import{aa as c,ab as l}from"./_applist-tangy-colts-beg-36.js";import{_ as n}from"./main-tangy-colts-beg.js";import{h as i,s as m}from"./machine.-tangy-colts-beg-869.js";import{h as d,a as r,c as N,u}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 h=c(({helpers:e})=>({states:{components:[N(e),{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:r,IF_CONNECTION_SELECTED:({$:o})=>{var a;return l((a=o.getComponent("connection-id"))==null?void 0:a.value)},ON_MACHINE_LOAD:({$:o})=>{m(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"}]),u({$:o})},SET_CONNECTION:async({$:o,e:a})=>{o.setThisComponent(t=>{t.value=a}),o.setDb(t=>{t.connectionId=a,t.urlDb=""})},HANDLE_ACCOUNT_URL:i("accountUrl"),HANDLE_NAME:i("nameDb"),HANDLE_OWNER:i("ownerDb"),HANDLE_URL:d,SET_FIELDS:i("fieldsDb")}}));export{h as default};
