@microcosmmoney/portal-react 3.12.8 → 3.13.1

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 (351) hide show
  1. package/dist/index.d.ts +22 -0
  2. package/dist/index.js +48 -1
  3. package/dist/main-portal/components/auctions/AuctionsPage.d.ts +1 -0
  4. package/dist/main-portal/components/auctions/AuctionsPage.js +218 -0
  5. package/dist/main-portal/components/data/asset-stats.d.ts +1 -0
  6. package/dist/main-portal/components/data/asset-stats.js +33 -0
  7. package/dist/main-portal/components/data/charts/MCCSupplyChart.d.ts +7 -0
  8. package/dist/main-portal/components/data/charts/MCCSupplyChart.js +27 -0
  9. package/dist/main-portal/components/data/charts/MiningTrendChart.d.ts +7 -0
  10. package/dist/main-portal/components/data/charts/MiningTrendChart.js +39 -0
  11. package/dist/main-portal/components/data/charts/PriceChart.d.ts +5 -0
  12. package/dist/main-portal/components/data/charts/PriceChart.js +99 -0
  13. package/dist/main-portal/components/data/charts/TeamWalletChart.d.ts +7 -0
  14. package/dist/main-portal/components/data/charts/TeamWalletChart.js +33 -0
  15. package/dist/main-portal/components/data/charts/TerritoryProgressChart.d.ts +7 -0
  16. package/dist/main-portal/components/data/charts/TerritoryProgressChart.js +35 -0
  17. package/dist/main-portal/components/data/charts/UserLevelPieChart.d.ts +7 -0
  18. package/dist/main-portal/components/data/charts/UserLevelPieChart.js +34 -0
  19. package/dist/main-portal/components/data/charts/index.d.ts +5 -0
  20. package/dist/main-portal/components/data/charts/index.js +14 -0
  21. package/dist/main-portal/components/data/data-hero.d.ts +1 -0
  22. package/dist/main-portal/components/data/data-hero.js +81 -0
  23. package/dist/main-portal/components/data/mining-history-stats.d.ts +1 -0
  24. package/dist/main-portal/components/data/mining-history-stats.js +44 -0
  25. package/dist/main-portal/components/data/team-wallet-stats.d.ts +1 -0
  26. package/dist/main-portal/components/data/team-wallet-stats.js +34 -0
  27. package/dist/main-portal/components/data/territory-stats.d.ts +1 -0
  28. package/dist/main-portal/components/data/territory-stats.js +48 -0
  29. package/dist/main-portal/components/data/user-level-stats.d.ts +1 -0
  30. package/dist/main-portal/components/data/user-level-stats.js +36 -0
  31. package/dist/main-portal/components/fragment/FragmentPage.d.ts +1 -0
  32. package/dist/main-portal/components/fragment/FragmentPage.js +13 -0
  33. package/dist/main-portal/components/income/ManagerIncomePage.d.ts +1 -0
  34. package/dist/main-portal/components/income/ManagerIncomePage.js +147 -0
  35. package/dist/main-portal/components/layout/AppSidebar.d.ts +3 -0
  36. package/dist/main-portal/components/layout/AppSidebar.js +88 -0
  37. package/dist/main-portal/components/layout/DashboardHeader.d.ts +1 -0
  38. package/dist/main-portal/components/layout/DashboardHeader.js +121 -0
  39. package/dist/main-portal/components/layout/LocaleSwitcher.d.ts +1 -0
  40. package/dist/main-portal/components/layout/LocaleSwitcher.js +30 -0
  41. package/dist/main-portal/components/layout/MainFooter.d.ts +2 -0
  42. package/dist/main-portal/components/layout/MainFooter.js +50 -0
  43. package/dist/main-portal/components/layout/ShadcnNavbar.d.ts +1 -0
  44. package/dist/main-portal/components/layout/ShadcnNavbar.js +155 -0
  45. package/dist/main-portal/components/layout/TerminalSidebar.d.ts +1 -0
  46. package/dist/main-portal/components/layout/TerminalSidebar.js +110 -0
  47. package/dist/main-portal/components/lending/LendingPage.d.ts +1 -0
  48. package/dist/main-portal/components/lending/LendingPage.js +20 -0
  49. package/dist/main-portal/components/mcd/MCDPage.d.ts +1 -0
  50. package/dist/main-portal/components/mcd/MCDPage.js +125 -0
  51. package/dist/main-portal/components/messages/MessagesPage.d.ts +1 -0
  52. package/dist/main-portal/components/messages/MessagesPage.js +13 -0
  53. package/dist/main-portal/components/mining/MiningDistributionHistory.d.ts +11 -0
  54. package/dist/main-portal/components/mining/MiningDistributionHistory.js +84 -0
  55. package/dist/main-portal/components/mining/MiningModal.d.ts +12 -0
  56. package/dist/main-portal/components/mining/MiningModal.js +302 -0
  57. package/dist/main-portal/components/mining/MiningPage.d.ts +1 -0
  58. package/dist/main-portal/components/mining/MiningPage.js +237 -0
  59. package/dist/main-portal/components/mining/index.d.ts +1 -0
  60. package/dist/main-portal/components/mining/index.js +6 -0
  61. package/dist/main-portal/components/notifications/NotificationsPage.d.ts +1 -0
  62. package/dist/main-portal/components/notifications/NotificationsPage.js +13 -0
  63. package/dist/main-portal/components/organization/OrganizationPage.d.ts +1 -0
  64. package/dist/main-portal/components/organization/OrganizationPage.js +235 -0
  65. package/dist/main-portal/components/organization/connection-line.d.ts +12 -0
  66. package/dist/main-portal/components/organization/connection-line.js +38 -0
  67. package/dist/main-portal/components/organization/diagram-node.d.ts +17 -0
  68. package/dist/main-portal/components/organization/diagram-node.js +105 -0
  69. package/dist/main-portal/components/organization/system-panel.d.ts +11 -0
  70. package/dist/main-portal/components/organization/system-panel.js +72 -0
  71. package/dist/main-portal/components/profile/EmailChangeCard.d.ts +1 -0
  72. package/dist/main-portal/components/profile/EmailChangeCard.js +58 -0
  73. package/dist/main-portal/components/profile/ProfilePage.d.ts +1 -0
  74. package/dist/main-portal/components/profile/ProfilePage.js +263 -0
  75. package/dist/main-portal/components/profile/TwoFactorSettings.d.ts +1 -0
  76. package/dist/main-portal/components/profile/TwoFactorSettings.js +99 -0
  77. package/dist/main-portal/components/providers/ClientProviders.d.ts +6 -0
  78. package/dist/main-portal/components/providers/ClientProviders.js +17 -0
  79. package/dist/main-portal/components/providers/SolanaWalletProvider.d.ts +7 -0
  80. package/dist/main-portal/components/providers/SolanaWalletProvider.js +17 -0
  81. package/dist/main-portal/components/providers/theme-provider.d.ts +5 -0
  82. package/dist/main-portal/components/providers/theme-provider.js +10 -0
  83. package/dist/main-portal/components/queue/QueueStatusPage.d.ts +1 -0
  84. package/dist/main-portal/components/queue/QueueStatusPage.js +245 -0
  85. package/dist/main-portal/components/reincarnation/ReincarnationPage.d.ts +1 -0
  86. package/dist/main-portal/components/reincarnation/ReincarnationPage.js +87 -0
  87. package/dist/main-portal/components/resources/mcc-stats-section.d.ts +1 -0
  88. package/dist/main-portal/components/resources/mcc-stats-section.js +199 -0
  89. package/dist/main-portal/components/resources/mcd-stats-section.d.ts +1 -0
  90. package/dist/main-portal/components/resources/mcd-stats-section.js +76 -0
  91. package/dist/main-portal/components/resources/minting-entry-section.d.ts +1 -0
  92. package/dist/main-portal/components/resources/minting-entry-section.js +70 -0
  93. package/dist/main-portal/components/resources/public-mining-modal.d.ts +7 -0
  94. package/dist/main-portal/components/resources/public-mining-modal.js +239 -0
  95. package/dist/main-portal/components/resources/recycle-pool-section.d.ts +1 -0
  96. package/dist/main-portal/components/resources/recycle-pool-section.js +82 -0
  97. package/dist/main-portal/components/resources/registration-prompt.d.ts +8 -0
  98. package/dist/main-portal/components/resources/registration-prompt.js +13 -0
  99. package/dist/main-portal/components/rewards/RewardsPage.d.ts +1 -0
  100. package/dist/main-portal/components/rewards/RewardsPage.js +149 -0
  101. package/dist/main-portal/components/security/domain-verification-bar.d.ts +1 -0
  102. package/dist/main-portal/components/security/domain-verification-bar.js +32 -0
  103. package/dist/main-portal/components/stations/StationDetailPage.d.ts +5 -0
  104. package/dist/main-portal/components/stations/StationDetailPage.js +232 -0
  105. package/dist/main-portal/components/stations/StationIncomeChart.d.ts +11 -0
  106. package/dist/main-portal/components/stations/StationIncomeChart.js +57 -0
  107. package/dist/main-portal/components/stations/StationKPIHistory.d.ts +1 -0
  108. package/dist/main-portal/components/stations/StationKPIHistory.js +7 -0
  109. package/dist/main-portal/components/stations/StationListPage.d.ts +1 -0
  110. package/dist/main-portal/components/stations/StationListPage.js +341 -0
  111. package/dist/main-portal/components/stations/StationMemberRanking.d.ts +13 -0
  112. package/dist/main-portal/components/stations/StationMemberRanking.js +64 -0
  113. package/dist/main-portal/components/stations/StationSummaryCards.d.ts +13 -0
  114. package/dist/main-portal/components/stations/StationSummaryCards.js +30 -0
  115. package/dist/main-portal/components/stations/StationsPage.d.ts +1 -0
  116. package/dist/main-portal/components/stations/StationsPage.js +239 -0
  117. package/dist/main-portal/components/territory/TerritoryNFTBrowser.d.ts +1 -0
  118. package/dist/main-portal/components/territory/TerritoryNFTBrowser.js +147 -0
  119. package/dist/main-portal/components/ui/accordion.d.ts +7 -0
  120. package/dist/main-portal/components/ui/accordion.js +57 -0
  121. package/dist/main-portal/components/ui/alert-dialog.d.ts +14 -0
  122. package/dist/main-portal/components/ui/alert-dialog.js +85 -0
  123. package/dist/main-portal/components/ui/alert.d.ts +9 -0
  124. package/dist/main-portal/components/ui/alert.js +28 -0
  125. package/dist/main-portal/components/ui/aspect-ratio.d.ts +3 -0
  126. package/dist/main-portal/components/ui/aspect-ratio.js +43 -0
  127. package/dist/main-portal/components/ui/avatar.d.ts +6 -0
  128. package/dist/main-portal/components/ui/avatar.js +52 -0
  129. package/dist/main-portal/components/ui/badge.d.ts +9 -0
  130. package/dist/main-portal/components/ui/badge.js +26 -0
  131. package/dist/main-portal/components/ui/breadcrumb.d.ts +11 -0
  132. package/dist/main-portal/components/ui/breadcrumb.js +35 -0
  133. package/dist/main-portal/components/ui/button-group.d.ts +11 -0
  134. package/dist/main-portal/components/ui/button-group.js +34 -0
  135. package/dist/main-portal/components/ui/button.d.ts +10 -0
  136. package/dist/main-portal/components/ui/button.js +35 -0
  137. package/dist/main-portal/components/ui/calendar.d.ts +8 -0
  138. package/dist/main-portal/components/ui/calendar.js +111 -0
  139. package/dist/main-portal/components/ui/card.d.ts +17 -0
  140. package/dist/main-portal/components/ui/card.js +41 -0
  141. package/dist/main-portal/components/ui/carousel.d.ts +19 -0
  142. package/dist/main-portal/components/ui/carousel.js +134 -0
  143. package/dist/main-portal/components/ui/chart.d.ts +40 -0
  144. package/dist/main-portal/components/ui/chart.js +168 -0
  145. package/dist/main-portal/components/ui/checkbox.d.ts +4 -0
  146. package/dist/main-portal/components/ui/checkbox.js +45 -0
  147. package/dist/main-portal/components/ui/collapsible.d.ts +5 -0
  148. package/dist/main-portal/components/ui/collapsible.js +51 -0
  149. package/dist/main-portal/components/ui/command.d.ts +18 -0
  150. package/dist/main-portal/components/ui/command.js +45 -0
  151. package/dist/main-portal/components/ui/context-menu.d.ts +25 -0
  152. package/dist/main-portal/components/ui/context-menu.js +101 -0
  153. package/dist/main-portal/components/ui/dialog.d.ts +15 -0
  154. package/dist/main-portal/components/ui/dialog.js +81 -0
  155. package/dist/main-portal/components/ui/drawer.d.ts +13 -0
  156. package/dist/main-portal/components/ui/drawer.js +47 -0
  157. package/dist/main-portal/components/ui/dropdown-menu.d.ts +25 -0
  158. package/dist/main-portal/components/ui/dropdown-menu.js +101 -0
  159. package/dist/main-portal/components/ui/empty.d.ts +11 -0
  160. package/dist/main-portal/components/ui/empty.js +41 -0
  161. package/dist/main-portal/components/ui/field.d.ts +24 -0
  162. package/dist/main-portal/components/ui/field.js +85 -0
  163. package/dist/main-portal/components/ui/form.d.ts +24 -0
  164. package/dist/main-portal/components/ui/form.js +103 -0
  165. package/dist/main-portal/components/ui/hover-avatar.d.ts +10 -0
  166. package/dist/main-portal/components/ui/hover-avatar.js +70 -0
  167. package/dist/main-portal/components/ui/hover-card.d.ts +6 -0
  168. package/dist/main-portal/components/ui/hover-card.js +52 -0
  169. package/dist/main-portal/components/ui/input-group.d.ts +15 -0
  170. package/dist/main-portal/components/ui/input-group.js +65 -0
  171. package/dist/main-portal/components/ui/input-otp.d.ts +11 -0
  172. package/dist/main-portal/components/ui/input-otp.js +60 -0
  173. package/dist/main-portal/components/ui/input.d.ts +3 -0
  174. package/dist/main-portal/components/ui/input.js +8 -0
  175. package/dist/main-portal/components/ui/item.d.ts +23 -0
  176. package/dist/main-portal/components/ui/item.js +77 -0
  177. package/dist/main-portal/components/ui/kbd.d.ts +3 -0
  178. package/dist/main-portal/components/ui/kbd.js +13 -0
  179. package/dist/main-portal/components/ui/label.d.ts +4 -0
  180. package/dist/main-portal/components/ui/label.js +44 -0
  181. package/dist/main-portal/components/ui/menubar.d.ts +26 -0
  182. package/dist/main-portal/components/ui/menubar.js +105 -0
  183. package/dist/main-portal/components/ui/navigation-menu.d.ts +14 -0
  184. package/dist/main-portal/components/ui/navigation-menu.js +75 -0
  185. package/dist/main-portal/components/ui/pagination.d.ts +13 -0
  186. package/dist/main-portal/components/ui/pagination.js +37 -0
  187. package/dist/main-portal/components/ui/popover.d.ts +7 -0
  188. package/dist/main-portal/components/ui/popover.js +56 -0
  189. package/dist/main-portal/components/ui/progress.d.ts +4 -0
  190. package/dist/main-portal/components/ui/progress.js +44 -0
  191. package/dist/main-portal/components/ui/radio-group.d.ts +5 -0
  192. package/dist/main-portal/components/ui/radio-group.js +49 -0
  193. package/dist/main-portal/components/ui/resizable.d.ts +8 -0
  194. package/dist/main-portal/components/ui/resizable.js +53 -0
  195. package/dist/main-portal/components/ui/scroll-area.d.ts +5 -0
  196. package/dist/main-portal/components/ui/scroll-area.js +50 -0
  197. package/dist/main-portal/components/ui/select.d.ts +15 -0
  198. package/dist/main-portal/components/ui/select.js +83 -0
  199. package/dist/main-portal/components/ui/separator.d.ts +4 -0
  200. package/dist/main-portal/components/ui/separator.js +44 -0
  201. package/dist/main-portal/components/ui/sheet.d.ts +13 -0
  202. package/dist/main-portal/components/ui/sheet.js +83 -0
  203. package/dist/main-portal/components/ui/sidebar.d.ts +69 -0
  204. package/dist/main-portal/components/ui/sidebar.js +258 -0
  205. package/dist/main-portal/components/ui/skeleton.d.ts +2 -0
  206. package/dist/main-portal/components/ui/skeleton.js +9 -0
  207. package/dist/main-portal/components/ui/slider.d.ts +4 -0
  208. package/dist/main-portal/components/ui/slider.js +50 -0
  209. package/dist/main-portal/components/ui/sonner.d.ts +3 -0
  210. package/dist/main-portal/components/ui/sonner.js +17 -0
  211. package/dist/main-portal/components/ui/spinner.d.ts +2 -0
  212. package/dist/main-portal/components/ui/spinner.js +10 -0
  213. package/dist/main-portal/components/ui/switch.d.ts +4 -0
  214. package/dist/main-portal/components/ui/switch.js +44 -0
  215. package/dist/main-portal/components/ui/table.d.ts +10 -0
  216. package/dist/main-portal/components/ui/table.js +38 -0
  217. package/dist/main-portal/components/ui/tabs.d.ts +7 -0
  218. package/dist/main-portal/components/ui/tabs.js +53 -0
  219. package/dist/main-portal/components/ui/terminal.d.ts +49 -0
  220. package/dist/main-portal/components/ui/terminal.js +56 -0
  221. package/dist/main-portal/components/ui/textarea.d.ts +3 -0
  222. package/dist/main-portal/components/ui/textarea.js +8 -0
  223. package/dist/main-portal/components/ui/time-remaining.d.ts +54 -0
  224. package/dist/main-portal/components/ui/time-remaining.js +223 -0
  225. package/dist/main-portal/components/ui/toast.d.ts +15 -0
  226. package/dist/main-portal/components/ui/toast.js +77 -0
  227. package/dist/main-portal/components/ui/toaster.d.ts +1 -0
  228. package/dist/main-portal/components/ui/toaster.js +14 -0
  229. package/dist/main-portal/components/ui/toggle-group.d.ts +7 -0
  230. package/dist/main-portal/components/ui/toggle-group.js +58 -0
  231. package/dist/main-portal/components/ui/toggle.d.ts +9 -0
  232. package/dist/main-portal/components/ui/toggle.js +64 -0
  233. package/dist/main-portal/components/ui/tooltip.d.ts +7 -0
  234. package/dist/main-portal/components/ui/tooltip.js +56 -0
  235. package/dist/main-portal/components/ui/use-mobile.d.ts +1 -0
  236. package/dist/main-portal/components/ui/use-mobile.js +53 -0
  237. package/dist/main-portal/components/voting/VotingPage.d.ts +1 -0
  238. package/dist/main-portal/components/voting/VotingPage.js +14 -0
  239. package/dist/main-portal/components/wallet/MCCHistory.d.ts +9 -0
  240. package/dist/main-portal/components/wallet/MCCHistory.js +100 -0
  241. package/dist/main-portal/components/wallet/WalletManagement.d.ts +5 -0
  242. package/dist/main-portal/components/wallet/WalletManagement.js +144 -0
  243. package/dist/main-portal/components/wallet/WalletPage.d.ts +1 -0
  244. package/dist/main-portal/components/wallet/WalletPage.js +130 -0
  245. package/dist/main-portal/config/menu-config.d.ts +22 -0
  246. package/dist/main-portal/config/menu-config.js +167 -0
  247. package/dist/main-portal/contexts/MCCPriceContext.d.ts +38 -0
  248. package/dist/main-portal/contexts/MCCPriceContext.js +70 -0
  249. package/dist/main-portal/contexts/WalletContext.d.ts +48 -0
  250. package/dist/main-portal/contexts/WalletContext.js +94 -0
  251. package/dist/main-portal/hooks/index.d.ts +4 -0
  252. package/dist/main-portal/hooks/index.js +11 -0
  253. package/dist/main-portal/hooks/use-breakpoint.d.ts +45 -0
  254. package/dist/main-portal/hooks/use-breakpoint.js +91 -0
  255. package/dist/main-portal/hooks/use-mobile.d.ts +1 -0
  256. package/dist/main-portal/hooks/use-mobile.js +55 -0
  257. package/dist/main-portal/hooks/use-toast.d.ts +44 -0
  258. package/dist/main-portal/hooks/use-toast.js +164 -0
  259. package/dist/main-portal/hooks/useAuth.d.ts +30 -0
  260. package/dist/main-portal/hooks/useAuth.js +136 -0
  261. package/dist/main-portal/hooks/useMCC.d.ts +26 -0
  262. package/dist/main-portal/hooks/useMCC.js +148 -0
  263. package/dist/main-portal/hooks/useMCD.d.ts +17 -0
  264. package/dist/main-portal/hooks/useMCD.js +114 -0
  265. package/dist/main-portal/hooks/useMultiWalletBalance.d.ts +31 -0
  266. package/dist/main-portal/hooks/useMultiWalletBalance.js +65 -0
  267. package/dist/main-portal/hooks/useSolanaBalance.d.ts +21 -0
  268. package/dist/main-portal/hooks/useSolanaBalance.js +58 -0
  269. package/dist/main-portal/hooks/useSpeechRecognition.d.ts +6 -0
  270. package/dist/main-portal/hooks/useSpeechRecognition.js +82 -0
  271. package/dist/main-portal/hooks/useStats.d.ts +131 -0
  272. package/dist/main-portal/hooks/useStats.js +161 -0
  273. package/dist/main-portal/hooks/useStrategies.d.ts +134 -0
  274. package/dist/main-portal/hooks/useStrategies.js +28 -0
  275. package/dist/main-portal/hooks/useUserRank.d.ts +16 -0
  276. package/dist/main-portal/hooks/useUserRank.js +61 -0
  277. package/dist/main-portal/hooks/useWalletTokenBalances.d.ts +29 -0
  278. package/dist/main-portal/hooks/useWalletTokenBalances.js +106 -0
  279. package/dist/main-portal/i18n/navigation.d.ts +341 -0
  280. package/dist/main-portal/i18n/navigation.js +7 -0
  281. package/dist/main-portal/i18n/request.d.ts +2 -0
  282. package/dist/main-portal/i18n/request.js +47 -0
  283. package/dist/main-portal/i18n/routing.d.ts +18 -0
  284. package/dist/main-portal/i18n/routing.js +10 -0
  285. package/dist/main-portal/lib/ai-chat-config.d.ts +8 -0
  286. package/dist/main-portal/lib/ai-chat-config.js +144 -0
  287. package/dist/main-portal/lib/api/blockchain.d.ts +178 -0
  288. package/dist/main-portal/lib/api/blockchain.js +302 -0
  289. package/dist/main-portal/lib/api/core.d.ts +3 -0
  290. package/dist/main-portal/lib/api/core.js +47 -0
  291. package/dist/main-portal/lib/api/index.d.ts +9 -0
  292. package/dist/main-portal/lib/api/index.js +37 -0
  293. package/dist/main-portal/lib/api/services/ai.d.ts +139 -0
  294. package/dist/main-portal/lib/api/services/ai.js +214 -0
  295. package/dist/main-portal/lib/api/services/finance.d.ts +37 -0
  296. package/dist/main-portal/lib/api/services/finance.js +144 -0
  297. package/dist/main-portal/lib/api/services/index.d.ts +5 -0
  298. package/dist/main-portal/lib/api/services/index.js +21 -0
  299. package/dist/main-portal/lib/api/services/mining.d.ts +68 -0
  300. package/dist/main-portal/lib/api/services/mining.js +76 -0
  301. package/dist/main-portal/lib/api/services/organization.d.ts +161 -0
  302. package/dist/main-portal/lib/api/services/organization.js +139 -0
  303. package/dist/main-portal/lib/api/services/user.d.ts +90 -0
  304. package/dist/main-portal/lib/api/services/user.js +78 -0
  305. package/dist/main-portal/lib/api/services.d.ts +1 -0
  306. package/dist/main-portal/lib/api/services.js +17 -0
  307. package/dist/main-portal/lib/api-service.d.ts +1 -0
  308. package/dist/main-portal/lib/api-service.js +18 -0
  309. package/dist/main-portal/lib/auth-service.d.ts +65 -0
  310. package/dist/main-portal/lib/auth-service.js +382 -0
  311. package/dist/main-portal/lib/config/mainstream-tokens.d.ts +13 -0
  312. package/dist/main-portal/lib/config/mainstream-tokens.js +88 -0
  313. package/dist/main-portal/lib/docs-data.d.ts +36 -0
  314. package/dist/main-portal/lib/docs-data.js +108 -0
  315. package/dist/main-portal/lib/oauth-config.d.ts +12 -0
  316. package/dist/main-portal/lib/oauth-config.js +48 -0
  317. package/dist/main-portal/lib/order-id-generator.d.ts +19 -0
  318. package/dist/main-portal/lib/order-id-generator.js +97 -0
  319. package/dist/main-portal/lib/solana/reincarnation-client.d.ts +28 -0
  320. package/dist/main-portal/lib/solana/reincarnation-client.js +39 -0
  321. package/dist/main-portal/lib/solana/solana-pay.d.ts +31 -0
  322. package/dist/main-portal/lib/solana/solana-pay.js +85 -0
  323. package/dist/main-portal/lib/strategy/defaults.d.ts +2 -0
  324. package/dist/main-portal/lib/strategy/defaults.js +58 -0
  325. package/dist/main-portal/lib/strategy/index.d.ts +3 -0
  326. package/dist/main-portal/lib/strategy/index.js +20 -0
  327. package/dist/main-portal/lib/strategy/tooltips.d.ts +1 -0
  328. package/dist/main-portal/lib/strategy/tooltips.js +50 -0
  329. package/dist/main-portal/lib/strategy/types.d.ts +74 -0
  330. package/dist/main-portal/lib/strategy/types.js +2 -0
  331. package/dist/main-portal/lib/types/ai.types.d.ts +111 -0
  332. package/dist/main-portal/lib/types/ai.types.js +2 -0
  333. package/dist/main-portal/lib/types/api.d.ts +5 -0
  334. package/dist/main-portal/lib/types/api.js +21 -0
  335. package/dist/main-portal/lib/types/common.types.d.ts +168 -0
  336. package/dist/main-portal/lib/types/common.types.js +24 -0
  337. package/dist/main-portal/lib/types/finance.types.d.ts +267 -0
  338. package/dist/main-portal/lib/types/finance.types.js +2 -0
  339. package/dist/main-portal/lib/types/protocol.types.d.ts +216 -0
  340. package/dist/main-portal/lib/types/protocol.types.js +2 -0
  341. package/dist/main-portal/lib/types/user.types.d.ts +243 -0
  342. package/dist/main-portal/lib/types/user.types.js +12 -0
  343. package/dist/main-portal/lib/utils/territoryId.d.ts +75 -0
  344. package/dist/main-portal/lib/utils/territoryId.js +241 -0
  345. package/dist/main-portal/lib/utils.d.ts +4 -0
  346. package/dist/main-portal/lib/utils.js +24 -0
  347. package/dist/main-portal/lib/wallet-auth/api.d.ts +13 -0
  348. package/dist/main-portal/lib/wallet-auth/api.js +132 -0
  349. package/dist/main-portal/lib/wallet-auth/types.d.ts +87 -0
  350. package/dist/main-portal/lib/wallet-auth/types.js +58 -0
  351. package/package.json +55 -5
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ // AI-generated · AI-managed · AI-maintained
3
+ "use client";
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.ConnectionLine = ConnectionLine;
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const typeColors = {
8
+ hdmi: { stroke: "#22d3ee", glow: "#22d3ee" },
9
+ sdi: { stroke: "#fb923c", glow: "#fb923c" },
10
+ usb: { stroke: "#4ade80", glow: "#4ade80" },
11
+ wireless: { stroke: "#f472b6", glow: "#f472b6" },
12
+ ethernet: { stroke: "#facc15", glow: "#facc15" },
13
+ stream: { stroke: "#a78bfa", glow: "#a78bfa" },
14
+ audio: { stroke: "#f87171", glow: "#f87171" },
15
+ };
16
+ function ConnectionLine({ fromX, fromY, toX, toY, label, type, lineStyle = "solid", isHighlighted }) {
17
+ const { stroke, glow } = typeColors[type];
18
+ const baseStrokeWidth = lineStyle === "thick" ? 4 : 2;
19
+ const highlightedStrokeWidth = lineStyle === "thick" ? 5 : 3;
20
+ const getDashArray = () => {
21
+ if (lineStyle === "dotted")
22
+ return "4 4";
23
+ if (type === "wireless")
24
+ return "8 4";
25
+ return undefined;
26
+ };
27
+ const midX = (fromX + toX) / 2;
28
+ const midY = (fromY + toY) / 2;
29
+ const dx = toX - fromX;
30
+ const cx1 = fromX + dx * 0.25;
31
+ const cy1 = fromY;
32
+ const cx2 = toX - dx * 0.25;
33
+ const cy2 = toY;
34
+ const pathD = `M ${fromX} ${fromY} C ${cx1} ${cy1}, ${cx2} ${cy2}, ${toX} ${toY}`;
35
+ return ((0, jsx_runtime_1.jsxs)("g", { className: "transition-opacity duration-300", style: { opacity: isHighlighted ? 1 : 0.3 }, children: [isHighlighted && ((0, jsx_runtime_1.jsx)("path", { d: pathD, fill: "none", stroke: glow, strokeWidth: "6", strokeOpacity: "0.3", filter: "url(#glow)" })), (0, jsx_runtime_1.jsx)("path", { d: pathD, fill: "none", stroke: stroke, strokeWidth: isHighlighted ? highlightedStrokeWidth : baseStrokeWidth, strokeDasharray: getDashArray(), className: isHighlighted ? "animate-flow-line" : "", style: {
36
+ strokeDasharray: getDashArray() || (isHighlighted ? "20 20" : undefined),
37
+ } }), isHighlighted && ((0, jsx_runtime_1.jsx)("circle", { r: "4", fill: stroke, children: (0, jsx_runtime_1.jsx)("animateMotion", { dur: "2s", repeatCount: "indefinite", path: pathD }) })), label && ((0, jsx_runtime_1.jsxs)("g", { transform: `translate(${midX}, ${midY - 8})`, children: [(0, jsx_runtime_1.jsx)("rect", { x: "-35", y: "-10", width: "70", height: "18", rx: "4", fill: "rgba(0,0,0,0.7)", stroke: isHighlighted ? stroke : "transparent", strokeWidth: "1" }), (0, jsx_runtime_1.jsx)("text", { textAnchor: "middle", dominantBaseline: "middle", fill: isHighlighted ? stroke : "#888", fontSize: "9", fontFamily: "var(--font-mono)", className: "select-none", children: label })] }))] }));
38
+ }
@@ -0,0 +1,17 @@
1
+ interface DiagramNodeProps {
2
+ id: string;
3
+ label: string;
4
+ sublabel?: string;
5
+ type: "system" | "sector" | "matrix" | "station" | "empty" | "team";
6
+ x: number;
7
+ y: number;
8
+ system: string;
9
+ isSelected: boolean;
10
+ isConnected: boolean;
11
+ isHovered: boolean;
12
+ onSelect: () => void;
13
+ onHover: (hovered: boolean) => void;
14
+ onDrag: (nodeId: string, x: number, y: number) => void;
15
+ }
16
+ export declare function DiagramNode({ id, label, sublabel, type, x, y, isSelected, isConnected, isHovered, onSelect, onHover, onDrag, }: DiagramNodeProps): import("react/jsx-runtime").JSX.Element;
17
+ export {};
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ // AI-generated · AI-managed · AI-maintained
3
+ "use client";
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.DiagramNode = DiagramNode;
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const react_1 = require("react");
8
+ const utils_1 = require("../../lib/utils");
9
+ const lucide_react_1 = require("lucide-react");
10
+ const typeConfig = {
11
+ system: {
12
+ icon: lucide_react_1.Globe,
13
+ className: "border-purple-500/50 bg-purple-500/10 text-purple-400 shadow-purple-500/20",
14
+ glowColor: "shadow-purple-500/50",
15
+ },
16
+ sector: {
17
+ icon: lucide_react_1.Map,
18
+ className: "border-blue-500/50 bg-blue-500/5 text-blue-400 shadow-blue-500/20",
19
+ glowColor: "shadow-blue-500/50",
20
+ },
21
+ matrix: {
22
+ icon: lucide_react_1.Grid3x3,
23
+ className: "border-cyan-500/50 bg-cyan-500/5 text-cyan-400 shadow-cyan-500/20",
24
+ glowColor: "shadow-cyan-500/50",
25
+ },
26
+ station: {
27
+ icon: lucide_react_1.Building2,
28
+ className: "border-emerald-500/50 bg-emerald-500/5 text-emerald-400 shadow-emerald-500/20",
29
+ glowColor: "shadow-emerald-500/50",
30
+ },
31
+ empty: {
32
+ icon: lucide_react_1.CircleDashed,
33
+ className: "border-dashed border-zinc-500/50 bg-zinc-500/5 text-zinc-400 shadow-zinc-500/20",
34
+ glowColor: "shadow-zinc-500/50",
35
+ },
36
+ team: {
37
+ icon: lucide_react_1.Users,
38
+ className: "border-orange-500/50 bg-orange-500/5 text-orange-400 shadow-orange-500/20",
39
+ glowColor: "shadow-orange-500/50",
40
+ },
41
+ };
42
+ function DiagramNode({ id, label, sublabel, type, x, y, isSelected, isConnected, isHovered, onSelect, onHover, onDrag, }) {
43
+ const config = typeConfig[type];
44
+ const Icon = config.icon;
45
+ const [isDragging, setIsDragging] = (0, react_1.useState)(false);
46
+ const dragOffset = (0, react_1.useRef)({ x: 0, y: 0 });
47
+ const nodeRef = (0, react_1.useRef)(null);
48
+ const handleMouseDown = (e) => {
49
+ if (e.button !== 0)
50
+ return;
51
+ e.preventDefault();
52
+ e.stopPropagation();
53
+ setIsDragging(true);
54
+ dragOffset.current = {
55
+ x: e.clientX - x,
56
+ y: e.clientY - y,
57
+ };
58
+ };
59
+ const handleTouchStart = (e) => {
60
+ e.stopPropagation();
61
+ const touch = e.touches[0];
62
+ setIsDragging(true);
63
+ dragOffset.current = {
64
+ x: touch.clientX - x,
65
+ y: touch.clientY - y,
66
+ };
67
+ };
68
+ (0, react_1.useEffect)(() => {
69
+ if (!isDragging)
70
+ return;
71
+ const handleMouseMove = (e) => {
72
+ const newX = e.clientX - dragOffset.current.x;
73
+ const newY = e.clientY - dragOffset.current.y;
74
+ onDrag(id, Math.max(0, newX), Math.max(0, newY));
75
+ };
76
+ const handleTouchMove = (e) => {
77
+ const touch = e.touches[0];
78
+ const newX = touch.clientX - dragOffset.current.x;
79
+ const newY = touch.clientY - dragOffset.current.y;
80
+ onDrag(id, Math.max(0, newX), Math.max(0, newY));
81
+ };
82
+ const handleMouseUp = () => {
83
+ setIsDragging(false);
84
+ };
85
+ const handleTouchEnd = () => {
86
+ setIsDragging(false);
87
+ };
88
+ document.addEventListener("mousemove", handleMouseMove);
89
+ document.addEventListener("mouseup", handleMouseUp);
90
+ document.addEventListener("touchmove", handleTouchMove, { passive: false });
91
+ document.addEventListener("touchend", handleTouchEnd);
92
+ return () => {
93
+ document.removeEventListener("mousemove", handleMouseMove);
94
+ document.removeEventListener("mouseup", handleMouseUp);
95
+ document.removeEventListener("touchmove", handleTouchMove);
96
+ document.removeEventListener("touchend", handleTouchEnd);
97
+ };
98
+ }, [isDragging, id, onDrag]);
99
+ return ((0, jsx_runtime_1.jsx)("div", { ref: nodeRef, className: (0, utils_1.cn)("absolute transition-all duration-300 ease-out select-none", "w-[120px]", isDragging && "cursor-grabbing z-50 transition-none", !isDragging && "cursor-grab"), style: { left: x, top: y }, onClick: (e) => {
100
+ if (!isDragging) {
101
+ e.stopPropagation();
102
+ onSelect();
103
+ }
104
+ }, onMouseEnter: () => !isDragging && onHover(true), onMouseLeave: () => !isDragging && onHover(false), children: (0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)("relative p-3 rounded-lg border-2 backdrop-blur-sm", "transition-all duration-300", config.className, (isSelected || isHovered || isDragging) && ["scale-110 z-20", "shadow-lg", config.glowColor], isConnected && !isHovered && "opacity-100", !isConnected && !isHovered && !isSelected && "opacity-60", isDragging && "ring-2 ring-white/30"), children: [(0, jsx_runtime_1.jsx)("div", { className: "absolute -top-0 left-1/2 -translate-x-1/2 -translate-y-1/2 p-1 rounded bg-background/80 border border-border/50 opacity-0 group-hover:opacity-100 hover:opacity-100 transition-opacity cursor-grab active:cursor-grabbing", onMouseDown: handleMouseDown, onTouchStart: handleTouchStart, style: { opacity: isHovered || isDragging ? 1 : 0 }, children: (0, jsx_runtime_1.jsx)(lucide_react_1.GripVertical, { className: "w-3 h-3 text-muted-foreground" }) }), isSelected && (0, jsx_runtime_1.jsx)("div", { className: "absolute inset-0 rounded-lg border-2 border-current animate-ping opacity-30" }), (0, jsx_runtime_1.jsxs)("div", { onMouseDown: handleMouseDown, onTouchStart: handleTouchStart, children: [(0, jsx_runtime_1.jsx)("div", { className: "flex justify-center mb-2", children: (0, jsx_runtime_1.jsx)(Icon, { className: "w-6 h-6" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs font-medium truncate", children: label }), sublabel && (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] opacity-70 truncate", children: sublabel })] })] }), (isSelected || isHovered) && !isDragging && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "absolute -top-1 left-1/2 -translate-x-1/2 w-2 h-2 rounded-full bg-current animate-pulse" }), (0, jsx_runtime_1.jsx)("div", { className: "absolute -bottom-1 left-1/2 -translate-x-1/2 w-2 h-2 rounded-full bg-current animate-pulse" }), (0, jsx_runtime_1.jsx)("div", { className: "absolute top-1/2 -left-1 -translate-y-1/2 w-2 h-2 rounded-full bg-current animate-pulse" }), (0, jsx_runtime_1.jsx)("div", { className: "absolute top-1/2 -right-1 -translate-y-1/2 w-2 h-2 rounded-full bg-current animate-pulse" })] }))] }) }));
105
+ }
@@ -0,0 +1,11 @@
1
+ interface SystemPanelProps {
2
+ id: string;
3
+ title: string;
4
+ x: number;
5
+ y: number;
6
+ width: number;
7
+ height: number;
8
+ onDrag?: (id: string, deltaX: number, deltaY: number) => void;
9
+ }
10
+ export declare function SystemPanel({ id, title, x, y, width, height, onDrag }: SystemPanelProps): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ // AI-generated · AI-managed · AI-maintained
3
+ "use client";
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.SystemPanel = SystemPanel;
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const react_1 = require("react");
8
+ const lucide_react_1 = require("lucide-react");
9
+ function SystemPanel({ id, title, x, y, width, height, onDrag }) {
10
+ const [isDragging, setIsDragging] = (0, react_1.useState)(false);
11
+ const dragStartRef = (0, react_1.useRef)({ x: 0, y: 0 });
12
+ const onDragRef = (0, react_1.useRef)(onDrag);
13
+ (0, react_1.useEffect)(() => {
14
+ onDragRef.current = onDrag;
15
+ }, [onDrag]);
16
+ const handleMouseDown = (e) => {
17
+ if (e.button !== 0)
18
+ return;
19
+ e.stopPropagation();
20
+ e.preventDefault();
21
+ setIsDragging(true);
22
+ dragStartRef.current = { x: e.clientX, y: e.clientY };
23
+ };
24
+ const handleTouchStart = (e) => {
25
+ e.stopPropagation();
26
+ const touch = e.touches[0];
27
+ setIsDragging(true);
28
+ dragStartRef.current = { x: touch.clientX, y: touch.clientY };
29
+ };
30
+ (0, react_1.useEffect)(() => {
31
+ if (!isDragging)
32
+ return;
33
+ const handleMouseMove = (e) => {
34
+ const deltaX = e.clientX - dragStartRef.current.x;
35
+ const deltaY = e.clientY - dragStartRef.current.y;
36
+ if (deltaX === 0 && deltaY === 0)
37
+ return;
38
+ if (onDragRef.current) {
39
+ onDragRef.current(id, deltaX, deltaY);
40
+ dragStartRef.current = { x: e.clientX, y: e.clientY };
41
+ }
42
+ };
43
+ const handleTouchMove = (e) => {
44
+ const touch = e.touches[0];
45
+ const deltaX = touch.clientX - dragStartRef.current.x;
46
+ const deltaY = touch.clientY - dragStartRef.current.y;
47
+ if (deltaX === 0 && deltaY === 0)
48
+ return;
49
+ if (onDragRef.current) {
50
+ onDragRef.current(id, deltaX, deltaY);
51
+ dragStartRef.current = { x: touch.clientX, y: touch.clientY };
52
+ }
53
+ };
54
+ const handleMouseUp = () => {
55
+ setIsDragging(false);
56
+ };
57
+ const handleTouchEnd = () => {
58
+ setIsDragging(false);
59
+ };
60
+ window.addEventListener("mousemove", handleMouseMove);
61
+ window.addEventListener("mouseup", handleMouseUp);
62
+ window.addEventListener("touchmove", handleTouchMove, { passive: false });
63
+ window.addEventListener("touchend", handleTouchEnd);
64
+ return () => {
65
+ window.removeEventListener("mousemove", handleMouseMove);
66
+ window.removeEventListener("mouseup", handleMouseUp);
67
+ window.removeEventListener("touchmove", handleTouchMove);
68
+ window.removeEventListener("touchend", handleTouchEnd);
69
+ };
70
+ }, [isDragging, id]);
71
+ return ((0, jsx_runtime_1.jsxs)("div", { className: `absolute rounded-xl border border-border/30 bg-card/20 backdrop-blur-sm transition-shadow ${isDragging ? "shadow-lg shadow-primary/20 border-primary/50" : ""}`, style: { left: x, top: y, width, height }, children: [(0, jsx_runtime_1.jsxs)("div", { className: `flex items-center gap-2 px-4 py-2 border-b border-border/30 cursor-grab select-none ${isDragging ? "cursor-grabbing bg-primary/10" : "hover:bg-primary/5"}`, onMouseDown: handleMouseDown, onTouchStart: handleTouchStart, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.GripHorizontal, { className: "w-4 h-4 text-muted-foreground/50" }), (0, jsx_runtime_1.jsx)("div", { className: "w-2 h-2 rounded-full bg-accent animate-pulse" }), (0, jsx_runtime_1.jsx)("span", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider", children: title })] }), (0, jsx_runtime_1.jsxs)("svg", { className: "absolute inset-0 w-full h-full pointer-events-none", children: [(0, jsx_runtime_1.jsx)("line", { x1: "0", y1: "20", x2: "0", y2: "40", stroke: "currentColor", strokeOpacity: "0.2", strokeWidth: "2", className: "text-primary" }), (0, jsx_runtime_1.jsx)("line", { x1: "0", y1: "20", x2: "20", y2: "20", stroke: "currentColor", strokeOpacity: "0.2", strokeWidth: "2", className: "text-primary" }), (0, jsx_runtime_1.jsx)("line", { x1: width, y1: "20", x2: width, y2: "40", stroke: "currentColor", strokeOpacity: "0.2", strokeWidth: "2", className: "text-primary" }), (0, jsx_runtime_1.jsx)("line", { x1: width, y1: "20", x2: width - 20, y2: "20", stroke: "currentColor", strokeOpacity: "0.2", strokeWidth: "2", className: "text-primary" }), (0, jsx_runtime_1.jsx)("line", { x1: "0", y1: height - 20, x2: "0", y2: height - 40, stroke: "currentColor", strokeOpacity: "0.2", strokeWidth: "2", className: "text-primary" }), (0, jsx_runtime_1.jsx)("line", { x1: "0", y1: height - 20, x2: "20", y2: height - 20, stroke: "currentColor", strokeOpacity: "0.2", strokeWidth: "2", className: "text-primary" }), (0, jsx_runtime_1.jsx)("line", { x1: width, y1: height - 20, x2: width, y2: height - 40, stroke: "currentColor", strokeOpacity: "0.2", strokeWidth: "2", className: "text-primary" }), (0, jsx_runtime_1.jsx)("line", { x1: width, y1: height - 20, x2: width - 20, y2: height - 20, stroke: "currentColor", strokeOpacity: "0.2", strokeWidth: "2", className: "text-primary" })] })] }));
72
+ }
@@ -0,0 +1 @@
1
+ export default function EmailChangeCard(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.default = EmailChangeCard;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const react_1 = require("react");
7
+ const card_1 = require("../ui/card");
8
+ const button_1 = require("../ui/button");
9
+ const auth_service_1 = require("../../lib/auth-service");
10
+ const sonner_1 = require("sonner");
11
+ const lucide_react_1 = require("lucide-react");
12
+ function EmailChangeCard() {
13
+ const [step, setStep] = (0, react_1.useState)('idle');
14
+ const [newEmail, setNewEmail] = (0, react_1.useState)("");
15
+ const [password, setPassword] = (0, react_1.useState)("");
16
+ const [code, setCode] = (0, react_1.useState)("");
17
+ const [submitting, setSubmitting] = (0, react_1.useState)(false);
18
+ const handleRequestChange = async () => {
19
+ if (!newEmail || !password)
20
+ return;
21
+ setSubmitting(true);
22
+ try {
23
+ await (0, auth_service_1.requestEmailChange)(newEmail, password);
24
+ setStep('verify');
25
+ sonner_1.toast.success('Verification code sent to new email');
26
+ }
27
+ catch (err) {
28
+ sonner_1.toast.error(err instanceof Error ? err.message : 'Failed');
29
+ }
30
+ finally {
31
+ setSubmitting(false);
32
+ }
33
+ };
34
+ const handleVerify = async () => {
35
+ if (!code || code.length !== 6)
36
+ return;
37
+ setSubmitting(true);
38
+ try {
39
+ await (0, auth_service_1.verifyEmailChange)(newEmail, code);
40
+ sonner_1.toast.success('Email changed successfully');
41
+ setStep('idle');
42
+ setNewEmail("");
43
+ setPassword("");
44
+ setCode("");
45
+ window.location.reload();
46
+ }
47
+ catch (err) {
48
+ sonner_1.toast.error(err instanceof Error ? err.message : 'Verification failed');
49
+ }
50
+ finally {
51
+ setSubmitting(false);
52
+ }
53
+ };
54
+ if (step === 'idle') {
55
+ return ((0, jsx_runtime_1.jsx)("div", { id: "change-email", children: (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 mb-3", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Mail, { className: "h-4 w-4 text-neutral-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-sm text-neutral-300 font-medium tracking-wider", children: "change_email" })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs text-neutral-400 mb-3", children: "Update your email address. A verification code will be sent to the new email." }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: () => setStep('form'), variant: "outline", className: "border-neutral-700 text-neutral-300 hover:bg-neutral-800 bg-transparent text-xs", children: "Change Email" })] }) }) }));
56
+ }
57
+ return ((0, jsx_runtime_1.jsx)("div", { id: "change-email", children: (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-6 space-y-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Mail, { className: "h-4 w-4 text-neutral-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-sm text-neutral-300 font-medium tracking-wider", children: "change_email" })] }), step === 'form' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("input", { type: "email", value: newEmail, onChange: (e) => setNewEmail(e.target.value), placeholder: "New email address", className: "w-full bg-neutral-800 border border-neutral-700 text-white p-2 rounded text-sm outline-none focus:border-cyan-500" }), (0, jsx_runtime_1.jsx)("input", { type: "password", value: password, onChange: (e) => setPassword(e.target.value), placeholder: "Current password", className: "w-full bg-neutral-800 border border-neutral-700 text-white p-2 rounded text-sm outline-none focus:border-cyan-500" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2", children: [(0, jsx_runtime_1.jsx)(button_1.Button, { onClick: () => { setStep('idle'); setNewEmail(''); setPassword(''); }, variant: "ghost", className: "flex-1 text-neutral-500 hover:text-neutral-300 text-xs", children: "Cancel" }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: handleRequestChange, disabled: submitting || !newEmail || !password, className: "flex-1 bg-cyan-700 hover:bg-cyan-600 text-white text-xs", children: submitting ? 'Sending...' : 'Send Code' })] })] })), step === 'verify' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("p", { className: "text-xs text-neutral-400", children: ["Enter the 6-digit code sent to ", (0, jsx_runtime_1.jsx)("span", { className: "text-cyan-400", children: newEmail })] }), (0, jsx_runtime_1.jsx)("input", { type: "text", value: code, onChange: (e) => setCode(e.target.value.replace(/\D/g, '').slice(0, 6)), placeholder: "000000", className: "w-full bg-neutral-800 border border-neutral-700 text-white p-2 rounded text-center text-lg font-mono tracking-[0.5em] outline-none focus:border-cyan-500", maxLength: 6 }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2", children: [(0, jsx_runtime_1.jsx)(button_1.Button, { onClick: () => { setStep('form'); setCode(''); }, variant: "ghost", className: "flex-1 text-neutral-500 hover:text-neutral-300 text-xs", children: "Back" }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: handleVerify, disabled: submitting || code.length !== 6, className: "flex-1 bg-cyan-700 hover:bg-cyan-600 text-white text-xs", children: submitting ? 'Verifying...' : 'Verify' })] })] }))] }) }) }));
58
+ }
@@ -0,0 +1 @@
1
+ export default function ProfilePage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,263 @@
1
+ "use strict";
2
+ "use client";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.default = ProfilePage;
8
+ const jsx_runtime_1 = require("react/jsx-runtime");
9
+ const react_1 = require("react");
10
+ const card_1 = require("../ui/card");
11
+ const badge_1 = require("../ui/badge");
12
+ const button_1 = require("../ui/button");
13
+ const useAuth_1 = require("../../hooks/useAuth");
14
+ const auth_service_1 = require("../../lib/auth-service");
15
+ const services_1 = require("../../lib/api/services");
16
+ const sonner_1 = require("sonner");
17
+ const lucide_react_1 = require("lucide-react");
18
+ const WalletManagement_1 = __importDefault(require("../wallet/WalletManagement"));
19
+ const TwoFactorSettings_1 = __importDefault(require("./TwoFactorSettings"));
20
+ const EmailChangeCard_1 = __importDefault(require("./EmailChangeCard"));
21
+ const next_intl_1 = require("next-intl");
22
+ const LEVEL_INFO = {
23
+ miner: { label: 'Miner', description: 'Registration', color: 'text-white' },
24
+ commander: { label: 'Commander', description: 'Owns >=1 Station NFT', color: 'text-cyan-400' },
25
+ pioneer: { label: 'Pioneer', description: 'Auto-minted Matrix NFT (>=10 Station)', color: 'text-cyan-400' },
26
+ warden: { label: 'Warden', description: 'Auto-minted Sector NFT (>=10 Matrix)', color: 'text-cyan-400' },
27
+ admiral: { label: 'Admiral', description: 'Auto-minted System NFT (>=10 Sector)', color: 'text-red-500' },
28
+ };
29
+ function ProfilePage() {
30
+ const t = (0, next_intl_1.useTranslations)('profile');
31
+ const { userInfo } = (0, useAuth_1.useAuth)();
32
+ const [loading, setLoading] = (0, react_1.useState)(true);
33
+ const [editing, setEditing] = (0, react_1.useState)(false);
34
+ const [saving, setSaving] = (0, react_1.useState)(false);
35
+ const [displayName, setDisplayName] = (0, react_1.useState)("");
36
+ const [avatarUrl, setAvatarUrl] = (0, react_1.useState)("");
37
+ const [emailVerified, setEmailVerified] = (0, react_1.useState)(false);
38
+ const [createdAt, setCreatedAt] = (0, react_1.useState)("");
39
+ const [lastLoginAt, setLastLoginAt] = (0, react_1.useState)("");
40
+ const [shortId, setShortId] = (0, react_1.useState)(null);
41
+ const [locationId, setLocationId] = (0, react_1.useState)(null);
42
+ const [editDisplayName, setEditDisplayName] = (0, react_1.useState)("");
43
+ const [isAvatarDialogOpen, setIsAvatarDialogOpen] = (0, react_1.useState)(false);
44
+ const [avatarPreview, setAvatarPreview] = (0, react_1.useState)(null);
45
+ const [avatarFile, setAvatarFile] = (0, react_1.useState)(null);
46
+ const [uploadingAvatar, setUploadingAvatar] = (0, react_1.useState)(false);
47
+ const fileInputRef = (0, react_1.useRef)(null);
48
+ const [sendingVerification, setSendingVerification] = (0, react_1.useState)(false);
49
+ const [checkingVerification, setCheckingVerification] = (0, react_1.useState)(false);
50
+ const [showVerifyDialog, setShowVerifyDialog] = (0, react_1.useState)(false);
51
+ const [verifyDialogStep, setVerifyDialogStep] = (0, react_1.useState)('main');
52
+ const [newEmailInput, setNewEmailInput] = (0, react_1.useState)("");
53
+ const [changePasswordInput, setChangePasswordInput] = (0, react_1.useState)("");
54
+ const [changeCodeInput, setChangeCodeInput] = (0, react_1.useState)("");
55
+ const [verifyDialogLoading, setVerifyDialogLoading] = (0, react_1.useState)(false);
56
+ const [levelStatus, setLevelStatus] = (0, react_1.useState)(null);
57
+ const [levelLoading, setLevelLoading] = (0, react_1.useState)(false);
58
+ (0, react_1.useEffect)(() => {
59
+ const unsubscribe = (0, auth_service_1.onAuthChange)(async (user) => {
60
+ if (user) {
61
+ setCreatedAt("");
62
+ setLastLoginAt("");
63
+ try {
64
+ const token = await (0, auth_service_1.getCurrentUserToken)();
65
+ if (token) {
66
+ const response = await fetch("/api/users/profile", { headers: { Authorization: `Bearer ${token}` } });
67
+ if (response.ok) {
68
+ const data = await response.json();
69
+ if (data.success && data.user) {
70
+ const name = data.user.display_name || data.user.email?.split("@")[0] || "user";
71
+ setDisplayName(name);
72
+ setEditDisplayName(name);
73
+ if (data.user.email_verified !== undefined)
74
+ setEmailVerified(data.user.email_verified);
75
+ if (data.user.avatar_url)
76
+ setAvatarUrl(data.user.avatar_url);
77
+ if (data.user.short_id)
78
+ setShortId(data.user.short_id);
79
+ if (data.user.location_id)
80
+ setLocationId(data.user.location_id);
81
+ if (data.user.created_at)
82
+ setCreatedAt(data.user.created_at);
83
+ if (data.user.last_login_at)
84
+ setLastLoginAt(data.user.last_login_at);
85
+ }
86
+ else {
87
+ setDisplayName("user");
88
+ setEditDisplayName("user");
89
+ }
90
+ }
91
+ else {
92
+ setDisplayName("user");
93
+ setEditDisplayName("user");
94
+ }
95
+ }
96
+ }
97
+ catch {
98
+ setDisplayName("user");
99
+ setEditDisplayName("user");
100
+ }
101
+ setLoading(false);
102
+ loadLevelStatus(user.uid);
103
+ }
104
+ });
105
+ return () => unsubscribe();
106
+ }, []);
107
+ const loadLevelStatus = async (uid) => {
108
+ try {
109
+ setLevelLoading(true);
110
+ const result = await (0, services_1.getUserLevelStatus)(uid);
111
+ if (result.success && result.data)
112
+ setLevelStatus(result.data);
113
+ }
114
+ catch { }
115
+ finally {
116
+ setLevelLoading(false);
117
+ }
118
+ };
119
+ const getRoleLabel = (role) => role === "admin" || role === "platform_admin" ? t('platformAdmin') : role === "team_member" ? t('teamMember') : t('normalUser');
120
+ const getRoleBadgeVariant = (role) => role === "admin" || role === "platform_admin" ? "default" : role === "team_member" ? "secondary" : "outline";
121
+ const formatDate = (dateStr) => { if (!dateStr)
122
+ return "-"; try {
123
+ return new Date(dateStr).toLocaleDateString("zh-CN", { year: "numeric", month: "long", day: "numeric" });
124
+ }
125
+ catch {
126
+ return "-";
127
+ } };
128
+ const handleSave = async () => {
129
+ setSaving(true);
130
+ try {
131
+ const token = await (0, auth_service_1.getCurrentUserToken)();
132
+ if (!token)
133
+ throw new Error("Not authenticated");
134
+ const response = await fetch("/api/users/profile", { method: "PATCH", headers: { "Content-Type": "application/json", Authorization: `Bearer ${token}` }, body: JSON.stringify({ display_name: editDisplayName }) });
135
+ if (!response.ok) {
136
+ const error = await response.json();
137
+ throw new Error(error.error || "Failed to update profile");
138
+ }
139
+ setDisplayName(editDisplayName);
140
+ setEditing(false);
141
+ sonner_1.toast.success("profile updated successfully");
142
+ }
143
+ catch (error) {
144
+ sonner_1.toast.error(error instanceof Error ? error.message : "save failed");
145
+ }
146
+ finally {
147
+ setSaving(false);
148
+ }
149
+ };
150
+ const handleFileSelect = (e) => {
151
+ const file = e.target.files?.[0];
152
+ if (!file)
153
+ return;
154
+ if (!file.type.startsWith("image/")) {
155
+ sonner_1.toast.error("please select an image file");
156
+ return;
157
+ }
158
+ if (file.size > 2 * 1024 * 1024) {
159
+ sonner_1.toast.error("image size must be less than 2MB");
160
+ return;
161
+ }
162
+ setAvatarFile(file);
163
+ const reader = new FileReader();
164
+ reader.onload = (e) => { setAvatarPreview(e.target?.result); };
165
+ reader.readAsDataURL(file);
166
+ };
167
+ const handleAvatarUpload = async () => {
168
+ if (!avatarFile) {
169
+ if (!avatarPreview && avatarUrl) {
170
+ setAvatarUrl("");
171
+ setIsAvatarDialogOpen(false);
172
+ return;
173
+ }
174
+ ;
175
+ setIsAvatarDialogOpen(false);
176
+ return;
177
+ }
178
+ setUploadingAvatar(true);
179
+ try {
180
+ const token = await (0, auth_service_1.getCurrentUserToken)();
181
+ if (!token)
182
+ throw new Error("Not authenticated");
183
+ const formData = new FormData();
184
+ formData.append("avatar", avatarFile);
185
+ const response = await fetch("/api/users/avatar", { method: "POST", headers: { Authorization: `Bearer ${token}` }, body: formData });
186
+ if (!response.ok)
187
+ throw new Error("Upload failed");
188
+ const result = await response.json();
189
+ setAvatarUrl(result.data?.avatar_url || result.avatar_url);
190
+ setIsAvatarDialogOpen(false);
191
+ sonner_1.toast.success("avatar updated");
192
+ }
193
+ catch {
194
+ sonner_1.toast.error("avatar upload failed");
195
+ }
196
+ finally {
197
+ setUploadingAvatar(false);
198
+ }
199
+ };
200
+ if (loading)
201
+ return (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center py-20", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-8 w-8 animate-spin text-neutral-400" }), (0, jsx_runtime_1.jsx)("span", { className: "ml-3 text-neutral-400 text-sm", children: "loading profile..." })] });
202
+ const lvl = levelStatus?.current_rank?.toLowerCase() || levelStatus?.database_level?.toLowerCase() || 'miner';
203
+ const lvlInfo = LEVEL_INFO[lvl] || LEVEL_INFO.miner;
204
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-3 py-4 space-y-3 xs:px-4 xs:space-y-4 sm:px-6 sm:py-6 sm:space-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-lg sm:text-2xl font-bold text-white tracking-wider", children: "Profile" }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs sm:text-sm text-neutral-400", children: "view and manage your personal information" })] }), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-3 sm:gap-4 mb-4 sm:mb-6 pb-4 sm:pb-6 border-b border-neutral-700", children: [(0, jsx_runtime_1.jsxs)("div", { className: "relative group cursor-pointer", onClick: () => { setAvatarPreview(avatarUrl || null); setAvatarFile(null); setIsAvatarDialogOpen(true); }, children: [avatarUrl ? (0, jsx_runtime_1.jsx)("img", { src: avatarUrl, alt: "", className: "h-20 w-20 rounded bg-neutral-800 border border-neutral-700 object-cover", onError: e => { e.currentTarget.onerror = null; e.currentTarget.src = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Crect width='40' height='40' rx='20' fill='%23312e81'/%3E%3Ccircle cx='20' cy='15' r='6' fill='%236366f1'/%3E%3Cellipse cx='20' cy='32' rx='10' ry='8' fill='%236366f1'/%3E%3C/svg%3E"; } }) : (0, jsx_runtime_1.jsx)("div", { className: "h-20 w-20 rounded bg-cyan-400/20 border border-cyan-400/30 flex items-center justify-center text-cyan-400 text-3xl font-bold", children: displayName.charAt(0).toUpperCase() }), (0, jsx_runtime_1.jsx)("div", { className: "absolute inset-0 bg-black/50 rounded opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center", children: (0, jsx_runtime_1.jsx)("span", { className: "text-white text-xs", children: "edit" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1", children: editing ? ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-3", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "text-xs text-neutral-400 tracking-wider block mb-1", children: "display_name" }), (0, jsx_runtime_1.jsx)("input", { type: "text", value: editDisplayName, onChange: e => setEditDisplayName(e.target.value), className: "w-full bg-neutral-800 border border-neutral-600 rounded px-3 py-2 text-white text-sm focus:outline-none focus:border-cyan-400 placeholder-neutral-400", placeholder: "Enter display name" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2", children: [(0, jsx_runtime_1.jsx)(button_1.Button, { onClick: handleSave, disabled: saving, size: "sm", className: "bg-cyan-700 hover:bg-cyan-600 text-white", children: saving ? "saving..." : "save" }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: () => { setEditDisplayName(displayName); setEditing(false); }, disabled: saving, variant: "outline", size: "sm", className: "border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent", children: "cancel" })] })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-lg text-white", children: displayName }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: () => { setEditDisplayName(displayName); setEditing(true); }, variant: "ghost", size: "sm", className: "text-neutral-400 hover:text-cyan-400 text-xs h-auto py-0 px-1", children: "[edit]" })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm text-neutral-400 mt-1", children: userInfo?.email || "no email set" }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500 mt-1", children: t('avatarAutoGenNote') }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2 mt-2", children: [(0, jsx_runtime_1.jsx)(badge_1.Badge, { variant: getRoleBadgeVariant(userInfo?.role), children: getRoleLabel(userInfo?.role) }), emailVerified ? (0, jsx_runtime_1.jsx)(badge_1.Badge, { variant: "default", className: "bg-green-600 text-white hover:bg-green-600", children: "verified" }) : (0, jsx_runtime_1.jsx)(badge_1.Badge, { variant: "destructive", className: "cursor-pointer hover:opacity-80", onClick: () => { setShowVerifyDialog(true); setVerifyDialogStep('main'); }, children: "unverified" })] })] })) })] }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-0", children: [{ l: 'id', v: (0, jsx_runtime_1.jsx)("span", { className: "text-xs bg-neutral-800 px-2 py-0.5 rounded font-mono", children: shortId || userInfo?.uid || "-" }) }, { l: 'email', v: userInfo?.email || "-" }, { l: 'role', v: (0, jsx_runtime_1.jsx)("span", { className: "text-cyan-400", children: getRoleLabel(userInfo?.role) }) }, { l: 'status', v: (0, jsx_runtime_1.jsx)("span", { className: "text-white", children: "active" }) }].map(({ l, v }) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between py-2 border-b border-neutral-800", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400 text-sm", children: l }), (0, jsx_runtime_1.jsx)("span", { className: "text-white text-sm", children: v })] }, l))) })] }) }), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsx)(card_1.CardContent, { className: "p-3 sm:p-6", children: (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [[{ l: 'created_at', v: formatDate(createdAt) }, { l: 'last_login', v: formatDate(lastLoginAt) }, { l: 'short_id', v: (0, jsx_runtime_1.jsx)("span", { className: "font-mono text-sm", children: shortId || userInfo?.uid?.substring(0, 16) + '...' }) }].map(({ l, v }) => ((0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: l }), (0, jsx_runtime_1.jsx)("div", { className: "text-white font-medium", children: v })] }, l))), locationId && (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-4 col-span-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: "location_id" }), (0, jsx_runtime_1.jsx)("div", { className: "text-cyan-400 font-mono text-sm break-all", children: locationId })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: "email_status" }), emailVerified ? (0, jsx_runtime_1.jsx)("div", { className: "text-green-400 font-medium", children: "verified" }) : ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-cyan-400 font-medium", children: "unverified" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-wrap gap-2", children: [(0, jsx_runtime_1.jsx)(button_1.Button, { onClick: async () => { setSendingVerification(true); try {
205
+ await (0, auth_service_1.sendEmailVerification)();
206
+ sonner_1.toast.success("verification email sent", { description: "check your inbox (and spam folder)" });
207
+ }
208
+ catch (e) {
209
+ sonner_1.toast.error("send failed", { description: e instanceof Error ? e.message : "send failed" });
210
+ }
211
+ finally {
212
+ setSendingVerification(false);
213
+ } }, disabled: sendingVerification, variant: "outline", size: "sm", className: "border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent text-xs", children: sendingVerification ? "sending..." : "send email" }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: async () => { setCheckingVerification(true); try {
214
+ const v = await (0, auth_service_1.checkEmailVerified)();
215
+ if (v) {
216
+ setEmailVerified(true);
217
+ sonner_1.toast.success("email verified!");
218
+ }
219
+ else
220
+ sonner_1.toast.info("email not verified yet", { description: "click the link in the email" });
221
+ }
222
+ catch {
223
+ sonner_1.toast.error("check failed", { description: "please try again" });
224
+ }
225
+ finally {
226
+ setCheckingVerification(false);
227
+ } }, disabled: checkingVerification, variant: "outline", size: "sm", className: "border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent text-xs", children: checkingVerification ? "checking..." : "check" }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: () => window.location.href = '#change-email', variant: "outline", size: "sm", className: "border-cyan-800 text-cyan-500 hover:bg-cyan-950 hover:text-cyan-300 bg-transparent text-xs", children: "change email" })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] text-neutral-500", children: "If you entered an incorrect email, you can change it below." })] }))] })] }) }) }), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsx)(card_1.CardContent, { className: "p-3 sm:p-6", children: levelLoading ? (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center py-4", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-5 w-5 animate-spin text-neutral-400" }), (0, jsx_runtime_1.jsx)("span", { className: "ml-2 text-neutral-500 text-sm", children: t('loadingLevel') })] }) : levelStatus ? ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between p-4 bg-neutral-800 rounded", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: "current_level" }), (0, jsx_runtime_1.jsx)("div", { className: `text-xl font-bold ${lvlInfo.color}`, children: lvlInfo.label }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500 mt-1", children: lvlInfo.description })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-right", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: "holdings" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-white text-xs font-mono", children: ["S:", levelStatus.holdings.station, " M:", levelStatus.holdings.matrix, " Se:", levelStatus.holdings.sector, " Sy:", levelStatus.holdings.system] })] })] }), levelStatus.next_level_requirement && ((0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-center mb-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-400 tracking-wider", children: "upgrade_progress" }), (0, jsx_runtime_1.jsxs)("span", { className: "text-white text-sm font-mono", children: [levelStatus.progress_percent, "%"] })] }), (0, jsx_runtime_1.jsx)("div", { className: "w-full bg-neutral-800 rounded-full h-2", children: (0, jsx_runtime_1.jsx)("div", { className: "h-2 rounded-full transition-all bg-cyan-400", style: { width: `${Math.min(levelStatus.progress_percent, 100)}%` } }) }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500 mt-2", children: levelStatus.next_level_requirement.description }), (0, jsx_runtime_1.jsxs)("div", { className: "text-xs text-neutral-400 mt-1", children: [levelStatus.next_level_requirement.have, "/", levelStatus.next_level_requirement.need, " ", levelStatus.next_level_requirement.tier, " \u2192 ", (0, jsx_runtime_1.jsx)("span", { className: "text-white", children: levelStatus.next_rank })] })] }))] })) : (0, jsx_runtime_1.jsxs)("div", { className: "text-center py-6 text-neutral-500", children: [(0, jsx_runtime_1.jsx)("p", { children: t('noLevelInfo') }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs mt-1", children: t('noLevelInfoHint') })] }) }) }), (0, jsx_runtime_1.jsx)(WalletManagement_1.default, {}), (0, jsx_runtime_1.jsx)(EmailChangeCard_1.default, {}), (0, jsx_runtime_1.jsx)(TwoFactorSettings_1.default, {}), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-cyan-400", children: "!" }), " security notice"] }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-2 text-sm text-neutral-400", children: ['Keep your account credentials secure', 'Change password periodically', 'Report suspicious activity immediately', 'Verify email to receive important notifications'].map(p => (0, jsx_runtime_1.jsxs)("p", { children: ["- ", p] }, p)) })] }) }), isAvatarDialogOpen && ((0, jsx_runtime_1.jsx)("div", { className: "fixed inset-0 bg-black/50 flex items-center justify-center z-50", children: (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 w-full max-w-md mx-4", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-6 space-y-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex justify-center", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative", children: [avatarPreview ? (0, jsx_runtime_1.jsx)("img", { src: avatarPreview, alt: "preview", className: "h-32 w-32 rounded border-4 border-neutral-700 object-cover" }) : (0, jsx_runtime_1.jsx)("div", { className: "h-32 w-32 rounded border-4 border-neutral-700 bg-neutral-800 flex items-center justify-center text-4xl text-neutral-500", children: displayName.charAt(0).toUpperCase() }), avatarPreview && (0, jsx_runtime_1.jsx)("button", { onClick: () => { setAvatarPreview(null); setAvatarFile(null); if (fileInputRef.current)
228
+ fileInputRef.current.value = ""; }, className: "absolute -top-2 -right-2 w-6 h-6 bg-red-500 hover:bg-red-600 rounded-full flex items-center justify-center text-white text-xs", children: "x" })] }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center gap-4", children: [(0, jsx_runtime_1.jsx)("input", { ref: fileInputRef, type: "file", accept: "image/jpeg,image/png,image/gif,image/webp", onChange: handleFileSelect, className: "hidden" }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: () => fileInputRef.current?.click(), variant: "outline", className: "w-full border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent", children: "select image" }), avatarFile && (0, jsx_runtime_1.jsxs)("p", { className: "text-sm text-neutral-500", children: ["selected: ", avatarFile.name, " (", (avatarFile.size / 1024).toFixed(1), " KB)"] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-end gap-2", children: [(0, jsx_runtime_1.jsx)(button_1.Button, { onClick: () => setIsAvatarDialogOpen(false), disabled: uploadingAvatar, variant: "outline", size: "sm", className: "border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent", children: "cancel" }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: handleAvatarUpload, disabled: uploadingAvatar || (!avatarFile && avatarPreview === avatarUrl), size: "sm", className: "bg-cyan-700 hover:bg-cyan-600 text-white", children: uploadingAvatar ? "uploading..." : "upload" })] })] }) }) })), showVerifyDialog && ((0, jsx_runtime_1.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm p-4", onClick: () => setShowVerifyDialog(false), children: (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg w-full max-w-md p-6 space-y-4", onClick: e => e.stopPropagation(), children: [verifyDialogStep === 'main' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-white font-medium text-sm", children: "Verify Your Email" }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 mb-1", children: "current email" }), (0, jsx_runtime_1.jsx)("div", { className: "text-white text-sm font-mono", children: userInfo?.email || '-' })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs text-neutral-400", children: "A verification link will be sent to this email. If this is not your real email, change it first." }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2", children: [(0, jsx_runtime_1.jsx)(button_1.Button, { onClick: async () => { setVerifyDialogLoading(true); try {
229
+ await (0, auth_service_1.resendVerificationEmail)();
230
+ sonner_1.toast.success('Verification email sent! Check your inbox.');
231
+ setShowVerifyDialog(false);
232
+ }
233
+ catch (err) {
234
+ sonner_1.toast.error(err instanceof Error ? err.message : 'Failed to send');
235
+ }
236
+ finally {
237
+ setVerifyDialogLoading(false);
238
+ } }, disabled: verifyDialogLoading, className: "flex-1 bg-cyan-700 hover:bg-cyan-600 text-white text-xs", children: verifyDialogLoading ? 'Sending...' : 'Send Verification Link' }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: () => { setVerifyDialogStep('change'); setNewEmailInput(''); setChangePasswordInput(''); }, variant: "outline", className: "flex-1 border-neutral-700 text-neutral-300 hover:bg-neutral-800 bg-transparent text-xs", children: "Change Email" })] }), (0, jsx_runtime_1.jsx)("button", { onClick: () => setShowVerifyDialog(false), className: "w-full text-center text-xs text-neutral-500 hover:text-neutral-300 pt-1", children: "Close" })] })), verifyDialogStep === 'change' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-white font-medium text-sm", children: "Change Email Address" }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs text-neutral-400", children: "Enter your new email and current password. A verification code will be sent to the new email." }), (0, jsx_runtime_1.jsx)("input", { type: "email", value: newEmailInput, onChange: e => setNewEmailInput(e.target.value), placeholder: "New email address", className: "w-full bg-neutral-800 border border-neutral-700 text-white p-2 rounded text-sm outline-none focus:border-cyan-500" }), (0, jsx_runtime_1.jsx)("input", { type: "password", value: changePasswordInput, onChange: e => setChangePasswordInput(e.target.value), placeholder: "Current password", className: "w-full bg-neutral-800 border border-neutral-700 text-white p-2 rounded text-sm outline-none focus:border-cyan-500" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2", children: [(0, jsx_runtime_1.jsx)(button_1.Button, { onClick: () => setVerifyDialogStep('main'), variant: "ghost", className: "flex-1 text-neutral-500 hover:text-neutral-300 text-xs", children: "Back" }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: async () => { if (!newEmailInput || !changePasswordInput)
239
+ return; setVerifyDialogLoading(true); try {
240
+ await (0, auth_service_1.requestEmailChange)(newEmailInput, changePasswordInput);
241
+ sonner_1.toast.success('Verification code sent to new email');
242
+ setVerifyDialogStep('change-verify');
243
+ }
244
+ catch (err) {
245
+ sonner_1.toast.error(err instanceof Error ? err.message : 'Failed');
246
+ }
247
+ finally {
248
+ setVerifyDialogLoading(false);
249
+ } }, disabled: verifyDialogLoading || !newEmailInput || !changePasswordInput, className: "flex-1 bg-cyan-700 hover:bg-cyan-600 text-white text-xs", children: verifyDialogLoading ? 'Sending...' : 'Send Code' })] })] })), verifyDialogStep === 'change-verify' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-white font-medium text-sm", children: "Enter Verification Code" }), (0, jsx_runtime_1.jsxs)("p", { className: "text-xs text-neutral-400", children: ["A 6-digit code was sent to ", (0, jsx_runtime_1.jsx)("span", { className: "text-cyan-400", children: newEmailInput }), ". After verification, this becomes your new login email. Your password stays the same."] }), (0, jsx_runtime_1.jsx)("input", { type: "text", value: changeCodeInput, onChange: e => setChangeCodeInput(e.target.value.replace(/\D/g, '').slice(0, 6)), placeholder: "000000", className: "w-full bg-neutral-800 border border-neutral-700 text-white p-2 rounded text-center text-xl font-mono tracking-[0.5em] outline-none focus:border-cyan-500", maxLength: 6 }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2", children: [(0, jsx_runtime_1.jsx)(button_1.Button, { onClick: () => { setVerifyDialogStep('change'); setChangeCodeInput(''); }, variant: "ghost", className: "flex-1 text-neutral-500 hover:text-neutral-300 text-xs", children: "Back" }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: async () => { if (changeCodeInput.length !== 6)
250
+ return; setVerifyDialogLoading(true); try {
251
+ await (0, auth_service_1.verifyEmailChange)(newEmailInput, changeCodeInput);
252
+ sonner_1.toast.success('Email changed and verified!');
253
+ setEmailVerified(true);
254
+ setShowVerifyDialog(false);
255
+ window.location.reload();
256
+ }
257
+ catch (err) {
258
+ sonner_1.toast.error(err instanceof Error ? err.message : 'Verification failed');
259
+ }
260
+ finally {
261
+ setVerifyDialogLoading(false);
262
+ } }, disabled: verifyDialogLoading || changeCodeInput.length !== 6, className: "flex-1 bg-cyan-700 hover:bg-cyan-600 text-white text-xs", children: verifyDialogLoading ? 'Verifying...' : 'Verify & Change' })] })] }))] }) }))] }));
263
+ }
@@ -0,0 +1 @@
1
+ export default function TwoFactorSettings(): import("react/jsx-runtime").JSX.Element | null;