import{aa as l}from"./_applist-tangy-colts-beg-36.js";import{_ as e}from"./main-tangy-colts-beg.js";import{s,a as d}from"./machine.-tangy-colts-beg-869.js";import{h as t}from"./commonut-tangy-colts-beg-953.js";import{h as m,f as n}from"./machineh-tangy-colts-beg-110.js";import{w as r}from"./wpuserfi-tangy-colts-beg-384.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(a,o){return this.cache.has(a)?this.cache.get(a):(this.cache.set(a,o),o)}};const w=l(({helpers:a})=>({states:{components:[{componentName:a.componentName.select,id:"user-role",label:e("Select User Role"),onChange:"SELECT_USER_ROLE",onRefetch:"REFETCH_USER_ROLES",options:[],path:"userRole",render:!0,required:!0,value:void 0},{componentName:a.componentName.select,helperText:e("Selecting this option will trigger a welcome email from WordPress upon user registration."),id:"email-notification",label:e("Select Email Notification"),onChange:"SELECT_EMAIL_NOTIFICATION",options:[{label:e("Admin"),value:"admin"},{label:e("User"),required:!0,value:"user"},{label:e("Both (Admin & User)"),required:!1,value:"both"}],path:"emailNotification",render:!0,value:void 0},{addItemButtonLabel:e("Add Field"),componentName:a.componentName.repeaterField,fieldsMetaData:[{componentName:a.componentName.select,label:e("Field"),name:"wordPressField",options:r,required:!0,style:{width:150},value:""},{componentName:a.componentName.mixInput,label:e("Value"),name:"value",required:!0,value:[],wrapperClassName:"w-100"}],id:"field-map",label:e("Field Map"),nonRemovableRows:[],onChange:"HANDLE_FIELD_MAPPING",path:"fieldMap",render:!0,value:[]},{componentName:a.componentName.switch,fieldType:"config",id:"is-auto-password-enabled",label:e("Generate Password Automatically"),onChange:"HANDLE_AUTO_PASSWORD_ENABLE",path:"isAutoPasswordEnabled",render:!0,value:!0,wrapperClassName:"my-1"},{componentName:a.componentName.mixInput,id:"password",label:e("Custom User Password"),onChange:"HANDLE_CUSTOM_PASSWORD",path:"password",render:"SHOULD_SHOW_MANUAL_PASSWORD_FIELD",required:!0,value:void 0},{componentName:a.componentName.button,fieldType:"config",id:"generate-password",onClick:"GENERATE_PASSWORD",render:"SHOULD_SHOW_MANUAL_PASSWORD_FIELD",text:e("Generate Password")},{addItemButtonLabel:e("Add Field"),componentName:a.componentName.repeaterField,fieldsMetaData:[{componentName:a.componentName.mixInput,label:e("Meta Key"),name:"meta_key",required:!0,value:[],wrapperClassName:"w-100"},{componentName:a.componentName.mixInput,label:e("Value"),name:"value",required:!0,value:[],wrapperClassName:"w-100"}],id:"user-meta-field-map",label:e("User Meta Field Map"),nonRemovableRows:[],onChange:"HANDLE_META_FIELD_MAPPING",path:"userMetaFieldMap",render:"SHOULD_SHOW_USER_META_FIELD_MAPPING",value:[]},{componentName:a.componentName.switch,fieldType:"config",id:"show-user-meta-field",label:e("Show User Meta Field Mapping"),onChange:"SHOW_META_FIELD_ENABLE",path:"showUserMetaField",render:!0,value:!1,wrapperClassName:"my-1"}]},actions:{SHOULD_SHOW_MANUAL_PASSWORD_FIELD:({$:o})=>{var i;return((i=o.getComponent("is-auto-password-enabled"))==null?void 0:i.value)===!1},SHOULD_SHOW_USER_META_FIELD_MAPPING:({$:o})=>{var i;return((i=o.getComponent("show-user-meta-field"))==null?void 0:i.value)===!0},ON_MACHINE_LOAD:async({$:o})=>{s(o,[{db:"userRole",id:"user-role"},{db:"emailNotification",id:"email-notification"},{db:"isAutoPasswordEnabled",id:"is-auto-password-enabled"},{db:"password",id:"password"},{db:"showUserMetaField",id:"show-user-meta-field"},{db:"userMetaFieldMap",id:"user-meta-field-map"}]),d({$:o,componentId:"field-map",dbKey:"fieldMap",fields:r,mapFieldKey:"wordPressField",mapFieldValue:"value"}),await n(o)},REFETCH_USER_ROLES:async({$:o})=>{await n(o)},GENERATE_PASSWORD:async({$:o})=>{await m(o)},HANDLE_AUTO_PASSWORD_ENABLE:t("isAutoPasswordEnabled"),HANDLE_CUSTOM_PASSWORD:t("password"),HANDLE_FIELD_MAPPING:t("fieldMap"),HANDLE_META_FIELD_MAPPING:t("userMetaFieldMap"),SELECT_EMAIL_NOTIFICATION:t("emailNotification"),SELECT_USER_ROLE:t("userRole"),SHOW_META_FIELD_ENABLE:t("showUserMetaField")}}));export{w as default};
