import{aa as E,ab as o}from"./_applist-tangy-colts-beg-36.js";import{_ as e}from"./main-tangy-colts-beg.js";import{h as t,s as l}from"./machine.-tangy-colts-beg-869.js";import{f as d,a as i,h as s,b as m,c as N}from"./sendycom-tangy-colts-beg-734.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 _=E(({helpers:a})=>({states:{components:[N(a),{allowClear:!0,componentName:a.componentName.select,fieldType:"config",helperText:e("Select the brand."),id:"brand-id",label:e("Brand"),onChange:"HANDLE_SELECT_BRAND",onRefetch:"REFETCH_BRAND",options:[],render:"IF_CONNECTION_SELECTED",required:!0,value:void 0},{allowClear:!0,componentName:a.componentName.select,fieldType:"config",helperText:e("Select the list to add the subscriber to."),id:"list-id",label:e("List"),onChange:"HANDLE_SELECT_LIST",onRefetch:"REFETCH_LIST",options:[],render:"IF_BRAND_SELECTED",required:!0,value:void 0},{componentName:a.componentName.mixInput,helperText:e("Enter the email address of the subscriber."),id:"email",label:e("Email"),onChange:"SET_EMAIL",path:"email",render:"IF_CONNECTION_SELECTED",required:!0,value:[]},{componentName:a.componentName.mixInput,helperText:e("Enter the name of the subscriber."),id:"name",label:e("Name"),onChange:"SET_NAME",path:"name",render:"IF_CONNECTION_SELECTED",required:!1,value:[]},{componentName:a.componentName.mixInput,helperText:e("User's 2 letter country code."),id:"country",label:e("Country"),onChange:"SET_COUNTRY",path:"country",render:"IF_CONNECTION_SELECTED",required:!1,value:[]},{componentName:a.componentName.switch,helperText:e("Enable if the subscriber has given GDPR consent."),id:"gdpr",label:e("GDPR Consent"),onChange:"SET_GDPR",path:"gdpr",render:"IF_CONNECTION_SELECTED",size:"small",value:!1},{componentName:a.componentName.switch,helperText:e("If enabled, Sendy will send a confirmation email. If disabled, subscriber is added immediately."),id:"silent",label:e("Silent Subscription"),onChange:"SET_SILENT",path:"silent",render:"IF_CONNECTION_SELECTED",size:"small",value:!1},{componentName:a.componentName.mixInput,helperText:e("Enter the subscriber's IP address."),id:"ipaddress",label:e("IP Address"),onChange:"SET_IPADDRESS",path:"ipaddress",render:"IF_CONNECTION_SELECTED",required:!1,value:[]},{componentName:a.componentName.mixInput,helperText:e("The URL where the user signed up from."),id:"referrer",label:e("Referrer"),onChange:"SET_REFERRER",path:"referrer",render:"IF_CONNECTION_SELECTED",required:!1,value:[]},{componentName:a.componentName.switch,helperText:e("Honeypot field to prevent spambots from signing up. When spambots fill this field, the signup will be rejected."),id:"hp",label:e("Honeypot"),onChange:"SET_HP",path:"hp",render:"IF_CONNECTION_SELECTED",size:"small",value:!1}]},actions:{SET_CONNECTION:({$:n,e:r})=>{t("connectionId")({$:n,e:r}),i(n)},HANDLE_SELECT_BRAND:({$:n,e:r})=>{t("brandId")({$:n,e:r}),d(n)},CONNECTION_ADD_CHANGE:m,HANDLE_SELECT_LIST:t("listId"),HANDLE_SENDY_URL:s,IF_BRAND_SELECTED:({$:n})=>{var r;return o((r=n.getComponent("brand-id"))==null?void 0:r.value)},IF_CONNECTION_SELECTED:({$:n})=>{var r;return o((r=n.getComponent("connection-id"))==null?void 0:r.value)},REFETCH_BRAND:({$:n})=>i(n),REFETCH_LIST:({$:n})=>d(n),SET_COUNTRY:t("country"),SET_EMAIL:t("email"),SET_GDPR:t("gdpr"),SET_HP:t("hp"),SET_IPADDRESS:t("ipaddress"),SET_NAME:t("name"),SET_REFERRER:t("referrer"),SET_SILENT:t("silent"),ON_MACHINE_LOAD:({$:n})=>{l(n,[{db:"connectionId",id:"connection-id"},{db:"sendyUrl",id:"sendy-url"},{db:"brandId",id:"brand-id"},{db:"listId",id:"list-id"},{db:"email",id:"email"},{db:"name",id:"name"},{db:"country",id:"country"},{db:"gdpr",id:"gdpr"},{db:"silent",id:"silent"},{db:"ipaddress",id:"ipaddress"},{db:"referrer",id:"referrer"},{db:"hp",id:"hp"}]),i(n)}}}));export{_ as default};
