vendor: 4,996 bytes, line 1
1import{e as Jt,z as qt,L as Xt,R as Qt,g as A,r as v,O as eo,h as Be,S as to,Y as $e,M as oo,i as ro,j as so,c as n,o as l,F as L,b as lo,x as St,T as no,w as ao,k as p,a as r,I as g,q as y,t as f,l as $,m as C,V as Pt,U as E,E as O,p as Vt,Q as It,n as ge,W as io}from"./BMTcipvY.js";import{f as uo}from"./CnrdOZoC.js";import{u as co}from"./CTM5cs1O.js";import{_ as po}from"./DlAUqK2U.js";const fo={key:0,class:"fixed bottom-0 left-0 right-0 z-[100] p-4 md:p-8 pointer-events-none"},vo={key:0,class:"max-w-lg mx-auto pointer-events-auto"},mo={key:0,class:"flex flex-col md:flex-row md:items-start gap-5 max-h-[calc(100vh-10rem)] overflow-y-auto"},ho={class:"flex-shrink-0 w-full md:w-[20%] lg:w-[18%] transition-all duration-700 ease-out flex flex-col"},go={class:"sticky top-2 flex flex-col group"},xo={class:"relative w-full h-[120px] md:h-[140px] rounded-2xl overflow-hidden bg-black/40 border-[0.5px] border-white/10 shadow-xl flex items-center justify-center transition-all duration-300"},bo={key:0,class:"absolute inset-0 bg-gradient-to-br from-zinc-900/90 to-black/90 flex items-center justify-center z-10"},wo={key:1,class:"absolute inset-0 bg-gradient-to-br from-yellow-900/40 to-orange-900/40 backdrop-blur-[2px] flex flex-col items-center justify-center z-20 border-2 border-yellow-500/50 rounded-2xl"},yo=["src"],_o=["src"],ko={key:4,class:"absolute inset-0 flex items-center justify-center"},Co={key:5,class:"absolute inset-x-0 bottom-0 p-2 flex justify-center bg-gradient-to-t from-black/70 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none"},Mo={class:"flex-1 min-w-0 overflow-visible"},jo={class:"flex flex-col gap-3 overflow-visible"},Ao={key:0,class:"relative px-4 py-3 bg-orange-500/10 border border-orange-500/30 rounded-xl text-sm"},Lo={class:"flex items-start gap-3"},So={class:"flex-1"},Po={class:"text-orange-200 text-xs leading-relaxed"},Vo={class:"flex gap-2 mt-3"},Io={class:"flex gap-4 items-start"},zo={key:0,class:"flex gap-3 shrink-0"},Bo=["onClick"],$o=["onChange"],Eo={key:0,class:"w-full h-full grid grid-cols-2 gap-0.5 p-0.5"},Oo=["src"],To=["src"],Uo={key:2,class:"w-full h-full flex items-center justify-center"},No={key:1,class:"absolute inset-0 flex flex-col items-center justify-center text-gray-500 group-hover:text-violet-400 transition-colors pointer-events-none px-1"},Ho={class:"text-[9px] uppercase tracking-tight font-bold text-center w-full whitespace-nowrap overflow-hidden text-ellipsis"},Ro={key:2,class:"absolute top-1 right-1 bg-black/70 backdrop-blur px-1 py-0.5 rounded text-[8px] text-white font-bold border border-white/10"},Wo={key:3,class:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center"},Do=["onClick"],Fo=["onClick"],Go=["accept","multiple","onChange"],Ko={key:0,class:"w-full h-full"},Yo=["src"],Zo=["src"],Jo={key:2,class:"absolute bottom-1 right-1 bg-black/70 backdrop-blur px-1.5 py-0.5 rounded text-[8px] text-white font-bold border border-white/10"},qo={class:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center"},Xo=["onClick"],Qo={key:1,class:"flex flex-col items-center justify-center text-gray-500 group-hover:text-violet-400 transition-colors pointer-events-none px-1"},er={class:"text-[10px] uppercase tracking-tight font-bold text-center w-full whitespace-nowrap overflow-hidden text-ellipsis"},tr={key:1,class:"flex-1 relative group"},or={key:0,class:"absolute bottom-2 right-12 z-10"},rr=["disabled"],sr={key:0,class:"w-4 h-4 border-2 border-violet-400/30 border-t-violet-400 rounded-full animate-spin"},lr={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},nr=["disabled"],ar=["disabled"],ir=["disabled"],dr=["disabled"],ur=["disabled"],cr={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},pr={key:1,class:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"},fr={class:"flex flex-wrap items-center justify-between gap-3 pt-1 border-t border-white/5 overflow-visible"},vr={class:"flex flex-wrap items-center gap-2 overflow-visible"},mr={class:"relative group"},hr=["innerHTML"],gr={class:"flex-1 min-w-0 truncate text-ellipsis"},xr={key:0,class:"relative"},br={key:0,class:"flex-shrink-0 w-3.5 h-3.5 rounded overflow-hidden bg-white/5"},wr=["src"],yr={key:1,class:"w-3.5 h-3.5 text-blue-400 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},_r={class:"flex-1 min-w-0 truncate text-ellipsis"},kr=["onClick"],Cr={class:"flex-1 min-w-0 truncate text-ellipsis"},Mr={key:0,class:"absolute bottom-full left-0 mb-2 w-40 bg-zinc-900 border border-white/10 rounded-xl shadow-2xl py-1.5 z-[100]"},jr={class:"px-3 py-1.5 border-b border-white/5 mb-1"},Ar={class:"text-[10px] uppercase font-semibold text-gray-500 tracking-widest"},Lr={key:0,class:"max-h-48 overflow-y-auto custom-scrollbar"},Sr=["onClick","title"],Pr={key:1,class:"px-4 py-3 space-y-3"}
vendor: 5,017 bytes, line 1
1,Vr={key:0,class:"relative group/slider pt-1"},Ir=["onUpdate:modelValue","min","max","step"],zr=["onUpdate:modelValue","min","max","step","placeholder"],Br=["onUpdate:modelValue","placeholder"],$r={key:1,class:"relative"},Er={key:0,class:"absolute bottom-full left-0 mb-2 w-52 bg-zinc-900 border border-white/10 rounded-xl shadow-2xl p-0 z-[100] max-h-[400px] overflow-y-auto custom-scrollbar"},Or={class:"p-4 pt-0 space-y-5"},Tr={class:"flex items-center justify-between"},Ur={class:"text-[10px] font-semibold text-gray-500 uppercase tracking-widest"},Nr={class:"text-xs font-mono text-violet-400/90"},Hr={key:0,class:"relative group/slider pt-1 pb-2"},Rr=["onUpdate:modelValue","min","max","step"],Wr={key:1,class:"flex flex-wrap gap-1.5"},Dr=["onClick","title"],Fr={key:2,class:"flex items-center gap-1 bg-white/5 p-1 rounded-xl w-fit"},Gr=["onClick"],Kr=["onClick"],Yr=["onUpdate:modelValue","min","max","step","placeholder"],Zr=["onUpdate:modelValue","placeholder"],Jr={class:"flex items-center gap-4"},qr={key:0,class:"hidden sm:flex flex-col items-end leading-tight"},Xr={class:"flex items-center gap-1"},Qr={class:"text-[11px] font-bold text-white"},es={class:"text-[10px] text-gray-600 font-medium"},ts={key:0,class:"text-[10px] text-red-400 font-semibold"},os={key:1,class:"hidden sm:block text-[10px] font-bold text-gray-500 uppercase tracking-widest"},rs=["disabled"],ss={key:0,class:"w-5 h-5 transition-transform group-hover:-translate-y-0.5 relative z-10",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},ls={key:1,class:"w-4 h-4 border-2 border-violet-900/30 border-t-violet-900 rounded-full animate-spin relative z-10"},ns={key:1,class:"flex flex-col gap-3"},as={key:0,class:"relative px-4 py-3 bg-orange-500/10 border border-orange-500/30 rounded-xl text-sm"},is={class:"flex items-start gap-3"},ds={class:"flex-1"},us={class:"text-orange-200 text-xs leading-relaxed"},cs={class:"flex gap-2 mt-3"},ps={class:"flex gap-4 items-start"},fs={key:0,class:"flex gap-3 shrink-0"},vs=["onClick"],ms=["onChange"],hs={key:0,class:"w-full h-full grid grid-cols-2 gap-0.5 p-0.5"},gs=["src"],xs=["src"],bs={key:2,class:"w-full h-full flex items-center justify-center"},ws={key:1,class:"absolute inset-0 flex flex-col items-center justify-center text-gray-500 group-hover:text-violet-400 transition-colors pointer-events-none px-1"},ys={class:"text-[9px] uppercase tracking-tight font-bold text-center w-full whitespace-nowrap overflow-hidden text-ellipsis"},_s={key:2,class:"absolute top-1 right-1 bg-black/70 backdrop-blur px-1 py-0.5 rounded text-[8px] text-white font-bold border border-white/10"},ks={key:3,class:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center"},Cs=["onClick"],Ms=["onClick"],js=["accept","multiple","onChange"],As={key:0,class:"w-full h-full"},Ls=["src"],Ss=["src"],Ps={key:2,class:"absolute bottom-1 right-1 bg-black/70 backdrop-blur px-1.5 py-0.5 rounded text-[8px] text-white font-bold border border-white/10"},Vs={class:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center"},Is=["onClick"],zs={key:1,class:"flex flex-col items-center justify-center text-gray-500 group-hover:text-violet-400 transition-colors pointer-events-none px-1"},Bs={class:"text-[10px] uppercase tracking-tight font-bold text-center w-full whitespace-nowrap overflow-hidden text-ellipsis"},$s={key:1,class:"flex-1 relative group"},Es={key:0,class:"absolute bottom-2 right-12 z-10"},Os=["disabled"],Ts={key:0,class:"w-4 h-4 border-2 border-violet-400/30 border-t-violet-400 rounded-full animate-spin"},Us={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Ns=["disabled"],Hs=["disabled"],Rs=["disabled"],Ws=["disabled"],Ds=["disabled"],Fs={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Gs={key:1,class:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"},Ks={class:"flex flex-wrap items-center justify-between gap-3 pt-1 border-t border-white/5 overflow-visible"},Ys={class:"flex flex-wrap items-center gap-2 overflow-visible"},Zs={class:"relative group"},Js=["innerHTML"],qs={class:"flex-1 min-w-0 truncate text-ellipsis"},Xs={key:0,class:"relative"},Qs={key:0,class:"flex-shrink-0 w-3.5 h-3.5 rounded overflow-hidden bg-white/5 mt-0.5"},el=["src"],tl={key:1,class:"w-3.5 h-3.5 text-blue-400 shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},ol={class:"flex-1 min-w-0 line-clamp-2 break-words whitespace-normal text-left"},rl=["onClick"],sl={class:"flex-1 min-w-0 truncate text-ellipsis"},ll={key:0,class:"absolute bottom-full left-0 mb-2 w-40 bg-zinc-900 border border-white/10 rounded-xl shadow-2xl py-1.5 z-[100]"},nl={class:"px-3 py-1.5 border-b border-white/5 mb-1"},al={class:"text-[10px] uppercase font-semibold text-gray-500 tracking-widest"},il={key:0,class:"max-h-48 overflow-y-auto custom-scrollbar"},dl=["onClick","title"],ul={key:1,class:"px-4 py-3 space-y-3"}
1,cl={key:0,class:"relative group/slider pt-1"},pl=["onUpdate:modelValue","min","max","step"],fl=["onUpdate:modelValue","min","max","step","placeholder"],vl=["onUpdate:modelValue","placeholder"],ml={key:1,class:"relative"},hl={key:0,class:"absolute bottom-full left-0 mb-2 w-52 bg-zinc-900 border border-white/10 rounded-xl shadow-2xl p-0 z-[100] max-h-[400px] overflow-y-auto custom-scrollbar"},gl={class:"p-4 pt-0 space-y-5"},xl={class:"flex items-center justify-between"},bl={class:"text-[10px] font-semibold text-gray-500 uppercase tracking-widest"},wl={class:"text-xs font-mono text-violet-400/90"},yl={key:0,class:"relative group/slider pt-1 pb-2"},_l=["onUpdate:modelValue","min","max","step"],kl={key:1,class:"flex flex-wrap gap-1.5"},Cl=["onClick","title"],Ml={key:2,class:"flex items-center gap-1 bg-white/5 p-1 rounded-xl w-fit"},jl=["onClick"],Al=["onClick"],Ll=["onUpdate:modelValue","min","max","step","placeholder"],Sl=["onUpdate:modelValue","placeholder"],Pl={class:"flex items-center gap-4"},Vl={key:0,class:"hidden sm:flex flex-col items-end leading-tight"},Il={class:"flex items-center gap-1"},zl={class:"text-[11px] font-bold text-white"},Bl={class:"text-[10px] text-gray-600 font-medium"},$l={key:0,class:"text-[10px] text-red-400 font-semibold"},El={key:1,class:"hidden sm:block text-[10px] font-bold text-gray-500 uppercase tracking-widest"},Ol=["disabled"],Tl={key:0,class:"w-5 h-5 transition-transform group-hover:-translate-y-0.5 relative z-10",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Ul={key:1,class:"w-4 h-4 border-2 border-violet-900/30 border-t-violet-900 rounded-full animate-spin relative z-10"},Nl=["onClick","title"],Hl=["innerHTML"],Rl=["onClick","title"],Wl={class:"flex items-center gap-2 min-w-0 flex-1"},Dl={key:0,class:"flex-shrink-0 w-4 h-4 rounded overflow-hidden bg-white/5"},Fl=["src"],Gl={class:"text-xs min-w-0 line-clamp-2 break-words whitespace-normal"},Kl={key:0,class:"text-[10px] text-gray-500 shrink-0 tabular-nums"},Yl=100,zt=120,Zl=400,Bt="random_prompts_cache_v1",Jl=Jt({__name:"GenerationBar",setup(ql){const W=qt(),T=Xt(),ie=Qt(),{toast:S}=oo(),{confirm:Xe}=io(),{getBadgeLabel:Ee,getBadgeClassObject:Oe}=co(),xe=[{value:"image-to-video",label:"IMG2VID",iconSvg:'<svg class="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="m15.75 10.5 4.72-4.72a.75.75 0 0 1 1.28.53v11.38a.75.75 0 0 1-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25h-9A2.25 2.25 0 0 0 2.25 7.5v9a2.25 2.25 0 0 0 2.25 2.25Z" /></svg>'},{value:"text-to-video",label:"TXT2VID",iconSvg:'<svg class="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h1.5C5.496 19.5 6 18.996 6 18.375m-3.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-1.5A1.125 1.125 0 0 1 18 18.375M20.625 4.5H3.375m17.25 0c.621 0 1.125.504 1.125 1.125M20.625 4.5h-1.5C18.504 4.5 18 5.004 18 5.625m3.75 0v1.5c0 .621-.504 1.125-1.125 1.125M3.375 4.5c-.621 0-1.125.504-1.125 1.125M3.375 4.5h1.5C5.496 4.5 6 5.004 6 5.625m-3.75 0v1.5c0 .621.504 1.125 1.125 1.125m0 0h1.5m-1.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m1.5-3.75C5.496 8.25 6 7.746 6 7.125v-1.5M4.875 8.25C5.496 8.25 6 8.754 6 9.375v1.5m0-5.25v5.25m0-5.25C6 5.004 6.504 4.5 7.125 4.5h9.75c.621 0 1.125.504 1.125 1.125m1.125 2.625h1.5m-1.5 0A1.125 1.125 0 0 1 18 7.125v-1.5m1.125 2.625c-.621 0-1.125.504-1.125 1.125v1.5m2.625-2.625c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125M18 5.625v5.25M7.125 12h9.75m-9.75 0A1.125 1.125 0 0 1 6 10.875M7.125 12C6.504 12 6 12.504 6 13.125m0-2.25C6 11.496 5.496 12 4.875 12M18 10.875c0 .621-.504 1.125-1.125 1.125M18 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m-12 5.25v-5.25m0 5.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125m-12 0v-1.5c0-.621-.504-1.125-1.125-1.125M18 18.375v
1-5.25m0 5.25v-1.5c0-.621.504-1.125 1.125-1.125M18 13.125v1.5c0 .621.504 1.125 1.125 1.125M18 13.125c0-.621.504-1.125 1.125-1.125M6 13.125v1.5c0 .621-.504 1.125-1.125 1.125M6 13.125C6 12.504 5.496 12 4.875 12m-1.5 0h1.5m-1.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M19.125 12h1.5m0 0c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h1.5m14.25 0h1.5" /></svg>'},{value:"text-to-image",label:"TXT2IMG",iconSvg:'<svg class="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z" /></svg>'},{value:"image-to-image",label:"IMG2IMG",iconSvg:'<svg class="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5" /></svg>'},{value:"video-effects",label:"VID FX",iconSvg:'<svg class="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z" /></svg>'},{value:"image-effects",label:"IMG FX",iconSvg:'<svg class="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M9.53 16.122a3 3 0 0 0-5.78 1.128 2.25 2.25 0 0 1-2.4 2.245 4.5 4.5 0 0 0 8.4-2.245c0-.399-.078-.78-.22-1.128Zm0 0a15.998 15.998 0 0 0 3.388-1.62m-5.043-.025a15.994 15.994 0 0 1 1.622-3.395m3.42 3.42a15.995 15.995 0 0 0 4.764-4.648l3.876-5.814a1.151 1.151 0 0 0-1.597-1.597L14.146 6.32a15.996 15.996 0 0 0-4.649 4.763m3.42 3.42a6.776 6.776 0 0 0-3.42-3.42" /></svg>'}],$t=A(()=>{const o=be.value||{},t=new Set(Object.keys(o)),e=xe.filter(u=>t.has(u.value)),s=new Set(xe.map(u=>u.value)),i=[];Object.keys(o).forEach(u=>{if(!s.has(u)){let m=u;if(de.value){const h=de.value.find(_=>_.category_name===u||_.page_path===`/generate/${u}`);h&&(m=h.category_name)}i.push({value:u,label:m.toUpperCase(),iconSvg:'<svg fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6"><path stroke-linecap="round" stroke-linejoin="round" d="M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z" /></svg>'})}});const c=[...e,...i];if(de.value&&de.value.length>0){const u=new Map;de.value.forEach((m,h)=>{u.set(m.category_name,m.sort_order||h)}),c.sort((m,h)=>{const _=u.has(m.value)?u.get(m.value):999,z=u.has(h.value)?u.get(h.value):999;return _-z})}return c.length>0?c:xe}),de=v([]),Qe=async()=>{try{const o=await W.get("/api/generate-pages/tree-active");o.success&&(de.value=o.data||[])}catch(o){console.error("Failed to fetch generate pages tree:",o)}},et=v(!1),q=v(!1),Te=v(0),ke=v(null),Ue=v(null),ue=v(null),ce=v(!1),Ne=v(0),be=v({}
1),tt=v(!0),U=v(!0),X=v(""),V=v(""),Q=v(null),le=v(!1),ne=v([]),N=new Set,M=v(null),D=A(()=>M.value!==null&&N.has(M.value)),j=v(!1),H=v(null),K=v(!1),I=v(!1),Ce=v(!1),He=v(""),Me=v(null),a=eo({type:"text-to-image",model:"",prompt:"",params:{},image_previews:{}}),Re=v({}),Y=v(!1),Z=v(!1),ae=v(null),ee=v(!1),je=v(!1),We=v(null),De=v(null),ot=v({left:"0px",bottom:"0px"}),rt=v({left:"0px",bottom:"0px"});function Et(){const o=We.value;if(!o)return;const t=o.getBoundingClientRect();ot.value={left:`${t.left}px`,bottom:`${window.innerHeight-t.top+8}px`}}function Ot(){const o=De.value;if(!o)return;const t=o.getBoundingClientRect();rt.value={left:`${t.left}px`,bottom:`${window.innerHeight-t.top+8}px`}}Be(Y,o=>{o&&ge(()=>Et())}),Be(Z,o=>{o&&ge(()=>Ot())});const st=A(()=>xe.find(o=>o.value===a.type)?.label||"Type"),lt=A(()=>xe.find(o=>o.value===a.type)?.iconSvg||""),we=A(()=>be.value[a.type]||[]),x=A(()=>we.value.find(o=>o.name===a.model)),nt=A(()=>x.value?.display_name||"Select Model"),Tt=A(()=>we.value.slice().sort((o,t)=>{const e=typeof o.sort_order=="number"?o.sort_order:Number.POSITIVE_INFINITY,s=typeof t.sort_order=="number"?t.sort_order:Number.POSITIVE_INFINITY;if(e!==s)return e-s;const i=typeof o.cost=="number"?o.cost:Number.POSITIVE_INFINITY,c=typeof t.cost=="number"?t.cost:Number.POSITIVE_INFINITY;return i-c}).map(o=>({value:o.name,label:o.display_name||o.name,description:o.description,right:`${o.cost||0} ð`,icon_url:o.icon_url||null,badge:o.badge||null}))),at=A(()=>x.value?.params?Object.keys(x.value.params).filter(o=>{const t=x.value.params[o],e=o!=="prompt",s=t.visible!==!1,i=t.type!=="image"&&t.type!=="video";return e&&s&&i}):[]),it=A(()=>{const o=x.value?.params?.prompt;return o&&o.visible!==!1}),pe=A(()=>x.value?.params?Object.keys(x.value.params).filter(o=>{const t=x.value.params[o];return(t.type==="image"||t.type==="video"||t.type==="array")&&t.visible!==!1}):[]),dt=A(()=>at.value.slice(0,3)),Fe=A(()=>at.value.slice(3)),ut=A(()=>Fe.value.length>0),te=A(()=>{if(!x.value)return 0;const o=x.value.cost||0;let t=0;const e=x.value.params||{};for(const[s,i]of Object.entries(a.params)){const c=e[s];if(!c?.cost_additions||typeof c.cost_additions!="object")continue;const u=c.cost_additions,m=String(i);let h;if(m in u)h=Number(u[m]);else if(Array.isArray(u._ranges)&&u._ranges.length>0){const _=typeof i=="number"?i:Number(i);if(!Number.isNaN(_)){for(const z of u._ranges)if(Array.isArray(z)&&z.length>=3){const P=Number(z[0]),B=Number(z[1]),w=z[2];if(P<=_&&_<=B){h=typeof w=="number"?w:Number(w)||0;break}}}}h!==void 0&&!Number.isNaN(h)&&(t+=h)}return o+t}),ye=A(()=>{if(!a.model||x.value?.params?.prompt?.required&&!a.prompt.trim())return!1;for(const o of pe.value)if(x.value.params[o].required&&!a.params[o])return!1;return!0}),Ge=async()=>{try{tt.value=!0;const o=await W.get("/api/generate/models");o.success&&(be.value=o.data,Ke())}catch(o){console.error("Failed to fetch configs:",o)}finally{tt.value=!1}},Ke=()=>{const o=we.value;o.length>0&&(a.model=o[0].name,Ye())},Ye=(o=!1)=>{const t=x.value;if(!t?.params)return;const e={},s={};t.params.prompt&&(!o||!a.prompt)&&(a.prompt=t.params.prompt.default||""),Object.entries(t.params).forEach(([c,u])=>{const m=u.type==="image"||u.type==="video",h=a.params[c],_=m&&typeof h=="string"&&h===Re.value[c];if(o&&h!==void 0&&!_){if(e[c]=a.params[c],m&&typeof a.params[c]=="string"&&(a.params[c].startsWith("http")||a.params[c].startsWith("data:image")))s[c]=a.params[c];else if(u.type==="array"&&a.params[c]){const P=R(c);if(P.length>0){const B=P[0];typeof B=="string"&&(s[c]=B)}}}else if(e[c]=u.default,(u.type==="image"||u.type==="video")&&typeof u.default=="string"&&(u.default.startsWith("http")||u.default.startsWith("data:image")||u.default.startsWith("data:video")))s[c]=u.default;else if(u.type==="array"&&u.default){let P=[];if(Array.isArray(u.default))P=u.default.filter(B=>typeof B=="string");else if(typeof u.default=="string")try{const B=JSON.parse(u.default);Array.isArray(B)?P=B.filter(w=>typeof w=="string"):P=[u.default]}catch{P=u.default.split(",").map(B=>B.trim()).filter(Boolean)}P.length>0&&(e[c]=P,s[c]=P[0])}}),a.params=e,a.image_previews=o?{...a.image_previews,...s}:s;const i={};
1Object.entries(t.params).forEach(([c,u])=>{(u.type==="image"||u.type==="video")&&typeof u.default=="string"&&(u.default.startsWith("http")||u.default.startsWith("data:"))&&(i[c]=u.default)}),Re.value=i},Ut=async()=>{q.value=!0,typeof window<"u"&&(Te.value=window.scrollY),await ge(),ke.value?.focus()},ct=o=>{if(!q.value)return;if(ce.value){ce.value=!1;return}const t=o.target;t?.tagName==="INPUT"&&t.type==="file"||Ue.value&&!Ue.value.contains(t)&&(q.value=!1)};function Nt(){if(typeof window>"u")return;const o=window.scrollY,t=document.documentElement.scrollHeight,e=window.innerHeight,s=o+e>=t-Yl;if(!q.value){s&&(q.value=!0,Te.value=o);return}if(Date.now()-Ne.value<Zl||D.value)return;const i=Te.value;(o<i-zt||o>i+zt)&&(q.value=!1)}function pt(){ue.value==null&&(ue.value=setTimeout(()=>{ue.value=null,Nt()},100))}const Ht=()=>{try{const o=localStorage.getItem(Bt);if(o){const t=JSON.parse(o);Array.isArray(t)&&(ne.value=t.filter(e=>typeof e=="string"&&e.trim()))}}catch{}},Ae=()=>{U.value=!0},Rt=async()=>{const o=Q.value?.url_slug,t=Q.value?.short_code,e=M.value||Q.value?.id;if(o)return ie.push(`/prompt/${o}`);if(t)return ie.push(`/prompt/${t}`);if(e)try{const s=await W.get(`/api/generate/${e}`);if(s.success&&s.data){Q.value=s.data;const i=s.data.url_slug||s.data.short_code;if(i)return ie.push(`/prompt/${i}`)}}catch(s){console.warn("Failed to fetch work for navigation",s)}S.error("Work is not ready yet. Please try again.")},ft=o=>{try{localStorage.setItem(Bt,JSON.stringify(o))}catch{}},vt=o=>o?.prompt&&String(o.prompt)||o?.params?.prompt&&String(o.params.prompt)||o?.payload?.prompt&&String(o.payload.prompt)||o?.meta?.prompt&&String(o.meta.prompt)||o?.data?.prompt&&String(o.data.prompt)||"",mt=async()=>{const o=await W.get("/api/works/featured/preview",{params:{limit:50}});if(o.success&&o.data){const e=(Array.isArray(o.data)?o.data:[]).filter(s=>{if(!vt(s).trim())return!1;const c=s?.is_featured===void 0?!0:s.is_featured===!0,u=s?.hidden===void 0?!0:s.hidden===!1,m=s?.deleted_at===void 0?!0:!s.deleted_at;return c&&u&&m}).map(s=>vt(s).trim());e.length>0?(ne.value=e,ft(e)):(ne.value=[],ft([]))}},ht=async()=>{if(!le.value){le.value=!0;try{if(ne.value.length===0&&await mt(),ne.value.length>0){const o=ne.value[Math.floor(Math.random()*ne.value.length)];a.prompt=o,await ge(),ke.value?.focus()}}catch{}finally{le.value=!1}}},Wt={optimize:"Prompt rewritten!",expand:"Prompt expanded!",condense:"Prompt condensed!",suggest:"Variations ready!"},oe=async o=>{if(K.value=!1,!T.isAuthenticated){S.error("Please log in to use AI Assistant");return}if(!a.prompt?.trim()){S.error("Please enter a prompt first");return}try{I.value=!0;const t=await W.post("/api/generate/prompt-assistant",{prompt:a.prompt,action:o,model_type:a.type});t.success&&t.data?.improved_prompt?(a.prompt=t.data.improved_prompt,S.success(Wt[o]||"Done!")):S.error(t.message||"AI Assistant failed")}catch(t){console.error("AI Assistant error:",t),S.error(t.message||"AI Assistant failed")}finally{I.value=!1}},Dt=o=>new Promise(t=>{He.value=o,Me.value=t,Ce.value=!0}),fe=o=>{Ce.value=!1,Me.value&&(Me.value(o),Me.value=null)},re=o=>o.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase()),Le=o=>{if(o instanceof File)return o.type.startsWith("image/");if(typeof o!="string"||!o)return!1;const t=[".jpg",".jpeg",".png",".gif",".webp",".bmp",".svg"],e=o.toLowerCase();return t.some(s=>e.includes(s))||e.includes("image")||e.startsWith("data:image")},gt=o=>{if(o instanceof File)return o.type.startsWith("video/");if(typeof o!="string"||!o)return!1;const t=[".mp4",".webm",".ogg",".mov",".avi",".mkv"],e=o.toLowerCase();return t.some(s=>e.includes(s))||e.includes("video")},Se=new Map,Pe=o=>{if(o==null)return"";if(typeof o=="string")return o;if(o instanceof File){let t=Se.get(o);return t||(t=URL.createObjectURL(o),Se.set(o,t)),t}return""},G=o=>{const t=String(o),e=a.image_previews[t];if(e)return e;const s=a.params[t];return typeof s=="string"&&(s.startsWith("http")||s.startsWith("data:"))?s:""},ve=o=>{if(o==null)return"";if(typeof o=="string")return o;if(typeof o=="number"||typeof o=="boolean")return String(o);if(typeof o=="object"){if(typeof o.label=="string")return o.label;if(typeof o.name=="string")return o.name;if(typeof o.title=="string")return o.title;if(typeof o.text=="string")return o.text;if(typeof o.display=="string")return o.display;
1if(typeof o.displayName=="string")return o.displayName;if(o.value!==void 0&&o.value!==null&&typeof o.value!="object")return String(o.value);if(Array.isArray(o)&&o.length>0)return ve(o[0]);for(const e of Object.keys(o)){if(e==="type")continue;const s=o[e];if(typeof s=="string")return s;if(typeof s=="number")return String(s)}const t=Object.keys(o);if(t.length>0){const e=t.find(i=>i!=="type")||t[0],s=o[e];if(typeof s=="string"||typeof s=="number")return String(s)}}return""},xt=o=>{if(!o||typeof o!="object"||Array.isArray(o))return!1;const t="type"in o,e="options"in o||"default"in o||"min"in o||"max"in o||"step"in o||"name"in o||"description"in o;return t&&e},Ft=o=>o==null?o:xt(o)?o.default:typeof o=="object"&&!Array.isArray(o)&&o.value!==void 0&&o.value!==null&&typeof o.value!="object"?o.value:o,_e=o=>{let t=a.params[o];const e=d(o);if(!e)return ve(t);if(t==null&&(t=e.default),t==null)return"";if(e.options&&e.options.length>0)if(typeof e.options[0]=="object"&&e.options[0]!==null){const s=e.options.find(i=>typeof t=="object"&&t!==null?JSON.stringify(i)===JSON.stringify(t)||i.value!==void 0&&t.value!==void 0&&i.value===t.value||i.type!==void 0&&t.type!==void 0&&i.type===t.type||i.id!==void 0&&t.id!==void 0&&i.id===t.id:i.value===t||i.type===t||i.id===t||i===t);if(s)return ve(s);if(typeof t=="object")return ve(t)}else{const s=e.options.find(i=>String(i)===String(t));if(s!==void 0)return String(s)}return e.type==="bool"?t?"On":"Off":typeof t=="number"?`${t}${e.unit||""}`:ve(t)},bt=o=>String(_e(o)||"").length>12,wt=A(()=>a.type.includes("video")),d=o=>x.value?.params?.[o],me=o=>{const t=d(o);return t?t.type==="bool"&&(!t.options||!t.options.length)?[{value:!0,label:"On"},{value:!1,label:"Off"}]:t.options?t.options.map(e=>typeof e=="object"&&e!==null?{value:e.value!==void 0?e.value:e.type!==void 0?e.type:e.id!==void 0?e.id:e,label:ve(e)}:{value:e,label:String(e)}):[]:[]},Gt=o=>{a.type=o,Y.value=!1,Ke()},Kt=o=>{a.model=o,Z.value=!1,Ye(!0)},yt=o=>{ae.value=ae.value===o?null:o},Ve=(o,t)=>{a.params[o]=t,ae.value=null},Ie=(o,t)=>{const e=a.params[o];return e===t?!0:e==null?!1:typeof e=="object"&&e!==null&&(t===e.value||t===e.type||t===e.id||typeof t=="object"&&JSON.stringify(e)===JSON.stringify(t))?!0:String(e)===String(t)},_t=(o,t)=>{const e=o.target;if(!e.files||e.files.length===0)return;ce.value=!0,Ne.value=Date.now(),setTimeout(()=>{ce.value=!1},150);const s=Array.from(e.files);if(d(t)?.multiple){a.params[t]=s;const c=new FileReader;c.onload=u=>{a.image_previews[t]=u.target?.result},c.readAsDataURL(s[0]),s.length>1&&S.success(`${s.length} images selected`)}else{const c=s[0];a.params[t]=c;const u=new FileReader;u.onload=m=>{a.image_previews[t]=m.target?.result},u.readAsDataURL(c)}e&&(e.value="")},ze=o=>{a.params[o]=null,delete a.image_previews[o]},Ze=v({}),kt=o=>{Ze.value[o]?.click()},Je=v({}),Ct=o=>{Je.value[o]?.click()},R=o=>{const t=a.params[o];if(!t)return[];if(Array.isArray(t))return t.filter(e=>e!=null);if(typeof t=="string")try{const e=JSON.parse(t);return Array.isArray(e)?e.filter(s=>typeof s=="string"):[t]}catch{return t.split(",").map(e=>e.trim()).filter(Boolean)}return[]},Mt=o=>{const t=R(o);for(;t.length<4;)t.push(null);return t.slice(0,4)},jt=(o,t)=>{const e=o.target;if(!e.files||e.files.length===0)return;ce.value=!0,Ne.value=Date.now();const s=()=>{setTimeout(()=>{ce.value=!1},150)},i=Array.from(e.files);if(d(t),i.filter(h=>!h.type.startsWith("image/")&&!h.type.startsWith("video/")).length>0){S.error("Please upload only image or video files"),s();return}const m=[...R(t),...i];if(a.params[t]=m,m.length>0){const h=m[0];if(h instanceof File){const _=new FileReader;_.onload=z=>{a.image_previews[t]=z.target?.result},_.readAsDataURL(h)}else typeof h=="string"&&(a.image_previews[t]=h)}i.length>1&&S.success(`${i.length} files added`),e&&(e.value=""),s()},At=o=>{o.shiftKey||qe()};to().hook("ws:generation_complete",o=>{const t=o.work_id;if(N.has(t)){if(o.status==="success")N.delete(t),M.value===t&&(V.value=o.file_url,Q.value={id:o.work_id,status:"success",file_url:o.file_url,nsfw_status:o.nsfw_status,type:a.type},X.value="Complete!",U.value=!0,M.value=null,H.value==="MEDIUM"||H.value==="LOW"||o.nsfw_status==="PENDING"?j.value=!0:o.nsfw_status==="APPROVED"?(j.value=!1,H.value=null):j.value=!1);else if(o.status==="failed"){N.delete(t),M.value===t&&(U.value=!0,M.value=null),j.value=!1,H.value=null;const e=$e(o.error_message||"AI creation failed","GenerationBar.ws");S.error(e)}}});const qe=async()=>
1{if(ye.value){if(!T.isAuthenticated){{const t={type:a.type,model:a.model,prompt:a.prompt,params:{...a.params},image_previews:{...a.image_previews}},e={};for(const[s,i]of Object.entries(t.params))i instanceof File?e[s]={_isFile:!0,_fileName:i.name}:Array.isArray(i)&&i.length>0&&i[0]instanceof File?e[s]={_isFileArray:!0,_fileNames:i.map(c=>c.name)}:e[s]=i;t.params=e,sessionStorage.setItem("generation_bar_form_state",JSON.stringify(t))}if(await Xe({title:"Login Required",message:"You need to log in first to generate. Go to login page?",confirmText:"Go to Login",cancelText:"Cancel"})){const t=ie.currentRoute.value.fullPath;ie.push(`/auth/login?redirect=${encodeURIComponent(t)}`)}return}if(T.availableCredits<te.value){await Xe({title:"Insufficient Credits",message:`You need ${te.value} credits but have ${T.availableCredits}. Go to recharge page?`,confirmText:"Go to Recharge",cancelText:"Cancel",type:"warning"})&&ie.push("/recharge");return}try{const o={};for(const e in a.params){const s=a.params[e];!(s instanceof File)&&!(Array.isArray(s)&&s.length>0&&s[0]instanceof File)&&(o[e]=s)}a.prompt?o.prompt=a.prompt:a.params.prompt&&(o.prompt=a.params.prompt);const t=await W.post("/api/generate/check-moderation",{type:a.type,model_name:a.model,params:o});if(j.value=!1,H.value=null,!t.success)console.warn("Moderation check API call failed:",t.message||"Unknown error"),S.warning("Content check failed, proceeding...",3e3);else if(t.data.has_violation){const{max_severity:e,flagged_keywords:s,nsfw_tags:i}=t.data;if(e==="HIGH"){const c=s.filter(u=>u.severity==="HIGH").map(u=>u.word).join(", ");X.value="",await ge(),setTimeout(()=>{S.error(`Generation blocked: flagged terms ${c}. Please adjust your prompt.`,8e3)},100);return}if(e==="MEDIUM"){const c=s.filter(m=>m.severity==="MEDIUM").map(m=>m.word).join(", ");if(!await Dt(`Your prompt contains flagged terms: ${c}. Continue anyway?`)){X.value="";return}H.value="MEDIUM"}e==="LOW"&&(H.value="LOW")}}catch(o){console.error("Moderation check failed:",o),S.warning("Content check failed, proceeding...",3e3),j.value=!1,H.value=null}try{U.value=!1,X.value="Uploading...",N.size===0&&(V.value="",Q.value=null);const o={...a.params};if(x.value?.params)for(const[e,s]of Object.entries(x.value.params))s.visible===!1&&s.default!==void 0&&s.default!==null&&(o[e]=s.default);for(const e of pe.value){let s=o[e];const i=d(e);if(i?.multiple===!0&&typeof s=="string"&&s.trim()&&!Array.isArray(s)&&(s.startsWith("http")||s.startsWith("data:"))&&(s=[s],o[e]=s),i?.type==="array"){if(Array.isArray(s)&&s.length>0){const c=[];for(const u of s)if(u instanceof File){const m=new FormData;m.append("file",u);const h=await W.upload("/api/upload",m);h.success&&c.push(h.data.url)}else typeof u=="string"&&(u.startsWith("http")||u.startsWith("data:"))&&c.push(u);c.length>0&&(o[e]=c)}}else if(s instanceof File){const c=new FormData;c.append("file",s);const u=await W.upload("/api/upload",c);u.success&&(o[e]=u.data.url)}else if(Array.isArray(s)&&s.length>0&&s[0]instanceof File){const c=[];for(const u of s){const m=new FormData;m.append("file",u);const h=await W.upload("/api/upload",m);h.success&&c.push(h.data.url)}o[e]=c}}X.value="Generating...";const t=await W.post("/api/generate",{type:a.type,model_name:a.model,params:{...o,prompt:a.prompt}});if(t.success){a.prompt;const e=t.data.work_id;M.value=e,T.updateCredits(t.data.remaining_credits),Yt(e)}else throw new Error(t.message||"Generation failed")}catch(o){N.size===0&&(U.value=!0,M.value=null),j.value=!1,H.value=null;const t=$e(o,"GenerationBar.handleGenerate");S.error(t)}}},Yt=async o=>{N.add(o);const t=60;let e=0;const s=async()=>{if(N.has(o))try{const i=await W.get(`/api/generate/${o}`);if(i.success){const c=i.data;if(c.status==="generating"||c.status==="processing")M.value===o&&(X.value=""),e++,e<t?setTimeout(s,2e3):(N.delete(o),M.value===o&&(U.value=!0,M.value=null));else if(c.status==="success")N.delete(o),M.value===o&&(V.value=c.canonical_url||c.file_url,Q.value=c,X.value="Complete!",U.value=!0,M.value=null,H.value==="MEDIUM"||H.value==="LOW"||c.nsfw_status==="PENDING"?j.value=!0:c.nsfw_status==="APPROVED"?(j.value=!1,H.value=null):j.value=!1);else if(c.status==="failed"){N.delete(o),M.value===o&&(U.value=!0,M.value=null),j.value=!1,H.value=null;const u=$e(c.error_message||"Generation failed","GenerationBar.poll");S.error(u);return}}}catch(i){N.delete(o),M.value===o&&(U.value=!0,M.value=null),j.value=!1;const c=$e(i,"GenerationBar.poll");S.error(c)}};s()},Lt=async o=>{const t=o.detail;if(!t)return;q.value=!0,Object.keys(be.value).length===0&&await Ge();let e=t;const s=t.params&&typeof t.params=="object"&&Object.keys(t.params).length>0,i=t.prompt&&t.prompt.trim().length>0,c=t.model_name||t.model;if(t.id&&!i&&(!s||!c))try{const w=await W.get(`/api/works/${t.id}`);w.success&&w.data&&(e=w.data)}catch(w){console.error("Failed to fetch work details:",w)}je.value=!0,e.type&&(a.type=e.type);const u=be.value[e.type]||[],m=e.model_key||e.model_name||e.model||e.params?.model_name,_=(m?uo(m,u):{model:null}).model||u[0];
1_&&(a.model=_.name),a.prompt=e.prompt||_?.params?.prompt?.default||"";const z={},P={};_?.params&&Object.entries(_.params).forEach(([w,b])=>{if(z[w]=b.default,(b.type==="image"||b.type==="video")&&typeof b.default=="string"&&(b.default.startsWith("http")||b.default.startsWith("data:image")||b.default.startsWith("data:video")))P[w]=b.default;else if(b.type==="array"&&b.default){let k=[];if(Array.isArray(b.default))k=b.default.filter(F=>typeof F=="string");else if(typeof b.default=="string")try{const F=JSON.parse(b.default);Array.isArray(F)?k=F.filter(J=>typeof J=="string"):k=[b.default]}catch{k=b.default.split(",").map(F=>F.trim()).filter(Boolean)}k.length>0&&(z[w]=k,P[w]=k[0])}}),a.params=z,a.image_previews={...a.image_previews,...P};const B={};_?.params&&Object.entries(_.params).forEach(([w,b])=>{(b.type==="image"||b.type==="video")&&typeof b.default=="string"&&(b.default.startsWith("http")||b.default.startsWith("data:"))&&(B[w]=b.default)}),Re.value=B,await ge(),je.value=!1,e.params&&_?.params&&Object.entries(e.params).forEach(([w,b])=>{if(["prompt","model_name","type","model"].includes(w))return;const k=Ft(b);if(k==null||xt(b))return;const F=_.params[w];if(F){if(a.params[w]=k,(F.type==="image"||F.type==="video")&&typeof k=="string"&&(k.startsWith("http")||k.startsWith("data:image")||k.startsWith("data:video")))a.image_previews[w]=k;else if(F.type==="array"){let J=[];if(Array.isArray(k))J=k.filter(he=>typeof he=="string");else if(typeof k=="string")try{const he=JSON.parse(k);Array.isArray(he)?J=he.filter(Zt=>typeof Zt=="string"):J=[k]}catch{J=k.split(",").map(he=>he.trim()).filter(Boolean)}J.length>0&&(a.params[w]=J,a.image_previews[w]=J[0])}}}),V.value="",Q.value=null,X.value="",M.value=null,N.clear(),j.value=!1};ro(async()=>{et.value=!0;{const o=sessionStorage.getItem("generation_bar_form_state");if(o)try{const t=JSON.parse(o);if(await Promise.all([Ge(),Qe()]),t.type&&(a.type=t.type),t.model&&(a.model=t.model),t.prompt&&(a.prompt=t.prompt),t.params){const e={};for(const[s,i]of Object.entries(t.params))i&&typeof i=="object"&&("_isFile"in i||"_isFileArray"in i)||(e[s]=i);a.params={...a.params,...e}}t.image_previews&&Object.entries(t.image_previews).forEach(([e,s])=>{typeof s=="string"&&(s.startsWith("http")||s.startsWith("data:image")||s.startsWith("data:video"))&&(a.image_previews[e]=s)}),sessionStorage.removeItem("generation_bar_form_state")}catch(t){console.error("Failed to restore saved form state",t)}else await Promise.all([Ge(),Qe()])}Ht(),mt().catch(()=>{}),window.addEventListener("generation-bar:remix",Lt),document.addEventListener("click",ct),window.addEventListener("scroll",pt,{passive:!0})}),so(()=>{document.removeEventListener("click",ct),window.removeEventListener("scroll",pt),window.removeEventListener("generation-bar:remix",Lt),ue.value!=null&&(clearTimeout(ue.value),ue.value=null),Se.forEach(o=>URL.revokeObjectURL(o)),Se.clear()}),Be(()=>a.type,()=>{Y.value=!1,Z.value=!1,je.value||Ke()}),Be(()=>a.model,(o,t)=>{o!==t&&!je.value&&Ye(!0)});const se={mounted(o,t){o.clickOutsideEvent=e=>{const s=e.target;o.contains(s)||t.value(e)},document.addEventListener("click",o.clickOutsideEvent,!0)},unmounted(o){document.removeEventListener("click",o.clickOutsideEvent,!0)}};return(o,t)=>(l(),n(L,null,[lo(no,{"enter-active-class":"transition duration-500 ease-out translate-y-20","enter-to-class":"translate-y-0","leave-active-class":"transition duration-300 ease-in translate-y-0","leave-to-class":"translate-y-20"},{default:ao(()=>[et.value?(l(),n("div",fo,[q.value?(l(),n("div",{key:1,ref_key:"expandedContainerRef",ref:Ue,class:y(["mx-auto pointer-events-auto transition-all duration-700 ease-out",V.value||D.value?"max-w-5xl":"max-w-3xl"])},[r("div",{onClick:t[28]||(t[28]=g(()=>{},["stop"])),class:"relative rounded-[2rem] shadow-[0_25px_50px_-12px_rgba(0,0,0,0.5),0_0_32px_rgba(139,92,246,0.1)] transition-all duration-700 ease-out p-[0.5px]"},[t[72]||(t[72]=r("div",{class:"absolute inset-0 overflow-hidden rounded-[2rem] pointer-events-none"},[r("div",{class:"absolute inset-[-200%] animate-slow-spin bg-[url('/assets/border-gradient-3.png')] bg-center bg-[length:80%_80%]"})],-1)),r("div",{class:y(["relative rounded-[calc(2rem-1.0px)] transition-all duration-700 ease-out max-h-[calc(100vh-4rem)] overflow-visible border border-violet-500/25 bg-gradient-to-b from-[#262626] to-[#1A1A1A] backdrop-blur-3xl",V.value||D.value?"p-4":"p-4 pb-2"])},[V.value||D.value?(l(),n("div",mo,[r("div",ho,[r("div",go,[r("div",xo,[D.value?(l(),n("div",bo,[...t[31]||(t[31]=[r("div",{class:"w-8 h-8 border-2 border-white/30 border-t-white rounded-full animate-spin"},null,-1)])])):p("",!0),j.value&&V.value&&!D.value?(l(),n("div",wo,[...t[32]||(t[32]=[r("div",{class:"text-xs text-yellow-100 font-bold text-center px-3 py-1 bg-black/50 rounded-lg backdrop-blur-sm"}," Under Review ",-1)])])):p("",!0),V.value&&!wt.value&&!D.value?(l(),n("img",{key:2,src:V.value,class:y(["h-full max-h-full w-auto max-w-full object-contain",{"opacity-50":j.value}]),onLoad:Ae,onError:Ae},null,42,yo)):V.value&&wt.value&&!D.value?(l(),n("video",{key:3,src:V.value,class:y(["h-full max-h-full w-auto max-w-full object-contain",{"opacity-50":j.value}]),autoplay:"",muted:"",loop:"",playsinline:"",onLoadeddata:Ae,onError:Ae},null,42,_o)):p("",!0),!V.value&&!D.value?(l(),n("div",ko,[...t[33]||(t[33]=[r("div",{class:"text-center text-gray-500"},[r("svg",{class:"w-16 h-16 mx-auto mb-3 opacity-30",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})]),r("div",{class:"text-xs"},"Preview will appear here")],-1)])])):p("",!0),V.value&&!D.value?(l(),n("div",Co,[r("button",{class:"pointer-events-auto px-4 py-2 text-xs font-semibold rounded-xl bg-white/10 border border-white/20 text-white hover:bg-white/20 backdrop-blur-sm transition",onClick:Rt}," Details ")])):p("",!0)])])]),r("div",Mo,[r("div",jo,[Ce.value?(l(),n("div",Ao,[r("div",Lo,[t[35]||(t[35]=r("svg",{class:"w-5 h-5 text-orange-400 flex-shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})],-1)),r("div",So,[r("p",Po,f(He.value),1),r("div",Vo,[r("button",{onClick:t[0]||(t[0]=e=>fe(!0)),class:"px-3 py-1.5 bg-orange-500/20 hover:bg-orange-500/30 border border-orange-500/40 rounded-lg text-xs text-orange-200 font-medium transition-all"}," Proceed "),r("button",{onClick:t[1]||(t[1]=e=>fe(!1)),class:"px-3 py-1.5 bg-white/5 hover:bg-white/10 border border-white/10 rounded-lg text-xs text-gray-300 font-medium transition-all"}," Cancel ")])]),r("button",{onClick:t[2]||(t[2]=e=>fe(!1)),class:"text-orange-400/50 hover:text-orange-400 transition-colors flex-shrink-0"},[...t[34]||(t[34]=[r("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])])])):p("",!0),r("div",Io,[pe.value.length>0?(l(),n("div",zo,[(l(!0),n(L,null,$(pe.value,e=>(l(),n(L,{key:e},[d(e)?.type==="array"?(l(),n("div",{key:0,class:y(["relative w-20 h-24 rounded-2xl bg-black/40 border border-dashed border-white/10 overflow-hidden group hover:border-violet-500/50 transition-all cursor-pointer",{"border-solid border-violet-500/50 bg-vi
1olet-500/5":R(e).length>0}]),onClick:s=>Ct(e)},[r("input",{ref_for:!0,ref:s=>{s&&(Je.value[String(e)]=s)},type:"file",accept:"image/*,video/*",multiple:"",class:"hidden",onChange:s=>jt(s,e)},null,40,$o),R(e).length>0?(l(),n("div",Eo,[(l(!0),n(L,null,$(Mt(e),(s,i)=>(l(),n("div",{key:i,class:"relative aspect-square rounded overflow-hidden bg-black/60"},[s&&Le(s)?(l(),n("img",{key:0,src:Pe(s),class:"w-full h-full object-cover"},null,8,Oo)):s&>(s)?(l(),n("video",{key:1,src:Pe(s),class:"w-full h-full object-cover",autoplay:"",loop:"",muted:"",playsinline:""},null,8,To)):s===null?(l(),n("div",Uo,[...t[36]||(t[36]=[r("svg",{class:"w-3 h-3 text-gray-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1)])])):p("",!0)]))),128))])):(l(),n("div",No,[t[37]||(t[37]=r("svg",{class:"w-5 h-5 mb-1 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1)),r("span",Ho,f(re(e)),1)])),R(e).length>0?(l(),n("div",Ro,f(R(e).length),1)):p("",!0),R(e).length>0?(l(),n("div",Wo,[r("button",{onClick:g(s=>ze(e),["stop"]),class:"p-1.5 bg-red-500 text-white rounded-full hover:scale-110 transition-transform"},[...t[38]||(t[38]=[r("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],8,Do)])):p("",!0)],10,Bo)):(l(),n("div",{key:1,class:y(["relative w-20 h-24 rounded-2xl bg-black/40 border border-dashed border-white/10 overflow-hidden group hover:border-violet-500/50 transition-all flex flex-col items-center justify-center cursor-pointer",{"border-solid border-violet-500/50 bg-violet-500/5":G(e)}]),onClick:s=>kt(e)},[r("input",{ref_for:!0,ref:s=>{s&&(Ze.value[String(e)]=s)},type:"file",accept:d(e)?.type==="video"?"video/*":"image/*",class:"hidden",multiple:d(e)?.multiple,onChange:s=>_t(s,e)},null,40,Go),G(e)?(l(),n("div",Ko,[d(e)?.type==="image"||Le(G(e))?(l(),n("img",{key:0,src:G(e),class:"w-full h-full object-cover"},null,8,Yo)):(l(),n("video",{key:1,src:G(e),class:"w-full h-full object-cover",autoplay:"",loop:"",muted:"",playsinline:""},null,8,Zo)),d(e)?.multiple&&Array.isArray(a.params[e])&&a.params[e].length>1?(l(),n("div",Jo," +"+f(a.params[e].length-1),1)):p("",!0),r("div",qo,[r("button",{onClick:g(s=>ze(e),["stop"]),class:"p-1.5 bg-red-500 text-white rounded-full hover:scale-110 transition-transform"},[...t[39]||(t[39]=[r("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],8,Xo)])])):(l(),n("div",Qo,[t[40]||(t[40]=r("svg",{class:"w-5 h-5 mb-1 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M12 4v16m8-8H4"})],-1)),r("span",er,f(re(e)),1)]))],10,Fo))],64))),128))])):p("",!0),it.value?(l(),n("div",tr,[C(r("textarea",{ref_key:"textareaRef",ref:ke,"onUpdate:modelValue":t[3]||(t[3]=e=>a.prompt=e),placeholder:"Enter your idea to generate...",class:"w-full bg-gradient-to-b from-[#262626]/95 to-[#1A1A1A]/95 border border-violet-500/25 rounded-xl text-gray-300 text-xs placeholder-gray-600 resize-none focus:ring-1 focus:ring-violet-500/40 focus:border-violet-500/40 focus:outline-none focus-visible:outline-none outline-none min-h-[90px] max-h-[150px] custom-scrollbar py-3 px-3 transition-colors shadow-[0_0_16px_rgba(139,92,246,0.06)]",onKeydown:Pt(At,["enter"])},null,544),[[E,a.prompt]]),O(T).isAuthenticated?(l(),n("div",or,[r("button",{onClick:t[4]||(t[4]=g(e=>K.value=!K.value,["stop"])),class:"w-8 h-8 rounded-lg bg-violet-500/10 border border-violet-500/30 text-violet-400 hover:bg-violet-500/20 hover:border-violet-500/50 transition-all flex items-center justify-center disabled:opacity-50",disabled:I.value,title:"AI Assistant"},[I.value?(l(),n("div",sr)):(l(),n("svg",lr,[...t[41]||(t[41]=[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"},null,-1)])]))],8,rr),K.value?C((l(),n("div",{key:0,class:"absolute bottom-full right-0 mb-2 w-40 bg-zinc-900 border border-white/10 rounded-xl shadow-2xl py-1.5 z-[120]",onClick:t[9]||(t[9]=g(()=>{},["stop"]))},[r("button",{onClick:t[5]||(t[5]=e=>oe("optimize")),disabled:I.value||!a.prompt?.trim(),class:"w-full px-3 py-2 text-left text-[10px] text-white hover:bg-white/5 transition-colors flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",title:"Rewrite Prompt"},[...t[42]||(t[42]=[r("svg",{class:"w-4 h-4 shrink-0 text-green-400",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",viewBox:"0 0 24 24"},[r("path",{d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1),r("span",null,"Rewrite prompt",-1)])],8,nr),r("button",{onClick:t[6]||(t[6]=e=>oe("expand")),disabled:I.value||!a.prompt?.trim(),class:"w-full px-3 py-2 text-left text-[10px] text-white hover:bg-white/5 transition-colors flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",title:"Expand Prompt"},[...t[43]||(t[43]=[r("svg",{class:"w-4 h-4 shrink-0 text-violet-400",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",viewBox:"0 0 24 24"},[r("path",{d:"M8 3H5a2 2 0 00-2 2v3m18 0V5a2 2 0 00-2-2h-3m0 18h3a2 2 0 002-2v-3M3 16v3a2 2 0 002 2h3"})],-1),r("span",null,"Expand prompt",-1)])],8,ar),r("button",{onClick:t[7]||(t[7]=e=>oe("condense")),disabled:I.value||!a.prompt?.trim(),class:"w-full px-3 py-2 text-left text-[10px] text-white hover:bg-white/5 transition-colors flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",title:"Condense Prompt"},[...t[44]||(t[44]=[r("svg",{class:"w-4 h-4 shrink-0 text-amber-400",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",viewBox:"0 0 24 24"},[r("path",{d:"M12 21a9 9 0 100-18 9 9 0 000 18z M9 12h6"})],-1),r("span",null,"Condense prompt",-1)])],8,ir),r("button",{onClick:t[8]||(t[8]=e=>oe("suggest")),disabled:I.value||!a.prompt?.trim(),class:"w-full px-3 py-2 text-left text-[10px] text-white hover:bg-white/5 transition-colors flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",title:"Vary Prompt"}
1,[...t[45]||(t[45]=[r("svg",{class:"w-4 h-4 shrink-0 text-pink-400",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",viewBox:"0 0 24 24"},[r("path",{d:"M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z"})],-1),r("span",null,"Vary prompt",-1)])],8,dr)])),[[se,()=>K.value=!1]]):p("",!0)])):p("",!0),r("button",{class:"absolute bottom-2 right-2 w-8 h-8 rounded-lg bg-white/5 border border-white/10 text-white hover:bg-white/10 transition-all flex items-center justify-center disabled:opacity-50",disabled:le.value,onClick:g(ht,["stop"])},[le.value?(l(),n("div",pr)):(l(),n("svg",cr,[...t[46]||(t[46]=[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.8",d:"M4 4h16v16H4z"},null,-1),r("circle",{cx:"8",cy:"8",r:"1.2",fill:"currentColor"},null,-1),r("circle",{cx:"16",cy:"8",r:"1.2",fill:"currentColor"},null,-1),r("circle",{cx:"8",cy:"16",r:"1.2",fill:"currentColor"},null,-1),r("circle",{cx:"16",cy:"16",r:"1.2",fill:"currentColor"},null,-1),r("circle",{cx:"12",cy:"12",r:"1.2",fill:"currentColor"},null,-1)])]))],8,ur)])):p("",!0)]),r("div",fr,[r("div",vr,[r("div",mr,[r("button",{ref_key:"typeTriggerRef",ref:We,onClick:t[10]||(t[10]=g(e=>Y.value=!Y.value,["stop"])),class:"flex items-center gap-1.5 px-2 py-1.5 bg-white/5 hover:bg-white/10 border border-white/5 rounded-lg text-xs font-bold transition-all text-white/90 max-w-[140px] min-w-0"},[r("span",{class:"text-pink-400 shrink-0",innerHTML:lt.value},null,8,hr),r("span",gr,f(st.value),1)],512)]),we.value.length>0?(l(),n("div",xr,[r("button",{ref_key:"modelTriggerRef",ref:De,onClick:t[12]||(t[12]=g(e=>Z.value=!Z.value,["stop"])),class:"flex items-center gap-1.5 px-2 py-1.5 bg-white/5 hover:bg-white/10 border border-white/5 rounded-lg text-xs font-bold transition-all text-white/90 max-w-[200px] min-w-0"},[x.value?.icon_url?(l(),n("span",br,[r("img",{src:x.value.icon_url,alt:"",class:"w-full h-full object-contain",onError:t[11]||(t[11]=e=>e.target.style.display="none")},null,40,wr)])):(l(),n("svg",yr,[...t[47]||(t[47]=[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"},null,-1)])])),r("span",_r,f(nt.value),1),x.value?.badge?(l(),n("span",{key:2,class:y(["flex-shrink-0 text-[9px] font-semibold px-1 py-0.5 rounded uppercase",O(Oe)(x.value.badge,"dark")])},f(O(Ee)(x.value.badge)),3)):p("",!0)],512)])):p("",!0),(l(!0),n(L,null,$(dt.value,(e,s)=>(l(),n("div",{key:e,class:"relative"},[r("button",{onClick:g(i=>yt(e),["stop"]),class:y(["flex items-center gap-1.5 px-2 py-1.5 bg-white/5 hover:bg-white/10 border border-white/5 rounded-lg text-xs font-bold transition-all text-white/90",bt(e)?"w-24 truncate":"truncate"])},[t[48]||(t[48]=r("svg",{class:"w-3.5 h-3.5 text-gray-400 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})],-1)),r("span",Cr,f(_e(e)),1)],10,kr),ae.value===e?C((l(),n("div",Mr,[r("div",jr,[r("span",Ar,f(re(e)),1)]),me(e).length?(l(),n("div",Lr,[(l(!0),n(L,null,$(me(e),i=>(l(),n("button",{key:String(i.value),onClick:g(c=>Ve(e,i.value),["stop"]),class:y(["w-full px-3 py-1.5 text-left text-xs hover:bg-white/5 transition-colors truncate",Ie(e,i.value)?"text-violet-400 bg-violet-500/5":"text-gray-400"]),title:i.label},f(i.label),11,Sr))),128))])):(l(),n("div",Pr,[d(e)?.min!==void 0&&!d(e)?.options?.length?(l(),n("div",Vr,[C(r("input",{"onUpdate:modelValue":i=>a.params[e]=i,type:"range",min:d(e).min,max:d(e).max,step:d(e).step||1,class:"w-full h-1 bg-white/10 rounded-lg appearance-none cursor-pointer accent-violet-500 hover:accent-violet-400 transition-all"},null,8,Ir),[[E,a.params[e],void 0,{number:!0}]])])):(d(e)?.type==="int"||d(e)?.type==="float")&&!d(e)?.options?.length?C((l(),n("input",{key:1,"onUpdate:modelValue":i=>a.params[e]=i,type:"number",min:d(e)?.min,max:d(e)?.max,step:d(e)?.type==="float"?d(e)?.step??.1:1,class:"w-full bg-white/5 border border-white/10 rounded-lg px-2.5 py-1.5 text-xs text-white focus:ring-1 focus:ring-violet-500/50 outline-none transition-all",placeholder:d(e)?.placeholder||""},null,8,zr)),[[E,a.params[e],void 0,{number:!0}]]):d(e)?.type==="text"?C((l(),n("input",{key:2,"onUpdate:modelValue":i=>a.params[e]=i,type:"text",class:"w-full bg-white/5 border border-white/10 rounded-lg px-2.5 py-1.5 text-xs text-white focus:ring-1 focus:ring-violet-500/50 outline-none transition-all",placeholder:d(e)?.placeholder||""}
1,null,8,Br)),[[E,a.params[e]]]):p("",!0)]))])),[[se,()=>ae.value=null]]):p("",!0)]))),128)),ut.value?(l(),n("div",$r,[r("button",{onClick:t[13]||(t[13]=g(e=>ee.value=!ee.value,["stop"])),class:"flex items-center justify-center px-2 py-1.5 min-h-[28px] bg-white/5 hover:bg-white/10 border border-white/5 rounded-lg transition-all text-white/50 hover:text-white text-xs"},[...t[49]||(t[49]=[r("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h.01M12 12h.01M19 12h.01M6 12a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0z"})],-1)])]),ee.value?C((l(),n("div",Er,[t[50]||(t[50]=r("div",{class:"px-4 py-3 border-b border-white/5 mb-2 bg-white/5 rounded-t-xl"},[r("h3",{class:"text-[10px] font-semibold text-gray-500 uppercase tracking-widest"},"More Parameters")],-1)),r("div",Or,[(l(!0),n(L,null,$(Fe.value,e=>(l(),n("div",{key:e,class:"space-y-2.5"},[r("div",Tr,[r("label",Ur,f(re(e)),1),r("span",Nr,f(_e(e)),1)]),d(e)?.min!==void 0&&!d(e)?.options?(l(),n("div",Hr,[C(r("input",{"onUpdate:modelValue":s=>a.params[e]=s,type:"range",min:d(e).min,max:d(e).max,step:d(e).step||1,class:"w-full h-1 bg-white/10 rounded-lg appearance-none cursor-pointer accent-violet-500 hover:accent-violet-400 transition-all"},null,8,Rr),[[E,a.params[e],void 0,{number:!0}]])])):d(e)?.options?(l(),n("div",Wr,[(l(!0),n(L,null,$(me(e),s=>(l(),n("button",{key:String(s.value),onClick:g(i=>Ve(e,s.value),["stop"]),class:y(["px-2.5 py-1 rounded-lg text-[11px] border transition-all truncate",Ie(e,s.value)?"bg-violet-600/20 border-violet-500/50 text-violet-300":"bg-white/5 border-white/5 text-gray-400 hover:bg-white/10 hover:border-white/10"]),title:s.label},f(s.label),11,Dr))),128))])):d(e)?.type==="bool"?(l(),n("div",Fr,[r("button",{onClick:g(s=>a.params[e]=!0,["stop"]),class:y(["px-3 py-1 rounded-lg text-[11px] transition-all",a.params[e]?"bg-violet-600/30 text-violet-300 shadow-sm":"text-gray-500 hover:text-gray-400"])}," On ",10,Gr),r("button",{onClick:g(s=>a.params[e]=!1,["stop"]),class:y(["px-3 py-1 rounded-lg text-[11px] transition-all",a.params[e]?"text-gray-500 hover:text-gray-400":"bg-zinc-700/50 text-gray-300 shadow-sm"])}," Off ",10,Kr)])):(d(e)?.type==="int"||d(e)?.type==="float")&&!d(e)?.options?.length?C((l(),n("input",{key:3,"onUpdate:modelValue":s=>a.params[e]=s,type:"number",min:d(e)?.min,max:d(e)?.max,step:d(e)?.type==="float"?d(e)?.step??.1:1,class:"w-full bg-white/5 border border-white/10 rounded-lg px-2.5 py-1.5 text-xs text-white focus:ring-1 focus:ring-violet-500/50 outline-none transition-all",placeholder:d(e)?.placeholder||""},null,8,Yr)),[[E,a.params[e],void 0,{number:!0}]]):d(e)?.type==="text"?C((l(),n("input",{key:4,"onUpdate:modelValue":s=>a.params[e]=s,type:"text",class:"w-full bg-white/5 border border-white/10 rounded-lg px-2.5 py-1.5 text-xs text-white focus:ring-1 focus:ring-violet-500/50 outline-none transition-all",placeholder:d(e)?.placeholder||""},null,8,Zr)),[[E,a.params[e]]]):p("",!0)]))),128))])])),[[se,()=>ee.value=!1]]):p("",!0)])):p("",!0)]),r("div",Jr,[O(T).isAuthenticated?(l(),n("div",qr,[r("div",Xr,[r("span",Qr,f(te.value),1),t[51]||(t[51]=r("span",{class:"text-[10px] font-black text-gray-500 uppercase tracking-widest"},"Credits",-1))]),r("div",es,"Balance: "+f(O(T).availableCredits),1),O(T).availableCredits<te.value?(l(),n("div",ts,"Insufficient")):p("",!0)])):(l(),n("div",os,f(te.value)+" Credits ",1)),r("button",{onClick:g(qe,["stop"]),disabled:!ye.value||!U.value,class:y(["send-btn flex items-center justify-center w-11 h-11 rounded-lg hover:scale-105 active:scale-95 transition-all duration-300 disabled:opacity-30 disabled:hover:scale-100 group overflow-hidden",ye.value&&U.value?"bg-gradient-to-br from-white via-violet-50 to-violet-100 text-violet-900 shadow-lg shadow-violet-500/20 animate-breathe-glow":"bg-white text-black shadow-lg shadow-white/10"])},[D.value?(l(),n("div",ls)):(l(),n("svg",ss,[...t[52]||(t[52]=[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M5 10l7-7m0 0l7 7m-7-7v18"},null,-1)])]))],10,rs)])])])])])):(l(),n("div",ns,[Ce.value?(l(),n("div",as,[r("div",is,[t[54]||(t[54]=r("svg",{class:"w-5 h-5 text-orange-400 flex-shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})],-1)),r("div",ds,[r("p",us,f(He.value),1),r("div",cs,[r("button",{onClick:t[14]||(t[14]=e=>fe(!0)),class:"px-3 py-1.5 bg-orange-500/20 hover:bg-orange-500/30 border border-orange-500/40 rounded-lg text-xs text-orange-200 font-medium transition-all"}," Proceed "),r("button",{onClick:t[15]||(t[15]=e=>fe(!1)),class:"px-3 py-1.5 bg-white/5 hover:bg-white/10 border border-white/10 rounded-lg text-xs text-gray-300 font-medium transition-all"}," Cancel ")])]),r("button",{onClick:t[16]||(t[16]=e=>fe(!1)),class:"text-orange-400/50 hover:text-orange-400 transition-colors flex-shrink-0"},[...t[53]||(t[53]=[r("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])])])):p("",!0),r("div",ps,[pe.value.length>0?(l(),n("div",fs,[(l(!0),n(L,null,$(pe.value,e=>(l(),n(L,{key:e},[d(e)?.type==="array"?(l(),n("div",{key:0,class:y(["relative w-20 h-24 rounded-2xl bg-black/40 border border-dashed border-white/10 overflow-hidden group hover:border-violet-500/50 transition-all cursor-pointer",{"border-solid border-violet-500/50 bg-vi
1olet-500/5":R(e).length>0}]),onClick:s=>Ct(e)},[r("input",{ref_for:!0,ref:s=>{s&&(Je.value[String(e)]=s)},type:"file",accept:"image/*,video/*",multiple:"",class:"hidden",onChange:s=>jt(s,e)},null,40,ms),R(e).length>0?(l(),n("div",hs,[(l(!0),n(L,null,$(Mt(e),(s,i)=>(l(),n("div",{key:i,class:"relative aspect-square rounded overflow-hidden bg-black/60"},[s&&Le(s)?(l(),n("img",{key:0,src:Pe(s),class:"w-full h-full object-cover"},null,8,gs)):s&>(s)?(l(),n("video",{key:1,src:Pe(s),class:"w-full h-full object-cover",autoplay:"",loop:"",muted:"",playsinline:""},null,8,xs)):s===null?(l(),n("div",bs,[...t[55]||(t[55]=[r("svg",{class:"w-3 h-3 text-gray-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1)])])):p("",!0)]))),128))])):(l(),n("div",ws,[t[56]||(t[56]=r("svg",{class:"w-5 h-5 mb-1 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1)),r("span",ys,f(re(e)),1)])),R(e).length>0?(l(),n("div",_s,f(R(e).length),1)):p("",!0),R(e).length>0?(l(),n("div",ks,[r("button",{onClick:g(s=>ze(e),["stop"]),class:"p-1.5 bg-red-500 text-white rounded-full hover:scale-110 transition-transform"},[...t[57]||(t[57]=[r("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],8,Cs)])):p("",!0)],10,vs)):(l(),n("div",{key:1,class:y(["relative w-20 h-24 rounded-2xl bg-black/40 border border-dashed border-white/10 overflow-hidden group hover:border-violet-500/50 transition-all flex flex-col items-center justify-center cursor-pointer",{"border-solid border-violet-500/50 bg-violet-500/5":G(e)}]),onClick:s=>kt(e)},[r("input",{ref_for:!0,ref:s=>{s&&(Ze.value[String(e)]=s)},type:"file",accept:d(e)?.type==="video"?"video/*":"image/*",class:"hidden",multiple:d(e)?.multiple,onChange:s=>_t(s,e)},null,40,js),G(e)?(l(),n("div",As,[d(e)?.type==="image"||Le(G(e))?(l(),n("img",{key:0,src:G(e),class:"w-full h-full object-cover"},null,8,Ls)):(l(),n("video",{key:1,src:G(e),class:"w-full h-full object-cover",autoplay:"",loop:"",muted:"",playsinline:""},null,8,Ss)),d(e)?.multiple&&Array.isArray(a.params[e])&&a.params[e].length>1?(l(),n("div",Ps," +"+f(a.params[e].length-1),1)):p("",!0),r("div",Vs,[r("button",{onClick:g(s=>ze(e),["stop"]),class:"p-1.5 bg-red-500 text-white rounded-full hover:scale-110 transition-transform"},[...t[58]||(t[58]=[r("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],8,Is)])])):(l(),n("div",zs,[t[59]||(t[59]=r("svg",{class:"w-5 h-5 mb-1 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M12 4v16m8-8H4"})],-1)),r("span",Bs,f(re(e)),1)]))],10,Ms))],64))),128))])):p("",!0),it.value?(l(),n("div",$s,[C(r("textarea",{ref_key:"textareaRef",ref:ke,"onUpdate:modelValue":t[17]||(t[17]=e=>a.prompt=e),placeholder:"Enter your idea to generate...",class:"w-full bg-gradient-to-b from-[#262626]/95 to-[#1A1A1A]/95 border border-violet-500/25 rounded-xl text-gray-300 text-xs placeholder-gray-600 resize-none focus:ring-1 focus:ring-violet-500/40 focus:border-violet-500/40 focus:outline-none focus-visible:outline-none outline-none min-h-[90px] max-h-[150px] custom-scrollbar py-3 px-3 transition-colors shadow-[0_0_16px_rgba(139,92,246,0.06)]",onKeydown:Pt(At,["enter"])},null,544),[[E,a.prompt]]),O(T).isAuthenticated?(l(),n("div",Es,[r("button",{onClick:t[18]||(t[18]=g(e=>K.value=!K.value,["stop"])),class:"w-8 h-8 rounded-lg bg-violet-500/10 border border-violet-500/30 text-violet-400 hover:bg-violet-500/20 hover:border-violet-500/50 transition-all flex items-center justify-center disabled:opacity-50",disabled:I.value,title:"AI Assistant"},[I.value?(l(),n("div",Ts)):(l(),n("svg",Us,[...t[60]||(t[60]=[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"},null,-1)])]))],8,Os),K.value?C((l(),n("div",{key:0,class:"absolute bottom-full right-0 mb-2 w-40 bg-zinc-900 border border-white/10 rounded-xl shadow-2xl py-1.5 z-[120]",onClick:t[23]||(t[23]=g(()=>{},["stop"]))},[r("button",{onClick:t[19]||(t[19]=e=>oe("optimize")),disabled:I.value||!a.prompt?.trim(),class:"w-full px-3 py-2 text-left text-[10px] text-white hover:bg-white/5 transition-colors flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",title:"Rewrite Prompt"},[...t[61]||(t[61]=[r("svg",{class:"w-4 h-4 shrink-0 text-green-400",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",viewBox:"0 0 24 24"},[r("path",{d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1),r("span",null,"Rewrite prompt",-1)])],8,Ns),r("button",{onClick:t[20]||(t[20]=e=>oe("expand")),disabled:I.value||!a.prompt?.trim(),class:"w-full px-3 py-2 text-left text-[10px] text-white hover:bg-white/5 transition-colors flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",title:"Expand Prompt"},[...t[62]||(t[62]=[r("svg",{class:"w-4 h-4 shrink-0 text-violet-400",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",viewBox:"0 0 24 24"},[r("path",{d:"M8 3H5a2 2 0 00-2 2v3m18 0V5a2 2 0 00-2-2h-3m0 18h3a2 2 0 002-2v-3M3 16v3a2 2 0 002 2h3"})],-1),r("span",null,"Expand prompt",-1)])],8,Hs),r("button",{onClick:t[21]||(t[21]=e=>oe("condense")),disabled:I.value||!a.prompt?.trim(),class:"w-full px-3 py-2 text-left text-[10px] text-white hover:bg-white/5 transition-colors flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",title:"Condense Prompt"},[...t[63]||(t[63]=[r("svg",{class:"w-4 h-4 shrink-0 text-amber-400",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",viewBox:"0 0 24 24"},[r("path",{d:"M12 21a9 9 0 100-18 9 9 0 000 18z M9 12h6"})],-1),r("span",null,"Condense prompt",-1)])],8,Rs),r("button",{onClick:t[22]||(t[22]=e=>oe("suggest")),disabled:I.value||!a.prompt?.trim(),class:"w-full px-3 py-2 text-left text-[10px] text-white hover:bg-white/5 transition-colors flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",title:"Vary Prompt"},[...t[64]||(t[64]=[r("svg",{class:"w-4 h-4 shrink-0 text-pink-400",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",viewBox:"0 0 24 24"},[r("path",{d:"M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z"}
1)],-1),r("span",null,"Vary prompt",-1)])],8,Ws)])),[[se,()=>K.value=!1]]):p("",!0)])):p("",!0),r("button",{class:"absolute bottom-2 right-2 w-8 h-8 rounded-lg bg-white/5 border border-white/10 text-white hover:bg-white/10 transition-all flex items-center justify-center disabled:opacity-50",disabled:le.value,onClick:g(ht,["stop"])},[le.value?(l(),n("div",Gs)):(l(),n("svg",Fs,[...t[65]||(t[65]=[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.8",d:"M4 4h16v16H4z"},null,-1),r("circle",{cx:"8",cy:"8",r:"1.2",fill:"currentColor"},null,-1),r("circle",{cx:"16",cy:"8",r:"1.2",fill:"currentColor"},null,-1),r("circle",{cx:"8",cy:"16",r:"1.2",fill:"currentColor"},null,-1),r("circle",{cx:"16",cy:"16",r:"1.2",fill:"currentColor"},null,-1),r("circle",{cx:"12",cy:"12",r:"1.2",fill:"currentColor"},null,-1)])]))],8,Ds)])):p("",!0)]),r("div",Ks,[r("div",Ys,[r("div",Zs,[r("button",{ref_key:"typeTriggerRef",ref:We,onClick:t[24]||(t[24]=g(e=>Y.value=!Y.value,["stop"])),class:"flex items-center gap-1.5 px-2 py-1.5 bg-white/5 hover:bg-white/10 border border-white/5 rounded-lg text-xs font-bold transition-all text-white/90 max-w-[140px] min-w-0"},[r("span",{class:"text-pink-400 shrink-0",innerHTML:lt.value},null,8,Js),r("span",qs,f(st.value),1)],512)]),we.value.length>0?(l(),n("div",Xs,[r("button",{ref_key:"modelTriggerRef",ref:De,onClick:t[26]||(t[26]=g(e=>Z.value=!Z.value,["stop"])),class:"flex items-center gap-1.5 px-2 py-1.5 bg-white/5 hover:bg-white/10 border border-white/5 rounded-lg text-xs font-bold transition-all text-white/90 max-w-[240px] min-w-0"},[x.value?.icon_url?(l(),n("span",Qs,[r("img",{src:x.value.icon_url,alt:"",class:"w-full h-full object-contain",onError:t[25]||(t[25]=e=>e.target.style.display="none")},null,40,el)])):(l(),n("svg",tl,[...t[66]||(t[66]=[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"},null,-1)])])),r("span",ol,f(nt.value),1),x.value?.badge?(l(),n("span",{key:2,class:y(["flex-shrink-0 text-[9px] font-semibold px-1 py-0.5 rounded uppercase",O(Oe)(x.value.badge,"dark")])},f(O(Ee)(x.value.badge)),3)):p("",!0)],512)])):p("",!0),(l(!0),n(L,null,$(dt.value,(e,s)=>(l(),n("div",{key:e,class:"relative"},[r("button",{onClick:g(i=>yt(e),["stop"]),class:y(["flex items-center gap-1.5 px-2 py-1.5 bg-white/5 hover:bg-white/10 border border-white/5 rounded-lg text-xs font-bold transition-all text-white/90",bt(e)?"w-24 truncate":"truncate"])},[t[67]||(t[67]=r("svg",{class:"w-3.5 h-3.5 text-gray-400 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})],-1)),r("span",sl,f(_e(e)),1)],10,rl),ae.value===e?C((l(),n("div",ll,[r("div",nl,[r("span",al,f(re(e)),1)]),me(e).length?(l(),n("div",il,[(l(!0),n(L,null,$(me(e),i=>(l(),n("button",{key:String(i.value),onClick:g(c=>Ve(e,i.value),["stop"]),class:y(["w-full px-3 py-1.5 text-left text-xs hover:bg-white/5 transition-colors truncate",Ie(e,i.value)?"text-violet-400 bg-violet-500/5":"text-gray-400"]),title:i.label},f(i.label),11,dl))),128))])):(l(),n("div",ul,[d(e)?.min!==void 0&&!d(e)?.options?.length?(l(),n("div",cl,[C(r("input",{"onUpdate:modelValue":i=>a.params[e]=i,type:"range",min:d(e).min,max:d(e).max,step:d(e).step||1,class:"w-full h-1 bg-white/10 rounded-lg appearance-none cursor-pointer accent-violet-500 hover:accent-violet-400 transition-all"},null,8,pl),[[E,a.params[e],void 0,{number:!0}]])])):(d(e)?.type==="int"||d(e)?.type==="float")&&!d(e)?.options?.length?C((l(),n("input",{key:1,"onUpdate:modelValue":i=>a.params[e]=i,type:"number",min:d(e)?.min,max:d(e)?.max,step:d(e)?.type==="float"?d(e)?.step??.1:1,class:"w-full bg-white/5 border border-white/10 rounded-lg px-2.5 py-1.5 text-xs text-white focus:ring-1 focus:ring-violet-500/50 outline-none transition-all",placeholder:d(e)?.placeholder||""},null,8,fl)),[[E,a.params[e],void 0,{number:!0}]]):d(e)?.type==="text"?C((l(),n("input",{key:2,"onUpdate:modelValue":i=>a.params[e]=i,type:"text",class:"w-full bg-white/5 border border-white/10 rounded-lg px-2.5 py-1.5 text-xs text-white focus:ring-1 focus:ring-violet-500/50 outline-none transition-all",placeholder:d(e)?.placeholder||""}
1,null,8,vl)),[[E,a.params[e]]]):p("",!0)]))])),[[se,()=>ae.value=null]]):p("",!0)]))),128)),ut.value?(l(),n("div",ml,[r("button",{onClick:t[27]||(t[27]=g(e=>ee.value=!ee.value,["stop"])),class:"flex items-center justify-center px-2 py-1.5 min-h-[28px] bg-white/5 hover:bg-white/10 border border-white/5 rounded-lg transition-all text-white/50 hover:text-white text-xs"},[...t[68]||(t[68]=[r("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h.01M12 12h.01M19 12h.01M6 12a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0z"})],-1)])]),ee.value?C((l(),n("div",hl,[t[69]||(t[69]=r("div",{class:"px-4 py-3 border-b border-white/5 mb-2 bg-white/5 rounded-t-xl"},[r("h3",{class:"text-[10px] font-semibold text-gray-500 uppercase tracking-widest"},"More Parameters")],-1)),r("div",gl,[(l(!0),n(L,null,$(Fe.value,e=>(l(),n("div",{key:e,class:"space-y-2.5"},[r("div",xl,[r("label",bl,f(re(e)),1),r("span",wl,f(_e(e)),1)]),d(e)?.min!==void 0&&!d(e)?.options?(l(),n("div",yl,[C(r("input",{"onUpdate:modelValue":s=>a.params[e]=s,type:"range",min:d(e).min,max:d(e).max,step:d(e).step||1,class:"w-full h-1 bg-white/10 rounded-lg appearance-none cursor-pointer accent-violet-500 hover:accent-violet-400 transition-all"},null,8,_l),[[E,a.params[e],void 0,{number:!0}]])])):d(e)?.options?(l(),n("div",kl,[(l(!0),n(L,null,$(me(e),s=>(l(),n("button",{key:String(s.value),onClick:g(i=>Ve(e,s.value),["stop"]),class:y(["px-2.5 py-1 rounded-lg text-[11px] border transition-all truncate",Ie(e,s.value)?"bg-violet-600/20 border-violet-500/50 text-violet-300":"bg-white/5 border-white/5 text-gray-400 hover:bg-white/10 hover:border-white/10"]),title:s.label},f(s.label),11,Cl))),128))])):d(e)?.type==="bool"?(l(),n("div",Ml,[r("button",{onClick:g(s=>a.params[e]=!0,["stop"]),class:y(["px-3 py-1 rounded-lg text-[11px] transition-all",a.params[e]?"bg-violet-600/30 text-violet-300 shadow-sm":"text-gray-500 hover:text-gray-400"])}," On ",10,jl),r("button",{onClick:g(s=>a.params[e]=!1,["stop"]),class:y(["px-3 py-1 rounded-lg text-[11px] transition-all",a.params[e]?"text-gray-500 hover:text-gray-400":"bg-zinc-700/50 text-gray-300 shadow-sm"])}," Off ",10,Al)])):(d(e)?.type==="int"||d(e)?.type==="float")&&!d(e)?.options?.length?C((l(),n("input",{key:3,"onUpdate:modelValue":s=>a.params[e]=s,type:"number",min:d(e)?.min,max:d(e)?.max,step:d(e)?.type==="float"?d(e)?.step??.1:1,class:"w-full bg-white/5 border border-white/10 rounded-lg px-2.5 py-1.5 text-xs text-white focus:ring-1 focus:ring-violet-500/50 outline-none transition-all",placeholder:d(e)?.placeholder||""},null,8,Ll)),[[E,a.params[e],void 0,{number:!0}]]):d(e)?.type==="text"?C((l(),n("input",{key:4,"onUpdate:modelValue":s=>a.params[e]=s,type:"text",class:"w-full bg-white/5 border border-white/10 rounded-lg px-2.5 py-1.5 text-xs text-white focus:ring-1 focus:ring-violet-500/50 outline-none transition-all",placeholder:d(e)?.placeholder||""},null,8,Sl)),[[E,a.params[e]]]):p("",!0)]))),128))])])),[[se,()=>ee.value=!1]]):p("",!0)])):p("",!0)]),r("div",Pl,[O(T).isAuthenticated?(l(),n("div",Vl,[r("div",Il,[r("span",zl,f(te.value),1),t[70]||(t[70]=r("span",{class:"text-[10px] font-black text-gray-500 uppercase tracking-widest"},"Credits",-1))]),r("div",Bl,"Balance: "+f(O(T).availableCredits),1),O(T).availableCredits<te.value?(l(),n("div",$l,"Insufficient")):p("",!0)])):(l(),n("div",El,f(te.value)+" Credits ",1)),r("button",{onClick:g(qe,["stop"]),disabled:!ye.value||!U.value,class:y(["send-btn flex items-center justify-center w-11 h-11 rounded-lg hover:scale-105 active:scale-95 transition-all duration-300 disabled:opacity-30 disabled:hover:scale-100 group overflow-hidden",ye.value&&U.value?"bg-gradient-to-br from-white via-violet-50 to-violet-100 text-violet-900 shadow-lg shadow-violet-500/20 animate-breathe-glow":"bg-white text-black shadow-lg shadow-white/10"])},[D.value?(l(),n("div",Ul)):(l(),n("svg",Tl,[...t[71]||(t[71]=[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M5 10l7-7m0 0l7 7m-7-7v18"},null,-1)])]))],10,Ol)])])]))],2)])],2)):(l(),n("div",vo,[r("div",{onClick:g(Ut,["stop"]),class:"relative overflow-hidden rounded-full shadow-[0_25px_50px_-12px_rgba(0,0,0,0.5),0_0_24px_rgba(139,92,246,0.14)] transition-all duration-300 cursor-pointer"},[...t[30]||(t[30]=[r("div",{class:"relative rounded-full px-6 py-2.5 flex items-center gap-4 border border-violet-500/30 bg-gradient-to-b from-[#262626] to-[#1A1A1A] backdrop-blur-3xl"},[r("span",{class:"flex-shrink-0 text-gray-500/80","aria-hidden":"true"},[r("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-5"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09
1L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"})])]),r("div",{class:"flex-1 text-sm text-gray-500"}," Enter your idea to generate... "),r("button",{class:"flex items-center justify-center w-9 h-9 bg-gray-700/50 text-gray-400 rounded-lg hover:bg-gray-600/50 transition-all"},[r("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M5 10l7-7m0 0l7 7m-7-7v18"})])])],-1)])])]))])):p("",!0)]),_:1}),(l(),St(It,{to:"body"},[Y.value?C((l(),n("div",{key:0,style:Vt(ot.value),class:"fixed w-40 bg-zinc-900 border border-white/10 rounded-xl shadow-2xl py-1.5 z-[200]"},[t[73]||(t[73]=r("div",{class:"px-3 py-1.5 border-b border-white/5 mb-1"},[r("span",{class:"text-[10px] uppercase font-semibold text-gray-500 tracking-widest"},"Type")],-1)),(l(!0),n(L,null,$($t.value,e=>(l(),n("button",{key:e.value,onClick:g(s=>Gt(e.value),["stop"]),class:y(["w-full px-3 py-1.5 text-left text-xs hover:bg-white/5 transition-colors flex items-center gap-2 group/item",a.type===e.value?"text-violet-400 bg-violet-500/5":"text-gray-400"]),title:e.label},[r("span",{innerHTML:e.iconSvg,class:"opacity-70 group-hover/item:opacity-100 transition-opacity"},null,8,Hl),r("span",null,f(e.label),1)],10,Nl))),128))],4)),[[se,()=>Y.value=!1]]):p("",!0)])),(l(),St(It,{to:"body"},[Z.value?C((l(),n("div",{key:0,style:Vt(rt.value),class:"fixed w-52 bg-zinc-900 border border-white/10 rounded-xl shadow-2xl py-1.5 z-[200] max-h-60 overflow-y-auto custom-scrollbar"},[t[74]||(t[74]=r("div",{class:"px-3 py-1.5 border-b border-white/5 mb-1"},[r("span",{class:"text-[10px] uppercase font-semibold text-gray-500 tracking-widest"},"Model")],-1)),(l(!0),n(L,null,$(Tt.value,e=>(l(),n("button",{key:e.value,onClick:g(s=>Kt(String(e.value)),["stop"]),class:y(["w-full px-3 py-1.5 text-left hover:bg-white/5 transition-colors border-b border-white/5 last:border-0 group/item flex items-center justify-between gap-2",a.model===e.value?"bg-violet-500/5 text-violet-400":"text-gray-400"]),title:e.label},[r("div",Wl,[e.icon_url?(l(),n("span",Dl,[r("img",{src:e.icon_url,alt:"",class:"w-full h-full object-contain",onError:t[29]||(t[29]=s=>s.target.style.display="none")},null,40,Fl)])):p("",!0),r("span",Gl,f(e.label),1),e.badge?(l(),n("span",{key:1,class:y(["flex-shrink-0 text-[9px] font-semibold px-1.5 py-0.5 rounded uppercase",O(Oe)(e.badge,"dark")])},f(O(Ee)(e.badge)),3)):p("",!0)]),e.right?(l(),n("span",Kl,f(e.right),1)):p("",!0)],10,Rl))),128))],4)),[[se,()=>Z.value=!1]]):p("",!0)]))],64))}}),rn=po(Jl,[["__scopeId","data-v-e8d465d9"]]);export{rn as _};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.