/**
 * Copyright 2024 Phenix Real Time Solutions, Inc. Confidential and Proprietary. All Rights Reserved.
 */
const commonErrorMessages = {
  unauthorized: 'The streaming platform was not able to authorize the provided credentials',
  capacity: 'The system is temporarily overloaded. Please try again later',
  'rate-limited': 'The system is temporarily overloaded. Please try again later',
  'time-exceeded': 'The request took to long to execute. Please try again later'
};

export const reportsErrorMessages = {
  'excessive-report-interval': 'The interval for the report exceed 1 month',
  'period-start-outside-supported-window': 'The year of the start of period is more than 1 year before the current year',
  'period-end-must-be-in-past': 'The end of period is in future',
  'period-end-must-be-after-start': 'The end of period is less than or equal to the start of the period',
  'malformed-version-in-request-query-parameter': 'The supplied version in HTTP query parameter does not conform to the format "YYYY-MM-dd"',
  'version-does-not-exist': 'The supplied version in HTTP query parameter does not exist',
  unsupported: 'The parameter combination is not supported',
  unauthorized: 'The streaming platform was not able to authorize the provided credentials',
  'request-timeout': 'Request timed out likely due to temporary resource or network conditions. Please try again',
  capacity: 'The system is temporarily overloaded. Please try again later',
  default: 'Unable to generate report'
};

export const currentActivityErrorMessages = {
  'socket-not-authenticated': 'Socket not authenticated',
  'unable-to-fetch-data': 'Unable to fetch active users data. Please try again',
  'by-country-missing': 'Missing data sorted by country'
};

export const summaryErrorMessages = {
  'socket-not-authenticated': 'Socket not authenticated',
  'unable-to-fetch-data': 'Unable to fetch usage statistics data. Please try again'
};

export const timeToFirstFrameErrorMessages = {
  'socket-not-authenticated': 'Socket not authenticated',
  'unable-to-fetch-data': 'Unable to fetch time to first frame data. Please try again'
};

export const usageErrorMessages = {
  'socket-not-authenticated': 'Socket not authenticated',
  'unable-to-fetch-data': 'Unable to fetch usage statistics data. Please try again'
};

export const concurrentAndIngestErrorMessages = {
  ...reportsErrorMessages,
  'excessive-report-interval': 'The interval for the report exceed 1 day',
  default: 'Unable to fetch data for the report'
};

export const forkingHistoryErrorMessages = {
  ...reportsErrorMessages,
  'excessive-report-interval': 'The interval for the report exceed 1 day',
  'maximal-result-size-exceeded': 'The size of the result exceeds the maximum allowed (10GB)',
  'unable-to-clear-forking-history': 'Unable to clear forking history',
  'unable-to-change-forking-history-data': 'Unable to change forking history data'
};

export const publishingHistoryErrorMessages = {
  ...reportsErrorMessages,
  'excessive-report-interval': 'The interval for the report exceed 1 year',
  'maximal-result-size-exceeded': 'The size of the result exceeds the maximum allowed (10GB)',
  'unable-to-clear-publishing-history': 'Unable to clear publishing history',
  'unable-to-change-publishing-history-data': 'Unable to change publishing history data'
};

export const messagesPageErrorMessages = {
  ...commonErrorMessages,
  'not-found': 'The channel does not exist',
  default: 'Unable to fetch messages'
};

export const channelListErrorMessages = {
  ...commonErrorMessages,
  default: 'Unable to fetch channels list'
};

export const channelListPublishingStateErrorMessages = {
  ...commonErrorMessages,
  'not-found': 'The channel was not found',
  default: 'Unable to fetch publishing state'
};

export const roomsListErrorMessages = {
  ...commonErrorMessages,
  default: 'Unable to fetch rooms list'
};

export const roomsListPublishingStateErrorMessages = {
  ...commonErrorMessages,
  'not-found': 'The room was not found',
  default: 'Unable to fetch publishing state'
};

export const forkChannelErrorMessages = {
  ...commonErrorMessages,
  'not-found': 'One or both of the source and destination channels are not found',
  default: 'Unable to fork a channel'
};

export const deleteChannelErrorMessages = {
  ...commonErrorMessages,
  default: 'Unable to delete a channel'
};

export const deleteRoomErrorMessages = {
  ...commonErrorMessages,
  default: 'Unable to delete a room'
};

export const createChannelErrorMessages = {
  ...commonErrorMessages,
  'already-exists': 'The channel already exists',
  'type-conflict': 'A room with the provided alias already exists',
  default: 'Unable to create a channel'
};

export const createRoomErrorMessages = {
  ...commonErrorMessages,
  'already-exists': 'The room already exists',
  'type-conflict': 'A channel with the provided alias already exists',
  default: 'Unable to create a room'
};

export const killChannelErrorMessages = {
  ...commonErrorMessages,
  'not-found': 'The channel was not found',
  default: 'Unable to kill a channel'
};

export const tokenErrorMessages = {
  ...commonErrorMessages,
  default: 'Unable to generate a token'
};

export const playlistErrorMessages = {
  ...commonErrorMessages,
  default: 'Unable to fetch playlist data'
};

export const channelDetailsErrorMessages = {
  ...commonErrorMessages,
  'not-found': 'The channel does not exist',
  default: 'Unable to fetch channel details'
};

export const channelStreamsErrorMessages = {
  ...commonErrorMessages,
  'not found': 'The channel was not found',
  default: 'Unable to fetch streams for this channel'
};

export const roomDetailsErrorMessages = {
  ...commonErrorMessages,
  'not-found': 'The room does not exist',
  default: 'Unable to fetch room details'
};

export const roomMembersErrorMessages = {
  ...commonErrorMessages,
  'not-found': 'The room was not found',
  default: 'Unable to fetch members for this room'
};

export const publishPullErrorMessages = {
  ...commonErrorMessages,
  default: 'Unable to publish with uri'
};

export const qosErrorMessages = {
  ...reportsErrorMessages,
  ...commonErrorMessages,
  'excessive-report-interval': 'The interval for the report exceed 1 day',
  unsupported: 'The parameter combination is not supported',
  'request-timeout': 'Request timed out likely due to temporary resource or network conditions. Please try again',
  capacity: 'The system is temporarily overloaded. Please try again later'
};
