import{aa as E,ab as r}from"./_applist-tangy-colts-beg-36.js";import{_ as o}from"./main-tangy-colts-beg.js";import{h as a,s as C}from"./machine.-tangy-colts-beg-869.js";import{h as d,c as s}from"./gohighle-tangy-colts-beg-43.js";import{e as c,b as i}from"./machineh-tangy-colts-beg-622.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 p=E(({helpers:t})=>({states:{components:[s(t),{componentName:t.componentName.select,fieldType:"config",helperText:o("Select the contact to add a note to."),id:"contact-id",label:o("Select Contact"),onChange:"HANDLE_SELECT_CONTACT",onRefetch:"REFETCH_CONTACT_LIST",options:[],render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,value:void 0},{componentName:t.componentName.select,helperText:o("Select the user adding the note."),id:"user-id",label:o("Select User"),onChange:"HANDLE_SELECT_USER",onRefetch:"REFETCH_USER_LIST",options:[],path:"userId",render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,value:void 0},{componentName:t.componentName.mixInput,helperText:o("Enter the note to add to the contact."),id:"note",label:o("Note"),onChange:"SET_NOTE",path:"body",render:"IF_CONNECTION_SELECTED",required:!0,value:[]}]},actions:{CONNECTION_ADD_CHANGE:d,HANDLE_SELECT_CONTACT:a("contactId"),HANDLE_SELECT_USER:a("userId"),IF_CONNECTION_SELECTED:({$:e})=>{var n;return r((n=e.getComponent("connection-id"))==null?void 0:n.value)},REFETCH_CONTACT_LIST:({$:e})=>i(e),REFETCH_USER_LIST:({$:e})=>c(e),SET_NOTE:a("note"),SET_CONNECTION:async({$:e,e:n})=>{a("connectionId")({$:e,e:n}),await Promise.all([i(e),c(e)])},ON_MACHINE_LOAD:async({$:e})=>{C(e,[{db:"connectionId",id:"connection-id"},{db:"contactId",id:"contact-id"},{db:"userId",id:"user-id"},{db:"note",id:"note"}]),await Promise.all([i(e),c(e)])}}}));export{p as default};
