import{b as r,i as E}from"./useflows-BpG3C9m1.js";import{e as t}from"./main-few-lands-burn.js";import{s as d,h as a}from"./machine.-BRuqPpdF.js";import{h,c as S}from"./commons.-bP-saOXM.js";import{f as i,a as l}from"./machineh-5vGV0ecU.js";import"./mutative-C6xjlr6O.js";import"./lodash-YpNkAOPN.js";const H=r(({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."),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:a("sheetTitle"),IF_CONNECTION_SELECTED:({$:e})=>E(e.getComponent("connection-id")?.value),IF_SHEET_SELECTED:({$:e})=>E(e.getComponent("sheet-title")?.value),IF_SPREADSHEET_SELECTED:({$:e})=>E(e.getComponent("spreadsheet-id")?.value),REFETCH_SHEETS:({$:e})=>l(e),REFETCH_SPREADSHEETS:({$:e})=>i(e),SET_CONNECTION:({$:e,e:n})=>{a("connectionId")({$:e,e:n}),i(e)},HANDLE_SPREADSHEET:({$:e,e:n})=>{a("spreadsheetId")({$:e,e:n}),e.setComponent("sheet-title",s=>{s.value=void 0}),l(e)},ON_MACHINE_LOAD:({$:e})=>{d(e,[{db:"connectionId",id:"connection-id"},{db:"spreadsheetId",id:"spreadsheet-id"},{db:"sheetTitle",id:"sheet-title"}]),Promise.all([i(e),l(e)])}}}));export{H as default};
