import{aa as i,ab as d}from"./_applist-tangy-colts-beg-36.js";import{_ as a}from"./main-tangy-colts-beg.js";import{h as c,s as C}from"./machine.-tangy-colts-beg-869.js";import{h as N,a as l,c as h,u as r}from"./commonut-tangy-colts-beg-567.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,t){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,t),t)}};const _=i(({helpers:e})=>({states:{components:[h(e),{componentName:e.componentName.mixInput,helperText:a("Enter contact ID, of the contact"),id:"contact-id",label:a("Contact ID"),onChange:"HANDLE_CONTACT_ID",path:"contact",render:"IF_CONNECTION_SELECTED",value:void 0},{componentName:e.componentName.mixInput,helperText:a("Enter tag ID, for the contact"),id:"tag-id",label:a("Tag ID"),onChange:"HANDLE_TAG_ID",path:"tag",render:"IF_CONNECTION_SELECTED",value:void 0},{componentName:e.componentName.select,helperText:a("Choose the action for the tag"),id:"action-type",label:a("Action"),onChange:"SELECT_ACTION",options:[{label:a("Add"),value:"add"},{label:a("Remove"),value:"remove"}],path:"action-type",render:"IF_CONNECTION_SELECTED",showSearch:!0,value:void 0}]},actions:{CONNECTION_ADD_CHANGE:l,IF_CONNECTION_SELECTED:({$:t})=>{var o;return d((o=t.getComponent("connection-id"))==null?void 0:o.value)},ON_MACHINE_LOAD:({$:t})=>{C(t,[{db:"connectionId",id:"connection-id"},{db:"urlDb",id:"url"},{db:"contactId",id:"contact-id"},{db:"actionType",id:"action-type"},{db:"tagId",id:"tag-id"}]),r({$:t})},SET_CONNECTION:async({$:t,e:o})=>{t.setThisComponent(n=>{n.value=o}),t.setDb(n=>{n.connectionId=o,n.urlDb=""})},HANDLE_CONTACT_ID:c("contactId"),HANDLE_TAG_ID:c("tagId"),HANDLE_URL:N,SELECT_ACTION:c("actionType")}}));export{_ as default};
