import{_ as n}from"./main-tangy-colts-beg.js";import{s as a}from"./machine.-tangy-colts-beg-869.js";import{f as d,a as s,b as m}from"./machineh-tangy-colts-beg-663.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 o=t=>({$:e,e:c})=>{e.setThisComponent(i=>{i.value=c}),e.setDb(i=>{i[t]=c})},C=t=>({states:{components:[{componentName:t.componentName.mixInput,id:"id",label:n("Id"),onChange:"HANDLE_ID",path:"id",render:!0,required:!0,value:void 0}]},actions:{HANDLE_ID:o("id"),ON_MACHINE_LOAD:({$:e})=>{a(e,[{db:"id",id:"id"}])}}}),N=t=>({states:{components:[{componentName:t.componentName.select,fieldType:"config",id:"tag-id",label:n("Tags"),mode:"multiple",onChange:"SELECT_TAG",onRefetch:"REFETCH_TAGS",options:[],placeholder:n("Select a tag"),render:!0,value:void 0},{componentName:t.componentName.mixInput,id:"contact-id",label:n("Contact Id"),onChange:"HANDLE_CONTACT_ID",path:"contactId",render:!0,required:!0,value:void 0}]},actions:{HANDLE_CONTACT_ID:o("contactId"),SELECT_TAG:o("tagId"),REFETCH_TAGS:async({$:e})=>d(e),ON_MACHINE_LOAD:async({$:e})=>{a(e,[{db:"contactId",id:"contact-id"},{db:"tagId",id:"tag-id"}]),await d(e)}}}),I=t=>({states:{components:[{componentName:t.componentName.select,fieldType:"config",id:"list-id",label:n("Lists"),mode:"multiple",onChange:"SELECT_LIST",onRefetch:"REFETCH_LISTS",options:[],placeholder:n("Select a list"),render:!0,value:void 0},{componentName:t.componentName.mixInput,id:"contact-id",label:n("Contact Id"),onChange:"HANDLE_CONTACT_ID",path:"contactId",render:!0,required:!0,value:void 0}]},actions:{HANDLE_CONTACT_ID:o("contactId"),SELECT_LIST:o("listId"),REFETCH_LISTS:async({$:e})=>s(e),ON_MACHINE_LOAD:async({$:e})=>{a(e,[{db:"contactId",id:"contact-id"},{db:"listId",id:"list-id"}]),await s(e)}}}),u=t=>({states:{components:[{componentName:t.componentName.mixInput,id:"title",label:n("Title"),onChange:"HANDLE_TITLE",path:"title",render:!0,required:!0,value:void 0},{componentName:t.componentName.mixInput,id:"slug",label:n("Slug"),onChange:"HANDLE_SLUG",path:"slug",render:!0,value:void 0},{componentName:t.componentName.mixInput,id:"description",label:n("Description"),onChange:"HANDLE_DESCRIPTION",path:"description",render:!0,value:void 0}]},actions:{HANDLE_DESCRIPTION:o("description"),HANDLE_SLUG:o("slug"),HANDLE_TITLE:o("title"),ON_MACHINE_LOAD:({$:e})=>{a(e,[{db:"title",id:"title"},{db:"slug",id:"slug"},{db:"description",id:"description"}])}}}),E=t=>({states:{components:[{componentName:t.componentName.select,fieldType:"config",id:"company-id",label:n("Company"),mode:"multiple",onChange:"SELECT_COMPANY",onRefetch:"REFETCH_COMPANIES",options:[],placeholder:n("Select a company"),render:!0,value:void 0},{componentName:t.componentName.mixInput,id:"contact-id",label:n("Contact Id"),onChange:"HANDLE_CONTACT_ID",path:"contactId",render:!0,required:!0,value:void 0}]},actions:{HANDLE_CONTACT_ID:o("contactId"),SELECT_COMPANY:o("companyId"),REFETCH_COMPANIES:async({$:e})=>{await m(e)},ON_MACHINE_LOAD:async({$:e})=>{a(e,[{db:"contactId",id:"contact-id"},{db:"companyId",id:"company-id"}]),await m(e)}}});export{I as a,N as b,u as c,C as d,E as g,o as h};
