@hexclave/react 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/components/api-key-dialogs.js +5 -5
  2. package/dist/components/credential-sign-in.js +3 -3
  3. package/dist/components/credential-sign-up.js +5 -5
  4. package/dist/components/elements/sidebar-layout.js +1 -1
  5. package/dist/components/elements/user-avatar.js +1 -1
  6. package/dist/components/magic-link-sign-in.js +4 -4
  7. package/dist/components/message-cards/predefined-message-card.js +1 -1
  8. package/dist/components/oauth-button.d.ts.map +1 -1
  9. package/dist/components/oauth-button.js.map +1 -1
  10. package/dist/components/passkey-button.js +1 -1
  11. package/dist/components/profile-image-editor.js +1 -1
  12. package/dist/components/team-icon.js +1 -1
  13. package/dist/components/team-switcher.js +2 -2
  14. package/dist/components/user-button.js +1 -1
  15. package/dist/components-page/account-settings/active-sessions/active-sessions-page.js +1 -1
  16. package/dist/components-page/account-settings/editable-text.js +1 -1
  17. package/dist/components-page/account-settings/email-and-auth/emails-section.js +3 -3
  18. package/dist/components-page/account-settings/email-and-auth/mfa-section.js +1 -1
  19. package/dist/components-page/account-settings/email-and-auth/password-section.js +3 -3
  20. package/dist/components-page/account-settings/teams/team-api-keys-section.js +1 -1
  21. package/dist/components-page/account-settings/teams/team-creation-page.js +3 -3
  22. package/dist/components-page/account-settings/teams/team-member-invitation-section.js +4 -4
  23. package/dist/components-page/account-settings.js +3 -3
  24. package/dist/components-page/auth-page.js +1 -1
  25. package/dist/components-page/cli-auth-confirm.js +1 -1
  26. package/dist/components-page/email-verification.js +2 -2
  27. package/dist/components-page/error-page.js +1 -1
  28. package/dist/components-page/forgot-password.js +5 -5
  29. package/dist/components-page/magic-link-callback.js +2 -2
  30. package/dist/components-page/mfa.js +3 -3
  31. package/dist/components-page/oauth-callback.js +3 -3
  32. package/dist/components-page/onboarding.js +4 -4
  33. package/dist/components-page/password-reset.js +9 -9
  34. package/dist/components-page/stack-handler-client.js +7 -3
  35. package/dist/components-page/stack-handler-client.js.map +1 -1
  36. package/dist/components-page/team-creation.js +5 -5
  37. package/dist/components-page/team-invitation.js +1 -1
  38. package/dist/dev-tool/index.js +1 -1
  39. package/dist/esm/components/api-key-dialogs.js +5 -5
  40. package/dist/esm/components/credential-sign-in.js +3 -3
  41. package/dist/esm/components/credential-sign-up.js +5 -5
  42. package/dist/esm/components/elements/sidebar-layout.js +1 -1
  43. package/dist/esm/components/elements/user-avatar.js +1 -1
  44. package/dist/esm/components/magic-link-sign-in.js +4 -4
  45. package/dist/esm/components/message-cards/predefined-message-card.js +1 -1
  46. package/dist/esm/components/oauth-button.d.ts.map +1 -1
  47. package/dist/esm/components/oauth-button.js.map +1 -1
  48. package/dist/esm/components/passkey-button.js +1 -1
  49. package/dist/esm/components/profile-image-editor.js +1 -1
  50. package/dist/esm/components/team-icon.js +1 -1
  51. package/dist/esm/components/team-switcher.js +2 -2
  52. package/dist/esm/components/user-button.js +1 -1
  53. package/dist/esm/components-page/account-settings/active-sessions/active-sessions-page.js +1 -1
  54. package/dist/esm/components-page/account-settings/editable-text.js +1 -1
  55. package/dist/esm/components-page/account-settings/email-and-auth/emails-section.js +3 -3
  56. package/dist/esm/components-page/account-settings/email-and-auth/mfa-section.js +1 -1
  57. package/dist/esm/components-page/account-settings/email-and-auth/password-section.js +3 -3
  58. package/dist/esm/components-page/account-settings/teams/team-api-keys-section.js +1 -1
  59. package/dist/esm/components-page/account-settings/teams/team-creation-page.js +3 -3
  60. package/dist/esm/components-page/account-settings/teams/team-member-invitation-section.js +4 -4
  61. package/dist/esm/components-page/account-settings.d.ts +1 -1
  62. package/dist/esm/components-page/account-settings.js +3 -3
  63. package/dist/esm/components-page/auth-page.js +1 -1
  64. package/dist/esm/components-page/cli-auth-confirm.js +1 -1
  65. package/dist/esm/components-page/email-verification.js +2 -2
  66. package/dist/esm/components-page/error-page.js +1 -1
  67. package/dist/esm/components-page/forgot-password.js +5 -5
  68. package/dist/esm/components-page/magic-link-callback.js +2 -2
  69. package/dist/esm/components-page/mfa.js +3 -3
  70. package/dist/esm/components-page/oauth-callback.js +3 -3
  71. package/dist/esm/components-page/onboarding.js +4 -4
  72. package/dist/esm/components-page/password-reset.js +8 -8
  73. package/dist/esm/components-page/stack-handler-client.js +8 -4
  74. package/dist/esm/components-page/stack-handler-client.js.map +1 -1
  75. package/dist/esm/components-page/team-creation.js +5 -5
  76. package/dist/esm/components-page/team-invitation.js +1 -1
  77. package/dist/esm/dev-tool/index.js +1 -1
  78. package/dist/esm/generated/quetzal-translations.d.ts +2 -2
  79. package/dist/esm/lib/auth.js +1 -1
  80. package/dist/esm/lib/auth.test.js +1 -1
  81. package/dist/esm/lib/stack-app/apps/implementations/admin-app-impl.d.ts +1 -1
  82. package/dist/esm/lib/stack-app/apps/implementations/admin-app-impl.d.ts.map +1 -1
  83. package/dist/esm/lib/stack-app/apps/implementations/admin-app-impl.js +1 -1
  84. package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.cross-domain.test.js +67 -1
  85. package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.cross-domain.test.js.map +1 -1
  86. package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.d.ts +2 -1
  87. package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.d.ts.map +1 -1
  88. package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.js +19 -3
  89. package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.js.map +1 -1
  90. package/dist/esm/lib/stack-app/apps/implementations/common.js +2 -2
  91. package/dist/esm/lib/stack-app/apps/implementations/server-app-impl.d.ts +1 -1
  92. package/dist/esm/lib/stack-app/apps/implementations/server-app-impl.js +1 -1
  93. package/dist/esm/lib/stack-app/apps/implementations/session-replay.js +1 -1
  94. package/dist/esm/lib/stack-app/users/index.d.ts +1 -1
  95. package/dist/esm/providers/translation-provider.js +1 -1
  96. package/dist/generated/quetzal-translations.d.ts +2 -2
  97. package/dist/lib/auth.js +1 -1
  98. package/dist/lib/auth.test.js +1 -1
  99. package/dist/lib/stack-app/apps/implementations/admin-app-impl.d.ts.map +1 -1
  100. package/dist/lib/stack-app/apps/implementations/admin-app-impl.js +1 -1
  101. package/dist/lib/stack-app/apps/implementations/client-app-impl.cross-domain.test.js +66 -0
  102. package/dist/lib/stack-app/apps/implementations/client-app-impl.cross-domain.test.js.map +1 -1
  103. package/dist/lib/stack-app/apps/implementations/client-app-impl.d.ts +1 -0
  104. package/dist/lib/stack-app/apps/implementations/client-app-impl.d.ts.map +1 -1
  105. package/dist/lib/stack-app/apps/implementations/client-app-impl.js +19 -3
  106. package/dist/lib/stack-app/apps/implementations/client-app-impl.js.map +1 -1
  107. package/dist/lib/stack-app/apps/implementations/common.js +2 -2
  108. package/dist/lib/stack-app/apps/implementations/server-app-impl.js +1 -1
  109. package/dist/lib/stack-app/apps/implementations/session-replay.js +1 -1
  110. package/dist/providers/translation-provider.js +1 -1
  111. package/package.json +5 -5
@@ -2,14 +2,14 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
  const require_chunk = require('../chunk-BE-pF4vm.js');
5
- let _hexclave_shared_dist_utils_errors = require("@hexclave/shared/dist/utils/errors");
6
5
  let _hexclave_shared_dist_utils_promises = require("@hexclave/shared/dist/utils/promises");
7
6
  let react = require("react");
8
7
  let ___index_js = require("../index.js");
9
8
  let react_jsx_runtime = require("react/jsx-runtime");
10
- let ___lib_hooks_js = require("../lib/hooks.js");
11
9
  let __cli_auth_confirm_js = require("./cli-auth-confirm.js");
12
10
  let ___components_message_cards_message_card_js = require("../components/message-cards/message-card.js");
11
+ let ___lib_hooks_js = require("../lib/hooks.js");
12
+ let _hexclave_shared_dist_utils_errors = require("@hexclave/shared/dist/utils/errors");
13
13
  let ___lib_stack_app_index_js = require("../lib/stack-app/index.js");
14
14
  let _hexclave_shared_dist_utils_objects = require("@hexclave/shared/dist/utils/objects");
15
15
  let _hexclave_shared_dist_utils_urls = require("@hexclave/shared/dist/utils/urls");
@@ -154,6 +154,7 @@ function renderComponent(props) {
154
154
  }
155
155
  function StackHandlerClient(props) {
156
156
  const stackApp = (0, ___lib_hooks_js.useStackApp)();
157
+ const clientOrigin = useClientOriginAfterHydration();
157
158
  const navigate = stackApp.useNavigate();
158
159
  const navigateRef = (0, react.useRef)(navigate);
159
160
  navigateRef.current = navigate;
@@ -185,7 +186,7 @@ function StackHandlerClient(props) {
185
186
  return !(0, ___lib_stack_app_url_targets_js.isLocalHandlerUrlTarget)({
186
187
  targetUrl: url,
187
188
  handlerPath,
188
- currentOrigin: typeof window === "undefined" ? void 0 : window.location.origin
189
+ currentOrigin: clientOrigin
189
190
  });
190
191
  };
191
192
  const result = renderComponent({
@@ -236,6 +237,9 @@ function filterUndefinedINU(value) {
236
237
  function toAbsoluteOrRelativeRedirectTarget(url) {
237
238
  return url.origin === "http://example.com" ? (0, _hexclave_shared_dist_utils_urls.getRelativePart)(url) : url.toString();
238
239
  }
240
+ function useClientOriginAfterHydration() {
241
+ return (0, react.useSyncExternalStore)(() => () => {}, () => window.location.origin, () => void 0);
242
+ }
239
243
 
240
244
  //#endregion
241
245
  exports.StackHandlerClient = StackHandlerClient;
@@ -1 +1 @@
1
- {"version":3,"file":"stack-handler-client.js","names":["SignIn","SignUp","EmailVerification","PasswordReset","ForgotPassword","SignOut","OAuthCallback","MagicLinkCallback","TeamInvitation","AccountSettings","ErrorPage","CliAuthConfirmation","MFA","Onboarding","HexclaveAssertionError","stackAppInternalsSymbol","MessageCard"],"sources":["../../src/components-page/stack-handler-client.tsx"],"sourcesContent":["\"use client\";\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { HexclaveAssertionError } from \"@hexclave/shared/dist/utils/errors\";\nimport { FilterUndefined, filterUndefined } from \"@hexclave/shared/dist/utils/objects\";\nimport { runAsynchronouslyWithAlert } from \"@hexclave/shared/dist/utils/promises\";\nimport { getRelativePart } from \"@hexclave/shared/dist/utils/urls\";\nimport { useEffect, useMemo } from 'react';\nimport { useRef } from 'react';\nimport { SignIn, SignUp, StackServerApp } from \"..\";\nimport { useStackApp } from \"../lib/hooks\";\nimport { HandlerUrls, StackClientApp, stackAppInternalsSymbol } from \"../lib/stack-app\";\nimport { isLocalHandlerUrlTarget, resolveUnknownHandlerPathFallbackUrl } from \"../lib/stack-app/url-targets\";\nimport { AccountSettings } from \"./account-settings\";\nimport { CliAuthConfirmation } from \"./cli-auth-confirm\";\nimport { EmailVerification } from \"./email-verification\";\nimport { ErrorPage } from \"./error-page\";\nimport { ForgotPassword } from \"./forgot-password\";\nimport { MagicLinkCallback } from \"./magic-link-callback\";\nimport { MFA } from \"./mfa\";\nimport { OAuthCallback } from \"./oauth-callback\";\nimport { Onboarding } from \"./onboarding\";\nimport { PasswordReset } from \"./password-reset\";\nimport { SignOut } from \"./sign-out\";\nimport { TeamInvitation } from \"./team-invitation\";\n\nimport { MessageCard } from \"../components/message-cards/message-card\";\n\ntype Components = {\n SignIn: typeof SignIn,\n SignUp: typeof SignUp,\n EmailVerification: typeof EmailVerification,\n PasswordReset: typeof PasswordReset,\n ForgotPassword: typeof ForgotPassword,\n SignOut: typeof SignOut,\n OAuthCallback: typeof OAuthCallback,\n MagicLinkCallback: typeof MagicLinkCallback,\n TeamInvitation: typeof TeamInvitation,\n ErrorPage: typeof ErrorPage,\n AccountSettings: typeof AccountSettings,\n CliAuthConfirmation: typeof CliAuthConfirmation,\n MFA: typeof MFA,\n Onboarding: typeof Onboarding,\n};\n\ntype RouteProps = {\n params: Promise<{ stack?: string[] }> | { stack?: string[] },\n searchParams: Promise<Record<string, string>> | Record<string, string>,\n};\n\nconst availablePaths = {\n signIn: 'sign-in',\n signUp: 'sign-up',\n emailVerification: 'email-verification',\n passwordReset: 'password-reset',\n forgotPassword: 'forgot-password',\n signOut: 'sign-out',\n oauthCallback: 'oauth-callback',\n magicLinkCallback: 'magic-link-callback',\n teamInvitation: 'team-invitation',\n accountSettings: 'account-settings',\n cliAuthConfirm: 'cli-auth-confirm',\n mfa: 'mfa',\n error: 'error',\n onboarding: 'onboarding',\n} as const;\n\nconst placeholderOrigin = \"http://example.com\";\n\nconst pathAliases = {\n // also includes the uppercase and non-dashed versions\n ...Object.fromEntries(Object.entries(availablePaths).map(([key, value]) => [value, value])),\n \"log-in\": availablePaths.signIn,\n \"register\": availablePaths.signUp,\n} as const;\n\nexport type BaseHandlerProps = {\n fullPage: boolean,\n componentProps?: {\n [K in keyof Components]?: Parameters<Components[K]>[0];\n },\n};\n\nfunction renderComponent(props: {\n path: string,\n searchParams: Record<string, string>,\n fullPage: boolean,\n componentProps?: BaseHandlerProps['componentProps'],\n shouldRedirectToPage?: (name: keyof HandlerUrls) => boolean,\n getDefaultUnknownPathUrl?: (path: string) => string | null,\n onNotFound: () => any,\n app: StackClientApp<any> | StackServerApp<any>,\n}) {\n const { path, searchParams, fullPage, componentProps, shouldRedirectToPage, getDefaultUnknownPathUrl, onNotFound, app } = props;\n\n switch (path) {\n case availablePaths.signIn: {\n if (shouldRedirectToPage?.('signIn')) return { redirectToPage: 'signIn' as const };\n return <SignIn\n fullPage={fullPage}\n automaticRedirect\n {...filterUndefinedINU(componentProps?.SignIn)}\n />;\n }\n case availablePaths.signUp: {\n if (shouldRedirectToPage?.('signUp')) return { redirectToPage: 'signUp' as const };\n return <SignUp\n fullPage={fullPage}\n automaticRedirect\n {...filterUndefinedINU(componentProps?.SignUp)}\n />;\n }\n case availablePaths.emailVerification: {\n if (shouldRedirectToPage?.('emailVerification')) return { redirectToPage: 'emailVerification' as const };\n return <EmailVerification\n searchParams={searchParams}\n fullPage={fullPage}\n {...filterUndefinedINU(componentProps?.EmailVerification)}\n />;\n }\n case availablePaths.passwordReset: {\n if (shouldRedirectToPage?.('passwordReset')) return { redirectToPage: 'passwordReset' as const };\n return <PasswordReset\n searchParams={searchParams}\n fullPage={fullPage}\n {...filterUndefinedINU(componentProps?.PasswordReset)}\n />;\n }\n case availablePaths.forgotPassword: {\n if (shouldRedirectToPage?.('forgotPassword')) return { redirectToPage: 'forgotPassword' as const };\n return <ForgotPassword\n fullPage={fullPage}\n {...filterUndefinedINU(componentProps?.ForgotPassword)}\n />;\n }\n case availablePaths.signOut: {\n if (shouldRedirectToPage?.('signOut')) return { redirectToPage: 'signOut' as const };\n return <SignOut\n fullPage={fullPage}\n {...filterUndefinedINU(componentProps?.SignOut)}\n />;\n }\n case availablePaths.oauthCallback: {\n if (shouldRedirectToPage?.('oauthCallback')) return { redirectToPage: 'oauthCallback' as const };\n return <OAuthCallback\n fullPage={fullPage}\n {...filterUndefinedINU(componentProps?.OAuthCallback)}\n />;\n }\n case availablePaths.magicLinkCallback: {\n if (shouldRedirectToPage?.('magicLinkCallback')) return { redirectToPage: 'magicLinkCallback' as const };\n return <MagicLinkCallback\n searchParams={searchParams}\n fullPage={fullPage}\n {...filterUndefinedINU(componentProps?.MagicLinkCallback)}\n />;\n }\n case availablePaths.teamInvitation: {\n if (shouldRedirectToPage?.('teamInvitation')) return { redirectToPage: 'teamInvitation' as const };\n return <TeamInvitation\n searchParams={searchParams}\n fullPage={fullPage}\n {...filterUndefinedINU(componentProps?.TeamInvitation)}\n />;\n }\n case availablePaths.accountSettings: {\n return <AccountSettings\n fullPage={fullPage}\n {...filterUndefinedINU(componentProps?.AccountSettings)}\n />;\n }\n case availablePaths.error: {\n return <ErrorPage\n searchParams={searchParams}\n fullPage={fullPage}\n {...filterUndefinedINU(componentProps?.ErrorPage)}\n />;\n }\n case availablePaths.cliAuthConfirm: {\n if (shouldRedirectToPage?.('cliAuthConfirm')) return { redirectToPage: 'cliAuthConfirm' as const };\n return <CliAuthConfirmation\n fullPage={fullPage}\n {...filterUndefinedINU(componentProps?.CliAuthConfirmation)}\n />;\n }\n case availablePaths.mfa: {\n if (shouldRedirectToPage?.('mfa')) return { redirectToPage: 'mfa' as const };\n return <MFA\n fullPage={fullPage}\n {...filterUndefinedINU(componentProps?.MFA)}\n />;\n }\n case availablePaths.onboarding: {\n if (shouldRedirectToPage?.('onboarding')) return { redirectToPage: 'onboarding' as const };\n return <Onboarding\n fullPage={fullPage}\n {...filterUndefinedINU(componentProps?.Onboarding)}\n />;\n }\n default: {\n if (Object.values(availablePaths).includes(path as any)) {\n throw new HexclaveAssertionError(`Path alias ${path} not included in switch statement, but in availablePaths?`, { availablePaths });\n }\n for (const [key, value] of Object.entries(pathAliases)) {\n if (path.toLowerCase().replaceAll('-', '') === key.toLowerCase().replaceAll('-', '')) {\n const redirectUrl = `${app.urls.handler}/${value}?${new URLSearchParams(searchParams).toString()}`;\n return { redirect: redirectUrl };\n }\n }\n const defaultUnknownPathUrl = getDefaultUnknownPathUrl?.(path);\n if (defaultUnknownPathUrl != null) {\n const defaultUnknownPathUrlObject = new URL(defaultUnknownPathUrl, \"http://example.com\");\n for (const [key, value] of Object.entries(searchParams)) {\n defaultUnknownPathUrlObject.searchParams.set(key, value);\n }\n return { redirect: toAbsoluteOrRelativeRedirectTarget(defaultUnknownPathUrlObject) };\n }\n return onNotFound();\n }\n }\n}\n\nexport function StackHandlerClient(props: BaseHandlerProps & Partial<RouteProps> & { location?: string }) {\n // Use hooks to get app\n const stackApp = useStackApp();\n\n const navigate = stackApp.useNavigate();\n const navigateRef = useRef(navigate);\n navigateRef.current = navigate;\n const currentLocation = props.location ?? (typeof window === \"undefined\" ? new URL(stackApp.urls.handler, placeholderOrigin).pathname : window.location.pathname);\n const searchParamsSource = new URLSearchParams(typeof window === \"undefined\" ? \"\" : window.location.search);\n const redirectTargets: (string | undefined)[] = [];\n\n const { path, searchParams, handlerPath } = useMemo(() => {\n const handlerPath = new URL(stackApp.urls.handler, 'http://example.com').pathname;\n const relativePath = currentLocation.startsWith(handlerPath)\n ? currentLocation.slice(handlerPath.length).replace(/^\\/+/, '')\n : currentLocation.replace(/^\\/+/, '');\n\n return {\n path: relativePath,\n searchParams: Object.fromEntries(searchParamsSource.entries()),\n handlerPath,\n };\n }, [currentLocation, searchParamsSource, stackApp.urls.handler]);\n\n const getDefaultUnknownPathUrl = (unknownPath: string): string | null => {\n return resolveUnknownHandlerPathFallbackUrl({\n defaultTarget: stackApp[stackAppInternalsSymbol].getConstructorOptions().urls?.default,\n projectId: stackApp.projectId,\n unknownPath,\n });\n };\n\n const shouldRedirectToPage = (name: keyof HandlerUrls): boolean => {\n const url = stackApp.urls[name];\n const isCrossDomainLocalOauthCallback = name === \"oauthCallback\" && searchParams.hexclave_cross_domain_auth === \"1\";\n if (isCrossDomainLocalOauthCallback) {\n return false;\n }\n return !isLocalHandlerUrlTarget({\n targetUrl: url,\n handlerPath,\n currentOrigin: typeof window === \"undefined\" ? undefined : window.location.origin,\n });\n };\n\n const result = renderComponent({\n path,\n searchParams,\n fullPage: props.fullPage,\n componentProps: props.componentProps,\n shouldRedirectToPage,\n getDefaultUnknownPathUrl,\n onNotFound: () =>\n (\n <MessageCard\n title=\"Page does not exist\"\n fullPage={props.fullPage}\n primaryButtonText=\"Go to Home\"\n primaryAction={() => stackApp.redirectToHome()}\n >\n The page you are looking for could not be found. Please check the URL and try again.\n </MessageCard>\n )\n ,\n app: stackApp,\n });\n\n const redirectToPage = (result != null && typeof result === 'object' && 'redirectToPage' in result) ? result.redirectToPage : undefined;\n\n useEffect(() => {\n if (redirectToPage == null) return;\n runAsynchronouslyWithAlert(\n stackApp[stackAppInternalsSymbol].redirectToHandler(redirectToPage, { replace: true })\n );\n }, [redirectToPage, stackApp]);\n\n if (redirectToPage != null) {\n return (\n <MessageCard title=\"Redirecting...\" fullPage={props.fullPage} />\n );\n }\n\n if (result && 'redirect' in result) {\n redirectTargets.push(result.redirect);\n }\n\n const redirectTarget = redirectTargets[0];\n const shouldRenderRedirectFallback = redirectTarget != null && stackApp[stackAppInternalsSymbol].getRedirectMethod() === \"none\";\n useEffect(() => {\n if (redirectTarget == null || shouldRenderRedirectFallback) {\n return;\n }\n navigateRef.current(redirectTarget);\n }, [redirectTarget, shouldRenderRedirectFallback]);\n\n if (redirectTarget != null && shouldRenderRedirectFallback) {\n return (\n <MessageCard\n title=\"Continue\"\n fullPage={props.fullPage}\n primaryButtonText=\"Continue\"\n primaryAction={() => window.location.assign(redirectTarget)}\n >\n Continue to the next page.\n </MessageCard>\n );\n }\n\n if (redirectTarget != null) {\n return null;\n }\n\n return result;\n}\n\n// filter undefined values in object. if object itself is undefined, return undefined\nfunction filterUndefinedINU<T extends {}>(value: T | undefined): FilterUndefined<T> | undefined {\n return value === undefined ? value : filterUndefined(value);\n}\n\nfunction toAbsoluteOrRelativeRedirectTarget(url: URL): string {\n return url.origin === \"http://example.com\" ? getRelativePart(url) : url.toString();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,MAAM,iBAAiB;CACrB,QAAQ;CACR,QAAQ;CACR,mBAAmB;CACnB,eAAe;CACf,gBAAgB;CAChB,SAAS;CACT,eAAe;CACf,mBAAmB;CACnB,gBAAgB;CAChB,iBAAiB;CACjB,gBAAgB;CAChB,KAAK;CACL,OAAO;CACP,YAAY;CACb;AAED,MAAM,oBAAoB;AAE1B,MAAM,cAAc;CAElB,GAAG,OAAO,YAAY,OAAO,QAAQ,eAAe,CAAC,KAAK,CAAC,KAAK,WAAW,CAAC,OAAO,MAAM,CAAC,CAAC;CAC3F,UAAU,eAAe;CACzB,YAAY,eAAe;CAC5B;AASD,SAAS,gBAAgB,OAStB;CACD,MAAM,EAAE,MAAM,cAAc,UAAU,gBAAgB,sBAAsB,0BAA0B,YAAY,QAAQ;AAE1H,SAAQ,MAAR;EACE,KAAK,eAAe;AAClB,OAAI,uBAAuB,SAAS,CAAE,QAAO,EAAE,gBAAgB,UAAmB;AAClF,UAAO,2CAACA;IACI;IACV;IACA,GAAI,mBAAmB,gBAAgB,OAAO;KAC9C;EAEJ,KAAK,eAAe;AAClB,OAAI,uBAAuB,SAAS,CAAE,QAAO,EAAE,gBAAgB,UAAmB;AAClF,UAAO,2CAACC;IACI;IACV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OAAO,iBAAiB;AAE9H,4BAAgB;AACd,MAAI,kBAAkB,KAAM;AAC5B,uEACE,SAASD,mDAAyB,kBAAkB,gBAAgB,EAAE,SAAS,MAAM,CAAC,CACvF;IACA,CAAC,gBAAgB,SAAS,CAAC;AAE9B,KAAI,kBAAkB,KACpB,QACE,2CAACC;EAAY,OAAM;EAAiB,UAAU,MAAM;GAAY;AAIpE,KAAI,UAAU,cAAc,OAC1B,iBAAgB,KAAK,OAAO,SAAS;CAGvC,MAAM,iBAAiB,gBAAgB;CACvC,MAAM,+BAA+B,kBAAkB,QAAQ,SAASD,mDAAyB,mBAAmB,KAAK;AACzH,4BAAgB;AACd,MAAI,kBAAkB,QAAQ,6BAC5B;AAEF,cAAY,QAAQ,eAAe;IAClC,CAAC,gBAAgB,6BAA6B,CAAC;AAElD,KAAI,kBAAkB,QAAQ,6BAC5B,QACE,2CAACC;EACC,OAAM;EACN,UAAU,MAAM;EAChB,mBAAkB;EAClB,qBAAqB,OAAO,SAAS,OAAO,eAAe;YAC5D;GAEa;AAIlB,KAAI,kBAAkB,KACpB,QAAO;AAGT,QAAO;;AAIT,SAAS,mBAAiC,OAAsD;AAC9F,QAAO,UAAU,SAAY,iEAAwB,MAAM;;AAG7D,SAAS,mCAAmC,KAAkB;AAC5D,QAAO,IAAI,WAAW,6EAAuC,IAAI,GAAG,IAAI,UAAU"}
1
+ {"version":3,"file":"stack-handler-client.js","names":["SignIn","SignUp","EmailVerification","PasswordReset","ForgotPassword","SignOut","OAuthCallback","MagicLinkCallback","TeamInvitation","AccountSettings","ErrorPage","CliAuthConfirmation","MFA","Onboarding","HexclaveAssertionError","stackAppInternalsSymbol","MessageCard"],"sources":["../../src/components-page/stack-handler-client.tsx"],"sourcesContent":["\"use client\";\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { HexclaveAssertionError } from \"@hexclave/shared/dist/utils/errors\";\nimport { FilterUndefined, filterUndefined } from \"@hexclave/shared/dist/utils/objects\";\nimport { runAsynchronouslyWithAlert } from \"@hexclave/shared/dist/utils/promises\";\nimport { getRelativePart } from \"@hexclave/shared/dist/utils/urls\";\nimport { useEffect, useMemo, useSyncExternalStore } from 'react';\nimport { useRef } from 'react';\nimport { SignIn, SignUp, StackServerApp } from \"..\";\nimport { useStackApp } from \"../lib/hooks\";\nimport { HandlerUrls, StackClientApp, stackAppInternalsSymbol } from \"../lib/stack-app\";\nimport { isLocalHandlerUrlTarget, resolveUnknownHandlerPathFallbackUrl } from \"../lib/stack-app/url-targets\";\nimport { AccountSettings } from \"./account-settings\";\nimport { CliAuthConfirmation } from \"./cli-auth-confirm\";\nimport { EmailVerification } from \"./email-verification\";\nimport { ErrorPage } from \"./error-page\";\nimport { ForgotPassword } from \"./forgot-password\";\nimport { MagicLinkCallback } from \"./magic-link-callback\";\nimport { MFA } from \"./mfa\";\nimport { OAuthCallback } from \"./oauth-callback\";\nimport { Onboarding } from \"./onboarding\";\nimport { PasswordReset } from \"./password-reset\";\nimport { SignOut } from \"./sign-out\";\nimport { TeamInvitation } from \"./team-invitation\";\n\nimport { MessageCard } from \"../components/message-cards/message-card\";\n\ntype Components = {\n SignIn: typeof SignIn,\n SignUp: typeof SignUp,\n EmailVerification: typeof EmailVerification,\n PasswordReset: typeof PasswordReset,\n ForgotPassword: typeof ForgotPassword,\n SignOut: typeof SignOut,\n OAuthCallback: typeof OAuthCallback,\n MagicLinkCallback: typeof MagicLinkCallback,\n TeamInvitation: typeof TeamInvitation,\n ErrorPage: typeof ErrorPage,\n AccountSettings: typeof AccountSettings,\n CliAuthConfirmation: typeof CliAuthConfirmation,\n MFA: typeof MFA,\n Onboarding: typeof Onboarding,\n};\n\ntype RouteProps = {\n params: Promise<{ stack?: string[] }> | { stack?: string[] },\n searchParams: Promise<Record<string, string>> | Record<string, string>,\n};\n\nconst availablePaths = {\n signIn: 'sign-in',\n signUp: 'sign-up',\n emailVerification: 'email-verification',\n passwordReset: 'password-reset',\n forgotPassword: 'forgot-password',\n signOut: 'sign-out',\n oauthCallback: 'oauth-callback',\n magicLinkCallback: 'magic-link-callback',\n teamInvitation: 'team-invitation',\n accountSettings: 'account-settings',\n cliAuthConfirm: 'cli-auth-confirm',\n mfa: 'mfa',\n error: 'error',\n onboarding: 'onboarding',\n} as const;\n\nconst placeholderOrigin = \"http://example.com\";\n\nconst pathAliases = {\n // also includes the uppercase and non-dashed versions\n ...Object.fromEntries(Object.entries(availablePaths).map(([key, value]) => [value, value])),\n \"log-in\": availablePaths.signIn,\n \"register\": availablePaths.signUp,\n} as const;\n\nexport type BaseHandlerProps = {\n fullPage: boolean,\n componentProps?: {\n [K in keyof Components]?: Parameters<Components[K]>[0];\n },\n};\n\nfunction renderComponent(props: {\n path: string,\n searchParams: Record<string, string>,\n fullPage: boolean,\n componentProps?: BaseHandlerProps['componentProps'],\n shouldRedirectToPage?: (name: keyof HandlerUrls) => boolean,\n getDefaultUnknownPathUrl?: (path: string) => string | null,\n onNotFound: () => any,\n app: StackClientApp<any> | StackServerApp<any>,\n}) {\n const { path, searchParams, fullPage, componentProps, shouldRedirectToPage, getDefaultUnknownPathUrl, onNotFound, app } = props;\n\n switch (path) {\n case availablePaths.signIn: {\n if (shouldRedirectToPage?.('signIn')) return { redirectToPage: 'signIn' as const };\n return <SignIn\n fullPage={fullPage}\n automaticRedirect\n {...filterUndefinedINU(componentProps?.SignIn)}\n />;\n }\n case availablePaths.signUp: {\n if (shouldRedirectToPage?.('signUp')) return { redirectToPage: 'signUp' as const };\n return <SignUp\n fullPage={fullPage}\n automaticRedirect\n {...filterUndefinedINU(componentProps?.SignUp)}\n />;\n }\n case availablePaths.emailVerification: {\n if (shouldRedirectToPage?.('emailVerification')) return { redirectToPage: 'emailVerification' as const };\n return <EmailVerification\n searchParams={searchParams}\n fullPage={fullPage}\n {...filterUndefinedINU(componentProps?.EmailVerification)}\n />;\n }\n case availablePaths.passwordReset: {\n if (shouldRedirectToPage?.('passwordReset')) return { redirectToPage: 'passwordReset' as const };\n return <PasswordReset\n searchParams={searchParams}\n fullPage={fullPage}\n {...filterUndefinedINU(componentProps?.PasswordReset)}\n />;\n }\n case availablePaths.forgotPassword: {\n if (shouldRedirectToPage?.('forgotPassword')) return { redirectToPage: 'forgotPassword' as const };\n return <ForgotPassword\n fullPage={fullPage}\n {...filterUndefinedINU(componentProps?.ForgotPassword)}\n />;\n }\n case availablePaths.signOut: {\n if (shouldRedirectToPage?.('signOut')) return { redirectToPage: 'signOut' as const };\n return <SignOut\n fullPage={fullPage}\n {...filterUndefinedINU(componentProps?.SignOut)}\n />;\n }\n case availablePaths.oauthCallback: {\n if (shouldRedirectToPage?.('oauthCallback')) return { redirectToPage: 'oauthCallback' as const };\n return <OAuthCallback\n fullPage={fullPage}\n {...filterUndefinedINU(componentProps?.OAuthCallback)}\n />;\n }\n case availablePaths.magicLinkCallback: {\n if (shouldRedirectToPage?.('magicLinkCallback')) return { redirectToPage: 'magicLinkCallback' as const };\n return <MagicLinkCallback\n searchParams={searchParams}\n fullPage={fullPage}\n {...filterUndefinedINU(componentProps?.MagicLinkCallback)}\n />;\n }\n case availablePaths.teamInvitation: {\n if (shouldRedirectToPage?.('teamInvitation')) return { redirectToPage: 'teamInvitation' as const };\n return <TeamInvitation\n searchParams={searchParams}\n fullPage={fullPage}\n {...filterUndefinedINU(componentProps?.TeamInvitation)}\n />;\n }\n case availablePaths.accountSettings: {\n return <AccountSettings\n fullPage={fullPage}\n {...filterUndefinedINU(componentProps?.AccountSettings)}\n />;\n }\n case availablePaths.error: {\n return <ErrorPage\n searchParams={searchParams}\n fullPage={fullPage}\n {...filterUndefinedINU(componentProps?.ErrorPage)}\n />;\n }\n case availablePaths.cliAuthConfirm: {\n if (shouldRedirectToPage?.('cliAuthConfirm')) return { redirectToPage: 'cliAuthConfirm' as const };\n return <CliAuthConfirmation\n fullPage={fullPage}\n {...filterUndefinedINU(componentProps?.CliAuthConfirmation)}\n />;\n }\n case availablePaths.mfa: {\n if (shouldRedirectToPage?.('mfa')) return { redirectToPage: 'mfa' as const };\n return <MFA\n fullPage={fullPage}\n {...filterUndefinedINU(componentProps?.MFA)}\n />;\n }\n case availablePaths.onboarding: {\n if (shouldRedirectToPage?.('onboarding')) return { redirectToPage: 'onboarding' as const };\n return <Onboarding\n fullPage={fullPage}\n {...filterUndefinedINU(componentProps?.Onboarding)}\n />;\n }\n default: {\n if (Object.values(availablePaths).includes(path as any)) {\n throw new HexclaveAssertionError(`Path alias ${path} not included in switch statement, but in availablePaths?`, { availablePaths });\n }\n for (const [key, value] of Object.entries(pathAliases)) {\n if (path.toLowerCase().replaceAll('-', '') === key.toLowerCase().replaceAll('-', '')) {\n const redirectUrl = `${app.urls.handler}/${value}?${new URLSearchParams(searchParams).toString()}`;\n return { redirect: redirectUrl };\n }\n }\n const defaultUnknownPathUrl = getDefaultUnknownPathUrl?.(path);\n if (defaultUnknownPathUrl != null) {\n const defaultUnknownPathUrlObject = new URL(defaultUnknownPathUrl, \"http://example.com\");\n for (const [key, value] of Object.entries(searchParams)) {\n defaultUnknownPathUrlObject.searchParams.set(key, value);\n }\n return { redirect: toAbsoluteOrRelativeRedirectTarget(defaultUnknownPathUrlObject) };\n }\n return onNotFound();\n }\n }\n}\n\nexport function StackHandlerClient(props: BaseHandlerProps & Partial<RouteProps> & { location?: string }) {\n // Use hooks to get app\n const stackApp = useStackApp();\n const clientOrigin = useClientOriginAfterHydration();\n\n const navigate = stackApp.useNavigate();\n const navigateRef = useRef(navigate);\n navigateRef.current = navigate;\n const currentLocation = props.location ?? (typeof window === \"undefined\" ? new URL(stackApp.urls.handler, placeholderOrigin).pathname : window.location.pathname);\n const searchParamsSource = new URLSearchParams(typeof window === \"undefined\" ? \"\" : window.location.search);\n const redirectTargets: (string | undefined)[] = [];\n\n const { path, searchParams, handlerPath } = useMemo(() => {\n const handlerPath = new URL(stackApp.urls.handler, 'http://example.com').pathname;\n const relativePath = currentLocation.startsWith(handlerPath)\n ? currentLocation.slice(handlerPath.length).replace(/^\\/+/, '')\n : currentLocation.replace(/^\\/+/, '');\n\n return {\n path: relativePath,\n searchParams: Object.fromEntries(searchParamsSource.entries()),\n handlerPath,\n };\n }, [currentLocation, searchParamsSource, stackApp.urls.handler]);\n\n const getDefaultUnknownPathUrl = (unknownPath: string): string | null => {\n return resolveUnknownHandlerPathFallbackUrl({\n defaultTarget: stackApp[stackAppInternalsSymbol].getConstructorOptions().urls?.default,\n projectId: stackApp.projectId,\n unknownPath,\n });\n };\n\n const shouldRedirectToPage = (name: keyof HandlerUrls): boolean => {\n const url = stackApp.urls[name];\n const isCrossDomainLocalOauthCallback = name === \"oauthCallback\" && searchParams.hexclave_cross_domain_auth === \"1\";\n if (isCrossDomainLocalOauthCallback) {\n return false;\n }\n return !isLocalHandlerUrlTarget({\n targetUrl: url,\n handlerPath,\n currentOrigin: clientOrigin,\n });\n };\n\n const result = renderComponent({\n path,\n searchParams,\n fullPage: props.fullPage,\n componentProps: props.componentProps,\n shouldRedirectToPage,\n getDefaultUnknownPathUrl,\n onNotFound: () =>\n (\n <MessageCard\n title=\"Page does not exist\"\n fullPage={props.fullPage}\n primaryButtonText=\"Go to Home\"\n primaryAction={() => stackApp.redirectToHome()}\n >\n The page you are looking for could not be found. Please check the URL and try again.\n </MessageCard>\n )\n ,\n app: stackApp,\n });\n\n const redirectToPage = (result != null && typeof result === 'object' && 'redirectToPage' in result) ? result.redirectToPage : undefined;\n\n useEffect(() => {\n if (redirectToPage == null) return;\n runAsynchronouslyWithAlert(\n stackApp[stackAppInternalsSymbol].redirectToHandler(redirectToPage, { replace: true })\n );\n }, [redirectToPage, stackApp]);\n\n if (redirectToPage != null) {\n return (\n <MessageCard title=\"Redirecting...\" fullPage={props.fullPage} />\n );\n }\n\n if (result && 'redirect' in result) {\n redirectTargets.push(result.redirect);\n }\n\n const redirectTarget = redirectTargets[0];\n const shouldRenderRedirectFallback = redirectTarget != null && stackApp[stackAppInternalsSymbol].getRedirectMethod() === \"none\";\n useEffect(() => {\n if (redirectTarget == null || shouldRenderRedirectFallback) {\n return;\n }\n navigateRef.current(redirectTarget);\n }, [redirectTarget, shouldRenderRedirectFallback]);\n\n if (redirectTarget != null && shouldRenderRedirectFallback) {\n return (\n <MessageCard\n title=\"Continue\"\n fullPage={props.fullPage}\n primaryButtonText=\"Continue\"\n primaryAction={() => window.location.assign(redirectTarget)}\n >\n Continue to the next page.\n </MessageCard>\n );\n }\n\n if (redirectTarget != null) {\n return null;\n }\n\n return result;\n}\n\n// filter undefined values in object. if object itself is undefined, return undefined\nfunction filterUndefinedINU<T extends {}>(value: T | undefined): FilterUndefined<T> | undefined {\n return value === undefined ? value : filterUndefined(value);\n}\n\nfunction toAbsoluteOrRelativeRedirectTarget(url: URL): string {\n return url.origin === \"http://example.com\" ? getRelativePart(url) : url.toString();\n}\n\nfunction useClientOriginAfterHydration(): string | undefined {\n // The first hydrated render must match SSR. After hydration, React re-checks\n // the snapshot and lets us distinguish same-path cross-origin handler URLs.\n return useSyncExternalStore(\n () => () => {},\n () => window.location.origin,\n () => undefined,\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,MAAM,iBAAiB;CACrB,QAAQ;CACR,QAAQ;CACR,mBAAmB;CACnB,eAAe;CACf,gBAAgB;CAChB,SAAS;CACT,eAAe;CACf,mBAAmB;CACnB,gBAAgB;CAChB,iBAAiB;CACjB,gBAAgB;CAChB,KAAK;CACL,OAAO;CACP,YAAY;CACb;AAED,MAAM,oBAAoB;AAE1B,MAAM,cAAc;CAElB,GAAG,OAAO,YAAY,OAAO,QAAQ,eAAe,CAAC,KAAK,CAAC,KAAK,WAAW,CAAC,OAAO,MAAM,CAAC,CAAC;CAC3F,UAAU,eAAe;CACzB,YAAY,eAAe;CAC5B;AASD,SAAS,gBAAgB,OAStB;CACD,MAAM,EAAE,MAAM,cAAc,UAAU,gBAAgB,sBAAsB,0BAA0B,YAAY,QAAQ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StringTag, { value: 'Module' });
4
4
  const require_chunk = require('../chunk-BE-pF4vm.js');
5
- let _hookform_resolvers_yup = require("@hookform/resolvers/yup");
6
- let _hexclave_shared_dist_schema_fields = require("@hexclave/shared/dist/schema-fields");
7
5
  let _hexclave_shared_dist_utils_promises = require("@hexclave/shared/dist/utils/promises");
8
6
  let _hexclave_ui = require("@hexclave/ui");
9
7
  let react = require("react");
10
- let react_hook_form = require("react-hook-form");
11
8
  let ___index_js = require("../index.js");
12
- let ___components_elements_form_warning_js = require("../components/elements/form-warning.js");
9
+ let ___components_elements_maybe_full_page_js = require("../components/elements/maybe-full-page.js");
13
10
  let ___lib_translations_js = require("../lib/translations.js");
14
11
  let react_jsx_runtime = require("react/jsx-runtime");
15
- let ___components_elements_maybe_full_page_js = require("../components/elements/maybe-full-page.js");
12
+ let _hookform_resolvers_yup = require("@hookform/resolvers/yup");
13
+ let _hexclave_shared_dist_schema_fields = require("@hexclave/shared/dist/schema-fields");
14
+ let react_hook_form = require("react-hook-form");
15
+ let ___components_elements_form_warning_js = require("../components/elements/form-warning.js");
16
16
 
17
17
  //#region src/components-page/team-creation.tsx
18
18
  function TeamCreation(props) {
@@ -9,8 +9,8 @@ react = require_chunk.__toESM(react);
9
9
  let ___index_js = require("../index.js");
10
10
  let ___lib_translations_js = require("../lib/translations.js");
11
11
  let react_jsx_runtime = require("react/jsx-runtime");
12
- let _hexclave_shared = require("@hexclave/shared");
13
12
  let ___components_message_cards_predefined_message_card_js = require("../components/message-cards/predefined-message-card.js");
13
+ let _hexclave_shared = require("@hexclave/shared");
14
14
  let _hexclave_shared_dist_utils_caches = require("@hexclave/shared/dist/utils/caches");
15
15
  let _hexclave_shared_dist_utils_react = require("@hexclave/shared/dist/utils/react");
16
16
 
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_chunk = require('../chunk-BE-pF4vm.js');
3
- let _hexclave_shared_dist_utils_errors = require("@hexclave/shared/dist/utils/errors");
4
3
  let _hexclave_shared_dist_utils_promises = require("@hexclave/shared/dist/utils/promises");
4
+ let _hexclave_shared_dist_utils_errors = require("@hexclave/shared/dist/utils/errors");
5
5
  let _hexclave_shared_dist_utils_urls = require("@hexclave/shared/dist/utils/urls");
6
6
 
7
7
  //#region src/dev-tool/index.ts
@@ -1,16 +1,16 @@
1
1
  'use client';
2
2
 
3
- import { yupResolver } from "@hookform/resolvers/yup";
4
- import { yupObject, yupString } from "@hexclave/shared/dist/schema-fields";
5
- import { captureError } from "@hexclave/shared/dist/utils/errors";
6
3
  import { runAsynchronously } from "@hexclave/shared/dist/utils/promises";
7
4
  import { ActionDialog, Button, CopyField, Input, Label, Typography } from "@hexclave/ui";
8
5
  import { useState } from "react";
9
- import { useForm } from "react-hook-form";
10
6
  import { useUser } from "../index.js";
11
- import { FormWarningText } from "../components/elements/form-warning.js";
12
7
  import { useTranslation } from "../lib/translations.js";
13
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
+ import { captureError } from "@hexclave/shared/dist/utils/errors";
10
+ import { yupResolver } from "@hookform/resolvers/yup";
11
+ import { yupObject, yupString } from "@hexclave/shared/dist/schema-fields";
12
+ import { useForm } from "react-hook-form";
13
+ import { FormWarningText } from "../components/elements/form-warning.js";
14
14
 
15
15
  //#region src/components/api-key-dialogs.tsx
16
16
  const neverInMs = 1e3 * 60 * 60 * 24 * 365 * 200;
@@ -1,14 +1,14 @@
1
1
  'use client';
2
2
 
3
- import { yupResolver } from "@hookform/resolvers/yup";
4
- import { passwordSchema, strictEmailSchema, yupObject } from "@hexclave/shared/dist/schema-fields";
5
3
  import { runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
6
4
  import { Button, Input, Label, PasswordInput } from "@hexclave/ui";
7
5
  import { useState } from "react";
8
- import { useForm } from "react-hook-form";
9
6
  import { useStackApp } from "../index.js";
10
7
  import { useTranslation } from "../lib/translations.js";
11
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
+ import { yupResolver } from "@hookform/resolvers/yup";
10
+ import { passwordSchema, strictEmailSchema, yupObject } from "@hexclave/shared/dist/schema-fields";
11
+ import { useForm } from "react-hook-form";
12
12
  import { FormWarningText } from "./elements/form-warning.js";
13
13
  import { StyledLink } from "./link.js";
14
14
 
@@ -1,17 +1,17 @@
1
1
  'use client';
2
2
 
3
- import { yupResolver } from "@hookform/resolvers/yup";
4
- import { passwordSchema, strictEmailSchema, yupObject } from "@hexclave/shared/dist/schema-fields";
5
3
  import { runAsynchronously, runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
6
4
  import { Button, Input, Label, PasswordInput } from "@hexclave/ui";
7
5
  import React, { useState } from "react";
8
- import { useForm } from "react-hook-form";
9
6
  import { useTranslation } from "../lib/translations.js";
10
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
- import { FormWarningText } from "./elements/form-warning.js";
8
+ import { useStackApp } from "../lib/hooks.js";
9
+ import { yupResolver } from "@hookform/resolvers/yup";
10
+ import { passwordSchema, strictEmailSchema, yupObject } from "@hexclave/shared/dist/schema-fields";
11
+ import { useForm } from "react-hook-form";
12
12
  import { getPasswordError } from "@hexclave/shared/dist/helpers/password";
13
13
  import * as yup from "yup";
14
- import { useStackApp } from "../lib/hooks.js";
14
+ import { FormWarningText } from "./elements/form-warning.js";
15
15
 
16
16
  //#region src/components/credential-sign-up.tsx
17
17
  function CredentialSignUp(props) {
@@ -1,9 +1,9 @@
1
1
  'use client';
2
2
 
3
3
  import { Button, Typography, cn } from "@hexclave/ui";
4
+ import { XIcon } from "lucide-react";
4
5
  import React from "react";
5
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
- import { XIcon } from "lucide-react";
7
7
  import { useHash } from "@hexclave/shared/dist/hooks/use-hash";
8
8
  import { useStackApp } from "../../index.js";
9
9
 
@@ -1,6 +1,6 @@
1
1
  import { Avatar, AvatarFallback, AvatarImage } from "@hexclave/ui";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
2
  import { UserRound } from "lucide-react";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
4
 
5
5
  //#region src/components/elements/user-avatar.tsx
6
6
  const defaultSize = 34;
@@ -1,16 +1,16 @@
1
1
  'use client';
2
2
 
3
- import { yupResolver } from "@hookform/resolvers/yup";
4
- import { strictEmailSchema, yupObject } from "@hexclave/shared/dist/schema-fields";
5
3
  import { runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
6
4
  import { Button, Input, InputOTP, InputOTPGroup, InputOTPSlot, Label, Typography } from "@hexclave/ui";
7
5
  import { useEffect, useState } from "react";
8
- import { useForm } from "react-hook-form";
9
6
  import { useTranslation } from "../lib/translations.js";
10
7
  import { jsx, jsxs } from "react/jsx-runtime";
11
- import { FormWarningText } from "./elements/form-warning.js";
12
8
  import { useStackApp } from "../lib/hooks.js";
13
9
  import { KnownErrors } from "@hexclave/shared";
10
+ import { yupResolver } from "@hookform/resolvers/yup";
11
+ import { strictEmailSchema, yupObject } from "@hexclave/shared/dist/schema-fields";
12
+ import { useForm } from "react-hook-form";
13
+ import { FormWarningText } from "./elements/form-warning.js";
14
14
 
15
15
  //#region src/components/magic-link-sign-in.tsx
16
16
  function OTP(props) {
@@ -2,9 +2,9 @@
2
2
 
3
3
  import { Typography } from "@hexclave/ui";
4
4
  import { jsx } from "react/jsx-runtime";
5
+ import { useTranslation } from "../../lib/translations.js";
5
6
  import { useStackApp } from "../../index.js";
6
7
  import { MessageCard } from "./message-card.js";
7
- import { useTranslation } from "../../lib/translations.js";
8
8
 
9
9
  //#region src/components/message-cards/predefined-message-card.tsx
10
10
  function PredefinedMessageCard({ type, fullPage = false }) {
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-button.d.ts","names":[],"sources":["../../../src/components/oauth-button.tsx"],"mappings":";;;iBAuBgB,WAAA,CAAA;EACd,QAAA;EACA,IAAA;EACA,MAAA;EACA;AAAA;EAEA,QAAA;EACA,IAAA;EACA,MAAA;EACA,cAAA,SAAuB,OAAA;AAAA,IACxB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"oauth-button.d.ts","names":[],"sources":["../../../src/components/oauth-button.tsx"],"mappings":";;;iBAwBgB,WAAA,CAAA;EACd,QAAA;EACA,IAAA;EACA,MAAA;EACA;AAAA;EAEA,QAAA;EACA,IAAA;EACA,MAAA;EACA,cAAA,SAAuB,OAAA;AAAA,IACxB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-button.js","names":[],"sources":["../../../src/components/oauth-button.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { BrandIcons, Button, SimpleTooltip } from '@hexclave/ui';\nimport Color, { ColorInstance } from 'color';\nimport { useEffect, useId, useState } from 'react';\nimport { useStackApp } from '../lib/hooks';\nimport { useTranslation } from '../lib/translations';\nimport { useInIframe } from './use-in-iframe';\n\nconst iconSize = 22;\n\nconst changeColor = (c: ColorInstance, value: number) => {\n if (c.isLight()) {\n value = -value;\n }\n return c.hsl(c.hue(), c.saturationl(), c.lightness() + value).toString();\n};\n\nexport function OAuthButton({\n provider,\n type,\n isMock = false,\n onAuthenticate,\n}: {\n provider: string,\n type: 'sign-in' | 'sign-up',\n isMock?: boolean,\n onAuthenticate?: () => Promise<void>,\n}) {\n const { t } = useTranslation();\n const stackApp = useStackApp();\n const styleId = useId().replaceAll(':', '-');\n const isIframe = useInIframe();\n\n const [lastUsed, setLastUsed] = useState<string | null>(null);\n useEffect(() => {\n // Hexclave rebrand: UI hint key — straight rename (dot delimiter preserved).\n setLastUsed(localStorage.getItem('_HEXCLAVE.lastUsed'));\n }, []);\n\n let style : {\n backgroundColor?: string,\n textColor?: string,\n name: string,\n icon: JSX.Element | null,\n border?: string,\n };\n switch (provider) {\n case 'google': {\n style = {\n backgroundColor: '#fff',\n textColor: '#000',\n name: 'Google',\n border: '1px solid #ddd',\n icon: <BrandIcons.Google iconSize={iconSize} />,\n };\n break;\n }\n case 'github': {\n style = {\n backgroundColor: '#111',\n textColor: '#fff',\n border: '1px solid #333',\n name: 'GitHub',\n icon: <BrandIcons.GitHub iconSize={iconSize} />,\n };\n break;\n }\n case 'facebook': {\n style = {\n backgroundColor: '#1877F2',\n textColor: '#fff',\n name: 'Facebook',\n icon: <BrandIcons.Facebook iconSize={iconSize} />,\n };\n break;\n }\n case 'microsoft': {\n style = {\n backgroundColor: '#2f2f2f',\n textColor: '#fff',\n name: 'Microsoft',\n icon: <BrandIcons.Microsoft iconSize={iconSize} />,\n };\n break;\n }\n case 'spotify': {\n style = {\n backgroundColor: '#1DB954',\n textColor: '#fff',\n name: 'Spotify',\n icon: <BrandIcons.Spotify iconSize={iconSize} />,\n };\n break;\n }\n case 'discord': {\n style = {\n backgroundColor: '#5865F2',\n textColor: '#fff',\n name: 'Discord',\n icon: <BrandIcons.Discord iconSize={iconSize} />,\n };\n break;\n }\n case 'gitlab': {\n style = {\n backgroundColor: \"#111\",\n textColor: \"#fff\",\n border: \"1px solid #333\",\n name: \"Gitlab\",\n icon: <BrandIcons.Gitlab iconSize={iconSize} />,\n };\n break;\n }\n case 'apple': {\n style = {\n backgroundColor: \"#000\",\n textColor: \"#fff\",\n border: \"1px solid #333\",\n name: \"Apple\",\n icon: <BrandIcons.Apple iconSize={iconSize} />,\n };\n break;\n }\n case \"bitbucket\": {\n style = {\n backgroundColor: \"#fff\",\n textColor: \"#000\",\n border: \"1px solid #ddd\",\n name: \"Bitbucket\",\n icon: <BrandIcons.Bitbucket iconSize={iconSize} />,\n };\n break;\n }\n case 'linkedin': {\n style = {\n backgroundColor: \"#0073b1\",\n textColor: \"#fff\",\n name: \"LinkedIn\",\n icon: <BrandIcons.LinkedIn iconSize={iconSize} />,\n };\n break;\n }\n case 'x': {\n style = {\n backgroundColor: \"#000\",\n textColor: \"#fff\",\n name: \"X\",\n icon: <BrandIcons.X iconSize={iconSize} />,\n };\n break;\n }\n case 'twitch': {\n style = {\n backgroundColor: \"#6441a5\",\n textColor: \"#fff\",\n name: \"Twitch\",\n icon: <BrandIcons.Twitch iconSize={iconSize} />,\n };\n break;\n }\n default: {\n style = {\n name: provider,\n icon: null,\n };\n }\n }\n\n const styleSheet = `\n .stack-oauth-button-${styleId} {\n background-color: ${style.backgroundColor} !important;\n color: ${style.textColor} !important;\n border: ${style.border} !important;\n }\n .stack-oauth-button-${styleId}:hover {\n background-color: ${changeColor(Color(style.backgroundColor), 10)} !important;\n }\n `;\n\n return (\n <>\n <style>{styleSheet}</style>\n <SimpleTooltip\n disabled={!isIframe}\n tooltip={isIframe ? \"This auth provider is not supported in an iframe for security reasons.\" : undefined}\n className='stack-scope w-full inline-flex'\n >\n <Button\n onClick={async () => {\n // Hexclave rebrand: UI hint key — straight rename (dot delimiter preserved).\n localStorage.setItem('_HEXCLAVE.lastUsed', provider);\n await (onAuthenticate ? onAuthenticate() : stackApp.signInWithOAuth(provider));\n }}\n className={`stack-oauth-button-${styleId} stack-scope relative w-full`}\n disabled={isIframe}\n >\n {!isMock && lastUsed === provider && (\n <span className=\"absolute -top-2 -right-2 bg-blue-500 text-white text-xs px-2 py-1 rounded-md\">\n last\n </span>\n )}\n <div className='flex items-center w-full gap-4'>\n {style.icon}\n <span className='flex-1'>\n {type === 'sign-up' ?\n t('Sign up with {provider}', { provider: style.name }) :\n t('Sign in with {provider}', { provider: style.name })\n }\n </span>\n </div>\n </Button>\n </SimpleTooltip>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;AAcA,MAAM,WAAW;AAEjB,MAAM,eAAe,GAAkB,UAAkB;AACvD,KAAI,EAAE,SAAS,CACb,SAAQ,CAAC;AAEX,QAAO,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,aAAa,EAAE,EAAE,WAAW,GAAG,MAAM,CAAC,UAAU;;AAG1E,SAAgB,YAAY,EAC1B,UACA,MACA,SAAS,OAC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N,iBAAiB;IACjB,WAAW;IACX,QAAQ;IACR,MAAM;IACN,MAAM,oBAAC,WAAW,aAAoB,WAAY;IACnD;AACD;EAEF,KAAK;AACH,WAAQ;IACN,iBAAiB;IACjB,WAAW;IACX,MAAM;IACN,MAAM,oBAAC,WAAW,YAAmB,WAAY;IAClD;AACD;EAEF,KAAK;AACH,WAAQ;IACN,iBAAiB;IACjB,WAAW;IACX,MAAM;IACN,MAAM,oBAAC,WAAW,KAAY,WAAY;IAC3C;AACD;EAEF,KAAK;AACH,WAAQ;IACN,iBAAiB;IACjB,WAAW;IACX,MAAM;IACN,MAAM,oBAAC,WAAW,UAAiB,WAAY;IAChD;AACD;EAEF,QACE,SAAQ;GACN,MAAM;GACN,MAAM;GACP;;AAeL,QACE,4CACE,oBAAC,qBAbc;0BACK,QAAQ;0BACR,MAAM,gBAAgB;eACjC,MAAM,UAAU;gBACf,MAAM,OAAO;;0BAEH,QAAQ;0BACR,YAAY,MAAM,MAAM,gBAAgB,EAAE,GAAG,CAAC;;MAMvC,EAC3B,oBAAC;EACC,UAAU,CAAC;EACX,SAAS,WAAW,2EAA2E;EAC/F,WAAU;YAEV,qBAAC;GACC,SAAS,YAAY;AAEnB,iBAAa,QAAQ,sBAAsB,SAAS;AACpD,WAAO,iBAAiB,gBAAgB,GAAG,SAAS,gBAAgB,SAAS;;GAE/E,WAAW,sBAAsB,QAAQ;GACzC,UAAU;cAET,CAAC,UAAU,aAAa,YACvB,oBAAC;IAAK,WAAU;cAA+E;KAExF,EAET,qBAAC;IAAI,WAAU;eACZ,MAAM,MACP,oBAAC;KAAK,WAAU;eACb,SAAS,YACV,EAAE,2BAA2B,EAAE,UAAU,MAAM,MAAM,CAAC,GACtD,EAAE,2BAA2B,EAAE,UAAU,MAAM,MAAM,CAAC;MAEjD;KACH;IACC;GACK,IACf"}
1
+ {"version":3,"file":"oauth-button.js","names":[],"sources":["../../../src/components/oauth-button.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { BrandIcons, Button, SimpleTooltip } from '@hexclave/ui';\nimport Color, { ColorInstance } from 'color';\nimport type { ReactElement } from 'react';\nimport { useEffect, useId, useState } from 'react';\nimport { useStackApp } from '../lib/hooks';\nimport { useTranslation } from '../lib/translations';\nimport { useInIframe } from './use-in-iframe';\n\nconst iconSize = 22;\n\nconst changeColor = (c: ColorInstance, value: number) => {\n if (c.isLight()) {\n value = -value;\n }\n return c.hsl(c.hue(), c.saturationl(), c.lightness() + value).toString();\n};\n\nexport function OAuthButton({\n provider,\n type,\n isMock = false,\n onAuthenticate,\n}: {\n provider: string,\n type: 'sign-in' | 'sign-up',\n isMock?: boolean,\n onAuthenticate?: () => Promise<void>,\n}) {\n const { t } = useTranslation();\n const stackApp = useStackApp();\n const styleId = useId().replaceAll(':', '-');\n const isIframe = useInIframe();\n\n const [lastUsed, setLastUsed] = useState<string | null>(null);\n useEffect(() => {\n // Hexclave rebrand: UI hint key — straight rename (dot delimiter preserved).\n setLastUsed(localStorage.getItem('_HEXCLAVE.lastUsed'));\n }, []);\n\n let style : {\n backgroundColor?: string,\n textColor?: string,\n name: string,\n icon: ReactElement | null,\n border?: string,\n };\n switch (provider) {\n case 'google': {\n style = {\n backgroundColor: '#fff',\n textColor: '#000',\n name: 'Google',\n border: '1px solid #ddd',\n icon: <BrandIcons.Google iconSize={iconSize} />,\n };\n break;\n }\n case 'github': {\n style = {\n backgroundColor: '#111',\n textColor: '#fff',\n border: '1px solid #333',\n name: 'GitHub',\n icon: <BrandIcons.GitHub iconSize={iconSize} />,\n };\n break;\n }\n case 'facebook': {\n style = {\n backgroundColor: '#1877F2',\n textColor: '#fff',\n name: 'Facebook',\n icon: <BrandIcons.Facebook iconSize={iconSize} />,\n };\n break;\n }\n case 'microsoft': {\n style = {\n backgroundColor: '#2f2f2f',\n textColor: '#fff',\n name: 'Microsoft',\n icon: <BrandIcons.Microsoft iconSize={iconSize} />,\n };\n break;\n }\n case 'spotify': {\n style = {\n backgroundColor: '#1DB954',\n textColor: '#fff',\n name: 'Spotify',\n icon: <BrandIcons.Spotify iconSize={iconSize} />,\n };\n break;\n }\n case 'discord': {\n style = {\n backgroundColor: '#5865F2',\n textColor: '#fff',\n name: 'Discord',\n icon: <BrandIcons.Discord iconSize={iconSize} />,\n };\n break;\n }\n case 'gitlab': {\n style = {\n backgroundColor: \"#111\",\n textColor: \"#fff\",\n border: \"1px solid #333\",\n name: \"Gitlab\",\n icon: <BrandIcons.Gitlab iconSize={iconSize} />,\n };\n break;\n }\n case 'apple': {\n style = {\n backgroundColor: \"#000\",\n textColor: \"#fff\",\n border: \"1px solid #333\",\n name: \"Apple\",\n icon: <BrandIcons.Apple iconSize={iconSize} />,\n };\n break;\n }\n case \"bitbucket\": {\n style = {\n backgroundColor: \"#fff\",\n textColor: \"#000\",\n border: \"1px solid #ddd\",\n name: \"Bitbucket\",\n icon: <BrandIcons.Bitbucket iconSize={iconSize} />,\n };\n break;\n }\n case 'linkedin': {\n style = {\n backgroundColor: \"#0073b1\",\n textColor: \"#fff\",\n name: \"LinkedIn\",\n icon: <BrandIcons.LinkedIn iconSize={iconSize} />,\n };\n break;\n }\n case 'x': {\n style = {\n backgroundColor: \"#000\",\n textColor: \"#fff\",\n name: \"X\",\n icon: <BrandIcons.X iconSize={iconSize} />,\n };\n break;\n }\n case 'twitch': {\n style = {\n backgroundColor: \"#6441a5\",\n textColor: \"#fff\",\n name: \"Twitch\",\n icon: <BrandIcons.Twitch iconSize={iconSize} />,\n };\n break;\n }\n default: {\n style = {\n name: provider,\n icon: null,\n };\n }\n }\n\n const styleSheet = `\n .stack-oauth-button-${styleId} {\n background-color: ${style.backgroundColor} !important;\n color: ${style.textColor} !important;\n border: ${style.border} !important;\n }\n .stack-oauth-button-${styleId}:hover {\n background-color: ${changeColor(Color(style.backgroundColor), 10)} !important;\n }\n `;\n\n return (\n <>\n <style>{styleSheet}</style>\n <SimpleTooltip\n disabled={!isIframe}\n tooltip={isIframe ? \"This auth provider is not supported in an iframe for security reasons.\" : undefined}\n className='stack-scope w-full inline-flex'\n >\n <Button\n onClick={async () => {\n // Hexclave rebrand: UI hint key — straight rename (dot delimiter preserved).\n localStorage.setItem('_HEXCLAVE.lastUsed', provider);\n await (onAuthenticate ? onAuthenticate() : stackApp.signInWithOAuth(provider));\n }}\n className={`stack-oauth-button-${styleId} stack-scope relative w-full`}\n disabled={isIframe}\n >\n {!isMock && lastUsed === provider && (\n <span className=\"absolute -top-2 -right-2 bg-blue-500 text-white text-xs px-2 py-1 rounded-md\">\n last\n </span>\n )}\n <div className='flex items-center w-full gap-4'>\n {style.icon}\n <span className='flex-1'>\n {type === 'sign-up' ?\n t('Sign up with {provider}', { provider: style.name }) :\n t('Sign in with {provider}', { provider: style.name })\n }\n </span>\n </div>\n </Button>\n </SimpleTooltip>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;AAeA,MAAM,WAAW;AAEjB,MAAM,eAAe,GAAkB,UAAkB;AACvD,KAAI,EAAE,SAAS,CACb,SAAQ,CAAC;AAEX,QAAO,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,aAAa,EAAE,EAAE,WAAW,GAAG,MAAM,CAAC,UAAU;;AAG1E,SAAgB,YAAY,EAC1B,UACA,MACA,SAAS,OACT,kBAMC;CACD,MAAM,EAAE,MAAM,gBAAgB;CAC9B,MAAM,WAAW,aAAa;CAC9B,MAAM,UAAU,OAAO,CAAC,WAAW,KAAK,IAAI;CAC5C,MAAM,WAAW,aAAa;CAE9B,MAAM,CAAC,UAAU,eAAe,SAAwB,KAAK;AAC7D,iBAAgB;AAEd,cAAY,aAAa,QAAQ,qBAAqB,CAAC;IACtD,EAAE,CAAC;CAEN,IAAI;AAOJ,SAAQ,UAAR;EACE,KAAK;AACH,WAAQ;IACN,iBAAiB;IACjB,WAAW;IACX,MAAM;IACN,QAAQ;IACR,MAA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IACN,MAAM,oBAAC,WAAW,UAAiB,WAAY;IAChD;AACD;EAEF,QACE,SAAQ;GACN,MAAM;GACN,MAAM;GACP;;AAeL,QACE,4CACE,oBAAC,qBAbc;0BACK,QAAQ;0BACR,MAAM,gBAAgB;eACjC,MAAM,UAAU;gBACf,MAAM,OAAO;;0BAEH,QAAQ;0BACR,YAAY,MAAM,MAAM,gBAAgB,EAAE,GAAG,CAAC;;MAMvC,EAC3B,oBAAC;EACC,UAAU,CAAC;EACX,SAAS,WAAW,2EAA2E;EAC/F,WAAU;YAEV,qBAAC;GACC,SAAS,YAAY;AAEnB,iBAAa,QAAQ,sBAAsB,SAAS;AACpD,WAAO,iBAAiB,gBAAgB,GAAG,SAAS,gBAAgB,SAAS;;GAE/E,WAAW,sBAAsB,QAAQ;GACzC,UAAU;cAET,CAAC,UAAU,aAAa,YACvB,oBAAC;IAAK,WAAU;cAA+E;KAExF,EAET,qBAAC;IAAI,WAAU;eACZ,MAAM,MACP,oBAAC;KAAK,WAAU;eACb,SAAS,YACV,EAAE,2BAA2B,EAAE,UAAU,MAAM,MAAM,CAAC,GACtD,EAAE,2BAA2B,EAAE,UAAU,MAAM,MAAM,CAAC;MAEjD;KACH;IACC;GACK,IACf"}
@@ -1,11 +1,11 @@
1
1
  'use client';
2
2
 
3
3
  import { Button } from "@hexclave/ui";
4
+ import { KeyRound } from "lucide-react";
4
5
  import { useId } from "react";
5
6
  import { useStackApp } from "../index.js";
6
7
  import { useTranslation } from "../lib/translations.js";
7
8
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
- import { KeyRound } from "lucide-react";
9
9
 
10
10
  //#region src/components/passkey-button.tsx
11
11
  function PasskeyButton({ type }) {
@@ -1,9 +1,9 @@
1
1
  import { runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
2
2
  import { Button, Slider, Typography } from "@hexclave/ui";
3
+ import { Upload } from "lucide-react";
3
4
  import { useCallback, useState } from "react";
4
5
  import { useTranslation } from "../lib/translations.js";
5
6
  import { jsx, jsxs } from "react/jsx-runtime";
6
- import { Upload } from "lucide-react";
7
7
  import { fileToBase64 } from "@hexclave/shared/dist/utils/base64";
8
8
  import imageCompression from "browser-image-compression";
9
9
  import Cropper from "react-easy-crop";
@@ -1,6 +1,6 @@
1
1
  import { Avatar, AvatarImage, Typography } from "@hexclave/ui";
2
- import { jsx } from "react/jsx-runtime";
3
2
  import { User2 } from "lucide-react";
3
+ import { jsx } from "react/jsx-runtime";
4
4
 
5
5
  //#region src/components/team-icon.tsx
6
6
  function TeamIcon(props) {
@@ -1,13 +1,13 @@
1
1
  'use client';
2
2
 
3
- import { HexclaveAssertionError } from "@hexclave/shared/dist/utils/errors";
4
3
  import { runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
5
4
  import { Button, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Skeleton, Typography, cn } from "@hexclave/ui";
5
+ import { PlusCircle, Settings } from "lucide-react";
6
6
  import { Suspense, useMemo } from "react";
7
7
  import { useStackApp, useUser } from "../index.js";
8
8
  import { useTranslation } from "../lib/translations.js";
9
9
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
- import { PlusCircle, Settings } from "lucide-react";
10
+ import { HexclaveAssertionError } from "@hexclave/shared/dist/utils/errors";
11
11
  import { TeamIcon } from "./team-icon.js";
12
12
 
13
13
  //#region src/components/team-switcher.tsx
@@ -2,11 +2,11 @@
2
2
 
3
3
  import { runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
4
4
  import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, Skeleton, Typography } from "@hexclave/ui";
5
+ import { CircleUser, LogIn, LogOut, SunMoon, UserPlus } from "lucide-react";
5
6
  import React, { Suspense } from "react";
6
7
  import { useStackApp, useUser } from "../index.js";
7
8
  import { useTranslation } from "../lib/translations.js";
8
9
  import { jsx, jsxs } from "react/jsx-runtime";
9
- import { CircleUser, LogIn, LogOut, SunMoon, UserPlus } from "lucide-react";
10
10
  import { UserAvatar } from "./elements/user-avatar.js";
11
11
 
12
12
  //#region src/components/user-button.tsx
@@ -1,8 +1,8 @@
1
- import { captureError } from "@hexclave/shared/dist/utils/errors";
2
1
  import { runAsynchronously } from "@hexclave/shared/dist/utils/promises";
3
2
  import { ActionCell, Badge, Button, Skeleton, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Typography } from "@hexclave/ui";
4
3
  import { useEffect, useState } from "react";
5
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { captureError } from "@hexclave/shared/dist/utils/errors";
6
6
  import { fromNow } from "@hexclave/shared/dist/utils/dates";
7
7
  import { useUser } from "../../../lib/hooks.js";
8
8
  import { useTranslation } from "../../../lib/translations.js";
@@ -1,7 +1,7 @@
1
1
  import { Button, Input, Typography } from "@hexclave/ui";
2
+ import { Edit } from "lucide-react";
2
3
  import { useState } from "react";
3
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
- import { Edit } from "lucide-react";
5
5
  import { useTranslation } from "../../lib/translations.js";
6
6
 
7
7
  //#region src/components-page/account-settings/editable-text.tsx
@@ -1,10 +1,10 @@
1
- import { yupResolver } from "@hookform/resolvers/yup";
2
- import { strictEmailSchema, yupObject } from "@hexclave/shared/dist/schema-fields";
3
1
  import { runAsynchronously } from "@hexclave/shared/dist/utils/promises";
4
2
  import { ActionCell, Badge, Button, Input, Table, TableBody, TableCell, TableRow, Typography } from "@hexclave/ui";
5
3
  import { useEffect, useState } from "react";
6
- import { useForm } from "react-hook-form";
7
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { yupResolver } from "@hookform/resolvers/yup";
6
+ import { strictEmailSchema, yupObject } from "@hexclave/shared/dist/schema-fields";
7
+ import { useForm } from "react-hook-form";
8
8
  import { useUser } from "../../../lib/hooks.js";
9
9
  import { useTranslation } from "../../../lib/translations.js";
10
10
  import { KnownErrors } from "@hexclave/shared/dist/known-errors";
@@ -1,8 +1,8 @@
1
- import { throwErr } from "@hexclave/shared/dist/utils/errors";
2
1
  import { runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
3
2
  import { Button, Input, Typography } from "@hexclave/ui";
4
3
  import { useEffect, useState } from "react";
5
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ import { throwErr } from "@hexclave/shared/dist/utils/errors";
6
6
  import { useStackApp, useUser } from "../../../lib/hooks.js";
7
7
  import { useTranslation } from "../../../lib/translations.js";
8
8
  import { createTOTPKeyURI, verifyTOTP } from "@oslojs/otp";
@@ -1,10 +1,10 @@
1
- import { yupResolver } from "@hookform/resolvers/yup";
2
- import { passwordSchema, yupObject, yupString } from "@hexclave/shared/dist/schema-fields";
3
1
  import { runAsynchronously, runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
4
2
  import { Button, Input, Label, PasswordInput, Typography } from "@hexclave/ui";
5
3
  import { useState } from "react";
6
- import { useForm } from "react-hook-form";
7
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ import { yupResolver } from "@hookform/resolvers/yup";
6
+ import { passwordSchema, yupObject, yupString } from "@hexclave/shared/dist/schema-fields";
7
+ import { useForm } from "react-hook-form";
8
8
  import { getPasswordError } from "@hexclave/shared/dist/helpers/password";
9
9
  import * as yup from "yup";
10
10
  import { useUser } from "../../../lib/hooks.js";
@@ -1,7 +1,7 @@
1
- import { HexclaveAssertionError } from "@hexclave/shared/dist/utils/errors";
2
1
  import { Button } from "@hexclave/ui";
3
2
  import { useState } from "react";
4
3
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ import { HexclaveAssertionError } from "@hexclave/shared/dist/utils/errors";
5
5
  import { useStackApp, useUser } from "../../../lib/hooks.js";
6
6
  import { useTranslation } from "../../../lib/translations.js";
7
7
  import { CreateApiKeyDialog, ShowApiKeyDialog } from "../../../components/api-key-dialogs.js";
@@ -1,10 +1,10 @@
1
- import { yupResolver } from "@hookform/resolvers/yup";
2
- import { yupObject, yupString } from "@hexclave/shared/dist/schema-fields";
3
1
  import { runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
4
2
  import { Button, Input } from "@hexclave/ui";
5
3
  import { useState } from "react";
6
- import { useForm } from "react-hook-form";
7
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { yupResolver } from "@hookform/resolvers/yup";
6
+ import { yupObject, yupString } from "@hexclave/shared/dist/schema-fields";
7
+ import { useForm } from "react-hook-form";
8
8
  import { useStackApp, useUser } from "../../../lib/hooks.js";
9
9
  import { useTranslation } from "../../../lib/translations.js";
10
10
  import { PageLayout } from "../page-layout.js";
@@ -1,11 +1,11 @@
1
- import { yupResolver } from "@hookform/resolvers/yup";
2
- import { strictEmailSchema, yupObject } from "@hexclave/shared/dist/schema-fields";
3
1
  import { runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
4
2
  import { Button, Input, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Typography } from "@hexclave/ui";
3
+ import { Trash } from "lucide-react";
5
4
  import { useEffect, useState } from "react";
6
- import { useForm } from "react-hook-form";
7
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
- import { Trash } from "lucide-react";
6
+ import { yupResolver } from "@hookform/resolvers/yup";
7
+ import { strictEmailSchema, yupObject } from "@hexclave/shared/dist/schema-fields";
8
+ import { useForm } from "react-hook-form";
9
9
  import { useUser } from "../../../lib/hooks.js";
10
10
  import { useTranslation } from "../../../lib/translations.js";
11
11
  import { FormWarningText } from "../../../components/elements/form-warning.js";
@@ -1,6 +1,6 @@
1
+ import * as lucide_react0 from "lucide-react";
1
2
  import React from "react";
2
3
  import * as react_jsx_runtime0 from "react/jsx-runtime";
3
- import * as lucide_react0 from "lucide-react";
4
4
 
5
5
  //#region src/components-page/account-settings.d.ts
6
6
  declare const iconMap: {
@@ -2,14 +2,13 @@
2
2
 
3
3
  import { runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
4
4
  import { Skeleton, Typography } from "@hexclave/ui";
5
+ import { Bell, CirclePlus, Contact, CreditCard, Key, Monitor, Settings, ShieldCheck } from "lucide-react";
5
6
  import React, { Suspense, useEffect, useMemo, useRef, useState } from "react";
6
7
  import { useStackApp, useUser } from "../index.js";
7
- import { useTranslation } from "../lib/translations.js";
8
- import { jsx, jsxs } from "react/jsx-runtime";
9
- import { Bell, CirclePlus, Contact, CreditCard, Key, Monitor, Settings, ShieldCheck } from "lucide-react";
10
8
  import { MaybeFullPage } from "../components/elements/maybe-full-page.js";
11
9
  import { SidebarLayout } from "../components/elements/sidebar-layout.js";
12
10
  import { TeamIcon } from "../components/team-icon.js";
11
+ import { useTranslation } from "../lib/translations.js";
13
12
  import { ActiveSessionsPage } from "./account-settings/active-sessions/active-sessions-page.js";
14
13
  import { ApiKeysPage } from "./account-settings/api-keys/api-keys-page.js";
15
14
  import { EmailsAndAuthPage } from "./account-settings/email-and-auth/email-and-auth-page.js";
@@ -19,6 +18,7 @@ import { PaymentsPage } from "./account-settings/payments/payments-page.js";
19
18
  import { SettingsPage } from "./account-settings/settings/settings-page.js";
20
19
  import { TeamCreationPage } from "./account-settings/teams/team-creation-page.js";
21
20
  import { TeamPage } from "./account-settings/teams/team-page.js";
21
+ import { jsx, jsxs } from "react/jsx-runtime";
22
22
 
23
23
  //#region src/components-page/account-settings.tsx
24
24
  const iconMap = {
@@ -4,9 +4,9 @@ import { runAsynchronously } from "@hexclave/shared/dist/utils/promises";
4
4
  import { Skeleton, Tabs, TabsContent, TabsList, TabsTrigger, Typography, cn } from "@hexclave/ui";
5
5
  import { Suspense } from "react";
6
6
  import { useStackApp, useUser } from "../index.js";
7
+ import { MaybeFullPage } from "../components/elements/maybe-full-page.js";
7
8
  import { useTranslation } from "../lib/translations.js";
8
9
  import { jsx, jsxs } from "react/jsx-runtime";
9
- import { MaybeFullPage } from "../components/elements/maybe-full-page.js";
10
10
  import { CredentialSignIn } from "../components/credential-sign-in.js";
11
11
  import { CredentialSignUp } from "../components/credential-sign-up.js";
12
12
  import { SeparatorWithText } from "../components/elements/separator-with-text.js";
@@ -5,9 +5,9 @@ import { Typography } from "@hexclave/ui";
5
5
  import { useCallback, useEffect, useRef, useState } from "react";
6
6
  import { useTranslation } from "../lib/translations.js";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
- import { useStackApp } from "../lib/hooks.js";
9
8
  import { stackAppInternalsSymbol } from "../lib/stack-app/common.js";
10
9
  import { MessageCard } from "../components/message-cards/message-card.js";
10
+ import { useStackApp } from "../lib/hooks.js";
11
11
 
12
12
  //#region src/components-page/cli-auth-confirm.tsx
13
13
  async function postCliAuthComplete(app, body) {
@@ -1,12 +1,12 @@
1
1
  'use client';
2
2
 
3
- import { throwErr } from "@hexclave/shared/dist/utils/errors";
4
3
  import React from "react";
5
4
  import { useStackApp, useUser } from "../index.js";
6
5
  import { useTranslation } from "../lib/translations.js";
7
6
  import { jsx } from "react/jsx-runtime";
8
- import { KnownErrors } from "@hexclave/shared";
9
7
  import { MessageCard as MessageCard$1 } from "../components/message-cards/message-card.js";
8
+ import { KnownErrors } from "@hexclave/shared";
9
+ import { throwErr } from "@hexclave/shared/dist/utils/errors";
10
10
 
11
11
  //#region src/components-page/email-verification.tsx
12
12
  function EmailVerification(props) {