import{Qt as e,dn as t,en as n,gr as r,tn as i}from"./vendor-6bGPahzI.js";import{et as a}from"./vendor-quasar-Bl8FKFQs.js";import{B as o,Ba as s,F as c,H as l,Ha as u,Nt as d,On as f,P as p,Pt as m,Ua as h,V as g,Va as _,b as v,ea as y,fr as b,jt as x,na as S,ur as C,wn as w,x as T,za as E}from"./ws-BfVPV0ME.js";import{a as D,c as O,d as k}from"./client-api-DGgiwyPh.js";import{r as A,t as j}from"./useNotifications-DKQR3Y1H.js";import{An as M,jn as N}from"./auth-WD4QDKIv.js";t(),k(),h(),A(),y(),C(),w(),m(),c(),T(),N(),n(),E();var P=`wq:`,F=!1;function I(){F||(F=!0,s(()=>{(async()=>{try{let t=(await i()).filter(e=>typeof e==`string`&&e.startsWith(P));if(!t.length)return;await e(t),console.debug(`[Queue] Swept legacy queue storage:`,{removed:t.length})}catch(e){console.debug(`[Queue] Legacy queue storage sweep failed:`,e)}})()},{timeout:6e4}))}l();var L=a(async()=>{if(f())return;console.debug(`[boot] Client Listeners`);let e=b(),t=x(),n=O()===`win32`&&D()==`pixie`;(O()===`darwin`||n)&&(document.body.classList.add(`window-glass`),document.documentElement.classList.add(`window-glass`)),r(()=>t.debug?.mklite,e=>{globalThis.__MKLITE_DEBUG=!!e},{immediate:!0}),g(),S(e=>{e?o():g(),j({title:_(e?`term.privateSession`:`term.disablePrivateSession`),subtitle:e?u(`Scrobbling, Discord presence and listening history are paused.`,`term.privateSession.paused`):u(`Scrobbling, Discord presence and listening history have resumed.`,`term.privateSession.resumed`),icon:`nicon:private`,type:`info`})}),p(),I();let i=new Set;window.addEventListener(`blur`,()=>{if(d(`visual.pauseAnimatedOnBlur`)){let e=document.querySelectorAll(`.animated-artwork-video`);for(let t of e)t.paused||(t.pause(),i.add(t))}document.body.setAttribute(`window-blurred`,`true`),e.windowFocusState=`blurred`}),window.addEventListener(`focus`,()=>{for(let e of i)i.delete(e),e.isConnected&&e.play().catch(()=>{});document.body.removeAttribute(`window-blurred`),e.windowFocusState=`focused`}),window.addEventListener(`beforeunload`,()=>{v()}),M(t.general.keybindings)});export{L as default};