import{aa as i,ab as d}from"./_applist-tangy-colts-beg-36.js";import{_ as n}from"./main-tangy-colts-beg.js";import{h as t,s as l}from"./machine.-tangy-colts-beg-869.js";import{h as m,a as u,c as N,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,o){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,o),o)}};const D=i(({helpers:e})=>({states:{components:[N(e),{componentName:e.componentName.mixInput,helperText:n("Enter account ID for updates"),id:"account-id",label:n("Account ID"),onChange:"HANDLE_ACCOUNT_ID",path:"accountId",render:"IF_CONNECTION_SELECTED",value:void 0},{componentName:e.componentName.mixInput,helperText:n("Enter name of the account"),id:"name",label:n("Name"),onChange:"HANDLE_NAME",path:"name",render:"IF_CONNECTION_SELECTED",value:void 0},{componentName:e.componentName.mixInput,helperText:n("Enter account-url of the account"),id:"account-url",label:n("Account Url"),onChange:"HANDLE_ACCOUNT_URL",path:"accountUrl",render:"IF_CONNECTION_SELECTED",value:void 0},{componentName:e.componentName.mixInput,helperText:n("Enter owner-id of the contact"),id:"owner",label:n("Owner"),onChange:"HANDLE_OWNER",path:"owner",render:"IF_CONNECTION_SELECTED",value:void 0},{addItemButtonLabel:"Add Custom Fields",componentName:e.componentName.repeaterField,fieldsMetaData:[{componentName:e.componentName.input,label:n("Field Id"),name:"customFieldId",required:!0,value:void 0},{componentName:e.componentName.input,label:n("Field Value"),name:"fieldValue",required:!0,value:void 0},{componentName:e.componentName.input,label:n("Currency "),name:"fieldCurrency",value:void 0}],id:"fields",inputGroupProps:{label:n("Field #{COUNT}")},label:n("Custom Fields"),loading:!1,onChange:"SET_FIELDS",render:"IF_CONNECTION_SELECTED",value:[]}]},actions:{CONNECTION_ADD_CHANGE:u,IF_CONNECTION_SELECTED:({$:o})=>{var a;return d((a=o.getComponent("connection-id"))==null?void 0:a.value)},ON_MACHINE_LOAD:({$:o})=>{l(o,[{db:"connectionId",id:"connection-id"},{db:"urlDb",id:"url"},{db:"nameDb",id:"name"},{db:"accountUrl",id:"account-url"},{db:"ownerDb",id:"owner"},{db:"fieldsDb",id:"fields"},{db:"accountId",id:"account-id"}]),r({$:o})},SET_CONNECTION:async({$:o,e:a})=>{o.setThisComponent(c=>{c.value=a}),o.setDb(c=>{c.connectionId=a,c.urlDb=""})},HANDLE_ACCOUNT_ID:t("accountId"),HANDLE_ACCOUNT_URL:t("accountUrl"),HANDLE_NAME:t("nameDb"),HANDLE_OWNER:t("ownerDb"),HANDLE_URL:m,SET_FIELDS:t("fieldsDb")}}));export{D as default};
