@kyro-cms/core 0.12.70 → 0.12.71

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 (80) hide show
  1. package/dist/{WebhookService-CGNSlclW.d.ts → WebhookService-DQyM9fVo.d.ts} +1 -1
  2. package/dist/{WebhookService-CIQPD1We.d.cts → WebhookService-bo1NrgBW.d.cts} +1 -1
  3. package/dist/api-handler-graphql.cjs +1 -1
  4. package/dist/api-handler-graphql.js +1 -1
  5. package/dist/api-handler-trpc.cjs +1 -1
  6. package/dist/api-handler-trpc.js +1 -1
  7. package/dist/api-handler.cjs +1 -1
  8. package/dist/api-handler.js +1 -1
  9. package/dist/{types-CpjuXbe7.d.cts → base-BcfNgOqZ.d.ts} +69 -1
  10. package/dist/{types-CpjuXbe7.d.ts → base-urWvrsX8.d.cts} +69 -1
  11. package/dist/bootstrap-E24SGUJP.cjs +1 -0
  12. package/dist/{bootstrap-WB6FDH2T.js → bootstrap-YFVE7MRG.js} +1 -1
  13. package/dist/{chunk-6USPOWA4.js → chunk-26KFM3P6.js} +10 -10
  14. package/dist/{chunk-MRR7OTRX.js → chunk-2HATK4C5.js} +28 -28
  15. package/dist/{chunk-637PTUHF.js → chunk-3TAUNYEM.js} +1 -1
  16. package/dist/{chunk-IL2TMAHB.cjs → chunk-A35ZP72D.cjs} +3 -3
  17. package/dist/{chunk-TBTQXIHP.js → chunk-CHYVUWZ3.js} +1 -1
  18. package/dist/{chunk-3XLXKGEU.cjs → chunk-FG3IFGJP.cjs} +1 -1
  19. package/dist/{chunk-XVPTVTQC.js → chunk-FSWDDVLA.js} +2 -2
  20. package/dist/{chunk-MVZSSTCV.js → chunk-FUFS65Q5.js} +2 -2
  21. package/dist/{chunk-Z552BTXA.cjs → chunk-H7PC2ENZ.cjs} +1 -1
  22. package/dist/chunk-K6ZW5M6S.cjs +56 -0
  23. package/dist/{chunk-OBH6EEAO.cjs → chunk-LKQHIOPW.cjs} +5 -5
  24. package/dist/{chunk-SOCBJPYB.cjs → chunk-RVBSJ4UQ.cjs} +1 -1
  25. package/dist/{chunk-ZQETJ4T4.cjs → chunk-TCFL3UWT.cjs} +1 -1
  26. package/dist/{chunk-4OMQURN7.js → chunk-ZAKYTBEN.js} +1 -1
  27. package/dist/cli/index.cjs +1 -1
  28. package/dist/cli/index.js +1 -1
  29. package/dist/client.cjs +109 -1
  30. package/dist/client.js +109 -2
  31. package/dist/drizzle/index.cjs +1 -1
  32. package/dist/drizzle/index.d.cts +3 -4
  33. package/dist/drizzle/index.d.ts +3 -4
  34. package/dist/drizzle/index.js +1 -1
  35. package/dist/fields/index.d.cts +2 -2
  36. package/dist/fields/index.d.ts +2 -2
  37. package/dist/graphql/index.d.cts +3 -3
  38. package/dist/graphql/index.d.ts +3 -3
  39. package/dist/{index-DTy4k1oU.d.ts → index-4cH-BjtP.d.ts} +2 -2
  40. package/dist/{index-BHYGO3yF.d.cts → index-d1m_oup7.d.cts} +2 -2
  41. package/dist/index.cjs +35 -16
  42. package/dist/index.d.cts +105 -13
  43. package/dist/index.d.ts +105 -13
  44. package/dist/index.js +39 -20
  45. package/dist/mongodb/index.d.cts +3 -4
  46. package/dist/mongodb/index.d.ts +3 -4
  47. package/dist/postgres-auth-adapter-SK3N3OSS.js +1 -1
  48. package/dist/postgres-auth-adapter-ZO6HK5AK.cjs +1 -1
  49. package/dist/postgres-js-7YBZKGXG.cjs +1 -0
  50. package/dist/{postgres-js-WE3NBRFO.js → postgres-js-JLFIWOBH.js} +1 -1
  51. package/dist/rest/index.cjs +1 -1
  52. package/dist/rest/index.d.cts +4 -4
  53. package/dist/rest/index.d.ts +4 -4
  54. package/dist/rest/index.js +1 -1
  55. package/dist/templates/index.d.cts +2 -2
  56. package/dist/templates/index.d.ts +2 -2
  57. package/dist/trpc/index.d.cts +3 -3
  58. package/dist/trpc/index.d.ts +3 -3
  59. package/dist/{types-BWJx6zzm.d.ts → types-BADIMVGF.d.ts} +2 -2
  60. package/dist/{types-BKPEavuy.d.cts → types-DlGSbh7I.d.cts} +1 -1
  61. package/dist/{types-BKPEavuy.d.ts → types-DlGSbh7I.d.ts} +1 -1
  62. package/dist/{types-CeAQSR87.d.cts → types-YAVR0H9Z.d.cts} +2 -2
  63. package/package.json +2 -2
  64. package/dist/base-Ds06wMo9.d.cts +0 -69
  65. package/dist/base-DxDXLyWe.d.ts +0 -69
  66. package/dist/bootstrap-XDT4MRML.cjs +0 -1
  67. package/dist/chunk-7FXEXHK6.js +0 -21
  68. package/dist/chunk-JSTDCK3Z.js +0 -2
  69. package/dist/chunk-JT36FTHY.cjs +0 -20
  70. package/dist/chunk-L2QXP26Q.js +0 -2
  71. package/dist/chunk-MVX2PYJJ.cjs +0 -1
  72. package/dist/chunk-MYGHZQMO.cjs +0 -1
  73. package/dist/chunk-OUAR4ZCU.cjs +0 -56
  74. package/dist/client.d.cts +0 -12
  75. package/dist/client.d.ts +0 -12
  76. package/dist/index-D7kt5jT_.d.ts +0 -97
  77. package/dist/index-DPtCjn94.d.cts +0 -97
  78. package/dist/postgres-js-GXZX3AGZ.cjs +0 -1
  79. /package/dist/{chunk-XTTGHN3D.cjs → chunk-FLS2FJM6.cjs} +0 -0
  80. /package/dist/{chunk-KWGB3YNI.js → chunk-PFKVHUOT.js} +0 -0
package/dist/index.d.ts CHANGED
@@ -1,28 +1,26 @@
1
1
  import * as hono from 'hono';
2
2
  import * as hono_types from 'hono/types';
3
- import { R as Registry } from './index-DTy4k1oU.js';
4
- export { c as createRegistry, g as getRegistry, r as resetRegistry } from './index-DTy4k1oU.js';
5
- import { j as StorageProvider, B as BaseAdapter, P as PluginManager, K as KyroConfig, l as User, R as Request$1, C as CollectionConfig, G as GlobalConfig, F as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, e as UpdateArgs, D as DeleteArgs, f as FindOneArgs, g as FindVersionsArgs, h as VersionRecord, i as CreateVersionArgs } from './types-BWJx6zzm.js';
6
- export { m as AccessArgs, n as AccessControl, o as AdapterConfig, A as AdminConfig, p as AnalyticsPlugin, a as AuthConfig, q as CollectionAccess, r as CollectionHooks, s as CommentsPlugin, t as ConfigService, u as CreateResult, E as EmailConfig, v as FieldAccess, w as FieldHooks, x as GlobalAccess, y as GlobalHooks, H as Hook, z as HookArgs, I as ImageSize, k as KyroPlugin, J as PluginAPI, L as PluginHooks, M as ReviewsPlugin, N as SEOPlugin, S as StorageConfig, U as UploadConfig, V as VersionConfig, W as WhereClause, O as WishlistPlugin, Q as evaluateAccess, X as getWhereClause, Y as mergeWhereClauses, Z as presetPlugins, _ as resolveProvider, $ as runFieldHooks, a0 as runHooks } from './types-BWJx6zzm.js';
3
+ import { R as Registry } from './index-4cH-BjtP.js';
4
+ export { c as createRegistry, g as getRegistry, r as resetRegistry } from './index-4cH-BjtP.js';
5
+ import { a as StorageProvider, C as CollectionConfig, G as GlobalConfig, B as BaseAdapter, P as PluginManager, h as KyroConfig, i as User, R as Request$1, F as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, U as UpdateArgs, D as DeleteArgs, e as FindOneArgs, f as FindVersionsArgs, V as VersionRecord, g as CreateVersionArgs } from './types-BADIMVGF.js';
6
+ export { A as AccessArgs, j as AccessControl, k as AdapterConfig, l as AdminConfig, m as AnalyticsPlugin, n as AuthConfig, o as CollectionAccess, p as CollectionHooks, q as CommentsPlugin, r as ConfigService, s as CreateResult, E as EmailConfig, t as FieldAccess, u as FieldHooks, v as GlobalAccess, w as GlobalHooks, H as Hook, x as HookArgs, I as ImageSize, K as KyroPlugin, y as PluginAPI, z as PluginHooks, J as ReviewsPlugin, L as SEOPlugin, S as StorageConfig, M as UploadConfig, N as VersionConfig, W as WhereClause, O as WishlistPlugin, Q as evaluateAccess, X as getWhereClause, Y as mergeWhereClauses, Z as presetPlugins, _ as resolveProvider, $ as runFieldHooks, a0 as runHooks } from './types-BADIMVGF.js';
7
7
  import { KyroPubSub, KyroWSServer } from './ws/index.js';
8
8
  export { PubSub, createWSServer } from './ws/index.js';
9
- import { W as WebhookPayload, D as DeliveryResult, a as WebhookDelivery, b as WebhookConfig, c as DeliveryOptions, d as WebhookService } from './WebhookService-CGNSlclW.js';
10
- export { A as ALL_WEBHOOK_EVENTS, C as CreateWebhookData, U as UpdateWebhookData, e as WEBHOOK_COLLECTION, f as WEBHOOK_DELIVERY_COLLECTION, g as WEBHOOK_EVENTS, h as WebhookEvent, i as WebhookTriggerResult, j as createWebhookService } from './WebhookService-CGNSlclW.js';
11
- import { F as Field } from './types-BKPEavuy.js';
12
- export { A as ALL_FIELD_TYPES, a as ArrayField, B as BaseField, b as Block, e as BlocksField, v as COMPLEX_FIELD_TYPES, C as CheckboxField, f as CodeField, g as CollapsibleField, h as ColorField, D as DateField, E as EmailField, j as FieldAdmin, k as FieldType, G as GroupField, l as ImageField, J as JSONField, L as LAYOUT_FIELD_TYPES, M as MarkdownField, N as NumberField, x as PRIMITIVE_FIELD_TYPES, P as PasswordField, y as RELATIONAL_FIELD_TYPES, R as RadioField, m as RelationshipField, n as RichTextBlock, o as RichTextField, p as RowField, q as SelectField, T as TabsField, r as TextField, s as TextareaField, U as UploadField, V as ValidateOptions, O as isArrayField, Q as isBlocksField, W as isGroupField, Y as isImageField, Z as isLayoutField, _ as isNumberField, $ as isRelationshipField, a0 as isRichTextField, a1 as isSelectField, a2 as isTextField, a3 as isUploadField } from './types-BKPEavuy.js';
9
+ import { W as WebhookPayload, D as DeliveryResult, a as WebhookDelivery, b as WebhookConfig, c as DeliveryOptions, d as WebhookService } from './WebhookService-DQyM9fVo.js';
10
+ export { A as ALL_WEBHOOK_EVENTS, C as CreateWebhookData, U as UpdateWebhookData, e as WEBHOOK_COLLECTION, f as WEBHOOK_DELIVERY_COLLECTION, g as WEBHOOK_EVENTS, h as WebhookEvent, i as WebhookTriggerResult, j as createWebhookService } from './WebhookService-DQyM9fVo.js';
11
+ import { F as Field } from './types-DlGSbh7I.js';
12
+ export { A as ALL_FIELD_TYPES, b as ArrayField, B as BaseField, c as Block, f as BlocksField, C as COMPLEX_FIELD_TYPES, h as CheckboxField, i as CodeField, j as CollapsibleField, k as ColorField, D as DateField, E as EmailField, m as FieldAdmin, n as FieldType, G as GroupField, o as ImageField, J as JSONField, L as LAYOUT_FIELD_TYPES, M as MarkdownField, N as NumberField, P as PRIMITIVE_FIELD_TYPES, q as PasswordField, R as RELATIONAL_FIELD_TYPES, r as RadioField, s as RelationshipField, t as RichTextBlock, u as RichTextField, v as RowField, w as SelectField, T as TabsField, x as TextField, z as TextareaField, U as UploadField, V as ValidateOptions, O as isArrayField, Q as isBlocksField, W as isGroupField, Y as isImageField, Z as isLayoutField, _ as isNumberField, $ as isRelationshipField, a0 as isRichTextField, a1 as isSelectField, a2 as isTextField, a3 as isUploadField } from './types-DlGSbh7I.js';
13
13
  import { ZodTypeAny, z } from 'zod';
14
14
  export { z } from 'zod';
15
15
  export { n as normalizeRichTextValue, r as renderRichText, a as richTextStyles } from './richtext-DrhORshE.js';
16
- import { A as AbstractBaseAdapter } from './base-DxDXLyWe.js';
16
+ import { A as AuditLog, a as AuditLogFilter, b as AbstractBaseAdapter, c as AuthAdapter, U as UserRole, d as AuthUser, S as Session, e as AuthTokenConfig, R as RegisterData, f as AuthResult, L as LoginCredentials, J as JWTPayload } from './base-BcfNgOqZ.js';
17
+ export { g as AuditAction } from './base-BcfNgOqZ.js';
17
18
  import { Dialect } from './drizzle/index.js';
18
19
  export { DrizzleAdapter, PostgresAuthAdapter, collectionToDrizzleSchema, createDatabase, createDrizzleAdapter, fieldToDrizzleType, runMigrations, seedDefaultRoles } from './drizzle/index.js';
19
20
  export { MongoDBAdapter, MongoDBAuthAdapter, createMongoDBAdapter } from './mongodb/index.js';
20
21
  export { createContext, createCountProcedure, createCreateProcedure, createDeleteProcedure, createDynamicRouter, createFindByIDProcedure, createFindProcedure, createKyroServer, createUpdateProcedure } from './trpc/index.js';
21
22
  export { buildGraphQLSchema, createGraphQLSchema } from './graphql/index.js';
22
23
  export { createKyroApp, createRESTAPI } from './rest/index.js';
23
- export { A as AdminStylingConfig, C as CSSGenerator, F as FIELD_DEFINITION_KEYS, a as FieldStyling, S as StylingConfig, b as StylingMode, T as ThemeBorderRadius, c as ThemeColors, d as ThemeConfig, e as ThemeFonts, f as ThemeShadows, g as ThemeSpacing, h as applyBlocksOverrides, i as applyCollectionOverrides, j as applyGlobalOverrides, k as applyTabsOverrides, l as createAdminStyling, m as defaultDarkTheme, n as defaultFieldStyling, o as defaultLightTheme, p as ecommerce2026Theme, q as flattenFieldOverrides, r as generateCSSVariables, s as generateTailwindConfig, t as isFieldOverrideDefinition, u as updateFieldByPath } from './index-D7kt5jT_.js';
24
- import { d as AuditLog, e as AuditLogFilter, A as AuthAdapter, U as UserRole, c as AuthUser, S as Session, b as AuthTokenConfig, R as RegisterData, a as AuthResult, L as LoginCredentials, J as JWTPayload } from './types-CpjuXbe7.js';
25
- export { f as AuditAction } from './types-CpjuXbe7.js';
26
24
  export { TemplateConfig, allGlobalSettings, blogCollections, coreGlobalSettings, createTemplateConfig, ecommerceCollections, ecommerceGlobals, kitchenSinkCollections, mediaCollections, minimalCollections, templateCollections } from './templates/index.js';
27
25
  export { default as kyro } from './integration.js';
28
26
  import { Loader } from 'astro/loaders';
@@ -44,6 +42,15 @@ declare function deliverWithRetry(webhook: WebhookConfig, payload: WebhookPayloa
44
42
  declare function buildDeliveryRecord(deliveryId: string, webhookId: string, event: string, payload: WebhookPayload, attempt: number, result: DeliveryResult): WebhookDelivery;
45
43
  declare function createTestPayload(): WebhookPayload;
46
44
 
45
+ declare const FIELD_DEFINITION_KEYS: Set<string>;
46
+ declare function isFieldOverrideDefinition(obj: any): boolean;
47
+ declare function flattenFieldOverrides(overrides: Record<string, any>, prefix?: string): Record<string, any>;
48
+ declare function updateFieldByPath(fields: any[], path: string, updates: Record<string, any>, allowAppend?: boolean): boolean;
49
+ declare function applyBlocksOverrides(fields: any[], rawBlocks: any): void;
50
+ declare function applyTabsOverrides(fields: any[], rawTabs: any): void;
51
+ declare function applyCollectionOverrides(collections: CollectionConfig[], overrides?: Record<string, any>): void;
52
+ declare function applyGlobalOverrides(globals: GlobalConfig[], overrides?: Record<string, any>): void;
53
+
47
54
  type Redis$2 = any;
48
55
 
49
56
  declare class AuditLogger {
@@ -480,6 +487,91 @@ declare class TursoAdapter extends AbstractBaseAdapter {
480
487
  }
481
488
  declare function createTursoAdapter(options: TursoAdapterOptions): TursoAdapter;
482
489
 
490
+ type StylingMode = 'css' | 'tailwind' | 'css-in-js' | 'styled-components' | 'vanilla-extract';
491
+ interface StylingConfig {
492
+ mode: StylingMode;
493
+ theme?: ThemeConfig;
494
+ customProperties?: Record<string, string>;
495
+ }
496
+ interface ThemeConfig {
497
+ colors?: ThemeColors;
498
+ fonts?: ThemeFonts;
499
+ spacing?: ThemeSpacing;
500
+ borderRadius?: ThemeBorderRadius;
501
+ shadows?: ThemeShadows;
502
+ breakpoints?: Record<string, string>;
503
+ }
504
+ interface ThemeColors {
505
+ primary?: string;
506
+ secondary?: string;
507
+ accent?: string;
508
+ background?: string;
509
+ surface?: string;
510
+ text?: string;
511
+ textMuted?: string;
512
+ border?: string;
513
+ error?: string;
514
+ warning?: string;
515
+ success?: string;
516
+ info?: string;
517
+ }
518
+ interface ThemeFonts {
519
+ sans?: string;
520
+ serif?: string;
521
+ mono?: string;
522
+ }
523
+ interface ThemeSpacing {
524
+ xs?: string;
525
+ sm?: string;
526
+ md?: string;
527
+ lg?: string;
528
+ xl?: string;
529
+ '2xl'?: string;
530
+ '3xl'?: string;
531
+ '4xl'?: string;
532
+ }
533
+ interface ThemeBorderRadius {
534
+ sm?: string;
535
+ md?: string;
536
+ lg?: string;
537
+ xl?: string;
538
+ full?: string;
539
+ }
540
+ interface ThemeShadows {
541
+ sm?: string;
542
+ md?: string;
543
+ lg?: string;
544
+ xl?: string;
545
+ }
546
+ declare class CSSGenerator {
547
+ private config;
548
+ private css;
549
+ constructor(config: StylingConfig);
550
+ addRule(selector: string, properties: Record<string, string>): this;
551
+ addMediaQuery(breakpoint: string, rules: string[]): this;
552
+ generate(): string;
553
+ }
554
+ declare function generateTailwindConfig(theme: ThemeConfig): Record<string, any>;
555
+ declare const defaultLightTheme: ThemeConfig;
556
+ declare const defaultDarkTheme: ThemeConfig;
557
+ declare const ecommerce2026Theme: ThemeConfig;
558
+ declare function generateCSSVariables(theme: ThemeConfig): string;
559
+ interface AdminStylingConfig {
560
+ mode: StylingMode;
561
+ theme?: ThemeConfig;
562
+ customStyles?: string;
563
+ componentOverrides?: Record<string, Record<string, string>>;
564
+ }
565
+ declare function createAdminStyling(config: AdminStylingConfig): string;
566
+ interface FieldStyling {
567
+ wrapper?: Record<string, string>;
568
+ label?: Record<string, string>;
569
+ input?: Record<string, string>;
570
+ error?: Record<string, string>;
571
+ description?: Record<string, string>;
572
+ }
573
+ declare const defaultFieldStyling: Record<string, FieldStyling>;
574
+
483
575
  interface RedisAuthAdapterOptions {
484
576
  url?: string;
485
577
  host?: string;
@@ -1651,4 +1743,4 @@ declare class Logger {
1651
1743
  }
1652
1744
  declare const logger: Logger;
1653
1745
 
1654
- export { AbstractBaseAdapter, AccountLockout, type AdapterOptions, AuditLog, AuditLogFilter, AuditLogger, Auth, AuthAdapter, AuthResult, Session as AuthSession, AuthTokenConfig, AuthUser, BaseAdapter, type BaseEmailOptions, type BrandConfig$1 as BrandConfig, CollectionConfig, type CompareVersionsOptions, ConfigValidationError, CreateArgs, type CreateStorageResult, type CreateVersionOptions, type DatabaseConnectionOptions, type DatabaseType, type DatabaseType$1 as DbAdapterType, DeleteArgs, DeliveryOptions, DeliveryResult, Dialect, type DraftPublishConfig, type DrizzleAdapterOptions, EmailTransport, type EncryptionConfig, type Environment, Field, FindArgs, FindByIDArgs, FindResult, GlobalConfig, InMemoryAccountLockout, InMemoryAuditLogger, InMemoryAuthAdapter, InMemoryRateLimiter, JWTPayload, Kyro, type KyroActionOptions, type KyroAuthConfig, type KyroAuthMiddlewareOptions, KyroConfig, type KyroEnvSchemaOptions, type KyroLoaderOptions, KyroPubSub, KyroWSServer, LocalAdapter, type LogLevel, Logger, LoginCredentials, MediaService, type MongoDBAdapterOptions, NeonAdapter, type NeonAdapterOptions, PasswordPolicy, type PaymentConfig, PluginManager, type PublishVersionOptions, RateLimiter, RedisAuthAdapter, RegisterData, Registry, Request$1 as Request, SQLiteAuthAdapter, type SeoTagsOptions, Session, type SocialLink, type StorageAdapter, type StorageOptions, type StoreConfig, TursoAdapter, type TursoAdapterOptions, UpdateArgs, User, UserRole, type Version, type VersionAdapter, type VersionDiff, type VersionHistoryOptions, VersionManager, type VersionPublishSchedule, type VersionStatus, WebhookConfig, WebhookDelivery, WebhookPayload, WebhookService, authConfig, autoBootstrap, bootstrapAdmin, bootstrapWithRetry, buildDeliveryRecord, collectionToCreateZod, collectionToUpdateZod, collectionToWhereZod, collectionToZod, createAuditContext, createAuth, createAuthConfig, createAuthStorage, createKyro, createKyroHandler, createLocalAdapter, createLocalStorage, createNeonAdapter, createStorage, createTestPayload, createTursoAdapter, createVersionManager, defineConfig, defineKyroConfig, deliverWebhook, deliverWithRetry, fieldToZod, generateAnalyticsTags, generateKyroAstroTypes, generateSeoTags, generateWebhookSecret, getAppSecret, getBootstrapFromEnv, getDefaultDraftPublishConfig, getEmailTemplates, getEncryptionKey, getPaymentConfig, getPaymentConfigFromSettings, getSessionConfig, getSocialLinks, getSocialLinksFromSettings, getStoreConfig, getStoreConfigFromSettings, globalToZod, isArchived, isDraft, isEdgeRuntime, isPublished, kyroAction, kyroAuthMiddleware, kyroEnvSchema, kyroLoader, loadSecrets, logger, renderAbandonedCart, renderAccountLocked, renderBaseLayout, renderMagicLink, renderNewLogin, renderOrderConfirmation, renderOrderDelivered, renderOrderRefunded, renderOrderShipped, renderPasswordChanged, renderResetPassword, renderUserInvite, renderVerifyEmail, renderWelcome, setDbAdapter, signPayload, validateCollection, validateConfig, validateFields, validateGlobal };
1746
+ export { AbstractBaseAdapter, AccountLockout, type AdapterOptions, type AdminStylingConfig, AuditLog, AuditLogFilter, AuditLogger, Auth, AuthAdapter, AuthResult, Session as AuthSession, AuthTokenConfig, AuthUser, BaseAdapter, type BaseEmailOptions, type BrandConfig$1 as BrandConfig, CSSGenerator, CollectionConfig, type CompareVersionsOptions, ConfigValidationError, CreateArgs, type CreateStorageResult, type CreateVersionOptions, type DatabaseConnectionOptions, type DatabaseType, type DatabaseType$1 as DbAdapterType, DeleteArgs, DeliveryOptions, DeliveryResult, Dialect, type DraftPublishConfig, type DrizzleAdapterOptions, EmailTransport, type EncryptionConfig, type Environment, FIELD_DEFINITION_KEYS, Field, type FieldStyling, FindArgs, FindByIDArgs, FindResult, GlobalConfig, InMemoryAccountLockout, InMemoryAuditLogger, InMemoryAuthAdapter, InMemoryRateLimiter, JWTPayload, Kyro, type KyroActionOptions, type KyroAuthConfig, type KyroAuthMiddlewareOptions, KyroConfig, type KyroEnvSchemaOptions, type KyroLoaderOptions, KyroPubSub, KyroWSServer, LocalAdapter, type LogLevel, Logger, LoginCredentials, MediaService, type MongoDBAdapterOptions, NeonAdapter, type NeonAdapterOptions, PasswordPolicy, type PaymentConfig, PluginManager, type PublishVersionOptions, RateLimiter, RedisAuthAdapter, RegisterData, Registry, Request$1 as Request, SQLiteAuthAdapter, type SeoTagsOptions, Session, type SocialLink, type StorageAdapter, type StorageOptions, type StoreConfig, type StylingConfig, type StylingMode, type ThemeBorderRadius, type ThemeColors, type ThemeConfig, type ThemeFonts, type ThemeShadows, type ThemeSpacing, TursoAdapter, type TursoAdapterOptions, UpdateArgs, User, UserRole, type Version, type VersionAdapter, type VersionDiff, type VersionHistoryOptions, VersionManager, type VersionPublishSchedule, type VersionStatus, WebhookConfig, WebhookDelivery, WebhookPayload, WebhookService, applyBlocksOverrides, applyCollectionOverrides, applyGlobalOverrides, applyTabsOverrides, authConfig, autoBootstrap, bootstrapAdmin, bootstrapWithRetry, buildDeliveryRecord, collectionToCreateZod, collectionToUpdateZod, collectionToWhereZod, collectionToZod, createAdminStyling, createAuditContext, createAuth, createAuthConfig, createAuthStorage, createKyro, createKyroHandler, createLocalAdapter, createLocalStorage, createNeonAdapter, createStorage, createTestPayload, createTursoAdapter, createVersionManager, defaultDarkTheme, defaultFieldStyling, defaultLightTheme, defineConfig, defineKyroConfig, deliverWebhook, deliverWithRetry, ecommerce2026Theme, fieldToZod, flattenFieldOverrides, generateAnalyticsTags, generateCSSVariables, generateKyroAstroTypes, generateSeoTags, generateTailwindConfig, generateWebhookSecret, getAppSecret, getBootstrapFromEnv, getDefaultDraftPublishConfig, getEmailTemplates, getEncryptionKey, getPaymentConfig, getPaymentConfigFromSettings, getSessionConfig, getSocialLinks, getSocialLinksFromSettings, getStoreConfig, getStoreConfigFromSettings, globalToZod, isArchived, isDraft, isEdgeRuntime, isFieldOverrideDefinition, isPublished, kyroAction, kyroAuthMiddleware, kyroEnvSchema, kyroLoader, loadSecrets, logger, renderAbandonedCart, renderAccountLocked, renderBaseLayout, renderMagicLink, renderNewLogin, renderOrderConfirmation, renderOrderDelivered, renderOrderRefunded, renderOrderShipped, renderPasswordChanged, renderResetPassword, renderUserInvite, renderVerifyEmail, renderWelcome, setDbAdapter, signPayload, updateFieldByPath, validateCollection, validateConfig, validateFields, validateGlobal };
package/dist/index.js CHANGED
@@ -1,26 +1,45 @@
1
- export{a as LocalAdapter,b as createLocalAdapter}from'./chunk-JCEJ4VTN.js';export{a as RedisAuthAdapter}from'./chunk-M75VGFCI.js';import {a as a$5}from'./chunk-RPRGGGIW.js';export{k as allGlobalSettings,q as blogCollections,l as coreGlobalSettings,V as createTemplateConfig,r as ecommerceCollections,s as ecommerceGlobals,t as kitchenSinkCollections,v as mediaCollections,a as minimalCollections,U as templateCollections}from'./chunk-VTOL3URF.js';export{a as kyro}from'./chunk-XDPLVJRO.js';import {f}from'./chunk-MRR7OTRX.js';export{t as AnalyticsPlugin,u as CommentsPlugin,a as ConfigValidationError,y as Kyro,q as KyroPlugin,B as Logger,r as PluginManager,m as Registry,v as ReviewsPlugin,s as SEOPlugin,w as WishlistPlugin,i as collectionToCreateZod,j as collectionToUpdateZod,k as collectionToWhereZod,h as collectionToZod,z as createKyro,A as createKyroHandler,p as createRegistry,g as fieldToZod,n as getRegistry,l as globalToZod,C as logger,x as presetPlugins,o as resetRegistry,b as validateCollection,e as validateConfig,d as validateFields,c as validateGlobal,f as z}from'./chunk-MRR7OTRX.js';export{e as autoBootstrap,a as bootstrapAdmin,f as bootstrapWithRetry,d as getBootstrapFromEnv}from'./chunk-TBTQXIHP.js';import'./chunk-LWM4WABU.js';export{a as CSSGenerator,g as createAdminStyling,d as defaultDarkTheme,h as defaultFieldStyling,c as defaultLightTheme,e as ecommerce2026Theme,f as generateCSSVariables,b as generateTailwindConfig}from'./chunk-7FXEXHK6.js';export{q as ALL_FIELD_TYPES,n as COMPLEX_FIELD_TYPES,p as LAYOUT_FIELD_TYPES,m as PRIMITIVE_FIELD_TYPES,o as RELATIONAL_FIELD_TYPES,d as isArrayField,f as isBlocksField,e as isGroupField,h as isImageField,k as isLayoutField,b as isNumberField,c as isRelationshipField,i as isRichTextField,j as isSelectField,a as isTextField,g as isUploadField,t as normalizeRichTextValue,u as renderRichText,s as richTextStyles}from'./chunk-ZRIBWDYJ.js';export{a as FIELD_DEFINITION_KEYS,e as applyBlocksOverrides,g as applyCollectionOverrides,h as applyGlobalOverrides,f as applyTabsOverrides,c as flattenFieldOverrides,b as isFieldOverrideDefinition,d as updateFieldByPath}from'./chunk-JSTDCK3Z.js';import'./chunk-D6SDGHY6.js';export{a as createContext,g as createCountProcedure,d as createCreateProcedure,f as createDeleteProcedure,h as createDynamicRouter,c as createFindByIDProcedure,b as createFindProcedure,i as createKyroServer,e as createUpdateProcedure}from'./chunk-4ZWLNGLS.js';export{J as buildGraphQLSchema,K as createGraphQLSchema}from'./chunk-X473JI7Z.js';import {bb,ab,db,eb}from'./chunk-6USPOWA4.js';export{bb as AuditLogger,db as InMemoryAuditLogger,ab as InMemoryRateLimiter,gb as MediaService,cb as createAuditContext,ib as createKyroApp,_a as createLocalStorage,jb as createRESTAPI,fb as isEdgeRuntime,Za as resolveProvider}from'./chunk-6USPOWA4.js';import {q,r}from'./chunk-KWGB3YNI.js';export{p as ConfigService,q as EmailTransport,r as PasswordPolicy,o as getEmailTemplates,n as renderAbandonedCart,g as renderAccountLocked,a as renderBaseLayout,f as renderMagicLink,i as renderNewLogin,j as renderOrderConfirmation,l as renderOrderDelivered,m as renderOrderRefunded,k as renderOrderShipped,e as renderPasswordChanged,c as renderResetPassword,h as renderUserInvite,b as renderVerifyEmail,d as renderWelcome}from'./chunk-KWGB3YNI.js';import'./chunk-OLRCZ6E3.js';import {a as a$2}from'./chunk-N6MNQIQU.js';export{a as SQLiteAuthAdapter}from'./chunk-N6MNQIQU.js';import {f as f$1}from'./chunk-6TPICJ2L.js';export{c as getAppSecret,d as getEncryptionKey,e as getSessionConfig,b as loadSecrets,a as setDbAdapter}from'./chunk-6TPICJ2L.js';import'./chunk-YENNL5HG.js';import'./chunk-W45TLOOT.js';import'./chunk-IKGVPXMK.js';import'./chunk-YUUXFD73.js';import'./chunk-LVBHOZZF.js';import'./chunk-OBYAIJVU.js';import'./chunk-JRUQ5ABB.js';import'./chunk-CIVA6SKW.js';import'./chunk-WPM6LFCY.js';import'./chunk-U6KFONKM.js';import'./chunk-TYQYKKWJ.js';import'./chunk-L2QXP26Q.js';export{d as ALL_WEBHOOK_EVENTS,e as WEBHOOK_COLLECTION,f as WEBHOOK_DELIVERY_COLLECTION,c as WEBHOOK_EVENTS,m as WebhookService,k as buildDeliveryRecord,l as createTestPayload,n as createWebhookService,i as deliverWebhook,j as deliverWithRetry,h as generateWebhookSecret,g as signPayload}from'./chunk-AWQGDMOE.js';export{h as evaluateAccess,j as getWhereClause,i as mergeWhereClauses}from'./chunk-GQGFNTDZ.js';export{b as KyroPubSub,c as KyroWSServer,a as PubSub,d as createWSServer}from'./chunk-5M3FKE2V.js';import'./chunk-7MNDQU6K.js';export{c as DrizzleAdapter,b as collectionToDrizzleSchema,d as createDrizzleAdapter,a as fieldToDrizzleType}from'./chunk-MVZSSTCV.js';import'./chunk-JV4HJBXW.js';export{b as createDatabase,c as runMigrations,d as seedDefaultRoles}from'./chunk-4OMQURN7.js';import {a as a$3}from'./chunk-ZWDBPEXL.js';export{a as PostgresAuthAdapter}from'./chunk-ZWDBPEXL.js';import'./chunk-47CXBWMA.js';import'./chunk-EML5FDUU.js';import'./chunk-637PTUHF.js';import'./chunk-N5POANYV.js';import'./chunk-HRAY65XH.js';import'./chunk-2HA6EKXX.js';import'./chunk-FLMUMPDE.js';import'./chunk-3NSZZCOJ.js';export{a as MongoDBAdapter,b as createMongoDBAdapter}from'./chunk-4YCI3HBD.js';import {a as a$1}from'./chunk-5ZEYOFAK.js';export{a as MongoDBAuthAdapter}from'./chunk-5ZEYOFAK.js';import {a as a$4}from'./chunk-SLMIYECU.js';export{a as AbstractBaseAdapter}from'./chunk-SLMIYECU.js';import {a}from'./chunk-P6JITOFF.js';import'./chunk-7NH7H3WA.js';import'./chunk-VVVCCB6R.js';import'./chunk-TBHNE4VV.js';import {g}from'./chunk-Y2YAKDEQ.js';import ee,{randomBytes}from'crypto';import {readFileSync}from'fs';import Xe,{join,resolve}from'path';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
2
- g();g();g();g();async function He(s,e){let t=e.data;for(let r of s){let o=await r({...e,data:t});o!==void 0&&(t=o);}return t}async function Yr(s,e){return He(s,e)}g();g();var E=class extends a$4{connectionString;constructor(e){super(),this.connectionString=e.connectionString;}async connect(){this.connected=true;}async disconnect(){this.connected=false;}async query(e,t=[]){if(!this.connectionString)throw new Error("NeonAdapter: Connection string is required.");try{let r=await fetch(`${this.connectionString}/sql`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,params:t})});return r.ok?(await r.json()).rows||[]:[]}catch{return []}}async find(e){return {docs:[],totalDocs:0,limit:e.limit||10,totalPages:1,page:e.page||1,hasNextPage:false,hasPrevPage:false}}async findByID(e){return null}async create(e){return e.data}async update(e){return e.data}async delete(e){return {success:true,id:e.id}}async count(e){return 0}async findOne(e){return null}async findVersions(e){return {docs:[],totalDocs:0,limit:10,totalPages:1,page:1,hasNextPage:false,hasPrevPage:false}}async findVersionByID(e){return null}async createVersion(e){return {id:"v1",parentId:e.documentId,version:e.version||1,snapshot:e.snapshot||{},createdAt:new Date().toISOString()}}async updateLatestVersion(e){return {id:"v1",parentId:e.documentId,version:e.version||1,snapshot:e.snapshot||{},createdAt:new Date().toISOString()}}async deleteVersions(e){}};function Fe(s){return new E(s)}g();var O=class extends a$4{url;authToken;constructor(e){super(),this.url=e.url.replace(/^libsql:\/\//,"https://"),this.authToken=e.authToken;}async connect(){this.connected=true;}async disconnect(){this.connected=false;}async query(e,t=[]){if(!this.url)throw new Error("TursoAdapter: Database URL is required.");try{let r={"Content-Type":"application/json"};this.authToken&&(r.Authorization=`Bearer ${this.authToken}`);let o=await fetch(`${this.url}/v2/pipeline`,{method:"POST",headers:r,body:JSON.stringify({requests:[{type:"execute",stmt:{sql:e,args:t.map(l=>({type:"text",value:String(l)}))}},{type:"close"}]})});if(!o.ok)return [];let i=(await o.json())?.results?.[0]?.response?.result;if(!i||!i.rows)return [];let c=i.cols.map(l=>l.name);return i.rows.map(l=>{let p={};return c.forEach((g,m)=>{p[g]=l[m]?.value??null;}),p})}catch{return []}}async find(e){return {docs:[],totalDocs:0,limit:e.limit||10,totalPages:1,page:e.page||1,hasNextPage:false,hasPrevPage:false}}async findByID(e){return null}async create(e){return e.data}async update(e){return e.data}async delete(e){return {success:true,id:e.id}}async count(e){return 0}async findOne(e){return null}async findVersions(e){return {docs:[],totalDocs:0,limit:10,totalPages:1,page:1,hasNextPage:false,hasPrevPage:false}}async findVersionByID(e){return null}async createVersion(e){return {id:"v1",parentId:e.documentId,version:e.version||1,snapshot:e.snapshot||{},createdAt:new Date().toISOString()}}async updateLatestVersion(e){return {id:"v1",parentId:e.documentId,version:e.version||1,snapshot:e.snapshot||{},createdAt:new Date().toISOString()}}async deleteVersions(e){}};function Ke(s){return new O(s)}g();g();g();g();var Jr={maxAttempts:5,lockDuration:9e5,notifyUser:true,notifyAdmin:true,adminNotifyAfter:3},R=class{redis;prefix;config;constructor(e,t={},r="kyro:lockout:"){this.redis=e,this.prefix=r,this.config={...Jr,...t};}lockKey(e){return `${this.prefix}${e}`}historyKey(e){return `${this.prefix}${e}:history`}async checkLockout(e){let t=this.lockKey(e),r=await this.redis.hgetall(t);if(!r||Object.keys(r).length===0)return {locked:false,attemptsRemaining:this.config.maxAttempts,totalAttempts:0};let o=parseInt(r.attempts,10),n=r.lockedUntil?new Date(parseInt(r.lockedUntil,10)):void 0;return n&&n>new Date?{locked:true,attemptsRemaining:0,lockedUntil:n,totalAttempts:o}:n&&n<=new Date?(await this.unlockAccount(e),{locked:false,attemptsRemaining:this.config.maxAttempts,totalAttempts:0}):{locked:false,attemptsRemaining:Math.max(0,this.config.maxAttempts-o),totalAttempts:o}}async recordFailedAttempt(e){let t=this.lockKey(e),r=this.historyKey(e),o=Date.now(),n=await this.redis.hincrby(t,"attempts",1);if(await this.redis.hset(t,"lastAttempt",o.toString()),await this.redis.lpush(r,o.toString()),await this.redis.ltrim(r,0,99),n>=this.config.maxAttempts){let i=new Date(o+this.config.lockDuration);return await this.redis.hset(t,{lockedAt:o.toString(),lockedUntil:i.getTime().toString()}),await this.redis.expire(t,Math.ceil(this.config.lockDuration/1e3)+3600),{locked:true,attemptsRemaining:0,lockedUntil:i,totalAttempts:n}}return {locked:false,attemptsRemaining:Math.max(0,this.config.maxAttempts-n),totalAttempts:n}}async lockAccount(e,t){let r=this.lockKey(e),o=Date.now(),n=t||this.config.lockDuration,i=new Date(o+n),c=this.redis.pipeline();c.hset(r,{attempts:this.config.maxAttempts.toString(),lockedAt:o.toString(),lockedUntil:i.getTime().toString()}),c.expire(r,Math.ceil(n/1e3)+3600),await c.exec();}async unlockAccount(e){let t=this.lockKey(e);await this.redis.del(t);}async resetAttempts(e){let t=this.lockKey(e);(await this.redis.hgetall(t)).lockedAt?await this.redis.hset(t,{attempts:"0",lockedAt:"",lockedUntil:""}):await this.redis.del(t);}async getLockoutHistory(e,t=10){let r=this.historyKey(e);return (await this.redis.lrange(r,0,t-1)).map(n=>new Date(parseInt(n,10)))}async getLockoutStats(e){let t=this.historyKey(e),r=await this.redis.lrange(t,0,-1),o=r.filter((i,c)=>(c+1)%this.config.maxAttempts===0).length,n=await this.redis.hget(this.lockKey(e),"lockedAt");return {totalFailedAttempts:r.length,lockoutCount:o,lastLockout:n?new Date(parseInt(n,10)):null,averageAttemptsBeforeLockout:o>0?this.config.maxAttempts:0}}shouldNotifyAdmin(e){return this.config.notifyAdmin&&e>=this.config.adminNotifyAfter}getConfig(){return {...this.config}}setConfig(e){this.config={...this.config,...e};}};g();var Xr={"auth:login":{window:9e5,max:5},"auth:register":{window:36e5,max:3},"auth:forgot":{window:36e5,max:3},"auth:reset":{window:36e5,max:5},"auth:verify":{window:36e5,max:5},"api:general":{window:6e4,max:100},"api:authenticated":{window:6e4,max:200}},v=class{redis;prefix;limits;userLimits;constructor(e,t,r,o="kyro:ratelimit:"){this.redis=e,this.prefix=o,this.limits={...Xr,...t},this.userLimits=r||{"user:api":{window:6e4,max:500},"user:write":{window:36e5,max:100}};}getKey(e,t){return `${this.prefix}${e}:${t}`}async check(e,t){let r=this.limits[e]||this.limits["api:general"],o=this.getKey(e,t),n=Date.now(),i=n-r.window,c=this.redis.pipeline();c.zremrangebyscore(o,0,i),c.zcard(o),c.zadd(o,n,`${n}:${Math.random()}`),c.expire(o,Math.ceil(r.window/1e3)+1);let p=(await c.exec())?.[1]?.[1]||0;if(p>=r.max){let g=await this.redis.zrange(o,0,0,"WITHSCORES"),m=g.length>1?parseInt(g[1],10)+r.window:n+r.window;return {allowed:false,remaining:0,resetAt:m,retryAfter:Math.ceil((m-n)/1e3)}}return {allowed:true,remaining:r.max-p-1,resetAt:n+r.window}}async checkUser(e,t,r){let o=this.userLimits[e]||this.userLimits["user:api"],n=this.getKey(`user:${e}:${t}`,r),i=Date.now(),c=i-o.window,l=this.redis.pipeline();l.zremrangebyscore(n,0,c),l.zcard(n),l.zadd(n,i,`${i}:${Math.random()}`),l.expire(n,Math.ceil(o.window/1e3)+1);let g=(await l.exec())?.[1]?.[1]||0;if(g>=o.max){let m=await this.redis.zrange(n,0,0,"WITHSCORES"),f=m.length>1?parseInt(m[1],10)+o.window:i+o.window;return {allowed:false,remaining:0,resetAt:f,retryAfter:Math.ceil((f-i)/1e3)}}return {allowed:true,remaining:o.max-g-1,resetAt:i+o.window}}async reset(e,t){let r=this.getKey(e,t);await this.redis.del(r);}async resetUser(e,t,r){let o=this.getKey(`user:${e}:${t}`,r);await this.redis.del(o);}async getStatus(e,t){let r=this.limits[e]||this.limits["api:general"],o=this.getKey(e,t),n=Date.now(),i=n-r.window;await this.redis.zremrangebyscore(o,0,i);let c=await this.redis.zcard(o);return {count:c,limit:r.max,remaining:Math.max(0,r.max-c),resetAt:n+r.window}}setLimit(e,t){this.limits[e]=t;}setUserLimit(e,t){this.userLimits[e]=t;}};g();g();g();var D=class{users=new Map;sessions=new Map;refreshTokens=new Map;emailToUserId=new Map;passwordHistory=new Map;emailVerificationTokens=new Map;passwordResetTokens=new Map;auditLogs=[];externalDb=false;constructor(){}async connect(){}async disconnect(){this.users.clear(),this.sessions.clear(),this.refreshTokens.clear(),this.emailToUserId.clear(),this.passwordHistory.clear();}async createUser(e){let t=randomBytes(16).toString("hex"),r=new Date().toISOString(),o=await this.hashPassword(e.password),n={id:t,email:e.email.toLowerCase(),passwordHash:o,role:e.role||"customer",tenantId:e.tenantId,createdAt:r,updatedAt:r};return this.users.set(t,n),this.emailToUserId.set(e.email.toLowerCase(),t),this.passwordHistory.set(t,[]),n}async findUserByEmail(e){let t=this.emailToUserId.get(e.toLowerCase());return t?this.findUserById(t):null}async findUserById(e){return this.users.get(e)||null}async updateUser(e,t){let r=await this.findUserById(e);if(!r)return null;let o={...r,...t,id:e,updatedAt:new Date().toISOString()};return t.email&&t.email!==r.email&&(this.emailToUserId.delete(r.email.toLowerCase()),this.emailToUserId.set(t.email.toLowerCase(),e)),this.users.set(e,o),o}async deleteUser(e){let t=await this.findUserById(e);return t?(this.users.delete(e),this.emailToUserId.delete(t.email.toLowerCase()),this.refreshTokens.forEach((r,o)=>{this.sessions.get(r)?.userId===e&&(this.refreshTokens.delete(o),this.sessions.delete(r));}),this.passwordHistory.delete(e),this.sessions.forEach((r,o)=>{r.userId===e&&this.sessions.delete(o);}),true):false}async hashPassword(e){return (await import('./bcryptjs-ZEEHSMAG.js')).default.hash(e,12)}async verifyPassword(e,t){let r=await this.findUserByEmail(e);return !r||!r.passwordHash?null:await(await import('./bcryptjs-ZEEHSMAG.js')).default.compare(t,r.passwordHash)?r:null}async createSession(e,t={}){let r=randomBytes(32).toString("hex"),o=randomBytes(32).toString("base64url"),n=randomBytes(32).toString("base64url"),i=new Date,c={id:r,userId:e,token:o,refreshToken:n,expiresAt:new Date(i.getTime()+86400*1e3).toISOString(),createdAt:i.toISOString(),ipAddress:t.ipAddress,userAgent:t.userAgent};return this.sessions.set(r,c),this.refreshTokens.set(n,r),c}async findSessionByToken(e){return this.sessions.get(e)||null}async findSessionByRefreshToken(e){let t=this.refreshTokens.get(e);return t&&this.sessions.get(t)||null}async deleteSession(e){let t=this.sessions.get(e);return t?(t.refreshToken&&this.refreshTokens.delete(t.refreshToken),this.sessions.delete(e),true):false}async deleteUserSessions(e){let t=0;return this.sessions.forEach((r,o)=>{r.userId===e&&(r.refreshToken&&this.refreshTokens.delete(r.refreshToken),this.sessions.delete(o),t++);}),t}async addPasswordToHistory(e,t){let r=this.passwordHistory.get(e)||[];r.push(t),r.length>5&&r.splice(0,r.length-5),this.passwordHistory.set(e,r);}async getPasswordHistory(e,t=5){return this.passwordHistory.get(e)||[]}async isPasswordInHistory(e,t,r=5){let o=await this.getPasswordHistory(t,r),n=(await import('./bcryptjs-ZEEHSMAG.js')).default;for(let i of o)if(await n.compare(e,i))return true;return false}async createEmailVerificationToken(e){let t=randomBytes(32).toString("hex"),r=new Date(Date.now()+1440*60*1e3);return this.emailVerificationTokens.set(t,{userId:e,expiresAt:r}),{token:t,expiresAt:r}}async verifyEmailToken(e){let t=this.emailVerificationTokens.get(e);return !t||t.expiresAt<new Date?(this.emailVerificationTokens.delete(e),{success:false,error:"Invalid or expired token"}):(this.emailVerificationTokens.delete(e),{success:true,userId:t.userId})}async createPasswordResetToken(e){let t=await this.findUserByEmail(e);if(!t)return {token:"",expiresAt:new Date,error:"User not found"};let r=randomBytes(32).toString("hex"),o=new Date(Date.now()+3600*1e3);return this.passwordResetTokens.set(r,{userId:t.id,expiresAt:o}),{token:r,expiresAt:o}}async resetPasswordWithToken(e,t){let r=this.passwordResetTokens.get(e);if(!r||r.expiresAt<new Date)return this.passwordResetTokens.delete(e),{success:false,error:"Invalid or expired token"};let o=await this.hashPassword(t);return await this.updateUser(r.userId,{passwordHash:o}),this.passwordResetTokens.delete(e),{success:true}}async hasAnyUsers(){return this.users.size>0}async findAuditLogs(e){let{limit:t=50,offset:r=0}=e,o=this.auditLogs.slice().reverse();return e.userId&&(o=o.filter(n=>n.userId===e.userId)),e.action&&(Array.isArray(e.action)?o=o.filter(n=>e.action.includes(String(n.action))):o=o.filter(n=>n.action===e.action)),e.resource&&(o=o.filter(n=>n.resource===e.resource)),e.success!==void 0&&(o=o.filter(n=>n.success===e.success)),{logs:o.slice(r,r+t),total:o.length}}async createAuditLog(e){let t=randomBytes(16).toString("hex"),o={...e,id:t,timestamp:new Date};return this.auditLogs.push(o),o}};g();var I=class{storage=new Map;history=new Map;config;constructor(e={}){this.config={maxAttempts:5,lockDuration:9e5,notifyUser:true,notifyAdmin:true,adminNotifyAfter:3,...e};}async checkLockout(e){let t=Date.now(),r=this.storage.get(e);if(r&&r.lockedUntil!==null&&r.lockedUntil<=t)return await this.resetAttempts(e),{locked:false,attemptsRemaining:this.config.maxAttempts,totalAttempts:0};if(!r)return {locked:false,attemptsRemaining:this.config.maxAttempts,totalAttempts:0};let{attempts:o,lockedUntil:n}=r;return n!==null&&n>t?{locked:true,attemptsRemaining:0,lockedUntil:new Date(n),totalAttempts:o}:{locked:false,attemptsRemaining:Math.max(0,this.config.maxAttempts-o),totalAttempts:o}}async recordFailedAttempt(e){let t=Date.now(),r=this.storage.get(e)||{attempts:0,lastAttempt:null,lockedAt:null,lockedUntil:null};r.attempts+=1,r.lastAttempt=t;let o=this.history.get(e)||[];if(o.push(t),o.length>100&&o.splice(0,o.length-100),this.history.set(e,o),this.storage.set(e,r),r.attempts>=this.config.maxAttempts){let n=new Date(t+this.config.lockDuration);return r.lockedAt=t,r.lockedUntil=n.getTime(),this.storage.set(e,r),{locked:true,attemptsRemaining:0,lockedUntil:n,totalAttempts:r.attempts}}return {locked:false,attemptsRemaining:Math.max(0,this.config.maxAttempts-r.attempts),totalAttempts:r.attempts}}async lockAccount(e,t){let r=Date.now(),o=t||this.config.lockDuration,n=new Date(r+o),i=this.storage.get(e)||{attempts:0,lastAttempt:null,lockedAt:null,lockedUntil:null};i.attempts=this.config.maxAttempts,i.lockedAt=r,i.lockedUntil=n.getTime(),this.storage.set(e,i);}async unlockAccount(e){await this.resetAttempts(e);}async resetAttempts(e){let t=this.storage.get(e);t&&(t.attempts=0,t.lockedAt=null,t.lockedUntil=null,this.storage.set(e,t)),this.history.delete(e);}async getLockoutHistory(e,t=10){return (this.history.get(e)||[]).slice(-t).reverse().map(o=>new Date(o))}async getLockoutStats(e){let r=(this.history.get(e)||[]).length,o=Math.floor(r/this.config.maxAttempts),n=null,i=this.storage.get(e);i&&i.lockedAt!==null&&(n=new Date(i.lockedAt));let c=o>0?this.config.maxAttempts:0;return {totalFailedAttempts:r,lockoutCount:o,lastLockout:n,averageAttemptsBeforeLockout:c}}shouldNotifyAdmin(e){return this.config.notifyAdmin&&e>=this.config.adminNotifyAfter}getConfig(){return {...this.config}}setConfig(e){this.config={...this.config,...e};}};function b(s,e=""){return process.env[s]||e}function P(s,e=false){let t=process.env[s];return t?t.toLowerCase()==="true":e}function y(s,e=0){let t=process.env[s];return t?parseInt(t,10):e}function Be(){let s=process.env.KYRO_AUTH_DATABASE?.toLowerCase();if(s&&["sqlite","postgres","mongodb","memory"].includes(s))return s;try{let e=join(process.cwd(),"kyro.config.ts"),t=readFileSync(e,"utf8");if(t.includes("createLocalAdapter"))return "sqlite";if(t.includes("createDrizzleAdapter"))return t.includes("postgres")||t.includes("postgresql"),"postgres";if(t.includes("createMongoDBAdapter"))return "mongodb"}catch{}return "memory"}async function to(s){let e=process.cwd(),t=e.endsWith("admin")?join(e,".."):e,r=resolve(t,"data","auth.db");switch(s){case "sqlite":return new a$2({path:b("KYRO_AUTH_DB_PATH",r)});case "postgres":{let o=b("DATABASE_URL","");if(o){let n,i;try{n=(await import('./postgres-js-WE3NBRFO.js')).drizzle,i=await import('./src-QBADSZV4.js');}catch{a(["postgres","drizzle-orm"]),n=(await import('./postgres-js-WE3NBRFO.js')).drizzle,i=await import('./src-QBADSZV4.js');}let c=i.default(o,{onnotice:()=>{}}),l=n(c);return new a$3({db:l})}return new a$2({path:b("KYRO_AUTH_DB_PATH",r)})}case "mongodb":{let o=b("MONGODB_URI","");if(o){let n;try{let g=await import('./lib-XXYYUPMW.js');n=g.MongoClient??g.default?.MongoClient;}catch{a(["mongodb"]);let m=await import('./lib-XXYYUPMW.js');n=m.MongoClient??m.default?.MongoClient;}let i=new n(o);await i.connect();let l=new URL(o).pathname.replace(/^\//,"")||"kyro_cms",p=i.db(l);return new a$1({db:p})}return new a$2({path:b("KYRO_AUTH_DB_PATH",r)})}default:return new D}}async function G(s,e){let t=P("KYRO_DISTRIBUTED",false),r$1;if(t){let{RedisAuthAdapter:m}=await import('./redis-adapter-QPCTMF55.js'),f=b("REDIS_URL","redis://localhost:6379"),w=P("REDIS_TLS",false),h=new m({url:f,tls:w});await h.connect?.(),r$1=h;}else {let m=s||Be();r$1=await to(m),r$1.connect&&await r$1.connect();}let o=e?await q.fromConfig(e).catch(()=>null)||q.fromEnv()||void 0:q.fromEnv()||void 0,n=new r({minLength:y("PASSWORD_MIN_LENGTH",12),requireUppercase:P("PASSWORD_REQUIRE_UPPERCASE",true),requireLowercase:P("PASSWORD_REQUIRE_LOWERCASE",true),requireNumbers:P("PASSWORD_REQUIRE_NUMBERS",true),requireSpecialChars:P("PASSWORD_REQUIRE_SPECIAL",true),preventReuse:y("PASSWORD_PREVENT_REUSE",5),maxLength:y("PASSWORD_MAX_LENGTH",128)}),i,c,l;if(t){let f=r$1.redis;i=new R(f,{maxAttempts:y("LOCKOUT_MAX_ATTEMPTS",5),lockDuration:y("LOCKOUT_DURATION_MINUTES",15)*60*1e3}),c=new v(f,{"auth:login":{window:y("RATE_LIMIT_AUTH_WINDOW_MS",9e5),max:y("RATE_LIMIT_AUTH_MAX_REQUESTS",10)},"api:general":{window:y("RATE_LIMIT_WINDOW_MS",6e4),max:y("RATE_LIMIT_MAX_REQUESTS",100)}}),l=new bb(f,y("AUDIT_LOG_RETENTION_DAYS",30));}else i=new I({maxAttempts:y("LOCKOUT_MAX_ATTEMPTS",5),lockDuration:y("LOCKOUT_DURATION_MINUTES",15)*60*1e3}),c=new ab({"auth:login":{window:y("RATE_LIMIT_AUTH_WINDOW_MS",9e5),max:y("RATE_LIMIT_AUTH_MAX_REQUESTS",10)},"api:general":{window:y("RATE_LIMIT_WINDOW_MS",6e4),max:y("RATE_LIMIT_MAX_REQUESTS",100)}}),l=P("AUDIT_LOG_ENABLED",true)?new db(y("AUDIT_LOG_RETENTION_DAYS",30)):void 0;let p=new eb({redis:r$1,email:o,jwtSecret:b("APP_SECRET","change-me"),jwtExpiresIn:b("JWT_EXPIRES_IN","24h"),jwtIssuer:b("JWT_ISSUER","kyro-cms"),jwtAudience:b("JWT_AUDIENCE","kyro-cms-client"),passwordPolicy:n,lockout:i,rateLimiter:c,auditLogger:l,baseUrl:b("EMAIL_BASE_URL","http://localhost:4321"),emailVerificationRequired:P("EMAIL_VERIFICATION_REQUIRED",true)}),g=t?"distributed":s||Be();return {authAdapter:r$1,databaseType:g,email:o,passwordPolicy:n,lockout:i,rateLimiter:c,auditLogger:l,routes:p}}var $e=G().catch(s=>(console.warn("[AuthConfig] Failed to initialize auth config:",s.message),null));var ro=12,oo="24h",so="7d",B=class{adapter;config;constructor(e,t){this.adapter=e,this.config={secret:t.secret,expiresIn:t.expiresIn??oo,refreshExpiresIn:t.refreshExpiresIn??so,issuer:t.issuer??"kyro-cms",audience:t.audience??[],saltRounds:t.saltRounds??ro};}async register(e){try{if(await this.adapter.findUserByEmail(e.email))return {success:!1,error:"Email already registered"};let r=await this.adapter.createUser({email:e.email,password:e.password,role:e.role??"customer",tenantId:e.tenantId});return this.createSessionForUser(r)}catch(t){return {success:false,error:String(t)}}}async login(e){try{let t=await this.adapter.verifyPassword(e.email,e.password);return t?this.createSessionForUser(t):{success:!1,error:"Invalid credentials"}}catch(t){return {success:false,error:String(t)}}}async logout(e){await this.adapter.deleteSession(e);}async refreshToken(e){try{let t=await this.adapter.findSessionByToken(e);if(!t||new Date(t.expiresAt)<new Date)return {success:!1,error:"Invalid or expired refresh token"};let r=await this.adapter.findUserById(t.userId);return r?(await this.adapter.deleteSession(e),this.createSessionForUser(r)):{success:!1,error:"User not found"}}catch(t){return {success:false,error:String(t)}}}async verifyToken(e){try{let{default:t}=await import('./jsonwebtoken-OD67R5JS.js');return t.verify(e,this.config.secret,{issuer:this.config.issuer,audience:this.config.audience.length>0?this.config.audience[0]:void 0})}catch{return null}}async getUserFromToken(e){let t=await this.verifyToken(e);return t?this.adapter.findUserById(t.sub):null}async changePassword(e,t,r){try{let o=await this.adapter.findUserById(e);return o?await this.adapter.verifyPassword(o.email,t)?(await this.adapter.updateUser(e,{password:r}),await this.adapter.deleteUserSessions(e),{success:!0,user:o}):{success:!1,error:"Current password is incorrect"}:{success:!1,error:"User not found"}}catch(o){return {success:false,error:String(o)}}}async resetPassword(e,t){try{let r=await this.adapter.findUserByEmail(e);return r?(await this.adapter.updateUser(r.id,{password:t}),await this.adapter.deleteUserSessions(r.id),{success:!0,user:r}):{success:!1,error:"User not found"}}catch(r){return {success:false,error:String(r)}}}async sendEmailVerification(e){try{let{token:t,expiresAt:r}=await this.adapter.createEmailVerificationToken(e);return {success:!0}}catch(t){return {success:false,error:String(t)}}}async verifyEmail(e){try{return await this.adapter.verifyEmailToken(e)}catch(t){return {success:false,error:String(t)}}}async requestPasswordReset(e){try{let t=await this.adapter.createPasswordResetToken(e);return t.error?{success:!1,error:t.error}:{success:!0}}catch(t){return {success:false,error:String(t)}}}async resetPasswordWithToken(e,t){try{return await this.adapter.resetPasswordWithToken(e,t)}catch(r){return {success:false,error:String(r)}}}async deleteAccount(e){try{return await this.adapter.findUserById(e)?(await this.adapter.deleteUserSessions(e),await this.adapter.deleteUser(e),{success:!0}):{success:!1,error:"User not found"}}catch(t){return {success:false,error:String(t)}}}async createSessionForUser(e){let t=await this.generateToken(e),r=await this.adapter.createSession(e.id);return {success:true,user:e,session:r,token:t}}async generateToken(e){let{default:t}=await import('./jsonwebtoken-OD67R5JS.js'),r={sub:e.id,email:e.email,role:e.role,tenantId:e.tenantId},o={expiresIn:this.parseExpiresIn(this.config.expiresIn)/1e3,issuer:this.config.issuer};return this.config.audience.length>0&&(o.audience=this.config.audience[0]),t.sign(r,this.config.secret,o)}async hashPassword(e){let{default:t}=await import('./bcryptjs-ZEEHSMAG.js');return t.hash(e,this.config.saltRounds)}parseExpiresIn(e){if(typeof e=="number")return e;let t=e.match(/^(\d+)([smhd])$/);if(!t)return 864e5;let r=parseInt(t[1],10);switch(t[2]){case "s":return r*1e3;case "m":return r*6e4;case "h":return r*36e5;case "d":return r*864e5;default:return 864e5}}};function no(s,e){return new B(s,e)}g();g();function N(){return {enabled:true,draftsEnabled:true,publishEnabled:true,scheduleEnabled:false,versioningEnabled:true,maxVersionsPerDocument:50,autoPublish:false,requirePublishPermission:true}}var $=class{adapter;config;constructor(e,t){this.adapter=e,this.config={...N(),...t};}async createVersion(e){let r=((await this.adapter.getLatestVersion(e.collection,e.documentId))?.version??0)+1,o={...e,version:r},n=await this.adapter.createVersion(o);return this.config.maxVersionsPerDocument>0&&await this.pruneOldVersions(e.collection,e.documentId),n}async publishVersion(e){let t=await this.adapter.getVersion(e.collection,e.versionId);if(!t)throw new Error("Version not found");if(t.status==="published")throw new Error("Version is already published");await this.adapter.publishVersion(e);}async unpublishDocument(e,t){let r=await this.adapter.getVersions({collection:e,documentId:t,limit:1e3});for(let o of r)if(o.status==="published"){await this.createVersion({collection:e,documentId:t,data:o.data,status:"draft",createdBy:"system",changeDescription:"Unpublished document"});break}}async revertToVersion(e,t,r,o){if(!await this.adapter.getVersion(e,r))throw new Error("Version not found");return await this.adapter.revertToVersion({collection:e,documentId:t,versionId:r,userId:o})}async getVersionHistory(e,t,r=20,o=0){return this.adapter.getVersions({collection:e,documentId:t,limit:r,offset:o})}async compareTwoVersions(e,t,r,o){return this.adapter.compareVersions({collection:e,documentId:t,versionA:r,versionB:o})}async getLatestDraft(e,t){return this.adapter.getLatestVersion(e,t)}async getPublishedVersion(e,t){return this.adapter.getPublishedVersion(e,t)}async getVersion(e,t){return this.adapter.getVersion(e,t)}async schedulePublish(e,t,r,o){if(!this.config.scheduleEnabled)throw new Error("Scheduled publishing is not enabled");if(!await this.adapter.getVersion(e,r))throw new Error("Version not found")}async deleteVersionHistory(e,t){await this.adapter.deleteVersions(e,t);}async pruneOldVersions(e,t){let r=await this.adapter.getVersions({collection:e,documentId:t,limit:this.config.maxVersionsPerDocument+100});if(r.length<=this.config.maxVersionsPerDocument)return;r.slice(0,this.config.maxVersionsPerDocument);let n=r.slice(this.config.maxVersionsPerDocument);for(let i of n)if(i.status!=="published"){await this.adapter.deleteVersions(e,t);break}}};function io(s,e){return new $(s,e)}function ao(s){return s==="published"}function co(s){return s==="draft"}function lo(s){return s==="archived"}g();function uo(s){return s?Array.isArray(s)?s:Object.values(s):[]}function po(s){return s?Array.isArray(s)?s:Object.values(s):[]}function ze(s){return {collections:uo(s.collections),globals:po(s.globals),adapter:s.adapter,storage:s.storage,plugins:s.plugins,auth:s.auth,cors:s.cors,admin:s.admin,upload:s.upload,graphQL:s.graphQL,typescript:s.typescript,localization:s.localization,rateLimit:s.rateLimit,debug:s.debug}}var go=ze;g();function mo(s){let{siteSettings:e,seoSettings:t,title:r,description:o,image:n,url:i}=s;if(!e)return "";let c=e.siteName||"",l=r||t?.defaultTitle||c,p=t?.titleTemplate,g=t?.separator||" | ",m=t?.siteNameInTitle!==false,f=p?p.replace(/\{\{title\}\}/g,l).replace(/\{\{siteName\}\}/g,m?c:"").replace(/\{\{separator\}\}/g,g).replace(/\s+/g," ").trim():l,w=o||t?.defaultDescription||e.siteDescription||"",h=n||e.siteOgImage?.url||"",V=i||e.siteUrl||"",A=`
1
+ export{a as LocalAdapter,b as createLocalAdapter}from'./chunk-JCEJ4VTN.js';export{a as RedisAuthAdapter}from'./chunk-M75VGFCI.js';import {a as a$5}from'./chunk-RPRGGGIW.js';export{k as allGlobalSettings,q as blogCollections,l as coreGlobalSettings,V as createTemplateConfig,r as ecommerceCollections,s as ecommerceGlobals,t as kitchenSinkCollections,v as mediaCollections,a as minimalCollections,U as templateCollections}from'./chunk-VTOL3URF.js';export{q as ALL_FIELD_TYPES,n as COMPLEX_FIELD_TYPES,p as LAYOUT_FIELD_TYPES,m as PRIMITIVE_FIELD_TYPES,o as RELATIONAL_FIELD_TYPES,d as isArrayField,f as isBlocksField,e as isGroupField,h as isImageField,k as isLayoutField,b as isNumberField,c as isRelationshipField,i as isRichTextField,j as isSelectField,a as isTextField,g as isUploadField,t as normalizeRichTextValue,u as renderRichText,s as richTextStyles}from'./chunk-ZRIBWDYJ.js';export{a as kyro}from'./chunk-XDPLVJRO.js';import {f}from'./chunk-2HATK4C5.js';export{t as AnalyticsPlugin,u as CommentsPlugin,a as ConfigValidationError,y as FIELD_DEFINITION_KEYS,G as Kyro,q as KyroPlugin,J as Logger,r as PluginManager,m as Registry,v as ReviewsPlugin,s as SEOPlugin,w as WishlistPlugin,C as applyBlocksOverrides,E as applyCollectionOverrides,F as applyGlobalOverrides,D as applyTabsOverrides,i as collectionToCreateZod,j as collectionToUpdateZod,k as collectionToWhereZod,h as collectionToZod,H as createKyro,I as createKyroHandler,p as createRegistry,g as fieldToZod,A as flattenFieldOverrides,n as getRegistry,l as globalToZod,z as isFieldOverrideDefinition,K as logger,x as presetPlugins,o as resetRegistry,B as updateFieldByPath,b as validateCollection,e as validateConfig,d as validateFields,c as validateGlobal,f as z}from'./chunk-2HATK4C5.js';export{e as autoBootstrap,a as bootstrapAdmin,f as bootstrapWithRetry,d as getBootstrapFromEnv}from'./chunk-CHYVUWZ3.js';import'./chunk-LWM4WABU.js';import'./chunk-D6SDGHY6.js';export{a as createContext,g as createCountProcedure,d as createCreateProcedure,f as createDeleteProcedure,h as createDynamicRouter,c as createFindByIDProcedure,b as createFindProcedure,i as createKyroServer,e as createUpdateProcedure}from'./chunk-4ZWLNGLS.js';export{J as buildGraphQLSchema,K as createGraphQLSchema}from'./chunk-X473JI7Z.js';import {bb,ab,db,eb}from'./chunk-26KFM3P6.js';export{bb as AuditLogger,db as InMemoryAuditLogger,ab as InMemoryRateLimiter,gb as MediaService,cb as createAuditContext,ib as createKyroApp,_a as createLocalStorage,jb as createRESTAPI,fb as isEdgeRuntime,Za as resolveProvider}from'./chunk-26KFM3P6.js';import {q,r}from'./chunk-PFKVHUOT.js';export{p as ConfigService,q as EmailTransport,r as PasswordPolicy,o as getEmailTemplates,n as renderAbandonedCart,g as renderAccountLocked,a as renderBaseLayout,f as renderMagicLink,i as renderNewLogin,j as renderOrderConfirmation,l as renderOrderDelivered,m as renderOrderRefunded,k as renderOrderShipped,e as renderPasswordChanged,c as renderResetPassword,h as renderUserInvite,b as renderVerifyEmail,d as renderWelcome}from'./chunk-PFKVHUOT.js';import {a as a$2}from'./chunk-N6MNQIQU.js';export{a as SQLiteAuthAdapter}from'./chunk-N6MNQIQU.js';import'./chunk-OLRCZ6E3.js';import {f as f$1}from'./chunk-6TPICJ2L.js';export{c as getAppSecret,d as getEncryptionKey,e as getSessionConfig,b as loadSecrets,a as setDbAdapter}from'./chunk-6TPICJ2L.js';import'./chunk-YENNL5HG.js';import'./chunk-W45TLOOT.js';import'./chunk-IKGVPXMK.js';import'./chunk-YUUXFD73.js';import'./chunk-LVBHOZZF.js';import'./chunk-OBYAIJVU.js';import'./chunk-JRUQ5ABB.js';import'./chunk-CIVA6SKW.js';import'./chunk-WPM6LFCY.js';import'./chunk-U6KFONKM.js';import'./chunk-TYQYKKWJ.js';export{d as ALL_WEBHOOK_EVENTS,e as WEBHOOK_COLLECTION,f as WEBHOOK_DELIVERY_COLLECTION,c as WEBHOOK_EVENTS,m as WebhookService,k as buildDeliveryRecord,l as createTestPayload,n as createWebhookService,i as deliverWebhook,j as deliverWithRetry,h as generateWebhookSecret,g as signPayload}from'./chunk-AWQGDMOE.js';export{h as evaluateAccess,j as getWhereClause,i as mergeWhereClauses}from'./chunk-GQGFNTDZ.js';export{b as KyroPubSub,c as KyroWSServer,a as PubSub,d as createWSServer}from'./chunk-5M3FKE2V.js';import'./chunk-7MNDQU6K.js';export{c as DrizzleAdapter,b as collectionToDrizzleSchema,d as createDrizzleAdapter,a as fieldToDrizzleType}from'./chunk-FUFS65Q5.js';import'./chunk-JV4HJBXW.js';export{b as createDatabase,c as runMigrations,d as seedDefaultRoles}from'./chunk-ZAKYTBEN.js';import {a as a$3}from'./chunk-ZWDBPEXL.js';export{a as PostgresAuthAdapter}from'./chunk-ZWDBPEXL.js';import'./chunk-3TAUNYEM.js';import'./chunk-N5POANYV.js';import'./chunk-2HA6EKXX.js';import'./chunk-47CXBWMA.js';import'./chunk-FLMUMPDE.js';import'./chunk-EML5FDUU.js';import'./chunk-HRAY65XH.js';import'./chunk-3NSZZCOJ.js';export{a as MongoDBAdapter,b as createMongoDBAdapter}from'./chunk-4YCI3HBD.js';import {a as a$1}from'./chunk-5ZEYOFAK.js';export{a as MongoDBAuthAdapter}from'./chunk-5ZEYOFAK.js';import {a as a$4}from'./chunk-SLMIYECU.js';export{a as AbstractBaseAdapter}from'./chunk-SLMIYECU.js';import {a}from'./chunk-P6JITOFF.js';import'./chunk-7NH7H3WA.js';import'./chunk-VVVCCB6R.js';import'./chunk-TBHNE4VV.js';import {g}from'./chunk-Y2YAKDEQ.js';import re,{randomBytes}from'crypto';import {readFileSync}from'fs';import tt,{join,resolve}from'path';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
2
+ g();g();g();g();async function Be(o,e){let t=e.data;for(let r of o){let s=await r({...e,data:t});s!==void 0&&(t=s);}return t}async function zr(o,e){return Be(o,e)}g();g();var E=class extends a$4{connectionString;constructor(e){super(),this.connectionString=e.connectionString;}async connect(){this.connected=true;}async disconnect(){this.connected=false;}async query(e,t=[]){if(!this.connectionString)throw new Error("NeonAdapter: Connection string is required.");try{let r=await fetch(`${this.connectionString}/sql`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,params:t})});return r.ok?(await r.json()).rows||[]:[]}catch{return []}}async find(e){return {docs:[],totalDocs:0,limit:e.limit||10,totalPages:1,page:e.page||1,hasNextPage:false,hasPrevPage:false}}async findByID(e){return null}async create(e){return e.data}async update(e){return e.data}async delete(e){return {success:true,id:e.id}}async count(e){return 0}async findOne(e){return null}async findVersions(e){return {docs:[],totalDocs:0,limit:10,totalPages:1,page:1,hasNextPage:false,hasPrevPage:false}}async findVersionByID(e){return null}async createVersion(e){return {id:"v1",parentId:e.documentId,version:e.version||1,snapshot:e.snapshot||{},createdAt:new Date().toISOString()}}async updateLatestVersion(e){return {id:"v1",parentId:e.documentId,version:e.version||1,snapshot:e.snapshot||{},createdAt:new Date().toISOString()}}async deleteVersions(e){}};function Ke(o){return new E(o)}g();var O=class extends a$4{url;authToken;constructor(e){super(),this.url=e.url.replace(/^libsql:\/\//,"https://"),this.authToken=e.authToken;}async connect(){this.connected=true;}async disconnect(){this.connected=false;}async query(e,t=[]){if(!this.url)throw new Error("TursoAdapter: Database URL is required.");try{let r={"Content-Type":"application/json"};this.authToken&&(r.Authorization=`Bearer ${this.authToken}`);let s=await fetch(`${this.url}/v2/pipeline`,{method:"POST",headers:r,body:JSON.stringify({requests:[{type:"execute",stmt:{sql:e,args:t.map(l=>({type:"text",value:String(l)}))}},{type:"close"}]})});if(!s.ok)return [];let i=(await s.json())?.results?.[0]?.response?.result;if(!i||!i.rows)return [];let c=i.cols.map(l=>l.name);return i.rows.map(l=>{let p={};return c.forEach((g,m)=>{p[g]=l[m]?.value??null;}),p})}catch{return []}}async find(e){return {docs:[],totalDocs:0,limit:e.limit||10,totalPages:1,page:e.page||1,hasNextPage:false,hasPrevPage:false}}async findByID(e){return null}async create(e){return e.data}async update(e){return e.data}async delete(e){return {success:true,id:e.id}}async count(e){return 0}async findOne(e){return null}async findVersions(e){return {docs:[],totalDocs:0,limit:10,totalPages:1,page:1,hasNextPage:false,hasPrevPage:false}}async findVersionByID(e){return null}async createVersion(e){return {id:"v1",parentId:e.documentId,version:e.version||1,snapshot:e.snapshot||{},createdAt:new Date().toISOString()}}async updateLatestVersion(e){return {id:"v1",parentId:e.documentId,version:e.version||1,snapshot:e.snapshot||{},createdAt:new Date().toISOString()}}async deleteVersions(e){}};function Ne(o){return new O(o)}g();g();g();var Q=class{constructor(e){this.config=e;}config;css=[];addRule(e,t){let r=Object.entries(t).map(([s,n])=>` ${s}: ${n};`).join(`
3
+ `);return this.css.push(`${e} {
4
+ ${r}
5
+ }`),this}addMediaQuery(e,t){return this.css.push(`@media (min-width: ${e}) {
6
+ ${t.join(`
7
+ `)}
8
+ }`),this}generate(){return this.css.join(`
9
+
10
+ `)}};function Wr(o){return {theme:{extend:{colors:o.colors||{},fontFamily:o.fonts||{},spacing:o.spacing||{},borderRadius:o.borderRadius||{},boxShadow:o.shadows||{},screens:o.breakpoints||{}}}}}var U={colors:{primary:"#3b82f6",secondary:"#6366f1",accent:"#ec4899",background:"#ffffff",surface:"#f9fafb",text:"#111827",textMuted:"#6b7280",border:"#e5e7eb",error:"#ef4444",warning:"#f59e0b",success:"#10b981",info:"#3b82f6"},fonts:{sans:"system-ui, -apple-system, sans-serif",serif:"Georgia, serif",mono:"Menlo, monospace"},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem","2xl":"3rem","3xl":"4rem"},borderRadius:{sm:"0.125rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem",full:"9999px"},shadows:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1)"}},qr={colors:{primary:"#60a5fa",secondary:"#818cf8",accent:"#f472b6",background:"#111827",surface:"#1f2937",text:"#f9fafb",textMuted:"#9ca3af",border:"#374151",error:"#f87171",warning:"#fbbf24",success:"#34d399",info:"#60a5fa"},fonts:U.fonts,spacing:U.spacing,borderRadius:U.borderRadius,shadows:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.3)",md:"0 4px 6px -1px rgb(0 0 0 / 0.4)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.5)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.6)"}},Gr={colors:{primary:"#FF6B35",secondary:"#1A1A2E",accent:"#16C79A",background:"#FFFFFF",surface:"#F8F9FA",text:"#1A1A2E",textMuted:"#6B7280",border:"#E5E7EB",error:"#EF4444",warning:"#F59E0B",success:"#16C79A",info:"#3B82F6"},fonts:{sans:'"Inter", "Satoshi", system-ui, sans-serif',serif:'"Playfair Display", Georgia, serif',mono:'"JetBrains Mono", monospace'},spacing:{xs:"0.125rem",sm:"0.25rem",md:"0.5rem",lg:"1rem",xl:"1.5rem","2xl":"2rem","3xl":"3rem","4xl":"4rem"},borderRadius:{sm:"0",md:"0",lg:"0",xl:"0",full:"9999px"},shadows:{sm:"0 1px 2px rgba(0,0,0,0.05)",md:"0 4px 6px rgba(0,0,0,0.07)",lg:"0 10px 15px rgba(0,0,0,0.1)",xl:"0 20px 25px rgba(0,0,0,0.15)"}};function $e(o){let e=[];if(o.colors)for(let[t,r]of Object.entries(o.colors))e.push(` --color-${t}: ${r};`);if(o.fonts)for(let[t,r]of Object.entries(o.fonts))e.push(` --font-${t}: ${r};`);if(o.spacing)for(let[t,r]of Object.entries(o.spacing))e.push(` --spacing-${t}: ${r};`);if(o.borderRadius)for(let[t,r]of Object.entries(o.borderRadius))e.push(` --radius-${t}: ${r};`);if(o.shadows)for(let[t,r]of Object.entries(o.shadows))e.push(` --shadow-${t}: ${r};`);return `:root {
11
+ ${e.join(`
12
+ `)}
13
+ }`}function Qr(o){let e=$e(o.theme||U),t=[];if(o.componentOverrides)for(let[r,s]of Object.entries(o.componentOverrides)){let n=Object.entries(s).map(([i,c])=>` ${i}: ${c};`).join(`
14
+ `);t.push(`${r} {
15
+ ${n}
16
+ }`);}return `
17
+ ${e}
18
+ ${o.customStyles||""}
19
+ ${t.join(`
20
+ `)}
21
+ `}var Yr={text:{wrapper:{marginBottom:"var(--spacing-md)"},label:{display:"block",marginBottom:"var(--spacing-xs)",fontWeight:"500",color:"var(--color-text)"},input:{width:"100%",padding:"var(--spacing-sm) var(--spacing-md)",border:"1px solid var(--color-border)",borderRadius:"var(--radius-md)",fontSize:"0.875rem"},error:{color:"var(--color-error)",fontSize:"0.75rem",marginTop:"var(--spacing-xs)"}},number:{wrapper:{marginBottom:"var(--spacing-md)"},label:{display:"block",marginBottom:"var(--spacing-xs)",fontWeight:"500"},input:{width:"100%",padding:"var(--spacing-sm) var(--spacing-md)",border:"1px solid var(--color-border)",borderRadius:"var(--radius-md)"}},checkbox:{wrapper:{display:"flex",alignItems:"center",gap:"var(--spacing-sm)"},input:{width:"1rem",height:"1rem"},label:{cursor:"pointer"}},select:{wrapper:{marginBottom:"var(--spacing-md)"},input:{width:"100%",padding:"var(--spacing-sm) var(--spacing-md)",border:"1px solid var(--color-border)",borderRadius:"var(--radius-md)",backgroundColor:"white"}}};g();g();var Jr={maxAttempts:5,lockDuration:9e5,notifyUser:true,notifyAdmin:true,adminNotifyAfter:3},R=class{redis;prefix;config;constructor(e,t={},r="kyro:lockout:"){this.redis=e,this.prefix=r,this.config={...Jr,...t};}lockKey(e){return `${this.prefix}${e}`}historyKey(e){return `${this.prefix}${e}:history`}async checkLockout(e){let t=this.lockKey(e),r=await this.redis.hgetall(t);if(!r||Object.keys(r).length===0)return {locked:false,attemptsRemaining:this.config.maxAttempts,totalAttempts:0};let s=parseInt(r.attempts,10),n=r.lockedUntil?new Date(parseInt(r.lockedUntil,10)):void 0;return n&&n>new Date?{locked:true,attemptsRemaining:0,lockedUntil:n,totalAttempts:s}:n&&n<=new Date?(await this.unlockAccount(e),{locked:false,attemptsRemaining:this.config.maxAttempts,totalAttempts:0}):{locked:false,attemptsRemaining:Math.max(0,this.config.maxAttempts-s),totalAttempts:s}}async recordFailedAttempt(e){let t=this.lockKey(e),r=this.historyKey(e),s=Date.now(),n=await this.redis.hincrby(t,"attempts",1);if(await this.redis.hset(t,"lastAttempt",s.toString()),await this.redis.lpush(r,s.toString()),await this.redis.ltrim(r,0,99),n>=this.config.maxAttempts){let i=new Date(s+this.config.lockDuration);return await this.redis.hset(t,{lockedAt:s.toString(),lockedUntil:i.getTime().toString()}),await this.redis.expire(t,Math.ceil(this.config.lockDuration/1e3)+3600),{locked:true,attemptsRemaining:0,lockedUntil:i,totalAttempts:n}}return {locked:false,attemptsRemaining:Math.max(0,this.config.maxAttempts-n),totalAttempts:n}}async lockAccount(e,t){let r=this.lockKey(e),s=Date.now(),n=t||this.config.lockDuration,i=new Date(s+n),c=this.redis.pipeline();c.hset(r,{attempts:this.config.maxAttempts.toString(),lockedAt:s.toString(),lockedUntil:i.getTime().toString()}),c.expire(r,Math.ceil(n/1e3)+3600),await c.exec();}async unlockAccount(e){let t=this.lockKey(e);await this.redis.del(t);}async resetAttempts(e){let t=this.lockKey(e);(await this.redis.hgetall(t)).lockedAt?await this.redis.hset(t,{attempts:"0",lockedAt:"",lockedUntil:""}):await this.redis.del(t);}async getLockoutHistory(e,t=10){let r=this.historyKey(e);return (await this.redis.lrange(r,0,t-1)).map(n=>new Date(parseInt(n,10)))}async getLockoutStats(e){let t=this.historyKey(e),r=await this.redis.lrange(t,0,-1),s=r.filter((i,c)=>(c+1)%this.config.maxAttempts===0).length,n=await this.redis.hget(this.lockKey(e),"lockedAt");return {totalFailedAttempts:r.length,lockoutCount:s,lastLockout:n?new Date(parseInt(n,10)):null,averageAttemptsBeforeLockout:s>0?this.config.maxAttempts:0}}shouldNotifyAdmin(e){return this.config.notifyAdmin&&e>=this.config.adminNotifyAfter}getConfig(){return {...this.config}}setConfig(e){this.config={...this.config,...e};}};g();var Xr={"auth:login":{window:9e5,max:5},"auth:register":{window:36e5,max:3},"auth:forgot":{window:36e5,max:3},"auth:reset":{window:36e5,max:5},"auth:verify":{window:36e5,max:5},"api:general":{window:6e4,max:100},"api:authenticated":{window:6e4,max:200}},C=class{redis;prefix;limits;userLimits;constructor(e,t,r,s="kyro:ratelimit:"){this.redis=e,this.prefix=s,this.limits={...Xr,...t},this.userLimits=r||{"user:api":{window:6e4,max:500},"user:write":{window:36e5,max:100}};}getKey(e,t){return `${this.prefix}${e}:${t}`}async check(e,t){let r=this.limits[e]||this.limits["api:general"],s=this.getKey(e,t),n=Date.now(),i=n-r.window,c=this.redis.pipeline();c.zremrangebyscore(s,0,i),c.zcard(s),c.zadd(s,n,`${n}:${Math.random()}`),c.expire(s,Math.ceil(r.window/1e3)+1);let p=(await c.exec())?.[1]?.[1]||0;if(p>=r.max){let g=await this.redis.zrange(s,0,0,"WITHSCORES"),m=g.length>1?parseInt(g[1],10)+r.window:n+r.window;return {allowed:false,remaining:0,resetAt:m,retryAfter:Math.ceil((m-n)/1e3)}}return {allowed:true,remaining:r.max-p-1,resetAt:n+r.window}}async checkUser(e,t,r){let s=this.userLimits[e]||this.userLimits["user:api"],n=this.getKey(`user:${e}:${t}`,r),i=Date.now(),c=i-s.window,l=this.redis.pipeline();l.zremrangebyscore(n,0,c),l.zcard(n),l.zadd(n,i,`${i}:${Math.random()}`),l.expire(n,Math.ceil(s.window/1e3)+1);let g=(await l.exec())?.[1]?.[1]||0;if(g>=s.max){let m=await this.redis.zrange(n,0,0,"WITHSCORES"),f=m.length>1?parseInt(m[1],10)+s.window:i+s.window;return {allowed:false,remaining:0,resetAt:f,retryAfter:Math.ceil((f-i)/1e3)}}return {allowed:true,remaining:s.max-g-1,resetAt:i+s.window}}async reset(e,t){let r=this.getKey(e,t);await this.redis.del(r);}async resetUser(e,t,r){let s=this.getKey(`user:${e}:${t}`,r);await this.redis.del(s);}async getStatus(e,t){let r=this.limits[e]||this.limits["api:general"],s=this.getKey(e,t),n=Date.now(),i=n-r.window;await this.redis.zremrangebyscore(s,0,i);let c=await this.redis.zcard(s);return {count:c,limit:r.max,remaining:Math.max(0,r.max-c),resetAt:n+r.window}}setLimit(e,t){this.limits[e]=t;}setUserLimit(e,t){this.userLimits[e]=t;}};g();g();g();var D=class{users=new Map;sessions=new Map;refreshTokens=new Map;emailToUserId=new Map;passwordHistory=new Map;emailVerificationTokens=new Map;passwordResetTokens=new Map;auditLogs=[];externalDb=false;constructor(){}async connect(){}async disconnect(){this.users.clear(),this.sessions.clear(),this.refreshTokens.clear(),this.emailToUserId.clear(),this.passwordHistory.clear();}async createUser(e){let t=randomBytes(16).toString("hex"),r=new Date().toISOString(),s=await this.hashPassword(e.password),n={id:t,email:e.email.toLowerCase(),passwordHash:s,role:e.role||"customer",tenantId:e.tenantId,createdAt:r,updatedAt:r};return this.users.set(t,n),this.emailToUserId.set(e.email.toLowerCase(),t),this.passwordHistory.set(t,[]),n}async findUserByEmail(e){let t=this.emailToUserId.get(e.toLowerCase());return t?this.findUserById(t):null}async findUserById(e){return this.users.get(e)||null}async updateUser(e,t){let r=await this.findUserById(e);if(!r)return null;let s={...r,...t,id:e,updatedAt:new Date().toISOString()};return t.email&&t.email!==r.email&&(this.emailToUserId.delete(r.email.toLowerCase()),this.emailToUserId.set(t.email.toLowerCase(),e)),this.users.set(e,s),s}async deleteUser(e){let t=await this.findUserById(e);return t?(this.users.delete(e),this.emailToUserId.delete(t.email.toLowerCase()),this.refreshTokens.forEach((r,s)=>{this.sessions.get(r)?.userId===e&&(this.refreshTokens.delete(s),this.sessions.delete(r));}),this.passwordHistory.delete(e),this.sessions.forEach((r,s)=>{r.userId===e&&this.sessions.delete(s);}),true):false}async hashPassword(e){return (await import('./bcryptjs-ZEEHSMAG.js')).default.hash(e,12)}async verifyPassword(e,t){let r=await this.findUserByEmail(e);return !r||!r.passwordHash?null:await(await import('./bcryptjs-ZEEHSMAG.js')).default.compare(t,r.passwordHash)?r:null}async createSession(e,t={}){let r=randomBytes(32).toString("hex"),s=randomBytes(32).toString("base64url"),n=randomBytes(32).toString("base64url"),i=new Date,c={id:r,userId:e,token:s,refreshToken:n,expiresAt:new Date(i.getTime()+86400*1e3).toISOString(),createdAt:i.toISOString(),ipAddress:t.ipAddress,userAgent:t.userAgent};return this.sessions.set(r,c),this.refreshTokens.set(n,r),c}async findSessionByToken(e){return this.sessions.get(e)||null}async findSessionByRefreshToken(e){let t=this.refreshTokens.get(e);return t&&this.sessions.get(t)||null}async deleteSession(e){let t=this.sessions.get(e);return t?(t.refreshToken&&this.refreshTokens.delete(t.refreshToken),this.sessions.delete(e),true):false}async deleteUserSessions(e){let t=0;return this.sessions.forEach((r,s)=>{r.userId===e&&(r.refreshToken&&this.refreshTokens.delete(r.refreshToken),this.sessions.delete(s),t++);}),t}async addPasswordToHistory(e,t){let r=this.passwordHistory.get(e)||[];r.push(t),r.length>5&&r.splice(0,r.length-5),this.passwordHistory.set(e,r);}async getPasswordHistory(e,t=5){return this.passwordHistory.get(e)||[]}async isPasswordInHistory(e,t,r=5){let s=await this.getPasswordHistory(t,r),n=(await import('./bcryptjs-ZEEHSMAG.js')).default;for(let i of s)if(await n.compare(e,i))return true;return false}async createEmailVerificationToken(e){let t=randomBytes(32).toString("hex"),r=new Date(Date.now()+1440*60*1e3);return this.emailVerificationTokens.set(t,{userId:e,expiresAt:r}),{token:t,expiresAt:r}}async verifyEmailToken(e){let t=this.emailVerificationTokens.get(e);return !t||t.expiresAt<new Date?(this.emailVerificationTokens.delete(e),{success:false,error:"Invalid or expired token"}):(this.emailVerificationTokens.delete(e),{success:true,userId:t.userId})}async createPasswordResetToken(e){let t=await this.findUserByEmail(e);if(!t)return {token:"",expiresAt:new Date,error:"User not found"};let r=randomBytes(32).toString("hex"),s=new Date(Date.now()+3600*1e3);return this.passwordResetTokens.set(r,{userId:t.id,expiresAt:s}),{token:r,expiresAt:s}}async resetPasswordWithToken(e,t){let r=this.passwordResetTokens.get(e);if(!r||r.expiresAt<new Date)return this.passwordResetTokens.delete(e),{success:false,error:"Invalid or expired token"};let s=await this.hashPassword(t);return await this.updateUser(r.userId,{passwordHash:s}),this.passwordResetTokens.delete(e),{success:true}}async hasAnyUsers(){return this.users.size>0}async findAuditLogs(e){let{limit:t=50,offset:r=0}=e,s=this.auditLogs.slice().reverse();return e.userId&&(s=s.filter(n=>n.userId===e.userId)),e.action&&(Array.isArray(e.action)?s=s.filter(n=>e.action.includes(String(n.action))):s=s.filter(n=>n.action===e.action)),e.resource&&(s=s.filter(n=>n.resource===e.resource)),e.success!==void 0&&(s=s.filter(n=>n.success===e.success)),{logs:s.slice(r,r+t),total:s.length}}async createAuditLog(e){let t=randomBytes(16).toString("hex"),s={...e,id:t,timestamp:new Date};return this.auditLogs.push(s),s}};g();var I=class{storage=new Map;history=new Map;config;constructor(e={}){this.config={maxAttempts:5,lockDuration:9e5,notifyUser:true,notifyAdmin:true,adminNotifyAfter:3,...e};}async checkLockout(e){let t=Date.now(),r=this.storage.get(e);if(r&&r.lockedUntil!==null&&r.lockedUntil<=t)return await this.resetAttempts(e),{locked:false,attemptsRemaining:this.config.maxAttempts,totalAttempts:0};if(!r)return {locked:false,attemptsRemaining:this.config.maxAttempts,totalAttempts:0};let{attempts:s,lockedUntil:n}=r;return n!==null&&n>t?{locked:true,attemptsRemaining:0,lockedUntil:new Date(n),totalAttempts:s}:{locked:false,attemptsRemaining:Math.max(0,this.config.maxAttempts-s),totalAttempts:s}}async recordFailedAttempt(e){let t=Date.now(),r=this.storage.get(e)||{attempts:0,lastAttempt:null,lockedAt:null,lockedUntil:null};r.attempts+=1,r.lastAttempt=t;let s=this.history.get(e)||[];if(s.push(t),s.length>100&&s.splice(0,s.length-100),this.history.set(e,s),this.storage.set(e,r),r.attempts>=this.config.maxAttempts){let n=new Date(t+this.config.lockDuration);return r.lockedAt=t,r.lockedUntil=n.getTime(),this.storage.set(e,r),{locked:true,attemptsRemaining:0,lockedUntil:n,totalAttempts:r.attempts}}return {locked:false,attemptsRemaining:Math.max(0,this.config.maxAttempts-r.attempts),totalAttempts:r.attempts}}async lockAccount(e,t){let r=Date.now(),s=t||this.config.lockDuration,n=new Date(r+s),i=this.storage.get(e)||{attempts:0,lastAttempt:null,lockedAt:null,lockedUntil:null};i.attempts=this.config.maxAttempts,i.lockedAt=r,i.lockedUntil=n.getTime(),this.storage.set(e,i);}async unlockAccount(e){await this.resetAttempts(e);}async resetAttempts(e){let t=this.storage.get(e);t&&(t.attempts=0,t.lockedAt=null,t.lockedUntil=null,this.storage.set(e,t)),this.history.delete(e);}async getLockoutHistory(e,t=10){return (this.history.get(e)||[]).slice(-t).reverse().map(s=>new Date(s))}async getLockoutStats(e){let r=(this.history.get(e)||[]).length,s=Math.floor(r/this.config.maxAttempts),n=null,i=this.storage.get(e);i&&i.lockedAt!==null&&(n=new Date(i.lockedAt));let c=s>0?this.config.maxAttempts:0;return {totalFailedAttempts:r,lockoutCount:s,lastLockout:n,averageAttemptsBeforeLockout:c}}shouldNotifyAdmin(e){return this.config.notifyAdmin&&e>=this.config.adminNotifyAfter}getConfig(){return {...this.config}}setConfig(e){this.config={...this.config,...e};}};function w(o,e=""){return process.env[o]||e}function S(o,e=false){let t=process.env[o];return t?t.toLowerCase()==="true":e}function y(o,e=0){let t=process.env[o];return t?parseInt(t,10):e}function je(){let o=process.env.KYRO_AUTH_DATABASE?.toLowerCase();if(o&&["sqlite","postgres","mongodb","memory"].includes(o))return o;try{let e=join(process.cwd(),"kyro.config.ts"),t=readFileSync(e,"utf8");if(t.includes("createLocalAdapter"))return "sqlite";if(t.includes("createDrizzleAdapter"))return t.includes("postgres")||t.includes("postgresql"),"postgres";if(t.includes("createMongoDBAdapter"))return "mongodb"}catch{}return "memory"}async function to(o){let e=process.cwd(),t=e.endsWith("admin")?join(e,".."):e,r=resolve(t,"data","auth.db");switch(o){case "sqlite":return new a$2({path:w("KYRO_AUTH_DB_PATH",r)});case "postgres":{let s=w("DATABASE_URL","");if(s){let n,i;try{n=(await import('./postgres-js-JLFIWOBH.js')).drizzle,i=await import('./src-QBADSZV4.js');}catch{a(["postgres","drizzle-orm"]),n=(await import('./postgres-js-JLFIWOBH.js')).drizzle,i=await import('./src-QBADSZV4.js');}let c=i.default(s,{onnotice:()=>{}}),l=n(c);return new a$3({db:l})}return new a$2({path:w("KYRO_AUTH_DB_PATH",r)})}case "mongodb":{let s=w("MONGODB_URI","");if(s){let n;try{let g=await import('./lib-XXYYUPMW.js');n=g.MongoClient??g.default?.MongoClient;}catch{a(["mongodb"]);let m=await import('./lib-XXYYUPMW.js');n=m.MongoClient??m.default?.MongoClient;}let i=new n(s);await i.connect();let l=new URL(s).pathname.replace(/^\//,"")||"kyro_cms",p=i.db(l);return new a$1({db:p})}return new a$2({path:w("KYRO_AUTH_DB_PATH",r)})}default:return new D}}async function Y(o,e){let t=S("KYRO_DISTRIBUTED",false),r$1;if(t){let{RedisAuthAdapter:m}=await import('./redis-adapter-QPCTMF55.js'),f=w("REDIS_URL","redis://localhost:6379"),b=S("REDIS_TLS",false),h=new m({url:f,tls:b});await h.connect?.(),r$1=h;}else {let m=o||je();r$1=await to(m),r$1.connect&&await r$1.connect();}let s=e?await q.fromConfig(e).catch(()=>null)||q.fromEnv()||void 0:q.fromEnv()||void 0,n=new r({minLength:y("PASSWORD_MIN_LENGTH",12),requireUppercase:S("PASSWORD_REQUIRE_UPPERCASE",true),requireLowercase:S("PASSWORD_REQUIRE_LOWERCASE",true),requireNumbers:S("PASSWORD_REQUIRE_NUMBERS",true),requireSpecialChars:S("PASSWORD_REQUIRE_SPECIAL",true),preventReuse:y("PASSWORD_PREVENT_REUSE",5),maxLength:y("PASSWORD_MAX_LENGTH",128)}),i,c,l;if(t){let f=r$1.redis;i=new R(f,{maxAttempts:y("LOCKOUT_MAX_ATTEMPTS",5),lockDuration:y("LOCKOUT_DURATION_MINUTES",15)*60*1e3}),c=new C(f,{"auth:login":{window:y("RATE_LIMIT_AUTH_WINDOW_MS",9e5),max:y("RATE_LIMIT_AUTH_MAX_REQUESTS",10)},"api:general":{window:y("RATE_LIMIT_WINDOW_MS",6e4),max:y("RATE_LIMIT_MAX_REQUESTS",100)}}),l=new bb(f,y("AUDIT_LOG_RETENTION_DAYS",30));}else i=new I({maxAttempts:y("LOCKOUT_MAX_ATTEMPTS",5),lockDuration:y("LOCKOUT_DURATION_MINUTES",15)*60*1e3}),c=new ab({"auth:login":{window:y("RATE_LIMIT_AUTH_WINDOW_MS",9e5),max:y("RATE_LIMIT_AUTH_MAX_REQUESTS",10)},"api:general":{window:y("RATE_LIMIT_WINDOW_MS",6e4),max:y("RATE_LIMIT_MAX_REQUESTS",100)}}),l=S("AUDIT_LOG_ENABLED",true)?new db(y("AUDIT_LOG_RETENTION_DAYS",30)):void 0;let p=new eb({redis:r$1,email:s,jwtSecret:w("APP_SECRET","change-me"),jwtExpiresIn:w("JWT_EXPIRES_IN","24h"),jwtIssuer:w("JWT_ISSUER","kyro-cms"),jwtAudience:w("JWT_AUDIENCE","kyro-cms-client"),passwordPolicy:n,lockout:i,rateLimiter:c,auditLogger:l,baseUrl:w("EMAIL_BASE_URL","http://localhost:4321"),emailVerificationRequired:S("EMAIL_VERIFICATION_REQUIRED",true)}),g=t?"distributed":o||je();return {authAdapter:r$1,databaseType:g,email:s,passwordPolicy:n,lockout:i,rateLimiter:c,auditLogger:l,routes:p}}var We=Y().catch(o=>(console.warn("[AuthConfig] Failed to initialize auth config:",o.message),null));var ro=12,oo="24h",so="7d",N=class{adapter;config;constructor(e,t){this.adapter=e,this.config={secret:t.secret,expiresIn:t.expiresIn??oo,refreshExpiresIn:t.refreshExpiresIn??so,issuer:t.issuer??"kyro-cms",audience:t.audience??[],saltRounds:t.saltRounds??ro};}async register(e){try{if(await this.adapter.findUserByEmail(e.email))return {success:!1,error:"Email already registered"};let r=await this.adapter.createUser({email:e.email,password:e.password,role:e.role??"customer",tenantId:e.tenantId});return this.createSessionForUser(r)}catch(t){return {success:false,error:String(t)}}}async login(e){try{let t=await this.adapter.verifyPassword(e.email,e.password);return t?this.createSessionForUser(t):{success:!1,error:"Invalid credentials"}}catch(t){return {success:false,error:String(t)}}}async logout(e){await this.adapter.deleteSession(e);}async refreshToken(e){try{let t=await this.adapter.findSessionByToken(e);if(!t||new Date(t.expiresAt)<new Date)return {success:!1,error:"Invalid or expired refresh token"};let r=await this.adapter.findUserById(t.userId);return r?(await this.adapter.deleteSession(e),this.createSessionForUser(r)):{success:!1,error:"User not found"}}catch(t){return {success:false,error:String(t)}}}async verifyToken(e){try{let{default:t}=await import('./jsonwebtoken-OD67R5JS.js');return t.verify(e,this.config.secret,{issuer:this.config.issuer,audience:this.config.audience.length>0?this.config.audience[0]:void 0})}catch{return null}}async getUserFromToken(e){let t=await this.verifyToken(e);return t?this.adapter.findUserById(t.sub):null}async changePassword(e,t,r){try{let s=await this.adapter.findUserById(e);return s?await this.adapter.verifyPassword(s.email,t)?(await this.adapter.updateUser(e,{password:r}),await this.adapter.deleteUserSessions(e),{success:!0,user:s}):{success:!1,error:"Current password is incorrect"}:{success:!1,error:"User not found"}}catch(s){return {success:false,error:String(s)}}}async resetPassword(e,t){try{let r=await this.adapter.findUserByEmail(e);return r?(await this.adapter.updateUser(r.id,{password:t}),await this.adapter.deleteUserSessions(r.id),{success:!0,user:r}):{success:!1,error:"User not found"}}catch(r){return {success:false,error:String(r)}}}async sendEmailVerification(e){try{let{token:t,expiresAt:r}=await this.adapter.createEmailVerificationToken(e);return {success:!0}}catch(t){return {success:false,error:String(t)}}}async verifyEmail(e){try{return await this.adapter.verifyEmailToken(e)}catch(t){return {success:false,error:String(t)}}}async requestPasswordReset(e){try{let t=await this.adapter.createPasswordResetToken(e);return t.error?{success:!1,error:t.error}:{success:!0}}catch(t){return {success:false,error:String(t)}}}async resetPasswordWithToken(e,t){try{return await this.adapter.resetPasswordWithToken(e,t)}catch(r){return {success:false,error:String(r)}}}async deleteAccount(e){try{return await this.adapter.findUserById(e)?(await this.adapter.deleteUserSessions(e),await this.adapter.deleteUser(e),{success:!0}):{success:!1,error:"User not found"}}catch(t){return {success:false,error:String(t)}}}async createSessionForUser(e){let t=await this.generateToken(e),r=await this.adapter.createSession(e.id);return {success:true,user:e,session:r,token:t}}async generateToken(e){let{default:t}=await import('./jsonwebtoken-OD67R5JS.js'),r={sub:e.id,email:e.email,role:e.role,tenantId:e.tenantId},s={expiresIn:this.parseExpiresIn(this.config.expiresIn)/1e3,issuer:this.config.issuer};return this.config.audience.length>0&&(s.audience=this.config.audience[0]),t.sign(r,this.config.secret,s)}async hashPassword(e){let{default:t}=await import('./bcryptjs-ZEEHSMAG.js');return t.hash(e,this.config.saltRounds)}parseExpiresIn(e){if(typeof e=="number")return e;let t=e.match(/^(\d+)([smhd])$/);if(!t)return 864e5;let r=parseInt(t[1],10);switch(t[2]){case "s":return r*1e3;case "m":return r*6e4;case "h":return r*36e5;case "d":return r*864e5;default:return 864e5}}};function no(o,e){return new N(o,e)}g();g();function $(){return {enabled:true,draftsEnabled:true,publishEnabled:true,scheduleEnabled:false,versioningEnabled:true,maxVersionsPerDocument:50,autoPublish:false,requirePublishPermission:true}}var j=class{adapter;config;constructor(e,t){this.adapter=e,this.config={...$(),...t};}async createVersion(e){let r=((await this.adapter.getLatestVersion(e.collection,e.documentId))?.version??0)+1,s={...e,version:r},n=await this.adapter.createVersion(s);return this.config.maxVersionsPerDocument>0&&await this.pruneOldVersions(e.collection,e.documentId),n}async publishVersion(e){let t=await this.adapter.getVersion(e.collection,e.versionId);if(!t)throw new Error("Version not found");if(t.status==="published")throw new Error("Version is already published");await this.adapter.publishVersion(e);}async unpublishDocument(e,t){let r=await this.adapter.getVersions({collection:e,documentId:t,limit:1e3});for(let s of r)if(s.status==="published"){await this.createVersion({collection:e,documentId:t,data:s.data,status:"draft",createdBy:"system",changeDescription:"Unpublished document"});break}}async revertToVersion(e,t,r,s){if(!await this.adapter.getVersion(e,r))throw new Error("Version not found");return await this.adapter.revertToVersion({collection:e,documentId:t,versionId:r,userId:s})}async getVersionHistory(e,t,r=20,s=0){return this.adapter.getVersions({collection:e,documentId:t,limit:r,offset:s})}async compareTwoVersions(e,t,r,s){return this.adapter.compareVersions({collection:e,documentId:t,versionA:r,versionB:s})}async getLatestDraft(e,t){return this.adapter.getLatestVersion(e,t)}async getPublishedVersion(e,t){return this.adapter.getPublishedVersion(e,t)}async getVersion(e,t){return this.adapter.getVersion(e,t)}async schedulePublish(e,t,r,s){if(!this.config.scheduleEnabled)throw new Error("Scheduled publishing is not enabled");if(!await this.adapter.getVersion(e,r))throw new Error("Version not found")}async deleteVersionHistory(e,t){await this.adapter.deleteVersions(e,t);}async pruneOldVersions(e,t){let r=await this.adapter.getVersions({collection:e,documentId:t,limit:this.config.maxVersionsPerDocument+100});if(r.length<=this.config.maxVersionsPerDocument)return;r.slice(0,this.config.maxVersionsPerDocument);let n=r.slice(this.config.maxVersionsPerDocument);for(let i of n)if(i.status!=="published"){await this.adapter.deleteVersions(e,t);break}}};function io(o,e){return new j(o,e)}function ao(o){return o==="published"}function co(o){return o==="draft"}function lo(o){return o==="archived"}g();function uo(o){return o?Array.isArray(o)?o:Object.values(o):[]}function po(o){return o?Array.isArray(o)?o:Object.values(o):[]}function qe(o){return {collections:uo(o.collections),globals:po(o.globals),adapter:o.adapter,storage:o.storage,plugins:o.plugins,auth:o.auth,cors:o.cors,admin:o.admin,upload:o.upload,graphQL:o.graphQL,typescript:o.typescript,localization:o.localization,rateLimit:o.rateLimit,debug:o.debug}}var go=qe;g();function mo(o){let{siteSettings:e,seoSettings:t,title:r,description:s,image:n,url:i}=o;if(!e)return "";let c=e.siteName||"",l=r||t?.defaultTitle||c,p=t?.titleTemplate,g=t?.separator||" | ",m=t?.siteNameInTitle!==false,f=p?p.replace(/\{\{title\}\}/g,l).replace(/\{\{siteName\}\}/g,m?c:"").replace(/\{\{separator\}\}/g,g).replace(/\s+/g," ").trim():l,b=s||t?.defaultDescription||e.siteDescription||"",h=n||e.siteOgImage?.url||"",M=i||e.siteUrl||"",A=`
3
22
  <title>${f}</title>
4
- <meta name="description" content="${w}">
23
+ <meta name="description" content="${b}">
5
24
  `;e.siteFavicon?.url&&(A+=`
6
- <link rel="icon" type="${e.siteFavicon.mimeType||"image/x-icon"}" href="${e.siteFavicon.url}">`);let oe=t?.meta?.robots;oe&&(A+=`
7
- <meta name="robots" content="${oe}">`);let se=t?.meta?.canonicalUrl||V;se&&(A+=`
8
- <link rel="canonical" href="${se}">`);let et=t?.meta?.ogType||"website";A+=`
9
- <meta property="og:type" content="${et}">
25
+ <link rel="icon" type="${e.siteFavicon.mimeType||"image/x-icon"}" href="${e.siteFavicon.url}">`);let ne=t?.meta?.robots;ne&&(A+=`
26
+ <meta name="robots" content="${ne}">`);let ie=t?.meta?.canonicalUrl||M;ie&&(A+=`
27
+ <link rel="canonical" href="${ie}">`);let ot=t?.meta?.ogType||"website";A+=`
28
+ <meta property="og:type" content="${ot}">
10
29
  <meta property="og:title" content="${f}">
11
- <meta property="og:description" content="${w}">
30
+ <meta property="og:description" content="${b}">
12
31
  <meta property="og:site_name" content="${c}">
13
- `,V&&(A+=`
14
- <meta property="og:url" content="${V}">`),h&&(A+=`
32
+ `,M&&(A+=`
33
+ <meta property="og:url" content="${M}">`),h&&(A+=`
15
34
  <meta property="og:image" content="${h}">`),t?.social?.fbAppId&&(A+=`
16
- <meta property="fb:app_id" content="${t.social.fbAppId}">`);let tt=t?.social?.twitterCardType||"summary_large_image";return A+=`
17
- <meta name="twitter:card" content="${tt}">
35
+ <meta property="fb:app_id" content="${t.social.fbAppId}">`);let st=t?.social?.twitterCardType||"summary_large_image";return A+=`
36
+ <meta name="twitter:card" content="${st}">
18
37
  <meta name="twitter:title" content="${f}">
19
- <meta name="twitter:description" content="${w}">
38
+ <meta name="twitter:description" content="${b}">
20
39
  `,t?.social?.twitterHandle&&(A+=`
21
40
  <meta name="twitter:site" content="${t.social.twitterHandle}">`),h&&(A+=`
22
41
  <meta name="twitter:image" content="${h}">`),e.enableI18n&&e.i18n?.language&&(A+=`
23
- <meta http-equiv="content-language" content="${e.i18n.language}">`),A}function fo(s){if(!s||!s.analyticsEnabled||!s.analytics)return "";let{googleAnalyticsId:e,googleTagManagerId:t,plausibleDomain:r}=s.analytics,o="";return e&&(o+=`
42
+ <meta http-equiv="content-language" content="${e.i18n.language}">`),A}function fo(o){if(!o||!o.analyticsEnabled||!o.analytics)return "";let{googleAnalyticsId:e,googleTagManagerId:t,plausibleDomain:r}=o.analytics,s="";return e&&(s+=`
24
43
  <!-- Google Analytics -->
25
44
  <script async src="https://www.googletagmanager.com/gtag/js?id=${e}"></script>
26
45
  <script>
@@ -29,7 +48,7 @@ g();g();g();g();async function He(s,e){let t=e.data;for(let r of s){let o=await
29
48
  gtag('js', new Date());
30
49
  gtag('config', '${e}');
31
50
  </script>
32
- `),t&&(o+=`
51
+ `),t&&(s+=`
33
52
  <!-- Google Tag Manager -->
34
53
  <script>
35
54
  (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
@@ -38,14 +57,14 @@ g();g();g();g();async function He(s,e){let t=e.data;for(let r of s){let o=await
38
57
  'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
39
58
  })(window,document,'script','dataLayer','${t}');
40
59
  </script>
41
- `),r&&(o+=`
60
+ `),r&&(s+=`
42
61
  <!-- Plausible Analytics -->
43
62
  <script defer data-domain="${r}" src="https://plausible.io/js/script.js"></script>
44
- `),o}g();var yo={facebook:{label:"Facebook"},twitter:{label:"Twitter / X"},instagram:{label:"Instagram"},linkedin:{label:"LinkedIn"},youtube:{label:"YouTube"},tiktok:{label:"TikTok"},pinterest:{label:"Pinterest"},discord:{label:"Discord"},twitch:{label:"Twitch"},github:{label:"GitHub"},mastodon:{label:"Mastodon"}},ho=["facebook","twitter","instagram","linkedin","youtube","tiktok","pinterest","discord","twitch","github","mastodon"];function je(s){if(!s)return [];let e=s.showAll===true,t=[];for(let r of ho){let o=s[r];if(!o||["tiktok","pinterest","discord","twitch","github","mastodon"].includes(r)&&!e)continue;let i=yo[r];t.push({platform:r,url:o,label:i?.label||r});}return t}async function Ao(s,e){try{let t=await s.findOne({collection:"_globals_social-settings",where:{},draft:e?.draft??!1});return je(t)}catch{return []}}g();function We(s){return s?{storeName:s.storeName,storeEmail:s.storeEmail,storePhone:s.storePhone,address:s.address,currency:s.currency,tax:s.tax,shipping:s.shipping,orders:s.orders}:{}}async function wo(s,e){try{let t=await s.findOne({collection:"_globals_store-settings",where:{},draft:e?.draft??!1});return We(t)}catch{return {}}}g();function qe(s){return s?{testMode:s.testMode,provider:s.provider,stripe:s.stripe,paypal:s.paypal,square:s.square,methods:s.methods,bankTransfer:s.bankTransfer}:{}}async function bo(s,e){try{let t=await s.findOne({collection:"_globals_payment-settings",where:{},draft:e?.draft??!1});return qe(t)}catch{return {}}}g();g();g();g();g();function T(s){return new Promise((e,t)=>{s.oncomplete=s.onsuccess=()=>e(s.result),s.onabort=s.onerror=()=>t(s.error);})}function Y(s,e){let t,r=()=>{if(t)return t;let o=indexedDB.open(s);return o.onupgradeneeded=()=>o.result.createObjectStore(e),t=T(o),t.then(n=>{n.onclose=()=>t=void 0;},()=>{t=void 0;}),t};return (o,n)=>r().then(i=>n(i.transaction(e,o).objectStore(e)))}var Q;function U(){return Q||(Q=Y("keyval-store","keyval")),Q}function z(s,e=U()){return e("readonly",t=>T(t.get(s)))}function J(s,e,t=U()){return t("readwrite",r=>(r.put(e,s),T(r.transaction)))}function Ge(s,e=U()){return e("readwrite",t=>(t.delete(s),T(t.transaction)))}function Qe(s=U()){return s("readwrite",e=>(e.clear(),T(e.transaction)))}function So(s,e){return s.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue());},T(s.transaction)}function Ye(s=U()){return s("readonly",e=>{if(e.getAllKeys)return T(e.getAllKeys());let t=[];return So(e,r=>t.push(r.key)).then(()=>t)})}var Po="idb-keyval",Je=(s={})=>{let e=s.base&&s.base.length>0?`${s.base}:`:"",t=o=>e+o,r;return s.dbName&&s.storeName&&(r=Y(s.dbName,s.storeName)),{name:Po,options:s,async hasItem(o){return await z(t(o),r)!==void 0},async getItem(o){return await z(t(o),r)??null},async getItemRaw(o){return await z(t(o),r)??null},setItem(o,n){return J(t(o),n,r)},setItemRaw(o,n){return J(t(o),n,r)},removeItem(o){return Ge(t(o),r)},getKeys(){return Ye(r)},clear(){return Qe(r)}}};async function X(s={}){let{namespace:e="kyro",ttl:t}=s,r=f$1({driver:Je({dbName:"kyro-cms",storeName:e})}),o=e?`${e}:`:"";return {storage:{getItem:async i=>{let c=`${o}${i}`,l=await r.getItem(c);if(l==null)return null;try{let p=JSON.parse(l);return p.expiry&&Date.now()>p.expiry?(await r.removeItem(c),null):p.value}catch{return l}},setItem:async(i,c)=>{let l=`${o}${i}`,p=JSON.stringify(t?{value:c,expiry:Date.now()+t}:{value:c});await r.setItem(l,p);},removeItem:async i=>{await r.removeItem(`${o}${i}`);}},cleanup:async()=>{await r.dispose?.();}}}g();g();function Z(s){let e=s||process.env.APP_SECRET||process.env.AUTH_SECRET||"development-secret-key";return ee.createHash("sha256").update(e).digest("hex")}function To(s,e){let t=ee.randomBytes(16),r=ee.createCipheriv("aes-256-gcm",Buffer.from(e,"hex").subarray(0,32),t),o=r.update(s,"utf8","hex");o+=r.final("hex");let n=r.getAuthTag().toString("hex");return `${t.toString("hex")}:${n}:${o}`}function ko(s,e){let[t,r,o]=s.split(":"),n=Buffer.from(t,"hex"),i=Buffer.from(r,"hex"),c=ee.createDecipheriv("aes-256-gcm",Buffer.from(e,"hex").subarray(0,32),n);c.setAuthTag(i);let l=c.update(o,"hex","utf8");return l+=c.final("utf8"),l}async function te(s={}){let{namespace:e="kyro",ttl:t,encryption:r=true,secret:o,basePath:n}=s,i=n?Xe.join(n,".astro","kyro.json"):Xe.join(process.cwd(),".astro","kyro.json"),c=f$1({driver:a$5({base:i})}),l=r?Z(o):null,p=e?`${e}:`:"";return {storage:{getItem:async g=>{let m=`${p}${g}`,f=await c.getItem(m);if(f==null)return null;try{let w=l?ko(f,l):f,h=JSON.parse(w);return h.expiry&&Date.now()>h.expiry?(await c.removeItem(m),null):h.value}catch{return f}},setItem:async(g,m)=>{let f=`${p}${g}`,w=JSON.stringify(t?{value:m,expiry:Date.now()+t}:{value:m});await c.setItem(f,l?To(w,l):w);},removeItem:async g=>{await c.removeItem(`${p}${g}`);}},cleanup:async()=>{await c.dispose?.();}}}async function re(s){let{environment:e,adapter:t,connectionString:r,encryption:o}=s,n=process.env.APP_SECRET||process.env.AUTH_SECRET,i={enabled:o?.enabled??true,algorithm:o?.algorithm};return e==="browser"?X({namespace:"kyro"}):te({namespace:"kyro",encryption:i.enabled,secret:n})}async function Ze(s){let e={...s,encryption:{enabled:true,algorithm:s.encryption?.algorithm}};return re(e)}g();function Co(s){return {name:"kyro-loader",load:async e=>{let{store:t,logger:r,parseData:o}=e;r.info(`Loading Kyro CMS collection: "${s.collection}"`);try{let n=[];t.clear();for(let i of n){let c=String(i.id||i._id),l=await o({id:c,data:i});t.set({id:c,data:l,digest:JSON.stringify(l)});}r.info(`Successfully synced ${n.length} entries for "${s.collection}" into Astro store.`);}catch(n){r.error(`Failed to load Kyro collection "${s.collection}": ${n.message}`);}},schema:f.object({id:f.string(),createdAt:f.string().optional(),updatedAt:f.string().optional()}).passthrough()}}g();function Ro(s){return {input:s.schema||f.object({}).passthrough(),handler:async(t,r)=>{try{return {success:!0,collection:s.collection,action:s.action,data:t,timestamp:new Date().toISOString()}}catch(o){return {success:false,error:o.message||"CMS Action Execution Failed"}}}}}g();function vo(s={}){let e=s.protectedRoutes||[],t=s.loginPath||"/admin/login",r=s.cookieName||"kyro_session";return async(o,n)=>{let{request:i,cookies:c,redirect:l,locals:p}=o,g=new URL(i.url),m=c?.get?.(r)?.value||i.headers.get("authorization")?.replace("Bearer ",""),f=null;return m&&(f={id:"user_1",email:"admin@kyro-cms.com",role:"admin"}),p.kyroUser=f,e.some(h=>new RegExp("^"+h.replace(/\*/g,".*")+"$").test(g.pathname))&&!f?l(`${t}?redirect=${encodeURIComponent(g.pathname)}`):n()}}g();function Do(s){let e=s?.collections||[],t=`// Auto-generated by Kyro CMS
63
+ `),s}g();var yo={facebook:{label:"Facebook"},twitter:{label:"Twitter / X"},instagram:{label:"Instagram"},linkedin:{label:"LinkedIn"},youtube:{label:"YouTube"},tiktok:{label:"TikTok"},pinterest:{label:"Pinterest"},discord:{label:"Discord"},twitch:{label:"Twitch"},github:{label:"GitHub"},mastodon:{label:"Mastodon"}},ho=["facebook","twitter","instagram","linkedin","youtube","tiktok","pinterest","discord","twitch","github","mastodon"];function Ge(o){if(!o)return [];let e=o.showAll===true,t=[];for(let r of ho){let s=o[r];if(!s||["tiktok","pinterest","discord","twitch","github","mastodon"].includes(r)&&!e)continue;let i=yo[r];t.push({platform:r,url:s,label:i?.label||r});}return t}async function Ao(o,e){try{let t=await o.findOne({collection:"_globals_social-settings",where:{},draft:e?.draft??!1});return Ge(t)}catch{return []}}g();function Qe(o){return o?{storeName:o.storeName,storeEmail:o.storeEmail,storePhone:o.storePhone,address:o.address,currency:o.currency,tax:o.tax,shipping:o.shipping,orders:o.orders}:{}}async function bo(o,e){try{let t=await o.findOne({collection:"_globals_store-settings",where:{},draft:e?.draft??!1});return Qe(t)}catch{return {}}}g();function Ye(o){return o?{testMode:o.testMode,provider:o.provider,stripe:o.stripe,paypal:o.paypal,square:o.square,methods:o.methods,bankTransfer:o.bankTransfer}:{}}async function wo(o,e){try{let t=await o.findOne({collection:"_globals_payment-settings",where:{},draft:e?.draft??!1});return Ye(t)}catch{return {}}}g();g();g();g();g();function k(o){return new Promise((e,t)=>{o.oncomplete=o.onsuccess=()=>e(o.result),o.onabort=o.onerror=()=>t(o.error);})}function X(o,e){let t,r=()=>{if(t)return t;let s=indexedDB.open(o);return s.onupgradeneeded=()=>s.result.createObjectStore(e),t=k(s),t.then(n=>{n.onclose=()=>t=void 0;},()=>{t=void 0;}),t};return (s,n)=>r().then(i=>n(i.transaction(e,s).objectStore(e)))}var J;function V(){return J||(J=X("keyval-store","keyval")),J}function z(o,e=V()){return e("readonly",t=>k(t.get(o)))}function Z(o,e,t=V()){return t("readwrite",r=>(r.put(e,o),k(r.transaction)))}function Je(o,e=V()){return e("readwrite",t=>(t.delete(o),k(t.transaction)))}function Xe(o=V()){return o("readwrite",e=>(e.clear(),k(e.transaction)))}function xo(o,e){return o.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue());},k(o.transaction)}function Ze(o=V()){return o("readonly",e=>{if(e.getAllKeys)return k(e.getAllKeys());let t=[];return xo(e,r=>t.push(r.key)).then(()=>t)})}var So="idb-keyval",et=(o={})=>{let e=o.base&&o.base.length>0?`${o.base}:`:"",t=s=>e+s,r;return o.dbName&&o.storeName&&(r=X(o.dbName,o.storeName)),{name:So,options:o,async hasItem(s){return await z(t(s),r)!==void 0},async getItem(s){return await z(t(s),r)??null},async getItemRaw(s){return await z(t(s),r)??null},setItem(s,n){return Z(t(s),n,r)},setItemRaw(s,n){return Z(t(s),n,r)},removeItem(s){return Je(t(s),r)},getKeys(){return Ze(r)},clear(){return Xe(r)}}};async function ee(o={}){let{namespace:e="kyro",ttl:t}=o,r=f$1({driver:et({dbName:"kyro-cms",storeName:e})}),s=e?`${e}:`:"";return {storage:{getItem:async i=>{let c=`${s}${i}`,l=await r.getItem(c);if(l==null)return null;try{let p=JSON.parse(l);return p.expiry&&Date.now()>p.expiry?(await r.removeItem(c),null):p.value}catch{return l}},setItem:async(i,c)=>{let l=`${s}${i}`,p=JSON.stringify(t?{value:c,expiry:Date.now()+t}:{value:c});await r.setItem(l,p);},removeItem:async i=>{await r.removeItem(`${s}${i}`);}},cleanup:async()=>{await r.dispose?.();}}}g();g();function te(o){let e=o||process.env.APP_SECRET||process.env.AUTH_SECRET||"development-secret-key";return re.createHash("sha256").update(e).digest("hex")}function ko(o,e){let t=re.randomBytes(16),r=re.createCipheriv("aes-256-gcm",Buffer.from(e,"hex").subarray(0,32),t),s=r.update(o,"utf8","hex");s+=r.final("hex");let n=r.getAuthTag().toString("hex");return `${t.toString("hex")}:${n}:${s}`}function Po(o,e){let[t,r,s]=o.split(":"),n=Buffer.from(t,"hex"),i=Buffer.from(r,"hex"),c=re.createDecipheriv("aes-256-gcm",Buffer.from(e,"hex").subarray(0,32),n);c.setAuthTag(i);let l=c.update(s,"hex","utf8");return l+=c.final("utf8"),l}async function oe(o={}){let{namespace:e="kyro",ttl:t,encryption:r=true,secret:s,basePath:n}=o,i=n?tt.join(n,".astro","kyro.json"):tt.join(process.cwd(),".astro","kyro.json"),c=f$1({driver:a$5({base:i})}),l=r?te(s):null,p=e?`${e}:`:"";return {storage:{getItem:async g=>{let m=`${p}${g}`,f=await c.getItem(m);if(f==null)return null;try{let b=l?Po(f,l):f,h=JSON.parse(b);return h.expiry&&Date.now()>h.expiry?(await c.removeItem(m),null):h.value}catch{return f}},setItem:async(g,m)=>{let f=`${p}${g}`,b=JSON.stringify(t?{value:m,expiry:Date.now()+t}:{value:m});await c.setItem(f,l?ko(b,l):b);},removeItem:async g=>{await c.removeItem(`${p}${g}`);}},cleanup:async()=>{await c.dispose?.();}}}async function se(o){let{environment:e,adapter:t,connectionString:r,encryption:s}=o,n=process.env.APP_SECRET||process.env.AUTH_SECRET,i={enabled:s?.enabled??true,algorithm:s?.algorithm};return e==="browser"?ee({namespace:"kyro"}):oe({namespace:"kyro",encryption:i.enabled,secret:n})}async function rt(o){let e={...o,encryption:{enabled:true,algorithm:o.encryption?.algorithm}};return se(e)}g();function vo(o){return {name:"kyro-loader",load:async e=>{let{store:t,logger:r,parseData:s}=e;r.info(`Loading Kyro CMS collection: "${o.collection}"`);try{let n=[];t.clear();for(let i of n){let c=String(i.id||i._id),l=await s({id:c,data:i});t.set({id:c,data:l,digest:JSON.stringify(l)});}r.info(`Successfully synced ${n.length} entries for "${o.collection}" into Astro store.`);}catch(n){r.error(`Failed to load Kyro collection "${o.collection}": ${n.message}`);}},schema:f.object({id:f.string(),createdAt:f.string().optional(),updatedAt:f.string().optional()}).passthrough()}}g();function Ro(o){return {input:o.schema||f.object({}).passthrough(),handler:async(t,r)=>{try{return {success:!0,collection:o.collection,action:o.action,data:t,timestamp:new Date().toISOString()}}catch(s){return {success:false,error:s.message||"CMS Action Execution Failed"}}}}}g();function Co(o={}){let e=o.protectedRoutes||[],t=o.loginPath||"/admin/login",r=o.cookieName||"kyro_session";return async(s,n)=>{let{request:i,cookies:c,redirect:l,locals:p}=s,g=new URL(i.url),m=c?.get?.(r)?.value||i.headers.get("authorization")?.replace("Bearer ",""),f=null;return m&&(f={id:"user_1",email:"admin@kyro-cms.com",role:"admin"}),p.kyroUser=f,e.some(h=>new RegExp("^"+h.replace(/\*/g,".*")+"$").test(g.pathname))&&!f?l(`${t}?redirect=${encodeURIComponent(g.pathname)}`):n()}}g();function Do(o){let e=o?.collections||[],t=`// Auto-generated by Kyro CMS
45
64
  declare module 'kyro:collections' {
46
65
  export interface KyroCollections {
47
- `;for(let r of e){let o=r.name||r.slug;t+=` '${o}': Record<string, any>;
66
+ `;for(let r of e){let s=r.name||r.slug;t+=` '${s}': Record<string, any>;
48
67
  `;}return t+=` }
49
68
  }
50
- `,t}g();function Io(s={}){return {APP_SECRET:{context:"server",access:"secret",type:"string",optional:false},DATABASE_URL:{context:"server",access:"secret",type:"string",optional:!s.requireDatabase},PUBLIC_KYRO_URL:{context:"client",access:"public",type:"string",optional:true,default:"http://localhost:4321"}}}
51
- export{R as AccountLockout,B as Auth,I as InMemoryAccountLockout,D as InMemoryAuthAdapter,E as NeonAdapter,v as RateLimiter,O as TursoAdapter,$ as VersionManager,$e as authConfig,no as createAuth,G as createAuthConfig,Ze as createAuthStorage,Fe as createNeonAdapter,re as createStorage,Ke as createTursoAdapter,io as createVersionManager,ze as defineConfig,go as defineKyroConfig,fo as generateAnalyticsTags,Do as generateKyroAstroTypes,mo as generateSeoTags,N as getDefaultDraftPublishConfig,bo as getPaymentConfig,qe as getPaymentConfigFromSettings,Ao as getSocialLinks,je as getSocialLinksFromSettings,wo as getStoreConfig,We as getStoreConfigFromSettings,lo as isArchived,co as isDraft,ao as isPublished,Ro as kyroAction,vo as kyroAuthMiddleware,Io as kyroEnvSchema,Co as kyroLoader,Yr as runFieldHooks,He as runHooks};
69
+ `,t}g();function Io(o={}){return {APP_SECRET:{context:"server",access:"secret",type:"string",optional:false},DATABASE_URL:{context:"server",access:"secret",type:"string",optional:!o.requireDatabase},PUBLIC_KYRO_URL:{context:"client",access:"public",type:"string",optional:true,default:"http://localhost:4321"}}}
70
+ export{R as AccountLockout,N as Auth,Q as CSSGenerator,I as InMemoryAccountLockout,D as InMemoryAuthAdapter,E as NeonAdapter,C as RateLimiter,O as TursoAdapter,j as VersionManager,We as authConfig,Qr as createAdminStyling,no as createAuth,Y as createAuthConfig,rt as createAuthStorage,Ke as createNeonAdapter,se as createStorage,Ne as createTursoAdapter,io as createVersionManager,qr as defaultDarkTheme,Yr as defaultFieldStyling,U as defaultLightTheme,qe as defineConfig,go as defineKyroConfig,Gr as ecommerce2026Theme,fo as generateAnalyticsTags,$e as generateCSSVariables,Do as generateKyroAstroTypes,mo as generateSeoTags,Wr as generateTailwindConfig,$ as getDefaultDraftPublishConfig,wo as getPaymentConfig,Ye as getPaymentConfigFromSettings,Ao as getSocialLinks,Ge as getSocialLinksFromSettings,bo as getStoreConfig,Qe as getStoreConfigFromSettings,lo as isArchived,co as isDraft,ao as isPublished,Ro as kyroAction,Co as kyroAuthMiddleware,Io as kyroEnvSchema,vo as kyroLoader,zr as runFieldHooks,Be as runHooks};
@@ -1,7 +1,6 @@
1
- import { A as AbstractBaseAdapter } from '../base-Ds06wMo9.cjs';
2
- import { F as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, e as UpdateArgs, D as DeleteArgs, f as FindOneArgs, g as FindVersionsArgs, h as VersionRecord, i as CreateVersionArgs } from '../types-CeAQSR87.cjs';
3
- import { A as AuthAdapter, U as UserRole, c as AuthUser, S as Session, e as AuditLogFilter, d as AuditLog } from '../types-CpjuXbe7.cjs';
4
- import '../types-BKPEavuy.cjs';
1
+ import { b as AbstractBaseAdapter, c as AuthAdapter, U as UserRole, d as AuthUser, S as Session, a as AuditLogFilter, A as AuditLog } from '../base-urWvrsX8.cjs';
2
+ import { F as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, U as UpdateArgs, D as DeleteArgs, e as FindOneArgs, f as FindVersionsArgs, V as VersionRecord, g as CreateVersionArgs } from '../types-YAVR0H9Z.cjs';
3
+ import '../types-DlGSbh7I.cjs';
5
4
 
6
5
  declare class MongoDBAdapter extends AbstractBaseAdapter {
7
6
  dialect: "mongodb";
@@ -1,7 +1,6 @@
1
- import { A as AbstractBaseAdapter } from '../base-DxDXLyWe.js';
2
- import { F as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, e as UpdateArgs, D as DeleteArgs, f as FindOneArgs, g as FindVersionsArgs, h as VersionRecord, i as CreateVersionArgs } from '../types-BWJx6zzm.js';
3
- import { A as AuthAdapter, U as UserRole, c as AuthUser, S as Session, e as AuditLogFilter, d as AuditLog } from '../types-CpjuXbe7.js';
4
- import '../types-BKPEavuy.js';
1
+ import { b as AbstractBaseAdapter, c as AuthAdapter, U as UserRole, d as AuthUser, S as Session, a as AuditLogFilter, A as AuditLog } from '../base-BcfNgOqZ.js';
2
+ import { F as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, U as UpdateArgs, D as DeleteArgs, e as FindOneArgs, f as FindVersionsArgs, V as VersionRecord, g as CreateVersionArgs } from '../types-BADIMVGF.js';
3
+ import '../types-DlGSbh7I.js';
5
4
 
6
5
  declare class MongoDBAdapter extends AbstractBaseAdapter {
7
6
  dialect: "mongodb";
@@ -1 +1 @@
1
- export{a as PostgresAuthAdapter}from'./chunk-ZWDBPEXL.js';import'./chunk-47CXBWMA.js';import'./chunk-EML5FDUU.js';import'./chunk-HRAY65XH.js';import'./chunk-FLMUMPDE.js';import'./chunk-3NSZZCOJ.js';import'./chunk-7NH7H3WA.js';import'./chunk-Y2YAKDEQ.js';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
1
+ export{a as PostgresAuthAdapter}from'./chunk-ZWDBPEXL.js';import'./chunk-47CXBWMA.js';import'./chunk-FLMUMPDE.js';import'./chunk-EML5FDUU.js';import'./chunk-HRAY65XH.js';import'./chunk-3NSZZCOJ.js';import'./chunk-7NH7H3WA.js';import'./chunk-Y2YAKDEQ.js';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
@@ -1 +1 @@
1
- 'use strict';var chunkXBQ6HV3T_cjs=require('./chunk-XBQ6HV3T.cjs');require('./chunk-7JWQ2PZP.cjs'),require('./chunk-NGNJSUGL.cjs'),require('./chunk-BCEE4NBZ.cjs'),require('./chunk-BAVN7VDR.cjs'),require('./chunk-VRZC4TTF.cjs'),require('./chunk-HTYVI2HK.cjs'),require('./chunk-BUNLC3II.cjs');Object.defineProperty(exports,"PostgresAuthAdapter",{enumerable:true,get:function(){return chunkXBQ6HV3T_cjs.a}});
1
+ 'use strict';var chunkXBQ6HV3T_cjs=require('./chunk-XBQ6HV3T.cjs');require('./chunk-7JWQ2PZP.cjs'),require('./chunk-BAVN7VDR.cjs'),require('./chunk-NGNJSUGL.cjs'),require('./chunk-BCEE4NBZ.cjs'),require('./chunk-VRZC4TTF.cjs'),require('./chunk-HTYVI2HK.cjs'),require('./chunk-BUNLC3II.cjs');Object.defineProperty(exports,"PostgresAuthAdapter",{enumerable:true,get:function(){return chunkXBQ6HV3T_cjs.a}});
@@ -0,0 +1 @@
1
+ 'use strict';var chunkRVBSJ4UQ_cjs=require('./chunk-RVBSJ4UQ.cjs');require('./chunk-GNOSG3PK.cjs'),require('./chunk-LY7N3UHH.cjs'),require('./chunk-BAVN7VDR.cjs'),require('./chunk-BCEE4NBZ.cjs'),require('./chunk-VRZC4TTF.cjs'),require('./chunk-BUNLC3II.cjs');Object.defineProperty(exports,"PostgresJsDatabase",{enumerable:true,get:function(){return chunkRVBSJ4UQ_cjs.e}});Object.defineProperty(exports,"PostgresJsPreparedQuery",{enumerable:true,get:function(){return chunkRVBSJ4UQ_cjs.b}});Object.defineProperty(exports,"PostgresJsSession",{enumerable:true,get:function(){return chunkRVBSJ4UQ_cjs.c}});Object.defineProperty(exports,"PostgresJsTransaction",{enumerable:true,get:function(){return chunkRVBSJ4UQ_cjs.d}});Object.defineProperty(exports,"drizzle",{enumerable:true,get:function(){return chunkRVBSJ4UQ_cjs.f}});
@@ -1 +1 @@
1
- export{e as PostgresJsDatabase,b as PostgresJsPreparedQuery,c as PostgresJsSession,d as PostgresJsTransaction,f as drizzle}from'./chunk-637PTUHF.js';import'./chunk-N5POANYV.js';import'./chunk-HRAY65XH.js';import'./chunk-2HA6EKXX.js';import'./chunk-FLMUMPDE.js';import'./chunk-3NSZZCOJ.js';import'./chunk-Y2YAKDEQ.js';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
1
+ export{e as PostgresJsDatabase,b as PostgresJsPreparedQuery,c as PostgresJsSession,d as PostgresJsTransaction,f as drizzle}from'./chunk-3TAUNYEM.js';import'./chunk-N5POANYV.js';import'./chunk-2HA6EKXX.js';import'./chunk-FLMUMPDE.js';import'./chunk-HRAY65XH.js';import'./chunk-3NSZZCOJ.js';import'./chunk-Y2YAKDEQ.js';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
@@ -1 +1 @@
1
- 'use strict';var chunkOBH6EEAO_cjs=require('../chunk-OBH6EEAO.cjs');require('../chunk-XTTGHN3D.cjs'),require('../chunk-HPYH7GTS.cjs'),require('../chunk-OPTVCCQQ.cjs'),require('../chunk-O4YE57OS.cjs'),require('../chunk-MCIZG4A3.cjs'),require('../chunk-35PGCW3S.cjs'),require('../chunk-UNYXWPLZ.cjs'),require('../chunk-PITMDQYN.cjs'),require('../chunk-GIS6X43A.cjs'),require('../chunk-LEBM6ZSZ.cjs'),require('../chunk-GNEVCEJU.cjs'),require('../chunk-ZO3YB5DK.cjs'),require('../chunk-3VXEK5ZW.cjs'),require('../chunk-EZIDQBXI.cjs'),require('../chunk-LQ3YZTPU.cjs'),require('../chunk-MVX2PYJJ.cjs'),require('../chunk-FSL3NLRT.cjs'),require('../chunk-ZHA446FA.cjs'),require('../chunk-ZQETJ4T4.cjs'),require('../chunk-XBQ6HV3T.cjs'),require('../chunk-7JWQ2PZP.cjs'),require('../chunk-NGNJSUGL.cjs'),require('../chunk-SOCBJPYB.cjs'),require('../chunk-GNOSG3PK.cjs'),require('../chunk-BCEE4NBZ.cjs'),require('../chunk-LY7N3UHH.cjs'),require('../chunk-BAVN7VDR.cjs'),require('../chunk-VRZC4TTF.cjs'),require('../chunk-7DUKWHRN.cjs'),require('../chunk-HTYVI2HK.cjs'),require('../chunk-ZOVH6QT5.cjs'),require('../chunk-7WMMKGEO.cjs'),require('../chunk-BUNLC3II.cjs');Object.defineProperty(exports,"createKyroApp",{enumerable:true,get:function(){return chunkOBH6EEAO_cjs.ib}});Object.defineProperty(exports,"createRESTAPI",{enumerable:true,get:function(){return chunkOBH6EEAO_cjs.jb}});
1
+ 'use strict';var chunkLKQHIOPW_cjs=require('../chunk-LKQHIOPW.cjs');require('../chunk-FLS2FJM6.cjs'),require('../chunk-OPTVCCQQ.cjs'),require('../chunk-HPYH7GTS.cjs'),require('../chunk-O4YE57OS.cjs'),require('../chunk-MCIZG4A3.cjs'),require('../chunk-35PGCW3S.cjs'),require('../chunk-UNYXWPLZ.cjs'),require('../chunk-PITMDQYN.cjs'),require('../chunk-GIS6X43A.cjs'),require('../chunk-LEBM6ZSZ.cjs'),require('../chunk-GNEVCEJU.cjs'),require('../chunk-ZO3YB5DK.cjs'),require('../chunk-3VXEK5ZW.cjs'),require('../chunk-EZIDQBXI.cjs'),require('../chunk-LQ3YZTPU.cjs'),require('../chunk-FSL3NLRT.cjs'),require('../chunk-ZHA446FA.cjs'),require('../chunk-TCFL3UWT.cjs'),require('../chunk-XBQ6HV3T.cjs'),require('../chunk-RVBSJ4UQ.cjs'),require('../chunk-GNOSG3PK.cjs'),require('../chunk-LY7N3UHH.cjs'),require('../chunk-7JWQ2PZP.cjs'),require('../chunk-BAVN7VDR.cjs'),require('../chunk-NGNJSUGL.cjs'),require('../chunk-BCEE4NBZ.cjs'),require('../chunk-VRZC4TTF.cjs'),require('../chunk-7DUKWHRN.cjs'),require('../chunk-HTYVI2HK.cjs'),require('../chunk-ZOVH6QT5.cjs'),require('../chunk-7WMMKGEO.cjs'),require('../chunk-BUNLC3II.cjs');Object.defineProperty(exports,"createKyroApp",{enumerable:true,get:function(){return chunkLKQHIOPW_cjs.ib}});Object.defineProperty(exports,"createRESTAPI",{enumerable:true,get:function(){return chunkLKQHIOPW_cjs.jb}});
@@ -1,8 +1,8 @@
1
1
  import { Hono } from 'hono';
2
- import { B as BaseAdapter, l as User } from '../types-CeAQSR87.cjs';
3
- import { R as Registry } from '../index-BHYGO3yF.cjs';
4
- import { j as createWebhookService } from '../WebhookService-CIQPD1We.cjs';
5
- import '../types-BKPEavuy.cjs';
2
+ import { B as BaseAdapter, i as User } from '../types-YAVR0H9Z.cjs';
3
+ import { R as Registry } from '../index-d1m_oup7.cjs';
4
+ import { j as createWebhookService } from '../WebhookService-bo1NrgBW.cjs';
5
+ import '../types-DlGSbh7I.cjs';
6
6
  import 'zod';
7
7
 
8
8
  interface KyroAppOptions {
@@ -1,8 +1,8 @@
1
1
  import { Hono } from 'hono';
2
- import { B as BaseAdapter, l as User } from '../types-BWJx6zzm.js';
3
- import { R as Registry } from '../index-DTy4k1oU.js';
4
- import { j as createWebhookService } from '../WebhookService-CGNSlclW.js';
5
- import '../types-BKPEavuy.js';
2
+ import { B as BaseAdapter, i as User } from '../types-BADIMVGF.js';
3
+ import { R as Registry } from '../index-4cH-BjtP.js';
4
+ import { j as createWebhookService } from '../WebhookService-DQyM9fVo.js';
5
+ import '../types-DlGSbh7I.js';
6
6
  import 'zod';
7
7
 
8
8
  interface KyroAppOptions {
@@ -1 +1 @@
1
- export{ib as createKyroApp,jb as createRESTAPI}from'../chunk-6USPOWA4.js';import'../chunk-KWGB3YNI.js';import'../chunk-OLRCZ6E3.js';import'../chunk-N6MNQIQU.js';import'../chunk-6TPICJ2L.js';import'../chunk-YENNL5HG.js';import'../chunk-W45TLOOT.js';import'../chunk-IKGVPXMK.js';import'../chunk-YUUXFD73.js';import'../chunk-LVBHOZZF.js';import'../chunk-OBYAIJVU.js';import'../chunk-JRUQ5ABB.js';import'../chunk-CIVA6SKW.js';import'../chunk-WPM6LFCY.js';import'../chunk-U6KFONKM.js';import'../chunk-TYQYKKWJ.js';import'../chunk-L2QXP26Q.js';import'../chunk-AWQGDMOE.js';import'../chunk-GQGFNTDZ.js';import'../chunk-4OMQURN7.js';import'../chunk-ZWDBPEXL.js';import'../chunk-47CXBWMA.js';import'../chunk-EML5FDUU.js';import'../chunk-637PTUHF.js';import'../chunk-N5POANYV.js';import'../chunk-HRAY65XH.js';import'../chunk-2HA6EKXX.js';import'../chunk-FLMUMPDE.js';import'../chunk-3NSZZCOJ.js';import'../chunk-5ZEYOFAK.js';import'../chunk-7NH7H3WA.js';import'../chunk-VVVCCB6R.js';import'../chunk-TBHNE4VV.js';import'../chunk-Y2YAKDEQ.js';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
1
+ export{ib as createKyroApp,jb as createRESTAPI}from'../chunk-26KFM3P6.js';import'../chunk-PFKVHUOT.js';import'../chunk-N6MNQIQU.js';import'../chunk-OLRCZ6E3.js';import'../chunk-6TPICJ2L.js';import'../chunk-YENNL5HG.js';import'../chunk-W45TLOOT.js';import'../chunk-IKGVPXMK.js';import'../chunk-YUUXFD73.js';import'../chunk-LVBHOZZF.js';import'../chunk-OBYAIJVU.js';import'../chunk-JRUQ5ABB.js';import'../chunk-CIVA6SKW.js';import'../chunk-WPM6LFCY.js';import'../chunk-U6KFONKM.js';import'../chunk-TYQYKKWJ.js';import'../chunk-AWQGDMOE.js';import'../chunk-GQGFNTDZ.js';import'../chunk-ZAKYTBEN.js';import'../chunk-ZWDBPEXL.js';import'../chunk-3TAUNYEM.js';import'../chunk-N5POANYV.js';import'../chunk-2HA6EKXX.js';import'../chunk-47CXBWMA.js';import'../chunk-FLMUMPDE.js';import'../chunk-EML5FDUU.js';import'../chunk-HRAY65XH.js';import'../chunk-3NSZZCOJ.js';import'../chunk-5ZEYOFAK.js';import'../chunk-7NH7H3WA.js';import'../chunk-VVVCCB6R.js';import'../chunk-TBHNE4VV.js';import'../chunk-Y2YAKDEQ.js';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
@@ -1,5 +1,5 @@
1
- import { G as GlobalConfig, C as CollectionConfig } from '../types-CeAQSR87.cjs';
2
- import '../types-BKPEavuy.cjs';
1
+ import { G as GlobalConfig, C as CollectionConfig } from '../types-YAVR0H9Z.cjs';
2
+ import '../types-DlGSbh7I.cjs';
3
3
 
4
4
  declare const minimalCollections: Record<string, any>;
5
5