(function(){ function esc(s){return String(s==null?'':s).replace(/[&<>"']/g,function(c){return{'&':'&','<':'<','>':'>','"':'"',"'":'''}[c];});} function injectStyle(){ if (document.getElementById('hsAlertStyle')) return; var s = document.createElement('style'); s.id = 'hsAlertStyle'; s.textContent = '#hsAlertArea { background:#3d1f00; border:1px solid #f0b90b; border-radius:6px; padding:4px 10px; margin:6px auto; max-width:1100px; box-sizing:border-box; } #hsAlertArea .hs-alert-item { display:flex; justify-content:space-between; align-items:center; color:#f0b90b; font-size:13px; padding:2px 0; line-height:1.2; } #hsAlertArea .hs-alert-item .hs-time { color:#8b949e; font-size:11px; margin-left:8px; } #hsAlertArea .hs-dismiss { background:transparent; border:1px solid #f0b90b; color:#f0b90b; border-radius:4px; width:20px; height:20px; cursor:pointer; font-size:11px; line-height:1; padding:0; } #hsAlertArea .hs-dismiss:hover { background:#f0b90b; color:#0b0e11; }'; document.head.appendChild(s); } function findAnchor(){ var sels = ['#market-panel','.market-panel','[id*="market-panel"]','[class*="market-panel"]','.cards-row','#marketData','.market-data-panel','[class*="market-data"]']; for (var i=0;i\uD83D\uDEA8 '+s+' scored '+sc+' ('+m+')'+tm+''; }).join(''); el.querySelectorAll('.hs-dismiss').forEach(function(b){ b.onclick = function(){ fetch('/api/alerts/dismiss',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({symbol:b.dataset.sym})}).then(function(){poll();}); }; }); }).catch(function(){}); } if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', poll); else poll(); setInterval(poll, 60000); })();