import{Xn as e,dn as t,gr as n}from"./vendor-Dnfj1twE.js";import{Lr as r,or as i,sr as a,zr as o}from"./ws-Dl8XkIy4.js";r(),i(),t();var s=800,c=32,l=`cider:spa-ready`,u=`cider:catalog-ready`;function d(e){try{window.chrome?.webview?.postMessage?.(e)}catch{}}function f(e){return new Promise(t=>setTimeout(t,e))}function p(){d(l);let t=o(),r=a();if(t.bootRevealed){d(u);return}let i=!1,p=()=>{t.bootRevealed=!0,d(u)},m=async()=>{i||(i=!0,await e(),await f(c),p())},h=()=>{i||(i=!0,p(),console.warn(`[BootReveal] catalog-ready fired on max-hold cap`))};if(r.musicKitReady){m();return}let g=setTimeout(h,s),_=n(()=>r.musicKitReady,e=>{e&&(_(),clearTimeout(g),m())})}export{p as startBootReveal};