/* OK ITHAKI V249467 - FINAL BIL / NO ATHENA / NOTIFICATION LANGUAGE GUARD */
(function(){
'use strict';if(window.__ITHAKI_V249475_OWNS_BIL__)return;
if(window.__ITHAKI_V249467_FINAL_GUARD__)return;
window.__ITHAKI_V249467_FINAL_GUARD__={version:'V249467',installedAt:Date.now()};
var B='ithBilGreenTurtleV249461',M='ithBilMenuV249461',legacy=/Αθην(?:ά|α)|Athena|Athina|Bil|Bil|Sokrataki|Socrates companion/i;
var observer,timer;
function eng(){try{return String(localStorage.getItem('ith_ui_lang_v249141')||localStorage.getItem('ith_ui_lang')||document.documentElement.lang||'el').toLowerCase().indexOf('en')===0}catch(e){return false}}
function tr(el,en){return eng()?en:el}
function addCss(){if(document.getElementById('ithV249467FinalCss'))return;var s=document.createElement('style');s.id='ithV249467FinalCss';s.textContent=`
[id*="athina" i],[id*="athena" i],[class*="athina" i],[class*="athena" i],#ithAthena378,#ithSocrates378,#socratakiFabV249252,#socratakiPanelV249252,#ithCompanionBubble378,#notifyCompanionIntroV249258{display:none!important;visibility:hidden!important;opacity:0!important;pointer-events:none!important}
#${B}{position:fixed!important;left:max(10px,env(safe-area-inset-left))!important;bottom:calc(var(--bar,68px) + 34px + env(safe-area-inset-bottom))!important;z-index:2147483000!important;width:64px!important;height:64px!important;padding:0!important;border:0!important;outline:0!important;background:transparent!important;box-shadow:none!important;display:grid!important;place-items:center!important;overflow:visible!important}
#${B} .bilFace467{position:relative;width:54px;height:48px;display:block;animation:bilBob467 3.2s ease-in-out infinite;transform-origin:50% 90%}#${B} .bilShell467{position:absolute;left:8px;top:19px;width:38px;height:27px;border-radius:50% 50% 42% 42%;background:radial-gradient(circle at 42% 27%,#f5dd79 0 18%,#5db982 19% 54%,#22674f 55% 100%);border:2px solid rgba(255,255,255,.55);box-shadow:0 8px 18px rgba(0,0,0,.28)}#${B} .bilHead467{position:absolute;left:18px;top:0;width:26px;height:25px;border-radius:50%;background:#7bd59b;border:2px solid rgba(255,255,255,.55);animation:bilHead467 4s ease-in-out infinite;transform-origin:50% 110%}#${B} .bilEye467{position:absolute;top:7px;width:4px;height:6px;background:#10231e;border-radius:99px;animation:bilBlink467 5.3s infinite}#${B} .bilEye467.l{left:6px}#${B} .bilEye467.r{right:6px}#${B} .bilSmile467{position:absolute;left:7px;top:14px;width:10px;height:5px;border-bottom:2px solid #10231e;border-radius:0 0 99px 99px}#${B} .bilFoot467{position:absolute;bottom:0;width:10px;height:7px;border-radius:99px;background:#65be86}#${B} .bilFoot467.l{left:6px}#${B} .bilFoot467.r{right:4px}@keyframes bilBob467{0%,100%{transform:translateY(0) rotate(-1deg)}50%{transform:translateY(-4px) rotate(1deg)}}@keyframes bilHead467{0%,100%{transform:rotate(-5deg)}50%{transform:rotate(7deg)}}@keyframes bilBlink467{0%,44%,48%,100%{transform:scaleY(1)}46%{transform:scaleY(.1)}}
`;document.head.appendChild(s)}
function face(){return '<span class="bilFace467"><i class="bilFoot467 l"></i><i class="bilFoot467 r"></i><i class="bilShell467"></i><i class="bilHead467"><i class="bilEye467 l"></i><i class="bilEye467 r"></i><i class="bilSmile467"></i></i></span>'}
function noop(){return false}
function disableLegacy(){['showAthinaWelcomeV249272','showAthenaWelcomeV249272','showAthinaSimpleHelloV249273','showAthinaSimpleHelloV249276','showAthinaTinyTipV249279','openAthenaV249378','openSocratesV249378','openAthinaMenuV249283','manualAthinaGuideV249282','ensureAthinaCompanionV249258','ensureSocratakiV249252','sokratakiOpenV249252'].forEach(function(n){try{window[n]=noop}catch(e){}try{if(window.ITH)window.ITH[n]=noop}catch(e){}})}
function removeLegacy(root){root=root||document;try{root.querySelectorAll('[id*="athina" i],[id*="athena" i],[class*="athina" i],[class*="athena" i],#ithAthena378,#ithSocrates378,#socratakiFabV249252,#socratakiPanelV249252,#ithCompanionBubble378,#notifyCompanionIntroV249258').forEach(function(x){x.remove()})}catch(e){}try{root.querySelectorAll('#plusSheet button,#memberMenu button,#memberMenu a,[role="dialog"] button').forEach(function(x){if(legacy.test(String(x.textContent||'')))x.remove()})}catch(e){}try{root.querySelectorAll('#notifyCenter,#notificationCenter,.v249238NotifyPanel,[id*="notify" i],[class*="notify" i]').forEach(function(box){box.querySelectorAll('.card,.notification,.notice,.notifyItem,li').forEach(function(x){if(legacy.test(String(x.textContent||'')))x.remove()})})}catch(e){}}
function isHome(){var h=document.getElementById('homePage');return !!(!document.body||!document.body.dataset.page||document.body.dataset.page==='home'||(h&&h.classList.contains('active')))}
function fallbackMenu(){var old=document.getElementById(M);if(old){old.remove();return false}var d=document.createElement('section');d.id=M;d.style.cssText='position:fixed;left:12px;bottom:150px;z-index:2147483600;width:min(350px,calc(100vw - 24px));padding:14px;border-radius:20px;background:#07131f;color:#fff;border:1px solid rgba(255,255,255,.2);box-shadow:0 20px 70px rgba(0,0,0,.55)';d.innerHTML='<div style="display:flex;gap:10px;align-items:center"><span style="width:58px;height:50px;display:grid;place-items:center">'+face()+'</span><div><b style="font-size:18px">Bil</b><div style="opacity:.75">'+tr('Ο πράσινος φίλος της ΙΘΑΚΗΣ','ITHAKI’s green friend')+'</div></div><button type="button" data-x style="margin-left:auto;color:#fff;font-size:22px">×</button></div><p style="line-height:1.5">'+tr('Η καθαρή επικοινωνία αρχίζει όταν ακούμε πριν απαντήσουμε.','Clear communication begins when we listen before replying.')+'</p>';d.querySelector('[data-x]').onclick=function(){d.remove()};document.body.appendChild(d);return false}
function ensureBil(){if(!document.body)return;var b=document.getElementById(B);if(!b){b=document.createElement('button');b.id=B;b.type='button';b.innerHTML=face();b.onclick=function(e){e.preventDefault();e.stopPropagation();try{if(window.ITH&&typeof ITH.openBilV249461==='function')return ITH.openBilV249461()}catch(_e){}return fallbackMenu()};document.body.appendChild(b)}else if(!b.querySelector('.bilFace467'))b.innerHTML=face();b.setAttribute('aria-label',tr('Άνοιγμα Bil','Open Bil'));b.style.display=isHome()?'grid':'none'}
var dict={
'Κέντρο ειδοποιήσεων':'Notification Center','Ρυθμίσεις ειδοποιήσεων':'Notification settings','Όλες':'All','Μηνύματα':'Messages','Κλήσεις':'Calls','Αιτήματα φιλίας':'Friend requests','Likes':'Likes','Αναφορές':'Mentions','Σήμανση όλων ως διαβασμένα':'Mark all as read','Δεν υπάρχουν ειδοποιήσεις.':'There are no notifications.','Νέο μήνυμα':'New message','Νέα αντίδραση':'New reaction','Νέο αίτημα φιλίας':'New friend request','Αναπάντητη κλήση':'Missed call','Αποδοχή':'Accept','Απόρριψη':'Reject','Άνοιγμα μηνύματος':'Open message','Άνοιγμα':'Open','Κλείσιμο':'Close','Ανανέωση':'Refresh','Ενεργοποίηση':'Enable','Απενεργοποίηση':'Disable','Ήσυχες ώρες':'Quiet hours','Αποθήκευση':'Save','Νέος ακόλουθος':'New follower','Νέο σχόλιο':'New comment','Νέα απάντηση':'New reply','Νέο συνημμένο':'New attachment'};
var back={};Object.keys(dict).forEach(function(k){back[dict[k]]=k});
function translateNotices(){var map=eng()?dict:back;try{document.querySelectorAll('#notifyCenter,#notificationCenter,.v249238NotifyPanel,[id*="notify" i],[class*="notify" i]').forEach(function(box){var w=document.createTreeWalker(box,NodeFilter.SHOW_TEXT),n;while((n=w.nextNode())){var raw=String(n.nodeValue||''),v=raw.trim();if(!v||legacy.test(v))continue;var t=map[v];if(t)n.nodeValue=raw.replace(v,t)}})}catch(e){}try{if(window.ITH&&typeof ITH.applyCompleteLanguageV249463==='function')ITH.applyCompleteLanguageV249463()}catch(e){}}
function run(){addCss();disableLegacy();removeLegacy(document);ensureBil();translateNotices();document.documentElement.setAttribute('data-v249467-final','bil-two-eyes-smile-no-athena-translated-notices')}
function schedule(){clearTimeout(timer);timer=setTimeout(run,25)}
function install(){run();if(document.body&&!observer){observer=new MutationObserver(schedule);observer.observe(document.body,{subtree:true,childList:true})}window.addEventListener('ithaki:page-changed',schedule);document.addEventListener('visibilitychange',function(){if(!document.hidden)schedule()},{passive:true});[100,300,700,1500,3000,7000,12000].forEach(function(ms){setTimeout(run,ms)});setInterval(run,5000)}
if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',install,{once:true});else install();
})();
