import{Y as S,Z as v,b as n,c as M,$ as u,A as d,u as o}from"./index-BWheVNoj.js";const h=()=>{const[s,a]=v([]),[l,r]=n(!1),[i,c]=n(!1),m=M(()=>{const e={auto:0,magic:0};return s.forEach(t=>{t.is_mounted&&(t.mode==="auto"?e.auto++:t.mode==="magic"&&e.magic++)}),e});async function g(){r(!0);try{const e=await d.scanModules();a(u(e))}catch{o.showToast(o.L.modules?.scanError||"Failed to load modules","error")}r(!1)}async function f(){c(!0);try{await d.saveModules(s),o.showToast(o.L.common?.saved||"Saved","success")}catch{o.showToast(o.L.modules?.saveFailed||"Failed to save module modes","error")}c(!1)}return{get modules(){return s},set modules(e){a(u(e))},get loading(){return l()},get saving(){return i()},get modeStats(){return m()},loadModules:g,saveModules:f}},y=S(h);export{y as m};
