import{c as e,it as t,l as n,p as r,rt as i}from"./button-cHQg_W3T.js";import{a,i as o}from"./shared-styles-CHEAAivb.js";var s=i(()=>{let[i,s]=o(n),[c,l]=t(!1),[u,d]=t(!1);async function f(){l(!0);try{s(a(await e.loadConfig()))}catch{r.showToast(r.L.config?.loadError||`Failed to load config`,`error`)}l(!1)}async function p(){d(!0);try{await e.saveConfig(i),r.showToast(r.L.common?.saved||`Saved`,`success`)}catch{r.showToast(r.L.config?.saveFailed||`Failed to save config`,`error`)}d(!1)}async function m(){d(!0);try{await e.resetConfig(),await f(),r.showToast(r.L.config?.resetSuccess||`Config reset to defaults`,`success`)}catch{r.showToast(r.L.config?.saveFailed||`Failed to reset config`,`error`)}d(!1)}return{get config(){return i},set config(e){s(a(e))},get loading(){return c()},get saving(){return u()},loadConfig:f,saveConfig:p,resetConfig:m}});export{s as t};