import { CONTENT_URL_ACCEPTABLE_USE_POLICY, CONTENT_URL_AI_TROUBLESHOOTING } from '../constants';
import { messages } from '../messages';
export const getIsAISummaryEnabled = (isAdminHubAIEnabled = false, response) => {
  var _response$meta, _response$meta$suppor;
  return Boolean(isAdminHubAIEnabled && (response === null || response === void 0 ? void 0 : (_response$meta = response.meta) === null || _response$meta === void 0 ? void 0 : (_response$meta$suppor = _response$meta.supportedFeature) === null || _response$meta$suppor === void 0 ? void 0 : _response$meta$suppor.includes('AISummary')));
};
export const getAISummaryErrorMessage = error => {
  switch (error) {
    case 'ACCEPTABLE_USE_VIOLATIONS':
      return {
        message: messages.ai_summary_error_acceptable_use_violation,
        url: CONTENT_URL_ACCEPTABLE_USE_POLICY
      };
    case 'HIPAA_CONTENT_DETECTED':
      return {
        message: messages.ai_summary_error_hipaa_content_detected
      };
    case 'EXCEEDING_CONTEXT_LENGTH_ERROR':
      return {
        message: messages.ai_summary_error_exceeding_context_length_error
      };
    default:
      return {
        message: messages.ai_summary_error_generic_rebrand,
        url: CONTENT_URL_AI_TROUBLESHOOTING
      };
  }
};