@nowramp/form 0.1.41 → 0.1.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1114 -980
- package/dist/index.js.map +1 -1
- package/dist/nowramp-form.iife.js +12 -12
- package/dist/nowramp-form.iife.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -4,127 +4,128 @@
|
|
|
4
4
|
if(document.getElementById(id))return;
|
|
5
5
|
var s=document.createElement('style');
|
|
6
6
|
s.id=id;
|
|
7
|
-
s.textContent=`@layer nowramp-form{.theme-dark{--t-bg: #000000;--t-surface: rgba(255,255,255,.1);--t-surface-hover: rgba(255,255,255,.14);--t-text: #ffffff;--t-text-secondary: rgba(255,255,255,.4);--t-text-tertiary: rgba(255,255,255,.3);--t-text-muted: rgba(255,255,255,.5);--t-border: rgba(255,255,255,.2);--t-border-focus: rgba(255,255,255,.5);--t-pill-bg: rgba(255,255,255,.1);--t-pill-hover: rgba(255,255,255,.15);--t-badge-bg: rgba(255,255,255,.15);--t-divider: rgba(255,255,255,.2);--t-close-bg: rgba(255,255,255,.1);--t-close-hover: rgba(255,255,255,.2);--t-icon-stroke: rgba(255,255,255,.4);--t-icon-close: rgba(255,255,255,.6);--t-accent: #0077FF;--t-cta-bg: var(--t-accent);--t-cta-text: #ffffff;--t-cta-hover: rgba(255,255,255,.9);--t-cta-active: rgba(255,255,255,.8);--t-modal-bg: #000000;--t-chain-border: #000000;--t-skeleton-from: rgba(255,255,255,.06);--t-skeleton-mid: rgba(255,255,255,.12);--t-scrollbar: rgba(255,255,255,.15);--t-card-icon-bg: rgba(255,255,255,.1);--t-card-icon-stroke: rgba(255,255,255,.6);--t-success: #10b981;--t-error: #EF4444}.theme-light{--t-bg: #F2F3F5;--t-surface: rgba(0,0,0,.05);--t-surface-hover: rgba(0,0,0,.08);--t-text: #111111;--t-text-secondary: rgba(0,0,0,.45);--t-text-tertiary: rgba(0,0,0,.3);--t-text-muted: rgba(0,0,0,.5);--t-border: rgba(0,0,0,.12);--t-border-focus: rgba(0,0,0,.3);--t-pill-bg: rgba(0,0,0,.06);--t-pill-hover: rgba(0,0,0,.1);--t-badge-bg: rgba(0,0,0,.08);--t-divider: rgba(0,0,0,.1);--t-close-bg: rgba(0,0,0,.06);--t-close-hover: rgba(0,0,0,.12);--t-icon-stroke: rgba(0,0,0,.35);--t-icon-close: rgba(0,0,0,.5);--t-accent: #0077FF;--t-cta-bg: var(--t-accent);--t-cta-text: #ffffff;--t-cta-hover: #222222;--t-cta-active: #333333;--t-modal-bg: #F2F3F5;--t-chain-border: #F2F3F5;--t-skeleton-from: rgba(0,0,0,.04);--t-skeleton-mid: rgba(0,0,0,.08);--t-scrollbar: rgba(0,0,0,.12);--t-card-icon-bg: rgba(0,0,0,.06);--t-card-icon-stroke: rgba(0,0,0,.5);--t-success: #10b981;--t-error: #EF4444}.custom-scroll::-webkit-scrollbar{width:4px}.custom-scroll::-webkit-scrollbar-track{background:transparent}.custom-scroll::-webkit-scrollbar-thumb{background:var(--t-scrollbar);border-radius:2px}@keyframes shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.skeleton{background:linear-gradient(90deg,var(--t-skeleton-from) 25%,var(--t-skeleton-mid) 50%,var(--t-skeleton-from) 75%);background-size:200% 100%;animation:shimmer 1.5s ease-in-out infinite;border-radius:4px}@keyframes fadeIn{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.tab-fade-in{animation:fadeIn .3s ease-out both}.digit-slot{display:inline-block;overflow:hidden;vertical-align:top}.digit-slot-inner{transition:transform .35s cubic-bezier(.33,1,.68,1)}@keyframes nramp-spin{to{transform:rotate(360deg)}}.nramp-spinner{width:40px;height:40px;border:3px solid var(--t-border);border-top-color:var(--t-accent);border-radius:50%;animation:nramp-spin .8s linear infinite;margin:0 auto}.nramp-spinner-large{width:60px;height:60px;border-width:4px}.nramp-spinner-inline{width:16px;height:16px;border-width:2px;display:inline-block}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.visible{visibility:visible}.static{position:static}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.left-0{left:0}.right-3{right:.75rem}.top-0{top:0}.top-1\\/2{top:50%}.top-\\[3px\\]{top:3px}.z-20{z-index:20}.mx-5{margin-left:1.25rem;margin-right:1.25rem}.mb-1\\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-2\\.5{margin-bottom:.625rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mr-0\\.5{margin-right:.125rem}.mr-3{margin-right:.75rem}.mt-0\\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-\\[2px\\]{margin-top:2px}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.h-\\[640px\\]{height:640px}.h-full{height:100%}.min-h-\\[640px\\]{min-height:640px}.w-0{width:0px}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-\\[390px\\]{max-width:390px}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-3\\.5{gap:.875rem}.
|
|
7
|
+
s.textContent=`@layer nowramp-form{.theme-dark{--t-bg: #000000;--t-surface: rgba(255,255,255,.1);--t-surface-hover: rgba(255,255,255,.14);--t-text: #ffffff;--t-text-secondary: rgba(255,255,255,.4);--t-text-tertiary: rgba(255,255,255,.3);--t-text-muted: rgba(255,255,255,.5);--t-border: rgba(255,255,255,.2);--t-border-focus: rgba(255,255,255,.5);--t-pill-bg: rgba(255,255,255,.1);--t-pill-hover: rgba(255,255,255,.15);--t-badge-bg: rgba(255,255,255,.15);--t-divider: rgba(255,255,255,.2);--t-close-bg: rgba(255,255,255,.1);--t-close-hover: rgba(255,255,255,.2);--t-icon-stroke: rgba(255,255,255,.4);--t-icon-close: rgba(255,255,255,.6);--t-accent: #0077FF;--t-cta-bg: var(--t-accent);--t-cta-text: #ffffff;--t-cta-hover: rgba(255,255,255,.9);--t-cta-active: rgba(255,255,255,.8);--t-modal-bg: #000000;--t-chain-border: #000000;--t-skeleton-from: rgba(255,255,255,.06);--t-skeleton-mid: rgba(255,255,255,.12);--t-scrollbar: rgba(255,255,255,.15);--t-card-icon-bg: rgba(255,255,255,.1);--t-card-icon-stroke: rgba(255,255,255,.6);--t-success: #10b981;--t-error: #EF4444}.theme-light{--t-bg: #F2F3F5;--t-surface: rgba(0,0,0,.05);--t-surface-hover: rgba(0,0,0,.08);--t-text: #111111;--t-text-secondary: rgba(0,0,0,.45);--t-text-tertiary: rgba(0,0,0,.3);--t-text-muted: rgba(0,0,0,.5);--t-border: rgba(0,0,0,.12);--t-border-focus: rgba(0,0,0,.3);--t-pill-bg: rgba(0,0,0,.06);--t-pill-hover: rgba(0,0,0,.1);--t-badge-bg: rgba(0,0,0,.08);--t-divider: rgba(0,0,0,.1);--t-close-bg: rgba(0,0,0,.06);--t-close-hover: rgba(0,0,0,.12);--t-icon-stroke: rgba(0,0,0,.35);--t-icon-close: rgba(0,0,0,.5);--t-accent: #0077FF;--t-cta-bg: var(--t-accent);--t-cta-text: #ffffff;--t-cta-hover: #222222;--t-cta-active: #333333;--t-modal-bg: #F2F3F5;--t-chain-border: #F2F3F5;--t-skeleton-from: rgba(0,0,0,.04);--t-skeleton-mid: rgba(0,0,0,.08);--t-scrollbar: rgba(0,0,0,.12);--t-card-icon-bg: rgba(0,0,0,.06);--t-card-icon-stroke: rgba(0,0,0,.5);--t-success: #10b981;--t-error: #EF4444}.custom-scroll::-webkit-scrollbar{width:4px}.custom-scroll::-webkit-scrollbar-track{background:transparent}.custom-scroll::-webkit-scrollbar-thumb{background:var(--t-scrollbar);border-radius:2px}@keyframes shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.skeleton{background:linear-gradient(90deg,var(--t-skeleton-from) 25%,var(--t-skeleton-mid) 50%,var(--t-skeleton-from) 75%);background-size:200% 100%;animation:shimmer 1.5s ease-in-out infinite;border-radius:4px}@keyframes fadeIn{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.tab-fade-in{animation:fadeIn .3s ease-out both}.digit-slot{display:inline-block;overflow:hidden;vertical-align:top}.digit-slot-inner{transition:transform .35s cubic-bezier(.33,1,.68,1)}@keyframes nramp-spin{to{transform:rotate(360deg)}}.nramp-spinner{width:40px;height:40px;border:3px solid var(--t-border);border-top-color:var(--t-accent);border-radius:50%;animation:nramp-spin .8s linear infinite;margin:0 auto}.nramp-spinner-large{width:60px;height:60px;border-width:4px}.nramp-spinner-inline{width:16px;height:16px;border-width:2px;display:inline-block}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.left-0{left:0}.right-3{right:.75rem}.top-0{top:0}.top-1\\/2{top:50%}.top-\\[3px\\]{top:3px}.z-20{z-index:20}.mx-5{margin-left:1.25rem;margin-right:1.25rem}.mb-1\\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-2\\.5{margin-bottom:.625rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mr-0\\.5{margin-right:.125rem}.mr-3{margin-right:.75rem}.mt-0\\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-\\[2px\\]{margin-top:2px}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.h-\\[640px\\]{height:640px}.h-full{height:100%}.min-h-\\[640px\\]{min-height:640px}.w-0{width:0px}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-\\[390px\\]{max-width:390px}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-3\\.5{gap:.875rem}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.border{border-width:1px}.border-white\\/20{border-color:#fff3}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.p-12{padding:3rem}.p-8{padding:2rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-8{padding-left:2rem;padding-right:2rem}.px-\\[18px\\]{padding-left:18px;padding-right:18px}.px-\\[2px\\]{padding-left:2px;padding-right:2px}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\\.5{padding-top:.875rem;padding-bottom:.875rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.pb-1{padding-bottom:.25rem}.pb-2\\.5{padding-bottom:.625rem}.pb-5{padding-bottom:1.25rem}.pb-\\[14px\\]{padding-bottom:14px}.pb-\\[18px\\]{padding-bottom:18px}.pt-3{padding-top:.75rem}.pt-5{padding-top:1.25rem}.pt-6{padding-top:1.5rem}.pt-\\[12px\\]{padding-top:12px}.pt-\\[14px\\]{padding-top:14px}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-\\[16px\\]{font-size:16px}.text-\\[17px\\]{font-size:17px}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.text-\\[48px\\]{font-size:48px}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.lowercase{text-transform:lowercase}.leading-tight{line-height:1.25}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.hover\\:opacity-70:hover{opacity:.7}
|
|
8
8
|
}`;
|
|
9
9
|
document.head.appendChild(s);
|
|
10
10
|
})();
|
|
11
|
-
import { jsx as e, jsxs as
|
|
12
|
-
import ke, { useState as N, useRef as
|
|
11
|
+
import { jsx as e, jsxs as o, Fragment as J } from "react/jsx-runtime";
|
|
12
|
+
import ke, { useState as N, useRef as K, useCallback as X, useEffect as U, useMemo as F, useReducer as Lt, useContext as It, createContext as Mt } from "react";
|
|
13
13
|
import { RampApi as Me } from "@nowramp/sdk";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
import { createPortal as lt } from "react-dom";
|
|
15
|
+
function Bt(t, n) {
|
|
16
|
+
const [a, r] = N(null), [s, m] = N(!0), [u, i] = N(null), l = K(null);
|
|
17
|
+
(!l.current || l.current !== t) && (l.current = new Me({ apiKey: "", ...t }));
|
|
18
|
+
const d = X(async () => {
|
|
18
19
|
if (!t.projectId) {
|
|
19
|
-
i(new Error("projectId is required")),
|
|
20
|
+
i(new Error("projectId is required")), m(!1);
|
|
20
21
|
return;
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
+
m(!0), i(null);
|
|
23
24
|
try {
|
|
24
|
-
const h = await
|
|
25
|
-
|
|
25
|
+
const h = await l.current.getSupported(n);
|
|
26
|
+
r(h);
|
|
26
27
|
} catch (h) {
|
|
27
28
|
i(h instanceof Error ? h : new Error("Failed to fetch config"));
|
|
28
29
|
} finally {
|
|
29
|
-
|
|
30
|
+
m(!1);
|
|
30
31
|
}
|
|
31
|
-
}, [t.projectId,
|
|
32
|
-
return
|
|
32
|
+
}, [t.projectId, n]);
|
|
33
|
+
return U(() => {
|
|
33
34
|
d();
|
|
34
|
-
}, [d]), { config:
|
|
35
|
+
}, [d]), { config: a, loading: s, error: u, refetch: d };
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
-
const [
|
|
38
|
-
(!
|
|
39
|
-
const f =
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
if (!
|
|
43
|
-
|
|
37
|
+
function Ot(t, n) {
|
|
38
|
+
const [a, r] = N(null), [s, m] = N(!1), [u, i] = N(null), l = K(null), d = K(""), h = `${t.apiUrl}|${t.projectId}`;
|
|
39
|
+
(!l.current || d.current !== h) && (l.current = new Me({ apiKey: "", ...t }), d.current = h);
|
|
40
|
+
const f = K(0);
|
|
41
|
+
U(() => {
|
|
42
|
+
const x = ++f.current;
|
|
43
|
+
if (!n || !t.projectId) {
|
|
44
|
+
r(null), m(!1);
|
|
44
45
|
return;
|
|
45
46
|
}
|
|
46
|
-
|
|
47
|
+
m(!0), i(null), l.current.getQuotes(n).then(
|
|
47
48
|
(p) => {
|
|
48
|
-
f.current ===
|
|
49
|
+
f.current === x && (r(p), m(!1));
|
|
49
50
|
},
|
|
50
51
|
(p) => {
|
|
51
|
-
f.current ===
|
|
52
|
+
f.current === x && (i(p instanceof Error ? p : new Error("Failed to fetch quotes")), r(null), m(!1));
|
|
52
53
|
}
|
|
53
54
|
);
|
|
54
|
-
}, [t.projectId,
|
|
55
|
-
const
|
|
56
|
-
if (!(!
|
|
57
|
-
|
|
55
|
+
}, [t.projectId, n == null ? void 0 : n.fiatCurrency, n == null ? void 0 : n.fiatAmount, n == null ? void 0 : n.cryptoAmount, n == null ? void 0 : n.cryptoCurrency, n == null ? void 0 : n.network, n == null ? void 0 : n.paymentMethodId, n == null ? void 0 : n.country, n == null ? void 0 : n.orderType]);
|
|
56
|
+
const v = X(async () => {
|
|
57
|
+
if (!(!n || !t.projectId)) {
|
|
58
|
+
m(!0), i(null);
|
|
58
59
|
try {
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
} catch (
|
|
62
|
-
i(
|
|
60
|
+
const x = await l.current.getQuotes(n);
|
|
61
|
+
r(x);
|
|
62
|
+
} catch (x) {
|
|
63
|
+
i(x instanceof Error ? x : new Error("Failed to fetch quotes"));
|
|
63
64
|
} finally {
|
|
64
|
-
|
|
65
|
+
m(!1);
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
|
-
}, [t.projectId,
|
|
68
|
-
return { quotes:
|
|
68
|
+
}, [t.projectId, n]);
|
|
69
|
+
return { quotes: a, loading: s, error: u, refetch: v };
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
-
const [
|
|
72
|
-
(!i.current ||
|
|
73
|
-
const h =
|
|
74
|
-
|
|
71
|
+
function Pt(t) {
|
|
72
|
+
const [n, a] = N(null), [r, s] = N(!1), [m, u] = N(null), i = K(null), l = K(""), d = `${t.apiUrl}|${t.projectId}`;
|
|
73
|
+
(!i.current || l.current !== d) && (i.current = new Me({ apiKey: "", ...t }), l.current = d);
|
|
74
|
+
const h = X(async (v) => {
|
|
75
|
+
s(!0), u(null);
|
|
75
76
|
try {
|
|
76
|
-
const
|
|
77
|
-
return
|
|
78
|
-
} catch (
|
|
79
|
-
const p =
|
|
80
|
-
throw
|
|
77
|
+
const x = await i.current.createCheckoutIntent(v);
|
|
78
|
+
return a(x), x;
|
|
79
|
+
} catch (x) {
|
|
80
|
+
const p = x instanceof Error ? x : new Error("Failed to create checkout intent");
|
|
81
|
+
throw u(p), p;
|
|
81
82
|
} finally {
|
|
82
|
-
|
|
83
|
+
s(!1);
|
|
83
84
|
}
|
|
84
|
-
}, []), f =
|
|
85
|
-
|
|
85
|
+
}, []), f = X(() => {
|
|
86
|
+
a(null), u(null);
|
|
86
87
|
}, []);
|
|
87
|
-
return { order:
|
|
88
|
+
return { order: n, loading: r, error: m, createOrder: h, reset: f };
|
|
88
89
|
}
|
|
89
|
-
function
|
|
90
|
-
const [
|
|
90
|
+
function Dt(t, n, a) {
|
|
91
|
+
const [r, s] = N(null), [m, u] = N(!1), [i, l] = N(null), d = K(null);
|
|
91
92
|
d.current || (d.current = new Me({ apiKey: "", projectId: "", ...t }));
|
|
92
|
-
const h =
|
|
93
|
-
if (
|
|
94
|
-
|
|
93
|
+
const h = X(async () => {
|
|
94
|
+
if (n) {
|
|
95
|
+
u(!0), l(null);
|
|
95
96
|
try {
|
|
96
|
-
const f = await d.current.getTransaction(
|
|
97
|
-
|
|
97
|
+
const f = await d.current.getTransaction(n);
|
|
98
|
+
s(f);
|
|
98
99
|
} catch (f) {
|
|
99
|
-
|
|
100
|
+
l(f instanceof Error ? f : new Error("Failed to fetch status"));
|
|
100
101
|
} finally {
|
|
101
|
-
|
|
102
|
+
u(!1);
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
|
-
}, [
|
|
105
|
-
return
|
|
106
|
-
if (!
|
|
107
|
-
const f = (
|
|
105
|
+
}, [n]);
|
|
106
|
+
return U(() => {
|
|
107
|
+
if (!n) return;
|
|
108
|
+
const f = (a == null ? void 0 : a.initialDelay) ?? 0;
|
|
108
109
|
if (f > 0) {
|
|
109
|
-
const
|
|
110
|
-
return () => clearTimeout(
|
|
110
|
+
const v = setTimeout(h, f);
|
|
111
|
+
return () => clearTimeout(v);
|
|
111
112
|
}
|
|
112
113
|
h();
|
|
113
|
-
}, [h,
|
|
114
|
-
if (!
|
|
114
|
+
}, [h, n, a == null ? void 0 : a.initialDelay]), U(() => {
|
|
115
|
+
if (!n || !(a != null && a.pollInterval) || !r || ["completed", "failed", "cancelled", "expired", "refunded"].includes(r.status))
|
|
115
116
|
return;
|
|
116
|
-
const
|
|
117
|
-
return () => clearInterval(
|
|
118
|
-
}, [
|
|
117
|
+
const v = setInterval(h, a.pollInterval);
|
|
118
|
+
return () => clearInterval(v);
|
|
119
|
+
}, [n, a == null ? void 0 : a.pollInterval, r == null ? void 0 : r.status, h]), { status: r, loading: m, error: i, refetch: h };
|
|
119
120
|
}
|
|
120
|
-
function
|
|
121
|
+
function st(t, n) {
|
|
121
122
|
if (!t) return t;
|
|
122
|
-
const
|
|
123
|
-
if (
|
|
124
|
-
let
|
|
125
|
-
return
|
|
123
|
+
const a = t.indexOf(".");
|
|
124
|
+
if (a === -1) return t;
|
|
125
|
+
let r = t;
|
|
126
|
+
return r.length - a - 1 > n && (r = r.slice(0, a + n + 1)), r = r.replace(/0+$/, "").replace(/\.$/, ""), r;
|
|
126
127
|
}
|
|
127
|
-
const
|
|
128
|
+
const ft = {
|
|
128
129
|
step: "amount",
|
|
129
130
|
flowType: "buy",
|
|
130
131
|
fiatCurrency: "USD",
|
|
@@ -142,14 +143,14 @@ const ht = {
|
|
|
142
143
|
country: "",
|
|
143
144
|
errorMessage: null
|
|
144
145
|
};
|
|
145
|
-
function
|
|
146
|
-
switch (
|
|
146
|
+
function Ht(t, n) {
|
|
147
|
+
switch (n.type) {
|
|
147
148
|
case "SET_STEP":
|
|
148
|
-
return { ...t, step:
|
|
149
|
+
return { ...t, step: n.step, errorMessage: null };
|
|
149
150
|
case "SET_FLOW_TYPE":
|
|
150
151
|
return {
|
|
151
152
|
...t,
|
|
152
|
-
flowType:
|
|
153
|
+
flowType: n.flowType,
|
|
153
154
|
fiatAmount: "",
|
|
154
155
|
cryptoAmount: "",
|
|
155
156
|
paymentMethodId: "",
|
|
@@ -158,163 +159,165 @@ function Pt(t, a) {
|
|
|
158
159
|
errorMessage: null
|
|
159
160
|
};
|
|
160
161
|
case "SET_FIAT_CURRENCY":
|
|
161
|
-
return { ...t, fiatCurrency:
|
|
162
|
+
return { ...t, fiatCurrency: n.currency };
|
|
162
163
|
case "SET_FIAT_AMOUNT":
|
|
163
|
-
return { ...t, fiatAmount:
|
|
164
|
+
return { ...t, fiatAmount: n.amount };
|
|
164
165
|
case "SET_CRYPTO_CURRENCY":
|
|
165
|
-
return { ...t, cryptoCurrency:
|
|
166
|
+
return { ...t, cryptoCurrency: n.currency, network: "" };
|
|
166
167
|
case "SET_CRYPTO_AMOUNT":
|
|
167
|
-
return { ...t, cryptoAmount:
|
|
168
|
+
return { ...t, cryptoAmount: n.amount };
|
|
168
169
|
case "SET_NETWORK":
|
|
169
|
-
return { ...t, network:
|
|
170
|
+
return { ...t, network: n.network };
|
|
170
171
|
case "SET_CRYPTO_CHAIN":
|
|
171
|
-
return { ...t, network:
|
|
172
|
+
return { ...t, network: n.chain };
|
|
172
173
|
case "SET_PAYMENT_METHOD":
|
|
173
|
-
return { ...t, paymentMethodId:
|
|
174
|
+
return { ...t, paymentMethodId: n.methodId };
|
|
174
175
|
case "SET_WALLET_ADDRESS":
|
|
175
|
-
return { ...t, walletAddress:
|
|
176
|
+
return { ...t, walletAddress: n.address, walletError: null };
|
|
176
177
|
case "SET_WALLET_ERROR":
|
|
177
|
-
return { ...t, walletError:
|
|
178
|
+
return { ...t, walletError: n.message };
|
|
178
179
|
case "SELECT_QUOTE":
|
|
179
180
|
return {
|
|
180
181
|
...t,
|
|
181
|
-
selectedQuote:
|
|
182
|
-
selectedProvider:
|
|
182
|
+
selectedQuote: n.quote,
|
|
183
|
+
selectedProvider: n.quote.gatewayId
|
|
183
184
|
};
|
|
184
185
|
case "SET_CUSTOMER_ID":
|
|
185
|
-
return { ...t, customerId:
|
|
186
|
+
return { ...t, customerId: n.customerId };
|
|
186
187
|
case "SET_EMAIL":
|
|
187
|
-
return { ...t, email:
|
|
188
|
+
return { ...t, email: n.email };
|
|
188
189
|
case "SET_COUNTRY":
|
|
189
|
-
return { ...t, country:
|
|
190
|
+
return { ...t, country: n.country };
|
|
190
191
|
case "SET_ERROR":
|
|
191
|
-
return { ...t, step: "error", errorMessage:
|
|
192
|
+
return { ...t, step: "error", errorMessage: n.message };
|
|
192
193
|
case "CLEAR_ERROR":
|
|
193
194
|
return { ...t, errorMessage: null };
|
|
194
195
|
case "RESET":
|
|
195
|
-
return
|
|
196
|
+
return ft;
|
|
196
197
|
default:
|
|
197
198
|
return t;
|
|
198
199
|
}
|
|
199
200
|
}
|
|
200
|
-
const
|
|
201
|
-
function
|
|
201
|
+
const yt = Mt(null);
|
|
202
|
+
function Ut({
|
|
202
203
|
projectId: t,
|
|
203
|
-
apiUrl:
|
|
204
|
-
assetBaseUrl:
|
|
205
|
-
flowType:
|
|
206
|
-
customerId:
|
|
207
|
-
defaultFiatCurrency:
|
|
208
|
-
defaultCryptoCurrency:
|
|
204
|
+
apiUrl: n = "https://api.nowramp.com",
|
|
205
|
+
assetBaseUrl: a = "",
|
|
206
|
+
flowType: r = "buy",
|
|
207
|
+
customerId: s = "",
|
|
208
|
+
defaultFiatCurrency: m = "USD",
|
|
209
|
+
defaultCryptoCurrency: u = "BTC",
|
|
209
210
|
defaultNetwork: i = "",
|
|
210
|
-
defaultFiatAmount:
|
|
211
|
+
defaultFiatAmount: l = "",
|
|
211
212
|
defaultCryptoAmount: d = "",
|
|
212
213
|
defaultWalletAddress: h = "",
|
|
213
214
|
defaultGateway: f,
|
|
214
|
-
fieldLocks:
|
|
215
|
-
statusPollInterval:
|
|
215
|
+
fieldLocks: v,
|
|
216
|
+
statusPollInterval: x = 5e3,
|
|
216
217
|
onComplete: p,
|
|
217
|
-
onError:
|
|
218
|
-
children:
|
|
218
|
+
onError: C,
|
|
219
|
+
children: L
|
|
219
220
|
}) {
|
|
220
|
-
const P =
|
|
221
|
-
...
|
|
222
|
-
step:
|
|
223
|
-
flowType:
|
|
224
|
-
fiatCurrency:
|
|
225
|
-
cryptoCurrency:
|
|
226
|
-
network:
|
|
227
|
-
fiatAmount:
|
|
228
|
-
cryptoAmount:
|
|
221
|
+
const P = F(() => ({ apiUrl: n, projectId: t }), [n, t]), S = i || (u ? u.toLowerCase() : ""), j = r === "sell", Q = j ? !!d : !!l, q = (j ? !!(Q && u && S) : !!(Q && u && S && h)) && f ? "confirm" : "amount", [c, O] = Lt(Ht, {
|
|
222
|
+
...ft,
|
|
223
|
+
step: q,
|
|
224
|
+
flowType: r,
|
|
225
|
+
fiatCurrency: m,
|
|
226
|
+
cryptoCurrency: u,
|
|
227
|
+
network: S,
|
|
228
|
+
fiatAmount: st(l, 2),
|
|
229
|
+
cryptoAmount: st(d, 6),
|
|
229
230
|
walletAddress: h,
|
|
230
|
-
customerId:
|
|
231
|
-
}),
|
|
232
|
-
config:
|
|
233
|
-
loading:
|
|
234
|
-
error:
|
|
235
|
-
} =
|
|
231
|
+
customerId: s
|
|
232
|
+
}), b = c.flowType === "sell", {
|
|
233
|
+
config: k,
|
|
234
|
+
loading: _,
|
|
235
|
+
error: $
|
|
236
|
+
} = Bt(P, c.flowType);
|
|
236
237
|
ke.useEffect(() => {
|
|
237
|
-
var
|
|
238
|
-
if (!
|
|
239
|
-
const
|
|
238
|
+
var T, R, w;
|
|
239
|
+
if (!k || !c.cryptoCurrency || c.network) return;
|
|
240
|
+
const g = (T = k.cryptos) == null ? void 0 : T.find((D) => D.code === c.cryptoCurrency), E = ((R = g == null ? void 0 : g.networks) == null ? void 0 : R.find((D) => D.isDefault)) || ((w = g == null ? void 0 : g.networks) == null ? void 0 : w[0]);
|
|
240
241
|
E != null && E.id && O({ type: "SET_NETWORK", network: E.id });
|
|
241
|
-
}, [
|
|
242
|
-
var
|
|
243
|
-
if (!((
|
|
244
|
-
const
|
|
242
|
+
}, [k, c.cryptoCurrency, c.network]), ke.useEffect(() => {
|
|
243
|
+
var w, D;
|
|
244
|
+
if (!((w = k == null ? void 0 : k.paymentMethods) != null && w.length)) return;
|
|
245
|
+
const g = c.fiatCurrency, E = k.paymentMethods;
|
|
245
246
|
if (c.paymentMethodId && E.some(
|
|
246
|
-
(
|
|
247
|
+
(Z) => Z.id === c.paymentMethodId && Z.supportedFiats.includes(g)
|
|
247
248
|
))
|
|
248
249
|
return;
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
250
|
+
const R = E.find(
|
|
251
|
+
(H) => H.supportedFiats.includes(g) && (H.id.includes("card") || H.id.includes("debit"))
|
|
252
|
+
) || E.find((H) => H.supportedFiats.includes(g));
|
|
253
|
+
O({ type: "SET_PAYMENT_METHOD", methodId: (R == null ? void 0 : R.id) || ((D = E[0]) == null ? void 0 : D.id) || "" });
|
|
254
|
+
}, [k, c.fiatCurrency, c.paymentMethodId]);
|
|
255
|
+
const G = F(() => {
|
|
256
|
+
if (b) {
|
|
254
257
|
if (!c.cryptoAmount) return null;
|
|
255
|
-
const
|
|
256
|
-
return isNaN(
|
|
258
|
+
const w = parseFloat(c.cryptoAmount);
|
|
259
|
+
return isNaN(w) || w <= 0 ? "Enter a valid amount" : null;
|
|
257
260
|
}
|
|
258
|
-
if (!
|
|
259
|
-
const
|
|
260
|
-
if (isNaN(
|
|
261
|
-
const E =
|
|
261
|
+
if (!k || !c.fiatAmount) return null;
|
|
262
|
+
const g = parseFloat(c.fiatAmount);
|
|
263
|
+
if (isNaN(g)) return null;
|
|
264
|
+
const E = k.fiats.find((w) => w.code === c.fiatCurrency);
|
|
262
265
|
if (!E) return null;
|
|
263
|
-
const
|
|
264
|
-
return !isNaN(
|
|
265
|
-
}, [
|
|
266
|
-
const
|
|
267
|
-
return !
|
|
266
|
+
const T = parseFloat(E.minAmount), R = parseFloat(E.maxAmount);
|
|
267
|
+
return !isNaN(T) && g < T ? `Minimum amount is ${E.minAmount} ${c.fiatCurrency}` : !isNaN(R) && g > R ? `Maximum amount is ${E.maxAmount} ${c.fiatCurrency}` : null;
|
|
268
|
+
}, [k, c.fiatAmount, c.fiatCurrency, c.cryptoAmount, b]), Ne = F(() => {
|
|
269
|
+
const g = b ? !!c.cryptoAmount : !!c.fiatAmount;
|
|
270
|
+
return !k || !g || !c.cryptoCurrency || !c.network || G ? null : {
|
|
268
271
|
fiatCurrency: c.fiatCurrency,
|
|
269
|
-
...
|
|
272
|
+
...b ? { cryptoAmount: c.cryptoAmount } : { fiatAmount: c.fiatAmount },
|
|
270
273
|
cryptoCurrency: c.cryptoCurrency,
|
|
271
274
|
network: c.network,
|
|
272
275
|
paymentMethodId: c.paymentMethodId || void 0,
|
|
273
276
|
country: c.country || void 0,
|
|
274
277
|
orderType: c.flowType
|
|
275
278
|
};
|
|
276
|
-
}, [
|
|
279
|
+
}, [k, c.fiatCurrency, c.fiatAmount, c.cryptoAmount, c.cryptoCurrency, c.network, c.paymentMethodId, c.country, G, b, c.flowType]), {
|
|
277
280
|
quotes: he,
|
|
278
281
|
loading: fe,
|
|
279
|
-
error:
|
|
282
|
+
error: Y,
|
|
280
283
|
refetch: ye
|
|
281
|
-
} =
|
|
284
|
+
} = Ot(P, Ne), {
|
|
282
285
|
order: ae,
|
|
283
286
|
loading: Ce,
|
|
284
|
-
error:
|
|
285
|
-
createOrder:
|
|
286
|
-
} =
|
|
287
|
+
error: ce,
|
|
288
|
+
createOrder: ie
|
|
289
|
+
} = Pt(P), be = 15e3, {
|
|
287
290
|
status: V,
|
|
288
|
-
loading:
|
|
289
|
-
} =
|
|
290
|
-
{ apiUrl:
|
|
291
|
+
loading: re
|
|
292
|
+
} = Dt(
|
|
293
|
+
{ apiUrl: n },
|
|
291
294
|
(ae == null ? void 0 : ae.orderId) ?? null,
|
|
292
|
-
{ pollInterval:
|
|
295
|
+
{ pollInterval: x, initialDelay: be }
|
|
293
296
|
);
|
|
294
297
|
ke.useEffect(() => {
|
|
295
298
|
(V == null ? void 0 : V.status) === "completed" && p && p(V);
|
|
296
299
|
}, [V == null ? void 0 : V.status, p]), ke.useEffect(() => {
|
|
297
|
-
const
|
|
298
|
-
|
|
299
|
-
}, [
|
|
300
|
-
const
|
|
301
|
-
Ee.current =
|
|
302
|
-
const Ae =
|
|
300
|
+
const g = $ || ce;
|
|
301
|
+
g && C && C(g);
|
|
302
|
+
}, [$, ce, C]);
|
|
303
|
+
const oe = f || (k == null ? void 0 : k.defaultGateway) || null, Ee = K(oe);
|
|
304
|
+
Ee.current = oe;
|
|
305
|
+
const Ae = K(he);
|
|
303
306
|
Ae.current = he;
|
|
304
|
-
const
|
|
305
|
-
var E,
|
|
306
|
-
const
|
|
307
|
-
if (!
|
|
308
|
-
const
|
|
309
|
-
O({ type: "SET_ERROR", message: `Missing required fields: ${
|
|
307
|
+
const Se = X(async () => {
|
|
308
|
+
var E, T, R;
|
|
309
|
+
const g = ((E = c.selectedQuote) == null ? void 0 : E.gatewayId) || ((R = (T = Ae.current) == null ? void 0 : T.bestQuote) == null ? void 0 : R.gatewayId) || Ee.current;
|
|
310
|
+
if (!g || !c.walletAddress) {
|
|
311
|
+
const w = [!g && "gateway", !c.walletAddress && "walletAddress"].filter(Boolean).join(", ");
|
|
312
|
+
O({ type: "SET_ERROR", message: `Missing required fields: ${w}` });
|
|
310
313
|
return;
|
|
311
314
|
}
|
|
312
315
|
try {
|
|
313
|
-
await
|
|
314
|
-
gateway:
|
|
316
|
+
await ie({
|
|
317
|
+
gateway: g,
|
|
315
318
|
customerId: c.customerId || void 0,
|
|
316
319
|
fiatCurrency: c.fiatCurrency,
|
|
317
|
-
...
|
|
320
|
+
...b ? { cryptoAmount: c.cryptoAmount } : { fiatAmount: c.fiatAmount },
|
|
318
321
|
cryptoCurrency: c.cryptoCurrency,
|
|
319
322
|
network: c.network,
|
|
320
323
|
walletAddress: c.walletAddress,
|
|
@@ -322,22 +325,22 @@ function Dt({
|
|
|
322
325
|
email: c.email || void 0,
|
|
323
326
|
orderType: c.flowType
|
|
324
327
|
}), O({ type: "SET_STEP", step: "checkout" });
|
|
325
|
-
} catch (
|
|
326
|
-
const D =
|
|
328
|
+
} catch (w) {
|
|
329
|
+
const D = w instanceof Error ? w.message : "Failed to create order";
|
|
327
330
|
/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
331
|
}
|
|
329
|
-
}, [c,
|
|
330
|
-
O({ type: "SET_STEP", step:
|
|
331
|
-
}, []),
|
|
332
|
-
const
|
|
333
|
-
E > 0 && O({ type: "SET_STEP", step:
|
|
334
|
-
}, [c.step,
|
|
335
|
-
const
|
|
332
|
+
}, [c, ie, b]), ee = X((g) => {
|
|
333
|
+
O({ type: "SET_STEP", step: g });
|
|
334
|
+
}, []), de = X(() => {
|
|
335
|
+
const g = ["confirm", "amount", "quotes", "wallet", "checkout", "processing", "complete"], E = g.indexOf(c.step);
|
|
336
|
+
E > 0 && O({ type: "SET_STEP", step: g[E - 1] });
|
|
337
|
+
}, [c.step, b]), Oe = F(() => {
|
|
338
|
+
const g = b ? !!c.cryptoAmount : !!c.fiatAmount;
|
|
336
339
|
switch (c.step) {
|
|
337
340
|
case "confirm":
|
|
338
|
-
return !!(
|
|
341
|
+
return !!(g && c.cryptoCurrency && c.network && c.walletAddress && !G);
|
|
339
342
|
case "amount":
|
|
340
|
-
return !!(
|
|
343
|
+
return !!(g && c.cryptoCurrency && c.network && !G);
|
|
341
344
|
case "quotes":
|
|
342
345
|
return !!c.selectedQuote;
|
|
343
346
|
case "wallet":
|
|
@@ -345,35 +348,35 @@ function Dt({
|
|
|
345
348
|
default:
|
|
346
349
|
return !1;
|
|
347
350
|
}
|
|
348
|
-
}, [c,
|
|
351
|
+
}, [c, G, b]), xe = {
|
|
349
352
|
apiConfig: P,
|
|
350
|
-
assetBaseUrl:
|
|
351
|
-
config:
|
|
352
|
-
configLoading:
|
|
353
|
-
configError:
|
|
353
|
+
assetBaseUrl: a,
|
|
354
|
+
config: k,
|
|
355
|
+
configLoading: _,
|
|
356
|
+
configError: $,
|
|
354
357
|
state: c,
|
|
355
358
|
dispatch: O,
|
|
356
359
|
quotes: he,
|
|
357
360
|
quotesLoading: fe,
|
|
358
|
-
quotesError:
|
|
361
|
+
quotesError: Y,
|
|
359
362
|
fetchQuotes: ye,
|
|
360
363
|
order: ae,
|
|
361
364
|
orderLoading: Ce,
|
|
362
|
-
orderError:
|
|
363
|
-
createOrder:
|
|
365
|
+
orderError: ce,
|
|
366
|
+
createOrder: Se,
|
|
364
367
|
orderStatus: V,
|
|
365
|
-
orderStatusLoading:
|
|
366
|
-
fieldLocks:
|
|
367
|
-
defaultGateway:
|
|
368
|
-
amountError:
|
|
369
|
-
goToStep:
|
|
370
|
-
goBack:
|
|
368
|
+
orderStatusLoading: re,
|
|
369
|
+
fieldLocks: v || null,
|
|
370
|
+
defaultGateway: oe,
|
|
371
|
+
amountError: G,
|
|
372
|
+
goToStep: ee,
|
|
373
|
+
goBack: de,
|
|
371
374
|
canProceed: Oe
|
|
372
375
|
};
|
|
373
|
-
return /* @__PURE__ */ e(
|
|
376
|
+
return /* @__PURE__ */ e(yt.Provider, { value: xe, children: L });
|
|
374
377
|
}
|
|
375
378
|
function pe() {
|
|
376
|
-
const t =
|
|
379
|
+
const t = It(yt);
|
|
377
380
|
if (!t)
|
|
378
381
|
throw new Error("useRamp must be used within a RampProvider");
|
|
379
382
|
return t;
|
|
@@ -512,7 +515,7 @@ const Ie = {
|
|
|
512
515
|
OKC: { name: "OKX Chain", icon: "eth" },
|
|
513
516
|
UNI_CHAIN: { name: "UNI", icon: "uni" },
|
|
514
517
|
ZEC: { name: "ZCash", icon: "zec" }
|
|
515
|
-
},
|
|
518
|
+
}, Kt = [
|
|
516
519
|
// --- Popular / Top coins ---
|
|
517
520
|
{ code: "BTC", name: "Bitcoin", chains: ["BTC", "LN"], popular: !0 },
|
|
518
521
|
{ code: "ETH", name: "Ethereum", chains: ["ETH", "ARB", "BASE", "BSC", "OPTIMISM", "LINEA", "ZKSYNC", "LRC", "STARK", "APE", "ECLIPSE", "FUEL", "INK", "SOPHON", "UNICHAIN", "WLD"], popular: !0 },
|
|
@@ -705,7 +708,7 @@ const Ie = {
|
|
|
705
708
|
{ code: "ZCHF", name: "Frankencoin", chains: ["ETH"], popular: !1 },
|
|
706
709
|
{ code: "ZETA", name: "Zeta", chains: ["ETH", "ZETACHAIN"], popular: !1 },
|
|
707
710
|
{ code: "ZTG", name: "Zeitgeist", chains: ["ZTG"], popular: !1 }
|
|
708
|
-
],
|
|
711
|
+
], Ft = {
|
|
709
712
|
AED: "ae",
|
|
710
713
|
ALL: "al",
|
|
711
714
|
ARS: "ar",
|
|
@@ -740,18 +743,18 @@ const Ie = {
|
|
|
740
743
|
VND: "vn",
|
|
741
744
|
ZAR: "za"
|
|
742
745
|
};
|
|
743
|
-
function
|
|
744
|
-
return `${
|
|
746
|
+
function xt(t, n = "") {
|
|
747
|
+
return `${n}/crypto-icons/${t.toLowerCase()}.svg`;
|
|
745
748
|
}
|
|
746
|
-
function
|
|
747
|
-
const
|
|
748
|
-
return `${
|
|
749
|
+
function _t(t, n = "") {
|
|
750
|
+
const a = Ft[t] || "us";
|
|
751
|
+
return `${n}/flags/${a}.svg`;
|
|
749
752
|
}
|
|
750
|
-
function _e(t,
|
|
751
|
-
const
|
|
752
|
-
return
|
|
753
|
+
function _e(t, n = "") {
|
|
754
|
+
const a = Ie[t];
|
|
755
|
+
return a ? `${n}/crypto-icons/${a.icon}.svg` : `${n}/crypto-icons/${t.toLowerCase()}.svg`;
|
|
753
756
|
}
|
|
754
|
-
const
|
|
757
|
+
const ct = [
|
|
755
758
|
{ code: "ALL", name: "Albania Lek" },
|
|
756
759
|
{ code: "ARS", name: "Argentina Peso" },
|
|
757
760
|
{ code: "AUD", name: "Australian Dollar" },
|
|
@@ -764,14 +767,14 @@ const st = [
|
|
|
764
767
|
{ code: "CHF", name: "Swiss Franc" },
|
|
765
768
|
{ code: "MXN", name: "Mexican Peso" },
|
|
766
769
|
{ code: "INR", name: "Indian Rupee" }
|
|
767
|
-
],
|
|
770
|
+
], it = [
|
|
768
771
|
{ id: "blue", name: "Blue", accent: "#0077FF" },
|
|
769
772
|
{ id: "violet", name: "Violet", accent: "#7C3AED" },
|
|
770
773
|
{ id: "green", name: "Green", accent: "#10B981" },
|
|
771
774
|
{ id: "orange", name: "Orange", accent: "#F59E0B" },
|
|
772
775
|
{ id: "rose", name: "Rose", accent: "#F43F5E" },
|
|
773
776
|
{ id: "mono", name: "Mono", accent: null }
|
|
774
|
-
],
|
|
777
|
+
], dt = {
|
|
775
778
|
USDC: { USD: 0.9962, EUR: 1.0814, GBP: 1.2573, JPY: 667e-5, CAD: 0.7198, AUD: 0.6384, BRL: 0.1726, CHF: 1.1306, MXN: 0.0487, INR: 0.01187, ARS: 855e-6, ALL: 0.01058 },
|
|
776
779
|
USDT: { USD: 0.9958, EUR: 1.081, GBP: 1.2568, JPY: 666e-5, CAD: 0.7194, AUD: 0.638, BRL: 0.1724, CHF: 1.1301, MXN: 0.0486, INR: 0.01186, ARS: 854e-6, ALL: 0.01057 },
|
|
777
780
|
BTC: { USD: 104e-7, EUR: 1129e-8, GBP: 1313e-8, JPY: 696e-10, CAD: 751e-8, AUD: 666e-8, BRL: 18e-7, CHF: 118e-7, MXN: 508e-9, INR: 124e-9, ARS: 892e-11, ALL: 11e-8 },
|
|
@@ -781,62 +784,62 @@ const st = [
|
|
|
781
784
|
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 },
|
|
782
785
|
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 }
|
|
783
786
|
};
|
|
784
|
-
function
|
|
785
|
-
var
|
|
786
|
-
return ((
|
|
787
|
+
function kn(t, n) {
|
|
788
|
+
var a, r;
|
|
789
|
+
return ((a = dt[t]) == null ? void 0 : a[n]) ?? ((r = dt.USDC) == null ? void 0 : r[n]) ?? 1;
|
|
787
790
|
}
|
|
788
|
-
function
|
|
791
|
+
function Xt(t) {
|
|
789
792
|
return parseFloat(t.replace(/,/g, "")) || 0;
|
|
790
793
|
}
|
|
791
|
-
function
|
|
794
|
+
function Ln(t) {
|
|
792
795
|
if (t === 0) return "0";
|
|
793
796
|
if (t >= 1e3) return t.toLocaleString("en-US", { maximumFractionDigits: 2 });
|
|
794
797
|
if (t >= 1) return t.toFixed(2);
|
|
795
798
|
if (t >= 0.01) return t.toFixed(4);
|
|
796
|
-
const
|
|
797
|
-
return parseFloat(
|
|
799
|
+
const n = t.toPrecision(4);
|
|
800
|
+
return parseFloat(n).toString();
|
|
798
801
|
}
|
|
799
|
-
const Fe = (t) => /^#([0-9A-Fa-f]{3}){1,2}$/.test(t),
|
|
802
|
+
const Fe = (t) => /^#([0-9A-Fa-f]{3}){1,2}$/.test(t), ut = 10, mt = 1e-4, $t = (() => {
|
|
800
803
|
const t = [];
|
|
801
|
-
for (const
|
|
802
|
-
for (const
|
|
803
|
-
t.push({ code:
|
|
804
|
+
for (const n of Kt)
|
|
805
|
+
for (const a of n.chains)
|
|
806
|
+
t.push({ code: n.code, name: n.name, chain: a, popular: n.popular });
|
|
804
807
|
return t;
|
|
805
808
|
})();
|
|
806
|
-
function
|
|
809
|
+
function pt({ ticker: t, size: n = 32, baseUrl: a = "" }) {
|
|
807
810
|
return /* @__PURE__ */ e(
|
|
808
811
|
"img",
|
|
809
812
|
{
|
|
810
|
-
src:
|
|
813
|
+
src: xt(t, a),
|
|
811
814
|
alt: t,
|
|
812
|
-
width:
|
|
813
|
-
height:
|
|
815
|
+
width: n,
|
|
816
|
+
height: n,
|
|
814
817
|
className: "rounded-full shrink-0",
|
|
815
|
-
style: { width:
|
|
818
|
+
style: { width: n, height: n }
|
|
816
819
|
}
|
|
817
820
|
);
|
|
818
821
|
}
|
|
819
|
-
function Xe({ currencyCode: t, size:
|
|
822
|
+
function Xe({ currencyCode: t, size: n = 16, baseUrl: a = "" }) {
|
|
820
823
|
return /* @__PURE__ */ e(
|
|
821
824
|
"img",
|
|
822
825
|
{
|
|
823
|
-
src:
|
|
826
|
+
src: _t(t, a),
|
|
824
827
|
alt: t,
|
|
825
|
-
width:
|
|
826
|
-
height:
|
|
828
|
+
width: n,
|
|
829
|
+
height: n,
|
|
827
830
|
className: "rounded-full shrink-0",
|
|
828
|
-
style: { width:
|
|
831
|
+
style: { width: n, height: n }
|
|
829
832
|
}
|
|
830
833
|
);
|
|
831
834
|
}
|
|
832
|
-
function $e({ size: t = 32, color:
|
|
833
|
-
return /* @__PURE__ */
|
|
834
|
-
/* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "16", fill:
|
|
835
|
+
function $e({ size: t = 32, color: n = "#888" }) {
|
|
836
|
+
return /* @__PURE__ */ o("svg", { width: t, height: t, viewBox: "0 0 32 32", fill: "none", children: [
|
|
837
|
+
/* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "16", fill: n }),
|
|
835
838
|
/* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "8", stroke: "white", strokeWidth: "1.5", fill: "none" })
|
|
836
839
|
] });
|
|
837
840
|
}
|
|
838
|
-
function
|
|
839
|
-
return /* @__PURE__ */
|
|
841
|
+
function Gt({ size: t = 24 }) {
|
|
842
|
+
return /* @__PURE__ */ o("svg", { width: t, height: t, viewBox: "0 0 32 32", fill: "none", children: [
|
|
840
843
|
/* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "16", fill: "#0077FF" }),
|
|
841
844
|
/* @__PURE__ */ e("path", { d: "M8 15l8-6 8 6H8z", fill: "white" }),
|
|
842
845
|
/* @__PURE__ */ e("rect", { x: "10", y: "16", width: "2", height: "6", fill: "white" }),
|
|
@@ -845,7 +848,7 @@ function Xt({ size: t = 24 }) {
|
|
|
845
848
|
/* @__PURE__ */ e("rect", { x: "8", y: "22", width: "16", height: "2", rx: "0.5", fill: "white" })
|
|
846
849
|
] });
|
|
847
850
|
}
|
|
848
|
-
function
|
|
851
|
+
function jt({ size: t = 32 }) {
|
|
849
852
|
return /* @__PURE__ */ e(
|
|
850
853
|
"div",
|
|
851
854
|
{
|
|
@@ -855,7 +858,7 @@ function $t({ size: t = 32 }) {
|
|
|
855
858
|
}
|
|
856
859
|
);
|
|
857
860
|
}
|
|
858
|
-
function
|
|
861
|
+
function Wt({ size: t = 32 }) {
|
|
859
862
|
return /* @__PURE__ */ e(
|
|
860
863
|
"div",
|
|
861
864
|
{
|
|
@@ -866,7 +869,7 @@ function Gt({ size: t = 32 }) {
|
|
|
866
869
|
);
|
|
867
870
|
}
|
|
868
871
|
function Yt({ size: t = 32 }) {
|
|
869
|
-
return /* @__PURE__ */
|
|
872
|
+
return /* @__PURE__ */ o(
|
|
870
873
|
"div",
|
|
871
874
|
{
|
|
872
875
|
className: "rounded-full bg-white flex items-center justify-center shrink-0",
|
|
@@ -878,7 +881,7 @@ function Yt({ size: t = 32 }) {
|
|
|
878
881
|
}
|
|
879
882
|
);
|
|
880
883
|
}
|
|
881
|
-
function
|
|
884
|
+
function Vt({ size: t = 32 }) {
|
|
882
885
|
return /* @__PURE__ */ e(
|
|
883
886
|
"div",
|
|
884
887
|
{
|
|
@@ -888,20 +891,20 @@ function jt({ size: t = 32 }) {
|
|
|
888
891
|
}
|
|
889
892
|
);
|
|
890
893
|
}
|
|
891
|
-
function
|
|
894
|
+
function Qt({ size: t = 32 }) {
|
|
892
895
|
return /* @__PURE__ */ e(
|
|
893
896
|
"div",
|
|
894
897
|
{
|
|
895
898
|
className: "rounded-full flex items-center justify-center shrink-0",
|
|
896
899
|
style: { width: t, height: t, background: "var(--t-card-icon-bg)" },
|
|
897
|
-
children: /* @__PURE__ */
|
|
900
|
+
children: /* @__PURE__ */ o("svg", { width: t * 0.55, height: t * 0.55, viewBox: "0 0 18 14", fill: "none", children: [
|
|
898
901
|
/* @__PURE__ */ e("rect", { x: "0.5", y: "0.5", width: "17", height: "13", rx: "2", stroke: "var(--t-card-icon-stroke)" }),
|
|
899
902
|
/* @__PURE__ */ e("rect", { y: "3", width: "18", height: "3", fill: "var(--t-card-icon-stroke)" })
|
|
900
903
|
] })
|
|
901
904
|
}
|
|
902
905
|
);
|
|
903
906
|
}
|
|
904
|
-
function
|
|
907
|
+
function In({ size: t = 18 }) {
|
|
905
908
|
return /* @__PURE__ */ e(
|
|
906
909
|
"div",
|
|
907
910
|
{
|
|
@@ -914,10 +917,10 @@ function Sa({ size: t = 18 }) {
|
|
|
914
917
|
function ge() {
|
|
915
918
|
return /* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ e("path", { d: "M3 4.5L6 7.5L9 4.5", stroke: "var(--t-text-secondary)", strokeWidth: "1.2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
916
919
|
}
|
|
917
|
-
function
|
|
920
|
+
function Zt() {
|
|
918
921
|
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" }) });
|
|
919
922
|
}
|
|
920
|
-
function
|
|
923
|
+
function zt({ onClick: t }) {
|
|
921
924
|
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(
|
|
922
925
|
"path",
|
|
923
926
|
{
|
|
@@ -927,66 +930,66 @@ function Qt({ onClick: t }) {
|
|
|
927
930
|
}
|
|
928
931
|
) }) });
|
|
929
932
|
}
|
|
930
|
-
function
|
|
933
|
+
function Jt({ size: t = 40 }) {
|
|
931
934
|
return /* @__PURE__ */ e(
|
|
932
935
|
"div",
|
|
933
936
|
{
|
|
934
937
|
className: "rounded-full flex items-center justify-center shrink-0",
|
|
935
938
|
style: { width: t, height: t, background: "var(--t-surface)" },
|
|
936
|
-
children: /* @__PURE__ */
|
|
939
|
+
children: /* @__PURE__ */ o("svg", { width: t * 0.5, height: t * 0.5, viewBox: "0 0 20 20", fill: "none", children: [
|
|
937
940
|
/* @__PURE__ */ e("circle", { cx: "10", cy: "10", r: "7.5", stroke: "var(--t-text)", strokeWidth: "1.5" }),
|
|
938
941
|
/* @__PURE__ */ e("path", { d: "M10 2.5A7.5 7.5 0 0 1 10 17.5", fill: "var(--t-text)" })
|
|
939
942
|
] })
|
|
940
943
|
}
|
|
941
944
|
);
|
|
942
945
|
}
|
|
943
|
-
function
|
|
946
|
+
function qt(t, n = 32) {
|
|
944
947
|
switch (t) {
|
|
945
948
|
case "revolut":
|
|
946
|
-
return /* @__PURE__ */ e(
|
|
949
|
+
return /* @__PURE__ */ e(jt, { size: n });
|
|
947
950
|
case "applepay":
|
|
948
|
-
return /* @__PURE__ */ e(
|
|
951
|
+
return /* @__PURE__ */ e(Wt, { size: n });
|
|
949
952
|
case "card":
|
|
950
|
-
return /* @__PURE__ */ e(
|
|
953
|
+
return /* @__PURE__ */ e(Qt, { size: n });
|
|
951
954
|
case "googlepay":
|
|
952
|
-
return /* @__PURE__ */ e(Yt, { size:
|
|
955
|
+
return /* @__PURE__ */ e(Yt, { size: n });
|
|
953
956
|
case "paypal":
|
|
954
|
-
return /* @__PURE__ */ e(
|
|
957
|
+
return /* @__PURE__ */ e(Vt, { size: n });
|
|
955
958
|
case "bank":
|
|
956
|
-
return /* @__PURE__ */ e(
|
|
959
|
+
return /* @__PURE__ */ e(Gt, { size: n });
|
|
957
960
|
default:
|
|
958
|
-
return /* @__PURE__ */ e($e, { size:
|
|
961
|
+
return /* @__PURE__ */ e($e, { size: n });
|
|
959
962
|
}
|
|
960
963
|
}
|
|
961
964
|
function Le({
|
|
962
965
|
isOpen: t,
|
|
963
|
-
onClose:
|
|
964
|
-
children:
|
|
966
|
+
onClose: n,
|
|
967
|
+
children: a
|
|
965
968
|
}) {
|
|
966
|
-
const [
|
|
967
|
-
|
|
969
|
+
const [r, s] = N(!1), [m, u] = N(!1);
|
|
970
|
+
U(() => {
|
|
968
971
|
if (t)
|
|
969
|
-
|
|
970
|
-
else if (
|
|
971
|
-
|
|
972
|
-
const
|
|
973
|
-
return () => clearTimeout(
|
|
972
|
+
s(!0), requestAnimationFrame(() => requestAnimationFrame(() => u(!0)));
|
|
973
|
+
else if (r) {
|
|
974
|
+
u(!1);
|
|
975
|
+
const l = setTimeout(() => s(!1), 250);
|
|
976
|
+
return () => clearTimeout(l);
|
|
974
977
|
}
|
|
975
978
|
}, [t]);
|
|
976
|
-
const i =
|
|
977
|
-
|
|
978
|
-
}, [
|
|
979
|
-
return
|
|
979
|
+
const i = X(() => {
|
|
980
|
+
u(!1), setTimeout(() => n(), 250);
|
|
981
|
+
}, [n]);
|
|
982
|
+
return r ? /* @__PURE__ */ e(
|
|
980
983
|
"div",
|
|
981
984
|
{
|
|
982
985
|
className: "absolute inset-0 z-20 transition-opacity duration-250",
|
|
983
|
-
style: { opacity:
|
|
986
|
+
style: { opacity: m ? 1 : 0 },
|
|
984
987
|
children: /* @__PURE__ */ e(
|
|
985
988
|
"div",
|
|
986
989
|
{
|
|
987
990
|
className: "absolute inset-0 flex flex-col transition-transform duration-250 ease-out",
|
|
988
|
-
style: { background: "var(--t-modal-bg)", transform:
|
|
989
|
-
children: typeof
|
|
991
|
+
style: { background: "var(--t-modal-bg)", transform: m ? "translateY(0)" : "translateY(24px)" },
|
|
992
|
+
children: typeof a == "function" ? a(i) : a
|
|
990
993
|
}
|
|
991
994
|
)
|
|
992
995
|
}
|
|
@@ -999,25 +1002,25 @@ function ve({ onClick: t }) {
|
|
|
999
1002
|
onClick: t,
|
|
1000
1003
|
className: "flex items-center justify-center transition-colors rounded-full shrink-0",
|
|
1001
1004
|
style: { width: 30, height: 30, backgroundColor: "var(--t-close-bg)" },
|
|
1002
|
-
onMouseEnter: (
|
|
1003
|
-
onMouseLeave: (
|
|
1005
|
+
onMouseEnter: (n) => n.currentTarget.style.backgroundColor = "var(--t-close-hover)",
|
|
1006
|
+
onMouseLeave: (n) => n.currentTarget.style.backgroundColor = "var(--t-close-bg)",
|
|
1004
1007
|
children: /* @__PURE__ */ e("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ e("path", { d: "M1 1L9 9M9 1L1 9", stroke: "var(--t-icon-close)", strokeWidth: "1.4", strokeLinecap: "round" }) })
|
|
1005
1008
|
}
|
|
1006
1009
|
);
|
|
1007
1010
|
}
|
|
1008
1011
|
function Be({
|
|
1009
1012
|
value: t,
|
|
1010
|
-
onChange:
|
|
1011
|
-
placeholder:
|
|
1013
|
+
onChange: n,
|
|
1014
|
+
placeholder: a = ""
|
|
1012
1015
|
}) {
|
|
1013
|
-
return /* @__PURE__ */
|
|
1016
|
+
return /* @__PURE__ */ o("div", { className: "relative mx-5 mb-5", children: [
|
|
1014
1017
|
/* @__PURE__ */ e(
|
|
1015
1018
|
"input",
|
|
1016
1019
|
{
|
|
1017
1020
|
type: "text",
|
|
1018
1021
|
value: t,
|
|
1019
|
-
onChange: (
|
|
1020
|
-
placeholder:
|
|
1022
|
+
onChange: (r) => n(r.target.value),
|
|
1023
|
+
placeholder: a,
|
|
1021
1024
|
style: { height: 47, borderRadius: 4.5, borderColor: "var(--t-border)", color: "var(--t-text)", paddingLeft: 14, paddingRight: t ? 40 : 14, fontSize: 14 },
|
|
1022
1025
|
className: "w-full bg-transparent border outline-none transition-colors"
|
|
1023
1026
|
}
|
|
@@ -1025,7 +1028,7 @@ function Be({
|
|
|
1025
1028
|
t && /* @__PURE__ */ e(
|
|
1026
1029
|
"button",
|
|
1027
1030
|
{
|
|
1028
|
-
onClick: () =>
|
|
1031
|
+
onClick: () => n(""),
|
|
1029
1032
|
className: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center justify-center transition-colors rounded",
|
|
1030
1033
|
style: { width: 22, height: 22, backgroundColor: "var(--t-close-bg)", borderRadius: 4 },
|
|
1031
1034
|
children: /* @__PURE__ */ e("svg", { width: "8", height: "8", viewBox: "0 0 8 8", fill: "none", children: /* @__PURE__ */ e("path", { d: "M1 1L7 7M7 1L1 7", stroke: "var(--t-icon-close)", strokeWidth: "1.2", strokeLinecap: "round" }) })
|
|
@@ -1033,20 +1036,20 @@ function Be({
|
|
|
1033
1036
|
)
|
|
1034
1037
|
] });
|
|
1035
1038
|
}
|
|
1036
|
-
function
|
|
1039
|
+
function en({
|
|
1037
1040
|
methods: t,
|
|
1038
|
-
selectedId:
|
|
1039
|
-
onSelect:
|
|
1040
|
-
onClose:
|
|
1041
|
+
selectedId: n,
|
|
1042
|
+
onSelect: a,
|
|
1043
|
+
onClose: r
|
|
1041
1044
|
}) {
|
|
1042
|
-
const [
|
|
1043
|
-
const i =
|
|
1045
|
+
const [s, m] = N(""), u = F(() => {
|
|
1046
|
+
const i = s.trim().toLowerCase();
|
|
1044
1047
|
return i ? t.filter(
|
|
1045
|
-
(
|
|
1048
|
+
(l) => l.id.toLowerCase().includes(i) || l.name.toLowerCase().includes(i) || l.description && l.description.toLowerCase().includes(i)
|
|
1046
1049
|
) : t;
|
|
1047
|
-
}, [t,
|
|
1048
|
-
return /* @__PURE__ */
|
|
1049
|
-
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ve, { onClick:
|
|
1050
|
+
}, [t, s]);
|
|
1051
|
+
return /* @__PURE__ */ o(J, { children: [
|
|
1052
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ve, { onClick: r }) }),
|
|
1050
1053
|
/* @__PURE__ */ e(
|
|
1051
1054
|
"h2",
|
|
1052
1055
|
{
|
|
@@ -1055,62 +1058,80 @@ function zt({
|
|
|
1055
1058
|
children: "Choose payment method"
|
|
1056
1059
|
}
|
|
1057
1060
|
),
|
|
1058
|
-
/* @__PURE__ */ e(Be, { value:
|
|
1059
|
-
/* @__PURE__ */
|
|
1060
|
-
|
|
1061
|
-
const
|
|
1062
|
-
return /* @__PURE__ */
|
|
1061
|
+
/* @__PURE__ */ e(Be, { value: s, onChange: m }),
|
|
1062
|
+
/* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
|
|
1063
|
+
u.map((i) => {
|
|
1064
|
+
const l = i.id === n, d = gt(i.id, i.name);
|
|
1065
|
+
return /* @__PURE__ */ o(
|
|
1063
1066
|
"button",
|
|
1064
1067
|
{
|
|
1065
|
-
onClick: () =>
|
|
1066
|
-
className: "flex items-center gap-
|
|
1067
|
-
style: {
|
|
1068
|
-
color: "var(--t-text)",
|
|
1069
|
-
paddingTop: 18,
|
|
1070
|
-
paddingBottom: 18
|
|
1071
|
-
},
|
|
1068
|
+
onClick: () => a(i.id),
|
|
1069
|
+
className: "flex items-center gap-3.5 w-full py-3.5 transition-colors",
|
|
1070
|
+
style: { color: "var(--t-text)" },
|
|
1072
1071
|
children: [
|
|
1073
|
-
/* @__PURE__ */ e("span", { className: "flex items-center justify-center shrink-0", style: { width: 32, height: 32 }, children:
|
|
1074
|
-
/* @__PURE__ */
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1072
|
+
/* @__PURE__ */ e("span", { className: "flex items-center justify-center shrink-0", style: { width: 32, height: 32 }, children: vt(i.id, i.icon, 32) }),
|
|
1073
|
+
/* @__PURE__ */ o("span", { className: "text-left flex-1", children: [
|
|
1074
|
+
/* @__PURE__ */ e(
|
|
1075
|
+
"span",
|
|
1076
|
+
{
|
|
1077
|
+
className: "font-semibold text-[15px] leading-tight block",
|
|
1078
|
+
style: { color: l ? "var(--t-accent)" : "var(--t-text)" },
|
|
1079
|
+
children: d
|
|
1080
|
+
}
|
|
1081
|
+
),
|
|
1082
|
+
i.description && /* @__PURE__ */ e(
|
|
1083
|
+
"span",
|
|
1084
|
+
{
|
|
1085
|
+
className: "text-[13px] leading-tight block",
|
|
1086
|
+
style: { color: "var(--t-text-muted)" },
|
|
1087
|
+
children: i.description
|
|
1088
|
+
}
|
|
1089
|
+
)
|
|
1090
|
+
] })
|
|
1082
1091
|
]
|
|
1083
1092
|
},
|
|
1084
1093
|
i.id
|
|
1085
1094
|
);
|
|
1086
1095
|
}),
|
|
1087
|
-
|
|
1096
|
+
u.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No payment methods found" })
|
|
1088
1097
|
] })
|
|
1089
1098
|
] });
|
|
1090
1099
|
}
|
|
1091
|
-
const
|
|
1100
|
+
const tn = {
|
|
1092
1101
|
"debit-credit-card": "card",
|
|
1093
1102
|
"bank-transfer": "bank",
|
|
1094
1103
|
"apple-pay": "applepay",
|
|
1095
1104
|
"google-pay": "googlepay",
|
|
1096
1105
|
paypal: "paypal",
|
|
1097
1106
|
revolut: "revolut"
|
|
1107
|
+
}, nn = {
|
|
1108
|
+
"debit-credit-card": "Card",
|
|
1109
|
+
"bank-transfer": "Bank Transfer",
|
|
1110
|
+
"ach-bank-transfer": "ACH",
|
|
1111
|
+
"apple-pay": "Apple Pay",
|
|
1112
|
+
"google-pay": "Google Pay",
|
|
1113
|
+
"payid-bank-transfer": "PayID",
|
|
1114
|
+
paypal: "PayPal",
|
|
1115
|
+
revolut: "Revolut"
|
|
1098
1116
|
};
|
|
1099
|
-
function
|
|
1100
|
-
|
|
1101
|
-
return s ? Jt(s, n) : a ? /* @__PURE__ */ e("img", { src: a, alt: "", width: n, height: n, style: { borderRadius: "50%" } }) : /* @__PURE__ */ e($e, { size: n });
|
|
1117
|
+
function gt(t, n) {
|
|
1118
|
+
return nn[t] || n;
|
|
1102
1119
|
}
|
|
1103
|
-
function
|
|
1120
|
+
function vt(t, n, a = 24) {
|
|
1121
|
+
const r = tn[t];
|
|
1122
|
+
return r ? qt(r, a) : n ? /* @__PURE__ */ e("img", { src: n, alt: "", width: a, height: a, style: { borderRadius: "50%" } }) : /* @__PURE__ */ e($e, { size: a });
|
|
1123
|
+
}
|
|
1124
|
+
function an({
|
|
1104
1125
|
methods: t,
|
|
1105
|
-
selectedId:
|
|
1106
|
-
onSelect:
|
|
1107
|
-
fiatCurrency:
|
|
1126
|
+
selectedId: n,
|
|
1127
|
+
onSelect: a,
|
|
1128
|
+
fiatCurrency: r
|
|
1108
1129
|
}) {
|
|
1109
|
-
const [
|
|
1110
|
-
() => t.filter((
|
|
1111
|
-
[t,
|
|
1112
|
-
), i =
|
|
1113
|
-
return
|
|
1130
|
+
const [s, m] = N(!1), u = F(
|
|
1131
|
+
() => t.filter((l) => l.supportedFiats.includes(r)),
|
|
1132
|
+
[t, r]
|
|
1133
|
+
), i = u.find((l) => l.id === n) || u[0];
|
|
1134
|
+
return u.length === 0 ? /* @__PURE__ */ e(
|
|
1114
1135
|
"div",
|
|
1115
1136
|
{
|
|
1116
1137
|
className: "flex items-center justify-between px-[18px] pt-[12px] pb-[14px]",
|
|
@@ -1119,20 +1140,20 @@ function ea({
|
|
|
1119
1140
|
borderBottomLeftRadius: 5,
|
|
1120
1141
|
borderBottomRightRadius: 5
|
|
1121
1142
|
},
|
|
1122
|
-
children: /* @__PURE__ */
|
|
1143
|
+
children: /* @__PURE__ */ o("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children: [
|
|
1123
1144
|
"No payment methods available for ",
|
|
1124
|
-
|
|
1145
|
+
r
|
|
1125
1146
|
] })
|
|
1126
1147
|
}
|
|
1127
|
-
) : /* @__PURE__ */
|
|
1128
|
-
/* @__PURE__ */
|
|
1148
|
+
) : /* @__PURE__ */ o(J, { children: [
|
|
1149
|
+
/* @__PURE__ */ o(
|
|
1129
1150
|
"div",
|
|
1130
1151
|
{
|
|
1131
1152
|
role: "button",
|
|
1132
1153
|
tabIndex: 0,
|
|
1133
|
-
onClick: () =>
|
|
1134
|
-
onKeyDown: (
|
|
1135
|
-
(
|
|
1154
|
+
onClick: () => m(!0),
|
|
1155
|
+
onKeyDown: (l) => {
|
|
1156
|
+
(l.key === "Enter" || l.key === " ") && m(!0);
|
|
1136
1157
|
},
|
|
1137
1158
|
className: "flex items-center justify-between w-full px-[18px] transition-colors",
|
|
1138
1159
|
style: {
|
|
@@ -1144,51 +1165,50 @@ function ea({
|
|
|
1144
1165
|
},
|
|
1145
1166
|
children: [
|
|
1146
1167
|
/* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: "Payment method" }),
|
|
1147
|
-
/* @__PURE__ */
|
|
1148
|
-
/* @__PURE__ */ e("span", { className: "flex items-center justify-center", style: { width: 20, height: 20 }, children: i &&
|
|
1149
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children:
|
|
1168
|
+
/* @__PURE__ */ o("span", { className: "flex items-center gap-2", children: [
|
|
1169
|
+
/* @__PURE__ */ e("span", { className: "flex items-center justify-center", style: { width: 20, height: 20 }, children: i && vt(i.id, i.icon, 20) }),
|
|
1170
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: i ? gt(i.id, i.name) : "Select" }),
|
|
1150
1171
|
/* @__PURE__ */ e(ge, {})
|
|
1151
1172
|
] })
|
|
1152
1173
|
]
|
|
1153
1174
|
}
|
|
1154
1175
|
),
|
|
1155
|
-
/* @__PURE__ */ e(Le, { isOpen:
|
|
1156
|
-
|
|
1176
|
+
/* @__PURE__ */ e(Le, { isOpen: s, onClose: () => m(!1), children: (l) => /* @__PURE__ */ e(
|
|
1177
|
+
en,
|
|
1157
1178
|
{
|
|
1158
|
-
methods:
|
|
1159
|
-
selectedId:
|
|
1179
|
+
methods: u,
|
|
1180
|
+
selectedId: n,
|
|
1160
1181
|
onSelect: (d) => {
|
|
1161
|
-
|
|
1182
|
+
a(d), l();
|
|
1162
1183
|
},
|
|
1163
|
-
onClose:
|
|
1184
|
+
onClose: l
|
|
1164
1185
|
}
|
|
1165
1186
|
) })
|
|
1166
1187
|
] });
|
|
1167
1188
|
}
|
|
1168
|
-
function
|
|
1189
|
+
function rn({
|
|
1169
1190
|
className: t = "",
|
|
1170
|
-
iframeHeight: a = 600,
|
|
1171
1191
|
autoRedirect: n = !1,
|
|
1172
|
-
redirectDelay:
|
|
1192
|
+
redirectDelay: a = 3e3
|
|
1173
1193
|
}) {
|
|
1174
|
-
var
|
|
1175
|
-
const { order: r, orderStatus:
|
|
1176
|
-
if (
|
|
1177
|
-
if ((r == null ? void 0 : r.checkout.method) === "redirect" && n && !
|
|
1178
|
-
|
|
1179
|
-
const
|
|
1194
|
+
var v;
|
|
1195
|
+
const { order: r, orderStatus: s, goToStep: m, goBack: u } = pe(), [i, l] = N(!1), [d, h] = N(null), f = r != null && r.checkout.expiresAt ? Date.now() > r.checkout.expiresAt : !1;
|
|
1196
|
+
if (U(() => {
|
|
1197
|
+
if ((r == null ? void 0 : r.checkout.method) === "redirect" && n && !f) {
|
|
1198
|
+
h(Math.ceil(a / 1e3));
|
|
1199
|
+
const x = setTimeout(() => {
|
|
1180
1200
|
window.location.href = r.checkout.url;
|
|
1181
|
-
},
|
|
1182
|
-
|
|
1201
|
+
}, a), p = setInterval(() => {
|
|
1202
|
+
h((C) => C && C > 1 ? C - 1 : null);
|
|
1183
1203
|
}, 1e3);
|
|
1184
1204
|
return () => {
|
|
1185
|
-
clearTimeout(
|
|
1205
|
+
clearTimeout(x), clearInterval(p);
|
|
1186
1206
|
};
|
|
1187
1207
|
}
|
|
1188
|
-
}, [r, n,
|
|
1189
|
-
|
|
1190
|
-
}, [
|
|
1191
|
-
return /* @__PURE__ */
|
|
1208
|
+
}, [r, n, a, f]), U(() => {
|
|
1209
|
+
s && (s.status === "completed" ? m("complete") : ["failed", "cancelled", "expired"].includes(s.status) && m("error"));
|
|
1210
|
+
}, [s == null ? void 0 : s.status, m]), !r)
|
|
1211
|
+
return /* @__PURE__ */ o(
|
|
1192
1212
|
"div",
|
|
1193
1213
|
{
|
|
1194
1214
|
className: `flex flex-col items-center justify-center p-8 ${t}`,
|
|
@@ -1207,15 +1227,15 @@ function ta({
|
|
|
1207
1227
|
paddingLeft: 24,
|
|
1208
1228
|
paddingRight: 24
|
|
1209
1229
|
},
|
|
1210
|
-
onClick:
|
|
1230
|
+
onClick: u,
|
|
1211
1231
|
children: "Go Back"
|
|
1212
1232
|
}
|
|
1213
1233
|
)
|
|
1214
1234
|
]
|
|
1215
1235
|
}
|
|
1216
1236
|
);
|
|
1217
|
-
if (
|
|
1218
|
-
return /* @__PURE__ */
|
|
1237
|
+
if (f)
|
|
1238
|
+
return /* @__PURE__ */ o(
|
|
1219
1239
|
"div",
|
|
1220
1240
|
{
|
|
1221
1241
|
className: `flex flex-col items-center justify-center p-8 text-center ${t}`,
|
|
@@ -1233,49 +1253,107 @@ function ta({
|
|
|
1233
1253
|
background: "var(--t-cta-bg)",
|
|
1234
1254
|
color: "var(--t-cta-text)"
|
|
1235
1255
|
},
|
|
1236
|
-
onClick:
|
|
1256
|
+
onClick: u,
|
|
1237
1257
|
children: "Start over"
|
|
1238
1258
|
}
|
|
1239
1259
|
)
|
|
1240
1260
|
]
|
|
1241
1261
|
}
|
|
1242
1262
|
);
|
|
1243
|
-
if (r.checkout.method === "iframe")
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1263
|
+
if (r.checkout.method === "iframe") {
|
|
1264
|
+
const x = r.checkout.url, p = ((v = r.checkout.allowedFeatures) == null ? void 0 : v.join("; ")) || "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share";
|
|
1265
|
+
return lt(
|
|
1266
|
+
/* @__PURE__ */ o(
|
|
1267
|
+
"div",
|
|
1268
|
+
{
|
|
1269
|
+
style: {
|
|
1270
|
+
position: "fixed",
|
|
1271
|
+
inset: 0,
|
|
1272
|
+
zIndex: 9999,
|
|
1273
|
+
display: "flex",
|
|
1274
|
+
flexDirection: "column",
|
|
1275
|
+
background: "#000"
|
|
1276
|
+
},
|
|
1277
|
+
children: [
|
|
1278
|
+
/* @__PURE__ */ e(
|
|
1279
|
+
"div",
|
|
1280
|
+
{
|
|
1281
|
+
style: {
|
|
1282
|
+
display: "flex",
|
|
1283
|
+
alignItems: "center",
|
|
1284
|
+
height: 48,
|
|
1285
|
+
paddingLeft: 8,
|
|
1286
|
+
paddingRight: 16,
|
|
1287
|
+
background: "#111",
|
|
1288
|
+
flexShrink: 0
|
|
1289
|
+
},
|
|
1290
|
+
children: /* @__PURE__ */ o(
|
|
1291
|
+
"button",
|
|
1292
|
+
{
|
|
1293
|
+
onClick: u,
|
|
1294
|
+
style: {
|
|
1295
|
+
display: "flex",
|
|
1296
|
+
alignItems: "center",
|
|
1297
|
+
gap: 6,
|
|
1298
|
+
background: "none",
|
|
1299
|
+
border: "none",
|
|
1300
|
+
color: "#fff",
|
|
1301
|
+
fontSize: 14,
|
|
1302
|
+
fontWeight: 500,
|
|
1303
|
+
cursor: "pointer",
|
|
1304
|
+
padding: "8px 12px",
|
|
1305
|
+
borderRadius: 6
|
|
1306
|
+
},
|
|
1307
|
+
children: [
|
|
1308
|
+
/* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e("path", { d: "M10 12L6 8L10 4", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }),
|
|
1309
|
+
"Cancel"
|
|
1310
|
+
]
|
|
1311
|
+
}
|
|
1312
|
+
)
|
|
1313
|
+
}
|
|
1314
|
+
),
|
|
1315
|
+
/* @__PURE__ */ o("div", { style: { flex: 1, position: "relative", overflow: "hidden" }, children: [
|
|
1316
|
+
!i && /* @__PURE__ */ o(
|
|
1317
|
+
"div",
|
|
1318
|
+
{
|
|
1319
|
+
style: {
|
|
1320
|
+
position: "absolute",
|
|
1321
|
+
inset: 0,
|
|
1322
|
+
display: "flex",
|
|
1323
|
+
flexDirection: "column",
|
|
1324
|
+
alignItems: "center",
|
|
1325
|
+
justifyContent: "center"
|
|
1326
|
+
},
|
|
1327
|
+
children: [
|
|
1328
|
+
/* @__PURE__ */ e("div", { className: "nramp-spinner" }),
|
|
1329
|
+
/* @__PURE__ */ e("p", { style: { color: "#888", fontSize: 14, marginTop: 16 }, children: "Loading checkout..." })
|
|
1330
|
+
]
|
|
1331
|
+
}
|
|
1332
|
+
),
|
|
1333
|
+
/* @__PURE__ */ e(
|
|
1334
|
+
"iframe",
|
|
1335
|
+
{
|
|
1336
|
+
src: x,
|
|
1337
|
+
style: {
|
|
1338
|
+
display: i ? "block" : "none",
|
|
1339
|
+
width: "100%",
|
|
1340
|
+
height: "100%",
|
|
1341
|
+
border: "none"
|
|
1342
|
+
},
|
|
1343
|
+
allow: p,
|
|
1344
|
+
onLoad: () => l(!0),
|
|
1345
|
+
title: "Provider Checkout"
|
|
1346
|
+
}
|
|
1347
|
+
)
|
|
1348
|
+
] })
|
|
1349
|
+
]
|
|
1350
|
+
}
|
|
1351
|
+
),
|
|
1352
|
+
document.body
|
|
1353
|
+
);
|
|
1354
|
+
}
|
|
1277
1355
|
if (r.checkout.method === "redirect")
|
|
1278
|
-
return /* @__PURE__ */
|
|
1356
|
+
return /* @__PURE__ */ o(
|
|
1279
1357
|
"div",
|
|
1280
1358
|
{
|
|
1281
1359
|
className: `flex flex-col items-center justify-center p-8 text-center ${t}`,
|
|
@@ -1283,17 +1361,17 @@ function ta({
|
|
|
1283
1361
|
children: [
|
|
1284
1362
|
/* @__PURE__ */ e("div", { className: "text-[48px] mb-4", children: "🔗" }),
|
|
1285
1363
|
/* @__PURE__ */ e("h3", { className: "text-[18px] font-semibold mb-2", children: "Complete Payment" }),
|
|
1286
|
-
/* @__PURE__ */
|
|
1364
|
+
/* @__PURE__ */ o("p", { className: "text-[14px] mb-4", style: { color: "var(--t-text-secondary)" }, children: [
|
|
1287
1365
|
"You'll be redirected to ",
|
|
1288
1366
|
r.gateway,
|
|
1289
1367
|
" to complete your payment."
|
|
1290
1368
|
] }),
|
|
1291
|
-
|
|
1369
|
+
d !== null && /* @__PURE__ */ o("p", { className: "text-[13px] mb-4", style: { color: "var(--t-text-muted)" }, children: [
|
|
1292
1370
|
"Redirecting in ",
|
|
1293
|
-
|
|
1371
|
+
d,
|
|
1294
1372
|
"..."
|
|
1295
1373
|
] }),
|
|
1296
|
-
/* @__PURE__ */
|
|
1374
|
+
/* @__PURE__ */ o(
|
|
1297
1375
|
"a",
|
|
1298
1376
|
{
|
|
1299
1377
|
href: r.checkout.url,
|
|
@@ -1323,7 +1401,7 @@ function ta({
|
|
|
1323
1401
|
background: "var(--t-surface)",
|
|
1324
1402
|
color: "var(--t-text)"
|
|
1325
1403
|
},
|
|
1326
|
-
onClick:
|
|
1404
|
+
onClick: u,
|
|
1327
1405
|
children: "Cancel"
|
|
1328
1406
|
}
|
|
1329
1407
|
)
|
|
@@ -1331,42 +1409,98 @@ function ta({
|
|
|
1331
1409
|
}
|
|
1332
1410
|
);
|
|
1333
1411
|
if (r.checkout.method === "widget" && r.widgetConfig) {
|
|
1334
|
-
const
|
|
1335
|
-
return
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
/* @__PURE__ */ e(
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1412
|
+
const x = on(r.checkout.url, r.widgetConfig);
|
|
1413
|
+
return lt(
|
|
1414
|
+
/* @__PURE__ */ o(
|
|
1415
|
+
"div",
|
|
1416
|
+
{
|
|
1417
|
+
style: {
|
|
1418
|
+
position: "fixed",
|
|
1419
|
+
inset: 0,
|
|
1420
|
+
zIndex: 9999,
|
|
1421
|
+
display: "flex",
|
|
1422
|
+
flexDirection: "column",
|
|
1423
|
+
background: "#000"
|
|
1424
|
+
},
|
|
1425
|
+
children: [
|
|
1426
|
+
/* @__PURE__ */ e(
|
|
1427
|
+
"div",
|
|
1428
|
+
{
|
|
1429
|
+
style: {
|
|
1430
|
+
display: "flex",
|
|
1431
|
+
alignItems: "center",
|
|
1432
|
+
height: 48,
|
|
1433
|
+
paddingLeft: 8,
|
|
1434
|
+
paddingRight: 16,
|
|
1435
|
+
background: "#111",
|
|
1436
|
+
flexShrink: 0
|
|
1437
|
+
},
|
|
1438
|
+
children: /* @__PURE__ */ o(
|
|
1439
|
+
"button",
|
|
1440
|
+
{
|
|
1441
|
+
onClick: u,
|
|
1442
|
+
style: {
|
|
1443
|
+
display: "flex",
|
|
1444
|
+
alignItems: "center",
|
|
1445
|
+
gap: 6,
|
|
1446
|
+
background: "none",
|
|
1447
|
+
border: "none",
|
|
1448
|
+
color: "#fff",
|
|
1449
|
+
fontSize: 14,
|
|
1450
|
+
fontWeight: 500,
|
|
1451
|
+
cursor: "pointer",
|
|
1452
|
+
padding: "8px 12px",
|
|
1453
|
+
borderRadius: 6
|
|
1454
|
+
},
|
|
1455
|
+
children: [
|
|
1456
|
+
/* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e("path", { d: "M10 12L6 8L10 4", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }),
|
|
1457
|
+
"Cancel"
|
|
1458
|
+
]
|
|
1459
|
+
}
|
|
1460
|
+
)
|
|
1461
|
+
}
|
|
1462
|
+
),
|
|
1463
|
+
/* @__PURE__ */ o("div", { style: { flex: 1, position: "relative", overflow: "hidden" }, children: [
|
|
1464
|
+
!i && /* @__PURE__ */ o(
|
|
1465
|
+
"div",
|
|
1466
|
+
{
|
|
1467
|
+
style: {
|
|
1468
|
+
position: "absolute",
|
|
1469
|
+
inset: 0,
|
|
1470
|
+
display: "flex",
|
|
1471
|
+
flexDirection: "column",
|
|
1472
|
+
alignItems: "center",
|
|
1473
|
+
justifyContent: "center"
|
|
1474
|
+
},
|
|
1475
|
+
children: [
|
|
1476
|
+
/* @__PURE__ */ e("div", { className: "nramp-spinner" }),
|
|
1477
|
+
/* @__PURE__ */ e("p", { style: { color: "#888", fontSize: 14, marginTop: 16 }, children: "Loading checkout..." })
|
|
1478
|
+
]
|
|
1479
|
+
}
|
|
1480
|
+
),
|
|
1481
|
+
/* @__PURE__ */ e(
|
|
1482
|
+
"iframe",
|
|
1483
|
+
{
|
|
1484
|
+
src: x,
|
|
1485
|
+
style: {
|
|
1486
|
+
display: i ? "block" : "none",
|
|
1487
|
+
width: "100%",
|
|
1488
|
+
height: "100%",
|
|
1489
|
+
border: "none"
|
|
1490
|
+
},
|
|
1491
|
+
allow: "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share",
|
|
1492
|
+
onLoad: () => l(!0),
|
|
1493
|
+
title: "Payment Checkout"
|
|
1494
|
+
}
|
|
1495
|
+
)
|
|
1496
|
+
] })
|
|
1497
|
+
]
|
|
1498
|
+
}
|
|
1499
|
+
),
|
|
1500
|
+
document.body
|
|
1501
|
+
);
|
|
1368
1502
|
}
|
|
1369
|
-
return /* @__PURE__ */
|
|
1503
|
+
return /* @__PURE__ */ o(
|
|
1370
1504
|
"div",
|
|
1371
1505
|
{
|
|
1372
1506
|
className: `flex flex-col items-center justify-center p-8 ${t}`,
|
|
@@ -1385,7 +1519,7 @@ function ta({
|
|
|
1385
1519
|
paddingLeft: 24,
|
|
1386
1520
|
paddingRight: 24
|
|
1387
1521
|
},
|
|
1388
|
-
onClick:
|
|
1522
|
+
onClick: u,
|
|
1389
1523
|
children: "Go Back"
|
|
1390
1524
|
}
|
|
1391
1525
|
)
|
|
@@ -1393,20 +1527,20 @@ function ta({
|
|
|
1393
1527
|
}
|
|
1394
1528
|
);
|
|
1395
1529
|
}
|
|
1396
|
-
function
|
|
1397
|
-
const
|
|
1398
|
-
for (const [
|
|
1399
|
-
|
|
1400
|
-
return
|
|
1530
|
+
function on(t, n) {
|
|
1531
|
+
const a = new URL("/en/partner/widget", t);
|
|
1532
|
+
for (const [r, s] of Object.entries(n))
|
|
1533
|
+
s != null && s !== "" && a.searchParams.set(r, String(s));
|
|
1534
|
+
return a.toString();
|
|
1401
1535
|
}
|
|
1402
|
-
function
|
|
1403
|
-
const { orderStatus:
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
}, [
|
|
1407
|
-
const
|
|
1408
|
-
if (!
|
|
1409
|
-
switch (
|
|
1536
|
+
function ln({ className: t = "" }) {
|
|
1537
|
+
const { orderStatus: n, orderStatusLoading: a, goToStep: r } = pe();
|
|
1538
|
+
U(() => {
|
|
1539
|
+
n && (n.status === "completed" ? r("complete") : ["failed", "cancelled", "expired", "refunded"].includes(n.status) && r("error"));
|
|
1540
|
+
}, [n == null ? void 0 : n.status, r]);
|
|
1541
|
+
const s = () => {
|
|
1542
|
+
if (!n) return "Processing your order...";
|
|
1543
|
+
switch (n.status) {
|
|
1410
1544
|
case "pending":
|
|
1411
1545
|
return "Waiting for payment confirmation...";
|
|
1412
1546
|
case "processing":
|
|
@@ -1415,45 +1549,45 @@ function na({ className: t = "" }) {
|
|
|
1415
1549
|
return "Processing...";
|
|
1416
1550
|
}
|
|
1417
1551
|
};
|
|
1418
|
-
return /* @__PURE__ */
|
|
1552
|
+
return /* @__PURE__ */ o("div", { className: `flex flex-col items-center justify-center px-8 py-12 text-center ${t}`, children: [
|
|
1419
1553
|
/* @__PURE__ */ e("div", { className: "mb-6", children: /* @__PURE__ */ e("div", { className: "nramp-spinner-large nramp-spinner" }) }),
|
|
1420
|
-
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-3", style: { color: "var(--t-text)" }, children:
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
/* @__PURE__ */ e(me, { label: "Order ID", value:
|
|
1424
|
-
/* @__PURE__ */ e(me, { label: "Provider", value:
|
|
1554
|
+
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-3", style: { color: "var(--t-text)" }, children: s() }),
|
|
1555
|
+
a && /* @__PURE__ */ e("p", { className: "text-[13px] mb-4", style: { color: "var(--t-text-muted)" }, children: "Checking status..." }),
|
|
1556
|
+
n && /* @__PURE__ */ o("div", { className: "w-full mt-6 text-left", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
|
|
1557
|
+
/* @__PURE__ */ e(me, { label: "Order ID", value: n.orderId, mono: !0 }),
|
|
1558
|
+
/* @__PURE__ */ e(me, { label: "Provider", value: n.gateway }),
|
|
1425
1559
|
/* @__PURE__ */ e(
|
|
1426
1560
|
me,
|
|
1427
1561
|
{
|
|
1428
1562
|
label: "Amount",
|
|
1429
|
-
value: `${
|
|
1563
|
+
value: `${n.fiatAmount} ${n.fiatCurrency}`
|
|
1430
1564
|
}
|
|
1431
1565
|
),
|
|
1432
1566
|
/* @__PURE__ */ e(
|
|
1433
1567
|
me,
|
|
1434
1568
|
{
|
|
1435
1569
|
label: "Receiving",
|
|
1436
|
-
value: `${
|
|
1570
|
+
value: `${n.cryptoAmount || "..."} ${n.cryptoCurrency}`
|
|
1437
1571
|
}
|
|
1438
1572
|
),
|
|
1439
|
-
/* @__PURE__ */ e(me, { label: "Network", value:
|
|
1573
|
+
/* @__PURE__ */ e(me, { label: "Network", value: n.network }),
|
|
1440
1574
|
/* @__PURE__ */ e(
|
|
1441
1575
|
me,
|
|
1442
1576
|
{
|
|
1443
1577
|
label: "To Address",
|
|
1444
|
-
value: `${
|
|
1578
|
+
value: `${n.walletAddress.slice(0, 10)}...${n.walletAddress.slice(-8)}`,
|
|
1445
1579
|
mono: !0
|
|
1446
1580
|
}
|
|
1447
1581
|
)
|
|
1448
1582
|
] }),
|
|
1449
|
-
/* @__PURE__ */
|
|
1583
|
+
/* @__PURE__ */ o("div", { className: "mt-6", children: [
|
|
1450
1584
|
/* @__PURE__ */ e("p", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "This usually takes a few minutes." }),
|
|
1451
1585
|
/* @__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." })
|
|
1452
1586
|
] })
|
|
1453
1587
|
] });
|
|
1454
1588
|
}
|
|
1455
|
-
function me({ label: t, value:
|
|
1456
|
-
return /* @__PURE__ */
|
|
1589
|
+
function me({ label: t, value: n, mono: a }) {
|
|
1590
|
+
return /* @__PURE__ */ o(
|
|
1457
1591
|
"div",
|
|
1458
1592
|
{
|
|
1459
1593
|
className: "flex justify-between items-center py-2",
|
|
@@ -1463,24 +1597,24 @@ function me({ label: t, value: a, mono: n }) {
|
|
|
1463
1597
|
/* @__PURE__ */ e(
|
|
1464
1598
|
"span",
|
|
1465
1599
|
{
|
|
1466
|
-
className: `text-[13px] font-medium ${
|
|
1600
|
+
className: `text-[13px] font-medium ${a ? "font-mono" : ""}`,
|
|
1467
1601
|
style: { color: "var(--t-text)" },
|
|
1468
|
-
children:
|
|
1602
|
+
children: n
|
|
1469
1603
|
}
|
|
1470
1604
|
)
|
|
1471
1605
|
]
|
|
1472
1606
|
}
|
|
1473
1607
|
);
|
|
1474
1608
|
}
|
|
1475
|
-
function
|
|
1609
|
+
function sn({
|
|
1476
1610
|
className: t = "",
|
|
1477
|
-
explorerUrl:
|
|
1478
|
-
onDone:
|
|
1479
|
-
doneButtonText:
|
|
1611
|
+
explorerUrl: n,
|
|
1612
|
+
onDone: a,
|
|
1613
|
+
doneButtonText: r = "Done"
|
|
1480
1614
|
}) {
|
|
1481
|
-
const { orderStatus:
|
|
1482
|
-
if (!(
|
|
1483
|
-
if (!
|
|
1615
|
+
const { orderStatus: s, state: m, dispatch: u } = pe(), i = m.flowType === "sell", l = () => {
|
|
1616
|
+
if (!(s != null && s.transactionHash)) return null;
|
|
1617
|
+
if (!n) {
|
|
1484
1618
|
const f = {
|
|
1485
1619
|
ethereum: "https://etherscan.io/tx/{txHash}",
|
|
1486
1620
|
polygon: "https://polygonscan.com/tx/{txHash}",
|
|
@@ -1492,13 +1626,13 @@ function ra({
|
|
|
1492
1626
|
avalanche: "https://snowtrace.io/tx/{txHash}",
|
|
1493
1627
|
fantom: "https://ftmscan.com/tx/{txHash}"
|
|
1494
1628
|
};
|
|
1495
|
-
return (f[
|
|
1629
|
+
return (f[m.network] || f.ethereum).replace("{txHash}", s.transactionHash);
|
|
1496
1630
|
}
|
|
1497
|
-
return
|
|
1631
|
+
return n.replace("{txHash}", s.transactionHash);
|
|
1498
1632
|
}, d = () => {
|
|
1499
|
-
|
|
1500
|
-
}, h =
|
|
1501
|
-
return /* @__PURE__ */
|
|
1633
|
+
a ? a() : u({ type: "RESET" });
|
|
1634
|
+
}, h = l();
|
|
1635
|
+
return /* @__PURE__ */ o("div", { className: `flex flex-col items-center px-8 py-12 text-center ${t}`, children: [
|
|
1502
1636
|
/* @__PURE__ */ e(
|
|
1503
1637
|
"div",
|
|
1504
1638
|
{
|
|
@@ -1508,51 +1642,51 @@ function ra({
|
|
|
1508
1642
|
}
|
|
1509
1643
|
),
|
|
1510
1644
|
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: i ? "Sale Complete!" : "Purchase Complete!" }),
|
|
1511
|
-
/* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: i ? `Your ${(
|
|
1512
|
-
|
|
1645
|
+
/* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: i ? `Your ${(s == null ? void 0 : s.fiatCurrency) || m.fiatCurrency} payout is being processed.` : `Your ${(s == null ? void 0 : s.cryptoCurrency) || m.cryptoCurrency} has been sent to your wallet.` }),
|
|
1646
|
+
s && /* @__PURE__ */ o("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
|
|
1513
1647
|
/* @__PURE__ */ e(
|
|
1514
|
-
|
|
1648
|
+
ne,
|
|
1515
1649
|
{
|
|
1516
1650
|
label: i ? "Amount Sold" : "Amount Received",
|
|
1517
|
-
value: `${
|
|
1651
|
+
value: `${s.cryptoAmount} ${s.cryptoCurrency}`,
|
|
1518
1652
|
highlight: !0
|
|
1519
1653
|
}
|
|
1520
1654
|
),
|
|
1521
1655
|
/* @__PURE__ */ e(
|
|
1522
|
-
|
|
1656
|
+
ne,
|
|
1523
1657
|
{
|
|
1524
1658
|
label: i ? "Payout Amount" : "Amount Paid",
|
|
1525
|
-
value: `${
|
|
1659
|
+
value: `${s.fiatAmount} ${s.fiatCurrency}`
|
|
1526
1660
|
}
|
|
1527
1661
|
),
|
|
1528
|
-
/* @__PURE__ */ e(
|
|
1662
|
+
/* @__PURE__ */ e(ne, { label: "Network", value: s.network }),
|
|
1529
1663
|
/* @__PURE__ */ e(
|
|
1530
|
-
|
|
1664
|
+
ne,
|
|
1531
1665
|
{
|
|
1532
1666
|
label: "Wallet",
|
|
1533
|
-
value: `${
|
|
1667
|
+
value: `${s.walletAddress.slice(0, 10)}...${s.walletAddress.slice(-8)}`,
|
|
1534
1668
|
mono: !0
|
|
1535
1669
|
}
|
|
1536
1670
|
),
|
|
1537
|
-
|
|
1538
|
-
|
|
1671
|
+
s.transactionHash && /* @__PURE__ */ e(
|
|
1672
|
+
ne,
|
|
1539
1673
|
{
|
|
1540
1674
|
label: "Transaction",
|
|
1541
|
-
value: `${
|
|
1675
|
+
value: `${s.transactionHash.slice(0, 10)}...${s.transactionHash.slice(-8)}`,
|
|
1542
1676
|
mono: !0
|
|
1543
1677
|
}
|
|
1544
1678
|
),
|
|
1545
|
-
/* @__PURE__ */ e(
|
|
1546
|
-
/* @__PURE__ */ e(
|
|
1547
|
-
|
|
1548
|
-
|
|
1679
|
+
/* @__PURE__ */ e(ne, { label: "Provider", value: s.gateway }),
|
|
1680
|
+
/* @__PURE__ */ e(ne, { label: "Order ID", value: s.orderId, mono: !0 }),
|
|
1681
|
+
s.completedAt && /* @__PURE__ */ e(
|
|
1682
|
+
ne,
|
|
1549
1683
|
{
|
|
1550
1684
|
label: "Completed",
|
|
1551
|
-
value: new Date(
|
|
1685
|
+
value: new Date(s.completedAt).toLocaleString()
|
|
1552
1686
|
}
|
|
1553
1687
|
)
|
|
1554
1688
|
] }),
|
|
1555
|
-
/* @__PURE__ */
|
|
1689
|
+
/* @__PURE__ */ o("div", { className: "w-full flex flex-col gap-2", children: [
|
|
1556
1690
|
h && /* @__PURE__ */ e(
|
|
1557
1691
|
"a",
|
|
1558
1692
|
{
|
|
@@ -1570,14 +1704,14 @@ function ra({
|
|
|
1570
1704
|
className: "w-full font-semibold text-[16px] transition-all",
|
|
1571
1705
|
style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)" },
|
|
1572
1706
|
onClick: d,
|
|
1573
|
-
children:
|
|
1707
|
+
children: r
|
|
1574
1708
|
}
|
|
1575
1709
|
)
|
|
1576
1710
|
] })
|
|
1577
1711
|
] });
|
|
1578
1712
|
}
|
|
1579
|
-
function
|
|
1580
|
-
return /* @__PURE__ */
|
|
1713
|
+
function ne({ label: t, value: n, mono: a, highlight: r }) {
|
|
1714
|
+
return /* @__PURE__ */ o(
|
|
1581
1715
|
"div",
|
|
1582
1716
|
{
|
|
1583
1717
|
className: "flex justify-between items-center py-2",
|
|
@@ -1587,23 +1721,23 @@ function te({ label: t, value: a, mono: n, highlight: s }) {
|
|
|
1587
1721
|
/* @__PURE__ */ e(
|
|
1588
1722
|
"span",
|
|
1589
1723
|
{
|
|
1590
|
-
className: `text-[13px] font-medium ${
|
|
1591
|
-
style: { color:
|
|
1592
|
-
children:
|
|
1724
|
+
className: `text-[13px] font-medium ${a ? "font-mono" : ""}`,
|
|
1725
|
+
style: { color: r ? "var(--t-success, #10b981)" : "var(--t-text)" },
|
|
1726
|
+
children: n
|
|
1593
1727
|
}
|
|
1594
1728
|
)
|
|
1595
1729
|
]
|
|
1596
1730
|
}
|
|
1597
1731
|
);
|
|
1598
1732
|
}
|
|
1599
|
-
function
|
|
1733
|
+
function cn({
|
|
1600
1734
|
className: t = "",
|
|
1601
|
-
onRetry:
|
|
1602
|
-
supportEmail:
|
|
1735
|
+
onRetry: n,
|
|
1736
|
+
supportEmail: a = "support@nowramp.com"
|
|
1603
1737
|
}) {
|
|
1604
|
-
const { state:
|
|
1605
|
-
if (
|
|
1606
|
-
switch (
|
|
1738
|
+
const { state: r, orderStatus: s, dispatch: m, goToStep: u } = pe(), i = r.flowType === "sell", l = () => {
|
|
1739
|
+
if (s)
|
|
1740
|
+
switch (s.status) {
|
|
1607
1741
|
case "failed":
|
|
1608
1742
|
return "Payment Failed";
|
|
1609
1743
|
case "cancelled":
|
|
@@ -1617,9 +1751,9 @@ function oa({
|
|
|
1617
1751
|
}
|
|
1618
1752
|
return "Something Went Wrong";
|
|
1619
1753
|
}, d = () => {
|
|
1620
|
-
if (
|
|
1621
|
-
if (
|
|
1622
|
-
switch (
|
|
1754
|
+
if (r.errorMessage) return r.errorMessage;
|
|
1755
|
+
if (s)
|
|
1756
|
+
switch (s.status) {
|
|
1623
1757
|
case "failed":
|
|
1624
1758
|
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.";
|
|
1625
1759
|
case "cancelled":
|
|
@@ -1633,11 +1767,11 @@ function oa({
|
|
|
1633
1767
|
}
|
|
1634
1768
|
return "An unexpected error occurred. Please try again.";
|
|
1635
1769
|
}, h = () => {
|
|
1636
|
-
|
|
1770
|
+
m({ type: "CLEAR_ERROR" }), n ? n() : (m({ type: "RESET" }), u("amount"));
|
|
1637
1771
|
}, f = () => {
|
|
1638
|
-
|
|
1772
|
+
m({ type: "RESET" }), u("amount");
|
|
1639
1773
|
};
|
|
1640
|
-
return /* @__PURE__ */
|
|
1774
|
+
return /* @__PURE__ */ o("div", { className: `flex flex-col items-center px-8 py-12 text-center ${t}`, children: [
|
|
1641
1775
|
/* @__PURE__ */ e(
|
|
1642
1776
|
"div",
|
|
1643
1777
|
{
|
|
@@ -1646,26 +1780,26 @@ function oa({
|
|
|
1646
1780
|
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" }) })
|
|
1647
1781
|
}
|
|
1648
1782
|
),
|
|
1649
|
-
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children:
|
|
1783
|
+
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: l() }),
|
|
1650
1784
|
/* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: d() }),
|
|
1651
|
-
|
|
1652
|
-
/* @__PURE__ */
|
|
1785
|
+
s && /* @__PURE__ */ o("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
|
|
1786
|
+
/* @__PURE__ */ o("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
|
|
1653
1787
|
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Order ID" }),
|
|
1654
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium font-mono", style: { color: "var(--t-text)" }, children:
|
|
1788
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium font-mono", style: { color: "var(--t-text)" }, children: s.orderId })
|
|
1655
1789
|
] }),
|
|
1656
|
-
/* @__PURE__ */
|
|
1790
|
+
/* @__PURE__ */ o("div", { className: "flex justify-between items-center py-2", children: [
|
|
1657
1791
|
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Status" }),
|
|
1658
1792
|
/* @__PURE__ */ e(
|
|
1659
1793
|
"span",
|
|
1660
1794
|
{
|
|
1661
1795
|
className: "text-[12px] font-medium px-2 py-0.5",
|
|
1662
1796
|
style: { background: "rgba(239,68,68,0.15)", color: "#EF4444", borderRadius: 4 },
|
|
1663
|
-
children:
|
|
1797
|
+
children: s.gatewayStatus
|
|
1664
1798
|
}
|
|
1665
1799
|
)
|
|
1666
1800
|
] })
|
|
1667
1801
|
] }),
|
|
1668
|
-
/* @__PURE__ */
|
|
1802
|
+
/* @__PURE__ */ o("div", { className: "w-full flex flex-col gap-2", children: [
|
|
1669
1803
|
/* @__PURE__ */ e(
|
|
1670
1804
|
"button",
|
|
1671
1805
|
{
|
|
@@ -1685,71 +1819,71 @@ function oa({
|
|
|
1685
1819
|
}
|
|
1686
1820
|
)
|
|
1687
1821
|
] }),
|
|
1688
|
-
/* @__PURE__ */
|
|
1689
|
-
/* @__PURE__ */
|
|
1822
|
+
/* @__PURE__ */ o("div", { className: "mt-6", children: [
|
|
1823
|
+
/* @__PURE__ */ o("p", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: [
|
|
1690
1824
|
"Need help? Contact",
|
|
1691
1825
|
" ",
|
|
1692
1826
|
/* @__PURE__ */ e(
|
|
1693
1827
|
"a",
|
|
1694
1828
|
{
|
|
1695
|
-
href: `mailto:${
|
|
1829
|
+
href: `mailto:${a}`,
|
|
1696
1830
|
className: "underline",
|
|
1697
1831
|
style: { color: "var(--t-accent)" },
|
|
1698
|
-
children:
|
|
1832
|
+
children: a
|
|
1699
1833
|
}
|
|
1700
1834
|
)
|
|
1701
1835
|
] }),
|
|
1702
|
-
|
|
1836
|
+
s && /* @__PURE__ */ o("p", { className: "text-[12px] mt-1", style: { color: "var(--t-text-muted)" }, children: [
|
|
1703
1837
|
"Reference: ",
|
|
1704
|
-
|
|
1838
|
+
s.orderId
|
|
1705
1839
|
] })
|
|
1706
1840
|
] })
|
|
1707
1841
|
] });
|
|
1708
1842
|
}
|
|
1709
|
-
function
|
|
1843
|
+
function ht(t) {
|
|
1710
1844
|
return t.length <= 12 ? t : `${t.slice(0, 6)}...${t.slice(-6)}`;
|
|
1711
1845
|
}
|
|
1712
|
-
function
|
|
1846
|
+
function dn({ className: t = "" }) {
|
|
1713
1847
|
const {
|
|
1714
|
-
config:
|
|
1715
|
-
configLoading:
|
|
1716
|
-
state:
|
|
1717
|
-
defaultGateway:
|
|
1718
|
-
fetchQuotes:
|
|
1719
|
-
createOrder:
|
|
1848
|
+
config: n,
|
|
1849
|
+
configLoading: a,
|
|
1850
|
+
state: r,
|
|
1851
|
+
defaultGateway: s,
|
|
1852
|
+
fetchQuotes: m,
|
|
1853
|
+
createOrder: u,
|
|
1720
1854
|
orderLoading: i
|
|
1721
|
-
} = pe(),
|
|
1855
|
+
} = pe(), l = r.flowType === "sell", [d, h] = N(null), f = n == null ? void 0 : n.gateways.find((x) => x.id === s), v = async () => {
|
|
1722
1856
|
h(null);
|
|
1723
1857
|
try {
|
|
1724
|
-
|
|
1725
|
-
} catch (
|
|
1726
|
-
const p =
|
|
1858
|
+
m(), await u();
|
|
1859
|
+
} catch (x) {
|
|
1860
|
+
const p = x instanceof Error ? x.message : "Failed to create order";
|
|
1727
1861
|
h(p);
|
|
1728
1862
|
}
|
|
1729
1863
|
};
|
|
1730
|
-
return
|
|
1864
|
+
return a ? /* @__PURE__ */ o("div", { className: `flex flex-col items-center justify-center p-12 ${t}`, children: [
|
|
1731
1865
|
/* @__PURE__ */ e("div", { className: "nramp-spinner" }),
|
|
1732
1866
|
/* @__PURE__ */ e("p", { className: "text-[14px] mt-4", style: { color: "var(--t-text-secondary)" }, children: "Loading..." })
|
|
1733
|
-
] }) : /* @__PURE__ */
|
|
1734
|
-
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-6", style: { color: "var(--t-text)" }, children:
|
|
1735
|
-
/* @__PURE__ */
|
|
1736
|
-
f && /* @__PURE__ */
|
|
1867
|
+
] }) : /* @__PURE__ */ o("div", { className: `flex flex-col items-center px-8 py-12 ${t}`, children: [
|
|
1868
|
+
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-6", style: { color: "var(--t-text)" }, children: l ? "Confirm Sale" : "Confirm Purchase" }),
|
|
1869
|
+
/* @__PURE__ */ o("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
|
|
1870
|
+
f && /* @__PURE__ */ o("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
|
|
1737
1871
|
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Provider" }),
|
|
1738
|
-
/* @__PURE__ */
|
|
1872
|
+
/* @__PURE__ */ o("span", { className: "flex items-center gap-2", children: [
|
|
1739
1873
|
f.logo && /* @__PURE__ */ e("img", { src: f.logo, alt: f.name, width: 20, height: 20, style: { borderRadius: 4 } }),
|
|
1740
1874
|
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: f.name })
|
|
1741
1875
|
] })
|
|
1742
1876
|
] }),
|
|
1743
|
-
|
|
1744
|
-
/* @__PURE__ */ e(
|
|
1745
|
-
/* @__PURE__ */ e(
|
|
1746
|
-
] }) : /* @__PURE__ */
|
|
1747
|
-
/* @__PURE__ */ e(
|
|
1748
|
-
/* @__PURE__ */ e(
|
|
1749
|
-
/* @__PURE__ */ e(
|
|
1877
|
+
l ? /* @__PURE__ */ o(J, { children: [
|
|
1878
|
+
/* @__PURE__ */ e(se, { label: "You sell", value: `${r.cryptoAmount} ${r.cryptoCurrency}`, highlight: !0 }),
|
|
1879
|
+
/* @__PURE__ */ e(se, { label: "You receive", value: `${r.fiatCurrency} payout` })
|
|
1880
|
+
] }) : /* @__PURE__ */ o(J, { children: [
|
|
1881
|
+
/* @__PURE__ */ e(se, { label: "You pay", value: `${r.fiatAmount} ${r.fiatCurrency}`, highlight: !0 }),
|
|
1882
|
+
/* @__PURE__ */ e(se, { label: "You receive", value: `${r.cryptoCurrency} on ${r.network}` }),
|
|
1883
|
+
/* @__PURE__ */ e(se, { label: "Wallet", value: ht(r.walletAddress), mono: !0 })
|
|
1750
1884
|
] }),
|
|
1751
|
-
/* @__PURE__ */ e(
|
|
1752
|
-
|
|
1885
|
+
/* @__PURE__ */ e(se, { label: "Network", value: r.network }),
|
|
1886
|
+
l && r.walletAddress && /* @__PURE__ */ e(se, { label: "Refund address", value: ht(r.walletAddress), mono: !0 })
|
|
1753
1887
|
] }),
|
|
1754
1888
|
d && /* @__PURE__ */ e("p", { className: "text-[12px] mb-4", style: { color: "#EF4444" }, children: d }),
|
|
1755
1889
|
/* @__PURE__ */ e(
|
|
@@ -1758,68 +1892,68 @@ function la({ className: t = "" }) {
|
|
|
1758
1892
|
className: "w-full font-semibold text-[16px] transition-all flex items-center justify-center gap-2",
|
|
1759
1893
|
style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)", opacity: i ? 0.7 : 1 },
|
|
1760
1894
|
disabled: i,
|
|
1761
|
-
onClick:
|
|
1762
|
-
children: i ? /* @__PURE__ */
|
|
1895
|
+
onClick: v,
|
|
1896
|
+
children: i ? /* @__PURE__ */ o(J, { children: [
|
|
1763
1897
|
/* @__PURE__ */ e("span", { className: "nramp-spinner-inline" }),
|
|
1764
1898
|
"Processing..."
|
|
1765
|
-
] }) :
|
|
1899
|
+
] }) : l ? "Confirm & Sell" : "Confirm & Pay"
|
|
1766
1900
|
}
|
|
1767
1901
|
)
|
|
1768
1902
|
] });
|
|
1769
1903
|
}
|
|
1770
|
-
function
|
|
1771
|
-
return /* @__PURE__ */
|
|
1904
|
+
function se({ label: t, value: n, mono: a, highlight: r }) {
|
|
1905
|
+
return /* @__PURE__ */ o("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
|
|
1772
1906
|
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: t }),
|
|
1773
1907
|
/* @__PURE__ */ e(
|
|
1774
1908
|
"span",
|
|
1775
1909
|
{
|
|
1776
|
-
className: `text-[13px] font-medium ${
|
|
1777
|
-
style: { color:
|
|
1778
|
-
children:
|
|
1910
|
+
className: `text-[13px] font-medium ${a ? "font-mono" : ""}`,
|
|
1911
|
+
style: { color: r ? "var(--t-success, #10b981)" : "var(--t-text)" },
|
|
1912
|
+
children: n
|
|
1779
1913
|
}
|
|
1780
1914
|
)
|
|
1781
1915
|
] });
|
|
1782
1916
|
}
|
|
1783
|
-
function
|
|
1784
|
-
const
|
|
1785
|
-
return
|
|
1917
|
+
function un({ char: t, height: n = 38 }) {
|
|
1918
|
+
const a = "0123456789", r = a.indexOf(t);
|
|
1919
|
+
return r === -1 ? /* @__PURE__ */ e("span", { children: t }) : /* @__PURE__ */ e("span", { className: "digit-slot", style: { height: n, lineHeight: `${n}px` }, children: /* @__PURE__ */ e("span", { className: "digit-slot-inner block", style: { transform: `translateY(-${r * n}px)` }, children: a.split("").map((s) => /* @__PURE__ */ e("span", { className: "block", style: { height: n, lineHeight: `${n}px` }, children: s }, s)) }) });
|
|
1786
1920
|
}
|
|
1787
|
-
function
|
|
1921
|
+
function mn({
|
|
1788
1922
|
value: t,
|
|
1789
|
-
height:
|
|
1790
|
-
className:
|
|
1791
|
-
style:
|
|
1923
|
+
height: n = 38,
|
|
1924
|
+
className: a = "",
|
|
1925
|
+
style: r = {}
|
|
1792
1926
|
}) {
|
|
1793
|
-
return /* @__PURE__ */ e("span", { className:
|
|
1927
|
+
return /* @__PURE__ */ e("span", { className: a, style: { display: "inline-flex", ...r }, children: t.split("").map((s, m) => /* @__PURE__ */ e(un, { char: s, height: n }, m)) });
|
|
1794
1928
|
}
|
|
1795
1929
|
function M({
|
|
1796
1930
|
w: t,
|
|
1797
|
-
h:
|
|
1798
|
-
className:
|
|
1931
|
+
h: n,
|
|
1932
|
+
className: a = ""
|
|
1799
1933
|
}) {
|
|
1800
|
-
return /* @__PURE__ */ e("div", { className: `skeleton ${
|
|
1934
|
+
return /* @__PURE__ */ e("div", { className: `skeleton ${a}`, style: { width: t, height: n } });
|
|
1801
1935
|
}
|
|
1802
|
-
function
|
|
1803
|
-
return /* @__PURE__ */
|
|
1804
|
-
/* @__PURE__ */
|
|
1936
|
+
function pn() {
|
|
1937
|
+
return /* @__PURE__ */ o("div", { className: "flex-1 px-5 flex flex-col", children: [
|
|
1938
|
+
/* @__PURE__ */ o("div", { className: "px-[18px] pt-[14px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5 }, children: [
|
|
1805
1939
|
/* @__PURE__ */ e(M, { w: 70, h: 14, className: "mb-3" }),
|
|
1806
|
-
/* @__PURE__ */
|
|
1940
|
+
/* @__PURE__ */ o("div", { className: "flex justify-between items-center", children: [
|
|
1807
1941
|
/* @__PURE__ */ e(M, { w: 120, h: 32 }),
|
|
1808
1942
|
/* @__PURE__ */ e(M, { w: 75, h: 32 })
|
|
1809
1943
|
] })
|
|
1810
1944
|
] }),
|
|
1811
|
-
/* @__PURE__ */
|
|
1945
|
+
/* @__PURE__ */ o("div", { className: "px-[18px] pt-[12px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5, marginTop: 4 }, children: [
|
|
1812
1946
|
/* @__PURE__ */ e(M, { w: 50, h: 14, className: "mb-3" }),
|
|
1813
|
-
/* @__PURE__ */
|
|
1947
|
+
/* @__PURE__ */ o("div", { className: "flex justify-between items-center", children: [
|
|
1814
1948
|
/* @__PURE__ */ e(M, { w: 180, h: 32 }),
|
|
1815
1949
|
/* @__PURE__ */ e(M, { w: 85, h: 32 })
|
|
1816
1950
|
] })
|
|
1817
1951
|
] }),
|
|
1818
|
-
/* @__PURE__ */
|
|
1952
|
+
/* @__PURE__ */ o("div", { className: "flex justify-between mt-3 px-[2px]", children: [
|
|
1819
1953
|
/* @__PURE__ */ e(M, { w: 140, h: 12 }),
|
|
1820
1954
|
/* @__PURE__ */ e(M, { w: 90, h: 12 })
|
|
1821
1955
|
] }),
|
|
1822
|
-
/* @__PURE__ */
|
|
1956
|
+
/* @__PURE__ */ o("div", { className: "mt-8", children: [
|
|
1823
1957
|
/* @__PURE__ */ e(M, { w: 65, h: 14, className: "mb-2.5" }),
|
|
1824
1958
|
/* @__PURE__ */ e(M, { w: "100%", h: 47 })
|
|
1825
1959
|
] }),
|
|
@@ -1828,21 +1962,21 @@ function ia() {
|
|
|
1828
1962
|
/* @__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" }) })
|
|
1829
1963
|
] });
|
|
1830
1964
|
}
|
|
1831
|
-
function
|
|
1832
|
-
const [
|
|
1833
|
-
if (!
|
|
1834
|
-
const
|
|
1835
|
-
return
|
|
1965
|
+
function hn({ onClose: t, onSelect: n, currencies: a, assetBaseUrl: r = "" }) {
|
|
1966
|
+
const [s, m] = N(""), u = F(() => {
|
|
1967
|
+
if (!a || a.length === 0) return ct;
|
|
1968
|
+
const l = new Map(ct.map((d) => [d.code, d.name]));
|
|
1969
|
+
return a.map((d) => ({
|
|
1836
1970
|
code: d.code,
|
|
1837
|
-
name: d.name ||
|
|
1971
|
+
name: d.name || l.get(d.code) || d.code
|
|
1838
1972
|
}));
|
|
1839
|
-
}, [
|
|
1840
|
-
const
|
|
1841
|
-
return
|
|
1842
|
-
(d) => d.code.toLowerCase().includes(
|
|
1843
|
-
) :
|
|
1844
|
-
}, [
|
|
1845
|
-
return /* @__PURE__ */
|
|
1973
|
+
}, [a]), i = F(() => {
|
|
1974
|
+
const l = s.trim().toLowerCase();
|
|
1975
|
+
return l ? u.filter(
|
|
1976
|
+
(d) => d.code.toLowerCase().includes(l) || d.name.toLowerCase().includes(l)
|
|
1977
|
+
) : u;
|
|
1978
|
+
}, [u, s]);
|
|
1979
|
+
return /* @__PURE__ */ o(J, { children: [
|
|
1846
1980
|
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ve, { onClick: t }) }),
|
|
1847
1981
|
/* @__PURE__ */ e(
|
|
1848
1982
|
"h2",
|
|
@@ -1852,63 +1986,63 @@ function da({ onClose: t, onSelect: a, currencies: n, assetBaseUrl: s = "" }) {
|
|
|
1852
1986
|
children: "Select fiat currency"
|
|
1853
1987
|
}
|
|
1854
1988
|
),
|
|
1855
|
-
/* @__PURE__ */ e(Be, { value:
|
|
1856
|
-
/* @__PURE__ */
|
|
1857
|
-
i.map((
|
|
1989
|
+
/* @__PURE__ */ e(Be, { value: s, onChange: m }),
|
|
1990
|
+
/* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
|
|
1991
|
+
i.map((l) => /* @__PURE__ */ o(
|
|
1858
1992
|
"button",
|
|
1859
1993
|
{
|
|
1860
|
-
onClick: () =>
|
|
1994
|
+
onClick: () => n(l.code),
|
|
1861
1995
|
className: "flex items-center gap-3.5 w-full py-3.5 transition-colors",
|
|
1862
1996
|
style: { color: "var(--t-text)" },
|
|
1863
1997
|
children: [
|
|
1864
|
-
/* @__PURE__ */ e(Xe, { currencyCode:
|
|
1865
|
-
/* @__PURE__ */
|
|
1866
|
-
/* @__PURE__ */ e("div", { className: "font-semibold text-[15px] leading-tight", children:
|
|
1867
|
-
/* @__PURE__ */ e("div", { className: "text-[13px] mt-0.5", style: { color: "var(--t-text-secondary)" }, children:
|
|
1998
|
+
/* @__PURE__ */ e(Xe, { currencyCode: l.code, size: 32, baseUrl: r }),
|
|
1999
|
+
/* @__PURE__ */ o("div", { className: "text-left", children: [
|
|
2000
|
+
/* @__PURE__ */ e("div", { className: "font-semibold text-[15px] leading-tight", children: l.code }),
|
|
2001
|
+
/* @__PURE__ */ e("div", { className: "text-[13px] mt-0.5", style: { color: "var(--t-text-secondary)" }, children: l.name })
|
|
1868
2002
|
] })
|
|
1869
2003
|
]
|
|
1870
2004
|
},
|
|
1871
|
-
|
|
2005
|
+
l.code
|
|
1872
2006
|
)),
|
|
1873
2007
|
i.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No currencies found" })
|
|
1874
2008
|
] })
|
|
1875
2009
|
] });
|
|
1876
2010
|
}
|
|
1877
|
-
function
|
|
1878
|
-
const [
|
|
1879
|
-
if (!
|
|
1880
|
-
const
|
|
1881
|
-
for (const d of
|
|
2011
|
+
function fn({ onClose: t, onSelect: n, cryptos: a, assetBaseUrl: r = "" }) {
|
|
2012
|
+
const [s, m] = N(""), u = F(() => {
|
|
2013
|
+
if (!a || a.length === 0) return $t;
|
|
2014
|
+
const l = [];
|
|
2015
|
+
for (const d of a) {
|
|
1882
2016
|
const h = d.networks || [];
|
|
1883
2017
|
if (h.length === 0)
|
|
1884
|
-
|
|
2018
|
+
l.push({ code: d.code, name: d.name || d.code, chain: d.code, popular: !1 });
|
|
1885
2019
|
else
|
|
1886
2020
|
for (const f of h) {
|
|
1887
|
-
const
|
|
1888
|
-
|
|
2021
|
+
const v = f.code || f.id || f.name || d.code;
|
|
2022
|
+
l.push({
|
|
1889
2023
|
code: d.code,
|
|
1890
2024
|
name: d.name || d.code,
|
|
1891
|
-
chain:
|
|
2025
|
+
chain: v,
|
|
1892
2026
|
chainName: f.name,
|
|
1893
2027
|
popular: !1
|
|
1894
2028
|
});
|
|
1895
2029
|
}
|
|
1896
2030
|
}
|
|
1897
|
-
return
|
|
1898
|
-
}, [
|
|
2031
|
+
return l;
|
|
2032
|
+
}, [a]), i = F(() => {
|
|
1899
2033
|
var f;
|
|
1900
|
-
const
|
|
1901
|
-
if (!
|
|
1902
|
-
const d =
|
|
1903
|
-
for (const
|
|
1904
|
-
const
|
|
1905
|
-
if (!d.every((
|
|
1906
|
-
let
|
|
1907
|
-
P ===
|
|
2034
|
+
const l = s.trim().toLowerCase();
|
|
2035
|
+
if (!l) return u;
|
|
2036
|
+
const d = l.split(/\s+/), h = [];
|
|
2037
|
+
for (const v of u) {
|
|
2038
|
+
const x = Ie[v.chain], p = x ? x.name.toLowerCase() : "", C = ((f = x == null ? void 0 : x.shortName) == null ? void 0 : f.toLowerCase()) || "", L = v.chain.toLowerCase(), P = v.code.toLowerCase(), S = v.name.toLowerCase(), j = [P, S, p, C, L];
|
|
2039
|
+
if (!d.every((q) => j.some((c) => c.includes(q)))) continue;
|
|
2040
|
+
let W = 0;
|
|
2041
|
+
P === l ? W += 100 : P.startsWith(d[0]) && (W += 50), v.popular && (W += 10), d.length > 1 && (p.includes(d[1]) || C.includes(d[1]) || L.includes(d[1])) && (W += 25), h.push({ item: v, score: W });
|
|
1908
2042
|
}
|
|
1909
|
-
return h.sort((
|
|
1910
|
-
}, [
|
|
1911
|
-
return /* @__PURE__ */
|
|
2043
|
+
return h.sort((v, x) => x.score - v.score), h.map((v) => v.item);
|
|
2044
|
+
}, [u, s]);
|
|
2045
|
+
return /* @__PURE__ */ o(J, { children: [
|
|
1912
2046
|
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ve, { onClick: t }) }),
|
|
1913
2047
|
/* @__PURE__ */ e(
|
|
1914
2048
|
"h2",
|
|
@@ -1918,22 +2052,22 @@ function ua({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: s = "" }) {
|
|
|
1918
2052
|
children: "Select crypto currency"
|
|
1919
2053
|
}
|
|
1920
2054
|
),
|
|
1921
|
-
/* @__PURE__ */ e(Be, { value:
|
|
1922
|
-
/* @__PURE__ */
|
|
1923
|
-
i.map((
|
|
1924
|
-
const d = Ie[
|
|
1925
|
-
return /* @__PURE__ */
|
|
2055
|
+
/* @__PURE__ */ e(Be, { value: s, onChange: m }),
|
|
2056
|
+
/* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
|
|
2057
|
+
i.map((l) => {
|
|
2058
|
+
const d = Ie[l.chain], h = (d == null ? void 0 : d.name) || l.chainName || l.chain;
|
|
2059
|
+
return /* @__PURE__ */ o(
|
|
1926
2060
|
"button",
|
|
1927
2061
|
{
|
|
1928
|
-
onClick: () =>
|
|
2062
|
+
onClick: () => n(l.code, l.chain),
|
|
1929
2063
|
className: "flex items-center gap-3.5 w-full py-3.5 transition-colors",
|
|
1930
2064
|
children: [
|
|
1931
|
-
/* @__PURE__ */
|
|
2065
|
+
/* @__PURE__ */ o("div", { className: "relative shrink-0", style: { width: 40, height: 40 }, children: [
|
|
1932
2066
|
/* @__PURE__ */ e(
|
|
1933
2067
|
"img",
|
|
1934
2068
|
{
|
|
1935
|
-
src:
|
|
1936
|
-
alt:
|
|
2069
|
+
src: xt(l.code, r),
|
|
2070
|
+
alt: l.code,
|
|
1937
2071
|
width: 32,
|
|
1938
2072
|
height: 32,
|
|
1939
2073
|
className: "rounded-full absolute top-0 left-0",
|
|
@@ -1943,8 +2077,8 @@ function ua({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: s = "" }) {
|
|
|
1943
2077
|
/* @__PURE__ */ e(
|
|
1944
2078
|
"img",
|
|
1945
2079
|
{
|
|
1946
|
-
src: _e(
|
|
1947
|
-
alt:
|
|
2080
|
+
src: _e(l.chain, r),
|
|
2081
|
+
alt: l.chain,
|
|
1948
2082
|
width: 16,
|
|
1949
2083
|
height: 16,
|
|
1950
2084
|
className: "rounded-full absolute",
|
|
@@ -1958,42 +2092,42 @@ function ua({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: s = "" }) {
|
|
|
1958
2092
|
}
|
|
1959
2093
|
)
|
|
1960
2094
|
] }),
|
|
1961
|
-
/* @__PURE__ */
|
|
2095
|
+
/* @__PURE__ */ o("div", { className: "text-left flex-1 min-w-0", children: [
|
|
1962
2096
|
/* @__PURE__ */ e(
|
|
1963
2097
|
"div",
|
|
1964
2098
|
{
|
|
1965
2099
|
className: "font-semibold text-[15px] leading-tight",
|
|
1966
2100
|
style: { color: "var(--t-text)" },
|
|
1967
|
-
children:
|
|
2101
|
+
children: l.code
|
|
1968
2102
|
}
|
|
1969
2103
|
),
|
|
1970
|
-
/* @__PURE__ */ e("div", { className: "text-[13px] mt-0.5", style: { color: "var(--t-text-secondary)" }, children:
|
|
2104
|
+
/* @__PURE__ */ e("div", { className: "text-[13px] mt-0.5", style: { color: "var(--t-text-secondary)" }, children: l.name })
|
|
1971
2105
|
] }),
|
|
1972
2106
|
/* @__PURE__ */ e("div", { className: "text-right shrink-0", children: /* @__PURE__ */ e("div", { className: "text-[13px]", style: { color: "var(--t-text-muted)" }, children: h }) })
|
|
1973
2107
|
]
|
|
1974
2108
|
},
|
|
1975
|
-
`${
|
|
2109
|
+
`${l.code}-${l.chain}`
|
|
1976
2110
|
);
|
|
1977
2111
|
}),
|
|
1978
2112
|
i.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No currencies found" })
|
|
1979
2113
|
] })
|
|
1980
2114
|
] });
|
|
1981
2115
|
}
|
|
1982
|
-
function
|
|
2116
|
+
function yn({
|
|
1983
2117
|
checked: t,
|
|
1984
|
-
onChange:
|
|
1985
|
-
accentColor:
|
|
2118
|
+
onChange: n,
|
|
2119
|
+
accentColor: a = "var(--t-accent)"
|
|
1986
2120
|
}) {
|
|
1987
2121
|
return /* @__PURE__ */ e(
|
|
1988
2122
|
"button",
|
|
1989
2123
|
{
|
|
1990
|
-
onClick: () =>
|
|
2124
|
+
onClick: () => n(!t),
|
|
1991
2125
|
className: "relative shrink-0 transition-colors duration-200",
|
|
1992
2126
|
style: {
|
|
1993
2127
|
width: 48,
|
|
1994
2128
|
height: 28,
|
|
1995
2129
|
borderRadius: 14,
|
|
1996
|
-
backgroundColor: t ?
|
|
2130
|
+
backgroundColor: t ? a : "var(--t-border)"
|
|
1997
2131
|
},
|
|
1998
2132
|
children: /* @__PURE__ */ e(
|
|
1999
2133
|
"div",
|
|
@@ -2009,23 +2143,23 @@ function ma({
|
|
|
2009
2143
|
}
|
|
2010
2144
|
);
|
|
2011
2145
|
}
|
|
2012
|
-
const
|
|
2146
|
+
const xn = [
|
|
2013
2147
|
{ label: "Privacy policy", href: "https://nowramp.com/privacy-policy" },
|
|
2014
2148
|
{ label: "Terms of use", href: "https://nowramp.com/terms-and-conditions" }
|
|
2015
2149
|
];
|
|
2016
|
-
function
|
|
2150
|
+
function gn({
|
|
2017
2151
|
onClose: t,
|
|
2018
|
-
darkMode:
|
|
2019
|
-
onToggleDarkMode:
|
|
2020
|
-
skinId:
|
|
2021
|
-
onSelectSkin:
|
|
2152
|
+
darkMode: n,
|
|
2153
|
+
onToggleDarkMode: a,
|
|
2154
|
+
skinId: r,
|
|
2155
|
+
onSelectSkin: s
|
|
2022
2156
|
}) {
|
|
2023
|
-
return /* @__PURE__ */
|
|
2157
|
+
return /* @__PURE__ */ o(J, { children: [
|
|
2024
2158
|
/* @__PURE__ */ e("div", { className: "flex justify-end items-center px-5 pt-5", children: /* @__PURE__ */ e(ve, { onClick: t }) }),
|
|
2025
|
-
/* @__PURE__ */
|
|
2026
|
-
/* @__PURE__ */ e("div", { style: { borderTop: "1px solid var(--t-divider)" }, children: /* @__PURE__ */
|
|
2027
|
-
/* @__PURE__ */
|
|
2028
|
-
/* @__PURE__ */ e(
|
|
2159
|
+
/* @__PURE__ */ o("div", { className: "px-5 flex-1 pt-6 overflow-y-auto custom-scroll", children: [
|
|
2160
|
+
/* @__PURE__ */ e("div", { style: { borderTop: "1px solid var(--t-divider)" }, children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between w-full py-5", children: [
|
|
2161
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-3.5", children: [
|
|
2162
|
+
/* @__PURE__ */ e(Jt, { size: 40 }),
|
|
2029
2163
|
/* @__PURE__ */ e(
|
|
2030
2164
|
"span",
|
|
2031
2165
|
{
|
|
@@ -2035,14 +2169,14 @@ function ha({
|
|
|
2035
2169
|
}
|
|
2036
2170
|
)
|
|
2037
2171
|
] }),
|
|
2038
|
-
/* @__PURE__ */ e(
|
|
2172
|
+
/* @__PURE__ */ e(yn, { checked: n, onChange: a, accentColor: "#4CD964" })
|
|
2039
2173
|
] }) }),
|
|
2040
2174
|
/* @__PURE__ */ e("div", { style: { height: 1, background: "var(--t-divider)" } }),
|
|
2041
|
-
|
|
2042
|
-
/* @__PURE__ */
|
|
2175
|
+
xn.map((m) => /* @__PURE__ */ o("div", { children: [
|
|
2176
|
+
/* @__PURE__ */ o(
|
|
2043
2177
|
"a",
|
|
2044
2178
|
{
|
|
2045
|
-
href:
|
|
2179
|
+
href: m.href,
|
|
2046
2180
|
target: "_blank",
|
|
2047
2181
|
rel: "noopener noreferrer",
|
|
2048
2182
|
className: "flex items-center justify-between w-full py-5 transition-colors",
|
|
@@ -2052,190 +2186,190 @@ function ha({
|
|
|
2052
2186
|
{
|
|
2053
2187
|
className: "font-medium text-[15px]",
|
|
2054
2188
|
style: { color: "var(--t-text)" },
|
|
2055
|
-
children:
|
|
2189
|
+
children: m.label
|
|
2056
2190
|
}
|
|
2057
2191
|
),
|
|
2058
|
-
/* @__PURE__ */ e(
|
|
2192
|
+
/* @__PURE__ */ e(Zt, {})
|
|
2059
2193
|
]
|
|
2060
2194
|
}
|
|
2061
2195
|
),
|
|
2062
2196
|
/* @__PURE__ */ e("div", { style: { height: 1, background: "var(--t-divider)" } })
|
|
2063
|
-
] },
|
|
2197
|
+
] }, m.label))
|
|
2064
2198
|
] })
|
|
2065
2199
|
] });
|
|
2066
2200
|
}
|
|
2067
|
-
function
|
|
2201
|
+
function vn({
|
|
2068
2202
|
className: t = "",
|
|
2069
|
-
theme:
|
|
2070
|
-
skinId:
|
|
2071
|
-
accentColor:
|
|
2072
|
-
bgColor:
|
|
2073
|
-
bgImage:
|
|
2074
|
-
borderColor:
|
|
2203
|
+
theme: n = "dark",
|
|
2204
|
+
skinId: a = "mono",
|
|
2205
|
+
accentColor: r,
|
|
2206
|
+
bgColor: s,
|
|
2207
|
+
bgImage: m,
|
|
2208
|
+
borderColor: u,
|
|
2075
2209
|
borderRadius: i,
|
|
2076
|
-
showFlowToggle:
|
|
2210
|
+
showFlowToggle: l = !0,
|
|
2077
2211
|
autoRedirect: d = !1,
|
|
2078
2212
|
explorerUrl: h,
|
|
2079
2213
|
doneButtonText: f = "Done",
|
|
2080
|
-
supportEmail:
|
|
2081
|
-
onDone:
|
|
2214
|
+
supportEmail: v,
|
|
2215
|
+
onDone: x
|
|
2082
2216
|
}) {
|
|
2083
|
-
var
|
|
2217
|
+
var Je, qe, et, tt, nt, at, rt, ot;
|
|
2084
2218
|
const {
|
|
2085
2219
|
state: p,
|
|
2086
|
-
dispatch:
|
|
2087
|
-
config:
|
|
2220
|
+
dispatch: C,
|
|
2221
|
+
config: L,
|
|
2088
2222
|
configLoading: P,
|
|
2089
|
-
quotes:
|
|
2090
|
-
quotesLoading:
|
|
2223
|
+
quotes: S,
|
|
2224
|
+
quotesLoading: j,
|
|
2091
2225
|
quotesError: Q,
|
|
2092
|
-
fetchQuotes:
|
|
2093
|
-
createOrder:
|
|
2226
|
+
fetchQuotes: W,
|
|
2227
|
+
createOrder: q,
|
|
2094
2228
|
orderLoading: c,
|
|
2095
2229
|
amountError: O,
|
|
2096
|
-
fieldLocks:
|
|
2097
|
-
apiConfig:
|
|
2098
|
-
assetBaseUrl:
|
|
2099
|
-
} = pe(), [
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
}, [
|
|
2230
|
+
fieldLocks: b,
|
|
2231
|
+
apiConfig: k,
|
|
2232
|
+
assetBaseUrl: _
|
|
2233
|
+
} = pe(), [$, G] = N(n === "dark"), [Ne, he] = N(a), [fe, Y] = N(null), [ye, ae] = N(!1), [Ce, ce] = N(!1), [ie, be] = N(!1), [V, re] = N(null), [oe, Ee] = N(!0), [Ae, Se] = N(!1), [ee, de] = N(!1), Oe = K(null), xe = K(), g = K(p.flowType);
|
|
2234
|
+
U(() => {
|
|
2235
|
+
G(n === "dark");
|
|
2236
|
+
}, [n]), U(() => {
|
|
2103
2237
|
const y = setTimeout(() => Ee(!1), P ? 0 : 800);
|
|
2104
2238
|
return () => clearTimeout(y);
|
|
2105
|
-
}, [P]),
|
|
2106
|
-
if (
|
|
2107
|
-
|
|
2108
|
-
const y = setTimeout(() =>
|
|
2239
|
+
}, [P]), U(() => {
|
|
2240
|
+
if (g.current !== p.flowType && !oe) {
|
|
2241
|
+
g.current = p.flowType, Se(!0), ae(!1), ce(!1);
|
|
2242
|
+
const y = setTimeout(() => Se(!1), 350);
|
|
2109
2243
|
return () => clearTimeout(y);
|
|
2110
2244
|
}
|
|
2111
|
-
|
|
2112
|
-
}, [p.flowType,
|
|
2113
|
-
const E = p.flowType,
|
|
2114
|
-
|
|
2115
|
-
const
|
|
2116
|
-
if (
|
|
2117
|
-
const y =
|
|
2245
|
+
g.current = p.flowType;
|
|
2246
|
+
}, [p.flowType, oe]);
|
|
2247
|
+
const E = p.flowType, T = E === "buy", R = p.cryptoCurrency || "BTC", w = p.fiatCurrency || "USD", D = T ? p.fiatAmount : p.cryptoAmount, H = Xt(D), Z = (Je = S == null ? void 0 : S.bestQuote) != null && Je.exchangeRate ? parseFloat(S.bestQuote.exchangeRate) : null, we = K(null);
|
|
2248
|
+
Z && R && w && (we.current = { rate: Z, crypto: R, fiat: w });
|
|
2249
|
+
const Nt = F(() => {
|
|
2250
|
+
if (S != null && S.bestQuote) {
|
|
2251
|
+
const y = T ? S.bestQuote.cryptoAmount : S.bestQuote.fiatAmount;
|
|
2118
2252
|
if (y) return y;
|
|
2119
2253
|
}
|
|
2120
2254
|
return "0";
|
|
2121
|
-
}, [
|
|
2122
|
-
var B,
|
|
2123
|
-
const y =
|
|
2255
|
+
}, [S, T]), Ct = F(() => {
|
|
2256
|
+
var B, te, He;
|
|
2257
|
+
const y = Z || ((B = we.current) == null ? void 0 : B.rate), A = Z ? R : (te = we.current) == null ? void 0 : te.crypto, I = Z ? w : (He = we.current) == null ? void 0 : He.fiat;
|
|
2124
2258
|
return !y || !A || !I ? "" : `1 ${A} ≈ ${y.toFixed(2)} ${I}`;
|
|
2125
|
-
}, [
|
|
2126
|
-
|
|
2259
|
+
}, [R, w, Z]);
|
|
2260
|
+
U(() => {
|
|
2127
2261
|
const y = p.walletAddress.trim(), A = p.network;
|
|
2128
2262
|
if (!y || y.length < 10) {
|
|
2129
|
-
|
|
2263
|
+
re(null), C({ type: "SET_WALLET_ERROR", message: "" });
|
|
2130
2264
|
return;
|
|
2131
2265
|
}
|
|
2132
|
-
return be(!0),
|
|
2133
|
-
var I, B,
|
|
2266
|
+
return be(!0), re(null), clearTimeout(xe.current), xe.current = setTimeout(async () => {
|
|
2267
|
+
var I, B, te;
|
|
2134
2268
|
try {
|
|
2135
|
-
const Ue = await (await fetch(`${
|
|
2269
|
+
const Ue = await (await fetch(`${k.apiUrl}/public/validate/address`, {
|
|
2136
2270
|
method: "POST",
|
|
2137
2271
|
headers: { "Content-Type": "application/json" },
|
|
2138
2272
|
body: JSON.stringify({ address: y, ...A ? { network: A } : {} })
|
|
2139
2273
|
})).json(), Ke = ((I = Ue.data) == null ? void 0 : I.attributes) || Ue.data || Ue;
|
|
2140
2274
|
if (Ke.isValid)
|
|
2141
|
-
|
|
2275
|
+
re(!0), C({ type: "SET_WALLET_ERROR", message: "" });
|
|
2142
2276
|
else {
|
|
2143
|
-
|
|
2144
|
-
const
|
|
2145
|
-
|
|
2277
|
+
re(!1);
|
|
2278
|
+
const kt = ((B = Ke.errors) == null ? void 0 : B[0]) || ((te = Ke.details) == null ? void 0 : te.formatMessage) || "Invalid wallet address";
|
|
2279
|
+
C({ type: "SET_WALLET_ERROR", message: kt });
|
|
2146
2280
|
}
|
|
2147
2281
|
} catch {
|
|
2148
|
-
|
|
2282
|
+
re(null);
|
|
2149
2283
|
} finally {
|
|
2150
2284
|
be(!1);
|
|
2151
2285
|
}
|
|
2152
2286
|
}, 500), () => clearTimeout(xe.current);
|
|
2153
|
-
}, [p.walletAddress, p.network,
|
|
2154
|
-
const Ge = !D ||
|
|
2287
|
+
}, [p.walletAddress, p.network, k.apiUrl]);
|
|
2288
|
+
const Ge = !D || H === 0, je = H > 0 && (T ? H < ut : H < mt), We = !!O || je || ye && Ge, bt = H > 0 && !O && !je, Pe = p.walletAddress.trim().length >= 10 && V !== !1 && !ie, Re = bt && Pe && !!p.cryptoCurrency && !!p.network, Et = (y) => {
|
|
2155
2289
|
let A = y.target.value.replace(/[^0-9.,]/g, "");
|
|
2156
|
-
const I =
|
|
2157
|
-
B !== -1 && A.length - B - 1 > I && (A = A.slice(0, B + I + 1)),
|
|
2158
|
-
},
|
|
2159
|
-
y !== E &&
|
|
2160
|
-
},
|
|
2290
|
+
const I = T ? 2 : 6, B = A.indexOf(".");
|
|
2291
|
+
B !== -1 && A.length - B - 1 > I && (A = A.slice(0, B + I + 1)), C(T ? { type: "SET_FIAT_AMOUNT", amount: A } : { type: "SET_CRYPTO_AMOUNT", amount: A });
|
|
2292
|
+
}, Ye = (y) => {
|
|
2293
|
+
y !== E && C({ type: "SET_FLOW_TYPE", flowType: y });
|
|
2294
|
+
}, At = X(
|
|
2161
2295
|
(y) => {
|
|
2162
|
-
|
|
2296
|
+
C({ type: "SET_FIAT_CURRENCY", currency: y });
|
|
2163
2297
|
},
|
|
2164
|
-
[
|
|
2165
|
-
),
|
|
2298
|
+
[C]
|
|
2299
|
+
), St = X(
|
|
2166
2300
|
(y, A) => {
|
|
2167
|
-
|
|
2301
|
+
C({ type: "SET_CRYPTO_CURRENCY", currency: y }), C({ type: "SET_CRYPTO_CHAIN", chain: A });
|
|
2168
2302
|
},
|
|
2169
|
-
[
|
|
2170
|
-
),
|
|
2303
|
+
[C]
|
|
2304
|
+
), wt = X(
|
|
2171
2305
|
(y) => {
|
|
2172
|
-
|
|
2306
|
+
C({ type: "SET_PAYMENT_METHOD", methodId: y });
|
|
2173
2307
|
},
|
|
2174
|
-
[
|
|
2175
|
-
),
|
|
2176
|
-
Re && (
|
|
2308
|
+
[C]
|
|
2309
|
+
), Rt = () => {
|
|
2310
|
+
Re && (de(!0), W());
|
|
2177
2311
|
};
|
|
2178
|
-
|
|
2312
|
+
U(() => {
|
|
2179
2313
|
var y;
|
|
2180
|
-
if (!(!
|
|
2181
|
-
if (
|
|
2182
|
-
|
|
2314
|
+
if (!(!ee || j)) {
|
|
2315
|
+
if (S != null && S.bestQuote)
|
|
2316
|
+
de(!1), C({ type: "SELECT_QUOTE", quote: S.bestQuote }), q().catch(() => {
|
|
2183
2317
|
});
|
|
2184
2318
|
else if (Q)
|
|
2185
|
-
|
|
2186
|
-
else if (
|
|
2187
|
-
|
|
2188
|
-
const A = (y =
|
|
2189
|
-
|
|
2319
|
+
de(!1), C({ type: "SET_ERROR", message: Q.message || "No quotes available" });
|
|
2320
|
+
else if (S && !S.bestQuote) {
|
|
2321
|
+
de(!1);
|
|
2322
|
+
const A = (y = S.unavailableGateways) == null ? void 0 : y.map((B) => B.reason).filter(Boolean), I = A != null && A.length ? `No providers available: ${A.join("; ")}` : "No providers available for this currency/network combination";
|
|
2323
|
+
C({ type: "SET_ERROR", message: I });
|
|
2190
2324
|
}
|
|
2191
2325
|
}
|
|
2192
|
-
}, [
|
|
2193
|
-
const
|
|
2194
|
-
"--t-accent":
|
|
2195
|
-
"--t-cta-bg":
|
|
2196
|
-
"--t-cta-text":
|
|
2326
|
+
}, [ee, S, j, Q, C, q]);
|
|
2327
|
+
const Ve = $ ? "theme-dark" : "theme-light", De = it.find((y) => y.id === Ne) || it[0], Tt = De.accent === null, Qe = (r ? Fe(r) : !1) ? { "--t-accent": r, "--t-cta-bg": r, "--t-cta-text": "#ffffff" } : Tt ? {
|
|
2328
|
+
"--t-accent": $ ? "#ffffff" : "#111111",
|
|
2329
|
+
"--t-cta-bg": $ ? "#ffffff" : "#111111",
|
|
2330
|
+
"--t-cta-text": $ ? "#000000" : "#ffffff"
|
|
2197
2331
|
} : {
|
|
2198
2332
|
"--t-accent": De.accent,
|
|
2199
2333
|
"--t-cta-bg": De.accent,
|
|
2200
2334
|
"--t-cta-text": "#ffffff"
|
|
2201
|
-
},
|
|
2202
|
-
|
|
2335
|
+
}, le = {};
|
|
2336
|
+
s && Fe(s) ? le.backgroundColor = s : le.backgroundColor = "var(--t-bg)", m && (le.backgroundImage = `url(${m})`, le.backgroundSize = "cover", le.backgroundPosition = "center");
|
|
2203
2337
|
const Te = {};
|
|
2204
|
-
|
|
2205
|
-
const Ze = p.step === "checkout" ? /* @__PURE__ */ e(
|
|
2338
|
+
u && Fe(u) && (Te.border = `1px solid ${u}`), i && (Te.borderRadius = i);
|
|
2339
|
+
const Ze = p.step === "checkout" ? /* @__PURE__ */ e(rn, { autoRedirect: d }) : p.step === "processing" ? /* @__PURE__ */ e(ln, {}) : p.step === "complete" ? /* @__PURE__ */ e(sn, { explorerUrl: h, doneButtonText: f, onDone: x }) : p.step === "error" ? /* @__PURE__ */ e(cn, { supportEmail: v }) : p.step === "confirm" ? /* @__PURE__ */ e(dn, {}) : null;
|
|
2206
2340
|
if (Ze)
|
|
2207
2341
|
return /* @__PURE__ */ e(
|
|
2208
2342
|
"div",
|
|
2209
2343
|
{
|
|
2210
|
-
className: `${
|
|
2344
|
+
className: `${Ve} relative w-full max-w-[390px] h-[640px] overflow-hidden flex flex-col select-none transition-colors duration-300 ${t}`,
|
|
2211
2345
|
style: {
|
|
2212
2346
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
2213
|
-
...
|
|
2347
|
+
...le,
|
|
2214
2348
|
...Qe,
|
|
2215
2349
|
...Te
|
|
2216
2350
|
},
|
|
2217
2351
|
children: Ze
|
|
2218
2352
|
}
|
|
2219
2353
|
);
|
|
2220
|
-
const
|
|
2221
|
-
return /* @__PURE__ */
|
|
2354
|
+
const z = p.network, ue = z ? Ie[z] : null, ze = (ue == null ? void 0 : ue.shortName) || (ue == null ? void 0 : ue.name) || z;
|
|
2355
|
+
return /* @__PURE__ */ o(
|
|
2222
2356
|
"div",
|
|
2223
2357
|
{
|
|
2224
|
-
className: `${
|
|
2358
|
+
className: `${Ve} relative w-full max-w-[390px] min-h-[640px] overflow-hidden flex flex-col select-none transition-colors duration-300 ${t}`,
|
|
2225
2359
|
style: {
|
|
2226
2360
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
2227
|
-
...
|
|
2361
|
+
...le,
|
|
2228
2362
|
...Qe,
|
|
2229
2363
|
...Te
|
|
2230
2364
|
},
|
|
2231
2365
|
children: [
|
|
2232
|
-
/* @__PURE__ */ e("div", { className: `flex justify-end items-center px-5 pt-3 ${
|
|
2233
|
-
|
|
2234
|
-
/* @__PURE__ */
|
|
2366
|
+
/* @__PURE__ */ e("div", { className: `flex justify-end items-center px-5 pt-3 ${l ? "pb-1" : "pb-5"}`, children: /* @__PURE__ */ e(zt, { onClick: () => Y("settings") }) }),
|
|
2367
|
+
l ? /* @__PURE__ */ o("div", { className: "flex flex-col items-center pt-3 pb-5", children: [
|
|
2368
|
+
/* @__PURE__ */ o("div", { className: "flex", style: { width: 165 }, children: [
|
|
2235
2369
|
/* @__PURE__ */ e(
|
|
2236
2370
|
"button",
|
|
2237
2371
|
{
|
|
2238
|
-
onClick: () =>
|
|
2372
|
+
onClick: () => Ye("buy"),
|
|
2239
2373
|
className: "flex-1 pb-2.5 text-[16px] font-medium text-center transition-colors duration-200",
|
|
2240
2374
|
style: { color: E === "buy" ? "var(--t-text)" : "var(--t-text-secondary)" },
|
|
2241
2375
|
children: "Buy"
|
|
@@ -2244,14 +2378,14 @@ function fa({
|
|
|
2244
2378
|
/* @__PURE__ */ e(
|
|
2245
2379
|
"button",
|
|
2246
2380
|
{
|
|
2247
|
-
onClick: () =>
|
|
2381
|
+
onClick: () => Ye("sell"),
|
|
2248
2382
|
className: "flex-1 pb-2.5 text-[16px] font-medium text-center transition-colors duration-200",
|
|
2249
2383
|
style: { color: E === "sell" ? "var(--t-text)" : "var(--t-text-secondary)" },
|
|
2250
2384
|
children: "Sell"
|
|
2251
2385
|
}
|
|
2252
2386
|
)
|
|
2253
2387
|
] }),
|
|
2254
|
-
/* @__PURE__ */
|
|
2388
|
+
/* @__PURE__ */ o("div", { className: "relative", style: { width: 165, height: 1 }, children: [
|
|
2255
2389
|
/* @__PURE__ */ e("div", { className: "absolute inset-0", style: { background: "var(--t-divider)" } }),
|
|
2256
2390
|
/* @__PURE__ */ e(
|
|
2257
2391
|
"div",
|
|
@@ -2266,38 +2400,38 @@ function fa({
|
|
|
2266
2400
|
)
|
|
2267
2401
|
] })
|
|
2268
2402
|
] }) : null,
|
|
2269
|
-
|
|
2270
|
-
/* @__PURE__ */
|
|
2403
|
+
oe || Ae || P ? /* @__PURE__ */ e(pn, {}) : /* @__PURE__ */ o("div", { className: "flex-1 overflow-hidden px-5 flex flex-col tab-fade-in", children: [
|
|
2404
|
+
/* @__PURE__ */ o(
|
|
2271
2405
|
"div",
|
|
2272
2406
|
{
|
|
2273
2407
|
className: "px-[18px] pt-[14px] pb-[18px]",
|
|
2274
2408
|
style: {
|
|
2275
2409
|
background: "var(--t-surface)",
|
|
2276
2410
|
borderRadius: 5,
|
|
2277
|
-
border: ye &&
|
|
2411
|
+
border: ye && We ? "1px solid #EF4444" : "1px solid transparent"
|
|
2278
2412
|
},
|
|
2279
2413
|
children: [
|
|
2280
2414
|
/* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: "You spend" }),
|
|
2281
|
-
/* @__PURE__ */
|
|
2415
|
+
/* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
2282
2416
|
/* @__PURE__ */ e(
|
|
2283
2417
|
"input",
|
|
2284
2418
|
{
|
|
2285
2419
|
ref: Oe,
|
|
2286
2420
|
type: "text",
|
|
2287
2421
|
value: D,
|
|
2288
|
-
onChange:
|
|
2422
|
+
onChange: Et,
|
|
2289
2423
|
onBlur: () => ae(!0),
|
|
2290
|
-
placeholder:
|
|
2424
|
+
placeholder: T ? "250" : "0.01",
|
|
2291
2425
|
className: "bg-transparent outline-none w-0 flex-1 mr-3",
|
|
2292
2426
|
style: { color: "var(--t-text)", fontSize: 24, fontWeight: 600, lineHeight: "32px" },
|
|
2293
2427
|
inputMode: "decimal",
|
|
2294
|
-
disabled: !!((qe =
|
|
2428
|
+
disabled: !!((qe = b == null ? void 0 : b.sourceAmount) != null && qe.locked)
|
|
2295
2429
|
}
|
|
2296
2430
|
),
|
|
2297
|
-
|
|
2431
|
+
T ? /* @__PURE__ */ o(
|
|
2298
2432
|
"button",
|
|
2299
2433
|
{
|
|
2300
|
-
onClick: () =>
|
|
2434
|
+
onClick: () => Y("fiat"),
|
|
2301
2435
|
className: "flex items-center gap-1.5 shrink-0 transition-colors",
|
|
2302
2436
|
style: {
|
|
2303
2437
|
background: "var(--t-pill-bg)",
|
|
@@ -2306,18 +2440,18 @@ function fa({
|
|
|
2306
2440
|
paddingLeft: 10,
|
|
2307
2441
|
paddingRight: 10
|
|
2308
2442
|
},
|
|
2309
|
-
disabled: !!((et =
|
|
2443
|
+
disabled: !!((et = b == null ? void 0 : b.sourceCurrency) != null && et.locked),
|
|
2310
2444
|
children: [
|
|
2311
|
-
/* @__PURE__ */ e(Xe, { currencyCode:
|
|
2312
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children:
|
|
2445
|
+
/* @__PURE__ */ e(Xe, { currencyCode: w, size: 16, baseUrl: _ }),
|
|
2446
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: w }),
|
|
2313
2447
|
/* @__PURE__ */ e(ge, {})
|
|
2314
2448
|
]
|
|
2315
2449
|
}
|
|
2316
|
-
) : /* @__PURE__ */
|
|
2317
|
-
/* @__PURE__ */
|
|
2450
|
+
) : /* @__PURE__ */ o("div", { className: "flex flex-col items-end shrink-0", children: [
|
|
2451
|
+
/* @__PURE__ */ o(
|
|
2318
2452
|
"button",
|
|
2319
2453
|
{
|
|
2320
|
-
onClick: () =>
|
|
2454
|
+
onClick: () => Y("crypto"),
|
|
2321
2455
|
className: "flex items-center gap-1.5 transition-colors",
|
|
2322
2456
|
style: {
|
|
2323
2457
|
background: "var(--t-pill-bg)",
|
|
@@ -2326,35 +2460,35 @@ function fa({
|
|
|
2326
2460
|
paddingLeft: 10,
|
|
2327
2461
|
paddingRight: 10
|
|
2328
2462
|
},
|
|
2329
|
-
disabled: !!((tt =
|
|
2463
|
+
disabled: !!((tt = b == null ? void 0 : b.destinationCurrency) != null && tt.locked),
|
|
2330
2464
|
children: [
|
|
2331
|
-
/* @__PURE__ */ e(
|
|
2332
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children:
|
|
2465
|
+
/* @__PURE__ */ e(pt, { ticker: R, size: 16, baseUrl: _ }),
|
|
2466
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: R }),
|
|
2333
2467
|
/* @__PURE__ */ e(ge, {})
|
|
2334
2468
|
]
|
|
2335
2469
|
}
|
|
2336
2470
|
),
|
|
2337
|
-
|
|
2471
|
+
z && /* @__PURE__ */ o("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
|
|
2338
2472
|
/* @__PURE__ */ e(
|
|
2339
2473
|
"img",
|
|
2340
2474
|
{
|
|
2341
|
-
src: _e(
|
|
2342
|
-
alt:
|
|
2475
|
+
src: _e(z, _),
|
|
2476
|
+
alt: z,
|
|
2343
2477
|
width: 14,
|
|
2344
2478
|
height: 14,
|
|
2345
2479
|
className: "rounded-full",
|
|
2346
2480
|
style: { width: 14, height: 14 }
|
|
2347
2481
|
}
|
|
2348
2482
|
),
|
|
2349
|
-
/* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children:
|
|
2483
|
+
/* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children: ze })
|
|
2350
2484
|
] })
|
|
2351
2485
|
] })
|
|
2352
2486
|
] })
|
|
2353
2487
|
]
|
|
2354
2488
|
}
|
|
2355
2489
|
),
|
|
2356
|
-
ye &&
|
|
2357
|
-
/* @__PURE__ */
|
|
2490
|
+
ye && We && /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5 px-[2px]", style: { color: "#EF4444" }, children: O || (Ge ? "Amount should be more than 0" : T ? `Minimum amount is ${ut} ${w}` : `Minimum amount is ${mt} ${R}`) }),
|
|
2491
|
+
/* @__PURE__ */ o(
|
|
2358
2492
|
"div",
|
|
2359
2493
|
{
|
|
2360
2494
|
className: "px-[18px] pt-[12px] pb-[14px]",
|
|
@@ -2368,21 +2502,21 @@ function fa({
|
|
|
2368
2502
|
},
|
|
2369
2503
|
children: [
|
|
2370
2504
|
/* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: "You get" }),
|
|
2371
|
-
/* @__PURE__ */
|
|
2372
|
-
|
|
2373
|
-
|
|
2505
|
+
/* @__PURE__ */ o("div", { className: "flex items-start justify-between", children: [
|
|
2506
|
+
j ? /* @__PURE__ */ e(M, { w: 180, h: 32 }) : /* @__PURE__ */ e(
|
|
2507
|
+
mn,
|
|
2374
2508
|
{
|
|
2375
|
-
value:
|
|
2509
|
+
value: H > 0 ? Nt : "0",
|
|
2376
2510
|
height: 32,
|
|
2377
2511
|
className: "font-semibold",
|
|
2378
|
-
style: { color:
|
|
2512
|
+
style: { color: H > 0 ? "var(--t-text)" : "var(--t-text-muted)", fontSize: 24 }
|
|
2379
2513
|
}
|
|
2380
2514
|
),
|
|
2381
|
-
|
|
2382
|
-
/* @__PURE__ */
|
|
2515
|
+
T ? /* @__PURE__ */ o("div", { className: "flex flex-col items-end shrink-0", children: [
|
|
2516
|
+
/* @__PURE__ */ o(
|
|
2383
2517
|
"button",
|
|
2384
2518
|
{
|
|
2385
|
-
onClick: () =>
|
|
2519
|
+
onClick: () => Y("crypto"),
|
|
2386
2520
|
className: "flex items-center gap-1.5 transition-colors",
|
|
2387
2521
|
style: {
|
|
2388
2522
|
background: "var(--t-pill-bg)",
|
|
@@ -2391,32 +2525,32 @@ function fa({
|
|
|
2391
2525
|
paddingLeft: 10,
|
|
2392
2526
|
paddingRight: 10
|
|
2393
2527
|
},
|
|
2394
|
-
disabled: !!((
|
|
2528
|
+
disabled: !!((nt = b == null ? void 0 : b.destinationCurrency) != null && nt.locked),
|
|
2395
2529
|
children: [
|
|
2396
|
-
/* @__PURE__ */ e(
|
|
2397
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children:
|
|
2530
|
+
/* @__PURE__ */ e(pt, { ticker: R, size: 16, baseUrl: _ }),
|
|
2531
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: R }),
|
|
2398
2532
|
/* @__PURE__ */ e(ge, {})
|
|
2399
2533
|
]
|
|
2400
2534
|
}
|
|
2401
2535
|
),
|
|
2402
|
-
|
|
2536
|
+
z && /* @__PURE__ */ o("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
|
|
2403
2537
|
/* @__PURE__ */ e(
|
|
2404
2538
|
"img",
|
|
2405
2539
|
{
|
|
2406
|
-
src: _e(
|
|
2407
|
-
alt:
|
|
2540
|
+
src: _e(z, _),
|
|
2541
|
+
alt: z,
|
|
2408
2542
|
width: 14,
|
|
2409
2543
|
height: 14,
|
|
2410
2544
|
className: "rounded-full",
|
|
2411
2545
|
style: { width: 14, height: 14 }
|
|
2412
2546
|
}
|
|
2413
2547
|
),
|
|
2414
|
-
/* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children:
|
|
2548
|
+
/* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children: ze })
|
|
2415
2549
|
] })
|
|
2416
|
-
] }) : /* @__PURE__ */
|
|
2550
|
+
] }) : /* @__PURE__ */ o(
|
|
2417
2551
|
"button",
|
|
2418
2552
|
{
|
|
2419
|
-
onClick: () =>
|
|
2553
|
+
onClick: () => Y("fiat"),
|
|
2420
2554
|
className: "flex items-center gap-1.5 shrink-0 transition-colors",
|
|
2421
2555
|
style: {
|
|
2422
2556
|
background: "var(--t-pill-bg)",
|
|
@@ -2425,10 +2559,10 @@ function fa({
|
|
|
2425
2559
|
paddingLeft: 10,
|
|
2426
2560
|
paddingRight: 10
|
|
2427
2561
|
},
|
|
2428
|
-
disabled: !!((
|
|
2562
|
+
disabled: !!((at = b == null ? void 0 : b.sourceCurrency) != null && at.locked),
|
|
2429
2563
|
children: [
|
|
2430
|
-
/* @__PURE__ */ e(Xe, { currencyCode:
|
|
2431
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children:
|
|
2564
|
+
/* @__PURE__ */ e(Xe, { currencyCode: w, size: 16, baseUrl: _ }),
|
|
2565
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: w }),
|
|
2432
2566
|
/* @__PURE__ */ e(ge, {})
|
|
2433
2567
|
]
|
|
2434
2568
|
}
|
|
@@ -2443,30 +2577,30 @@ function fa({
|
|
|
2443
2577
|
className: "flex items-center justify-between mt-[2px] px-[18px] pt-[12px] pb-[14px]",
|
|
2444
2578
|
style: {
|
|
2445
2579
|
background: "var(--t-surface)",
|
|
2446
|
-
...(rt =
|
|
2580
|
+
...(rt = L == null ? void 0 : L.paymentMethods) != null && rt.length ? {} : { borderBottomLeftRadius: 5, borderBottomRightRadius: 5 }
|
|
2447
2581
|
},
|
|
2448
|
-
children: /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children:
|
|
2582
|
+
children: /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: Ct || " " })
|
|
2449
2583
|
}
|
|
2450
2584
|
),
|
|
2451
|
-
(
|
|
2452
|
-
|
|
2585
|
+
(L == null ? void 0 : L.paymentMethods) && L.paymentMethods.length > 0 && /* @__PURE__ */ e("div", { className: "mt-[2px]", children: /* @__PURE__ */ e(
|
|
2586
|
+
an,
|
|
2453
2587
|
{
|
|
2454
|
-
methods:
|
|
2588
|
+
methods: L.paymentMethods,
|
|
2455
2589
|
selectedId: p.paymentMethodId,
|
|
2456
|
-
onSelect:
|
|
2590
|
+
onSelect: wt,
|
|
2457
2591
|
fiatCurrency: p.fiatCurrency
|
|
2458
2592
|
}
|
|
2459
2593
|
) }),
|
|
2460
|
-
/* @__PURE__ */
|
|
2461
|
-
/* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children:
|
|
2594
|
+
/* @__PURE__ */ o("div", { className: "mt-8", children: [
|
|
2595
|
+
/* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: T ? "Receiving wallet address" : "Sending wallet address" }),
|
|
2462
2596
|
/* @__PURE__ */ e(
|
|
2463
2597
|
"input",
|
|
2464
2598
|
{
|
|
2465
2599
|
type: "text",
|
|
2466
2600
|
value: p.walletAddress,
|
|
2467
|
-
onChange: (y) =>
|
|
2468
|
-
onBlur: () =>
|
|
2469
|
-
placeholder:
|
|
2601
|
+
onChange: (y) => C({ type: "SET_WALLET_ADDRESS", address: y.target.value }),
|
|
2602
|
+
onBlur: () => ce(!0),
|
|
2603
|
+
placeholder: T ? "Enter your receiving address" : "Enter your sending address",
|
|
2470
2604
|
spellCheck: !1,
|
|
2471
2605
|
autoComplete: "off",
|
|
2472
2606
|
className: "w-full bg-transparent text-[13px] outline-none transition-colors",
|
|
@@ -2478,72 +2612,72 @@ function fa({
|
|
|
2478
2612
|
paddingRight: 14,
|
|
2479
2613
|
color: "var(--t-text)"
|
|
2480
2614
|
},
|
|
2481
|
-
disabled: !!((ot =
|
|
2615
|
+
disabled: !!((ot = b == null ? void 0 : b.destinationAddress) != null && ot.locked)
|
|
2482
2616
|
}
|
|
2483
2617
|
),
|
|
2484
|
-
p.walletError ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: p.walletError }) : Ce && !Pe && !
|
|
2618
|
+
p.walletError ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: p.walletError }) : Ce && !Pe && !ie ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: "Enter a valid wallet address" }) : ie && p.walletAddress.trim().length >= 10 ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "var(--t-text-muted)" }, children: "Validating address..." }) : null
|
|
2485
2619
|
] }),
|
|
2486
2620
|
/* @__PURE__ */ e("div", { className: "flex-1" }),
|
|
2487
2621
|
/* @__PURE__ */ e(
|
|
2488
2622
|
"button",
|
|
2489
2623
|
{
|
|
2490
|
-
disabled: !Re || c ||
|
|
2491
|
-
onClick:
|
|
2624
|
+
disabled: !Re || c || ee,
|
|
2625
|
+
onClick: Rt,
|
|
2492
2626
|
className: "w-full font-semibold text-[16px] transition-all",
|
|
2493
2627
|
style: {
|
|
2494
2628
|
height: 60,
|
|
2495
2629
|
borderRadius: 5,
|
|
2496
2630
|
background: "var(--t-cta-bg)",
|
|
2497
2631
|
color: "var(--t-cta-text)",
|
|
2498
|
-
opacity: Re && !c && !
|
|
2499
|
-
cursor: Re && !c && !
|
|
2632
|
+
opacity: Re && !c && !ee ? 1 : 0.4,
|
|
2633
|
+
cursor: Re && !c && !ee ? "pointer" : "not-allowed"
|
|
2500
2634
|
},
|
|
2501
|
-
children:
|
|
2635
|
+
children: ee ? "Getting best price..." : c ? "Processing..." : T ? `Buy ${R}` : `Sell ${R}`
|
|
2502
2636
|
}
|
|
2503
2637
|
),
|
|
2504
2638
|
/* @__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" }) })
|
|
2505
2639
|
] }, E),
|
|
2506
|
-
/* @__PURE__ */ e(Le, { isOpen: fe === "fiat", onClose: () =>
|
|
2640
|
+
/* @__PURE__ */ e(Le, { isOpen: fe === "fiat", onClose: () => Y(null), children: (y) => {
|
|
2507
2641
|
var A;
|
|
2508
2642
|
return /* @__PURE__ */ e(
|
|
2509
|
-
|
|
2643
|
+
hn,
|
|
2510
2644
|
{
|
|
2511
2645
|
onClose: y,
|
|
2512
2646
|
onSelect: (I) => {
|
|
2513
|
-
|
|
2647
|
+
At(I), y();
|
|
2514
2648
|
},
|
|
2515
|
-
currencies: (A =
|
|
2516
|
-
assetBaseUrl:
|
|
2649
|
+
currencies: (A = L == null ? void 0 : L.fiats) == null ? void 0 : A.map((I) => ({ code: I.code, name: I.code })),
|
|
2650
|
+
assetBaseUrl: _
|
|
2517
2651
|
}
|
|
2518
2652
|
);
|
|
2519
2653
|
} }),
|
|
2520
|
-
/* @__PURE__ */ e(Le, { isOpen: fe === "crypto", onClose: () =>
|
|
2654
|
+
/* @__PURE__ */ e(Le, { isOpen: fe === "crypto", onClose: () => Y(null), children: (y) => {
|
|
2521
2655
|
var A;
|
|
2522
2656
|
return /* @__PURE__ */ e(
|
|
2523
|
-
|
|
2657
|
+
fn,
|
|
2524
2658
|
{
|
|
2525
2659
|
onClose: y,
|
|
2526
2660
|
onSelect: (I, B) => {
|
|
2527
|
-
|
|
2661
|
+
St(I, B), y();
|
|
2528
2662
|
},
|
|
2529
|
-
cryptos: (A =
|
|
2663
|
+
cryptos: (A = L == null ? void 0 : L.cryptos) == null ? void 0 : A.map((I) => {
|
|
2530
2664
|
var B;
|
|
2531
2665
|
return {
|
|
2532
2666
|
code: I.code,
|
|
2533
2667
|
name: I.code,
|
|
2534
|
-
networks: (B = I.networks) == null ? void 0 : B.map((
|
|
2668
|
+
networks: (B = I.networks) == null ? void 0 : B.map((te) => ({ code: te.id, name: te.name }))
|
|
2535
2669
|
};
|
|
2536
2670
|
}),
|
|
2537
|
-
assetBaseUrl:
|
|
2671
|
+
assetBaseUrl: _
|
|
2538
2672
|
}
|
|
2539
2673
|
);
|
|
2540
2674
|
} }),
|
|
2541
|
-
/* @__PURE__ */ e(Le, { isOpen: fe === "settings", onClose: () =>
|
|
2542
|
-
|
|
2675
|
+
/* @__PURE__ */ e(Le, { isOpen: fe === "settings", onClose: () => Y(null), children: (y) => /* @__PURE__ */ e(
|
|
2676
|
+
gn,
|
|
2543
2677
|
{
|
|
2544
2678
|
onClose: y,
|
|
2545
|
-
darkMode:
|
|
2546
|
-
onToggleDarkMode:
|
|
2679
|
+
darkMode: $,
|
|
2680
|
+
onToggleDarkMode: G,
|
|
2547
2681
|
skinId: Ne,
|
|
2548
2682
|
onSelectSkin: (A) => {
|
|
2549
2683
|
he(A);
|
|
@@ -2554,109 +2688,109 @@ function fa({
|
|
|
2554
2688
|
}
|
|
2555
2689
|
);
|
|
2556
2690
|
}
|
|
2557
|
-
function
|
|
2691
|
+
function Nn({
|
|
2558
2692
|
projectId: t,
|
|
2559
|
-
apiUrl:
|
|
2560
|
-
assetBaseUrl:
|
|
2561
|
-
flowType:
|
|
2562
|
-
customerId:
|
|
2563
|
-
defaultFiatCurrency:
|
|
2564
|
-
defaultCryptoCurrency:
|
|
2693
|
+
apiUrl: n,
|
|
2694
|
+
assetBaseUrl: a,
|
|
2695
|
+
flowType: r,
|
|
2696
|
+
customerId: s,
|
|
2697
|
+
defaultFiatCurrency: m,
|
|
2698
|
+
defaultCryptoCurrency: u,
|
|
2565
2699
|
defaultNetwork: i,
|
|
2566
|
-
defaultFiatAmount:
|
|
2700
|
+
defaultFiatAmount: l,
|
|
2567
2701
|
defaultCryptoAmount: d,
|
|
2568
2702
|
defaultWalletAddress: h,
|
|
2569
2703
|
defaultGateway: f,
|
|
2570
|
-
fieldLocks:
|
|
2571
|
-
statusPollInterval:
|
|
2704
|
+
fieldLocks: v,
|
|
2705
|
+
statusPollInterval: x,
|
|
2572
2706
|
onComplete: p,
|
|
2573
|
-
onError:
|
|
2574
|
-
className:
|
|
2707
|
+
onError: C,
|
|
2708
|
+
className: L,
|
|
2575
2709
|
theme: P,
|
|
2576
|
-
skinId:
|
|
2577
|
-
accentColor:
|
|
2710
|
+
skinId: S,
|
|
2711
|
+
accentColor: j,
|
|
2578
2712
|
bgColor: Q,
|
|
2579
|
-
bgImage:
|
|
2580
|
-
borderColor:
|
|
2713
|
+
bgImage: W,
|
|
2714
|
+
borderColor: q,
|
|
2581
2715
|
borderRadius: c,
|
|
2582
2716
|
showFlowToggle: O,
|
|
2583
|
-
autoRedirect:
|
|
2584
|
-
explorerUrl:
|
|
2585
|
-
doneButtonText:
|
|
2586
|
-
supportEmail:
|
|
2587
|
-
onDone:
|
|
2717
|
+
autoRedirect: b,
|
|
2718
|
+
explorerUrl: k,
|
|
2719
|
+
doneButtonText: _,
|
|
2720
|
+
supportEmail: $,
|
|
2721
|
+
onDone: G
|
|
2588
2722
|
}) {
|
|
2589
2723
|
return /* @__PURE__ */ e(
|
|
2590
|
-
|
|
2724
|
+
Ut,
|
|
2591
2725
|
{
|
|
2592
2726
|
projectId: t,
|
|
2593
|
-
apiUrl:
|
|
2594
|
-
assetBaseUrl:
|
|
2595
|
-
flowType:
|
|
2596
|
-
customerId:
|
|
2597
|
-
defaultFiatCurrency:
|
|
2598
|
-
defaultCryptoCurrency:
|
|
2727
|
+
apiUrl: n,
|
|
2728
|
+
assetBaseUrl: a,
|
|
2729
|
+
flowType: r,
|
|
2730
|
+
customerId: s,
|
|
2731
|
+
defaultFiatCurrency: m,
|
|
2732
|
+
defaultCryptoCurrency: u,
|
|
2599
2733
|
defaultNetwork: i,
|
|
2600
|
-
defaultFiatAmount:
|
|
2734
|
+
defaultFiatAmount: l,
|
|
2601
2735
|
defaultCryptoAmount: d,
|
|
2602
2736
|
defaultWalletAddress: h,
|
|
2603
2737
|
defaultGateway: f,
|
|
2604
|
-
fieldLocks:
|
|
2605
|
-
statusPollInterval:
|
|
2738
|
+
fieldLocks: v,
|
|
2739
|
+
statusPollInterval: x,
|
|
2606
2740
|
onComplete: p,
|
|
2607
|
-
onError:
|
|
2741
|
+
onError: C,
|
|
2608
2742
|
children: /* @__PURE__ */ e(
|
|
2609
|
-
|
|
2743
|
+
vn,
|
|
2610
2744
|
{
|
|
2611
|
-
className:
|
|
2745
|
+
className: L,
|
|
2612
2746
|
theme: P,
|
|
2613
|
-
skinId:
|
|
2614
|
-
accentColor:
|
|
2747
|
+
skinId: S,
|
|
2748
|
+
accentColor: j,
|
|
2615
2749
|
bgColor: Q,
|
|
2616
|
-
bgImage:
|
|
2617
|
-
borderColor:
|
|
2750
|
+
bgImage: W,
|
|
2751
|
+
borderColor: q,
|
|
2618
2752
|
borderRadius: c,
|
|
2619
2753
|
showFlowToggle: O,
|
|
2620
|
-
autoRedirect:
|
|
2621
|
-
explorerUrl:
|
|
2622
|
-
doneButtonText:
|
|
2623
|
-
supportEmail:
|
|
2624
|
-
onDone:
|
|
2754
|
+
autoRedirect: b,
|
|
2755
|
+
explorerUrl: k,
|
|
2756
|
+
doneButtonText: _,
|
|
2757
|
+
supportEmail: $,
|
|
2758
|
+
onDone: G
|
|
2625
2759
|
}
|
|
2626
2760
|
)
|
|
2627
2761
|
}
|
|
2628
2762
|
);
|
|
2629
2763
|
}
|
|
2630
|
-
function
|
|
2764
|
+
function Mn({
|
|
2631
2765
|
submitButtonText: t,
|
|
2632
|
-
rateRefreshInterval:
|
|
2633
|
-
...
|
|
2766
|
+
rateRefreshInterval: n,
|
|
2767
|
+
...a
|
|
2634
2768
|
}) {
|
|
2635
|
-
return /* @__PURE__ */ e(
|
|
2769
|
+
return /* @__PURE__ */ e(Nn, { ...a });
|
|
2636
2770
|
}
|
|
2637
|
-
function
|
|
2771
|
+
function Bn({
|
|
2638
2772
|
skin: t,
|
|
2639
|
-
active:
|
|
2640
|
-
onClick:
|
|
2641
|
-
darkMode:
|
|
2642
|
-
dimmed:
|
|
2773
|
+
active: n,
|
|
2774
|
+
onClick: a,
|
|
2775
|
+
darkMode: r,
|
|
2776
|
+
dimmed: s
|
|
2643
2777
|
}) {
|
|
2644
|
-
const
|
|
2645
|
-
return /* @__PURE__ */
|
|
2778
|
+
const m = t.accent === null, u = 32;
|
|
2779
|
+
return /* @__PURE__ */ o(
|
|
2646
2780
|
"button",
|
|
2647
2781
|
{
|
|
2648
|
-
onClick:
|
|
2782
|
+
onClick: a,
|
|
2649
2783
|
className: "relative shrink-0",
|
|
2650
|
-
style: { width:
|
|
2784
|
+
style: { width: u, height: u, opacity: s ? 0.4 : 1, transition: "opacity 0.2s" },
|
|
2651
2785
|
children: [
|
|
2652
|
-
|
|
2786
|
+
m ? /* @__PURE__ */ o("svg", { width: u, height: u, viewBox: "0 0 32 32", children: [
|
|
2653
2787
|
/* @__PURE__ */ e("clipPath", { id: "mono-left", children: /* @__PURE__ */ e("rect", { x: "0", y: "0", width: "16", height: "32" }) }),
|
|
2654
2788
|
/* @__PURE__ */ e("clipPath", { id: "mono-right", children: /* @__PURE__ */ e("rect", { x: "16", y: "0", width: "16", height: "32" }) }),
|
|
2655
2789
|
/* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: "#111111", clipPath: "url(#mono-left)" }),
|
|
2656
2790
|
/* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: "#ffffff", clipPath: "url(#mono-right)" }),
|
|
2657
|
-
/* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: "none", stroke:
|
|
2658
|
-
] }) : /* @__PURE__ */ e("svg", { width:
|
|
2659
|
-
|
|
2791
|
+
/* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: "none", stroke: r ? "rgba(255,255,255,0.15)" : "rgba(0,0,0,0.1)", strokeWidth: "1" })
|
|
2792
|
+
] }) : /* @__PURE__ */ e("svg", { width: u, height: u, viewBox: "0 0 32 32", children: /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: t.accent }) }),
|
|
2793
|
+
n && !s && /* @__PURE__ */ e(
|
|
2660
2794
|
"div",
|
|
2661
2795
|
{
|
|
2662
2796
|
className: "absolute inset-0 rounded-full",
|
|
@@ -2667,13 +2801,13 @@ function Ta({
|
|
|
2667
2801
|
}
|
|
2668
2802
|
);
|
|
2669
2803
|
}
|
|
2670
|
-
function
|
|
2671
|
-
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__ */
|
|
2804
|
+
function Cn({ quote: t }) {
|
|
2805
|
+
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__ */ o("div", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: [
|
|
2672
2806
|
"#",
|
|
2673
2807
|
t.rank
|
|
2674
2808
|
] }) : null;
|
|
2675
2809
|
}
|
|
2676
|
-
function
|
|
2810
|
+
function bn({ quote: t }) {
|
|
2677
2811
|
return t.gatewayLogo ? /* @__PURE__ */ e(
|
|
2678
2812
|
"img",
|
|
2679
2813
|
{
|
|
@@ -2686,8 +2820,8 @@ function ga({ quote: t }) {
|
|
|
2686
2820
|
}
|
|
2687
2821
|
) : /* @__PURE__ */ e($e, { size: 36 });
|
|
2688
2822
|
}
|
|
2689
|
-
function
|
|
2690
|
-
return /* @__PURE__ */ e("div", { className: "space-y-2", children: [0, 1, 2].map((t) => /* @__PURE__ */
|
|
2823
|
+
function En() {
|
|
2824
|
+
return /* @__PURE__ */ e("div", { className: "space-y-2", children: [0, 1, 2].map((t) => /* @__PURE__ */ o(
|
|
2691
2825
|
"div",
|
|
2692
2826
|
{
|
|
2693
2827
|
className: "w-full flex items-center gap-3.5",
|
|
@@ -2700,11 +2834,11 @@ function va() {
|
|
|
2700
2834
|
},
|
|
2701
2835
|
children: [
|
|
2702
2836
|
/* @__PURE__ */ e(M, { w: 36, h: 36, className: "rounded-full shrink-0" }),
|
|
2703
|
-
/* @__PURE__ */
|
|
2837
|
+
/* @__PURE__ */ o("div", { className: "flex-1", children: [
|
|
2704
2838
|
/* @__PURE__ */ e(M, { w: 90, h: 14, className: "mb-1.5" }),
|
|
2705
2839
|
/* @__PURE__ */ e(M, { w: 60, h: 12 })
|
|
2706
2840
|
] }),
|
|
2707
|
-
/* @__PURE__ */
|
|
2841
|
+
/* @__PURE__ */ o("div", { className: "text-right", children: [
|
|
2708
2842
|
/* @__PURE__ */ e(M, { w: 40, h: 10, className: "mb-1.5" }),
|
|
2709
2843
|
/* @__PURE__ */ e(M, { w: 80, h: 14 })
|
|
2710
2844
|
] })
|
|
@@ -2713,19 +2847,19 @@ function va() {
|
|
|
2713
2847
|
t
|
|
2714
2848
|
)) });
|
|
2715
2849
|
}
|
|
2716
|
-
function
|
|
2850
|
+
function On({
|
|
2717
2851
|
onClose: t,
|
|
2718
|
-
onSelect:
|
|
2719
|
-
quotes:
|
|
2720
|
-
quotesLoading:
|
|
2721
|
-
cryptoCurrency:
|
|
2852
|
+
onSelect: n,
|
|
2853
|
+
quotes: a,
|
|
2854
|
+
quotesLoading: r,
|
|
2855
|
+
cryptoCurrency: s
|
|
2722
2856
|
}) {
|
|
2723
|
-
const [
|
|
2724
|
-
if (!(
|
|
2725
|
-
const
|
|
2726
|
-
return
|
|
2727
|
-
}, [
|
|
2728
|
-
return /* @__PURE__ */
|
|
2857
|
+
const [m, u] = N(""), i = F(() => {
|
|
2858
|
+
if (!(a != null && a.quotes)) return [];
|
|
2859
|
+
const l = m.trim().toLowerCase();
|
|
2860
|
+
return l ? a.quotes.filter((d) => d.gatewayName.toLowerCase().includes(l)) : a.quotes;
|
|
2861
|
+
}, [a, m]);
|
|
2862
|
+
return /* @__PURE__ */ o(J, { children: [
|
|
2729
2863
|
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ve, { onClick: t }) }),
|
|
2730
2864
|
/* @__PURE__ */ e(
|
|
2731
2865
|
"h2",
|
|
@@ -2735,14 +2869,14 @@ function ka({
|
|
|
2735
2869
|
children: "Choose Ramp"
|
|
2736
2870
|
}
|
|
2737
2871
|
),
|
|
2738
|
-
/* @__PURE__ */ e(Be, { value:
|
|
2739
|
-
/* @__PURE__ */
|
|
2740
|
-
|
|
2741
|
-
const h = d === 0, f = parseFloat(
|
|
2742
|
-
return /* @__PURE__ */
|
|
2872
|
+
/* @__PURE__ */ e(Be, { value: m, onChange: u }),
|
|
2873
|
+
/* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5 space-y-2", children: [
|
|
2874
|
+
r ? /* @__PURE__ */ e(En, {}) : i.length === 0 ? /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: a && a.quotes.length === 0 ? "No quotes available for this request" : "No providers found" }) : i.map((l, d) => {
|
|
2875
|
+
const h = d === 0, f = parseFloat(l.cryptoAmount), v = f >= 1 ? f.toFixed(4) : f.toPrecision(6);
|
|
2876
|
+
return /* @__PURE__ */ o(
|
|
2743
2877
|
"button",
|
|
2744
2878
|
{
|
|
2745
|
-
onClick: () =>
|
|
2879
|
+
onClick: () => n(l),
|
|
2746
2880
|
className: "w-full flex items-center gap-3.5 transition-colors",
|
|
2747
2881
|
style: {
|
|
2748
2882
|
borderRadius: h ? 4.5 : 5,
|
|
@@ -2753,94 +2887,94 @@ function ka({
|
|
|
2753
2887
|
background: h ? "transparent" : "var(--t-surface)"
|
|
2754
2888
|
},
|
|
2755
2889
|
children: [
|
|
2756
|
-
/* @__PURE__ */ e(
|
|
2757
|
-
/* @__PURE__ */
|
|
2758
|
-
/* @__PURE__ */ e("div", { className: "font-medium text-[15px]", style: { color: "var(--t-text)" }, children:
|
|
2759
|
-
/* @__PURE__ */ e(
|
|
2890
|
+
/* @__PURE__ */ e(bn, { quote: l }),
|
|
2891
|
+
/* @__PURE__ */ o("div", { className: "text-left flex-1 min-w-0", children: [
|
|
2892
|
+
/* @__PURE__ */ e("div", { className: "font-medium text-[15px]", style: { color: "var(--t-text)" }, children: l.gatewayName }),
|
|
2893
|
+
/* @__PURE__ */ e(Cn, { quote: l })
|
|
2760
2894
|
] }),
|
|
2761
|
-
/* @__PURE__ */
|
|
2895
|
+
/* @__PURE__ */ o("div", { className: "text-right shrink-0", children: [
|
|
2762
2896
|
/* @__PURE__ */ e("div", { className: "text-[11px]", style: { color: "var(--t-text-secondary)" }, children: "You get" }),
|
|
2763
|
-
/* @__PURE__ */
|
|
2764
|
-
|
|
2897
|
+
/* @__PURE__ */ o("div", { className: "font-medium text-[14px]", style: { color: "var(--t-text)" }, children: [
|
|
2898
|
+
s,
|
|
2765
2899
|
" ",
|
|
2766
|
-
|
|
2900
|
+
v
|
|
2767
2901
|
] })
|
|
2768
2902
|
] })
|
|
2769
2903
|
]
|
|
2770
2904
|
},
|
|
2771
|
-
|
|
2905
|
+
l.gatewayId
|
|
2772
2906
|
);
|
|
2773
2907
|
}),
|
|
2774
|
-
!
|
|
2908
|
+
!r && (a == null ? void 0 : a.unavailableGateways) && a.unavailableGateways.length > 0 && /* @__PURE__ */ e("div", { className: "pt-3", children: a.unavailableGateways.map((l) => /* @__PURE__ */ o(
|
|
2775
2909
|
"div",
|
|
2776
2910
|
{
|
|
2777
2911
|
className: "flex items-center justify-between py-2 text-[12px]",
|
|
2778
2912
|
style: { color: "var(--t-text-muted)" },
|
|
2779
2913
|
children: [
|
|
2780
|
-
/* @__PURE__ */ e("span", { children:
|
|
2781
|
-
/* @__PURE__ */ e("span", { children:
|
|
2914
|
+
/* @__PURE__ */ e("span", { children: l.gatewayName }),
|
|
2915
|
+
/* @__PURE__ */ e("span", { children: l.reason })
|
|
2782
2916
|
]
|
|
2783
2917
|
},
|
|
2784
|
-
|
|
2918
|
+
l.gatewayId
|
|
2785
2919
|
)) })
|
|
2786
2920
|
] })
|
|
2787
2921
|
] });
|
|
2788
2922
|
}
|
|
2789
2923
|
export {
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2924
|
+
un as AnimatedDigit,
|
|
2925
|
+
mn as AnimatedNumber,
|
|
2926
|
+
Wt as ApplePayIcon,
|
|
2793
2927
|
Ie as BLOCKCHAINS,
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2928
|
+
Gt as BankIcon,
|
|
2929
|
+
$t as CRYPTO_CHAIN_COMBOS,
|
|
2930
|
+
Kt as CRYPTO_CURRENCIES,
|
|
2931
|
+
Qt as CardIcon,
|
|
2932
|
+
Mn as CheckoutForm,
|
|
2933
|
+
rn as CheckoutStep,
|
|
2800
2934
|
ge as ChevronDown,
|
|
2801
|
-
|
|
2802
|
-
|
|
2935
|
+
Zt as ChevronRight,
|
|
2936
|
+
On as ChooseRampModal,
|
|
2803
2937
|
ve as CloseButton,
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2938
|
+
In as CoinifyIcon,
|
|
2939
|
+
sn as CompleteStep,
|
|
2940
|
+
dn as ConfirmStep,
|
|
2941
|
+
fn as CryptoCurrencyModal,
|
|
2942
|
+
pt as CryptoIcon,
|
|
2943
|
+
Jt as DarkModeIcon,
|
|
2944
|
+
cn as ErrorStep,
|
|
2945
|
+
ct as FIAT_CURRENCIES,
|
|
2946
|
+
Ft as FIAT_TO_COUNTRY,
|
|
2947
|
+
hn as FiatCurrencyModal,
|
|
2814
2948
|
Xe as FiatFlag,
|
|
2815
|
-
|
|
2949
|
+
pn as FormSkeleton,
|
|
2816
2950
|
$e as GenericCoinIcon,
|
|
2817
2951
|
Yt as GooglePayIcon,
|
|
2818
|
-
|
|
2819
|
-
|
|
2952
|
+
dt as MOCK_RATES,
|
|
2953
|
+
zt as MenuIcon,
|
|
2820
2954
|
Le as Modal,
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2955
|
+
Vt as PayPalIcon,
|
|
2956
|
+
an as PaymentMethodSelector,
|
|
2957
|
+
ln as ProcessingStep,
|
|
2958
|
+
Nn as RampForm,
|
|
2959
|
+
Ut as RampProvider,
|
|
2960
|
+
jt as RevolutIcon,
|
|
2961
|
+
it as SKINS,
|
|
2828
2962
|
Be as SearchInput,
|
|
2829
|
-
|
|
2963
|
+
gn as SettingsScreen,
|
|
2830
2964
|
M as Skeleton,
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2965
|
+
Bn as SkinSwatch,
|
|
2966
|
+
yn as ToggleSwitch,
|
|
2967
|
+
Ln as formatOutput,
|
|
2834
2968
|
_e as getChainIconUrl,
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2969
|
+
xt as getCryptoIconUrl,
|
|
2970
|
+
_t as getFiatFlagUrl,
|
|
2971
|
+
kn as getMockRate,
|
|
2972
|
+
qt as getPaymentIcon,
|
|
2973
|
+
Xt as parseAmount,
|
|
2974
|
+
Pt as useCheckoutIntent,
|
|
2975
|
+
Ot as useQuotes,
|
|
2842
2976
|
pe as useRamp,
|
|
2843
|
-
|
|
2844
|
-
|
|
2977
|
+
Bt as useRampConfig,
|
|
2978
|
+
Dt as useTransaction
|
|
2845
2979
|
};
|
|
2846
2980
|
//# sourceMappingURL=index.js.map
|