import { ClientIds } from 'config/clients/types'

import { facr } from './facr'
import { insports } from './insports'
import { instat } from './instat'
import { lff } from './lff'
import { india } from './india'
import { tunisia } from './tunisia'

const clients = {
  [ClientIds.Facr]: facr,
  [ClientIds.Instat]: instat,
  [ClientIds.Lff]: lff,
  [ClientIds.Insports]: insports,
  [ClientIds.India]: india,
  [ClientIds.Tunisia]: tunisia,
}

const params = new URLSearchParams(window.location.search)
const clientId = params.get('client_id') as ClientIds

export const client = clients[clientId] || insports
