(function(){try{var g=typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};g["__faroBundleId_Speechify Chrome Extension"]="13.4.1"}catch(l){}})();
import{Ab as c,gc as l,hc as u}from"./chunk-XMRXO6YU.js";import"./chunk-ODCFEFOB.js";import"./chunk-24ZZP5UQ.js";import"./chunk-GQY3J744.js";import{H as t}from"./chunk-NWEJW7RD.js";import"./chunk-ASZMUWWE.js";import"./chunk-4XRFE7WB.js";import"./chunk-6I7EUWRH.js";import{g as o,n as s}from"./chunk-CLPINNGF.js";s();o();var r=null,y=[];async function g(){let a=await m();return()=>a&&a()}var m=async()=>{let a=c();if(Object.keys(a).some(e=>y.includes(e)))return;if(!("wakeLock"in navigator)){t(new Error("Wake Lock API not supported"));return}let n=async()=>{if(r)try{await r.release(),r=null}catch(e){t(new Error(`Wake Lock release failed: ${e}`))}},k=l.registerHook("PLAYBACK_STATE_CHANGED",async({state:e})=>{if(e==="playing")try{r=await navigator.wakeLock.request("screen")}catch(f){t(new Error(`Wake Lock request failed: ${f}`))}else await n()}),i=async()=>{if(document.visibilityState==="visible")try{u.getPlayingState()==="playing"?r=await navigator.wakeLock.request("screen"):await n()}catch(e){t(new Error(`Wake Lock request failed: ${e}`))}};return document.addEventListener("visibilitychange",i),()=>{k(),document.removeEventListener("visibilitychange",i),r&&r.release().catch(e=>t(new Error(`Wake Lock release failed: ${e}`)))}};export{g as default};
//# sourceMappingURL=init-WBD5FCDM.js.map
