import { HTMLLanguageElementProvider } from "./HTMLLanguageElementProvider";
import { BrowserLanguageProvider } from "./BrowserLanguageProvider";
import { LanguageEnvVariableProvider } from "./LanguageEnvVariableProvider";
/**
 * Contains language providers which are processed in the defined order.
 */
var ConversationLanguageResolver = /** @class */ (function () {
    function ConversationLanguageResolver() {
        this.LANGUAGE_PROVIDERS = [
            new LanguageEnvVariableProvider(),
            new HTMLLanguageElementProvider(),
            new BrowserLanguageProvider()
        ];
    }
    /**
     * It goes through all language providers to extract the conversation language
     */
    ConversationLanguageResolver.prototype.get = function () {
        var conversationLanguage = this.LANGUAGE_PROVIDERS.map(function (e) { return e.get(); }).find(function (l) { return l !== undefined; });
        if (conversationLanguage === undefined) {
            console.error("No language was configured for the conversation");
        }
        return conversationLanguage;
    };
    return ConversationLanguageResolver;
}());
export { ConversationLanguageResolver };
//# sourceMappingURL=ConversationLanguageResolver.js.map