import{aa as l,ab as i}from"./_applist-tangy-colts-beg-36.js";import{_ as a}from"./main-tangy-colts-beg.js";import{h as n,s as d}from"./machine.-tangy-colts-beg-869.js";import{f as r,b as c,h as E,c as s,d as C}from"./machineh-tangy-colts-beg-230.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 S=l(({helpers:t})=>({states:{components:[s(t),{allowClear:!0,componentName:t.componentName.select,fieldType:"config",helperText:a("Select your Airtable Base from the list."),id:"base-id",label:a("Select Base"),onChange:"SELECT_BASE",onRefetch:"REFETCH_BASES",optionFilterProp:"label",options:[],placeholder:a("Select Base"),render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,value:void 0},{allowClear:!0,componentName:t.componentName.select,fieldType:"config",helperText:a("Select the table where you want to get a record."),id:"table-id",label:a("Select Table"),onChange:"SELECT_TABLE",onRefetch:"REFETCH_TABLES",optionFilterProp:"label",options:[],path:"table-id",render:"IF_BASE_ID_SELECTED",required:!0,showSearch:!0,value:void 0},{componentName:t.componentName.mixInput,fieldType:"config",helperText:a("Enter the Record ID that you want to retrieve."),id:"record-id",label:a("Record ID"),onChange:"SET_RECORD_ID",path:"record-id",render:"IF_TABLE_SELECTED",required:!0,value:[]}]},actions:{CONNECTION_ADD_CHANGE:E,SELECT_BASE:({$:e,e:o})=>{n("baseId")({$:e,e:o}),r(e)},SELECT_TABLE:({$:e,e:o})=>n("tableId")({$:e,e:o}),IF_BASE_ID_SELECTED:({$:e})=>{var o;return i((o=e.getComponent("base-id"))==null?void 0:o.value)},IF_CONNECTION_SELECTED:({$:e})=>{var o;return i((o=e.getComponent("connection-id"))==null?void 0:o.value)},IF_TABLE_SELECTED:({$:e})=>{var o;return i((o=e.getComponent("table-id"))==null?void 0:o.value)},ON_MACHINE_LOAD:async({$:e})=>{d(e,[{db:"connectionId",id:"connection-id"},{db:"baseId",id:"base-id"},{db:"tableId",id:"table-id"},{db:"recordId",id:"record-id"}]),await Promise.all([c(e),r(e)])},REFETCH_BASES:({$:e})=>c(e),REFETCH_TABLES:({$:e})=>r(e),SET_CONNECTION:({$:e,e:o})=>{n("connectionId")({$:e,e:o}),c(e),C(e,t)},SET_RECORD_ID:n("recordId")}}));export{S as default};
