import{aa as s,ab as l}from"./_applist-tangy-colts-beg-36.js";import{_ as t}from"./main-tangy-colts-beg.js";import{h as a,s as d}from"./machine.-tangy-colts-beg-869.js";import{h as r,c as N}from"./gohighle-tangy-colts-beg-43.js";import{e as i,g as E,i as T,b as p,h as c}from"./machineh-tangy-colts-beg-622.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 I=s(({helpers:o})=>({states:{components:[N(o),{componentName:o.componentName.select,fieldType:"config",helperText:t("Select pipeline to filter opportunities."),id:"pipeline-id",label:t("Select Pipeline"),onChange:"HANDLE_SELECT_PIPELINE",onRefetch:"REFETCH_PIPELINE_LIST",options:[],render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,value:void 0},{componentName:o.componentName.select,fieldType:"config",helperText:t("Select opportunity to update."),id:"opportunity-id",label:t("Select Opportunity"),onChange:"HANDLE_SELECT_OPPORTUNITY",onRefetch:"REFETCH_OPPORTUNITY_LIST",options:[],render:"IF_PIPELINE_SELECTED",required:!0,showSearch:!0,value:void 0},{componentName:o.componentName.select,helperText:t("Select the stage of the pipeline to use."),id:"stage-id",label:t("Stage"),onChange:"HANDLE_SELECT_STAGE",options:[],path:"pipelineStageId",render:"IF_PIPELINE_SELECTED",showSearch:!0,value:void 0},{componentName:o.componentName.mixInput,helperText:t("Enter the title of the opportunity."),id:"title",label:t("Title"),onChange:"SET_TITLE",path:"name",render:"IF_CONNECTION_SELECTED",value:[]},{componentName:o.componentName.select,helperText:t("Select the contact to associate with the opportunity."),id:"contact-id",label:t("Contact"),onChange:"HANDLE_SELECT_CONTACT",onRefetch:"REFETCH_CONTACTS",options:[],path:"contactId",render:"IF_CONNECTION_SELECTED",showSearch:!0,value:void 0},{componentName:o.componentName.select,helperText:t("Select the status of the opportunity."),id:"status",label:t("Status"),onChange:"HANDLE_SELECT_STATUS",options:[{label:t("Open"),value:"open"},{label:t("Won"),value:"won"},{label:t("Lost"),value:"lost"},{label:t("Abandoned"),value:"abandoned"}],path:"status",render:"IF_CONNECTION_SELECTED",value:"open"},{componentName:o.componentName.select,helperText:t("Select the user to assign the opportunity to."),id:"user-id",label:t("Assigned To"),onChange:"HANDLE_SELECT_ASSIGNED_TO",onRefetch:"REFETCH_USERS",options:[],path:"assignedTo",render:"IF_CONNECTION_SELECTED",showSearch:!0,value:void 0},{componentName:o.componentName.mixInput,helperText:t("Enter the monetary value of the opportunity."),id:"monetary-value",label:t("Monetary Value"),onChange:"SET_MONETARY_VALUE",path:"monetaryValue",render:"IF_CONNECTION_SELECTED",value:[]}]},actions:{CONNECTION_ADD_CHANGE:r,HANDLE_SELECT_ASSIGNED_TO:a("assignedTo"),HANDLE_SELECT_CONTACT:a("contactId"),HANDLE_SELECT_OPPORTUNITY:a("opportunityId"),HANDLE_SELECT_STAGE:a("stageId"),HANDLE_SELECT_STATUS:a("status"),IF_CONNECTION_SELECTED:({$:e})=>{var n;return l((n=e.getComponent("connection-id"))==null?void 0:n.value)},IF_PIPELINE_SELECTED:({$:e})=>{var n;return l((n=e.getComponent("pipeline-id"))==null?void 0:n.value)},REFETCH_CONTACTS:({$:e})=>p(e),REFETCH_OPPORTUNITY_LIST:({$:e})=>T(e),REFETCH_PIPELINE_LIST:({$:e})=>E(e),REFETCH_USERS:({$:e})=>i(e),SET_MONETARY_VALUE:a("monetaryValue"),SET_TITLE:a("name"),SET_CONNECTION:async({$:e,e:n})=>{a("connectionId")({$:e,e:n}),await Promise.all([E(e),p(e),i(e)])},HANDLE_SELECT_PIPELINE:async({$:e,e:n})=>{a("pipelineId")({$:e,e:n}),await Promise.all([T(e),c(e)])},ON_MACHINE_LOAD:async({$:e})=>{d(e,[{db:"connectionId",id:"connection-id"},{db:"pipelineId",id:"pipeline-id"},{db:"opportunityId",id:"opportunity-id"},{db:"stageId",id:"stage-id"},{db:"name",id:"title"},{db:"contactId",id:"contact-id"},{db:"status",id:"status"},{db:"assignedTo",id:"user-id"},{db:"monetaryValue",id:"monetary-value"}]),await Promise.all([E(e),p(e),i(e),c(e)])}}}));export{I as default};
