@volr/react-ui 0.1.116 → 0.1.118

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
@@ -559,6 +559,7 @@ var en = {
559
559
  noAssets: "No assets configured",
560
560
  menu: {
561
561
  assets: "Assets",
562
+ deposit: "Deposit",
562
563
  withdraw: "Withdraw",
563
564
  payments: "Payment History",
564
565
  account: "Account"
@@ -646,6 +647,15 @@ var en = {
646
647
  messageLabel: "Message",
647
648
  domainLabel: "Domain"
648
649
  },
650
+ payment: {
651
+ processing: {
652
+ signing: "Confirming payment...",
653
+ broadcasting: "Sending payment...",
654
+ confirming: "Almost done...",
655
+ default: "Processing...",
656
+ doNotClose: "Please don't close this window"
657
+ }
658
+ },
649
659
  errors: {
650
660
  webauthnNotSupported: "WebAuthn API is not supported",
651
661
  passkeyCreationFailed: "Failed to create passkey",
@@ -752,6 +762,7 @@ var ko = {
752
762
  noAssets: "\uC124\uC815\uB41C \uC790\uC0B0\uC774 \uC5C6\uC2B5\uB2C8\uB2E4",
753
763
  menu: {
754
764
  assets: "\uC790\uC0B0",
765
+ deposit: "\uC785\uAE08",
755
766
  withdraw: "\uCD9C\uAE08",
756
767
  payments: "\uACB0\uC81C \uAE30\uB85D",
757
768
  account: "\uACC4\uC815 \uC815\uBCF4"
@@ -839,6 +850,15 @@ var ko = {
839
850
  messageLabel: "\uBA54\uC2DC\uC9C0",
840
851
  domainLabel: "\uB3C4\uBA54\uC778"
841
852
  },
853
+ payment: {
854
+ processing: {
855
+ signing: "\uACB0\uC81C \uD655\uC778 \uC911...",
856
+ broadcasting: "\uACB0\uC81C \uC804\uC1A1 \uC911...",
857
+ confirming: "\uAC70\uC758 \uC644\uB8CC...",
858
+ default: "\uCC98\uB9AC \uC911...",
859
+ doNotClose: "\uCC3D\uC744 \uB2EB\uC9C0 \uB9C8\uC138\uC694"
860
+ }
861
+ },
842
862
  errors: {
843
863
  webauthnNotSupported: "WebAuthn API\uAC00 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",
844
864
  passkeyCreationFailed: "\uD328\uC2A4\uD0A4 \uC0DD\uC131\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4.",
@@ -981,7 +1001,7 @@ function useMediaQuery(query) {
981
1001
  }
982
1002
 
983
1003
  // src/generated/volr-sdk-css.ts
984
- var VOLR_SDK_CSS = '/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--volr-tw-translate-x:0;--volr-tw-translate-y:0;--volr-tw-translate-z:0;--volr-tw-space-y-reverse:0;--volr-tw-border-style:solid;--volr-tw-gradient-position:initial;--volr-tw-gradient-from:#0000;--volr-tw-gradient-via:#0000;--volr-tw-gradient-to:#0000;--volr-tw-gradient-stops:initial;--volr-tw-gradient-via-stops:initial;--volr-tw-gradient-from-position:0%;--volr-tw-gradient-via-position:50%;--volr-tw-gradient-to-position:100%;--volr-tw-leading:initial;--volr-tw-font-weight:initial;--volr-tw-tracking:initial;--volr-tw-shadow:0 0 #0000;--volr-tw-shadow-color:initial;--volr-tw-shadow-alpha:100%;--volr-tw-inset-shadow:0 0 #0000;--volr-tw-inset-shadow-color:initial;--volr-tw-inset-shadow-alpha:100%;--volr-tw-ring-color:initial;--volr-tw-ring-shadow:0 0 #0000;--volr-tw-inset-ring-color:initial;--volr-tw-inset-ring-shadow:0 0 #0000;--volr-tw-ring-inset:initial;--volr-tw-ring-offset-width:0px;--volr-tw-ring-offset-color:#fff;--volr-tw-ring-offset-shadow:0 0 #0000;--volr-tw-blur:initial;--volr-tw-brightness:initial;--volr-tw-contrast:initial;--volr-tw-grayscale:initial;--volr-tw-hue-rotate:initial;--volr-tw-invert:initial;--volr-tw-opacity:initial;--volr-tw-saturate:initial;--volr-tw-sepia:initial;--volr-tw-drop-shadow:initial;--volr-tw-drop-shadow-color:initial;--volr-tw-drop-shadow-alpha:100%;--volr-tw-drop-shadow-size:initial;--volr-tw-duration:initial;--volr-tw-ease:initial}}}@layer theme{:root,:host{--volr-font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--volr-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--volr-color-red-50:oklch(97.1% .013 17.38);--volr-color-red-100:oklch(93.6% .032 17.717);--volr-color-red-200:oklch(88.5% .062 18.334);--volr-color-red-500:oklch(63.7% .237 25.331);--volr-color-red-600:oklch(57.7% .245 27.325);--volr-color-red-700:oklch(50.5% .213 27.518);--volr-color-amber-50:oklch(98.7% .022 95.277);--volr-color-amber-200:oklch(92.4% .12 95.746);--volr-color-amber-700:oklch(55.5% .163 48.998);--volr-color-yellow-100:oklch(97.3% .071 103.193);--volr-color-yellow-700:oklch(55.4% .135 66.442);--volr-color-green-50:oklch(98.2% .018 155.826);--volr-color-green-100:oklch(96.2% .044 156.743);--volr-color-green-600:oklch(62.7% .194 149.214);--volr-color-green-700:oklch(52.7% .154 150.069);--volr-color-emerald-300:oklch(84.5% .143 164.978);--volr-color-emerald-400:oklch(76.5% .177 163.223);--volr-color-emerald-500:oklch(69.6% .17 162.48);--volr-color-emerald-600:oklch(59.6% .145 163.225);--volr-color-teal-400:oklch(77.7% .152 181.912);--volr-color-teal-500:oklch(70.4% .14 182.503);--volr-color-cyan-400:oklch(78.9% .154 211.53);--volr-color-blue-100:oklch(93.2% .032 255.585);--volr-color-blue-700:oklch(48.8% .243 264.376);--volr-color-slate-50:oklch(98.4% .003 247.858);--volr-color-slate-100:oklch(96.8% .007 247.896);--volr-color-slate-200:oklch(92.9% .013 255.508);--volr-color-slate-300:oklch(86.9% .022 252.894);--volr-color-slate-400:oklch(70.4% .04 256.788);--volr-color-slate-500:oklch(55.4% .046 257.417);--volr-color-slate-600:oklch(44.6% .043 257.281);--volr-color-slate-700:oklch(37.2% .044 257.287);--volr-color-slate-900:oklch(20.8% .042 265.755);--volr-color-gray-500:oklch(55.1% .027 264.364);--volr-color-black:#000;--volr-color-white:#fff;--volr-spacing:.25rem;--volr-container-md:28rem;--volr-container-4xl:56rem;--volr-text-xs:.75rem;--volr-text-xs--line-height:calc(1/.75);--volr-text-sm:.875rem;--volr-text-sm--line-height:calc(1.25/.875);--volr-text-base:1rem;--volr-text-base--line-height:calc(1.5/1);--volr-text-lg:1.125rem;--volr-text-lg--line-height:calc(1.75/1.125);--volr-text-xl:1.25rem;--volr-text-xl--line-height:calc(1.75/1.25);--volr-text-2xl:1.5rem;--volr-text-2xl--line-height:calc(2/1.5);--volr-text-3xl:1.875rem;--volr-text-3xl--line-height:calc(2.25/1.875);--volr-text-8xl:6rem;--volr-text-8xl--line-height:1;--volr-font-weight-medium:500;--volr-font-weight-semibold:600;--volr-font-weight-bold:700;--volr-tracking-wide:.025em;--volr-leading-relaxed:1.625;--volr-radius-md:.375rem;--volr-radius-lg:.5rem;--volr-radius-xl:.75rem;--volr-radius-2xl:1rem;--volr-radius-3xl:1.5rem;--volr-ease-out:cubic-bezier(0,0,.2,1);--volr-animate-spin:spin 1s linear infinite;--volr-animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--volr-blur-2xl:40px;--volr-default-transition-duration:.15s;--volr-default-transition-timing-function:cubic-bezier(.4,0,.2,1);--volr-default-font-family:var(--volr-font-sans);--volr-default-mono-font-family:var(--volr-font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--volr-default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--volr-default-font-feature-settings,normal);font-variation-settings:var(--volr-default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--volr-default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--volr-default-mono-font-feature-settings,normal);font-variation-settings:var(--volr-default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:host{--volr-primary-color:var(--volr-accent-color,#303030);--volr-font-family:var(--volr-custom-font,inherit);--volr-bg:#fff;--volr-bg-secondary:#f8fafc;--volr-bg-tertiary:#f1f5f9;--volr-text:#0f172a;--volr-text-secondary:#475569;--volr-text-muted:#94a3b8;--volr-border:#e2e8f0;--volr-border-strong:#cbd5e1;--volr-hover-bg:#f8fafc;--volr-error-bg:#fef2f2;--volr-error-border:#fecaca;--volr-error-text:#991b1b}:host([data-theme=dark]){--volr-bg:#1c1c1e;--volr-bg-secondary:#2c2c2e;--volr-bg-tertiary:#3a3a3c;--volr-text:#f5f5f7;--volr-text-secondary:#c7c7cc;--volr-text-muted:#8e8e93;--volr-border:#3a3a3c;--volr-border-strong:#48484a;--volr-hover-bg:#2c2c2e;--volr-error-bg:#3c1f1f;--volr-error-border:#7f1d1d;--volr-error-text:#fca5a5}*,:before,:after{box-sizing:border-box}*{font-family:var(--volr-font-family);color:var(--volr-text)}button,input,select,textarea{color:var(--volr-text);background-color:#0000}button{cursor:pointer;background-color:#0000}input::placeholder{color:var(--volr-text-muted)}h1,h2,h3{color:var(--volr-text);margin:0;font-weight:700}h1{font-size:1.875rem;line-height:2.25rem}h2{font-size:1.5rem;line-height:2rem}h3{font-size:1.25rem;line-height:1.75rem}p{margin:0}}@layer components{.volr-dialog-overlay{inset:calc(var(--volr-spacing)*0);z-index:40;background-color:var(--volr-color-black);position:fixed}@supports (color:color-mix(in lab, red, red)){.volr-dialog-overlay{background-color:color-mix(in oklab,var(--volr-color-black)45%,transparent)}}.volr-dialog-content{z-index:50;border-radius:var(--volr-radius-2xl);border-style:var(--volr-tw-border-style);padding:calc(var(--volr-spacing)*7);--volr-tw-shadow:0 20px 25px -5px var(--volr-tw-shadow-color,#0000001a),0 8px 10px -6px var(--volr-tw-shadow-color,#0000001a);box-shadow:var(--volr-tw-inset-shadow),var(--volr-tw-inset-ring-shadow),var(--volr-tw-ring-offset-shadow),var(--volr-tw-ring-shadow),var(--volr-tw-shadow);background-color:var(--volr-bg);border-width:1px;border-color:var(--volr-border-strong);width:calc(100% - 2rem);max-width:28rem;max-height:85vh;position:fixed;top:50%;left:50%;overflow-y:auto;transform:translate(-50%,-50%)}@media (max-width:640px){.volr-dialog-content{top:auto;right:calc(var(--volr-spacing)*0);bottom:calc(var(--volr-spacing)*0);left:calc(var(--volr-spacing)*0);border-radius:1.25rem 1.25rem 0 0;width:100%;max-width:100%;margin:0 auto;transform:translateY(0)}}.volr-dialog-close{top:calc(var(--volr-spacing)*4);right:calc(var(--volr-spacing)*4);height:calc(var(--volr-spacing)*8);width:calc(var(--volr-spacing)*8);color:var(--volr-text-muted);cursor:pointer;background-color:#0000;border:none;border-radius:3.40282e38px;justify-content:center;align-items:center;display:inline-flex;position:absolute}.volr-dialog-close:hover{background-color:var(--volr-hover-bg);color:var(--volr-text-secondary)}.volr-dialog-close:focus-visible{box-shadow:0 0 0 2px var(--volr-border-strong);outline:none}.volr-dialog-close-icon{height:calc(var(--volr-spacing)*4);width:calc(var(--volr-spacing)*4)}.volr-email-input{border:1px solid var(--volr-border-strong);background-color:var(--volr-bg);width:100%;color:var(--volr-text);border-radius:.5rem;outline:none;padding:.75rem .75rem .75rem 2.75rem;font-size:1rem;line-height:1.5}.volr-email-input::placeholder{color:var(--volr-text-muted)}.volr-email-input:focus{border-color:var(--volr-border-strong);box-shadow:0 0 0 2px var(--volr-border-strong)}.volr-option-button{border:1px solid var(--volr-border);background-color:var(--volr-bg);width:100%;color:var(--volr-text);cursor:pointer;border-radius:.5rem;align-items:center;gap:.75rem;padding:.75rem;transition:background-color .15s ease-out,border-color .15s ease-out,box-shadow .15s ease-out;display:flex}.volr-option-button:hover{background-color:var(--volr-hover-bg);border-color:var(--volr-border)}.volr-option-button:focus-visible{box-shadow:0 0 0 2px var(--volr-border-strong);outline:none}}@layer utilities{.volr\\:pointer-events-auto{pointer-events:auto}.volr\\:pointer-events-none{pointer-events:none}.volr\\:sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.volr\\:absolute{position:absolute}.volr\\:fixed{position:fixed}.volr\\:relative{position:relative}.volr\\:inset-0{inset:calc(var(--volr-spacing)*0)}.volr\\:-top-3{top:calc(var(--volr-spacing)*-3)}.volr\\:top-1\\/2{top:50%}.volr\\:-right-3{right:calc(var(--volr-spacing)*-3)}.volr\\:right-2{right:calc(var(--volr-spacing)*2)}.volr\\:right-3{right:calc(var(--volr-spacing)*3)}.volr\\:bottom-3{bottom:calc(var(--volr-spacing)*3)}.volr\\:left-3{left:calc(var(--volr-spacing)*3)}.volr\\:-z-10{z-index:calc(10*-1)}.volr\\:z-10{z-index:10}.volr\\:z-20{z-index:20}.volr\\:z-40{z-index:40}.volr\\:z-50{z-index:50}.volr\\:mx-auto{margin-inline:auto}.volr\\:my-6{margin-block:calc(var(--volr-spacing)*6)}.volr\\:mt-0\\.5{margin-top:calc(var(--volr-spacing)*.5)}.volr\\:mt-1{margin-top:calc(var(--volr-spacing)*1)}.volr\\:mt-2{margin-top:calc(var(--volr-spacing)*2)}.volr\\:mt-3{margin-top:calc(var(--volr-spacing)*3)}.volr\\:mt-4{margin-top:calc(var(--volr-spacing)*4)}.volr\\:mt-6{margin-top:calc(var(--volr-spacing)*6)}.volr\\:mt-8{margin-top:calc(var(--volr-spacing)*8)}.volr\\:mb-1{margin-bottom:calc(var(--volr-spacing)*1)}.volr\\:mb-2{margin-bottom:calc(var(--volr-spacing)*2)}.volr\\:mb-3{margin-bottom:calc(var(--volr-spacing)*3)}.volr\\:mb-4{margin-bottom:calc(var(--volr-spacing)*4)}.volr\\:mb-5{margin-bottom:calc(var(--volr-spacing)*5)}.volr\\:mb-6{margin-bottom:calc(var(--volr-spacing)*6)}.volr\\:mb-8{margin-bottom:calc(var(--volr-spacing)*8)}.volr\\:-ml-2{margin-left:calc(var(--volr-spacing)*-2)}.volr\\:line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.volr\\:block{display:block}.volr\\:flex{display:flex}.volr\\:grid{display:grid}.volr\\:inline-block{display:inline-block}.volr\\:inline-flex{display:inline-flex}.volr\\:h-1{height:calc(var(--volr-spacing)*1)}.volr\\:h-1\\.5{height:calc(var(--volr-spacing)*1.5)}.volr\\:h-2{height:calc(var(--volr-spacing)*2)}.volr\\:h-3{height:calc(var(--volr-spacing)*3)}.volr\\:h-4{height:calc(var(--volr-spacing)*4)}.volr\\:h-5{height:calc(var(--volr-spacing)*5)}.volr\\:h-6{height:calc(var(--volr-spacing)*6)}.volr\\:h-7{height:calc(var(--volr-spacing)*7)}.volr\\:h-8{height:calc(var(--volr-spacing)*8)}.volr\\:h-9{height:calc(var(--volr-spacing)*9)}.volr\\:h-10{height:calc(var(--volr-spacing)*10)}.volr\\:h-12{height:calc(var(--volr-spacing)*12)}.volr\\:h-14{height:calc(var(--volr-spacing)*14)}.volr\\:h-16{height:calc(var(--volr-spacing)*16)}.volr\\:h-20{height:calc(var(--volr-spacing)*20)}.volr\\:h-24{height:calc(var(--volr-spacing)*24)}.volr\\:h-40{height:calc(var(--volr-spacing)*40)}.volr\\:h-44{height:calc(var(--volr-spacing)*44)}.volr\\:h-48{height:calc(var(--volr-spacing)*48)}.volr\\:h-\\[0\\.8em\\]{height:.8em}.volr\\:h-\\[200px\\]{height:200px}.volr\\:h-full{height:100%}.volr\\:h-px{height:1px}.volr\\:max-h-48{max-height:calc(var(--volr-spacing)*48)}.volr\\:max-h-60{max-height:calc(var(--volr-spacing)*60)}.volr\\:max-h-64{max-height:calc(var(--volr-spacing)*64)}.volr\\:max-h-\\[85vh\\]{max-height:85vh}.volr\\:max-h-\\[90vh\\]{max-height:90vh}.volr\\:min-h-\\[120px\\]{min-height:120px}.volr\\:min-h-\\[500px\\]{min-height:500px}.volr\\:w-1\\.5{width:calc(var(--volr-spacing)*1.5)}.volr\\:w-2{width:calc(var(--volr-spacing)*2)}.volr\\:w-3{width:calc(var(--volr-spacing)*3)}.volr\\:w-4{width:calc(var(--volr-spacing)*4)}.volr\\:w-5{width:calc(var(--volr-spacing)*5)}.volr\\:w-6{width:calc(var(--volr-spacing)*6)}.volr\\:w-7{width:calc(var(--volr-spacing)*7)}.volr\\:w-8{width:calc(var(--volr-spacing)*8)}.volr\\:w-10{width:calc(var(--volr-spacing)*10)}.volr\\:w-12{width:calc(var(--volr-spacing)*12)}.volr\\:w-14{width:calc(var(--volr-spacing)*14)}.volr\\:w-16{width:calc(var(--volr-spacing)*16)}.volr\\:w-20{width:calc(var(--volr-spacing)*20)}.volr\\:w-24{width:calc(var(--volr-spacing)*24)}.volr\\:w-32{width:calc(var(--volr-spacing)*32)}.volr\\:w-36{width:calc(var(--volr-spacing)*36)}.volr\\:w-40{width:calc(var(--volr-spacing)*40)}.volr\\:w-44{width:calc(var(--volr-spacing)*44)}.volr\\:w-48{width:calc(var(--volr-spacing)*48)}.volr\\:w-\\[200px\\]{width:200px}.volr\\:w-auto{width:auto}.volr\\:w-full{width:100%}.volr\\:max-w-4xl{max-width:var(--volr-container-4xl)}.volr\\:max-w-full{max-width:100%}.volr\\:max-w-md{max-width:var(--volr-container-md)}.volr\\:max-w-none{max-width:none}.volr\\:min-w-0{min-width:calc(var(--volr-spacing)*0)}.volr\\:flex-1{flex:1}.volr\\:flex-shrink-0,.volr\\:shrink-0{flex-shrink:0}.volr\\:-translate-y-1\\/2{--volr-tw-translate-y:calc(calc(1/2*100%)*-1);translate:var(--volr-tw-translate-x)var(--volr-tw-translate-y)}.volr\\:rotate-90{rotate:90deg}.volr\\:rotate-180{rotate:180deg}.volr\\:animate-pulse{animation:var(--volr-animate-pulse)}.volr\\:animate-spin{animation:var(--volr-animate-spin)}.volr\\:cursor-not-allowed{cursor:not-allowed}.volr\\:cursor-pointer{cursor:pointer}.volr\\:list-inside{list-style-position:inside}.volr\\:list-decimal{list-style-type:decimal}.volr\\:grid-cols-\\[minmax\\(0\\,1\\.1fr\\)_minmax\\(0\\,1fr\\)\\]{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr)}.volr\\:flex-col{flex-direction:column}.volr\\:items-baseline{align-items:baseline}.volr\\:items-center{align-items:center}.volr\\:items-end{align-items:flex-end}.volr\\:items-start{align-items:flex-start}.volr\\:justify-between{justify-content:space-between}.volr\\:justify-center{justify-content:center}.volr\\:gap-1{gap:calc(var(--volr-spacing)*1)}.volr\\:gap-2{gap:calc(var(--volr-spacing)*2)}.volr\\:gap-3{gap:calc(var(--volr-spacing)*3)}.volr\\:gap-4{gap:calc(var(--volr-spacing)*4)}:where(.volr\\:space-y-1>:not(:last-child)){--volr-tw-space-y-reverse:0;margin-block-start:calc(calc(var(--volr-spacing)*1)*var(--volr-tw-space-y-reverse));margin-block-end:calc(calc(var(--volr-spacing)*1)*calc(1 - var(--volr-tw-space-y-reverse)))}:where(.volr\\:space-y-2>:not(:last-child)){--volr-tw-space-y-reverse:0;margin-block-start:calc(calc(var(--volr-spacing)*2)*var(--volr-tw-space-y-reverse));margin-block-end:calc(calc(var(--volr-spacing)*2)*calc(1 - var(--volr-tw-space-y-reverse)))}:where(.volr\\:space-y-3>:not(:last-child)){--volr-tw-space-y-reverse:0;margin-block-start:calc(calc(var(--volr-spacing)*3)*var(--volr-tw-space-y-reverse));margin-block-end:calc(calc(var(--volr-spacing)*3)*calc(1 - var(--volr-tw-space-y-reverse)))}:where(.volr\\:space-y-4>:not(:last-child)){--volr-tw-space-y-reverse:0;margin-block-start:calc(calc(var(--volr-spacing)*4)*var(--volr-tw-space-y-reverse));margin-block-end:calc(calc(var(--volr-spacing)*4)*calc(1 - var(--volr-tw-space-y-reverse)))}:where(.volr\\:space-y-6>:not(:last-child)){--volr-tw-space-y-reverse:0;margin-block-start:calc(calc(var(--volr-spacing)*6)*var(--volr-tw-space-y-reverse));margin-block-end:calc(calc(var(--volr-spacing)*6)*calc(1 - var(--volr-tw-space-y-reverse)))}:where(.volr\\:space-y-8>:not(:last-child)){--volr-tw-space-y-reverse:0;margin-block-start:calc(calc(var(--volr-spacing)*8)*var(--volr-tw-space-y-reverse));margin-block-end:calc(calc(var(--volr-spacing)*8)*calc(1 - var(--volr-tw-space-y-reverse)))}.volr\\:truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.volr\\:overflow-auto{overflow:auto}.volr\\:overflow-hidden{overflow:hidden}.volr\\:overflow-visible{overflow:visible}.volr\\:overflow-x-auto{overflow-x:auto}.volr\\:overflow-y-auto{overflow-y:auto}.volr\\:rounded{border-radius:.25rem}.volr\\:rounded-2xl{border-radius:var(--volr-radius-2xl)}.volr\\:rounded-full{border-radius:3.40282e38px}.volr\\:rounded-lg{border-radius:var(--volr-radius-lg)}.volr\\:rounded-md{border-radius:var(--volr-radius-md)}.volr\\:rounded-xl{border-radius:var(--volr-radius-xl)}.volr\\:rounded-t-2xl{border-top-left-radius:var(--volr-radius-2xl);border-top-right-radius:var(--volr-radius-2xl)}.volr\\:rounded-t-3xl{border-top-left-radius:var(--volr-radius-3xl);border-top-right-radius:var(--volr-radius-3xl)}.volr\\:border{border-style:var(--volr-tw-border-style);border-width:1px}.volr\\:border-2{border-style:var(--volr-tw-border-style);border-width:2px}.volr\\:border-4{border-style:var(--volr-tw-border-style);border-width:4px}.volr\\:border-y{border-block-style:var(--volr-tw-border-style);border-block-width:1px}.volr\\:border-t{border-top-style:var(--volr-tw-border-style);border-top-width:1px}.volr\\:border-b{border-bottom-style:var(--volr-tw-border-style);border-bottom-width:1px}.volr\\:border-amber-200{border-color:var(--volr-color-amber-200)}.volr\\:border-red-200{border-color:var(--volr-color-red-200)}.volr\\:border-red-500{border-color:var(--volr-color-red-500)}.volr\\:border-slate-100{border-color:var(--volr-color-slate-100)}.volr\\:border-slate-200{border-color:var(--volr-color-slate-200)}.volr\\:border-slate-300{border-color:var(--volr-color-slate-300)}.volr\\:border-white{border-color:var(--volr-color-white)}.volr\\:border-t-slate-600{border-top-color:var(--volr-color-slate-600)}.volr\\:bg-amber-50{background-color:var(--volr-color-amber-50)}.volr\\:bg-black\\/40{background-color:var(--volr-color-black)}@supports (color:color-mix(in lab, red, red)){.volr\\:bg-black\\/40{background-color:color-mix(in oklab,var(--volr-color-black)40%,transparent)}}.volr\\:bg-black\\/45{background-color:var(--volr-color-black)}@supports (color:color-mix(in lab, red, red)){.volr\\:bg-black\\/45{background-color:color-mix(in oklab,var(--volr-color-black)45%,transparent)}}.volr\\:bg-blue-100{background-color:var(--volr-color-blue-100)}.volr\\:bg-cyan-400{background-color:var(--volr-color-cyan-400)}.volr\\:bg-emerald-300{background-color:var(--volr-color-emerald-300)}.volr\\:bg-emerald-400{background-color:var(--volr-color-emerald-400)}.volr\\:bg-green-50{background-color:var(--volr-color-green-50)}.volr\\:bg-green-100{background-color:var(--volr-color-green-100)}.volr\\:bg-red-50{background-color:var(--volr-color-red-50)}.volr\\:bg-red-100{background-color:var(--volr-color-red-100)}.volr\\:bg-slate-50{background-color:var(--volr-color-slate-50)}.volr\\:bg-slate-100{background-color:var(--volr-color-slate-100)}.volr\\:bg-slate-200{background-color:var(--volr-color-slate-200)}.volr\\:bg-slate-900{background-color:var(--volr-color-slate-900)}.volr\\:bg-teal-400{background-color:var(--volr-color-teal-400)}.volr\\:bg-white{background-color:var(--volr-color-white)}.volr\\:bg-yellow-100{background-color:var(--volr-color-yellow-100)}.volr\\:bg-linear-to-br{--volr-tw-gradient-position:to bottom right}@supports (background-image:linear-gradient(in lab, red, red)){.volr\\:bg-linear-to-br{--volr-tw-gradient-position:to bottom right in oklab}}.volr\\:bg-linear-to-br{background-image:linear-gradient(var(--volr-tw-gradient-stops))}.volr\\:bg-linear-to-r{--volr-tw-gradient-position:to right}@supports (background-image:linear-gradient(in lab, red, red)){.volr\\:bg-linear-to-r{--volr-tw-gradient-position:to right in oklab}}.volr\\:bg-linear-to-r{background-image:linear-gradient(var(--volr-tw-gradient-stops))}.volr\\:bg-gradient-to-br{--volr-tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--volr-tw-gradient-stops))}.volr\\:from-emerald-400{--volr-tw-gradient-from:var(--volr-color-emerald-400);--volr-tw-gradient-stops:var(--volr-tw-gradient-via-stops,var(--volr-tw-gradient-position),var(--volr-tw-gradient-from)var(--volr-tw-gradient-from-position),var(--volr-tw-gradient-to)var(--volr-tw-gradient-to-position))}.volr\\:from-emerald-500{--volr-tw-gradient-from:var(--volr-color-emerald-500);--volr-tw-gradient-stops:var(--volr-tw-gradient-via-stops,var(--volr-tw-gradient-position),var(--volr-tw-gradient-from)var(--volr-tw-gradient-from-position),var(--volr-tw-gradient-to)var(--volr-tw-gradient-to-position))}.volr\\:from-slate-50{--volr-tw-gradient-from:var(--volr-color-slate-50);--volr-tw-gradient-stops:var(--volr-tw-gradient-via-stops,var(--volr-tw-gradient-position),var(--volr-tw-gradient-from)var(--volr-tw-gradient-from-position),var(--volr-tw-gradient-to)var(--volr-tw-gradient-to-position))}.volr\\:to-slate-100{--volr-tw-gradient-to:var(--volr-color-slate-100);--volr-tw-gradient-stops:var(--volr-tw-gradient-via-stops,var(--volr-tw-gradient-position),var(--volr-tw-gradient-from)var(--volr-tw-gradient-from-position),var(--volr-tw-gradient-to)var(--volr-tw-gradient-to-position))}.volr\\:to-teal-500{--volr-tw-gradient-to:var(--volr-color-teal-500);--volr-tw-gradient-stops:var(--volr-tw-gradient-via-stops,var(--volr-tw-gradient-position),var(--volr-tw-gradient-from)var(--volr-tw-gradient-from-position),var(--volr-tw-gradient-to)var(--volr-tw-gradient-to-position))}.volr\\:object-cover{object-fit:cover}.volr\\:p-1{padding:calc(var(--volr-spacing)*1)}.volr\\:p-2{padding:calc(var(--volr-spacing)*2)}.volr\\:p-3{padding:calc(var(--volr-spacing)*3)}.volr\\:p-4{padding:calc(var(--volr-spacing)*4)}.volr\\:p-5{padding:calc(var(--volr-spacing)*5)}.volr\\:p-6{padding:calc(var(--volr-spacing)*6)}.volr\\:p-8{padding:calc(var(--volr-spacing)*8)}.volr\\:px-1\\.5{padding-inline:calc(var(--volr-spacing)*1.5)}.volr\\:px-2{padding-inline:calc(var(--volr-spacing)*2)}.volr\\:px-3{padding-inline:calc(var(--volr-spacing)*3)}.volr\\:px-4{padding-inline:calc(var(--volr-spacing)*4)}.volr\\:py-0\\.5{padding-block:calc(var(--volr-spacing)*.5)}.volr\\:py-1{padding-block:calc(var(--volr-spacing)*1)}.volr\\:py-1\\.5{padding-block:calc(var(--volr-spacing)*1.5)}.volr\\:py-2{padding-block:calc(var(--volr-spacing)*2)}.volr\\:py-2\\.5{padding-block:calc(var(--volr-spacing)*2.5)}.volr\\:py-3{padding-block:calc(var(--volr-spacing)*3)}.volr\\:py-4{padding-block:calc(var(--volr-spacing)*4)}.volr\\:py-6{padding-block:calc(var(--volr-spacing)*6)}.volr\\:py-8{padding-block:calc(var(--volr-spacing)*8)}.volr\\:py-12{padding-block:calc(var(--volr-spacing)*12)}.volr\\:pt-2{padding-top:calc(var(--volr-spacing)*2)}.volr\\:pt-3{padding-top:calc(var(--volr-spacing)*3)}.volr\\:pt-4{padding-top:calc(var(--volr-spacing)*4)}.volr\\:pr-3{padding-right:calc(var(--volr-spacing)*3)}.volr\\:pr-16{padding-right:calc(var(--volr-spacing)*16)}.volr\\:pl-11{padding-left:calc(var(--volr-spacing)*11)}.volr\\:text-center{text-align:center}.volr\\:text-left{text-align:left}.volr\\:text-right{text-align:right}.volr\\:align-baseline{vertical-align:baseline}.volr\\:font-mono{font-family:var(--volr-font-mono)}.volr\\:text-2xl{font-size:var(--volr-text-2xl);line-height:var(--volr-tw-leading,var(--volr-text-2xl--line-height))}.volr\\:text-3xl{font-size:var(--volr-text-3xl);line-height:var(--volr-tw-leading,var(--volr-text-3xl--line-height))}.volr\\:text-8xl{font-size:var(--volr-text-8xl);line-height:var(--volr-tw-leading,var(--volr-text-8xl--line-height))}.volr\\:text-base{font-size:var(--volr-text-base);line-height:var(--volr-tw-leading,var(--volr-text-base--line-height))}.volr\\:text-lg{font-size:var(--volr-text-lg);line-height:var(--volr-tw-leading,var(--volr-text-lg--line-height))}.volr\\:text-sm{font-size:var(--volr-text-sm);line-height:var(--volr-tw-leading,var(--volr-text-sm--line-height))}.volr\\:text-xl{font-size:var(--volr-text-xl);line-height:var(--volr-tw-leading,var(--volr-text-xl--line-height))}.volr\\:text-xs{font-size:var(--volr-text-xs);line-height:var(--volr-tw-leading,var(--volr-text-xs--line-height))}.volr\\:leading-relaxed{--volr-tw-leading:var(--volr-leading-relaxed);line-height:var(--volr-leading-relaxed)}.volr\\:font-bold{--volr-tw-font-weight:var(--volr-font-weight-bold);font-weight:var(--volr-font-weight-bold)}.volr\\:font-medium{--volr-tw-font-weight:var(--volr-font-weight-medium);font-weight:var(--volr-font-weight-medium)}.volr\\:font-semibold{--volr-tw-font-weight:var(--volr-font-weight-semibold);font-weight:var(--volr-font-weight-semibold)}.volr\\:tracking-wide{--volr-tw-tracking:var(--volr-tracking-wide);letter-spacing:var(--volr-tracking-wide)}.volr\\:break-all{word-break:break-all}.volr\\:text-amber-700{color:var(--volr-color-amber-700)}.volr\\:text-blue-700{color:var(--volr-color-blue-700)}.volr\\:text-emerald-600{color:var(--volr-color-emerald-600)}.volr\\:text-gray-500{color:var(--volr-color-gray-500)}.volr\\:text-green-600{color:var(--volr-color-green-600)}.volr\\:text-green-700{color:var(--volr-color-green-700)}.volr\\:text-red-500{color:var(--volr-color-red-500)}.volr\\:text-red-600{color:var(--volr-color-red-600)}.volr\\:text-red-700{color:var(--volr-color-red-700)}.volr\\:text-slate-100{color:var(--volr-color-slate-100)}.volr\\:text-slate-300{color:var(--volr-color-slate-300)}.volr\\:text-slate-400{color:var(--volr-color-slate-400)}.volr\\:text-slate-500{color:var(--volr-color-slate-500)}.volr\\:text-slate-600{color:var(--volr-color-slate-600)}.volr\\:text-slate-700{color:var(--volr-color-slate-700)}.volr\\:text-slate-900{color:var(--volr-color-slate-900)}.volr\\:text-white{color:var(--volr-color-white)}.volr\\:text-yellow-700{color:var(--volr-color-yellow-700)}.volr\\:capitalize{text-transform:capitalize}.volr\\:uppercase{text-transform:uppercase}.volr\\:underline{text-decoration-line:underline}.volr\\:opacity-0{opacity:0}.volr\\:opacity-25{opacity:.25}.volr\\:opacity-30{opacity:.3}.volr\\:opacity-50{opacity:.5}.volr\\:opacity-75{opacity:.75}.volr\\:shadow-2xl{--volr-tw-shadow:0 25px 50px -12px var(--volr-tw-shadow-color,#00000040);box-shadow:var(--volr-tw-inset-shadow),var(--volr-tw-inset-ring-shadow),var(--volr-tw-ring-offset-shadow),var(--volr-tw-ring-shadow),var(--volr-tw-shadow)}.volr\\:shadow-lg{--volr-tw-shadow:0 10px 15px -3px var(--volr-tw-shadow-color,#0000001a),0 4px 6px -4px var(--volr-tw-shadow-color,#0000001a);box-shadow:var(--volr-tw-inset-shadow),var(--volr-tw-inset-ring-shadow),var(--volr-tw-ring-offset-shadow),var(--volr-tw-ring-shadow),var(--volr-tw-shadow)}.volr\\:shadow-md{--volr-tw-shadow:0 4px 6px -1px var(--volr-tw-shadow-color,#0000001a),0 2px 4px -2px var(--volr-tw-shadow-color,#0000001a);box-shadow:var(--volr-tw-inset-shadow),var(--volr-tw-inset-ring-shadow),var(--volr-tw-ring-offset-shadow),var(--volr-tw-ring-shadow),var(--volr-tw-shadow)}.volr\\:shadow-sm{--volr-tw-shadow:0 1px 3px 0 var(--volr-tw-shadow-color,#0000001a),0 1px 2px -1px var(--volr-tw-shadow-color,#0000001a);box-shadow:var(--volr-tw-inset-shadow),var(--volr-tw-inset-ring-shadow),var(--volr-tw-ring-offset-shadow),var(--volr-tw-ring-shadow),var(--volr-tw-shadow)}.volr\\:shadow-xl{--volr-tw-shadow:0 20px 25px -5px var(--volr-tw-shadow-color,#0000001a),0 8px 10px -6px var(--volr-tw-shadow-color,#0000001a);box-shadow:var(--volr-tw-inset-shadow),var(--volr-tw-inset-ring-shadow),var(--volr-tw-ring-offset-shadow),var(--volr-tw-ring-shadow),var(--volr-tw-shadow)}.volr\\:shadow-emerald-500\\/50{--volr-tw-shadow-color:var(--volr-color-emerald-500)}@supports (color:color-mix(in lab, red, red)){.volr\\:shadow-emerald-500\\/50{--volr-tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--volr-color-emerald-500)50%,transparent)var(--volr-tw-shadow-alpha),transparent)}}.volr\\:blur-2xl{--volr-tw-blur:blur(var(--volr-blur-2xl));filter:var(--volr-tw-blur,)var(--volr-tw-brightness,)var(--volr-tw-contrast,)var(--volr-tw-grayscale,)var(--volr-tw-hue-rotate,)var(--volr-tw-invert,)var(--volr-tw-saturate,)var(--volr-tw-sepia,)var(--volr-tw-drop-shadow,)}.volr\\:transition-all{transition-property:all;transition-timing-function:var(--volr-tw-ease,var(--volr-default-transition-timing-function));transition-duration:var(--volr-tw-duration,var(--volr-default-transition-duration))}.volr\\:transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--volr-tw-gradient-from,--volr-tw-gradient-via,--volr-tw-gradient-to;transition-timing-function:var(--volr-tw-ease,var(--volr-default-transition-timing-function));transition-duration:var(--volr-tw-duration,var(--volr-default-transition-duration))}.volr\\:transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--volr-tw-ease,var(--volr-default-transition-timing-function));transition-duration:var(--volr-tw-duration,var(--volr-default-transition-duration))}.volr\\:duration-300{--volr-tw-duration:.3s;transition-duration:.3s}.volr\\:duration-500{--volr-tw-duration:.5s;transition-duration:.5s}.volr\\:ease-out{--volr-tw-ease:var(--volr-ease-out);transition-timing-function:var(--volr-ease-out)}.volr\\:outline-none{--volr-tw-outline-style:none;outline-style:none}@media (hover:hover){.volr\\:hover\\:border-slate-300:hover{border-color:var(--volr-color-slate-300)}.volr\\:hover\\:bg-slate-50:hover{background-color:var(--volr-color-slate-50)}.volr\\:hover\\:bg-slate-200:hover{background-color:var(--volr-color-slate-200)}.volr\\:hover\\:text-slate-700:hover{color:var(--volr-color-slate-700)}}.volr\\:focus\\:ring-2:focus{--volr-tw-ring-shadow:var(--volr-tw-ring-inset,)0 0 0 calc(2px + var(--volr-tw-ring-offset-width))var(--volr-tw-ring-color,currentcolor);box-shadow:var(--volr-tw-inset-shadow),var(--volr-tw-inset-ring-shadow),var(--volr-tw-ring-offset-shadow),var(--volr-tw-ring-shadow),var(--volr-tw-shadow)}.volr\\:focus\\:ring-slate-300:focus{--volr-tw-ring-color:var(--volr-color-slate-300)}.volr\\:focus\\:outline-none:focus{--volr-tw-outline-style:none;outline-style:none}.volr\\:disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.volr\\:disabled\\:bg-slate-100:disabled{background-color:var(--volr-color-slate-100)}.volr\\:disabled\\:text-slate-400:disabled{color:var(--volr-color-slate-400)}.volr\\:disabled\\:opacity-50:disabled{opacity:.5}.volr-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.volr-text-secondary{color:var(--volr-text-secondary)}.volr-text-muted{color:var(--volr-text-muted)}.volr-bg-secondary{background-color:var(--volr-bg-secondary)}.volr-bg-tertiary{background-color:var(--volr-bg-tertiary)}.volr-border{border-color:var(--volr-border)}.volr-border-strong{border-color:var(--volr-border-strong)}.volr-divider-line{background-color:var(--volr-border)}.volr-error{background-color:var(--volr-error-bg);border-color:var(--volr-error-border);color:var(--volr-error-text)}.volr-hover:hover{background-color:var(--volr-hover-bg)}.volr-surface{background-color:var(--volr-bg)}}@property --volr-tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --volr-tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --volr-tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --volr-tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --volr-tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --volr-tw-gradient-position{syntax:"*";inherits:false}@property --volr-tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --volr-tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --volr-tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --volr-tw-gradient-stops{syntax:"*";inherits:false}@property --volr-tw-gradient-via-stops{syntax:"*";inherits:false}@property --volr-tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --volr-tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --volr-tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --volr-tw-leading{syntax:"*";inherits:false}@property --volr-tw-font-weight{syntax:"*";inherits:false}@property --volr-tw-tracking{syntax:"*";inherits:false}@property --volr-tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --volr-tw-shadow-color{syntax:"*";inherits:false}@property --volr-tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --volr-tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --volr-tw-inset-shadow-color{syntax:"*";inherits:false}@property --volr-tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --volr-tw-ring-color{syntax:"*";inherits:false}@property --volr-tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --volr-tw-inset-ring-color{syntax:"*";inherits:false}@property --volr-tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --volr-tw-ring-inset{syntax:"*";inherits:false}@property --volr-tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --volr-tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --volr-tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --volr-tw-blur{syntax:"*";inherits:false}@property --volr-tw-brightness{syntax:"*";inherits:false}@property --volr-tw-contrast{syntax:"*";inherits:false}@property --volr-tw-grayscale{syntax:"*";inherits:false}@property --volr-tw-hue-rotate{syntax:"*";inherits:false}@property --volr-tw-invert{syntax:"*";inherits:false}@property --volr-tw-opacity{syntax:"*";inherits:false}@property --volr-tw-saturate{syntax:"*";inherits:false}@property --volr-tw-sepia{syntax:"*";inherits:false}@property --volr-tw-drop-shadow{syntax:"*";inherits:false}@property --volr-tw-drop-shadow-color{syntax:"*";inherits:false}@property --volr-tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --volr-tw-drop-shadow-size{syntax:"*";inherits:false}@property --volr-tw-duration{syntax:"*";inherits:false}@property --volr-tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}';
1004
+ var VOLR_SDK_CSS = '/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--volr-tw-translate-x:0;--volr-tw-translate-y:0;--volr-tw-translate-z:0;--volr-tw-space-y-reverse:0;--volr-tw-border-style:solid;--volr-tw-gradient-position:initial;--volr-tw-gradient-from:#0000;--volr-tw-gradient-via:#0000;--volr-tw-gradient-to:#0000;--volr-tw-gradient-stops:initial;--volr-tw-gradient-via-stops:initial;--volr-tw-gradient-from-position:0%;--volr-tw-gradient-via-position:50%;--volr-tw-gradient-to-position:100%;--volr-tw-leading:initial;--volr-tw-font-weight:initial;--volr-tw-tracking:initial;--volr-tw-shadow:0 0 #0000;--volr-tw-shadow-color:initial;--volr-tw-shadow-alpha:100%;--volr-tw-inset-shadow:0 0 #0000;--volr-tw-inset-shadow-color:initial;--volr-tw-inset-shadow-alpha:100%;--volr-tw-ring-color:initial;--volr-tw-ring-shadow:0 0 #0000;--volr-tw-inset-ring-color:initial;--volr-tw-inset-ring-shadow:0 0 #0000;--volr-tw-ring-inset:initial;--volr-tw-ring-offset-width:0px;--volr-tw-ring-offset-color:#fff;--volr-tw-ring-offset-shadow:0 0 #0000;--volr-tw-blur:initial;--volr-tw-brightness:initial;--volr-tw-contrast:initial;--volr-tw-grayscale:initial;--volr-tw-hue-rotate:initial;--volr-tw-invert:initial;--volr-tw-opacity:initial;--volr-tw-saturate:initial;--volr-tw-sepia:initial;--volr-tw-drop-shadow:initial;--volr-tw-drop-shadow-color:initial;--volr-tw-drop-shadow-alpha:100%;--volr-tw-drop-shadow-size:initial;--volr-tw-duration:initial;--volr-tw-ease:initial}}}@layer theme{:root,:host{--volr-font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--volr-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--volr-color-red-50:oklch(97.1% .013 17.38);--volr-color-red-100:oklch(93.6% .032 17.717);--volr-color-red-200:oklch(88.5% .062 18.334);--volr-color-red-500:oklch(63.7% .237 25.331);--volr-color-red-600:oklch(57.7% .245 27.325);--volr-color-red-700:oklch(50.5% .213 27.518);--volr-color-amber-50:oklch(98.7% .022 95.277);--volr-color-amber-200:oklch(92.4% .12 95.746);--volr-color-amber-700:oklch(55.5% .163 48.998);--volr-color-yellow-100:oklch(97.3% .071 103.193);--volr-color-yellow-700:oklch(55.4% .135 66.442);--volr-color-green-50:oklch(98.2% .018 155.826);--volr-color-green-100:oklch(96.2% .044 156.743);--volr-color-green-600:oklch(62.7% .194 149.214);--volr-color-green-700:oklch(52.7% .154 150.069);--volr-color-emerald-300:oklch(84.5% .143 164.978);--volr-color-emerald-400:oklch(76.5% .177 163.223);--volr-color-emerald-500:oklch(69.6% .17 162.48);--volr-color-emerald-600:oklch(59.6% .145 163.225);--volr-color-teal-400:oklch(77.7% .152 181.912);--volr-color-teal-500:oklch(70.4% .14 182.503);--volr-color-cyan-400:oklch(78.9% .154 211.53);--volr-color-blue-100:oklch(93.2% .032 255.585);--volr-color-blue-700:oklch(48.8% .243 264.376);--volr-color-slate-50:oklch(98.4% .003 247.858);--volr-color-slate-100:oklch(96.8% .007 247.896);--volr-color-slate-200:oklch(92.9% .013 255.508);--volr-color-slate-300:oklch(86.9% .022 252.894);--volr-color-slate-400:oklch(70.4% .04 256.788);--volr-color-slate-500:oklch(55.4% .046 257.417);--volr-color-slate-600:oklch(44.6% .043 257.281);--volr-color-slate-700:oklch(37.2% .044 257.287);--volr-color-slate-900:oklch(20.8% .042 265.755);--volr-color-gray-500:oklch(55.1% .027 264.364);--volr-color-black:#000;--volr-color-white:#fff;--volr-spacing:.25rem;--volr-container-md:28rem;--volr-container-4xl:56rem;--volr-text-xs:.75rem;--volr-text-xs--line-height:calc(1/.75);--volr-text-sm:.875rem;--volr-text-sm--line-height:calc(1.25/.875);--volr-text-base:1rem;--volr-text-base--line-height:calc(1.5/1);--volr-text-lg:1.125rem;--volr-text-lg--line-height:calc(1.75/1.125);--volr-text-xl:1.25rem;--volr-text-xl--line-height:calc(1.75/1.25);--volr-text-2xl:1.5rem;--volr-text-2xl--line-height:calc(2/1.5);--volr-text-8xl:6rem;--volr-text-8xl--line-height:1;--volr-font-weight-medium:500;--volr-font-weight-semibold:600;--volr-font-weight-bold:700;--volr-tracking-wide:.025em;--volr-leading-relaxed:1.625;--volr-radius-md:.375rem;--volr-radius-lg:.5rem;--volr-radius-xl:.75rem;--volr-radius-2xl:1rem;--volr-radius-3xl:1.5rem;--volr-ease-out:cubic-bezier(0,0,.2,1);--volr-animate-spin:spin 1s linear infinite;--volr-animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--volr-blur-2xl:40px;--volr-default-transition-duration:.15s;--volr-default-transition-timing-function:cubic-bezier(.4,0,.2,1);--volr-default-font-family:var(--volr-font-sans);--volr-default-mono-font-family:var(--volr-font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--volr-default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--volr-default-font-feature-settings,normal);font-variation-settings:var(--volr-default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--volr-default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--volr-default-mono-font-feature-settings,normal);font-variation-settings:var(--volr-default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:host{--volr-primary-color:var(--volr-accent-color,#303030);--volr-font-family:var(--volr-custom-font,inherit);--volr-bg:#fff;--volr-bg-secondary:#f8fafc;--volr-bg-tertiary:#f1f5f9;--volr-text:#0f172a;--volr-text-secondary:#475569;--volr-text-muted:#94a3b8;--volr-border:#e2e8f0;--volr-border-strong:#cbd5e1;--volr-hover-bg:#f8fafc;--volr-error-bg:#fef2f2;--volr-error-border:#fecaca;--volr-error-text:#991b1b}:host([data-theme=dark]){--volr-bg:#1c1c1e;--volr-bg-secondary:#2c2c2e;--volr-bg-tertiary:#3a3a3c;--volr-text:#f5f5f7;--volr-text-secondary:#c7c7cc;--volr-text-muted:#8e8e93;--volr-border:#3a3a3c;--volr-border-strong:#48484a;--volr-hover-bg:#2c2c2e;--volr-error-bg:#3c1f1f;--volr-error-border:#7f1d1d;--volr-error-text:#fca5a5}*,:before,:after{box-sizing:border-box}*{font-family:var(--volr-font-family);color:var(--volr-text)}button,input,select,textarea{color:var(--volr-text);background-color:#0000}button{cursor:pointer;background-color:#0000}input::placeholder{color:var(--volr-text-muted)}h1,h2,h3{color:var(--volr-text);margin:0;font-weight:700}h1{font-size:1.875rem;line-height:2.25rem}h2{font-size:1.5rem;line-height:2rem}h3{font-size:1.25rem;line-height:1.75rem}p{margin:0}}@layer components{.volr-dialog-overlay{inset:calc(var(--volr-spacing)*0);z-index:40;background-color:var(--volr-color-black);position:fixed}@supports (color:color-mix(in lab, red, red)){.volr-dialog-overlay{background-color:color-mix(in oklab,var(--volr-color-black)45%,transparent)}}.volr-dialog-content{z-index:50;border-radius:var(--volr-radius-2xl);border-style:var(--volr-tw-border-style);padding:calc(var(--volr-spacing)*7);--volr-tw-shadow:0 20px 25px -5px var(--volr-tw-shadow-color,#0000001a),0 8px 10px -6px var(--volr-tw-shadow-color,#0000001a);box-shadow:var(--volr-tw-inset-shadow),var(--volr-tw-inset-ring-shadow),var(--volr-tw-ring-offset-shadow),var(--volr-tw-ring-shadow),var(--volr-tw-shadow);background-color:var(--volr-bg);border-width:1px;border-color:var(--volr-border-strong);width:calc(100% - 2rem);max-width:28rem;max-height:85vh;position:fixed;top:50%;left:50%;overflow-y:auto;transform:translate(-50%,-50%)}@media (max-width:640px){.volr-dialog-content{top:auto;right:calc(var(--volr-spacing)*0);bottom:calc(var(--volr-spacing)*0);left:calc(var(--volr-spacing)*0);border-radius:1.25rem 1.25rem 0 0;width:100%;max-width:100%;margin:0 auto;transform:translateY(0)}}.volr-dialog-close{top:calc(var(--volr-spacing)*4);right:calc(var(--volr-spacing)*4);height:calc(var(--volr-spacing)*8);width:calc(var(--volr-spacing)*8);color:var(--volr-text-muted);cursor:pointer;background-color:#0000;border:none;border-radius:3.40282e38px;justify-content:center;align-items:center;display:inline-flex;position:absolute}.volr-dialog-close:hover{background-color:var(--volr-hover-bg);color:var(--volr-text-secondary)}.volr-dialog-close:focus-visible{box-shadow:0 0 0 2px var(--volr-border-strong);outline:none}.volr-dialog-close-icon{height:calc(var(--volr-spacing)*4);width:calc(var(--volr-spacing)*4)}.volr-email-input{border:1px solid var(--volr-border-strong);background-color:var(--volr-bg);width:100%;color:var(--volr-text);border-radius:.5rem;outline:none;padding:.75rem .75rem .75rem 2.75rem;font-size:1rem;line-height:1.5}.volr-email-input::placeholder{color:var(--volr-text-muted)}.volr-email-input:focus{border-color:var(--volr-border-strong);box-shadow:0 0 0 2px var(--volr-border-strong)}.volr-option-button{border:1px solid var(--volr-border);background-color:var(--volr-bg);width:100%;color:var(--volr-text);cursor:pointer;border-radius:.5rem;align-items:center;gap:.75rem;padding:.75rem;transition:background-color .15s ease-out,border-color .15s ease-out,box-shadow .15s ease-out;display:flex}.volr-option-button:hover{background-color:var(--volr-hover-bg);border-color:var(--volr-border)}.volr-option-button:focus-visible{box-shadow:0 0 0 2px var(--volr-border-strong);outline:none}}@layer utilities{.volr\\:pointer-events-auto{pointer-events:auto}.volr\\:pointer-events-none{pointer-events:none}.volr\\:sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.volr\\:absolute{position:absolute}.volr\\:fixed{position:fixed}.volr\\:relative{position:relative}.volr\\:inset-0{inset:calc(var(--volr-spacing)*0)}.volr\\:-top-3{top:calc(var(--volr-spacing)*-3)}.volr\\:top-1\\/2{top:50%}.volr\\:-right-3{right:calc(var(--volr-spacing)*-3)}.volr\\:right-0{right:calc(var(--volr-spacing)*0)}.volr\\:right-2{right:calc(var(--volr-spacing)*2)}.volr\\:right-3{right:calc(var(--volr-spacing)*3)}.volr\\:bottom-0{bottom:calc(var(--volr-spacing)*0)}.volr\\:left-0{left:calc(var(--volr-spacing)*0)}.volr\\:left-3{left:calc(var(--volr-spacing)*3)}.volr\\:-z-10{z-index:calc(10*-1)}.volr\\:z-10{z-index:10}.volr\\:z-20{z-index:20}.volr\\:z-40{z-index:40}.volr\\:z-50{z-index:50}.volr\\:mx-auto{margin-inline:auto}.volr\\:my-6{margin-block:calc(var(--volr-spacing)*6)}.volr\\:mt-0\\.5{margin-top:calc(var(--volr-spacing)*.5)}.volr\\:mt-1{margin-top:calc(var(--volr-spacing)*1)}.volr\\:mt-2{margin-top:calc(var(--volr-spacing)*2)}.volr\\:mt-3{margin-top:calc(var(--volr-spacing)*3)}.volr\\:mt-4{margin-top:calc(var(--volr-spacing)*4)}.volr\\:mt-6{margin-top:calc(var(--volr-spacing)*6)}.volr\\:mt-8{margin-top:calc(var(--volr-spacing)*8)}.volr\\:mb-0\\.5{margin-bottom:calc(var(--volr-spacing)*.5)}.volr\\:mb-1{margin-bottom:calc(var(--volr-spacing)*1)}.volr\\:mb-2{margin-bottom:calc(var(--volr-spacing)*2)}.volr\\:mb-3{margin-bottom:calc(var(--volr-spacing)*3)}.volr\\:mb-4{margin-bottom:calc(var(--volr-spacing)*4)}.volr\\:mb-5{margin-bottom:calc(var(--volr-spacing)*5)}.volr\\:mb-6{margin-bottom:calc(var(--volr-spacing)*6)}.volr\\:mb-8{margin-bottom:calc(var(--volr-spacing)*8)}.volr\\:-ml-2{margin-left:calc(var(--volr-spacing)*-2)}.volr\\:line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.volr\\:block{display:block}.volr\\:flex{display:flex}.volr\\:grid{display:grid}.volr\\:inline-block{display:inline-block}.volr\\:inline-flex{display:inline-flex}.volr\\:h-1{height:calc(var(--volr-spacing)*1)}.volr\\:h-1\\.5{height:calc(var(--volr-spacing)*1.5)}.volr\\:h-2{height:calc(var(--volr-spacing)*2)}.volr\\:h-3{height:calc(var(--volr-spacing)*3)}.volr\\:h-4{height:calc(var(--volr-spacing)*4)}.volr\\:h-5{height:calc(var(--volr-spacing)*5)}.volr\\:h-6{height:calc(var(--volr-spacing)*6)}.volr\\:h-7{height:calc(var(--volr-spacing)*7)}.volr\\:h-8{height:calc(var(--volr-spacing)*8)}.volr\\:h-10{height:calc(var(--volr-spacing)*10)}.volr\\:h-12{height:calc(var(--volr-spacing)*12)}.volr\\:h-14{height:calc(var(--volr-spacing)*14)}.volr\\:h-16{height:calc(var(--volr-spacing)*16)}.volr\\:h-20{height:calc(var(--volr-spacing)*20)}.volr\\:h-24{height:calc(var(--volr-spacing)*24)}.volr\\:h-40{height:calc(var(--volr-spacing)*40)}.volr\\:h-44{height:calc(var(--volr-spacing)*44)}.volr\\:h-48{height:calc(var(--volr-spacing)*48)}.volr\\:h-\\[0\\.8em\\]{height:.8em}.volr\\:h-\\[200px\\]{height:200px}.volr\\:h-full{height:100%}.volr\\:h-px{height:1px}.volr\\:max-h-48{max-height:calc(var(--volr-spacing)*48)}.volr\\:max-h-60{max-height:calc(var(--volr-spacing)*60)}.volr\\:max-h-64{max-height:calc(var(--volr-spacing)*64)}.volr\\:max-h-\\[85vh\\]{max-height:85vh}.volr\\:max-h-\\[90vh\\]{max-height:90vh}.volr\\:min-h-\\[120px\\]{min-height:120px}.volr\\:min-h-\\[500px\\]{min-height:500px}.volr\\:w-1\\.5{width:calc(var(--volr-spacing)*1.5)}.volr\\:w-2{width:calc(var(--volr-spacing)*2)}.volr\\:w-3{width:calc(var(--volr-spacing)*3)}.volr\\:w-4{width:calc(var(--volr-spacing)*4)}.volr\\:w-5{width:calc(var(--volr-spacing)*5)}.volr\\:w-6{width:calc(var(--volr-spacing)*6)}.volr\\:w-7{width:calc(var(--volr-spacing)*7)}.volr\\:w-8{width:calc(var(--volr-spacing)*8)}.volr\\:w-10{width:calc(var(--volr-spacing)*10)}.volr\\:w-12{width:calc(var(--volr-spacing)*12)}.volr\\:w-14{width:calc(var(--volr-spacing)*14)}.volr\\:w-16{width:calc(var(--volr-spacing)*16)}.volr\\:w-20{width:calc(var(--volr-spacing)*20)}.volr\\:w-24{width:calc(var(--volr-spacing)*24)}.volr\\:w-32{width:calc(var(--volr-spacing)*32)}.volr\\:w-36{width:calc(var(--volr-spacing)*36)}.volr\\:w-40{width:calc(var(--volr-spacing)*40)}.volr\\:w-44{width:calc(var(--volr-spacing)*44)}.volr\\:w-48{width:calc(var(--volr-spacing)*48)}.volr\\:w-\\[200px\\]{width:200px}.volr\\:w-auto{width:auto}.volr\\:w-full{width:100%}.volr\\:max-w-4xl{max-width:var(--volr-container-4xl)}.volr\\:max-w-full{max-width:100%}.volr\\:max-w-md{max-width:var(--volr-container-md)}.volr\\:max-w-none{max-width:none}.volr\\:min-w-0{min-width:calc(var(--volr-spacing)*0)}.volr\\:flex-1{flex:1}.volr\\:flex-shrink-0,.volr\\:shrink-0{flex-shrink:0}.volr\\:-translate-y-1\\/2{--volr-tw-translate-y:calc(calc(1/2*100%)*-1);translate:var(--volr-tw-translate-x)var(--volr-tw-translate-y)}.volr\\:rotate-90{rotate:90deg}.volr\\:rotate-180{rotate:180deg}.volr\\:animate-pulse{animation:var(--volr-animate-pulse)}.volr\\:animate-spin{animation:var(--volr-animate-spin)}.volr\\:cursor-not-allowed{cursor:not-allowed}.volr\\:cursor-pointer{cursor:pointer}.volr\\:list-inside{list-style-position:inside}.volr\\:list-decimal{list-style-type:decimal}.volr\\:grid-cols-\\[minmax\\(0\\,1\\.1fr\\)_minmax\\(0\\,1fr\\)\\]{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr)}.volr\\:flex-col{flex-direction:column}.volr\\:items-baseline{align-items:baseline}.volr\\:items-center{align-items:center}.volr\\:items-end{align-items:flex-end}.volr\\:items-start{align-items:flex-start}.volr\\:justify-between{justify-content:space-between}.volr\\:justify-center{justify-content:center}.volr\\:gap-1{gap:calc(var(--volr-spacing)*1)}.volr\\:gap-2{gap:calc(var(--volr-spacing)*2)}.volr\\:gap-3{gap:calc(var(--volr-spacing)*3)}.volr\\:gap-4{gap:calc(var(--volr-spacing)*4)}:where(.volr\\:space-y-1>:not(:last-child)){--volr-tw-space-y-reverse:0;margin-block-start:calc(calc(var(--volr-spacing)*1)*var(--volr-tw-space-y-reverse));margin-block-end:calc(calc(var(--volr-spacing)*1)*calc(1 - var(--volr-tw-space-y-reverse)))}:where(.volr\\:space-y-2>:not(:last-child)){--volr-tw-space-y-reverse:0;margin-block-start:calc(calc(var(--volr-spacing)*2)*var(--volr-tw-space-y-reverse));margin-block-end:calc(calc(var(--volr-spacing)*2)*calc(1 - var(--volr-tw-space-y-reverse)))}:where(.volr\\:space-y-3>:not(:last-child)){--volr-tw-space-y-reverse:0;margin-block-start:calc(calc(var(--volr-spacing)*3)*var(--volr-tw-space-y-reverse));margin-block-end:calc(calc(var(--volr-spacing)*3)*calc(1 - var(--volr-tw-space-y-reverse)))}:where(.volr\\:space-y-4>:not(:last-child)){--volr-tw-space-y-reverse:0;margin-block-start:calc(calc(var(--volr-spacing)*4)*var(--volr-tw-space-y-reverse));margin-block-end:calc(calc(var(--volr-spacing)*4)*calc(1 - var(--volr-tw-space-y-reverse)))}:where(.volr\\:space-y-6>:not(:last-child)){--volr-tw-space-y-reverse:0;margin-block-start:calc(calc(var(--volr-spacing)*6)*var(--volr-tw-space-y-reverse));margin-block-end:calc(calc(var(--volr-spacing)*6)*calc(1 - var(--volr-tw-space-y-reverse)))}.volr\\:truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.volr\\:overflow-auto{overflow:auto}.volr\\:overflow-hidden{overflow:hidden}.volr\\:overflow-visible{overflow:visible}.volr\\:overflow-x-auto{overflow-x:auto}.volr\\:overflow-y-auto{overflow-y:auto}.volr\\:rounded{border-radius:.25rem}.volr\\:rounded-2xl{border-radius:var(--volr-radius-2xl)}.volr\\:rounded-full{border-radius:3.40282e38px}.volr\\:rounded-lg{border-radius:var(--volr-radius-lg)}.volr\\:rounded-md{border-radius:var(--volr-radius-md)}.volr\\:rounded-xl{border-radius:var(--volr-radius-xl)}.volr\\:rounded-t-2xl{border-top-left-radius:var(--volr-radius-2xl);border-top-right-radius:var(--volr-radius-2xl)}.volr\\:rounded-t-3xl{border-top-left-radius:var(--volr-radius-3xl);border-top-right-radius:var(--volr-radius-3xl)}.volr\\:rounded-t-xl{border-top-left-radius:var(--volr-radius-xl);border-top-right-radius:var(--volr-radius-xl)}.volr\\:rounded-b-xl{border-bottom-right-radius:var(--volr-radius-xl);border-bottom-left-radius:var(--volr-radius-xl)}.volr\\:border{border-style:var(--volr-tw-border-style);border-width:1px}.volr\\:border-2{border-style:var(--volr-tw-border-style);border-width:2px}.volr\\:border-4{border-style:var(--volr-tw-border-style);border-width:4px}.volr\\:border-x{border-inline-style:var(--volr-tw-border-style);border-inline-width:1px}.volr\\:border-y{border-block-style:var(--volr-tw-border-style);border-block-width:1px}.volr\\:border-t{border-top-style:var(--volr-tw-border-style);border-top-width:1px}.volr\\:border-b{border-bottom-style:var(--volr-tw-border-style);border-bottom-width:1px}.volr\\:border-amber-200{border-color:var(--volr-color-amber-200)}.volr\\:border-red-200{border-color:var(--volr-color-red-200)}.volr\\:border-red-500{border-color:var(--volr-color-red-500)}.volr\\:border-slate-100{border-color:var(--volr-color-slate-100)}.volr\\:border-slate-200{border-color:var(--volr-color-slate-200)}.volr\\:border-slate-300{border-color:var(--volr-color-slate-300)}.volr\\:border-white{border-color:var(--volr-color-white)}.volr\\:border-t-slate-600{border-top-color:var(--volr-color-slate-600)}.volr\\:bg-amber-50{background-color:var(--volr-color-amber-50)}.volr\\:bg-black\\/45{background-color:var(--volr-color-black)}@supports (color:color-mix(in lab, red, red)){.volr\\:bg-black\\/45{background-color:color-mix(in oklab,var(--volr-color-black)45%,transparent)}}.volr\\:bg-blue-100{background-color:var(--volr-color-blue-100)}.volr\\:bg-cyan-400{background-color:var(--volr-color-cyan-400)}.volr\\:bg-emerald-300{background-color:var(--volr-color-emerald-300)}.volr\\:bg-emerald-400{background-color:var(--volr-color-emerald-400)}.volr\\:bg-emerald-500{background-color:var(--volr-color-emerald-500)}.volr\\:bg-green-50{background-color:var(--volr-color-green-50)}.volr\\:bg-green-100{background-color:var(--volr-color-green-100)}.volr\\:bg-red-50{background-color:var(--volr-color-red-50)}.volr\\:bg-red-100{background-color:var(--volr-color-red-100)}.volr\\:bg-slate-50{background-color:var(--volr-color-slate-50)}.volr\\:bg-slate-100{background-color:var(--volr-color-slate-100)}.volr\\:bg-slate-200{background-color:var(--volr-color-slate-200)}.volr\\:bg-slate-900{background-color:var(--volr-color-slate-900)}.volr\\:bg-teal-400{background-color:var(--volr-color-teal-400)}.volr\\:bg-white{background-color:var(--volr-color-white)}.volr\\:bg-yellow-100{background-color:var(--volr-color-yellow-100)}.volr\\:bg-linear-to-br{--volr-tw-gradient-position:to bottom right}@supports (background-image:linear-gradient(in lab, red, red)){.volr\\:bg-linear-to-br{--volr-tw-gradient-position:to bottom right in oklab}}.volr\\:bg-linear-to-br{background-image:linear-gradient(var(--volr-tw-gradient-stops))}.volr\\:bg-linear-to-r{--volr-tw-gradient-position:to right}@supports (background-image:linear-gradient(in lab, red, red)){.volr\\:bg-linear-to-r{--volr-tw-gradient-position:to right in oklab}}.volr\\:bg-linear-to-r{background-image:linear-gradient(var(--volr-tw-gradient-stops))}.volr\\:bg-gradient-to-br{--volr-tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--volr-tw-gradient-stops))}.volr\\:from-emerald-400{--volr-tw-gradient-from:var(--volr-color-emerald-400);--volr-tw-gradient-stops:var(--volr-tw-gradient-via-stops,var(--volr-tw-gradient-position),var(--volr-tw-gradient-from)var(--volr-tw-gradient-from-position),var(--volr-tw-gradient-to)var(--volr-tw-gradient-to-position))}.volr\\:from-slate-50{--volr-tw-gradient-from:var(--volr-color-slate-50);--volr-tw-gradient-stops:var(--volr-tw-gradient-via-stops,var(--volr-tw-gradient-position),var(--volr-tw-gradient-from)var(--volr-tw-gradient-from-position),var(--volr-tw-gradient-to)var(--volr-tw-gradient-to-position))}.volr\\:to-slate-100{--volr-tw-gradient-to:var(--volr-color-slate-100);--volr-tw-gradient-stops:var(--volr-tw-gradient-via-stops,var(--volr-tw-gradient-position),var(--volr-tw-gradient-from)var(--volr-tw-gradient-from-position),var(--volr-tw-gradient-to)var(--volr-tw-gradient-to-position))}.volr\\:to-teal-500{--volr-tw-gradient-to:var(--volr-color-teal-500);--volr-tw-gradient-stops:var(--volr-tw-gradient-via-stops,var(--volr-tw-gradient-position),var(--volr-tw-gradient-from)var(--volr-tw-gradient-from-position),var(--volr-tw-gradient-to)var(--volr-tw-gradient-to-position))}.volr\\:object-cover{object-fit:cover}.volr\\:p-1{padding:calc(var(--volr-spacing)*1)}.volr\\:p-2{padding:calc(var(--volr-spacing)*2)}.volr\\:p-3{padding:calc(var(--volr-spacing)*3)}.volr\\:p-4{padding:calc(var(--volr-spacing)*4)}.volr\\:p-5{padding:calc(var(--volr-spacing)*5)}.volr\\:p-8{padding:calc(var(--volr-spacing)*8)}.volr\\:px-1\\.5{padding-inline:calc(var(--volr-spacing)*1.5)}.volr\\:px-2{padding-inline:calc(var(--volr-spacing)*2)}.volr\\:px-3{padding-inline:calc(var(--volr-spacing)*3)}.volr\\:px-4{padding-inline:calc(var(--volr-spacing)*4)}.volr\\:py-0\\.5{padding-block:calc(var(--volr-spacing)*.5)}.volr\\:py-1{padding-block:calc(var(--volr-spacing)*1)}.volr\\:py-1\\.5{padding-block:calc(var(--volr-spacing)*1.5)}.volr\\:py-2{padding-block:calc(var(--volr-spacing)*2)}.volr\\:py-2\\.5{padding-block:calc(var(--volr-spacing)*2.5)}.volr\\:py-3{padding-block:calc(var(--volr-spacing)*3)}.volr\\:py-4{padding-block:calc(var(--volr-spacing)*4)}.volr\\:py-6{padding-block:calc(var(--volr-spacing)*6)}.volr\\:py-8{padding-block:calc(var(--volr-spacing)*8)}.volr\\:py-12{padding-block:calc(var(--volr-spacing)*12)}.volr\\:pt-2{padding-top:calc(var(--volr-spacing)*2)}.volr\\:pt-3{padding-top:calc(var(--volr-spacing)*3)}.volr\\:pt-4{padding-top:calc(var(--volr-spacing)*4)}.volr\\:pr-3{padding-right:calc(var(--volr-spacing)*3)}.volr\\:pr-16{padding-right:calc(var(--volr-spacing)*16)}.volr\\:pl-11{padding-left:calc(var(--volr-spacing)*11)}.volr\\:text-center{text-align:center}.volr\\:text-left{text-align:left}.volr\\:text-right{text-align:right}.volr\\:align-baseline{vertical-align:baseline}.volr\\:font-mono{font-family:var(--volr-font-mono)}.volr\\:text-2xl{font-size:var(--volr-text-2xl);line-height:var(--volr-tw-leading,var(--volr-text-2xl--line-height))}.volr\\:text-8xl{font-size:var(--volr-text-8xl);line-height:var(--volr-tw-leading,var(--volr-text-8xl--line-height))}.volr\\:text-base{font-size:var(--volr-text-base);line-height:var(--volr-tw-leading,var(--volr-text-base--line-height))}.volr\\:text-lg{font-size:var(--volr-text-lg);line-height:var(--volr-tw-leading,var(--volr-text-lg--line-height))}.volr\\:text-sm{font-size:var(--volr-text-sm);line-height:var(--volr-tw-leading,var(--volr-text-sm--line-height))}.volr\\:text-xl{font-size:var(--volr-text-xl);line-height:var(--volr-tw-leading,var(--volr-text-xl--line-height))}.volr\\:text-xs{font-size:var(--volr-text-xs);line-height:var(--volr-tw-leading,var(--volr-text-xs--line-height))}.volr\\:leading-relaxed{--volr-tw-leading:var(--volr-leading-relaxed);line-height:var(--volr-leading-relaxed)}.volr\\:font-bold{--volr-tw-font-weight:var(--volr-font-weight-bold);font-weight:var(--volr-font-weight-bold)}.volr\\:font-medium{--volr-tw-font-weight:var(--volr-font-weight-medium);font-weight:var(--volr-font-weight-medium)}.volr\\:font-semibold{--volr-tw-font-weight:var(--volr-font-weight-semibold);font-weight:var(--volr-font-weight-semibold)}.volr\\:tracking-wide{--volr-tw-tracking:var(--volr-tracking-wide);letter-spacing:var(--volr-tracking-wide)}.volr\\:break-all{word-break:break-all}.volr\\:text-amber-700{color:var(--volr-color-amber-700)}.volr\\:text-blue-700{color:var(--volr-color-blue-700)}.volr\\:text-emerald-600{color:var(--volr-color-emerald-600)}.volr\\:text-gray-500{color:var(--volr-color-gray-500)}.volr\\:text-green-600{color:var(--volr-color-green-600)}.volr\\:text-green-700{color:var(--volr-color-green-700)}.volr\\:text-red-500{color:var(--volr-color-red-500)}.volr\\:text-red-600{color:var(--volr-color-red-600)}.volr\\:text-red-700{color:var(--volr-color-red-700)}.volr\\:text-slate-300{color:var(--volr-color-slate-300)}.volr\\:text-slate-400{color:var(--volr-color-slate-400)}.volr\\:text-slate-500{color:var(--volr-color-slate-500)}.volr\\:text-slate-600{color:var(--volr-color-slate-600)}.volr\\:text-slate-700{color:var(--volr-color-slate-700)}.volr\\:text-slate-900{color:var(--volr-color-slate-900)}.volr\\:text-white{color:var(--volr-color-white)}.volr\\:text-yellow-700{color:var(--volr-color-yellow-700)}.volr\\:capitalize{text-transform:capitalize}.volr\\:uppercase{text-transform:uppercase}.volr\\:underline{text-decoration-line:underline}.volr\\:opacity-0{opacity:0}.volr\\:opacity-25{opacity:.25}.volr\\:opacity-30{opacity:.3}.volr\\:opacity-50{opacity:.5}.volr\\:opacity-75{opacity:.75}.volr\\:shadow-2xl{--volr-tw-shadow:0 25px 50px -12px var(--volr-tw-shadow-color,#00000040);box-shadow:var(--volr-tw-inset-shadow),var(--volr-tw-inset-ring-shadow),var(--volr-tw-ring-offset-shadow),var(--volr-tw-ring-shadow),var(--volr-tw-shadow)}.volr\\:shadow-lg{--volr-tw-shadow:0 10px 15px -3px var(--volr-tw-shadow-color,#0000001a),0 4px 6px -4px var(--volr-tw-shadow-color,#0000001a);box-shadow:var(--volr-tw-inset-shadow),var(--volr-tw-inset-ring-shadow),var(--volr-tw-ring-offset-shadow),var(--volr-tw-ring-shadow),var(--volr-tw-shadow)}.volr\\:shadow-sm{--volr-tw-shadow:0 1px 3px 0 var(--volr-tw-shadow-color,#0000001a),0 1px 2px -1px var(--volr-tw-shadow-color,#0000001a);box-shadow:var(--volr-tw-inset-shadow),var(--volr-tw-inset-ring-shadow),var(--volr-tw-ring-offset-shadow),var(--volr-tw-ring-shadow),var(--volr-tw-shadow)}.volr\\:shadow-xl{--volr-tw-shadow:0 20px 25px -5px var(--volr-tw-shadow-color,#0000001a),0 8px 10px -6px var(--volr-tw-shadow-color,#0000001a);box-shadow:var(--volr-tw-inset-shadow),var(--volr-tw-inset-ring-shadow),var(--volr-tw-ring-offset-shadow),var(--volr-tw-ring-shadow),var(--volr-tw-shadow)}.volr\\:shadow-emerald-500\\/50{--volr-tw-shadow-color:var(--volr-color-emerald-500)}@supports (color:color-mix(in lab, red, red)){.volr\\:shadow-emerald-500\\/50{--volr-tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--volr-color-emerald-500)50%,transparent)var(--volr-tw-shadow-alpha),transparent)}}.volr\\:blur-2xl{--volr-tw-blur:blur(var(--volr-blur-2xl));filter:var(--volr-tw-blur,)var(--volr-tw-brightness,)var(--volr-tw-contrast,)var(--volr-tw-grayscale,)var(--volr-tw-hue-rotate,)var(--volr-tw-invert,)var(--volr-tw-saturate,)var(--volr-tw-sepia,)var(--volr-tw-drop-shadow,)}.volr\\:transition-all{transition-property:all;transition-timing-function:var(--volr-tw-ease,var(--volr-default-transition-timing-function));transition-duration:var(--volr-tw-duration,var(--volr-default-transition-duration))}.volr\\:transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--volr-tw-gradient-from,--volr-tw-gradient-via,--volr-tw-gradient-to;transition-timing-function:var(--volr-tw-ease,var(--volr-default-transition-timing-function));transition-duration:var(--volr-tw-duration,var(--volr-default-transition-duration))}.volr\\:transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--volr-tw-ease,var(--volr-default-transition-timing-function));transition-duration:var(--volr-tw-duration,var(--volr-default-transition-duration))}.volr\\:duration-300{--volr-tw-duration:.3s;transition-duration:.3s}.volr\\:duration-500{--volr-tw-duration:.5s;transition-duration:.5s}.volr\\:ease-out{--volr-tw-ease:var(--volr-ease-out);transition-timing-function:var(--volr-ease-out)}.volr\\:outline-none{--volr-tw-outline-style:none;outline-style:none}@media (hover:hover){.volr\\:hover\\:border-slate-300:hover{border-color:var(--volr-color-slate-300)}.volr\\:hover\\:bg-slate-50:hover{background-color:var(--volr-color-slate-50)}.volr\\:hover\\:bg-slate-200:hover{background-color:var(--volr-color-slate-200)}.volr\\:hover\\:text-slate-700:hover{color:var(--volr-color-slate-700)}}.volr\\:focus\\:ring-2:focus{--volr-tw-ring-shadow:var(--volr-tw-ring-inset,)0 0 0 calc(2px + var(--volr-tw-ring-offset-width))var(--volr-tw-ring-color,currentcolor);box-shadow:var(--volr-tw-inset-shadow),var(--volr-tw-inset-ring-shadow),var(--volr-tw-ring-offset-shadow),var(--volr-tw-ring-shadow),var(--volr-tw-shadow)}.volr\\:focus\\:ring-slate-300:focus{--volr-tw-ring-color:var(--volr-color-slate-300)}.volr\\:focus\\:outline-none:focus{--volr-tw-outline-style:none;outline-style:none}.volr\\:disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.volr\\:disabled\\:bg-slate-100:disabled{background-color:var(--volr-color-slate-100)}.volr\\:disabled\\:text-slate-400:disabled{color:var(--volr-color-slate-400)}.volr\\:disabled\\:opacity-50:disabled{opacity:.5}.volr-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.volr-text-secondary{color:var(--volr-text-secondary)}.volr-text-muted{color:var(--volr-text-muted)}.volr-bg-secondary{background-color:var(--volr-bg-secondary)}.volr-bg-tertiary{background-color:var(--volr-bg-tertiary)}.volr-border{border-color:var(--volr-border)}.volr-border-strong{border-color:var(--volr-border-strong)}.volr-divider-line{background-color:var(--volr-border)}.volr-error{background-color:var(--volr-error-bg);border-color:var(--volr-error-border);color:var(--volr-error-text)}.volr-hover:hover{background-color:var(--volr-hover-bg)}.volr-surface{background-color:var(--volr-bg)}}@property --volr-tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --volr-tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --volr-tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --volr-tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --volr-tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --volr-tw-gradient-position{syntax:"*";inherits:false}@property --volr-tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --volr-tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --volr-tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --volr-tw-gradient-stops{syntax:"*";inherits:false}@property --volr-tw-gradient-via-stops{syntax:"*";inherits:false}@property --volr-tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --volr-tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --volr-tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --volr-tw-leading{syntax:"*";inherits:false}@property --volr-tw-font-weight{syntax:"*";inherits:false}@property --volr-tw-tracking{syntax:"*";inherits:false}@property --volr-tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --volr-tw-shadow-color{syntax:"*";inherits:false}@property --volr-tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --volr-tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --volr-tw-inset-shadow-color{syntax:"*";inherits:false}@property --volr-tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --volr-tw-ring-color{syntax:"*";inherits:false}@property --volr-tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --volr-tw-inset-ring-color{syntax:"*";inherits:false}@property --volr-tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --volr-tw-ring-inset{syntax:"*";inherits:false}@property --volr-tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --volr-tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --volr-tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --volr-tw-blur{syntax:"*";inherits:false}@property --volr-tw-brightness{syntax:"*";inherits:false}@property --volr-tw-contrast{syntax:"*";inherits:false}@property --volr-tw-grayscale{syntax:"*";inherits:false}@property --volr-tw-hue-rotate{syntax:"*";inherits:false}@property --volr-tw-invert{syntax:"*";inherits:false}@property --volr-tw-opacity{syntax:"*";inherits:false}@property --volr-tw-saturate{syntax:"*";inherits:false}@property --volr-tw-sepia{syntax:"*";inherits:false}@property --volr-tw-drop-shadow{syntax:"*";inherits:false}@property --volr-tw-drop-shadow-color{syntax:"*";inherits:false}@property --volr-tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --volr-tw-drop-shadow-size{syntax:"*";inherits:false}@property --volr-tw-duration{syntax:"*";inherits:false}@property --volr-tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}';
985
1005
  function useResolvedTheme(theme = "light") {
986
1006
  const [resolvedTheme, setResolvedTheme] = useState(() => {
987
1007
  if (theme !== "system") return theme;
@@ -2887,1031 +2907,879 @@ function SigninModal({ isOpen, onClose, onError }) {
2887
2907
  }
2888
2908
  );
2889
2909
  }
2890
- function ChevronRightIcon({ className }) {
2891
- return /* @__PURE__ */ jsx(
2892
- "svg",
2893
- {
2894
- xmlns: "http://www.w3.org/2000/svg",
2895
- viewBox: "0 0 20 20",
2896
- fill: "currentColor",
2897
- className,
2898
- children: /* @__PURE__ */ jsx(
2899
- "path",
2910
+ function AssetSelectView({
2911
+ assets,
2912
+ onSelect
2913
+ }) {
2914
+ const { t } = useI18n();
2915
+ return /* @__PURE__ */ jsxs("div", { children: [
2916
+ /* @__PURE__ */ jsx("p", { className: "volr:text-xl volr:font-semibold volr:mb-1", children: t("deposit.selectTitle") }),
2917
+ /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:mb-4 volr-text-secondary", children: "Supported token" }),
2918
+ /* @__PURE__ */ jsx("div", { className: "volr:space-y-3", children: assets.map((a, idx) => {
2919
+ const isNative = a.token === "native";
2920
+ const tokenSymbol = isNative ? "ETH" : a.token.symbol;
2921
+ const tokenName = isNative ? "Ethereum" : a.token.symbol;
2922
+ return /* @__PURE__ */ jsxs(
2923
+ "button",
2900
2924
  {
2901
- fillRule: "evenodd",
2902
- d: "M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z",
2903
- clipRule: "evenodd"
2904
- }
2905
- )
2906
- }
2907
- );
2908
- }
2909
- function WalletIcon2({ className }) {
2910
- return /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 12a2.25 2.25 0 00-2.25-2.25H15a3 3 0 11-6 0H5.25A2.25 2.25 0 003 12m18 0v6a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 18v-6m18 0V9M3 12V9m18 0a2.25 2.25 0 00-2.25-2.25H5.25A2.25 2.25 0 003 9m18 0V6a2.25 2.25 0 00-2.25-2.25H5.25A2.25 2.25 0 003 6v3" }) });
2911
- }
2912
- function ArrowUpIcon({ className }) {
2913
- return /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 10.5L12 3m0 0l7.5 7.5M12 3v18" }) });
2914
- }
2915
- function ClockIcon({ className }) {
2916
- return /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z" }) });
2917
- }
2918
- function UserIcon({ className }) {
2919
- return /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z" }) });
2925
+ className: cn(
2926
+ "volr:w-full volr:p-4 volr:rounded-xl volr:border-2",
2927
+ "volr:text-left volr:transition-all",
2928
+ "volr:flex volr:items-center volr:gap-4",
2929
+ "volr-border volr-hover"
2930
+ ),
2931
+ onClick: () => onSelect(idx),
2932
+ children: [
2933
+ /* @__PURE__ */ jsx("div", { className: "volr:shrink-0", children: !isNative && a.token.iconUrl ? /* @__PURE__ */ jsx(
2934
+ "img",
2935
+ {
2936
+ alt: a.token.symbol,
2937
+ src: a.token.iconUrl,
2938
+ className: "volr:w-10 volr:h-10 volr:rounded-full volr:border volr-border"
2939
+ }
2940
+ ) : /* @__PURE__ */ jsx("div", { className: "volr:w-10 volr:h-10 volr:rounded-full volr:flex volr:items-center volr:justify-center volr:text-white volr:font-bold volr:text-sm volr-bg-tertiary", children: tokenSymbol.slice(0, 2) }) }),
2941
+ /* @__PURE__ */ jsxs("div", { className: "volr:flex-1 volr:min-w-0", children: [
2942
+ /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:gap-2 volr:mb-1", children: [
2943
+ /* @__PURE__ */ jsx("span", { className: "volr:text-base volr:font-semibold", children: tokenSymbol }),
2944
+ /* @__PURE__ */ jsxs("span", { className: "volr:text-xs volr:px-2 volr:py-0.5 volr:rounded-full volr:font-medium volr-bg-secondary volr-text-secondary", children: [
2945
+ "Chain ",
2946
+ a.chainId
2947
+ ] })
2948
+ ] }),
2949
+ /* @__PURE__ */ jsx("div", { className: "volr:text-sm volr-text-secondary", children: tokenName }),
2950
+ !isNative && /* @__PURE__ */ jsx("div", { className: "volr:text-xs volr:font-mono volr:truncate volr:mt-1 volr-text-muted", children: a.token.address })
2951
+ ] }),
2952
+ /* @__PURE__ */ jsx("div", { className: "volr:shrink-0 volr-text-muted", children: /* @__PURE__ */ jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("polyline", { points: "9 18 15 12 9 6" }) }) })
2953
+ ]
2954
+ },
2955
+ `${a.chainId}-${idx}`
2956
+ );
2957
+ }) })
2958
+ ] });
2920
2959
  }
2921
- function MenuItem({ icon, label, description, onClick }) {
2960
+ var TextLinkButton = React13.forwardRef(({ showArrow = false, className, children, ...props }, ref) => {
2922
2961
  return /* @__PURE__ */ jsxs(
2923
2962
  "button",
2924
2963
  {
2964
+ ref,
2925
2965
  type: "button",
2926
- onClick,
2927
- className: "volr:w-full volr:flex volr:items-center volr:gap-3 volr:py-3 volr:px-3 volr:rounded-xl hover:volr:bg-slate-50 volr:transition-colors volr:text-left",
2966
+ className: cn(
2967
+ "volr:underline volr:transition-colors volr-text-secondary",
2968
+ className
2969
+ ),
2970
+ ...props,
2928
2971
  children: [
2929
- /* @__PURE__ */ jsx("div", { className: "volr:w-10 volr:h-10 volr:rounded-full volr:bg-slate-100 volr:flex volr:items-center volr:justify-center volr:shrink-0", children: icon }),
2930
- /* @__PURE__ */ jsxs("div", { className: "volr:flex-1 volr:min-w-0", children: [
2931
- /* @__PURE__ */ jsx("span", { className: "volr:text-sm volr:font-medium volr:text-slate-900", children: label }),
2932
- description && /* @__PURE__ */ jsx("p", { className: "volr:text-xs volr:text-slate-400 volr:mt-0.5", children: description })
2933
- ] }),
2934
- /* @__PURE__ */ jsx(ChevronRightIcon, { className: "volr:w-4 volr:h-4 volr:text-slate-300" })
2972
+ children,
2973
+ showArrow && " \u2192"
2935
2974
  ]
2936
2975
  }
2937
2976
  );
2977
+ });
2978
+ TextLinkButton.displayName = "TextLinkButton";
2979
+ var OtherTokenModal = ({
2980
+ open,
2981
+ onOpenChange
2982
+ }) => {
2983
+ return /* @__PURE__ */ jsxs(Modal, { open, onOpenChange, children: [
2984
+ /* @__PURE__ */ jsx(ModalHeader, { onClose: () => onOpenChange(false) }),
2985
+ /* @__PURE__ */ jsxs("div", { className: "volr:text-center", children: [
2986
+ /* @__PURE__ */ jsx("p", { className: "volr:text-lg volr:font-semibold volr:mb-2", children: "Coming Soon" }),
2987
+ /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr-text-secondary", children: "Swap and bridge recommendations will be available here soon." })
2988
+ ] })
2989
+ ] });
2990
+ };
2991
+
2992
+ // ../node_modules/viem/_esm/errors/unit.js
2993
+ init_base();
2994
+ var InvalidDecimalNumberError = class extends BaseError {
2995
+ constructor({ value }) {
2996
+ super(`Number \`${value}\` is not a valid decimal number.`, {
2997
+ name: "InvalidDecimalNumberError"
2998
+ });
2999
+ }
3000
+ };
3001
+
3002
+ // ../node_modules/viem/_esm/utils/unit/parseUnits.js
3003
+ function parseUnits(value, decimals) {
3004
+ if (!/^(-?)([0-9]*)\.?([0-9]*)$/.test(value))
3005
+ throw new InvalidDecimalNumberError({ value });
3006
+ let [integer, fraction = "0"] = value.split(".");
3007
+ const negative = integer.startsWith("-");
3008
+ if (negative)
3009
+ integer = integer.slice(1);
3010
+ fraction = fraction.replace(/(0+)$/, "");
3011
+ if (decimals === 0) {
3012
+ if (Math.round(Number(`.${fraction}`)) === 1)
3013
+ integer = `${BigInt(integer) + 1n}`;
3014
+ fraction = "";
3015
+ } else if (fraction.length > decimals) {
3016
+ const [left, unit, right] = [
3017
+ fraction.slice(0, decimals - 1),
3018
+ fraction.slice(decimals - 1, decimals),
3019
+ fraction.slice(decimals)
3020
+ ];
3021
+ const rounded = Math.round(Number(`${unit}.${right}`));
3022
+ if (rounded > 9)
3023
+ fraction = `${BigInt(left) + BigInt(1)}0`.padStart(left.length + 1, "0");
3024
+ else
3025
+ fraction = `${left}${rounded}`;
3026
+ if (fraction.length > decimals) {
3027
+ fraction = fraction.slice(1);
3028
+ integer = `${BigInt(integer) + 1n}`;
3029
+ }
3030
+ fraction = fraction.slice(0, decimals);
3031
+ } else {
3032
+ fraction = fraction.padEnd(decimals, "0");
3033
+ }
3034
+ return BigInt(`${negative ? "-" : ""}${integer}${fraction}`);
2938
3035
  }
2939
- function AccountMainView({
2940
- totalUsd,
2941
- balances,
2942
- isLoading,
2943
- paymentEnabled,
2944
- onNavigate,
2945
- onLogout,
2946
- isLoggingOut
2947
- }) {
2948
- const { t } = useI18n();
2949
- const formattedUsd = isLoading ? "\u2014" : totalUsd.toLocaleString("en-US", {
2950
- style: "currency",
2951
- currency: "USD",
2952
- minimumFractionDigits: 2,
2953
- maximumFractionDigits: 2
2954
- });
2955
- const tokensWithBalance = balances.filter((b) => b.balanceRaw > 0n).length;
2956
- const assetsDescription = isLoading ? void 0 : tokensWithBalance > 0 ? `${tokensWithBalance} ${tokensWithBalance === 1 ? "token" : "tokens"}` : void 0;
2957
- return /* @__PURE__ */ jsxs("div", { children: [
2958
- /* @__PURE__ */ jsxs("div", { className: "volr:rounded-2xl volr:bg-gradient-to-br volr:from-slate-50 volr:to-slate-100 volr:p-6 volr:mb-4", children: [
2959
- /* @__PURE__ */ jsx("p", { className: "volr:text-xs volr:text-slate-500 volr:mb-1", children: t("account.totalBalance") }),
2960
- isLoading ? /* @__PURE__ */ jsx("div", { className: "volr:animate-pulse", children: /* @__PURE__ */ jsx("div", { className: "volr:h-9 volr:w-36 volr:bg-slate-200 volr:rounded" }) }) : /* @__PURE__ */ jsx("p", { className: "volr:text-3xl volr:font-semibold volr:text-slate-900", children: formattedUsd })
2961
- ] }),
2962
- /* @__PURE__ */ jsxs("div", { className: "volr:space-y-1", children: [
3036
+
3037
+ // ../node_modules/viem/_esm/index.js
3038
+ init_abis();
3039
+ init_formatUnits();
3040
+ var DefaultWalletIcon2 = () => /* @__PURE__ */ jsxs(
3041
+ "svg",
3042
+ {
3043
+ className: "volr:w-6 volr:h-6",
3044
+ viewBox: "0 0 24 24",
3045
+ fill: "none",
3046
+ xmlns: "http://www.w3.org/2000/svg",
3047
+ children: [
2963
3048
  /* @__PURE__ */ jsx(
2964
- MenuItem,
3049
+ "rect",
2965
3050
  {
2966
- icon: /* @__PURE__ */ jsx(WalletIcon2, { className: "volr:w-5 volr:h-5 volr:text-slate-600" }),
2967
- label: t("account.menu.assets"),
2968
- description: assetsDescription,
2969
- onClick: () => onNavigate("assets")
3051
+ x: "2",
3052
+ y: "6",
3053
+ width: "20",
3054
+ height: "14",
3055
+ rx: "2",
3056
+ stroke: "currentColor",
3057
+ strokeWidth: "1.5"
2970
3058
  }
2971
3059
  ),
2972
3060
  /* @__PURE__ */ jsx(
2973
- MenuItem,
2974
- {
2975
- icon: /* @__PURE__ */ jsx(ArrowUpIcon, { className: "volr:w-5 volr:h-5 volr:text-slate-600" }),
2976
- label: t("account.menu.withdraw"),
2977
- onClick: () => onNavigate("withdraw")
2978
- }
2979
- ),
2980
- paymentEnabled && /* @__PURE__ */ jsx(
2981
- MenuItem,
3061
+ "path",
2982
3062
  {
2983
- icon: /* @__PURE__ */ jsx(ClockIcon, { className: "volr:w-5 volr:h-5 volr:text-slate-600" }),
2984
- label: t("account.menu.payments"),
2985
- onClick: () => onNavigate("payments")
3063
+ d: "M17 12.5C17 13.3284 16.3284 14 15.5 14C14.6716 14 14 13.3284 14 12.5C14 11.6716 14.6716 11 15.5 11C16.3284 11 17 11.6716 17 12.5Z",
3064
+ fill: "currentColor"
2986
3065
  }
2987
3066
  ),
2988
3067
  /* @__PURE__ */ jsx(
2989
- MenuItem,
3068
+ "path",
2990
3069
  {
2991
- icon: /* @__PURE__ */ jsx(UserIcon, { className: "volr:w-5 volr:h-5 volr:text-slate-600" }),
2992
- label: t("account.menu.account"),
2993
- onClick: () => onNavigate("account")
3070
+ d: "M6 6V5C6 3.89543 6.89543 3 8 3H16C17.1046 3 18 3.89543 18 5V6",
3071
+ stroke: "currentColor",
3072
+ strokeWidth: "1.5"
2994
3073
  }
2995
3074
  )
2996
- ] }),
2997
- /* @__PURE__ */ jsx("div", { className: "volr:mt-4 volr:pt-4 volr:border-t volr:border-slate-100", children: /* @__PURE__ */ jsx(
2998
- "button",
2999
- {
3000
- type: "button",
3001
- onClick: onLogout,
3002
- disabled: isLoggingOut,
3003
- className: "volr:w-full volr:py-2 volr:text-sm volr:text-slate-400 volr:text-center hover:volr:text-slate-600 volr:transition-colors disabled:volr:opacity-50",
3004
- children: isLoggingOut ? t("common.loading") : t("account.logout")
3005
- }
3006
- ) })
3007
- ] });
3008
- }
3009
- function TokenRow({ token }) {
3010
- return /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:justify-between volr:py-3 volr:border-b volr:border-slate-100 last:volr:border-b-0", children: [
3011
- /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:gap-3", children: [
3012
- /* @__PURE__ */ jsx("div", { className: "volr:w-8 volr:h-8 volr:rounded-full volr:bg-slate-100 volr:flex volr:items-center volr:justify-center volr:overflow-hidden volr:shrink-0", children: token.iconUrl ? /* @__PURE__ */ jsx(
3013
- "img",
3014
- {
3015
- src: token.iconUrl,
3016
- alt: token.symbol,
3017
- className: "volr:w-full volr:h-full volr:object-cover"
3018
- }
3019
- ) : /* @__PURE__ */ jsx("span", { className: "volr:text-xs volr:font-medium volr:text-slate-500", children: token.symbol.slice(0, 2) }) }),
3020
- /* @__PURE__ */ jsxs("div", { children: [
3021
- /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:font-medium volr:text-slate-900", children: token.symbol }),
3022
- /* @__PURE__ */ jsxs("p", { className: "volr:text-xs volr:text-slate-400", children: [
3023
- "Chain ",
3024
- token.chainId
3025
- ] })
3026
- ] })
3027
- ] }),
3028
- /* @__PURE__ */ jsx("div", { className: "volr:text-right", children: token.isLoading ? /* @__PURE__ */ jsx("div", { className: "volr:animate-pulse", children: /* @__PURE__ */ jsx("div", { className: "volr:h-4 volr:w-16 volr:bg-slate-200 volr:rounded" }) }) : token.error ? /* @__PURE__ */ jsx("p", { className: "volr:text-xs volr:text-red-500", children: "Error" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
3029
- /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:font-medium volr:text-slate-900", children: token.balance }),
3030
- token.balanceUsd !== void 0 && token.balanceUsd > 0 && /* @__PURE__ */ jsxs("p", { className: "volr:text-xs volr:text-slate-400", children: [
3031
- "$",
3032
- token.balanceUsd.toFixed(2)
3033
- ] })
3034
- ] }) })
3035
- ] });
3036
- }
3037
- function BalanceDetailView({
3038
- balances,
3039
- isLoading
3075
+ ]
3076
+ }
3077
+ );
3078
+ function WalletTransferView({
3079
+ chainId,
3080
+ asset,
3081
+ destinationAddress,
3082
+ onBack,
3083
+ onSuccess
3040
3084
  }) {
3041
3085
  const { t } = useI18n();
3042
- if (isLoading && balances.length === 0) {
3043
- return /* @__PURE__ */ jsx("div", { className: "volr:py-8", children: /* @__PURE__ */ jsx("div", { className: "volr:animate-pulse volr:space-y-4", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:gap-3", children: [
3044
- /* @__PURE__ */ jsx("div", { className: "volr:w-8 volr:h-8 volr:rounded-full volr:bg-slate-200" }),
3045
- /* @__PURE__ */ jsxs("div", { className: "volr:flex-1", children: [
3046
- /* @__PURE__ */ jsx("div", { className: "volr:h-4 volr:w-16 volr:bg-slate-200 volr:rounded volr:mb-1" }),
3047
- /* @__PURE__ */ jsx("div", { className: "volr:h-3 volr:w-12 volr:bg-slate-100 volr:rounded" })
3048
- ] }),
3049
- /* @__PURE__ */ jsx("div", { className: "volr:h-4 volr:w-16 volr:bg-slate-200 volr:rounded" })
3050
- ] }, i)) }) });
3051
- }
3052
- if (balances.length === 0) {
3053
- return /* @__PURE__ */ jsx("div", { className: "volr:py-12 volr:text-center", children: /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-slate-400", children: t("account.noAssets") }) });
3054
- }
3055
- return /* @__PURE__ */ jsxs("div", { children: [
3056
- /* @__PURE__ */ jsx("h2", { className: "volr:text-lg volr:font-semibold volr:text-slate-900 volr:mb-4", children: t("account.menu.assets") }),
3057
- /* @__PURE__ */ jsx("div", { children: balances.map((token) => /* @__PURE__ */ jsx(TokenRow, { token }, token.id)) })
3058
- ] });
3059
- }
3060
- var Input = React13.forwardRef(
3061
- ({ leftIcon, error, className, style, disabled, ...props }, ref) => {
3062
- return /* @__PURE__ */ jsxs("div", { className: "volr:relative", children: [
3063
- leftIcon && /* @__PURE__ */ jsx("div", { className: "volr:absolute volr:left-3 volr:top-1/2 volr:-translate-y-1/2 volr:pointer-events-none volr-text-muted", children: leftIcon }),
3064
- /* @__PURE__ */ jsx(
3065
- "input",
3066
- {
3067
- ref,
3068
- disabled,
3069
- className: cn(
3070
- "volr:w-full volr:text-base volr:outline-none volr:transition-all volr:rounded-lg volr:py-3 volr:disabled:cursor-not-allowed volr:bg-white",
3071
- "volr:border volr:border-slate-300 focus:volr:border-slate-400 focus:volr:ring-1 focus:volr:ring-slate-400",
3072
- leftIcon ? "volr:pl-11 volr:pr-3" : "volr:px-3",
3073
- error && "volr:border-red-500 focus:volr:border-red-500 focus:volr:ring-red-500",
3074
- className
3075
- ),
3076
- style,
3077
- ...props
3078
- }
3079
- )
3080
- ] });
3081
- }
3082
- );
3083
- Input.displayName = "Input";
3084
- function WithdrawView({
3085
- balances,
3086
- connectedWallet,
3087
- onSuccess
3088
- }) {
3089
- const { t } = useI18n();
3090
- const { withdraw, isWithdrawing, result, error, reset } = useWithdraw();
3091
- const [step, setStep] = useState("select");
3092
- const [selectedTokenId, setSelectedTokenId] = useState(null);
3093
- const [toAddress, setToAddress] = useState("");
3086
+ const { config } = useVolrContext();
3087
+ const { client } = useInternalAuth();
3088
+ const { isDetecting, getWalletsForDisplay, hasWallet } = useEIP6963();
3089
+ const [viewState, setViewState] = useState("select-wallet");
3090
+ const [selectedWallet, setSelectedWallet] = useState(null);
3091
+ const [connectedAddress, setConnectedAddress] = useState(null);
3092
+ const [balance, setBalance] = useState(null);
3094
3093
  const [amount, setAmount] = useState("");
3095
- const [useConnectedWallet, setUseConnectedWallet] = useState(false);
3096
- const selectedToken = useMemo(
3097
- () => balances.find((b) => b.id === selectedTokenId),
3098
- [balances, selectedTokenId]
3094
+ const [isConnecting, setIsConnecting] = useState(false);
3095
+ const [isTransferring, setIsTransferring] = useState(false);
3096
+ const [error, setError] = useState(null);
3097
+ const [chainName, setChainName] = useState(null);
3098
+ const [currentChainId, setCurrentChainId] = useState(null);
3099
+ const tokenSymbol = asset === "native" ? "ETH" : asset.symbol;
3100
+ const decimals = asset === "native" ? 18 : asset.decimals;
3101
+ const getNetworkInfo = useCallback(
3102
+ createGetNetworkInfo({ client, rpcOverrides: config.rpcOverrides }),
3103
+ [client, config.rpcOverrides]
3099
3104
  );
3100
- const connectedAddress = useMemo(() => {
3101
- if (!connectedWallet) return null;
3102
- const parts = connectedWallet.split(":");
3103
- return parts.length >= 2 ? parts[1] : null;
3104
- }, [connectedWallet]);
3105
- const handleSelectToken = (tokenId) => {
3106
- setSelectedTokenId(tokenId);
3107
- setStep("input");
3108
- };
3109
- const handleUseConnectedWallet = () => {
3110
- if (connectedAddress) {
3111
- setToAddress(connectedAddress);
3112
- setUseConnectedWallet(true);
3113
- }
3114
- };
3115
- const handleConfirm = async () => {
3116
- if (!selectedToken || !toAddress || !amount) return;
3117
- setStep("confirm");
3105
+ useEffect(() => {
3106
+ let cancelled = false;
3107
+ const loadChainName = async () => {
3108
+ try {
3109
+ const info = await getNetworkInfo(chainId, false);
3110
+ if (!cancelled) setChainName(info.name);
3111
+ } catch {
3112
+ if (!cancelled) setChainName(`Chain ${chainId}`);
3113
+ }
3114
+ };
3115
+ loadChainName();
3116
+ return () => {
3117
+ cancelled = true;
3118
+ };
3119
+ }, [getNetworkInfo, chainId]);
3120
+ const connectWallet = useCallback(async (wallet) => {
3121
+ setIsConnecting(true);
3122
+ setError(null);
3118
3123
  try {
3119
- await withdraw({
3120
- chainId: selectedToken.chainId,
3121
- tokenAddress: selectedToken.address,
3122
- decimals: selectedToken.decimals,
3123
- amount,
3124
- to: toAddress
3125
- });
3126
- setStep("result");
3127
- } catch {
3128
- setStep("result");
3124
+ const provider = wallet.provider;
3125
+ const accounts = await provider.request({ method: "eth_requestAccounts" });
3126
+ if (!accounts || accounts.length === 0) {
3127
+ throw new Error("No accounts found");
3128
+ }
3129
+ const address = accounts[0];
3130
+ setConnectedAddress(address);
3131
+ setSelectedWallet(wallet);
3132
+ const chainIdHex = await provider.request({ method: "eth_chainId" });
3133
+ const currentChain = parseInt(chainIdHex, 16);
3134
+ setCurrentChainId(currentChain);
3135
+ await fetchBalance(provider, address, currentChain);
3136
+ setViewState("transfer");
3137
+ } catch (err) {
3138
+ console.error("Failed to connect wallet:", err);
3139
+ setError(err instanceof Error ? err.message : "Connection failed");
3140
+ } finally {
3141
+ setIsConnecting(false);
3129
3142
  }
3130
- };
3131
- const handleReset = () => {
3132
- reset();
3133
- setStep("select");
3134
- setSelectedTokenId(null);
3135
- setToAddress("");
3136
- setAmount("");
3137
- setUseConnectedWallet(false);
3138
- };
3139
- const isAmountValid = useMemo(() => {
3140
- if (!amount || !selectedToken) return false;
3141
- const num = parseFloat(amount);
3142
- if (isNaN(num) || num <= 0) return false;
3143
- const balance = parseFloat(selectedToken.balance.replace(/,/g, ""));
3144
- return num <= balance;
3145
- }, [amount, selectedToken]);
3146
- const isAddressValid = /^0x[a-fA-F0-9]{40}$/.test(toAddress);
3147
- if (step === "select") {
3148
- return /* @__PURE__ */ jsxs("div", { children: [
3149
- /* @__PURE__ */ jsx("h2", { className: "volr:text-lg volr:font-semibold volr:text-slate-900 volr:mb-4", children: t("account.withdraw.selectToken") }),
3150
- /* @__PURE__ */ jsx("div", { className: "volr:space-y-2", children: balances.map((token) => /* @__PURE__ */ jsxs(
3151
- "button",
3152
- {
3153
- type: "button",
3154
- onClick: () => handleSelectToken(token.id),
3155
- disabled: token.balanceRaw === 0n,
3156
- className: "volr:w-full volr:flex volr:items-center volr:justify-between volr:p-3 volr:rounded-lg volr:border volr:border-slate-200 hover:volr:bg-slate-50 volr:transition-colors disabled:volr:opacity-50 disabled:volr:cursor-not-allowed",
3157
- children: [
3158
- /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:gap-3", children: [
3159
- /* @__PURE__ */ jsx("div", { className: "volr:w-8 volr:h-8 volr:rounded-full volr:bg-slate-100 volr:flex volr:items-center volr:justify-center volr:overflow-hidden", children: token.iconUrl ? /* @__PURE__ */ jsx(
3160
- "img",
3161
- {
3162
- src: token.iconUrl,
3163
- alt: token.symbol,
3164
- className: "volr:w-full volr:h-full volr:object-cover"
3165
- }
3166
- ) : /* @__PURE__ */ jsx("span", { className: "volr:text-xs volr:font-medium volr:text-slate-500", children: token.symbol.slice(0, 2) }) }),
3167
- /* @__PURE__ */ jsx("span", { className: "volr:text-sm volr:font-medium volr:text-slate-900", children: token.symbol })
3168
- ] }),
3169
- /* @__PURE__ */ jsx("span", { className: "volr:text-sm volr:text-slate-500", children: token.balance })
3170
- ]
3171
- },
3172
- token.id
3173
- )) })
3174
- ] });
3175
- }
3176
- if (step === "input" && selectedToken) {
3177
- return /* @__PURE__ */ jsxs("div", { children: [
3178
- /* @__PURE__ */ jsx("h2", { className: "volr:text-lg volr:font-semibold volr:text-slate-900 volr:mb-4", children: t("account.withdraw.title") }),
3179
- /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:gap-3 volr:p-3 volr:rounded-lg volr:bg-slate-50 volr:mb-4", children: [
3180
- /* @__PURE__ */ jsx("div", { className: "volr:w-8 volr:h-8 volr:rounded-full volr:bg-slate-200 volr:flex volr:items-center volr:justify-center volr:overflow-hidden", children: selectedToken.iconUrl ? /* @__PURE__ */ jsx(
3181
- "img",
3182
- {
3183
- src: selectedToken.iconUrl,
3184
- alt: selectedToken.symbol,
3185
- className: "volr:w-full volr:h-full volr:object-cover"
3186
- }
3187
- ) : /* @__PURE__ */ jsx("span", { className: "volr:text-xs volr:font-medium volr:text-slate-500", children: selectedToken.symbol.slice(0, 2) }) }),
3188
- /* @__PURE__ */ jsxs("div", { children: [
3189
- /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:font-medium volr:text-slate-900", children: selectedToken.symbol }),
3190
- /* @__PURE__ */ jsxs("p", { className: "volr:text-xs volr:text-slate-400", children: [
3191
- t("account.withdraw.available"),
3192
- ": ",
3193
- selectedToken.balance
3194
- ] })
3195
- ] })
3196
- ] }),
3197
- /* @__PURE__ */ jsxs("div", { className: "volr:mb-4", children: [
3198
- /* @__PURE__ */ jsx("label", { className: "volr:block volr:text-sm volr:text-slate-600 volr:mb-2", children: t("account.withdraw.toAddress") }),
3199
- /* @__PURE__ */ jsx(
3200
- Input,
3201
- {
3202
- type: "text",
3203
- placeholder: "0x...",
3204
- value: toAddress,
3205
- onChange: (e) => {
3206
- setToAddress(e.target.value);
3207
- setUseConnectedWallet(false);
3208
- }
3209
- }
3210
- ),
3211
- connectedAddress && !useConnectedWallet && /* @__PURE__ */ jsx(
3212
- "button",
3213
- {
3214
- type: "button",
3215
- onClick: handleUseConnectedWallet,
3216
- className: "volr:mt-2 volr:text-xs volr:text-slate-500 hover:volr:text-slate-700 volr:underline",
3217
- children: t("account.withdraw.useConnectedWallet")
3218
- }
3219
- )
3220
- ] }),
3221
- /* @__PURE__ */ jsxs("div", { className: "volr:mb-6", children: [
3222
- /* @__PURE__ */ jsx("label", { className: "volr:block volr:text-sm volr:text-slate-600 volr:mb-2", children: t("account.withdraw.amount") }),
3223
- /* @__PURE__ */ jsxs("div", { className: "volr:relative", children: [
3224
- /* @__PURE__ */ jsx(
3225
- Input,
3226
- {
3227
- type: "text",
3228
- inputMode: "decimal",
3229
- placeholder: "0.00",
3230
- value: amount,
3231
- onChange: (e) => setAmount(e.target.value)
3232
- }
3233
- ),
3234
- /* @__PURE__ */ jsx(
3235
- "button",
3236
- {
3237
- type: "button",
3238
- onClick: () => setAmount(selectedToken.balance.replace(/,/g, "")),
3239
- className: "volr:absolute volr:right-3 volr:top-1/2 volr:-translate-y-1/2 volr:text-xs volr:text-slate-500 hover:volr:text-slate-700 volr:font-medium",
3240
- children: "MAX"
3241
- }
3242
- )
3243
- ] })
3244
- ] }),
3245
- /* @__PURE__ */ jsx(
3246
- Button,
3247
- {
3248
- onClick: handleConfirm,
3249
- disabled: !isAddressValid || !isAmountValid,
3250
- fullWidth: true,
3251
- children: t("account.withdraw.confirm")
3252
- }
3253
- )
3254
- ] });
3255
- }
3256
- if (step === "confirm" && selectedToken) {
3257
- return /* @__PURE__ */ jsxs("div", { className: "volr:py-8 volr:text-center", children: [
3258
- /* @__PURE__ */ jsx("div", { className: "volr:animate-spin volr:w-8 volr:h-8 volr:border-2 volr:border-slate-200 volr:border-t-slate-600 volr:rounded-full volr:mx-auto volr:mb-4" }),
3259
- /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-slate-600", children: t("account.withdraw.processing") })
3260
- ] });
3261
- }
3262
- if (step === "result") {
3263
- const isSuccess = result && !error;
3264
- return /* @__PURE__ */ jsxs("div", { className: "volr:py-8 volr:text-center", children: [
3265
- isSuccess ? /* @__PURE__ */ jsxs(Fragment, { children: [
3266
- /* @__PURE__ */ jsx("div", { className: "volr:w-12 volr:h-12 volr:rounded-full volr:bg-green-100 volr:flex volr:items-center volr:justify-center volr:mx-auto volr:mb-4", children: /* @__PURE__ */ jsx(
3267
- "svg",
3268
- {
3269
- className: "volr:w-6 volr:h-6 volr:text-green-600",
3270
- fill: "none",
3271
- viewBox: "0 0 24 24",
3272
- stroke: "currentColor",
3273
- children: /* @__PURE__ */ jsx(
3274
- "path",
3275
- {
3276
- strokeLinecap: "round",
3277
- strokeLinejoin: "round",
3278
- strokeWidth: 2,
3279
- d: "M5 13l4 4L19 7"
3280
- }
3281
- )
3282
- }
3283
- ) }),
3284
- /* @__PURE__ */ jsx("p", { className: "volr:text-lg volr:font-semibold volr:text-slate-900 volr:mb-2", children: t("account.withdraw.success") }),
3285
- /* @__PURE__ */ jsxs("p", { className: "volr:text-sm volr:text-slate-500 volr:mb-6", children: [
3286
- amount,
3287
- " ",
3288
- selectedToken?.symbol,
3289
- " ",
3290
- t("account.withdraw.sent")
3291
- ] })
3292
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
3293
- /* @__PURE__ */ jsx("div", { className: "volr:w-12 volr:h-12 volr:rounded-full volr:bg-red-100 volr:flex volr:items-center volr:justify-center volr:mx-auto volr:mb-4", children: /* @__PURE__ */ jsx(
3294
- "svg",
3295
- {
3296
- className: "volr:w-6 volr:h-6 volr:text-red-600",
3297
- fill: "none",
3298
- viewBox: "0 0 24 24",
3299
- stroke: "currentColor",
3300
- children: /* @__PURE__ */ jsx(
3301
- "path",
3302
- {
3303
- strokeLinecap: "round",
3304
- strokeLinejoin: "round",
3305
- strokeWidth: 2,
3306
- d: "M6 18L18 6M6 6l12 12"
3307
- }
3308
- )
3309
- }
3310
- ) }),
3311
- /* @__PURE__ */ jsx("p", { className: "volr:text-lg volr:font-semibold volr:text-slate-900 volr:mb-2", children: t("account.withdraw.failed") }),
3312
- /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-red-500 volr:mb-6", children: error?.message || t("account.withdraw.unknownError") })
3313
- ] }),
3314
- /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: isSuccess ? onSuccess : handleReset, fullWidth: true, children: isSuccess ? t("common.done") : t("common.tryAgain") })
3315
- ] });
3316
- }
3317
- return null;
3318
- }
3319
- function PaymentRow({ payment, onClick }) {
3320
- const { t } = useI18n();
3321
- const date = new Date(payment.createdAt);
3322
- const formattedDate = date.toLocaleDateString(void 0, {
3323
- month: "short",
3324
- day: "numeric",
3325
- year: "numeric"
3326
- });
3327
- const statusColors = {
3328
- CONFIRMED: "volr:bg-green-100 volr:text-green-700",
3329
- PENDING: "volr:bg-yellow-100 volr:text-yellow-700",
3330
- PROCESSING: "volr:bg-blue-100 volr:text-blue-700",
3331
- FAILED: "volr:bg-red-100 volr:text-red-700",
3332
- CANCELLED: "volr:bg-slate-100 volr:text-slate-500",
3333
- EXPIRED: "volr:bg-slate-100 volr:text-slate-500"
3334
- };
3335
- return /* @__PURE__ */ jsxs(
3336
- "button",
3337
- {
3338
- type: "button",
3339
- onClick,
3340
- className: "volr:w-full volr:flex volr:items-center volr:justify-between volr:py-3 volr:border-b volr:border-slate-100 hover:volr:bg-slate-50 volr:transition-colors volr:text-left",
3341
- children: [
3342
- /* @__PURE__ */ jsxs("div", { className: "volr:flex-1 volr:min-w-0", children: [
3343
- /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:gap-2 volr:mb-1", children: [
3344
- /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:font-medium volr:text-slate-900 volr:truncate", children: payment.itemName || t("account.payments.payment") }),
3345
- /* @__PURE__ */ jsx(
3346
- "span",
3347
- {
3348
- className: `volr:px-1.5 volr:py-0.5 volr:text-xs volr:font-medium volr:rounded ${statusColors[payment.status] || "volr:bg-slate-100 volr:text-slate-500"}`,
3349
- children: payment.status
3350
- }
3351
- )
3352
- ] }),
3353
- /* @__PURE__ */ jsx("p", { className: "volr:text-xs volr:text-slate-400", children: formattedDate })
3354
- ] }),
3355
- /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:gap-2", children: [
3356
- /* @__PURE__ */ jsxs("div", { className: "volr:text-right", children: [
3357
- /* @__PURE__ */ jsxs("p", { className: "volr:text-sm volr:font-medium volr:text-slate-900", children: [
3358
- payment.amount,
3359
- " ",
3360
- payment.token.symbol
3361
- ] }),
3362
- payment.totalUsd && /* @__PURE__ */ jsxs("p", { className: "volr:text-xs volr:text-slate-400", children: [
3363
- "$",
3364
- parseFloat(payment.totalUsd).toFixed(2)
3365
- ] })
3366
- ] }),
3367
- /* @__PURE__ */ jsx(ChevronRightIcon, { className: "volr:w-4 volr:h-4 volr:text-slate-300" })
3368
- ] })
3369
- ]
3370
- }
3371
- );
3372
- }
3373
- function PaymentHistoryView({ onSelectPayment }) {
3374
- const { t } = useI18n();
3375
- const { getPaymentHistory, isLoading: isApiLoading } = useVolrPaymentApi();
3376
- const [payments, setPayments] = useState([]);
3377
- const [isLoading, setIsLoading] = useState(true);
3378
- const [error, setError] = useState(null);
3379
- useEffect(() => {
3380
- setIsLoading(true);
3381
- setError(null);
3382
- getPaymentHistory({ take: 20 }).then((result) => {
3383
- setPayments(result.payments);
3384
- }).catch((err) => {
3385
- console.error("[PaymentHistoryView] Failed to fetch payments:", err);
3386
- setError(t("account.payments.fetchError"));
3387
- }).finally(() => {
3388
- setIsLoading(false);
3389
- });
3390
- }, [getPaymentHistory, t]);
3391
- if (isLoading || isApiLoading) {
3392
- return /* @__PURE__ */ jsx("div", { className: "volr:py-8", children: /* @__PURE__ */ jsx("div", { className: "volr:animate-pulse volr:space-y-4", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:justify-between volr:py-3", children: [
3393
- /* @__PURE__ */ jsxs("div", { children: [
3394
- /* @__PURE__ */ jsx("div", { className: "volr:h-4 volr:w-32 volr:bg-slate-200 volr:rounded volr:mb-2" }),
3395
- /* @__PURE__ */ jsx("div", { className: "volr:h-3 volr:w-20 volr:bg-slate-100 volr:rounded" })
3396
- ] }),
3397
- /* @__PURE__ */ jsx("div", { className: "volr:h-4 volr:w-16 volr:bg-slate-200 volr:rounded" })
3398
- ] }, i)) }) });
3399
- }
3400
- if (error) {
3401
- return /* @__PURE__ */ jsx("div", { className: "volr:py-12 volr:text-center", children: /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-red-500", children: error }) });
3402
- }
3403
- if (payments.length === 0) {
3404
- return /* @__PURE__ */ jsx("div", { className: "volr:py-12 volr:text-center", children: /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-slate-400", children: t("account.payments.noPayments") }) });
3405
- }
3406
- return /* @__PURE__ */ jsxs("div", { children: [
3407
- /* @__PURE__ */ jsx("h2", { className: "volr:text-lg volr:font-semibold volr:text-slate-900 volr:mb-4", children: t("account.menu.payments") }),
3408
- /* @__PURE__ */ jsx("div", { children: payments.map((payment) => /* @__PURE__ */ jsx(
3409
- PaymentRow,
3410
- {
3411
- payment,
3412
- onClick: () => onSelectPayment(payment)
3413
- },
3414
- payment.id
3415
- )) })
3416
- ] });
3417
- }
3418
- function DetailRow({ label, value, copyable, mono }) {
3419
- return /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-start volr:justify-between volr:py-2 volr:border-b volr:border-slate-100 last:volr:border-b-0", children: [
3420
- /* @__PURE__ */ jsx("span", { className: "volr:text-sm volr:text-slate-500", children: label }),
3421
- /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:gap-2", children: [
3422
- /* @__PURE__ */ jsx(
3423
- "span",
3424
- {
3425
- className: `volr:text-sm volr:text-slate-900 volr:text-right ${mono ? "volr:font-mono" : ""}`,
3426
- children: value
3427
- }
3428
- ),
3429
- copyable && /* @__PURE__ */ jsx(CopyButton, { text: value, className: "volr:shrink-0" })
3430
- ] })
3431
- ] });
3432
- }
3433
- function PaymentDetailView({ payment }) {
3434
- const { t } = useI18n();
3435
- const createdDate = new Date(payment.createdAt);
3436
- const formattedCreatedAt = createdDate.toLocaleString(void 0, {
3437
- year: "numeric",
3438
- month: "short",
3439
- day: "numeric",
3440
- hour: "2-digit",
3441
- minute: "2-digit"
3442
- });
3443
- const confirmedDate = payment.confirmedAt ? new Date(payment.confirmedAt) : null;
3444
- const formattedConfirmedAt = confirmedDate ? confirmedDate.toLocaleString(void 0, {
3445
- year: "numeric",
3446
- month: "short",
3447
- day: "numeric",
3448
- hour: "2-digit",
3449
- minute: "2-digit"
3450
- }) : null;
3451
- const statusColors = {
3452
- CONFIRMED: "volr:bg-green-100 volr:text-green-700",
3453
- PENDING: "volr:bg-yellow-100 volr:text-yellow-700",
3454
- PROCESSING: "volr:bg-blue-100 volr:text-blue-700",
3455
- FAILED: "volr:bg-red-100 volr:text-red-700",
3456
- CANCELLED: "volr:bg-slate-100 volr:text-slate-500",
3457
- EXPIRED: "volr:bg-slate-100 volr:text-slate-500"
3458
- };
3459
- const truncateHash = (hash) => {
3460
- if (hash.length <= 16) return hash;
3461
- return `${hash.slice(0, 8)}...${hash.slice(-6)}`;
3462
- };
3463
- return /* @__PURE__ */ jsxs("div", { children: [
3464
- /* @__PURE__ */ jsxs("div", { className: "volr:mb-6", children: [
3465
- /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:gap-2 volr:mb-2", children: [
3466
- /* @__PURE__ */ jsx("h2", { className: "volr:text-lg volr:font-semibold volr:text-slate-900", children: payment.itemName || t("account.payments.payment") }),
3467
- /* @__PURE__ */ jsx(
3468
- "span",
3469
- {
3470
- className: `volr:px-2 volr:py-0.5 volr:text-xs volr:font-medium volr:rounded ${statusColors[payment.status] || "volr:bg-slate-100 volr:text-slate-500"}`,
3471
- children: payment.status
3472
- }
3473
- )
3474
- ] }),
3475
- payment.itemDescription && /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-slate-500", children: payment.itemDescription })
3476
- ] }),
3477
- /* @__PURE__ */ jsxs("div", { className: "volr:py-4 volr:mb-4 volr:border-y volr:border-slate-100", children: [
3478
- /* @__PURE__ */ jsxs("p", { className: "volr:text-2xl volr:font-semibold volr:text-slate-900", children: [
3479
- payment.amount,
3480
- " ",
3481
- payment.token.symbol
3482
- ] }),
3483
- payment.totalUsd && /* @__PURE__ */ jsxs("p", { className: "volr:text-sm volr:text-slate-500", children: [
3484
- "\u2248 $",
3485
- parseFloat(payment.totalUsd).toFixed(2),
3486
- " USD"
3487
- ] })
3488
- ] }),
3489
- /* @__PURE__ */ jsxs("div", { className: "volr:space-y-1", children: [
3490
- /* @__PURE__ */ jsx(DetailRow, { label: t("account.payments.createdAt"), value: formattedCreatedAt }),
3491
- formattedConfirmedAt && /* @__PURE__ */ jsx(DetailRow, { label: t("account.payments.confirmedAt"), value: formattedConfirmedAt }),
3492
- /* @__PURE__ */ jsx(
3493
- DetailRow,
3494
- {
3495
- label: t("account.payments.token"),
3496
- value: `${payment.token.symbol} (Chain ${payment.token.chainId})`
3497
- }
3498
- ),
3499
- payment.txHash && /* @__PURE__ */ jsx(
3500
- DetailRow,
3501
- {
3502
- label: t("account.payments.txHash"),
3503
- value: truncateHash(payment.txHash),
3504
- copyable: true,
3505
- mono: true
3506
- }
3507
- ),
3508
- payment.referenceId && /* @__PURE__ */ jsx(
3509
- DetailRow,
3510
- {
3511
- label: t("account.payments.referenceId"),
3512
- value: payment.referenceId,
3513
- copyable: true
3514
- }
3515
- )
3516
- ] }),
3517
- payment.itemImage && /* @__PURE__ */ jsx("div", { className: "volr:mt-6", children: /* @__PURE__ */ jsx(
3518
- "img",
3519
- {
3520
- src: payment.itemImage,
3521
- alt: payment.itemName || "Item",
3522
- className: "volr:w-full volr:h-40 volr:object-cover volr:rounded-lg"
3523
- }
3524
- ) })
3525
- ] });
3526
- }
3527
- function InfoRow({ label, value, copyable, mono }) {
3528
- return /* @__PURE__ */ jsxs("div", { className: "volr:py-3 volr:border-b volr:border-slate-100 last:volr:border-b-0", children: [
3529
- /* @__PURE__ */ jsx("p", { className: "volr:text-xs volr:text-slate-400 volr:mb-1", children: label }),
3530
- /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:justify-between volr:gap-2", children: [
3531
- /* @__PURE__ */ jsx(
3532
- "p",
3533
- {
3534
- className: `volr:text-sm volr:text-slate-900 volr:break-all ${mono ? "volr:font-mono" : ""}`,
3535
- children: value
3536
- }
3537
- ),
3538
- copyable && /* @__PURE__ */ jsx(CopyButton, { text: value, className: "volr:shrink-0" })
3539
- ] })
3540
- ] });
3541
- }
3542
- function AccountInfoView({ user }) {
3543
- const { t } = useI18n();
3544
- const getLoginMethod = () => {
3545
- if (user.authWallet) {
3546
- return t("account.info.loginMethod.wallet");
3547
- }
3548
- if (user.email?.includes("@google.")) {
3549
- return t("account.info.loginMethod.google");
3550
- }
3551
- if (user.email?.includes("@twitter.") || user.email?.includes("@x.")) {
3552
- return t("account.info.loginMethod.twitter");
3553
- }
3554
- if (user.email?.includes("@wallet.")) {
3555
- return t("account.info.loginMethod.wallet");
3556
- }
3557
- return t("account.info.loginMethod.email");
3558
- };
3559
- const formatAddress = (address) => {
3560
- if (address.length <= 16) return address;
3561
- return `${address.slice(0, 6)}...${address.slice(-4)}`;
3562
- };
3563
- const externalWallet = user.authWallet ? user.authWallet.split(":")[1] || user.authWallet : null;
3564
- return /* @__PURE__ */ jsxs("div", { children: [
3565
- /* @__PURE__ */ jsx("h2", { className: "volr:text-lg volr:font-semibold volr:text-slate-900 volr:mb-4", children: t("account.menu.account") }),
3566
- /* @__PURE__ */ jsxs("div", { children: [
3567
- /* @__PURE__ */ jsx(InfoRow, { label: t("account.info.loginMethod.label"), value: getLoginMethod() }),
3568
- user.email && !user.email.includes("@wallet.") && /* @__PURE__ */ jsx(InfoRow, { label: t("account.email"), value: user.email }),
3569
- user.evmAddress && /* @__PURE__ */ jsx(
3570
- InfoRow,
3571
- {
3572
- label: t("account.walletAddress"),
3573
- value: formatAddress(user.evmAddress),
3574
- copyable: true,
3575
- mono: true
3576
- }
3577
- ),
3578
- externalWallet && /* @__PURE__ */ jsx(
3579
- InfoRow,
3580
- {
3581
- label: t("account.info.connectedWallet"),
3582
- value: formatAddress(externalWallet),
3583
- copyable: true,
3584
- mono: true
3585
- }
3586
- ),
3587
- user.signerType && /* @__PURE__ */ jsx(
3588
- InfoRow,
3589
- {
3590
- label: t("account.info.signerType"),
3591
- value: user.signerType === "passkey" ? "Passkey" : user.signerType
3592
- }
3593
- )
3594
- ] })
3595
- ] });
3596
- }
3597
- function AccountModal({ isOpen, onClose, onError }) {
3598
- const { user, logout } = useVolrContext();
3599
- const { balances, totalUsd, isLoading, paymentEnabled, refresh } = useUserBalances();
3600
- const [currentView, setCurrentView] = useState("main");
3601
- const [selectedPayment, setSelectedPayment] = useState(null);
3602
- const [isLoggingOut, setIsLoggingOut] = useState(false);
3603
- const handleOpenChange = useCallback((open) => {
3604
- if (!open) {
3605
- onClose();
3606
- setTimeout(() => {
3607
- setCurrentView("main");
3608
- setSelectedPayment(null);
3609
- }, 200);
3610
- }
3611
- }, [onClose]);
3612
- if (!user) {
3613
- return /* @__PURE__ */ jsx(SigninModal, { isOpen, onClose, onError });
3614
- }
3615
- if (!user.keyStorageType) {
3616
- const handlePasskeyComplete = () => {
3617
- onClose();
3618
- };
3619
- const handlePasskeyError = (error) => {
3620
- if (onError) onError(error);
3621
- };
3622
- const handleLogoutFromPasskey = async () => {
3623
- try {
3624
- await logout();
3625
- onClose();
3626
- } catch (error) {
3627
- if (onError) {
3628
- onError(error instanceof Error ? error : new Error("Logout failed"));
3629
- }
3143
+ }, [chainId, asset]);
3144
+ const fetchBalance = useCallback(async (provider, address, currentChain) => {
3145
+ try {
3146
+ if (currentChain !== chainId) {
3147
+ setBalance(null);
3148
+ return;
3630
3149
  }
3631
- };
3632
- return /* @__PURE__ */ jsx(Modal, { open: isOpen, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsx(
3633
- PasskeyEnrollView,
3634
- {
3635
- wrapInModal: false,
3636
- onComplete: handlePasskeyComplete,
3637
- onError: handlePasskeyError,
3638
- onLogout: handleLogoutFromPasskey,
3639
- onClose
3150
+ if (asset === "native") {
3151
+ const balanceHex = await provider.request({
3152
+ method: "eth_getBalance",
3153
+ params: [address, "latest"]
3154
+ });
3155
+ setBalance(BigInt(balanceHex));
3156
+ } else {
3157
+ const data = `0x70a08231000000000000000000000000${address.slice(2)}`;
3158
+ const result = await provider.request({
3159
+ method: "eth_call",
3160
+ params: [{ to: asset.address, data }, "latest"]
3161
+ });
3162
+ setBalance(BigInt(result));
3640
3163
  }
3641
- ) });
3642
- }
3643
- const handleLogout = async () => {
3644
- setIsLoggingOut(true);
3164
+ } catch (err) {
3165
+ console.error("Failed to fetch balance:", err);
3166
+ setBalance(BigInt(0));
3167
+ }
3168
+ }, [chainId, asset]);
3169
+ const switchNetwork = useCallback(async () => {
3170
+ if (!selectedWallet?.provider) return;
3645
3171
  try {
3646
- await logout();
3647
- onClose();
3648
- } catch (error) {
3649
- if (onError) {
3650
- onError(error instanceof Error ? error : new Error("Logout failed"));
3172
+ await selectedWallet.provider.request({
3173
+ method: "wallet_switchEthereumChain",
3174
+ params: [{ chainId: `0x${chainId.toString(16)}` }]
3175
+ });
3176
+ const chainIdHex = await selectedWallet.provider.request({ method: "eth_chainId" });
3177
+ const currentChain = parseInt(chainIdHex, 16);
3178
+ setCurrentChainId(currentChain);
3179
+ if (connectedAddress) {
3180
+ await fetchBalance(selectedWallet.provider, connectedAddress, currentChain);
3651
3181
  }
3652
- } finally {
3653
- setIsLoggingOut(false);
3182
+ } catch (err) {
3183
+ console.error("Failed to switch network:", err);
3184
+ setError(err instanceof Error ? err.message : "Failed to switch network");
3654
3185
  }
3655
- };
3656
- const handleNavigate = (view) => {
3657
- setCurrentView(view);
3658
- };
3659
- const handleBack = () => {
3660
- if (selectedPayment) {
3661
- setSelectedPayment(null);
3662
- setCurrentView("payments");
3663
- } else {
3664
- setCurrentView("main");
3186
+ }, [selectedWallet, chainId, connectedAddress, fetchBalance]);
3187
+ const executeTransfer = useCallback(async () => {
3188
+ if (!selectedWallet?.provider || !connectedAddress || !amount) return;
3189
+ setIsTransferring(true);
3190
+ setError(null);
3191
+ try {
3192
+ const amountWei = parseUnits(amount, decimals);
3193
+ if (balance !== null && amountWei > balance) {
3194
+ setError(t("deposit.walletTransfer.insufficientBalance"));
3195
+ setIsTransferring(false);
3196
+ return;
3197
+ }
3198
+ let txHash;
3199
+ if (asset === "native") {
3200
+ txHash = await selectedWallet.provider.request({
3201
+ method: "eth_sendTransaction",
3202
+ params: [{
3203
+ from: connectedAddress,
3204
+ to: destinationAddress,
3205
+ value: `0x${amountWei.toString(16)}`
3206
+ }]
3207
+ });
3208
+ } else {
3209
+ const paddedTo = destinationAddress.slice(2).padStart(64, "0");
3210
+ const paddedAmount = amountWei.toString(16).padStart(64, "0");
3211
+ const data = `0xa9059cbb${paddedTo}${paddedAmount}`;
3212
+ txHash = await selectedWallet.provider.request({
3213
+ method: "eth_sendTransaction",
3214
+ params: [{
3215
+ from: connectedAddress,
3216
+ to: asset.address,
3217
+ data
3218
+ }]
3219
+ });
3220
+ }
3221
+ console.log("Transfer tx hash:", txHash);
3222
+ onSuccess?.();
3223
+ } catch (err) {
3224
+ console.error("Transfer failed:", err);
3225
+ setError(err instanceof Error ? err.message : "Transfer failed");
3226
+ } finally {
3227
+ setIsTransferring(false);
3665
3228
  }
3666
- };
3667
- const handleSelectPayment = (payment) => {
3668
- setSelectedPayment(payment);
3669
- };
3670
- const handleWithdrawSuccess = () => {
3671
- refresh();
3672
- setCurrentView("main");
3673
- };
3674
- const showBack = currentView !== "main" || selectedPayment !== null;
3675
- const renderContent = () => {
3676
- if (selectedPayment) {
3677
- return /* @__PURE__ */ jsx(PaymentDetailView, { payment: selectedPayment });
3229
+ }, [selectedWallet, connectedAddress, amount, decimals, balance, asset, destinationAddress, onSuccess, t]);
3230
+ const setMaxAmount = useCallback(() => {
3231
+ if (balance !== null) {
3232
+ const formatted = formatUnits(balance, decimals);
3233
+ setAmount(formatted);
3678
3234
  }
3679
- switch (currentView) {
3680
- case "main":
3681
- return /* @__PURE__ */ jsx(
3682
- AccountMainView,
3683
- {
3684
- totalUsd,
3685
- balances,
3686
- isLoading,
3687
- paymentEnabled,
3688
- onNavigate: handleNavigate,
3689
- onLogout: handleLogout,
3690
- isLoggingOut
3691
- }
3692
- );
3693
- case "assets":
3694
- return /* @__PURE__ */ jsx(BalanceDetailView, { balances, isLoading });
3695
- case "withdraw":
3696
- return /* @__PURE__ */ jsx(
3697
- WithdrawView,
3235
+ }, [balance, decimals]);
3236
+ const wallets = getWalletsForDisplay();
3237
+ const isWrongNetwork = currentChainId !== null && currentChainId !== chainId;
3238
+ const formattedBalance = balance !== null ? formatUnits(balance, decimals) : null;
3239
+ if (viewState === "select-wallet") {
3240
+ return /* @__PURE__ */ jsxs("div", { children: [
3241
+ /* @__PURE__ */ jsxs("div", { className: "volr:mb-4", children: [
3242
+ /* @__PURE__ */ jsx("p", { className: "volr:text-xl volr:font-semibold volr:mb-1", children: t("deposit.walletTransfer.title") }),
3243
+ /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-slate-500", children: t("deposit.walletTransfer.selectWallet") })
3244
+ ] }),
3245
+ isDetecting && /* @__PURE__ */ jsxs("div", { className: "volr:text-center volr:py-8", children: [
3246
+ /* @__PURE__ */ jsx("div", { className: "volr:animate-spin volr:w-6 volr:h-6 volr:border-2 volr:border-slate-300 volr:border-t-slate-600 volr:rounded-full volr:mx-auto" }),
3247
+ /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-slate-500 volr:mt-3", children: t("common.loading") })
3248
+ ] }),
3249
+ !isDetecting && !hasWallet && /* @__PURE__ */ jsx("div", { className: "volr:text-center volr:py-8", children: /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-slate-500", children: t("deposit.walletTransfer.noWallets") }) }),
3250
+ !isDetecting && wallets.length > 0 && /* @__PURE__ */ jsx("div", { className: "volr:space-y-2", children: wallets.map((wallet) => /* @__PURE__ */ jsxs(
3251
+ "button",
3252
+ {
3253
+ type: "button",
3254
+ onClick: () => connectWallet(wallet),
3255
+ disabled: isConnecting,
3256
+ className: "volr:w-full volr:flex volr:items-center volr:gap-3 volr:p-3 volr:border volr:border-slate-200 volr:rounded-xl volr:hover:bg-slate-50 volr:transition-colors volr:disabled:opacity-50",
3257
+ children: [
3258
+ /* @__PURE__ */ jsx("div", { className: "volr:w-10 volr:h-10 volr:rounded-lg volr:bg-slate-100 volr:flex volr:items-center volr:justify-center volr:overflow-hidden volr:flex-shrink-0", children: wallet.icon ? /* @__PURE__ */ jsx(
3259
+ "img",
3260
+ {
3261
+ src: wallet.icon,
3262
+ alt: wallet.name,
3263
+ className: "volr:w-7 volr:h-7"
3264
+ }
3265
+ ) : /* @__PURE__ */ jsx("div", { className: "volr:text-slate-400", children: /* @__PURE__ */ jsx(DefaultWalletIcon2, {}) }) }),
3266
+ /* @__PURE__ */ jsx("span", { className: "volr:flex-1 volr:text-left volr:font-medium volr:text-slate-900", children: wallet.name }),
3267
+ /* @__PURE__ */ jsx(
3268
+ "svg",
3269
+ {
3270
+ className: "volr:w-5 volr:h-5 volr:text-slate-400",
3271
+ fill: "none",
3272
+ viewBox: "0 0 24 24",
3273
+ stroke: "currentColor",
3274
+ children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" })
3275
+ }
3276
+ )
3277
+ ]
3278
+ },
3279
+ wallet.id
3280
+ )) }),
3281
+ error && /* @__PURE__ */ jsx("div", { className: "volr:mt-4 volr:p-3 volr:bg-red-50 volr:border volr:border-red-200 volr:rounded-lg", children: /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-red-600", children: error }) }),
3282
+ /* @__PURE__ */ jsx("div", { className: "volr:mt-6 volr:pt-4 volr:border-t volr:border-slate-200", children: /* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: onBack, className: "volr:w-full", children: t("common.back") }) })
3283
+ ] });
3284
+ }
3285
+ return /* @__PURE__ */ jsxs("div", { children: [
3286
+ /* @__PURE__ */ jsxs("div", { className: "volr:mb-4", children: [
3287
+ /* @__PURE__ */ jsx("p", { className: "volr:text-xl volr:font-semibold volr:mb-1", children: t("deposit.walletTransfer.title") }),
3288
+ /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:gap-2", children: [
3289
+ selectedWallet?.icon && /* @__PURE__ */ jsx("img", { src: selectedWallet.icon, alt: "", className: "volr:w-5 volr:h-5 volr:rounded" }),
3290
+ /* @__PURE__ */ jsxs("span", { className: "volr:text-sm volr:text-slate-500", children: [
3291
+ connectedAddress?.slice(0, 6),
3292
+ "...",
3293
+ connectedAddress?.slice(-4)
3294
+ ] })
3295
+ ] })
3296
+ ] }),
3297
+ isWrongNetwork && /* @__PURE__ */ jsxs("div", { className: "volr:mb-4 volr:p-3 volr:bg-amber-50 volr:border volr:border-amber-200 volr:rounded-lg", children: [
3298
+ /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-amber-700 volr:mb-2", children: t("deposit.walletTransfer.wrongNetwork", { network: chainName || `Chain ${chainId}` }) }),
3299
+ /* @__PURE__ */ jsx(
3300
+ Button,
3301
+ {
3302
+ variant: "secondary",
3303
+ size: "sm",
3304
+ onClick: switchNetwork,
3305
+ className: "volr:w-full",
3306
+ children: t("deposit.walletTransfer.switchNetwork")
3307
+ }
3308
+ )
3309
+ ] }),
3310
+ /* @__PURE__ */ jsx("div", { className: "volr:mb-4 volr:p-4 volr:bg-slate-50 volr:rounded-xl volr:border volr:border-slate-200", children: /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:justify-between", children: [
3311
+ /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:gap-2", children: [
3312
+ /* @__PURE__ */ jsx("span", { className: "volr:text-base volr:font-semibold", children: tokenSymbol }),
3313
+ /* @__PURE__ */ jsx("span", { className: "volr:text-xs volr:px-2 volr:py-0.5 volr:rounded-full volr:bg-slate-200 volr:text-slate-600", children: chainName || `Chain ${chainId}` })
3314
+ ] }),
3315
+ /* @__PURE__ */ jsxs("div", { className: "volr:text-right", children: [
3316
+ /* @__PURE__ */ jsx("p", { className: "volr:text-xs volr:text-slate-500", children: t("deposit.walletTransfer.balance") }),
3317
+ /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:font-mono volr:font-medium", children: isWrongNetwork ? "-" : formattedBalance ? `${Number(formattedBalance).toFixed(4)}` : "..." })
3318
+ ] })
3319
+ ] }) }),
3320
+ /* @__PURE__ */ jsxs("div", { className: "volr:mb-4", children: [
3321
+ /* @__PURE__ */ jsx("label", { className: "volr:block volr:text-sm volr:font-medium volr:text-slate-700 volr:mb-2", children: t("deposit.walletTransfer.amount") }),
3322
+ /* @__PURE__ */ jsxs("div", { className: "volr:relative", children: [
3323
+ /* @__PURE__ */ jsx(
3324
+ "input",
3698
3325
  {
3699
- balances,
3700
- connectedWallet: user.authWallet,
3701
- onSuccess: handleWithdrawSuccess
3326
+ type: "text",
3327
+ inputMode: "decimal",
3328
+ value: amount,
3329
+ onChange: (e) => setAmount(e.target.value),
3330
+ placeholder: t("deposit.walletTransfer.amountPlaceholder"),
3331
+ disabled: isWrongNetwork,
3332
+ className: "volr:w-full volr:px-4 volr:py-3 volr:pr-16 volr:border volr:border-slate-300 volr:rounded-xl volr:text-base volr:font-mono volr:focus:outline-none volr:focus:ring-2 volr:focus:ring-slate-300 volr:disabled:bg-slate-100 volr:disabled:text-slate-400"
3702
3333
  }
3703
- );
3704
- case "payments":
3705
- return /* @__PURE__ */ jsx(PaymentHistoryView, { onSelectPayment: handleSelectPayment });
3706
- case "account":
3707
- return /* @__PURE__ */ jsx(AccountInfoView, { user });
3708
- default:
3709
- return null;
3710
- }
3711
- };
3712
- return /* @__PURE__ */ jsxs(Modal, { open: isOpen, onOpenChange: handleOpenChange, children: [
3334
+ ),
3335
+ /* @__PURE__ */ jsx(
3336
+ "button",
3337
+ {
3338
+ type: "button",
3339
+ onClick: setMaxAmount,
3340
+ disabled: isWrongNetwork || balance === null,
3341
+ className: "volr:absolute volr:right-3 volr:top-1/2 volr:-translate-y-1/2 volr:px-2 volr:py-1 volr:text-xs volr:font-semibold volr:text-slate-600 volr:bg-slate-100 volr:rounded volr:hover:bg-slate-200 volr:disabled:opacity-50",
3342
+ children: t("deposit.walletTransfer.max")
3343
+ }
3344
+ )
3345
+ ] })
3346
+ ] }),
3347
+ error && /* @__PURE__ */ jsx("div", { className: "volr:mb-4 volr:p-3 volr:bg-red-50 volr:border volr:border-red-200 volr:rounded-lg", children: /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-red-600", children: error }) }),
3713
3348
  /* @__PURE__ */ jsx(
3714
- ModalHeader,
3349
+ Button,
3715
3350
  {
3716
- back: showBack,
3717
- onBack: showBack ? handleBack : void 0,
3718
- onClose
3351
+ onClick: executeTransfer,
3352
+ disabled: isTransferring || !amount || isWrongNetwork,
3353
+ className: "volr:w-full",
3354
+ children: isTransferring ? t("deposit.walletTransfer.transferring") : t("deposit.walletTransfer.transfer")
3719
3355
  }
3720
3356
  ),
3721
- renderContent()
3357
+ /* @__PURE__ */ jsx("div", { className: "volr:mt-3", children: /* @__PURE__ */ jsx(
3358
+ Button,
3359
+ {
3360
+ variant: "ghost",
3361
+ onClick: () => setViewState("select-wallet"),
3362
+ className: "volr:w-full",
3363
+ children: t("common.back")
3364
+ }
3365
+ ) })
3722
3366
  ] });
3723
3367
  }
3724
- function AssetSelectView({
3725
- assets,
3726
- onSelect
3727
- }) {
3728
- const { t } = useI18n();
3729
- return /* @__PURE__ */ jsxs("div", { children: [
3730
- /* @__PURE__ */ jsx("p", { className: "volr:text-xl volr:font-semibold volr:mb-1", children: t("deposit.selectTitle") }),
3731
- /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:mb-4 volr-text-secondary", children: "Supported token" }),
3732
- /* @__PURE__ */ jsx("div", { className: "volr:space-y-3", children: assets.map((a, idx) => {
3733
- const isNative = a.token === "native";
3734
- const tokenSymbol = isNative ? "ETH" : a.token.symbol;
3735
- const tokenName = isNative ? "Ethereum" : a.token.symbol;
3736
- return /* @__PURE__ */ jsxs(
3737
- "button",
3368
+ var DepositQRStatusOverlay = ({
3369
+ status
3370
+ }) => {
3371
+ if (status !== "detected") return null;
3372
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
3373
+ /* @__PURE__ */ jsx(
3374
+ "div",
3375
+ {
3376
+ className: "volr:absolute volr:inset-0 volr:rounded-2xl volr:pointer-events-none",
3377
+ style: {
3378
+ boxShadow: "0 0 0 4px rgba(16, 185, 129, 0.3), 0 0 30px rgba(16, 185, 129, 0.4)",
3379
+ animation: "volrPulseGlow 1.5s ease-out infinite"
3380
+ }
3381
+ }
3382
+ ),
3383
+ /* @__PURE__ */ jsxs("div", { className: "volr:absolute volr:inset-0 volr:overflow-visible volr:pointer-events-none volr:-z-10", children: [
3384
+ /* @__PURE__ */ jsx(
3385
+ "div",
3738
3386
  {
3739
- className: cn(
3740
- "volr:w-full volr:p-4 volr:rounded-xl volr:border-2",
3741
- "volr:text-left volr:transition-all",
3742
- "volr:flex volr:items-center volr:gap-4",
3743
- "volr-border volr-hover"
3744
- ),
3745
- onClick: () => onSelect(idx),
3746
- children: [
3747
- /* @__PURE__ */ jsx("div", { className: "volr:shrink-0", children: !isNative && a.token.iconUrl ? /* @__PURE__ */ jsx(
3748
- "img",
3749
- {
3750
- alt: a.token.symbol,
3751
- src: a.token.iconUrl,
3752
- className: "volr:w-10 volr:h-10 volr:rounded-full volr:border volr-border"
3753
- }
3754
- ) : /* @__PURE__ */ jsx("div", { className: "volr:w-10 volr:h-10 volr:rounded-full volr:flex volr:items-center volr:justify-center volr:text-white volr:font-bold volr:text-sm volr-bg-tertiary", children: tokenSymbol.slice(0, 2) }) }),
3755
- /* @__PURE__ */ jsxs("div", { className: "volr:flex-1 volr:min-w-0", children: [
3756
- /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:gap-2 volr:mb-1", children: [
3757
- /* @__PURE__ */ jsx("span", { className: "volr:text-base volr:font-semibold", children: tokenSymbol }),
3758
- /* @__PURE__ */ jsxs("span", { className: "volr:text-xs volr:px-2 volr:py-0.5 volr:rounded-full volr:font-medium volr-bg-secondary volr-text-secondary", children: [
3759
- "Chain ",
3760
- a.chainId
3761
- ] })
3762
- ] }),
3763
- /* @__PURE__ */ jsx("div", { className: "volr:text-sm volr-text-secondary", children: tokenName }),
3764
- !isNative && /* @__PURE__ */ jsx("div", { className: "volr:text-xs volr:font-mono volr:truncate volr:mt-1 volr-text-muted", children: a.token.address })
3765
- ] }),
3766
- /* @__PURE__ */ jsx("div", { className: "volr:shrink-0 volr-text-muted", children: /* @__PURE__ */ jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("polyline", { points: "9 18 15 12 9 6" }) }) })
3767
- ]
3387
+ className: "volr:absolute volr:w-48 volr:h-48 volr:rounded-full volr:opacity-0",
3388
+ style: {
3389
+ background: "radial-gradient(circle, rgba(16,185,129,0.7) 0%, rgba(16,185,129,0) 60%)",
3390
+ filter: "blur(50px)",
3391
+ top: "5%",
3392
+ left: "0%",
3393
+ animation: "volrGlowPulse 1.8s ease-out forwards"
3394
+ }
3395
+ }
3396
+ ),
3397
+ /* @__PURE__ */ jsx(
3398
+ "div",
3399
+ {
3400
+ className: "volr:absolute volr:w-44 volr:h-44 volr:rounded-full volr:opacity-0",
3401
+ style: {
3402
+ background: "radial-gradient(circle, rgba(6,182,212,0.65) 0%, rgba(6,182,212,0) 60%)",
3403
+ filter: "blur(45px)",
3404
+ bottom: "10%",
3405
+ right: "-5%",
3406
+ animation: "volrGlowPulse 2s ease-out 0.1s forwards"
3407
+ }
3408
+ }
3409
+ ),
3410
+ /* @__PURE__ */ jsx(
3411
+ "div",
3412
+ {
3413
+ className: "volr:absolute volr:w-40 volr:h-40 volr:rounded-full volr:opacity-0",
3414
+ style: {
3415
+ background: "radial-gradient(circle, rgba(20,184,166,0.6) 0%, rgba(20,184,166,0) 60%)",
3416
+ filter: "blur(40px)",
3417
+ top: "50%",
3418
+ left: "50%",
3419
+ transform: "translateX(-50%)",
3420
+ animation: "volrGlowPulse 2.2s ease-out 0.2s forwards"
3421
+ }
3422
+ }
3423
+ )
3424
+ ] }),
3425
+ /* @__PURE__ */ jsx(
3426
+ "div",
3427
+ {
3428
+ className: "volr:absolute volr:-top-3 volr:-right-3 volr:rounded-full volr:p-3 volr:bg-linear-to-br volr:from-emerald-400 volr:to-teal-500 volr:shadow-2xl volr:shadow-emerald-500/50 volr:border-4 volr:border-white volr:z-20",
3429
+ style: {
3430
+ animation: "volrBounceIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards"
3768
3431
  },
3769
- `${a.chainId}-${idx}`
3770
- );
3771
- }) })
3772
- ] });
3773
- }
3774
- var TextLinkButton = React13.forwardRef(({ showArrow = false, className, children, ...props }, ref) => {
3775
- return /* @__PURE__ */ jsxs(
3776
- "button",
3777
- {
3778
- ref,
3779
- type: "button",
3780
- className: cn(
3781
- "volr:underline volr:transition-colors volr-text-secondary",
3782
- className
3432
+ children: /* @__PURE__ */ jsx(
3433
+ "svg",
3434
+ {
3435
+ width: "20",
3436
+ height: "20",
3437
+ viewBox: "0 0 24 24",
3438
+ fill: "none",
3439
+ stroke: "white",
3440
+ strokeWidth: "3",
3441
+ strokeLinecap: "round",
3442
+ strokeLinejoin: "round",
3443
+ children: /* @__PURE__ */ jsx("polyline", { points: "20 6 9 17 4 12" })
3444
+ }
3445
+ )
3446
+ }
3447
+ ),
3448
+ /* @__PURE__ */ jsxs("div", { className: "volr:absolute volr:inset-0 volr:pointer-events-none volr:overflow-visible", children: [
3449
+ /* @__PURE__ */ jsx(
3450
+ "div",
3451
+ {
3452
+ className: "volr:absolute volr:w-2 volr:h-2 volr:bg-emerald-400 volr:rounded-full volr:opacity-0",
3453
+ style: {
3454
+ top: "20%",
3455
+ left: "20%",
3456
+ animation: "volrParticle1 1s ease-out forwards"
3457
+ }
3458
+ }
3783
3459
  ),
3784
- ...props,
3785
- children: [
3786
- children,
3787
- showArrow && " \u2192"
3788
- ]
3789
- }
3790
- );
3791
- });
3792
- TextLinkButton.displayName = "TextLinkButton";
3793
- var OtherTokenModal = ({
3794
- open,
3795
- onOpenChange
3796
- }) => {
3797
- return /* @__PURE__ */ jsxs(Modal, { open, onOpenChange, children: [
3798
- /* @__PURE__ */ jsx(ModalHeader, { onClose: () => onOpenChange(false) }),
3799
- /* @__PURE__ */ jsxs("div", { className: "volr:text-center", children: [
3800
- /* @__PURE__ */ jsx("p", { className: "volr:text-lg volr:font-semibold volr:mb-2", children: "Coming Soon" }),
3801
- /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr-text-secondary", children: "Swap and bridge recommendations will be available here soon." })
3802
- ] })
3803
- ] });
3804
- };
3805
-
3806
- // ../node_modules/viem/_esm/errors/unit.js
3807
- init_base();
3808
- var InvalidDecimalNumberError = class extends BaseError {
3809
- constructor({ value }) {
3810
- super(`Number \`${value}\` is not a valid decimal number.`, {
3811
- name: "InvalidDecimalNumberError"
3812
- });
3813
- }
3814
- };
3815
-
3816
- // ../node_modules/viem/_esm/utils/unit/parseUnits.js
3817
- function parseUnits(value, decimals) {
3818
- if (!/^(-?)([0-9]*)\.?([0-9]*)$/.test(value))
3819
- throw new InvalidDecimalNumberError({ value });
3820
- let [integer, fraction = "0"] = value.split(".");
3821
- const negative = integer.startsWith("-");
3822
- if (negative)
3823
- integer = integer.slice(1);
3824
- fraction = fraction.replace(/(0+)$/, "");
3825
- if (decimals === 0) {
3826
- if (Math.round(Number(`.${fraction}`)) === 1)
3827
- integer = `${BigInt(integer) + 1n}`;
3828
- fraction = "";
3829
- } else if (fraction.length > decimals) {
3830
- const [left, unit, right] = [
3831
- fraction.slice(0, decimals - 1),
3832
- fraction.slice(decimals - 1, decimals),
3833
- fraction.slice(decimals)
3834
- ];
3835
- const rounded = Math.round(Number(`${unit}.${right}`));
3836
- if (rounded > 9)
3837
- fraction = `${BigInt(left) + BigInt(1)}0`.padStart(left.length + 1, "0");
3838
- else
3839
- fraction = `${left}${rounded}`;
3840
- if (fraction.length > decimals) {
3841
- fraction = fraction.slice(1);
3842
- integer = `${BigInt(integer) + 1n}`;
3843
- }
3844
- fraction = fraction.slice(0, decimals);
3845
- } else {
3846
- fraction = fraction.padEnd(decimals, "0");
3847
- }
3848
- return BigInt(`${negative ? "-" : ""}${integer}${fraction}`);
3849
- }
3850
-
3851
- // ../node_modules/viem/_esm/index.js
3852
- init_abis();
3853
- init_formatUnits();
3854
- var DefaultWalletIcon2 = () => /* @__PURE__ */ jsxs(
3855
- "svg",
3856
- {
3857
- className: "volr:w-6 volr:h-6",
3858
- viewBox: "0 0 24 24",
3859
- fill: "none",
3860
- xmlns: "http://www.w3.org/2000/svg",
3861
- children: [
3862
3460
  /* @__PURE__ */ jsx(
3863
- "rect",
3461
+ "div",
3864
3462
  {
3865
- x: "2",
3866
- y: "6",
3867
- width: "20",
3868
- height: "14",
3869
- rx: "2",
3870
- stroke: "currentColor",
3871
- strokeWidth: "1.5"
3463
+ className: "volr:absolute volr:w-1.5 volr:h-1.5 volr:bg-cyan-400 volr:rounded-full volr:opacity-0",
3464
+ style: {
3465
+ top: "30%",
3466
+ right: "25%",
3467
+ animation: "volrParticle2 1.2s ease-out 0.1s forwards"
3468
+ }
3872
3469
  }
3873
3470
  ),
3874
3471
  /* @__PURE__ */ jsx(
3875
- "path",
3472
+ "div",
3876
3473
  {
3877
- d: "M17 12.5C17 13.3284 16.3284 14 15.5 14C14.6716 14 14 13.3284 14 12.5C14 11.6716 14.6716 11 15.5 11C16.3284 11 17 11.6716 17 12.5Z",
3878
- fill: "currentColor"
3474
+ className: "volr:absolute volr:w-2 volr:h-2 volr:bg-teal-400 volr:rounded-full volr:opacity-0",
3475
+ style: {
3476
+ bottom: "25%",
3477
+ left: "30%",
3478
+ animation: "volrParticle3 1.1s ease-out 0.2s forwards"
3479
+ }
3879
3480
  }
3880
3481
  ),
3881
3482
  /* @__PURE__ */ jsx(
3882
- "path",
3483
+ "div",
3883
3484
  {
3884
- d: "M6 6V5C6 3.89543 6.89543 3 8 3H16C17.1046 3 18 3.89543 18 5V6",
3885
- stroke: "currentColor",
3886
- strokeWidth: "1.5"
3485
+ className: "volr:absolute volr:w-1.5 volr:h-1.5 volr:bg-emerald-300 volr:rounded-full volr:opacity-0",
3486
+ style: {
3487
+ bottom: "30%",
3488
+ right: "20%",
3489
+ animation: "volrParticle4 1.3s ease-out 0.15s forwards"
3490
+ }
3887
3491
  }
3888
3492
  )
3889
- ]
3890
- }
3891
- );
3892
- function WalletTransferView({
3893
- chainId,
3894
- asset,
3895
- destinationAddress,
3896
- onBack,
3897
- onSuccess
3898
- }) {
3493
+ ] }),
3494
+ /* @__PURE__ */ jsx("style", { children: `
3495
+ @keyframes volrGlowPulse {
3496
+ 0% {
3497
+ transform: scale(0.5);
3498
+ opacity: 0;
3499
+ }
3500
+ 40% {
3501
+ opacity: 1;
3502
+ }
3503
+ 100% {
3504
+ transform: scale(1.6);
3505
+ opacity: 0;
3506
+ }
3507
+ }
3508
+ @keyframes volrBounceIn {
3509
+ 0% {
3510
+ transform: scale(0);
3511
+ opacity: 0;
3512
+ }
3513
+ 50% {
3514
+ transform: scale(1.2);
3515
+ }
3516
+ 70% {
3517
+ transform: scale(0.9);
3518
+ }
3519
+ 100% {
3520
+ transform: scale(1);
3521
+ opacity: 1;
3522
+ }
3523
+ }
3524
+ @keyframes volrPulseGlow {
3525
+ 0%, 100% {
3526
+ opacity: 0.6;
3527
+ }
3528
+ 50% {
3529
+ opacity: 1;
3530
+ }
3531
+ }
3532
+ @keyframes volrParticle1 {
3533
+ 0% {
3534
+ transform: translate(0, 0) scale(0);
3535
+ opacity: 0;
3536
+ }
3537
+ 20% {
3538
+ opacity: 1;
3539
+ }
3540
+ 100% {
3541
+ transform: translate(-20px, -30px) scale(1);
3542
+ opacity: 0;
3543
+ }
3544
+ }
3545
+ @keyframes volrParticle2 {
3546
+ 0% {
3547
+ transform: translate(0, 0) scale(0);
3548
+ opacity: 0;
3549
+ }
3550
+ 20% {
3551
+ opacity: 1;
3552
+ }
3553
+ 100% {
3554
+ transform: translate(25px, -35px) scale(1);
3555
+ opacity: 0;
3556
+ }
3557
+ }
3558
+ @keyframes volrParticle3 {
3559
+ 0% {
3560
+ transform: translate(0, 0) scale(0);
3561
+ opacity: 0;
3562
+ }
3563
+ 20% {
3564
+ opacity: 1;
3565
+ }
3566
+ 100% {
3567
+ transform: translate(-30px, 25px) scale(1);
3568
+ opacity: 0;
3569
+ }
3570
+ }
3571
+ @keyframes volrParticle4 {
3572
+ 0% {
3573
+ transform: translate(0, 0) scale(0);
3574
+ opacity: 0;
3575
+ }
3576
+ 20% {
3577
+ opacity: 1;
3578
+ }
3579
+ 100% {
3580
+ transform: translate(30px, 30px) scale(1);
3581
+ opacity: 0;
3582
+ }
3583
+ }
3584
+ ` })
3585
+ ] });
3586
+ };
3587
+ var DepositCompletedToast = ({
3588
+ onClose,
3589
+ previousBalance,
3590
+ newBalance,
3591
+ delta,
3592
+ decimals,
3593
+ symbol
3594
+ }) => {
3595
+ const { t } = useI18n();
3596
+ const [expanded, setExpanded] = useState(false);
3597
+ const formatAmount = (amount) => {
3598
+ const divisor = BigInt(10 ** decimals);
3599
+ const whole = amount / divisor;
3600
+ const fraction = amount % divisor;
3601
+ const fractionStr = fraction.toString().padStart(decimals, "0").slice(0, 4);
3602
+ const trimmedFraction = fractionStr.replace(/0+$/, "");
3603
+ return trimmedFraction ? `${whole}.${trimmedFraction}` : `${whole}`;
3604
+ };
3605
+ const formattedDelta = formatAmount(delta);
3606
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
3607
+ /* @__PURE__ */ jsxs(
3608
+ "div",
3609
+ {
3610
+ className: cn(
3611
+ // Position: anchored to bottom, full width
3612
+ "volr:absolute volr:bottom-0 volr:left-0 volr:right-0 volr:z-50",
3613
+ // Appearance: floating card with rounded top
3614
+ "volr:bg-white volr:rounded-t-2xl",
3615
+ // Animation
3616
+ "volr:transition-all volr:duration-300 volr:ease-out"
3617
+ ),
3618
+ style: {
3619
+ animation: "volrSlideUp 0.3s ease-out",
3620
+ // Strong elevation shadow (upward direction)
3621
+ boxShadow: "0 -8px 30px rgba(0, 0, 0, 0.15), 0 -2px 10px rgba(0, 0, 0, 0.08)"
3622
+ },
3623
+ children: [
3624
+ /* @__PURE__ */ jsx("div", { className: "volr:h-1 volr:bg-linear-to-r volr:from-emerald-400 volr:to-teal-500 volr:rounded-t-2xl" }),
3625
+ /* @__PURE__ */ jsxs("div", { className: "volr:p-4", children: [
3626
+ /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:justify-between volr:gap-2 volr:mb-2", children: [
3627
+ /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:gap-2", children: [
3628
+ /* @__PURE__ */ jsx("div", { className: "volr:shrink-0 volr:w-5 volr:h-5 volr:rounded-full volr:bg-emerald-500 volr:flex volr:items-center volr:justify-center", children: /* @__PURE__ */ jsx(
3629
+ "svg",
3630
+ {
3631
+ width: "12",
3632
+ height: "12",
3633
+ viewBox: "0 0 24 24",
3634
+ fill: "none",
3635
+ stroke: "white",
3636
+ strokeWidth: "3",
3637
+ strokeLinecap: "round",
3638
+ strokeLinejoin: "round",
3639
+ children: /* @__PURE__ */ jsx("polyline", { points: "20 6 9 17 4 12" })
3640
+ }
3641
+ ) }),
3642
+ /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:font-semibold volr:text-slate-900", children: t("deposit.completed") })
3643
+ ] }),
3644
+ /* @__PURE__ */ jsx(
3645
+ "button",
3646
+ {
3647
+ onClick: onClose,
3648
+ className: "volr:shrink-0 volr:w-6 volr:h-6 volr:flex volr:items-center volr:justify-center volr:rounded-full volr:transition-colors volr:bg-slate-100 volr:text-slate-500 volr:hover:bg-slate-200",
3649
+ "aria-label": "Close",
3650
+ children: /* @__PURE__ */ jsxs(
3651
+ "svg",
3652
+ {
3653
+ width: "14",
3654
+ height: "14",
3655
+ viewBox: "0 0 24 24",
3656
+ fill: "none",
3657
+ stroke: "currentColor",
3658
+ strokeWidth: "2.5",
3659
+ children: [
3660
+ /* @__PURE__ */ jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
3661
+ /* @__PURE__ */ jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
3662
+ ]
3663
+ }
3664
+ )
3665
+ }
3666
+ )
3667
+ ] }),
3668
+ /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-slate-700 volr:mb-3", children: t("deposit.completedAmount", { amount: formattedDelta, symbol }) }),
3669
+ expanded && /* @__PURE__ */ jsxs(
3670
+ "div",
3671
+ {
3672
+ className: "volr:space-y-2 volr:mb-3 volr:p-3 volr:rounded-lg volr:bg-slate-50 volr:border volr:border-slate-200",
3673
+ style: { animation: "volrFadeIn 0.2s ease-out" },
3674
+ children: [
3675
+ /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:justify-between volr:text-xs", children: [
3676
+ /* @__PURE__ */ jsx("span", { className: "volr:text-slate-500", children: t("deposit.amount") }),
3677
+ /* @__PURE__ */ jsxs("span", { className: "volr:font-mono volr:text-emerald-600 volr:font-semibold", children: [
3678
+ "+",
3679
+ formattedDelta,
3680
+ " ",
3681
+ symbol
3682
+ ] })
3683
+ ] }),
3684
+ /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:justify-between volr:text-xs", children: [
3685
+ /* @__PURE__ */ jsx("span", { className: "volr:text-slate-500", children: t("deposit.previousBalance") }),
3686
+ /* @__PURE__ */ jsxs("span", { className: "volr:font-mono volr:text-slate-500", children: [
3687
+ formatAmount(previousBalance),
3688
+ " ",
3689
+ symbol
3690
+ ] })
3691
+ ] }),
3692
+ /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:justify-between volr:text-xs volr:pt-2 volr:border-t volr:border-slate-200", children: [
3693
+ /* @__PURE__ */ jsx("span", { className: "volr:text-slate-500", children: t("deposit.newBalance") }),
3694
+ /* @__PURE__ */ jsxs("span", { className: "volr:font-mono volr:font-semibold volr:text-slate-900", children: [
3695
+ formatAmount(newBalance),
3696
+ " ",
3697
+ symbol
3698
+ ] })
3699
+ ] })
3700
+ ]
3701
+ }
3702
+ ),
3703
+ /* @__PURE__ */ jsx(
3704
+ "button",
3705
+ {
3706
+ onClick: () => setExpanded(!expanded),
3707
+ className: "volr:w-full volr:py-2.5 volr:text-xs volr:font-medium volr:rounded-lg volr:transition-colors volr:bg-slate-100 volr:text-slate-600 volr:border volr:border-slate-200 volr:hover:bg-slate-200",
3708
+ children: expanded ? t("deposit.seeLess") : t("deposit.seeMore")
3709
+ }
3710
+ )
3711
+ ] })
3712
+ ]
3713
+ }
3714
+ ),
3715
+ /* @__PURE__ */ jsx("style", { children: `
3716
+ @keyframes volrSlideUp {
3717
+ from {
3718
+ transform: translateY(20px);
3719
+ opacity: 0;
3720
+ }
3721
+ to {
3722
+ transform: translateY(0);
3723
+ opacity: 1;
3724
+ }
3725
+ }
3726
+ @keyframes volrFadeIn {
3727
+ from {
3728
+ opacity: 0;
3729
+ }
3730
+ to {
3731
+ opacity: 1;
3732
+ }
3733
+ }
3734
+ ` })
3735
+ ] });
3736
+ };
3737
+ var DepositSkeleton = () => {
3738
+ return /* @__PURE__ */ jsxs("div", { className: "volr:animate-pulse", children: [
3739
+ /* @__PURE__ */ jsxs("div", { className: "volr:mb-4", children: [
3740
+ /* @__PURE__ */ jsx("div", { className: "volr:h-7 volr:w-24 volr:rounded volr:mb-2 volr-bg-tertiary" }),
3741
+ /* @__PURE__ */ jsx("div", { className: "volr:h-8 volr:w-36 volr:rounded-lg volr-bg-secondary" })
3742
+ ] }),
3743
+ /* @__PURE__ */ jsx("div", { className: "volr:flex volr:justify-center volr:mb-3", children: /* @__PURE__ */ jsx("div", { className: "volr:rounded-xl volr:p-3 volr:border volr-bg-secondary volr-border", children: /* @__PURE__ */ jsx("div", { className: "volr:w-[200px] volr:h-[200px] volr:rounded-lg volr-bg-tertiary" }) }) }),
3744
+ /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:justify-center volr:gap-2 volr:mb-3", children: [
3745
+ /* @__PURE__ */ jsx("div", { className: "volr:w-1.5 volr:h-1.5 volr:rounded-full volr-bg-tertiary" }),
3746
+ /* @__PURE__ */ jsx("div", { className: "volr:h-3 volr:w-32 volr:rounded volr-bg-tertiary" })
3747
+ ] }),
3748
+ /* @__PURE__ */ jsx("div", { className: "volr:space-y-3", children: /* @__PURE__ */ jsx("div", { className: "volr:border volr:rounded-lg volr:p-3 volr-bg-secondary volr-border", children: /* @__PURE__ */ jsx("div", { className: "volr:flex volr:items-center volr:justify-center", children: /* @__PURE__ */ jsx("div", { className: "volr:h-4 volr:w-48 volr:rounded volr-bg-tertiary" }) }) }) }),
3749
+ /* @__PURE__ */ jsx("div", { className: "volr:text-center volr:pt-3 volr:border-t volr:mt-3 volr-border", children: /* @__PURE__ */ jsx("div", { className: "volr:h-3 volr:w-44 volr:rounded volr:mx-auto volr-bg-secondary" }) })
3750
+ ] });
3751
+ };
3752
+ function DepositQRView(props) {
3899
3753
  const { t } = useI18n();
3900
3754
  const { config } = useVolrContext();
3901
3755
  const { client } = useInternalAuth();
3902
- const { isDetecting, getWalletsForDisplay, hasWallet } = useEIP6963();
3903
- const [viewState, setViewState] = useState("select-wallet");
3904
- const [selectedWallet, setSelectedWallet] = useState(null);
3905
- const [connectedAddress, setConnectedAddress] = useState(null);
3906
- const [balance, setBalance] = useState(null);
3907
- const [amount, setAmount] = useState("");
3908
- const [isConnecting, setIsConnecting] = useState(false);
3909
- const [isTransferring, setIsTransferring] = useState(false);
3910
- const [error, setError] = useState(null);
3911
3756
  const [chainName, setChainName] = useState(null);
3912
- const [currentChainId, setCurrentChainId] = useState(null);
3913
- const tokenSymbol = asset === "native" ? "ETH" : asset.symbol;
3914
- const decimals = asset === "native" ? 18 : asset.decimals;
3757
+ const [showOtherTokenModal, setShowOtherTokenModal] = useState(false);
3758
+ const [showToast, setShowToast] = useState(false);
3759
+ const [toastData, setToastData] = useState(null);
3760
+ const [viewMode, setViewMode] = useState("qr");
3761
+ const eip681 = `ethereum:${props.address}`;
3762
+ const status = useDepositListener({
3763
+ chainId: props.chainId,
3764
+ asset: props.asset === "native" ? { kind: "native" } : {
3765
+ kind: "erc20",
3766
+ token: {
3767
+ address: props.asset.address,
3768
+ decimals: props.asset.decimals
3769
+ }
3770
+ },
3771
+ address: props.address
3772
+ });
3773
+ useEffect(() => {
3774
+ if (status.state === "detected") {
3775
+ setToastData({
3776
+ previousBalance: status.previousBalance,
3777
+ newBalance: status.newBalance,
3778
+ delta: status.delta
3779
+ });
3780
+ setShowToast(true);
3781
+ }
3782
+ }, [status]);
3915
3783
  const getNetworkInfo = useCallback(
3916
3784
  createGetNetworkInfo({ client, rpcOverrides: config.rpcOverrides }),
3917
3785
  [client, config.rpcOverrides]
@@ -3920,930 +3788,1124 @@ function WalletTransferView({
3920
3788
  let cancelled = false;
3921
3789
  const loadChainName = async () => {
3922
3790
  try {
3923
- const info = await getNetworkInfo(chainId, false);
3924
- if (!cancelled) setChainName(info.name);
3925
- } catch {
3926
- if (!cancelled) setChainName(`Chain ${chainId}`);
3791
+ const info = await getNetworkInfo(props.chainId, false);
3792
+ if (!cancelled) {
3793
+ setChainName(info.name);
3794
+ }
3795
+ } catch (error) {
3796
+ if (!cancelled) {
3797
+ setChainName(`Chain ${props.chainId}`);
3798
+ }
3927
3799
  }
3928
3800
  };
3929
3801
  loadChainName();
3930
3802
  return () => {
3931
3803
  cancelled = true;
3932
3804
  };
3933
- }, [getNetworkInfo, chainId]);
3934
- const connectWallet = useCallback(async (wallet) => {
3935
- setIsConnecting(true);
3936
- setError(null);
3937
- try {
3938
- const provider = wallet.provider;
3939
- const accounts = await provider.request({ method: "eth_requestAccounts" });
3940
- if (!accounts || accounts.length === 0) {
3941
- throw new Error("No accounts found");
3942
- }
3943
- const address = accounts[0];
3944
- setConnectedAddress(address);
3945
- setSelectedWallet(wallet);
3946
- const chainIdHex = await provider.request({ method: "eth_chainId" });
3947
- const currentChain = parseInt(chainIdHex, 16);
3948
- setCurrentChainId(currentChain);
3949
- await fetchBalance(provider, address, currentChain);
3950
- setViewState("transfer");
3951
- } catch (err) {
3952
- console.error("Failed to connect wallet:", err);
3953
- setError(err instanceof Error ? err.message : "Connection failed");
3954
- } finally {
3955
- setIsConnecting(false);
3956
- }
3957
- }, [chainId, asset]);
3958
- const fetchBalance = useCallback(async (provider, address, currentChain) => {
3959
- try {
3960
- if (currentChain !== chainId) {
3961
- setBalance(null);
3962
- return;
3963
- }
3964
- if (asset === "native") {
3965
- const balanceHex = await provider.request({
3966
- method: "eth_getBalance",
3967
- params: [address, "latest"]
3968
- });
3969
- setBalance(BigInt(balanceHex));
3970
- } else {
3971
- const data = `0x70a08231000000000000000000000000${address.slice(2)}`;
3972
- const result = await provider.request({
3973
- method: "eth_call",
3974
- params: [{ to: asset.address, data }, "latest"]
3975
- });
3976
- setBalance(BigInt(result));
3977
- }
3978
- } catch (err) {
3979
- console.error("Failed to fetch balance:", err);
3980
- setBalance(BigInt(0));
3981
- }
3982
- }, [chainId, asset]);
3983
- const switchNetwork = useCallback(async () => {
3984
- if (!selectedWallet?.provider) return;
3985
- try {
3986
- await selectedWallet.provider.request({
3987
- method: "wallet_switchEthereumChain",
3988
- params: [{ chainId: `0x${chainId.toString(16)}` }]
3989
- });
3990
- const chainIdHex = await selectedWallet.provider.request({ method: "eth_chainId" });
3991
- const currentChain = parseInt(chainIdHex, 16);
3992
- setCurrentChainId(currentChain);
3993
- if (connectedAddress) {
3994
- await fetchBalance(selectedWallet.provider, connectedAddress, currentChain);
3995
- }
3996
- } catch (err) {
3997
- console.error("Failed to switch network:", err);
3998
- setError(err instanceof Error ? err.message : "Failed to switch network");
3999
- }
4000
- }, [selectedWallet, chainId, connectedAddress, fetchBalance]);
4001
- const executeTransfer = useCallback(async () => {
4002
- if (!selectedWallet?.provider || !connectedAddress || !amount) return;
4003
- setIsTransferring(true);
4004
- setError(null);
4005
- try {
4006
- const amountWei = parseUnits(amount, decimals);
4007
- if (balance !== null && amountWei > balance) {
4008
- setError(t("deposit.walletTransfer.insufficientBalance"));
4009
- setIsTransferring(false);
4010
- return;
4011
- }
4012
- let txHash;
4013
- if (asset === "native") {
4014
- txHash = await selectedWallet.provider.request({
4015
- method: "eth_sendTransaction",
4016
- params: [{
4017
- from: connectedAddress,
4018
- to: destinationAddress,
4019
- value: `0x${amountWei.toString(16)}`
4020
- }]
4021
- });
4022
- } else {
4023
- const paddedTo = destinationAddress.slice(2).padStart(64, "0");
4024
- const paddedAmount = amountWei.toString(16).padStart(64, "0");
4025
- const data = `0xa9059cbb${paddedTo}${paddedAmount}`;
4026
- txHash = await selectedWallet.provider.request({
4027
- method: "eth_sendTransaction",
4028
- params: [{
4029
- from: connectedAddress,
4030
- to: asset.address,
4031
- data
4032
- }]
4033
- });
4034
- }
4035
- console.log("Transfer tx hash:", txHash);
4036
- onSuccess?.();
4037
- } catch (err) {
4038
- console.error("Transfer failed:", err);
4039
- setError(err instanceof Error ? err.message : "Transfer failed");
4040
- } finally {
4041
- setIsTransferring(false);
4042
- }
4043
- }, [selectedWallet, connectedAddress, amount, decimals, balance, asset, destinationAddress, onSuccess, t]);
4044
- const setMaxAmount = useCallback(() => {
4045
- if (balance !== null) {
4046
- const formatted = formatUnits(balance, decimals);
4047
- setAmount(formatted);
4048
- }
4049
- }, [balance, decimals]);
4050
- const wallets = getWalletsForDisplay();
4051
- const isWrongNetwork = currentChainId !== null && currentChainId !== chainId;
4052
- const formattedBalance = balance !== null ? formatUnits(balance, decimals) : null;
4053
- if (viewState === "select-wallet") {
4054
- return /* @__PURE__ */ jsxs("div", { children: [
4055
- /* @__PURE__ */ jsxs("div", { className: "volr:mb-4", children: [
4056
- /* @__PURE__ */ jsx("p", { className: "volr:text-xl volr:font-semibold volr:mb-1", children: t("deposit.walletTransfer.title") }),
4057
- /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-slate-500", children: t("deposit.walletTransfer.selectWallet") })
4058
- ] }),
4059
- isDetecting && /* @__PURE__ */ jsxs("div", { className: "volr:text-center volr:py-8", children: [
4060
- /* @__PURE__ */ jsx("div", { className: "volr:animate-spin volr:w-6 volr:h-6 volr:border-2 volr:border-slate-300 volr:border-t-slate-600 volr:rounded-full volr:mx-auto" }),
4061
- /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-slate-500 volr:mt-3", children: t("common.loading") })
4062
- ] }),
4063
- !isDetecting && !hasWallet && /* @__PURE__ */ jsx("div", { className: "volr:text-center volr:py-8", children: /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-slate-500", children: t("deposit.walletTransfer.noWallets") }) }),
4064
- !isDetecting && wallets.length > 0 && /* @__PURE__ */ jsx("div", { className: "volr:space-y-2", children: wallets.map((wallet) => /* @__PURE__ */ jsxs(
4065
- "button",
4066
- {
4067
- type: "button",
4068
- onClick: () => connectWallet(wallet),
4069
- disabled: isConnecting,
4070
- className: "volr:w-full volr:flex volr:items-center volr:gap-3 volr:p-3 volr:border volr:border-slate-200 volr:rounded-xl volr:hover:bg-slate-50 volr:transition-colors volr:disabled:opacity-50",
4071
- children: [
4072
- /* @__PURE__ */ jsx("div", { className: "volr:w-10 volr:h-10 volr:rounded-lg volr:bg-slate-100 volr:flex volr:items-center volr:justify-center volr:overflow-hidden volr:flex-shrink-0", children: wallet.icon ? /* @__PURE__ */ jsx(
4073
- "img",
4074
- {
4075
- src: wallet.icon,
4076
- alt: wallet.name,
4077
- className: "volr:w-7 volr:h-7"
4078
- }
4079
- ) : /* @__PURE__ */ jsx("div", { className: "volr:text-slate-400", children: /* @__PURE__ */ jsx(DefaultWalletIcon2, {}) }) }),
4080
- /* @__PURE__ */ jsx("span", { className: "volr:flex-1 volr:text-left volr:font-medium volr:text-slate-900", children: wallet.name }),
4081
- /* @__PURE__ */ jsx(
4082
- "svg",
4083
- {
4084
- className: "volr:w-5 volr:h-5 volr:text-slate-400",
4085
- fill: "none",
4086
- viewBox: "0 0 24 24",
4087
- stroke: "currentColor",
4088
- children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" })
4089
- }
4090
- )
4091
- ]
4092
- },
4093
- wallet.id
4094
- )) }),
4095
- error && /* @__PURE__ */ jsx("div", { className: "volr:mt-4 volr:p-3 volr:bg-red-50 volr:border volr:border-red-200 volr:rounded-lg", children: /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-red-600", children: error }) }),
4096
- /* @__PURE__ */ jsx("div", { className: "volr:mt-6 volr:pt-4 volr:border-t volr:border-slate-200", children: /* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: onBack, className: "volr:w-full", children: t("common.back") }) })
4097
- ] });
4098
- }
4099
- return /* @__PURE__ */ jsxs("div", { children: [
4100
- /* @__PURE__ */ jsxs("div", { className: "volr:mb-4", children: [
4101
- /* @__PURE__ */ jsx("p", { className: "volr:text-xl volr:font-semibold volr:mb-1", children: t("deposit.walletTransfer.title") }),
4102
- /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:gap-2", children: [
4103
- selectedWallet?.icon && /* @__PURE__ */ jsx("img", { src: selectedWallet.icon, alt: "", className: "volr:w-5 volr:h-5 volr:rounded" }),
4104
- /* @__PURE__ */ jsxs("span", { className: "volr:text-sm volr:text-slate-500", children: [
4105
- connectedAddress?.slice(0, 6),
4106
- "...",
4107
- connectedAddress?.slice(-4)
4108
- ] })
4109
- ] })
4110
- ] }),
4111
- isWrongNetwork && /* @__PURE__ */ jsxs("div", { className: "volr:mb-4 volr:p-3 volr:bg-amber-50 volr:border volr:border-amber-200 volr:rounded-lg", children: [
4112
- /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-amber-700 volr:mb-2", children: t("deposit.walletTransfer.wrongNetwork", { network: chainName || `Chain ${chainId}` }) }),
3805
+ }, [getNetworkInfo, props.chainId]);
3806
+ const tokenSymbol = props.asset === "native" ? "ETH" : props.asset.symbol;
3807
+ const displayChainName = chainName || `Chain ${props.chainId}`;
3808
+ const decimals = props.asset === "native" ? 18 : props.asset.decimals;
3809
+ if (viewMode === "wallet-transfer") {
3810
+ return /* @__PURE__ */ jsxs("div", { className: "volr:relative", children: [
4113
3811
  /* @__PURE__ */ jsx(
4114
- Button,
3812
+ WalletTransferView,
4115
3813
  {
4116
- variant: "secondary",
4117
- size: "sm",
4118
- onClick: switchNetwork,
4119
- className: "volr:w-full",
4120
- children: t("deposit.walletTransfer.switchNetwork")
3814
+ chainId: props.chainId,
3815
+ asset: props.asset,
3816
+ destinationAddress: props.address,
3817
+ onBack: () => setViewMode("qr"),
3818
+ onSuccess: () => {
3819
+ setViewMode("qr");
3820
+ }
3821
+ }
3822
+ ),
3823
+ showToast && toastData && /* @__PURE__ */ jsx(
3824
+ DepositCompletedToast,
3825
+ {
3826
+ onClose: () => {
3827
+ setShowToast(false);
3828
+ setToastData(null);
3829
+ },
3830
+ previousBalance: toastData.previousBalance,
3831
+ newBalance: toastData.newBalance,
3832
+ delta: toastData.delta,
3833
+ decimals,
3834
+ symbol: tokenSymbol
4121
3835
  }
4122
3836
  )
4123
- ] }),
4124
- /* @__PURE__ */ jsx("div", { className: "volr:mb-4 volr:p-4 volr:bg-slate-50 volr:rounded-xl volr:border volr:border-slate-200", children: /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:justify-between", children: [
4125
- /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:gap-2", children: [
4126
- /* @__PURE__ */ jsx("span", { className: "volr:text-base volr:font-semibold", children: tokenSymbol }),
4127
- /* @__PURE__ */ jsx("span", { className: "volr:text-xs volr:px-2 volr:py-0.5 volr:rounded-full volr:bg-slate-200 volr:text-slate-600", children: chainName || `Chain ${chainId}` })
4128
- ] }),
4129
- /* @__PURE__ */ jsxs("div", { className: "volr:text-right", children: [
4130
- /* @__PURE__ */ jsx("p", { className: "volr:text-xs volr:text-slate-500", children: t("deposit.walletTransfer.balance") }),
4131
- /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:font-mono volr:font-medium", children: isWrongNetwork ? "-" : formattedBalance ? `${Number(formattedBalance).toFixed(4)}` : "..." })
3837
+ ] });
3838
+ }
3839
+ return /* @__PURE__ */ jsxs("div", { className: "volr:relative", children: [
3840
+ /* @__PURE__ */ jsxs("div", { className: "volr:mb-4", children: [
3841
+ /* @__PURE__ */ jsx("p", { className: "volr:text-xl volr:font-semibold volr:mb-2", children: t("deposit.qrTitle") }),
3842
+ /* @__PURE__ */ jsxs("div", { className: "volr:inline-flex volr:items-center volr:gap-2 volr:px-3 volr:py-1.5 volr:rounded-lg volr-bg-secondary", children: [
3843
+ /* @__PURE__ */ jsx("span", { className: "volr:text-sm volr:font-medium", children: tokenSymbol }),
3844
+ /* @__PURE__ */ jsx("span", { className: "volr-text-muted", children: "\u2022" }),
3845
+ /* @__PURE__ */ jsx("span", { className: "volr:text-sm volr-text-secondary", children: displayChainName })
4132
3846
  ] })
3847
+ ] }),
3848
+ /* @__PURE__ */ jsx("div", { className: "volr:flex volr:justify-center volr:mb-3", children: /* @__PURE__ */ jsxs("div", { className: "volr:relative", children: [
3849
+ /* @__PURE__ */ jsx("div", { className: "volr:relative volr:rounded-xl volr:p-4 volr:shadow-sm volr:border volr:z-10 volr:bg-white volr-border", children: /* @__PURE__ */ jsx(
3850
+ "img",
3851
+ {
3852
+ alt: "Deposit QR",
3853
+ width: 200,
3854
+ height: 200,
3855
+ src: `https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(
3856
+ eip681
3857
+ )}`,
3858
+ className: "volr:rounded-md volr:relative volr:z-10"
3859
+ }
3860
+ ) }),
3861
+ /* @__PURE__ */ jsx(DepositQRStatusOverlay, { status: status.state })
4133
3862
  ] }) }),
4134
- /* @__PURE__ */ jsxs("div", { className: "volr:mb-4", children: [
4135
- /* @__PURE__ */ jsx("label", { className: "volr:block volr:text-sm volr:font-medium volr:text-slate-700 volr:mb-2", children: t("deposit.walletTransfer.amount") }),
4136
- /* @__PURE__ */ jsxs("div", { className: "volr:relative", children: [
4137
- /* @__PURE__ */ jsx(
4138
- "input",
4139
- {
4140
- type: "text",
4141
- inputMode: "decimal",
4142
- value: amount,
4143
- onChange: (e) => setAmount(e.target.value),
4144
- placeholder: t("deposit.walletTransfer.amountPlaceholder"),
4145
- disabled: isWrongNetwork,
4146
- className: "volr:w-full volr:px-4 volr:py-3 volr:pr-16 volr:border volr:border-slate-300 volr:rounded-xl volr:text-base volr:font-mono volr:focus:outline-none volr:focus:ring-2 volr:focus:ring-slate-300 volr:disabled:bg-slate-100 volr:disabled:text-slate-400"
4147
- }
4148
- ),
3863
+ (status.state === "listening" || status.state === "idle") && /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:justify-center volr:gap-2 volr:mb-3", children: [
3864
+ /* @__PURE__ */ jsx("div", { className: "volr:w-1.5 volr:h-1.5 volr:rounded-full volr:animate-pulse volr-text-secondary", style: { backgroundColor: "currentColor" } }),
3865
+ /* @__PURE__ */ jsx("span", { className: "volr:text-xs volr-text-secondary", children: t("deposit.listening") })
3866
+ ] }),
3867
+ status.state === "error" && /* @__PURE__ */ jsxs("div", { className: "volr:text-xs volr:text-center volr:mb-3 volr-error", children: [
3868
+ "Error: ",
3869
+ status.message
3870
+ ] }),
3871
+ /* @__PURE__ */ jsxs("div", { className: "volr:space-y-3", children: [
3872
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("div", { className: "volr:relative volr:border volr:rounded-lg volr:p-3 volr:transition-all volr-bg-secondary volr-border volr-hover", children: /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:justify-between volr:gap-3", children: [
3873
+ /* @__PURE__ */ jsx("p", { className: "volr:font-mono volr:text-xs volr:font-medium volr:flex-1 volr:text-center", children: `${props.address.slice(0, 10)}...${props.address.slice(-8)}` }),
4149
3874
  /* @__PURE__ */ jsx(
4150
- "button",
3875
+ CopyButton,
4151
3876
  {
4152
- type: "button",
4153
- onClick: setMaxAmount,
4154
- disabled: isWrongNetwork || balance === null,
4155
- className: "volr:absolute volr:right-3 volr:top-1/2 volr:-translate-y-1/2 volr:px-2 volr:py-1 volr:text-xs volr:font-semibold volr:text-slate-600 volr:bg-slate-100 volr:rounded volr:hover:bg-slate-200 volr:disabled:opacity-50",
4156
- children: t("deposit.walletTransfer.max")
3877
+ text: props.address,
3878
+ className: "volr:shrink-0 volr:absolute volr:right-2"
4157
3879
  }
4158
3880
  )
4159
- ] })
3881
+ ] }) }) }),
3882
+ status.state === "error" && /* @__PURE__ */ jsx("div", { className: "volr:text-xs volr:text-center volr:mb-4 volr-error", children: status.message })
4160
3883
  ] }),
4161
- error && /* @__PURE__ */ jsx("div", { className: "volr:mb-4 volr:p-3 volr:bg-red-50 volr:border volr:border-red-200 volr:rounded-lg", children: /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-red-600", children: error }) }),
3884
+ /* @__PURE__ */ jsx("div", { className: "volr:mt-4", children: /* @__PURE__ */ jsxs(
3885
+ "button",
3886
+ {
3887
+ type: "button",
3888
+ onClick: () => setViewMode("wallet-transfer"),
3889
+ className: "volr:w-full volr:flex volr:items-center volr:justify-center volr:gap-2 volr:py-3 volr:px-4 volr:border volr:border-slate-200 volr:rounded-xl volr:text-sm volr:font-medium volr:text-slate-700 volr:bg-white volr:hover:bg-slate-50 volr:transition-colors",
3890
+ children: [
3891
+ /* @__PURE__ */ jsxs(
3892
+ "svg",
3893
+ {
3894
+ className: "volr:w-5 volr:h-5",
3895
+ viewBox: "0 0 24 24",
3896
+ fill: "none",
3897
+ stroke: "currentColor",
3898
+ strokeWidth: "1.5",
3899
+ children: [
3900
+ /* @__PURE__ */ jsx("rect", { x: "2", y: "6", width: "20", height: "14", rx: "2" }),
3901
+ /* @__PURE__ */ jsx("path", { d: "M17 12.5C17 13.3284 16.3284 14 15.5 14C14.6716 14 14 13.3284 14 12.5C14 11.6716 14.6716 11 15.5 11C16.3284 11 17 11.6716 17 12.5Z", fill: "currentColor" }),
3902
+ /* @__PURE__ */ jsx("path", { d: "M6 6V5C6 3.89543 6.89543 3 8 3H16C17.1046 3 18 3.89543 18 5V6" })
3903
+ ]
3904
+ }
3905
+ ),
3906
+ t("deposit.useWallet")
3907
+ ]
3908
+ }
3909
+ ) }),
3910
+ /* @__PURE__ */ jsx("div", { className: "volr:text-center volr:pt-3 volr:mt-3 volr:border-t volr-border", children: /* @__PURE__ */ jsxs("span", { className: "volr:text-xs volr-text-secondary", children: [
3911
+ t("deposit.noToken"),
3912
+ " ",
3913
+ /* @__PURE__ */ jsx(
3914
+ TextLinkButton,
3915
+ {
3916
+ onClick: () => setShowOtherTokenModal(true),
3917
+ showArrow: true,
3918
+ children: t("deposit.getOtherToken")
3919
+ }
3920
+ )
3921
+ ] }) }),
4162
3922
  /* @__PURE__ */ jsx(
4163
- Button,
3923
+ OtherTokenModal,
3924
+ {
3925
+ open: showOtherTokenModal,
3926
+ onOpenChange: setShowOtherTokenModal
3927
+ }
3928
+ ),
3929
+ showToast && toastData && /* @__PURE__ */ jsx(
3930
+ DepositCompletedToast,
3931
+ {
3932
+ onClose: () => {
3933
+ setShowToast(false);
3934
+ setToastData(null);
3935
+ },
3936
+ previousBalance: toastData.previousBalance,
3937
+ newBalance: toastData.newBalance,
3938
+ delta: toastData.delta,
3939
+ decimals,
3940
+ symbol: tokenSymbol
3941
+ }
3942
+ )
3943
+ ] });
3944
+ }
3945
+ function DepositModalBody({
3946
+ isLoading,
3947
+ error,
3948
+ depositAssets,
3949
+ evmAddress,
3950
+ selectedIdx,
3951
+ onSelectIdx
3952
+ }) {
3953
+ if (isLoading) return /* @__PURE__ */ jsx(DepositSkeleton, {});
3954
+ if (error) {
3955
+ return /* @__PURE__ */ jsxs("div", { className: "volr:relative", children: [
3956
+ /* @__PURE__ */ jsx(DepositSkeleton, {}),
3957
+ /* @__PURE__ */ jsx(
3958
+ "div",
3959
+ {
3960
+ className: "volr:absolute volr:inset-0 volr:flex volr:items-center volr:justify-center volr-surface",
3961
+ style: { opacity: 0.9 },
3962
+ children: /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-center volr:px-4 volr-error", children: error })
3963
+ }
3964
+ )
3965
+ ] });
3966
+ }
3967
+ if (depositAssets.length === 0) {
3968
+ return /* @__PURE__ */ jsxs("div", { className: "volr:relative", children: [
3969
+ /* @__PURE__ */ jsx(DepositSkeleton, {}),
3970
+ /* @__PURE__ */ jsx(
3971
+ "div",
3972
+ {
3973
+ className: "volr:absolute volr:inset-0 volr:flex volr:items-center volr:justify-center volr-surface",
3974
+ style: { opacity: 0.9 },
3975
+ children: /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-center volr:px-4 volr-text-secondary", children: "No payment token configured. Please contact the app developer." })
3976
+ }
3977
+ )
3978
+ ] });
3979
+ }
3980
+ if (!evmAddress) {
3981
+ return /* @__PURE__ */ jsxs("div", { className: "volr:relative", children: [
3982
+ /* @__PURE__ */ jsx(DepositSkeleton, {}),
3983
+ /* @__PURE__ */ jsx(
3984
+ "div",
3985
+ {
3986
+ className: "volr:absolute volr:inset-0 volr:flex volr:items-center volr:justify-center volr-surface",
3987
+ style: { opacity: 0.9 },
3988
+ children: /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-center volr:px-4 volr-text-secondary", children: "Wallet address is not ready. Please finish wallet setup first." })
3989
+ }
3990
+ )
3991
+ ] });
3992
+ }
3993
+ if (depositAssets.length === 1) {
3994
+ return /* @__PURE__ */ jsx(
3995
+ DepositQRView,
3996
+ {
3997
+ chainId: depositAssets[0].chainId,
3998
+ asset: depositAssets[0].token,
3999
+ address: evmAddress,
4000
+ onBack: void 0
4001
+ }
4002
+ );
4003
+ }
4004
+ if (selectedIdx === -1) {
4005
+ return /* @__PURE__ */ jsx(
4006
+ AssetSelectView,
4007
+ {
4008
+ assets: depositAssets,
4009
+ onSelect: (idx) => onSelectIdx(idx)
4010
+ }
4011
+ );
4012
+ }
4013
+ const selected = depositAssets[selectedIdx];
4014
+ return /* @__PURE__ */ jsx(
4015
+ DepositQRView,
4016
+ {
4017
+ chainId: selected.chainId,
4018
+ asset: selected.token,
4019
+ address: evmAddress,
4020
+ onBack: () => onSelectIdx(-1)
4021
+ }
4022
+ );
4023
+ }
4024
+ function ChevronRightIcon({ className }) {
4025
+ return /* @__PURE__ */ jsx(
4026
+ "svg",
4027
+ {
4028
+ xmlns: "http://www.w3.org/2000/svg",
4029
+ viewBox: "0 0 20 20",
4030
+ fill: "currentColor",
4031
+ className,
4032
+ children: /* @__PURE__ */ jsx(
4033
+ "path",
4034
+ {
4035
+ fillRule: "evenodd",
4036
+ d: "M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z",
4037
+ clipRule: "evenodd"
4038
+ }
4039
+ )
4040
+ }
4041
+ );
4042
+ }
4043
+ function WalletIcon2({ className }) {
4044
+ return /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 12a2.25 2.25 0 00-2.25-2.25H15a3 3 0 11-6 0H5.25A2.25 2.25 0 003 12m18 0v6a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 18v-6m18 0V9M3 12V9m18 0a2.25 2.25 0 00-2.25-2.25H5.25A2.25 2.25 0 003 9m18 0V6a2.25 2.25 0 00-2.25-2.25H5.25A2.25 2.25 0 003 6v3" }) });
4045
+ }
4046
+ function ArrowDownIcon({ className }) {
4047
+ return /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 13.5L12 21m0 0l-7.5-7.5M12 21V3" }) });
4048
+ }
4049
+ function ArrowUpIcon({ className }) {
4050
+ return /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 10.5L12 3m0 0l7.5 7.5M12 3v18" }) });
4051
+ }
4052
+ function ClockIcon({ className }) {
4053
+ return /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z" }) });
4054
+ }
4055
+ function UserIcon({ className }) {
4056
+ return /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z" }) });
4057
+ }
4058
+ function MenuItem({ icon, label, description, onClick, isFirst, isLast }) {
4059
+ return /* @__PURE__ */ jsxs(
4060
+ "button",
4061
+ {
4062
+ type: "button",
4063
+ onClick,
4064
+ className: `volr:w-full volr:flex volr:items-center volr:gap-3 volr:py-2.5 volr:px-3 volr:bg-white hover:volr:bg-slate-50 volr:transition-colors volr:text-left volr:border-x volr:border-slate-200 ${isFirst ? "volr:border-t volr:rounded-t-xl" : ""} ${isLast ? "volr:border-b volr:rounded-b-xl" : "volr:border-b"}`,
4065
+ children: [
4066
+ /* @__PURE__ */ jsx("div", { className: "volr:w-8 volr:h-8 volr:rounded-full volr:bg-slate-100 volr:flex volr:items-center volr:justify-center volr:shrink-0", children: icon }),
4067
+ /* @__PURE__ */ jsxs("div", { className: "volr:flex-1 volr:min-w-0", children: [
4068
+ /* @__PURE__ */ jsx("span", { className: "volr:text-sm volr:font-medium volr:text-slate-900", children: label }),
4069
+ description && /* @__PURE__ */ jsx("p", { className: "volr:text-xs volr:text-slate-400", children: description })
4070
+ ] }),
4071
+ /* @__PURE__ */ jsx(ChevronRightIcon, { className: "volr:w-4 volr:h-4 volr:text-slate-300" })
4072
+ ]
4073
+ }
4074
+ );
4075
+ }
4076
+ function AccountMainView({
4077
+ totalUsd,
4078
+ balances,
4079
+ isLoading,
4080
+ paymentEnabled,
4081
+ onNavigate,
4082
+ onLogout,
4083
+ isLoggingOut
4084
+ }) {
4085
+ const { t } = useI18n();
4086
+ const formattedUsd = isLoading ? "\u2014" : totalUsd.toLocaleString("en-US", {
4087
+ style: "currency",
4088
+ currency: "USD",
4089
+ minimumFractionDigits: 2,
4090
+ maximumFractionDigits: 2
4091
+ });
4092
+ const tokensWithBalance = balances.filter((b) => b.balanceRaw > 0n).length;
4093
+ const assetsDescription = isLoading ? void 0 : tokensWithBalance > 0 ? `${tokensWithBalance} ${tokensWithBalance === 1 ? "token" : "tokens"}` : void 0;
4094
+ const menuItems = [
4095
+ {
4096
+ key: "assets",
4097
+ icon: /* @__PURE__ */ jsx(WalletIcon2, { className: "volr:w-4 volr:h-4 volr:text-slate-600" }),
4098
+ label: t("account.menu.assets"),
4099
+ description: assetsDescription,
4100
+ view: "assets"
4101
+ },
4102
+ {
4103
+ key: "deposit",
4104
+ icon: /* @__PURE__ */ jsx(ArrowDownIcon, { className: "volr:w-4 volr:h-4 volr:text-slate-600" }),
4105
+ label: t("account.menu.deposit"),
4106
+ view: "deposit"
4107
+ },
4108
+ {
4109
+ key: "withdraw",
4110
+ icon: /* @__PURE__ */ jsx(ArrowUpIcon, { className: "volr:w-4 volr:h-4 volr:text-slate-600" }),
4111
+ label: t("account.menu.withdraw"),
4112
+ view: "withdraw"
4113
+ },
4114
+ ...paymentEnabled ? [
4164
4115
  {
4165
- onClick: executeTransfer,
4166
- disabled: isTransferring || !amount || isWrongNetwork,
4167
- className: "volr:w-full",
4168
- children: isTransferring ? t("deposit.walletTransfer.transferring") : t("deposit.walletTransfer.transfer")
4116
+ key: "payments",
4117
+ icon: /* @__PURE__ */ jsx(ClockIcon, { className: "volr:w-4 volr:h-4 volr:text-slate-600" }),
4118
+ label: t("account.menu.payments"),
4119
+ view: "payments"
4169
4120
  }
4170
- ),
4171
- /* @__PURE__ */ jsx("div", { className: "volr:mt-3", children: /* @__PURE__ */ jsx(
4172
- Button,
4121
+ ] : [],
4122
+ {
4123
+ key: "account",
4124
+ icon: /* @__PURE__ */ jsx(UserIcon, { className: "volr:w-4 volr:h-4 volr:text-slate-600" }),
4125
+ label: t("account.menu.account"),
4126
+ view: "account"
4127
+ }
4128
+ ];
4129
+ return /* @__PURE__ */ jsxs("div", { children: [
4130
+ /* @__PURE__ */ jsxs("div", { className: "volr:rounded-xl volr:bg-gradient-to-br volr:from-slate-50 volr:to-slate-100 volr:p-4 volr:mb-4", children: [
4131
+ /* @__PURE__ */ jsx("p", { className: "volr:text-xs volr:text-slate-500 volr:mb-0.5", children: t("account.totalBalance") }),
4132
+ isLoading ? /* @__PURE__ */ jsx("div", { className: "volr:animate-pulse", children: /* @__PURE__ */ jsx("div", { className: "volr:h-8 volr:w-32 volr:bg-slate-200 volr:rounded" }) }) : /* @__PURE__ */ jsx("p", { className: "volr:text-2xl volr:font-semibold volr:text-slate-900", children: formattedUsd })
4133
+ ] }),
4134
+ /* @__PURE__ */ jsx("div", { children: menuItems.map((item, index) => /* @__PURE__ */ jsx(
4135
+ MenuItem,
4173
4136
  {
4174
- variant: "ghost",
4175
- onClick: () => setViewState("select-wallet"),
4176
- className: "volr:w-full",
4177
- children: t("common.back")
4137
+ icon: item.icon,
4138
+ label: item.label,
4139
+ description: item.description,
4140
+ onClick: () => onNavigate(item.view),
4141
+ isFirst: index === 0,
4142
+ isLast: index === menuItems.length - 1
4143
+ },
4144
+ item.key
4145
+ )) }),
4146
+ /* @__PURE__ */ jsx("div", { className: "volr:mt-4 volr:pt-3", children: /* @__PURE__ */ jsx(
4147
+ "button",
4148
+ {
4149
+ type: "button",
4150
+ onClick: onLogout,
4151
+ disabled: isLoggingOut,
4152
+ className: "volr:w-full volr:py-2 volr:text-sm volr:text-slate-400 volr:text-center hover:volr:text-slate-600 volr:transition-colors disabled:volr:opacity-50",
4153
+ children: isLoggingOut ? t("common.loading") : t("account.logout")
4178
4154
  }
4179
4155
  ) })
4180
4156
  ] });
4181
4157
  }
4182
- var DepositQRStatusOverlay = ({
4183
- status
4184
- }) => {
4185
- if (status !== "detected") return null;
4186
- return /* @__PURE__ */ jsxs(Fragment, { children: [
4187
- /* @__PURE__ */ jsx(
4188
- "div",
4189
- {
4190
- className: "volr:absolute volr:inset-0 volr:rounded-2xl volr:pointer-events-none",
4191
- style: {
4192
- boxShadow: "0 0 0 4px rgba(16, 185, 129, 0.3), 0 0 30px rgba(16, 185, 129, 0.4)",
4193
- animation: "volrPulseGlow 1.5s ease-out infinite"
4194
- }
4195
- }
4196
- ),
4197
- /* @__PURE__ */ jsxs("div", { className: "volr:absolute volr:inset-0 volr:overflow-visible volr:pointer-events-none volr:-z-10", children: [
4198
- /* @__PURE__ */ jsx(
4199
- "div",
4200
- {
4201
- className: "volr:absolute volr:w-48 volr:h-48 volr:rounded-full volr:opacity-0",
4202
- style: {
4203
- background: "radial-gradient(circle, rgba(16,185,129,0.7) 0%, rgba(16,185,129,0) 60%)",
4204
- filter: "blur(50px)",
4205
- top: "5%",
4206
- left: "0%",
4207
- animation: "volrGlowPulse 1.8s ease-out forwards"
4208
- }
4209
- }
4210
- ),
4211
- /* @__PURE__ */ jsx(
4212
- "div",
4158
+ function TokenRow({ token }) {
4159
+ return /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:justify-between volr:py-3 volr:border-b volr:border-slate-100 last:volr:border-b-0", children: [
4160
+ /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:gap-3", children: [
4161
+ /* @__PURE__ */ jsx("div", { className: "volr:w-8 volr:h-8 volr:rounded-full volr:bg-slate-100 volr:flex volr:items-center volr:justify-center volr:overflow-hidden volr:shrink-0", children: token.iconUrl ? /* @__PURE__ */ jsx(
4162
+ "img",
4213
4163
  {
4214
- className: "volr:absolute volr:w-44 volr:h-44 volr:rounded-full volr:opacity-0",
4215
- style: {
4216
- background: "radial-gradient(circle, rgba(6,182,212,0.65) 0%, rgba(6,182,212,0) 60%)",
4217
- filter: "blur(45px)",
4218
- bottom: "10%",
4219
- right: "-5%",
4220
- animation: "volrGlowPulse 2s ease-out 0.1s forwards"
4221
- }
4164
+ src: token.iconUrl,
4165
+ alt: token.symbol,
4166
+ className: "volr:w-full volr:h-full volr:object-cover"
4222
4167
  }
4223
- ),
4168
+ ) : /* @__PURE__ */ jsx("span", { className: "volr:text-xs volr:font-medium volr:text-slate-500", children: token.symbol.slice(0, 2) }) }),
4169
+ /* @__PURE__ */ jsxs("div", { children: [
4170
+ /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:font-medium volr:text-slate-900", children: token.symbol }),
4171
+ /* @__PURE__ */ jsxs("p", { className: "volr:text-xs volr:text-slate-400", children: [
4172
+ "Chain ",
4173
+ token.chainId
4174
+ ] })
4175
+ ] })
4176
+ ] }),
4177
+ /* @__PURE__ */ jsx("div", { className: "volr:text-right", children: token.isLoading ? /* @__PURE__ */ jsx("div", { className: "volr:animate-pulse", children: /* @__PURE__ */ jsx("div", { className: "volr:h-4 volr:w-16 volr:bg-slate-200 volr:rounded" }) }) : token.error ? /* @__PURE__ */ jsx("p", { className: "volr:text-xs volr:text-red-500", children: "Error" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
4178
+ /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:font-medium volr:text-slate-900", children: token.balance }),
4179
+ token.balanceUsd !== void 0 && token.balanceUsd > 0 && /* @__PURE__ */ jsxs("p", { className: "volr:text-xs volr:text-slate-400", children: [
4180
+ "$",
4181
+ token.balanceUsd.toFixed(2)
4182
+ ] })
4183
+ ] }) })
4184
+ ] });
4185
+ }
4186
+ function BalanceDetailView({
4187
+ balances,
4188
+ isLoading
4189
+ }) {
4190
+ const { t } = useI18n();
4191
+ if (isLoading && balances.length === 0) {
4192
+ return /* @__PURE__ */ jsx("div", { className: "volr:py-8", children: /* @__PURE__ */ jsx("div", { className: "volr:animate-pulse volr:space-y-4", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:gap-3", children: [
4193
+ /* @__PURE__ */ jsx("div", { className: "volr:w-8 volr:h-8 volr:rounded-full volr:bg-slate-200" }),
4194
+ /* @__PURE__ */ jsxs("div", { className: "volr:flex-1", children: [
4195
+ /* @__PURE__ */ jsx("div", { className: "volr:h-4 volr:w-16 volr:bg-slate-200 volr:rounded volr:mb-1" }),
4196
+ /* @__PURE__ */ jsx("div", { className: "volr:h-3 volr:w-12 volr:bg-slate-100 volr:rounded" })
4197
+ ] }),
4198
+ /* @__PURE__ */ jsx("div", { className: "volr:h-4 volr:w-16 volr:bg-slate-200 volr:rounded" })
4199
+ ] }, i)) }) });
4200
+ }
4201
+ if (balances.length === 0) {
4202
+ return /* @__PURE__ */ jsx("div", { className: "volr:py-12 volr:text-center", children: /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-slate-400", children: t("account.noAssets") }) });
4203
+ }
4204
+ return /* @__PURE__ */ jsxs("div", { children: [
4205
+ /* @__PURE__ */ jsx("h2", { className: "volr:text-lg volr:font-semibold volr:text-slate-900 volr:mb-4", children: t("account.menu.assets") }),
4206
+ /* @__PURE__ */ jsx("div", { children: balances.map((token) => /* @__PURE__ */ jsx(TokenRow, { token }, token.id)) })
4207
+ ] });
4208
+ }
4209
+ var Input = React13.forwardRef(
4210
+ ({ leftIcon, error, className, style, disabled, ...props }, ref) => {
4211
+ return /* @__PURE__ */ jsxs("div", { className: "volr:relative", children: [
4212
+ leftIcon && /* @__PURE__ */ jsx("div", { className: "volr:absolute volr:left-3 volr:top-1/2 volr:-translate-y-1/2 volr:pointer-events-none volr-text-muted", children: leftIcon }),
4224
4213
  /* @__PURE__ */ jsx(
4225
- "div",
4214
+ "input",
4226
4215
  {
4227
- className: "volr:absolute volr:w-40 volr:h-40 volr:rounded-full volr:opacity-0",
4228
- style: {
4229
- background: "radial-gradient(circle, rgba(20,184,166,0.6) 0%, rgba(20,184,166,0) 60%)",
4230
- filter: "blur(40px)",
4231
- top: "50%",
4232
- left: "50%",
4233
- transform: "translateX(-50%)",
4234
- animation: "volrGlowPulse 2.2s ease-out 0.2s forwards"
4235
- }
4216
+ ref,
4217
+ disabled,
4218
+ className: cn(
4219
+ "volr:w-full volr:text-base volr:outline-none volr:transition-all volr:rounded-lg volr:py-3 volr:disabled:cursor-not-allowed volr:bg-white",
4220
+ "volr:border volr:border-slate-300 focus:volr:border-slate-400 focus:volr:ring-1 focus:volr:ring-slate-400",
4221
+ leftIcon ? "volr:pl-11 volr:pr-3" : "volr:px-3",
4222
+ error && "volr:border-red-500 focus:volr:border-red-500 focus:volr:ring-red-500",
4223
+ className
4224
+ ),
4225
+ style,
4226
+ ...props
4236
4227
  }
4237
4228
  )
4238
- ] }),
4239
- /* @__PURE__ */ jsx(
4240
- "div",
4241
- {
4242
- className: "volr:absolute volr:-top-3 volr:-right-3 volr:rounded-full volr:p-3 volr:bg-linear-to-br volr:from-emerald-400 volr:to-teal-500 volr:shadow-2xl volr:shadow-emerald-500/50 volr:border-4 volr:border-white volr:z-20",
4243
- style: {
4244
- animation: "volrBounceIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards"
4229
+ ] });
4230
+ }
4231
+ );
4232
+ Input.displayName = "Input";
4233
+ function WithdrawView({
4234
+ balances,
4235
+ connectedWallet,
4236
+ onSuccess
4237
+ }) {
4238
+ const { t } = useI18n();
4239
+ const { withdraw, isWithdrawing, result, error, reset } = useWithdraw();
4240
+ const [step, setStep] = useState("select");
4241
+ const [selectedTokenId, setSelectedTokenId] = useState(null);
4242
+ const [toAddress, setToAddress] = useState("");
4243
+ const [amount, setAmount] = useState("");
4244
+ const [useConnectedWallet, setUseConnectedWallet] = useState(false);
4245
+ const selectedToken = useMemo(
4246
+ () => balances.find((b) => b.id === selectedTokenId),
4247
+ [balances, selectedTokenId]
4248
+ );
4249
+ const connectedAddress = useMemo(() => {
4250
+ if (!connectedWallet) return null;
4251
+ const parts = connectedWallet.split(":");
4252
+ return parts.length >= 2 ? parts[1] : null;
4253
+ }, [connectedWallet]);
4254
+ const handleSelectToken = (tokenId) => {
4255
+ setSelectedTokenId(tokenId);
4256
+ setStep("input");
4257
+ };
4258
+ const handleUseConnectedWallet = () => {
4259
+ if (connectedAddress) {
4260
+ setToAddress(connectedAddress);
4261
+ setUseConnectedWallet(true);
4262
+ }
4263
+ };
4264
+ const handleConfirm = async () => {
4265
+ if (!selectedToken || !toAddress || !amount) return;
4266
+ setStep("confirm");
4267
+ try {
4268
+ await withdraw({
4269
+ chainId: selectedToken.chainId,
4270
+ tokenAddress: selectedToken.address,
4271
+ decimals: selectedToken.decimals,
4272
+ amount,
4273
+ to: toAddress
4274
+ });
4275
+ setStep("result");
4276
+ } catch {
4277
+ setStep("result");
4278
+ }
4279
+ };
4280
+ const handleReset = () => {
4281
+ reset();
4282
+ setStep("select");
4283
+ setSelectedTokenId(null);
4284
+ setToAddress("");
4285
+ setAmount("");
4286
+ setUseConnectedWallet(false);
4287
+ };
4288
+ const isAmountValid = useMemo(() => {
4289
+ if (!amount || !selectedToken) return false;
4290
+ const num = parseFloat(amount);
4291
+ if (isNaN(num) || num <= 0) return false;
4292
+ const balance = parseFloat(selectedToken.balance.replace(/,/g, ""));
4293
+ return num <= balance;
4294
+ }, [amount, selectedToken]);
4295
+ const isAddressValid = /^0x[a-fA-F0-9]{40}$/.test(toAddress);
4296
+ if (step === "select") {
4297
+ return /* @__PURE__ */ jsxs("div", { children: [
4298
+ /* @__PURE__ */ jsx("h2", { className: "volr:text-lg volr:font-semibold volr:text-slate-900 volr:mb-4", children: t("account.withdraw.selectToken") }),
4299
+ /* @__PURE__ */ jsx("div", { className: "volr:space-y-2", children: balances.map((token) => /* @__PURE__ */ jsxs(
4300
+ "button",
4301
+ {
4302
+ type: "button",
4303
+ onClick: () => handleSelectToken(token.id),
4304
+ disabled: token.balanceRaw === 0n,
4305
+ className: "volr:w-full volr:flex volr:items-center volr:justify-between volr:p-3 volr:rounded-lg volr:border volr:border-slate-200 hover:volr:bg-slate-50 volr:transition-colors disabled:volr:opacity-50 disabled:volr:cursor-not-allowed",
4306
+ children: [
4307
+ /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:gap-3", children: [
4308
+ /* @__PURE__ */ jsx("div", { className: "volr:w-8 volr:h-8 volr:rounded-full volr:bg-slate-100 volr:flex volr:items-center volr:justify-center volr:overflow-hidden", children: token.iconUrl ? /* @__PURE__ */ jsx(
4309
+ "img",
4310
+ {
4311
+ src: token.iconUrl,
4312
+ alt: token.symbol,
4313
+ className: "volr:w-full volr:h-full volr:object-cover"
4314
+ }
4315
+ ) : /* @__PURE__ */ jsx("span", { className: "volr:text-xs volr:font-medium volr:text-slate-500", children: token.symbol.slice(0, 2) }) }),
4316
+ /* @__PURE__ */ jsx("span", { className: "volr:text-sm volr:font-medium volr:text-slate-900", children: token.symbol })
4317
+ ] }),
4318
+ /* @__PURE__ */ jsx("span", { className: "volr:text-sm volr:text-slate-500", children: token.balance })
4319
+ ]
4245
4320
  },
4246
- children: /* @__PURE__ */ jsx(
4247
- "svg",
4321
+ token.id
4322
+ )) })
4323
+ ] });
4324
+ }
4325
+ if (step === "input" && selectedToken) {
4326
+ return /* @__PURE__ */ jsxs("div", { children: [
4327
+ /* @__PURE__ */ jsx("h2", { className: "volr:text-lg volr:font-semibold volr:text-slate-900 volr:mb-4", children: t("account.withdraw.title") }),
4328
+ /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:gap-3 volr:p-3 volr:rounded-lg volr:bg-slate-50 volr:mb-4", children: [
4329
+ /* @__PURE__ */ jsx("div", { className: "volr:w-8 volr:h-8 volr:rounded-full volr:bg-slate-200 volr:flex volr:items-center volr:justify-center volr:overflow-hidden", children: selectedToken.iconUrl ? /* @__PURE__ */ jsx(
4330
+ "img",
4248
4331
  {
4249
- width: "20",
4250
- height: "20",
4251
- viewBox: "0 0 24 24",
4252
- fill: "none",
4253
- stroke: "white",
4254
- strokeWidth: "3",
4255
- strokeLinecap: "round",
4256
- strokeLinejoin: "round",
4257
- children: /* @__PURE__ */ jsx("polyline", { points: "20 6 9 17 4 12" })
4258
- }
4259
- )
4260
- }
4261
- ),
4262
- /* @__PURE__ */ jsxs("div", { className: "volr:absolute volr:inset-0 volr:pointer-events-none volr:overflow-visible", children: [
4263
- /* @__PURE__ */ jsx(
4264
- "div",
4265
- {
4266
- className: "volr:absolute volr:w-2 volr:h-2 volr:bg-emerald-400 volr:rounded-full volr:opacity-0",
4267
- style: {
4268
- top: "20%",
4269
- left: "20%",
4270
- animation: "volrParticle1 1s ease-out forwards"
4332
+ src: selectedToken.iconUrl,
4333
+ alt: selectedToken.symbol,
4334
+ className: "volr:w-full volr:h-full volr:object-cover"
4271
4335
  }
4272
- }
4273
- ),
4274
- /* @__PURE__ */ jsx(
4275
- "div",
4276
- {
4277
- className: "volr:absolute volr:w-1.5 volr:h-1.5 volr:bg-cyan-400 volr:rounded-full volr:opacity-0",
4278
- style: {
4279
- top: "30%",
4280
- right: "25%",
4281
- animation: "volrParticle2 1.2s ease-out 0.1s forwards"
4336
+ ) : /* @__PURE__ */ jsx("span", { className: "volr:text-xs volr:font-medium volr:text-slate-500", children: selectedToken.symbol.slice(0, 2) }) }),
4337
+ /* @__PURE__ */ jsxs("div", { children: [
4338
+ /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:font-medium volr:text-slate-900", children: selectedToken.symbol }),
4339
+ /* @__PURE__ */ jsxs("p", { className: "volr:text-xs volr:text-slate-400", children: [
4340
+ t("account.withdraw.available"),
4341
+ ": ",
4342
+ selectedToken.balance
4343
+ ] })
4344
+ ] })
4345
+ ] }),
4346
+ /* @__PURE__ */ jsxs("div", { className: "volr:mb-4", children: [
4347
+ /* @__PURE__ */ jsx("label", { className: "volr:block volr:text-sm volr:text-slate-600 volr:mb-2", children: t("account.withdraw.toAddress") }),
4348
+ /* @__PURE__ */ jsx(
4349
+ Input,
4350
+ {
4351
+ type: "text",
4352
+ placeholder: "0x...",
4353
+ value: toAddress,
4354
+ onChange: (e) => {
4355
+ setToAddress(e.target.value);
4356
+ setUseConnectedWallet(false);
4357
+ }
4282
4358
  }
4283
- }
4284
- ),
4285
- /* @__PURE__ */ jsx(
4286
- "div",
4287
- {
4288
- className: "volr:absolute volr:w-2 volr:h-2 volr:bg-teal-400 volr:rounded-full volr:opacity-0",
4289
- style: {
4290
- bottom: "25%",
4291
- left: "30%",
4292
- animation: "volrParticle3 1.1s ease-out 0.2s forwards"
4359
+ ),
4360
+ connectedAddress && !useConnectedWallet && /* @__PURE__ */ jsx(
4361
+ "button",
4362
+ {
4363
+ type: "button",
4364
+ onClick: handleUseConnectedWallet,
4365
+ className: "volr:mt-2 volr:text-xs volr:text-slate-500 hover:volr:text-slate-700 volr:underline",
4366
+ children: t("account.withdraw.useConnectedWallet")
4293
4367
  }
4294
- }
4295
- ),
4368
+ )
4369
+ ] }),
4370
+ /* @__PURE__ */ jsxs("div", { className: "volr:mb-6", children: [
4371
+ /* @__PURE__ */ jsx("label", { className: "volr:block volr:text-sm volr:text-slate-600 volr:mb-2", children: t("account.withdraw.amount") }),
4372
+ /* @__PURE__ */ jsxs("div", { className: "volr:relative", children: [
4373
+ /* @__PURE__ */ jsx(
4374
+ Input,
4375
+ {
4376
+ type: "text",
4377
+ inputMode: "decimal",
4378
+ placeholder: "0.00",
4379
+ value: amount,
4380
+ onChange: (e) => setAmount(e.target.value)
4381
+ }
4382
+ ),
4383
+ /* @__PURE__ */ jsx(
4384
+ "button",
4385
+ {
4386
+ type: "button",
4387
+ onClick: () => setAmount(selectedToken.balance.replace(/,/g, "")),
4388
+ className: "volr:absolute volr:right-3 volr:top-1/2 volr:-translate-y-1/2 volr:text-xs volr:text-slate-500 hover:volr:text-slate-700 volr:font-medium",
4389
+ children: "MAX"
4390
+ }
4391
+ )
4392
+ ] })
4393
+ ] }),
4296
4394
  /* @__PURE__ */ jsx(
4297
- "div",
4395
+ Button,
4298
4396
  {
4299
- className: "volr:absolute volr:w-1.5 volr:h-1.5 volr:bg-emerald-300 volr:rounded-full volr:opacity-0",
4300
- style: {
4301
- bottom: "30%",
4302
- right: "20%",
4303
- animation: "volrParticle4 1.3s ease-out 0.15s forwards"
4304
- }
4397
+ onClick: handleConfirm,
4398
+ disabled: !isAddressValid || !isAmountValid,
4399
+ fullWidth: true,
4400
+ children: t("account.withdraw.confirm")
4305
4401
  }
4306
4402
  )
4307
- ] }),
4308
- /* @__PURE__ */ jsx("style", { children: `
4309
- @keyframes volrGlowPulse {
4310
- 0% {
4311
- transform: scale(0.5);
4312
- opacity: 0;
4313
- }
4314
- 40% {
4315
- opacity: 1;
4316
- }
4317
- 100% {
4318
- transform: scale(1.6);
4319
- opacity: 0;
4320
- }
4321
- }
4322
- @keyframes volrBounceIn {
4323
- 0% {
4324
- transform: scale(0);
4325
- opacity: 0;
4326
- }
4327
- 50% {
4328
- transform: scale(1.2);
4329
- }
4330
- 70% {
4331
- transform: scale(0.9);
4332
- }
4333
- 100% {
4334
- transform: scale(1);
4335
- opacity: 1;
4336
- }
4337
- }
4338
- @keyframes volrPulseGlow {
4339
- 0%, 100% {
4340
- opacity: 0.6;
4341
- }
4342
- 50% {
4343
- opacity: 1;
4344
- }
4345
- }
4346
- @keyframes volrParticle1 {
4347
- 0% {
4348
- transform: translate(0, 0) scale(0);
4349
- opacity: 0;
4350
- }
4351
- 20% {
4352
- opacity: 1;
4353
- }
4354
- 100% {
4355
- transform: translate(-20px, -30px) scale(1);
4356
- opacity: 0;
4357
- }
4358
- }
4359
- @keyframes volrParticle2 {
4360
- 0% {
4361
- transform: translate(0, 0) scale(0);
4362
- opacity: 0;
4363
- }
4364
- 20% {
4365
- opacity: 1;
4366
- }
4367
- 100% {
4368
- transform: translate(25px, -35px) scale(1);
4369
- opacity: 0;
4370
- }
4371
- }
4372
- @keyframes volrParticle3 {
4373
- 0% {
4374
- transform: translate(0, 0) scale(0);
4375
- opacity: 0;
4376
- }
4377
- 20% {
4378
- opacity: 1;
4379
- }
4380
- 100% {
4381
- transform: translate(-30px, 25px) scale(1);
4382
- opacity: 0;
4383
- }
4384
- }
4385
- @keyframes volrParticle4 {
4386
- 0% {
4387
- transform: translate(0, 0) scale(0);
4388
- opacity: 0;
4389
- }
4390
- 20% {
4391
- opacity: 1;
4392
- }
4393
- 100% {
4394
- transform: translate(30px, 30px) scale(1);
4395
- opacity: 0;
4396
- }
4397
- }
4398
- ` })
4399
- ] });
4400
- };
4401
- var DepositCompletedToast = ({
4402
- onClose,
4403
- previousBalance,
4404
- newBalance,
4405
- delta,
4406
- decimals,
4407
- symbol
4408
- }) => {
4409
- const { t } = useI18n();
4410
- const [expanded, setExpanded] = useState(false);
4411
- const formatAmount = (amount) => {
4412
- const divisor = BigInt(10 ** decimals);
4413
- const whole = amount / divisor;
4414
- const fraction = amount % divisor;
4415
- const fractionStr = fraction.toString().padStart(decimals, "0").slice(0, 4);
4416
- const trimmedFraction = fractionStr.replace(/0+$/, "");
4417
- return trimmedFraction ? `${whole}.${trimmedFraction}` : `${whole}`;
4418
- };
4419
- const formattedDelta = formatAmount(delta);
4420
- return /* @__PURE__ */ jsxs(Fragment, { children: [
4421
- /* @__PURE__ */ jsx(
4422
- "div",
4423
- {
4424
- className: "volr:absolute volr:inset-0 volr:bg-black/40 volr:z-40",
4425
- onClick: onClose,
4426
- style: { animation: "volrFadeIn 0.2s ease-out" }
4427
- }
4428
- ),
4429
- /* @__PURE__ */ jsxs(
4430
- "div",
4431
- {
4432
- className: cn(
4433
- // Position: centered at bottom with margin
4434
- "volr:absolute volr:bottom-3 volr:left-3 volr:right-3 volr:z-50",
4435
- // Appearance: floating card
4436
- "volr:bg-white volr:rounded-2xl",
4437
- // Border: full border for clear card definition
4438
- "volr:border volr:border-slate-200",
4439
- // Shadow: strong shadow for floating effect
4440
- "volr:shadow-2xl",
4441
- // Animation
4442
- "volr:transition-all volr:duration-300 volr:ease-out"
4443
- ),
4444
- style: {
4445
- animation: "volrSlideUp 0.3s ease-out"
4446
- },
4447
- children: [
4448
- /* @__PURE__ */ jsx("div", { className: "volr:h-1 volr:bg-linear-to-r volr:from-emerald-400 volr:to-teal-500 volr:rounded-t-2xl" }),
4449
- /* @__PURE__ */ jsx("div", { className: "volr:p-4", children: /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-start volr:gap-3", children: [
4450
- /* @__PURE__ */ jsx("div", { className: "volr:shrink-0 volr:w-10 volr:h-10 volr:rounded-full volr:bg-linear-to-br volr:from-emerald-500 volr:to-teal-500 volr:flex volr:items-center volr:justify-center volr:shadow-md", children: /* @__PURE__ */ jsx(
4451
- "svg",
4403
+ ] });
4404
+ }
4405
+ if (step === "confirm" && selectedToken) {
4406
+ return /* @__PURE__ */ jsxs("div", { className: "volr:py-8 volr:text-center", children: [
4407
+ /* @__PURE__ */ jsx("div", { className: "volr:animate-spin volr:w-8 volr:h-8 volr:border-2 volr:border-slate-200 volr:border-t-slate-600 volr:rounded-full volr:mx-auto volr:mb-4" }),
4408
+ /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-slate-600", children: t("account.withdraw.processing") })
4409
+ ] });
4410
+ }
4411
+ if (step === "result") {
4412
+ const isSuccess = result && !error;
4413
+ return /* @__PURE__ */ jsxs("div", { className: "volr:py-8 volr:text-center", children: [
4414
+ isSuccess ? /* @__PURE__ */ jsxs(Fragment, { children: [
4415
+ /* @__PURE__ */ jsx("div", { className: "volr:w-12 volr:h-12 volr:rounded-full volr:bg-green-100 volr:flex volr:items-center volr:justify-center volr:mx-auto volr:mb-4", children: /* @__PURE__ */ jsx(
4416
+ "svg",
4417
+ {
4418
+ className: "volr:w-6 volr:h-6 volr:text-green-600",
4419
+ fill: "none",
4420
+ viewBox: "0 0 24 24",
4421
+ stroke: "currentColor",
4422
+ children: /* @__PURE__ */ jsx(
4423
+ "path",
4452
4424
  {
4453
- width: "20",
4454
- height: "20",
4455
- viewBox: "0 0 24 24",
4456
- fill: "none",
4457
- stroke: "white",
4458
- strokeWidth: "2.5",
4459
4425
  strokeLinecap: "round",
4460
4426
  strokeLinejoin: "round",
4461
- children: /* @__PURE__ */ jsx("polyline", { points: "20 6 9 17 4 12" })
4427
+ strokeWidth: 2,
4428
+ d: "M5 13l4 4L19 7"
4462
4429
  }
4463
- ) }),
4464
- /* @__PURE__ */ jsxs("div", { className: "volr:flex-1 volr:min-w-0", children: [
4465
- /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-start volr:justify-between volr:gap-2 volr:mb-1", children: [
4466
- /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:font-semibold volr:text-slate-900", children: t("deposit.completed") }),
4467
- /* @__PURE__ */ jsx(
4468
- "button",
4469
- {
4470
- onClick: onClose,
4471
- className: "volr:shrink-0 volr:w-6 volr:h-6 volr:flex volr:items-center volr:justify-center volr:rounded-full volr:transition-colors volr:bg-slate-100 volr:text-slate-500 volr:hover:bg-slate-200",
4472
- "aria-label": "Close",
4473
- children: /* @__PURE__ */ jsxs(
4474
- "svg",
4475
- {
4476
- width: "14",
4477
- height: "14",
4478
- viewBox: "0 0 24 24",
4479
- fill: "none",
4480
- stroke: "currentColor",
4481
- strokeWidth: "2.5",
4482
- children: [
4483
- /* @__PURE__ */ jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
4484
- /* @__PURE__ */ jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
4485
- ]
4486
- }
4487
- )
4488
- }
4489
- )
4490
- ] }),
4491
- /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:font-medium volr:text-slate-700 volr:mb-3", children: t("deposit.completedAmount", { amount: formattedDelta, symbol }) }),
4492
- expanded && /* @__PURE__ */ jsxs(
4493
- "div",
4494
- {
4495
- className: "volr:space-y-2 volr:mb-3 volr:p-3 volr:rounded-lg volr:bg-slate-50 volr:border volr:border-slate-200",
4496
- style: { animation: "volrFadeIn 0.2s ease-out" },
4497
- children: [
4498
- /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:justify-between volr:text-xs", children: [
4499
- /* @__PURE__ */ jsx("span", { className: "volr:text-slate-500", children: t("deposit.amount") }),
4500
- /* @__PURE__ */ jsxs("span", { className: "volr:font-mono volr:text-emerald-600 volr:font-semibold", children: [
4501
- "+",
4502
- formattedDelta,
4503
- " ",
4504
- symbol
4505
- ] })
4506
- ] }),
4507
- /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:justify-between volr:text-xs", children: [
4508
- /* @__PURE__ */ jsx("span", { className: "volr:text-slate-500", children: t("deposit.previousBalance") }),
4509
- /* @__PURE__ */ jsxs("span", { className: "volr:font-mono volr:text-slate-500", children: [
4510
- formatAmount(previousBalance),
4511
- " ",
4512
- symbol
4513
- ] })
4514
- ] }),
4515
- /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:justify-between volr:text-xs volr:pt-2 volr:border-t volr:border-slate-200", children: [
4516
- /* @__PURE__ */ jsx("span", { className: "volr:text-slate-500", children: t("deposit.newBalance") }),
4517
- /* @__PURE__ */ jsxs("span", { className: "volr:font-mono volr:font-semibold volr:text-slate-900", children: [
4518
- formatAmount(newBalance),
4519
- " ",
4520
- symbol
4521
- ] })
4522
- ] })
4523
- ]
4524
- }
4525
- ),
4526
- /* @__PURE__ */ jsx(
4527
- "button",
4528
- {
4529
- onClick: () => setExpanded(!expanded),
4530
- className: "volr:w-full volr:py-2.5 volr:text-xs volr:font-medium volr:rounded-lg volr:transition-colors volr:bg-slate-100 volr:text-slate-600 volr:border volr:border-slate-200 volr:hover:bg-slate-200",
4531
- children: expanded ? t("deposit.seeLess") : t("deposit.seeMore")
4532
- }
4533
- )
4534
- ] })
4535
- ] }) })
4536
- ]
4537
- }
4538
- ),
4539
- /* @__PURE__ */ jsx("style", { children: `
4540
- @keyframes volrSlideUp {
4541
- from {
4542
- transform: translateY(20px);
4543
- opacity: 0;
4544
- }
4545
- to {
4546
- transform: translateY(0);
4547
- opacity: 1;
4548
- }
4549
- }
4550
- @keyframes volrFadeIn {
4551
- from {
4552
- opacity: 0;
4430
+ )
4553
4431
  }
4554
- to {
4555
- opacity: 1;
4432
+ ) }),
4433
+ /* @__PURE__ */ jsx("p", { className: "volr:text-lg volr:font-semibold volr:text-slate-900 volr:mb-2", children: t("account.withdraw.success") }),
4434
+ /* @__PURE__ */ jsxs("p", { className: "volr:text-sm volr:text-slate-500 volr:mb-6", children: [
4435
+ amount,
4436
+ " ",
4437
+ selectedToken?.symbol,
4438
+ " ",
4439
+ t("account.withdraw.sent")
4440
+ ] })
4441
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
4442
+ /* @__PURE__ */ jsx("div", { className: "volr:w-12 volr:h-12 volr:rounded-full volr:bg-red-100 volr:flex volr:items-center volr:justify-center volr:mx-auto volr:mb-4", children: /* @__PURE__ */ jsx(
4443
+ "svg",
4444
+ {
4445
+ className: "volr:w-6 volr:h-6 volr:text-red-600",
4446
+ fill: "none",
4447
+ viewBox: "0 0 24 24",
4448
+ stroke: "currentColor",
4449
+ children: /* @__PURE__ */ jsx(
4450
+ "path",
4451
+ {
4452
+ strokeLinecap: "round",
4453
+ strokeLinejoin: "round",
4454
+ strokeWidth: 2,
4455
+ d: "M6 18L18 6M6 6l12 12"
4456
+ }
4457
+ )
4556
4458
  }
4557
- }
4558
- ` })
4559
- ] });
4560
- };
4561
- var DepositSkeleton = () => {
4562
- return /* @__PURE__ */ jsxs("div", { className: "volr:animate-pulse", children: [
4563
- /* @__PURE__ */ jsxs("div", { className: "volr:mb-4", children: [
4564
- /* @__PURE__ */ jsx("div", { className: "volr:h-7 volr:w-24 volr:rounded volr:mb-2 volr-bg-tertiary" }),
4565
- /* @__PURE__ */ jsx("div", { className: "volr:h-8 volr:w-36 volr:rounded-lg volr-bg-secondary" })
4566
- ] }),
4567
- /* @__PURE__ */ jsx("div", { className: "volr:flex volr:justify-center volr:mb-3", children: /* @__PURE__ */ jsx("div", { className: "volr:rounded-xl volr:p-3 volr:border volr-bg-secondary volr-border", children: /* @__PURE__ */ jsx("div", { className: "volr:w-[200px] volr:h-[200px] volr:rounded-lg volr-bg-tertiary" }) }) }),
4568
- /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:justify-center volr:gap-2 volr:mb-3", children: [
4569
- /* @__PURE__ */ jsx("div", { className: "volr:w-1.5 volr:h-1.5 volr:rounded-full volr-bg-tertiary" }),
4570
- /* @__PURE__ */ jsx("div", { className: "volr:h-3 volr:w-32 volr:rounded volr-bg-tertiary" })
4571
- ] }),
4572
- /* @__PURE__ */ jsx("div", { className: "volr:space-y-3", children: /* @__PURE__ */ jsx("div", { className: "volr:border volr:rounded-lg volr:p-3 volr-bg-secondary volr-border", children: /* @__PURE__ */ jsx("div", { className: "volr:flex volr:items-center volr:justify-center", children: /* @__PURE__ */ jsx("div", { className: "volr:h-4 volr:w-48 volr:rounded volr-bg-tertiary" }) }) }) }),
4573
- /* @__PURE__ */ jsx("div", { className: "volr:text-center volr:pt-3 volr:border-t volr:mt-3 volr-border", children: /* @__PURE__ */ jsx("div", { className: "volr:h-3 volr:w-44 volr:rounded volr:mx-auto volr-bg-secondary" }) })
4574
- ] });
4575
- };
4576
- function DepositQRView(props) {
4459
+ ) }),
4460
+ /* @__PURE__ */ jsx("p", { className: "volr:text-lg volr:font-semibold volr:text-slate-900 volr:mb-2", children: t("account.withdraw.failed") }),
4461
+ /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-red-500 volr:mb-6", children: error?.message || t("account.withdraw.unknownError") })
4462
+ ] }),
4463
+ /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: isSuccess ? onSuccess : handleReset, fullWidth: true, children: isSuccess ? t("common.done") : t("common.tryAgain") })
4464
+ ] });
4465
+ }
4466
+ return null;
4467
+ }
4468
+ function PaymentRow({ payment, onClick }) {
4577
4469
  const { t } = useI18n();
4578
- const { config } = useVolrContext();
4579
- const { client } = useInternalAuth();
4580
- const [chainName, setChainName] = useState(null);
4581
- const [showOtherTokenModal, setShowOtherTokenModal] = useState(false);
4582
- const [showToast, setShowToast] = useState(false);
4583
- const [toastData, setToastData] = useState(null);
4584
- const [viewMode, setViewMode] = useState("qr");
4585
- const eip681 = `ethereum:${props.address}`;
4586
- const status = useDepositListener({
4587
- chainId: props.chainId,
4588
- asset: props.asset === "native" ? { kind: "native" } : {
4589
- kind: "erc20",
4590
- token: {
4591
- address: props.asset.address,
4592
- decimals: props.asset.decimals
4593
- }
4594
- },
4595
- address: props.address
4470
+ const date = new Date(payment.createdAt);
4471
+ const formattedDate = date.toLocaleDateString(void 0, {
4472
+ month: "short",
4473
+ day: "numeric",
4474
+ year: "numeric"
4596
4475
  });
4597
- useEffect(() => {
4598
- if (status.state === "detected") {
4599
- setToastData({
4600
- previousBalance: status.previousBalance,
4601
- newBalance: status.newBalance,
4602
- delta: status.delta
4603
- });
4604
- setShowToast(true);
4476
+ const statusColors = {
4477
+ CONFIRMED: "volr:bg-green-100 volr:text-green-700",
4478
+ PENDING: "volr:bg-yellow-100 volr:text-yellow-700",
4479
+ PROCESSING: "volr:bg-blue-100 volr:text-blue-700",
4480
+ FAILED: "volr:bg-red-100 volr:text-red-700",
4481
+ CANCELLED: "volr:bg-slate-100 volr:text-slate-500",
4482
+ EXPIRED: "volr:bg-slate-100 volr:text-slate-500"
4483
+ };
4484
+ return /* @__PURE__ */ jsxs(
4485
+ "button",
4486
+ {
4487
+ type: "button",
4488
+ onClick,
4489
+ className: "volr:w-full volr:flex volr:items-center volr:justify-between volr:py-3 volr:border-b volr:border-slate-100 hover:volr:bg-slate-50 volr:transition-colors volr:text-left",
4490
+ children: [
4491
+ /* @__PURE__ */ jsxs("div", { className: "volr:flex-1 volr:min-w-0", children: [
4492
+ /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:gap-2 volr:mb-1", children: [
4493
+ /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:font-medium volr:text-slate-900 volr:truncate", children: payment.itemName || t("account.payments.payment") }),
4494
+ /* @__PURE__ */ jsx(
4495
+ "span",
4496
+ {
4497
+ className: `volr:px-1.5 volr:py-0.5 volr:text-xs volr:font-medium volr:rounded ${statusColors[payment.status] || "volr:bg-slate-100 volr:text-slate-500"}`,
4498
+ children: payment.status
4499
+ }
4500
+ )
4501
+ ] }),
4502
+ /* @__PURE__ */ jsx("p", { className: "volr:text-xs volr:text-slate-400", children: formattedDate })
4503
+ ] }),
4504
+ /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:gap-2", children: [
4505
+ /* @__PURE__ */ jsxs("div", { className: "volr:text-right", children: [
4506
+ /* @__PURE__ */ jsxs("p", { className: "volr:text-sm volr:font-medium volr:text-slate-900", children: [
4507
+ payment.amount,
4508
+ " ",
4509
+ payment.token.symbol
4510
+ ] }),
4511
+ payment.totalUsd && /* @__PURE__ */ jsxs("p", { className: "volr:text-xs volr:text-slate-400", children: [
4512
+ "$",
4513
+ parseFloat(payment.totalUsd).toFixed(2)
4514
+ ] })
4515
+ ] }),
4516
+ /* @__PURE__ */ jsx(ChevronRightIcon, { className: "volr:w-4 volr:h-4 volr:text-slate-300" })
4517
+ ] })
4518
+ ]
4605
4519
  }
4606
- }, [status]);
4607
- const getNetworkInfo = useCallback(
4608
- createGetNetworkInfo({ client, rpcOverrides: config.rpcOverrides }),
4609
- [client, config.rpcOverrides]
4610
4520
  );
4521
+ }
4522
+ function PaymentHistoryView({ onSelectPayment }) {
4523
+ const { t } = useI18n();
4524
+ const { getPaymentHistory, isLoading: isApiLoading } = useVolrPaymentApi();
4525
+ const [payments, setPayments] = useState([]);
4526
+ const [isLoading, setIsLoading] = useState(true);
4527
+ const [error, setError] = useState(null);
4611
4528
  useEffect(() => {
4612
- let cancelled = false;
4613
- const loadChainName = async () => {
4614
- try {
4615
- const info = await getNetworkInfo(props.chainId, false);
4616
- if (!cancelled) {
4617
- setChainName(info.name);
4618
- }
4619
- } catch (error) {
4620
- if (!cancelled) {
4621
- setChainName(`Chain ${props.chainId}`);
4622
- }
4623
- }
4624
- };
4625
- loadChainName();
4626
- return () => {
4627
- cancelled = true;
4628
- };
4629
- }, [getNetworkInfo, props.chainId]);
4630
- const tokenSymbol = props.asset === "native" ? "ETH" : props.asset.symbol;
4631
- const displayChainName = chainName || `Chain ${props.chainId}`;
4632
- const decimals = props.asset === "native" ? 18 : props.asset.decimals;
4633
- if (viewMode === "wallet-transfer") {
4634
- return /* @__PURE__ */ jsxs("div", { className: "volr:relative", children: [
4529
+ setIsLoading(true);
4530
+ setError(null);
4531
+ getPaymentHistory({ take: 20 }).then((result) => {
4532
+ setPayments(result.payments);
4533
+ }).catch((err) => {
4534
+ console.error("[PaymentHistoryView] Failed to fetch payments:", err);
4535
+ setError(t("account.payments.fetchError"));
4536
+ }).finally(() => {
4537
+ setIsLoading(false);
4538
+ });
4539
+ }, [getPaymentHistory, t]);
4540
+ if (isLoading || isApiLoading) {
4541
+ return /* @__PURE__ */ jsx("div", { className: "volr:py-8", children: /* @__PURE__ */ jsx("div", { className: "volr:animate-pulse volr:space-y-4", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:justify-between volr:py-3", children: [
4542
+ /* @__PURE__ */ jsxs("div", { children: [
4543
+ /* @__PURE__ */ jsx("div", { className: "volr:h-4 volr:w-32 volr:bg-slate-200 volr:rounded volr:mb-2" }),
4544
+ /* @__PURE__ */ jsx("div", { className: "volr:h-3 volr:w-20 volr:bg-slate-100 volr:rounded" })
4545
+ ] }),
4546
+ /* @__PURE__ */ jsx("div", { className: "volr:h-4 volr:w-16 volr:bg-slate-200 volr:rounded" })
4547
+ ] }, i)) }) });
4548
+ }
4549
+ if (error) {
4550
+ return /* @__PURE__ */ jsx("div", { className: "volr:py-12 volr:text-center", children: /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-red-500", children: error }) });
4551
+ }
4552
+ if (payments.length === 0) {
4553
+ return /* @__PURE__ */ jsx("div", { className: "volr:py-12 volr:text-center", children: /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-slate-400", children: t("account.payments.noPayments") }) });
4554
+ }
4555
+ return /* @__PURE__ */ jsxs("div", { children: [
4556
+ /* @__PURE__ */ jsx("h2", { className: "volr:text-lg volr:font-semibold volr:text-slate-900 volr:mb-4", children: t("account.menu.payments") }),
4557
+ /* @__PURE__ */ jsx("div", { children: payments.map((payment) => /* @__PURE__ */ jsx(
4558
+ PaymentRow,
4559
+ {
4560
+ payment,
4561
+ onClick: () => onSelectPayment(payment)
4562
+ },
4563
+ payment.id
4564
+ )) })
4565
+ ] });
4566
+ }
4567
+ function DetailRow({ label, value, copyable, mono }) {
4568
+ return /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-start volr:justify-between volr:py-2 volr:border-b volr:border-slate-100 last:volr:border-b-0", children: [
4569
+ /* @__PURE__ */ jsx("span", { className: "volr:text-sm volr:text-slate-500", children: label }),
4570
+ /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:gap-2", children: [
4635
4571
  /* @__PURE__ */ jsx(
4636
- WalletTransferView,
4572
+ "span",
4637
4573
  {
4638
- chainId: props.chainId,
4639
- asset: props.asset,
4640
- destinationAddress: props.address,
4641
- onBack: () => setViewMode("qr"),
4642
- onSuccess: () => {
4643
- setViewMode("qr");
4644
- }
4574
+ className: `volr:text-sm volr:text-slate-900 volr:text-right ${mono ? "volr:font-mono" : ""}`,
4575
+ children: value
4645
4576
  }
4646
4577
  ),
4647
- showToast && toastData && /* @__PURE__ */ jsx(
4648
- DepositCompletedToast,
4649
- {
4650
- onClose: () => {
4651
- setShowToast(false);
4652
- setToastData(null);
4653
- },
4654
- previousBalance: toastData.previousBalance,
4655
- newBalance: toastData.newBalance,
4656
- delta: toastData.delta,
4657
- decimals,
4658
- symbol: tokenSymbol
4659
- }
4660
- )
4661
- ] });
4662
- }
4663
- return /* @__PURE__ */ jsxs("div", { className: "volr:relative", children: [
4664
- /* @__PURE__ */ jsxs("div", { className: "volr:mb-4", children: [
4665
- /* @__PURE__ */ jsx("p", { className: "volr:text-xl volr:font-semibold volr:mb-2", children: t("deposit.qrTitle") }),
4666
- /* @__PURE__ */ jsxs("div", { className: "volr:inline-flex volr:items-center volr:gap-2 volr:px-3 volr:py-1.5 volr:rounded-lg volr-bg-secondary", children: [
4667
- /* @__PURE__ */ jsx("span", { className: "volr:text-sm volr:font-medium", children: tokenSymbol }),
4668
- /* @__PURE__ */ jsx("span", { className: "volr-text-muted", children: "\u2022" }),
4669
- /* @__PURE__ */ jsx("span", { className: "volr:text-sm volr-text-secondary", children: displayChainName })
4670
- ] })
4671
- ] }),
4672
- /* @__PURE__ */ jsx("div", { className: "volr:flex volr:justify-center volr:mb-3", children: /* @__PURE__ */ jsxs("div", { className: "volr:relative", children: [
4673
- /* @__PURE__ */ jsx("div", { className: "volr:relative volr:rounded-xl volr:p-4 volr:shadow-sm volr:border volr:z-10 volr:bg-white volr-border", children: /* @__PURE__ */ jsx(
4674
- "img",
4675
- {
4676
- alt: "Deposit QR",
4677
- width: 200,
4678
- height: 200,
4679
- src: `https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(
4680
- eip681
4681
- )}`,
4682
- className: "volr:rounded-md volr:relative volr:z-10"
4683
- }
4684
- ) }),
4685
- /* @__PURE__ */ jsx(DepositQRStatusOverlay, { status: status.state })
4686
- ] }) }),
4687
- (status.state === "listening" || status.state === "idle") && /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:justify-center volr:gap-2 volr:mb-3", children: [
4688
- /* @__PURE__ */ jsx("div", { className: "volr:w-1.5 volr:h-1.5 volr:rounded-full volr:animate-pulse volr-text-secondary", style: { backgroundColor: "currentColor" } }),
4689
- /* @__PURE__ */ jsx("span", { className: "volr:text-xs volr-text-secondary", children: t("deposit.listening") })
4690
- ] }),
4691
- status.state === "error" && /* @__PURE__ */ jsxs("div", { className: "volr:text-xs volr:text-center volr:mb-3 volr-error", children: [
4692
- "Error: ",
4693
- status.message
4694
- ] }),
4695
- /* @__PURE__ */ jsxs("div", { className: "volr:space-y-3", children: [
4696
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("div", { className: "volr:relative volr:border volr:rounded-lg volr:p-3 volr:transition-all volr-bg-secondary volr-border volr-hover", children: /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:justify-between volr:gap-3", children: [
4697
- /* @__PURE__ */ jsx("p", { className: "volr:font-mono volr:text-xs volr:font-medium volr:flex-1 volr:text-center", children: `${props.address.slice(0, 10)}...${props.address.slice(-8)}` }),
4578
+ copyable && /* @__PURE__ */ jsx(CopyButton, { text: value, className: "volr:shrink-0" })
4579
+ ] })
4580
+ ] });
4581
+ }
4582
+ function PaymentDetailView({ payment }) {
4583
+ const { t } = useI18n();
4584
+ const createdDate = new Date(payment.createdAt);
4585
+ const formattedCreatedAt = createdDate.toLocaleString(void 0, {
4586
+ year: "numeric",
4587
+ month: "short",
4588
+ day: "numeric",
4589
+ hour: "2-digit",
4590
+ minute: "2-digit"
4591
+ });
4592
+ const confirmedDate = payment.confirmedAt ? new Date(payment.confirmedAt) : null;
4593
+ const formattedConfirmedAt = confirmedDate ? confirmedDate.toLocaleString(void 0, {
4594
+ year: "numeric",
4595
+ month: "short",
4596
+ day: "numeric",
4597
+ hour: "2-digit",
4598
+ minute: "2-digit"
4599
+ }) : null;
4600
+ const statusColors = {
4601
+ CONFIRMED: "volr:bg-green-100 volr:text-green-700",
4602
+ PENDING: "volr:bg-yellow-100 volr:text-yellow-700",
4603
+ PROCESSING: "volr:bg-blue-100 volr:text-blue-700",
4604
+ FAILED: "volr:bg-red-100 volr:text-red-700",
4605
+ CANCELLED: "volr:bg-slate-100 volr:text-slate-500",
4606
+ EXPIRED: "volr:bg-slate-100 volr:text-slate-500"
4607
+ };
4608
+ const truncateHash = (hash) => {
4609
+ if (hash.length <= 16) return hash;
4610
+ return `${hash.slice(0, 8)}...${hash.slice(-6)}`;
4611
+ };
4612
+ return /* @__PURE__ */ jsxs("div", { children: [
4613
+ /* @__PURE__ */ jsxs("div", { className: "volr:mb-6", children: [
4614
+ /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:gap-2 volr:mb-2", children: [
4615
+ /* @__PURE__ */ jsx("h2", { className: "volr:text-lg volr:font-semibold volr:text-slate-900", children: payment.itemName || t("account.payments.payment") }),
4698
4616
  /* @__PURE__ */ jsx(
4699
- CopyButton,
4617
+ "span",
4700
4618
  {
4701
- text: props.address,
4702
- className: "volr:shrink-0 volr:absolute volr:right-2"
4619
+ className: `volr:px-2 volr:py-0.5 volr:text-xs volr:font-medium volr:rounded ${statusColors[payment.status] || "volr:bg-slate-100 volr:text-slate-500"}`,
4620
+ children: payment.status
4703
4621
  }
4704
4622
  )
4705
- ] }) }) }),
4706
- status.state === "error" && /* @__PURE__ */ jsx("div", { className: "volr:text-xs volr:text-center volr:mb-4 volr-error", children: status.message })
4623
+ ] }),
4624
+ payment.itemDescription && /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-slate-500", children: payment.itemDescription })
4707
4625
  ] }),
4708
- /* @__PURE__ */ jsx("div", { className: "volr:mt-4", children: /* @__PURE__ */ jsxs(
4709
- "button",
4710
- {
4711
- type: "button",
4712
- onClick: () => setViewMode("wallet-transfer"),
4713
- className: "volr:w-full volr:flex volr:items-center volr:justify-center volr:gap-2 volr:py-3 volr:px-4 volr:border volr:border-slate-200 volr:rounded-xl volr:text-sm volr:font-medium volr:text-slate-700 volr:bg-white volr:hover:bg-slate-50 volr:transition-colors",
4714
- children: [
4715
- /* @__PURE__ */ jsxs(
4716
- "svg",
4717
- {
4718
- className: "volr:w-5 volr:h-5",
4719
- viewBox: "0 0 24 24",
4720
- fill: "none",
4721
- stroke: "currentColor",
4722
- strokeWidth: "1.5",
4723
- children: [
4724
- /* @__PURE__ */ jsx("rect", { x: "2", y: "6", width: "20", height: "14", rx: "2" }),
4725
- /* @__PURE__ */ jsx("path", { d: "M17 12.5C17 13.3284 16.3284 14 15.5 14C14.6716 14 14 13.3284 14 12.5C14 11.6716 14.6716 11 15.5 11C16.3284 11 17 11.6716 17 12.5Z", fill: "currentColor" }),
4726
- /* @__PURE__ */ jsx("path", { d: "M6 6V5C6 3.89543 6.89543 3 8 3H16C17.1046 3 18 3.89543 18 5V6" })
4727
- ]
4728
- }
4729
- ),
4730
- t("deposit.useWallet")
4731
- ]
4732
- }
4733
- ) }),
4734
- /* @__PURE__ */ jsx("div", { className: "volr:text-center volr:pt-3 volr:mt-3 volr:border-t volr-border", children: /* @__PURE__ */ jsxs("span", { className: "volr:text-xs volr-text-secondary", children: [
4735
- t("deposit.noToken"),
4736
- " ",
4626
+ /* @__PURE__ */ jsxs("div", { className: "volr:py-4 volr:mb-4 volr:border-y volr:border-slate-100", children: [
4627
+ /* @__PURE__ */ jsxs("p", { className: "volr:text-2xl volr:font-semibold volr:text-slate-900", children: [
4628
+ payment.amount,
4629
+ " ",
4630
+ payment.token.symbol
4631
+ ] }),
4632
+ payment.totalUsd && /* @__PURE__ */ jsxs("p", { className: "volr:text-sm volr:text-slate-500", children: [
4633
+ "\u2248 $",
4634
+ parseFloat(payment.totalUsd).toFixed(2),
4635
+ " USD"
4636
+ ] })
4637
+ ] }),
4638
+ /* @__PURE__ */ jsxs("div", { className: "volr:space-y-1", children: [
4639
+ /* @__PURE__ */ jsx(DetailRow, { label: t("account.payments.createdAt"), value: formattedCreatedAt }),
4640
+ formattedConfirmedAt && /* @__PURE__ */ jsx(DetailRow, { label: t("account.payments.confirmedAt"), value: formattedConfirmedAt }),
4737
4641
  /* @__PURE__ */ jsx(
4738
- TextLinkButton,
4642
+ DetailRow,
4739
4643
  {
4740
- onClick: () => setShowOtherTokenModal(true),
4741
- showArrow: true,
4742
- children: t("deposit.getOtherToken")
4644
+ label: t("account.payments.token"),
4645
+ value: `${payment.token.symbol} (Chain ${payment.token.chainId})`
4646
+ }
4647
+ ),
4648
+ payment.txHash && /* @__PURE__ */ jsx(
4649
+ DetailRow,
4650
+ {
4651
+ label: t("account.payments.txHash"),
4652
+ value: truncateHash(payment.txHash),
4653
+ copyable: true,
4654
+ mono: true
4655
+ }
4656
+ ),
4657
+ payment.referenceId && /* @__PURE__ */ jsx(
4658
+ DetailRow,
4659
+ {
4660
+ label: t("account.payments.referenceId"),
4661
+ value: payment.referenceId,
4662
+ copyable: true
4743
4663
  }
4744
4664
  )
4745
- ] }) }),
4746
- /* @__PURE__ */ jsx(
4747
- OtherTokenModal,
4748
- {
4749
- open: showOtherTokenModal,
4750
- onOpenChange: setShowOtherTokenModal
4751
- }
4752
- ),
4753
- showToast && toastData && /* @__PURE__ */ jsx(
4754
- DepositCompletedToast,
4665
+ ] }),
4666
+ payment.itemImage && /* @__PURE__ */ jsx("div", { className: "volr:mt-6", children: /* @__PURE__ */ jsx(
4667
+ "img",
4755
4668
  {
4756
- onClose: () => {
4757
- setShowToast(false);
4758
- setToastData(null);
4759
- },
4760
- previousBalance: toastData.previousBalance,
4761
- newBalance: toastData.newBalance,
4762
- delta: toastData.delta,
4763
- decimals,
4764
- symbol: tokenSymbol
4669
+ src: payment.itemImage,
4670
+ alt: payment.itemName || "Item",
4671
+ className: "volr:w-full volr:h-40 volr:object-cover volr:rounded-lg"
4765
4672
  }
4766
- )
4673
+ ) })
4767
4674
  ] });
4768
4675
  }
4769
- function DepositModalBody({
4770
- isLoading,
4771
- error,
4772
- depositAssets,
4773
- evmAddress,
4774
- selectedIdx,
4775
- onSelectIdx
4776
- }) {
4777
- if (isLoading) return /* @__PURE__ */ jsx(DepositSkeleton, {});
4778
- if (error) {
4779
- return /* @__PURE__ */ jsxs("div", { className: "volr:relative", children: [
4780
- /* @__PURE__ */ jsx(DepositSkeleton, {}),
4676
+ function InfoRow({ label, value, copyable, mono }) {
4677
+ return /* @__PURE__ */ jsxs("div", { className: "volr:py-3 volr:border-b volr:border-slate-100 last:volr:border-b-0", children: [
4678
+ /* @__PURE__ */ jsx("p", { className: "volr:text-xs volr:text-slate-400 volr:mb-1", children: label }),
4679
+ /* @__PURE__ */ jsxs("div", { className: "volr:flex volr:items-center volr:justify-between volr:gap-2", children: [
4781
4680
  /* @__PURE__ */ jsx(
4782
- "div",
4681
+ "p",
4682
+ {
4683
+ className: `volr:text-sm volr:text-slate-900 volr:break-all ${mono ? "volr:font-mono" : ""}`,
4684
+ children: value
4685
+ }
4686
+ ),
4687
+ copyable && /* @__PURE__ */ jsx(CopyButton, { text: value, className: "volr:shrink-0" })
4688
+ ] })
4689
+ ] });
4690
+ }
4691
+ function AccountInfoView({ user }) {
4692
+ const { t } = useI18n();
4693
+ const getLoginMethod = () => {
4694
+ if (user.authWallet) {
4695
+ return t("account.info.loginMethod.wallet");
4696
+ }
4697
+ if (user.email?.includes("@google.")) {
4698
+ return t("account.info.loginMethod.google");
4699
+ }
4700
+ if (user.email?.includes("@twitter.") || user.email?.includes("@x.")) {
4701
+ return t("account.info.loginMethod.twitter");
4702
+ }
4703
+ if (user.email?.includes("@wallet.")) {
4704
+ return t("account.info.loginMethod.wallet");
4705
+ }
4706
+ return t("account.info.loginMethod.email");
4707
+ };
4708
+ const formatAddress = (address) => {
4709
+ if (address.length <= 16) return address;
4710
+ return `${address.slice(0, 6)}...${address.slice(-4)}`;
4711
+ };
4712
+ const externalWallet = user.authWallet ? user.authWallet.split(":")[1] || user.authWallet : null;
4713
+ return /* @__PURE__ */ jsxs("div", { children: [
4714
+ /* @__PURE__ */ jsx("h2", { className: "volr:text-lg volr:font-semibold volr:text-slate-900 volr:mb-4", children: t("account.menu.account") }),
4715
+ /* @__PURE__ */ jsxs("div", { children: [
4716
+ /* @__PURE__ */ jsx(InfoRow, { label: t("account.info.loginMethod.label"), value: getLoginMethod() }),
4717
+ user.email && !user.email.includes("@wallet.") && /* @__PURE__ */ jsx(InfoRow, { label: t("account.email"), value: user.email }),
4718
+ user.evmAddress && /* @__PURE__ */ jsx(
4719
+ InfoRow,
4783
4720
  {
4784
- className: "volr:absolute volr:inset-0 volr:flex volr:items-center volr:justify-center volr-surface",
4785
- style: { opacity: 0.9 },
4786
- children: /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-center volr:px-4 volr-error", children: error })
4721
+ label: t("account.walletAddress"),
4722
+ value: formatAddress(user.evmAddress),
4723
+ copyable: true,
4724
+ mono: true
4787
4725
  }
4788
- )
4789
- ] });
4790
- }
4791
- if (depositAssets.length === 0) {
4792
- return /* @__PURE__ */ jsxs("div", { className: "volr:relative", children: [
4793
- /* @__PURE__ */ jsx(DepositSkeleton, {}),
4794
- /* @__PURE__ */ jsx(
4795
- "div",
4726
+ ),
4727
+ externalWallet && /* @__PURE__ */ jsx(
4728
+ InfoRow,
4796
4729
  {
4797
- className: "volr:absolute volr:inset-0 volr:flex volr:items-center volr:justify-center volr-surface",
4798
- style: { opacity: 0.9 },
4799
- children: /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-center volr:px-4 volr-text-secondary", children: "No payment token configured. Please contact the app developer." })
4730
+ label: t("account.info.connectedWallet"),
4731
+ value: formatAddress(externalWallet),
4732
+ copyable: true,
4733
+ mono: true
4800
4734
  }
4801
- )
4802
- ] });
4803
- }
4804
- if (!evmAddress) {
4805
- return /* @__PURE__ */ jsxs("div", { className: "volr:relative", children: [
4806
- /* @__PURE__ */ jsx(DepositSkeleton, {}),
4807
- /* @__PURE__ */ jsx(
4808
- "div",
4735
+ ),
4736
+ user.signerType && /* @__PURE__ */ jsx(
4737
+ InfoRow,
4809
4738
  {
4810
- className: "volr:absolute volr:inset-0 volr:flex volr:items-center volr:justify-center volr-surface",
4811
- style: { opacity: 0.9 },
4812
- children: /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-center volr:px-4 volr-text-secondary", children: "Wallet address is not ready. Please finish wallet setup first." })
4739
+ label: t("account.info.signerType"),
4740
+ value: user.signerType === "passkey" ? "Passkey" : user.signerType
4813
4741
  }
4814
4742
  )
4815
- ] });
4816
- }
4817
- if (depositAssets.length === 1) {
4818
- return /* @__PURE__ */ jsx(
4819
- DepositQRView,
4820
- {
4821
- chainId: depositAssets[0].chainId,
4822
- asset: depositAssets[0].token,
4823
- address: evmAddress,
4824
- onBack: void 0
4743
+ ] })
4744
+ ] });
4745
+ }
4746
+ function AccountModal({ isOpen, onClose, onError }) {
4747
+ const { user, logout } = useVolrContext();
4748
+ const { balances, totalUsd, isLoading, paymentEnabled, refresh } = useUserBalances();
4749
+ const { client } = useInternalAuth();
4750
+ const [currentView, setCurrentView] = useState("main");
4751
+ const [selectedPayment, setSelectedPayment] = useState(null);
4752
+ const [isLoggingOut, setIsLoggingOut] = useState(false);
4753
+ const [depositAssets, setDepositAssets] = useState([]);
4754
+ const [depositLoading, setDepositLoading] = useState(false);
4755
+ const [depositError, setDepositError] = useState(null);
4756
+ const [depositSelectedIdx, setDepositSelectedIdx] = useState(-1);
4757
+ useEffect(() => {
4758
+ if (currentView !== "deposit" || !isOpen) return;
4759
+ setDepositLoading(true);
4760
+ setDepositError(null);
4761
+ client.get("/auth/branding").then((response) => {
4762
+ const assets = response.depositAssets ?? [];
4763
+ setDepositAssets(assets);
4764
+ if (assets.length === 1) {
4765
+ setDepositSelectedIdx(0);
4825
4766
  }
4826
- );
4767
+ }).catch((err) => {
4768
+ console.error("Failed to fetch deposit assets:", err);
4769
+ setDepositError("Failed to load deposit options");
4770
+ }).finally(() => {
4771
+ setDepositLoading(false);
4772
+ });
4773
+ }, [currentView, isOpen, client]);
4774
+ const handleOpenChange = useCallback((open) => {
4775
+ if (!open) {
4776
+ onClose();
4777
+ setTimeout(() => {
4778
+ setCurrentView("main");
4779
+ setSelectedPayment(null);
4780
+ }, 200);
4781
+ }
4782
+ }, [onClose]);
4783
+ if (!user) {
4784
+ return /* @__PURE__ */ jsx(SigninModal, { isOpen, onClose, onError });
4827
4785
  }
4828
- if (selectedIdx === -1) {
4829
- return /* @__PURE__ */ jsx(
4830
- AssetSelectView,
4786
+ if (!user.keyStorageType) {
4787
+ const handlePasskeyComplete = () => {
4788
+ onClose();
4789
+ };
4790
+ const handlePasskeyError = (error) => {
4791
+ if (onError) onError(error);
4792
+ };
4793
+ const handleLogoutFromPasskey = async () => {
4794
+ try {
4795
+ await logout();
4796
+ onClose();
4797
+ } catch (error) {
4798
+ if (onError) {
4799
+ onError(error instanceof Error ? error : new Error("Logout failed"));
4800
+ }
4801
+ }
4802
+ };
4803
+ return /* @__PURE__ */ jsx(Modal, { open: isOpen, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsx(
4804
+ PasskeyEnrollView,
4831
4805
  {
4832
- assets: depositAssets,
4833
- onSelect: (idx) => onSelectIdx(idx)
4806
+ wrapInModal: false,
4807
+ onComplete: handlePasskeyComplete,
4808
+ onError: handlePasskeyError,
4809
+ onLogout: handleLogoutFromPasskey,
4810
+ onClose
4834
4811
  }
4835
- );
4812
+ ) });
4836
4813
  }
4837
- const selected = depositAssets[selectedIdx];
4838
- return /* @__PURE__ */ jsx(
4839
- DepositQRView,
4840
- {
4841
- chainId: selected.chainId,
4842
- asset: selected.token,
4843
- address: evmAddress,
4844
- onBack: () => onSelectIdx(-1)
4814
+ const handleLogout = async () => {
4815
+ setIsLoggingOut(true);
4816
+ try {
4817
+ await logout();
4818
+ onClose();
4819
+ } catch (error) {
4820
+ if (onError) {
4821
+ onError(error instanceof Error ? error : new Error("Logout failed"));
4822
+ }
4823
+ } finally {
4824
+ setIsLoggingOut(false);
4845
4825
  }
4846
- );
4826
+ };
4827
+ const handleNavigate = (view) => {
4828
+ setCurrentView(view);
4829
+ };
4830
+ const handleBack = () => {
4831
+ if (selectedPayment) {
4832
+ setSelectedPayment(null);
4833
+ setCurrentView("payments");
4834
+ } else if (currentView === "deposit" && depositSelectedIdx >= 0 && depositAssets.length > 1) {
4835
+ setDepositSelectedIdx(-1);
4836
+ } else {
4837
+ setCurrentView("main");
4838
+ setDepositSelectedIdx(-1);
4839
+ }
4840
+ };
4841
+ const handleSelectPayment = (payment) => {
4842
+ setSelectedPayment(payment);
4843
+ };
4844
+ const handleWithdrawSuccess = () => {
4845
+ refresh();
4846
+ setCurrentView("main");
4847
+ };
4848
+ const showBack = currentView !== "main" || selectedPayment !== null || currentView === "deposit" && depositSelectedIdx >= 0 && depositAssets.length > 1;
4849
+ const renderContent = () => {
4850
+ if (selectedPayment) {
4851
+ return /* @__PURE__ */ jsx(PaymentDetailView, { payment: selectedPayment });
4852
+ }
4853
+ switch (currentView) {
4854
+ case "main":
4855
+ return /* @__PURE__ */ jsx(
4856
+ AccountMainView,
4857
+ {
4858
+ totalUsd,
4859
+ balances,
4860
+ isLoading,
4861
+ paymentEnabled,
4862
+ onNavigate: handleNavigate,
4863
+ onLogout: handleLogout,
4864
+ isLoggingOut
4865
+ }
4866
+ );
4867
+ case "assets":
4868
+ return /* @__PURE__ */ jsx(BalanceDetailView, { balances, isLoading });
4869
+ case "deposit":
4870
+ return /* @__PURE__ */ jsx(
4871
+ DepositModalBody,
4872
+ {
4873
+ isLoading: depositLoading,
4874
+ error: depositError,
4875
+ depositAssets,
4876
+ evmAddress: user.evmAddress,
4877
+ selectedIdx: depositSelectedIdx,
4878
+ onSelectIdx: setDepositSelectedIdx
4879
+ }
4880
+ );
4881
+ case "withdraw":
4882
+ return /* @__PURE__ */ jsx(
4883
+ WithdrawView,
4884
+ {
4885
+ balances,
4886
+ connectedWallet: user.authWallet,
4887
+ onSuccess: handleWithdrawSuccess
4888
+ }
4889
+ );
4890
+ case "payments":
4891
+ return /* @__PURE__ */ jsx(PaymentHistoryView, { onSelectPayment: handleSelectPayment });
4892
+ case "account":
4893
+ return /* @__PURE__ */ jsx(AccountInfoView, { user });
4894
+ default:
4895
+ return null;
4896
+ }
4897
+ };
4898
+ return /* @__PURE__ */ jsxs(Modal, { open: isOpen, onOpenChange: handleOpenChange, children: [
4899
+ /* @__PURE__ */ jsx(
4900
+ ModalHeader,
4901
+ {
4902
+ back: showBack,
4903
+ onBack: showBack ? handleBack : void 0,
4904
+ onClose
4905
+ }
4906
+ ),
4907
+ renderContent()
4908
+ ] });
4847
4909
  }
4848
4910
  var DepositModal = ({
4849
4911
  open,
@@ -5689,71 +5751,92 @@ var PaymentInfoView = ({
5689
5751
  var PaymentProcessingView = ({
5690
5752
  step
5691
5753
  }) => {
5754
+ const { t } = useI18n();
5692
5755
  const getStatusMessage = () => {
5693
5756
  switch (step) {
5694
5757
  case "signing":
5695
- return "Waiting for confirmation...";
5758
+ return t("payment.processing.signing");
5696
5759
  case "broadcasting":
5697
- return "Sending payment...";
5760
+ return t("payment.processing.broadcasting");
5698
5761
  case "confirming":
5699
- return "Almost done...";
5762
+ return t("payment.processing.confirming");
5700
5763
  default:
5701
- return "Processing...";
5764
+ return t("payment.processing.default");
5702
5765
  }
5703
5766
  };
5704
- const getProgress = () => {
5767
+ const getStepIndex = () => {
5705
5768
  switch (step) {
5706
5769
  case "signing":
5707
- return 20;
5770
+ return 0;
5708
5771
  case "broadcasting":
5709
- return 60;
5772
+ return 1;
5710
5773
  case "confirming":
5711
- return 90;
5774
+ return 2;
5712
5775
  default:
5713
5776
  return 0;
5714
5777
  }
5715
5778
  };
5716
- const progress = getProgress();
5717
- return /* @__PURE__ */ jsxs("div", { className: "volr:space-y-8 volr:py-4", children: [
5718
- /* @__PURE__ */ jsx("div", { className: "volr:flex volr:justify-center", children: /* @__PURE__ */ jsxs("div", { className: "volr:relative volr:w-20 volr:h-20", children: [
5719
- /* @__PURE__ */ jsxs("svg", { className: "volr:w-20 volr:h-20", viewBox: "0 0 36 36", children: [
5720
- /* @__PURE__ */ jsx(
5721
- "circle",
5722
- {
5723
- cx: "18",
5724
- cy: "18",
5725
- r: "16",
5726
- fill: "none",
5727
- stroke: "currentColor",
5728
- strokeWidth: "2",
5729
- className: "volr:text-slate-100"
5779
+ const currentStep = getStepIndex();
5780
+ return /* @__PURE__ */ jsxs("div", { className: "volr:py-8 volr:px-4", children: [
5781
+ /* @__PURE__ */ jsx("div", { className: "volr:flex volr:justify-center volr:mb-8", children: /* @__PURE__ */ jsxs("div", { className: "volr:relative", children: [
5782
+ /* @__PURE__ */ jsx(
5783
+ "div",
5784
+ {
5785
+ className: "volr:w-20 volr:h-20 volr:rounded-full volr:border-2 volr:border-slate-200",
5786
+ style: {
5787
+ borderTopColor: "#1e293b",
5788
+ animation: "volrSpin 1.2s linear infinite"
5730
5789
  }
5731
- ),
5732
- /* @__PURE__ */ jsx(
5733
- "circle",
5734
- {
5735
- cx: "18",
5736
- cy: "18",
5737
- r: "16",
5738
- fill: "none",
5739
- stroke: "currentColor",
5740
- strokeWidth: "2",
5741
- strokeLinecap: "round",
5742
- className: "volr:text-slate-900 volr:transition-all volr:duration-500",
5743
- strokeDasharray: `${progress}, 100`,
5744
- style: {
5745
- transform: "rotate(-90deg)",
5746
- transformOrigin: "center"
5790
+ }
5791
+ ),
5792
+ /* @__PURE__ */ jsx("div", { className: "volr:absolute volr:inset-0 volr:flex volr:items-center volr:justify-center", children: /* @__PURE__ */ jsx(
5793
+ "div",
5794
+ {
5795
+ className: "volr:w-10 volr:h-10 volr:rounded-full volr:bg-slate-900 volr:flex volr:items-center volr:justify-center",
5796
+ style: { animation: "volrPulse 2s ease-in-out infinite" },
5797
+ children: /* @__PURE__ */ jsx(
5798
+ "svg",
5799
+ {
5800
+ width: "20",
5801
+ height: "20",
5802
+ viewBox: "0 0 24 24",
5803
+ fill: "none",
5804
+ stroke: "white",
5805
+ strokeWidth: "2",
5806
+ strokeLinecap: "round",
5807
+ strokeLinejoin: "round",
5808
+ children: /* @__PURE__ */ jsx("path", { d: "M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6" })
5747
5809
  }
5748
- }
5749
- )
5750
- ] }),
5751
- /* @__PURE__ */ jsx("div", { className: "volr:absolute volr:inset-0 volr:flex volr:items-center volr:justify-center", children: /* @__PURE__ */ jsx("div", { className: "volr:w-2 volr:h-2 volr:bg-slate-900 volr:rounded-full volr:animate-pulse" }) })
5810
+ )
5811
+ }
5812
+ ) })
5752
5813
  ] }) }),
5753
- /* @__PURE__ */ jsxs("div", { className: "volr:text-center volr:space-y-2", children: [
5754
- /* @__PURE__ */ jsx("p", { className: "volr:text-lg volr:font-medium volr:text-slate-900", children: getStatusMessage() }),
5755
- /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-slate-400", children: "Please don't close this window" })
5756
- ] })
5814
+ /* @__PURE__ */ jsxs("div", { className: "volr:text-center volr:mb-6", children: [
5815
+ /* @__PURE__ */ jsx("p", { className: "volr:text-lg volr:font-semibold volr:text-slate-900 volr:mb-1", children: getStatusMessage() }),
5816
+ /* @__PURE__ */ jsx("p", { className: "volr:text-sm volr:text-slate-500", children: t("payment.processing.doNotClose") })
5817
+ ] }),
5818
+ /* @__PURE__ */ jsx("div", { className: "volr:flex volr:items-center volr:justify-center volr:gap-2", children: [0, 1, 2].map((stepIdx) => /* @__PURE__ */ jsx(
5819
+ "div",
5820
+ {
5821
+ className: `volr:h-1.5 volr:rounded-full volr:transition-all volr:duration-300 ${stepIdx <= currentStep ? "volr:bg-slate-900 volr:w-8" : "volr:bg-slate-200 volr:w-6"}`,
5822
+ style: stepIdx === currentStep ? { animation: "volrProgressPulse 1.5s ease-in-out infinite" } : void 0
5823
+ },
5824
+ stepIdx
5825
+ )) }),
5826
+ /* @__PURE__ */ jsx("style", { children: `
5827
+ @keyframes volrSpin {
5828
+ from { transform: rotate(0deg); }
5829
+ to { transform: rotate(360deg); }
5830
+ }
5831
+ @keyframes volrPulse {
5832
+ 0%, 100% { transform: scale(1); opacity: 1; }
5833
+ 50% { transform: scale(0.95); opacity: 0.85; }
5834
+ }
5835
+ @keyframes volrProgressPulse {
5836
+ 0%, 100% { opacity: 1; }
5837
+ 50% { opacity: 0.6; }
5838
+ }
5839
+ ` })
5757
5840
  ] });
5758
5841
  };
5759
5842
  var PaymentResultView = ({