import type { AppReadyRuntimeDepsFactoryInput } from '../app-lifecycle';

export function createBuildAppReadyRuntimeMainDepsHandler(deps: AppReadyRuntimeDepsFactoryInput) {
  return (): AppReadyRuntimeDepsFactoryInput => ({
    ensureDefaultConfigBootstrap: deps.ensureDefaultConfigBootstrap,
    loadSubtitlePosition: deps.loadSubtitlePosition,
    resolveKeybindings: deps.resolveKeybindings,
    createMpvClient: deps.createMpvClient,
    reloadConfig: deps.reloadConfig,
    getResolvedConfig: deps.getResolvedConfig,
    getConfigWarnings: deps.getConfigWarnings,
    logConfigWarning: deps.logConfigWarning,
    initRuntimeOptionsManager: deps.initRuntimeOptionsManager,
    setSecondarySubMode: deps.setSecondarySubMode,
    defaultSecondarySubMode: deps.defaultSecondarySubMode,
    defaultWebsocketPort: deps.defaultWebsocketPort,
    defaultAnnotationWebsocketPort: deps.defaultAnnotationWebsocketPort,
    defaultTexthookerPort: deps.defaultTexthookerPort,
    hasMpvWebsocketPlugin: deps.hasMpvWebsocketPlugin,
    startSubtitleWebsocket: deps.startSubtitleWebsocket,
    startAnnotationWebsocket: deps.startAnnotationWebsocket,
    startTexthooker: deps.startTexthooker,
    log: deps.log,
    setLogLevel: deps.setLogLevel,
    setLogRotation: deps.setLogRotation,
    setLogFileToggles: deps.setLogFileToggles,
    createMecabTokenizerAndCheck: deps.createMecabTokenizerAndCheck,
    createSubtitleTimingTracker: deps.createSubtitleTimingTracker,
    createImmersionTracker: deps.createImmersionTracker,
    startJellyfinRemoteSession: deps.startJellyfinRemoteSession,
    loadYomitanExtension: deps.loadYomitanExtension,
    ensureYomitanExtensionLoaded: deps.ensureYomitanExtensionLoaded,
    handleFirstRunSetup: deps.handleFirstRunSetup,
    prewarmSubtitleDictionaries: deps.prewarmSubtitleDictionaries,
    startBackgroundWarmups: deps.startBackgroundWarmups,
    texthookerOnlyMode: deps.texthookerOnlyMode,
    shouldAutoInitializeOverlayRuntimeFromConfig: deps.shouldAutoInitializeOverlayRuntimeFromConfig,
    setVisibleOverlayVisible: deps.setVisibleOverlayVisible,
    initializeOverlayRuntime: deps.initializeOverlayRuntime,
    runHeadlessInitialCommand: deps.runHeadlessInitialCommand,
    handleInitialArgs: deps.handleInitialArgs,
    onCriticalConfigErrors: deps.onCriticalConfigErrors,
    logDebug: deps.logDebug,
    now: deps.now,
    shouldRunHeadlessInitialCommand: deps.shouldRunHeadlessInitialCommand,
    shouldUseMinimalStartup: deps.shouldUseMinimalStartup,
    shouldSkipHeavyStartup: deps.shouldSkipHeavyStartup,
    shouldHandleInitialArgsBeforeDeferredOverlayWarmup:
      deps.shouldHandleInitialArgsBeforeDeferredOverlayWarmup,
  });
}
