import type { TAndroidtvRemoteKeyCode } from './androidtv_remote.types.js';

export const androidtvRemoteApiPort = 6466;
export const androidtvRemotePairPort = 6467;
export const androidtvRemoteMdnsService = '_androidtvremote2._tcp.local.';

export const androidtvRemoteKnownApps: Record<string, string> = {
  'com.android.tv.settings': 'Settings',
  'com.disney.disneyplus': 'Disney+',
  'com.google.android.apps.tv.launcherx': 'Google TV Launcher',
  'com.google.android.tvlauncher': 'Android TV Launcher',
  'com.google.android.youtube.tv': 'YouTube',
  'com.google.android.youtube.tvkids': 'YouTube Kids',
  'com.google.android.youtube.tvmusic': 'YouTube Music',
  'com.hbo.hbonow': 'HBO Max',
  'com.hulu.plus': 'Hulu',
  'com.netflix.ninja': 'Netflix',
  'com.plexapp.android': 'Plex',
  'com.spotify.tv.android': 'Spotify',
  'org.jellyfin.androidtv': 'Jellyfin',
  'org.videolan.vlc': 'VLC',
  'org.xbmc.kodi': 'Kodi',
  'tv.twitch.android.app': 'Twitch',
};

export const androidtvRemoteKeyAliases: Record<string, TAndroidtvRemoteKeyCode> = {
  BLUE: 'PROG_BLUE',
  CENTER: 'DPAD_CENTER',
  CH_DOWN: 'CHANNEL_DOWN',
  CH_UP: 'CHANNEL_UP',
  CHANNELDOWN: 'CHANNEL_DOWN',
  CHANNELUP: 'CHANNEL_UP',
  DOWN: 'DPAD_DOWN',
  FAST_FORWARD: 'MEDIA_FAST_FORWARD',
  FORWARD: 'MEDIA_FAST_FORWARD',
  GREEN: 'PROG_GREEN',
  INFO: 'INFO',
  LEFT: 'DPAD_LEFT',
  NEXT: 'MEDIA_NEXT',
  PAUSE: 'MEDIA_PAUSE',
  PLAY: 'MEDIA_PLAY',
  PLAY_PAUSE: 'MEDIA_PLAY_PAUSE',
  PREVIOUS: 'MEDIA_PREVIOUS',
  RED: 'PROG_RED',
  REWIND: 'MEDIA_REWIND',
  RIGHT: 'DPAD_RIGHT',
  SELECT: 'DPAD_CENTER',
  STOP: 'MEDIA_STOP',
  UP: 'DPAD_UP',
  VOL_DOWN: 'VOLUME_DOWN',
  VOL_UP: 'VOLUME_UP',
  VOLUMEDOWN: 'VOLUME_DOWN',
  VOLUMEMUTE: 'VOLUME_MUTE',
  VOLUMEUP: 'VOLUME_UP',
  YELLOW: 'PROG_YELLOW',
};
