/**
 * @djangocfg/ui-tools
 *
 * Heavy React tools with lazy loading (React.lazy + Suspense)
 * Works in any React environment: Next.js, Vite, Wails, CRA
 *
 * Bundle sizes:
 * - Map: ~800KB (MapLibre GL maps)
 * - Mermaid: ~800KB (diagram rendering)
 * - PrettyCode: ~500KB (code syntax highlighting)
 * - OpenapiViewer: ~400KB (OpenAPI schema viewer & playground)
 * - JsonForm: ~300KB (JSON Schema form generator)
 * - LottiePlayer: ~200KB (Lottie animation player)
 * - AudioPlayer: ~200KB (Audio player with WaveSurfer.js)
 * - VideoPlayer: ~150KB (Professional video player with Vidstack)
 * - JsonTree: ~100KB (JSON visualization)
 * - Gallery: ~50KB (Image/video gallery)
 * - ImageViewer: ~50KB (Image viewer with zoom/pan/rotate)
 * - CronScheduler: ~15KB (Cron expression builder)
 *
 * For tree-shaking, use subpath imports:
 * - import { Gallery } from '@djangocfg/ui-tools/gallery'
 * - import { MapContainer } from '@djangocfg/ui-tools/map'
 */

'use client';

// ============================================================================
// Lazy Loading Utilities
// ============================================================================

export {
  // Components
  LazyWrapper,
  LoadingFallback,
  CardLoadingFallback,
  MapLoadingFallback,
  Spinner,
  // Factory
  createLazyComponent,
} from './components';
export type {
  LazyWrapperProps,
  LoadingFallbackProps,
  CreateLazyComponentOptions,
} from './components';

// ============================================================================
// Lazy Components (heavy tools, loaded on demand)
// ============================================================================

// Map (~800KB)
export {
  LazyMapContainer,
  LazyMapView,
} from './tools/Map/lazy';
export type {
  MapContainerProps,
  MapViewport,
  MapStyleKey,
  MarkerData,
} from './tools/Map/lazy';

// Mermaid (~800KB)
export { LazyMermaid } from './tools/Mermaid/lazy';
export type { MermaidProps } from './tools/Mermaid/lazy';

// PrettyCode (~500KB)
export { LazyPrettyCode } from './tools/PrettyCode/lazy';
export type { PrettyCodeProps } from './tools/PrettyCode/lazy';

// OpenapiViewer (~400KB)
export { LazyOpenapiViewer } from './tools/OpenapiViewer/lazy';
export type { ApiKey, PlaygroundConfig, SchemaSource, PlaygroundProps } from './tools/OpenapiViewer/lazy';

// JsonForm (~300KB)
export { LazyJsonSchemaForm } from './tools/JsonForm/lazy';

// LottiePlayer (~200KB)
export { LazyLottiePlayer } from './tools/LottiePlayer/lazy';

// AudioPlayer (~200KB)
export {
  LazyHybridAudioPlayer,
  LazyHybridSimplePlayer,
  LazyHybridCompactPlayer,
} from './tools/AudioPlayer/lazy';
export type { HybridCompactPlayerProps } from './tools/AudioPlayer/lazy';

// AudioBus — global audio exclusivity (one player at a time)
export { useAudioBus, useAudioBusStore } from './tools/AudioPlayer/hooks/useAudioBus';
export type { UseAudioBusReturn } from './tools/AudioPlayer/hooks/useAudioBus';

// VideoPlayer (~150KB)
export { LazyVideoPlayer } from './tools/VideoPlayer/lazy';

// JsonTree (~100KB)
export { LazyJsonTree } from './tools/JsonTree/lazy';
export type { JsonTreeProps } from './tools/JsonTree/lazy';

// ImageViewer (~50KB)
export { LazyImageViewer } from './tools/ImageViewer/lazy';

// CronScheduler (~15KB)
export { LazyCronScheduler } from './tools/CronScheduler/lazy';
export type { CronSchedulerProps } from './tools/CronScheduler/lazy';

// ============================================================================
// Tools (from ./tools/index.ts) - Direct imports (no lazy loading)
// ============================================================================

export * from './tools';

// ============================================================================
// Components (Markdown, etc.)
// ============================================================================

export * from './components/markdown';

// ============================================================================
// Stores
// ============================================================================

export * from './stores/mediaCache';
