System.register(["./index-legacy-DQdImDha.js?v=1773287522785","./index.vue_vue_type_script_setup_true_lang-legacy-BWPgT9-g.js?v=1773287522785","./index.vue_vue_type_script_setup_true_lang-legacy-IFFYkvEY.js?v=1773287522785","./useTableColumns-legacy-DP6ypvsQ.js?v=1773287522785","./useTableData-legacy-3kc3lnk4.js?v=1773287522785","./useModal-legacy-AHbfq87s.js?v=1773287522785","./naive-ui-legacy-BW82sq8q.js?v=1773287522785","./vue-core-legacy-Cn1vuJ3s.js?v=1773287522785"],(function(e,a){"use strict";var t,s,n,i,l,o,r,d,u,c,_,p,f,g,y,b,m,x,W,w,v,h,A,j,k;return{setters:[e=>{t=e.as,s=e.a3,n=e.v,i=e.n,l=e.x,o=e.P},e=>{r=e._},e=>{d=e._},e=>{u=e.u},e=>{c=e.u},e=>{_=e.u},e=>{p=e.a8,f=e.a6,g=e.B,y=e.a2},e=>{b=e.k,m=e.R,x=e.a0,W=e.$,w=e.a8,v=e.a9,h=e.S,A=e.j,j=e.aa,k=e.a3}],execute:function(){e("g",(()=>t.post("/plugin?action=a&name=btwaf&s=reg_domains"))),e("a",(e=>t.post("/plugin?action=a&name=btwaf&s=add_reg_tions",e,{requestOptions:{loading:s.global.t("Waf.Api.area_32"),successMessage:!0}})));const O=e=>t.post("/plugin?action=a&name=btwaf&s="+(0===e.select?"edit_reg_tions":"edit_city"),{id:e.id,open:e.open,status:e.status},{requestOptions:{loading:s.global.t("Waf.Api.area_34"),successMessage:!0}}),q=b({__name:"index",setup(e){const b=k((()=>o((()=>a.import("./index-legacy-Bxx375BY.js?v=1773287522785")),void 0))),{t:q}=m(),M=n(q("Waf.Area.index_1"),{onRefresh:()=>{T()}}),C=()=>{M.show=!0},{table:S,columns:z,setLoading:P}=c([{key:"region",title:q("Waf.Area.index_2"),minWidth:300,render:e=>Object.entries(e.region).filter((([,e])=>1==e)).map((([e])=>e)).join(", ")},{key:"open",title:q("Waf.Area.index_3"),minWidth:80,render:(e,a)=>x(p,{value:e.open,size:"small",onUpdateValue:async t=>{await O({select:e.select,id:a,open:t,status:e.status}),e.open=t}},null)},{key:"status",title:q("Waf.Area.index_4"),width:"14%",render:(e,a)=>x("div",{class:"w-210px"},[x(f,{value:e.status,size:"small",options:[{label:q("Waf.Area.index_5"),value:200},{label:q("Waf.Area.index_6"),value:404},{label:q("Waf.Area.index_7"),value:403},{label:q("Waf.Area.index_8"),value:444},{label:q("Waf.Area.index_9"),value:502},{label:q("Waf.Area.index_10"),value:503}],onUpdateValue:async t=>{await O({select:e.select,id:a,open:e.open,status:t}),e.status=t}},null)])},{key:"site",title:q("Waf.Area.index_11"),minWidth:260,render:e=>Object.entries(e.site).filter((([,e])=>1==e)).map((([e])=>"allsite"===e?q("Waf.Area.index_12"):e)).join(", ")},{key:"types",title:q("Waf.Area.index_13"),minWidth:90,render:e=>"refuse"===e.types?q("Waf.Area.index_15"):q("Waf.Area.index_14")},u({width:120,options:(e,a)=>[{label:q("Waf.Area.index_16"),onClick:()=>{_({path:`/www/server/btwaf/html/${e.reqfile}`})}},{label:q("Public.Btn.Del"),onClick:async()=>{var n;await(n={select:e.select,id:a},t.post("/plugin?action=a&name=btwaf&s="+(0===n.select?"del_reg_tions":"del_city"),{id:n.id},{requestOptions:{loading:s.global.t("Waf.Api.area_33"),successMessage:!0}})),T()}}]})]),T=async()=>{try{P(!0);const{message:e}=await t.post("/btwaf/get_reg_tions.json");i(e)&&(e.forEach(((e,a)=>{e.forEach((e=>{e.select=a}))})),S.data=e.reduce(((e,a)=>e.concat(a)),[]))}finally{P(!1)}};return T(),(e,a)=>{const t=g,s=d,n=r,i=l,o=y;return W(),w(o,{class:"p-16px"},{default:v((()=>[x(n,null,{toolsLeft:v((()=>[x(t,{type:"primary",onClick:C},{default:v((()=>[A(j(e.$t("Waf.Area.index_1")),1)])),_:1})])),table:v((()=>[x(s,{loading:h(S).loading,data:h(S).data,columns:h(z)},null,8,["loading","data","columns"])])),_:1}),x(i,{show:h(M).show,"onUpdate:show":a[0]||(a[0]=e=>h(M).show=e),title:h(M).title,data:h(M).data,width:720,"min-height":454,footer:!0,component:h(b)},null,8,["show","title","data","component"])])),_:1})}}}),M=Object.freeze(Object.defineProperty({__proto__:null,default:q},Symbol.toStringTag,{value:"Module"}));e("i",M)}}}));
