import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { addHintTranslations } from '@translations/add-hint-translations';
import { redactTextTranslations } from '@translations/redact-text-translations';
import { removeRedactionTranslations } from '@translations/remove-redaction-translations';
import {
    ForceAnnotationOptions,
    RectangleRedactOptions,
    RedactOrHintOptions,
    RemoveRedactionOptions,
} from '../../file-preview/utils/dialog-types';

export const SystemDefaults = {
    RECTANGLE_REDACT_DEFAULT: RectangleRedactOptions.ONLY_THIS_PAGE,
    ADD_REDACTION_DEFAULT: RedactOrHintOptions.IN_DOSSIER,
    ADD_HINT_DEFAULT: RedactOrHintOptions.IN_DOSSIER,
    FORCE_REDACTION_DEFAULT: ForceAnnotationOptions.ONLY_HERE,
    REMOVE_REDACTION_DEFAULT: RemoveRedactionOptions.ONLY_HERE,
    REMOVE_HINT_DEFAULT: RemoveRedactionOptions.ONLY_HERE,
    REMOVE_RECOMMENDATION_DEFAULT: RemoveRedactionOptions.DO_NOT_RECOMMEND,
} as const;

export const SystemDefaultOption = {
    SYSTEM_DEFAULT: 'SYSTEM_DEFAULT',
    label: _('dialog-defaults-form.system-default'),
} as const;

export type SystemDefaultType = typeof SystemDefaultOption.SYSTEM_DEFAULT;

export const redactionAddOptions = [
    {
        label: SystemDefaultOption.label,
        value: SystemDefaultOption.SYSTEM_DEFAULT,
    },
    {
        label: redactTextTranslations.onlyHere.label,
        value: RedactOrHintOptions.ONLY_HERE,
    },
    {
        label: redactTextTranslations.inDocument.label,
        value: RedactOrHintOptions.IN_DOCUMENT,
    },
    {
        label: redactTextTranslations.inDossier.label,
        value: RedactOrHintOptions.IN_DOSSIER,
    },
];

export const hintAddOptions = [
    {
        label: SystemDefaultOption.label,
        value: SystemDefaultOption.SYSTEM_DEFAULT,
    },
    {
        label: addHintTranslations.onlyHere.label,
        value: RedactOrHintOptions.ONLY_HERE,
    },
    {
        label: addHintTranslations.inDossier.label,
        value: RedactOrHintOptions.IN_DOSSIER,
    },
];

export const removeOptions = [
    {
        label: SystemDefaultOption.label,
        value: SystemDefaultOption.SYSTEM_DEFAULT,
    },
    {
        label: removeRedactionTranslations.ONLY_HERE.label,
        value: RemoveRedactionOptions.ONLY_HERE,
    },
    {
        label: removeRedactionTranslations.IN_DOSSIER.label,
        value: RemoveRedactionOptions.IN_DOSSIER,
    },
];

export const redactionRemoveOptions = [
    ...removeOptions,
    {
        label: removeRedactionTranslations.FALSE_POSITIVE.label,
        value: RemoveRedactionOptions.FALSE_POSITIVE,
    },
];

export const recommendationRemoveOptions = [
    {
        label: SystemDefaultOption.label,
        value: SystemDefaultOption.SYSTEM_DEFAULT,
    },
    {
        label: removeRedactionTranslations.DO_NOT_RECOMMEND.label,
        value: RemoveRedactionOptions.DO_NOT_RECOMMEND,
    },
];
