import spacetime from 'spacetime'

const america = 'America/'
const asia = 'Asia/'
const europe = 'Europe/'
const africa = 'Africa/'
const aus = 'Australia/'
const pac = 'Pacific/'

const informal = {
  //europe
  'british summer time': europe + 'London',
  bst: europe + 'London',
  'british time': europe + 'London',
  'britain time': europe + 'London',
  'irish summer time': europe + 'Dublin',
  'irish time': europe + 'Dublin',
  'central european time': europe + 'Berlin',
  cet: europe + 'Berlin',
  'central european summer time': europe + 'Berlin',
  cest: europe + 'Berlin',
  'central europe': europe + 'Berlin',
  'eastern european time': europe + 'Riga',
  eet: europe + 'Riga',
  'eastern european summer time': europe + 'Riga',
  eest: europe + 'Riga',
  'eastern europe time': europe + 'Riga',
  'western european time': europe + 'Lisbon',
  'western european summer time': europe + 'Lisbon',
  'turkey standard time': europe + 'Istanbul',
  'turkish time': europe + 'Istanbul',

  utc: africa + 'Freetown',
  'greenwich standard time': africa + 'Freetown',
  gmt: africa + 'Freetown',

  //africa
  'east africa time': africa + 'Nairobi',
  'east african time': africa + 'Nairobi',
  'eastern africa time': africa + 'Nairobi',
  'central africa time': africa + 'Khartoum',
  'central african time': africa + 'Khartoum',
  'south africa standard time': africa + 'Johannesburg',
  'west africa standard time': africa + 'Lagos',
  'western africa time': africa + 'Lagos',
  'west african time': africa + 'Lagos',

  // australia
  'australian central standard time': aus + 'Adelaide',
  acst: aus + 'Adelaide',
  'australian central daylight time': aus + 'Adelaide',
  acdt: aus + 'Adelaide',
  'australian eastern standard time': aus + 'Brisbane',
  aest: aus + 'Brisbane',
  'australian eastern daylight time': aus + 'Brisbane',
  aedt: aus + 'Brisbane',
  'australian western standard time': aus + 'Perth',
  awst: aus + 'Perth',
  'australian western daylight time': aus + 'Perth',
  awdt: aus + 'Perth',
  'australian central western standard time': aus + 'Eucla',
  acwst: aus + 'Eucla',
  'lord howe standard time': aus + 'Lord_Howe',
  lhst: aus + 'Lord_Howe',
  'lord howe daylight time': aus + 'Lord_Howe',
  lhdt: aus + 'Lord_Howe',
  'russian standard time': europe + 'Moscow',
  msk: europe + 'Moscow',

  //america
  'central standard time': america + 'Chicago',
  'central time': america + 'Chicago',
  cst: america + 'Havana',
  'central daylight time': america + 'Chicago',
  cdt: america + 'Havana',
  'mountain standard time': america + 'Denver',
  'mountain time': america + 'Denver',
  mst: america + 'Denver',
  'mountain daylight time': america + 'Denver',
  mdt: america + 'Denver',
  'atlantic standard time': america + 'Halifax',
  'atlantic time': america + 'Halifax',
  ast: asia + 'Baghdad',
  'atlantic daylight time': america + 'Halifax',
  adt: america + 'Halifax',
  'eastern standard time': america + 'New_York',
  'eastern time': america + 'New_York',
  est: america + 'New_York',
  'eastern daylight time': america + 'New_York',
  edt: america + 'New_York',
  'pacific time': america + 'Los_Angeles',
  'pacific standard time': america + 'Los_Angeles',
  pst: america + 'Los_Angeles',
  'pacific daylight time': america + 'Los_Angeles',
  pdt: america + 'Los_Angeles',
  'alaskan standard time': america + 'Anchorage',
  'alaskan time': america + 'Anchorage',
  ahst: america + 'Anchorage',
  'alaskan daylight time': america + 'Anchorage',
  ahdt: america + 'Anchorage',
  'hawaiian standard time': pac + 'Honolulu',
  'hawaiian time': pac + 'Honolulu',
  hst: pac + 'Honolulu',
  'aleutian time': pac + 'Honolulu',
  'hawaii time': pac + 'Honolulu',
  'newfoundland standard time': america + 'St_Johns',
  'newfoundland time': america + 'St_Johns',
  'newfoundland daylight time': america + 'St_Johns',
  'brazil time': america + 'Sao_Paulo',
  'brazilian time': america + 'Sao_Paulo',
  'argentina time': america + 'Buenos_Aires',
  'argentinian time': america + 'Buenos_Aires',
  'amazon time': america + 'Manaus',
  'amazonian time': america + 'Manaus',
  'easter island standard time': 'Chile/Easterisland',
  'easter island summer time': 'Chile/Easterisland',
  easst: 'Chile/Easterisland',
  'venezuelan standard time': america + 'Caracas',
  'venezuelan time': america + 'Caracas',
  'venezuela time': america + 'Caracas',
  'paraguay time': america + 'Asuncion',
  'paraguay summer time': america + 'Asuncion',
  'cuba standard time': america + 'Havana',
  'cuba time': america + 'Havana',
  'cuba daylight time': america + 'Havana',
  'cuban time': america + 'Havana',
  'bolivia time': america + 'La_Paz',
  'bolivian time': america + 'La_Paz',
  'colombia time': america + 'Bogota',
  'colombian time': america + 'Bogota',
  'acre time': america + 'Eirunepe',
  'peru time': america + 'Lima',
  'chile standard time': america + 'Punta_Arenas',
  'chile time': america + 'Punta_Arenas',
  clst: america + 'Punta_Arenas',
  'chile summer time': america + 'Punta_Arenas',
  cldt: america + 'Punta_Arenas',
  'uruguay time': america + 'Montevideo',
  uyt: america + 'Montevideo',

  //asia
  'arabic standard time': asia + 'Baghdad',
  'iran standard time': asia + 'Tehran',
  'iran time': asia + 'Tehran',
  'iran daylight time': asia + 'Tehran',
  'pakistan standard time': asia + 'Karachi',
  'pakistan time': asia + 'Karachi',
  'india standard time': asia + 'Kolkata',
  'indian time': asia + 'Kolkata',
  'indochina time': asia + 'Bangkok',
  'china standard time': asia + 'Shanghai',
  'alma-ata time': asia + 'Almaty',
  'oral time': asia + 'Oral',
  'orat time': asia + 'Oral',
  'yakutsk time': asia + 'Yakutsk',
  yakt: asia + 'Yakutsk',
  'gulf standard time': asia + 'Dubai',
  'gulf time': asia + 'Dubai',
  'hong kong time': asia + 'Hong_Kong',
  'western indonesian time': asia + 'Jakarta',
  'indonesia time': asia + 'Jakarta',
  'central indonesian time': asia + 'Makassar',
  'israel daylight time': asia + 'Jerusalem',
  'israel standard time': asia + 'Jerusalem',
  'israel time': asia + 'Jerusalem',
  'krasnoyarsk time': asia + 'Krasnoyarsk',
  'malaysia time': asia + 'Kuala_Lumpur',
  'singapore time': asia + 'Singapore',
  'korea standard time': asia + 'Seoul',
  'korea time': asia + 'Seoul',
  kst: asia + 'Seoul',
  'korean time': asia + 'Seoul',
  'uzbekistan time': asia + 'Samarkand',
  'vladivostok time': asia + 'Vladivostok',

  //indian
  'maldives time': 'Indian/Maldives',
  'mauritius time': 'Indian/Mauritius',

  'marshall islands time': pac + 'Kwajalein',
  'samoa standard time': pac + 'Midway',
  'somoan time': pac + 'Midway',
  'chamorro standard time': pac + 'Guam',
  'papua new guinea time': pac + 'Bougainville',
}

//add the official iana zonefile names
let iana = spacetime().timezones
let formal = Object.keys(iana).reduce((h, k) => {
  h[k] = k
  return h
}, {})
export default Object.assign({}, informal, formal)
