import{_ as a}from"./index.vue_vue_type_script_setup_true_lang.js?v=1764830988434";import{m as e,d as i}from"./page_layout.js?v=1764830988434";import{d as s}from"./public.js?v=1764830988434";import{c as n}from"./site.js?v=1764830988434";import{i as o}from"./index49.js?v=1764830988434";import{k as t,P as l,r,e as p,am as d,R as m,V as u,W as v,a3 as _,S as c,a2 as f,an as g,U as h,j,a4 as x,F as b}from"./vue.js?v=1764830988434";import{dR as y,av as w,au as M,dZ as S,dV as k}from"./naive.js?v=1764830988434";import"./common.js?v=1764830988434";import"./__commonjsHelpers__.js?v=1764830988434";import"./index.js?v=1764830988434";import"./index.vue_vue_type_script_setup_true_lang5.js?v=1764830988434";import"./index.vue_vue_type_script_setup_true_lang6.js?v=1764830988434";import"./index.vue_vue_type_script_setup_true_lang7.js?v=1764830988434";import"./mail.js?v=1764830988434";const P={class:"p-20px pt-24px pb-8px"},W={class:"w-240px"},R={class:"w-240px"},U=t({__name:"install",props:{domain:{type:Object}},emits:["refresh"],setup(t,{expose:U,emit:C}){const E=C,{t:H}=l(),I=r(null),V=p({domain:"",php_version:null}),$={domain:{trigger:"change",validator:()=>""!==V.domain.trim()||new Error(H("Mail.Setting.index_20"))},php_version:{trigger:"change",validator:()=>null!==V.php_version||new Error(H("Mail.Setting.index_21"))}},F=r([]),L=async()=>{const{message:a}=await n();if(i(a)){F.value=a.versions.reverse().map(a=>({label:a.name,value:a.version}));const e=a.versions.findIndex(a=>"74"===a.version);V.php_version=-1!==e?a.versions[e].version:a.versions[0].version}},{loading:O,setLoading:Z}=s(),q=d();return(async()=>{try{Z(!0),await Promise.all([L()])}finally{Z(!1)}})(),U({onConfirm:async()=>{var a,i,s;await(null==(a=I.value)?void 0:a.validate()),await o({webmail_domain:"".concat(V.domain,".").concat((null==(i=t.domain)?void 0:i.domain)||""),php_version:V.php_version||"",domain:(null==(s=t.domain)?void 0:s.domain)||""});const{close:n}=e.success({content:()=>v(b,null,[j("WebMail Installation Successful, "),v("br",null,null),j(' Manage WebMail view in "'),v("a",{class:"bt-link",href:"javascript:;",onClick:()=>{q.push("/site/php"),n()}},[j("Website > PHP Project")]),j('"')]),close:!0,maxWidth:480});E("refresh")}}),(e,i)=>{const s=M,n=S,o=w,l=y,r=k,p=a;return u(),m("div",P,[v(p,{ref_key:"formRef",ref:I,model:h(V),rules:$},{default:_(()=>[v(l,{label:e.$t("Mail.Setting.index_18"),path:"domain"},{default:_(()=>[c("div",W,[v(o,null,{default:_(()=>{var a;return[v(s,{value:h(V).domain,"onUpdate:value":i[0]||(i[0]=a=>h(V).domain=a)},null,8,["value"]),(null==(a=t.domain)?void 0:a.domain)?(u(),f(n,{key:0},{default:_(()=>{var a;return[j(" ."+x(null==(a=t.domain)?void 0:a.domain),1)]}),_:1})):g("",!0)]}),_:1})])]),_:1},8,["label"]),v(l,{label:e.$t("Mail.Setting.index_19"),path:"php_version"},{default:_(()=>[c("div",R,[v(r,{value:h(V).php_version,"onUpdate:value":i[1]||(i[1]=a=>h(V).php_version=a),loading:h(O),options:h(F)},null,8,["value","loading","options"])])]),_:1},8,["label"])]),_:1},8,["model"])])}}});export{U as default};
