System.register(["./index-legacy-BGUFxny_.js","./useTitle-legacy-Ck1as0cr.js","./SettingItem-legacy-DcuCPY8O.js","./ResponsiveGrid-legacy-B3XB4KcT.js","./index-legacy-BbfMcMsh.js","./index-legacy-CwkvHJvM.js","./index-legacy-DVBgQjo3.js","./item_type-legacy-BFH7Oxl9.js"],function(e,t){"use strict";var n,s,a,l,c,i,g,r,o,u,d,y,p,h,m,f,b,j,w,_;return{setters:[e=>{n=e.j,s=e.b9,a=e.bq,l=e.bV,c=e.df,i=e.B,g=e.D,r=e.dg,o=e.Q,u=e.bt,d=e.r,y=e.o,p=e.aw,h=e.K,m=e.dh,f=e.ah,b=e.di},e=>{j=e.b},e=>{w=e.I},e=>{_=e.R},null,null,null,null],execute:function(){e("default",e=>{const t=y(),{pathname:k}=n();j(`manage.sidemenu.${k().split("/").pop()}`);const[$,v]=s(()=>a.get(`/admin/setting/list?group=${e.group}`)),[x,C]=l([]),S=async()=>{const e=await v();u(e,C)};S();const[I,D]=s(()=>a.post("/admin/setting/save",c(x))),[R,q]=s(()=>a.post(`/admin/setting/default?group=${e.group}`)),[B,G]=i(!1);return g(f,{w:"$full",alignItems:"start",spacing:"$2",get children(){return[g(_,{get children(){return g(r,{each:x,children:e=>g(w,o(e,{onChange:t=>{C(t=>e().key===t.key,"value",t)},onDelete:async()=>{G(!0);const n=await a.post(`/admin/setting/delete?key=${e().key}`);G(!1),u(n,()=>{d.success(t("global.delete_success")),S()})}}))})}}),g(p,{spacing:"$2",get children(){return[g(h,{colorScheme:"accent",onClick:S,get loading(){return $()||B()||R()},get children(){return t("global.refresh")}}),g(h,{get loading(){return I()},onClick:async()=>{const e=await D();u(e,async()=>{d.success(t("global.save_success")),m(await a.get("/public/settings"),b)})},get children(){return t("global.save")}}),g(h,{colorScheme:"warning",get loading(){return $()||B()||R()},onClick:async()=>{const e=await q();u(e,e=>{d.info(t("manage.load_default_setting_success")),C(e)})},get children(){return t("manage.load_default_setting")}})]}})]}})})}}});
