import{$n as e,Cn as t,Jn as n,M as r,Wn as i,j as a}from"./DLvf9lie.js";var o=e(!1),s=e(0),c=t(()=>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 r().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:e}=a();if(e.value){f();return}d=n(!0),d.run(()=>{u=i(e,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};