@nowramp/form 0.1.39 → 0.1.41

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
@@ -9,12 +9,12 @@
9
9
  document.head.appendChild(s);
10
10
  })();
11
11
  import { jsx as e, jsxs as l, Fragment as J } from "react/jsx-runtime";
12
- import ke, { useState as C, useRef as F, useCallback as X, useEffect as D, useMemo as K, useReducer as Rt, useContext as kt, createContext as Lt } from "react";
12
+ import ke, { useState as N, useRef as U, useCallback as _, useEffect as H, useMemo as K, useReducer as Tt, useContext as kt, createContext as Lt } from "react";
13
13
  import { RampApi as Me } from "@nowramp/sdk";
14
14
  function It(t, a) {
15
- const [n, s] = C(null), [r, u] = C(!0), [m, i] = C(null), o = F(null);
15
+ const [n, s] = N(null), [r, u] = N(!0), [m, i] = N(null), o = U(null);
16
16
  (!o.current || o.current !== t) && (o.current = new Me({ apiKey: "", ...t }));
17
- const d = X(async () => {
17
+ const d = _(async () => {
18
18
  if (!t.projectId) {
19
19
  i(new Error("projectId is required")), u(!1);
20
20
  return;
@@ -29,15 +29,15 @@ function It(t, a) {
29
29
  u(!1);
30
30
  }
31
31
  }, [t.projectId, a]);
32
- return D(() => {
32
+ return H(() => {
33
33
  d();
34
34
  }, [d]), { config: n, loading: r, error: m, refetch: d };
35
35
  }
36
36
  function Mt(t, a) {
37
- const [n, s] = C(null), [r, u] = C(!1), [m, i] = C(null), o = F(null), d = F(""), h = `${t.apiUrl}|${t.projectId}`;
37
+ const [n, s] = N(null), [r, u] = N(!1), [m, i] = N(null), o = U(null), d = U(""), h = `${t.apiUrl}|${t.projectId}`;
38
38
  (!o.current || d.current !== h) && (o.current = new Me({ apiKey: "", ...t }), d.current = h);
39
- const f = F(0);
40
- D(() => {
39
+ const f = U(0);
40
+ H(() => {
41
41
  const g = ++f.current;
42
42
  if (!a || !t.projectId) {
43
43
  s(null), u(!1);
@@ -52,7 +52,7 @@ function Mt(t, a) {
52
52
  }
53
53
  );
54
54
  }, [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]);
55
- const x = X(async () => {
55
+ const x = _(async () => {
56
56
  if (!(!a || !t.projectId)) {
57
57
  u(!0), i(null);
58
58
  try {
@@ -68,9 +68,9 @@ function Mt(t, a) {
68
68
  return { quotes: n, loading: r, error: m, refetch: x };
69
69
  }
70
70
  function Bt(t) {
71
- const [a, n] = C(null), [s, r] = C(!1), [u, m] = C(null), i = F(null), o = F(""), d = `${t.apiUrl}|${t.projectId}`;
71
+ const [a, n] = N(null), [s, r] = N(!1), [u, m] = N(null), i = U(null), o = U(""), d = `${t.apiUrl}|${t.projectId}`;
72
72
  (!i.current || o.current !== d) && (i.current = new Me({ apiKey: "", ...t }), o.current = d);
73
- const h = X(async (x) => {
73
+ const h = _(async (x) => {
74
74
  r(!0), m(null);
75
75
  try {
76
76
  const g = await i.current.createCheckoutIntent(x);
@@ -81,15 +81,15 @@ function Bt(t) {
81
81
  } finally {
82
82
  r(!1);
83
83
  }
84
- }, []), f = X(() => {
84
+ }, []), f = _(() => {
85
85
  n(null), m(null);
86
86
  }, []);
87
87
  return { order: a, loading: s, error: u, createOrder: h, reset: f };
88
88
  }
89
89
  function Ot(t, a, n) {
90
- const [s, r] = C(null), [u, m] = C(!1), [i, o] = C(null), d = F(null);
90
+ const [s, r] = N(null), [u, m] = N(!1), [i, o] = N(null), d = U(null);
91
91
  d.current || (d.current = new Me({ apiKey: "", projectId: "", ...t }));
92
- const h = X(async () => {
92
+ const h = _(async () => {
93
93
  if (a) {
94
94
  m(!0), o(null);
95
95
  try {
@@ -102,7 +102,7 @@ function Ot(t, a, n) {
102
102
  }
103
103
  }
104
104
  }, [a]);
105
- return D(() => {
105
+ return H(() => {
106
106
  if (!a) return;
107
107
  const f = (n == null ? void 0 : n.initialDelay) ?? 0;
108
108
  if (f > 0) {
@@ -110,7 +110,7 @@ function Ot(t, a, n) {
110
110
  return () => clearTimeout(x);
111
111
  }
112
112
  h();
113
- }, [h, a, n == null ? void 0 : n.initialDelay]), D(() => {
113
+ }, [h, a, n == null ? void 0 : n.initialDelay]), H(() => {
114
114
  if (!a || !(n != null && n.pollInterval) || !s || ["completed", "failed", "cancelled", "expired", "refunded"].includes(s.status))
115
115
  return;
116
116
  const x = setInterval(h, n.pollInterval);
@@ -198,7 +198,7 @@ function Pt(t, a) {
198
198
  }
199
199
  }
200
200
  const ft = Lt(null);
201
- function Ht({
201
+ function Dt({
202
202
  projectId: t,
203
203
  apiUrl: a = "https://api.nowramp.com",
204
204
  assetBaseUrl: n = "",
@@ -215,9 +215,9 @@ function Ht({
215
215
  statusPollInterval: g = 5e3,
216
216
  onComplete: p,
217
217
  onError: b,
218
- children: T
218
+ children: R
219
219
  }) {
220
- const H = K(() => ({ apiUrl: a, projectId: t }), [a, t]), w = i || (m ? m.toLowerCase() : ""), j = s === "sell", Q = j ? !!d : !!o, z = (j ? !!(Q && m && w) : !!(Q && m && w && h)) && f ? "confirm" : "amount", [c, O] = Rt(Pt, {
220
+ const P = K(() => ({ apiUrl: a, projectId: t }), [a, t]), w = i || (m ? m.toLowerCase() : ""), G = s === "sell", Q = G ? !!d : !!o, z = (G ? !!(Q && m && w) : !!(Q && m && w && h)) && f ? "confirm" : "amount", [c, O] = Tt(Pt, {
221
221
  ...ht,
222
222
  step: z,
223
223
  flowType: s,
@@ -228,63 +228,63 @@ function Ht({
228
228
  cryptoAmount: lt(d, 6),
229
229
  walletAddress: h,
230
230
  customerId: r
231
- }), N = c.flowType === "sell", {
231
+ }), C = c.flowType === "sell", {
232
232
  config: L,
233
- loading: _,
234
- error: $
235
- } = It(H, c.flowType);
233
+ loading: F,
234
+ error: X
235
+ } = It(P, c.flowType);
236
236
  ke.useEffect(() => {
237
- var S, R, k;
237
+ var S, k, T;
238
238
  if (!L || !c.cryptoCurrency || c.network) return;
239
- const v = (S = L.cryptos) == null ? void 0 : S.find((P) => P.code === c.cryptoCurrency), E = ((R = v == null ? void 0 : v.networks) == null ? void 0 : R.find((P) => P.isDefault)) || ((k = v == null ? void 0 : v.networks) == null ? void 0 : k[0]);
239
+ const v = (S = L.cryptos) == null ? void 0 : S.find((D) => D.code === c.cryptoCurrency), E = ((k = v == null ? void 0 : v.networks) == null ? void 0 : k.find((D) => D.isDefault)) || ((T = v == null ? void 0 : v.networks) == null ? void 0 : T[0]);
240
240
  E != null && E.id && O({ type: "SET_NETWORK", network: E.id });
241
241
  }, [L, c.cryptoCurrency, c.network]), ke.useEffect(() => {
242
- var R, k;
243
- if (!((R = L == null ? void 0 : L.paymentMethods) != null && R.length)) return;
242
+ var k, T;
243
+ if (!((k = L == null ? void 0 : L.paymentMethods) != null && k.length)) return;
244
244
  const v = c.fiatCurrency, E = L.paymentMethods;
245
245
  if (c.paymentMethodId && E.some(
246
- (U) => U.id === c.paymentMethodId && U.supportedFiats.includes(v)
246
+ (W) => W.id === c.paymentMethodId && W.supportedFiats.includes(v)
247
247
  ))
248
248
  return;
249
- const S = E.find((P) => P.supportedFiats.includes(v));
250
- O({ type: "SET_PAYMENT_METHOD", methodId: (S == null ? void 0 : S.id) || ((k = E[0]) == null ? void 0 : k.id) || "" });
249
+ const S = E.find((D) => D.supportedFiats.includes(v));
250
+ O({ type: "SET_PAYMENT_METHOD", methodId: (S == null ? void 0 : S.id) || ((T = E[0]) == null ? void 0 : T.id) || "" });
251
251
  }, [L, c.fiatCurrency, c.paymentMethodId]);
252
- const G = K(() => {
253
- if (N) {
252
+ const $ = K(() => {
253
+ if (C) {
254
254
  if (!c.cryptoAmount) return null;
255
- const k = parseFloat(c.cryptoAmount);
256
- return isNaN(k) || k <= 0 ? "Enter a valid amount" : null;
255
+ const T = parseFloat(c.cryptoAmount);
256
+ return isNaN(T) || T <= 0 ? "Enter a valid amount" : null;
257
257
  }
258
258
  if (!L || !c.fiatAmount) return null;
259
259
  const v = parseFloat(c.fiatAmount);
260
260
  if (isNaN(v)) return null;
261
- const E = L.fiats.find((k) => k.code === c.fiatCurrency);
261
+ const E = L.fiats.find((T) => T.code === c.fiatCurrency);
262
262
  if (!E) return null;
263
- const S = parseFloat(E.minAmount), R = parseFloat(E.maxAmount);
264
- return !isNaN(S) && v < S ? `Minimum amount is ${E.minAmount} ${c.fiatCurrency}` : !isNaN(R) && v > R ? `Maximum amount is ${E.maxAmount} ${c.fiatCurrency}` : null;
265
- }, [L, c.fiatAmount, c.fiatCurrency, c.cryptoAmount, N]), Ne = K(() => {
266
- const v = N ? !!c.cryptoAmount : !!c.fiatAmount;
267
- return !L || !v || !c.cryptoCurrency || !c.network || G ? null : {
263
+ const S = parseFloat(E.minAmount), k = parseFloat(E.maxAmount);
264
+ return !isNaN(S) && v < S ? `Minimum amount is ${E.minAmount} ${c.fiatCurrency}` : !isNaN(k) && v > k ? `Maximum amount is ${E.maxAmount} ${c.fiatCurrency}` : null;
265
+ }, [L, c.fiatAmount, c.fiatCurrency, c.cryptoAmount, C]), Ne = K(() => {
266
+ const v = C ? !!c.cryptoAmount : !!c.fiatAmount;
267
+ return !L || !v || !c.cryptoCurrency || !c.network || $ ? null : {
268
268
  fiatCurrency: c.fiatCurrency,
269
- ...N ? { cryptoAmount: c.cryptoAmount } : { fiatAmount: c.fiatAmount },
269
+ ...C ? { cryptoAmount: c.cryptoAmount } : { fiatAmount: c.fiatAmount },
270
270
  cryptoCurrency: c.cryptoCurrency,
271
271
  network: c.network,
272
272
  paymentMethodId: c.paymentMethodId || void 0,
273
273
  country: c.country || void 0,
274
274
  orderType: c.flowType
275
275
  };
276
- }, [L, c.fiatCurrency, c.fiatAmount, c.cryptoAmount, c.cryptoCurrency, c.network, c.paymentMethodId, c.country, G, N, c.flowType]), {
276
+ }, [L, c.fiatCurrency, c.fiatAmount, c.cryptoAmount, c.cryptoCurrency, c.network, c.paymentMethodId, c.country, $, C, c.flowType]), {
277
277
  quotes: he,
278
278
  loading: fe,
279
- error: V,
279
+ error: j,
280
280
  refetch: ye
281
- } = Mt(H, Ne), {
281
+ } = Mt(P, Ne), {
282
282
  order: ae,
283
283
  loading: Ce,
284
284
  error: se,
285
285
  createOrder: ce
286
- } = Bt(H), be = 15e3, {
287
- status: W,
286
+ } = Bt(P), be = 15e3, {
287
+ status: V,
288
288
  loading: ne
289
289
  } = Ot(
290
290
  { apiUrl: a },
@@ -292,21 +292,21 @@ function Ht({
292
292
  { pollInterval: g, initialDelay: be }
293
293
  );
294
294
  ke.useEffect(() => {
295
- (W == null ? void 0 : W.status) === "completed" && p && p(W);
296
- }, [W == null ? void 0 : W.status, p]), ke.useEffect(() => {
297
- const v = $ || se;
295
+ (V == null ? void 0 : V.status) === "completed" && p && p(V);
296
+ }, [V == null ? void 0 : V.status, p]), ke.useEffect(() => {
297
+ const v = X || se;
298
298
  v && b && b(v);
299
- }, [$, se, b]);
300
- const re = f || (L == null ? void 0 : L.defaultGateway) || null, Ee = F(re);
299
+ }, [X, se, b]);
300
+ const re = f || (L == null ? void 0 : L.defaultGateway) || null, Ee = U(re);
301
301
  Ee.current = re;
302
- const Ae = F(he);
302
+ const Ae = U(he);
303
303
  Ae.current = he;
304
- const we = X(async () => {
305
- var S, R, k;
306
- const v = ((S = c.selectedQuote) == null ? void 0 : S.gatewayId) || ((k = (R = Ae.current) == null ? void 0 : R.bestQuote) == null ? void 0 : k.gatewayId) || Ee.current, E = c.flowType === "buy";
307
- if (!v || E && !c.walletAddress) {
308
- const P = [!v && "gateway", E && !c.walletAddress && "walletAddress"].filter(Boolean).join(", ");
309
- O({ type: "SET_ERROR", message: `Missing required fields: ${P}` });
304
+ const we = _(async () => {
305
+ var E, S, k;
306
+ const v = ((E = c.selectedQuote) == null ? void 0 : E.gatewayId) || ((k = (S = Ae.current) == null ? void 0 : S.bestQuote) == null ? void 0 : k.gatewayId) || Ee.current;
307
+ if (!v || !c.walletAddress) {
308
+ const T = [!v && "gateway", !c.walletAddress && "walletAddress"].filter(Boolean).join(", ");
309
+ O({ type: "SET_ERROR", message: `Missing required fields: ${T}` });
310
310
  return;
311
311
  }
312
312
  try {
@@ -314,30 +314,30 @@ function Ht({
314
314
  gateway: v,
315
315
  customerId: c.customerId || void 0,
316
316
  fiatCurrency: c.fiatCurrency,
317
- ...N ? { cryptoAmount: c.cryptoAmount } : { fiatAmount: c.fiatAmount },
317
+ ...C ? { cryptoAmount: c.cryptoAmount } : { fiatAmount: c.fiatAmount },
318
318
  cryptoCurrency: c.cryptoCurrency,
319
319
  network: c.network,
320
- walletAddress: c.walletAddress || void 0,
320
+ walletAddress: c.walletAddress,
321
321
  paymentMethodId: c.paymentMethodId || void 0,
322
322
  email: c.email || void 0,
323
323
  orderType: c.flowType
324
324
  }), O({ type: "SET_STEP", step: "checkout" });
325
- } catch (P) {
326
- const U = P instanceof Error ? P.message : "Failed to create order";
327
- /wallet|address/i.test(U) ? O({ type: "SET_WALLET_ERROR", message: U.replace(/^Failed to create checkout intent:\s*/i, "") }) : O({ type: "SET_ERROR", message: U });
325
+ } catch (T) {
326
+ const D = T instanceof Error ? T.message : "Failed to create order";
327
+ /wallet|address/i.test(D) ? O({ type: "SET_WALLET_ERROR", message: D.replace(/^Failed to create checkout intent:\s*/i, "") }) : O({ type: "SET_ERROR", message: D });
328
328
  }
329
- }, [c, ce, N]), q = X((v) => {
329
+ }, [c, ce, C]), q = _((v) => {
330
330
  O({ type: "SET_STEP", step: v });
331
- }, []), ie = X(() => {
331
+ }, []), ie = _(() => {
332
332
  const v = ["confirm", "amount", "quotes", "wallet", "checkout", "processing", "complete"], E = v.indexOf(c.step);
333
333
  E > 0 && O({ type: "SET_STEP", step: v[E - 1] });
334
- }, [c.step, N]), Oe = K(() => {
335
- const v = N ? !!c.cryptoAmount : !!c.fiatAmount;
334
+ }, [c.step, C]), Oe = K(() => {
335
+ const v = C ? !!c.cryptoAmount : !!c.fiatAmount;
336
336
  switch (c.step) {
337
337
  case "confirm":
338
- return !!(v && c.cryptoCurrency && c.network && (N || c.walletAddress) && !G);
338
+ return !!(v && c.cryptoCurrency && c.network && c.walletAddress && !$);
339
339
  case "amount":
340
- return !!(v && c.cryptoCurrency && c.network && !G);
340
+ return !!(v && c.cryptoCurrency && c.network && !$);
341
341
  case "quotes":
342
342
  return !!c.selectedQuote;
343
343
  case "wallet":
@@ -345,32 +345,32 @@ function Ht({
345
345
  default:
346
346
  return !1;
347
347
  }
348
- }, [c, G, N]), xe = {
349
- apiConfig: H,
348
+ }, [c, $, C]), xe = {
349
+ apiConfig: P,
350
350
  assetBaseUrl: n,
351
351
  config: L,
352
- configLoading: _,
353
- configError: $,
352
+ configLoading: F,
353
+ configError: X,
354
354
  state: c,
355
355
  dispatch: O,
356
356
  quotes: he,
357
357
  quotesLoading: fe,
358
- quotesError: V,
358
+ quotesError: j,
359
359
  fetchQuotes: ye,
360
360
  order: ae,
361
361
  orderLoading: Ce,
362
362
  orderError: se,
363
363
  createOrder: we,
364
- orderStatus: W,
364
+ orderStatus: V,
365
365
  orderStatusLoading: ne,
366
366
  fieldLocks: x || null,
367
367
  defaultGateway: re,
368
- amountError: G,
368
+ amountError: $,
369
369
  goToStep: q,
370
370
  goBack: ie,
371
371
  canProceed: Oe
372
372
  };
373
- return /* @__PURE__ */ e(ft.Provider, { value: xe, children: T });
373
+ return /* @__PURE__ */ e(ft.Provider, { value: xe, children: R });
374
374
  }
375
375
  function pe() {
376
376
  const t = kt(ft);
@@ -512,7 +512,7 @@ const Ie = {
512
512
  OKC: { name: "OKX Chain", icon: "eth" },
513
513
  UNI_CHAIN: { name: "UNI", icon: "uni" },
514
514
  ZEC: { name: "ZCash", icon: "zec" }
515
- }, Ut = [
515
+ }, Ht = [
516
516
  // --- Popular / Top coins ---
517
517
  { code: "BTC", name: "Bitcoin", chains: ["BTC", "LN"], popular: !0 },
518
518
  { code: "ETH", name: "Ethereum", chains: ["ETH", "ARB", "BASE", "BSC", "OPTIMISM", "LINEA", "ZKSYNC", "LRC", "STARK", "APE", "ECLIPSE", "FUEL", "INK", "SOPHON", "UNICHAIN", "WLD"], popular: !0 },
@@ -705,25 +705,46 @@ const Ie = {
705
705
  { code: "ZCHF", name: "Frankencoin", chains: ["ETH"], popular: !1 },
706
706
  { code: "ZETA", name: "Zeta", chains: ["ETH", "ZETACHAIN"], popular: !1 },
707
707
  { code: "ZTG", name: "Zeitgeist", chains: ["ZTG"], popular: !1 }
708
- ], Dt = {
709
- USD: "us",
710
- EUR: "eu",
711
- GBP: "gb",
712
- JPY: "jp",
713
- CAD: "ca",
708
+ ], Ut = {
709
+ AED: "ae",
710
+ ALL: "al",
711
+ ARS: "ar",
714
712
  AUD: "au",
715
713
  BRL: "br",
714
+ CAD: "ca",
716
715
  CHF: "ch",
717
- MXN: "mx",
716
+ CLP: "cl",
717
+ CZK: "cz",
718
+ DKK: "dk",
719
+ EUR: "eu",
720
+ GBP: "gb",
721
+ HKD: "hk",
722
+ IDR: "id",
718
723
  INR: "in",
719
- ARS: "ar",
720
- ALL: "al"
724
+ JPY: "jp",
725
+ KRW: "kr",
726
+ MXN: "mx",
727
+ NGN: "ng",
728
+ NOK: "no",
729
+ NZD: "nz",
730
+ PHP: "ph",
731
+ PLN: "pl",
732
+ QAR: "qa",
733
+ SAR: "sa",
734
+ SEK: "se",
735
+ SGD: "sg",
736
+ THB: "th",
737
+ TRY: "tr",
738
+ TWD: "tw",
739
+ USD: "us",
740
+ VND: "vn",
741
+ ZAR: "za"
721
742
  };
722
743
  function yt(t, a = "") {
723
744
  return `${a}/crypto-icons/${t.toLowerCase()}.svg`;
724
745
  }
725
- function Ft(t, a = "") {
726
- const n = Dt[t] || "us";
746
+ function Kt(t, a = "") {
747
+ const n = Ut[t] || "us";
727
748
  return `${a}/flags/${n}.svg`;
728
749
  }
729
750
  function _e(t, a = "") {
@@ -764,7 +785,7 @@ function Aa(t, a) {
764
785
  var n, s;
765
786
  return ((n = it[t]) == null ? void 0 : n[a]) ?? ((s = it.USDC) == null ? void 0 : s[a]) ?? 1;
766
787
  }
767
- function Kt(t) {
788
+ function Ft(t) {
768
789
  return parseFloat(t.replace(/,/g, "")) || 0;
769
790
  }
770
791
  function wa(t) {
@@ -775,9 +796,9 @@ function wa(t) {
775
796
  const a = t.toPrecision(4);
776
797
  return parseFloat(a).toString();
777
798
  }
778
- const Ke = (t) => /^#([0-9A-Fa-f]{3}){1,2}$/.test(t), dt = 10, ut = 1e-4, _t = (() => {
799
+ const Fe = (t) => /^#([0-9A-Fa-f]{3}){1,2}$/.test(t), dt = 10, ut = 1e-4, _t = (() => {
779
800
  const t = [];
780
- for (const a of Ut)
801
+ for (const a of Ht)
781
802
  for (const n of a.chains)
782
803
  t.push({ code: a.code, name: a.name, chain: n, popular: a.popular });
783
804
  return t;
@@ -799,7 +820,7 @@ function Xe({ currencyCode: t, size: a = 16, baseUrl: n = "" }) {
799
820
  return /* @__PURE__ */ e(
800
821
  "img",
801
822
  {
802
- src: Ft(t, n),
823
+ src: Kt(t, n),
803
824
  alt: t,
804
825
  width: a,
805
826
  height: a,
@@ -844,7 +865,7 @@ function Gt({ size: t = 32 }) {
844
865
  }
845
866
  );
846
867
  }
847
- function jt({ size: t = 32 }) {
868
+ function Yt({ size: t = 32 }) {
848
869
  return /* @__PURE__ */ l(
849
870
  "div",
850
871
  {
@@ -857,7 +878,7 @@ function jt({ size: t = 32 }) {
857
878
  }
858
879
  );
859
880
  }
860
- function Yt({ size: t = 32 }) {
881
+ function jt({ size: t = 32 }) {
861
882
  return /* @__PURE__ */ e(
862
883
  "div",
863
884
  {
@@ -928,9 +949,9 @@ function Jt(t, a = 32) {
928
949
  case "card":
929
950
  return /* @__PURE__ */ e(Vt, { size: a });
930
951
  case "googlepay":
931
- return /* @__PURE__ */ e(jt, { size: a });
932
- case "paypal":
933
952
  return /* @__PURE__ */ e(Yt, { size: a });
953
+ case "paypal":
954
+ return /* @__PURE__ */ e(jt, { size: a });
934
955
  case "bank":
935
956
  return /* @__PURE__ */ e(Xt, { size: a });
936
957
  default:
@@ -942,8 +963,8 @@ function Le({
942
963
  onClose: a,
943
964
  children: n
944
965
  }) {
945
- const [s, r] = C(!1), [u, m] = C(!1);
946
- D(() => {
966
+ const [s, r] = N(!1), [u, m] = N(!1);
967
+ H(() => {
947
968
  if (t)
948
969
  r(!0), requestAnimationFrame(() => requestAnimationFrame(() => m(!0)));
949
970
  else if (s) {
@@ -952,7 +973,7 @@ function Le({
952
973
  return () => clearTimeout(o);
953
974
  }
954
975
  }, [t]);
955
- const i = X(() => {
976
+ const i = _(() => {
956
977
  m(!1), setTimeout(() => a(), 250);
957
978
  }, [a]);
958
979
  return s ? /* @__PURE__ */ e(
@@ -1018,7 +1039,7 @@ function zt({
1018
1039
  onSelect: n,
1019
1040
  onClose: s
1020
1041
  }) {
1021
- const [r, u] = C(""), m = K(() => {
1042
+ const [r, u] = N(""), m = K(() => {
1022
1043
  const i = r.trim().toLowerCase();
1023
1044
  return i ? t.filter(
1024
1045
  (o) => o.id.toLowerCase().includes(i) || o.name.toLowerCase().includes(i) || o.description && o.description.toLowerCase().includes(i)
@@ -1085,7 +1106,7 @@ function ea({
1085
1106
  onSelect: n,
1086
1107
  fiatCurrency: s
1087
1108
  }) {
1088
- const [r, u] = C(!1), m = K(
1109
+ const [r, u] = N(!1), m = K(
1089
1110
  () => t.filter((o) => o.supportedFiats.includes(s)),
1090
1111
  [t, s]
1091
1112
  ), i = m.find((o) => o.id === a) || m[0];
@@ -1151,20 +1172,20 @@ function ta({
1151
1172
  redirectDelay: s = 3e3
1152
1173
  }) {
1153
1174
  var g;
1154
- const { order: r, orderStatus: u, goToStep: m, goBack: i } = pe(), [o, d] = C(!1), [h, f] = C(null), x = r != null && r.checkout.expiresAt ? Date.now() > r.checkout.expiresAt : !1;
1155
- if (D(() => {
1175
+ const { order: r, orderStatus: u, goToStep: m, goBack: i } = pe(), [o, d] = N(!1), [h, f] = N(null), x = r != null && r.checkout.expiresAt ? Date.now() > r.checkout.expiresAt : !1;
1176
+ if (H(() => {
1156
1177
  if ((r == null ? void 0 : r.checkout.method) === "redirect" && n && !x) {
1157
1178
  f(Math.ceil(s / 1e3));
1158
1179
  const p = setTimeout(() => {
1159
1180
  window.location.href = r.checkout.url;
1160
1181
  }, s), b = setInterval(() => {
1161
- f((T) => T && T > 1 ? T - 1 : null);
1182
+ f((R) => R && R > 1 ? R - 1 : null);
1162
1183
  }, 1e3);
1163
1184
  return () => {
1164
1185
  clearTimeout(p), clearInterval(b);
1165
1186
  };
1166
1187
  }
1167
- }, [r, n, s, x]), D(() => {
1188
+ }, [r, n, s, x]), H(() => {
1168
1189
  u && (u.status === "completed" ? m("complete") : ["failed", "cancelled", "expired"].includes(u.status) && m("error"));
1169
1190
  }, [u == null ? void 0 : u.status, m]), !r)
1170
1191
  return /* @__PURE__ */ l(
@@ -1380,7 +1401,7 @@ function aa(t, a) {
1380
1401
  }
1381
1402
  function na({ className: t = "" }) {
1382
1403
  const { orderStatus: a, orderStatusLoading: n, goToStep: s } = pe();
1383
- D(() => {
1404
+ H(() => {
1384
1405
  a && (a.status === "completed" ? s("complete") : ["failed", "cancelled", "expired", "refunded"].includes(a.status) && s("error"));
1385
1406
  }, [a == null ? void 0 : a.status, s]);
1386
1407
  const r = () => {
@@ -1697,7 +1718,7 @@ function la({ className: t = "" }) {
1697
1718
  fetchQuotes: u,
1698
1719
  createOrder: m,
1699
1720
  orderLoading: i
1700
- } = pe(), o = s.flowType === "sell", [d, h] = C(null), f = a == null ? void 0 : a.gateways.find((g) => g.id === r), x = async () => {
1721
+ } = pe(), o = s.flowType === "sell", [d, h] = N(null), f = a == null ? void 0 : a.gateways.find((g) => g.id === r), x = async () => {
1701
1722
  h(null);
1702
1723
  try {
1703
1724
  u(), await m();
@@ -1808,7 +1829,7 @@ function ia() {
1808
1829
  ] });
1809
1830
  }
1810
1831
  function da({ onClose: t, onSelect: a, currencies: n, assetBaseUrl: s = "" }) {
1811
- const [r, u] = C(""), m = K(() => {
1832
+ const [r, u] = N(""), m = K(() => {
1812
1833
  if (!n || n.length === 0) return st;
1813
1834
  const o = new Map(st.map((d) => [d.code, d.name]));
1814
1835
  return n.map((d) => ({
@@ -1854,7 +1875,7 @@ function da({ onClose: t, onSelect: a, currencies: n, assetBaseUrl: s = "" }) {
1854
1875
  ] });
1855
1876
  }
1856
1877
  function ua({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: s = "" }) {
1857
- const [r, u] = C(""), m = K(() => {
1878
+ const [r, u] = N(""), m = K(() => {
1858
1879
  if (!n || n.length === 0) return _t;
1859
1880
  const o = [];
1860
1881
  for (const d of n) {
@@ -1880,10 +1901,10 @@ function ua({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: s = "" }) {
1880
1901
  if (!o) return m;
1881
1902
  const d = o.split(/\s+/), h = [];
1882
1903
  for (const x of m) {
1883
- const g = Ie[x.chain], p = g ? g.name.toLowerCase() : "", b = ((f = g == null ? void 0 : g.shortName) == null ? void 0 : f.toLowerCase()) || "", T = x.chain.toLowerCase(), H = x.code.toLowerCase(), w = x.name.toLowerCase(), j = [H, w, p, b, T];
1884
- if (!d.every((z) => j.some((c) => c.includes(z)))) continue;
1904
+ const g = Ie[x.chain], p = g ? g.name.toLowerCase() : "", b = ((f = g == null ? void 0 : g.shortName) == null ? void 0 : f.toLowerCase()) || "", R = x.chain.toLowerCase(), P = x.code.toLowerCase(), w = x.name.toLowerCase(), G = [P, w, p, b, R];
1905
+ if (!d.every((z) => G.some((c) => c.includes(z)))) continue;
1885
1906
  let Y = 0;
1886
- H === o ? Y += 100 : H.startsWith(d[0]) && (Y += 50), x.popular && (Y += 10), d.length > 1 && (p.includes(d[1]) || b.includes(d[1]) || T.includes(d[1])) && (Y += 25), h.push({ item: x, score: Y });
1907
+ P === o ? Y += 100 : P.startsWith(d[0]) && (Y += 50), x.popular && (Y += 10), d.length > 1 && (p.includes(d[1]) || b.includes(d[1]) || R.includes(d[1])) && (Y += 25), h.push({ item: x, score: Y });
1887
1908
  }
1888
1909
  return h.sort((x, g) => g.score - x.score), h.map((x) => x.item);
1889
1910
  }, [m, r]);
@@ -2063,25 +2084,25 @@ function fa({
2063
2084
  const {
2064
2085
  state: p,
2065
2086
  dispatch: b,
2066
- config: T,
2067
- configLoading: H,
2087
+ config: R,
2088
+ configLoading: P,
2068
2089
  quotes: w,
2069
- quotesLoading: j,
2090
+ quotesLoading: G,
2070
2091
  quotesError: Q,
2071
2092
  fetchQuotes: Y,
2072
2093
  createOrder: z,
2073
2094
  orderLoading: c,
2074
2095
  amountError: O,
2075
- fieldLocks: N,
2096
+ fieldLocks: C,
2076
2097
  apiConfig: L,
2077
- assetBaseUrl: _
2078
- } = pe(), [$, G] = C(a === "dark"), [Ne, he] = C(n), [fe, V] = C(null), [ye, ae] = C(!1), [Ce, se] = C(!1), [ce, be] = C(!1), [W, ne] = C(null), [re, Ee] = C(!0), [Ae, we] = C(!1), [q, ie] = C(!1), Oe = F(null), xe = F(), v = F(p.flowType);
2079
- D(() => {
2080
- G(a === "dark");
2081
- }, [a]), D(() => {
2082
- const y = setTimeout(() => Ee(!1), H ? 0 : 800);
2098
+ assetBaseUrl: F
2099
+ } = pe(), [X, $] = N(a === "dark"), [Ne, he] = N(n), [fe, j] = N(null), [ye, ae] = N(!1), [Ce, se] = N(!1), [ce, be] = N(!1), [V, ne] = N(null), [re, Ee] = N(!0), [Ae, we] = N(!1), [q, ie] = N(!1), Oe = U(null), xe = U(), v = U(p.flowType);
2100
+ H(() => {
2101
+ $(a === "dark");
2102
+ }, [a]), H(() => {
2103
+ const y = setTimeout(() => Ee(!1), P ? 0 : 800);
2083
2104
  return () => clearTimeout(y);
2084
- }, [H]), D(() => {
2105
+ }, [P]), H(() => {
2085
2106
  if (v.current !== p.flowType && !re) {
2086
2107
  v.current = p.flowType, we(!0), ae(!1), se(!1);
2087
2108
  const y = setTimeout(() => we(!1), 350);
@@ -2089,8 +2110,8 @@ function fa({
2089
2110
  }
2090
2111
  v.current = p.flowType;
2091
2112
  }, [p.flowType, re]);
2092
- const E = p.flowType, S = E === "buy", R = p.cryptoCurrency || "BTC", k = p.fiatCurrency || "USD", P = S ? p.fiatAmount : p.cryptoAmount, U = Kt(P), de = (ze = w == null ? void 0 : w.bestQuote) != null && ze.exchangeRate ? parseFloat(w.bestQuote.exchangeRate) : null, Se = F(null);
2093
- de && R && k && (Se.current = { rate: de, crypto: R, fiat: k });
2113
+ const E = p.flowType, S = E === "buy", k = p.cryptoCurrency || "BTC", T = p.fiatCurrency || "USD", D = S ? p.fiatAmount : p.cryptoAmount, W = Ft(D), de = (ze = w == null ? void 0 : w.bestQuote) != null && ze.exchangeRate ? parseFloat(w.bestQuote.exchangeRate) : null, Se = U(null);
2114
+ de && k && T && (Se.current = { rate: de, crypto: k, fiat: T });
2094
2115
  const gt = K(() => {
2095
2116
  if (w != null && w.bestQuote) {
2096
2117
  const y = S ? w.bestQuote.cryptoAmount : w.bestQuote.fiatAmount;
@@ -2098,11 +2119,11 @@ function fa({
2098
2119
  }
2099
2120
  return "0";
2100
2121
  }, [w, S]), vt = K(() => {
2101
- var B, ee, Ue;
2102
- const y = de || ((B = Se.current) == null ? void 0 : B.rate), A = de ? R : (ee = Se.current) == null ? void 0 : ee.crypto, I = de ? k : (Ue = Se.current) == null ? void 0 : Ue.fiat;
2122
+ var B, ee, He;
2123
+ const y = de || ((B = Se.current) == null ? void 0 : B.rate), A = de ? k : (ee = Se.current) == null ? void 0 : ee.crypto, I = de ? T : (He = Se.current) == null ? void 0 : He.fiat;
2103
2124
  return !y || !A || !I ? "" : `1 ${A} ≈ ${y.toFixed(2)} ${I}`;
2104
- }, [R, k, de]);
2105
- D(() => {
2125
+ }, [k, T, de]);
2126
+ H(() => {
2106
2127
  const y = p.walletAddress.trim(), A = p.network;
2107
2128
  if (!y || y.length < 10) {
2108
2129
  ne(null), b({ type: "SET_WALLET_ERROR", message: "" });
@@ -2111,17 +2132,17 @@ function fa({
2111
2132
  return be(!0), ne(null), clearTimeout(xe.current), xe.current = setTimeout(async () => {
2112
2133
  var I, B, ee;
2113
2134
  try {
2114
- const De = await (await fetch(`${L.apiUrl}/public/validate/address`, {
2135
+ const Ue = await (await fetch(`${L.apiUrl}/public/validate/address`, {
2115
2136
  method: "POST",
2116
2137
  headers: { "Content-Type": "application/json" },
2117
2138
  body: JSON.stringify({ address: y, ...A ? { network: A } : {} })
2118
- })).json(), Fe = ((I = De.data) == null ? void 0 : I.attributes) || De.data || De;
2119
- if (Fe.isValid)
2139
+ })).json(), Ke = ((I = Ue.data) == null ? void 0 : I.attributes) || Ue.data || Ue;
2140
+ if (Ke.isValid)
2120
2141
  ne(!0), b({ type: "SET_WALLET_ERROR", message: "" });
2121
2142
  else {
2122
2143
  ne(!1);
2123
- const Tt = ((B = Fe.errors) == null ? void 0 : B[0]) || ((ee = Fe.details) == null ? void 0 : ee.formatMessage) || "Invalid wallet address";
2124
- b({ type: "SET_WALLET_ERROR", message: Tt });
2144
+ const Rt = ((B = Ke.errors) == null ? void 0 : B[0]) || ((ee = Ke.details) == null ? void 0 : ee.formatMessage) || "Invalid wallet address";
2145
+ b({ type: "SET_WALLET_ERROR", message: Rt });
2125
2146
  }
2126
2147
  } catch {
2127
2148
  ne(null);
@@ -2130,33 +2151,33 @@ function fa({
2130
2151
  }
2131
2152
  }, 500), () => clearTimeout(xe.current);
2132
2153
  }, [p.walletAddress, p.network, L.apiUrl]);
2133
- const Ge = !P || U === 0, je = U > 0 && (S ? U < dt : U < ut), Ye = !!O || je || ye && Ge, Nt = U > 0 && !O && !je, Pe = p.walletAddress.trim().length >= 10 && W !== !1 && !ce, Te = Nt && (S ? Pe : !0) && !!p.cryptoCurrency && !!p.network, Ct = (y) => {
2154
+ const Ge = !D || W === 0, Ye = W > 0 && (S ? W < dt : W < ut), je = !!O || Ye || ye && Ge, Nt = W > 0 && !O && !Ye, Pe = p.walletAddress.trim().length >= 10 && V !== !1 && !ce, Re = Nt && Pe && !!p.cryptoCurrency && !!p.network, Ct = (y) => {
2134
2155
  let A = y.target.value.replace(/[^0-9.,]/g, "");
2135
2156
  const I = S ? 2 : 6, B = A.indexOf(".");
2136
2157
  B !== -1 && A.length - B - 1 > I && (A = A.slice(0, B + I + 1)), b(S ? { type: "SET_FIAT_AMOUNT", amount: A } : { type: "SET_CRYPTO_AMOUNT", amount: A });
2137
2158
  }, Ve = (y) => {
2138
2159
  y !== E && b({ type: "SET_FLOW_TYPE", flowType: y });
2139
- }, bt = X(
2160
+ }, bt = _(
2140
2161
  (y) => {
2141
2162
  b({ type: "SET_FIAT_CURRENCY", currency: y });
2142
2163
  },
2143
2164
  [b]
2144
- ), Et = X(
2165
+ ), Et = _(
2145
2166
  (y, A) => {
2146
2167
  b({ type: "SET_CRYPTO_CURRENCY", currency: y }), b({ type: "SET_CRYPTO_CHAIN", chain: A });
2147
2168
  },
2148
2169
  [b]
2149
- ), At = X(
2170
+ ), At = _(
2150
2171
  (y) => {
2151
2172
  b({ type: "SET_PAYMENT_METHOD", methodId: y });
2152
2173
  },
2153
2174
  [b]
2154
2175
  ), wt = () => {
2155
- Te && (ie(!0), Y());
2176
+ Re && (ie(!0), Y());
2156
2177
  };
2157
- D(() => {
2178
+ H(() => {
2158
2179
  var y;
2159
- if (!(!q || j)) {
2180
+ if (!(!q || G)) {
2160
2181
  if (w != null && w.bestQuote)
2161
2182
  ie(!1), b({ type: "SELECT_QUOTE", quote: w.bestQuote }), z().catch(() => {
2162
2183
  });
@@ -2168,19 +2189,19 @@ function fa({
2168
2189
  b({ type: "SET_ERROR", message: I });
2169
2190
  }
2170
2191
  }
2171
- }, [q, w, j, Q, b, z]);
2172
- const We = $ ? "theme-dark" : "theme-light", He = ct.find((y) => y.id === Ne) || ct[0], St = He.accent === null, Qe = (s ? Ke(s) : !1) ? { "--t-accent": s, "--t-cta-bg": s, "--t-cta-text": "#ffffff" } : St ? {
2173
- "--t-accent": $ ? "#ffffff" : "#111111",
2174
- "--t-cta-bg": $ ? "#ffffff" : "#111111",
2175
- "--t-cta-text": $ ? "#000000" : "#ffffff"
2192
+ }, [q, w, G, Q, b, z]);
2193
+ const We = X ? "theme-dark" : "theme-light", De = ct.find((y) => y.id === Ne) || ct[0], St = De.accent === null, Qe = (s ? Fe(s) : !1) ? { "--t-accent": s, "--t-cta-bg": s, "--t-cta-text": "#ffffff" } : St ? {
2194
+ "--t-accent": X ? "#ffffff" : "#111111",
2195
+ "--t-cta-bg": X ? "#ffffff" : "#111111",
2196
+ "--t-cta-text": X ? "#000000" : "#ffffff"
2176
2197
  } : {
2177
- "--t-accent": He.accent,
2178
- "--t-cta-bg": He.accent,
2198
+ "--t-accent": De.accent,
2199
+ "--t-cta-bg": De.accent,
2179
2200
  "--t-cta-text": "#ffffff"
2180
2201
  }, oe = {};
2181
- r && Ke(r) ? oe.backgroundColor = r : oe.backgroundColor = "var(--t-bg)", u && (oe.backgroundImage = `url(${u})`, oe.backgroundSize = "cover", oe.backgroundPosition = "center");
2182
- const Re = {};
2183
- m && Ke(m) && (Re.border = `1px solid ${m}`), i && (Re.borderRadius = i);
2202
+ r && Fe(r) ? oe.backgroundColor = r : oe.backgroundColor = "var(--t-bg)", u && (oe.backgroundImage = `url(${u})`, oe.backgroundSize = "cover", oe.backgroundPosition = "center");
2203
+ const Te = {};
2204
+ m && Fe(m) && (Te.border = `1px solid ${m}`), i && (Te.borderRadius = i);
2184
2205
  const Ze = p.step === "checkout" ? /* @__PURE__ */ e(ta, { autoRedirect: d }) : p.step === "processing" ? /* @__PURE__ */ e(na, {}) : p.step === "complete" ? /* @__PURE__ */ e(ra, { explorerUrl: h, doneButtonText: f, onDone: g }) : p.step === "error" ? /* @__PURE__ */ e(oa, { supportEmail: x }) : p.step === "confirm" ? /* @__PURE__ */ e(la, {}) : null;
2185
2206
  if (Ze)
2186
2207
  return /* @__PURE__ */ e(
@@ -2191,7 +2212,7 @@ function fa({
2191
2212
  fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
2192
2213
  ...oe,
2193
2214
  ...Qe,
2194
- ...Re
2215
+ ...Te
2195
2216
  },
2196
2217
  children: Ze
2197
2218
  }
@@ -2205,10 +2226,10 @@ function fa({
2205
2226
  fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
2206
2227
  ...oe,
2207
2228
  ...Qe,
2208
- ...Re
2229
+ ...Te
2209
2230
  },
2210
2231
  children: [
2211
- /* @__PURE__ */ e("div", { className: `flex justify-end items-center px-5 pt-3 ${o ? "pb-1" : "pb-5"}`, children: /* @__PURE__ */ e(Qt, { onClick: () => V("settings") }) }),
2232
+ /* @__PURE__ */ e("div", { className: `flex justify-end items-center px-5 pt-3 ${o ? "pb-1" : "pb-5"}`, children: /* @__PURE__ */ e(Qt, { onClick: () => j("settings") }) }),
2212
2233
  o ? /* @__PURE__ */ l("div", { className: "flex flex-col items-center pt-3 pb-5", children: [
2213
2234
  /* @__PURE__ */ l("div", { className: "flex", style: { width: 165 }, children: [
2214
2235
  /* @__PURE__ */ e(
@@ -2245,7 +2266,7 @@ function fa({
2245
2266
  )
2246
2267
  ] })
2247
2268
  ] }) : null,
2248
- re || Ae || H ? /* @__PURE__ */ e(ia, {}) : /* @__PURE__ */ l("div", { className: "flex-1 overflow-hidden px-5 flex flex-col tab-fade-in", children: [
2269
+ re || Ae || P ? /* @__PURE__ */ e(ia, {}) : /* @__PURE__ */ l("div", { className: "flex-1 overflow-hidden px-5 flex flex-col tab-fade-in", children: [
2249
2270
  /* @__PURE__ */ l(
2250
2271
  "div",
2251
2272
  {
@@ -2253,7 +2274,7 @@ function fa({
2253
2274
  style: {
2254
2275
  background: "var(--t-surface)",
2255
2276
  borderRadius: 5,
2256
- border: ye && Ye ? "1px solid #EF4444" : "1px solid transparent"
2277
+ border: ye && je ? "1px solid #EF4444" : "1px solid transparent"
2257
2278
  },
2258
2279
  children: [
2259
2280
  /* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: "You spend" }),
@@ -2263,20 +2284,20 @@ function fa({
2263
2284
  {
2264
2285
  ref: Oe,
2265
2286
  type: "text",
2266
- value: P,
2287
+ value: D,
2267
2288
  onChange: Ct,
2268
2289
  onBlur: () => ae(!0),
2269
2290
  placeholder: S ? "250" : "0.01",
2270
2291
  className: "bg-transparent outline-none w-0 flex-1 mr-3",
2271
2292
  style: { color: "var(--t-text)", fontSize: 24, fontWeight: 600, lineHeight: "32px" },
2272
2293
  inputMode: "decimal",
2273
- disabled: !!((qe = N == null ? void 0 : N.sourceAmount) != null && qe.locked)
2294
+ disabled: !!((qe = C == null ? void 0 : C.sourceAmount) != null && qe.locked)
2274
2295
  }
2275
2296
  ),
2276
2297
  S ? /* @__PURE__ */ l(
2277
2298
  "button",
2278
2299
  {
2279
- onClick: () => V("fiat"),
2300
+ onClick: () => j("fiat"),
2280
2301
  className: "flex items-center gap-1.5 shrink-0 transition-colors",
2281
2302
  style: {
2282
2303
  background: "var(--t-pill-bg)",
@@ -2285,10 +2306,10 @@ function fa({
2285
2306
  paddingLeft: 10,
2286
2307
  paddingRight: 10
2287
2308
  },
2288
- disabled: !!((et = N == null ? void 0 : N.sourceCurrency) != null && et.locked),
2309
+ disabled: !!((et = C == null ? void 0 : C.sourceCurrency) != null && et.locked),
2289
2310
  children: [
2290
- /* @__PURE__ */ e(Xe, { currencyCode: k, size: 16, baseUrl: _ }),
2291
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: k }),
2311
+ /* @__PURE__ */ e(Xe, { currencyCode: T, size: 16, baseUrl: F }),
2312
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: T }),
2292
2313
  /* @__PURE__ */ e(ge, {})
2293
2314
  ]
2294
2315
  }
@@ -2296,7 +2317,7 @@ function fa({
2296
2317
  /* @__PURE__ */ l(
2297
2318
  "button",
2298
2319
  {
2299
- onClick: () => V("crypto"),
2320
+ onClick: () => j("crypto"),
2300
2321
  className: "flex items-center gap-1.5 transition-colors",
2301
2322
  style: {
2302
2323
  background: "var(--t-pill-bg)",
@@ -2305,10 +2326,10 @@ function fa({
2305
2326
  paddingLeft: 10,
2306
2327
  paddingRight: 10
2307
2328
  },
2308
- disabled: !!((tt = N == null ? void 0 : N.destinationCurrency) != null && tt.locked),
2329
+ disabled: !!((tt = C == null ? void 0 : C.destinationCurrency) != null && tt.locked),
2309
2330
  children: [
2310
- /* @__PURE__ */ e(mt, { ticker: R, size: 16, baseUrl: _ }),
2311
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: R }),
2331
+ /* @__PURE__ */ e(mt, { ticker: k, size: 16, baseUrl: F }),
2332
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: k }),
2312
2333
  /* @__PURE__ */ e(ge, {})
2313
2334
  ]
2314
2335
  }
@@ -2317,7 +2338,7 @@ function fa({
2317
2338
  /* @__PURE__ */ e(
2318
2339
  "img",
2319
2340
  {
2320
- src: _e(Z, _),
2341
+ src: _e(Z, F),
2321
2342
  alt: Z,
2322
2343
  width: 14,
2323
2344
  height: 14,
@@ -2332,7 +2353,7 @@ function fa({
2332
2353
  ]
2333
2354
  }
2334
2355
  ),
2335
- ye && Ye && /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5 px-[2px]", style: { color: "#EF4444" }, children: O || (Ge ? "Amount should be more than 0" : S ? `Minimum amount is ${dt} ${k}` : `Minimum amount is ${ut} ${R}`) }),
2356
+ ye && je && /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5 px-[2px]", style: { color: "#EF4444" }, children: O || (Ge ? "Amount should be more than 0" : S ? `Minimum amount is ${dt} ${T}` : `Minimum amount is ${ut} ${k}`) }),
2336
2357
  /* @__PURE__ */ l(
2337
2358
  "div",
2338
2359
  {
@@ -2348,20 +2369,20 @@ function fa({
2348
2369
  children: [
2349
2370
  /* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: "You get" }),
2350
2371
  /* @__PURE__ */ l("div", { className: "flex items-start justify-between", children: [
2351
- j ? /* @__PURE__ */ e(M, { w: 180, h: 32 }) : /* @__PURE__ */ e(
2372
+ G ? /* @__PURE__ */ e(M, { w: 180, h: 32 }) : /* @__PURE__ */ e(
2352
2373
  ca,
2353
2374
  {
2354
- value: U > 0 ? gt : "0",
2375
+ value: W > 0 ? gt : "0",
2355
2376
  height: 32,
2356
2377
  className: "font-semibold",
2357
- style: { color: U > 0 ? "var(--t-text)" : "var(--t-text-muted)", fontSize: 24 }
2378
+ style: { color: W > 0 ? "var(--t-text)" : "var(--t-text-muted)", fontSize: 24 }
2358
2379
  }
2359
2380
  ),
2360
2381
  S ? /* @__PURE__ */ l("div", { className: "flex flex-col items-end shrink-0", children: [
2361
2382
  /* @__PURE__ */ l(
2362
2383
  "button",
2363
2384
  {
2364
- onClick: () => V("crypto"),
2385
+ onClick: () => j("crypto"),
2365
2386
  className: "flex items-center gap-1.5 transition-colors",
2366
2387
  style: {
2367
2388
  background: "var(--t-pill-bg)",
@@ -2370,10 +2391,10 @@ function fa({
2370
2391
  paddingLeft: 10,
2371
2392
  paddingRight: 10
2372
2393
  },
2373
- disabled: !!((at = N == null ? void 0 : N.destinationCurrency) != null && at.locked),
2394
+ disabled: !!((at = C == null ? void 0 : C.destinationCurrency) != null && at.locked),
2374
2395
  children: [
2375
- /* @__PURE__ */ e(mt, { ticker: R, size: 16, baseUrl: _ }),
2376
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: R }),
2396
+ /* @__PURE__ */ e(mt, { ticker: k, size: 16, baseUrl: F }),
2397
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: k }),
2377
2398
  /* @__PURE__ */ e(ge, {})
2378
2399
  ]
2379
2400
  }
@@ -2382,7 +2403,7 @@ function fa({
2382
2403
  /* @__PURE__ */ e(
2383
2404
  "img",
2384
2405
  {
2385
- src: _e(Z, _),
2406
+ src: _e(Z, F),
2386
2407
  alt: Z,
2387
2408
  width: 14,
2388
2409
  height: 14,
@@ -2395,7 +2416,7 @@ function fa({
2395
2416
  ] }) : /* @__PURE__ */ l(
2396
2417
  "button",
2397
2418
  {
2398
- onClick: () => V("fiat"),
2419
+ onClick: () => j("fiat"),
2399
2420
  className: "flex items-center gap-1.5 shrink-0 transition-colors",
2400
2421
  style: {
2401
2422
  background: "var(--t-pill-bg)",
@@ -2404,10 +2425,10 @@ function fa({
2404
2425
  paddingLeft: 10,
2405
2426
  paddingRight: 10
2406
2427
  },
2407
- disabled: !!((nt = N == null ? void 0 : N.sourceCurrency) != null && nt.locked),
2428
+ disabled: !!((nt = C == null ? void 0 : C.sourceCurrency) != null && nt.locked),
2408
2429
  children: [
2409
- /* @__PURE__ */ e(Xe, { currencyCode: k, size: 16, baseUrl: _ }),
2410
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: k }),
2430
+ /* @__PURE__ */ e(Xe, { currencyCode: T, size: 16, baseUrl: F }),
2431
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: T }),
2411
2432
  /* @__PURE__ */ e(ge, {})
2412
2433
  ]
2413
2434
  }
@@ -2422,22 +2443,22 @@ function fa({
2422
2443
  className: "flex items-center justify-between mt-[2px] px-[18px] pt-[12px] pb-[14px]",
2423
2444
  style: {
2424
2445
  background: "var(--t-surface)",
2425
- ...(rt = T == null ? void 0 : T.paymentMethods) != null && rt.length ? {} : { borderBottomLeftRadius: 5, borderBottomRightRadius: 5 }
2446
+ ...(rt = R == null ? void 0 : R.paymentMethods) != null && rt.length ? {} : { borderBottomLeftRadius: 5, borderBottomRightRadius: 5 }
2426
2447
  },
2427
2448
  children: /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: vt || " " })
2428
2449
  }
2429
2450
  ),
2430
- (T == null ? void 0 : T.paymentMethods) && T.paymentMethods.length > 0 && /* @__PURE__ */ e("div", { className: "mt-[2px]", children: /* @__PURE__ */ e(
2451
+ (R == null ? void 0 : R.paymentMethods) && R.paymentMethods.length > 0 && /* @__PURE__ */ e("div", { className: "mt-[2px]", children: /* @__PURE__ */ e(
2431
2452
  ea,
2432
2453
  {
2433
- methods: T.paymentMethods,
2454
+ methods: R.paymentMethods,
2434
2455
  selectedId: p.paymentMethodId,
2435
2456
  onSelect: At,
2436
2457
  fiatCurrency: p.fiatCurrency
2437
2458
  }
2438
2459
  ) }),
2439
- S && /* @__PURE__ */ l("div", { className: "mt-8", children: [
2440
- /* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: "Wallet address" }),
2460
+ /* @__PURE__ */ l("div", { className: "mt-8", children: [
2461
+ /* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: S ? "Receiving wallet address" : "Sending wallet address" }),
2441
2462
  /* @__PURE__ */ e(
2442
2463
  "input",
2443
2464
  {
@@ -2445,7 +2466,7 @@ function fa({
2445
2466
  value: p.walletAddress,
2446
2467
  onChange: (y) => b({ type: "SET_WALLET_ADDRESS", address: y.target.value }),
2447
2468
  onBlur: () => se(!0),
2448
- placeholder: "Enter your wallet address",
2469
+ placeholder: S ? "Enter your receiving address" : "Enter your sending address",
2449
2470
  spellCheck: !1,
2450
2471
  autoComplete: "off",
2451
2472
  className: "w-full bg-transparent text-[13px] outline-none transition-colors",
@@ -2457,7 +2478,7 @@ function fa({
2457
2478
  paddingRight: 14,
2458
2479
  color: "var(--t-text)"
2459
2480
  },
2460
- disabled: !!((ot = N == null ? void 0 : N.destinationAddress) != null && ot.locked)
2481
+ disabled: !!((ot = C == null ? void 0 : C.destinationAddress) != null && ot.locked)
2461
2482
  }
2462
2483
  ),
2463
2484
  p.walletError ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: p.walletError }) : Ce && !Pe && !ce ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: "Enter a valid wallet address" }) : ce && p.walletAddress.trim().length >= 10 ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "var(--t-text-muted)" }, children: "Validating address..." }) : null
@@ -2466,7 +2487,7 @@ function fa({
2466
2487
  /* @__PURE__ */ e(
2467
2488
  "button",
2468
2489
  {
2469
- disabled: !Te || c || q,
2490
+ disabled: !Re || c || q,
2470
2491
  onClick: wt,
2471
2492
  className: "w-full font-semibold text-[16px] transition-all",
2472
2493
  style: {
@@ -2474,15 +2495,15 @@ function fa({
2474
2495
  borderRadius: 5,
2475
2496
  background: "var(--t-cta-bg)",
2476
2497
  color: "var(--t-cta-text)",
2477
- opacity: Te && !c && !q ? 1 : 0.4,
2478
- cursor: Te && !c && !q ? "pointer" : "not-allowed"
2498
+ opacity: Re && !c && !q ? 1 : 0.4,
2499
+ cursor: Re && !c && !q ? "pointer" : "not-allowed"
2479
2500
  },
2480
- children: q ? "Getting best price..." : c ? "Processing..." : S ? `Buy ${R}` : `Sell ${R}`
2501
+ children: q ? "Getting best price..." : c ? "Processing..." : S ? `Buy ${k}` : `Sell ${k}`
2481
2502
  }
2482
2503
  ),
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
  ] }, E),
2485
- /* @__PURE__ */ e(Le, { isOpen: fe === "fiat", onClose: () => V(null), children: (y) => {
2506
+ /* @__PURE__ */ e(Le, { isOpen: fe === "fiat", onClose: () => j(null), children: (y) => {
2486
2507
  var A;
2487
2508
  return /* @__PURE__ */ e(
2488
2509
  da,
@@ -2491,12 +2512,12 @@ function fa({
2491
2512
  onSelect: (I) => {
2492
2513
  bt(I), y();
2493
2514
  },
2494
- currencies: (A = T == null ? void 0 : T.fiats) == null ? void 0 : A.map((I) => ({ code: I.code, name: I.code })),
2495
- assetBaseUrl: _
2515
+ currencies: (A = R == null ? void 0 : R.fiats) == null ? void 0 : A.map((I) => ({ code: I.code, name: I.code })),
2516
+ assetBaseUrl: F
2496
2517
  }
2497
2518
  );
2498
2519
  } }),
2499
- /* @__PURE__ */ e(Le, { isOpen: fe === "crypto", onClose: () => V(null), children: (y) => {
2520
+ /* @__PURE__ */ e(Le, { isOpen: fe === "crypto", onClose: () => j(null), children: (y) => {
2500
2521
  var A;
2501
2522
  return /* @__PURE__ */ e(
2502
2523
  ua,
@@ -2505,7 +2526,7 @@ function fa({
2505
2526
  onSelect: (I, B) => {
2506
2527
  Et(I, B), y();
2507
2528
  },
2508
- cryptos: (A = T == null ? void 0 : T.cryptos) == null ? void 0 : A.map((I) => {
2529
+ cryptos: (A = R == null ? void 0 : R.cryptos) == null ? void 0 : A.map((I) => {
2509
2530
  var B;
2510
2531
  return {
2511
2532
  code: I.code,
@@ -2513,16 +2534,16 @@ function fa({
2513
2534
  networks: (B = I.networks) == null ? void 0 : B.map((ee) => ({ code: ee.id, name: ee.name }))
2514
2535
  };
2515
2536
  }),
2516
- assetBaseUrl: _
2537
+ assetBaseUrl: F
2517
2538
  }
2518
2539
  );
2519
2540
  } }),
2520
- /* @__PURE__ */ e(Le, { isOpen: fe === "settings", onClose: () => V(null), children: (y) => /* @__PURE__ */ e(
2541
+ /* @__PURE__ */ e(Le, { isOpen: fe === "settings", onClose: () => j(null), children: (y) => /* @__PURE__ */ e(
2521
2542
  ha,
2522
2543
  {
2523
2544
  onClose: y,
2524
- darkMode: $,
2525
- onToggleDarkMode: G,
2545
+ darkMode: X,
2546
+ onToggleDarkMode: $,
2526
2547
  skinId: Ne,
2527
2548
  onSelectSkin: (A) => {
2528
2549
  he(A);
@@ -2550,23 +2571,23 @@ function ya({
2550
2571
  statusPollInterval: g,
2551
2572
  onComplete: p,
2552
2573
  onError: b,
2553
- className: T,
2554
- theme: H,
2574
+ className: R,
2575
+ theme: P,
2555
2576
  skinId: w,
2556
- accentColor: j,
2577
+ accentColor: G,
2557
2578
  bgColor: Q,
2558
2579
  bgImage: Y,
2559
2580
  borderColor: z,
2560
2581
  borderRadius: c,
2561
2582
  showFlowToggle: O,
2562
- autoRedirect: N,
2583
+ autoRedirect: C,
2563
2584
  explorerUrl: L,
2564
- doneButtonText: _,
2565
- supportEmail: $,
2566
- onDone: G
2585
+ doneButtonText: F,
2586
+ supportEmail: X,
2587
+ onDone: $
2567
2588
  }) {
2568
2589
  return /* @__PURE__ */ e(
2569
- Ht,
2590
+ Dt,
2570
2591
  {
2571
2592
  projectId: t,
2572
2593
  apiUrl: a,
@@ -2587,33 +2608,33 @@ function ya({
2587
2608
  children: /* @__PURE__ */ e(
2588
2609
  fa,
2589
2610
  {
2590
- className: T,
2591
- theme: H,
2611
+ className: R,
2612
+ theme: P,
2592
2613
  skinId: w,
2593
- accentColor: j,
2614
+ accentColor: G,
2594
2615
  bgColor: Q,
2595
2616
  bgImage: Y,
2596
2617
  borderColor: z,
2597
2618
  borderRadius: c,
2598
2619
  showFlowToggle: O,
2599
- autoRedirect: N,
2620
+ autoRedirect: C,
2600
2621
  explorerUrl: L,
2601
- doneButtonText: _,
2602
- supportEmail: $,
2603
- onDone: G
2622
+ doneButtonText: F,
2623
+ supportEmail: X,
2624
+ onDone: $
2604
2625
  }
2605
2626
  )
2606
2627
  }
2607
2628
  );
2608
2629
  }
2609
- function Ta({
2630
+ function Ra({
2610
2631
  submitButtonText: t,
2611
2632
  rateRefreshInterval: a,
2612
2633
  ...n
2613
2634
  }) {
2614
2635
  return /* @__PURE__ */ e(ya, { ...n });
2615
2636
  }
2616
- function Ra({
2637
+ function Ta({
2617
2638
  skin: t,
2618
2639
  active: a,
2619
2640
  onClick: n,
@@ -2699,7 +2720,7 @@ function ka({
2699
2720
  quotesLoading: s,
2700
2721
  cryptoCurrency: r
2701
2722
  }) {
2702
- const [u, m] = C(""), i = K(() => {
2723
+ const [u, m] = N(""), i = K(() => {
2703
2724
  if (!(n != null && n.quotes)) return [];
2704
2725
  const o = u.trim().toLowerCase();
2705
2726
  return o ? n.quotes.filter((d) => d.gatewayName.toLowerCase().includes(o)) : n.quotes;
@@ -2772,9 +2793,9 @@ export {
2772
2793
  Ie as BLOCKCHAINS,
2773
2794
  Xt as BankIcon,
2774
2795
  _t as CRYPTO_CHAIN_COMBOS,
2775
- Ut as CRYPTO_CURRENCIES,
2796
+ Ht as CRYPTO_CURRENCIES,
2776
2797
  Vt as CardIcon,
2777
- Ta as CheckoutForm,
2798
+ Ra as CheckoutForm,
2778
2799
  ta as CheckoutStep,
2779
2800
  ge as ChevronDown,
2780
2801
  Wt as ChevronRight,
@@ -2788,34 +2809,34 @@ export {
2788
2809
  Zt as DarkModeIcon,
2789
2810
  oa as ErrorStep,
2790
2811
  st as FIAT_CURRENCIES,
2791
- Dt as FIAT_TO_COUNTRY,
2812
+ Ut as FIAT_TO_COUNTRY,
2792
2813
  da as FiatCurrencyModal,
2793
2814
  Xe as FiatFlag,
2794
2815
  ia as FormSkeleton,
2795
2816
  $e as GenericCoinIcon,
2796
- jt as GooglePayIcon,
2817
+ Yt as GooglePayIcon,
2797
2818
  it as MOCK_RATES,
2798
2819
  Qt as MenuIcon,
2799
2820
  Le as Modal,
2800
- Yt as PayPalIcon,
2821
+ jt as PayPalIcon,
2801
2822
  ea as PaymentMethodSelector,
2802
2823
  na as ProcessingStep,
2803
2824
  ya as RampForm,
2804
- Ht as RampProvider,
2825
+ Dt as RampProvider,
2805
2826
  $t as RevolutIcon,
2806
2827
  ct as SKINS,
2807
2828
  Be as SearchInput,
2808
2829
  ha as SettingsScreen,
2809
2830
  M as Skeleton,
2810
- Ra as SkinSwatch,
2831
+ Ta as SkinSwatch,
2811
2832
  ma as ToggleSwitch,
2812
2833
  wa as formatOutput,
2813
2834
  _e as getChainIconUrl,
2814
2835
  yt as getCryptoIconUrl,
2815
- Ft as getFiatFlagUrl,
2836
+ Kt as getFiatFlagUrl,
2816
2837
  Aa as getMockRate,
2817
2838
  Jt as getPaymentIcon,
2818
- Kt as parseAmount,
2839
+ Ft as parseAmount,
2819
2840
  Bt as useCheckoutIntent,
2820
2841
  Mt as useQuotes,
2821
2842
  pe as useRamp,