UNPKG

@larva.io/webcomponents

Version:

Fentrica SmartUnits WebComponents package

42 lines (36 loc) 1.68 kB
/*! * (C) Fentrica http://fentrica.com - Seee LICENSE.md */ import { c as configFromSession, a as configFromURL, b as config, s as saveConfig } from './p-Bt4QT_oL.js'; export { g as getAssetPath, r as render, s as setAssetPath, a as setNonce, b as setPlatformOptions } from './p-AOwgnAK2.js'; export { i as i18n } from './p-Cga1x4Z-.js'; export { a as addCachedAssets, g as getAssetsCacheMap } from './p-BA46Bz7S.js'; export { I as ICONS, c as addIcons, g as getAllIconNames, a as getIcon, b as getIconMap } from './p-PgdWkWmb.js'; function appGlobalScript () { const win = typeof window !== 'undefined' ? window : {}; const Larva = (win.Larva = win.Larva || {}); // create the Larva.config from raw config object (if it exists) // and convert Larva.config into a ConfigApi that has a get() fn const configObj = Object.assign(Object.assign(Object.assign(Object.assign({}, configFromSession(win)), { persistConfig: false }), Larva.config), configFromURL(win)); config.reset(configObj); if (config.getBoolean('persistConfig')) { saveConfig(win, configObj); } Larva.config = config; } const globalScripts = appGlobalScript; const setupConfig = (config) => { const win = window; const Larva = win.Larva; if (Larva && Larva.config && Larva.config.constructor.name !== 'Object') { console.error('Larva config was already initialized'); return; } win.Larva = win.Larva || {}; win.Larva.config = Object.assign(Object.assign({}, win.Larva.config), config); return win.Larva.config; }; globalScripts(); export { setupConfig }; //# sourceMappingURL=index.js.map //# sourceMappingURL=index.js.map