@b3dotfun/sdk 0.0.65-test.4 → 0.0.65-test.6

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.
Files changed (90) hide show
  1. package/dist/cjs/anyspend/react/components/AnySpend.js +1 -1
  2. package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +2 -1
  3. package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.js +2 -2
  4. package/dist/cjs/anyspend/react/components/common/OrderDetails.js +1 -1
  5. package/dist/cjs/anyspend/react/components/common/OrderHistory.js +1 -1
  6. package/dist/cjs/anyspend/react/components/common/OrderHistoryItem.js +1 -1
  7. package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +4 -2
  8. package/dist/cjs/anyspend/react/components/common/RecipientSelection.js +1 -1
  9. package/dist/cjs/anyspend/react/hooks/useConnectedWalletDisplay.js +2 -1
  10. package/dist/cjs/global-account/react/components/AccountAssets/AccountAssets.js +9 -9
  11. package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +3 -3
  12. package/dist/cjs/global-account/react/components/B3DynamicModal.js +2 -1
  13. package/dist/cjs/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.js +1 -1
  14. package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.js +30 -9
  15. package/dist/cjs/global-account/react/components/ManageAccount/BottomNavigation.js +1 -1
  16. package/dist/cjs/global-account/react/components/ManageAccount/Header.js +2 -2
  17. package/dist/cjs/global-account/react/components/ManageAccount/HomeActions.js +1 -1
  18. package/dist/cjs/global-account/react/components/ManageAccount/HomeContent.js +1 -1
  19. package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +1 -1
  20. package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.js +5 -1
  21. package/dist/cjs/global-account/react/components/ManageAccount/SettingsMenuItem.js +1 -1
  22. package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +1 -1
  23. package/dist/cjs/global-account/react/components/ModalHeader/ModalHeader.js +1 -1
  24. package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +1 -1
  25. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +1 -1
  26. package/dist/cjs/global-account/react/components/ui/Tabs.js +1 -1
  27. package/dist/cjs/global-account/react/components/ui/dialog.js +1 -1
  28. package/dist/cjs/global-account/react/utils/profileDisplay.d.ts +1 -0
  29. package/dist/cjs/global-account/react/utils/profileDisplay.js +1 -1
  30. package/dist/esm/anyspend/react/components/AnySpend.js +1 -1
  31. package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +3 -2
  32. package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.js +2 -2
  33. package/dist/esm/anyspend/react/components/common/OrderDetails.js +1 -1
  34. package/dist/esm/anyspend/react/components/common/OrderHistory.js +1 -1
  35. package/dist/esm/anyspend/react/components/common/OrderHistoryItem.js +1 -1
  36. package/dist/esm/anyspend/react/components/common/PanelOnramp.js +4 -2
  37. package/dist/esm/anyspend/react/components/common/RecipientSelection.js +1 -1
  38. package/dist/esm/anyspend/react/hooks/useConnectedWalletDisplay.js +2 -1
  39. package/dist/esm/global-account/react/components/AccountAssets/AccountAssets.js +9 -9
  40. package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +3 -3
  41. package/dist/esm/global-account/react/components/B3DynamicModal.js +2 -1
  42. package/dist/esm/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.js +1 -1
  43. package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.js +31 -10
  44. package/dist/esm/global-account/react/components/ManageAccount/BottomNavigation.js +1 -1
  45. package/dist/esm/global-account/react/components/ManageAccount/Header.js +2 -2
  46. package/dist/esm/global-account/react/components/ManageAccount/HomeActions.js +1 -1
  47. package/dist/esm/global-account/react/components/ManageAccount/HomeContent.js +1 -1
  48. package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +1 -1
  49. package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.js +5 -1
  50. package/dist/esm/global-account/react/components/ManageAccount/SettingsMenuItem.js +1 -1
  51. package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +1 -1
  52. package/dist/esm/global-account/react/components/ModalHeader/ModalHeader.js +2 -2
  53. package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +1 -1
  54. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +1 -1
  55. package/dist/esm/global-account/react/components/ui/Tabs.js +1 -1
  56. package/dist/esm/global-account/react/components/ui/dialog.js +1 -1
  57. package/dist/esm/global-account/react/utils/profileDisplay.d.ts +1 -0
  58. package/dist/esm/global-account/react/utils/profileDisplay.js +1 -1
  59. package/dist/styles/index.css +1 -1
  60. package/dist/types/global-account/react/utils/profileDisplay.d.ts +1 -0
  61. package/package.json +1 -1
  62. package/src/anyspend/react/components/AnySpend.tsx +1 -1
  63. package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +7 -2
  64. package/src/anyspend/react/components/common/FiatPaymentMethod.tsx +2 -2
  65. package/src/anyspend/react/components/common/OrderDetails.tsx +4 -1
  66. package/src/anyspend/react/components/common/OrderHistory.tsx +1 -1
  67. package/src/anyspend/react/components/common/OrderHistoryItem.tsx +4 -4
  68. package/src/anyspend/react/components/common/PanelOnramp.tsx +5 -2
  69. package/src/anyspend/react/components/common/RecipientSelection.tsx +1 -1
  70. package/src/anyspend/react/hooks/useConnectedWalletDisplay.ts +2 -1
  71. package/src/global-account/react/components/AccountAssets/AccountAssets.tsx +20 -20
  72. package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +4 -4
  73. package/src/global-account/react/components/B3DynamicModal.tsx +5 -1
  74. package/src/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.tsx +1 -1
  75. package/src/global-account/react/components/LinkAccount/LinkAccount.tsx +43 -15
  76. package/src/global-account/react/components/ManageAccount/BottomNavigation.tsx +1 -1
  77. package/src/global-account/react/components/ManageAccount/Header.tsx +10 -10
  78. package/src/global-account/react/components/ManageAccount/HomeActions.tsx +1 -1
  79. package/src/global-account/react/components/ManageAccount/HomeContent.tsx +2 -2
  80. package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +3 -1
  81. package/src/global-account/react/components/ManageAccount/SettingsContent.tsx +8 -2
  82. package/src/global-account/react/components/ManageAccount/SettingsMenuItem.tsx +1 -1
  83. package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +3 -1
  84. package/src/global-account/react/components/ModalHeader/ModalHeader.tsx +6 -3
  85. package/src/global-account/react/components/SignInWithB3/SignIn.tsx +1 -1
  86. package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +1 -1
  87. package/src/global-account/react/components/ui/Tabs.tsx +1 -1
  88. package/src/global-account/react/components/ui/dialog.tsx +3 -12
  89. package/src/global-account/react/utils/profileDisplay.ts +2 -1
  90. package/src/styles/index.css +6 -0
@@ -45,7 +45,7 @@ function SignIn(props) {
45
45
  // Desktop version - original dropdown menu
46
46
  return ((0, jsx_runtime_1.jsx)(react_1.StyleRoot, { children: (0, jsx_runtime_1.jsx)(react_2.Menu, { className: `relative flex items-center ${className || ""}`, as: "div", children: globalAddress ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_2.MenuButton, { className: "bg-b3-react-background group flex h-10 items-center gap-1 rounded-xl px-3 focus:outline-none", children: [!!walletImage && ((0, jsx_runtime_1.jsx)(react_1.IPFSMediaRenderer, { src: walletImage, alt: "Wallet Image", className: "bg-b3-react-primary h-6 w-6 rounded-full object-cover opacity-100" })), (0, jsx_runtime_1.jsx)("div", { className: "text-as-primary", children: ensName ? ensName : (0, utils_1.truncateAddress)(globalAddress) })] }), (0, jsx_runtime_1.jsx)(react_2.Transition, { enter: "duration-200 ease-out", enterFrom: "scale-95 opacity-0", enterTo: "scale-100 opacity-100", leave: "duration-300 ease-out", leaveFrom: "scale-100 opacity-100", leaveTo: "scale-95 opacity-0", children: (0, jsx_runtime_1.jsx)(react_2.MenuItems, { className: "b3-root absolute -right-4 top-full min-w-64 rounded-2xl border focus:outline-none lg:right-0", modal: false,
47
47
  // TODO: Figure out why setting anchor on mobile causes z-index issues where it appears under elements
48
- anchor: isMobile ? "top end" : undefined, children: (0, jsx_runtime_1.jsxs)("div", { className: "bg-b3-react-background", children: [connectedEOAWallet ? ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)("border-b3-react-subtle bg-b3-react-background flex cursor-pointer items-center justify-between rounded-xl p-3"), onClick: () => handleSetActiveAccount(connectedEOAWallet?.id), children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center", children: [(0, jsx_runtime_1.jsx)("img", { className: "bg-b3-react-primary h-16 w-16 rounded-full opacity-100", src: eoaWalletIcon, alt: connectedEOAWallet?.id }), (0, jsx_runtime_1.jsxs)("div", { className: "ml-4 grow", children: [ensName && (0, jsx_runtime_1.jsx)("div", { children: ensName }), (0, jsx_runtime_1.jsx)("div", { children: (0, utils_1.truncateAddress)(globalAddress) }), (0, jsx_runtime_1.jsx)("div", { children: walletInfo?.name })] })] }), isActiveEOAWallet && (0, jsx_runtime_1.jsx)(Icon_1.default, { className: "fill-b3-react-primary", name: "check" })] })) : (connectedSmartWallet && ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)("mb-2 flex cursor-pointer items-center justify-between rounded-xl p-3", isActiveSmartWallet
48
+ anchor: isMobile ? "top end" : undefined, children: (0, jsx_runtime_1.jsxs)("div", { className: "bg-b3-react-background", children: [connectedEOAWallet ? ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)("border-b3-react-subtle bg-b3-react-background flex cursor-pointer items-center justify-between rounded-xl p-3"), onClick: () => handleSetActiveAccount(connectedEOAWallet?.id), children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center", children: [(0, jsx_runtime_1.jsx)("img", { className: "bg-b3-react-primary h-16 w-16 rounded-full opacity-100", src: eoaWalletIcon, alt: connectedEOAWallet?.id }), (0, jsx_runtime_1.jsxs)("div", { className: "ml-4 grow", children: [ensName && (0, jsx_runtime_1.jsx)("div", { children: ensName }), (0, jsx_runtime_1.jsx)("div", { children: (0, utils_1.truncateAddress)(globalAddress) })] })] }), isActiveEOAWallet && (0, jsx_runtime_1.jsx)(Icon_1.default, { className: "fill-b3-react-primary", name: "check" })] })) : (connectedSmartWallet && ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)("mb-2 flex cursor-pointer items-center justify-between rounded-xl p-3", isActiveSmartWallet
49
49
  ? "bg-b3-react-background"
50
50
  : "bg-b3-react-background hover:bg-b3-react-background"), onClick: () => handleSetActiveAccount(connectedSmartWallet?.id), children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center", children: [(0, jsx_runtime_1.jsx)("img", { className: "bg-b3-react-primary h-16 w-16 rounded-full opacity-100", src: smartWalletIcon, alt: connectedSmartWallet?.id }), (0, jsx_runtime_1.jsxs)("div", { className: "grow pl-4", children: [ensName && (0, jsx_runtime_1.jsx)("div", { children: ensName }), (0, jsx_runtime_1.jsx)("div", { children: (0, utils_1.truncateAddress)(globalAddress) }), (0, jsx_runtime_1.jsx)("div", { children: "Smart wallet" })] })] }), isActiveSmartWallet && (0, jsx_runtime_1.jsx)(Icon_1.default, { className: "fill-b3-react-primary", name: "check" })] }))), (0, jsx_runtime_1.jsx)("div", { className: "ml-3", children: (0, jsx_runtime_1.jsx)(ManageAccountButton_1.ManageAccountButton, { ...props, className: "w-[calc(100%-12px)]" }) }), (0, jsx_runtime_1.jsx)("button", { className: "mb-2 w-full space-y-1", onClick: onDisconnect, children: (0, jsx_runtime_1.jsxs)("div", { className: "hover:bg-b3-react-background group flex h-12 items-center rounded-xl px-4 transition-colors", children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { className: "fill-b3-react-primary mr-4 shrink-0 transition-colors", name: "logout" }), (0, jsx_runtime_1.jsx)("div", { className: "text-b3-react-primary mr-auto transition-colors", children: "Disconnect" })] }) })] }) }) })] })) : ((0, jsx_runtime_1.jsx)(react_1.SignInWithB3, { closeAfterLogin: true, onLoginSuccess: async (globalAccount) => {
51
51
  console.log("User authenticated with Global Account!", globalAccount);
@@ -176,7 +176,7 @@ function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySuccess, onE
176
176
  return ((0, jsx_runtime_1.jsx)(LoginStep_1.LoginStepContainer, { partnerId: partnerId, children: (0, jsx_runtime_1.jsx)("div", { className: "p-4 text-center text-red-500", children: refetchError }) }));
177
177
  }
178
178
  if (isAuthenticating || (isFetchingSigners && step === "login") || source === "requestPermissions") {
179
- return ((0, jsx_runtime_1.jsx)(LoginStep_1.LoginStepContainer, { partnerId: partnerId, children: (0, jsx_runtime_1.jsx)("div", { className: "mt-8 flex items-center justify-center", children: (0, jsx_runtime_1.jsx)(react_1.Loading, { variant: "white", size: "lg" }) }) }));
179
+ return ((0, jsx_runtime_1.jsx)(LoginStep_1.LoginStepContainer, { partnerId: partnerId, children: (0, jsx_runtime_1.jsx)("div", { className: "my-8 flex min-h-[350px] items-center justify-center", children: (0, jsx_runtime_1.jsx)(react_1.Loading, { variant: "white", size: "lg" }) }) }));
180
180
  }
181
181
  if (step === "login") {
182
182
  // Custom strategy
@@ -46,7 +46,7 @@ function TabsList({ className, ...props }) {
46
46
  return (0, jsx_runtime_1.jsx)(TabsPrimitive.List, { className: (0, utils_1.cn)("", className), ...props });
47
47
  }
48
48
  function TabTrigger({ className, ...props }) {
49
- return ((0, jsx_runtime_1.jsx)(TabsPrimitive.Trigger, { className: (0, utils_1.cn)("text-md inline-flex h-full items-center justify-center whitespace-nowrap px-3 font-semibold transition-all", "focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50", "data-[state=active]:text-b3-react-primary data-[state=active]:font-bold", "hover:text-b3-react-foreground data-[state=inactive]:text-b3-react-muted-foreground", "flex-1", className), ...props }));
49
+ return ((0, jsx_runtime_1.jsx)(TabsPrimitive.Trigger, { className: (0, utils_1.cn)("text-md inline-flex h-full items-center justify-center whitespace-nowrap px-3 font-semibold transition-all", "focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50", "data-[state=active]:font-bold data-[state=active]:text-[#0B57C2]", "hover:text-b3-react-foreground data-[state=inactive]:text-b3-react-muted-foreground", "flex-1", className), ...props }));
50
50
  }
51
51
  function TabsContent({ className, ...props }) {
52
52
  return ((0, jsx_runtime_1.jsx)(TabsPrimitive.Content, { className: (0, utils_1.cn)("ring-offset-b3-react-background focus-visible:ring-b3-react-ring mt-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2", className), ...props }));
@@ -53,7 +53,7 @@ exports.DialogOverlay = DialogOverlay;
53
53
  DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
54
54
  const DialogContent = React.forwardRef(({ className, children, hideCloseButton = true, closeBtnClassName, ...props }, ref) => {
55
55
  const container = typeof window !== "undefined" ? document.getElementById("b3-root") : null;
56
- return ((0, jsx_runtime_1.jsxs)(DialogPortal, { container: container, children: [(0, jsx_runtime_1.jsx)(DialogOverlay, {}), (0, jsx_runtime_1.jsxs)(DialogPrimitive.Content, { ref: ref, className: (0, utils_1.cn)("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 border shadow-lg !outline-none", "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 duration-500", "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", "data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]", "[perspective:1200px] [transform-style:preserve-3d] sm:rounded-xl", "transition-all ease-out", className), ...props, children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-1 flex-col overflow-hidden rounded-xl border border-[#D1D1D6] bg-white shadow-[0_20px_24px_-4px_rgba(10,13,18,0.08),0_8px_8px_-4px_rgba(10,13,18,0.03),0_3px_3px_-1.5px_rgba(10,13,18,0.04)]", children: [children, !hideCloseButton && ((0, jsx_runtime_1.jsxs)(DialogPrimitive.Close, { className: (0, utils_1.cn)("modal-close-button data-[state=open]:bg-b3-react-background data-[state=open]:text-b3-react-muted-foreground absolute right-2 top-2 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none dark:data-[state=open]:bg-gray-800 dark:data-[state=open]:text-gray-400", closeBtnClassName), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "h-5 w-5" }), (0, jsx_runtime_1.jsx)("span", { className: "sr-only", children: "Close" })] }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center gap-1.5 pt-[10px]", children: [(0, jsx_runtime_1.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsx)("path", { d: "M2 4.66667C2 3.19391 3.19391 2 4.66667 2H11.3333C12.8061 2 14 3.19391 14 4.66667V11.3333C14 12.8061 12.8061 14 11.3333 14H4.66667C3.19391 14 2 12.8061 2 11.3333V4.66667Z", fill: "#0B57C2" }), (0, jsx_runtime_1.jsx)("path", { d: "M5.33333 6C5.33333 5.63181 5.63181 5.33333 6 5.33333H10C10.3682 5.33333 10.6667 5.63181 10.6667 6V10C10.6667 10.3682 10.3682 10.6667 10 10.6667H6C5.63181 10.6667 5.33333 10.3682 5.33333 10V6Z", fill: "white" })] }), (0, jsx_runtime_1.jsx)("span", { className: "font-neue-montreal-semibold text-xs uppercase leading-none tracking-[0.72px] text-[#0B57C2]", children: "Global Account" })] })] })] }));
56
+ return ((0, jsx_runtime_1.jsxs)(DialogPortal, { container: container, children: [(0, jsx_runtime_1.jsx)(DialogOverlay, {}), (0, jsx_runtime_1.jsxs)(DialogPrimitive.Content, { ref: ref, className: (0, utils_1.cn)("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 border shadow-lg !outline-none", "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 duration-500", "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", "data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]", "[perspective:1200px] [transform-style:preserve-3d] sm:rounded-xl", "transition-all ease-out", className), ...props, children: [(0, jsx_runtime_1.jsxs)("div", { className: "modal-inner-content flex flex-1 flex-col overflow-hidden rounded-xl border border-[#D1D1D6] bg-white shadow-[0_20px_24px_-4px_rgba(10,13,18,0.08),0_8px_8px_-4px_rgba(10,13,18,0.03),0_3px_3px_-1.5px_rgba(10,13,18,0.04)]", children: [children, !hideCloseButton && ((0, jsx_runtime_1.jsxs)(DialogPrimitive.Close, { className: (0, utils_1.cn)("modal-close-button data-[state=open]:bg-b3-react-background data-[state=open]:text-b3-react-muted-foreground absolute right-2 top-2 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none dark:data-[state=open]:bg-gray-800 dark:data-[state=open]:text-gray-400", closeBtnClassName), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "h-5 w-5" }), (0, jsx_runtime_1.jsx)("span", { className: "sr-only", children: "Close" })] }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "b3-modal-ga-branding flex items-center justify-center gap-1.5 pt-[10px]", children: [(0, jsx_runtime_1.jsx)("img", { src: "https://cdn.b3.fun/b3_logo.svg", alt: "B3", className: "h-4 w-4" }), (0, jsx_runtime_1.jsx)("span", { className: "font-neue-montreal-semibold text-xs uppercase leading-none tracking-[0.72px] text-[#0B57C2]", children: "Global Account" })] })] })] }));
57
57
  });
58
58
  exports.DialogContent = DialogContent;
59
59
  DialogContent.displayName = DialogPrimitive.Content.displayName;
@@ -6,6 +6,7 @@ import { type Profile } from "thirdweb/wallets";
6
6
  */
7
7
  export declare function validateImageUrl(url: string | null | undefined): string | null;
8
8
  export interface ExtendedProfileDetails {
9
+ fid?: string;
9
10
  id?: string;
10
11
  email?: string;
11
12
  phone?: string;
@@ -80,7 +80,7 @@ function getProfileDisplayInfo(profile) {
80
80
  break;
81
81
  case "farcaster":
82
82
  displayInfo = {
83
- title: details.name || details.username || "Unknown",
83
+ title: details.name || details.username || "FID:" + details?.fid || "Unknown",
84
84
  subtitle: details.username ? `@${details.username}` : "Farcaster Account",
85
85
  imageUrl: validateImageUrl(details.pfpUrl || details.profileImageUrl),
86
86
  initial: "F",
@@ -787,7 +787,7 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
787
787
  };
788
788
  }, [activePanel, navigateBack]);
789
789
  const historyView = (_jsx("div", { className: "mx-auto flex w-[560px] max-w-full flex-col items-center", children: _jsx(OrderHistory, { mode: mode, onBack: navigateBack, onSelectOrder: onSelectOrder }) }));
790
- const orderDetailsView = (_jsx("div", { className: "mx-auto w-[460px] max-w-full px-5", children: _jsx("div", { className: "relative flex flex-col gap-4", children: oat && (_jsx(OrderDetails, { mode: mode, order: oat.data.order, depositTxs: oat.data.depositTxs, relayTxs: oat.data.relayTxs, executeTx: oat.data.executeTx, refundTxs: oat.data.refundTxs, selectedCryptoPaymentMethod: selectedCryptoPaymentMethod, onPaymentMethodChange: setSelectedCryptoPaymentMethod, points: oat.data.points || undefined, onBack: () => {
790
+ const orderDetailsView = (_jsx("div", { className: "mx-auto w-[460px] max-w-full p-5", children: _jsx("div", { className: "relative flex flex-col gap-4", children: oat && (_jsx(OrderDetails, { mode: mode, order: oat.data.order, depositTxs: oat.data.depositTxs, relayTxs: oat.data.relayTxs, executeTx: oat.data.executeTx, refundTxs: oat.data.refundTxs, selectedCryptoPaymentMethod: selectedCryptoPaymentMethod, onPaymentMethodChange: setSelectedCryptoPaymentMethod, points: oat.data.points || undefined, onBack: () => {
791
791
  setOrderId(undefined);
792
792
  navigateBack();
793
793
  setSelectedCryptoPaymentMethod(CryptoPaymentMethodType.NONE); // Reset payment method when going back
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useAccountWallet } from "../../../../global-account/react/index.js";
3
+ import { IPFSMediaRenderer, useAccountWallet } from "../../../../global-account/react/index.js";
4
4
  import { useAccountWalletImage } from "../../../../global-account/react/hooks/useAccountWallet.js";
5
5
  import { cn } from "../../../../shared/utils/cn.js";
6
6
  import { shortenAddress } from "../../../../shared/utils/formatAddress.js";
@@ -35,6 +35,7 @@ export function CryptoPaymentMethod({ selectedPaymentMethod, setSelectedPaymentM
35
35
  const walletImage = useAccountWalletImage();
36
36
  // Use custom hook to determine wallet display logic
37
37
  const { shouldShowConnectedEOA, shouldShowWagmiWallet } = useConnectedWalletDisplay(selectedPaymentMethod);
38
+ console.log("shouldShowWagmiWallet :", shouldShowWagmiWallet);
38
39
  // Map wagmi connector names to thirdweb wallet IDs
39
40
  const getThirdwebWalletId = (connectorName) => {
40
41
  const walletMap = {
@@ -200,7 +201,7 @@ export function CryptoPaymentMethod({ selectedPaymentMethod, setSelectedPaymentM
200
201
  toast.success("Selected B3 Account");
201
202
  }, className: cn("crypto-payment-method-global-wallet w-full rounded-xl border p-4 text-left transition-all hover:shadow-md", selectedPaymentMethod === CryptoPaymentMethodType.GLOBAL_WALLET
202
203
  ? "connected-wallet border-as-brand bg-as-brand/5"
203
- : "border-as-border-secondary bg-as-surface-primary hover:border-as-secondary/80"), children: _jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-3", children: [walletImage ? (_jsx("img", { src: walletImage, alt: "Global Account", className: "h-10 w-10 rounded-full" })) : (_jsx("div", { className: "wallet-icon flex h-10 w-10 items-center justify-center rounded-full bg-purple-100", children: _jsx(Wallet, { className: "h-5 w-5 text-purple-600" }) })), _jsxs("div", { className: "flex flex-col", children: [_jsx("span", { className: "text-as-primary font-semibold", children: "Global Account" }), _jsx("span", { className: "text-as-primary/60 text-sm", children: shortenAddress(globalAddress || "") })] })] }), _jsx("div", { className: "flex items-center gap-2", children: selectedPaymentMethod === CryptoPaymentMethodType.GLOBAL_WALLET && (_jsx("div", { className: "h-2 w-2 rounded-full bg-green-500" })) })] }) }))] })] })), _jsxs("div", { className: "other-payment-methods", children: [_jsx("h3", { className: "text-as-primary/80 mb-3 text-sm font-medium", children: "Payment methods" }), _jsxs("div", { className: "space-y-3", children: [_jsxs("button", { onClick: () => {
204
+ : "border-as-border-secondary bg-as-surface-primary hover:border-as-secondary/80"), children: _jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-3", children: [walletImage ? (_jsx(IPFSMediaRenderer, { src: walletImage, alt: "Global Account", className: "h-10 w-10 rounded-full" })) : (_jsx("div", { className: "wallet-icon flex h-10 w-10 items-center justify-center rounded-full bg-purple-100", children: _jsx(Wallet, { className: "h-5 w-5 text-purple-600" }) })), _jsxs("div", { className: "flex flex-col", children: [_jsx("span", { className: "text-as-primary font-semibold", children: "Global Account" }), _jsx("span", { className: "text-as-primary/60 text-sm", children: shortenAddress(globalAddress || "") })] })] }), _jsx("div", { className: "flex items-center gap-2", children: selectedPaymentMethod === CryptoPaymentMethodType.GLOBAL_WALLET && (_jsx("div", { className: "h-2 w-2 rounded-full bg-green-500" })) })] }) }))] })] })), _jsxs("div", { className: "other-payment-methods", children: [_jsx("h3", { className: "text-as-primary/80 mb-3 text-sm font-medium", children: "Payment methods" }), _jsxs("div", { className: "space-y-3", children: [_jsxs("button", { onClick: () => {
204
205
  // Always show wallet selection modal first
205
206
  setShowWalletModal(true);
206
207
  }, className: "crypto-payment-method-connect-wallet bg-as-surface-primary border-as-border-secondary hover:border-as-secondary/80 group flex w-full items-center justify-between gap-4 rounded-xl border px-4 py-3.5 transition-all duration-200 hover:shadow-md", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "wallet-icon flex h-8 w-8 items-center justify-center rounded-full bg-blue-100", children: _jsx(Wallet, { className: "h-4 w-4 text-blue-600" }) }), _jsx("div", { className: "flex flex-col items-start text-left", children: _jsx("h4", { className: "text-as-primary font-semibold", children: "Connect wallet" }) })] }), _jsx(ChevronRightCircle, { className: "text-as-primary/40 group-hover:text-as-primary/60 h-5 w-5 transition-colors" })] }), _jsxs("button", { onClick: () => {
@@ -56,9 +56,9 @@ export function FiatPaymentMethodComponent({ selectedPaymentMethod, setSelectedP
56
56
  }
57
57
  // Show loading state while checking geo availability
58
58
  if (isLoadingGeoOnramp) {
59
- return (_jsx("div", { className: "fiat-payment-method mx-auto w-[460px] max-w-full px-5", children: _jsxs("div", { className: "flex flex-col gap-6", children: [_jsxs("div", { className: "flex items-center gap-4", children: [_jsx("button", { onClick: onBack, className: "text-as-quaternary hover:text-as-primary flex h-8 w-8 items-center justify-center rounded-lg transition-colors", children: _jsx(ChevronLeft, { className: "h-6 w-6" }) }), _jsx("div", { className: "flex-1", children: _jsx("h2", { className: "text-as-primary text-lg font-semibold", children: "Choose payment method" }) })] }), _jsxs("div", { className: "flex items-center justify-center py-8", children: [_jsx(Loader2, { className: "h-6 w-6 animate-spin" }), _jsx("span", { className: "text-as-secondary ml-2 text-sm", children: "Loading payment methods..." })] })] }) }));
59
+ return (_jsx("div", { className: "fiat-payment-method mx-auto w-[460px] max-w-full p-5", children: _jsxs("div", { className: "flex flex-col gap-6", children: [_jsxs("div", { className: "flex items-center gap-4", children: [_jsx("button", { onClick: onBack, className: "text-as-quaternary hover:text-as-primary flex h-8 w-8 items-center justify-center rounded-lg transition-colors", children: _jsx(ChevronLeft, { className: "h-6 w-6" }) }), _jsx("div", { className: "flex-1", children: _jsx("h2", { className: "text-as-primary text-lg font-semibold", children: "Choose payment method" }) })] }), _jsxs("div", { className: "flex items-center justify-center py-8", children: [_jsx(Loader2, { className: "h-6 w-6 animate-spin" }), _jsx("span", { className: "text-as-secondary ml-2 text-sm", children: "Loading payment methods..." })] })] }) }));
60
60
  }
61
- return (_jsx("div", { className: "fiat-payment-method mx-auto w-[460px] max-w-full px-5", children: _jsxs("div", { className: "flex flex-col gap-6", children: [_jsxs("div", { className: "flex items-center gap-4", children: [_jsx("button", { onClick: onBack, className: "text-as-quaternary hover:text-as-primary flex h-8 w-8 items-center justify-center rounded-lg transition-colors", children: _jsx(ChevronLeft, { className: "h-6 w-6" }) }), _jsx("div", { className: "flex-1", children: _jsx("h2", { className: "text-as-primary text-lg font-semibold", children: "Choose payment method" }) })] }), _jsx("div", { className: "flex flex-col gap-3", children: availablePaymentMethods.length === 0 ? (_jsx("div", { className: "fiat-payment-method-no-methods bg-as-surface-secondary border-as-border-secondary rounded-2xl border p-6 text-center", children: _jsx("p", { className: "text-as-secondary text-sm", children: "No payment methods available in your region for the selected amount." }) })) : (availablePaymentMethods.map(method => (_jsxs("button", { onClick: () => {
61
+ return (_jsx("div", { className: "fiat-payment-method mx-auto w-[460px] max-w-full p-5", children: _jsxs("div", { className: "flex flex-col gap-6", children: [_jsxs("div", { className: "flex items-center gap-4", children: [_jsx("button", { onClick: onBack, className: "text-as-quaternary hover:text-as-primary flex h-8 w-8 items-center justify-center rounded-lg transition-colors", children: _jsx(ChevronLeft, { className: "h-6 w-6" }) }), _jsx("div", { className: "flex-1", children: _jsx("h2", { className: "text-as-primary text-lg font-semibold", children: "Choose payment method" }) })] }), _jsx("div", { className: "flex flex-col gap-3", children: availablePaymentMethods.length === 0 ? (_jsx("div", { className: "fiat-payment-method-no-methods bg-as-surface-secondary border-as-border-secondary rounded-2xl border p-6 text-center", children: _jsx("p", { className: "text-as-secondary text-sm", children: "No payment methods available in your region for the selected amount." }) })) : (availablePaymentMethods.map(method => (_jsxs("button", { onClick: () => {
62
62
  setSelectedPaymentMethod(method.id);
63
63
  onSelectPaymentMethod(method.id);
64
64
  }, className: cn("fiat-payment-method-item bg-as-surface-secondary border-as-border-secondary flex w-full items-center gap-4 rounded-2xl border p-4 transition-all duration-200", selectedPaymentMethod === method.id
@@ -410,7 +410,7 @@ export const OrderDetails = memo(function OrderDetails({ mode = "modal", order,
410
410
  ? centerTruncate(phantomWalletAddress, 6)
411
411
  : centerTruncate(account?.address || "", 6)] })] }), _jsxs("div", { className: "flex w-full flex-col items-center gap-2", children: [_jsxs(ShinyButton, { accentColor: colorMode === "dark" ? "#ffffff" : "#000000", className: "flex w-5/6 items-center gap-2 sm:px-0", onClick: () => setShowQRCode(true), children: [_jsx("span", { className: "pl-4 text-lg md:text-sm", children: "Pay from a different wallet" }), _jsx(ChevronRight, { className: "h-4 w-4" })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(WalletMetamask, { className: "h-5 w-5", variant: "branded" }), _jsx(WalletCoinbase, { className: "h-5 w-5", variant: "branded" }), _jsx(WalletPhantom, { className: "h-5 w-5", variant: "branded" }), _jsx(WalletTrust, { className: "h-5 w-5", variant: "branded" }), _jsx(WalletWalletConnect, { className: "h-5 w-5", variant: "branded" }), _jsx("span", { className: "label-style text-as-primary/30 text-xs", children: "& more" })] })] })] }) })) : (
412
412
  // Default case - existing QR code flow
413
- _jsx(motion.div, { initial: { opacity: 0, filter: "blur(10px)" }, animate: { opacity: 1, filter: "blur(0px)" }, transition: { duration: 0.5, ease: "easeInOut" }, className: "flex w-full items-center justify-evenly gap-4", children: _jsxs("div", { className: "order-details-qr-container mt-8 flex flex-col items-center rounded-lg bg-white p-6 pb-3", children: [_jsx(QRCodeSVG, { value: getPaymentUrl(order.globalAddress, BigInt(order.srcAmount), order.srcTokenAddress === RELAY_ETH_ADDRESS ? srcToken?.symbol || "ETH" : order.srcTokenAddress, order.srcChain, srcToken?.decimals), className: "order-details-qr-code max-w-[200px]" }), _jsxs("div", { className: "order-details-qr-wallets mt-3 flex items-center justify-center gap-2 text-sm", children: [_jsx("span", { className: "label-style text-as-brand/70 text-sm", children: "Scan with" }), _jsxs(TextLoop, { interval: 3, children: [_jsx(WalletMetamask, { className: "h-5 w-5", variant: "branded" }), _jsx(WalletCoinbase, { className: "h-5 w-5", variant: "branded" }), _jsx(WalletPhantom, { className: "h-5 w-5", variant: "branded" }), _jsx(WalletTrust, { className: "h-5 w-5", variant: "branded" })] })] })] }) }))] })) })), _jsxs("div", { className: "order-details-time-remaining flex w-full items-center justify-center gap-1 text-sm", children: [_jsx("div", { className: "text-as-primary/30 order-details-time-label", children: "Time remaining:" }), _jsx("div", { className: "text-as-primary order-details-time-value", children: depositEnoughAmount ? ("Received") : order.status === "expired" ? ("Expired") : (_jsx(TimeAgo, { date: new Date(order.expiredAt), live: true })) })] }), statusDisplay !== "processing" && (_jsx(OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points })), _jsxs("button", { className: "order-details-cancel-btn flex w-full items-center justify-center gap-2", onClick: handleBack, children: [_jsx(RefreshCcw, { className: "ml-2 h-4 w-4" }), " Cancel and start over"] })] }));
413
+ _jsx(motion.div, { initial: { opacity: 0, filter: "blur(10px)" }, animate: { opacity: 1, filter: "blur(0px)" }, transition: { duration: 0.5, ease: "easeInOut" }, className: "flex w-full items-center justify-evenly gap-4", children: _jsxs("div", { className: "order-details-qr-container mt-8 flex flex-col items-center rounded-lg bg-white p-6 pb-3", children: [_jsx(QRCodeSVG, { value: getPaymentUrl(order.globalAddress, BigInt(order.srcAmount), order.srcTokenAddress === RELAY_ETH_ADDRESS ? srcToken?.symbol || "ETH" : order.srcTokenAddress, order.srcChain, srcToken?.decimals), className: "order-details-qr-code max-w-[200px]" }), _jsxs("div", { className: "order-details-qr-wallets mt-3 flex items-center justify-center gap-2 text-sm", children: [_jsx("span", { className: "label-style text-as-brand/70 text-sm", children: "Scan with" }), _jsxs(TextLoop, { interval: 3, children: [_jsx(WalletMetamask, { className: "h-5 w-5", variant: "branded" }), _jsx(WalletCoinbase, { className: "h-5 w-5", variant: "branded" }), _jsx(WalletPhantom, { className: "h-5 w-5", variant: "branded" }), _jsx(WalletTrust, { className: "h-5 w-5", variant: "branded" })] })] })] }) }))] })) })), _jsxs("div", { className: "order-details-time-remaining flex w-full items-center justify-center gap-1 text-sm", children: [_jsx("div", { className: "text-as-primary/30 order-details-time-label", children: "Time remaining:" }), _jsx("div", { className: "text-as-primary order-details-time-value", children: depositEnoughAmount ? ("Received") : order.status === "expired" ? ("Expired") : (_jsx(TimeAgo, { date: new Date(order.expiredAt), live: true })) })] }), statusDisplay !== "processing" && (_jsx(OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points })), _jsxs("button", { className: "text-b3-primary-blue hover:text-b3-primary-blue/50 order-details-cancel-btn flex w-full items-center justify-center gap-2 underline", onClick: handleBack, children: [_jsx(RefreshCcw, { className: "ml-2 h-4 w-4" }), " Cancel and start over"] })] }));
414
414
  });
415
415
  function TransactionDetails({ title, chainId, tx, isProcessing, delay, }) {
416
416
  return (_jsxs("div", { className: "order-details-transaction-item relative flex w-full flex-1 items-center justify-between gap-4", children: [_jsxs("div", { className: "order-details-transaction-content flex grow items-center gap-4", children: [_jsx(motion.div, { className: "bg-as-surface-secondary relative h-10 w-10 rounded-full", children: isProcessing ? (_jsx(motion.div, { initial: { opacity: 0, scale: 0.3 }, animate: { opacity: 1, scale: 1 }, transition: { duration: 0.5, ease: "easeInOut", delay }, className: "border-as-border-secondary absolute z-10 m-2 flex h-6 w-6 items-center justify-center rounded-full border-2 shadow-lg backdrop-blur-sm", children: _jsx(Loader2, { className: "text-as-primary h-4 w-4 animate-spin" }) })) : (_jsx(motion.div, { initial: { opacity: 0, scale: 0.3 }, animate: { opacity: 1, scale: 1 }, transition: { duration: 0.5, ease: "easeOut", delay }, className: "bg-as-success-secondary absolute z-10 m-2 flex h-6 w-6 items-center justify-center rounded-full border border-white/30 shadow-lg backdrop-blur-sm", children: _jsx(CheckIcon, { className: "text-as-content-icon-success h-4 w-4" }) })) }), _jsx(motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, ease: "easeInOut", delay }, className: "shrink-0 text-base", children: isProcessing ? (_jsx(TextShimmer, { duration: 1, children: title })) : (_jsx("span", { className: "text-as-primary", children: title })) })] }), _jsx("div", { className: "flex flex-col gap-1", children: tx ? (_jsx(motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, ease: "easeInOut", delay: (delay || 0) + 0.3 }, className: "flex items-center gap-3", children: _jsx("a", { href: getExplorerTxUrl(chainId, tx.txHash), target: "_blank", children: _jsx("div", { className: "text-as-primary/30 font-mono text-xs", children: centerTruncate(tx?.txHash, 6) }) }) })) : null })] }));
@@ -10,7 +10,7 @@ export function OrderHistory({ mode, onBack, onSelectOrder }) {
10
10
  const { orderHistory, isLoadingOrderHistory, refetchOrderHistory } = useAnyspendOrderHistory(address);
11
11
  return (_jsxs(_Fragment, { children: [_jsx(ModalHeader, { title: "Order History", showCloseButton: false, handleBack: onBack, className: "w-full", children: _jsx(Button, { variant: "ghost", size: "icon", className: "hover:bg-as-surface-secondary", onClick: () => {
12
12
  refetchOrderHistory();
13
- }, children: _jsx(RefreshCcw, { className: "text-as-secondary hover:text-as-primary h-5 w-5 cursor-pointer transition-all hover:rotate-180" }) }) }), isLoadingOrderHistory ? (_jsx("div", { className: "w-full space-y-3 px-5", children: [1, 2, 3].map(i => (_jsx(Skeleton, { className: "h-[180px] w-full rounded-2xl" }, i))) })) : !orderHistory?.length ? (_jsx("div", { className: "bg-as-surface-secondary w-full rounded-2xl p-12 px-5 text-center", children: _jsx("p", { className: "text-as-secondary text-sm", children: "No order history found" }) })) : (_jsx("div", { className: "mb-12 w-full space-y-3 px-5 pt-5", children: [...orderHistory]
13
+ }, children: _jsx(RefreshCcw, { className: "text-as-secondary hover:text-as-primary h-5 w-5 cursor-pointer transition-all hover:rotate-180" }) }) }), isLoadingOrderHistory ? (_jsx("div", { className: "w-full space-y-3 px-5", children: [1, 2, 3].map(i => (_jsx(Skeleton, { className: "h-[180px] w-full rounded-2xl" }, i))) })) : !orderHistory?.length ? (_jsx("div", { className: "bg-as-surface-secondary w-full rounded-2xl p-12 px-5 text-center", children: _jsx("p", { className: "text-as-secondary text-sm", children: "No order history found" }) })) : (_jsx("div", { className: "mb-12 w-full px-5 pt-5", children: [...orderHistory]
14
14
  .sort((a, b) => b.createdAt - a.createdAt)
15
15
  .map(order => (_jsx(OrderHistoryItem, { order: order, onSelectOrder: onSelectOrder, mode: mode }, order.id))) }))] }));
16
16
  }
@@ -22,7 +22,7 @@ export function OrderHistoryItem({ order, onSelectOrder, mode }) {
22
22
  // Check if this is a one-click payment order
23
23
  const isOneClickPayment = !!order.oneClickBuyUrl;
24
24
  const vendorName = order.onrampMetadata?.vendor ? getVendorDisplayName(order.onrampMetadata.vendor) : null;
25
- return (_jsxs("div", { className: cn("bg-as-surface-secondary hover:bg-as-surface-tertiary rounded-xl p-4 transition-all", onSelectOrder && "cursor-pointer"), onClick: () => onSelectOrder?.(order.id), children: [_jsxs("div", { className: "mb-3 flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: cn("text-xs font-semibold", orderDisplayStatus === "processing" && "text-yellow-600", orderDisplayStatus === "success" && "text-green-600", orderDisplayStatus === "failure" && "text-red-600"), children: orderStatusText }), isOneClickPayment && vendorName && (_jsx(Badge, { variant: "outline", className: "text-as-secondary px-2 py-0.5 text-[10px]", children: vendorName }))] }), _jsx("div", { className: "text-as-secondary text-[10px] font-medium uppercase tracking-wide", children: _jsx(TimeAgo, { date: new Date(order.createdAt) }) })] }), _jsxs("div", { className: cn("flex items-center", isSmallView ? "gap-2" : "gap-4"), children: [_jsxs("div", { className: cn("flex min-w-0 flex-1 items-center", isSmallView ? "gap-1.5" : "gap-2"), children: [_jsx("img", { src: order.metadata.srcToken.metadata.logoURI, alt: order.metadata.srcToken.symbol, className: cn("shrink-0 rounded-full", isSmallView ? "h-7 w-7" : "h-8 w-8") }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: cn("text-as-primary truncate font-bold", isSmallView ? "text-xs" : "text-sm"), children: [formatTokenAmount(BigInt(order.srcAmount), order.metadata.srcToken.decimals), " ", order.metadata.srcToken.symbol] }), _jsxs("div", { className: cn("text-as-secondary flex items-center gap-1", isSmallView ? "text-[10px]" : "text-xs"), children: [_jsx("img", { src: ALL_CHAINS[order.srcChain]?.logoUrl, alt: getChainName(order.srcChain), className: "h-3 w-3" }), _jsx("span", { className: "truncate", children: getChainName(order.srcChain) })] })] })] }), _jsx(ArrowRight, { className: cn("text-as-secondary shrink-0 opacity-30", isSmallView ? "h-4 w-4" : "h-5 w-5") }), _jsx("div", { className: cn("flex min-w-0 flex-1 items-center", isSmallView ? "gap-1.5" : "gap-2"), children: nft ? (_jsxs(_Fragment, { children: [_jsx("img", { src: nft.imageUrl, alt: nft.name, className: cn("shrink-0 rounded-full", isSmallView ? "h-7 w-7" : "h-8 w-8") }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: cn("text-as-primary truncate font-bold", isSmallView ? "text-xs" : "text-sm"), children: nft.name }), _jsxs("div", { className: cn("text-as-secondary flex items-center gap-1", isSmallView ? "text-[10px]" : "text-xs"), children: [_jsx("img", { src: ALL_CHAINS[order.dstChain]?.logoUrl, alt: getChainName(order.dstChain), className: "h-3 w-3" }), _jsx("span", { className: "truncate", children: getChainName(order.dstChain) })] })] })] })) : tournament ? (_jsxs(_Fragment, { children: [_jsx("img", { src: tournament.imageUrl, alt: tournament.name, className: cn("shrink-0 rounded-full", isSmallView ? "h-7 w-7" : "h-8 w-8") }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: cn("text-as-primary truncate font-bold", isSmallView ? "text-xs" : "text-sm"), children: tournament.name }), _jsxs("div", { className: cn("text-as-secondary flex items-center gap-1", isSmallView ? "text-[10px]" : "text-xs"), children: [_jsx("img", { src: ALL_CHAINS[order.dstChain]?.logoUrl, alt: getChainName(order.dstChain), className: "h-3 w-3" }), _jsx("span", { className: "truncate", children: getChainName(order.dstChain) })] })] })] })) : (_jsxs(_Fragment, { children: [_jsx("img", { src: dstToken.metadata.logoURI, alt: dstToken.symbol, className: cn("shrink-0 rounded-full", isSmallView ? "h-7 w-7" : "h-8 w-8") }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: cn("text-as-primary truncate font-bold", isSmallView ? "text-xs" : "text-sm"), children: [formatTokenAmount(actualDstAmount
25
+ return (_jsxs("div", { className: cn("font-inter border-as-border-secondary border-b py-5 font-medium transition-all last:border-b-0", onSelectOrder && "hover:bg-as-surface-secondary/50 cursor-pointer"), onClick: () => onSelectOrder?.(order.id), children: [_jsxs("div", { className: "mb-3 flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: cn("text-xs", orderDisplayStatus === "processing" && "text-yellow-600", orderDisplayStatus === "success" && "text-green-600", orderDisplayStatus === "failure" && "text-red-600"), children: orderStatusText }), isOneClickPayment && vendorName && (_jsx(Badge, { variant: "outline", className: "text-as-secondary px-2 py-0.5 text-[10px]", children: vendorName }))] }), _jsx("div", { className: "text-as-secondary text-[10px] font-medium uppercase tracking-wide", children: _jsx(TimeAgo, { date: new Date(order.createdAt) }) })] }), _jsxs("div", { className: cn("flex items-center", isSmallView ? "gap-2" : "gap-4"), children: [_jsxs("div", { className: cn("flex min-w-0 flex-1 items-center", isSmallView ? "gap-1.5" : "gap-2"), children: [_jsx("img", { src: order.metadata.srcToken.metadata.logoURI, alt: order.metadata.srcToken.symbol, className: cn("shrink-0 rounded-full", isSmallView ? "h-7 w-7" : "h-8 w-8") }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: cn("text-as-primary truncate font-bold", isSmallView ? "text-xs" : "text-sm"), children: [formatTokenAmount(BigInt(order.srcAmount), order.metadata.srcToken.decimals), " ", order.metadata.srcToken.symbol] }), _jsxs("div", { className: cn("text-as-secondary flex items-center gap-1", isSmallView ? "text-[10px]" : "text-xs"), children: [_jsx("img", { src: ALL_CHAINS[order.srcChain]?.logoUrl, alt: getChainName(order.srcChain), className: "h-3 w-3" }), _jsx("span", { className: "truncate", children: getChainName(order.srcChain) })] })] })] }), _jsx(ArrowRight, { className: cn("text-as-secondary shrink-0 opacity-30", isSmallView ? "h-4 w-4" : "h-5 w-5") }), _jsx("div", { className: cn("flex min-w-0 flex-1 items-center", isSmallView ? "gap-1.5" : "gap-2"), children: nft ? (_jsxs(_Fragment, { children: [_jsx("img", { src: nft.imageUrl, alt: nft.name, className: cn("shrink-0 rounded-full", isSmallView ? "h-7 w-7" : "h-8 w-8") }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: cn("text-as-primary truncate font-bold", isSmallView ? "text-xs" : "text-sm"), children: nft.name }), _jsxs("div", { className: cn("text-as-secondary flex items-center gap-1", isSmallView ? "text-[10px]" : "text-xs"), children: [_jsx("img", { src: ALL_CHAINS[order.dstChain]?.logoUrl, alt: getChainName(order.dstChain), className: "h-3 w-3" }), _jsx("span", { className: "truncate", children: getChainName(order.dstChain) })] })] })] })) : tournament ? (_jsxs(_Fragment, { children: [_jsx("img", { src: tournament.imageUrl, alt: tournament.name, className: cn("shrink-0 rounded-full", isSmallView ? "h-7 w-7" : "h-8 w-8") }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: cn("text-as-primary truncate font-bold", isSmallView ? "text-xs" : "text-sm"), children: tournament.name }), _jsxs("div", { className: cn("text-as-secondary flex items-center gap-1", isSmallView ? "text-[10px]" : "text-xs"), children: [_jsx("img", { src: ALL_CHAINS[order.dstChain]?.logoUrl, alt: getChainName(order.dstChain), className: "h-3 w-3" }), _jsx("span", { className: "truncate", children: getChainName(order.dstChain) })] })] })] })) : (_jsxs(_Fragment, { children: [_jsx("img", { src: dstToken.metadata.logoURI, alt: dstToken.symbol, className: cn("shrink-0 rounded-full", isSmallView ? "h-7 w-7" : "h-8 w-8") }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: cn("text-as-primary truncate font-bold", isSmallView ? "text-xs" : "text-sm"), children: [formatTokenAmount(actualDstAmount
26
26
  ? BigInt(actualDstAmount)
27
27
  : expectedDstAmount
28
28
  ? BigInt(expectedDstAmount)
@@ -11,6 +11,7 @@ import { useFeatureFlags } from "../../contexts/FeatureFlagsContext.js";
11
11
  import { FiatPaymentMethod } from "./FiatPaymentMethod.js";
12
12
  import { OrderTokenAmountFiat } from "./OrderTokenAmountFiat.js";
13
13
  import { PointsBadge } from "./PointsBadge.js";
14
+ const ONE_CHAR_WIDTH = 30;
14
15
  export function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPaymentMethod, setActivePanel, _recipientAddress, destinationToken, destinationChainId, destinationAmount, onDestinationTokenChange, onDestinationChainChange, fiatPaymentMethodIndex, recipientSelectionPanelIndex, dstTokenSymbol, hideDstToken = false, anyspendQuote, onShowPointsDetail, onShowFeeDetail, customUsdInputValues = ["5", "10", "20", "25"], }) {
15
16
  const featureFlags = useFeatureFlags();
16
17
  // Helper function to get fees from anyspend quote
@@ -73,8 +74,9 @@ export function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPayme
73
74
  const handleQuickAmount = (value) => {
74
75
  setSrcAmountOnRamp(value);
75
76
  };
76
- return (_jsxs("div", { className: "panel-onramp bg-as-surface-primary flex w-full flex-col", children: [_jsxs("div", { className: "border-as-border-secondary bg-as-surface-secondary relative flex w-full flex-col rounded-2xl border p-4", children: [_jsxs("div", { className: "flex h-7 w-full items-center justify-between", children: [_jsx("span", { className: "text-as-tertiarry flex items-center text-sm font-bold", children: "Pay" }), _jsx("button", { className: "text-as-tertiarry flex h-7 items-center gap-1 text-sm", onClick: () => setActivePanel(fiatPaymentMethodIndex), children: selectedPaymentMethod === FiatPaymentMethod.COINBASE_PAY ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-blue-600", children: _jsx("span", { className: "text-xs font-bold text-white", children: "C" }) }), "Coinbase Pay"] }), _jsx(ChevronRight, { className: "h-4 w-4" })] })) : selectedPaymentMethod === FiatPaymentMethod.STRIPE ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-blue-600", children: _jsx("span", { className: "text-xs font-bold text-white", children: "S" }) }), "Stripe"] }), _jsx(ChevronRight, { className: "h-4 w-4" })] })) : (_jsxs(_Fragment, { children: ["Select payment method", _jsx(ChevronRight, { className: "h-4 w-4" })] })) })] }), _jsx("div", { className: "flex items-center justify-center pb-2 pt-8", children: _jsxs("div", { className: "flex gap-1", children: [_jsx("span", { className: "text-as-tertiarry text-2xl font-bold", children: "$" }), _jsx(Input, { ref: amountInputRef, type: "text", value: srcAmountOnRamp, onChange: handleAmountChange, placeholder: "5", className: "text-as-primary placeholder:text-as-primary/50 h-auto min-w-[70px] border-0 bg-transparent p-0 px-1 pt-1 text-4xl font-bold focus-visible:ring-0 focus-visible:ring-offset-0", style: {
77
- width: `${Math.max(50, srcAmountOnRamp.length * 34)}px`,
77
+ console.log("srcAmountOnRamp :", srcAmountOnRamp.length);
78
+ return (_jsxs("div", { className: "panel-onramp bg-as-surface-primary flex w-full flex-col", children: [_jsxs("div", { className: "border-as-border-secondary bg-as-surface-secondary relative flex w-full flex-col rounded-2xl border p-4", children: [_jsxs("div", { className: "flex h-7 w-full items-center justify-between", children: [_jsx("span", { className: "text-as-tertiarry flex items-center text-sm font-bold", children: "Pay" }), _jsx("button", { className: "text-as-tertiarry flex h-7 items-center gap-1 text-sm", onClick: () => setActivePanel(fiatPaymentMethodIndex), children: selectedPaymentMethod === FiatPaymentMethod.COINBASE_PAY ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-blue-600", children: _jsx("span", { className: "text-xs font-bold text-white", children: "C" }) }), "Coinbase Pay"] }), _jsx(ChevronRight, { className: "h-4 w-4" })] })) : selectedPaymentMethod === FiatPaymentMethod.STRIPE ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-blue-600", children: _jsx("span", { className: "text-xs font-bold text-white", children: "S" }) }), "Stripe"] }), _jsx(ChevronRight, { className: "h-4 w-4" })] })) : (_jsxs(_Fragment, { children: ["Select payment method", _jsx(ChevronRight, { className: "h-4 w-4" })] })) })] }), _jsx("div", { className: "flex items-center justify-center pb-2 pt-8", children: _jsxs("div", { className: "flex gap-1", children: [_jsx("span", { className: "text-as-tertiarry text-2xl font-bold", children: "$" }), _jsx(Input, { ref: amountInputRef, type: "text", value: srcAmountOnRamp, onChange: handleAmountChange, placeholder: "5", className: "text-as-primary placeholder:text-as-primary/50 h-auto border-0 bg-transparent p-0 px-1 pt-1 text-4xl font-bold focus-visible:ring-0 focus-visible:ring-offset-0", style: {
79
+ width: `${Math.max(ONE_CHAR_WIDTH, srcAmountOnRamp.length * ONE_CHAR_WIDTH)}px`,
78
80
  } })] }) }), _jsx("div", { className: cn("mx-auto mb-6 flex justify-center gap-2", hideDstToken && "mb-0"), children: customUsdInputValues
79
81
  .filter(v => !isNaN(Number(v)))
80
82
  .map(value => (_jsxs("button", { onClick: () => handleQuickAmount(value), className: `bg-as-surface-secondary border-as-border-secondary hover:border-as-border-secondary h-7 w-14 rounded-lg border text-sm font-medium transition-all duration-200 ${srcAmountOnRamp === value
@@ -29,5 +29,5 @@ export function RecipientSelection({ initialValue = "", placeholder = "Enter rec
29
29
  };
30
30
  const isAddressValid = !validateAddress || !recipientAddress || validateAddress(recipientAddress);
31
31
  const canConfirm = recipientAddress && isAddressValid;
32
- return (_jsx("div", { className: "recipient-selection mx-auto w-[460px] max-w-full px-5", children: _jsxs("div", { className: "flex flex-col gap-6", children: [_jsxs("div", { className: "flex justify-around", children: [_jsx("button", { onClick: onBack, className: "text-as-quaternary hover:text-as-primary flex h-8 w-8 items-center justify-center rounded-lg transition-colors", children: _jsx(ChevronLeft, { className: "h-6 w-6" }) }), _jsxs("div", { className: "flex-1 text-center", children: [_jsx("h2", { className: "text-as-primary text-lg font-semibold", children: title }), _jsx("p", { className: "text-as-primary/60 text-sm", children: description })] })] }), _jsxs("div", { className: "flex flex-col gap-4", children: [_jsxs("div", { className: "bg-as-surface-secondary border-as-border-secondary flex h-12 w-full overflow-hidden rounded-xl border", children: [_jsx("input", { type: "text", placeholder: placeholder, value: recipientAddress, onChange: e => setRecipientAddress(e.target.value), onKeyDown: handleKeyDown, className: "text-as-primary placeholder:text-as-primary/50 flex-1 bg-transparent px-4 text-base focus:outline-none", autoFocus: autoFocus }), _jsx("div", { className: "border-as-border-secondary border-l", children: _jsx("button", { onClick: handlePaste, className: "text-as-primary/70 hover:text-as-primary hover:bg-as-surface-primary h-full px-4 font-semibold transition-colors", children: "Paste" }) })] }), recipientAddress && !isAddressValid && (_jsx("div", { className: "text-as-red text-sm", children: "Please enter a valid address" })), _jsx("button", { onClick: handleConfirm, disabled: !canConfirm, className: "bg-as-brand hover:bg-as-brand/90 disabled:bg-as-on-surface-2 disabled:text-as-secondary h-12 w-full rounded-xl font-medium text-white transition-colors disabled:cursor-not-allowed", children: confirmText })] })] }) }));
32
+ return (_jsx("div", { className: "recipient-selection mx-auto w-[460px] max-w-full p-5", children: _jsxs("div", { className: "flex flex-col gap-6", children: [_jsxs("div", { className: "flex justify-around", children: [_jsx("button", { onClick: onBack, className: "text-as-quaternary hover:text-as-primary flex h-8 w-8 items-center justify-center rounded-lg transition-colors", children: _jsx(ChevronLeft, { className: "h-6 w-6" }) }), _jsxs("div", { className: "flex-1 text-center", children: [_jsx("h2", { className: "text-as-primary text-lg font-semibold", children: title }), _jsx("p", { className: "text-as-primary/60 text-sm", children: description })] })] }), _jsxs("div", { className: "flex flex-col gap-4", children: [_jsxs("div", { className: "bg-as-surface-secondary border-as-border-secondary flex h-12 w-full overflow-hidden rounded-xl border", children: [_jsx("input", { type: "text", placeholder: placeholder, value: recipientAddress, onChange: e => setRecipientAddress(e.target.value), onKeyDown: handleKeyDown, className: "text-as-primary placeholder:text-as-primary/50 flex-1 bg-transparent px-4 text-base focus:outline-none", autoFocus: autoFocus }), _jsx("div", { className: "border-as-border-secondary border-l", children: _jsx("button", { onClick: handlePaste, className: "text-as-primary/70 hover:text-as-primary hover:bg-as-surface-primary h-full px-4 font-semibold transition-colors", children: "Paste" }) })] }), recipientAddress && !isAddressValid && (_jsx("div", { className: "text-as-red text-sm", children: "Please enter a valid address" })), _jsx("button", { onClick: handleConfirm, disabled: !canConfirm, className: "bg-as-brand hover:bg-as-brand/90 disabled:bg-as-on-surface-2 disabled:text-as-secondary h-12 w-full rounded-xl font-medium text-white transition-colors disabled:cursor-not-allowed", children: confirmText })] })] }) }));
33
33
  }
@@ -19,7 +19,8 @@ export function useConnectedWalletDisplay(selectedCryptoPaymentMethod) {
19
19
  const isWalletDuplicated = isSameAddress(connectedEOAAddress, wagmiAddress);
20
20
  // Determine which wallet to show (prefer connectedEOAWallet if both exist and are the same)
21
21
  const shouldShowConnectedEOA = !!connectedEOAWallet;
22
- const shouldShowWagmiWallet = wagmiWalletIsConnected && (!isWalletDuplicated || !connectedEOAWallet);
22
+ // this is disabled because we don't want to display In-App Wallet as a payment method
23
+ const shouldShowWagmiWallet = false; // wagmiWalletIsConnected && (!isWalletDuplicated || !connectedEOAWallet);
23
24
  // Determine which address to use based on payment method
24
25
  let walletAddress;
25
26
  if (selectedCryptoPaymentMethod === CryptoPaymentMethodType.GLOBAL_WALLET) {
@@ -2,15 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from "react";
3
3
  export function AccountAssets({ nfts, isLoading }) {
4
4
  // Initialize with all collections expanded
5
- const [expandedCollections, setExpandedCollections] = useState(() => new Set(collections.map(c => c.collection_id)));
6
- if (isLoading) {
7
- return (_jsx("div", { className: "flex flex-col gap-3", children: [...Array(2)].map((_, i) => (_jsxs("div", { className: "animate-pulse", children: [_jsx("div", { className: "bg-b3-react-muted mb-3 h-6 w-48 rounded" }), _jsxs("div", { className: "flex gap-3", children: [_jsx("div", { className: "bg-b3-react-muted h-[98px] w-[98px] shrink-0 rounded-lg" }), _jsx("div", { className: "bg-b3-react-muted h-[98px] w-[98px] shrink-0 rounded-lg" })] })] }, i))) }));
8
- }
9
- if (!nfts?.nfts?.length) {
10
- return _jsx("div", { className: "text-b3-react-muted-foreground py-8 text-center", children: "No NFTs found" });
11
- }
12
5
  // Group NFTs by collection
13
- const groupedNFTs = nfts.nfts.reduce((acc, nft) => {
6
+ const groupedNFTs = nfts?.nfts?.reduce((acc, nft) => {
14
7
  const collectionId = nft.collection?.collection_id || "unknown";
15
8
  if (!acc[collectionId]) {
16
9
  acc[collectionId] = {
@@ -23,7 +16,14 @@ export function AccountAssets({ nfts, isLoading }) {
23
16
  acc[collectionId].nfts.push(nft);
24
17
  return acc;
25
18
  }, {});
26
- const collections = Object.values(groupedNFTs);
19
+ const collections = Object.values(groupedNFTs || {});
20
+ const [expandedCollections, setExpandedCollections] = useState(() => new Set(collections.map(c => c.collection_id)));
21
+ if (isLoading) {
22
+ return (_jsx("div", { className: "flex flex-col gap-3", children: [...Array(2)].map((_, i) => (_jsxs("div", { className: "animate-pulse", children: [_jsx("div", { className: "bg-b3-react-muted mb-3 h-6 w-48 rounded" }), _jsxs("div", { className: "flex gap-3", children: [_jsx("div", { className: "bg-b3-react-muted h-[98px] w-[98px] shrink-0 rounded-lg" }), _jsx("div", { className: "bg-b3-react-muted h-[98px] w-[98px] shrink-0 rounded-lg" })] })] }, i))) }));
23
+ }
24
+ if (!nfts?.nfts?.length) {
25
+ return _jsx("div", { className: "text-b3-react-muted-foreground py-8 text-center", children: "No NFTs found" });
26
+ }
27
27
  const toggleCollection = (collectionId) => {
28
28
  setExpandedCollections(prev => {
29
29
  const next = new Set(prev);
@@ -295,14 +295,14 @@ export function AvatarEditor({ onSetAvatar, className }) {
295
295
  };
296
296
  })
297
297
  .filter(p => p.avatar !== null) || []; // Filter out profiles with invalid avatars
298
- return (_jsxs("div", { className: cn("flex w-full max-w-md flex-col bg-white", className), children: [viewStep === "upload" && _jsx(ModalHeader, { title: "Upload Image" }), _jsxs("div", { className: "flex flex-col items-center p-6", children: [viewStep === "select" ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "relative mb-6", children: [_jsx("div", { className: "h-32 w-32 overflow-hidden rounded-full", children: safePreviewUrl || selectedAvatar || currentAvatar ? (_jsx(IPFSMediaRenderer, { src: safePreviewUrl || selectedAvatar || currentAvatar || "", alt: "Avatar preview", className: "h-full w-full object-cover" })) : (_jsx("div", { className: "bg-b3-primary-wash h-full w-full" })) }), (selectedAvatar !== currentAvatar || selectedFile) && (_jsx("button", { onClick: handleRemovePreview, className: "absolute -right-1 -top-1 flex h-8 w-8 items-center justify-center rounded-full bg-[#51525c] text-white transition-colors hover:bg-[#71717a]", children: _jsx(X, { className: "h-4 w-4" }) }))] }), _jsxs("button", { onClick: handleUploadImageClick, className: "font-inter mb-6 flex w-full items-center justify-center gap-2 rounded-xl border border-[#e4e4e7] bg-white px-4 py-3 text-sm font-semibold text-[#18181b] shadow-sm transition-colors hover:bg-[#f4f4f5]", children: [_jsx(Upload, { className: "h-4 w-4" }), "Upload image"] }), _jsxs("div", { className: "w-full", children: [_jsx("h3", { className: "mb-2 text-base font-semibold text-[#18181b]", children: "Select your profile image" }), _jsx("p", { className: "mb-4 text-sm font-semibold text-[#475467]", children: "Pick an avatar from your linked profiles, ENS or upload a new one." }), _jsx("div", { className: "mb-4 flex gap-3", children: profileAvatars.map((profileAvatar, index) => {
298
+ return (_jsxs("div", { className: cn("b3-modal-avatar-editor flex w-full max-w-md flex-col bg-white", className), children: [viewStep === "upload" && _jsx(ModalHeader, { title: "Upload Image" }), _jsxs("div", { className: "flex flex-col items-center p-6", children: [viewStep === "select" ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "relative mb-6", children: [_jsx("div", { className: "h-32 w-32 overflow-hidden rounded-full", children: safePreviewUrl || selectedAvatar || currentAvatar ? (_jsx(IPFSMediaRenderer, { src: safePreviewUrl || selectedAvatar || currentAvatar || "", alt: "Avatar preview", className: "h-full w-full object-cover" })) : (_jsx("div", { className: "bg-b3-primary-wash h-full w-full" })) }), (selectedAvatar !== currentAvatar || selectedFile) && (_jsx("button", { onClick: handleRemovePreview, className: "absolute -right-1 -top-1 flex h-8 w-8 items-center justify-center rounded-full bg-[#51525c] text-white transition-colors hover:bg-[#71717a]", children: _jsx(X, { className: "h-4 w-4" }) }))] }), _jsxs("button", { onClick: handleUploadImageClick, className: "font-inter mb-6 flex w-full items-center justify-center gap-2 rounded-xl border border-[#e4e4e7] bg-white px-4 py-3 text-sm font-semibold text-[#18181b] shadow-sm transition-colors hover:bg-[#f4f4f5]", children: [_jsx(Upload, { className: "h-4 w-4" }), "Upload image"] }), _jsxs("div", { className: "w-full", children: [_jsx("h3", { className: "mb-2 text-base font-semibold text-[#18181b]", children: "Select your profile image" }), _jsx("p", { className: "mb-4 text-sm font-semibold text-[#475467]", children: "Pick an avatar from your linked profiles, ENS or upload a new one." }), _jsx("div", { className: "mb-4 flex gap-3", children: profileAvatars.map((profileAvatar, index) => {
299
299
  // Skip if avatar is null (should not happen due to filter, but TypeScript doesn't know that)
300
300
  if (!profileAvatar.avatar)
301
301
  return null;
302
302
  return (_jsxs("div", { className: "relative", onMouseEnter: () => setHoveredProfile(profileAvatar.type), onMouseLeave: () => setHoveredProfile(null), children: [_jsx("button", { onClick: () => handleProfileAvatarSelect(profileAvatar.avatar || "", profileAvatar.type || ""), className: cn("h-16 w-16 overflow-hidden rounded-full border-2 transition-all", selectedProfileType === profileAvatar.type
303
303
  ? "border-[#3368ef] ring-2 ring-[#3368ef]/20"
304
304
  : "border-transparent hover:border-[#e4e4e7]"), children: _jsx("img", { src: profileAvatar.avatar, alt: `${profileAvatar.type} avatar`, className: "h-full w-full object-cover" }) }), hoveredProfile === profileAvatar.type && (_jsx("div", { className: "absolute -top-10 left-1/2 -translate-x-1/2 whitespace-nowrap rounded-md bg-[#18181b] px-3 py-1.5 text-xs text-white", children: profileAvatar.name }))] }, index));
305
- }) }), _jsxs("button", { onClick: handleLinkMoreAccount, className: "font-inter flex items-center gap-2 text-sm font-semibold text-[#3368ef] hover:underline", children: [_jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "h-4 w-4", children: _jsx("path", { d: "M8.75 2.75C8.75 2.33579 8.41421 2 8 2C7.58579 2 7.25 2.33579 7.25 2.75V7.25H2.75C2.33579 7.25 2 7.58579 2 8C2 8.41421 2.33579 8.75 2.75 8.75H7.25V13.25C7.25 13.6642 7.58579 14 8 14C8.41421 14 8.75 13.6642 8.75 13.25V8.75H13.25C13.6642 8.75 14 8.41421 14 8C14 7.58579 13.6642 7.25 13.25 7.25H8.75V2.75Z", fill: "currentColor" }) }), "Link more account"] })] })] })) : (_jsx(_Fragment, { children: !selectedFile ? (_jsxs("div", { onClick: handleOpenFilePicker, onDragEnter: handleDragEnter, onDragLeave: handleDragLeave, onDragOver: handleDragOver, onDrop: handleDrop, className: cn("mb-6 flex w-full cursor-pointer flex-col items-center justify-center rounded-xl border-2 border-dashed p-16 transition-colors", isDragging
305
+ }) }), _jsxs("button", { onClick: handleLinkMoreAccount, className: "b3-modal-link-more-account font-inter flex items-center gap-2 text-sm font-semibold text-[#3368ef] hover:underline", children: [_jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "h-4 w-4", children: _jsx("path", { d: "M8.75 2.75C8.75 2.33579 8.41421 2 8 2C7.58579 2 7.25 2.33579 7.25 2.75V7.25H2.75C2.33579 7.25 2 7.58579 2 8C2 8.41421 2.33579 8.75 2.75 8.75H7.25V13.25C7.25 13.6642 7.58579 14 8 14C8.41421 14 8.75 13.6642 8.75 13.25V8.75H13.25C13.6642 8.75 14 8.41421 14 8C14 7.58579 13.6642 7.25 13.25 7.25H8.75V2.75Z", fill: "currentColor" }) }), "Link more account"] })] })] })) : (_jsx(_Fragment, { children: !selectedFile ? (_jsxs("div", { onClick: handleOpenFilePicker, onDragEnter: handleDragEnter, onDragLeave: handleDragLeave, onDragOver: handleDragOver, onDrop: handleDrop, className: cn("b3-modal-upload-view mb-6 flex w-full cursor-pointer flex-col items-center justify-center rounded-xl border-2 border-dashed p-16 transition-colors", isDragging
306
306
  ? "border-[#3368ef] bg-[#f0f5ff]"
307
307
  : "border-[#e4e4e7] hover:border-[#3368ef] hover:bg-[#f0f5ff]"), children: [_jsxs("p", { className: "font-inter mb-1 text-sm", children: [_jsx("span", { className: "font-semibold text-[#3368ef]", children: "Click to upload" }), _jsx("span", { className: "text-[#71717a]", children: " or drag and drop" })] }), _jsx("p", { className: "text-xs text-[#71717a]", children: "PNG, JPG or GIF (up to 5MB)" })] })) : (_jsxs("div", { className: "mb-6 w-full", children: [_jsx("div", { className: "relative aspect-square w-full overflow-hidden rounded-xl bg-[#f4f4f5]", children: safePreviewUrl ? (_jsxs(_Fragment, { children: [_jsx(Cropper, { image: safePreviewUrl, crop: crop, zoom: zoom, aspect: 1, onCropChange: setCrop, onCropComplete: onCropComplete, onZoomChange: setZoom, cropShape: "rect", showGrid: false, style: {
308
308
  containerStyle: {
@@ -314,5 +314,5 @@ export function AvatarEditor({ onSetAvatar, className }) {
314
314
  border: "2px solid #3368ef",
315
315
  borderRadius: "0px",
316
316
  },
317
- } }), _jsx("button", { onClick: handleRemovePreview, className: "absolute right-4 top-4 z-10 flex h-8 w-8 items-center justify-center rounded-full bg-[#51525c] text-white transition-colors hover:bg-[#71717a]", children: _jsx(X, { className: "h-4 w-4" }) })] })) : (_jsx("div", { className: "bg-b3-primary-wash h-full w-full" })) }), safePreviewUrl && (_jsxs("div", { className: "mt-4 flex items-center gap-3", children: [_jsx("label", { className: "flex-shrink-0 text-sm font-semibold text-[#475467]", children: "Zoom" }), _jsx("input", { type: "range", min: 1, max: 3, step: 0.1, value: zoom, onChange: e => setZoom(Number(e.target.value)), className: "flex-1 accent-[#3368ef]" })] }))] })) })), _jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", onChange: handleFileSelect, className: "hidden" })] }), _jsxs("div", { className: "font-inter flex gap-3 border-t border-[#e4e4e7] p-6 font-semibold", children: [_jsx(Button, { onClick: handleCancel, variant: "outline", disabled: isLoading, className: "flex-1 rounded-xl border-[#e4e4e7] text-[#18181b] hover:bg-[#f4f4f5]", children: "Cancel" }), _jsx(Button, { onClick: handleSaveChanges, disabled: isLoading || (!selectedFile && !selectedProfileType), className: "flex-1 rounded-xl bg-[#3368ef] text-white hover:bg-[#2952cc]", children: isLoading ? (_jsxs(_Fragment, { children: [_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }), "Saving..."] })) : ("Save changes") })] })] }));
317
+ } }), _jsx("button", { onClick: handleRemovePreview, className: "absolute right-4 top-4 z-10 flex h-8 w-8 items-center justify-center rounded-full bg-[#51525c] text-white transition-colors hover:bg-[#71717a]", children: _jsx(X, { className: "h-4 w-4" }) })] })) : (_jsx("div", { className: "bg-b3-primary-wash h-full w-full" })) }), safePreviewUrl && (_jsxs("div", { className: "mt-4 flex items-center gap-3", children: [_jsx("label", { className: "flex-shrink-0 text-sm font-semibold text-[#475467]", children: "Zoom" }), _jsx("input", { type: "range", min: 1, max: 3, step: 0.1, value: zoom, onChange: e => setZoom(Number(e.target.value)), className: "flex-1 accent-[#3368ef]" })] }))] })) })), _jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", onChange: handleFileSelect, className: "hidden" })] }), _jsxs("div", { className: "font-inter flex gap-3 border-t border-[#e4e4e7] p-6 font-semibold", children: [_jsx(Button, { onClick: handleCancel, variant: "outline", disabled: isLoading, className: "flex-1 rounded-xl border-[#e4e4e7] text-[#18181b] hover:bg-[#f4f4f5]", children: "Cancel" }), _jsx(Button, { onClick: handleSaveChanges, disabled: isLoading || (!selectedFile && !selectedProfileType), className: "b3-modal-save-button flex-1 rounded-xl bg-[#3368ef] text-white hover:bg-[#2952cc]", children: isLoading ? (_jsxs(_Fragment, { children: [_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }), "Saving..."] })) : ("Save changes") })] })] }));
318
318
  }
@@ -74,10 +74,11 @@ export function B3DynamicModal() {
74
74
  ];
75
75
  // Check if current content type is in freestyle types
76
76
  const isFreestyleType = freestyleTypes.includes(contentType?.type);
77
+ console.log("contentType :", contentType);
77
78
  const hideCloseButton = true;
78
79
  // Build content class using cn utility
79
80
  // eslint-disable-next-line tailwindcss/no-custom-classname
80
- const contentClass = cn("b3-modal", theme === "dark" && "dark", fullWidthTypes.includes(contentType?.type) && "w-full", isFreestyleType && "b3-modal-freestyle", contentType?.type === "signInWithB3" && "p-0", contentType?.type === "anySpend" && "md:px-6");
81
+ const contentClass = cn("b3-modal", theme === "dark" && "dark", fullWidthTypes.includes(contentType?.type) && "w-full", isFreestyleType && "b3-modal-freestyle", contentType?.type === "signInWithB3" && "p-0", contentType?.type === "anySpend" && "md:p-0", contentType?.type === "send" && "p-0", contentType?.type === "manageAccount" && " md:p-0 md:pt-2", contentType?.type === "linkAccount" && "md:p-0");
81
82
  debug("contentType", contentType);
82
83
  const renderContent = () => {
83
84
  if (!contentType)
@@ -26,7 +26,7 @@ const IPFS_GATEWAY_URL = "https://cloudflare-ipfs.com";
26
26
  export function IPFSMediaRenderer({ src, alt = "Media", className, client = defaultClient, width, height, controls, style, }) {
27
27
  // If no source, render fallback
28
28
  if (!src) {
29
- return (_jsx("div", { className: className, style: style, "aria-label": alt, children: _jsx("div", { className: "bg-b3-primary-wash flex h-full w-full items-center justify-center", children: _jsx("span", { className: "text-b3-grey font-neue-montreal-semibold text-xs", children: alt.charAt(0).toUpperCase() }) }) }));
29
+ return (_jsx("div", { className: className, style: style, "aria-label": alt, children: _jsx("div", { className: "bg-b3-primary-wash flex h-full w-full items-center justify-center rounded-full", children: _jsx("span", { className: "text-b3-grey font-neue-montreal-semibold text-xs", children: alt.charAt(0).toUpperCase() }) }) }));
30
30
  }
31
31
  // Convert IPFS URLs to HTTP gateway URLs if needed
32
32
  // This handles both ipfs:// URLs and existing HTTP gateway URLs
@@ -4,7 +4,7 @@ import { Button, useB3, useModalStore, useQueryB3 } from "../../../../global-acc
4
4
  import { client } from "../../../../shared/utils/thirdweb.js";
5
5
  import { truncateAddress } from "../../../../shared/utils/truncateAddress.js";
6
6
  import { Copy, Loader2, Pencil, UnlinkIcon } from "lucide-react";
7
- import { useRef, useState } from "react";
7
+ import { useEffect, useRef, useState } from "react";
8
8
  import { toast } from "sonner";
9
9
  import { useProfiles, useUnlinkProfile } from "thirdweb/react";
10
10
  import { getProfileDisplayInfo } from "../../utils/profileDisplay.js";
@@ -26,6 +26,7 @@ const formatProfileTitle = (title) => {
26
26
  import ModalHeader from "../ModalHeader/ModalHeader.js";
27
27
  export const LinkAccount = ({ partnerId, onLogout, chain, }) => {
28
28
  const [unlinkingAccountId, setUnlinkingAccountId] = useState(null);
29
+ const [profileToUnlink, setProfileToUnlink] = useState(null);
29
30
  const { data: profilesRaw = [], isLoading: isLoadingProfiles } = useProfiles({ client });
30
31
  const { mutate: unlinkProfile, isPending: isUnlinking } = useUnlinkProfile();
31
32
  const setB3ModalContentType = useModalStore(state => state.setB3ModalContentType);
@@ -94,16 +95,34 @@ export const LinkAccount = ({ partnerId, onLogout, chain, }) => {
94
95
  ...getProfileDisplayInfo(profile),
95
96
  originalProfile: profile,
96
97
  }));
97
- const handleUnlink = async (profile) => {
98
- setUnlinkingAccountId(profile.title);
99
- try {
100
- unlinkProfile({ client, profileToUnlink: profile.originalProfile }, mutationOptions);
98
+ console.log("profiles :", profiles);
99
+ // Reset confirmation state after 3 seconds
100
+ useEffect(() => {
101
+ if (profileToUnlink) {
102
+ const timer = setTimeout(() => {
103
+ setProfileToUnlink(null);
104
+ }, 5000);
105
+ return () => clearTimeout(timer);
101
106
  }
102
- catch (error) {
103
- console.error("Error unlinking account:", error);
107
+ }, [profileToUnlink]);
108
+ const handleUnlinkClick = (profile) => {
109
+ // If this profile is already pending confirmation, perform the unlink
110
+ if (profileToUnlink?.title === profile.title) {
111
+ setUnlinkingAccountId(profile.title);
112
+ try {
113
+ unlinkProfile({ client, profileToUnlink: profile.originalProfile }, mutationOptions);
114
+ }
115
+ catch (error) {
116
+ console.error("Error unlinking account:", error);
117
+ }
118
+ finally {
119
+ setUnlinkingAccountId(null);
120
+ setProfileToUnlink(null);
121
+ }
104
122
  }
105
- finally {
106
- setUnlinkingAccountId(null);
123
+ else {
124
+ // First click - set pending confirmation
125
+ setProfileToUnlink(profile);
107
126
  }
108
127
  };
109
128
  const handleOpenLinkModal = () => {
@@ -139,7 +158,9 @@ export const LinkAccount = ({ partnerId, onLogout, chain, }) => {
139
158
  ? "font-mono text-sm" // Use monospace font for addresses
140
159
  : "break-words" // Use break-words for emails/names (better than break-all)
141
160
  }`, title: isAddress ? profile.title : undefined, children: displayTitle }), isAddress && (_jsx("button", { onClick: handleCopyAddress, className: "linked-account-copy-button ml-1 rounded p-1 opacity-0 transition-opacity hover:bg-gray-100 group-hover:opacity-100", title: "Copy full address", children: _jsx(Copy, { size: 12, className: "text-gray-500 hover:text-gray-700" }) }))] }));
142
- })(), _jsx("span", { className: "linked-account-type text-b3-foreground-muted font-neue-montreal-medium bg-b3-primary-wash rounded px-2 py-0.5 text-xs", children: profile.type.toUpperCase() })] }), _jsx("div", { className: "linked-account-subtitle text-b3-foreground-muted font-neue-montreal-medium text-sm", children: profile.subtitle })] })] }), _jsx(Button, { variant: "ghost", size: "icon", className: "linked-account-unlink-button text-b3-grey hover:text-b3-negative", onClick: () => handleUnlink(profile), disabled: unlinkingAccountId === profile.title || isUnlinking, children: unlinkingAccountId === profile.title || isUnlinking ? (_jsx(Loader2, { className: "linked-account-unlink-loading animate-spin" })) : (_jsx(UnlinkIcon, { size: 16, className: "linked-account-unlink-icon" })) })] }, profile.title))) })) : (_jsx("div", { className: "linked-accounts-empty text-b3-foreground-muted py-8 text-center", children: "No linked accounts found" })), _jsx(Button, { onClick: handleOpenLinkModal, disabled: isLinking, className: "bg-b3-primary-blue hover:bg-b3-primary-blue/90 border-white/12 group relative h-12 w-full rounded-xl border-2 px-[18px] text-base font-semibold text-white shadow-[inset_0px_0px_0px_1px_rgba(10,13,18,0.18),inset_0px_-2px_0px_0px_rgba(10,13,18,0.05)] transition-all", children: _jsxs("div", { className: "flex items-center justify-center gap-1.5", children: [_jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "shrink-0", children: _jsx("path", { d: "M10.0001 13.3333V6.66667M6.66675 10H13.3334M18.3334 10C18.3334 14.6024 14.6025 18.3333 10.0001 18.3333C5.39771 18.3333 1.66675 14.6024 1.66675 10C1.66675 5.39763 5.39771 1.66667 10.0001 1.66667C14.6025 1.66667 18.3334 5.39763 18.3334 10Z", stroke: "currentColor", strokeWidth: "1.67", strokeLinecap: "round", strokeLinejoin: "round" }) }), _jsx("span", { children: "Link new account" })] }) })] }), showReferralInfo && (
161
+ })(), _jsx("span", { className: "linked-account-type text-b3-foreground-muted font-neue-montreal-medium bg-b3-primary-wash rounded px-2 py-0.5 text-xs", children: profile.type.toUpperCase() })] }), _jsx("div", { className: "linked-account-subtitle text-b3-foreground-muted font-neue-montreal-medium text-sm", children: profile.subtitle })] })] }), _jsx(Button, { variant: "ghost", size: profileToUnlink?.title === profile.title ? "sm" : "icon", className: `linked-account-unlink-button transition-all ${profileToUnlink?.title === profile.title
162
+ ? "bg-b3-negative hover:bg-b3-negative/90 text-white"
163
+ : "text-b3-grey hover:text-b3-negative"}`, onClick: () => handleUnlinkClick(profile), disabled: unlinkingAccountId === profile.title || isUnlinking, children: unlinkingAccountId === profile.title || isUnlinking ? (_jsx(Loader2, { className: "linked-account-unlink-loading h-4 w-4 animate-spin" })) : profileToUnlink?.title === profile.title ? (_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx(UnlinkIcon, { size: 14, className: "linked-account-unlink-icon" }), _jsx("span", { className: "text-xs font-semibold", children: "Unlink" })] })) : (_jsx(UnlinkIcon, { size: 16, className: "linked-account-unlink-icon" })) })] }, profile.title))) })) : (_jsx("div", { className: "linked-accounts-empty font-neue-montreal-medium text-b3-foreground-muted py-8 text-center", children: "No linked accounts found" })), _jsx(Button, { onClick: handleOpenLinkModal, disabled: isLinking, className: "b3-modal-link-new-account-button bg-b3-primary-blue hover:bg-b3-primary-blue/90 border-white/12 group relative h-12 w-full rounded-xl border-2 px-[18px] text-base font-semibold text-white shadow-[inset_0px_0px_0px_1px_rgba(10,13,18,0.18),inset_0px_-2px_0px_0px_rgba(10,13,18,0.05)] transition-all", children: _jsxs("div", { className: "flex items-center justify-center gap-1.5", children: [_jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "shrink-0", children: _jsx("path", { d: "M10.0001 13.3333V6.66667M6.66675 10H13.3334M18.3334 10C18.3334 14.6024 14.6025 18.3333 10.0001 18.3333C5.39771 18.3333 1.66675 14.6024 1.66675 10C1.66675 5.39763 5.39771 1.66667 10.0001 1.66667C14.6025 1.66667 18.3334 5.39763 18.3334 10Z", stroke: "currentColor", strokeWidth: "1.67", strokeLinecap: "round", strokeLinejoin: "round" }) }), _jsx("span", { children: "Link new account" })] }) })] }), showReferralInfo && (
143
164
  /* Referral Section */
144
165
  _jsxs("div", { className: "referrals-section space-y-4", children: [_jsx("h3", { className: "referrals-title text-b3-grey font-neue-montreal-semibold text-xl", children: "Referrals" }), _jsxs("div", { className: "referral-code-container bg-b3-line rounded-xl p-4", children: [isEditingCode && (_jsxs("div", { className: "referral-code-header-editing", children: [_jsx("div", { className: "referral-code-title text-b3-grey font-neue-montreal-semibold", children: "Your Referral Code" }), _jsx("div", { className: "referral-code-description text-b3-foreground-muted font-neue-montreal-medium text-sm", children: "Share this code with friends to earn rewards" })] })), _jsxs("div", { className: "referral-code-content flex items-center justify-between", children: [!isEditingCode && (_jsxs("div", { className: "referral-code-header", children: [_jsx("div", { className: "referral-code-title text-b3-grey font-neue-montreal-semibold", children: "Your Referral Code" }), _jsx("div", { className: "referral-code-description text-b3-foreground-muted font-neue-montreal-medium text-sm", children: "Share this code with friends to earn rewards" })] })), _jsx("div", { className: "referral-code-actions flex items-center gap-2", children: isEditingCode ? (_jsxs("div", { className: "referral-code-edit-form flex items-center gap-2", children: [_jsx("input", { type: "text", value: newReferralCode, onChange: e => setNewReferralCode(e.target.value), className: "referral-code-input rounded-lg border border-gray-200 bg-white px-3 py-1.5 text-sm", placeholder: "Enter new code", ref: referallCodeRef }), _jsx(Button, { size: "sm", className: "referral-code-save-button", onClick: handleUpdateReferralCode, disabled: isUpdatingCode || !newReferralCode, children: isUpdatingCode ? (_jsx(Loader2, { className: "referral-code-save-loading h-4 w-4 animate-spin" })) : ("Save") }), _jsx(Button, { size: "sm", variant: "ghost", className: "referral-code-cancel-button", onClick: () => {
145
166
  setIsEditingCode(false);
@@ -11,7 +11,7 @@ const SettingsIcon = () => {
11
11
  };
12
12
  const BottomNavigation = () => {
13
13
  const setB3ModalContentType = useModalStore(state => state.setB3ModalContentType);
14
- return (_jsx("div", { className: "sticky bottom-0 left-0 w-full rounded-b-xl border-t border-gray-200 bg-[#FAFAFA]", children: _jsxs(TabsListPrimitive, { className: "flex h-[68px] w-full items-center justify-center gap-4 border-none bg-transparent", children: [_jsxs(TabTriggerPrimitive, { value: "home", className: "data-[state=active]:border-b3-primary-blue group flex flex-initial flex-col items-center gap-1 border-r-0 border-t-0 px-6 pb-2 pt-2.5 text-[#a0a0ab] data-[state=active]:border-t-4 data-[state=active]:text-[#18181B]", children: [_jsx(HomeIcon, {}), _jsx("span", { className: "text-b3-grey font-neue-montreal-semibold text-xs", children: "Home" })] }), _jsxs(TabTriggerPrimitive, { value: "swap", className: "data-[state=active]:border-b3-primary-blue group flex flex-initial flex-col items-center gap-1 border-r-0 border-t-0 px-6 pb-2 pt-2.5 text-[#a0a0ab] data-[state=active]:border-t-4 data-[state=active]:text-[#18181B]", onClick: () => {
14
+ return (_jsx("div", { className: "b3-modal-bottom-navigation sticky bottom-0 left-0 w-full rounded-b-xl border-t border-gray-200 bg-[#FAFAFA]", children: _jsxs(TabsListPrimitive, { className: "flex h-[68px] w-full items-center justify-center gap-4 border-none bg-transparent", children: [_jsxs(TabTriggerPrimitive, { value: "home", className: "data-[state=active]:border-b3-primary-blue group flex flex-initial flex-col items-center gap-1 border-r-0 border-t-0 px-6 pb-2 pt-2.5 text-[#a0a0ab] data-[state=active]:border-t-4 data-[state=active]:text-[#18181B]", children: [_jsx(HomeIcon, {}), _jsx("span", { className: "text-b3-grey font-neue-montreal-semibold text-xs", children: "Home" })] }), _jsxs(TabTriggerPrimitive, { value: "swap", className: "data-[state=active]:border-b3-primary-blue group flex flex-initial flex-col items-center gap-1 border-r-0 border-t-0 px-6 pb-2 pt-2.5 text-[#a0a0ab] data-[state=active]:border-t-4 data-[state=active]:text-[#18181B]", onClick: () => {
15
15
  setB3ModalContentType({
16
16
  type: "anySpend",
17
17
  showBackButton: true,
@@ -37,7 +37,7 @@ function WalletItem({ wallet, isActive, onClick }) {
37
37
  : isGlobalAccount
38
38
  ? "Smart Wallet"
39
39
  : "Wallet";
40
- return (_jsxs("div", { className: `box-border flex cursor-pointer items-center gap-2 rounded-xl px-3 py-2 transition-colors ${isActive ? "bg-[#F4F4F5]" : "hover:bg-b3-line/50"}`, onClick: onClick, children: [_jsx("div", { className: "relative size-10 shrink-0 overflow-clip rounded-full", children: isGlobalAccount ? (_jsx("div", { className: "flex size-full items-center justify-center p-1", children: _jsx("img", { src: "https://cdn.b3.fun/b3_logo.svg", alt: "B3", className: "size-full object-contain" }) })) : walletImage ? (_jsx("img", { src: walletImage, alt: walletName, className: "size-full object-contain p-1" })) : (_jsx("div", { className: "flex size-full items-center justify-center", children: _jsx(WalletIcon, {}) })) }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [_jsx("p", { className: "text-b3-grey font-neue-montreal-semibold truncate text-sm", children: walletName }), _jsx("p", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: centerTruncate(address, 4) })] }), isActive && (_jsx("div", { className: "shrink-0", children: _jsx(CheckIcon, {}) }))] }));
40
+ return (_jsxs("div", { className: `b3-modal-wallet-item ${isActive ? "b3-modal-wallet-item-active bg-[#F4F4F5]" : "hover:bg-b3-line/50"} box-border flex cursor-pointer items-center gap-2 rounded-xl px-3 py-2 transition-colors`, onClick: onClick, children: [_jsx("div", { className: "relative size-10 shrink-0 overflow-clip rounded-full", children: isGlobalAccount ? (_jsx("div", { className: "flex size-full items-center justify-center p-1", children: _jsx("img", { src: "https://cdn.b3.fun/b3_logo.svg", alt: "B3", className: "size-full object-contain" }) })) : walletImage ? (_jsx("img", { src: walletImage, alt: walletName, className: "size-full object-contain p-1" })) : (_jsx("div", { className: "flex size-full items-center justify-center", children: _jsx(WalletIcon, {}) })) }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [_jsx("p", { className: "text-b3-grey font-neue-montreal-semibold truncate text-sm", children: walletName }), _jsx("p", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: centerTruncate(address, 4) })] }), isActive && (_jsx("div", { className: "shrink-0", children: _jsx(CheckIcon, {}) }))] }));
41
41
  }
42
42
  export function Header({ onLogout }) {
43
43
  const activeWallet = useActiveWallet();
@@ -75,7 +75,7 @@ export function Header({ onLogout }) {
75
75
  },
76
76
  });
77
77
  };
78
- return (_jsx(AccordionPrimitive.Root, { type: "single", collapsible: true, value: isExpanded ? "wallet-switcher" : "", className: "bg-b3-background border-b3-line relative border-b", onValueChange: (value) => setIsExpanded(value === "wallet-switcher"), children: _jsxs(AccordionPrimitive.Item, { value: "wallet-switcher", className: "border-none", children: [_jsxs(AccordionPrimitive.Trigger, { className: "group flex w-full items-center justify-between border-none bg-transparent px-5 py-3 outline-none", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "relative size-10 shrink-0 overflow-clip rounded-full", children: isActiveGlobalAccount ? (_jsx("div", { className: "flex size-full items-center justify-center p-1", children: _jsx("img", { src: "https://cdn.b3.fun/b3_logo.svg", alt: "B3", className: "size-full object-contain" }) })) : activeWalletImage ? (_jsx("img", { src: activeWalletImage, alt: "Active Wallet", className: "size-full object-contain p-1" })) : (_jsx("div", { className: "flex size-full items-center justify-center", children: _jsx(WalletIcon, {}) })) }), _jsxs("div", { className: "flex flex-col gap-0.5", children: [_jsx("p", { className: "text-b3-grey font-neue-montreal-semibold text-sm", children: "Active Wallet" }), _jsxs("div", { className: "flex items-center gap-1", children: [_jsx("p", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: centerTruncate(address, 4) }), _jsx(CopyToClipboard, { text: address })] })] })] }), _jsx(ChevronDownIcon, { className: "text-b3-grey transition-transform duration-200 group-data-[state=open]:rotate-180" })] }), _jsx(AnimatePresence, { children: isExpanded && (_jsx(AccordionPrimitive.Content, { forceMount: true, className: "absolute left-0 right-0 top-full z-50 overflow-visible", children: _jsxs(motion.div, { initial: { opacity: 0, y: -10 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -10 }, transition: { duration: 0.2, ease: "easeInOut" }, className: "flex flex-col gap-3 rounded-bl-3xl rounded-br-3xl bg-white px-2 pb-5 pt-3 shadow-[0px_32px_64px_-12px_rgba(10,13,18,0.14),0px_5px_5px_-2.5px_rgba(10,13,18,0.04)]", children: [_jsxs("div", { className: "flex flex-col gap-3", children: [connectedWallets.map(wallet => (_jsx(WalletItem, { wallet: wallet, isActive: activeWallet?.id === wallet.id, onClick: () => handleWalletSwitch(wallet) }, wallet.id))), _jsxs("div", { className: "hover:bg-b3-line/50 box-border flex cursor-pointer items-center gap-2 rounded-xl px-3 py-2 transition-colors", onClick: handleLinkWallet, children: [_jsx("div", { className: "bg-b3-line flex size-10 shrink-0 items-center justify-center rounded-full", children: _jsx(LinkIcon, { className: "text-b3-grey" }) }), _jsx("div", { className: "flex flex-1 flex-col", children: _jsx("p", { className: "text-b3-grey font-neue-montreal-semibold text-sm", children: "Link another wallet" }) })] })] }), _jsxs("button", { className: "border-b3-line hover:bg-b3-line bg-b3-background flex items-center justify-center gap-1.5 rounded-xl border border-solid p-2.5 transition-colors", onClick: onLogoutEnhanced, disabled: logoutLoading, style: {
78
+ return (_jsx(AccordionPrimitive.Root, { type: "single", collapsible: true, value: isExpanded ? "wallet-switcher" : "", className: "b3-modal-wallet-switcher bg-b3-background border-b3-line relative border-b", onValueChange: (value) => setIsExpanded(value === "wallet-switcher"), children: _jsxs(AccordionPrimitive.Item, { value: "wallet-switcher", className: "border-none", children: [_jsxs(AccordionPrimitive.Trigger, { className: "b3-modal-wallet-switcher-trigger group flex w-full items-center justify-between border-none bg-transparent px-5 py-3 outline-none", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "relative size-10 shrink-0 overflow-clip rounded-full", children: isActiveGlobalAccount ? (_jsx("div", { className: "flex size-full items-center justify-center p-1", children: _jsx("img", { src: "https://cdn.b3.fun/b3_logo.svg", alt: "B3", className: "size-full object-contain" }) })) : activeWalletImage ? (_jsx("img", { src: activeWalletImage, alt: "Active Wallet", className: "size-full object-contain p-1" })) : (_jsx("div", { className: "flex size-full items-center justify-center", children: _jsx(WalletIcon, {}) })) }), _jsxs("div", { className: "flex flex-col gap-0.5", children: [_jsx("p", { className: "text-b3-grey font-neue-montreal-semibold text-left text-sm", children: "Active Wallet" }), _jsxs("div", { className: "flex items-center gap-1", children: [_jsx("p", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: centerTruncate(address, 4) }), _jsx(CopyToClipboard, { text: address })] })] })] }), _jsx(ChevronDownIcon, { className: "b3-modal-wallet-switcher-chevron text-b3-grey transition-transform duration-200 group-data-[state=open]:rotate-180" })] }), _jsx(AnimatePresence, { children: isExpanded && (_jsx(AccordionPrimitive.Content, { forceMount: true, className: "absolute left-0 right-0 top-full z-50 overflow-visible", children: _jsxs(motion.div, { initial: { opacity: 0, y: -10 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -10 }, transition: { duration: 0.2, ease: "easeInOut" }, className: "b3-modal-wallet-switcher-content flex flex-col gap-3 rounded-bl-3xl rounded-br-3xl bg-white px-2 pb-5 pt-3 shadow-[0px_32px_64px_-12px_rgba(10,13,18,0.14),0px_5px_5px_-2.5px_rgba(10,13,18,0.04)]", children: [_jsxs("div", { className: "flex flex-col gap-3", children: [connectedWallets.map(wallet => (_jsx(WalletItem, { wallet: wallet, isActive: activeWallet?.id === wallet.id, onClick: () => handleWalletSwitch(wallet) }, wallet.id))), _jsxs("div", { className: "b3-modal-link-another-wallet hover:bg-b3-line/50 box-border flex cursor-pointer items-center gap-2 rounded-xl px-3 py-2 transition-colors", onClick: handleLinkWallet, children: [_jsx("div", { className: "bg-b3-line flex size-10 shrink-0 items-center justify-center rounded-full", children: _jsx(LinkIcon, { className: "text-b3-grey" }) }), _jsx("div", { className: "flex flex-1 flex-col", children: _jsx("p", { className: "text-b3-grey font-neue-montreal-semibold text-sm", children: "Link another wallet" }) })] })] }), _jsxs("button", { className: "b3-modal-sign-out-button border-b3-line hover:bg-b3-line bg-b3-background flex items-center justify-center gap-1.5 rounded-xl border border-solid p-2.5 transition-colors", onClick: onLogoutEnhanced, disabled: logoutLoading, style: {
79
79
  boxShadow: "inset 0px 0px 0px 1px rgba(10,13,18,0.18), inset 0px -2px 0px 0px rgba(10,13,18,0.05)",
80
80
  }, children: [logoutLoading ? (_jsx(Loader2, { className: "animate-spin", size: 20 })) : (_jsx(SignOutIcon, { size: 20, className: "text-b3-grey" })), _jsx("p", { className: "text-b3-grey font-neue-montreal-semibold text-base", children: "Sign out" })] })] }) })) })] }) }));
81
81
  }
@@ -11,7 +11,7 @@ const HomeActionButton = ({ customClass, icon, label, onClick, }) => {
11
11
  const HomeActions = ({ showDeposit, showSwap }) => {
12
12
  const setB3ModalOpen = useModalStore(state => state.setB3ModalOpen);
13
13
  const setB3ModalContentType = useModalStore(state => state.setB3ModalContentType);
14
- return (_jsxs("div", { className: "border-b3-line grid grid-cols-4 gap-3 border-b px-5 pb-6", children: [showDeposit && (_jsx(HomeActionButton, { customClass: "manage-account-deposit", icon: _jsx(BankIcon, { size: 24, className: "text-b3-primary-blue shrink-0" }), label: "Deposit", onClick: () => {
14
+ return (_jsxs("div", { className: "b3-modal-home-actions border-b3-line grid grid-cols-4 gap-3 border-b px-5 pb-6", children: [showDeposit && (_jsx(HomeActionButton, { customClass: "manage-account-deposit", icon: _jsx(BankIcon, { size: 24, className: "text-b3-primary-blue shrink-0" }), label: "Deposit", onClick: () => {
15
15
  setB3ModalOpen(true);
16
16
  setB3ModalContentType({
17
17
  type: "deposit",
@@ -6,5 +6,5 @@ import NFTContent from "./NFTContent.js";
6
6
  import ProfileSection from "./ProfileSection.js";
7
7
  import TokenContent from "./TokenContent.js";
8
8
  export function HomeContent({ showDeposit = false, showSwap = true }) {
9
- return (_jsxs("div", { className: "flex flex-col", children: [_jsx(Header, {}), _jsxs("div", { className: "flex flex-col", children: [_jsx(ProfileSection, {}), _jsx(HomeActions, { showDeposit: showDeposit, showSwap: showSwap }), _jsx("div", { className: "space-y-2 p-5", children: _jsxs(Tabs, { defaultValue: "balance", children: [_jsxs(TabsList, { children: [_jsx(TabTrigger, { value: "balance", className: "font-neue-montreal-semibold p-0 pr-3", children: "Balance" }), _jsx(TabTrigger, { value: "nfts", className: "font-neue-montreal-semibold p-0 pr-3", children: "NFTs" })] }), _jsx(TabsContent, { value: "balance", className: "px-0 pb-4 pt-2", children: _jsx(TokenContent, {}) }), _jsx(TabsContent, { value: "nfts", className: "px-0 pb-4 pt-2", children: _jsx(NFTContent, {}) })] }) })] })] }));
9
+ return (_jsxs("div", { className: "flex flex-col", children: [_jsx(Header, {}), _jsxs("div", { className: "flex flex-col", children: [_jsx(ProfileSection, {}), _jsx(HomeActions, { showDeposit: showDeposit, showSwap: showSwap }), _jsx("div", { className: "b3-modal-balance-content space-y-2 p-5", children: _jsxs(Tabs, { defaultValue: "balance", children: [_jsxs(TabsList, { className: "b3-modal-balance-tabs-list", children: [_jsx(TabTrigger, { value: "balance", className: "font-neue-montreal-semibold p-0 pr-3", children: "Balance" }), _jsx(TabTrigger, { value: "nfts", className: "font-neue-montreal-semibold p-0 pr-3", children: "NFTs" })] }), _jsx(TabsContent, { value: "balance", className: "px-0 pb-4 pt-2", children: _jsx(TokenContent, {}) }), _jsx(TabsContent, { value: "nfts", className: "px-0 pb-4 pt-2", children: _jsx(NFTContent, {}) })] }) })] })] }));
10
10
  }
@@ -40,6 +40,6 @@ const ProfileSection = () => {
40
40
  const avatarSrc = user?.avatar || profile?.avatar;
41
41
  // Get current username - prioritize user.username, fallback to profile data
42
42
  const currentUsername = user?.username || profile?.displayName || formatUsername(profile?.name || "");
43
- return (_jsx("div", { className: "flex items-center justify-between px-5 py-6", children: _jsxs("div", { className: "global-account-profile flex items-center gap-4", children: [_jsxs("div", { className: "global-account-profile-avatar relative", children: [_jsx(IPFSMediaRenderer, { src: avatarSrc, alt: "Profile Avatar", className: "border-b3-line border-1 bg-b3-primary-wash size-14 rounded-full border" }), _jsx("button", { onClick: handleEditAvatar, className: "border-b3-background hover:bg-b3-grey/80 absolute -bottom-1 -right-1 flex size-6 items-center justify-center rounded-full border-4 bg-[#a0a0ab] transition-colors", children: _jsx(Pencil, { size: 10, className: "text-b3-background" }) })] }), _jsxs("div", { className: "global-account-profile-info flex flex-col gap-1", children: [_jsxs("h2", { className: "text-b3-grey font-neue-montreal-semibold flex h-[38px] items-center gap-1 text-xl", children: [_jsx("div", { className: "text-b3-foreground-muted", children: " $" }), _jsx("div", { className: "text-[30px]", children: formatDisplayNumber(totalBalanceUsd, { fractionDigits: 2 }) })] }), _jsx("div", { className: "font-neue-montreal-semibold text-base leading-none text-[#0B57C2]", children: currentUsername })] })] }) }));
43
+ return (_jsx("div", { className: "flex items-center justify-between px-5 py-6", children: _jsxs("div", { className: "global-account-profile flex items-center gap-4", children: [_jsxs("div", { className: "global-account-profile-avatar relative", children: [_jsx(IPFSMediaRenderer, { src: avatarSrc, alt: "Profile Avatar", className: "border-b3-line border-1 bg-b3-primary-wash size-14 rounded-full border" }), _jsx("button", { onClick: handleEditAvatar, className: "border-b3-background hover:bg-b3-grey/80 absolute -bottom-1 -right-1 flex size-6 items-center justify-center rounded-full border-4 bg-[#a0a0ab] transition-colors", children: _jsx(Pencil, { size: 10, className: "text-b3-background" }) })] }), _jsxs("div", { className: "global-account-profile-info flex flex-col gap-1", children: [_jsxs("h2", { className: "text-b3-grey font-neue-montreal-semibold flex h-[38px] items-center gap-1 text-xl", children: [_jsx("div", { className: "text-b3-foreground-muted", children: " $" }), _jsx("div", { className: "text-[30px]", children: formatDisplayNumber(totalBalanceUsd, { fractionDigits: 2 }) })] }), _jsx("div", { className: "b3-modal-username font-neue-montreal-semibold text-base leading-none text-[#0B57C2]", children: currentUsername })] })] }) }));
44
44
  };
45
45
  export default ProfileSection;