import{b as i}from"./useflows-BpG3C9m1.js";import{e as s}from"./main-few-lands-burn.js";import{s as r}from"./machine.-BRuqPpdF.js";import{i as p,e as a}from"./machineh-D8WlVdMZ.js";import"./mutative-C6xjlr6O.js";import"./lodash-YpNkAOPN.js";const P=i(({helpers:n})=>({states:{components:[{componentName:n.componentName.select,fieldType:"config",id:"post-type",label:s("Post Type"),mode:"multiple",onChange:"SELECT_POST_TYPE",onRefetch:"REFETCH_POST_TYPES",optionFilterProp:"label",options:[],placeholder:s("any post type"),render:!0,showSearch:!0,value:void 0},{componentName:n.componentName.select,fieldType:"config",id:"post-id",label:s("Posts"),mode:"multiple",onChange:"SELECT_POST",onRefetch:"REFETCH_POSTS",optionFilterProp:"label",options:[],placeholder:s("any post"),render:!0,showSearch:!0,value:void 0},{componentName:n.componentName.hookListener,fieldType:"config",id:"hook-listener",label:s("Listen Hook"),render:!0}]},actions:{ON_MACHINE_LOAD:async({$:e})=>{r(e,[{db:"postType",id:"post-type"},{db:"postId",id:"post-id"}]),await Promise.all([a(e),p(e)])},REFETCH_POST_TYPES:async({$:e})=>a(e),REFETCH_POSTS:async({$:e})=>p(e),SELECT_POST:async({$:e,e:t})=>{e.setThisComponent(o=>{o.value=t}),e.setDb(o=>{o.postId=t})},SELECT_POST_TYPE:async({$:e,e:t})=>{e.setThisComponent(o=>{o.value=t}),e.setDb(o=>{o.postType=t}),e.setComponent("post-id",o=>{o.value=void 0}),await p(e)}}}));export{P as default};
