import{aa as r,ab as i}from"./_applist-tangy-colts-beg-36.js";import{_ as a}from"./main-tangy-colts-beg.js";import{s as l}from"./machine.-tangy-colts-beg-869.js";import{h as m,c as s}from"./commonut-tangy-colts-beg-826.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:[s(n),{componentName:n.componentName.select,helperText:a("Choose the Groq model to use for translation."),id:"model-id",label:a("Model"),onChange:"SELECT_MODEL",optionFilterProp:"label",options:[{label:a("whisper-large-v3"),value:"whisper-large-v3"},{label:a("distil-whisper-large-v2-en"),value:"distil-whisper-large-v2-en"}],path:"model",render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,value:""},{componentName:n.componentName.mixInput,helperText:a("The audio file to translate. Supported formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm."),id:"audio-file",label:a("Audio File"),onChange:"HANDLE_AUDIO_FILE",path:"file",render:"IF_MODEL_SELECTED",required:!0,value:[]},{componentName:n.componentName.mixInput,helperText:a("An optional text in English to guide the model's style or continue a previous audio segment."),id:"prompt",label:a("Prompt"),onChange:"HANDLE_PROMPT",path:"prompt",render:"IF_MODEL_SELECTED",value:[]},{componentName:n.componentName.mixInput,helperText:a("The sampling temperature, between 0 and 1. Default is 0."),id:"temperature",label:a("Temperature"),onChange:"HANDLE_TEMPERATURE",path:"temperature",render:"IF_MODEL_SELECTED",value:[]},{componentName:n.componentName.select,helperText:a("The format of the translation output."),id:"response-format",label:a("Response Format"),onChange:"HANDLE_RESPONSE_FORMAT",options:[{label:a("JSON"),value:"json"},{label:a("Text"),value:"text"},{label:a("Verbose JSON"),value:"verbose_json"}],path:"response_format",render:"IF_MODEL_SELECTED",value:"json"}]},actions:{IF_CONNECTION_SELECTED:({$:e})=>{var t;return i((t=e.getComponent("connection-id"))==null?void 0:t.value)},IF_MODEL_SELECTED:({$:e})=>{var t,o;return i((t=e.getComponent("connection-id"))==null?void 0:t.value)&&((o=e.getComponent("model-id"))==null?void 0:o.value)!==""},ON_MACHINE_LOAD:async({$:e})=>{l(e,[{db:"connectionId",id:"connection-id"},{db:"modelId",id:"model-id"},{db:"audioFile",id:"audio-file"},{db:"prompt",id:"prompt"},{db:"temperature",id:"temperature"},{db:"responseFormat",id:"response-format"}])},SELECT_MODEL:({$:e,e:t})=>{e.setThisComponent(o=>{o.value=t}),e.setDb(o=>{o.modelId=t})},HANDLE_AUDIO_FILE:({$:e,e:t})=>{e.setThisComponent(o=>{o.value=t}),e.setDb(o=>{o.audioFile=t})},HANDLE_PROMPT:({$:e,e:t})=>{e.setThisComponent(o=>{o.value=t}),e.setDb(o=>{o.prompt=t})},HANDLE_TEMPERATURE:({$:e,e:t})=>{e.setThisComponent(o=>{o.value=t}),e.setDb(o=>{o.temperature=t})},HANDLE_RESPONSE_FORMAT:({$:e,e:t})=>{e.setThisComponent(o=>{o.value=t}),e.setDb(o=>{o.responseFormat=t})},SET_CONNECTION:async({$:e,e:t})=>{e.setThisComponent(o=>{o.value=t}),e.setDb(o=>{o.connectionId=t})},CONNECTION_ADD_CHANGE:m}}));export{c as default};
