import{d as e,r as a,l as r,m as s,$ as t,c as o,bM as l,p as n,x as i,y as d}from"./main-DKqTMGci.js";import{u as p,k as m}from"./index-DffoH-R8.js";import{r as u}from"./verify-Ccmvvliy.js";import{D as v}from"./index-DpMxWTvF.js";import"./index-K1QYmvkf.js";import"./index-DoBLtCBk.js";import"./test-BLZVy0JC.js";import"./useStore-fO20gUdJ.js";import"./business-DeShhBC1.js";import"./useStore-BxWZ-2Xk.js";import"./setting-huTIIu1c.js";import"./index-CpnxPwGt.js";import"./index-ClL52y7R.js";import"./text-CBxeXF61.js";import"./Flex-CfuRT3n6.js";const _=e({name:"ApplyNodeDrawer",props:{node:{type:Object,default:()=>({id:"",config:{domains:"",email:"",provider_id:"",provider:"",end_day:30,name_server:"",skip_check:1}})}},setup(e){const{updateNodeConfig:_,isRefreshNode:c}=p(),{confirm:j}=d(),{useFormInput:y,useFormHelp:f,useFormSwitch:h}=s(),x=a(m(e.node.config)),g=r((()=>[y(t("t_17_1745227838561"),"domains",{placeholder:t("t_0_1745735774005"),onInput:e=>{x.value.domains=e.trim(),x.value.domains=x.value.domains.replace(/，/g,","),x.value.domains=x.value.domains.replace(/;/g,",")},onFocus:()=>{x.value.domains=x.value.domains.replace(/,^/g,"")}}),y(t("t_1_1745735764953"),"email",{placeholder:t("t_2_1745735773668"),onInput:e=>x.value.email=e.trim()}),{type:"custom",render:()=>o(v,{type:"dns",path:"provider_id",value:x.value.provider_id,"onUpdate:value":e=>{x.value.provider_id=e.value,x.value.provider=e.type}},null)},{type:"custom",render:()=>o(n,{label:t("t_5_1745735769112"),path:"end_day"},{default:()=>[o(l,{value:x.value.end_day,"onUpdate:value":e=>x.value.end_day=e,showButton:!1,min:1,class:"w-[180px]",placeholder:t("t_6_1745735765205")},null),o("span",{class:"text-[1.4rem] ml-[1.2rem]"},[t("t_7_1745735768326")])]})},y(t("t_0_1747106957037"),"name_server",{placeholder:t("t_1_1747106961747"),onInput:e=>{x.value.name_server=e.trim(),x.value.name_server=x.value.name_server.replace(/，/g,","),x.value.name_server=x.value.name_server.replace(/;/g,",")},onFocus:()=>{x.value.name_server=x.value.name_server.replace(/,^/g,"")}},{showRequireMark:!1}),h(t("t_2_1747106957037"),"skip_check",{},{showRequireMark:!1}),f([{content:t("t_0_1747040228657"),isHtml:!1},{content:t("t_1_1747040226143"),isHtml:!1}])])),{component:w,data:k,example:F}=i({defaultValue:x,config:g,rules:u});return j((async a=>{var r;try{await(null==(r=F.value)?void 0:r.validate()),_(e.node.id,k.value),c.value=e.node.id,a()}catch(s){}})),()=>o("div",{class:"apply-node-drawer"},[o(w,{labelPlacement:"top"},null)])}});export{_ as default};
