import{aa as s,ab as r}from"./_applist-tangy-colts-beg-36.js";import{_ as a}from"./main-tangy-colts-beg.js";import{h as n,s as h}from"./machine.-tangy-colts-beg-869.js";import{f as E,a as l,d as i,b as d,h as C,c as T}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 p=s(({helpers:t})=>({states:{components:[T(t),{allowClear:!0,componentName:t.componentName.select,fieldType:"config",helperText:a("Select the folder where the workbook is located. Leave empty for root folder."),id:"folder-id",label:a("Folder"),onChange:"HANDLE_FOLDER",onRefetch:"REFETCH_FOLDERS",options:[{label:a("Root"),value:"root"}],render:"IF_CONNECTION_SELECTED",showSearch:!0,value:"root"},{allowClear:!0,componentName:t.componentName.select,fieldType:"config",helperText:a("Select the workbook."),id:"workbook-id",label:a("Workbook"),onChange:"HANDLE_WORKBOOK",onRefetch:"REFETCH_WORKBOOKS",options:[],render:"IF_CONNECTION_SELECTED",required:!0,value:void 0},{allowClear:!0,componentName:t.componentName.select,fieldType:"config",helperText:a("Select the worksheet."),id:"worksheet-id",label:a("Worksheet"),onChange:"HANDLE_WORKSHEET",onRefetch:"REFETCH_WORKSHEETS",options:[],render:"IF_WORKBOOK_SELECTED",required:!0,value:void 0},{allowClear:!0,componentName:t.componentName.select,fieldType:"config",helperText:a("Select the table to delete."),id:"table-id",label:a("Table"),onChange:"HANDLE_TABLE",onRefetch:"REFETCH_TABLES",options:[],render:"IF_WORKSHEET_SELECTED",required:!0,value:void 0}]},actions:{CONNECTION_ADD_CHANGE:C,HANDLE_TABLE:n("tableId"),IF_CONNECTION_SELECTED:({$:e})=>{var o;return r((o=e.getComponent("connection-id"))==null?void 0:o.value)},IF_WORKBOOK_SELECTED:({$:e})=>{var o;return r((o=e.getComponent("workbook-id"))==null?void 0:o.value)},IF_WORKSHEET_SELECTED:({$:e})=>{var o;return r((o=e.getComponent("worksheet-id"))==null?void 0:o.value)},REFETCH_FOLDERS:({$:e})=>d(e),REFETCH_TABLES:({$:e})=>i(e),REFETCH_WORKBOOKS:({$:e})=>l(e),REFETCH_WORKSHEETS:({$:e})=>E(e),SET_CONNECTION:({$:e,e:o})=>{n("connectionId")({$:e,e:o}),Promise.all([d(e),l(e)])},HANDLE_FOLDER:({$:e,e:o})=>{n("folderId")({$:e,e:o}),l(e)},HANDLE_WORKBOOK:({$:e,e:o})=>{n("workbookId")({$:e,e:o}),e.setComponent("worksheet-id",c=>{c.value=void 0}),E(e)},HANDLE_WORKSHEET:({$:e,e:o})=>{n("worksheetId")({$:e,e:o}),i(e)},ON_MACHINE_LOAD:async({$:e})=>{h(e,[{db:"connectionId",id:"connection-id"},{db:"folderId",id:"folder-id"},{db:"workbookId",id:"workbook-id"},{db:"worksheetId",id:"worksheet-id"},{db:"tableId",id:"table-id"}]),await Promise.all([d(e),l(e),E(e),i(e)])}}}));export{p as default};
