@carlonicora/nextjs-jsonapi 1.39.2 → 1.40.1

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 (84) hide show
  1. package/dist/{BlockNoteEditor-WQXQPLMX.js → BlockNoteEditor-4G3L3LSF.js} +14 -14
  2. package/dist/{BlockNoteEditor-WQXQPLMX.js.map → BlockNoteEditor-4G3L3LSF.js.map} +1 -1
  3. package/dist/{BlockNoteEditor-CITC7I2Z.mjs → BlockNoteEditor-EKY4AHVK.mjs} +4 -4
  4. package/dist/billing/index.js +346 -346
  5. package/dist/billing/index.mjs +3 -3
  6. package/dist/{chunk-LDH2FGJY.mjs → chunk-BAOP6PTD.mjs} +689 -34
  7. package/dist/chunk-BAOP6PTD.mjs.map +1 -0
  8. package/dist/{chunk-2RBYXY6T.js → chunk-GKY5DAIH.js} +1228 -573
  9. package/dist/chunk-GKY5DAIH.js.map +1 -0
  10. package/dist/{chunk-TQ5GRRTM.mjs → chunk-GVN7XC3U.mjs} +278 -2
  11. package/dist/chunk-GVN7XC3U.mjs.map +1 -0
  12. package/dist/{chunk-XLMJPA4N.mjs → chunk-RRIYLEY6.mjs} +22 -2
  13. package/dist/chunk-RRIYLEY6.mjs.map +1 -0
  14. package/dist/{chunk-2PHWAL6Q.js → chunk-T5YYOT4Z.js} +22 -2
  15. package/dist/chunk-T5YYOT4Z.js.map +1 -0
  16. package/dist/{chunk-3EZX4G2E.js → chunk-ZNGEVB5M.js} +279 -3
  17. package/dist/chunk-ZNGEVB5M.js.map +1 -0
  18. package/dist/client/index.js +4 -4
  19. package/dist/client/index.mjs +3 -3
  20. package/dist/components/index.d.mts +28 -4
  21. package/dist/components/index.d.ts +28 -4
  22. package/dist/components/index.js +16 -4
  23. package/dist/components/index.js.map +1 -1
  24. package/dist/components/index.mjs +15 -3
  25. package/dist/contexts/index.js +4 -4
  26. package/dist/contexts/index.mjs +3 -3
  27. package/dist/core/index.d.mts +127 -3
  28. package/dist/core/index.d.ts +127 -3
  29. package/dist/core/index.js +12 -2
  30. package/dist/core/index.js.map +1 -1
  31. package/dist/core/index.mjs +11 -1
  32. package/dist/index.d.mts +5 -2
  33. package/dist/index.d.ts +5 -2
  34. package/dist/index.js +17 -3
  35. package/dist/index.js.map +1 -1
  36. package/dist/index.mjs +16 -2
  37. package/dist/{s3.service-hnTPVTm2.d.mts → s3.service-BoOF5-ln.d.mts} +1 -0
  38. package/dist/{s3.service-DXkDoMf1.d.ts → s3.service-Mxo-7wQ6.d.ts} +1 -0
  39. package/dist/server/index.d.mts +1 -1
  40. package/dist/server/index.d.ts +1 -1
  41. package/dist/server/index.js +3 -3
  42. package/dist/server/index.mjs +1 -1
  43. package/dist/waitlist.config-kPfjImle.d.mts +26 -0
  44. package/dist/waitlist.config-kPfjImle.d.ts +26 -0
  45. package/package.json +1 -1
  46. package/src/components/forms/FormCheckbox.tsx +1 -1
  47. package/src/components/forms/FormSelect.tsx +1 -1
  48. package/src/components/index.ts +1 -0
  49. package/src/core/index.ts +3 -0
  50. package/src/core/registry/ModuleRegistry.ts +3 -0
  51. package/src/features/auth/components/forms/Register.tsx +180 -1
  52. package/src/features/auth/data/auth.interface.ts +1 -0
  53. package/src/features/auth/data/auth.ts +1 -0
  54. package/src/features/index.ts +1 -0
  55. package/src/features/waitlist/components/forms/WaitlistForm.tsx +186 -0
  56. package/src/features/waitlist/components/forms/WaitlistQuestionnaireRenderer.tsx +110 -0
  57. package/src/features/waitlist/components/forms/index.ts +2 -0
  58. package/src/features/waitlist/components/index.ts +3 -0
  59. package/src/features/waitlist/components/lists/WaitlistList.tsx +145 -0
  60. package/src/features/waitlist/components/lists/index.ts +1 -0
  61. package/src/features/waitlist/components/sections/WaitlistConfirmation.tsx +68 -0
  62. package/src/features/waitlist/components/sections/WaitlistHeroSection.tsx +49 -0
  63. package/src/features/waitlist/components/sections/WaitlistSuccessState.tsx +19 -0
  64. package/src/features/waitlist/components/sections/index.ts +3 -0
  65. package/src/features/waitlist/config/waitlist.config.ts +35 -0
  66. package/src/features/waitlist/data/Waitlist.ts +104 -0
  67. package/src/features/waitlist/data/WaitlistInterface.ts +32 -0
  68. package/src/features/waitlist/data/WaitlistService.ts +153 -0
  69. package/src/features/waitlist/data/index.ts +5 -0
  70. package/src/features/waitlist/data/waitlist-stats.interface.ts +9 -0
  71. package/src/features/waitlist/data/waitlist-stats.ts +47 -0
  72. package/src/features/waitlist/hooks/useWaitlistTableStructure.tsx +121 -0
  73. package/src/features/waitlist/index.ts +28 -0
  74. package/src/features/waitlist/waitlist-stats.module.ts +8 -0
  75. package/src/features/waitlist/waitlist.module.ts +9 -0
  76. package/src/index.ts +9 -0
  77. package/src/login/config.ts +9 -0
  78. package/dist/chunk-2PHWAL6Q.js.map +0 -1
  79. package/dist/chunk-2RBYXY6T.js.map +0 -1
  80. package/dist/chunk-3EZX4G2E.js.map +0 -1
  81. package/dist/chunk-LDH2FGJY.mjs.map +0 -1
  82. package/dist/chunk-TQ5GRRTM.mjs.map +0 -1
  83. package/dist/chunk-XLMJPA4N.mjs.map +0 -1
  84. /package/dist/{BlockNoteEditor-CITC7I2Z.mjs.map → BlockNoteEditor-EKY4AHVK.mjs.map} +0 -0
@@ -98,11 +98,13 @@ var _useDiscordAuth = false;
98
98
  var _useGoogleAuth = false;
99
99
  var _useInternalAuth = true;
100
100
  var _allowRegistration = true;
101
+ var _registrationMode = "open";
101
102
  function configureLogin(params) {
102
103
  _useDiscordAuth = !!params.discordClientId;
103
104
  _useGoogleAuth = !!params.googleClientId;
104
105
  _useInternalAuth = params.useInternalAuth ?? true;
105
106
  _allowRegistration = params.allowRegistration ?? true;
107
+ _registrationMode = params.registrationMode ?? "open";
106
108
  }
107
109
  __name(configureLogin, "configureLogin");
108
110
  function isDiscordAuthEnabled() {
@@ -121,6 +123,10 @@ function isRegistrationAllowed() {
121
123
  return _allowRegistration;
122
124
  }
123
125
  __name(isRegistrationAllowed, "isRegistrationAllowed");
126
+ function getRegistrationMode() {
127
+ return _registrationMode;
128
+ }
129
+ __name(getRegistrationMode, "getRegistrationMode");
124
130
 
125
131
  // src/roles/config.ts
126
132
  var _roleId = null;
@@ -140,6 +146,17 @@ function isRolesConfigured() {
140
146
  }
141
147
  __name(isRolesConfigured, "isRolesConfigured");
142
148
 
149
+ // src/features/waitlist/config/waitlist.config.ts
150
+ var _waitlistConfig = {};
151
+ function configureWaitlist(config) {
152
+ _waitlistConfig = config;
153
+ }
154
+ __name(configureWaitlist, "configureWaitlist");
155
+ function getWaitlistConfig() {
156
+ return _waitlistConfig;
157
+ }
158
+ __name(getWaitlistConfig, "getWaitlistConfig");
159
+
143
160
  export {
144
161
  configureJsonApi,
145
162
  configureClientConfig,
@@ -158,8 +175,11 @@ export {
158
175
  isGoogleAuthEnabled,
159
176
  isInternalAuthEnabled,
160
177
  isRegistrationAllowed,
178
+ getRegistrationMode,
161
179
  configureRoles,
162
180
  getRoleId,
163
- isRolesConfigured
181
+ isRolesConfigured,
182
+ configureWaitlist,
183
+ getWaitlistConfig
164
184
  };
165
- //# sourceMappingURL=chunk-XLMJPA4N.mjs.map
185
+ //# sourceMappingURL=chunk-RRIYLEY6.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/client/config.ts","../src/i18n/config.ts","../src/login/config.ts","../src/roles/config.ts","../src/features/waitlist/config/waitlist.config.ts"],"sourcesContent":["\"use client\";\n\nimport { ModuleWithPermissions } from \"../permissions/types\";\nimport { setBootstrapper } from \"../core/registry/bootstrapStore\";\n\n// Config storage for client-side contexts\nlet _clientConfig: {\n apiUrl: string;\n appUrl?: string;\n trackablePages?: ModuleWithPermissions[];\n bootstrapper?: () => void;\n additionalHeaders?: Record<string, string>;\n stripePublishableKey?: string;\n} | null = null;\n\n/**\n * Configure the JSON:API client. This is the main configuration function.\n * This is typically called during app initialization.\n */\nexport function configureJsonApi(config: {\n apiUrl: string;\n appUrl?: string;\n trackablePages?: ModuleWithPermissions[];\n bootstrapper?: () => void;\n additionalHeaders?: Record<string, string>;\n stripePublishableKey?: string;\n}): void {\n _clientConfig = config;\n // Register and call bootstrapper to register all modules\n if (config.bootstrapper) {\n setBootstrapper(config.bootstrapper);\n config.bootstrapper();\n }\n}\n\n/**\n * Configure the client config. This is typically called during app initialization.\n * @deprecated Use configureJsonApi instead\n */\nexport function configureClientConfig(config: {\n apiUrl: string;\n appUrl?: string;\n trackablePages?: ModuleWithPermissions[];\n}): void {\n _clientConfig = config;\n}\n\n/**\n * Get the configured API URL.\n */\nexport function getApiUrl(): string {\n if (_clientConfig?.apiUrl) {\n return _clientConfig.apiUrl;\n }\n if (typeof process !== \"undefined\" && process.env?.NEXT_PUBLIC_API_URL) {\n return process.env.NEXT_PUBLIC_API_URL;\n }\n return \"\";\n}\n\n/**\n * Get the configured app URL.\n */\nexport function getAppUrl(): string {\n if (_clientConfig?.appUrl) {\n return _clientConfig.appUrl;\n }\n if (typeof process !== \"undefined\" && process.env?.NEXT_PUBLIC_APP_URL) {\n return process.env.NEXT_PUBLIC_APP_URL;\n }\n if (typeof window !== \"undefined\") {\n return window.location.origin;\n }\n return \"\";\n}\n\n/**\n * Get the configured trackable pages.\n */\nexport function getTrackablePages(): ModuleWithPermissions[] {\n return _clientConfig?.trackablePages ?? [];\n}\n\n/**\n * Get the configured Stripe publishable key.\n */\nexport function getStripePublishableKey(): string | undefined {\n return _clientConfig?.stripePublishableKey;\n}\n","import { ComponentType } from \"react\";\n\n// Types for injected hooks\nexport interface I18nRouter {\n push: (href: string) => void;\n replace: (href: string) => void;\n back: () => void;\n forward: () => void;\n refresh: () => void;\n prefetch: (href: string) => void;\n}\n\nexport type UseRouterHook = () => I18nRouter;\nexport type UseTranslationsHook = (namespace?: string) => (key: string, values?: Record<string, any>) => string;\nexport type UseLocaleHook = () => string;\n\nexport type UseDateFnsLocaleHook = () => any; // date-fns Locale type\nexport type LinkComponent = ComponentType<{ href: string; children: React.ReactNode; [key: string]: any }>;\n\nexport interface I18nConfig {\n useRouter: UseRouterHook;\n useTranslations: UseTranslationsHook;\n useLocale?: UseLocaleHook;\n useDateFnsLocale?: UseDateFnsLocaleHook;\n Link: LinkComponent;\n usePathname: () => string;\n}\n\n// Private storage\nlet _config: I18nConfig | null = null;\n\n// Configuration function (called by app at startup)\nexport function configureI18n(config: I18nConfig): void {\n _config = config;\n}\n\n// Hooks for library components to use\nexport function useI18nRouter(): I18nRouter {\n if (!_config?.useRouter) {\n throw new Error(\"i18n not configured. Call configureI18n() at app startup.\");\n }\n return _config.useRouter();\n}\n\nexport function useI18nTranslations(namespace?: string): (key: string, values?: Record<string, any>) => string {\n if (!_config?.useTranslations) {\n // Fallback: return key as-is (safe for server/client)\n return (key: string) => key;\n }\n return _config.useTranslations(namespace);\n}\n\nexport function getI18nLink(): LinkComponent {\n if (!_config?.Link) {\n throw new Error(\"i18n not configured. Call configureI18n() at app startup.\");\n }\n return _config.Link;\n}\n\nexport function useI18nLocale(): string {\n if (_config?.useLocale) {\n return _config.useLocale();\n }\n // Fallback to English (safe for server/client)\n return \"en\";\n}\n\nexport function useI18nDateFnsLocale(): any {\n if (_config?.useDateFnsLocale) {\n return _config.useDateFnsLocale();\n }\n // Fallback to undefined (Calendar will use default)\n return undefined;\n}\n","let _useDiscordAuth: boolean = false;\nlet _useGoogleAuth: boolean = false;\nlet _useInternalAuth: boolean = true;\nlet _allowRegistration: boolean = true;\nlet _registrationMode: \"open\" | \"closed\" | \"waitlist\" = \"open\";\n\nexport type RegistrationMode = \"open\" | \"closed\" | \"waitlist\";\n\nexport interface LoginConfig {\n discordClientId?: string;\n googleClientId?: string;\n useInternalAuth?: boolean;\n allowRegistration?: boolean;\n registrationMode?: RegistrationMode;\n}\n\nexport function configureLogin(params: LoginConfig): void {\n _useDiscordAuth = !!params.discordClientId;\n _useGoogleAuth = !!params.googleClientId;\n _useInternalAuth = params.useInternalAuth ?? true;\n _allowRegistration = params.allowRegistration ?? true;\n _registrationMode = params.registrationMode ?? \"open\";\n}\n\nexport function isDiscordAuthEnabled(): boolean {\n return _useDiscordAuth;\n}\n\nexport function isGoogleAuthEnabled(): boolean {\n return _useGoogleAuth;\n}\n\nexport function isInternalAuthEnabled(): boolean {\n return _useInternalAuth;\n}\n\nexport function isRegistrationAllowed(): boolean {\n return _allowRegistration;\n}\n\nexport function getRegistrationMode(): RegistrationMode {\n return _registrationMode;\n}\n","/**\n * Role ID configuration interface\n * Apps provide their role IDs via configureRoles()\n */\nexport interface RoleIdConfig {\n Administrator: string;\n CompanyAdministrator: string;\n [key: string]: string; // Allow additional roles\n}\n\n// Private storage for the injected role IDs\nlet _roleId: RoleIdConfig | null = null;\n\n/**\n * Configure role IDs for the library\n * Call this at app startup to provide role ID constants\n *\n * @example\n * ```typescript\n * import { configureRoles } from \"@carlonicora/nextjs-jsonapi\";\n * import { RoleId } from \"@phlow/shared\";\n *\n * configureRoles(RoleId);\n * ```\n */\nexport function configureRoles(roleId: RoleIdConfig): void {\n _roleId = roleId;\n}\n\n/**\n * Get configured role IDs\n * @throws Error if roles not configured\n */\nexport function getRoleId(): RoleIdConfig {\n if (!_roleId) {\n throw new Error(\"Roles not configured. Call configureRoles() at app startup.\");\n }\n return _roleId;\n}\n\n/**\n * Check if roles have been configured\n */\nexport function isRolesConfigured(): boolean {\n return _roleId !== null;\n}\n","export type QuestionnaireFieldType = \"text\" | \"textarea\" | \"select\" | \"checkbox\";\n\nexport interface QuestionnaireOption {\n value: string;\n label: string;\n description?: string;\n}\n\nexport interface QuestionnaireField {\n id: string;\n type: QuestionnaireFieldType;\n label: string;\n description?: string;\n placeholder?: string;\n required?: boolean;\n options?: QuestionnaireOption[];\n}\n\nexport interface WaitlistConfig {\n questionnaire?: QuestionnaireField[];\n heroTitle?: string;\n heroSubtitle?: string;\n heroDescription?: string;\n benefits?: string[];\n}\n\nlet _waitlistConfig: WaitlistConfig = {};\n\nexport function configureWaitlist(config: WaitlistConfig): void {\n _waitlistConfig = config;\n}\n\nexport function getWaitlistConfig(): WaitlistConfig {\n return _waitlistConfig;\n}\n"],"mappings":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th = true;
100
100
  var _allowRegistration = true;
101
+ var _registrationMode = "open";
101
102
  function configureLogin(params) {
102
103
  _useDiscordAuth = !!params.discordClientId;
103
104
  _useGoogleAuth = !!params.googleClientId;
104
105
  _useInternalAuth = _nullishCoalesce(params.useInternalAuth, () => ( true));
105
106
  _allowRegistration = _nullishCoalesce(params.allowRegistration, () => ( true));
107
+ _registrationMode = _nullishCoalesce(params.registrationMode, () => ( "open"));
106
108
  }
107
109
  _chunk7QVYU63Ejs.__name.call(void 0, configureLogin, "configureLogin");
108
110
  function isDiscordAuthEnabled() {
@@ -121,6 +123,10 @@ function isRegistrationAllowed() {
121
123
  return _allowRegistration;
122
124
  }
123
125
  _chunk7QVYU63Ejs.__name.call(void 0, isRegistrationAllowed, "isRegistrationAllowed");
126
+ function getRegistrationMode() {
127
+ return _registrationMode;
128
+ }
129
+ _chunk7QVYU63Ejs.__name.call(void 0, getRegistrationMode, "getRegistrationMode");
124
130
 
125
131
  // src/roles/config.ts
126
132
  var _roleId = null;
@@ -140,6 +146,20 @@ function isRolesConfigured() {
140
146
  }
141
147
  _chunk7QVYU63Ejs.__name.call(void 0, isRolesConfigured, "isRolesConfigured");
142
148
 
149
+ // src/features/waitlist/config/waitlist.config.ts
150
+ var _waitlistConfig = {};
151
+ function configureWaitlist(config) {
152
+ _waitlistConfig = config;
153
+ }
154
+ _chunk7QVYU63Ejs.__name.call(void 0, configureWaitlist, "configureWaitlist");
155
+ function getWaitlistConfig() {
156
+ return _waitlistConfig;
157
+ }
158
+ _chunk7QVYU63Ejs.__name.call(void 0, getWaitlistConfig, "getWaitlistConfig");
159
+
160
+
161
+
162
+
143
163
 
144
164
 
145
165
 
@@ -161,5 +181,5 @@ _chunk7QVYU63Ejs.__name.call(void 0, isRolesConfigured, "isRolesConfigured");
161
181
 
162
182
 
163
183
 
164
- exports.configureJsonApi = configureJsonApi; exports.configureClientConfig = configureClientConfig; exports.getApiUrl = getApiUrl; exports.getAppUrl = getAppUrl; exports.getTrackablePages = getTrackablePages; exports.getStripePublishableKey = getStripePublishableKey; exports.configureI18n = configureI18n; exports.useI18nRouter = useI18nRouter; exports.useI18nTranslations = useI18nTranslations; exports.getI18nLink = getI18nLink; exports.useI18nLocale = useI18nLocale; exports.useI18nDateFnsLocale = useI18nDateFnsLocale; exports.configureLogin = configureLogin; exports.isDiscordAuthEnabled = isDiscordAuthEnabled; exports.isGoogleAuthEnabled = isGoogleAuthEnabled; exports.isInternalAuthEnabled = isInternalAuthEnabled; exports.isRegistrationAllowed = isRegistrationAllowed; exports.configureRoles = configureRoles; exports.getRoleId = getRoleId; exports.isRolesConfigured = isRolesConfigured;
165
- //# sourceMappingURL=chunk-2PHWAL6Q.js.map
184
+ exports.configureJsonApi = configureJsonApi; exports.configureClientConfig = configureClientConfig; exports.getApiUrl = getApiUrl; exports.getAppUrl = getAppUrl; exports.getTrackablePages = getTrackablePages; exports.getStripePublishableKey = getStripePublishableKey; exports.configureI18n = configureI18n; exports.useI18nRouter = useI18nRouter; exports.useI18nTranslations = useI18nTranslations; exports.getI18nLink = getI18nLink; exports.useI18nLocale = useI18nLocale; exports.useI18nDateFnsLocale = useI18nDateFnsLocale; exports.configureLogin = configureLogin; exports.isDiscordAuthEnabled = isDiscordAuthEnabled; exports.isGoogleAuthEnabled = isGoogleAuthEnabled; exports.isInternalAuthEnabled = isInternalAuthEnabled; exports.isRegistrationAllowed = isRegistrationAllowed; exports.getRegistrationMode = getRegistrationMode; exports.configureRoles = configureRoles; exports.getRoleId = getRoleId; exports.isRolesConfigured = isRolesConfigured; exports.configureWaitlist = configureWaitlist; exports.getWaitlistConfig = getWaitlistConfig;
185
+ //# sourceMappingURL=chunk-T5YYOT4Z.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/nextjs-jsonapi/nextjs-jsonapi/dist/chunk-T5YYOT4Z.js","../src/client/config.ts","../src/i18n/config.ts","../src/login/config.ts","../src/roles/config.ts","../src/features/waitlist/config/waitlist.config.ts"],"names":[],"mappings":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ourcesContent":[null,"\"use client\";\n\nimport { ModuleWithPermissions } from \"../permissions/types\";\nimport { setBootstrapper } from \"../core/registry/bootstrapStore\";\n\n// Config storage for client-side contexts\nlet _clientConfig: {\n apiUrl: string;\n appUrl?: string;\n trackablePages?: ModuleWithPermissions[];\n bootstrapper?: () => void;\n additionalHeaders?: Record<string, string>;\n stripePublishableKey?: string;\n} | null = null;\n\n/**\n * Configure the JSON:API client. This is the main configuration function.\n * This is typically called during app initialization.\n */\nexport function configureJsonApi(config: {\n apiUrl: string;\n appUrl?: string;\n trackablePages?: ModuleWithPermissions[];\n bootstrapper?: () => void;\n additionalHeaders?: Record<string, string>;\n stripePublishableKey?: string;\n}): void {\n _clientConfig = config;\n // Register and call bootstrapper to register all modules\n if (config.bootstrapper) {\n setBootstrapper(config.bootstrapper);\n config.bootstrapper();\n }\n}\n\n/**\n * Configure the client config. This is typically called during app initialization.\n * @deprecated Use configureJsonApi instead\n */\nexport function configureClientConfig(config: {\n apiUrl: string;\n appUrl?: string;\n trackablePages?: ModuleWithPermissions[];\n}): void {\n _clientConfig = config;\n}\n\n/**\n * Get the configured API URL.\n */\nexport function getApiUrl(): string {\n if (_clientConfig?.apiUrl) {\n return _clientConfig.apiUrl;\n }\n if (typeof process !== \"undefined\" && process.env?.NEXT_PUBLIC_API_URL) {\n return process.env.NEXT_PUBLIC_API_URL;\n }\n return \"\";\n}\n\n/**\n * Get the configured app URL.\n */\nexport function getAppUrl(): string {\n if (_clientConfig?.appUrl) {\n return _clientConfig.appUrl;\n }\n if (typeof process !== \"undefined\" && process.env?.NEXT_PUBLIC_APP_URL) {\n return process.env.NEXT_PUBLIC_APP_URL;\n }\n if (typeof window !== \"undefined\") {\n return window.location.origin;\n }\n return \"\";\n}\n\n/**\n * Get the configured trackable pages.\n */\nexport function getTrackablePages(): ModuleWithPermissions[] {\n return _clientConfig?.trackablePages ?? [];\n}\n\n/**\n * Get the configured Stripe publishable key.\n */\nexport function getStripePublishableKey(): string | undefined {\n return _clientConfig?.stripePublishableKey;\n}\n","import { ComponentType } from \"react\";\n\n// Types for injected hooks\nexport interface I18nRouter {\n push: (href: string) => void;\n replace: (href: string) => void;\n back: () => void;\n forward: () => void;\n refresh: () => void;\n prefetch: (href: string) => void;\n}\n\nexport type UseRouterHook = () => I18nRouter;\nexport type UseTranslationsHook = (namespace?: string) => (key: string, values?: Record<string, any>) => string;\nexport type UseLocaleHook = () => string;\n\nexport type UseDateFnsLocaleHook = () => any; // date-fns Locale type\nexport type LinkComponent = ComponentType<{ href: string; children: React.ReactNode; [key: string]: any }>;\n\nexport interface I18nConfig {\n useRouter: UseRouterHook;\n useTranslations: UseTranslationsHook;\n useLocale?: UseLocaleHook;\n useDateFnsLocale?: UseDateFnsLocaleHook;\n Link: LinkComponent;\n usePathname: () => string;\n}\n\n// Private storage\nlet _config: I18nConfig | null = null;\n\n// Configuration function (called by app at startup)\nexport function configureI18n(config: I18nConfig): void {\n _config = config;\n}\n\n// Hooks for library components to use\nexport function useI18nRouter(): I18nRouter {\n if (!_config?.useRouter) {\n throw new Error(\"i18n not configured. Call configureI18n() at app startup.\");\n }\n return _config.useRouter();\n}\n\nexport function useI18nTranslations(namespace?: string): (key: string, values?: Record<string, any>) => string {\n if (!_config?.useTranslations) {\n // Fallback: return key as-is (safe for server/client)\n return (key: string) => key;\n }\n return _config.useTranslations(namespace);\n}\n\nexport function getI18nLink(): LinkComponent {\n if (!_config?.Link) {\n throw new Error(\"i18n not configured. Call configureI18n() at app startup.\");\n }\n return _config.Link;\n}\n\nexport function useI18nLocale(): string {\n if (_config?.useLocale) {\n return _config.useLocale();\n }\n // Fallback to English (safe for server/client)\n return \"en\";\n}\n\nexport function useI18nDateFnsLocale(): any {\n if (_config?.useDateFnsLocale) {\n return _config.useDateFnsLocale();\n }\n // Fallback to undefined (Calendar will use default)\n return undefined;\n}\n","let _useDiscordAuth: boolean = false;\nlet _useGoogleAuth: boolean = false;\nlet _useInternalAuth: boolean = true;\nlet _allowRegistration: boolean = true;\nlet _registrationMode: \"open\" | \"closed\" | \"waitlist\" = \"open\";\n\nexport type RegistrationMode = \"open\" | \"closed\" | \"waitlist\";\n\nexport interface LoginConfig {\n discordClientId?: string;\n googleClientId?: string;\n useInternalAuth?: boolean;\n allowRegistration?: boolean;\n registrationMode?: RegistrationMode;\n}\n\nexport function configureLogin(params: LoginConfig): void {\n _useDiscordAuth = !!params.discordClientId;\n _useGoogleAuth = !!params.googleClientId;\n _useInternalAuth = params.useInternalAuth ?? true;\n _allowRegistration = params.allowRegistration ?? true;\n _registrationMode = params.registrationMode ?? \"open\";\n}\n\nexport function isDiscordAuthEnabled(): boolean {\n return _useDiscordAuth;\n}\n\nexport function isGoogleAuthEnabled(): boolean {\n return _useGoogleAuth;\n}\n\nexport function isInternalAuthEnabled(): boolean {\n return _useInternalAuth;\n}\n\nexport function isRegistrationAllowed(): boolean {\n return _allowRegistration;\n}\n\nexport function getRegistrationMode(): RegistrationMode {\n return _registrationMode;\n}\n","/**\n * Role ID configuration interface\n * Apps provide their role IDs via configureRoles()\n */\nexport interface RoleIdConfig {\n Administrator: string;\n CompanyAdministrator: string;\n [key: string]: string; // Allow additional roles\n}\n\n// Private storage for the injected role IDs\nlet _roleId: RoleIdConfig | null = null;\n\n/**\n * Configure role IDs for the library\n * Call this at app startup to provide role ID constants\n *\n * @example\n * ```typescript\n * import { configureRoles } from \"@carlonicora/nextjs-jsonapi\";\n * import { RoleId } from \"@phlow/shared\";\n *\n * configureRoles(RoleId);\n * ```\n */\nexport function configureRoles(roleId: RoleIdConfig): void {\n _roleId = roleId;\n}\n\n/**\n * Get configured role IDs\n * @throws Error if roles not configured\n */\nexport function getRoleId(): RoleIdConfig {\n if (!_roleId) {\n throw new Error(\"Roles not configured. Call configureRoles() at app startup.\");\n }\n return _roleId;\n}\n\n/**\n * Check if roles have been configured\n */\nexport function isRolesConfigured(): boolean {\n return _roleId !== null;\n}\n","export type QuestionnaireFieldType = \"text\" | \"textarea\" | \"select\" | \"checkbox\";\n\nexport interface QuestionnaireOption {\n value: string;\n label: string;\n description?: string;\n}\n\nexport interface QuestionnaireField {\n id: string;\n type: QuestionnaireFieldType;\n label: string;\n description?: string;\n placeholder?: string;\n required?: boolean;\n options?: QuestionnaireOption[];\n}\n\nexport interface WaitlistConfig {\n questionnaire?: QuestionnaireField[];\n heroTitle?: string;\n heroSubtitle?: string;\n heroDescription?: string;\n benefits?: string[];\n}\n\nlet _waitlistConfig: WaitlistConfig = {};\n\nexport function configureWaitlist(config: WaitlistConfig): void {\n _waitlistConfig = config;\n}\n\nexport function getWaitlistConfig(): WaitlistConfig {\n return _waitlistConfig;\n}\n"]}
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9; var _class10; var _class11; var _class12;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9; var _class10; var _class11; var _class12; var _class13; var _class14;
2
2
 
3
3
  var _chunkLXKSUWAVjs = require('./chunk-LXKSUWAV.js');
4
4
 
@@ -2289,6 +2289,7 @@ var Auth = class extends AbstractApiData {
2289
2289
  if (data.termsAcceptedAt !== void 0) response.data.attributes.termsAcceptedAt = data.termsAcceptedAt;
2290
2290
  if (data.marketingConsent !== void 0) response.data.attributes.marketingConsent = data.marketingConsent;
2291
2291
  if (data.marketingConsentAt !== void 0) response.data.attributes.marketingConsentAt = data.marketingConsentAt;
2292
+ if (data.inviteCode !== void 0) response.data.attributes.inviteCode = data.inviteCode;
2292
2293
  return response;
2293
2294
  }
2294
2295
  };
@@ -5390,6 +5391,281 @@ var OAUTH_SCOPE_DISPLAY = {
5390
5391
  var AVAILABLE_OAUTH_SCOPES = Object.values(OAUTH_SCOPE_DISPLAY);
5391
5392
  var DEFAULT_GRANT_TYPES = ["authorization_code", "refresh_token"];
5392
5393
 
5394
+ // src/features/waitlist/data/Waitlist.ts
5395
+ var Waitlist = (_class13 = class extends AbstractApiData {constructor(...args11) { super(...args11); _class13.prototype.__init24.call(this);_class13.prototype.__init25.call(this); }
5396
+ static {
5397
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "Waitlist");
5398
+ }
5399
+
5400
+ __init24() {this._gdprConsent = false}
5401
+
5402
+
5403
+
5404
+
5405
+ __init25() {this._status = "pending"}
5406
+
5407
+
5408
+
5409
+ get email() {
5410
+ return _nullishCoalesce(this._email, () => ( ""));
5411
+ }
5412
+ get gdprConsent() {
5413
+ return this._gdprConsent;
5414
+ }
5415
+ get gdprConsentAt() {
5416
+ return _nullishCoalesce(this._gdprConsentAt, () => ( ""));
5417
+ }
5418
+ get marketingConsent() {
5419
+ return this._marketingConsent;
5420
+ }
5421
+ get marketingConsentAt() {
5422
+ return this._marketingConsentAt;
5423
+ }
5424
+ get questionnaire() {
5425
+ return this._questionnaire;
5426
+ }
5427
+ get status() {
5428
+ return this._status;
5429
+ }
5430
+ get confirmedAt() {
5431
+ return this._confirmedAt;
5432
+ }
5433
+ get invitedAt() {
5434
+ return this._invitedAt;
5435
+ }
5436
+ get registeredAt() {
5437
+ return this._registeredAt;
5438
+ }
5439
+ rehydrate(data) {
5440
+ super.rehydrate(data);
5441
+ this._email = data.jsonApi.attributes.email;
5442
+ this._gdprConsent = data.jsonApi.attributes.gdprConsent;
5443
+ this._gdprConsentAt = data.jsonApi.attributes.gdprConsentAt;
5444
+ this._marketingConsent = data.jsonApi.attributes.marketingConsent;
5445
+ this._marketingConsentAt = data.jsonApi.attributes.marketingConsentAt;
5446
+ this._questionnaire = data.jsonApi.attributes.questionnaire;
5447
+ this._status = data.jsonApi.attributes.status;
5448
+ this._confirmedAt = data.jsonApi.attributes.confirmedAt;
5449
+ this._invitedAt = data.jsonApi.attributes.invitedAt;
5450
+ this._registeredAt = data.jsonApi.attributes.registeredAt;
5451
+ return this;
5452
+ }
5453
+ createJsonApi(data) {
5454
+ const response = {
5455
+ data: {
5456
+ type: Modules.Waitlist.name,
5457
+ id: data.id,
5458
+ attributes: {
5459
+ email: data.email,
5460
+ gdprConsent: data.gdprConsent,
5461
+ gdprConsentAt: data.gdprConsentAt
5462
+ },
5463
+ meta: {},
5464
+ relationships: {}
5465
+ },
5466
+ included: []
5467
+ };
5468
+ if (data.marketingConsent !== void 0) {
5469
+ response.data.attributes.marketingConsent = data.marketingConsent;
5470
+ }
5471
+ if (data.marketingConsentAt !== void 0) {
5472
+ response.data.attributes.marketingConsentAt = data.marketingConsentAt;
5473
+ }
5474
+ if (data.questionnaire !== void 0) {
5475
+ response.data.attributes.questionnaire = JSON.stringify(data.questionnaire);
5476
+ }
5477
+ return response;
5478
+ }
5479
+ }, _class13);
5480
+
5481
+ // src/features/waitlist/data/WaitlistService.ts
5482
+ var WaitlistService = class extends AbstractService {
5483
+ static {
5484
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "WaitlistService");
5485
+ }
5486
+ /**
5487
+ * Submit to waitlist (public)
5488
+ * Uses Waitlist.createJsonApi() to transform WaitlistInput to JSON:API format
5489
+ */
5490
+ static async submit(params) {
5491
+ return this.callApi({
5492
+ type: Modules.Waitlist,
5493
+ method: "POST" /* POST */,
5494
+ endpoint: new EndpointCreator({ endpoint: Modules.Waitlist }).generate(),
5495
+ input: params
5496
+ });
5497
+ }
5498
+ /**
5499
+ * Confirm email (public)
5500
+ */
5501
+ static async confirm(code) {
5502
+ const endpoint = new EndpointCreator({
5503
+ endpoint: Modules.Waitlist,
5504
+ childEndpoint: "confirm",
5505
+ childId: code
5506
+ });
5507
+ return this.callApi({
5508
+ type: Modules.Waitlist,
5509
+ method: "GET" /* GET */,
5510
+ endpoint: endpoint.generate()
5511
+ });
5512
+ }
5513
+ /**
5514
+ * List all waitlist entries (admin)
5515
+ * Uses cursor-based pagination with NextRef/PreviousRef
5516
+ */
5517
+ static async findMany(params) {
5518
+ const endpoint = new EndpointCreator({ endpoint: Modules.Waitlist });
5519
+ if (_optionalChain([params, 'optionalAccess', _122 => _122.status])) endpoint.addAdditionalParam("status", params.status);
5520
+ if (_optionalChain([params, 'optionalAccess', _123 => _123.search])) endpoint.addAdditionalParam("search", params.search);
5521
+ if (_optionalChain([params, 'optionalAccess', _124 => _124.fetchAll])) endpoint.addAdditionalParam("fetchAll", "true");
5522
+ return this.callApi({
5523
+ type: Modules.Waitlist,
5524
+ method: "GET" /* GET */,
5525
+ endpoint: endpoint.generate(),
5526
+ next: _optionalChain([params, 'optionalAccess', _125 => _125.next]),
5527
+ previous: _optionalChain([params, 'optionalAccess', _126 => _126.prev])
5528
+ });
5529
+ }
5530
+ /**
5531
+ * Send invite (admin)
5532
+ */
5533
+ static async invite(id) {
5534
+ const endpoint = new EndpointCreator({
5535
+ endpoint: Modules.Waitlist,
5536
+ id,
5537
+ childEndpoint: "invite"
5538
+ });
5539
+ return this.callApi({
5540
+ type: Modules.Waitlist,
5541
+ method: "POST" /* POST */,
5542
+ endpoint: endpoint.generate()
5543
+ });
5544
+ }
5545
+ /**
5546
+ * Batch invite (admin)
5547
+ * Non-standard batch operation - uses custom JSON:API format
5548
+ */
5549
+ static async inviteBatch(ids) {
5550
+ const endpoint = new EndpointCreator({
5551
+ endpoint: Modules.Waitlist,
5552
+ childEndpoint: "invite-batch"
5553
+ });
5554
+ return this.callApi({
5555
+ type: Modules.Waitlist,
5556
+ method: "POST" /* POST */,
5557
+ endpoint: endpoint.generate(),
5558
+ input: {
5559
+ data: {
5560
+ type: "waitlist-batch-invites",
5561
+ attributes: { ids }
5562
+ }
5563
+ },
5564
+ overridesJsonApiCreation: true
5565
+ });
5566
+ }
5567
+ /**
5568
+ * Get statistics (admin)
5569
+ */
5570
+ static async getStats() {
5571
+ const endpoint = new EndpointCreator({
5572
+ endpoint: Modules.WaitlistStats
5573
+ });
5574
+ return this.callApi({
5575
+ type: Modules.WaitlistStats,
5576
+ method: "GET" /* GET */,
5577
+ endpoint: endpoint.generate()
5578
+ });
5579
+ }
5580
+ /**
5581
+ * Validate invite code (public) - calls auth endpoint
5582
+ */
5583
+ static async validateInvite(code) {
5584
+ console.log("[WaitlistService.validateInvite] Starting validation for code:", code);
5585
+ try {
5586
+ const endpoint = new EndpointCreator({
5587
+ endpoint: Modules.Waitlist,
5588
+ childEndpoint: "invite",
5589
+ childId: code
5590
+ });
5591
+ console.log("[WaitlistService.validateInvite] Calling endpoint:", endpoint.generate());
5592
+ const response = await this.callApiWithMeta({
5593
+ type: Modules.Auth,
5594
+ method: "GET" /* GET */,
5595
+ endpoint: endpoint.generate()
5596
+ });
5597
+ console.log("[WaitlistService.validateInvite] Response:", JSON.stringify(response));
5598
+ const attributes = _optionalChain([response, 'access', _127 => _127.data, 'optionalAccess', _128 => _128._jsonApi, 'optionalAccess', _129 => _129.attributes]);
5599
+ console.log("[WaitlistService.validateInvite] Parsed attributes:", JSON.stringify(attributes));
5600
+ return {
5601
+ email: _optionalChain([attributes, 'optionalAccess', _130 => _130.email]),
5602
+ valid: _nullishCoalesce(_optionalChain([attributes, 'optionalAccess', _131 => _131.valid]), () => ( false))
5603
+ };
5604
+ } catch (error) {
5605
+ console.error("[WaitlistService.validateInvite] Error:", error);
5606
+ return null;
5607
+ }
5608
+ }
5609
+ };
5610
+
5611
+ // src/features/waitlist/data/waitlist-stats.ts
5612
+ var WaitlistStats = (_class14 = class extends AbstractApiData {constructor(...args12) { super(...args12); _class14.prototype.__init26.call(this);_class14.prototype.__init27.call(this);_class14.prototype.__init28.call(this);_class14.prototype.__init29.call(this);_class14.prototype.__init30.call(this); }
5613
+ static {
5614
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "WaitlistStats");
5615
+ }
5616
+ __init26() {this._pending = 0}
5617
+ __init27() {this._confirmed = 0}
5618
+ __init28() {this._invited = 0}
5619
+ __init29() {this._registered = 0}
5620
+ __init30() {this._total = 0}
5621
+ get pending() {
5622
+ return this._pending;
5623
+ }
5624
+ get confirmed() {
5625
+ return this._confirmed;
5626
+ }
5627
+ get invited() {
5628
+ return this._invited;
5629
+ }
5630
+ get registered() {
5631
+ return this._registered;
5632
+ }
5633
+ get total() {
5634
+ return this._total;
5635
+ }
5636
+ rehydrate(data) {
5637
+ super.rehydrate(data);
5638
+ const attrs = data.jsonApi.attributes;
5639
+ this._pending = _nullishCoalesce(attrs.pending, () => ( 0));
5640
+ this._confirmed = _nullishCoalesce(attrs.confirmed, () => ( 0));
5641
+ this._invited = _nullishCoalesce(attrs.invited, () => ( 0));
5642
+ this._registered = _nullishCoalesce(attrs.registered, () => ( 0));
5643
+ this._total = _nullishCoalesce(attrs.total, () => ( 0));
5644
+ return this;
5645
+ }
5646
+ createJsonApi(_data) {
5647
+ throw new Error("WaitlistStats is read-only and cannot be created");
5648
+ }
5649
+ }, _class14);
5650
+
5651
+ // src/features/waitlist/waitlist.module.ts
5652
+ var WaitlistModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory) => factory({
5653
+ name: "waitlists",
5654
+ pageUrl: "/waitlists",
5655
+ model: Waitlist
5656
+ }), "WaitlistModule");
5657
+
5658
+ // src/features/waitlist/waitlist-stats.module.ts
5659
+ var WaitlistStatsModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory) => factory({
5660
+ name: "waitlist-stats",
5661
+ model: WaitlistStats
5662
+ }), "WaitlistStatsModule");
5663
+
5664
+
5665
+
5666
+
5667
+
5668
+
5393
5669
 
5394
5670
 
5395
5671
 
@@ -5518,5 +5794,5 @@ var DEFAULT_GRANT_TYPES = ["authorization_code", "refresh_token"];
5518
5794
 
5519
5795
 
5520
5796
 
5521
- exports.RehydrationFactory = RehydrationFactory; exports.AbstractApiData = AbstractApiData; exports.HttpMethod = HttpMethod; exports.getLastApiTotal = getLastApiTotal; exports.clearLastApiTotal = clearLastApiTotal; exports.setGlobalErrorHandler = setGlobalErrorHandler; exports.getGlobalErrorHandler = getGlobalErrorHandler; exports.AbstractService = AbstractService; exports.configureClientJsonApi = configureClientJsonApi; exports.getClientApiUrl = getClientApiUrl; exports.getClientAppUrl = getClientAppUrl; exports.getClientTrackablePages = getClientTrackablePages; exports.ClientJsonApiGet = ClientJsonApiGet; exports.ClientJsonApiPost = ClientJsonApiPost; exports.ClientJsonApiPut = ClientJsonApiPut; exports.ClientJsonApiPatch = ClientJsonApiPatch; exports.ClientJsonApiDelete = ClientJsonApiDelete; exports.ClientHttpMethod = ClientHttpMethod; exports.setClientGlobalErrorHandler = setClientGlobalErrorHandler; exports.getClientGlobalErrorHandler = getClientGlobalErrorHandler; exports.ClientAbstractService = ClientAbstractService; exports.ModuleRegistrar = ModuleRegistrar; exports.ModuleRegistry = ModuleRegistry; exports.Modules = Modules; exports.EndpointCreator = EndpointCreator; exports.createJsonApiInclusion = createJsonApiInclusion; exports.rehydrate = rehydrate; exports.rehydrateList = rehydrateList; exports.cn = cn; exports.composeRefs = composeRefs; exports.useComposedRefs = useComposedRefs; exports.useIsMobile = useIsMobile; exports.formatDate = formatDate; exports.exists = exists; exports.TableOptions = TableOptions; exports.getTableOptions = getTableOptions; exports.getTableComponents = getTableComponents; exports.userObjectSchema = userObjectSchema; exports.entityObjectSchema = entityObjectSchema; exports.BlockNoteDiffUtil = BlockNoteDiffUtil; exports.BlockNoteWordDiffRendererUtil = BlockNoteWordDiffRendererUtil; exports.getIconByModule = getIconByModule; exports.getIcon = getIcon; exports.getIconByModuleName = getIconByModuleName; exports.getLucideIcon = getLucideIcon; exports.getLucideIconByModule = getLucideIconByModule; exports.getLucideIconByModuleName = getLucideIconByModuleName; exports.showToast = showToast; exports.showError = showError; exports.dismissToast = dismissToast; exports.showCustomToast = showCustomToast; exports.Action = Action; exports.checkPermissions = checkPermissions; exports.checkPermissionsFromServer = checkPermissionsFromServer; exports.getValueFromPath = getValueFromPath; exports.configureAuth = configureAuth; exports.getTokenHandler = getTokenHandler; exports.Auth = Auth; exports.AuthService = AuthService; exports.AuthComponent = AuthComponent; exports.AuthModule = AuthModule; exports.BillingService = BillingService; exports.Billing = Billing; exports.BillingModule = BillingModule; exports.PaymentMethod = PaymentMethod; exports.StripeCustomer = StripeCustomer; exports.StripeCustomerService = StripeCustomerService; exports.StripeCustomerModule = StripeCustomerModule; exports.StripePaymentMethodModule = StripePaymentMethodModule; exports.StripeInvoice = StripeInvoice; exports.InvoiceStatus = InvoiceStatus; exports.StripeInvoiceService = StripeInvoiceService; exports.StripeInvoiceModule = StripeInvoiceModule; exports.StripePrice = StripePrice; exports.StripePriceService = StripePriceService; exports.StripePriceModule = StripePriceModule; exports.StripeProduct = StripeProduct; exports.StripeProductService = StripeProductService; exports.StripeProductModule = StripeProductModule; exports.StripeSubscription = StripeSubscription; exports.SubscriptionStatus = SubscriptionStatus; exports.StripeSubscriptionService = StripeSubscriptionService; exports.StripeSubscriptionModule = StripeSubscriptionModule; exports.StripeUsage = StripeUsage; exports.StripeUsageService = StripeUsageService; exports.StripeUsageModule = StripeUsageModule; exports.StripePromotionCodeService = StripePromotionCodeService; exports.StripePromotionCode = StripePromotionCode; exports.StripePromotionCodeModule = StripePromotionCodeModule; exports.Company = Company; exports.CompanyFields = CompanyFields; exports.CompanyService = CompanyService; exports.CompanyModule = CompanyModule; exports.Content = Content; exports.ContentFields = ContentFields; exports.ContentService = ContentService; exports.ContentModule = ContentModule; exports.Feature = Feature; exports.FeatureService = FeatureService; exports.FeatureModule = FeatureModule; exports.Module = Module; exports.ModuleModule = ModuleModule; exports.Notification = Notification; exports.NotificationFields = NotificationFields; exports.NotificationService = NotificationService; exports.NotificationModule = NotificationModule; exports.Push = Push; exports.PushService = PushService; exports.PushModule = PushModule; exports.Role = Role; exports.RoleFields = RoleFields; exports.RoleService = RoleService; exports.RoleModule = RoleModule; exports.S3 = S3; exports.S3Module = S3Module; exports.S3Service = S3Service; exports.User = User; exports.UserFields = UserFields; exports.UserService = UserService; exports.AuthorModule = AuthorModule; exports.UserModule = UserModule; exports.OAuthClient = OAuthClient; exports.OAuthModule = OAuthModule; exports.OAuthService = OAuthService; exports.OAUTH_SCOPE_DISPLAY = OAUTH_SCOPE_DISPLAY; exports.AVAILABLE_OAUTH_SCOPES = AVAILABLE_OAUTH_SCOPES; exports.DEFAULT_GRANT_TYPES = DEFAULT_GRANT_TYPES;
5522
- //# sourceMappingURL=chunk-3EZX4G2E.js.map
5797
+ exports.RehydrationFactory = RehydrationFactory; exports.AbstractApiData = AbstractApiData; exports.HttpMethod = HttpMethod; exports.getLastApiTotal = getLastApiTotal; exports.clearLastApiTotal = clearLastApiTotal; exports.setGlobalErrorHandler = setGlobalErrorHandler; exports.getGlobalErrorHandler = getGlobalErrorHandler; exports.AbstractService = AbstractService; exports.configureClientJsonApi = configureClientJsonApi; exports.getClientApiUrl = getClientApiUrl; exports.getClientAppUrl = getClientAppUrl; exports.getClientTrackablePages = getClientTrackablePages; exports.ClientJsonApiGet = ClientJsonApiGet; exports.ClientJsonApiPost = ClientJsonApiPost; exports.ClientJsonApiPut = ClientJsonApiPut; exports.ClientJsonApiPatch = ClientJsonApiPatch; exports.ClientJsonApiDelete = ClientJsonApiDelete; exports.ClientHttpMethod = ClientHttpMethod; exports.setClientGlobalErrorHandler = setClientGlobalErrorHandler; exports.getClientGlobalErrorHandler = getClientGlobalErrorHandler; exports.ClientAbstractService = ClientAbstractService; exports.ModuleRegistrar = ModuleRegistrar; exports.ModuleRegistry = ModuleRegistry; exports.Modules = Modules; exports.EndpointCreator = EndpointCreator; exports.createJsonApiInclusion = createJsonApiInclusion; exports.rehydrate = rehydrate; exports.rehydrateList = rehydrateList; exports.cn = cn; exports.composeRefs = composeRefs; exports.useComposedRefs = useComposedRefs; exports.useIsMobile = useIsMobile; exports.formatDate = formatDate; exports.exists = exists; exports.TableOptions = TableOptions; exports.getTableOptions = getTableOptions; exports.getTableComponents = getTableComponents; exports.userObjectSchema = userObjectSchema; exports.entityObjectSchema = entityObjectSchema; exports.BlockNoteDiffUtil = BlockNoteDiffUtil; exports.BlockNoteWordDiffRendererUtil = BlockNoteWordDiffRendererUtil; exports.getIconByModule = getIconByModule; exports.getIcon = getIcon; exports.getIconByModuleName = getIconByModuleName; exports.getLucideIcon = getLucideIcon; exports.getLucideIconByModule = getLucideIconByModule; exports.getLucideIconByModuleName = getLucideIconByModuleName; exports.showToast = showToast; exports.showError = showError; exports.dismissToast = dismissToast; exports.showCustomToast = showCustomToast; exports.Action = Action; exports.checkPermissions = checkPermissions; exports.checkPermissionsFromServer = checkPermissionsFromServer; exports.getValueFromPath = getValueFromPath; exports.configureAuth = configureAuth; exports.getTokenHandler = getTokenHandler; exports.Auth = Auth; exports.AuthService = AuthService; exports.AuthComponent = AuthComponent; exports.AuthModule = AuthModule; exports.BillingService = BillingService; exports.Billing = Billing; exports.BillingModule = BillingModule; exports.PaymentMethod = PaymentMethod; exports.StripeCustomer = StripeCustomer; exports.StripeCustomerService = StripeCustomerService; exports.StripeCustomerModule = StripeCustomerModule; exports.StripePaymentMethodModule = StripePaymentMethodModule; exports.StripeInvoice = StripeInvoice; exports.InvoiceStatus = InvoiceStatus; exports.StripeInvoiceService = StripeInvoiceService; exports.StripeInvoiceModule = StripeInvoiceModule; exports.StripePrice = StripePrice; exports.StripePriceService = StripePriceService; exports.StripePriceModule = StripePriceModule; exports.StripeProduct = StripeProduct; exports.StripeProductService = StripeProductService; exports.StripeProductModule = StripeProductModule; exports.StripeSubscription = StripeSubscription; exports.SubscriptionStatus = SubscriptionStatus; exports.StripeSubscriptionService = StripeSubscriptionService; exports.StripeSubscriptionModule = StripeSubscriptionModule; exports.StripeUsage = StripeUsage; exports.StripeUsageService = StripeUsageService; exports.StripeUsageModule = StripeUsageModule; exports.StripePromotionCodeService = StripePromotionCodeService; exports.StripePromotionCode = StripePromotionCode; exports.StripePromotionCodeModule = StripePromotionCodeModule; exports.Company = Company; exports.CompanyFields = CompanyFields; exports.CompanyService = CompanyService; exports.CompanyModule = CompanyModule; exports.Content = Content; exports.ContentFields = ContentFields; exports.ContentService = ContentService; exports.ContentModule = ContentModule; exports.Feature = Feature; exports.FeatureService = FeatureService; exports.FeatureModule = FeatureModule; exports.Module = Module; exports.ModuleModule = ModuleModule; exports.Notification = Notification; exports.NotificationFields = NotificationFields; exports.NotificationService = NotificationService; exports.NotificationModule = NotificationModule; exports.Push = Push; exports.PushService = PushService; exports.PushModule = PushModule; exports.Role = Role; exports.RoleFields = RoleFields; exports.RoleService = RoleService; exports.RoleModule = RoleModule; exports.S3 = S3; exports.S3Module = S3Module; exports.S3Service = S3Service; exports.User = User; exports.UserFields = UserFields; exports.UserService = UserService; exports.AuthorModule = AuthorModule; exports.UserModule = UserModule; exports.OAuthClient = OAuthClient; exports.OAuthModule = OAuthModule; exports.OAuthService = OAuthService; exports.OAUTH_SCOPE_DISPLAY = OAUTH_SCOPE_DISPLAY; exports.AVAILABLE_OAUTH_SCOPES = AVAILABLE_OAUTH_SCOPES; exports.DEFAULT_GRANT_TYPES = DEFAULT_GRANT_TYPES; exports.Waitlist = Waitlist; exports.WaitlistService = WaitlistService; exports.WaitlistStats = WaitlistStats; exports.WaitlistModule = WaitlistModule; exports.WaitlistStatsModule = WaitlistStatsModule;
5798
+ //# sourceMappingURL=chunk-ZNGEVB5M.js.map