@nowramp/form 0.1.35 → 0.1.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4,127 +4,127 @@
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}.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}
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}.gap-4{gap:1rem}.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 o, Fragment as le } from "react/jsx-runtime";
12
- import Ue, { useState as C, useRef as U, useCallback as $, useEffect as H, useMemo as X, useReducer as St, useContext as wt, createContext as Tt } from "react";
13
- import { RampApi as ke } from "@nowramp/sdk";
14
- function Rt(t, a) {
15
- const [n, l] = C(null), [r, d] = C(!0), [u, m] = C(null), c = U(null);
16
- (!c.current || c.current !== t) && (c.current = new ke({ apiKey: "", ...t }));
17
- const i = $(async () => {
11
+ import { jsx as e, jsxs as l, Fragment as J } from "react/jsx-runtime";
12
+ import ke, { useState as N, useRef as D, useCallback as _, useEffect as U, useMemo as F, useReducer as Rt, useContext as kt, createContext as Lt } from "react";
13
+ import { RampApi as Me } from "@nowramp/sdk";
14
+ function It(t, a) {
15
+ const [n, s] = N(null), [r, u] = N(!0), [m, i] = N(null), o = D(null);
16
+ (!o.current || o.current !== t) && (o.current = new Me({ apiKey: "", ...t }));
17
+ const d = _(async () => {
18
18
  if (!t.projectId) {
19
- m(new Error("projectId is required")), d(!1);
19
+ i(new Error("projectId is required")), u(!1);
20
20
  return;
21
21
  }
22
- d(!0), m(null);
22
+ u(!0), i(null);
23
23
  try {
24
- const p = await c.current.getSupported(a);
25
- l(p);
26
- } catch (p) {
27
- m(p instanceof Error ? p : new Error("Failed to fetch config"));
24
+ const h = await o.current.getSupported(a);
25
+ s(h);
26
+ } catch (h) {
27
+ i(h instanceof Error ? h : new Error("Failed to fetch config"));
28
28
  } finally {
29
- d(!1);
29
+ u(!1);
30
30
  }
31
31
  }, [t.projectId, a]);
32
- return H(() => {
33
- i();
34
- }, [i]), { config: n, loading: r, error: u, refetch: i };
32
+ return U(() => {
33
+ d();
34
+ }, [d]), { config: n, loading: r, error: m, refetch: d };
35
35
  }
36
- function kt(t, a) {
37
- const [n, l] = C(null), [r, d] = C(!1), [u, m] = C(null), c = U(null), i = U(""), p = `${t.apiUrl}|${t.projectId}`;
38
- (!c.current || i.current !== p) && (c.current = new ke({ apiKey: "", ...t }), i.current = p);
39
- const f = U(0);
40
- H(() => {
36
+ function Mt(t, a) {
37
+ const [n, s] = N(null), [r, u] = N(!1), [m, i] = N(null), o = D(null), d = D(""), h = `${t.apiUrl}|${t.projectId}`;
38
+ (!o.current || d.current !== h) && (o.current = new Me({ apiKey: "", ...t }), d.current = h);
39
+ const f = D(0);
40
+ U(() => {
41
41
  const g = ++f.current;
42
42
  if (!a || !t.projectId) {
43
- l(null), d(!1);
43
+ s(null), u(!1);
44
44
  return;
45
45
  }
46
- d(!0), m(null), c.current.getQuotes(a).then(
47
- (h) => {
48
- f.current === g && (l(h), d(!1));
46
+ u(!0), i(null), o.current.getQuotes(a).then(
47
+ (p) => {
48
+ f.current === g && (s(p), u(!1));
49
49
  },
50
- (h) => {
51
- f.current === g && (m(h instanceof Error ? h : new Error("Failed to fetch quotes")), l(null), d(!1));
50
+ (p) => {
51
+ f.current === g && (i(p instanceof Error ? p : new Error("Failed to fetch quotes")), s(null), u(!1));
52
52
  }
53
53
  );
54
54
  }, [t.projectId, a == null ? void 0 : a.fiatCurrency, a == null ? void 0 : a.fiatAmount, a == null ? void 0 : a.cryptoAmount, a == null ? void 0 : a.cryptoCurrency, a == null ? void 0 : a.network, a == null ? void 0 : a.paymentMethodId, a == null ? void 0 : a.country, a == null ? void 0 : a.orderType]);
55
- const x = $(async () => {
55
+ const x = _(async () => {
56
56
  if (!(!a || !t.projectId)) {
57
- d(!0), m(null);
57
+ u(!0), i(null);
58
58
  try {
59
- const g = await c.current.getQuotes(a);
60
- l(g);
59
+ const g = await o.current.getQuotes(a);
60
+ s(g);
61
61
  } catch (g) {
62
- m(g instanceof Error ? g : new Error("Failed to fetch quotes"));
62
+ i(g instanceof Error ? g : new Error("Failed to fetch quotes"));
63
63
  } finally {
64
- d(!1);
64
+ u(!1);
65
65
  }
66
66
  }
67
67
  }, [t.projectId, a]);
68
- return { quotes: n, loading: r, error: u, refetch: x };
68
+ return { quotes: n, loading: r, error: m, refetch: x };
69
69
  }
70
- function Lt(t) {
71
- const [a, n] = C(null), [l, r] = C(!1), [d, u] = C(null), m = U(null), c = U(""), i = `${t.apiUrl}|${t.projectId}`;
72
- (!m.current || c.current !== i) && (m.current = new ke({ apiKey: "", ...t }), c.current = i);
73
- const p = $(async (x) => {
74
- r(!0), u(null);
70
+ function Bt(t) {
71
+ const [a, n] = N(null), [s, r] = N(!1), [u, m] = N(null), i = D(null), o = D(""), d = `${t.apiUrl}|${t.projectId}`;
72
+ (!i.current || o.current !== d) && (i.current = new Me({ apiKey: "", ...t }), o.current = d);
73
+ const h = _(async (x) => {
74
+ r(!0), m(null);
75
75
  try {
76
- const g = await m.current.createCheckoutIntent(x);
76
+ const g = await i.current.createCheckoutIntent(x);
77
77
  return n(g), g;
78
78
  } catch (g) {
79
- const h = g instanceof Error ? g : new Error("Failed to create checkout intent");
80
- throw u(h), h;
79
+ const p = g instanceof Error ? g : new Error("Failed to create checkout intent");
80
+ throw m(p), p;
81
81
  } finally {
82
82
  r(!1);
83
83
  }
84
- }, []), f = $(() => {
85
- n(null), u(null);
84
+ }, []), f = _(() => {
85
+ n(null), m(null);
86
86
  }, []);
87
- return { order: a, loading: l, error: d, createOrder: p, reset: f };
87
+ return { order: a, loading: s, error: u, createOrder: h, reset: f };
88
88
  }
89
- function It(t, a, n) {
90
- const [l, r] = C(null), [d, u] = C(!1), [m, c] = C(null), i = U(null);
91
- i.current || (i.current = new ke({ apiKey: "", projectId: "", ...t }));
92
- const p = $(async () => {
89
+ function Ot(t, a, n) {
90
+ const [s, r] = N(null), [u, m] = N(!1), [i, o] = N(null), d = D(null);
91
+ d.current || (d.current = new Me({ apiKey: "", projectId: "", ...t }));
92
+ const h = _(async () => {
93
93
  if (a) {
94
- u(!0), c(null);
94
+ m(!0), o(null);
95
95
  try {
96
- const f = await i.current.getTransaction(a);
96
+ const f = await d.current.getTransaction(a);
97
97
  r(f);
98
98
  } catch (f) {
99
- c(f instanceof Error ? f : new Error("Failed to fetch status"));
99
+ o(f instanceof Error ? f : new Error("Failed to fetch status"));
100
100
  } finally {
101
- u(!1);
101
+ m(!1);
102
102
  }
103
103
  }
104
104
  }, [a]);
105
- return H(() => {
105
+ return U(() => {
106
106
  if (!a) return;
107
107
  const f = (n == null ? void 0 : n.initialDelay) ?? 0;
108
108
  if (f > 0) {
109
- const x = setTimeout(p, f);
109
+ const x = setTimeout(h, f);
110
110
  return () => clearTimeout(x);
111
111
  }
112
- p();
113
- }, [p, a, n == null ? void 0 : n.initialDelay]), H(() => {
114
- if (!a || !(n != null && n.pollInterval) || !l || ["completed", "failed", "cancelled", "expired", "refunded"].includes(l.status))
112
+ h();
113
+ }, [h, a, n == null ? void 0 : n.initialDelay]), U(() => {
114
+ if (!a || !(n != null && n.pollInterval) || !s || ["completed", "failed", "cancelled", "expired", "refunded"].includes(s.status))
115
115
  return;
116
- const x = setInterval(p, n.pollInterval);
116
+ const x = setInterval(h, n.pollInterval);
117
117
  return () => clearInterval(x);
118
- }, [a, n == null ? void 0 : n.pollInterval, l == null ? void 0 : l.status, p]), { status: l, loading: d, error: m, refetch: p };
118
+ }, [a, n == null ? void 0 : n.pollInterval, s == null ? void 0 : s.status, h]), { status: s, loading: u, error: i, refetch: h };
119
119
  }
120
- function rt(t, a) {
120
+ function lt(t, a) {
121
121
  if (!t) return t;
122
122
  const n = t.indexOf(".");
123
123
  if (n === -1) return t;
124
- let l = t;
125
- return l.length - n - 1 > a && (l = l.slice(0, n + a + 1)), l = l.replace(/0+$/, "").replace(/\.$/, ""), l;
124
+ let s = t;
125
+ return s.length - n - 1 > a && (s = s.slice(0, n + a + 1)), s = s.replace(/0+$/, "").replace(/\.$/, ""), s;
126
126
  }
127
- const mt = {
127
+ const ht = {
128
128
  step: "amount",
129
129
  flowType: "buy",
130
130
  fiatCurrency: "USD",
@@ -142,7 +142,7 @@ const mt = {
142
142
  country: "",
143
143
  errorMessage: null
144
144
  };
145
- function Bt(t, a) {
145
+ function Pt(t, a) {
146
146
  switch (a.type) {
147
147
  case "SET_STEP":
148
148
  return { ...t, step: a.step, errorMessage: null };
@@ -152,6 +152,7 @@ function Bt(t, a) {
152
152
  flowType: a.flowType,
153
153
  fiatAmount: "",
154
154
  cryptoAmount: "",
155
+ paymentMethodId: "",
155
156
  selectedQuote: null,
156
157
  selectedProvider: null,
157
158
  errorMessage: null
@@ -191,799 +192,193 @@ function Bt(t, a) {
191
192
  case "CLEAR_ERROR":
192
193
  return { ...t, errorMessage: null };
193
194
  case "RESET":
194
- return mt;
195
+ return ht;
195
196
  default:
196
197
  return t;
197
198
  }
198
199
  }
199
- const ht = Tt(null);
200
- function Mt({
200
+ const ft = Lt(null);
201
+ function Ht({
201
202
  projectId: t,
202
203
  apiUrl: a = "https://api.nowramp.com",
203
204
  assetBaseUrl: n = "",
204
- flowType: l = "buy",
205
+ flowType: s = "buy",
205
206
  customerId: r = "",
206
- defaultFiatCurrency: d = "USD",
207
- defaultCryptoCurrency: u = "BTC",
208
- defaultNetwork: m = "",
209
- defaultFiatAmount: c = "",
210
- defaultCryptoAmount: i = "",
211
- defaultWalletAddress: p = "",
207
+ defaultFiatCurrency: u = "USD",
208
+ defaultCryptoCurrency: m = "BTC",
209
+ defaultNetwork: i = "",
210
+ defaultFiatAmount: o = "",
211
+ defaultCryptoAmount: d = "",
212
+ defaultWalletAddress: h = "",
212
213
  defaultGateway: f,
213
214
  fieldLocks: x,
214
215
  statusPollInterval: g = 5e3,
215
- onComplete: h,
216
+ onComplete: p,
216
217
  onError: b,
217
- children: L
218
+ children: S
218
219
  }) {
219
- const O = X(() => ({ apiUrl: a, projectId: t }), [a, t]), A = m || (u ? u.toLowerCase() : ""), G = l === "sell", j = G ? !!i : !!c, Z = (G ? !!(j && u && A) : !!(j && u && A && p)) && f ? "confirm" : "amount", [s, P] = St(Bt, {
220
- ...mt,
221
- step: Z,
222
- flowType: l,
223
- fiatCurrency: d,
224
- cryptoCurrency: u,
225
- network: A,
226
- fiatAmount: rt(c, 2),
227
- cryptoAmount: rt(i, 6),
228
- walletAddress: p,
220
+ const P = F(() => ({ apiUrl: a, projectId: t }), [a, t]), w = i || (m ? m.toLowerCase() : ""), G = s === "sell", Q = G ? !!d : !!o, z = (G ? !!(Q && m && w) : !!(Q && m && w && h)) && f ? "confirm" : "amount", [c, O] = Rt(Pt, {
221
+ ...ht,
222
+ step: z,
223
+ flowType: s,
224
+ fiatCurrency: u,
225
+ cryptoCurrency: m,
226
+ network: w,
227
+ fiatAmount: lt(o, 2),
228
+ cryptoAmount: lt(d, 6),
229
+ walletAddress: h,
229
230
  customerId: r
230
- }), v = s.flowType === "sell", {
231
- config: I,
232
- loading: D,
233
- error: F
234
- } = Rt(O, s.flowType);
235
- Ue.useEffect(() => {
236
- var R, k, w;
237
- if (!I || !s.cryptoCurrency || s.network) return;
238
- const N = (R = I.cryptos) == null ? void 0 : R.find((_) => _.code === s.cryptoCurrency), S = ((k = N == null ? void 0 : N.networks) == null ? void 0 : k.find((_) => _.isDefault)) || ((w = N == null ? void 0 : N.networks) == null ? void 0 : w[0]);
239
- S != null && S.id && P({ type: "SET_NETWORK", network: S.id });
240
- }, [I, s.cryptoCurrency, s.network]);
241
- const K = X(() => {
242
- if (v) {
243
- if (!s.cryptoAmount) return null;
244
- const w = parseFloat(s.cryptoAmount);
245
- return isNaN(w) || w <= 0 ? "Enter a valid amount" : null;
231
+ }), C = c.flowType === "sell", {
232
+ config: L,
233
+ loading: K,
234
+ error: X
235
+ } = It(P, c.flowType);
236
+ ke.useEffect(() => {
237
+ var R, k, T;
238
+ if (!L || !c.cryptoCurrency || c.network) return;
239
+ const v = (R = L.cryptos) == null ? void 0 : R.find((H) => H.code === c.cryptoCurrency), E = ((k = v == null ? void 0 : v.networks) == null ? void 0 : k.find((H) => H.isDefault)) || ((T = v == null ? void 0 : v.networks) == null ? void 0 : T[0]);
240
+ E != null && E.id && O({ type: "SET_NETWORK", network: E.id });
241
+ }, [L, c.cryptoCurrency, c.network]), ke.useEffect(() => {
242
+ var k, T;
243
+ if (!((k = L == null ? void 0 : L.paymentMethods) != null && k.length)) return;
244
+ const v = c.fiatCurrency, E = L.paymentMethods;
245
+ if (c.paymentMethodId && E.some(
246
+ (W) => W.id === c.paymentMethodId && W.supportedFiats.includes(v)
247
+ ))
248
+ return;
249
+ const R = E.find((H) => H.supportedFiats.includes(v));
250
+ O({ type: "SET_PAYMENT_METHOD", methodId: (R == null ? void 0 : R.id) || ((T = E[0]) == null ? void 0 : T.id) || "" });
251
+ }, [L, c.fiatCurrency, c.paymentMethodId]);
252
+ const $ = F(() => {
253
+ if (C) {
254
+ if (!c.cryptoAmount) return null;
255
+ const T = parseFloat(c.cryptoAmount);
256
+ return isNaN(T) || T <= 0 ? "Enter a valid amount" : null;
246
257
  }
247
- if (!I || !s.fiatAmount) return null;
248
- const N = parseFloat(s.fiatAmount);
249
- if (isNaN(N)) return null;
250
- const S = I.fiats.find((w) => w.code === s.fiatCurrency);
251
- if (!S) return null;
252
- const R = parseFloat(S.minAmount), k = parseFloat(S.maxAmount);
253
- return !isNaN(R) && N < R ? `Minimum amount is ${S.minAmount} ${s.fiatCurrency}` : !isNaN(k) && N > k ? `Maximum amount is ${S.maxAmount} ${s.fiatCurrency}` : null;
254
- }, [I, s.fiatAmount, s.fiatCurrency, s.cryptoAmount, v]), ge = X(() => {
255
- const N = v ? !!s.cryptoAmount : !!s.fiatAmount;
256
- return !I || !N || !s.cryptoCurrency || !s.network || K ? null : {
257
- fiatCurrency: s.fiatCurrency,
258
- ...v ? { cryptoAmount: s.cryptoAmount } : { fiatAmount: s.fiatAmount },
259
- cryptoCurrency: s.cryptoCurrency,
260
- network: s.network,
261
- paymentMethodId: s.paymentMethodId || void 0,
262
- country: s.country || void 0,
263
- orderType: s.flowType
258
+ if (!L || !c.fiatAmount) return null;
259
+ const v = parseFloat(c.fiatAmount);
260
+ if (isNaN(v)) return null;
261
+ const E = L.fiats.find((T) => T.code === c.fiatCurrency);
262
+ if (!E) return null;
263
+ const R = parseFloat(E.minAmount), k = parseFloat(E.maxAmount);
264
+ return !isNaN(R) && v < R ? `Minimum amount is ${E.minAmount} ${c.fiatCurrency}` : !isNaN(k) && v > k ? `Maximum amount is ${E.maxAmount} ${c.fiatCurrency}` : null;
265
+ }, [L, c.fiatAmount, c.fiatCurrency, c.cryptoAmount, C]), Ne = F(() => {
266
+ const v = C ? !!c.cryptoAmount : !!c.fiatAmount;
267
+ return !L || !v || !c.cryptoCurrency || !c.network || $ ? null : {
268
+ fiatCurrency: c.fiatCurrency,
269
+ ...C ? { cryptoAmount: c.cryptoAmount } : { fiatAmount: c.fiatAmount },
270
+ cryptoCurrency: c.cryptoCurrency,
271
+ network: c.network,
272
+ paymentMethodId: c.paymentMethodId || void 0,
273
+ country: c.country || void 0,
274
+ orderType: c.flowType
264
275
  };
265
- }, [I, s.fiatCurrency, s.fiatAmount, s.cryptoAmount, s.cryptoCurrency, s.network, s.paymentMethodId, s.country, K, v, s.flowType]), {
266
- quotes: pe,
276
+ }, [L, c.fiatCurrency, c.fiatAmount, c.cryptoAmount, c.cryptoCurrency, c.network, c.paymentMethodId, c.country, $, C, c.flowType]), {
277
+ quotes: he,
267
278
  loading: fe,
268
279
  error: Y,
269
280
  refetch: ye
270
- } = kt(O, ge), {
271
- order: ee,
272
- loading: ve,
273
- error: ce,
274
- createOrder: se
275
- } = Lt(O), Ne = 15e3, {
281
+ } = Mt(P, Ne), {
282
+ order: ae,
283
+ loading: Ce,
284
+ error: se,
285
+ createOrder: ce
286
+ } = Bt(P), be = 15e3, {
276
287
  status: V,
277
- loading: te
278
- } = It(
288
+ loading: ne
289
+ } = Ot(
279
290
  { apiUrl: a },
280
- (ee == null ? void 0 : ee.orderId) ?? null,
281
- { pollInterval: g, initialDelay: Ne }
291
+ (ae == null ? void 0 : ae.orderId) ?? null,
292
+ { pollInterval: g, initialDelay: be }
282
293
  );
283
- Ue.useEffect(() => {
284
- (V == null ? void 0 : V.status) === "completed" && h && h(V);
285
- }, [V == null ? void 0 : V.status, h]), Ue.useEffect(() => {
286
- const N = F || ce;
287
- N && b && b(N);
288
- }, [F, ce, b]);
289
- const ae = f || (I == null ? void 0 : I.defaultGateway) || null, Ce = U(ae);
290
- Ce.current = ae;
291
- const be = U(pe);
292
- be.current = pe;
293
- const Ee = $(async () => {
294
- var S, R, k;
295
- const N = ((S = s.selectedQuote) == null ? void 0 : S.gatewayId) || ((k = (R = be.current) == null ? void 0 : R.bestQuote) == null ? void 0 : k.gatewayId) || Ce.current;
296
- if (!N || !s.walletAddress) {
297
- const w = [!N && "gateway", !s.walletAddress && "walletAddress"].filter(Boolean).join(", ");
298
- P({ type: "SET_ERROR", message: `Missing required fields: ${w}` });
294
+ ke.useEffect(() => {
295
+ (V == null ? void 0 : V.status) === "completed" && p && p(V);
296
+ }, [V == null ? void 0 : V.status, p]), ke.useEffect(() => {
297
+ const v = X || se;
298
+ v && b && b(v);
299
+ }, [X, se, b]);
300
+ const re = f || (L == null ? void 0 : L.defaultGateway) || null, Ee = D(re);
301
+ Ee.current = re;
302
+ const Ae = D(he);
303
+ Ae.current = he;
304
+ const we = _(async () => {
305
+ var E, R, k;
306
+ const v = ((E = c.selectedQuote) == null ? void 0 : E.gatewayId) || ((k = (R = Ae.current) == null ? void 0 : R.bestQuote) == null ? void 0 : k.gatewayId) || Ee.current;
307
+ if (!v || !c.walletAddress) {
308
+ const T = [!v && "gateway", !c.walletAddress && "walletAddress"].filter(Boolean).join(", ");
309
+ O({ type: "SET_ERROR", message: `Missing required fields: ${T}` });
299
310
  return;
300
311
  }
301
312
  try {
302
- await se({
303
- gateway: N,
304
- externalCustomerId: s.customerId || void 0,
305
- fiatCurrency: s.fiatCurrency,
306
- ...v ? { cryptoAmount: s.cryptoAmount } : { fiatAmount: s.fiatAmount },
307
- cryptoCurrency: s.cryptoCurrency,
308
- network: s.network,
309
- walletAddress: s.walletAddress,
310
- paymentMethodId: s.paymentMethodId || void 0,
311
- email: s.email || void 0,
312
- orderType: s.flowType
313
- }), P({ type: "SET_STEP", step: "checkout" });
314
- } catch (w) {
315
- const _ = w instanceof Error ? w.message : "Failed to create order";
316
- /wallet|address/i.test(_) ? P({ type: "SET_WALLET_ERROR", message: _.replace(/^Failed to create checkout intent:\s*/i, "") }) : P({ type: "SET_ERROR", message: _ });
313
+ await ce({
314
+ gateway: v,
315
+ customerId: c.customerId || void 0,
316
+ fiatCurrency: c.fiatCurrency,
317
+ ...C ? { cryptoAmount: c.cryptoAmount } : { fiatAmount: c.fiatAmount },
318
+ cryptoCurrency: c.cryptoCurrency,
319
+ network: c.network,
320
+ walletAddress: c.walletAddress,
321
+ paymentMethodId: c.paymentMethodId || void 0,
322
+ email: c.email || void 0,
323
+ orderType: c.flowType
324
+ }), O({ type: "SET_STEP", step: "checkout" });
325
+ } catch (T) {
326
+ const H = T instanceof Error ? T.message : "Failed to create order";
327
+ /wallet|address/i.test(H) ? O({ type: "SET_WALLET_ERROR", message: H.replace(/^Failed to create checkout intent:\s*/i, "") }) : O({ type: "SET_ERROR", message: H });
317
328
  }
318
- }, [s, se, v]), J = $((N) => {
319
- P({ type: "SET_STEP", step: N });
320
- }, []), ie = $(() => {
321
- const N = ["confirm", "amount", "quotes", "wallet", "checkout", "processing", "complete"], S = N.indexOf(s.step);
322
- S > 0 && P({ type: "SET_STEP", step: N[S - 1] });
323
- }, [s.step, v]), Ie = X(() => {
324
- const N = v ? !!s.cryptoAmount : !!s.fiatAmount;
325
- switch (s.step) {
329
+ }, [c, ce, C]), q = _((v) => {
330
+ O({ type: "SET_STEP", step: v });
331
+ }, []), ie = _(() => {
332
+ const v = ["confirm", "amount", "quotes", "wallet", "checkout", "processing", "complete"], E = v.indexOf(c.step);
333
+ E > 0 && O({ type: "SET_STEP", step: v[E - 1] });
334
+ }, [c.step, C]), Oe = F(() => {
335
+ const v = C ? !!c.cryptoAmount : !!c.fiatAmount;
336
+ switch (c.step) {
326
337
  case "confirm":
327
- return !!(N && s.cryptoCurrency && s.network && s.walletAddress && !K);
338
+ return !!(v && c.cryptoCurrency && c.network && c.walletAddress && !$);
328
339
  case "amount":
329
- return !!(N && s.cryptoCurrency && s.network && !K);
340
+ return !!(v && c.cryptoCurrency && c.network && !$);
330
341
  case "quotes":
331
- return !!s.selectedQuote;
342
+ return !!c.selectedQuote;
332
343
  case "wallet":
333
- return !!s.walletAddress;
344
+ return !!c.walletAddress;
334
345
  default:
335
346
  return !1;
336
347
  }
337
- }, [s, K, v]), xe = {
338
- apiConfig: O,
348
+ }, [c, $, C]), xe = {
349
+ apiConfig: P,
339
350
  assetBaseUrl: n,
340
- config: I,
341
- configLoading: D,
342
- configError: F,
343
- state: s,
344
- dispatch: P,
345
- quotes: pe,
351
+ config: L,
352
+ configLoading: K,
353
+ configError: X,
354
+ state: c,
355
+ dispatch: O,
356
+ quotes: he,
346
357
  quotesLoading: fe,
347
358
  quotesError: Y,
348
359
  fetchQuotes: ye,
349
- order: ee,
350
- orderLoading: ve,
351
- orderError: ce,
352
- createOrder: Ee,
360
+ order: ae,
361
+ orderLoading: Ce,
362
+ orderError: se,
363
+ createOrder: we,
353
364
  orderStatus: V,
354
- orderStatusLoading: te,
365
+ orderStatusLoading: ne,
355
366
  fieldLocks: x || null,
356
- defaultGateway: ae,
357
- amountError: K,
358
- goToStep: J,
367
+ defaultGateway: re,
368
+ amountError: $,
369
+ goToStep: q,
359
370
  goBack: ie,
360
- canProceed: Ie
371
+ canProceed: Oe
361
372
  };
362
- return /* @__PURE__ */ e(ht.Provider, { value: xe, children: L });
373
+ return /* @__PURE__ */ e(ft.Provider, { value: xe, children: S });
363
374
  }
364
- function he() {
365
- const t = wt(ht);
375
+ function pe() {
376
+ const t = kt(ft);
366
377
  if (!t)
367
378
  throw new Error("useRamp must be used within a RampProvider");
368
379
  return t;
369
380
  }
370
- function Ot({
371
- className: t = "",
372
- iframeHeight: a = 600,
373
- autoRedirect: n = !1,
374
- redirectDelay: l = 3e3
375
- }) {
376
- var g;
377
- const { order: r, orderStatus: d, goToStep: u, goBack: m } = he(), [c, i] = C(!1), [p, f] = C(null), x = r != null && r.checkout.expiresAt ? Date.now() > r.checkout.expiresAt : !1;
378
- if (H(() => {
379
- if ((r == null ? void 0 : r.checkout.method) === "redirect" && n && !x) {
380
- f(Math.ceil(l / 1e3));
381
- const h = setTimeout(() => {
382
- window.location.href = r.checkout.url;
383
- }, l), b = setInterval(() => {
384
- f((L) => L && L > 1 ? L - 1 : null);
385
- }, 1e3);
386
- return () => {
387
- clearTimeout(h), clearInterval(b);
388
- };
389
- }
390
- }, [r, n, l, x]), H(() => {
391
- d && (d.status === "completed" ? u("complete") : ["failed", "cancelled", "expired"].includes(d.status) && u("error"));
392
- }, [d == null ? void 0 : d.status, u]), !r)
393
- return /* @__PURE__ */ o("div", { className: `flex flex-col items-center justify-center p-8 ${t}`, style: { color: "var(--t-text)" }, children: [
394
- /* @__PURE__ */ e("p", { className: "text-[15px] mb-4", children: "No order found" }),
395
- /* @__PURE__ */ e(
396
- "button",
397
- {
398
- className: "font-semibold text-[14px] transition-all",
399
- style: { height: 48, borderRadius: 5, background: "var(--t-surface)", color: "var(--t-text)", paddingLeft: 24, paddingRight: 24 },
400
- onClick: m,
401
- children: "Go Back"
402
- }
403
- )
404
- ] });
405
- if (x)
406
- return /* @__PURE__ */ o("div", { className: `flex flex-col items-center justify-center p-8 text-center ${t}`, style: { color: "var(--t-text)" }, children: [
407
- /* @__PURE__ */ e("div", { className: "text-[48px] mb-4", children: "⏰" }),
408
- /* @__PURE__ */ e("h3", { className: "text-[18px] font-semibold mb-2", children: "Checkout Expired" }),
409
- /* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: "The checkout link has expired. Please try again." }),
410
- /* @__PURE__ */ e(
411
- "button",
412
- {
413
- className: "w-full font-semibold text-[16px] transition-all",
414
- style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)" },
415
- onClick: m,
416
- children: "Start Over"
417
- }
418
- )
419
- ] });
420
- if (r.checkout.method === "iframe")
421
- return /* @__PURE__ */ e("div", { className: `flex flex-col flex-1 ${t}`, children: /* @__PURE__ */ o("div", { className: "relative flex-1", style: { height: a, borderRadius: 5, overflow: "hidden", background: "var(--t-surface)" }, children: [
422
- !c && /* @__PURE__ */ o("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
423
- /* @__PURE__ */ e("div", { className: "nramp-spinner" }),
424
- /* @__PURE__ */ e("p", { className: "text-[14px] mt-4", style: { color: "var(--t-text-secondary)" }, children: "Loading checkout..." })
425
- ] }),
426
- /* @__PURE__ */ e(
427
- "iframe",
428
- {
429
- src: r.checkout.url,
430
- style: {
431
- display: c ? "block" : "none",
432
- width: "100%",
433
- height: "100%",
434
- border: "none"
435
- },
436
- allow: ((g = r.checkout.allowedFeatures) == null ? void 0 : g.join("; ")) || "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share",
437
- onLoad: () => i(!0),
438
- title: "Provider Checkout"
439
- }
440
- )
441
- ] }) });
442
- if (r.checkout.method === "redirect")
443
- return /* @__PURE__ */ o("div", { className: `flex flex-col items-center justify-center p-8 text-center ${t}`, style: { color: "var(--t-text)" }, children: [
444
- /* @__PURE__ */ e("div", { className: "text-[48px] mb-4", children: "🔗" }),
445
- /* @__PURE__ */ e("h3", { className: "text-[18px] font-semibold mb-2", children: "Complete Payment" }),
446
- /* @__PURE__ */ o("p", { className: "text-[14px] mb-4", style: { color: "var(--t-text-secondary)" }, children: [
447
- "You'll be redirected to ",
448
- r.gateway,
449
- " to complete your payment."
450
- ] }),
451
- p !== null && /* @__PURE__ */ o("p", { className: "text-[13px] mb-4", style: { color: "var(--t-text-muted)" }, children: [
452
- "Redirecting in ",
453
- p,
454
- "..."
455
- ] }),
456
- /* @__PURE__ */ o(
457
- "a",
458
- {
459
- href: r.checkout.url,
460
- className: "w-full font-semibold text-[16px] flex items-center justify-center transition-all",
461
- style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)", textDecoration: "none" },
462
- target: "_blank",
463
- rel: "noopener noreferrer",
464
- children: [
465
- "Continue to ",
466
- r.gateway
467
- ]
468
- }
469
- ),
470
- /* @__PURE__ */ e(
471
- "button",
472
- {
473
- className: "w-full font-semibold text-[14px] mt-2 transition-all",
474
- style: { height: 48, borderRadius: 5, background: "var(--t-surface)", color: "var(--t-text)" },
475
- onClick: m,
476
- children: "Cancel"
477
- }
478
- )
479
- ] });
480
- if (r.checkout.method === "widget" && r.widgetConfig) {
481
- const h = Pt(r.checkout.url, r.widgetConfig);
482
- return /* @__PURE__ */ e("div", { className: `flex flex-col flex-1 ${t}`, children: /* @__PURE__ */ o("div", { className: "relative flex-1", style: { height: a, borderRadius: 5, overflow: "hidden", background: "var(--t-surface)" }, children: [
483
- !c && /* @__PURE__ */ o("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
484
- /* @__PURE__ */ e("div", { className: "nramp-spinner" }),
485
- /* @__PURE__ */ e("p", { className: "text-[14px] mt-4", style: { color: "var(--t-text-secondary)" }, children: "Loading checkout..." })
486
- ] }),
487
- /* @__PURE__ */ e(
488
- "iframe",
489
- {
490
- src: h,
491
- style: {
492
- display: c ? "block" : "none",
493
- width: "100%",
494
- height: "100%",
495
- border: "none"
496
- },
497
- allow: "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share",
498
- onLoad: () => i(!0),
499
- title: "Payment Checkout"
500
- }
501
- )
502
- ] }) });
503
- }
504
- return /* @__PURE__ */ o("div", { className: `flex flex-col items-center justify-center p-8 ${t}`, style: { color: "var(--t-text)" }, children: [
505
- /* @__PURE__ */ e("p", { className: "text-[15px] mb-4", children: "Unknown checkout method" }),
506
- /* @__PURE__ */ e(
507
- "button",
508
- {
509
- className: "font-semibold text-[14px] transition-all",
510
- style: { height: 48, borderRadius: 5, background: "var(--t-surface)", color: "var(--t-text)", paddingLeft: 24, paddingRight: 24 },
511
- onClick: m,
512
- children: "Go Back"
513
- }
514
- )
515
- ] });
516
- }
517
- function Pt(t, a) {
518
- const n = new URL("/en/partner/widget", t);
519
- for (const [l, r] of Object.entries(a))
520
- r != null && r !== "" && n.searchParams.set(l, String(r));
521
- return n.toString();
522
- }
523
- function Ht({ className: t = "" }) {
524
- const { orderStatus: a, orderStatusLoading: n, goToStep: l } = he();
525
- H(() => {
526
- a && (a.status === "completed" ? l("complete") : ["failed", "cancelled", "expired", "refunded"].includes(a.status) && l("error"));
527
- }, [a == null ? void 0 : a.status, l]);
528
- const r = () => {
529
- if (!a) return "Processing your order...";
530
- switch (a.status) {
531
- case "pending":
532
- return "Waiting for payment confirmation...";
533
- case "processing":
534
- return "Processing your transaction...";
535
- default:
536
- return "Processing...";
537
- }
538
- };
539
- return /* @__PURE__ */ o("div", { className: `flex flex-col items-center justify-center px-8 py-12 text-center ${t}`, children: [
540
- /* @__PURE__ */ e("div", { className: "mb-6", children: /* @__PURE__ */ e("div", { className: "nramp-spinner-large nramp-spinner" }) }),
541
- /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-3", style: { color: "var(--t-text)" }, children: r() }),
542
- n && /* @__PURE__ */ e("p", { className: "text-[13px] mb-4", style: { color: "var(--t-text-muted)" }, children: "Checking status..." }),
543
- a && /* @__PURE__ */ o("div", { className: "w-full mt-6 text-left", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
544
- /* @__PURE__ */ e(me, { label: "Order ID", value: a.orderId, mono: !0 }),
545
- /* @__PURE__ */ e(me, { label: "Provider", value: a.gateway }),
546
- /* @__PURE__ */ e(
547
- me,
548
- {
549
- label: "Amount",
550
- value: `${a.fiatAmount} ${a.fiatCurrency}`
551
- }
552
- ),
553
- /* @__PURE__ */ e(
554
- me,
555
- {
556
- label: "Receiving",
557
- value: `${a.cryptoAmount || "..."} ${a.cryptoCurrency}`
558
- }
559
- ),
560
- /* @__PURE__ */ e(me, { label: "Network", value: a.network }),
561
- /* @__PURE__ */ e(
562
- me,
563
- {
564
- label: "To Address",
565
- value: `${a.walletAddress.slice(0, 10)}...${a.walletAddress.slice(-8)}`,
566
- mono: !0
567
- }
568
- )
569
- ] }),
570
- /* @__PURE__ */ o("div", { className: "mt-6", children: [
571
- /* @__PURE__ */ e("p", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "This usually takes a few minutes." }),
572
- /* @__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." })
573
- ] })
574
- ] });
575
- }
576
- function me({ label: t, value: a, mono: n }) {
577
- return /* @__PURE__ */ o(
578
- "div",
579
- {
580
- className: "flex justify-between items-center py-2",
581
- style: { borderBottom: "1px solid var(--t-divider)" },
582
- children: [
583
- /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: t }),
584
- /* @__PURE__ */ e(
585
- "span",
586
- {
587
- className: `text-[13px] font-medium ${n ? "font-mono" : ""}`,
588
- style: { color: "var(--t-text)" },
589
- children: a
590
- }
591
- )
592
- ]
593
- }
594
- );
595
- }
596
- function Ut({
597
- className: t = "",
598
- explorerUrl: a,
599
- onDone: n,
600
- doneButtonText: l = "Done"
601
- }) {
602
- const { orderStatus: r, state: d, dispatch: u } = he(), m = d.flowType === "sell", c = () => {
603
- if (!(r != null && r.transactionHash)) return null;
604
- if (!a) {
605
- const f = {
606
- ethereum: "https://etherscan.io/tx/{txHash}",
607
- polygon: "https://polygonscan.com/tx/{txHash}",
608
- arbitrum: "https://arbiscan.io/tx/{txHash}",
609
- optimism: "https://optimistic.etherscan.io/tx/{txHash}",
610
- base: "https://basescan.org/tx/{txHash}",
611
- bitcoin: "https://mempool.space/tx/{txHash}",
612
- solana: "https://solscan.io/tx/{txHash}",
613
- avalanche: "https://snowtrace.io/tx/{txHash}",
614
- fantom: "https://ftmscan.com/tx/{txHash}"
615
- };
616
- return (f[d.network] || f.ethereum).replace("{txHash}", r.transactionHash);
617
- }
618
- return a.replace("{txHash}", r.transactionHash);
619
- }, i = () => {
620
- n ? n() : u({ type: "RESET" });
621
- }, p = c();
622
- return /* @__PURE__ */ o("div", { className: `flex flex-col items-center px-8 py-12 text-center ${t}`, children: [
623
- /* @__PURE__ */ e(
624
- "div",
625
- {
626
- className: "flex items-center justify-center mb-5",
627
- style: { width: 64, height: 64, borderRadius: "50%", background: "var(--t-success, #10b981)" },
628
- children: /* @__PURE__ */ e("svg", { viewBox: "0 0 24 24", width: "32", height: "32", fill: "white", children: /* @__PURE__ */ e("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z" }) })
629
- }
630
- ),
631
- /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: m ? "Sale Complete!" : "Purchase Complete!" }),
632
- /* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: m ? `Your ${(r == null ? void 0 : r.fiatCurrency) || d.fiatCurrency} payout is being processed.` : `Your ${(r == null ? void 0 : r.cryptoCurrency) || d.cryptoCurrency} has been sent to your wallet.` }),
633
- r && /* @__PURE__ */ o("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
634
- /* @__PURE__ */ e(
635
- q,
636
- {
637
- label: m ? "Amount Sold" : "Amount Received",
638
- value: `${r.cryptoAmount} ${r.cryptoCurrency}`,
639
- highlight: !0
640
- }
641
- ),
642
- /* @__PURE__ */ e(
643
- q,
644
- {
645
- label: m ? "Payout Amount" : "Amount Paid",
646
- value: `${r.fiatAmount} ${r.fiatCurrency}`
647
- }
648
- ),
649
- /* @__PURE__ */ e(q, { label: "Network", value: r.network }),
650
- /* @__PURE__ */ e(
651
- q,
652
- {
653
- label: "Wallet",
654
- value: `${r.walletAddress.slice(0, 10)}...${r.walletAddress.slice(-8)}`,
655
- mono: !0
656
- }
657
- ),
658
- r.transactionHash && /* @__PURE__ */ e(
659
- q,
660
- {
661
- label: "Transaction",
662
- value: `${r.transactionHash.slice(0, 10)}...${r.transactionHash.slice(-8)}`,
663
- mono: !0
664
- }
665
- ),
666
- /* @__PURE__ */ e(q, { label: "Provider", value: r.gateway }),
667
- /* @__PURE__ */ e(q, { label: "Order ID", value: r.orderId, mono: !0 }),
668
- r.completedAt && /* @__PURE__ */ e(
669
- q,
670
- {
671
- label: "Completed",
672
- value: new Date(r.completedAt).toLocaleString()
673
- }
674
- )
675
- ] }),
676
- /* @__PURE__ */ o("div", { className: "w-full flex flex-col gap-2", children: [
677
- p && /* @__PURE__ */ e(
678
- "a",
679
- {
680
- href: p,
681
- target: "_blank",
682
- rel: "noopener noreferrer",
683
- className: "w-full font-semibold text-[14px] flex items-center justify-center transition-all",
684
- style: { height: 48, borderRadius: 5, background: "var(--t-surface)", color: "var(--t-text)", textDecoration: "none" },
685
- children: "View on Explorer"
686
- }
687
- ),
688
- /* @__PURE__ */ e(
689
- "button",
690
- {
691
- className: "w-full font-semibold text-[16px] transition-all",
692
- style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)" },
693
- onClick: i,
694
- children: l
695
- }
696
- )
697
- ] })
698
- ] });
699
- }
700
- function q({ label: t, value: a, mono: n, highlight: l }) {
701
- return /* @__PURE__ */ o(
702
- "div",
703
- {
704
- className: "flex justify-between items-center py-2",
705
- style: { borderBottom: "1px solid var(--t-divider)" },
706
- children: [
707
- /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: t }),
708
- /* @__PURE__ */ e(
709
- "span",
710
- {
711
- className: `text-[13px] font-medium ${n ? "font-mono" : ""}`,
712
- style: { color: l ? "var(--t-success, #10b981)" : "var(--t-text)" },
713
- children: a
714
- }
715
- )
716
- ]
717
- }
718
- );
719
- }
720
- function Dt({
721
- className: t = "",
722
- onRetry: a,
723
- supportEmail: n = "support@nowramp.com"
724
- }) {
725
- const { state: l, orderStatus: r, dispatch: d, goToStep: u } = he(), m = l.flowType === "sell", c = () => {
726
- if (r)
727
- switch (r.status) {
728
- case "failed":
729
- return "Payment Failed";
730
- case "cancelled":
731
- return "Order Cancelled";
732
- case "expired":
733
- return "Order Expired";
734
- case "refunded":
735
- return "Order Refunded";
736
- default:
737
- return "Something Went Wrong";
738
- }
739
- return "Something Went Wrong";
740
- }, i = () => {
741
- if (l.errorMessage) return l.errorMessage;
742
- if (r)
743
- switch (r.status) {
744
- case "failed":
745
- return m ? "Your sale could not be processed. Please try again." : "Your payment could not be processed. Please try again or use a different payment method.";
746
- case "cancelled":
747
- return m ? "Your sale was cancelled. No crypto was transferred." : "Your order was cancelled. No payment was processed.";
748
- case "expired":
749
- return m ? "Your order has expired. Please start a new sale." : "Your order has expired. Please start a new purchase.";
750
- case "refunded":
751
- return m ? "Your crypto has been returned. The funds should appear in your wallet shortly." : "Your payment has been refunded. The funds should appear in your account within 5-10 business days.";
752
- default:
753
- return "An unexpected error occurred. Please try again.";
754
- }
755
- return "An unexpected error occurred. Please try again.";
756
- }, p = () => {
757
- d({ type: "CLEAR_ERROR" }), a ? a() : (d({ type: "RESET" }), u("amount"));
758
- }, f = () => {
759
- d({ type: "RESET" }), u("amount");
760
- };
761
- return /* @__PURE__ */ o("div", { className: `flex flex-col items-center px-8 py-12 text-center ${t}`, children: [
762
- /* @__PURE__ */ e(
763
- "div",
764
- {
765
- className: "flex items-center justify-center mb-5",
766
- style: { width: 64, height: 64, borderRadius: "50%", background: "var(--t-error, #EF4444)" },
767
- 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" }) })
768
- }
769
- ),
770
- /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: c() }),
771
- /* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: i() }),
772
- r && /* @__PURE__ */ o("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
773
- /* @__PURE__ */ o("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
774
- /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Order ID" }),
775
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium font-mono", style: { color: "var(--t-text)" }, children: r.orderId })
776
- ] }),
777
- /* @__PURE__ */ o("div", { className: "flex justify-between items-center py-2", children: [
778
- /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Status" }),
779
- /* @__PURE__ */ e(
780
- "span",
781
- {
782
- className: "text-[12px] font-medium px-2 py-0.5",
783
- style: { background: "rgba(239,68,68,0.15)", color: "#EF4444", borderRadius: 4 },
784
- children: r.gatewayStatus
785
- }
786
- )
787
- ] })
788
- ] }),
789
- /* @__PURE__ */ o("div", { className: "w-full flex flex-col gap-2", children: [
790
- /* @__PURE__ */ e(
791
- "button",
792
- {
793
- className: "w-full font-semibold text-[16px] transition-all",
794
- style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)" },
795
- onClick: p,
796
- children: "Try Again"
797
- }
798
- ),
799
- /* @__PURE__ */ e(
800
- "button",
801
- {
802
- className: "w-full font-semibold text-[14px] transition-all",
803
- style: { height: 48, borderRadius: 5, background: "var(--t-surface)", color: "var(--t-text)" },
804
- onClick: f,
805
- children: "Start Over"
806
- }
807
- )
808
- ] }),
809
- /* @__PURE__ */ o("div", { className: "mt-6", children: [
810
- /* @__PURE__ */ o("p", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: [
811
- "Need help? Contact",
812
- " ",
813
- /* @__PURE__ */ e(
814
- "a",
815
- {
816
- href: `mailto:${n}`,
817
- className: "underline",
818
- style: { color: "var(--t-accent)" },
819
- children: n
820
- }
821
- )
822
- ] }),
823
- r && /* @__PURE__ */ o("p", { className: "text-[12px] mt-1", style: { color: "var(--t-text-muted)" }, children: [
824
- "Reference: ",
825
- r.orderId
826
- ] })
827
- ] })
828
- ] });
829
- }
830
- function ot(t) {
831
- return t.length <= 12 ? t : `${t.slice(0, 6)}...${t.slice(-6)}`;
832
- }
833
- function Ft({ className: t = "" }) {
834
- const {
835
- config: a,
836
- configLoading: n,
837
- state: l,
838
- defaultGateway: r,
839
- fetchQuotes: d,
840
- createOrder: u,
841
- orderLoading: m
842
- } = he(), c = l.flowType === "sell", [i, p] = C(null), f = a == null ? void 0 : a.gateways.find((g) => g.id === r), x = async () => {
843
- p(null);
844
- try {
845
- d(), await u();
846
- } catch (g) {
847
- const h = g instanceof Error ? g.message : "Failed to create order";
848
- p(h);
849
- }
850
- };
851
- return n ? /* @__PURE__ */ o("div", { className: `flex flex-col items-center justify-center p-12 ${t}`, children: [
852
- /* @__PURE__ */ e("div", { className: "nramp-spinner" }),
853
- /* @__PURE__ */ e("p", { className: "text-[14px] mt-4", style: { color: "var(--t-text-secondary)" }, children: "Loading..." })
854
- ] }) : /* @__PURE__ */ o("div", { className: `flex flex-col items-center px-8 py-12 ${t}`, children: [
855
- /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-6", style: { color: "var(--t-text)" }, children: c ? "Confirm Sale" : "Confirm Purchase" }),
856
- /* @__PURE__ */ o("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
857
- f && /* @__PURE__ */ o("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
858
- /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Provider" }),
859
- /* @__PURE__ */ o("span", { className: "flex items-center gap-2", children: [
860
- f.logo && /* @__PURE__ */ e("img", { src: f.logo, alt: f.name, width: 20, height: 20, style: { borderRadius: 4 } }),
861
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: f.name })
862
- ] })
863
- ] }),
864
- c ? /* @__PURE__ */ o(le, { children: [
865
- /* @__PURE__ */ e(oe, { label: "You sell", value: `${l.cryptoAmount} ${l.cryptoCurrency}`, highlight: !0 }),
866
- /* @__PURE__ */ e(oe, { label: "You receive", value: `${l.fiatCurrency} payout` })
867
- ] }) : /* @__PURE__ */ o(le, { children: [
868
- /* @__PURE__ */ e(oe, { label: "You pay", value: `${l.fiatAmount} ${l.fiatCurrency}`, highlight: !0 }),
869
- /* @__PURE__ */ e(oe, { label: "You receive", value: `${l.cryptoCurrency} on ${l.network}` }),
870
- /* @__PURE__ */ e(oe, { label: "Wallet", value: ot(l.walletAddress), mono: !0 })
871
- ] }),
872
- /* @__PURE__ */ e(oe, { label: "Network", value: l.network }),
873
- c && l.walletAddress && /* @__PURE__ */ e(oe, { label: "Refund address", value: ot(l.walletAddress), mono: !0 })
874
- ] }),
875
- i && /* @__PURE__ */ e("p", { className: "text-[12px] mb-4", style: { color: "#EF4444" }, children: i }),
876
- /* @__PURE__ */ e(
877
- "button",
878
- {
879
- className: "w-full font-semibold text-[16px] transition-all flex items-center justify-center gap-2",
880
- style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)", opacity: m ? 0.7 : 1 },
881
- disabled: m,
882
- onClick: x,
883
- children: m ? /* @__PURE__ */ o(le, { children: [
884
- /* @__PURE__ */ e("span", { className: "nramp-spinner-inline" }),
885
- "Processing..."
886
- ] }) : c ? "Confirm & Sell" : "Confirm & Pay"
887
- }
888
- )
889
- ] });
890
- }
891
- function oe({ label: t, value: a, mono: n, highlight: l }) {
892
- return /* @__PURE__ */ o("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
893
- /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: t }),
894
- /* @__PURE__ */ e(
895
- "span",
896
- {
897
- className: `text-[13px] font-medium ${n ? "font-mono" : ""}`,
898
- style: { color: l ? "var(--t-success, #10b981)" : "var(--t-text)" },
899
- children: a
900
- }
901
- )
902
- ] });
903
- }
904
- function De({
905
- isOpen: t,
906
- onClose: a,
907
- children: n
908
- }) {
909
- const [l, r] = C(!1), [d, u] = C(!1);
910
- H(() => {
911
- if (t)
912
- r(!0), requestAnimationFrame(() => requestAnimationFrame(() => u(!0)));
913
- else if (l) {
914
- u(!1);
915
- const c = setTimeout(() => r(!1), 250);
916
- return () => clearTimeout(c);
917
- }
918
- }, [t]);
919
- const m = $(() => {
920
- u(!1), setTimeout(() => a(), 250);
921
- }, [a]);
922
- return l ? /* @__PURE__ */ e(
923
- "div",
924
- {
925
- className: "absolute inset-0 z-20 transition-opacity duration-250",
926
- style: { opacity: d ? 1 : 0 },
927
- children: /* @__PURE__ */ e(
928
- "div",
929
- {
930
- className: "absolute inset-0 flex flex-col transition-transform duration-250 ease-out",
931
- style: { background: "var(--t-modal-bg)", transform: d ? "translateY(0)" : "translateY(24px)" },
932
- children: typeof n == "function" ? n(m) : n
933
- }
934
- )
935
- }
936
- ) : null;
937
- }
938
- function Kt({ char: t, height: a = 38 }) {
939
- const n = "0123456789", l = n.indexOf(t);
940
- return l === -1 ? /* @__PURE__ */ e("span", { children: t }) : /* @__PURE__ */ e("span", { className: "digit-slot", style: { height: a, lineHeight: `${a}px` }, children: /* @__PURE__ */ e("span", { className: "digit-slot-inner block", style: { transform: `translateY(-${l * a}px)` }, children: n.split("").map((r) => /* @__PURE__ */ e("span", { className: "block", style: { height: a, lineHeight: `${a}px` }, children: r }, r)) }) });
941
- }
942
- function _t({
943
- value: t,
944
- height: a = 38,
945
- className: n = "",
946
- style: l = {}
947
- }) {
948
- return /* @__PURE__ */ e("span", { className: n, style: { display: "inline-flex", ...l }, children: t.split("").map((r, d) => /* @__PURE__ */ e(Kt, { char: r, height: a }, d)) });
949
- }
950
- function B({
951
- w: t,
952
- h: a,
953
- className: n = ""
954
- }) {
955
- return /* @__PURE__ */ e("div", { className: `skeleton ${n}`, style: { width: t, height: a } });
956
- }
957
- function Xt() {
958
- return /* @__PURE__ */ o("div", { className: "flex-1 px-5 flex flex-col", children: [
959
- /* @__PURE__ */ o("div", { className: "px-[18px] pt-[14px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5 }, children: [
960
- /* @__PURE__ */ e(B, { w: 70, h: 14, className: "mb-3" }),
961
- /* @__PURE__ */ o("div", { className: "flex justify-between items-center", children: [
962
- /* @__PURE__ */ e(B, { w: 120, h: 32 }),
963
- /* @__PURE__ */ e(B, { w: 75, h: 32 })
964
- ] })
965
- ] }),
966
- /* @__PURE__ */ o("div", { className: "px-[18px] pt-[12px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5, marginTop: 4 }, children: [
967
- /* @__PURE__ */ e(B, { w: 50, h: 14, className: "mb-3" }),
968
- /* @__PURE__ */ o("div", { className: "flex justify-between items-center", children: [
969
- /* @__PURE__ */ e(B, { w: 180, h: 32 }),
970
- /* @__PURE__ */ e(B, { w: 85, h: 32 })
971
- ] })
972
- ] }),
973
- /* @__PURE__ */ o("div", { className: "flex justify-between mt-3 px-[2px]", children: [
974
- /* @__PURE__ */ e(B, { w: 140, h: 12 }),
975
- /* @__PURE__ */ e(B, { w: 90, h: 12 })
976
- ] }),
977
- /* @__PURE__ */ o("div", { className: "mt-8", children: [
978
- /* @__PURE__ */ e(B, { w: 65, h: 14, className: "mb-2.5" }),
979
- /* @__PURE__ */ e(B, { w: "100%", h: 47 })
980
- ] }),
981
- /* @__PURE__ */ e("div", { className: "flex-1" }),
982
- /* @__PURE__ */ e(B, { w: "100%", h: 60, className: "mb-2" }),
983
- /* @__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" }) })
984
- ] });
985
- }
986
- const Re = {
381
+ const Ie = {
987
382
  ETH: { name: "Ethereum (ERC20)", shortName: "Ethereum", icon: "eth" },
988
383
  BSC: { name: "Binance Smart Chain (BEP20)", shortName: "Binance", icon: "bnb" },
989
384
  BTC: { name: "Bitcoin", icon: "btc" },
@@ -1117,7 +512,7 @@ const Re = {
1117
512
  OKC: { name: "OKX Chain", icon: "eth" },
1118
513
  UNI_CHAIN: { name: "UNI", icon: "uni" },
1119
514
  ZEC: { name: "ZCash", icon: "zec" }
1120
- }, $t = [
515
+ }, Ut = [
1121
516
  // --- Popular / Top coins ---
1122
517
  { code: "BTC", name: "Bitcoin", chains: ["BTC", "LN"], popular: !0 },
1123
518
  { code: "ETH", name: "Ethereum", chains: ["ETH", "ARB", "BASE", "BSC", "OPTIMISM", "LINEA", "ZKSYNC", "LRC", "STARK", "APE", "ECLIPSE", "FUEL", "INK", "SOPHON", "UNICHAIN", "WLD"], popular: !0 },
@@ -1310,7 +705,7 @@ const Re = {
1310
705
  { code: "ZCHF", name: "Frankencoin", chains: ["ETH"], popular: !1 },
1311
706
  { code: "ZETA", name: "Zeta", chains: ["ETH", "ZETACHAIN"], popular: !1 },
1312
707
  { code: "ZTG", name: "Zeitgeist", chains: ["ZTG"], popular: !1 }
1313
- ], Gt = {
708
+ ], Dt = {
1314
709
  USD: "us",
1315
710
  EUR: "eu",
1316
711
  GBP: "gb",
@@ -1324,18 +719,18 @@ const Re = {
1324
719
  ARS: "ar",
1325
720
  ALL: "al"
1326
721
  };
1327
- function pt(t, a = "") {
722
+ function yt(t, a = "") {
1328
723
  return `${a}/crypto-icons/${t.toLowerCase()}.svg`;
1329
724
  }
1330
- function Wt(t, a = "") {
1331
- const n = Gt[t] || "us";
725
+ function Ft(t, a = "") {
726
+ const n = Dt[t] || "us";
1332
727
  return `${a}/flags/${n}.svg`;
1333
728
  }
1334
- function Ke(t, a = "") {
1335
- const n = Re[t];
729
+ function _e(t, a = "") {
730
+ const n = Ie[t];
1336
731
  return n ? `${a}/crypto-icons/${n.icon}.svg` : `${a}/crypto-icons/${t.toLowerCase()}.svg`;
1337
732
  }
1338
- const lt = [
733
+ const st = [
1339
734
  { code: "ALL", name: "Albania Lek" },
1340
735
  { code: "ARS", name: "Argentina Peso" },
1341
736
  { code: "AUD", name: "Australian Dollar" },
@@ -1355,7 +750,7 @@ const lt = [
1355
750
  { id: "orange", name: "Orange", accent: "#F59E0B" },
1356
751
  { id: "rose", name: "Rose", accent: "#F43F5E" },
1357
752
  { id: "mono", name: "Mono", accent: null }
1358
- ], st = {
753
+ ], it = {
1359
754
  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 },
1360
755
  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 },
1361
756
  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 },
@@ -1365,14 +760,14 @@ const lt = [
1365
760
  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 },
1366
761
  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 }
1367
762
  };
1368
- function xa(t, a) {
1369
- var n, l;
1370
- return ((n = st[t]) == null ? void 0 : n[a]) ?? ((l = st.USDC) == null ? void 0 : l[a]) ?? 1;
763
+ function Aa(t, a) {
764
+ var n, s;
765
+ return ((n = it[t]) == null ? void 0 : n[a]) ?? ((s = it.USDC) == null ? void 0 : s[a]) ?? 1;
1371
766
  }
1372
- function Yt(t) {
767
+ function Kt(t) {
1373
768
  return parseFloat(t.replace(/,/g, "")) || 0;
1374
769
  }
1375
- function ga(t) {
770
+ function wa(t) {
1376
771
  if (t === 0) return "0";
1377
772
  if (t >= 1e3) return t.toLocaleString("en-US", { maximumFractionDigits: 2 });
1378
773
  if (t >= 1) return t.toFixed(2);
@@ -1380,18 +775,18 @@ function ga(t) {
1380
775
  const a = t.toPrecision(4);
1381
776
  return parseFloat(a).toString();
1382
777
  }
1383
- const Fe = (t) => /^#([0-9A-Fa-f]{3}){1,2}$/.test(t), it = 10, dt = 1e-4, Vt = (() => {
778
+ const Ke = (t) => /^#([0-9A-Fa-f]{3}){1,2}$/.test(t), dt = 10, ut = 1e-4, _t = (() => {
1384
779
  const t = [];
1385
- for (const a of $t)
780
+ for (const a of Ut)
1386
781
  for (const n of a.chains)
1387
782
  t.push({ code: a.code, name: a.name, chain: n, popular: a.popular });
1388
783
  return t;
1389
784
  })();
1390
- function ut({ ticker: t, size: a = 32, baseUrl: n = "" }) {
785
+ function mt({ ticker: t, size: a = 32, baseUrl: n = "" }) {
1391
786
  return /* @__PURE__ */ e(
1392
787
  "img",
1393
788
  {
1394
- src: pt(t, n),
789
+ src: yt(t, n),
1395
790
  alt: t,
1396
791
  width: a,
1397
792
  height: a,
@@ -1400,11 +795,11 @@ function ut({ ticker: t, size: a = 32, baseUrl: n = "" }) {
1400
795
  }
1401
796
  );
1402
797
  }
1403
- function _e({ currencyCode: t, size: a = 16, baseUrl: n = "" }) {
798
+ function Xe({ currencyCode: t, size: a = 16, baseUrl: n = "" }) {
1404
799
  return /* @__PURE__ */ e(
1405
800
  "img",
1406
801
  {
1407
- src: Wt(t, n),
802
+ src: Ft(t, n),
1408
803
  alt: t,
1409
804
  width: a,
1410
805
  height: a,
@@ -1413,14 +808,14 @@ function _e({ currencyCode: t, size: a = 16, baseUrl: n = "" }) {
1413
808
  }
1414
809
  );
1415
810
  }
1416
- function ft({ size: t = 32, color: a = "#888" }) {
1417
- return /* @__PURE__ */ o("svg", { width: t, height: t, viewBox: "0 0 32 32", fill: "none", children: [
811
+ function $e({ size: t = 32, color: a = "#888" }) {
812
+ return /* @__PURE__ */ l("svg", { width: t, height: t, viewBox: "0 0 32 32", fill: "none", children: [
1418
813
  /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "16", fill: a }),
1419
814
  /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "8", stroke: "white", strokeWidth: "1.5", fill: "none" })
1420
815
  ] });
1421
816
  }
1422
- function jt({ size: t = 24 }) {
1423
- return /* @__PURE__ */ o("svg", { width: t, height: t, viewBox: "0 0 32 32", fill: "none", children: [
817
+ function Xt({ size: t = 24 }) {
818
+ return /* @__PURE__ */ l("svg", { width: t, height: t, viewBox: "0 0 32 32", fill: "none", children: [
1424
819
  /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "16", fill: "#0077FF" }),
1425
820
  /* @__PURE__ */ e("path", { d: "M8 15l8-6 8 6H8z", fill: "white" }),
1426
821
  /* @__PURE__ */ e("rect", { x: "10", y: "16", width: "2", height: "6", fill: "white" }),
@@ -1429,7 +824,7 @@ function jt({ size: t = 24 }) {
1429
824
  /* @__PURE__ */ e("rect", { x: "8", y: "22", width: "16", height: "2", rx: "0.5", fill: "white" })
1430
825
  ] });
1431
826
  }
1432
- function Qt({ size: t = 32 }) {
827
+ function $t({ size: t = 32 }) {
1433
828
  return /* @__PURE__ */ e(
1434
829
  "div",
1435
830
  {
@@ -1439,7 +834,7 @@ function Qt({ size: t = 32 }) {
1439
834
  }
1440
835
  );
1441
836
  }
1442
- function Zt({ size: t = 32 }) {
837
+ function Gt({ size: t = 32 }) {
1443
838
  return /* @__PURE__ */ e(
1444
839
  "div",
1445
840
  {
@@ -1449,156 +844,985 @@ function Zt({ size: t = 32 }) {
1449
844
  }
1450
845
  );
1451
846
  }
1452
- function Jt({ size: t = 32 }) {
1453
- return /* @__PURE__ */ o(
847
+ function jt({ size: t = 32 }) {
848
+ return /* @__PURE__ */ l(
849
+ "div",
850
+ {
851
+ className: "rounded-full bg-white flex items-center justify-center shrink-0",
852
+ style: { width: t, height: t, fontSize: t * 0.28, fontWeight: 700, color: "#333" },
853
+ children: [
854
+ "G",
855
+ /* @__PURE__ */ e("span", { style: { color: "#4285F4", fontSize: t * 0.2 }, children: "Pay" })
856
+ ]
857
+ }
858
+ );
859
+ }
860
+ function Yt({ size: t = 32 }) {
861
+ return /* @__PURE__ */ e(
862
+ "div",
863
+ {
864
+ className: "rounded-full flex items-center justify-center shrink-0",
865
+ style: { width: t, height: t, background: "#003087" },
866
+ children: /* @__PURE__ */ e("span", { className: "text-white font-bold", style: { fontSize: t * 0.38 }, children: "P" })
867
+ }
868
+ );
869
+ }
870
+ function Vt({ size: t = 32 }) {
871
+ return /* @__PURE__ */ e(
872
+ "div",
873
+ {
874
+ className: "rounded-full flex items-center justify-center shrink-0",
875
+ style: { width: t, height: t, background: "var(--t-card-icon-bg)" },
876
+ children: /* @__PURE__ */ l("svg", { width: t * 0.55, height: t * 0.55, viewBox: "0 0 18 14", fill: "none", children: [
877
+ /* @__PURE__ */ e("rect", { x: "0.5", y: "0.5", width: "17", height: "13", rx: "2", stroke: "var(--t-card-icon-stroke)" }),
878
+ /* @__PURE__ */ e("rect", { y: "3", width: "18", height: "3", fill: "var(--t-card-icon-stroke)" })
879
+ ] })
880
+ }
881
+ );
882
+ }
883
+ function Sa({ size: t = 18 }) {
884
+ return /* @__PURE__ */ e(
885
+ "div",
886
+ {
887
+ className: "rounded-full bg-white flex items-center justify-center shrink-0",
888
+ style: { width: t, height: t },
889
+ children: /* @__PURE__ */ e("span", { className: "text-black font-bold", style: { fontSize: t * 0.55 }, children: "C" })
890
+ }
891
+ );
892
+ }
893
+ function ge() {
894
+ 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" }) });
895
+ }
896
+ function Wt() {
897
+ 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" }) });
898
+ }
899
+ function Qt({ onClick: t }) {
900
+ 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(
901
+ "path",
902
+ {
903
+ d: "M4 0.799805H20C21.7673 0.799805 23.2002 2.23269 23.2002 4V12C23.2002 13.7673 21.7673 15.2002 20 15.2002H4C2.23269 15.2002 0.799805 13.7673 0.799805 12V4C0.799805 2.23269 2.23269 0.799805 4 0.799805Z",
904
+ stroke: "var(--t-icon-stroke)",
905
+ strokeWidth: "1.6"
906
+ }
907
+ ) }) });
908
+ }
909
+ function Zt({ size: t = 40 }) {
910
+ return /* @__PURE__ */ e(
911
+ "div",
912
+ {
913
+ className: "rounded-full flex items-center justify-center shrink-0",
914
+ style: { width: t, height: t, background: "var(--t-surface)" },
915
+ children: /* @__PURE__ */ l("svg", { width: t * 0.5, height: t * 0.5, viewBox: "0 0 20 20", fill: "none", children: [
916
+ /* @__PURE__ */ e("circle", { cx: "10", cy: "10", r: "7.5", stroke: "var(--t-text)", strokeWidth: "1.5" }),
917
+ /* @__PURE__ */ e("path", { d: "M10 2.5A7.5 7.5 0 0 1 10 17.5", fill: "var(--t-text)" })
918
+ ] })
919
+ }
920
+ );
921
+ }
922
+ function Jt(t, a = 32) {
923
+ switch (t) {
924
+ case "revolut":
925
+ return /* @__PURE__ */ e($t, { size: a });
926
+ case "applepay":
927
+ return /* @__PURE__ */ e(Gt, { size: a });
928
+ case "card":
929
+ return /* @__PURE__ */ e(Vt, { size: a });
930
+ case "googlepay":
931
+ return /* @__PURE__ */ e(jt, { size: a });
932
+ case "paypal":
933
+ return /* @__PURE__ */ e(Yt, { size: a });
934
+ case "bank":
935
+ return /* @__PURE__ */ e(Xt, { size: a });
936
+ default:
937
+ return /* @__PURE__ */ e($e, { size: a });
938
+ }
939
+ }
940
+ function Le({
941
+ isOpen: t,
942
+ onClose: a,
943
+ children: n
944
+ }) {
945
+ const [s, r] = N(!1), [u, m] = N(!1);
946
+ U(() => {
947
+ if (t)
948
+ r(!0), requestAnimationFrame(() => requestAnimationFrame(() => m(!0)));
949
+ else if (s) {
950
+ m(!1);
951
+ const o = setTimeout(() => r(!1), 250);
952
+ return () => clearTimeout(o);
953
+ }
954
+ }, [t]);
955
+ const i = _(() => {
956
+ m(!1), setTimeout(() => a(), 250);
957
+ }, [a]);
958
+ return s ? /* @__PURE__ */ e(
959
+ "div",
960
+ {
961
+ className: "absolute inset-0 z-20 transition-opacity duration-250",
962
+ style: { opacity: u ? 1 : 0 },
963
+ children: /* @__PURE__ */ e(
964
+ "div",
965
+ {
966
+ className: "absolute inset-0 flex flex-col transition-transform duration-250 ease-out",
967
+ style: { background: "var(--t-modal-bg)", transform: u ? "translateY(0)" : "translateY(24px)" },
968
+ children: typeof n == "function" ? n(i) : n
969
+ }
970
+ )
971
+ }
972
+ ) : null;
973
+ }
974
+ function ve({ onClick: t }) {
975
+ return /* @__PURE__ */ e(
976
+ "button",
977
+ {
978
+ onClick: t,
979
+ className: "flex items-center justify-center transition-colors rounded-full shrink-0",
980
+ style: { width: 30, height: 30, backgroundColor: "var(--t-close-bg)" },
981
+ onMouseEnter: (a) => a.currentTarget.style.backgroundColor = "var(--t-close-hover)",
982
+ onMouseLeave: (a) => a.currentTarget.style.backgroundColor = "var(--t-close-bg)",
983
+ 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" }) })
984
+ }
985
+ );
986
+ }
987
+ function Be({
988
+ value: t,
989
+ onChange: a,
990
+ placeholder: n = ""
991
+ }) {
992
+ return /* @__PURE__ */ l("div", { className: "relative mx-5 mb-5", children: [
993
+ /* @__PURE__ */ e(
994
+ "input",
995
+ {
996
+ type: "text",
997
+ value: t,
998
+ onChange: (s) => a(s.target.value),
999
+ placeholder: n,
1000
+ style: { height: 47, borderRadius: 4.5, borderColor: "var(--t-border)", color: "var(--t-text)", paddingLeft: 14, paddingRight: t ? 40 : 14, fontSize: 14 },
1001
+ className: "w-full bg-transparent border outline-none transition-colors"
1002
+ }
1003
+ ),
1004
+ t && /* @__PURE__ */ e(
1005
+ "button",
1006
+ {
1007
+ onClick: () => a(""),
1008
+ className: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center justify-center transition-colors rounded",
1009
+ style: { width: 22, height: 22, backgroundColor: "var(--t-close-bg)", borderRadius: 4 },
1010
+ 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" }) })
1011
+ }
1012
+ )
1013
+ ] });
1014
+ }
1015
+ function zt({
1016
+ methods: t,
1017
+ selectedId: a,
1018
+ onSelect: n,
1019
+ onClose: s
1020
+ }) {
1021
+ const [r, u] = N(""), m = F(() => {
1022
+ const i = r.trim().toLowerCase();
1023
+ return i ? t.filter(
1024
+ (o) => o.id.toLowerCase().includes(i) || o.name.toLowerCase().includes(i) || o.description && o.description.toLowerCase().includes(i)
1025
+ ) : t;
1026
+ }, [t, r]);
1027
+ return /* @__PURE__ */ l(J, { children: [
1028
+ /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ve, { onClick: s }) }),
1029
+ /* @__PURE__ */ e(
1030
+ "h2",
1031
+ {
1032
+ className: "text-center text-[17px] font-medium mt-2 mb-6",
1033
+ style: { color: "var(--t-text)" },
1034
+ children: "Choose payment method"
1035
+ }
1036
+ ),
1037
+ /* @__PURE__ */ e(Be, { value: r, onChange: u }),
1038
+ /* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
1039
+ m.map((i) => {
1040
+ const o = i.id === a;
1041
+ return /* @__PURE__ */ l(
1042
+ "button",
1043
+ {
1044
+ onClick: () => n(i.id),
1045
+ className: "flex items-center gap-4 w-full transition-colors",
1046
+ style: {
1047
+ color: "var(--t-text)",
1048
+ paddingTop: 18,
1049
+ paddingBottom: 18
1050
+ },
1051
+ children: [
1052
+ /* @__PURE__ */ e("span", { className: "flex items-center justify-center shrink-0", style: { width: 32, height: 32 }, children: xt(i.id, i.icon, 32) }),
1053
+ /* @__PURE__ */ e("span", { className: "text-left flex-1", children: /* @__PURE__ */ e(
1054
+ "span",
1055
+ {
1056
+ className: "font-semibold text-[15px] leading-tight",
1057
+ style: { color: o ? "var(--t-accent)" : "var(--t-text)" },
1058
+ children: i.name
1059
+ }
1060
+ ) })
1061
+ ]
1062
+ },
1063
+ i.id
1064
+ );
1065
+ }),
1066
+ m.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No payment methods found" })
1067
+ ] })
1068
+ ] });
1069
+ }
1070
+ const qt = {
1071
+ "debit-credit-card": "card",
1072
+ "bank-transfer": "bank",
1073
+ "apple-pay": "applepay",
1074
+ "google-pay": "googlepay",
1075
+ paypal: "paypal",
1076
+ revolut: "revolut"
1077
+ };
1078
+ function xt(t, a, n = 24) {
1079
+ const s = qt[t];
1080
+ return s ? Jt(s, n) : a ? /* @__PURE__ */ e("img", { src: a, alt: "", width: n, height: n, style: { borderRadius: "50%" } }) : /* @__PURE__ */ e($e, { size: n });
1081
+ }
1082
+ function ea({
1083
+ methods: t,
1084
+ selectedId: a,
1085
+ onSelect: n,
1086
+ fiatCurrency: s
1087
+ }) {
1088
+ const [r, u] = N(!1), m = F(
1089
+ () => t.filter((o) => o.supportedFiats.includes(s)),
1090
+ [t, s]
1091
+ ), i = m.find((o) => o.id === a) || m[0];
1092
+ return m.length === 0 ? /* @__PURE__ */ e(
1093
+ "div",
1094
+ {
1095
+ className: "flex items-center justify-between px-[18px] pt-[12px] pb-[14px]",
1096
+ style: {
1097
+ background: "var(--t-surface)",
1098
+ borderBottomLeftRadius: 5,
1099
+ borderBottomRightRadius: 5
1100
+ },
1101
+ children: /* @__PURE__ */ l("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children: [
1102
+ "No payment methods available for ",
1103
+ s
1104
+ ] })
1105
+ }
1106
+ ) : /* @__PURE__ */ l(J, { children: [
1107
+ /* @__PURE__ */ l(
1108
+ "div",
1109
+ {
1110
+ role: "button",
1111
+ tabIndex: 0,
1112
+ onClick: () => u(!0),
1113
+ onKeyDown: (o) => {
1114
+ (o.key === "Enter" || o.key === " ") && u(!0);
1115
+ },
1116
+ className: "flex items-center justify-between w-full px-[18px] transition-colors",
1117
+ style: {
1118
+ background: "var(--t-surface)",
1119
+ borderBottomLeftRadius: 5,
1120
+ borderBottomRightRadius: 5,
1121
+ cursor: "pointer",
1122
+ height: 42
1123
+ },
1124
+ children: [
1125
+ /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: "Payment method" }),
1126
+ /* @__PURE__ */ l("span", { className: "flex items-center gap-2", children: [
1127
+ /* @__PURE__ */ e("span", { className: "flex items-center justify-center", style: { width: 20, height: 20 }, children: i && xt(i.id, i.icon, 20) }),
1128
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: (i == null ? void 0 : i.name) || "Select" }),
1129
+ /* @__PURE__ */ e(ge, {})
1130
+ ] })
1131
+ ]
1132
+ }
1133
+ ),
1134
+ /* @__PURE__ */ e(Le, { isOpen: r, onClose: () => u(!1), children: (o) => /* @__PURE__ */ e(
1135
+ zt,
1136
+ {
1137
+ methods: m,
1138
+ selectedId: a,
1139
+ onSelect: (d) => {
1140
+ n(d), o();
1141
+ },
1142
+ onClose: o
1143
+ }
1144
+ ) })
1145
+ ] });
1146
+ }
1147
+ function ta({
1148
+ className: t = "",
1149
+ iframeHeight: a = 600,
1150
+ autoRedirect: n = !1,
1151
+ redirectDelay: s = 3e3
1152
+ }) {
1153
+ var g;
1154
+ const { order: r, orderStatus: u, goToStep: m, goBack: i } = pe(), [o, d] = N(!1), [h, f] = N(null), x = r != null && r.checkout.expiresAt ? Date.now() > r.checkout.expiresAt : !1;
1155
+ if (U(() => {
1156
+ if ((r == null ? void 0 : r.checkout.method) === "redirect" && n && !x) {
1157
+ f(Math.ceil(s / 1e3));
1158
+ const p = setTimeout(() => {
1159
+ window.location.href = r.checkout.url;
1160
+ }, s), b = setInterval(() => {
1161
+ f((S) => S && S > 1 ? S - 1 : null);
1162
+ }, 1e3);
1163
+ return () => {
1164
+ clearTimeout(p), clearInterval(b);
1165
+ };
1166
+ }
1167
+ }, [r, n, s, x]), U(() => {
1168
+ u && (u.status === "completed" ? m("complete") : ["failed", "cancelled", "expired"].includes(u.status) && m("error"));
1169
+ }, [u == null ? void 0 : u.status, m]), !r)
1170
+ return /* @__PURE__ */ l(
1171
+ "div",
1172
+ {
1173
+ className: `flex flex-col items-center justify-center p-8 ${t}`,
1174
+ style: { color: "var(--t-text)" },
1175
+ children: [
1176
+ /* @__PURE__ */ e("p", { className: "text-[15px] mb-4", children: "No order found" }),
1177
+ /* @__PURE__ */ e(
1178
+ "button",
1179
+ {
1180
+ className: "font-semibold text-[14px] transition-all",
1181
+ style: {
1182
+ height: 48,
1183
+ borderRadius: 5,
1184
+ background: "var(--t-surface)",
1185
+ color: "var(--t-text)",
1186
+ paddingLeft: 24,
1187
+ paddingRight: 24
1188
+ },
1189
+ onClick: i,
1190
+ children: "Go Back"
1191
+ }
1192
+ )
1193
+ ]
1194
+ }
1195
+ );
1196
+ if (x)
1197
+ return /* @__PURE__ */ l(
1198
+ "div",
1199
+ {
1200
+ className: `flex flex-col items-center justify-center p-8 text-center ${t}`,
1201
+ style: { color: "var(--t-text)" },
1202
+ children: [
1203
+ /* @__PURE__ */ e("h3", { className: "text-[18px] font-semibold mb-2", children: "Checkout expired" }),
1204
+ /* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: "The session has expired. Please try again." }),
1205
+ /* @__PURE__ */ e(
1206
+ "button",
1207
+ {
1208
+ className: "w-full font-semibold text-[16px] transition-all",
1209
+ style: {
1210
+ height: 60,
1211
+ borderRadius: 5,
1212
+ background: "var(--t-cta-bg)",
1213
+ color: "var(--t-cta-text)"
1214
+ },
1215
+ onClick: i,
1216
+ children: "Start over"
1217
+ }
1218
+ )
1219
+ ]
1220
+ }
1221
+ );
1222
+ if (r.checkout.method === "iframe")
1223
+ return /* @__PURE__ */ e("div", { className: `flex flex-col flex-1 ${t}`, children: /* @__PURE__ */ l(
1224
+ "div",
1225
+ {
1226
+ className: "relative flex-1",
1227
+ style: {
1228
+ height: a,
1229
+ borderRadius: 5,
1230
+ overflow: "hidden",
1231
+ background: "var(--t-surface)"
1232
+ },
1233
+ children: [
1234
+ !o && /* @__PURE__ */ l("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
1235
+ /* @__PURE__ */ e("div", { className: "nramp-spinner" }),
1236
+ /* @__PURE__ */ e("p", { className: "text-[14px] mt-4", style: { color: "var(--t-text-secondary)" }, children: "Loading checkout..." })
1237
+ ] }),
1238
+ /* @__PURE__ */ e(
1239
+ "iframe",
1240
+ {
1241
+ src: r.checkout.url,
1242
+ style: {
1243
+ display: o ? "block" : "none",
1244
+ width: "100%",
1245
+ height: "100%",
1246
+ border: "none"
1247
+ },
1248
+ allow: ((g = r.checkout.allowedFeatures) == null ? void 0 : g.join("; ")) || "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share",
1249
+ onLoad: () => d(!0),
1250
+ title: "Provider Checkout"
1251
+ }
1252
+ )
1253
+ ]
1254
+ }
1255
+ ) });
1256
+ if (r.checkout.method === "redirect")
1257
+ return /* @__PURE__ */ l(
1258
+ "div",
1259
+ {
1260
+ className: `flex flex-col items-center justify-center p-8 text-center ${t}`,
1261
+ style: { color: "var(--t-text)" },
1262
+ children: [
1263
+ /* @__PURE__ */ e("div", { className: "text-[48px] mb-4", children: "🔗" }),
1264
+ /* @__PURE__ */ e("h3", { className: "text-[18px] font-semibold mb-2", children: "Complete Payment" }),
1265
+ /* @__PURE__ */ l("p", { className: "text-[14px] mb-4", style: { color: "var(--t-text-secondary)" }, children: [
1266
+ "You'll be redirected to ",
1267
+ r.gateway,
1268
+ " to complete your payment."
1269
+ ] }),
1270
+ h !== null && /* @__PURE__ */ l("p", { className: "text-[13px] mb-4", style: { color: "var(--t-text-muted)" }, children: [
1271
+ "Redirecting in ",
1272
+ h,
1273
+ "..."
1274
+ ] }),
1275
+ /* @__PURE__ */ l(
1276
+ "a",
1277
+ {
1278
+ href: r.checkout.url,
1279
+ className: "w-full font-semibold text-[16px] flex items-center justify-center transition-all",
1280
+ style: {
1281
+ height: 60,
1282
+ borderRadius: 5,
1283
+ background: "var(--t-cta-bg)",
1284
+ color: "var(--t-cta-text)",
1285
+ textDecoration: "none"
1286
+ },
1287
+ target: "_blank",
1288
+ rel: "noopener noreferrer",
1289
+ children: [
1290
+ "Continue to ",
1291
+ r.gateway
1292
+ ]
1293
+ }
1294
+ ),
1295
+ /* @__PURE__ */ e(
1296
+ "button",
1297
+ {
1298
+ className: "w-full font-semibold text-[14px] mt-2 transition-all",
1299
+ style: {
1300
+ height: 48,
1301
+ borderRadius: 5,
1302
+ background: "var(--t-surface)",
1303
+ color: "var(--t-text)"
1304
+ },
1305
+ onClick: i,
1306
+ children: "Cancel"
1307
+ }
1308
+ )
1309
+ ]
1310
+ }
1311
+ );
1312
+ if (r.checkout.method === "widget" && r.widgetConfig) {
1313
+ const p = aa(r.checkout.url, r.widgetConfig);
1314
+ return /* @__PURE__ */ e("div", { className: `flex flex-col flex-1 ${t}`, children: /* @__PURE__ */ l(
1315
+ "div",
1316
+ {
1317
+ className: "relative flex-1",
1318
+ style: {
1319
+ height: a,
1320
+ borderRadius: 5,
1321
+ overflow: "hidden",
1322
+ background: "var(--t-surface)"
1323
+ },
1324
+ children: [
1325
+ !o && /* @__PURE__ */ l("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
1326
+ /* @__PURE__ */ e("div", { className: "nramp-spinner" }),
1327
+ /* @__PURE__ */ e("p", { className: "text-[14px] mt-4", style: { color: "var(--t-text-secondary)" }, children: "Loading checkout..." })
1328
+ ] }),
1329
+ /* @__PURE__ */ e(
1330
+ "iframe",
1331
+ {
1332
+ src: p,
1333
+ style: {
1334
+ display: o ? "block" : "none",
1335
+ width: "100%",
1336
+ height: "100%",
1337
+ border: "none"
1338
+ },
1339
+ allow: "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share",
1340
+ onLoad: () => d(!0),
1341
+ title: "Payment Checkout"
1342
+ }
1343
+ )
1344
+ ]
1345
+ }
1346
+ ) });
1347
+ }
1348
+ return /* @__PURE__ */ l(
1349
+ "div",
1350
+ {
1351
+ className: `flex flex-col items-center justify-center p-8 ${t}`,
1352
+ style: { color: "var(--t-text)" },
1353
+ children: [
1354
+ /* @__PURE__ */ e("p", { className: "text-[15px] mb-4", children: "Unknown checkout method" }),
1355
+ /* @__PURE__ */ e(
1356
+ "button",
1357
+ {
1358
+ className: "font-semibold text-[14px] transition-all",
1359
+ style: {
1360
+ height: 48,
1361
+ borderRadius: 5,
1362
+ background: "var(--t-surface)",
1363
+ color: "var(--t-text)",
1364
+ paddingLeft: 24,
1365
+ paddingRight: 24
1366
+ },
1367
+ onClick: i,
1368
+ children: "Go Back"
1369
+ }
1370
+ )
1371
+ ]
1372
+ }
1373
+ );
1374
+ }
1375
+ function aa(t, a) {
1376
+ const n = new URL("/en/partner/widget", t);
1377
+ for (const [s, r] of Object.entries(a))
1378
+ r != null && r !== "" && n.searchParams.set(s, String(r));
1379
+ return n.toString();
1380
+ }
1381
+ function na({ className: t = "" }) {
1382
+ const { orderStatus: a, orderStatusLoading: n, goToStep: s } = pe();
1383
+ U(() => {
1384
+ a && (a.status === "completed" ? s("complete") : ["failed", "cancelled", "expired", "refunded"].includes(a.status) && s("error"));
1385
+ }, [a == null ? void 0 : a.status, s]);
1386
+ const r = () => {
1387
+ if (!a) return "Processing your order...";
1388
+ switch (a.status) {
1389
+ case "pending":
1390
+ return "Waiting for payment confirmation...";
1391
+ case "processing":
1392
+ return "Processing your transaction...";
1393
+ default:
1394
+ return "Processing...";
1395
+ }
1396
+ };
1397
+ return /* @__PURE__ */ l("div", { className: `flex flex-col items-center justify-center px-8 py-12 text-center ${t}`, children: [
1398
+ /* @__PURE__ */ e("div", { className: "mb-6", children: /* @__PURE__ */ e("div", { className: "nramp-spinner-large nramp-spinner" }) }),
1399
+ /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-3", style: { color: "var(--t-text)" }, children: r() }),
1400
+ n && /* @__PURE__ */ e("p", { className: "text-[13px] mb-4", style: { color: "var(--t-text-muted)" }, children: "Checking status..." }),
1401
+ a && /* @__PURE__ */ l("div", { className: "w-full mt-6 text-left", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
1402
+ /* @__PURE__ */ e(me, { label: "Order ID", value: a.orderId, mono: !0 }),
1403
+ /* @__PURE__ */ e(me, { label: "Provider", value: a.gateway }),
1404
+ /* @__PURE__ */ e(
1405
+ me,
1406
+ {
1407
+ label: "Amount",
1408
+ value: `${a.fiatAmount} ${a.fiatCurrency}`
1409
+ }
1410
+ ),
1411
+ /* @__PURE__ */ e(
1412
+ me,
1413
+ {
1414
+ label: "Receiving",
1415
+ value: `${a.cryptoAmount || "..."} ${a.cryptoCurrency}`
1416
+ }
1417
+ ),
1418
+ /* @__PURE__ */ e(me, { label: "Network", value: a.network }),
1419
+ /* @__PURE__ */ e(
1420
+ me,
1421
+ {
1422
+ label: "To Address",
1423
+ value: `${a.walletAddress.slice(0, 10)}...${a.walletAddress.slice(-8)}`,
1424
+ mono: !0
1425
+ }
1426
+ )
1427
+ ] }),
1428
+ /* @__PURE__ */ l("div", { className: "mt-6", children: [
1429
+ /* @__PURE__ */ e("p", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "This usually takes a few minutes." }),
1430
+ /* @__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." })
1431
+ ] })
1432
+ ] });
1433
+ }
1434
+ function me({ label: t, value: a, mono: n }) {
1435
+ return /* @__PURE__ */ l(
1436
+ "div",
1437
+ {
1438
+ className: "flex justify-between items-center py-2",
1439
+ style: { borderBottom: "1px solid var(--t-divider)" },
1440
+ children: [
1441
+ /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: t }),
1442
+ /* @__PURE__ */ e(
1443
+ "span",
1444
+ {
1445
+ className: `text-[13px] font-medium ${n ? "font-mono" : ""}`,
1446
+ style: { color: "var(--t-text)" },
1447
+ children: a
1448
+ }
1449
+ )
1450
+ ]
1451
+ }
1452
+ );
1453
+ }
1454
+ function ra({
1455
+ className: t = "",
1456
+ explorerUrl: a,
1457
+ onDone: n,
1458
+ doneButtonText: s = "Done"
1459
+ }) {
1460
+ const { orderStatus: r, state: u, dispatch: m } = pe(), i = u.flowType === "sell", o = () => {
1461
+ if (!(r != null && r.transactionHash)) return null;
1462
+ if (!a) {
1463
+ const f = {
1464
+ ethereum: "https://etherscan.io/tx/{txHash}",
1465
+ polygon: "https://polygonscan.com/tx/{txHash}",
1466
+ arbitrum: "https://arbiscan.io/tx/{txHash}",
1467
+ optimism: "https://optimistic.etherscan.io/tx/{txHash}",
1468
+ base: "https://basescan.org/tx/{txHash}",
1469
+ bitcoin: "https://mempool.space/tx/{txHash}",
1470
+ solana: "https://solscan.io/tx/{txHash}",
1471
+ avalanche: "https://snowtrace.io/tx/{txHash}",
1472
+ fantom: "https://ftmscan.com/tx/{txHash}"
1473
+ };
1474
+ return (f[u.network] || f.ethereum).replace("{txHash}", r.transactionHash);
1475
+ }
1476
+ return a.replace("{txHash}", r.transactionHash);
1477
+ }, d = () => {
1478
+ n ? n() : m({ type: "RESET" });
1479
+ }, h = o();
1480
+ return /* @__PURE__ */ l("div", { className: `flex flex-col items-center px-8 py-12 text-center ${t}`, children: [
1481
+ /* @__PURE__ */ e(
1482
+ "div",
1483
+ {
1484
+ className: "flex items-center justify-center mb-5",
1485
+ style: { width: 64, height: 64, borderRadius: "50%", background: "var(--t-success, #10b981)" },
1486
+ children: /* @__PURE__ */ e("svg", { viewBox: "0 0 24 24", width: "32", height: "32", fill: "white", children: /* @__PURE__ */ e("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z" }) })
1487
+ }
1488
+ ),
1489
+ /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: i ? "Sale Complete!" : "Purchase Complete!" }),
1490
+ /* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: i ? `Your ${(r == null ? void 0 : r.fiatCurrency) || u.fiatCurrency} payout is being processed.` : `Your ${(r == null ? void 0 : r.cryptoCurrency) || u.cryptoCurrency} has been sent to your wallet.` }),
1491
+ r && /* @__PURE__ */ l("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
1492
+ /* @__PURE__ */ e(
1493
+ te,
1494
+ {
1495
+ label: i ? "Amount Sold" : "Amount Received",
1496
+ value: `${r.cryptoAmount} ${r.cryptoCurrency}`,
1497
+ highlight: !0
1498
+ }
1499
+ ),
1500
+ /* @__PURE__ */ e(
1501
+ te,
1502
+ {
1503
+ label: i ? "Payout Amount" : "Amount Paid",
1504
+ value: `${r.fiatAmount} ${r.fiatCurrency}`
1505
+ }
1506
+ ),
1507
+ /* @__PURE__ */ e(te, { label: "Network", value: r.network }),
1508
+ /* @__PURE__ */ e(
1509
+ te,
1510
+ {
1511
+ label: "Wallet",
1512
+ value: `${r.walletAddress.slice(0, 10)}...${r.walletAddress.slice(-8)}`,
1513
+ mono: !0
1514
+ }
1515
+ ),
1516
+ r.transactionHash && /* @__PURE__ */ e(
1517
+ te,
1518
+ {
1519
+ label: "Transaction",
1520
+ value: `${r.transactionHash.slice(0, 10)}...${r.transactionHash.slice(-8)}`,
1521
+ mono: !0
1522
+ }
1523
+ ),
1524
+ /* @__PURE__ */ e(te, { label: "Provider", value: r.gateway }),
1525
+ /* @__PURE__ */ e(te, { label: "Order ID", value: r.orderId, mono: !0 }),
1526
+ r.completedAt && /* @__PURE__ */ e(
1527
+ te,
1528
+ {
1529
+ label: "Completed",
1530
+ value: new Date(r.completedAt).toLocaleString()
1531
+ }
1532
+ )
1533
+ ] }),
1534
+ /* @__PURE__ */ l("div", { className: "w-full flex flex-col gap-2", children: [
1535
+ h && /* @__PURE__ */ e(
1536
+ "a",
1537
+ {
1538
+ href: h,
1539
+ target: "_blank",
1540
+ rel: "noopener noreferrer",
1541
+ className: "w-full font-semibold text-[14px] flex items-center justify-center transition-all",
1542
+ style: { height: 48, borderRadius: 5, background: "var(--t-surface)", color: "var(--t-text)", textDecoration: "none" },
1543
+ children: "View on Explorer"
1544
+ }
1545
+ ),
1546
+ /* @__PURE__ */ e(
1547
+ "button",
1548
+ {
1549
+ className: "w-full font-semibold text-[16px] transition-all",
1550
+ style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)" },
1551
+ onClick: d,
1552
+ children: s
1553
+ }
1554
+ )
1555
+ ] })
1556
+ ] });
1557
+ }
1558
+ function te({ label: t, value: a, mono: n, highlight: s }) {
1559
+ return /* @__PURE__ */ l(
1454
1560
  "div",
1455
1561
  {
1456
- className: "rounded-full bg-white flex items-center justify-center shrink-0",
1457
- style: { width: t, height: t, fontSize: t * 0.28, fontWeight: 700, color: "#333" },
1562
+ className: "flex justify-between items-center py-2",
1563
+ style: { borderBottom: "1px solid var(--t-divider)" },
1458
1564
  children: [
1459
- "G",
1460
- /* @__PURE__ */ e("span", { style: { color: "#4285F4", fontSize: t * 0.2 }, children: "Pay" })
1565
+ /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: t }),
1566
+ /* @__PURE__ */ e(
1567
+ "span",
1568
+ {
1569
+ className: `text-[13px] font-medium ${n ? "font-mono" : ""}`,
1570
+ style: { color: s ? "var(--t-success, #10b981)" : "var(--t-text)" },
1571
+ children: a
1572
+ }
1573
+ )
1461
1574
  ]
1462
1575
  }
1463
1576
  );
1464
1577
  }
1465
- function zt({ size: t = 32 }) {
1466
- return /* @__PURE__ */ e(
1467
- "div",
1468
- {
1469
- className: "rounded-full flex items-center justify-center shrink-0",
1470
- style: { width: t, height: t, background: "#003087" },
1471
- children: /* @__PURE__ */ e("span", { className: "text-white font-bold", style: { fontSize: t * 0.38 }, children: "P" })
1472
- }
1473
- );
1474
- }
1475
- function qt({ size: t = 32 }) {
1476
- return /* @__PURE__ */ e(
1477
- "div",
1478
- {
1479
- className: "rounded-full flex items-center justify-center shrink-0",
1480
- style: { width: t, height: t, background: "var(--t-card-icon-bg)" },
1481
- children: /* @__PURE__ */ o("svg", { width: t * 0.55, height: t * 0.55, viewBox: "0 0 18 14", fill: "none", children: [
1482
- /* @__PURE__ */ e("rect", { x: "0.5", y: "0.5", width: "17", height: "13", rx: "2", stroke: "var(--t-card-icon-stroke)" }),
1483
- /* @__PURE__ */ e("rect", { y: "3", width: "18", height: "3", fill: "var(--t-card-icon-stroke)" })
1578
+ function oa({
1579
+ className: t = "",
1580
+ onRetry: a,
1581
+ supportEmail: n = "support@nowramp.com"
1582
+ }) {
1583
+ const { state: s, orderStatus: r, dispatch: u, goToStep: m } = pe(), i = s.flowType === "sell", o = () => {
1584
+ if (r)
1585
+ switch (r.status) {
1586
+ case "failed":
1587
+ return "Payment Failed";
1588
+ case "cancelled":
1589
+ return "Order Cancelled";
1590
+ case "expired":
1591
+ return "Order Expired";
1592
+ case "refunded":
1593
+ return "Order Refunded";
1594
+ default:
1595
+ return "Something Went Wrong";
1596
+ }
1597
+ return "Something Went Wrong";
1598
+ }, d = () => {
1599
+ if (s.errorMessage) return s.errorMessage;
1600
+ if (r)
1601
+ switch (r.status) {
1602
+ case "failed":
1603
+ 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.";
1604
+ case "cancelled":
1605
+ return i ? "Your sale was cancelled. No crypto was transferred." : "Your order was cancelled. No payment was processed.";
1606
+ case "expired":
1607
+ return i ? "Your order has expired. Please start a new sale." : "Your order has expired. Please start a new purchase.";
1608
+ case "refunded":
1609
+ return i ? "Your crypto has been returned. The funds should appear in your wallet shortly." : "Your payment has been refunded. The funds should appear in your account within 5-10 business days.";
1610
+ default:
1611
+ return "An unexpected error occurred. Please try again.";
1612
+ }
1613
+ return "An unexpected error occurred. Please try again.";
1614
+ }, h = () => {
1615
+ u({ type: "CLEAR_ERROR" }), a ? a() : (u({ type: "RESET" }), m("amount"));
1616
+ }, f = () => {
1617
+ u({ type: "RESET" }), m("amount");
1618
+ };
1619
+ return /* @__PURE__ */ l("div", { className: `flex flex-col items-center px-8 py-12 text-center ${t}`, children: [
1620
+ /* @__PURE__ */ e(
1621
+ "div",
1622
+ {
1623
+ className: "flex items-center justify-center mb-5",
1624
+ style: { width: 64, height: 64, borderRadius: "50%", background: "var(--t-error, #EF4444)" },
1625
+ 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" }) })
1626
+ }
1627
+ ),
1628
+ /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: o() }),
1629
+ /* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: d() }),
1630
+ r && /* @__PURE__ */ l("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
1631
+ /* @__PURE__ */ l("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
1632
+ /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Order ID" }),
1633
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium font-mono", style: { color: "var(--t-text)" }, children: r.orderId })
1634
+ ] }),
1635
+ /* @__PURE__ */ l("div", { className: "flex justify-between items-center py-2", children: [
1636
+ /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Status" }),
1637
+ /* @__PURE__ */ e(
1638
+ "span",
1639
+ {
1640
+ className: "text-[12px] font-medium px-2 py-0.5",
1641
+ style: { background: "rgba(239,68,68,0.15)", color: "#EF4444", borderRadius: 4 },
1642
+ children: r.gatewayStatus
1643
+ }
1644
+ )
1484
1645
  ] })
1485
- }
1486
- );
1487
- }
1488
- function va({ size: t = 18 }) {
1489
- return /* @__PURE__ */ e(
1490
- "div",
1491
- {
1492
- className: "rounded-full bg-white flex items-center justify-center shrink-0",
1493
- style: { width: t, height: t },
1494
- children: /* @__PURE__ */ e("span", { className: "text-black font-bold", style: { fontSize: t * 0.55 }, children: "C" })
1495
- }
1496
- );
1497
- }
1498
- function Te() {
1499
- 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" }) });
1500
- }
1501
- function ea() {
1502
- 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" }) });
1503
- }
1504
- function ta({ onClick: t }) {
1505
- 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(
1506
- "path",
1507
- {
1508
- d: "M4 0.799805H20C21.7673 0.799805 23.2002 2.23269 23.2002 4V12C23.2002 13.7673 21.7673 15.2002 20 15.2002H4C2.23269 15.2002 0.799805 13.7673 0.799805 12V4C0.799805 2.23269 2.23269 0.799805 4 0.799805Z",
1509
- stroke: "var(--t-icon-stroke)",
1510
- strokeWidth: "1.6"
1511
- }
1512
- ) }) });
1513
- }
1514
- function aa({ size: t = 40 }) {
1515
- return /* @__PURE__ */ e(
1516
- "div",
1517
- {
1518
- className: "rounded-full flex items-center justify-center shrink-0",
1519
- style: { width: t, height: t, background: "var(--t-surface)" },
1520
- children: /* @__PURE__ */ o("svg", { width: t * 0.5, height: t * 0.5, viewBox: "0 0 20 20", fill: "none", children: [
1521
- /* @__PURE__ */ e("circle", { cx: "10", cy: "10", r: "7.5", stroke: "var(--t-text)", strokeWidth: "1.5" }),
1522
- /* @__PURE__ */ e("path", { d: "M10 2.5A7.5 7.5 0 0 1 10 17.5", fill: "var(--t-text)" })
1646
+ ] }),
1647
+ /* @__PURE__ */ l("div", { className: "w-full flex flex-col gap-2", children: [
1648
+ /* @__PURE__ */ e(
1649
+ "button",
1650
+ {
1651
+ className: "w-full font-semibold text-[16px] transition-all",
1652
+ style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)" },
1653
+ onClick: h,
1654
+ children: "Try Again"
1655
+ }
1656
+ ),
1657
+ /* @__PURE__ */ e(
1658
+ "button",
1659
+ {
1660
+ className: "w-full font-semibold text-[14px] transition-all",
1661
+ style: { height: 48, borderRadius: 5, background: "var(--t-surface)", color: "var(--t-text)" },
1662
+ onClick: f,
1663
+ children: "Start Over"
1664
+ }
1665
+ )
1666
+ ] }),
1667
+ /* @__PURE__ */ l("div", { className: "mt-6", children: [
1668
+ /* @__PURE__ */ l("p", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: [
1669
+ "Need help? Contact",
1670
+ " ",
1671
+ /* @__PURE__ */ e(
1672
+ "a",
1673
+ {
1674
+ href: `mailto:${n}`,
1675
+ className: "underline",
1676
+ style: { color: "var(--t-accent)" },
1677
+ children: n
1678
+ }
1679
+ )
1680
+ ] }),
1681
+ r && /* @__PURE__ */ l("p", { className: "text-[12px] mt-1", style: { color: "var(--t-text-muted)" }, children: [
1682
+ "Reference: ",
1683
+ r.orderId
1523
1684
  ] })
1524
- }
1525
- );
1685
+ ] })
1686
+ ] });
1526
1687
  }
1527
- function Na(t, a = 32) {
1528
- switch (t) {
1529
- case "revolut":
1530
- return /* @__PURE__ */ e(Qt, { size: a });
1531
- case "applepay":
1532
- return /* @__PURE__ */ e(Zt, { size: a });
1533
- case "card":
1534
- return /* @__PURE__ */ e(qt, { size: a });
1535
- case "googlepay":
1536
- return /* @__PURE__ */ e(Jt, { size: a });
1537
- case "paypal":
1538
- return /* @__PURE__ */ e(zt, { size: a });
1539
- case "bank":
1540
- return /* @__PURE__ */ e(jt, { size: a });
1541
- default:
1542
- return /* @__PURE__ */ e(ft, { size: a });
1543
- }
1688
+ function pt(t) {
1689
+ return t.length <= 12 ? t : `${t.slice(0, 6)}...${t.slice(-6)}`;
1544
1690
  }
1545
- function Le({ onClick: t }) {
1546
- return /* @__PURE__ */ e(
1547
- "button",
1548
- {
1549
- onClick: t,
1550
- className: "flex items-center justify-center transition-colors rounded-full shrink-0",
1551
- style: { width: 30, height: 30, backgroundColor: "var(--t-close-bg)" },
1552
- onMouseEnter: (a) => a.currentTarget.style.backgroundColor = "var(--t-close-hover)",
1553
- onMouseLeave: (a) => a.currentTarget.style.backgroundColor = "var(--t-close-bg)",
1554
- 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" }) })
1691
+ function la({ className: t = "" }) {
1692
+ const {
1693
+ config: a,
1694
+ configLoading: n,
1695
+ state: s,
1696
+ defaultGateway: r,
1697
+ fetchQuotes: u,
1698
+ createOrder: m,
1699
+ orderLoading: i
1700
+ } = pe(), o = s.flowType === "sell", [d, h] = N(null), f = a == null ? void 0 : a.gateways.find((g) => g.id === r), x = async () => {
1701
+ h(null);
1702
+ try {
1703
+ u(), await m();
1704
+ } catch (g) {
1705
+ const p = g instanceof Error ? g.message : "Failed to create order";
1706
+ h(p);
1555
1707
  }
1556
- );
1557
- }
1558
- function Xe({
1559
- value: t,
1560
- onChange: a,
1561
- placeholder: n = ""
1562
- }) {
1563
- return /* @__PURE__ */ o("div", { className: "relative mx-5 mb-5", children: [
1708
+ };
1709
+ return n ? /* @__PURE__ */ l("div", { className: `flex flex-col items-center justify-center p-12 ${t}`, children: [
1710
+ /* @__PURE__ */ e("div", { className: "nramp-spinner" }),
1711
+ /* @__PURE__ */ e("p", { className: "text-[14px] mt-4", style: { color: "var(--t-text-secondary)" }, children: "Loading..." })
1712
+ ] }) : /* @__PURE__ */ l("div", { className: `flex flex-col items-center px-8 py-12 ${t}`, children: [
1713
+ /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-6", style: { color: "var(--t-text)" }, children: o ? "Confirm Sale" : "Confirm Purchase" }),
1714
+ /* @__PURE__ */ l("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
1715
+ f && /* @__PURE__ */ l("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
1716
+ /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Provider" }),
1717
+ /* @__PURE__ */ l("span", { className: "flex items-center gap-2", children: [
1718
+ f.logo && /* @__PURE__ */ e("img", { src: f.logo, alt: f.name, width: 20, height: 20, style: { borderRadius: 4 } }),
1719
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: f.name })
1720
+ ] })
1721
+ ] }),
1722
+ o ? /* @__PURE__ */ l(J, { children: [
1723
+ /* @__PURE__ */ e(le, { label: "You sell", value: `${s.cryptoAmount} ${s.cryptoCurrency}`, highlight: !0 }),
1724
+ /* @__PURE__ */ e(le, { label: "You receive", value: `${s.fiatCurrency} payout` })
1725
+ ] }) : /* @__PURE__ */ l(J, { children: [
1726
+ /* @__PURE__ */ e(le, { label: "You pay", value: `${s.fiatAmount} ${s.fiatCurrency}`, highlight: !0 }),
1727
+ /* @__PURE__ */ e(le, { label: "You receive", value: `${s.cryptoCurrency} on ${s.network}` }),
1728
+ /* @__PURE__ */ e(le, { label: "Wallet", value: pt(s.walletAddress), mono: !0 })
1729
+ ] }),
1730
+ /* @__PURE__ */ e(le, { label: "Network", value: s.network }),
1731
+ o && s.walletAddress && /* @__PURE__ */ e(le, { label: "Refund address", value: pt(s.walletAddress), mono: !0 })
1732
+ ] }),
1733
+ d && /* @__PURE__ */ e("p", { className: "text-[12px] mb-4", style: { color: "#EF4444" }, children: d }),
1564
1734
  /* @__PURE__ */ e(
1565
- "input",
1735
+ "button",
1566
1736
  {
1567
- type: "text",
1568
- value: t,
1569
- onChange: (l) => a(l.target.value),
1570
- placeholder: n,
1571
- style: { height: 47, borderRadius: 4.5, borderColor: "var(--t-border)", color: "var(--t-text)", paddingLeft: 14, paddingRight: t ? 40 : 14, fontSize: 14 },
1572
- className: "w-full bg-transparent border outline-none transition-colors"
1737
+ className: "w-full font-semibold text-[16px] transition-all flex items-center justify-center gap-2",
1738
+ style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)", opacity: i ? 0.7 : 1 },
1739
+ disabled: i,
1740
+ onClick: x,
1741
+ children: i ? /* @__PURE__ */ l(J, { children: [
1742
+ /* @__PURE__ */ e("span", { className: "nramp-spinner-inline" }),
1743
+ "Processing..."
1744
+ ] }) : o ? "Confirm & Sell" : "Confirm & Pay"
1573
1745
  }
1574
- ),
1575
- t && /* @__PURE__ */ e(
1576
- "button",
1746
+ )
1747
+ ] });
1748
+ }
1749
+ function le({ label: t, value: a, mono: n, highlight: s }) {
1750
+ return /* @__PURE__ */ l("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
1751
+ /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: t }),
1752
+ /* @__PURE__ */ e(
1753
+ "span",
1577
1754
  {
1578
- onClick: () => a(""),
1579
- className: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center justify-center transition-colors rounded",
1580
- style: { width: 22, height: 22, backgroundColor: "var(--t-close-bg)", borderRadius: 4 },
1581
- 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" }) })
1755
+ className: `text-[13px] font-medium ${n ? "font-mono" : ""}`,
1756
+ style: { color: s ? "var(--t-success, #10b981)" : "var(--t-text)" },
1757
+ children: a
1582
1758
  }
1583
1759
  )
1584
1760
  ] });
1585
1761
  }
1586
- function na({ onClose: t, onSelect: a, currencies: n, assetBaseUrl: l = "" }) {
1587
- const [r, d] = C(""), u = X(() => {
1588
- if (!n || n.length === 0) return lt;
1589
- const c = new Map(lt.map((i) => [i.code, i.name]));
1590
- return n.map((i) => ({
1591
- code: i.code,
1592
- name: i.name || c.get(i.code) || i.code
1762
+ function sa({ char: t, height: a = 38 }) {
1763
+ const n = "0123456789", s = n.indexOf(t);
1764
+ return s === -1 ? /* @__PURE__ */ e("span", { children: t }) : /* @__PURE__ */ e("span", { className: "digit-slot", style: { height: a, lineHeight: `${a}px` }, children: /* @__PURE__ */ e("span", { className: "digit-slot-inner block", style: { transform: `translateY(-${s * a}px)` }, children: n.split("").map((r) => /* @__PURE__ */ e("span", { className: "block", style: { height: a, lineHeight: `${a}px` }, children: r }, r)) }) });
1765
+ }
1766
+ function ca({
1767
+ value: t,
1768
+ height: a = 38,
1769
+ className: n = "",
1770
+ style: s = {}
1771
+ }) {
1772
+ return /* @__PURE__ */ e("span", { className: n, style: { display: "inline-flex", ...s }, children: t.split("").map((r, u) => /* @__PURE__ */ e(sa, { char: r, height: a }, u)) });
1773
+ }
1774
+ function M({
1775
+ w: t,
1776
+ h: a,
1777
+ className: n = ""
1778
+ }) {
1779
+ return /* @__PURE__ */ e("div", { className: `skeleton ${n}`, style: { width: t, height: a } });
1780
+ }
1781
+ function ia() {
1782
+ return /* @__PURE__ */ l("div", { className: "flex-1 px-5 flex flex-col", children: [
1783
+ /* @__PURE__ */ l("div", { className: "px-[18px] pt-[14px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5 }, children: [
1784
+ /* @__PURE__ */ e(M, { w: 70, h: 14, className: "mb-3" }),
1785
+ /* @__PURE__ */ l("div", { className: "flex justify-between items-center", children: [
1786
+ /* @__PURE__ */ e(M, { w: 120, h: 32 }),
1787
+ /* @__PURE__ */ e(M, { w: 75, h: 32 })
1788
+ ] })
1789
+ ] }),
1790
+ /* @__PURE__ */ l("div", { className: "px-[18px] pt-[12px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5, marginTop: 4 }, children: [
1791
+ /* @__PURE__ */ e(M, { w: 50, h: 14, className: "mb-3" }),
1792
+ /* @__PURE__ */ l("div", { className: "flex justify-between items-center", children: [
1793
+ /* @__PURE__ */ e(M, { w: 180, h: 32 }),
1794
+ /* @__PURE__ */ e(M, { w: 85, h: 32 })
1795
+ ] })
1796
+ ] }),
1797
+ /* @__PURE__ */ l("div", { className: "flex justify-between mt-3 px-[2px]", children: [
1798
+ /* @__PURE__ */ e(M, { w: 140, h: 12 }),
1799
+ /* @__PURE__ */ e(M, { w: 90, h: 12 })
1800
+ ] }),
1801
+ /* @__PURE__ */ l("div", { className: "mt-8", children: [
1802
+ /* @__PURE__ */ e(M, { w: 65, h: 14, className: "mb-2.5" }),
1803
+ /* @__PURE__ */ e(M, { w: "100%", h: 47 })
1804
+ ] }),
1805
+ /* @__PURE__ */ e("div", { className: "flex-1" }),
1806
+ /* @__PURE__ */ e(M, { w: "100%", h: 60, className: "mb-2" }),
1807
+ /* @__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" }) })
1808
+ ] });
1809
+ }
1810
+ function da({ onClose: t, onSelect: a, currencies: n, assetBaseUrl: s = "" }) {
1811
+ const [r, u] = N(""), m = F(() => {
1812
+ if (!n || n.length === 0) return st;
1813
+ const o = new Map(st.map((d) => [d.code, d.name]));
1814
+ return n.map((d) => ({
1815
+ code: d.code,
1816
+ name: d.name || o.get(d.code) || d.code
1593
1817
  }));
1594
- }, [n]), m = X(() => {
1595
- const c = r.trim().toLowerCase();
1596
- return c ? u.filter(
1597
- (i) => i.code.toLowerCase().includes(c) || i.name.toLowerCase().includes(c)
1598
- ) : u;
1599
- }, [u, r]);
1600
- return /* @__PURE__ */ o(le, { children: [
1601
- /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Le, { onClick: t }) }),
1818
+ }, [n]), i = F(() => {
1819
+ const o = r.trim().toLowerCase();
1820
+ return o ? m.filter(
1821
+ (d) => d.code.toLowerCase().includes(o) || d.name.toLowerCase().includes(o)
1822
+ ) : m;
1823
+ }, [m, r]);
1824
+ return /* @__PURE__ */ l(J, { children: [
1825
+ /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ve, { onClick: t }) }),
1602
1826
  /* @__PURE__ */ e(
1603
1827
  "h2",
1604
1828
  {
@@ -1607,64 +1831,64 @@ function na({ onClose: t, onSelect: a, currencies: n, assetBaseUrl: l = "" }) {
1607
1831
  children: "Select fiat currency"
1608
1832
  }
1609
1833
  ),
1610
- /* @__PURE__ */ e(Xe, { value: r, onChange: d }),
1611
- /* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
1612
- m.map((c) => /* @__PURE__ */ o(
1834
+ /* @__PURE__ */ e(Be, { value: r, onChange: u }),
1835
+ /* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
1836
+ i.map((o) => /* @__PURE__ */ l(
1613
1837
  "button",
1614
1838
  {
1615
- onClick: () => a(c.code),
1839
+ onClick: () => a(o.code),
1616
1840
  className: "flex items-center gap-3.5 w-full py-3.5 transition-colors",
1617
1841
  style: { color: "var(--t-text)" },
1618
1842
  children: [
1619
- /* @__PURE__ */ e(_e, { currencyCode: c.code, size: 32, baseUrl: l }),
1620
- /* @__PURE__ */ o("div", { className: "text-left", children: [
1621
- /* @__PURE__ */ e("div", { className: "font-semibold text-[15px] leading-tight", children: c.code }),
1622
- /* @__PURE__ */ e("div", { className: "text-[13px] mt-0.5", style: { color: "var(--t-text-secondary)" }, children: c.name })
1843
+ /* @__PURE__ */ e(Xe, { currencyCode: o.code, size: 32, baseUrl: s }),
1844
+ /* @__PURE__ */ l("div", { className: "text-left", children: [
1845
+ /* @__PURE__ */ e("div", { className: "font-semibold text-[15px] leading-tight", children: o.code }),
1846
+ /* @__PURE__ */ e("div", { className: "text-[13px] mt-0.5", style: { color: "var(--t-text-secondary)" }, children: o.name })
1623
1847
  ] })
1624
1848
  ]
1625
1849
  },
1626
- c.code
1850
+ o.code
1627
1851
  )),
1628
- m.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No currencies found" })
1852
+ i.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No currencies found" })
1629
1853
  ] })
1630
1854
  ] });
1631
1855
  }
1632
- function ra({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: l = "" }) {
1633
- const [r, d] = C(""), u = X(() => {
1634
- if (!n || n.length === 0) return Vt;
1635
- const c = [];
1636
- for (const i of n) {
1637
- const p = i.networks || [];
1638
- if (p.length === 0)
1639
- c.push({ code: i.code, name: i.name || i.code, chain: i.code, popular: !1 });
1856
+ function ua({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: s = "" }) {
1857
+ const [r, u] = N(""), m = F(() => {
1858
+ if (!n || n.length === 0) return _t;
1859
+ const o = [];
1860
+ for (const d of n) {
1861
+ const h = d.networks || [];
1862
+ if (h.length === 0)
1863
+ o.push({ code: d.code, name: d.name || d.code, chain: d.code, popular: !1 });
1640
1864
  else
1641
- for (const f of p) {
1642
- const x = f.code || f.id || f.name || i.code;
1643
- c.push({
1644
- code: i.code,
1645
- name: i.name || i.code,
1865
+ for (const f of h) {
1866
+ const x = f.code || f.id || f.name || d.code;
1867
+ o.push({
1868
+ code: d.code,
1869
+ name: d.name || d.code,
1646
1870
  chain: x,
1647
1871
  chainName: f.name,
1648
1872
  popular: !1
1649
1873
  });
1650
1874
  }
1651
1875
  }
1652
- return c;
1653
- }, [n]), m = X(() => {
1876
+ return o;
1877
+ }, [n]), i = F(() => {
1654
1878
  var f;
1655
- const c = r.trim().toLowerCase();
1656
- if (!c) return u;
1657
- const i = c.split(/\s+/), p = [];
1658
- for (const x of u) {
1659
- const g = Re[x.chain], h = g ? g.name.toLowerCase() : "", b = ((f = g == null ? void 0 : g.shortName) == null ? void 0 : f.toLowerCase()) || "", L = x.chain.toLowerCase(), O = x.code.toLowerCase(), A = x.name.toLowerCase(), G = [O, A, h, b, L];
1660
- if (!i.every((Z) => G.some((s) => s.includes(Z)))) continue;
1661
- let W = 0;
1662
- O === c ? W += 100 : O.startsWith(i[0]) && (W += 50), x.popular && (W += 10), i.length > 1 && (h.includes(i[1]) || b.includes(i[1]) || L.includes(i[1])) && (W += 25), p.push({ item: x, score: W });
1879
+ const o = r.trim().toLowerCase();
1880
+ if (!o) return m;
1881
+ const d = o.split(/\s+/), h = [];
1882
+ for (const x of m) {
1883
+ const g = Ie[x.chain], p = g ? g.name.toLowerCase() : "", b = ((f = g == null ? void 0 : g.shortName) == null ? void 0 : f.toLowerCase()) || "", S = x.chain.toLowerCase(), P = x.code.toLowerCase(), w = x.name.toLowerCase(), G = [P, w, p, b, S];
1884
+ if (!d.every((z) => G.some((c) => c.includes(z)))) continue;
1885
+ let j = 0;
1886
+ P === o ? j += 100 : P.startsWith(d[0]) && (j += 50), x.popular && (j += 10), d.length > 1 && (p.includes(d[1]) || b.includes(d[1]) || S.includes(d[1])) && (j += 25), h.push({ item: x, score: j });
1663
1887
  }
1664
- return p.sort((x, g) => g.score - x.score), p.map((x) => x.item);
1665
- }, [u, r]);
1666
- return /* @__PURE__ */ o(le, { children: [
1667
- /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Le, { onClick: t }) }),
1888
+ return h.sort((x, g) => g.score - x.score), h.map((x) => x.item);
1889
+ }, [m, r]);
1890
+ return /* @__PURE__ */ l(J, { children: [
1891
+ /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ve, { onClick: t }) }),
1668
1892
  /* @__PURE__ */ e(
1669
1893
  "h2",
1670
1894
  {
@@ -1673,22 +1897,22 @@ function ra({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: l = "" }) {
1673
1897
  children: "Select crypto currency"
1674
1898
  }
1675
1899
  ),
1676
- /* @__PURE__ */ e(Xe, { value: r, onChange: d }),
1677
- /* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
1678
- m.map((c) => {
1679
- const i = Re[c.chain], p = (i == null ? void 0 : i.name) || c.chainName || c.chain;
1680
- return /* @__PURE__ */ o(
1900
+ /* @__PURE__ */ e(Be, { value: r, onChange: u }),
1901
+ /* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
1902
+ i.map((o) => {
1903
+ const d = Ie[o.chain], h = (d == null ? void 0 : d.name) || o.chainName || o.chain;
1904
+ return /* @__PURE__ */ l(
1681
1905
  "button",
1682
1906
  {
1683
- onClick: () => a(c.code, c.chain),
1907
+ onClick: () => a(o.code, o.chain),
1684
1908
  className: "flex items-center gap-3.5 w-full py-3.5 transition-colors",
1685
1909
  children: [
1686
- /* @__PURE__ */ o("div", { className: "relative shrink-0", style: { width: 40, height: 40 }, children: [
1910
+ /* @__PURE__ */ l("div", { className: "relative shrink-0", style: { width: 40, height: 40 }, children: [
1687
1911
  /* @__PURE__ */ e(
1688
1912
  "img",
1689
1913
  {
1690
- src: pt(c.code, l),
1691
- alt: c.code,
1914
+ src: yt(o.code, s),
1915
+ alt: o.code,
1692
1916
  width: 32,
1693
1917
  height: 32,
1694
1918
  className: "rounded-full absolute top-0 left-0",
@@ -1698,8 +1922,8 @@ function ra({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: l = "" }) {
1698
1922
  /* @__PURE__ */ e(
1699
1923
  "img",
1700
1924
  {
1701
- src: Ke(c.chain, l),
1702
- alt: c.chain,
1925
+ src: _e(o.chain, s),
1926
+ alt: o.chain,
1703
1927
  width: 16,
1704
1928
  height: 16,
1705
1929
  className: "rounded-full absolute",
@@ -1713,28 +1937,28 @@ function ra({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: l = "" }) {
1713
1937
  }
1714
1938
  )
1715
1939
  ] }),
1716
- /* @__PURE__ */ o("div", { className: "text-left flex-1 min-w-0", children: [
1940
+ /* @__PURE__ */ l("div", { className: "text-left flex-1 min-w-0", children: [
1717
1941
  /* @__PURE__ */ e(
1718
1942
  "div",
1719
1943
  {
1720
1944
  className: "font-semibold text-[15px] leading-tight",
1721
1945
  style: { color: "var(--t-text)" },
1722
- children: c.code
1946
+ children: o.code
1723
1947
  }
1724
1948
  ),
1725
- /* @__PURE__ */ e("div", { className: "text-[13px] mt-0.5", style: { color: "var(--t-text-secondary)" }, children: c.name })
1949
+ /* @__PURE__ */ e("div", { className: "text-[13px] mt-0.5", style: { color: "var(--t-text-secondary)" }, children: o.name })
1726
1950
  ] }),
1727
- /* @__PURE__ */ e("div", { className: "text-right shrink-0", children: /* @__PURE__ */ e("div", { className: "text-[13px]", style: { color: "var(--t-text-muted)" }, children: p }) })
1951
+ /* @__PURE__ */ e("div", { className: "text-right shrink-0", children: /* @__PURE__ */ e("div", { className: "text-[13px]", style: { color: "var(--t-text-muted)" }, children: h }) })
1728
1952
  ]
1729
1953
  },
1730
- `${c.code}-${c.chain}`
1954
+ `${o.code}-${o.chain}`
1731
1955
  );
1732
1956
  }),
1733
- m.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No currencies found" })
1957
+ i.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No currencies found" })
1734
1958
  ] })
1735
1959
  ] });
1736
1960
  }
1737
- function oa({
1961
+ function ma({
1738
1962
  checked: t,
1739
1963
  onChange: a,
1740
1964
  accentColor: n = "var(--t-accent)"
@@ -1764,23 +1988,23 @@ function oa({
1764
1988
  }
1765
1989
  );
1766
1990
  }
1767
- const la = [
1991
+ const pa = [
1768
1992
  { label: "Privacy policy", href: "https://nowramp.com/privacy-policy" },
1769
1993
  { label: "Terms of use", href: "https://nowramp.com/terms-and-conditions" }
1770
1994
  ];
1771
- function ca({
1995
+ function ha({
1772
1996
  onClose: t,
1773
1997
  darkMode: a,
1774
1998
  onToggleDarkMode: n,
1775
- skinId: l,
1999
+ skinId: s,
1776
2000
  onSelectSkin: r
1777
2001
  }) {
1778
- return /* @__PURE__ */ o(le, { children: [
1779
- /* @__PURE__ */ e("div", { className: "flex justify-end items-center px-5 pt-5", children: /* @__PURE__ */ e(Le, { onClick: t }) }),
1780
- /* @__PURE__ */ o("div", { className: "px-5 flex-1 pt-6 overflow-y-auto custom-scroll", children: [
1781
- /* @__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: [
1782
- /* @__PURE__ */ o("div", { className: "flex items-center gap-3.5", children: [
1783
- /* @__PURE__ */ e(aa, { size: 40 }),
2002
+ return /* @__PURE__ */ l(J, { children: [
2003
+ /* @__PURE__ */ e("div", { className: "flex justify-end items-center px-5 pt-5", children: /* @__PURE__ */ e(ve, { onClick: t }) }),
2004
+ /* @__PURE__ */ l("div", { className: "px-5 flex-1 pt-6 overflow-y-auto custom-scroll", children: [
2005
+ /* @__PURE__ */ e("div", { style: { borderTop: "1px solid var(--t-divider)" }, children: /* @__PURE__ */ l("div", { className: "flex items-center justify-between w-full py-5", children: [
2006
+ /* @__PURE__ */ l("div", { className: "flex items-center gap-3.5", children: [
2007
+ /* @__PURE__ */ e(Zt, { size: 40 }),
1784
2008
  /* @__PURE__ */ e(
1785
2009
  "span",
1786
2010
  {
@@ -1790,14 +2014,14 @@ function ca({
1790
2014
  }
1791
2015
  )
1792
2016
  ] }),
1793
- /* @__PURE__ */ e(oa, { checked: a, onChange: n, accentColor: "#4CD964" })
2017
+ /* @__PURE__ */ e(ma, { checked: a, onChange: n, accentColor: "#4CD964" })
1794
2018
  ] }) }),
1795
2019
  /* @__PURE__ */ e("div", { style: { height: 1, background: "var(--t-divider)" } }),
1796
- la.map((d) => /* @__PURE__ */ o("div", { children: [
1797
- /* @__PURE__ */ o(
2020
+ pa.map((u) => /* @__PURE__ */ l("div", { children: [
2021
+ /* @__PURE__ */ l(
1798
2022
  "a",
1799
2023
  {
1800
- href: d.href,
2024
+ href: u.href,
1801
2025
  target: "_blank",
1802
2026
  rel: "noopener noreferrer",
1803
2027
  className: "flex items-center justify-between w-full py-5 transition-colors",
@@ -1807,201 +2031,206 @@ function ca({
1807
2031
  {
1808
2032
  className: "font-medium text-[15px]",
1809
2033
  style: { color: "var(--t-text)" },
1810
- children: d.label
2034
+ children: u.label
1811
2035
  }
1812
2036
  ),
1813
- /* @__PURE__ */ e(ea, {})
2037
+ /* @__PURE__ */ e(Wt, {})
1814
2038
  ]
1815
2039
  }
1816
2040
  ),
1817
2041
  /* @__PURE__ */ e("div", { style: { height: 1, background: "var(--t-divider)" } })
1818
- ] }, d.label))
2042
+ ] }, u.label))
1819
2043
  ] })
1820
2044
  ] });
1821
2045
  }
1822
- function sa({
2046
+ function fa({
1823
2047
  className: t = "",
1824
2048
  theme: a = "dark",
1825
2049
  skinId: n = "mono",
1826
- accentColor: l,
2050
+ accentColor: s,
1827
2051
  bgColor: r,
1828
- bgImage: d,
1829
- borderColor: u,
1830
- borderRadius: m,
1831
- showFlowToggle: c = !0,
1832
- autoRedirect: i = !1,
1833
- explorerUrl: p,
2052
+ bgImage: u,
2053
+ borderColor: m,
2054
+ borderRadius: i,
2055
+ showFlowToggle: o = !0,
2056
+ autoRedirect: d = !1,
2057
+ explorerUrl: h,
1834
2058
  doneButtonText: f = "Done",
1835
2059
  supportEmail: x,
1836
2060
  onDone: g
1837
2061
  }) {
1838
- var Je, ze, qe, et, tt, at, nt;
2062
+ var ze, qe, et, tt, at, nt, rt, ot;
1839
2063
  const {
1840
- state: h,
2064
+ state: p,
1841
2065
  dispatch: b,
1842
- config: L,
1843
- configLoading: O,
1844
- quotes: A,
2066
+ config: S,
2067
+ configLoading: P,
2068
+ quotes: w,
1845
2069
  quotesLoading: G,
1846
- quotesError: j,
1847
- fetchQuotes: W,
1848
- createOrder: Z,
1849
- orderLoading: s,
1850
- amountError: P,
1851
- fieldLocks: v,
1852
- apiConfig: I,
1853
- assetBaseUrl: D
1854
- } = he(), [F, K] = C(a === "dark"), [ge, pe] = C(n), [fe, Y] = C(null), [ye, ee] = C(!1), [ve, ce] = C(!1), [se, Ne] = C(!1), [V, te] = C(null), [ae, Ce] = C(!0), [be, Ee] = C(!1), [J, ie] = C(!1), Ie = U(null), xe = U(), N = U(h.flowType);
1855
- H(() => {
1856
- K(a === "dark");
1857
- }, [a]), H(() => {
1858
- const y = setTimeout(() => Ce(!1), O ? 0 : 800);
2070
+ quotesError: Q,
2071
+ fetchQuotes: j,
2072
+ createOrder: z,
2073
+ orderLoading: c,
2074
+ amountError: O,
2075
+ fieldLocks: C,
2076
+ apiConfig: L,
2077
+ assetBaseUrl: K
2078
+ } = pe(), [X, $] = N(a === "dark"), [Ne, he] = N(n), [fe, Y] = N(null), [ye, ae] = N(!1), [Ce, se] = N(!1), [ce, be] = N(!1), [V, ne] = N(null), [re, Ee] = N(!0), [Ae, we] = N(!1), [q, ie] = N(!1), Oe = D(null), xe = D(), v = D(p.flowType);
2079
+ U(() => {
2080
+ $(a === "dark");
2081
+ }, [a]), U(() => {
2082
+ const y = setTimeout(() => Ee(!1), P ? 0 : 800);
1859
2083
  return () => clearTimeout(y);
1860
- }, [O]), H(() => {
1861
- if (N.current !== h.flowType && !ae) {
1862
- N.current = h.flowType, Ee(!0), ee(!1), ce(!1);
1863
- const y = setTimeout(() => Ee(!1), 350);
2084
+ }, [P]), U(() => {
2085
+ if (v.current !== p.flowType && !re) {
2086
+ v.current = p.flowType, we(!0), ae(!1), se(!1);
2087
+ const y = setTimeout(() => we(!1), 350);
1864
2088
  return () => clearTimeout(y);
1865
2089
  }
1866
- N.current = h.flowType;
1867
- }, [h.flowType, ae]);
1868
- const S = h.flowType, R = S === "buy", k = h.cryptoCurrency || "BTC", w = h.fiatCurrency || "USD", _ = R ? h.fiatAmount : h.cryptoAmount, ne = Yt(_), de = (Je = A == null ? void 0 : A.bestQuote) != null && Je.exchangeRate ? parseFloat(A.bestQuote.exchangeRate) : null, Ae = U(null);
1869
- de && k && w && (Ae.current = { rate: de, crypto: k, fiat: w });
1870
- const yt = X(() => {
1871
- if (A != null && A.bestQuote) {
1872
- const y = R ? A.bestQuote.cryptoAmount : A.bestQuote.fiatAmount;
2090
+ v.current = p.flowType;
2091
+ }, [p.flowType, re]);
2092
+ const E = p.flowType, R = E === "buy", k = p.cryptoCurrency || "BTC", T = p.fiatCurrency || "USD", H = R ? p.fiatAmount : p.cryptoAmount, W = Kt(H), de = (ze = w == null ? void 0 : w.bestQuote) != null && ze.exchangeRate ? parseFloat(w.bestQuote.exchangeRate) : null, Se = D(null);
2093
+ de && k && T && (Se.current = { rate: de, crypto: k, fiat: T });
2094
+ const gt = F(() => {
2095
+ if (w != null && w.bestQuote) {
2096
+ const y = R ? w.bestQuote.cryptoAmount : w.bestQuote.fiatAmount;
1873
2097
  if (y) return y;
1874
2098
  }
1875
2099
  return "0";
1876
- }, [A, R]), xt = X(() => {
1877
- var M, z, Oe;
1878
- const y = de || ((M = Ae.current) == null ? void 0 : M.rate), E = de ? k : (z = Ae.current) == null ? void 0 : z.crypto, T = de ? w : (Oe = Ae.current) == null ? void 0 : Oe.fiat;
1879
- return !y || !E || !T ? "" : `1 ${E} ≈ ${y.toFixed(2)} ${T}`;
1880
- }, [k, w, de]);
1881
- H(() => {
1882
- const y = h.walletAddress.trim(), E = h.network;
2100
+ }, [w, R]), vt = F(() => {
2101
+ var B, ee, Ue;
2102
+ const y = de || ((B = Se.current) == null ? void 0 : B.rate), A = de ? k : (ee = Se.current) == null ? void 0 : ee.crypto, I = de ? T : (Ue = Se.current) == null ? void 0 : Ue.fiat;
2103
+ return !y || !A || !I ? "" : `1 ${A} ≈ ${y.toFixed(2)} ${I}`;
2104
+ }, [k, T, de]);
2105
+ U(() => {
2106
+ const y = p.walletAddress.trim(), A = p.network;
1883
2107
  if (!y || y.length < 10) {
1884
- te(null), b({ type: "SET_WALLET_ERROR", message: "" });
2108
+ ne(null), b({ type: "SET_WALLET_ERROR", message: "" });
1885
2109
  return;
1886
2110
  }
1887
- return Ne(!0), te(null), clearTimeout(xe.current), xe.current = setTimeout(async () => {
1888
- var T, M, z;
2111
+ return be(!0), ne(null), clearTimeout(xe.current), xe.current = setTimeout(async () => {
2112
+ var I, B, ee;
1889
2113
  try {
1890
- const Pe = await (await fetch(`${I.apiUrl}/public/validate/address`, {
2114
+ const De = await (await fetch(`${L.apiUrl}/public/validate/address`, {
1891
2115
  method: "POST",
1892
2116
  headers: { "Content-Type": "application/json" },
1893
- body: JSON.stringify({ address: y, ...E ? { network: E } : {} })
1894
- })).json(), He = ((T = Pe.data) == null ? void 0 : T.attributes) || Pe.data || Pe;
1895
- if (He.isValid)
1896
- te(!0), b({ type: "SET_WALLET_ERROR", message: "" });
2117
+ body: JSON.stringify({ address: y, ...A ? { network: A } : {} })
2118
+ })).json(), Fe = ((I = De.data) == null ? void 0 : I.attributes) || De.data || De;
2119
+ if (Fe.isValid)
2120
+ ne(!0), b({ type: "SET_WALLET_ERROR", message: "" });
1897
2121
  else {
1898
- te(!1);
1899
- const At = ((M = He.errors) == null ? void 0 : M[0]) || ((z = He.details) == null ? void 0 : z.formatMessage) || "Invalid wallet address";
1900
- b({ type: "SET_WALLET_ERROR", message: At });
2122
+ ne(!1);
2123
+ const Tt = ((B = Fe.errors) == null ? void 0 : B[0]) || ((ee = Fe.details) == null ? void 0 : ee.formatMessage) || "Invalid wallet address";
2124
+ b({ type: "SET_WALLET_ERROR", message: Tt });
1901
2125
  }
1902
2126
  } catch {
1903
- te(null);
2127
+ ne(null);
1904
2128
  } finally {
1905
- Ne(!1);
2129
+ be(!1);
1906
2130
  }
1907
2131
  }, 500), () => clearTimeout(xe.current);
1908
- }, [h.walletAddress, h.network, I.apiUrl]);
1909
- const $e = !_ || ne === 0, Ge = ne > 0 && (R ? ne < it : ne < dt), We = !!P || Ge || ye && $e, gt = ne > 0 && !P && !Ge, Be = h.walletAddress.trim().length >= 10 && V !== !1 && !se, Se = gt && Be && !!h.cryptoCurrency && !!h.network, vt = (y) => {
1910
- let E = y.target.value.replace(/[^0-9.,]/g, "");
1911
- const T = R ? 2 : 6, M = E.indexOf(".");
1912
- M !== -1 && E.length - M - 1 > T && (E = E.slice(0, M + T + 1)), b(R ? { type: "SET_FIAT_AMOUNT", amount: E } : { type: "SET_CRYPTO_AMOUNT", amount: E });
1913
- }, Ye = (y) => {
1914
- y !== S && b({ type: "SET_FLOW_TYPE", flowType: y });
1915
- }, Nt = $(
2132
+ }, [p.walletAddress, p.network, L.apiUrl]);
2133
+ const Ge = !H || W === 0, je = W > 0 && (R ? W < dt : W < ut), Ye = !!O || je || ye && Ge, Nt = W > 0 && !O && !je, Pe = p.walletAddress.trim().length >= 10 && V !== !1 && !ce, Te = Nt && Pe && !!p.cryptoCurrency && !!p.network, Ct = (y) => {
2134
+ let A = y.target.value.replace(/[^0-9.,]/g, "");
2135
+ const I = R ? 2 : 6, B = A.indexOf(".");
2136
+ B !== -1 && A.length - B - 1 > I && (A = A.slice(0, B + I + 1)), b(R ? { type: "SET_FIAT_AMOUNT", amount: A } : { type: "SET_CRYPTO_AMOUNT", amount: A });
2137
+ }, Ve = (y) => {
2138
+ y !== E && b({ type: "SET_FLOW_TYPE", flowType: y });
2139
+ }, bt = _(
1916
2140
  (y) => {
1917
2141
  b({ type: "SET_FIAT_CURRENCY", currency: y });
1918
2142
  },
1919
2143
  [b]
1920
- ), Ct = $(
1921
- (y, E) => {
1922
- b({ type: "SET_CRYPTO_CURRENCY", currency: y }), b({ type: "SET_CRYPTO_CHAIN", chain: E });
2144
+ ), Et = _(
2145
+ (y, A) => {
2146
+ b({ type: "SET_CRYPTO_CURRENCY", currency: y }), b({ type: "SET_CRYPTO_CHAIN", chain: A });
1923
2147
  },
1924
2148
  [b]
1925
- ), bt = () => {
1926
- Se && (ie(!0), W());
2149
+ ), At = _(
2150
+ (y) => {
2151
+ b({ type: "SET_PAYMENT_METHOD", methodId: y });
2152
+ },
2153
+ [b]
2154
+ ), wt = () => {
2155
+ Te && (ie(!0), j());
1927
2156
  };
1928
- H(() => {
2157
+ U(() => {
1929
2158
  var y;
1930
- if (!(!J || G)) {
1931
- if (A != null && A.bestQuote)
1932
- ie(!1), b({ type: "SELECT_QUOTE", quote: A.bestQuote }), Z().catch(() => {
2159
+ if (!(!q || G)) {
2160
+ if (w != null && w.bestQuote)
2161
+ ie(!1), b({ type: "SELECT_QUOTE", quote: w.bestQuote }), z().catch(() => {
1933
2162
  });
1934
- else if (j)
1935
- ie(!1), b({ type: "SET_ERROR", message: j.message || "No quotes available" });
1936
- else if (A && !A.bestQuote) {
2163
+ else if (Q)
2164
+ ie(!1), b({ type: "SET_ERROR", message: Q.message || "No quotes available" });
2165
+ else if (w && !w.bestQuote) {
1937
2166
  ie(!1);
1938
- const E = (y = A.unavailableGateways) == null ? void 0 : y.map((M) => M.reason).filter(Boolean), T = E != null && E.length ? `No providers available: ${E.join("; ")}` : "No providers available for this currency/network combination";
1939
- b({ type: "SET_ERROR", message: T });
2167
+ const A = (y = w.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";
2168
+ b({ type: "SET_ERROR", message: I });
1940
2169
  }
1941
2170
  }
1942
- }, [J, A, G, j, b, Z]);
1943
- const Ve = F ? "theme-dark" : "theme-light", Me = ct.find((y) => y.id === ge) || ct[0], Et = Me.accent === null, je = (l ? Fe(l) : !1) ? { "--t-accent": l, "--t-cta-bg": l, "--t-cta-text": "#ffffff" } : Et ? {
1944
- "--t-accent": F ? "#ffffff" : "#111111",
1945
- "--t-cta-bg": F ? "#ffffff" : "#111111",
1946
- "--t-cta-text": F ? "#000000" : "#ffffff"
2171
+ }, [q, w, G, Q, b, z]);
2172
+ const We = X ? "theme-dark" : "theme-light", He = ct.find((y) => y.id === Ne) || ct[0], St = He.accent === null, Qe = (s ? Ke(s) : !1) ? { "--t-accent": s, "--t-cta-bg": s, "--t-cta-text": "#ffffff" } : St ? {
2173
+ "--t-accent": X ? "#ffffff" : "#111111",
2174
+ "--t-cta-bg": X ? "#ffffff" : "#111111",
2175
+ "--t-cta-text": X ? "#000000" : "#ffffff"
1947
2176
  } : {
1948
- "--t-accent": Me.accent,
1949
- "--t-cta-bg": Me.accent,
2177
+ "--t-accent": He.accent,
2178
+ "--t-cta-bg": He.accent,
1950
2179
  "--t-cta-text": "#ffffff"
1951
- }, re = {};
1952
- r && Fe(r) ? re.backgroundColor = r : re.backgroundColor = "var(--t-bg)", d && (re.backgroundImage = `url(${d})`, re.backgroundSize = "cover", re.backgroundPosition = "center");
1953
- const we = {};
1954
- u && Fe(u) && (we.border = `1px solid ${u}`), m && (we.borderRadius = m);
1955
- const Qe = h.step === "checkout" ? /* @__PURE__ */ e(Ot, { autoRedirect: i }) : h.step === "processing" ? /* @__PURE__ */ e(Ht, {}) : h.step === "complete" ? /* @__PURE__ */ e(Ut, { explorerUrl: p, doneButtonText: f, onDone: g }) : h.step === "error" ? /* @__PURE__ */ e(Dt, { supportEmail: x }) : h.step === "confirm" ? /* @__PURE__ */ e(Ft, {}) : null;
1956
- if (Qe)
2180
+ }, oe = {};
2181
+ r && Ke(r) ? oe.backgroundColor = r : oe.backgroundColor = "var(--t-bg)", u && (oe.backgroundImage = `url(${u})`, oe.backgroundSize = "cover", oe.backgroundPosition = "center");
2182
+ const Re = {};
2183
+ m && Ke(m) && (Re.border = `1px solid ${m}`), i && (Re.borderRadius = i);
2184
+ const Ze = p.step === "checkout" ? /* @__PURE__ */ e(ta, { autoRedirect: d }) : p.step === "processing" ? /* @__PURE__ */ e(na, {}) : p.step === "complete" ? /* @__PURE__ */ e(ra, { explorerUrl: h, doneButtonText: f, onDone: g }) : p.step === "error" ? /* @__PURE__ */ e(oa, { supportEmail: x }) : p.step === "confirm" ? /* @__PURE__ */ e(la, {}) : null;
2185
+ if (Ze)
1957
2186
  return /* @__PURE__ */ e(
1958
2187
  "div",
1959
2188
  {
1960
- className: `${Ve} relative w-full max-w-[390px] h-[640px] overflow-hidden flex flex-col select-none transition-colors duration-300 ${t}`,
2189
+ className: `${We} relative w-full max-w-[390px] h-[640px] overflow-hidden flex flex-col select-none transition-colors duration-300 ${t}`,
1961
2190
  style: {
1962
2191
  fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
1963
- ...re,
1964
- ...je,
1965
- ...we
2192
+ ...oe,
2193
+ ...Qe,
2194
+ ...Re
1966
2195
  },
1967
- children: Qe
2196
+ children: Ze
1968
2197
  }
1969
2198
  );
1970
- const Q = h.network, ue = Q ? Re[Q] : null, Ze = (ue == null ? void 0 : ue.shortName) || (ue == null ? void 0 : ue.name) || Q;
1971
- return /* @__PURE__ */ o(
2199
+ const Z = p.network, ue = Z ? Ie[Z] : null, Je = (ue == null ? void 0 : ue.shortName) || (ue == null ? void 0 : ue.name) || Z;
2200
+ return /* @__PURE__ */ l(
1972
2201
  "div",
1973
2202
  {
1974
- className: `${Ve} relative w-full max-w-[390px] min-h-[640px] overflow-hidden flex flex-col select-none transition-colors duration-300 ${t}`,
2203
+ className: `${We} relative w-full max-w-[390px] min-h-[640px] overflow-hidden flex flex-col select-none transition-colors duration-300 ${t}`,
1975
2204
  style: {
1976
2205
  fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
1977
- ...re,
1978
- ...je,
1979
- ...we
2206
+ ...oe,
2207
+ ...Qe,
2208
+ ...Re
1980
2209
  },
1981
2210
  children: [
1982
- /* @__PURE__ */ e("div", { className: `flex justify-end items-center px-5 pt-3 ${c ? "pb-1" : "pb-5"}`, children: /* @__PURE__ */ e(ta, { onClick: () => Y("settings") }) }),
1983
- c ? /* @__PURE__ */ o("div", { className: "flex flex-col items-center pt-3 pb-5", children: [
1984
- /* @__PURE__ */ o("div", { className: "flex", style: { width: 165 }, children: [
2211
+ /* @__PURE__ */ e("div", { className: `flex justify-end items-center px-5 pt-3 ${o ? "pb-1" : "pb-5"}`, children: /* @__PURE__ */ e(Qt, { onClick: () => Y("settings") }) }),
2212
+ o ? /* @__PURE__ */ l("div", { className: "flex flex-col items-center pt-3 pb-5", children: [
2213
+ /* @__PURE__ */ l("div", { className: "flex", style: { width: 165 }, children: [
1985
2214
  /* @__PURE__ */ e(
1986
2215
  "button",
1987
2216
  {
1988
- onClick: () => Ye("buy"),
2217
+ onClick: () => Ve("buy"),
1989
2218
  className: "flex-1 pb-2.5 text-[16px] font-medium text-center transition-colors duration-200",
1990
- style: { color: S === "buy" ? "var(--t-text)" : "var(--t-text-secondary)" },
2219
+ style: { color: E === "buy" ? "var(--t-text)" : "var(--t-text-secondary)" },
1991
2220
  children: "Buy"
1992
2221
  }
1993
2222
  ),
1994
2223
  /* @__PURE__ */ e(
1995
2224
  "button",
1996
2225
  {
1997
- onClick: () => Ye("sell"),
2226
+ onClick: () => Ve("sell"),
1998
2227
  className: "flex-1 pb-2.5 text-[16px] font-medium text-center transition-colors duration-200",
1999
- style: { color: S === "sell" ? "var(--t-text)" : "var(--t-text-secondary)" },
2228
+ style: { color: E === "sell" ? "var(--t-text)" : "var(--t-text-secondary)" },
2000
2229
  children: "Sell"
2001
2230
  }
2002
2231
  )
2003
2232
  ] }),
2004
- /* @__PURE__ */ o("div", { className: "relative", style: { width: 165, height: 1 }, children: [
2233
+ /* @__PURE__ */ l("div", { className: "relative", style: { width: 165, height: 1 }, children: [
2005
2234
  /* @__PURE__ */ e("div", { className: "absolute inset-0", style: { background: "var(--t-divider)" } }),
2006
2235
  /* @__PURE__ */ e(
2007
2236
  "div",
@@ -2009,42 +2238,42 @@ function sa({
2009
2238
  className: "absolute top-0 h-full transition-all duration-300 ease-in-out",
2010
2239
  style: {
2011
2240
  width: "50%",
2012
- left: S === "buy" ? "0%" : "50%",
2241
+ left: E === "buy" ? "0%" : "50%",
2013
2242
  background: "var(--t-accent)"
2014
2243
  }
2015
2244
  }
2016
2245
  )
2017
2246
  ] })
2018
2247
  ] }) : null,
2019
- ae || be || O ? /* @__PURE__ */ e(Xt, {}) : /* @__PURE__ */ o("div", { className: "flex-1 overflow-hidden px-5 flex flex-col tab-fade-in", children: [
2020
- /* @__PURE__ */ o(
2248
+ re || Ae || P ? /* @__PURE__ */ e(ia, {}) : /* @__PURE__ */ l("div", { className: "flex-1 overflow-hidden px-5 flex flex-col tab-fade-in", children: [
2249
+ /* @__PURE__ */ l(
2021
2250
  "div",
2022
2251
  {
2023
2252
  className: "px-[18px] pt-[14px] pb-[18px]",
2024
2253
  style: {
2025
2254
  background: "var(--t-surface)",
2026
2255
  borderRadius: 5,
2027
- border: ye && We ? "1px solid #EF4444" : "1px solid transparent"
2256
+ border: ye && Ye ? "1px solid #EF4444" : "1px solid transparent"
2028
2257
  },
2029
2258
  children: [
2030
2259
  /* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: "You spend" }),
2031
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
2260
+ /* @__PURE__ */ l("div", { className: "flex items-center justify-between", children: [
2032
2261
  /* @__PURE__ */ e(
2033
2262
  "input",
2034
2263
  {
2035
- ref: Ie,
2264
+ ref: Oe,
2036
2265
  type: "text",
2037
- value: _,
2038
- onChange: vt,
2039
- onBlur: () => ee(!0),
2266
+ value: H,
2267
+ onChange: Ct,
2268
+ onBlur: () => ae(!0),
2040
2269
  placeholder: R ? "250" : "0.01",
2041
2270
  className: "bg-transparent outline-none w-0 flex-1 mr-3",
2042
2271
  style: { color: "var(--t-text)", fontSize: 24, fontWeight: 600, lineHeight: "32px" },
2043
2272
  inputMode: "decimal",
2044
- disabled: !!((ze = v == null ? void 0 : v.sourceAmount) != null && ze.locked)
2273
+ disabled: !!((qe = C == null ? void 0 : C.sourceAmount) != null && qe.locked)
2045
2274
  }
2046
2275
  ),
2047
- R ? /* @__PURE__ */ o(
2276
+ R ? /* @__PURE__ */ l(
2048
2277
  "button",
2049
2278
  {
2050
2279
  onClick: () => Y("fiat"),
@@ -2056,15 +2285,15 @@ function sa({
2056
2285
  paddingLeft: 10,
2057
2286
  paddingRight: 10
2058
2287
  },
2059
- disabled: !!((qe = v == null ? void 0 : v.sourceCurrency) != null && qe.locked),
2288
+ disabled: !!((et = C == null ? void 0 : C.sourceCurrency) != null && et.locked),
2060
2289
  children: [
2061
- /* @__PURE__ */ e(_e, { currencyCode: w, size: 16, baseUrl: D }),
2062
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: w }),
2063
- /* @__PURE__ */ e(Te, {})
2290
+ /* @__PURE__ */ e(Xe, { currencyCode: T, size: 16, baseUrl: K }),
2291
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: T }),
2292
+ /* @__PURE__ */ e(ge, {})
2064
2293
  ]
2065
2294
  }
2066
- ) : /* @__PURE__ */ o("div", { className: "flex flex-col items-end shrink-0", children: [
2067
- /* @__PURE__ */ o(
2295
+ ) : /* @__PURE__ */ l("div", { className: "flex flex-col items-end shrink-0", children: [
2296
+ /* @__PURE__ */ l(
2068
2297
  "button",
2069
2298
  {
2070
2299
  onClick: () => Y("crypto"),
@@ -2076,35 +2305,35 @@ function sa({
2076
2305
  paddingLeft: 10,
2077
2306
  paddingRight: 10
2078
2307
  },
2079
- disabled: !!((et = v == null ? void 0 : v.destinationCurrency) != null && et.locked),
2308
+ disabled: !!((tt = C == null ? void 0 : C.destinationCurrency) != null && tt.locked),
2080
2309
  children: [
2081
- /* @__PURE__ */ e(ut, { ticker: k, size: 16, baseUrl: D }),
2310
+ /* @__PURE__ */ e(mt, { ticker: k, size: 16, baseUrl: K }),
2082
2311
  /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: k }),
2083
- /* @__PURE__ */ e(Te, {})
2312
+ /* @__PURE__ */ e(ge, {})
2084
2313
  ]
2085
2314
  }
2086
2315
  ),
2087
- Q && /* @__PURE__ */ o("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
2316
+ Z && /* @__PURE__ */ l("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
2088
2317
  /* @__PURE__ */ e(
2089
2318
  "img",
2090
2319
  {
2091
- src: Ke(Q, D),
2092
- alt: Q,
2320
+ src: _e(Z, K),
2321
+ alt: Z,
2093
2322
  width: 14,
2094
2323
  height: 14,
2095
2324
  className: "rounded-full",
2096
2325
  style: { width: 14, height: 14 }
2097
2326
  }
2098
2327
  ),
2099
- /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children: Ze })
2328
+ /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children: Je })
2100
2329
  ] })
2101
2330
  ] })
2102
2331
  ] })
2103
2332
  ]
2104
2333
  }
2105
2334
  ),
2106
- ye && We && /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5 px-[2px]", style: { color: "#EF4444" }, children: P || ($e ? "Amount should be more than 0" : R ? `Minimum amount is ${it} ${w}` : `Minimum amount is ${dt} ${k}`) }),
2107
- /* @__PURE__ */ o(
2335
+ ye && Ye && /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5 px-[2px]", style: { color: "#EF4444" }, children: O || (Ge ? "Amount should be more than 0" : R ? `Minimum amount is ${dt} ${T}` : `Minimum amount is ${ut} ${k}`) }),
2336
+ /* @__PURE__ */ l(
2108
2337
  "div",
2109
2338
  {
2110
2339
  className: "px-[18px] pt-[12px] pb-[14px]",
@@ -2118,18 +2347,18 @@ function sa({
2118
2347
  },
2119
2348
  children: [
2120
2349
  /* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: "You get" }),
2121
- /* @__PURE__ */ o("div", { className: "flex items-start justify-between", children: [
2122
- G ? /* @__PURE__ */ e(B, { w: 180, h: 32 }) : /* @__PURE__ */ e(
2123
- _t,
2350
+ /* @__PURE__ */ l("div", { className: "flex items-start justify-between", children: [
2351
+ G ? /* @__PURE__ */ e(M, { w: 180, h: 32 }) : /* @__PURE__ */ e(
2352
+ ca,
2124
2353
  {
2125
- value: ne > 0 ? yt : "0",
2354
+ value: W > 0 ? gt : "0",
2126
2355
  height: 32,
2127
2356
  className: "font-semibold",
2128
- style: { color: ne > 0 ? "var(--t-text)" : "var(--t-text-muted)", fontSize: 24 }
2357
+ style: { color: W > 0 ? "var(--t-text)" : "var(--t-text-muted)", fontSize: 24 }
2129
2358
  }
2130
2359
  ),
2131
- R ? /* @__PURE__ */ o("div", { className: "flex flex-col items-end shrink-0", children: [
2132
- /* @__PURE__ */ o(
2360
+ R ? /* @__PURE__ */ l("div", { className: "flex flex-col items-end shrink-0", children: [
2361
+ /* @__PURE__ */ l(
2133
2362
  "button",
2134
2363
  {
2135
2364
  onClick: () => Y("crypto"),
@@ -2141,29 +2370,29 @@ function sa({
2141
2370
  paddingLeft: 10,
2142
2371
  paddingRight: 10
2143
2372
  },
2144
- disabled: !!((tt = v == null ? void 0 : v.destinationCurrency) != null && tt.locked),
2373
+ disabled: !!((at = C == null ? void 0 : C.destinationCurrency) != null && at.locked),
2145
2374
  children: [
2146
- /* @__PURE__ */ e(ut, { ticker: k, size: 16, baseUrl: D }),
2375
+ /* @__PURE__ */ e(mt, { ticker: k, size: 16, baseUrl: K }),
2147
2376
  /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: k }),
2148
- /* @__PURE__ */ e(Te, {})
2377
+ /* @__PURE__ */ e(ge, {})
2149
2378
  ]
2150
2379
  }
2151
2380
  ),
2152
- Q && /* @__PURE__ */ o("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
2381
+ Z && /* @__PURE__ */ l("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
2153
2382
  /* @__PURE__ */ e(
2154
2383
  "img",
2155
2384
  {
2156
- src: Ke(Q, D),
2157
- alt: Q,
2385
+ src: _e(Z, K),
2386
+ alt: Z,
2158
2387
  width: 14,
2159
2388
  height: 14,
2160
2389
  className: "rounded-full",
2161
2390
  style: { width: 14, height: 14 }
2162
2391
  }
2163
2392
  ),
2164
- /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children: Ze })
2393
+ /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children: Je })
2165
2394
  ] })
2166
- ] }) : /* @__PURE__ */ o(
2395
+ ] }) : /* @__PURE__ */ l(
2167
2396
  "button",
2168
2397
  {
2169
2398
  onClick: () => Y("fiat"),
@@ -2175,11 +2404,11 @@ function sa({
2175
2404
  paddingLeft: 10,
2176
2405
  paddingRight: 10
2177
2406
  },
2178
- disabled: !!((at = v == null ? void 0 : v.sourceCurrency) != null && at.locked),
2407
+ disabled: !!((nt = C == null ? void 0 : C.sourceCurrency) != null && nt.locked),
2179
2408
  children: [
2180
- /* @__PURE__ */ e(_e, { currencyCode: w, size: 16, baseUrl: D }),
2181
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: w }),
2182
- /* @__PURE__ */ e(Te, {})
2409
+ /* @__PURE__ */ e(Xe, { currencyCode: T, size: 16, baseUrl: K }),
2410
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: T }),
2411
+ /* @__PURE__ */ e(ge, {})
2183
2412
  ]
2184
2413
  }
2185
2414
  )
@@ -2191,100 +2420,112 @@ function sa({
2191
2420
  "div",
2192
2421
  {
2193
2422
  className: "flex items-center justify-between mt-[2px] px-[18px] pt-[12px] pb-[14px]",
2194
- style: { background: "var(--t-surface)" },
2195
- children: /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: xt || " " })
2423
+ style: {
2424
+ background: "var(--t-surface)",
2425
+ ...(rt = S == null ? void 0 : S.paymentMethods) != null && rt.length ? {} : { borderBottomLeftRadius: 5, borderBottomRightRadius: 5 }
2426
+ },
2427
+ children: /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: vt || " " })
2196
2428
  }
2197
2429
  ),
2198
- /* @__PURE__ */ o("div", { className: "mt-8", children: [
2430
+ (S == null ? void 0 : S.paymentMethods) && S.paymentMethods.length > 0 && /* @__PURE__ */ e("div", { className: "mt-[2px]", children: /* @__PURE__ */ e(
2431
+ ea,
2432
+ {
2433
+ methods: S.paymentMethods,
2434
+ selectedId: p.paymentMethodId,
2435
+ onSelect: At,
2436
+ fiatCurrency: p.fiatCurrency
2437
+ }
2438
+ ) }),
2439
+ /* @__PURE__ */ l("div", { className: "mt-8", children: [
2199
2440
  /* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: "Wallet address" }),
2200
2441
  /* @__PURE__ */ e(
2201
2442
  "input",
2202
2443
  {
2203
2444
  type: "text",
2204
- value: h.walletAddress,
2445
+ value: p.walletAddress,
2205
2446
  onChange: (y) => b({ type: "SET_WALLET_ADDRESS", address: y.target.value }),
2206
- onBlur: () => ce(!0),
2447
+ onBlur: () => se(!0),
2207
2448
  placeholder: "Enter your wallet address",
2208
2449
  spellCheck: !1,
2209
2450
  autoComplete: "off",
2210
2451
  className: "w-full bg-transparent text-[13px] outline-none transition-colors",
2211
2452
  style: {
2212
- border: h.walletError || ve && !Be ? "1px solid #EF4444" : "1px solid var(--t-border)",
2453
+ border: p.walletError || Ce && !Pe ? "1px solid #EF4444" : "1px solid var(--t-border)",
2213
2454
  borderRadius: 3.5,
2214
2455
  height: 47,
2215
2456
  paddingLeft: 14,
2216
2457
  paddingRight: 14,
2217
2458
  color: "var(--t-text)"
2218
2459
  },
2219
- disabled: !!((nt = v == null ? void 0 : v.destinationAddress) != null && nt.locked)
2460
+ disabled: !!((ot = C == null ? void 0 : C.destinationAddress) != null && ot.locked)
2220
2461
  }
2221
2462
  ),
2222
- h.walletError ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: h.walletError }) : ve && !Be && !se ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: "Enter a valid wallet address" }) : se && h.walletAddress.trim().length >= 10 ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "var(--t-text-muted)" }, children: "Validating address..." }) : null
2463
+ p.walletError ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: p.walletError }) : Ce && !Pe && !ce ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: "Enter a valid wallet address" }) : ce && p.walletAddress.trim().length >= 10 ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "var(--t-text-muted)" }, children: "Validating address..." }) : null
2223
2464
  ] }),
2224
2465
  /* @__PURE__ */ e("div", { className: "flex-1" }),
2225
2466
  /* @__PURE__ */ e(
2226
2467
  "button",
2227
2468
  {
2228
- disabled: !Se || s || J,
2229
- onClick: bt,
2469
+ disabled: !Te || c || q,
2470
+ onClick: wt,
2230
2471
  className: "w-full font-semibold text-[16px] transition-all",
2231
2472
  style: {
2232
2473
  height: 60,
2233
2474
  borderRadius: 5,
2234
2475
  background: "var(--t-cta-bg)",
2235
2476
  color: "var(--t-cta-text)",
2236
- opacity: Se && !s && !J ? 1 : 0.4,
2237
- cursor: Se && !s && !J ? "pointer" : "not-allowed"
2477
+ opacity: Te && !c && !q ? 1 : 0.4,
2478
+ cursor: Te && !c && !q ? "pointer" : "not-allowed"
2238
2479
  },
2239
- children: J ? "Getting best price..." : s ? "Processing..." : R ? `Buy ${k}` : `Sell ${k}`
2480
+ children: q ? "Getting best price..." : c ? "Processing..." : R ? `Buy ${k}` : `Sell ${k}`
2240
2481
  }
2241
2482
  ),
2242
2483
  /* @__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" }) })
2243
- ] }, S),
2244
- /* @__PURE__ */ e(De, { isOpen: fe === "fiat", onClose: () => Y(null), children: (y) => {
2245
- var E;
2484
+ ] }, E),
2485
+ /* @__PURE__ */ e(Le, { isOpen: fe === "fiat", onClose: () => Y(null), children: (y) => {
2486
+ var A;
2246
2487
  return /* @__PURE__ */ e(
2247
- na,
2488
+ da,
2248
2489
  {
2249
2490
  onClose: y,
2250
- onSelect: (T) => {
2251
- Nt(T), y();
2491
+ onSelect: (I) => {
2492
+ bt(I), y();
2252
2493
  },
2253
- currencies: (E = L == null ? void 0 : L.fiats) == null ? void 0 : E.map((T) => ({ code: T.code, name: T.code })),
2254
- assetBaseUrl: D
2494
+ currencies: (A = S == null ? void 0 : S.fiats) == null ? void 0 : A.map((I) => ({ code: I.code, name: I.code })),
2495
+ assetBaseUrl: K
2255
2496
  }
2256
2497
  );
2257
2498
  } }),
2258
- /* @__PURE__ */ e(De, { isOpen: fe === "crypto", onClose: () => Y(null), children: (y) => {
2259
- var E;
2499
+ /* @__PURE__ */ e(Le, { isOpen: fe === "crypto", onClose: () => Y(null), children: (y) => {
2500
+ var A;
2260
2501
  return /* @__PURE__ */ e(
2261
- ra,
2502
+ ua,
2262
2503
  {
2263
2504
  onClose: y,
2264
- onSelect: (T, M) => {
2265
- Ct(T, M), y();
2505
+ onSelect: (I, B) => {
2506
+ Et(I, B), y();
2266
2507
  },
2267
- cryptos: (E = L == null ? void 0 : L.cryptos) == null ? void 0 : E.map((T) => {
2268
- var M;
2508
+ cryptos: (A = S == null ? void 0 : S.cryptos) == null ? void 0 : A.map((I) => {
2509
+ var B;
2269
2510
  return {
2270
- code: T.code,
2271
- name: T.code,
2272
- networks: (M = T.networks) == null ? void 0 : M.map((z) => ({ code: z.id, name: z.name }))
2511
+ code: I.code,
2512
+ name: I.code,
2513
+ networks: (B = I.networks) == null ? void 0 : B.map((ee) => ({ code: ee.id, name: ee.name }))
2273
2514
  };
2274
2515
  }),
2275
- assetBaseUrl: D
2516
+ assetBaseUrl: K
2276
2517
  }
2277
2518
  );
2278
2519
  } }),
2279
- /* @__PURE__ */ e(De, { isOpen: fe === "settings", onClose: () => Y(null), children: (y) => /* @__PURE__ */ e(
2280
- ca,
2520
+ /* @__PURE__ */ e(Le, { isOpen: fe === "settings", onClose: () => Y(null), children: (y) => /* @__PURE__ */ e(
2521
+ ha,
2281
2522
  {
2282
2523
  onClose: y,
2283
- darkMode: F,
2284
- onToggleDarkMode: K,
2285
- skinId: ge,
2286
- onSelectSkin: (E) => {
2287
- pe(E);
2524
+ darkMode: X,
2525
+ onToggleDarkMode: $,
2526
+ skinId: Ne,
2527
+ onSelectSkin: (A) => {
2528
+ he(A);
2288
2529
  }
2289
2530
  }
2290
2531
  ) })
@@ -2292,108 +2533,108 @@ function sa({
2292
2533
  }
2293
2534
  );
2294
2535
  }
2295
- function ia({
2536
+ function ya({
2296
2537
  projectId: t,
2297
2538
  apiUrl: a,
2298
2539
  assetBaseUrl: n,
2299
- flowType: l,
2540
+ flowType: s,
2300
2541
  customerId: r,
2301
- defaultFiatCurrency: d,
2302
- defaultCryptoCurrency: u,
2303
- defaultNetwork: m,
2304
- defaultFiatAmount: c,
2305
- defaultCryptoAmount: i,
2306
- defaultWalletAddress: p,
2542
+ defaultFiatCurrency: u,
2543
+ defaultCryptoCurrency: m,
2544
+ defaultNetwork: i,
2545
+ defaultFiatAmount: o,
2546
+ defaultCryptoAmount: d,
2547
+ defaultWalletAddress: h,
2307
2548
  defaultGateway: f,
2308
2549
  fieldLocks: x,
2309
2550
  statusPollInterval: g,
2310
- onComplete: h,
2551
+ onComplete: p,
2311
2552
  onError: b,
2312
- className: L,
2313
- theme: O,
2314
- skinId: A,
2553
+ className: S,
2554
+ theme: P,
2555
+ skinId: w,
2315
2556
  accentColor: G,
2316
- bgColor: j,
2317
- bgImage: W,
2318
- borderColor: Z,
2319
- borderRadius: s,
2320
- showFlowToggle: P,
2321
- autoRedirect: v,
2322
- explorerUrl: I,
2323
- doneButtonText: D,
2324
- supportEmail: F,
2325
- onDone: K
2557
+ bgColor: Q,
2558
+ bgImage: j,
2559
+ borderColor: z,
2560
+ borderRadius: c,
2561
+ showFlowToggle: O,
2562
+ autoRedirect: C,
2563
+ explorerUrl: L,
2564
+ doneButtonText: K,
2565
+ supportEmail: X,
2566
+ onDone: $
2326
2567
  }) {
2327
2568
  return /* @__PURE__ */ e(
2328
- Mt,
2569
+ Ht,
2329
2570
  {
2330
2571
  projectId: t,
2331
2572
  apiUrl: a,
2332
2573
  assetBaseUrl: n,
2333
- flowType: l,
2574
+ flowType: s,
2334
2575
  customerId: r,
2335
- defaultFiatCurrency: d,
2336
- defaultCryptoCurrency: u,
2337
- defaultNetwork: m,
2338
- defaultFiatAmount: c,
2339
- defaultCryptoAmount: i,
2340
- defaultWalletAddress: p,
2576
+ defaultFiatCurrency: u,
2577
+ defaultCryptoCurrency: m,
2578
+ defaultNetwork: i,
2579
+ defaultFiatAmount: o,
2580
+ defaultCryptoAmount: d,
2581
+ defaultWalletAddress: h,
2341
2582
  defaultGateway: f,
2342
2583
  fieldLocks: x,
2343
2584
  statusPollInterval: g,
2344
- onComplete: h,
2585
+ onComplete: p,
2345
2586
  onError: b,
2346
2587
  children: /* @__PURE__ */ e(
2347
- sa,
2588
+ fa,
2348
2589
  {
2349
- className: L,
2350
- theme: O,
2351
- skinId: A,
2590
+ className: S,
2591
+ theme: P,
2592
+ skinId: w,
2352
2593
  accentColor: G,
2353
- bgColor: j,
2354
- bgImage: W,
2355
- borderColor: Z,
2356
- borderRadius: s,
2357
- showFlowToggle: P,
2358
- autoRedirect: v,
2359
- explorerUrl: I,
2360
- doneButtonText: D,
2361
- supportEmail: F,
2362
- onDone: K
2594
+ bgColor: Q,
2595
+ bgImage: j,
2596
+ borderColor: z,
2597
+ borderRadius: c,
2598
+ showFlowToggle: O,
2599
+ autoRedirect: C,
2600
+ explorerUrl: L,
2601
+ doneButtonText: K,
2602
+ supportEmail: X,
2603
+ onDone: $
2363
2604
  }
2364
2605
  )
2365
2606
  }
2366
2607
  );
2367
2608
  }
2368
- function Ca({
2609
+ function Ta({
2369
2610
  submitButtonText: t,
2370
2611
  rateRefreshInterval: a,
2371
2612
  ...n
2372
2613
  }) {
2373
- return /* @__PURE__ */ e(ia, { ...n });
2614
+ return /* @__PURE__ */ e(ya, { ...n });
2374
2615
  }
2375
- function ba({
2616
+ function Ra({
2376
2617
  skin: t,
2377
2618
  active: a,
2378
2619
  onClick: n,
2379
- darkMode: l,
2620
+ darkMode: s,
2380
2621
  dimmed: r
2381
2622
  }) {
2382
- const d = t.accent === null, u = 32;
2383
- return /* @__PURE__ */ o(
2623
+ const u = t.accent === null, m = 32;
2624
+ return /* @__PURE__ */ l(
2384
2625
  "button",
2385
2626
  {
2386
2627
  onClick: n,
2387
2628
  className: "relative shrink-0",
2388
- style: { width: u, height: u, opacity: r ? 0.4 : 1, transition: "opacity 0.2s" },
2629
+ style: { width: m, height: m, opacity: r ? 0.4 : 1, transition: "opacity 0.2s" },
2389
2630
  children: [
2390
- d ? /* @__PURE__ */ o("svg", { width: u, height: u, viewBox: "0 0 32 32", children: [
2631
+ u ? /* @__PURE__ */ l("svg", { width: m, height: m, viewBox: "0 0 32 32", children: [
2391
2632
  /* @__PURE__ */ e("clipPath", { id: "mono-left", children: /* @__PURE__ */ e("rect", { x: "0", y: "0", width: "16", height: "32" }) }),
2392
2633
  /* @__PURE__ */ e("clipPath", { id: "mono-right", children: /* @__PURE__ */ e("rect", { x: "16", y: "0", width: "16", height: "32" }) }),
2393
2634
  /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: "#111111", clipPath: "url(#mono-left)" }),
2394
2635
  /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: "#ffffff", clipPath: "url(#mono-right)" }),
2395
- /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: "none", stroke: l ? "rgba(255,255,255,0.15)" : "rgba(0,0,0,0.1)", strokeWidth: "1" })
2396
- ] }) : /* @__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 }) }),
2636
+ /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: "none", stroke: s ? "rgba(255,255,255,0.15)" : "rgba(0,0,0,0.1)", strokeWidth: "1" })
2637
+ ] }) : /* @__PURE__ */ e("svg", { width: m, height: m, viewBox: "0 0 32 32", children: /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: t.accent }) }),
2397
2638
  a && !r && /* @__PURE__ */ e(
2398
2639
  "div",
2399
2640
  {
@@ -2405,13 +2646,13 @@ function ba({
2405
2646
  }
2406
2647
  );
2407
2648
  }
2408
- function da({ quote: t }) {
2409
- 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: [
2649
+ function xa({ quote: t }) {
2650
+ return t.isBestRate ? /* @__PURE__ */ e("div", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: "Best price" }) : t.isRecommended ? /* @__PURE__ */ e("div", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: "Recommended" }) : t.rank && t.rank <= 3 ? /* @__PURE__ */ l("div", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: [
2410
2651
  "#",
2411
2652
  t.rank
2412
2653
  ] }) : null;
2413
2654
  }
2414
- function ua({ quote: t }) {
2655
+ function ga({ quote: t }) {
2415
2656
  return t.gatewayLogo ? /* @__PURE__ */ e(
2416
2657
  "img",
2417
2658
  {
@@ -2422,10 +2663,10 @@ function ua({ quote: t }) {
2422
2663
  className: "rounded-full shrink-0",
2423
2664
  style: { width: 36, height: 36 }
2424
2665
  }
2425
- ) : /* @__PURE__ */ e(ft, { size: 36 });
2666
+ ) : /* @__PURE__ */ e($e, { size: 36 });
2426
2667
  }
2427
- function ma() {
2428
- return /* @__PURE__ */ e("div", { className: "space-y-2", children: [0, 1, 2].map((t) => /* @__PURE__ */ o(
2668
+ function va() {
2669
+ return /* @__PURE__ */ e("div", { className: "space-y-2", children: [0, 1, 2].map((t) => /* @__PURE__ */ l(
2429
2670
  "div",
2430
2671
  {
2431
2672
  className: "w-full flex items-center gap-3.5",
@@ -2437,34 +2678,34 @@ function ma() {
2437
2678
  background: "var(--t-surface)"
2438
2679
  },
2439
2680
  children: [
2440
- /* @__PURE__ */ e(B, { w: 36, h: 36, className: "rounded-full shrink-0" }),
2441
- /* @__PURE__ */ o("div", { className: "flex-1", children: [
2442
- /* @__PURE__ */ e(B, { w: 90, h: 14, className: "mb-1.5" }),
2443
- /* @__PURE__ */ e(B, { w: 60, h: 12 })
2681
+ /* @__PURE__ */ e(M, { w: 36, h: 36, className: "rounded-full shrink-0" }),
2682
+ /* @__PURE__ */ l("div", { className: "flex-1", children: [
2683
+ /* @__PURE__ */ e(M, { w: 90, h: 14, className: "mb-1.5" }),
2684
+ /* @__PURE__ */ e(M, { w: 60, h: 12 })
2444
2685
  ] }),
2445
- /* @__PURE__ */ o("div", { className: "text-right", children: [
2446
- /* @__PURE__ */ e(B, { w: 40, h: 10, className: "mb-1.5" }),
2447
- /* @__PURE__ */ e(B, { w: 80, h: 14 })
2686
+ /* @__PURE__ */ l("div", { className: "text-right", children: [
2687
+ /* @__PURE__ */ e(M, { w: 40, h: 10, className: "mb-1.5" }),
2688
+ /* @__PURE__ */ e(M, { w: 80, h: 14 })
2448
2689
  ] })
2449
2690
  ]
2450
2691
  },
2451
2692
  t
2452
2693
  )) });
2453
2694
  }
2454
- function Ea({
2695
+ function ka({
2455
2696
  onClose: t,
2456
2697
  onSelect: a,
2457
2698
  quotes: n,
2458
- quotesLoading: l,
2699
+ quotesLoading: s,
2459
2700
  cryptoCurrency: r
2460
2701
  }) {
2461
- const [d, u] = C(""), m = X(() => {
2702
+ const [u, m] = N(""), i = F(() => {
2462
2703
  if (!(n != null && n.quotes)) return [];
2463
- const c = d.trim().toLowerCase();
2464
- return c ? n.quotes.filter((i) => i.gatewayName.toLowerCase().includes(c)) : n.quotes;
2465
- }, [n, d]);
2466
- return /* @__PURE__ */ o(le, { children: [
2467
- /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Le, { onClick: t }) }),
2704
+ const o = u.trim().toLowerCase();
2705
+ return o ? n.quotes.filter((d) => d.gatewayName.toLowerCase().includes(o)) : n.quotes;
2706
+ }, [n, u]);
2707
+ return /* @__PURE__ */ l(J, { children: [
2708
+ /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ve, { onClick: t }) }),
2468
2709
  /* @__PURE__ */ e(
2469
2710
  "h2",
2470
2711
  {
@@ -2473,32 +2714,32 @@ function Ea({
2473
2714
  children: "Choose Ramp"
2474
2715
  }
2475
2716
  ),
2476
- /* @__PURE__ */ e(Xe, { value: d, onChange: u }),
2477
- /* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5 space-y-2", children: [
2478
- l ? /* @__PURE__ */ e(ma, {}) : m.length === 0 ? /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: n && n.quotes.length === 0 ? "No quotes available for this request" : "No providers found" }) : m.map((c, i) => {
2479
- const p = i === 0, f = parseFloat(c.cryptoAmount), x = f >= 1 ? f.toFixed(4) : f.toPrecision(6);
2480
- return /* @__PURE__ */ o(
2717
+ /* @__PURE__ */ e(Be, { value: u, onChange: m }),
2718
+ /* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto custom-scroll px-5 space-y-2", children: [
2719
+ s ? /* @__PURE__ */ e(va, {}) : i.length === 0 ? /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: n && n.quotes.length === 0 ? "No quotes available for this request" : "No providers found" }) : i.map((o, d) => {
2720
+ const h = d === 0, f = parseFloat(o.cryptoAmount), x = f >= 1 ? f.toFixed(4) : f.toPrecision(6);
2721
+ return /* @__PURE__ */ l(
2481
2722
  "button",
2482
2723
  {
2483
- onClick: () => a(c),
2724
+ onClick: () => a(o),
2484
2725
  className: "w-full flex items-center gap-3.5 transition-colors",
2485
2726
  style: {
2486
- borderRadius: p ? 4.5 : 5,
2487
- height: p ? 63 : 64,
2727
+ borderRadius: h ? 4.5 : 5,
2728
+ height: h ? 63 : 64,
2488
2729
  paddingLeft: 16,
2489
2730
  paddingRight: 16,
2490
- border: p ? "1px solid var(--t-border)" : "1px solid transparent",
2491
- background: p ? "transparent" : "var(--t-surface)"
2731
+ border: h ? "1px solid var(--t-border)" : "1px solid transparent",
2732
+ background: h ? "transparent" : "var(--t-surface)"
2492
2733
  },
2493
2734
  children: [
2494
- /* @__PURE__ */ e(ua, { quote: c }),
2495
- /* @__PURE__ */ o("div", { className: "text-left flex-1 min-w-0", children: [
2496
- /* @__PURE__ */ e("div", { className: "font-medium text-[15px]", style: { color: "var(--t-text)" }, children: c.gatewayName }),
2497
- /* @__PURE__ */ e(da, { quote: c })
2735
+ /* @__PURE__ */ e(ga, { quote: o }),
2736
+ /* @__PURE__ */ l("div", { className: "text-left flex-1 min-w-0", children: [
2737
+ /* @__PURE__ */ e("div", { className: "font-medium text-[15px]", style: { color: "var(--t-text)" }, children: o.gatewayName }),
2738
+ /* @__PURE__ */ e(xa, { quote: o })
2498
2739
  ] }),
2499
- /* @__PURE__ */ o("div", { className: "text-right shrink-0", children: [
2740
+ /* @__PURE__ */ l("div", { className: "text-right shrink-0", children: [
2500
2741
  /* @__PURE__ */ e("div", { className: "text-[11px]", style: { color: "var(--t-text-secondary)" }, children: "You get" }),
2501
- /* @__PURE__ */ o("div", { className: "font-medium text-[14px]", style: { color: "var(--t-text)" }, children: [
2742
+ /* @__PURE__ */ l("div", { className: "font-medium text-[14px]", style: { color: "var(--t-text)" }, children: [
2502
2743
  r,
2503
2744
  " ",
2504
2745
  x
@@ -2506,78 +2747,79 @@ function Ea({
2506
2747
  ] })
2507
2748
  ]
2508
2749
  },
2509
- c.gatewayId
2750
+ o.gatewayId
2510
2751
  );
2511
2752
  }),
2512
- !l && (n == null ? void 0 : n.unavailableGateways) && n.unavailableGateways.length > 0 && /* @__PURE__ */ e("div", { className: "pt-3", children: n.unavailableGateways.map((c) => /* @__PURE__ */ o(
2753
+ !s && (n == null ? void 0 : n.unavailableGateways) && n.unavailableGateways.length > 0 && /* @__PURE__ */ e("div", { className: "pt-3", children: n.unavailableGateways.map((o) => /* @__PURE__ */ l(
2513
2754
  "div",
2514
2755
  {
2515
2756
  className: "flex items-center justify-between py-2 text-[12px]",
2516
2757
  style: { color: "var(--t-text-muted)" },
2517
2758
  children: [
2518
- /* @__PURE__ */ e("span", { children: c.gatewayName }),
2519
- /* @__PURE__ */ e("span", { children: c.reason })
2759
+ /* @__PURE__ */ e("span", { children: o.gatewayName }),
2760
+ /* @__PURE__ */ e("span", { children: o.reason })
2520
2761
  ]
2521
2762
  },
2522
- c.gatewayId
2763
+ o.gatewayId
2523
2764
  )) })
2524
2765
  ] })
2525
2766
  ] });
2526
2767
  }
2527
2768
  export {
2528
- Kt as AnimatedDigit,
2529
- _t as AnimatedNumber,
2530
- Zt as ApplePayIcon,
2531
- Re as BLOCKCHAINS,
2532
- jt as BankIcon,
2533
- Vt as CRYPTO_CHAIN_COMBOS,
2534
- $t as CRYPTO_CURRENCIES,
2535
- qt as CardIcon,
2536
- Ca as CheckoutForm,
2537
- Ot as CheckoutStep,
2538
- Te as ChevronDown,
2539
- ea as ChevronRight,
2540
- Ea as ChooseRampModal,
2541
- Le as CloseButton,
2542
- va as CoinifyIcon,
2543
- Ut as CompleteStep,
2544
- Ft as ConfirmStep,
2545
- ra as CryptoCurrencyModal,
2546
- ut as CryptoIcon,
2547
- aa as DarkModeIcon,
2548
- Dt as ErrorStep,
2549
- lt as FIAT_CURRENCIES,
2550
- Gt as FIAT_TO_COUNTRY,
2551
- na as FiatCurrencyModal,
2552
- _e as FiatFlag,
2553
- Xt as FormSkeleton,
2554
- ft as GenericCoinIcon,
2555
- Jt as GooglePayIcon,
2556
- st as MOCK_RATES,
2557
- ta as MenuIcon,
2558
- De as Modal,
2559
- zt as PayPalIcon,
2560
- Ht as ProcessingStep,
2561
- ia as RampForm,
2562
- Mt as RampProvider,
2563
- Qt as RevolutIcon,
2769
+ sa as AnimatedDigit,
2770
+ ca as AnimatedNumber,
2771
+ Gt as ApplePayIcon,
2772
+ Ie as BLOCKCHAINS,
2773
+ Xt as BankIcon,
2774
+ _t as CRYPTO_CHAIN_COMBOS,
2775
+ Ut as CRYPTO_CURRENCIES,
2776
+ Vt as CardIcon,
2777
+ Ta as CheckoutForm,
2778
+ ta as CheckoutStep,
2779
+ ge as ChevronDown,
2780
+ Wt as ChevronRight,
2781
+ ka as ChooseRampModal,
2782
+ ve as CloseButton,
2783
+ Sa as CoinifyIcon,
2784
+ ra as CompleteStep,
2785
+ la as ConfirmStep,
2786
+ ua as CryptoCurrencyModal,
2787
+ mt as CryptoIcon,
2788
+ Zt as DarkModeIcon,
2789
+ oa as ErrorStep,
2790
+ st as FIAT_CURRENCIES,
2791
+ Dt as FIAT_TO_COUNTRY,
2792
+ da as FiatCurrencyModal,
2793
+ Xe as FiatFlag,
2794
+ ia as FormSkeleton,
2795
+ $e as GenericCoinIcon,
2796
+ jt as GooglePayIcon,
2797
+ it as MOCK_RATES,
2798
+ Qt as MenuIcon,
2799
+ Le as Modal,
2800
+ Yt as PayPalIcon,
2801
+ ea as PaymentMethodSelector,
2802
+ na as ProcessingStep,
2803
+ ya as RampForm,
2804
+ Ht as RampProvider,
2805
+ $t as RevolutIcon,
2564
2806
  ct as SKINS,
2565
- Xe as SearchInput,
2566
- ca as SettingsScreen,
2567
- B as Skeleton,
2568
- ba as SkinSwatch,
2569
- oa as ToggleSwitch,
2570
- ga as formatOutput,
2571
- Ke as getChainIconUrl,
2572
- pt as getCryptoIconUrl,
2573
- Wt as getFiatFlagUrl,
2574
- xa as getMockRate,
2575
- Na as getPaymentIcon,
2576
- Yt as parseAmount,
2577
- Lt as useCheckoutIntent,
2578
- kt as useQuotes,
2579
- he as useRamp,
2580
- Rt as useRampConfig,
2581
- It as useTransaction
2807
+ Be as SearchInput,
2808
+ ha as SettingsScreen,
2809
+ M as Skeleton,
2810
+ Ra as SkinSwatch,
2811
+ ma as ToggleSwitch,
2812
+ wa as formatOutput,
2813
+ _e as getChainIconUrl,
2814
+ yt as getCryptoIconUrl,
2815
+ Ft as getFiatFlagUrl,
2816
+ Aa as getMockRate,
2817
+ Jt as getPaymentIcon,
2818
+ Kt as parseAmount,
2819
+ Bt as useCheckoutIntent,
2820
+ Mt as useQuotes,
2821
+ pe as useRamp,
2822
+ It as useRampConfig,
2823
+ Ot as useTransaction
2582
2824
  };
2583
2825
  //# sourceMappingURL=index.js.map