@hexclave/react 1.0.27 → 1.0.29

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 (43) hide show
  1. package/dist/components-page/account-settings/email-and-auth/emails-section.js +1 -1
  2. package/dist/components-page/account-settings/email-and-auth/mfa-section.js +1 -1
  3. package/dist/components-page/account-settings/email-and-auth/passkey-section.js +1 -1
  4. package/dist/components-page/account-settings/email-and-auth/password-section.js +2 -2
  5. package/dist/components-page/account-settings/payments/payments-panel.js +1 -1
  6. package/dist/components-page/account-settings/teams/team-creation-page.js +1 -1
  7. package/dist/components-page/account-settings/teams/team-member-invitation-section.js +1 -1
  8. package/dist/dev-tool/dev-tool-core.js +1 -1
  9. package/dist/dev-tool/dev-tool-core.js.map +1 -1
  10. package/dist/esm/components-page/account-settings/email-and-auth/emails-section.js +1 -1
  11. package/dist/esm/components-page/account-settings/email-and-auth/mfa-section.js +1 -1
  12. package/dist/esm/components-page/account-settings/email-and-auth/passkey-section.js +1 -1
  13. package/dist/esm/components-page/account-settings/email-and-auth/password-section.js +2 -2
  14. package/dist/esm/components-page/account-settings/payments/payments-panel.js +1 -1
  15. package/dist/esm/components-page/account-settings/teams/team-creation-page.js +1 -1
  16. package/dist/esm/components-page/account-settings/teams/team-member-invitation-section.js +1 -1
  17. package/dist/esm/dev-tool/dev-tool-core.js +1 -1
  18. package/dist/esm/dev-tool/dev-tool-core.js.map +1 -1
  19. package/dist/esm/generated/quetzal-translations.d.ts +2 -2
  20. package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts.map +1 -1
  21. package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.js +6 -1
  22. package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.js.map +1 -1
  23. package/dist/esm/lib/hexclave-app/apps/implementations/common.js +1 -1
  24. package/dist/esm/pushed-config-error-overlay/index.js +1 -1
  25. package/dist/esm/pushed-config-error-overlay/index.js.map +1 -1
  26. package/dist/esm/pushed-config-error-overlay/index.test.d.ts +1 -0
  27. package/dist/esm/pushed-config-error-overlay/index.test.js +67 -0
  28. package/dist/esm/pushed-config-error-overlay/index.test.js.map +1 -0
  29. package/dist/generated/quetzal-translations.d.ts +2 -2
  30. package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts.map +1 -1
  31. package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.js +6 -1
  32. package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.js.map +1 -1
  33. package/dist/lib/hexclave-app/apps/implementations/common.js +1 -1
  34. package/dist/pushed-config-error-overlay/index.js +1 -1
  35. package/dist/pushed-config-error-overlay/index.js.map +1 -1
  36. package/dist/pushed-config-error-overlay/index.test.d.ts +1 -0
  37. package/dist/pushed-config-error-overlay/index.test.js +67 -0
  38. package/dist/pushed-config-error-overlay/index.test.js.map +1 -0
  39. package/package.json +4 -4
  40. package/src/dev-tool/dev-tool-core.ts +1 -1
  41. package/src/lib/hexclave-app/apps/implementations/admin-app-impl.ts +2 -1
  42. package/src/pushed-config-error-overlay/index.test.ts +76 -0
  43. package/src/pushed-config-error-overlay/index.ts +4 -1
@@ -1 +1 @@
1
- {"version":3,"file":"admin-app-impl.d.ts","names":[],"sources":["../../../../../../src/lib/hexclave-app/apps/implementations/admin-app-impl.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwCK,iBAAA,GAAoB,OAAA,CAAQ,UAAA,CAAW,sBAAA;AAAA,cAqC/B,+BAAA,kEAAiG,gCAAA,CAAiC,aAAA,EAAe,SAAA,aAAsB,aAAA,CAAc,aAAA,EAAe,SAAA;EAAA,UAC7L,UAAA,EAAY,sBAAA;EAAA,iBAEb,kBAAA;EAAA,iBAGA,eAAA;EAAA,iBAGA,qBAAA;EAAA,iBAIA,qBAAA;EAAA,iBAGA,sBAAA;EAAA,iBAGA,yBAAA;EAAA,iBAGA,sBAAA;EAAA,iBAGA,oCAAA;EAAA,iBAGA,uCAAA;EAA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Ac,wBAAA;EAAA,GACd,KAAA,YACC,OAAA;IACD,aAAA,EAAe,KAAA;MACb,EAAA;MACA,WAAA;MACA,YAAA;MACA,gBAAA,EAAkB,gBAAA;IAAA;IAEpB,kBAAA;EAAA;AAAA"}
@@ -666,7 +666,12 @@ var _HexclaveAdminAppImplIncomplete = class extends _HexclaveServerAppImplIncomp
666
666
  return result;
667
667
  }
668
668
  async getEmailPreview(options) {
669
- return (await this._interface.renderEmailPreview(options)).html;
669
+ return Result.orThrow(await this._emailPreviewCache.getOrWait([
670
+ options.themeId,
671
+ options.themeTsxSource,
672
+ options.templateId,
673
+ options.templateTsxSource
674
+ ], "write-only")).html;
670
675
  }
671
676
  useEmailPreview(options) {
672
677
  return useAsyncCache(this._emailPreviewCache, [
@@ -1 +1 @@
1
- {"version":3,"file":"admin-app-impl.js","names":[],"sources":["../../../../../../src/lib/hexclave-app/apps/implementations/admin-app-impl.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { KnownErrors, HexclaveAdminInterface } from \"@hexclave/shared\";\nimport { getProductionModeErrors } from \"@hexclave/shared/dist/helpers/production-mode\";\nimport { InternalApiKeyCreateCrudResponse } from \"@hexclave/shared/dist/interface/admin-interface\";\nimport type { AnalyticsClickmapOptions, AnalyticsClickmapResponse, AnalyticsClickmapTokenResponse, MetricsResponse, MetricsUserCounts, UserActivityResponse } from \"@hexclave/shared/dist/interface/admin-metrics\";\nimport { AnalyticsQueryOptions, AnalyticsQueryResponse } from \"@hexclave/shared/dist/interface/crud/analytics\";\nimport { EmailTemplateCrud } from \"@hexclave/shared/dist/interface/crud/email-templates\";\nimport { InternalApiKeysCrud } from \"@hexclave/shared/dist/interface/crud/internal-api-keys\";\nimport { ProjectsCrud } from \"@hexclave/shared/dist/interface/crud/projects\";\nimport type { AdminGetSessionReplayChunkEventsResponse } from \"@hexclave/shared/dist/interface/crud/session-replays\";\nimport type { Transaction, TransactionType } from \"@hexclave/shared/dist/interface/crud/transactions\";\nimport type { RestrictedReason } from \"@hexclave/shared/dist/schema-fields\";\nimport type { MoneyAmount } from \"@hexclave/shared/dist/utils/currency-constants\";\nimport { HexclaveAssertionError, throwErr } from \"@hexclave/shared/dist/utils/errors\";\nimport type { Json } from \"@hexclave/shared/dist/utils/json\";\nimport { pick, typedEntries, typedValues } from \"@hexclave/shared/dist/utils/objects\";\nimport { Result } from \"@hexclave/shared/dist/utils/results\";\nimport { useMemo } from \"react\"; // THIS_LINE_PLATFORM react-like\nimport { AdminEmailOutbox, AdminSentEmail } from \"../..\";\nimport { EmailConfig, hexclaveAppInternalsSymbol } from \"../../common\";\nimport { AdminEmailTemplate } from \"../../email-templates\";\nimport { InternalApiKey, InternalApiKeyBase, InternalApiKeyBaseCrudRead, InternalApiKeyCreateOptions, InternalApiKeyFirstView, internalApiKeyCreateOptionsToCrud } from \"../../internal-api-keys\";\nimport { AdminProjectPermission, AdminProjectPermissionDefinition, AdminProjectPermissionDefinitionCreateOptions, AdminProjectPermissionDefinitionUpdateOptions, AdminTeamPermission, AdminTeamPermissionDefinition, AdminTeamPermissionDefinitionCreateOptions, AdminTeamPermissionDefinitionUpdateOptions, adminProjectPermissionDefinitionCreateOptionsToCrud, adminProjectPermissionDefinitionUpdateOptionsToCrud, adminTeamPermissionDefinitionCreateOptionsToCrud, adminTeamPermissionDefinitionUpdateOptionsToCrud } from \"../../permissions\";\nimport type { PlanUsage } from \"../../plan-usage\";\nimport { AdminOwnedProject, AdminProject, AdminProjectUpdateOptions, PushConfigOptions, adminProjectUpdateOptionsToCrud } from \"../../projects\";\nimport type { AdminSessionReplay, AdminSessionReplayChunk, ListSessionReplayChunksOptions, ListSessionReplayChunksResult, ListSessionReplaysOptions, ListSessionReplaysResult, SessionReplayAllEventsResult } from \"../../session-replays\";\nimport { ManagedEmailProviderListItem, ManagedEmailProviderSetupResult, ManagedEmailProviderStatus, EmailOutboxUpdateOptions, StackAdminApp, StackAdminAppConstructorOptions } from \"../interfaces/admin-app\";\nimport { clientVersion, createCache, getDefaultExtraRequestHeaders, getDefaultProjectId, getDefaultPublishableClientKey, getDefaultSecretServerKey, getDefaultSuperSecretAdminKey, resolveApiUrls, resolveConstructorOptions } from \"./common\";\nimport { _HexclaveServerAppImplIncomplete } from \"./server-app-impl\";\n\nimport { CompleteConfig, EnvironmentConfigOverrideOverride } from \"@hexclave/shared/dist/config/schema\";\nimport { branchConfigSourceSchema } from \"@hexclave/shared/dist/schema-fields\";\nimport * as yup from \"yup\";\nimport { PushedConfigSource } from \"../../projects\";\nimport { useAsyncCache } from \"./common\"; // THIS_LINE_PLATFORM react-like\n\ntype BranchConfigSourceApi = yup.InferType<typeof branchConfigSourceSchema>;\ntype PlanUsageResponse = Awaited<ReturnType<HexclaveAdminInterface[\"getPlanUsage\"]>>;\n/**\n * Converts a PushedConfigSource (SDK camelCase) to BranchConfigSourceApi (API snake_case).\n */\nfunction pushedConfigSourceToApi(source: PushedConfigSource): BranchConfigSourceApi {\n if (source.type === \"pushed-from-github\") {\n return {\n type: \"pushed-from-github\",\n owner: source.owner,\n repo: source.repo,\n branch: source.branch,\n commit_hash: source.commitHash,\n config_file_path: source.configFilePath,\n workflow_path: source.workflowPath,\n };\n }\n return source;\n}\n\n/**\n * Converts a BranchConfigSourceApi (API snake_case) to PushedConfigSource (SDK camelCase).\n */\nfunction apiToPushedConfigSource(source: BranchConfigSourceApi): PushedConfigSource {\n if (source.type === \"pushed-from-github\") {\n return {\n type: \"pushed-from-github\",\n owner: source.owner,\n repo: source.repo,\n branch: source.branch,\n commitHash: source.commit_hash,\n configFilePath: source.config_file_path,\n workflowPath: source.workflow_path,\n };\n }\n return source;\n}\n\nexport class _HexclaveAdminAppImplIncomplete<HasTokenStore extends boolean, ProjectId extends string> extends _HexclaveServerAppImplIncomplete<HasTokenStore, ProjectId> implements StackAdminApp<HasTokenStore, ProjectId> {\n declare protected _interface: HexclaveAdminInterface;\n\n private readonly _adminProjectCache = createCache(async () => {\n return await this._interface.getProject();\n });\n private readonly _planUsageCache = createCache(async () => {\n return await this._interface.getPlanUsage();\n });\n private readonly _internalApiKeysCache = createCache(async () => {\n const res = await this._interface.listInternalApiKeys();\n return res;\n });\n private readonly _adminEmailThemeCache = createCache(async ([id]: [string]) => {\n return await this._interface.getEmailTheme(id);\n });\n private readonly _adminEmailThemesCache = createCache(async () => {\n return await this._interface.listEmailThemes();\n });\n private readonly _adminEmailTemplatesCache = createCache(async () => {\n return await this._interface.listInternalEmailTemplates();\n });\n private readonly _adminEmailDraftsCache = createCache(async () => {\n return await this._interface.listInternalEmailDrafts();\n });\n private readonly _adminTeamPermissionDefinitionsCache = createCache(async () => {\n return await this._interface.listTeamPermissionDefinitions();\n });\n private readonly _adminProjectPermissionDefinitionsCache = createCache(async () => {\n return await this._interface.listProjectPermissionDefinitions();\n });\n private readonly _svixTokenCache = createCache(async () => {\n return await this._interface.getSvixToken();\n });\n // Cache key serializes filters via URLSearchParams (sorted keys) so\n // DependenciesMap (identity-keyed per array slot) treats two equal\n // filter objects as the same deterministic string entry.\n private readonly _metricsCache = createCache(async ([includeAnonymous, filtersKey]: [boolean, string]) => {\n const filters = filtersKey ? Object.fromEntries(new URLSearchParams(filtersKey)) : undefined;\n return await this._interface.getMetrics(includeAnonymous, filters);\n });\n private readonly _userActivityCache = createCache(async ([userId]: [string]) => {\n return await this._interface.getUserActivity(userId);\n });\n private readonly _metricsUserCountsCache = createCache(async () => {\n return await this._interface.getMetricsUserCounts();\n });\n private readonly _emailPreviewCache = createCache(async ([themeId, themeTsxSource, templateId, templateTsxSource]: [string | null | false | undefined, string | undefined, string | undefined, string | undefined]) => {\n return await this._interface.renderEmailPreview({ themeId, themeTsxSource, templateId, templateTsxSource });\n });\n private readonly _emailPreviewWithEditableMarkersCache = createCache(async ([themeId, themeTsxSource, templateId, templateTsxSource, editableSource]: [string | null | false | undefined, string | undefined, string | undefined, string | undefined, 'template' | 'theme' | 'both' | undefined]) => {\n return await this._interface.renderEmailPreview({ themeId, themeTsxSource, templateId, templateTsxSource, editableMarkers: true, editableSource });\n });\n private readonly _configOverridesCache = createCache(async () => {\n return await this._interface.getConfig();\n });\n private readonly _stripeAccountInfoCache = createCache(async () => {\n try {\n return await this._interface.getStripeAccountInfo();\n } catch (error: any) {\n if (error?.status === 404) {\n return null;\n }\n throw error;\n }\n });\n private readonly _transactionsCache = createCache(async ([cursor, limit, type, customerType, customerId]: [string | undefined, number | undefined, TransactionType | undefined, 'user' | 'team' | 'custom' | undefined, string | undefined]) => {\n return await this._interface.listTransactions({ cursor, limit, type, customerType, customerId });\n });\n\n constructor(options: StackAdminAppConstructorOptions<HasTokenStore, ProjectId>, extraOptions?: { uniqueIdentifier?: string, checkString?: string, interface?: HexclaveAdminInterface }) {\n const resolvedOptions = resolveConstructorOptions(options);\n\n const publishableClientKey = resolvedOptions.publishableClientKey ?? getDefaultPublishableClientKey();\n\n super(resolvedOptions, {\n ...extraOptions,\n interface: extraOptions?.interface ?? (() => {\n const apiUrls = resolveApiUrls(resolvedOptions.baseUrl);\n return new HexclaveAdminInterface({\n getBaseUrl: () => apiUrls()[0],\n getApiUrls: apiUrls,\n projectId: resolvedOptions.projectId ?? getDefaultProjectId(),\n extraRequestHeaders: resolvedOptions.extraRequestHeaders ?? getDefaultExtraRequestHeaders(),\n clientVersion,\n ...resolvedOptions.projectOwnerSession ? {\n projectOwnerSession: resolvedOptions.projectOwnerSession,\n } : {\n ...(publishableClientKey ? { publishableClientKey } : {}),\n secretServerKey: resolvedOptions.secretServerKey ?? getDefaultSecretServerKey(),\n superSecretAdminKey: resolvedOptions.superSecretAdminKey ?? getDefaultSuperSecretAdminKey(),\n },\n });\n })(),\n });\n }\n\n _adminConfigFromCrud(data: { config_string: string }): CompleteConfig {\n return JSON.parse(data.config_string);\n }\n\n _adminOwnedProjectFromCrud(data: ProjectsCrud['Admin']['Read'], onRefresh: () => Promise<void>): AdminOwnedProject {\n if (this._tokenStoreInit !== null) {\n throw new HexclaveAssertionError(\"Owned apps must always have tokenStore === null — did you not create this project with app._createOwnedApp()?\");\n }\n return {\n ...this._adminProjectFromCrud(data, onRefresh),\n app: this as StackAdminApp<false>,\n };\n }\n\n _adminProjectFromCrud(data: ProjectsCrud['Admin']['Read'], onRefresh: () => Promise<void>): AdminProject {\n if (data.id !== this.projectId) {\n throw new HexclaveAssertionError(`The project ID of the provided project JSON (${data.id}) does not match the project ID of the app (${this.projectId})!`);\n }\n\n const app = this;\n return {\n id: data.id,\n displayName: data.display_name,\n description: data.description,\n createdAt: new Date(data.created_at_millis),\n isProductionMode: data.is_production_mode,\n isDevelopmentEnvironment: data.is_development_environment,\n ownerTeamId: data.owner_team_id,\n onboardingStatus: data.onboarding_status,\n onboardingState: data.onboarding_state ?? null,\n logoUrl: data.logo_url,\n logoFullUrl: data.logo_full_url,\n logoDarkModeUrl: data.logo_dark_mode_url,\n logoFullDarkModeUrl: data.logo_full_dark_mode_url,\n pushedConfigError: data.pushed_config_error == null ? null : {\n message: data.pushed_config_error.message,\n },\n configWarnings: data.config_warnings.map((warning) => ({\n message: warning.message,\n })),\n config: {\n signUpEnabled: data.config.sign_up_enabled,\n credentialEnabled: data.config.credential_enabled,\n magicLinkEnabled: data.config.magic_link_enabled,\n passkeyEnabled: data.config.passkey_enabled,\n clientTeamCreationEnabled: data.config.client_team_creation_enabled,\n clientUserDeletionEnabled: data.config.client_user_deletion_enabled,\n allowLocalhost: data.config.allow_localhost,\n oauthAccountMergeStrategy: data.config.oauth_account_merge_strategy,\n allowUserApiKeys: data.config.allow_user_api_keys,\n allowTeamApiKeys: data.config.allow_team_api_keys,\n oauthProviders: data.config.oauth_providers.map((p) => ((p.type === 'shared' ? {\n id: p.id,\n type: 'shared',\n } as const : {\n id: p.id,\n type: 'standard',\n clientId: p.client_id ?? throwErr(\"Client ID is missing\"),\n clientSecret: p.client_secret ?? throwErr(\"Client secret is missing\"),\n facebookConfigId: p.facebook_config_id,\n microsoftTenantId: p.microsoft_tenant_id,\n appleBundleIds: p.apple_bundle_ids,\n } as const))),\n emailConfig: data.config.email_config.type === 'shared' ? {\n type: 'shared'\n } : {\n type: 'standard',\n host: data.config.email_config.host ?? throwErr(\"Email host is missing\"),\n port: data.config.email_config.port ?? throwErr(\"Email port is missing\"),\n username: data.config.email_config.username ?? throwErr(\"Email username is missing\"),\n password: data.config.email_config.password ?? throwErr(\"Email password is missing\"),\n senderName: data.config.email_config.sender_name ?? throwErr(\"Email sender name is missing\"),\n senderEmail: data.config.email_config.sender_email ?? throwErr(\"Email sender email is missing\"),\n },\n emailTheme: data.config.email_theme,\n domains: data.config.domains.map((d) => ({\n domain: d.domain,\n handlerPath: d.handler_path,\n })),\n createTeamOnSignUp: data.config.create_team_on_sign_up,\n teamCreatorDefaultPermissions: data.config.team_creator_default_permissions,\n teamMemberDefaultPermissions: data.config.team_member_default_permissions,\n userDefaultPermissions: data.config.user_default_permissions,\n },\n async getConfig() {\n return app._adminConfigFromCrud(await app._interface.getConfig());\n },\n useConfig() {\n const config = useAsyncCache(app._configOverridesCache, [], \"project.useConfig()\");\n return useMemo(() => app._adminConfigFromCrud(config), [config]);\n },\n async updateConfig(configOverride: EnvironmentConfigOverrideOverride) {\n await app._interface.updateConfigOverride(\"environment\", configOverride);\n await app._refreshProjectConfig();\n },\n async pushConfig(config: EnvironmentConfigOverrideOverride, options: PushConfigOptions) {\n await app._interface.setConfigOverride(\"branch\", config, pushedConfigSourceToApi(options.source));\n await app._refreshProjectConfig();\n },\n async updatePushedConfig(config: EnvironmentConfigOverrideOverride) {\n await app._interface.updateConfigOverride(\"branch\", config);\n await app._refreshProjectConfig();\n },\n async getPushedConfigSource(): Promise<PushedConfigSource> {\n const apiSource = await app._interface.getPushedConfigSource();\n return apiToPushedConfigSource(apiSource);\n },\n async unlinkPushedConfigSource(): Promise<void> {\n await app._interface.unlinkPushedConfigSource();\n await app._refreshProjectConfig();\n },\n async resetConfigOverrideKeys(level: \"branch\" | \"environment\", keys: string[]): Promise<void> {\n await app._interface.resetConfigOverrideKeys(level, keys);\n await app._refreshProjectConfig();\n },\n async getConfigOverride(level: \"branch\" | \"environment\"): Promise<Record<string, unknown>> {\n const result = await app._interface.getConfigOverride(level);\n return JSON.parse(result.config_string);\n },\n async replaceConfigOverride(level: \"branch\" | \"environment\", config: Record<string, unknown>): Promise<void> {\n if (level === \"branch\") {\n const source = await app._interface.getPushedConfigSource();\n await app._interface.setConfigOverride(level, config, source);\n } else {\n await app._interface.setConfigOverride(level, config);\n }\n await app._refreshProjectConfig();\n },\n async update(update: AdminProjectUpdateOptions) {\n const { requirePublishableClientKey, ...projectUpdate } = update;\n const updateOptions = adminProjectUpdateOptionsToCrud(projectUpdate);\n const hasConfigUpdate = !!updateOptions.config\n && typedValues(updateOptions.config).some((value) => value !== undefined);\n const hasProjectUpdate = typedEntries(updateOptions).some(([key, value]) => {\n if (key === \"config\") return hasConfigUpdate;\n return value !== undefined;\n });\n\n if (hasProjectUpdate) {\n await app._interface.updateProject(updateOptions);\n await onRefresh();\n }\n\n if (requirePublishableClientKey !== undefined) {\n await app._interface.updateConfigOverride(\"project\", {\n \"project.requirePublishableClientKey\": requirePublishableClientKey,\n });\n await app._refreshProjectConfig();\n }\n },\n async delete() {\n await app._interface.deleteProject();\n },\n async getProductionModeErrors() {\n return getProductionModeErrors(data);\n },\n useProductionModeErrors() {\n return getProductionModeErrors(data);\n },\n };\n }\n\n _adminEmailTemplateFromCrud(data: EmailTemplateCrud['Admin']['Read']): AdminEmailTemplate {\n return {\n type: data.type,\n subject: data.subject,\n content: data.content,\n isDefault: data.is_default,\n };\n }\n\n _planUsageFromCrud(data: PlanUsageResponse): PlanUsage {\n return {\n ownerTeamId: data.owner_team_id,\n ownerTeamDisplayName: data.owner_team_display_name,\n planId: data.plan_id,\n planDisplayName: data.plan_display_name,\n periodStart: new Date(data.period_start_millis),\n periodEnd: new Date(data.period_end_millis),\n nextPlanId: data.next_plan_id,\n rows: data.rows.map((row) => ({\n itemId: row.item_id,\n displayName: row.display_name,\n kind: row.kind,\n used: row.used,\n limit: row.limit,\n remaining: row.remaining,\n overage: row.overage,\n isUnlimited: row.is_unlimited,\n })),\n };\n }\n\n override async getProject(): Promise<AdminProject> {\n return this._adminProjectFromCrud(\n Result.orThrow(await this._adminProjectCache.getOrWait([], \"write-only\")),\n () => this._refreshProject()\n );\n }\n\n override useProject(): AdminProject {\n const crud = useAsyncCache(this._adminProjectCache, [], \"adminApp.useProject()\");\n return useMemo(() => this._adminProjectFromCrud(\n crud,\n () => this._refreshProject()\n ), [crud]);\n }\n\n async getPlanUsage(): Promise<PlanUsage> {\n return this._planUsageFromCrud(Result.orThrow(await this._planUsageCache.getOrWait([], \"write-only\")));\n }\n\n usePlanUsage(): PlanUsage {\n const crud = useAsyncCache(this._planUsageCache, [], \"adminApp.usePlanUsage()\");\n return useMemo(() => this._planUsageFromCrud(crud), [crud]);\n }\n\n protected _createInternalApiKeyBaseFromCrud(data: InternalApiKeyBaseCrudRead): InternalApiKeyBase {\n const app = this;\n return {\n id: data.id,\n description: data.description,\n expiresAt: new Date(data.expires_at_millis),\n manuallyRevokedAt: data.manually_revoked_at_millis ? new Date(data.manually_revoked_at_millis) : null,\n createdAt: new Date(data.created_at_millis),\n isValid() {\n return this.whyInvalid() === null;\n },\n whyInvalid() {\n if (this.expiresAt.getTime() < Date.now()) return \"expired\";\n if (this.manuallyRevokedAt) return \"manually-revoked\";\n return null;\n },\n async revoke() {\n const res = await app._interface.revokeInternalApiKeyById(data.id);\n await app._refreshInternalApiKeys();\n return res;\n }\n };\n }\n\n protected _createInternalApiKeyFromCrud(data: InternalApiKeysCrud[\"Admin\"][\"Read\"]): InternalApiKey {\n return {\n ...this._createInternalApiKeyBaseFromCrud(data),\n publishableClientKey: data.publishable_client_key ? { lastFour: data.publishable_client_key.last_four } : null,\n secretServerKey: data.secret_server_key ? { lastFour: data.secret_server_key.last_four } : null,\n superSecretAdminKey: data.super_secret_admin_key ? { lastFour: data.super_secret_admin_key.last_four } : null,\n };\n }\n\n protected _createInternalApiKeyFirstViewFromCrud(data: InternalApiKeyCreateCrudResponse): InternalApiKeyFirstView {\n return {\n ...this._createInternalApiKeyBaseFromCrud(data),\n publishableClientKey: data.publishable_client_key,\n secretServerKey: data.secret_server_key,\n superSecretAdminKey: data.super_secret_admin_key,\n };\n }\n\n async listInternalApiKeys(): Promise<InternalApiKey[]> {\n const crud = Result.orThrow(await this._internalApiKeysCache.getOrWait([], \"write-only\"));\n return crud.map((j) => this._createInternalApiKeyFromCrud(j));\n }\n\n useInternalApiKeys(): InternalApiKey[] {\n const crud = useAsyncCache(this._internalApiKeysCache, [], \"adminApp.useInternalApiKeys()\");\n return useMemo(() => {\n return crud.map((j) => this._createInternalApiKeyFromCrud(j));\n }, [crud]);\n }\n\n async createInternalApiKey(options: InternalApiKeyCreateOptions): Promise<InternalApiKeyFirstView> {\n const crud = await this._interface.createInternalApiKey(internalApiKeyCreateOptionsToCrud(options));\n await this._refreshInternalApiKeys();\n return this._createInternalApiKeyFirstViewFromCrud(crud);\n }\n\n\n useEmailThemes(): { id: string, displayName: string }[] {\n const crud = useAsyncCache(this._adminEmailThemesCache, [], \"adminApp.useEmailThemes()\");\n return useMemo(() => {\n return crud.map((theme) => ({\n id: theme.id,\n displayName: theme.display_name,\n }));\n }, [crud]);\n }\n useEmailTemplates(): { id: string, displayName: string, themeId?: string, tsxSource: string }[] {\n const crud = useAsyncCache(this._adminEmailTemplatesCache, [], \"adminApp.useEmailTemplates()\");\n return useMemo(() => {\n return crud.map((template) => ({\n id: template.id,\n displayName: template.display_name,\n themeId: template.theme_id,\n tsxSource: template.tsx_source,\n }));\n }, [crud]);\n }\n useEmailDrafts(): { id: string, displayName: string, themeId: string | undefined | false, tsxSource: string, sentAt: Date | null }[] {\n const crud = useAsyncCache(this._adminEmailDraftsCache, [], \"adminApp.useEmailDrafts()\");\n return useMemo(() => {\n return crud.map((draft) => ({\n id: draft.id,\n displayName: draft.display_name,\n themeId: draft.theme_id,\n tsxSource: draft.tsx_source,\n sentAt: draft.sent_at_millis ? new Date(draft.sent_at_millis) : null,\n }));\n }, [crud]);\n }\n async listEmailThemes(): Promise<{ id: string, displayName: string }[]> {\n const crud = Result.orThrow(await this._adminEmailThemesCache.getOrWait([], \"write-only\"));\n return crud.map((theme) => ({\n id: theme.id,\n displayName: theme.display_name,\n }));\n }\n\n async listEmailTemplates(): Promise<{ id: string, displayName: string, themeId?: string, tsxSource: string }[]> {\n const crud = Result.orThrow(await this._adminEmailTemplatesCache.getOrWait([], \"write-only\"));\n return crud.map((template) => ({\n id: template.id,\n displayName: template.display_name,\n themeId: template.theme_id,\n tsxSource: template.tsx_source,\n }));\n }\n\n async listEmailDrafts(): Promise<{ id: string, displayName: string, themeId: string | undefined | false, tsxSource: string, sentAt: Date | null }[]> {\n const crud = Result.orThrow(await this._adminEmailDraftsCache.getOrWait([], \"write-only\"));\n return crud.map((draft) => ({\n id: draft.id,\n displayName: draft.display_name,\n themeId: draft.theme_id,\n tsxSource: draft.tsx_source,\n sentAt: draft.sent_at_millis ? new Date(draft.sent_at_millis) : null,\n }));\n }\n\n\n async createTeamPermissionDefinition(data: AdminTeamPermissionDefinitionCreateOptions): Promise<AdminTeamPermission> {\n const crud = await this._interface.createTeamPermissionDefinition(adminTeamPermissionDefinitionCreateOptionsToCrud(data));\n await this._adminTeamPermissionDefinitionsCache.refresh([]);\n return this._serverTeamPermissionDefinitionFromCrud(crud);\n }\n\n async updateTeamPermissionDefinition(permissionId: string, data: AdminTeamPermissionDefinitionUpdateOptions) {\n await this._interface.updateTeamPermissionDefinition(permissionId, adminTeamPermissionDefinitionUpdateOptionsToCrud(data));\n await this._adminTeamPermissionDefinitionsCache.refresh([]);\n }\n\n async deleteTeamPermissionDefinition(permissionId: string): Promise<void> {\n await this._interface.deleteTeamPermissionDefinition(permissionId);\n await this._adminTeamPermissionDefinitionsCache.refresh([]);\n }\n\n async listTeamPermissionDefinitions(): Promise<AdminTeamPermissionDefinition[]> {\n const crud = Result.orThrow(await this._adminTeamPermissionDefinitionsCache.getOrWait([], \"write-only\"));\n return crud.map((p) => this._serverTeamPermissionDefinitionFromCrud(p));\n }\n\n async listTeamPermissionDefinitionsPaginated(\n options: { limit: number, cursor?: string, query?: string },\n ): Promise<{ items: AdminTeamPermissionDefinition[], nextCursor: string | null }> {\n const result = await this._interface.listTeamPermissionDefinitionsPaginated(options);\n return {\n items: result.items.map((p) => this._serverTeamPermissionDefinitionFromCrud(p)),\n nextCursor: result.nextCursor,\n };\n }\n\n useTeamPermissionDefinitions(): AdminTeamPermissionDefinition[] {\n const crud = useAsyncCache(this._adminTeamPermissionDefinitionsCache, [], \"adminApp.useTeamPermissionDefinitions()\");\n return useMemo(() => {\n return crud.map((p) => this._serverTeamPermissionDefinitionFromCrud(p));\n }, [crud]);\n }\n\n async createProjectPermissionDefinition(data: AdminProjectPermissionDefinitionCreateOptions): Promise<AdminProjectPermission> {\n const crud = await this._interface.createProjectPermissionDefinition(adminProjectPermissionDefinitionCreateOptionsToCrud(data));\n await this._adminProjectPermissionDefinitionsCache.refresh([]);\n return this._serverProjectPermissionDefinitionFromCrud(crud);\n }\n\n async updateProjectPermissionDefinition(permissionId: string, data: AdminProjectPermissionDefinitionUpdateOptions) {\n await this._interface.updateProjectPermissionDefinition(permissionId, adminProjectPermissionDefinitionUpdateOptionsToCrud(data));\n await this._adminProjectPermissionDefinitionsCache.refresh([]);\n }\n\n async deleteProjectPermissionDefinition(permissionId: string): Promise<void> {\n await this._interface.deleteProjectPermissionDefinition(permissionId);\n await this._adminProjectPermissionDefinitionsCache.refresh([]);\n }\n\n async listProjectPermissionDefinitions(): Promise<AdminProjectPermissionDefinition[]> {\n const crud = Result.orThrow(await this._adminProjectPermissionDefinitionsCache.getOrWait([], \"write-only\"));\n return crud.map((p) => this._serverProjectPermissionDefinitionFromCrud(p));\n }\n\n useProjectPermissionDefinitions(): AdminProjectPermissionDefinition[] {\n const crud = useAsyncCache(this._adminProjectPermissionDefinitionsCache, [], \"adminApp.useProjectPermissionDefinitions()\");\n return useMemo(() => {\n return crud.map((p) => this._serverProjectPermissionDefinitionFromCrud(p));\n }, [crud]);\n }\n useSvixToken(): { token: string, url: string | undefined } {\n const crud = useAsyncCache(this._svixTokenCache, [], \"adminApp.useSvixToken()\");\n return { token: crud.token, url: crud.url };\n }\n\n protected override async _refreshProject() {\n await Promise.all([\n super._refreshProject(),\n this._adminProjectCache.refresh([]),\n ]);\n }\n\n protected async _refreshProjectConfig() {\n await Promise.all([\n this._configOverridesCache.refresh([]),\n this._adminProjectCache.refresh([]),\n ]);\n }\n\n protected async _refreshInternalApiKeys() {\n await this._internalApiKeysCache.refresh([]);\n }\n\n protected override async _refreshUsers() {\n await Promise.all([\n super._refreshUsers(),\n this._metricsCache.refreshWhere(() => true),\n this._metricsUserCountsCache.refresh([]),\n ]);\n }\n\n get [hexclaveAppInternalsSymbol]() {\n return {\n ...super[hexclaveAppInternalsSymbol],\n useMetrics: (\n includeAnonymous: boolean = false,\n filters?: { country_code?: string, referrer?: string, browser?: string, os?: string, device?: string, since?: string, until?: string },\n ): MetricsResponse => {\n const filtersKey = (() => {\n if (filters == null) return \"\";\n const params = new URLSearchParams();\n for (const key of [\"browser\", \"country_code\", \"device\", \"os\", \"referrer\", \"since\", \"until\"] as const) {\n const v = filters[key];\n if (v != null) params.set(key, v);\n }\n return params.toString();\n })();\n return useAsyncCache(this._metricsCache, [includeAnonymous, filtersKey] as const, \"adminApp.useMetrics()\") as MetricsResponse;\n },\n useUserActivity: (userId: string): UserActivityResponse => {\n return useAsyncCache(this._userActivityCache, [userId] as const, \"adminApp.useUserActivity()\") as UserActivityResponse;\n },\n useMetricsUserCounts: (): MetricsUserCounts => {\n return useAsyncCache(this._metricsUserCountsCache, [] as const, \"adminApp.useMetricsUserCounts()\") as MetricsUserCounts;\n },\n };\n }\n\n async sendTestEmail(options: {\n recipientEmail: string,\n emailConfig: EmailConfig,\n }): Promise<Result<undefined, { errorMessage: string }>> {\n let response: { success: boolean, error_message?: string };\n try {\n response = await this._interface.sendTestEmail({\n recipient_email: options.recipientEmail,\n email_config: {\n ...(pick(options.emailConfig, ['host', 'port', 'username', 'password'])),\n sender_email: options.emailConfig.senderEmail,\n sender_name: options.emailConfig.senderName,\n },\n });\n } catch (error) {\n // Translate the quota-exhaustion KnownError into the existing\n // Result.error shape so SDK/dashboard callers don't need to branch on\n // exceptions. The backend throws `ItemQuantityInsufficientAmount`\n // (consistent with every other limit-rejection endpoint), but this\n // method's historical contract has always been a `Result`.\n if (error instanceof KnownErrors.ItemQuantityInsufficientAmount) {\n return Result.error({\n errorMessage: \"Monthly email sending limit exceeded for your plan. Please upgrade your plan or wait until next month before sending more test emails.\",\n });\n }\n throw error;\n }\n\n if (response.success) {\n return Result.ok(undefined);\n } else {\n return Result.error({ errorMessage: response.error_message ?? throwErr(\"Email test error not specified\") });\n }\n }\n\n async sendTestWebhook(options: { endpointId: string }): Promise<Result<undefined, { errorMessage: string }>> {\n const response = await this._interface.sendTestWebhook({\n endpoint_id: options.endpointId,\n });\n\n if (response.success) {\n return Result.ok(undefined);\n } else {\n return Result.error({ errorMessage: response.error_message ?? throwErr(\"Webhook test error not specified\") });\n }\n }\n\n async listSentEmails(): Promise<AdminSentEmail[]> {\n const response = await this._interface.listSentEmails();\n return response.items.map((email) => ({\n id: email.id,\n to: email.to ?? [],\n subject: email.subject,\n recipient: email.to?.[0] ?? \"\",\n sentAt: new Date(email.sent_at_millis),\n error: email.error,\n }));\n }\n\n async setupManagedEmailProvider(options: { subdomain: string, senderLocalPart: string }): Promise<ManagedEmailProviderSetupResult> {\n const response = await this._interface.setupManagedEmailProvider({\n subdomain: options.subdomain,\n sender_local_part: options.senderLocalPart,\n });\n return {\n domainId: response.domain_id,\n subdomain: response.subdomain,\n senderLocalPart: response.sender_local_part,\n nameServerRecords: response.name_server_records,\n status: response.status,\n };\n }\n\n async checkManagedEmailStatus(options: { domainId: string, subdomain: string, senderLocalPart: string }): Promise<ManagedEmailProviderStatus> {\n const response = await this._interface.checkManagedEmailStatus({\n domain_id: options.domainId,\n subdomain: options.subdomain,\n sender_local_part: options.senderLocalPart,\n });\n return {\n status: response.status,\n };\n }\n\n async listManagedEmailDomains(): Promise<ManagedEmailProviderListItem[]> {\n const response = await this._interface.listManagedEmailDomains();\n return response.items.map((item) => ({\n domainId: item.domain_id,\n subdomain: item.subdomain,\n senderLocalPart: item.sender_local_part,\n status: item.status,\n nameServerRecords: item.name_server_records,\n }));\n }\n\n async applyManagedEmailProvider(options: { domainId: string }): Promise<{ status: \"applied\" }> {\n const result = await this._interface.applyManagedEmailProvider({\n domain_id: options.domainId,\n });\n await this._refreshProjectConfig();\n return result;\n }\n\n async deleteManagedEmailDomain(options: { resendDomainId: string }): Promise<{ status: \"deleted\" }> {\n return await this._interface.deleteManagedEmailDomain({\n resend_domain_id: options.resendDomainId,\n });\n }\n\n async sendSignInInvitationEmail(email: string, callbackUrl: string): Promise<void> {\n await this._interface.sendSignInInvitationEmail(email, callbackUrl);\n }\n\n async createEmailTemplate(displayName: string): Promise<{ id: string }> {\n const result = await this._interface.createEmailTemplate(displayName);\n await this._adminEmailTemplatesCache.refresh([]);\n\n return result;\n }\n\n async deleteEmailTemplate(id: string): Promise<void> {\n await this._interface.deleteEmailTemplate(id);\n await this._adminEmailTemplatesCache.refresh([]);\n }\n\n async createEmailDraft(options: { displayName: string, themeId?: string | false, tsxSource?: string }): Promise<{ id: string }> {\n const result = await this._interface.createEmailDraft({\n display_name: options.displayName,\n theme_id: options.themeId,\n tsx_source: options.tsxSource,\n });\n await this._adminEmailDraftsCache.refresh([]);\n return result;\n }\n\n async updateEmailDraft(id: string, data: { displayName?: string, themeId?: string | undefined | false, tsxSource?: string }): Promise<void> {\n await this._interface.updateEmailDraft(id, {\n display_name: data.displayName,\n theme_id: data.themeId,\n tsx_source: data.tsxSource,\n });\n await this._adminEmailDraftsCache.refresh([]);\n }\n\n async deleteEmailDraft(id: string): Promise<void> {\n await this._interface.deleteEmailDraft(id);\n const current = this._adminEmailDraftsCache.getIfCached([]);\n if (current.status === \"ok\" && current.data.status === \"ok\") {\n this._adminEmailDraftsCache.forceSetCachedValue([], Result.ok(current.data.data.filter((d) => d.id !== id)));\n }\n await this._adminEmailDraftsCache.refresh([]);\n }\n\n async refreshEmailDrafts(): Promise<void> {\n await this._adminEmailDraftsCache.refresh([]);\n }\n\n async saveChatMessage(threadId: string, message: any): Promise<void> {\n await this._interface.saveChatMessage(threadId, message);\n }\n\n async listChatMessages(threadId: string): Promise<{ messages: Array<any> }> {\n return await this._interface.listChatMessages(threadId);\n }\n\n async rewriteTemplateSourceWithAI(templateTsxSource: string): Promise<{ tsxSource: string }> {\n const result = await this._interface.rewriteTemplateSourceWithAI(templateTsxSource);\n return { tsxSource: result.tsx_source };\n }\n\n async createEmailTheme(displayName: string): Promise<{ id: string }> {\n const result = await this._interface.createEmailTheme(displayName);\n await this._adminEmailThemesCache.refresh([]);\n return result;\n }\n\n async getEmailPreview(options: { themeId?: string | null | false, themeTsxSource?: string, templateId?: string, templateTsxSource?: string }): Promise<string> {\n return (await this._interface.renderEmailPreview(options)).html;\n }\n useEmailPreview(options: { themeId?: string | null | false, themeTsxSource?: string, templateId?: string, templateTsxSource?: string }): string {\n const crud = useAsyncCache(this._emailPreviewCache, [options.themeId, options.themeTsxSource, options.templateId, options.templateTsxSource] as const, \"adminApp.useEmailPreview()\");\n return crud.html;\n }\n async getEmailPreviewWithEditableMarkers(options: { themeId?: string | null | false, themeTsxSource?: string, templateId?: string, templateTsxSource?: string, editableSource?: 'template' | 'theme' | 'both' }): Promise<{ html: string, editableRegions?: Record<string, unknown> }> {\n const result = await this._interface.renderEmailPreview({ ...options, editableMarkers: true, editableSource: options.editableSource });\n return { html: result.html, editableRegions: result.editable_regions };\n }\n useEmailPreviewWithEditableMarkers(options: { themeId?: string | null | false, themeTsxSource?: string, templateId?: string, templateTsxSource?: string, editableSource?: 'template' | 'theme' | 'both' }): { html: string, editableRegions?: Record<string, unknown> } {\n const crud = useAsyncCache(this._emailPreviewWithEditableMarkersCache, [options.themeId, options.themeTsxSource, options.templateId, options.templateTsxSource, options.editableSource] as const, \"adminApp.useEmailPreviewWithEditableMarkers()\");\n return { html: crud.html, editableRegions: crud.editable_regions };\n }\n useEmailTheme(id: string): { displayName: string, tsxSource: string } {\n const crud = useAsyncCache(this._adminEmailThemeCache, [id] as const, \"adminApp.useEmailTheme()\");\n return {\n displayName: crud.display_name,\n tsxSource: crud.tsx_source,\n };\n }\n async updateEmailTheme(id: string, tsxSource: string): Promise<void> {\n await this._interface.updateEmailTheme(id, tsxSource);\n await this._adminEmailThemesCache.refresh([]);\n await this._adminEmailThemeCache.invalidate([id]);\n }\n\n async deleteEmailTheme(id: string): Promise<void> {\n await this._interface.deleteEmailTheme(id);\n await this._adminEmailThemesCache.refresh([]);\n await this._adminEmailThemeCache.invalidate([id]);\n }\n\n async updateEmailTemplate(id: string, tsxSource: string, themeId: string | null | false): Promise<{ renderedHtml: string }> {\n const result = await this._interface.updateEmailTemplate(id, tsxSource, themeId);\n await this._adminEmailTemplatesCache.refresh([]);\n return { renderedHtml: result.rendered_html };\n }\n\n async setupPayments(): Promise<{ url: string }> {\n const result = await this._interface.setupPayments();\n await this._stripeAccountInfoCache.refresh([]);\n return result;\n }\n\n async createStripeWidgetAccountSession(): Promise<{ client_secret: string }> {\n return await this._interface.createStripeWidgetAccountSession();\n }\n\n async getPaymentMethodConfigs(): Promise<{ configId: string, methods: Array<{ id: string, name: string, enabled: boolean, available: boolean, overridable: boolean }> } | null> {\n return await this._interface.getPaymentMethodConfigs();\n }\n\n async updatePaymentMethodConfigs(configId: string, updates: Record<string, 'on' | 'off'>): Promise<void> {\n await this._interface.updatePaymentMethodConfigs(configId, updates);\n }\n\n async createItemQuantityChange(options: (\n { userId: string, itemId: string, quantity: number, expiresAt?: string, description?: string } |\n { teamId: string, itemId: string, quantity: number, expiresAt?: string, description?: string } |\n { customCustomerId: string, itemId: string, quantity: number, expiresAt?: string, description?: string }\n )): Promise<void> {\n await this._interface.updateItemQuantity(\n { itemId: options.itemId, ...(\"userId\" in options ? { userId: options.userId } : (\"teamId\" in options ? { teamId: options.teamId } : { customCustomerId: options.customCustomerId })) },\n {\n delta: options.quantity,\n expires_at: options.expiresAt,\n description: options.description,\n allow_negative: true,\n }\n );\n }\n\n async refundTransaction(options: {\n type: \"subscription\" | \"one-time-purchase\",\n id: string,\n invoiceId?: string,\n amountUsd: MoneyAmount,\n endAction?: \"now\" | \"at-period-end\",\n }): Promise<{ refundTransactionId: string }> {\n const result = await this._interface.refundTransaction({\n type: options.type,\n id: options.id,\n invoiceId: options.invoiceId,\n amountUsd: options.amountUsd,\n endAction: options.endAction,\n });\n await this._transactionsCache.invalidateWhere(() => true);\n return { refundTransactionId: result.refundTransactionId };\n }\n\n async listTransactions(params: { cursor?: string, limit?: number, type?: TransactionType, customerType?: 'user' | 'team' | 'custom', customerId?: string }): Promise<{ transactions: Transaction[], nextCursor: string | null }> {\n const crud = Result.orThrow(await this._transactionsCache.getOrWait([params.cursor, params.limit, params.type, params.customerType, params.customerId] as const, \"write-only\"));\n return crud;\n }\n\n // Email Outbox methods\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Complex discriminated union conversion from API response\n private _emailOutboxCrudToAdmin(crud: any): AdminEmailOutbox {\n const recipient = crud.to;\n let to: AdminEmailOutbox[\"to\"];\n if (recipient.type === \"user-primary-email\") {\n to = { type: \"user-primary-email\", userId: recipient.user_id };\n } else if (recipient.type === \"user-custom-emails\") {\n to = { type: \"user-custom-emails\", userId: recipient.user_id, emails: recipient.emails };\n } else {\n to = { type: \"custom-emails\", emails: recipient.emails };\n }\n\n // Base fields present on all emails\n const base = {\n id: crud.id as string,\n createdAt: new Date(crud.created_at_millis),\n updatedAt: new Date(crud.updated_at_millis),\n tsxSource: crud.tsx_source as string,\n themeId: (crud.theme_id as string | null) ?? null,\n to,\n scheduledAt: new Date(crud.scheduled_at_millis),\n // Source tracking for grouping emails by template/draft\n createdWith: crud.created_with as \"draft\" | \"programmatic-call\",\n emailDraftId: crud.email_draft_id as string | null,\n emailProgrammaticCallTemplateId: crud.email_programmatic_call_template_id as string | null,\n variables: (crud.variables ?? {}) as Record<string, Json>,\n isPaused: false as const,\n hasRendered: false as const,\n hasDelivered: false as const,\n // Retry tracking fields\n sendRetries: crud.send_retries as number,\n nextSendRetryAt: crud.next_send_retry_at_millis ? new Date(crud.next_send_retry_at_millis) : null,\n sendAttemptErrors: crud.send_attempt_errors ? (crud.send_attempt_errors as Array<{\n attempt_number: number,\n timestamp: string,\n external_message: string,\n external_details: Record<string, unknown>,\n internal_message: string,\n internal_details: Record<string, unknown>,\n }>).map((e) => ({\n attemptNumber: e.attempt_number,\n timestamp: e.timestamp,\n externalMessage: e.external_message,\n externalDetails: e.external_details,\n internalMessage: e.internal_message,\n internalDetails: e.internal_details,\n })) : null,\n };\n\n // Rendered fields (available after rendering completes successfully)\n const rendered = crud.has_rendered ? {\n ...base,\n startedRenderingAt: new Date(crud.started_rendering_at_millis),\n renderedAt: new Date(crud.rendered_at_millis),\n subject: crud.subject as string,\n html: crud.html as string | null,\n text: crud.text as string | null,\n isTransactional: crud.is_transactional as boolean,\n isHighPriority: crud.is_high_priority as boolean,\n notificationCategoryId: crud.notification_category_id as string | null,\n hasRendered: true as const,\n } : null;\n\n // Started sending fields\n const startedSending = rendered && crud.started_sending_at_millis ? {\n ...rendered,\n startedSendingAt: new Date(crud.started_sending_at_millis),\n } : null;\n\n // Finished delivering fields\n const finishedDelivering = startedSending && crud.has_delivered ? {\n ...startedSending,\n deliveredAt: new Date(crud.delivered_at_millis),\n hasDelivered: true as const,\n } : null;\n\n // Use type assertion at the end because TypeScript has trouble with\n // spread + override patterns on discriminated unions with const literal types\n const result = (() => {\n switch (crud.status) {\n case \"paused\": {\n return {\n ...base,\n status: \"paused\" as const,\n simpleStatus: \"in-progress\" as const,\n isPaused: true as const,\n };\n }\n case \"preparing\": {\n return {\n ...base,\n status: \"preparing\" as const,\n simpleStatus: \"in-progress\" as const,\n };\n }\n case \"rendering\": {\n return {\n ...base,\n status: \"rendering\" as const,\n simpleStatus: \"in-progress\" as const,\n startedRenderingAt: new Date(crud.started_rendering_at_millis),\n };\n }\n case \"render-error\": {\n return {\n ...base,\n status: \"render-error\" as const,\n simpleStatus: \"error\" as const,\n startedRenderingAt: new Date(crud.started_rendering_at_millis),\n renderedAt: new Date(crud.rendered_at_millis),\n renderError: crud.render_error,\n };\n }\n case \"scheduled\": {\n return {\n ...rendered!,\n status: \"scheduled\" as const,\n simpleStatus: \"in-progress\" as const,\n };\n }\n case \"queued\": {\n return {\n ...rendered!,\n status: \"queued\" as const,\n simpleStatus: \"in-progress\" as const,\n };\n }\n case \"sending\": {\n return {\n ...startedSending!,\n status: \"sending\" as const,\n simpleStatus: \"in-progress\" as const,\n };\n }\n case \"server-error\": {\n return {\n ...startedSending!,\n status: \"server-error\" as const,\n simpleStatus: \"error\" as const,\n errorAt: new Date(crud.error_at_millis),\n serverError: crud.server_error,\n };\n }\n case \"skipped\": {\n return {\n ...base,\n status: \"skipped\" as const,\n simpleStatus: \"ok\" as const,\n skippedAt: new Date(crud.skipped_at_millis),\n skippedReason: crud.skipped_reason,\n skippedDetails: crud.skipped_details ?? {},\n hasRendered: crud.has_rendered as boolean,\n // Optional fields\n startedRenderingAt: crud.started_rendering_at_millis ? new Date(crud.started_rendering_at_millis) : undefined,\n renderedAt: crud.rendered_at_millis ? new Date(crud.rendered_at_millis) : undefined,\n subject: crud.subject,\n html: crud.html,\n text: crud.text,\n isTransactional: crud.is_transactional,\n isHighPriority: crud.is_high_priority,\n notificationCategoryId: crud.notification_category_id,\n startedSendingAt: crud.started_sending_at_millis ? new Date(crud.started_sending_at_millis) : undefined,\n };\n }\n case \"bounced\": {\n return {\n ...startedSending!,\n status: \"bounced\" as const,\n simpleStatus: \"error\" as const,\n bouncedAt: new Date(crud.bounced_at_millis),\n };\n }\n case \"delivery-delayed\": {\n return {\n ...startedSending!,\n status: \"delivery-delayed\" as const,\n simpleStatus: \"ok\" as const,\n deliveryDelayedAt: new Date(crud.delivery_delayed_at_millis),\n };\n }\n case \"sent\": {\n return {\n ...finishedDelivering!,\n status: \"sent\" as const,\n simpleStatus: \"ok\" as const,\n canHaveDeliveryInfo: crud.can_have_delivery_info,\n };\n }\n case \"opened\": {\n return {\n ...finishedDelivering!,\n status: \"opened\" as const,\n simpleStatus: \"ok\" as const,\n openedAt: new Date(crud.opened_at_millis),\n canHaveDeliveryInfo: true as const,\n };\n }\n case \"clicked\": {\n return {\n ...finishedDelivering!,\n status: \"clicked\" as const,\n simpleStatus: \"ok\" as const,\n clickedAt: new Date(crud.clicked_at_millis),\n canHaveDeliveryInfo: true as const,\n };\n }\n case \"marked-as-spam\": {\n return {\n ...finishedDelivering!,\n status: \"marked-as-spam\" as const,\n simpleStatus: \"ok\" as const,\n markedAsSpamAt: new Date(crud.marked_as_spam_at_millis),\n canHaveDeliveryInfo: true as const,\n };\n }\n default: {\n throw new HexclaveAssertionError(`Unknown email outbox status: ${crud.status}`, { status: crud.status });\n }\n }\n })();\n // The type system has difficulty with spread + override patterns on discriminated unions,\n // so we use a type assertion here. The switch statement above ensures we return the correct shape.\n return result as AdminEmailOutbox;\n }\n\n async listOutboxEmails(options?: { status?: string, simpleStatus?: string, userId?: string, limit?: number, cursor?: string }): Promise<{ items: AdminEmailOutbox[], nextCursor: string | null }> {\n const response = await this._interface.listOutboxEmails({\n status: options?.status,\n simple_status: options?.simpleStatus,\n user_id: options?.userId,\n limit: options?.limit,\n cursor: options?.cursor,\n });\n return {\n items: response.items.map((item) => this._emailOutboxCrudToAdmin(item)),\n nextCursor: response.pagination?.next_cursor ?? null,\n };\n }\n\n async getOutboxEmail(id: string): Promise<AdminEmailOutbox> {\n const response = await this._interface.getOutboxEmail(id);\n return this._emailOutboxCrudToAdmin(response);\n }\n\n async updateOutboxEmail(id: string, options: EmailOutboxUpdateOptions): Promise<AdminEmailOutbox> {\n const response = await this._interface.updateOutboxEmail(id, {\n is_paused: options.isPaused,\n scheduled_at_millis: options.scheduledAtMillis,\n cancel: options.cancel,\n tsx_source: options.tsxSource,\n theme_id: options.themeId,\n });\n return this._emailOutboxCrudToAdmin(response);\n }\n\n async pauseOutboxEmail(id: string): Promise<AdminEmailOutbox> {\n return await this.updateOutboxEmail(id, { isPaused: true });\n }\n\n async unpauseOutboxEmail(id: string): Promise<AdminEmailOutbox> {\n return await this.updateOutboxEmail(id, { isPaused: false });\n }\n\n async cancelOutboxEmail(id: string): Promise<AdminEmailOutbox> {\n return await this.updateOutboxEmail(id, { cancel: true });\n }\n\n useTransactions(params: { cursor?: string, limit?: number, type?: TransactionType, customerType?: 'user' | 'team' | 'custom', customerId?: string }): { transactions: Transaction[], nextCursor: string | null } {\n const data = useAsyncCache(this._transactionsCache, [params.cursor, params.limit, params.type, params.customerType, params.customerId] as const, \"adminApp.useTransactions()\");\n return data;\n }\n\n async getStripeAccountInfo(): Promise<null | { account_id: string, charges_enabled: boolean, details_submitted: boolean, payouts_enabled: boolean }> {\n return Result.orThrow(await this._stripeAccountInfoCache.getOrWait([], \"write-only\"));\n }\n\n useStripeAccountInfo(): { account_id: string, charges_enabled: boolean, details_submitted: boolean, payouts_enabled: boolean } | null {\n const data = useAsyncCache(this._stripeAccountInfoCache, [], \"adminApp.useStripeAccountInfo()\");\n return data;\n }\n\n async queryAnalytics(options: AnalyticsQueryOptions): Promise<AnalyticsQueryResponse> {\n return await this._interface.queryAnalytics(options);\n }\n\n async getAnalyticsClickmap(options: AnalyticsClickmapOptions): Promise<AnalyticsClickmapResponse> {\n return await this._interface.getAnalyticsClickmap({\n kind: options.kind,\n member_user_ids: options.memberUserIds,\n route_path: options.routePath,\n route_regex: options.routeRegex,\n url_pattern: options.urlPattern,\n user_id: options.userId,\n replay_id: options.replayId,\n device: options.device,\n viewport_width_min: options.viewportWidthMin,\n viewport_width_max: options.viewportWidthMax,\n sampling: options.sampling,\n since: options.since,\n until: options.until,\n });\n }\n\n async createAnalyticsClickmapToken(options: { origin: string }): Promise<AnalyticsClickmapTokenResponse> {\n return await this._interface.createAnalyticsClickmapToken(options);\n }\n\n async listSessionReplays(options?: ListSessionReplaysOptions): Promise<ListSessionReplaysResult> {\n const response = await this._interface.listSessionReplays({\n cursor: options?.cursor,\n limit: options?.limit,\n user_ids: options?.userIds,\n team_ids: options?.teamIds,\n duration_ms_min: options?.durationMsMin,\n duration_ms_max: options?.durationMsMax,\n last_event_at_from_millis: options?.lastEventAtFromMillis,\n last_event_at_to_millis: options?.lastEventAtToMillis,\n click_count_min: options?.clickCountMin,\n });\n\n const items: AdminSessionReplay[] = response.items.map((r) => ({\n id: r.id,\n projectUser: {\n id: r.project_user.id,\n displayName: r.project_user.display_name,\n primaryEmail: r.project_user.primary_email,\n },\n startedAt: new Date(r.started_at_millis),\n lastEventAt: new Date(r.last_event_at_millis),\n chunkCount: r.chunk_count,\n eventCount: r.event_count,\n }));\n\n return {\n items,\n nextCursor: response.pagination.next_cursor,\n };\n }\n\n async getSessionReplay(sessionReplayId: string): Promise<AdminSessionReplay> {\n const response = await this._interface.getSessionReplay(sessionReplayId);\n return {\n id: response.id,\n projectUser: {\n id: response.project_user.id,\n displayName: response.project_user.display_name,\n primaryEmail: response.project_user.primary_email,\n },\n startedAt: new Date(response.started_at_millis),\n lastEventAt: new Date(response.last_event_at_millis),\n chunkCount: response.chunk_count,\n eventCount: response.event_count,\n };\n }\n\n async listSessionReplayChunks(sessionReplayId: string, options?: ListSessionReplayChunksOptions): Promise<ListSessionReplayChunksResult> {\n const response = await this._interface.listSessionReplayChunks(sessionReplayId, {\n cursor: options?.cursor,\n limit: options?.limit,\n });\n\n const items: AdminSessionReplayChunk[] = response.items.map((c) => ({\n id: c.id,\n batchId: c.batch_id,\n sessionReplaySegmentId: c.session_replay_segment_id,\n browserSessionId: c.browser_session_id,\n eventCount: c.event_count,\n byteLength: c.byte_length,\n firstEventAt: new Date(c.first_event_at_millis),\n lastEventAt: new Date(c.last_event_at_millis),\n createdAt: new Date(c.created_at_millis),\n }));\n\n return {\n items,\n nextCursor: response.pagination.next_cursor,\n };\n }\n\n async getSessionReplayChunkEvents(sessionReplayId: string, chunkId: string): Promise<AdminGetSessionReplayChunkEventsResponse> {\n return await this._interface.getSessionReplayChunkEvents(sessionReplayId, chunkId);\n }\n\n async getSessionReplayEvents(sessionReplayId: string, options?: { offset?: number, limit?: number }): Promise<SessionReplayAllEventsResult> {\n const response = await this._interface.getSessionReplayEvents(sessionReplayId, options);\n return {\n chunks: response.chunks.map((c) => ({\n id: c.id,\n batchId: c.batch_id,\n sessionReplaySegmentId: c.session_replay_segment_id,\n eventCount: c.event_count,\n byteLength: c.byte_length,\n firstEventAt: new Date(c.first_event_at_millis),\n lastEventAt: new Date(c.last_event_at_millis),\n createdAt: new Date(c.created_at_millis),\n })),\n chunkEvents: response.chunk_events.map((ce) => ({\n chunkId: ce.chunk_id,\n events: ce.events,\n })),\n };\n }\n\n async previewAffectedUsersByOnboardingChange(\n onboarding: { requireEmailVerification?: boolean },\n limit?: number,\n ): Promise<{\n affectedUsers: Array<{\n id: string,\n displayName: string | null,\n primaryEmail: string | null,\n restrictedReason: RestrictedReason,\n }>,\n totalAffectedCount: number,\n }> {\n const result = await this._interface.previewAffectedUsersByOnboardingChange(\n { require_email_verification: onboarding.requireEmailVerification },\n limit,\n );\n return {\n affectedUsers: result.affected_users.map(u => ({\n id: u.id,\n displayName: u.display_name,\n primaryEmail: u.primary_email,\n restrictedReason: u.restricted_reason as RestrictedReason,\n })),\n totalAffectedCount: result.total_affected_count,\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA4CA,SAAS,wBAAwB,QAAmD;AAClF,KAAI,OAAO,SAAS,qBAClB,QAAO;EACL,MAAM;EACN,OAAO,OAAO;EACd,MAAM,OAAO;EACb,QAAQ,OAAO;EACf,aAAa,OAAO;EACpB,kBAAkB,OAAO;EACzB,eAAe,OAAO;EACvB;AAEH,QAAO;;;;;A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"file":"admin-app-impl.js","names":[],"sources":["../../../../../../src/lib/hexclave-app/apps/implementations/admin-app-impl.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { KnownErrors, HexclaveAdminInterface } from \"@hexclave/shared\";\nimport { getProductionModeErrors } from \"@hexclave/shared/dist/helpers/production-mode\";\nimport { InternalApiKeyCreateCrudResponse } from \"@hexclave/shared/dist/interface/admin-interface\";\nimport type { AnalyticsClickmapOptions, AnalyticsClickmapResponse, AnalyticsClickmapTokenResponse, MetricsResponse, MetricsUserCounts, UserActivityResponse } from \"@hexclave/shared/dist/interface/admin-metrics\";\nimport { AnalyticsQueryOptions, AnalyticsQueryResponse } from \"@hexclave/shared/dist/interface/crud/analytics\";\nimport { EmailTemplateCrud } from \"@hexclave/shared/dist/interface/crud/email-templates\";\nimport { InternalApiKeysCrud } from \"@hexclave/shared/dist/interface/crud/internal-api-keys\";\nimport { ProjectsCrud } from \"@hexclave/shared/dist/interface/crud/projects\";\nimport type { AdminGetSessionReplayChunkEventsResponse } from \"@hexclave/shared/dist/interface/crud/session-replays\";\nimport type { Transaction, TransactionType } from \"@hexclave/shared/dist/interface/crud/transactions\";\nimport type { RestrictedReason } from \"@hexclave/shared/dist/schema-fields\";\nimport type { MoneyAmount } from \"@hexclave/shared/dist/utils/currency-constants\";\nimport { HexclaveAssertionError, throwErr } from \"@hexclave/shared/dist/utils/errors\";\nimport type { Json } from \"@hexclave/shared/dist/utils/json\";\nimport { pick, typedEntries, typedValues } from \"@hexclave/shared/dist/utils/objects\";\nimport { Result } from \"@hexclave/shared/dist/utils/results\";\nimport { useMemo } from \"react\"; // THIS_LINE_PLATFORM react-like\nimport { AdminEmailOutbox, AdminSentEmail } from \"../..\";\nimport { EmailConfig, hexclaveAppInternalsSymbol } from \"../../common\";\nimport { AdminEmailTemplate } from \"../../email-templates\";\nimport { InternalApiKey, InternalApiKeyBase, InternalApiKeyBaseCrudRead, InternalApiKeyCreateOptions, InternalApiKeyFirstView, internalApiKeyCreateOptionsToCrud } from \"../../internal-api-keys\";\nimport { AdminProjectPermission, AdminProjectPermissionDefinition, AdminProjectPermissionDefinitionCreateOptions, AdminProjectPermissionDefinitionUpdateOptions, AdminTeamPermission, AdminTeamPermissionDefinition, AdminTeamPermissionDefinitionCreateOptions, AdminTeamPermissionDefinitionUpdateOptions, adminProjectPermissionDefinitionCreateOptionsToCrud, adminProjectPermissionDefinitionUpdateOptionsToCrud, adminTeamPermissionDefinitionCreateOptionsToCrud, adminTeamPermissionDefinitionUpdateOptionsToCrud } from \"../../permissions\";\nimport type { PlanUsage } from \"../../plan-usage\";\nimport { AdminOwnedProject, AdminProject, AdminProjectUpdateOptions, PushConfigOptions, adminProjectUpdateOptionsToCrud } from \"../../projects\";\nimport type { AdminSessionReplay, AdminSessionReplayChunk, ListSessionReplayChunksOptions, ListSessionReplayChunksResult, ListSessionReplaysOptions, ListSessionReplaysResult, SessionReplayAllEventsResult } from \"../../session-replays\";\nimport { ManagedEmailProviderListItem, ManagedEmailProviderSetupResult, ManagedEmailProviderStatus, EmailOutboxUpdateOptions, StackAdminApp, StackAdminAppConstructorOptions } from \"../interfaces/admin-app\";\nimport { clientVersion, createCache, getDefaultExtraRequestHeaders, getDefaultProjectId, getDefaultPublishableClientKey, getDefaultSecretServerKey, getDefaultSuperSecretAdminKey, resolveApiUrls, resolveConstructorOptions } from \"./common\";\nimport { _HexclaveServerAppImplIncomplete } from \"./server-app-impl\";\n\nimport { CompleteConfig, EnvironmentConfigOverrideOverride } from \"@hexclave/shared/dist/config/schema\";\nimport { branchConfigSourceSchema } from \"@hexclave/shared/dist/schema-fields\";\nimport * as yup from \"yup\";\nimport { PushedConfigSource } from \"../../projects\";\nimport { useAsyncCache } from \"./common\"; // THIS_LINE_PLATFORM react-like\n\ntype BranchConfigSourceApi = yup.InferType<typeof branchConfigSourceSchema>;\ntype PlanUsageResponse = Awaited<ReturnType<HexclaveAdminInterface[\"getPlanUsage\"]>>;\n/**\n * Converts a PushedConfigSource (SDK camelCase) to BranchConfigSourceApi (API snake_case).\n */\nfunction pushedConfigSourceToApi(source: PushedConfigSource): BranchConfigSourceApi {\n if (source.type === \"pushed-from-github\") {\n return {\n type: \"pushed-from-github\",\n owner: source.owner,\n repo: source.repo,\n branch: source.branch,\n commit_hash: source.commitHash,\n config_file_path: source.configFilePath,\n workflow_path: source.workflowPath,\n };\n }\n return source;\n}\n\n/**\n * Converts a BranchConfigSourceApi (API snake_case) to PushedConfigSource (SDK camelCase).\n */\nfunction apiToPushedConfigSource(source: BranchConfigSourceApi): PushedConfigSource {\n if (source.type === \"pushed-from-github\") {\n return {\n type: \"pushed-from-github\",\n owner: source.owner,\n repo: source.repo,\n branch: source.branch,\n commitHash: source.commit_hash,\n configFilePath: source.config_file_path,\n workflowPath: source.workflow_path,\n };\n }\n return source;\n}\n\nexport class _HexclaveAdminAppImplIncomplete<HasTokenStore extends boolean, ProjectId extends string> extends _HexclaveServerAppImplIncomplete<HasTokenStore, ProjectId> implements StackAdminApp<HasTokenStore, ProjectId> {\n declare protected _interface: HexclaveAdminInterface;\n\n private readonly _adminProjectCache = createCache(async () => {\n return await this._interface.getProject();\n });\n private readonly _planUsageCache = createCache(async () => {\n return await this._interface.getPlanUsage();\n });\n private readonly _internalApiKeysCache = createCache(async () => {\n const res = await this._interface.listInternalApiKeys();\n return res;\n });\n private readonly _adminEmailThemeCache = createCache(async ([id]: [string]) => {\n return await this._interface.getEmailTheme(id);\n });\n private readonly _adminEmailThemesCache = createCache(async () => {\n return await this._interface.listEmailThemes();\n });\n private readonly _adminEmailTemplatesCache = createCache(async () => {\n return await this._interface.listInternalEmailTemplates();\n });\n private readonly _adminEmailDraftsCache = createCache(async () => {\n return await this._interface.listInternalEmailDrafts();\n });\n private readonly _adminTeamPermissionDefinitionsCache = createCache(async () => {\n return await this._interface.listTeamPermissionDefinitions();\n });\n private readonly _adminProjectPermissionDefinitionsCache = createCache(async () => {\n return await this._interface.listProjectPermissionDefinitions();\n });\n private readonly _svixTokenCache = createCache(async () => {\n return await this._interface.getSvixToken();\n });\n // Cache key serializes filters via URLSearchParams (sorted keys) so\n // DependenciesMap (identity-keyed per array slot) treats two equal\n // filter objects as the same deterministic string entry.\n private readonly _metricsCache = createCache(async ([includeAnonymous, filtersKey]: [boolean, string]) => {\n const filters = filtersKey ? Object.fromEntries(new URLSearchParams(filtersKey)) : undefined;\n return await this._interface.getMetrics(includeAnonymous, filters);\n });\n private readonly _userActivityCache = createCache(async ([userId]: [string]) => {\n return await this._interface.getUserActivity(userId);\n });\n private readonly _metricsUserCountsCache = createCache(async () => {\n return await this._interface.getMetricsUserCounts();\n });\n private readonly _emailPreviewCache = createCache(async ([themeId, themeTsxSource, templateId, templateTsxSource]: [string | null | false | undefined, string | undefined, string | undefined, string | undefined]) => {\n return await this._interface.renderEmailPreview({ themeId, themeTsxSource, templateId, templateTsxSource });\n });\n private readonly _emailPreviewWithEditableMarkersCache = createCache(async ([themeId, themeTsxSource, templateId, templateTsxSource, editableSource]: [string | null | false | undefined, string | undefined, string | undefined, string | undefined, 'template' | 'theme' | 'both' | undefined]) => {\n return await this._interface.renderEmailPreview({ themeId, themeTsxSource, templateId, templateTsxSource, editableMarkers: true, editableSource });\n });\n private readonly _configOverridesCache = createCache(async () => {\n return await this._interface.getConfig();\n });\n private readonly _stripeAccountInfoCache = createCache(async () => {\n try {\n return await this._interface.getStripeAccountInfo();\n } catch (error: any) {\n if (error?.status === 404) {\n return null;\n }\n throw error;\n }\n });\n private readonly _transactionsCache = createCache(async ([cursor, limit, type, customerType, customerId]: [string | undefined, number | undefined, TransactionType | undefined, 'user' | 'team' | 'custom' | undefined, string | undefined]) => {\n return await this._interface.listTransactions({ cursor, limit, type, customerType, customerId });\n });\n\n constructor(options: StackAdminAppConstructorOptions<HasTokenStore, ProjectId>, extraOptions?: { uniqueIdentifier?: string, checkString?: string, interface?: HexclaveAdminInterface }) {\n const resolvedOptions = resolveConstructorOptions(options);\n\n const publishableClientKey = resolvedOptions.publishableClientKey ?? getDefaultPublishableClientKey();\n\n super(resolvedOptions, {\n ...extraOptions,\n interface: extraOptions?.interface ?? (() => {\n const apiUrls = resolveApiUrls(resolvedOptions.baseUrl);\n return new HexclaveAdminInterface({\n getBaseUrl: () => apiUrls()[0],\n getApiUrls: apiUrls,\n projectId: resolvedOptions.projectId ?? getDefaultProjectId(),\n extraRequestHeaders: resolvedOptions.extraRequestHeaders ?? getDefaultExtraRequestHeaders(),\n clientVersion,\n ...resolvedOptions.projectOwnerSession ? {\n projectOwnerSession: resolvedOptions.projectOwnerSession,\n } : {\n ...(publishableClientKey ? { publishableClientKey } : {}),\n secretServerKey: resolvedOptions.secretServerKey ?? getDefaultSecretServerKey(),\n superSecretAdminKey: resolvedOptions.superSecretAdminKey ?? getDefaultSuperSecretAdminKey(),\n },\n });\n })(),\n });\n }\n\n _adminConfigFromCrud(data: { config_string: string }): CompleteConfig {\n return JSON.parse(data.config_string);\n }\n\n _adminOwnedProjectFromCrud(data: ProjectsCrud['Admin']['Read'], onRefresh: () => Promise<void>): AdminOwnedProject {\n if (this._tokenStoreInit !== null) {\n throw new HexclaveAssertionError(\"Owned apps must always have tokenStore === null — did you not create this project with app._createOwnedApp()?\");\n }\n return {\n ...this._adminProjectFromCrud(data, onRefresh),\n app: this as StackAdminApp<false>,\n };\n }\n\n _adminProjectFromCrud(data: ProjectsCrud['Admin']['Read'], onRefresh: () => Promise<void>): AdminProject {\n if (data.id !== this.projectId) {\n throw new HexclaveAssertionError(`The project ID of the provided project JSON (${data.id}) does not match the project ID of the app (${this.projectId})!`);\n }\n\n const app = this;\n return {\n id: data.id,\n displayName: data.display_name,\n description: data.description,\n createdAt: new Date(data.created_at_millis),\n isProductionMode: data.is_production_mode,\n isDevelopmentEnvironment: data.is_development_environment,\n ownerTeamId: data.owner_team_id,\n onboardingStatus: data.onboarding_status,\n onboardingState: data.onboarding_state ?? null,\n logoUrl: data.logo_url,\n logoFullUrl: data.logo_full_url,\n logoDarkModeUrl: data.logo_dark_mode_url,\n logoFullDarkModeUrl: data.logo_full_dark_mode_url,\n pushedConfigError: data.pushed_config_error == null ? null : {\n message: data.pushed_config_error.message,\n },\n configWarnings: data.config_warnings.map((warning) => ({\n message: warning.message,\n })),\n config: {\n signUpEnabled: data.config.sign_up_enabled,\n credentialEnabled: data.config.credential_enabled,\n magicLinkEnabled: data.config.magic_link_enabled,\n passkeyEnabled: data.config.passkey_enabled,\n clientTeamCreationEnabled: data.config.client_team_creation_enabled,\n clientUserDeletionEnabled: data.config.client_user_deletion_enabled,\n allowLocalhost: data.config.allow_localhost,\n oauthAccountMergeStrategy: data.config.oauth_account_merge_strategy,\n allowUserApiKeys: data.config.allow_user_api_keys,\n allowTeamApiKeys: data.config.allow_team_api_keys,\n oauthProviders: data.config.oauth_providers.map((p) => ((p.type === 'shared' ? {\n id: p.id,\n type: 'shared',\n } as const : {\n id: p.id,\n type: 'standard',\n clientId: p.client_id ?? throwErr(\"Client ID is missing\"),\n clientSecret: p.client_secret ?? throwErr(\"Client secret is missing\"),\n facebookConfigId: p.facebook_config_id,\n microsoftTenantId: p.microsoft_tenant_id,\n appleBundleIds: p.apple_bundle_ids,\n } as const))),\n emailConfig: data.config.email_config.type === 'shared' ? {\n type: 'shared'\n } : {\n type: 'standard',\n host: data.config.email_config.host ?? throwErr(\"Email host is missing\"),\n port: data.config.email_config.port ?? throwErr(\"Email port is missing\"),\n username: data.config.email_config.username ?? throwErr(\"Email username is missing\"),\n password: data.config.email_config.password ?? throwErr(\"Email password is missing\"),\n senderName: data.config.email_config.sender_name ?? throwErr(\"Email sender name is missing\"),\n senderEmail: data.config.email_config.sender_email ?? throwErr(\"Email sender email is missing\"),\n },\n emailTheme: data.config.email_theme,\n domains: data.config.domains.map((d) => ({\n domain: d.domain,\n handlerPath: d.handler_path,\n })),\n createTeamOnSignUp: data.config.create_team_on_sign_up,\n teamCreatorDefaultPermissions: data.config.team_creator_default_permissions,\n teamMemberDefaultPermissions: data.config.team_member_default_permissions,\n userDefaultPermissions: data.config.user_default_permissions,\n },\n async getConfig() {\n return app._adminConfigFromCrud(await app._interface.getConfig());\n },\n useConfig() {\n const config = useAsyncCache(app._configOverridesCache, [], \"project.useConfig()\");\n return useMemo(() => app._adminConfigFromCrud(config), [config]);\n },\n async updateConfig(configOverride: EnvironmentConfigOverrideOverride) {\n await app._interface.updateConfigOverride(\"environment\", configOverride);\n await app._refreshProjectConfig();\n },\n async pushConfig(config: EnvironmentConfigOverrideOverride, options: PushConfigOptions) {\n await app._interface.setConfigOverride(\"branch\", config, pushedConfigSourceToApi(options.source));\n await app._refreshProjectConfig();\n },\n async updatePushedConfig(config: EnvironmentConfigOverrideOverride) {\n await app._interface.updateConfigOverride(\"branch\", config);\n await app._refreshProjectConfig();\n },\n async getPushedConfigSource(): Promise<PushedConfigSource> {\n const apiSource = await app._interface.getPushedConfigSource();\n return apiToPushedConfigSource(apiSource);\n },\n async unlinkPushedConfigSource(): Promise<void> {\n await app._interface.unlinkPushedConfigSource();\n await app._refreshProjectConfig();\n },\n async resetConfigOverrideKeys(level: \"branch\" | \"environment\", keys: string[]): Promise<void> {\n await app._interface.resetConfigOverrideKeys(level, keys);\n await app._refreshProjectConfig();\n },\n async getConfigOverride(level: \"branch\" | \"environment\"): Promise<Record<string, unknown>> {\n const result = await app._interface.getConfigOverride(level);\n return JSON.parse(result.config_string);\n },\n async replaceConfigOverride(level: \"branch\" | \"environment\", config: Record<string, unknown>): Promise<void> {\n if (level === \"branch\") {\n const source = await app._interface.getPushedConfigSource();\n await app._interface.setConfigOverride(level, config, source);\n } else {\n await app._interface.setConfigOverride(level, config);\n }\n await app._refreshProjectConfig();\n },\n async update(update: AdminProjectUpdateOptions) {\n const { requirePublishableClientKey, ...projectUpdate } = update;\n const updateOptions = adminProjectUpdateOptionsToCrud(projectUpdate);\n const hasConfigUpdate = !!updateOptions.config\n && typedValues(updateOptions.config).some((value) => value !== undefined);\n const hasProjectUpdate = typedEntries(updateOptions).some(([key, value]) => {\n if (key === \"config\") return hasConfigUpdate;\n return value !== undefined;\n });\n\n if (hasProjectUpdate) {\n await app._interface.updateProject(updateOptions);\n await onRefresh();\n }\n\n if (requirePublishableClientKey !== undefined) {\n await app._interface.updateConfigOverride(\"project\", {\n \"project.requirePublishableClientKey\": requirePublishableClientKey,\n });\n await app._refreshProjectConfig();\n }\n },\n async delete() {\n await app._interface.deleteProject();\n },\n async getProductionModeErrors() {\n return getProductionModeErrors(data);\n },\n useProductionModeErrors() {\n return getProductionModeErrors(data);\n },\n };\n }\n\n _adminEmailTemplateFromCrud(data: EmailTemplateCrud['Admin']['Read']): AdminEmailTemplate {\n return {\n type: data.type,\n subject: data.subject,\n content: data.content,\n isDefault: data.is_default,\n };\n }\n\n _planUsageFromCrud(data: PlanUsageResponse): PlanUsage {\n return {\n ownerTeamId: data.owner_team_id,\n ownerTeamDisplayName: data.owner_team_display_name,\n planId: data.plan_id,\n planDisplayName: data.plan_display_name,\n periodStart: new Date(data.period_start_millis),\n periodEnd: new Date(data.period_end_millis),\n nextPlanId: data.next_plan_id,\n rows: data.rows.map((row) => ({\n itemId: row.item_id,\n displayName: row.display_name,\n kind: row.kind,\n used: row.used,\n limit: row.limit,\n remaining: row.remaining,\n overage: row.overage,\n isUnlimited: row.is_unlimited,\n })),\n };\n }\n\n override async getProject(): Promise<AdminProject> {\n return this._adminProjectFromCrud(\n Result.orThrow(await this._adminProjectCache.getOrWait([], \"write-only\")),\n () => this._refreshProject()\n );\n }\n\n override useProject(): AdminProject {\n const crud = useAsyncCache(this._adminProjectCache, [], \"adminApp.useProject()\");\n return useMemo(() => this._adminProjectFromCrud(\n crud,\n () => this._refreshProject()\n ), [crud]);\n }\n\n async getPlanUsage(): Promise<PlanUsage> {\n return this._planUsageFromCrud(Result.orThrow(await this._planUsageCache.getOrWait([], \"write-only\")));\n }\n\n usePlanUsage(): PlanUsage {\n const crud = useAsyncCache(this._planUsageCache, [], \"adminApp.usePlanUsage()\");\n return useMemo(() => this._planUsageFromCrud(crud), [crud]);\n }\n\n protected _createInternalApiKeyBaseFromCrud(data: InternalApiKeyBaseCrudRead): InternalApiKeyBase {\n const app = this;\n return {\n id: data.id,\n description: data.description,\n expiresAt: new Date(data.expires_at_millis),\n manuallyRevokedAt: data.manually_revoked_at_millis ? new Date(data.manually_revoked_at_millis) : null,\n createdAt: new Date(data.created_at_millis),\n isValid() {\n return this.whyInvalid() === null;\n },\n whyInvalid() {\n if (this.expiresAt.getTime() < Date.now()) return \"expired\";\n if (this.manuallyRevokedAt) return \"manually-revoked\";\n return null;\n },\n async revoke() {\n const res = await app._interface.revokeInternalApiKeyById(data.id);\n await app._refreshInternalApiKeys();\n return res;\n }\n };\n }\n\n protected _createInternalApiKeyFromCrud(data: InternalApiKeysCrud[\"Admin\"][\"Read\"]): InternalApiKey {\n return {\n ...this._createInternalApiKeyBaseFromCrud(data),\n publishableClientKey: data.publishable_client_key ? { lastFour: data.publishable_client_key.last_four } : null,\n secretServerKey: data.secret_server_key ? { lastFour: data.secret_server_key.last_four } : null,\n superSecretAdminKey: data.super_secret_admin_key ? { lastFour: data.super_secret_admin_key.last_four } : null,\n };\n }\n\n protected _createInternalApiKeyFirstViewFromCrud(data: InternalApiKeyCreateCrudResponse): InternalApiKeyFirstView {\n return {\n ...this._createInternalApiKeyBaseFromCrud(data),\n publishableClientKey: data.publishable_client_key,\n secretServerKey: data.secret_server_key,\n superSecretAdminKey: data.super_secret_admin_key,\n };\n }\n\n async listInternalApiKeys(): Promise<InternalApiKey[]> {\n const crud = Result.orThrow(await this._internalApiKeysCache.getOrWait([], \"write-only\"));\n return crud.map((j) => this._createInternalApiKeyFromCrud(j));\n }\n\n useInternalApiKeys(): InternalApiKey[] {\n const crud = useAsyncCache(this._internalApiKeysCache, [], \"adminApp.useInternalApiKeys()\");\n return useMemo(() => {\n return crud.map((j) => this._createInternalApiKeyFromCrud(j));\n }, [crud]);\n }\n\n async createInternalApiKey(options: InternalApiKeyCreateOptions): Promise<InternalApiKeyFirstView> {\n const crud = await this._interface.createInternalApiKey(internalApiKeyCreateOptionsToCrud(options));\n await this._refreshInternalApiKeys();\n return this._createInternalApiKeyFirstViewFromCrud(crud);\n }\n\n\n useEmailThemes(): { id: string, displayName: string }[] {\n const crud = useAsyncCache(this._adminEmailThemesCache, [], \"adminApp.useEmailThemes()\");\n return useMemo(() => {\n return crud.map((theme) => ({\n id: theme.id,\n displayName: theme.display_name,\n }));\n }, [crud]);\n }\n useEmailTemplates(): { id: string, displayName: string, themeId?: string, tsxSource: string }[] {\n const crud = useAsyncCache(this._adminEmailTemplatesCache, [], \"adminApp.useEmailTemplates()\");\n return useMemo(() => {\n return crud.map((template) => ({\n id: template.id,\n displayName: template.display_name,\n themeId: template.theme_id,\n tsxSource: template.tsx_source,\n }));\n }, [crud]);\n }\n useEmailDrafts(): { id: string, displayName: string, themeId: string | undefined | false, tsxSource: string, sentAt: Date | null }[] {\n const crud = useAsyncCache(this._adminEmailDraftsCache, [], \"adminApp.useEmailDrafts()\");\n return useMemo(() => {\n return crud.map((draft) => ({\n id: draft.id,\n displayName: draft.display_name,\n themeId: draft.theme_id,\n tsxSource: draft.tsx_source,\n sentAt: draft.sent_at_millis ? new Date(draft.sent_at_millis) : null,\n }));\n }, [crud]);\n }\n async listEmailThemes(): Promise<{ id: string, displayName: string }[]> {\n const crud = Result.orThrow(await this._adminEmailThemesCache.getOrWait([], \"write-only\"));\n return crud.map((theme) => ({\n id: theme.id,\n displayName: theme.display_name,\n }));\n }\n\n async listEmailTemplates(): Promise<{ id: string, displayName: string, themeId?: string, tsxSource: string }[]> {\n const crud = Result.orThrow(await this._adminEmailTemplatesCache.getOrWait([], \"write-only\"));\n return crud.map((template) => ({\n id: template.id,\n displayName: template.display_name,\n themeId: template.theme_id,\n tsxSource: template.tsx_source,\n }));\n }\n\n async listEmailDrafts(): Promise<{ id: string, displayName: string, themeId: string | undefined | false, tsxSource: string, sentAt: Date | null }[]> {\n const crud = Result.orThrow(await this._adminEmailDraftsCache.getOrWait([], \"write-only\"));\n return crud.map((draft) => ({\n id: draft.id,\n displayName: draft.display_name,\n themeId: draft.theme_id,\n tsxSource: draft.tsx_source,\n sentAt: draft.sent_at_millis ? new Date(draft.sent_at_millis) : null,\n }));\n }\n\n\n async createTeamPermissionDefinition(data: AdminTeamPermissionDefinitionCreateOptions): Promise<AdminTeamPermission> {\n const crud = await this._interface.createTeamPermissionDefinition(adminTeamPermissionDefinitionCreateOptionsToCrud(data));\n await this._adminTeamPermissionDefinitionsCache.refresh([]);\n return this._serverTeamPermissionDefinitionFromCrud(crud);\n }\n\n async updateTeamPermissionDefinition(permissionId: string, data: AdminTeamPermissionDefinitionUpdateOptions) {\n await this._interface.updateTeamPermissionDefinition(permissionId, adminTeamPermissionDefinitionUpdateOptionsToCrud(data));\n await this._adminTeamPermissionDefinitionsCache.refresh([]);\n }\n\n async deleteTeamPermissionDefinition(permissionId: string): Promise<void> {\n await this._interface.deleteTeamPermissionDefinition(permissionId);\n await this._adminTeamPermissionDefinitionsCache.refresh([]);\n }\n\n async listTeamPermissionDefinitions(): Promise<AdminTeamPermissionDefinition[]> {\n const crud = Result.orThrow(await this._adminTeamPermissionDefinitionsCache.getOrWait([], \"write-only\"));\n return crud.map((p) => this._serverTeamPermissionDefinitionFromCrud(p));\n }\n\n async listTeamPermissionDefinitionsPaginated(\n options: { limit: number, cursor?: string, query?: string },\n ): Promise<{ items: AdminTeamPermissionDefinition[], nextCursor: string | null }> {\n const result = await this._interface.listTeamPermissionDefinitionsPaginated(options);\n return {\n items: result.items.map((p) => this._serverTeamPermissionDefinitionFromCrud(p)),\n nextCursor: result.nextCursor,\n };\n }\n\n useTeamPermissionDefinitions(): AdminTeamPermissionDefinition[] {\n const crud = useAsyncCache(this._adminTeamPermissionDefinitionsCache, [], \"adminApp.useTeamPermissionDefinitions()\");\n return useMemo(() => {\n return crud.map((p) => this._serverTeamPermissionDefinitionFromCrud(p));\n }, [crud]);\n }\n\n async createProjectPermissionDefinition(data: AdminProjectPermissionDefinitionCreateOptions): Promise<AdminProjectPermission> {\n const crud = await this._interface.createProjectPermissionDefinition(adminProjectPermissionDefinitionCreateOptionsToCrud(data));\n await this._adminProjectPermissionDefinitionsCache.refresh([]);\n return this._serverProjectPermissionDefinitionFromCrud(crud);\n }\n\n async updateProjectPermissionDefinition(permissionId: string, data: AdminProjectPermissionDefinitionUpdateOptions) {\n await this._interface.updateProjectPermissionDefinition(permissionId, adminProjectPermissionDefinitionUpdateOptionsToCrud(data));\n await this._adminProjectPermissionDefinitionsCache.refresh([]);\n }\n\n async deleteProjectPermissionDefinition(permissionId: string): Promise<void> {\n await this._interface.deleteProjectPermissionDefinition(permissionId);\n await this._adminProjectPermissionDefinitionsCache.refresh([]);\n }\n\n async listProjectPermissionDefinitions(): Promise<AdminProjectPermissionDefinition[]> {\n const crud = Result.orThrow(await this._adminProjectPermissionDefinitionsCache.getOrWait([], \"write-only\"));\n return crud.map((p) => this._serverProjectPermissionDefinitionFromCrud(p));\n }\n\n useProjectPermissionDefinitions(): AdminProjectPermissionDefinition[] {\n const crud = useAsyncCache(this._adminProjectPermissionDefinitionsCache, [], \"adminApp.useProjectPermissionDefinitions()\");\n return useMemo(() => {\n return crud.map((p) => this._serverProjectPermissionDefinitionFromCrud(p));\n }, [crud]);\n }\n useSvixToken(): { token: string, url: string | undefined } {\n const crud = useAsyncCache(this._svixTokenCache, [], \"adminApp.useSvixToken()\");\n return { token: crud.token, url: crud.url };\n }\n\n protected override async _refreshProject() {\n await Promise.all([\n super._refreshProject(),\n this._adminProjectCache.refresh([]),\n ]);\n }\n\n protected async _refreshProjectConfig() {\n await Promise.all([\n this._configOverridesCache.refresh([]),\n this._adminProjectCache.refresh([]),\n ]);\n }\n\n protected async _refreshInternalApiKeys() {\n await this._internalApiKeysCache.refresh([]);\n }\n\n protected override async _refreshUsers() {\n await Promise.all([\n super._refreshUsers(),\n this._metricsCache.refreshWhere(() => true),\n this._metricsUserCountsCache.refresh([]),\n ]);\n }\n\n get [hexclaveAppInternalsSymbol]() {\n return {\n ...super[hexclaveAppInternalsSymbol],\n useMetrics: (\n includeAnonymous: boolean = false,\n filters?: { country_code?: string, referrer?: string, browser?: string, os?: string, device?: string, since?: string, until?: string },\n ): MetricsResponse => {\n const filtersKey = (() => {\n if (filters == null) return \"\";\n const params = new URLSearchParams();\n for (const key of [\"browser\", \"country_code\", \"device\", \"os\", \"referrer\", \"since\", \"until\"] as const) {\n const v = filters[key];\n if (v != null) params.set(key, v);\n }\n return params.toString();\n })();\n return useAsyncCache(this._metricsCache, [includeAnonymous, filtersKey] as const, \"adminApp.useMetrics()\") as MetricsResponse;\n },\n useUserActivity: (userId: string): UserActivityResponse => {\n return useAsyncCache(this._userActivityCache, [userId] as const, \"adminApp.useUserActivity()\") as UserActivityResponse;\n },\n useMetricsUserCounts: (): MetricsUserCounts => {\n return useAsyncCache(this._metricsUserCountsCache, [] as const, \"adminApp.useMetricsUserCounts()\") as MetricsUserCounts;\n },\n };\n }\n\n async sendTestEmail(options: {\n recipientEmail: string,\n emailConfig: EmailConfig,\n }): Promise<Result<undefined, { errorMessage: string }>> {\n let response: { success: boolean, error_message?: string };\n try {\n response = await this._interface.sendTestEmail({\n recipient_email: options.recipientEmail,\n email_config: {\n ...(pick(options.emailConfig, ['host', 'port', 'username', 'password'])),\n sender_email: options.emailConfig.senderEmail,\n sender_name: options.emailConfig.senderName,\n },\n });\n } catch (error) {\n // Translate the quota-exhaustion KnownError into the existing\n // Result.error shape so SDK/dashboard callers don't need to branch on\n // exceptions. The backend throws `ItemQuantityInsufficientAmount`\n // (consistent with every other limit-rejection endpoint), but this\n // method's historical contract has always been a `Result`.\n if (error instanceof KnownErrors.ItemQuantityInsufficientAmount) {\n return Result.error({\n errorMessage: \"Monthly email sending limit exceeded for your plan. Please upgrade your plan or wait until next month before sending more test emails.\",\n });\n }\n throw error;\n }\n\n if (response.success) {\n return Result.ok(undefined);\n } else {\n return Result.error({ errorMessage: response.error_message ?? throwErr(\"Email test error not specified\") });\n }\n }\n\n async sendTestWebhook(options: { endpointId: string }): Promise<Result<undefined, { errorMessage: string }>> {\n const response = await this._interface.sendTestWebhook({\n endpoint_id: options.endpointId,\n });\n\n if (response.success) {\n return Result.ok(undefined);\n } else {\n return Result.error({ errorMessage: response.error_message ?? throwErr(\"Webhook test error not specified\") });\n }\n }\n\n async listSentEmails(): Promise<AdminSentEmail[]> {\n const response = await this._interface.listSentEmails();\n return response.items.map((email) => ({\n id: email.id,\n to: email.to ?? [],\n subject: email.subject,\n recipient: email.to?.[0] ?? \"\",\n sentAt: new Date(email.sent_at_millis),\n error: email.error,\n }));\n }\n\n async setupManagedEmailProvider(options: { subdomain: string, senderLocalPart: string }): Promise<ManagedEmailProviderSetupResult> {\n const response = await this._interface.setupManagedEmailProvider({\n subdomain: options.subdomain,\n sender_local_part: options.senderLocalPart,\n });\n return {\n domainId: response.domain_id,\n subdomain: response.subdomain,\n senderLocalPart: response.sender_local_part,\n nameServerRecords: response.name_server_records,\n status: response.status,\n };\n }\n\n async checkManagedEmailStatus(options: { domainId: string, subdomain: string, senderLocalPart: string }): Promise<ManagedEmailProviderStatus> {\n const response = await this._interface.checkManagedEmailStatus({\n domain_id: options.domainId,\n subdomain: options.subdomain,\n sender_local_part: options.senderLocalPart,\n });\n return {\n status: response.status,\n };\n }\n\n async listManagedEmailDomains(): Promise<ManagedEmailProviderListItem[]> {\n const response = await this._interface.listManagedEmailDomains();\n return response.items.map((item) => ({\n domainId: item.domain_id,\n subdomain: item.subdomain,\n senderLocalPart: item.sender_local_part,\n status: item.status,\n nameServerRecords: item.name_server_records,\n }));\n }\n\n async applyManagedEmailProvider(options: { domainId: string }): Promise<{ status: \"applied\" }> {\n const result = await this._interface.applyManagedEmailProvider({\n domain_id: options.domainId,\n });\n await this._refreshProjectConfig();\n return result;\n }\n\n async deleteManagedEmailDomain(options: { resendDomainId: string }): Promise<{ status: \"deleted\" }> {\n return await this._interface.deleteManagedEmailDomain({\n resend_domain_id: options.resendDomainId,\n });\n }\n\n async sendSignInInvitationEmail(email: string, callbackUrl: string): Promise<void> {\n await this._interface.sendSignInInvitationEmail(email, callbackUrl);\n }\n\n async createEmailTemplate(displayName: string): Promise<{ id: string }> {\n const result = await this._interface.createEmailTemplate(displayName);\n await this._adminEmailTemplatesCache.refresh([]);\n\n return result;\n }\n\n async deleteEmailTemplate(id: string): Promise<void> {\n await this._interface.deleteEmailTemplate(id);\n await this._adminEmailTemplatesCache.refresh([]);\n }\n\n async createEmailDraft(options: { displayName: string, themeId?: string | false, tsxSource?: string }): Promise<{ id: string }> {\n const result = await this._interface.createEmailDraft({\n display_name: options.displayName,\n theme_id: options.themeId,\n tsx_source: options.tsxSource,\n });\n await this._adminEmailDraftsCache.refresh([]);\n return result;\n }\n\n async updateEmailDraft(id: string, data: { displayName?: string, themeId?: string | undefined | false, tsxSource?: string }): Promise<void> {\n await this._interface.updateEmailDraft(id, {\n display_name: data.displayName,\n theme_id: data.themeId,\n tsx_source: data.tsxSource,\n });\n await this._adminEmailDraftsCache.refresh([]);\n }\n\n async deleteEmailDraft(id: string): Promise<void> {\n await this._interface.deleteEmailDraft(id);\n const current = this._adminEmailDraftsCache.getIfCached([]);\n if (current.status === \"ok\" && current.data.status === \"ok\") {\n this._adminEmailDraftsCache.forceSetCachedValue([], Result.ok(current.data.data.filter((d) => d.id !== id)));\n }\n await this._adminEmailDraftsCache.refresh([]);\n }\n\n async refreshEmailDrafts(): Promise<void> {\n await this._adminEmailDraftsCache.refresh([]);\n }\n\n async saveChatMessage(threadId: string, message: any): Promise<void> {\n await this._interface.saveChatMessage(threadId, message);\n }\n\n async listChatMessages(threadId: string): Promise<{ messages: Array<any> }> {\n return await this._interface.listChatMessages(threadId);\n }\n\n async rewriteTemplateSourceWithAI(templateTsxSource: string): Promise<{ tsxSource: string }> {\n const result = await this._interface.rewriteTemplateSourceWithAI(templateTsxSource);\n return { tsxSource: result.tsx_source };\n }\n\n async createEmailTheme(displayName: string): Promise<{ id: string }> {\n const result = await this._interface.createEmailTheme(displayName);\n await this._adminEmailThemesCache.refresh([]);\n return result;\n }\n\n async getEmailPreview(options: { themeId?: string | null | false, themeTsxSource?: string, templateId?: string, templateTsxSource?: string }): Promise<string> {\n const result = Result.orThrow(await this._emailPreviewCache.getOrWait([options.themeId, options.themeTsxSource, options.templateId, options.templateTsxSource], \"write-only\"));\n return result.html;\n }\n useEmailPreview(options: { themeId?: string | null | false, themeTsxSource?: string, templateId?: string, templateTsxSource?: string }): string {\n const crud = useAsyncCache(this._emailPreviewCache, [options.themeId, options.themeTsxSource, options.templateId, options.templateTsxSource] as const, \"adminApp.useEmailPreview()\");\n return crud.html;\n }\n async getEmailPreviewWithEditableMarkers(options: { themeId?: string | null | false, themeTsxSource?: string, templateId?: string, templateTsxSource?: string, editableSource?: 'template' | 'theme' | 'both' }): Promise<{ html: string, editableRegions?: Record<string, unknown> }> {\n const result = await this._interface.renderEmailPreview({ ...options, editableMarkers: true, editableSource: options.editableSource });\n return { html: result.html, editableRegions: result.editable_regions };\n }\n useEmailPreviewWithEditableMarkers(options: { themeId?: string | null | false, themeTsxSource?: string, templateId?: string, templateTsxSource?: string, editableSource?: 'template' | 'theme' | 'both' }): { html: string, editableRegions?: Record<string, unknown> } {\n const crud = useAsyncCache(this._emailPreviewWithEditableMarkersCache, [options.themeId, options.themeTsxSource, options.templateId, options.templateTsxSource, options.editableSource] as const, \"adminApp.useEmailPreviewWithEditableMarkers()\");\n return { html: crud.html, editableRegions: crud.editable_regions };\n }\n useEmailTheme(id: string): { displayName: string, tsxSource: string } {\n const crud = useAsyncCache(this._adminEmailThemeCache, [id] as const, \"adminApp.useEmailTheme()\");\n return {\n displayName: crud.display_name,\n tsxSource: crud.tsx_source,\n };\n }\n async updateEmailTheme(id: string, tsxSource: string): Promise<void> {\n await this._interface.updateEmailTheme(id, tsxSource);\n await this._adminEmailThemesCache.refresh([]);\n await this._adminEmailThemeCache.invalidate([id]);\n }\n\n async deleteEmailTheme(id: string): Promise<void> {\n await this._interface.deleteEmailTheme(id);\n await this._adminEmailThemesCache.refresh([]);\n await this._adminEmailThemeCache.invalidate([id]);\n }\n\n async updateEmailTemplate(id: string, tsxSource: string, themeId: string | null | false): Promise<{ renderedHtml: string }> {\n const result = await this._interface.updateEmailTemplate(id, tsxSource, themeId);\n await this._adminEmailTemplatesCache.refresh([]);\n return { renderedHtml: result.rendered_html };\n }\n\n async setupPayments(): Promise<{ url: string }> {\n const result = await this._interface.setupPayments();\n await this._stripeAccountInfoCache.refresh([]);\n return result;\n }\n\n async createStripeWidgetAccountSession(): Promise<{ client_secret: string }> {\n return await this._interface.createStripeWidgetAccountSession();\n }\n\n async getPaymentMethodConfigs(): Promise<{ configId: string, methods: Array<{ id: string, name: string, enabled: boolean, available: boolean, overridable: boolean }> } | null> {\n return await this._interface.getPaymentMethodConfigs();\n }\n\n async updatePaymentMethodConfigs(configId: string, updates: Record<string, 'on' | 'off'>): Promise<void> {\n await this._interface.updatePaymentMethodConfigs(configId, updates);\n }\n\n async createItemQuantityChange(options: (\n { userId: string, itemId: string, quantity: number, expiresAt?: string, description?: string } |\n { teamId: string, itemId: string, quantity: number, expiresAt?: string, description?: string } |\n { customCustomerId: string, itemId: string, quantity: number, expiresAt?: string, description?: string }\n )): Promise<void> {\n await this._interface.updateItemQuantity(\n { itemId: options.itemId, ...(\"userId\" in options ? { userId: options.userId } : (\"teamId\" in options ? { teamId: options.teamId } : { customCustomerId: options.customCustomerId })) },\n {\n delta: options.quantity,\n expires_at: options.expiresAt,\n description: options.description,\n allow_negative: true,\n }\n );\n }\n\n async refundTransaction(options: {\n type: \"subscription\" | \"one-time-purchase\",\n id: string,\n invoiceId?: string,\n amountUsd: MoneyAmount,\n endAction?: \"now\" | \"at-period-end\",\n }): Promise<{ refundTransactionId: string }> {\n const result = await this._interface.refundTransaction({\n type: options.type,\n id: options.id,\n invoiceId: options.invoiceId,\n amountUsd: options.amountUsd,\n endAction: options.endAction,\n });\n await this._transactionsCache.invalidateWhere(() => true);\n return { refundTransactionId: result.refundTransactionId };\n }\n\n async listTransactions(params: { cursor?: string, limit?: number, type?: TransactionType, customerType?: 'user' | 'team' | 'custom', customerId?: string }): Promise<{ transactions: Transaction[], nextCursor: string | null }> {\n const crud = Result.orThrow(await this._transactionsCache.getOrWait([params.cursor, params.limit, params.type, params.customerType, params.customerId] as const, \"write-only\"));\n return crud;\n }\n\n // Email Outbox methods\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Complex discriminated union conversion from API response\n private _emailOutboxCrudToAdmin(crud: any): AdminEmailOutbox {\n const recipient = crud.to;\n let to: AdminEmailOutbox[\"to\"];\n if (recipient.type === \"user-primary-email\") {\n to = { type: \"user-primary-email\", userId: recipient.user_id };\n } else if (recipient.type === \"user-custom-emails\") {\n to = { type: \"user-custom-emails\", userId: recipient.user_id, emails: recipient.emails };\n } else {\n to = { type: \"custom-emails\", emails: recipient.emails };\n }\n\n // Base fields present on all emails\n const base = {\n id: crud.id as string,\n createdAt: new Date(crud.created_at_millis),\n updatedAt: new Date(crud.updated_at_millis),\n tsxSource: crud.tsx_source as string,\n themeId: (crud.theme_id as string | null) ?? null,\n to,\n scheduledAt: new Date(crud.scheduled_at_millis),\n // Source tracking for grouping emails by template/draft\n createdWith: crud.created_with as \"draft\" | \"programmatic-call\",\n emailDraftId: crud.email_draft_id as string | null,\n emailProgrammaticCallTemplateId: crud.email_programmatic_call_template_id as string | null,\n variables: (crud.variables ?? {}) as Record<string, Json>,\n isPaused: false as const,\n hasRendered: false as const,\n hasDelivered: false as const,\n // Retry tracking fields\n sendRetries: crud.send_retries as number,\n nextSendRetryAt: crud.next_send_retry_at_millis ? new Date(crud.next_send_retry_at_millis) : null,\n sendAttemptErrors: crud.send_attempt_errors ? (crud.send_attempt_errors as Array<{\n attempt_number: number,\n timestamp: string,\n external_message: string,\n external_details: Record<string, unknown>,\n internal_message: string,\n internal_details: Record<string, unknown>,\n }>).map((e) => ({\n attemptNumber: e.attempt_number,\n timestamp: e.timestamp,\n externalMessage: e.external_message,\n externalDetails: e.external_details,\n internalMessage: e.internal_message,\n internalDetails: e.internal_details,\n })) : null,\n };\n\n // Rendered fields (available after rendering completes successfully)\n const rendered = crud.has_rendered ? {\n ...base,\n startedRenderingAt: new Date(crud.started_rendering_at_millis),\n renderedAt: new Date(crud.rendered_at_millis),\n subject: crud.subject as string,\n html: crud.html as string | null,\n text: crud.text as string | null,\n isTransactional: crud.is_transactional as boolean,\n isHighPriority: crud.is_high_priority as boolean,\n notificationCategoryId: crud.notification_category_id as string | null,\n hasRendered: true as const,\n } : null;\n\n // Started sending fields\n const startedSending = rendered && crud.started_sending_at_millis ? {\n ...rendered,\n startedSendingAt: new Date(crud.started_sending_at_millis),\n } : null;\n\n // Finished delivering fields\n const finishedDelivering = startedSending && crud.has_delivered ? {\n ...startedSending,\n deliveredAt: new Date(crud.delivered_at_millis),\n hasDelivered: true as const,\n } : null;\n\n // Use type assertion at the end because TypeScript has trouble with\n // spread + override patterns on discriminated unions with const literal types\n const result = (() => {\n switch (crud.status) {\n case \"paused\": {\n return {\n ...base,\n status: \"paused\" as const,\n simpleStatus: \"in-progress\" as const,\n isPaused: true as const,\n };\n }\n case \"preparing\": {\n return {\n ...base,\n status: \"preparing\" as const,\n simpleStatus: \"in-progress\" as const,\n };\n }\n case \"rendering\": {\n return {\n ...base,\n status: \"rendering\" as const,\n simpleStatus: \"in-progress\" as const,\n startedRenderingAt: new Date(crud.started_rendering_at_millis),\n };\n }\n case \"render-error\": {\n return {\n ...base,\n status: \"render-error\" as const,\n simpleStatus: \"error\" as const,\n startedRenderingAt: new Date(crud.started_rendering_at_millis),\n renderedAt: new Date(crud.rendered_at_millis),\n renderError: crud.render_error,\n };\n }\n case \"scheduled\": {\n return {\n ...rendered!,\n status: \"scheduled\" as const,\n simpleStatus: \"in-progress\" as const,\n };\n }\n case \"queued\": {\n return {\n ...rendered!,\n status: \"queued\" as const,\n simpleStatus: \"in-progress\" as const,\n };\n }\n case \"sending\": {\n return {\n ...startedSending!,\n status: \"sending\" as const,\n simpleStatus: \"in-progress\" as const,\n };\n }\n case \"server-error\": {\n return {\n ...startedSending!,\n status: \"server-error\" as const,\n simpleStatus: \"error\" as const,\n errorAt: new Date(crud.error_at_millis),\n serverError: crud.server_error,\n };\n }\n case \"skipped\": {\n return {\n ...base,\n status: \"skipped\" as const,\n simpleStatus: \"ok\" as const,\n skippedAt: new Date(crud.skipped_at_millis),\n skippedReason: crud.skipped_reason,\n skippedDetails: crud.skipped_details ?? {},\n hasRendered: crud.has_rendered as boolean,\n // Optional fields\n startedRenderingAt: crud.started_rendering_at_millis ? new Date(crud.started_rendering_at_millis) : undefined,\n renderedAt: crud.rendered_at_millis ? new Date(crud.rendered_at_millis) : undefined,\n subject: crud.subject,\n html: crud.html,\n text: crud.text,\n isTransactional: crud.is_transactional,\n isHighPriority: crud.is_high_priority,\n notificationCategoryId: crud.notification_category_id,\n startedSendingAt: crud.started_sending_at_millis ? new Date(crud.started_sending_at_millis) : undefined,\n };\n }\n case \"bounced\": {\n return {\n ...startedSending!,\n status: \"bounced\" as const,\n simpleStatus: \"error\" as const,\n bouncedAt: new Date(crud.bounced_at_millis),\n };\n }\n case \"delivery-delayed\": {\n return {\n ...startedSending!,\n status: \"delivery-delayed\" as const,\n simpleStatus: \"ok\" as const,\n deliveryDelayedAt: new Date(crud.delivery_delayed_at_millis),\n };\n }\n case \"sent\": {\n return {\n ...finishedDelivering!,\n status: \"sent\" as const,\n simpleStatus: \"ok\" as const,\n canHaveDeliveryInfo: crud.can_have_delivery_info,\n };\n }\n case \"opened\": {\n return {\n ...finishedDelivering!,\n status: \"opened\" as const,\n simpleStatus: \"ok\" as const,\n openedAt: new Date(crud.opened_at_millis),\n canHaveDeliveryInfo: true as const,\n };\n }\n case \"clicked\": {\n return {\n ...finishedDelivering!,\n status: \"clicked\" as const,\n simpleStatus: \"ok\" as const,\n clickedAt: new Date(crud.clicked_at_millis),\n canHaveDeliveryInfo: true as const,\n };\n }\n case \"marked-as-spam\": {\n return {\n ...finishedDelivering!,\n status: \"marked-as-spam\" as const,\n simpleStatus: \"ok\" as const,\n markedAsSpamAt: new Date(crud.marked_as_spam_at_millis),\n canHaveDeliveryInfo: true as const,\n };\n }\n default: {\n throw new HexclaveAssertionError(`Unknown email outbox status: ${crud.status}`, { status: crud.status });\n }\n }\n })();\n // The type system has difficulty with spread + override patterns on discriminated unions,\n // so we use a type assertion here. The switch statement above ensures we return the correct shape.\n return result as AdminEmailOutbox;\n }\n\n async listOutboxEmails(options?: { status?: string, simpleStatus?: string, userId?: string, limit?: number, cursor?: string }): Promise<{ items: AdminEmailOutbox[], nextCursor: string | null }> {\n const response = await this._interface.listOutboxEmails({\n status: options?.status,\n simple_status: options?.simpleStatus,\n user_id: options?.userId,\n limit: options?.limit,\n cursor: options?.cursor,\n });\n return {\n items: response.items.map((item) => this._emailOutboxCrudToAdmin(item)),\n nextCursor: response.pagination?.next_cursor ?? null,\n };\n }\n\n async getOutboxEmail(id: string): Promise<AdminEmailOutbox> {\n const response = await this._interface.getOutboxEmail(id);\n return this._emailOutboxCrudToAdmin(response);\n }\n\n async updateOutboxEmail(id: string, options: EmailOutboxUpdateOptions): Promise<AdminEmailOutbox> {\n const response = await this._interface.updateOutboxEmail(id, {\n is_paused: options.isPaused,\n scheduled_at_millis: options.scheduledAtMillis,\n cancel: options.cancel,\n tsx_source: options.tsxSource,\n theme_id: options.themeId,\n });\n return this._emailOutboxCrudToAdmin(response);\n }\n\n async pauseOutboxEmail(id: string): Promise<AdminEmailOutbox> {\n return await this.updateOutboxEmail(id, { isPaused: true });\n }\n\n async unpauseOutboxEmail(id: string): Promise<AdminEmailOutbox> {\n return await this.updateOutboxEmail(id, { isPaused: false });\n }\n\n async cancelOutboxEmail(id: string): Promise<AdminEmailOutbox> {\n return await this.updateOutboxEmail(id, { cancel: true });\n }\n\n useTransactions(params: { cursor?: string, limit?: number, type?: TransactionType, customerType?: 'user' | 'team' | 'custom', customerId?: string }): { transactions: Transaction[], nextCursor: string | null } {\n const data = useAsyncCache(this._transactionsCache, [params.cursor, params.limit, params.type, params.customerType, params.customerId] as const, \"adminApp.useTransactions()\");\n return data;\n }\n\n async getStripeAccountInfo(): Promise<null | { account_id: string, charges_enabled: boolean, details_submitted: boolean, payouts_enabled: boolean }> {\n return Result.orThrow(await this._stripeAccountInfoCache.getOrWait([], \"write-only\"));\n }\n\n useStripeAccountInfo(): { account_id: string, charges_enabled: boolean, details_submitted: boolean, payouts_enabled: boolean } | null {\n const data = useAsyncCache(this._stripeAccountInfoCache, [], \"adminApp.useStripeAccountInfo()\");\n return data;\n }\n\n async queryAnalytics(options: AnalyticsQueryOptions): Promise<AnalyticsQueryResponse> {\n return await this._interface.queryAnalytics(options);\n }\n\n async getAnalyticsClickmap(options: AnalyticsClickmapOptions): Promise<AnalyticsClickmapResponse> {\n return await this._interface.getAnalyticsClickmap({\n kind: options.kind,\n member_user_ids: options.memberUserIds,\n route_path: options.routePath,\n route_regex: options.routeRegex,\n url_pattern: options.urlPattern,\n user_id: options.userId,\n replay_id: options.replayId,\n device: options.device,\n viewport_width_min: options.viewportWidthMin,\n viewport_width_max: options.viewportWidthMax,\n sampling: options.sampling,\n since: options.since,\n until: options.until,\n });\n }\n\n async createAnalyticsClickmapToken(options: { origin: string }): Promise<AnalyticsClickmapTokenResponse> {\n return await this._interface.createAnalyticsClickmapToken(options);\n }\n\n async listSessionReplays(options?: ListSessionReplaysOptions): Promise<ListSessionReplaysResult> {\n const response = await this._interface.listSessionReplays({\n cursor: options?.cursor,\n limit: options?.limit,\n user_ids: options?.userIds,\n team_ids: options?.teamIds,\n duration_ms_min: options?.durationMsMin,\n duration_ms_max: options?.durationMsMax,\n last_event_at_from_millis: options?.lastEventAtFromMillis,\n last_event_at_to_millis: options?.lastEventAtToMillis,\n click_count_min: options?.clickCountMin,\n });\n\n const items: AdminSessionReplay[] = response.items.map((r) => ({\n id: r.id,\n projectUser: {\n id: r.project_user.id,\n displayName: r.project_user.display_name,\n primaryEmail: r.project_user.primary_email,\n },\n startedAt: new Date(r.started_at_millis),\n lastEventAt: new Date(r.last_event_at_millis),\n chunkCount: r.chunk_count,\n eventCount: r.event_count,\n }));\n\n return {\n items,\n nextCursor: response.pagination.next_cursor,\n };\n }\n\n async getSessionReplay(sessionReplayId: string): Promise<AdminSessionReplay> {\n const response = await this._interface.getSessionReplay(sessionReplayId);\n return {\n id: response.id,\n projectUser: {\n id: response.project_user.id,\n displayName: response.project_user.display_name,\n primaryEmail: response.project_user.primary_email,\n },\n startedAt: new Date(response.started_at_millis),\n lastEventAt: new Date(response.last_event_at_millis),\n chunkCount: response.chunk_count,\n eventCount: response.event_count,\n };\n }\n\n async listSessionReplayChunks(sessionReplayId: string, options?: ListSessionReplayChunksOptions): Promise<ListSessionReplayChunksResult> {\n const response = await this._interface.listSessionReplayChunks(sessionReplayId, {\n cursor: options?.cursor,\n limit: options?.limit,\n });\n\n const items: AdminSessionReplayChunk[] = response.items.map((c) => ({\n id: c.id,\n batchId: c.batch_id,\n sessionReplaySegmentId: c.session_replay_segment_id,\n browserSessionId: c.browser_session_id,\n eventCount: c.event_count,\n byteLength: c.byte_length,\n firstEventAt: new Date(c.first_event_at_millis),\n lastEventAt: new Date(c.last_event_at_millis),\n createdAt: new Date(c.created_at_millis),\n }));\n\n return {\n items,\n nextCursor: response.pagination.next_cursor,\n };\n }\n\n async getSessionReplayChunkEvents(sessionReplayId: string, chunkId: string): Promise<AdminGetSessionReplayChunkEventsResponse> {\n return await this._interface.getSessionReplayChunkEvents(sessionReplayId, chunkId);\n }\n\n async getSessionReplayEvents(sessionReplayId: string, options?: { offset?: number, limit?: number }): Promise<SessionReplayAllEventsResult> {\n const response = await this._interface.getSessionReplayEvents(sessionReplayId, options);\n return {\n chunks: response.chunks.map((c) => ({\n id: c.id,\n batchId: c.batch_id,\n sessionReplaySegmentId: c.session_replay_segment_id,\n eventCount: c.event_count,\n byteLength: c.byte_length,\n firstEventAt: new Date(c.first_event_at_millis),\n lastEventAt: new Date(c.last_event_at_millis),\n createdAt: new Date(c.created_at_millis),\n })),\n chunkEvents: response.chunk_events.map((ce) => ({\n chunkId: ce.chunk_id,\n events: ce.events,\n })),\n };\n }\n\n async previewAffectedUsersByOnboardingChange(\n onboarding: { requireEmailVerification?: boolean },\n limit?: number,\n ): Promise<{\n affectedUsers: Array<{\n id: string,\n displayName: string | null,\n primaryEmail: string | null,\n restrictedReason: RestrictedReason,\n }>,\n totalAffectedCount: number,\n }> {\n const result = await this._interface.previewAffectedUsersByOnboardingChange(\n { require_email_verification: onboarding.requireEmailVerification },\n limit,\n );\n return {\n affectedUsers: result.affected_users.map(u => ({\n id: u.id,\n displayName: u.display_name,\n primaryEmail: u.primary_email,\n restrictedReason: u.restricted_reason as RestrictedReason,\n })),\n totalAffectedCount: result.total_affected_count,\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA4CA,SAAS,wBAAwB,QAAmD;AAClF,KAAI,OAAO,SAAS,qBAClB,QAAO;EACL,MAAM;EACN,OAAO,OAAO;EACd,MAAM,OAAO;EACb,QAAQ,OAAO;EACf,aAAa,OAAO;EACpB,kBAAkB,OAAO;EACzB,eAAe,OAAO;EACvB;AAEH,QAAO;;;;;AAMT,SAAS,wBAAwB,QAAmD;AAClF,KAAI,OAAO,SAAS,qBAClB,QAAO;EACL,MAAM;EACN,OAAO,OAAO;EACd,MAAM,OAAO;EACb,QAAQ,OAAO;EACf,YAAY,OAAO;EACnB,gBAAgB,OAAO;EACvB,cAAc,OAAO;EACtB;AAEH,QAAO;;AAGT,IAAa,kCAAb,cAA8G,iCAA8G;CAsE1N,YAAY,SAAoE,cAAwG;EACtL,MAAM,kBAAkB,0BAA0B,QAAQ;EAE1D,MAAM,uBAAuB,gBAAgB,wBAAwB,gCAAgC;AAErG,QAAM,iBAAiB;GACrB,GAAG;GACH,WAAW,cAAc,oBAAoB;IAC3C,MAAM,UAAU,eAAe,gBA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kB;IACzC,EAAE;GAID,YAAY,SAAS,WAAW;GACjC;;CAGH,MAAM,4BAA4B,iBAAyB,SAAoE;AAC7H,SAAO,MAAM,KAAK,WAAW,4BAA4B,iBAAiB,QAAQ;;CAGpF,MAAM,uBAAuB,iBAAyB,SAAsF;EAC1I,MAAM,WAAW,MAAM,KAAK,WAAW,uBAAuB,iBAAiB,QAAQ;AACvF,SAAO;GACL,QAAQ,SAAS,OAAO,KAAK,OAAO;IAClC,IAAI,EAAE;IACN,SAAS,EAAE;IACX,wBAAwB,EAAE;IAC1B,YAAY,EAAE;IACd,YAAY,EAAE;IACd,cAAc,IAAI,KAAK,EAAE,sBAAsB;IAC/C,aAAa,IAAI,KAAK,EAAE,qBAAqB;IAC7C,WAAW,IAAI,KAAK,EAAE,kBAAkB;IACzC,EAAE;GACH,aAAa,SAAS,aAAa,KAAK,QAAQ;IAC9C,SAAS,GAAG;IACZ,QAAQ,GAAG;IACZ,EAAE;GACJ;;CAGH,MAAM,uCACJ,YACA,OASC;EACD,MAAM,SAAS,MAAM,KAAK,WAAW,uCACnC,EAAE,4BAA4B,WAAW,0BAA0B,EACnE,MACD;AACD,SAAO;GACL,eAAe,OAAO,eAAe,KAAI,OAAM;IAC7C,IAAI,EAAE;IACN,aAAa,EAAE;IACf,cAAc,EAAE;IAChB,kBAAkB,EAAE;IACrB,EAAE;GACH,oBAAoB,OAAO;GAC5B"}
@@ -14,7 +14,7 @@ import { envVars } from "../../../../generated/env.js";
14
14
  import { resolveHandlerUrls } from "../../url-targets.js";
15
15
 
16
16
  //#region src/lib/hexclave-app/apps/implementations/common.ts
17
- const clientVersion = "js @hexclave/react@1.0.27";
17
+ const clientVersion = "js @hexclave/react@1.0.29";
18
18
  if (clientVersion.startsWith("STACK_COMPILE_TIME")) throw new HexclaveAssertionError("Client version was not replaced. Something went wrong during build!");
19
19
  const replaceHexclavePortPrefix = (input) => {
20
20
  if (!input) return input;
@@ -447,7 +447,7 @@ function mountPushedConfigErrorOverlay(app) {
447
447
  }
448
448
  });
449
449
  };
450
- refresh();
450
+ queueMicrotask(refresh);
451
451
  const interval = setInterval(refresh, REFRESH_INTERVAL_MS);
452
452
  const cleanup = () => {
453
453
  disposed = true;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/pushed-config-error-overlay/index.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { captureError } from \"@hexclave/shared/dist/utils/errors\";\nimport { runAsynchronously } from \"@hexclave/shared/dist/utils/promises\";\nimport { isLocalhost } from \"@hexclave/shared/dist/utils/urls\";\nimport { envVars } from \"../generated/env\";\nimport { getInPageUiBaseCSS } from \"../in-page-ui/base-styles\";\nimport { canMountIntoDom, getGlobalUiInstance, h, setGlobalUiInstance, setHtml } from \"../in-page-ui/dom\";\nimport type { StackClientApp } from \"../lib/hexclave-app\";\n\nconst GLOBAL_INSTANCE_KEY = \"__hexclave-pushed-config-error-overlay\";\nconst MINIMIZED_STORAGE_KEY = \"hexclave-pushed-config-error-minimized-key\";\nconst REFRESH_INTERVAL_MS = 5_000;\nconst HEXCLAVE_LOGO_SVG = '<svg width=\"16\" height=\"16\" viewBox=\"0 0 48 48\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"3\" stroke-linejoin=\"miter\"><path d=\"M 24 4 L 41.32 14 L 41.32 34 L 24 44 L 6.68 34 L 6.68 14 Z\"/><path d=\"M 11 16.87 L 14 15.13 L 14 32.87 L 11 31.13 Z\" fill=\"currentColor\" stroke=\"none\"/><path d=\"M 11 16.87 L 14 15.13 L 14 32.87 L 11 31.13 Z\" fill=\"currentColor\" stroke=\"none\" transform=\"rotate(120 24 24)\"/><path d=\"M 11 16.87 L 14 15.13 L 14 32.87 L 11 31.13 Z\" fill=\"currentColor\" stroke=\"none\" transform=\"rotate(240 24 24)\"/></svg>';\nconst COPY_ICON_SVG = '<svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.25\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\"/><path d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\"/></svg>';\n\ntype ConfigIssue = {\n kind: \"error\" | \"warning\",\n messages: string[],\n};\n\nconst css = getInPageUiBaseCSS(\".hexclave-config-error-overlay\") + `\n .hexclave-config-error-overlay .hce-backdrop {\n position: fixed;\n inset: 0;\n z-index: 2147483647;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 24px;\n background: rgba(0, 0, 0, 0.46);\n backdrop-filter: blur(6px);\n overflow: auto;\n }\n\n .hexclave-config-error-overlay .hce-card {\n --hce-status: var(--sdt-error);\n width: min(720px, calc(100vw - 32px));\n max-height: min(640px, calc(100dvh - 48px));\n border: 1px solid color-mix(in srgb, var(--hce-status) 35%, var(--sdt-border));\n border-radius: 18px;\n background: var(--sdt-overlay-bg);\n box-shadow: var(--sdt-shadow);\n backdrop-filter: blur(18px);\n display: flex;\n overflow: hidden;\n }\n\n .hexclave-config-error-overlay .hce-card-warning {\n --hce-status: var(--sdt-warning);\n }\n\n .hexclave-config-error-overlay .hce-card-inner {\n padding: 18px;\n width: 100%;\n overflow: auto;\n }\n\n .hexclave-config-error-overlay .hce-header {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: 12px;\n margin-bottom: 12px;\n }\n\n .hexclave-config-error-overlay .hce-title-row {\n display: flex;\n align-items: flex-start;\n gap: 10px;\n min-width: 0;\n }\n\n .hexclave-config-error-overlay .hce-logo {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 34px;\n height: 34px;\n border-radius: 10px;\n background: var(--hce-status);\n color: white;\n box-shadow: 0 10px 30px color-mix(in srgb, var(--hce-status) 32%, transparent);\n }\n\n .hexclave-config-error-overlay .hce-badge {\n display: inline-flex;\n flex-shrink: 0;\n padding: 2px 6px;\n border-radius: 999px;\n background: var(--hce-status);\n color: white;\n font-size: 10px;\n font-weight: 700;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n }\n\n .hexclave-config-error-overlay .hce-title {\n color: var(--sdt-text);\n margin-top: 4px;\n font-size: 18px;\n font-weight: 700;\n line-height: 1.25;\n }\n\n .hexclave-config-error-overlay .hce-actions {\n display: flex;\n gap: 4px;\n }\n\n .hexclave-config-error-overlay .hce-icon-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border: 1px solid var(--sdt-border);\n border-radius: 8px;\n background: var(--sdt-bg-elevated);\n color: var(--sdt-text-secondary);\n cursor: pointer;\n font: inherit;\n line-height: 1;\n vertical-align: top;\n }\n\n .hexclave-config-error-overlay .hce-icon-btn svg {\n display: block;\n flex-shrink: 0;\n }\n\n .hexclave-config-error-overlay .hce-text-btn {\n align-items: center;\n gap: 6px;\n min-height: 28px;\n padding: 0 10px;\n width: auto;\n font-size: 12px;\n line-height: 1;\n }\n\n .hexclave-config-error-overlay .hce-icon-btn:hover {\n background: var(--sdt-bg-hover);\n color: var(--sdt-text);\n }\n\n .hexclave-config-error-overlay .hce-body {\n color: var(--sdt-text-secondary);\n font-size: 14px;\n line-height: 1.5;\n }\n\n .hexclave-config-error-overlay .hce-message-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 10px;\n margin-top: 14px;\n margin-bottom: 8px;\n }\n\n .hexclave-config-error-overlay .hce-message-label {\n color: var(--sdt-text);\n font-size: 12px;\n font-weight: 650;\n }\n\n .hexclave-config-error-overlay .hce-message {\n padding: 12px;\n max-height: min(260px, max(96px, 30dvh));\n overflow: auto;\n border: 1px solid var(--sdt-border-subtle);\n border-radius: 10px;\n background: var(--sdt-bg-subtle);\n color: var(--sdt-text);\n font-family: var(--sdt-font-mono);\n font-size: 12px;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n }\n\n .hexclave-config-error-overlay .hce-footer {\n margin-top: 10px;\n color: var(--sdt-text-tertiary);\n font-size: 12px;\n }\n\n .hexclave-config-error-overlay .hce-pill {\n position: fixed;\n right: 18px;\n bottom: 18px;\n z-index: 2147483647;\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 12px 8px 8px;\n --hce-status: var(--sdt-error);\n border: 1px solid color-mix(in srgb, var(--hce-status) 35%, var(--sdt-border));\n border-radius: 999px;\n background: var(--sdt-overlay-bg);\n box-shadow: var(--sdt-trigger-shadow);\n color: var(--sdt-text);\n cursor: pointer;\n font: inherit;\n backdrop-filter: blur(18px);\n }\n\n .hexclave-config-error-overlay .hce-pill-warning {\n --hce-status: var(--sdt-warning);\n }\n\n .hexclave-config-error-overlay .hce-pill-logo {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 26px;\n height: 26px;\n border-radius: 999px;\n background: var(--hce-status);\n color: white;\n }\n\n @media (max-height: 520px) {\n .hexclave-config-error-overlay .hce-backdrop {\n align-items: flex-start;\n padding: 12px;\n }\n\n .hexclave-config-error-overlay .hce-card {\n width: min(720px, calc(100vw - 24px));\n max-height: calc(100dvh - 24px);\n }\n\n .hexclave-config-error-overlay .hce-card-inner {\n padding: 12px;\n }\n\n .hexclave-config-error-overlay .hce-header {\n margin-bottom: 8px;\n }\n\n .hexclave-config-error-overlay .hce-title {\n font-size: 16px;\n }\n\n .hexclave-config-error-overlay .hce-body {\n font-size: 13px;\n }\n\n .hexclave-config-error-overlay .hce-message {\n max-height: max(80px, 24dvh);\n }\n }\n`;\n\nfunction storageGet(key: string): string | null {\n try {\n return localStorage.getItem(key);\n } catch {\n return null;\n }\n}\n\nfunction storageSet(key: string, value: string): void {\n try {\n localStorage.setItem(key, value);\n } catch {\n // Storage may be unavailable in private or embedded contexts.\n }\n}\n\nfunction storageRemove(key: string): void {\n try {\n localStorage.removeItem(key);\n } catch {\n // Storage may be unavailable in private or embedded contexts.\n }\n}\n\nfunction shouldMount(): boolean {\n if (!canMountIntoDom()) {\n return false;\n }\n\n const nodeEnv = envVars.NODE_ENV;\n if (nodeEnv !== undefined) {\n return nodeEnv === \"development\";\n }\n\n try {\n const url = new URL(window.location.href);\n if (url.protocol === \"file:\") {\n return true;\n }\n } catch {\n return false;\n }\n return isLocalhost(window.location.href);\n}\n\nasync function copyTextToClipboard(text: string): Promise<void> {\n const clipboard: unknown = Reflect.get(navigator, \"clipboard\");\n const writeText = clipboard != null && typeof clipboard === \"object\"\n ? Reflect.get(clipboard, \"writeText\")\n : null;\n if (typeof writeText === \"function\") {\n await writeText.call(clipboard, text);\n return;\n }\n\n const textarea = h(\"textarea\", {\n style: {\n position: \"fixed\",\n left: \"-9999px\",\n top: \"0\",\n opacity: \"0\",\n },\n readonly: \"true\",\n }) as HTMLTextAreaElement;\n textarea.value = text;\n document.body.appendChild(textarea);\n textarea.select();\n const copied = document.execCommand(\"copy\");\n textarea.remove();\n if (!copied) {\n throw new Error(\"Browser refused to copy the config error message.\");\n }\n}\n\nfunction buildConfigIssueAiPrompt(issue: ConfigIssue): string {\n const issueLabel = issue.kind === \"error\" ? \"error\" : \"warning\";\n return [\n `Help me fix this Hexclave config ${issueLabel}.`,\n \"\",\n \"Hexclave reminder:\",\n `This ${issueLabel} comes from a pushed Hexclave config file. The app may keep running with the synced Hexclave config, but I need to fix the config file mentioned in the message and save it again so Hexclave can sync the config successfully and clear the dialog. Use your web fetch tool to read https://skill.hexclave.com to learn more about Hexclave.`,\n \"\",\n issue.kind === \"error\" ? \"Error message:\" : \"Warning message:\",\n issue.messages.join(\"\\n\"),\n \"\",\n \"Please explain the likely cause, identify the config key or value I should change, and suggest the smallest safe fix.\",\n ].join(\"\\n\");\n}\n\nexport function mountPushedConfigErrorOverlay(app: StackClientApp<true>): () => void {\n if (!shouldMount()) {\n return () => {};\n }\n\n getGlobalUiInstance(GLOBAL_INSTANCE_KEY)?.cleanup();\n\n const root = h(\"div\", { className: \"hexclave-config-error-overlay\" });\n const style = h(\"style\", null, css);\n root.appendChild(style);\n document.body.appendChild(root);\n\n let disposed = false;\n let lastErrorKey: string | null = null;\n let lastConsoleErrorKey: string | null = null;\n let minimized = false;\n\n const render = (issue: ConfigIssue | null) => {\n root.replaceChildren(style);\n if (issue == null) {\n lastErrorKey = null;\n minimized = false;\n return;\n }\n\n const issueMessage = issue.messages.join(\"\\n\");\n const issueKey = `${app.projectId}:${issue.kind}:${issueMessage}`;\n const issueLabel = issue.kind === \"error\" ? \"error\" : \"warning\";\n const issueTitle = issue.kind === \"error\"\n ? \"Your Hexclave config has been saved, but contains errors\"\n : \"Your Hexclave config has been saved, but has warnings\";\n const bodyText = issue.kind === \"error\"\n ? \"Your app can keep running, but Hexclave is still using the last valid config until this is fixed.\"\n : \"Your app can keep running, but part of your Hexclave config may not behave the way you expect until this is fixed.\";\n const footerText = issue.kind === \"error\"\n ? \"Fix the config file mentioned above and save it again. This message will disappear after the config sync succeeds.\"\n : \"Fix the config file mentioned above and save it again. This warning will disappear after Hexclave syncs a config without warnings.\";\n if (issueKey !== lastConsoleErrorKey) {\n lastConsoleErrorKey = issueKey;\n const consoleMessage = `[Hexclave] Config ${issueLabel}: ${issueMessage}`;\n if (issue.kind === \"error\") {\n console.error(consoleMessage);\n } else {\n console.warn(consoleMessage);\n }\n }\n\n if (issueKey !== lastErrorKey) {\n lastErrorKey = issueKey;\n minimized = storageGet(MINIMIZED_STORAGE_KEY) === issueKey;\n }\n\n if (minimized) {\n const logoSpan = h(\"span\", { className: \"hce-pill-logo\" });\n setHtml(logoSpan, HEXCLAVE_LOGO_SVG);\n root.appendChild(h(\"button\", {\n className: issue.kind === \"error\" ? \"hce-pill\" : \"hce-pill hce-pill-warning\",\n type: \"button\",\n onClick: () => {\n minimized = false;\n storageRemove(MINIMIZED_STORAGE_KEY);\n render(issue);\n },\n },\n logoSpan,\n h(\"span\", null, issue.kind === \"error\" ? \"Config error\" : \"Config warning\")));\n return;\n }\n\n const logoSpan = h(\"span\", { className: \"hce-logo\" });\n setHtml(logoSpan, HEXCLAVE_LOGO_SVG);\n const copyButton = h(\"button\", {\n className: \"hce-icon-btn hce-text-btn\",\n type: \"button\",\n title: issue.kind === \"error\" ? \"Copy error message\" : \"Copy warning message\",\n \"aria-label\": issue.kind === \"error\" ? \"Copy config error message\" : \"Copy config warning message\",\n onClick: () => {\n runAsynchronously(async () => {\n await copyTextToClipboard(issueMessage);\n copyButton.textContent = \"Copied\";\n setTimeout(() => {\n setHtml(copyButton, `${COPY_ICON_SVG}Copy`);\n }, 1500);\n }, {\n noErrorLogging: true,\n onError: (copyError) => {\n captureError(\"pushed-config-error-overlay-copy\", copyError);\n copyButton.textContent = \"Copy failed\";\n setTimeout(() => {\n setHtml(copyButton, `${COPY_ICON_SVG}Copy`);\n }, 1500);\n },\n });\n },\n });\n setHtml(copyButton, `${COPY_ICON_SVG}Copy`);\n\n const aiPromptCopyButton = h(\"button\", {\n className: \"hce-icon-btn\",\n type: \"button\",\n title: \"Copy AI prompt\",\n \"aria-label\": issue.kind === \"error\" ? \"Copy AI prompt for config error\" : \"Copy AI prompt for config warning\",\n onClick: () => {\n runAsynchronously(async () => {\n await copyTextToClipboard(buildConfigIssueAiPrompt(issue));\n aiPromptCopyButton.textContent = \"✓\";\n setTimeout(() => {\n setHtml(aiPromptCopyButton, COPY_ICON_SVG);\n }, 1500);\n }, {\n noErrorLogging: true,\n onError: (copyError) => {\n captureError(\"pushed-config-error-overlay-copy-ai-prompt\", copyError);\n aiPromptCopyButton.textContent = \"!\";\n setTimeout(() => {\n setHtml(aiPromptCopyButton, COPY_ICON_SVG);\n }, 1500);\n },\n });\n },\n });\n setHtml(aiPromptCopyButton, COPY_ICON_SVG);\n\n root.appendChild(h(\"div\", { className: \"hce-backdrop\" },\n h(\"div\", { className: issue.kind === \"error\" ? \"hce-card\" : \"hce-card hce-card-warning\", role: \"alertdialog\", \"aria-modal\": \"true\", \"aria-label\": `Hexclave config ${issueLabel}` },\n h(\"div\", { className: \"hce-card-inner\" },\n h(\"div\", { className: \"hce-header\" },\n h(\"div\", { className: \"hce-title-row\" },\n logoSpan,\n h(\"div\", null,\n h(\"span\", { className: \"hce-badge\" }, `Config ${issueLabel}`),\n h(\"div\", { className: \"hce-title\" }, issueTitle),\n ),\n ),\n h(\"div\", { className: \"hce-actions\" },\n aiPromptCopyButton,\n h(\"button\", {\n className: \"hce-icon-btn\",\n type: \"button\",\n title: \"Minimize\",\n \"aria-label\": issue.kind === \"error\" ? \"Minimize config error\" : \"Minimize config warning\",\n onClick: () => {\n minimized = true;\n storageSet(MINIMIZED_STORAGE_KEY, issueKey);\n render(issue);\n },\n }, \"–\"),\n ),\n ),\n h(\"div\", { className: \"hce-body\" },\n bodyText,\n h(\"div\", { className: \"hce-message-header\" },\n h(\"div\", { className: \"hce-message-label\" }, issue.kind === \"error\" ? \"Error message\" : \"Warning message\"),\n copyButton,\n ),\n h(\"div\", { className: \"hce-message\" }, issueMessage),\n h(\"div\", { className: \"hce-footer\" }, footerText),\n ),\n ),\n )));\n };\n\n const refresh = () => {\n if (disposed || !canMountIntoDom()) {\n return;\n }\n runAsynchronously(async () => {\n const project = await app.getProject();\n if (disposed) {\n return;\n }\n render(project.pushedConfigError == null\n ? project.configWarnings.length === 0\n ? null\n : { kind: \"warning\", messages: project.configWarnings.map((warning) => warning.message) }\n : { kind: \"error\", messages: [project.pushedConfigError.message] });\n }, {\n noErrorLogging: true,\n onError: (error) => {\n captureError(\"pushed-config-error-overlay-refresh\", error);\n },\n });\n };\n\n refresh();\n const interval = setInterval(refresh, REFRESH_INTERVAL_MS);\n\n const cleanup = () => {\n disposed = true;\n clearInterval(interval);\n root.remove();\n if (getGlobalUiInstance(GLOBAL_INSTANCE_KEY)?.cleanup === cleanup) {\n setGlobalUiInstance(GLOBAL_INSTANCE_KEY, null);\n }\n };\n setGlobalUiInstance(GLOBAL_INSTANCE_KEY, { cleanup });\n return cleanup;\n}\n\n"],"mappings":";;;;;;;;AAaA,MAAM,sBAAsB;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AC,iBAAiB,CAChC;AAEF,oBAAkB,YAAY;GAC5B,MAAM,UAAU,MAAM,IAAI,YAAY;AACtC,OAAI,SACF;AAEF,UAAO,QAAQ,qBAAqB,OAChC,QAAQ,eAAe,WAAW,IAChC,OACA;IAAE,MAAM;IAAW,UAAU,QAAQ,eAAe,KAAK,YAAY,QAAQ,QAAQ;IAAE,GACzF;IAAE,MAAM;IAAS,UAAU,CAAC,QAAQ,kBAAkB,QAAQ;IAAE,CAAC;KACpE;GACD,gBAAgB;GAChB,UAAU,UAAU;AAClB,iBAAa,uCAAuC,MAAM;;GAE7D,CAAC;;AAGJ,UAAS;CACT,MAAM,WAAW,YAAY,SAAS,oBAAoB;CAE1D,MAAM,gBAAgB;AACpB,aAAW;AACX,gBAAc,SAAS;AACvB,OAAK,QAAQ;AACb,MAAI,oBAAoB,oBAAoB,EAAE,YAAY,QACxD,qBAAoB,qBAAqB,KAAK;;AAGlD,qBAAoB,qBAAqB,EAAE,SAAS,CAAC;AACrD,QAAO"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/pushed-config-error-overlay/index.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { captureError } from \"@hexclave/shared/dist/utils/errors\";\nimport { runAsynchronously } from \"@hexclave/shared/dist/utils/promises\";\nimport { isLocalhost } from \"@hexclave/shared/dist/utils/urls\";\nimport { envVars } from \"../generated/env\";\nimport { getInPageUiBaseCSS } from \"../in-page-ui/base-styles\";\nimport { canMountIntoDom, getGlobalUiInstance, h, setGlobalUiInstance, setHtml } from \"../in-page-ui/dom\";\nimport type { StackClientApp } from \"../lib/hexclave-app\";\n\nconst GLOBAL_INSTANCE_KEY = \"__hexclave-pushed-config-error-overlay\";\nconst MINIMIZED_STORAGE_KEY = \"hexclave-pushed-config-error-minimized-key\";\nconst REFRESH_INTERVAL_MS = 5_000;\nconst HEXCLAVE_LOGO_SVG = '<svg width=\"16\" height=\"16\" viewBox=\"0 0 48 48\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"3\" stroke-linejoin=\"miter\"><path d=\"M 24 4 L 41.32 14 L 41.32 34 L 24 44 L 6.68 34 L 6.68 14 Z\"/><path d=\"M 11 16.87 L 14 15.13 L 14 32.87 L 11 31.13 Z\" fill=\"currentColor\" stroke=\"none\"/><path d=\"M 11 16.87 L 14 15.13 L 14 32.87 L 11 31.13 Z\" fill=\"currentColor\" stroke=\"none\" transform=\"rotate(120 24 24)\"/><path d=\"M 11 16.87 L 14 15.13 L 14 32.87 L 11 31.13 Z\" fill=\"currentColor\" stroke=\"none\" transform=\"rotate(240 24 24)\"/></svg>';\nconst COPY_ICON_SVG = '<svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.25\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\"/><path d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\"/></svg>';\n\ntype ConfigIssue = {\n kind: \"error\" | \"warning\",\n messages: string[],\n};\n\nconst css = getInPageUiBaseCSS(\".hexclave-config-error-overlay\") + `\n .hexclave-config-error-overlay .hce-backdrop {\n position: fixed;\n inset: 0;\n z-index: 2147483647;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 24px;\n background: rgba(0, 0, 0, 0.46);\n backdrop-filter: blur(6px);\n overflow: auto;\n }\n\n .hexclave-config-error-overlay .hce-card {\n --hce-status: var(--sdt-error);\n width: min(720px, calc(100vw - 32px));\n max-height: min(640px, calc(100dvh - 48px));\n border: 1px solid color-mix(in srgb, var(--hce-status) 35%, var(--sdt-border));\n border-radius: 18px;\n background: var(--sdt-overlay-bg);\n box-shadow: var(--sdt-shadow);\n backdrop-filter: blur(18px);\n display: flex;\n overflow: hidden;\n }\n\n .hexclave-config-error-overlay .hce-card-warning {\n --hce-status: var(--sdt-warning);\n }\n\n .hexclave-config-error-overlay .hce-card-inner {\n padding: 18px;\n width: 100%;\n overflow: auto;\n }\n\n .hexclave-config-error-overlay .hce-header {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: 12px;\n margin-bottom: 12px;\n }\n\n .hexclave-config-error-overlay .hce-title-row {\n display: flex;\n align-items: flex-start;\n gap: 10px;\n min-width: 0;\n }\n\n .hexclave-config-error-overlay .hce-logo {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 34px;\n height: 34px;\n border-radius: 10px;\n background: var(--hce-status);\n color: white;\n box-shadow: 0 10px 30px color-mix(in srgb, var(--hce-status) 32%, transparent);\n }\n\n .hexclave-config-error-overlay .hce-badge {\n display: inline-flex;\n flex-shrink: 0;\n padding: 2px 6px;\n border-radius: 999px;\n background: var(--hce-status);\n color: white;\n font-size: 10px;\n font-weight: 700;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n }\n\n .hexclave-config-error-overlay .hce-title {\n color: var(--sdt-text);\n margin-top: 4px;\n font-size: 18px;\n font-weight: 700;\n line-height: 1.25;\n }\n\n .hexclave-config-error-overlay .hce-actions {\n display: flex;\n gap: 4px;\n }\n\n .hexclave-config-error-overlay .hce-icon-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border: 1px solid var(--sdt-border);\n border-radius: 8px;\n background: var(--sdt-bg-elevated);\n color: var(--sdt-text-secondary);\n cursor: pointer;\n font: inherit;\n line-height: 1;\n vertical-align: top;\n }\n\n .hexclave-config-error-overlay .hce-icon-btn svg {\n display: block;\n flex-shrink: 0;\n }\n\n .hexclave-config-error-overlay .hce-text-btn {\n align-items: center;\n gap: 6px;\n min-height: 28px;\n padding: 0 10px;\n width: auto;\n font-size: 12px;\n line-height: 1;\n }\n\n .hexclave-config-error-overlay .hce-icon-btn:hover {\n background: var(--sdt-bg-hover);\n color: var(--sdt-text);\n }\n\n .hexclave-config-error-overlay .hce-body {\n color: var(--sdt-text-secondary);\n font-size: 14px;\n line-height: 1.5;\n }\n\n .hexclave-config-error-overlay .hce-message-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 10px;\n margin-top: 14px;\n margin-bottom: 8px;\n }\n\n .hexclave-config-error-overlay .hce-message-label {\n color: var(--sdt-text);\n font-size: 12px;\n font-weight: 650;\n }\n\n .hexclave-config-error-overlay .hce-message {\n padding: 12px;\n max-height: min(260px, max(96px, 30dvh));\n overflow: auto;\n border: 1px solid var(--sdt-border-subtle);\n border-radius: 10px;\n background: var(--sdt-bg-subtle);\n color: var(--sdt-text);\n font-family: var(--sdt-font-mono);\n font-size: 12px;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n }\n\n .hexclave-config-error-overlay .hce-footer {\n margin-top: 10px;\n color: var(--sdt-text-tertiary);\n font-size: 12px;\n }\n\n .hexclave-config-error-overlay .hce-pill {\n position: fixed;\n right: 18px;\n bottom: 18px;\n z-index: 2147483647;\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 12px 8px 8px;\n --hce-status: var(--sdt-error);\n border: 1px solid color-mix(in srgb, var(--hce-status) 35%, var(--sdt-border));\n border-radius: 999px;\n background: var(--sdt-overlay-bg);\n box-shadow: var(--sdt-trigger-shadow);\n color: var(--sdt-text);\n cursor: pointer;\n font: inherit;\n backdrop-filter: blur(18px);\n }\n\n .hexclave-config-error-overlay .hce-pill-warning {\n --hce-status: var(--sdt-warning);\n }\n\n .hexclave-config-error-overlay .hce-pill-logo {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 26px;\n height: 26px;\n border-radius: 999px;\n background: var(--hce-status);\n color: white;\n }\n\n @media (max-height: 520px) {\n .hexclave-config-error-overlay .hce-backdrop {\n align-items: flex-start;\n padding: 12px;\n }\n\n .hexclave-config-error-overlay .hce-card {\n width: min(720px, calc(100vw - 24px));\n max-height: calc(100dvh - 24px);\n }\n\n .hexclave-config-error-overlay .hce-card-inner {\n padding: 12px;\n }\n\n .hexclave-config-error-overlay .hce-header {\n margin-bottom: 8px;\n }\n\n .hexclave-config-error-overlay .hce-title {\n font-size: 16px;\n }\n\n .hexclave-config-error-overlay .hce-body {\n font-size: 13px;\n }\n\n .hexclave-config-error-overlay .hce-message {\n max-height: max(80px, 24dvh);\n }\n }\n`;\n\nfunction storageGet(key: string): string | null {\n try {\n return localStorage.getItem(key);\n } catch {\n return null;\n }\n}\n\nfunction storageSet(key: string, value: string): void {\n try {\n localStorage.setItem(key, value);\n } catch {\n // Storage may be unavailable in private or embedded contexts.\n }\n}\n\nfunction storageRemove(key: string): void {\n try {\n localStorage.removeItem(key);\n } catch {\n // Storage may be unavailable in private or embedded contexts.\n }\n}\n\nfunction shouldMount(): boolean {\n if (!canMountIntoDom()) {\n return false;\n }\n\n const nodeEnv = envVars.NODE_ENV;\n if (nodeEnv !== undefined) {\n return nodeEnv === \"development\";\n }\n\n try {\n const url = new URL(window.location.href);\n if (url.protocol === \"file:\") {\n return true;\n }\n } catch {\n return false;\n }\n return isLocalhost(window.location.href);\n}\n\nasync function copyTextToClipboard(text: string): Promise<void> {\n const clipboard: unknown = Reflect.get(navigator, \"clipboard\");\n const writeText = clipboard != null && typeof clipboard === \"object\"\n ? Reflect.get(clipboard, \"writeText\")\n : null;\n if (typeof writeText === \"function\") {\n await writeText.call(clipboard, text);\n return;\n }\n\n const textarea = h(\"textarea\", {\n style: {\n position: \"fixed\",\n left: \"-9999px\",\n top: \"0\",\n opacity: \"0\",\n },\n readonly: \"true\",\n }) as HTMLTextAreaElement;\n textarea.value = text;\n document.body.appendChild(textarea);\n textarea.select();\n const copied = document.execCommand(\"copy\");\n textarea.remove();\n if (!copied) {\n throw new Error(\"Browser refused to copy the config error message.\");\n }\n}\n\nfunction buildConfigIssueAiPrompt(issue: ConfigIssue): string {\n const issueLabel = issue.kind === \"error\" ? \"error\" : \"warning\";\n return [\n `Help me fix this Hexclave config ${issueLabel}.`,\n \"\",\n \"Hexclave reminder:\",\n `This ${issueLabel} comes from a pushed Hexclave config file. The app may keep running with the synced Hexclave config, but I need to fix the config file mentioned in the message and save it again so Hexclave can sync the config successfully and clear the dialog. Use your web fetch tool to read https://skill.hexclave.com to learn more about Hexclave.`,\n \"\",\n issue.kind === \"error\" ? \"Error message:\" : \"Warning message:\",\n issue.messages.join(\"\\n\"),\n \"\",\n \"Please explain the likely cause, identify the config key or value I should change, and suggest the smallest safe fix.\",\n ].join(\"\\n\");\n}\n\nexport function mountPushedConfigErrorOverlay(app: StackClientApp<true>): () => void {\n if (!shouldMount()) {\n return () => {};\n }\n\n getGlobalUiInstance(GLOBAL_INSTANCE_KEY)?.cleanup();\n\n const root = h(\"div\", { className: \"hexclave-config-error-overlay\" });\n const style = h(\"style\", null, css);\n root.appendChild(style);\n document.body.appendChild(root);\n\n let disposed = false;\n let lastErrorKey: string | null = null;\n let lastConsoleErrorKey: string | null = null;\n let minimized = false;\n\n const render = (issue: ConfigIssue | null) => {\n root.replaceChildren(style);\n if (issue == null) {\n lastErrorKey = null;\n minimized = false;\n return;\n }\n\n const issueMessage = issue.messages.join(\"\\n\");\n const issueKey = `${app.projectId}:${issue.kind}:${issueMessage}`;\n const issueLabel = issue.kind === \"error\" ? \"error\" : \"warning\";\n const issueTitle = issue.kind === \"error\"\n ? \"Your Hexclave config has been saved, but contains errors\"\n : \"Your Hexclave config has been saved, but has warnings\";\n const bodyText = issue.kind === \"error\"\n ? \"Your app can keep running, but Hexclave is still using the last valid config until this is fixed.\"\n : \"Your app can keep running, but part of your Hexclave config may not behave the way you expect until this is fixed.\";\n const footerText = issue.kind === \"error\"\n ? \"Fix the config file mentioned above and save it again. This message will disappear after the config sync succeeds.\"\n : \"Fix the config file mentioned above and save it again. This warning will disappear after Hexclave syncs a config without warnings.\";\n if (issueKey !== lastConsoleErrorKey) {\n lastConsoleErrorKey = issueKey;\n const consoleMessage = `[Hexclave] Config ${issueLabel}: ${issueMessage}`;\n if (issue.kind === \"error\") {\n console.error(consoleMessage);\n } else {\n console.warn(consoleMessage);\n }\n }\n\n if (issueKey !== lastErrorKey) {\n lastErrorKey = issueKey;\n minimized = storageGet(MINIMIZED_STORAGE_KEY) === issueKey;\n }\n\n if (minimized) {\n const logoSpan = h(\"span\", { className: \"hce-pill-logo\" });\n setHtml(logoSpan, HEXCLAVE_LOGO_SVG);\n root.appendChild(h(\"button\", {\n className: issue.kind === \"error\" ? \"hce-pill\" : \"hce-pill hce-pill-warning\",\n type: \"button\",\n onClick: () => {\n minimized = false;\n storageRemove(MINIMIZED_STORAGE_KEY);\n render(issue);\n },\n },\n logoSpan,\n h(\"span\", null, issue.kind === \"error\" ? \"Config error\" : \"Config warning\")));\n return;\n }\n\n const logoSpan = h(\"span\", { className: \"hce-logo\" });\n setHtml(logoSpan, HEXCLAVE_LOGO_SVG);\n const copyButton = h(\"button\", {\n className: \"hce-icon-btn hce-text-btn\",\n type: \"button\",\n title: issue.kind === \"error\" ? \"Copy error message\" : \"Copy warning message\",\n \"aria-label\": issue.kind === \"error\" ? \"Copy config error message\" : \"Copy config warning message\",\n onClick: () => {\n runAsynchronously(async () => {\n await copyTextToClipboard(issueMessage);\n copyButton.textContent = \"Copied\";\n setTimeout(() => {\n setHtml(copyButton, `${COPY_ICON_SVG}Copy`);\n }, 1500);\n }, {\n noErrorLogging: true,\n onError: (copyError) => {\n captureError(\"pushed-config-error-overlay-copy\", copyError);\n copyButton.textContent = \"Copy failed\";\n setTimeout(() => {\n setHtml(copyButton, `${COPY_ICON_SVG}Copy`);\n }, 1500);\n },\n });\n },\n });\n setHtml(copyButton, `${COPY_ICON_SVG}Copy`);\n\n const aiPromptCopyButton = h(\"button\", {\n className: \"hce-icon-btn\",\n type: \"button\",\n title: \"Copy AI prompt\",\n \"aria-label\": issue.kind === \"error\" ? \"Copy AI prompt for config error\" : \"Copy AI prompt for config warning\",\n onClick: () => {\n runAsynchronously(async () => {\n await copyTextToClipboard(buildConfigIssueAiPrompt(issue));\n aiPromptCopyButton.textContent = \"✓\";\n setTimeout(() => {\n setHtml(aiPromptCopyButton, COPY_ICON_SVG);\n }, 1500);\n }, {\n noErrorLogging: true,\n onError: (copyError) => {\n captureError(\"pushed-config-error-overlay-copy-ai-prompt\", copyError);\n aiPromptCopyButton.textContent = \"!\";\n setTimeout(() => {\n setHtml(aiPromptCopyButton, COPY_ICON_SVG);\n }, 1500);\n },\n });\n },\n });\n setHtml(aiPromptCopyButton, COPY_ICON_SVG);\n\n root.appendChild(h(\"div\", { className: \"hce-backdrop\" },\n h(\"div\", { className: issue.kind === \"error\" ? \"hce-card\" : \"hce-card hce-card-warning\", role: \"alertdialog\", \"aria-modal\": \"true\", \"aria-label\": `Hexclave config ${issueLabel}` },\n h(\"div\", { className: \"hce-card-inner\" },\n h(\"div\", { className: \"hce-header\" },\n h(\"div\", { className: \"hce-title-row\" },\n logoSpan,\n h(\"div\", null,\n h(\"span\", { className: \"hce-badge\" }, `Config ${issueLabel}`),\n h(\"div\", { className: \"hce-title\" }, issueTitle),\n ),\n ),\n h(\"div\", { className: \"hce-actions\" },\n aiPromptCopyButton,\n h(\"button\", {\n className: \"hce-icon-btn\",\n type: \"button\",\n title: \"Minimize\",\n \"aria-label\": issue.kind === \"error\" ? \"Minimize config error\" : \"Minimize config warning\",\n onClick: () => {\n minimized = true;\n storageSet(MINIMIZED_STORAGE_KEY, issueKey);\n render(issue);\n },\n }, \"–\"),\n ),\n ),\n h(\"div\", { className: \"hce-body\" },\n bodyText,\n h(\"div\", { className: \"hce-message-header\" },\n h(\"div\", { className: \"hce-message-label\" }, issue.kind === \"error\" ? \"Error message\" : \"Warning message\"),\n copyButton,\n ),\n h(\"div\", { className: \"hce-message\" }, issueMessage),\n h(\"div\", { className: \"hce-footer\" }, footerText),\n ),\n ),\n )));\n };\n\n const refresh = () => {\n if (disposed || !canMountIntoDom()) {\n return;\n }\n runAsynchronously(async () => {\n const project = await app.getProject();\n if (disposed) {\n return;\n }\n render(project.pushedConfigError == null\n ? project.configWarnings.length === 0\n ? null\n : { kind: \"warning\", messages: project.configWarnings.map((warning) => warning.message) }\n : { kind: \"error\", messages: [project.pushedConfigError.message] });\n }, {\n noErrorLogging: true,\n onError: (error) => {\n captureError(\"pushed-config-error-overlay-refresh\", error);\n },\n });\n };\n\n // This is mounted from the base client-app constructor, which also runs\n // before subclass field initializers. Defer the first app call so overridden\n // methods like adminApp.getProject() can safely touch subclass caches.\n queueMicrotask(refresh);\n const interval = setInterval(refresh, REFRESH_INTERVAL_MS);\n\n const cleanup = () => {\n disposed = true;\n clearInterval(interval);\n root.remove();\n if (getGlobalUiInstance(GLOBAL_INSTANCE_KEY)?.cleanup === cleanup) {\n setGlobalUiInstance(GLOBAL_INSTANCE_KEY, null);\n }\n };\n setGlobalUiInstance(GLOBAL_INSTANCE_KEY, { cleanup });\n return cleanup;\n}\n\n"],"mappings":";;;;;;;;AAaA,MAAM,sBAAsB;AAC5B,MAAM,wBAAwB;AAC9B,MAAM,sBAAsB;AAC5B,MAAM,oBAAoB;AAC1B,MAAM,gBAAgB;AAOtB,MAAM,MAAM,mBAAmB,iCAAiC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4OnE,SAAS,WAAW,KAA4B;AAC9C,KAAI;AACF,SAAO,aAAa,QAAQ,IAAI;SAC1B;AACN,SAAO;;;AAIX,SAAS,WAAW,KAAa,OAAqB;AACpD,KAAI;AACF,eAAa,QAAQ,KAAK,MAAM;SAC1B;;AAKV,SAAS,cAAc,KAAmB;AACxC,KAAI;AACF,eAAa,WAAW,IAAI;SACtB;;AAKV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