import{Br as e,Ir as t,pr as n,qr as r}from"./ChQ2IioC.js";import{n as i,t as a}from"./CPMu7zly.js";var o=r(!1),s=r(0),c=n(()=>s.value>0),l=!1,u=null,d=null;async function f(){let{hasAgent:e,hasFeature:t}=a();if(!e.value||!t(`profiles`)){s.value=0,o.value=!0;return}try{s.value=(await i().listProfiles()).filter(e=>e.type!==`merge`&&e.type!==`script`).length}catch{s.value=0}finally{o.value=!0}}function p(){if(l)return;l=!0;let{ready:n}=a();if(n.value){f();return}d=e(!0),d.run(()=>{u=t(n,e=>{e&&(u?.(),u=null,d?.stop(),d=null,f())})})}function m(){return p(),{ready:o,hasBaseProfile:c,baseProfileCount:s,refresh:f}}export{m as t};