@nowramp/form 0.1.52 → 0.1.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +91 -81
- package/dist/index.js.map +1 -1
- package/dist/nowramp-form.iife.js +10 -10
- package/dist/nowramp-form.iife.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -4,17 +4,17 @@
|
|
|
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}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.left-0{left:0}.right-3{right:.75rem}.top-0{top:0}.top-1\\/2{top:50%}.top-\\[3px\\]{top:3px}.z-20{z-index:20}.mx-5{margin-left:1.25rem;margin-right:1.25rem}.mb-1\\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-2\\.5{margin-bottom:.625rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mr-0\\.5{margin-right:.125rem}.mr-3{margin-right:.75rem}.mt-0\\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-\\[2px\\]{margin-top:2px}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.h-\\[640px\\]{height:640px}.h-full{height:100%}.min-h-\\[640px\\]{min-height:640px}.w-0{width:0px}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-\\[390px\\]{max-width:390px}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.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}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.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-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-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-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-\\[10px\\]{font-size:10px}.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-snug{line-height:1.375}.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}.opacity-0{opacity:0}.opacity-100{opacity:1}.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{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.hover-item{transition:background-color .15s ease}.hover-item:hover{background-color:var(--t-hover-bg, rgba(255, 255, 255, .05))}.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}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.left-0{left:0}.right-3{right:.75rem}.top-0{top:0}.top-1\\/2{top:50%}.top-\\[3px\\]{top:3px}.z-20{z-index:20}.mx-5{margin-left:1.25rem;margin-right:1.25rem}.mb-1\\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-2\\.5{margin-bottom:.625rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mr-0\\.5{margin-right:.125rem}.mr-3{margin-right:.75rem}.mt-0\\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-\\[2px\\]{margin-top:2px}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.h-\\[640px\\]{height:640px}.h-full{height:100%}.min-h-\\[640px\\]{min-height:640px}.w-0{width:0px}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-\\[390px\\]{max-width:390px}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.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}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.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-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-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-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-\\[10px\\]{font-size:10px}.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}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.leading-snug{line-height:1.375}.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}.opacity-0{opacity:0}.opacity-100{opacity:1}.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{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.hover-item{transition:background-color .15s ease}.hover-item:hover{background-color:var(--t-hover-bg, rgba(255, 255, 255, .05))}.hover\\:opacity-70:hover{opacity:.7}
|
|
8
8
|
}`;
|
|
9
9
|
document.head.appendChild(s);
|
|
10
10
|
})();
|
|
11
11
|
import { jsx as e, jsxs as o, Fragment as te } from "react/jsx-runtime";
|
|
12
|
-
import
|
|
13
|
-
import { RampApi as
|
|
12
|
+
import De, { useState as g, useRef as V, useCallback as O, useEffect as _, useMemo as j, useReducer as Xt, useContext as $t, createContext as jt } from "react";
|
|
13
|
+
import { RampApi as Ke } from "@nowramp/sdk";
|
|
14
14
|
import { createPortal as yt } from "react-dom";
|
|
15
15
|
function Wt(t, n) {
|
|
16
16
|
const [a, r] = g(null), [l, u] = g(!0), [m, i] = g(null), s = V(null);
|
|
17
|
-
(!s.current || s.current !== t) && (s.current = new
|
|
17
|
+
(!s.current || s.current !== t) && (s.current = new Ke({ apiKey: "", ...t }));
|
|
18
18
|
const p = O(async () => {
|
|
19
19
|
if (!t.projectId) {
|
|
20
20
|
i(new Error("projectId is required")), u(!1);
|
|
@@ -36,7 +36,7 @@ function Wt(t, n) {
|
|
|
36
36
|
}
|
|
37
37
|
function Gt(t, n) {
|
|
38
38
|
const [a, r] = g(null), [l, u] = g(!1), [m, i] = g(null), s = V(null), p = V(""), h = `${t.apiUrl}|${t.projectId}`;
|
|
39
|
-
(!s.current || p.current !== h) && (s.current = new
|
|
39
|
+
(!s.current || p.current !== h) && (s.current = new Ke({ apiKey: "", ...t }), p.current = h);
|
|
40
40
|
const d = V(0);
|
|
41
41
|
_(() => {
|
|
42
42
|
const y = ++d.current;
|
|
@@ -70,7 +70,7 @@ function Gt(t, n) {
|
|
|
70
70
|
}
|
|
71
71
|
function Zt(t) {
|
|
72
72
|
const [n, a] = g(null), [r, l] = g(!1), [u, m] = g(null), i = V(null), s = V(""), p = `${t.apiUrl}|${t.projectId}`;
|
|
73
|
-
(!i.current || s.current !== p) && (i.current = new
|
|
73
|
+
(!i.current || s.current !== p) && (i.current = new Ke({ apiKey: "", ...t }), s.current = p);
|
|
74
74
|
const h = O(async (f) => {
|
|
75
75
|
l(!0), m(null);
|
|
76
76
|
try {
|
|
@@ -89,7 +89,7 @@ function Zt(t) {
|
|
|
89
89
|
}
|
|
90
90
|
function Yt(t, n, a) {
|
|
91
91
|
const [r, l] = g(null), [u, m] = g(!1), [i, s] = g(null), p = V(null);
|
|
92
|
-
p.current || (p.current = new
|
|
92
|
+
p.current || (p.current = new Ke({ apiKey: "", projectId: "", ...t }));
|
|
93
93
|
const h = O(async () => {
|
|
94
94
|
if (n) {
|
|
95
95
|
m(!0), s(null);
|
|
@@ -235,12 +235,12 @@ function Jt({
|
|
|
235
235
|
loading: Se,
|
|
236
236
|
error: se
|
|
237
237
|
} = Wt(Q, c.flowType);
|
|
238
|
-
|
|
238
|
+
De.useEffect(() => {
|
|
239
239
|
var U, F, M;
|
|
240
240
|
if (!I || !c.cryptoCurrency || c.network) return;
|
|
241
241
|
const v = (U = I.cryptos) == null ? void 0 : U.find((K) => K.code === c.cryptoCurrency), w = ((F = v == null ? void 0 : v.networks) == null ? void 0 : F.find((K) => K.isDefault)) || ((M = v == null ? void 0 : v.networks) == null ? void 0 : M[0]);
|
|
242
242
|
w != null && w.id && N({ type: "SET_NETWORK", network: w.id });
|
|
243
|
-
}, [I, c.cryptoCurrency, c.network]),
|
|
243
|
+
}, [I, c.cryptoCurrency, c.network]), De.useEffect(() => {
|
|
244
244
|
var M, K;
|
|
245
245
|
if (!((M = I == null ? void 0 : I.paymentMethods) != null && M.length)) return;
|
|
246
246
|
const v = c.fiatCurrency, w = I.paymentMethods;
|
|
@@ -289,15 +289,15 @@ function Jt({
|
|
|
289
289
|
createOrder: me
|
|
290
290
|
} = Zt(Q), G = 15e3, {
|
|
291
291
|
status: Z,
|
|
292
|
-
loading:
|
|
292
|
+
loading: Be
|
|
293
293
|
} = Yt(
|
|
294
294
|
{ apiUrl: n },
|
|
295
295
|
(ae == null ? void 0 : ae.orderId) ?? null,
|
|
296
296
|
{ pollInterval: A, initialDelay: G }
|
|
297
297
|
);
|
|
298
|
-
|
|
298
|
+
De.useEffect(() => {
|
|
299
299
|
(Z == null ? void 0 : Z.status) === "completed" && b && b(Z);
|
|
300
|
-
}, [Z == null ? void 0 : Z.status, b]),
|
|
300
|
+
}, [Z == null ? void 0 : Z.status, b]), De.useEffect(() => {
|
|
301
301
|
const v = se || Re;
|
|
302
302
|
v && T && T(v);
|
|
303
303
|
}, [se, Re, T]);
|
|
@@ -307,7 +307,7 @@ function Jt({
|
|
|
307
307
|
ve.current = L;
|
|
308
308
|
const be = V(u);
|
|
309
309
|
be.current = u;
|
|
310
|
-
const
|
|
310
|
+
const Ve = O(async () => {
|
|
311
311
|
var w, U, F;
|
|
312
312
|
const v = ((w = c.selectedQuote) == null ? void 0 : w.gatewayId) || ((F = (U = ve.current) == null ? void 0 : U.bestQuote) == null ? void 0 : F.gatewayId) || Te.current;
|
|
313
313
|
if (!v || !c.walletAddress) {
|
|
@@ -338,7 +338,7 @@ function Jt({
|
|
|
338
338
|
}, []), Le = O(() => {
|
|
339
339
|
const v = ["confirm", "amount", "quotes", "wallet", "checkout", "processing", "complete"], w = v.indexOf(c.step);
|
|
340
340
|
w > 0 && N({ type: "SET_STEP", step: v[w - 1] });
|
|
341
|
-
}, [c.step, H]),
|
|
341
|
+
}, [c.step, H]), Xe = j(() => {
|
|
342
342
|
const v = H ? !!c.cryptoAmount : !!c.fiatAmount;
|
|
343
343
|
switch (c.step) {
|
|
344
344
|
case "confirm":
|
|
@@ -352,7 +352,7 @@ function Jt({
|
|
|
352
352
|
default:
|
|
353
353
|
return !1;
|
|
354
354
|
}
|
|
355
|
-
}, [c, X, H]),
|
|
355
|
+
}, [c, X, H]), $e = {
|
|
356
356
|
apiConfig: Q,
|
|
357
357
|
assetBaseUrl: a,
|
|
358
358
|
config: I,
|
|
@@ -367,17 +367,17 @@ function Jt({
|
|
|
367
367
|
order: ae,
|
|
368
368
|
orderLoading: Ce,
|
|
369
369
|
orderError: Re,
|
|
370
|
-
createOrder:
|
|
370
|
+
createOrder: Ve,
|
|
371
371
|
orderStatus: Z,
|
|
372
|
-
orderStatusLoading:
|
|
372
|
+
orderStatusLoading: Be,
|
|
373
373
|
fieldLocks: y || null,
|
|
374
374
|
defaultGateway: ge,
|
|
375
375
|
amountError: X,
|
|
376
376
|
goToStep: he,
|
|
377
377
|
goBack: Le,
|
|
378
|
-
canProceed:
|
|
378
|
+
canProceed: Xe
|
|
379
379
|
};
|
|
380
|
-
return /* @__PURE__ */ e(Rt.Provider, { value:
|
|
380
|
+
return /* @__PURE__ */ e(Rt.Provider, { value: $e, children: Y });
|
|
381
381
|
}
|
|
382
382
|
function Ae() {
|
|
383
383
|
const t = $t(Rt);
|
|
@@ -385,7 +385,17 @@ function Ae() {
|
|
|
385
385
|
throw new Error("useRamp must be used within a RampProvider");
|
|
386
386
|
return t;
|
|
387
387
|
}
|
|
388
|
-
const
|
|
388
|
+
const ke = {
|
|
389
|
+
// Canonical IDs (returned by the API)
|
|
390
|
+
ethereum: { name: "Ethereum (ERC20)", shortName: "Ethereum", icon: "eth" },
|
|
391
|
+
bitcoin: { name: "Bitcoin", icon: "btc" },
|
|
392
|
+
solana: { name: "Solana", icon: "sol" },
|
|
393
|
+
polygon: { name: "Polygon", icon: "pol" },
|
|
394
|
+
arbitrum: { name: "Arbitrum", icon: "arb" },
|
|
395
|
+
avalanche: { name: "Avalanche C-Chain", shortName: "Avalanche", icon: "avax" },
|
|
396
|
+
litecoin: { name: "Litecoin", icon: "ltc" },
|
|
397
|
+
tezos: { name: "Tezos", icon: "xtz" },
|
|
398
|
+
// Legacy uppercase keys (used by local crypto data and older integrations)
|
|
389
399
|
ETH: { name: "Ethereum (ERC20)", shortName: "Ethereum", icon: "eth" },
|
|
390
400
|
BSC: { name: "Binance Smart Chain (BEP20)", shortName: "Binance", icon: "bnb" },
|
|
391
401
|
BTC: { name: "Bitcoin", icon: "btc" },
|
|
@@ -756,11 +766,11 @@ function en(t, n = "") {
|
|
|
756
766
|
const a = qt[t] || "us";
|
|
757
767
|
return `${n}/flags/${a}.svg`;
|
|
758
768
|
}
|
|
759
|
-
function
|
|
760
|
-
return
|
|
769
|
+
function Fe(t) {
|
|
770
|
+
return ke[t] || ke[t.toLowerCase()] || ke[t.toUpperCase()] || ke[t.toUpperCase().replace(/-/g, "_")] || ke[t.toLowerCase().replace(/-/g, "_")];
|
|
761
771
|
}
|
|
762
772
|
function Je(t, n = "") {
|
|
763
|
-
const a =
|
|
773
|
+
const a = Fe(t);
|
|
764
774
|
return a ? `${n}/crypto-icons/${a.icon}.svg` : `${n}/crypto-icons/${t.toLowerCase()}.svg`;
|
|
765
775
|
}
|
|
766
776
|
const Ct = [
|
|
@@ -1052,7 +1062,7 @@ function Wn({ size: t = 18 }) {
|
|
|
1052
1062
|
}
|
|
1053
1063
|
);
|
|
1054
1064
|
}
|
|
1055
|
-
function
|
|
1065
|
+
function Ie() {
|
|
1056
1066
|
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" }) });
|
|
1057
1067
|
}
|
|
1058
1068
|
function mn() {
|
|
@@ -1176,7 +1186,7 @@ function Cn({
|
|
|
1176
1186
|
/* @__PURE__ */ o("span", { className: "flex items-center gap-2", children: [
|
|
1177
1187
|
/* @__PURE__ */ e("span", { className: "flex items-center justify-center", style: { width: 20, height: 20 }, children: u && Mt(u.id, u.icon, 20) }),
|
|
1178
1188
|
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: u ? It(u.id, u.name) : "Select" }),
|
|
1179
|
-
/* @__PURE__ */ e(
|
|
1189
|
+
/* @__PURE__ */ e(Ie, {})
|
|
1180
1190
|
] })
|
|
1181
1191
|
]
|
|
1182
1192
|
}
|
|
@@ -1897,7 +1907,7 @@ function ye({ label: t, value: n, mono: a, highlight: r }) {
|
|
|
1897
1907
|
)
|
|
1898
1908
|
] });
|
|
1899
1909
|
}
|
|
1900
|
-
function
|
|
1910
|
+
function Ue({
|
|
1901
1911
|
isOpen: t,
|
|
1902
1912
|
onClose: n,
|
|
1903
1913
|
children: a
|
|
@@ -1985,7 +1995,7 @@ function Rn() {
|
|
|
1985
1995
|
/* @__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" }) })
|
|
1986
1996
|
] });
|
|
1987
1997
|
}
|
|
1988
|
-
function
|
|
1998
|
+
function Me({ onClick: t }) {
|
|
1989
1999
|
return /* @__PURE__ */ e(
|
|
1990
2000
|
"button",
|
|
1991
2001
|
{
|
|
@@ -1998,7 +2008,7 @@ function Ie({ onClick: t }) {
|
|
|
1998
2008
|
}
|
|
1999
2009
|
);
|
|
2000
2010
|
}
|
|
2001
|
-
function
|
|
2011
|
+
function _e({
|
|
2002
2012
|
value: t,
|
|
2003
2013
|
onChange: n,
|
|
2004
2014
|
placeholder: a = ""
|
|
@@ -2057,7 +2067,7 @@ function Tn({
|
|
|
2057
2067
|
);
|
|
2058
2068
|
}, [i, u, l]);
|
|
2059
2069
|
return /* @__PURE__ */ o(te, { children: [
|
|
2060
|
-
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(
|
|
2070
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Me, { onClick: t }) }),
|
|
2061
2071
|
/* @__PURE__ */ e(
|
|
2062
2072
|
"h2",
|
|
2063
2073
|
{
|
|
@@ -2072,7 +2082,7 @@ function Tn({
|
|
|
2072
2082
|
children: "Select fiat currency"
|
|
2073
2083
|
}
|
|
2074
2084
|
),
|
|
2075
|
-
/* @__PURE__ */ e(
|
|
2085
|
+
/* @__PURE__ */ e(_e, { value: u, onChange: m }),
|
|
2076
2086
|
/* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
|
|
2077
2087
|
s.map((p, h) => {
|
|
2078
2088
|
const d = p.name !== p.code ? p.name : "", f = l === p.code;
|
|
@@ -2183,7 +2193,7 @@ function Ln({ onClose: t, onSelect: n, cryptos: a, assetBaseUrl: r = "", selecte
|
|
|
2183
2193
|
}
|
|
2184
2194
|
const f = d.split(/\s+/), y = [];
|
|
2185
2195
|
for (const b of s) {
|
|
2186
|
-
const T =
|
|
2196
|
+
const T = Fe(b.chain), Y = T ? T.name.toLowerCase() : "", Q = ((A = T == null ? void 0 : T.shortName) == null ? void 0 : A.toLowerCase()) || "", q = b.chain.toLowerCase(), ee = b.code.toLowerCase(), ie = b.name.toLowerCase(), C = [ee, ie, Y, Q, q];
|
|
2187
2197
|
if (!f.every((c) => C.some((N) => N.includes(c)))) continue;
|
|
2188
2198
|
let S = 0;
|
|
2189
2199
|
ee === d ? S += 100 : ee.startsWith(f[0]) && (S += 50), b.popular && (S += 10), f.length > 1 && (Y.includes(f[1]) || Q.includes(f[1]) || q.includes(f[1])) && (S += 25), y.push({ item: b, score: S });
|
|
@@ -2191,7 +2201,7 @@ function Ln({ onClose: t, onSelect: n, cryptos: a, assetBaseUrl: r = "", selecte
|
|
|
2191
2201
|
return y.sort((b, T) => T.score - b.score), y.map((b) => b.item);
|
|
2192
2202
|
}, [s, m, l, u]);
|
|
2193
2203
|
return /* @__PURE__ */ o(te, { children: [
|
|
2194
|
-
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(
|
|
2204
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Me, { onClick: t }) }),
|
|
2195
2205
|
/* @__PURE__ */ e(
|
|
2196
2206
|
"h2",
|
|
2197
2207
|
{
|
|
@@ -2200,10 +2210,10 @@ function Ln({ onClose: t, onSelect: n, cryptos: a, assetBaseUrl: r = "", selecte
|
|
|
2200
2210
|
children: "Select crypto currency"
|
|
2201
2211
|
}
|
|
2202
2212
|
),
|
|
2203
|
-
/* @__PURE__ */ e(
|
|
2213
|
+
/* @__PURE__ */ e(_e, { value: m, onChange: i }),
|
|
2204
2214
|
/* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
|
|
2205
2215
|
h.map((d, f) => {
|
|
2206
|
-
const y =
|
|
2216
|
+
const y = Fe(d.chain), A = (y == null ? void 0 : y.name) || d.chainName || d.chain, b = d.name !== d.code ? d.name : "", T = p(d.code, d.chain);
|
|
2207
2217
|
return /* @__PURE__ */ o("div", { children: [
|
|
2208
2218
|
/* @__PURE__ */ o(
|
|
2209
2219
|
"button",
|
|
@@ -2314,7 +2324,7 @@ function kn({
|
|
|
2314
2324
|
);
|
|
2315
2325
|
}, [t, l, n]);
|
|
2316
2326
|
return /* @__PURE__ */ o(te, { children: [
|
|
2317
|
-
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(
|
|
2327
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Me, { onClick: r }) }),
|
|
2318
2328
|
/* @__PURE__ */ e(
|
|
2319
2329
|
"h2",
|
|
2320
2330
|
{
|
|
@@ -2323,7 +2333,7 @@ function kn({
|
|
|
2323
2333
|
children: "Choose payment method"
|
|
2324
2334
|
}
|
|
2325
2335
|
),
|
|
2326
|
-
/* @__PURE__ */ e(
|
|
2336
|
+
/* @__PURE__ */ e(_e, { value: l, onChange: u }),
|
|
2327
2337
|
/* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
|
|
2328
2338
|
m.map((i, s) => {
|
|
2329
2339
|
const p = i.id === n, h = It(i.id, i.name);
|
|
@@ -2424,7 +2434,7 @@ function Bn({
|
|
|
2424
2434
|
showThemeToggle: u = !0
|
|
2425
2435
|
}) {
|
|
2426
2436
|
return /* @__PURE__ */ o(te, { children: [
|
|
2427
|
-
/* @__PURE__ */ e("div", { className: "flex justify-end items-center px-5 pt-5", children: /* @__PURE__ */ e(
|
|
2437
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end items-center px-5 pt-5", children: /* @__PURE__ */ e(Me, { onClick: t }) }),
|
|
2428
2438
|
/* @__PURE__ */ o("div", { className: "px-5 flex-1 pt-6 overflow-y-auto custom-scroll", children: [
|
|
2429
2439
|
u && /* @__PURE__ */ o(te, { children: [
|
|
2430
2440
|
/* @__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: [
|
|
@@ -2510,22 +2520,22 @@ function On({
|
|
|
2510
2520
|
fieldLocks: L,
|
|
2511
2521
|
apiConfig: xe,
|
|
2512
2522
|
assetBaseUrl: W
|
|
2513
|
-
} = Ae(), [ne, ae] = g(n === "dark"), [Ce, Re] = g(a), [me, G] = g(null), [Z,
|
|
2523
|
+
} = Ae(), [ne, ae] = g(n === "dark"), [Ce, Re] = g(a), [me, G] = g(null), [Z, Be] = g(!1), [ge, Te] = g(!1), [ve, be] = g(!1), [Ve, he] = g(null), [Le, Xe] = g(!0), [$e, v] = g(!1), [w, U] = g(!1), F = V(null), M = V(), K = V(C.flowType);
|
|
2514
2524
|
_(() => {
|
|
2515
2525
|
ae(n === "dark");
|
|
2516
2526
|
}, [n]), _(() => {
|
|
2517
|
-
const x = setTimeout(() =>
|
|
2527
|
+
const x = setTimeout(() => Xe(!1), c ? 0 : 800);
|
|
2518
2528
|
return () => clearTimeout(x);
|
|
2519
2529
|
}, [c]), _(() => {
|
|
2520
2530
|
if (K.current !== C.flowType && !Le) {
|
|
2521
|
-
K.current = C.flowType, v(!0),
|
|
2531
|
+
K.current = C.flowType, v(!0), Be(!1), Te(!1);
|
|
2522
2532
|
const x = setTimeout(() => v(!1), 350);
|
|
2523
2533
|
return () => clearTimeout(x);
|
|
2524
2534
|
}
|
|
2525
2535
|
K.current = C.flowType;
|
|
2526
2536
|
}, [C.flowType, Le]);
|
|
2527
|
-
const $ = C.flowType, P = $ === "buy", J = C.cryptoCurrency || "BTC", re = C.fiatCurrency || "USD",
|
|
2528
|
-
Ne && J && re && (
|
|
2537
|
+
const $ = C.flowType, P = $ === "buy", J = C.cryptoCurrency || "BTC", re = C.fiatCurrency || "USD", je = P ? C.fiatAmount : C.cryptoAmount, pe = tn(je), Ne = (st = N == null ? void 0 : N.bestQuote) != null && st.exchangeRate ? parseFloat(N.bestQuote.exchangeRate) : null, Oe = V(null);
|
|
2538
|
+
Ne && J && re && (Oe.current = { rate: Ne, crypto: J, fiat: re });
|
|
2529
2539
|
const Bt = j(() => {
|
|
2530
2540
|
if (N != null && N.bestQuote) {
|
|
2531
2541
|
const x = P ? N.bestQuote.cryptoAmount : N.bestQuote.fiatAmount;
|
|
@@ -2533,8 +2543,8 @@ function On({
|
|
|
2533
2543
|
}
|
|
2534
2544
|
return "0";
|
|
2535
2545
|
}, [N, P]), Ot = j(() => {
|
|
2536
|
-
var D, ce,
|
|
2537
|
-
const x = Ne || ((D =
|
|
2546
|
+
var D, ce, Ze;
|
|
2547
|
+
const x = Ne || ((D = Oe.current) == null ? void 0 : D.rate), E = Ne ? J : (ce = Oe.current) == null ? void 0 : ce.crypto, R = Ne ? re : (Ze = Oe.current) == null ? void 0 : Ze.fiat;
|
|
2538
2548
|
return !x || !E || !R ? "" : `1 ${E} ≈ ${x.toFixed(2)} ${R}`;
|
|
2539
2549
|
}, [J, re, Ne]);
|
|
2540
2550
|
_(() => {
|
|
@@ -2546,16 +2556,16 @@ function On({
|
|
|
2546
2556
|
return be(!0), he(null), clearTimeout(M.current), M.current = setTimeout(async () => {
|
|
2547
2557
|
var R, D, ce;
|
|
2548
2558
|
try {
|
|
2549
|
-
const
|
|
2559
|
+
const Ye = await (await fetch(`${xe.apiUrl}/public/validate/address`, {
|
|
2550
2560
|
method: "POST",
|
|
2551
2561
|
headers: { "Content-Type": "application/json" },
|
|
2552
2562
|
body: JSON.stringify({ address: x, ...E ? { network: E } : {} })
|
|
2553
|
-
})).json(),
|
|
2554
|
-
if (
|
|
2563
|
+
})).json(), Qe = ((R = Ye.data) == null ? void 0 : R.attributes) || Ye.data || Ye;
|
|
2564
|
+
if (Qe.isValid)
|
|
2555
2565
|
he(!0), k({ type: "SET_WALLET_ERROR", message: "" });
|
|
2556
2566
|
else {
|
|
2557
2567
|
he(!1);
|
|
2558
|
-
const Vt = ((D =
|
|
2568
|
+
const Vt = ((D = Qe.errors) == null ? void 0 : D[0]) || ((ce = Qe.details) == null ? void 0 : ce.formatMessage) || "Invalid wallet address";
|
|
2559
2569
|
k({ type: "SET_WALLET_ERROR", message: Vt });
|
|
2560
2570
|
}
|
|
2561
2571
|
} catch {
|
|
@@ -2565,7 +2575,7 @@ function On({
|
|
|
2565
2575
|
}
|
|
2566
2576
|
}, 500), () => clearTimeout(M.current);
|
|
2567
2577
|
}, [C.walletAddress, C.network, xe.apiUrl]);
|
|
2568
|
-
const et =
|
|
2578
|
+
const et = !je || pe === 0, tt = pe > 0 && (P ? pe < bt : pe < Nt), nt = !!ue || tt || Z && et, Ht = pe > 0 && !ue && !tt, We = C.walletAddress.trim().length >= 10 && Ve !== !1 && !ve, He = Ht && We && !!C.cryptoCurrency && !!C.network, Pt = (x) => {
|
|
2569
2579
|
let E = x.target.value.replace(/[^0-9.,]/g, "");
|
|
2570
2580
|
const R = P ? 2 : 6, D = E.indexOf(".");
|
|
2571
2581
|
D !== -1 && E.length - D - 1 > R && (E = E.slice(0, D + R + 1)), k(P ? { type: "SET_FIAT_AMOUNT", amount: E } : { type: "SET_CRYPTO_AMOUNT", amount: E });
|
|
@@ -2587,7 +2597,7 @@ function On({
|
|
|
2587
2597
|
},
|
|
2588
2598
|
[k]
|
|
2589
2599
|
), Kt = () => {
|
|
2590
|
-
|
|
2600
|
+
He && (U(!0), Se());
|
|
2591
2601
|
};
|
|
2592
2602
|
_(() => {
|
|
2593
2603
|
var x;
|
|
@@ -2604,20 +2614,20 @@ function On({
|
|
|
2604
2614
|
}
|
|
2605
2615
|
}
|
|
2606
2616
|
}, [w, N, H, I, k, se]);
|
|
2607
|
-
const rt = ne ? "theme-dark" : "theme-light",
|
|
2617
|
+
const rt = ne ? "theme-dark" : "theme-light", Ge = gt.find((x) => x.id === Ce) || gt[0], _t = Ge.accent === null, ot = (r ? le(r) : !1) ? { "--t-accent": r, "--t-cta-bg": r, "--t-cta-text": "#ffffff" } : _t ? {
|
|
2608
2618
|
"--t-accent": ne ? "#ffffff" : "#111111",
|
|
2609
2619
|
"--t-cta-bg": ne ? "#ffffff" : "#111111",
|
|
2610
2620
|
"--t-cta-text": ne ? "#000000" : "#ffffff"
|
|
2611
2621
|
} : {
|
|
2612
|
-
"--t-accent":
|
|
2613
|
-
"--t-cta-bg":
|
|
2622
|
+
"--t-accent": Ge.accent,
|
|
2623
|
+
"--t-cta-bg": Ge.accent,
|
|
2614
2624
|
"--t-cta-text": "#ffffff"
|
|
2615
2625
|
}, z = {};
|
|
2616
2626
|
s && le(s) && (z["--t-surface"] = s, z["--t-modal-bg"] = s), p && le(p) && (z["--t-pill-bg"] = p, z["--t-close-bg"] = p), h && le(h) && (z["--t-text"] = h), d && le(d) && (z["--t-text-secondary"] = d), f && le(f) && (z["--t-text-muted"] = f, z["--t-text-tertiary"] = f), y && le(y) && (z["--t-success"] = y);
|
|
2617
2627
|
const fe = {};
|
|
2618
2628
|
l && le(l) ? fe.backgroundColor = l : fe.backgroundColor = "var(--t-bg)", u && (fe.backgroundImage = `url(${u})`, fe.backgroundSize = "cover", fe.backgroundPosition = "center");
|
|
2619
|
-
const
|
|
2620
|
-
m && le(m) && (
|
|
2629
|
+
const Pe = {};
|
|
2630
|
+
m && le(m) && (Pe.border = `1px solid ${m}`), i && (Pe.borderRadius = i);
|
|
2621
2631
|
const lt = C.step === "checkout" ? /* @__PURE__ */ e(gn, { autoRedirect: Y }) : C.step === "processing" ? /* @__PURE__ */ e(bn, {}) : C.step === "complete" ? /* @__PURE__ */ e(Nn, { explorerUrl: Q, doneButtonText: q, onDone: ie }) : C.step === "error" ? /* @__PURE__ */ e(En, { supportEmail: ee }) : C.step === "confirm" ? /* @__PURE__ */ e(wn, {}) : null;
|
|
2622
2632
|
if (lt)
|
|
2623
2633
|
return /* @__PURE__ */ e(
|
|
@@ -2629,12 +2639,12 @@ function On({
|
|
|
2629
2639
|
...fe,
|
|
2630
2640
|
...ot,
|
|
2631
2641
|
...z,
|
|
2632
|
-
...
|
|
2642
|
+
...Pe
|
|
2633
2643
|
},
|
|
2634
2644
|
children: lt
|
|
2635
2645
|
}
|
|
2636
2646
|
);
|
|
2637
|
-
const oe = C.network, Ee = oe ?
|
|
2647
|
+
const oe = C.network, Ee = oe ? Fe(oe) : null, it = (Ee == null ? void 0 : Ee.shortName) || (Ee == null ? void 0 : Ee.name) || oe;
|
|
2638
2648
|
return /* @__PURE__ */ o(
|
|
2639
2649
|
"div",
|
|
2640
2650
|
{
|
|
@@ -2644,7 +2654,7 @@ function On({
|
|
|
2644
2654
|
...fe,
|
|
2645
2655
|
...ot,
|
|
2646
2656
|
...z,
|
|
2647
|
-
...
|
|
2657
|
+
...Pe
|
|
2648
2658
|
},
|
|
2649
2659
|
children: [
|
|
2650
2660
|
b && /* @__PURE__ */ e("div", { className: `flex justify-end items-center px-5 pt-3 ${A ? "pb-1" : "pb-5"}`, children: /* @__PURE__ */ e(hn, { onClick: () => G("settings") }) }),
|
|
@@ -2684,7 +2694,7 @@ function On({
|
|
|
2684
2694
|
)
|
|
2685
2695
|
] })
|
|
2686
2696
|
] }) : null,
|
|
2687
|
-
Le ||
|
|
2697
|
+
Le || $e || c ? /* @__PURE__ */ e(Rn, {}) : /* @__PURE__ */ o("div", { className: "flex-1 overflow-hidden px-5 flex flex-col tab-fade-in", children: [
|
|
2688
2698
|
/* @__PURE__ */ o(
|
|
2689
2699
|
"div",
|
|
2690
2700
|
{
|
|
@@ -2703,9 +2713,9 @@ function On({
|
|
|
2703
2713
|
{
|
|
2704
2714
|
ref: F,
|
|
2705
2715
|
type: "text",
|
|
2706
|
-
value:
|
|
2716
|
+
value: je,
|
|
2707
2717
|
onChange: Pt,
|
|
2708
|
-
onBlur: () =>
|
|
2718
|
+
onBlur: () => Be(!0),
|
|
2709
2719
|
placeholder: P ? "250" : "0.01",
|
|
2710
2720
|
className: "bg-transparent outline-none w-0 flex-1 mr-3",
|
|
2711
2721
|
style: { color: "var(--t-text)", fontSize: 24, fontWeight: 600, lineHeight: "32px", padding: 0, border: "none", borderRadius: 0, backgroundColor: "transparent", height: "auto", width: 0 },
|
|
@@ -2729,7 +2739,7 @@ function On({
|
|
|
2729
2739
|
children: [
|
|
2730
2740
|
/* @__PURE__ */ e(ze, { currencyCode: re, size: 16, baseUrl: W }),
|
|
2731
2741
|
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: re }),
|
|
2732
|
-
/* @__PURE__ */ e(
|
|
2742
|
+
/* @__PURE__ */ e(Ie, {})
|
|
2733
2743
|
]
|
|
2734
2744
|
}
|
|
2735
2745
|
) : /* @__PURE__ */ o("div", { className: "flex flex-col items-end shrink-0", children: [
|
|
@@ -2749,7 +2759,7 @@ function On({
|
|
|
2749
2759
|
children: [
|
|
2750
2760
|
/* @__PURE__ */ e(Et, { ticker: J, size: 16, baseUrl: W }),
|
|
2751
2761
|
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: J }),
|
|
2752
|
-
/* @__PURE__ */ e(
|
|
2762
|
+
/* @__PURE__ */ e(Ie, {})
|
|
2753
2763
|
]
|
|
2754
2764
|
}
|
|
2755
2765
|
),
|
|
@@ -2815,7 +2825,7 @@ function On({
|
|
|
2815
2825
|
children: [
|
|
2816
2826
|
/* @__PURE__ */ e(Et, { ticker: J, size: 16, baseUrl: W }),
|
|
2817
2827
|
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: J }),
|
|
2818
|
-
/* @__PURE__ */ e(
|
|
2828
|
+
/* @__PURE__ */ e(Ie, {})
|
|
2819
2829
|
]
|
|
2820
2830
|
}
|
|
2821
2831
|
),
|
|
@@ -2849,7 +2859,7 @@ function On({
|
|
|
2849
2859
|
children: [
|
|
2850
2860
|
/* @__PURE__ */ e(ze, { currencyCode: re, size: 16, baseUrl: W }),
|
|
2851
2861
|
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: re }),
|
|
2852
|
-
/* @__PURE__ */ e(
|
|
2862
|
+
/* @__PURE__ */ e(Ie, {})
|
|
2853
2863
|
]
|
|
2854
2864
|
}
|
|
2855
2865
|
)
|
|
@@ -2891,7 +2901,7 @@ function On({
|
|
|
2891
2901
|
autoComplete: "off",
|
|
2892
2902
|
className: "w-full bg-transparent text-[13px] outline-none transition-colors",
|
|
2893
2903
|
style: {
|
|
2894
|
-
border: C.walletError || ge && !
|
|
2904
|
+
border: C.walletError || ge && !We ? "1px solid #EF4444" : "1px solid var(--t-border)",
|
|
2895
2905
|
borderRadius: 3.5,
|
|
2896
2906
|
height: 47,
|
|
2897
2907
|
padding: "0 14px",
|
|
@@ -2902,13 +2912,13 @@ function On({
|
|
|
2902
2912
|
disabled: !!((ft = L == null ? void 0 : L.destinationAddress) != null && ft.locked)
|
|
2903
2913
|
}
|
|
2904
2914
|
),
|
|
2905
|
-
C.walletError ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: C.walletError }) : ge && !
|
|
2915
|
+
C.walletError ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: C.walletError }) : ge && !We && !ve ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: "Enter a valid wallet address" }) : ve && C.walletAddress.trim().length >= 10 ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "var(--t-text-muted)" }, children: "Validating address..." }) : null
|
|
2906
2916
|
] }),
|
|
2907
2917
|
/* @__PURE__ */ e("div", { className: "flex-1" }),
|
|
2908
2918
|
/* @__PURE__ */ e(
|
|
2909
2919
|
"button",
|
|
2910
2920
|
{
|
|
2911
|
-
disabled: !
|
|
2921
|
+
disabled: !He || X || w,
|
|
2912
2922
|
onClick: Kt,
|
|
2913
2923
|
className: "w-full font-semibold text-[16px] transition-all",
|
|
2914
2924
|
style: {
|
|
@@ -2916,15 +2926,15 @@ function On({
|
|
|
2916
2926
|
borderRadius: 5,
|
|
2917
2927
|
background: "var(--t-cta-bg)",
|
|
2918
2928
|
color: "var(--t-cta-text)",
|
|
2919
|
-
opacity:
|
|
2920
|
-
cursor:
|
|
2929
|
+
opacity: He && !X && !w ? 1 : 0.4,
|
|
2930
|
+
cursor: He && !X && !w ? "pointer" : "not-allowed"
|
|
2921
2931
|
},
|
|
2922
2932
|
children: w ? "Getting best price..." : X ? "Processing..." : P ? `Buy ${J}` : `Sell ${J}`
|
|
2923
2933
|
}
|
|
2924
2934
|
),
|
|
2925
2935
|
/* @__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" }) })
|
|
2926
2936
|
] }, $),
|
|
2927
|
-
/* @__PURE__ */ e(
|
|
2937
|
+
/* @__PURE__ */ e(Ue, { isOpen: me === "fiat", onClose: () => G(null), children: (x) => {
|
|
2928
2938
|
var E;
|
|
2929
2939
|
return /* @__PURE__ */ e(
|
|
2930
2940
|
Tn,
|
|
@@ -2939,7 +2949,7 @@ function On({
|
|
|
2939
2949
|
}
|
|
2940
2950
|
);
|
|
2941
2951
|
} }),
|
|
2942
|
-
/* @__PURE__ */ e(
|
|
2952
|
+
/* @__PURE__ */ e(Ue, { isOpen: me === "crypto", onClose: () => G(null), children: (x) => {
|
|
2943
2953
|
var E;
|
|
2944
2954
|
return /* @__PURE__ */ e(
|
|
2945
2955
|
Ln,
|
|
@@ -2962,7 +2972,7 @@ function On({
|
|
|
2962
2972
|
}
|
|
2963
2973
|
);
|
|
2964
2974
|
} }),
|
|
2965
|
-
/* @__PURE__ */ e(
|
|
2975
|
+
/* @__PURE__ */ e(Ue, { isOpen: me === "payment", onClose: () => G(null), children: (x) => {
|
|
2966
2976
|
var E;
|
|
2967
2977
|
return /* @__PURE__ */ e(
|
|
2968
2978
|
kn,
|
|
@@ -2976,7 +2986,7 @@ function On({
|
|
|
2976
2986
|
}
|
|
2977
2987
|
);
|
|
2978
2988
|
} }),
|
|
2979
|
-
/* @__PURE__ */ e(
|
|
2989
|
+
/* @__PURE__ */ e(Ue, { isOpen: me === "settings", onClose: () => G(null), children: (x) => /* @__PURE__ */ e(
|
|
2980
2990
|
Bn,
|
|
2981
2991
|
{
|
|
2982
2992
|
onClose: x,
|
|
@@ -3183,7 +3193,7 @@ function Yn({
|
|
|
3183
3193
|
return s ? a.quotes.filter((p) => p.gatewayName.toLowerCase().includes(s)) : a.quotes;
|
|
3184
3194
|
}, [a, u]);
|
|
3185
3195
|
return /* @__PURE__ */ o(te, { children: [
|
|
3186
|
-
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(
|
|
3196
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Me, { onClick: t }) }),
|
|
3187
3197
|
/* @__PURE__ */ e(
|
|
3188
3198
|
"h2",
|
|
3189
3199
|
{
|
|
@@ -3192,7 +3202,7 @@ function Yn({
|
|
|
3192
3202
|
children: "Choose Ramp"
|
|
3193
3203
|
}
|
|
3194
3204
|
),
|
|
3195
|
-
/* @__PURE__ */ e(
|
|
3205
|
+
/* @__PURE__ */ e(_e, { value: u, onChange: m }),
|
|
3196
3206
|
/* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5 space-y-2", children: [
|
|
3197
3207
|
r ? /* @__PURE__ */ e(Un, {}) : i.length === 0 ? /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: a && a.quotes.length === 0 ? "No quotes available for this request" : "No providers found" }) : i.map((s, p) => {
|
|
3198
3208
|
const h = p === 0, d = parseFloat(s.cryptoAmount), f = d >= 1 ? d.toFixed(4) : d.toPrecision(6);
|
|
@@ -3247,17 +3257,17 @@ export {
|
|
|
3247
3257
|
An as AnimatedDigit,
|
|
3248
3258
|
Sn as AnimatedNumber,
|
|
3249
3259
|
on as ApplePayIcon,
|
|
3250
|
-
|
|
3260
|
+
ke as BLOCKCHAINS,
|
|
3251
3261
|
an as BankIcon,
|
|
3252
3262
|
nn as CRYPTO_CHAIN_COMBOS,
|
|
3253
3263
|
Tt as CRYPTO_CURRENCIES,
|
|
3254
3264
|
un as CardIcon,
|
|
3255
3265
|
Gn as CheckoutForm,
|
|
3256
3266
|
gn as CheckoutStep,
|
|
3257
|
-
|
|
3267
|
+
Ie as ChevronDown,
|
|
3258
3268
|
mn as ChevronRight,
|
|
3259
3269
|
Yn as ChooseRampModal,
|
|
3260
|
-
|
|
3270
|
+
Me as CloseButton,
|
|
3261
3271
|
Wn as CoinifyIcon,
|
|
3262
3272
|
Nn as CompleteStep,
|
|
3263
3273
|
wn as ConfirmStep,
|
|
@@ -3274,7 +3284,7 @@ export {
|
|
|
3274
3284
|
ln as GooglePayIcon,
|
|
3275
3285
|
vt as MOCK_RATES,
|
|
3276
3286
|
hn as MenuIcon,
|
|
3277
|
-
|
|
3287
|
+
Ue as Modal,
|
|
3278
3288
|
sn as PayPalIcon,
|
|
3279
3289
|
Cn as PaymentMethodSelector,
|
|
3280
3290
|
bn as ProcessingStep,
|
|
@@ -3282,7 +3292,7 @@ export {
|
|
|
3282
3292
|
Jt as RampProvider,
|
|
3283
3293
|
rn as RevolutIcon,
|
|
3284
3294
|
gt as SKINS,
|
|
3285
|
-
|
|
3295
|
+
_e as SearchInput,
|
|
3286
3296
|
Bn as SettingsScreen,
|
|
3287
3297
|
B as Skeleton,
|
|
3288
3298
|
Zn as SkinSwatch,
|