import{aa as r,ab as i}from"./_applist-tangy-colts-beg-36.js";import{_ as e}from"./main-tangy-colts-beg.js";import{s as m}from"./machine.-tangy-colts-beg-869.js";import{h as d,b as n,c as s}from"./openaico-tangy-colts-beg-990.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(o,a){return this.cache.has(o)?this.cache.get(o):(this.cache.set(o,a),a)}};const S=r(({helpers:o})=>({states:{components:[s(o),{componentName:o.componentName.select,id:"model-id",label:e("Select Model"),onChange:"SET_MODEL",options:[{label:e("Dall-E-3"),value:"dall-e-3"},{label:e("Dall-E-2"),value:"dall-e-2"}],path:"model",placeholder:e("Select a Model"),render:"IF_CONNECTION_SELECTED",required:!0,value:""},{componentName:o.componentName.mixInput,helperText:e("The maximum length is 1000 characters for dall-e-2 and 4000 characters for dall-e-3."),id:"prompt-id",label:e("Image Generation Prompt"),onChange:"SET_PROMPT",path:"prompt",render:"IF_CONNECTION_SELECTED",required:!0,value:[]},{componentName:o.componentName.select,helperText:e("Size of the image or images."),id:"sizeForDalle2",label:e("Select Size"),onChange:"SET_DALL_E_2_SIZE",options:[{label:e("256x256"),value:"256x256"},{label:e("512x512"),value:"512x512"},{label:e("1024x1024"),value:"1024x1024"}],path:"sizeForDalle2",placeholder:e("Select a Size"),render:"IF_DALL_E_2_SELECTED",required:!0,value:""},{componentName:o.componentName.mixInput,helperText:e("The number of images to generate. Must be between 1 and 10."),id:"number",label:e("Number"),onChange:"SET_NUMBER",path:"n",render:"IF_DALL_E_2_SELECTED",value:[]},{componentName:o.componentName.select,helperText:e("Format to return the image or images in. For Base64-encoded PNG, the raw PNG image can be obtained using the IML function toBinary(<module_no>.data[].b64_json; base64) in following modules."),id:"response_format",label:e("Select Response Format"),onChange:"SET_RESPONSE",options:[{label:e("url"),value:"url"},{label:e("b64_json"),value:"b64_json"}],path:"response_format",placeholder:e("Select a Format"),render:"IF_DALL_E_2_SELECTED",value:""},{componentName:o.componentName.select,helperText:e("Size of the image."),id:"sizeForDalle3",label:e("Select Size"),onChange:"SET_DALL_E_3_SIZE",options:[{label:e("1024x1024"),value:"1024x1024"},{label:e("1792x1024"),value:"1792x1024"},{label:e("1024x1792"),value:"1024x1792"}],path:"sizeForDalle3",placeholder:e("Select a Size"),render:"IF_DALL_E_3_SELECTED",value:""},{componentName:o.componentName.select,helperText:e("Quality of the generated image. HD generates images with finer details and greater consistency across the image."),id:"quality",label:e("Select Quality"),onChange:"SET_QUALITY",options:[{label:e("Standard"),value:"standard"},{label:e("Hd"),value:"hd"}],path:"quality",placeholder:e("Select a Format"),render:"IF_DALL_E_3_SELECTED",required:!0,value:""},{componentName:o.componentName.select,id:"style",label:e("Select Style"),onChange:"SET_STYLE",options:[{label:e("Vivid"),value:"vivid"},{label:e("Natural"),value:"natural"}],path:"style",placeholder:e("Select a Style"),render:"IF_DALL_E_3_SELECTED",required:!0,value:""}]},actions:{SET_CONNECTION:async({$:a,e:l})=>{a.setThisComponent(t=>{t.value=l}),a.setDb(t=>{t.connection=l})},IF_CONNECTION_SELECTED:({$:a})=>{var l;return i((l=a.getComponent("connection-id"))==null?void 0:l.value)},IF_DALL_E_2_SELECTED:({$:a})=>{var l,t;if(i((l=a.getComponent("connection-id"))==null?void 0:l.value)&&((t=a.getComponent("model-id"))==null?void 0:t.value)==="dall-e-2")return!0},IF_DALL_E_3_SELECTED:({$:a})=>{var l,t;if(i((l=a.getComponent("connection-id"))==null?void 0:l.value)&&((t=a.getComponent("model-id"))==null?void 0:t.value)==="dall-e-3")return!0},SET_MODEL:async({$:a,e:l})=>{a.setThisComponent(t=>{t.value=l}),a.setDb(t=>{t.model=l})},SET_NUMBER:n("number"),SET_PROMPT:n("prompt"),SET_DALL_E_2_SIZE:n("sizeForDalle2"),SET_DALL_E_3_SIZE:n("sizeForDalle3"),SET_QUALITY:n("quality"),SET_STYLE:n("style"),SET_RESPONSE:n("responseFormat"),CONNECTION_ADD_CHANGE:d,ON_MACHINE_LOAD:async({$:a})=>{m(a,[{db:"connection",id:"connection-id"},{db:"model",id:"model-id"},{db:"prompt",id:"prompt-id"},{db:"number",id:"number"},{db:"quality",id:"quality"},{db:"style",id:"style"},{db:"responseFormat",id:"response_format"},{db:"sizeForDalle3",id:"sizeForDalle3"},{db:"sizeForDalle2",id:"sizeForDalle2"}])}}}));export{S as default};
