@mks2508/better-logger 5.0.0 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{Logger-Cbi1f10o.js → Logger-CKqzXDh3.js} +2 -2
- package/dist/chunks/{Logger-Cbi1f10o.js.map → Logger-CKqzXDh3.js.map} +1 -1
- package/dist/chunks/{Logger-BZ7B7OXE.js → Logger-D_vuKP4l.js} +2 -2
- package/dist/chunks/{Logger-BZ7B7OXE.js.map → Logger-D_vuKP4l.js.map} +1 -1
- package/dist/chunks/cli-module-B-njrTWb.js +2 -0
- package/dist/chunks/cli-module-B-njrTWb.js.map +1 -0
- package/dist/chunks/{cli-module-ClIJmaT8.js → cli-module-Cx7qotPY.js} +16 -9
- package/dist/chunks/cli-module-Cx7qotPY.js.map +1 -0
- package/dist/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/exports.cjs +1 -1
- package/dist/exports.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/styling.cjs +1 -1
- package/dist/styling.js +2 -2
- package/dist/terminal/formatter.d.ts.map +1 -1
- package/package.json +5 -1
- package/.claude/settings.local.json +0 -48
- package/.github/workflows/ci-quality.yml +0 -357
- package/.github/workflows/docs-demo.yml +0 -119
- package/.github/workflows/releases-core.yml +0 -512
- package/.github/workflows/releases-full.yml +0 -582
- package/.github/workflows-backup/ci.yml +0 -221
- package/.github/workflows-backup/nightly.yml +0 -196
- package/.github/workflows-backup/release-optimized.yml +0 -373
- package/.github/workflows-backup/release.yml +0 -269
- package/.release-notes-0.2.0.md +0 -129
- package/.yamllint +0 -28
- package/CHANGELOG.json +0 -1076
- package/CHANGELOG.md +0 -209
- package/CLAUDE.md +0 -217
- package/bun.lock +0 -333
- package/demo.html +0 -847
- package/dist/chunks/cli-module-CadqgZ1Z.js +0 -2
- package/dist/chunks/cli-module-CadqgZ1Z.js.map +0 -1
- package/dist/chunks/cli-module-ClIJmaT8.js.map +0 -1
- package/docs/API.md +0 -918
- package/docs/CORE.md +0 -264
- package/docs/DEVELOPMENT.md +0 -731
- package/docs/EXPORTS.md +0 -467
- package/docs/PACKAGES.md +0 -244
- package/docs/STYLING.md +0 -405
- package/docs/_config.yml +0 -36
- package/docs/index.md +0 -179
- package/examples/README.md +0 -208
- package/examples/basic-logging.js +0 -75
- package/examples/data-export.js +0 -234
- package/examples/package.json +0 -16
- package/examples/performance-timing.js +0 -170
- package/examples/simplified-api.js +0 -124
- package/examples/styling-themes.js +0 -207
- package/index.html +0 -358
- package/packages/core/package.json +0 -57
- package/packages/exports/package.json +0 -41
- package/packages/nodejs-opentui/README.md +0 -232
- package/packages/nodejs-opentui/package.json +0 -72
- package/packages/nodejs-opentui/src/LogRenderer.ts +0 -171
- package/packages/nodejs-opentui/src/OpenTUILogHandler.ts +0 -178
- package/packages/nodejs-opentui/src/components/LogBadge.tsx +0 -131
- package/packages/nodejs-opentui/src/index.ts +0 -133
- package/packages/nodejs-opentui/src/types.ts +0 -158
- package/packages/nodejs-opentui/tsconfig.json +0 -20
- package/packages/styling/package.json +0 -41
- package/playground/demo-all.ts +0 -95
- package/playground/demo-box.ts +0 -85
- package/playground/demo-levels.ts +0 -56
- package/playground/demo-real-world.ts +0 -98
- package/playground/demo-spinner.ts +0 -77
- package/playground/demo-steps.ts +0 -72
- package/playground/demo-table.ts +0 -83
- package/project-utils/README.md +0 -172
- package/project-utils/auto-release-gemini.ts +0 -1193
- package/project-utils/auto-release-ui.ts +0 -1329
- package/project-utils/commit-generator.ts +0 -1385
- package/project-utils/commit-ui.ts +0 -264
- package/project-utils/git-utils.ts +0 -199
- package/project-utils/github-release-manager.ts +0 -466
- package/project-utils/project-config.ts +0 -260
- package/project-utils/prompt-templates.js +0 -345
- package/project-utils/prompt-templates.ts +0 -422
- package/project-utils/version-manager.ts +0 -1078
- package/public/vite.svg +0 -1
- package/src/Logger.ts +0 -1858
- package/src/ScopedLogger.ts +0 -256
- package/src/cli/CommandProcessor.ts +0 -248
- package/src/cli/commands/ConfigCommand.ts +0 -93
- package/src/cli/commands/ExportCommand.ts +0 -276
- package/src/cli/commands/HistoryCommand.ts +0 -117
- package/src/cli/commands/StatusCommand.ts +0 -112
- package/src/cli/commands/ThemeCommand.ts +0 -88
- package/src/cli/help.ts +0 -127
- package/src/cli/index.ts +0 -71
- package/src/cli-module.ts +0 -21
- package/src/cli-primitives/box.ts +0 -86
- package/src/cli-primitives/cli-table.ts +0 -62
- package/src/cli-primitives/divider.ts +0 -17
- package/src/cli-primitives/header.ts +0 -18
- package/src/cli-primitives/index.ts +0 -13
- package/src/cli-primitives/server-fallback.ts +0 -54
- package/src/cli-primitives/spinner.ts +0 -133
- package/src/cli-primitives/step.ts +0 -22
- package/src/constants.ts +0 -313
- package/src/core.ts +0 -397
- package/src/example.ts +0 -210
- package/src/exports-module.ts +0 -311
- package/src/handlers/AnalyticsLogHandler.ts +0 -22
- package/src/handlers/ExportLogHandler.ts +0 -610
- package/src/handlers/FileLogHandler.ts +0 -169
- package/src/handlers/RemoteLogHandler.ts +0 -42
- package/src/handlers/index.ts +0 -8
- package/src/hooks/HookManager.ts +0 -177
- package/src/hooks/index.ts +0 -1
- package/src/index.ts +0 -395
- package/src/main.ts +0 -196
- package/src/serializers/SerializerRegistry.ts +0 -173
- package/src/serializers/index.ts +0 -1
- package/src/style.css +0 -96
- package/src/styling/LogStyleBuilder.ts +0 -355
- package/src/styling/SemanticStyles.ts +0 -380
- package/src/styling/SmartPresets.ts +0 -288
- package/src/styling/StyleBuilder.ts +0 -319
- package/src/styling/StyleCache.ts +0 -131
- package/src/styling/banners.ts +0 -168
- package/src/styling/index.ts +0 -27
- package/src/styling/themes.ts +0 -235
- package/src/styling-module.ts +0 -244
- package/src/terminal/color-converter.ts +0 -315
- package/src/terminal/formatter.ts +0 -236
- package/src/terminal/terminal-renderer.ts +0 -342
- package/src/transports/ConsoleTransport.ts +0 -28
- package/src/transports/FileTransport.ts +0 -53
- package/src/transports/HttpTransport.ts +0 -56
- package/src/transports/TransportManager.ts +0 -130
- package/src/transports/index.ts +0 -4
- package/src/types/core.ts +0 -417
- package/src/types/handlers.ts +0 -95
- package/src/types/hooks.ts +0 -45
- package/src/types/index.ts +0 -83
- package/src/types/serializers.ts +0 -30
- package/src/types/transports.ts +0 -52
- package/src/typescript.svg +0 -1
- package/src/utils/adapter.ts +0 -291
- package/src/utils/ansi-colors.ts +0 -333
- package/src/utils/environment-detector.ts +0 -170
- package/src/utils/environment.ts +0 -94
- package/src/utils/formatting.ts +0 -332
- package/src/utils/index.ts +0 -33
- package/src/utils/opentui-detection.ts +0 -138
- package/src/utils/output.ts +0 -227
- package/src/utils/stackTrace.ts +0 -144
- package/src/utils/timestamps.ts +0 -80
- package/src/vite-env.d.ts +0 -1
- package/src/writers/BufferWriter.ts +0 -157
- package/src/writers/index.ts +0 -6
- package/test-core-browser.html +0 -237
- package/test-core-node.js +0 -63
- package/tests/test-conflict-resolution.ts +0 -391
- package/tests/validate-workflows.sh +0 -131
- package/tests/yaml-autofix.sh +0 -146
- package/tsconfig.json +0 -50
- package/vite.config.ts +0 -256
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logger-Cbi1f10o.js","sources":["../../src/serializers/SerializerRegistry.ts","../../src/hooks/HookManager.ts","../../src/types/core.ts","../../src/transports/TransportManager.ts","../../src/styling/themes.ts","../../src/styling/banners.ts","../../src/styling/SemanticStyles.ts","../../src/styling/LogStyleBuilder.ts","../../src/styling/SmartPresets.ts","../../src/ScopedLogger.ts","../../src/handlers/ExportLogHandler.ts","../../src/cli/CommandProcessor.ts","../../src/cli/commands/ConfigCommand.ts","../../src/cli/commands/ThemeCommand.ts","../../src/cli/commands/StatusCommand.ts","../../src/cli/commands/ExportCommand.ts","../../src/cli/help.ts","../../src/cli/commands/HistoryCommand.ts","../../src/Logger.ts","../../src/cli/index.ts"],"sourcesContent":["import type {\n SerializerFn,\n SerializerContext,\n SerializerEntry,\n SerializerConfig,\n ISerializerRegistry\n} from '../types/index.js';\n\nconst DEFAULT_CONFIG: Required<SerializerConfig> = {\n maxDepth: 5,\n circular: 'placeholder',\n preserveUndefined: false\n};\n\nexport class SerializerRegistry implements ISerializerRegistry {\n private serializers: Map<Function, SerializerEntry> = new Map();\n private config: Required<SerializerConfig>;\n\n constructor(config: SerializerConfig = {}) {\n this.config = { ...DEFAULT_CONFIG, ...config };\n this.registerDefaults();\n }\n\n private registerDefaults(): void {\n this.add(Error, (err: Error) => ({\n name: err.name,\n message: err.message,\n stack: err.stack?.split('\\n').slice(0, 10),\n ...(err.cause ? { cause: this.serialize(err.cause) } : {})\n }), 100);\n\n this.add(Date, (date: Date) => ({\n iso: date.toISOString(),\n timestamp: date.getTime()\n }), 90);\n\n this.add(RegExp, (regex: RegExp) => ({\n pattern: regex.source,\n flags: regex.flags\n }), 90);\n\n this.add(Map, (map: Map<any, any>, ctx) => {\n const obj: Record<string, any> = {};\n map.forEach((value, key) => {\n const keyStr = typeof key === 'object' ? JSON.stringify(key) : String(key);\n obj[keyStr] = this.serializeInternal(value, {\n ...ctx,\n depth: ctx.depth + 1,\n path: [...ctx.path, keyStr]\n });\n });\n return { __type: 'Map', entries: obj };\n }, 80);\n\n this.add(Set, (set: Set<any>, ctx) => ({\n __type: 'Set',\n values: Array.from(set).map((v, i) =>\n this.serializeInternal(v, {\n ...ctx,\n depth: ctx.depth + 1,\n path: [...ctx.path, `[${i}]`]\n })\n )\n }), 80);\n\n if (typeof Buffer !== 'undefined') {\n this.add(Buffer as any, (buf: Buffer) => ({\n __type: 'Buffer',\n length: buf.length,\n preview: buf.slice(0, 50).toString('hex')\n }), 70);\n }\n }\n\n add<T>(\n type: new (...args: any[]) => T,\n serializer: SerializerFn<T>,\n priority: number = 50\n ): void {\n this.serializers.set(type, { type, serializer, priority });\n }\n\n remove<T>(type: new (...args: any[]) => T): boolean {\n return this.serializers.delete(type);\n }\n\n has<T>(type: new (...args: any[]) => T): boolean {\n return this.serializers.has(type);\n }\n\n getAll(): SerializerEntry[] {\n return Array.from(this.serializers.values())\n .sort((a, b) => (b.priority ?? 50) - (a.priority ?? 50));\n }\n\n private findSerializer(value: any): SerializerEntry | null {\n const sorted = this.getAll();\n for (const entry of sorted) {\n if (value instanceof entry.type) {\n return entry;\n }\n }\n return null;\n }\n\n private serializeInternal(value: any, context: SerializerContext): any {\n if (value === null) return null;\n if (value === undefined) return this.config.preserveUndefined ? undefined : '[undefined]';\n if (typeof value === 'function') return `[Function: ${value.name || 'anonymous'}]`;\n if (typeof value !== 'object') return value;\n\n if (context.depth >= this.config.maxDepth) {\n return '[Max Depth]';\n }\n\n if (context.seen.has(value)) {\n switch (this.config.circular) {\n case 'error':\n throw new Error(`Circular reference at ${context.path.join('.')}`);\n case 'skip':\n return undefined;\n case 'placeholder':\n default:\n return '[Circular]';\n }\n }\n context.seen.add(value);\n\n const serializer = this.findSerializer(value);\n if (serializer) {\n return serializer.serializer(value, context);\n }\n\n if (Array.isArray(value)) {\n return value.map((item, i) =>\n this.serializeInternal(item, {\n ...context,\n depth: context.depth + 1,\n path: [...context.path, `[${i}]`]\n })\n );\n }\n\n const result: Record<string, any> = {};\n for (const [key, val] of Object.entries(value)) {\n result[key] = this.serializeInternal(val, {\n ...context,\n depth: context.depth + 1,\n path: [...context.path, key]\n });\n }\n return result;\n }\n\n serialize(value: any, config?: SerializerConfig): any {\n const mergedConfig = { ...this.config, ...config };\n return this.serializeInternal(value, {\n depth: 0,\n maxDepth: mergedConfig.maxDepth,\n path: [],\n seen: new WeakSet()\n });\n }\n}\n\nlet _defaultRegistry: SerializerRegistry | null = null;\n\nexport function getDefaultSerializerRegistry(): SerializerRegistry {\n if (!_defaultRegistry) {\n _defaultRegistry = new SerializerRegistry();\n }\n return _defaultRegistry;\n}\n","import type {\n HookLogEntry,\n HookEvent,\n HookCallback,\n MiddlewareFn,\n HookRegistration,\n MiddlewareRegistration,\n IHookManager\n} from '../types/index.js';\n\nfunction generateId(): string {\n return `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;\n}\n\nexport class HookManager implements IHookManager {\n private hooks: Map<HookEvent, HookRegistration[]> = new Map();\n private middlewares: MiddlewareRegistration[] = [];\n\n constructor() {\n this.hooks.set('beforeLog', []);\n this.hooks.set('afterLog', []);\n this.hooks.set('onError', []);\n }\n\n on(event: HookEvent, callback: HookCallback, priority: number = 50): () => void {\n const registration: HookRegistration = {\n id: generateId(),\n event,\n callback,\n priority,\n once: false\n };\n\n const hooks = this.hooks.get(event)!;\n hooks.push(registration);\n hooks.sort((a, b) => b.priority - a.priority);\n\n return () => this.removeHook(event, registration.id);\n }\n\n once(event: HookEvent, callback: HookCallback, priority: number = 50): () => void {\n const registration: HookRegistration = {\n id: generateId(),\n event,\n callback,\n priority,\n once: true\n };\n\n const hooks = this.hooks.get(event)!;\n hooks.push(registration);\n hooks.sort((a, b) => b.priority - a.priority);\n\n return () => this.removeHook(event, registration.id);\n }\n\n off(event: HookEvent, callback: HookCallback): boolean {\n const hooks = this.hooks.get(event);\n if (!hooks) return false;\n\n const index = hooks.findIndex(h => h.callback === callback);\n if (index >= 0) {\n hooks.splice(index, 1);\n return true;\n }\n return false;\n }\n\n private removeHook(event: HookEvent, id: string): void {\n const hooks = this.hooks.get(event);\n if (hooks) {\n const index = hooks.findIndex(h => h.id === id);\n if (index >= 0) {\n hooks.splice(index, 1);\n }\n }\n }\n\n use(middleware: MiddlewareFn, priority: number = 50): () => void {\n const registration: MiddlewareRegistration = {\n id: generateId(),\n fn: middleware,\n priority\n };\n\n this.middlewares.push(registration);\n this.middlewares.sort((a, b) => b.priority - a.priority);\n\n return () => {\n const index = this.middlewares.findIndex(m => m.id === registration.id);\n if (index >= 0) {\n this.middlewares.splice(index, 1);\n }\n };\n }\n\n async emit(event: HookEvent, entry: HookLogEntry): Promise<HookLogEntry> {\n const hooks = this.hooks.get(event) || [];\n let currentEntry = { ...entry };\n const toRemove: string[] = [];\n\n for (const hook of hooks) {\n try {\n const result = await hook.callback(currentEntry);\n if (result) {\n currentEntry = { ...currentEntry, ...result };\n }\n if (hook.once) {\n toRemove.push(hook.id);\n }\n } catch (error) {\n if (event !== 'onError') {\n await this.emit('onError', {\n ...currentEntry,\n error,\n hookEvent: event\n } as HookLogEntry);\n }\n }\n }\n\n toRemove.forEach(id => this.removeHook(event, id));\n return currentEntry;\n }\n\n async process(entry: HookLogEntry): Promise<HookLogEntry> {\n let currentEntry = { ...entry };\n\n currentEntry = await this.emit('beforeLog', currentEntry);\n\n if (this.middlewares.length > 0) {\n let index = 0;\n\n const executeNext = async (): Promise<void> => {\n if (index < this.middlewares.length) {\n const middleware = this.middlewares[index++];\n if (middleware) {\n await middleware.fn(currentEntry, executeNext);\n }\n }\n };\n\n await executeNext();\n }\n\n return currentEntry;\n }\n\n async afterProcess(entry: HookLogEntry): Promise<void> {\n await this.emit('afterLog', entry);\n }\n\n clear(): void {\n this.hooks.forEach(hooks => hooks.length = 0);\n this.middlewares.length = 0;\n }\n\n getStats(): { hooks: Record<HookEvent, number>; middlewares: number } {\n return {\n hooks: {\n beforeLog: this.hooks.get('beforeLog')?.length || 0,\n afterLog: this.hooks.get('afterLog')?.length || 0,\n onError: this.hooks.get('onError')?.length || 0\n },\n middlewares: this.middlewares.length\n };\n }\n}\n\nlet _defaultHookManager: HookManager | null = null;\n\nexport function getDefaultHookManager(): HookManager {\n if (!_defaultHookManager) {\n _defaultHookManager = new HookManager();\n }\n return _defaultHookManager;\n}\n","/**\n * @fileoverview Definiciones de tipos principales para Better Logger\n * @version 0.3.0\n * @since 2024\n */\n\n/**\n * Niveles de log soportados en orden jerárquico (debug < info < warn < error < critical)\n * \n * @constant {Object} LOG_LEVELS\n * @property {number} debug - Nivel 0: Información de depuración detallada\n * @property {number} info - Nivel 1: Mensajes informativos generales\n * @property {number} warn - Nivel 2: Advertencias que no detienen la ejecución\n * @property {number} error - Nivel 3: Errores que pueden afectar funcionalidad\n * @property {number} critical - Nivel 4: Errores críticos que requieren atención inmediata\n * \n * @example\n * // Verificar si un nivel debe mostrarse\n * if (LOG_LEVELS[currentLevel] >= LOG_LEVELS.warn) {\n * // Mostrar solo warn, error y critical\n * }\n */\nexport const LOG_LEVELS = {\n debug: 0,\n info: 1,\n warn: 2,\n error: 3,\n critical: 4,\n} as const;\n\n/**\n * Tipo de nivel de log derivado de las claves de LOG_LEVELS\n * @typedef {'debug' | 'info' | 'warn' | 'error' | 'critical'} LogLevel\n */\nexport type LogLevel = keyof typeof LOG_LEVELS;\n\n/**\n * Tipo de nivel de verbosidad para filtrar logs\n * @typedef {LogLevel | 'silent'} Verbosity\n * @description 'silent' desactiva completamente todos los logs\n */\nexport type Verbosity = LogLevel | 'silent';\n\n/**\n * Variantes de tema para diferentes estilos visuales\n * @typedef {'default' | 'dark' | 'light' | 'neon' | 'minimal' | 'cyberpunk'} ThemeVariant\n * \n * @description\n * - default: Tema adaptativo automático (claro/oscuro)\n * - dark: Tema oscuro con colores vibrantes\n * - light: Tema claro con colores suaves\n * - neon: Colores neón brillantes con efectos de resplandor\n * - minimal: Diseño minimalista y limpio\n * - cyberpunk: Estilo futurista con neón y efectos\n */\nexport type ThemeVariant = 'default' | 'dark' | 'light' | 'neon' | 'minimal' | 'cyberpunk';\n\n/**\n * Detección de tema de DevTools del navegador\n * @typedef {'light' | 'dark'} DevToolsTheme\n */\nexport type DevToolsTheme = 'light' | 'dark';\n\n/**\n * Tipos de banner para diferentes enfoques visuales\n * @typedef {'simple' | 'ascii' | 'unicode' | 'svg' | 'animated'} BannerType\n * \n * @description\n * - simple: Texto simple sin decoración\n * - ascii: Arte ASCII tradicional\n * - unicode: Caracteres Unicode decorativos\n * - svg: Gráfico SVG embebido\n * - animated: Banner con animación CSS\n */\nexport type BannerType = 'simple' | 'ascii' | 'unicode' | 'svg' | 'animated';\n\n/**\n * Formatos de exportación para datos de log\n * @typedef {'json' | 'csv' | 'markdown' | 'plain' | 'html'} ExportFormat\n *\n * @description\n * - json: Formato JSON estructurado\n * - csv: Valores separados por comas para Excel/Sheets\n * - markdown: Formato Markdown para documentación\n * - plain: Texto plano sin formato\n * - html: HTML con estilos para visualización web\n */\nexport type ExportFormat = 'json' | 'csv' | 'markdown' | 'plain' | 'html';\n\n/**\n * Formatos de salida para diferentes entornos\n * @typedef {'auto' | 'plain' | 'ansi' | 'build' | 'ci'} OutputFormat\n *\n * @description\n * - auto: Detección automática basada en entorno (recomendado)\n * - plain: Texto plano sin colores (máxima compatibilidad)\n * - ansi: Colores ANSI para terminales modernos\n * - build: Formato optimizado para builds (Next.js, webpack, etc.)\n * - ci: Formato optimizado para CI/CD (sin emojis, texto simple)\n */\nexport type OutputFormat = 'auto' | 'plain' | 'ansi' | 'build' | 'ci';\n\n/**\n * Output modes for controlling where logs are written\n * @typedef {'console' | 'silent' | 'custom'} OutputMode\n *\n * @description\n * - console: Standard console.log output (default)\n * - silent: No output at all\n * - custom: Use custom OutputWriter for advanced scenarios\n */\nexport type OutputMode = 'console' | 'silent' | 'custom';\n\n/**\n * Custom output writer interface for redirecting log output\n *\n * @interface OutputWriter\n * @since 4.0.0\n *\n * @description\n * Allows redirecting log output to custom destinations like:\n * - DraftLog for CLI spinners with concurrent logging\n * - Buffers for collecting logs during operations\n * - Custom streams or transports\n *\n * @example\n * class BufferWriter implements OutputWriter {\n * private buffer: string[] = [];\n *\n * write(message: string, level: LogLevel, styles: string[]): void {\n * this.buffer.push(message);\n * }\n *\n * flush(): void {\n * this.buffer.forEach(msg => console.log(msg));\n * this.buffer = [];\n * }\n * }\n */\nexport interface OutputWriter {\n write(message: string, level: LogLevel, styles: string[]): void;\n flush?(): void;\n}\n\n/**\n * Interfaz de configuración para instancias del logger\n * \n * @interface LoggerConfig\n * @since 0.3.0\n * \n * @example\n * const config: LoggerConfig = {\n * globalPrefix: 'MiApp',\n * verbosity: 'info',\n * enableColors: true,\n * enableTimestamps: true,\n * enableStackTrace: false,\n * theme: 'cyberpunk',\n * bannerType: 'animated',\n * bufferSize: 500,\n * autoDetectTheme: true\n * };\n */\nexport interface LoggerConfig {\n globalPrefix?: string;\n verbosity: Verbosity;\n enableColors: boolean;\n enableTimestamps: boolean;\n enableStackTrace: boolean;\n theme?: ThemeVariant;\n bannerType?: BannerType;\n bufferSize?: number;\n autoDetectTheme?: boolean;\n outputFormat?: OutputFormat;\n /** Output mode: 'console' (default), 'silent', or 'custom' @since 4.0.0 */\n outputMode?: OutputMode;\n /** Custom writer when outputMode is 'custom' @since 4.0.0 */\n outputWriter?: OutputWriter;\n /** CLI verbosity level for controlling primitive output @since 5.0.0 */\n cliLevel?: CLILogLevel;\n}\n\n/**\n * Información parseada del stack trace\n * \n * @interface StackInfo\n * @description Contiene la ubicación exacta donde se originó el log\n */\nexport interface StackInfo {\n file: string;\n line: number;\n column: number;\n function?: string;\n}\n\n/**\n * Entrada de temporizador para medición de rendimiento\n * \n * @interface TimerEntry\n * @description Usado internamente para rastrear temporizadores activos\n */\nexport interface TimerEntry {\n label: string;\n startTime: number;\n}\n\n/**\n * Opciones para estilizar componentes\n * \n * @interface StyleOptions\n * @description Configuración de dimensiones y espaciado para elementos visuales\n */\nexport interface StyleOptions {\n width?: number;\n height?: number;\n padding?: string;\n}\n\n/**\n * Configuración de colores adaptativos para temas claro/oscuro\n * \n * @interface AdaptiveColors\n * @description Define colores que se ajustan automáticamente al tema del navegador\n */\nexport interface AdaptiveColors {\n light: string;\n dark: string;\n}\n\n/**\n * Configuración de espaciado para elementos del log\n * @typedef {'compact' | 'normal' | 'spacious'} SpacingType\n * \n * @description\n * - compact: Espaciado mínimo para más densidad\n * - normal: Espaciado estándar balanceado\n * - spacious: Espaciado amplio para mejor legibilidad\n */\nexport type SpacingType = 'compact' | 'normal' | 'spacious';\n\n/**\n * Configuración de layout para la estructura del log\n * \n * @interface LogLayout\n * @description Define cómo se organizan visualmente los elementos del log\n */\nexport interface LogLayout {\n spacing: SpacingType;\n innerPadding?: string;\n outerMargin?: string;\n separator?: string;\n}\n\n/**\n * Configuración para partes individuales del log\n * \n * @interface LogPartConfig\n * @description Permite personalizar cada elemento del log por separado\n * \n * @example\n * const timestampConfig: LogPartConfig = {\n * show: true,\n * color: '#888',\n * font: 'Monaco',\n * size: '11px'\n * };\n */\nexport interface LogPartConfig {\n show?: boolean;\n style?: string;\n font?: string;\n size?: string;\n color?: string; // Automatically adaptive by default\n background?: string;\n padding?: string;\n margin?: string;\n border?: string;\n shadow?: string;\n uppercase?: boolean;\n}\n\n/**\n * Configuración completa de estilos del log\n * \n * @interface LogStyles\n * @description Agrupa todas las opciones de estilo en una sola configuración\n * @since 0.3.0\n */\nexport interface LogStyles {\n layout?: LogLayout;\n timestamp?: LogPartConfig;\n level?: LogPartConfig;\n prefix?: LogPartConfig;\n message?: LogPartConfig;\n location?: LogPartConfig;\n backdrop?: string;\n transparency?: number;\n}\n\nexport interface TimerResult {\n label: string;\n duration: number;\n startTime: number;\n endTime: number;\n}\n\nexport interface IScopedLogger {\n debug(...args: any[]): void;\n info(...args: any[]): void;\n warn(...args: any[]): void;\n error(...args: any[]): void;\n success(...args: any[]): void;\n critical(...args: any[]): void;\n trace(...args: any[]): void;\n\n badges(badges: string[]): this;\n badge(badge: string): this;\n clearBadges(): this;\n\n time(label: string): void;\n timeEnd(label: string): number | undefined;\n\n style(presetName: string): this;\n}\n\nexport interface IAPILogger extends IScopedLogger {\n slow(message: string, duration?: number): void;\n rateLimit(message: string): void;\n auth(message: string): void;\n deprecated(message: string): void;\n}\n\nexport interface IComponentLogger extends IScopedLogger {\n lifecycle(event: string, message?: string): void;\n stateChange(from: string, to: string, data?: any): void;\n propsChange(changes: Record<string, any>): void;\n}\n\nexport interface Bindings {\n scope?: string;\n badges?: string[];\n type?: 'scope' | 'api' | 'component';\n context?: string[];\n}\n\nexport type BadgeStyle = 'brackets' | 'rounded' | 'plain' | 'unicode' | 'pill';\n\nexport type TimestampFormat = 'iso' | 'time' | 'timeMs' | 'relative' | 'elapsed' | 'date' | 'custom';\n\nexport type ColumnAlign = 'left' | 'right' | 'center';\n\nexport interface ColumnConfig {\n content: string;\n width?: number;\n align?: ColumnAlign;\n color?: string;\n}\n\nexport interface LogOptions {\n rightAlign?: string;\n columns?: ColumnConfig[];\n maxWidth?: number;\n keyValue?: boolean;\n badgeStyle?: BadgeStyle;\n timestampFormat?: TimestampFormat;\n}\n\n// ===== CLI PRIMITIVES (v5.0) =====\n\n/**\n * CLI verbosity levels for controlling primitive output\n * @since 5.0.0\n */\nexport type CLILogLevel = 'silent' | 'quiet' | 'normal' | 'verbose' | 'debug';\n\n/**\n * Handle returned by logger.spinner() for controlling spinner lifecycle\n * @since 5.0.0\n */\nexport interface ISpinnerHandle {\n /** Start the spinner animation */\n start(): void;\n /** Stop the spinner without a status message */\n stop(): void;\n /** Stop the spinner with a success message */\n succeed(msg?: string): void;\n /** Stop the spinner with a failure message */\n fail(msg?: string): void;\n /** Update the spinner text while running */\n text(msg: string): void;\n}\n\n/**\n * Options for logger.box() output\n * @since 5.0.0\n */\nexport interface IBoxOptions {\n /** Title displayed in the top border */\n title?: string;\n /** Color of the border (hex, CSS name, or ANSI name) */\n borderColor?: string;\n /** Border character style */\n borderStyle?: 'single' | 'double' | 'rounded' | 'bold';\n /** Inner padding lines (default: 0) */\n padding?: number;\n}\n\n/**\n * Options for logger.cliTable() output\n * @since 5.0.0\n */\nexport interface ITableOptions {\n /** Column names to display (overrides auto-detection) */\n columns?: string[];\n /** Header labels (defaults to column names) */\n head?: string[];\n}","import type {\n TransportRecord,\n TransportTarget,\n TransportOptions,\n ITransport,\n ITransportManager,\n LogLevel\n} from '../types/index.js';\nimport { LOG_LEVELS } from '../types/index.js';\n\nfunction generateTransportId(): string {\n return `transport-${Date.now()}-${Math.random().toString(36).substr(2, 6)}`;\n}\n\ninterface TransportEntry {\n id: string;\n transport: ITransport;\n options: TransportOptions;\n level: LogLevel;\n levelValue: number;\n}\n\nexport class TransportManager implements ITransportManager {\n private transports: Map<string, TransportEntry> = new Map();\n private defaultLevel: LogLevel = 'info';\n\n constructor(defaultLevel?: LogLevel) {\n if (defaultLevel) {\n this.defaultLevel = defaultLevel;\n }\n }\n\n add(target: TransportTarget): string {\n const id = generateTransportId();\n const level = target.level || this.defaultLevel;\n\n let transport: ITransport;\n\n if (typeof target.target === 'string') {\n throw new Error(`String transport targets not supported. Use inline transport object.`);\n } else {\n transport = target.target;\n }\n\n const entry: TransportEntry = {\n id,\n transport,\n options: target.options || {},\n level,\n levelValue: LOG_LEVELS[level]\n };\n\n this.transports.set(id, entry);\n return id;\n }\n\n remove(id: string): boolean {\n const entry = this.transports.get(id);\n if (entry) {\n entry.transport.close?.();\n return this.transports.delete(id);\n }\n return false;\n }\n\n async write(record: TransportRecord): Promise<void> {\n const promises: Promise<void>[] = [];\n\n for (const entry of this.transports.values()) {\n if (record.levelValue < entry.levelValue) {\n continue;\n }\n\n let transformedRecord = record;\n if (entry.options.transform) {\n const result = entry.options.transform(record);\n if (result === null) continue;\n transformedRecord = result;\n }\n\n const result = entry.transport.write(transformedRecord);\n if (result instanceof Promise) {\n promises.push(result);\n }\n }\n\n await Promise.all(promises);\n }\n\n async flush(): Promise<void> {\n const promises: Promise<void>[] = [];\n\n for (const entry of this.transports.values()) {\n if (entry.transport.flush) {\n const result = entry.transport.flush();\n if (result instanceof Promise) {\n promises.push(result);\n }\n }\n }\n\n await Promise.all(promises);\n }\n\n async close(): Promise<void> {\n await this.flush();\n\n const promises: Promise<void>[] = [];\n\n for (const entry of this.transports.values()) {\n if (entry.transport.close) {\n const result = entry.transport.close();\n if (result instanceof Promise) {\n promises.push(result);\n }\n }\n }\n\n await Promise.all(promises);\n this.transports.clear();\n }\n\n get count(): number {\n return this.transports.size;\n }\n\n list(): string[] {\n return Array.from(this.transports.keys());\n }\n}\n","/**\n * @fileoverview Theme presets for Advanced Logger\n */\n\nimport type { ThemeVariant } from '../types/index.js';\nimport type { LevelStyleConfig } from '../utils/index.js';\n\n/**\n * Theme configurations for different visual styles\n */\nexport const THEME_PRESETS: Record<ThemeVariant, Record<string, LevelStyleConfig>> = {\n default: {\n debug: {\n emoji: '🐞', label: 'DEBUG',\n background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',\n color: '#ffffff', border: '1px solid #667eea',\n shadow: '0 2px 4px rgba(102, 126, 234, 0.3)',\n },\n info: {\n emoji: 'ℹ️', label: 'INFO',\n background: 'linear-gradient(135deg, #74b9ff 0%, #0984e3 100%)',\n color: '#ffffff', border: '1px solid #74b9ff',\n shadow: '0 2px 4px rgba(116, 185, 255, 0.3)',\n },\n warn: {\n emoji: '⚠️', label: 'WARN',\n background: 'linear-gradient(135deg, #fdcb6e 0%, #e17055 100%)',\n color: '#2d3436', border: '1px solid #fdcb6e',\n shadow: '0 2px 4px rgba(253, 203, 110, 0.3)',\n },\n error: {\n emoji: '❌', label: 'ERROR',\n background: 'linear-gradient(135deg, #e84393 0%, #d63031 100%)',\n color: '#ffffff', border: '1px solid #e84393',\n shadow: '0 2px 4px rgba(232, 67, 147, 0.3)',\n },\n success: {\n emoji: '✅', label: 'SUCCESS',\n background: 'linear-gradient(135deg, #00b894 0%, #00a085 100%)',\n color: '#ffffff', border: '1px solid #00b894',\n shadow: '0 2px 4px rgba(0, 184, 148, 0.3)',\n },\n critical: {\n emoji: '🔥', label: 'CRITICAL',\n background: 'linear-gradient(135deg, #ff3838 0%, #ff1744 100%)',\n color: '#ffffff', border: '2px solid #ff3838',\n shadow: '0 4px 8px rgba(255, 56, 56, 0.5)',\n },\n },\n dark: {\n debug: {\n emoji: '🌙', label: 'DEBUG',\n background: 'linear-gradient(135deg, #2d3748 0%, #4a5568 100%)',\n color: '#e2e8f0', border: '1px solid #4a5568',\n shadow: '0 2px 4px rgba(45, 55, 72, 0.8)',\n },\n info: {\n emoji: '💡', label: 'INFO',\n background: 'linear-gradient(135deg, #1a202c 0%, #2d3748 100%)',\n color: '#90cdf4', border: '1px solid #3182ce',\n shadow: '0 2px 4px rgba(26, 32, 44, 0.8)',\n },\n warn: {\n emoji: '⚡', label: 'WARN',\n background: 'linear-gradient(135deg, #744210 0%, #975a16 100%)',\n color: '#faf089', border: '1px solid #d69e2e',\n shadow: '0 2px 4px rgba(116, 66, 16, 0.8)',\n },\n error: {\n emoji: '💀', label: 'ERROR',\n background: 'linear-gradient(135deg, #742a2a 0%, #9b2c2c 100%)',\n color: '#feb2b2', border: '1px solid #e53e3e',\n shadow: '0 2px 4px rgba(116, 42, 42, 0.8)',\n },\n success: {\n emoji: '🎯', label: 'SUCCESS',\n background: 'linear-gradient(135deg, #276749 0%, #2f855a 100%)',\n color: '#9ae6b4', border: '1px solid #38a169',\n shadow: '0 2px 4px rgba(39, 103, 73, 0.8)',\n },\n critical: {\n emoji: '💥', label: 'CRITICAL',\n background: 'linear-gradient(135deg, #1a1a1a 0%, #ff0000 100%)',\n color: '#ffffff', border: '2px solid #ff0000',\n shadow: '0 4px 8px rgba(255, 0, 0, 0.9)',\n },\n },\n neon: {\n debug: {\n emoji: '⚡', label: 'DEBUG',\n background: 'linear-gradient(135deg, #0f3460 0%, #e94560 100%)',\n color: '#00ffff', border: '1px solid #00ffff',\n shadow: '0 0 10px rgba(0, 255, 255, 0.5)',\n },\n info: {\n emoji: '🔮', label: 'INFO',\n background: 'linear-gradient(135deg, #16213e 0%, #0f3460 100%)',\n color: '#00ff41', border: '1px solid #00ff41',\n shadow: '0 0 10px rgba(0, 255, 65, 0.5)',\n },\n warn: {\n emoji: '⚠️', label: 'WARN',\n background: 'linear-gradient(135deg, #533a03 0%, #e94560 100%)',\n color: '#ffff00', border: '1px solid #ffff00',\n shadow: '0 0 10px rgba(255, 255, 0, 0.5)',\n },\n error: {\n emoji: '💥', label: 'ERROR',\n background: 'linear-gradient(135deg, #5c0a0a 0%, #ff073a 100%)',\n color: '#ff073a', border: '1px solid #ff073a',\n shadow: '0 0 10px rgba(255, 7, 58, 0.8)',\n },\n success: {\n emoji: '✨', label: 'SUCCESS',\n background: 'linear-gradient(135deg, #0a5c0a 0%, #39ff14 100%)',\n color: '#39ff14', border: '1px solid #39ff14',\n shadow: '0 0 10px rgba(57, 255, 20, 0.8)',\n },\n critical: {\n emoji: '🌟', label: 'CRITICAL',\n background: 'linear-gradient(135deg, #000000 0%, #ff0080 100%)',\n color: '#ff0080', border: '2px solid #ff0080',\n shadow: '0 0 20px rgba(255, 0, 128, 1)',\n },\n },\n minimal: {\n debug: {\n emoji: '', label: 'DEBUG',\n background: '#f7fafc', color: '#4a5568',\n border: '1px solid #e2e8f0', shadow: 'none',\n },\n info: {\n emoji: '', label: 'INFO',\n background: '#ebf8ff', color: '#2b6cb0',\n border: '1px solid #bee3f8', shadow: 'none',\n },\n warn: {\n emoji: '', label: 'WARN',\n background: '#fffbf0', color: '#c05621',\n border: '1px solid #fed7aa', shadow: 'none',\n },\n error: {\n emoji: '', label: 'ERROR',\n background: '#fef5f5', color: '#c53030',\n border: '1px solid #fca5a5', shadow: 'none',\n },\n success: {\n emoji: '', label: 'SUCCESS',\n background: '#f0fff4', color: '#2f855a',\n border: '1px solid #9ae6b4', shadow: 'none',\n },\n critical: {\n emoji: '', label: 'CRITICAL',\n background: '#fef5f5', color: '#e53e3e',\n border: '2px solid #f56565', shadow: 'none',\n },\n },\n // Additional theme variants can be added here\n light: {\n debug: {\n emoji: '🔍', label: 'DEBUG',\n background: 'linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%)',\n color: '#1565c0', border: '1px solid #90caf9',\n shadow: '0 1px 3px rgba(33, 150, 243, 0.2)',\n },\n info: {\n emoji: 'ℹ️', label: 'INFO',\n background: 'linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%)',\n color: '#7b1fa2', border: '1px solid #ce93d8',\n shadow: '0 1px 3px rgba(156, 39, 176, 0.2)',\n },\n warn: {\n emoji: '⚠️', label: 'WARN',\n background: 'linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%)',\n color: '#f57c00', border: '1px solid #ffcc02',\n shadow: '0 1px 3px rgba(255, 152, 0, 0.2)',\n },\n error: {\n emoji: '❌', label: 'ERROR',\n background: 'linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%)',\n color: '#d32f2f', border: '1px solid #f44336',\n shadow: '0 1px 3px rgba(244, 67, 54, 0.2)',\n },\n success: {\n emoji: '✅', label: 'SUCCESS',\n background: 'linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%)',\n color: '#388e3c', border: '1px solid #4caf50',\n shadow: '0 1px 3px rgba(76, 175, 80, 0.2)',\n },\n critical: {\n emoji: '🚨', label: 'CRITICAL',\n background: 'linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%)',\n color: '#c2185b', border: '2px solid #e91e63',\n shadow: '0 2px 6px rgba(233, 30, 99, 0.3)',\n },\n },\n cyberpunk: {\n debug: {\n emoji: '🤖', label: 'DEBUG',\n background: 'linear-gradient(135deg, #0d1b2a 0%, #415a77 100%)',\n color: '#00d4aa', border: '1px solid #00d4aa',\n shadow: '0 0 15px rgba(0, 212, 170, 0.4)',\n },\n info: {\n emoji: '🔗', label: 'INFO',\n background: 'linear-gradient(135deg, #1b263b 0%, #0d1b2a 100%)',\n color: '#00b4d8', border: '1px solid #00b4d8',\n shadow: '0 0 15px rgba(0, 180, 216, 0.4)',\n },\n warn: {\n emoji: '⚡', label: 'WARN',\n background: 'linear-gradient(135deg, #f72585 0%, #b5179e 100%)',\n color: '#ffff3f', border: '1px solid #ffff3f',\n shadow: '0 0 15px rgba(255, 255, 63, 0.4)',\n },\n error: {\n emoji: '💀', label: 'ERROR',\n background: 'linear-gradient(135deg, #7209b7 0%, #480ca8 100%)',\n color: '#ff006e', border: '1px solid #ff006e',\n shadow: '0 0 15px rgba(255, 0, 110, 0.6)',\n },\n success: {\n emoji: '⚡', label: 'SUCCESS',\n background: 'linear-gradient(135deg, #003566 0%, #001d3d 100%)',\n color: '#00f5ff', border: '1px solid #00f5ff',\n shadow: '0 0 15px rgba(0, 245, 255, 0.4)',\n },\n critical: {\n emoji: '💥', label: 'CRITICAL',\n background: 'linear-gradient(135deg, #000000 0%, #ff0040 100%)',\n color: '#ff0040', border: '2px solid #ff0040',\n shadow: '0 0 25px rgba(255, 0, 64, 0.8)',\n },\n },\n};","/**\n * @fileoverview Banner configurations for Advanced Logger\n */\n\nimport type { BannerType, ThemeVariant } from '../types/index.js';\n\n/**\n * Banner variants for different display capabilities\n */\nexport const BANNER_VARIANTS = {\n simple: {\n text: '🚀 ADVANCED LOGGER v2.0.0 - State-of-the-art Console Styling 🚀',\n style: 'background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 12px 20px; border-radius: 8px; font-weight: bold; font-size: 14px;'\n },\n ascii: {\n text: `\n ___ ____ _ __ ___ _ __ _____ _____ ____ __ ___ _____ _____ _____ ____ \n / _ \\\\ / __ \\\\| | / / / _ \\\\ | \\\\ | |/ ____| ____| _ \\\\ | | / _ \\\\ / ____| ___| _ | _ \\\\ \n / /_\\\\ \\\\ / / _\\` | |/ / / /_\\\\ \\\\ | \\\\| | | | |__ | | | | | | / / \\\\ \\\\| | __| |_ | |_| | |_) |\n | _ || | (_| | < | _ | | . \\` | | | __| | | | | | | | | | | | |_ | _| | /| _ < \n | | | |\\\\ \\\\__,_|_|\\\\_\\\\ | | | | | |\\\\ | |___| |____| |_| | | |__\\\\ \\\\_/ /| |__| | |___| |\\\\ \\\\| |_) |\n \\\\_| |_/ \\\\____/ \\\\_| |_/ |_| \\\\_|\\\\_____|______|____/ |_____/\\\\___/ \\\\_____|_____|_| \\\\_|____/\n\n Advanced Logger v2.0.0 - Console Excellence`,\n style: 'font-family: \"Courier New\", Consolas, Monaco, monospace; color: #667eea; font-size: 11px; line-height: 1.2;'\n },\n unicode: {\n text: `\n╔══════════════════════════════════════════════════════════════════════════╗\n║ 🚀 ADVANCED LOGGER v2.0.0 ║\n║ State-of-the-art Console Styling ║ \n╚══════════════════════════════════════════════════════════════════════════╝`,\n style: 'font-family: \"Courier New\", Consolas, Monaco, monospace; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 15px; border-radius: 8px; font-size: 12px; line-height: 1.3;'\n },\n svg: {\n text: ' ',\n style: `\n background-image: url(\"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 80'><defs><linearGradient id='grad' x1='0%' y1='0%' x2='100%' y2='0%'><stop offset='0%' style='stop-color:%23667eea'/><stop offset='100%' style='stop-color:%23764ba2'/></linearGradient></defs><rect width='100%' height='100%' fill='url(%23grad)' rx='8'/><text x='200' y='30' text-anchor='middle' fill='white' font-family='monospace' font-size='14' font-weight='bold'>🚀 ADVANCED LOGGER</text><text x='200' y='50' text-anchor='middle' fill='white' font-family='monospace' font-size='12'>State-of-the-art Console Styling</text><text x='200' y='65' text-anchor='middle' fill='white' font-family='monospace' font-size='10'>v2.0.0</text></svg>\");\n background-repeat: no-repeat;\n background-size: 400px 80px;\n padding: 40px 200px;\n color: transparent;\n display: inline-block;\n border-radius: 8px;\n `\n },\n animated: {\n text: ' 🚀 ADVANCED LOGGER v2.0.0 ',\n style: `\n background: linear-gradient(-45deg, #667eea, #764ba2, #667eea, #764ba2);\n background-size: 400% 400%;\n color: white;\n padding: 15px 25px;\n border-radius: 10px;\n font-weight: bold;\n font-size: 14px;\n font-family: monospace;\n animation: gradientShift 3s ease infinite;\n display: inline-block;\n `\n }\n};\n\n/**\n * Theme-specific banners for enhanced visual theming\n */\nexport const THEME_BANNERS: Record<ThemeVariant, { simple: string; style: string }> = {\n default: {\n simple: '🚀 ADVANCED LOGGER v2.0.0 - State-of-the-art Console Styling 🚀',\n style: 'background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 12px 20px; border-radius: 8px; font-weight: bold;'\n },\n dark: {\n simple: '🌙 ADVANCED LOGGER v2.0.0 - Dark Mode Console Excellence 🌙',\n style: 'background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%); color: #e2e8f0; padding: 12px 20px; border-radius: 8px; font-weight: bold; border: 1px solid #4a5568;'\n },\n neon: {\n simple: '⚡ ADVANCED LOGGER v2.0.0 - Cyberpunk Console Experience ⚡',\n style: 'background: linear-gradient(135deg, #0f3460 0%, #e94560 100%); color: #00ffff; padding: 12px 20px; border-radius: 8px; font-weight: bold; text-shadow: 0 0 10px #00ffff;'\n },\n minimal: {\n simple: 'ADVANCED LOGGER v2.0.0 - Clean Console Styling',\n style: 'background: #f7fafc; color: #2d3748; padding: 8px 16px; border: 1px solid #e2e8f0; border-radius: 4px; font-weight: 500;'\n },\n light: {\n simple: '☀️ ADVANCED LOGGER v2.0.0 - Bright Console Styling ☀️',\n style: 'background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); color: #495057; padding: 12px 20px; border-radius: 8px; font-weight: bold; border: 1px solid #dee2e6;'\n },\n cyberpunk: {\n simple: '🤖 ADVANCED LOGGER v2.0.0 - Neural Console Interface 🤖',\n style: 'background: linear-gradient(135deg, #0d1b2a 0%, #415a77 100%); color: #00d4aa; padding: 12px 20px; border-radius: 8px; font-weight: bold; text-shadow: 0 0 10px #00d4aa; border: 1px solid #00d4aa;'\n }\n};\n\n/**\n * Feature detection for banner capabilities\n */\nexport function detectBannerCapabilities(): BannerType {\n // Try to detect browser capabilities\n const userAgent = navigator.userAgent;\n const isChrome = /Chrome/.test(userAgent);\n const isFirefox = /Firefox/.test(userAgent);\n const isSafari = /Safari/.test(userAgent) && !/Chrome/.test(userAgent);\n \n // Check for SVG support (most modern browsers)\n const supportsSVG = !!document.createElementNS && \n !!document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect;\n \n // Check for CSS animation support\n const supportsAnimations = typeof document !== 'undefined' && \n 'animationName' in document.createElement('div').style;\n \n // Progressive enhancement\n if (supportsAnimations && isChrome) {\n return 'animated';\n } else if (supportsSVG && (isChrome || isFirefox)) {\n return 'svg';\n } else if (isChrome || isFirefox) {\n return 'unicode';\n } else if (isSafari) {\n return 'ascii';\n }\n \n return 'simple';\n}\n\n/**\n * Display initialization banner with advanced styling\n */\nexport function displayInitBanner(bannerType?: BannerType): void {\n const selectedType = bannerType || detectBannerCapabilities();\n const banner = BANNER_VARIANTS[selectedType];\n \n // Add CSS animation keyframes if needed\n if (selectedType === 'animated') {\n const style = document.createElement('style');\n style.textContent = `\n @keyframes gradientShift {\n 0% { background-position: 0% 50%; }\n 50% { background-position: 100% 50%; }\n 100% { background-position: 0% 50%; }\n }\n `;\n document.head.appendChild(style);\n }\n \n console.log(`%c${banner.text}`, banner.style);\n\n // Show feature highlights\n const features = [\n '🎨 Advanced CSS Console Styling',\n '📍 Automatic Stack Trace Parsing',\n '🔧 Scoped Loggers & Prefixes',\n '⚡ Performance Timers',\n '🎯 Verbosity Filtering',\n '🔌 Extensible Handlers',\n '📱 Modern TypeScript Patterns',\n '📤 Export & Clipboard Support'\n ];\n\n console.group(`%c✨ Features`, 'background: #f8f9fa; color: #495057; padding: 4px 8px; border-radius: 4px; font-weight: bold;');\n\n features.forEach(feature => {\n console.log(`%c${feature}`, 'color: #6c757d; font-size: 13px;');\n });\n\n console.groupEnd();\n console.log(''); // Add spacing\n}","/**\n * @fileoverview Semantic styling system for Advanced Logger\n */\n\nimport { StyleBuilder } from './StyleBuilder.js';\nimport type { AdaptiveColors } from '../types/index.js';\nimport { ADAPTIVE_COLORS } from '../constants.js';\nimport { getAdaptiveColor } from '../utils/output.js';\n\n/**\n * Base semantic styler with common style methods\n */\nexport abstract class BaseStyler {\n protected builder: StyleBuilder;\n\n constructor(builder: StyleBuilder = new StyleBuilder()) {\n this.builder = builder;\n }\n\n /**\n * Primary brand color (typically blue)\n */\n primary(): this {\n return this.color('#007bff');\n }\n\n /**\n * Secondary color (typically gray)\n */\n secondary(): this {\n return this.color('#6c757d');\n }\n\n /**\n * Accent color for highlights\n */\n accent(): this {\n return this.color('#17a2b8');\n }\n\n /**\n * Muted/subtle color - automatically adaptive\n */\n muted(): this {\n const mutedColors: AdaptiveColors = { light: '#6c757d', dark: '#a0aec0' };\n return this.color(getAdaptiveColor(mutedColors));\n }\n\n /**\n * Success color (green)\n */\n success(): this {\n return this.color('#28a745');\n }\n\n /**\n * Warning color (yellow/orange)\n */\n warning(): this {\n return this.color('#ffc107');\n }\n\n /**\n * Danger/error color (red)\n */\n danger(): this {\n return this.color('#dc3545');\n }\n\n /**\n * Monospace font family\n */\n mono(): this {\n this.builder.font('Monaco, Consolas, \"Courier New\", monospace');\n return this;\n }\n\n /**\n * System font family\n */\n system(): this {\n this.builder.font('system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif');\n return this;\n }\n\n /**\n * Readable font optimized for text\n */\n readable(): this {\n this.builder.font('Georgia, \"Times New Roman\", serif');\n return this;\n }\n\n /**\n * Compact spacing\n */\n compact(): this {\n this.builder.padding('1px 4px').margin('0 1px');\n return this;\n }\n\n /**\n * Spacious layout\n */\n spacious(): this {\n this.builder.padding('6px 12px').margin('2px 4px');\n return this;\n }\n\n /**\n * Inline display\n */\n inline(): this {\n this.builder.display('inline-block');\n return this;\n }\n\n /**\n * Glass morphism effect\n */\n glassmorphic(): this {\n this.builder\n .css('backdrop-filter', 'blur(10px)')\n .css('background', 'rgba(255, 255, 255, 0.1)')\n .border('1px solid rgba(255, 255, 255, 0.2)')\n .rounded('8px');\n return this;\n }\n\n /**\n * Neon glow effect\n */\n neon(): this {\n const neonColor = '#00ffff';\n this.builder\n .color(neonColor)\n .border(`1px solid ${neonColor}`)\n .shadow(`0 0 10px ${neonColor}, 0 0 20px ${neonColor}`)\n .css('text-shadow', `0 0 5px ${neonColor}`);\n return this;\n }\n\n /**\n * Gradient background\n */\n gradient(from: string = '#667eea', to: string = '#764ba2'): this {\n this.builder.bg(`linear-gradient(135deg, ${from} 0%, ${to} 100%)`);\n return this;\n }\n\n /**\n * Bold text\n */\n bold(): this {\n this.builder.bold();\n return this;\n }\n\n /**\n * Set color with automatic adaptation\n */\n protected color(color: string): this {\n this.builder.color(color);\n return this;\n }\n\n /**\n * Build the final CSS string\n */\n build(): string {\n return this.builder.build();\n }\n}\n\n/**\n * Timestamp-specific styling\n */\nexport class TimestampStyler extends BaseStyler {\n /**\n * Default timestamp style - subtle and informative\n */\n default(): this {\n this.muted().mono();\n this.builder.size('11px');\n return this;\n }\n\n /**\n * Hide timestamp\n */\n hidden(): this {\n this.builder.display('none');\n return this;\n }\n\n /**\n * Minimal timestamp (just time, no date)\n */\n minimal(): this {\n this.muted().mono();\n this.builder.size('10px').opacity(0.7);\n return this;\n }\n\n /**\n * Set font size\n */\n size(size: string): this {\n this.builder.size(size);\n return this;\n }\n}\n\n/**\n * Level badge styling\n */\nexport class LevelStyler extends BaseStyler {\n /**\n * Colorful gradient badge\n */\n badge(): this {\n this.builder\n .padding('2px 8px')\n .rounded('4px')\n .bold()\n .color('#ffffff');\n return this;\n }\n\n /**\n * Glowing effect for dark themes\n */\n glowing(): this {\n return this.neon().badge();\n }\n\n /**\n * Minimal flat style\n */\n flat(): this {\n this.builder\n .padding('1px 6px')\n .rounded('2px')\n .border('1px solid currentColor')\n .css('background', 'transparent');\n return this;\n }\n\n /**\n * Uppercase text\n */\n uppercase(): this {\n this.builder.uppercase();\n return this;\n }\n}\n\n/**\n * Prefix styling\n */\nexport class PrefixStyler extends BaseStyler {\n /**\n * Dark theme prefix\n */\n dark(): this {\n const prefixColors: AdaptiveColors = { light: '#2d3748', dark: '#4a5568' };\n const textColors: AdaptiveColors = { light: '#e2e8f0', dark: '#f7fafc' };\n \n this.builder\n .bg(getAdaptiveColor(prefixColors))\n .color(getAdaptiveColor(textColors))\n .padding('2px 6px')\n .rounded('3px')\n .bold()\n .mono()\n .size('11px');\n return this;\n }\n\n /**\n * Light theme prefix\n */\n light(): this {\n this.builder\n .bg('#f8f9fa')\n .color('#495057')\n .padding('2px 6px')\n .rounded('3px')\n .bold()\n .mono()\n .size('11px')\n .border('1px solid #dee2e6');\n return this;\n }\n\n /**\n * Compact prefix\n */\n compact(): this {\n this.builder\n .padding('1px 4px')\n .size('10px')\n .rounded('2px');\n return this;\n }\n}\n\n/**\n * Message text styling\n */\nexport class MessageStyler extends BaseStyler {\n /**\n * Readable message text - automatically adaptive\n */\n readable(): this {\n this.builder\n .color(getAdaptiveColor(ADAPTIVE_COLORS.messageText))\n .system()\n .size('14px');\n return this;\n }\n\n /**\n * Code-style monospace text\n */\n code(): this {\n this.builder\n .mono()\n .size('13px')\n .color(getAdaptiveColor(ADAPTIVE_COLORS.messageText))\n .bg('rgba(0, 0, 0, 0.05)')\n .padding('1px 4px')\n .rounded('3px');\n return this;\n }\n\n /**\n * Large, prominent text\n */\n large(): this {\n this.builder\n .size('16px')\n .color(getAdaptiveColor(ADAPTIVE_COLORS.messageText));\n return this;\n }\n}\n\n/**\n * Location info styling\n */\nexport class LocationStyler extends BaseStyler {\n /**\n * Subtle location info - automatically adaptive\n */\n subtle(): this {\n this.builder\n .color(getAdaptiveColor(ADAPTIVE_COLORS.location))\n .mono()\n .size('11px')\n .opacity(0.7);\n return this;\n }\n\n /**\n * Hide location info\n */\n hidden(): this {\n this.builder.display('none');\n return this;\n }\n\n /**\n * Clickable style (for IDE integration)\n */\n clickable(): this {\n this.subtle();\n this.builder.css('text-decoration', 'underline').cursor('pointer');\n return this;\n }\n}","/**\n * @fileoverview LogStyleBuilder for fluent log styling API\n */\n\nimport type { Logger } from '../Logger.js';\nimport type { LogStyles, LogLayout, SpacingType } from '../types/index.js';\nimport { \n TimestampStyler, \n LevelStyler, \n PrefixStyler, \n MessageStyler, \n LocationStyler \n} from './SemanticStyles.js';\n\n/**\n * Fluent API builder for log styling with semantic methods\n */\nexport class LogStyleBuilder {\n private logStyles: LogStyles = {};\n private logger: Logger;\n\n constructor(logger: Logger) {\n this.logger = logger;\n }\n\n /**\n * Configure timestamp styling\n */\n timestamp(): TimestampStyleBuilderProxy {\n return new TimestampStyleBuilderProxy(this);\n }\n\n /**\n * Configure level badge styling\n */\n level(): LevelStyleBuilderProxy {\n return new LevelStyleBuilderProxy(this);\n }\n\n /**\n * Configure prefix styling\n */\n prefix(): PrefixStyleBuilderProxy {\n return new PrefixStyleBuilderProxy(this);\n }\n\n /**\n * Configure message text styling\n */\n message(): MessageStyleBuilderProxy {\n return new MessageStyleBuilderProxy(this);\n }\n\n /**\n * Configure location info styling\n */\n location(): LocationStyleBuilderProxy {\n return new LocationStyleBuilderProxy(this);\n }\n\n /**\n * Use a predefined preset\n */\n usePreset(presetName: string): LogStyleBuilder {\n // Will be implemented when we create the presets\n console.warn(`Preset '${presetName}' will be available in next implementation phase`);\n return this;\n }\n\n /**\n * Customize with partial configuration\n */\n customize(overrides: Partial<LogStyles>): LogStyleBuilder {\n this.logStyles = { ...this.logStyles, ...overrides };\n return this;\n }\n\n /**\n * Set layout spacing\n */\n spacing(type: SpacingType): LogStyleBuilder {\n if (!this.logStyles.layout) {\n this.logStyles.layout = { spacing: type };\n } else {\n this.logStyles.layout.spacing = type;\n }\n\n // Apply spacing-specific configurations\n switch (type) {\n case 'compact':\n this.logStyles.layout.innerPadding = '1px';\n this.logStyles.layout.outerMargin = '0px';\n break;\n case 'spacious':\n this.logStyles.layout.innerPadding = '4px';\n this.logStyles.layout.outerMargin = '2px';\n break;\n default: // normal\n this.logStyles.layout.innerPadding = '2px';\n this.logStyles.layout.outerMargin = '1px';\n }\n \n return this;\n }\n\n /**\n * Set backdrop filter for glassmorphism effects\n */\n backdrop(filter: string): LogStyleBuilder {\n this.logStyles.backdrop = filter;\n return this;\n }\n\n /**\n * Set overall transparency\n */\n transparency(value: number): LogStyleBuilder {\n this.logStyles.transparency = Math.max(0, Math.min(1, value));\n return this;\n }\n\n /**\n * Apply the configured styles to the logger\n */\n apply(): void {\n // Store the configuration in the logger\n // This will be implemented when we integrate with the main Logger\n (this.logger as any)._customLogStyles = this.logStyles;\n console.log('Applied log styles:', this.logStyles);\n }\n\n /**\n * Get current configuration (for debugging)\n */\n getConfig(): LogStyles {\n return { ...this.logStyles };\n }\n\n /**\n * Internal method to update part configuration\n */\n _updatePartConfig(part: keyof LogStyles, styles: string): void {\n if (part === 'layout' || part === 'backdrop' || part === 'transparency') {\n return; // Skip these non-part configs\n }\n \n if (!this.logStyles[part]) {\n this.logStyles[part] = {};\n }\n \n // Parse basic CSS styles into config\n // This is a simplified approach - in production might want more sophisticated parsing\n this.logStyles[part]!.style = styles;\n }\n}\n\n/**\n * Base proxy class for part-specific styling\n */\nabstract class PartStyleBuilderProxy {\n protected parentBuilder: LogStyleBuilder;\n protected partName: keyof LogStyles;\n\n constructor(parentBuilder: LogStyleBuilder, partName: keyof LogStyles) {\n this.parentBuilder = parentBuilder;\n this.partName = partName;\n }\n\n /**\n * Return to the main builder for chaining other parts\n */\n and(): LogStyleBuilder {\n return this.parentBuilder;\n }\n\n /**\n * Apply styles and finish configuration\n */\n apply(): void {\n this.parentBuilder.apply();\n }\n\n /**\n * Helper to apply styles to the parent builder\n */\n protected applyStyles(styler: any): this {\n const styles = styler.build();\n this.parentBuilder._updatePartConfig(this.partName, styles);\n return this;\n }\n}\n\n/**\n * Timestamp styling proxy with fluent API\n */\nclass TimestampStyleBuilderProxy extends PartStyleBuilderProxy {\n constructor(parentBuilder: LogStyleBuilder) {\n super(parentBuilder, 'timestamp');\n }\n\n default(): TimestampStyleBuilderProxy {\n return this.applyStyles(new TimestampStyler().default());\n }\n\n hidden(): TimestampStyleBuilderProxy {\n return this.applyStyles(new TimestampStyler().hidden());\n }\n\n minimal(): TimestampStyleBuilderProxy {\n return this.applyStyles(new TimestampStyler().minimal());\n }\n\n muted(): TimestampStyleBuilderProxy {\n return this.applyStyles(new TimestampStyler().muted());\n }\n\n mono(): TimestampStyleBuilderProxy {\n return this.applyStyles(new TimestampStyler().mono());\n }\n\n compact(): TimestampStyleBuilderProxy {\n return this.applyStyles(new TimestampStyler().compact());\n }\n}\n\n/**\n * Level badge styling proxy with fluent API\n */\nclass LevelStyleBuilderProxy extends PartStyleBuilderProxy {\n constructor(parentBuilder: LogStyleBuilder) {\n super(parentBuilder, 'level');\n }\n\n badge(): LevelStyleBuilderProxy {\n return this.applyStyles(new LevelStyler().badge());\n }\n\n gradient(from?: string, to?: string): LevelStyleBuilderProxy {\n return this.applyStyles(new LevelStyler().gradient(from, to));\n }\n\n glowing(): LevelStyleBuilderProxy {\n return this.applyStyles(new LevelStyler().glowing());\n }\n\n flat(): LevelStyleBuilderProxy {\n return this.applyStyles(new LevelStyler().flat());\n }\n\n bold(): LevelStyleBuilderProxy {\n return this.applyStyles(new LevelStyler().bold());\n }\n\n uppercase(): LevelStyleBuilderProxy {\n return this.applyStyles(new LevelStyler().uppercase());\n }\n\n neon(): LevelStyleBuilderProxy {\n return this.applyStyles(new LevelStyler().neon());\n }\n}\n\n/**\n * Prefix styling proxy with fluent API\n */\nclass PrefixStyleBuilderProxy extends PartStyleBuilderProxy {\n constructor(parentBuilder: LogStyleBuilder) {\n super(parentBuilder, 'prefix');\n }\n\n dark(): PrefixStyleBuilderProxy {\n return this.applyStyles(new PrefixStyler().dark());\n }\n\n light(): PrefixStyleBuilderProxy {\n return this.applyStyles(new PrefixStyler().light());\n }\n\n compact(): PrefixStyleBuilderProxy {\n return this.applyStyles(new PrefixStyler().compact());\n }\n\n muted(): PrefixStyleBuilderProxy {\n return this.applyStyles(new PrefixStyler().muted());\n }\n\n mono(): PrefixStyleBuilderProxy {\n return this.applyStyles(new PrefixStyler().mono());\n }\n}\n\n/**\n * Message styling proxy with fluent API\n */\nclass MessageStyleBuilderProxy extends PartStyleBuilderProxy {\n constructor(parentBuilder: LogStyleBuilder) {\n super(parentBuilder, 'message');\n }\n\n readable(): MessageStyleBuilderProxy {\n return this.applyStyles(new MessageStyler().readable());\n }\n\n code(): MessageStyleBuilderProxy {\n return this.applyStyles(new MessageStyler().code());\n }\n\n large(): MessageStyleBuilderProxy {\n return this.applyStyles(new MessageStyler().large());\n }\n\n system(): MessageStyleBuilderProxy {\n return this.applyStyles(new MessageStyler().system());\n }\n\n mono(): MessageStyleBuilderProxy {\n return this.applyStyles(new MessageStyler().mono());\n }\n}\n\n/**\n * Location styling proxy with fluent API\n */\nclass LocationStyleBuilderProxy extends PartStyleBuilderProxy {\n constructor(parentBuilder: LogStyleBuilder) {\n super(parentBuilder, 'location');\n }\n\n subtle(): LocationStyleBuilderProxy {\n return this.applyStyles(new LocationStyler().subtle());\n }\n\n hidden(): LocationStyleBuilderProxy {\n return this.applyStyles(new LocationStyler().hidden());\n }\n\n clickable(): LocationStyleBuilderProxy {\n return this.applyStyles(new LocationStyler().clickable());\n }\n\n muted(): LocationStyleBuilderProxy {\n return this.applyStyles(new LocationStyler().muted());\n }\n\n mono(): LocationStyleBuilderProxy {\n return this.applyStyles(new LocationStyler().mono());\n }\n}\n\n/**\n * Create a new LogStyleBuilder instance\n */\nexport function createLogStyleBuilder(logger: Logger): LogStyleBuilder {\n return new LogStyleBuilder(logger);\n}","/**\n * @fileoverview Smart presets for simplified logger configuration\n */\n\nimport type { LogStyles, LogLayout } from '../types/index.js';\n\n/**\n * Smart presets that configure the entire log appearance\n */\nexport const SMART_PRESETS: Record<string, LogStyles> = {\n /**\n * Default preset - works perfectly out-of-the-box\n * Clean, readable, automatically adaptive to dark/light themes\n */\n default: {\n layout: {\n spacing: 'normal',\n innerPadding: '2px',\n outerMargin: '1px'\n },\n timestamp: {\n show: true,\n color: 'auto', // Automatically adaptive\n font: 'Monaco, Consolas, monospace',\n size: '11px'\n },\n level: {\n show: true,\n style: 'badge',\n uppercase: false,\n padding: '2px 8px'\n },\n prefix: {\n show: true,\n style: 'dark', // Automatically adaptive\n padding: '2px 6px'\n },\n message: {\n show: true,\n color: 'auto', // Automatically adaptive\n font: 'system-ui, -apple-system, sans-serif',\n size: '14px'\n },\n location: {\n show: true,\n color: 'auto', // Automatically adaptive\n font: 'Monaco, Consolas, monospace',\n size: '11px'\n }\n },\n\n /**\n * Cyberpunk preset - neon colors, glowing effects, dark theme\n */\n cyberpunk: {\n layout: {\n spacing: 'compact',\n innerPadding: '1px',\n outerMargin: '0px'\n },\n timestamp: {\n show: true,\n color: '#00ffff',\n font: 'Monaco, Consolas, monospace',\n size: '10px',\n style: 'neon'\n },\n level: {\n show: true,\n style: 'glowing',\n uppercase: true,\n padding: '2px 8px'\n },\n prefix: {\n show: true,\n color: '#ff0080',\n background: 'rgba(255, 0, 128, 0.1)',\n border: '1px solid #ff0080',\n style: 'neon'\n },\n message: {\n show: true,\n color: '#00ff41',\n font: 'Monaco, Consolas, monospace',\n size: '13px'\n },\n location: {\n show: false // Hidden for cleaner look\n },\n backdrop: 'blur(2px)',\n transparency: 0.9\n },\n\n /**\n * Glassmorphism preset - modern blur effects, transparency\n */\n glassmorphism: {\n layout: {\n spacing: 'spacious',\n innerPadding: '4px',\n outerMargin: '2px'\n },\n timestamp: {\n show: true,\n color: 'auto',\n font: 'system-ui, sans-serif',\n size: '11px',\n style: 'glassmorphic'\n },\n level: {\n show: true,\n style: 'glassmorphic',\n uppercase: false,\n padding: '4px 12px'\n },\n prefix: {\n show: true,\n style: 'glassmorphic',\n padding: '3px 8px'\n },\n message: {\n show: true,\n color: 'auto',\n font: 'system-ui, sans-serif',\n size: '14px'\n },\n location: {\n show: true,\n color: 'auto',\n font: 'system-ui, sans-serif',\n size: '11px',\n style: 'glassmorphic'\n },\n backdrop: 'blur(10px)',\n transparency: 0.8\n },\n\n /**\n * Minimal preset - clean, no decorations, maximum readability\n */\n minimal: {\n layout: {\n spacing: 'compact',\n innerPadding: '0px',\n outerMargin: '0px'\n },\n timestamp: {\n show: false // Hidden for minimal look\n },\n level: {\n show: true,\n style: 'flat',\n uppercase: true,\n padding: '0px 4px',\n border: 'none',\n background: 'transparent'\n },\n prefix: {\n show: true,\n style: 'flat',\n padding: '0px 4px',\n border: 'none',\n background: 'transparent'\n },\n message: {\n show: true,\n color: 'auto',\n font: 'system-ui, sans-serif',\n size: '14px'\n },\n location: {\n show: false // Hidden for minimal look\n }\n },\n\n /**\n * Debug preset - monospace, detailed, compact for development\n */\n debug: {\n layout: {\n spacing: 'compact',\n innerPadding: '1px',\n outerMargin: '0px'\n },\n timestamp: {\n show: true,\n color: 'auto',\n font: 'Monaco, Consolas, monospace',\n size: '10px'\n },\n level: {\n show: true,\n style: 'compact',\n uppercase: true,\n padding: '1px 4px',\n font: 'Monaco, Consolas, monospace',\n size: '10px'\n },\n prefix: {\n show: true,\n style: 'compact',\n padding: '1px 4px',\n font: 'Monaco, Consolas, monospace',\n size: '10px'\n },\n message: {\n show: true,\n color: 'auto',\n font: 'Monaco, Consolas, monospace',\n size: '12px'\n },\n location: {\n show: true,\n color: 'auto',\n font: 'Monaco, Consolas, monospace',\n size: '10px',\n style: 'clickable'\n }\n },\n\n /**\n * Production preset - clean, essential info only\n */\n production: {\n layout: {\n spacing: 'normal',\n innerPadding: '2px',\n outerMargin: '1px'\n },\n timestamp: {\n show: true,\n color: 'auto',\n font: 'system-ui, sans-serif',\n size: '11px'\n },\n level: {\n show: true,\n style: 'badge',\n uppercase: false,\n padding: '2px 6px'\n },\n prefix: {\n show: false // Hidden in production\n },\n message: {\n show: true,\n color: 'auto',\n font: 'system-ui, sans-serif',\n size: '14px'\n },\n location: {\n show: false // Hidden in production\n }\n }\n};\n\n/**\n * Get a smart preset by name\n */\nexport function getSmartPreset(name: string): LogStyles | null {\n return SMART_PRESETS[name] || null;\n}\n\n/**\n * List all available smart presets\n */\nexport function getAvailablePresets(): string[] {\n return Object.keys(SMART_PRESETS);\n}\n\n/**\n * Check if a preset exists\n */\nexport function hasPreset(name: string): boolean {\n return name in SMART_PRESETS;\n}\n\n/**\n * Preset descriptions for help/documentation\n */\nexport const PRESET_DESCRIPTIONS: Record<string, string> = {\n default: 'Clean, readable, automatically adaptive to dark/light themes',\n cyberpunk: 'Neon colors, glowing effects, perfect for dark themes',\n glassmorphism: 'Modern blur effects with transparency and spacious layout',\n minimal: 'Clean and simple, no decorations, maximum readability',\n debug: 'Monospace fonts, detailed info, compact layout for development',\n production: 'Professional look with essential information only'\n};","import { Logger } from './Logger.js';\nimport type { TimerEntry, Bindings, ISpinnerHandle, IBoxOptions, ITableOptions, CLILogLevel } from './types/index.js';\n\nexport class ScopedLogger {\n private readonly parent: Logger;\n private readonly scopeName: string;\n private badgeList: string[] = [];\n private contextStack: string[] = [];\n private _timers?: Map<string, TimerEntry>;\n\n constructor(parent: Logger, scopeName: string) {\n this.parent = parent;\n this.scopeName = scopeName;\n }\n\n private get timers(): Map<string, TimerEntry> {\n if (!this._timers) this._timers = new Map();\n return this._timers;\n }\n\n private getBindings(): Bindings {\n return {\n scope: this.getScopePrefix(),\n badges: this.badgeList.length > 0 ? [...this.badgeList] : undefined,\n };\n }\n\n private getScopePrefix(): string {\n if (this.contextStack.length === 0) return this.scopeName;\n return [this.scopeName, ...this.contextStack].join(':');\n }\n\n badges(badges: string[]): this {\n this.badgeList = [...badges];\n return this;\n }\n\n badge(badge: string): this {\n if (!this.badgeList.includes(badge)) {\n this.badgeList.push(badge);\n }\n return this;\n }\n\n clearBadges(): this {\n this.badgeList = [];\n return this;\n }\n\n style(presetName: string): this {\n this.parent.setTheme(presetName as any);\n return this;\n }\n\n context(contextName: string): ContextLogger {\n return new ContextLogger(this, contextName);\n }\n\n time(label: string): void {\n this.timers.set(label, {\n label: `${this.scopeName}:${label}`,\n startTime: performance.now(),\n });\n }\n\n timeEnd(label: string): number | undefined {\n const timer = this.timers.get(label);\n if (!timer) {\n this.warn(`Timer '${label}' not found`);\n return undefined;\n }\n const elapsed = performance.now() - timer.startTime;\n this.timers.delete(label);\n this.success(`Timer: ${label} - ${elapsed.toFixed(2)}ms`);\n return elapsed;\n }\n\n debug(...args: any[]): void {\n this.parent.logWithBindings(this.getBindings(), 'debug', ...args);\n }\n\n info(...args: any[]): void {\n this.parent.logWithBindings(this.getBindings(), 'info', ...args);\n }\n\n warn(...args: any[]): void {\n this.parent.logWithBindings(this.getBindings(), 'warn', ...args);\n }\n\n error(...args: any[]): void {\n this.parent.logWithBindings(this.getBindings(), 'error', ...args);\n }\n\n success(...args: any[]): void {\n const bindings = this.getBindings();\n this.parent.logWithBindings(bindings, 'info', ...args);\n }\n\n critical(...args: any[]): void {\n this.parent.logWithBindings(this.getBindings(), 'critical', ...args);\n }\n\n trace(...args: any[]): void {\n this.parent.logWithBindings(this.getBindings(), 'debug', ...args);\n console.trace(`[${this.scopeName}]`);\n }\n\n // ===== CLI PRIMITIVES (v5.0 delegation) =====\n\n /** @see Logger.step */\n step(current: number, total: number, message: string): void {\n this.parent.step(current, total, message);\n }\n\n /** @see Logger.header */\n header(title: string, subtitle?: string): void {\n this.parent.header(title, subtitle);\n }\n\n /** @see Logger.divider */\n divider(): void {\n this.parent.divider();\n }\n\n /** @see Logger.blank */\n blank(): void {\n this.parent.blank();\n }\n\n /** @see Logger.box */\n box(content: string, options?: IBoxOptions): void {\n this.parent.box(content, options);\n }\n\n /** @see Logger.cliTable */\n cliTable(rows: Record<string, unknown>[], options?: ITableOptions): void {\n this.parent.cliTable(rows, options);\n }\n\n /** @see Logger.spinner */\n spinner(message: string): ISpinnerHandle {\n return this.parent.spinner(message);\n }\n\n /** @see Logger.setCLILevel */\n setCLILevel(level: CLILogLevel): void {\n this.parent.setCLILevel(level);\n }\n\n _pushContext(context: string): void {\n this.contextStack.push(context);\n }\n\n _popContext(): void {\n this.contextStack.pop();\n }\n}\n\nexport class APILogger extends ScopedLogger {\n constructor(parent: Logger, apiName: string) {\n super(parent, `API:${apiName}`);\n this.badge('API');\n }\n\n slow(message: string, duration?: number): void {\n this.badge('SLOW');\n const msg = duration ? `${message} (${duration}ms)` : message;\n this.warn(msg);\n }\n\n rateLimit(message: string): void {\n this.badge('RATE_LIMIT');\n this.warn(message);\n }\n\n auth(message: string): void {\n this.badge('AUTH');\n this.error(message);\n }\n\n deprecated(message: string): void {\n this.badge('DEPRECATED');\n this.warn(message);\n }\n}\n\nexport class ComponentLogger extends ScopedLogger {\n constructor(parent: Logger, componentName: string) {\n super(parent, componentName);\n this.badge('COMPONENT');\n }\n\n lifecycle(event: string, message?: string): void {\n this.badge('LIFECYCLE');\n const msg = message ? `${event}: ${message}` : event;\n this.info(msg);\n }\n\n stateChange(from: string, to: string, data?: any): void {\n this.badge('STATE');\n const msg = `${from} → ${to}`;\n if (data) {\n this.info(msg, data);\n } else {\n this.info(msg);\n }\n }\n\n propsChange(changes: Record<string, any>): void {\n this.badge('PROPS');\n this.debug('Props changed:', changes);\n }\n}\n\nexport class ContextLogger {\n private parentLogger: ScopedLogger;\n private contextName: string;\n\n constructor(parentLogger: ScopedLogger, contextName: string) {\n this.parentLogger = parentLogger;\n this.contextName = contextName;\n }\n\n run<T>(fn: () => T): T {\n this.parentLogger._pushContext(this.contextName);\n try {\n return fn();\n } finally {\n this.parentLogger._popContext();\n }\n }\n\n async runAsync<T>(fn: () => Promise<T>): Promise<T> {\n this.parentLogger._pushContext(this.contextName);\n try {\n return await fn();\n } finally {\n this.parentLogger._popContext();\n }\n }\n\n start(): void {\n this.parentLogger._pushContext(this.contextName);\n }\n\n end(): void {\n this.parentLogger._popContext();\n }\n\n debug(...args: any[]): void { this.parentLogger.debug(...args); }\n info(...args: any[]): void { this.parentLogger.info(...args); }\n warn(...args: any[]): void { this.parentLogger.warn(...args); }\n error(...args: any[]): void { this.parentLogger.error(...args); }\n success(...args: any[]): void { this.parentLogger.success(...args); }\n critical(...args: any[]): void { this.parentLogger.critical(...args); }\n}\n","/**\n * @fileoverview Export and clipboard log handler for Advanced Logger\n */\n\nimport type { \n ILogHandler, \n LogLevel, \n LogMetadata, \n LogEntry, \n ExportFilters, \n ExportOptions, \n ExportResult, \n BufferStats,\n ExportFormat\n} from '../types/index.js';\nimport { parseTimeInput, formatDisplayTime } from '../utils/timestamps.js';\nimport { safeStringify, escapeHtml, generateLogId } from '../utils/output.js';\nimport { BUFFER_LIMITS } from '../constants.js';\n\n/**\n * Export log handler with circular buffer and multiple export formats\n */\nexport class ExportLogHandler implements ILogHandler {\n private buffer: LogEntry[] = [];\n private maxSize: number;\n private groupDepth: number = 0;\n private currentGroup?: string;\n\n constructor(maxSize: number = BUFFER_LIMITS.DEFAULT_SIZE) {\n this.maxSize = Math.min(Math.max(maxSize, BUFFER_LIMITS.MIN_SIZE), BUFFER_LIMITS.MAX_SIZE);\n }\n\n /**\n * Handle incoming log and store in buffer\n */\n handle(level: LogLevel, message: string, args: any[], metadata: LogMetadata): void {\n const entry: LogEntry = {\n id: generateLogId(),\n timestamp: metadata.timestamp,\n level,\n prefix: metadata.prefix,\n message,\n args,\n location: metadata.stackInfo,\n groupInfo: this.groupDepth > 0 ? {\n depth: this.groupDepth,\n groupName: this.currentGroup\n } : undefined\n };\n\n // Add to circular buffer\n this.buffer.push(entry);\n if (this.buffer.length > this.maxSize) {\n this.buffer.shift(); // Remove oldest entry\n }\n }\n\n /**\n * Set group tracking for nested logs\n */\n setGroupInfo(depth: number, groupName?: string): void {\n this.groupDepth = depth;\n this.currentGroup = groupName;\n }\n\n /**\n * Get buffer statistics\n */\n getBufferStats(): BufferStats {\n const levelCounts = this.buffer.reduce((acc, entry) => {\n const currentCount = acc[entry.level] ? acc[entry.level] : 0;\n acc[entry.level] = currentCount + 1;\n return acc;\n }, {} as Record<LogLevel, number>);\n\n let oldestLog: Date | undefined;\n let newestLog: Date | undefined;\n \n if (this.buffer.length > 0) {\n const firstEntry = this.buffer[0];\n const lastEntry = this.buffer[this.buffer.length - 1];\n \n if (firstEntry && firstEntry.timestamp) {\n oldestLog = new Date(firstEntry.timestamp);\n }\n \n if (lastEntry && lastEntry.timestamp) {\n newestLog = new Date(lastEntry.timestamp);\n }\n }\n\n return {\n size: this.buffer.length,\n maxSize: this.maxSize,\n usage: (this.buffer.length / this.maxSize) * 100,\n oldestLog,\n newestLog,\n levelCounts: {\n debug: levelCounts.debug ? levelCounts.debug : 0,\n info: levelCounts.info ? levelCounts.info : 0,\n warn: levelCounts.warn ? levelCounts.warn : 0,\n error: levelCounts.error ? levelCounts.error : 0,\n critical: levelCounts.critical ? levelCounts.critical : 0\n }\n };\n }\n\n /**\n * Clear the buffer\n */\n clearBuffer(): void {\n this.buffer = [];\n }\n\n /**\n * Set buffer size (with limits)\n */\n setBufferSize(size: number): void {\n this.maxSize = Math.min(Math.max(size, BUFFER_LIMITS.MIN_SIZE), BUFFER_LIMITS.MAX_SIZE);\n \n // Trim buffer if new size is smaller\n if (this.buffer.length > this.maxSize) {\n this.buffer = this.buffer.slice(-this.maxSize);\n }\n }\n\n /**\n * Filter logs based on criteria\n */\n private filterLogs(filters: ExportFilters = {}): LogEntry[] {\n let filtered = [...this.buffer];\n\n // Filter by levels\n if (filters.levels?.length) {\n filtered = filtered.filter(entry => filters.levels!.includes(entry.level));\n }\n\n // Filter by prefixes\n if (filters.prefixes?.length) {\n filtered = filtered.filter(entry => \n entry.prefix && filters.prefixes!.includes(entry.prefix)\n );\n }\n\n // Exclude prefixes\n if (filters.excludePrefixes?.length) {\n filtered = filtered.filter(entry => \n !entry.prefix || !filters.excludePrefixes!.includes(entry.prefix)\n );\n }\n\n // Filter by time range\n if (filters.since) {\n const sinceDate = parseTimeInput(filters.since);\n filtered = filtered.filter(entry => new Date(entry.timestamp) >= sinceDate);\n }\n\n if (filters.until) {\n const untilDate = parseTimeInput(filters.until);\n filtered = filtered.filter(entry => new Date(entry.timestamp) <= untilDate);\n }\n\n // Filter by stack trace presence\n if (filters.withStackTrace) {\n filtered = filtered.filter(entry => entry.location);\n }\n\n // Filter errors only\n if (filters.errorsOnly) {\n filtered = filtered.filter(entry => entry.level === 'error' || entry.level === 'critical');\n }\n\n // Search in messages\n if (filters.search) {\n const searchTerm = filters.search.toLowerCase();\n filtered = filtered.filter(entry => \n entry.message.toLowerCase().includes(searchTerm) ||\n entry.args.some(arg => \n String(arg).toLowerCase().includes(searchTerm)\n )\n );\n }\n\n // Limit results\n if (filters.last) {\n filtered = filtered.slice(-filters.last);\n }\n\n if (filters.first) {\n filtered = filtered.slice(0, filters.first);\n }\n\n return filtered;\n }\n\n /**\n * Export logs in JSON format\n */\n private exportJSON(logs: LogEntry[], options: ExportOptions): string {\n const data = logs.map(entry => ({\n timestamp: entry.timestamp,\n level: entry.level,\n prefix: entry.prefix,\n message: entry.message,\n ...(options.minimal ? {} : {\n args: entry.args.slice(1),\n location: entry.location,\n groupInfo: entry.groupInfo\n })\n }));\n\n return options.compact \n ? JSON.stringify(data)\n : JSON.stringify(data, null, 2);\n }\n\n /**\n * Export logs in CSV format\n */\n private exportCSV(logs: LogEntry[], options: ExportOptions): string {\n const headers = options.minimal \n ? ['Timestamp', 'Level', 'Prefix', 'Message']\n : ['Timestamp', 'Level', 'Prefix', 'Message', 'File', 'Line', 'Args'];\n\n const rows = logs.map(entry => {\n const baseRow = [\n formatDisplayTime(new Date(entry.timestamp), 'full'),\n entry.level.toUpperCase(),\n entry.prefix || '',\n `\"${entry.message.replace(/\"/g, '\"\"')}\"`\n ];\n\n if (!options.minimal) {\n baseRow.push(\n entry.location?.file || '',\n entry.location?.line?.toString() || '',\n `\"${safeStringify(entry.args.slice(1)).replace(/\"/g, '\"\"')}\"`\n );\n }\n\n return baseRow;\n });\n\n return [headers.join(','), ...rows.map(row => row.join(','))].join('\\n');\n }\n\n /**\n * Export logs in Markdown format\n */\n private exportMarkdown(logs: LogEntry[], options: ExportOptions): string {\n const now = new Date();\n let content = `# Log Export - ${formatDisplayTime(now, 'full')}\\n\\n`;\n\n // Add summary if not minimal\n if (!options.minimal) {\n const summary = this.getBufferStats();\n content += `## Summary\\n`;\n content += `- **Total logs**: ${logs.length}\\n`;\n content += `- **Errors**: ${summary.levelCounts.error + summary.levelCounts.critical}\\n`;\n content += `- **Warnings**: ${summary.levelCounts.warn}\\n\\n`;\n }\n\n // Group by level if specified\n if (options.groupBy === 'level') {\n const grouped = logs.reduce((acc, entry) => {\n const level = entry.level;\n if (!acc[level]) {\n acc[level] = [];\n }\n // We just ensured the array exists above\n const levelArray = acc[level];\n if (levelArray) {\n levelArray.push(entry);\n }\n return acc;\n }, {} as Record<string, LogEntry[]>);\n\n Object.entries(grouped).forEach(([level, entries]) => {\n const emoji = this.getLevelEmoji(level as LogLevel);\n content += `## ${emoji} ${level.toUpperCase()} (${entries.length})\\n\\n`;\n \n entries.forEach(entry => {\n const time = formatDisplayTime(new Date(entry.timestamp), 'time-only');\n const location = entry.location ? ` (${entry.location.file}:${entry.location.line})` : '';\n const prefix = entry.prefix ? ` **${entry.prefix}**:` : '';\n content += `- \\`${time}\\`${prefix} ${entry.message}${location}\\n`;\n });\n content += '\\n';\n });\n } else {\n content += '## Logs\\n\\n';\n logs.forEach(entry => {\n const time = formatDisplayTime(new Date(entry.timestamp), 'time-only');\n const emoji = this.getLevelEmoji(entry.level);\n const location = entry.location ? ` (${entry.location.file}:${entry.location.line})` : '';\n const prefix = entry.prefix ? ` **${entry.prefix}**:` : '';\n content += `- \\`${time}\\` ${emoji}${prefix} ${entry.message}${location}\\n`;\n });\n }\n\n return content;\n }\n\n /**\n * Export logs in plain text format\n */\n private exportPlain(logs: LogEntry[], options: ExportOptions): string {\n return logs.map(entry => {\n const time = formatDisplayTime(new Date(entry.timestamp), options.minimal ? 'time-only' : 'short');\n const level = entry.level.toUpperCase().padEnd(8);\n const prefix = entry.prefix ? `[${entry.prefix}] ` : '';\n const location = (!options.minimal && entry.location) ? ` (${entry.location.file}:${entry.location.line})` : '';\n \n return `${time} ${level} ${prefix}${entry.message}${location}`;\n }).join('\\n');\n }\n\n /**\n * Export logs in HTML format\n */\n private exportHTML(logs: LogEntry[], _options: ExportOptions): string {\n const title = `Log Export - ${formatDisplayTime(new Date(), 'full')}`;\n \n let html = `<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>${title}</title>\n <style>\n body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; margin: 20px; line-height: 1.6; }\n .header { border-bottom: 2px solid #ddd; padding-bottom: 20px; margin-bottom: 20px; }\n .log-entry { margin: 5px 0; padding: 8px; border-radius: 4px; font-family: 'Monaco', 'Consolas', monospace; }\n .timestamp { color: #666; font-size: 0.9em; }\n .level { font-weight: bold; padding: 2px 6px; border-radius: 3px; margin: 0 8px; }\n .prefix { background: #2d3748; color: #e2e8f0; padding: 2px 6px; border-radius: 3px; margin: 0 8px; }\n .location { color: #718096; font-size: 0.9em; }\n .debug { background: #f0f4ff; }\n .info { background: #f0f9ff; }\n .warn { background: #fffbeb; }\n .error { background: #fef2f2; }\n .critical { background: #fef2f2; border-left: 4px solid #dc2626; }\n .level.debug { background: #667eea; color: white; }\n .level.info { background: #74b9ff; color: white; }\n .level.warn { background: #fdcb6e; color: #2d3436; }\n .level.error { background: #e84393; color: white; }\n .level.critical { background: #ff3838; color: white; }\n </style>\n</head>\n<body>\n <div class=\"header\">\n <h1>${title}</h1>\n <p>Generated by Advanced Logger v2.0.0</p>\n </div>\n <div class=\"logs\">`;\n\n logs.forEach(entry => {\n const time = formatDisplayTime(new Date(entry.timestamp), 'full');\n const location = entry.location ? ` <span class=\"location\">(${escapeHtml(entry.location.file)}:${entry.location.line})</span>` : '';\n const prefix = entry.prefix ? ` <span class=\"prefix\">${escapeHtml(entry.prefix)}</span>` : '';\n \n html += `\n <div class=\"log-entry ${entry.level}\">\n <span class=\"timestamp\">${time}</span>\n <span class=\"level ${entry.level}\">${entry.level.toUpperCase()}</span>\n ${prefix}\n <span class=\"message\">${escapeHtml(entry.message)}</span>\n ${location}\n </div>`;\n });\n\n html += `\n </div>\n</body>\n</html>`;\n\n return html;\n }\n\n /**\n * Get emoji for log level\n */\n private getLevelEmoji(level: LogLevel): string {\n const emojis = {\n debug: '🐞',\n info: 'ℹ️',\n warn: '⚠️',\n error: '❌',\n critical: '🔥'\n };\n return emojis[level] || '';\n }\n\n /**\n * Main export function\n */\n export(format: ExportFormat, filters: ExportFilters = {}, options: ExportOptions = {}): ExportResult {\n const filteredLogs = this.filterLogs(filters);\n \n let data: string;\n switch (format) {\n case 'json':\n data = this.exportJSON(filteredLogs, options);\n break;\n case 'csv':\n data = this.exportCSV(filteredLogs, options);\n break;\n case 'markdown':\n data = this.exportMarkdown(filteredLogs, options);\n break;\n case 'plain':\n data = this.exportPlain(filteredLogs, options);\n break;\n case 'html':\n data = this.exportHTML(filteredLogs, options);\n break;\n default:\n throw new Error(`Unsupported export format: ${format}`);\n }\n\n return {\n format,\n data,\n metadata: {\n totalLogs: this.buffer.length,\n filteredLogs: filteredLogs.length,\n exportedAt: new Date().toISOString(),\n filters,\n options\n }\n };\n }\n\n /**\n * Copy to clipboard with fallback\n */\n async copyToClipboard(format: ExportFormat, filters: ExportFilters = {}, options: ExportOptions = {}): Promise<boolean> {\n const result = this.export(format, filters, options);\n \n try {\n if (navigator.clipboard && window.isSecureContext) {\n await navigator.clipboard.writeText(result.data);\n return true;\n } else {\n // Fallback for non-secure contexts\n const textArea = document.createElement('textarea');\n textArea.value = result.data;\n textArea.style.position = 'fixed';\n textArea.style.opacity = '0';\n document.body.appendChild(textArea);\n textArea.focus();\n textArea.select();\n const success = document.execCommand('copy');\n document.body.removeChild(textArea);\n return success;\n }\n } catch (error) {\n console.error('Failed to copy to clipboard:', error);\n return false;\n }\n }\n\n /**\n * Get all logs (for debugging)\n */\n getAllLogs(): LogEntry[] {\n return [...this.buffer];\n }\n\n /**\n * Save export to file with download prompt\n */\n async saveToFile(format: ExportFormat, filters: ExportFilters = {}, options: ExportOptions = {}): Promise<boolean> {\n try {\n const result = this.export(format, filters, options);\n const blob = new Blob([result.data], { \n type: this.getMimeType(format) \n });\n \n const url = URL.createObjectURL(blob);\n const a = document.createElement('a');\n const filename = this.generateFilename(format, filters);\n \n a.href = url;\n a.download = filename;\n a.style.display = 'none';\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n URL.revokeObjectURL(url);\n \n return true;\n } catch (error) {\n console.error('Failed to save file:', error);\n return false;\n }\n }\n\n /**\n * Get MIME type for format\n */\n private getMimeType(format: ExportFormat): string {\n const mimeTypes = {\n json: 'application/json',\n csv: 'text/csv',\n markdown: 'text/markdown',\n plain: 'text/plain',\n html: 'text/html'\n };\n return mimeTypes[format] || 'text/plain';\n }\n\n /**\n * Generate filename with timestamp\n */\n private generateFilename(format: ExportFormat, filters: ExportFilters): string {\n const timestamp = new Date().toISOString().replace(/[:.]/g, '-').slice(0, -5);\n const prefix = filters.prefixes?.length === 1 ? `_${filters.prefixes[0]}` : '';\n const extension = format === 'markdown' ? 'md' : format;\n return `logs${prefix}_${timestamp}.${extension}`;\n }\n\n /**\n * Stream logs to external endpoint\n */\n async streamToEndpoint(endpoint: string, filters: ExportFilters = {}, options: { \n apiKey?: string; \n batchSize?: number; \n format?: ExportFormat \n } = {}): Promise<boolean> {\n try {\n const logs = this.filterLogs(filters);\n const batchSize = options.batchSize || 100;\n const format = options.format || 'json';\n \n // Send in batches\n for (let i = 0; i < logs.length; i += batchSize) {\n const batch = logs.slice(i, i + batchSize);\n const result = this.export(format, {}, { compact: true });\n \n const headers: Record<string, string> = {\n 'Content-Type': 'application/json'\n };\n \n if (options.apiKey) {\n headers['Authorization'] = `Bearer ${options.apiKey}`;\n }\n \n const response = await fetch(endpoint, {\n method: 'POST',\n headers,\n body: JSON.stringify({\n logs: batch,\n metadata: {\n batchIndex: Math.floor(i / batchSize),\n totalBatches: Math.ceil(logs.length / batchSize),\n timestamp: new Date().toISOString()\n }\n })\n });\n \n if (!response.ok) {\n throw new Error(`HTTP ${response.status}: ${response.statusText}`);\n }\n }\n \n return true;\n } catch (error) {\n console.error('Failed to stream logs:', error);\n return false;\n }\n }\n\n /**\n * Create export with metadata enrichment\n */\n exportWithMetadata(format: ExportFormat, filters: ExportFilters = {}, options: ExportOptions = {}): ExportResult {\n const baseResult = this.export(format, filters, options);\n const bufferStats = this.getBufferStats();\n \n return {\n ...baseResult,\n metadata: {\n ...baseResult.metadata,\n bufferStats: bufferStats,\n performance: {\n memoryUsage: this.estimateMemoryUsage(),\n processingTime: Date.now()\n },\n system: {\n userAgent: typeof navigator !== 'undefined' ? navigator.userAgent : 'Node.js',\n timestamp: new Date().toISOString(),\n timezone: Intl.DateTimeFormat().resolvedOptions().timeZone\n }\n } as any\n };\n }\n\n /**\n * Estimate memory usage of buffer\n */\n private estimateMemoryUsage(): number {\n const sampleEntry = this.buffer[0];\n if (!sampleEntry) return 0;\n \n // Rough estimation: JSON.stringify size * buffer length\n const sampleSize = JSON.stringify(sampleEntry).length;\n return sampleSize * this.buffer.length;\n }\n}","/**\n * @fileoverview CLI Command processor for Advanced Logger\n */\n\nimport type { Logger } from '../Logger.js';\n\n/**\n * Base interface for CLI commands\n */\nexport interface ICommand {\n name: string;\n description: string;\n usage: string;\n category?: string;\n aliases?: string[];\n execute(args: string, logger: Logger): void | Promise<void>;\n}\n\n/**\n * Plugin interface for extending CLI functionality\n */\nexport interface ICLIPlugin {\n name: string;\n version: string;\n description: string;\n commands: ICommand[];\n initialize?(processor: CommandProcessor, logger: Logger): void;\n cleanup?(): void;\n}\n\n/**\n * Command history entry\n */\ninterface HistoryEntry {\n command: string;\n timestamp: Date;\n success: boolean;\n}\n\n/**\n * CLI command processor\n */\nexport class CommandProcessor {\n private commands: Map<string, ICommand> = new Map();\n private aliases: Map<string, string> = new Map();\n private plugins: Map<string, ICLIPlugin> = new Map();\n private history: HistoryEntry[] = [];\n private maxHistorySize: number = 100;\n private isInteractiveMode: boolean = false;\n\n /**\n * Register a command\n */\n registerCommand(command: ICommand): void {\n this.commands.set(command.name, command);\n \n // Register aliases\n if (command.aliases) {\n for (const alias of command.aliases) {\n this.aliases.set(alias, command.name);\n }\n }\n }\n \n /**\n * Register a plugin\n */\n registerPlugin(plugin: ICLIPlugin, logger?: Logger): void {\n if (this.plugins.has(plugin.name)) {\n throw new Error(`Plugin ${plugin.name} is already registered`);\n }\n \n this.plugins.set(plugin.name, plugin);\n \n // Register plugin commands\n for (const command of plugin.commands) {\n this.registerCommand(command);\n }\n \n // Initialize plugin\n if (plugin.initialize && logger) {\n plugin.initialize(this, logger);\n }\n }\n \n /**\n * Unregister a plugin\n */\n unregisterPlugin(pluginName: string): void {\n const plugin = this.plugins.get(pluginName);\n if (!plugin) return;\n \n // Remove plugin commands\n for (const command of plugin.commands) {\n this.commands.delete(command.name);\n if (command.aliases) {\n for (const alias of command.aliases) {\n this.aliases.delete(alias);\n }\n }\n }\n \n // Cleanup plugin\n if (plugin.cleanup) {\n plugin.cleanup();\n }\n \n this.plugins.delete(pluginName);\n }\n\n /**\n * Get all registered commands\n */\n getCommands(): ICommand[] {\n return Array.from(this.commands.values());\n }\n\n /**\n * Get a specific command\n */\n getCommand(name: string): ICommand | undefined {\n // Check direct command name\n let command = this.commands.get(name);\n if (command) return command;\n \n // Check aliases\n const aliasTarget = this.aliases.get(name);\n if (aliasTarget) {\n return this.commands.get(aliasTarget);\n }\n \n return undefined;\n }\n \n /**\n * Get command history\n */\n getHistory(): HistoryEntry[] {\n return [...this.history];\n }\n \n /**\n * Clear command history\n */\n clearHistory(): void {\n this.history = [];\n }\n \n /**\n * Get registered plugins\n */\n getPlugins(): ICLIPlugin[] {\n return Array.from(this.plugins.values());\n }\n \n /**\n * Enter interactive mode\n */\n enterInteractiveMode(logger: Logger): void {\n this.isInteractiveMode = true;\n logger.info('🔧 Interactive CLI mode activated. Type /exit to quit, /help for commands.');\n \n // Set up browser console listener for interactive commands\n if (typeof window !== 'undefined') {\n this.setupBrowserInteractiveMode(logger);\n }\n }\n \n /**\n * Exit interactive mode\n */\n exitInteractiveMode(): void {\n this.isInteractiveMode = false;\n }\n \n /**\n * Setup browser interactive mode\n */\n private setupBrowserInteractiveMode(logger: Logger): void {\n // Add global CLI function for browser usage\n (window as any).cli = (commandString: string) => {\n return this.processCommand(`/${commandString}`, logger);\n };\n \n logger.info('💡 Use cli(\"command\") to execute CLI commands in browser console.');\n }\n\n /**\n * Process a CLI command\n */\n async processCommand(commandString: string, logger: Logger): Promise<void> {\n if (!commandString.startsWith('/')) {\n logger.error('Invalid command. Commands must start with /');\n this.addToHistory(commandString, false);\n return;\n }\n\n const parts = commandString.slice(1).split(' ');\n const commandName = parts[0] || '';\n const args = parts.slice(1).join(' ');\n\n const command = this.getCommand(commandName);\n if (!command) {\n logger.error(`Unknown command: ${commandName}. Type /help for available commands.`);\n \n // Suggest similar commands\n const suggestions = this.getSuggestions(commandName);\n if (suggestions.length > 0) {\n logger.info(`📋 Did you mean: ${suggestions.slice(0, 3).join(', ')}?`);\n }\n \n this.addToHistory(commandString, false);\n return;\n }\n\n try {\n await command.execute(args || '', logger);\n this.addToHistory(commandString, true);\n } catch (error) {\n logger.error(`Command '${commandName}' failed:`, error);\n this.addToHistory(commandString, false);\n }\n }\n \n /**\n * Add command to history\n */\n private addToHistory(command: string, success: boolean): void {\n this.history.unshift({\n command,\n timestamp: new Date(),\n success\n });\n \n // Limit history size\n if (this.history.length > this.maxHistorySize) {\n this.history = this.history.slice(0, this.maxHistorySize);\n }\n }\n\n /**\n * Get command suggestions for partial matches\n */\n getSuggestions(partial: string): string[] {\n const commandNames = Array.from(this.commands.keys());\n return commandNames.filter(name => name.startsWith(partial));\n }\n}","/**\n * @fileoverview Configuration commands for Advanced Logger CLI\n */\n\nimport type { ICommand } from '../CommandProcessor.js';\nimport type { Logger } from '../../Logger.js';\nimport type { ThemeVariant, BannerType, Verbosity } from '../../types/index.js';\n\n/**\n * Configuration command handler\n */\nexport class ConfigCommand implements ICommand {\n name = 'config';\n description = 'Show or update logger configuration';\n usage = '/config [json|key=value,...]';\n\n execute(args: string, logger: Logger): void {\n if (!args) {\n this.showStatus(logger);\n return;\n }\n\n try {\n // Try to parse as JSON first\n if (args.startsWith('{')) {\n const config = JSON.parse(args);\n this.applyConfig(config, logger);\n } else {\n // Parse key=value pairs\n const pairs = args.split(',').map(pair => pair.trim().split('='));\n const config: any = {};\n pairs.forEach(([key, value]) => {\n if (key && value) {\n config[key.trim()] = value.trim().replace(/[\"']/g, '');\n }\n });\n this.applyConfig(config, logger);\n }\n } catch (error) {\n logger.error('Invalid config format. Use JSON or key=value pairs:', error);\n logger.info('Examples: /config {\"theme\":\"dark\"} or /config theme=neon,verbosity=debug');\n }\n }\n\n private showStatus(logger: Logger): void {\n const statusData = {\n theme: logger.getConfig().theme || 'default',\n verbosity: logger.getConfig().verbosity,\n colors: logger.getConfig().enableColors,\n timestamps: logger.getConfig().enableTimestamps,\n stackTrace: logger.getConfig().enableStackTrace,\n globalPrefix: logger.getConfig().globalPrefix || 'none',\n bannerType: logger.getConfig().bannerType || 'simple',\n handlers: logger.getHandlers().length\n };\n\n logger.group('⚙️ Logger Configuration');\n logger.table(statusData);\n logger.groupEnd();\n }\n\n private applyConfig(config: any, logger: Logger): void {\n const validKeys = ['theme', 'verbosity', 'enableColors', 'enableTimestamps', 'enableStackTrace', 'globalPrefix', 'bannerType'];\n const applied: string[] = [];\n\n Object.entries(config).forEach(([key, value]) => {\n if (validKeys.includes(key)) {\n if (key === 'theme' && typeof value === 'string') {\n logger.setTheme(value as ThemeVariant);\n applied.push(`${key}=${value}`);\n } else if (key === 'bannerType' && typeof value === 'string') {\n logger.setBannerType(value as BannerType);\n applied.push(`${key}=${value}`);\n } else if (key === 'verbosity') {\n logger.setVerbosity(value as Verbosity);\n applied.push(`${key}=${value}`);\n } else if (key === 'globalPrefix') {\n logger.setGlobalPrefix(value as string);\n applied.push(`${key}=${value}`);\n } else {\n logger.updateConfig({ [key]: value });\n applied.push(`${key}=${value}`);\n }\n } else {\n logger.warn(`Invalid config key: ${key}`);\n }\n });\n\n if (applied.length > 0) {\n logger.success(`Configuration updated: ${applied.join(', ')}`);\n }\n }\n}","/**\n * @fileoverview Theme and banner commands for Advanced Logger CLI\n */\n\nimport type { ICommand } from '../CommandProcessor.js';\nimport type { Logger } from '../../Logger.js';\nimport type { BannerType } from '../../types/index.js';\nimport { THEME_PRESETS, BANNER_VARIANTS } from '../../styling/index.js';\nimport { StyleBuilder } from '../../styling/index.js';\n\n/**\n * Themes command - show available themes\n */\nexport class ThemesCommand implements ICommand {\n name = 'themes';\n description = 'Show available theme presets';\n usage = '/themes';\n\n execute(_args: string, logger: Logger): void {\n logger.group('🎨 Available Themes');\n Object.keys(THEME_PRESETS).forEach(themeName => {\n const preview = (THEME_PRESETS as any)[themeName];\n const previewStyle = new StyleBuilder()\n .bg(preview.info.background)\n .color(preview.info.color)\n .padding('4px 8px')\n .rounded('4px')\n .border(preview.info.border)\n .build();\n \n console.log(`%c${themeName}`, previewStyle, `- ${themeName} theme preview`);\n });\n logger.groupEnd();\n }\n}\n\n/**\n * Banners command - show available banner types\n */\nexport class BannersCommand implements ICommand {\n name = 'banners';\n description = 'Show available banner types';\n usage = '/banners';\n\n execute(_args: string, logger: Logger): void {\n logger.group('🖼️ Available Banner Types');\n Object.keys(BANNER_VARIANTS).forEach(bannerName => {\n const banner = (BANNER_VARIANTS as any)[bannerName];\n console.log(`%c${bannerName}`, 'font-weight: bold; color: #667eea;');\n console.log(`%cPreview:`, 'color: #666; font-size: 12px;');\n \n // Show a mini preview\n if (bannerName === 'simple') {\n console.log(`%c${banner.text}`, banner.style);\n } else if (bannerName === 'ascii') {\n console.log(`%c${banner.text.split('\\n').slice(1, 4).join('\\n')}...`, 'font-family: monospace; color: #667eea; font-size: 10px;');\n } else if (bannerName === 'unicode') {\n console.log(`%c${banner.text}`, banner.style);\n } else {\n console.log(`%c${bannerName} banner`, 'color: #666; font-style: italic;');\n }\n });\n logger.groupEnd();\n }\n}\n\n/**\n * Banner command - change/show banner type\n */\nexport class BannerCommand implements ICommand {\n name = 'banner';\n description = 'Change or show current banner type';\n usage = '/banner [type]';\n\n execute(args: string, logger: Logger): void {\n if (!args) {\n logger.showBanner();\n return;\n }\n\n if (args in BANNER_VARIANTS) {\n logger.setBannerType(args as BannerType);\n logger.showBanner();\n } else {\n logger.error(`Invalid banner type: ${args}. Available: ${Object.keys(BANNER_VARIANTS).join(', ')}`);\n }\n }\n}","/**\n * @fileoverview Status and demo commands for Advanced Logger CLI\n */\n\nimport type { ICommand } from '../CommandProcessor.js';\nimport type { Logger } from '../../Logger.js';\n\n/**\n * Status command - show logger configuration and statistics\n */\nexport class StatusCommand implements ICommand {\n name = 'status';\n description = 'Show current logger status and configuration';\n usage = '/status';\n\n execute(_args: string, logger: Logger): void {\n const config = logger.getConfig();\n const statusData = {\n theme: config.theme ? config.theme : 'default',\n verbosity: config.verbosity,\n colors: config.enableColors,\n timestamps: config.enableTimestamps,\n stackTrace: config.enableStackTrace,\n globalPrefix: config.globalPrefix ? config.globalPrefix : 'none',\n bannerType: config.bannerType ? config.bannerType : 'simple',\n handlers: logger.getHandlers().length,\n bufferSize: config.bufferSize ? config.bufferSize : 1000\n };\n\n logger.group('⚙️ Logger Configuration');\n logger.table(statusData);\n logger.groupEnd();\n\n // Show buffer stats if ExportLogHandler is present\n const exportHandler = logger.getExportHandler();\n if (exportHandler) {\n const bufferStats = exportHandler.getBufferStats();\n logger.group('📊 Buffer Statistics');\n logger.table({\n size: `${bufferStats.size}/${bufferStats.maxSize}`,\n usage: `${bufferStats.usage.toFixed(1)}%`,\n oldestLog: bufferStats.oldestLog ? bufferStats.oldestLog.toISOString() : 'None',\n newestLog: bufferStats.newestLog ? bufferStats.newestLog.toISOString() : 'None',\n errorCount: bufferStats.levelCounts.error + bufferStats.levelCounts.critical,\n warningCount: bufferStats.levelCounts.warn\n });\n logger.groupEnd();\n }\n }\n}\n\n/**\n * Reset command - reset logger to defaults\n */\nexport class ResetCommand implements ICommand {\n name = 'reset';\n description = 'Reset logger configuration to defaults';\n usage = '/reset';\n\n execute(_args: string, logger: Logger): void {\n logger.resetConfig();\n }\n}\n\n/**\n * Demo command - show logger feature demonstration\n */\nexport class DemoCommand implements ICommand {\n name = 'demo';\n description = 'Show comprehensive feature demonstration';\n usage = '/demo';\n\n execute(_args: string, logger: Logger): void {\n logger.group('🎪 Advanced Logger Demo');\n \n // Basic logging demo\n logger.debug('Debug message with detailed information');\n logger.info('Informational message about system state'); \n logger.warn('Warning about deprecated feature');\n logger.error('Error processing user request');\n logger.success('Operation completed successfully');\n logger.critical('Critical system failure detected');\n \n // Advanced features demo\n logger.group('📊 Advanced Features Demo');\n \n // Table demo\n logger.table([\n { feature: 'Styled Console', status: '✅ Active', performance: 'Excellent' },\n { feature: 'Theme System', status: '✅ Active', performance: 'Great' },\n { feature: 'CLI Interface', status: '✅ Active', performance: 'Good' },\n { feature: 'Export System', status: '✅ Active', performance: 'Excellent' }\n ]);\n \n // Timer demo\n logger.time('demo-operation');\n setTimeout(() => {\n logger.timeEnd('demo-operation');\n }, 100);\n \n // SVG demo\n logger.logWithSVG('SVG Demo');\n \n // Animated demo\n logger.logAnimated('🌟 Animated Logger Demo 🌟', 2);\n \n logger.groupEnd();\n logger.groupEnd();\n\n logger.info('Demo completed! Check the console for styled output.');\n }\n}","/**\n * @fileoverview Export and clipboard commands for Advanced Logger CLI\n */\n\nimport type { ICommand } from '../CommandProcessor.js';\nimport type { Logger } from '../../Logger.js';\nimport type { ExportFormat, ExportFilters, ExportOptions, LogLevel } from '../../types/index.js';\nimport { EXPORT_FORMATS } from '../../constants.js';\n\n/**\n * Parse command line arguments into filters and options\n */\nfunction parseArguments(args: string): { filters: ExportFilters; options: ExportOptions; format?: ExportFormat } {\n const filters: ExportFilters = {};\n const options: ExportOptions = {};\n let format: ExportFormat | undefined;\n\n if (!args.trim()) return { filters, options };\n\n // Split args by spaces, but keep quoted strings together\n const argParts = args.match(/(?:[^\\s\"]+|\"[^\"]*\")+/g) || [];\n \n for (let i = 0; i < argParts.length; i++) {\n const arg = argParts[i];\n\n // Skip if arg is null/undefined\n if (!arg) {\n continue;\n }\n\n // Format (first argument without --)\n if (i === 0 && !arg.startsWith('--') && arg in EXPORT_FORMATS) {\n format = arg as ExportFormat;\n continue;\n }\n\n // Parse --flags\n if (arg.startsWith('--')) {\n const [flag, value] = arg.slice(2).split('=');\n \n switch (flag) {\n case 'level':\n case 'levels':\n if (value) {\n filters.levels = value.split(',').map(l => l.trim()) as LogLevel[];\n }\n break;\n case 'since':\n if (value) filters.since = value;\n break;\n case 'until':\n if (value) filters.until = value;\n break;\n case 'prefix':\n case 'prefixes':\n if (value) {\n filters.prefixes = value.split(',').map(p => p.trim());\n }\n break;\n case 'exclude-prefix':\n case 'exclude-prefixes':\n if (value) {\n filters.excludePrefixes = value.split(',').map(p => p.trim());\n }\n break;\n case 'last':\n if (value) filters.last = parseInt(value, 10);\n break;\n case 'first':\n if (value) filters.first = parseInt(value, 10);\n break;\n case 'search':\n if (value) filters.search = value.replace(/['\"]/g, '');\n break;\n case 'with-stack':\n filters.withStackTrace = true;\n break;\n case 'errors-only':\n filters.errorsOnly = true;\n break;\n case 'group-by':\n if (value) {\n filters.groupBy = value as ExportFilters['groupBy'];\n options.groupBy = value as ExportOptions['groupBy'];\n }\n break;\n case 'minimal':\n options.minimal = true;\n break;\n case 'compact':\n options.compact = true;\n break;\n case 'styled':\n options.styled = true;\n break;\n }\n }\n }\n\n return { filters, options, format };\n}\n\n/**\n * Export command - export logs in various formats\n */\nexport class ExportCommand implements ICommand {\n name = 'export';\n description = 'Export logs to various formats';\n usage = '/export <format> [--filter=value] [--option]';\n\n execute(args: string, logger: Logger): void {\n const exportHandler = logger.getExportHandler();\n if (!exportHandler) {\n logger.error('Export handler not available. Make sure ExportLogHandler is registered.');\n return;\n }\n\n const { filters, options, format } = parseArguments(args);\n\n if (!format) {\n logger.error('Format required. Available formats: ' + Object.keys(EXPORT_FORMATS).join(', '));\n logger.info('Usage: /export <format> [--filter=value]');\n logger.info('Example: /export json --level=error,warn --last=50');\n return;\n }\n\n try {\n const result = exportHandler.export(format, filters, options);\n \n // Log success with metadata\n logger.success(`✅ Export completed: ${result.metadata.filteredLogs} logs exported in ${format} format`);\n \n // Show preview for small exports\n if (result.data.length < 1000) {\n logger.group(`📄 Preview (${format.toUpperCase()})`);\n console.log(result.data);\n logger.groupEnd();\n } else {\n logger.info(`📄 Export size: ${(result.data.length / 1024).toFixed(2)}KB`);\n }\n\n // Show metadata\n logger.table({\n format: result.format,\n totalLogs: result.metadata.totalLogs,\n filtered: result.metadata.filteredLogs,\n exported: result.metadata.exportedAt\n });\n\n } catch (error) {\n logger.error('Export failed:', error);\n }\n }\n}\n\n/**\n * Copy command - copy logs to clipboard\n */\nexport class CopyCommand implements ICommand {\n name = 'copy';\n description = 'Copy logs to clipboard';\n usage = '/copy <format> [--filter=value] [--option]';\n\n async execute(args: string, logger: Logger): Promise<void> {\n const exportHandler = logger.getExportHandler();\n if (!exportHandler) {\n logger.error('Export handler not available. Make sure ExportLogHandler is registered.');\n return;\n }\n\n const { filters, options, format } = parseArguments(args);\n\n if (!format) {\n logger.error('Format required. Available formats: ' + Object.keys(EXPORT_FORMATS).join(', '));\n logger.info('Usage: /copy <format> [--filter=value]');\n logger.info('Example: /copy plain --level=error --last=25');\n return;\n }\n\n try {\n const success = await exportHandler.copyToClipboard(format, filters, options);\n \n if (success) {\n const result = exportHandler.export(format, filters, options);\n logger.success(`📋 Copied ${result.metadata.filteredLogs} logs to clipboard (${format} format)`);\n } else {\n logger.error('Failed to copy to clipboard. Browser may not support clipboard API.');\n }\n\n } catch (error) {\n logger.error('Copy failed:', error);\n }\n }\n}\n\n/**\n * Buffer-size command - configure buffer size\n */\nexport class BufferSizeCommand implements ICommand {\n name = 'buffer-size';\n description = 'Set log buffer size';\n usage = '/buffer-size <size>';\n\n execute(args: string, logger: Logger): void {\n const exportHandler = logger.getExportHandler();\n if (!exportHandler) {\n logger.error('Export handler not available.');\n return;\n }\n\n const size = parseInt(args.trim(), 10);\n if (isNaN(size) || size <= 0) {\n logger.error('Invalid buffer size. Must be a positive number.');\n logger.info('Example: /buffer-size 2000');\n return;\n }\n\n exportHandler.setBufferSize(size);\n logger.success(`Buffer size set to ${size}`);\n }\n}\n\n/**\n * Clear-buffer command - clear log buffer\n */\nexport class ClearBufferCommand implements ICommand {\n name = 'clear-buffer';\n description = 'Clear the log buffer';\n usage = '/clear-buffer';\n\n execute(_args: string, logger: Logger): void {\n const exportHandler = logger.getExportHandler();\n if (!exportHandler) {\n logger.error('Export handler not available.');\n return;\n }\n\n const stats = exportHandler.getBufferStats();\n exportHandler.clearBuffer();\n \n logger.success(`✅ Buffer cleared. Removed ${stats.size} log entries.`);\n }\n}\n\n/**\n * Buffer-info command - show buffer information\n */\nexport class BufferInfoCommand implements ICommand {\n name = 'buffer-info';\n description = 'Show buffer statistics and information';\n usage = '/buffer-info';\n\n execute(_args: string, logger: Logger): void {\n const exportHandler = logger.getExportHandler();\n if (!exportHandler) {\n logger.error('Export handler not available.');\n return;\n }\n\n const stats = exportHandler.getBufferStats();\n \n logger.group('📊 Buffer Information');\n logger.table({\n size: `${stats.size}/${stats.maxSize}`,\n usage: `${stats.usage.toFixed(1)}%`,\n oldestLog: stats.oldestLog?.toLocaleString() || 'None',\n newestLog: stats.newestLog?.toLocaleString() || 'None'\n });\n \n logger.group('📈 Log Level Counts');\n logger.table(stats.levelCounts);\n logger.groupEnd();\n \n logger.groupEnd();\n }\n}","/**\n * @fileoverview Help system for Advanced Logger CLI\n */\n\nimport type { ICommand } from './CommandProcessor.js';\nimport type { Logger } from '../Logger.js';\nimport { StyleBuilder } from '../styling/index.js';\n\n/**\n * Help command - show comprehensive CLI help\n */\nexport class HelpCommand implements ICommand {\n name = 'help';\n description = 'Show CLI help and available commands';\n usage = '/help [command]';\n\n execute(_args: string, logger: Logger): void {\n const helpStyle = new StyleBuilder()\n .bg('linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%)')\n .color('#495057')\n .padding('15px 20px')\n .rounded('8px')\n .border('1px solid #dee2e6')\n .font('Monaco, Consolas, monospace')\n .size('13px')\n .build();\n\n const helpText = `\n╭─────────────── ADVANCED LOGGER CLI COMMANDS ─────────────────╮\n│ │\n│ CONFIGURATION │\n│ /config Show current configuration │\n│ /config {json} Apply JSON configuration │\n│ /config key=val Apply key-value configuration │\n│ /themes Show available themes │\n│ /banners Show available banner types │\n│ /banner [type] Change/show banner type │\n│ /status Show logger status & buffer stats │\n│ /demo Show feature demonstration │\n│ /reset Reset to default configuration │\n│ │\n│ EXPORT & CLIPBOARD │\n│ /export <format> Export logs (json|csv|md|plain|html) │\n│ /copy <format> Copy logs to clipboard │\n│ /buffer-size N Set log buffer size │\n│ /buffer-info Show buffer statistics │\n│ /clear-buffer Clear stored logs │\n│ │\n│ EXPORT FILTERS (for export/copy commands) │\n│ --level error,warn Filter by log levels │\n│ --since 2h Logs from last 2 hours │\n│ --until 1h Logs until 1 hour ago │\n│ --prefix API,DB Filter by prefixes │\n│ --exclude-prefix INT Exclude prefixes │\n│ --last 50 Last 50 logs only │\n│ --first 25 First 25 logs only │\n│ --search \"error\" Search in log messages │\n│ --with-stack Only logs with stack traces │\n│ --errors-only Only error + critical logs │\n│ --group-by level Group by level/prefix/hour │\n│ │\n│ EXPORT OPTIONS │\n│ --minimal Minimal output format │\n│ --compact Remove extra whitespace │\n│ --styled Include styling (HTML format) │\n│ │\n├──────────────────── CONFIGURATION OPTIONS ─────────────────┤\n│ │\n│ theme: default | dark | light | neon | minimal | cyberpunk│\n│ bannerType: simple | ascii | unicode | svg | animated │\n│ verbosity: debug | info | warn | error | critical | silent│\n│ enableColors: true | false │\n│ enableTimestamps: true | false │\n│ enableStackTrace: true | false │\n│ globalPrefix: \"string\" │\n│ bufferSize: number (50-10000) │\n│ │\n├──────────────────────── EXAMPLES ──────────────────────────┤\n│ │\n│ Basic Configuration: │\n│ /config {\"theme\":\"dark\",\"verbosity\":\"debug\"} │\n│ /config theme=neon,bufferSize=2000 │\n│ /banner animated Change to animated banner │\n│ │\n│ Export Examples: │\n│ /export json --level=error,warn --last=25 │\n│ /export csv --since=2h --prefix=API │\n│ /export markdown --group-by=level --errors-only │\n│ /export html --styled --since=1h │\n│ │\n│ Clipboard Examples: │\n│ /copy plain --minimal --last=10 │\n│ /copy json --search=\"authentication\" --compact │\n│ /copy csv --since=30m --exclude-prefix=DEBUG │\n│ │\n│ Buffer Management: │\n│ /buffer-size 5000 Increase buffer to 5000 logs │\n│ /buffer-info Show detailed buffer statistics │\n│ /clear-buffer Clear all stored logs │\n│ │\n│ Time Formats: │\n│ --since=2h 2 hours ago │\n│ --since=30m 30 minutes ago │\n│ --since=1d 1 day ago │\n│ --since=\"2024-01-01T10:00:00Z\" Specific ISO date │\n│ │\n╰─────────────────────────────────────────────────────────────╯`;\n\n console.log(`%c${helpText}`, helpStyle);\n\n // Show quick tips\n logger.group('💡 Quick Tips');\n const tips = [\n 'Use /demo to see all logger features in action',\n 'Logs are automatically stored in a circular buffer for export',\n 'Export formats: JSON (structured), CSV (Excel), Markdown (readable), Plain (simple), HTML (styled)',\n 'Time filters support relative (2h, 30m) and absolute (ISO) formats',\n 'Combine multiple filters: /export json --level=error --since=1h --search=\"auth\"',\n 'Use /copy for quick clipboard access instead of /export'\n ];\n \n tips.forEach(tip => {\n logger.info(`• ${tip}`);\n });\n logger.groupEnd();\n }\n}","/**\n * @fileoverview History management commands for CLI\n */\n\nimport type { ICommand } from '../CommandProcessor.js';\nimport type { Logger } from '../../Logger.js';\n\n/**\n * Show command history\n */\nexport class HistoryCommand implements ICommand {\n name = 'history';\n description = 'Show command execution history';\n usage = '/history [limit] - Show recent commands (default: 10)';\n category = 'system';\n aliases = ['hist', 'h'];\n\n execute(args: string, logger: Logger): void {\n const processor = (logger as any).cliProcessor;\n if (!processor) {\n logger.error('CLI processor not available');\n return;\n }\n\n const limit = parseInt(args) || 10;\n const history = processor.getHistory().slice(0, limit);\n \n if (history.length === 0) {\n logger.info('📝 No command history available');\n return;\n }\n\n logger.info(`📋 Last ${history.length} commands:`);\n \n history.forEach((entry: any, index: number) => {\n const status = entry.success ? '✅' : '❌';\n const time = entry.timestamp.toLocaleTimeString();\n logger.info(`${status} [${time}] ${entry.command}`);\n });\n }\n}\n\n/**\n * Clear command history\n */\nexport class ClearHistoryCommand implements ICommand {\n name = 'clearhistory';\n description = 'Clear command execution history';\n usage = '/clearhistory - Remove all command history';\n category = 'system';\n aliases = ['clrhist'];\n\n execute(args: string, logger: Logger): void {\n const processor = (logger as any).cliProcessor;\n if (!processor) {\n logger.error('CLI processor not available');\n return;\n }\n\n processor.clearHistory();\n logger.success('🗑️ Command history cleared');\n }\n}\n\n/**\n * Interactive mode command\n */\nexport class InteractiveCommand implements ICommand {\n name = 'interactive';\n description = 'Enter interactive CLI mode';\n usage = '/interactive - Start interactive command mode';\n category = 'system';\n aliases = ['i', 'repl'];\n\n execute(args: string, logger: Logger): void {\n const processor = (logger as any).cliProcessor;\n if (!processor) {\n logger.error('CLI processor not available');\n return;\n }\n\n processor.enterInteractiveMode(logger);\n }\n}\n\n/**\n * Plugin management command\n */\nexport class PluginsCommand implements ICommand {\n name = 'plugins';\n description = 'List loaded CLI plugins';\n usage = '/plugins - Show all registered plugins';\n category = 'system';\n aliases = ['plug'];\n\n execute(args: string, logger: Logger): void {\n const processor = (logger as any).cliProcessor;\n if (!processor) {\n logger.error('CLI processor not available');\n return;\n }\n\n const plugins = processor.getPlugins();\n \n if (plugins.length === 0) {\n logger.info('🔌 No plugins registered');\n return;\n }\n\n logger.info(`🔌 Loaded plugins (${plugins.length}):`);\n \n plugins.forEach((plugin: any) => {\n logger.info(` 📦 ${plugin.name} v${plugin.version} - ${plugin.description}`);\n logger.info(` Commands: ${plugin.commands.map((c: any) => c.name).join(', ')}`);\n });\n }\n}","/**\n * @fileoverview Logger avanzado con arquitectura modular y API simplificada\n * @version 0.3.0\n * @since 2024\n * \n * Sistema de logging profesional con estilos CSS avanzados, temas adaptativos,\n * badges automáticos, contextos temporales y exportación de datos.\n */\n\n// Type imports\nimport type {\n LogLevel,\n Verbosity,\n ThemeVariant,\n BannerType,\n LoggerConfig,\n TimerEntry,\n ILogHandler,\n LogMetadata,\n StyleOptions,\n Bindings,\n SerializerFn,\n HookEvent,\n HookCallback,\n MiddlewareFn,\n TransportTarget,\n TransportRecord\n} from './types/index.js';\n\n// Enterprise features\nimport { SerializerRegistry } from './serializers/index.js';\nimport { HookManager } from './hooks/index.js';\nimport { TransportManager } from './transports/index.js';\n\n// Utility imports\nimport { parseStackTrace } from './utils/stackTrace.js';\nimport { formatTimestamp } from './utils/timestamps.js';\nimport { createStyledOutput, setupThemeChangeListener } from './utils/output.js';\nimport { getEnvironment, getColorCapability, isRunningInTerminal } from './utils/environment-detector.js';\nimport { formatBadge } from './terminal/formatter.js';\n\n// Styling imports\nimport {\n THEME_PRESETS,\n THEME_BANNERS,\n displayInitBanner,\n StylePresets,\n StyleBuilder\n} from './styling/index.js';\n\n// Smart presets and dynamic scoped loggers\nimport { getSmartPreset, getAvailablePresets, hasPreset } from './styling/SmartPresets.js';\nimport { createLogStyleBuilder } from './styling/LogStyleBuilder.js';\n\n// Scoped loggers (static import for performance)\nimport { ScopedLogger, APILogger, ComponentLogger } from './ScopedLogger.js';\n\n// Handler imports\nimport { ExportLogHandler } from './handlers/index.js';\n\n// CLI imports\nimport { createDefaultCLI, type CommandProcessor } from './cli/index.js';\n\n// Constants\nimport { DEFAULT_CONFIG, CLI_LEVEL_MAP } from './constants.js';\n\n// CLI Primitives\nimport type { CLILogLevel, ISpinnerHandle, IBoxOptions, ITableOptions } from './types/index.js';\nimport { renderStep } from './cli-primitives/step.js';\nimport { renderHeader } from './cli-primitives/header.js';\nimport { renderDivider } from './cli-primitives/divider.js';\nimport { renderBox } from './cli-primitives/box.js';\nimport { renderTable } from './cli-primitives/cli-table.js';\nimport { SpinnerManager, NoopSpinner } from './cli-primitives/spinner.js';\nimport { ServerFallback } from './cli-primitives/server-fallback.js';\n\n/**\n * Estilos del tema activo actual\n * @private\n */\nlet LEVEL_STYLES = THEME_PRESETS.default;\n\n/**\n * Clase principal Logger con capacidades avanzadas de logging\n * \n * @class Logger\n * @description Sistema completo de logging con temas, badges, contextos y exportación.\n * Detecta automáticamente el tema claro/oscuro del navegador.\n * \n * @example\n * // Uso básico sin configuración\n * import logger from '@mks2508/better-logger';\n * logger.info('Aplicación iniciada');\n * logger.success('Conexión establecida');\n * \n * @example\n * // Aplicar un preset temático\n * logger.preset('cyberpunk');\n * logger.warn('Advertencia con estilo neón');\n * \n * @example\n * // Logger con scope para componentes\n * const auth = logger.component('Autenticación');\n * auth.info('Usuario intentando login');\n * auth.success('Login exitoso');\n * \n * @since 0.3.0\n */\nexport class Logger {\n private config: LoggerConfig;\n private scopedPrefix?: string;\n private handlers: ILogHandler[] = [];\n private timers: Map<string, TimerEntry> = new Map();\n private groupDepth: number = 0;\n private exportHandler?: ExportLogHandler;\n private cliProcessor?: CommandProcessor;\n private themeChangeListener?: (() => void) | null;\n private badgeList: string[] = [];\n private displaySettings = {\n showTimestamp: true,\n showLocation: true,\n showBadges: true\n };\n\n private serializerRegistry: SerializerRegistry;\n private hookManager: HookManager;\n private transportManager?: TransportManager;\n\n /** Whether CLI primitives (step, box, header, etc.) should be shown @since 5.0.0 */\n private _showPrimitives = true;\n /** Server-mode fallback for non-TTY environments @since 5.0.0 */\n private _serverFallback?: ServerFallback;\n\n /**\n * Crea una nueva instancia del Logger\n * \n * @param {Partial<LoggerConfig>} config - Configuración opcional del logger\n * \n * @example\n * // Logger con configuración personalizada\n * const logger = new Logger({\n * theme: 'neon',\n * globalPrefix: 'MiApp',\n * verbosity: 'debug',\n * bufferSize: 1000\n * });\n */\n constructor(config: Partial<LoggerConfig> = {}) {\n this.config = {\n ...DEFAULT_CONFIG,\n ...config,\n };\n\n // Initialize enterprise features\n this.serializerRegistry = new SerializerRegistry();\n this.hookManager = new HookManager();\n\n // Initialize export handler if buffer size is specified\n if (this.config.bufferSize) {\n this.exportHandler = new ExportLogHandler(this.config.bufferSize);\n this.handlers.push(this.exportHandler);\n }\n\n // Initialize CLI processor\n this.cliProcessor = createDefaultCLI();\n\n // Set up theme change listener if auto-detection is enabled\n if (this.config.autoDetectTheme) {\n this.setupAutoThemeDetection();\n }\n }\n\n // ===== PRIVATE HELPER METHODS =====\n \n /**\n * Configura la detección automática de tema con listener de cambios\n * @private\n * @description Detecta automáticamente si el navegador está en modo claro u oscuro\n */\n private setupAutoThemeDetection(): void {\n // Clean up existing listener if any\n if (this.themeChangeListener) {\n this.themeChangeListener();\n this.themeChangeListener = null;\n }\n\n // Set up new listener\n this.themeChangeListener = setupThemeChangeListener((theme) => {\n // Theme changed - logs will automatically use new colors on next call\n // No need to update anything as colors are resolved dynamically\n this.debug(`DevTools theme changed to: ${theme}`);\n });\n }\n\n // ===== CONFIGURATION METHODS =====\n\n /**\n * Obtiene la configuración actual del logger\n * \n * @returns {LoggerConfig} Configuración completa actual\n * \n * @example\n * const config = logger.getConfig();\n * console.log('Verbosidad actual:', config.verbosity);\n * console.log('Tema actual:', config.theme);\n * \n * @since 0.3.0\n */\n getConfig(): LoggerConfig {\n return { ...this.config };\n }\n\n /**\n * Actualiza la configuración del logger\n * \n * @param {Partial<LoggerConfig>} updates - Propiedades a actualizar\n * \n * @example\n * logger.updateConfig({\n * verbosity: 'debug',\n * enableTimestamps: false,\n * theme: 'cyberpunk'\n * });\n * \n * @since 0.3.0\n */\n updateConfig(updates: Partial<LoggerConfig>): void {\n const previousAutoDetect = this.config.autoDetectTheme;\n this.config = { ...this.config, ...updates };\n \n // Handle auto-detection changes\n if (updates.autoDetectTheme !== undefined && updates.autoDetectTheme !== previousAutoDetect) {\n if (updates.autoDetectTheme) {\n this.setupAutoThemeDetection();\n } else if (this.themeChangeListener) {\n this.themeChangeListener();\n this.themeChangeListener = null;\n }\n }\n }\n\n /**\n * Establece el prefijo global para todos los mensajes de log\n * \n * @param {string} prefix - Prefijo a usar\n * \n * @example\n * logger.setGlobalPrefix('MiApp');\n * logger.info('Iniciado'); // [MiApp] Iniciado\n * \n * @since 0.3.0\n */\n setGlobalPrefix(prefix: string): void {\n this.config.globalPrefix = prefix;\n }\n\n /**\n * Establece el nivel de verbosidad para filtrar la salida de logs\n * \n * @param {Verbosity} level - Nivel mínimo a mostrar ('debug' | 'info' | 'warn' | 'error' | 'critical' | 'silent')\n * \n * @example\n * logger.setVerbosity('warn'); // Solo muestra warn, error y critical\n * logger.setVerbosity('debug'); // Muestra todos los niveles\n * logger.setVerbosity('silent'); // No muestra nada\n * \n * @since 0.3.0\n */\n setVerbosity(level: Verbosity): void {\n this.config.verbosity = level;\n }\n\n /**\n * Establece el tema del logger\n * \n * @param {ThemeVariant} theme - Tema a aplicar ('default' | 'dark' | 'light' | 'neon' | 'minimal' | 'cyberpunk')\n * \n * @example\n * logger.setTheme('neon'); // Tema con colores neón\n * logger.setTheme('minimal'); // Tema minimalista\n * logger.setTheme('cyberpunk'); // Tema cyberpunk con efectos\n * \n * @since 0.3.0\n */\n setTheme(theme: ThemeVariant): void {\n // First check if it's a smart preset\n if (hasPreset(theme)) {\n this.preset(theme);\n return;\n }\n \n // Fallback to old theme system\n if (theme in THEME_PRESETS) {\n LEVEL_STYLES = (THEME_PRESETS as any)[theme];\n this.config.theme = theme;\n \n // Show theme-specific banner\n if (theme in THEME_BANNERS) {\n const themeBanner = (THEME_BANNERS as any)[theme];\n console.log(`%c${themeBanner.simple}`, themeBanner.style);\n }\n \n this.success(`Theme changed to: ${theme}`);\n } else {\n this.error(`Invalid theme: ${theme}. Available:`, [...getAvailablePresets(), ...Object.keys(THEME_PRESETS)]);\n }\n }\n\n /**\n * Establece el tipo de banner para mostrar en la inicialización\n * \n * @param {BannerType} bannerType - Tipo de banner ('simple' | 'ascii' | 'unicode' | 'svg' | 'animated')\n * \n * @example\n * logger.setBannerType('ascii'); // Banner con arte ASCII\n * logger.setBannerType('unicode'); // Banner con caracteres Unicode\n * logger.setBannerType('animated'); // Banner con animación\n * \n * @since 0.3.0\n */\n setBannerType(bannerType: BannerType): void {\n this.config.bannerType = bannerType;\n this.success(`Banner type changed to: ${bannerType}`);\n }\n\n /**\n * Reinicia el logger a la configuración por defecto\n * \n * @example\n * logger.resetConfig();\n * // Todo vuelve a la configuración inicial\n * \n * @since 0.3.0\n */\n resetConfig(): void {\n // Clean up theme listener\n if (this.themeChangeListener) {\n this.themeChangeListener();\n this.themeChangeListener = null;\n }\n \n this.config = { ...DEFAULT_CONFIG };\n LEVEL_STYLES = THEME_PRESETS.default;\n \n // Re-setup auto theme detection if enabled in default config\n if (this.config.autoDetectTheme) {\n this.setupAutoThemeDetection();\n }\n \n this.success('Logger configuration reset to defaults');\n }\n\n /**\n * Método de limpieza para eliminar listeners y liberar recursos\n * \n * @example\n * // Antes de cerrar la aplicación\n * logger.cleanup();\n * \n * @since 0.3.0\n */\n cleanup(): void {\n if (this.themeChangeListener) {\n this.themeChangeListener();\n this.themeChangeListener = null;\n }\n // Close transports\n this.transportManager?.close().catch(() => {});\n }\n\n\n // ===== SIMPLIFIED API =====\n\n /**\n * Aplica un preset inteligente - funciona perfectamente sin configuración\n * \n * @param {string} name - Nombre del preset a aplicar\n * \n * @example\n * // Presets disponibles\n * logger.preset('default'); // Limpio y adaptativo\n * logger.preset('cyberpunk'); // Colores neón, efectos brillantes\n * logger.preset('glassmorphism'); // Efectos de blur modernos\n * logger.preset('minimal'); // Minimalista y elegante\n * logger.preset('debug'); // Modo desarrollo detallado\n * logger.preset('production'); // Optimizado para producción\n * \n * @since 0.3.0\n */\n preset(name: string): void {\n if (!hasPreset(name)) {\n this.error(`Unknown preset: ${name}. Available presets:`, getAvailablePresets());\n return;\n }\n\n const presetConfig = getSmartPreset(name);\n if (presetConfig) {\n // Apply the smart preset configuration\n this.displaySettings.showTimestamp = presetConfig.timestamp?.show ?? true;\n this.displaySettings.showLocation = presetConfig.location?.show ?? true;\n\n // Store the preset config for use in createStyledOutput\n (this as any)._activePreset = presetConfig;\n (this as any)._activePresetName = name;\n\n // Only show success message in browser to avoid verbose terminal logs\n if (getEnvironment() === 'browser') {\n this.success(`Applied preset: ${name}`);\n }\n }\n }\n\n /**\n * Lista todos los presets disponibles\n * \n * @returns {string[]} Array con nombres de presets disponibles\n * \n * @example\n * const disponibles = logger.presets();\n * console.log(disponibles); // ['default', 'cyberpunk', 'glassmorphism', ...]\n * \n * @since 0.3.0\n */\n presets(): string[] {\n return getAvailablePresets();\n }\n\n // ===== TOGGLE METHODS =====\n\n /**\n * Oculta el timestamp en los logs\n * \n * @example\n * logger.hideTimestamp();\n * logger.info('Sin marca de tiempo'); // Sin timestamp visible\n * \n * @since 0.3.0\n */\n hideTimestamp(): this {\n this.displaySettings.showTimestamp = false;\n return this;\n }\n\n /**\n * Muestra el timestamp en los logs\n * \n * @example\n * logger.showTimestamp();\n * logger.info('Con marca de tiempo'); // [2024-01-15 10:30:45] Con marca de tiempo\n * \n * @since 0.3.0\n */\n showTimestamp(): this {\n this.displaySettings.showTimestamp = true;\n return this;\n }\n\n /**\n * Oculta la información de ubicación (archivo:línea) en los logs\n * \n * @example\n * logger.hideLocation();\n * logger.debug('Sin ubicación'); // Sin mostrar archivo:línea\n * \n * @since 0.3.0\n */\n hideLocation(): this {\n this.displaySettings.showLocation = false;\n return this;\n }\n\n /**\n * Muestra la información de ubicación (archivo:línea) en los logs\n * \n * @example\n * logger.showLocation();\n * logger.debug('Con ubicación'); // app.js:42 Con ubicación\n * \n * @since 0.3.0\n */\n showLocation(): this {\n this.displaySettings.showLocation = true;\n return this;\n }\n\n /**\n * Oculta los badges en los logs\n * \n * @example\n * logger.hideBadges();\n * const api = logger.api('REST');\n * api.info('Sin badges'); // Sin mostrar [API] [REST]\n * \n * @since 0.3.0\n */\n hideBadges(): this {\n this.displaySettings.showBadges = false;\n return this;\n }\n\n /**\n * Muestra los badges en los logs\n *\n * @example\n * logger.showBadges();\n * const api = logger.api('GraphQL');\n * api.info('Con badges'); // [API] [GraphQL] Con badges\n *\n * @since 0.3.0\n */\n showBadges(): this {\n this.displaySettings.showBadges = true;\n return this;\n }\n\n /**\n * Establece múltiples badges para los logs\n *\n * @param {string[]} badges - Array de badges a mostrar\n * @returns {this} Logger instance para encadenamiento\n *\n * @example\n * logger.badges(['v3', 'stable']).info('Release publicado');\n * logger.badges(['API', 'v2']).warn('Endpoint deprecado');\n *\n * @since 3.0.0\n */\n badges(badges: string[]): this {\n this.badgeList = [...badges];\n return this;\n }\n\n /**\n * Añade un badge individual a la lista\n *\n * @param {string} badge - Badge a añadir\n * @returns {this} Logger instance para encadenamiento\n *\n * @example\n * logger.badge('DEBUG').badge('AUTH').info('Token validado');\n *\n * @since 3.0.0\n */\n badge(badge: string): this {\n if (!this.badgeList.includes(badge)) {\n this.badgeList.push(badge);\n }\n return this;\n }\n\n /**\n * Limpia todos los badges activos\n *\n * @returns {this} Logger instance para encadenamiento\n *\n * @example\n * logger.clearBadges().info('Sin badges');\n *\n * @since 3.0.0\n */\n clearBadges(): this {\n this.badgeList = [];\n return this;\n }\n\n // ===== SCOPED LOGGERS =====\n\n component(name: string): ComponentLogger {\n return new ComponentLogger(this, name);\n }\n\n api(name: string): APILogger {\n return new APILogger(this, name);\n }\n\n scope(name: string): ScopedLogger {\n return new ScopedLogger(this, name);\n }\n\n // ===== SIMPLE CUSTOMIZATION =====\n\n /**\n * Personalización simple con configuración mínima\n * \n * @param {Object} overrides - Opciones de personalización\n * @param {Object} overrides.message - Configuración del mensaje\n * @param {Object} overrides.timestamp - Configuración del timestamp\n * @param {Object} overrides.location - Configuración de ubicación\n * @param {Object} overrides.level - Configuración del nivel\n * @param {Object} overrides.prefix - Configuración del prefijo\n * @param {string} overrides.spacing - Espaciado: 'compact' | 'normal' | 'spacious'\n * \n * @example\n * logger.customize({\n * message: { color: '#00ff00', size: '16px' },\n * timestamp: { show: false },\n * spacing: 'compact'\n * });\n * \n * @since 0.3.0\n */\n customize(overrides: {\n message?: { color?: string; font?: string; size?: string };\n timestamp?: { show?: boolean; color?: string };\n location?: { show?: boolean; color?: string };\n level?: { uppercase?: boolean; style?: string };\n prefix?: { show?: boolean; style?: string };\n spacing?: 'compact' | 'normal' | 'spacious';\n }): void {\n // Apply simple overrides\n if (overrides.timestamp?.show !== undefined) {\n this.displaySettings.showTimestamp = overrides.timestamp.show;\n }\n if (overrides.location?.show !== undefined) {\n this.displaySettings.showLocation = overrides.location.show;\n }\n if (overrides.prefix?.show !== undefined) {\n // Will be handled when we integrate with preset system\n }\n\n // Store customization for use in createStyledOutput\n (this as any)._customization = overrides;\n this.success('Customization applied');\n }\n\n /**\n * Access advanced styling API (for power users)\n */\n styles(): any {\n return createLogStyleBuilder(this);\n }\n\n // ===== HANDLER MANAGEMENT =====\n\n /**\n * Añade un handler personalizado para extender funcionalidad\n * \n * @param {ILogHandler} handler - Handler que implementa ILogHandler\n * \n * @example\n * // Handler personalizado para enviar logs a servidor\n * const remoteHandler = new RemoteLogHandler('https://api.ejemplo.com/logs');\n * logger.addHandler(remoteHandler);\n * \n * @example\n * // Handler para guardar en archivo\n * const fileHandler = new FileLogHandler('./app.log');\n * logger.addHandler(fileHandler);\n * \n * @since 0.3.0\n */\n addHandler(handler: ILogHandler): void {\n this.handlers.push(handler);\n }\n\n /**\n * Obtiene todos los handlers registrados\n * \n * @returns {ILogHandler[]} Array de handlers activos\n * @since 0.3.0\n */\n getHandlers(): ILogHandler[] {\n return [...this.handlers];\n }\n\n /**\n * Obtiene el handler de exportación si está disponible\n *\n * @returns {ExportLogHandler | undefined} Handler de exportación o undefined\n * @since 0.3.0\n */\n getExportHandler(): ExportLogHandler | undefined {\n return this.exportHandler;\n }\n\n // ===== SERIALIZERS =====\n\n /**\n * Añade un serializador personalizado para un tipo específico\n *\n * @param type - Constructor del tipo a serializar\n * @param serializer - Función de serialización\n * @param priority - Prioridad (mayor = primero)\n *\n * @example\n * logger.addSerializer(Error, (err) => ({\n * name: err.name,\n * message: err.message,\n * stack: err.stack?.split('\\n').slice(0, 5)\n * }));\n *\n * @since 3.0.0\n */\n addSerializer<T>(\n type: new (...args: any[]) => T,\n serializer: SerializerFn<T>,\n priority?: number\n ): void {\n this.serializerRegistry.add(type, serializer, priority);\n }\n\n /**\n * Elimina un serializador registrado\n *\n * @param type - Constructor del tipo a remover\n * @returns true si se eliminó\n *\n * @since 3.0.0\n */\n removeSerializer<T>(type: new (...args: any[]) => T): boolean {\n return this.serializerRegistry.remove(type);\n }\n\n /**\n * Obtiene el registry de serializadores\n *\n * @returns SerializerRegistry\n * @since 3.0.0\n */\n getSerializerRegistry(): SerializerRegistry {\n return this.serializerRegistry;\n }\n\n // ===== HOOKS & MIDDLEWARE =====\n\n /**\n * Registra un hook para un evento\n *\n * @param event - Evento: 'beforeLog' | 'afterLog' | 'onError'\n * @param callback - Función a ejecutar\n * @param priority - Prioridad (mayor = primero)\n * @returns Función para desregistrar\n *\n * @example\n * const unsubscribe = logger.on('beforeLog', (entry) => {\n * entry.correlationId = getCorrelationId();\n * return entry;\n * });\n *\n * @since 3.0.0\n */\n on(event: HookEvent, callback: HookCallback, priority?: number): () => void {\n return this.hookManager.on(event, callback, priority);\n }\n\n /**\n * Registra un hook que se ejecuta solo una vez\n *\n * @param event - Evento: 'beforeLog' | 'afterLog' | 'onError'\n * @param callback - Función a ejecutar\n * @param priority - Prioridad (mayor = primero)\n * @returns Función para desregistrar\n *\n * @since 3.0.0\n */\n once(event: HookEvent, callback: HookCallback, priority?: number): () => void {\n return this.hookManager.once(event, callback, priority);\n }\n\n /**\n * Elimina un hook registrado\n *\n * @param event - Evento del hook\n * @param callback - Callback a remover\n * @returns true si se eliminó\n *\n * @since 3.0.0\n */\n off(event: HookEvent, callback: HookCallback): boolean {\n return this.hookManager.off(event, callback);\n }\n\n /**\n * Añade un middleware al pipeline\n *\n * @param middleware - Función middleware\n * @param priority - Prioridad (mayor = primero)\n * @returns Función para desregistrar\n *\n * @example\n * logger.use((entry, next) => {\n * entry.requestId = asyncLocalStorage.getStore()?.requestId;\n * next();\n * });\n *\n * @since 3.0.0\n */\n use(middleware: MiddlewareFn, priority?: number): () => void {\n return this.hookManager.use(middleware, priority);\n }\n\n /**\n * Obtiene el HookManager\n *\n * @returns HookManager\n * @since 3.0.0\n */\n getHookManager(): HookManager {\n return this.hookManager;\n }\n\n // ===== TRANSPORTS =====\n\n /**\n * Añade un transport para envío de logs\n *\n * @param target - Configuración del transport\n * @returns ID único del transport\n *\n * @example\n * // File transport\n * logger.addTransport({\n * target: 'file',\n * options: { destination: '/var/log/app.log' }\n * });\n *\n * @example\n * // HTTP transport con batching\n * logger.addTransport({\n * target: 'http',\n * options: {\n * url: 'https://logs.example.com',\n * batchSize: 100,\n * flushInterval: 5000\n * },\n * level: 'warn'\n * });\n *\n * @since 3.0.0\n */\n addTransport(target: TransportTarget): string {\n if (!this.transportManager) {\n this.transportManager = new TransportManager();\n }\n return this.transportManager.add(target);\n }\n\n /**\n * Elimina un transport\n *\n * @param id - ID del transport a remover\n * @returns true si se eliminó\n *\n * @since 3.0.0\n */\n removeTransport(id: string): boolean {\n return this.transportManager?.remove(id) ?? false;\n }\n\n /**\n * Fuerza el flush de todos los transports\n *\n * @returns Promise que resuelve cuando todos los buffers están vaciados\n *\n * @since 3.0.0\n */\n async flushTransports(): Promise<void> {\n await this.transportManager?.flush();\n }\n\n /**\n * Cierra todos los transports\n *\n * @returns Promise que resuelve cuando todos están cerrados\n *\n * @since 3.0.0\n */\n async closeTransports(): Promise<void> {\n await this.transportManager?.close();\n }\n\n /**\n * Obtiene el TransportManager\n *\n * @returns TransportManager o undefined si no hay transports\n * @since 3.0.0\n */\n getTransportManager(): TransportManager | undefined {\n return this.transportManager;\n }\n\n // ===== CORE LOGGING METHODS =====\n\n /**\n * Verifica si un nivel de log debe mostrarse según la verbosidad actual\n * @private\n * @param {LogLevel} level - Nivel de log a verificar\n * @returns {boolean} True si debe mostrarse, false si no\n */\n private shouldLog(level: LogLevel): boolean {\n if (this.config.verbosity === 'silent') return false;\n const levels = { debug: 0, info: 1, warn: 2, error: 3, critical: 4 };\n return levels[level] >= levels[this.config.verbosity];\n }\n\n /**\n * Obtiene el prefijo efectivo (global + scope)\n * @private\n * @returns {string | undefined} Prefijo combinado o undefined\n */\n private getEffectivePrefix(): string | undefined {\n const parts = [this.config.globalPrefix, this.scopedPrefix].filter(Boolean);\n return parts.length > 0 ? parts.join(':') : undefined;\n }\n\n /**\n * Método central de logging que maneja estilos y formato\n * @protected\n * @param {LogLevel} level - Nivel del log\n * @param {...any} args - Argumentos a loggear\n */\n protected log(level: LogLevel, ...args: any[]): void {\n if (!this.shouldLog(level)) return;\n\n const stackInfo = this.config.enableStackTrace ? parseStackTrace() : null;\n const prefix = this.getEffectivePrefix();\n const timestamp = formatTimestamp();\n\n // Serialize args using registry\n const serializedArgs = args.map(arg => this.serializerRegistry.serialize(arg));\n\n // Prepend badges to message if any\n let message = serializedArgs.length > 0 ? String(serializedArgs[0]) : '';\n if (this.badgeList.length > 0 && this.displaySettings.showBadges) {\n const badgePrefix = this.badgeList.map(b => `[${b}]`).join('');\n message = badgePrefix + ' ' + message;\n }\n const additionalArgs = serializedArgs.slice(1);\n\n // Process beforeLog hooks (sync for performance)\n let hookEntry = {\n level,\n message,\n args: serializedArgs,\n timestamp,\n prefix,\n stackInfo: stackInfo || undefined\n };\n\n // Emit beforeLog event (fire-and-forget for sync logging)\n this.hookManager.emit('beforeLog', hookEntry).then(processed => {\n message = processed.message;\n }).catch(() => {});\n\n // Create styled output with theme detection and display settings\n const [format, ...styles] = createStyledOutput(\n level,\n LEVEL_STYLES,\n prefix,\n message,\n this.displaySettings.showLocation ? stackInfo : null,\n this.config.autoDetectTheme,\n (this as any)._activePreset,\n (this as any)._activePresetName\n );\n\n // Add group indentation\n const groupIndent = ' '.repeat(this.groupDepth);\n const finalFormat = groupIndent + format;\n\n // Output via configured writer (console by default)\n this.writeOutput(finalFormat, level, styles, additionalArgs);\n\n // Update export handler group info\n if (this.exportHandler) {\n this.exportHandler.setGroupInfo(this.groupDepth);\n }\n\n // Call custom handlers\n const metadata: LogMetadata = {\n timestamp,\n level,\n prefix,\n stackInfo: stackInfo ? stackInfo : undefined,\n };\n\n this.handlers.forEach(handler => {\n try {\n handler.handle(level, message, serializedArgs, metadata);\n } catch (error) {\n console.error('Log handler failed:', error);\n }\n });\n\n // Write to transports (async, fire-and-forget)\n if (this.transportManager) {\n const levelValues: Record<LogLevel, number> = {\n debug: 0, info: 1, warn: 2, error: 3, critical: 4\n };\n const record: TransportRecord = {\n level,\n levelValue: levelValues[level],\n time: Date.now(),\n msg: message,\n prefix,\n location: stackInfo ? {\n file: stackInfo.file,\n line: stackInfo.line,\n column: stackInfo.column,\n function: stackInfo.function\n } : undefined\n };\n this.transportManager.write(record).catch(() => {});\n }\n\n // Emit afterLog event (fire-and-forget)\n this.hookManager.emit('afterLog', hookEntry).catch(() => {});\n }\n\n logWithBindings(bindings: Bindings, level: LogLevel, ...args: any[]): void {\n if (!this.shouldLog(level)) return;\n\n let prefix = '';\n const colorCapability = getColorCapability();\n\n if (bindings.badges?.length) {\n prefix += bindings.badges.map(b => formatBadge(b, 'pill', colorCapability, '#00ff88')).join(' ') + ' ';\n }\n if (bindings.scope) {\n prefix += formatBadge(bindings.scope, 'pill', colorCapability, '#00ffff') + ' ';\n }\n\n if (prefix && args.length > 0) {\n args[0] = prefix + String(args[0]);\n }\n\n this.log(level, ...args);\n }\n\n debug(...args: any[]): void {\n this.log('debug', ...args);\n }\n\n /**\n * Registra mensajes informativos\n * \n * @param {...any} args - Mensajes y datos informativos\n * \n * @example\n * logger.info('Servidor iniciado en puerto 3000');\n * logger.info('Usuario conectado:', userId);\n * logger.info('Procesando', totalItems, 'elementos');\n * \n * @since 0.3.0\n */\n info(...args: any[]): void {\n this.log('info', ...args);\n }\n\n /**\n * Registra mensajes de advertencia\n * \n * @param {...any} args - Mensajes de advertencia\n * \n * @example\n * logger.warn('Memoria al 85% de capacidad');\n * logger.warn('API deprecada, usar v2');\n * logger.warn('Reintentos agotados:', maxRetries);\n * \n * @since 0.3.0\n */\n warn(...args: any[]): void {\n this.log('warn', ...args);\n }\n\n /**\n * Registra mensajes de error\n * \n * @param {...any} args - Mensajes de error y stack traces\n * \n * @example\n * logger.error('Fallo en conexión a base de datos');\n * logger.error('Error al procesar:', error.message, error.stack);\n * logger.error('Código de error:', errorCode);\n * \n * @since 0.3.0\n */\n error(...args: any[]): void {\n this.log('error', ...args);\n }\n\n /**\n * Registra mensajes de éxito (nivel info especial)\n * \n * @param {...any} args - Mensajes de operaciones exitosas\n * \n * @example\n * logger.success('Base de datos conectada');\n * logger.success('Usuario creado con ID:', userId);\n * logger.success('✓ Tests pasados: 42/42');\n * \n * @since 0.3.0\n */\n success(...args: any[]): void {\n if (!this.shouldLog('info')) return;\n\n const stackInfo = this.config.enableStackTrace ? parseStackTrace() : null;\n const prefix = this.getEffectivePrefix();\n const message = args.length > 0 ? String(args[0]) : '';\n const additionalArgs = args.slice(1);\n\n // Handle success as special case - use info level with success styling\n const [format, ...styles] = createStyledOutput(\n 'info',\n LEVEL_STYLES,\n prefix,\n message,\n this.displaySettings.showLocation ? stackInfo : null,\n this.config.autoDetectTheme,\n (this as any)._activePreset,\n (this as any)._activePresetName\n );\n \n // Override with success styling\n const successStyle = LEVEL_STYLES.success;\n let emoji = '✅';\n let label = 'SUCCESS';\n \n if (successStyle) {\n if (successStyle.emoji) {\n emoji = successStyle.emoji;\n }\n if (successStyle.label) {\n label = successStyle.label;\n }\n }\n \n const successFormat = format.replace(/ℹ️ INFO/, `${emoji} ${label}`);\n\n const groupIndent = ' '.repeat(this.groupDepth);\n const finalFormat = groupIndent + successFormat;\n\n if (additionalArgs.length > 0) {\n console.log(finalFormat, ...styles, ...additionalArgs);\n } else {\n console.log(finalFormat, ...styles);\n }\n\n // Call handlers\n const metadata: LogMetadata = {\n timestamp: formatTimestamp(),\n level: 'info',\n prefix,\n stackInfo: stackInfo ? stackInfo : undefined,\n };\n\n this.handlers.forEach(handler => {\n try {\n handler.handle('info', message, args, metadata);\n } catch (error) {\n console.error('Log handler failed:', error);\n }\n });\n }\n\n /**\n * Registra información de trace (debugging detallado)\n * \n * @param {...any} args - Datos detallados para debugging\n * \n * @example\n * logger.trace('Entrando en función processData');\n * logger.trace('Stack completo:', new Error().stack);\n * \n * @since 0.3.0\n */\n trace(...args: any[]): void {\n this.log('debug', ...args);\n if (this.shouldLog('debug')) {\n console.trace(...args);\n }\n }\n\n /**\n * Registra errores críticos (prioridad más alta)\n * \n * @param {...any} args - Errores críticos del sistema\n * \n * @example\n * logger.critical('Sistema caído - reinicio inmediato requerido');\n * logger.critical('Pérdida de datos detectada');\n * logger.critical('Brecha de seguridad:', securityError);\n * \n * @since 0.3.0\n */\n critical(...args: any[]): void {\n this.log('critical', ...args);\n }\n\n // ===== ADVANCED LOGGING FEATURES =====\n\n /**\n * Muestra datos en formato de tabla\n * \n * @param {any} data - Datos a mostrar (array de objetos o matriz)\n * @param {string[]} columns - Columnas específicas a mostrar (opcional)\n * \n * @example\n * const usuarios = [\n * { id: 1, nombre: 'Juan', edad: 30 },\n * { id: 2, nombre: 'María', edad: 25 }\n * ];\n * logger.table(usuarios);\n * logger.table(usuarios, ['nombre', 'edad']); // Solo estas columnas\n * \n * @since 0.3.0\n */\n table(data: any, columns?: string[]): void {\n if (!this.shouldLog('info')) return;\n\n const prefix = this.getEffectivePrefix();\n const tableStyle = StylePresets.accent().build();\n\n const format = `%c📊 TABLE${prefix ? ` [${prefix}]` : ''}`;\n console.log(format, tableStyle);\n\n if (columns) {\n console.table(data, columns);\n } else {\n console.table(data);\n }\n }\n\n /**\n * Inicia un grupo colapsable en la consola\n * \n * @param {string} label - Etiqueta del grupo\n * @param {boolean} collapsed - Si el grupo inicia colapsado (default: false)\n * \n * @example\n * logger.group('Procesando usuarios');\n * logger.info('Usuario 1 procesado');\n * logger.info('Usuario 2 procesado');\n * logger.groupEnd();\n * \n * @example\n * // Grupo colapsado por defecto\n * logger.group('Detalles adicionales', true);\n * logger.debug('Información detallada aquí');\n * logger.groupEnd();\n * \n * @since 0.3.0\n */\n group(label: string, collapsed: boolean = false): void {\n const groupStyle = new StyleBuilder()\n .bg('linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%)')\n .color('#1565c0')\n .border('1px solid #90caf9')\n .padding('4px 12px')\n .rounded('6px')\n .bold()\n .build();\n\n const format = `%c📁 ${label}`;\n\n if (collapsed) {\n console.groupCollapsed(format, groupStyle);\n } else {\n console.group(format, groupStyle);\n }\n\n this.groupDepth++;\n }\n\n /**\n * Finaliza el grupo actual de la consola\n * \n * @example\n * logger.group('Operaciones');\n * logger.info('Operación 1');\n * logger.info('Operación 2');\n * logger.groupEnd(); // Cierra el grupo\n * \n * @since 0.3.0\n */\n groupEnd(): void {\n if (this.groupDepth > 0) {\n console.groupEnd();\n this.groupDepth--;\n }\n }\n\n // ===== PERFORMANCE TIMING =====\n\n /**\n * Inicia un temporizador con la etiqueta dada\n * \n * @param {string} label - Etiqueta identificadora del temporizador\n * \n * @example\n * logger.time('proceso-datos');\n * // ... operación costosa ...\n * logger.timeEnd('proceso-datos'); // ⏱️ Timer ended: proceso-datos - 1523.45ms\n * \n * @since 0.3.0\n */\n time(label: string): void {\n const timer: TimerEntry = {\n label,\n startTime: performance.now(),\n };\n this.timers.set(label, timer);\n\n const timerStyle = StylePresets.warning().build();\n console.log(`%c⏱️ Timer started: ${label}`, timerStyle);\n }\n\n /**\n * Finaliza un temporizador y muestra el tiempo transcurrido\n *\n * @param {string} label - Etiqueta del temporizador a finalizar\n * @returns {number} Elapsed milliseconds, or -1 if timer not found\n *\n * @example\n * logger.time('consulta-db');\n * await consultarBaseDatos();\n * const elapsed = logger.timeEnd('consulta-db'); // ⏱️ Timer ended: consulta-db - 234.56ms\n *\n * @since 0.3.0\n */\n timeEnd(label: string): number {\n const timer = this.timers.get(label);\n if (!timer) {\n this.warn(`Timer '${label}' does not exist`);\n return -1;\n }\n\n const elapsed = performance.now() - timer.startTime;\n this.timers.delete(label);\n\n const timerStyle = StylePresets.success().build();\n console.log(`%c⏱️ Timer ended: ${label} - ${elapsed.toFixed(2)}ms`, timerStyle);\n\n return elapsed;\n }\n\n // ===== ADVANCED VISUAL FEATURES =====\n\n /**\n * Muestra un banner con el tipo especificado o configurado\n * \n * @param {BannerType} bannerType - Tipo de banner (opcional)\n * \n * @example\n * logger.showBanner('ascii'); // Banner ASCII art\n * logger.showBanner('unicode'); // Banner con caracteres Unicode\n * logger.showBanner('svg'); // Banner con gráfico SVG\n * logger.showBanner(); // Usa el tipo configurado\n * \n * @since 0.3.0\n */\n showBanner(bannerType?: BannerType): void {\n const effectiveBannerType = bannerType ? bannerType : this.config.bannerType;\n displayInitBanner(effectiveBannerType);\n }\n\n /**\n * Registra mensaje con imagen SVG de fondo\n * \n * @param {string} message - Mensaje a mostrar\n * @param {string} svgContent - Contenido SVG personalizado (opcional)\n * @param {StyleOptions} options - Opciones de estilo (ancho, alto, padding)\n * \n * @example\n * // SVG automático con gradiente\n * logger.logWithSVG('🎆 Bienvenido a Better Logger');\n * \n * @example\n * // SVG personalizado\n * const customSVG = '<svg>...</svg>';\n * logger.logWithSVG('Logo', customSVG, { width: 400, height: 100 });\n * \n * @since 0.3.0\n */\n logWithSVG(message: string, svgContent?: string, options: StyleOptions = {}): void {\n const { width = 300, height = 60, padding = '30px 150px' } = options;\n \n let svgDataUri = '';\n if (svgContent) {\n const encodedSVG = encodeURIComponent(svgContent);\n svgDataUri = `data:image/svg+xml,${encodedSVG}`;\n } else {\n const defaultSVG = `<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 ${width} ${height}'><defs><linearGradient id='grad' x1='0%' y1='0%' x2='100%' y2='0%'><stop offset='0%' style='stop-color:%23667eea'/><stop offset='100%' style='stop-color:%23764ba2'/></linearGradient></defs><rect width='100%' height='100%' fill='url(%23grad)' rx='4'/><text x='${width/2}' y='${height/2 + 5}' text-anchor='middle' fill='white' font-family='monospace' font-size='14' font-weight='bold'>${message}</text></svg>`;\n svgDataUri = `data:image/svg+xml,${encodeURIComponent(defaultSVG)}`;\n }\n\n const svgStyle = new StyleBuilder()\n .bg(`url(\"${svgDataUri}\") no-repeat center center`)\n .padding(padding)\n .color('transparent')\n .rounded('4px')\n .build();\n\n console.log(`%c${message}`, svgStyle);\n }\n\n /**\n * Registra mensaje con gradiente animado de fondo\n * \n * @param {string} message - Mensaje a animar\n * @param {number} duration - Duración de la animación en segundos (default: 3)\n * \n * @example\n * logger.logAnimated('🌈 Animación en progreso');\n * logger.logAnimated('Cargando...', 5); // Animación de 5 segundos\n * \n * @since 0.3.0\n */\n logAnimated(message: string, duration: number = 3): void {\n // Inject CSS animation if not already present\n if (!document.getElementById('logger-animations')) {\n const style = document.createElement('style');\n style.id = 'logger-animations';\n style.textContent = `\n @keyframes loggerGradient {\n 0% { background-position: 0% 50%; }\n 50% { background-position: 100% 50%; }\n 100% { background-position: 0% 50%; }\n }\n `;\n document.head.appendChild(style);\n }\n\n const animatedStyle = new StyleBuilder()\n .bg('linear-gradient(-45deg, #667eea, #764ba2, #667eea, #764ba2)')\n .css('background-size', '400% 400%')\n .color('#ffffff')\n .padding('12px 20px')\n .rounded('8px')\n .bold()\n .font('Monaco, Consolas, monospace')\n .animation(`loggerGradient ${duration}s ease infinite`)\n .display('inline-block')\n .build();\n\n console.log(`%c${message}`, animatedStyle);\n }\n\n /**\n * Agrupa logs por una propiedad específica usando Object.groupBy (cuando esté disponible)\n * \n * @param {T[]} items - Array de elementos a agrupar\n * @param {Function} groupBy - Función que retorna la clave de agrupación\n * \n * @example\n * const ventas = [\n * { producto: 'Laptop', categoria: 'Electrónica', precio: 1200 },\n * { producto: 'Mouse', categoria: 'Electrónica', precio: 25 },\n * { producto: 'Libro', categoria: 'Literatura', precio: 15 }\n * ];\n * logger.logGrouped(ventas, item => item.categoria);\n * \n * @since 0.3.0\n */\n logGrouped<T>(items: T[], groupBy: (item: T) => string): void {\n try {\n // Use Object.groupBy if available (ES2024), otherwise fallback to reduce\n let grouped: Record<string, T[]>;\n \n if ((Object as any).groupBy) {\n grouped = (Object as any).groupBy(items, groupBy);\n } else {\n grouped = items.reduce((acc, item) => {\n const key = groupBy(item);\n if (!acc[key]) {\n acc[key] = [];\n }\n acc[key].push(item);\n return acc;\n }, {} as Record<string, T[]>);\n }\n\n Object.entries(grouped).forEach(([group, groupItems]) => {\n this.group(`Group: ${group}`);\n this.table(groupItems);\n this.groupEnd();\n });\n } catch {\n this.info('Grouped data:', items);\n }\n }\n\n // ===== CLI PRIMITIVES (v5.0) =====\n\n /**\n * Displays a step progress indicator in the terminal\n *\n * @param {number} current - Current step number\n * @param {number} total - Total number of steps\n * @param {string} message - Step description\n *\n * @example\n * logger.step(1, 5, 'Analyzing repository...');\n * logger.step(2, 5, 'Generating commit message...');\n *\n * @since 5.0.0\n */\n step(current: number, total: number, message: string): void {\n if (!this._showPrimitives) return;\n if (!isRunningInTerminal()) {\n this.getServerFallback().step(current, total, message);\n return;\n }\n const colorCap = getColorCapability();\n const output = renderStep(current, total, message, colorCap);\n process.stderr.write(output + '\\n');\n }\n\n /**\n * Displays a styled header with optional subtitle\n *\n * @param {string} title - Main title text\n * @param {string} subtitle - Optional subtitle (rendered dimmed)\n *\n * @example\n * logger.header('Commit Wizard', 'v2.0.0');\n *\n * @since 5.0.0\n */\n header(title: string, subtitle?: string): void {\n if (!this._showPrimitives) return;\n if (!isRunningInTerminal()) {\n this.getServerFallback().header(title, subtitle);\n return;\n }\n const output = renderHeader(title, subtitle);\n process.stderr.write(output + '\\n');\n }\n\n /**\n * Displays a horizontal divider line\n *\n * @example\n * logger.divider();\n *\n * @since 5.0.0\n */\n divider(): void {\n if (!this._showPrimitives) return;\n if (!isRunningInTerminal()) {\n this.getServerFallback().divider();\n return;\n }\n const output = renderDivider();\n process.stderr.write(output + '\\n');\n }\n\n /**\n * Outputs a blank line\n *\n * @example\n * logger.blank();\n *\n * @since 5.0.0\n */\n blank(): void {\n if (!this._showPrimitives) return;\n if (!isRunningInTerminal()) {\n this.getServerFallback().blank();\n return;\n }\n process.stderr.write('\\n');\n }\n\n /**\n * Renders content inside a bordered box\n *\n * @param {string} content - Content string (may contain newlines)\n * @param {IBoxOptions} options - Box rendering options\n *\n * @example\n * logger.box('3 commits generated\\nProvider: Groq', { title: 'Done', borderColor: '#00ff00' });\n *\n * @since 5.0.0\n */\n box(content: string, options?: IBoxOptions): void {\n if (!this._showPrimitives) return;\n if (!isRunningInTerminal()) {\n this.getServerFallback().box(content, options);\n return;\n }\n const colorCap = getColorCapability();\n const output = renderBox(content, options, colorCap);\n process.stderr.write(output + '\\n');\n }\n\n /**\n * Renders an array of objects as a formatted ASCII table.\n * Note: This is distinct from the existing table() method which uses console.table.\n *\n * @param {Record<string, unknown>[]} rows - Array of row objects\n * @param {ITableOptions} options - Table rendering options\n *\n * @example\n * logger.cliTable([\n * { provider: 'Groq', status: 'Available', model: 'llama-3.3-70b' },\n * { provider: 'Gemini', status: 'Configured', model: 'gemini-2.5-flash' },\n * ]);\n *\n * @since 5.0.0\n */\n cliTable(rows: Record<string, unknown>[], options?: ITableOptions): void {\n if (!this._showPrimitives) return;\n if (!isRunningInTerminal()) {\n this.getServerFallback().cliTable(rows, options);\n return;\n }\n const colorCap = getColorCapability();\n const output = renderTable(rows, options, colorCap);\n process.stderr.write(output + '\\n');\n }\n\n /**\n * Creates a spinner handle for showing progress during async operations.\n * Returns a NoopSpinner in non-TTY environments.\n *\n * @param {string} message - Initial spinner text\n * @returns {ISpinnerHandle} Spinner controller\n *\n * @example\n * const s = logger.spinner('Analyzing repository...');\n * s.start();\n * await analyzeRepo();\n * s.succeed('Analysis complete (1.2s)');\n *\n * @since 5.0.0\n */\n spinner(message: string): ISpinnerHandle {\n if (!isRunningInTerminal() || this.config.outputMode === 'silent') {\n return new NoopSpinner(message, this);\n }\n return new SpinnerManager(message, this.config, this);\n }\n\n /**\n * Sets the CLI verbosity level, controlling both log verbosity and primitive visibility\n *\n * @param {CLILogLevel} level - CLI log level\n *\n * @example\n * logger.setCLILevel('quiet'); // Only errors, no CLI primitives\n * logger.setCLILevel('verbose'); // Debug logs + all CLI primitives\n *\n * @since 5.0.0\n */\n setCLILevel(level: CLILogLevel): void {\n const mapping = CLI_LEVEL_MAP[level];\n this.setVerbosity(mapping.verbosity);\n this._showPrimitives = mapping.showPrimitives;\n this.config.cliLevel = level;\n }\n\n /**\n * Returns the current CLI log level\n * @returns {CLILogLevel} Current CLI log level\n * @since 5.0.0\n */\n get cliLevel(): CLILogLevel {\n return this.config.cliLevel ?? 'normal';\n }\n\n /** Lazily creates the server fallback instance @private */\n private getServerFallback(): ServerFallback {\n if (!this._serverFallback) {\n this._serverFallback = new ServerFallback(this);\n }\n return this._serverFallback;\n }\n\n // ===== OUTPUT WRITER SYSTEM =====\n\n /**\n * Writes formatted output to the configured destination.\n * Respects outputMode configuration for console, silent, or custom output.\n *\n * @private\n * @param {string} message - Formatted log message\n * @param {LogLevel} level - Log level\n * @param {string[]} styles - CSS styles for browser console\n * @param {any[]} additionalArgs - Additional arguments to log\n * @since 4.0.0\n */\n private writeOutput(\n message: string,\n level: LogLevel,\n styles: string[],\n additionalArgs: any[]\n ): void {\n const mode = this.config.outputMode ?? 'console';\n\n // Silent mode: no output\n if (mode === 'silent') {\n return;\n }\n\n // Custom mode: use configured writer\n if (mode === 'custom' && this.config.outputWriter) {\n const fullMessage = additionalArgs.length > 0\n ? `${message} ${additionalArgs.map(a => String(a)).join(' ')}`\n : message;\n this.config.outputWriter.write(fullMessage, level, styles);\n return;\n }\n\n // Default: console output\n if (additionalArgs.length > 0) {\n console.log(message, ...styles, ...additionalArgs);\n } else {\n console.log(message, ...styles);\n }\n }\n\n // ===== CLI SYSTEM =====\n\n /**\n * Procesador de comandos CLI para configuración y exportación del logger\n * \n * @param {string} command - Comando CLI a ejecutar\n * @returns {Promise<void>}\n * \n * @example\n * // Comandos disponibles\n * await logger.cli('export json'); // Exporta logs en JSON\n * await logger.cli('export csv'); // Exporta logs en CSV\n * await logger.cli('theme list'); // Lista temas disponibles\n * await logger.cli('theme set neon'); // Cambia al tema neon\n * await logger.cli('config show'); // Muestra configuración actual\n * await logger.cli('history clear'); // Limpia historial de logs\n * await logger.cli('status'); // Muestra estado del logger\n * await logger.cli('help'); // Muestra ayuda de comandos\n * \n * @since 0.3.0\n */\n async cli(command: string): Promise<void> {\n if (!this.cliProcessor) {\n this.error('CLI processor not initialized');\n return;\n }\n\n await this.cliProcessor.processCommand(command, this);\n }\n}\n\n/**\n * Lazy singleton instance - se inicializa solo cuando se necesita\n * @private\n */\nlet _defaultLogger: Logger | null = null;\n\n/**\n * Obtiene o crea la instancia singleton del logger\n * @returns {Logger} Instancia singleton del logger\n */\nfunction getDefaultLogger(): Logger {\n if (!_defaultLogger) {\n _defaultLogger = new Logger({\n verbosity: 'info',\n enableColors: true,\n enableTimestamps: true,\n enableStackTrace: true,\n bufferSize: 1000, // Enable export functionality by default\n });\n \n // Display initialization banner only once\n try {\n displayInitBanner();\n } catch (error) {\n // Silent fail if banner cannot be displayed\n }\n }\n return _defaultLogger;\n}\n\n// Export the lazy singleton getter as default\nexport default getDefaultLogger();\n\n/**\n * Métodos individuales exportados para conveniencia\n * @description Todos los métodos están correctamente enlazados al singleton lazy\n * @since 0.3.0\n */\nexport const debug = (...args: any[]) => getDefaultLogger().debug(...args);\nexport const info = (...args: any[]) => getDefaultLogger().info(...args);\nexport const warn = (...args: any[]) => getDefaultLogger().warn(...args);\nexport const error = (...args: any[]) => getDefaultLogger().error(...args);\nexport const success = (...args: any[]) => getDefaultLogger().success(...args);\nexport const trace = (...args: any[]) => getDefaultLogger().trace(...args);\nexport const critical = (...args: any[]) => getDefaultLogger().critical(...args);\nexport const table = (data: any, columns?: string[]) => getDefaultLogger().table(data, columns);\nexport const group = (label: string, collapsed?: boolean) => getDefaultLogger().group(label, collapsed);\nexport const groupEnd = () => getDefaultLogger().groupEnd();\nexport const time = (label: string) => getDefaultLogger().time(label);\nexport const timeEnd = (label: string) => getDefaultLogger().timeEnd(label);\nexport const setGlobalPrefix = (prefix: string) => getDefaultLogger().setGlobalPrefix(prefix);\nexport const setVerbosity = (level: Verbosity) => getDefaultLogger().setVerbosity(level);\nexport const addHandler = (handler: ILogHandler) => getDefaultLogger().addHandler(handler);\nexport const setTheme = (theme: ThemeVariant) => getDefaultLogger().setTheme(theme);\nexport const setBannerType = (bannerType: BannerType) => getDefaultLogger().setBannerType(bannerType);\nexport const showBanner = (bannerType?: BannerType) => getDefaultLogger().showBanner(bannerType);\nexport const logWithSVG = (message: string, svgContent?: string, options?: StyleOptions) => \n getDefaultLogger().logWithSVG(message, svgContent, options);\nexport const logAnimated = (message: string, duration?: number) => \n getDefaultLogger().logAnimated(message, duration);\nexport const cli = (command: string) => getDefaultLogger().cli(command);\nexport const cleanup = () => getDefaultLogger().cleanup();\n\n// Simplified API exports\nexport const preset = (name: string) => getDefaultLogger().preset(name);\nexport const presets = () => getDefaultLogger().presets();\nexport const hideTimestamp = () => getDefaultLogger().hideTimestamp();\nexport const showTimestamp = () => getDefaultLogger().showTimestamp();\nexport const hideLocation = () => getDefaultLogger().hideLocation();\nexport const showLocation = () => getDefaultLogger().showLocation();\nexport const hideBadges = () => getDefaultLogger().hideBadges();\nexport const showBadges = () => getDefaultLogger().showBadges();\nexport const badges = (badgeList: string[]) => getDefaultLogger().badges(badgeList);\nexport const badge = (badgeName: string) => getDefaultLogger().badge(badgeName);\nexport const clearBadges = () => getDefaultLogger().clearBadges();\nexport const component = (name: string) => getDefaultLogger().component(name);\nexport const api = (name: string) => getDefaultLogger().api(name);\nexport const scope = (name: string) => getDefaultLogger().scope(name);\nexport const customize = (overrides: any) => getDefaultLogger().customize(overrides);\nexport const styles = () => getDefaultLogger().styles();\n\n// Enterprise features exports\nexport const addSerializer = <T>(\n type: new (...args: any[]) => T,\n serializer: SerializerFn<T>,\n priority?: number\n) => getDefaultLogger().addSerializer(type, serializer, priority);\nexport const removeSerializer = <T>(type: new (...args: any[]) => T) =>\n getDefaultLogger().removeSerializer(type);\nexport const on = (event: HookEvent, callback: HookCallback, priority?: number) =>\n getDefaultLogger().on(event, callback, priority);\nexport const once = (event: HookEvent, callback: HookCallback, priority?: number) =>\n getDefaultLogger().once(event, callback, priority);\nexport const off = (event: HookEvent, callback: HookCallback) =>\n getDefaultLogger().off(event, callback);\nexport const use = (middleware: MiddlewareFn, priority?: number) =>\n getDefaultLogger().use(middleware, priority);\nexport const addTransport = (target: TransportTarget) =>\n getDefaultLogger().addTransport(target);\nexport const removeTransport = (id: string) =>\n getDefaultLogger().removeTransport(id);\nexport const flushTransports = () =>\n getDefaultLogger().flushTransports();\nexport const closeTransports = () =>\n getDefaultLogger().closeTransports();\n\n// Re-export handlers and utilities for backward compatibility\nexport { FileLogHandler, RemoteLogHandler, AnalyticsLogHandler, ExportLogHandler } from './handlers/index.js';\nexport { StyleBuilder, StylePresets as Styles } from './styling/index.js';\n\n// Re-export enterprise features\nexport { SerializerRegistry } from './serializers/index.js';\nexport { HookManager } from './hooks/index.js';\nexport { TransportManager, ConsoleTransport, FileTransport, HttpTransport } from './transports/index.js';\nexport { StyleCache, getStyleCache } from './styling/StyleCache.js';\n","/**\n * @fileoverview CLI system exports for Advanced Logger\n */\n\n// Core CLI system\nexport { CommandProcessor, type ICommand } from './CommandProcessor.js';\nimport { CommandProcessor } from './CommandProcessor.js';\n\n// Commands\nexport { ConfigCommand } from './commands/ConfigCommand.js';\nexport { ThemesCommand, BannersCommand, BannerCommand } from './commands/ThemeCommand.js';\nexport { StatusCommand, ResetCommand, DemoCommand } from './commands/StatusCommand.js';\nexport { \n ExportCommand, \n CopyCommand, \n BufferSizeCommand, \n ClearBufferCommand, \n BufferInfoCommand \n} from './commands/ExportCommand.js';\n\n// Help system\nexport { HelpCommand } from './help.js';\n\n// Import all commands\nimport { HelpCommand } from './help.js';\nimport { ConfigCommand } from './commands/ConfigCommand.js';\nimport { ThemesCommand, BannersCommand, BannerCommand } from './commands/ThemeCommand.js';\nimport { StatusCommand, ResetCommand, DemoCommand } from './commands/StatusCommand.js';\nimport { \n ExportCommand, \n CopyCommand, \n BufferSizeCommand, \n ClearBufferCommand, \n BufferInfoCommand \n} from './commands/ExportCommand.js';\nimport { \n HistoryCommand, \n ClearHistoryCommand, \n InteractiveCommand, \n PluginsCommand \n} from './commands/HistoryCommand.js';\n\n/**\n * Create and configure default CLI processor\n */\nexport function createDefaultCLI(): CommandProcessor {\n const processor = new CommandProcessor();\n \n // Register all default commands\n processor.registerCommand(new HelpCommand());\n processor.registerCommand(new ConfigCommand());\n processor.registerCommand(new ThemesCommand());\n processor.registerCommand(new BannersCommand());\n processor.registerCommand(new BannerCommand());\n processor.registerCommand(new StatusCommand());\n processor.registerCommand(new ResetCommand());\n processor.registerCommand(new DemoCommand());\n processor.registerCommand(new ExportCommand());\n processor.registerCommand(new CopyCommand());\n processor.registerCommand(new BufferSizeCommand());\n processor.registerCommand(new ClearBufferCommand());\n processor.registerCommand(new BufferInfoCommand());\n \n // Register new enhanced commands\n processor.registerCommand(new HistoryCommand());\n processor.registerCommand(new ClearHistoryCommand());\n processor.registerCommand(new InteractiveCommand());\n processor.registerCommand(new PluginsCommand());\n \n return processor;\n}"],"names":["DEFAULT_CONFIG","maxDepth","circular","preserveUndefined","SerializerRegistry","serializers","Map","config","constructor","this","registerDefaults","add","Error","err","name","message","stack","split","slice","cause","serialize","Date","date","iso","toISOString","timestamp","getTime","RegExp","regex","pattern","source","flags","map","ctx","obj","forEach","value","key","keyStr","JSON","stringify","String","serializeInternal","depth","path","__type","entries","Set","set","values","Array","from","v","i","Buffer","buf","length","preview","toString","type","serializer","priority","remove","delete","has","getAll","sort","a","b","findSerializer","sorted","entry","context","seen","join","isArray","item","result","val","Object","mergedConfig","WeakSet","generateId","now","Math","random","substr","HookManager","hooks","middlewares","on","event","callback","registration","id","once","get","push","removeHook","off","index","findIndex","h","splice","use","middleware","fn","m","emit","currentEntry","toRemove","hook","error","hookEvent","process","executeNext","async","afterProcess","clear","getStats","beforeLog","afterLog","onError","LOG_LEVELS","debug","info","warn","critical","TransportManager","transports","defaultLevel","target","level","transport","options","levelValue","close","write","record","promises","transformedRecord","transform","Promise","all","flush","count","size","list","keys","THEME_PRESETS","default","emoji","label","background","color","border","shadow","success","dark","neon","minimal","light","cyberpunk","BANNER_VARIANTS","simple","text","style","ascii","unicode","svg","animated","THEME_BANNERS","displayInitBanner","bannerType","selectedType","userAgent","navigator","isChrome","test","isFirefox","isSafari","supportsSVG","document","createElementNS","createSVGRect","createElement","detectBannerCapabilities","banner","textContent","head","appendChild","console","log","group","feature","groupEnd","BaseStyler","builder","StyleBuilder","primary","secondary","accent","muted","getAdaptiveColor","warning","danger","mono","font","system","readable","compact","padding","margin","spacious","inline","display","glassmorphic","css","rounded","neonColor","gradient","to","bg","bold","build","TimestampStyler","hidden","opacity","LevelStyler","badge","glowing","flat","uppercase","PrefixStyler","MessageStyler","ADAPTIVE_COLORS","messageText","code","large","LocationStyler","subtle","location","clickable","cursor","LogStyleBuilder","logStyles","logger","TimestampStyleBuilderProxy","LevelStyleBuilderProxy","prefix","PrefixStyleBuilderProxy","MessageStyleBuilderProxy","LocationStyleBuilderProxy","usePreset","presetName","customize","overrides","spacing","layout","innerPadding","outerMargin","backdrop","filter","transparency","max","min","apply","_customLogStyles","getConfig","_updatePartConfig","part","styles","PartStyleBuilderProxy","parentBuilder","partName","and","applyStyles","styler","super","SMART_PRESETS","show","glassmorphism","production","getAvailablePresets","hasPreset","ScopedLogger","parent","scopeName","badgeList","contextStack","_timers","timers","getBindings","scope","getScopePrefix","badges","includes","clearBadges","setTheme","contextName","ContextLogger","time","startTime","performance","timeEnd","timer","elapsed","toFixed","args","logWithBindings","bindings","trace","step","current","total","header","title","subtitle","divider","blank","box","content","cliTable","rows","spinner","setCLILevel","_pushContext","_popContext","pop","APILogger","apiName","slow","duration","msg","rateLimit","auth","deprecated","ComponentLogger","componentName","lifecycle","stateChange","data","propsChange","changes","parentLogger","run","runAsync","start","end","ExportLogHandler","buffer","maxSize","groupDepth","currentGroup","BUFFER_LIMITS","DEFAULT_SIZE","MIN_SIZE","MAX_SIZE","handle","metadata","generateLogId","stackInfo","groupInfo","groupName","shift","setGroupInfo","getBufferStats","levelCounts","reduce","acc","currentCount","oldestLog","newestLog","firstEntry","lastEntry","usage","clearBuffer","setBufferSize","filterLogs","filters","filtered","levels","prefixes","excludePrefixes","since","sinceDate","parseTimeInput","until","untilDate","withStackTrace","errorsOnly","search","searchTerm","toLowerCase","some","arg","last","first","exportJSON","logs","exportCSV","headers","baseRow","formatDisplayTime","toUpperCase","replace","file","line","safeStringify","row","exportMarkdown","summary","groupBy","grouped","levelArray","getLevelEmoji","exportPlain","padEnd","exportHTML","_options","html","escapeHtml","format","filteredLogs","totalLogs","exportedAt","copyToClipboard","export","clipboard","window","isSecureContext","writeText","textArea","position","body","focus","select","execCommand","removeChild","getAllLogs","saveToFile","blob","Blob","getMimeType","url","URL","createObjectURL","filename","generateFilename","href","download","click","revokeObjectURL","json","csv","markdown","plain","streamToEndpoint","endpoint","batchSize","batch","apiKey","response","fetch","method","batchIndex","floor","totalBatches","ceil","ok","status","statusText","exportWithMetadata","baseResult","bufferStats","memoryUsage","estimateMemoryUsage","processingTime","timezone","Intl","DateTimeFormat","resolvedOptions","timeZone","sampleEntry","CommandProcessor","commands","aliases","plugins","history","maxHistorySize","isInteractiveMode","registerCommand","command","alias","registerPlugin","plugin","initialize","unregisterPlugin","pluginName","cleanup","getCommands","getCommand","aliasTarget","getHistory","clearHistory","getPlugins","enterInteractiveMode","setupBrowserInteractiveMode","exitInteractiveMode","cli","commandString","processCommand","startsWith","addToHistory","parts","commandName","suggestions","getSuggestions","execute","unshift","partial","ConfigCommand","description","parse","applyConfig","pairs","pair","trim","showStatus","statusData","theme","verbosity","colors","enableColors","timestamps","enableTimestamps","stackTrace","enableStackTrace","globalPrefix","handlers","getHandlers","table","validKeys","applied","setBannerType","setVerbosity","setGlobalPrefix","updateConfig","ThemesCommand","_args","themeName","previewStyle","BannersCommand","bannerName","BannerCommand","showBanner","StatusCommand","bufferSize","exportHandler","getExportHandler","errorCount","warningCount","ResetCommand","resetConfig","DemoCommand","setTimeout","logWithSVG","logAnimated","parseArguments","argParts","match","EXPORT_FORMATS","flag","l","p","parseInt","styled","ExportCommand","exported","CopyCommand","BufferSizeCommand","isNaN","ClearBufferCommand","stats","BufferInfoCommand","toLocaleString","HelpCommand","helpStyle","tip","HistoryCommand","category","processor","cliProcessor","limit","toLocaleTimeString","ClearHistoryCommand","InteractiveCommand","PluginsCommand","version","c","LEVEL_STYLES","Logger","scopedPrefix","themeChangeListener","displaySettings","showTimestamp","showLocation","showBadges","serializerRegistry","hookManager","transportManager","_showPrimitives","_serverFallback","createDefaultCLI","autoDetectTheme","setupAutoThemeDetection","setupThemeChangeListener","updates","previousAutoDetect","preset","themeBanner","catch","presetConfig","getSmartPreset","_activePreset","_activePresetName","getEnvironment","presets","hideTimestamp","hideLocation","hideBadges","component","api","_customization","addHandler","handler","addSerializer","removeSerializer","getSerializerRegistry","getHookManager","addTransport","removeTransport","flushTransports","closeTransports","getTransportManager","shouldLog","getEffectivePrefix","Boolean","parseStackTrace","formatTimestamp","serializedArgs","badgePrefix","additionalArgs","hookEntry","then","processed","createStyledOutput","finalFormat","repeat","writeOutput","column","function","colorCapability","getColorCapability","formatBadge","successStyle","successFormat","columns","tableStyle","StylePresets","collapsed","groupStyle","groupCollapsed","timerStyle","svgContent","width","height","svgDataUri","encodeURIComponent","svgStyle","getElementById","animatedStyle","animation","logGrouped","items","groupItems","isRunningInTerminal","getServerFallback","colorCap","output","renderStep","stderr","renderHeader","renderDivider","renderBox","renderTable","outputMode","SpinnerManager","NoopSpinner","mapping","CLI_LEVEL_MAP","showPrimitives","cliLevel","ServerFallback","mode","outputWriter","fullMessage","_defaultLogger","getDefaultLogger"],"mappings":"2IAQMA,EAA6C,CAC/CC,SAAU,EACVC,SAAU,cACVC,mBAAmB,GAGhB,MAAMC,mBACDC,+BAAkDC,IAClDC,OAER,WAAAC,CAAYD,EAA2B,IACnCE,KAAKF,OAAS,IAAKP,KAAmBO,GACtCE,KAAKC,kBACT,CAEQ,gBAAAA,GACJD,KAAKE,IAAIC,MAAQC,IAAA,CACbC,KAAMD,EAAIC,KACVC,QAASF,EAAIE,QACbC,MAAOH,EAAIG,OAAOC,MAAM,MAAMC,MAAM,EAAG,OACnCL,EAAIM,MAAQ,CAAEA,MAAOV,KAAKW,UAAUP,EAAIM,QAAW,CAAA,IACvD,KAEJV,KAAKE,IAAIU,KAAOC,IAAA,CACZC,IAAKD,EAAKE,cACVC,UAAWH,EAAKI,YAChB,IAEJjB,KAAKE,IAAIgB,OAASC,IAAA,CACdC,QAASD,EAAME,OACfC,MAAOH,EAAMG,QACb,IAEJtB,KAAKE,IAAIL,IAAK,CAAC0B,EAAoBC,KAC/B,MAAMC,EAA2B,CAAA,EASjC,OARAF,EAAIG,QAAQ,CAACC,EAAOC,KAChB,MAAMC,EAAwB,iBAARD,EAAmBE,KAAKC,UAAUH,GAAOI,OAAOJ,GACtEH,EAAII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KAAKF,OAAOirB,YAAc,UAGvC,GAAa,WAATQ,EAAJ,CAKA,GAAa,WAATA,GAAqBvrB,KAAKF,OAAO0rB,aAAc,CAC/C,MAAMC,EAActD,EAAeplB,OAAS,EACtC,GAAGzC,KAAW6nB,EAAe5mB,IAAImC,GAAK1B,OAAO0B,IAAIO,KAAK,OACtD3D,EAEN,YADAN,KAAKF,OAAO0rB,aAAaxjB,MAAMyjB,EAAa9jB,EAAO2I,EAEvD,CAGI6X,EAAeplB,OAAS,EACxBuI,QAAQC,IAAIjL,KAAYgQ,KAAW6X,GAEnC7c,QAAQC,IAAIjL,KAAYgQ,EAf5B,CAiBJ,CAuBA,SAAM8O,CAAIjB,GACDne,KAAKukB,mBAKJvkB,KAAKukB,aAAajF,eAAenB,EAASne,MAJ5CA,KAAKuG,MAAM,gCAKnB,EAOJ,IAAImlB,EAAgC,MAMpC,WACI,IAAKA,EAAgB,CACjBA,EAAiB,IAAI1G,OAAO,CACxBtE,UAAW,OACXE,cAAc,EACdE,kBAAkB,EAClBE,kBAAkB,EAClBoB,WAAY,MAIhB,IACIjY,mBACJ,OAAS5D,GAET,CACJ,CAEJ,CAGeolB"}
|
|
1
|
+
{"version":3,"file":"Logger-CKqzXDh3.js","sources":["../../src/serializers/SerializerRegistry.ts","../../src/hooks/HookManager.ts","../../src/types/core.ts","../../src/transports/TransportManager.ts","../../src/styling/themes.ts","../../src/styling/banners.ts","../../src/styling/SemanticStyles.ts","../../src/styling/LogStyleBuilder.ts","../../src/styling/SmartPresets.ts","../../src/ScopedLogger.ts","../../src/handlers/ExportLogHandler.ts","../../src/cli/CommandProcessor.ts","../../src/cli/commands/ConfigCommand.ts","../../src/cli/commands/ThemeCommand.ts","../../src/cli/commands/StatusCommand.ts","../../src/cli/commands/ExportCommand.ts","../../src/cli/help.ts","../../src/cli/commands/HistoryCommand.ts","../../src/Logger.ts","../../src/cli/index.ts"],"sourcesContent":["import type {\n SerializerFn,\n SerializerContext,\n SerializerEntry,\n SerializerConfig,\n ISerializerRegistry\n} from '../types/index.js';\n\nconst DEFAULT_CONFIG: Required<SerializerConfig> = {\n maxDepth: 5,\n circular: 'placeholder',\n preserveUndefined: false\n};\n\nexport class SerializerRegistry implements ISerializerRegistry {\n private serializers: Map<Function, SerializerEntry> = new Map();\n private config: Required<SerializerConfig>;\n\n constructor(config: SerializerConfig = {}) {\n this.config = { ...DEFAULT_CONFIG, ...config };\n this.registerDefaults();\n }\n\n private registerDefaults(): void {\n this.add(Error, (err: Error) => ({\n name: err.name,\n message: err.message,\n stack: err.stack?.split('\\n').slice(0, 10),\n ...(err.cause ? { cause: this.serialize(err.cause) } : {})\n }), 100);\n\n this.add(Date, (date: Date) => ({\n iso: date.toISOString(),\n timestamp: date.getTime()\n }), 90);\n\n this.add(RegExp, (regex: RegExp) => ({\n pattern: regex.source,\n flags: regex.flags\n }), 90);\n\n this.add(Map, (map: Map<any, any>, ctx) => {\n const obj: Record<string, any> = {};\n map.forEach((value, key) => {\n const keyStr = typeof key === 'object' ? JSON.stringify(key) : String(key);\n obj[keyStr] = this.serializeInternal(value, {\n ...ctx,\n depth: ctx.depth + 1,\n path: [...ctx.path, keyStr]\n });\n });\n return { __type: 'Map', entries: obj };\n }, 80);\n\n this.add(Set, (set: Set<any>, ctx) => ({\n __type: 'Set',\n values: Array.from(set).map((v, i) =>\n this.serializeInternal(v, {\n ...ctx,\n depth: ctx.depth + 1,\n path: [...ctx.path, `[${i}]`]\n })\n )\n }), 80);\n\n if (typeof Buffer !== 'undefined') {\n this.add(Buffer as any, (buf: Buffer) => ({\n __type: 'Buffer',\n length: buf.length,\n preview: buf.slice(0, 50).toString('hex')\n }), 70);\n }\n }\n\n add<T>(\n type: new (...args: any[]) => T,\n serializer: SerializerFn<T>,\n priority: number = 50\n ): void {\n this.serializers.set(type, { type, serializer, priority });\n }\n\n remove<T>(type: new (...args: any[]) => T): boolean {\n return this.serializers.delete(type);\n }\n\n has<T>(type: new (...args: any[]) => T): boolean {\n return this.serializers.has(type);\n }\n\n getAll(): SerializerEntry[] {\n return Array.from(this.serializers.values())\n .sort((a, b) => (b.priority ?? 50) - (a.priority ?? 50));\n }\n\n private findSerializer(value: any): SerializerEntry | null {\n const sorted = this.getAll();\n for (const entry of sorted) {\n if (value instanceof entry.type) {\n return entry;\n }\n }\n return null;\n }\n\n private serializeInternal(value: any, context: SerializerContext): any {\n if (value === null) return null;\n if (value === undefined) return this.config.preserveUndefined ? undefined : '[undefined]';\n if (typeof value === 'function') return `[Function: ${value.name || 'anonymous'}]`;\n if (typeof value !== 'object') return value;\n\n if (context.depth >= this.config.maxDepth) {\n return '[Max Depth]';\n }\n\n if (context.seen.has(value)) {\n switch (this.config.circular) {\n case 'error':\n throw new Error(`Circular reference at ${context.path.join('.')}`);\n case 'skip':\n return undefined;\n case 'placeholder':\n default:\n return '[Circular]';\n }\n }\n context.seen.add(value);\n\n const serializer = this.findSerializer(value);\n if (serializer) {\n return serializer.serializer(value, context);\n }\n\n if (Array.isArray(value)) {\n return value.map((item, i) =>\n this.serializeInternal(item, {\n ...context,\n depth: context.depth + 1,\n path: [...context.path, `[${i}]`]\n })\n );\n }\n\n const result: Record<string, any> = {};\n for (const [key, val] of Object.entries(value)) {\n result[key] = this.serializeInternal(val, {\n ...context,\n depth: context.depth + 1,\n path: [...context.path, key]\n });\n }\n return result;\n }\n\n serialize(value: any, config?: SerializerConfig): any {\n const mergedConfig = { ...this.config, ...config };\n return this.serializeInternal(value, {\n depth: 0,\n maxDepth: mergedConfig.maxDepth,\n path: [],\n seen: new WeakSet()\n });\n }\n}\n\nlet _defaultRegistry: SerializerRegistry | null = null;\n\nexport function getDefaultSerializerRegistry(): SerializerRegistry {\n if (!_defaultRegistry) {\n _defaultRegistry = new SerializerRegistry();\n }\n return _defaultRegistry;\n}\n","import type {\n HookLogEntry,\n HookEvent,\n HookCallback,\n MiddlewareFn,\n HookRegistration,\n MiddlewareRegistration,\n IHookManager\n} from '../types/index.js';\n\nfunction generateId(): string {\n return `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;\n}\n\nexport class HookManager implements IHookManager {\n private hooks: Map<HookEvent, HookRegistration[]> = new Map();\n private middlewares: MiddlewareRegistration[] = [];\n\n constructor() {\n this.hooks.set('beforeLog', []);\n this.hooks.set('afterLog', []);\n this.hooks.set('onError', []);\n }\n\n on(event: HookEvent, callback: HookCallback, priority: number = 50): () => void {\n const registration: HookRegistration = {\n id: generateId(),\n event,\n callback,\n priority,\n once: false\n };\n\n const hooks = this.hooks.get(event)!;\n hooks.push(registration);\n hooks.sort((a, b) => b.priority - a.priority);\n\n return () => this.removeHook(event, registration.id);\n }\n\n once(event: HookEvent, callback: HookCallback, priority: number = 50): () => void {\n const registration: HookRegistration = {\n id: generateId(),\n event,\n callback,\n priority,\n once: true\n };\n\n const hooks = this.hooks.get(event)!;\n hooks.push(registration);\n hooks.sort((a, b) => b.priority - a.priority);\n\n return () => this.removeHook(event, registration.id);\n }\n\n off(event: HookEvent, callback: HookCallback): boolean {\n const hooks = this.hooks.get(event);\n if (!hooks) return false;\n\n const index = hooks.findIndex(h => h.callback === callback);\n if (index >= 0) {\n hooks.splice(index, 1);\n return true;\n }\n return false;\n }\n\n private removeHook(event: HookEvent, id: string): void {\n const hooks = this.hooks.get(event);\n if (hooks) {\n const index = hooks.findIndex(h => h.id === id);\n if (index >= 0) {\n hooks.splice(index, 1);\n }\n }\n }\n\n use(middleware: MiddlewareFn, priority: number = 50): () => void {\n const registration: MiddlewareRegistration = {\n id: generateId(),\n fn: middleware,\n priority\n };\n\n this.middlewares.push(registration);\n this.middlewares.sort((a, b) => b.priority - a.priority);\n\n return () => {\n const index = this.middlewares.findIndex(m => m.id === registration.id);\n if (index >= 0) {\n this.middlewares.splice(index, 1);\n }\n };\n }\n\n async emit(event: HookEvent, entry: HookLogEntry): Promise<HookLogEntry> {\n const hooks = this.hooks.get(event) || [];\n let currentEntry = { ...entry };\n const toRemove: string[] = [];\n\n for (const hook of hooks) {\n try {\n const result = await hook.callback(currentEntry);\n if (result) {\n currentEntry = { ...currentEntry, ...result };\n }\n if (hook.once) {\n toRemove.push(hook.id);\n }\n } catch (error) {\n if (event !== 'onError') {\n await this.emit('onError', {\n ...currentEntry,\n error,\n hookEvent: event\n } as HookLogEntry);\n }\n }\n }\n\n toRemove.forEach(id => this.removeHook(event, id));\n return currentEntry;\n }\n\n async process(entry: HookLogEntry): Promise<HookLogEntry> {\n let currentEntry = { ...entry };\n\n currentEntry = await this.emit('beforeLog', currentEntry);\n\n if (this.middlewares.length > 0) {\n let index = 0;\n\n const executeNext = async (): Promise<void> => {\n if (index < this.middlewares.length) {\n const middleware = this.middlewares[index++];\n if (middleware) {\n await middleware.fn(currentEntry, executeNext);\n }\n }\n };\n\n await executeNext();\n }\n\n return currentEntry;\n }\n\n async afterProcess(entry: HookLogEntry): Promise<void> {\n await this.emit('afterLog', entry);\n }\n\n clear(): void {\n this.hooks.forEach(hooks => hooks.length = 0);\n this.middlewares.length = 0;\n }\n\n getStats(): { hooks: Record<HookEvent, number>; middlewares: number } {\n return {\n hooks: {\n beforeLog: this.hooks.get('beforeLog')?.length || 0,\n afterLog: this.hooks.get('afterLog')?.length || 0,\n onError: this.hooks.get('onError')?.length || 0\n },\n middlewares: this.middlewares.length\n };\n }\n}\n\nlet _defaultHookManager: HookManager | null = null;\n\nexport function getDefaultHookManager(): HookManager {\n if (!_defaultHookManager) {\n _defaultHookManager = new HookManager();\n }\n return _defaultHookManager;\n}\n","/**\n * @fileoverview Definiciones de tipos principales para Better Logger\n * @version 0.3.0\n * @since 2024\n */\n\n/**\n * Niveles de log soportados en orden jerárquico (debug < info < warn < error < critical)\n * \n * @constant {Object} LOG_LEVELS\n * @property {number} debug - Nivel 0: Información de depuración detallada\n * @property {number} info - Nivel 1: Mensajes informativos generales\n * @property {number} warn - Nivel 2: Advertencias que no detienen la ejecución\n * @property {number} error - Nivel 3: Errores que pueden afectar funcionalidad\n * @property {number} critical - Nivel 4: Errores críticos que requieren atención inmediata\n * \n * @example\n * // Verificar si un nivel debe mostrarse\n * if (LOG_LEVELS[currentLevel] >= LOG_LEVELS.warn) {\n * // Mostrar solo warn, error y critical\n * }\n */\nexport const LOG_LEVELS = {\n debug: 0,\n info: 1,\n warn: 2,\n error: 3,\n critical: 4,\n} as const;\n\n/**\n * Tipo de nivel de log derivado de las claves de LOG_LEVELS\n * @typedef {'debug' | 'info' | 'warn' | 'error' | 'critical'} LogLevel\n */\nexport type LogLevel = keyof typeof LOG_LEVELS;\n\n/**\n * Tipo de nivel de verbosidad para filtrar logs\n * @typedef {LogLevel | 'silent'} Verbosity\n * @description 'silent' desactiva completamente todos los logs\n */\nexport type Verbosity = LogLevel | 'silent';\n\n/**\n * Variantes de tema para diferentes estilos visuales\n * @typedef {'default' | 'dark' | 'light' | 'neon' | 'minimal' | 'cyberpunk'} ThemeVariant\n * \n * @description\n * - default: Tema adaptativo automático (claro/oscuro)\n * - dark: Tema oscuro con colores vibrantes\n * - light: Tema claro con colores suaves\n * - neon: Colores neón brillantes con efectos de resplandor\n * - minimal: Diseño minimalista y limpio\n * - cyberpunk: Estilo futurista con neón y efectos\n */\nexport type ThemeVariant = 'default' | 'dark' | 'light' | 'neon' | 'minimal' | 'cyberpunk';\n\n/**\n * Detección de tema de DevTools del navegador\n * @typedef {'light' | 'dark'} DevToolsTheme\n */\nexport type DevToolsTheme = 'light' | 'dark';\n\n/**\n * Tipos de banner para diferentes enfoques visuales\n * @typedef {'simple' | 'ascii' | 'unicode' | 'svg' | 'animated'} BannerType\n * \n * @description\n * - simple: Texto simple sin decoración\n * - ascii: Arte ASCII tradicional\n * - unicode: Caracteres Unicode decorativos\n * - svg: Gráfico SVG embebido\n * - animated: Banner con animación CSS\n */\nexport type BannerType = 'simple' | 'ascii' | 'unicode' | 'svg' | 'animated';\n\n/**\n * Formatos de exportación para datos de log\n * @typedef {'json' | 'csv' | 'markdown' | 'plain' | 'html'} ExportFormat\n *\n * @description\n * - json: Formato JSON estructurado\n * - csv: Valores separados por comas para Excel/Sheets\n * - markdown: Formato Markdown para documentación\n * - plain: Texto plano sin formato\n * - html: HTML con estilos para visualización web\n */\nexport type ExportFormat = 'json' | 'csv' | 'markdown' | 'plain' | 'html';\n\n/**\n * Formatos de salida para diferentes entornos\n * @typedef {'auto' | 'plain' | 'ansi' | 'build' | 'ci'} OutputFormat\n *\n * @description\n * - auto: Detección automática basada en entorno (recomendado)\n * - plain: Texto plano sin colores (máxima compatibilidad)\n * - ansi: Colores ANSI para terminales modernos\n * - build: Formato optimizado para builds (Next.js, webpack, etc.)\n * - ci: Formato optimizado para CI/CD (sin emojis, texto simple)\n */\nexport type OutputFormat = 'auto' | 'plain' | 'ansi' | 'build' | 'ci';\n\n/**\n * Output modes for controlling where logs are written\n * @typedef {'console' | 'silent' | 'custom'} OutputMode\n *\n * @description\n * - console: Standard console.log output (default)\n * - silent: No output at all\n * - custom: Use custom OutputWriter for advanced scenarios\n */\nexport type OutputMode = 'console' | 'silent' | 'custom';\n\n/**\n * Custom output writer interface for redirecting log output\n *\n * @interface OutputWriter\n * @since 4.0.0\n *\n * @description\n * Allows redirecting log output to custom destinations like:\n * - DraftLog for CLI spinners with concurrent logging\n * - Buffers for collecting logs during operations\n * - Custom streams or transports\n *\n * @example\n * class BufferWriter implements OutputWriter {\n * private buffer: string[] = [];\n *\n * write(message: string, level: LogLevel, styles: string[]): void {\n * this.buffer.push(message);\n * }\n *\n * flush(): void {\n * this.buffer.forEach(msg => console.log(msg));\n * this.buffer = [];\n * }\n * }\n */\nexport interface OutputWriter {\n write(message: string, level: LogLevel, styles: string[]): void;\n flush?(): void;\n}\n\n/**\n * Interfaz de configuración para instancias del logger\n * \n * @interface LoggerConfig\n * @since 0.3.0\n * \n * @example\n * const config: LoggerConfig = {\n * globalPrefix: 'MiApp',\n * verbosity: 'info',\n * enableColors: true,\n * enableTimestamps: true,\n * enableStackTrace: false,\n * theme: 'cyberpunk',\n * bannerType: 'animated',\n * bufferSize: 500,\n * autoDetectTheme: true\n * };\n */\nexport interface LoggerConfig {\n globalPrefix?: string;\n verbosity: Verbosity;\n enableColors: boolean;\n enableTimestamps: boolean;\n enableStackTrace: boolean;\n theme?: ThemeVariant;\n bannerType?: BannerType;\n bufferSize?: number;\n autoDetectTheme?: boolean;\n outputFormat?: OutputFormat;\n /** Output mode: 'console' (default), 'silent', or 'custom' @since 4.0.0 */\n outputMode?: OutputMode;\n /** Custom writer when outputMode is 'custom' @since 4.0.0 */\n outputWriter?: OutputWriter;\n /** CLI verbosity level for controlling primitive output @since 5.0.0 */\n cliLevel?: CLILogLevel;\n}\n\n/**\n * Información parseada del stack trace\n * \n * @interface StackInfo\n * @description Contiene la ubicación exacta donde se originó el log\n */\nexport interface StackInfo {\n file: string;\n line: number;\n column: number;\n function?: string;\n}\n\n/**\n * Entrada de temporizador para medición de rendimiento\n * \n * @interface TimerEntry\n * @description Usado internamente para rastrear temporizadores activos\n */\nexport interface TimerEntry {\n label: string;\n startTime: number;\n}\n\n/**\n * Opciones para estilizar componentes\n * \n * @interface StyleOptions\n * @description Configuración de dimensiones y espaciado para elementos visuales\n */\nexport interface StyleOptions {\n width?: number;\n height?: number;\n padding?: string;\n}\n\n/**\n * Configuración de colores adaptativos para temas claro/oscuro\n * \n * @interface AdaptiveColors\n * @description Define colores que se ajustan automáticamente al tema del navegador\n */\nexport interface AdaptiveColors {\n light: string;\n dark: string;\n}\n\n/**\n * Configuración de espaciado para elementos del log\n * @typedef {'compact' | 'normal' | 'spacious'} SpacingType\n * \n * @description\n * - compact: Espaciado mínimo para más densidad\n * - normal: Espaciado estándar balanceado\n * - spacious: Espaciado amplio para mejor legibilidad\n */\nexport type SpacingType = 'compact' | 'normal' | 'spacious';\n\n/**\n * Configuración de layout para la estructura del log\n * \n * @interface LogLayout\n * @description Define cómo se organizan visualmente los elementos del log\n */\nexport interface LogLayout {\n spacing: SpacingType;\n innerPadding?: string;\n outerMargin?: string;\n separator?: string;\n}\n\n/**\n * Configuración para partes individuales del log\n * \n * @interface LogPartConfig\n * @description Permite personalizar cada elemento del log por separado\n * \n * @example\n * const timestampConfig: LogPartConfig = {\n * show: true,\n * color: '#888',\n * font: 'Monaco',\n * size: '11px'\n * };\n */\nexport interface LogPartConfig {\n show?: boolean;\n style?: string;\n font?: string;\n size?: string;\n color?: string; // Automatically adaptive by default\n background?: string;\n padding?: string;\n margin?: string;\n border?: string;\n shadow?: string;\n uppercase?: boolean;\n}\n\n/**\n * Configuración completa de estilos del log\n * \n * @interface LogStyles\n * @description Agrupa todas las opciones de estilo en una sola configuración\n * @since 0.3.0\n */\nexport interface LogStyles {\n layout?: LogLayout;\n timestamp?: LogPartConfig;\n level?: LogPartConfig;\n prefix?: LogPartConfig;\n message?: LogPartConfig;\n location?: LogPartConfig;\n backdrop?: string;\n transparency?: number;\n}\n\nexport interface TimerResult {\n label: string;\n duration: number;\n startTime: number;\n endTime: number;\n}\n\nexport interface IScopedLogger {\n debug(...args: any[]): void;\n info(...args: any[]): void;\n warn(...args: any[]): void;\n error(...args: any[]): void;\n success(...args: any[]): void;\n critical(...args: any[]): void;\n trace(...args: any[]): void;\n\n badges(badges: string[]): this;\n badge(badge: string): this;\n clearBadges(): this;\n\n time(label: string): void;\n timeEnd(label: string): number | undefined;\n\n style(presetName: string): this;\n}\n\nexport interface IAPILogger extends IScopedLogger {\n slow(message: string, duration?: number): void;\n rateLimit(message: string): void;\n auth(message: string): void;\n deprecated(message: string): void;\n}\n\nexport interface IComponentLogger extends IScopedLogger {\n lifecycle(event: string, message?: string): void;\n stateChange(from: string, to: string, data?: any): void;\n propsChange(changes: Record<string, any>): void;\n}\n\nexport interface Bindings {\n scope?: string;\n badges?: string[];\n type?: 'scope' | 'api' | 'component';\n context?: string[];\n}\n\nexport type BadgeStyle = 'brackets' | 'rounded' | 'plain' | 'unicode' | 'pill';\n\nexport type TimestampFormat = 'iso' | 'time' | 'timeMs' | 'relative' | 'elapsed' | 'date' | 'custom';\n\nexport type ColumnAlign = 'left' | 'right' | 'center';\n\nexport interface ColumnConfig {\n content: string;\n width?: number;\n align?: ColumnAlign;\n color?: string;\n}\n\nexport interface LogOptions {\n rightAlign?: string;\n columns?: ColumnConfig[];\n maxWidth?: number;\n keyValue?: boolean;\n badgeStyle?: BadgeStyle;\n timestampFormat?: TimestampFormat;\n}\n\n// ===== CLI PRIMITIVES (v5.0) =====\n\n/**\n * CLI verbosity levels for controlling primitive output\n * @since 5.0.0\n */\nexport type CLILogLevel = 'silent' | 'quiet' | 'normal' | 'verbose' | 'debug';\n\n/**\n * Handle returned by logger.spinner() for controlling spinner lifecycle\n * @since 5.0.0\n */\nexport interface ISpinnerHandle {\n /** Start the spinner animation */\n start(): void;\n /** Stop the spinner without a status message */\n stop(): void;\n /** Stop the spinner with a success message */\n succeed(msg?: string): void;\n /** Stop the spinner with a failure message */\n fail(msg?: string): void;\n /** Update the spinner text while running */\n text(msg: string): void;\n}\n\n/**\n * Options for logger.box() output\n * @since 5.0.0\n */\nexport interface IBoxOptions {\n /** Title displayed in the top border */\n title?: string;\n /** Color of the border (hex, CSS name, or ANSI name) */\n borderColor?: string;\n /** Border character style */\n borderStyle?: 'single' | 'double' | 'rounded' | 'bold';\n /** Inner padding lines (default: 0) */\n padding?: number;\n}\n\n/**\n * Options for logger.cliTable() output\n * @since 5.0.0\n */\nexport interface ITableOptions {\n /** Column names to display (overrides auto-detection) */\n columns?: string[];\n /** Header labels (defaults to column names) */\n head?: string[];\n}","import type {\n TransportRecord,\n TransportTarget,\n TransportOptions,\n ITransport,\n ITransportManager,\n LogLevel\n} from '../types/index.js';\nimport { LOG_LEVELS } from '../types/index.js';\n\nfunction generateTransportId(): string {\n return `transport-${Date.now()}-${Math.random().toString(36).substr(2, 6)}`;\n}\n\ninterface TransportEntry {\n id: string;\n transport: ITransport;\n options: TransportOptions;\n level: LogLevel;\n levelValue: number;\n}\n\nexport class TransportManager implements ITransportManager {\n private transports: Map<string, TransportEntry> = new Map();\n private defaultLevel: LogLevel = 'info';\n\n constructor(defaultLevel?: LogLevel) {\n if (defaultLevel) {\n this.defaultLevel = defaultLevel;\n }\n }\n\n add(target: TransportTarget): string {\n const id = generateTransportId();\n const level = target.level || this.defaultLevel;\n\n let transport: ITransport;\n\n if (typeof target.target === 'string') {\n throw new Error(`String transport targets not supported. Use inline transport object.`);\n } else {\n transport = target.target;\n }\n\n const entry: TransportEntry = {\n id,\n transport,\n options: target.options || {},\n level,\n levelValue: LOG_LEVELS[level]\n };\n\n this.transports.set(id, entry);\n return id;\n }\n\n remove(id: string): boolean {\n const entry = this.transports.get(id);\n if (entry) {\n entry.transport.close?.();\n return this.transports.delete(id);\n }\n return false;\n }\n\n async write(record: TransportRecord): Promise<void> {\n const promises: Promise<void>[] = [];\n\n for (const entry of this.transports.values()) {\n if (record.levelValue < entry.levelValue) {\n continue;\n }\n\n let transformedRecord = record;\n if (entry.options.transform) {\n const result = entry.options.transform(record);\n if (result === null) continue;\n transformedRecord = result;\n }\n\n const result = entry.transport.write(transformedRecord);\n if (result instanceof Promise) {\n promises.push(result);\n }\n }\n\n await Promise.all(promises);\n }\n\n async flush(): Promise<void> {\n const promises: Promise<void>[] = [];\n\n for (const entry of this.transports.values()) {\n if (entry.transport.flush) {\n const result = entry.transport.flush();\n if (result instanceof Promise) {\n promises.push(result);\n }\n }\n }\n\n await Promise.all(promises);\n }\n\n async close(): Promise<void> {\n await this.flush();\n\n const promises: Promise<void>[] = [];\n\n for (const entry of this.transports.values()) {\n if (entry.transport.close) {\n const result = entry.transport.close();\n if (result instanceof Promise) {\n promises.push(result);\n }\n }\n }\n\n await Promise.all(promises);\n this.transports.clear();\n }\n\n get count(): number {\n return this.transports.size;\n }\n\n list(): string[] {\n return Array.from(this.transports.keys());\n }\n}\n","/**\n * @fileoverview Theme presets for Advanced Logger\n */\n\nimport type { ThemeVariant } from '../types/index.js';\nimport type { LevelStyleConfig } from '../utils/index.js';\n\n/**\n * Theme configurations for different visual styles\n */\nexport const THEME_PRESETS: Record<ThemeVariant, Record<string, LevelStyleConfig>> = {\n default: {\n debug: {\n emoji: '🐞', label: 'DEBUG',\n background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',\n color: '#ffffff', border: '1px solid #667eea',\n shadow: '0 2px 4px rgba(102, 126, 234, 0.3)',\n },\n info: {\n emoji: 'ℹ️', label: 'INFO',\n background: 'linear-gradient(135deg, #74b9ff 0%, #0984e3 100%)',\n color: '#ffffff', border: '1px solid #74b9ff',\n shadow: '0 2px 4px rgba(116, 185, 255, 0.3)',\n },\n warn: {\n emoji: '⚠️', label: 'WARN',\n background: 'linear-gradient(135deg, #fdcb6e 0%, #e17055 100%)',\n color: '#2d3436', border: '1px solid #fdcb6e',\n shadow: '0 2px 4px rgba(253, 203, 110, 0.3)',\n },\n error: {\n emoji: '❌', label: 'ERROR',\n background: 'linear-gradient(135deg, #e84393 0%, #d63031 100%)',\n color: '#ffffff', border: '1px solid #e84393',\n shadow: '0 2px 4px rgba(232, 67, 147, 0.3)',\n },\n success: {\n emoji: '✅', label: 'SUCCESS',\n background: 'linear-gradient(135deg, #00b894 0%, #00a085 100%)',\n color: '#ffffff', border: '1px solid #00b894',\n shadow: '0 2px 4px rgba(0, 184, 148, 0.3)',\n },\n critical: {\n emoji: '🔥', label: 'CRITICAL',\n background: 'linear-gradient(135deg, #ff3838 0%, #ff1744 100%)',\n color: '#ffffff', border: '2px solid #ff3838',\n shadow: '0 4px 8px rgba(255, 56, 56, 0.5)',\n },\n },\n dark: {\n debug: {\n emoji: '🌙', label: 'DEBUG',\n background: 'linear-gradient(135deg, #2d3748 0%, #4a5568 100%)',\n color: '#e2e8f0', border: '1px solid #4a5568',\n shadow: '0 2px 4px rgba(45, 55, 72, 0.8)',\n },\n info: {\n emoji: '💡', label: 'INFO',\n background: 'linear-gradient(135deg, #1a202c 0%, #2d3748 100%)',\n color: '#90cdf4', border: '1px solid #3182ce',\n shadow: '0 2px 4px rgba(26, 32, 44, 0.8)',\n },\n warn: {\n emoji: '⚡', label: 'WARN',\n background: 'linear-gradient(135deg, #744210 0%, #975a16 100%)',\n color: '#faf089', border: '1px solid #d69e2e',\n shadow: '0 2px 4px rgba(116, 66, 16, 0.8)',\n },\n error: {\n emoji: '💀', label: 'ERROR',\n background: 'linear-gradient(135deg, #742a2a 0%, #9b2c2c 100%)',\n color: '#feb2b2', border: '1px solid #e53e3e',\n shadow: '0 2px 4px rgba(116, 42, 42, 0.8)',\n },\n success: {\n emoji: '🎯', label: 'SUCCESS',\n background: 'linear-gradient(135deg, #276749 0%, #2f855a 100%)',\n color: '#9ae6b4', border: '1px solid #38a169',\n shadow: '0 2px 4px rgba(39, 103, 73, 0.8)',\n },\n critical: {\n emoji: '💥', label: 'CRITICAL',\n background: 'linear-gradient(135deg, #1a1a1a 0%, #ff0000 100%)',\n color: '#ffffff', border: '2px solid #ff0000',\n shadow: '0 4px 8px rgba(255, 0, 0, 0.9)',\n },\n },\n neon: {\n debug: {\n emoji: '⚡', label: 'DEBUG',\n background: 'linear-gradient(135deg, #0f3460 0%, #e94560 100%)',\n color: '#00ffff', border: '1px solid #00ffff',\n shadow: '0 0 10px rgba(0, 255, 255, 0.5)',\n },\n info: {\n emoji: '🔮', label: 'INFO',\n background: 'linear-gradient(135deg, #16213e 0%, #0f3460 100%)',\n color: '#00ff41', border: '1px solid #00ff41',\n shadow: '0 0 10px rgba(0, 255, 65, 0.5)',\n },\n warn: {\n emoji: '⚠️', label: 'WARN',\n background: 'linear-gradient(135deg, #533a03 0%, #e94560 100%)',\n color: '#ffff00', border: '1px solid #ffff00',\n shadow: '0 0 10px rgba(255, 255, 0, 0.5)',\n },\n error: {\n emoji: '💥', label: 'ERROR',\n background: 'linear-gradient(135deg, #5c0a0a 0%, #ff073a 100%)',\n color: '#ff073a', border: '1px solid #ff073a',\n shadow: '0 0 10px rgba(255, 7, 58, 0.8)',\n },\n success: {\n emoji: '✨', label: 'SUCCESS',\n background: 'linear-gradient(135deg, #0a5c0a 0%, #39ff14 100%)',\n color: '#39ff14', border: '1px solid #39ff14',\n shadow: '0 0 10px rgba(57, 255, 20, 0.8)',\n },\n critical: {\n emoji: '🌟', label: 'CRITICAL',\n background: 'linear-gradient(135deg, #000000 0%, #ff0080 100%)',\n color: '#ff0080', border: '2px solid #ff0080',\n shadow: '0 0 20px rgba(255, 0, 128, 1)',\n },\n },\n minimal: {\n debug: {\n emoji: '', label: 'DEBUG',\n background: '#f7fafc', color: '#4a5568',\n border: '1px solid #e2e8f0', shadow: 'none',\n },\n info: {\n emoji: '', label: 'INFO',\n background: '#ebf8ff', color: '#2b6cb0',\n border: '1px solid #bee3f8', shadow: 'none',\n },\n warn: {\n emoji: '', label: 'WARN',\n background: '#fffbf0', color: '#c05621',\n border: '1px solid #fed7aa', shadow: 'none',\n },\n error: {\n emoji: '', label: 'ERROR',\n background: '#fef5f5', color: '#c53030',\n border: '1px solid #fca5a5', shadow: 'none',\n },\n success: {\n emoji: '', label: 'SUCCESS',\n background: '#f0fff4', color: '#2f855a',\n border: '1px solid #9ae6b4', shadow: 'none',\n },\n critical: {\n emoji: '', label: 'CRITICAL',\n background: '#fef5f5', color: '#e53e3e',\n border: '2px solid #f56565', shadow: 'none',\n },\n },\n // Additional theme variants can be added here\n light: {\n debug: {\n emoji: '🔍', label: 'DEBUG',\n background: 'linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%)',\n color: '#1565c0', border: '1px solid #90caf9',\n shadow: '0 1px 3px rgba(33, 150, 243, 0.2)',\n },\n info: {\n emoji: 'ℹ️', label: 'INFO',\n background: 'linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%)',\n color: '#7b1fa2', border: '1px solid #ce93d8',\n shadow: '0 1px 3px rgba(156, 39, 176, 0.2)',\n },\n warn: {\n emoji: '⚠️', label: 'WARN',\n background: 'linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%)',\n color: '#f57c00', border: '1px solid #ffcc02',\n shadow: '0 1px 3px rgba(255, 152, 0, 0.2)',\n },\n error: {\n emoji: '❌', label: 'ERROR',\n background: 'linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%)',\n color: '#d32f2f', border: '1px solid #f44336',\n shadow: '0 1px 3px rgba(244, 67, 54, 0.2)',\n },\n success: {\n emoji: '✅', label: 'SUCCESS',\n background: 'linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%)',\n color: '#388e3c', border: '1px solid #4caf50',\n shadow: '0 1px 3px rgba(76, 175, 80, 0.2)',\n },\n critical: {\n emoji: '🚨', label: 'CRITICAL',\n background: 'linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%)',\n color: '#c2185b', border: '2px solid #e91e63',\n shadow: '0 2px 6px rgba(233, 30, 99, 0.3)',\n },\n },\n cyberpunk: {\n debug: {\n emoji: '🤖', label: 'DEBUG',\n background: 'linear-gradient(135deg, #0d1b2a 0%, #415a77 100%)',\n color: '#00d4aa', border: '1px solid #00d4aa',\n shadow: '0 0 15px rgba(0, 212, 170, 0.4)',\n },\n info: {\n emoji: '🔗', label: 'INFO',\n background: 'linear-gradient(135deg, #1b263b 0%, #0d1b2a 100%)',\n color: '#00b4d8', border: '1px solid #00b4d8',\n shadow: '0 0 15px rgba(0, 180, 216, 0.4)',\n },\n warn: {\n emoji: '⚡', label: 'WARN',\n background: 'linear-gradient(135deg, #f72585 0%, #b5179e 100%)',\n color: '#ffff3f', border: '1px solid #ffff3f',\n shadow: '0 0 15px rgba(255, 255, 63, 0.4)',\n },\n error: {\n emoji: '💀', label: 'ERROR',\n background: 'linear-gradient(135deg, #7209b7 0%, #480ca8 100%)',\n color: '#ff006e', border: '1px solid #ff006e',\n shadow: '0 0 15px rgba(255, 0, 110, 0.6)',\n },\n success: {\n emoji: '⚡', label: 'SUCCESS',\n background: 'linear-gradient(135deg, #003566 0%, #001d3d 100%)',\n color: '#00f5ff', border: '1px solid #00f5ff',\n shadow: '0 0 15px rgba(0, 245, 255, 0.4)',\n },\n critical: {\n emoji: '💥', label: 'CRITICAL',\n background: 'linear-gradient(135deg, #000000 0%, #ff0040 100%)',\n color: '#ff0040', border: '2px solid #ff0040',\n shadow: '0 0 25px rgba(255, 0, 64, 0.8)',\n },\n },\n};","/**\n * @fileoverview Banner configurations for Advanced Logger\n */\n\nimport type { BannerType, ThemeVariant } from '../types/index.js';\n\n/**\n * Banner variants for different display capabilities\n */\nexport const BANNER_VARIANTS = {\n simple: {\n text: '🚀 ADVANCED LOGGER v2.0.0 - State-of-the-art Console Styling 🚀',\n style: 'background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 12px 20px; border-radius: 8px; font-weight: bold; font-size: 14px;'\n },\n ascii: {\n text: `\n ___ ____ _ __ ___ _ __ _____ _____ ____ __ ___ _____ _____ _____ ____ \n / _ \\\\ / __ \\\\| | / / / _ \\\\ | \\\\ | |/ ____| ____| _ \\\\ | | / _ \\\\ / ____| ___| _ | _ \\\\ \n / /_\\\\ \\\\ / / _\\` | |/ / / /_\\\\ \\\\ | \\\\| | | | |__ | | | | | | / / \\\\ \\\\| | __| |_ | |_| | |_) |\n | _ || | (_| | < | _ | | . \\` | | | __| | | | | | | | | | | | |_ | _| | /| _ < \n | | | |\\\\ \\\\__,_|_|\\\\_\\\\ | | | | | |\\\\ | |___| |____| |_| | | |__\\\\ \\\\_/ /| |__| | |___| |\\\\ \\\\| |_) |\n \\\\_| |_/ \\\\____/ \\\\_| |_/ |_| \\\\_|\\\\_____|______|____/ |_____/\\\\___/ \\\\_____|_____|_| \\\\_|____/\n\n Advanced Logger v2.0.0 - Console Excellence`,\n style: 'font-family: \"Courier New\", Consolas, Monaco, monospace; color: #667eea; font-size: 11px; line-height: 1.2;'\n },\n unicode: {\n text: `\n╔══════════════════════════════════════════════════════════════════════════╗\n║ 🚀 ADVANCED LOGGER v2.0.0 ║\n║ State-of-the-art Console Styling ║ \n╚══════════════════════════════════════════════════════════════════════════╝`,\n style: 'font-family: \"Courier New\", Consolas, Monaco, monospace; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 15px; border-radius: 8px; font-size: 12px; line-height: 1.3;'\n },\n svg: {\n text: ' ',\n style: `\n background-image: url(\"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 80'><defs><linearGradient id='grad' x1='0%' y1='0%' x2='100%' y2='0%'><stop offset='0%' style='stop-color:%23667eea'/><stop offset='100%' style='stop-color:%23764ba2'/></linearGradient></defs><rect width='100%' height='100%' fill='url(%23grad)' rx='8'/><text x='200' y='30' text-anchor='middle' fill='white' font-family='monospace' font-size='14' font-weight='bold'>🚀 ADVANCED LOGGER</text><text x='200' y='50' text-anchor='middle' fill='white' font-family='monospace' font-size='12'>State-of-the-art Console Styling</text><text x='200' y='65' text-anchor='middle' fill='white' font-family='monospace' font-size='10'>v2.0.0</text></svg>\");\n background-repeat: no-repeat;\n background-size: 400px 80px;\n padding: 40px 200px;\n color: transparent;\n display: inline-block;\n border-radius: 8px;\n `\n },\n animated: {\n text: ' 🚀 ADVANCED LOGGER v2.0.0 ',\n style: `\n background: linear-gradient(-45deg, #667eea, #764ba2, #667eea, #764ba2);\n background-size: 400% 400%;\n color: white;\n padding: 15px 25px;\n border-radius: 10px;\n font-weight: bold;\n font-size: 14px;\n font-family: monospace;\n animation: gradientShift 3s ease infinite;\n display: inline-block;\n `\n }\n};\n\n/**\n * Theme-specific banners for enhanced visual theming\n */\nexport const THEME_BANNERS: Record<ThemeVariant, { simple: string; style: string }> = {\n default: {\n simple: '🚀 ADVANCED LOGGER v2.0.0 - State-of-the-art Console Styling 🚀',\n style: 'background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 12px 20px; border-radius: 8px; font-weight: bold;'\n },\n dark: {\n simple: '🌙 ADVANCED LOGGER v2.0.0 - Dark Mode Console Excellence 🌙',\n style: 'background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%); color: #e2e8f0; padding: 12px 20px; border-radius: 8px; font-weight: bold; border: 1px solid #4a5568;'\n },\n neon: {\n simple: '⚡ ADVANCED LOGGER v2.0.0 - Cyberpunk Console Experience ⚡',\n style: 'background: linear-gradient(135deg, #0f3460 0%, #e94560 100%); color: #00ffff; padding: 12px 20px; border-radius: 8px; font-weight: bold; text-shadow: 0 0 10px #00ffff;'\n },\n minimal: {\n simple: 'ADVANCED LOGGER v2.0.0 - Clean Console Styling',\n style: 'background: #f7fafc; color: #2d3748; padding: 8px 16px; border: 1px solid #e2e8f0; border-radius: 4px; font-weight: 500;'\n },\n light: {\n simple: '☀️ ADVANCED LOGGER v2.0.0 - Bright Console Styling ☀️',\n style: 'background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); color: #495057; padding: 12px 20px; border-radius: 8px; font-weight: bold; border: 1px solid #dee2e6;'\n },\n cyberpunk: {\n simple: '🤖 ADVANCED LOGGER v2.0.0 - Neural Console Interface 🤖',\n style: 'background: linear-gradient(135deg, #0d1b2a 0%, #415a77 100%); color: #00d4aa; padding: 12px 20px; border-radius: 8px; font-weight: bold; text-shadow: 0 0 10px #00d4aa; border: 1px solid #00d4aa;'\n }\n};\n\n/**\n * Feature detection for banner capabilities\n */\nexport function detectBannerCapabilities(): BannerType {\n // Try to detect browser capabilities\n const userAgent = navigator.userAgent;\n const isChrome = /Chrome/.test(userAgent);\n const isFirefox = /Firefox/.test(userAgent);\n const isSafari = /Safari/.test(userAgent) && !/Chrome/.test(userAgent);\n \n // Check for SVG support (most modern browsers)\n const supportsSVG = !!document.createElementNS && \n !!document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect;\n \n // Check for CSS animation support\n const supportsAnimations = typeof document !== 'undefined' && \n 'animationName' in document.createElement('div').style;\n \n // Progressive enhancement\n if (supportsAnimations && isChrome) {\n return 'animated';\n } else if (supportsSVG && (isChrome || isFirefox)) {\n return 'svg';\n } else if (isChrome || isFirefox) {\n return 'unicode';\n } else if (isSafari) {\n return 'ascii';\n }\n \n return 'simple';\n}\n\n/**\n * Display initialization banner with advanced styling\n */\nexport function displayInitBanner(bannerType?: BannerType): void {\n const selectedType = bannerType || detectBannerCapabilities();\n const banner = BANNER_VARIANTS[selectedType];\n \n // Add CSS animation keyframes if needed\n if (selectedType === 'animated') {\n const style = document.createElement('style');\n style.textContent = `\n @keyframes gradientShift {\n 0% { background-position: 0% 50%; }\n 50% { background-position: 100% 50%; }\n 100% { background-position: 0% 50%; }\n }\n `;\n document.head.appendChild(style);\n }\n \n console.log(`%c${banner.text}`, banner.style);\n\n // Show feature highlights\n const features = [\n '🎨 Advanced CSS Console Styling',\n '📍 Automatic Stack Trace Parsing',\n '🔧 Scoped Loggers & Prefixes',\n '⚡ Performance Timers',\n '🎯 Verbosity Filtering',\n '🔌 Extensible Handlers',\n '📱 Modern TypeScript Patterns',\n '📤 Export & Clipboard Support'\n ];\n\n console.group(`%c✨ Features`, 'background: #f8f9fa; color: #495057; padding: 4px 8px; border-radius: 4px; font-weight: bold;');\n\n features.forEach(feature => {\n console.log(`%c${feature}`, 'color: #6c757d; font-size: 13px;');\n });\n\n console.groupEnd();\n console.log(''); // Add spacing\n}","/**\n * @fileoverview Semantic styling system for Advanced Logger\n */\n\nimport { StyleBuilder } from './StyleBuilder.js';\nimport type { AdaptiveColors } from '../types/index.js';\nimport { ADAPTIVE_COLORS } from '../constants.js';\nimport { getAdaptiveColor } from '../utils/output.js';\n\n/**\n * Base semantic styler with common style methods\n */\nexport abstract class BaseStyler {\n protected builder: StyleBuilder;\n\n constructor(builder: StyleBuilder = new StyleBuilder()) {\n this.builder = builder;\n }\n\n /**\n * Primary brand color (typically blue)\n */\n primary(): this {\n return this.color('#007bff');\n }\n\n /**\n * Secondary color (typically gray)\n */\n secondary(): this {\n return this.color('#6c757d');\n }\n\n /**\n * Accent color for highlights\n */\n accent(): this {\n return this.color('#17a2b8');\n }\n\n /**\n * Muted/subtle color - automatically adaptive\n */\n muted(): this {\n const mutedColors: AdaptiveColors = { light: '#6c757d', dark: '#a0aec0' };\n return this.color(getAdaptiveColor(mutedColors));\n }\n\n /**\n * Success color (green)\n */\n success(): this {\n return this.color('#28a745');\n }\n\n /**\n * Warning color (yellow/orange)\n */\n warning(): this {\n return this.color('#ffc107');\n }\n\n /**\n * Danger/error color (red)\n */\n danger(): this {\n return this.color('#dc3545');\n }\n\n /**\n * Monospace font family\n */\n mono(): this {\n this.builder.font('Monaco, Consolas, \"Courier New\", monospace');\n return this;\n }\n\n /**\n * System font family\n */\n system(): this {\n this.builder.font('system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif');\n return this;\n }\n\n /**\n * Readable font optimized for text\n */\n readable(): this {\n this.builder.font('Georgia, \"Times New Roman\", serif');\n return this;\n }\n\n /**\n * Compact spacing\n */\n compact(): this {\n this.builder.padding('1px 4px').margin('0 1px');\n return this;\n }\n\n /**\n * Spacious layout\n */\n spacious(): this {\n this.builder.padding('6px 12px').margin('2px 4px');\n return this;\n }\n\n /**\n * Inline display\n */\n inline(): this {\n this.builder.display('inline-block');\n return this;\n }\n\n /**\n * Glass morphism effect\n */\n glassmorphic(): this {\n this.builder\n .css('backdrop-filter', 'blur(10px)')\n .css('background', 'rgba(255, 255, 255, 0.1)')\n .border('1px solid rgba(255, 255, 255, 0.2)')\n .rounded('8px');\n return this;\n }\n\n /**\n * Neon glow effect\n */\n neon(): this {\n const neonColor = '#00ffff';\n this.builder\n .color(neonColor)\n .border(`1px solid ${neonColor}`)\n .shadow(`0 0 10px ${neonColor}, 0 0 20px ${neonColor}`)\n .css('text-shadow', `0 0 5px ${neonColor}`);\n return this;\n }\n\n /**\n * Gradient background\n */\n gradient(from: string = '#667eea', to: string = '#764ba2'): this {\n this.builder.bg(`linear-gradient(135deg, ${from} 0%, ${to} 100%)`);\n return this;\n }\n\n /**\n * Bold text\n */\n bold(): this {\n this.builder.bold();\n return this;\n }\n\n /**\n * Set color with automatic adaptation\n */\n protected color(color: string): this {\n this.builder.color(color);\n return this;\n }\n\n /**\n * Build the final CSS string\n */\n build(): string {\n return this.builder.build();\n }\n}\n\n/**\n * Timestamp-specific styling\n */\nexport class TimestampStyler extends BaseStyler {\n /**\n * Default timestamp style - subtle and informative\n */\n default(): this {\n this.muted().mono();\n this.builder.size('11px');\n return this;\n }\n\n /**\n * Hide timestamp\n */\n hidden(): this {\n this.builder.display('none');\n return this;\n }\n\n /**\n * Minimal timestamp (just time, no date)\n */\n minimal(): this {\n this.muted().mono();\n this.builder.size('10px').opacity(0.7);\n return this;\n }\n\n /**\n * Set font size\n */\n size(size: string): this {\n this.builder.size(size);\n return this;\n }\n}\n\n/**\n * Level badge styling\n */\nexport class LevelStyler extends BaseStyler {\n /**\n * Colorful gradient badge\n */\n badge(): this {\n this.builder\n .padding('2px 8px')\n .rounded('4px')\n .bold()\n .color('#ffffff');\n return this;\n }\n\n /**\n * Glowing effect for dark themes\n */\n glowing(): this {\n return this.neon().badge();\n }\n\n /**\n * Minimal flat style\n */\n flat(): this {\n this.builder\n .padding('1px 6px')\n .rounded('2px')\n .border('1px solid currentColor')\n .css('background', 'transparent');\n return this;\n }\n\n /**\n * Uppercase text\n */\n uppercase(): this {\n this.builder.uppercase();\n return this;\n }\n}\n\n/**\n * Prefix styling\n */\nexport class PrefixStyler extends BaseStyler {\n /**\n * Dark theme prefix\n */\n dark(): this {\n const prefixColors: AdaptiveColors = { light: '#2d3748', dark: '#4a5568' };\n const textColors: AdaptiveColors = { light: '#e2e8f0', dark: '#f7fafc' };\n \n this.builder\n .bg(getAdaptiveColor(prefixColors))\n .color(getAdaptiveColor(textColors))\n .padding('2px 6px')\n .rounded('3px')\n .bold()\n .mono()\n .size('11px');\n return this;\n }\n\n /**\n * Light theme prefix\n */\n light(): this {\n this.builder\n .bg('#f8f9fa')\n .color('#495057')\n .padding('2px 6px')\n .rounded('3px')\n .bold()\n .mono()\n .size('11px')\n .border('1px solid #dee2e6');\n return this;\n }\n\n /**\n * Compact prefix\n */\n compact(): this {\n this.builder\n .padding('1px 4px')\n .size('10px')\n .rounded('2px');\n return this;\n }\n}\n\n/**\n * Message text styling\n */\nexport class MessageStyler extends BaseStyler {\n /**\n * Readable message text - automatically adaptive\n */\n readable(): this {\n this.builder\n .color(getAdaptiveColor(ADAPTIVE_COLORS.messageText))\n .system()\n .size('14px');\n return this;\n }\n\n /**\n * Code-style monospace text\n */\n code(): this {\n this.builder\n .mono()\n .size('13px')\n .color(getAdaptiveColor(ADAPTIVE_COLORS.messageText))\n .bg('rgba(0, 0, 0, 0.05)')\n .padding('1px 4px')\n .rounded('3px');\n return this;\n }\n\n /**\n * Large, prominent text\n */\n large(): this {\n this.builder\n .size('16px')\n .color(getAdaptiveColor(ADAPTIVE_COLORS.messageText));\n return this;\n }\n}\n\n/**\n * Location info styling\n */\nexport class LocationStyler extends BaseStyler {\n /**\n * Subtle location info - automatically adaptive\n */\n subtle(): this {\n this.builder\n .color(getAdaptiveColor(ADAPTIVE_COLORS.location))\n .mono()\n .size('11px')\n .opacity(0.7);\n return this;\n }\n\n /**\n * Hide location info\n */\n hidden(): this {\n this.builder.display('none');\n return this;\n }\n\n /**\n * Clickable style (for IDE integration)\n */\n clickable(): this {\n this.subtle();\n this.builder.css('text-decoration', 'underline').cursor('pointer');\n return this;\n }\n}","/**\n * @fileoverview LogStyleBuilder for fluent log styling API\n */\n\nimport type { Logger } from '../Logger.js';\nimport type { LogStyles, LogLayout, SpacingType } from '../types/index.js';\nimport { \n TimestampStyler, \n LevelStyler, \n PrefixStyler, \n MessageStyler, \n LocationStyler \n} from './SemanticStyles.js';\n\n/**\n * Fluent API builder for log styling with semantic methods\n */\nexport class LogStyleBuilder {\n private logStyles: LogStyles = {};\n private logger: Logger;\n\n constructor(logger: Logger) {\n this.logger = logger;\n }\n\n /**\n * Configure timestamp styling\n */\n timestamp(): TimestampStyleBuilderProxy {\n return new TimestampStyleBuilderProxy(this);\n }\n\n /**\n * Configure level badge styling\n */\n level(): LevelStyleBuilderProxy {\n return new LevelStyleBuilderProxy(this);\n }\n\n /**\n * Configure prefix styling\n */\n prefix(): PrefixStyleBuilderProxy {\n return new PrefixStyleBuilderProxy(this);\n }\n\n /**\n * Configure message text styling\n */\n message(): MessageStyleBuilderProxy {\n return new MessageStyleBuilderProxy(this);\n }\n\n /**\n * Configure location info styling\n */\n location(): LocationStyleBuilderProxy {\n return new LocationStyleBuilderProxy(this);\n }\n\n /**\n * Use a predefined preset\n */\n usePreset(presetName: string): LogStyleBuilder {\n // Will be implemented when we create the presets\n console.warn(`Preset '${presetName}' will be available in next implementation phase`);\n return this;\n }\n\n /**\n * Customize with partial configuration\n */\n customize(overrides: Partial<LogStyles>): LogStyleBuilder {\n this.logStyles = { ...this.logStyles, ...overrides };\n return this;\n }\n\n /**\n * Set layout spacing\n */\n spacing(type: SpacingType): LogStyleBuilder {\n if (!this.logStyles.layout) {\n this.logStyles.layout = { spacing: type };\n } else {\n this.logStyles.layout.spacing = type;\n }\n\n // Apply spacing-specific configurations\n switch (type) {\n case 'compact':\n this.logStyles.layout.innerPadding = '1px';\n this.logStyles.layout.outerMargin = '0px';\n break;\n case 'spacious':\n this.logStyles.layout.innerPadding = '4px';\n this.logStyles.layout.outerMargin = '2px';\n break;\n default: // normal\n this.logStyles.layout.innerPadding = '2px';\n this.logStyles.layout.outerMargin = '1px';\n }\n \n return this;\n }\n\n /**\n * Set backdrop filter for glassmorphism effects\n */\n backdrop(filter: string): LogStyleBuilder {\n this.logStyles.backdrop = filter;\n return this;\n }\n\n /**\n * Set overall transparency\n */\n transparency(value: number): LogStyleBuilder {\n this.logStyles.transparency = Math.max(0, Math.min(1, value));\n return this;\n }\n\n /**\n * Apply the configured styles to the logger\n */\n apply(): void {\n // Store the configuration in the logger\n // This will be implemented when we integrate with the main Logger\n (this.logger as any)._customLogStyles = this.logStyles;\n console.log('Applied log styles:', this.logStyles);\n }\n\n /**\n * Get current configuration (for debugging)\n */\n getConfig(): LogStyles {\n return { ...this.logStyles };\n }\n\n /**\n * Internal method to update part configuration\n */\n _updatePartConfig(part: keyof LogStyles, styles: string): void {\n if (part === 'layout' || part === 'backdrop' || part === 'transparency') {\n return; // Skip these non-part configs\n }\n \n if (!this.logStyles[part]) {\n this.logStyles[part] = {};\n }\n \n // Parse basic CSS styles into config\n // This is a simplified approach - in production might want more sophisticated parsing\n this.logStyles[part]!.style = styles;\n }\n}\n\n/**\n * Base proxy class for part-specific styling\n */\nabstract class PartStyleBuilderProxy {\n protected parentBuilder: LogStyleBuilder;\n protected partName: keyof LogStyles;\n\n constructor(parentBuilder: LogStyleBuilder, partName: keyof LogStyles) {\n this.parentBuilder = parentBuilder;\n this.partName = partName;\n }\n\n /**\n * Return to the main builder for chaining other parts\n */\n and(): LogStyleBuilder {\n return this.parentBuilder;\n }\n\n /**\n * Apply styles and finish configuration\n */\n apply(): void {\n this.parentBuilder.apply();\n }\n\n /**\n * Helper to apply styles to the parent builder\n */\n protected applyStyles(styler: any): this {\n const styles = styler.build();\n this.parentBuilder._updatePartConfig(this.partName, styles);\n return this;\n }\n}\n\n/**\n * Timestamp styling proxy with fluent API\n */\nclass TimestampStyleBuilderProxy extends PartStyleBuilderProxy {\n constructor(parentBuilder: LogStyleBuilder) {\n super(parentBuilder, 'timestamp');\n }\n\n default(): TimestampStyleBuilderProxy {\n return this.applyStyles(new TimestampStyler().default());\n }\n\n hidden(): TimestampStyleBuilderProxy {\n return this.applyStyles(new TimestampStyler().hidden());\n }\n\n minimal(): TimestampStyleBuilderProxy {\n return this.applyStyles(new TimestampStyler().minimal());\n }\n\n muted(): TimestampStyleBuilderProxy {\n return this.applyStyles(new TimestampStyler().muted());\n }\n\n mono(): TimestampStyleBuilderProxy {\n return this.applyStyles(new TimestampStyler().mono());\n }\n\n compact(): TimestampStyleBuilderProxy {\n return this.applyStyles(new TimestampStyler().compact());\n }\n}\n\n/**\n * Level badge styling proxy with fluent API\n */\nclass LevelStyleBuilderProxy extends PartStyleBuilderProxy {\n constructor(parentBuilder: LogStyleBuilder) {\n super(parentBuilder, 'level');\n }\n\n badge(): LevelStyleBuilderProxy {\n return this.applyStyles(new LevelStyler().badge());\n }\n\n gradient(from?: string, to?: string): LevelStyleBuilderProxy {\n return this.applyStyles(new LevelStyler().gradient(from, to));\n }\n\n glowing(): LevelStyleBuilderProxy {\n return this.applyStyles(new LevelStyler().glowing());\n }\n\n flat(): LevelStyleBuilderProxy {\n return this.applyStyles(new LevelStyler().flat());\n }\n\n bold(): LevelStyleBuilderProxy {\n return this.applyStyles(new LevelStyler().bold());\n }\n\n uppercase(): LevelStyleBuilderProxy {\n return this.applyStyles(new LevelStyler().uppercase());\n }\n\n neon(): LevelStyleBuilderProxy {\n return this.applyStyles(new LevelStyler().neon());\n }\n}\n\n/**\n * Prefix styling proxy with fluent API\n */\nclass PrefixStyleBuilderProxy extends PartStyleBuilderProxy {\n constructor(parentBuilder: LogStyleBuilder) {\n super(parentBuilder, 'prefix');\n }\n\n dark(): PrefixStyleBuilderProxy {\n return this.applyStyles(new PrefixStyler().dark());\n }\n\n light(): PrefixStyleBuilderProxy {\n return this.applyStyles(new PrefixStyler().light());\n }\n\n compact(): PrefixStyleBuilderProxy {\n return this.applyStyles(new PrefixStyler().compact());\n }\n\n muted(): PrefixStyleBuilderProxy {\n return this.applyStyles(new PrefixStyler().muted());\n }\n\n mono(): PrefixStyleBuilderProxy {\n return this.applyStyles(new PrefixStyler().mono());\n }\n}\n\n/**\n * Message styling proxy with fluent API\n */\nclass MessageStyleBuilderProxy extends PartStyleBuilderProxy {\n constructor(parentBuilder: LogStyleBuilder) {\n super(parentBuilder, 'message');\n }\n\n readable(): MessageStyleBuilderProxy {\n return this.applyStyles(new MessageStyler().readable());\n }\n\n code(): MessageStyleBuilderProxy {\n return this.applyStyles(new MessageStyler().code());\n }\n\n large(): MessageStyleBuilderProxy {\n return this.applyStyles(new MessageStyler().large());\n }\n\n system(): MessageStyleBuilderProxy {\n return this.applyStyles(new MessageStyler().system());\n }\n\n mono(): MessageStyleBuilderProxy {\n return this.applyStyles(new MessageStyler().mono());\n }\n}\n\n/**\n * Location styling proxy with fluent API\n */\nclass LocationStyleBuilderProxy extends PartStyleBuilderProxy {\n constructor(parentBuilder: LogStyleBuilder) {\n super(parentBuilder, 'location');\n }\n\n subtle(): LocationStyleBuilderProxy {\n return this.applyStyles(new LocationStyler().subtle());\n }\n\n hidden(): LocationStyleBuilderProxy {\n return this.applyStyles(new LocationStyler().hidden());\n }\n\n clickable(): LocationStyleBuilderProxy {\n return this.applyStyles(new LocationStyler().clickable());\n }\n\n muted(): LocationStyleBuilderProxy {\n return this.applyStyles(new LocationStyler().muted());\n }\n\n mono(): LocationStyleBuilderProxy {\n return this.applyStyles(new LocationStyler().mono());\n }\n}\n\n/**\n * Create a new LogStyleBuilder instance\n */\nexport function createLogStyleBuilder(logger: Logger): LogStyleBuilder {\n return new LogStyleBuilder(logger);\n}","/**\n * @fileoverview Smart presets for simplified logger configuration\n */\n\nimport type { LogStyles, LogLayout } from '../types/index.js';\n\n/**\n * Smart presets that configure the entire log appearance\n */\nexport const SMART_PRESETS: Record<string, LogStyles> = {\n /**\n * Default preset - works perfectly out-of-the-box\n * Clean, readable, automatically adaptive to dark/light themes\n */\n default: {\n layout: {\n spacing: 'normal',\n innerPadding: '2px',\n outerMargin: '1px'\n },\n timestamp: {\n show: true,\n color: 'auto', // Automatically adaptive\n font: 'Monaco, Consolas, monospace',\n size: '11px'\n },\n level: {\n show: true,\n style: 'badge',\n uppercase: false,\n padding: '2px 8px'\n },\n prefix: {\n show: true,\n style: 'dark', // Automatically adaptive\n padding: '2px 6px'\n },\n message: {\n show: true,\n color: 'auto', // Automatically adaptive\n font: 'system-ui, -apple-system, sans-serif',\n size: '14px'\n },\n location: {\n show: true,\n color: 'auto', // Automatically adaptive\n font: 'Monaco, Consolas, monospace',\n size: '11px'\n }\n },\n\n /**\n * Cyberpunk preset - neon colors, glowing effects, dark theme\n */\n cyberpunk: {\n layout: {\n spacing: 'compact',\n innerPadding: '1px',\n outerMargin: '0px'\n },\n timestamp: {\n show: true,\n color: '#00ffff',\n font: 'Monaco, Consolas, monospace',\n size: '10px',\n style: 'neon'\n },\n level: {\n show: true,\n style: 'glowing',\n uppercase: true,\n padding: '2px 8px'\n },\n prefix: {\n show: true,\n color: '#ff0080',\n background: 'rgba(255, 0, 128, 0.1)',\n border: '1px solid #ff0080',\n style: 'neon'\n },\n message: {\n show: true,\n color: '#00ff41',\n font: 'Monaco, Consolas, monospace',\n size: '13px'\n },\n location: {\n show: false // Hidden for cleaner look\n },\n backdrop: 'blur(2px)',\n transparency: 0.9\n },\n\n /**\n * Glassmorphism preset - modern blur effects, transparency\n */\n glassmorphism: {\n layout: {\n spacing: 'spacious',\n innerPadding: '4px',\n outerMargin: '2px'\n },\n timestamp: {\n show: true,\n color: 'auto',\n font: 'system-ui, sans-serif',\n size: '11px',\n style: 'glassmorphic'\n },\n level: {\n show: true,\n style: 'glassmorphic',\n uppercase: false,\n padding: '4px 12px'\n },\n prefix: {\n show: true,\n style: 'glassmorphic',\n padding: '3px 8px'\n },\n message: {\n show: true,\n color: 'auto',\n font: 'system-ui, sans-serif',\n size: '14px'\n },\n location: {\n show: true,\n color: 'auto',\n font: 'system-ui, sans-serif',\n size: '11px',\n style: 'glassmorphic'\n },\n backdrop: 'blur(10px)',\n transparency: 0.8\n },\n\n /**\n * Minimal preset - clean, no decorations, maximum readability\n */\n minimal: {\n layout: {\n spacing: 'compact',\n innerPadding: '0px',\n outerMargin: '0px'\n },\n timestamp: {\n show: false // Hidden for minimal look\n },\n level: {\n show: true,\n style: 'flat',\n uppercase: true,\n padding: '0px 4px',\n border: 'none',\n background: 'transparent'\n },\n prefix: {\n show: true,\n style: 'flat',\n padding: '0px 4px',\n border: 'none',\n background: 'transparent'\n },\n message: {\n show: true,\n color: 'auto',\n font: 'system-ui, sans-serif',\n size: '14px'\n },\n location: {\n show: false // Hidden for minimal look\n }\n },\n\n /**\n * Debug preset - monospace, detailed, compact for development\n */\n debug: {\n layout: {\n spacing: 'compact',\n innerPadding: '1px',\n outerMargin: '0px'\n },\n timestamp: {\n show: true,\n color: 'auto',\n font: 'Monaco, Consolas, monospace',\n size: '10px'\n },\n level: {\n show: true,\n style: 'compact',\n uppercase: true,\n padding: '1px 4px',\n font: 'Monaco, Consolas, monospace',\n size: '10px'\n },\n prefix: {\n show: true,\n style: 'compact',\n padding: '1px 4px',\n font: 'Monaco, Consolas, monospace',\n size: '10px'\n },\n message: {\n show: true,\n color: 'auto',\n font: 'Monaco, Consolas, monospace',\n size: '12px'\n },\n location: {\n show: true,\n color: 'auto',\n font: 'Monaco, Consolas, monospace',\n size: '10px',\n style: 'clickable'\n }\n },\n\n /**\n * Production preset - clean, essential info only\n */\n production: {\n layout: {\n spacing: 'normal',\n innerPadding: '2px',\n outerMargin: '1px'\n },\n timestamp: {\n show: true,\n color: 'auto',\n font: 'system-ui, sans-serif',\n size: '11px'\n },\n level: {\n show: true,\n style: 'badge',\n uppercase: false,\n padding: '2px 6px'\n },\n prefix: {\n show: false // Hidden in production\n },\n message: {\n show: true,\n color: 'auto',\n font: 'system-ui, sans-serif',\n size: '14px'\n },\n location: {\n show: false // Hidden in production\n }\n }\n};\n\n/**\n * Get a smart preset by name\n */\nexport function getSmartPreset(name: string): LogStyles | null {\n return SMART_PRESETS[name] || null;\n}\n\n/**\n * List all available smart presets\n */\nexport function getAvailablePresets(): string[] {\n return Object.keys(SMART_PRESETS);\n}\n\n/**\n * Check if a preset exists\n */\nexport function hasPreset(name: string): boolean {\n return name in SMART_PRESETS;\n}\n\n/**\n * Preset descriptions for help/documentation\n */\nexport const PRESET_DESCRIPTIONS: Record<string, string> = {\n default: 'Clean, readable, automatically adaptive to dark/light themes',\n cyberpunk: 'Neon colors, glowing effects, perfect for dark themes',\n glassmorphism: 'Modern blur effects with transparency and spacious layout',\n minimal: 'Clean and simple, no decorations, maximum readability',\n debug: 'Monospace fonts, detailed info, compact layout for development',\n production: 'Professional look with essential information only'\n};","import { Logger } from './Logger.js';\nimport type { TimerEntry, Bindings, ISpinnerHandle, IBoxOptions, ITableOptions, CLILogLevel } from './types/index.js';\n\nexport class ScopedLogger {\n private readonly parent: Logger;\n private readonly scopeName: string;\n private badgeList: string[] = [];\n private contextStack: string[] = [];\n private _timers?: Map<string, TimerEntry>;\n\n constructor(parent: Logger, scopeName: string) {\n this.parent = parent;\n this.scopeName = scopeName;\n }\n\n private get timers(): Map<string, TimerEntry> {\n if (!this._timers) this._timers = new Map();\n return this._timers;\n }\n\n private getBindings(): Bindings {\n return {\n scope: this.getScopePrefix(),\n badges: this.badgeList.length > 0 ? [...this.badgeList] : undefined,\n };\n }\n\n private getScopePrefix(): string {\n if (this.contextStack.length === 0) return this.scopeName;\n return [this.scopeName, ...this.contextStack].join(':');\n }\n\n badges(badges: string[]): this {\n this.badgeList = [...badges];\n return this;\n }\n\n badge(badge: string): this {\n if (!this.badgeList.includes(badge)) {\n this.badgeList.push(badge);\n }\n return this;\n }\n\n clearBadges(): this {\n this.badgeList = [];\n return this;\n }\n\n style(presetName: string): this {\n this.parent.setTheme(presetName as any);\n return this;\n }\n\n context(contextName: string): ContextLogger {\n return new ContextLogger(this, contextName);\n }\n\n time(label: string): void {\n this.timers.set(label, {\n label: `${this.scopeName}:${label}`,\n startTime: performance.now(),\n });\n }\n\n timeEnd(label: string): number | undefined {\n const timer = this.timers.get(label);\n if (!timer) {\n this.warn(`Timer '${label}' not found`);\n return undefined;\n }\n const elapsed = performance.now() - timer.startTime;\n this.timers.delete(label);\n this.success(`Timer: ${label} - ${elapsed.toFixed(2)}ms`);\n return elapsed;\n }\n\n debug(...args: any[]): void {\n this.parent.logWithBindings(this.getBindings(), 'debug', ...args);\n }\n\n info(...args: any[]): void {\n this.parent.logWithBindings(this.getBindings(), 'info', ...args);\n }\n\n warn(...args: any[]): void {\n this.parent.logWithBindings(this.getBindings(), 'warn', ...args);\n }\n\n error(...args: any[]): void {\n this.parent.logWithBindings(this.getBindings(), 'error', ...args);\n }\n\n success(...args: any[]): void {\n const bindings = this.getBindings();\n this.parent.logWithBindings(bindings, 'info', ...args);\n }\n\n critical(...args: any[]): void {\n this.parent.logWithBindings(this.getBindings(), 'critical', ...args);\n }\n\n trace(...args: any[]): void {\n this.parent.logWithBindings(this.getBindings(), 'debug', ...args);\n console.trace(`[${this.scopeName}]`);\n }\n\n // ===== CLI PRIMITIVES (v5.0 delegation) =====\n\n /** @see Logger.step */\n step(current: number, total: number, message: string): void {\n this.parent.step(current, total, message);\n }\n\n /** @see Logger.header */\n header(title: string, subtitle?: string): void {\n this.parent.header(title, subtitle);\n }\n\n /** @see Logger.divider */\n divider(): void {\n this.parent.divider();\n }\n\n /** @see Logger.blank */\n blank(): void {\n this.parent.blank();\n }\n\n /** @see Logger.box */\n box(content: string, options?: IBoxOptions): void {\n this.parent.box(content, options);\n }\n\n /** @see Logger.cliTable */\n cliTable(rows: Record<string, unknown>[], options?: ITableOptions): void {\n this.parent.cliTable(rows, options);\n }\n\n /** @see Logger.spinner */\n spinner(message: string): ISpinnerHandle {\n return this.parent.spinner(message);\n }\n\n /** @see Logger.setCLILevel */\n setCLILevel(level: CLILogLevel): void {\n this.parent.setCLILevel(level);\n }\n\n _pushContext(context: string): void {\n this.contextStack.push(context);\n }\n\n _popContext(): void {\n this.contextStack.pop();\n }\n}\n\nexport class APILogger extends ScopedLogger {\n constructor(parent: Logger, apiName: string) {\n super(parent, `API:${apiName}`);\n this.badge('API');\n }\n\n slow(message: string, duration?: number): void {\n this.badge('SLOW');\n const msg = duration ? `${message} (${duration}ms)` : message;\n this.warn(msg);\n }\n\n rateLimit(message: string): void {\n this.badge('RATE_LIMIT');\n this.warn(message);\n }\n\n auth(message: string): void {\n this.badge('AUTH');\n this.error(message);\n }\n\n deprecated(message: string): void {\n this.badge('DEPRECATED');\n this.warn(message);\n }\n}\n\nexport class ComponentLogger extends ScopedLogger {\n constructor(parent: Logger, componentName: string) {\n super(parent, componentName);\n this.badge('COMPONENT');\n }\n\n lifecycle(event: string, message?: string): void {\n this.badge('LIFECYCLE');\n const msg = message ? `${event}: ${message}` : event;\n this.info(msg);\n }\n\n stateChange(from: string, to: string, data?: any): void {\n this.badge('STATE');\n const msg = `${from} → ${to}`;\n if (data) {\n this.info(msg, data);\n } else {\n this.info(msg);\n }\n }\n\n propsChange(changes: Record<string, any>): void {\n this.badge('PROPS');\n this.debug('Props changed:', changes);\n }\n}\n\nexport class ContextLogger {\n private parentLogger: ScopedLogger;\n private contextName: string;\n\n constructor(parentLogger: ScopedLogger, contextName: string) {\n this.parentLogger = parentLogger;\n this.contextName = contextName;\n }\n\n run<T>(fn: () => T): T {\n this.parentLogger._pushContext(this.contextName);\n try {\n return fn();\n } finally {\n this.parentLogger._popContext();\n }\n }\n\n async runAsync<T>(fn: () => Promise<T>): Promise<T> {\n this.parentLogger._pushContext(this.contextName);\n try {\n return await fn();\n } finally {\n this.parentLogger._popContext();\n }\n }\n\n start(): void {\n this.parentLogger._pushContext(this.contextName);\n }\n\n end(): void {\n this.parentLogger._popContext();\n }\n\n debug(...args: any[]): void { this.parentLogger.debug(...args); }\n info(...args: any[]): void { this.parentLogger.info(...args); }\n warn(...args: any[]): void { this.parentLogger.warn(...args); }\n error(...args: any[]): void { this.parentLogger.error(...args); }\n success(...args: any[]): void { this.parentLogger.success(...args); }\n critical(...args: any[]): void { this.parentLogger.critical(...args); }\n}\n","/**\n * @fileoverview Export and clipboard log handler for Advanced Logger\n */\n\nimport type { \n ILogHandler, \n LogLevel, \n LogMetadata, \n LogEntry, \n ExportFilters, \n ExportOptions, \n ExportResult, \n BufferStats,\n ExportFormat\n} from '../types/index.js';\nimport { parseTimeInput, formatDisplayTime } from '../utils/timestamps.js';\nimport { safeStringify, escapeHtml, generateLogId } from '../utils/output.js';\nimport { BUFFER_LIMITS } from '../constants.js';\n\n/**\n * Export log handler with circular buffer and multiple export formats\n */\nexport class ExportLogHandler implements ILogHandler {\n private buffer: LogEntry[] = [];\n private maxSize: number;\n private groupDepth: number = 0;\n private currentGroup?: string;\n\n constructor(maxSize: number = BUFFER_LIMITS.DEFAULT_SIZE) {\n this.maxSize = Math.min(Math.max(maxSize, BUFFER_LIMITS.MIN_SIZE), BUFFER_LIMITS.MAX_SIZE);\n }\n\n /**\n * Handle incoming log and store in buffer\n */\n handle(level: LogLevel, message: string, args: any[], metadata: LogMetadata): void {\n const entry: LogEntry = {\n id: generateLogId(),\n timestamp: metadata.timestamp,\n level,\n prefix: metadata.prefix,\n message,\n args,\n location: metadata.stackInfo,\n groupInfo: this.groupDepth > 0 ? {\n depth: this.groupDepth,\n groupName: this.currentGroup\n } : undefined\n };\n\n // Add to circular buffer\n this.buffer.push(entry);\n if (this.buffer.length > this.maxSize) {\n this.buffer.shift(); // Remove oldest entry\n }\n }\n\n /**\n * Set group tracking for nested logs\n */\n setGroupInfo(depth: number, groupName?: string): void {\n this.groupDepth = depth;\n this.currentGroup = groupName;\n }\n\n /**\n * Get buffer statistics\n */\n getBufferStats(): BufferStats {\n const levelCounts = this.buffer.reduce((acc, entry) => {\n const currentCount = acc[entry.level] ? acc[entry.level] : 0;\n acc[entry.level] = currentCount + 1;\n return acc;\n }, {} as Record<LogLevel, number>);\n\n let oldestLog: Date | undefined;\n let newestLog: Date | undefined;\n \n if (this.buffer.length > 0) {\n const firstEntry = this.buffer[0];\n const lastEntry = this.buffer[this.buffer.length - 1];\n \n if (firstEntry && firstEntry.timestamp) {\n oldestLog = new Date(firstEntry.timestamp);\n }\n \n if (lastEntry && lastEntry.timestamp) {\n newestLog = new Date(lastEntry.timestamp);\n }\n }\n\n return {\n size: this.buffer.length,\n maxSize: this.maxSize,\n usage: (this.buffer.length / this.maxSize) * 100,\n oldestLog,\n newestLog,\n levelCounts: {\n debug: levelCounts.debug ? levelCounts.debug : 0,\n info: levelCounts.info ? levelCounts.info : 0,\n warn: levelCounts.warn ? levelCounts.warn : 0,\n error: levelCounts.error ? levelCounts.error : 0,\n critical: levelCounts.critical ? levelCounts.critical : 0\n }\n };\n }\n\n /**\n * Clear the buffer\n */\n clearBuffer(): void {\n this.buffer = [];\n }\n\n /**\n * Set buffer size (with limits)\n */\n setBufferSize(size: number): void {\n this.maxSize = Math.min(Math.max(size, BUFFER_LIMITS.MIN_SIZE), BUFFER_LIMITS.MAX_SIZE);\n \n // Trim buffer if new size is smaller\n if (this.buffer.length > this.maxSize) {\n this.buffer = this.buffer.slice(-this.maxSize);\n }\n }\n\n /**\n * Filter logs based on criteria\n */\n private filterLogs(filters: ExportFilters = {}): LogEntry[] {\n let filtered = [...this.buffer];\n\n // Filter by levels\n if (filters.levels?.length) {\n filtered = filtered.filter(entry => filters.levels!.includes(entry.level));\n }\n\n // Filter by prefixes\n if (filters.prefixes?.length) {\n filtered = filtered.filter(entry => \n entry.prefix && filters.prefixes!.includes(entry.prefix)\n );\n }\n\n // Exclude prefixes\n if (filters.excludePrefixes?.length) {\n filtered = filtered.filter(entry => \n !entry.prefix || !filters.excludePrefixes!.includes(entry.prefix)\n );\n }\n\n // Filter by time range\n if (filters.since) {\n const sinceDate = parseTimeInput(filters.since);\n filtered = filtered.filter(entry => new Date(entry.timestamp) >= sinceDate);\n }\n\n if (filters.until) {\n const untilDate = parseTimeInput(filters.until);\n filtered = filtered.filter(entry => new Date(entry.timestamp) <= untilDate);\n }\n\n // Filter by stack trace presence\n if (filters.withStackTrace) {\n filtered = filtered.filter(entry => entry.location);\n }\n\n // Filter errors only\n if (filters.errorsOnly) {\n filtered = filtered.filter(entry => entry.level === 'error' || entry.level === 'critical');\n }\n\n // Search in messages\n if (filters.search) {\n const searchTerm = filters.search.toLowerCase();\n filtered = filtered.filter(entry => \n entry.message.toLowerCase().includes(searchTerm) ||\n entry.args.some(arg => \n String(arg).toLowerCase().includes(searchTerm)\n )\n );\n }\n\n // Limit results\n if (filters.last) {\n filtered = filtered.slice(-filters.last);\n }\n\n if (filters.first) {\n filtered = filtered.slice(0, filters.first);\n }\n\n return filtered;\n }\n\n /**\n * Export logs in JSON format\n */\n private exportJSON(logs: LogEntry[], options: ExportOptions): string {\n const data = logs.map(entry => ({\n timestamp: entry.timestamp,\n level: entry.level,\n prefix: entry.prefix,\n message: entry.message,\n ...(options.minimal ? {} : {\n args: entry.args.slice(1),\n location: entry.location,\n groupInfo: entry.groupInfo\n })\n }));\n\n return options.compact \n ? JSON.stringify(data)\n : JSON.stringify(data, null, 2);\n }\n\n /**\n * Export logs in CSV format\n */\n private exportCSV(logs: LogEntry[], options: ExportOptions): string {\n const headers = options.minimal \n ? ['Timestamp', 'Level', 'Prefix', 'Message']\n : ['Timestamp', 'Level', 'Prefix', 'Message', 'File', 'Line', 'Args'];\n\n const rows = logs.map(entry => {\n const baseRow = [\n formatDisplayTime(new Date(entry.timestamp), 'full'),\n entry.level.toUpperCase(),\n entry.prefix || '',\n `\"${entry.message.replace(/\"/g, '\"\"')}\"`\n ];\n\n if (!options.minimal) {\n baseRow.push(\n entry.location?.file || '',\n entry.location?.line?.toString() || '',\n `\"${safeStringify(entry.args.slice(1)).replace(/\"/g, '\"\"')}\"`\n );\n }\n\n return baseRow;\n });\n\n return [headers.join(','), ...rows.map(row => row.join(','))].join('\\n');\n }\n\n /**\n * Export logs in Markdown format\n */\n private exportMarkdown(logs: LogEntry[], options: ExportOptions): string {\n const now = new Date();\n let content = `# Log Export - ${formatDisplayTime(now, 'full')}\\n\\n`;\n\n // Add summary if not minimal\n if (!options.minimal) {\n const summary = this.getBufferStats();\n content += `## Summary\\n`;\n content += `- **Total logs**: ${logs.length}\\n`;\n content += `- **Errors**: ${summary.levelCounts.error + summary.levelCounts.critical}\\n`;\n content += `- **Warnings**: ${summary.levelCounts.warn}\\n\\n`;\n }\n\n // Group by level if specified\n if (options.groupBy === 'level') {\n const grouped = logs.reduce((acc, entry) => {\n const level = entry.level;\n if (!acc[level]) {\n acc[level] = [];\n }\n // We just ensured the array exists above\n const levelArray = acc[level];\n if (levelArray) {\n levelArray.push(entry);\n }\n return acc;\n }, {} as Record<string, LogEntry[]>);\n\n Object.entries(grouped).forEach(([level, entries]) => {\n const emoji = this.getLevelEmoji(level as LogLevel);\n content += `## ${emoji} ${level.toUpperCase()} (${entries.length})\\n\\n`;\n \n entries.forEach(entry => {\n const time = formatDisplayTime(new Date(entry.timestamp), 'time-only');\n const location = entry.location ? ` (${entry.location.file}:${entry.location.line})` : '';\n const prefix = entry.prefix ? ` **${entry.prefix}**:` : '';\n content += `- \\`${time}\\`${prefix} ${entry.message}${location}\\n`;\n });\n content += '\\n';\n });\n } else {\n content += '## Logs\\n\\n';\n logs.forEach(entry => {\n const time = formatDisplayTime(new Date(entry.timestamp), 'time-only');\n const emoji = this.getLevelEmoji(entry.level);\n const location = entry.location ? ` (${entry.location.file}:${entry.location.line})` : '';\n const prefix = entry.prefix ? ` **${entry.prefix}**:` : '';\n content += `- \\`${time}\\` ${emoji}${prefix} ${entry.message}${location}\\n`;\n });\n }\n\n return content;\n }\n\n /**\n * Export logs in plain text format\n */\n private exportPlain(logs: LogEntry[], options: ExportOptions): string {\n return logs.map(entry => {\n const time = formatDisplayTime(new Date(entry.timestamp), options.minimal ? 'time-only' : 'short');\n const level = entry.level.toUpperCase().padEnd(8);\n const prefix = entry.prefix ? `[${entry.prefix}] ` : '';\n const location = (!options.minimal && entry.location) ? ` (${entry.location.file}:${entry.location.line})` : '';\n \n return `${time} ${level} ${prefix}${entry.message}${location}`;\n }).join('\\n');\n }\n\n /**\n * Export logs in HTML format\n */\n private exportHTML(logs: LogEntry[], _options: ExportOptions): string {\n const title = `Log Export - ${formatDisplayTime(new Date(), 'full')}`;\n \n let html = `<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>${title}</title>\n <style>\n body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; margin: 20px; line-height: 1.6; }\n .header { border-bottom: 2px solid #ddd; padding-bottom: 20px; margin-bottom: 20px; }\n .log-entry { margin: 5px 0; padding: 8px; border-radius: 4px; font-family: 'Monaco', 'Consolas', monospace; }\n .timestamp { color: #666; font-size: 0.9em; }\n .level { font-weight: bold; padding: 2px 6px; border-radius: 3px; margin: 0 8px; }\n .prefix { background: #2d3748; color: #e2e8f0; padding: 2px 6px; border-radius: 3px; margin: 0 8px; }\n .location { color: #718096; font-size: 0.9em; }\n .debug { background: #f0f4ff; }\n .info { background: #f0f9ff; }\n .warn { background: #fffbeb; }\n .error { background: #fef2f2; }\n .critical { background: #fef2f2; border-left: 4px solid #dc2626; }\n .level.debug { background: #667eea; color: white; }\n .level.info { background: #74b9ff; color: white; }\n .level.warn { background: #fdcb6e; color: #2d3436; }\n .level.error { background: #e84393; color: white; }\n .level.critical { background: #ff3838; color: white; }\n </style>\n</head>\n<body>\n <div class=\"header\">\n <h1>${title}</h1>\n <p>Generated by Advanced Logger v2.0.0</p>\n </div>\n <div class=\"logs\">`;\n\n logs.forEach(entry => {\n const time = formatDisplayTime(new Date(entry.timestamp), 'full');\n const location = entry.location ? ` <span class=\"location\">(${escapeHtml(entry.location.file)}:${entry.location.line})</span>` : '';\n const prefix = entry.prefix ? ` <span class=\"prefix\">${escapeHtml(entry.prefix)}</span>` : '';\n \n html += `\n <div class=\"log-entry ${entry.level}\">\n <span class=\"timestamp\">${time}</span>\n <span class=\"level ${entry.level}\">${entry.level.toUpperCase()}</span>\n ${prefix}\n <span class=\"message\">${escapeHtml(entry.message)}</span>\n ${location}\n </div>`;\n });\n\n html += `\n </div>\n</body>\n</html>`;\n\n return html;\n }\n\n /**\n * Get emoji for log level\n */\n private getLevelEmoji(level: LogLevel): string {\n const emojis = {\n debug: '🐞',\n info: 'ℹ️',\n warn: '⚠️',\n error: '❌',\n critical: '🔥'\n };\n return emojis[level] || '';\n }\n\n /**\n * Main export function\n */\n export(format: ExportFormat, filters: ExportFilters = {}, options: ExportOptions = {}): ExportResult {\n const filteredLogs = this.filterLogs(filters);\n \n let data: string;\n switch (format) {\n case 'json':\n data = this.exportJSON(filteredLogs, options);\n break;\n case 'csv':\n data = this.exportCSV(filteredLogs, options);\n break;\n case 'markdown':\n data = this.exportMarkdown(filteredLogs, options);\n break;\n case 'plain':\n data = this.exportPlain(filteredLogs, options);\n break;\n case 'html':\n data = this.exportHTML(filteredLogs, options);\n break;\n default:\n throw new Error(`Unsupported export format: ${format}`);\n }\n\n return {\n format,\n data,\n metadata: {\n totalLogs: this.buffer.length,\n filteredLogs: filteredLogs.length,\n exportedAt: new Date().toISOString(),\n filters,\n options\n }\n };\n }\n\n /**\n * Copy to clipboard with fallback\n */\n async copyToClipboard(format: ExportFormat, filters: ExportFilters = {}, options: ExportOptions = {}): Promise<boolean> {\n const result = this.export(format, filters, options);\n \n try {\n if (navigator.clipboard && window.isSecureContext) {\n await navigator.clipboard.writeText(result.data);\n return true;\n } else {\n // Fallback for non-secure contexts\n const textArea = document.createElement('textarea');\n textArea.value = result.data;\n textArea.style.position = 'fixed';\n textArea.style.opacity = '0';\n document.body.appendChild(textArea);\n textArea.focus();\n textArea.select();\n const success = document.execCommand('copy');\n document.body.removeChild(textArea);\n return success;\n }\n } catch (error) {\n console.error('Failed to copy to clipboard:', error);\n return false;\n }\n }\n\n /**\n * Get all logs (for debugging)\n */\n getAllLogs(): LogEntry[] {\n return [...this.buffer];\n }\n\n /**\n * Save export to file with download prompt\n */\n async saveToFile(format: ExportFormat, filters: ExportFilters = {}, options: ExportOptions = {}): Promise<boolean> {\n try {\n const result = this.export(format, filters, options);\n const blob = new Blob([result.data], { \n type: this.getMimeType(format) \n });\n \n const url = URL.createObjectURL(blob);\n const a = document.createElement('a');\n const filename = this.generateFilename(format, filters);\n \n a.href = url;\n a.download = filename;\n a.style.display = 'none';\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n URL.revokeObjectURL(url);\n \n return true;\n } catch (error) {\n console.error('Failed to save file:', error);\n return false;\n }\n }\n\n /**\n * Get MIME type for format\n */\n private getMimeType(format: ExportFormat): string {\n const mimeTypes = {\n json: 'application/json',\n csv: 'text/csv',\n markdown: 'text/markdown',\n plain: 'text/plain',\n html: 'text/html'\n };\n return mimeTypes[format] || 'text/plain';\n }\n\n /**\n * Generate filename with timestamp\n */\n private generateFilename(format: ExportFormat, filters: ExportFilters): string {\n const timestamp = new Date().toISOString().replace(/[:.]/g, '-').slice(0, -5);\n const prefix = filters.prefixes?.length === 1 ? `_${filters.prefixes[0]}` : '';\n const extension = format === 'markdown' ? 'md' : format;\n return `logs${prefix}_${timestamp}.${extension}`;\n }\n\n /**\n * Stream logs to external endpoint\n */\n async streamToEndpoint(endpoint: string, filters: ExportFilters = {}, options: { \n apiKey?: string; \n batchSize?: number; \n format?: ExportFormat \n } = {}): Promise<boolean> {\n try {\n const logs = this.filterLogs(filters);\n const batchSize = options.batchSize || 100;\n const format = options.format || 'json';\n \n // Send in batches\n for (let i = 0; i < logs.length; i += batchSize) {\n const batch = logs.slice(i, i + batchSize);\n const result = this.export(format, {}, { compact: true });\n \n const headers: Record<string, string> = {\n 'Content-Type': 'application/json'\n };\n \n if (options.apiKey) {\n headers['Authorization'] = `Bearer ${options.apiKey}`;\n }\n \n const response = await fetch(endpoint, {\n method: 'POST',\n headers,\n body: JSON.stringify({\n logs: batch,\n metadata: {\n batchIndex: Math.floor(i / batchSize),\n totalBatches: Math.ceil(logs.length / batchSize),\n timestamp: new Date().toISOString()\n }\n })\n });\n \n if (!response.ok) {\n throw new Error(`HTTP ${response.status}: ${response.statusText}`);\n }\n }\n \n return true;\n } catch (error) {\n console.error('Failed to stream logs:', error);\n return false;\n }\n }\n\n /**\n * Create export with metadata enrichment\n */\n exportWithMetadata(format: ExportFormat, filters: ExportFilters = {}, options: ExportOptions = {}): ExportResult {\n const baseResult = this.export(format, filters, options);\n const bufferStats = this.getBufferStats();\n \n return {\n ...baseResult,\n metadata: {\n ...baseResult.metadata,\n bufferStats: bufferStats,\n performance: {\n memoryUsage: this.estimateMemoryUsage(),\n processingTime: Date.now()\n },\n system: {\n userAgent: typeof navigator !== 'undefined' ? navigator.userAgent : 'Node.js',\n timestamp: new Date().toISOString(),\n timezone: Intl.DateTimeFormat().resolvedOptions().timeZone\n }\n } as any\n };\n }\n\n /**\n * Estimate memory usage of buffer\n */\n private estimateMemoryUsage(): number {\n const sampleEntry = this.buffer[0];\n if (!sampleEntry) return 0;\n \n // Rough estimation: JSON.stringify size * buffer length\n const sampleSize = JSON.stringify(sampleEntry).length;\n return sampleSize * this.buffer.length;\n }\n}","/**\n * @fileoverview CLI Command processor for Advanced Logger\n */\n\nimport type { Logger } from '../Logger.js';\n\n/**\n * Base interface for CLI commands\n */\nexport interface ICommand {\n name: string;\n description: string;\n usage: string;\n category?: string;\n aliases?: string[];\n execute(args: string, logger: Logger): void | Promise<void>;\n}\n\n/**\n * Plugin interface for extending CLI functionality\n */\nexport interface ICLIPlugin {\n name: string;\n version: string;\n description: string;\n commands: ICommand[];\n initialize?(processor: CommandProcessor, logger: Logger): void;\n cleanup?(): void;\n}\n\n/**\n * Command history entry\n */\ninterface HistoryEntry {\n command: string;\n timestamp: Date;\n success: boolean;\n}\n\n/**\n * CLI command processor\n */\nexport class CommandProcessor {\n private commands: Map<string, ICommand> = new Map();\n private aliases: Map<string, string> = new Map();\n private plugins: Map<string, ICLIPlugin> = new Map();\n private history: HistoryEntry[] = [];\n private maxHistorySize: number = 100;\n private isInteractiveMode: boolean = false;\n\n /**\n * Register a command\n */\n registerCommand(command: ICommand): void {\n this.commands.set(command.name, command);\n \n // Register aliases\n if (command.aliases) {\n for (const alias of command.aliases) {\n this.aliases.set(alias, command.name);\n }\n }\n }\n \n /**\n * Register a plugin\n */\n registerPlugin(plugin: ICLIPlugin, logger?: Logger): void {\n if (this.plugins.has(plugin.name)) {\n throw new Error(`Plugin ${plugin.name} is already registered`);\n }\n \n this.plugins.set(plugin.name, plugin);\n \n // Register plugin commands\n for (const command of plugin.commands) {\n this.registerCommand(command);\n }\n \n // Initialize plugin\n if (plugin.initialize && logger) {\n plugin.initialize(this, logger);\n }\n }\n \n /**\n * Unregister a plugin\n */\n unregisterPlugin(pluginName: string): void {\n const plugin = this.plugins.get(pluginName);\n if (!plugin) return;\n \n // Remove plugin commands\n for (const command of plugin.commands) {\n this.commands.delete(command.name);\n if (command.aliases) {\n for (const alias of command.aliases) {\n this.aliases.delete(alias);\n }\n }\n }\n \n // Cleanup plugin\n if (plugin.cleanup) {\n plugin.cleanup();\n }\n \n this.plugins.delete(pluginName);\n }\n\n /**\n * Get all registered commands\n */\n getCommands(): ICommand[] {\n return Array.from(this.commands.values());\n }\n\n /**\n * Get a specific command\n */\n getCommand(name: string): ICommand | undefined {\n // Check direct command name\n let command = this.commands.get(name);\n if (command) return command;\n \n // Check aliases\n const aliasTarget = this.aliases.get(name);\n if (aliasTarget) {\n return this.commands.get(aliasTarget);\n }\n \n return undefined;\n }\n \n /**\n * Get command history\n */\n getHistory(): HistoryEntry[] {\n return [...this.history];\n }\n \n /**\n * Clear command history\n */\n clearHistory(): void {\n this.history = [];\n }\n \n /**\n * Get registered plugins\n */\n getPlugins(): ICLIPlugin[] {\n return Array.from(this.plugins.values());\n }\n \n /**\n * Enter interactive mode\n */\n enterInteractiveMode(logger: Logger): void {\n this.isInteractiveMode = true;\n logger.info('🔧 Interactive CLI mode activated. Type /exit to quit, /help for commands.');\n \n // Set up browser console listener for interactive commands\n if (typeof window !== 'undefined') {\n this.setupBrowserInteractiveMode(logger);\n }\n }\n \n /**\n * Exit interactive mode\n */\n exitInteractiveMode(): void {\n this.isInteractiveMode = false;\n }\n \n /**\n * Setup browser interactive mode\n */\n private setupBrowserInteractiveMode(logger: Logger): void {\n // Add global CLI function for browser usage\n (window as any).cli = (commandString: string) => {\n return this.processCommand(`/${commandString}`, logger);\n };\n \n logger.info('💡 Use cli(\"command\") to execute CLI commands in browser console.');\n }\n\n /**\n * Process a CLI command\n */\n async processCommand(commandString: string, logger: Logger): Promise<void> {\n if (!commandString.startsWith('/')) {\n logger.error('Invalid command. Commands must start with /');\n this.addToHistory(commandString, false);\n return;\n }\n\n const parts = commandString.slice(1).split(' ');\n const commandName = parts[0] || '';\n const args = parts.slice(1).join(' ');\n\n const command = this.getCommand(commandName);\n if (!command) {\n logger.error(`Unknown command: ${commandName}. Type /help for available commands.`);\n \n // Suggest similar commands\n const suggestions = this.getSuggestions(commandName);\n if (suggestions.length > 0) {\n logger.info(`📋 Did you mean: ${suggestions.slice(0, 3).join(', ')}?`);\n }\n \n this.addToHistory(commandString, false);\n return;\n }\n\n try {\n await command.execute(args || '', logger);\n this.addToHistory(commandString, true);\n } catch (error) {\n logger.error(`Command '${commandName}' failed:`, error);\n this.addToHistory(commandString, false);\n }\n }\n \n /**\n * Add command to history\n */\n private addToHistory(command: string, success: boolean): void {\n this.history.unshift({\n command,\n timestamp: new Date(),\n success\n });\n \n // Limit history size\n if (this.history.length > this.maxHistorySize) {\n this.history = this.history.slice(0, this.maxHistorySize);\n }\n }\n\n /**\n * Get command suggestions for partial matches\n */\n getSuggestions(partial: string): string[] {\n const commandNames = Array.from(this.commands.keys());\n return commandNames.filter(name => name.startsWith(partial));\n }\n}","/**\n * @fileoverview Configuration commands for Advanced Logger CLI\n */\n\nimport type { ICommand } from '../CommandProcessor.js';\nimport type { Logger } from '../../Logger.js';\nimport type { ThemeVariant, BannerType, Verbosity } from '../../types/index.js';\n\n/**\n * Configuration command handler\n */\nexport class ConfigCommand implements ICommand {\n name = 'config';\n description = 'Show or update logger configuration';\n usage = '/config [json|key=value,...]';\n\n execute(args: string, logger: Logger): void {\n if (!args) {\n this.showStatus(logger);\n return;\n }\n\n try {\n // Try to parse as JSON first\n if (args.startsWith('{')) {\n const config = JSON.parse(args);\n this.applyConfig(config, logger);\n } else {\n // Parse key=value pairs\n const pairs = args.split(',').map(pair => pair.trim().split('='));\n const config: any = {};\n pairs.forEach(([key, value]) => {\n if (key && value) {\n config[key.trim()] = value.trim().replace(/[\"']/g, '');\n }\n });\n this.applyConfig(config, logger);\n }\n } catch (error) {\n logger.error('Invalid config format. Use JSON or key=value pairs:', error);\n logger.info('Examples: /config {\"theme\":\"dark\"} or /config theme=neon,verbosity=debug');\n }\n }\n\n private showStatus(logger: Logger): void {\n const statusData = {\n theme: logger.getConfig().theme || 'default',\n verbosity: logger.getConfig().verbosity,\n colors: logger.getConfig().enableColors,\n timestamps: logger.getConfig().enableTimestamps,\n stackTrace: logger.getConfig().enableStackTrace,\n globalPrefix: logger.getConfig().globalPrefix || 'none',\n bannerType: logger.getConfig().bannerType || 'simple',\n handlers: logger.getHandlers().length\n };\n\n logger.group('⚙️ Logger Configuration');\n logger.table(statusData);\n logger.groupEnd();\n }\n\n private applyConfig(config: any, logger: Logger): void {\n const validKeys = ['theme', 'verbosity', 'enableColors', 'enableTimestamps', 'enableStackTrace', 'globalPrefix', 'bannerType'];\n const applied: string[] = [];\n\n Object.entries(config).forEach(([key, value]) => {\n if (validKeys.includes(key)) {\n if (key === 'theme' && typeof value === 'string') {\n logger.setTheme(value as ThemeVariant);\n applied.push(`${key}=${value}`);\n } else if (key === 'bannerType' && typeof value === 'string') {\n logger.setBannerType(value as BannerType);\n applied.push(`${key}=${value}`);\n } else if (key === 'verbosity') {\n logger.setVerbosity(value as Verbosity);\n applied.push(`${key}=${value}`);\n } else if (key === 'globalPrefix') {\n logger.setGlobalPrefix(value as string);\n applied.push(`${key}=${value}`);\n } else {\n logger.updateConfig({ [key]: value });\n applied.push(`${key}=${value}`);\n }\n } else {\n logger.warn(`Invalid config key: ${key}`);\n }\n });\n\n if (applied.length > 0) {\n logger.success(`Configuration updated: ${applied.join(', ')}`);\n }\n }\n}","/**\n * @fileoverview Theme and banner commands for Advanced Logger CLI\n */\n\nimport type { ICommand } from '../CommandProcessor.js';\nimport type { Logger } from '../../Logger.js';\nimport type { BannerType } from '../../types/index.js';\nimport { THEME_PRESETS, BANNER_VARIANTS } from '../../styling/index.js';\nimport { StyleBuilder } from '../../styling/index.js';\n\n/**\n * Themes command - show available themes\n */\nexport class ThemesCommand implements ICommand {\n name = 'themes';\n description = 'Show available theme presets';\n usage = '/themes';\n\n execute(_args: string, logger: Logger): void {\n logger.group('🎨 Available Themes');\n Object.keys(THEME_PRESETS).forEach(themeName => {\n const preview = (THEME_PRESETS as any)[themeName];\n const previewStyle = new StyleBuilder()\n .bg(preview.info.background)\n .color(preview.info.color)\n .padding('4px 8px')\n .rounded('4px')\n .border(preview.info.border)\n .build();\n \n console.log(`%c${themeName}`, previewStyle, `- ${themeName} theme preview`);\n });\n logger.groupEnd();\n }\n}\n\n/**\n * Banners command - show available banner types\n */\nexport class BannersCommand implements ICommand {\n name = 'banners';\n description = 'Show available banner types';\n usage = '/banners';\n\n execute(_args: string, logger: Logger): void {\n logger.group('🖼️ Available Banner Types');\n Object.keys(BANNER_VARIANTS).forEach(bannerName => {\n const banner = (BANNER_VARIANTS as any)[bannerName];\n console.log(`%c${bannerName}`, 'font-weight: bold; color: #667eea;');\n console.log(`%cPreview:`, 'color: #666; font-size: 12px;');\n \n // Show a mini preview\n if (bannerName === 'simple') {\n console.log(`%c${banner.text}`, banner.style);\n } else if (bannerName === 'ascii') {\n console.log(`%c${banner.text.split('\\n').slice(1, 4).join('\\n')}...`, 'font-family: monospace; color: #667eea; font-size: 10px;');\n } else if (bannerName === 'unicode') {\n console.log(`%c${banner.text}`, banner.style);\n } else {\n console.log(`%c${bannerName} banner`, 'color: #666; font-style: italic;');\n }\n });\n logger.groupEnd();\n }\n}\n\n/**\n * Banner command - change/show banner type\n */\nexport class BannerCommand implements ICommand {\n name = 'banner';\n description = 'Change or show current banner type';\n usage = '/banner [type]';\n\n execute(args: string, logger: Logger): void {\n if (!args) {\n logger.showBanner();\n return;\n }\n\n if (args in BANNER_VARIANTS) {\n logger.setBannerType(args as BannerType);\n logger.showBanner();\n } else {\n logger.error(`Invalid banner type: ${args}. Available: ${Object.keys(BANNER_VARIANTS).join(', ')}`);\n }\n }\n}","/**\n * @fileoverview Status and demo commands for Advanced Logger CLI\n */\n\nimport type { ICommand } from '../CommandProcessor.js';\nimport type { Logger } from '../../Logger.js';\n\n/**\n * Status command - show logger configuration and statistics\n */\nexport class StatusCommand implements ICommand {\n name = 'status';\n description = 'Show current logger status and configuration';\n usage = '/status';\n\n execute(_args: string, logger: Logger): void {\n const config = logger.getConfig();\n const statusData = {\n theme: config.theme ? config.theme : 'default',\n verbosity: config.verbosity,\n colors: config.enableColors,\n timestamps: config.enableTimestamps,\n stackTrace: config.enableStackTrace,\n globalPrefix: config.globalPrefix ? config.globalPrefix : 'none',\n bannerType: config.bannerType ? config.bannerType : 'simple',\n handlers: logger.getHandlers().length,\n bufferSize: config.bufferSize ? config.bufferSize : 1000\n };\n\n logger.group('⚙️ Logger Configuration');\n logger.table(statusData);\n logger.groupEnd();\n\n // Show buffer stats if ExportLogHandler is present\n const exportHandler = logger.getExportHandler();\n if (exportHandler) {\n const bufferStats = exportHandler.getBufferStats();\n logger.group('📊 Buffer Statistics');\n logger.table({\n size: `${bufferStats.size}/${bufferStats.maxSize}`,\n usage: `${bufferStats.usage.toFixed(1)}%`,\n oldestLog: bufferStats.oldestLog ? bufferStats.oldestLog.toISOString() : 'None',\n newestLog: bufferStats.newestLog ? bufferStats.newestLog.toISOString() : 'None',\n errorCount: bufferStats.levelCounts.error + bufferStats.levelCounts.critical,\n warningCount: bufferStats.levelCounts.warn\n });\n logger.groupEnd();\n }\n }\n}\n\n/**\n * Reset command - reset logger to defaults\n */\nexport class ResetCommand implements ICommand {\n name = 'reset';\n description = 'Reset logger configuration to defaults';\n usage = '/reset';\n\n execute(_args: string, logger: Logger): void {\n logger.resetConfig();\n }\n}\n\n/**\n * Demo command - show logger feature demonstration\n */\nexport class DemoCommand implements ICommand {\n name = 'demo';\n description = 'Show comprehensive feature demonstration';\n usage = '/demo';\n\n execute(_args: string, logger: Logger): void {\n logger.group('🎪 Advanced Logger Demo');\n \n // Basic logging demo\n logger.debug('Debug message with detailed information');\n logger.info('Informational message about system state'); \n logger.warn('Warning about deprecated feature');\n logger.error('Error processing user request');\n logger.success('Operation completed successfully');\n logger.critical('Critical system failure detected');\n \n // Advanced features demo\n logger.group('📊 Advanced Features Demo');\n \n // Table demo\n logger.table([\n { feature: 'Styled Console', status: '✅ Active', performance: 'Excellent' },\n { feature: 'Theme System', status: '✅ Active', performance: 'Great' },\n { feature: 'CLI Interface', status: '✅ Active', performance: 'Good' },\n { feature: 'Export System', status: '✅ Active', performance: 'Excellent' }\n ]);\n \n // Timer demo\n logger.time('demo-operation');\n setTimeout(() => {\n logger.timeEnd('demo-operation');\n }, 100);\n \n // SVG demo\n logger.logWithSVG('SVG Demo');\n \n // Animated demo\n logger.logAnimated('🌟 Animated Logger Demo 🌟', 2);\n \n logger.groupEnd();\n logger.groupEnd();\n\n logger.info('Demo completed! Check the console for styled output.');\n }\n}","/**\n * @fileoverview Export and clipboard commands for Advanced Logger CLI\n */\n\nimport type { ICommand } from '../CommandProcessor.js';\nimport type { Logger } from '../../Logger.js';\nimport type { ExportFormat, ExportFilters, ExportOptions, LogLevel } from '../../types/index.js';\nimport { EXPORT_FORMATS } from '../../constants.js';\n\n/**\n * Parse command line arguments into filters and options\n */\nfunction parseArguments(args: string): { filters: ExportFilters; options: ExportOptions; format?: ExportFormat } {\n const filters: ExportFilters = {};\n const options: ExportOptions = {};\n let format: ExportFormat | undefined;\n\n if (!args.trim()) return { filters, options };\n\n // Split args by spaces, but keep quoted strings together\n const argParts = args.match(/(?:[^\\s\"]+|\"[^\"]*\")+/g) || [];\n \n for (let i = 0; i < argParts.length; i++) {\n const arg = argParts[i];\n\n // Skip if arg is null/undefined\n if (!arg) {\n continue;\n }\n\n // Format (first argument without --)\n if (i === 0 && !arg.startsWith('--') && arg in EXPORT_FORMATS) {\n format = arg as ExportFormat;\n continue;\n }\n\n // Parse --flags\n if (arg.startsWith('--')) {\n const [flag, value] = arg.slice(2).split('=');\n \n switch (flag) {\n case 'level':\n case 'levels':\n if (value) {\n filters.levels = value.split(',').map(l => l.trim()) as LogLevel[];\n }\n break;\n case 'since':\n if (value) filters.since = value;\n break;\n case 'until':\n if (value) filters.until = value;\n break;\n case 'prefix':\n case 'prefixes':\n if (value) {\n filters.prefixes = value.split(',').map(p => p.trim());\n }\n break;\n case 'exclude-prefix':\n case 'exclude-prefixes':\n if (value) {\n filters.excludePrefixes = value.split(',').map(p => p.trim());\n }\n break;\n case 'last':\n if (value) filters.last = parseInt(value, 10);\n break;\n case 'first':\n if (value) filters.first = parseInt(value, 10);\n break;\n case 'search':\n if (value) filters.search = value.replace(/['\"]/g, '');\n break;\n case 'with-stack':\n filters.withStackTrace = true;\n break;\n case 'errors-only':\n filters.errorsOnly = true;\n break;\n case 'group-by':\n if (value) {\n filters.groupBy = value as ExportFilters['groupBy'];\n options.groupBy = value as ExportOptions['groupBy'];\n }\n break;\n case 'minimal':\n options.minimal = true;\n break;\n case 'compact':\n options.compact = true;\n break;\n case 'styled':\n options.styled = true;\n break;\n }\n }\n }\n\n return { filters, options, format };\n}\n\n/**\n * Export command - export logs in various formats\n */\nexport class ExportCommand implements ICommand {\n name = 'export';\n description = 'Export logs to various formats';\n usage = '/export <format> [--filter=value] [--option]';\n\n execute(args: string, logger: Logger): void {\n const exportHandler = logger.getExportHandler();\n if (!exportHandler) {\n logger.error('Export handler not available. Make sure ExportLogHandler is registered.');\n return;\n }\n\n const { filters, options, format } = parseArguments(args);\n\n if (!format) {\n logger.error('Format required. Available formats: ' + Object.keys(EXPORT_FORMATS).join(', '));\n logger.info('Usage: /export <format> [--filter=value]');\n logger.info('Example: /export json --level=error,warn --last=50');\n return;\n }\n\n try {\n const result = exportHandler.export(format, filters, options);\n \n // Log success with metadata\n logger.success(`✅ Export completed: ${result.metadata.filteredLogs} logs exported in ${format} format`);\n \n // Show preview for small exports\n if (result.data.length < 1000) {\n logger.group(`📄 Preview (${format.toUpperCase()})`);\n console.log(result.data);\n logger.groupEnd();\n } else {\n logger.info(`📄 Export size: ${(result.data.length / 1024).toFixed(2)}KB`);\n }\n\n // Show metadata\n logger.table({\n format: result.format,\n totalLogs: result.metadata.totalLogs,\n filtered: result.metadata.filteredLogs,\n exported: result.metadata.exportedAt\n });\n\n } catch (error) {\n logger.error('Export failed:', error);\n }\n }\n}\n\n/**\n * Copy command - copy logs to clipboard\n */\nexport class CopyCommand implements ICommand {\n name = 'copy';\n description = 'Copy logs to clipboard';\n usage = '/copy <format> [--filter=value] [--option]';\n\n async execute(args: string, logger: Logger): Promise<void> {\n const exportHandler = logger.getExportHandler();\n if (!exportHandler) {\n logger.error('Export handler not available. Make sure ExportLogHandler is registered.');\n return;\n }\n\n const { filters, options, format } = parseArguments(args);\n\n if (!format) {\n logger.error('Format required. Available formats: ' + Object.keys(EXPORT_FORMATS).join(', '));\n logger.info('Usage: /copy <format> [--filter=value]');\n logger.info('Example: /copy plain --level=error --last=25');\n return;\n }\n\n try {\n const success = await exportHandler.copyToClipboard(format, filters, options);\n \n if (success) {\n const result = exportHandler.export(format, filters, options);\n logger.success(`📋 Copied ${result.metadata.filteredLogs} logs to clipboard (${format} format)`);\n } else {\n logger.error('Failed to copy to clipboard. Browser may not support clipboard API.');\n }\n\n } catch (error) {\n logger.error('Copy failed:', error);\n }\n }\n}\n\n/**\n * Buffer-size command - configure buffer size\n */\nexport class BufferSizeCommand implements ICommand {\n name = 'buffer-size';\n description = 'Set log buffer size';\n usage = '/buffer-size <size>';\n\n execute(args: string, logger: Logger): void {\n const exportHandler = logger.getExportHandler();\n if (!exportHandler) {\n logger.error('Export handler not available.');\n return;\n }\n\n const size = parseInt(args.trim(), 10);\n if (isNaN(size) || size <= 0) {\n logger.error('Invalid buffer size. Must be a positive number.');\n logger.info('Example: /buffer-size 2000');\n return;\n }\n\n exportHandler.setBufferSize(size);\n logger.success(`Buffer size set to ${size}`);\n }\n}\n\n/**\n * Clear-buffer command - clear log buffer\n */\nexport class ClearBufferCommand implements ICommand {\n name = 'clear-buffer';\n description = 'Clear the log buffer';\n usage = '/clear-buffer';\n\n execute(_args: string, logger: Logger): void {\n const exportHandler = logger.getExportHandler();\n if (!exportHandler) {\n logger.error('Export handler not available.');\n return;\n }\n\n const stats = exportHandler.getBufferStats();\n exportHandler.clearBuffer();\n \n logger.success(`✅ Buffer cleared. Removed ${stats.size} log entries.`);\n }\n}\n\n/**\n * Buffer-info command - show buffer information\n */\nexport class BufferInfoCommand implements ICommand {\n name = 'buffer-info';\n description = 'Show buffer statistics and information';\n usage = '/buffer-info';\n\n execute(_args: string, logger: Logger): void {\n const exportHandler = logger.getExportHandler();\n if (!exportHandler) {\n logger.error('Export handler not available.');\n return;\n }\n\n const stats = exportHandler.getBufferStats();\n \n logger.group('📊 Buffer Information');\n logger.table({\n size: `${stats.size}/${stats.maxSize}`,\n usage: `${stats.usage.toFixed(1)}%`,\n oldestLog: stats.oldestLog?.toLocaleString() || 'None',\n newestLog: stats.newestLog?.toLocaleString() || 'None'\n });\n \n logger.group('📈 Log Level Counts');\n logger.table(stats.levelCounts);\n logger.groupEnd();\n \n logger.groupEnd();\n }\n}","/**\n * @fileoverview Help system for Advanced Logger CLI\n */\n\nimport type { ICommand } from './CommandProcessor.js';\nimport type { Logger } from '../Logger.js';\nimport { StyleBuilder } from '../styling/index.js';\n\n/**\n * Help command - show comprehensive CLI help\n */\nexport class HelpCommand implements ICommand {\n name = 'help';\n description = 'Show CLI help and available commands';\n usage = '/help [command]';\n\n execute(_args: string, logger: Logger): void {\n const helpStyle = new StyleBuilder()\n .bg('linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%)')\n .color('#495057')\n .padding('15px 20px')\n .rounded('8px')\n .border('1px solid #dee2e6')\n .font('Monaco, Consolas, monospace')\n .size('13px')\n .build();\n\n const helpText = `\n╭─────────────── ADVANCED LOGGER CLI COMMANDS ─────────────────╮\n│ │\n│ CONFIGURATION │\n│ /config Show current configuration │\n│ /config {json} Apply JSON configuration │\n│ /config key=val Apply key-value configuration │\n│ /themes Show available themes │\n│ /banners Show available banner types │\n│ /banner [type] Change/show banner type │\n│ /status Show logger status & buffer stats │\n│ /demo Show feature demonstration │\n│ /reset Reset to default configuration │\n│ │\n│ EXPORT & CLIPBOARD │\n│ /export <format> Export logs (json|csv|md|plain|html) │\n│ /copy <format> Copy logs to clipboard │\n│ /buffer-size N Set log buffer size │\n│ /buffer-info Show buffer statistics │\n│ /clear-buffer Clear stored logs │\n│ │\n│ EXPORT FILTERS (for export/copy commands) │\n│ --level error,warn Filter by log levels │\n│ --since 2h Logs from last 2 hours │\n│ --until 1h Logs until 1 hour ago │\n│ --prefix API,DB Filter by prefixes │\n│ --exclude-prefix INT Exclude prefixes │\n│ --last 50 Last 50 logs only │\n│ --first 25 First 25 logs only │\n│ --search \"error\" Search in log messages │\n│ --with-stack Only logs with stack traces │\n│ --errors-only Only error + critical logs │\n│ --group-by level Group by level/prefix/hour │\n│ │\n│ EXPORT OPTIONS │\n│ --minimal Minimal output format │\n│ --compact Remove extra whitespace │\n│ --styled Include styling (HTML format) │\n│ │\n├──────────────────── CONFIGURATION OPTIONS ─────────────────┤\n│ │\n│ theme: default | dark | light | neon | minimal | cyberpunk│\n│ bannerType: simple | ascii | unicode | svg | animated │\n│ verbosity: debug | info | warn | error | critical | silent│\n│ enableColors: true | false │\n│ enableTimestamps: true | false │\n│ enableStackTrace: true | false │\n│ globalPrefix: \"string\" │\n│ bufferSize: number (50-10000) │\n│ │\n├──────────────────────── EXAMPLES ──────────────────────────┤\n│ │\n│ Basic Configuration: │\n│ /config {\"theme\":\"dark\",\"verbosity\":\"debug\"} │\n│ /config theme=neon,bufferSize=2000 │\n│ /banner animated Change to animated banner │\n│ │\n│ Export Examples: │\n│ /export json --level=error,warn --last=25 │\n│ /export csv --since=2h --prefix=API │\n│ /export markdown --group-by=level --errors-only │\n│ /export html --styled --since=1h │\n│ │\n│ Clipboard Examples: │\n│ /copy plain --minimal --last=10 │\n│ /copy json --search=\"authentication\" --compact │\n│ /copy csv --since=30m --exclude-prefix=DEBUG │\n│ │\n│ Buffer Management: │\n│ /buffer-size 5000 Increase buffer to 5000 logs │\n│ /buffer-info Show detailed buffer statistics │\n│ /clear-buffer Clear all stored logs │\n│ │\n│ Time Formats: │\n│ --since=2h 2 hours ago │\n│ --since=30m 30 minutes ago │\n│ --since=1d 1 day ago │\n│ --since=\"2024-01-01T10:00:00Z\" Specific ISO date │\n│ │\n╰─────────────────────────────────────────────────────────────╯`;\n\n console.log(`%c${helpText}`, helpStyle);\n\n // Show quick tips\n logger.group('💡 Quick Tips');\n const tips = [\n 'Use /demo to see all logger features in action',\n 'Logs are automatically stored in a circular buffer for export',\n 'Export formats: JSON (structured), CSV (Excel), Markdown (readable), Plain (simple), HTML (styled)',\n 'Time filters support relative (2h, 30m) and absolute (ISO) formats',\n 'Combine multiple filters: /export json --level=error --since=1h --search=\"auth\"',\n 'Use /copy for quick clipboard access instead of /export'\n ];\n \n tips.forEach(tip => {\n logger.info(`• ${tip}`);\n });\n logger.groupEnd();\n }\n}","/**\n * @fileoverview History management commands for CLI\n */\n\nimport type { ICommand } from '../CommandProcessor.js';\nimport type { Logger } from '../../Logger.js';\n\n/**\n * Show command history\n */\nexport class HistoryCommand implements ICommand {\n name = 'history';\n description = 'Show command execution history';\n usage = '/history [limit] - Show recent commands (default: 10)';\n category = 'system';\n aliases = ['hist', 'h'];\n\n execute(args: string, logger: Logger): void {\n const processor = (logger as any).cliProcessor;\n if (!processor) {\n logger.error('CLI processor not available');\n return;\n }\n\n const limit = parseInt(args) || 10;\n const history = processor.getHistory().slice(0, limit);\n \n if (history.length === 0) {\n logger.info('📝 No command history available');\n return;\n }\n\n logger.info(`📋 Last ${history.length} commands:`);\n \n history.forEach((entry: any, index: number) => {\n const status = entry.success ? '✅' : '❌';\n const time = entry.timestamp.toLocaleTimeString();\n logger.info(`${status} [${time}] ${entry.command}`);\n });\n }\n}\n\n/**\n * Clear command history\n */\nexport class ClearHistoryCommand implements ICommand {\n name = 'clearhistory';\n description = 'Clear command execution history';\n usage = '/clearhistory - Remove all command history';\n category = 'system';\n aliases = ['clrhist'];\n\n execute(args: string, logger: Logger): void {\n const processor = (logger as any).cliProcessor;\n if (!processor) {\n logger.error('CLI processor not available');\n return;\n }\n\n processor.clearHistory();\n logger.success('🗑️ Command history cleared');\n }\n}\n\n/**\n * Interactive mode command\n */\nexport class InteractiveCommand implements ICommand {\n name = 'interactive';\n description = 'Enter interactive CLI mode';\n usage = '/interactive - Start interactive command mode';\n category = 'system';\n aliases = ['i', 'repl'];\n\n execute(args: string, logger: Logger): void {\n const processor = (logger as any).cliProcessor;\n if (!processor) {\n logger.error('CLI processor not available');\n return;\n }\n\n processor.enterInteractiveMode(logger);\n }\n}\n\n/**\n * Plugin management command\n */\nexport class PluginsCommand implements ICommand {\n name = 'plugins';\n description = 'List loaded CLI plugins';\n usage = '/plugins - Show all registered plugins';\n category = 'system';\n aliases = ['plug'];\n\n execute(args: string, logger: Logger): void {\n const processor = (logger as any).cliProcessor;\n if (!processor) {\n logger.error('CLI processor not available');\n return;\n }\n\n const plugins = processor.getPlugins();\n \n if (plugins.length === 0) {\n logger.info('🔌 No plugins registered');\n return;\n }\n\n logger.info(`🔌 Loaded plugins (${plugins.length}):`);\n \n plugins.forEach((plugin: any) => {\n logger.info(` 📦 ${plugin.name} v${plugin.version} - ${plugin.description}`);\n logger.info(` Commands: ${plugin.commands.map((c: any) => c.name).join(', ')}`);\n });\n }\n}","/**\n * @fileoverview Logger avanzado con arquitectura modular y API simplificada\n * @version 0.3.0\n * @since 2024\n * \n * Sistema de logging profesional con estilos CSS avanzados, temas adaptativos,\n * badges automáticos, contextos temporales y exportación de datos.\n */\n\n// Type imports\nimport type {\n LogLevel,\n Verbosity,\n ThemeVariant,\n BannerType,\n LoggerConfig,\n TimerEntry,\n ILogHandler,\n LogMetadata,\n StyleOptions,\n Bindings,\n SerializerFn,\n HookEvent,\n HookCallback,\n MiddlewareFn,\n TransportTarget,\n TransportRecord\n} from './types/index.js';\n\n// Enterprise features\nimport { SerializerRegistry } from './serializers/index.js';\nimport { HookManager } from './hooks/index.js';\nimport { TransportManager } from './transports/index.js';\n\n// Utility imports\nimport { parseStackTrace } from './utils/stackTrace.js';\nimport { formatTimestamp } from './utils/timestamps.js';\nimport { createStyledOutput, setupThemeChangeListener } from './utils/output.js';\nimport { getEnvironment, getColorCapability, isRunningInTerminal } from './utils/environment-detector.js';\nimport { formatBadge } from './terminal/formatter.js';\n\n// Styling imports\nimport {\n THEME_PRESETS,\n THEME_BANNERS,\n displayInitBanner,\n StylePresets,\n StyleBuilder\n} from './styling/index.js';\n\n// Smart presets and dynamic scoped loggers\nimport { getSmartPreset, getAvailablePresets, hasPreset } from './styling/SmartPresets.js';\nimport { createLogStyleBuilder } from './styling/LogStyleBuilder.js';\n\n// Scoped loggers (static import for performance)\nimport { ScopedLogger, APILogger, ComponentLogger } from './ScopedLogger.js';\n\n// Handler imports\nimport { ExportLogHandler } from './handlers/index.js';\n\n// CLI imports\nimport { createDefaultCLI, type CommandProcessor } from './cli/index.js';\n\n// Constants\nimport { DEFAULT_CONFIG, CLI_LEVEL_MAP } from './constants.js';\n\n// CLI Primitives\nimport type { CLILogLevel, ISpinnerHandle, IBoxOptions, ITableOptions } from './types/index.js';\nimport { renderStep } from './cli-primitives/step.js';\nimport { renderHeader } from './cli-primitives/header.js';\nimport { renderDivider } from './cli-primitives/divider.js';\nimport { renderBox } from './cli-primitives/box.js';\nimport { renderTable } from './cli-primitives/cli-table.js';\nimport { SpinnerManager, NoopSpinner } from './cli-primitives/spinner.js';\nimport { ServerFallback } from './cli-primitives/server-fallback.js';\n\n/**\n * Estilos del tema activo actual\n * @private\n */\nlet LEVEL_STYLES = THEME_PRESETS.default;\n\n/**\n * Clase principal Logger con capacidades avanzadas de logging\n * \n * @class Logger\n * @description Sistema completo de logging con temas, badges, contextos y exportación.\n * Detecta automáticamente el tema claro/oscuro del navegador.\n * \n * @example\n * // Uso básico sin configuración\n * import logger from '@mks2508/better-logger';\n * logger.info('Aplicación iniciada');\n * logger.success('Conexión establecida');\n * \n * @example\n * // Aplicar un preset temático\n * logger.preset('cyberpunk');\n * logger.warn('Advertencia con estilo neón');\n * \n * @example\n * // Logger con scope para componentes\n * const auth = logger.component('Autenticación');\n * auth.info('Usuario intentando login');\n * auth.success('Login exitoso');\n * \n * @since 0.3.0\n */\nexport class Logger {\n private config: LoggerConfig;\n private scopedPrefix?: string;\n private handlers: ILogHandler[] = [];\n private timers: Map<string, TimerEntry> = new Map();\n private groupDepth: number = 0;\n private exportHandler?: ExportLogHandler;\n private cliProcessor?: CommandProcessor;\n private themeChangeListener?: (() => void) | null;\n private badgeList: string[] = [];\n private displaySettings = {\n showTimestamp: true,\n showLocation: true,\n showBadges: true\n };\n\n private serializerRegistry: SerializerRegistry;\n private hookManager: HookManager;\n private transportManager?: TransportManager;\n\n /** Whether CLI primitives (step, box, header, etc.) should be shown @since 5.0.0 */\n private _showPrimitives = true;\n /** Server-mode fallback for non-TTY environments @since 5.0.0 */\n private _serverFallback?: ServerFallback;\n\n /**\n * Crea una nueva instancia del Logger\n * \n * @param {Partial<LoggerConfig>} config - Configuración opcional del logger\n * \n * @example\n * // Logger con configuración personalizada\n * const logger = new Logger({\n * theme: 'neon',\n * globalPrefix: 'MiApp',\n * verbosity: 'debug',\n * bufferSize: 1000\n * });\n */\n constructor(config: Partial<LoggerConfig> = {}) {\n this.config = {\n ...DEFAULT_CONFIG,\n ...config,\n };\n\n // Initialize enterprise features\n this.serializerRegistry = new SerializerRegistry();\n this.hookManager = new HookManager();\n\n // Initialize export handler if buffer size is specified\n if (this.config.bufferSize) {\n this.exportHandler = new ExportLogHandler(this.config.bufferSize);\n this.handlers.push(this.exportHandler);\n }\n\n // Initialize CLI processor\n this.cliProcessor = createDefaultCLI();\n\n // Set up theme change listener if auto-detection is enabled\n if (this.config.autoDetectTheme) {\n this.setupAutoThemeDetection();\n }\n }\n\n // ===== PRIVATE HELPER METHODS =====\n \n /**\n * Configura la detección automática de tema con listener de cambios\n * @private\n * @description Detecta automáticamente si el navegador está en modo claro u oscuro\n */\n private setupAutoThemeDetection(): void {\n // Clean up existing listener if any\n if (this.themeChangeListener) {\n this.themeChangeListener();\n this.themeChangeListener = null;\n }\n\n // Set up new listener\n this.themeChangeListener = setupThemeChangeListener((theme) => {\n // Theme changed - logs will automatically use new colors on next call\n // No need to update anything as colors are resolved dynamically\n this.debug(`DevTools theme changed to: ${theme}`);\n });\n }\n\n // ===== CONFIGURATION METHODS =====\n\n /**\n * Obtiene la configuración actual del logger\n * \n * @returns {LoggerConfig} Configuración completa actual\n * \n * @example\n * const config = logger.getConfig();\n * console.log('Verbosidad actual:', config.verbosity);\n * console.log('Tema actual:', config.theme);\n * \n * @since 0.3.0\n */\n getConfig(): LoggerConfig {\n return { ...this.config };\n }\n\n /**\n * Actualiza la configuración del logger\n * \n * @param {Partial<LoggerConfig>} updates - Propiedades a actualizar\n * \n * @example\n * logger.updateConfig({\n * verbosity: 'debug',\n * enableTimestamps: false,\n * theme: 'cyberpunk'\n * });\n * \n * @since 0.3.0\n */\n updateConfig(updates: Partial<LoggerConfig>): void {\n const previousAutoDetect = this.config.autoDetectTheme;\n this.config = { ...this.config, ...updates };\n \n // Handle auto-detection changes\n if (updates.autoDetectTheme !== undefined && updates.autoDetectTheme !== previousAutoDetect) {\n if (updates.autoDetectTheme) {\n this.setupAutoThemeDetection();\n } else if (this.themeChangeListener) {\n this.themeChangeListener();\n this.themeChangeListener = null;\n }\n }\n }\n\n /**\n * Establece el prefijo global para todos los mensajes de log\n * \n * @param {string} prefix - Prefijo a usar\n * \n * @example\n * logger.setGlobalPrefix('MiApp');\n * logger.info('Iniciado'); // [MiApp] Iniciado\n * \n * @since 0.3.0\n */\n setGlobalPrefix(prefix: string): void {\n this.config.globalPrefix = prefix;\n }\n\n /**\n * Establece el nivel de verbosidad para filtrar la salida de logs\n * \n * @param {Verbosity} level - Nivel mínimo a mostrar ('debug' | 'info' | 'warn' | 'error' | 'critical' | 'silent')\n * \n * @example\n * logger.setVerbosity('warn'); // Solo muestra warn, error y critical\n * logger.setVerbosity('debug'); // Muestra todos los niveles\n * logger.setVerbosity('silent'); // No muestra nada\n * \n * @since 0.3.0\n */\n setVerbosity(level: Verbosity): void {\n this.config.verbosity = level;\n }\n\n /**\n * Establece el tema del logger\n * \n * @param {ThemeVariant} theme - Tema a aplicar ('default' | 'dark' | 'light' | 'neon' | 'minimal' | 'cyberpunk')\n * \n * @example\n * logger.setTheme('neon'); // Tema con colores neón\n * logger.setTheme('minimal'); // Tema minimalista\n * logger.setTheme('cyberpunk'); // Tema cyberpunk con efectos\n * \n * @since 0.3.0\n */\n setTheme(theme: ThemeVariant): void {\n // First check if it's a smart preset\n if (hasPreset(theme)) {\n this.preset(theme);\n return;\n }\n \n // Fallback to old theme system\n if (theme in THEME_PRESETS) {\n LEVEL_STYLES = (THEME_PRESETS as any)[theme];\n this.config.theme = theme;\n \n // Show theme-specific banner\n if (theme in THEME_BANNERS) {\n const themeBanner = (THEME_BANNERS as any)[theme];\n console.log(`%c${themeBanner.simple}`, themeBanner.style);\n }\n \n this.success(`Theme changed to: ${theme}`);\n } else {\n this.error(`Invalid theme: ${theme}. Available:`, [...getAvailablePresets(), ...Object.keys(THEME_PRESETS)]);\n }\n }\n\n /**\n * Establece el tipo de banner para mostrar en la inicialización\n * \n * @param {BannerType} bannerType - Tipo de banner ('simple' | 'ascii' | 'unicode' | 'svg' | 'animated')\n * \n * @example\n * logger.setBannerType('ascii'); // Banner con arte ASCII\n * logger.setBannerType('unicode'); // Banner con caracteres Unicode\n * logger.setBannerType('animated'); // Banner con animación\n * \n * @since 0.3.0\n */\n setBannerType(bannerType: BannerType): void {\n this.config.bannerType = bannerType;\n this.success(`Banner type changed to: ${bannerType}`);\n }\n\n /**\n * Reinicia el logger a la configuración por defecto\n * \n * @example\n * logger.resetConfig();\n * // Todo vuelve a la configuración inicial\n * \n * @since 0.3.0\n */\n resetConfig(): void {\n // Clean up theme listener\n if (this.themeChangeListener) {\n this.themeChangeListener();\n this.themeChangeListener = null;\n }\n \n this.config = { ...DEFAULT_CONFIG };\n LEVEL_STYLES = THEME_PRESETS.default;\n \n // Re-setup auto theme detection if enabled in default config\n if (this.config.autoDetectTheme) {\n this.setupAutoThemeDetection();\n }\n \n this.success('Logger configuration reset to defaults');\n }\n\n /**\n * Método de limpieza para eliminar listeners y liberar recursos\n * \n * @example\n * // Antes de cerrar la aplicación\n * logger.cleanup();\n * \n * @since 0.3.0\n */\n cleanup(): void {\n if (this.themeChangeListener) {\n this.themeChangeListener();\n this.themeChangeListener = null;\n }\n // Close transports\n this.transportManager?.close().catch(() => {});\n }\n\n\n // ===== SIMPLIFIED API =====\n\n /**\n * Aplica un preset inteligente - funciona perfectamente sin configuración\n * \n * @param {string} name - Nombre del preset a aplicar\n * \n * @example\n * // Presets disponibles\n * logger.preset('default'); // Limpio y adaptativo\n * logger.preset('cyberpunk'); // Colores neón, efectos brillantes\n * logger.preset('glassmorphism'); // Efectos de blur modernos\n * logger.preset('minimal'); // Minimalista y elegante\n * logger.preset('debug'); // Modo desarrollo detallado\n * logger.preset('production'); // Optimizado para producción\n * \n * @since 0.3.0\n */\n preset(name: string): void {\n if (!hasPreset(name)) {\n this.error(`Unknown preset: ${name}. Available presets:`, getAvailablePresets());\n return;\n }\n\n const presetConfig = getSmartPreset(name);\n if (presetConfig) {\n // Apply the smart preset configuration\n this.displaySettings.showTimestamp = presetConfig.timestamp?.show ?? true;\n this.displaySettings.showLocation = presetConfig.location?.show ?? true;\n\n // Store the preset config for use in createStyledOutput\n (this as any)._activePreset = presetConfig;\n (this as any)._activePresetName = name;\n\n // Only show success message in browser to avoid verbose terminal logs\n if (getEnvironment() === 'browser') {\n this.success(`Applied preset: ${name}`);\n }\n }\n }\n\n /**\n * Lista todos los presets disponibles\n * \n * @returns {string[]} Array con nombres de presets disponibles\n * \n * @example\n * const disponibles = logger.presets();\n * console.log(disponibles); // ['default', 'cyberpunk', 'glassmorphism', ...]\n * \n * @since 0.3.0\n */\n presets(): string[] {\n return getAvailablePresets();\n }\n\n // ===== TOGGLE METHODS =====\n\n /**\n * Oculta el timestamp en los logs\n * \n * @example\n * logger.hideTimestamp();\n * logger.info('Sin marca de tiempo'); // Sin timestamp visible\n * \n * @since 0.3.0\n */\n hideTimestamp(): this {\n this.displaySettings.showTimestamp = false;\n return this;\n }\n\n /**\n * Muestra el timestamp en los logs\n * \n * @example\n * logger.showTimestamp();\n * logger.info('Con marca de tiempo'); // [2024-01-15 10:30:45] Con marca de tiempo\n * \n * @since 0.3.0\n */\n showTimestamp(): this {\n this.displaySettings.showTimestamp = true;\n return this;\n }\n\n /**\n * Oculta la información de ubicación (archivo:línea) en los logs\n * \n * @example\n * logger.hideLocation();\n * logger.debug('Sin ubicación'); // Sin mostrar archivo:línea\n * \n * @since 0.3.0\n */\n hideLocation(): this {\n this.displaySettings.showLocation = false;\n return this;\n }\n\n /**\n * Muestra la información de ubicación (archivo:línea) en los logs\n * \n * @example\n * logger.showLocation();\n * logger.debug('Con ubicación'); // app.js:42 Con ubicación\n * \n * @since 0.3.0\n */\n showLocation(): this {\n this.displaySettings.showLocation = true;\n return this;\n }\n\n /**\n * Oculta los badges en los logs\n * \n * @example\n * logger.hideBadges();\n * const api = logger.api('REST');\n * api.info('Sin badges'); // Sin mostrar [API] [REST]\n * \n * @since 0.3.0\n */\n hideBadges(): this {\n this.displaySettings.showBadges = false;\n return this;\n }\n\n /**\n * Muestra los badges en los logs\n *\n * @example\n * logger.showBadges();\n * const api = logger.api('GraphQL');\n * api.info('Con badges'); // [API] [GraphQL] Con badges\n *\n * @since 0.3.0\n */\n showBadges(): this {\n this.displaySettings.showBadges = true;\n return this;\n }\n\n /**\n * Establece múltiples badges para los logs\n *\n * @param {string[]} badges - Array de badges a mostrar\n * @returns {this} Logger instance para encadenamiento\n *\n * @example\n * logger.badges(['v3', 'stable']).info('Release publicado');\n * logger.badges(['API', 'v2']).warn('Endpoint deprecado');\n *\n * @since 3.0.0\n */\n badges(badges: string[]): this {\n this.badgeList = [...badges];\n return this;\n }\n\n /**\n * Añade un badge individual a la lista\n *\n * @param {string} badge - Badge a añadir\n * @returns {this} Logger instance para encadenamiento\n *\n * @example\n * logger.badge('DEBUG').badge('AUTH').info('Token validado');\n *\n * @since 3.0.0\n */\n badge(badge: string): this {\n if (!this.badgeList.includes(badge)) {\n this.badgeList.push(badge);\n }\n return this;\n }\n\n /**\n * Limpia todos los badges activos\n *\n * @returns {this} Logger instance para encadenamiento\n *\n * @example\n * logger.clearBadges().info('Sin badges');\n *\n * @since 3.0.0\n */\n clearBadges(): this {\n this.badgeList = [];\n return this;\n }\n\n // ===== SCOPED LOGGERS =====\n\n component(name: string): ComponentLogger {\n return new ComponentLogger(this, name);\n }\n\n api(name: string): APILogger {\n return new APILogger(this, name);\n }\n\n scope(name: string): ScopedLogger {\n return new ScopedLogger(this, name);\n }\n\n // ===== SIMPLE CUSTOMIZATION =====\n\n /**\n * Personalización simple con configuración mínima\n * \n * @param {Object} overrides - Opciones de personalización\n * @param {Object} overrides.message - Configuración del mensaje\n * @param {Object} overrides.timestamp - Configuración del timestamp\n * @param {Object} overrides.location - Configuración de ubicación\n * @param {Object} overrides.level - Configuración del nivel\n * @param {Object} overrides.prefix - Configuración del prefijo\n * @param {string} overrides.spacing - Espaciado: 'compact' | 'normal' | 'spacious'\n * \n * @example\n * logger.customize({\n * message: { color: '#00ff00', size: '16px' },\n * timestamp: { show: false },\n * spacing: 'compact'\n * });\n * \n * @since 0.3.0\n */\n customize(overrides: {\n message?: { color?: string; font?: string; size?: string };\n timestamp?: { show?: boolean; color?: string };\n location?: { show?: boolean; color?: string };\n level?: { uppercase?: boolean; style?: string };\n prefix?: { show?: boolean; style?: string };\n spacing?: 'compact' | 'normal' | 'spacious';\n }): void {\n // Apply simple overrides\n if (overrides.timestamp?.show !== undefined) {\n this.displaySettings.showTimestamp = overrides.timestamp.show;\n }\n if (overrides.location?.show !== undefined) {\n this.displaySettings.showLocation = overrides.location.show;\n }\n if (overrides.prefix?.show !== undefined) {\n // Will be handled when we integrate with preset system\n }\n\n // Store customization for use in createStyledOutput\n (this as any)._customization = overrides;\n this.success('Customization applied');\n }\n\n /**\n * Access advanced styling API (for power users)\n */\n styles(): any {\n return createLogStyleBuilder(this);\n }\n\n // ===== HANDLER MANAGEMENT =====\n\n /**\n * Añade un handler personalizado para extender funcionalidad\n * \n * @param {ILogHandler} handler - Handler que implementa ILogHandler\n * \n * @example\n * // Handler personalizado para enviar logs a servidor\n * const remoteHandler = new RemoteLogHandler('https://api.ejemplo.com/logs');\n * logger.addHandler(remoteHandler);\n * \n * @example\n * // Handler para guardar en archivo\n * const fileHandler = new FileLogHandler('./app.log');\n * logger.addHandler(fileHandler);\n * \n * @since 0.3.0\n */\n addHandler(handler: ILogHandler): void {\n this.handlers.push(handler);\n }\n\n /**\n * Obtiene todos los handlers registrados\n * \n * @returns {ILogHandler[]} Array de handlers activos\n * @since 0.3.0\n */\n getHandlers(): ILogHandler[] {\n return [...this.handlers];\n }\n\n /**\n * Obtiene el handler de exportación si está disponible\n *\n * @returns {ExportLogHandler | undefined} Handler de exportación o undefined\n * @since 0.3.0\n */\n getExportHandler(): ExportLogHandler | undefined {\n return this.exportHandler;\n }\n\n // ===== SERIALIZERS =====\n\n /**\n * Añade un serializador personalizado para un tipo específico\n *\n * @param type - Constructor del tipo a serializar\n * @param serializer - Función de serialización\n * @param priority - Prioridad (mayor = primero)\n *\n * @example\n * logger.addSerializer(Error, (err) => ({\n * name: err.name,\n * message: err.message,\n * stack: err.stack?.split('\\n').slice(0, 5)\n * }));\n *\n * @since 3.0.0\n */\n addSerializer<T>(\n type: new (...args: any[]) => T,\n serializer: SerializerFn<T>,\n priority?: number\n ): void {\n this.serializerRegistry.add(type, serializer, priority);\n }\n\n /**\n * Elimina un serializador registrado\n *\n * @param type - Constructor del tipo a remover\n * @returns true si se eliminó\n *\n * @since 3.0.0\n */\n removeSerializer<T>(type: new (...args: any[]) => T): boolean {\n return this.serializerRegistry.remove(type);\n }\n\n /**\n * Obtiene el registry de serializadores\n *\n * @returns SerializerRegistry\n * @since 3.0.0\n */\n getSerializerRegistry(): SerializerRegistry {\n return this.serializerRegistry;\n }\n\n // ===== HOOKS & MIDDLEWARE =====\n\n /**\n * Registra un hook para un evento\n *\n * @param event - Evento: 'beforeLog' | 'afterLog' | 'onError'\n * @param callback - Función a ejecutar\n * @param priority - Prioridad (mayor = primero)\n * @returns Función para desregistrar\n *\n * @example\n * const unsubscribe = logger.on('beforeLog', (entry) => {\n * entry.correlationId = getCorrelationId();\n * return entry;\n * });\n *\n * @since 3.0.0\n */\n on(event: HookEvent, callback: HookCallback, priority?: number): () => void {\n return this.hookManager.on(event, callback, priority);\n }\n\n /**\n * Registra un hook que se ejecuta solo una vez\n *\n * @param event - Evento: 'beforeLog' | 'afterLog' | 'onError'\n * @param callback - Función a ejecutar\n * @param priority - Prioridad (mayor = primero)\n * @returns Función para desregistrar\n *\n * @since 3.0.0\n */\n once(event: HookEvent, callback: HookCallback, priority?: number): () => void {\n return this.hookManager.once(event, callback, priority);\n }\n\n /**\n * Elimina un hook registrado\n *\n * @param event - Evento del hook\n * @param callback - Callback a remover\n * @returns true si se eliminó\n *\n * @since 3.0.0\n */\n off(event: HookEvent, callback: HookCallback): boolean {\n return this.hookManager.off(event, callback);\n }\n\n /**\n * Añade un middleware al pipeline\n *\n * @param middleware - Función middleware\n * @param priority - Prioridad (mayor = primero)\n * @returns Función para desregistrar\n *\n * @example\n * logger.use((entry, next) => {\n * entry.requestId = asyncLocalStorage.getStore()?.requestId;\n * next();\n * });\n *\n * @since 3.0.0\n */\n use(middleware: MiddlewareFn, priority?: number): () => void {\n return this.hookManager.use(middleware, priority);\n }\n\n /**\n * Obtiene el HookManager\n *\n * @returns HookManager\n * @since 3.0.0\n */\n getHookManager(): HookManager {\n return this.hookManager;\n }\n\n // ===== TRANSPORTS =====\n\n /**\n * Añade un transport para envío de logs\n *\n * @param target - Configuración del transport\n * @returns ID único del transport\n *\n * @example\n * // File transport\n * logger.addTransport({\n * target: 'file',\n * options: { destination: '/var/log/app.log' }\n * });\n *\n * @example\n * // HTTP transport con batching\n * logger.addTransport({\n * target: 'http',\n * options: {\n * url: 'https://logs.example.com',\n * batchSize: 100,\n * flushInterval: 5000\n * },\n * level: 'warn'\n * });\n *\n * @since 3.0.0\n */\n addTransport(target: TransportTarget): string {\n if (!this.transportManager) {\n this.transportManager = new TransportManager();\n }\n return this.transportManager.add(target);\n }\n\n /**\n * Elimina un transport\n *\n * @param id - ID del transport a remover\n * @returns true si se eliminó\n *\n * @since 3.0.0\n */\n removeTransport(id: string): boolean {\n return this.transportManager?.remove(id) ?? false;\n }\n\n /**\n * Fuerza el flush de todos los transports\n *\n * @returns Promise que resuelve cuando todos los buffers están vaciados\n *\n * @since 3.0.0\n */\n async flushTransports(): Promise<void> {\n await this.transportManager?.flush();\n }\n\n /**\n * Cierra todos los transports\n *\n * @returns Promise que resuelve cuando todos están cerrados\n *\n * @since 3.0.0\n */\n async closeTransports(): Promise<void> {\n await this.transportManager?.close();\n }\n\n /**\n * Obtiene el TransportManager\n *\n * @returns TransportManager o undefined si no hay transports\n * @since 3.0.0\n */\n getTransportManager(): TransportManager | undefined {\n return this.transportManager;\n }\n\n // ===== CORE LOGGING METHODS =====\n\n /**\n * Verifica si un nivel de log debe mostrarse según la verbosidad actual\n * @private\n * @param {LogLevel} level - Nivel de log a verificar\n * @returns {boolean} True si debe mostrarse, false si no\n */\n private shouldLog(level: LogLevel): boolean {\n if (this.config.verbosity === 'silent') return false;\n const levels = { debug: 0, info: 1, warn: 2, error: 3, critical: 4 };\n return levels[level] >= levels[this.config.verbosity];\n }\n\n /**\n * Obtiene el prefijo efectivo (global + scope)\n * @private\n * @returns {string | undefined} Prefijo combinado o undefined\n */\n private getEffectivePrefix(): string | undefined {\n const parts = [this.config.globalPrefix, this.scopedPrefix].filter(Boolean);\n return parts.length > 0 ? parts.join(':') : undefined;\n }\n\n /**\n * Método central de logging que maneja estilos y formato\n * @protected\n * @param {LogLevel} level - Nivel del log\n * @param {...any} args - Argumentos a loggear\n */\n protected log(level: LogLevel, ...args: any[]): void {\n if (!this.shouldLog(level)) return;\n\n const stackInfo = this.config.enableStackTrace ? parseStackTrace() : null;\n const prefix = this.getEffectivePrefix();\n const timestamp = formatTimestamp();\n\n // Serialize args using registry\n const serializedArgs = args.map(arg => this.serializerRegistry.serialize(arg));\n\n // Prepend badges to message if any\n let message = serializedArgs.length > 0 ? String(serializedArgs[0]) : '';\n if (this.badgeList.length > 0 && this.displaySettings.showBadges) {\n const badgePrefix = this.badgeList.map(b => `[${b}]`).join('');\n message = badgePrefix + ' ' + message;\n }\n const additionalArgs = serializedArgs.slice(1);\n\n // Process beforeLog hooks (sync for performance)\n let hookEntry = {\n level,\n message,\n args: serializedArgs,\n timestamp,\n prefix,\n stackInfo: stackInfo || undefined\n };\n\n // Emit beforeLog event (fire-and-forget for sync logging)\n this.hookManager.emit('beforeLog', hookEntry).then(processed => {\n message = processed.message;\n }).catch(() => {});\n\n // Create styled output with theme detection and display settings\n const [format, ...styles] = createStyledOutput(\n level,\n LEVEL_STYLES,\n prefix,\n message,\n this.displaySettings.showLocation ? stackInfo : null,\n this.config.autoDetectTheme,\n (this as any)._activePreset,\n (this as any)._activePresetName\n );\n\n // Add group indentation\n const groupIndent = ' '.repeat(this.groupDepth);\n const finalFormat = groupIndent + format;\n\n // Output via configured writer (console by default)\n this.writeOutput(finalFormat, level, styles, additionalArgs);\n\n // Update export handler group info\n if (this.exportHandler) {\n this.exportHandler.setGroupInfo(this.groupDepth);\n }\n\n // Call custom handlers\n const metadata: LogMetadata = {\n timestamp,\n level,\n prefix,\n stackInfo: stackInfo ? stackInfo : undefined,\n };\n\n this.handlers.forEach(handler => {\n try {\n handler.handle(level, message, serializedArgs, metadata);\n } catch (error) {\n console.error('Log handler failed:', error);\n }\n });\n\n // Write to transports (async, fire-and-forget)\n if (this.transportManager) {\n const levelValues: Record<LogLevel, number> = {\n debug: 0, info: 1, warn: 2, error: 3, critical: 4\n };\n const record: TransportRecord = {\n level,\n levelValue: levelValues[level],\n time: Date.now(),\n msg: message,\n prefix,\n location: stackInfo ? {\n file: stackInfo.file,\n line: stackInfo.line,\n column: stackInfo.column,\n function: stackInfo.function\n } : undefined\n };\n this.transportManager.write(record).catch(() => {});\n }\n\n // Emit afterLog event (fire-and-forget)\n this.hookManager.emit('afterLog', hookEntry).catch(() => {});\n }\n\n logWithBindings(bindings: Bindings, level: LogLevel, ...args: any[]): void {\n if (!this.shouldLog(level)) return;\n\n let prefix = '';\n const colorCapability = getColorCapability();\n\n if (bindings.badges?.length) {\n prefix += bindings.badges.map(b => formatBadge(b, 'pill', colorCapability, '#00ff88')).join(' ') + ' ';\n }\n if (bindings.scope) {\n prefix += formatBadge(bindings.scope, 'pill', colorCapability, '#00ffff') + ' ';\n }\n\n if (prefix && args.length > 0) {\n args[0] = prefix + String(args[0]);\n }\n\n this.log(level, ...args);\n }\n\n debug(...args: any[]): void {\n this.log('debug', ...args);\n }\n\n /**\n * Registra mensajes informativos\n * \n * @param {...any} args - Mensajes y datos informativos\n * \n * @example\n * logger.info('Servidor iniciado en puerto 3000');\n * logger.info('Usuario conectado:', userId);\n * logger.info('Procesando', totalItems, 'elementos');\n * \n * @since 0.3.0\n */\n info(...args: any[]): void {\n this.log('info', ...args);\n }\n\n /**\n * Registra mensajes de advertencia\n * \n * @param {...any} args - Mensajes de advertencia\n * \n * @example\n * logger.warn('Memoria al 85% de capacidad');\n * logger.warn('API deprecada, usar v2');\n * logger.warn('Reintentos agotados:', maxRetries);\n * \n * @since 0.3.0\n */\n warn(...args: any[]): void {\n this.log('warn', ...args);\n }\n\n /**\n * Registra mensajes de error\n * \n * @param {...any} args - Mensajes de error y stack traces\n * \n * @example\n * logger.error('Fallo en conexión a base de datos');\n * logger.error('Error al procesar:', error.message, error.stack);\n * logger.error('Código de error:', errorCode);\n * \n * @since 0.3.0\n */\n error(...args: any[]): void {\n this.log('error', ...args);\n }\n\n /**\n * Registra mensajes de éxito (nivel info especial)\n * \n * @param {...any} args - Mensajes de operaciones exitosas\n * \n * @example\n * logger.success('Base de datos conectada');\n * logger.success('Usuario creado con ID:', userId);\n * logger.success('✓ Tests pasados: 42/42');\n * \n * @since 0.3.0\n */\n success(...args: any[]): void {\n if (!this.shouldLog('info')) return;\n\n const stackInfo = this.config.enableStackTrace ? parseStackTrace() : null;\n const prefix = this.getEffectivePrefix();\n const message = args.length > 0 ? String(args[0]) : '';\n const additionalArgs = args.slice(1);\n\n // Handle success as special case - use info level with success styling\n const [format, ...styles] = createStyledOutput(\n 'info',\n LEVEL_STYLES,\n prefix,\n message,\n this.displaySettings.showLocation ? stackInfo : null,\n this.config.autoDetectTheme,\n (this as any)._activePreset,\n (this as any)._activePresetName\n );\n \n // Override with success styling\n const successStyle = LEVEL_STYLES.success;\n let emoji = '✅';\n let label = 'SUCCESS';\n \n if (successStyle) {\n if (successStyle.emoji) {\n emoji = successStyle.emoji;\n }\n if (successStyle.label) {\n label = successStyle.label;\n }\n }\n \n const successFormat = format.replace(/ℹ️ INFO/, `${emoji} ${label}`);\n\n const groupIndent = ' '.repeat(this.groupDepth);\n const finalFormat = groupIndent + successFormat;\n\n if (additionalArgs.length > 0) {\n console.log(finalFormat, ...styles, ...additionalArgs);\n } else {\n console.log(finalFormat, ...styles);\n }\n\n // Call handlers\n const metadata: LogMetadata = {\n timestamp: formatTimestamp(),\n level: 'info',\n prefix,\n stackInfo: stackInfo ? stackInfo : undefined,\n };\n\n this.handlers.forEach(handler => {\n try {\n handler.handle('info', message, args, metadata);\n } catch (error) {\n console.error('Log handler failed:', error);\n }\n });\n }\n\n /**\n * Registra información de trace (debugging detallado)\n * \n * @param {...any} args - Datos detallados para debugging\n * \n * @example\n * logger.trace('Entrando en función processData');\n * logger.trace('Stack completo:', new Error().stack);\n * \n * @since 0.3.0\n */\n trace(...args: any[]): void {\n this.log('debug', ...args);\n if (this.shouldLog('debug')) {\n console.trace(...args);\n }\n }\n\n /**\n * Registra errores críticos (prioridad más alta)\n * \n * @param {...any} args - Errores críticos del sistema\n * \n * @example\n * logger.critical('Sistema caído - reinicio inmediato requerido');\n * logger.critical('Pérdida de datos detectada');\n * logger.critical('Brecha de seguridad:', securityError);\n * \n * @since 0.3.0\n */\n critical(...args: any[]): void {\n this.log('critical', ...args);\n }\n\n // ===== ADVANCED LOGGING FEATURES =====\n\n /**\n * Muestra datos en formato de tabla\n * \n * @param {any} data - Datos a mostrar (array de objetos o matriz)\n * @param {string[]} columns - Columnas específicas a mostrar (opcional)\n * \n * @example\n * const usuarios = [\n * { id: 1, nombre: 'Juan', edad: 30 },\n * { id: 2, nombre: 'María', edad: 25 }\n * ];\n * logger.table(usuarios);\n * logger.table(usuarios, ['nombre', 'edad']); // Solo estas columnas\n * \n * @since 0.3.0\n */\n table(data: any, columns?: string[]): void {\n if (!this.shouldLog('info')) return;\n\n const prefix = this.getEffectivePrefix();\n const tableStyle = StylePresets.accent().build();\n\n const format = `%c📊 TABLE${prefix ? ` [${prefix}]` : ''}`;\n console.log(format, tableStyle);\n\n if (columns) {\n console.table(data, columns);\n } else {\n console.table(data);\n }\n }\n\n /**\n * Inicia un grupo colapsable en la consola\n * \n * @param {string} label - Etiqueta del grupo\n * @param {boolean} collapsed - Si el grupo inicia colapsado (default: false)\n * \n * @example\n * logger.group('Procesando usuarios');\n * logger.info('Usuario 1 procesado');\n * logger.info('Usuario 2 procesado');\n * logger.groupEnd();\n * \n * @example\n * // Grupo colapsado por defecto\n * logger.group('Detalles adicionales', true);\n * logger.debug('Información detallada aquí');\n * logger.groupEnd();\n * \n * @since 0.3.0\n */\n group(label: string, collapsed: boolean = false): void {\n const groupStyle = new StyleBuilder()\n .bg('linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%)')\n .color('#1565c0')\n .border('1px solid #90caf9')\n .padding('4px 12px')\n .rounded('6px')\n .bold()\n .build();\n\n const format = `%c📁 ${label}`;\n\n if (collapsed) {\n console.groupCollapsed(format, groupStyle);\n } else {\n console.group(format, groupStyle);\n }\n\n this.groupDepth++;\n }\n\n /**\n * Finaliza el grupo actual de la consola\n * \n * @example\n * logger.group('Operaciones');\n * logger.info('Operación 1');\n * logger.info('Operación 2');\n * logger.groupEnd(); // Cierra el grupo\n * \n * @since 0.3.0\n */\n groupEnd(): void {\n if (this.groupDepth > 0) {\n console.groupEnd();\n this.groupDepth--;\n }\n }\n\n // ===== PERFORMANCE TIMING =====\n\n /**\n * Inicia un temporizador con la etiqueta dada\n * \n * @param {string} label - Etiqueta identificadora del temporizador\n * \n * @example\n * logger.time('proceso-datos');\n * // ... operación costosa ...\n * logger.timeEnd('proceso-datos'); // ⏱️ Timer ended: proceso-datos - 1523.45ms\n * \n * @since 0.3.0\n */\n time(label: string): void {\n const timer: TimerEntry = {\n label,\n startTime: performance.now(),\n };\n this.timers.set(label, timer);\n\n const timerStyle = StylePresets.warning().build();\n console.log(`%c⏱️ Timer started: ${label}`, timerStyle);\n }\n\n /**\n * Finaliza un temporizador y muestra el tiempo transcurrido\n *\n * @param {string} label - Etiqueta del temporizador a finalizar\n * @returns {number} Elapsed milliseconds, or -1 if timer not found\n *\n * @example\n * logger.time('consulta-db');\n * await consultarBaseDatos();\n * const elapsed = logger.timeEnd('consulta-db'); // ⏱️ Timer ended: consulta-db - 234.56ms\n *\n * @since 0.3.0\n */\n timeEnd(label: string): number {\n const timer = this.timers.get(label);\n if (!timer) {\n this.warn(`Timer '${label}' does not exist`);\n return -1;\n }\n\n const elapsed = performance.now() - timer.startTime;\n this.timers.delete(label);\n\n const timerStyle = StylePresets.success().build();\n console.log(`%c⏱️ Timer ended: ${label} - ${elapsed.toFixed(2)}ms`, timerStyle);\n\n return elapsed;\n }\n\n // ===== ADVANCED VISUAL FEATURES =====\n\n /**\n * Muestra un banner con el tipo especificado o configurado\n * \n * @param {BannerType} bannerType - Tipo de banner (opcional)\n * \n * @example\n * logger.showBanner('ascii'); // Banner ASCII art\n * logger.showBanner('unicode'); // Banner con caracteres Unicode\n * logger.showBanner('svg'); // Banner con gráfico SVG\n * logger.showBanner(); // Usa el tipo configurado\n * \n * @since 0.3.0\n */\n showBanner(bannerType?: BannerType): void {\n const effectiveBannerType = bannerType ? bannerType : this.config.bannerType;\n displayInitBanner(effectiveBannerType);\n }\n\n /**\n * Registra mensaje con imagen SVG de fondo\n * \n * @param {string} message - Mensaje a mostrar\n * @param {string} svgContent - Contenido SVG personalizado (opcional)\n * @param {StyleOptions} options - Opciones de estilo (ancho, alto, padding)\n * \n * @example\n * // SVG automático con gradiente\n * logger.logWithSVG('🎆 Bienvenido a Better Logger');\n * \n * @example\n * // SVG personalizado\n * const customSVG = '<svg>...</svg>';\n * logger.logWithSVG('Logo', customSVG, { width: 400, height: 100 });\n * \n * @since 0.3.0\n */\n logWithSVG(message: string, svgContent?: string, options: StyleOptions = {}): void {\n const { width = 300, height = 60, padding = '30px 150px' } = options;\n \n let svgDataUri = '';\n if (svgContent) {\n const encodedSVG = encodeURIComponent(svgContent);\n svgDataUri = `data:image/svg+xml,${encodedSVG}`;\n } else {\n const defaultSVG = `<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 ${width} ${height}'><defs><linearGradient id='grad' x1='0%' y1='0%' x2='100%' y2='0%'><stop offset='0%' style='stop-color:%23667eea'/><stop offset='100%' style='stop-color:%23764ba2'/></linearGradient></defs><rect width='100%' height='100%' fill='url(%23grad)' rx='4'/><text x='${width/2}' y='${height/2 + 5}' text-anchor='middle' fill='white' font-family='monospace' font-size='14' font-weight='bold'>${message}</text></svg>`;\n svgDataUri = `data:image/svg+xml,${encodeURIComponent(defaultSVG)}`;\n }\n\n const svgStyle = new StyleBuilder()\n .bg(`url(\"${svgDataUri}\") no-repeat center center`)\n .padding(padding)\n .color('transparent')\n .rounded('4px')\n .build();\n\n console.log(`%c${message}`, svgStyle);\n }\n\n /**\n * Registra mensaje con gradiente animado de fondo\n * \n * @param {string} message - Mensaje a animar\n * @param {number} duration - Duración de la animación en segundos (default: 3)\n * \n * @example\n * logger.logAnimated('🌈 Animación en progreso');\n * logger.logAnimated('Cargando...', 5); // Animación de 5 segundos\n * \n * @since 0.3.0\n */\n logAnimated(message: string, duration: number = 3): void {\n // Inject CSS animation if not already present\n if (!document.getElementById('logger-animations')) {\n const style = document.createElement('style');\n style.id = 'logger-animations';\n style.textContent = `\n @keyframes loggerGradient {\n 0% { background-position: 0% 50%; }\n 50% { background-position: 100% 50%; }\n 100% { background-position: 0% 50%; }\n }\n `;\n document.head.appendChild(style);\n }\n\n const animatedStyle = new StyleBuilder()\n .bg('linear-gradient(-45deg, #667eea, #764ba2, #667eea, #764ba2)')\n .css('background-size', '400% 400%')\n .color('#ffffff')\n .padding('12px 20px')\n .rounded('8px')\n .bold()\n .font('Monaco, Consolas, monospace')\n .animation(`loggerGradient ${duration}s ease infinite`)\n .display('inline-block')\n .build();\n\n console.log(`%c${message}`, animatedStyle);\n }\n\n /**\n * Agrupa logs por una propiedad específica usando Object.groupBy (cuando esté disponible)\n * \n * @param {T[]} items - Array de elementos a agrupar\n * @param {Function} groupBy - Función que retorna la clave de agrupación\n * \n * @example\n * const ventas = [\n * { producto: 'Laptop', categoria: 'Electrónica', precio: 1200 },\n * { producto: 'Mouse', categoria: 'Electrónica', precio: 25 },\n * { producto: 'Libro', categoria: 'Literatura', precio: 15 }\n * ];\n * logger.logGrouped(ventas, item => item.categoria);\n * \n * @since 0.3.0\n */\n logGrouped<T>(items: T[], groupBy: (item: T) => string): void {\n try {\n // Use Object.groupBy if available (ES2024), otherwise fallback to reduce\n let grouped: Record<string, T[]>;\n \n if ((Object as any).groupBy) {\n grouped = (Object as any).groupBy(items, groupBy);\n } else {\n grouped = items.reduce((acc, item) => {\n const key = groupBy(item);\n if (!acc[key]) {\n acc[key] = [];\n }\n acc[key].push(item);\n return acc;\n }, {} as Record<string, T[]>);\n }\n\n Object.entries(grouped).forEach(([group, groupItems]) => {\n this.group(`Group: ${group}`);\n this.table(groupItems);\n this.groupEnd();\n });\n } catch {\n this.info('Grouped data:', items);\n }\n }\n\n // ===== CLI PRIMITIVES (v5.0) =====\n\n /**\n * Displays a step progress indicator in the terminal\n *\n * @param {number} current - Current step number\n * @param {number} total - Total number of steps\n * @param {string} message - Step description\n *\n * @example\n * logger.step(1, 5, 'Analyzing repository...');\n * logger.step(2, 5, 'Generating commit message...');\n *\n * @since 5.0.0\n */\n step(current: number, total: number, message: string): void {\n if (!this._showPrimitives) return;\n if (!isRunningInTerminal()) {\n this.getServerFallback().step(current, total, message);\n return;\n }\n const colorCap = getColorCapability();\n const output = renderStep(current, total, message, colorCap);\n process.stderr.write(output + '\\n');\n }\n\n /**\n * Displays a styled header with optional subtitle\n *\n * @param {string} title - Main title text\n * @param {string} subtitle - Optional subtitle (rendered dimmed)\n *\n * @example\n * logger.header('Commit Wizard', 'v2.0.0');\n *\n * @since 5.0.0\n */\n header(title: string, subtitle?: string): void {\n if (!this._showPrimitives) return;\n if (!isRunningInTerminal()) {\n this.getServerFallback().header(title, subtitle);\n return;\n }\n const output = renderHeader(title, subtitle);\n process.stderr.write(output + '\\n');\n }\n\n /**\n * Displays a horizontal divider line\n *\n * @example\n * logger.divider();\n *\n * @since 5.0.0\n */\n divider(): void {\n if (!this._showPrimitives) return;\n if (!isRunningInTerminal()) {\n this.getServerFallback().divider();\n return;\n }\n const output = renderDivider();\n process.stderr.write(output + '\\n');\n }\n\n /**\n * Outputs a blank line\n *\n * @example\n * logger.blank();\n *\n * @since 5.0.0\n */\n blank(): void {\n if (!this._showPrimitives) return;\n if (!isRunningInTerminal()) {\n this.getServerFallback().blank();\n return;\n }\n process.stderr.write('\\n');\n }\n\n /**\n * Renders content inside a bordered box\n *\n * @param {string} content - Content string (may contain newlines)\n * @param {IBoxOptions} options - Box rendering options\n *\n * @example\n * logger.box('3 commits generated\\nProvider: Groq', { title: 'Done', borderColor: '#00ff00' });\n *\n * @since 5.0.0\n */\n box(content: string, options?: IBoxOptions): void {\n if (!this._showPrimitives) return;\n if (!isRunningInTerminal()) {\n this.getServerFallback().box(content, options);\n return;\n }\n const colorCap = getColorCapability();\n const output = renderBox(content, options, colorCap);\n process.stderr.write(output + '\\n');\n }\n\n /**\n * Renders an array of objects as a formatted ASCII table.\n * Note: This is distinct from the existing table() method which uses console.table.\n *\n * @param {Record<string, unknown>[]} rows - Array of row objects\n * @param {ITableOptions} options - Table rendering options\n *\n * @example\n * logger.cliTable([\n * { provider: 'Groq', status: 'Available', model: 'llama-3.3-70b' },\n * { provider: 'Gemini', status: 'Configured', model: 'gemini-2.5-flash' },\n * ]);\n *\n * @since 5.0.0\n */\n cliTable(rows: Record<string, unknown>[], options?: ITableOptions): void {\n if (!this._showPrimitives) return;\n if (!isRunningInTerminal()) {\n this.getServerFallback().cliTable(rows, options);\n return;\n }\n const colorCap = getColorCapability();\n const output = renderTable(rows, options, colorCap);\n process.stderr.write(output + '\\n');\n }\n\n /**\n * Creates a spinner handle for showing progress during async operations.\n * Returns a NoopSpinner in non-TTY environments.\n *\n * @param {string} message - Initial spinner text\n * @returns {ISpinnerHandle} Spinner controller\n *\n * @example\n * const s = logger.spinner('Analyzing repository...');\n * s.start();\n * await analyzeRepo();\n * s.succeed('Analysis complete (1.2s)');\n *\n * @since 5.0.0\n */\n spinner(message: string): ISpinnerHandle {\n if (!isRunningInTerminal() || this.config.outputMode === 'silent') {\n return new NoopSpinner(message, this);\n }\n return new SpinnerManager(message, this.config, this);\n }\n\n /**\n * Sets the CLI verbosity level, controlling both log verbosity and primitive visibility\n *\n * @param {CLILogLevel} level - CLI log level\n *\n * @example\n * logger.setCLILevel('quiet'); // Only errors, no CLI primitives\n * logger.setCLILevel('verbose'); // Debug logs + all CLI primitives\n *\n * @since 5.0.0\n */\n setCLILevel(level: CLILogLevel): void {\n const mapping = CLI_LEVEL_MAP[level];\n this.setVerbosity(mapping.verbosity);\n this._showPrimitives = mapping.showPrimitives;\n this.config.cliLevel = level;\n }\n\n /**\n * Returns the current CLI log level\n * @returns {CLILogLevel} Current CLI log level\n * @since 5.0.0\n */\n get cliLevel(): CLILogLevel {\n return this.config.cliLevel ?? 'normal';\n }\n\n /** Lazily creates the server fallback instance @private */\n private getServerFallback(): ServerFallback {\n if (!this._serverFallback) {\n this._serverFallback = new ServerFallback(this);\n }\n return this._serverFallback;\n }\n\n // ===== OUTPUT WRITER SYSTEM =====\n\n /**\n * Writes formatted output to the configured destination.\n * Respects outputMode configuration for console, silent, or custom output.\n *\n * @private\n * @param {string} message - Formatted log message\n * @param {LogLevel} level - Log level\n * @param {string[]} styles - CSS styles for browser console\n * @param {any[]} additionalArgs - Additional arguments to log\n * @since 4.0.0\n */\n private writeOutput(\n message: string,\n level: LogLevel,\n styles: string[],\n additionalArgs: any[]\n ): void {\n const mode = this.config.outputMode ?? 'console';\n\n // Silent mode: no output\n if (mode === 'silent') {\n return;\n }\n\n // Custom mode: use configured writer\n if (mode === 'custom' && this.config.outputWriter) {\n const fullMessage = additionalArgs.length > 0\n ? `${message} ${additionalArgs.map(a => String(a)).join(' ')}`\n : message;\n this.config.outputWriter.write(fullMessage, level, styles);\n return;\n }\n\n // Default: console output\n if (additionalArgs.length > 0) {\n console.log(message, ...styles, ...additionalArgs);\n } else {\n console.log(message, ...styles);\n }\n }\n\n // ===== CLI SYSTEM =====\n\n /**\n * Procesador de comandos CLI para configuración y exportación del logger\n * \n * @param {string} command - Comando CLI a ejecutar\n * @returns {Promise<void>}\n * \n * @example\n * // Comandos disponibles\n * await logger.cli('export json'); // Exporta logs en JSON\n * await logger.cli('export csv'); // Exporta logs en CSV\n * await logger.cli('theme list'); // Lista temas disponibles\n * await logger.cli('theme set neon'); // Cambia al tema neon\n * await logger.cli('config show'); // Muestra configuración actual\n * await logger.cli('history clear'); // Limpia historial de logs\n * await logger.cli('status'); // Muestra estado del logger\n * await logger.cli('help'); // Muestra ayuda de comandos\n * \n * @since 0.3.0\n */\n async cli(command: string): Promise<void> {\n if (!this.cliProcessor) {\n this.error('CLI processor not initialized');\n return;\n }\n\n await this.cliProcessor.processCommand(command, this);\n }\n}\n\n/**\n * Lazy singleton instance - se inicializa solo cuando se necesita\n * @private\n */\nlet _defaultLogger: Logger | null = null;\n\n/**\n * Obtiene o crea la instancia singleton del logger\n * @returns {Logger} Instancia singleton del logger\n */\nfunction getDefaultLogger(): Logger {\n if (!_defaultLogger) {\n _defaultLogger = new Logger({\n verbosity: 'info',\n enableColors: true,\n enableTimestamps: true,\n enableStackTrace: true,\n bufferSize: 1000, // Enable export functionality by default\n });\n \n // Display initialization banner only once\n try {\n displayInitBanner();\n } catch (error) {\n // Silent fail if banner cannot be displayed\n }\n }\n return _defaultLogger;\n}\n\n// Export the lazy singleton getter as default\nexport default getDefaultLogger();\n\n/**\n * Métodos individuales exportados para conveniencia\n * @description Todos los métodos están correctamente enlazados al singleton lazy\n * @since 0.3.0\n */\nexport const debug = (...args: any[]) => getDefaultLogger().debug(...args);\nexport const info = (...args: any[]) => getDefaultLogger().info(...args);\nexport const warn = (...args: any[]) => getDefaultLogger().warn(...args);\nexport const error = (...args: any[]) => getDefaultLogger().error(...args);\nexport const success = (...args: any[]) => getDefaultLogger().success(...args);\nexport const trace = (...args: any[]) => getDefaultLogger().trace(...args);\nexport const critical = (...args: any[]) => getDefaultLogger().critical(...args);\nexport const table = (data: any, columns?: string[]) => getDefaultLogger().table(data, columns);\nexport const group = (label: string, collapsed?: boolean) => getDefaultLogger().group(label, collapsed);\nexport const groupEnd = () => getDefaultLogger().groupEnd();\nexport const time = (label: string) => getDefaultLogger().time(label);\nexport const timeEnd = (label: string) => getDefaultLogger().timeEnd(label);\nexport const setGlobalPrefix = (prefix: string) => getDefaultLogger().setGlobalPrefix(prefix);\nexport const setVerbosity = (level: Verbosity) => getDefaultLogger().setVerbosity(level);\nexport const addHandler = (handler: ILogHandler) => getDefaultLogger().addHandler(handler);\nexport const setTheme = (theme: ThemeVariant) => getDefaultLogger().setTheme(theme);\nexport const setBannerType = (bannerType: BannerType) => getDefaultLogger().setBannerType(bannerType);\nexport const showBanner = (bannerType?: BannerType) => getDefaultLogger().showBanner(bannerType);\nexport const logWithSVG = (message: string, svgContent?: string, options?: StyleOptions) => \n getDefaultLogger().logWithSVG(message, svgContent, options);\nexport const logAnimated = (message: string, duration?: number) => \n getDefaultLogger().logAnimated(message, duration);\nexport const cli = (command: string) => getDefaultLogger().cli(command);\nexport const cleanup = () => getDefaultLogger().cleanup();\n\n// Simplified API exports\nexport const preset = (name: string) => getDefaultLogger().preset(name);\nexport const presets = () => getDefaultLogger().presets();\nexport const hideTimestamp = () => getDefaultLogger().hideTimestamp();\nexport const showTimestamp = () => getDefaultLogger().showTimestamp();\nexport const hideLocation = () => getDefaultLogger().hideLocation();\nexport const showLocation = () => getDefaultLogger().showLocation();\nexport const hideBadges = () => getDefaultLogger().hideBadges();\nexport const showBadges = () => getDefaultLogger().showBadges();\nexport const badges = (badgeList: string[]) => getDefaultLogger().badges(badgeList);\nexport const badge = (badgeName: string) => getDefaultLogger().badge(badgeName);\nexport const clearBadges = () => getDefaultLogger().clearBadges();\nexport const component = (name: string) => getDefaultLogger().component(name);\nexport const api = (name: string) => getDefaultLogger().api(name);\nexport const scope = (name: string) => getDefaultLogger().scope(name);\nexport const customize = (overrides: any) => getDefaultLogger().customize(overrides);\nexport const styles = () => getDefaultLogger().styles();\n\n// Enterprise features exports\nexport const addSerializer = <T>(\n type: new (...args: any[]) => T,\n serializer: SerializerFn<T>,\n priority?: number\n) => getDefaultLogger().addSerializer(type, serializer, priority);\nexport const removeSerializer = <T>(type: new (...args: any[]) => T) =>\n getDefaultLogger().removeSerializer(type);\nexport const on = (event: HookEvent, callback: HookCallback, priority?: number) =>\n getDefaultLogger().on(event, callback, priority);\nexport const once = (event: HookEvent, callback: HookCallback, priority?: number) =>\n getDefaultLogger().once(event, callback, priority);\nexport const off = (event: HookEvent, callback: HookCallback) =>\n getDefaultLogger().off(event, callback);\nexport const use = (middleware: MiddlewareFn, priority?: number) =>\n getDefaultLogger().use(middleware, priority);\nexport const addTransport = (target: TransportTarget) =>\n getDefaultLogger().addTransport(target);\nexport const removeTransport = (id: string) =>\n getDefaultLogger().removeTransport(id);\nexport const flushTransports = () =>\n getDefaultLogger().flushTransports();\nexport const closeTransports = () =>\n getDefaultLogger().closeTransports();\n\n// Re-export handlers and utilities for backward compatibility\nexport { FileLogHandler, RemoteLogHandler, AnalyticsLogHandler, ExportLogHandler } from './handlers/index.js';\nexport { StyleBuilder, StylePresets as Styles } from './styling/index.js';\n\n// Re-export enterprise features\nexport { SerializerRegistry } from './serializers/index.js';\nexport { HookManager } from './hooks/index.js';\nexport { TransportManager, ConsoleTransport, FileTransport, HttpTransport } from './transports/index.js';\nexport { StyleCache, getStyleCache } from './styling/StyleCache.js';\n","/**\n * @fileoverview CLI system exports for Advanced Logger\n */\n\n// Core CLI system\nexport { CommandProcessor, type ICommand } from './CommandProcessor.js';\nimport { CommandProcessor } from './CommandProcessor.js';\n\n// Commands\nexport { ConfigCommand } from './commands/ConfigCommand.js';\nexport { ThemesCommand, BannersCommand, BannerCommand } from './commands/ThemeCommand.js';\nexport { StatusCommand, ResetCommand, DemoCommand } from './commands/StatusCommand.js';\nexport { \n ExportCommand, \n CopyCommand, \n BufferSizeCommand, \n ClearBufferCommand, \n BufferInfoCommand \n} from './commands/ExportCommand.js';\n\n// Help system\nexport { HelpCommand } from './help.js';\n\n// Import all commands\nimport { HelpCommand } from './help.js';\nimport { ConfigCommand } from './commands/ConfigCommand.js';\nimport { ThemesCommand, BannersCommand, BannerCommand } from './commands/ThemeCommand.js';\nimport { StatusCommand, ResetCommand, DemoCommand } from './commands/StatusCommand.js';\nimport { \n ExportCommand, \n CopyCommand, \n BufferSizeCommand, \n ClearBufferCommand, \n BufferInfoCommand \n} from './commands/ExportCommand.js';\nimport { \n HistoryCommand, \n ClearHistoryCommand, \n InteractiveCommand, \n PluginsCommand \n} from './commands/HistoryCommand.js';\n\n/**\n * Create and configure default CLI processor\n */\nexport function createDefaultCLI(): CommandProcessor {\n const processor = new CommandProcessor();\n \n // Register all default commands\n processor.registerCommand(new HelpCommand());\n processor.registerCommand(new ConfigCommand());\n processor.registerCommand(new ThemesCommand());\n processor.registerCommand(new BannersCommand());\n processor.registerCommand(new BannerCommand());\n processor.registerCommand(new StatusCommand());\n processor.registerCommand(new ResetCommand());\n processor.registerCommand(new DemoCommand());\n processor.registerCommand(new ExportCommand());\n processor.registerCommand(new CopyCommand());\n processor.registerCommand(new BufferSizeCommand());\n processor.registerCommand(new ClearBufferCommand());\n processor.registerCommand(new BufferInfoCommand());\n \n // Register new enhanced commands\n processor.registerCommand(new HistoryCommand());\n processor.registerCommand(new ClearHistoryCommand());\n processor.registerCommand(new InteractiveCommand());\n processor.registerCommand(new PluginsCommand());\n \n return processor;\n}"],"names":["DEFAULT_CONFIG","maxDepth","circular","preserveUndefined","SerializerRegistry","serializers","Map","config","constructor","this","registerDefaults","add","Error","err","name","message","stack","split","slice","cause","serialize","Date","date","iso","toISOString","timestamp","getTime","RegExp","regex","pattern","source","flags","map","ctx","obj","forEach","value","key","keyStr","JSON","stringify","String","serializeInternal","depth","path","__type","entries","Set","set","values","Array","from","v","i","Buffer","buf","length","preview","toString","type","serializer","priority","remove","delete","has","getAll","sort","a","b","findSerializer","sorted","entry","context","seen","join","isArray","item","result","val","Object","mergedConfig","WeakSet","generateId","now","Math","random","substr","HookManager","hooks","middlewares","on","event","callback","registration","id","once","get","push","removeHook","off","index","findIndex","h","splice","use","middleware","fn","m","emit","currentEntry","toRemove","hook","error","hookEvent","process","executeNext","async","afterProcess","clear","getStats","beforeLog","afterLog","onError","LOG_LEVELS","debug","info","warn","critical","TransportManager","transports","defaultLevel","target","level","transport","options","levelValue","close","write","record","promises","transformedRecord","transform","Promise","all","flush","count","size","list","keys","THEME_PRESETS","default","emoji","label","background","color","border","shadow","success","dark","neon","minimal","light","cyberpunk","BANNER_VARIANTS","simple","text","style","ascii","unicode","svg","animated","THEME_BANNERS","displayInitBanner","bannerType","selectedType","userAgent","navigator","isChrome","test","isFirefox","isSafari","supportsSVG","document","createElementNS","createSVGRect","createElement","detectBannerCapabilities","banner","textContent","head","appendChild","console","log","group","feature","groupEnd","BaseStyler","builder","StyleBuilder","primary","secondary","accent","muted","getAdaptiveColor","warning","danger","mono","font","system","readable","compact","padding","margin","spacious","inline","display","glassmorphic","css","rounded","neonColor","gradient","to","bg","bold","build","TimestampStyler","hidden","opacity","LevelStyler","badge","glowing","flat","uppercase","PrefixStyler","MessageStyler","ADAPTIVE_COLORS","messageText","code","large","LocationStyler","subtle","location","clickable","cursor","LogStyleBuilder","logStyles","logger","TimestampStyleBuilderProxy","LevelStyleBuilderProxy","prefix","PrefixStyleBuilderProxy","MessageStyleBuilderProxy","LocationStyleBuilderProxy","usePreset","presetName","customize","overrides","spacing","layout","innerPadding","outerMargin","backdrop","filter","transparency","max","min","apply","_customLogStyles","getConfig","_updatePartConfig","part","styles","PartStyleBuilderProxy","parentBuilder","partName","and","applyStyles","styler","super","SMART_PRESETS","show","glassmorphism","production","getAvailablePresets","hasPreset","ScopedLogger","parent","scopeName","badgeList","contextStack","_timers","timers","getBindings","scope","getScopePrefix","badges","includes","clearBadges","setTheme","contextName","ContextLogger","time","startTime","performance","timeEnd","timer","elapsed","toFixed","args","logWithBindings","bindings","trace","step","current","total","header","title","subtitle","divider","blank","box","content","cliTable","rows","spinner","setCLILevel","_pushContext","_popContext","pop","APILogger","apiName","slow","duration","msg","rateLimit","auth","deprecated","ComponentLogger","componentName","lifecycle","stateChange","data","propsChange","changes","parentLogger","run","runAsync","start","end","ExportLogHandler","buffer","maxSize","groupDepth","currentGroup","BUFFER_LIMITS","DEFAULT_SIZE","MIN_SIZE","MAX_SIZE","handle","metadata","generateLogId","stackInfo","groupInfo","groupName","shift","setGroupInfo","getBufferStats","levelCounts","reduce","acc","currentCount","oldestLog","newestLog","firstEntry","lastEntry","usage","clearBuffer","setBufferSize","filterLogs","filters","filtered","levels","prefixes","excludePrefixes","since","sinceDate","parseTimeInput","until","untilDate","withStackTrace","errorsOnly","search","searchTerm","toLowerCase","some","arg","last","first","exportJSON","logs","exportCSV","headers","baseRow","formatDisplayTime","toUpperCase","replace","file","line","safeStringify","row","exportMarkdown","summary","groupBy","grouped","levelArray","getLevelEmoji","exportPlain","padEnd","exportHTML","_options","html","escapeHtml","format","filteredLogs","totalLogs","exportedAt","copyToClipboard","export","clipboard","window","isSecureContext","writeText","textArea","position","body","focus","select","execCommand","removeChild","getAllLogs","saveToFile","blob","Blob","getMimeType","url","URL","createObjectURL","filename","generateFilename","href","download","click","revokeObjectURL","json","csv","markdown","plain","streamToEndpoint","endpoint","batchSize","batch","apiKey","response","fetch","method","batchIndex","floor","totalBatches","ceil","ok","status","statusText","exportWithMetadata","baseResult","bufferStats","memoryUsage","estimateMemoryUsage","processingTime","timezone","Intl","DateTimeFormat","resolvedOptions","timeZone","sampleEntry","CommandProcessor","commands","aliases","plugins","history","maxHistorySize","isInteractiveMode","registerCommand","command","alias","registerPlugin","plugin","initialize","unregisterPlugin","pluginName","cleanup","getCommands","getCommand","aliasTarget","getHistory","clearHistory","getPlugins","enterInteractiveMode","setupBrowserInteractiveMode","exitInteractiveMode","cli","commandString","processCommand","startsWith","addToHistory","parts","commandName","suggestions","getSuggestions","execute","unshift","partial","ConfigCommand","description","parse","applyConfig","pairs","pair","trim","showStatus","statusData","theme","verbosity","colors","enableColors","timestamps","enableTimestamps","stackTrace","enableStackTrace","globalPrefix","handlers","getHandlers","table","validKeys","applied","setBannerType","setVerbosity","setGlobalPrefix","updateConfig","ThemesCommand","_args","themeName","previewStyle","BannersCommand","bannerName","BannerCommand","showBanner","StatusCommand","bufferSize","exportHandler","getExportHandler","errorCount","warningCount","ResetCommand","resetConfig","DemoCommand","setTimeout","logWithSVG","logAnimated","parseArguments","argParts","match","EXPORT_FORMATS","flag","l","p","parseInt","styled","ExportCommand","exported","CopyCommand","BufferSizeCommand","isNaN","ClearBufferCommand","stats","BufferInfoCommand","toLocaleString","HelpCommand","helpStyle","tip","HistoryCommand","category","processor","cliProcessor","limit","toLocaleTimeString","ClearHistoryCommand","InteractiveCommand","PluginsCommand","version","c","LEVEL_STYLES","Logger","scopedPrefix","themeChangeListener","displaySettings","showTimestamp","showLocation","showBadges","serializerRegistry","hookManager","transportManager","_showPrimitives","_serverFallback","createDefaultCLI","autoDetectTheme","setupAutoThemeDetection","setupThemeChangeListener","updates","previousAutoDetect","preset","themeBanner","catch","presetConfig","getSmartPreset","_activePreset","_activePresetName","getEnvironment","presets","hideTimestamp","hideLocation","hideBadges","component","api","_customization","addHandler","handler","addSerializer","removeSerializer","getSerializerRegistry","getHookManager","addTransport","removeTransport","flushTransports","closeTransports","getTransportManager","shouldLog","getEffectivePrefix","Boolean","parseStackTrace","formatTimestamp","serializedArgs","badgePrefix","additionalArgs","hookEntry","then","processed","createStyledOutput","finalFormat","repeat","writeOutput","column","function","colorCapability","getColorCapability","formatBadge","successStyle","successFormat","columns","tableStyle","StylePresets","collapsed","groupStyle","groupCollapsed","timerStyle","svgContent","width","height","svgDataUri","encodeURIComponent","svgStyle","getElementById","animatedStyle","animation","logGrouped","items","groupItems","isRunningInTerminal","getServerFallback","colorCap","output","renderStep","stderr","renderHeader","renderDivider","renderBox","renderTable","outputMode","SpinnerManager","NoopSpinner","mapping","CLI_LEVEL_MAP","showPrimitives","cliLevel","ServerFallback","mode","outputWriter","fullMessage","_defaultLogger","getDefaultLogger"],"mappings":"2IAQMA,EAA6C,CAC/CC,SAAU,EACVC,SAAU,cACVC,mBAAmB,GAGhB,MAAMC,mBACDC,+BAAkDC,IAClDC,OAER,WAAAC,CAAYD,EAA2B,IACnCE,KAAKF,OAAS,IAAKP,KAAmBO,GACtCE,KAAKC,kBACT,CAEQ,gBAAAA,GACJD,KAAKE,IAAIC,MAAQC,IAAA,CACbC,KAAMD,EAAIC,KACVC,QAASF,EAAIE,QACbC,MAAOH,EAAIG,OAAOC,MAAM,MAAMC,MAAM,EAAG,OACnCL,EAAIM,MAAQ,CAAEA,MAAOV,KAAKW,UAAUP,EAAIM,QAAW,CAAA,IACvD,KAEJV,KAAKE,IAAIU,KAAOC,IAAA,CACZC,IAAKD,EAAKE,cACVC,UAAWH,EAAKI,YAChB,IAEJjB,KAAKE,IAAIgB,OAASC,IAAA,CACdC,QAASD,EAAME,OACfC,MAAOH,EAAMG,QACb,IAEJtB,KAAKE,IAAIL,IAAK,CAAC0B,EAAoBC,KAC/B,MAAMC,EAA2B,CAAA,EASjC,OARAF,EAAIG,QAAQ,CAACC,EAAOC,KAChB,MAAMC,EAAwB,iBAARD,EAAmBE,KAAKC,UAAUH,GAAOI,OAAOJ,GACtEH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