import{b as o,i as t}from"./useflows-BpG3C9m1.js";import{e}from"./main-few-lands-burn.js";import{s as m,h as n}from"./machine.-BRuqPpdF.js";import{c as i,a as s}from"./mysqlcom-CIX_d5mm.js";import"./mutative-C6xjlr6O.js";import"./lodash-YpNkAOPN.js";const N=o(({helpers:a})=>({states:{components:[s(a),{componentName:a.componentName.mixInput,helperText:e("Use ? placeholders for values and provide them in order below."),id:"query",label:e("SQL Query"),onChange:"SET_QUERY",path:"query",placeholder:e("SELECT * FROM users WHERE status = ? AND created_at > ?"),render:"IF_CONNECTION_SELECTED",required:!0,value:[]},{addItemButtonLabel:e("Add Parameter"),componentName:a.componentName.repeaterField,fieldsMetaData:[{componentName:a.componentName.mixInput,label:e("Value"),name:"value",required:!0,value:[],wrapperClassName:"w-100"}],helperText:e("Bound to ? placeholders in order. Prevents SQL injection."),id:"query-params",inputGroupProps:{label:e("Parameter #{COUNT}")},label:e("Query Parameters"),onChange:"SET_QUERY_PARAMS",path:"queryParams",render:"IF_CONNECTION_SELECTED",value:[],wrapperClassName:"mt-3"}]},actions:{...i,IF_CONNECTION_SELECTED:({$:r})=>t(r.getComponent("connection-id")?.value),SET_CONNECTION:n("connectionId"),SET_QUERY:n("query"),SET_QUERY_PARAMS:n("queryParams"),ON_MACHINE_LOAD:({$:r})=>{m(r,[{db:"connectionId",id:"connection-id"},{db:"query",id:"query"},{db:"queryParams",id:"query-params"}])}}}));export{N as default};
