@opexa/portal-components 0.0.38 → 0.0.41

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 (77) hide show
  1. package/dist/client/hooks/useGlobalStore.d.ts +1 -2
  2. package/dist/client/hooks/useGlobalStore.js +19 -36
  3. package/dist/components/Account/Account.d.ts +1 -7
  4. package/dist/components/Account/Account.js +15 -40
  5. package/dist/components/AccountInfo/AccountInfo.js +20 -3
  6. package/dist/components/AccountSecurity/AccountSecurity.js +14 -6
  7. package/dist/components/AccountVerification/AccountVerification.js +5 -32
  8. package/dist/components/AccountVerification/AccountVerificationContext.d.ts +14 -0
  9. package/dist/components/AccountVerification/AccountVerificationContext.js +27 -0
  10. package/dist/components/AccountVerification/VerificationCapture.d.ts +1 -1
  11. package/dist/components/AccountVerification/VerificationCapture.js +16 -45
  12. package/dist/components/AccountVerification/VerificationComplete.d.ts +1 -0
  13. package/dist/components/AccountVerification/VerificationComplete.js +9 -0
  14. package/dist/components/AccountVerification/VerificationDetails.d.ts +1 -0
  15. package/dist/components/AccountVerification/VerificationDetails.js +38 -0
  16. package/dist/components/DepositWithdrawal/AmountChoices.js +1 -1
  17. package/dist/components/DepositWithdrawal/Deposit/AvailablePromos.js +21 -16
  18. package/dist/components/DepositWithdrawal/Deposit/GCashDeposit/GCashDeposit.js +4 -23
  19. package/dist/components/DepositWithdrawal/Deposit/MayaAppDeposit/MayaAppDeposit.js +4 -23
  20. package/dist/components/DepositWithdrawal/Deposit/MayaDeposit/MayaDeposit.js +4 -23
  21. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositForm.js +5 -24
  22. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.js +4 -23
  23. package/dist/components/DepositWithdrawal/DepositWithdrawal.js +3 -3
  24. package/dist/components/DepositWithdrawal/PaymentMethods.js +2 -2
  25. package/dist/components/DepositWithdrawal/Withdrawal/Withdrawal.js +27 -20
  26. package/dist/components/GameLaunch/GameLaunch.js +33 -57
  27. package/dist/components/KYC/KYC.d.ts +1 -0
  28. package/dist/components/KYC/KYC.js +3 -0
  29. package/dist/components/KYC/index.d.ts +1 -0
  30. package/dist/components/KYC/index.js +1 -0
  31. package/dist/components/Messages/MessageItem.js +12 -7
  32. package/dist/components/Messages/MessagePopup.js +8 -7
  33. package/dist/components/PortalProvider/PortalProvider.d.ts +2 -2
  34. package/dist/components/PortalProvider/PortalProvider.js +8 -5
  35. package/dist/components/PortalProvider/Providers.d.ts +4 -0
  36. package/dist/components/PortalProvider/Providers.js +12 -0
  37. package/dist/components/PortalProvider/Snackbar.d.ts +1 -0
  38. package/dist/components/PortalProvider/Snackbar.js +21 -0
  39. package/dist/components/PortalProvider/WebVitals.d.ts +1 -0
  40. package/dist/components/PortalProvider/WebVitals.js +8 -0
  41. package/dist/components/index.d.ts +1 -0
  42. package/dist/components/index.js +1 -0
  43. package/dist/images/gift.png +0 -0
  44. package/dist/tsconfig.build.tsbuildinfo +1 -1
  45. package/dist/types/index.d.ts +1 -1
  46. package/dist/ui/AlertDialog/AlertDialog.d.ts +154 -154
  47. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +14 -14
  48. package/dist/ui/AlertDialog/alertDialog.recipe.js +4 -4
  49. package/dist/ui/Badge/Badge.d.ts +12 -12
  50. package/dist/ui/Badge/badge.recipe.d.ts +3 -3
  51. package/dist/ui/Button/button.recipe.js +1 -1
  52. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  53. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  54. package/dist/ui/Checkbox/checkbox.recipe.js +2 -2
  55. package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
  56. package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
  57. package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
  58. package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
  59. package/dist/ui/Combobox/Combobox.d.ts +196 -196
  60. package/dist/ui/Combobox/combobox.recipe.d.ts +14 -14
  61. package/dist/ui/DatePicker/DatePicker.d.ts +192 -192
  62. package/dist/ui/DatePicker/datePicker.recipe.d.ts +8 -8
  63. package/dist/ui/NumberInput/NumberInput.d.ts +24 -24
  64. package/dist/ui/NumberInput/numberInput.recipe.d.ts +3 -3
  65. package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
  66. package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
  67. package/dist/ui/Popover/Popover.d.ts +55 -55
  68. package/dist/ui/Popover/popover.recipe.d.ts +5 -5
  69. package/dist/ui/Progress/Progress.d.ts +27 -27
  70. package/dist/ui/Progress/progress.recipe.d.ts +3 -3
  71. package/dist/ui/Select/Select.d.ts +45 -45
  72. package/dist/ui/Select/select.recipe.d.ts +3 -3
  73. package/dist/ui/Table/Table.d.ts +21 -21
  74. package/dist/ui/Table/table.recipe.d.ts +3 -3
  75. package/dist/ui/Tabs/Tabs.d.ts +15 -15
  76. package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
  77. package/package.json +7 -6
@@ -39,7 +39,6 @@ interface MessageStore extends PopupStore {
39
39
  interface MessagesStore extends PopupStore {
40
40
  tab: MessagesTab;
41
41
  setTab: (tab: MessagesTab) => void;
42
- message: MessageStore;
43
42
  }
44
43
  interface DepositWithdrawalStore extends PopupStore {
45
44
  tab: DepositWithdrawalTab;
@@ -54,8 +53,8 @@ interface GlobalStore {
54
53
  gamesSearch: GamesSearchStore;
55
54
  account: PopupStore;
56
55
  account__mobile: PopupStore;
57
- accountSettings: CollapsibleStore;
58
56
  messages: MessagesStore;
57
+ message: MessageStore;
59
58
  sidebar: CollapsibleStore;
60
59
  kyc: PopupStore;
61
60
  }
@@ -86,17 +86,6 @@ export const useGlobalStore = create((set) => ({
86
86
  }));
87
87
  },
88
88
  },
89
- accountSettings: {
90
- collapsed: true,
91
- setCollapsed(collapsed) {
92
- set((prev) => ({
93
- accountSettings: {
94
- ...prev.accountSettings,
95
- collapsed,
96
- },
97
- }));
98
- },
99
- },
100
89
  messages: {
101
90
  open: false,
102
91
  setOpen(open) {
@@ -116,31 +105,25 @@ export const useGlobalStore = create((set) => ({
116
105
  },
117
106
  }));
118
107
  },
119
- message: {
120
- data: null,
121
- open: false,
122
- setOpen(open) {
123
- set((prev) => ({
124
- messages: {
125
- ...prev.messages,
126
- message: {
127
- ...prev.messages.message,
128
- open,
129
- },
130
- },
131
- }));
132
- },
133
- setData(content) {
134
- set((prev) => ({
135
- messages: {
136
- ...prev.messages,
137
- message: {
138
- ...prev.messages.message,
139
- data: content,
140
- },
141
- },
142
- }));
143
- },
108
+ },
109
+ message: {
110
+ data: null,
111
+ open: false,
112
+ setOpen(open) {
113
+ set((prev) => ({
114
+ message: {
115
+ ...prev.message,
116
+ open,
117
+ },
118
+ }));
119
+ },
120
+ setData(content) {
121
+ set((prev) => ({
122
+ message: {
123
+ ...prev.message,
124
+ data: content,
125
+ },
126
+ }));
144
127
  },
145
128
  },
146
129
  gamesSearch: {
@@ -18,12 +18,6 @@ export interface AccountProps {
18
18
  /** @default '/transactions' */
19
19
  transactionsUrl?: string;
20
20
  /** @default '/account' */
21
- accountInfoUrl?: string;
22
- /** @default '/account/security' */
23
- accountSecurityUrl?: string;
24
- /** @default '/account/verification' */
25
- accountVerificationUrl?: string;
26
- /** @default '/account/payment-methods' */
27
- accountPaymentMethodsUrl?: string;
21
+ accountSettingsUrl?: string;
28
22
  }
29
23
  export declare function Account(props: AccountProps): import("react/jsx-runtime").JSX.Element;
@@ -5,9 +5,9 @@ import Image from 'next/image';
5
5
  import Link from 'next/link';
6
6
  import { useShallow } from 'zustand/shallow';
7
7
  import { useAccountQuery, useGlobalStore, useLocaleInfo, useSignOutMutation, useUnreadMessagesCountQuery, useWalletQuery, } from '../../client/hooks/index.js';
8
- import { AlertCircleIcon, ChevronLeftIcon, ChevronRightIcon, CoinsStacked02Icon, CoinsSwap02Icon, CreditCard02Icon, FileCheck02Icon, Gift01Icon, Lock01Icon, Logout01Icon, Settings02Icon, User01Icon, XIcon, } from '../../icons/index.js';
8
+ import { AlertCircleIcon, ChevronRightIcon, CoinsStacked02Icon, CoinsSwap02Icon, Gift01Icon, Logout01Icon, Settings02Icon, XIcon, } from '../../icons/index.js';
9
9
  import avatarPlaceholder from '../../images/placeholder-avatar.png';
10
- import { Badge, Button, Drawer, IconButton, Popover, Presence } from '../../ui/index.js';
10
+ import { Badge, Button, Drawer, IconButton, Popover } from '../../ui/index.js';
11
11
  import { formatNumber, parseDecimal } from '../../utils/index.js';
12
12
  import { accountRecipe } from './account.recipe.js';
13
13
  const recipe = accountRecipe();
@@ -15,25 +15,26 @@ export function Account(props) {
15
15
  const globalStore = useGlobalStore(useShallow((ctx) => ({
16
16
  account: ctx.account,
17
17
  account__mobile: ctx.account__mobile,
18
- accountSettings: ctx.accountSettings,
19
18
  })));
19
+ const rewardsUrl = props.rewardsUrl ?? '/rewards';
20
+ const betRecordsUrl = props.betRecordsUrl ?? '/bet-records';
21
+ const transactionsUrl = props.transactionsUrl ?? '/transactions';
22
+ const accountSettingsUrl = props.accountSettingsUrl ?? '/account';
20
23
  return (_jsxs(_Fragment, { children: [_jsxs(Drawer.Root, { open: globalStore.account__mobile.open, onOpenChange: (details) => {
21
24
  globalStore.account__mobile.setOpen(details.open);
22
- globalStore.accountSettings.setCollapsed(true);
23
25
  }, lazyMount: true, unmountOnExit: true, children: [_jsx(Drawer.Trigger, { asChild: true, className: "lg:hidden", children: props.children ?? (_jsx(IconButton, { size: "sm", colorScheme: "gray", children: globalStore.account__mobile.open ? (_jsx(XIcon, {})) : (_jsx(Image, { src: avatarPlaceholder, alt: "", width: 100, height: 100, className: "size-10" })) })) }), _jsx(Portal, { children: _jsx(Drawer.Positioner, { children: _jsxs(Drawer.Content, { className: "relative top-[var(--top,0px)] flex h-[calc(100%-var(--top,0px))] w-full flex-col px-xl py-6", style: {
24
26
  ['--top']: props.offsetTop ?? '0px',
25
- }, children: [_jsx(Profile, {}), _jsx(Wallet, {}), _jsx(Links, { rewardsUrl: props.rewardsUrl, betRecordsUrl: props.betRecordsUrl, transactionsUrl: props.transactionsUrl }), _jsx(AccountSettingsMenu, { accountInfoUrl: props.accountInfoUrl, accountSecurityUrl: props.accountSecurityUrl, accountVerificationUrl: props.accountVerificationUrl, accountPaymentMethodsUrl: props.accountPaymentMethodsUrl })] }) }) })] }), _jsxs(Popover.Root, { open: globalStore.account.open, onOpenChange: (details) => {
27
+ }, children: [_jsx(Profile, {}), _jsx(Wallet, {}), _jsx(Links, { rewardsUrl: rewardsUrl, betRecordsUrl: betRecordsUrl, transactionsUrl: transactionsUrl, accountSettingsUrl: accountSettingsUrl })] }) }) })] }), _jsxs(Popover.Root, { open: globalStore.account.open, onOpenChange: (details) => {
26
28
  globalStore.account.setOpen(details.open);
27
- globalStore.accountSettings.setCollapsed(true);
28
29
  }, lazyMount: true, unmountOnExit: true, positioning: {
29
30
  placement: 'bottom',
30
31
  strategy: 'fixed',
31
- }, children: [_jsx(Popover.Trigger, { className: "hidden lg:flex", asChild: true, children: props.children ?? (_jsx(IconButton, { size: "sm", colorScheme: "gray", children: _jsx(Image, { src: avatarPlaceholder, alt: "", width: 48, height: 48, className: "size-10" }) })) }), _jsx(Portal, { children: _jsx(Popover.Positioner, { children: _jsxs(Popover.Content, { className: "border-border-primary bg-bg-primary relative z-popover w-[23.438rem] overflow-hidden rounded-xl border p-xl ui-open:animate-fade-in ui-closed:animate-fade-out", children: [_jsx(Profile, {}), _jsx(Wallet, {}), _jsx(Links, { rewardsUrl: props.rewardsUrl, betRecordsUrl: props.betRecordsUrl, transactionsUrl: props.transactionsUrl }), _jsx(AccountSettingsMenu, { accountInfoUrl: props.accountInfoUrl, accountSecurityUrl: props.accountSecurityUrl, accountVerificationUrl: props.accountVerificationUrl, accountPaymentMethodsUrl: props.accountPaymentMethodsUrl })] }) }) })] })] }));
32
+ }, children: [_jsx(Popover.Trigger, { className: "hidden lg:flex", asChild: true, children: props.children ?? (_jsx(IconButton, { size: "sm", colorScheme: "gray", children: _jsx(Image, { src: avatarPlaceholder, alt: "", width: 48, height: 48, className: "size-10" }) })) }), _jsx(Portal, { children: _jsx(Popover.Positioner, { children: _jsxs(Popover.Content, { className: "border-border-primary bg-bg-primary relative z-popover w-[23.438rem] overflow-hidden rounded-xl border p-xl ui-open:animate-fade-in ui-closed:animate-fade-out", children: [_jsx(Profile, {}), _jsx(Wallet, {}), _jsx(Links, { rewardsUrl: rewardsUrl, betRecordsUrl: betRecordsUrl, transactionsUrl: transactionsUrl, accountSettingsUrl: accountSettingsUrl })] }) }) })] })] }));
32
33
  }
33
34
  function Profile() {
34
35
  const accountQuery = useAccountQuery();
35
36
  const account = accountQuery.data;
36
- return (_jsxs("div", { className: "flex shrink-0 items-center gap-lg", children: [_jsx(Image, { src: avatarPlaceholder, alt: "", width: 48, height: 48, className: "size-12" }), _jsxs("div", { className: "grow", children: [_jsx("p", { className: "text-text-secondary-700 font-semibold leading-tight", children: account?.name }), _jsx("p", { className: "text-text-tertiary-600 leading-tight", children: account?.nickName ?? account?.emailAddress ?? account?.realName })] }), _jsxs(Badge.Root, { colorScheme: account?.verified ? 'success' : 'danger', className: "self-start", children: [_jsx(Badge.Indicator, {}), _jsx(Badge.Label, { children: account?.verified ? 'Verified' : 'Unverified' })] })] }));
37
+ return (_jsxs("div", { className: "flex shrink-0 items-center gap-lg", children: [_jsx(Image, { src: avatarPlaceholder, alt: "", width: 48, height: 48, className: "size-12" }), _jsxs("div", { className: "grow", children: [_jsx("p", { className: "text-text-secondary-700 font-semibold leading-tight", children: account?.name }), _jsxs("div", { className: "flex", children: [_jsx("p", { className: "text-text-tertiary-600 grow items-center leading-tight", children: account?.id }), _jsxs(Badge.Root, { colorScheme: account?.verified ? 'success' : 'danger', className: "self-start", children: [_jsx(Badge.Indicator, {}), _jsx(Badge.Label, { children: account?.verified ? 'Verified' : 'Unverified' })] })] })] })] }));
37
38
  }
38
39
  function Wallet() {
39
40
  const localeInfo = useLocaleInfo();
@@ -74,7 +75,6 @@ function Links(props) {
74
75
  const globalStore = useGlobalStore(useShallow((ctx) => ({
75
76
  account: ctx.account,
76
77
  account__mobile: ctx.account__mobile,
77
- accountSettings: ctx.accountSettings,
78
78
  messages: ctx.messages,
79
79
  })));
80
80
  const unreadMessagesCountQuery = useUnreadMessagesCountQuery({}, { refetchInterval: 5000 });
@@ -82,15 +82,16 @@ function Links(props) {
82
82
  globalStore.account.setOpen(false);
83
83
  globalStore.account__mobile.setOpen(false);
84
84
  globalStore.messages.setOpen(true);
85
- }, children: [_jsx(Logout01Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Notifications" }), _jsx("span", { className: recipe.navItemBadge(), "data-type": "warning", children: unreadMessagesCountQuery.data ?? 0 }), _jsx(ChevronRightIcon, { className: recipe.navItemIndicator() })] }) }), _jsx("li", { className: recipe.navItemRoot(), children: _jsxs(Link, { href: props.rewardsUrl ?? '/rewards', className: recipe.navItemLink(), onClick: () => {
85
+ }, children: [_jsx(Logout01Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Notifications" }), _jsx("span", { className: recipe.navItemBadge(), "data-type": "warning", children: unreadMessagesCountQuery.data ?? 0 }), _jsx(ChevronRightIcon, { className: recipe.navItemIndicator() })] }) }), _jsx("li", { className: recipe.navItemRoot(), children: _jsxs(Link, { href: props.rewardsUrl, className: recipe.navItemLink(), onClick: () => {
86
86
  globalStore.account.setOpen(false);
87
87
  globalStore.account__mobile.setOpen(false);
88
- }, children: [_jsx(Gift01Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Rewards" }), _jsx("span", { className: recipe.navItemBadge(), "data-type": "warning", children: "0" }), _jsx(ChevronRightIcon, { className: recipe.navItemIndicator() })] }) })] }), _jsx("ul", { children: _jsx("li", { className: recipe.navItemRoot(), children: _jsxs("button", { type: "button", className: recipe.navItemLink(), onClick: () => {
89
- globalStore.accountSettings.setCollapsed(false);
90
- }, children: [_jsx(Settings02Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Settings" }), _jsx("span", { className: recipe.navItemBadge(), "data-type": "error", children: _jsx(AlertCircleIcon, {}) }), _jsx(ChevronRightIcon, { className: recipe.navItemIndicator() })] }) }) }), _jsxs("ul", { children: [_jsx("li", { className: recipe.navItemRoot(), children: _jsxs(Link, { href: props.betRecordsUrl ?? '/bet-records', className: recipe.navItemLink(), onClick: () => {
88
+ }, children: [_jsx(Gift01Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Rewards" }), _jsx("span", { className: recipe.navItemBadge(), "data-type": "warning", children: "0" }), _jsx(ChevronRightIcon, { className: recipe.navItemIndicator() })] }) })] }), _jsx("ul", { children: _jsx("li", { className: recipe.navItemRoot(), children: _jsxs(Link, { href: props.accountSettingsUrl, className: recipe.navItemLink(), onClick: () => {
89
+ globalStore.account.setOpen(false);
90
+ globalStore.account__mobile.setOpen(false);
91
+ }, children: [_jsx(Settings02Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Settings" }), _jsx("span", { className: recipe.navItemBadge(), "data-type": "error", children: _jsx(AlertCircleIcon, {}) }), _jsx(ChevronRightIcon, { className: recipe.navItemIndicator() })] }) }) }), _jsxs("ul", { children: [_jsx("li", { className: recipe.navItemRoot(), children: _jsxs(Link, { href: props.betRecordsUrl, className: recipe.navItemLink(), onClick: () => {
91
92
  globalStore.account.setOpen(false);
92
93
  globalStore.account__mobile.setOpen(false);
93
- }, children: [_jsx(CoinsStacked02Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Bet Records" }), _jsx(ChevronRightIcon, { className: recipe.navItemIndicator() })] }) }), _jsx("li", { className: recipe.navItemRoot(), children: _jsxs(Link, { href: props.transactionsUrl ?? '/transactions', className: recipe.navItemLink(), onClick: () => {
94
+ }, children: [_jsx(CoinsStacked02Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Bet Records" }), _jsx(ChevronRightIcon, { className: recipe.navItemIndicator() })] }) }), _jsx("li", { className: recipe.navItemRoot(), children: _jsxs(Link, { href: props.transactionsUrl, className: recipe.navItemLink(), onClick: () => {
94
95
  globalStore.account.setOpen(false);
95
96
  globalStore.account__mobile.setOpen(false);
96
97
  }, children: [_jsx(CoinsSwap02Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Transactions" }), _jsx(ChevronRightIcon, { className: recipe.navItemIndicator() })] }) })] }), _jsx("ul", { children: _jsx("li", { className: recipe.navItemRoot(), children: _jsxs("button", { type: "button", className: recipe.navItemLink(), disabled: signOutMutation.isPending, onClick: () => {
@@ -99,29 +100,3 @@ function Links(props) {
99
100
  globalStore.account__mobile.setOpen(false);
100
101
  }, children: [_jsx(Logout01Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Log Out" }), _jsx(ChevronRightIcon, { className: recipe.navItemIndicator() })] }) }) })] }));
101
102
  }
102
- function AccountSettingsMenu(props) {
103
- const globalStore = useGlobalStore(useShallow((ctx) => ({
104
- account: ctx.account,
105
- account__mobile: ctx.account__mobile,
106
- accountSettings: ctx.accountSettings,
107
- })));
108
- return (_jsxs(Presence, { present: !globalStore.accountSettings.collapsed, lazyMount: true, className: "bg-bg-primary ui-open:animate-slide-in-right ui-closed:animate-slide-out-right absolute left-0 top-0 size-full overflow-y-auto", children: [_jsxs("div", { className: "bg-bg-primary-alt flex items-center gap-xl px-xl py-md", children: [_jsx(IconButton, { size: "2xs", variant: "outline", colorScheme: "gray", onClick: () => {
109
- globalStore.accountSettings.setCollapsed(true);
110
- }, children: _jsx(ChevronLeftIcon, {}) }), _jsx("h2", { className: "text-text-primary-900 text-lg font-semibold", children: "Settings" })] }), _jsx("nav", { className: recipe.nav({ className: 'p-4' }), children: _jsxs("ul", { children: [_jsx("li", { className: recipe.navItemRoot(), children: _jsxs(Link, { href: props.accountInfoUrl ?? '/account', className: recipe.navItemLink(), onClick: () => {
111
- globalStore.account.setOpen(false);
112
- globalStore.account__mobile.setOpen(false);
113
- globalStore.accountSettings.setCollapsed(true);
114
- }, children: [_jsx(User01Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Account Info" }), _jsx(ChevronRightIcon, { className: recipe.navItemIndicator() })] }) }), _jsx("li", { className: recipe.navItemRoot(), children: _jsxs(Link, { href: props.accountSecurityUrl ?? '/account/security', className: recipe.navItemLink(), onClick: () => {
115
- globalStore.account.setOpen(false);
116
- globalStore.account__mobile.setOpen(false);
117
- globalStore.accountSettings.setCollapsed(true);
118
- }, children: [_jsx(Lock01Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Security" }), _jsx(ChevronRightIcon, { className: recipe.navItemIndicator() })] }) }), _jsx("li", { className: recipe.navItemRoot(), children: _jsxs(Link, { href: props.accountVerificationUrl ?? '/account/verification', className: recipe.navItemLink(), onClick: () => {
119
- globalStore.account.setOpen(false);
120
- globalStore.account__mobile.setOpen(false);
121
- globalStore.accountSettings.setCollapsed(true);
122
- }, children: [_jsx(FileCheck02Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Personal Verification" }), _jsx(ChevronRightIcon, { className: recipe.navItemIndicator() })] }) }), _jsx("li", { className: recipe.navItemRoot(), children: _jsxs(Link, { href: props.accountPaymentMethodsUrl ?? '/account/payment-methods', className: recipe.navItemLink(), onClick: () => {
123
- globalStore.account.setOpen(false);
124
- globalStore.account__mobile.setOpen(false);
125
- globalStore.accountSettings.setCollapsed(true);
126
- }, children: [_jsx(CreditCard02Icon, { className: recipe.navItemIcon() }), _jsx("span", { className: recipe.navItemLabel(), children: "Payment Methods" }), _jsx(ChevronRightIcon, { className: recipe.navItemIndicator() })] }) })] }) })] }));
127
- }
@@ -3,16 +3,33 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { format } from 'date-fns';
4
4
  import { noop } from 'lodash-es';
5
5
  import Image from 'next/image';
6
+ import { twMerge } from 'tailwind-merge';
6
7
  import { useAccountQuery, useLocaleInfo, useMobileNumberParser, } from '../../client/hooks/index.js';
7
8
  import { FacebookIcon, GoogleIcon } from '../../icons/index.js';
8
9
  import avatar from '../../images/placeholder-avatar.png';
9
10
  import { Button, Field, IconButton } from '../../ui/index.js';
10
11
  export function AccountInfo(props) {
12
+ return (_jsxs("div", { className: twMerge('space-y-3xl', props.className), children: [_jsx(ProfileInfo, {}), _jsx(ContactInfo, {}), _jsx(PersonalInfo, {}), _jsx(SSO, {})] }));
13
+ }
14
+ function ProfileInfo() {
15
+ const accountQuery = useAccountQuery();
16
+ const account = accountQuery.data;
17
+ return (_jsxs("div", { children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Profile Info" }), _jsxs("div", { className: "bg-bg-primary-alt border-border-secondary mt-5 rounded-xl border", children: [_jsx("div", { className: "border-border-secondary border-b px-4 py-5", children: _jsxs("div", { className: "flex items-center gap-xl", children: [_jsx(Image, { src: avatar, alt: "", width: 80, height: 80, className: "size-14 shrink-0 rounded-md object-cover" }), _jsxs("div", { children: [_jsx("h3", { className: "text-text-secondary-700 text-lg font-semibold leading-tight", children: account?.name }), _jsx("p", { className: "text-text-tertiary-600 leading-tight", children: account?.id })] })] }) }), _jsx("div", { className: "flex justify-end px-xl py-lg", children: _jsx(Button, { size: "sm", variant: "outline", fullWidth: false, children: "Upload New Avatar" }) })] })] }));
18
+ }
19
+ function PersonalInfo() {
20
+ const accountQuery = useAccountQuery();
21
+ const account = accountQuery.data;
22
+ return (_jsxs("div", { children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Personal Data" }), _jsxs("form", { className: "shadow-xs bg-bg-primary-alt border-border-secondary mt-5 rounded-xl border", children: [_jsxs("div", { className: "px-4 py-5 lg:px-3xl lg:py-5", children: [_jsxs(Field.Root, { children: [_jsx(Field.Label, { children: "Real name" }), _jsx(Field.Input, { value: account?.realName ?? '', onChange: noop, readOnly: true })] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Date of birth" }), _jsx(Field.Input, { type: "date", value: account?.birthDay ? format(account.birthDay, 'yyyy-MM-dd') : '', readOnly: true })] })] }), _jsxs("div", { className: "border-border-secondary flex justify-end gap-lg border-t px-xl py-lg lg:px-3xl lg:py-xl", children: [_jsx(Button, { size: "sm", variant: "outline", fullWidth: false, children: "Cancel" }), _jsx(Button, { size: "sm", fullWidth: false, children: "Save Changes" })] })] })] }));
23
+ }
24
+ function ContactInfo() {
11
25
  const localeInfo = useLocaleInfo();
12
26
  const accountQuery = useAccountQuery();
13
27
  const account = accountQuery.data;
14
28
  const mobileNumberParser = useMobileNumberParser();
15
- return (_jsxs("div", { className: props.className, children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Profile Info" }), _jsxs("div", { className: "bg-bg-primary-alt border-border-secondary mt-5 rounded-xl border", children: [_jsx("div", { className: "border-border-secondary border-b px-4 py-5", children: _jsxs("div", { className: "flex items-center gap-xl", children: [_jsx(Image, { src: avatar, alt: "", width: 80, height: 80, className: "size-14 shrink-0 rounded-md object-cover" }), _jsxs("div", { children: [_jsx("h3", { className: "text-text-secondary-700 text-lg font-semibold leading-tight", children: account?.name }), _jsx("p", { className: "text-text-tertiary-600 leading-tight", children: account?.emailAddress ?? account?.nickName })] })] }) }), _jsx("div", { className: "flex justify-end px-xl py-lg", children: _jsx(Button, { size: "sm", variant: "outline", fullWidth: false, children: "Upload New Avatar" }) })] }), _jsx("h2", { className: "text-text-secondary-700 mt-6 text-sm font-semibold", children: "Contact Info" }), _jsxs("div", { className: "shadow-xs bg-bg-primary-alt border-border-secondary mt-5 rounded-xl border px-4 py-5", children: [_jsxs(Field.Root, { children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsx(localeInfo.country.flag, { className: "pointer-events-none absolute left-3.5 top-1/2 size-5 -translate-y-1/2" }), _jsx(Field.Input, { className: "pl-10.5", value: account?.mobileNumber
16
- ? mobileNumberParser.format(account?.mobileNumber)
17
- : '', readOnly: true, onChange: noop })] })] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Email address" }), _jsx(Field.Input, { defaultValue: account?.emailAddress ?? '' })] })] }), _jsx("h2", { className: "text-text-secondary-700 mt-6 text-sm font-semibold", children: "Personal Data" }), _jsxs("div", { className: "shadow-xs bg-bg-primary-alt border-border-secondary mt-5 rounded-xl border px-4 py-5", children: [_jsxs(Field.Root, { children: [_jsx(Field.Label, { children: "Real name" }), _jsx(Field.Input, { value: account?.realName ?? '', onChange: noop, readOnly: true })] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Date of birth" }), _jsx(Field.Input, { type: "date", value: account?.birthDay ? format(account.birthDay, 'yyyy-MM-dd') : '', readOnly: true })] })] }), _jsx("h2", { className: "text-text-secondary-700 mt-6 text-sm font-semibold", children: "Account Connections" }), _jsxs("div", { className: "shadow-xs bg-bg-primary-alt border-border-secondary mt-5 rounded-xl border px-4 py-5", children: [_jsxs("div", { className: "flex items-center", children: [_jsxs("div", { className: "flex grow items-center gap-sm", children: [_jsx(IconButton, { variant: "outline", colorScheme: "gray", children: _jsx(GoogleIcon, { className: "size-6" }) }), _jsxs("div", { children: [_jsx("p", { className: "text-sm font-medium leading-tight", children: "Google" }), _jsx("p", { className: "text-text-secondary-700 mt-xs text-xs leading-tight", children: "Not Connected" })] })] }), _jsx(Button, { fullWidth: false, children: "Connect" })] }), _jsxs("div", { className: "mt-6 flex items-center", children: [_jsxs("div", { className: "flex grow items-center gap-sm", children: [_jsx(IconButton, { variant: "outline", colorScheme: "gray", children: _jsx(FacebookIcon, { className: "size-6" }) }), _jsxs("div", { children: [_jsx("p", { className: "text-sm font-medium leading-tight", children: "Facebook" }), _jsx("p", { className: "text-text-success-primary-600 mt-xs text-xs leading-tight", children: "Connected" })] })] }), _jsx("button", { className: "text-button-tertiary-error-fg text-sm font-semibold", children: "Disconnect" })] })] })] }));
29
+ return (_jsxs("div", { children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Contact Info" }), _jsxs("form", { className: "shadow-xs bg-bg-primary-alt border-border-secondary mt-5 rounded-xl border", children: [_jsxs("div", { className: "px-xl py-5 lg:px-3xl lg:py-5", children: [_jsxs(Field.Root, { children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsx(localeInfo.country.flag, { className: "pointer-events-none absolute left-3.5 top-1/2 size-5 -translate-y-1/2" }), _jsx(Field.Input, { className: "pl-10.5", value: account?.mobileNumber
30
+ ? mobileNumberParser.format(account?.mobileNumber)
31
+ : '', readOnly: true, onChange: noop })] })] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Email address" }), _jsx(Field.Input, { defaultValue: account?.emailAddress ?? '' })] })] }), _jsxs("div", { className: "border-border-secondary flex justify-end gap-lg border-t px-xl py-lg lg:px-3xl lg:py-xl", children: [_jsx(Button, { size: "sm", variant: "outline", fullWidth: false, children: "Cancel" }), _jsx(Button, { size: "sm", fullWidth: false, children: "Save Changes" })] })] })] }));
32
+ }
33
+ function SSO() {
34
+ return (_jsxs("div", { children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Account Connections" }), _jsxs("div", { className: "shadow-xs bg-bg-primary-alt border-border-secondary mt-5 rounded-xl border px-4 py-5", children: [_jsxs("div", { className: "flex items-center", children: [_jsxs("div", { className: "flex grow items-center gap-sm", children: [_jsx(IconButton, { variant: "outline", colorScheme: "gray", children: _jsx(GoogleIcon, { className: "size-6" }) }), _jsxs("div", { children: [_jsx("p", { className: "text-sm font-medium leading-tight", children: "Google" }), _jsx("p", { className: "text-text-secondary-700 mt-xs text-xs leading-tight", children: "Not Connected" })] })] }), _jsx(Button, { fullWidth: false, children: "Connect" })] }), _jsxs("div", { className: "mt-6 flex items-center", children: [_jsxs("div", { className: "flex grow items-center gap-sm", children: [_jsx(IconButton, { variant: "outline", colorScheme: "gray", children: _jsx(FacebookIcon, { className: "size-6" }) }), _jsxs("div", { children: [_jsx("p", { className: "text-sm font-medium leading-tight", children: "Facebook" }), _jsx("p", { className: "text-text-success-primary-600 mt-xs text-xs leading-tight", children: "Connected" })] })] }), _jsx("button", { className: "text-button-tertiary-error-fg text-sm font-semibold", children: "Disconnect" })] })] })] }));
18
35
  }
@@ -4,17 +4,25 @@ import { ark, createListCollection, Portal } from '@ark-ui/react';
4
4
  import { twMerge } from 'tailwind-merge';
5
5
  import { useProfileCompletionQuery } from '../../client/hooks/index.js';
6
6
  import { AlertCircleIcon, CheckIcon, CheckVerified02Icon, ChevronDownIcon, EyeIcon, EyeOffIcon, } from '../../icons/index.js';
7
- import { Field, PasswordInput, Select } from '../../ui/index.js';
7
+ import { Button, Field, PasswordInput, Select } from '../../ui/index.js';
8
8
  export function AccountSecurity(props) {
9
+ return (_jsxs("div", { className: twMerge('space-y-3xl', props.className), children: [_jsx(LoginPassword, {}), _jsx(TransactionPassword, {})] }));
10
+ }
11
+ function LoginPassword() {
9
12
  const profileCompletionQuery = useProfileCompletionQuery();
10
13
  const profileCompletion = profileCompletionQuery.data;
11
- return (_jsxs("div", { className: props.className, children: [_jsxs("div", { className: "flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Log in password" }), _jsx("p", { className: "text-text-tertiary-600 text-sm", children: "Access your account by logging in with your name and password." })] }), _jsx(ark.svg, { asChild: true, className: twMerge('size-6', profileCompletion?.accountPassword
14
+ return (_jsxs("div", { children: [_jsxs("div", { className: "flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Log in password" }), _jsx("p", { className: "text-text-tertiary-600 text-sm", children: "Access your account by logging in with your name and password." })] }), _jsx(ark.svg, { asChild: true, className: twMerge('size-6', profileCompletion?.accountPassword
12
15
  ? 'text-text-success-primary'
13
- : 'text-text-warning-primary'), children: profileCompletion?.accountPassword ? (_jsx(CheckVerified02Icon, {})) : (_jsx(AlertCircleIcon, {})) })] }), _jsxs("div", { className: "shadow-xs bg-bg-primary-alt border-border-secondary mt-5 rounded-xl border px-4 py-5", children: [_jsx(Field.Root, { children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, {}), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }) }), _jsx(Field.Root, { className: "mt-6", children: _jsxs(Select.Root, { collection: secretQuestionCollection, lazyMount: true, positioning: {
14
- sameWidth: true,
15
- }, children: [_jsx(Select.Label, { children: "Security Question" }), _jsxs(Select.Trigger, { children: [_jsx(Select.ValueText, { placeholder: "Game Vendor" }), _jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })] }), _jsx(Portal, { children: _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: _jsx(Select.ItemGroup, { children: secretQuestionCollection.items.map((provider) => (_jsxs(Select.Item, { item: provider, children: [_jsx(Select.ItemText, { children: secretQuestionCollection.stringifyItem(provider) }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, provider))) }) }) }) })] }) }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Answer" }), _jsx(Field.Input, {})] })] }), _jsxs("div", { className: "mt-6 flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Transaction password" }), _jsx("p", { className: "text-text-tertiary-600 text-sm", children: "The transaction password secures and confirms your wallet withdrawals." })] }), _jsx(ark.svg, { asChild: true, className: twMerge('size-6', profileCompletion?.accountPassword
16
+ : 'text-text-warning-primary'), children: profileCompletion?.accountPassword ? (_jsx(CheckVerified02Icon, {})) : (_jsx(AlertCircleIcon, {})) })] }), _jsxs("form", { className: "shadow-xs bg-bg-primary-alt border-border-secondary mt-5 rounded-xl border", children: [_jsxs("div", { className: "px-xl py-5 lg:px-3xl lg:py-5", children: [_jsx(Field.Root, { children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, {}), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }) }), _jsx(Field.Root, { className: "mt-6", children: _jsxs(Select.Root, { collection: secretQuestionCollection, lazyMount: true, positioning: {
17
+ sameWidth: true,
18
+ }, children: [_jsx(Select.Label, { children: "Security Question" }), _jsxs(Select.Trigger, { children: [_jsx(Select.ValueText, { placeholder: "Game Vendor" }), _jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })] }), _jsx(Portal, { children: _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: _jsx(Select.ItemGroup, { children: secretQuestionCollection.items.map((provider) => (_jsxs(Select.Item, { item: provider, children: [_jsx(Select.ItemText, { children: secretQuestionCollection.stringifyItem(provider) }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, provider))) }) }) }) })] }) }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Answer" }), _jsx(Field.Input, {})] })] }), _jsxs("div", { className: "border-border-secondary flex justify-end gap-lg border-t px-xl py-lg lg:px-3xl lg:py-xl", children: [_jsx(Button, { size: "sm", variant: "outline", fullWidth: false, children: "Cancel" }), _jsx(Button, { size: "sm", fullWidth: false, children: "Save Changes" })] })] })] }));
19
+ }
20
+ function TransactionPassword() {
21
+ const profileCompletionQuery = useProfileCompletionQuery();
22
+ const profileCompletion = profileCompletionQuery.data;
23
+ return (_jsxs("div", { children: [_jsxs("div", { className: "flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Transaction password" }), _jsx("p", { className: "text-text-tertiary-600 text-sm", children: "The transaction password secures and confirms your wallet withdrawals." })] }), _jsx(ark.svg, { asChild: true, className: twMerge('size-6', profileCompletion?.accountPassword
16
24
  ? 'text-text-success-primary'
17
- : 'text-text-warning-primary'), children: profileCompletion?.accountPassword ? (_jsx(CheckVerified02Icon, {})) : (_jsx(AlertCircleIcon, {})) })] }), _jsx("div", { className: "shadow-xs bg-bg-primary-alt border-border-secondary mt-5 rounded-xl border px-4 py-5", children: _jsx(Field.Root, { children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, {}), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }) }) })] }));
25
+ : 'text-text-warning-primary'), children: profileCompletion?.accountPassword ? (_jsx(CheckVerified02Icon, {})) : (_jsx(AlertCircleIcon, {})) })] }), _jsxs("form", { className: "shadow-xs bg-bg-primary-alt border-border-secondary mt-5 rounded-xl border", children: [_jsxs("div", { className: "px-xl py-5 lg:px-3xl lg:py-5", children: [_jsx(Field.Root, { children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, {}), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }) }), _jsx(Field.Root, { className: "mt-6", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Confirm Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, {}), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }) })] }), _jsxs("div", { className: "border-border-secondary flex justify-end gap-lg border-t px-xl py-lg lg:px-3xl lg:py-xl", children: [_jsx(Button, { size: "sm", variant: "outline", fullWidth: false, children: "Cancel" }), _jsx(Button, { size: "sm", fullWidth: false, children: "Save Changes" })] })] })] }));
18
26
  }
19
27
  const SECRET_QUESTIONS = [
20
28
  'BEST_CHILDHOOD_FRIEND',
@@ -1,37 +1,10 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { ark } from '@ark-ui/react';
4
- import { twMerge } from 'tailwind-merge';
5
- import { useMemberVerificationQuery, useProfileCompletionQuery, } from '../../client/hooks/index.js';
6
- import { AlertCircleIcon, CheckVerified02Icon, CreditCard02Icon, FaceIdIcon, FileCheck02Icon, FileSearch02Icon, FileX02Icon, Globe05Icon, } from '../../icons/index.js';
7
- import { Button } from '../../ui/index.js';
3
+ import { AccountVerificationContext, useAccountVerification, } from './AccountVerificationContext.js';
8
4
  import { VerificationCapture } from './VerificationCapture.js';
5
+ import { VerificationComplete } from './VerificationComplete.js';
6
+ import { VerificationDetails } from './VerificationDetails.js';
9
7
  export function AccountVerification(props) {
10
- const profileCompletionQuery = useProfileCompletionQuery();
11
- const profileCompletion = profileCompletionQuery.data;
12
- const verificationQuery = useMemberVerificationQuery();
13
- const verification = verificationQuery.data;
14
- const empty = verification == null;
15
- const pending = verification?.status === 'PENDING';
16
- const success = verification?.status === 'VERIFIED' || verification?.status === 'APPROVED';
17
- const failed = verification?.status === 'REJECTED' ||
18
- verification?.status === 'UNVERIFIED';
19
- if (1) {
20
- return (_jsx("div", { className: props.className, children: _jsx(VerificationCapture, {}) }));
21
- }
22
- return (_jsxs("div", { className: props.className, children: [_jsxs("div", { className: "flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Verify your identity" }), _jsx("p", { className: "text-text-tertiary-600 text-sm", children: "Complete personal verification to unlock all features and enhance account security." })] }), _jsx(ark.svg, { asChild: true, className: twMerge('size-6', profileCompletion?.accountVerification
23
- ? 'text-text-success-primary'
24
- : 'text-text-warning-primary'), children: profileCompletion?.accountVerification ? (_jsx(CheckVerified02Icon, {})) : (_jsx(AlertCircleIcon, {})) })] }), _jsxs("div", { className: "shadow-xs border-border-secondary bg-bg-primary-alt mt-5 rounded-xl border", children: [_jsx("div", { className: "px-4 py-5", children: _jsxs("ul", { className: "space-y-lg", children: [_jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(FileCheck02Icon, {}), "Basic Information"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(Globe05Icon, {}), "Proof of address"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(CreditCard02Icon, {}), "Government ID"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(FaceIdIcon, {}), "Facial Verification"] })] }) }), _jsx("div", { className: "border-border-secondary border-t px-4 py-3", children: _jsx(Button, { size: "sm", children: "Verify Now" }) })] }), success && _jsx(VerificationSuccess, {}), pending && _jsx(VerificationInProgress, {}), failed && _jsx(VerificationFailed, {}), empty && _jsx(VerificationNotSubmitted, {})] }));
25
- }
26
- function VerificationNotSubmitted() {
27
- return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 rounded-xl border p-xl", children: [_jsx("div", { className: "border-text-warning-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-warning-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(AlertCircleIcon, { className: "text-text-warning-primary size-5" }) }) }), _jsx("p", { className: "text-text-tertiary-600 mt-2 text-sm", children: "To serve you better and unlock all features, please provide valid identification documents. This helps protect your account and makes recovery easier if ever needed." })] }));
28
- }
29
- function VerificationInProgress() {
30
- return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 rounded-xl border p-xl", children: [_jsx("div", { className: "border-text-warning-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-warning-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(FileSearch02Icon, { className: "text-text-warning-primary size-5" }) }) }), _jsx("h2", { className: "text-text-secondary-700 mt-2 text-sm font-semibold", children: "Under review" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: "To serve you better and unlock all features, please provide valid identification documents. This helps protect your account and makes recovery easier if ever needed." })] }));
31
- }
32
- function VerificationSuccess() {
33
- return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 rounded-xl border p-xl", children: [_jsx("div", { className: "border-text-success-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-success-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(FileCheck02Icon, { className: "text-text-success-primary size-5" }) }) }), _jsx("h2", { className: "text-text-secondary-700 mt-2 text-sm font-semibold", children: "Verification successful" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: "Your account has been successfully verified. You now have full access to all features and improved account security." })] }));
34
- }
35
- function VerificationFailed() {
36
- return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 rounded-xl border p-xl", children: [_jsx("div", { className: "border-text-error-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-error-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(FileX02Icon, { className: "text-text-error-primary size-5" }) }) }), _jsx("h2", { className: "text-text-secondary-700 mt-2 text-sm font-semibold", children: "Verification failed" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: "There was an issue with the verification process. Please try again or contact support for assistance." })] }));
8
+ const context = useAccountVerification();
9
+ return (_jsx(AccountVerificationContext, { value: context, children: _jsxs("div", { className: props.className, children: [_jsx(VerificationCapture, {}), _jsx(VerificationDetails, {}), _jsx(VerificationComplete, {})] }) }));
37
10
  }
@@ -0,0 +1,14 @@
1
+ type Step = 1 | 2 | 3 | (number & {});
2
+ interface UseAccountVerificationReturn {
3
+ step: Step;
4
+ setStep: (step: Step) => void;
5
+ started: boolean;
6
+ setStarted: (started: boolean) => void;
7
+ completed: boolean;
8
+ setCompleted: (completed: boolean) => void;
9
+ reset: () => void;
10
+ }
11
+ export declare function useAccountVerification(): UseAccountVerificationReturn;
12
+ export declare const AccountVerificationContext: import("react").Context<UseAccountVerificationReturn | null>;
13
+ export declare function useAccountVerificationContext(): UseAccountVerificationReturn;
14
+ export {};
@@ -0,0 +1,27 @@
1
+ import { createContext, useContext, useState } from 'react';
2
+ import invariant from 'tiny-invariant';
3
+ export function useAccountVerification() {
4
+ const [step, setStep] = useState(1);
5
+ const [started, setStarted] = useState(false);
6
+ const [completed, setCompleted] = useState(false);
7
+ function reset() {
8
+ setStep(1);
9
+ setStarted(false);
10
+ setCompleted(false);
11
+ }
12
+ return {
13
+ step,
14
+ setStep,
15
+ started,
16
+ setStarted,
17
+ completed,
18
+ setCompleted,
19
+ reset,
20
+ };
21
+ }
22
+ export const AccountVerificationContext = createContext(null);
23
+ export function useAccountVerificationContext() {
24
+ const context = useContext(AccountVerificationContext);
25
+ invariant(context);
26
+ return context;
27
+ }
@@ -1 +1 @@
1
- export declare function VerificationCapture(): import("react/jsx-runtime").JSX.Element;
1
+ export declare function VerificationCapture(): import("react/jsx-runtime").JSX.Element | null;
@@ -1,57 +1,28 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Portal } from '@ark-ui/react';
3
- import { clamp, noop } from 'lodash-es';
2
+ import { noop } from 'lodash-es';
4
3
  import Image from 'next/image';
5
- import { createContext, useContext, useState } from 'react';
6
- import invariant from 'tiny-invariant';
7
- import { toaster } from '../../client/utils/index.js';
8
- import { ArrowLeftIcon, CheckCircleIcon, CheckIcon, XIcon } from '../../icons/index.js';
4
+ import { ArrowLeftIcon, CheckIcon, XIcon } from '../../icons/index.js';
9
5
  import uploadId from '../../images/capture-id-banner.png';
10
6
  import selfie from '../../images/capture-selfie-banner.png';
11
- import { AlertDialog, Button, Checkbox, Field, Progress } from '../../ui/index.js';
12
- function useVerificationCapture() {
13
- const [step, setStep_] = useState(1);
14
- function setStep(step) {
15
- setStep_(step);
16
- if (step === 4) {
17
- toaster.success({
18
- title: 'Submission Successful',
19
- description: 'Your documents have been submitted successfully. They’re now under review, and you’ll receive a notification as soon as your account is verified.',
20
- });
21
- }
22
- }
23
- return {
24
- step,
25
- setStep,
26
- };
27
- }
28
- const VerificationCaptureContext = createContext(null);
29
- function useVerificationCaptureContext() {
30
- const context = useContext(VerificationCaptureContext);
31
- invariant(context);
32
- return context;
33
- }
7
+ import { Button, Checkbox, Field, Progress } from '../../ui/index.js';
8
+ import { useAccountVerificationContext } from './AccountVerificationContext.js';
34
9
  export function VerificationCapture() {
35
- const context = useVerificationCapture();
36
- return (_jsx(VerificationCaptureContext, { value: context, children: _jsxs("div", { children: [_jsxs("div", { className: "grid grid-cols-4 items-center", children: [_jsxs("button", { className: "text-text-tertiary-600 flex gap-sm text-sm font-semibold", disabled: context.step <= 1, onClick: () => context.setStep(clamp(context.step - 1, 1, 4)), children: [_jsx(ArrowLeftIcon, { className: "size-5" }), "Back"] }), _jsxs("div", { className: "col-span-2 flex justify-center gap-2", children: [_jsx(Progress.Root, { value: context.step >= 2 ? 100 : context.step >= 1 ? 50 : 0, onValueChange: noop, className: "w-22.5 shrink-0", children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) }), _jsx(Progress.Root, { value: context.step >= 4 ? 100 : context.step >= 3 ? 50 : 0, onValueChange: noop, className: "w-22.5 shrink-0", children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) })] })] }), context.step === 1 && _jsx(Step1, {}), context.step === 2 && _jsx(Step2, {}), (context.step === 3 || context.step === 4) && _jsx(Step3, {}), _jsx(Congrats, {})] }) }));
10
+ const context = useAccountVerificationContext();
11
+ if (!context.started)
12
+ return null;
13
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "grid grid-cols-4 items-center", children: [_jsxs("button", { className: "text-text-tertiary-600 flex gap-sm text-sm font-semibold", disabled: context.step <= 1, onClick: () => context.setStep(context.step - 1), children: [_jsx(ArrowLeftIcon, { className: "size-5" }), "Back"] }), _jsxs("div", { className: "col-span-2 flex justify-center gap-2", children: [_jsx(Progress.Root, { value: context.step >= 2 ? 100 : context.step >= 1 ? 50 : 0, onValueChange: noop, className: "w-22.5 shrink-0", children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) }), _jsx(Progress.Root, { value: context.completed ? 100 : context.step >= 3 ? 50 : 0, onValueChange: noop, className: "w-22.5 shrink-0", children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) })] })] }), context.step === 1 && _jsx(Step1, {}), context.step === 2 && _jsx(Step2, {}), context.step === 3 && _jsx(Step3, {})] }));
37
14
  }
38
15
  function Step1() {
39
- const context = useVerificationCaptureContext();
40
- return (_jsxs(_Fragment, { children: [_jsx("p", { className: "mt-2xl text-center text-2xl font-semibold", children: "Prepare to upload your ID" }), _jsxs("div", { className: "border-border-secondary bg-bg-primary-alt shadow-xs mt-6 rounded-2xl border", children: [_jsxs("div", { className: "px-4 py-5", children: [_jsx(Image, { src: uploadId, alt: "", className: "h-auto w-full", width: 800, height: 400 }), _jsxs("ul", { className: "mt-2xl space-y-3", children: [_jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Upload front side of your ID"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Take a photo in a well lit room"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(XIcon, { className: "text-text-featured-icon-light-error size-6" }), "Don't edit image of your ID"] })] })] }), _jsx("div", { className: "border-border-secondary border-t px-xl py-lg", children: _jsx(Button, { size: "sm", onClick: () => context.setStep(2), children: "Continue" }) })] })] }));
16
+ const context = useAccountVerificationContext();
17
+ return (_jsxs(_Fragment, { children: [_jsx("p", { className: "mt-2xl text-center text-2xl font-semibold", children: "Prepare to upload your ID" }), _jsxs("div", { className: "border-border-secondary bg-bg-primary-alt shadow-xs mt-6 rounded-2xl border", children: [_jsxs("div", { className: "px-4 py-5", children: [_jsx(Image, { src: uploadId, alt: "", className: "h-auto w-full", width: 600, height: 352 }), _jsxs("ul", { className: "mt-2xl space-y-3", children: [_jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Upload front side of your ID"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Take a photo in a well lit room"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(XIcon, { className: "text-text-featured-icon-light-error size-6" }), "Don't edit image of your ID"] })] })] }), _jsx("div", { className: "border-border-secondary border-t px-xl py-lg", children: _jsx(Button, { size: "sm", onClick: () => context.setStep(2), children: "Continue" }) })] })] }));
41
18
  }
42
19
  function Step2() {
43
- const context = useVerificationCaptureContext();
44
- return (_jsxs(_Fragment, { children: [_jsx("p", { className: "mt-2xl text-center text-2xl font-semibold", children: "Take a selfie holding your ID" }), _jsxs("div", { className: "border-border-secondary bg-bg-primary-alt shadow-xs mt-6 rounded-2xl border", children: [_jsxs("div", { className: "px-4 py-5", children: [_jsx(Image, { src: selfie, alt: "", className: "h-auto w-full", width: 800, height: 400 }), _jsxs("ul", { className: "mt-2xl space-y-3", children: [_jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Face and ID must be clearly visible"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Take a photo in a well lit room"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(XIcon, { className: "text-text-featured-icon-light-error size-6" }), "No hats, sunglasses, or masks"] })] })] }), _jsx("div", { className: "border-border-secondary border-t px-xl py-lg", children: _jsx(Button, { size: "sm", onClick: () => context.setStep(3), children: "Continue" }) })] })] }));
20
+ const context = useAccountVerificationContext();
21
+ return (_jsxs(_Fragment, { children: [_jsx("p", { className: "mt-2xl text-center text-2xl font-semibold", children: "Take a selfie holding your ID" }), _jsxs("div", { className: "border-border-secondary bg-bg-primary-alt shadow-xs mt-6 rounded-2xl border", children: [_jsxs("div", { className: "px-4 py-5", children: [_jsx(Image, { src: selfie, alt: "", className: "h-auto w-full", width: 600, height: 352 }), _jsxs("ul", { className: "mt-2xl space-y-3", children: [_jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Face and ID must be clearly visible"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Take a photo in a well lit room"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(XIcon, { className: "text-text-featured-icon-light-error size-6" }), "No hats, sunglasses, or masks"] })] })] }), _jsx("div", { className: "border-border-secondary border-t px-xl py-lg", children: _jsx(Button, { size: "sm", onClick: () => context.setStep(3), children: "Continue" }) })] })] }));
45
22
  }
46
23
  function Step3() {
47
- const context = useVerificationCaptureContext();
48
- return (_jsxs(_Fragment, { children: [_jsx("p", { className: "mt-2xl text-center text-2xl font-semibold", children: "Enter your basic and work-related information" }), _jsxs("div", { className: "border-border-secondary bg-bg-primary-alt shadow-xs mt-6 rounded-2xl border", children: [_jsxs("div", { className: "px-4 py-5", children: [_jsxs(Field.Root, { children: [_jsx(Field.Label, { children: "Permanent address" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Current address" }), _jsx(Field.Input, {})] }), _jsxs(Checkbox.Root, { className: "mt-sm", children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsx(Checkbox.Label, { children: "Same as permanent address" }), _jsx(Checkbox.HiddenInput, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Source of income" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Nature of work" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Place of birth" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Nationality" }), _jsx(Field.Input, {})] })] }), _jsx("div", { className: "border-border-secondary border-t px-xl py-lg", children: _jsx(Button, { size: "sm", onClick: () => context.setStep(4), children: "Continue" }) })] })] }));
49
- }
50
- function Congrats() {
51
- const context = useVerificationCaptureContext();
52
- return (_jsx(AlertDialog.Root, { open: context.step === 4, onOpenChange: (details) => {
53
- if (!details.open) {
54
- context.setStep(1);
55
- }
56
- }, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "bg-bg-overlay/75 backdrop-blur-sm" }), _jsx(AlertDialog.Positioner, { children: _jsxs(AlertDialog.Content, { className: "mx-auto w-[21.438rem] p-xl", children: [_jsx("div", { className: "bg-bg-success-secondary text-text-featured-icon-light-success mx-auto flex size-12 items-center justify-center rounded-full", children: _jsx(CheckCircleIcon, {}) }), _jsx(AlertDialog.Title, { className: "mt-3 text-center", children: "Submission Successful" }), _jsx(AlertDialog.Description, { className: "text-text-tertiary-600 text-center", children: "Your documents have been submitted successfully. They\u2019re now under review, and you\u2019ll receive a notification as soon as your account is verified." }), _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { className: "mt-3xl", onClick: () => api.setOpen(false), children: "Ok" })) })] }) })] }) }));
24
+ const context = useAccountVerificationContext();
25
+ return (_jsxs(_Fragment, { children: [_jsx("p", { className: "mt-2xl text-center text-2xl font-semibold", children: "Enter your basic and work-related information" }), _jsxs("div", { className: "border-border-secondary bg-bg-primary-alt shadow-xs mt-6 rounded-2xl border", children: [_jsxs("div", { className: "px-4 py-5", children: [_jsxs(Field.Root, { children: [_jsx(Field.Label, { children: "Permanent address" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Current address" }), _jsx(Field.Input, {})] }), _jsxs(Checkbox.Root, { className: "mt-sm", children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsx(Checkbox.Label, { children: "Same as permanent address" }), _jsx(Checkbox.HiddenInput, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Source of income" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Nature of work" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Place of birth" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Nationality" }), _jsx(Field.Input, {})] })] }), _jsx("div", { className: "border-border-secondary border-t px-xl py-lg", children: _jsx(Button, { size: "sm", onClick: () => {
26
+ context.setCompleted(true);
27
+ }, children: "Continue" }) })] })] }));
57
28
  }
@@ -0,0 +1 @@
1
+ export declare function VerificationComplete(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Portal } from '@ark-ui/react';
3
+ import { CheckCircleIcon } from '../../icons/index.js';
4
+ import { AlertDialog, Button } from '../../ui/index.js';
5
+ import { useAccountVerificationContext } from './AccountVerificationContext.js';
6
+ export function VerificationComplete() {
7
+ const context = useAccountVerificationContext();
8
+ return (_jsx(AlertDialog.Root, { open: context.completed, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "bg-bg-overlay/75 backdrop-blur-sm" }), _jsx(AlertDialog.Positioner, { children: _jsxs(AlertDialog.Content, { className: "mx-auto w-[21.438rem] p-xl", children: [_jsx("div", { className: "bg-bg-success-secondary text-text-featured-icon-light-success mx-auto flex size-12 items-center justify-center rounded-full", children: _jsx(CheckCircleIcon, {}) }), _jsx(AlertDialog.Title, { className: "mt-3 text-center", children: "Submission Successful" }), _jsx(AlertDialog.Description, { className: "text-text-tertiary-600 text-center", children: "Your documents have been submitted successfully. They\u2019re now under review, and you\u2019ll receive a notification as soon as your account is verified." }), _jsx(Button, { className: "mt-3xl", onClick: () => context.reset(), children: "Ok" })] }) })] }) }));
9
+ }
@@ -0,0 +1 @@
1
+ export declare function VerificationDetails(): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { ark } from '@ark-ui/react';
3
+ import { twMerge } from 'tailwind-merge';
4
+ import { useMemberVerificationQuery, useProfileCompletionQuery, } from '../../client/hooks/index.js';
5
+ import { AlertCircleIcon, CheckVerified02Icon, CreditCard02Icon, FaceIdIcon, FileCheck02Icon, FileSearch02Icon, FileX02Icon, Globe05Icon, } from '../../icons/index.js';
6
+ import { Button } from '../../ui/index.js';
7
+ import { useAccountVerificationContext } from './AccountVerificationContext.js';
8
+ export function VerificationDetails() {
9
+ const context = useAccountVerificationContext();
10
+ const profileCompletionQuery = useProfileCompletionQuery();
11
+ const profileCompletion = profileCompletionQuery.data;
12
+ const verificationQuery = useMemberVerificationQuery();
13
+ const verification = verificationQuery.data;
14
+ const empty = verification == null;
15
+ const pending = verification?.status === 'PENDING';
16
+ const success = verification?.status === 'VERIFIED' || verification?.status === 'APPROVED';
17
+ const failed = verification?.status === 'REJECTED' ||
18
+ verification?.status === 'UNVERIFIED';
19
+ if (context.started)
20
+ return null;
21
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Verify your identity" }), _jsx("p", { className: "text-text-tertiary-600 text-sm", children: "Complete personal verification to unlock all features and enhance account security." })] }), _jsx(ark.svg, { asChild: true, className: twMerge('size-6', profileCompletion?.accountVerification
22
+ ? 'text-text-success-primary'
23
+ : 'text-text-warning-primary'), children: profileCompletion?.accountVerification ? (_jsx(CheckVerified02Icon, {})) : (_jsx(AlertCircleIcon, {})) })] }), _jsxs("div", { className: "shadow-xs border-border-secondary bg-bg-primary-alt mt-5 rounded-xl border", children: [_jsx("div", { className: "px-4 py-5", children: _jsxs("ul", { className: "space-y-lg", children: [_jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(FileCheck02Icon, {}), "Basic Information"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(Globe05Icon, {}), "Proof of address"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(CreditCard02Icon, {}), "Government ID"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(FaceIdIcon, {}), "Facial Verification"] })] }) }), _jsx("div", { className: "border-border-secondary flex justify-end border-t px-4 py-3 lg:py-xl", children: _jsx(Button, { size: "sm", onClick: () => {
24
+ context.setStarted(true);
25
+ }, className: "w-full lg:w-fit", children: "Verify Now" }) })] }), success && _jsx(VerificationSuccess, {}), pending && _jsx(VerificationInProgress, {}), failed && _jsx(VerificationFailed, {}), empty && _jsx(VerificationNotSubmitted, {})] }));
26
+ }
27
+ function VerificationNotSubmitted() {
28
+ return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 flex flex-col gap-2 rounded-xl border p-xl lg:flex-row", children: [_jsx("div", { className: "border-text-warning-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-warning-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(AlertCircleIcon, { className: "text-text-warning-primary size-5" }) }) }), _jsx("p", { className: "text-text-tertiary-600 max-w-[800px] text-sm", children: "To serve you better and unlock all features, please provide valid identification documents. This helps protect your account and makes recovery easier if ever needed." })] }));
29
+ }
30
+ function VerificationInProgress() {
31
+ return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 flex flex-col gap-2 rounded-xl border p-xl lg:flex-row", children: [_jsx("div", { className: "border-text-warning-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-warning-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(FileSearch02Icon, { className: "text-text-warning-primary size-5" }) }) }), _jsxs("div", { children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Under review" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: "To serve you better and unlock all features, please provide valid identification documents. This helps protect your account and makes recovery easier if ever needed." })] })] }));
32
+ }
33
+ function VerificationSuccess() {
34
+ return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 flex flex-col gap-2 rounded-xl border p-xl lg:flex-row", children: [_jsx("div", { className: "border-text-success-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-success-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(FileCheck02Icon, { className: "text-text-success-primary size-5" }) }) }), _jsxs("div", { children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Verification successful" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: "Your account has been successfully verified. You now have full access to all features and improved account security." })] })] }));
35
+ }
36
+ function VerificationFailed() {
37
+ return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 flex flex-col gap-2 rounded-xl border p-xl lg:flex-row", children: [_jsx("div", { className: "border-text-error-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-error-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(FileX02Icon, { className: "text-text-error-primary size-5" }) }) }), _jsxs("div", { children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Verification failed" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: "There was an issue with the verification process. Please try again or contact support for assistance." })] })] }));
38
+ }