import * as constants from './constants';
import { isAutomationTestActive } from './testAutomation';
var config = {};
var initialized = false;
function setConfig(conf) {
    config = conf; // IMPORTANT - config should be link to RC.Config, do not clone conf object!!!
    if (!initialized) {
        initialized = Object.keys(config).length > 0;
    }
}
function getConfig() {
    if (!initialized) {
        var message_1 = 'getConfig used earlier than setConfig';
        if (isAutomationTestActive()) {
            setTimeout(function () { return alert(message_1); });
        }
        throw new Error(message_1);
    }
    return config;
}
export function isConfigInitialized() {
    return initialized;
}
function testConfig(config) {
    setConfig(Object.assign({
        brandId: constants.defaultBrandId,
        userLanguage: constants.defaultUserLanguage,
        brandDisplayName: constants.defaultBrandDisplayName,
        shortBrandName: constants.defaultShortBrandName
    }, config || {}));
}
export { setConfig, getConfig, testConfig };
//# sourceMappingURL=config.js.map