@cedros/login-react 0.0.41 → 0.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AuthenticationSettings-CSoFp-_2.js → AuthenticationSettings-CxAubcoz.js} +1 -1
- package/dist/{AuthenticationSettings-CSoFp-_2.js.map → AuthenticationSettings-CxAubcoz.js.map} +1 -1
- package/dist/{AuthenticationSettings-Cu5Z2mTC.cjs → AuthenticationSettings-DPr882lj.cjs} +1 -1
- package/dist/{AuthenticationSettings-Cu5Z2mTC.cjs.map → AuthenticationSettings-DPr882lj.cjs.map} +1 -1
- package/dist/{AuthenticationSettings-DABzZHuI.cjs → AuthenticationSettings-Y40T1djV.cjs} +1 -1
- package/dist/{AuthenticationSettings-DABzZHuI.cjs.map → AuthenticationSettings-Y40T1djV.cjs.map} +1 -1
- package/dist/{AuthenticationSettings-D4ExU-2a.js → AuthenticationSettings-aVBFKKZ-.js} +1 -1
- package/dist/{AuthenticationSettings-D4ExU-2a.js.map → AuthenticationSettings-aVBFKKZ-.js.map} +1 -1
- package/dist/AutosaveStatus-ByD01ENa.cjs +1 -0
- package/dist/AutosaveStatus-ByD01ENa.cjs.map +1 -0
- package/dist/{AutosaveStatus-DMjvXzP2.js → AutosaveStatus-DtF_58rC.js} +608 -279
- package/dist/AutosaveStatus-DtF_58rC.js.map +1 -0
- package/dist/{CreditSystemSettings-BjQdysRS.js → CreditSystemSettings-BQek2Ux2.js} +1 -1
- package/dist/{CreditSystemSettings-BjQdysRS.js.map → CreditSystemSettings-BQek2Ux2.js.map} +1 -1
- package/dist/{CreditSystemSettings-DfSfQVE8.cjs → CreditSystemSettings-CbuCce29.cjs} +1 -1
- package/dist/{CreditSystemSettings-DfSfQVE8.cjs.map → CreditSystemSettings-CbuCce29.cjs.map} +1 -1
- package/dist/{CreditSystemSettings-BWuiRTtA.cjs → CreditSystemSettings-DHG_jhz9.cjs} +1 -1
- package/dist/{CreditSystemSettings-BWuiRTtA.cjs.map → CreditSystemSettings-DHG_jhz9.cjs.map} +1 -1
- package/dist/{CreditSystemSettings-Du3ac0ID.js → CreditSystemSettings-GDKgYc7I.js} +1 -1
- package/dist/{CreditSystemSettings-Du3ac0ID.js.map → CreditSystemSettings-GDKgYc7I.js.map} +1 -1
- package/dist/{EmailRegisterForm-CMXsa-_r.js → EmailRegisterForm-p2X5QP58.js} +147 -147
- package/dist/EmailRegisterForm-p2X5QP58.js.map +1 -0
- package/dist/EmailRegisterForm-xFb6MaVA.cjs +1 -0
- package/dist/EmailRegisterForm-xFb6MaVA.cjs.map +1 -0
- package/dist/{EmailSettings-CswtKXhb.cjs → EmailSettings-Cg4Z7139.cjs} +1 -1
- package/dist/{EmailSettings-CswtKXhb.cjs.map → EmailSettings-Cg4Z7139.cjs.map} +1 -1
- package/dist/{EmailSettings-BcHo0cqk.cjs → EmailSettings-CjxBg0cE.cjs} +1 -1
- package/dist/{EmailSettings-BcHo0cqk.cjs.map → EmailSettings-CjxBg0cE.cjs.map} +1 -1
- package/dist/{EmailSettings-CjngJwDS.js → EmailSettings-Ct6nFslP.js} +1 -1
- package/dist/{EmailSettings-CjngJwDS.js.map → EmailSettings-Ct6nFslP.js.map} +1 -1
- package/dist/{EmailSettings-ASDHfI0K.js → EmailSettings-D2pCqTKC.js} +1 -1
- package/dist/{EmailSettings-ASDHfI0K.js.map → EmailSettings-D2pCqTKC.js.map} +1 -1
- package/dist/{EmbeddedWalletSettings-CUY_X7Vj.js → EmbeddedWalletSettings-Bus7UyOX.js} +1 -1
- package/dist/{EmbeddedWalletSettings-CUY_X7Vj.js.map → EmbeddedWalletSettings-Bus7UyOX.js.map} +1 -1
- package/dist/{EmbeddedWalletSettings-BXlboZ9-.cjs → EmbeddedWalletSettings-CfzvFYnn.cjs} +1 -1
- package/dist/{EmbeddedWalletSettings-BXlboZ9-.cjs.map → EmbeddedWalletSettings-CfzvFYnn.cjs.map} +1 -1
- package/dist/{EmbeddedWalletSettings-CPLbqlxJ.js → EmbeddedWalletSettings-PwFgtGmK.js} +1 -1
- package/dist/{EmbeddedWalletSettings-CPLbqlxJ.js.map → EmbeddedWalletSettings-PwFgtGmK.js.map} +1 -1
- package/dist/{EmbeddedWalletSettings-BkwIbTkL.cjs → EmbeddedWalletSettings-t0_5poBu.cjs} +1 -1
- package/dist/{EmbeddedWalletSettings-BkwIbTkL.cjs.map → EmbeddedWalletSettings-t0_5poBu.cjs.map} +1 -1
- package/dist/GoogleLoginButton-2zNTIKMm.cjs +1 -0
- package/dist/GoogleLoginButton-2zNTIKMm.cjs.map +1 -0
- package/dist/{GoogleLoginButton-qf4A_A3G.js → GoogleLoginButton-C1WNu7W3.js} +41 -40
- package/dist/GoogleLoginButton-C1WNu7W3.js.map +1 -0
- package/dist/LoadingSpinner-6vml-zwr.js.map +1 -1
- package/dist/LoadingSpinner-d6sSxgQN.cjs.map +1 -1
- package/dist/{PermissionsSection-BeFhIgQy.js → PermissionsSection-BDDiEfho.js} +81 -77
- package/dist/{PermissionsSection-BeFhIgQy.js.map → PermissionsSection-BDDiEfho.js.map} +1 -1
- package/dist/PermissionsSection-CSB_Ikj9.cjs +1 -0
- package/dist/{PermissionsSection-B-6DJnN8.cjs.map → PermissionsSection-CSB_Ikj9.cjs.map} +1 -1
- package/dist/{ServerSettings-BygCxOTY.cjs → ServerSettings-BjLFs_sb.cjs} +1 -1
- package/dist/{ServerSettings-BygCxOTY.cjs.map → ServerSettings-BjLFs_sb.cjs.map} +1 -1
- package/dist/{ServerSettings-B9PNMse1.js → ServerSettings-COkhan4u.js} +1 -1
- package/dist/{ServerSettings-B9PNMse1.js.map → ServerSettings-COkhan4u.js.map} +1 -1
- package/dist/{ServerSettings-BLoWX7KG.js → ServerSettings-D7WJDTbZ.js} +1 -1
- package/dist/{ServerSettings-BLoWX7KG.js.map → ServerSettings-D7WJDTbZ.js.map} +1 -1
- package/dist/{ServerSettings-CgBdYspU.cjs → ServerSettings-Dmw2rpFA.cjs} +1 -1
- package/dist/{ServerSettings-CgBdYspU.cjs.map → ServerSettings-Dmw2rpFA.cjs.map} +1 -1
- package/dist/SolanaLoginButton-CqdzSSeJ.cjs +1 -0
- package/dist/SolanaLoginButton-CqdzSSeJ.cjs.map +1 -0
- package/dist/{SolanaLoginButton-B04dib6X.js → SolanaLoginButton-CyeX35eU.js} +41 -40
- package/dist/SolanaLoginButton-CyeX35eU.js.map +1 -0
- package/dist/{TeamSection-DbSYDRdI.js → TeamSection-BhsBEckR.js} +1 -1
- package/dist/{TeamSection-DbSYDRdI.js.map → TeamSection-BhsBEckR.js.map} +1 -1
- package/dist/{TeamSection-B1t1tU-_.cjs → TeamSection-DLxtRmta.cjs} +1 -1
- package/dist/{TeamSection-B1t1tU-_.cjs.map → TeamSection-DLxtRmta.cjs.map} +1 -1
- package/dist/{UsersSection-C7aRNkK2.cjs → UsersSection-BEKfbhQ4.cjs} +1 -1
- package/dist/{UsersSection-C7aRNkK2.cjs.map → UsersSection-BEKfbhQ4.cjs.map} +1 -1
- package/dist/{UsersSection--PAE1XRh.js → UsersSection-DbGkmxty.js} +1 -1
- package/dist/{UsersSection--PAE1XRh.js.map → UsersSection-DbGkmxty.js.map} +1 -1
- package/dist/{WebhookSettings-C-7Yxueu.js → WebhookSettings-CpPvGmV7.js} +1 -1
- package/dist/{WebhookSettings-C-7Yxueu.js.map → WebhookSettings-CpPvGmV7.js.map} +1 -1
- package/dist/{WebhookSettings-C923ZSKa.js → WebhookSettings-DEHV2ptf.js} +1 -1
- package/dist/{WebhookSettings-C923ZSKa.js.map → WebhookSettings-DEHV2ptf.js.map} +1 -1
- package/dist/{WebhookSettings-CbU3cfTJ.cjs → WebhookSettings-DbyPJ8V2.cjs} +1 -1
- package/dist/{WebhookSettings-CbU3cfTJ.cjs.map → WebhookSettings-DbyPJ8V2.cjs.map} +1 -1
- package/dist/{WebhookSettings-D19u9Uok.cjs → WebhookSettings-Rq_nNJuw.cjs} +1 -1
- package/dist/{WebhookSettings-D19u9Uok.cjs.map → WebhookSettings-Rq_nNJuw.cjs.map} +1 -1
- package/dist/admin-only.cjs +1 -1
- package/dist/admin-only.js +1 -1
- package/dist/email-only.cjs +1 -1
- package/dist/email-only.d.ts +6 -0
- package/dist/email-only.js +2 -2
- package/dist/google-only.cjs +1 -1
- package/dist/google-only.d.ts +6 -0
- package/dist/google-only.js +2 -2
- package/dist/index.cjs +13 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +500 -1
- package/dist/index.js +5656 -4205
- package/dist/index.js.map +1 -1
- package/dist/{plugin-BiftIhZe.js → plugin-Bwwe7_ZO.js} +3 -2
- package/dist/plugin-Bwwe7_ZO.js.map +1 -0
- package/dist/plugin-C4bijrSr.cjs +1 -0
- package/dist/plugin-C4bijrSr.cjs.map +1 -0
- package/dist/solana-only.cjs +1 -1
- package/dist/solana-only.d.ts +6 -0
- package/dist/solana-only.js +2 -2
- package/dist/useAuth-B1yS_YiD.cjs +1 -0
- package/dist/{useAuth-U5CYsHEU.cjs.map → useAuth-B1yS_YiD.cjs.map} +1 -1
- package/dist/{useAuth-C-Vw-ggy.js → useAuth-l-itM5am.js} +440 -433
- package/dist/{useAuth-C-Vw-ggy.js.map → useAuth-l-itM5am.js.map} +1 -1
- package/dist/useUsersStatsSummary-9HQDKBU5.js +1879 -0
- package/dist/useUsersStatsSummary-9HQDKBU5.js.map +1 -0
- package/dist/useUsersStatsSummary-DiRC8sGs.cjs +1 -0
- package/dist/useUsersStatsSummary-DiRC8sGs.cjs.map +1 -0
- package/package.json +1 -1
- package/dist/AutosaveStatus-B1A1zORa.cjs +0 -1
- package/dist/AutosaveStatus-B1A1zORa.cjs.map +0 -1
- package/dist/AutosaveStatus-DMjvXzP2.js.map +0 -1
- package/dist/EmailRegisterForm-CMXsa-_r.js.map +0 -1
- package/dist/EmailRegisterForm-i7f4St2N.cjs +0 -1
- package/dist/EmailRegisterForm-i7f4St2N.cjs.map +0 -1
- package/dist/GoogleLoginButton-JtRViYWS.cjs +0 -1
- package/dist/GoogleLoginButton-JtRViYWS.cjs.map +0 -1
- package/dist/GoogleLoginButton-qf4A_A3G.js.map +0 -1
- package/dist/PermissionsSection-B-6DJnN8.cjs +0 -1
- package/dist/SolanaLoginButton-B04dib6X.js.map +0 -1
- package/dist/SolanaLoginButton-nSJHVFpZ.cjs +0 -1
- package/dist/SolanaLoginButton-nSJHVFpZ.cjs.map +0 -1
- package/dist/plugin-BiftIhZe.js.map +0 -1
- package/dist/plugin-BtQdI_Ay.cjs +0 -1
- package/dist/plugin-BtQdI_Ay.cjs.map +0 -1
- package/dist/useAuth-U5CYsHEU.cjs +0 -1
- package/dist/useUsersStatsSummary-5DJwzntC.js +0 -1246
- package/dist/useUsersStatsSummary-5DJwzntC.js.map +0 -1
- package/dist/useUsersStatsSummary-DgKaUIfs.cjs +0 -1
- package/dist/useUsersStatsSummary-DgKaUIfs.cjs.map +0 -1
package/dist/{AuthenticationSettings-Cu5Z2mTC.cjs.map → AuthenticationSettings-DPr882lj.cjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthenticationSettings-Cu5Z2mTC.cjs","sources":["../src/hooks/useSsoProviders.ts","../src/components/admin/settings/SsoProvidersSettings.tsx","../src/components/admin/settings/SocialButtonOrderSettings.tsx","../src/components/admin/settings/AuthenticationSettings.tsx"],"sourcesContent":["/**\n * Hook for managing SSO providers (admin)\n */\nimport { useState, useCallback, useRef } from 'react';\nimport { useCedrosLogin } from '../context/useCedrosLogin';\n\nexport interface SsoProvider {\n id: string;\n orgId: string;\n name: string;\n issuerUrl: string;\n clientId: string;\n scopes: string[];\n enabled: boolean;\n allowRegistration: boolean;\n emailDomain: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CreateSsoProviderInput {\n orgId: string;\n name: string;\n issuerUrl: string;\n clientId: string;\n clientSecret: string;\n scopes?: string[];\n enabled?: boolean;\n allowRegistration?: boolean;\n emailDomain?: string | null;\n}\n\nexport interface UpdateSsoProviderInput {\n name?: string;\n issuerUrl?: string;\n clientId?: string;\n clientSecret?: string;\n scopes?: string[];\n enabled?: boolean;\n allowRegistration?: boolean;\n emailDomain?: string | null;\n}\n\ninterface ListResponse {\n providers: SsoProvider[];\n total: number;\n limit: number;\n offset: number;\n}\n\nexport function useSsoProviders() {\n const { config, _internal } = useCedrosLogin();\n const serverUrl = config.serverUrl;\n\n // PERF-03: Stabilize getAccessToken reference using ref pattern\n // to prevent unnecessary re-creation of callbacks\n const getAccessTokenRef = useRef(_internal?.getAccessToken ?? (() => null));\n getAccessTokenRef.current = _internal?.getAccessToken ?? (() => null);\n\n const [providers, setProviders] = useState<SsoProvider[]>([]);\n const [total, setTotal] = useState(0);\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n // Memoize getHeaders with empty deps since it uses ref\n const getHeaders = useCallback(() => {\n const token = getAccessTokenRef.current();\n return {\n 'Content-Type': 'application/json',\n ...(token ? { Authorization: `Bearer ${token}` } : {}),\n };\n }, []);\n\n const fetchProviders = useCallback(\n async (orgId?: string, limit = 50, offset = 0) => {\n setIsLoading(true);\n setError(null);\n try {\n const params = new URLSearchParams();\n if (orgId) params.set('org_id', orgId);\n params.set('limit', String(limit));\n params.set('offset', String(offset));\n\n const res = await fetch(`${serverUrl}/admin/sso-providers?${params}`, {\n headers: getHeaders(),\n });\n\n if (!res.ok) {\n const err = await res.json().catch(() => ({}));\n throw new Error(err.error || `Failed to fetch SSO providers: ${res.status}`);\n }\n\n const data: ListResponse = await res.json();\n setProviders(data.providers);\n setTotal(data.total);\n return data;\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n setError(error);\n throw error;\n } finally {\n setIsLoading(false);\n }\n },\n [serverUrl, getHeaders]\n );\n\n const createProvider = useCallback(\n async (input: CreateSsoProviderInput): Promise<SsoProvider> => {\n setIsLoading(true);\n setError(null);\n try {\n const res = await fetch(`${serverUrl}/admin/sso-providers`, {\n method: 'POST',\n headers: getHeaders(),\n body: JSON.stringify(input),\n });\n\n if (!res.ok) {\n const err = await res.json().catch(() => ({}));\n throw new Error(err.error || `Failed to create SSO provider: ${res.status}`);\n }\n\n const provider: SsoProvider = await res.json();\n setProviders((prev) => [...prev, provider]);\n setTotal((prev) => prev + 1);\n return provider;\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n setError(error);\n throw error;\n } finally {\n setIsLoading(false);\n }\n },\n [serverUrl, getHeaders]\n );\n\n const updateProvider = useCallback(\n async (id: string, input: UpdateSsoProviderInput): Promise<SsoProvider> => {\n setIsLoading(true);\n setError(null);\n try {\n const res = await fetch(`${serverUrl}/admin/sso-providers/${id}`, {\n method: 'PUT',\n headers: getHeaders(),\n body: JSON.stringify(input),\n });\n\n if (!res.ok) {\n const err = await res.json().catch(() => ({}));\n throw new Error(err.error || `Failed to update SSO provider: ${res.status}`);\n }\n\n const provider: SsoProvider = await res.json();\n setProviders((prev) => prev.map((p) => (p.id === id ? provider : p)));\n return provider;\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n setError(error);\n throw error;\n } finally {\n setIsLoading(false);\n }\n },\n [serverUrl, getHeaders]\n );\n\n const deleteProvider = useCallback(\n async (id: string): Promise<void> => {\n setIsLoading(true);\n setError(null);\n try {\n const res = await fetch(`${serverUrl}/admin/sso-providers/${id}`, {\n method: 'DELETE',\n headers: getHeaders(),\n });\n\n if (!res.ok) {\n const err = await res.json().catch(() => ({}));\n throw new Error(err.error || `Failed to delete SSO provider: ${res.status}`);\n }\n\n setProviders((prev) => prev.filter((p) => p.id !== id));\n setTotal((prev) => prev - 1);\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n setError(error);\n throw error;\n } finally {\n setIsLoading(false);\n }\n },\n [serverUrl, getHeaders]\n );\n\n const toggleProvider = useCallback(\n async (id: string, enabled: boolean): Promise<SsoProvider> => {\n return updateProvider(id, { enabled });\n },\n [updateProvider]\n );\n\n return {\n providers,\n total,\n isLoading,\n error,\n fetchProviders,\n createProvider,\n updateProvider,\n deleteProvider,\n toggleProvider,\n };\n}\n","/**\n * SSO Providers settings - manage OIDC identity providers\n */\nimport { useState, useEffect, useCallback } from 'react';\nimport { LoadingSpinner } from '../../shared/LoadingSpinner';\nimport { ErrorMessage } from '../../shared/ErrorMessage';\nimport {\n useSsoProviders,\n type SsoProvider,\n type CreateSsoProviderInput,\n type UpdateSsoProviderInput,\n} from '../../../hooks/useSsoProviders';\nimport { useOrgs } from '../../../hooks/useOrgs';\n\nexport interface SsoProvidersSettingsProps {\n className?: string;\n}\n\ntype ViewMode = 'list' | 'add' | 'edit';\n\nexport function SsoProvidersSettings({ className }: SsoProvidersSettingsProps) {\n const {\n providers,\n isLoading,\n error,\n fetchProviders,\n createProvider,\n updateProvider,\n deleteProvider,\n toggleProvider,\n } = useSsoProviders();\n\n const { activeOrg } = useOrgs();\n const [viewMode, setViewMode] = useState<ViewMode>('list');\n const [editingProvider, setEditingProvider] = useState<SsoProvider | null>(null);\n const [formError, setFormError] = useState<string | null>(null);\n\n useEffect(() => {\n fetchProviders(activeOrg?.id);\n }, [fetchProviders, activeOrg?.id]);\n\n const handleAdd = () => {\n setEditingProvider(null);\n setFormError(null);\n setViewMode('add');\n };\n\n const handleEdit = (provider: SsoProvider) => {\n setEditingProvider(provider);\n setFormError(null);\n setViewMode('edit');\n };\n\n const handleCancel = () => {\n setViewMode('list');\n setEditingProvider(null);\n setFormError(null);\n };\n\n const handleDelete = async (provider: SsoProvider) => {\n if (!confirm(`Delete SSO provider \"${provider.name}\"? This cannot be undone.`)) {\n return;\n }\n try {\n await deleteProvider(provider.id);\n } catch {\n // Error is already set in hook\n }\n };\n\n const handleToggle = async (provider: SsoProvider) => {\n try {\n await toggleProvider(provider.id, !provider.enabled);\n } catch {\n // Error is already set in hook\n }\n };\n\n const handleSave = async (data: CreateSsoProviderInput | UpdateSsoProviderInput) => {\n setFormError(null);\n try {\n if (viewMode === 'add') {\n await createProvider(data as CreateSsoProviderInput);\n } else if (editingProvider) {\n await updateProvider(editingProvider.id, data as UpdateSsoProviderInput);\n }\n setViewMode('list');\n setEditingProvider(null);\n } catch (err) {\n setFormError(err instanceof Error ? err.message : 'Failed to save provider');\n }\n };\n\n if (isLoading && providers.length === 0) {\n return (\n <div className={`cedros-system-settings cedros-system-settings-loading ${className ?? ''}`}>\n <LoadingSpinner />\n <span>Loading SSO providers...</span>\n </div>\n );\n }\n\n if (viewMode === 'add' || viewMode === 'edit') {\n return (\n <div className={`cedros-system-settings ${className ?? ''}`}>\n <SsoProviderForm\n provider={editingProvider}\n orgId={activeOrg?.id}\n error={formError}\n isLoading={isLoading}\n onSave={handleSave}\n onCancel={handleCancel}\n />\n </div>\n );\n }\n\n return (\n <div className={`cedros-system-settings ${className ?? ''}`}>\n <div className=\"cedros-settings-page-header\">\n <div className=\"cedros-settings-page-header-content\">\n <h2 className=\"cedros-settings-page-title\">SSO Providers</h2>\n <p className=\"cedros-settings-page-description\">\n Configure OIDC identity providers for enterprise single sign-on.\n </p>\n </div>\n <button type=\"button\" className=\"cedros-btn cedros-btn-primary\" onClick={handleAdd}>\n Add Provider\n </button>\n </div>\n\n {error && <ErrorMessage error={error.message} />}\n\n {providers.length === 0 ? (\n <div className=\"cedros-system-settings-empty\">\n <p>No SSO providers configured.</p>\n <p className=\"cedros-text-muted\">\n Add an OIDC provider like Okta, Azure AD, or Auth0 to enable enterprise SSO.\n </p>\n </div>\n ) : (\n <div className=\"cedros-sso-provider-list\">\n {providers.map((provider) => (\n <SsoProviderCard\n key={provider.id}\n provider={provider}\n onEdit={() => handleEdit(provider)}\n onDelete={() => handleDelete(provider)}\n onToggle={() => handleToggle(provider)}\n />\n ))}\n </div>\n )}\n </div>\n );\n}\n\n// =============================================================================\n// Provider Card\n// =============================================================================\n\ninterface SsoProviderCardProps {\n provider: SsoProvider;\n onEdit: () => void;\n onDelete: () => void;\n onToggle: () => void;\n}\n\nfunction SsoProviderCard({ provider, onEdit, onDelete, onToggle }: SsoProviderCardProps) {\n return (\n <div\n className={`cedros-sso-provider-card ${provider.enabled ? '' : 'cedros-sso-provider-card--disabled'}`}\n >\n <div className=\"cedros-sso-provider-card-header\">\n <div className=\"cedros-sso-provider-card-info\">\n <h3 className=\"cedros-sso-provider-card-name\">{provider.name}</h3>\n <p className=\"cedros-sso-provider-card-issuer\">{provider.issuerUrl}</p>\n </div>\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={provider.enabled}\n className={`cedros-toggle ${provider.enabled ? 'cedros-toggle-on' : 'cedros-toggle-off'}`}\n onClick={onToggle}\n >\n <span className=\"cedros-toggle-track\">\n <span className=\"cedros-toggle-thumb\" />\n </span>\n <span className=\"cedros-toggle-label\">{provider.enabled ? 'Enabled' : 'Disabled'}</span>\n </button>\n </div>\n\n <div className=\"cedros-sso-provider-card-details\">\n <div className=\"cedros-sso-provider-card-detail\">\n <span className=\"cedros-sso-provider-card-detail-label\">Client ID</span>\n <code className=\"cedros-sso-provider-card-detail-value\">{provider.clientId}</code>\n </div>\n {provider.emailDomain && (\n <div className=\"cedros-sso-provider-card-detail\">\n <span className=\"cedros-sso-provider-card-detail-label\">Email Domain</span>\n <span className=\"cedros-sso-provider-card-detail-value\">@{provider.emailDomain}</span>\n </div>\n )}\n <div className=\"cedros-sso-provider-card-detail\">\n <span className=\"cedros-sso-provider-card-detail-label\">Registration</span>\n <span className=\"cedros-sso-provider-card-detail-value\">\n {provider.allowRegistration ? 'Allowed' : 'Existing users only'}\n </span>\n </div>\n </div>\n\n <div className=\"cedros-sso-provider-card-actions\">\n <button type=\"button\" className=\"cedros-btn cedros-btn-ghost\" onClick={onEdit}>\n Edit\n </button>\n <button\n type=\"button\"\n className=\"cedros-btn cedros-btn-ghost cedros-btn-danger\"\n onClick={onDelete}\n >\n Delete\n </button>\n </div>\n </div>\n );\n}\n\n// =============================================================================\n// Provider Form\n// =============================================================================\n\ninterface SsoProviderFormProps {\n provider: SsoProvider | null;\n orgId?: string;\n error: string | null;\n isLoading: boolean;\n onSave: (data: CreateSsoProviderInput | UpdateSsoProviderInput) => void;\n onCancel: () => void;\n}\n\nfunction SsoProviderForm({\n provider,\n orgId,\n error,\n isLoading,\n onSave,\n onCancel,\n}: SsoProviderFormProps) {\n const isEditing = Boolean(provider);\n\n const [name, setName] = useState(provider?.name ?? '');\n const [issuerUrl, setIssuerUrl] = useState(provider?.issuerUrl ?? '');\n const [clientId, setClientId] = useState(provider?.clientId ?? '');\n const [clientSecret, setClientSecret] = useState('');\n const [emailDomain, setEmailDomain] = useState(provider?.emailDomain ?? '');\n const [allowRegistration, setAllowRegistration] = useState(provider?.allowRegistration ?? true);\n const [enabled, setEnabled] = useState(provider?.enabled ?? true);\n\n const handleSubmit = useCallback(\n (e: React.FormEvent) => {\n e.preventDefault();\n\n if (isEditing) {\n const updates: UpdateSsoProviderInput = {\n name,\n issuerUrl,\n clientId,\n emailDomain: emailDomain || null,\n allowRegistration,\n enabled,\n };\n // Only include secret if changed\n if (clientSecret) {\n updates.clientSecret = clientSecret;\n }\n onSave(updates);\n } else {\n if (!orgId) {\n return;\n }\n const data: CreateSsoProviderInput = {\n orgId,\n name,\n issuerUrl,\n clientId,\n clientSecret,\n emailDomain: emailDomain || null,\n allowRegistration,\n enabled,\n };\n onSave(data);\n }\n },\n [\n isEditing,\n orgId,\n name,\n issuerUrl,\n clientId,\n clientSecret,\n emailDomain,\n allowRegistration,\n enabled,\n onSave,\n ]\n );\n\n return (\n <form className=\"cedros-sso-provider-form\" onSubmit={handleSubmit}>\n <div className=\"cedros-settings-page-header\">\n <div className=\"cedros-settings-page-header-content\">\n <h2 className=\"cedros-settings-page-title\">\n {isEditing ? 'Edit SSO Provider' : 'Add SSO Provider'}\n </h2>\n <p className=\"cedros-settings-page-description\">\n Configure an OIDC identity provider for enterprise single sign-on.\n </p>\n </div>\n </div>\n\n {error && <ErrorMessage error={error} />}\n\n <div className=\"cedros-form-section\">\n <div className=\"cedros-form-group\">\n <label className=\"cedros-form-label\" htmlFor=\"sso-name\">\n Provider Name\n </label>\n <input\n id=\"sso-name\"\n type=\"text\"\n className=\"cedros-form-input\"\n value={name}\n onChange={(e) => setName(e.target.value)}\n placeholder=\"e.g., Okta, Azure AD\"\n required\n />\n </div>\n\n <div className=\"cedros-form-group\">\n <label className=\"cedros-form-label\" htmlFor=\"sso-issuer\">\n Issuer URL\n </label>\n <input\n id=\"sso-issuer\"\n type=\"url\"\n className=\"cedros-form-input\"\n value={issuerUrl}\n onChange={(e) => setIssuerUrl(e.target.value)}\n placeholder=\"https://your-org.okta.com\"\n required\n />\n <p className=\"cedros-form-hint\">\n The OIDC issuer URL. Must support discovery at /.well-known/openid-configuration\n </p>\n </div>\n\n <div className=\"cedros-form-group\">\n <label className=\"cedros-form-label\" htmlFor=\"sso-client-id\">\n Client ID\n </label>\n <input\n id=\"sso-client-id\"\n type=\"text\"\n className=\"cedros-form-input\"\n value={clientId}\n onChange={(e) => setClientId(e.target.value)}\n placeholder=\"OAuth client ID\"\n required\n />\n </div>\n\n <div className=\"cedros-form-group\">\n <label className=\"cedros-form-label\" htmlFor=\"sso-client-secret\">\n Client Secret{' '}\n {isEditing && (\n <span className=\"cedros-form-hint-inline\">(leave blank to keep current)</span>\n )}\n </label>\n <input\n id=\"sso-client-secret\"\n type=\"password\"\n className=\"cedros-form-input\"\n value={clientSecret}\n onChange={(e) => setClientSecret(e.target.value)}\n placeholder={isEditing ? '••••••••' : 'OAuth client secret'}\n required={!isEditing}\n />\n </div>\n\n <div className=\"cedros-form-group\">\n <label className=\"cedros-form-label\" htmlFor=\"sso-email-domain\">\n Email Domain (optional)\n </label>\n <input\n id=\"sso-email-domain\"\n type=\"text\"\n className=\"cedros-form-input\"\n value={emailDomain}\n onChange={(e) => setEmailDomain(e.target.value)}\n placeholder=\"company.com\"\n />\n <p className=\"cedros-form-hint\">Restrict to users with emails from this domain</p>\n </div>\n\n <div className=\"cedros-form-group\">\n <label className=\"cedros-form-checkbox\">\n <input\n type=\"checkbox\"\n checked={allowRegistration}\n onChange={(e) => setAllowRegistration(e.target.checked)}\n />\n <span>Allow new user registration via SSO</span>\n </label>\n </div>\n\n <div className=\"cedros-form-group\">\n <label className=\"cedros-form-checkbox\">\n <input\n type=\"checkbox\"\n checked={enabled}\n onChange={(e) => setEnabled(e.target.checked)}\n />\n <span>Enable this provider</span>\n </label>\n </div>\n </div>\n\n <div className=\"cedros-form-actions\">\n <button\n type=\"button\"\n className=\"cedros-btn cedros-btn-ghost\"\n onClick={onCancel}\n disabled={isLoading}\n >\n Cancel\n </button>\n <button type=\"submit\" className=\"cedros-btn cedros-btn-primary\" disabled={isLoading}>\n {isLoading ? 'Saving...' : isEditing ? 'Save Changes' : 'Add Provider'}\n </button>\n </div>\n </form>\n );\n}\n","/**\n * Drag-and-drop social button order settings with live preview.\n *\n * Uses HTML5 Drag and Drop API (no library needed for 4 items).\n * Reads enabled state from shared settings map (`auth_*_enabled` keys).\n */\nimport { useState, useCallback, useRef, type ReactNode } from 'react';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport interface SocialButtonOrderSettingsProps {\n /** Settings map (key -> SystemSetting[]) from useSettingsAutosave */\n settings: Record<string, { key: string; value: string }[]>;\n /** Autosave handler from parent */\n handleChange: (key: string, value: string) => void;\n}\n\ninterface ProviderMeta {\n label: string;\n icon: ReactNode;\n enabledKey: string;\n}\n\n// ---------------------------------------------------------------------------\n// Provider metadata + icons (matching existing button components)\n// ---------------------------------------------------------------------------\n\nfunction GoogleIcon() {\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M17.64 9.2c0-.637-.057-1.251-.164-1.84H9v3.481h4.844c-.209 1.125-.843 2.078-1.796 2.717v2.258h2.908c1.702-1.567 2.684-3.874 2.684-6.615z\" fill=\"#4285F4\" />\n <path d=\"M9.003 18c2.43 0 4.467-.806 5.956-2.18l-2.909-2.26c-.806.54-1.836.86-3.047.86-2.344 0-4.328-1.584-5.036-3.711H.96v2.332A8.997 8.997 0 0 0 9.003 18z\" fill=\"#34A853\" />\n <path d=\"M3.964 10.712A5.41 5.41 0 0 1 3.682 9c0-.593.102-1.17.282-1.71V4.958H.96A8.996 8.996 0 0 0 0 9c0 1.452.348 2.827.96 4.042l3.004-2.33z\" fill=\"#FBBC05\" />\n <path d=\"M9.003 3.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C13.464.891 11.428 0 9.002 0A8.997 8.997 0 0 0 .96 4.958l3.005 2.332c.708-2.127 2.692-3.71 5.036-3.71z\" fill=\"#EA4335\" />\n </svg>\n );\n}\n\nfunction AppleIcon() {\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <path d=\"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z\" />\n </svg>\n );\n}\n\nfunction SolanaIcon() {\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 128 128\" fill=\"currentColor\" aria-hidden=\"true\">\n <path d=\"M25.38 96.04a4.35 4.35 0 0 1 3.07-1.27h91.68c1.93 0 2.9 2.34 1.54 3.7l-17.71 17.72a4.35 4.35 0 0 1-3.07 1.27H9.21c-1.93 0-2.9-2.34-1.54-3.7l17.71-17.72z\" />\n <path d=\"M25.38 11.81a4.47 4.47 0 0 1 3.07-1.27h91.68c1.93 0 2.9 2.34 1.54 3.7L103.96 31.96a4.35 4.35 0 0 1-3.07 1.27H9.21c-1.93 0-2.9-2.34-1.54-3.7L25.38 11.81z\" />\n <path d=\"M102.62 53.76a4.35 4.35 0 0 0-3.07-1.27H7.87c-1.93 0-2.9 2.34-1.54 3.7l17.71 17.72a4.35 4.35 0 0 0 3.07 1.27h91.68c1.93 0 2.9-2.34 1.54-3.7L102.62 53.76z\" />\n </svg>\n );\n}\n\nfunction PasskeyIcon() {\n return (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4\" />\n <path d=\"M14 13.12c0 2.38 0 6.38-1 8.88\" />\n <path d=\"M17.29 21.02c.12-.6.43-2.3.5-3.02\" />\n <path d=\"M2 12a10 10 0 0 1 18-6\" />\n <path d=\"M2 16h.01\" />\n <path d=\"M21.8 16c.2-2 .131-5.354 0-6\" />\n <path d=\"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2\" />\n <path d=\"M8.65 22c.21-.66.45-1.32.57-2\" />\n <path d=\"M9 6.8a6 6 0 0 1 9 5.2v2\" />\n </svg>\n );\n}\n\nconst PROVIDERS: Record<string, ProviderMeta> = {\n webauthn: { label: 'Passkey', icon: <PasskeyIcon />, enabledKey: 'auth_webauthn_enabled' },\n google: { label: 'Google', icon: <GoogleIcon />, enabledKey: 'auth_google_enabled' },\n apple: { label: 'Apple', icon: <AppleIcon />, enabledKey: 'auth_apple_enabled' },\n solana: { label: 'Solana', icon: <SolanaIcon />, enabledKey: 'auth_solana_enabled' },\n};\n\nconst DEFAULT_ORDER = ['webauthn', 'google', 'apple', 'solana'];\n\nconst PREVIEW_LABELS: Record<string, string> = {\n webauthn: 'Continue with Passkey',\n google: 'Continue with Google',\n apple: 'Continue with Apple',\n solana: 'Continue with Solana',\n};\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\n/** Read whether a provider is enabled from the flattened settings. */\nfunction isProviderEnabled(\n settings: Record<string, { key: string; value: string }[]>,\n enabledKey: string,\n): boolean {\n for (const group of Object.values(settings)) {\n const found = group.find((s) => s.key === enabledKey);\n if (found) return found.value === 'true';\n }\n return true; // default enabled when setting is absent\n}\n\n/** Read current order from settings map, falling back to default. */\nfunction readOrder(settings: Record<string, { key: string; value: string }[]>): string[] {\n for (const group of Object.values(settings)) {\n const found = group.find((s) => s.key === 'ui_social_button_order');\n if (found && found.value) return found.value.split(',').map((s) => s.trim());\n }\n return DEFAULT_ORDER;\n}\n\n// ---------------------------------------------------------------------------\n// Grab-handle icon\n// ---------------------------------------------------------------------------\n\nfunction GrabHandle() {\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\" style={{ opacity: 0.4 }}>\n <circle cx=\"5\" cy=\"3\" r=\"1.5\" />\n <circle cx=\"11\" cy=\"3\" r=\"1.5\" />\n <circle cx=\"5\" cy=\"8\" r=\"1.5\" />\n <circle cx=\"11\" cy=\"8\" r=\"1.5\" />\n <circle cx=\"5\" cy=\"13\" r=\"1.5\" />\n <circle cx=\"11\" cy=\"13\" r=\"1.5\" />\n </svg>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\nexport function SocialButtonOrderSettings({ settings, handleChange }: SocialButtonOrderSettingsProps) {\n const [order, setOrder] = useState<string[]>(() => readOrder(settings));\n const dragIdx = useRef<number | null>(null);\n const [dragOverIdx, setDragOverIdx] = useState<number | null>(null);\n\n const persist = useCallback(\n (newOrder: string[]) => {\n setOrder(newOrder);\n handleChange('ui_social_button_order', newOrder.join(','));\n },\n [handleChange],\n );\n\n const onDragStart = useCallback((idx: number) => {\n dragIdx.current = idx;\n }, []);\n\n const onDragOver = useCallback((e: React.DragEvent, idx: number) => {\n e.preventDefault();\n setDragOverIdx(idx);\n }, []);\n\n const onDrop = useCallback(\n (targetIdx: number) => {\n const fromIdx = dragIdx.current;\n if (fromIdx === null || fromIdx === targetIdx) {\n setDragOverIdx(null);\n return;\n }\n const next = [...order];\n const [moved] = next.splice(fromIdx, 1);\n next.splice(targetIdx, 0, moved);\n persist(next);\n dragIdx.current = null;\n setDragOverIdx(null);\n },\n [order, persist],\n );\n\n const onDragEnd = useCallback(() => {\n dragIdx.current = null;\n setDragOverIdx(null);\n }, []);\n\n return (\n <div className=\"cedros-system-settings\">\n <div className=\"cedros-settings-page-header\">\n <div className=\"cedros-settings-page-header-content\">\n <h2 className=\"cedros-settings-page-title\">Button Order</h2>\n <p className=\"cedros-settings-page-description\">\n Drag to reorder the social login buttons on your sign-in form.\n </p>\n </div>\n </div>\n\n <div style={{ display: 'flex', gap: '2rem', flexWrap: 'wrap' }}>\n {/* Left: Reorder list */}\n <div style={{ flex: '1 1 260px', minWidth: 260 }}>\n <ul style={{ listStyle: 'none', padding: 0, margin: 0, display: 'flex', flexDirection: 'column', gap: '0.5rem' }}>\n {order.map((id, idx) => {\n const meta = PROVIDERS[id];\n if (!meta) return null;\n const enabled = isProviderEnabled(settings, meta.enabledKey);\n const isDragOver = dragOverIdx === idx;\n return (\n <li\n key={id}\n draggable\n onDragStart={() => onDragStart(idx)}\n onDragOver={(e) => onDragOver(e, idx)}\n onDrop={() => onDrop(idx)}\n onDragEnd={onDragEnd}\n className=\"cedros-btn-order-item\"\n style={{\n display: 'flex',\n alignItems: 'center',\n gap: '0.75rem',\n padding: '0.625rem 0.75rem',\n borderRadius: 'var(--cedros-radius, 0.5rem)',\n border: isDragOver\n ? '2px solid var(--cedros-primary, #6366f1)'\n : '1px solid var(--cedros-border, #e5e7eb)',\n background: 'var(--cedros-background, #fff)',\n cursor: 'grab',\n opacity: enabled ? 1 : 0.5,\n transition: 'border-color 0.15s',\n }}\n >\n <GrabHandle />\n <span className=\"cedros-button-icon\" style={{ display: 'flex', alignItems: 'center' }}>\n {meta.icon}\n </span>\n <span style={{ flex: 1, fontWeight: 500, fontSize: '0.875rem' }}>{meta.label}</span>\n <span\n style={{\n fontSize: '0.7rem',\n padding: '0.125rem 0.5rem',\n borderRadius: '9999px',\n background: enabled\n ? 'var(--cedros-primary, #6366f1)'\n : 'var(--cedros-muted, #f3f4f6)',\n color: enabled\n ? 'var(--cedros-primary-foreground, #fff)'\n : 'var(--cedros-muted-foreground, #6b7280)',\n }}\n >\n {enabled ? 'Enabled' : 'Disabled'}\n </span>\n </li>\n );\n })}\n </ul>\n </div>\n\n {/* Right: Live preview */}\n <div style={{ flex: '1 1 280px', minWidth: 280 }}>\n <p style={{ fontSize: '0.75rem', color: 'var(--cedros-muted-foreground, #6b7280)', margin: '0 0 0.75rem' }}>\n This is how your login form buttons will appear:\n </p>\n <div\n style={{\n display: 'flex',\n flexDirection: 'column',\n gap: '0.5rem',\n padding: '1.25rem',\n borderRadius: 'var(--cedros-radius, 0.5rem)',\n border: '1px solid var(--cedros-border, #e5e7eb)',\n background: 'var(--cedros-background, #fff)',\n }}\n >\n {order.map((id) => {\n const meta = PROVIDERS[id];\n if (!meta) return null;\n const enabled = isProviderEnabled(settings, meta.enabledKey);\n if (!enabled) return null;\n return (\n <button\n key={id}\n type=\"button\"\n className=\"cedros-button cedros-button-social\"\n style={{ pointerEvents: 'none', width: '100%' }}\n tabIndex={-1}\n >\n <span className=\"cedros-button-icon\">{meta.icon}</span>\n {PREVIEW_LABELS[id]}\n </button>\n );\n })}\n </div>\n </div>\n </div>\n </div>\n );\n}\n","/**\n * Authentication settings page - configure auth providers with tabs\n */\nimport { useState, useEffect, useMemo } from 'react';\nimport { LoadingSpinner } from '../../shared/LoadingSpinner';\nimport { ErrorMessage } from '../../shared/ErrorMessage';\nimport { useSettingsAutosave } from '../../../hooks/useSettingsAutosave';\nimport { SettingsSection } from './settingsInputs';\nimport { AutosaveStatus } from './AutosaveStatus';\nimport { SsoProvidersSettings } from './SsoProvidersSettings';\nimport { SocialButtonOrderSettings } from './SocialButtonOrderSettings';\n\ntype AuthTab = 'email' | 'google' | 'apple' | 'solana' | 'passkeys' | 'instantlink' | 'sso' | 'buttonorder' | 'postlogin';\n\ninterface TabConfig {\n id: AuthTab;\n label: string;\n /** Categories to pull settings from (not used for 'sso' tab) */\n categories: string[];\n /** Optional list of specific keys to show (if omitted, show all in categories) */\n keys?: string[];\n /** If true, renders a custom component instead of settings section */\n isCustom?: boolean;\n}\n\nconst TABS: TabConfig[] = [\n { id: 'email', label: 'Email', categories: ['auth.email'],\n keys: ['auth_email_enabled', 'auth_email_require_verification', 'auth_email_block_disposable'] },\n { id: 'google', label: 'Google', categories: ['auth.google'],\n keys: ['auth_google_enabled', 'auth_google_client_id'] },\n { id: 'apple', label: 'Apple', categories: ['auth.apple'],\n keys: ['auth_apple_enabled', 'auth_apple_client_id', 'auth_apple_team_id'] },\n { id: 'solana', label: 'Solana', categories: ['auth.solana'],\n keys: ['auth_solana_enabled', 'auth_solana_challenge_expiry'] },\n { id: 'passkeys', label: 'Passkeys', categories: ['auth.webauthn'],\n keys: ['auth_webauthn_enabled', 'auth_webauthn_rp_id', 'auth_webauthn_rp_name', 'auth_webauthn_rp_origin'] },\n { id: 'instantlink', label: 'Instant Link', categories: ['auth.instantlink'],\n keys: ['auth_instantlink_enabled', 'auth_instantlink_expiry', 'auth_instantlink_rate_limit'] },\n { id: 'sso', label: 'SSO Providers', categories: [], isCustom: true },\n { id: 'buttonorder', label: 'Button Order', categories: [], isCustom: true },\n { id: 'postlogin', label: 'Post-Login', categories: ['postlogin', 'postlogin.welcome', 'postlogin.username', 'postlogin.complete', 'postlogin.wallet'],\n keys: ['postlogin_redirect_url', 'postlogin_welcome_enabled', 'postlogin_welcome_route', 'postlogin_username_enabled', 'postlogin_complete_enabled', 'postlogin_wallet_enroll_enabled', 'postlogin_show_recovery_enabled'] },\n];\n\nexport interface AuthenticationSettingsProps {\n className?: string;\n}\n\nexport function AuthenticationSettings({ className }: AuthenticationSettingsProps) {\n const {\n settings,\n edits,\n isLoading,\n autosaveStatus,\n autosaveError,\n error,\n fetchSettings,\n handleChange,\n } = useSettingsAutosave();\n\n const [activeTab, setActiveTab] = useState<AuthTab>('email');\n\n useEffect(() => {\n fetchSettings();\n }, [fetchSettings]);\n\n // Get current tab config\n const currentTab = TABS.find((t) => t.id === activeTab);\n\n // Collect settings from all categories for the current tab\n const allTabSettings = useMemo(() => {\n if (!currentTab) return [];\n const allSettings: (typeof settings)[string] = [];\n for (const category of currentTab.categories) {\n const categorySettings = settings[category] ?? [];\n allSettings.push(...categorySettings);\n }\n return allSettings;\n }, [settings, currentTab]);\n\n const currentSettings = useMemo(() => {\n if (!currentTab?.keys) return allTabSettings;\n // Filter and sort by keys order\n return allTabSettings\n .filter((s) => currentTab.keys!.includes(s.key))\n .sort((a, b) => currentTab.keys!.indexOf(a.key) - currentTab.keys!.indexOf(b.key));\n }, [allTabSettings, currentTab]);\n\n if (isLoading && Object.keys(settings).length === 0) {\n return (\n <div className={`cedros-system-settings cedros-system-settings-loading ${className ?? ''}`}>\n <LoadingSpinner />\n <span>Loading settings...</span>\n </div>\n );\n }\n\n if (error) {\n return (\n <div className={`cedros-system-settings ${className ?? ''}`}>\n <ErrorMessage error={error.message} />\n </div>\n );\n }\n\n return (\n <div className={`cedros-system-settings ${className ?? ''}`}>\n <div className=\"cedros-settings-page-header\">\n <div className=\"cedros-settings-page-header-content\">\n <h2 className=\"cedros-settings-page-title\">Authentication</h2>\n <p className=\"cedros-settings-page-description\">\n Configure authentication providers and methods for user sign-in.\n </p>\n </div>\n <AutosaveStatus status={autosaveStatus} error={autosaveError} />\n </div>\n\n {/* Tabs */}\n <div className=\"cedros-admin-tabs cedros-admin-tabs--line\">\n {TABS.map((tab) => (\n <button\n key={tab.id}\n type=\"button\"\n className={`cedros-admin-tab ${activeTab === tab.id ? 'cedros-admin-tab-active' : ''}`}\n onClick={() => setActiveTab(tab.id)}\n aria-selected={activeTab === tab.id}\n role=\"tab\"\n >\n {tab.label}\n </button>\n ))}\n </div>\n\n {/* Tab content */}\n <div className=\"cedros-admin-tab-content\" role=\"tabpanel\">\n {currentTab?.id === 'buttonorder' ? (\n <SocialButtonOrderSettings settings={settings} handleChange={handleChange} />\n ) : currentTab?.isCustom ? (\n <SsoProvidersSettings />\n ) : currentSettings.length === 0 ? (\n <div className=\"cedros-system-settings-empty\">\n <p>No settings found for {currentTab?.label ?? 'this provider'}.</p>\n </div>\n ) : (\n <SettingsSection settings={currentSettings} edits={edits} onChange={handleChange} />\n )}\n </div>\n </div>\n );\n}\n"],"names":["useSsoProviders","config","_internal","useCedrosLogin","serverUrl","getAccessTokenRef","useRef","providers","setProviders","useState","total","setTotal","isLoading","setIsLoading","error","setError","getHeaders","useCallback","token","fetchProviders","orgId","limit","offset","params","res","err","data","createProvider","input","provider","prev","updateProvider","id","p","deleteProvider","toggleProvider","enabled","SsoProvidersSettings","className","activeOrg","useOrgs","viewMode","setViewMode","editingProvider","setEditingProvider","formError","setFormError","useEffect","handleAdd","handleEdit","handleCancel","handleDelete","handleToggle","handleSave","jsx","LoadingSpinner","SsoProviderForm","jsxs","ErrorMessage","SsoProviderCard","onEdit","onDelete","onToggle","onSave","onCancel","isEditing","name","setName","issuerUrl","setIssuerUrl","clientId","setClientId","clientSecret","setClientSecret","emailDomain","setEmailDomain","allowRegistration","setAllowRegistration","setEnabled","handleSubmit","e","updates","GoogleIcon","AppleIcon","SolanaIcon","PasskeyIcon","PROVIDERS","DEFAULT_ORDER","PREVIEW_LABELS","isProviderEnabled","settings","enabledKey","group","found","s","readOrder","GrabHandle","SocialButtonOrderSettings","handleChange","order","setOrder","dragIdx","dragOverIdx","setDragOverIdx","persist","newOrder","onDragStart","idx","onDragOver","onDrop","targetIdx","fromIdx","next","moved","onDragEnd","meta","isDragOver","TABS","AuthenticationSettings","edits","autosaveStatus","autosaveError","fetchSettings","useSettingsAutosave","activeTab","setActiveTab","currentTab","t","allTabSettings","useMemo","allSettings","category","categorySettings","currentSettings","a","b","AutosaveStatus","tab","SettingsSection"],"mappings":"mRAkDO,SAASA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AAA,IAAC,KAAA,CAAG,UAAU,6BAA6B,SAAA,iBAAc,EACzDA,EAAAA,IAAC,IAAA,CAAE,UAAU,mCAAmC,SAAA,kEAAA,CAEhD,CAAA,EACF,EACAA,EAAAA,IAACkF,EAAAA,eAAA,CAAe,OAAQhB,EAAgB,MAAOC,CAAA,CAAe,CAAA,EAChE,QAGC,MAAA,CAAI,UAAU,4CACZ,SAAAJ,EAAK,IAAKoB,GACTnF,EAAAA,IAAC,SAAA,CAEC,KAAK,SACL,UAAW,oBAAoBsE,IAAca,EAAI,GAAK,0BAA4B,EAAE,GACpF,QAAS,IAAMZ,EAAaY,EAAI,EAAE,EAClC,gBAAeb,IAAca,EAAI,GACjC,KAAK,MAEJ,SAAAA,EAAI,KAAA,EAPAA,EAAI,EAAA,CASZ,EACH,EAGAnF,EAAAA,IAAC,MAAA,CAAI,UAAU,2BAA2B,KAAK,WAC5C,SAAAwE,GAAY,KAAO,cAClBxE,MAAC2C,EAAA,CAA0B,SAAAP,EAAoB,aAAAQ,CAAA,CAA4B,EACzE4B,GAAY,SACdxE,EAAAA,IAACjB,EAAA,CAAA,CAAqB,EACpBgG,EAAgB,SAAW,EAC7B/E,EAAAA,IAAC,MAAA,CAAI,UAAU,+BACb,SAAAG,EAAAA,KAAC,IAAA,CAAE,SAAA,CAAA,yBAAuBqE,GAAY,OAAS,gBAAgB,GAAA,CAAA,CAAC,CAAA,CAClE,EAEAxE,EAAAA,IAACoF,kBAAA,CAAgB,SAAUL,EAAiB,MAAAd,EAAc,SAAUrB,CAAA,CAAc,CAAA,CAEtF,CAAA,EACF,CAEJ"}
|
|
1
|
+
{"version":3,"file":"AuthenticationSettings-DPr882lj.cjs","sources":["../src/hooks/useSsoProviders.ts","../src/components/admin/settings/SsoProvidersSettings.tsx","../src/components/admin/settings/SocialButtonOrderSettings.tsx","../src/components/admin/settings/AuthenticationSettings.tsx"],"sourcesContent":["/**\n * Hook for managing SSO providers (admin)\n */\nimport { useState, useCallback, useRef } from 'react';\nimport { useCedrosLogin } from '../context/useCedrosLogin';\n\nexport interface SsoProvider {\n id: string;\n orgId: string;\n name: string;\n issuerUrl: string;\n clientId: string;\n scopes: string[];\n enabled: boolean;\n allowRegistration: boolean;\n emailDomain: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CreateSsoProviderInput {\n orgId: string;\n name: string;\n issuerUrl: string;\n clientId: string;\n clientSecret: string;\n scopes?: string[];\n enabled?: boolean;\n allowRegistration?: boolean;\n emailDomain?: string | null;\n}\n\nexport interface UpdateSsoProviderInput {\n name?: string;\n issuerUrl?: string;\n clientId?: string;\n clientSecret?: string;\n scopes?: string[];\n enabled?: boolean;\n allowRegistration?: boolean;\n emailDomain?: string | null;\n}\n\ninterface ListResponse {\n providers: SsoProvider[];\n total: number;\n limit: number;\n offset: number;\n}\n\nexport function useSsoProviders() {\n const { config, _internal } = useCedrosLogin();\n const serverUrl = config.serverUrl;\n\n // PERF-03: Stabilize getAccessToken reference using ref pattern\n // to prevent unnecessary re-creation of callbacks\n const getAccessTokenRef = useRef(_internal?.getAccessToken ?? (() => null));\n getAccessTokenRef.current = _internal?.getAccessToken ?? (() => null);\n\n const [providers, setProviders] = useState<SsoProvider[]>([]);\n const [total, setTotal] = useState(0);\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n // Memoize getHeaders with empty deps since it uses ref\n const getHeaders = useCallback(() => {\n const token = getAccessTokenRef.current();\n return {\n 'Content-Type': 'application/json',\n ...(token ? { Authorization: `Bearer ${token}` } : {}),\n };\n }, []);\n\n const fetchProviders = useCallback(\n async (orgId?: string, limit = 50, offset = 0) => {\n setIsLoading(true);\n setError(null);\n try {\n const params = new URLSearchParams();\n if (orgId) params.set('org_id', orgId);\n params.set('limit', String(limit));\n params.set('offset', String(offset));\n\n const res = await fetch(`${serverUrl}/admin/sso-providers?${params}`, {\n headers: getHeaders(),\n });\n\n if (!res.ok) {\n const err = await res.json().catch(() => ({}));\n throw new Error(err.error || `Failed to fetch SSO providers: ${res.status}`);\n }\n\n const data: ListResponse = await res.json();\n setProviders(data.providers);\n setTotal(data.total);\n return data;\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n setError(error);\n throw error;\n } finally {\n setIsLoading(false);\n }\n },\n [serverUrl, getHeaders]\n );\n\n const createProvider = useCallback(\n async (input: CreateSsoProviderInput): Promise<SsoProvider> => {\n setIsLoading(true);\n setError(null);\n try {\n const res = await fetch(`${serverUrl}/admin/sso-providers`, {\n method: 'POST',\n headers: getHeaders(),\n body: JSON.stringify(input),\n });\n\n if (!res.ok) {\n const err = await res.json().catch(() => ({}));\n throw new Error(err.error || `Failed to create SSO provider: ${res.status}`);\n }\n\n const provider: SsoProvider = await res.json();\n setProviders((prev) => [...prev, provider]);\n setTotal((prev) => prev + 1);\n return provider;\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n setError(error);\n throw error;\n } finally {\n setIsLoading(false);\n }\n },\n [serverUrl, getHeaders]\n );\n\n const updateProvider = useCallback(\n async (id: string, input: UpdateSsoProviderInput): Promise<SsoProvider> => {\n setIsLoading(true);\n setError(null);\n try {\n const res = await fetch(`${serverUrl}/admin/sso-providers/${id}`, {\n method: 'PUT',\n headers: getHeaders(),\n body: JSON.stringify(input),\n });\n\n if (!res.ok) {\n const err = await res.json().catch(() => ({}));\n throw new Error(err.error || `Failed to update SSO provider: ${res.status}`);\n }\n\n const provider: SsoProvider = await res.json();\n setProviders((prev) => prev.map((p) => (p.id === id ? provider : p)));\n return provider;\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n setError(error);\n throw error;\n } finally {\n setIsLoading(false);\n }\n },\n [serverUrl, getHeaders]\n );\n\n const deleteProvider = useCallback(\n async (id: string): Promise<void> => {\n setIsLoading(true);\n setError(null);\n try {\n const res = await fetch(`${serverUrl}/admin/sso-providers/${id}`, {\n method: 'DELETE',\n headers: getHeaders(),\n });\n\n if (!res.ok) {\n const err = await res.json().catch(() => ({}));\n throw new Error(err.error || `Failed to delete SSO provider: ${res.status}`);\n }\n\n setProviders((prev) => prev.filter((p) => p.id !== id));\n setTotal((prev) => prev - 1);\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n setError(error);\n throw error;\n } finally {\n setIsLoading(false);\n }\n },\n [serverUrl, getHeaders]\n );\n\n const toggleProvider = useCallback(\n async (id: string, enabled: boolean): Promise<SsoProvider> => {\n return updateProvider(id, { enabled });\n },\n [updateProvider]\n );\n\n return {\n providers,\n total,\n isLoading,\n error,\n fetchProviders,\n createProvider,\n updateProvider,\n deleteProvider,\n toggleProvider,\n };\n}\n","/**\n * SSO Providers settings - manage OIDC identity providers\n */\nimport { useState, useEffect, useCallback } from 'react';\nimport { LoadingSpinner } from '../../shared/LoadingSpinner';\nimport { ErrorMessage } from '../../shared/ErrorMessage';\nimport {\n useSsoProviders,\n type SsoProvider,\n type CreateSsoProviderInput,\n type UpdateSsoProviderInput,\n} from '../../../hooks/useSsoProviders';\nimport { useOrgs } from '../../../hooks/useOrgs';\n\nexport interface SsoProvidersSettingsProps {\n className?: string;\n}\n\ntype ViewMode = 'list' | 'add' | 'edit';\n\nexport function SsoProvidersSettings({ className }: SsoProvidersSettingsProps) {\n const {\n providers,\n isLoading,\n error,\n fetchProviders,\n createProvider,\n updateProvider,\n deleteProvider,\n toggleProvider,\n } = useSsoProviders();\n\n const { activeOrg } = useOrgs();\n const [viewMode, setViewMode] = useState<ViewMode>('list');\n const [editingProvider, setEditingProvider] = useState<SsoProvider | null>(null);\n const [formError, setFormError] = useState<string | null>(null);\n\n useEffect(() => {\n fetchProviders(activeOrg?.id);\n }, [fetchProviders, activeOrg?.id]);\n\n const handleAdd = () => {\n setEditingProvider(null);\n setFormError(null);\n setViewMode('add');\n };\n\n const handleEdit = (provider: SsoProvider) => {\n setEditingProvider(provider);\n setFormError(null);\n setViewMode('edit');\n };\n\n const handleCancel = () => {\n setViewMode('list');\n setEditingProvider(null);\n setFormError(null);\n };\n\n const handleDelete = async (provider: SsoProvider) => {\n if (!confirm(`Delete SSO provider \"${provider.name}\"? This cannot be undone.`)) {\n return;\n }\n try {\n await deleteProvider(provider.id);\n } catch {\n // Error is already set in hook\n }\n };\n\n const handleToggle = async (provider: SsoProvider) => {\n try {\n await toggleProvider(provider.id, !provider.enabled);\n } catch {\n // Error is already set in hook\n }\n };\n\n const handleSave = async (data: CreateSsoProviderInput | UpdateSsoProviderInput) => {\n setFormError(null);\n try {\n if (viewMode === 'add') {\n await createProvider(data as CreateSsoProviderInput);\n } else if (editingProvider) {\n await updateProvider(editingProvider.id, data as UpdateSsoProviderInput);\n }\n setViewMode('list');\n setEditingProvider(null);\n } catch (err) {\n setFormError(err instanceof Error ? err.message : 'Failed to save provider');\n }\n };\n\n if (isLoading && providers.length === 0) {\n return (\n <div className={`cedros-system-settings cedros-system-settings-loading ${className ?? ''}`}>\n <LoadingSpinner />\n <span>Loading SSO providers...</span>\n </div>\n );\n }\n\n if (viewMode === 'add' || viewMode === 'edit') {\n return (\n <div className={`cedros-system-settings ${className ?? ''}`}>\n <SsoProviderForm\n provider={editingProvider}\n orgId={activeOrg?.id}\n error={formError}\n isLoading={isLoading}\n onSave={handleSave}\n onCancel={handleCancel}\n />\n </div>\n );\n }\n\n return (\n <div className={`cedros-system-settings ${className ?? ''}`}>\n <div className=\"cedros-settings-page-header\">\n <div className=\"cedros-settings-page-header-content\">\n <h2 className=\"cedros-settings-page-title\">SSO Providers</h2>\n <p className=\"cedros-settings-page-description\">\n Configure OIDC identity providers for enterprise single sign-on.\n </p>\n </div>\n <button type=\"button\" className=\"cedros-btn cedros-btn-primary\" onClick={handleAdd}>\n Add Provider\n </button>\n </div>\n\n {error && <ErrorMessage error={error.message} />}\n\n {providers.length === 0 ? (\n <div className=\"cedros-system-settings-empty\">\n <p>No SSO providers configured.</p>\n <p className=\"cedros-text-muted\">\n Add an OIDC provider like Okta, Azure AD, or Auth0 to enable enterprise SSO.\n </p>\n </div>\n ) : (\n <div className=\"cedros-sso-provider-list\">\n {providers.map((provider) => (\n <SsoProviderCard\n key={provider.id}\n provider={provider}\n onEdit={() => handleEdit(provider)}\n onDelete={() => handleDelete(provider)}\n onToggle={() => handleToggle(provider)}\n />\n ))}\n </div>\n )}\n </div>\n );\n}\n\n// =============================================================================\n// Provider Card\n// =============================================================================\n\ninterface SsoProviderCardProps {\n provider: SsoProvider;\n onEdit: () => void;\n onDelete: () => void;\n onToggle: () => void;\n}\n\nfunction SsoProviderCard({ provider, onEdit, onDelete, onToggle }: SsoProviderCardProps) {\n return (\n <div\n className={`cedros-sso-provider-card ${provider.enabled ? '' : 'cedros-sso-provider-card--disabled'}`}\n >\n <div className=\"cedros-sso-provider-card-header\">\n <div className=\"cedros-sso-provider-card-info\">\n <h3 className=\"cedros-sso-provider-card-name\">{provider.name}</h3>\n <p className=\"cedros-sso-provider-card-issuer\">{provider.issuerUrl}</p>\n </div>\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={provider.enabled}\n className={`cedros-toggle ${provider.enabled ? 'cedros-toggle-on' : 'cedros-toggle-off'}`}\n onClick={onToggle}\n >\n <span className=\"cedros-toggle-track\">\n <span className=\"cedros-toggle-thumb\" />\n </span>\n <span className=\"cedros-toggle-label\">{provider.enabled ? 'Enabled' : 'Disabled'}</span>\n </button>\n </div>\n\n <div className=\"cedros-sso-provider-card-details\">\n <div className=\"cedros-sso-provider-card-detail\">\n <span className=\"cedros-sso-provider-card-detail-label\">Client ID</span>\n <code className=\"cedros-sso-provider-card-detail-value\">{provider.clientId}</code>\n </div>\n {provider.emailDomain && (\n <div className=\"cedros-sso-provider-card-detail\">\n <span className=\"cedros-sso-provider-card-detail-label\">Email Domain</span>\n <span className=\"cedros-sso-provider-card-detail-value\">@{provider.emailDomain}</span>\n </div>\n )}\n <div className=\"cedros-sso-provider-card-detail\">\n <span className=\"cedros-sso-provider-card-detail-label\">Registration</span>\n <span className=\"cedros-sso-provider-card-detail-value\">\n {provider.allowRegistration ? 'Allowed' : 'Existing users only'}\n </span>\n </div>\n </div>\n\n <div className=\"cedros-sso-provider-card-actions\">\n <button type=\"button\" className=\"cedros-btn cedros-btn-ghost\" onClick={onEdit}>\n Edit\n </button>\n <button\n type=\"button\"\n className=\"cedros-btn cedros-btn-ghost cedros-btn-danger\"\n onClick={onDelete}\n >\n Delete\n </button>\n </div>\n </div>\n );\n}\n\n// =============================================================================\n// Provider Form\n// =============================================================================\n\ninterface SsoProviderFormProps {\n provider: SsoProvider | null;\n orgId?: string;\n error: string | null;\n isLoading: boolean;\n onSave: (data: CreateSsoProviderInput | UpdateSsoProviderInput) => void;\n onCancel: () => void;\n}\n\nfunction SsoProviderForm({\n provider,\n orgId,\n error,\n isLoading,\n onSave,\n onCancel,\n}: SsoProviderFormProps) {\n const isEditing = Boolean(provider);\n\n const [name, setName] = useState(provider?.name ?? '');\n const [issuerUrl, setIssuerUrl] = useState(provider?.issuerUrl ?? '');\n const [clientId, setClientId] = useState(provider?.clientId ?? '');\n const [clientSecret, setClientSecret] = useState('');\n const [emailDomain, setEmailDomain] = useState(provider?.emailDomain ?? '');\n const [allowRegistration, setAllowRegistration] = useState(provider?.allowRegistration ?? true);\n const [enabled, setEnabled] = useState(provider?.enabled ?? true);\n\n const handleSubmit = useCallback(\n (e: React.FormEvent) => {\n e.preventDefault();\n\n if (isEditing) {\n const updates: UpdateSsoProviderInput = {\n name,\n issuerUrl,\n clientId,\n emailDomain: emailDomain || null,\n allowRegistration,\n enabled,\n };\n // Only include secret if changed\n if (clientSecret) {\n updates.clientSecret = clientSecret;\n }\n onSave(updates);\n } else {\n if (!orgId) {\n return;\n }\n const data: CreateSsoProviderInput = {\n orgId,\n name,\n issuerUrl,\n clientId,\n clientSecret,\n emailDomain: emailDomain || null,\n allowRegistration,\n enabled,\n };\n onSave(data);\n }\n },\n [\n isEditing,\n orgId,\n name,\n issuerUrl,\n clientId,\n clientSecret,\n emailDomain,\n allowRegistration,\n enabled,\n onSave,\n ]\n );\n\n return (\n <form className=\"cedros-sso-provider-form\" onSubmit={handleSubmit}>\n <div className=\"cedros-settings-page-header\">\n <div className=\"cedros-settings-page-header-content\">\n <h2 className=\"cedros-settings-page-title\">\n {isEditing ? 'Edit SSO Provider' : 'Add SSO Provider'}\n </h2>\n <p className=\"cedros-settings-page-description\">\n Configure an OIDC identity provider for enterprise single sign-on.\n </p>\n </div>\n </div>\n\n {error && <ErrorMessage error={error} />}\n\n <div className=\"cedros-form-section\">\n <div className=\"cedros-form-group\">\n <label className=\"cedros-form-label\" htmlFor=\"sso-name\">\n Provider Name\n </label>\n <input\n id=\"sso-name\"\n type=\"text\"\n className=\"cedros-form-input\"\n value={name}\n onChange={(e) => setName(e.target.value)}\n placeholder=\"e.g., Okta, Azure AD\"\n required\n />\n </div>\n\n <div className=\"cedros-form-group\">\n <label className=\"cedros-form-label\" htmlFor=\"sso-issuer\">\n Issuer URL\n </label>\n <input\n id=\"sso-issuer\"\n type=\"url\"\n className=\"cedros-form-input\"\n value={issuerUrl}\n onChange={(e) => setIssuerUrl(e.target.value)}\n placeholder=\"https://your-org.okta.com\"\n required\n />\n <p className=\"cedros-form-hint\">\n The OIDC issuer URL. Must support discovery at /.well-known/openid-configuration\n </p>\n </div>\n\n <div className=\"cedros-form-group\">\n <label className=\"cedros-form-label\" htmlFor=\"sso-client-id\">\n Client ID\n </label>\n <input\n id=\"sso-client-id\"\n type=\"text\"\n className=\"cedros-form-input\"\n value={clientId}\n onChange={(e) => setClientId(e.target.value)}\n placeholder=\"OAuth client ID\"\n required\n />\n </div>\n\n <div className=\"cedros-form-group\">\n <label className=\"cedros-form-label\" htmlFor=\"sso-client-secret\">\n Client Secret{' '}\n {isEditing && (\n <span className=\"cedros-form-hint-inline\">(leave blank to keep current)</span>\n )}\n </label>\n <input\n id=\"sso-client-secret\"\n type=\"password\"\n className=\"cedros-form-input\"\n value={clientSecret}\n onChange={(e) => setClientSecret(e.target.value)}\n placeholder={isEditing ? '••••••••' : 'OAuth client secret'}\n required={!isEditing}\n />\n </div>\n\n <div className=\"cedros-form-group\">\n <label className=\"cedros-form-label\" htmlFor=\"sso-email-domain\">\n Email Domain (optional)\n </label>\n <input\n id=\"sso-email-domain\"\n type=\"text\"\n className=\"cedros-form-input\"\n value={emailDomain}\n onChange={(e) => setEmailDomain(e.target.value)}\n placeholder=\"company.com\"\n />\n <p className=\"cedros-form-hint\">Restrict to users with emails from this domain</p>\n </div>\n\n <div className=\"cedros-form-group\">\n <label className=\"cedros-form-checkbox\">\n <input\n type=\"checkbox\"\n checked={allowRegistration}\n onChange={(e) => setAllowRegistration(e.target.checked)}\n />\n <span>Allow new user registration via SSO</span>\n </label>\n </div>\n\n <div className=\"cedros-form-group\">\n <label className=\"cedros-form-checkbox\">\n <input\n type=\"checkbox\"\n checked={enabled}\n onChange={(e) => setEnabled(e.target.checked)}\n />\n <span>Enable this provider</span>\n </label>\n </div>\n </div>\n\n <div className=\"cedros-form-actions\">\n <button\n type=\"button\"\n className=\"cedros-btn cedros-btn-ghost\"\n onClick={onCancel}\n disabled={isLoading}\n >\n Cancel\n </button>\n <button type=\"submit\" className=\"cedros-btn cedros-btn-primary\" disabled={isLoading}>\n {isLoading ? 'Saving...' : isEditing ? 'Save Changes' : 'Add Provider'}\n </button>\n </div>\n </form>\n );\n}\n","/**\n * Drag-and-drop social button order settings with live preview.\n *\n * Uses HTML5 Drag and Drop API (no library needed for 4 items).\n * Reads enabled state from shared settings map (`auth_*_enabled` keys).\n */\nimport { useState, useCallback, useRef, type ReactNode } from 'react';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport interface SocialButtonOrderSettingsProps {\n /** Settings map (key -> SystemSetting[]) from useSettingsAutosave */\n settings: Record<string, { key: string; value: string }[]>;\n /** Autosave handler from parent */\n handleChange: (key: string, value: string) => void;\n}\n\ninterface ProviderMeta {\n label: string;\n icon: ReactNode;\n enabledKey: string;\n}\n\n// ---------------------------------------------------------------------------\n// Provider metadata + icons (matching existing button components)\n// ---------------------------------------------------------------------------\n\nfunction GoogleIcon() {\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M17.64 9.2c0-.637-.057-1.251-.164-1.84H9v3.481h4.844c-.209 1.125-.843 2.078-1.796 2.717v2.258h2.908c1.702-1.567 2.684-3.874 2.684-6.615z\" fill=\"#4285F4\" />\n <path d=\"M9.003 18c2.43 0 4.467-.806 5.956-2.18l-2.909-2.26c-.806.54-1.836.86-3.047.86-2.344 0-4.328-1.584-5.036-3.711H.96v2.332A8.997 8.997 0 0 0 9.003 18z\" fill=\"#34A853\" />\n <path d=\"M3.964 10.712A5.41 5.41 0 0 1 3.682 9c0-.593.102-1.17.282-1.71V4.958H.96A8.996 8.996 0 0 0 0 9c0 1.452.348 2.827.96 4.042l3.004-2.33z\" fill=\"#FBBC05\" />\n <path d=\"M9.003 3.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C13.464.891 11.428 0 9.002 0A8.997 8.997 0 0 0 .96 4.958l3.005 2.332c.708-2.127 2.692-3.71 5.036-3.71z\" fill=\"#EA4335\" />\n </svg>\n );\n}\n\nfunction AppleIcon() {\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <path d=\"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z\" />\n </svg>\n );\n}\n\nfunction SolanaIcon() {\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 128 128\" fill=\"currentColor\" aria-hidden=\"true\">\n <path d=\"M25.38 96.04a4.35 4.35 0 0 1 3.07-1.27h91.68c1.93 0 2.9 2.34 1.54 3.7l-17.71 17.72a4.35 4.35 0 0 1-3.07 1.27H9.21c-1.93 0-2.9-2.34-1.54-3.7l17.71-17.72z\" />\n <path d=\"M25.38 11.81a4.47 4.47 0 0 1 3.07-1.27h91.68c1.93 0 2.9 2.34 1.54 3.7L103.96 31.96a4.35 4.35 0 0 1-3.07 1.27H9.21c-1.93 0-2.9-2.34-1.54-3.7L25.38 11.81z\" />\n <path d=\"M102.62 53.76a4.35 4.35 0 0 0-3.07-1.27H7.87c-1.93 0-2.9 2.34-1.54 3.7l17.71 17.72a4.35 4.35 0 0 0 3.07 1.27h91.68c1.93 0 2.9-2.34 1.54-3.7L102.62 53.76z\" />\n </svg>\n );\n}\n\nfunction PasskeyIcon() {\n return (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4\" />\n <path d=\"M14 13.12c0 2.38 0 6.38-1 8.88\" />\n <path d=\"M17.29 21.02c.12-.6.43-2.3.5-3.02\" />\n <path d=\"M2 12a10 10 0 0 1 18-6\" />\n <path d=\"M2 16h.01\" />\n <path d=\"M21.8 16c.2-2 .131-5.354 0-6\" />\n <path d=\"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2\" />\n <path d=\"M8.65 22c.21-.66.45-1.32.57-2\" />\n <path d=\"M9 6.8a6 6 0 0 1 9 5.2v2\" />\n </svg>\n );\n}\n\nconst PROVIDERS: Record<string, ProviderMeta> = {\n webauthn: { label: 'Passkey', icon: <PasskeyIcon />, enabledKey: 'auth_webauthn_enabled' },\n google: { label: 'Google', icon: <GoogleIcon />, enabledKey: 'auth_google_enabled' },\n apple: { label: 'Apple', icon: <AppleIcon />, enabledKey: 'auth_apple_enabled' },\n solana: { label: 'Solana', icon: <SolanaIcon />, enabledKey: 'auth_solana_enabled' },\n};\n\nconst DEFAULT_ORDER = ['webauthn', 'google', 'apple', 'solana'];\n\nconst PREVIEW_LABELS: Record<string, string> = {\n webauthn: 'Continue with Passkey',\n google: 'Continue with Google',\n apple: 'Continue with Apple',\n solana: 'Continue with Solana',\n};\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\n/** Read whether a provider is enabled from the flattened settings. */\nfunction isProviderEnabled(\n settings: Record<string, { key: string; value: string }[]>,\n enabledKey: string,\n): boolean {\n for (const group of Object.values(settings)) {\n const found = group.find((s) => s.key === enabledKey);\n if (found) return found.value === 'true';\n }\n return true; // default enabled when setting is absent\n}\n\n/** Read current order from settings map, falling back to default. */\nfunction readOrder(settings: Record<string, { key: string; value: string }[]>): string[] {\n for (const group of Object.values(settings)) {\n const found = group.find((s) => s.key === 'ui_social_button_order');\n if (found && found.value) return found.value.split(',').map((s) => s.trim());\n }\n return DEFAULT_ORDER;\n}\n\n// ---------------------------------------------------------------------------\n// Grab-handle icon\n// ---------------------------------------------------------------------------\n\nfunction GrabHandle() {\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\" style={{ opacity: 0.4 }}>\n <circle cx=\"5\" cy=\"3\" r=\"1.5\" />\n <circle cx=\"11\" cy=\"3\" r=\"1.5\" />\n <circle cx=\"5\" cy=\"8\" r=\"1.5\" />\n <circle cx=\"11\" cy=\"8\" r=\"1.5\" />\n <circle cx=\"5\" cy=\"13\" r=\"1.5\" />\n <circle cx=\"11\" cy=\"13\" r=\"1.5\" />\n </svg>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\nexport function SocialButtonOrderSettings({ settings, handleChange }: SocialButtonOrderSettingsProps) {\n const [order, setOrder] = useState<string[]>(() => readOrder(settings));\n const dragIdx = useRef<number | null>(null);\n const [dragOverIdx, setDragOverIdx] = useState<number | null>(null);\n\n const persist = useCallback(\n (newOrder: string[]) => {\n setOrder(newOrder);\n handleChange('ui_social_button_order', newOrder.join(','));\n },\n [handleChange],\n );\n\n const onDragStart = useCallback((idx: number) => {\n dragIdx.current = idx;\n }, []);\n\n const onDragOver = useCallback((e: React.DragEvent, idx: number) => {\n e.preventDefault();\n setDragOverIdx(idx);\n }, []);\n\n const onDrop = useCallback(\n (targetIdx: number) => {\n const fromIdx = dragIdx.current;\n if (fromIdx === null || fromIdx === targetIdx) {\n setDragOverIdx(null);\n return;\n }\n const next = [...order];\n const [moved] = next.splice(fromIdx, 1);\n next.splice(targetIdx, 0, moved);\n persist(next);\n dragIdx.current = null;\n setDragOverIdx(null);\n },\n [order, persist],\n );\n\n const onDragEnd = useCallback(() => {\n dragIdx.current = null;\n setDragOverIdx(null);\n }, []);\n\n return (\n <div className=\"cedros-system-settings\">\n <div className=\"cedros-settings-page-header\">\n <div className=\"cedros-settings-page-header-content\">\n <h2 className=\"cedros-settings-page-title\">Button Order</h2>\n <p className=\"cedros-settings-page-description\">\n Drag to reorder the social login buttons on your sign-in form.\n </p>\n </div>\n </div>\n\n <div style={{ display: 'flex', gap: '2rem', flexWrap: 'wrap' }}>\n {/* Left: Reorder list */}\n <div style={{ flex: '1 1 260px', minWidth: 260 }}>\n <ul style={{ listStyle: 'none', padding: 0, margin: 0, display: 'flex', flexDirection: 'column', gap: '0.5rem' }}>\n {order.map((id, idx) => {\n const meta = PROVIDERS[id];\n if (!meta) return null;\n const enabled = isProviderEnabled(settings, meta.enabledKey);\n const isDragOver = dragOverIdx === idx;\n return (\n <li\n key={id}\n draggable\n onDragStart={() => onDragStart(idx)}\n onDragOver={(e) => onDragOver(e, idx)}\n onDrop={() => onDrop(idx)}\n onDragEnd={onDragEnd}\n className=\"cedros-btn-order-item\"\n style={{\n display: 'flex',\n alignItems: 'center',\n gap: '0.75rem',\n padding: '0.625rem 0.75rem',\n borderRadius: 'var(--cedros-radius, 0.5rem)',\n border: isDragOver\n ? '2px solid var(--cedros-primary, #6366f1)'\n : '1px solid var(--cedros-border, #e5e7eb)',\n background: 'var(--cedros-background, #fff)',\n cursor: 'grab',\n opacity: enabled ? 1 : 0.5,\n transition: 'border-color 0.15s',\n }}\n >\n <GrabHandle />\n <span className=\"cedros-button-icon\" style={{ display: 'flex', alignItems: 'center' }}>\n {meta.icon}\n </span>\n <span style={{ flex: 1, fontWeight: 500, fontSize: '0.875rem' }}>{meta.label}</span>\n <span\n style={{\n fontSize: '0.7rem',\n padding: '0.125rem 0.5rem',\n borderRadius: '9999px',\n background: enabled\n ? 'var(--cedros-primary, #6366f1)'\n : 'var(--cedros-muted, #f3f4f6)',\n color: enabled\n ? 'var(--cedros-primary-foreground, #fff)'\n : 'var(--cedros-muted-foreground, #6b7280)',\n }}\n >\n {enabled ? 'Enabled' : 'Disabled'}\n </span>\n </li>\n );\n })}\n </ul>\n </div>\n\n {/* Right: Live preview */}\n <div style={{ flex: '1 1 280px', minWidth: 280 }}>\n <p style={{ fontSize: '0.75rem', color: 'var(--cedros-muted-foreground, #6b7280)', margin: '0 0 0.75rem' }}>\n This is how your login form buttons will appear:\n </p>\n <div\n style={{\n display: 'flex',\n flexDirection: 'column',\n gap: '0.5rem',\n padding: '1.25rem',\n borderRadius: 'var(--cedros-radius, 0.5rem)',\n border: '1px solid var(--cedros-border, #e5e7eb)',\n background: 'var(--cedros-background, #fff)',\n }}\n >\n {order.map((id) => {\n const meta = PROVIDERS[id];\n if (!meta) return null;\n const enabled = isProviderEnabled(settings, meta.enabledKey);\n if (!enabled) return null;\n return (\n <button\n key={id}\n type=\"button\"\n className=\"cedros-button cedros-button-social\"\n style={{ pointerEvents: 'none', width: '100%' }}\n tabIndex={-1}\n >\n <span className=\"cedros-button-icon\">{meta.icon}</span>\n {PREVIEW_LABELS[id]}\n </button>\n );\n })}\n </div>\n </div>\n </div>\n </div>\n );\n}\n","/**\n * Authentication settings page - configure auth providers with tabs\n */\nimport { useState, useEffect, useMemo } from 'react';\nimport { LoadingSpinner } from '../../shared/LoadingSpinner';\nimport { ErrorMessage } from '../../shared/ErrorMessage';\nimport { useSettingsAutosave } from '../../../hooks/useSettingsAutosave';\nimport { SettingsSection } from './settingsInputs';\nimport { AutosaveStatus } from './AutosaveStatus';\nimport { SsoProvidersSettings } from './SsoProvidersSettings';\nimport { SocialButtonOrderSettings } from './SocialButtonOrderSettings';\n\ntype AuthTab = 'email' | 'google' | 'apple' | 'solana' | 'passkeys' | 'instantlink' | 'sso' | 'buttonorder' | 'postlogin';\n\ninterface TabConfig {\n id: AuthTab;\n label: string;\n /** Categories to pull settings from (not used for 'sso' tab) */\n categories: string[];\n /** Optional list of specific keys to show (if omitted, show all in categories) */\n keys?: string[];\n /** If true, renders a custom component instead of settings section */\n isCustom?: boolean;\n}\n\nconst TABS: TabConfig[] = [\n { id: 'email', label: 'Email', categories: ['auth.email'],\n keys: ['auth_email_enabled', 'auth_email_require_verification', 'auth_email_block_disposable'] },\n { id: 'google', label: 'Google', categories: ['auth.google'],\n keys: ['auth_google_enabled', 'auth_google_client_id'] },\n { id: 'apple', label: 'Apple', categories: ['auth.apple'],\n keys: ['auth_apple_enabled', 'auth_apple_client_id', 'auth_apple_team_id'] },\n { id: 'solana', label: 'Solana', categories: ['auth.solana'],\n keys: ['auth_solana_enabled', 'auth_solana_challenge_expiry'] },\n { id: 'passkeys', label: 'Passkeys', categories: ['auth.webauthn'],\n keys: ['auth_webauthn_enabled', 'auth_webauthn_rp_id', 'auth_webauthn_rp_name', 'auth_webauthn_rp_origin'] },\n { id: 'instantlink', label: 'Instant Link', categories: ['auth.instantlink'],\n keys: ['auth_instantlink_enabled', 'auth_instantlink_expiry', 'auth_instantlink_rate_limit'] },\n { id: 'sso', label: 'SSO Providers', categories: [], isCustom: true },\n { id: 'buttonorder', label: 'Button Order', categories: [], isCustom: true },\n { id: 'postlogin', label: 'Post-Login', categories: ['postlogin', 'postlogin.welcome', 'postlogin.username', 'postlogin.complete', 'postlogin.wallet'],\n keys: ['postlogin_redirect_url', 'postlogin_welcome_enabled', 'postlogin_welcome_route', 'postlogin_username_enabled', 'postlogin_complete_enabled', 'postlogin_wallet_enroll_enabled', 'postlogin_show_recovery_enabled'] },\n];\n\nexport interface AuthenticationSettingsProps {\n className?: string;\n}\n\nexport function AuthenticationSettings({ className }: AuthenticationSettingsProps) {\n const {\n settings,\n edits,\n isLoading,\n autosaveStatus,\n autosaveError,\n error,\n fetchSettings,\n handleChange,\n } = useSettingsAutosave();\n\n const [activeTab, setActiveTab] = useState<AuthTab>('email');\n\n useEffect(() => {\n fetchSettings();\n }, [fetchSettings]);\n\n // Get current tab config\n const currentTab = TABS.find((t) => t.id === activeTab);\n\n // Collect settings from all categories for the current tab\n const allTabSettings = useMemo(() => {\n if (!currentTab) return [];\n const allSettings: (typeof settings)[string] = [];\n for (const category of currentTab.categories) {\n const categorySettings = settings[category] ?? [];\n allSettings.push(...categorySettings);\n }\n return allSettings;\n }, [settings, currentTab]);\n\n const currentSettings = useMemo(() => {\n if (!currentTab?.keys) return allTabSettings;\n // Filter and sort by keys order\n return allTabSettings\n .filter((s) => currentTab.keys!.includes(s.key))\n .sort((a, b) => currentTab.keys!.indexOf(a.key) - currentTab.keys!.indexOf(b.key));\n }, [allTabSettings, currentTab]);\n\n if (isLoading && Object.keys(settings).length === 0) {\n return (\n <div className={`cedros-system-settings cedros-system-settings-loading ${className ?? ''}`}>\n <LoadingSpinner />\n <span>Loading settings...</span>\n </div>\n );\n }\n\n if (error) {\n return (\n <div className={`cedros-system-settings ${className ?? ''}`}>\n <ErrorMessage error={error.message} />\n </div>\n );\n }\n\n return (\n <div className={`cedros-system-settings ${className ?? ''}`}>\n <div className=\"cedros-settings-page-header\">\n <div className=\"cedros-settings-page-header-content\">\n <h2 className=\"cedros-settings-page-title\">Authentication</h2>\n <p className=\"cedros-settings-page-description\">\n Configure authentication providers and methods for user sign-in.\n </p>\n </div>\n <AutosaveStatus status={autosaveStatus} error={autosaveError} />\n </div>\n\n {/* Tabs */}\n <div className=\"cedros-admin-tabs cedros-admin-tabs--line\">\n {TABS.map((tab) => (\n <button\n key={tab.id}\n type=\"button\"\n className={`cedros-admin-tab ${activeTab === tab.id ? 'cedros-admin-tab-active' : ''}`}\n onClick={() => setActiveTab(tab.id)}\n aria-selected={activeTab === tab.id}\n role=\"tab\"\n >\n {tab.label}\n </button>\n ))}\n </div>\n\n {/* Tab content */}\n <div className=\"cedros-admin-tab-content\" role=\"tabpanel\">\n {currentTab?.id === 'buttonorder' ? (\n <SocialButtonOrderSettings settings={settings} handleChange={handleChange} />\n ) : currentTab?.isCustom ? (\n <SsoProvidersSettings />\n ) : currentSettings.length === 0 ? (\n <div className=\"cedros-system-settings-empty\">\n <p>No settings found for {currentTab?.label ?? 'this provider'}.</p>\n </div>\n ) : (\n <SettingsSection settings={currentSettings} edits={edits} onChange={handleChange} />\n )}\n </div>\n </div>\n );\n}\n"],"names":["useSsoProviders","config","_internal","useCedrosLogin","serverUrl","getAccessTokenRef","useRef","providers","setProviders","useState","total","setTotal","isLoading","setIsLoading","error","setError","getHeaders","useCallback","token","fetchProviders","orgId","limit","offset","params","res","err","data","createProvider","input","provider","prev","updateProvider","id","p","deleteProvider","toggleProvider","enabled","SsoProvidersSettings","className","activeOrg","useOrgs","viewMode","setViewMode","editingProvider","setEditingProvider","formError","setFormError","useEffect","handleAdd","handleEdit","handleCancel","handleDelete","handleToggle","handleSave","jsx","LoadingSpinner","SsoProviderForm","jsxs","ErrorMessage","SsoProviderCard","onEdit","onDelete","onToggle","onSave","onCancel","isEditing","name","setName","issuerUrl","setIssuerUrl","clientId","setClientId","clientSecret","setClientSecret","emailDomain","setEmailDomain","allowRegistration","setAllowRegistration","setEnabled","handleSubmit","e","updates","GoogleIcon","AppleIcon","SolanaIcon","PasskeyIcon","PROVIDERS","DEFAULT_ORDER","PREVIEW_LABELS","isProviderEnabled","settings","enabledKey","group","found","s","readOrder","GrabHandle","SocialButtonOrderSettings","handleChange","order","setOrder","dragIdx","dragOverIdx","setDragOverIdx","persist","newOrder","onDragStart","idx","onDragOver","onDrop","targetIdx","fromIdx","next","moved","onDragEnd","meta","isDragOver","TABS","AuthenticationSettings","edits","autosaveStatus","autosaveError","fetchSettings","useSettingsAutosave","activeTab","setActiveTab","currentTab","t","allTabSettings","useMemo","allSettings","category","categorySettings","currentSettings","a","b","AutosaveStatus","tab","SettingsSection"],"mappings":"mRAkDO,SAASA,GAAkB,CAChC,KAAM,CAAE,OAAAC,EAAQ,UAAAC,CAAA,EAAcC,iBAAA,EACxBC,EAAYH,EAAO,UAInBI,EAAoBC,EAAAA,OAAOJ,GAAW,iBAAmB,IAAM,KAAK,EAC1EG,EAAkB,QAAUH,GAAW,iBAAmB,IAAM,MAEhE,KAAM,CAACK,EAAWC,CAAY,EAAIC,EAAAA,SAAwB,CAAA,CAAE,EACtD,CAACC,EAAOC,CAAQ,EAAIF,EAAAA,SAAS,CAAC,EAC9B,CAACG,EAAWC,CAAY,EAAIJ,EAAAA,SAAS,EAAK,EAC1C,CAACK,EAAOC,CAAQ,EAAIN,EAAAA,SAAuB,IAAI,EAG/CO,EAAaC,EAAAA,YAAY,IAAM,CACnC,MAAMC,EAAQb,EAAkB,QAAA,EAChC,MAAO,CACL,eAAgB,mBAChB,GAAIa,EAAQ,CAAE,cAAe,UAAUA,CAAK,IAAO,CAAA,CAAC,CAExD,EAAG,CAAA,CAAE,EAECC,EAAiBF,EAAAA,YACrB,MAAOG,EAAgBC,EAAQ,GAAIC,EAAS,IAAM,CAChDT,EAAa,EAAI,EACjBE,EAAS,IAAI,EACb,GAAI,CACF,MAAMQ,EAAS,IAAI,gBACfH,GAAOG,EAAO,IAAI,SAAUH,CAAK,EACrCG,EAAO,IAAI,QAAS,OAAOF,CAAK,CAAC,EACjCE,EAAO,IAAI,SAAU,OAAOD,CAAM,CAAC,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,EAEAxE,EAAAA,IAACoF,kBAAA,CAAgB,SAAUL,EAAiB,MAAAd,EAAc,SAAUrB,CAAA,CAAc,CAAA,CAEtF,CAAA,EACF,CAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime");require("react");const e=require("./AuthenticationSettings-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime");require("react");const e=require("./AuthenticationSettings-DPr882lj.cjs");function i(){return t.jsx("div",{className:"cedros-dashboard__section",children:t.jsx(e.AuthenticationSettings,{})})}exports.default=i;
|
package/dist/{AuthenticationSettings-DABzZHuI.cjs.map → AuthenticationSettings-Y40T1djV.cjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthenticationSettings-
|
|
1
|
+
{"version":3,"file":"AuthenticationSettings-Y40T1djV.cjs","sources":["../src/admin/sections/AuthenticationSettings.tsx"],"sourcesContent":["/**\n * Authentication Settings Section - Plugin wrapper\n */\n\nimport React from 'react';\nimport { AuthenticationSettings as Settings } from '../../components/admin/settings';\n\nexport default function AuthenticationSettings(): React.JSX.Element {\n return (\n <div className=\"cedros-dashboard__section\">\n <Settings />\n </div>\n );\n}\n"],"names":["AuthenticationSettings","jsx","Settings"],"mappings":"+LAOA,SAAwBA,GAA4C,CAClE,aACG,MAAA,CAAI,UAAU,4BACb,SAAAC,MAACC,EAAAA,yBAAS,EACZ,CAEJ"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { A as i } from "./AuthenticationSettings-
|
|
3
|
+
import { A as i } from "./AuthenticationSettings-CxAubcoz.js";
|
|
4
4
|
function r() {
|
|
5
5
|
return /* @__PURE__ */ t("div", { className: "cedros-dashboard__section", children: /* @__PURE__ */ t(i, {}) });
|
|
6
6
|
}
|
package/dist/{AuthenticationSettings-D4ExU-2a.js.map → AuthenticationSettings-aVBFKKZ-.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthenticationSettings-
|
|
1
|
+
{"version":3,"file":"AuthenticationSettings-aVBFKKZ-.js","sources":["../src/admin/sections/AuthenticationSettings.tsx"],"sourcesContent":["/**\n * Authentication Settings Section - Plugin wrapper\n */\n\nimport React from 'react';\nimport { AuthenticationSettings as Settings } from '../../components/admin/settings';\n\nexport default function AuthenticationSettings(): React.JSX.Element {\n return (\n <div className=\"cedros-dashboard__section\">\n <Settings />\n </div>\n );\n}\n"],"names":["AuthenticationSettings","jsx","Settings"],"mappings":";;;AAOA,SAAwBA,IAA4C;AAClE,2BACG,OAAA,EAAI,WAAU,6BACb,UAAA,gBAAAC,EAACC,KAAS,GACZ;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),d=require("react"),A=require("./useCedrosLogin-DtJorrE7.cjs"),D=require("./useSystemSettings-B2jY51ob.cjs");function R(t){const s=Math.floor(t/86400),a=Math.floor(t%86400/3600),l=Math.floor(t%3600/60),i=t%60;return{days:s,hours:a,minutes:l,seconds:i}}function L(t){const{days:s,hours:a,minutes:l}=R(t),i=[];return s>0&&i.push(`${s}d`),a>0&&i.push(`${a}h`),l>0&&i.push(`${l}m`),i.length===0&&i.push(`${t}s`),i.join(" ")}const j={auth_email_enabled:{key:"auth_email_enabled",label:"Enable Email Authentication",description:"Allow users to sign up and log in with email/password.",inputType:"boolean"},auth_email_require_verification:{key:"auth_email_require_verification",label:"Require Email Verification",description:"Users must verify their email address before they can log in.",inputType:"boolean"},auth_email_block_disposable:{key:"auth_email_block_disposable",label:"Block Disposable Emails",description:"Reject registrations from known disposable email providers.",inputType:"boolean"},auth_google_enabled:{key:"auth_google_enabled",label:"Enable Google Sign-In",description:'Allow users to authenticate with their Google account. Configure at <a href="https://console.cloud.google.com/apis/credentials" target="_blank" rel="noopener">Google Cloud Console > Credentials</a>.',inputType:"boolean"},auth_google_client_id:{key:"auth_google_client_id",label:"Google Client ID",description:"OAuth 2.0 client ID from Google Cloud Console. Create a Web application credential and add your frontend URL to Authorized JavaScript origins.",inputType:"text"},auth_apple_enabled:{key:"auth_apple_enabled",label:"Enable Sign in with Apple",description:'Allow users to authenticate with their Apple ID. Configure at <a href="https://developer.apple.com/account/resources/identifiers" target="_blank" rel="noopener">Apple Developer > Identifiers</a>.',inputType:"boolean"},auth_apple_client_id:{key:"auth_apple_client_id",label:"Apple Services ID",description:"Your Client ID (e.g. com.yourdomain.service). Create at Identifiers > Services IDs, then enable Sign in with Apple and add your frontend URL as a Return URL (e.g. https://yourdomain.com).",inputType:"text",placeholder:"com.yourdomain.service"},auth_apple_team_id:{key:"auth_apple_team_id",label:"Apple Team ID",description:'Identifies your developer account. Found at the top-right of <a href="https://developer.apple.com/account" target="_blank" rel="noopener">Apple Developer</a>.',inputType:"text"},auth_solana_enabled:{key:"auth_solana_enabled",label:"Enable Solana Wallet Auth",description:"Allow users to authenticate by signing with their Solana wallet.",inputType:"boolean"},auth_solana_challenge_expiry:{key:"auth_solana_challenge_expiry",label:"Challenge Expiry",description:"How long a wallet signature challenge is valid.",inputType:"duration",min:60,presets:[{label:"1 minute",value:"60"},{label:"5 minutes",value:"300"},{label:"10 minutes",value:"600"}]},auth_webauthn_enabled:{key:"auth_webauthn_enabled",label:"Enable WebAuthn/Passkeys",description:"Allow passwordless authentication with FIDO2/WebAuthn credentials.",inputType:"boolean"},auth_webauthn_rp_id:{key:"auth_webauthn_rp_id",label:"Relying Party ID",description:"Usually your domain (e.g., example.com). Passkeys are bound to this.",inputType:"text"},auth_webauthn_rp_name:{key:"auth_webauthn_rp_name",label:"Relying Party Name",description:"Display name shown to users during passkey registration.",inputType:"text"},auth_webauthn_rp_origin:{key:"auth_webauthn_rp_origin",label:"Allowed Origins",description:"Comma-separated origins allowed for WebAuthn (e.g., https://example.com).",inputType:"text"},auth_instantlink_enabled:{key:"auth_instantlink_enabled",label:"Enable Instant Link",description:'When enabled, "Forgot your password?" on the sign-in form sends a one-time sign-in link instead of a password reset. This replaces the password reset flow — it is not a separate login button.',inputType:"boolean"},auth_instantlink_expiry:{key:"auth_instantlink_expiry",label:"Link Expiry",description:"How long the magic link remains valid.",inputType:"duration",min:60,presets:[{label:"5 minutes",value:"300"},{label:"15 minutes",value:"900"},{label:"30 minutes",value:"1800"},{label:"1 hour",value:"3600"}]},auth_instantlink_rate_limit:{key:"auth_instantlink_rate_limit",label:"Rate Limit",description:"Maximum instant link requests per email per hour.",inputType:"select",presets:[{label:"3 per hour",value:"3"},{label:"5 per hour",value:"5"},{label:"10 per hour",value:"10"}]},feature_organizations:{key:"feature_organizations",label:"Organizations",description:"Enable multi-user organizations with role-based access.",inputType:"boolean"},feature_sso:{key:"feature_sso",label:"Enterprise SSO",description:"Enable SAML/OIDC single sign-on for enterprise customers.",inputType:"boolean"},feature_mfa:{key:"feature_mfa",label:"Two-Factor Authentication",description:"Allow users to enable TOTP-based two-factor authentication for email/password sign-in. OAuth (Google, Apple) and passkey logins are not affected — those providers handle their own verification.",inputType:"boolean"},feature_wallet_signing:{key:"feature_wallet_signing",label:"Enable Embedded Wallet",description:"Enable the embedded wallet for transaction signing.",inputType:"boolean"},wallet_recovery_mode:{key:"wallet_recovery_mode",label:"Recovery Mode",description:"Controls whether users can recover their embedded wallet seed. <b>Share C Only</b> lets users export a single key share (cannot reconstruct the full seed). <b>Full Seed</b> lets users export the complete seed phrase. <b>No Recovery</b> prevents any seed export — required when Private Deposits are enabled, because recoverable seeds would let users front-run privacy withdrawals.",inputType:"select",presets:[{label:"Share C Only (Recommended)",value:"share_c_only"},{label:"Full Seed Phrase",value:"full_seed"},{label:"No Recovery (Required for Private Deposits)",value:"none"}]},feature_credits:{key:"feature_credits",label:"Credit System",description:"Enable the deposits and credits system. Users can deposit tokens to receive platform credits.",inputType:"boolean"},feature_user_withdrawals:{key:"feature_user_withdrawals",label:"User Withdrawals",description:"Allow users to initiate withdrawals from their embedded wallet to external addresses. This is separate from the automated privacy withdrawal worker, which moves funds from the privacy pool to the treasury.",inputType:"boolean"},feature_referrals_enabled:{key:"feature_referrals_enabled",label:"Referral System",description:"Enable the referral system. Each user gets a unique referral code they can share. New users can register with a referral code to track who invited them.",inputType:"boolean"},referral_reward_lamports:{key:"referral_reward_lamports",label:"Referral Reward Amount (lamports)",description:"Amount of credits to reward the referrer (in smallest unit: lamports for SOL, micros for USD). Set to 0 to disable referral rewards. For example, 1000000000 = 1 SOL.",inputType:"text"},referral_reward_max_per_referrer:{key:"referral_reward_max_per_referrer",label:"Max Reward Per Referrer",description:"Maximum total reward amount a single referrer can earn (in smallest unit). Set to 0 for unlimited. Applies to direct payout mode only.",inputType:"text"},referral_reward_type:{key:"referral_reward_type",label:"Referral Reward Type",description:`How referral rewards are issued. "Credits" adds balance to the referrer's in-app credit account. "Direct payout" queues an on-chain transfer to the referrer's configured payout wallet address.`,inputType:"select",presets:[{label:"Credits",value:"credits"},{label:"Direct payout (on-chain)",value:"direct_payout"}]},referral_reward_trigger:{key:"referral_reward_trigger",label:"Referral Reward Trigger",description:'When to issue the referral reward to the referrer. "On signup" rewards immediately when the referred user registers. "On first purchase" rewards only after the referred user makes their first spend. "On every purchase" rewards the referrer on each spend by the referred user.',inputType:"select",presets:[{label:"On signup",value:"on_signup"},{label:"On first purchase",value:"on_first_spend"},{label:"On every purchase",value:"on_every_spend"}]},payout_auto_enabled:{key:"payout_auto_enabled",label:"Auto-Process Payouts",description:"Enable the automated payout worker that periodically processes pending referral payouts on-chain. When disabled, payouts must be processed manually from the admin dashboard.",inputType:"boolean"},payout_poll_interval_secs:{key:"payout_poll_interval_secs",label:"Payout Poll Interval",description:"How often the payout worker checks for pending payouts (in seconds). Default: 3600 (1 hour). Lower values mean faster payouts but more frequent treasury key decryption.",inputType:"duration",unit:"seconds"},payout_batch_size:{key:"payout_batch_size",label:"Payout Batch Size",description:"Maximum number of referrer groups to process per worker cycle. Default: 50. Each referrer group aggregates all pending payouts for that referrer into a single transfer.",inputType:"text"},security_require_mfa:{key:"security_require_mfa",label:"Require Two-Factor Authentication",description:'Require users with email/password credentials to set up TOTP two-factor authentication. Users will be prompted to enroll after their next sign-in. Does not affect OAuth, passkey, or wallet sign-in methods. Works independently of the "Two-Factor Authentication" feature flag (which controls UI visibility).',inputType:"boolean"},security_cors_origins:{key:"security_cors_origins",label:"CORS Origins",description:"Allowed origins for cross-origin requests (comma-separated). Empty = same origin only.",inputType:"text"},security_cookie_domain:{key:"security_cookie_domain",label:"Cookie Domain",description:"Domain for auth cookies. Empty uses the request origin.",inputType:"text"},security_cookie_secure:{key:"security_cookie_secure",label:"Secure Cookies",description:"Require HTTPS for cookies. Disable only for local development.",inputType:"boolean"},security_cookie_same_site:{key:"security_cookie_same_site",label:"Cookie SameSite",description:'SameSite policy for cookies. Use "none" only if needed for cross-site embeds.',inputType:"select",presets:[{label:"Strict",value:"strict"},{label:"Lax (Recommended)",value:"lax"},{label:"None (cross-site)",value:"none"}]},security_session_timeout:{key:"security_session_timeout",label:"Session Timeout",description:"How long sessions remain valid before requiring re-authentication.",inputType:"duration",min:300,presets:[{label:"1 hour",value:"3600"},{label:"24 hours",value:"86400"},{label:"7 days",value:"604800"},{label:"30 days",value:"2592000"}]},security_jwt_issuer:{key:"security_jwt_issuer",label:"JWT Issuer",description:"Issuer claim for JWTs. Empty uses the server URL.",inputType:"text"},security_jwt_audience:{key:"security_jwt_audience",label:"JWT Audience",description:"Audience claim for JWTs. Empty uses default.",inputType:"text"},email_provider:{key:"email_provider",label:"Email Provider",description:"Select a provider to auto-configure SMTP host, port, and TLS. Choose Custom SMTP to enter settings manually.",inputType:"select",presets:[{label:"Mailgun",value:"mailgun"},{label:"SendGrid",value:"sendgrid"},{label:"Postmark",value:"postmark"},{label:"AWS SES",value:"ses"},{label:"Resend",value:"resend"},{label:"Custom SMTP",value:"custom"}]},email_smtp_host:{key:"email_smtp_host",label:"SMTP Host",description:"SMTP server hostname. Auto-filled when selecting a provider above.",inputType:"text",placeholder:"smtp.example.com"},email_smtp_port:{key:"email_smtp_port",label:"SMTP Port",description:"SMTP server port. Most providers use 587 (TLS).",inputType:"select",presets:[{label:"587 (TLS)",value:"587"},{label:"465 (SSL)",value:"465"},{label:"25 (Plain)",value:"25"}]},email_smtp_user:{key:"email_smtp_user",label:"SMTP Username",description:'Username for SMTP authentication. For SendGrid use "apikey", for Postmark use your server API token, for Mailgun use your full Mailgun SMTP login.',inputType:"text"},email_smtp_password:{key:"email_smtp_password",label:"API Key",description:"API key or password for your email provider. For SendGrid this is your API key, for Postmark your server API token, for Mailgun your SMTP password.",inputType:"secret"},email_smtp_tls:{key:"email_smtp_tls",label:"Use TLS",description:"Enable TLS encryption for SMTP connections. Required by most providers.",inputType:"boolean"},email_from_address:{key:"email_from_address",label:"From Address",description:"Sender email address for verification, password reset, and instant link emails. Must be verified with your provider.",inputType:"text",placeholder:"noreply@yourdomain.com"},email_from_name:{key:"email_from_name",label:"From Name",description:'Display name shown in the "From" field of outbound emails.',inputType:"text",placeholder:"My App"},email_subject_verification:{key:"email_subject_verification",label:"Verification Email Subject",description:'Custom subject for email verification messages. Leave empty for the default: "Verify your email address".',inputType:"text",placeholder:"Verify your email address"},email_subject_password_reset:{key:"email_subject_password_reset",label:"Password Reset Subject",description:'Custom subject for password reset emails. Leave empty for the default: "Reset your password".',inputType:"text",placeholder:"Reset your password"},email_subject_instant_link:{key:"email_subject_instant_link",label:"Instant Link Subject",description:'Custom subject for instant link sign-in emails. Leave empty for the default: "Your sign-in link".',inputType:"text",placeholder:"Your sign-in link"},email_subject_invite:{key:"email_subject_invite",label:"Invite Email Subject",description:"Custom subject for organization invite emails. Leave empty for the default which includes the org name.",inputType:"text",placeholder:"You've been invited to join..."},email_subject_security_alert:{key:"email_subject_security_alert",label:"Security Alert Subject",description:'Custom subject for new device sign-in alerts. Leave empty for the default: "New sign-in to your account".',inputType:"text",placeholder:"New sign-in to your account"},webhook_enabled:{key:"webhook_enabled",label:"Enable Webhooks",description:"Send notifications to a Discord or Slack webhook URL.",inputType:"boolean"},webhook_url:{key:"webhook_url",label:"Webhook URL",description:"Discord or Slack webhook URL to receive notifications.",inputType:"text",placeholder:"https://discord.com/api/webhooks/..."},webhook_notify_registrations:{key:"webhook_notify_registrations",label:"New Registrations",description:"Notify when a new user registers.",inputType:"boolean"},webhook_notify_signins:{key:"webhook_notify_signins",label:"Sign-Ins",description:"Notify when a user signs in.",inputType:"boolean"},webhook_notify_deposits:{key:"webhook_notify_deposits",label:"Deposits",description:"Notify when a user makes a deposit.",inputType:"boolean"},server_frontend_url:{key:"server_frontend_url",label:"Frontend URL",description:"URL of your frontend app (for redirects and email links).",inputType:"text"},server_base_path:{key:"server_base_path",label:"Base Path",description:"Base path for auth endpoints (e.g., /auth).",inputType:"text"},server_trust_proxy:{key:"server_trust_proxy",label:"Trust Proxy",description:"Trust X-Forwarded-For headers. Enable if behind a reverse proxy.",inputType:"boolean"},feature_cedros_pay:{key:"feature_cedros_pay",label:"Cedros Pay Integration",description:"Enable Cedros Pay integration. When enabled, shows the Integrations tab with API key configuration. Not needed for co-located deployments using JWT/JWKS inter-service auth.",inputType:"boolean"},server_cedros_pay_api_key:{key:"server_cedros_pay_api_key",label:"Cedros Pay API Key",description:"API key for Cedros Pay to authenticate with this server. Copy this into your Cedros Pay settings.",inputType:"secret"},jupiter_api_key:{key:"jupiter_api_key",label:"Jupiter API Key",description:'API key for Jupiter Ultra API (gasless swaps). Get a free key at <a href="https://portal.jup.ag" target="_blank" rel="noopener">portal.jup.ag</a>.',inputType:"secret"},server_metrics_api_key:{key:"server_metrics_api_key",label:"Metrics API Key",description:"API key for Prometheus/Grafana to scrape the /metrics endpoint. Use with Authorization: Bearer header.",inputType:"secret"},server_log_level:{key:"server_log_level",label:"Log Level",description:"Minimum severity level for log output. Lower levels are more verbose.",inputType:"select",presets:[{label:"Trace (most verbose)",value:"trace"},{label:"Debug",value:"debug"},{label:"Info",value:"info"},{label:"Warn",value:"warn"},{label:"Error (least verbose)",value:"error"}]},server_log_format:{key:"server_log_format",label:"Log Format",description:"Output format for log messages.",inputType:"select",presets:[{label:"JSON (structured)",value:"json"},{label:"Pretty (human-readable)",value:"pretty"}]},server_environment:{key:"server_environment",label:"Environment",description:"Deployment environment. Affects default behaviors and log verbosity.",inputType:"select",presets:[{label:"Development",value:"development"},{label:"Staging",value:"staging"},{label:"Production",value:"production"}]},privacy_period_secs:{key:"privacy_period_secs",label:"Privacy Period",description:"How long deposits are held before withdrawal to provide timing privacy. Longer periods provide better privacy but delay user access to funds.",inputType:"duration",min:0,presets:[{label:"Disabled",value:"0"},{label:"1 hour",value:"3600"},{label:"6 hours",value:"21600"},{label:"24 hours",value:"86400"},{label:"7 days",value:"604800"},{label:"14 days",value:"1209600"},{label:"30 days",value:"2592000"}],warningThreshold:{below:3600,message:"Very short privacy periods may not provide adequate timing protection."}},treasury_wallet_address:{key:"treasury_wallet_address",label:"Treasury Wallet Address",description:"Solana wallet address where funds are sent. Used for privacy cash withdrawals, micro payment batches, and direct payments.",inputType:"text",placeholder:"e.g., 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"},withdrawal_poll_interval_secs:{key:"withdrawal_poll_interval_secs",label:"Worker Poll Interval",description:"How often the withdrawal worker checks for deposits ready to process. Lower values process faster but increase server load.",inputType:"duration",min:60,presets:[{label:"1 minute",value:"60"},{label:"5 minutes",value:"300"},{label:"15 minutes",value:"900"},{label:"1 hour",value:"3600"},{label:"6 hours",value:"21600"}],warningThreshold:{below:60,message:"Polling more than once per minute may cause excessive load."}},withdrawal_batch_size:{key:"withdrawal_batch_size",label:"Batch Size",description:"Maximum number of withdrawals to process in a single batch. Higher values improve throughput but may cause timeouts.",inputType:"select",min:1,max:100,presets:[{label:"1 (Sequential)",value:"1"},{label:"5",value:"5"},{label:"10 (Recommended)",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100 (Max)",value:"100"}]},withdrawal_timeout_secs:{key:"withdrawal_timeout_secs",label:"Transaction Timeout",description:"How long to wait for a withdrawal transaction to confirm before considering it failed.",inputType:"duration",min:30,presets:[{label:"30 seconds",value:"30"},{label:"1 minute",value:"60"},{label:"2 minutes",value:"120"},{label:"5 minutes",value:"300"}],warningThreshold:{below:30,message:"Very short timeouts may cause premature failure on slow networks."}},withdrawal_max_retries:{key:"withdrawal_max_retries",label:"Max Retries",description:"Number of times to retry a failed withdrawal before marking it as permanently failed.",inputType:"select",min:0,max:10,presets:[{label:"0 (No retries)",value:"0"},{label:"1",value:"1"},{label:"3 (Recommended)",value:"3"},{label:"5",value:"5"},{label:"10",value:"10"}]},withdrawal_percentage:{key:"withdrawal_percentage",label:"Withdrawal Percentage",description:"Percentage of ready funds to withdraw each cycle. Lower values spread withdrawals over time for better privacy.",inputType:"percentage",min:1,max:100,step:5,presets:[{label:"25%",value:"25"},{label:"50%",value:"50"},{label:"75%",value:"75"},{label:"100% (All at once)",value:"100"}],warningThreshold:{above:75,message:"High percentages may reduce timing privacy by processing most withdrawals together."}},partial_withdrawal_count:{key:"partial_withdrawal_count",label:"Partial Withdrawals",description:"Maximum partial withdrawals per batch. Partial withdrawals add noise to timing analysis. Set to 0 to disable.",inputType:"select",min:0,presets:[{label:"Disabled",value:"0"},{label:"1",value:"1"},{label:"3",value:"3"},{label:"5",value:"5"},{label:"10",value:"10"}]},partial_withdrawal_min_lamports:{key:"partial_withdrawal_min_lamports",label:"Min Balance for Partial",description:"Minimum account balance (in lamports) required before partial withdrawals are considered. 1 SOL = 1,000,000,000 lamports.",inputType:"select",min:0,presets:[{label:"0.1 SOL",value:"100000000"},{label:"0.5 SOL",value:"500000000"},{label:"1 SOL",value:"1000000000"},{label:"5 SOL",value:"5000000000"},{label:"10 SOL",value:"10000000000"}]},rate_limit_auth:{key:"rate_limit_auth",label:"Auth Request Limit",description:"Maximum authentication attempts (login, register, password reset) per IP per window. Protects against brute force attacks.",inputType:"select",min:1,unit:"requests",presets:[{label:"5 (Strict)",value:"5"},{label:"10 (Recommended)",value:"10"},{label:"20",value:"20"},{label:"50 (Permissive)",value:"50"}],warningThreshold:{above:20,message:"High auth limits may allow brute force attempts."}},rate_limit_general:{key:"rate_limit_general",label:"General Request Limit",description:"Maximum general API requests per IP per window. Affects all non-auth endpoints.",inputType:"select",min:1,unit:"requests",presets:[{label:"30",value:"30"},{label:"60 (Recommended)",value:"60"},{label:"120",value:"120"},{label:"300",value:"300"}]},rate_limit_credit:{key:"rate_limit_credit",label:"Credit Request Limit",description:"Maximum credit/balance check requests per IP per window. Higher for apps that poll balance frequently.",inputType:"select",min:1,unit:"requests",presets:[{label:"10",value:"10"},{label:"30 (Recommended)",value:"30"},{label:"60",value:"60"},{label:"120",value:"120"}]},rate_limit_window:{key:"rate_limit_window",label:"Rate Limit Window",description:'Time window for rate limiting. All limits above are "per window". Shorter windows are stricter.',inputType:"duration",min:1,presets:[{label:"30 seconds",value:"30"},{label:"1 minute",value:"60"},{label:"5 minutes",value:"300"},{label:"15 minutes",value:"900"}]},solana_rpc_url:{key:"solana_rpc_url",label:"Solana RPC URL",description:'Get a fast RPC endpoint from <a href="https://helius.dev" target="_blank" rel="noopener">Helius</a> or <a href="https://quicknode.com" target="_blank" rel="noopener">QuickNode</a>.',inputType:"text",placeholder:"https://api.mainnet-beta.solana.com"},solana_network:{key:"solana_network",label:"Solana Network",description:"The Solana network to use for deposits and withdrawals.",inputType:"select",presets:[{label:"Mainnet",value:"mainnet-beta"},{label:"Devnet",value:"devnet"}]},deposit_privacy_enabled:{key:"deposit_privacy_enabled",label:"Enable Private Deposits",description:"When enabled, deposits are held for a privacy period before withdrawal. Provides timing privacy but delays fund availability.",inputType:"boolean"},deposit_company_token:{key:"deposit_company_token",label:"Platform Token",description:"The token that represents platform credits. Deposits are converted to this token. Common choices: USDC, SOL.",inputType:"select",presets:[{label:"USDC",value:"USDC"},{label:"USDT",value:"USDT"},{label:"SOL",value:"SOL"},{label:"EURC",value:"EURC"}]},deposit_micro_enabled:{key:"deposit_micro_enabled",label:"SOL Micro Payments",description:"Allow small SOL deposits (under $10) that are batched together for efficiency.",inputType:"boolean"},deposit_gasless_swap_enabled:{key:"deposit_gasless_swap_enabled",label:"Gasless Swap Payments",description:"Allow deposits via Jupiter swaps.",inputType:"boolean"},deposit_min_usd:{key:"deposit_min_usd",label:"Minimum Deposit",description:"Minimum deposit amount in USD equivalent.",inputType:"select",unit:"USD",presets:[{label:"$1",value:"1"},{label:"$5",value:"5"},{label:"$10",value:"10"},{label:"$25",value:"25"}]},deposit_max_usd:{key:"deposit_max_usd",label:"Maximum Deposit",description:"Maximum deposit amount per transaction in USD equivalent. Set to 0 for unlimited.",inputType:"select",unit:"USD",presets:[{label:"Unlimited",value:"0"},{label:"$1,000",value:"1000"},{label:"$10,000",value:"10000"},{label:"$100,000",value:"100000"}]},deposit_show_explainer:{key:"deposit_show_explainer",label:"Show Explainer Screen",description:"Show the introductory explainer screen at the start of the deposit flow.",inputType:"boolean"},deposit_quick_action_tokens:{key:"deposit_quick_action_tokens",label:"Quick Action Tokens",description:"Comma-separated token symbols shown as quick action buttons. First token is the default.",inputType:"tokenSymbolList"},deposit_custom_tokens:{key:"deposit_custom_tokens",label:"Custom Dropdown Tokens",description:'Comma-separated token symbols shown in the "Custom" dropdown. Leave empty to show all.',inputType:"tokenSymbolList"},deposit_custom_tokens_json:{key:"deposit_custom_tokens_json",label:"Custom Token Definitions",description:"Add tokens beyond the built-in list. Define symbol, mint address, decimals, and logo URL.",inputType:"tokenList"},deposit_fee_policy:{key:"deposit_fee_policy",label:"Fee Policy",description:"Who pays deposit fees: company absorbs all, or user pays swap/privacy/all fees.",inputType:"select",presets:[{label:"Company Pays All",value:"company_pays_all"},{label:"User Pays Swap Fees",value:"user_pays_swap"},{label:"User Pays Privacy Fees",value:"user_pays_privacy"},{label:"User Pays All Fees",value:"user_pays_all"}]},privacy_fee_fixed_lamports:{key:"privacy_fee_fixed_lamports",label:"Privacy Fixed Fee",description:"Fixed fee for Privacy Cash deposits in lamports. 1 SOL = 1,000,000,000 lamports.",inputType:"select",unit:"lamports",presets:[{label:"0 SOL",value:"0"},{label:"0.001 SOL",value:"1000000"},{label:"0.005 SOL",value:"5000000"},{label:"0.006 SOL (Default)",value:"6000000"},{label:"0.01 SOL",value:"10000000"}]},privacy_fee_percent_bps:{key:"privacy_fee_percent_bps",label:"Privacy Percentage Fee",description:"Percentage fee for Privacy Cash deposits in basis points. 100 bps = 1%.",inputType:"select",unit:"bps",presets:[{label:"0%",value:"0"},{label:"0.25%",value:"25"},{label:"0.35% (Default)",value:"35"},{label:"0.5%",value:"50"},{label:"1%",value:"100"}]},swap_fee_fixed_lamports:{key:"swap_fee_fixed_lamports",label:"Swap Fixed Fee",description:"Fixed fee for Jupiter swaps in lamports. Covers transaction costs.",inputType:"select",unit:"lamports",presets:[{label:"0 SOL",value:"0"},{label:"0.001 SOL (Default)",value:"1000000"},{label:"0.002 SOL",value:"2000000"},{label:"0.005 SOL",value:"5000000"}]},swap_fee_percent_bps:{key:"swap_fee_percent_bps",label:"Swap Percentage Fee",description:"Percentage fee for Jupiter swaps in basis points. 100 bps = 1%.",inputType:"select",unit:"bps",presets:[{label:"0%",value:"0"},{label:"0.1% (Default)",value:"10"},{label:"0.25%",value:"25"},{label:"0.5%",value:"50"}]},company_fee_fixed_lamports:{key:"company_fee_fixed_lamports",label:"Company Fixed Fee",description:"Additional fixed processing fee in lamports. Set to 0 to disable.",inputType:"select",unit:"lamports",presets:[{label:"Disabled",value:"0"},{label:"0.001 SOL",value:"1000000"},{label:"0.005 SOL",value:"5000000"},{label:"0.01 SOL",value:"10000000"}]},company_fee_percent_bps:{key:"company_fee_percent_bps",label:"Company Percentage Fee",description:"Additional percentage processing fee in basis points. 100 bps = 1%.",inputType:"select",unit:"bps",presets:[{label:"Disabled",value:"0"},{label:"0.1%",value:"10"},{label:"0.25%",value:"25"},{label:"0.5%",value:"50"},{label:"1%",value:"100"}]},micro_batch_threshold_usd:{key:"micro_batch_threshold_usd",label:"Batch Threshold",description:"Minimum accumulated USD value before triggering a batch swap. Jupiter requires ~$10 minimum.",inputType:"select",unit:"USD",presets:[{label:"$10 (Minimum)",value:"10"},{label:"$25",value:"25"},{label:"$50",value:"50"},{label:"$100",value:"100"}]},micro_batch_poll_secs:{key:"micro_batch_poll_secs",label:"Batch Poll Interval",description:"How often to check for batchable micro deposits. Lower values process faster but increase load.",inputType:"duration",min:60,presets:[{label:"1 minute",value:"60"},{label:"5 minutes (Default)",value:"300"},{label:"15 minutes",value:"900"},{label:"1 hour",value:"3600"}]},private_deposit_min_lamports:{key:"private_deposit_min_lamports",label:"Min Private Deposit",description:"Minimum amount for Privacy Cash deposits in lamports. Smaller deposits use micro batching.",inputType:"select",unit:"lamports",presets:[{label:"0.1 SOL",value:"100000000"},{label:"0.25 SOL (Default)",value:"250000000"},{label:"0.5 SOL",value:"500000000"},{label:"1 SOL",value:"1000000000"}]},withdrawal_min_lamports:{key:"withdrawal_min_lamports",label:"Min Withdrawal Amount",description:"Minimum amount to withdraw in lamports. Deposits below this remain pending. Fees are ~0.006 SOL + 0.35% + Jupiter.",inputType:"select",unit:"lamports",presets:[{label:"0.5 SOL",value:"500000000"},{label:"1 SOL (Default)",value:"1000000000"},{label:"2 SOL",value:"2000000000"},{label:"5 SOL",value:"5000000000"}],warningThreshold:{below:5e8,message:"Very small withdrawals may lose significant value to fees."}},sidecar_api_key:{key:"sidecar_api_key",label:"Sidecar API Key",description:"Authenticates requests from cedros-login to the login-sidecar. This value must also be set as the SIDECAR_API_KEY environment variable on the sidecar container.",inputType:"readonlySecret"},note_encryption_key:{key:"note_encryption_key",label:"Note Encryption Key",description:"AES-256 key for encrypting privacy cash notes (base64). This value must also be set as the NOTE_ENCRYPTION_KEY environment variable on the sidecar container.",inputType:"readonlySecret"},postlogin_redirect_url:{key:"postlogin_redirect_url",label:"Redirect URL",description:"URL to redirect to after login. Leave empty for default behavior (consumer app decides).",inputType:"text",placeholder:"https://example.com/dashboard"},postlogin_welcome_enabled:{key:"postlogin_welcome_enabled",label:"Enable Welcome Page",description:"Show a one-time welcome/onboarding page to new users after their first login.",inputType:"boolean"},postlogin_welcome_route:{key:"postlogin_welcome_route",label:"Welcome Route",description:"Route for the welcome/onboarding page.",inputType:"text",placeholder:"/welcome"},postlogin_complete_enabled:{key:"postlogin_complete_enabled",label:"Prompt Profile Completion",description:"Prompt users to fill in missing name or email after login. Shows every login until the user completes or skips.",inputType:"boolean"},postlogin_username_enabled:{key:"postlogin_username_enabled",label:"Require Username Selection",description:"Prompt new users to choose a unique handle-style username (e.g. @swift_falcon_42) after signup. Shows until the user picks a username or skips.",inputType:"boolean"},postlogin_wallet_enroll_enabled:{key:"postlogin_wallet_enroll_enabled",label:"Prompt Wallet Enrollment",description:"Prompt users to enroll an embedded wallet after signup. Requires the Embedded Wallet feature to be enabled.",inputType:"boolean"},wallet_enroll_solana_users:{key:"wallet_enroll_solana_users",label:"Enroll Solana Wallet Users",description:"Also prompt Solana wallet users to enroll an embedded wallet. By default they are skipped since they already have a wallet.",inputType:"boolean"},postlogin_show_recovery_enabled:{key:"postlogin_show_recovery_enabled",label:"Show Recovery Info",description:"Show wallet recovery information screen after account creation. Displays recovery phrase based on the configured recovery mode.",inputType:"boolean"},image_storage_enabled:{key:"image_storage_enabled",label:"Enable Image Storage",description:"Enable S3-compatible object storage for user avatar uploads. When disabled, users cannot upload profile pictures.",inputType:"boolean"},image_storage_provider:{key:"image_storage_provider",label:"Storage Provider",description:"Select your S3-compatible storage provider to auto-fill endpoint and region hints.",inputType:"select",presets:[{label:"DigitalOcean Spaces",value:"digitalocean"},{label:"AWS S3",value:"s3"},{label:"Custom S3-Compatible",value:"custom"}]},image_storage_bucket:{key:"image_storage_bucket",label:"Bucket Name",description:"The name of your S3 bucket or DigitalOcean Space.",inputType:"text",placeholder:"my-app-avatars"},image_storage_region:{key:"image_storage_region",label:"Region",description:"AWS region or DigitalOcean datacenter (e.g., us-east-1, nyc3, ams3).",inputType:"text",placeholder:"us-east-1"},image_storage_endpoint:{key:"image_storage_endpoint",label:"Endpoint URL",description:"S3-compatible endpoint URL. For DigitalOcean Spaces: https://{region}.digitaloceanspaces.com. Leave empty for AWS S3.",inputType:"text",placeholder:"https://nyc3.digitaloceanspaces.com"},image_storage_access_key:{key:"image_storage_access_key",label:"Access Key",description:"S3 access key ID or DigitalOcean Spaces access key.",inputType:"secret"},image_storage_secret_key:{key:"image_storage_secret_key",label:"Secret Key",description:"S3 secret access key or DigitalOcean Spaces secret key.",inputType:"secret"},image_storage_cdn_url:{key:"image_storage_cdn_url",label:"CDN URL (optional)",description:"Custom CDN URL prefix for serving images (e.g., https://cdn.example.com). If empty, images are served directly from the bucket URL.",inputType:"text",placeholder:"https://cdn.example.com"},kyc_enabled:{key:"kyc_enabled",label:"Enable KYC Verification",description:"Enable identity verification for users via Stripe Identity.",inputType:"boolean"},kyc_provider:{key:"kyc_provider",label:"KYC Provider",description:"Identity verification provider.",inputType:"select",presets:[{label:"Stripe Identity",value:"stripe"}]},kyc_api_secret_key:{key:"kyc_api_secret_key",label:"Stripe Secret Key",description:"Stripe API secret key for Identity API calls (sk_live_... or sk_test_...).",inputType:"secret",placeholder:"sk_..."},kyc_webhook_secret:{key:"kyc_webhook_secret",label:"Webhook Signing Secret",description:"Stripe webhook endpoint secret for verifying webhook signatures (whsec_...).",inputType:"secret",placeholder:"whsec_..."},kyc_enforcement_mode:{key:"kyc_enforcement_mode",label:"Enforcement Mode",description:'When to require KYC verification. "None" disables enforcement. "Optional" lets users verify voluntarily.',inputType:"select",presets:[{label:"None (disabled)",value:"none"},{label:"Withdrawals only",value:"withdrawals"},{label:"Deposits only",value:"deposits"},{label:"All financial operations",value:"all"},{label:"Optional (user choice)",value:"optional"}]},kyc_expiry_days:{key:"kyc_expiry_days",label:"Verification Expiry",description:"How long a verification remains valid. Set to 0 for no expiry.",inputType:"select",presets:[{label:"Never expires",value:"0"},{label:"90 days",value:"90"},{label:"365 days",value:"365"}]},kyc_redirect_url:{key:"kyc_redirect_url",label:"Return URL",description:"URL where users are redirected after completing Stripe Identity verification.",inputType:"text",placeholder:"https://app.example.com/kyc/callback"},kyc_document_types:{key:"kyc_document_types",label:"Accepted Document Types",description:"Comma-separated list of accepted document types: driving_license, id_card, passport.",inputType:"text",placeholder:"driving_license,id_card,passport"},kyc_require_selfie:{key:"kyc_require_selfie",label:"Require Selfie",description:"Require a selfie photo that matches the document photo for identity verification.",inputType:"boolean"},kyc_cumulative_deposit_usd:{key:"kyc_cumulative_deposit_usd",label:"Cumulative Deposit Threshold (USD)",description:"Require KYC when a user's total deposits exceed this USD amount. Set to 0 to disable. Works independently of enforcement mode.",inputType:"text",placeholder:"0",unit:"USD"},kyc_single_deposit_usd:{key:"kyc_single_deposit_usd",label:"Single Deposit Threshold (USD)",description:"Require KYC when any individual deposit exceeds this USD amount. Set to 0 to disable. Works independently of enforcement mode.",inputType:"text",placeholder:"0",unit:"USD"},kyc_single_purchase_usd:{key:"kyc_single_purchase_usd",label:"Single Purchase Threshold (USD)",description:"Require KYC when any individual credit spend/purchase exceeds this USD amount. Set to 0 to disable. Works independently of enforcement mode.",inputType:"text",placeholder:"0",unit:"USD"},sanctions_enabled:{key:"sanctions_enabled",label:"Enable Sanctions Screening",description:"Block transactions to or from wallet addresses that appear on the sanctions list fetched from the configured API URL.",inputType:"boolean"},sanctions_api_url:{key:"sanctions_api_url",label:"Sanctions API URL",description:"Base URL for the sanctions list API (e.g. <code>https://sunscreen.cedros.io</code>). The service calls <code>GET {url}/v1/lists</code>.",inputType:"text",placeholder:"https://sunscreen.cedros.io"},sanctions_refresh_interval_secs:{key:"sanctions_refresh_interval_secs",label:"Refresh Interval",description:"How often to re-fetch the sanctions list. Minimum 60 seconds.",inputType:"text",unit:"seconds",placeholder:"3600"},sanctions_geoip_header:{key:"sanctions_geoip_header",label:"GeoIP Country Header",description:"HTTP header containing the client's ISO country code. Common values: <code>CF-IPCountry</code> (Cloudflare), <code>X-Vercel-IP-Country</code> (Vercel). Leave empty to disable country screening.",inputType:"text",placeholder:"CF-IPCountry"},accreditation_enabled:{key:"accreditation_enabled",label:"Enable Accreditation Verification",description:"Enable accredited investor self-service verification.",inputType:"boolean"},accreditation_enforcement_mode:{key:"accreditation_enforcement_mode",label:"Enforcement Mode",description:"When to require accreditation.",inputType:"select",presets:[{label:"None (disabled)",value:"none"},{label:"Optional (user choice)",value:"optional"},{label:"Required",value:"required"}]},accreditation_default_expiry_days_income:{key:"accreditation_default_expiry_days_income",label:"Income/Net Worth Expiry",description:"Default validity for income and net worth verifications.",inputType:"text",unit:"days",placeholder:"365"},accreditation_default_expiry_days_letter:{key:"accreditation_default_expiry_days_letter",label:"Letter Expiry",description:"Default validity for third-party verification letters.",inputType:"text",unit:"days",placeholder:"90"},accreditation_default_expiry_days_credential:{key:"accreditation_default_expiry_days_credential",label:"Credential Expiry",description:"Default validity for FINRA credential verifications.",inputType:"text",unit:"days",placeholder:"365"},accreditation_max_upload_size_mb:{key:"accreditation_max_upload_size_mb",label:"Max Upload Size",description:"Maximum file size per document upload.",inputType:"text",unit:"MB",placeholder:"10"},accreditation_income_threshold_individual:{key:"accreditation_income_threshold_individual",label:"Income Threshold (Individual)",description:"Annual income threshold for individual accreditation (USD).",inputType:"text",unit:"USD",placeholder:"200000"},accreditation_income_threshold_joint:{key:"accreditation_income_threshold_joint",label:"Income Threshold (Joint)",description:"Annual income threshold for joint accreditation (USD).",inputType:"text",unit:"USD",placeholder:"300000"},accreditation_net_worth_threshold:{key:"accreditation_net_worth_threshold",label:"Net Worth Threshold",description:"Net worth threshold excluding primary residence (USD).",inputType:"text",unit:"USD",placeholder:"1000000"},accreditation_investment_threshold_individual:{key:"accreditation_investment_threshold_individual",label:"Investment Threshold (Individual)",description:"Minimum investment commitment for individual simplified verification (USD).",inputType:"text",unit:"USD",placeholder:"200000"},accreditation_investment_threshold_entity:{key:"accreditation_investment_threshold_entity",label:"Investment Threshold (Entity)",description:"Minimum investment commitment for entity simplified verification (USD).",inputType:"text",unit:"USD",placeholder:"1000000"},token_gating_enabled:{key:"token_gating_enabled",label:"Enable Token Gating",description:"Require Solana wallet holdings for access.",inputType:"boolean"},token_gating_rpc_url:{key:"token_gating_rpc_url",label:"Solana RPC/DAS URL",description:"RPC endpoint that supports DAS API for NFT queries.",inputType:"secret",placeholder:"https://mainnet.helius-rpc.com/?api-key=..."},token_gating_rules:{key:"token_gating_rules",label:"Token Gate Rules",description:"JSON array of gate rules. Managed via admin API.",inputType:"text",multiline:!0,placeholder:"[]"},token_gating_cache_ttl_secs:{key:"token_gating_cache_ttl_secs",label:"Cache TTL",description:"How long to cache wallet holdings (seconds).",inputType:"text",unit:"seconds",placeholder:"60"}},E={"auth.apple":{label:"Apple Sign-In",description:"Configure Sign in with Apple OAuth integration.",icon:""},"auth.email":{label:"Email Authentication",description:"Configure email/password authentication settings.",icon:""},"auth.google":{label:"Google Sign-In",description:"Configure Google OAuth integration.",icon:""},"auth.solana":{label:"Solana Wallet Auth",description:"Configure Solana wallet signature authentication.",icon:""},"auth.webauthn":{label:"WebAuthn / Passkeys",description:"Configure FIDO2/WebAuthn passwordless authentication.",icon:""},"auth.instantlink":{label:"Instant Link",description:'Passwordless sign-in via email link. Replaces "Forgot your password?" with a one-time login link instead of a password reset.',icon:""},"deposit.general":{label:"General",description:"Core deposit and credit system configuration.",icon:""},postlogin:{label:"Post-Login",description:"Configure what happens after a user logs in.",icon:""},"postlogin.welcome":{label:"Welcome Page",description:"One-time onboarding page shown to new users after first login.",icon:""},"postlogin.complete":{label:"Profile Completion",description:"Prompt users to fill in missing profile information.",icon:""},"postlogin.username":{label:"Username Selection",description:"Prompt users to choose a unique handle-style username.",icon:""},"postlogin.wallet":{label:"Wallet Enrollment",description:"Prompt users to enroll an embedded wallet after signup.",icon:""},deposit:{label:"Deposit Settings",description:"Configure deposit tokens, fees, and related settings.",icon:""},email:{label:"Email / SMTP",description:"Configure outbound email delivery for verification, password reset, and notifications.",icon:""},features:{label:"Feature Flags",description:"Enable or disable major platform features.",icon:""},privacy:{label:"Privacy Settings",description:"Control the privacy period for deposits. Longer periods provide better timing privacy but delay fund availability.",icon:""},referral:{label:"Referral & Payouts",description:"Configure referral rewards, payout triggers, and the automated payout worker.",icon:""},rate_limit:{label:"Rate Limiting",description:"Protect the system from abuse by limiting request rates. Balance security with user experience.",icon:""},security:{label:"Security",description:"Configure CORS, cookies, sessions, and JWT settings.",icon:""},server:{label:"Server",description:"Server infrastructure settings. Some may be overridden by environment variables.",icon:""},webhook:{label:"Webhooks",description:"Configure HTTP webhook notifications for auth events.",icon:""},withdrawal:{label:"Withdrawal Worker",description:"Configure how the automated withdrawal processor handles pending withdrawals. These settings affect throughput and privacy.",icon:""},image_storage:{label:"Image Storage",description:"Configure S3-compatible object storage for user avatars and images.",icon:""},kyc:{label:"KYC / Identity Verification",description:"Configure identity verification requirements using Stripe Identity.",icon:""},sanctions:{label:"Sanctions Screening",description:"Block transactions involving wallet addresses on OFAC or custom sanctions lists.",icon:""},accreditation:{label:"Accredited Investor Verification",description:"Configure accredited investor verification requirements and thresholds per SEC Regulation D.",icon:""},token_gating:{label:"Token Gating",description:"Configure Solana wallet holdings requirements for gated access.",icon:""}},P=["SOL","USDC","USDT","EURC","USD1","PYUSD","USDH","CASH","BONK","ORE"];function x(t){const s=t.split(/(<a\s[^>]*>.*?<\/a>)/g);return s.length===1?t:s.map((a,l)=>{const i=a.match(/^<a\s+href="([^"]+)"[^>]*>([^<]+)<\/a>$/);return i?e.jsx("a",{href:i[1],target:"_blank",rel:"noopener noreferrer",children:i[2]},l):a})}function I({settings:t,edits:s,onChange:a,externalWarnings:l}){return e.jsx("div",{className:"cedros-settings-grid",children:t.map(i=>e.jsx(U,{setting:i,editValue:s[i.key],onChange:a,externalWarning:l?.[i.key]},i.key))})}function U({setting:t,editValue:s,onChange:a,externalWarning:l}){const i=j[t.key],r=s??t.value,p=s!==void 0&&s!==t.value,n=i?.inputType==="boolean",o=d.useMemo(()=>{if(l)return l;if(!i?.warningThreshold)return null;const c=parseInt(r,10);if(isNaN(c))return null;const{above:m,below:y,message:h}=i.warningThreshold;return m!==void 0&&c>m||y!==void 0&&c<y?h:null},[r,i?.warningThreshold,l]);return i?e.jsx("div",{className:`cedros-setting-row ${p?"cedros-setting-row-changed":""} ${o?"cedros-setting-row-warning":""} ${n?"cedros-setting-row-toggle":""}`,children:n?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"cedros-setting-control cedros-setting-control-toggle",children:[e.jsx(C,{meta:i,value:r,onChange:c=>a(t.key,c)}),o&&e.jsx("div",{className:"cedros-setting-warning",children:o})]}),e.jsxs("div",{className:"cedros-setting-label",children:[e.jsx("span",{className:"cedros-setting-name",children:i.label}),e.jsx("span",{className:"cedros-setting-description",children:x(i.description)})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"cedros-setting-label",children:[e.jsx("span",{className:"cedros-setting-name",children:i.label}),e.jsx("span",{className:"cedros-setting-description",children:x(i.description)})]}),e.jsxs("div",{className:"cedros-setting-control",children:[e.jsx(C,{meta:i,value:r,onChange:c=>a(t.key,c)}),o&&e.jsx("div",{className:"cedros-setting-warning",children:o})]})]})}):e.jsxs("div",{className:`cedros-setting-row ${p?"cedros-setting-row-changed":""}`,children:[e.jsxs("div",{className:"cedros-setting-label",children:[e.jsx("span",{className:"cedros-setting-name",children:t.key}),t.description&&e.jsx("span",{className:"cedros-setting-description",children:t.description})]}),e.jsx("div",{className:"cedros-setting-input-wrapper",children:e.jsx("input",{type:"text",value:r,onChange:c=>a(t.key,c.target.value),className:"cedros-setting-input"})})]})}function C({meta:t,value:s,onChange:a}){switch(t.inputType){case"duration":return e.jsx(O,{value:s,onChange:a,presets:t.presets,min:t.min});case"percentage":return e.jsx(M,{value:s,onChange:a,min:t.min??1,max:t.max??100,step:t.step??5,presets:t.presets});case"select":return e.jsx(q,{value:s,onChange:a,presets:t.presets??[],unit:t.unit});case"number":return e.jsx(W,{value:s,onChange:a,min:t.min,max:t.max,unit:t.unit});case"tokenList":return e.jsx(B,{value:s,onChange:a});case"text":return e.jsx("input",{type:"text",value:s,onChange:l=>a(l.target.value),className:"cedros-setting-input",placeholder:t.label});case"boolean":return e.jsx(F,{value:s,onChange:a});case"secret":return e.jsx($,{value:s,onChange:a,multiline:t.multiline});case"readonlySecret":return e.jsx(V,{settingKey:t.key,value:s});case"tokenSymbolList":return e.jsx(G,{value:s,onChange:a});default:return e.jsx("input",{type:"text",value:s,onChange:l=>a(l.target.value),className:"cedros-setting-input"})}}function O({value:t,onChange:s,presets:a,min:l=0}){const i=parseInt(t,10)||0,r=L(i),p=d.useCallback(o=>{o.target.value&&s(o.target.value)},[s]),n=d.useCallback(o=>{const c=Math.max(l,parseInt(o.target.value,10)||0);s(String(c))},[s,l]);return e.jsxs("div",{className:"cedros-duration-input",children:[a&&a.length>0&&e.jsxs("select",{value:a.find(o=>o.value===t)?.value??"",onChange:p,className:"cedros-setting-select",children:[e.jsx("option",{value:"",children:"Custom..."}),a.map(o=>e.jsx("option",{value:o.value,children:o.label},o.value))]}),e.jsxs("div",{className:"cedros-duration-custom",children:[e.jsx("input",{type:"number",value:i,onChange:n,min:l,className:"cedros-setting-input cedros-setting-input-sm"}),e.jsx("span",{className:"cedros-setting-unit",children:"seconds"}),e.jsxs("span",{className:"cedros-duration-display",children:["= ",r]})]})]})}function M({value:t,onChange:s,min:a,max:l,step:i,presets:r}){const p=parseInt(t,10)||a,n=d.useCallback(c=>{s(c.target.value)},[s]),o=d.useCallback(c=>{s(c)},[s]);return e.jsxs("div",{className:"cedros-percentage-input",children:[e.jsxs("div",{className:"cedros-percentage-slider-row",children:[e.jsx("input",{type:"range",value:p,onChange:n,min:a,max:l,step:i,className:"cedros-percentage-slider"}),e.jsxs("span",{className:"cedros-percentage-value",children:[p,"%"]})]}),r&&r.length>0&&e.jsx("div",{className:"cedros-preset-buttons",children:r.map(c=>e.jsx("button",{type:"button",className:`cedros-preset-button ${c.value===t?"cedros-preset-button-active":""}`,onClick:()=>o(c.value),children:c.label},c.value))})]})}function q({value:t,onChange:s,presets:a,unit:l}){const i=!a.some(n=>n.value===t),r=d.useCallback(n=>{n.target.value!=="__custom__"&&s(n.target.value)},[s]),p=d.useCallback(n=>{s(n.target.value)},[s]);return e.jsxs("div",{className:"cedros-select-input",children:[e.jsxs("select",{value:i?"__custom__":t,onChange:r,className:"cedros-setting-select",children:[a.map(n=>e.jsx("option",{value:n.value,children:n.label},n.value)),e.jsx("option",{value:"__custom__",children:"Custom..."})]}),i&&e.jsxs("div",{className:"cedros-select-custom",children:[e.jsx("input",{type:"number",value:t,onChange:p,className:"cedros-setting-input cedros-setting-input-sm"}),l&&e.jsx("span",{className:"cedros-setting-unit",children:l})]})]})}function W({value:t,onChange:s,min:a,max:l,unit:i}){const r=d.useCallback(p=>{s(p.target.value)},[s]);return e.jsxs("div",{className:"cedros-number-input",children:[e.jsx("input",{type:"number",value:t,onChange:r,min:a,max:l,className:"cedros-setting-input"}),i&&e.jsx("span",{className:"cedros-setting-unit",children:i})]})}function F({value:t,onChange:s}){const a=t==="true",l=d.useCallback(()=>{s(a?"false":"true")},[a,s]);return e.jsxs("button",{type:"button",role:"switch","aria-checked":a,className:`cedros-toggle ${a?"cedros-toggle-on":"cedros-toggle-off"}`,onClick:l,children:[e.jsx("span",{className:"cedros-toggle-track",children:e.jsx("span",{className:"cedros-toggle-thumb"})}),e.jsx("span",{className:"cedros-toggle-label",children:a?"Enabled":"Disabled"})]})}function $({value:t,onChange:s,multiline:a}){const[l,i]=d.useState(!1),[r,p]=d.useState(!1),n=t&&t.length>0,o=d.useCallback(()=>{i(!0),p(!0)},[]),c=d.useCallback(()=>{i(!1),p(!1)},[]),m=d.useCallback(y=>{s(y.target.value)},[s]);return!l&&n?e.jsxs("div",{className:"cedros-secret-input cedros-secret-input-masked",children:[e.jsx("span",{className:"cedros-secret-masked",children:"•".repeat(Math.min(t.length,20))}),e.jsx("button",{type:"button",className:"cedros-secret-edit-btn",onClick:o,children:"Edit"})]}):e.jsxs("div",{className:"cedros-secret-input",children:[a?e.jsx("textarea",{value:t,onChange:m,className:"cedros-setting-input cedros-setting-textarea",placeholder:"Enter secret value...",rows:4}):e.jsx("input",{type:r?"text":"password",value:t,onChange:m,className:"cedros-setting-input",placeholder:"Enter secret value..."}),e.jsxs("div",{className:"cedros-secret-actions",children:[!a&&e.jsx("button",{type:"button",className:"cedros-secret-toggle-btn",onClick:()=>p(!r),children:r?"Hide":"Show"}),l&&e.jsx("button",{type:"button",className:"cedros-secret-done-btn",onClick:c,children:"Done"})]})]})}function V({settingKey:t,value:s}){const[a,l]=d.useState(null),[i,r]=d.useState(!1),[p,n]=d.useState(!1),[o,c]=d.useState(null),[m,y]=d.useState(!1),{config:h,_internal:f}=A.useCedrosLogin(),_=a??s,w=_&&_.length>0,S=w&&!a,b=d.useCallback(async()=>{if(_)try{await navigator.clipboard.writeText(_),r(!0),setTimeout(()=>r(!1),2e3)}catch{const u=document.createElement("textarea");u.value=_,document.body.appendChild(u),u.select(),document.execCommand("copy"),document.body.removeChild(u),r(!0),setTimeout(()=>r(!1),2e3)}},[_]),v=d.useCallback(async()=>{n(!0),c(null);try{const u=f?.getAccessToken?.(),g={"Content-Type":"application/json"};u&&(g.Authorization=`Bearer ${u}`);const k=await fetch(`${h.serverUrl}/auth/admin/settings/regenerate/${t}`,{method:"POST",headers:g,credentials:"include"});if(!k.ok){const T=await k.json().catch(()=>null);throw new Error(T?.message||T?.error||`Regenerate failed (${k.status})`)}const N=await k.json();l(N.value),y(!1)}catch(u){c(u instanceof Error?u.message:"Failed to regenerate")}finally{n(!1)}},[h.serverUrl,f,t]);return e.jsxs("div",{className:"cedros-readonly-secret",children:[e.jsx("div",{className:"cedros-readonly-secret-value",children:S?e.jsx("span",{className:"cedros-secret-masked",children:"•".repeat(20)}):w?e.jsx("code",{className:"cedros-readonly-secret-code",children:_}):e.jsx("span",{className:"cedros-readonly-secret-empty",children:"Not generated yet"})}),e.jsxs("div",{className:"cedros-readonly-secret-actions",children:[w&&e.jsx("button",{type:"button",className:"cedros-secret-action-btn",onClick:b,children:i?"Copied!":"Copy"}),m?e.jsxs("span",{className:"cedros-readonly-secret-confirm",children:[e.jsx("span",{className:"cedros-readonly-secret-confirm-text",children:"Update deploy secret too?"}),e.jsx("button",{type:"button",className:"cedros-secret-action-btn cedros-secret-action-btn--danger",onClick:v,disabled:p,children:p?"Regenerating...":"Confirm"}),e.jsx("button",{type:"button",className:"cedros-secret-action-btn",onClick:()=>y(!1),disabled:p,children:"Cancel"})]}):e.jsx("button",{type:"button",className:"cedros-secret-action-btn cedros-secret-action-btn--danger",onClick:()=>y(!0),disabled:p,children:"Regenerate"})]}),o&&e.jsx("p",{className:"cedros-readonly-secret-error",children:o})]})}function B({value:t,onChange:s}){const a=d.useMemo(()=>{try{return JSON.parse(t||"[]")}catch{return[]}},[t]),l=d.useCallback(n=>{s(JSON.stringify(n))},[s]),i=d.useCallback(()=>{l([...a,{symbol:"",mint:"",decimals:6}])},[a,l]),r=d.useCallback((n,o,c)=>{const m=[...a];m[n]={...m[n],[o]:c},l(m)},[a,l]),p=d.useCallback(n=>{l(a.filter((o,c)=>c!==n))},[a,l]);return e.jsxs("div",{className:"cedros-token-list-input",children:[e.jsxs("div",{className:"cedros-token-presets",children:[e.jsx("span",{className:"cedros-token-presets-label",children:"Built-in tokens:"}),e.jsx("div",{className:"cedros-token-presets-list",children:P.map(n=>e.jsx("span",{className:"cedros-token-preset-chip",children:n},n))})]}),a.length===0&&e.jsx("p",{className:"cedros-token-list-empty",children:"No custom tokens added. Use the built-in tokens above or add your own."}),a.map((n,o)=>e.jsxs("div",{className:"cedros-token-row",children:[e.jsxs("div",{className:"cedros-token-row-fields",children:[e.jsx("input",{type:"text",placeholder:"Symbol",value:n.symbol,onChange:c=>r(o,"symbol",c.target.value.toUpperCase()),className:"cedros-setting-input cedros-token-input-symbol",maxLength:10}),e.jsx("input",{type:"text",placeholder:"Mint address",value:n.mint,onChange:c=>r(o,"mint",c.target.value),className:"cedros-setting-input cedros-token-input-mint"}),e.jsx("input",{type:"number",placeholder:"Decimals",value:n.decimals,onChange:c=>r(o,"decimals",parseInt(c.target.value,10)||0),className:"cedros-setting-input cedros-token-input-decimals",min:0,max:18}),e.jsx("input",{type:"text",placeholder:"Logo URL (optional)",value:n.logoUrl||"",onChange:c=>r(o,"logoUrl",c.target.value||void 0),className:"cedros-setting-input cedros-token-input-logo"})]}),e.jsx("button",{type:"button",className:"cedros-token-remove-btn",onClick:()=>p(o),title:"Remove token",children:"×"})]},o)),e.jsx("button",{type:"button",className:"cedros-token-add-btn",onClick:i,children:"+ Add Token"})]})}function G({value:t,onChange:s}){const a=d.useMemo(()=>t.split(",").map(r=>r.trim()).filter(Boolean),[t]),l=d.useCallback(r=>{if(!r||a.includes(r))return;const p=[...a,r].join(", ");s(p)},[a,s]),i=d.useCallback(r=>{const p=a.filter(n=>n!==r).join(", ");s(p)},[a,s]);return e.jsxs("div",{className:"cedros-token-symbol-list-input",children:[e.jsxs("div",{className:"cedros-token-presets",children:[e.jsx("span",{className:"cedros-token-presets-label",children:"Click to add:"}),e.jsx("div",{className:"cedros-token-presets-list",children:P.map(r=>{const p=a.includes(r);return e.jsxs("button",{type:"button",className:`cedros-token-preset-chip ${p?"cedros-token-preset-chip-selected":""}`,onClick:()=>p?i(r):l(r),title:p?`Remove ${r}`:`Add ${r}`,children:[r,p&&e.jsx("span",{className:"cedros-token-chip-check",children:"✓"})]},r)})})]}),e.jsx("input",{type:"text",value:t,onChange:r=>s(r.target.value),className:"cedros-setting-input",placeholder:"USDC, SOL, BONK..."})]})}const H=800,K=2e3;function J(){const{settings:t,isLoading:s,error:a,fetchSettings:l,updateSettings:i}=D.useSystemSettings(),[r,p]=d.useState({}),[n,o]=d.useState("idle"),[c,m]=d.useState(null),y=d.useRef(null),h=d.useRef(null),f=d.useRef({});d.useEffect(()=>()=>{y.current&&clearTimeout(y.current),h.current&&clearTimeout(h.current)},[]);const _=d.useCallback(async()=>{const b={...f.current};if(Object.keys(b).length===0){o("idle");return}o("saving"),m(null);const v=Object.entries(b).map(([u,g])=>({key:u,value:g}));try{await i(v),p(u=>{const g={...u};for(const k of Object.keys(b))delete g[k];return g});for(const u of Object.keys(b))delete f.current[u];o("saved"),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{o("idle")},K)}catch(u){o("error"),m(u instanceof Error?u.message:"Failed to save")}},[i]),w=d.useCallback((b,v)=>{p(u=>({...u,[b]:v})),f.current[b]=v,m(null),o("pending"),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{_()},H)},[_]),S=d.useCallback(b=>{if(r[b]!==void 0)return r[b];for(const v of Object.values(t)){const u=v.find(g=>g.key===b);if(u)return u.value}return""},[r,t]);return{settings:t,edits:r,isLoading:s,autosaveStatus:n,autosaveError:c,error:a,fetchSettings:l,handleChange:w,getEffectiveValue:S}}function Y({status:t,error:s}){return t==="idle"?null:e.jsxs("div",{className:`cedros-autosave-status cedros-autosave-status--${t}`,children:[t==="pending"&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"cedros-autosave-dot"}),e.jsx("span",{children:"Unsaved changes"})]}),t==="saving"&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"cedros-autosave-spinner"}),e.jsx("span",{children:"Saving..."})]}),t==="saved"&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"cedros-autosave-check",children:"✓"}),e.jsx("span",{children:"Saved"})]}),t==="error"&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"cedros-autosave-error-icon",children:"!"}),e.jsx("span",{children:s||"Save failed"})]})]})}exports.AutosaveStatus=Y;exports.CATEGORY_METADATA=E;exports.SETTING_METADATA=j;exports.SettingsSection=I;exports.useSettingsAutosave=J;
|