import type { Bilingual } from '../types.js'
import type { MantraSlug } from '../mantras/index.js'

// A Navratri day number, 1 (Pratipada) through 9 (Navami).
export type NavratriDay = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

// One of the nine Navadurga forms. The order is the canonical Day 1 → Day 9
// sequence, unanimous across the consulted sources.
export type NavadurgaSlug =
  | 'shailaputri'
  | 'brahmacharini'
  | 'chandraghanta'
  | 'kushmanda'
  | 'skandamata'
  | 'katyayani'
  | 'kalaratri'
  | 'mahagauri'
  | 'siddhidatri'

// The per-form worship mantra (a one-line `oṃ devī …āyai namaḥ` form).
// `jaapSlug` cross-references a `mantras/` preset when one exists (none of the
// nine forms has a dedicated preset, so it is `null` throughout).
// `reviewPending` flagged a mantra whose IAST was unverified; as of the
// 2026-05-29 pass it is dropped — the IAST was normalised to the project
// standard (anusvāra `ṃ`) and round-trip-verified against the Devanagari.
// The meaning is a one-line gloss, not a verse translation, so nothing else
// gates these. (The sibling `dhyana` verse keeps its flag — see below.)
export interface NavadurgaMantra {
  jaapSlug: MantraSlug | null
  devanagari: string
  iast: string
  meaning: Bilingual
  reviewPending?: boolean
}

// A per-form dhyana (meditation) verse — the form's couplet from the Navadurga
// Stotram. `devanagari` and `iast` are multi-line: the padas are newline-
// separated, each closed by a daṇḍa (Kalaratri's dhyana is two couplets / four
// padas; the other eight are one couplet / two padas). `reviewPending` stays
// `true` even after the 2026-05-29 IAST pass: the IAST has been normalised
// (anusvāra `ṃ`) and round-trip-verified against the Devanagari, but the
// `meaning` is a provisional prose gloss of a full verse that has NOT had a
// human Sanskrit-reviewer pass — and for a dhyana verse the gloss is the part
// that needs one. (The sibling worship `mantra`, a one-line namaḥ form, has
// its flag dropped; the dhyana keeps it because of the meaning.)
export interface DhyanaShloka {
  devanagari: string
  iast: string
  meaning: Bilingual
  reviewPending: true
}

// One of the nine Navadurga manifestations of the Devi.
//
// There is no `colour` field — the per-day colour of Navratri follows the
// weekday cycle, not the goddess form, and is computed by the consumer (see
// `navratriColourCycle` / `navratriColourRule`).
export interface NavadurgaForm {
  slug: NavadurgaSlug
  // The Navratri day this form is worshipped on (1 → 9).
  day: NavratriDay
  // Localised form name ("Shailaputri" / "शैलपुत्री").
  name: Bilingual
  // Iconography — mount (vahana), attributes held, complexion.
  iconography: Bilingual
  // A short paragraph on who the form is and what she signifies.
  significance: Bilingual
  // The per-form worship mantra (the `oṃ devī …āyai namaḥ` form).
  mantra: NavadurgaMantra
  // The per-form dhyana (meditation) verse — the form's couplet(s) from the
  // Navadurga Stotram.
  dhyana: DhyanaShloka
  // The traditional bhog (food offering) for the day.
  bhog: Bilingual
}

// One tier of vrat (fasting) intensity that a devotee may keep through Navratri.
export interface VratTier {
  slug: 'nirjala' | 'phalahar' | 'satvik' | 'two-day'
  label: Bilingual
  description: Bilingual
}

// The allowed / forbidden food lists for a Navratri vrat. The lists hold the
// general vrat-kitchen consensus; regional latitude is noted within entries.
export interface VratFoodList {
  allowed: Bilingual[]
  forbidden: Bilingual[]
}

// One of the nine kanyas (young girls) honoured at Kanya Pujan, keyed by age.
export interface KanyaAgeName {
  // The girl's age in years (2 → 10).
  age: number
  // The name under which a girl of this age is honoured.
  name: Bilingual
}

// The Kanya Pujan dataset — the rite of honouring young girls as the Devi,
// kept on Ashtami or Navami.
export interface KanyaPujanData {
  about: Bilingual
  // When the rite is kept (Ashtami vs Navami, and the count of girls).
  whenObserved: Bilingual
  // The nine age-names, ages 2 → 10.
  ageNames: KanyaAgeName[]
  // The step sequence of the rite.
  protocol: Bilingual[]
  // The customary offerings made to the kanyas.
  offerings: Bilingual[]
  // Regional and practical notes.
  notes: Bilingual[]
}

// Which of the three caritas (narrative cycles) a Saptashati chapter belongs to.
export type SaptashatiCharita = 'prathama' | 'madhyama' | 'uttama'

// One of the 13 chapters (adhyayas) of the Durga Saptashati (Devi Mahatmya).
// The Sanskrit / English / Hindi titles are separate fields (three scripts,
// not a translation pair). This is an OUTLINE — the 700 verses are not shipped.
export interface SaptashatiChapter {
  // Chapter number, 1 → 13.
  number: number
  titleSanskrit: string
  titleEnglish: string
  titleHindi: string
  // Which carita this chapter falls in.
  charita: SaptashatiCharita
  // A one-paragraph summary of the chapter's events.
  theme: Bilingual
}

// One day's entry in the nine-day Saptashati reading map.
export interface SaptashatiDayMapEntry {
  day: NavratriDay
  // The chapter numbers read on this day.
  chapters: number[]
  note: Bilingual
}

// The Durga Saptashati outline — chapters, the three-carita structure, and
// one widely-used nine-day reading distribution. Outline only; no verse text.
export interface SaptashatiOutline {
  about: Bilingual
  chapters: SaptashatiChapter[]
  nineDayMap: SaptashatiDayMapEntry[]
  // A caption noting that the day-map is one of several traditional groupings.
  nineDayMapNote: Bilingual
}

// One entry of the Navratri colour cycle — a colour bound to a weekday.
export interface NavratriColour {
  // Weekday, 0 = Sunday … 6 = Saturday (the JavaScript `Date.getDay()` order).
  weekday: 0 | 1 | 2 | 3 | 4 | 5 | 6
  colour: Bilingual
}
