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