import{aa as l,ab as r}from"./_applist-tangy-colts-beg-36.js";import{_ as t}from"./main-tangy-colts-beg.js";import{h as a,s}from"./machine.-tangy-colts-beg-869.js";import{h as d,c}from"./commons.-tangy-colts-beg-737.js";import{f as n}from"./machineh-tangy-colts-beg-921.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(o,e){return this.cache.has(o)?this.cache.get(o):(this.cache.set(o,e),e)}};const E=l(({helpers:o})=>({states:{components:[c(o),{componentName:o.componentName.select,helperText:t("Select the list to which you want to add profiles."),id:"list-id",isLoadable:!0,label:t("List ID"),onChange:"SET_LIST",onRefetch:"REFETCH_LIST",optionFilterProp:"label",options:[],path:"data.id",placeholder:t("Select a List"),render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,value:void 0},{addItemButtonLabel:t("Add Profiles"),componentName:o.componentName.repeaterField,fieldsMetaData:[{componentName:o.componentName.select,helperText:t("Select the type of entity to add (Profile)."),id:"type",label:t("Type"),name:"type",options:[{label:t("Profile"),value:"profile"}],required:!0,value:"profile"},{componentName:o.componentName.mixInput,helperText:t("Enter the Profile ID to add to the list."),label:t("Enter Profile ID"),name:"id",required:!0,value:[],wrapperClassName:"w-100"}],helperText:t("Add one or more profile IDs to the selected list."),id:"profile-id-list",inputGroupProps:{label:t("Profile #{COUNT}")},label:t("Profile ID Fields"),onChange:"ON_FIELD_MAP_CHANGE",render:"IF_CONNECTION_SELECTED",value:[]}]},actions:{CONNECTION_ADD_CHANGE:d,IF_CONNECTION_SELECTED:({$:e})=>{var i;return r((i=e.getComponent("connection-id"))==null?void 0:i.value)},ON_FIELD_MAP_CHANGE:a("profiles"),REFETCH_LIST:({$:e})=>n(e),SET_LIST:a("list"),SET_CONNECTION:async({$:e,e:i})=>{a("connectionId")({$:e,e:i}),await n(e)},ON_MACHINE_LOAD:async({$:e})=>{var i;s(e,[{db:"connectionId",id:"connection-id"},{db:"list",id:"list-id"},{db:"profiles",id:"profile-id-list"}]),(i=e.db)!=null&&i.connectionId&&await n(e)}}}));export{E as default};
