import { setPlatformHelpers } from "@stencil/core/internal";
import { balToastController } from "./components/bal-toast/bal-toast.controller";
import { balSnackbarController } from "./components/bal-snackbar/bal-snackbar.controller";
import { setupConfig } from "./utils/config";
import { VERSION } from "./utils/constants/version.constant";
import { balBrowser } from "./utils/browser";
export const initializeBaloiseDesignSystem = (userConfig = {}, platformConfig = undefined, win = {}) => {
    if (Object.keys(win).length === 0 && balBrowser.hasWindow) {
        win = window;
    }
    win.BaloiseDesignSystem = win.BaloiseDesignSystem || {};
    if (platformConfig) {
        setPlatformHelpers(platformConfig);
    }
    setupConfig(Object.assign(Object.assign({}, userConfig), platformConfig), win);
    win.BaloiseDesignSystem.toastController = balToastController;
    win.BaloiseDesignSystem.snackbarController = balSnackbarController;
    win.BaloiseDesignSystem.initialize = () => setupConfig(win.BaloiseDesignSystem.config, win);
    win.BaloiseDesignSystem.version = VERSION;
};
