System.register(["./public-legacy.js?v=1763625242172","./page_layout-legacy.js?v=1763625242172","./setting-legacy.js?v=1763625242172","./naive-legacy.js?v=1763625242172","./vue-legacy.js?v=1763625242172","./common-legacy.js?v=1763625242172","./__commonjsHelpers__-legacy.js?v=1763625242172"],(function(e,l){"use strict";var a,t,n,i,u,s,c,r,o,d,p,g,f,m,y,v,V,_,x,h,S,b,w,j,k,W,C,E,P,B,N;return{setters:[e=>{a=e.c,t=e.f,n=e.a,i=e.h,u=e._},e=>{s=e.x,c=e.m},e=>{r=e.f,o=e.m,d=e.h,p=e.i,g=e.j},e=>{f=e.au,m=e.dj,y=e.aC},e=>{v=e.k,V=e.t,_=e.P,x=e.e,h=e.r,S=e.X,b=e.F,w=e.n,j=e.R,k=e.S,W=e.U,C=e.V,E=e.a3,P=e.j,B=e.a4,N=e.N},null,null],execute:function(){const l={class:"p-20px"},U={class:"flex mb-12px"},$={class:"flex-1 mr-12px"},z={class:"w-150px mr-12px"},D={class:"text-error"};e("default",v({__name:"index",props:{type:{}},setup(e,{expose:v}){const R=V(e,"type"),{t:A}=_(),F=x({ruleValue:"",ps:""}),H=async()=>{""!==F.ruleValue.trim()?(await g({...N(F),ruleName:R.value}),Q(),F.ruleValue="",F.ps=""):c.error(A("Waf.Setting.config_194"))},L=h(null),X=h(null),{table:q,columns:G,setLoading:I}=a([{key:"rule",title:A("Waf.Setting.config_82"),render:e=>S(b,null,[e.isEdit?S(f,{ref:L,value:e.ruleVal,size:"small",type:"textarea",autosize:{minRows:2,maxRows:2},placeholder:"",onUpdateValue:l=>{e.ruleVal=l}},null):e.rule])},{key:"ps",title:A("Waf.Setting.config_190"),width:150,render:e=>S(b,null,[e.isEdit?S(f,{ref:X,value:e.psVal,size:"small",placeholder:"",onUpdateValue:l=>{e.psVal=l}},null):e.ps])},{key:"status",title:A("Waf.Setting.config_82"),width:60,render:(e,l)=>S(m,{value:e.status,size:"small",checkedValue:1,uncheckedValue:0,onUpdateValue:async a=>{await r({index:l,ruleName:R.value}),e.status=a}},null)},t({width:100,options:(e,l)=>e.isEdit?[{label:A("Public.Btn.Save"),onClick:()=>{K(e,l)}},{label:A("Public.Btn.Cancel"),onClick:()=>{M(e)}}]:[{label:A("Public.Btn.Edit"),onClick:()=>{J(e)}},{label:A("Public.Btn.Del"),show:e.isDel,onClick:()=>{O(e,l)}}]})]),J=e=>{e.isEdit=!0,w((()=>{L.value?.focus()}))},K=async(e,l)=>{e.isEdit=!1,await o({index:l,ruleBody:e.ruleVal,rulePs:e.psVal,ruleName:R.value}),e.rule=e.ruleVal,e.ps=e.psVal},M=e=>{e.isEdit=!1,e.ruleVal=e.rule,e.psVal=e.ps},O=async(e,l)=>{n({title:A("Waf.Setting.config_195",[e.rule]),content:A("Waf.Setting.config_196"),onConfirm:async()=>{await d({index:l,ruleName:R.value}),Q()}})},Q=async()=>{try{I(!0);const{message:e}=await p({ruleName:R.value});s(e)&&(q.data=e.map((e=>({rule:e[1],ruleVal:e[1],ps:e[2],psVal:e[2],status:e[0],isEdit:!1,isDel:1===e[3]}))))}finally{I(!1)}};return Q(),v({init:Q}),(e,a)=>{const t=y,n=i,s=u;return j(),k("div",l,[W("div",U,[W("div",$,[S(C(f),{value:C(F).ruleValue,"onUpdate:value":a[0]||(a[0]=e=>C(F).ruleValue=e),placeholder:e.$t("Waf.Setting.config_189")},null,8,["value","placeholder"])]),W("div",z,[S(C(f),{value:C(F).ps,"onUpdate:value":a[1]||(a[1]=e=>C(F).ps=e),placeholder:e.$t("Waf.Setting.config_190")},null,8,["value","placeholder"])]),S(t,{type:"primary",onClick:H},{default:E((()=>[P(B(e.$t("Public.Btn.Add")),1)])),_:1})]),S(n,{"max-height":340,loading:C(q).loading,data:C(q).data,columns:C(G)},null,8,["loading","data","columns"]),S(s,{class:"mt-16px"},{default:E((()=>[W("li",D,B(e.$t("Waf.Setting.config_191")),1),W("li",null,B(e.$t("Waf.Setting.config_192")),1),W("li",null,B(e.$t("Waf.Setting.config_193")),1)])),_:1})])}}}))}}}));
