@nowramp/form 0.1.83 → 0.1.85

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.js CHANGED
@@ -8,98 +8,98 @@
8
8
  }`;
9
9
  document.head.appendChild(s);
10
10
  })();
11
- import { jsx as e, jsxs as l, Fragment as ee } from "react/jsx-runtime";
12
- import ge, { useState as N, useRef as I, useCallback as P, useEffect as Z, useMemo as j, useReducer as xa, useContext as va, createContext as ba } from "react";
13
- import { RampApi as at } from "@nowramp/sdk";
11
+ import { jsx as e, jsxs as i, Fragment as ae } from "react/jsx-runtime";
12
+ import Ce, { useState as A, useRef as M, useCallback as B, useEffect as Z, useMemo as j, useReducer as xa, useContext as va, createContext as ba } from "react";
13
+ import { RampApi as ot } from "@nowramp/sdk";
14
14
  import { createPortal as Pt } from "react-dom";
15
15
  function Sa(t, a, n) {
16
- const [r, o] = N(null), [d, u] = N(!0), [i, s] = N(null), m = I(null);
17
- (!m.current || m.current !== t) && (m.current = new at({ apiKey: "", ...t }));
18
- const h = P(async () => {
16
+ const [r, o] = A(null), [d, u] = A(!0), [l, c] = A(null), m = M(null);
17
+ (!m.current || m.current !== t) && (m.current = new ot({ apiKey: "", ...t }));
18
+ const p = B(async () => {
19
19
  if (!t.projectId) {
20
- s(new Error("projectId is required")), u(!1);
20
+ c(new Error("projectId is required")), u(!1);
21
21
  return;
22
22
  }
23
- u(!0), s(null);
23
+ u(!0), c(null);
24
24
  try {
25
25
  const f = {};
26
26
  a && (f.orderType = a), n && (f.country = n);
27
- const y = await m.current.getSupported(f);
28
- o(y);
27
+ const C = await m.current.getSupported(f);
28
+ o(C);
29
29
  } catch (f) {
30
- s(f instanceof Error ? f : new Error("Failed to fetch config"));
30
+ c(f instanceof Error ? f : new Error("Failed to fetch config"));
31
31
  } finally {
32
32
  u(!1);
33
33
  }
34
34
  }, [t.projectId, a, n]);
35
35
  return Z(() => {
36
- h();
37
- }, [h]), { config: r, loading: d, error: i, refetch: h };
36
+ p();
37
+ }, [p]), { config: r, loading: d, error: l, refetch: p };
38
38
  }
39
39
  function Na(t, a) {
40
- const [n, r] = N(null), [o, d] = N(!1), [u, i] = N(null), s = I(null), m = I(""), h = `${t.apiUrl}|${t.projectId}`;
41
- (!s.current || m.current !== h) && (s.current = new at({ apiKey: "", ...t }), m.current = h);
42
- const f = I(0);
40
+ const [n, r] = A(null), [o, d] = A(!1), [u, l] = A(null), c = M(null), m = M(""), p = `${t.apiUrl}|${t.projectId}`;
41
+ (!c.current || m.current !== p) && (c.current = new ot({ apiKey: "", ...t }), m.current = p);
42
+ const f = M(0);
43
43
  Z(() => {
44
- const x = ++f.current;
44
+ const S = ++f.current;
45
45
  if (!a || !t.projectId) {
46
46
  r(null), d(!1);
47
47
  return;
48
48
  }
49
- d(!0), i(null), s.current.getQuotes(a).then(
50
- (C) => {
51
- f.current === x && (r(C), d(!1));
49
+ d(!0), l(null), c.current.getQuotes(a).then(
50
+ (k) => {
51
+ f.current === S && (r(k), d(!1));
52
52
  },
53
- (C) => {
54
- f.current === x && (i(C instanceof Error ? C : new Error("Failed to fetch quotes")), r(null), d(!1));
53
+ (k) => {
54
+ f.current === S && (l(k instanceof Error ? k : new Error("Failed to fetch quotes")), r(null), d(!1));
55
55
  }
56
56
  );
57
57
  }, [t.projectId, a == null ? void 0 : a.fiatCurrency, a == null ? void 0 : a.fiatAmount, a == null ? void 0 : a.cryptoAmount, a == null ? void 0 : a.cryptoCurrency, a == null ? void 0 : a.network, a == null ? void 0 : a.paymentMethodId, a == null ? void 0 : a.country, a == null ? void 0 : a.orderType]);
58
- const y = P(async () => {
58
+ const C = B(async () => {
59
59
  if (!(!a || !t.projectId)) {
60
- d(!0), i(null);
60
+ d(!0), l(null);
61
61
  try {
62
- const x = await s.current.getQuotes(a);
63
- r(x);
64
- } catch (x) {
65
- i(x instanceof Error ? x : new Error("Failed to fetch quotes"));
62
+ const S = await c.current.getQuotes(a);
63
+ r(S);
64
+ } catch (S) {
65
+ l(S instanceof Error ? S : new Error("Failed to fetch quotes"));
66
66
  } finally {
67
67
  d(!1);
68
68
  }
69
69
  }
70
70
  }, [t.projectId, a]);
71
- return { quotes: n, loading: o, error: u, refetch: y };
71
+ return { quotes: n, loading: o, error: u, refetch: C };
72
72
  }
73
73
  function wa(t) {
74
- const [a, n] = N(null), [r, o] = N(!1), [d, u] = N(null), i = I(null), s = I(""), m = `${t.apiUrl}|${t.projectId}`;
75
- (!i.current || s.current !== m) && (i.current = new at({ apiKey: "", ...t }), s.current = m);
76
- const h = P(async (y) => {
74
+ const [a, n] = A(null), [r, o] = A(!1), [d, u] = A(null), l = M(null), c = M(""), m = `${t.apiUrl}|${t.projectId}`;
75
+ (!l.current || c.current !== m) && (l.current = new ot({ apiKey: "", ...t }), c.current = m);
76
+ const p = B(async (C) => {
77
77
  o(!0), u(null);
78
78
  try {
79
- const x = await i.current.createCheckoutIntent(y);
80
- return n(x), x;
81
- } catch (x) {
82
- const C = x instanceof Error ? x : new Error("Failed to create checkout intent");
83
- throw u(C), C;
79
+ const S = await l.current.createCheckoutIntent(C);
80
+ return n(S), S;
81
+ } catch (S) {
82
+ const k = S instanceof Error ? S : new Error("Failed to create checkout intent");
83
+ throw u(k), k;
84
84
  } finally {
85
85
  o(!1);
86
86
  }
87
- }, []), f = P(() => {
87
+ }, []), f = B(() => {
88
88
  n(null), u(null);
89
89
  }, []);
90
- return { order: a, loading: r, error: d, createOrder: h, reset: f };
90
+ return { order: a, loading: r, error: d, createOrder: p, reset: f };
91
91
  }
92
92
  function Ea(t, a, n) {
93
- const [r, o] = N(null), [d, u] = N(!1), [i, s] = N(null), m = I(null);
94
- m.current || (m.current = new at({ apiKey: "", projectId: "", ...t }));
95
- const h = P(async () => {
93
+ const [r, o] = A(null), [d, u] = A(!1), [l, c] = A(null), m = M(null);
94
+ m.current || (m.current = new ot({ apiKey: "", projectId: "", ...t }));
95
+ const p = B(async () => {
96
96
  if (a) {
97
- u(!0), s(null);
97
+ u(!0), c(null);
98
98
  try {
99
99
  const f = await m.current.getTransaction(a);
100
100
  o(f);
101
101
  } catch (f) {
102
- s(f instanceof Error ? f : new Error("Failed to fetch status"));
102
+ c(f instanceof Error ? f : new Error("Failed to fetch status"));
103
103
  } finally {
104
104
  u(!1);
105
105
  }
@@ -109,18 +109,18 @@ function Ea(t, a, n) {
109
109
  if (!a) return;
110
110
  const f = (n == null ? void 0 : n.initialDelay) ?? 0;
111
111
  if (f > 0) {
112
- const y = setTimeout(h, f);
113
- return () => clearTimeout(y);
112
+ const C = setTimeout(p, f);
113
+ return () => clearTimeout(C);
114
114
  }
115
- h();
116
- }, [h, a, n == null ? void 0 : n.initialDelay]), Z(() => {
115
+ p();
116
+ }, [p, a, n == null ? void 0 : n.initialDelay]), Z(() => {
117
117
  if (!a || !(n != null && n.pollInterval) || !r || ["completed", "failed", "cancelled", "expired", "refunded"].includes(r.status))
118
118
  return;
119
- const y = setInterval(h, n.pollInterval);
120
- return () => clearInterval(y);
121
- }, [a, n == null ? void 0 : n.pollInterval, r == null ? void 0 : r.status, h]), { status: r, loading: d, error: i, refetch: h };
119
+ const C = setInterval(p, n.pollInterval);
120
+ return () => clearInterval(C);
121
+ }, [a, n == null ? void 0 : n.pollInterval, r == null ? void 0 : r.status, p]), { status: r, loading: d, error: l, refetch: p };
122
122
  }
123
- const et = [
123
+ const nt = [
124
124
  { code: "ad", name: "Andorra", defaultFiat: "EUR" },
125
125
  { code: "ae", name: "United Arab Emirates", defaultFiat: "AED" },
126
126
  { code: "af", name: "Afghanistan", defaultFiat: "USD" },
@@ -313,21 +313,21 @@ const et = [
313
313
  { code: "zm", name: "Zambia", defaultFiat: "USD" },
314
314
  { code: "zw", name: "Zimbabwe", defaultFiat: "USD" }
315
315
  ], yt = Object.fromEntries(
316
- et.map((t) => [t.code, t])
316
+ nt.map((t) => [t.code, t])
317
317
  );
318
318
  function mt(t, a) {
319
319
  if (!t) return "USD";
320
320
  const n = yt[t.toLowerCase()], r = (n == null ? void 0 : n.defaultFiat) || "USD";
321
321
  return !a || a.length === 0 || a.includes(r) ? r : a.includes("USD") ? "USD" : a[0] || "USD";
322
322
  }
323
- const nt = !0;
324
- function Ct(t, a, n = nt) {
323
+ const it = !0;
324
+ function Ct(t, a, n = it) {
325
325
  return t === void 0 || a === void 0 ? n : t.length === 0 || a.length === 0 ? !1 : t.some((r) => a.includes(r));
326
326
  }
327
- function Aa(t, a, n = nt) {
327
+ function Aa(t, a, n = it) {
328
328
  return t.filter((r) => Ct(r.providers, a, n));
329
329
  }
330
- function Ra(t, a, n = nt) {
330
+ function Ra(t, a, n = it) {
331
331
  const r = [];
332
332
  for (const o of t) {
333
333
  const d = o.networks.filter(
@@ -339,7 +339,7 @@ function Ra(t, a, n = nt) {
339
339
  }
340
340
  return r;
341
341
  }
342
- function ka(t, a, n, r = nt) {
342
+ function ka(t, a, n, r = it) {
343
343
  return n ? t.filter(
344
344
  (o) => o.supportedFiats.includes(n) && Ct(o.providers, a, r)
345
345
  ) : [];
@@ -349,63 +349,63 @@ function Ta(t, a, n) {
349
349
  let o = !1;
350
350
  if (!n.cryptoLocked && !n.networkLocked) {
351
351
  if (!(t.cryptoCurrency && a.availableCryptos.some(
352
- (i) => i.code === t.cryptoCurrency && i.networks.some((s) => s.id === t.network)
352
+ (l) => l.code === t.cryptoCurrency && l.networks.some((c) => c.id === t.network)
353
353
  )) && a.availableCryptos.length > 0) {
354
- const i = a.availableCryptos[0], s = i.networks.find((m) => m.isDefault) || i.networks[0];
355
- i.code !== t.cryptoCurrency && (r.cryptoCurrency = i.code, o = !0), s && s.id !== t.network && (r.network = s.id, o = !0);
354
+ const l = a.availableCryptos[0], c = l.networks.find((m) => m.isDefault) || l.networks[0];
355
+ l.code !== t.cryptoCurrency && (r.cryptoCurrency = l.code, o = !0), c && c.id !== t.network && (r.network = c.id, o = !0);
356
356
  }
357
357
  } else if (!n.cryptoLocked && n.networkLocked) {
358
358
  if (!(t.cryptoCurrency && a.availableCryptos.some(
359
- (i) => i.code === t.cryptoCurrency && i.networks.some((s) => s.id === t.network)
359
+ (l) => l.code === t.cryptoCurrency && l.networks.some((c) => c.id === t.network)
360
360
  ))) {
361
- const i = a.availableCryptos.find(
362
- (s) => s.networks.some((m) => m.id === t.network)
361
+ const l = a.availableCryptos.find(
362
+ (c) => c.networks.some((m) => m.id === t.network)
363
363
  );
364
- i && i.code !== t.cryptoCurrency && (r.cryptoCurrency = i.code, o = !0);
364
+ l && l.code !== t.cryptoCurrency && (r.cryptoCurrency = l.code, o = !0);
365
365
  }
366
366
  } else if (n.cryptoLocked && !n.networkLocked) {
367
367
  const u = a.availableCryptos.find(
368
- (i) => i.code === t.cryptoCurrency
368
+ (l) => l.code === t.cryptoCurrency
369
369
  );
370
370
  if (u && !u.networks.some(
371
- (s) => s.id === t.network
371
+ (c) => c.id === t.network
372
372
  ) && u.networks.length > 0) {
373
- const s = u.networks.find((m) => m.isDefault) || u.networks[0];
374
- s.id !== t.network && (r.network = s.id, o = !0);
373
+ const c = u.networks.find((m) => m.isDefault) || u.networks[0];
374
+ c.id !== t.network && (r.network = c.id, o = !0);
375
375
  }
376
376
  }
377
- if (!n.fiatLocked && !(t.fiatCurrency && a.availableFiats.some((i) => i.code === t.fiatCurrency)) && a.availableFiats.length > 0) {
378
- const s = a.availableFiats.find((m) => m.code === "USD") || a.availableFiats[0];
379
- s.code !== t.fiatCurrency && (r.fiatCurrency = s.code, o = !0);
377
+ if (!n.fiatLocked && !(t.fiatCurrency && a.availableFiats.some((l) => l.code === t.fiatCurrency)) && a.availableFiats.length > 0) {
378
+ const c = a.availableFiats.find((m) => m.code === "USD") || a.availableFiats[0];
379
+ c.code !== t.fiatCurrency && (r.fiatCurrency = c.code, o = !0);
380
380
  }
381
381
  if (!(t.paymentMethodId && a.availablePaymentMethods.some(
382
382
  (u) => u.id === t.paymentMethodId
383
383
  )) && a.availablePaymentMethods.length > 0) {
384
- const i = a.availablePaymentMethods.find(
385
- (s) => s.id.includes("card") || s.id.includes("debit")
384
+ const l = a.availablePaymentMethods.find(
385
+ (c) => c.id.includes("card") || c.id.includes("debit")
386
386
  ) || a.availablePaymentMethods[0];
387
- i.id !== t.paymentMethodId && (r.paymentMethodId = i.id, o = !0);
387
+ l.id !== t.paymentMethodId && (r.paymentMethodId = l.id, o = !0);
388
388
  }
389
389
  return o ? r : null;
390
390
  }
391
391
  function La(t, a, n, r) {
392
392
  var o, d, u;
393
393
  if (n.cryptoLocked) {
394
- const i = (o = t.cryptos) == null ? void 0 : o.find(
394
+ const l = (o = t.cryptos) == null ? void 0 : o.find(
395
395
  (m) => m.code === a.cryptoCurrency
396
396
  );
397
- if (!i) return !0;
398
- const s = (d = i.networks) == null ? void 0 : d.find((m) => m.id === a.network);
399
- if (!s || s.providers !== void 0 && s.providers.length === 0 || s.providers !== void 0 && (r.availableFiats.length === 0 || r.availablePaymentMethods.length === 0))
397
+ if (!l) return !0;
398
+ const c = (d = l.networks) == null ? void 0 : d.find((m) => m.id === a.network);
399
+ if (!c || c.providers !== void 0 && c.providers.length === 0 || c.providers !== void 0 && (r.availableFiats.length === 0 || r.availablePaymentMethods.length === 0))
400
400
  return !0;
401
401
  }
402
402
  if (n.networkLocked && !n.cryptoLocked && !r.availableCryptos.some(
403
- (s) => s.networks.some((m) => m.id === a.network)
403
+ (c) => c.networks.some((m) => m.id === a.network)
404
404
  ))
405
405
  return !0;
406
406
  if (n.fiatLocked) {
407
- const i = (u = t.fiats) == null ? void 0 : u.find((s) => s.code === a.fiatCurrency);
408
- if (!i || i.providers !== void 0 && i.providers.length === 0 || i.providers !== void 0 && r.availableCryptos.length === 0)
407
+ const l = (u = t.fiats) == null ? void 0 : u.find((c) => c.code === a.fiatCurrency);
408
+ if (!l || l.providers !== void 0 && l.providers.length === 0 || l.providers !== void 0 && r.availableCryptos.length === 0)
409
409
  return !0;
410
410
  }
411
411
  return !1;
@@ -433,7 +433,7 @@ function Da(t) {
433
433
  const a = t.toLowerCase();
434
434
  return /amount|out of range for|minimum|maximum/.test(a) ? 1 : /currency|pair|network|chain/.test(a) ? 2 : /country|region|location/.test(a) ? 3 : /does not support|unsupported/.test(a) ? 4 : 5;
435
435
  }
436
- const Qt = {
436
+ const Ia = ["completed", "failed", "cancelled", "expired", "refunded"], Qt = {
437
437
  step: "amount",
438
438
  flowType: "buy",
439
439
  fiatCurrency: "USD",
@@ -453,7 +453,7 @@ const Qt = {
453
453
  errorMessage: null
454
454
  };
455
455
  function Ma(t, a) {
456
- var n, r, o, d, u, i, s, m;
456
+ var n, r, o, d, u, l, c, m;
457
457
  switch (a.type) {
458
458
  case "SET_STEP":
459
459
  return { ...t, step: a.step, errorMessage: null };
@@ -465,7 +465,7 @@ function Ma(t, a) {
465
465
  cryptoAmount: "",
466
466
  fiatCurrency: (r = (n = a.fieldLocks) == null ? void 0 : n.sourceCurrency) != null && r.locked ? t.fiatCurrency : "",
467
467
  cryptoCurrency: (d = (o = a.fieldLocks) == null ? void 0 : o.destinationCurrency) != null && d.locked ? t.cryptoCurrency : "",
468
- network: (i = (u = a.fieldLocks) == null ? void 0 : u.network) != null && i.locked || (m = (s = a.fieldLocks) == null ? void 0 : s.destinationCurrency) != null && m.locked ? t.network : "",
468
+ network: (l = (u = a.fieldLocks) == null ? void 0 : u.network) != null && l.locked || (m = (c = a.fieldLocks) == null ? void 0 : c.destinationCurrency) != null && m.locked ? t.network : "",
469
469
  paymentMethodId: "",
470
470
  selectedQuote: null,
471
471
  selectedProvider: null,
@@ -514,295 +514,298 @@ function Ma(t, a) {
514
514
  }
515
515
  }
516
516
  const zt = ba(null);
517
- function Ia({
518
- projectId: t,
519
- apiUrl: a = "https://api.nowramp.com",
520
- assetBaseUrl: n = "",
521
- flowType: r = "buy",
522
- customerId: o = "",
523
- brandId: d,
524
- defaultFiatCurrency: u = "USD",
525
- defaultCryptoCurrency: i = "BTC",
526
- defaultNetwork: s = "",
527
- defaultFiatAmount: m = "",
528
- defaultCryptoAmount: h = "",
529
- defaultWalletAddress: f = "",
530
- defaultGateway: y,
531
- defaultCountry: x,
532
- fieldLocks: C,
533
- statusPollInterval: E = 5e3,
534
- onComplete: k,
535
- onError: _,
536
- children: ie
537
- }) {
538
- const G = j(() => ({ apiUrl: a, projectId: t }), [a, t]), z = s || (i ? i.toLowerCase() : ""), te = r === "sell", X = te ? !!h : !!m, v = (te ? !!(X && i && z) : !!(X && i && z && f)) && y ? "confirm" : "amount", L = m || (r === "buy" ? "250" : ""), [c, U] = xa(Ma, {
517
+ function Ba(t) {
518
+ const a = M(t.defaultFiatCurrency !== void 0), {
519
+ projectId: n,
520
+ apiUrl: r = "https://api.nowramp.com",
521
+ assetBaseUrl: o = "",
522
+ flowType: d = "buy",
523
+ customerId: u = "",
524
+ brandId: l,
525
+ defaultFiatCurrency: c = "USD",
526
+ defaultCryptoCurrency: m = "BTC",
527
+ defaultNetwork: p = "",
528
+ defaultFiatAmount: f = "",
529
+ defaultCryptoAmount: C = "",
530
+ defaultWalletAddress: S = "",
531
+ defaultGateway: k,
532
+ defaultCountry: w,
533
+ fieldLocks: y,
534
+ partnerMetadata: O,
535
+ statusPollInterval: le = 5e3,
536
+ onComplete: G,
537
+ onError: z,
538
+ children: ce
539
+ } = t, _ = j(() => ({ apiUrl: r, projectId: n }), [r, n]), ne = p || (m ? m.toLowerCase() : ""), g = d === "sell", T = g ? !!C : !!f, xe = (g ? !!(T && m && ne) : !!(T && m && ne && S)) && k ? "confirm" : "amount", F = f || (d === "buy" ? "250" : ""), [s, L] = xa(Ma, {
539
540
  ...Qt,
540
- step: v,
541
- flowType: r,
542
- fiatCurrency: u,
543
- cryptoCurrency: i,
544
- network: z,
545
- fiatAmount: Kt(L, 2),
546
- cryptoAmount: Kt(h, 6),
547
- walletAddress: f,
548
- customerId: o,
541
+ step: xe,
542
+ flowType: d,
543
+ fiatCurrency: c,
544
+ cryptoCurrency: m,
545
+ network: ne,
546
+ fiatAmount: Kt(F, 2),
547
+ cryptoAmount: Kt(C, 6),
548
+ walletAddress: S,
549
+ customerId: u,
549
550
  // If defaultCountry is provided, set it immediately with 'manual' source to skip auto-detection
550
- ...x ? { country: x.toLowerCase(), countrySource: "manual" } : {}
551
- }), w = c.flowType === "sell", {
551
+ ...w ? { country: w.toLowerCase(), countrySource: "manual" } : {}
552
+ }), W = s.flowType === "sell", {
552
553
  config: b,
553
- loading: J,
554
- error: be
555
- } = Sa(G, c.flowType, c.country || void 0), Se = I(!1);
556
- ge.useEffect(() => {
557
- var F;
558
- if (Se.current || !(b != null && b.detectedCountry) || c.country) return;
559
- Se.current = !0;
560
- const p = b.detectedCountry.toLowerCase();
561
- U({ type: "SET_COUNTRY_AUTO", country: p });
562
- const A = (F = b.fiats) == null ? void 0 : F.map((M) => M.code), R = mt(p, A);
563
- R !== c.fiatCurrency && U({ type: "SET_FIAT_CURRENCY", currency: R });
564
- }, [b, c.country, c.fiatCurrency]);
565
- const se = I(!1);
566
- ge.useEffect(() => {
554
+ loading: ee,
555
+ error: ue
556
+ } = Sa(_, s.flowType, s.country || void 0), I = M(!1);
557
+ Ce.useEffect(() => {
558
+ var R, D;
559
+ if (I.current || !(b != null && b.detectedCountry) || s.country) return;
560
+ I.current = !0;
561
+ const h = b.detectedCountry.toLowerCase();
562
+ L({ type: "SET_COUNTRY_AUTO", country: h });
563
+ const v = (R = b.fiats) == null ? void 0 : R.map((U) => U.code), N = mt(h, v);
564
+ N !== s.fiatCurrency && !((D = y == null ? void 0 : y.sourceCurrency) != null && D.locked) && !a.current && L({ type: "SET_FIAT_CURRENCY", currency: N });
565
+ }, [b, s.country, s.fiatCurrency, y]);
566
+ const ve = M(!1);
567
+ Ce.useEffect(() => {
568
+ var N, R;
569
+ if (ve.current || !w || !((N = b == null ? void 0 : b.fiats) != null && N.length)) return;
570
+ ve.current = !0;
571
+ const h = b.fiats.map((D) => D.code), v = mt(w, h);
572
+ v !== s.fiatCurrency && !((R = y == null ? void 0 : y.sourceCurrency) != null && R.locked) && !a.current && L({ type: "SET_FIAT_CURRENCY", currency: v });
573
+ }, [w, b, s.fiatCurrency, y]);
574
+ const Y = M(s.country);
575
+ Ce.useEffect(() => {
576
+ var N, R;
577
+ if (s.country === Y.current || (Y.current = s.country, s.countrySource === "manual" && (Ne.current = !1), s.countrySource !== "manual") || !((N = b == null ? void 0 : b.fiats) != null && N.length)) return;
578
+ const h = b.fiats.map((D) => D.code), v = mt(s.country, h);
579
+ v !== s.fiatCurrency && !((R = y == null ? void 0 : y.sourceCurrency) != null && R.locked) && L({ type: "SET_FIAT_CURRENCY", currency: v });
580
+ }, [s.country, s.countrySource, b, s.fiatCurrency, y]);
581
+ const ke = M(s.fiatCurrency);
582
+ Ce.useEffect(() => {
567
583
  var R;
568
- if (se.current || !x || !((R = b == null ? void 0 : b.fiats) != null && R.length)) return;
569
- se.current = !0;
570
- const p = b.fiats.map((F) => F.code), A = mt(x, p);
571
- A !== c.fiatCurrency && U({ type: "SET_FIAT_CURRENCY", currency: A });
572
- }, [x, b, c.fiatCurrency]);
573
- const pe = I(c.country);
574
- ge.useEffect(() => {
575
- var R;
576
- if (c.country === pe.current || (pe.current = c.country, c.countrySource === "manual" && (Ie.current = !1), c.countrySource !== "manual") || !((R = b == null ? void 0 : b.fiats) != null && R.length)) return;
577
- const p = b.fiats.map((F) => F.code), A = mt(c.country, p);
578
- A !== c.fiatCurrency && U({ type: "SET_FIAT_CURRENCY", currency: A });
579
- }, [c.country, c.countrySource, b, c.fiatCurrency]);
580
- const D = I(c.fiatCurrency);
581
- ge.useEffect(() => {
582
- var F;
583
- if (c.fiatCurrency === D.current || (D.current = c.fiatCurrency, w || !((F = b == null ? void 0 : b.fiats) != null && F.length) || !c.fiatAmount)) return;
584
- const p = b.fiats.find((M) => M.code === c.fiatCurrency);
585
- if (!(p != null && p.minAmount)) return;
586
- const A = parseFloat(c.fiatAmount), R = parseFloat(p.minAmount);
587
- !isNaN(A) && !isNaN(R) && A < R && U({ type: "SET_FIAT_AMOUNT", amount: String(Math.ceil(R)) });
588
- }, [c.fiatCurrency, c.fiatAmount, b, w]);
589
- const { availableFiats: ae, availableCryptos: O, availablePaymentMethods: de } = j(() => {
590
- var R, F, M;
584
+ if (s.fiatCurrency === ke.current || (ke.current = s.fiatCurrency, W || !((R = b == null ? void 0 : b.fiats) != null && R.length) || !s.fiatAmount)) return;
585
+ const h = b.fiats.find((D) => D.code === s.fiatCurrency);
586
+ if (!(h != null && h.minAmount)) return;
587
+ const v = parseFloat(s.fiatAmount), N = parseFloat(h.minAmount);
588
+ !isNaN(v) && !isNaN(N) && v < N && L({ type: "SET_FIAT_AMOUNT", amount: String(Math.ceil(N)) });
589
+ }, [s.fiatCurrency, s.fiatAmount, b, W]);
590
+ const { availableFiats: se, availableCryptos: Q, availablePaymentMethods: te } = j(() => {
591
+ var N, R, D;
591
592
  if (!b)
592
593
  return { availableFiats: [], availableCryptos: [], availablePaymentMethods: [] };
593
- let p;
594
- if (c.cryptoCurrency && c.network) {
595
- const T = (R = b.cryptos) == null ? void 0 : R.find((Y) => Y.code === c.cryptoCurrency), H = (F = T == null ? void 0 : T.networks) == null ? void 0 : F.find((Y) => Y.id === c.network);
596
- !T || !H ? p = [] : p = H.providers;
594
+ let h;
595
+ if (s.cryptoCurrency && s.network) {
596
+ const U = (N = b.cryptos) == null ? void 0 : N.find((fe) => fe.code === s.cryptoCurrency), J = (R = U == null ? void 0 : U.networks) == null ? void 0 : R.find((fe) => fe.id === s.network);
597
+ !U || !J ? h = [] : h = J.providers;
597
598
  }
598
- let A;
599
- if (c.fiatCurrency) {
600
- const T = (M = b.fiats) == null ? void 0 : M.find((H) => H.code === c.fiatCurrency);
601
- T ? A = T.providers : A = [];
599
+ let v;
600
+ if (s.fiatCurrency) {
601
+ const U = (D = b.fiats) == null ? void 0 : D.find((J) => J.code === s.fiatCurrency);
602
+ U ? v = U.providers : v = [];
602
603
  }
603
604
  return {
604
- availableFiats: Aa(b.fiats ?? [], p),
605
- availableCryptos: Ra(b.cryptos ?? [], A),
605
+ availableFiats: Aa(b.fiats ?? [], h),
606
+ availableCryptos: Ra(b.cryptos ?? [], v),
606
607
  availablePaymentMethods: ka(
607
608
  b.paymentMethods ?? [],
608
- p,
609
- c.fiatCurrency
609
+ h,
610
+ s.fiatCurrency
610
611
  )
611
612
  };
612
- }, [b, c.cryptoCurrency, c.network, c.fiatCurrency]), Me = j(() => {
613
- var p, A, R;
614
- return J || !b ? !1 : La(
613
+ }, [b, s.cryptoCurrency, s.network, s.fiatCurrency]), de = j(() => {
614
+ var h, v, N;
615
+ return ee || !b ? !1 : La(
615
616
  b,
616
- { cryptoCurrency: c.cryptoCurrency, network: c.network, fiatCurrency: c.fiatCurrency },
617
+ { cryptoCurrency: s.cryptoCurrency, network: s.network, fiatCurrency: s.fiatCurrency },
617
618
  {
618
- cryptoLocked: !!((p = C == null ? void 0 : C.destinationCurrency) != null && p.locked),
619
- networkLocked: !!((A = C == null ? void 0 : C.network) != null && A.locked),
620
- fiatLocked: !!((R = C == null ? void 0 : C.sourceCurrency) != null && R.locked)
619
+ cryptoLocked: !!((h = y == null ? void 0 : y.destinationCurrency) != null && h.locked),
620
+ networkLocked: !!((v = y == null ? void 0 : y.network) != null && v.locked),
621
+ fiatLocked: !!((N = y == null ? void 0 : y.sourceCurrency) != null && N.locked)
621
622
  },
622
- { availableFiats: ae, availableCryptos: O, availablePaymentMethods: de }
623
+ { availableFiats: se, availableCryptos: Q, availablePaymentMethods: te }
623
624
  );
624
625
  }, [
625
- J,
626
+ ee,
626
627
  b,
627
- C,
628
- c.cryptoCurrency,
629
- c.network,
630
- c.fiatCurrency,
631
- ae,
632
- O,
633
- de
628
+ y,
629
+ s.cryptoCurrency,
630
+ s.network,
631
+ s.fiatCurrency,
632
+ se,
633
+ Q,
634
+ te
634
635
  ]);
635
- ge.useEffect(() => {
636
- var A, R, F;
637
- if (J || ae.length === 0 && O.length === 0) return;
638
- const p = Ta(
636
+ Ce.useEffect(() => {
637
+ var v, N, R;
638
+ if (ee || se.length === 0 && Q.length === 0) return;
639
+ const h = Ta(
639
640
  {
640
- cryptoCurrency: c.cryptoCurrency,
641
- network: c.network,
642
- fiatCurrency: c.fiatCurrency,
643
- paymentMethodId: c.paymentMethodId
641
+ cryptoCurrency: s.cryptoCurrency,
642
+ network: s.network,
643
+ fiatCurrency: s.fiatCurrency,
644
+ paymentMethodId: s.paymentMethodId
644
645
  },
645
- { availableFiats: ae, availableCryptos: O, availablePaymentMethods: de },
646
+ { availableFiats: se, availableCryptos: Q, availablePaymentMethods: te },
646
647
  {
647
- cryptoLocked: !!((A = C == null ? void 0 : C.destinationCurrency) != null && A.locked),
648
- networkLocked: !!((R = C == null ? void 0 : C.network) != null && R.locked),
649
- fiatLocked: !!((F = C == null ? void 0 : C.sourceCurrency) != null && F.locked)
648
+ cryptoLocked: !!((v = y == null ? void 0 : y.destinationCurrency) != null && v.locked),
649
+ networkLocked: !!((N = y == null ? void 0 : y.network) != null && N.locked),
650
+ fiatLocked: !!((R = y == null ? void 0 : y.sourceCurrency) != null && R.locked)
650
651
  }
651
652
  );
652
- p && (p.cryptoCurrency !== void 0 && U({ type: "SET_CRYPTO_CURRENCY", currency: p.cryptoCurrency }), p.network !== void 0 && U({ type: "SET_NETWORK", network: p.network }), p.fiatCurrency !== void 0 && U({ type: "SET_FIAT_CURRENCY", currency: p.fiatCurrency }), p.paymentMethodId !== void 0 && U({ type: "SET_PAYMENT_METHOD", methodId: p.paymentMethodId }));
653
+ h && (h.cryptoCurrency !== void 0 && L({ type: "SET_CRYPTO_CURRENCY", currency: h.cryptoCurrency }), h.network !== void 0 && L({ type: "SET_NETWORK", network: h.network }), h.fiatCurrency !== void 0 && L({ type: "SET_FIAT_CURRENCY", currency: h.fiatCurrency }), h.paymentMethodId !== void 0 && L({ type: "SET_PAYMENT_METHOD", methodId: h.paymentMethodId }));
653
654
  }, [
654
- J,
655
- ae,
656
- O,
657
- de,
658
- c.cryptoCurrency,
659
- c.network,
660
- c.fiatCurrency,
661
- c.paymentMethodId,
662
- C,
663
- U
655
+ ee,
656
+ se,
657
+ Q,
658
+ te,
659
+ s.cryptoCurrency,
660
+ s.network,
661
+ s.fiatCurrency,
662
+ s.paymentMethodId,
663
+ y,
664
+ L
664
665
  ]);
665
- const Q = j(() => {
666
- if (w) {
667
- if (!c.cryptoAmount) return null;
668
- const M = parseFloat(c.cryptoAmount);
669
- return isNaN(M) || M <= 0 ? "Enter a valid amount" : null;
666
+ const ye = j(() => {
667
+ if (W) {
668
+ if (!s.cryptoAmount) return null;
669
+ const D = parseFloat(s.cryptoAmount);
670
+ return isNaN(D) || D <= 0 ? "Enter a valid amount" : null;
670
671
  }
671
- if (!b || !c.fiatAmount) return null;
672
- const p = parseFloat(c.fiatAmount);
673
- if (isNaN(p)) return null;
674
- const A = b.fiats.find((M) => M.code === c.fiatCurrency);
675
- if (!A) return null;
676
- const R = parseFloat(A.minAmount), F = parseFloat(A.maxAmount);
677
- return !isNaN(R) && p < R ? `Minimum amount is ${A.minAmount} ${c.fiatCurrency}` : !isNaN(F) && p > F ? `Maximum amount is ${A.maxAmount} ${c.fiatCurrency}` : null;
678
- }, [b, c.fiatAmount, c.fiatCurrency, c.cryptoAmount, w]), ne = j(() => {
679
- const p = w ? !!c.cryptoAmount : !!c.fiatAmount;
680
- return !b || !p || !c.fiatCurrency || !c.cryptoCurrency || !c.network || Q || b.detectedCountry && c.countrySource === "" && !x ? null : {
681
- fiatCurrency: c.fiatCurrency,
682
- ...w ? { cryptoAmount: c.cryptoAmount } : { fiatAmount: c.fiatAmount },
683
- cryptoCurrency: c.cryptoCurrency,
684
- network: c.network,
685
- paymentMethodId: c.paymentMethodId || void 0,
686
- country: c.country || void 0,
687
- orderType: c.flowType
672
+ if (!b || !s.fiatAmount) return null;
673
+ const h = parseFloat(s.fiatAmount);
674
+ if (isNaN(h)) return null;
675
+ const v = b.fiats.find((D) => D.code === s.fiatCurrency);
676
+ if (!v) return null;
677
+ const N = parseFloat(v.minAmount), R = parseFloat(v.maxAmount);
678
+ return !isNaN(N) && h < N ? `Minimum amount is ${v.minAmount} ${s.fiatCurrency}` : !isNaN(R) && h > R ? `Maximum amount is ${v.maxAmount} ${s.fiatCurrency}` : null;
679
+ }, [b, s.fiatAmount, s.fiatCurrency, s.cryptoAmount, W]), re = j(() => {
680
+ const h = W ? !!s.cryptoAmount : !!s.fiatAmount;
681
+ return !b || !h || !s.fiatCurrency || !s.cryptoCurrency || !s.network || ye || b.detectedCountry && s.countrySource === "" && !w ? null : {
682
+ fiatCurrency: s.fiatCurrency,
683
+ ...W ? { cryptoAmount: s.cryptoAmount } : { fiatAmount: s.fiatAmount },
684
+ cryptoCurrency: s.cryptoCurrency,
685
+ network: s.network,
686
+ paymentMethodId: s.paymentMethodId || void 0,
687
+ country: s.country || void 0,
688
+ orderType: s.flowType
688
689
  };
689
- }, [b, c.fiatCurrency, c.fiatAmount, c.cryptoAmount, c.cryptoCurrency, c.network, c.paymentMethodId, c.country, c.countrySource, Q, w, c.flowType, x]), {
690
- quotes: B,
691
- loading: Re,
692
- error: le,
693
- refetch: We
694
- } = Na(G, ne), ke = Ua(Re, B, ne), Ie = I(!1);
695
- ge.useEffect(() => {
696
- Ie.current || c.countrySource === "auto" && (Re || !ne || le || !B || B.bestQuote || c.fiatCurrency !== "USD" && (Ie.current = !0, U({ type: "SET_FIAT_CURRENCY", currency: "USD" }), U({ type: "SET_FIAT_AMOUNT", amount: "250" })));
697
- }, [B, Re, le, ne, c.countrySource, c.fiatCurrency]);
690
+ }, [b, s.fiatCurrency, s.fiatAmount, s.cryptoAmount, s.cryptoCurrency, s.network, s.paymentMethodId, s.country, s.countrySource, ye, W, s.flowType, w]), {
691
+ quotes: $,
692
+ loading: be,
693
+ error: Oe,
694
+ refetch: Se
695
+ } = Na(_, re), H = Ua(be, $, re), Ne = M(!1);
696
+ Ce.useEffect(() => {
697
+ var h;
698
+ Ne.current || s.countrySource === "auto" && ((h = y == null ? void 0 : y.sourceCurrency) != null && h.locked || a.current || be || !re || Oe || !$ || $.bestQuote || s.fiatCurrency !== "USD" && (Ne.current = !0, L({ type: "SET_FIAT_CURRENCY", currency: "USD" }), L({ type: "SET_FIAT_AMOUNT", amount: "250" })));
699
+ }, [$, be, Oe, re, s.countrySource, s.fiatCurrency]);
698
700
  const {
699
- order: ce,
700
- loading: $,
701
- error: Ne,
702
- createOrder: Be
703
- } = wa(G), Xe = 15e3, {
704
- status: re,
705
- loading: rt
701
+ order: we,
702
+ loading: $e,
703
+ error: Te,
704
+ createOrder: Xe
705
+ } = wa(_), Ye = 15e3, {
706
+ status: P,
707
+ loading: Ze
706
708
  } = Ea(
707
- { apiUrl: a },
708
- (ce == null ? void 0 : ce.orderId) ?? null,
709
- { pollInterval: E, initialDelay: Xe }
710
- );
711
- ge.useEffect(() => {
712
- (re == null ? void 0 : re.status) === "completed" && k && k(re);
713
- }, [re == null ? void 0 : re.status, k]), ge.useEffect(() => {
714
- const p = be || Ne;
715
- p && _ && _(p);
716
- }, [be, Ne, _]);
717
- const ye = y || (b == null ? void 0 : b.defaultGateway) || null, Oe = j(() => {
718
- if (!ke || !(B != null && B.unavailableGateways)) return null;
719
- const p = B.preferredGatewayId || ye;
720
- return Fa(B.unavailableGateways, p);
721
- }, [ke, B, ye]), He = I(ye);
722
- He.current = ye;
723
- const Ye = I(B);
724
- Ye.current = B;
725
- const ue = I(d);
726
- ue.current = d;
727
- const Pe = P(async () => {
728
- var A, R, F;
729
- const p = ((A = c.selectedQuote) == null ? void 0 : A.gatewayId) || ((F = (R = Ye.current) == null ? void 0 : R.bestQuote) == null ? void 0 : F.gatewayId) || He.current;
730
- if (!p || !c.walletAddress) {
731
- const M = [!p && "gateway", !c.walletAddress && "walletAddress"].filter(Boolean).join(", ");
732
- U({ type: "SET_ERROR", message: `Missing required fields: ${M}` });
709
+ { apiUrl: r },
710
+ (we == null ? void 0 : we.orderId) ?? null,
711
+ { pollInterval: le, initialDelay: Ye }
712
+ ), Qe = M(null);
713
+ Ce.useEffect(() => {
714
+ !(P != null && P.status) || !G || Ia.includes(P.status) && Qe.current !== P.orderId && (Qe.current = P.orderId, G(P));
715
+ }, [P == null ? void 0 : P.status, P == null ? void 0 : P.orderId, G]), Ce.useEffect(() => {
716
+ const h = ue || Te;
717
+ h && z && z(h);
718
+ }, [ue, Te, z]);
719
+ const oe = k || (b == null ? void 0 : b.defaultGateway) || null, He = j(() => {
720
+ if (!H || !($ != null && $.unavailableGateways)) return null;
721
+ const h = $.preferredGatewayId || oe;
722
+ return Fa($.unavailableGateways, h);
723
+ }, [H, $, oe]), ze = M(oe);
724
+ ze.current = oe;
725
+ const Je = M($);
726
+ Je.current = $;
727
+ const Le = M(l);
728
+ Le.current = l;
729
+ const me = B(async () => {
730
+ var v, N, R;
731
+ const h = ((v = s.selectedQuote) == null ? void 0 : v.gatewayId) || ((R = (N = Je.current) == null ? void 0 : N.bestQuote) == null ? void 0 : R.gatewayId) || ze.current;
732
+ if (!h || !s.walletAddress) {
733
+ const D = [!h && "gateway", !s.walletAddress && "walletAddress"].filter(Boolean).join(", ");
734
+ L({ type: "SET_ERROR", message: `Missing required fields: ${D}` });
733
735
  return;
734
736
  }
735
737
  try {
736
- await Be({
737
- gateway: p,
738
- customerId: c.customerId || void 0,
739
- fiatCurrency: c.fiatCurrency,
740
- ...w ? { cryptoAmount: c.cryptoAmount } : { fiatAmount: c.fiatAmount },
741
- cryptoCurrency: c.cryptoCurrency,
742
- network: c.network,
743
- walletAddress: c.walletAddress,
744
- paymentMethodId: c.paymentMethodId || void 0,
745
- email: c.email || void 0,
746
- orderType: c.flowType,
747
- ...ue.current ? { metadata: { brand: ue.current } } : {}
748
- }), U({ type: "SET_STEP", step: "checkout" });
749
- } catch (M) {
750
- const T = M instanceof Error ? M.message : "Failed to create order";
751
- /wallet|address/i.test(T) ? U({ type: "SET_WALLET_ERROR", message: T.replace(/^Failed to create checkout intent:\s*/i, "") }) : U({ type: "SET_ERROR", message: T });
738
+ await Xe({
739
+ gateway: h,
740
+ customerId: s.customerId || void 0,
741
+ fiatCurrency: s.fiatCurrency,
742
+ ...W ? { cryptoAmount: s.cryptoAmount } : { fiatAmount: s.fiatAmount },
743
+ cryptoCurrency: s.cryptoCurrency,
744
+ network: s.network,
745
+ walletAddress: s.walletAddress,
746
+ paymentMethodId: s.paymentMethodId || void 0,
747
+ email: s.email || void 0,
748
+ orderType: s.flowType,
749
+ ...Le.current ? { metadata: { brand: Le.current } } : {},
750
+ ...O && Object.keys(O).length > 0 ? { partnerMetadata: O } : {}
751
+ }), L({ type: "SET_STEP", step: "checkout" });
752
+ } catch (D) {
753
+ const U = D instanceof Error ? D.message : "Failed to create order";
754
+ /wallet|address/i.test(U) ? L({ type: "SET_WALLET_ERROR", message: U.replace(/^Failed to create checkout intent:\s*/i, "") }) : L({ type: "SET_ERROR", message: U });
752
755
  }
753
- }, [c, Be, w]), ot = P((p) => {
754
- U({ type: "SET_STEP", step: p });
755
- }, []), it = P(() => {
756
- const p = ["confirm", "amount", "quotes", "wallet", "checkout", "processing", "complete"], A = p.indexOf(c.step);
757
- A > 0 && U({ type: "SET_STEP", step: p[A - 1] });
758
- }, [c.step, w]), Ze = j(() => {
759
- const p = w ? !!c.cryptoAmount : !!c.fiatAmount;
760
- switch (c.step) {
756
+ }, [s, Xe, W, O]), Ue = B((h) => {
757
+ L({ type: "SET_STEP", step: h });
758
+ }, []), lt = B(() => {
759
+ const h = ["confirm", "amount", "quotes", "wallet", "checkout", "processing", "complete"], v = h.indexOf(s.step);
760
+ v > 0 && L({ type: "SET_STEP", step: h[v - 1] });
761
+ }, [s.step, W]), Pe = j(() => {
762
+ const h = W ? !!s.cryptoAmount : !!s.fiatAmount;
763
+ switch (s.step) {
761
764
  case "confirm":
762
- return !!(p && c.cryptoCurrency && c.network && c.walletAddress && !Q);
765
+ return !!(h && s.cryptoCurrency && s.network && s.walletAddress && !ye);
763
766
  case "amount":
764
- return !!(p && c.cryptoCurrency && c.network && !Q);
767
+ return !!(h && s.cryptoCurrency && s.network && !ye);
765
768
  case "quotes":
766
- return !!c.selectedQuote;
769
+ return !!s.selectedQuote;
767
770
  case "wallet":
768
- return !!c.walletAddress;
771
+ return !!s.walletAddress;
769
772
  default:
770
773
  return !1;
771
774
  }
772
- }, [c, Q, w]), me = {
773
- apiConfig: G,
774
- assetBaseUrl: n,
775
+ }, [s, ye, W]), Ke = {
776
+ apiConfig: _,
777
+ assetBaseUrl: o,
775
778
  config: b,
776
- configLoading: J,
777
- configError: be,
778
- state: c,
779
- dispatch: U,
780
- quotes: B,
781
- quotesLoading: Re,
782
- quotesError: le,
783
- fetchQuotes: We,
784
- order: ce,
785
- orderLoading: $,
786
- orderError: Ne,
787
- createOrder: Pe,
788
- orderStatus: re,
789
- orderStatusLoading: rt,
790
- fieldLocks: C || null,
791
- defaultGateway: ye,
792
- availableFiats: ae,
793
- availableCryptos: O,
794
- availablePaymentMethods: de,
795
- selectionUnsupported: Me,
796
- quotesEmpty: ke,
797
- bestUnavailableReason: Oe,
798
- amountError: Q,
799
- goToStep: ot,
800
- goBack: it,
801
- canProceed: Ze
779
+ configLoading: ee,
780
+ configError: ue,
781
+ state: s,
782
+ dispatch: L,
783
+ quotes: $,
784
+ quotesLoading: be,
785
+ quotesError: Oe,
786
+ fetchQuotes: Se,
787
+ order: we,
788
+ orderLoading: $e,
789
+ orderError: Te,
790
+ createOrder: me,
791
+ orderStatus: P,
792
+ orderStatusLoading: Ze,
793
+ fieldLocks: y || null,
794
+ defaultGateway: oe,
795
+ availableFiats: se,
796
+ availableCryptos: Q,
797
+ availablePaymentMethods: te,
798
+ selectionUnsupported: de,
799
+ quotesEmpty: H,
800
+ bestUnavailableReason: He,
801
+ amountError: ye,
802
+ goToStep: Ue,
803
+ goBack: lt,
804
+ canProceed: Pe
802
805
  };
803
- return /* @__PURE__ */ e(zt.Provider, { value: me, children: ie });
806
+ return /* @__PURE__ */ e(zt.Provider, { value: Ke, children: ce });
804
807
  }
805
- function Fe() {
808
+ function Me() {
806
809
  const t = va(zt);
807
810
  if (!t)
808
811
  throw new Error("useRamp must be used within a RampProvider");
@@ -1163,9 +1166,9 @@ const Ve = {
1163
1166
  { code: "ZCHF", name: "Frankencoin", chains: ["ETH"], popular: !1 },
1164
1167
  { code: "ZETA", name: "Zeta", chains: ["ETH", "ZETACHAIN"], popular: !1 },
1165
1168
  { code: "ZTG", name: "Zeitgeist", chains: ["ZTG"], popular: !1 }
1166
- ], Ba = Object.fromEntries(
1169
+ ], Oa = Object.fromEntries(
1167
1170
  Jt.map((t) => [t.code, t.name])
1168
- ), Oa = {
1171
+ ), Ha = {
1169
1172
  AED: "ae",
1170
1173
  ALL: "al",
1171
1174
  ARS: "ar",
@@ -1203,15 +1206,15 @@ const Ve = {
1203
1206
  function qt(t, a = "") {
1204
1207
  return `${a}/crypto-icons/${t.toLowerCase()}.svg`;
1205
1208
  }
1206
- function Ha(t, a = "") {
1207
- const n = Oa[t] || "us";
1209
+ function Pa(t, a = "") {
1210
+ const n = Ha[t] || "us";
1208
1211
  return `${a}/flags/${n}.svg`;
1209
1212
  }
1210
- function tt(t) {
1213
+ function rt(t) {
1211
1214
  return Ve[t] || Ve[t.toLowerCase()] || Ve[t.toUpperCase()] || Ve[t.toUpperCase().replace(/-/g, "_")] || Ve[t.toLowerCase().replace(/-/g, "_")];
1212
1215
  }
1213
1216
  function ft(t, a = "") {
1214
- const n = tt(t);
1217
+ const n = rt(t);
1215
1218
  return n ? `${a}/crypto-icons/${n.icon}.svg` : `${a}/crypto-icons/${t.toLowerCase()}.svg`;
1216
1219
  }
1217
1220
  const _t = [
@@ -1243,7 +1246,7 @@ const _t = [
1243
1246
  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 },
1244
1247
  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 },
1245
1248
  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 }
1246
- }, Pa = /* @__PURE__ */ new Set([
1249
+ }, Ka = /* @__PURE__ */ new Set([
1247
1250
  "USDC",
1248
1251
  "USDT",
1249
1252
  "DAI",
@@ -1271,16 +1274,16 @@ const _t = [
1271
1274
  "ZCHF"
1272
1275
  ]);
1273
1276
  function ea(t) {
1274
- return Pa.has(t.toUpperCase());
1277
+ return Ka.has(t.toUpperCase());
1275
1278
  }
1276
- function Ln(t, a) {
1279
+ function Un(t, a) {
1277
1280
  var n, r;
1278
1281
  return ((n = jt[t]) == null ? void 0 : n[a]) ?? ((r = jt.USDC) == null ? void 0 : r[a]) ?? 1;
1279
1282
  }
1280
- function Ka(t) {
1283
+ function _a(t) {
1281
1284
  return parseFloat(t.replace(/,/g, "")) || 0;
1282
1285
  }
1283
- function ht(t) {
1286
+ function pt(t) {
1284
1287
  if (t === 0) return "0";
1285
1288
  if (t >= 1e3) return t.toLocaleString("en-US", { maximumFractionDigits: 2 });
1286
1289
  if (t >= 1) return t.toFixed(2);
@@ -1288,7 +1291,7 @@ function ht(t) {
1288
1291
  const a = t.toPrecision(4);
1289
1292
  return parseFloat(a).toString();
1290
1293
  }
1291
- const he = (t) => /^#([0-9A-Fa-f]{3}){1,2}$/.test(t), Gt = 10, $t = 1e-4, _a = (() => {
1294
+ const he = (t) => /^#([0-9A-Fa-f]{3}){1,2}$/.test(t), Gt = 10, Wt = 1e-4, Va = (() => {
1292
1295
  const t = [];
1293
1296
  for (const a of Jt)
1294
1297
  for (const n of a.chains)
@@ -1302,23 +1305,23 @@ function ta({
1302
1305
  className: r = "",
1303
1306
  background: o
1304
1307
  }) {
1305
- const [d, u] = N(!1), [i, s] = N(!1), m = I(t);
1306
- m.current !== t && (m.current = t, u(!1), s(!1));
1307
- const h = P(() => u(!0), []), f = P(() => s(!0), []);
1308
- return /* @__PURE__ */ l(
1308
+ const [d, u] = A(!1), [l, c] = A(!1), m = M(t);
1309
+ m.current !== t && (m.current = t, u(!1), c(!1));
1310
+ const p = B(() => u(!0), []), f = B(() => c(!0), []);
1311
+ return /* @__PURE__ */ i(
1309
1312
  "div",
1310
1313
  {
1311
1314
  className: `relative rounded-full shrink-0 ${r}`,
1312
1315
  style: { width: n, height: n, background: o },
1313
1316
  children: [
1314
- !d && !i && /* @__PURE__ */ e(
1317
+ !d && !l && /* @__PURE__ */ e(
1315
1318
  "div",
1316
1319
  {
1317
1320
  className: "absolute inset-0 rounded-full animate-pulse",
1318
1321
  style: { background: "var(--t-pill-bg, #333)" }
1319
1322
  }
1320
1323
  ),
1321
- i ? /* @__PURE__ */ e(
1324
+ l ? /* @__PURE__ */ e(
1322
1325
  "div",
1323
1326
  {
1324
1327
  className: "absolute inset-0 rounded-full flex items-center justify-center font-bold",
@@ -1336,7 +1339,7 @@ function ta({
1336
1339
  alt: a,
1337
1340
  width: n,
1338
1341
  height: n,
1339
- onLoad: h,
1342
+ onLoad: p,
1340
1343
  onError: f,
1341
1344
  className: `rounded-full ${d ? "opacity-100" : "opacity-0"}`,
1342
1345
  style: { width: n, height: n, transition: "opacity 0.15s ease-in" }
@@ -1346,7 +1349,7 @@ function ta({
1346
1349
  }
1347
1350
  );
1348
1351
  }
1349
- function Wt({ ticker: t, size: a = 32, baseUrl: n = "" }) {
1352
+ function $t({ ticker: t, size: a = 32, baseUrl: n = "" }) {
1350
1353
  return /* @__PURE__ */ e(
1351
1354
  ta,
1352
1355
  {
@@ -1357,29 +1360,29 @@ function Wt({ ticker: t, size: a = 32, baseUrl: n = "" }) {
1357
1360
  }
1358
1361
  );
1359
1362
  }
1360
- function pt({ currencyCode: t, size: a = 16, baseUrl: n = "" }) {
1363
+ function ht({ currencyCode: t, size: a = 16, baseUrl: n = "" }) {
1361
1364
  return /* @__PURE__ */ e(
1362
1365
  ta,
1363
1366
  {
1364
- src: Ha(t, n),
1367
+ src: Pa(t, n),
1365
1368
  alt: t,
1366
1369
  size: a
1367
1370
  }
1368
1371
  );
1369
1372
  }
1370
1373
  function gt({ size: t = 32, color: a = "#888" }) {
1371
- return /* @__PURE__ */ l("svg", { width: t, height: t, viewBox: "0 0 32 32", fill: "none", children: [
1374
+ return /* @__PURE__ */ i("svg", { width: t, height: t, viewBox: "0 0 32 32", fill: "none", children: [
1372
1375
  /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "16", fill: a }),
1373
1376
  /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "8", stroke: "white", strokeWidth: "1.5", fill: "none" })
1374
1377
  ] });
1375
1378
  }
1376
- function Va({ size: t = 24 }) {
1379
+ function ja({ size: t = 24 }) {
1377
1380
  return /* @__PURE__ */ e(
1378
1381
  "div",
1379
1382
  {
1380
1383
  className: "rounded-full flex items-center justify-center shrink-0",
1381
1384
  style: { width: t, height: t, background: "var(--t-card-icon-bg)" },
1382
- children: /* @__PURE__ */ l("svg", { width: t * 0.6, height: t * 0.58, viewBox: "0 0 25 24", fill: "none", children: [
1385
+ children: /* @__PURE__ */ i("svg", { width: t * 0.6, height: t * 0.58, viewBox: "0 0 25 24", fill: "none", children: [
1383
1386
  /* @__PURE__ */ e("path", { d: "M23.292 7.5H1.70801L12.5 0.592773L23.292 7.5Z", stroke: "var(--t-card-icon-stroke)", strokeWidth: "1" }),
1384
1387
  /* @__PURE__ */ e("rect", { x: "3", y: "10", width: "1.5", height: "11", fill: "var(--t-card-icon-stroke)" }),
1385
1388
  /* @__PURE__ */ e("rect", { x: "9", y: "10", width: "1.5", height: "11", fill: "var(--t-card-icon-stroke)" }),
@@ -1390,7 +1393,7 @@ function Va({ size: t = 24 }) {
1390
1393
  }
1391
1394
  );
1392
1395
  }
1393
- function ja({ size: t = 32 }) {
1396
+ function Ga({ size: t = 32 }) {
1394
1397
  return /* @__PURE__ */ e(
1395
1398
  "div",
1396
1399
  {
@@ -1400,7 +1403,7 @@ function ja({ size: t = 32 }) {
1400
1403
  }
1401
1404
  );
1402
1405
  }
1403
- function Ga({ size: t = 32 }) {
1406
+ function Wa({ size: t = 32 }) {
1404
1407
  return /* @__PURE__ */ e(
1405
1408
  "div",
1406
1409
  {
@@ -1422,7 +1425,7 @@ function $a({ size: t = 32 }) {
1422
1425
  {
1423
1426
  className: "flex items-center justify-center shrink-0",
1424
1427
  style: { width: t, height: t, background: "#3C4043", borderRadius: t * 0.2 },
1425
- children: /* @__PURE__ */ l("svg", { width: t * 0.72, height: t * 0.296, viewBox: "0 0 51 21", fill: "none", children: [
1428
+ children: /* @__PURE__ */ i("svg", { width: t * 0.72, height: t * 0.296, viewBox: "0 0 51 21", fill: "none", children: [
1426
1429
  /* @__PURE__ */ e("path", { d: "M50.9156 5.87122L44.6406 20.2837H42.6992L45.0289 15.2416L40.9009 5.87122H42.9451L45.929 13.0573H45.9689L48.8714 5.87122H50.9156Z", fill: "white" }),
1427
1430
  /* @__PURE__ */ e("path", { d: "M39.3906 6.65832C38.5866 5.91563 37.4895 5.54547 36.0995 5.54547C34.314 5.54547 32.9657 6.19816 32.0513 7.50532L33.7084 8.54664C34.3211 7.66089 35.1512 7.21951 36.2011 7.21951C36.8967 7.21951 37.5008 7.44661 38.0194 7.9023C38.538 8.35948 38.7964 8.91352 38.7964 9.5665V9.99507C38.0751 9.58796 37.1536 9.38381 36.0366 9.38381C34.7297 9.38381 33.6839 9.68959 32.8998 10.3023C32.1172 10.9151 31.7256 11.738 31.7256 12.7706C31.7256 13.8033 32.0969 14.5675 32.8396 15.2216C33.5808 15.8758 34.5065 16.2016 35.6092 16.2016C36.9033 16.2016 37.9389 15.6302 38.7147 14.4876H38.7976V15.8761H40.5944V9.70955C40.5944 8.4167 40.1944 7.39982 39.3903 6.65862L39.3906 6.65832ZM37.8665 13.6501C37.2451 14.2343 36.5424 14.5272 35.7511 14.5272C35.1926 14.5272 34.7068 14.3645 34.2913 14.0387C33.8741 13.7103 33.6673 13.3032 33.6673 12.8132C33.6673 12.2675 33.923 11.8134 34.4344 11.4462C34.9443 11.079 35.5815 10.8948 36.3442 10.8948C37.3926 10.8948 38.211 11.1249 38.7967 11.5889C38.7967 12.3775 38.4867 13.0645 37.8668 13.6501H37.8665Z", fill: "white" }),
1428
1431
  /* @__PURE__ */ e("path", { d: "M30.4166 2.52282C29.5296 1.67999 28.4552 1.25739 27.1883 1.25739H22.2017V15.8758H24.0813V9.95362H27.188C28.4678 9.95362 29.5448 9.53936 30.4163 8.70815C31.3175 7.87962 31.7661 6.84397 31.7661 5.60565C31.7661 4.36733 31.3175 3.36744 30.4163 2.52312L30.4166 2.52282ZM29.0895 7.40248C28.598 7.90525 27.9781 8.15798 27.2297 8.15798H24.0816V3.05272H27.2297C27.9781 3.05272 28.5983 3.31141 29.0895 3.82849C29.5937 4.33276 29.845 4.92554 29.845 5.60535C29.845 6.28516 29.5934 6.8994 29.0895 7.40218V7.40248Z", fill: "white" }),
@@ -1431,7 +1434,7 @@ function $a({ size: t = 32 }) {
1431
1434
  }
1432
1435
  );
1433
1436
  }
1434
- function Wa({ size: t = 32 }) {
1437
+ function Xa({ size: t = 32 }) {
1435
1438
  return /* @__PURE__ */ e(
1436
1439
  "div",
1437
1440
  {
@@ -1441,13 +1444,13 @@ function Wa({ size: t = 32 }) {
1441
1444
  }
1442
1445
  );
1443
1446
  }
1444
- function Xa({ size: t = 32 }) {
1447
+ function Ya({ size: t = 32 }) {
1445
1448
  return /* @__PURE__ */ e(
1446
1449
  "div",
1447
1450
  {
1448
1451
  className: "flex items-center justify-center shrink-0",
1449
1452
  style: { width: t, height: t, background: "#1A1F71", borderRadius: t * 0.2 },
1450
- children: /* @__PURE__ */ l("svg", { width: t * 0.72, height: t * 0.234, viewBox: "0 0 43 14", fill: "none", children: [
1453
+ children: /* @__PURE__ */ i("svg", { width: t * 0.72, height: t * 0.234, viewBox: "0 0 43 14", fill: "none", children: [
1451
1454
  /* @__PURE__ */ e("path", { d: "M18.3629 13.5165H14.9302L17.0772 0.240662H20.5097L18.3629 13.5165Z", fill: "white" }),
1452
1455
  /* @__PURE__ */ e("path", { d: "M30.806 0.565203C30.1289 0.296586 29.055 0 27.7271 0C24.3372 0 21.95 1.80767 21.9354 4.3921C21.9072 6.29889 23.6445 7.35796 24.9439 7.99375C26.2719 8.64342 26.7234 9.06747 26.7234 9.64656C26.7099 10.5359 25.6502 10.9459 24.6619 10.9459C23.2914 10.9459 22.5571 10.7345 21.4412 10.2397L20.9891 10.0276L20.5088 13.0077C21.3139 13.3745 22.7972 13.7 24.3372 13.7143C27.939 13.7143 30.2839 11.9346 30.3117 9.18047C30.3254 7.66919 29.4081 6.51119 27.4303 5.56493C26.2297 4.95749 25.4944 4.54791 25.4944 3.92639C25.5085 3.36137 26.1163 2.78265 27.4716 2.78265C28.5876 2.75431 29.4075 3.02255 30.0286 3.29098L30.3391 3.43195L30.806 0.565203Z", fill: "white" }),
1453
1456
  /* @__PURE__ */ e("path", { d: "M35.3681 8.81332C35.6508 8.05064 36.7386 5.09886 36.7386 5.09886C36.7243 5.1272 37.0207 4.3221 37.1902 3.82785L37.4301 4.97178C37.4301 4.97178 38.0802 8.14956 38.2213 8.81332C37.6848 8.81332 36.0461 8.81332 35.3681 8.81332ZM39.6053 0.240662H36.9501C36.1313 0.240662 35.5092 0.480559 35.156 1.34216L30.0571 13.5163H33.659C33.659 13.5163 34.2519 11.8777 34.3794 11.5248C34.7745 11.5248 38.2784 11.5248 38.7867 11.5248C38.8853 11.9909 39.1963 13.5163 39.1963 13.5163H42.3747L39.6053 0.240662Z", fill: "white" }),
@@ -1457,14 +1460,14 @@ function Xa({ size: t = 32 }) {
1457
1460
  }
1458
1461
  );
1459
1462
  }
1460
- function Ya({ size: t = 32 }) {
1463
+ function Za({ size: t = 32 }) {
1461
1464
  const a = t * 0.8;
1462
1465
  return /* @__PURE__ */ e(
1463
1466
  "div",
1464
1467
  {
1465
1468
  className: "flex items-center justify-center shrink-0",
1466
1469
  style: { width: t, height: t },
1467
- children: /* @__PURE__ */ l("svg", { width: a, height: a * 0.625, viewBox: "0 0 48 30", fill: "none", children: [
1470
+ children: /* @__PURE__ */ i("svg", { width: a, height: a * 0.625, viewBox: "0 0 48 30", fill: "none", children: [
1468
1471
  /* @__PURE__ */ e("circle", { cx: "18", cy: "15", r: "14", fill: "#EB001B" }),
1469
1472
  /* @__PURE__ */ e("circle", { cx: "30", cy: "15", r: "14", fill: "#F79E1B" }),
1470
1473
  /* @__PURE__ */ e("path", { d: "M24 2.35A14 14 0 0 1 24 27.65A14 14 0 0 1 24 2.35Z", fill: "#FF5F00" })
@@ -1472,9 +1475,9 @@ function Ya({ size: t = 32 }) {
1472
1475
  }
1473
1476
  );
1474
1477
  }
1475
- function Za({ size: t = 32 }) {
1478
+ function Qa({ size: t = 32 }) {
1476
1479
  const a = t * 0.56, n = a * 0.65, r = Math.max(2, a * 0.1), o = a * 0.2;
1477
- return /* @__PURE__ */ l("div", { className: "flex items-center justify-center shrink-0", style: { width: t, height: t }, children: [
1480
+ return /* @__PURE__ */ i("div", { className: "flex items-center justify-center shrink-0", style: { width: t, height: t }, children: [
1478
1481
  /* @__PURE__ */ e(
1479
1482
  "div",
1480
1483
  {
@@ -1489,7 +1492,7 @@ function Za({ size: t = 32 }) {
1489
1492
  alignItems: "center",
1490
1493
  justifyContent: "center"
1491
1494
  },
1492
- children: /* @__PURE__ */ l("svg", { width: a * 0.7, height: n * 0.35, viewBox: "0 0 43 14", fill: "none", children: [
1495
+ children: /* @__PURE__ */ i("svg", { width: a * 0.7, height: n * 0.35, viewBox: "0 0 43 14", fill: "none", children: [
1493
1496
  /* @__PURE__ */ e("path", { d: "M18.3629 13.5165H14.9302L17.0772 0.240662H20.5097L18.3629 13.5165Z", fill: "white" }),
1494
1497
  /* @__PURE__ */ e("path", { d: "M12.0629 0.240662L8.70119 9.29349L8.33383 7.45747C7.71232 5.33894 5.76311 3.03721 3.58789 1.89272L6.66713 13.5024H10.2971L15.6927 0.240662H12.0629Z", fill: "white" }),
1495
1498
  /* @__PURE__ */ e("path", { d: "M5.57939 0.240662H0.0565013L0 0.508903C4.3082 1.61059 7.16143 4.26616 8.3337 7.45803L7.13309 1.35661C6.93542 0.508715 6.32798 0.268631 5.57939 0.240662Z", fill: "white" }),
@@ -1514,7 +1517,7 @@ function Za({ size: t = 32 }) {
1514
1517
  justifyContent: "center",
1515
1518
  overflow: "hidden"
1516
1519
  },
1517
- children: /* @__PURE__ */ l("svg", { width: n * 0.85, height: n * 0.6, viewBox: "0 0 48 30", fill: "none", children: [
1520
+ children: /* @__PURE__ */ i("svg", { width: n * 0.85, height: n * 0.6, viewBox: "0 0 48 30", fill: "none", children: [
1518
1521
  /* @__PURE__ */ e("circle", { cx: "18", cy: "15", r: "14", fill: "#EB001B" }),
1519
1522
  /* @__PURE__ */ e("circle", { cx: "30", cy: "15", r: "14", fill: "#F79E1B" }),
1520
1523
  /* @__PURE__ */ e("path", { d: "M24 2.35A14 14 0 0 1 24 27.65A14 14 0 0 1 24 2.35Z", fill: "#FF5F00" })
@@ -1523,7 +1526,7 @@ function Za({ size: t = 32 }) {
1523
1526
  )
1524
1527
  ] });
1525
1528
  }
1526
- function Un({ size: t = 18 }) {
1529
+ function Fn({ size: t = 18 }) {
1527
1530
  return /* @__PURE__ */ e(
1528
1531
  "div",
1529
1532
  {
@@ -1539,7 +1542,7 @@ function Ge() {
1539
1542
  function Xt() {
1540
1543
  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" }) });
1541
1544
  }
1542
- function Qa({ onClick: t }) {
1545
+ function za({ onClick: t }) {
1543
1546
  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(
1544
1547
  "path",
1545
1548
  {
@@ -1548,42 +1551,42 @@ function Qa({ onClick: t }) {
1548
1551
  }
1549
1552
  ) }) });
1550
1553
  }
1551
- function za({ size: t = 40 }) {
1554
+ function Ja({ size: t = 40 }) {
1552
1555
  return /* @__PURE__ */ e(
1553
1556
  "div",
1554
1557
  {
1555
1558
  className: "rounded-full flex items-center justify-center shrink-0",
1556
1559
  style: { width: t, height: t, background: "var(--t-surface)" },
1557
- children: /* @__PURE__ */ l("svg", { width: t * 0.5, height: t * 0.5, viewBox: "0 0 20 20", fill: "none", children: [
1560
+ children: /* @__PURE__ */ i("svg", { width: t * 0.5, height: t * 0.5, viewBox: "0 0 20 20", fill: "none", children: [
1558
1561
  /* @__PURE__ */ e("circle", { cx: "10", cy: "10", r: "7.5", stroke: "var(--t-text)", strokeWidth: "1.5" }),
1559
1562
  /* @__PURE__ */ e("path", { d: "M10 2.5A7.5 7.5 0 0 1 10 17.5", fill: "var(--t-text)" })
1560
1563
  ] })
1561
1564
  }
1562
1565
  );
1563
1566
  }
1564
- function Ja(t, a = 32) {
1567
+ function qa(t, a = 32) {
1565
1568
  switch (t) {
1566
1569
  case "revolut":
1567
- return /* @__PURE__ */ e(ja, { size: a });
1568
- case "applepay":
1569
1570
  return /* @__PURE__ */ e(Ga, { size: a });
1571
+ case "applepay":
1572
+ return /* @__PURE__ */ e(Wa, { size: a });
1570
1573
  case "card":
1571
- return /* @__PURE__ */ e(Za, { size: a });
1574
+ return /* @__PURE__ */ e(Qa, { size: a });
1572
1575
  case "googlepay":
1573
1576
  return /* @__PURE__ */ e($a, { size: a });
1574
1577
  case "paypal":
1575
- return /* @__PURE__ */ e(Wa, { size: a });
1578
+ return /* @__PURE__ */ e(Xa, { size: a });
1576
1579
  case "bank":
1577
- return /* @__PURE__ */ e(Va, { size: a });
1580
+ return /* @__PURE__ */ e(ja, { size: a });
1578
1581
  case "visa":
1579
- return /* @__PURE__ */ e(Xa, { size: a });
1580
- case "mastercard":
1581
1582
  return /* @__PURE__ */ e(Ya, { size: a });
1583
+ case "mastercard":
1584
+ return /* @__PURE__ */ e(Za, { size: a });
1582
1585
  default:
1583
1586
  return /* @__PURE__ */ e(gt, { size: a });
1584
1587
  }
1585
1588
  }
1586
- const qa = {
1589
+ const en = {
1587
1590
  "debit-credit-card": "card",
1588
1591
  "bank-transfer": "bank",
1589
1592
  "ach-bank-transfer": "bank",
@@ -1594,7 +1597,7 @@ const qa = {
1594
1597
  "google-pay": "googlepay",
1595
1598
  paypal: "paypal",
1596
1599
  revolut: "revolut"
1597
- }, en = {
1600
+ }, tn = {
1598
1601
  "debit-credit-card": "Card",
1599
1602
  "bank-transfer": "Bank Transfer",
1600
1603
  "ach-bank-transfer": "ACH",
@@ -1605,13 +1608,13 @@ const qa = {
1605
1608
  revolut: "Revolut"
1606
1609
  };
1607
1610
  function aa(t, a) {
1608
- return en[t] || a;
1611
+ return tn[t] || a;
1609
1612
  }
1610
1613
  function na(t, a, n = 24) {
1611
- const r = qa[t];
1612
- return r ? Ja(r, n) : a ? /* @__PURE__ */ e("img", { src: a, alt: "", width: n, height: n, style: { borderRadius: "50%" } }) : /* @__PURE__ */ e(gt, { size: n });
1614
+ const r = en[t];
1615
+ return r ? qa(r, n) : a ? /* @__PURE__ */ e("img", { src: a, alt: "", width: n, height: n, style: { borderRadius: "50%" } }) : /* @__PURE__ */ e(gt, { size: n });
1613
1616
  }
1614
- function tn({
1617
+ function an({
1615
1618
  methods: t,
1616
1619
  selectedId: a,
1617
1620
  onOpenModal: n,
@@ -1630,12 +1633,12 @@ function tn({
1630
1633
  borderBottomLeftRadius: 5,
1631
1634
  borderBottomRightRadius: 5
1632
1635
  },
1633
- children: /* @__PURE__ */ l("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children: [
1636
+ children: /* @__PURE__ */ i("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children: [
1634
1637
  "No payment methods available for ",
1635
1638
  r
1636
1639
  ] })
1637
1640
  }
1638
- ) : /* @__PURE__ */ e(ee, { children: /* @__PURE__ */ l(
1641
+ ) : /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ i(
1639
1642
  "div",
1640
1643
  {
1641
1644
  role: "button",
@@ -1654,7 +1657,7 @@ function tn({
1654
1657
  },
1655
1658
  children: [
1656
1659
  /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: "Payment method" }),
1657
- /* @__PURE__ */ l("span", { className: "flex items-center gap-2", children: [
1660
+ /* @__PURE__ */ i("span", { className: "flex items-center gap-2", children: [
1658
1661
  /* @__PURE__ */ e("span", { className: "flex items-center justify-center", style: { width: 20, height: 20 }, children: d && na(d.id, d.icon, 20) }),
1659
1662
  /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: d ? aa(d.id, d.name) : "Select" }),
1660
1663
  /* @__PURE__ */ e(Ge, {})
@@ -1663,29 +1666,29 @@ function tn({
1663
1666
  }
1664
1667
  ) });
1665
1668
  }
1666
- function an({
1669
+ function nn({
1667
1670
  className: t = "",
1668
1671
  autoRedirect: a = !1,
1669
1672
  redirectDelay: n = 3e3
1670
1673
  }) {
1671
- var y;
1672
- const { order: r, orderStatus: o, goToStep: d, goBack: u } = Fe(), [i, s] = N(!1), [m, h] = N(null), f = r != null && r.checkout.expiresAt ? Date.now() > r.checkout.expiresAt : !1;
1674
+ var C;
1675
+ const { order: r, orderStatus: o, goToStep: d, goBack: u } = Me(), [l, c] = A(!1), [m, p] = A(null), f = r != null && r.checkout.expiresAt ? Date.now() > r.checkout.expiresAt : !1;
1673
1676
  if (Z(() => {
1674
1677
  if ((r == null ? void 0 : r.checkout.method) === "redirect" && a && !f) {
1675
- h(Math.ceil(n / 1e3));
1676
- const x = setTimeout(() => {
1678
+ p(Math.ceil(n / 1e3));
1679
+ const S = setTimeout(() => {
1677
1680
  window.location.href = r.checkout.url;
1678
- }, n), C = setInterval(() => {
1679
- h((E) => E && E > 1 ? E - 1 : null);
1681
+ }, n), k = setInterval(() => {
1682
+ p((w) => w && w > 1 ? w - 1 : null);
1680
1683
  }, 1e3);
1681
1684
  return () => {
1682
- clearTimeout(x), clearInterval(C);
1685
+ clearTimeout(S), clearInterval(k);
1683
1686
  };
1684
1687
  }
1685
1688
  }, [r, a, n, f]), Z(() => {
1686
1689
  o && (o.status === "completed" ? d("complete") : ["failed", "cancelled", "expired"].includes(o.status) && d("error"));
1687
1690
  }, [o == null ? void 0 : o.status, d]), !r)
1688
- return /* @__PURE__ */ l(
1691
+ return /* @__PURE__ */ i(
1689
1692
  "div",
1690
1693
  {
1691
1694
  className: `flex flex-col items-center justify-center p-8 ${t}`,
@@ -1712,7 +1715,7 @@ function an({
1712
1715
  }
1713
1716
  );
1714
1717
  if (f)
1715
- return /* @__PURE__ */ l(
1718
+ return /* @__PURE__ */ i(
1716
1719
  "div",
1717
1720
  {
1718
1721
  className: `flex flex-col items-center justify-center p-8 text-center ${t}`,
@@ -1738,9 +1741,9 @@ function an({
1738
1741
  }
1739
1742
  );
1740
1743
  if (r.checkout.method === "iframe") {
1741
- const x = r.checkout.url, C = ((y = r.checkout.allowedFeatures) == null ? void 0 : y.join("; ")) || "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share";
1744
+ const S = r.checkout.url, k = ((C = r.checkout.allowedFeatures) == null ? void 0 : C.join("; ")) || "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share";
1742
1745
  return Pt(
1743
- /* @__PURE__ */ l(
1746
+ /* @__PURE__ */ i(
1744
1747
  "div",
1745
1748
  {
1746
1749
  style: {
@@ -1764,7 +1767,7 @@ function an({
1764
1767
  background: "#111",
1765
1768
  flexShrink: 0
1766
1769
  },
1767
- children: /* @__PURE__ */ l(
1770
+ children: /* @__PURE__ */ i(
1768
1771
  "button",
1769
1772
  {
1770
1773
  onClick: u,
@@ -1789,8 +1792,8 @@ function an({
1789
1792
  )
1790
1793
  }
1791
1794
  ),
1792
- /* @__PURE__ */ l("div", { style: { flex: 1, position: "relative", overflow: "hidden" }, children: [
1793
- !i && /* @__PURE__ */ l(
1795
+ /* @__PURE__ */ i("div", { style: { flex: 1, position: "relative", overflow: "hidden" }, children: [
1796
+ !l && /* @__PURE__ */ i(
1794
1797
  "div",
1795
1798
  {
1796
1799
  style: {
@@ -1810,15 +1813,15 @@ function an({
1810
1813
  /* @__PURE__ */ e(
1811
1814
  "iframe",
1812
1815
  {
1813
- src: x,
1816
+ src: S,
1814
1817
  style: {
1815
- display: i ? "block" : "none",
1818
+ display: l ? "block" : "none",
1816
1819
  width: "100%",
1817
1820
  height: "100%",
1818
1821
  border: "none"
1819
1822
  },
1820
- allow: C,
1821
- onLoad: () => s(!0),
1823
+ allow: k,
1824
+ onLoad: () => c(!0),
1822
1825
  title: "Provider Checkout"
1823
1826
  }
1824
1827
  )
@@ -1830,7 +1833,7 @@ function an({
1830
1833
  );
1831
1834
  }
1832
1835
  if (r.checkout.method === "redirect")
1833
- return /* @__PURE__ */ l(
1836
+ return /* @__PURE__ */ i(
1834
1837
  "div",
1835
1838
  {
1836
1839
  className: `flex flex-col items-center justify-center p-8 text-center ${t}`,
@@ -1838,17 +1841,17 @@ function an({
1838
1841
  children: [
1839
1842
  /* @__PURE__ */ e("div", { className: "text-[48px] mb-4", children: "🔗" }),
1840
1843
  /* @__PURE__ */ e("h3", { className: "text-[18px] font-semibold mb-2", children: "Complete Payment" }),
1841
- /* @__PURE__ */ l("p", { className: "text-[14px] mb-4", style: { color: "var(--t-text-secondary)" }, children: [
1844
+ /* @__PURE__ */ i("p", { className: "text-[14px] mb-4", style: { color: "var(--t-text-secondary)" }, children: [
1842
1845
  "You'll be redirected to ",
1843
1846
  r.gateway,
1844
1847
  " to complete your payment."
1845
1848
  ] }),
1846
- m !== null && /* @__PURE__ */ l("p", { className: "text-[13px] mb-4", style: { color: "var(--t-text-muted)" }, children: [
1849
+ m !== null && /* @__PURE__ */ i("p", { className: "text-[13px] mb-4", style: { color: "var(--t-text-muted)" }, children: [
1847
1850
  "Redirecting in ",
1848
1851
  m,
1849
1852
  "..."
1850
1853
  ] }),
1851
- /* @__PURE__ */ l(
1854
+ /* @__PURE__ */ i(
1852
1855
  "a",
1853
1856
  {
1854
1857
  href: r.checkout.url,
@@ -1886,9 +1889,9 @@ function an({
1886
1889
  }
1887
1890
  );
1888
1891
  if (r.checkout.method === "widget" && r.widgetConfig) {
1889
- const x = nn(r.checkout.url, r.widgetConfig);
1892
+ const S = rn(r.checkout.url, r.widgetConfig);
1890
1893
  return Pt(
1891
- /* @__PURE__ */ l(
1894
+ /* @__PURE__ */ i(
1892
1895
  "div",
1893
1896
  {
1894
1897
  style: {
@@ -1912,7 +1915,7 @@ function an({
1912
1915
  background: "#111",
1913
1916
  flexShrink: 0
1914
1917
  },
1915
- children: /* @__PURE__ */ l(
1918
+ children: /* @__PURE__ */ i(
1916
1919
  "button",
1917
1920
  {
1918
1921
  onClick: u,
@@ -1937,8 +1940,8 @@ function an({
1937
1940
  )
1938
1941
  }
1939
1942
  ),
1940
- /* @__PURE__ */ l("div", { style: { flex: 1, position: "relative", overflow: "hidden" }, children: [
1941
- !i && /* @__PURE__ */ l(
1943
+ /* @__PURE__ */ i("div", { style: { flex: 1, position: "relative", overflow: "hidden" }, children: [
1944
+ !l && /* @__PURE__ */ i(
1942
1945
  "div",
1943
1946
  {
1944
1947
  style: {
@@ -1958,15 +1961,15 @@ function an({
1958
1961
  /* @__PURE__ */ e(
1959
1962
  "iframe",
1960
1963
  {
1961
- src: x,
1964
+ src: S,
1962
1965
  style: {
1963
- display: i ? "block" : "none",
1966
+ display: l ? "block" : "none",
1964
1967
  width: "100%",
1965
1968
  height: "100%",
1966
1969
  border: "none"
1967
1970
  },
1968
1971
  allow: "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share",
1969
- onLoad: () => s(!0),
1972
+ onLoad: () => c(!0),
1970
1973
  title: "Payment Checkout"
1971
1974
  }
1972
1975
  )
@@ -1977,7 +1980,7 @@ function an({
1977
1980
  document.body
1978
1981
  );
1979
1982
  }
1980
- return /* @__PURE__ */ l(
1983
+ return /* @__PURE__ */ i(
1981
1984
  "div",
1982
1985
  {
1983
1986
  className: `flex flex-col items-center justify-center p-8 ${t}`,
@@ -2004,14 +2007,14 @@ function an({
2004
2007
  }
2005
2008
  );
2006
2009
  }
2007
- function nn(t, a) {
2010
+ function rn(t, a) {
2008
2011
  const n = new URL("/en/partner/widget", t);
2009
2012
  for (const [r, o] of Object.entries(a))
2010
2013
  o != null && o !== "" && n.searchParams.set(r, String(o));
2011
2014
  return n.toString();
2012
2015
  }
2013
- function rn({ className: t = "" }) {
2014
- const { orderStatus: a, orderStatusLoading: n, goToStep: r } = Fe();
2016
+ function on({ className: t = "" }) {
2017
+ const { orderStatus: a, orderStatusLoading: n, goToStep: r } = Me();
2015
2018
  Z(() => {
2016
2019
  a && (a.status === "completed" ? r("complete") : ["failed", "cancelled", "expired", "refunded"].includes(a.status) && r("error"));
2017
2020
  }, [a == null ? void 0 : a.status, r]);
@@ -2026,30 +2029,30 @@ function rn({ className: t = "" }) {
2026
2029
  return "Processing...";
2027
2030
  }
2028
2031
  };
2029
- return /* @__PURE__ */ l("div", { className: `flex flex-col items-center justify-center px-8 py-12 text-center ${t}`, children: [
2032
+ return /* @__PURE__ */ i("div", { className: `flex flex-col items-center justify-center px-8 py-12 text-center ${t}`, children: [
2030
2033
  /* @__PURE__ */ e("div", { className: "mb-6", children: /* @__PURE__ */ e("div", { className: "nramp-spinner-large nramp-spinner" }) }),
2031
2034
  /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-3", style: { color: "var(--t-text)" }, children: o() }),
2032
2035
  n && /* @__PURE__ */ e("p", { className: "text-[13px] mb-4", style: { color: "var(--t-text-muted)" }, children: "Checking status..." }),
2033
- a && /* @__PURE__ */ l("div", { className: "w-full mt-6 text-left", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
2034
- /* @__PURE__ */ e(Ue, { label: "Order ID", value: a.orderId, mono: !0 }),
2035
- /* @__PURE__ */ e(Ue, { label: "Provider", value: a.gateway }),
2036
+ a && /* @__PURE__ */ i("div", { className: "w-full mt-6 text-left", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
2037
+ /* @__PURE__ */ e(Ie, { label: "Order ID", value: a.orderId, mono: !0 }),
2038
+ /* @__PURE__ */ e(Ie, { label: "Provider", value: a.gateway }),
2036
2039
  /* @__PURE__ */ e(
2037
- Ue,
2040
+ Ie,
2038
2041
  {
2039
2042
  label: "Amount",
2040
2043
  value: `${a.fiatAmount} ${a.fiatCurrency}`
2041
2044
  }
2042
2045
  ),
2043
2046
  /* @__PURE__ */ e(
2044
- Ue,
2047
+ Ie,
2045
2048
  {
2046
2049
  label: "Receiving",
2047
2050
  value: `${a.cryptoAmount || "..."} ${a.cryptoCurrency}`
2048
2051
  }
2049
2052
  ),
2050
- /* @__PURE__ */ e(Ue, { label: "Network", value: a.network }),
2053
+ /* @__PURE__ */ e(Ie, { label: "Network", value: a.network }),
2051
2054
  /* @__PURE__ */ e(
2052
- Ue,
2055
+ Ie,
2053
2056
  {
2054
2057
  label: "To Address",
2055
2058
  value: `${a.walletAddress.slice(0, 10)}...${a.walletAddress.slice(-8)}`,
@@ -2057,14 +2060,14 @@ function rn({ className: t = "" }) {
2057
2060
  }
2058
2061
  )
2059
2062
  ] }),
2060
- /* @__PURE__ */ l("div", { className: "mt-6", children: [
2063
+ /* @__PURE__ */ i("div", { className: "mt-6", children: [
2061
2064
  /* @__PURE__ */ e("p", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "This usually takes a few minutes." }),
2062
2065
  /* @__PURE__ */ e("p", { className: "text-[12px] mt-1", style: { color: "var(--t-text-muted)" }, children: "You can safely close this page - we'll send you an email when complete." })
2063
2066
  ] })
2064
2067
  ] });
2065
2068
  }
2066
- function Ue({ label: t, value: a, mono: n }) {
2067
- return /* @__PURE__ */ l(
2069
+ function Ie({ label: t, value: a, mono: n }) {
2070
+ return /* @__PURE__ */ i(
2068
2071
  "div",
2069
2072
  {
2070
2073
  className: "flex justify-between items-center py-2",
@@ -2083,13 +2086,13 @@ function Ue({ label: t, value: a, mono: n }) {
2083
2086
  }
2084
2087
  );
2085
2088
  }
2086
- function on({
2089
+ function ln({
2087
2090
  className: t = "",
2088
2091
  explorerUrl: a,
2089
2092
  onDone: n,
2090
2093
  doneButtonText: r = "Done"
2091
2094
  }) {
2092
- const { orderStatus: o, state: d, dispatch: u } = Fe(), i = d.flowType === "sell", s = () => {
2095
+ const { orderStatus: o, state: d, dispatch: u } = Me(), l = d.flowType === "sell", c = () => {
2093
2096
  if (!(o != null && o.transactionHash)) return null;
2094
2097
  if (!a) {
2095
2098
  const f = {
@@ -2108,8 +2111,8 @@ function on({
2108
2111
  return a.replace("{txHash}", o.transactionHash);
2109
2112
  }, m = () => {
2110
2113
  n ? n() : u({ type: "RESET" });
2111
- }, h = s();
2112
- return /* @__PURE__ */ l("div", { className: `flex flex-col items-center px-8 py-12 text-center ${t}`, children: [
2114
+ }, p = c();
2115
+ return /* @__PURE__ */ i("div", { className: `flex flex-col items-center px-8 py-12 text-center ${t}`, children: [
2113
2116
  /* @__PURE__ */ e(
2114
2117
  "div",
2115
2118
  {
@@ -2118,27 +2121,27 @@ function on({
2118
2121
  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" }) })
2119
2122
  }
2120
2123
  ),
2121
- /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: i ? "Sale Complete!" : "Purchase Complete!" }),
2122
- /* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: i ? `Your ${(o == null ? void 0 : o.fiatCurrency) || d.fiatCurrency} payout is being processed.` : `Your ${(o == null ? void 0 : o.cryptoCurrency) || d.cryptoCurrency} has been sent to your wallet.` }),
2123
- o && /* @__PURE__ */ l("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
2124
+ /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: l ? "Sale Complete!" : "Purchase Complete!" }),
2125
+ /* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: l ? `Your ${(o == null ? void 0 : o.fiatCurrency) || d.fiatCurrency} payout is being processed.` : `Your ${(o == null ? void 0 : o.cryptoCurrency) || d.cryptoCurrency} has been sent to your wallet.` }),
2126
+ o && /* @__PURE__ */ i("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
2124
2127
  /* @__PURE__ */ e(
2125
- xe,
2128
+ ge,
2126
2129
  {
2127
- label: i ? "Amount Sold" : "Amount Received",
2130
+ label: l ? "Amount Sold" : "Amount Received",
2128
2131
  value: `${o.cryptoAmount} ${o.cryptoCurrency}`,
2129
2132
  highlight: !0
2130
2133
  }
2131
2134
  ),
2132
2135
  /* @__PURE__ */ e(
2133
- xe,
2136
+ ge,
2134
2137
  {
2135
- label: i ? "Payout Amount" : "Amount Paid",
2138
+ label: l ? "Payout Amount" : "Amount Paid",
2136
2139
  value: `${o.fiatAmount} ${o.fiatCurrency}`
2137
2140
  }
2138
2141
  ),
2139
- /* @__PURE__ */ e(xe, { label: "Network", value: o.network }),
2142
+ /* @__PURE__ */ e(ge, { label: "Network", value: o.network }),
2140
2143
  /* @__PURE__ */ e(
2141
- xe,
2144
+ ge,
2142
2145
  {
2143
2146
  label: "Wallet",
2144
2147
  value: `${o.walletAddress.slice(0, 10)}...${o.walletAddress.slice(-8)}`,
@@ -2146,28 +2149,28 @@ function on({
2146
2149
  }
2147
2150
  ),
2148
2151
  o.transactionHash && /* @__PURE__ */ e(
2149
- xe,
2152
+ ge,
2150
2153
  {
2151
2154
  label: "Transaction",
2152
2155
  value: `${o.transactionHash.slice(0, 10)}...${o.transactionHash.slice(-8)}`,
2153
2156
  mono: !0
2154
2157
  }
2155
2158
  ),
2156
- /* @__PURE__ */ e(xe, { label: "Provider", value: o.gateway }),
2157
- /* @__PURE__ */ e(xe, { label: "Order ID", value: o.orderId, mono: !0 }),
2159
+ /* @__PURE__ */ e(ge, { label: "Provider", value: o.gateway }),
2160
+ /* @__PURE__ */ e(ge, { label: "Order ID", value: o.orderId, mono: !0 }),
2158
2161
  o.completedAt && /* @__PURE__ */ e(
2159
- xe,
2162
+ ge,
2160
2163
  {
2161
2164
  label: "Completed",
2162
2165
  value: new Date(o.completedAt).toLocaleString()
2163
2166
  }
2164
2167
  )
2165
2168
  ] }),
2166
- /* @__PURE__ */ l("div", { className: "w-full flex flex-col gap-2", children: [
2167
- h && /* @__PURE__ */ e(
2169
+ /* @__PURE__ */ i("div", { className: "w-full flex flex-col gap-2", children: [
2170
+ p && /* @__PURE__ */ e(
2168
2171
  "a",
2169
2172
  {
2170
- href: h,
2173
+ href: p,
2171
2174
  target: "_blank",
2172
2175
  rel: "noopener noreferrer",
2173
2176
  className: "w-full font-semibold text-[14px] flex items-center justify-center transition-all",
@@ -2187,8 +2190,8 @@ function on({
2187
2190
  ] })
2188
2191
  ] });
2189
2192
  }
2190
- function xe({ label: t, value: a, mono: n, highlight: r }) {
2191
- return /* @__PURE__ */ l(
2193
+ function ge({ label: t, value: a, mono: n, highlight: r }) {
2194
+ return /* @__PURE__ */ i(
2192
2195
  "div",
2193
2196
  {
2194
2197
  className: "flex justify-between items-center py-2",
@@ -2207,14 +2210,16 @@ function xe({ label: t, value: a, mono: n, highlight: r }) {
2207
2210
  }
2208
2211
  );
2209
2212
  }
2210
- function ln({
2213
+ function cn({
2211
2214
  className: t = "",
2212
2215
  onRetry: a,
2213
- supportEmail: n = "support@nowramp.com"
2216
+ onDone: n,
2217
+ doneButtonText: r,
2218
+ supportEmail: o = "support@nowramp.com"
2214
2219
  }) {
2215
- const { state: r, orderStatus: o, dispatch: d, goToStep: u } = Fe(), i = r.flowType === "sell", s = () => {
2216
- if (o)
2217
- switch (o.status) {
2220
+ const { state: d, orderStatus: u, dispatch: l, goToStep: c } = Me(), m = d.flowType === "sell", p = () => {
2221
+ if (u)
2222
+ switch (u.status) {
2218
2223
  case "failed":
2219
2224
  return "Payment Failed";
2220
2225
  case "cancelled":
@@ -2227,28 +2232,28 @@ function ln({
2227
2232
  return "Something Went Wrong";
2228
2233
  }
2229
2234
  return "Something Went Wrong";
2230
- }, m = () => {
2231
- if (r.errorMessage) return r.errorMessage;
2232
- if (o)
2233
- switch (o.status) {
2235
+ }, f = () => {
2236
+ if (d.errorMessage) return d.errorMessage;
2237
+ if (u)
2238
+ switch (u.status) {
2234
2239
  case "failed":
2235
- return i ? "Your sale could not be processed. Please try again." : "Your payment could not be processed. Please try again or use a different payment method.";
2240
+ return m ? "Your sale could not be processed. Please try again." : "Your payment could not be processed. Please try again or use a different payment method.";
2236
2241
  case "cancelled":
2237
- return i ? "Your sale was cancelled. No crypto was transferred." : "Your order was cancelled. No payment was processed.";
2242
+ return m ? "Your sale was cancelled. No crypto was transferred." : "Your order was cancelled. No payment was processed.";
2238
2243
  case "expired":
2239
- return i ? "Your order has expired. Please start a new sale." : "Your order has expired. Please start a new purchase.";
2244
+ return m ? "Your order has expired. Please start a new sale." : "Your order has expired. Please start a new purchase.";
2240
2245
  case "refunded":
2241
- return i ? "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.";
2246
+ return m ? "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.";
2242
2247
  default:
2243
2248
  return "An unexpected error occurred. Please try again.";
2244
2249
  }
2245
2250
  return "An unexpected error occurred. Please try again.";
2246
- }, h = () => {
2247
- d({ type: "CLEAR_ERROR" }), a ? a() : (d({ type: "RESET" }), u("amount"));
2248
- }, f = () => {
2249
- d({ type: "RESET" }), u("amount");
2251
+ }, C = () => {
2252
+ l({ type: "CLEAR_ERROR" }), a ? a() : (l({ type: "RESET" }), c("amount"));
2253
+ }, S = () => {
2254
+ l({ type: "RESET" }), c("amount");
2250
2255
  };
2251
- return /* @__PURE__ */ l("div", { className: `flex flex-col items-center px-8 py-12 text-center ${t}`, children: [
2256
+ return /* @__PURE__ */ i("div", { className: `flex flex-col items-center px-8 py-12 text-center ${t}`, children: [
2252
2257
  /* @__PURE__ */ e(
2253
2258
  "div",
2254
2259
  {
@@ -2257,19 +2262,19 @@ function ln({
2257
2262
  children: /* @__PURE__ */ e("svg", { viewBox: "0 0 24 24", width: "32", height: "32", fill: "white", children: /* @__PURE__ */ e("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z" }) })
2258
2263
  }
2259
2264
  ),
2260
- /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: s() }),
2261
- /* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: m() }),
2262
- o && /* @__PURE__ */ e("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: /* @__PURE__ */ l("div", { className: "flex justify-between items-center py-2", children: [
2265
+ /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: p() }),
2266
+ /* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: f() }),
2267
+ u && /* @__PURE__ */ e("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: /* @__PURE__ */ i("div", { className: "flex justify-between items-center py-2", children: [
2263
2268
  /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Order ID" }),
2264
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium font-mono", style: { color: "var(--t-text)" }, children: o.orderId })
2269
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium font-mono", style: { color: "var(--t-text)" }, children: u.orderId })
2265
2270
  ] }) }),
2266
- /* @__PURE__ */ l("div", { className: "w-full flex flex-col gap-2", children: [
2271
+ /* @__PURE__ */ i("div", { className: "w-full flex flex-col gap-2", children: [
2267
2272
  /* @__PURE__ */ e(
2268
2273
  "button",
2269
2274
  {
2270
2275
  className: "w-full font-semibold text-[16px] transition-all",
2271
2276
  style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)" },
2272
- onClick: h,
2277
+ onClick: C,
2273
2278
  children: "Try Again"
2274
2279
  }
2275
2280
  ),
@@ -2278,28 +2283,44 @@ function ln({
2278
2283
  {
2279
2284
  className: "w-full font-semibold text-[14px] transition-all",
2280
2285
  style: { height: 48, borderRadius: 5, background: "var(--t-surface)", color: "var(--t-text)" },
2281
- onClick: f,
2286
+ onClick: S,
2282
2287
  children: "Start Over"
2283
2288
  }
2289
+ ),
2290
+ n && /* @__PURE__ */ e(
2291
+ "button",
2292
+ {
2293
+ className: "w-full font-semibold text-[14px] transition-all mt-1",
2294
+ style: {
2295
+ height: 48,
2296
+ borderRadius: 5,
2297
+ background: "transparent",
2298
+ color: "var(--t-text-secondary)",
2299
+ border: "1px solid var(--t-divider)"
2300
+ },
2301
+ onClick: n,
2302
+ "aria-label": r || "Return to merchant",
2303
+ children: r || "Return"
2304
+ }
2284
2305
  )
2285
2306
  ] }),
2286
- /* @__PURE__ */ l("div", { className: "mt-6", children: [
2287
- /* @__PURE__ */ l("p", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: [
2307
+ /* @__PURE__ */ i("div", { className: "mt-6", children: [
2308
+ /* @__PURE__ */ i("p", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: [
2288
2309
  "Need help? Contact",
2289
2310
  " ",
2290
2311
  /* @__PURE__ */ e(
2291
2312
  "a",
2292
2313
  {
2293
- href: `mailto:${n}`,
2314
+ href: `mailto:${o}`,
2294
2315
  className: "underline",
2295
2316
  style: { color: "var(--t-accent)" },
2296
- children: n
2317
+ children: o
2297
2318
  }
2298
2319
  )
2299
2320
  ] }),
2300
- o && /* @__PURE__ */ l("p", { className: "text-[12px] mt-1", style: { color: "var(--t-text-muted)" }, children: [
2321
+ u && /* @__PURE__ */ i("p", { className: "text-[12px] mt-1", style: { color: "var(--t-text-muted)" }, children: [
2301
2322
  "Reference: ",
2302
- o.orderId
2323
+ u.orderId
2303
2324
  ] })
2304
2325
  ] })
2305
2326
  ] });
@@ -2307,53 +2328,53 @@ function ln({
2307
2328
  function Yt(t) {
2308
2329
  return t.length <= 12 ? t : `${t.slice(0, 6)}...${t.slice(-6)}`;
2309
2330
  }
2310
- function cn({ className: t = "", stablecoinParity: a, partnerName: n }) {
2311
- var te;
2331
+ function sn({ className: t = "", stablecoinParity: a, partnerName: n }) {
2332
+ var ce;
2312
2333
  const {
2313
2334
  config: r,
2314
2335
  configLoading: o,
2315
2336
  state: d,
2316
2337
  defaultGateway: u,
2317
- quotes: i,
2318
- fetchQuotes: s,
2338
+ quotes: l,
2339
+ fetchQuotes: c,
2319
2340
  createOrder: m,
2320
- orderLoading: h
2321
- } = Fe(), f = d.flowType === "sell", [y, x] = N(null), C = r == null ? void 0 : r.gateways.find((X) => X.id === u), E = (te = i == null ? void 0 : i.bestQuote) != null && te.exchangeRate ? parseFloat(i.bestQuote.exchangeRate) : null, k = parseFloat(d.fiatAmount) || 0, _ = !!(a && n && !f && ea(d.cryptoCurrency) && E), ie = _ && d.cryptoCurrency.toUpperCase().includes(d.fiatCurrency.toUpperCase()), G = _ && k > 0 ? ht(ie ? k : k / E) : null, z = async () => {
2322
- x(null);
2341
+ orderLoading: p
2342
+ } = Me(), f = d.flowType === "sell", [C, S] = A(null), k = r == null ? void 0 : r.gateways.find((_) => _.id === u), w = (ce = l == null ? void 0 : l.bestQuote) != null && ce.exchangeRate ? parseFloat(l.bestQuote.exchangeRate) : null, y = parseFloat(d.fiatAmount) || 0, O = !!(a && n && !f && ea(d.cryptoCurrency) && w), le = O && d.cryptoCurrency.toUpperCase().includes(d.fiatCurrency.toUpperCase()), G = O && y > 0 ? pt(le ? y : y / w) : null, z = async () => {
2343
+ S(null);
2323
2344
  try {
2324
- s(), await m();
2325
- } catch (X) {
2326
- const ve = X instanceof Error ? X.message : "Failed to create order";
2327
- x(ve);
2345
+ c(), await m();
2346
+ } catch (_) {
2347
+ const ne = _ instanceof Error ? _.message : "Failed to create order";
2348
+ S(ne);
2328
2349
  }
2329
2350
  };
2330
- return o ? /* @__PURE__ */ l("div", { className: `flex flex-col items-center justify-center p-12 ${t}`, children: [
2351
+ return o ? /* @__PURE__ */ i("div", { className: `flex flex-col items-center justify-center p-12 ${t}`, children: [
2331
2352
  /* @__PURE__ */ e("div", { className: "nramp-spinner" }),
2332
2353
  /* @__PURE__ */ e("p", { className: "text-[14px] mt-4", style: { color: "var(--t-text-secondary)" }, children: "Loading..." })
2333
- ] }) : /* @__PURE__ */ l("div", { className: `flex flex-col items-center px-8 py-12 ${t}`, children: [
2354
+ ] }) : /* @__PURE__ */ i("div", { className: `flex flex-col items-center px-8 py-12 ${t}`, children: [
2334
2355
  /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-6", style: { color: "var(--t-text)" }, children: f ? "Confirm Sale" : "Confirm Purchase" }),
2335
- /* @__PURE__ */ l("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
2336
- C && /* @__PURE__ */ l("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
2356
+ /* @__PURE__ */ i("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
2357
+ k && /* @__PURE__ */ i("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
2337
2358
  /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Provider" }),
2338
- /* @__PURE__ */ l("span", { className: "flex items-center gap-2", children: [
2339
- C.logo && /* @__PURE__ */ e("img", { src: C.logo, alt: C.name, width: 20, height: 20, style: { borderRadius: 4 } }),
2340
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: C.name })
2359
+ /* @__PURE__ */ i("span", { className: "flex items-center gap-2", children: [
2360
+ k.logo && /* @__PURE__ */ e("img", { src: k.logo, alt: k.name, width: 20, height: 20, style: { borderRadius: 4 } }),
2361
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: k.name })
2341
2362
  ] })
2342
2363
  ] }),
2343
- f ? /* @__PURE__ */ l(ee, { children: [
2344
- /* @__PURE__ */ e(Ae, { label: "You sell", value: `${d.cryptoAmount} ${d.cryptoCurrency}`, highlight: !0 }),
2345
- /* @__PURE__ */ e(Ae, { label: "You receive", value: `${d.fiatCurrency} payout` })
2346
- ] }) : /* @__PURE__ */ l(ee, { children: [
2347
- /* @__PURE__ */ e(Ae, { label: "You pay", value: `${d.fiatAmount} ${d.fiatCurrency}`, highlight: !0 }),
2364
+ f ? /* @__PURE__ */ i(ae, { children: [
2365
+ /* @__PURE__ */ e(Re, { label: "You sell", value: `${d.cryptoAmount} ${d.cryptoCurrency}`, highlight: !0 }),
2366
+ /* @__PURE__ */ e(Re, { label: "You receive", value: `${d.fiatCurrency} payout` })
2367
+ ] }) : /* @__PURE__ */ i(ae, { children: [
2368
+ /* @__PURE__ */ e(Re, { label: "You pay", value: `${d.fiatAmount} ${d.fiatCurrency}`, highlight: !0 }),
2348
2369
  /* @__PURE__ */ e(
2349
- Ae,
2370
+ Re,
2350
2371
  {
2351
2372
  label: "You receive",
2352
2373
  value: G ? `${G} ${d.cryptoCurrency}` : `${d.cryptoCurrency} on ${d.network}`
2353
2374
  }
2354
2375
  ),
2355
- /* @__PURE__ */ e(Ae, { label: "Wallet", value: Yt(d.walletAddress), mono: !0 }),
2356
- _ && G && /* @__PURE__ */ l("div", { className: "py-2 text-[11px]", style: { color: "var(--t-text-muted)", lineHeight: "15px" }, children: [
2376
+ /* @__PURE__ */ e(Re, { label: "Wallet", value: Yt(d.walletAddress), mono: !0 }),
2377
+ O && G && /* @__PURE__ */ i("div", { className: "py-2 text-[11px]", style: { color: "var(--t-text-muted)", lineHeight: "15px" }, children: [
2357
2378
  "Charged amount from provider may differ. The rest up to ",
2358
2379
  G,
2359
2380
  " ",
@@ -2363,18 +2384,18 @@ function cn({ className: t = "", stablecoinParity: a, partnerName: n }) {
2363
2384
  " account."
2364
2385
  ] })
2365
2386
  ] }),
2366
- /* @__PURE__ */ e(Ae, { label: "Network", value: d.network }),
2367
- f && d.walletAddress && /* @__PURE__ */ e(Ae, { label: "Refund address", value: Yt(d.walletAddress), mono: !0 })
2387
+ /* @__PURE__ */ e(Re, { label: "Network", value: d.network }),
2388
+ f && d.walletAddress && /* @__PURE__ */ e(Re, { label: "Refund address", value: Yt(d.walletAddress), mono: !0 })
2368
2389
  ] }),
2369
- y && /* @__PURE__ */ e("p", { className: "text-[12px] mb-4", style: { color: "#EF4444" }, children: y }),
2390
+ C && /* @__PURE__ */ e("p", { className: "text-[12px] mb-4", style: { color: "#EF4444" }, children: C }),
2370
2391
  /* @__PURE__ */ e(
2371
2392
  "button",
2372
2393
  {
2373
2394
  className: "w-full font-semibold text-[16px] transition-all flex items-center justify-center gap-2",
2374
- style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)", opacity: h ? 0.7 : 1 },
2375
- disabled: h,
2395
+ style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)", opacity: p ? 0.7 : 1 },
2396
+ disabled: p,
2376
2397
  onClick: z,
2377
- children: h ? /* @__PURE__ */ l(ee, { children: [
2398
+ children: p ? /* @__PURE__ */ i(ae, { children: [
2378
2399
  /* @__PURE__ */ e("span", { className: "nramp-spinner-inline" }),
2379
2400
  "Processing..."
2380
2401
  ] }) : f ? "Confirm & Sell" : "Confirm & Pay"
@@ -2382,8 +2403,8 @@ function cn({ className: t = "", stablecoinParity: a, partnerName: n }) {
2382
2403
  )
2383
2404
  ] });
2384
2405
  }
2385
- function Ae({ label: t, value: a, mono: n, highlight: r }) {
2386
- return /* @__PURE__ */ l("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
2406
+ function Re({ label: t, value: a, mono: n, highlight: r }) {
2407
+ return /* @__PURE__ */ i("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
2387
2408
  /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: t }),
2388
2409
  /* @__PURE__ */ e(
2389
2410
  "span",
@@ -2400,26 +2421,26 @@ function je({
2400
2421
  onClose: a,
2401
2422
  children: n
2402
2423
  }) {
2403
- const [r, o] = N(!1), [d, u] = N(!1);
2424
+ const [r, o] = A(!1), [d, u] = A(!1);
2404
2425
  Z(() => {
2405
2426
  if (t)
2406
2427
  o(!0), requestAnimationFrame(() => requestAnimationFrame(() => u(!0)));
2407
2428
  else if (r) {
2408
2429
  u(!1);
2409
- const s = setTimeout(() => o(!1), 250);
2410
- return () => clearTimeout(s);
2430
+ const c = setTimeout(() => o(!1), 250);
2431
+ return () => clearTimeout(c);
2411
2432
  }
2412
2433
  }, [t]);
2413
- const i = P(() => {
2434
+ const l = B(() => {
2414
2435
  u(!1), setTimeout(() => a(), 250);
2415
2436
  }, [a]);
2416
2437
  return Z(() => {
2417
2438
  if (!t) return;
2418
- const s = (m) => {
2419
- m.key === "Escape" && i();
2439
+ const c = (m) => {
2440
+ m.key === "Escape" && l();
2420
2441
  };
2421
- return window.addEventListener("keydown", s), () => window.removeEventListener("keydown", s);
2422
- }, [t, i]), r ? /* @__PURE__ */ e(
2442
+ return window.addEventListener("keydown", c), () => window.removeEventListener("keydown", c);
2443
+ }, [t, l]), r ? /* @__PURE__ */ e(
2423
2444
  "div",
2424
2445
  {
2425
2446
  className: "absolute inset-0 z-20 transition-opacity duration-250",
@@ -2429,23 +2450,23 @@ function je({
2429
2450
  {
2430
2451
  className: "absolute inset-0 flex flex-col transition-transform duration-250 ease-out",
2431
2452
  style: { background: "var(--t-modal-bg)", transform: d ? "translateY(0)" : "translateY(24px)" },
2432
- children: typeof n == "function" ? n(i) : n
2453
+ children: typeof n == "function" ? n(l) : n
2433
2454
  }
2434
2455
  )
2435
2456
  }
2436
2457
  ) : null;
2437
2458
  }
2438
- function sn({ char: t, height: a = 38 }) {
2459
+ function dn({ char: t, height: a = 38 }) {
2439
2460
  const n = "0123456789", r = n.indexOf(t);
2440
2461
  return r === -1 ? /* @__PURE__ */ e("span", { children: t }) : /* @__PURE__ */ e("span", { className: "digit-slot", style: { height: a, lineHeight: `${a}px` }, children: /* @__PURE__ */ e("span", { className: "digit-slot-inner block", style: { transform: `translateY(-${r * a}px)` }, children: n.split("").map((o) => /* @__PURE__ */ e("span", { className: "block", style: { height: a, lineHeight: `${a}px` }, children: o }, o)) }) });
2441
2462
  }
2442
- function dn({
2463
+ function un({
2443
2464
  value: t,
2444
2465
  height: a = 38,
2445
2466
  className: n = "",
2446
2467
  style: r = {}
2447
2468
  }) {
2448
- return /* @__PURE__ */ e("span", { className: n, style: { display: "inline-flex", ...r }, children: t.split("").map((o, d) => /* @__PURE__ */ e(sn, { char: o, height: a }, d)) });
2469
+ return /* @__PURE__ */ e("span", { className: n, style: { display: "inline-flex", ...r }, children: t.split("").map((o, d) => /* @__PURE__ */ e(dn, { char: o, height: a }, d)) });
2449
2470
  }
2450
2471
  function V({
2451
2472
  w: t,
@@ -2454,27 +2475,27 @@ function V({
2454
2475
  }) {
2455
2476
  return /* @__PURE__ */ e("div", { className: `skeleton ${n}`, style: { width: t, height: a } });
2456
2477
  }
2457
- function un() {
2458
- return /* @__PURE__ */ l("div", { className: "flex-1 px-5 flex flex-col", children: [
2459
- /* @__PURE__ */ l("div", { className: "px-[18px] pt-[14px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5 }, children: [
2478
+ function mn() {
2479
+ return /* @__PURE__ */ i("div", { className: "flex-1 px-5 flex flex-col", children: [
2480
+ /* @__PURE__ */ i("div", { className: "px-[18px] pt-[14px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5 }, children: [
2460
2481
  /* @__PURE__ */ e(V, { w: 70, h: 14, className: "mb-3" }),
2461
- /* @__PURE__ */ l("div", { className: "flex justify-between items-center", children: [
2482
+ /* @__PURE__ */ i("div", { className: "flex justify-between items-center", children: [
2462
2483
  /* @__PURE__ */ e(V, { w: 120, h: 32 }),
2463
2484
  /* @__PURE__ */ e(V, { w: 75, h: 32 })
2464
2485
  ] })
2465
2486
  ] }),
2466
- /* @__PURE__ */ l("div", { className: "px-[18px] pt-[12px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5, marginTop: 4 }, children: [
2487
+ /* @__PURE__ */ i("div", { className: "px-[18px] pt-[12px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5, marginTop: 4 }, children: [
2467
2488
  /* @__PURE__ */ e(V, { w: 50, h: 14, className: "mb-3" }),
2468
- /* @__PURE__ */ l("div", { className: "flex justify-between items-center", children: [
2489
+ /* @__PURE__ */ i("div", { className: "flex justify-between items-center", children: [
2469
2490
  /* @__PURE__ */ e(V, { w: 180, h: 32 }),
2470
2491
  /* @__PURE__ */ e(V, { w: 85, h: 32 })
2471
2492
  ] })
2472
2493
  ] }),
2473
- /* @__PURE__ */ l("div", { className: "flex justify-between mt-3 px-[2px]", children: [
2494
+ /* @__PURE__ */ i("div", { className: "flex justify-between mt-3 px-[2px]", children: [
2474
2495
  /* @__PURE__ */ e(V, { w: 140, h: 12 }),
2475
2496
  /* @__PURE__ */ e(V, { w: 90, h: 12 })
2476
2497
  ] }),
2477
- /* @__PURE__ */ l("div", { className: "mt-8", children: [
2498
+ /* @__PURE__ */ i("div", { className: "mt-8", children: [
2478
2499
  /* @__PURE__ */ e(V, { w: 65, h: 14, className: "mb-2.5" }),
2479
2500
  /* @__PURE__ */ e(V, { w: "100%", h: 47 })
2480
2501
  ] }),
@@ -2483,7 +2504,7 @@ function un() {
2483
2504
  /* @__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" }) })
2484
2505
  ] });
2485
2506
  }
2486
- function De({ onClick: t }) {
2507
+ function Be({ onClick: t }) {
2487
2508
  return /* @__PURE__ */ e(
2488
2509
  "button",
2489
2510
  {
@@ -2496,13 +2517,13 @@ function De({ onClick: t }) {
2496
2517
  }
2497
2518
  );
2498
2519
  }
2499
- function $e({
2520
+ function We({
2500
2521
  value: t,
2501
2522
  onChange: a,
2502
2523
  placeholder: n = ""
2503
2524
  }) {
2504
- const [r, o] = N(!1);
2505
- return /* @__PURE__ */ l("div", { className: "relative mx-5 mb-5", children: [
2525
+ const [r, o] = A(!1);
2526
+ return /* @__PURE__ */ i("div", { className: "relative mx-5 mb-5", children: [
2506
2527
  /* @__PURE__ */ e(
2507
2528
  "input",
2508
2529
  {
@@ -2527,38 +2548,38 @@ function $e({
2527
2548
  )
2528
2549
  ] });
2529
2550
  }
2530
- function mn({
2551
+ function fn({
2531
2552
  onClose: t,
2532
2553
  onSelect: a,
2533
2554
  currencies: n,
2534
2555
  assetBaseUrl: r = "",
2535
2556
  selectedCode: o
2536
2557
  }) {
2537
- const [d, u] = N(""), i = j(() => {
2558
+ const [d, u] = A(""), l = j(() => {
2538
2559
  if (!n || n.length === 0) return _t;
2539
- const m = new Map(_t.map((h) => [h.code, h.name]));
2540
- return n.map((h) => ({
2541
- code: h.code,
2542
- name: h.name || m.get(h.code) || h.code
2560
+ const m = new Map(_t.map((p) => [p.code, p.name]));
2561
+ return n.map((p) => ({
2562
+ code: p.code,
2563
+ name: p.name || m.get(p.code) || p.code
2543
2564
  }));
2544
- }, [n]), s = j(() => {
2565
+ }, [n]), c = j(() => {
2545
2566
  const m = d.trim().toLowerCase();
2546
2567
  if (!m) {
2547
2568
  if (o) {
2548
- const h = i.find((f) => f.code === o);
2549
- if (h) {
2550
- const f = i.filter((y) => y.code !== o);
2551
- return [h, ...f];
2569
+ const p = l.find((f) => f.code === o);
2570
+ if (p) {
2571
+ const f = l.filter((C) => C.code !== o);
2572
+ return [p, ...f];
2552
2573
  }
2553
2574
  }
2554
- return i;
2575
+ return l;
2555
2576
  }
2556
- return i.filter(
2557
- (h) => h.code.toLowerCase().includes(m) || h.name.toLowerCase().includes(m)
2577
+ return l.filter(
2578
+ (p) => p.code.toLowerCase().includes(m) || p.name.toLowerCase().includes(m)
2558
2579
  );
2559
- }, [i, d, o]);
2560
- return /* @__PURE__ */ l(ee, { children: [
2561
- /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(De, { onClick: t }) }),
2580
+ }, [l, d, o]);
2581
+ return /* @__PURE__ */ i(ae, { children: [
2582
+ /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Be, { onClick: t }) }),
2562
2583
  /* @__PURE__ */ e(
2563
2584
  "h2",
2564
2585
  {
@@ -2573,24 +2594,24 @@ function mn({
2573
2594
  children: "Select fiat currency"
2574
2595
  }
2575
2596
  ),
2576
- /* @__PURE__ */ e($e, { value: d, onChange: u }),
2577
- /* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
2578
- s.map((m, h) => {
2579
- const f = m.name !== m.code ? m.name : "", y = o === m.code;
2580
- return /* @__PURE__ */ l("div", { children: [
2581
- /* @__PURE__ */ l(
2597
+ /* @__PURE__ */ e(We, { value: d, onChange: u }),
2598
+ /* @__PURE__ */ i("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
2599
+ c.map((m, p) => {
2600
+ const f = m.name !== m.code ? m.name : "", C = o === m.code;
2601
+ return /* @__PURE__ */ i("div", { children: [
2602
+ /* @__PURE__ */ i(
2582
2603
  "button",
2583
2604
  {
2584
2605
  onClick: () => a(m.code),
2585
2606
  className: "flex items-center w-full transition-colors rounded-lg hover-item",
2586
2607
  style: { color: "var(--t-text)", gap: 14, padding: "18px 8px", margin: "0 -8px" },
2587
2608
  children: [
2588
- /* @__PURE__ */ e(pt, { currencyCode: m.code, size: 32, baseUrl: r }),
2589
- /* @__PURE__ */ l("div", { className: "text-left flex-1 flex items-center gap-2", children: [
2609
+ /* @__PURE__ */ e(ht, { currencyCode: m.code, size: 32, baseUrl: r }),
2610
+ /* @__PURE__ */ i("div", { className: "text-left flex-1 flex items-center gap-2", children: [
2590
2611
  /* @__PURE__ */ e("span", { className: "font-semibold text-[15px]", children: m.code }),
2591
2612
  f && /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: f })
2592
2613
  ] }),
2593
- y && /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", className: "shrink-0", children: /* @__PURE__ */ e(
2614
+ C && /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", className: "shrink-0", children: /* @__PURE__ */ e(
2594
2615
  "path",
2595
2616
  {
2596
2617
  d: "M13.5 4.5L6 12L2.5 8.5",
@@ -2603,7 +2624,7 @@ function mn({
2603
2624
  ]
2604
2625
  }
2605
2626
  ),
2606
- h < s.length - 1 && /* @__PURE__ */ e(
2627
+ p < c.length - 1 && /* @__PURE__ */ e(
2607
2628
  "div",
2608
2629
  {
2609
2630
  style: { height: 1, background: "var(--t-divider, rgba(255,255,255,0.08))" }
@@ -2611,23 +2632,23 @@ function mn({
2611
2632
  )
2612
2633
  ] }, m.code);
2613
2634
  }),
2614
- s.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No currencies found" })
2635
+ c.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No currencies found" })
2615
2636
  ] })
2616
2637
  ] });
2617
2638
  }
2618
2639
  function Zt({ src: t, alt: a, size: n, className: r, style: o }) {
2619
- const [d, u] = N(!1), [i, s] = N(!1), m = I(t);
2620
- m.current !== t && (m.current = t, u(!1), s(!1));
2621
- const h = P(() => u(!0), []), f = P(() => s(!0), []);
2622
- return /* @__PURE__ */ l("div", { className: r, style: { ...o, width: n, height: n, position: "relative" }, children: [
2623
- !d && !i && /* @__PURE__ */ e(
2640
+ const [d, u] = A(!1), [l, c] = A(!1), m = M(t);
2641
+ m.current !== t && (m.current = t, u(!1), c(!1));
2642
+ const p = B(() => u(!0), []), f = B(() => c(!0), []);
2643
+ return /* @__PURE__ */ i("div", { className: r, style: { ...o, width: n, height: n, position: "relative" }, children: [
2644
+ !d && !l && /* @__PURE__ */ e(
2624
2645
  "div",
2625
2646
  {
2626
2647
  className: "absolute inset-0 rounded-full animate-pulse",
2627
2648
  style: { background: "var(--t-pill-bg, #333)" }
2628
2649
  }
2629
2650
  ),
2630
- i ? /* @__PURE__ */ e(
2651
+ l ? /* @__PURE__ */ e(
2631
2652
  "div",
2632
2653
  {
2633
2654
  className: "absolute inset-0 rounded-full flex items-center justify-center text-[10px] font-bold",
@@ -2641,7 +2662,7 @@ function Zt({ src: t, alt: a, size: n, className: r, style: o }) {
2641
2662
  alt: a,
2642
2663
  width: n,
2643
2664
  height: n,
2644
- onLoad: h,
2665
+ onLoad: p,
2645
2666
  onError: f,
2646
2667
  className: `rounded-full ${d ? "opacity-100" : "opacity-0"}`,
2647
2668
  style: { width: n, height: n, transition: "opacity 0.15s ease-in" }
@@ -2649,51 +2670,51 @@ function Zt({ src: t, alt: a, size: n, className: r, style: o }) {
2649
2670
  )
2650
2671
  ] });
2651
2672
  }
2652
- function fn({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selectedCode: o, selectedChain: d }) {
2653
- const [u, i] = N(""), s = j(() => {
2654
- if (!n || n.length === 0) return _a;
2673
+ function pn({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selectedCode: o, selectedChain: d }) {
2674
+ const [u, l] = A(""), c = j(() => {
2675
+ if (!n || n.length === 0) return Va;
2655
2676
  const f = [];
2656
- for (const y of n) {
2657
- const x = y.networks || [], C = y.name || Ba[y.code] || y.code;
2658
- if (x.length === 0)
2659
- f.push({ code: y.code, name: C, chain: y.code, popular: !1 });
2677
+ for (const C of n) {
2678
+ const S = C.networks || [], k = C.name || Oa[C.code] || C.code;
2679
+ if (S.length === 0)
2680
+ f.push({ code: C.code, name: k, chain: C.code, popular: !1 });
2660
2681
  else
2661
- for (const E of x) {
2662
- const k = E.code || E.id || E.name || y.code;
2682
+ for (const w of S) {
2683
+ const y = w.code || w.id || w.name || C.code;
2663
2684
  f.push({
2664
- code: y.code,
2665
- name: C,
2666
- chain: k,
2667
- chainName: E.name,
2685
+ code: C.code,
2686
+ name: k,
2687
+ chain: y,
2688
+ chainName: w.name,
2668
2689
  popular: !1
2669
2690
  });
2670
2691
  }
2671
2692
  }
2672
2693
  return f;
2673
- }, [n]), m = P((f, y) => o === f && d === y, [o, d]), h = j(() => {
2674
- var C;
2694
+ }, [n]), m = B((f, C) => o === f && d === C, [o, d]), p = j(() => {
2695
+ var k;
2675
2696
  const f = u.trim().toLowerCase();
2676
2697
  if (!f) {
2677
2698
  if (o && d) {
2678
- const E = s.find((k) => k.code === o && k.chain === d);
2679
- if (E) {
2680
- const k = s.filter((_) => !(_.code === o && _.chain === d));
2681
- return [E, ...k];
2699
+ const w = c.find((y) => y.code === o && y.chain === d);
2700
+ if (w) {
2701
+ const y = c.filter((O) => !(O.code === o && O.chain === d));
2702
+ return [w, ...y];
2682
2703
  }
2683
2704
  }
2684
- return s;
2705
+ return c;
2685
2706
  }
2686
- const y = f.split(/\s+/), x = [];
2687
- for (const E of s) {
2688
- const k = tt(E.chain), _ = k ? k.name.toLowerCase() : "", ie = ((C = k == null ? void 0 : k.shortName) == null ? void 0 : C.toLowerCase()) || "", G = E.chain.toLowerCase(), z = E.code.toLowerCase(), te = E.name.toLowerCase(), X = [z, te, _, ie, G];
2689
- if (!y.every((L) => X.some((c) => c.includes(L)))) continue;
2690
- let v = 0;
2691
- z === f ? v += 100 : z.startsWith(y[0]) && (v += 50), E.popular && (v += 10), y.length > 1 && (_.includes(y[1]) || ie.includes(y[1]) || G.includes(y[1])) && (v += 25), x.push({ item: E, score: v });
2707
+ const C = f.split(/\s+/), S = [];
2708
+ for (const w of c) {
2709
+ const y = rt(w.chain), O = y ? y.name.toLowerCase() : "", le = ((k = y == null ? void 0 : y.shortName) == null ? void 0 : k.toLowerCase()) || "", G = w.chain.toLowerCase(), z = w.code.toLowerCase(), ce = w.name.toLowerCase(), _ = [z, ce, O, le, G];
2710
+ if (!C.every((T) => _.some((q) => q.includes(T)))) continue;
2711
+ let g = 0;
2712
+ z === f ? g += 100 : z.startsWith(C[0]) && (g += 50), w.popular && (g += 10), C.length > 1 && (O.includes(C[1]) || le.includes(C[1]) || G.includes(C[1])) && (g += 25), S.push({ item: w, score: g });
2692
2713
  }
2693
- return x.sort((E, k) => k.score - E.score), x.map((E) => E.item);
2694
- }, [s, u, o, d]);
2695
- return /* @__PURE__ */ l(ee, { children: [
2696
- /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(De, { onClick: t }) }),
2714
+ return S.sort((w, y) => y.score - w.score), S.map((w) => w.item);
2715
+ }, [c, u, o, d]);
2716
+ return /* @__PURE__ */ i(ae, { children: [
2717
+ /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Be, { onClick: t }) }),
2697
2718
  /* @__PURE__ */ e(
2698
2719
  "h2",
2699
2720
  {
@@ -2702,19 +2723,19 @@ function fn({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selecte
2702
2723
  children: "Select crypto currency"
2703
2724
  }
2704
2725
  ),
2705
- /* @__PURE__ */ e($e, { value: u, onChange: i }),
2706
- /* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
2707
- h.map((f, y) => {
2708
- const x = tt(f.chain), C = (x == null ? void 0 : x.name) || f.chainName || f.chain, E = f.name !== f.code ? f.name : "", k = m(f.code, f.chain);
2709
- return /* @__PURE__ */ l("div", { children: [
2710
- /* @__PURE__ */ l(
2726
+ /* @__PURE__ */ e(We, { value: u, onChange: l }),
2727
+ /* @__PURE__ */ i("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
2728
+ p.map((f, C) => {
2729
+ const S = rt(f.chain), k = (S == null ? void 0 : S.name) || f.chainName || f.chain, w = f.name !== f.code ? f.name : "", y = m(f.code, f.chain);
2730
+ return /* @__PURE__ */ i("div", { children: [
2731
+ /* @__PURE__ */ i(
2711
2732
  "button",
2712
2733
  {
2713
2734
  onClick: () => a(f.code, f.chain),
2714
2735
  className: "flex items-center w-full transition-colors rounded-lg hover-item",
2715
2736
  style: { gap: 14, padding: "18px 8px", margin: "0 -8px" },
2716
2737
  children: [
2717
- /* @__PURE__ */ l("div", { className: "relative shrink-0", style: { width: 40, height: 40 }, children: [
2738
+ /* @__PURE__ */ i("div", { className: "relative shrink-0", style: { width: 40, height: 40 }, children: [
2718
2739
  /* @__PURE__ */ e(
2719
2740
  "div",
2720
2741
  {
@@ -2752,7 +2773,7 @@ function fn({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selecte
2752
2773
  }
2753
2774
  )
2754
2775
  ] }),
2755
- /* @__PURE__ */ e("div", { className: "text-left flex-1 min-w-0", children: /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
2776
+ /* @__PURE__ */ e("div", { className: "text-left flex-1 min-w-0", children: /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
2756
2777
  /* @__PURE__ */ e(
2757
2778
  "span",
2758
2779
  {
@@ -2761,18 +2782,18 @@ function fn({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selecte
2761
2782
  children: f.code
2762
2783
  }
2763
2784
  ),
2764
- E && /* @__PURE__ */ e(
2785
+ w && /* @__PURE__ */ e(
2765
2786
  "span",
2766
2787
  {
2767
2788
  className: "text-[13px]",
2768
2789
  style: { color: "var(--t-text-secondary)" },
2769
- children: E
2790
+ children: w
2770
2791
  }
2771
2792
  )
2772
2793
  ] }) }),
2773
- /* @__PURE__ */ l("div", { className: "flex items-center gap-2 shrink-0", children: [
2774
- /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: C }),
2775
- k && /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
2794
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-2 shrink-0", children: [
2795
+ /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: k }),
2796
+ y && /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
2776
2797
  "path",
2777
2798
  {
2778
2799
  d: "M13.5 4.5L6 12L2.5 8.5",
@@ -2786,10 +2807,10 @@ function fn({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selecte
2786
2807
  ]
2787
2808
  }
2788
2809
  ),
2789
- y < h.length - 1 && /* @__PURE__ */ e("div", { style: { height: 1, background: "var(--t-divider, rgba(255,255,255,0.08))" } })
2810
+ C < p.length - 1 && /* @__PURE__ */ e("div", { style: { height: 1, background: "var(--t-divider, rgba(255,255,255,0.08))" } })
2790
2811
  ] }, `${f.code}-${f.chain}`);
2791
2812
  }),
2792
- h.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No currencies found" })
2813
+ p.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No currencies found" })
2793
2814
  ] })
2794
2815
  ] });
2795
2816
  }
@@ -2799,24 +2820,24 @@ function hn({
2799
2820
  onSelect: n,
2800
2821
  onClose: r
2801
2822
  }) {
2802
- const [o, d] = N(""), u = j(() => {
2803
- const i = o.trim().toLowerCase();
2804
- if (!i) {
2823
+ const [o, d] = A(""), u = j(() => {
2824
+ const l = o.trim().toLowerCase();
2825
+ if (!l) {
2805
2826
  if (a) {
2806
- const s = t.find((m) => m.id === a);
2807
- if (s) {
2808
- const m = t.filter((h) => h.id !== a);
2809
- return [s, ...m];
2827
+ const c = t.find((m) => m.id === a);
2828
+ if (c) {
2829
+ const m = t.filter((p) => p.id !== a);
2830
+ return [c, ...m];
2810
2831
  }
2811
2832
  }
2812
2833
  return t;
2813
2834
  }
2814
2835
  return t.filter(
2815
- (s) => s.id.toLowerCase().includes(i) || s.name.toLowerCase().includes(i) || s.description && s.description.toLowerCase().includes(i)
2836
+ (c) => c.id.toLowerCase().includes(l) || c.name.toLowerCase().includes(l) || c.description && c.description.toLowerCase().includes(l)
2816
2837
  );
2817
2838
  }, [t, o, a]);
2818
- return /* @__PURE__ */ l(ee, { children: [
2819
- /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(De, { onClick: r }) }),
2839
+ return /* @__PURE__ */ i(ae, { children: [
2840
+ /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Be, { onClick: r }) }),
2820
2841
  /* @__PURE__ */ e(
2821
2842
  "h2",
2822
2843
  {
@@ -2825,41 +2846,41 @@ function hn({
2825
2846
  children: "Choose payment method"
2826
2847
  }
2827
2848
  ),
2828
- /* @__PURE__ */ e($e, { value: o, onChange: d }),
2829
- /* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
2830
- u.map((i, s) => {
2831
- const m = i.id === a, h = aa(i.id, i.name);
2832
- return /* @__PURE__ */ l("div", { children: [
2833
- /* @__PURE__ */ l(
2849
+ /* @__PURE__ */ e(We, { value: o, onChange: d }),
2850
+ /* @__PURE__ */ i("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
2851
+ u.map((l, c) => {
2852
+ const m = l.id === a, p = aa(l.id, l.name);
2853
+ return /* @__PURE__ */ i("div", { children: [
2854
+ /* @__PURE__ */ i(
2834
2855
  "button",
2835
2856
  {
2836
- onClick: () => n(i.id),
2837
- className: `flex w-full transition-colors rounded-lg hover-item ${i.description ? "items-start" : "items-center"}`,
2857
+ onClick: () => n(l.id),
2858
+ className: `flex w-full transition-colors rounded-lg hover-item ${l.description ? "items-start" : "items-center"}`,
2838
2859
  style: { color: "var(--t-text)", gap: 14, padding: "18px 8px", margin: "0 -8px" },
2839
2860
  children: [
2840
2861
  /* @__PURE__ */ e(
2841
2862
  "span",
2842
2863
  {
2843
- className: `flex items-center justify-center shrink-0 ${i.description ? "mt-0.5" : ""}`,
2864
+ className: `flex items-center justify-center shrink-0 ${l.description ? "mt-0.5" : ""}`,
2844
2865
  style: { width: 32, height: 32 },
2845
- children: na(i.id, i.icon, 32)
2866
+ children: na(l.id, l.icon, 32)
2846
2867
  }
2847
2868
  ),
2848
- /* @__PURE__ */ l("div", { className: "text-left flex-1", children: [
2869
+ /* @__PURE__ */ i("div", { className: "text-left flex-1", children: [
2849
2870
  /* @__PURE__ */ e(
2850
2871
  "div",
2851
2872
  {
2852
2873
  className: "font-semibold text-[15px] leading-tight",
2853
2874
  style: { color: "var(--t-text)" },
2854
- children: h
2875
+ children: p
2855
2876
  }
2856
2877
  ),
2857
- i.description && /* @__PURE__ */ e(
2878
+ l.description && /* @__PURE__ */ e(
2858
2879
  "div",
2859
2880
  {
2860
2881
  className: "text-[13px] leading-snug mt-1",
2861
2882
  style: { color: "var(--t-text-secondary)" },
2862
- children: i.description
2883
+ children: l.description
2863
2884
  }
2864
2885
  )
2865
2886
  ] }),
@@ -2876,14 +2897,14 @@ function hn({
2876
2897
  ]
2877
2898
  }
2878
2899
  ),
2879
- s < u.length - 1 && /* @__PURE__ */ e("div", { style: { height: 1, background: "var(--t-divider, rgba(255,255,255,0.08))" } })
2880
- ] }, i.id);
2900
+ c < u.length - 1 && /* @__PURE__ */ e("div", { style: { height: 1, background: "var(--t-divider, rgba(255,255,255,0.08))" } })
2901
+ ] }, l.id);
2881
2902
  }),
2882
2903
  u.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No payment methods found" })
2883
2904
  ] })
2884
2905
  ] });
2885
2906
  }
2886
- function pn({
2907
+ function yn({
2887
2908
  checked: t,
2888
2909
  onChange: a,
2889
2910
  accentColor: n = "var(--t-accent)"
@@ -2913,11 +2934,11 @@ function pn({
2913
2934
  }
2914
2935
  );
2915
2936
  }
2916
- const yn = [
2937
+ const Cn = [
2917
2938
  { label: "Privacy policy", href: "https://nowramp.com/privacy-policy" },
2918
2939
  { label: "Terms of use", href: "https://nowramp.com/terms-and-conditions" }
2919
2940
  ];
2920
- function Cn({
2941
+ function gn({
2921
2942
  onClose: t,
2922
2943
  darkMode: a,
2923
2944
  onToggleDarkMode: n,
@@ -2925,24 +2946,24 @@ function Cn({
2925
2946
  onSelectSkin: o,
2926
2947
  showThemeToggle: d = !0,
2927
2948
  country: u,
2928
- countryName: i,
2929
- onLocationPress: s,
2949
+ countryName: l,
2950
+ onLocationPress: c,
2930
2951
  assetBaseUrl: m = ""
2931
2952
  }) {
2932
- const [h, f] = N(!1);
2933
- return /* @__PURE__ */ l(ee, { children: [
2934
- /* @__PURE__ */ e("div", { className: "flex justify-end items-center px-5 pt-5", children: /* @__PURE__ */ e(De, { onClick: t }) }),
2935
- /* @__PURE__ */ l("div", { className: "px-5 flex-1 pt-6 overflow-y-auto custom-scroll", children: [
2936
- s && /* @__PURE__ */ l(ee, { children: [
2937
- /* @__PURE__ */ e("div", { style: { borderTop: "1px solid var(--t-divider)" }, children: /* @__PURE__ */ l(
2953
+ const [p, f] = A(!1);
2954
+ return /* @__PURE__ */ i(ae, { children: [
2955
+ /* @__PURE__ */ e("div", { className: "flex justify-end items-center px-5 pt-5", children: /* @__PURE__ */ e(Be, { onClick: t }) }),
2956
+ /* @__PURE__ */ i("div", { className: "px-5 flex-1 pt-6 overflow-y-auto custom-scroll", children: [
2957
+ c && /* @__PURE__ */ i(ae, { children: [
2958
+ /* @__PURE__ */ e("div", { style: { borderTop: "1px solid var(--t-divider)" }, children: /* @__PURE__ */ i(
2938
2959
  "button",
2939
2960
  {
2940
- onClick: s,
2961
+ onClick: c,
2941
2962
  className: "flex items-center justify-between w-full py-5 transition-colors",
2942
2963
  style: { color: "inherit", background: "none", border: "none", cursor: "pointer", padding: "20px 0" },
2943
2964
  children: [
2944
- /* @__PURE__ */ l("div", { className: "flex items-center gap-3.5", children: [
2945
- u && !h ? /* @__PURE__ */ e(
2965
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-3.5", children: [
2966
+ u && !p ? /* @__PURE__ */ e(
2946
2967
  "img",
2947
2968
  {
2948
2969
  src: `${m}/flags/${u.toLowerCase()}.svg`,
@@ -2952,8 +2973,8 @@ function Cn({
2952
2973
  style: { width: 40, height: 40, borderRadius: "50%", objectFit: "cover" },
2953
2974
  onError: () => f(!0)
2954
2975
  }
2955
- ) : /* @__PURE__ */ e(gn, { size: 40 }),
2956
- /* @__PURE__ */ l("div", { className: "text-left", children: [
2976
+ ) : /* @__PURE__ */ e(xn, { size: 40 }),
2977
+ /* @__PURE__ */ i("div", { className: "text-left", children: [
2957
2978
  /* @__PURE__ */ e(
2958
2979
  "span",
2959
2980
  {
@@ -2962,12 +2983,12 @@ function Cn({
2962
2983
  children: "Location"
2963
2984
  }
2964
2985
  ),
2965
- i && /* @__PURE__ */ e(
2986
+ l && /* @__PURE__ */ e(
2966
2987
  "span",
2967
2988
  {
2968
2989
  className: "text-[13px]",
2969
2990
  style: { color: "var(--t-text-secondary)" },
2970
- children: i
2991
+ children: l
2971
2992
  }
2972
2993
  )
2973
2994
  ] })
@@ -2978,10 +2999,10 @@ function Cn({
2978
2999
  ) }),
2979
3000
  /* @__PURE__ */ e("div", { style: { height: 1, background: "var(--t-divider)" } })
2980
3001
  ] }),
2981
- d && /* @__PURE__ */ l(ee, { children: [
2982
- /* @__PURE__ */ e("div", { style: { borderTop: s ? "none" : "1px solid var(--t-divider)" }, children: /* @__PURE__ */ l("div", { className: "flex items-center justify-between w-full py-5", children: [
2983
- /* @__PURE__ */ l("div", { className: "flex items-center gap-3.5", children: [
2984
- /* @__PURE__ */ e(za, { size: 40 }),
3002
+ d && /* @__PURE__ */ i(ae, { children: [
3003
+ /* @__PURE__ */ e("div", { style: { borderTop: c ? "none" : "1px solid var(--t-divider)" }, children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between w-full py-5", children: [
3004
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-3.5", children: [
3005
+ /* @__PURE__ */ e(Ja, { size: 40 }),
2985
3006
  /* @__PURE__ */ e(
2986
3007
  "span",
2987
3008
  {
@@ -2991,15 +3012,15 @@ function Cn({
2991
3012
  }
2992
3013
  )
2993
3014
  ] }),
2994
- /* @__PURE__ */ e(pn, { checked: a, onChange: n, accentColor: "#4CD964" })
3015
+ /* @__PURE__ */ e(yn, { checked: a, onChange: n, accentColor: "#4CD964" })
2995
3016
  ] }) }),
2996
3017
  /* @__PURE__ */ e("div", { style: { height: 1, background: "var(--t-divider)" } })
2997
3018
  ] }),
2998
- yn.map((y) => /* @__PURE__ */ l("div", { children: [
2999
- /* @__PURE__ */ l(
3019
+ Cn.map((C) => /* @__PURE__ */ i("div", { children: [
3020
+ /* @__PURE__ */ i(
3000
3021
  "a",
3001
3022
  {
3002
- href: y.href,
3023
+ href: C.href,
3003
3024
  target: "_blank",
3004
3025
  rel: "noopener noreferrer",
3005
3026
  className: "flex items-center justify-between w-full py-5 transition-colors",
@@ -3010,7 +3031,7 @@ function Cn({
3010
3031
  {
3011
3032
  className: "font-medium text-[15px]",
3012
3033
  style: { color: "var(--t-text)" },
3013
- children: y.label
3034
+ children: C.label
3014
3035
  }
3015
3036
  ),
3016
3037
  /* @__PURE__ */ e(Xt, {})
@@ -3018,42 +3039,42 @@ function Cn({
3018
3039
  }
3019
3040
  ),
3020
3041
  /* @__PURE__ */ e("div", { style: { height: 1, background: "var(--t-divider)" } })
3021
- ] }, y.label))
3042
+ ] }, C.label))
3022
3043
  ] })
3023
3044
  ] });
3024
3045
  }
3025
- function gn({ size: t = 40 }) {
3026
- return /* @__PURE__ */ l("svg", { width: t, height: t, viewBox: "0 0 40 40", fill: "none", children: [
3046
+ function xn({ size: t = 40 }) {
3047
+ return /* @__PURE__ */ i("svg", { width: t, height: t, viewBox: "0 0 40 40", fill: "none", children: [
3027
3048
  /* @__PURE__ */ e("circle", { cx: "20", cy: "20", r: "18", stroke: "var(--t-text-secondary)", strokeWidth: "1.5", fill: "none" }),
3028
3049
  /* @__PURE__ */ e("ellipse", { cx: "20", cy: "20", rx: "9", ry: "18", stroke: "var(--t-text-secondary)", strokeWidth: "1.5", fill: "none" }),
3029
3050
  /* @__PURE__ */ e("line", { x1: "2", y1: "20", x2: "38", y2: "20", stroke: "var(--t-text-secondary)", strokeWidth: "1.5" }),
3030
3051
  /* @__PURE__ */ e("path", { d: "M5 12h30M5 28h30", stroke: "var(--t-text-secondary)", strokeWidth: "1.2" })
3031
3052
  ] });
3032
3053
  }
3033
- function xn({
3054
+ function vn({
3034
3055
  onClose: t,
3035
3056
  onSelect: a,
3036
3057
  assetBaseUrl: n = "",
3037
3058
  selectedCode: r
3038
3059
  }) {
3039
- const [o, d] = N(""), u = j(() => {
3040
- const i = o.trim().toLowerCase();
3041
- if (!i) {
3060
+ const [o, d] = A(""), u = j(() => {
3061
+ const l = o.trim().toLowerCase();
3062
+ if (!l) {
3042
3063
  if (r) {
3043
- const s = r.toLowerCase(), m = yt[s];
3064
+ const c = r.toLowerCase(), m = yt[c];
3044
3065
  if (m) {
3045
- const h = et.filter((f) => f.code !== s);
3046
- return [m, ...h];
3066
+ const p = nt.filter((f) => f.code !== c);
3067
+ return [m, ...p];
3047
3068
  }
3048
3069
  }
3049
- return et;
3070
+ return nt;
3050
3071
  }
3051
- return et.filter(
3052
- (s) => s.name.toLowerCase().includes(i) || s.code.includes(i) || s.defaultFiat.toLowerCase().includes(i)
3072
+ return nt.filter(
3073
+ (c) => c.name.toLowerCase().includes(l) || c.code.includes(l) || c.defaultFiat.toLowerCase().includes(l)
3053
3074
  );
3054
3075
  }, [o, r]);
3055
- return /* @__PURE__ */ l(ee, { children: [
3056
- /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(De, { onClick: t }) }),
3076
+ return /* @__PURE__ */ i(ae, { children: [
3077
+ /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Be, { onClick: t }) }),
3057
3078
  /* @__PURE__ */ e(
3058
3079
  "h2",
3059
3080
  {
@@ -3068,22 +3089,22 @@ function xn({
3068
3089
  children: "Select your country"
3069
3090
  }
3070
3091
  ),
3071
- /* @__PURE__ */ e($e, { value: o, onChange: d }),
3072
- /* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
3073
- u.map((i, s) => {
3074
- const m = (r == null ? void 0 : r.toLowerCase()) === i.code;
3075
- return /* @__PURE__ */ l("div", { children: [
3076
- /* @__PURE__ */ l(
3092
+ /* @__PURE__ */ e(We, { value: o, onChange: d }),
3093
+ /* @__PURE__ */ i("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
3094
+ u.map((l, c) => {
3095
+ const m = (r == null ? void 0 : r.toLowerCase()) === l.code;
3096
+ return /* @__PURE__ */ i("div", { children: [
3097
+ /* @__PURE__ */ i(
3077
3098
  "button",
3078
3099
  {
3079
- onClick: () => a(i.code),
3100
+ onClick: () => a(l.code),
3080
3101
  className: "flex items-center w-full transition-colors rounded-lg hover-item",
3081
3102
  style: { color: "var(--t-text)", gap: 14, padding: "18px 8px", margin: "0 -8px" },
3082
3103
  children: [
3083
- /* @__PURE__ */ e(vn, { code: i.code, size: 32, baseUrl: n }),
3084
- /* @__PURE__ */ l("div", { className: "text-left flex-1", children: [
3085
- /* @__PURE__ */ e("span", { className: "font-semibold text-[15px]", children: i.name }),
3086
- /* @__PURE__ */ e("span", { className: "text-[13px] ml-2", style: { color: "var(--t-text-secondary)" }, children: i.defaultFiat })
3104
+ /* @__PURE__ */ e(bn, { code: l.code, size: 32, baseUrl: n }),
3105
+ /* @__PURE__ */ i("div", { className: "text-left flex-1", children: [
3106
+ /* @__PURE__ */ e("span", { className: "font-semibold text-[15px]", children: l.name }),
3107
+ /* @__PURE__ */ e("span", { className: "text-[13px] ml-2", style: { color: "var(--t-text-secondary)" }, children: l.defaultFiat })
3087
3108
  ] }),
3088
3109
  m && /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", className: "shrink-0", children: /* @__PURE__ */ e(
3089
3110
  "path",
@@ -3098,20 +3119,20 @@ function xn({
3098
3119
  ]
3099
3120
  }
3100
3121
  ),
3101
- s < u.length - 1 && /* @__PURE__ */ e(
3122
+ c < u.length - 1 && /* @__PURE__ */ e(
3102
3123
  "div",
3103
3124
  {
3104
3125
  style: { height: 1, background: "var(--t-divider, rgba(255,255,255,0.08))" }
3105
3126
  }
3106
3127
  )
3107
- ] }, i.code);
3128
+ ] }, l.code);
3108
3129
  }),
3109
3130
  u.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No countries found" })
3110
3131
  ] })
3111
3132
  ] });
3112
3133
  }
3113
- function vn({ code: t, size: a = 32, baseUrl: n = "" }) {
3114
- const [r, o] = N(!1);
3134
+ function bn({ code: t, size: a = 32, baseUrl: n = "" }) {
3135
+ const [r, o] = A(!1);
3115
3136
  return r ? /* @__PURE__ */ e(
3116
3137
  "div",
3117
3138
  {
@@ -3140,7 +3161,7 @@ function vn({ code: t, size: a = 32, baseUrl: n = "" }) {
3140
3161
  }
3141
3162
  );
3142
3163
  }
3143
- function bn({
3164
+ function Sn({
3144
3165
  className: t = "",
3145
3166
  theme: a = "dark",
3146
3167
  skinId: n = "mono",
@@ -3148,173 +3169,173 @@ function bn({
3148
3169
  bgColor: o,
3149
3170
  bgImage: d,
3150
3171
  borderColor: u,
3151
- borderRadius: i,
3152
- surfaceColor: s,
3172
+ borderRadius: l,
3173
+ surfaceColor: c,
3153
3174
  inputBgColor: m,
3154
- textColor: h,
3175
+ textColor: p,
3155
3176
  textSecondaryColor: f,
3156
- textMutedColor: y,
3157
- successColor: x,
3158
- showFlowToggle: C = !0,
3159
- showSettings: E = !0,
3160
- showThemeToggle: k = !0,
3161
- autoRedirect: _ = !1,
3162
- explorerUrl: ie,
3177
+ textMutedColor: C,
3178
+ successColor: S,
3179
+ showFlowToggle: k = !0,
3180
+ showSettings: w = !0,
3181
+ showThemeToggle: y = !0,
3182
+ autoRedirect: O = !1,
3183
+ explorerUrl: le,
3163
3184
  doneButtonText: G = "Done",
3164
3185
  supportEmail: z,
3165
- stablecoinParity: te,
3166
- partnerName: X,
3167
- onDone: ve
3186
+ stablecoinParity: ce,
3187
+ partnerName: _,
3188
+ onDone: ne
3168
3189
  }) {
3169
- var Lt, Ut, Ft, Dt, Mt, It, Bt, Ot, Ht;
3190
+ var Lt, Ut, Ft, Dt, It, Mt, Bt, Ot, Ht;
3170
3191
  const {
3171
- state: v,
3172
- dispatch: L,
3173
- config: c,
3174
- configLoading: U,
3175
- quotes: w,
3176
- quotesLoading: b,
3177
- quotesError: J,
3178
- fetchQuotes: be,
3179
- createOrder: Se,
3180
- orderLoading: se,
3181
- amountError: pe,
3182
- fieldLocks: D,
3183
- apiConfig: ae,
3184
- assetBaseUrl: O,
3185
- availableFiats: de,
3186
- availableCryptos: Me,
3192
+ state: g,
3193
+ dispatch: T,
3194
+ config: q,
3195
+ configLoading: xe,
3196
+ quotes: F,
3197
+ quotesLoading: s,
3198
+ quotesError: L,
3199
+ fetchQuotes: W,
3200
+ createOrder: b,
3201
+ orderLoading: ee,
3202
+ amountError: ue,
3203
+ fieldLocks: I,
3204
+ apiConfig: ve,
3205
+ assetBaseUrl: Y,
3206
+ availableFiats: ke,
3207
+ availableCryptos: se,
3187
3208
  availablePaymentMethods: Q,
3188
- selectionUnsupported: ne,
3189
- quotesEmpty: B,
3190
- bestUnavailableReason: Re
3191
- } = Fe(), [le, We] = N(a === "dark"), [ke, Ie] = N(n), [ce, $] = N(null), [Ne, Be] = N(!1), [Xe, re] = N(!1), [rt, ye] = N(!1), [Oe, He] = N(!1), [Ye, ue] = N(null), [Pe, ot] = N(!0), [it, Ze] = N(!1), [me, p] = N(!1), A = I(null), R = I(), F = I(v.flowType);
3209
+ selectionUnsupported: te,
3210
+ quotesEmpty: de,
3211
+ bestUnavailableReason: ye
3212
+ } = Me(), [re, $] = A(a === "dark"), [be, Oe] = A(n), [Se, H] = A(null), [Ne, we] = A(!1), [$e, Te] = A(!1), [Xe, Ye] = A(!1), [P, Ze] = A(!1), [Qe, oe] = A(null), [He, ze] = A(!0), [Je, Le] = A(!1), [me, Ue] = A(!1), lt = M(null), Pe = M(), Ke = M(g.flowType);
3192
3213
  Z(() => {
3193
- We(a === "dark");
3214
+ $(a === "dark");
3194
3215
  }, [a]), Z(() => {
3195
- const g = setTimeout(() => ot(!1), U ? 0 : 800);
3196
- return () => clearTimeout(g);
3197
- }, [U]), Z(() => {
3198
- if (F.current !== v.flowType && !Pe) {
3199
- F.current = v.flowType, Ze(!0), Be(!1), re(!1);
3200
- const g = setTimeout(() => Ze(!1), 350);
3201
- return () => clearTimeout(g);
3216
+ const x = setTimeout(() => ze(!1), xe ? 0 : 800);
3217
+ return () => clearTimeout(x);
3218
+ }, [xe]), Z(() => {
3219
+ if (Ke.current !== g.flowType && !He) {
3220
+ Ke.current = g.flowType, Le(!0), we(!1), Te(!1);
3221
+ const x = setTimeout(() => Le(!1), 350);
3222
+ return () => clearTimeout(x);
3202
3223
  }
3203
- F.current = v.flowType;
3204
- }, [v.flowType, Pe]);
3205
- const M = v.flowType, T = M === "buy", H = v.cryptoCurrency || "BTC", Y = v.fiatCurrency || "USD", lt = T ? v.fiatAmount : v.cryptoAmount, q = Ka(lt), Ce = (Lt = w == null ? void 0 : w.bestQuote) != null && Lt.exchangeRate ? parseFloat(w.bestQuote.exchangeRate) : null, Ke = I(null);
3206
- Ce && H && Y && (Ke.current = { rate: Ce, crypto: H, fiat: Y }), Z(() => {
3207
- (B || J) && (Ke.current = null);
3208
- }, [B, J]);
3224
+ Ke.current = g.flowType;
3225
+ }, [g.flowType, He]);
3226
+ const h = g.flowType, v = h === "buy", N = g.cryptoCurrency || "BTC", R = g.fiatCurrency || "USD", D = v ? g.fiatAmount : g.cryptoAmount, U = _a(D), J = (Lt = F == null ? void 0 : F.bestQuote) != null && Lt.exchangeRate ? parseFloat(F.bestQuote.exchangeRate) : null, fe = M(null);
3227
+ J && N && R && (fe.current = { rate: J, crypto: N, fiat: R }), Z(() => {
3228
+ (de || L) && (fe.current = null);
3229
+ }, [de, L]);
3209
3230
  const xt = j(() => {
3210
- if (w != null && w.bestQuote) {
3211
- const g = T ? w.bestQuote.cryptoAmount : w.bestQuote.fiatAmount;
3212
- if (g) return g;
3231
+ if (F != null && F.bestQuote) {
3232
+ const x = v ? F.bestQuote.cryptoAmount : F.bestQuote.fiatAmount;
3233
+ if (x) return x;
3213
3234
  }
3214
3235
  return "0";
3215
- }, [w, T]), _e = !!(te && X && T && ea(H) && Ce), ra = _e && H.toUpperCase().includes(Y.toUpperCase()), vt = _e && q > 0 ? ht(ra ? q : q / Ce) : null, oa = _e && vt ? vt : xt, ia = j(() => {
3216
- var W, Ee, Le;
3217
- const g = Ce || ((W = Ke.current) == null ? void 0 : W.rate), S = Ce ? H : (Ee = Ke.current) == null ? void 0 : Ee.crypto, K = Ce ? Y : (Le = Ke.current) == null ? void 0 : Le.fiat;
3218
- return !g || !S || !K ? "" : `1 ${S} ≈ ${g.toFixed(2)} ${K}`;
3219
- }, [H, Y, Ce]);
3236
+ }, [F, v]), _e = !!(ce && _ && v && ea(N) && J), ra = _e && N.toUpperCase().includes(R.toUpperCase()), vt = _e && U > 0 ? pt(ra ? U : U / J) : null, oa = _e && vt ? vt : xt, ia = j(() => {
3237
+ var X, Ae, De;
3238
+ const x = J || ((X = fe.current) == null ? void 0 : X.rate), E = J ? N : (Ae = fe.current) == null ? void 0 : Ae.crypto, K = J ? R : (De = fe.current) == null ? void 0 : De.fiat;
3239
+ return !x || !E || !K ? "" : `1 ${E} ≈ ${x.toFixed(2)} ${K}`;
3240
+ }, [N, R, J]);
3220
3241
  Z(() => {
3221
- const g = v.walletAddress.trim(), S = v.network;
3222
- if (!g || g.length < 10) {
3223
- ue(null), L({ type: "SET_WALLET_ERROR", message: "" });
3242
+ const x = g.walletAddress.trim(), E = g.network;
3243
+ if (!x || x.length < 10) {
3244
+ oe(null), T({ type: "SET_WALLET_ERROR", message: "" });
3224
3245
  return;
3225
3246
  }
3226
- He(!0), ue(null);
3247
+ Ze(!0), oe(null);
3227
3248
  const K = new AbortController();
3228
- return clearTimeout(R.current), R.current = setTimeout(async () => {
3229
- var W, Ee, Le;
3249
+ return clearTimeout(Pe.current), Pe.current = setTimeout(async () => {
3250
+ var X, Ae, De;
3230
3251
  try {
3231
- const dt = await (await fetch(`${ae.apiUrl}/public/validate/address`, {
3252
+ const dt = await (await fetch(`${ve.apiUrl}/public/validate/address`, {
3232
3253
  method: "POST",
3233
3254
  headers: { "Content-Type": "application/json" },
3234
- body: JSON.stringify({ address: g, ...S ? { network: S } : {} }),
3255
+ body: JSON.stringify({ address: x, ...E ? { network: E } : {} }),
3235
3256
  signal: K.signal
3236
- })).json(), ut = ((W = dt.data) == null ? void 0 : W.attributes) || dt.data || dt;
3257
+ })).json(), ut = ((X = dt.data) == null ? void 0 : X.attributes) || dt.data || dt;
3237
3258
  if (ut.isValid)
3238
- ue(!0), L({ type: "SET_WALLET_ERROR", message: "" });
3259
+ oe(!0), T({ type: "SET_WALLET_ERROR", message: "" });
3239
3260
  else {
3240
- ue(!1);
3241
- const ga = ((Ee = ut.errors) == null ? void 0 : Ee[0]) || ((Le = ut.details) == null ? void 0 : Le.formatMessage) || "Invalid wallet address";
3242
- L({ type: "SET_WALLET_ERROR", message: ga });
3261
+ oe(!1);
3262
+ const ga = ((Ae = ut.errors) == null ? void 0 : Ae[0]) || ((De = ut.details) == null ? void 0 : De.formatMessage) || "Invalid wallet address";
3263
+ T({ type: "SET_WALLET_ERROR", message: ga });
3243
3264
  }
3244
3265
  } catch (st) {
3245
3266
  if (st instanceof DOMException && st.name === "AbortError") return;
3246
- ue(null);
3267
+ oe(null);
3247
3268
  } finally {
3248
- K.signal.aborted || He(!1);
3269
+ K.signal.aborted || Ze(!1);
3249
3270
  }
3250
3271
  }, 500), () => {
3251
- clearTimeout(R.current), K.abort();
3272
+ clearTimeout(Pe.current), K.abort();
3252
3273
  };
3253
- }, [v.walletAddress, v.network, ae.apiUrl]);
3254
- const bt = !lt || q === 0, St = q > 0 && (T ? q < Gt : q < $t), Nt = !!pe || St || Ne && bt, la = q > 0 && !pe && !St, ct = v.walletAddress.trim().length >= 10 && Ye !== !1 && !Oe, Qe = la && ct && !!v.cryptoCurrency && !!v.network, ca = (g) => {
3255
- let S = g.target.value.replace(/[^0-9.,]/g, "");
3256
- const K = T ? 2 : 6, W = S.indexOf(".");
3257
- W !== -1 && S.length - W - 1 > K && (S = S.slice(0, W + K + 1)), L(T ? { type: "SET_FIAT_AMOUNT", amount: S } : { type: "SET_CRYPTO_AMOUNT", amount: S });
3258
- }, wt = (g) => {
3259
- g !== M && L({ type: "SET_FLOW_TYPE", flowType: g, fieldLocks: D });
3260
- }, sa = P(
3261
- (g) => {
3262
- L({ type: "SET_FIAT_CURRENCY", currency: g });
3274
+ }, [g.walletAddress, g.network, ve.apiUrl]);
3275
+ const bt = !D || U === 0, St = U > 0 && (v ? U < Gt : U < Wt), Nt = !!ue || St || Ne && bt, la = U > 0 && !ue && !St, ct = g.walletAddress.trim().length >= 10 && Qe !== !1 && !P, qe = la && ct && !!g.cryptoCurrency && !!g.network, ca = (x) => {
3276
+ let E = x.target.value.replace(/[^0-9.,]/g, "");
3277
+ const K = v ? 2 : 6, X = E.indexOf(".");
3278
+ X !== -1 && E.length - X - 1 > K && (E = E.slice(0, X + K + 1)), T(v ? { type: "SET_FIAT_AMOUNT", amount: E } : { type: "SET_CRYPTO_AMOUNT", amount: E });
3279
+ }, wt = (x) => {
3280
+ x !== h && T({ type: "SET_FLOW_TYPE", flowType: x, fieldLocks: I });
3281
+ }, sa = B(
3282
+ (x) => {
3283
+ T({ type: "SET_FIAT_CURRENCY", currency: x });
3263
3284
  },
3264
- [L]
3265
- ), da = P(
3266
- (g, S) => {
3267
- L({ type: "SET_CRYPTO_CURRENCY", currency: g }), L({ type: "SET_CRYPTO_CHAIN", chain: S });
3285
+ [T]
3286
+ ), da = B(
3287
+ (x, E) => {
3288
+ T({ type: "SET_CRYPTO_CURRENCY", currency: x }), T({ type: "SET_CRYPTO_CHAIN", chain: E });
3268
3289
  },
3269
- [L]
3270
- ), ua = P(
3271
- (g) => {
3272
- L({ type: "SET_PAYMENT_METHOD", methodId: g });
3290
+ [T]
3291
+ ), ua = B(
3292
+ (x) => {
3293
+ T({ type: "SET_PAYMENT_METHOD", methodId: x });
3273
3294
  },
3274
- [L]
3275
- ), ma = P(
3276
- (g) => {
3277
- L({ type: "SET_COUNTRY", country: g }), $(null);
3295
+ [T]
3296
+ ), ma = B(
3297
+ (x) => {
3298
+ T({ type: "SET_COUNTRY", country: x }), H(null);
3278
3299
  },
3279
- [L]
3280
- ), fa = P(() => {
3281
- $(null), setTimeout(() => $("country"), 280);
3282
- }, []), ha = v.country ? (Ut = yt[v.country.toLowerCase()]) == null ? void 0 : Ut.name : void 0, pa = () => {
3283
- Qe && (p(!0), be());
3300
+ [T]
3301
+ ), fa = B(() => {
3302
+ H(null), setTimeout(() => H("country"), 280);
3303
+ }, []), pa = g.country ? (Ut = yt[g.country.toLowerCase()]) == null ? void 0 : Ut.name : void 0, ha = () => {
3304
+ qe && (Ue(!0), W());
3284
3305
  };
3285
3306
  Z(() => {
3286
- var g;
3287
- if (!(!me || b)) {
3288
- if (w != null && w.bestQuote)
3289
- p(!1), L({ type: "SELECT_QUOTE", quote: w.bestQuote }), Se().catch(() => {
3307
+ var x;
3308
+ if (!(!me || s)) {
3309
+ if (F != null && F.bestQuote)
3310
+ Ue(!1), T({ type: "SELECT_QUOTE", quote: F.bestQuote }), b().catch(() => {
3290
3311
  });
3291
- else if (J)
3292
- p(!1), L({ type: "SET_ERROR", message: J.message || "No quotes available" });
3293
- else if (w && !w.bestQuote) {
3294
- p(!1);
3295
- const S = (g = w.unavailableGateways) == null ? void 0 : g.map((W) => W.reason).filter(Boolean), K = S != null && S.length ? `No providers available: ${S.join("; ")}` : "No providers available for this currency/network combination";
3296
- L({ type: "SET_ERROR", message: K });
3312
+ else if (L)
3313
+ Ue(!1), T({ type: "SET_ERROR", message: L.message || "No quotes available" });
3314
+ else if (F && !F.bestQuote) {
3315
+ Ue(!1);
3316
+ const E = (x = F.unavailableGateways) == null ? void 0 : x.map((X) => X.reason).filter(Boolean), K = E != null && E.length ? `No providers available: ${E.join("; ")}` : "No providers available for this currency/network combination";
3317
+ T({ type: "SET_ERROR", message: K });
3297
3318
  }
3298
3319
  }
3299
- }, [me, w, b, J, L, Se]);
3300
- const Et = le ? "theme-dark" : "theme-light", ze = Vt.find((g) => g.id === ke) || Vt[0], ya = ze.accent === null, Ca = r ? he(r) : !1, At = (g) => {
3301
- const S = g.replace("#", ""), K = parseInt(S.substring(0, 2), 16), W = parseInt(S.substring(2, 4), 16), Ee = parseInt(S.substring(4, 6), 16);
3302
- return (0.299 * K + 0.587 * W + 0.114 * Ee) / 255 > 0.5 ? "#000000" : "#ffffff";
3320
+ }, [me, F, s, L, T, b]);
3321
+ const Et = re ? "theme-dark" : "theme-light", et = Vt.find((x) => x.id === be) || Vt[0], ya = et.accent === null, Ca = r ? he(r) : !1, At = (x) => {
3322
+ const E = x.replace("#", ""), K = parseInt(E.substring(0, 2), 16), X = parseInt(E.substring(2, 4), 16), Ae = parseInt(E.substring(4, 6), 16);
3323
+ return (0.299 * K + 0.587 * X + 0.114 * Ae) / 255 > 0.5 ? "#000000" : "#ffffff";
3303
3324
  }, Rt = Ca ? { "--t-accent": r, "--t-cta-bg": r, "--t-cta-text": At(r) } : ya ? {
3304
- "--t-accent": le ? "#ffffff" : "#111111",
3305
- "--t-cta-bg": le ? "#ffffff" : "#111111",
3306
- "--t-cta-text": le ? "#000000" : "#ffffff"
3325
+ "--t-accent": re ? "#ffffff" : "#111111",
3326
+ "--t-cta-bg": re ? "#ffffff" : "#111111",
3327
+ "--t-cta-text": re ? "#000000" : "#ffffff"
3307
3328
  } : {
3308
- "--t-accent": ze.accent,
3309
- "--t-cta-bg": ze.accent,
3310
- "--t-cta-text": At(ze.accent)
3311
- }, oe = {};
3312
- s && he(s) && (oe["--t-surface"] = s, oe["--t-modal-bg"] = s), m && he(m) && (oe["--t-pill-bg"] = m, oe["--t-close-bg"] = m), h && he(h) && (oe["--t-text"] = h), f && he(f) && (oe["--t-text-secondary"] = f), y && he(y) && (oe["--t-text-muted"] = y, oe["--t-text-tertiary"] = y), x && he(x) && (oe["--t-success"] = x);
3313
- const we = {};
3314
- o && he(o) ? we.backgroundColor = o : we.backgroundColor = "var(--t-bg)", d && (d.startsWith("https://") || d.startsWith("data:image/")) && (we.backgroundImage = `url(${d})`, we.backgroundSize = "cover", we.backgroundPosition = "center");
3315
- const Je = le ? "#ffffff" : "#111111", qe = {};
3316
- u && he(u) && (qe.border = `1px solid ${u}`), i && (qe.borderRadius = i);
3317
- const kt = v.step === "checkout" ? /* @__PURE__ */ e(an, { autoRedirect: _ }) : v.step === "processing" ? /* @__PURE__ */ e(rn, {}) : v.step === "complete" ? /* @__PURE__ */ e(on, { explorerUrl: ie, doneButtonText: G, onDone: ve }) : v.step === "error" ? /* @__PURE__ */ e(ln, { supportEmail: z }) : v.step === "confirm" ? /* @__PURE__ */ e(cn, { stablecoinParity: _e, partnerName: X }) : null;
3329
+ "--t-accent": et.accent,
3330
+ "--t-cta-bg": et.accent,
3331
+ "--t-cta-text": At(et.accent)
3332
+ }, ie = {};
3333
+ c && he(c) && (ie["--t-surface"] = c, ie["--t-modal-bg"] = c), m && he(m) && (ie["--t-pill-bg"] = m, ie["--t-close-bg"] = m), p && he(p) && (ie["--t-text"] = p), f && he(f) && (ie["--t-text-secondary"] = f), C && he(C) && (ie["--t-text-muted"] = C, ie["--t-text-tertiary"] = C), S && he(S) && (ie["--t-success"] = S);
3334
+ const Ee = {};
3335
+ o && he(o) ? Ee.backgroundColor = o : Ee.backgroundColor = "var(--t-bg)", d && (d.startsWith("https://") || d.startsWith("data:image/")) && (Ee.backgroundImage = `url(${d})`, Ee.backgroundSize = "cover", Ee.backgroundPosition = "center");
3336
+ const tt = re ? "#ffffff" : "#111111", at = {};
3337
+ u && he(u) && (at.border = `1px solid ${u}`), l && (at.borderRadius = l);
3338
+ const kt = g.step === "checkout" ? /* @__PURE__ */ e(nn, { autoRedirect: O }) : g.step === "processing" ? /* @__PURE__ */ e(on, {}) : g.step === "complete" ? /* @__PURE__ */ e(ln, { explorerUrl: le, doneButtonText: G, onDone: ne }) : g.step === "error" ? /* @__PURE__ */ e(cn, { supportEmail: z, onDone: ne, doneButtonText: G }) : g.step === "confirm" ? /* @__PURE__ */ e(sn, { stablecoinParity: _e, partnerName: _ }) : null;
3318
3339
  if (kt)
3319
3340
  return /* @__PURE__ */ e(
3320
3341
  "div",
@@ -3322,36 +3343,36 @@ function bn({
3322
3343
  className: `${Et} relative w-full max-w-[390px] h-[640px] overflow-hidden flex flex-col select-none transition-colors duration-300 ${t}`,
3323
3344
  style: {
3324
3345
  fontFamily: "'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
3325
- ...we,
3346
+ ...Ee,
3326
3347
  ...Rt,
3327
- ...oe,
3328
- ...qe
3348
+ ...ie,
3349
+ ...at
3329
3350
  },
3330
3351
  children: kt
3331
3352
  }
3332
3353
  );
3333
- const fe = v.network, Te = fe ? tt(fe) : null, Tt = (Te == null ? void 0 : Te.shortName) || (Te == null ? void 0 : Te.name) || fe;
3334
- return /* @__PURE__ */ l(
3354
+ const pe = g.network, Fe = pe ? rt(pe) : null, Tt = (Fe == null ? void 0 : Fe.shortName) || (Fe == null ? void 0 : Fe.name) || pe;
3355
+ return /* @__PURE__ */ i(
3335
3356
  "div",
3336
3357
  {
3337
3358
  className: `${Et} relative w-full max-w-[390px] min-h-[640px] overflow-hidden flex flex-col select-none transition-colors duration-300 ${t}`,
3338
3359
  style: {
3339
3360
  fontFamily: "'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
3340
- ...we,
3361
+ ...Ee,
3341
3362
  ...Rt,
3342
- ...oe,
3343
- ...qe
3363
+ ...ie,
3364
+ ...at
3344
3365
  },
3345
3366
  children: [
3346
- E && /* @__PURE__ */ e("div", { className: `flex justify-end items-center px-5 pt-3 ${C ? "pb-1" : "pb-5"}`, children: /* @__PURE__ */ e(Qa, { onClick: () => $("settings") }) }),
3347
- C ? /* @__PURE__ */ l("div", { className: "flex flex-col items-center pt-3 pb-5", children: [
3348
- /* @__PURE__ */ l("div", { className: "flex", style: { width: 165 }, children: [
3367
+ w && /* @__PURE__ */ e("div", { className: `flex justify-end items-center px-5 pt-3 ${k ? "pb-1" : "pb-5"}`, children: /* @__PURE__ */ e(za, { onClick: () => H("settings") }) }),
3368
+ k ? /* @__PURE__ */ i("div", { className: "flex flex-col items-center pt-3 pb-5", children: [
3369
+ /* @__PURE__ */ i("div", { className: "flex", style: { width: 165 }, children: [
3349
3370
  /* @__PURE__ */ e(
3350
3371
  "button",
3351
3372
  {
3352
3373
  onClick: () => wt("buy"),
3353
3374
  className: "flex-1 pb-2.5 text-[16px] font-medium text-center transition-colors duration-200",
3354
- style: { color: M === "buy" ? "var(--t-text)" : "var(--t-text-secondary)" },
3375
+ style: { color: h === "buy" ? "var(--t-text)" : "var(--t-text-secondary)" },
3355
3376
  children: "Buy"
3356
3377
  }
3357
3378
  ),
@@ -3360,12 +3381,12 @@ function bn({
3360
3381
  {
3361
3382
  onClick: () => wt("sell"),
3362
3383
  className: "flex-1 pb-2.5 text-[16px] font-medium text-center transition-colors duration-200",
3363
- style: { color: M === "sell" ? "var(--t-text)" : "var(--t-text-secondary)" },
3384
+ style: { color: h === "sell" ? "var(--t-text)" : "var(--t-text-secondary)" },
3364
3385
  children: "Sell"
3365
3386
  }
3366
3387
  )
3367
3388
  ] }),
3368
- /* @__PURE__ */ l("div", { className: "relative", style: { width: 165, height: 1 }, children: [
3389
+ /* @__PURE__ */ i("div", { className: "relative", style: { width: 165, height: 1 }, children: [
3369
3390
  /* @__PURE__ */ e("div", { className: "absolute inset-0", style: { background: "var(--t-divider)" } }),
3370
3391
  /* @__PURE__ */ e(
3371
3392
  "div",
@@ -3373,15 +3394,15 @@ function bn({
3373
3394
  className: "absolute top-0 h-full transition-all duration-300 ease-in-out",
3374
3395
  style: {
3375
3396
  width: "50%",
3376
- left: M === "buy" ? "0%" : "50%",
3397
+ left: h === "buy" ? "0%" : "50%",
3377
3398
  background: "var(--t-accent)"
3378
3399
  }
3379
3400
  }
3380
3401
  )
3381
3402
  ] })
3382
3403
  ] }) : null,
3383
- Pe || it || U ? /* @__PURE__ */ e(un, {}) : /* @__PURE__ */ l("div", { className: "flex-1 overflow-hidden px-5 flex flex-col tab-fade-in", children: [
3384
- /* @__PURE__ */ l(
3404
+ He || Je || xe ? /* @__PURE__ */ e(mn, {}) : /* @__PURE__ */ i("div", { className: "flex-1 overflow-hidden px-5 flex flex-col tab-fade-in", children: [
3405
+ /* @__PURE__ */ i(
3385
3406
  "div",
3386
3407
  {
3387
3408
  className: "px-[18px] pt-[14px] pb-[18px]",
@@ -3393,26 +3414,26 @@ function bn({
3393
3414
  },
3394
3415
  children: [
3395
3416
  /* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: "You spend" }),
3396
- /* @__PURE__ */ l("div", { className: "flex items-center justify-between", children: [
3417
+ /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
3397
3418
  /* @__PURE__ */ e(
3398
3419
  "input",
3399
3420
  {
3400
- ref: A,
3421
+ ref: lt,
3401
3422
  type: "text",
3402
- value: lt,
3423
+ value: D,
3403
3424
  onChange: ca,
3404
- onBlur: () => Be(!0),
3405
- placeholder: T ? "250" : "0.01",
3425
+ onBlur: () => we(!0),
3426
+ placeholder: v ? "250" : "0.01",
3406
3427
  className: "bg-transparent outline-none w-0 flex-1 mr-3",
3407
3428
  style: { color: "var(--t-text)", fontSize: 24, fontWeight: 600, lineHeight: "32px", padding: 0, border: "none", borderRadius: 0, backgroundColor: "transparent", height: "auto", width: 0 },
3408
3429
  inputMode: "decimal",
3409
- disabled: !!((Ft = D == null ? void 0 : D.sourceAmount) != null && Ft.locked)
3430
+ disabled: !!((Ft = I == null ? void 0 : I.sourceAmount) != null && Ft.locked)
3410
3431
  }
3411
3432
  ),
3412
- T ? /* @__PURE__ */ l(
3433
+ v ? /* @__PURE__ */ i(
3413
3434
  "button",
3414
3435
  {
3415
- onClick: () => $("fiat"),
3436
+ onClick: () => H("fiat"),
3416
3437
  className: "flex items-center gap-1.5 shrink-0 transition-colors",
3417
3438
  style: {
3418
3439
  background: "var(--t-pill-bg)",
@@ -3421,18 +3442,18 @@ function bn({
3421
3442
  paddingLeft: 10,
3422
3443
  paddingRight: 10
3423
3444
  },
3424
- disabled: !!((Dt = D == null ? void 0 : D.sourceCurrency) != null && Dt.locked),
3445
+ disabled: !!((Dt = I == null ? void 0 : I.sourceCurrency) != null && Dt.locked),
3425
3446
  children: [
3426
- /* @__PURE__ */ e(pt, { currencyCode: Y, size: 16, baseUrl: O }),
3427
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: Je }, children: Y }),
3447
+ /* @__PURE__ */ e(ht, { currencyCode: R, size: 16, baseUrl: Y }),
3448
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: tt }, children: R }),
3428
3449
  /* @__PURE__ */ e(Ge, {})
3429
3450
  ]
3430
3451
  }
3431
- ) : /* @__PURE__ */ l("div", { className: "flex flex-col items-end shrink-0", children: [
3432
- /* @__PURE__ */ l(
3452
+ ) : /* @__PURE__ */ i("div", { className: "flex flex-col items-end shrink-0", children: [
3453
+ /* @__PURE__ */ i(
3433
3454
  "button",
3434
3455
  {
3435
- onClick: () => $("crypto"),
3456
+ onClick: () => H("crypto"),
3436
3457
  className: "flex items-center gap-1.5 transition-colors",
3437
3458
  style: {
3438
3459
  background: "var(--t-pill-bg)",
@@ -3441,20 +3462,20 @@ function bn({
3441
3462
  paddingLeft: 10,
3442
3463
  paddingRight: 10
3443
3464
  },
3444
- disabled: !!((Mt = D == null ? void 0 : D.destinationCurrency) != null && Mt.locked),
3465
+ disabled: !!((It = I == null ? void 0 : I.destinationCurrency) != null && It.locked),
3445
3466
  children: [
3446
- /* @__PURE__ */ e(Wt, { ticker: H, size: 16, baseUrl: O }),
3447
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: Je }, children: H }),
3467
+ /* @__PURE__ */ e($t, { ticker: N, size: 16, baseUrl: Y }),
3468
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: tt }, children: N }),
3448
3469
  /* @__PURE__ */ e(Ge, {})
3449
3470
  ]
3450
3471
  }
3451
3472
  ),
3452
- fe && /* @__PURE__ */ l("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
3473
+ pe && /* @__PURE__ */ i("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
3453
3474
  /* @__PURE__ */ e("div", { className: "rounded-full", style: { width: 14, height: 14, background: "#ffffff" }, children: /* @__PURE__ */ e(
3454
3475
  "img",
3455
3476
  {
3456
- src: ft(fe, O),
3457
- alt: fe,
3477
+ src: ft(pe, Y),
3478
+ alt: pe,
3458
3479
  width: 14,
3459
3480
  height: 14,
3460
3481
  className: "rounded-full",
@@ -3468,8 +3489,8 @@ function bn({
3468
3489
  ]
3469
3490
  }
3470
3491
  ),
3471
- Ne && Nt && /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5 px-[2px]", style: { color: "#EF4444" }, children: pe || (bt ? "Amount should be more than 0" : T ? `Minimum amount is ${Gt} ${Y}` : `Minimum amount is ${$t} ${H}`) }),
3472
- /* @__PURE__ */ l(
3492
+ Ne && Nt && /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5 px-[2px]", style: { color: "#EF4444" }, children: ue || (bt ? "Amount should be more than 0" : v ? `Minimum amount is ${Gt} ${R}` : `Minimum amount is ${Wt} ${N}`) }),
3493
+ /* @__PURE__ */ i(
3473
3494
  "div",
3474
3495
  {
3475
3496
  className: "px-[18px] pt-[12px] pb-[14px]",
@@ -3484,21 +3505,21 @@ function bn({
3484
3505
  },
3485
3506
  children: [
3486
3507
  /* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: "You get" }),
3487
- /* @__PURE__ */ l("div", { className: "flex items-start justify-between", children: [
3488
- b && !me ? /* @__PURE__ */ e(V, { w: 180, h: 32 }) : /* @__PURE__ */ e(
3489
- dn,
3508
+ /* @__PURE__ */ i("div", { className: "flex items-start justify-between", children: [
3509
+ s && !me ? /* @__PURE__ */ e(V, { w: 180, h: 32 }) : /* @__PURE__ */ e(
3510
+ un,
3490
3511
  {
3491
- value: q > 0 ? oa : "0",
3512
+ value: U > 0 ? oa : "0",
3492
3513
  height: 32,
3493
3514
  className: "font-semibold",
3494
- style: { color: q > 0 ? "var(--t-text)" : "var(--t-text-muted)", fontSize: 24 }
3515
+ style: { color: U > 0 ? "var(--t-text)" : "var(--t-text-muted)", fontSize: 24 }
3495
3516
  }
3496
3517
  ),
3497
- T ? /* @__PURE__ */ l("div", { className: "flex flex-col items-end shrink-0", children: [
3498
- /* @__PURE__ */ l(
3518
+ v ? /* @__PURE__ */ i("div", { className: "flex flex-col items-end shrink-0", children: [
3519
+ /* @__PURE__ */ i(
3499
3520
  "button",
3500
3521
  {
3501
- onClick: () => $("crypto"),
3522
+ onClick: () => H("crypto"),
3502
3523
  className: "flex items-center gap-1.5 transition-colors",
3503
3524
  style: {
3504
3525
  background: "var(--t-pill-bg)",
@@ -3507,20 +3528,20 @@ function bn({
3507
3528
  paddingLeft: 10,
3508
3529
  paddingRight: 10
3509
3530
  },
3510
- disabled: !!((It = D == null ? void 0 : D.destinationCurrency) != null && It.locked),
3531
+ disabled: !!((Mt = I == null ? void 0 : I.destinationCurrency) != null && Mt.locked),
3511
3532
  children: [
3512
- /* @__PURE__ */ e(Wt, { ticker: H, size: 16, baseUrl: O }),
3513
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: Je }, children: H }),
3533
+ /* @__PURE__ */ e($t, { ticker: N, size: 16, baseUrl: Y }),
3534
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: tt }, children: N }),
3514
3535
  /* @__PURE__ */ e(Ge, {})
3515
3536
  ]
3516
3537
  }
3517
3538
  ),
3518
- fe && /* @__PURE__ */ l("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
3539
+ pe && /* @__PURE__ */ i("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
3519
3540
  /* @__PURE__ */ e("div", { className: "rounded-full", style: { width: 14, height: 14, background: "#ffffff" }, children: /* @__PURE__ */ e(
3520
3541
  "img",
3521
3542
  {
3522
- src: ft(fe, O),
3523
- alt: fe,
3543
+ src: ft(pe, Y),
3544
+ alt: pe,
3524
3545
  width: 14,
3525
3546
  height: 14,
3526
3547
  className: "rounded-full",
@@ -3529,10 +3550,10 @@ function bn({
3529
3550
  ) }),
3530
3551
  /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: Tt })
3531
3552
  ] })
3532
- ] }) : /* @__PURE__ */ l(
3553
+ ] }) : /* @__PURE__ */ i(
3533
3554
  "button",
3534
3555
  {
3535
- onClick: () => $("fiat"),
3556
+ onClick: () => H("fiat"),
3536
3557
  className: "flex items-center gap-1.5 shrink-0 transition-colors",
3537
3558
  style: {
3538
3559
  background: "var(--t-pill-bg)",
@@ -3541,10 +3562,10 @@ function bn({
3541
3562
  paddingLeft: 10,
3542
3563
  paddingRight: 10
3543
3564
  },
3544
- disabled: !!((Bt = D == null ? void 0 : D.sourceCurrency) != null && Bt.locked),
3565
+ disabled: !!((Bt = I == null ? void 0 : I.sourceCurrency) != null && Bt.locked),
3545
3566
  children: [
3546
- /* @__PURE__ */ e(pt, { currencyCode: Y, size: 16, baseUrl: O }),
3547
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: Je }, children: Y }),
3567
+ /* @__PURE__ */ e(ht, { currencyCode: R, size: 16, baseUrl: Y }),
3568
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: tt }, children: R }),
3548
3569
  /* @__PURE__ */ e(Ge, {})
3549
3570
  ]
3550
3571
  }
@@ -3553,35 +3574,35 @@ function bn({
3553
3574
  ]
3554
3575
  }
3555
3576
  ),
3556
- B && q > 0 && /* @__PURE__ */ e(
3577
+ de && U > 0 && /* @__PURE__ */ e(
3557
3578
  "div",
3558
3579
  {
3559
3580
  className: "px-[18px] py-[10px] mt-[2px]",
3560
3581
  style: { background: "var(--t-surface)", fontSize: 12, color: "#EF4444", lineHeight: "16px" },
3561
- children: Re || "No providers available for this combination"
3582
+ children: ye || "No providers available for this combination"
3562
3583
  }
3563
3584
  ),
3564
- _e && q > 0 && (w == null ? void 0 : w.bestQuote) && /* @__PURE__ */ l(
3585
+ _e && U > 0 && (F == null ? void 0 : F.bestQuote) && /* @__PURE__ */ i(
3565
3586
  "div",
3566
3587
  {
3567
3588
  className: "flex items-start gap-2 mt-[2px] px-[14px] py-[10px]",
3568
3589
  style: { background: "var(--t-surface)", fontSize: 12, color: "var(--t-text-secondary)", lineHeight: "16px" },
3569
3590
  children: [
3570
- /* @__PURE__ */ l("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", style: { flexShrink: 0, marginTop: 1 }, children: [
3591
+ /* @__PURE__ */ i("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", style: { flexShrink: 0, marginTop: 1 }, children: [
3571
3592
  /* @__PURE__ */ e("circle", { cx: "8", cy: "8", r: "7", stroke: "currentColor", strokeWidth: "1.5" }),
3572
3593
  /* @__PURE__ */ e("path", { d: "M8 7v4M8 5.5v-.01", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
3573
3594
  ] }),
3574
- /* @__PURE__ */ l("span", { children: [
3595
+ /* @__PURE__ */ i("span", { children: [
3575
3596
  "You will be charged for ",
3576
3597
  xt,
3577
3598
  " ",
3578
- H,
3599
+ N,
3579
3600
  ", the rest up to ",
3580
- ht(q),
3601
+ pt(U),
3581
3602
  " ",
3582
- Y,
3603
+ R,
3583
3604
  " will be credited to your ",
3584
- X,
3605
+ _,
3585
3606
  " account"
3586
3607
  ] })
3587
3608
  ]
@@ -3593,18 +3614,18 @@ function bn({
3593
3614
  className: "flex items-center justify-between mt-[2px] px-[18px] pt-[12px] pb-[14px]",
3594
3615
  style: {
3595
3616
  background: "var(--t-surface)",
3596
- ...!Q.length && !((Ot = c == null ? void 0 : c.paymentMethods) != null && Ot.length) ? { borderBottomLeftRadius: 5, borderBottomRightRadius: 5 } : {}
3617
+ ...!Q.length && !((Ot = q == null ? void 0 : q.paymentMethods) != null && Ot.length) ? { borderBottomLeftRadius: 5, borderBottomRightRadius: 5 } : {}
3597
3618
  },
3598
- children: /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: x ? "var(--t-success)" : "var(--t-text-secondary)" }, children: ia || " " })
3619
+ children: /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: S ? "var(--t-success)" : "var(--t-text-secondary)" }, children: ia || " " })
3599
3620
  }
3600
3621
  ),
3601
- (Q.length > 0 || (c == null ? void 0 : c.paymentMethods) && c.paymentMethods.length > 0) && /* @__PURE__ */ e("div", { className: "mt-[2px]", children: Q.length > 0 ? /* @__PURE__ */ e(
3602
- tn,
3622
+ (Q.length > 0 || (q == null ? void 0 : q.paymentMethods) && q.paymentMethods.length > 0) && /* @__PURE__ */ e("div", { className: "mt-[2px]", children: Q.length > 0 ? /* @__PURE__ */ e(
3623
+ an,
3603
3624
  {
3604
3625
  methods: Q,
3605
- selectedId: v.paymentMethodId,
3606
- onOpenModal: () => $("payment"),
3607
- fiatCurrency: v.fiatCurrency
3626
+ selectedId: g.paymentMethodId,
3627
+ onOpenModal: () => H("payment"),
3628
+ fiatCurrency: g.fiatCurrency
3608
3629
  }
3609
3630
  ) : /* @__PURE__ */ e(
3610
3631
  "div",
@@ -3618,24 +3639,24 @@ function bn({
3618
3639
  children: /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children: "No payment methods for this pair" })
3619
3640
  }
3620
3641
  ) }),
3621
- /* @__PURE__ */ l("div", { className: "mt-8", children: [
3622
- /* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: T ? "Receiving wallet address" : "Sending wallet address" }),
3642
+ /* @__PURE__ */ i("div", { className: "mt-8", children: [
3643
+ /* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: v ? "Receiving wallet address" : "Sending wallet address" }),
3623
3644
  /* @__PURE__ */ e(
3624
3645
  "input",
3625
3646
  {
3626
3647
  type: "text",
3627
- value: v.walletAddress,
3628
- onChange: (g) => L({ type: "SET_WALLET_ADDRESS", address: g.target.value }),
3629
- onFocus: () => ye(!0),
3648
+ value: g.walletAddress,
3649
+ onChange: (x) => T({ type: "SET_WALLET_ADDRESS", address: x.target.value }),
3650
+ onFocus: () => Ye(!0),
3630
3651
  onBlur: () => {
3631
- ye(!1), re(!0);
3652
+ Ye(!1), Te(!0);
3632
3653
  },
3633
- placeholder: T ? "Enter your receiving address" : "Enter your sending address",
3654
+ placeholder: v ? "Enter your receiving address" : "Enter your sending address",
3634
3655
  spellCheck: !1,
3635
3656
  autoComplete: "off",
3636
3657
  className: "w-full bg-transparent text-[13px] outline-none transition-colors",
3637
3658
  style: {
3638
- border: v.walletError || Xe && !ct ? "1px solid #EF4444" : rt ? "1px solid var(--t-border-focus)" : "1px solid var(--t-border)",
3659
+ border: g.walletError || $e && !ct ? "1px solid #EF4444" : Xe ? "1px solid var(--t-border-focus)" : "1px solid var(--t-border)",
3639
3660
  outline: "none",
3640
3661
  boxShadow: "none",
3641
3662
  borderRadius: 3.5,
@@ -3645,112 +3666,112 @@ function bn({
3645
3666
  fontSize: 13,
3646
3667
  backgroundColor: "transparent"
3647
3668
  },
3648
- disabled: !!((Ht = D == null ? void 0 : D.destinationAddress) != null && Ht.locked)
3669
+ disabled: !!((Ht = I == null ? void 0 : I.destinationAddress) != null && Ht.locked)
3649
3670
  }
3650
3671
  ),
3651
- v.walletError ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: v.walletError }) : Xe && !ct && !Oe ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: "Enter a valid wallet address" }) : Oe && v.walletAddress.trim().length >= 10 ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "var(--t-text-muted)" }, children: "Validating address..." }) : null
3672
+ g.walletError ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: g.walletError }) : $e && !ct && !P ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: "Enter a valid wallet address" }) : P && g.walletAddress.trim().length >= 10 ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "var(--t-text-muted)" }, children: "Validating address..." }) : null
3652
3673
  ] }),
3653
3674
  /* @__PURE__ */ e("div", { className: "flex-1", style: { minHeight: 16 } }),
3654
- ne && /* @__PURE__ */ l("div", { className: "text-[12px] text-center mb-2", style: { color: "#EF4444" }, children: [
3675
+ te && /* @__PURE__ */ i("div", { className: "text-[12px] text-center mb-2", style: { color: "#EF4444" }, children: [
3655
3676
  "This currency is not available for ",
3656
- T ? "buy" : "sell",
3677
+ v ? "buy" : "sell",
3657
3678
  " orders"
3658
3679
  ] }),
3659
3680
  /* @__PURE__ */ e(
3660
3681
  "button",
3661
3682
  {
3662
- disabled: !Qe || se || me || ne || B,
3663
- onClick: pa,
3683
+ disabled: !qe || ee || me || te || de,
3684
+ onClick: ha,
3664
3685
  className: "w-full font-semibold text-[16px] transition-all",
3665
3686
  style: {
3666
3687
  height: 60,
3667
3688
  borderRadius: 5,
3668
3689
  background: "var(--t-cta-bg)",
3669
3690
  color: "var(--t-cta-text)",
3670
- opacity: Qe && !se && !me && !ne && !B ? 1 : 0.4,
3671
- cursor: Qe && !se && !me && !ne && !B ? "pointer" : "not-allowed"
3691
+ opacity: qe && !ee && !me && !te && !de ? 1 : 0.4,
3692
+ cursor: qe && !ee && !me && !te && !de ? "pointer" : "not-allowed"
3672
3693
  },
3673
- children: me ? "Getting best price..." : se ? "Processing..." : T ? `Buy ${H}` : `Sell ${H}`
3694
+ children: me ? "Getting best price..." : ee ? "Processing..." : v ? `Buy ${N}` : `Sell ${N}`
3674
3695
  }
3675
3696
  ),
3676
3697
  /* @__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" }) })
3677
- ] }, M),
3678
- /* @__PURE__ */ e(je, { isOpen: ce === "fiat", onClose: () => $(null), children: (g) => /* @__PURE__ */ e(
3679
- mn,
3698
+ ] }, h),
3699
+ /* @__PURE__ */ e(je, { isOpen: Se === "fiat", onClose: () => H(null), children: (x) => /* @__PURE__ */ e(
3700
+ fn,
3680
3701
  {
3681
- onClose: g,
3682
- onSelect: (S) => {
3683
- sa(S), g();
3702
+ onClose: x,
3703
+ onSelect: (E) => {
3704
+ sa(E), x();
3684
3705
  },
3685
- currencies: de.map((S) => ({ code: S.code, name: S.code })),
3686
- assetBaseUrl: O,
3687
- selectedCode: v.fiatCurrency
3706
+ currencies: ke.map((E) => ({ code: E.code, name: E.code })),
3707
+ assetBaseUrl: Y,
3708
+ selectedCode: g.fiatCurrency
3688
3709
  }
3689
3710
  ) }),
3690
- /* @__PURE__ */ e(je, { isOpen: ce === "crypto", onClose: () => $(null), children: (g) => /* @__PURE__ */ e(
3691
- fn,
3711
+ /* @__PURE__ */ e(je, { isOpen: Se === "crypto", onClose: () => H(null), children: (x) => /* @__PURE__ */ e(
3712
+ pn,
3692
3713
  {
3693
- onClose: g,
3694
- onSelect: (S, K) => {
3695
- da(S, K), g();
3714
+ onClose: x,
3715
+ onSelect: (E, K) => {
3716
+ da(E, K), x();
3696
3717
  },
3697
- cryptos: Me.map((S) => {
3718
+ cryptos: se.map((E) => {
3698
3719
  var K;
3699
3720
  return {
3700
- code: S.code,
3701
- name: S.code,
3702
- networks: (K = S.networks) == null ? void 0 : K.map((W) => ({ code: W.id, name: W.name }))
3721
+ code: E.code,
3722
+ name: E.code,
3723
+ networks: (K = E.networks) == null ? void 0 : K.map((X) => ({ code: X.id, name: X.name }))
3703
3724
  };
3704
3725
  }),
3705
- assetBaseUrl: O,
3706
- selectedCode: v.cryptoCurrency,
3707
- selectedChain: v.network
3726
+ assetBaseUrl: Y,
3727
+ selectedCode: g.cryptoCurrency,
3728
+ selectedChain: g.network
3708
3729
  }
3709
3730
  ) }),
3710
- /* @__PURE__ */ e(je, { isOpen: ce === "payment", onClose: () => $(null), children: (g) => /* @__PURE__ */ e(
3731
+ /* @__PURE__ */ e(je, { isOpen: Se === "payment", onClose: () => H(null), children: (x) => /* @__PURE__ */ e(
3711
3732
  hn,
3712
3733
  {
3713
3734
  methods: Q,
3714
- selectedId: v.paymentMethodId,
3715
- onSelect: (S) => {
3716
- ua(S), g();
3735
+ selectedId: g.paymentMethodId,
3736
+ onSelect: (E) => {
3737
+ ua(E), x();
3717
3738
  },
3718
- onClose: g
3739
+ onClose: x
3719
3740
  }
3720
3741
  ) }),
3721
- /* @__PURE__ */ e(je, { isOpen: ce === "settings", onClose: () => $(null), children: (g) => /* @__PURE__ */ e(
3722
- Cn,
3742
+ /* @__PURE__ */ e(je, { isOpen: Se === "settings", onClose: () => H(null), children: (x) => /* @__PURE__ */ e(
3743
+ gn,
3723
3744
  {
3724
- onClose: g,
3725
- darkMode: le,
3726
- onToggleDarkMode: We,
3727
- skinId: ke,
3728
- onSelectSkin: (S) => {
3729
- Ie(S);
3745
+ onClose: x,
3746
+ darkMode: re,
3747
+ onToggleDarkMode: $,
3748
+ skinId: be,
3749
+ onSelectSkin: (E) => {
3750
+ Oe(E);
3730
3751
  },
3731
- showThemeToggle: k,
3732
- country: v.country,
3733
- countryName: ha,
3752
+ showThemeToggle: y,
3753
+ country: g.country,
3754
+ countryName: pa,
3734
3755
  onLocationPress: fa,
3735
- assetBaseUrl: O
3756
+ assetBaseUrl: Y
3736
3757
  }
3737
3758
  ) }),
3738
- /* @__PURE__ */ e(je, { isOpen: ce === "country", onClose: () => $(null), children: (g) => /* @__PURE__ */ e(
3739
- xn,
3759
+ /* @__PURE__ */ e(je, { isOpen: Se === "country", onClose: () => H(null), children: (x) => /* @__PURE__ */ e(
3760
+ vn,
3740
3761
  {
3741
- onClose: g,
3742
- onSelect: (S) => {
3743
- ma(S), g();
3762
+ onClose: x,
3763
+ onSelect: (E) => {
3764
+ ma(E), x();
3744
3765
  },
3745
- assetBaseUrl: O,
3746
- selectedCode: v.country
3766
+ assetBaseUrl: Y,
3767
+ selectedCode: g.country
3747
3768
  }
3748
3769
  ) })
3749
3770
  ]
3750
3771
  }
3751
3772
  );
3752
3773
  }
3753
- function Sn({
3774
+ function Nn({
3754
3775
  projectId: t,
3755
3776
  apiUrl: a,
3756
3777
  assetBaseUrl: n,
@@ -3758,44 +3779,45 @@ function Sn({
3758
3779
  customerId: o,
3759
3780
  brandId: d,
3760
3781
  defaultFiatCurrency: u,
3761
- defaultCryptoCurrency: i,
3762
- defaultNetwork: s,
3782
+ defaultCryptoCurrency: l,
3783
+ defaultNetwork: c,
3763
3784
  defaultFiatAmount: m,
3764
- defaultCryptoAmount: h,
3785
+ defaultCryptoAmount: p,
3765
3786
  defaultWalletAddress: f,
3766
- defaultGateway: y,
3767
- defaultCountry: x,
3768
- fieldLocks: C,
3769
- statusPollInterval: E,
3770
- onComplete: k,
3771
- onError: _,
3772
- className: ie,
3773
- theme: G,
3774
- skinId: z,
3775
- accentColor: te,
3776
- bgColor: X,
3777
- bgImage: ve,
3778
- borderColor: v,
3779
- borderRadius: L,
3780
- surfaceColor: c,
3781
- inputBgColor: U,
3782
- textColor: w,
3783
- textSecondaryColor: b,
3784
- textMutedColor: J,
3785
- successColor: be,
3786
- showFlowToggle: Se,
3787
- showSettings: se,
3788
- showThemeToggle: pe,
3789
- autoRedirect: D,
3790
- explorerUrl: ae,
3791
- doneButtonText: O,
3792
- supportEmail: de,
3793
- stablecoinParity: Me,
3794
- partnerName: Q,
3795
- onDone: ne
3787
+ defaultGateway: C,
3788
+ defaultCountry: S,
3789
+ fieldLocks: k,
3790
+ partnerMetadata: w,
3791
+ statusPollInterval: y,
3792
+ onComplete: O,
3793
+ onError: le,
3794
+ className: G,
3795
+ theme: z,
3796
+ skinId: ce,
3797
+ accentColor: _,
3798
+ bgColor: ne,
3799
+ bgImage: g,
3800
+ borderColor: T,
3801
+ borderRadius: q,
3802
+ surfaceColor: xe,
3803
+ inputBgColor: F,
3804
+ textColor: s,
3805
+ textSecondaryColor: L,
3806
+ textMutedColor: W,
3807
+ successColor: b,
3808
+ showFlowToggle: ee,
3809
+ showSettings: ue,
3810
+ showThemeToggle: I,
3811
+ autoRedirect: ve,
3812
+ explorerUrl: Y,
3813
+ doneButtonText: ke,
3814
+ supportEmail: se,
3815
+ stablecoinParity: Q,
3816
+ partnerName: te,
3817
+ onDone: de
3796
3818
  }) {
3797
3819
  return /* @__PURE__ */ e(
3798
- Ia,
3820
+ Ba,
3799
3821
  {
3800
3822
  projectId: t,
3801
3823
  apiUrl: a,
@@ -3804,57 +3826,58 @@ function Sn({
3804
3826
  customerId: o,
3805
3827
  brandId: d,
3806
3828
  defaultFiatCurrency: u,
3807
- defaultCryptoCurrency: i,
3808
- defaultNetwork: s,
3829
+ defaultCryptoCurrency: l,
3830
+ defaultNetwork: c,
3809
3831
  defaultFiatAmount: m,
3810
- defaultCryptoAmount: h,
3832
+ defaultCryptoAmount: p,
3811
3833
  defaultWalletAddress: f,
3812
- defaultGateway: y,
3813
- defaultCountry: x,
3814
- fieldLocks: C,
3815
- statusPollInterval: E,
3816
- onComplete: k,
3817
- onError: _,
3834
+ defaultGateway: C,
3835
+ defaultCountry: S,
3836
+ fieldLocks: k,
3837
+ partnerMetadata: w,
3838
+ statusPollInterval: y,
3839
+ onComplete: O,
3840
+ onError: le,
3818
3841
  children: /* @__PURE__ */ e(
3819
- bn,
3842
+ Sn,
3820
3843
  {
3821
- className: ie,
3822
- theme: G,
3823
- skinId: z,
3824
- accentColor: te,
3825
- bgColor: X,
3826
- bgImage: ve,
3827
- borderColor: v,
3828
- borderRadius: L,
3829
- surfaceColor: c,
3830
- inputBgColor: U,
3831
- textColor: w,
3832
- textSecondaryColor: b,
3833
- textMutedColor: J,
3834
- successColor: be,
3835
- showFlowToggle: Se,
3836
- showSettings: se,
3837
- showThemeToggle: pe,
3838
- autoRedirect: D,
3839
- explorerUrl: ae,
3840
- doneButtonText: O,
3841
- supportEmail: de,
3842
- stablecoinParity: Me,
3843
- partnerName: Q,
3844
- onDone: ne
3844
+ className: G,
3845
+ theme: z,
3846
+ skinId: ce,
3847
+ accentColor: _,
3848
+ bgColor: ne,
3849
+ bgImage: g,
3850
+ borderColor: T,
3851
+ borderRadius: q,
3852
+ surfaceColor: xe,
3853
+ inputBgColor: F,
3854
+ textColor: s,
3855
+ textSecondaryColor: L,
3856
+ textMutedColor: W,
3857
+ successColor: b,
3858
+ showFlowToggle: ee,
3859
+ showSettings: ue,
3860
+ showThemeToggle: I,
3861
+ autoRedirect: ve,
3862
+ explorerUrl: Y,
3863
+ doneButtonText: ke,
3864
+ supportEmail: se,
3865
+ stablecoinParity: Q,
3866
+ partnerName: te,
3867
+ onDone: de
3845
3868
  }
3846
3869
  )
3847
3870
  }
3848
3871
  );
3849
3872
  }
3850
- function Fn({
3873
+ function Dn({
3851
3874
  submitButtonText: t,
3852
3875
  rateRefreshInterval: a,
3853
3876
  ...n
3854
3877
  }) {
3855
- return /* @__PURE__ */ e(Sn, { ...n });
3878
+ return /* @__PURE__ */ e(Nn, { ...n });
3856
3879
  }
3857
- function Dn({
3880
+ function In({
3858
3881
  skin: t,
3859
3882
  active: a,
3860
3883
  onClick: n,
@@ -3862,14 +3885,14 @@ function Dn({
3862
3885
  dimmed: o
3863
3886
  }) {
3864
3887
  const d = t.accent === null, u = 32;
3865
- return /* @__PURE__ */ l(
3888
+ return /* @__PURE__ */ i(
3866
3889
  "button",
3867
3890
  {
3868
3891
  onClick: n,
3869
3892
  className: "relative shrink-0",
3870
3893
  style: { width: u, height: u, opacity: o ? 0.4 : 1, transition: "opacity 0.2s" },
3871
3894
  children: [
3872
- d ? /* @__PURE__ */ l("svg", { width: u, height: u, viewBox: "0 0 32 32", children: [
3895
+ d ? /* @__PURE__ */ i("svg", { width: u, height: u, viewBox: "0 0 32 32", children: [
3873
3896
  /* @__PURE__ */ e("clipPath", { id: "mono-left", children: /* @__PURE__ */ e("rect", { x: "0", y: "0", width: "16", height: "32" }) }),
3874
3897
  /* @__PURE__ */ e("clipPath", { id: "mono-right", children: /* @__PURE__ */ e("rect", { x: "16", y: "0", width: "16", height: "32" }) }),
3875
3898
  /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: "#111111", clipPath: "url(#mono-left)" }),
@@ -3887,13 +3910,13 @@ function Dn({
3887
3910
  }
3888
3911
  );
3889
3912
  }
3890
- function Nn({ quote: t }) {
3891
- 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__ */ l("div", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: [
3913
+ function wn({ quote: t }) {
3914
+ 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__ */ i("div", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: [
3892
3915
  "#",
3893
3916
  t.rank
3894
3917
  ] }) : null;
3895
3918
  }
3896
- function wn({ quote: t }) {
3919
+ function En({ quote: t }) {
3897
3920
  return t.gatewayLogo ? /* @__PURE__ */ e(
3898
3921
  "img",
3899
3922
  {
@@ -3906,8 +3929,8 @@ function wn({ quote: t }) {
3906
3929
  }
3907
3930
  ) : /* @__PURE__ */ e(gt, { size: 36 });
3908
3931
  }
3909
- function En() {
3910
- return /* @__PURE__ */ e("div", { className: "space-y-2", children: [0, 1, 2].map((t) => /* @__PURE__ */ l(
3932
+ function An() {
3933
+ return /* @__PURE__ */ e("div", { className: "space-y-2", children: [0, 1, 2].map((t) => /* @__PURE__ */ i(
3911
3934
  "div",
3912
3935
  {
3913
3936
  className: "w-full flex items-center gap-3.5",
@@ -3920,11 +3943,11 @@ function En() {
3920
3943
  },
3921
3944
  children: [
3922
3945
  /* @__PURE__ */ e(V, { w: 36, h: 36, className: "rounded-full shrink-0" }),
3923
- /* @__PURE__ */ l("div", { className: "flex-1", children: [
3946
+ /* @__PURE__ */ i("div", { className: "flex-1", children: [
3924
3947
  /* @__PURE__ */ e(V, { w: 90, h: 14, className: "mb-1.5" }),
3925
3948
  /* @__PURE__ */ e(V, { w: 60, h: 12 })
3926
3949
  ] }),
3927
- /* @__PURE__ */ l("div", { className: "text-right", children: [
3950
+ /* @__PURE__ */ i("div", { className: "text-right", children: [
3928
3951
  /* @__PURE__ */ e(V, { w: 40, h: 10, className: "mb-1.5" }),
3929
3952
  /* @__PURE__ */ e(V, { w: 80, h: 14 })
3930
3953
  ] })
@@ -3940,13 +3963,13 @@ function Mn({
3940
3963
  quotesLoading: r,
3941
3964
  cryptoCurrency: o
3942
3965
  }) {
3943
- const [d, u] = N(""), i = j(() => {
3966
+ const [d, u] = A(""), l = j(() => {
3944
3967
  if (!(n != null && n.quotes)) return [];
3945
- const s = d.trim().toLowerCase();
3946
- return s ? n.quotes.filter((m) => m.gatewayName.toLowerCase().includes(s)) : n.quotes;
3968
+ const c = d.trim().toLowerCase();
3969
+ return c ? n.quotes.filter((m) => m.gatewayName.toLowerCase().includes(c)) : n.quotes;
3947
3970
  }, [n, d]);
3948
- return /* @__PURE__ */ l(ee, { children: [
3949
- /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(De, { onClick: t }) }),
3971
+ return /* @__PURE__ */ i(ae, { children: [
3972
+ /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Be, { onClick: t }) }),
3950
3973
  /* @__PURE__ */ e(
3951
3974
  "h2",
3952
3975
  {
@@ -3955,116 +3978,116 @@ function Mn({
3955
3978
  children: "Choose Ramp"
3956
3979
  }
3957
3980
  ),
3958
- /* @__PURE__ */ e($e, { value: d, onChange: u }),
3959
- /* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto custom-scroll px-5 space-y-2", children: [
3960
- r ? /* @__PURE__ */ e(En, {}) : i.length === 0 ? /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: n && n.quotes.length === 0 ? "No quotes available for this request" : "No providers found" }) : i.map((s, m) => {
3961
- const h = m === 0, f = parseFloat(s.cryptoAmount), y = f >= 1 ? f.toFixed(4) : f.toPrecision(6);
3962
- return /* @__PURE__ */ l(
3981
+ /* @__PURE__ */ e(We, { value: d, onChange: u }),
3982
+ /* @__PURE__ */ i("div", { className: "flex-1 overflow-y-auto custom-scroll px-5 space-y-2", children: [
3983
+ r ? /* @__PURE__ */ e(An, {}) : l.length === 0 ? /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: n && n.quotes.length === 0 ? "No quotes available for this request" : "No providers found" }) : l.map((c, m) => {
3984
+ const p = m === 0, f = parseFloat(c.cryptoAmount), C = f >= 1 ? f.toFixed(4) : f.toPrecision(6);
3985
+ return /* @__PURE__ */ i(
3963
3986
  "button",
3964
3987
  {
3965
- onClick: () => a(s),
3988
+ onClick: () => a(c),
3966
3989
  className: "w-full flex items-center gap-3.5 transition-colors",
3967
3990
  style: {
3968
- borderRadius: h ? 4.5 : 5,
3969
- height: h ? 63 : 64,
3991
+ borderRadius: p ? 4.5 : 5,
3992
+ height: p ? 63 : 64,
3970
3993
  paddingLeft: 16,
3971
3994
  paddingRight: 16,
3972
- border: h ? "1px solid var(--t-border)" : "1px solid transparent",
3973
- background: h ? "transparent" : "var(--t-surface)"
3995
+ border: p ? "1px solid var(--t-border)" : "1px solid transparent",
3996
+ background: p ? "transparent" : "var(--t-surface)"
3974
3997
  },
3975
3998
  children: [
3976
- /* @__PURE__ */ e(wn, { quote: s }),
3977
- /* @__PURE__ */ l("div", { className: "text-left flex-1 min-w-0", children: [
3978
- /* @__PURE__ */ e("div", { className: "font-medium text-[15px]", style: { color: "var(--t-text)" }, children: s.gatewayName }),
3979
- /* @__PURE__ */ e(Nn, { quote: s })
3999
+ /* @__PURE__ */ e(En, { quote: c }),
4000
+ /* @__PURE__ */ i("div", { className: "text-left flex-1 min-w-0", children: [
4001
+ /* @__PURE__ */ e("div", { className: "font-medium text-[15px]", style: { color: "var(--t-text)" }, children: c.gatewayName }),
4002
+ /* @__PURE__ */ e(wn, { quote: c })
3980
4003
  ] }),
3981
- /* @__PURE__ */ l("div", { className: "text-right shrink-0", children: [
4004
+ /* @__PURE__ */ i("div", { className: "text-right shrink-0", children: [
3982
4005
  /* @__PURE__ */ e("div", { className: "text-[11px]", style: { color: "var(--t-text-secondary)" }, children: "You get" }),
3983
- /* @__PURE__ */ l("div", { className: "font-medium text-[14px]", style: { color: "var(--t-text)" }, children: [
4006
+ /* @__PURE__ */ i("div", { className: "font-medium text-[14px]", style: { color: "var(--t-text)" }, children: [
3984
4007
  o,
3985
4008
  " ",
3986
- y
4009
+ C
3987
4010
  ] })
3988
4011
  ] })
3989
4012
  ]
3990
4013
  },
3991
- s.gatewayId
4014
+ c.gatewayId
3992
4015
  );
3993
4016
  }),
3994
- !r && (n == null ? void 0 : n.unavailableGateways) && n.unavailableGateways.length > 0 && /* @__PURE__ */ e("div", { className: "pt-3", children: n.unavailableGateways.map((s) => /* @__PURE__ */ l(
4017
+ !r && (n == null ? void 0 : n.unavailableGateways) && n.unavailableGateways.length > 0 && /* @__PURE__ */ e("div", { className: "pt-3", children: n.unavailableGateways.map((c) => /* @__PURE__ */ i(
3995
4018
  "div",
3996
4019
  {
3997
4020
  className: "flex items-center justify-between py-2 text-[12px]",
3998
4021
  style: { color: "var(--t-text-muted)" },
3999
4022
  children: [
4000
- /* @__PURE__ */ e("span", { children: s.gatewayName }),
4001
- /* @__PURE__ */ e("span", { children: s.reason })
4023
+ /* @__PURE__ */ e("span", { children: c.gatewayName }),
4024
+ /* @__PURE__ */ e("span", { children: c.reason })
4002
4025
  ]
4003
4026
  },
4004
- s.gatewayId
4027
+ c.gatewayId
4005
4028
  )) })
4006
4029
  ] })
4007
4030
  ] });
4008
4031
  }
4009
4032
  export {
4010
- sn as AnimatedDigit,
4011
- dn as AnimatedNumber,
4012
- Ga as ApplePayIcon,
4033
+ dn as AnimatedDigit,
4034
+ un as AnimatedNumber,
4035
+ Wa as ApplePayIcon,
4013
4036
  Ve as BLOCKCHAINS,
4014
- Va as BankIcon,
4015
- et as COUNTRIES,
4037
+ ja as BankIcon,
4038
+ nt as COUNTRIES,
4016
4039
  yt as COUNTRY_MAP,
4017
- _a as CRYPTO_CHAIN_COMBOS,
4040
+ Va as CRYPTO_CHAIN_COMBOS,
4018
4041
  Jt as CRYPTO_CURRENCIES,
4019
- Za as CardIcon,
4020
- Fn as CheckoutForm,
4021
- an as CheckoutStep,
4042
+ Qa as CardIcon,
4043
+ Dn as CheckoutForm,
4044
+ nn as CheckoutStep,
4022
4045
  Ge as ChevronDown,
4023
4046
  Xt as ChevronRight,
4024
4047
  Mn as ChooseRampModal,
4025
- De as CloseButton,
4026
- Un as CoinifyIcon,
4027
- on as CompleteStep,
4028
- cn as ConfirmStep,
4029
- xn as CountryPickerModal,
4030
- fn as CryptoCurrencyModal,
4031
- Wt as CryptoIcon,
4032
- za as DarkModeIcon,
4033
- ln as ErrorStep,
4048
+ Be as CloseButton,
4049
+ Fn as CoinifyIcon,
4050
+ ln as CompleteStep,
4051
+ sn as ConfirmStep,
4052
+ vn as CountryPickerModal,
4053
+ pn as CryptoCurrencyModal,
4054
+ $t as CryptoIcon,
4055
+ Ja as DarkModeIcon,
4056
+ cn as ErrorStep,
4034
4057
  _t as FIAT_CURRENCIES,
4035
- Oa as FIAT_TO_COUNTRY,
4036
- mn as FiatCurrencyModal,
4037
- pt as FiatFlag,
4038
- un as FormSkeleton,
4058
+ Ha as FIAT_TO_COUNTRY,
4059
+ fn as FiatCurrencyModal,
4060
+ ht as FiatFlag,
4061
+ mn as FormSkeleton,
4039
4062
  gt as GenericCoinIcon,
4040
4063
  $a as GooglePayIcon,
4041
4064
  jt as MOCK_RATES,
4042
- Qa as MenuIcon,
4065
+ za as MenuIcon,
4043
4066
  je as Modal,
4044
- Wa as PayPalIcon,
4045
- tn as PaymentMethodSelector,
4046
- rn as ProcessingStep,
4047
- Sn as RampForm,
4048
- Ia as RampProvider,
4049
- ja as RevolutIcon,
4067
+ Xa as PayPalIcon,
4068
+ an as PaymentMethodSelector,
4069
+ on as ProcessingStep,
4070
+ Nn as RampForm,
4071
+ Ba as RampProvider,
4072
+ Ga as RevolutIcon,
4050
4073
  Vt as SKINS,
4051
- $e as SearchInput,
4052
- Cn as SettingsScreen,
4074
+ We as SearchInput,
4075
+ gn as SettingsScreen,
4053
4076
  V as Skeleton,
4054
- Dn as SkinSwatch,
4055
- pn as ToggleSwitch,
4056
- ht as formatOutput,
4077
+ In as SkinSwatch,
4078
+ yn as ToggleSwitch,
4079
+ pt as formatOutput,
4057
4080
  ft as getChainIconUrl,
4058
4081
  qt as getCryptoIconUrl,
4059
4082
  mt as getDefaultFiatForCountry,
4060
- Ha as getFiatFlagUrl,
4061
- Ln as getMockRate,
4062
- Ja as getPaymentIcon,
4083
+ Pa as getFiatFlagUrl,
4084
+ Un as getMockRate,
4085
+ qa as getPaymentIcon,
4063
4086
  ea as isStablecoin,
4064
- Ka as parseAmount,
4087
+ _a as parseAmount,
4065
4088
  wa as useCheckoutIntent,
4066
4089
  Na as useQuotes,
4067
- Fe as useRamp,
4090
+ Me as useRamp,
4068
4091
  Sa as useRampConfig,
4069
4092
  Ea as useTransaction
4070
4093
  };