System.register(["./page_layout-legacy.js?v=1763625242172","./index-legacy.js?v=1763625242172","./public-legacy.js?v=1763625242172","./index.vue_vue_type_script_setup_true_lang-legacy5.js?v=1763625242172","./naive-legacy.js?v=1763625242172","./vue-legacy.js?v=1763625242172","./common-legacy.js?v=1763625242172","./__commonjsHelpers__-legacy.js?v=1763625242172","./index.vue_vue_type_script_setup_true_lang-legacy6.js?v=1763625242172"],(function(t,e){"use strict";var i,a,n,s,o,l,d,c,u,r,m,_,y,p,f,h,g,C,x,w,W,j,b,v,k,E,O,P,$,S,B,R;return{setters:[t=>{i=t.dN,a=t.dO,n=t.dP,s=t.g,o=t.dQ,l=t.dR,d=t.c,c=t.a},t=>{u=t._},t=>{r=t.e,m=t.c,_=t.n,y=t.f,p=t.a,f=t.h,h=t._},t=>{g=t._},t=>{C=t.dd,x=t.dS,w=t.aC},t=>{W=t.k,j=t.P,b=t.X,v=t.R,k=t.a2,E=t.a3,O=t.u,P=t.j,$=t.a4,S=t.V,B=t.U,R=t._},null,null,null],execute:function(){t("default",W({__name:"index",setup(t){const W=R((()=>c((()=>e.import("./index-legacy231.js?v=1763625242172")),void 0))),{t:V}=j(),L=i(),N=r("",{isEdit:!1,onRefresh:()=>{Q()}}),U=()=>{N.data.isEdit=!1,N.data.row=void 0,N.title=V("Waf.Custom.index_4"),N.show=!0},{table:z,columns:A,setLoading:D}=m([{key:"name",title:V("Waf.Custom.index_6"),minWidth:160,ellipsis:{tooltip:!0}},{key:"servers",title:V("Waf.Custom.index_7"),width:"20%",minWidth:260,ellipsis:{tooltip:!0},render:({servers:t})=>L.getSiteName(t)},_({width:"10%",minWidth:100,status:t=>({checkedValue:1,uncheckedValue:0,onClick:async e=>{await a({id:t.id,status:e}),t.status=e}})}),{key:"hit",title:V("Waf.Custom.index_8"),width:"10%",minWidth:100,render:({hit:t})=>{return b(C,{size:"small",type:t>0?"success":"default",bordered:!1},"function"==typeof(e=t)||"[object Object]"===Object.prototype.toString.call(e)&&!O(e)?t:{default:()=>[t]});var e}},{key:"root",title:V("Waf.Custom.index_9"),width:"20%",minWidth:160,render:({root:t})=>L.getMatchCondition(t)},{key:"action",title:V("Waf.Custom.index_10"),width:"20%",minWidth:160,render:({action:t})=>L.getExecuteAction(t.type,t.response?.type||"")},y({width:140,options:t=>[{label:V("Public.Btn.Copy"),onClick:()=>{H(t)}},{label:V("Public.Btn.Edit"),onClick:()=>{(t=>{N.data.isEdit=!0,N.data.row=t,N.title=V("Waf.Custom.index_5",[t.name]),N.show=!0})(t)}},{label:V("Public.Btn.Del"),onClick:()=>{M(t)}}]})]),H=t=>{p({title:V("Waf.Custom.index_11",[t.name]),content:V("Waf.Custom.index_12"),onConfirm:async()=>{await n({name:`${t.name}_copy_${s(6)}`,servers:t.servers?t.servers:[],status:1,is_global:0,priority:0,root:t.root,action:{type:t.action.type,response:Object.assign({},t.action.response,{headers:{}})}}),Q()}})},M=t=>{p({title:V("Waf.Custom.index_13",[t.name]),content:V("Waf.Custom.index_14"),onConfirm:async()=>{await o({id:t.id}),Q()}})},Q=async()=>{try{D(!0);const{message:t}=await l();d(t)&&t.rules&&(z.data=Object.entries(t.rules).map((([t,e])=>({...e,id:t}))))}finally{D(!1)}};return(async()=>{try{D(!0),await L.getConfig(),await Q()}finally{D(!1)}})(),(t,e)=>{const i=w,a=f,n=g,s=h,o=u,l=x;return v(),k(l,{class:"p-16px"},{default:E((()=>[b(n,null,{toolsLeft:E((()=>[b(i,{type:"primary",onClick:U},{default:E((()=>[P($(t.$t("Waf.Custom.index_1")),1)])),_:1})])),table:E((()=>[b(a,{loading:S(z).loading,data:S(z).data,columns:S(A)},null,8,["loading","data","columns"])])),_:1}),b(s,{class:"mt-20px"},{default:E((()=>[B("li",null,$(t.$t("Waf.Custom.index_2")),1),B("li",null,$(t.$t("Waf.Custom.index_3")),1)])),_:1}),b(o,{show:S(N).show,"onUpdate:show":e[0]||(e[0]=t=>S(N).show=t),title:S(N).title,data:S(N).data,width:800,"min-height":448,footer:!0,component:S(W)},null,8,["show","title","data","component"])])),_:1})}}}))}}}));
