import{b as a,h as t,u as n,d as l,f as e,_ as o}from"./public.js?v=1753954525509";import{k as i,P as s,r,U as u,V as c,W as f,Q as p,X as d,ah as m,at as g,a2 as _,j as v,a3 as y}from"./vue.js?v=1753954525509";import{w as j,m as x,g4 as b}from"./page_layout.js?v=1753954525509";import{K as w,L as W,M as h,N as S,O as C}from"./setting.js?v=1753954525509";import{_ as k}from"./index100.js?v=1753954525509";import{aq as $,ay as P,bY as B}from"./naive.js?v=1753954525509";import"./common.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";const U={class:"p-20px"},L={class:"flex mb-16px"},E={class:"flex-1 mr-16px"},K="uri_find",q=i({__name:"config",setup(i){const{t:q}=s(),A=r(""),D=async()=>{""!==A.value.trim()?(await h({url_find:A.value}),A.value="",R()):x.error(q("Waf.Setting.config_176"))},H=()=>{const a=r("");n({title:q("Waf.Setting.config_177"),width:440,footer:!0,content:()=>p("div",{class:"p-20px"},[p(k,{value:a.value,"onUpdate:value":t=>a.value=t,rows:14,placeholder:q("Waf.Setting.config_178")},null)]),onConfirm:async()=>{if(""===a.value.trim())return x.error(q("Waf.Setting.config_179")),!1;await S({pdata:a.value,json:1}),R()}})},I=()=>{const a=r(N.data.map((a=>a.url)).join("\n"));n({title:q("Waf.Setting.config_177"),width:440,footer:!0,content:()=>p("div",{class:"p-20px"},[p(k,{value:a.value,"onUpdate:value":t=>a.value=t,rows:14,readonly:!0},null)]),onConfirm:()=>(b(a.value,"".concat(K,".json")),!1)})},M=()=>{l({title:q("Waf.Setting.config_180"),content:q("Waf.Setting.config_181"),onConfirm:async()=>{await C({type:K}),R()}})},{table:N,columns:O,setLoading:Q}=a([{key:"url",title:"URL"},t({width:80,options:a=>[{label:q("Public.Btn.Del"),onClick:async()=>{await w({url_find:a.url}),R()}}]})]),R=async()=>{try{Q(!0);const{message:a}=await W();j(a)&&(N.data=a.map((a=>({url:a}))))}finally{Q(!1)}};return R(),(a,t)=>{const n=$,l=P,i=e,s=B,r=o;return u(),c("div",U,[f("div",L,[f("div",E,[p(n,{value:d(A),"onUpdate:value":t[0]||(t[0]=a=>m(A)?A.value=a:null),placeholder:a.$t("Waf.Setting.config_173"),onKeyup:g(D,["enter"])},null,8,["value","placeholder"])]),p(l,{type:"primary",onClick:D},{default:_((()=>[v(y(a.$t("Public.Btn.Add")),1)])),_:1})]),p(i,{"max-height":258,loading:d(N).loading,data:d(N).data,columns:d(O)},null,8,["loading","data","columns"]),p(s,{class:"mt-16px"},{default:_((()=>[p(l,{onClick:H},{default:_((()=>[v(y(a.$t("Public.Btn.Import")),1)])),_:1}),p(l,{onClick:I},{default:_((()=>[v(y(a.$t("Public.Btn.Export")),1)])),_:1}),p(l,{onClick:M},{default:_((()=>[v(y(a.$t("Public.Btn.Empty")),1)])),_:1})])),_:1}),p(r,{class:"mt-16px"},{default:_((()=>[f("li",null,y(a.$t("Waf.Setting.config_174")),1),f("li",null,y(a.$t("Waf.Setting.config_175")),1)])),_:1})])}}});export{q as default};
