import{_ as U}from"./index-DIKmrNCq.js?v=1773287522785";import{_ as D}from"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import{k as F,R as P,r as f,$ as j,Z as A,_ as c,a0 as n,ai as E,X as L,S as p,a9 as i,j as m,aa as l}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{n as N,m as g,p as v,ht as I,h as K}from"./index-BTglIPU2.js?v=1773287522785";import{u as R}from"./useTableColumns-DDeyYvje.js?v=1773287522785";import{u as V}from"./useTableData-BmkIKQ_R.js?v=1773287522785";import{K as M,L as T,M as O,N as X,O as Z}from"./setting-DouXuJGW.js?v=1773287522785";import{_ as y}from"./index-CZps0rIN.js?v=1773287522785";import{b as q,B as z,k as G}from"./naive-ui--dJnpVcV.js?v=1773287522785";import"./data-BVsViUMm.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./index-S15tYq5l.js?v=1773287522785";import"./copy-D-wIKr0q.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DeTfbeeM.js?v=1773287522785";import"./index-Cg6fMjw6.js?v=1773287522785";const H={class:"p-20px"},J={class:"flex mb-16px"},Q={class:"flex-1 mr-16px"},b="uri_find",dt=F({__name:"config",setup(Y){const{t:a}=P(),e=f(""),_=async()=>{if(e.value.trim()===""){g.error(a("Waf.Setting.config_176"));return}await O({url_find:e.value}),e.value="",s()},h=()=>{const t=f("");v({title:a("Waf.Setting.config_177"),width:440,footer:!0,content:()=>n("div",{class:"p-20px"},[n(y,{value:t.value,"onUpdate:value":o=>t.value=o,rows:14,placeholder:a("Waf.Setting.config_178")},null)]),onConfirm:async()=>{if(t.value.trim()==="")return g.error(a("Waf.Setting.config_179")),!1;await X({pdata:t.value,json:1}),s()}})},w=()=>{const t=f(r.data.map(o=>o.url).join("\n"));v({title:a("Waf.Setting.config_177"),width:440,footer:!0,content:()=>n("div",{class:"p-20px"},[n(y,{value:t.value,"onUpdate:value":o=>t.value=o,rows:14,readonly:!0},null)]),onConfirm:()=>(I(t.value,"".concat(b,".json")),!1)})},C=()=>{K({title:a("Waf.Setting.config_180"),content:a("Waf.Setting.config_181"),onConfirm:async()=>{await Z({type:b}),s()}})},{table:r,columns:S,setLoading:d}=V([{key:"url",title:"URL"},R({width:80,options:t=>[{label:a("Public.Btn.Del"),onClick:async()=>{await M({url_find:t.url}),s()}}]})]),s=async()=>{try{d(!0);const{message:t}=await T();N(t)&&(r.data=t.map(o=>({url:o})))}finally{d(!1)}};return s(),(t,o)=>{const k=q,u=z,x=D,B=G,W=U;return j(),A("div",H,[c("div",J,[c("div",Q,[n(k,{value:p(e),"onUpdate:value":o[0]||(o[0]=$=>L(e)?e.value=$:null),placeholder:t.$t("Waf.Setting.config_173"),onKeyup:E(_,["enter"])},null,8,["value","placeholder"])]),n(u,{type:"primary",onClick:_},{default:i(()=>[m(l(t.$t("Public.Btn.Add")),1)]),_:1})]),n(x,{"max-height":258,loading:p(r).loading,data:p(r).data,columns:p(S)},null,8,["loading","data","columns"]),n(B,{class:"mt-16px"},{default:i(()=>[n(u,{onClick:h},{default:i(()=>[m(l(t.$t("Public.Btn.Import")),1)]),_:1}),n(u,{onClick:w},{default:i(()=>[m(l(t.$t("Public.Btn.Export")),1)]),_:1}),n(u,{onClick:C},{default:i(()=>[m(l(t.$t("Public.Btn.Empty")),1)]),_:1})]),_:1}),n(W,{class:"mt-16px"},{default:i(()=>[c("li",null,l(t.$t("Waf.Setting.config_174")),1),c("li",null,l(t.$t("Waf.Setting.config_175")),1)]),_:1})])}}});export{dt as default};
