import{aa as d,ab as l}from"./_applist-tangy-colts-beg-36.js";import{_ as t}from"./main-tangy-colts-beg.js";import{h as n,s}from"./machine.-tangy-colts-beg-869.js";import{f as i,a as E,b as c,h,c as p}from"./microsof-tangy-colts-beg-277.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(a,e){return this.cache.has(a)?this.cache.get(a):(this.cache.set(a,e),e)}};const O=d(({helpers:a})=>({states:{components:[p(a),{allowClear:!0,componentName:a.componentName.select,fieldType:"config",helperText:t("Select the folder where the workbook is located. Leave empty for root folder."),id:"folder-id",label:t("Folder"),onChange:"HANDLE_FOLDER",onRefetch:"REFETCH_FOLDERS",options:[{label:t("Root"),value:"root"}],render:"IF_CONNECTION_SELECTED",showSearch:!0,value:"root"},{allowClear:!0,componentName:a.componentName.select,fieldType:"config",helperText:t("Select the workbook."),id:"workbook-id",label:t("Workbook"),onChange:"HANDLE_WORKBOOK",onRefetch:"REFETCH_WORKBOOKS",options:[],render:"IF_CONNECTION_SELECTED",required:!0,value:void 0},{allowClear:!0,componentName:a.componentName.select,fieldType:"config",helperText:t("Select the worksheet."),id:"worksheet-id",label:t("Worksheet"),onChange:"HANDLE_WORKSHEET",onRefetch:"REFETCH_WORKSHEETS",options:[],render:"IF_WORKBOOK_SELECTED",required:!0,value:void 0},{componentName:a.componentName.select,helperText:t("Select what to clear."),id:"apply-to",label:t("Apply To"),onChange:"HANDLE_APPLY_TO",options:[{label:t("All"),value:"All"},{label:t("Formats"),value:"Formats"},{label:t("Contents"),value:"Contents"}],path:"applyTo",render:"IF_WORKSHEET_SELECTED",required:!0,value:"All"},{componentName:a.componentName.switch,fieldType:"config",helperText:t("Whether to clear a specific range or the entire worksheet."),id:"use-range",label:t("Select a Range"),onChange:"HANDLE_USE_RANGE",render:"IF_WORKSHEET_SELECTED",size:"small",value:!1},{componentName:a.componentName.mixInput,helperText:t("The sheet range to clear (e.g., A1:B2). Leave blank to clear entire worksheet."),id:"range",label:t("Range"),onChange:"HANDLE_RANGE",path:"range",render:"IF_USE_RANGE",required:!1,value:[]}]},actions:{CONNECTION_ADD_CHANGE:h,HANDLE_APPLY_TO:n("applyTo"),HANDLE_RANGE:n("range"),HANDLE_USE_RANGE:n("useRange"),HANDLE_WORKSHEET:n("worksheetId"),IF_CONNECTION_SELECTED:({$:e})=>{var o;return l((o=e.getComponent("connection-id"))==null?void 0:o.value)},IF_WORKBOOK_SELECTED:({$:e})=>{var o;return l((o=e.getComponent("workbook-id"))==null?void 0:o.value)},IF_WORKSHEET_SELECTED:({$:e})=>{var o;return l((o=e.getComponent("worksheet-id"))==null?void 0:o.value)},REFETCH_FOLDERS:({$:e})=>c(e),REFETCH_WORKBOOKS:({$:e})=>E(e),REFETCH_WORKSHEETS:({$:e})=>i(e),SET_CONNECTION:({$:e,e:o})=>{n("connectionId")({$:e,e:o}),Promise.all([c(e),E(e)])},IF_USE_RANGE:({$:e})=>{var o,r;return l((o=e.getComponent("worksheet-id"))==null?void 0:o.value)&&((r=e.getComponent("use-range"))==null?void 0:r.value)===!0},HANDLE_FOLDER:({$:e,e:o})=>{n("folderId")({$:e,e:o}),E(e)},HANDLE_WORKBOOK:({$:e,e:o})=>{n("workbookId")({$:e,e:o}),e.setComponent("worksheet-id",r=>{r.value=void 0}),i(e)},ON_MACHINE_LOAD:async({$:e})=>{s(e,[{db:"connectionId",id:"connection-id"},{db:"folderId",id:"folder-id"},{db:"workbookId",id:"workbook-id"},{db:"worksheetId",id:"worksheet-id"},{db:"applyTo",id:"apply-to"},{db:"useRange",id:"use-range"},{db:"range",id:"range"}]),await Promise.all([c(e),E(e),i(e)])}}}));export{O as default};
