import{aa as c,ab as s}from"./_applist-tangy-colts-beg-36.js";import{_ as t}from"./main-tangy-colts-beg.js";import{h as o,s as E}from"./machine.-tangy-colts-beg-869.js";import{e as i,h as l,b as m,c as C,d as h}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:[C(n),{allowClear:!0,componentName:n.componentName.select,fieldType:"config",helperText:t("Select the channel to retrieve messages from."),id:"channel-id",label:t("Select Channel"),onChange:"SELECT_CHANNEL",onRefetch:"REFETCH_CHANNELS",options:[],render:"IF_CONNECTION_SELECTED",required:!0,value:void 0},{componentName:n.componentName.mixInput,helperText:t("Enter the number of messages to retrieve (max 100)."),id:"message-limit",label:t("Message Limit"),onChange:"SET_MESSAGE_LIMIT",path:"limit",render:"IF_CHANNEL_SELECTED",required:!1,value:[]}]},actions:{SET_CONNECTION:async({$:e,e:a})=>{o("connectionId")({$:e,e:a}),await i(e),h(e,n)},CONNECTION_ADD_CHANGE:m,HANDLE_BOT_TOKEN:l,SELECT_CHANNEL:o("channelId"),REFETCH_CHANNELS:({$:e})=>i(e),SET_MESSAGE_LIMIT:o("messageLimit"),IF_CHANNEL_SELECTED:({$:e})=>{var a;return s((a=e.getComponent("channel-id"))==null?void 0:a.value)},IF_CONNECTION_SELECTED:({$:e})=>{var a;return s((a=e.getComponent("connection-id"))==null?void 0:a.value)},ON_MACHINE_LOAD:({$:e})=>{E(e,[{db:"connectionId",id:"connection-id"},{db:"channelId",id:"channel-id"},{db:"messageLimit",id:"message-limit"}]),i(e)}}}));export{p as default};
