import Foundation

// Check `HooksPlayerAnalyticsClient` to see how these are used across the app.
// We should slowly move all `playCurrentHook` and `pauseCurrentHook` actions
// from `HooksPlayerClient` to send events through the EventBusClient and HookEvent instead

// Different places the user can navigate to pause and resume Hook playback
public enum HookNavigationCause: Equatable, Sendable {
    case profile
    case createHook
    case createSong
    case tab
    case cover
    case extend
    case feed // Navigating into or out of a feed
    case onboarding
}

public enum HookPauseCause: Equatable, Sendable {
    case scroll // User scrolled to another hook
    case openOmniPlayer(clipId: String) // Opened OmniPlayer to play full song
    case reloadFeed // User reloaded feed
    case manual // User manually paused
    case navigation(HookNavigationCause) // User navigated away (profile, tapped "Create Hook", etc.)
    case appInactive // App switcher engaged
    case appBackground // App backgrounded
    case appTerminate // App is terminating
    case openDeeplink // Opened deeplink to play hook
    case audioInterruption // Phone call, Siri, other audio interruption
}

// Play causes for different hook play scenarios
public enum HookPlayCause: Equatable, Sendable {
    case manual // User explicitly tapped to play/resume
    case resume(HookNavigationCause) // Automatic resume (navigation, onAppear)
    case appForeground // App foregrounded
    case closeOmniPlayer(clipId: String, songSessionId: String) // Closed OmniPlayer and returned to hook
    case openDeeplink // Opened deeplink to play hook
}
