import{b as s,i as l}from"./useflows-BpG3C9m1.js";import{e as t}from"./main-few-lands-burn.js";import{s as d,h as E}from"./machine.-BRuqPpdF.js";import{h,c as S}from"./commons.-bP-saOXM.js";import{f as a,a as i}from"./machineh-5vGV0ecU.js";import"./mutative-C6xjlr6O.js";import"./lodash-YpNkAOPN.js";const H=s(({helpers:o})=>({states:{components:[S(o),{allowClear:!0,componentName:o.componentName.select,fieldType:"config",helperText:t("Select the spreadsheet."),id:"spreadsheet-id",label:t("Spreadsheet"),onChange:"HANDLE_SPREADSHEET",onRefetch:"REFETCH_SPREADSHEETS",optionFilterProp:"label",options:[],render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,value:void 0},{allowClear:!0,componentName:o.componentName.select,fieldType:"config",helperText:t("Select the sheet to delete."),id:"sheet-title",isMappable:!0,label:t("Sheet"),onChange:"HANDLE_SHEET",onRefetch:"REFETCH_SHEETS",optionFilterProp:"label",options:[],render:"IF_SPREADSHEET_SELECTED",required:!0,showSearch:!0,value:void 0}]},actions:{CONNECTION_ADD_CHANGE:h,HANDLE_SHEET:E("sheetTitle"),IF_CONNECTION_SELECTED:({$:e})=>l(e.getComponent("connection-id")?.value),IF_SPREADSHEET_SELECTED:({$:e})=>l(e.getComponent("spreadsheet-id")?.value),REFETCH_SHEETS:({$:e})=>i(e),REFETCH_SPREADSHEETS:({$:e})=>a(e),SET_CONNECTION:({$:e,e:n})=>{E("connectionId")({$:e,e:n}),a(e)},HANDLE_SPREADSHEET:({$:e,e:n})=>{E("spreadsheetId")({$:e,e:n}),e.setComponent("sheet-title",r=>{r.value=void 0}),i(e)},ON_MACHINE_LOAD:({$:e})=>{d(e,[{db:"connectionId",id:"connection-id"},{db:"spreadsheetId",id:"spreadsheet-id"},{db:"sheetTitle",id:"sheet-title"}]),Promise.all([a(e),i(e)])}}}));export{H as default};
