"use strict";

exports.__esModule = true;
exports.getTagsReachedLimitErrorMessage = exports.createTagErrors = void 0;
const createTagErrors = ({
  translate: t,
  visualType = 'toast',
  retryFn,
  excessCount = 1,
  limit
}) => {
  return {
    FQDN_NOT_FOUND: () => ({
      message: visualType === 'toast' ? t('cairo.tags.fqdn-not-found.error') : t('cairo.tags.fqdn-not-found.manageTagsModal.error'),
      action: {
        text: t('cairo.error.contactSupport.cta'),
        onClick: () => {
          // TODO: contact support
        }
      }
    }),
    TAG_NAME_ALREADY_EXISTS: () => ({
      message: t('cairo.tags.manageTags.modal.list.input.validation.exists')
    }),
    TAGS_REACHED_LIMIT: () => ({
      message: getTagsReachedLimitErrorMessage({
        visualType,
        translate: t,
        excessCount,
        limit
      })
    }),
    CREATE_ID_EXHAUSTED_RETRY_ATTEMPTS: () => ({
      message: visualType === 'toast' ? t('cairo.tags.collectionPage.toast.create.error') : t('cairo.tags.manageTags.modal.toast.create.error'),
      action: {
        text: t('cairo.error.tryAgain.cta'),
        onClick: retryFn
      }
    }),
    EXPOSURE_NOT_SUPPORTED: false
  };
};
exports.createTagErrors = createTagErrors;
const getTagsReachedLimitErrorMessage = ({
  visualType,
  translate: t,
  excessCount,
  limit
}) => visualType === 'toast' ? t('cairo.tags.popover.creationLimitReached.error', {
  count: excessCount,
  limit
}) : t('cairo.tags.creationLimitReached.error', {
  count: excessCount,
  limit
});
exports.getTagsReachedLimitErrorMessage = getTagsReachedLimitErrorMessage;
//# sourceMappingURL=createTagErrors.js.map