import{aa as p,ab as s}from"./_applist-tangy-colts-beg-36.js";import{_ as t}from"./main-tangy-colts-beg.js";import{h as n,s as T}from"./machine.-tangy-colts-beg-869.js";import{h as d,c as r}from"./gohighle-tangy-colts-beg-43.js";import{e as E,g as i,b as l,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 S=p(({helpers:o})=>({states:{components:[r(o),{componentName:o.componentName.select,helperText:t("Select the pipeline to use."),id:"pipeline-id",label:t("Pipeline"),onChange:"HANDLE_SELECT_PIPELINE",onRefetch:"REFETCH_PIPELINES",options:[],path:"pipelineId",render:"IF_CONNECTION_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",required:!0,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",required:!0,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",required:!0,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:d,HANDLE_SELECT_ASSIGNED_TO:n("assignedTo"),HANDLE_SELECT_CONTACT:n("contactId"),HANDLE_SELECT_STAGE:n("stageId"),HANDLE_SELECT_STATUS:n("status"),IF_CONNECTION_SELECTED:({$:e})=>{var a;return s((a=e.getComponent("connection-id"))==null?void 0:a.value)},IF_PIPELINE_SELECTED:({$:e})=>{var a;return s((a=e.getComponent("pipeline-id"))==null?void 0:a.value)},REFETCH_CONTACTS:({$:e})=>l(e),REFETCH_PIPELINES:({$:e})=>i(e),REFETCH_USERS:({$:e})=>E(e),SET_MONETARY_VALUE:n("monetaryValue"),SET_TITLE:n("name"),HANDLE_SELECT_PIPELINE:({$:e,e:a})=>{n("pipelineId")({$:e,e:a}),c(e)},SET_CONNECTION:async({$:e,e:a})=>{n("connectionId")({$:e,e:a}),await Promise.all([i(e),l(e),E(e)])},ON_MACHINE_LOAD:async({$:e})=>{T(e,[{db:"connectionId",id:"connection-id"},{db:"pipelineId",id:"pipeline-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([i(e),l(e),E(e),c(e)])}}}));export{S as default};
