import{aa as d,ab as a}from"./_applist-tangy-colts-beg-36.js";import{_ as n}from"./main-tangy-colts-beg.js";import{h as l,s as E}from"./machine.-tangy-colts-beg-869.js";import{a as r,b as i,h as m,c as s}from"./microsof-tangy-colts-beg-277.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 O=d(({helpers:t})=>({states:{components:[s(t),{allowClear:!0,componentName:t.componentName.select,fieldType:"config",helperText:n("Select the folder where the workbook is located. Leave empty for root folder."),id:"folder-id",label:n("Folder"),onChange:"HANDLE_FOLDER",onRefetch:"REFETCH_FOLDERS",options:[{label:n("Root"),value:"root"}],render:"IF_CONNECTION_SELECTED",showSearch:!0,value:"root"},{allowClear:!0,componentName:t.componentName.select,fieldType:"config",helperText:n("Select the workbook."),id:"workbook-id",label:n("Workbook"),onChange:"HANDLE_WORKBOOK",onRefetch:"REFETCH_WORKBOOKS",options:[],render:"IF_CONNECTION_SELECTED",required:!0,value:void 0},{componentName:t.componentName.switch,fieldType:"config",helperText:n("Whether to return all results or only up to a given limit."),id:"return-all",label:n("Return All"),onChange:"HANDLE_RETURN_ALL",render:"IF_WORKBOOK_SELECTED",size:"small",value:!1},{componentName:t.componentName.mixInput,helperText:n("Max number of results to return."),id:"limit",label:n("Limit"),onChange:"HANDLE_LIMIT",path:"limit",render:"IF_LIMIT_ENABLED",required:!1,value:void 0}]},actions:{CONNECTION_ADD_CHANGE:m,HANDLE_LIMIT:l("limit"),HANDLE_RETURN_ALL:l("returnAll"),HANDLE_WORKBOOK:l("workbookId"),IF_CONNECTION_SELECTED:({$:e})=>{var o;return a((o=e.getComponent("connection-id"))==null?void 0:o.value)},IF_WORKBOOK_SELECTED:({$:e})=>{var o;return a((o=e.getComponent("workbook-id"))==null?void 0:o.value)},REFETCH_FOLDERS:({$:e})=>i(e),REFETCH_WORKBOOKS:({$:e})=>r(e),SET_CONNECTION:({$:e,e:o})=>{l("connectionId")({$:e,e:o}),i(e)},IF_LIMIT_ENABLED:({$:e})=>{var o,c;return a((o=e.getComponent("workbook-id"))==null?void 0:o.value)&&((c=e.getComponent("return-all"))==null?void 0:c.value)===!1},HANDLE_FOLDER:({$:e,e:o})=>{l("folderId")({$:e,e:o}),r(e)},ON_MACHINE_LOAD:async({$:e})=>{E(e,[{db:"connectionId",id:"connection-id"},{db:"folderId",id:"folder-id"},{db:"workbookId",id:"workbook-id"},{db:"returnAll",id:"return-all"},{db:"limit",id:"limit"}]),await Promise.all([i(e),r(e)])}}}));export{O as default};
