/* OK ITHAKI V249526R3 — DEDUP HOME/COMMUNITIES / STABLE SHARE / FULL NOTIFICATION MODES */
(function(){
'use strict';
if(window.__ITHAKI_V249526R3_OWNER__)return;
window.__ITHAKI_V249526R3_OWNER__={version:'V249526R3',dedupHome:true,dedupCommunities:true,stableShareOwner:true,fullNotificationModes:true,at:Date.now()};
const HOME_COMMUNITY_DEDUP_R3=true,STABLE_SHARE_OWNER_R3=true,FULL_NOTIFICATION_MODES_R3=true,BIL_CHOICE_RESTORED_R3=true;
const I=()=>window.ITH=window.ITH||{};
const S=()=>window.state||I().state||{};
const $=id=>document.getElementById(id);
const esc=s=>String(s==null?'':s).replace(/[&<>"']/g,c=>({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[c]));
function toast(m,ms=5200){try{if(typeof I().toast==='function')return I().toast(String(m),ms)}catch(e){}const t=$('toast');if(t){t.textContent=String(m);t.classList.add('show');clearTimeout(toast._t);toast._t=setTimeout(()=>t.classList.remove('show'),ms)}}
function device(){return String(S().device||S().device_id||localStorage.getItem('ith_device')||localStorage.getItem('ith_device_id')||'')}
function room(){return String(S().room||localStorage.getItem('ith_room')||'ithaki-phone-test')}
function apiBase(){let b=String(S().api||'').replace(/\/+$/,'');if(!b||/appassets\.androidplatform\.net/i.test(b)){try{const n=window.OKITHAKI_ANDROID||window.AndroidBridge;if(n&&typeof n.getServerBase==='function')b=String(n.getServerBase()||'').replace(/\/+$/,'')}catch(e){}}return b||(/^https?:/i.test(location.origin)?location.origin:'https://ok-ithaki.gr')}
function fullUrl(u){try{return new URL(String(u||''),apiBase()+'/').toString()}catch(e){return String(u||'')}}
async function request(path,opt={}){const r=await fetch(/^https?:/i.test(path)?path:apiBase()+path,Object.assign({cache:'no-store',credentials:'include'},opt));let d=null;try{d=await r.json()}catch(e){}if(!r.ok||d&&d.ok===false)throw Error(String(d&&d.message||d&&d.reason||d&&d.detail||'HTTP '+r.status));return d||{ok:true}}

/* ---------- one visible entry per member / community ---------- */
function normalizedText(x){return String(x&&x.textContent||'').replace(/\s+/g,' ').trim().toLocaleLowerCase('el')}
function storyKey(x){if(x.classList.contains('ithakiOfficialStory'))return'official:ithaki';for(const k of ['memberId','peer','peerId','deviceId','sender','story','id']){const v=x.dataset&&x.dataset[k];if(v)return'member:'+String(v)}const oc=String(x.getAttribute('onclick')||'');const m=oc.match(/(?:member|startDM|openDMWith)\s*\(\s*['"]([^'"]+)/);if(m)return'member:'+m[1];const img=x.querySelector('img')?.getAttribute('src')||'';return'text:'+normalizedText(x)+'|'+img}
function mergeAndDedupeStories(){const home=$('homePage');if(!home)return;const roots=[...home.querySelectorAll('.homeStories')];if(!roots.length)return;let keep=roots.find(x=>x.closest('.ithActiveTopV249461'))||roots[0];let scroll=keep.querySelector('.storyScroll');if(!scroll){scroll=document.createElement('div');scroll.className='storyScroll';keep.prepend(scroll)}for(const extra of roots){if(extra===keep)continue;const src=extra.querySelector('.storyScroll');if(src)[...src.children].forEach(n=>scroll.appendChild(n));extra.remove()}const seen=new Set();[...scroll.querySelectorAll('.storyItem,button')].forEach(x=>{const k=storyKey(x);if(seen.has(k))x.remove();else seen.add(k)});const official=[...scroll.querySelectorAll('.ithakiOfficialStory')];official.slice(1).forEach(x=>x.remove())}
function dedupeHome(){const home=$('homePage');if(!home)return;const homes=[...home.querySelectorAll('.ithHomeV249461,[data-ithaki-v249461-home="1"]')];if(homes.length>1){const keep=homes.find(x=>x.classList.contains('ithHomeV249461'))||homes[0];homes.forEach(x=>{if(x!==keep)x.remove()})}mergeAndDedupeStories();const actionSeen=new Set();home.querySelectorAll('.ithActionsV249461 .ithActionV249461').forEach(x=>{const k=String(x.dataset.v249461Route||x.dataset.v249461Action||normalizedText(x));if(actionSeen.has(k))x.remove();else actionSeen.add(k)});const welcome=home.querySelectorAll('.ithHeroV249461,.welcomeHero,.homeWelcomePro');const keys=new Set();welcome.forEach(x=>{const k=x.className+'|'+normalizedText(x);if(keys.has(k))x.remove();else keys.add(k)})}
function communityKey(x){return String(x.dataset.spaceId||x.getAttribute('data-subroom-id')||x.dataset.roomId||'').trim()||normalizedText(x.querySelector('.who b,b')||x)}
function dedupeCommunities(){const list=$('ith516List');if(list){const seen=new Set();list.querySelectorAll('.ith516Row,[data-space-id]').forEach(x=>{const k=communityKey(x);if(!k)return;if(seen.has(k))x.remove();else seen.add(k)})}const roomList=$('roomList');if(roomList){const seen=new Set();[...roomList.children].forEach(x=>{const k=communityKey(x);if(!k)return;if(seen.has(k))x.remove();else seen.add(k)})}const cats=$('ith516Cats');if(cats){const seen=new Set();cats.querySelectorAll('[data-category]').forEach(x=>{const k=x.dataset.category;if(seen.has(k))x.remove();else seen.add(k)})}}
function dedupeState(){try{const s=S();if(Array.isArray(s.spaces)){const m=new Map();s.spaces.forEach(x=>{const k=String(x&&x.subroom_id||'');if(k&&!m.has(k))m.set(k,x)});s.spaces=[...m.values()]}}catch(e){}}
function dedupeAll(){dedupeState();dedupeHome();dedupeCommunities();document.querySelectorAll('#ith525BilDock').forEach(x=>x.remove());const bil=[...document.querySelectorAll('#ith526BilDock')];bil.slice(1).forEach(x=>x.remove())}

/* ---------- one immutable share owner ---------- */
const shareState={active:false,modal:null,media:null,blob:null,token:0,lastOpenAt:0};
const SINGLE_SHARE_MODAL_GUARD_R6=true;
function closeShare(){shareState.active=false;shareState.token++;if(shareState.modal)shareState.modal.remove();shareState.modal=null;shareState.media=null;shareState.blob=null}
function normalizeFriends(v){if(Array.isArray(v))return v;if(v&&Array.isArray(v.items))return v.items;if(v&&Array.isArray(v.friends))return v.friends;if(v&&Array.isArray(v.people))return v.people;return[]}
function peerId(p){return String(p&&p.device_id||p&&p.peer_id||p&&p.member_id||p&&p.user_id||p&&p.id||'')}
async function friends(){for(const fn of [I().loadServerFriendsV249429,I().loadServerFriends,I().getFriends,window.loadServerFriendsV249429,window.loadServerFriends]){if(typeof fn==='function'){try{const a=normalizeFriends(await fn.call(I(),true));if(a.length)return a}catch(e){}}}try{return normalizeFriends(await request('/api/messages/friends_v249430?room_id='+encodeURIComponent(room())+'&device_id='+encodeURIComponent(device())+'&_v='+Date.now()))}catch(e){return[]}}
async function sendFriend(peer,media){const channel='dm:'+[device(),String(peer)].sort().join(':');const payload=JSON.stringify({body:'',media});for(const fn of [window.sendMessagePayload,I().sendMessagePayload,window.sendDMPayload,I().sendDMPayload]){if(typeof fn==='function'){await fn.call(I(),channel,payload);return true}}await request('/api/messages/send_v249430',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({room_id:room(),channel,peer_id:String(peer),sender_id:device(),nickname:String(S().name||S().nickname||'Μέλος'),language:'el',text:payload})});return true}
async function uploadBlob(blob,media){if(typeof window.uploadWithProgress==='function'){const f=blob instanceof File?blob:new File([blob],media.filename,{type:media.mime_type});const up=await window.uploadWithProgress(f,'file',true);return{url:up.url||up.file_url,filename:up.filename||media.filename,mime_type:up.mime_type||media.mime_type,kind:media.kind||'file',size:up.size_bytes||f.size,serverStored:true}}throw Error('Δεν είναι διαθέσιμη η μεταφόρτωση αρχείου.')}
async function externalShare(media,blob){const n=window.OKITHAKI_ANDROID||window.AndroidBridge;try{if(blob&&n&&typeof n.shareBase64FileV249523==='function'){const data=await new Promise((res,rej)=>{const r=new FileReader();r.onload=()=>res(String(r.result).split(',')[1]||'');r.onerror=rej;r.readAsDataURL(blob)});const out=String(n.shareBase64FileV249523(media.filename,media.mime_type,data)||'');if(/^(ok|queued)/i.test(out))return true}if(!blob&&n&&typeof n.shareRemoteFileV249524==='function'){const out=String(n.shareRemoteFileV249524(fullUrl(media.url),media.filename,media.mime_type,'',device(),room())||'');if(/^(ok|queued)/i.test(out))return true}if(!blob&&n&&typeof n.shareRemoteFileV249523==='function'){const out=String(n.shareRemoteFileV249523(fullUrl(media.url),media.filename,media.mime_type,'',device(),room())||'');if(/^(ok|queued)/i.test(out))return true}}catch(e){}
 if(!blob&&navigator.share){try{await navigator.share({title:'OK ITHAKI',text:media.filename||'Κοινοποίηση από την OK ITHAKI',url:fullUrl(media.url)});return true}catch(e){if(e&&e.name==='AbortError')return false}}
 let file=blob;if(!file){const r=await fetch(fullUrl(media.url),{cache:'no-store',credentials:'include'});if(!r.ok)throw Error('HTTP '+r.status);file=await r.blob()}const f=file instanceof File?file:new File([file],media.filename||'ITHAKI_file',{type:media.mime_type||file.type||'application/octet-stream'});if(navigator.share&&(!navigator.canShare||navigator.canShare({files:[f]}))){await navigator.share({files:[f],title:'OK ITHAKI'});return true}const a=document.createElement('a');a.href=URL.createObjectURL(f);a.download=f.name;document.body.appendChild(a);a.click();setTimeout(()=>{URL.revokeObjectURL(a.href);a.remove()},1800);toast('Το αρχείο αποθηκεύτηκε επειδή δεν υπάρχει διαθέσιμη εξωτερική κοινοποίηση.');return true}
function modalMarkup(){return'<section><header><button type="button" data-r3-close>‹</button><b>Κοινοποίηση</b><button type="button" data-r3-close>×</button></header><button type="button" class="external" data-r3-external>↗ Εξωτερικά</button><div class="label">Αποστολή σε φίλο ΙΘΑΚΗΣ</div><div class="friends"><div class="card">Φόρτωση φίλων…</div></div></section>'}
async function openShare(media,blob){if(shareState.active&&shareState.modal&&shareState.modal.isConnected)return false;if(shareState.modal&&!shareState.modal.isConnected)closeShare();document.querySelectorAll('#ith524ShareChoice,#ith526R2ShareChoice,#ithShareOverlayV249433,#ithFriendPickerV249433,#ith518Panel[data-share-owner]').forEach(x=>x.remove());shareState.active=true;shareState.lastOpenAt=Date.now();shareState.media=media;shareState.blob=blob;const tok=++shareState.token;const d=document.createElement('div');d.id='ith526R3ShareChoice';d.innerHTML=modalMarkup();shareState.modal=d;document.body.appendChild(d);d.addEventListener('click',e=>{if(e.target===d||e.target.closest('[data-r3-close]'))closeShare();else e.stopPropagation()});d.querySelector('[data-r3-external]').onclick=async e=>{e.preventDefault();e.stopPropagation();const b=e.currentTarget;b.disabled=true;try{const ok=await externalShare(media,blob);if(ok)closeShare()}catch(x){toast('Η εξωτερική κοινοποίηση απέτυχε: '+String(x.message||x))}finally{b.disabled=false}};
 const a=await friends();if(!shareState.active||tok!==shareState.token)return false;const box=d.querySelector('.friends');const unique=new Map();a.forEach(p=>{const id=peerId(p);if(id&&!unique.has(id))unique.set(id,p)});box.innerHTML=unique.size?[...unique.values()].map(p=>{const id=peerId(p),name=String(p.nickname||p.name||p.display_name||'Φίλος'),av=String(p.avatar||p.photo||'');return'<button type="button" class="friend" data-r3-peer="'+esc(id)+'"><span class="avatar">'+(av?'<img src="'+esc(fullUrl(av))+'" alt="">':esc((name[0]||'Μ').toUpperCase()))+'</span><span><b>'+esc(name)+'</b><small>Αποστολή στο μήνυμα</small></span><i>➤</i></button>'}).join(''):'<div class="card">Δεν βρέθηκαν αποδεκτοί φίλοι.</div>';box.onclick=async e=>{const b=e.target.closest('[data-r3-peer]');if(!b)return;e.preventDefault();e.stopPropagation();b.disabled=true;try{let m=media;if(blob)m=await uploadBlob(blob,media);await sendFriend(b.dataset.r3Peer,m);closeShare();toast('Στάλθηκε στον φίλο.')}catch(x){toast('Δεν στάλθηκε στον φίλο: '+String(x.message||x))}finally{b.disabled=false}};return false}
function remoteShare(url,name='ITHAKI_file',mime='application/octet-stream'){return openShare({url:fullUrl(url),filename:name||'ITHAKI_file',mime_type:mime||'application/octet-stream',kind:/^video\//.test(mime)?'video':/^image\//.test(mime)?'photo':/^audio\//.test(mime)?'audio':'file'},null)}
function blobShare(blob,name='ITHAKI_file',mime=''){return openShare({url:'',filename:name||'ITHAKI_file',mime_type:mime||blob.type||'application/octet-stream',kind:/^video\//.test(mime||blob.type)?'video':/^image\//.test(mime||blob.type)?'photo':/^audio\//.test(mime||blob.type)?'audio':'file'},blob)}
function textShare(text,name='ITHAKI_message.txt'){return blobShare(new Blob([String(text||'')],{type:'text/plain;charset=utf-8'}),name,'text/plain')}
function genericShare(url,text=''){const u=String(url||'').trim(),t=String(text||'').trim();if(!u)return textShare(t);const fileLike=/\.(?:jpe?g|png|gif|webp|svg|mp4|webm|mov|m4v|mp3|wav|ogg|m4a|pdf|docx?|xlsx?|pptx?|zip|rar|7z)(?:[?#]|$)|\/api\/(?:media|files?)\//i.test(u);if(fileLike)return remoteShare(u,(u.split('/').pop()||'ITHAKI_file').split('?')[0],'application/octet-stream');return openShare({url:fullUrl(u),filename:t||'Σύνδεσμος OK ITHAKI',mime_type:'text/uri-list',kind:'link'},null)}
function lock(obj,key,fn){try{Object.defineProperty(obj,key,{configurable:false,enumerable:true,get(){return fn},set(){return fn}})}catch(e){try{obj[key]=fn}catch(_e){}}}
function installShareOwner(){const o=I();const media=(url,name='',mime='')=>{remoteShare(url,name||'ITHAKI_file',mime||'application/octet-stream');return false};[['shareActualFileV249526R3',remoteShare],['shareActualFileV249526R2',remoteShare],['shareActualFileV249524',remoteShare],['shareActualFileV249523',remoteShare],['shareActualUrlFileV249521',remoteShare],['shareBlobV249526R3',blobShare],['shareBlobV249526R2',blobShare],['shareBlobV249524',blobShare],['shareBlobV249523',blobShare],['shareTextFileV249524',textShare],['shareTextFileV249523',textShare],['shareTextFileV249522',textShare],['shareMediaFile',media],['share',genericShare]].forEach(([k,f])=>lock(o,k,f));lock(window,'shareMediaFile',media);lock(window,'shareActualUrlFileV249521',remoteShare)}
function keepShareAlive(){if(shareState.active&&shareState.modal&&!shareState.modal.isConnected)document.body.appendChild(shareState.modal)}

/* ---------- restore five notification modes + Bil ---------- */
const MODE_KEY='ithaki_push_mode_v249258',MASTER='ith525_notifications_enabled',SOUND='ith525_notification_sound',BIL='ith525_bil_enabled',OLD_BIL='ith_bil_enabled_v249461';
const modes=[['fcm_default','1. FCM προεπιλογή','Κλειστή εφαρμογή με Firebase/FCM και ανοιχτή εφαρμογή με το εσωτερικό καμπανάκι. Προτείνεται.'],['background','2. Παρασκήνιο','Πιο ήπια λειτουργία όταν η εφαρμογή βρίσκεται στο παρασκήνιο.'],['open_app','3. Ανοιχτή εφαρμογή','Ειδοποιήσεις μόνο όσο βρίσκεσαι μέσα στην ΙΘΑΚΗ.'],['stay_awake','4. Δεν κοιμάται','Κρατά ζωντανή σύνδεση. Πιο άμεσο, αλλά χρησιμοποιεί περισσότερη μπαταρία.'],['no_closed','5. Χωρίς ειδοποιήσεις με κλειστή εφαρμογή','Δεν εμφανίζεται FCM push όταν η εφαρμογή είναι κλειστή.']];
function bool(k,d=true){try{const v=localStorage.getItem(k);return v==null?d:v==='1'}catch(e){return d}}
function setBool(k,v){try{localStorage.setItem(k,v?'1':'0')}catch(e){}return!!v}
function mode(){try{return localStorage.getItem(MODE_KEY)||'fcm_default'}catch(e){return'fcm_default'}}
function bilOn(){return bool(BIL,bool(OLD_BIL,true))}
function setBil(v){setBool(BIL,v);setBool(OLD_BIL,v);try{localStorage.setItem('ithaki_companion_v249258',v?'sokratakis':'none')}catch(e){}const d=$('ith525BilDock')||$('ith526BilDock');if(d)d.hidden=!v;toast(v?'Ο Bil ενεργοποιήθηκε.':'Ο Bil απενεργοποιήθηκε.');openNotificationSettings();return false}
function setMode(v){if(!modes.some(x=>x[0]===v))v='fcm_default';try{if(typeof I().setNotificationMode==='function')I().setNotificationMode(v);else{localStorage.setItem(MODE_KEY,v);localStorage.setItem('ith_notifications_mode_v249164',v==='fcm_default'?'fcm':v==='background'?'hybrid':v==='open_app'?'open_only':v==='stay_awake'?'stay_awake':'open_only')}}catch(e){try{localStorage.setItem(MODE_KEY,v)}catch(_e){}}openNotificationSettings();return false}
function bilFace(){return'<span class="ithR3BilFace"><i class="shell"></i><i class="head"><i class="eye l"></i><i class="eye r"></i><i class="mouth"></i></i><i class="foot l"></i><i class="foot r"></i></span>'}
function openNotificationSettings(){const m=$('memberMenu');if(!m)return false;m.dataset.ith526Owner='notifications';m.classList.add('show','fullAvatarMenuV249231');const current=mode(),bil=bilOn();m.innerHTML='<div id="ith526NotificationSettings" class="ith526Panel ith526R3Settings"><div class="ith526Head"><button type="button" data-r3-top="center">‹</button><div><b>Ρυθμίσεις ειδοποιήσεων</b><small>Ένας μηχανισμός · μία επιλογή λειτουργίας</small></div><button type="button" data-r3-top="close">×</button></div><section class="ithR3SettingsCard"><b>🔔 Επιλογές τρόπου ειδοποιήσεων</b><p>Διάλεξε έναν μόνο τρόπο, ώστε να μην δημιουργούνται διπλά μηνύματα ή κλήσεις.</p><div class="ithR3ModeGrid">'+modes.map(x=>'<button type="button" class="ithR3Mode '+(current===x[0]?'active':'')+'" data-r3-mode="'+x[0]+'"><b>'+esc(x[1])+'</b><small>'+esc(x[2])+'</small></button>').join('')+'</div></section><section class="ithR3SettingsCard"><div class="ithR3BilRow">'+bilFace()+'<div><b>Bil</b><small>Τοπικός συνοδοιπόρος ειδοποιήσεων. Δεν στέλνει δεδομένα στον server.</small></div></div><div class="ithR3Two"><button type="button" class="'+(bil?'active':'')+'" data-r3-bil="1">Ενεργοποιημένος</button><button type="button" class="'+(!bil?'active':'')+'" data-r3-bil="0">Απενεργοποιημένος</button></div></section><section class="ithR3SettingsCard"><b>Βασικές επιλογές</b><div class="ithR3Two"><button type="button" class="'+(bool(MASTER,true)?'active':'')+'" data-r3-basic="master">Ειδοποιήσεις</button><button type="button" class="'+(bool(SOUND,true)?'active':'')+'" data-r3-basic="sound">Ήχος</button></div><div class="ithR3Grid"><button type="button" data-r3-action="external">📨 Κέντρο Μηνυμάτων</button><button type="button" data-r3-action="calendar">📅 Ημερολόγιο</button><button type="button" data-r3-action="access">🔐 Άδεια Android</button></div></section></div>';return false}
function closeNotificationMenu(){const m=$('memberMenu');if(m){delete m.dataset.ith526Owner;m.classList.remove('show');m.innerHTML=''}return false}
function notificationCapture(e){const settings=e.target.closest('#ith526NotificationCenter [data-top="settings"],#ith525NotificationCenter [data-top="settings"],[data-open-notification-settings]');if(settings){e.preventDefault();e.stopPropagation();e.stopImmediatePropagation();return openNotificationSettings()}const root=e.target.closest('#ith526NotificationSettings');if(!root)return;const top=e.target.closest('[data-r3-top]');if(top){e.preventDefault();e.stopImmediatePropagation();if(top.dataset.r3Top==='center'){const f=I().notifyCenter||window.notifyCenter;return typeof f==='function'?f('all'):false}return closeNotificationMenu()}const md=e.target.closest('[data-r3-mode]');if(md){e.preventDefault();e.stopImmediatePropagation();return setMode(md.dataset.r3Mode)}const b=e.target.closest('[data-r3-bil]');if(b){e.preventDefault();e.stopImmediatePropagation();return setBil(b.dataset.r3Bil==='1')}const basic=e.target.closest('[data-r3-basic]');if(basic){e.preventDefault();e.stopImmediatePropagation();const k=basic.dataset.r3Basic;if(k==='master')setBool(MASTER,!bool(MASTER,true));if(k==='sound')setBool(SOUND,!bool(SOUND,true));try{const n=window.OKITHAKI_ANDROID||window.AndroidBridge;if(n&&typeof n.setNotificationMasterEnabledV249525==='function')n.setNotificationMasterEnabledV249525(bool(MASTER,true));if(n&&typeof n.setNotificationSoundEnabledV249525==='function')n.setNotificationSoundEnabledV249525(bool(SOUND,true))}catch(x){}return openNotificationSettings()}const a=e.target.closest('[data-r3-action]');if(a){e.preventDefault();e.stopImmediatePropagation();const k=a.dataset.r3Action;if(k==='external'){const f=I().openExternalMessageCenterV249477||I().openExternalCenterV249508;if(typeof f==='function')return f.call(I())}if(k==='calendar'){const f=I().renderLocalProfessionalCalendarV249477;if(typeof f==='function')return f.call(I(),true,'calendar')}if(k==='access'){try{const n=window.OKITHAKI_ANDROID||window.AndroidBridge;if(n&&typeof n.openNotificationAccessSettingsV249477==='function')return n.openNotificationAccessSettingsV249477()}catch(x){}}}}
function installNotificationOwner(){lock(I(),'openNotificationSettingsV249238',openNotificationSettings);lock(window,'openNotificationSettingsV249238',openNotificationSettings);lock(I(),'renderNotificationModeSettingsV249258',openNotificationSettings);lock(window,'renderNotificationModeSettingsV249258',openNotificationSettings);lock(I(),'openNotificationSettingsV249526R3',openNotificationSettings)}

function css(){if($('ith526R3Css'))return;const s=document.createElement('style');s.id='ith526R3Css';s.textContent=`
#ith526R3ShareChoice{position:fixed;inset:0;z-index:2147483647;background:rgba(0,0,0,.80);display:grid;place-items:center;padding:12px;backdrop-filter:blur(10px)}#ith526R3ShareChoice>section{width:min(470px,96vw);max-height:90dvh;overflow:auto;border-radius:23px;background:#071522;color:#fff;border:1px solid rgba(255,255,255,.18);padding:12px;box-shadow:0 24px 80px rgba(0,0,0,.62)}#ith526R3ShareChoice header{display:flex;align-items:center;gap:8px}#ith526R3ShareChoice header b{flex:1;text-align:center}#ith526R3ShareChoice button{color:#fff}#ith526R3ShareChoice header button{width:42px;height:42px;border-radius:50%;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.16)}#ith526R3ShareChoice .external{width:100%;min-height:58px;margin:11px 0;border-radius:17px;background:rgba(54,240,160,.13);border:1px solid rgba(54,240,160,.44);font-weight:900}#ith526R3ShareChoice .label{margin:12px 3px 7px;color:#ffe39b;font-weight:900}#ith526R3ShareChoice .friend{width:100%;display:grid;grid-template-columns:46px 1fr auto;gap:10px;align-items:center;text-align:left;padding:9px;margin:7px 0;border-radius:16px;background:rgba(255,255,255,.055);border:1px solid rgba(255,255,255,.11)}#ith526R3ShareChoice .avatar{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;overflow:hidden;background:rgba(255,255,255,.1);font-weight:900}#ith526R3ShareChoice .avatar img{width:100%;height:100%;object-fit:cover}#ith526R3ShareChoice small{display:block;opacity:.72;margin-top:2px}
.ithR3SettingsCard{margin-top:10px;padding:13px;border-radius:18px;background:rgba(255,255,255,.045);border:1px solid rgba(255,255,255,.11)}.ithR3SettingsCard>p{opacity:.72;line-height:1.42}.ithR3ModeGrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:9px;margin-top:10px}.ithR3Mode,.ithR3Two button,.ithR3Grid button{border:1px solid rgba(255,255,255,.13);background:rgba(255,255,255,.055);color:#fff;border-radius:16px;padding:12px;text-align:left}.ithR3Mode.active,.ithR3Two button.active{border-color:rgba(255,218,112,.68);background:rgba(255,218,112,.15);box-shadow:0 0 0 1px rgba(255,218,112,.16)}.ithR3Mode b,.ithR3Mode small{display:block}.ithR3Mode small{opacity:.72;margin-top:5px;line-height:1.35}.ithR3Two{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}.ithR3Two button{text-align:center;font-weight:900}.ithR3Grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:10px}.ithR3Grid button{text-align:center}.ithR3BilRow{display:flex;align-items:center;gap:12px}.ithR3BilRow>div{display:flex;flex-direction:column;gap:4px}.ithR3BilRow small{opacity:.72}.ithR3BilFace{position:relative;display:block;width:64px;height:57px;flex:0 0 64px}.ithR3BilFace .shell{position:absolute;left:6px;top:24px;width:45px;height:29px;border-radius:55%;background:radial-gradient(circle at 44% 23%,#ffe49c 0 18%,#62bf89 19% 55%,#246b50 56% 100%);border:1px solid #ffffff80}.ithR3BilFace .head{position:absolute;left:25px;top:2px;width:28px;height:28px;border-radius:50%;background:#7bdaa0;border:1px solid #ffffff80}.ithR3BilFace .eye{position:absolute;top:8px;width:4px;height:6px;border-radius:50%;background:#10231e}.ithR3BilFace .eye.l{left:6px}.ithR3BilFace .eye.r{right:6px}.ithR3BilFace .mouth{position:absolute;left:9px;top:18px;width:10px;height:4px;border-bottom:2px solid #17392e;border-radius:0 0 9px 9px}.ithR3BilFace .foot{position:absolute;top:49px;width:11px;height:6px;border-radius:99px;background:#62bf89}.ithR3BilFace .foot.l{left:8px}.ithR3BilFace .foot.r{right:9px}@media(max-width:560px){.ithR3Grid{grid-template-columns:1fr}.ithR3ModeGrid{grid-template-columns:1fr}}
`;document.head.appendChild(s)}
function maintain(){css();installShareOwner();installNotificationOwner();dedupeAll();keepShareAlive();try{localStorage.setItem('ith_frontend_build','V249526R3-dedup-share-full-notification-modes');document.documentElement.setAttribute('data-ithaki-v249526r3','dedup-share-full-notification-modes')}catch(e){}}
function install(){css();installShareOwner();installNotificationOwner();document.addEventListener('click',notificationCapture,true);maintain();new MutationObserver(()=>{clearTimeout(install._m);install._m=setTimeout(maintain,45)}).observe(document.body,{subtree:true,childList:true});window.addEventListener('ithaki:page-changed',()=>setTimeout(maintain,30));['pageshow','focus'].forEach(n=>window.addEventListener(n,maintain));setInterval(maintain,700)}
if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',install,{once:true});else install();
})();
