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