/**
 * Tools - Heavy components with lazy loading (React.lazy + Suspense)
 *
 * All components are lazy-loaded to reduce initial bundle size:
 * - Mermaid: ~800KB (diagram rendering)
 * - PrettyCode: ~500KB (code syntax highlighting)
 * - JsonTree: ~100KB (JSON visualization)
 * - LottiePlayer: ~200KB (Lottie animation player)
 * - JsonForm: ~300KB (JSON Schema form generator)
 * - OpenapiViewer: ~400KB (OpenAPI schema viewer & playground)
 * - VideoPlayer: ~150KB (Professional video player with Vidstack)
 * - AudioPlayer: ~200KB (Audio player with WaveSurfer.js)
 * - ImageViewer: ~50KB (Image viewer with zoom/pan/rotate)
 * - CronScheduler: ~15KB (Cron expression builder)
 *
 * Works in any React environment: Next.js, Vite, Wails, CRA
 */

// Export tools as named exports (all use React.lazy internally)
export { default as JsonTree } from './JsonTree';
export type { JsonTreeConfig } from './JsonTree';
export { default as Mermaid } from './Mermaid';
export { default as PrettyCode } from './PrettyCode';
export type { Language } from './PrettyCode';
export { LottiePlayer, useLottie, usePrefersReducedMotion } from './LottiePlayer';
export type {
  LottiePlayerProps,
  LottieSize,
  LottieSpeed,
  LottieDirection,
  LottieSegment,
  UseLottieOptions,
  UseLottieReturn,
} from './LottiePlayer';

// Export JsonForm components
export { JsonSchemaForm } from './JsonForm';
export type { JsonSchemaFormProps } from './JsonForm';
export * from './JsonForm/widgets';
export * from './JsonForm/templates';
export * from './JsonForm/utils';

// Export OpenapiViewer
export { default as OpenapiViewer } from './OpenapiViewer';
export type { PlaygroundConfig, SchemaSource, PlaygroundProps } from './OpenapiViewer';

// Export VideoPlayer (media-chrome shell with provider-aware canvases)
export {
  VideoPlayer,
  CanvasDispatcher,
  NativeCanvas,
  YouTubeCanvas,
  VimeoCanvas,
  HlsCanvas,
  IframeCanvas,
  PlayButton,
  SeekBar,
  Volume,
  Fullscreen,
  Pip,
  PlaybackRate,
  ControlsBar,
  Poster,
  parseEmbedUrl,
  extractYouTubeId,
  extractVimeoId,
} from './VideoPlayer';
export type {
  VideoSource,
  UrlSource,
  YouTubeSource,
  VimeoSource,
  HlsSource,
  IframeSource,
  AspectRatioValue,
  VideoPlayerProps,
  VideoPlayerSettings,
  PlayButtonProps,
  SeekBarProps,
  VolumeProps,
  FullscreenProps,
  PipProps,
  PlaybackRateProps,
  ControlsBarProps,
  CanvasDispatcherProps,
  NativeCanvasProps,
  YouTubeCanvasProps,
  VimeoCanvasProps,
  HlsCanvasProps,
  IframeCanvasProps,
} from './VideoPlayer';

// AudioPlayer v6 — under construction (see @dev/@refactoring6-audioplayer/).
// The previous Hybrid* surface lives at ./AudioPlayer_old/ for reference and
// is intentionally not re-exported.
export { Player as AudioPlayer } from './AudioPlayer';
export type { PlayerProps as AudioPlayerProps } from './AudioPlayer';

// Export ImageViewer
export { ImageViewer } from './ImageViewer';
export type { ImageViewerProps, ImageFile } from './ImageViewer';

// Export CronScheduler (~15KB)
export {
  CronScheduler,
  // Context & Hooks
  CronSchedulerProvider,
  useCronSchedulerContext,
  useCronType,
  useCronTime,
  useCronWeekDays,
  useCronMonthDays,
  useCronCustom,
  useCronPreview,
  useCronScheduler,
  // Utilities
  buildCron,
  parseCron,
  isValidCron,
  humanizeCron,
  // Components
  ScheduleTypeSelector,
  TimeSelector,
  DayChips,
  MonthDayGrid,
  CustomInput,
  SchedulePreview,
} from './CronScheduler';
export type {
  CronSchedulerProps,
  ScheduleType,
  WeekDay,
  MonthDay,
  CronSchedulerState,
  CronSchedulerContextValue,
} from './CronScheduler';

// Export CodeEditor (Monaco ~550KB)
export {
  Editor,
  DiffEditor,
} from './CodeEditor/components';
export type { EditorRef } from './CodeEditor/components/Editor';
export {
  EditorProvider,
  useEditorContext,
} from './CodeEditor/context';
export {
  useMonaco,
  useEditor,
  useLanguage,
} from './CodeEditor/hooks';
export type {
  EditorFile,
  EditorOptions,
  EditorProps,
  DiffEditorProps,
  EditorContextValue,
  UseEditorReturn,
  UseMonacoReturn,
} from './CodeEditor/types';

// Export MarkdownEditor (Tiptap ~200KB)
export { MarkdownEditor, mentionPresets } from './MarkdownEditor';
export type {
  MarkdownEditorProps,
  MentionItem,
  MentionConfig,
  MentionAttrs,
  MentionMarkdownRenderer,
} from './MarkdownEditor';

// Export Tree (decomposed shadcn-style tree, our own engine)
export {
  TreeRoot,
  Tree,
  TreeProvider,
  useTreeContext,
  useTreeLabels,
  useTreeRows,
  useTreeSelection,
  useTreeExpansion,
  useTreeFocus,
  useTreeSearch,
  useTreeActions,
  useTreeTypeAhead,
  useTreeKeyboard,
  TreeContent,
  TreeRow,
  TreeChevron,
  TreeIcon,
  TreeLabel,
  TreeSearchInput,
  TreeEmpty,
  TreeSkeleton,
  TreeError,
  TreeIndentGuides,
  createChildCache,
  resolveChildren,
  flattenTree,
  loadTreeState,
  saveTreeState,
  clearTreeState,
  createDemoTree,
  DEFAULT_TREE_LABELS,
  DEFAULT_TREE_APPEARANCE,
  resolveAppearance,
  appearanceToStyle,
} from './Tree';
export type {
  TreeRootProps,
  TreeProviderProps,
  TreeContextValue,
  TreeContextMenuSlot,
  TreeContentProps,
  TreeRowProps,
  TreeChevronProps,
  TreeIconProps,
  TreeLabelProps,
  TreeSearchInputProps,
  TreeEmptyProps,
  TreeSkeletonProps,
  TreeErrorProps,
  TreeIndentGuidesProps,
  TreeNode,
  TreeItemId,
  TreeLabels,
  TreeSelectionMode,
  TreeRowRenderProps,
  TreeRowSlot,
  TreeLoadChildren,
  FlatRow,
  ChildCache,
  ChildEntry,
  ChildEntryStatus,
  FlattenInput,
  PersistedTreeState,
  UseTreeTypeAheadOptions,
  UseTreeKeyboardOptions,
  DemoNode,
  TreeAppearance,
  ResolvedAppearance,
  TreeDensity,
  TreeAccentIntensity,
  TreeRadius,
} from './Tree';

// Export Media Cache Store
export {
  useMediaCacheStore,
  useImageCache,
  useAudioCache,
  useVideoCache,
  useBlobUrlCleanup,
  generateContentKey,
} from '../stores/mediaCache';
