try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`db5f5d7d-d4ae-4121-a08f-750e8e87ea26`,e._sentryDebugIdIdentifier=`sentry-dbid-db5f5d7d-d4ae-4121-a08f-750e8e87ea26`)}catch{}import"./rolldown-runtime-nx40z1zs.js";import{Kl as e,yg as t}from"./entry.client-mpghtlrl.js";var n=()=>globalThis.window?.vidaatv??null,r=()=>{let e=n()?.getTTSEnable();return e===null?null:e===1||e===!0},i=new URL(`/assets/homeOSTV-jswz3q6s.js`,``+import.meta.url).href,a,o=()=>typeof window>`u`||window.vidaatv?Promise.resolve():a||(a=new Promise((e,t)=>{let n=document.createElement(`script`);n.src=i,n.async=!0,n.onload=()=>e(),n.onerror=()=>t(Error(`Failed to load VIDAA TV SDK from ${i}`)),document.head.appendChild(n)}),a),s=new t(`HomeOSApplicationLifecycleAdaptor`),c=class{async onAppStart(){e.keys.add(`Backspace`);try{await o()}catch(e){s.error(`Failed to load the VIDAA TV SDK!`,{error:e})}this.disableChromeVoxIfUnneeded()}hasQuitSupport(){return typeof window<`u`&&typeof window.close==`function`}quitApp(){typeof window<`u`&&typeof window.close==`function`&&window.close()}disableChromeVoxIfUnneeded(){if(r()){s.info(`TTS is enabled, allowing ChromeVox to run.`);return}s.info(`TTS is disabled, killing ChromeVox.`);try{cvox?.ChromeVox?.host?.killChromeVox()}catch{s.warn(`Failed to disable ChromeVox.`)}}};export{c as HomeOSApplicationLifecycleAdaptor};