import type { TirthaEntry, TirthaSloka } from './types.js'

// The twelve Dvādaśa Jyotirliṅga of Śiva, in the canonical stotra order
// ("Saurāṣṭre Somanāthaṃ ca…" — Somnath 1 … Ghṛṣṇeśvar 12). Each is
// `deity: 'shiva'`, cross-linked to the Rudrābhiṣeka puja and the Pañcākṣarī
// mantra. Locations follow the most widely accepted modern designation; the two
// contested sites (Vaidyanath, Nageshwar) are noted in `tirtha/SOURCES.md`.
// Verified across Wikipedia + Sanskrit Documents (the stotra) + pilgrimage
// references.

export const JYOTIRLINGAS: readonly TirthaEntry[] = [
  {
    id: 'somnath',
    category: 'jyotirlinga',
    jyotirlingaNumber: 1,
    name: { en: 'Somnath', hi: 'सोमनाथ' },
    nameSanskrit: 'सोमनाथ',
    location: { en: 'Prabhas Patan, Veraval', hi: 'प्रभास पाटन, वेरावल' },
    state: { en: 'Gujarat', hi: 'गुजरात' },
    deity: 'shiva',
    significance: {
      en: 'Traditionally honoured as the first (adi) of the twelve jyotirlingas, on the Arabian Sea coast of Saurashtra; the temple was destroyed and rebuilt many times across history.',
      hi: 'बारह ज्योतिर्लिंगों में प्रथम (आदि) माना जाने वाला, सौराष्ट्र के अरब-सागर तट पर स्थित; यह मन्दिर इतिहास में अनेक बार ध्वस्त होकर पुनर्निर्मित हुआ।',
    },
    pujaSlug: 'rudrabhishek',
    mantraSlug: 'om-namah-shivaya',
  },
  {
    id: 'mallikarjuna',
    category: 'jyotirlinga',
    jyotirlingaNumber: 2,
    name: { en: 'Mallikarjuna', hi: 'मल्लिकार्जुन' },
    nameSanskrit: 'मल्लिकार्जुन',
    location: { en: 'Srisailam', hi: 'श्रीशैलम्' },
    state: { en: 'Andhra Pradesh', hi: 'आंध्र प्रदेश' },
    deity: 'shiva',
    significance: {
      en: 'A rare site that is at once a Jyotirlinga and a Shakti Pitha (Bhramaramba), on the Nallamala hills above the Krishna river.',
      hi: 'कृष्णा नदी के ऊपर नल्लमला पहाड़ियों पर स्थित दुर्लभ स्थल, जो एक साथ ज्योतिर्लिंग एवं शक्तिपीठ (भ्रमराम्बा) दोनों है।',
    },
    pujaSlug: 'rudrabhishek',
    mantraSlug: 'om-namah-shivaya',
  },
  {
    id: 'mahakaleshwar',
    category: 'jyotirlinga',
    jyotirlingaNumber: 3,
    name: { en: 'Mahakaleshwar', hi: 'महाकालेश्वर' },
    nameSanskrit: 'महाकाल',
    location: { en: 'Ujjain', hi: 'उज्जैन' },
    state: { en: 'Madhya Pradesh', hi: 'मध्य प्रदेश' },
    deity: 'shiva',
    significance: {
      en: 'A swayambhu (self-manifested) linga and the only one whose idol faces south (dakshinamukhi); famed for the pre-dawn Bhasma Aarti with sacred ash.',
      hi: 'स्वयम्भू (स्वतः प्रकट) लिंग तथा एकमात्र दक्षिणामुखी मूर्ति; प्रातःकाल की भस्म आरती के लिए विख्यात।',
    },
    pujaSlug: 'rudrabhishek',
    mantraSlug: 'om-namah-shivaya',
  },
  {
    id: 'omkareshwar',
    category: 'jyotirlinga',
    jyotirlingaNumber: 4,
    name: { en: 'Omkareshwar', hi: 'ओंकारेश्वर' },
    nameSanskrit: 'ओङ्कारेश्वर',
    location: { en: 'Mandhata Island, Khandwa', hi: 'मान्धाता द्वीप, खंडवा' },
    state: { en: 'Madhya Pradesh', hi: 'मध्य प्रदेश' },
    deity: 'shiva',
    significance: {
      en: 'An island shrine on the Narmada river, on a landmass shaped like the sacred syllable Om (ॐ).',
      hi: 'नर्मदा नदी के एक द्वीप पर स्थित, जिसकी भूमि पवित्र अक्षर ॐ के आकार की मानी जाती है।',
    },
    pujaSlug: 'rudrabhishek',
    mantraSlug: 'om-namah-shivaya',
  },
  {
    id: 'vaidyanath',
    category: 'jyotirlinga',
    jyotirlingaNumber: 5,
    name: { en: 'Vaidyanath (Baidyanath)', hi: 'वैद्यनाथ (बैद्यनाथ)' },
    nameSanskrit: 'वैद्यनाथ',
    location: { en: 'Deoghar', hi: 'देवघर' },
    state: { en: 'Jharkhand', hi: 'झारखंड' },
    deity: 'shiva',
    significance: {
      en: 'Worshipped as Vaidyanath, "lord of healing"; the Baidyanath Dham at Deoghar is the most widely accepted seat (the site is contested — see notes).',
      hi: 'आरोग्य के स्वामी "वैद्यनाथ" रूप में पूजित; देवघर का बैद्यनाथ धाम सर्वाधिक मान्य स्थान है (स्थान विवादित — टिप्पणी देखें)।',
    },
    pujaSlug: 'rudrabhishek',
    mantraSlug: 'om-namah-shivaya',
  },
  {
    id: 'bhimashankar',
    category: 'jyotirlinga',
    jyotirlingaNumber: 6,
    name: { en: 'Bhimashankar', hi: 'भीमाशंकर' },
    nameSanskrit: 'भीमशङ्कर',
    location: { en: 'Bhorgiri, Pune (Sahyadri hills)', hi: 'भोरगिरि, पुणे (सह्याद्रि)' },
    state: { en: 'Maharashtra', hi: 'महाराष्ट्र' },
    deity: 'shiva',
    significance: {
      en: 'Set in the Dakini forest of the Western Ghats; the traditional source region of the Bhima river.',
      hi: 'पश्चिमी घाट के डाकिनी वन में स्थित; भीमा नदी का पारम्परिक उद्गम-क्षेत्र।',
    },
    pujaSlug: 'rudrabhishek',
    mantraSlug: 'om-namah-shivaya',
  },
  {
    id: 'rameshwar',
    category: 'jyotirlinga',
    jyotirlingaNumber: 7,
    name: { en: 'Rameshwar', hi: 'रामेश्वर' },
    nameSanskrit: 'रामेश',
    location: { en: 'Rameswaram Island', hi: 'रामेश्वरम् द्वीप' },
    state: { en: 'Tamil Nadu', hi: 'तमिलनाडु' },
    deity: 'shiva',
    significance: {
      en: 'The southernmost jyotirlinga, linked to Rama worshipping Shiva before the crossing to Lanka; also one of the four pan-India Char Dham.',
      hi: 'सर्वदक्षिण ज्योतिर्लिंग, लंका-गमन से पूर्व राम द्वारा शिव-पूजन से सम्बद्ध; चार धाम में से एक भी।',
    },
    pujaSlug: 'rudrabhishek',
    mantraSlug: 'om-namah-shivaya',
  },
  {
    id: 'nageshwar',
    category: 'jyotirlinga',
    jyotirlingaNumber: 8,
    name: { en: 'Nageshwar', hi: 'नागेश्वर' },
    nameSanskrit: 'नागेश',
    location: { en: 'Near Dwarka', hi: 'द्वारका के निकट' },
    state: { en: 'Gujarat', hi: 'गुजरात' },
    deity: 'shiva',
    significance: {
      en: 'Associated with the Darukavana forest and invoked as protector against poison and serpents (naga); the most common designation is near Dwarka (the site is contested — see notes).',
      hi: 'दारुकावन से सम्बद्ध तथा विष एवं सर्प (नाग) से रक्षक रूप में आराधित; सर्वाधिक प्रचलित स्थान द्वारका के निकट है (स्थान विवादित — टिप्पणी देखें)।',
    },
    pujaSlug: 'rudrabhishek',
    mantraSlug: 'om-namah-shivaya',
  },
  {
    id: 'kashi-vishwanath',
    category: 'jyotirlinga',
    jyotirlingaNumber: 9,
    name: { en: 'Kashi Vishwanath', hi: 'काशी विश्वनाथ' },
    nameSanskrit: 'विश्वेश्वर',
    location: { en: 'Varanasi (Kashi)', hi: 'वाराणसी (काशी)' },
    state: { en: 'Uttar Pradesh', hi: 'उत्तर प्रदेश' },
    deity: 'shiva',
    significance: {
      en: 'One of the most revered Shiva shrines, on the bank of the Ganga in Kashi — the city where death is said to grant liberation; also a Sapta Puri.',
      hi: 'काशी में गंगा-तट पर स्थित परम पूजनीय शिव-मन्दिर — वह नगरी जहाँ मृत्यु मोक्षदायिनी मानी जाती है; सप्त पुरी में से एक भी।',
    },
    pujaSlug: 'rudrabhishek',
    mantraSlug: 'om-namah-shivaya',
  },
  {
    id: 'trimbakeshwar',
    category: 'jyotirlinga',
    jyotirlingaNumber: 10,
    name: { en: 'Trimbakeshwar', hi: 'त्र्यम्बकेश्वर' },
    nameSanskrit: 'त्र्यम्बक',
    location: { en: 'Trimbak, Nashik', hi: 'त्र्यम्बक, नासिक' },
    state: { en: 'Maharashtra', hi: 'महाराष्ट्र' },
    deity: 'shiva',
    significance: {
      en: 'The source region of the Godavari (Gautami) river; its linga uniquely bears three faces, for Brahma, Vishnu and Shiva.',
      hi: 'गोदावरी (गौतमी) नदी का उद्गम-क्षेत्र; इसका लिंग ब्रह्मा, विष्णु एवं शिव के तीन मुखों वाला है।',
    },
    pujaSlug: 'rudrabhishek',
    mantraSlug: 'om-namah-shivaya',
  },
  {
    id: 'kedarnath',
    category: 'jyotirlinga',
    jyotirlingaNumber: 11,
    name: { en: 'Kedarnath', hi: 'केदारनाथ' },
    nameSanskrit: 'केदार',
    location: { en: 'Kedarnath, Rudraprayag', hi: 'केदारनाथ, रुद्रप्रयाग' },
    state: { en: 'Uttarakhand', hi: 'उत्तराखण्ड' },
    deity: 'shiva',
    significance: {
      en: 'The northernmost jyotirlinga, high in the Himalayas near the Mandakini; foremost of the Panch Kedar and part of the Chota Char Dham circuit.',
      hi: 'मन्दाकिनी के निकट हिमालय में स्थित सर्वोत्तर ज्योतिर्लिंग; पंच केदार में प्रमुख तथा छोटा चार धाम यात्रा का अंग।',
    },
    pujaSlug: 'rudrabhishek',
    mantraSlug: 'om-namah-shivaya',
  },
  {
    id: 'grishneshwar',
    category: 'jyotirlinga',
    jyotirlingaNumber: 12,
    name: { en: 'Grishneshwar', hi: 'घृष्णेश्वर' },
    nameSanskrit: 'घुश्मेश',
    location: { en: 'Verul, near Ellora, Sambhajinagar', hi: 'वेरूळ, एलोरा के निकट, संभाजीनगर' },
    state: { en: 'Maharashtra', hi: 'महाराष्ट्र' },
    deity: 'shiva',
    significance: {
      en: 'The twelfth and last of the jyotirlingas, beside the Ellora cave temples; its story celebrates the devotee Kushma (Ghushma).',
      hi: 'बारहवाँ एवं अन्तिम ज्योतिर्लिंग, एलोरा गुफा-मन्दिरों के निकट; इसकी कथा भक्त कुश्मा (घुश्मा) की महिमा गाती है।',
    },
    pujaSlug: 'rudrabhishek',
    mantraSlug: 'om-namah-shivaya',
  },
]

/**
 * The Dvādaśa-Jyotirliṅga Stotra (the canonical enumerating verses
 * "Saurāṣṭre Somanāthaṃ ca…" plus the opening phala line). `iast` is
 * machine-generated from the Devanagari and round-trip-verified. Note the text
 * itself reads "Paralyāṃ Vaidyanāthaṃ" (locating Vaidyanath at Parali) — the
 * textual basis for the Vaidyanath site dispute; see SOURCES.md.
 */
export const DVADASHA_JYOTIRLINGA_STOTRA: TirthaSloka = {
  devanagari: `सौराष्ट्रे सोमनाथं च श्रीशैले मल्लिकार्जुनम् ।
उज्जयिन्यां महाकालमोङ्कारममलेश्वरम् ॥
परल्यां वैद्यनाथं च डाकिन्यां भीमशङ्करम् ।
सेतुबन्धे तु रामेशं नागेशं दारुकावने ॥
वाराणस्यां तु विश्वेशं त्र्यम्बकं गौतमीतटे ।
हिमालये तु केदारं घुश्मेशं च शिवालये ॥
एतानि ज्योतिर्लिङ्गानि सायं प्रातः पठेन्नरः ।
सप्तजन्मकृतं पापं स्मरणेन विनश्यति ॥`,
  iast: `saurāṣṭre somanāthaṃ ca śrīśaile mallikārjunam |
ujjayinyāṃ mahākālamoṅkāramamaleśvaram ||
paralyāṃ vaidyanāthaṃ ca ḍākinyāṃ bhīmaśaṅkaram |
setubandhe tu rāmeśaṃ nāgeśaṃ dārukāvane ||
vārāṇasyāṃ tu viśveśaṃ tryambakaṃ gautamītaṭe |
himālaye tu kedāraṃ ghuśmeśaṃ ca śivālaye ||
etāni jyotirliṅgāni sāyaṃ prātaḥ paṭhennaraḥ |
saptajanmakṛtaṃ pāpaṃ smaraṇena vinaśyati ||`,
}
