import{d as e,r as o,x as r,$ as t,e as i,G as s,H as a}from"./main-DVBEmEFd.js";import{u as d}from"./index-BUF9qwGu.js";import{u as p}from"./index-sztGZ9nB.js";import{N as n}from"./index-CYK7pPtA.js";import{r as l}from"./verify-B7_9t_KN.js";import"./index-CBR7zAef.js";import"./test-BVQgoLgN.js";import"./useStore-BwTk8hfc.js";import"./useStore-9ut3oD1M.js";import"./setting-DqvEYlnM.js";import"./index-D0u98Vm2.js";import"./index-pbEXObG7.js";import"./access-DqTnWAGY.js";import"./text-BBOsWGWM.js";const u=e({name:"NotifyNodeDrawer",props:{node:{type:Object,default:()=>({id:"",config:{provider:"",provider_id:"",subject:"",body:""}})}},setup(e){const{updateNodeConfig:u,isRefreshNode:m}=d(),{useFormInput:c,useFormTextarea:v,useFormCustom:j}=r(),{confirm:f}=a(),{handleError:_}=p(),x=o(Object.keys(e.node.config).length>0?e.node.config:{provider:"",provider_id:"",subject:"",body:""}),y=[c(t("t_0_1745920566646"),"subject",{placeholder:t("t_3_1745887835089")}),v(t("t_1_1745920567200"),"body",{placeholder:t("t_4_1745887835265"),rows:4}),j((()=>i(n,{path:"provider_id",value:x.value.provider_id,isAddMode:!0,"onUpdate:value":e=>{x.value.provider_id=e.value,x.value.provider=e.type}},null)))],{component:b,data:g,example:h}=s({defaultValue:x,config:y,rules:l});return f((async o=>{var r;try{await(null==(r=h.value)?void 0:r.validate()),u(e.node.id,g.value),m.value=e.node.id,o()}catch(t){_(t)}})),()=>i("div",{class:"notify-node-drawer"},[i(b,{labelPlacement:"top"},null)])}});export{u as default};
