// SPDX-FileCopyrightText: 2026 Manuel Alcaraz Zambrano <manuel@alcarazzam.dev>
// SPDX-License-Identifier: GPL-3.0-or-later

#pragma once

#include <variant>

#include <QLocale>
#include <QMap>

#include <KLazyLocalizedString>

using namespace Qt::StringLiterals;

static const QMap<QString, std::variant<QLocale::Territory, KLazyLocalizedString>> FEDERATIONS{
    // clang-format off
    {"AFG"_L1, QLocale::Territory::Afghanistan},
    {"ALB"_L1, QLocale::Territory::Albania},
    {"ALG"_L1, QLocale::Territory::Algeria},
    {"AND"_L1, QLocale::Territory::Andorra},
    {"ANG"_L1, QLocale::Territory::Angola},
    {"ANT"_L1, QLocale::Territory::AntiguaAndBarbuda},
    {"ARG"_L1, QLocale::Territory::Argentina},
    {"ARM"_L1, QLocale::Territory::Armenia},
    {"ARU"_L1, QLocale::Territory::Aruba},
    {"AUS"_L1, QLocale::Territory::Australia},
    {"AUT"_L1, QLocale::Territory::Austria},
    {"AZE"_L1, QLocale::Territory::Azerbaijan},
    {"BAH"_L1, QLocale::Territory::Bahamas},
    {"BAN"_L1, QLocale::Territory::Bangladesh},
    {"BAR"_L1, QLocale::Territory::Barbados},
    {"BDI"_L1, QLocale::Territory::Burundi},
    {"BEL"_L1, QLocale::Territory::Belgium},
    {"BER"_L1, QLocale::Territory::Bermuda},
    {"BHU"_L1, QLocale::Territory::Bhutan},
    {"BIH"_L1, QLocale::Territory::BosniaAndHerzegovina},
    {"BIZ"_L1, QLocale::Territory::Belize},
    {"BLR"_L1, QLocale::Territory::Belarus},
    {"BOL"_L1, QLocale::Territory::Bolivia},
    {"BOT"_L1, QLocale::Territory::Botswana},
    {"BRA"_L1, QLocale::Territory::Brazil},
    {"BRN"_L1, QLocale::Territory::Bahrain},
    {"BRU"_L1, QLocale::Territory::Brunei},
    {"BUL"_L1, QLocale::Territory::Bulgaria},
    {"BUR"_L1, QLocale::Territory::BurkinaFaso},
    {"CAF"_L1, QLocale::Territory::CentralAfricanRepublic},
    {"CAM"_L1, QLocale::Territory::Cambodia},
    {"CAN"_L1, QLocale::Territory::Canada},
    {"CAY"_L1, QLocale::Territory::CaymanIslands},
    {"CHA"_L1, QLocale::Territory::Chad},
    {"CHI"_L1, QLocale::Territory::Chile},
    {"CHN"_L1, QLocale::Territory::China},
    {"CIV"_L1, QLocale::Territory::IvoryCoast},
    {"CMR"_L1, QLocale::Territory::Cameroon},
    {"COD"_L1, QLocale::Territory::DemocraticRepublicOfCongo},
    {"COL"_L1, QLocale::Territory::Colombia},
    {"COM"_L1, QLocale::Territory::Comoros},
    {"CPV"_L1, QLocale::Territory::CapeVerde},
    {"CRC"_L1, QLocale::Territory::CostaRica},
    {"CRO"_L1, QLocale::Territory::Croatia},
    {"CUB"_L1, QLocale::Territory::Cuba},
    {"CUR"_L1, QLocale::Territory::Curacao},
    {"CYP"_L1, QLocale::Territory::Cyprus},
    {"CZE"_L1, QLocale::Territory::CzechRepublic},
    {"DEN"_L1, QLocale::Territory::Denmark},
    {"DJI"_L1, QLocale::Territory::Djibouti},
    {"DMA"_L1, QLocale::Territory::Dominica},
    {"DOM"_L1, QLocale::Territory::DominicanRepublic},
    {"ECU"_L1, QLocale::Territory::Ecuador},
    {"EGY"_L1, QLocale::Territory::Egypt},
    {"ENG"_L1, QLocale::Territory::UnitedKingdom},
    {"ERI"_L1, QLocale::Territory::Eritrea},
    {"ESA"_L1, QLocale::Territory::ElSalvador},
    {"ESP"_L1, QLocale::Territory::Spain},
    {"EST"_L1, QLocale::Territory::Estonia},
    {"ETH"_L1, QLocale::Territory::Ethiopia},
    {"FAI"_L1, QLocale::Territory::FaroeIslands},
    {"FIJ"_L1, QLocale::Territory::Fiji},
    {"FIN"_L1, QLocale::Territory::Finland},
    {"FRA"_L1, QLocale::Territory::France},
    {"GAB"_L1, QLocale::Territory::Gabon},
    {"GAM"_L1, QLocale::Territory::Gambia},
    {"GCI"_L1, QLocale::Territory::Guernsey},
    {"GEO"_L1, QLocale::Territory::Georgia},
    {"GEQ"_L1, QLocale::Territory::EquatorialGuinea},
    {"GER"_L1, QLocale::Territory::Germany},
    {"GHA"_L1, QLocale::Territory::Ghana},
    {"GRE"_L1, QLocale::Territory::Greece},
    {"GRN"_L1, QLocale::Territory::Grenada},
    {"GUA"_L1, QLocale::Territory::Guatemala},
    {"GUI"_L1, QLocale::Territory::Guinea},
    {"GUM"_L1, QLocale::Territory::Guam},
    {"GUY"_L1, QLocale::Territory::Guyana},
    {"HAI"_L1, QLocale::Territory::Haiti},
    {"HKG"_L1, QLocale::Territory::HongKong},
    {"HON"_L1, QLocale::Territory::Honduras},
    {"HUN"_L1, QLocale::Territory::Hungary},
    {"INA"_L1, QLocale::Territory::Indonesia},
    {"IND"_L1, QLocale::Territory::India},
    {"IRI"_L1, QLocale::Territory::Iran},
    {"IRL"_L1, QLocale::Territory::Ireland},
    {"IRQ"_L1, QLocale::Territory::Iraq},
    {"ISL"_L1, QLocale::Territory::Iceland},
    {"ISR"_L1, QLocale::Territory::Israel},
    {"ISV"_L1, QLocale::Territory::UnitedStatesVirginIslands},
    {"ITA"_L1, QLocale::Territory::Italy},
    {"IVB"_L1, QLocale::Territory::BritishVirginIslands},
    {"JAM"_L1, QLocale::Territory::Jamaica},
    {"JCI"_L1, QLocale::Territory::Jersey},
    {"JOR"_L1, QLocale::Territory::Jordan},
    {"JPN"_L1, QLocale::Territory::Japan},
    {"KAZ"_L1, QLocale::Territory::Kazakhstan},
    {"KEN"_L1, QLocale::Territory::Kenya},
    {"KGZ"_L1, QLocale::Territory::Kyrgyzstan},
    {"KIR"_L1, QLocale::Territory::Kiribati},
    {"KOR"_L1, QLocale::Territory::SouthKorea},
    {"KOS"_L1, QLocale::Territory::Kosovo},
    {"KSA"_L1, QLocale::Territory::SaudiArabia},
    {"KUW"_L1, QLocale::Territory::Kuwait},
    {"LAO"_L1, QLocale::Territory::Laos},
    {"LAT"_L1, QLocale::Territory::Latvia},
    {"LBA"_L1, QLocale::Territory::Libya},
    {"LBN"_L1, QLocale::Territory::Lebanon},
    {"LBR"_L1, QLocale::Territory::Liberia},
    {"LCA"_L1, QLocale::Territory::SaintLucia},
    {"LES"_L1, QLocale::Territory::Lesotho},
    {"LIE"_L1, QLocale::Territory::Liechtenstein},
    {"LTU"_L1, QLocale::Territory::Lithuania},
    {"LUX"_L1, QLocale::Territory::Luxembourg},
    {"MAC"_L1, QLocale::Territory::Macau},
    {"MAD"_L1, QLocale::Territory::Madagascar},
    {"MAR"_L1, QLocale::Territory::Morocco},
    {"MAS"_L1, QLocale::Territory::Malaysia},
    {"MAW"_L1, QLocale::Territory::Malawi},
    {"MDA"_L1, QLocale::Territory::Moldova},
    {"MDV"_L1, QLocale::Territory::Maldives},
    {"MEX"_L1, QLocale::Territory::Mexico},
    {"MGL"_L1, QLocale::Territory::Mongolia},
    {"MHL"_L1, QLocale::Territory::MarshallIslands},
    {"MKD"_L1, QLocale::Territory::Macedonia},
    {"MLI"_L1, QLocale::Territory::Mali},
    {"MLT"_L1, QLocale::Territory::Malta},
    {"MNC"_L1, QLocale::Territory::Monaco},
    {"MNE"_L1, QLocale::Territory::Montenegro},
    {"MOZ"_L1, QLocale::Territory::Mozambique},
    {"MRI"_L1, QLocale::Territory::Mauritius},
    {"MTN"_L1, QLocale::Territory::Mauritania},
    {"MYA"_L1, QLocale::Territory::Myanmar},
    {"NAM"_L1, QLocale::Territory::Namibia},
    {"NCA"_L1, QLocale::Territory::Nicaragua},
    {"NED"_L1, QLocale::Territory::Netherlands},
    {"NEP"_L1, QLocale::Territory::Nepal},
    {"NGR"_L1, QLocale::Territory::Nigeria},
    {"NIG"_L1, QLocale::Territory::Niger},
    {"NOR"_L1, QLocale::Territory::Norway},
    {"NRU"_L1, QLocale::Territory::NauruTerritory},
    {"NZL"_L1, QLocale::Territory::NewZealand},
    {"OMA"_L1, QLocale::Territory::Oman},
    {"PAK"_L1, QLocale::Territory::Pakistan},
    {"PAN"_L1, QLocale::Territory::Panama},
    {"PAR"_L1, QLocale::Territory::Paraguay},
    {"PER"_L1, QLocale::Territory::Peru},
    {"PHI"_L1, QLocale::Territory::Philippines},
    {"PLE"_L1, QLocale::Territory::PalestinianTerritories},
    {"PLW"_L1, QLocale::Territory::Palau},
    {"PNG"_L1, QLocale::Territory::PapuaNewGuinea},
    {"POL"_L1, QLocale::Territory::Poland},
    {"POR"_L1, QLocale::Territory::Portugal},
    {"PUR"_L1, QLocale::Territory::PuertoRico},
    {"QAT"_L1, QLocale::Territory::Qatar},
    {"ROU"_L1, QLocale::Territory::Romania},
    {"RSA"_L1, QLocale::Territory::SouthAfrica},
    {"RUS"_L1, QLocale::Territory::Russia},
    {"RWA"_L1, QLocale::Territory::Rwanda},
    {"SCO"_L1, kli18nc("FIDE Federation", "Scotland")},
    {"SEN"_L1, QLocale::Territory::Senegal},
    {"SEY"_L1, QLocale::Territory::Seychelles},
    {"SGP"_L1, QLocale::Territory::Singapore},
    {"SKN"_L1, QLocale::Territory::SaintKittsAndNevis},
    {"SLE"_L1, QLocale::Territory::SierraLeone},
    {"SLO"_L1, QLocale::Territory::Slovenia},
    {"SMR"_L1, QLocale::Territory::SanMarino},
    {"SOL"_L1, QLocale::Territory::SolomonIslands},
    {"SOM"_L1, QLocale::Territory::Somalia},
    {"SRB"_L1, QLocale::Territory::Serbia},
    {"SRI"_L1, QLocale::Territory::SriLanka},
    {"SSD"_L1, QLocale::Territory::SouthSudan},
    {"STP"_L1, QLocale::Territory::SaoTomeAndPrincipe},
    {"SUD"_L1, QLocale::Territory::Sudan},
    {"SUI"_L1, QLocale::Territory::Switzerland},
    {"SUR"_L1, QLocale::Territory::Suriname},
    {"SVK"_L1, QLocale::Territory::Slovakia},
    {"SWE"_L1, QLocale::Territory::Sweden},
    {"SWZ"_L1, QLocale::Territory::Eswatini},
    {"SYR"_L1, QLocale::Territory::Syria},
    {"TAN"_L1, QLocale::Territory::Tanzania},
    {"TGA"_L1, QLocale::Territory::Tonga},
    {"THA"_L1, QLocale::Territory::Thailand},
    {"TJK"_L1, QLocale::Territory::Tajikistan},
    {"TKM"_L1, QLocale::Territory::Turkmenistan},
    {"TLS"_L1, QLocale::Territory::TimorLeste},
    {"TOG"_L1, QLocale::Territory::Togo},
    {"TPE"_L1, kli18nc("FIDE Federation", "Chinese Taipei")},
    {"TTO"_L1, QLocale::Territory::TrinidadAndTobago},
    {"TUN"_L1, QLocale::Territory::Tunisia},
    {"TUR"_L1, QLocale::Territory::Turkey},
    {"UAE"_L1, QLocale::Territory::UnitedArabEmirates},
    {"UGA"_L1, QLocale::Territory::Uganda},
    {"UKR"_L1, QLocale::Territory::Ukraine},
    {"URU"_L1, QLocale::Territory::Uruguay},
    {"USA"_L1, QLocale::Territory::UnitedStates},
    {"UZB"_L1, QLocale::Territory::Uzbekistan},
    {"VAN"_L1, QLocale::Territory::Vanuatu},
    {"VEN"_L1, QLocale::Territory::Venezuela},
    {"VIE"_L1, QLocale::Territory::Vietnam},
    {"VIN"_L1, QLocale::Territory::SaintVincentAndTheGrenadines},
    {"WLS"_L1, kli18nc("FIDE Federation", "Wales")},
    {"YEM"_L1, QLocale::Territory::Yemen},
    {"ZAM"_L1, QLocale::Territory::Zambia},
    {"ZIM"_L1, QLocale::Territory::Zimbabwe},
    // clang-format on
};
