import{aa as l,ab as i}from"./_applist-tangy-colts-beg-36.js";import{_ as e}from"./main-tangy-colts-beg.js";import{h as o,s as E}from"./machine.-tangy-colts-beg-869.js";import{h as d,c as N}from"./commonut-tangy-colts-beg-6742.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(a,n){return this.cache.has(a)?this.cache.get(a):(this.cache.set(a,n),n)}};const _=l(({helpers:a})=>({states:{components:[N(a),{addItemButtonLabel:"Add To Email",componentName:a.componentName.repeaterField,direction:"vertical",fieldsMetaData:[{componentName:a.componentName.mixInput,name:"email",required:!0,value:[]}],id:"email-to",inputGroupProps:{label:e("Email #{COUNT}")},label:e("Email To"),nonRemovableRows:[0],onChange:"HANDLE_TO_EMAIL",render:"IF_CONNECTION_SELECTED",value:[[{name:"email",value:[]}]]},{addItemButtonLabel:"Add CC Email",componentName:a.componentName.repeaterField,direction:"vertical",fieldsMetaData:[{componentName:a.componentName.mixInput,name:"email",required:!0,value:void 0}],id:"cc-email",inputGroupProps:{label:e("Email #{COUNT}")},label:e("CC Email"),loading:!1,nonRemovableRows:[0],onChange:"HANDLE_CC_EMAIL",render:"IF_CONNECTION_SELECTED",value:[[{name:"email",value:[]}]]},{addItemButtonLabel:"Add BCC Email",componentName:a.componentName.repeaterField,direction:"vertical",fieldsMetaData:[{componentName:a.componentName.mixInput,name:"email",required:!0,value:void 0}],id:"bcc-email",inputGroupProps:{label:e("Email #{COUNT}")},label:e("BCC Email"),loading:!1,nonRemovableRows:[0],onChange:"HANDLE_BCC_EMAIL",render:"IF_CONNECTION_SELECTED",value:[[{name:"email",value:[]}]]},{componentName:a.componentName.mixInput,helperText:e("Enter the subject for the email."),id:"subject",label:e("Subject"),onChange:"HANDLE_SUBJECT",path:"subject",render:"IF_CONNECTION_SELECTED",value:void 0},{componentName:a.componentName.mixInput,helperText:e("Enter content of the email."),id:"body",label:e("Body"),onChange:"HANDLE_BODY",path:"body",render:"IF_CONNECTION_SELECTED",value:void 0},{componentName:a.componentName.select,helperText:e("Select the content type of the email"),id:"body-type",label:e("Body Type"),onChange:"SELECT_BODY_TYPE",options:[{label:e("Plain"),value:"plain"},{label:e("Html"),value:"html"}],path:"body_type",render:"IF_CONNECTION_SELECTED",showSearch:!0,value:"plain"},{componentName:a.componentName.mixInput,helperText:e("Enter the label of the email"),id:"label",label:e("Label"),onChange:"HANDLE_LABEL",path:"label",render:"IF_CONNECTION_SELECTED",value:void 0},{componentName:a.componentName.mixInput,helperText:e("Enter a from email-address, default is the primary email address of the user."),id:"from-email",label:e("From Email"),onChange:"HANDLE_FROM_EMAIL",path:"from_email",render:"IF_CONNECTION_SELECTED",value:void 0},{componentName:a.componentName.mixInput,helperText:e("Enter the name of the sender."),id:"from-name",label:e("From Name"),onChange:"HANDLE_FROM_NAME",path:"from_name",render:"IF_CONNECTION_SELECTED",value:void 0},{componentName:a.componentName.mixInput,helperText:e("Enter a reply email-address, which will be different from user own, and from email-address."),id:"reply-to",label:e("Reply To"),onChange:"HANDLE_REPLY_TO",path:"reply_to",render:"IF_CONNECTION_SELECTED",value:void 0},{addItemButtonLabel:"Add Attachment",componentName:a.componentName.repeaterField,direction:"horizontal",fieldsMetaData:[{componentName:a.componentName.mixInput,label:e("Name"),name:"name",value:[],wrapperClassName:"w-80"},{componentName:a.componentName.mixInput,label:e("Url"),name:"url",value:[],wrapperClassName:"w-100"}],id:"attachment",inputGroupProps:{label:e("Attachment #{COUNT}")},label:e("Attachment"),loading:!1,onChange:"HANDLE_ATTACHMENT",render:"IF_CONNECTION_SELECTED",value:[]}]},actions:{CONNECTION_ADD_CHANGE:d,IF_CONNECTION_SELECTED:({$:n})=>{var t;return i((t=n.getComponent("connection-id"))==null?void 0:t.value)},ON_MACHINE_LOAD:async({$:n})=>{E(n,[{db:"connectionId",id:"connection-id"},{db:"attachmentDb",id:"attachment"},{db:"bccEmail",id:"bcc-email"},{db:"ccEmail",id:"cc-email"},{db:"labelDb",id:"label"},{db:"subjectDb",id:"subject"},{db:"bodyDb",id:"body"},{db:"bodyType",id:"body-type"},{db:"emailTo",id:"email-to"},{db:"fromName",id:"from-name"},{db:"fromEmail",id:"from-email"},{db:"replyTo",id:"reply-to"}])},HANDLE_ATTACHMENT:o("attachmentDb"),HANDLE_BCC_EMAIL:o("bccEmail"),HANDLE_BODY:o("bodyDb"),HANDLE_CC_EMAIL:o("ccEmail"),HANDLE_FROM_EMAIL:o("fromEmail"),HANDLE_FROM_NAME:o("fromName"),HANDLE_LABEL:o("labelDb"),HANDLE_REPLY_TO:o("replyTo"),HANDLE_SUBJECT:o("subjectDb"),HANDLE_TO_EMAIL:o("emailTo"),SELECT_BODY_TYPE:o("bodyType"),SET_CONNECTION:async({$:n,e:t})=>{n.setThisComponent(m=>{m.value=t}),n.setDb(m=>{m.connectionId=t})}}}));export{_ as default};
