<script>
(function() {
var searchLink = document.querySelector('.p-navgroup-link--search');
if (!searchLink) return;
var btn = document.createElement('a');
btn.href = 'javascript:void(0)';
btn.className = 'p-navgroup-link p-navgroup-link--iconic p-navgroup-link--snow';
btn.setAttribute('role', 'button');
btn.title = 'Toggle snow';
searchLink.insertAdjacentElement('afterend', btn);
var scriptId = 'snow-script';
var key = 'snowEnabled';
function update(on) {
btn.classList.toggle('is-active', on);
document.body.dataset.snow = on ? 'on' : 'off';
}
function enable() {
if (!document.getElementById(scriptId)) {
var s = document.createElement('script');
s.src = 'https://app.embed.im/snow.js';
s.id = scriptId;
s.defer = true;
document.body.appendChild(s);
}
localStorage.setItem(key, '1');
update(true);
}
function disable() {
var s = document.getElementById(scriptId);
var c = document.getElementById('embedim--snow');
if (s) s.remove();
if (c) c.remove();
localStorage.setItem(key, '0');
update(false);
}
localStorage.getItem(key) === '1' ? enable() : update(false);
btn.onclick = function() {
localStorage.getItem(key) === '1' ? disable() : enable();
};
})();
</script>
$0