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