import{b as i,i as t}from"./useflows-BpG3C9m1.js";import{e as a}from"./main-few-lands-burn.js";import{s as r,h as l}from"./machine.-BRuqPpdF.js";import{h as s,c as u,f as m,s as o,a as C}from"./mysqlcom-CIX_d5mm.js";import"./mutative-C6xjlr6O.js";import"./lodash-YpNkAOPN.js";const b=i(({helpers:n})=>({states:{components:[C(n),{allowClear:!0,componentName:n.componentName.select,fieldType:"config",helperText:a("Select the table you want to insert data into."),id:"table-name",label:a("Table"),onChange:"SELECT_TABLE",onRefetch:"REFETCH_TABLES",optionFilterProp:"label",options:[],placeholder:a("Select a table"),render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,value:void 0},{addItemButtonLabel:a("Add Column"),componentName:n.componentName.repeaterField,fieldsMetaData:[{componentName:n.componentName.select,label:a("Column"),name:"column",options:[],required:!0,showSearch:!0,style:{width:140},value:""},{componentName:n.componentName.mixInput,label:a("Value"),name:"value",required:!0,value:[],wrapperClassName:"w-100"}],id:"column-data",inputGroupProps:{label:a("Column #{COUNT}")},label:a("Column Mapping"),labelActionIconName:"refresh-cw",labelActionOnClick:"REFETCH_COLUMNS",labelActionText:a("Refetch Columns"),onChange:"SET_COLUMN_DATA",path:"columnData",render:"IF_TABLE_SELECTED",value:[],wrapperClassName:"mt-3"}]},actions:{...u,IF_CONNECTION_SELECTED:({$:e})=>t(e.getComponent("connection-id")?.value),IF_TABLE_SELECTED:({$:e})=>t(e.getComponent("table-name")?.value),REFETCH_COLUMNS:({$:e})=>o(e,["column-data"]),REFETCH_TABLES:({$:e})=>m(e),SET_COLUMN_DATA:l("columnData"),SET_CONNECTION:s,SELECT_TABLE:({$:e,e:c})=>{l("tableName")({$:e,e:c}),o(e,["column-data"])},ON_MACHINE_LOAD:({$:e})=>{r(e,[{db:"connectionId",id:"connection-id"},{db:"tableName",id:"table-name"},{db:"columnData",id:"column-data"}]),Promise.all([m(e),o(e,["column-data"])])}}}));export{b as default};
