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,i,o,c,_,p,b,g,m,v,f,x,y,h,j,w,D,$,U;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,i=e.P,o=e.a0,c=e.r,_=e.e,p=e.c,b=e.a2,g=e.V,m=e.a3,v=e.W,f=e.S,x=e.U,y=e.j,h=e.a4,j=e.N},null,e=>{w=e.g},e=>{D=e.dR,$=e.au,U=e.dV},null,null,null,null,null,null],execute:function(){const a={class:"w-240px"},k={class:"w-240px"},q={class:"w-240px"},R={class:"w-240px"},C={class:"ml-8px"};e("default",d({__name:"index",setup(e,{expose:d}){const{t:E}=i(),S=s(),{remoteList:V}=o(S),W=c(null),H=_({sid:V.value.length>0?V.value[0].id:null,name:"",db_user:"",password:"",active:!1,ssl:""}),L=p(()=>V.value.map(e=>({label:`${e.ps} (${e.db_host})`,value:e.id}))),N={name:{required:!0,message:E("Database.form.index_15"),trigger:["blur","change"]},db_user:{required:!0,message:E("Database.form.index_16"),trigger:["blur","change"]},password:{required:!0,message:E("Database.form.index_17"),trigger:["blur","change"]},sid:{trigger:"change",validator:(e,a)=>null!==a||new Error(E("Database.form.index_18"))}},P=e=>{H.db_user=e},z=()=>{w()};return d({onConfirm:async({hide:e})=>{try{await(W.value?.validate());const a=(()=>{const{sid:e}=H;if(null===e)throw n.error(E("Database.form.index_18")),new Error(E("Database.form.index_18"));return{...j(H),sid:e,ps:H.name}})();await r(S.type,a),S.setRefresh(!0),e()}catch(a){console.error(a)}}}),(e,s)=>{const r=$,n=D,d=u,i=U,o=t,c=l;return g(),b(c,{ref_key:"formRef",ref:W,model:x(H),rules:N,class:"p-20px"},{default:m(()=>[v(n,{label:e.$t("Database.index_12"),path:"name"},{default:m(()=>[f("div",a,[v(r,{value:x(H).name,"onUpdate:value":[s[0]||(s[0]=e=>x(H).name=e),P],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",k,[v(r,{value:x(H).db_user,"onUpdate:value":s[1]||(s[1]=e=>x(H).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",q,[v(d,{value:x(H).password,"onUpdate:value":s[2]||(s[2]=e=>x(H).password=e),placeholder:""},null,8,["value"])])]),_:1},8,["label"]),v(n,{label:e.$t("Database.form.index_9"),path:"sid"},{default:m(()=>[f("div",R,[v(i,{value:x(H).sid,"onUpdate:value":s[3]||(s[3]=e=>x(H).sid=e),options:x(L)},null,8,["value","options"])]),f("div",C,[v(o,{onClick:z},{default:m(()=>[y(h(e.$t("Database.form.index_10")),1)]),_:1})])]),_:1},8,["label"])]),_:1},8,["model"])}}}))}}});
