`).trim() } window.addEventListener('OBMIFY_WIDGET_IS_READY', () => onStateUpdated()) window.addEventListener('OBMIFY_WIDGET_CONFIG_CHANGED', () => onStateUpdated()) const link = document.createElement('link') link.rel = 'stylesheet' link.href = 'https://widget.obmify.com/obmify-widget.css' document.head.appendChild(link) const code = getWidgetEmbedCode('uk', 'white', null) const script = document.createElement('script') script.text = code document.head.appendChild(script) document.addEventListener('DOMContentLoaded', () => { document.querySelectorAll('.lang-btn').forEach(btn => { btn.addEventListener('click', () => OBMIFY_CONFIG.LANG = btn.innerText) }) document.querySelectorAll('.theme-btn').forEach(btn => { btn.addEventListener('click', () => OBMIFY_CONFIG.COLOR_THEME = btn.innerText) }) document.querySelector('.input-refcode').addEventListener('input', (e) => { OBMIFY_CONFIG.REF_CODE = e.target.value }) document.querySelector('.input-categories-visible').addEventListener('change', (e) => { OBMIFY_CONFIG.IS_CATEGORIES_VISIBLE = e.target.checked; }); })