"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var InteractionInterceptor_1 = require("./InteractionInterceptor");
/**
 * It enriches the attributes of all convey interactions with a specific language
 *
 * @constructor language Code of language ISO 639-1 (format: "de","en","es"). Also locales such as en_US or en-US are allowed
 */
var LanguageInteractionInterceptor = /** @class */ (function () {
    function LanguageInteractionInterceptor(language) {
        this.language = language;
    }
    LanguageInteractionInterceptor.prototype.execute = function (interaction) {
        if (interaction["attributes"][InteractionInterceptor_1.INTERNAL_LANGUAGE] !== undefined) {
            console.log("Conversation Language already in attributes: " + interaction["attributes"][InteractionInterceptor_1.INTERNAL_LANGUAGE]);
            return interaction;
        }
        interaction["attributes"][InteractionInterceptor_1.INTERNAL_LANGUAGE] = this.language;
        return interaction;
    };
    return LanguageInteractionInterceptor;
}());
exports.LanguageInteractionInterceptor = LanguageInteractionInterceptor;
//# sourceMappingURL=LanguageInteractionInterceptor.js.map