import{_ as b}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{_ as x}from"./index.vue_vue_type_script_setup_true_lang-DG86e1NA.js?v=1773287522785";import{gq as v,gr as y,i as D,ao as R}from"./index-BTglIPU2.js?v=1773287522785";import{u as h}from"./index-B5d4M70B.js?v=1773287522785";import{u as k}from"./useLoading-CZ2gSAW7.js?v=1773287522785";import{k as $,R as B,r as C,e as E,$ as N,Z as S,a0 as e,a9 as m,_ as L,S as t,N as V}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{a1 as j}from"./naive-ui--dJnpVcV.js?v=1773287522785";import"./index-K4YGya6V.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";const q={class:"px-20px pt-24px pb-8px"},I={class:"w-280px"},P=$({__name:"index",setup(O,{expose:l}){const{t:r}=B(),n=h(),i=C(null),a=E({password:""}),_={password:{trigger:["blur","input"],validator:()=>a.password?a.password.length<6?new Error(r("Database.form.index_20")):!0:new Error(r("Database.form.index_17"))}},d=async({hide:s})=>{var o;await((o=i.value)==null?void 0:o.validate()),await v(n.type,V(a)),s()},{loading:f,setLoading:p}=k();return(async()=>{try{p(!0);const{message:s}=await y(n.type);D(s)&&(a.password=R(s.result)?s.result:"")}finally{p(!1)}})(),l({onConfirm:d}),(s,o)=>{const u=x,c=j,w=b;return N(),S("div",q,[e(w,{ref_key:"formRef",ref:i,model:t(a),rules:_},{default:m(()=>[e(c,{label:s.$t("Database.tools.index_75"),path:"password"},{default:m(()=>[L("div",I,[e(u,{value:t(a).password,"onUpdate:value":o[0]||(o[0]=g=>t(a).password=g),loading:t(f),default:!1,"input-props":{name:"password"}},null,8,["value","loading"])])]),_:1},8,["label"])]),_:1},8,["model"])])}}});export{P as default};
