import{a as t,E as c}from"./index-ByIRZxAe.js";import{r as s}from"./lucide-F1B1VpI-.js";const a=s(null),r=s(!1),u=s(!1);let e=null;async function i(n=!1){return u.value&&!n?a.value:(e&&!n||(r.value=!0,e=(async()=>{try{const l=await t.sendCommand("party_mode/config");return a.value=l,u.value=!0,l}catch{return a.value=null,u.value=!0,null}finally{r.value=!1,e=null}})()),e)}function f(){a.value=null,u.value=!1,e=null}let o=!1;function v(){o||(o=!0,t.subscribe(c.PROVIDERS_UPDATED,async()=>{Object.values(t.providers).some(l=>l.domain==="party_mode")?(f(),await i(!0)):(a.value=null,u.value=!0)}))}function y(){return v(),{config:a,loading:r,loaded:u,fetchConfig:i,invalidate:f}}export{y as u};
