import { css } from 'styled-components/macro'

import { PROCEDURES } from '../procedures'

import {
  ClientConfig,
  ClientIds,
  ClientNames,
} from './types'

const randomHash = () => (
  (Math.random() ** Math.random()) * 9999999999999999
)

const params = {
  _p_version: 'facrtv',
}

export const facr: ClientConfig = {
  auth: {
    clientId: ClientIds.Facr,
    metaDataUrlParams: `?hash=${randomHash()}`,
  },
  defaultLanguage: 'cs',
  description: 'Live sports streaming platform. All matches playing under the auspices of Czech Republic FA. Access to full matches, various player playlists, and highlights. Free access in the Czech Republic. Available across all devices',
  disabledPreferences: true,
  name: ClientNames.Facr,
  privacyLink: '/clients/facr/terms-and-conditions.html',
  requests: {
    [PROCEDURES.get_matches]: params,
    [PROCEDURES.get_team_matches]: params,
    [PROCEDURES.get_player_matches]: params,
    [PROCEDURES.get_tournament_matches]: params,
  },
  showSearch: false,
  styles: {
    background: '',
    homePageHeader: css`
      background: linear-gradient(
      45.42deg,
      #00257A 51.04%,
      #000000 80.83%),
      #000000;
    `,
    logo: 'facr-logo.svg',
    logoHeight: 4.76,
    logoLeft: 1.17,
    logoTop: 1.74,
    logoWidth: 6.22,
    matchLogoHeight: 2.6,
    matchLogoTopMargin: 0.9,
    matchLogoWidth: 3.4,
  },
  title: 'FACR.TV - The home of Czech football streaming',
}
