System.register(["./index.vue_vue_type_script_setup_true_lang-legacy.js?v=1764233927359","./page_layout-legacy.js?v=1764233927359","./index.vue_vue_type_script_setup_true_lang-legacy2.js?v=1764233927359","./vue-legacy.js?v=1764233927359","./public-legacy.js?v=1764233927359","./index-legacy131.js?v=1764233927359","./naive-legacy.js?v=1764233927359","./common-legacy.js?v=1764233927359","./__commonjsHelpers__-legacy.js?v=1764233927359","./index-legacy98.js?v=1764233927359","./index-legacy132.js?v=1764233927359","./soft-legacy.js?v=1764233927359","./site-legacy.js?v=1764233927359"],function(e,a){"use strict";var l,s,t,r,n,u,d,o,i,c,_,p,b,g,v,m,x,f,y,h,j,w,D,$,U,k,q;return{setters:[e=>{l=e._},e=>{s=e.bn,t=e.o,r=e.eW,n=e.m},e=>{u=e._},e=>{d=e.k,o=e.P,i=e.a0,c=e.r,_=e.e,p=e.c,b=e.a2,g=e.V,v=e.a3,m=e.W,x=e.l,f=e.S,y=e.U,h=e.v,j=e.j,w=e.a4,D=e.N},null,e=>{$=e.g},e=>{U=e.dR,k=e.au,q=e.dV},null,null,null,null,null,null],execute:function(){const a={class:"w-240px"},R={class:"w-240px"},C={class:"w-240px"},E={class:"w-240px"},S={class:"ml-8px"};e("default",d({__name:"index",props:{data:{}},setup(e,{expose:d}){const{t:V}=o(),W=e,{status:H}=W.data,L=s(),{remoteList:N}=i(L),P=c(null),z=_({sid:N.value.length>0?N.value[0].id:null,name:"",db_user:"",password:"",active:!1,ssl:""}),A=p(()=>N.value.map(e=>({label:`${e.ps} (${e.db_host})`,value:e.id}))),B={name:{required:!0,message:V("Database.form.index_15"),trigger:["blur","change"]},db_user:{required:!0,message:V("Database.form.index_16"),trigger:["blur","change"]},password:{required:!0,message:V("Database.form.index_17"),trigger:["blur","change"]},sid:{trigger:"change",validator:(e,a)=>null!==a||new Error(V("Database.tools.index_64"))}},F=e=>{z.db_user=e},G=()=>{$()};return d({onConfirm:async({hide:e})=>{try{await(P.value?.validate());const a=(()=>{const{sid:e}=z;if(null===e)throw n.error(V("Database.tools.index_64")),new Error(V("Database.tools.index_64"));return{...D(z),sid:e,ps:z.name}})();await r(L.type,a),L.setRefresh(!0),e()}catch(a){console.error(a)}}}),(e,s)=>{const r=k,n=U,d=u,o=q,i=t,c=l;return g(),b(c,{ref_key:"formRef",ref:P,model:y(z),rules:B,class:"p-20px"},{default:v(()=>[m(n,{label:e.$t("Database.index_12"),path:"name"},{default:v(()=>[f("div",a,[m(r,{value:y(z).name,"onUpdate:value":[s[0]||(s[0]=e=>y(z).name=e),F],placeholder:e.$t("Database.form.index_2")},null,8,["value","placeholder"])])]),_:1},8,["label"]),x(m(n,{label:e.$t("Database.index_13"),path:"db_user"},{default:v(()=>[f("div",R,[m(r,{value:y(z).db_user,"onUpdate:value":s[1]||(s[1]=e=>y(z).db_user=e),placeholder:e.$t("Database.form.index_4")},null,8,["value","placeholder"])])]),_:1},8,["label"]),[[h,y(H)]]),x(m(n,{label:e.$t("Database.index_14"),path:"password"},{default:v(()=>[f("div",C,[m(d,{value:y(z).password,"onUpdate:value":s[2]||(s[2]=e=>y(z).password=e)},null,8,["value"])])]),_:1},8,["label"]),[[h,y(H)]]),m(n,{label:e.$t("Database.form.index_9"),path:"sid"},{default:v(()=>[f("div",E,[m(o,{value:y(z).sid,"onUpdate:value":s[3]||(s[3]=e=>y(z).sid=e),options:y(A)},null,8,["value","options"])]),f("div",S,[m(i,{onClick:G},{default:v(()=>[j(w(e.$t("Database.form.index_10")),1)]),_:1})])]),_:1},8,["label"])]),_:1},8,["model"])}}}))}}});
