package org.microg.vending.billing.core.ui

val UITypeIndexMap: Map<Int, UIType> = UIType.values().associateBy { it.value }

enum class UIType(val value: Int) {
    UNKNOWN(-1),
    LOADING_SPINNER(213),
    PURCHASE_CART_BUY_BUTTON(711),
    PURCHASE_CART_CONTINUE_BUTTON(712),
    PURCHASE_CART_PAYMENT_OPTIONS_LINK(714),
    PURCHASE_AUTH_SCREEN(750),
    PURCHASE_ERROR_SCREEN(770),
    BILLING_PROFILE_OPTION_REDEEM_CODE(815),
    BILLING_PROFILE_OPTION_ADD_PLAY_CREDIT(816),
    BILLING_PROFILE_OPTION_CREATE_INSTRUMENT(817),
    BILLING_PROFILE_EXISTING_INSTRUMENT(818),
    BILLING_PROFILE_BUTTON_UPDATE_INSTRUMENT(819),
    PURCHASE_SUCCESS_SCREEN_WITH_AUTH_CHOICES(1250),
    PURCHASE_CHANGE_SUBSCRIPTION_CONTINUE_BUTTON(1281),
    PURCHASE_PAYMENT_DECLINED_CONTINUE_BUTTON(1301),
    BILLING_PROFILE_MORE_OPTION_BUTTON_SHOW_HIDEABLE_INSTRUMENT(12034),
    PURCHASE_CONSENT_COLLECTION_REFUND_RIGHTS_CONTINUE_BUTTON(11872),
    BILLING_PROFILE_SCREEN_ABANDON(12035);

    companion object {
        fun fromValue(value: Int): UIType {
            return UITypeIndexMap[value] ?: UNKNOWN
        }
    }
}