import{aa as s,ab as m}from"./_applist-tangy-colts-beg-36.js";import{_ as o}from"./main-tangy-colts-beg.js";import{s as c}from"./machine.-tangy-colts-beg-869.js";import{h as r,a as i,c as d}from"./brevocom-tangy-colts-beg-591.js";import{f as n}from"./machineh-tangy-colts-beg-4.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(t,e){return this.cache.has(t)?this.cache.get(t):(this.cache.set(t,e),e)}};const h=s(({helpers:t})=>({states:{components:[d(t),{componentName:t.componentName.select,fieldType:"config",helperText:o("Select the contact list to remove contacts from."),id:"list-id",label:o("Contact list"),onChange:"SELECT_LIST",onRefetch:"REFETCH_CONTACT_LIST",optionFilterProp:"label",options:[],placeholder:o("Select a list"),render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,value:void 0},{addItemButtonLabel:"Add Email",componentName:t.componentName.repeaterField,fieldsMetaData:[{componentName:t.componentName.mixInput,label:o("Email"),name:"email",required:!0,value:void 0,wrapperClassName:"w-100"}],helperText:o("Emails to add to a list. You can pass a maximum of 150 emails for addition in one request."),id:"email-list",inputGroupProps:{label:o("Email #{COUNT}")},label:o("Emails"),loading:!1,onChange:"ON_EMAIL_FIELD_CHANGE",render:"IF_CONNECTION_SELECTED",value:[]},{componentName:t.componentName.select,fieldType:"config",helperText:o("Choose either yes or no here. Yes, to remove all existing contacts from a list."),id:"remove-all",label:o("Remove All?"),onChange:"SET_REMOVE_ALL",options:[{label:o("Yes"),value:"true"},{label:o("No"),value:"false"}],path:"all",placeholder:o("Select to Remove All"),render:"IF_CONNECTION_SELECTED",required:!0,value:"false"}]},actions:{SET_CONNECTION:async({$:e,e:a})=>{e.setThisComponent(l=>{l.value=a}),e.setDb(l=>{l.connectionId=a}),await n(e)},IF_CONNECTION_SELECTED:({$:e})=>{var a;return m((a=e.getComponent("connection-id"))==null?void 0:a.value)},SELECT_LIST:async({$:e,e:a})=>{e.setThisComponent(l=>{l.value=a}),e.setDb(l=>{l.listId=a})},REFETCH_CONTACT_LIST:async({$:e})=>{await n(e)},SET_REMOVE_ALL:i("removeAll"),ON_EMAIL_FIELD_CHANGE:i("emails"),CONNECTION_ADD_CHANGE:r,ON_MACHINE_LOAD:async({$:e})=>{var a;c(e,[{db:"connectionId",id:"connection-id"},{db:"emails",id:"email-list"},{db:"listId",id:"list-id"},{db:"removeAll",id:"remove-all"}]),(a=e.db)!=null&&a.connectionId&&await n(e)}}}));export{h as default};
