import{aa as r,ab as l}from"./_applist-tangy-colts-beg-36.js";import{_ as t}from"./main-tangy-colts-beg.js";import{s as p}from"./machine.-tangy-colts-beg-869.js";import{h as u,b as i,c as d}from"./openaico-tangy-colts-beg-990.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,e){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,e),e)}};const C=r(({helpers:n})=>({states:{components:[d(n),{componentName:n.componentName.select,id:"model-id",label:t("Select Model"),onChange:"SET_MODEL",options:[{label:t("omni-moderation-latest"),value:"omni-moderation-latest"},{label:t("text-moderation-latest"),value:"text-moderation-latest"}],path:"model",placeholder:t("Select a Model"),render:"IF_CONNECTION_SELECTED",required:!0,value:"omni-moderation-latest"},{componentName:n.componentName.select,fieldType:"config",id:"input-format",label:t("Select Input Format"),onChange:"SET_INPUT_FORMAT",options:[{label:t("Text"),value:"text"},{label:t("Array of Text"),value:"array_of_text"},{label:t("Image"),value:"image"}],placeholder:t("Select a Input Format"),render:"IF_CONNECTION_SELECTED",required:!0,value:void 0},{componentName:n.componentName.mixInput,id:"input",label:t("Input"),onChange:"SET_INPUT",path:"input",render:"IF_NOT_ARRAY_SELECTED",value:[]},{addItemButtonLabel:t("Add Input Fields"),componentName:n.componentName.repeaterField,fieldsMetaData:[{componentName:n.componentName.select,id:"input-entry",label:t("Type"),name:"type",options:[{label:t("Text"),value:"text"}],required:!0,style:{width:150},value:"text"},{componentName:n.componentName.mixInput,label:t("Value"),name:"text",required:!0,value:[],wrapperClassName:"w-100"}],id:"input-list",inputGroupProps:{label:t("Text #{COUNT}")},label:t("Field Mapping"),onChange:"ON_FIELD_MAP_CHANGE",render:"IF_ARRAY_SELECTED",value:[]}]},actions:{SET_CONNECTION:async({$:e,e:o})=>{e.setThisComponent(a=>{a.value=o}),e.setDb(a=>{a.connectionId=o})},IF_CONNECTION_SELECTED:({$:e})=>{var o;return l((o=e.getComponent("connection-id"))==null?void 0:o.value)},IF_ARRAY_SELECTED:({$:e})=>{var o,a;if(l((o=e.getComponent("connection-id"))==null?void 0:o.value)&&((a=e.getComponent("input-format"))==null?void 0:a.value)==="array_of_text")return!0},IF_NOT_ARRAY_SELECTED:({$:e})=>{var o,a,m;if(l((o=e.getComponent("connection-id"))==null?void 0:o.value)&&((a=e.getComponent("input-format"))==null?void 0:a.value)==="text"||((m=e.getComponent("input-format"))==null?void 0:m.value)==="image")return!0},SET_MODEL:i("model"),SET_INPUT_FORMAT:i("inputFormat"),SET_INPUT:i("input"),ON_FIELD_MAP_CHANGE:i("inputList"),CONNECTION_ADD_CHANGE:u,ON_MACHINE_LOAD:async({$:e})=>{p(e,[{db:"connectionId",id:"connection-id"},{db:"model",id:"model-id"},{db:"inputList",id:"input-list"},{db:"input",id:"input"},{db:"inputFormat",id:"input-format"}])}}}));export{C as default};
