import{aa as l,ab as s}from"./_applist-tangy-colts-beg-36.js";import{_ as n}from"./main-tangy-colts-beg.js";import{s as c}from"./machine.-tangy-colts-beg-869.js";import{f as i}from"./machineh-tangy-colts-beg-95.js";import{h as r,c as p,p as m}from"./notionco-tangy-colts-beg-866.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(t,e){return this.cache.has(t)?this.cache.get(t):(this.cache.set(t,e),e)}};const u=l(({helpers:t})=>({states:{components:[p(t),{componentName:t.componentName.select,fieldType:"config",id:"page-id",label:n("Parent Page"),onChange:"SELECT_PAGE",onRefetch:"REFETCH_PAGE",optionFilterProp:"label",options:[],placeholder:n("Select a Page"),render:"IF_CONNECTION_SELECTED",showSearch:!0,value:void 0},{addItemButtonLabel:"Add Column",componentName:t.componentName.repeaterField,fieldsMetaData:[{componentName:t.componentName.select,label:n("Field"),name:"notionField",options:m,required:!1,showSearch:!0,style:{width:200},value:""},{componentName:t.componentName.mixInput,label:n("Value"),name:"value",required:!0,value:[],wrapperClassName:"w-100"}],id:"field-properties",label:n("Properties"),onChange:"ON_CHANGE_FIELD",path:"FieldProperties",render:"IF_PAGE_ID_SELECTED",value:[]}]},actions:{IF_CONNECTION_SELECTED:({$:e})=>{var a;return s((a=e.getComponent("connection-id"))==null?void 0:a.value)},IF_PAGE_ID_SELECTED:({$:e})=>{var a;return s((a=e.getComponent("page-id"))==null?void 0:a.value)},ON_CHANGE_FIELD:({$:e,e:a})=>{e.setThisComponent(o=>{o.value=a}),e.setDb(o=>{o.FieldProperties=a})},ON_MACHINE_LOAD:async({$:e})=>{c(e,[{db:"connectionId",id:"connection-id"},{db:"pageId",id:"page-id"},{db:"FieldProperties",id:"field-properties"}]),await i(e)},REFETCH_PAGE:async({$:e})=>{await i(e)},SELECT_PAGE:async({$:e,e:a})=>{e.setThisComponent(o=>{o.value=a}),e.setDb(o=>{o.pageId=a})},SET_CONNECTION:async({$:e,e:a})=>{e.setThisComponent(o=>{o.value=a}),e.setDb(o=>{o.connectionId=a}),await i(e)},CONNECTION_ADD_CHANGE:r}}));export{u as default};
