import{b as c,i as l}from"./useflows-BpG3C9m1.js";import{e as t}from"./main-few-lands-burn.js";import{s as m}from"./machine.-BRuqPpdF.js";import{h as C,f as o,a as i,c as s}from"./telegram-Cgmg4C_6.js";import"./mutative-C6xjlr6O.js";import"./lodash-YpNkAOPN.js";const T=c(({helpers:n})=>({states:{components:[s(n),{componentName:n.componentName.select,helperText:t("Select the target chat fetched from your bot, or map a Chat ID. Use the prefix 100 for channels (e.g. channel ID -155545555 becomes -100155545555) or a username like @channelusername."),id:"chat-id",isMappable:!0,label:t("Select Chat"),onChange:"SET_CHAT_ID",onRefetch:"REFETCH_CHATS",options:[],path:"chat_id",placeholder:t("Select a chat"),render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,value:void 0},{componentName:n.componentName.mixInput,id:"user-id",label:t("User ID"),onChange:"SET_USER_ID",path:"user_id",render:"IF_CONNECTION_SELECTED",required:!0,value:[]},{componentName:n.componentName.mixInput,helperText:t("The invite link to revoke."),id:"ban-until-id",label:t("Ban Until"),onChange:"SET_UNTIL",path:"until_date",render:"IF_CONNECTION_SELECTED",value:[]}]},actions:{SET_CONNECTION:({$:e,e:r})=>{e.setThisComponent(a=>{a.value=r}),e.setDb(a=>{a.connection=r}),o(e)},IF_CONNECTION_SELECTED:({$:e})=>l(e.getComponent("connection-id")?.value),CONNECTION_ADD_CHANGE:C,REFETCH_CHATS:({$:e})=>o(e),SET_CHAT_ID:i("chat"),SET_USER_ID:i("user"),SET_UNTIL:i("untilDate"),ON_MACHINE_LOAD:({$:e})=>{m(e,[{db:"connection",id:"connection-id"},{db:"chat",id:"chat-id"},{db:"user",id:"user-id"},{db:"untilDate",id:"ban-until-id"}]),o(e)}}}));export{T as default};
