import{aa as C,ab as s}from"./_applist-tangy-colts-beg-36.js";import{_ as o}from"./main-tangy-colts-beg.js";import{h as a,s as i}from"./machine.-tangy-colts-beg-869.js";import{e as c,h as E,b as h,c as N,d as l}from"./machineh-tangy-colts-beg-816.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,e){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,e),e)}};const p=C(({helpers:n})=>({states:{components:[N(n),{allowClear:!0,componentName:n.componentName.select,fieldType:"config",helperText:o("Select the channel where you want to send the message."),id:"channel-id",label:o("Select Channel"),onChange:"SELECT_CHANNEL",onRefetch:"REFETCH_CHANNELS",options:[],render:"IF_CONNECTION_SELECTED",required:!0,value:void 0},{componentName:n.componentName.mixInput,helperText:o("Enter the message content you want to send."),id:"message-content",label:o("Message Content"),onChange:"SET_MESSAGE_CONTENT",path:"content",render:"IF_CHANNEL_SELECTED",required:!0,value:[]}]},actions:{SET_CONNECTION:async({$:e,e:t})=>{a("connectionId")({$:e,e:t}),await c(e),l(e,n)},CONNECTION_ADD_CHANGE:h,HANDLE_BOT_TOKEN:E,SELECT_CHANNEL:a("channelId"),REFETCH_CHANNELS:({$:e})=>c(e),SET_MESSAGE_CONTENT:a("messageContent"),IF_CHANNEL_SELECTED:({$:e})=>{var t;return s((t=e.getComponent("channel-id"))==null?void 0:t.value)},IF_CONNECTION_SELECTED:({$:e})=>{var t;return s((t=e.getComponent("connection-id"))==null?void 0:t.value)},ON_MACHINE_LOAD:({$:e})=>{i(e,[{db:"connectionId",id:"connection-id"},{db:"channelId",id:"channel-id"},{db:"messageContent",id:"message-content"}]),c(e)}}}));export{p as default};
