"""Cubing"""

RANK_TYPES = ['best', 'average']
AREAS = ['national', 'regional', 'cityprovincial']
EVENTS = [
    '222', '333', '333bf', '333fm', '333ft', '333mbf', '333mbo', '333oh',
    '444', '444bf', '555', '555bf', '666', '777', 'clock', 'magic', 'minx',
    'mmagic', 'pyram', 'skewb', 'sq1',
]

"""Regions"""

NCR = 'NCR'
REGION_I = 'Region I'
CAR = 'CAR'
REGION_II = 'Region II'
REGION_III = 'Region III'
REGION_IV_A = 'Region IV-A'
REGION_IV_B = 'Region IV-B'
REGION_V = 'Region V'
REGION_VI = 'Region VI'
REGION_VII = 'Region VII'
REGION_VIII = 'Region VIII'
REGION_IX = 'Region IX'
REGION_X = 'Region X'
REGION_XI = 'Region XI'
REGION_XII = 'Region XII'
REGION_XIII = 'Region XIII'
ARMM = 'ARMM'

"""Cities/Provinces"""

# NCR
CALOOCAN = 'Caloocan'
LAS_PINAS = 'Las Piñas'
MAKATI = 'Makati'
MALABON = 'Malabon'
MANDALUYONG = 'Mandaluyong'
CITY_OF_MANILA = 'City of Manila'
MARIKINA = 'Marikina'
MUNTINLUPA = 'Muntinlupa'
NAVOTAS = 'Navotas'
PARAÑAQUE = 'Parañaque'
PASAY = 'Pasay'
PASIG = 'Pasig'
PATEROS = 'Pateros'
QUEZON_CITY = 'Quezon City'
SAN_JUAN = 'San Juan'
TAGUIG = 'Taguig'
VALENZUELA = 'Valenzuela'

# Region I
ILOCOS_NORTE = 'Ilocos Norte'
ILOCOS_SUR = 'Ilocos Sur'
LA_UNION = 'La Union'
PANGASINAN = 'Pangasinan'

# CAR
ABRA = 'Abra'
APAYAO = 'Apayao'
BENGUET = 'Benguet'
IFUGAO = 'Ifugao'
KALINGA = 'Kalinga'
MOUNTAIN_PROVINCE = 'Mountain Province'
BAGUIO = 'Baguio'

# Region II
BATANES = 'Batanes'
CAGAYAN = 'Cagayan'
ISABELA = 'Isabela'
NUEVA_VIZCAYA = 'Nueva Vizcaya'
QUIRINO = 'Quirino'

# Region III
AURORA = 'Aurora'
BATAAN = 'Bataan'
BULACAN = 'Bulacan'
NUEVA_ECIJA = 'Nueva Ecija'
PAMPANGA = 'Pampanga'
TARLAC = 'Tarlac'
ZAMBALES = 'Zambales'
ANGELES = 'Angeles'
OLONGAPO = 'Olongapo'

# Region IV-A
BATANGAS = 'Batangas'
CAVITE = 'Cavite'
LAGUNA = 'Laguna'
QUEZON = 'Quezon'
RIZAL = 'Rizal'
LUCENA = 'Lucena'

# Region IV-B
MARINDUQUE = 'Marinduque'
OCCIDENTAL_MINDORO = 'Occidental Mindoro'
ORIENTAL_MINDORO = 'Oriental Mindoro'
PALAWAN = 'Palawan'
ROMBLON = 'Romblon'
PUERTO_PRINCESA = 'Puerto Princesa'

# Region V
ALBAY = 'Albay'
CAMARINES_NORTE = 'Camarines Norte'
CAMARINES_SUR = 'Camarines Sur'
CATANDUANES = 'Catanduanes'
MASBATE = 'Masbate'
SORSOGON = 'Sorsogon'

# Region VI
AKLAN = 'Aklan'
ANTIQUE = 'Antique'
CAPIZ = 'Capiz'
GUIMARAS = 'Guimaras'
ILOILO = 'Iloilo'
NEGROS_OCCIDENTAL = 'Negros Occidental'
BACOLOD_CITY = 'Bacolod City'
ILOILO_CITY = 'Iloilo City'

# Region VII
BOHOL = 'Bohol'
CEBU = 'Cebu'
NEGROS_ORIENTAL = 'Negros Oriental'
SIQUIJOR = 'Siquijor'
CEBU_CITY = 'Cebu City'
LAPU_LAPU = 'Lapu-Lapu'
MANDAUE = 'Mandaue'

# Region VIII
BILIRAN = 'Biliran'
EASTERN_SAMAR = 'Eastern Samar'
LEYTE = 'Leyte'
NORTHERN_SAMAR = 'Northern Samar'
SAMAR = 'Samar'
SOUTHERN_LEYTE = 'Southern Leyte'
TACLOBAN = 'Tacloban'

# Region IX
ZAMBOANGA_DEL_NORTE = 'Zamboanga del Norte'
ZAMBOANGA_DEL_SUR = 'Zamboanga del Sur'
ZAMBOANGA_SIBUGAY = 'Zamboanga Sibugay'
ZAMBOANGA_CITY = 'Zamboanga City'
ISABELA_CITY = 'Isabela City'

# Region X
BUKIDNON = 'Bukidnon'
CAMIGUIN = 'Camiguin'
LANAO_DEL_NORTE = 'Lanao del Norte'
MISAMIS_OCCIDENTAL = 'Misamis Occidental'
MISAMIS_ORIENTAL = 'Misamis Oriental'
CAGAYAN_DE_ORO = 'Cagayan de Oro'
ILIGAN = 'Iligan'

# Region XI
COMPOSTELA_VALLEY = 'Compostela Valley'
DAVAO_DEL_NORTE = 'Davao del Norte'
DAVAO_DEL_SUR = 'Davao del Sur'
DAVAO_OCCIDENTAL = 'Davao Occidental'
DAVAO_ORIENTAL = 'Davao Oriental'
DAVAO_CITY = 'Davao City'

# Region XII
COTABATO = 'Cotabato'
SARANGANI = 'Sarangani'
SOUTH_COTABATO = 'South Cotabato'
SULTAN_KUDARAT = 'Sultan Kudarat'
COTABATO_CITY = 'Cotabato City'
GENERAL_SANTOS = 'General Santos'

# Region XIII
AGUSAN_DEL_NORTE = 'Agusan del Norte'
AGUSAN_DEL_SUR = 'Agusan del Sur'
DINAGAT_ISLANDS = 'Dinagat Islands'
SURIGAO_DEL_NORTE = 'Surigao del Norte'
SURIGAO_DEL_SUR = 'Surigao del Sur'

# ARMM
BASILAN = 'Basilan'
LANAO_DEL_SUR = 'Lanao del Sur'
MAGUINDANAO = 'Maguindanao'
SULU = 'Sulu'
TAWI_TAWI = 'Tawi-Tawi'

"""Directory"""

LOCATION_DIRECTORY = {
    NCR: {
        'label': 'National Capital Region',
        'cities_provinces': [
            CALOOCAN, LAS_PINAS, MAKATI, MALABON, MANDALUYONG, CITY_OF_MANILA,
            MARIKINA, MUNTINLUPA, NAVOTAS, PARAÑAQUE, PASAY, PASIG, PATEROS,
            QUEZON_CITY, SAN_JUAN, TAGUIG, VALENZUELA,
        ],
    },
    REGION_I: {
        'label': 'Ilocos Region',
        'cities_provinces': [
            ILOCOS_NORTE, ILOCOS_SUR, LA_UNION, PANGASINAN,
        ],
    },
    CAR: {
        'label': 'Cordillera Administrative Region',
        'cities_provinces': [
            ABRA, APAYAO, BENGUET, IFUGAO, KALINGA, MOUNTAIN_PROVINCE, BAGUIO,
        ],
    },
    REGION_II: {
        'label': 'Cagayan Valley',
        'cities_provinces': [
            BATANES, CAGAYAN, ISABELA, NUEVA_VIZCAYA, QUIRINO,
        ],
    },
    REGION_III: {
        'label': 'Central Luzon',
        'cities_provinces': [
            AURORA, BATAAN, BULACAN, NUEVA_ECIJA, PAMPANGA, TARLAC, ZAMBALES,
            ANGELES, OLONGAPO,
        ],
    },
    REGION_IV_A: {
        'label': 'CALABARZON',
        'cities_provinces': [
            BATANGAS, CAVITE, LAGUNA, QUEZON, RIZAL, LUCENA,
        ],
    },
    REGION_IV_B: {
        'label': 'MIMAROPA',
        'cities_provinces': [
            MARINDUQUE, OCCIDENTAL_MINDORO, ORIENTAL_MINDORO, PALAWAN,
            ROMBLON, PUERTO_PRINCESA,
        ],
    },
    REGION_V: {
        'label': 'Bicol Region',
        'cities_provinces': [
            ALBAY, CAMARINES_NORTE, CAMARINES_SUR, CATANDUANES, MASBATE,
            SORSOGON,
        ],
    },
    REGION_VI: {
        'label': 'Western Visayas',
        'cities_provinces': [
            AKLAN, ANTIQUE, CAPIZ, GUIMARAS, ILOILO, NEGROS_OCCIDENTAL,
            BACOLOD_CITY, ILOILO_CITY,
        ],
    },
    REGION_VII: {
        'label': 'Central Visayas',
        'cities_provinces': [
            BOHOL, CEBU, NEGROS_ORIENTAL, SIQUIJOR, CEBU_CITY, LAPU_LAPU,
            MANDAUE,
        ],
    },
    REGION_VIII: {
        'label': 'Eastern Visayas',
        'cities_provinces': [
            BILIRAN, EASTERN_SAMAR, LEYTE, NORTHERN_SAMAR, SAMAR,
            SOUTHERN_LEYTE, TACLOBAN,
        ],
    },
    REGION_IX: {
        'label': 'Zamboanga Peninsula',
        'cities_provinces': [
            ZAMBOANGA_DEL_NORTE, ZAMBOANGA_DEL_SUR, ZAMBOANGA_SIBUGAY,
            ZAMBOANGA_CITY, ISABELA_CITY,
        ],
    },
    REGION_X: {
        'label': 'Northern Mindanao',
        'cities_provinces': [
            BUKIDNON, CAMIGUIN, LANAO_DEL_NORTE, MISAMIS_OCCIDENTAL,
            MISAMIS_ORIENTAL, CAGAYAN_DE_ORO, ILIGAN,
        ],
    },
    REGION_XI: {
        'label': 'Davao Region',
        'cities_provinces': [
            COMPOSTELA_VALLEY, DAVAO_DEL_NORTE, DAVAO_DEL_SUR,
            DAVAO_OCCIDENTAL, DAVAO_ORIENTAL, DAVAO_CITY,
        ],
    },
    REGION_XII: {
        'label': 'SOCCSKSARGEN',
        'cities_provinces': [
            COTABATO, SARANGANI, SOUTH_COTABATO, SULTAN_KUDARAT,
            COTABATO_CITY, GENERAL_SANTOS,
        ],
    },
    REGION_XIII: {
        'label': 'Caraga Region',
        'cities_provinces': [
            AGUSAN_DEL_NORTE, AGUSAN_DEL_SUR, DINAGAT_ISLANDS,
            SURIGAO_DEL_NORTE, SURIGAO_DEL_SUR,
        ],
    },
    ARMM: {
        'label': 'Autonomous Region in Muslim Mindanao',
        'cities_provinces': [
            BASILAN, LANAO_DEL_SUR, MAGUINDANAO, SULU, TAWI_TAWI,
        ],
    },
}

"""Lists and choices (built for django)"""

REGIONS = list(LOCATION_DIRECTORY.keys())
REGION_CHOICES = [(key, region['label']) for key, region in LOCATION_DIRECTORY.items()]

CITIES_PROVINCES = []
for key, region in LOCATION_DIRECTORY.items():
    CITIES_PROVINCES += region['cities_provinces']

CITY_PROVINCE_CHOICES = []
for key, region in LOCATION_DIRECTORY.items():
    CITY_PROVINCE_CHOICES += [(city_province, city_province) for city_province in region['cities_provinces']]
