import Foundation

/* Supported Sticker Presets */

public enum ShareAssetStickerStyle: String, Identifiable, Equatable {
    public enum LogoPositionStyle {
        case none
        case bottomLeading
        case bottomCenter
        case bottomCenterFramed
    }

    public enum TitlePositionStyle {
        case none
        case topCenterHigh
        case topCenterFramed
        case centerFramed
        case topLeadingCorner
        case centerLeading
    }

    public enum TimerPositionStyle {
        case none
        case bottomTrailingCorner
        case topCenterHigh
        case topCenterFramed
        case paddedCenterLeading
    }

    public enum FiveBandWavePosition {
        case none
        case trailingLogo
        case centerFramedAboveTitle
        case centerFramed
    }

    case none
    case coreInfoStandard = "core_info_standard"
    case leadingInfoStandard = "leading_info_standard"
    case coreLyricsStandard = "core_lyrics_standard"
    case framedCoreCenter = "framed_core_center"
    case framedCoreTop = "framed_core_top"

    public var id: String {
        return rawValue
    }

    public var supportsLyrics: Bool {
        switch self {
        case .none,
             .coreInfoStandard,
             .framedCoreCenter,
             .framedCoreTop,
             .leadingInfoStandard:
            return false
        case .coreLyricsStandard:
            return true
        }
    }

    public var supportedLyrics: [ShareAssetLyricsStyle] {
        switch self {
        case .none,
             .coreInfoStandard,
             .framedCoreCenter,
             .framedCoreTop,
             .leadingInfoStandard:
            return [
                .none,
            ]

        case .coreLyricsStandard:
            return [
                .none,
                .lyricsBox,
                .lyricsThreeLine,
                .lyricsTwoLine,
            ]
        }
    }

    /* Covers sides of render to give the appearance of a card in the middle */
    public var usesFrameCardV1: Bool {
        switch self {
        case .none,
             .coreInfoStandard,
             .leadingInfoStandard,
             .coreLyricsStandard:
            return false
        case .framedCoreCenter,
             .framedCoreTop:
            return true
        }
    }

    public var logoPositionStyle: LogoPositionStyle {
        switch self {
        case .none:
            return .none
        case .coreInfoStandard,
             .leadingInfoStandard:
            return .bottomLeading
        case .coreLyricsStandard:
            return .bottomCenter
        case .framedCoreCenter:
            return .bottomCenterFramed
        case .framedCoreTop:
            return .bottomCenterFramed
        }
    }

    public var titlePositionStyle: TitlePositionStyle {
        switch self {
        case .none:
            return .none
        case .coreInfoStandard:
            return .topLeadingCorner
        case .leadingInfoStandard:
            return .centerLeading
        case .coreLyricsStandard:
            return .topCenterHigh
        case .framedCoreCenter:
            return .centerFramed
        case .framedCoreTop:
            return .topCenterFramed
        }
    }

    public var timerPositionStyle: TimerPositionStyle {
        switch self {
        case .none:
            return .none
        case .coreInfoStandard:
            return .bottomTrailingCorner
        case .leadingInfoStandard:
            return .paddedCenterLeading
        case .coreLyricsStandard:
            return .topCenterHigh
        case .framedCoreCenter:
            return .topCenterHigh
        case .framedCoreTop:
            return .topCenterFramed
        }
    }

    public var fiveBandWavePositionStyle: FiveBandWavePosition {
        switch self {
        case .none, .leadingInfoStandard, .coreLyricsStandard:
            return .none
        case .coreInfoStandard:
            return .trailingLogo
        case .framedCoreCenter:
            return .centerFramedAboveTitle
        case .framedCoreTop:
            return .centerFramed
        }
    }
}
