@cedros/login-react 0.0.41 → 0.0.42

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 (128) hide show
  1. package/dist/{AuthenticationSettings-D4ExU-2a.js → AuthenticationSettings-CheE3j7w.js} +1 -1
  2. package/dist/{AuthenticationSettings-D4ExU-2a.js.map → AuthenticationSettings-CheE3j7w.js.map} +1 -1
  3. package/dist/{AuthenticationSettings-Cu5Z2mTC.cjs → AuthenticationSettings-Dl41GbJL.cjs} +1 -1
  4. package/dist/{AuthenticationSettings-Cu5Z2mTC.cjs.map → AuthenticationSettings-Dl41GbJL.cjs.map} +1 -1
  5. package/dist/{AuthenticationSettings-CSoFp-_2.js → AuthenticationSettings-DwSxgjbH.js} +1 -1
  6. package/dist/{AuthenticationSettings-CSoFp-_2.js.map → AuthenticationSettings-DwSxgjbH.js.map} +1 -1
  7. package/dist/{AuthenticationSettings-DABzZHuI.cjs → AuthenticationSettings-JxHsBst9.cjs} +1 -1
  8. package/dist/{AuthenticationSettings-DABzZHuI.cjs.map → AuthenticationSettings-JxHsBst9.cjs.map} +1 -1
  9. package/dist/AutosaveStatus-BMXjH1XN.cjs +1 -0
  10. package/dist/AutosaveStatus-BMXjH1XN.cjs.map +1 -0
  11. package/dist/{AutosaveStatus-DMjvXzP2.js → AutosaveStatus-DNuCl59W.js} +578 -284
  12. package/dist/AutosaveStatus-DNuCl59W.js.map +1 -0
  13. package/dist/{CreditSystemSettings-DfSfQVE8.cjs → CreditSystemSettings-BVgl6uUg.cjs} +1 -1
  14. package/dist/{CreditSystemSettings-DfSfQVE8.cjs.map → CreditSystemSettings-BVgl6uUg.cjs.map} +1 -1
  15. package/dist/{CreditSystemSettings-Du3ac0ID.js → CreditSystemSettings-C-ksysSx.js} +1 -1
  16. package/dist/{CreditSystemSettings-Du3ac0ID.js.map → CreditSystemSettings-C-ksysSx.js.map} +1 -1
  17. package/dist/{CreditSystemSettings-BjQdysRS.js → CreditSystemSettings-HSdF2_CY.js} +1 -1
  18. package/dist/{CreditSystemSettings-BjQdysRS.js.map → CreditSystemSettings-HSdF2_CY.js.map} +1 -1
  19. package/dist/{CreditSystemSettings-BWuiRTtA.cjs → CreditSystemSettings-LvA8rb17.cjs} +1 -1
  20. package/dist/{CreditSystemSettings-BWuiRTtA.cjs.map → CreditSystemSettings-LvA8rb17.cjs.map} +1 -1
  21. package/dist/{EmailRegisterForm-CMXsa-_r.js → EmailRegisterForm-p2X5QP58.js} +147 -147
  22. package/dist/EmailRegisterForm-p2X5QP58.js.map +1 -0
  23. package/dist/EmailRegisterForm-xFb6MaVA.cjs +1 -0
  24. package/dist/EmailRegisterForm-xFb6MaVA.cjs.map +1 -0
  25. package/dist/{EmailSettings-CjngJwDS.js → EmailSettings-Cy1cuVUq.js} +1 -1
  26. package/dist/{EmailSettings-CjngJwDS.js.map → EmailSettings-Cy1cuVUq.js.map} +1 -1
  27. package/dist/{EmailSettings-BcHo0cqk.cjs → EmailSettings-DC_zT4nI.cjs} +1 -1
  28. package/dist/{EmailSettings-BcHo0cqk.cjs.map → EmailSettings-DC_zT4nI.cjs.map} +1 -1
  29. package/dist/{EmailSettings-CswtKXhb.cjs → EmailSettings-QBMzpbxv.cjs} +1 -1
  30. package/dist/{EmailSettings-CswtKXhb.cjs.map → EmailSettings-QBMzpbxv.cjs.map} +1 -1
  31. package/dist/{EmailSettings-ASDHfI0K.js → EmailSettings-hIhJzux0.js} +1 -1
  32. package/dist/{EmailSettings-ASDHfI0K.js.map → EmailSettings-hIhJzux0.js.map} +1 -1
  33. package/dist/{EmbeddedWalletSettings-BkwIbTkL.cjs → EmbeddedWalletSettings-4qC9KBwh.cjs} +1 -1
  34. package/dist/{EmbeddedWalletSettings-BkwIbTkL.cjs.map → EmbeddedWalletSettings-4qC9KBwh.cjs.map} +1 -1
  35. package/dist/{EmbeddedWalletSettings-BXlboZ9-.cjs → EmbeddedWalletSettings-C81QQMWz.cjs} +1 -1
  36. package/dist/{EmbeddedWalletSettings-BXlboZ9-.cjs.map → EmbeddedWalletSettings-C81QQMWz.cjs.map} +1 -1
  37. package/dist/{EmbeddedWalletSettings-CPLbqlxJ.js → EmbeddedWalletSettings-CvvTnRvt.js} +1 -1
  38. package/dist/{EmbeddedWalletSettings-CPLbqlxJ.js.map → EmbeddedWalletSettings-CvvTnRvt.js.map} +1 -1
  39. package/dist/{EmbeddedWalletSettings-CUY_X7Vj.js → EmbeddedWalletSettings-Cwiug0vR.js} +1 -1
  40. package/dist/{EmbeddedWalletSettings-CUY_X7Vj.js.map → EmbeddedWalletSettings-Cwiug0vR.js.map} +1 -1
  41. package/dist/GoogleLoginButton-2zNTIKMm.cjs +1 -0
  42. package/dist/GoogleLoginButton-2zNTIKMm.cjs.map +1 -0
  43. package/dist/{GoogleLoginButton-qf4A_A3G.js → GoogleLoginButton-C1WNu7W3.js} +41 -40
  44. package/dist/GoogleLoginButton-C1WNu7W3.js.map +1 -0
  45. package/dist/LoadingSpinner-6vml-zwr.js.map +1 -1
  46. package/dist/LoadingSpinner-d6sSxgQN.cjs.map +1 -1
  47. package/dist/{PermissionsSection-BeFhIgQy.js → PermissionsSection-BDDiEfho.js} +81 -77
  48. package/dist/{PermissionsSection-BeFhIgQy.js.map → PermissionsSection-BDDiEfho.js.map} +1 -1
  49. package/dist/PermissionsSection-CSB_Ikj9.cjs +1 -0
  50. package/dist/{PermissionsSection-B-6DJnN8.cjs.map → PermissionsSection-CSB_Ikj9.cjs.map} +1 -1
  51. package/dist/{ServerSettings-BygCxOTY.cjs → ServerSettings-BV0SipW1.cjs} +1 -1
  52. package/dist/{ServerSettings-BygCxOTY.cjs.map → ServerSettings-BV0SipW1.cjs.map} +1 -1
  53. package/dist/{ServerSettings-CgBdYspU.cjs → ServerSettings-Bf7gFE8r.cjs} +1 -1
  54. package/dist/{ServerSettings-CgBdYspU.cjs.map → ServerSettings-Bf7gFE8r.cjs.map} +1 -1
  55. package/dist/{ServerSettings-BLoWX7KG.js → ServerSettings-DPqHtsgV.js} +1 -1
  56. package/dist/{ServerSettings-BLoWX7KG.js.map → ServerSettings-DPqHtsgV.js.map} +1 -1
  57. package/dist/{ServerSettings-B9PNMse1.js → ServerSettings-Sfr0CG6K.js} +1 -1
  58. package/dist/{ServerSettings-B9PNMse1.js.map → ServerSettings-Sfr0CG6K.js.map} +1 -1
  59. package/dist/SolanaLoginButton-CqdzSSeJ.cjs +1 -0
  60. package/dist/SolanaLoginButton-CqdzSSeJ.cjs.map +1 -0
  61. package/dist/{SolanaLoginButton-B04dib6X.js → SolanaLoginButton-CyeX35eU.js} +41 -40
  62. package/dist/SolanaLoginButton-CyeX35eU.js.map +1 -0
  63. package/dist/{TeamSection-DbSYDRdI.js → TeamSection-BhsBEckR.js} +1 -1
  64. package/dist/{TeamSection-DbSYDRdI.js.map → TeamSection-BhsBEckR.js.map} +1 -1
  65. package/dist/{TeamSection-B1t1tU-_.cjs → TeamSection-DLxtRmta.cjs} +1 -1
  66. package/dist/{TeamSection-B1t1tU-_.cjs.map → TeamSection-DLxtRmta.cjs.map} +1 -1
  67. package/dist/{UsersSection-C7aRNkK2.cjs → UsersSection-BEKfbhQ4.cjs} +1 -1
  68. package/dist/{UsersSection-C7aRNkK2.cjs.map → UsersSection-BEKfbhQ4.cjs.map} +1 -1
  69. package/dist/{UsersSection--PAE1XRh.js → UsersSection-DbGkmxty.js} +1 -1
  70. package/dist/{UsersSection--PAE1XRh.js.map → UsersSection-DbGkmxty.js.map} +1 -1
  71. package/dist/{WebhookSettings-D19u9Uok.cjs → WebhookSettings-BPCKv5Or.cjs} +1 -1
  72. package/dist/{WebhookSettings-D19u9Uok.cjs.map → WebhookSettings-BPCKv5Or.cjs.map} +1 -1
  73. package/dist/{WebhookSettings-C923ZSKa.js → WebhookSettings-CMROMCFT.js} +1 -1
  74. package/dist/{WebhookSettings-C923ZSKa.js.map → WebhookSettings-CMROMCFT.js.map} +1 -1
  75. package/dist/{WebhookSettings-CbU3cfTJ.cjs → WebhookSettings-Cj-iELGa.cjs} +1 -1
  76. package/dist/{WebhookSettings-CbU3cfTJ.cjs.map → WebhookSettings-Cj-iELGa.cjs.map} +1 -1
  77. package/dist/{WebhookSettings-C-7Yxueu.js → WebhookSettings-D4mKAWAg.js} +1 -1
  78. package/dist/{WebhookSettings-C-7Yxueu.js.map → WebhookSettings-D4mKAWAg.js.map} +1 -1
  79. package/dist/admin-only.cjs +1 -1
  80. package/dist/admin-only.js +1 -1
  81. package/dist/email-only.cjs +1 -1
  82. package/dist/email-only.d.ts +6 -0
  83. package/dist/email-only.js +2 -2
  84. package/dist/google-only.cjs +1 -1
  85. package/dist/google-only.d.ts +6 -0
  86. package/dist/google-only.js +2 -2
  87. package/dist/index.cjs +13 -13
  88. package/dist/index.cjs.map +1 -1
  89. package/dist/index.d.ts +411 -1
  90. package/dist/index.js +5175 -4054
  91. package/dist/index.js.map +1 -1
  92. package/dist/plugin-BHGg7ius.cjs +1 -0
  93. package/dist/plugin-BHGg7ius.cjs.map +1 -0
  94. package/dist/{plugin-BiftIhZe.js → plugin-CK2d7aP5.js} +3 -2
  95. package/dist/plugin-CK2d7aP5.js.map +1 -0
  96. package/dist/solana-only.cjs +1 -1
  97. package/dist/solana-only.d.ts +6 -0
  98. package/dist/solana-only.js +2 -2
  99. package/dist/useAuth-B1yS_YiD.cjs +1 -0
  100. package/dist/{useAuth-U5CYsHEU.cjs.map → useAuth-B1yS_YiD.cjs.map} +1 -1
  101. package/dist/{useAuth-C-Vw-ggy.js → useAuth-l-itM5am.js} +440 -433
  102. package/dist/{useAuth-C-Vw-ggy.js.map → useAuth-l-itM5am.js.map} +1 -1
  103. package/dist/useUsersStatsSummary-9HQDKBU5.js +1879 -0
  104. package/dist/useUsersStatsSummary-9HQDKBU5.js.map +1 -0
  105. package/dist/useUsersStatsSummary-DiRC8sGs.cjs +1 -0
  106. package/dist/useUsersStatsSummary-DiRC8sGs.cjs.map +1 -0
  107. package/package.json +1 -1
  108. package/dist/AutosaveStatus-B1A1zORa.cjs +0 -1
  109. package/dist/AutosaveStatus-B1A1zORa.cjs.map +0 -1
  110. package/dist/AutosaveStatus-DMjvXzP2.js.map +0 -1
  111. package/dist/EmailRegisterForm-CMXsa-_r.js.map +0 -1
  112. package/dist/EmailRegisterForm-i7f4St2N.cjs +0 -1
  113. package/dist/EmailRegisterForm-i7f4St2N.cjs.map +0 -1
  114. package/dist/GoogleLoginButton-JtRViYWS.cjs +0 -1
  115. package/dist/GoogleLoginButton-JtRViYWS.cjs.map +0 -1
  116. package/dist/GoogleLoginButton-qf4A_A3G.js.map +0 -1
  117. package/dist/PermissionsSection-B-6DJnN8.cjs +0 -1
  118. package/dist/SolanaLoginButton-B04dib6X.js.map +0 -1
  119. package/dist/SolanaLoginButton-nSJHVFpZ.cjs +0 -1
  120. package/dist/SolanaLoginButton-nSJHVFpZ.cjs.map +0 -1
  121. package/dist/plugin-BiftIhZe.js.map +0 -1
  122. package/dist/plugin-BtQdI_Ay.cjs +0 -1
  123. package/dist/plugin-BtQdI_Ay.cjs.map +0 -1
  124. package/dist/useAuth-U5CYsHEU.cjs +0 -1
  125. package/dist/useUsersStatsSummary-5DJwzntC.js +0 -1246
  126. package/dist/useUsersStatsSummary-5DJwzntC.js.map +0 -1
  127. package/dist/useUsersStatsSummary-DgKaUIfs.cjs +0 -1
  128. package/dist/useUsersStatsSummary-DgKaUIfs.cjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUsersStatsSummary-9HQDKBU5.js","sources":["../src/utils/adminUserApi.ts","../src/hooks/useAdminUsers.ts","../src/components/admin/AdminUserList.tsx","../src/components/admin/AdminUserDetail.tsx","../src/components/admin/hooks/useUsersStatsSummary.ts"],"sourcesContent":["import type {\n AdminReferredUsersResponse,\n AdminUser,\n AdminUserChatsResponse,\n AdminUserCreditsResponse,\n AdminUserKycResponse,\n AdminUserStatsResponse,\n AdjustCreditsRequest,\n ListAdminUsersResponse,\n ListUsersParams,\n UpdateUserRequest,\n} from '../types';\nimport type { AdminUserAccreditationResponse } from '../types/accreditation';\nimport type {\n AdminDepositListResponse,\n AdminUserWithdrawalHistoryResponse,\n} from '../types/deposit';\nimport { ApiClient, handleApiError } from './apiClient';\n\n/**\n * API client for admin user operations\n *\n * Requires system admin privileges.\n */\nexport class AdminUserApiClient {\n private client: ApiClient;\n\n constructor(\n baseUrl: string,\n timeoutMs?: number,\n retryAttempts?: number,\n getAccessToken?: () => string | null\n ) {\n this.client = new ApiClient({ baseUrl, timeoutMs, retryAttempts, getAccessToken });\n }\n\n /**\n * List all users in the system\n */\n async listUsers(params?: ListUsersParams): Promise<ListAdminUsersResponse> {\n try {\n const query = new URLSearchParams();\n if (params?.limit) query.set('limit', String(params.limit));\n if (params?.offset) query.set('offset', String(params.offset));\n const queryString = query.toString();\n const url = `/admin/users${queryString ? `?${queryString}` : ''}`;\n return await this.client.get<ListAdminUsersResponse>(url);\n } catch (error) {\n throw handleApiError(error, 'Failed to list users');\n }\n }\n\n /**\n * Get a specific user by ID\n */\n async getUser(userId: string): Promise<AdminUser> {\n try {\n return await this.client.get<AdminUser>(`/admin/users/${userId}`);\n } catch (error) {\n throw handleApiError(error, 'Failed to get user');\n }\n }\n\n /**\n * Set a user's system admin status\n */\n async setSystemAdmin(userId: string, isAdmin: boolean): Promise<void> {\n try {\n await this.client.patch(`/admin/users/${userId}/system-admin`, { isAdmin });\n } catch (error) {\n throw handleApiError(error, 'Failed to update system admin status');\n }\n }\n\n /**\n * Update a user's profile\n */\n async updateUser(userId: string, data: UpdateUserRequest): Promise<AdminUser> {\n try {\n return await this.client.patch<AdminUser>(`/admin/users/${userId}`, data);\n } catch (error) {\n throw handleApiError(error, 'Failed to update user');\n }\n }\n\n /**\n * Delete a user\n */\n async deleteUser(userId: string): Promise<void> {\n try {\n await this.client.delete(`/admin/users/${userId}`);\n } catch (error) {\n throw handleApiError(error, 'Failed to delete user');\n }\n }\n\n /**\n * Send a password reset email to a user\n */\n async forcePasswordReset(userId: string): Promise<void> {\n try {\n await this.client.post(`/admin/users/${userId}/force-password-reset`, {});\n } catch (error) {\n throw handleApiError(error, 'Failed to send password reset email');\n }\n }\n\n /**\n * Adjust a user's credits\n */\n async adjustCredits(userId: string, data: AdjustCreditsRequest): Promise<void> {\n try {\n await this.client.post(`/admin/users/${userId}/credits`, data);\n } catch (error) {\n throw handleApiError(error, 'Failed to adjust credits');\n }\n }\n\n /**\n * Get a user's deposit history\n */\n async getUserDeposits(\n userId: string,\n params?: ListUsersParams\n ): Promise<AdminDepositListResponse> {\n try {\n const query = new URLSearchParams();\n if (params?.limit) query.set('limit', String(params.limit));\n if (params?.offset) query.set('offset', String(params.offset));\n const queryString = query.toString();\n const url = `/admin/users/${userId}/deposits${queryString ? `?${queryString}` : ''}`;\n return await this.client.get<AdminDepositListResponse>(url);\n } catch (error) {\n throw handleApiError(error, 'Failed to get user deposits');\n }\n }\n\n /**\n * Get a user's credit stats and transaction history\n */\n async getUserCredits(\n userId: string,\n params?: ListUsersParams\n ): Promise<AdminUserCreditsResponse> {\n try {\n const query = new URLSearchParams();\n if (params?.limit) query.set('limit', String(params.limit));\n if (params?.offset) query.set('offset', String(params.offset));\n const queryString = query.toString();\n const url = `/admin/users/${userId}/credits${queryString ? `?${queryString}` : ''}`;\n return await this.client.get<AdminUserCreditsResponse>(url);\n } catch (error) {\n throw handleApiError(error, 'Failed to get user credits');\n }\n }\n\n /**\n * Get a user's withdrawal history\n */\n async getUserWithdrawalHistory(\n userId: string,\n params?: ListUsersParams\n ): Promise<AdminUserWithdrawalHistoryResponse> {\n try {\n const query = new URLSearchParams();\n if (params?.limit) query.set('limit', String(params.limit));\n if (params?.offset) query.set('offset', String(params.offset));\n const queryString = query.toString();\n const url = `/admin/users/${userId}/withdrawal-history${queryString ? `?${queryString}` : ''}`;\n return await this.client.get<AdminUserWithdrawalHistoryResponse>(url);\n } catch (error) {\n throw handleApiError(error, 'Failed to get user withdrawal history');\n }\n }\n\n /**\n * Get a user's chat history (from cedros-pay)\n * Only available when cedros-pay is enabled.\n */\n async getUserChats(userId: string, params?: ListUsersParams): Promise<AdminUserChatsResponse> {\n try {\n const query = new URLSearchParams();\n if (params?.limit) query.set('limit', String(params.limit));\n if (params?.offset) query.set('offset', String(params.offset));\n const queryString = query.toString();\n const url = `/admin/users/${userId}/chats${queryString ? `?${queryString}` : ''}`;\n return await this.client.get<AdminUserChatsResponse>(url);\n } catch (error) {\n throw handleApiError(error, 'Failed to get user chat history');\n }\n }\n\n /**\n * Get the list of users directly referred by a given user\n */\n async getUserReferrals(\n userId: string,\n params?: ListUsersParams\n ): Promise<AdminReferredUsersResponse> {\n try {\n const query = new URLSearchParams();\n if (params?.limit) query.set('limit', String(params.limit));\n if (params?.offset) query.set('offset', String(params.offset));\n const queryString = query.toString();\n const url = `/admin/users/${userId}/referrals${queryString ? `?${queryString}` : ''}`;\n return await this.client.get<AdminReferredUsersResponse>(url);\n } catch (error) {\n throw handleApiError(error, 'Failed to get user referrals');\n }\n }\n\n /**\n * Get a user's KYC status and session history\n */\n async getUserKyc(userId: string): Promise<AdminUserKycResponse> {\n try {\n return await this.client.get<AdminUserKycResponse>(`/admin/users/${userId}/kyc`);\n } catch (error) {\n throw handleApiError(error, 'Failed to get user KYC data');\n }\n }\n\n /**\n * Override a user's KYC status (system admin only)\n *\n * @param userId - target user ID\n * @param status - new status: \"none\" | \"verified\" | \"failed\"\n */\n async overrideUserKyc(userId: string, status: string): Promise<void> {\n try {\n await this.client.post(`/admin/users/${userId}/kyc/override`, { status });\n } catch (error) {\n throw handleApiError(error, 'Failed to override KYC status');\n }\n }\n\n /**\n * Get a user's accreditation status and submission history\n */\n async getUserAccreditation(userId: string): Promise<AdminUserAccreditationResponse> {\n try {\n return await this.client.get<AdminUserAccreditationResponse>(\n `/admin/users/${userId}/accreditation`\n );\n } catch (error) {\n throw handleApiError(error, 'Failed to get user accreditation data');\n }\n }\n\n /**\n * Review an accreditation submission (approve or reject).\n *\n * @param submissionId - target submission ID\n * @param approved - true to approve, false to reject\n * @param reviewerNotes - optional internal notes\n * @param rejectionReason - required when approved is false\n * @param expiryDays - override default expiry (approve only)\n */\n async reviewAccreditation(\n submissionId: string,\n approved: boolean,\n reviewerNotes?: string,\n rejectionReason?: string,\n expiryDays?: number\n ): Promise<void> {\n try {\n await this.client.post(`/admin/accreditation/${submissionId}/review`, {\n approved,\n reviewerNotes,\n rejectionReason,\n expiryDays,\n });\n } catch (error) {\n throw handleApiError(error, 'Failed to review accreditation submission');\n }\n }\n\n /**\n * Override a user's accreditation status (system admin only).\n *\n * @param userId - target user ID\n * @param status - new status: \"none\" | \"approved\" | \"rejected\"\n */\n async overrideAccreditationStatus(userId: string, status: string): Promise<void> {\n try {\n await this.client.post(`/admin/users/${userId}/accreditation/override`, { status });\n } catch (error) {\n throw handleApiError(error, 'Failed to override accreditation status');\n }\n }\n\n /**\n * Get user statistics by auth method\n */\n async getStats(): Promise<AdminUserStatsResponse> {\n try {\n return await this.client.get<AdminUserStatsResponse>('/admin/users/stats');\n } catch (error) {\n throw handleApiError(error, 'Failed to get user stats');\n }\n }\n}\n","import { useState, useCallback, useMemo } from 'react';\nimport { useCedrosLogin } from '../context/useCedrosLogin';\nimport { AdminUserApiClient } from '../utils/adminUserApi';\nimport type {\n AdminReferredUsersResponse,\n AdminUser,\n AdminUserChatsResponse,\n AdminUserCreditsResponse,\n AdminUserStatsResponse,\n ListAdminUsersResponse,\n ListUsersParams,\n UpdateUserRequest,\n UseAdminUsersReturn,\n} from '../types';\nimport type {\n AdminDepositListResponse,\n AdminUserWithdrawalHistoryResponse,\n} from '../types/deposit';\n\n/**\n * Hook for admin user management operations\n *\n * Provides methods to list all users, get individual users,\n * and manage system admin status. Requires system admin privileges.\n *\n * @example\n * ```tsx\n * function UserManagement() {\n * const { users, total, isLoading, listUsers, setSystemAdmin } = useAdminUsers();\n *\n * useEffect(() => {\n * listUsers({ limit: 20 });\n * }, [listUsers]);\n *\n * return (\n * <AdminUserList\n * users={users}\n * total={total}\n * isLoading={isLoading}\n * onToggleAdmin={(userId, isAdmin) => setSystemAdmin(userId, isAdmin)}\n * />\n * );\n * }\n * ```\n */\nexport function useAdminUsers(): UseAdminUsersReturn {\n const { config, _internal } = useCedrosLogin();\n\n const [users, setUsers] = useState<AdminUser[]>([]);\n const [total, setTotal] = useState(0);\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n const [lastParams, setLastParams] = useState<ListUsersParams>({});\n\n const apiClient = useMemo(\n () =>\n new AdminUserApiClient(\n config.serverUrl,\n config.requestTimeout,\n config.retryAttempts,\n _internal?.getAccessToken\n ),\n [config.serverUrl, config.requestTimeout, config.retryAttempts, _internal]\n );\n\n const listUsers = useCallback(\n async (params?: ListUsersParams): Promise<ListAdminUsersResponse> => {\n setIsLoading(true);\n setError(null);\n setLastParams(params || {});\n\n try {\n const response = await apiClient.listUsers(params);\n setUsers(response.users);\n setTotal(response.total);\n return response;\n } catch (err) {\n const error = err instanceof Error ? err : new Error('Failed to list users');\n setError(error);\n throw error;\n } finally {\n setIsLoading(false);\n }\n },\n [apiClient]\n );\n\n const getUser = useCallback(\n async (userId: string): Promise<AdminUser> => {\n setIsLoading(true);\n setError(null);\n\n try {\n return await apiClient.getUser(userId);\n } catch (err) {\n const error = err instanceof Error ? err : new Error('Failed to get user');\n setError(error);\n throw error;\n } finally {\n setIsLoading(false);\n }\n },\n [apiClient]\n );\n\n const setSystemAdmin = useCallback(\n async (userId: string, isAdmin: boolean): Promise<void> => {\n setIsLoading(true);\n setError(null);\n\n try {\n await apiClient.setSystemAdmin(userId, isAdmin);\n // Update local state\n setUsers((prev) =>\n prev.map((user) => (user.id === userId ? { ...user, isSystemAdmin: isAdmin } : user))\n );\n } catch (err) {\n const error = err instanceof Error ? err : new Error('Failed to update admin status');\n setError(error);\n throw error;\n } finally {\n setIsLoading(false);\n }\n },\n [apiClient]\n );\n\n const updateUser = useCallback(\n async (userId: string, data: UpdateUserRequest): Promise<AdminUser> => {\n setIsLoading(true);\n setError(null);\n\n try {\n const updated = await apiClient.updateUser(userId, data);\n // Update local state\n setUsers((prev) => prev.map((user) => (user.id === userId ? updated : user)));\n return updated;\n } catch (err) {\n const error = err instanceof Error ? err : new Error('Failed to update user');\n setError(error);\n throw error;\n } finally {\n setIsLoading(false);\n }\n },\n [apiClient]\n );\n\n const deleteUser = useCallback(\n async (userId: string): Promise<void> => {\n setIsLoading(true);\n setError(null);\n\n try {\n await apiClient.deleteUser(userId);\n // Remove from local state\n setUsers((prev) => prev.filter((user) => user.id !== userId));\n setTotal((prev) => prev - 1);\n } catch (err) {\n const error = err instanceof Error ? err : new Error('Failed to delete user');\n setError(error);\n throw error;\n } finally {\n setIsLoading(false);\n }\n },\n [apiClient]\n );\n\n const forcePasswordReset = useCallback(\n async (userId: string): Promise<void> => {\n setIsLoading(true);\n setError(null);\n\n try {\n await apiClient.forcePasswordReset(userId);\n } catch (err) {\n const error = err instanceof Error ? err : new Error('Failed to send password reset');\n setError(error);\n throw error;\n } finally {\n setIsLoading(false);\n }\n },\n [apiClient]\n );\n\n const adjustCredits = useCallback(\n async (userId: string, amount: number, reason: string): Promise<void> => {\n setIsLoading(true);\n setError(null);\n\n try {\n await apiClient.adjustCredits(userId, { amount, reason });\n } catch (err) {\n const error = err instanceof Error ? err : new Error('Failed to adjust credits');\n setError(error);\n throw error;\n } finally {\n setIsLoading(false);\n }\n },\n [apiClient]\n );\n\n const getUserDeposits = useCallback(\n async (userId: string, params?: ListUsersParams): Promise<AdminDepositListResponse> => {\n setIsLoading(true);\n setError(null);\n\n try {\n return await apiClient.getUserDeposits(userId, params);\n } catch (err) {\n const error = err instanceof Error ? err : new Error('Failed to get user deposits');\n setError(error);\n throw error;\n } finally {\n setIsLoading(false);\n }\n },\n [apiClient]\n );\n\n const getUserCredits = useCallback(\n async (userId: string, params?: ListUsersParams): Promise<AdminUserCreditsResponse> => {\n setIsLoading(true);\n setError(null);\n\n try {\n return await apiClient.getUserCredits(userId, params);\n } catch (err) {\n const error = err instanceof Error ? err : new Error('Failed to get user credits');\n setError(error);\n throw error;\n } finally {\n setIsLoading(false);\n }\n },\n [apiClient]\n );\n\n const getUserWithdrawalHistory = useCallback(\n async (\n userId: string,\n params?: ListUsersParams\n ): Promise<AdminUserWithdrawalHistoryResponse> => {\n setIsLoading(true);\n setError(null);\n\n try {\n return await apiClient.getUserWithdrawalHistory(userId, params);\n } catch (err) {\n const error =\n err instanceof Error ? err : new Error('Failed to get user withdrawal history');\n setError(error);\n throw error;\n } finally {\n setIsLoading(false);\n }\n },\n [apiClient]\n );\n\n const getUserChats = useCallback(\n async (userId: string, params?: ListUsersParams): Promise<AdminUserChatsResponse> => {\n setIsLoading(true);\n setError(null);\n\n try {\n return await apiClient.getUserChats(userId, params);\n } catch (err) {\n const error = err instanceof Error ? err : new Error('Failed to get user chat history');\n setError(error);\n throw error;\n } finally {\n setIsLoading(false);\n }\n },\n [apiClient]\n );\n\n const getUserReferrals = useCallback(\n async (userId: string, params?: ListUsersParams): Promise<AdminReferredUsersResponse> => {\n setIsLoading(true);\n setError(null);\n\n try {\n return await apiClient.getUserReferrals(userId, params);\n } catch (err) {\n const error = err instanceof Error ? err : new Error('Failed to get user referrals');\n setError(error);\n throw error;\n } finally {\n setIsLoading(false);\n }\n },\n [apiClient]\n );\n\n const getStats = useCallback(async (): Promise<AdminUserStatsResponse> => {\n setIsLoading(true);\n setError(null);\n\n try {\n return await apiClient.getStats();\n } catch (err) {\n const error = err instanceof Error ? err : new Error('Failed to get user stats');\n setError(error);\n throw error;\n } finally {\n setIsLoading(false);\n }\n }, [apiClient]);\n\n const refresh = useCallback(async () => {\n await listUsers(lastParams);\n }, [listUsers, lastParams]);\n\n const clearError = useCallback(() => {\n setError(null);\n }, []);\n\n return {\n users,\n total,\n isLoading,\n error,\n listUsers,\n getUser,\n setSystemAdmin,\n updateUser,\n deleteUser,\n forcePasswordReset,\n adjustCredits,\n getUserDeposits,\n getUserCredits,\n getUserWithdrawalHistory,\n getUserChats,\n getUserReferrals,\n getStats,\n refresh,\n clearError,\n };\n}\n","/**\n * Admin user list component\n *\n * Displays all registered users in the system with management actions.\n * Requires system admin privileges.\n */\n\nimport { useState, useEffect, useCallback, useMemo } from 'react';\nimport { useAdminUsers } from '../../hooks/useAdminUsers';\nimport type { AdminUser, ListAdminUsersResponse } from '../../types';\n\ntype SortField = 'name' | 'createdAt' | 'lastLoginAt' | 'balanceLamports';\ntype SortOrder = 'asc' | 'desc';\n\nexport interface AdminUserListProps {\n /** Number of items per page (default: 20) */\n pageSize?: number;\n /** Auto-refresh interval in milliseconds (0 to disable) */\n refreshInterval?: number;\n /** Current user's ID (to highlight current user) */\n currentUserId?: string;\n /** Additional CSS classes */\n className?: string;\n /** Callback when list is loaded */\n onLoad?: (response: ListAdminUsersResponse) => void;\n /** Callback when a user is clicked */\n onUserClick?: (user: AdminUser) => void;\n}\n\nfunction formatDate(dateString: string): string {\n const date = new Date(dateString);\n return date.toLocaleDateString(undefined, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n });\n}\n\nfunction truncateId(id: string): string {\n if (id.length <= 12) return id;\n return `${id.slice(0, 6)}...${id.slice(-4)}`;\n}\n\nfunction formatBalance(lamports: number | undefined): string {\n if (lamports === undefined || lamports === null) return '-';\n // Convert lamports to SOL (1 SOL = 1,000,000,000 lamports)\n const sol = lamports / 1_000_000_000;\n return sol.toFixed(4);\n}\n\n/**\n * Admin user list display\n *\n * Shows all registered users.\n */\nexport function AdminUserList({\n pageSize = 20,\n refreshInterval = 0,\n currentUserId,\n className = '',\n onLoad,\n onUserClick,\n}: AdminUserListProps) {\n const { users, total, isLoading, error, listUsers, clearError } = useAdminUsers();\n\n const [offset, setOffset] = useState(0);\n const [loadError, setLoadError] = useState<string | null>(null);\n const [sortField, setSortField] = useState<SortField>('createdAt');\n const [sortOrder, setSortOrder] = useState<SortOrder>('desc');\n\n const toggleSort = (field: SortField) => {\n if (sortField === field) {\n setSortOrder(sortOrder === 'asc' ? 'desc' : 'asc');\n } else {\n setSortField(field);\n setSortOrder('desc');\n }\n };\n\n // P-05: Client-side sort applies only to the current page of results.\n // For cross-page sorting, add server-side ORDER BY with sort parameters.\n const sortedUsers = useMemo(() => {\n return [...users].sort((a, b) => {\n let aVal: string | number | null;\n let bVal: string | number | null;\n\n switch (sortField) {\n case 'name':\n aVal = (a.name || a.email || '').toLowerCase();\n bVal = (b.name || b.email || '').toLowerCase();\n break;\n case 'createdAt':\n aVal = new Date(a.createdAt).getTime();\n bVal = new Date(b.createdAt).getTime();\n break;\n case 'lastLoginAt':\n aVal = a.lastLoginAt ? new Date(a.lastLoginAt).getTime() : 0;\n bVal = b.lastLoginAt ? new Date(b.lastLoginAt).getTime() : 0;\n break;\n case 'balanceLamports':\n aVal = a.balanceLamports ?? 0;\n bVal = b.balanceLamports ?? 0;\n break;\n default:\n return 0;\n }\n\n if (aVal < bVal) return sortOrder === 'asc' ? -1 : 1;\n if (aVal > bVal) return sortOrder === 'asc' ? 1 : -1;\n return 0;\n });\n }, [users, sortField, sortOrder]);\n\n const fetchUsers = useCallback(async () => {\n try {\n const result = await listUsers({ limit: pageSize, offset });\n onLoad?.(result);\n setLoadError(null);\n } catch (err) {\n setLoadError(err instanceof Error ? err.message : 'Failed to load users');\n }\n }, [pageSize, offset, listUsers, onLoad]);\n\n // Reset offset when page size changes\n useEffect(() => {\n setOffset(0);\n }, [pageSize]);\n\n // Fetch on mount and when dependencies change\n useEffect(() => {\n fetchUsers();\n }, [fetchUsers]);\n\n // Auto-refresh\n useEffect(() => {\n if (refreshInterval <= 0) return;\n\n const interval = setInterval(fetchUsers, refreshInterval);\n return () => clearInterval(interval);\n }, [refreshInterval, fetchUsers]);\n\n const totalPages = Math.ceil(total / pageSize);\n const currentPage = Math.floor(offset / pageSize) + 1;\n\n const goToPage = (page: number) => {\n const newOffset = (page - 1) * pageSize;\n setOffset(Math.max(0, Math.min(newOffset, Math.max(0, total - 1))));\n };\n\n // Error state\n if (loadError || error) {\n return (\n <div className={`cedros-admin-user-list cedros-admin-user-list-error ${className}`}>\n <p className=\"cedros-admin-error\">{loadError || error?.message}</p>\n <button\n type=\"button\"\n className=\"cedros-button cedros-button-outline\"\n onClick={() => {\n clearError();\n setLoadError(null);\n fetchUsers();\n }}\n >\n Retry\n </button>\n </div>\n );\n }\n\n // Loading state (initial load only)\n if (isLoading && users.length === 0) {\n return (\n <div className={`cedros-admin-user-list cedros-admin-user-list-loading ${className}`}>\n <span className=\"cedros-admin-loading-indicator\" />\n <span className=\"cedros-admin-loading-text\">Loading users...</span>\n </div>\n );\n }\n\n return (\n <div className={`cedros-admin-user-list ${className}`}>\n <div className=\"cedros-admin-user-list-header\">\n <h4 className=\"cedros-admin-user-list-title\">All Users</h4>\n <div className=\"cedros-admin-user-list-actions\">\n <span className=\"cedros-admin-queue-count\">\n {total} user{total !== 1 ? 's' : ''}\n </span>\n <button\n type=\"button\"\n className=\"cedros-admin__stats-bar-refresh\"\n onClick={fetchUsers}\n disabled={isLoading}\n title=\"Refresh list\"\n aria-label=\"Refresh list\"\n >\n {isLoading ? '...' : '↻'}\n </button>\n </div>\n </div>\n\n {users.length === 0 ? (\n <div className=\"cedros-admin-empty\">\n <p className=\"cedros-admin-empty-message\">No users found.</p>\n </div>\n ) : (\n <>\n <div className=\"cedros-admin-user-table\">\n <div className=\"cedros-admin-user-thead\">\n <div className=\"cedros-admin-user-th\">\n <button\n type=\"button\"\n className={`cedros-admin-sort-button ${sortField === 'name' ? 'cedros-admin-sort-active' : ''}`}\n onClick={() => toggleSort('name')}\n aria-label=\"Sort by user\"\n >\n User{' '}\n <span className=\"cedros-admin-sort-icon\">\n {sortField === 'name' ? (sortOrder === 'asc' ? '↑' : '↓') : '↕'}\n </span>\n </button>\n </div>\n <div className=\"cedros-admin-user-th\">\n <button\n type=\"button\"\n className={`cedros-admin-sort-button ${sortField === 'createdAt' ? 'cedros-admin-sort-active' : ''}`}\n onClick={() => toggleSort('createdAt')}\n aria-label=\"Sort by registered date\"\n >\n Registered{' '}\n <span className=\"cedros-admin-sort-icon\">\n {sortField === 'createdAt' ? (sortOrder === 'asc' ? '↑' : '↓') : '↕'}\n </span>\n </button>\n </div>\n <div className=\"cedros-admin-user-th\">\n <button\n type=\"button\"\n className={`cedros-admin-sort-button ${sortField === 'lastLoginAt' ? 'cedros-admin-sort-active' : ''}`}\n onClick={() => toggleSort('lastLoginAt')}\n aria-label=\"Sort by last login\"\n >\n Last Login{' '}\n <span className=\"cedros-admin-sort-icon\">\n {sortField === 'lastLoginAt' ? (sortOrder === 'asc' ? '↑' : '↓') : '↕'}\n </span>\n </button>\n </div>\n <div className=\"cedros-admin-user-th\">\n <button\n type=\"button\"\n className={`cedros-admin-sort-button ${sortField === 'balanceLamports' ? 'cedros-admin-sort-active' : ''}`}\n onClick={() => toggleSort('balanceLamports')}\n aria-label=\"Sort by balance\"\n >\n Balance{' '}\n <span className=\"cedros-admin-sort-icon\">\n {sortField === 'balanceLamports' ? (sortOrder === 'asc' ? '↑' : '↓') : '↕'}\n </span>\n </button>\n </div>\n </div>\n {sortedUsers.map((user) => {\n const isCurrentUser = user.id === currentUserId;\n\n return (\n <div\n key={user.id}\n className={`cedros-admin-user-row ${isCurrentUser ? 'cedros-admin-user-row-current' : ''}`}\n onClick={() => onUserClick?.(user)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onUserClick?.(user);\n }\n }}\n role={onUserClick ? 'button' : undefined}\n tabIndex={onUserClick ? 0 : undefined}\n >\n <div className=\"cedros-admin-user-td cedros-admin-user-info\">\n <div className=\"cedros-admin-user-avatar\">\n {user.picture ? (\n <img\n src={user.picture}\n alt={user.name || user.email || 'User'}\n className=\"cedros-admin-user-avatar-img\"\n referrerPolicy=\"no-referrer\"\n />\n ) : (\n <span className=\"cedros-admin-user-avatar-placeholder\">\n {(user.name?.[0] || user.email?.[0] || '?').toUpperCase()}\n </span>\n )}\n </div>\n <div className=\"cedros-admin-user-details\">\n <span className=\"cedros-admin-user-name\">\n {user.name || 'Unknown'}\n {isCurrentUser && <span className=\"cedros-admin-user-you\">(you)</span>}\n </span>\n <span className=\"cedros-admin-user-email\" title={user.email}>\n {user.email || truncateId(user.id)}\n </span>\n </div>\n </div>\n <div className=\"cedros-admin-user-td\">{formatDate(user.createdAt)}</div>\n <div className=\"cedros-admin-user-td\">\n {user.lastLoginAt ? formatDate(user.lastLoginAt) : '-'}\n </div>\n <div className=\"cedros-admin-user-td\">{formatBalance(user.balanceLamports)}</div>\n </div>\n );\n })}\n </div>\n\n {totalPages > 1 && (\n <div className=\"cedros-admin-pagination\">\n <button\n type=\"button\"\n className=\"cedros-button cedros-button-outline cedros-button-sm\"\n onClick={() => goToPage(currentPage - 1)}\n disabled={currentPage <= 1}\n >\n Previous\n </button>\n <span className=\"cedros-admin-page-info\">\n Page {currentPage} of {totalPages} ({total} total)\n </span>\n <button\n type=\"button\"\n className=\"cedros-button cedros-button-outline cedros-button-sm\"\n onClick={() => goToPage(currentPage + 1)}\n disabled={currentPage >= totalPages}\n >\n Next\n </button>\n </div>\n )}\n </>\n )}\n </div>\n );\n}\n","/**\n * Admin user detail component\n *\n * Displays detailed information about a specific user including:\n * - Account information (email, auth methods, admin status)\n * - Credit balance and stats\n * - Deposit history\n * - Transaction history\n *\n * Requires system admin privileges.\n */\n\nimport { useState, useEffect, useCallback, useMemo } from 'react';\nimport { useAdminUsers } from '../../hooks/useAdminUsers';\nimport type {\n AdminReferredUsersResponse,\n AdminUser,\n AdminUserCreditsResponse,\n AdminUserChatsResponse,\n AdminChatSession,\n AdminCreditTransactionItem,\n ListUsersParams,\n ReferredUserItem,\n} from '../../types';\nimport type { AdminDepositListResponse, AdminDepositItem } from '../../types/deposit';\nimport type { AdminUserKycResponse, AdminUserKycSession } from '../../types/adminUser';\nimport type {\n AdminUserAccreditationResponse,\n AccreditationSubmissionItem,\n} from '../../types/accreditation';\nimport { AdminUserApiClient } from '../../utils/adminUserApi';\nimport { useCedrosLogin } from '../../context/useCedrosLogin';\n\nexport interface AdminUserDetailProps {\n /** User ID to display */\n userId: string;\n /** Callback when back button is clicked */\n onBack: () => void;\n /** Current user's ID (to prevent self-demotion) */\n currentUserId?: string;\n /** Callback when edit is clicked (parent handles modal) */\n onEditUser?: (user: AdminUser) => void;\n /** Callback when credits adjustment is clicked (parent handles modal) */\n onAdjustCredits?: (user: AdminUser) => void;\n /** Whether cedros-pay is enabled (shows Chats tab) */\n cedrosPayEnabled?: boolean;\n /** Additional CSS classes */\n className?: string;\n}\n\ntype TabId = 'deposits' | 'transactions' | 'chats' | 'referrals' | 'kyc' | 'accreditation';\n\nfunction formatDate(dateString: string): string {\n const date = new Date(dateString);\n return date.toLocaleDateString(undefined, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n });\n}\n\nfunction formatDateTime(dateString: string): string {\n const date = new Date(dateString);\n return date.toLocaleString(undefined, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n });\n}\n\nfunction formatSol(lamports: number | null | undefined): string {\n if (lamports === null || lamports === undefined) return '—';\n const sol = lamports / 1_000_000_000;\n return `${sol.toFixed(4)} SOL`;\n}\n\nfunction formatCredits(lamports: number | null | undefined): string {\n if (lamports === null || lamports === undefined) return '—';\n // Credits are stored in lamports but displayed as a simple number\n const credits = lamports / 1_000_000_000;\n return credits.toFixed(4);\n}\n\nfunction formatTxType(txType: string): string {\n const typeMap: Record<string, string> = {\n DEPOSIT: 'Deposit',\n SPEND: 'Spend',\n ADJUSTMENT: 'Adjustment',\n REFUND: 'Refund',\n };\n return typeMap[txType.toUpperCase()] || txType;\n}\n\nfunction formatTxDescription(txType: string, referenceType?: string): string {\n if (referenceType) {\n const refMap: Record<string, string> = {\n deposit: 'Credit deposit',\n purchase: 'Purchase',\n api_call: 'API usage',\n subscription: 'Subscription',\n refund: 'Refund',\n bonus: 'Bonus credit',\n promo: 'Promotional credit',\n correction: 'Balance correction',\n };\n return refMap[referenceType.toLowerCase()] || referenceType;\n }\n // Fallback based on tx type\n const typeDescriptions: Record<string, string> = {\n DEPOSIT: 'Credit added',\n SPEND: 'Credit used',\n ADJUSTMENT: 'Manual adjustment',\n REFUND: 'Credit refunded',\n };\n return typeDescriptions[txType.toUpperCase()] || '—';\n}\n\n/**\n * Admin user detail display\n *\n * Shows comprehensive user information with deposit and credit history.\n */\nexport function AdminUserDetail({\n userId,\n onBack,\n currentUserId,\n onEditUser,\n onAdjustCredits,\n cedrosPayEnabled = false,\n className = '',\n}: AdminUserDetailProps) {\n const { config, _internal } = useCedrosLogin();\n const {\n isLoading,\n getUser,\n getUserDeposits,\n getUserCredits,\n getUserChats,\n getUserReferrals,\n deleteUser,\n forcePasswordReset,\n clearError,\n } = useAdminUsers();\n\n const kycApiClient = useMemo(\n () =>\n new AdminUserApiClient(\n config.serverUrl,\n config.requestTimeout,\n config.retryAttempts,\n _internal?.getAccessToken\n ),\n [config.serverUrl, config.requestTimeout, config.retryAttempts, _internal]\n );\n\n const [user, setUser] = useState<AdminUser | null>(null);\n const [credits, setCredits] = useState<AdminUserCreditsResponse | null>(null);\n const [deposits, setDeposits] = useState<AdminDepositListResponse | null>(null);\n const [chats, setChats] = useState<AdminUserChatsResponse | null>(null);\n const [referrals, setReferrals] = useState<AdminReferredUsersResponse | null>(null);\n const [kycData, setKycData] = useState<AdminUserKycResponse | null>(null);\n const [accreditationData, setAccreditationData] =\n useState<AdminUserAccreditationResponse | null>(null);\n const [activeTab, setActiveTab] = useState<TabId>('deposits');\n const [userError, setUserError] = useState<string | null>(null);\n const [creditsError, setCreditsError] = useState<string | null>(null);\n const [depositsError, setDepositsError] = useState<string | null>(null);\n const [chatsError, setChatsError] = useState<string | null>(null);\n const [referralsError, setReferralsError] = useState<string | null>(null);\n const [kycError, setKycError] = useState<string | null>(null);\n const [accreditationError, setAccreditationError] = useState<string | null>(null);\n const [actionInProgress, setActionInProgress] = useState(false);\n\n // Pagination state\n const [depositsOffset, setDepositsOffset] = useState(0);\n const [transactionsOffset, setTransactionsOffset] = useState(0);\n const [chatsOffset, setChatsOffset] = useState(0);\n const [referralsOffset, setReferralsOffset] = useState(0);\n const pageSize = 10;\n\n const fetchUser = useCallback(async () => {\n try {\n const userData = await getUser(userId);\n setUser(userData);\n setUserError(null);\n } catch (err) {\n setUserError(err instanceof Error ? err.message : 'Failed to load user');\n }\n }, [userId, getUser]);\n\n const fetchDeposits = useCallback(async () => {\n try {\n const params: ListUsersParams = { limit: pageSize, offset: depositsOffset };\n const depositsData = await getUserDeposits(userId, params);\n setDeposits(depositsData);\n setDepositsError(null);\n } catch (err) {\n setDepositsError(err instanceof Error ? err.message : 'Failed to load deposits');\n }\n }, [userId, getUserDeposits, depositsOffset]);\n\n const fetchCredits = useCallback(async () => {\n try {\n const params: ListUsersParams = { limit: pageSize, offset: transactionsOffset };\n const creditsData = await getUserCredits(userId, params);\n setCredits(creditsData);\n setCreditsError(null);\n } catch (err) {\n setCreditsError(err instanceof Error ? err.message : 'Failed to load credits');\n }\n }, [userId, getUserCredits, transactionsOffset]);\n\n const fetchChats = useCallback(async () => {\n if (!cedrosPayEnabled) return;\n try {\n const params: ListUsersParams = { limit: pageSize, offset: chatsOffset };\n const chatsData = await getUserChats(userId, params);\n setChats(chatsData);\n setChatsError(null);\n } catch (err) {\n setChatsError(err instanceof Error ? err.message : 'Failed to load chat history');\n }\n }, [userId, getUserChats, chatsOffset, cedrosPayEnabled]);\n\n const fetchReferrals = useCallback(async () => {\n try {\n const params: ListUsersParams = { limit: pageSize, offset: referralsOffset };\n const data = await getUserReferrals(userId, params);\n setReferrals(data);\n setReferralsError(null);\n } catch (err) {\n setReferralsError(err instanceof Error ? err.message : 'Failed to load referrals');\n }\n }, [userId, getUserReferrals, referralsOffset]);\n\n const fetchKyc = useCallback(async () => {\n try {\n const data = await kycApiClient.getUserKyc(userId);\n setKycData(data);\n setKycError(null);\n } catch (err) {\n setKycError(err instanceof Error ? err.message : 'Failed to load KYC data');\n }\n }, [userId, kycApiClient]);\n\n const fetchAccreditation = useCallback(async () => {\n try {\n const data = await kycApiClient.getUserAccreditation(userId);\n setAccreditationData(data);\n setAccreditationError(null);\n } catch (err) {\n setAccreditationError(\n err instanceof Error ? err.message : 'Failed to load accreditation data'\n );\n }\n }, [userId, kycApiClient]);\n\n const handleAccreditationOverride = useCallback(\n async (status: string) => {\n try {\n await kycApiClient.overrideAccreditationStatus(userId, status);\n await fetchAccreditation();\n } catch (err) {\n setAccreditationError(\n err instanceof Error ? err.message : 'Failed to override accreditation status'\n );\n }\n },\n [userId, kycApiClient, fetchAccreditation]\n );\n\n const handleAccreditationReview = useCallback(\n async (\n submissionId: string,\n approved: boolean,\n reviewerNotes?: string,\n rejectionReason?: string\n ) => {\n try {\n await kycApiClient.reviewAccreditation(\n submissionId,\n approved,\n reviewerNotes,\n rejectionReason\n );\n await fetchAccreditation();\n } catch (err) {\n setAccreditationError(\n err instanceof Error ? err.message : 'Failed to review accreditation submission'\n );\n }\n },\n [kycApiClient, fetchAccreditation]\n );\n\n const handleKycOverride = useCallback(\n async (status: string) => {\n try {\n await kycApiClient.overrideUserKyc(userId, status);\n await fetchKyc();\n } catch (err) {\n setKycError(err instanceof Error ? err.message : 'Failed to override KYC status');\n }\n },\n [userId, kycApiClient, fetchKyc]\n );\n\n // Initial load\n useEffect(() => {\n fetchUser();\n fetchDeposits();\n fetchCredits();\n fetchReferrals();\n fetchKyc();\n fetchAccreditation();\n if (cedrosPayEnabled) {\n fetchChats();\n }\n }, [fetchUser, fetchDeposits, fetchCredits, fetchChats, fetchReferrals, fetchKyc, fetchAccreditation, cedrosPayEnabled]);\n\n const handleDelete = async () => {\n if (!user) return;\n if (user.id === currentUserId) {\n alert('You cannot delete your own account');\n return;\n }\n if (user.isSystemAdmin) {\n alert('Cannot delete a system admin. Remove admin status first.');\n return;\n }\n\n const confirmed = window.confirm(\n `Are you sure you want to delete ${user.name || user.email || 'this user'}? This action cannot be undone.`\n );\n if (!confirmed) return;\n\n setActionInProgress(true);\n try {\n await deleteUser(user.id);\n onBack();\n } catch {\n // Error handled by hook\n } finally {\n setActionInProgress(false);\n }\n };\n\n const handlePasswordReset = async () => {\n if (!user?.email) {\n alert('User has no email address');\n return;\n }\n\n const confirmed = window.confirm(`Send a password reset email to ${user.email}?`);\n if (!confirmed) return;\n\n setActionInProgress(true);\n try {\n await forcePasswordReset(user.id);\n alert('Password reset email sent');\n } catch {\n // Error handled by hook\n } finally {\n setActionInProgress(false);\n }\n };\n\n // Pagination handlers\n const depositsTotalPages = deposits ? Math.ceil(deposits.total / pageSize) : 0;\n const depositsCurrentPage = Math.floor(depositsOffset / pageSize) + 1;\n\n const transactionsTotalPages = credits ? Math.ceil(credits.totalTransactions / pageSize) : 0;\n const transactionsCurrentPage = Math.floor(transactionsOffset / pageSize) + 1;\n\n const goToDepositsPage = (page: number) => {\n setDepositsOffset((page - 1) * pageSize);\n };\n\n const goToTransactionsPage = (page: number) => {\n setTransactionsOffset((page - 1) * pageSize);\n };\n\n const chatsTotalPages = chats ? Math.ceil(chats.total / pageSize) : 0;\n const chatsCurrentPage = Math.floor(chatsOffset / pageSize) + 1;\n\n const goToChatsPage = (page: number) => {\n setChatsOffset((page - 1) * pageSize);\n };\n\n const referralsTotalPages = referrals ? Math.ceil(referrals.total / pageSize) : 0;\n const referralsCurrentPage = Math.floor(referralsOffset / pageSize) + 1;\n\n const goToReferralsPage = (page: number) => {\n setReferralsOffset((page - 1) * pageSize);\n };\n\n // Critical error - user fetch failed\n if (userError) {\n return (\n <div className={`cedros-admin-user-detail cedros-admin-user-detail-error ${className}`}>\n <button\n type=\"button\"\n className=\"cedros-button cedros-button-outline cedros-button-sm\"\n onClick={onBack}\n >\n Back\n </button>\n <p className=\"cedros-admin-error\">{userError}</p>\n <button\n type=\"button\"\n className=\"cedros-button cedros-button-outline\"\n onClick={() => {\n clearError();\n setUserError(null);\n fetchUser();\n }}\n >\n Retry\n </button>\n </div>\n );\n }\n\n // Loading state\n if (isLoading && !user) {\n return (\n <div className={`cedros-admin-user-detail cedros-admin-user-detail-loading ${className}`}>\n <span className=\"cedros-admin-loading-indicator\" />\n <span className=\"cedros-admin-loading-text\">Loading user...</span>\n </div>\n );\n }\n\n if (!user) {\n return (\n <div className={`cedros-admin-user-detail ${className}`}>\n <button\n type=\"button\"\n className=\"cedros-button cedros-button-outline cedros-button-sm\"\n onClick={onBack}\n >\n Back\n </button>\n <p className=\"cedros-admin-empty-message\">User not found.</p>\n </div>\n );\n }\n\n const isCurrentUser = user.id === currentUserId;\n\n return (\n <div className={`cedros-admin-user-detail ${className}`}>\n {/* Header */}\n <div className=\"cedros-admin-user-detail-header\">\n <button\n type=\"button\"\n className=\"cedros-button cedros-button-outline cedros-button-sm cedros-admin-back-btn\"\n onClick={onBack}\n >\n Back to Users\n </button>\n <div className=\"cedros-admin-user-detail-actions\">\n {onEditUser && (\n <button\n type=\"button\"\n className=\"cedros-button cedros-button-outline cedros-button-sm\"\n onClick={() => onEditUser(user)}\n disabled={actionInProgress}\n >\n Edit\n </button>\n )}\n {user.email && (\n <button\n type=\"button\"\n className=\"cedros-button cedros-button-outline cedros-button-sm\"\n onClick={handlePasswordReset}\n disabled={actionInProgress}\n >\n Reset Password\n </button>\n )}\n {onAdjustCredits && (\n <button\n type=\"button\"\n className=\"cedros-button cedros-button-outline cedros-button-sm\"\n onClick={() => onAdjustCredits(user)}\n disabled={actionInProgress}\n >\n Adjust Credits\n </button>\n )}\n {!isCurrentUser && !user.isSystemAdmin && (\n <button\n type=\"button\"\n className=\"cedros-button cedros-button-outline cedros-button-sm cedros-admin-btn-danger\"\n onClick={handleDelete}\n disabled={actionInProgress}\n >\n Delete\n </button>\n )}\n </div>\n </div>\n\n {/* User Info Section */}\n <div className=\"cedros-admin-user-detail-info\">\n <div className=\"cedros-admin-user-detail-avatar\">\n {user.picture ? (\n <img\n src={user.picture}\n alt={user.name || user.email || 'User'}\n className=\"cedros-admin-user-detail-avatar-img\"\n referrerPolicy=\"no-referrer\"\n />\n ) : (\n <span className=\"cedros-admin-user-detail-avatar-placeholder\">\n {(user.name?.[0] || user.email?.[0] || '?').toUpperCase()}\n </span>\n )}\n </div>\n <div className=\"cedros-admin-user-detail-meta\">\n <h2 className=\"cedros-admin-user-detail-name\">\n {user.name || 'Unknown'}\n {isCurrentUser && <span className=\"cedros-admin-user-you\">(you)</span>}\n </h2>\n <p className=\"cedros-admin-user-detail-email\">\n {user.email || 'No email'}\n {user.emailVerified && (\n <span className=\"cedros-admin-verified-badge\" title=\"Email verified\">\n Verified\n </span>\n )}\n </p>\n {user.isSystemAdmin && (\n <div className=\"cedros-admin-user-detail-badges\">\n <span className=\"cedros-admin-admin-badge cedros-admin-admin-badge-yes\">\n System Admin\n </span>\n </div>\n )}\n <div className=\"cedros-admin-user-detail-methods\">\n <span className=\"cedros-admin-user-detail-methods-label\">Auth Methods:</span>\n {user.authMethods.length > 0 ? (\n user.authMethods.map((method) => (\n <span\n key={method}\n className={`cedros-admin-auth-badge cedros-admin-auth-badge-${method}`}\n >\n {method}\n </span>\n ))\n ) : (\n <span className=\"cedros-admin-auth-badge cedros-admin-auth-badge-none\">none</span>\n )}\n </div>\n <p className=\"cedros-admin-user-detail-dates\">\n Registered: {formatDate(user.createdAt)} | Updated: {formatDate(user.updatedAt)}\n </p>\n {user.referralCode && (\n <div className=\"cedros-admin-user-detail-referral\">\n <span className=\"cedros-admin-user-detail-referral-label\">Referral:</span>\n <span className=\"cedros-admin-user-detail-referral-code\">{user.referralCode}</span>\n {user.referralCount !== undefined && user.referralCount > 0 && (\n <span className=\"cedros-admin-user-detail-referral-count\">\n ({user.referralCount} referred)\n </span>\n )}\n {user.referredBy && (\n <span className=\"cedros-admin-user-detail-referred-by\">\n Referred by:{' '}\n <button\n type=\"button\"\n className=\"cedros-admin-user-uuid-link\"\n onClick={() => navigator.clipboard?.writeText(user.referredBy!)}\n title=\"Click to copy referrer UUID\"\n >\n {user.referredBy}\n </button>\n </span>\n )}\n </div>\n )}\n </div>\n </div>\n\n {/* Stats Cards */}\n {creditsError ? (\n <div className=\"cedros-admin-stats-error\">\n <p className=\"cedros-admin-error-inline\">{creditsError}</p>\n <button\n type=\"button\"\n className=\"cedros-button cedros-button-outline cedros-button-sm\"\n onClick={() => {\n setCreditsError(null);\n fetchCredits();\n }}\n >\n Retry\n </button>\n </div>\n ) : credits ? (\n <div className=\"cedros-admin-user-detail-stats\">\n <div className=\"cedros-admin-stat-card\">\n <span className=\"cedros-admin-stat-label\">Credit Balance</span>\n <span className=\"cedros-admin-stat-value\">\n {formatCredits(credits.stats.currentBalanceLamports)}\n </span>\n </div>\n <div className=\"cedros-admin-stat-card\">\n <span className=\"cedros-admin-stat-label\">Total Credited</span>\n <span className=\"cedros-admin-stat-value\">\n {formatCredits(credits.stats.totalDepositedLamports)}\n </span>\n </div>\n <div className=\"cedros-admin-stat-card\">\n <span className=\"cedros-admin-stat-label\">Total Spent</span>\n <span className=\"cedros-admin-stat-value\">\n {formatCredits(credits.stats.totalSpentLamports)}\n </span>\n </div>\n <div className=\"cedros-admin-stat-card\">\n <span className=\"cedros-admin-stat-label\">Deposits</span>\n <span className=\"cedros-admin-stat-value\">{credits.stats.depositCount}</span>\n </div>\n <div className=\"cedros-admin-stat-card\">\n <span className=\"cedros-admin-stat-label\">Transactions</span>\n <span className=\"cedros-admin-stat-value\">{credits.stats.spendCount}</span>\n </div>\n </div>\n ) : (\n <div className=\"cedros-admin-stats-loading\">\n <span className=\"cedros-admin-loading-indicator\" />\n <span>Loading credit stats...</span>\n </div>\n )}\n\n {/* Tabs */}\n <div className=\"cedros-admin-user-detail-tabs\">\n <button\n type=\"button\"\n className={`cedros-admin-tab ${activeTab === 'deposits' ? 'cedros-admin-tab-active' : ''}`}\n onClick={() => setActiveTab('deposits')}\n >\n Deposits ({deposits?.total ?? 0})\n </button>\n <button\n type=\"button\"\n className={`cedros-admin-tab ${activeTab === 'transactions' ? 'cedros-admin-tab-active' : ''}`}\n onClick={() => setActiveTab('transactions')}\n >\n Credits ({credits?.totalTransactions ?? 0})\n </button>\n {cedrosPayEnabled && (\n <button\n type=\"button\"\n className={`cedros-admin-tab ${activeTab === 'chats' ? 'cedros-admin-tab-active' : ''}`}\n onClick={() => setActiveTab('chats')}\n >\n Chats ({chats?.total ?? 0})\n </button>\n )}\n <button\n type=\"button\"\n className={`cedros-admin-tab ${activeTab === 'referrals' ? 'cedros-admin-tab-active' : ''}`}\n onClick={() => setActiveTab('referrals')}\n >\n Referrals ({referrals?.total ?? user.referralCount ?? 0})\n </button>\n <button\n type=\"button\"\n className={`cedros-admin-tab ${activeTab === 'kyc' ? 'cedros-admin-tab-active' : ''}`}\n onClick={() => setActiveTab('kyc')}\n >\n KYC ({kycData?.totalSessions ?? 0})\n </button>\n <button\n type=\"button\"\n className={`cedros-admin-tab ${activeTab === 'accreditation' ? 'cedros-admin-tab-active' : ''}`}\n onClick={() => setActiveTab('accreditation')}\n >\n Accreditation ({accreditationData?.totalSubmissions ?? 0})\n </button>\n </div>\n\n {/* Tab Content */}\n <div className=\"cedros-admin-user-detail-content\">\n {activeTab === 'deposits' && (\n <DepositsTab\n deposits={deposits?.deposits ?? []}\n total={deposits?.total ?? 0}\n currentPage={depositsCurrentPage}\n totalPages={depositsTotalPages}\n onPageChange={goToDepositsPage}\n isLoading={isLoading}\n error={depositsError}\n onRetry={() => {\n setDepositsError(null);\n fetchDeposits();\n }}\n />\n )}\n {activeTab === 'transactions' && (\n <TransactionsTab\n transactions={credits?.transactions ?? []}\n total={credits?.totalTransactions ?? 0}\n currentPage={transactionsCurrentPage}\n totalPages={transactionsTotalPages}\n onPageChange={goToTransactionsPage}\n error={creditsError}\n onRetry={() => {\n setCreditsError(null);\n fetchCredits();\n }}\n isLoading={isLoading}\n />\n )}\n {activeTab === 'chats' && cedrosPayEnabled && (\n <ChatsTab\n sessions={chats?.sessions ?? []}\n total={chats?.total ?? 0}\n currentPage={chatsCurrentPage}\n totalPages={chatsTotalPages}\n onPageChange={goToChatsPage}\n error={chatsError}\n onRetry={() => {\n setChatsError(null);\n fetchChats();\n }}\n isLoading={isLoading}\n />\n )}\n {activeTab === 'referrals' && (\n <ReferralsTab\n referrals={referrals?.users ?? []}\n total={referrals?.total ?? 0}\n currentPage={referralsCurrentPage}\n totalPages={referralsTotalPages}\n onPageChange={goToReferralsPage}\n error={referralsError}\n onRetry={() => {\n setReferralsError(null);\n fetchReferrals();\n }}\n isLoading={isLoading}\n />\n )}\n {activeTab === 'kyc' && (\n <KycTab\n kycData={kycData}\n userKycStatus={user.kycStatus}\n userKycVerifiedAt={user.kycVerifiedAt}\n userKycExpiresAt={user.kycExpiresAt}\n error={kycError}\n onRetry={() => {\n setKycError(null);\n fetchKyc();\n }}\n onOverride={handleKycOverride}\n />\n )}\n {activeTab === 'accreditation' && (\n <AccreditationTab\n accreditationData={accreditationData}\n userAccreditationStatus={user.accreditationStatus}\n userAccreditationVerifiedAt={user.accreditationVerifiedAt}\n userAccreditationExpiresAt={user.accreditationExpiresAt}\n error={accreditationError}\n onRetry={() => {\n setAccreditationError(null);\n fetchAccreditation();\n }}\n onOverride={handleAccreditationOverride}\n onReview={handleAccreditationReview}\n />\n )}\n </div>\n </div>\n );\n}\n\n// =============================================================================\n// Tab Components\n// =============================================================================\n\ninterface DepositsTabProps {\n deposits: AdminDepositItem[];\n total: number;\n currentPage: number;\n totalPages: number;\n onPageChange: (page: number) => void;\n isLoading: boolean;\n error: string | null;\n onRetry: () => void;\n}\n\nfunction DepositsTab({\n deposits,\n total,\n currentPage,\n totalPages,\n onPageChange,\n isLoading,\n error,\n onRetry,\n}: DepositsTabProps) {\n if (error) {\n return (\n <div className=\"cedros-admin-tab-error\">\n <p className=\"cedros-admin-error-inline\">{error}</p>\n <button\n type=\"button\"\n className=\"cedros-button cedros-button-outline cedros-button-sm\"\n onClick={onRetry}\n >\n Retry\n </button>\n </div>\n );\n }\n\n if (isLoading && deposits.length === 0) {\n return (\n <div className=\"cedros-admin-tab-loading\">\n <span className=\"cedros-admin-loading-indicator\" />\n <span>Loading deposits...</span>\n </div>\n );\n }\n\n if (total === 0) {\n return <div className=\"cedros-admin-empty-message\">No deposits found.</div>;\n }\n\n return (\n <>\n <div className=\"cedros-admin-list-table\">\n <div className=\"cedros-admin-list-thead\">\n <div className=\"cedros-admin-list-th\">Date</div>\n <div className=\"cedros-admin-list-th\">Amount</div>\n <div className=\"cedros-admin-list-th\">Status</div>\n <div className=\"cedros-admin-list-th\">Transaction</div>\n </div>\n {deposits.map((deposit) => (\n <div key={deposit.id} className=\"cedros-admin-list-row\">\n <div className=\"cedros-admin-list-td\">{formatDateTime(deposit.createdAt)}</div>\n <div className=\"cedros-admin-list-td\">{formatSol(deposit.amountLamports)}</div>\n <div className=\"cedros-admin-list-td\">\n <span className={`cedros-admin-status-badge cedros-admin-status-${deposit.status}`}>\n {deposit.status}\n </span>\n </div>\n <div className=\"cedros-admin-list-td cedros-admin-list-td-actions\">\n {deposit.txSignature ? (\n <>\n <span className=\"cedros-admin-list-td-mono\" title={deposit.txSignature}>\n {deposit.txSignature.slice(0, 8)}...\n </span>\n <a\n href={`https://orbmarkets.io/tx/${deposit.txSignature}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"cedros-admin-icon-link\"\n title=\"View on Orbmarkets\"\n aria-label=\"View transaction on Orbmarkets\"\n >\n ↗\n </a>\n </>\n ) : (\n <span className=\"cedros-admin-list-td-muted\">—</span>\n )}\n </div>\n </div>\n ))}\n </div>\n {totalPages > 1 && (\n <Pagination\n currentPage={currentPage}\n totalPages={totalPages}\n total={total}\n onPageChange={onPageChange}\n />\n )}\n </>\n );\n}\n\ninterface TransactionsTabProps {\n transactions: AdminCreditTransactionItem[];\n total: number;\n currentPage: number;\n totalPages: number;\n onPageChange: (page: number) => void;\n isLoading: boolean;\n error: string | null;\n onRetry: () => void;\n}\n\nfunction TransactionsTab({\n transactions,\n total,\n currentPage,\n totalPages,\n onPageChange,\n isLoading,\n error,\n onRetry,\n}: TransactionsTabProps) {\n if (error) {\n return (\n <div className=\"cedros-admin-tab-error\">\n <p className=\"cedros-admin-error-inline\">{error}</p>\n <button\n type=\"button\"\n className=\"cedros-button cedros-button-outline cedros-button-sm\"\n onClick={onRetry}\n >\n Retry\n </button>\n </div>\n );\n }\n\n if (isLoading && transactions.length === 0) {\n return (\n <div className=\"cedros-admin-tab-loading\">\n <span className=\"cedros-admin-loading-indicator\" />\n <span>Loading transactions...</span>\n </div>\n );\n }\n\n if (total === 0) {\n return <div className=\"cedros-admin-empty-message\">No credit transactions found.</div>;\n }\n\n return (\n <>\n <div className=\"cedros-admin-list-table\">\n <div className=\"cedros-admin-list-thead\">\n <div className=\"cedros-admin-list-th\">Date</div>\n <div className=\"cedros-admin-list-th\">Type</div>\n <div className=\"cedros-admin-list-th\">Description</div>\n <div className=\"cedros-admin-list-th\">Amount</div>\n </div>\n {transactions.map((tx) => (\n <div key={tx.id} className=\"cedros-admin-list-row\">\n <div className=\"cedros-admin-list-td\">{formatDateTime(tx.createdAt)}</div>\n <div className=\"cedros-admin-list-td\">\n <span\n className={`cedros-admin-tx-type cedros-admin-tx-type-${tx.txType.toLowerCase()}`}\n >\n {formatTxType(tx.txType)}\n </span>\n </div>\n <div className=\"cedros-admin-list-td\">\n {formatTxDescription(tx.txType, tx.referenceType)}\n </div>\n <div\n className={`cedros-admin-list-td ${tx.amountLamports >= 0 ? 'cedros-admin-amount-positive' : 'cedros-admin-amount-negative'}`}\n >\n {tx.amountLamports >= 0 ? '+' : ''}\n {formatCredits(tx.amountLamports)}\n </div>\n </div>\n ))}\n </div>\n {totalPages > 1 && (\n <Pagination\n currentPage={currentPage}\n totalPages={totalPages}\n total={total}\n onPageChange={onPageChange}\n />\n )}\n </>\n );\n}\n\ninterface ChatsTabProps {\n sessions: AdminChatSession[];\n total: number;\n currentPage: number;\n totalPages: number;\n onPageChange: (page: number) => void;\n isLoading: boolean;\n error: string | null;\n onRetry: () => void;\n}\n\nfunction ChatsTab({\n sessions,\n total,\n currentPage,\n totalPages,\n onPageChange,\n isLoading,\n error,\n onRetry,\n}: ChatsTabProps) {\n if (error) {\n return (\n <div className=\"cedros-admin-tab-error\">\n <p className=\"cedros-admin-error-inline\">{error}</p>\n <button\n type=\"button\"\n className=\"cedros-button cedros-button-outline cedros-button-sm\"\n onClick={onRetry}\n >\n Retry\n </button>\n </div>\n );\n }\n\n if (isLoading && sessions.length === 0) {\n return (\n <div className=\"cedros-admin-tab-loading\">\n <span className=\"cedros-admin-loading-indicator\" />\n <span>Loading chat history...</span>\n </div>\n );\n }\n\n if (total === 0) {\n return <div className=\"cedros-admin-empty-message\">No chat sessions found.</div>;\n }\n\n return (\n <>\n <div className=\"cedros-admin-list-table\">\n <div className=\"cedros-admin-list-thead\">\n <div className=\"cedros-admin-list-th\">Date</div>\n <div className=\"cedros-admin-list-th\">Session</div>\n <div className=\"cedros-admin-list-th\">Messages</div>\n </div>\n {sessions.map((session) => (\n <div key={session.id} className=\"cedros-admin-list-row\">\n <div className=\"cedros-admin-list-td\">{formatDateTime(session.createdAt)}</div>\n <div className=\"cedros-admin-list-td\">\n {session.title || `Chat ${session.id.slice(0, 8)}...`}\n </div>\n <div className=\"cedros-admin-list-td\">{session.messageCount}</div>\n </div>\n ))}\n </div>\n {totalPages > 1 && (\n <Pagination\n currentPage={currentPage}\n totalPages={totalPages}\n total={total}\n onPageChange={onPageChange}\n />\n )}\n </>\n );\n}\n\ninterface ReferralsTabProps {\n referrals: ReferredUserItem[];\n total: number;\n currentPage: number;\n totalPages: number;\n onPageChange: (page: number) => void;\n isLoading: boolean;\n error: string | null;\n onRetry: () => void;\n}\n\nfunction ReferralsTab({\n referrals,\n total,\n currentPage,\n totalPages,\n onPageChange,\n isLoading,\n error,\n onRetry,\n}: ReferralsTabProps) {\n if (error) {\n return (\n <div className=\"cedros-admin-tab-error\">\n <p className=\"cedros-admin-error-inline\">{error}</p>\n <button\n type=\"button\"\n className=\"cedros-button cedros-button-outline cedros-button-sm\"\n onClick={onRetry}\n >\n Retry\n </button>\n </div>\n );\n }\n\n if (isLoading && referrals.length === 0) {\n return (\n <div className=\"cedros-admin-tab-loading\">\n <span className=\"cedros-admin-loading-indicator\" />\n <span>Loading referrals...</span>\n </div>\n );\n }\n\n if (total === 0) {\n return <div className=\"cedros-admin-empty-message\">No referred users found.</div>;\n }\n\n return (\n <>\n <div className=\"cedros-admin-list-table\">\n <div className=\"cedros-admin-list-thead\">\n <div className=\"cedros-admin-list-th\">Name</div>\n <div className=\"cedros-admin-list-th\">Email</div>\n <div className=\"cedros-admin-list-th\">Joined</div>\n <div className=\"cedros-admin-list-th\">Last Login</div>\n </div>\n {referrals.map((r) => (\n <div key={r.id} className=\"cedros-admin-list-row\">\n <div className=\"cedros-admin-list-td\">{r.name || '—'}</div>\n <div className=\"cedros-admin-list-td\">{r.email || '—'}</div>\n <div className=\"cedros-admin-list-td\">{formatDate(r.createdAt)}</div>\n <div className=\"cedros-admin-list-td\">\n {r.lastLoginAt ? formatDateTime(r.lastLoginAt) : '—'}\n </div>\n </div>\n ))}\n </div>\n {totalPages > 1 && (\n <Pagination\n currentPage={currentPage}\n totalPages={totalPages}\n total={total}\n onPageChange={onPageChange}\n />\n )}\n </>\n );\n}\n\n// =============================================================================\n// KYC Tab Component\n// =============================================================================\n\nconst KYC_OVERRIDE_OPTIONS = [\n { value: 'none', label: 'None (reset)' },\n { value: 'verified', label: 'Verified' },\n { value: 'failed', label: 'Failed' },\n];\n\ninterface KycTabProps {\n kycData: AdminUserKycResponse | null;\n /** KYC status from the AdminUser object (faster-loading summary) */\n userKycStatus?: string;\n userKycVerifiedAt?: string;\n userKycExpiresAt?: string;\n error: string | null;\n onRetry: () => void;\n onOverride: (status: string) => Promise<void>;\n}\n\nfunction KycTab({\n kycData,\n userKycStatus,\n userKycVerifiedAt,\n userKycExpiresAt,\n error,\n onRetry,\n onOverride,\n}: KycTabProps) {\n const [overrideStatus, setOverrideStatus] = useState('none');\n const [overrideInProgress, setOverrideInProgress] = useState(false);\n const [overrideError, setOverrideError] = useState<string | null>(null);\n\n const effectiveStatus = kycData?.status ?? userKycStatus ?? 'none';\n const effectiveVerifiedAt = kycData?.verifiedAt ?? userKycVerifiedAt;\n const effectiveExpiresAt = kycData?.expiresAt ?? userKycExpiresAt;\n\n const handleOverride = async () => {\n const confirmed = window.confirm(\n `Override KYC status to \"${overrideStatus}\" for this user?`\n );\n if (!confirmed) return;\n setOverrideInProgress(true);\n setOverrideError(null);\n try {\n await onOverride(overrideStatus);\n } catch (err) {\n setOverrideError(err instanceof Error ? err.message : 'Override failed');\n } finally {\n setOverrideInProgress(false);\n }\n };\n\n if (error) {\n return (\n <div className=\"cedros-admin-tab-error\">\n <p className=\"cedros-admin-error-inline\">{error}</p>\n <button\n type=\"button\"\n className=\"cedros-button cedros-button-outline cedros-button-sm\"\n onClick={onRetry}\n >\n Retry\n </button>\n </div>\n );\n }\n\n if (!kycData && !userKycStatus) {\n return (\n <div className=\"cedros-admin-tab-loading\">\n <span className=\"cedros-admin-loading-indicator\" />\n <span>Loading KYC data...</span>\n </div>\n );\n }\n\n return (\n <div className=\"cedros-kyc-admin-tab\">\n {/* Status summary */}\n <div className=\"cedros-kyc-admin-tab-summary\">\n <div className=\"cedros-kyc-admin-tab-row\">\n <span className=\"cedros-kyc-admin-tab-label\">Status</span>\n <span\n className={`cedros-admin-status-badge cedros-kyc-status-${effectiveStatus}`}\n >\n {effectiveStatus}\n </span>\n </div>\n {effectiveVerifiedAt && (\n <div className=\"cedros-kyc-admin-tab-row\">\n <span className=\"cedros-kyc-admin-tab-label\">Verified at</span>\n <span>{formatDateTime(effectiveVerifiedAt)}</span>\n </div>\n )}\n {effectiveExpiresAt && (\n <div className=\"cedros-kyc-admin-tab-row\">\n <span className=\"cedros-kyc-admin-tab-label\">Expires at</span>\n <span>{formatDateTime(effectiveExpiresAt)}</span>\n </div>\n )}\n </div>\n\n {/* Override */}\n <div className=\"cedros-kyc-admin-override\">\n <span className=\"cedros-kyc-admin-override-label\">Override status</span>\n <select\n className=\"cedros-kyc-admin-override-select\"\n value={overrideStatus}\n onChange={(e) => setOverrideStatus(e.target.value)}\n disabled={overrideInProgress}\n aria-label=\"Select KYC override status\"\n >\n {KYC_OVERRIDE_OPTIONS.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n <button\n type=\"button\"\n className=\"cedros-button cedros-button-outline cedros-button-sm\"\n onClick={handleOverride}\n disabled={overrideInProgress}\n >\n {overrideInProgress ? 'Saving...' : 'Apply Override'}\n </button>\n {overrideError && (\n <p className=\"cedros-admin-error-inline\">{overrideError}</p>\n )}\n </div>\n\n {/* Session history */}\n {kycData && kycData.sessions.length > 0 ? (\n <div className=\"cedros-admin-list-table\">\n <div className=\"cedros-admin-list-thead\">\n <div className=\"cedros-admin-list-th\">Date</div>\n <div className=\"cedros-admin-list-th\">Provider</div>\n <div className=\"cedros-admin-list-th\">Status</div>\n <div className=\"cedros-admin-list-th\">Error</div>\n <div className=\"cedros-admin-list-th\">Completed</div>\n </div>\n {kycData.sessions.map((session: AdminUserKycSession) => (\n <div key={session.id} className=\"cedros-admin-list-row\">\n <div className=\"cedros-admin-list-td\">{formatDateTime(session.createdAt)}</div>\n <div className=\"cedros-admin-list-td\">{session.provider}</div>\n <div className=\"cedros-admin-list-td\">\n <span\n className={`cedros-admin-status-badge cedros-kyc-status-${session.status}`}\n >\n {session.status}\n </span>\n </div>\n <div className=\"cedros-admin-list-td cedros-admin-list-td-muted\">\n {session.errorCode\n ? `${session.errorCode}${session.errorReason ? `: ${session.errorReason}` : ''}`\n : '—'}\n </div>\n <div className=\"cedros-admin-list-td\">\n {session.completedAt ? formatDateTime(session.completedAt) : '—'}\n </div>\n </div>\n ))}\n </div>\n ) : (\n kycData && (\n <div className=\"cedros-admin-empty-message\">No verification sessions found.</div>\n )\n )}\n </div>\n );\n}\n\n// =============================================================================\n// Accreditation Tab Component\n// =============================================================================\n\nconst ACCREDITATION_OVERRIDE_OPTIONS = [\n { value: 'none', label: 'None (reset)' },\n { value: 'approved', label: 'Approved' },\n { value: 'rejected', label: 'Rejected' },\n];\n\ninterface AccreditationTabProps {\n accreditationData: AdminUserAccreditationResponse | null;\n userAccreditationStatus?: string;\n userAccreditationVerifiedAt?: string;\n userAccreditationExpiresAt?: string;\n error: string | null;\n onRetry: () => void;\n onOverride: (status: string) => Promise<void>;\n onReview: (\n submissionId: string,\n approved: boolean,\n reviewerNotes?: string,\n rejectionReason?: string\n ) => Promise<void>;\n}\n\nfunction AccreditationTab({\n accreditationData,\n userAccreditationStatus,\n userAccreditationVerifiedAt,\n userAccreditationExpiresAt,\n error,\n onRetry,\n onOverride,\n onReview,\n}: AccreditationTabProps) {\n const [overrideStatus, setOverrideStatus] = useState('none');\n const [overrideInProgress, setOverrideInProgress] = useState(false);\n const [overrideError, setOverrideError] = useState<string | null>(null);\n const [reviewingId, setReviewingId] = useState<string | null>(null);\n const [reviewNotes, setReviewNotes] = useState('');\n const [reviewRejection, setReviewRejection] = useState('');\n const [reviewInProgress, setReviewInProgress] = useState(false);\n const [reviewError, setReviewError] = useState<string | null>(null);\n\n const effectiveStatus =\n accreditationData?.status ?? userAccreditationStatus ?? 'none';\n const effectiveVerifiedAt =\n accreditationData?.verifiedAt ?? userAccreditationVerifiedAt;\n const effectiveExpiresAt =\n accreditationData?.expiresAt ?? userAccreditationExpiresAt;\n\n const handleOverride = async () => {\n const confirmed = window.confirm(\n `Override accreditation status to \"${overrideStatus}\" for this user?`\n );\n if (!confirmed) return;\n setOverrideInProgress(true);\n setOverrideError(null);\n try {\n await onOverride(overrideStatus);\n } catch (err) {\n setOverrideError(err instanceof Error ? err.message : 'Override failed');\n } finally {\n setOverrideInProgress(false);\n }\n };\n\n const handleReview = async (submissionId: string, approved: boolean) => {\n const label = approved ? 'approve' : 'reject';\n const confirmed = window.confirm(`${label.charAt(0).toUpperCase() + label.slice(1)} this submission?`);\n if (!confirmed) return;\n setReviewInProgress(true);\n setReviewError(null);\n try {\n await onReview(\n submissionId,\n approved,\n reviewNotes || undefined,\n !approved ? reviewRejection || undefined : undefined\n );\n setReviewingId(null);\n setReviewNotes('');\n setReviewRejection('');\n } catch (err) {\n setReviewError(err instanceof Error ? err.message : 'Review failed');\n } finally {\n setReviewInProgress(false);\n }\n };\n\n if (error) {\n return (\n <div className=\"cedros-admin-tab-error\">\n <p className=\"cedros-admin-error-inline\">{error}</p>\n <button\n type=\"button\"\n className=\"cedros-button cedros-button-outline cedros-button-sm\"\n onClick={onRetry}\n >\n Retry\n </button>\n </div>\n );\n }\n\n if (!accreditationData && !userAccreditationStatus) {\n return (\n <div className=\"cedros-admin-tab-loading\">\n <span className=\"cedros-admin-loading-indicator\" />\n <span>Loading accreditation data...</span>\n </div>\n );\n }\n\n return (\n <div className=\"cedros-accreditation-admin-tab\">\n {/* Status summary */}\n <div className=\"cedros-kyc-admin-tab-summary\">\n <div className=\"cedros-kyc-admin-tab-row\">\n <span className=\"cedros-kyc-admin-tab-label\">Status</span>\n <span\n className={`cedros-admin-status-badge cedros-accreditation-status-${effectiveStatus}`}\n >\n {effectiveStatus}\n </span>\n </div>\n {effectiveVerifiedAt && (\n <div className=\"cedros-kyc-admin-tab-row\">\n <span className=\"cedros-kyc-admin-tab-label\">Verified at</span>\n <span>{formatDateTime(effectiveVerifiedAt)}</span>\n </div>\n )}\n {effectiveExpiresAt && (\n <div className=\"cedros-kyc-admin-tab-row\">\n <span className=\"cedros-kyc-admin-tab-label\">Expires at</span>\n <span>{formatDateTime(effectiveExpiresAt)}</span>\n </div>\n )}\n </div>\n\n {/* Override */}\n <div className=\"cedros-kyc-admin-override\">\n <span className=\"cedros-kyc-admin-override-label\">Override status</span>\n <select\n className=\"cedros-kyc-admin-override-select\"\n value={overrideStatus}\n onChange={(e) => setOverrideStatus(e.target.value)}\n disabled={overrideInProgress}\n aria-label=\"Select accreditation override status\"\n >\n {ACCREDITATION_OVERRIDE_OPTIONS.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n <button\n type=\"button\"\n className=\"cedros-button cedros-button-outline cedros-button-sm\"\n onClick={handleOverride}\n disabled={overrideInProgress}\n >\n {overrideInProgress ? 'Saving...' : 'Apply Override'}\n </button>\n {overrideError && <p className=\"cedros-admin-error-inline\">{overrideError}</p>}\n </div>\n\n {/* Submission history */}\n {accreditationData && accreditationData.submissions.length > 0 ? (\n <>\n <div className=\"cedros-admin-list-table\">\n <div className=\"cedros-admin-list-thead\">\n <div className=\"cedros-admin-list-th\">Date</div>\n <div className=\"cedros-admin-list-th\">Method</div>\n <div className=\"cedros-admin-list-th\">Status</div>\n <div className=\"cedros-admin-list-th\">Expires</div>\n <div className=\"cedros-admin-list-th\">Actions</div>\n </div>\n {accreditationData.submissions.map((sub: AccreditationSubmissionItem) => (\n <div key={sub.id} className=\"cedros-admin-list-row\">\n <div className=\"cedros-admin-list-td\">{formatDateTime(sub.createdAt)}</div>\n <div className=\"cedros-admin-list-td\">{sub.method.replace(/_/g, ' ')}</div>\n <div className=\"cedros-admin-list-td\">\n <span\n className={`cedros-admin-status-badge cedros-accreditation-status-${sub.status}`}\n >\n {sub.status}\n </span>\n </div>\n <div className=\"cedros-admin-list-td\">\n {sub.expiresAt ? formatDateTime(sub.expiresAt) : '—'}\n </div>\n <div className=\"cedros-admin-list-td cedros-admin-list-td-actions\">\n {sub.status === 'pending' && (\n <button\n type=\"button\"\n className=\"cedros-button cedros-button-outline cedros-button-sm\"\n onClick={() =>\n setReviewingId(reviewingId === sub.id ? null : sub.id)\n }\n >\n Review\n </button>\n )}\n </div>\n </div>\n ))}\n </div>\n {reviewingId && (\n <div className=\"cedros-accreditation-review-panel\">\n <p className=\"cedros-accreditation-review-title\">Review submission</p>\n <label className=\"cedros-kyc-admin-tab-label\" htmlFor=\"review-notes\">\n Reviewer notes (internal)\n </label>\n <input\n id=\"review-notes\"\n type=\"text\"\n className=\"cedros-input cedros-input-sm\"\n value={reviewNotes}\n onChange={(e) => setReviewNotes(e.target.value)}\n placeholder=\"Optional internal notes\"\n disabled={reviewInProgress}\n />\n <label\n className=\"cedros-kyc-admin-tab-label\"\n htmlFor=\"review-rejection\"\n >\n Rejection reason (shown to user if rejected)\n </label>\n <input\n id=\"review-rejection\"\n type=\"text\"\n className=\"cedros-input cedros-input-sm\"\n value={reviewRejection}\n onChange={(e) => setReviewRejection(e.target.value)}\n placeholder=\"Required when rejecting\"\n disabled={reviewInProgress}\n />\n <div className=\"cedros-accreditation-review-actions\">\n <button\n type=\"button\"\n className=\"cedros-button cedros-button-outline cedros-button-sm\"\n onClick={() => handleReview(reviewingId, true)}\n disabled={reviewInProgress}\n >\n {reviewInProgress ? 'Saving...' : 'Approve'}\n </button>\n <button\n type=\"button\"\n className=\"cedros-button cedros-button-outline cedros-button-sm cedros-admin-btn-danger\"\n onClick={() => handleReview(reviewingId, false)}\n disabled={reviewInProgress || !reviewRejection.trim()}\n >\n {reviewInProgress ? 'Saving...' : 'Reject'}\n </button>\n </div>\n {reviewError && <p className=\"cedros-admin-error-inline\">{reviewError}</p>}\n </div>\n )}\n </>\n ) : (\n accreditationData && (\n <div className=\"cedros-admin-empty-message\">No accreditation submissions found.</div>\n )\n )}\n </div>\n );\n}\n\ninterface PaginationProps {\n currentPage: number;\n totalPages: number;\n total: number;\n onPageChange: (page: number) => void;\n}\n\nfunction Pagination({ currentPage, totalPages, total, onPageChange }: PaginationProps) {\n return (\n <div className=\"cedros-admin-pagination\">\n <button\n type=\"button\"\n className=\"cedros-button cedros-button-outline cedros-button-sm\"\n onClick={() => onPageChange(currentPage - 1)}\n disabled={currentPage <= 1}\n >\n Previous\n </button>\n <span className=\"cedros-admin-page-info\">\n Page {currentPage} of {totalPages} ({total} total)\n </span>\n <button\n type=\"button\"\n className=\"cedros-button cedros-button-outline cedros-button-sm\"\n onClick={() => onPageChange(currentPage + 1)}\n disabled={currentPage >= totalPages}\n >\n Next\n </button>\n </div>\n );\n}\n","import { useCallback, useEffect, useMemo, useState } from 'react';\nimport type { AdminUserStatsResponse } from '../../../types';\nimport { useAdminUsers } from '../../../hooks/useAdminUsers';\nimport { useSystemSettings } from '../../../hooks/useSystemSettings';\nimport type { StatItem } from '../StatsBar';\n\nconst METHOD_ORDER = ['email', 'google', 'apple', 'solana', 'webauthn', 'sso'] as const;\n\nconst METHOD_LABELS: Record<(typeof METHOD_ORDER)[number], string> = {\n email: 'Email Users',\n google: 'Google Users',\n apple: 'Apple Users',\n solana: 'Solana Users',\n webauthn: 'Passkey Users',\n sso: 'SSO Provider Users',\n};\n\nconst METHOD_SETTINGS: Record<(typeof METHOD_ORDER)[number], string> = {\n email: 'auth_email_enabled',\n google: 'auth_google_enabled',\n apple: 'auth_apple_enabled',\n solana: 'auth_solana_enabled',\n webauthn: 'auth_webauthn_enabled',\n sso: 'feature_sso',\n};\n\nexport interface UsersStatsSummary {\n statsItems: StatItem[];\n isLoading: boolean;\n error: string | null;\n refresh: () => Promise<void>;\n}\n\nexport function useUsersStatsSummary(): UsersStatsSummary {\n const { getStats } = useAdminUsers();\n const { fetchSettings, getValue } = useSystemSettings();\n const [stats, setStats] = useState<AdminUserStatsResponse | null>(null);\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [settingsFetched, setSettingsFetched] = useState(false);\n\n useEffect(() => {\n if (!settingsFetched) {\n fetchSettings();\n setSettingsFetched(true);\n }\n }, [fetchSettings, settingsFetched]);\n\n const isSettingEnabled = useCallback(\n (key: string): boolean => {\n const value = getValue(key);\n if (value === undefined) return false;\n return value === 'true' || value === '1';\n },\n [getValue]\n );\n\n const refresh = useCallback(async () => {\n setIsLoading(true);\n setError(null);\n\n try {\n const result = await getStats();\n setStats(result);\n } catch (err) {\n setError(err instanceof Error ? err.message : 'Failed to load user stats');\n } finally {\n setIsLoading(false);\n }\n }, [getStats]);\n\n useEffect(() => {\n void refresh();\n }, [refresh]);\n\n const statsItems = useMemo(() => {\n const items: StatItem[] = [{ label: 'Total Users', value: stats?.total ?? '—' }];\n\n METHOD_ORDER.forEach((method) => {\n if (!isSettingEnabled(METHOD_SETTINGS[method])) return;\n items.push({\n label: METHOD_LABELS[method],\n value: stats?.authMethodCounts[method] ?? 0,\n });\n });\n\n return items;\n }, [stats, isSettingEnabled]);\n\n return { statsItems, isLoading, error, refresh };\n}\n"],"names":["AdminUserApiClient","baseUrl","timeoutMs","retryAttempts","getAccessToken","ApiClient","params","query","queryString","url","error","handleApiError","userId","isAdmin","data","status","submissionId","approved","reviewerNotes","rejectionReason","expiryDays","useAdminUsers","config","_internal","useCedrosLogin","users","setUsers","useState","total","setTotal","isLoading","setIsLoading","setError","lastParams","setLastParams","apiClient","useMemo","listUsers","useCallback","response","err","getUser","setSystemAdmin","prev","user","updateUser","updated","deleteUser","forcePasswordReset","adjustCredits","amount","reason","getUserDeposits","getUserCredits","getUserWithdrawalHistory","getUserChats","getUserReferrals","getStats","refresh","clearError","formatDate","dateString","truncateId","id","formatBalance","lamports","AdminUserList","pageSize","refreshInterval","currentUserId","className","onLoad","onUserClick","offset","setOffset","loadError","setLoadError","sortField","setSortField","sortOrder","setSortOrder","toggleSort","field","sortedUsers","a","b","aVal","bVal","fetchUsers","result","useEffect","interval","totalPages","currentPage","goToPage","page","newOffset","jsxs","jsx","Fragment","isCurrentUser","e","formatDateTime","formatSol","formatCredits","formatTxType","txType","formatTxDescription","referenceType","AdminUserDetail","onBack","onEditUser","onAdjustCredits","cedrosPayEnabled","kycApiClient","setUser","credits","setCredits","deposits","setDeposits","chats","setChats","referrals","setReferrals","kycData","setKycData","accreditationData","setAccreditationData","activeTab","setActiveTab","userError","setUserError","creditsError","setCreditsError","depositsError","setDepositsError","chatsError","setChatsError","referralsError","setReferralsError","kycError","setKycError","accreditationError","setAccreditationError","actionInProgress","setActionInProgress","depositsOffset","setDepositsOffset","transactionsOffset","setTransactionsOffset","chatsOffset","setChatsOffset","referralsOffset","setReferralsOffset","fetchUser","userData","fetchDeposits","depositsData","fetchCredits","creditsData","fetchChats","chatsData","fetchReferrals","fetchKyc","fetchAccreditation","handleAccreditationOverride","handleAccreditationReview","handleKycOverride","handleDelete","handlePasswordReset","depositsTotalPages","depositsCurrentPage","transactionsTotalPages","transactionsCurrentPage","goToDepositsPage","goToTransactionsPage","chatsTotalPages","chatsCurrentPage","goToChatsPage","referralsTotalPages","referralsCurrentPage","goToReferralsPage","method","DepositsTab","TransactionsTab","ChatsTab","ReferralsTab","KycTab","AccreditationTab","onPageChange","onRetry","deposit","Pagination","transactions","tx","sessions","session","r","KYC_OVERRIDE_OPTIONS","userKycStatus","userKycVerifiedAt","userKycExpiresAt","onOverride","overrideStatus","setOverrideStatus","overrideInProgress","setOverrideInProgress","overrideError","setOverrideError","effectiveStatus","effectiveVerifiedAt","effectiveExpiresAt","handleOverride","opt","ACCREDITATION_OVERRIDE_OPTIONS","userAccreditationStatus","userAccreditationVerifiedAt","userAccreditationExpiresAt","onReview","reviewingId","setReviewingId","reviewNotes","setReviewNotes","reviewRejection","setReviewRejection","reviewInProgress","setReviewInProgress","reviewError","setReviewError","handleReview","label","sub","METHOD_ORDER","METHOD_LABELS","METHOD_SETTINGS","useUsersStatsSummary","fetchSettings","getValue","useSystemSettings","stats","setStats","settingsFetched","setSettingsFetched","isSettingEnabled","key","value","items"],"mappings":";;;;AAwBO,MAAMA,GAAmB;AAAA,EACtB;AAAA,EAER,YACEC,GACAC,GACAC,GACAC,GACA;AACA,SAAK,SAAS,IAAIC,GAAU,EAAE,SAAAJ,GAAS,WAAAC,GAAW,eAAAC,GAAe,gBAAAC,GAAgB;AAAA,EACnF;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,UAAUE,GAA2D;AACzE,QAAI;AACF,YAAMC,IAAQ,IAAI,gBAAA;AAClB,MAAID,GAAQ,SAAOC,EAAM,IAAI,SAAS,OAAOD,EAAO,KAAK,CAAC,GACtDA,GAAQ,UAAQC,EAAM,IAAI,UAAU,OAAOD,EAAO,MAAM,CAAC;AAC7D,YAAME,IAAcD,EAAM,SAAA,GACpBE,IAAM,eAAeD,IAAc,IAAIA,CAAW,KAAK,EAAE;AAC/D,aAAO,MAAM,KAAK,OAAO,IAA4BC,CAAG;AAAA,IAC1D,S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EAAA;AACzC;"}
@@ -0,0 +1 @@
1
+ "use strict";const e=require("react/jsx-runtime"),r=require("react"),C=require("./useCedrosLogin-DtJorrE7.cjs"),Ie=require("./useSystemSettings-B2jY51ob.cjs");class je{client;constructor(t,i,a,f){this.client=new C.ApiClient({baseUrl:t,timeoutMs:i,retryAttempts:a,getAccessToken:f})}async listUsers(t){try{const i=new URLSearchParams;t?.limit&&i.set("limit",String(t.limit)),t?.offset&&i.set("offset",String(t.offset));const a=i.toString(),f=`/admin/users${a?`?${a}`:""}`;return await this.client.get(f)}catch(i){throw C.handleApiError(i,"Failed to list users")}}async getUser(t){try{return await this.client.get(`/admin/users/${t}`)}catch(i){throw C.handleApiError(i,"Failed to get user")}}async setSystemAdmin(t,i){try{await this.client.patch(`/admin/users/${t}/system-admin`,{isAdmin:i})}catch(a){throw C.handleApiError(a,"Failed to update system admin status")}}async updateUser(t,i){try{return await this.client.patch(`/admin/users/${t}`,i)}catch(a){throw C.handleApiError(a,"Failed to update user")}}async deleteUser(t){try{await this.client.delete(`/admin/users/${t}`)}catch(i){throw C.handleApiError(i,"Failed to delete user")}}async forcePasswordReset(t){try{await this.client.post(`/admin/users/${t}/force-password-reset`,{})}catch(i){throw C.handleApiError(i,"Failed to send password reset email")}}async adjustCredits(t,i){try{await this.client.post(`/admin/users/${t}/credits`,i)}catch(a){throw C.handleApiError(a,"Failed to adjust credits")}}async getUserDeposits(t,i){try{const a=new URLSearchParams;i?.limit&&a.set("limit",String(i.limit)),i?.offset&&a.set("offset",String(i.offset));const f=a.toString(),j=`/admin/users/${t}/deposits${f?`?${f}`:""}`;return await this.client.get(j)}catch(a){throw C.handleApiError(a,"Failed to get user deposits")}}async getUserCredits(t,i){try{const a=new URLSearchParams;i?.limit&&a.set("limit",String(i.limit)),i?.offset&&a.set("offset",String(i.offset));const f=a.toString(),j=`/admin/users/${t}/credits${f?`?${f}`:""}`;return await this.client.get(j)}catch(a){throw C.handleApiError(a,"Failed to get user credits")}}async getUserWithdrawalHistory(t,i){try{const a=new URLSearchParams;i?.limit&&a.set("limit",String(i.limit)),i?.offset&&a.set("offset",String(i.offset));const f=a.toString(),j=`/admin/users/${t}/withdrawal-history${f?`?${f}`:""}`;return await this.client.get(j)}catch(a){throw C.handleApiError(a,"Failed to get user withdrawal history")}}async getUserChats(t,i){try{const a=new URLSearchParams;i?.limit&&a.set("limit",String(i.limit)),i?.offset&&a.set("offset",String(i.offset));const f=a.toString(),j=`/admin/users/${t}/chats${f?`?${f}`:""}`;return await this.client.get(j)}catch(a){throw C.handleApiError(a,"Failed to get user chat history")}}async getUserReferrals(t,i){try{const a=new URLSearchParams;i?.limit&&a.set("limit",String(i.limit)),i?.offset&&a.set("offset",String(i.offset));const f=a.toString(),j=`/admin/users/${t}/referrals${f?`?${f}`:""}`;return await this.client.get(j)}catch(a){throw C.handleApiError(a,"Failed to get user referrals")}}async getUserKyc(t){try{return await this.client.get(`/admin/users/${t}/kyc`)}catch(i){throw C.handleApiError(i,"Failed to get user KYC data")}}async overrideUserKyc(t,i){try{await this.client.post(`/admin/users/${t}/kyc/override`,{status:i})}catch(a){throw C.handleApiError(a,"Failed to override KYC status")}}async getUserAccreditation(t){try{return await this.client.get(`/admin/users/${t}/accreditation`)}catch(i){throw C.handleApiError(i,"Failed to get user accreditation data")}}async reviewAccreditation(t,i,a,f,j){try{await this.client.post(`/admin/accreditation/${t}/review`,{approved:i,reviewerNotes:a,rejectionReason:f,expiryDays:j})}catch(v){throw C.handleApiError(v,"Failed to review accreditation submission")}}async overrideAccreditationStatus(t,i){try{await this.client.post(`/admin/users/${t}/accreditation/override`,{status:i})}catch(a){throw C.handleApiError(a,"Failed to override accreditation status")}}async getStats(){try{return await this.client.get("/admin/users/stats")}catch(t){throw C.handleApiError(t,"Failed to get user stats")}}}function X(){const{config:s,_internal:t}=C.useCedrosLogin(),[i,a]=r.useState([]),[f,j]=r.useState(0),[v,c]=r.useState(!1),[o,h]=r.useState(null),[k,$]=r.useState({}),x=r.useMemo(()=>new je(s.serverUrl,s.requestTimeout,s.retryAttempts,t?.getAccessToken),[s.serverUrl,s.requestTimeout,s.retryAttempts,t]),U=r.useCallback(async u=>{c(!0),h(null),$(u||{});try{const n=await x.listUsers(u);return a(n.users),j(n.total),n}catch(n){const l=n instanceof Error?n:new Error("Failed to list users");throw h(l),l}finally{c(!1)}},[x]),N=r.useCallback(async u=>{c(!0),h(null);try{return await x.getUser(u)}catch(n){const l=n instanceof Error?n:new Error("Failed to get user");throw h(l),l}finally{c(!1)}},[x]),w=r.useCallback(async(u,n)=>{c(!0),h(null);try{await x.setSystemAdmin(u,n),a(l=>l.map(p=>p.id===u?{...p,isSystemAdmin:n}:p))}catch(l){const p=l instanceof Error?l:new Error("Failed to update admin status");throw h(p),p}finally{c(!1)}},[x]),A=r.useCallback(async(u,n)=>{c(!0),h(null);try{const l=await x.updateUser(u,n);return a(p=>p.map(q=>q.id===u?l:q)),l}catch(l){const p=l instanceof Error?l:new Error("Failed to update user");throw h(p),p}finally{c(!1)}},[x]),g=r.useCallback(async u=>{c(!0),h(null);try{await x.deleteUser(u),a(n=>n.filter(l=>l.id!==u)),j(n=>n-1)}catch(n){const l=n instanceof Error?n:new Error("Failed to delete user");throw h(l),l}finally{c(!1)}},[x]),y=r.useCallback(async u=>{c(!0),h(null);try{await x.forcePasswordReset(u)}catch(n){const l=n instanceof Error?n:new Error("Failed to send password reset");throw h(l),l}finally{c(!1)}},[x]),d=r.useCallback(async(u,n,l)=>{c(!0),h(null);try{await x.adjustCredits(u,{amount:n,reason:l})}catch(p){const q=p instanceof Error?p:new Error("Failed to adjust credits");throw h(q),q}finally{c(!1)}},[x]),L=r.useCallback(async(u,n)=>{c(!0),h(null);try{return await x.getUserDeposits(u,n)}catch(l){const p=l instanceof Error?l:new Error("Failed to get user deposits");throw h(p),p}finally{c(!1)}},[x]),E=r.useCallback(async(u,n)=>{c(!0),h(null);try{return await x.getUserCredits(u,n)}catch(l){const p=l instanceof Error?l:new Error("Failed to get user credits");throw h(p),p}finally{c(!1)}},[x]),D=r.useCallback(async(u,n)=>{c(!0),h(null);try{return await x.getUserWithdrawalHistory(u,n)}catch(l){const p=l instanceof Error?l:new Error("Failed to get user withdrawal history");throw h(p),p}finally{c(!1)}},[x]),P=r.useCallback(async(u,n)=>{c(!0),h(null);try{return await x.getUserChats(u,n)}catch(l){const p=l instanceof Error?l:new Error("Failed to get user chat history");throw h(p),p}finally{c(!1)}},[x]),M=r.useCallback(async(u,n)=>{c(!0),h(null);try{return await x.getUserReferrals(u,n)}catch(l){const p=l instanceof Error?l:new Error("Failed to get user referrals");throw h(p),p}finally{c(!1)}},[x]),O=r.useCallback(async()=>{c(!0),h(null);try{return await x.getStats()}catch(u){const n=u instanceof Error?u:new Error("Failed to get user stats");throw h(n),n}finally{c(!1)}},[x]),b=r.useCallback(async()=>{await U(k)},[U,k]),S=r.useCallback(()=>{h(null)},[]);return{users:i,total:f,isLoading:v,error:o,listUsers:U,getUser:N,setSystemAdmin:w,updateUser:A,deleteUser:g,forcePasswordReset:y,adjustCredits:d,getUserDeposits:L,getUserCredits:E,getUserWithdrawalHistory:D,getUserChats:P,getUserReferrals:M,getStats:O,refresh:b,clearError:S}}function xe(s){return new Date(s).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function Je(s){return s.length<=12?s:`${s.slice(0,6)}...${s.slice(-4)}`}function We(s){return s==null?"-":(s/1e9).toFixed(4)}function Ge({pageSize:s=20,refreshInterval:t=0,currentUserId:i,className:a="",onLoad:f,onUserClick:j}){const{users:v,total:c,isLoading:o,error:h,listUsers:k,clearError:$}=X(),[x,U]=r.useState(0),[N,w]=r.useState(null),[A,g]=r.useState("createdAt"),[y,d]=r.useState("desc"),L=b=>{A===b?d(y==="asc"?"desc":"asc"):(g(b),d("desc"))},E=r.useMemo(()=>[...v].sort((b,S)=>{let u,n;switch(A){case"name":u=(b.name||b.email||"").toLowerCase(),n=(S.name||S.email||"").toLowerCase();break;case"createdAt":u=new Date(b.createdAt).getTime(),n=new Date(S.createdAt).getTime();break;case"lastLoginAt":u=b.lastLoginAt?new Date(b.lastLoginAt).getTime():0,n=S.lastLoginAt?new Date(S.lastLoginAt).getTime():0;break;case"balanceLamports":u=b.balanceLamports??0,n=S.balanceLamports??0;break;default:return 0}return u<n?y==="asc"?-1:1:u>n?y==="asc"?1:-1:0}),[v,A,y]),D=r.useCallback(async()=>{try{const b=await k({limit:s,offset:x});f?.(b),w(null)}catch(b){w(b instanceof Error?b.message:"Failed to load users")}},[s,x,k,f]);r.useEffect(()=>{U(0)},[s]),r.useEffect(()=>{D()},[D]),r.useEffect(()=>{if(t<=0)return;const b=setInterval(D,t);return()=>clearInterval(b)},[t,D]);const P=Math.ceil(c/s),M=Math.floor(x/s)+1,O=b=>{const S=(b-1)*s;U(Math.max(0,Math.min(S,Math.max(0,c-1))))};return N||h?e.jsxs("div",{className:`cedros-admin-user-list cedros-admin-user-list-error ${a}`,children:[e.jsx("p",{className:"cedros-admin-error",children:N||h?.message}),e.jsx("button",{type:"button",className:"cedros-button cedros-button-outline",onClick:()=>{$(),w(null),D()},children:"Retry"})]}):o&&v.length===0?e.jsxs("div",{className:`cedros-admin-user-list cedros-admin-user-list-loading ${a}`,children:[e.jsx("span",{className:"cedros-admin-loading-indicator"}),e.jsx("span",{className:"cedros-admin-loading-text",children:"Loading users..."})]}):e.jsxs("div",{className:`cedros-admin-user-list ${a}`,children:[e.jsxs("div",{className:"cedros-admin-user-list-header",children:[e.jsx("h4",{className:"cedros-admin-user-list-title",children:"All Users"}),e.jsxs("div",{className:"cedros-admin-user-list-actions",children:[e.jsxs("span",{className:"cedros-admin-queue-count",children:[c," user",c!==1?"s":""]}),e.jsx("button",{type:"button",className:"cedros-admin__stats-bar-refresh",onClick:D,disabled:o,title:"Refresh list","aria-label":"Refresh list",children:o?"...":"↻"})]})]}),v.length===0?e.jsx("div",{className:"cedros-admin-empty",children:e.jsx("p",{className:"cedros-admin-empty-message",children:"No users found."})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"cedros-admin-user-table",children:[e.jsxs("div",{className:"cedros-admin-user-thead",children:[e.jsx("div",{className:"cedros-admin-user-th",children:e.jsxs("button",{type:"button",className:`cedros-admin-sort-button ${A==="name"?"cedros-admin-sort-active":""}`,onClick:()=>L("name"),"aria-label":"Sort by user",children:["User"," ",e.jsx("span",{className:"cedros-admin-sort-icon",children:A==="name"?y==="asc"?"↑":"↓":"↕"})]})}),e.jsx("div",{className:"cedros-admin-user-th",children:e.jsxs("button",{type:"button",className:`cedros-admin-sort-button ${A==="createdAt"?"cedros-admin-sort-active":""}`,onClick:()=>L("createdAt"),"aria-label":"Sort by registered date",children:["Registered"," ",e.jsx("span",{className:"cedros-admin-sort-icon",children:A==="createdAt"?y==="asc"?"↑":"↓":"↕"})]})}),e.jsx("div",{className:"cedros-admin-user-th",children:e.jsxs("button",{type:"button",className:`cedros-admin-sort-button ${A==="lastLoginAt"?"cedros-admin-sort-active":""}`,onClick:()=>L("lastLoginAt"),"aria-label":"Sort by last login",children:["Last Login"," ",e.jsx("span",{className:"cedros-admin-sort-icon",children:A==="lastLoginAt"?y==="asc"?"↑":"↓":"↕"})]})}),e.jsx("div",{className:"cedros-admin-user-th",children:e.jsxs("button",{type:"button",className:`cedros-admin-sort-button ${A==="balanceLamports"?"cedros-admin-sort-active":""}`,onClick:()=>L("balanceLamports"),"aria-label":"Sort by balance",children:["Balance"," ",e.jsx("span",{className:"cedros-admin-sort-icon",children:A==="balanceLamports"?y==="asc"?"↑":"↓":"↕"})]})})]}),E.map(b=>{const S=b.id===i;return e.jsxs("div",{className:`cedros-admin-user-row ${S?"cedros-admin-user-row-current":""}`,onClick:()=>j?.(b),onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),j?.(b))},role:j?"button":void 0,tabIndex:j?0:void 0,children:[e.jsxs("div",{className:"cedros-admin-user-td cedros-admin-user-info",children:[e.jsx("div",{className:"cedros-admin-user-avatar",children:b.picture?e.jsx("img",{src:b.picture,alt:b.name||b.email||"User",className:"cedros-admin-user-avatar-img",referrerPolicy:"no-referrer"}):e.jsx("span",{className:"cedros-admin-user-avatar-placeholder",children:(b.name?.[0]||b.email?.[0]||"?").toUpperCase()})}),e.jsxs("div",{className:"cedros-admin-user-details",children:[e.jsxs("span",{className:"cedros-admin-user-name",children:[b.name||"Unknown",S&&e.jsx("span",{className:"cedros-admin-user-you",children:"(you)"})]}),e.jsx("span",{className:"cedros-admin-user-email",title:b.email,children:b.email||Je(b.id)})]})]}),e.jsx("div",{className:"cedros-admin-user-td",children:xe(b.createdAt)}),e.jsx("div",{className:"cedros-admin-user-td",children:b.lastLoginAt?xe(b.lastLoginAt):"-"}),e.jsx("div",{className:"cedros-admin-user-td",children:We(b.balanceLamports)})]},b.id)})]}),P>1&&e.jsxs("div",{className:"cedros-admin-pagination",children:[e.jsx("button",{type:"button",className:"cedros-button cedros-button-outline cedros-button-sm",onClick:()=>O(M-1),disabled:M<=1,children:"Previous"}),e.jsxs("span",{className:"cedros-admin-page-info",children:["Page ",M," of ",P," (",c," total)"]}),e.jsx("button",{type:"button",className:"cedros-button cedros-button-outline cedros-button-sm",onClick:()=>O(M+1),disabled:M>=P,children:"Next"})]})]})]})}function ue(s){return new Date(s).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function _(s){return new Date(s).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Qe(s){return s==null?"—":`${(s/1e9).toFixed(4)} SOL`}function Q(s){return s==null?"—":(s/1e9).toFixed(4)}function Xe(s){return{DEPOSIT:"Deposit",SPEND:"Spend",ADJUSTMENT:"Adjustment",REFUND:"Refund"}[s.toUpperCase()]||s}function Ze(s,t){return t?{deposit:"Credit deposit",purchase:"Purchase",api_call:"API usage",subscription:"Subscription",refund:"Refund",bonus:"Bonus credit",promo:"Promotional credit",correction:"Balance correction"}[t.toLowerCase()]||t:{DEPOSIT:"Credit added",SPEND:"Credit used",ADJUSTMENT:"Manual adjustment",REFUND:"Credit refunded"}[s.toUpperCase()]||"—"}function ze({userId:s,onBack:t,currentUserId:i,onEditUser:a,onAdjustCredits:f,cedrosPayEnabled:j=!1,className:v=""}){const{config:c,_internal:o}=C.useCedrosLogin(),{isLoading:h,getUser:k,getUserDeposits:$,getUserCredits:x,getUserChats:U,getUserReferrals:N,deleteUser:w,forcePasswordReset:A,clearError:g}=X(),y=r.useMemo(()=>new je(c.serverUrl,c.requestTimeout,c.retryAttempts,o?.getAccessToken),[c.serverUrl,c.requestTimeout,c.retryAttempts,o]),[d,L]=r.useState(null),[E,D]=r.useState(null),[P,M]=r.useState(null),[O,b]=r.useState(null),[S,u]=r.useState(null),[n,l]=r.useState(null),[p,q]=r.useState(null),[F,V]=r.useState("deposits"),[he,z]=r.useState(null),[ee,H]=r.useState(null),[pe,se]=r.useState(null),[ve,te]=r.useState(null),[ye,ae]=r.useState(null),[ge,I]=r.useState(null),[Ne,B]=r.useState(null),[J,W]=r.useState(!1),[re,we]=r.useState(0),[ie,Se]=r.useState(0),[ne,Ce]=r.useState(0),[ce,Ae]=r.useState(0),R=10,de=r.useCallback(async()=>{try{const m=await k(s);L(m),z(null)}catch(m){z(m instanceof Error?m.message:"Failed to load user")}},[s,k]),oe=r.useCallback(async()=>{try{const T=await $(s,{limit:R,offset:re});M(T),se(null)}catch(m){se(m instanceof Error?m.message:"Failed to load deposits")}},[s,$,re]),G=r.useCallback(async()=>{try{const T=await x(s,{limit:R,offset:ie});D(T),H(null)}catch(m){H(m instanceof Error?m.message:"Failed to load credits")}},[s,x,ie]),le=r.useCallback(async()=>{if(j)try{const T=await U(s,{limit:R,offset:ne});b(T),te(null)}catch(m){te(m instanceof Error?m.message:"Failed to load chat history")}},[s,U,ne,j]),me=r.useCallback(async()=>{try{const T=await N(s,{limit:R,offset:ce});u(T),ae(null)}catch(m){ae(m instanceof Error?m.message:"Failed to load referrals")}},[s,N,ce]),Y=r.useCallback(async()=>{try{const m=await y.getUserKyc(s);l(m),I(null)}catch(m){I(m instanceof Error?m.message:"Failed to load KYC data")}},[s,y]),K=r.useCallback(async()=>{try{const m=await y.getUserAccreditation(s);q(m),B(null)}catch(m){B(m instanceof Error?m.message:"Failed to load accreditation data")}},[s,y]),Ee=r.useCallback(async m=>{try{await y.overrideAccreditationStatus(s,m),await K()}catch(T){B(T instanceof Error?T.message:"Failed to override accreditation status")}},[s,y,K]),ke=r.useCallback(async(m,T,Ye,He)=>{try{await y.reviewAccreditation(m,T,Ye,He),await K()}catch(be){B(be instanceof Error?be.message:"Failed to review accreditation submission")}},[y,K]),Ue=r.useCallback(async m=>{try{await y.overrideUserKyc(s,m),await Y()}catch(T){I(T instanceof Error?T.message:"Failed to override KYC status")}},[s,y,Y]);r.useEffect(()=>{de(),oe(),G(),me(),Y(),K(),j&&le()},[de,oe,G,le,me,Y,K,j]);const Re=async()=>{if(!d)return;if(d.id===i){alert("You cannot delete your own account");return}if(d.isSystemAdmin){alert("Cannot delete a system admin. Remove admin status first.");return}if(window.confirm(`Are you sure you want to delete ${d.name||d.email||"this user"}? This action cannot be undone.`)){W(!0);try{await w(d.id),t()}catch{}finally{W(!1)}}},$e=async()=>{if(!d?.email){alert("User has no email address");return}if(window.confirm(`Send a password reset email to ${d.email}?`)){W(!0);try{await A(d.id),alert("Password reset email sent")}catch{}finally{W(!1)}}},Le=P?Math.ceil(P.total/R):0,Fe=Math.floor(re/R)+1,Te=E?Math.ceil(E.totalTransactions/R):0,Pe=Math.floor(ie/R)+1,De=m=>{we((m-1)*R)},Oe=m=>{Se((m-1)*R)},Me=O?Math.ceil(O.total/R):0,_e=Math.floor(ne/R)+1,qe=m=>{Ce((m-1)*R)},Ke=S?Math.ceil(S.total/R):0,Ve=Math.floor(ce/R)+1,Be=m=>{Ae((m-1)*R)};if(he)return e.jsxs("div",{className:`cedros-admin-user-detail cedros-admin-user-detail-error ${v}`,children:[e.jsx("button",{type:"button",className:"cedros-button cedros-button-outline cedros-button-sm",onClick:t,children:"Back"}),e.jsx("p",{className:"cedros-admin-error",children:he}),e.jsx("button",{type:"button",className:"cedros-button cedros-button-outline",onClick:()=>{g(),z(null),de()},children:"Retry"})]});if(h&&!d)return e.jsxs("div",{className:`cedros-admin-user-detail cedros-admin-user-detail-loading ${v}`,children:[e.jsx("span",{className:"cedros-admin-loading-indicator"}),e.jsx("span",{className:"cedros-admin-loading-text",children:"Loading user..."})]});if(!d)return e.jsxs("div",{className:`cedros-admin-user-detail ${v}`,children:[e.jsx("button",{type:"button",className:"cedros-button cedros-button-outline cedros-button-sm",onClick:t,children:"Back"}),e.jsx("p",{className:"cedros-admin-empty-message",children:"User not found."})]});const fe=d.id===i;return e.jsxs("div",{className:`cedros-admin-user-detail ${v}`,children:[e.jsxs("div",{className:"cedros-admin-user-detail-header",children:[e.jsx("button",{type:"button",className:"cedros-button cedros-button-outline cedros-button-sm cedros-admin-back-btn",onClick:t,children:"Back to Users"}),e.jsxs("div",{className:"cedros-admin-user-detail-actions",children:[a&&e.jsx("button",{type:"button",className:"cedros-button cedros-button-outline cedros-button-sm",onClick:()=>a(d),disabled:J,children:"Edit"}),d.email&&e.jsx("button",{type:"button",className:"cedros-button cedros-button-outline cedros-button-sm",onClick:$e,disabled:J,children:"Reset Password"}),f&&e.jsx("button",{type:"button",className:"cedros-button cedros-button-outline cedros-button-sm",onClick:()=>f(d),disabled:J,children:"Adjust Credits"}),!fe&&!d.isSystemAdmin&&e.jsx("button",{type:"button",className:"cedros-button cedros-button-outline cedros-button-sm cedros-admin-btn-danger",onClick:Re,disabled:J,children:"Delete"})]})]}),e.jsxs("div",{className:"cedros-admin-user-detail-info",children:[e.jsx("div",{className:"cedros-admin-user-detail-avatar",children:d.picture?e.jsx("img",{src:d.picture,alt:d.name||d.email||"User",className:"cedros-admin-user-detail-avatar-img",referrerPolicy:"no-referrer"}):e.jsx("span",{className:"cedros-admin-user-detail-avatar-placeholder",children:(d.name?.[0]||d.email?.[0]||"?").toUpperCase()})}),e.jsxs("div",{className:"cedros-admin-user-detail-meta",children:[e.jsxs("h2",{className:"cedros-admin-user-detail-name",children:[d.name||"Unknown",fe&&e.jsx("span",{className:"cedros-admin-user-you",children:"(you)"})]}),e.jsxs("p",{className:"cedros-admin-user-detail-email",children:[d.email||"No email",d.emailVerified&&e.jsx("span",{className:"cedros-admin-verified-badge",title:"Email verified",children:"Verified"})]}),d.isSystemAdmin&&e.jsx("div",{className:"cedros-admin-user-detail-badges",children:e.jsx("span",{className:"cedros-admin-admin-badge cedros-admin-admin-badge-yes",children:"System Admin"})}),e.jsxs("div",{className:"cedros-admin-user-detail-methods",children:[e.jsx("span",{className:"cedros-admin-user-detail-methods-label",children:"Auth Methods:"}),d.authMethods.length>0?d.authMethods.map(m=>e.jsx("span",{className:`cedros-admin-auth-badge cedros-admin-auth-badge-${m}`,children:m},m)):e.jsx("span",{className:"cedros-admin-auth-badge cedros-admin-auth-badge-none",children:"none"})]}),e.jsxs("p",{className:"cedros-admin-user-detail-dates",children:["Registered: ",ue(d.createdAt)," | Updated: ",ue(d.updatedAt)]}),d.referralCode&&e.jsxs("div",{className:"cedros-admin-user-detail-referral",children:[e.jsx("span",{className:"cedros-admin-user-detail-referral-label",children:"Referral:"}),e.jsx("span",{className:"cedros-admin-user-detail-referral-code",children:d.referralCode}),d.referralCount!==void 0&&d.referralCount>0&&e.jsxs("span",{className:"cedros-admin-user-detail-referral-count",children:["(",d.referralCount," referred)"]}),d.referredBy&&e.jsxs("span",{className:"cedros-admin-user-detail-referred-by",children:["Referred by:"," ",e.jsx("button",{type:"button",className:"cedros-admin-user-uuid-link",onClick:()=>navigator.clipboard?.writeText(d.referredBy),title:"Click to copy referrer UUID",children:d.referredBy})]})]})]})]}),ee?e.jsxs("div",{className:"cedros-admin-stats-error",children:[e.jsx("p",{className:"cedros-admin-error-inline",children:ee}),e.jsx("button",{type:"button",className:"cedros-button cedros-button-outline cedros-button-sm",onClick:()=>{H(null),G()},children:"Retry"})]}):E?e.jsxs("div",{className:"cedros-admin-user-detail-stats",children:[e.jsxs("div",{className:"cedros-admin-stat-card",children:[e.jsx("span",{className:"cedros-admin-stat-label",children:"Credit Balance"}),e.jsx("span",{className:"cedros-admin-stat-value",children:Q(E.stats.currentBalanceLamports)})]}),e.jsxs("div",{className:"cedros-admin-stat-card",children:[e.jsx("span",{className:"cedros-admin-stat-label",children:"Total Credited"}),e.jsx("span",{className:"cedros-admin-stat-value",children:Q(E.stats.totalDepositedLamports)})]}),e.jsxs("div",{className:"cedros-admin-stat-card",children:[e.jsx("span",{className:"cedros-admin-stat-label",children:"Total Spent"}),e.jsx("span",{className:"cedros-admin-stat-value",children:Q(E.stats.totalSpentLamports)})]}),e.jsxs("div",{className:"cedros-admin-stat-card",children:[e.jsx("span",{className:"cedros-admin-stat-label",children:"Deposits"}),e.jsx("span",{className:"cedros-admin-stat-value",children:E.stats.depositCount})]}),e.jsxs("div",{className:"cedros-admin-stat-card",children:[e.jsx("span",{className:"cedros-admin-stat-label",children:"Transactions"}),e.jsx("span",{className:"cedros-admin-stat-value",children:E.stats.spendCount})]})]}):e.jsxs("div",{className:"cedros-admin-stats-loading",children:[e.jsx("span",{className:"cedros-admin-loading-indicator"}),e.jsx("span",{children:"Loading credit stats..."})]}),e.jsxs("div",{className:"cedros-admin-user-detail-tabs",children:[e.jsxs("button",{type:"button",className:`cedros-admin-tab ${F==="deposits"?"cedros-admin-tab-active":""}`,onClick:()=>V("deposits"),children:["Deposits (",P?.total??0,")"]}),e.jsxs("button",{type:"button",className:`cedros-admin-tab ${F==="transactions"?"cedros-admin-tab-active":""}`,onClick:()=>V("transactions"),children:["Credits (",E?.totalTransactions??0,")"]}),j&&e.jsxs("button",{type:"button",className:`cedros-admin-tab ${F==="chats"?"cedros-admin-tab-active":""}`,onClick:()=>V("chats"),children:["Chats (",O?.total??0,")"]}),e.jsxs("button",{type:"button",className:`cedros-admin-tab ${F==="referrals"?"cedros-admin-tab-active":""}`,onClick:()=>V("referrals"),children:["Referrals (",S?.total??d.referralCount??0,")"]}),e.jsxs("button",{type:"button",className:`cedros-admin-tab ${F==="kyc"?"cedros-admin-tab-active":""}`,onClick:()=>V("kyc"),children:["KYC (",n?.totalSessions??0,")"]}),e.jsxs("button",{type:"button",className:`cedros-admin-tab ${F==="accreditation"?"cedros-admin-tab-active":""}`,onClick:()=>V("accreditation"),children:["Accreditation (",p?.totalSubmissions??0,")"]})]}),e.jsxs("div",{className:"cedros-admin-user-detail-content",children:[F==="deposits"&&e.jsx(es,{deposits:P?.deposits??[],total:P?.total??0,currentPage:Fe,totalPages:Le,onPageChange:De,isLoading:h,error:pe,onRetry:()=>{se(null),oe()}}),F==="transactions"&&e.jsx(ss,{transactions:E?.transactions??[],total:E?.totalTransactions??0,currentPage:Pe,totalPages:Te,onPageChange:Oe,error:ee,onRetry:()=>{H(null),G()},isLoading:h}),F==="chats"&&j&&e.jsx(ts,{sessions:O?.sessions??[],total:O?.total??0,currentPage:_e,totalPages:Me,onPageChange:qe,error:ve,onRetry:()=>{te(null),le()},isLoading:h}),F==="referrals"&&e.jsx(as,{referrals:S?.users??[],total:S?.total??0,currentPage:Ve,totalPages:Ke,onPageChange:Be,error:ye,onRetry:()=>{ae(null),me()},isLoading:h}),F==="kyc"&&e.jsx(is,{kycData:n,userKycStatus:d.kycStatus,userKycVerifiedAt:d.kycVerifiedAt,userKycExpiresAt:d.kycExpiresAt,error:ge,onRetry:()=>{I(null),Y()},onOverride:Ue}),F==="accreditation"&&e.jsx(cs,{accreditationData:p,userAccreditationStatus:d.accreditationStatus,userAccreditationVerifiedAt:d.accreditationVerifiedAt,userAccreditationExpiresAt:d.accreditationExpiresAt,error:Ne,onRetry:()=>{B(null),K()},onOverride:Ee,onReview:ke})]})]})}function es({deposits:s,total:t,currentPage:i,totalPages:a,onPageChange:f,isLoading:j,error:v,onRetry:c}){return v?e.jsxs("div",{className:"cedros-admin-tab-error",children:[e.jsx("p",{className:"cedros-admin-error-inline",children:v}),e.jsx("button",{type:"button",className:"cedros-button cedros-button-outline cedros-button-sm",onClick:c,children:"Retry"})]}):j&&s.length===0?e.jsxs("div",{className:"cedros-admin-tab-loading",children:[e.jsx("span",{className:"cedros-admin-loading-indicator"}),e.jsx("span",{children:"Loading deposits..."})]}):t===0?e.jsx("div",{className:"cedros-admin-empty-message",children:"No deposits found."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"cedros-admin-list-table",children:[e.jsxs("div",{className:"cedros-admin-list-thead",children:[e.jsx("div",{className:"cedros-admin-list-th",children:"Date"}),e.jsx("div",{className:"cedros-admin-list-th",children:"Amount"}),e.jsx("div",{className:"cedros-admin-list-th",children:"Status"}),e.jsx("div",{className:"cedros-admin-list-th",children:"Transaction"})]}),s.map(o=>e.jsxs("div",{className:"cedros-admin-list-row",children:[e.jsx("div",{className:"cedros-admin-list-td",children:_(o.createdAt)}),e.jsx("div",{className:"cedros-admin-list-td",children:Qe(o.amountLamports)}),e.jsx("div",{className:"cedros-admin-list-td",children:e.jsx("span",{className:`cedros-admin-status-badge cedros-admin-status-${o.status}`,children:o.status})}),e.jsx("div",{className:"cedros-admin-list-td cedros-admin-list-td-actions",children:o.txSignature?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"cedros-admin-list-td-mono",title:o.txSignature,children:[o.txSignature.slice(0,8),"..."]}),e.jsx("a",{href:`https://orbmarkets.io/tx/${o.txSignature}`,target:"_blank",rel:"noopener noreferrer",className:"cedros-admin-icon-link",title:"View on Orbmarkets","aria-label":"View transaction on Orbmarkets",children:"↗"})]}):e.jsx("span",{className:"cedros-admin-list-td-muted",children:"—"})})]},o.id))]}),a>1&&e.jsx(Z,{currentPage:i,totalPages:a,total:t,onPageChange:f})]})}function ss({transactions:s,total:t,currentPage:i,totalPages:a,onPageChange:f,isLoading:j,error:v,onRetry:c}){return v?e.jsxs("div",{className:"cedros-admin-tab-error",children:[e.jsx("p",{className:"cedros-admin-error-inline",children:v}),e.jsx("button",{type:"button",className:"cedros-button cedros-button-outline cedros-button-sm",onClick:c,children:"Retry"})]}):j&&s.length===0?e.jsxs("div",{className:"cedros-admin-tab-loading",children:[e.jsx("span",{className:"cedros-admin-loading-indicator"}),e.jsx("span",{children:"Loading transactions..."})]}):t===0?e.jsx("div",{className:"cedros-admin-empty-message",children:"No credit transactions found."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"cedros-admin-list-table",children:[e.jsxs("div",{className:"cedros-admin-list-thead",children:[e.jsx("div",{className:"cedros-admin-list-th",children:"Date"}),e.jsx("div",{className:"cedros-admin-list-th",children:"Type"}),e.jsx("div",{className:"cedros-admin-list-th",children:"Description"}),e.jsx("div",{className:"cedros-admin-list-th",children:"Amount"})]}),s.map(o=>e.jsxs("div",{className:"cedros-admin-list-row",children:[e.jsx("div",{className:"cedros-admin-list-td",children:_(o.createdAt)}),e.jsx("div",{className:"cedros-admin-list-td",children:e.jsx("span",{className:`cedros-admin-tx-type cedros-admin-tx-type-${o.txType.toLowerCase()}`,children:Xe(o.txType)})}),e.jsx("div",{className:"cedros-admin-list-td",children:Ze(o.txType,o.referenceType)}),e.jsxs("div",{className:`cedros-admin-list-td ${o.amountLamports>=0?"cedros-admin-amount-positive":"cedros-admin-amount-negative"}`,children:[o.amountLamports>=0?"+":"",Q(o.amountLamports)]})]},o.id))]}),a>1&&e.jsx(Z,{currentPage:i,totalPages:a,total:t,onPageChange:f})]})}function ts({sessions:s,total:t,currentPage:i,totalPages:a,onPageChange:f,isLoading:j,error:v,onRetry:c}){return v?e.jsxs("div",{className:"cedros-admin-tab-error",children:[e.jsx("p",{className:"cedros-admin-error-inline",children:v}),e.jsx("button",{type:"button",className:"cedros-button cedros-button-outline cedros-button-sm",onClick:c,children:"Retry"})]}):j&&s.length===0?e.jsxs("div",{className:"cedros-admin-tab-loading",children:[e.jsx("span",{className:"cedros-admin-loading-indicator"}),e.jsx("span",{children:"Loading chat history..."})]}):t===0?e.jsx("div",{className:"cedros-admin-empty-message",children:"No chat sessions found."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"cedros-admin-list-table",children:[e.jsxs("div",{className:"cedros-admin-list-thead",children:[e.jsx("div",{className:"cedros-admin-list-th",children:"Date"}),e.jsx("div",{className:"cedros-admin-list-th",children:"Session"}),e.jsx("div",{className:"cedros-admin-list-th",children:"Messages"})]}),s.map(o=>e.jsxs("div",{className:"cedros-admin-list-row",children:[e.jsx("div",{className:"cedros-admin-list-td",children:_(o.createdAt)}),e.jsx("div",{className:"cedros-admin-list-td",children:o.title||`Chat ${o.id.slice(0,8)}...`}),e.jsx("div",{className:"cedros-admin-list-td",children:o.messageCount})]},o.id))]}),a>1&&e.jsx(Z,{currentPage:i,totalPages:a,total:t,onPageChange:f})]})}function as({referrals:s,total:t,currentPage:i,totalPages:a,onPageChange:f,isLoading:j,error:v,onRetry:c}){return v?e.jsxs("div",{className:"cedros-admin-tab-error",children:[e.jsx("p",{className:"cedros-admin-error-inline",children:v}),e.jsx("button",{type:"button",className:"cedros-button cedros-button-outline cedros-button-sm",onClick:c,children:"Retry"})]}):j&&s.length===0?e.jsxs("div",{className:"cedros-admin-tab-loading",children:[e.jsx("span",{className:"cedros-admin-loading-indicator"}),e.jsx("span",{children:"Loading referrals..."})]}):t===0?e.jsx("div",{className:"cedros-admin-empty-message",children:"No referred users found."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"cedros-admin-list-table",children:[e.jsxs("div",{className:"cedros-admin-list-thead",children:[e.jsx("div",{className:"cedros-admin-list-th",children:"Name"}),e.jsx("div",{className:"cedros-admin-list-th",children:"Email"}),e.jsx("div",{className:"cedros-admin-list-th",children:"Joined"}),e.jsx("div",{className:"cedros-admin-list-th",children:"Last Login"})]}),s.map(o=>e.jsxs("div",{className:"cedros-admin-list-row",children:[e.jsx("div",{className:"cedros-admin-list-td",children:o.name||"—"}),e.jsx("div",{className:"cedros-admin-list-td",children:o.email||"—"}),e.jsx("div",{className:"cedros-admin-list-td",children:ue(o.createdAt)}),e.jsx("div",{className:"cedros-admin-list-td",children:o.lastLoginAt?_(o.lastLoginAt):"—"})]},o.id))]}),a>1&&e.jsx(Z,{currentPage:i,totalPages:a,total:t,onPageChange:f})]})}const rs=[{value:"none",label:"None (reset)"},{value:"verified",label:"Verified"},{value:"failed",label:"Failed"}];function is({kycData:s,userKycStatus:t,userKycVerifiedAt:i,userKycExpiresAt:a,error:f,onRetry:j,onOverride:v}){const[c,o]=r.useState("none"),[h,k]=r.useState(!1),[$,x]=r.useState(null),U=s?.status??t??"none",N=s?.verifiedAt??i,w=s?.expiresAt??a,A=async()=>{if(window.confirm(`Override KYC status to "${c}" for this user?`)){k(!0),x(null);try{await v(c)}catch(y){x(y instanceof Error?y.message:"Override failed")}finally{k(!1)}}};return f?e.jsxs("div",{className:"cedros-admin-tab-error",children:[e.jsx("p",{className:"cedros-admin-error-inline",children:f}),e.jsx("button",{type:"button",className:"cedros-button cedros-button-outline cedros-button-sm",onClick:j,children:"Retry"})]}):!s&&!t?e.jsxs("div",{className:"cedros-admin-tab-loading",children:[e.jsx("span",{className:"cedros-admin-loading-indicator"}),e.jsx("span",{children:"Loading KYC data..."})]}):e.jsxs("div",{className:"cedros-kyc-admin-tab",children:[e.jsxs("div",{className:"cedros-kyc-admin-tab-summary",children:[e.jsxs("div",{className:"cedros-kyc-admin-tab-row",children:[e.jsx("span",{className:"cedros-kyc-admin-tab-label",children:"Status"}),e.jsx("span",{className:`cedros-admin-status-badge cedros-kyc-status-${U}`,children:U})]}),N&&e.jsxs("div",{className:"cedros-kyc-admin-tab-row",children:[e.jsx("span",{className:"cedros-kyc-admin-tab-label",children:"Verified at"}),e.jsx("span",{children:_(N)})]}),w&&e.jsxs("div",{className:"cedros-kyc-admin-tab-row",children:[e.jsx("span",{className:"cedros-kyc-admin-tab-label",children:"Expires at"}),e.jsx("span",{children:_(w)})]})]}),e.jsxs("div",{className:"cedros-kyc-admin-override",children:[e.jsx("span",{className:"cedros-kyc-admin-override-label",children:"Override status"}),e.jsx("select",{className:"cedros-kyc-admin-override-select",value:c,onChange:g=>o(g.target.value),disabled:h,"aria-label":"Select KYC override status",children:rs.map(g=>e.jsx("option",{value:g.value,children:g.label},g.value))}),e.jsx("button",{type:"button",className:"cedros-button cedros-button-outline cedros-button-sm",onClick:A,disabled:h,children:h?"Saving...":"Apply Override"}),$&&e.jsx("p",{className:"cedros-admin-error-inline",children:$})]}),s&&s.sessions.length>0?e.jsxs("div",{className:"cedros-admin-list-table",children:[e.jsxs("div",{className:"cedros-admin-list-thead",children:[e.jsx("div",{className:"cedros-admin-list-th",children:"Date"}),e.jsx("div",{className:"cedros-admin-list-th",children:"Provider"}),e.jsx("div",{className:"cedros-admin-list-th",children:"Status"}),e.jsx("div",{className:"cedros-admin-list-th",children:"Error"}),e.jsx("div",{className:"cedros-admin-list-th",children:"Completed"})]}),s.sessions.map(g=>e.jsxs("div",{className:"cedros-admin-list-row",children:[e.jsx("div",{className:"cedros-admin-list-td",children:_(g.createdAt)}),e.jsx("div",{className:"cedros-admin-list-td",children:g.provider}),e.jsx("div",{className:"cedros-admin-list-td",children:e.jsx("span",{className:`cedros-admin-status-badge cedros-kyc-status-${g.status}`,children:g.status})}),e.jsx("div",{className:"cedros-admin-list-td cedros-admin-list-td-muted",children:g.errorCode?`${g.errorCode}${g.errorReason?`: ${g.errorReason}`:""}`:"—"}),e.jsx("div",{className:"cedros-admin-list-td",children:g.completedAt?_(g.completedAt):"—"})]},g.id))]}):s&&e.jsx("div",{className:"cedros-admin-empty-message",children:"No verification sessions found."})]})}const ns=[{value:"none",label:"None (reset)"},{value:"approved",label:"Approved"},{value:"rejected",label:"Rejected"}];function cs({accreditationData:s,userAccreditationStatus:t,userAccreditationVerifiedAt:i,userAccreditationExpiresAt:a,error:f,onRetry:j,onOverride:v,onReview:c}){const[o,h]=r.useState("none"),[k,$]=r.useState(!1),[x,U]=r.useState(null),[N,w]=r.useState(null),[A,g]=r.useState(""),[y,d]=r.useState(""),[L,E]=r.useState(!1),[D,P]=r.useState(null),M=s?.status??t??"none",O=s?.verifiedAt??i,b=s?.expiresAt??a,S=async()=>{if(window.confirm(`Override accreditation status to "${o}" for this user?`)){$(!0),U(null);try{await v(o)}catch(l){U(l instanceof Error?l.message:"Override failed")}finally{$(!1)}}},u=async(n,l)=>{const p=l?"approve":"reject";if(window.confirm(`${p.charAt(0).toUpperCase()+p.slice(1)} this submission?`)){E(!0),P(null);try{await c(n,l,A||void 0,l?void 0:y||void 0),w(null),g(""),d("")}catch(F){P(F instanceof Error?F.message:"Review failed")}finally{E(!1)}}};return f?e.jsxs("div",{className:"cedros-admin-tab-error",children:[e.jsx("p",{className:"cedros-admin-error-inline",children:f}),e.jsx("button",{type:"button",className:"cedros-button cedros-button-outline cedros-button-sm",onClick:j,children:"Retry"})]}):!s&&!t?e.jsxs("div",{className:"cedros-admin-tab-loading",children:[e.jsx("span",{className:"cedros-admin-loading-indicator"}),e.jsx("span",{children:"Loading accreditation data..."})]}):e.jsxs("div",{className:"cedros-accreditation-admin-tab",children:[e.jsxs("div",{className:"cedros-kyc-admin-tab-summary",children:[e.jsxs("div",{className:"cedros-kyc-admin-tab-row",children:[e.jsx("span",{className:"cedros-kyc-admin-tab-label",children:"Status"}),e.jsx("span",{className:`cedros-admin-status-badge cedros-accreditation-status-${M}`,children:M})]}),O&&e.jsxs("div",{className:"cedros-kyc-admin-tab-row",children:[e.jsx("span",{className:"cedros-kyc-admin-tab-label",children:"Verified at"}),e.jsx("span",{children:_(O)})]}),b&&e.jsxs("div",{className:"cedros-kyc-admin-tab-row",children:[e.jsx("span",{className:"cedros-kyc-admin-tab-label",children:"Expires at"}),e.jsx("span",{children:_(b)})]})]}),e.jsxs("div",{className:"cedros-kyc-admin-override",children:[e.jsx("span",{className:"cedros-kyc-admin-override-label",children:"Override status"}),e.jsx("select",{className:"cedros-kyc-admin-override-select",value:o,onChange:n=>h(n.target.value),disabled:k,"aria-label":"Select accreditation override status",children:ns.map(n=>e.jsx("option",{value:n.value,children:n.label},n.value))}),e.jsx("button",{type:"button",className:"cedros-button cedros-button-outline cedros-button-sm",onClick:S,disabled:k,children:k?"Saving...":"Apply Override"}),x&&e.jsx("p",{className:"cedros-admin-error-inline",children:x})]}),s&&s.submissions.length>0?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"cedros-admin-list-table",children:[e.jsxs("div",{className:"cedros-admin-list-thead",children:[e.jsx("div",{className:"cedros-admin-list-th",children:"Date"}),e.jsx("div",{className:"cedros-admin-list-th",children:"Method"}),e.jsx("div",{className:"cedros-admin-list-th",children:"Status"}),e.jsx("div",{className:"cedros-admin-list-th",children:"Expires"}),e.jsx("div",{className:"cedros-admin-list-th",children:"Actions"})]}),s.submissions.map(n=>e.jsxs("div",{className:"cedros-admin-list-row",children:[e.jsx("div",{className:"cedros-admin-list-td",children:_(n.createdAt)}),e.jsx("div",{className:"cedros-admin-list-td",children:n.method.replace(/_/g," ")}),e.jsx("div",{className:"cedros-admin-list-td",children:e.jsx("span",{className:`cedros-admin-status-badge cedros-accreditation-status-${n.status}`,children:n.status})}),e.jsx("div",{className:"cedros-admin-list-td",children:n.expiresAt?_(n.expiresAt):"—"}),e.jsx("div",{className:"cedros-admin-list-td cedros-admin-list-td-actions",children:n.status==="pending"&&e.jsx("button",{type:"button",className:"cedros-button cedros-button-outline cedros-button-sm",onClick:()=>w(N===n.id?null:n.id),children:"Review"})})]},n.id))]}),N&&e.jsxs("div",{className:"cedros-accreditation-review-panel",children:[e.jsx("p",{className:"cedros-accreditation-review-title",children:"Review submission"}),e.jsx("label",{className:"cedros-kyc-admin-tab-label",htmlFor:"review-notes",children:"Reviewer notes (internal)"}),e.jsx("input",{id:"review-notes",type:"text",className:"cedros-input cedros-input-sm",value:A,onChange:n=>g(n.target.value),placeholder:"Optional internal notes",disabled:L}),e.jsx("label",{className:"cedros-kyc-admin-tab-label",htmlFor:"review-rejection",children:"Rejection reason (shown to user if rejected)"}),e.jsx("input",{id:"review-rejection",type:"text",className:"cedros-input cedros-input-sm",value:y,onChange:n=>d(n.target.value),placeholder:"Required when rejecting",disabled:L}),e.jsxs("div",{className:"cedros-accreditation-review-actions",children:[e.jsx("button",{type:"button",className:"cedros-button cedros-button-outline cedros-button-sm",onClick:()=>u(N,!0),disabled:L,children:L?"Saving...":"Approve"}),e.jsx("button",{type:"button",className:"cedros-button cedros-button-outline cedros-button-sm cedros-admin-btn-danger",onClick:()=>u(N,!1),disabled:L||!y.trim(),children:L?"Saving...":"Reject"})]}),D&&e.jsx("p",{className:"cedros-admin-error-inline",children:D})]})]}):s&&e.jsx("div",{className:"cedros-admin-empty-message",children:"No accreditation submissions found."})]})}function Z({currentPage:s,totalPages:t,total:i,onPageChange:a}){return e.jsxs("div",{className:"cedros-admin-pagination",children:[e.jsx("button",{type:"button",className:"cedros-button cedros-button-outline cedros-button-sm",onClick:()=>a(s-1),disabled:s<=1,children:"Previous"}),e.jsxs("span",{className:"cedros-admin-page-info",children:["Page ",s," of ",t," (",i," total)"]}),e.jsx("button",{type:"button",className:"cedros-button cedros-button-outline cedros-button-sm",onClick:()=>a(s+1),disabled:s>=t,children:"Next"})]})}const ds=["email","google","apple","solana","webauthn","sso"],os={email:"Email Users",google:"Google Users",apple:"Apple Users",solana:"Solana Users",webauthn:"Passkey Users",sso:"SSO Provider Users"},ls={email:"auth_email_enabled",google:"auth_google_enabled",apple:"auth_apple_enabled",solana:"auth_solana_enabled",webauthn:"auth_webauthn_enabled",sso:"feature_sso"};function ms(){const{getStats:s}=X(),{fetchSettings:t,getValue:i}=Ie.useSystemSettings(),[a,f]=r.useState(null),[j,v]=r.useState(!1),[c,o]=r.useState(null),[h,k]=r.useState(!1);r.useEffect(()=>{h||(t(),k(!0))},[t,h]);const $=r.useCallback(N=>{const w=i(N);return w===void 0?!1:w==="true"||w==="1"},[i]),x=r.useCallback(async()=>{v(!0),o(null);try{const N=await s();f(N)}catch(N){o(N instanceof Error?N.message:"Failed to load user stats")}finally{v(!1)}},[s]);return r.useEffect(()=>{x()},[x]),{statsItems:r.useMemo(()=>{const N=[{label:"Total Users",value:a?.total??"—"}];return ds.forEach(w=>{$(ls[w])&&N.push({label:os[w],value:a?.authMethodCounts[w]??0})}),N},[a,$]),isLoading:j,error:c,refresh:x}}exports.AdminUserDetail=ze;exports.AdminUserList=Ge;exports.useAdminUsers=X;exports.useUsersStatsSummary=ms;