/**
 * Copyright 2024 Phenix Real Time Solutions, Inc. Confidential and Proprietary. All Rights Reserved.
 */
import {IAdvancedSelectItem} from 'components/ui/advanced-select';

export enum VideoQuality {
  Xhd = 'xhd',
  Fhd = 'fhd',
  Hd = 'hd',
  Sd = 'sd',
  Ld = 'ld',
  Vld = 'vld',
  Uld = 'uld',
  AudioOnly = 'audio-only'
}

export enum CapabilitiesSet {
  TrackIsolation = 'track-isolation',
  AspectRatio = 'aspect-ratio',
  ResolutionLimit = 'resolution-limit',
  EncodingJitterBuffer = 'encoding-jitter-buffer',
  EncodingProfile = 'encoding-profile',
  PlayoutBuffer = 'playout-buffer',
  Ingest = 'ingest',
  MultiBitrateMode = 'multi-bitrate-mode',
  Quality = 'quality'
}

export enum CapabilitiesType {
  RemoteUriPublishing = 'remote-uri-publishing',
  Publishing = 'publishing',
  Viewing = 'viewing',
  Forking = 'forking',
  Quality = 'quality'
}

export const capabilities: IAdvancedSelectItem[] = [
  {
    value: VideoQuality.Xhd,
    type: [CapabilitiesType.Quality],
    set: [CapabilitiesSet.Quality]
  },
  {
    value: VideoQuality.Fhd,
    type: [CapabilitiesType.Quality],
    set: [CapabilitiesSet.Quality]
  },
  {
    value: VideoQuality.Hd,
    type: [CapabilitiesType.Quality],
    set: [CapabilitiesSet.Quality]
  },
  {
    value: VideoQuality.Sd,
    type: [CapabilitiesType.Quality],
    set: [CapabilitiesSet.Quality]
  },
  {
    value: VideoQuality.Ld,
    type: [CapabilitiesType.Quality],
    set: [CapabilitiesSet.Quality]
  },
  {
    value: VideoQuality.Vld,
    type: [CapabilitiesType.Quality],
    set: [CapabilitiesSet.Quality]
  },
  {
    value: VideoQuality.Uld,
    type: [CapabilitiesType.Quality],
    set: [CapabilitiesSet.Quality]
  },
  {
    value: 'prefer-vp8',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking]
  },
  {
    value: 'prefer-vp9',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking]
  },
  {
    value: 'prefer-h264',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking]
  },
  {
    value: 'streaming',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Viewing, CapabilitiesType.Forking]
  },
  {
    value: 'on-demand',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Viewing, CapabilitiesType.Forking]
  },
  {
    value: 'streaming-lite',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking],
    dependency: ['streaming']
  },
  {
    value: 'on-demand-lite',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking],
    dependency: ['on-demand']
  },
  {
    value: 'multi-bitrate',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking],
    set: [CapabilitiesSet.MultiBitrateMode]
  },
  {
    value: 'multi-bitrate-contribution',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking],
    set: [CapabilitiesSet.MultiBitrateMode]
  },
  {
    value: 'multi-bitrate-codec=vp8',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking]
  },
  {
    value: 'multi-bitrate-codec=vp9',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking]
  },
  {
    value: 'multi-bitrate-codec=h264',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking]
  },
  {
    value: 'aspect-ratio=16x9',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking],
    dependency: ['multi-bitrate'],
    set: [CapabilitiesSet.AspectRatio]
  },
  {
    value: 'aspect-ratio=4x3',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking],
    dependency: ['multi-bitrate'],
    set: [CapabilitiesSet.AspectRatio]
  },
  {
    value: 'aspect-ratio=9x16',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking],
    dependency: ['multi-bitrate'],
    set: [CapabilitiesSet.AspectRatio]
  },
  {
    value: 'aspect-ratio=3x4',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking],
    dependency: ['multi-bitrate'],
    set: [CapabilitiesSet.AspectRatio]
  },
  {
    value: 'resolution-limit=480',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing],
    set: [CapabilitiesSet.ResolutionLimit]
  },
  {
    value: 'resolution-limit=720',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing],
    set: [CapabilitiesSet.ResolutionLimit]
  },
  {
    value: 'bitrate-limit=1000000',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking]
  },
  {
    value: 'encoding-jitter-buffer=PT0.5S',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking],
    set: [CapabilitiesSet.EncodingJitterBuffer]
  },
  {
    value: 'encoding-jitter-buffer=PT1.0S',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking],
    set: [CapabilitiesSet.EncodingJitterBuffer]
  },
  {
    value: 'encoding-jitter-buffer=PT2.0S',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking],
    set: [CapabilitiesSet.EncodingJitterBuffer]
  },
  {
    value: 'encoding-profile=phenix-2020-1080p',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking],
    dependency: ['multi-bitrate', 'multi-bitrate-contribution'],
    set: [CapabilitiesSet.EncodingProfile]
  },
  {
    value: 'encoding-profile=phenix-2020-720p',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking],
    dependency: ['multi-bitrate', 'multi-bitrate-contribution'],
    set: [CapabilitiesSet.EncodingProfile]
  },
  {
    value: 'encoding-profile=phenix-2020-480p',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking],
    dependency: ['multi-bitrate', 'multi-bitrate-contribution'],
    set: [CapabilitiesSet.EncodingProfile]
  },
  {
    value: 'playout-buffer=PT0.3S',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking],
    set: [CapabilitiesSet.PlayoutBuffer]
  },
  {
    value: 'playout-buffer=PT0.5S',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking],
    set: [CapabilitiesSet.PlayoutBuffer]
  },
  {
    value: 'playout-buffer=PT0.8S',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking],
    set: [CapabilitiesSet.PlayoutBuffer]
  },
  {
    value: 'playout-buffer=PT1.0S',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking],
    set: [CapabilitiesSet.PlayoutBuffer]
  },
  {
    value: 'playout-buffer=PT2.0S',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking],
    set: [CapabilitiesSet.PlayoutBuffer]
  },
  {
    value: 'audio-only',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Viewing, CapabilitiesType.Forking, CapabilitiesType.Quality],
    set: [CapabilitiesSet.TrackIsolation, CapabilitiesSet.Quality]
  },
  {
    value: 'video-only',
    type: [CapabilitiesType.Viewing, CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking],
    set: [CapabilitiesSet.TrackIsolation]
  },
  {
    value: 'high-fidelity',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking]
  },
  {
    value: 'on-demand-archive=PT1D',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing, CapabilitiesType.Forking],
    dependency: ['on-demand']
  },
  {
    value: 'token-auth',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing],
    dependency: ['streaming']
  },
  {
    value: 'source-uri-ingest',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing],
    set: [CapabilitiesSet.Ingest]
  },
  {
    value: 'mpegts-unicast-ingest',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing],
    set: [CapabilitiesSet.Ingest]
  },
  {
    value: 'mpegts-multicast-ingest',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing],
    set: [CapabilitiesSet.Ingest]
  },
  {
    value: 'time-shift-manifest',
    type: [CapabilitiesType.RemoteUriPublishing, CapabilitiesType.Publishing]
  },
  {
    value: 'replay',
    type: [CapabilitiesType.Viewing]
  }
];
