import{b as n}from"./useflows-BpG3C9m1.js";import{e}from"./main-few-lands-burn.js";import{s as m}from"./machine.-BRuqPpdF.js";import{h as o}from"./commonut-D3rqJBtm.js";import{h as d,f as r}from"./machineh-D8WlVdMZ.js";import{w as l}from"./wpuserfi-Ud3BKkbF.js";import"./mutative-C6xjlr6O.js";import"./lodash-YpNkAOPN.js";const c=n(({helpers:a})=>({states:{components:[{componentName:a.componentName.mixInput,id:"user-id",label:e("User Id"),onChange:"HANDLE_USER_ID",path:"userId",render:!0,required:!0,value:void 0},{addItemButtonLabel:e("Add Field"),componentName:a.componentName.repeaterField,fieldsMetaData:[{componentName:a.componentName.select,label:e("Field"),name:"wordPressField",options:l,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"),onChange:"HANDLE_FIELD_MAPPING",path:"fieldMap",render:!0,value:[]},{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"},{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,value:void 0}]},actions:{SHOULD_SHOW_USER_META_FIELD_MAPPING:({$:t})=>t.getComponent("show-user-meta-field")?.value===!0,ON_MACHINE_LOAD:async({$:t})=>{m(t,[{db:"userId",id:"user-id"},{db:"fieldMap",id:"field-map"},{db:"userRole",id:"user-role"},{db:"showUserMetaField",id:"show-user-meta-field"},{db:"userMetaFieldMap",id:"user-meta-field-map"}]),await r(t)},REFETCH_USER_ROLES:async({$:t})=>{await r(t)},GENERATE_PASSWORD:async({$:t})=>{await d(t)},HANDLE_FIELD_MAPPING:o("fieldMap"),HANDLE_META_FIELD_MAPPING:o("userMetaFieldMap"),HANDLE_USER_ID:o("userId"),SELECT_USER_ROLE:o("userRole"),SHOW_META_FIELD_ENABLE:o("showUserMetaField")}}));export{c as default};
