package com.applemand.zmanim.core.jewcal

/**
 * KosherJava JewishDate month numbering: 1=Nisan, 2=Iyar, ... 12=Adar, 13=Adar II (in leap years).
 * Civil-year order (Tishrei first) is presentational and handled at the UI layer.
 */
enum class HebrewMonth(val kosherId: Int) {
    NISAN(1), IYAR(2), SIVAN(3), TAMMUZ(4), AV(5), ELUL(6),
    TISHREI(7), CHESHVAN(8), KISLEV(9), TEVET(10), SHEVAT(11),
    ADAR(12), ADAR_II(13);

    companion object {
        fun fromKosher(id: Int): HebrewMonth =
            entries.firstOrNull { it.kosherId == id }
                ?: error("unknown Hebrew month id: $id")
    }
}

object HebrewMonthNames {
    val english = arrayOf(
        "Nisan", "Iyar", "Sivan", "Tammuz", "Av", "Elul",
        "Tishrei", "Cheshvan", "Kislev", "Tevet", "Shevat", "Adar", "Adar II"
    )
    val hebrew = arrayOf(
        "ניסן", "אייר", "סיון", "תמוז", "אב", "אלול",
        "תשרי", "חשון", "כסלו", "טבת", "שבט", "אדר", "אדר ב׳"
    )

    fun en(kosherId: Int): String = english[kosherId - 1]
    fun he(kosherId: Int): String = hebrew[kosherId - 1]
}

object HebrewDayNames {
    val english = arrayOf(
        "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Shabbat"
    )
    val hebrew = arrayOf(
        "יום ראשון", "יום שני", "יום שלישי", "יום רביעי", "יום חמישי", "יום שישי", "שבת קודש"
    )
}
