import"./rolldown-runtime-DIIn1E2Q.js";import{a as e,i as t}from"./useFeatureFlags-CeS8LuDc.js";import{r as n}from"./api-Cw7jP9TY.js";async function refreshRemoteConfig(r={}){let{useAuth:i=!0}=r;try{let r=i?await n.fetchApi(`/features`,{cache:`no-store`}):await fetch(`/api/features`,{cache:`no-store`});if(r.ok){let n=await r.json();window.__CONFIG__=n,t.value=n,e.value=i?`authenticated`:`anonymous`;return}console.warn(`Failed to load remote config:`,r.statusText),(r.status===401||r.status===403)&&(window.__CONFIG__={},t.value={},e.value=`error`)}catch(n){console.error(`Failed to fetch remote config:`,n),window.__CONFIG__={},t.value={},e.value=`error`}}export{refreshRemoteConfig as t};
//# sourceMappingURL=refreshRemoteConfig-Dg4sbbSK.js.map