import{am as e,c as a,o as l,aY as s,d$ as u,p as d}from"./page_layout.js?v=1763625242172";import{k as t,ad as i,am as n,ae as o,R as p,a2 as c,a3 as r,X as v,H as _,U as m,an as f,S as k,j as x,a4 as b}from"./vue.js?v=1763625242172";import{au as h,aC as S,aZ as g,_ as y,dh as L,d9 as U}from"./naive.js?v=1763625242172";const $={key:1,class:"text-desc"},C=d(t({__name:"domain-input",props:i({is_wp:{type:Boolean,default:!1}},{value:{required:!0},valueModifiers:{},parseList:{required:!0},parseListModifiers:{}}),emits:i(["update:domain"],["update:value","update:parseList"]),setup(d,{expose:t,emit:i}){const C=d,w=n(),j=o(d,"value"),B=o(d,"parseList"),D=i,M=async(l,s)=>{if(0===s&&D("update:domain",l),!(null==l?void 0:l.trim()))return void(B.value[s]&&B.value.splice(s,1));const{message:u}=await e({domain:l});a(u)&&j.value[s]&&(B.value[s]={...u,auto:u.support.includes("auto"),ssl_cert:u.support.includes("ssl_cert"),cf_proxy:u.support.includes("cf_proxy")})},q=()=>{w.push("/ssl_domain/domain")};return t({onDomainItemBlur:M}),(e,a)=>{const d=h,t=S,i=g,n=y,o=l,w=L,I=s,H=U,R=u;return p(),c(R,{value:j.value,"onUpdate:value":a[0]||(a[0]=e=>j.value=e)},{default:r((({index:a})=>[v(d,{class:_(C.is_wp?"w-200px!":"w-140px!"),value:j.value[a],"onUpdate:value":e=>j.value[a]=e,placeholder:e.$t("Mail.Setting.index_20"),onBlur:e=>M(j.value[a],a)},null,8,["class","value","onUpdate:value","placeholder","onBlur"])])),action:r((({index:l})=>[v(H,{class:"items-center ml-5px"},{default:r((()=>{var s;return[C.is_wp?f("",!0):(p(),c(i,{key:0},{default:r((()=>[v(t,{onClick:e=>(e=>{j.value.splice(e,1),B.value.splice(e,1),0===e&&D("update:domain",j.value[0]?j.value[0]:"")})(l),disabled:1===j.value.length,round:""},{default:r((()=>a[1]||(a[1]=[m("span",null,"-",-1)]))),_:2,__:[1]},1032,["onClick","disabled"]),v(t,{onClick:e=>(e=>{j.value.splice(e+1,0,""),B.value.splice(e+1,0,{})})(l),round:""},{default:r((()=>a[2]||(a[2]=[m("span",null,"+",-1)]))),_:2,__:[2]},1032,["onClick"])])),_:2},1024)),(null==(s=B.value[l])?void 0:s.support)?(p(),k("span",$,[v(I,null,{default:r((()=>[v(w,{trigger:"hover",disabled:B.value[l].support.includes("auto")},{trigger:r((()=>[v(n,{checked:B.value[l].auto,"onUpdate:checked":e=>B.value[l].auto=e,disabled:!B.value[l].support.includes("auto"),label:e.$t("SSL.Domain.index_34")},null,8,["checked","onUpdate:checked","disabled","label"])])),default:r((()=>[m("div",null,[x(b(e.$t("SSL.index_5"))+" ",1),v(o,{onClick:q},{default:r((()=>[x(b(e.$t("SSL.index_4")),1)])),_:1})])])),_:2},1032,["disabled"]),v(w,{trigger:"hover",disabled:B.value[l].support.includes("ssl_cert")},{trigger:r((()=>[v(n,{checked:B.value[l].ssl_cert,"onUpdate:checked":e=>B.value[l].ssl_cert=e,disabled:!B.value[l].support.includes("ssl_cert"),label:e.$t("SSL.index_7")},null,8,["checked","onUpdate:checked","disabled","label"])])),default:r((()=>[m("div",null,[x(b(e.$t("SSL.index_6"))+" ",1),v(o,{onClick:q},{default:r((()=>[x(b(e.$t("SSL.index_4")),1)])),_:1})])])),_:2},1032,["disabled"]),B.value[l].support.includes("cf_proxy")?(p(),c(n,{key:0,checked:B.value[l].cf_proxy,"onUpdate:checked":e=>B.value[l].cf_proxy=e,disabled:!B.value[l].support.includes("cf_proxy"),label:e.$t("SSL.index_8")},null,8,["checked","onUpdate:checked","disabled","label"])):f("",!0)])),_:2},1024)])):f("",!0)]})),_:2},1024)])),_:1},8,["value"])}}}),[["__scopeId","data-v-4f4b9d13"]]);export{C as D};
