1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8094],{1630:(e,t,a)=>{a.d(t,{VideoUploader:()=>y});var s=a(76947),r=a(50243),l=a(82989),n=a(23894),i=a(15428),o=a(39188),d=a(1777),c=a(50021),u=a(11097),m=a(22958),p=a(77077),x=a(79627),h=a(15266),f=a(71858),g=a(94076),b=a(98547),v=a(23941);let j=["video/mp4","video/webm"];function y(e){let{videoUrl:t,onVideoChange:a,disabled:y,maxSizeBytes:w=0x1000000,purpose:N="video-editor",allowedMimeTypes:C=j,accept:k,formatHint:L,helperText:S,label:A,isPremiumLocked:M=!1}=e,D=(0,g.c3)("Generator.upload"),I=(0,d.w)(),F=(0,o.z)({includeSearch:!0}),[T,z]=(0,b.useState)(!1),[E,_]=(0,b.useState)(!1),[R,U]=(0,b.useState)(!1),G=y||R,B=(0,b.useCallback)(async e=>{if(G||!e||0===e.length)return;let t=e[0];if(!new Set(C).has(t.type))return void v.o.error(D("invalidFileType"),{description:D("pleaseUploadSupportedVideo")});if(t.size>w)return void v.o.error(D("fileTooLarge"),{description:D("pleaseUploadVideoSmaller",{size:Math.round(w/1048576)})});if(!(null==I?void 0:I.user))return void _(!0);if(M)return void v.o.error(D("subscribeToUpload"),{description:D("paidMembersCanUpload"),action:(0,s.jsx)(l.q,{children:D("upgrade")})});U(!0);try{let e="motion-control"===N?"motion-control":"video-editor",s=await (0,u.Q)(t,e,{purpose:N,allowFallback:!1});a(s.url)}catch(e){console.error("Video upload error:",e),v.o.error(D("uploadFailed"),{description:e instanceof Error?e.message:D("pleaseRetry")})}finally{U(!1)}},[G,M,w,a,N,null==I?void 0:I.user,C,D]),P=(0,b.useCallback)(e=>{e.preventDefault(),G||(z(!1),B(e.dataTransfer.files))},[B,G]);return(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)(i.J,{className:"text-sm font-medium",children:A||D("inputVideo")}),M&&(0,s.jsx)(m.A,{className:"w-3.5 h-3.5 text-amber-500"})]}),t&&(0,s.jsx)(n.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>a(null),disabled:y,className:"h-6 px-2 text-xs text-muted-foreground hover:text-destructive",children:D("remove")})]}),t?(0,s.jsx)("div",{className:"rounded-xl border border-border bg-muted p-2",children:(0,s.jsxs)("div",{className:"relative overflow-hidden rounded-lg bg-black shadow-sm",children:[(0,s.jsx)("video",{src:t,controls:!0,className:"block w-full max-h-[240px] bg-black"}),(0,s.jsx)("button",{type:"button",className:"absolute right-2 top-2 z-20 inline-flex h-8 w-8 items-center justify-center rounded-full bg-black/75 text-white shadow-md transition-colors hover:bg-black disabled:pointer-events-none disabled:opacity-50",onClick:()=>a(null),disabled:y,"aria-label":D("remove"),children:(0,s.jsx)(p.A,{className:"h-4 w-4"})})]})}):(0,s.jsxs)("label",{className:(0,c.cn)("flex flex-col items-center justify-center w-full min-h-[140px] border-2 border-dashed rounded-xl cursor-pointer transition-all",T?"border-primary bg-primary/5":"border-border hover:border-primary/50 hover:bg-accent/30",G&&"opacity-50 cursor-not-allowed"),onDrop:P,onDragOver:e=>{e.preventDefault(),G||z(!0)},onDragLeave:e=>{e.preventDefault(),G||z(!1)},children:[(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-4",children:[(0,s.jsx)("div",{className:"w-10 h-10 mb-3 bg-gradient-to-r from-blue-500/10 to-purple-500/10 rounded-full flex items-center justify-center",children:R?(0,s.jsx)(x.A,{className:"w-5 h-5 text-blue-500 animate-spin"}):(0,s.jsx)(h.A,{className:"w-5 h-5 text-blue-500"})}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground mb-1",children:R?(0,s.jsx)("span",{className:"font-medium text-primary",children:D("uploading")}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"font-medium text-primary",children:D("clickToUpload")})," ",D("orDragAndDrop")]})}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:L||D("videoFormatHint",{size:Math.round(w/1048576)})})]}),(0,s.jsx)("input",{type:"file",className:"hidden",accept:k||C.join(","),onChange:e=>B(e.target.files),disabled:G})]}),!t&&(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,s.jsx)(f.A,{className:"w-3.5 h-3.5"}),(0,s.jsx)("span",{children:S||D("videoHelperText")})]}),(0,s.jsx)(r.n,{mode:"modal",open:E,onOpenChange:_,callbackUrl:F})]})}},1777:(e,t,a)=>{a.d(t,{w:()=>r});var s=a(46010);let r=()=>{let{data:e,error:t}=s.y.useSession();return t?(console.error("useSession, error:",t),null):e}},2903:(e,t,a)=>{a.d(t,{W:()=>s});async function s(e,t,a){if(0===e.length)return[];let s=Array(e.length),r=0;async function l(){for(;r<e.length;){let t=r;r+=1,s[t]=await a(e[t],t)}}let n=Math.min(Math.max(1,t),e.length);return await Promise.all(Array.from({length:n},()=>l())),s}},3468:(e,t,a)=>{a.d(t,{ImageUploader:()=>k});var s=a(76947),r=a(50243),l=a(23894),n=a(30786),i=a(15428),o=a(41303),d=a(39188),c=a(1777),u=a(50021),m=a(11097),p=a(81591),x=a(79627),h=a(15266),f=a(20608),g=a(81247),b=a(
177077),v=a(94076),j=a(78799),y=a(98547),w=a(23941),N=a(88125);let C=["image/jpeg","image/png","image/webp"];function k(e){let{images:t,onImagesChange:a,disabled:k,maxImages:L=1,label:S,showStatus:A=!0,maxFileSizeBytes:M=0xa00000,allowedMimeTypes:D=C,uploadFolder:I,uploadPurpose:F="image",allowFallback:T=!0,prepareUploadFile:z,accept:E,helperText:_,labelTooltip:R,labelAction:U,compact:G=!1,singleImageSlot:B=!1}=e,P=(0,v.c3)("Generator.upload"),H=(0,c.w)(),O=(0,d.z)({includeSearch:!0}),[K,V]=(0,y.useState)(!1),[Z,J]=(0,y.useState)(!1),[$,W]=(0,y.useState)(!1),[q,Q]=(0,y.useState)(null),X=k||$,Y=G&&1===L,ee=(Y||B)&&1===L,et=null!==S||t.length>0,ea=(0,y.useCallback)(async e=>{if(k||$||!e||0===e.length)return;let s=L-t.length;if(s<=0)return void w.o.error(P("maxImagesAllowed",{max:L}));let r=Array.from(e).slice(0,s),l=new Set(D),n=[];for(let e of r){if(!l.has(e.type)){w.o.error(P("invalidFileType"),{description:P("pleaseUploadSupportedImage")});continue}if(e.size>M){w.o.error(P("fileTooLarge"),{description:P("pleaseUploadImageSmaller",{size:Math.round(M/1048576)})});continue}n.push(e)}if(0===n.length)return;if(!(null==H?void 0:H.user))return void J(!0);W(!0);let i=[];try{for(let e of n){let t=z?await z(e):e,a=await (0,m.Q)(t,I,{purpose:F,allowFallback:T});i.push(a.url)}}catch(e){console.error("Upload error:",e),w.o.error(P("uploadFailed"),{description:e instanceof Error?e.message:P("pleaseRetry")})}finally{W(!1),i.length>0&&(a([...t,...i]),i.length<r.length&&w.o.info(P("uploadedPartial",{uploaded:i.length,total:r.length})))}},[k,t,$,L,M,a,H,I,F,D,T,z,P]),es=(0,y.useCallback)(e=>{e.preventDefault(),V(!1),X||ea(e.dataTransfer.files)},[ea,X]),er=(0,y.useCallback)(e=>{e.preventDefault(),V(!0)},[]),el=(0,y.useCallback)(e=>{e.preventDefault(),V(!1)},[]),en=(0,y.useCallback)(e=>{a(t.filter((t,a)=>a!==e))},[t,a]),ei=(0,y.useCallback)(()=>{a([])},[a]);return(0,s.jsxs)("div",{className:(0,u.cn)("min-w-0",Y?"space-y-1.5":"space-y-3"),children:[et&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1",children:[null!==S?(0,s.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[(0,s.jsx)(i.J,{className:"text-sm font-medium",children:null!=S?S:P("referenceImages")}),R&&(0,s.jsxs)(o.m_,{children:[(0,s.jsx)(o.k$,{asChild:!0,children:(0,s.jsx)("button",{type:"button",className:"text-muted-foreground transition-colors hover:text-foreground",children:(0,s.jsx)(p.A,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(o.ZI,{className:"max-w-xs",children:"string"==typeof R?(0,s.jsx)("p",{children:R}):R})]}),U]}):(0,s.jsx)("div",{}),t.length>0&&!ee&&(0,s.jsx)(l.$,{type:"button",variant:"ghost",size:"sm",onClick:ei,disabled:X,className:"h-6 px-2 text-xs text-muted-foreground hover:text-destructive",children:P("clearAll")})]}),(0,s.jsxs)("label",{className:(0,u.cn)("flex min-h-[140px] w-full cursor-pointer flex-col items-center justify-center rounded-xl border-2 border-dashed transition-all duration-200",Y&&["h-28","min-h-0 focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2"],K?"border-primary bg-primary/5":"border-border hover:-translate-y-0.5 hover:border-primary/50 hover:bg-accent/30 hover:shadow-sm",X&&"cursor-not-allowed opacity-50",t.length>0&&"hidden"),onDrop:es,onDragOver:er,onDragLeave:el,children:[(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-4",children:[$?(0,s.jsx)(x.A,{className:(0,u.cn)("mb-2 h-5 w-5 animate-spin text-primary",Y&&"mb-0")}):(0,s.jsx)(h.A,{className:(0,u.cn)("mb-2 h-5 w-5 text-primary/80",Y&&"mb-0")}),(0,s.jsx)("p",{className:(0,u.cn)("text-sm font-medium text-foreground",Y&&"sr-only"),children:$?P("uploading"):P("uploadImage")}),!Y&&null!==_&&(0,s.jsx)("p",{className:"mt-1 text-center text-xs text-muted-foreground",children:_||"PNG, JPG, WEBP (max ".concat(Math.round(M/1048576),"MB each)")})]}),(0,s.jsx)("input",{type:"file",className:Y?"sr-only":"hidden","aria-label":Y?"".concat(null!=S?S:"",": ").concat(P("uploadImage")):void 0,accept:E||D.join(","),multiple:L>1,onChange:e=>{var t;let a=Array.from(null!=(t=e.target.files)?t:[]);e.target.value="",ea(a)},disabled:X||t.length>=L})]}),t.length>0&&(0,s.jsxs)("div",{className:(0,u.cn)("grid gap-2",ee?"grid-cols-1":t.length<=4?"grid-cols-2":"grid-cols-3 sm:grid-cols-4"),children:[t.map((e,a)=>(0,s.jsxs)("div",{className:(0,u.cn)("relative group aspect-square overflow-hidden rounded-lg border border-border bg-muted transition-transform duration-200 hover:-translate-y-0.5 hover:shadow-md",ee&&["aspect-auto rounded-xl",Y?"h-28":"h-[140px]"],!k&&"cursor-pointer"),children:[(0,s.jsx)(j.default,{src:e,alt:ee?S||P("referenceImages"):"Reference ".concat(a+1),fill:!0,sizes:ee?"100vw":t.length<=4?"50vw":"(min-width: 640px) 25vw, 33vw",className:ee?"object-contain":"object-cover"}),(0,s.jsx)("div",{className:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity"}),(0,s.jsx)("button",{type:"button",className:(0,u.cn)("absolute left-1/2 top-1/2 z-20 inline-flex h-11 w-11 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-full bg-rose-500 text-white opacity-100 shadow-lg transition-opacity duration-200 [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-hover:opacity-100",Y&&"h-10 w-10"),onClick:t=>{t.stopPropagation(),Q(e)},disabled:k,"aria-label":ee&&S?"".concat(S,": ").concat(P("previewImage")):P("previewImage"),children:(0,s.jsx)(f.A,{className:"h-5 w-5"})}),(0,s.jsx)(N.L,{className:(0,u.cn)("absolute right-2 top-2 z-20",Y&&"right-1 top-1"),onClick:e=>{e.stopPropagation(),en(a)},disabled:X,ariaLabel:ee&&S?"".concat(S,": ").concat(P("remove")):P("remove")}),(0,s.jsx)("span",{className:(0,u.cn)("absolute bottom-1 left-1 text-[10px] px-1.5 py-0.5 rounded bg-black/60 text-white opacity-0 group-hover:opacity-100 transition-opacity",ee&&"hidden"),children:a+1})]},a)),t.length<L&&(0,s.jsxs)("label",{className:(0,u.cn)("flex aspect-square cursor-pointer flex-col items-center justify-center rounded-lg border-2 border-dashed border-border transition-all duration-200 hover:-translate-y-0.5 hover:border-primary/50 hover:bg-accent/30 hover:shadow-sm",X&&"opacity-50 cursor-not-allowed"),children:[$?(0,s.jsx)(x.A,{className:"mb-1 h-5 w-5 animate-spin text-muted-foreground"}):(0,s.jsx)(g.A,{className:"mb-1 h-5 w-5 text-muted-foreground"}),(0,s.jsx)("span",{className:"text-[10px] text-muted-foreground",children:$?P("uploading"):P("addMore")}),(0,s.jsx)("input",{type:"file",className:"hidden",accept:E||D.join(","),multiple:L>1,onChange:e=>{var t;let a=Array.from(null!=(t=e.target.files)?t:[]);e.target.value="",ea(a)},disabled:X})]})]}),A&&(0,s.jsx)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:(0,s.jsx)("span",{children:L>1?P("supportMultipleImages",{count:t.length,max:L}):t.length>0?P("singleImageUploaded"):P("uploadAnImage")})}),(0,s.jsx)(n.lG,{open:!!q,onOpenChange:e=>{e||Q(null)},children:(0,s.jsxs)(n.Cf,{className:"h-[88vh] w-[92vw] max-w-[min(1200px,92vw)] overflow-hidden rounded-[28px] border border-white/10 bg-black p-0 shadow-2xl",children:[(0,s.jsx)(n.c7,{className:"sr-only",children:(0,s.jsx)(n.L3,{children:P("previewImage")})}),(0,s.jsx)("button",{type:"button",className:"absolute right-4 top-4 z-10 inline-flex h-11 w-11 items-center justify-center rounded-full border border-white/10 bg-black/75 text-white shadow-lg transition-colors hover:bg-black","aria-label":P("closePreview"),onClick:()=>Q(null),children:(0,s.jsx)(b.A,{className:"h-5 w-5"})}),q&&(0,s.jsx)("div",{className:"relative h-full w-full bg-black",children:(0,s.jsx)(j.default,{src:q,alt:P("previewImage"),fill:!0,className:"object-contain",sizes:"92vw"})})]})}),(0,s.jsx)(r.n,{mode:"modal",open:Z,onOpenChange:J,callbackUrl:O})]})}},4010:(e,t,a)=>{a.d(t,{G4:()=>r,gU:()=>n,mq:()=>l});var s=a(49780);let r=[{id:"kling-2.6-motion-control",apiModel:"kling-2.6/motion-control",name:"Kling 2.6 Motion Control",provider:"Kuaishou",description:"Motion control with reference image + video guidance",estimatedTime:"2-15 min",credits:(0,s.pP)({model:"kling-2.6-motion-control",mode:"720p"}),creditsLabel:"".concat((0,s.pP)({model:"kling-2.6-motion-control",mode:"720p"}),"-").concat((0,s.pP)({model:"kling-2.6-motion-control",mode:"1080p"}))},{id:"kling-3.0-motion-control",apiModel:"kling-3.0/motion-control",name:"Kling 3.0 Motion Control",provider:"Kuaishou",description:"Higher-fidelity motion control with upgraded consistency",estimatedTime:"2-15 min",credits:(0,s.pP)({model:"kling-3.0-motion-control",mode:"720p"}),creditsLabel:"".concat((0,s.pP)({model:"kling-3.0-motion-control",mode:"720p"}),"-").concat((0,s.pP)({model:"kling-3.0-motion-control",mode:"1080p"})),isNew:!0}];function l(){var e;return null!=(e=function(e){if(e)return r.find(t=>
1t.id===e)}("kling-3.0-motion-control"))?e:r[0]}function n(e){return{min:3,max:"image"===e?10:30}}},6217:(e,t,a)=>{function s(e,t){let a=AbortSignal.timeout(35e3),s=(null==t?void 0:t.signal)?AbortSignal.any([t.signal,a]):a;return fetch(e,{...t,signal:s})}function r(e){var t;return 408===(t=e.status)||429===t||t>=500}a.d(t,{UN:()=>r,u9:()=>s})},7483:(e,t,a)=>{a.d(t,{w:()=>s});let s="data-[state=active]:border-primary/70 data-[state=active]:ring-2 data-[state=active]:ring-primary/30 dark:data-[state=active]:border-primary/60 focus-visible:!border-ring focus-visible:!ring-[3px] focus-visible:!ring-ring/50"},9713:(e,t,a)=>{a.d(t,{G7:()=>o,L$:()=>u,h_:()=>m,oI:()=>d,uB:()=>i,xL:()=>c});var s=a(76947);a(98547);var r=a(50845),l=a(755),n=a(50021);function i(e){let{className:t,...a}=e;return(0,s.jsx)(r.uB,{"data-slot":"command",className:(0,n.cn)("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),...a})}function o(e){let{className:t,...a}=e;return(0,s.jsxs)("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[(0,s.jsx)(l.A,{className:"size-4 shrink-0 opacity-50"}),(0,s.jsx)(r.uB.Input,{"data-slot":"command-input",className:(0,n.cn)("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),...a})]})}function d(e){let{className:t,...a}=e;return(0,s.jsx)(r.uB.List,{"data-slot":"command-list",className:(0,n.cn)("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),...a})}function c(e){let{...t}=e;return(0,s.jsx)(r.uB.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t})}function u(e){let{className:t,...a}=e;return(0,s.jsx)(r.uB.Group,{"data-slot":"command-group",className:(0,n.cn)("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),...a})}function m(e){let{className:t,...a}=e;return(0,s.jsx)(r.uB.Item,{"data-slot":"command-item",className:(0,n.cn)("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...a})}a(30786)},10506:(e,t,a)=>{a.d(t,{VideoEditorModelSelector:()=>g});var s=a(76947),r=a(87713),l=a(63185),n=a(23894),i=a(9713),o=a(15428),d=a(82821),c=a(755),u=a(73705),m=a(9493),p=a(94076),x=a(98547),h=a(90215);function f(e){let{className:t}=e;return(0,s.jsx)(l.g9,{className:t})}function g(e){let{value:t,onChange:a,disabled:l}=e,[g,b]=(0,x.useState)(!1),v=(0,p.c3)("Generator.common"),j=r.Tm.find(e=>e.id===t);return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(o.J,{className:"text-sm font-medium",children:v("model")}),(0,s.jsxs)(d.AM,{open:g,onOpenChange:b,children:[(0,s.jsx)(d.Wv,{asChild:!0,children:(0,s.jsxs)(n.$,{variant:"outline","aria-haspopup":"listbox","aria-expanded":g,disabled:l,className:(0,h.Ul)({open:g,disabled:l}),children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[(0,s.jsx)(f,{className:"w-6 h-6"}),(0,s.jsxs)("div",{className:"flex flex-1 flex-col items-start min-w-0 whitespace-normal",children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-sm",children:(null==j?void 0:j.name)||v("selectModel")}),(null==j?void 0:j.isNew)&&(0,s.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-primary/10 text-primary font-medium",children:"New"})]}),(0,s.jsx)("span",{className:"w-full whitespace-normal text-left text-xs text-muted-foreground line-clamp-2 break-words",children:(null==j?void 0:j.description)||v("selectModel")}),j&&(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[10px] text-muted-foreground",children:j.provider}),(0,s.jsxs)("span",{className:"text-[10px] text-muted-foreground px-1.5 py-0.5 rounded bg-muted",children:[(0,s.jsx)("span",{className:"text-xs",children:"â±"})," ",j.estimatedTime]}),(0,s.jsxs)("span",{className:"text-[10px] text-muted-foreground px-1.5 py-0.5 rounded bg-muted",children:[(0,s.jsx)("span",{className:"text-xs",children:"â"})," ",v("nCredits",{count:Number(j.credits)})]})]})]})]}),(0,s.jsxs)("div",{className:"flex flex-shrink-0 items-center gap-2",children:[(0,s.jsx)(c.A,{className:h.TF}),(0,s.jsx)(u.A,{className:(0,h.pk)(g)})]})]})}),(0,s.jsx)(d.hl,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:(0,s.jsx)(i.uB,{children:(0,s.jsxs)(i.oI,{className:"max-h-[320px]",children:[(0,s.jsx)(i.xL,{children:v("noModelFound")}),(0,s.jsx)(i.L$,{children:r.Tm.map(e=>{let r=t===e.id;return(0,s.jsxs)(i.h_,{value:e.id,onSelect:()=>{a(e.id),b(!1)},className:(0,h.jy)(r),children:[r&&(0,s.jsx)("span",{className:h.iD}),(0,s.jsx)("div",{className:(0,h.Ks)(r),children:r&&(0,s.jsx)(m.A,{className:"w-3 h-3"})}),(0,s.jsx)(f,{className:"w-6 h-6 flex-shrink-0"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-sm",children:e.name}),e.isNew&&(0,s.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-primary/10 text-primary font-medium",children:"New"})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:e.description}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,s.jsx)("span",{className:"text-[10px] text-muted-foreground",children:e.provider}),(0,s.jsxs)("span",{className:"text-[10px] text-muted-foreground px-1.5 py-0.5 rounded bg-muted",children:[(0,s.jsx)("span",{className:"text-xs",children:"â±"})," ",e.estimatedTime]}),(0,s.jsxs)("span",{className:"text-[10px] text-muted-foreground px-1.5 py-0.5 rounded bg-muted",children:[(0,s.jsx)("span",{className:"text-xs",children:"â"})," ",v("nCredits",{count:Number(e.credits)})]})]})]})]},e.id)})})]})})})]})]})}},11097:(e,t,a)=>{a.d(t,{Q:()=>s});let s=async(e,t,a)=>{var s;let r=(null==a?void 0:a.purpose)||"image",l=async(e,t)=>{let a=t;try{let t=await e.json();a=t.error||t.message||a}catch(e){a=t}return a},n=async()=>{var s;let n=null!=(s=null==a?void 0:a.contentType)?s:e.type,i=await fetch("/api/storage/presign",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filename:e.name,contentType:n,size:e.size,folder:t||"",purpose:r})});if(!i.ok){let e=Error(await l(i,"Failed to prepare upload"));throw e.status=i.status,e}let o=await i.json();if(!(await fetch(o.url,{method:"PUT",body:e,headers:n?{"Content-Type":n}:void 0})).ok)throw Error("Failed to upload file");return{url:o.publicUrl,key:o.key}},i=async()=>{let a=new FormData;a.append("file",e),a.append("folder",t||""),a.append("purpose",r);let s=await fetch("/api/storage/upload",{method:"POST",body:a});if(!s.ok){if(413===s.status)throw Error("File size exceeds the server limit");throw Error(await l(s,"Failed to upload file"))}return await s.json()},o=null==(s=null==a?void 0:a.allowFallback)||s;try{return await n()}catch(e){if(e instanceof Error){let t=e.status;if(401===t||403===t)throw e}if(!o)throw Error(e instanceof Error?e.message:"Failed to upload file");console.warn("Presigned upload failed, falling back to legacy upload",e);try{return await i()}catch(e){throw Error(e instanceof Error?e.message:"Unknown error occurred during file upload")}}}},12504:(e,t,a)=>{a.d(t,{L:()=>r});let s="https://cdn.latiai.com/public".replace(/\/$/,"")||"";function r(e){if(!e)return null!=e?e:"";if(/^https?:\/\//i.test(e))return e;let t=e.startsWith("/")?e:"/".concat(e);return s?"".concat(s).concat(t):t}},13092:(e,t,a)=>{a.d(t,{VideoQualitySelector:()=>o});var s=a(76947),r=a(23894),l=a(15428);let n=[{value:"lite",label:"Lite"},{value:"fast",label:"Fast"}
1,{value:"quality",label:"Quality"}],i=[{value:"standard",label:"Standard"},{value:"high",label:"High"}];function o(e){let{modelOption:t,veoQuality:a,soraQuality:o,onVeoQualityChange:d,onSoraQualityChange:c,disabled:u,disabledVeoQualities:m}=e;if("veo3"!==t&&"sora2-pro"!==t)return null;let p="veo3"===t,x=p?n:i,h=p?a:o,f=p?e=>d(e):e=>c(e);return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(l.J,{className:"text-sm font-medium",children:"Quality"}),(0,s.jsx)("div",{className:"flex gap-2",children:x.map(e=>(0,s.jsx)(r.$,{type:"button",variant:h===e.value?"default":"outline",className:"flex-1",onClick:()=>f(e.value),disabled:u||p&&(null==m?void 0:m.includes(e.value)),children:e.label},e.value))})]})}},13411:(e,t,a)=>{a.d(t,{ReferenceImageUploader:()=>k});var s=a(76947),r=a(50243),l=a(23894),n=a(30786),i=a(15428),o=a(39188),d=a(1777),c=a(2903),u=a(50021),m=a(11097),p=a(63280),x=a(79627),h=a(15266),f=a(20608),g=a(81247),b=a(81591),v=a(77077),j=a(94076),y=a(78799),w=a(98547),N=a(23941),C=a(88125);function k(e){let{images:t,onImagesChange:a,disabled:k,maxImages:L=3,maxFileSizeMB:S=10,accept:A="image/jpeg,image/png,image/webp",allowedMimeTypes:M,uploadFolder:D="video-input",uploadPurpose:I,uploadConcurrency:F=1,label:T,helperText:z,showWarning:E=!0,showHint:_=!0,formatHintText:R,getImageBadgeLabel:U}=e,G=(0,j.c3)("Generator.upload"),B=(0,d.w)(),P=(0,o.z)({includeSearch:!0}),[H,O]=(0,w.useState)(!1),[K,V]=(0,w.useState)(!1),[Z,J]=(0,w.useState)(!1),[$,W]=(0,w.useState)(null),q=(0,w.useRef)(!1),Q=1024*S*1024,X=(0,w.useCallback)(async e=>{if(k||Z||q.current||!e||0===e.length)return;let s=L-t.length;if(s<=0)return void N.o.error(G("maxReferenceImagesAllowed",{max:L}));let r=Array.from(e).slice(0,s),l=[];for(let e of r){if(!function(e,t,a){if(null==a?void 0:a.includes(e.type))return!0;let s=t.split(",").map(e=>e.trim().toLowerCase()).filter(Boolean),r=e.type.toLowerCase(),l=e.name.toLowerCase();return s.some(e=>e.startsWith(".")?l.endsWith(e):e.endsWith("/*")?r.startsWith(e.slice(0,-1)):r===e)}(e,A,M)){N.o.error(G("pleaseUploadImageOnly"));continue}if(e.size>Q){N.o.error(G("imagesMustBeSmaller",{size:S}));continue}l.push(e)}if(0!==l.length){if(!(null==B?void 0:B.user))return void V(!0);q.current=!0,J(!0);try{var n;let e=await (0,c.W)(l,F,async e=>{try{return{url:(await (0,m.Q)(e,D,I?{purpose:I,allowFallback:!1}:void 0)).url,error:null}}catch(e){return{url:null,error:e}}}),s=e.flatMap(e=>e.url?[e.url]:[]),r=null==(n=e.find(e=>e.error))?void 0:n.error;s.length>0&&a([...t,...s]),r&&N.o.error(G("uploadFailed"),{description:r instanceof Error?r.message:G("pleaseRetry")})}catch(e){console.error("Upload error:",e),N.o.error(G("uploadFailed"),{description:e instanceof Error?e.message:G("pleaseRetry")})}finally{q.current=!1,J(!1)}}},[A,M,k,t,Z,Q,S,L,a,B,G,D,F,I]),Y=(0,w.useCallback)(e=>{e.preventDefault(),O(!1),X(e.dataTransfer.files)},[X]),ee=(0,w.useCallback)(e=>{a(t.filter((t,a)=>a!==e))},[t,a]),et=(0,w.useCallback)(()=>{a([])},[a]);return(0,s.jsxs)("div",{className:"space-y-4",children:[E&&(0,s.jsxs)("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-amber-500/10 border border-amber-500/20 text-amber-700 dark:text-amber-400",children:[(0,s.jsx)(p.A,{className:"w-4 h-4 shrink-0"}),(0,s.jsx)("p",{className:"text-xs leading-none",children:G.rich("referenceModeWarning",{strong:e=>(0,s.jsx)("strong",{children:e})})})]}),(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)(i.J,{className:"text-sm font-medium",children:T||G("referenceImagesLabel")}),z&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:z})]}),t.length>0&&(0,s.jsx)(l.$,{type:"button",variant:"ghost",size:"sm",onClick:et,disabled:k||Z,className:"h-6 px-2 text-xs text-muted-foreground hover:text-destructive",children:G("clearAll")})]}),0===t.length&&(0,s.jsxs)("label",{className:(0,u.cn)("flex min-h-[140px] w-full cursor-pointer flex-col items-center justify-center rounded-xl border-2 border-dashed transition-all duration-200",H?"border-primary bg-primary/5":"border-border hover:-translate-y-0.5 hover:border-primary/50 hover:bg-accent/30 hover:shadow-sm",(k||Z)&&"cursor-not-allowed opacity-50"),onDrop:Y,onDragOver:e=>{e.preventDefault(),k||Z||O(!0)},onDragLeave:e=>{e.preventDefault(),k||Z||O(!1)},children:[(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-4",children:[Z?(0,s.jsx)(x.A,{className:"mb-2 h-5 w-5 animate-spin text-primary"}):(0,s.jsx)(h.A,{className:"mb-2 h-5 w-5 text-primary/80"}),(0,s.jsx)("p",{className:"text-sm font-medium text-foreground",children:Z?G("uploading"):G("uploadImage")}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:R||G("formatHintMultiple",{size:S})})]}),(0,s.jsx)("input",{type:"file",className:"hidden",accept:A,multiple:!0,onChange:e=>X(e.target.files),disabled:k||Z}
1)]}),t.length>0&&(0,s.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[t.map((e,t)=>{var a;return(0,s.jsxs)("div",{className:(0,u.cn)("relative group aspect-square overflow-hidden rounded-lg border border-border bg-muted transition-transform duration-200 hover:-translate-y-0.5 hover:shadow-md",!k&&"cursor-pointer"),children:[(0,s.jsx)(y.default,{src:e,alt:"Reference ".concat(t+1),fill:!0,className:"object-cover"}),(0,s.jsx)("div",{className:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity"}),(0,s.jsx)("button",{type:"button",className:"absolute left-1/2 top-1/2 z-20 inline-flex h-11 w-11 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-full bg-rose-500 text-white opacity-100 shadow-lg transition-opacity duration-200 [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-hover:opacity-100",onClick:t=>{t.stopPropagation(),W(e)},disabled:k||Z,"aria-label":G("previewImage"),children:(0,s.jsx)(f.A,{className:"h-5 w-5"})}),(0,s.jsx)(C.L,{className:"absolute right-2 top-2 z-20",onClick:e=>{e.stopPropagation(),ee(t)},disabled:k||Z,ariaLabel:G("remove")}),(0,s.jsx)("span",{className:"absolute bottom-1 left-1 z-10 max-w-[calc(100%-0.5rem)] truncate rounded-md bg-black/70 px-1.5 py-0.5 text-[10px] font-medium leading-none text-white shadow-sm",children:null!=(a=null==U?void 0:U(t))?a:t+1})]},t)}),t.length<L&&(0,s.jsxs)("label",{className:(0,u.cn)("flex aspect-square cursor-pointer flex-col items-center justify-center rounded-lg border-2 border-dashed border-border transition-all duration-200 hover:-translate-y-0.5 hover:border-primary/50 hover:bg-accent/30 hover:shadow-sm",(k||Z)&&"opacity-50 cursor-not-allowed"),children:[Z?(0,s.jsx)(x.A,{className:"w-5 h-5 text-muted-foreground mb-1 animate-spin"}):(0,s.jsx)(g.A,{className:"w-5 h-5 text-muted-foreground mb-1"}),(0,s.jsx)("span",{className:"text-[10px] text-muted-foreground",children:Z?G("uploading"):G("addMore")}),(0,s.jsx)("input",{type:"file",className:"hidden",accept:A,multiple:!0,onChange:e=>X(e.target.files),disabled:k||Z}
1)]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:G("referenceImagesStatus",{count:t.length,max:L})}),_&&(0,s.jsxs)("div",{className:"flex items-start gap-2 text-xs text-muted-foreground",children:[(0,s.jsx)(b.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,s.jsx)("p",{children:G("referenceHint")})]})]}),(0,s.jsx)(n.lG,{open:!!$,onOpenChange:e=>{e||W(null)},children:(0,s.jsxs)(n.Cf,{className:"h-[88vh] w-[92vw] max-w-[min(1200px,92vw)] overflow-hidden rounded-[28px] border border-white/10 bg-black p-0 shadow-2xl",children:[(0,s.jsx)(n.c7,{className:"sr-only",children:(0,s.jsx)(n.L3,{children:G("previewImage")})}),(0,s.jsx)("button",{type:"button",className:"absolute right-4 top-4 z-10 inline-flex h-11 w-11 items-center justify-center rounded-full border border-white/10 bg-black/75 text-white shadow-lg transition-colors hover:bg-black","aria-label":G("closePreview"),onClick:()=>W(null),children:(0,s.jsx)(v.A,{className:"h-5 w-5"})}),$&&(0,s.jsx)("div",{className:"relative h-full w-full bg-black",children:(0,s.jsx)(y.default,{src:$,alt:G("previewImage"),fill:!0,className:"object-contain",sizes:"92vw"})})]})}),(0,s.jsx)(r.n,{mode:"modal",open:K,onOpenChange:V,callbackUrl:P})]})}},13850:(e,t,a)=>{a.d(t,{bq:()=>u,eb:()=>p,gC:()=>m,l6:()=>d,yv:()=>c});var s=a(76947);a(98547);var r=a(44803),l=a(73705),n=a(9493),i=a(30324),o=a(50021);function d(e){let{...t}=e;return(0,s.jsx)(r.bL,{"data-slot":"select",...t})}function c(e){let{...t}=e;return(0,s.jsx)(r.WT,{"data-slot":"select-value",...t})}function u(e){let{className:t,size:a="default",children:n,...i}=e;return(0,s.jsxs)(r.l9,{"data-slot":"select-trigger","data-size":a,className:(0,o.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 group",t),...i,children:[n,(0,s.jsx)(r.In,{asChild:!0,children:(0,s.jsx)(l.A,{className:"size-4 opacity-50 transition-transform duration-200 group-data-[state=open]:rotate-180"})})]})}function m(e){let{className:t,children:a,position:l="popper",...n}=e;return(0,s.jsx)(r.ZL,{children:(0,s.jsxs)(r.UC,{"data-slot":"select-content",className:(0,o.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===l&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:l,...n,children:[(0,s.jsx)(x,{}),(0,s.jsx)(r.LM,{className:(0,o.cn)("p-1","popper"===l&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),(0,s.jsx)(h,{})]})})}function p(e){let{className:t,children:a,...l}=e;return(0,s.jsxs)(r.q7,{"data-slot":"select-item",className:(0,o.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pe-8 ps-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...l,children:[(0,s.jsx)("span",{className:"absolute end-2 flex size-3.5 items-center justify-center",children:(0,s.jsx)(r.VF,{children:(0,s.jsx)(n.A,{className:"size-4"})})}),(0,s.jsx)(r.p4,{children:a})]})}function x(e){let{className:t,...a}=e;return(0,s.jsx)(r.PP,{"data-slot":"select-scroll-up-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,s.jsx)(i.A,{className:"size-4"})})}function h(e){let{className:t,...a}=e;return(0,s.jsx)(r.wn,{"data-slot":"select-scroll-down-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,s.jsx)(l.A,{className:"size-4"})})}},14106:(e,t,a)=>{a.d(t,{OutputFormatSelector:()=>o});var s=a(76947),r=a(15428),l=a(50021),n=a(94076),i=a(98547);function o(e){let{value:t,onChange:a,disabled:o}=e,d=(0,n.c3)("Generator.common"),c=(0,i.useMemo)(()=>[{value:"png",label:"PNG",description:d("formatLosslessTransparent")},{value:"jpg",label:"JPG",description:d("formatSmallerSize")}],[d]);return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(r.J,{className:"text-sm font-medium",children:d("outputFormatLabel")}),(0,s.jsx)("div",{className:"flex gap-2",children:c.map(e=>{let r=t===e.value;return(0,s.jsxs)("button",{type:"button",disabled:o,onClick:()=>a(e.value),className:(0,l.cn)("flex-1 px-3 py-2 rounded-lg text-center transition-all border-2",r?"border-primary bg-primary/5":"border-border hover:border-primary/50 hover:bg-accent/50",o&&"opacity-50 cursor-not-allowed"),children:[(0,s.jsx)("div",{className:"font-medium text-sm",children:e.label}),(0,s.jsx)("div",{className:"text-[10px] text-muted-foreground",children:e.description})]},e.value)})})]})}},19165:(e,t,a)=>{a.d(t,{ET:()=>n,Jq:()=>d,OT:()=>h,QW:()=>x,To:()=>u,WP:()=>s,Z:()=>l,cX:()=>v,hc:()=>p,j0:()=>f,lE:()=>g,sb:()=>i,tl:()=>m,w3:()=>o,wD:()=>c,wZ:()=>r,zH:()=>b});let s=0xa00000,r=0x3200000,l=0xa00000,n=0x6400000,i=0x6400000,o=0xa00000,d=15,c=300,u=2e3,m=1e3,p=5,x=2048,h=0xa00000,f=3,g=30,b=2e3,v=6e4},22227:(e,t,a)=>{a.d(t,{S:()=>r});var s=a(6217);async function r(e,t){try{let a=await (0,s.u9)(e,t);if((0,s.UN)(a))return{kind:"retry"};let r=await a.json();if("object"==typeof r&&null!==r&&"retryable"in r&&!0===r.retryable)return{kind:"retry"};return{kind:"data",data:r}}catch(e){return{kind:"retry"}}}},22960:(e,t,a)=>{a.d(t,{ReferenceMediaUploader:()=>C});var s=a(76947),r=a(50243),l=a(23894),n=a(15428),i=a(39188),o=a(1777),d=a(2903),c=a(50021),u=a(11097),m=a(81247),p=a(71858),x=a(8901),h=a(79627),f=a(15266),g=a(
173287),b=a(94076),v=a(98547),j=a(23941),y=a(88125);async function w(e,t){return await new Promise((a,s)=>{let r=document.createElement(t);r.preload="metadata";let l=URL.createObjectURL(e);r.src=l;let n=!1,i=e=>{n||(n=!0,e())},o=window.setTimeout(()=>{i(()=>{URL.revokeObjectURL(l),r.onloadedmetadata=null,r.onerror=null,r.removeAttribute("src"),r.load(),s(Error("Media metadata timeout"))})},1e4),d=()=>{window.clearTimeout(o),URL.revokeObjectURL(l),r.onloadedmetadata=null,r.onerror=null,r.removeAttribute("src"),r.load()};r.onloadedmetadata=()=>{let e=r.duration,l="video"===t?r:null,n=null==l?void 0:l.videoWidth,o=null==l?void 0:l.videoHeight;i(()=>{if(d(),!Number.isFinite(e)||e<=0)return void s(Error("Invalid media duration"));a({durationSeconds:e,videoWidth:n,videoHeight:o})})},r.onerror=()=>{i(()=>{d(),s(Error("Failed to read media duration"))})}})}function N(e){return e&&Number.isFinite(e)&&!(e<=0)?"".concat(e.toFixed(e>=10?0:1),"s"):null}function C(e){let{kind:t,label:a,items:C,onItemsChange:k,purpose:L,disabled:S,maxFiles:A,maxSizeBytes:M,allowedMimeTypes:D,accept:I,formatHint:F,helperText:T,minDurationSeconds:z,maxDurationSeconds:E,maxTotalDurationSeconds:_,videoDimensions:R}=e,U=(0,b.c3)("Generator.upload"),G=(0,o.w)(),B=(0,i.z)({includeSearch:!0}),[P,H]=(0,v.useState)(!1),[O,K]=(0,v.useState)(!1),[V,Z]=(0,v.useState)(!1),J=(0,v.useRef)(!1),$=C.length,W=(0,v.useMemo)(()=>C.reduce((e,t)=>{var a;return e+Math.max(0,null!=(a=t.durationSeconds)?a:0)},0),[C]),q=N(W),Q="image"===t?(0,s.jsx)(m.A,{className:"w-3.5 h-3.5"}):"video"===t?(0,s.jsx)(p.A,{className:"w-3.5 h-3.5"}):(0,s.jsx)(x.A,{className:"w-3.5 h-3.5"}),X=(0,v.useCallback)(async e=>{if(S||O||J.current||!e||0===e.length)return;let s=A-C.length;if(s<=0)return void j.o.error("image"===t?U("maxImagesAllowed",{max:A}):"video"===t?U("maxVideosAllowed",{max:A}):U("maxAudiosAllowed",{max:A}));J.current=!0,K(!0);try{var r,l,n;let i=Array.from(e).slice(0,s),o=[],c=W;for(let e of i){if(!function(e,t,a){if(t.includes(e.type))return!0;if(!a)return!1;let s=e.name.toLowerCase();return a.split(",").map(e=>e.trim().toLowerCase()).filter(e=>e.startsWith(".")).some(e=>s.endsWith(e))}(e,D,I)){j.o.error(U("invalidFileType"),{description:"image"===t?U("pleaseUploadSupportedImage"):"video"===t?U("pleaseUploadSupportedVideo"):U("pleaseUploadSupportedAudio")});continue}if(e.size>M){j.o.error(U("fileTooLarge"),{description:"image"===t?U("pleaseUploadImageSmaller",{size:Math.round(M/1048576)}):"video"===t?U("pleaseUploadVideoSmaller",{size:Math.round(M/1048576)}):U("pleaseUploadAudioSmaller",{size:Math.round(M/1048576)})});continue}let s=null;if("audio"===t||"video"===t){let r;try{s=(r=await w(e,t)).durationSeconds}catch(e){console.error("[ReferenceMediaUploader] Failed to read duration",e),j.o.error("audio"===t?U("audioDurationUnreadable"):U("videoDurationUnreadable"));continue}if("video"===t&&R){let e=null!=(l=r.videoWidth)?l:0,t=null!=(n=r.videoHeight)?n:0,a=e>0&&t>0?Math.max(e/t,t/e):1/0;if(e<R.minPixelsPerSide||e>R.maxPixelsPerSide||t<R.minPixelsPerSide||t>R.maxPixelsPerSide||a>R.maxAspectRatio){j.o.error(U("videoDimensionsInvalid",{min:R.minPixelsPerSide,max:R.maxPixelsPerSide,ratio:R.maxAspectRatio}));continue}}if(z&&s<z){j.o.error(U("mediaMinDurationPerFile",{label:a,seconds:z}));continue}if(E&&s>E){j.o.error(U("mediaMaxDurationPerFile",{label:a,seconds:E}));continue}if(_&&c+s>_){j.o.error(U("mediaMaxTotalDuration",{label:a,seconds:_}));continue}c+=s}o.push({file:e,item:{url:"",durationSeconds:s}})}if(0===o.length)return;if(!(null==G?void 0:G.user))return void Z(!0);let m=await (0,d.W)(o,4,async e=>{let{file:t,item:a}=e;try{var s;return{item:{url:(await (0,u.Q)(t,void 0,{purpose:L,allowFallback:!1})).url,durationSeconds:null!=(s=a.durationSeconds)?s:null},error:null}}catch(e){return{item:null,error:e}}}),p=m.flatMap(e=>e.item?[e.item]:[]),x=null==(r=m.find(e=>e.error))?void 0:r.error;p.length>0&&k([...C,...p]),x&&j.o.error(U("uploadFailed"),{description:x instanceof Error?x.message:U("pleaseRetry")})}catch(e){console.error("[ReferenceMediaUploader] Upload error:",e),j.o.error(U("uploadFailed"),{description:e instanceof Error?e.message:U("pleaseRetry")})}finally{J.current=!1,K(!1)}},[D,I,S,O,C,t,a,E,A,M,_,z,k,L,null==G?void 0:G.user,U,W,R]),Y=(0,v.useCallback)(e=>{k(C.filter((t,a)=>a!==e))},[C,k]),ee=(0,v.useCallback)(()=>{k([])},[k]);return(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsx)(n.J,{className:"text-sm font-medium",children:a}),$>0&&(0,s.jsx)(l.$,{type:"button",variant:"ghost",size:"sm",onClick:ee,disabled:S||O,className:"h-6 px-2 text-xs text-muted-foreground hover:text-destructive",children:U("clearAll")})]}
1),0===$?(0,s.jsxs)("label",{className:(0,c.cn)("flex w-full min-h-[140px] cursor-pointer flex-col items-center justify-center rounded-xl border-2 border-dashed transition-all",P?"border-primary bg-primary/5":"border-border hover:border-primary/50 hover:bg-accent/30",(S||O)&&"cursor-not-allowed opacity-50"),onDrop:e=>{e.preventDefault(),H(!1),X(e.dataTransfer.files)},onDragOver:e=>{e.preventDefault(),S||O||H(!0)},onDragLeave:e=>{e.preventDefault(),S||O||H(!1)},children:[(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-4",children:[(0,s.jsx)("div",{className:"mb-3 flex h-10 w-10 items-center justify-center rounded-full bg-gradient-to-r from-blue-500/10 to-purple-500/10",children:O?(0,s.jsx)(h.A,{className:"h-5 w-5 animate-spin text-blue-500"}):(0,s.jsx)(f.A,{className:"h-5 w-5 text-blue-500"})}),(0,s.jsx)("p",{className:"mb-1 text-sm text-muted-foreground",children:O?(0,s.jsx)("span",{className:"font-medium text-primary",children:U("uploading")}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"font-medium text-primary",children:U("clickToUpload")})," ",U("orDragAndDrop")]})}),F&&(0,s.jsx)("p",{className:"text-center text-xs text-muted-foreground",children:F})]}),(0,s.jsx)("input",{type:"file",className:"hidden",accept:I||D.join(","),multiple:A>1,onChange:e=>void X(e.target.files),disabled:S||O})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:(0,c.cn)("audio"===t?"space-y-3":"grid gap-3 sm:grid-cols-2 lg:grid-cols-3"),children:[C.map((e,r)=>{let l=N(e.durationSeconds);return"image"===t?(0,s.jsxs)("div",{className:"relative overflow-hidden rounded-lg border border-border bg-muted",children:[(0,s.jsx)("img",{src:e.url,alt:a,className:"h-32 w-full object-cover"}),(0,s.jsx)("span",{className:"absolute bottom-2 left-2 rounded-md bg-black/70 px-1.5 py-0.5 text-[10px] font-medium leading-none text-white shadow-sm",children:r+1}),(0,s.jsx)(y.L,{className:"absolute right-2 top-2",onClick:()=>Y(r),disabled:S||O,ariaLabel:U("remove")})]},"".concat(e.url,"-").concat(r)):"video"===t?(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-muted p-2",children:[(0,s.jsx)("div",{className:"relative overflow-hidden rounded-lg bg-black shadow-sm",children:(0,s.jsx)("video",{src:e.url,controls:!0,className:"block max-h-40 w-full rounded-lg bg-black"})}),(0,s.jsxs)("div",{className:"mt-2 flex items-center justify-between gap-2",children:[(0,s.jsx)("span",{className:"rounded-md bg-black/70 px-1.5 py-0.5 text-[10px] font-medium leading-none text-white shadow-sm",children:r+1}),(0,s.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[l&&(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:l}),(0,s.jsx)(y.L,{onClick:()=>Y(r),disabled:S||O,ariaLabel:U("remove")})]})]})]},"".concat(e.url,"-").concat(r)):(0,s.jsxs)("div",{className:"relative overflow-hidden rounded-xl border border-border bg-muted p-3",children:[(0,s.jsx)("audio",{src:e.url,controls:!0,className:"w-full"}),(0,s.jsxs)("div",{className:"mt-2 flex items-center justify-between gap-2",children:[(0,s.jsx)("span",{className:"rounded-md bg-black/70 px-1.5 py-0.5 text-[10px] font-medium leading-none text-white shadow-sm",children:r+1}),(0,s.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[l&&(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:l}),(0,s.jsx)(y.L,{onClick:()=>Y(r),disabled:S||O,ariaLabel:U("remove")})]})]})]},"".concat(e.url,"-").concat(r))}),$<A&&(0,s.jsxs)("label",{className:(0,c.cn)("flex min-h-[120px] cursor-pointer flex-col items-center justify-center rounded-xl border-2 border-dashed border-border bg-muted/30 transition-all","hover:border-primary/50 hover:bg-accent/30",(S||O)&&"cursor-not-allowed opacity-50"),children:[O?(0,s.jsx)(h.A,{className:"mb-2 h-5 w-5 animate-spin text-muted-foreground"}):(0,s.jsx)(g.A,{className:"mb-2 h-5 w-5 text-muted-foreground"}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:O?U("uploading"):U("addMore")}),(0,s.jsx)("input",{type:"file",className:"hidden",accept:I||D.join(","),multiple:!0,onChange:e=>void X(e.target.files),disabled:S||O})]})]}),(0,s.jsxs)("div",{className:"text-xs text-muted-foreground",children:[$,"/",A,q&&_?" \xb7 ".concat(q,"/").concat(_,"s"):""]})]}),0===$&&T&&(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[Q,(0,s.jsx)("span",{children:T})]}),(0,s.jsx)(r.n,{mode:"modal",open:V,onOpenChange:Z,callbackUrl:B})]})}},23753:(e,t,a)=>{a.d(t,{GeneratorRouteTabs:()=>i});var s=a(76947),r=a(1279),l=a(50021),n=a(7483);function i(e){let{activeValue:t,ariaLabel:a,items:i,className:o}=e;return(0,s.jsx)("nav",{"aria-label":a,children:(0,s.jsx)("div",{"data-slot":"tabs-list",className:(0,l.cn)("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",o),children:i.map(e=>{let a=e.value===t;return(0,s.jsxs)(r.XO,{href:e.href,"aria-current":a?"page":void 0,"data-slot":"tabs-trigger","data-state":a?"active":"inactive",className:(0,l.cn)("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow,border-color] focus-visible:ring-[3px] focus-visible:outline-1 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n.w),children:[e.icon,e.label]},e.value)})})})}},24355:(e,t,a)=>{a.d(t,{FrameImageUploader:()=>w});var s=a(76947),r=a(50243),l=a(30786),n=a(15428),i=a(92646),o=a(39188),d=a(1777),c=a(50021),u=a(11097),m=a(20608),p=a(79627),x=a(15266),h=a(81591),f=a(77077),g=a(94076),b=a(78799),v=a(98547),j=a(23941),y=a(88125);function w(e){let{startFrame:t,endFrame:a,addEndFrame:w,onStartFrameChange:N,onEndFrameChange:C,onAddEndFrameChange:k,disabled:L,showEndFrameToggle:S=!0,singleImageLabel:A,showFaceWarning:M=!1,maxFileSizeMB:D=10,accept:I="image/jpeg,image/png,image/webp",allowedMimeTypes:F,uploadFolder:T="video-input",uploadPurpose:z,formatHintText:E}=e,_=(0,g.c3)("Generator.upload"),R=(0,d.w)(),U=(0,o.z)({includeSearch:!0}),[G,B]=(0,v.useState)(!1),[P,H]=(0,v.useState)(!1),[O,K]=(0,v.useState)(!1),[V,Z]=(0,v.useState)(null),[J,$]=(0,v.useState)(null),W=1024*D*1024,q=(0,v.useCallback)(async(e,t)=>{if(!e||0===e.length)return;let a=e[0];if(!function(e,t,a){if(null==a?void 0:a.includes(e.type))return!0;let s=t.split(",").map(e=>
1e.trim().toLowerCase()).filter(Boolean),r=e.type.toLowerCase(),l=e.name.toLowerCase();return s.some(e=>e.startsWith(".")?l.endsWith(e):e.endsWith("/*")?r.startsWith(e.slice(0,-1)):r===e)}(a,I,F))return void j.o.error(_("pleaseUploadImageFile"));if(a.size>W)return void j.o.error(_("imageMustBeSmaller",{size:D}));if(!(null==R?void 0:R.user))return void K(!0);Z(t);try{let e=await (0,u.Q)(a,T,z?{purpose:z,allowFallback:!1}:void 0);"start"===t?N(e.url):C(e.url)}catch(e){console.error("Upload error:",e),j.o.error(_("uploadFailed"),{description:e instanceof Error?e.message:_("pleaseRetry")})}finally{Z(null)}},[I,F,W,D,N,C,R,_,T,z]),Q=(0,v.useCallback)((e,t)=>{e.preventDefault(),"start"===t?B(!1):H(!1),q(e.dataTransfer.files,t)},[q]),X=(e,t,a,r,l,i)=>{let o=V===e;return(0,s.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,s.jsx)(n.J,{className:"text-sm font-medium",children:i}),t?(0,s.jsxs)("div",{className:(0,c.cn)("relative group aspect-square max-w-[140px] overflow-hidden rounded-lg border border-border bg-muted transition-transform duration-200 hover:-translate-y-0.5 hover:shadow-md",!L&&"cursor-pointer"),children:[(0,s.jsx)(b.default,{src:t,alt:i,fill:!0,className:"object-cover"}),(0,s.jsx)("div",{className:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity"}),(0,s.jsx)("button",{type:"button",className:"absolute left-1/2 top-1/2 z-20 inline-flex h-11 w-11 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-full bg-rose-500 text-white opacity-100 shadow-lg transition-opacity duration-200 [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-hover:opacity-100",onClick:t=>{t.stopPropagation(),$(e)},disabled:L,"aria-label":_("previewImage"),children:(0,s.jsx)(m.A,{className:"h-5 w-5"})}),(0,s.jsx)(y.L,{className:"absolute right-2 top-2 z-20",onClick:e=>{e.stopPropagation(),l()},disabled:L,ariaLabel:_("remove")})]}):(0,s.jsxs)("label",{className:(0,c.cn)("flex min-h-[140px] w-full cursor-pointer flex-col items-center justify-center rounded-xl border-2 border-dashed transition-all duration-200",a?"border-primary bg-primary/5":"border-border hover:-translate-y-0.5 hover:border-primary/50 hover:bg-accent/30 hover:shadow-sm",(L||o)&&"cursor-not-allowed opacity-50"),onDrop:t=>Q(t,e),onDragOver:e=>{e.preventDefault(),r(!0)},onDragLeave:e=>{e.preventDefault(),r(!1)},children:[(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-4",children:[o?(0,s.jsx)(p.A,{className:"mb-2 h-5 w-5 animate-spin text-primary"}):(0,s.jsx)(x.A,{className:"mb-2 h-5 w-5 text-primary/80"}),(0,s.jsx)("p",{className:"text-sm font-medium text-foreground",children:o?_("uploading"):_("uploadImage")}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:E||_("formatHint",{size:D})}),M&&(0,s.jsx)("p",{className:"mt-1 text-xs text-amber-600 dark:text-amber-400",children:_("humanFacesNotSupported")})]}),(0,s.jsx)("input",{type:"file",className:"hidden",accept:I,onChange:t=>q(t.target.files,e),disabled:L||o})]})]})},Y=S&&w?_("frameHintDual"):_("frameHintSingle");return(0,s.jsxs)("div",{className:"space-y-4",children:[S&&(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)(n.J,{htmlFor:"add-end-frame",className:"text-sm font-medium cursor-pointer",children:_("addEndFrame")}),(0,s.jsx)(i.d,{id:"add-end-frame",checked:w,onCheckedChange:k,disabled:L})]}),(0,s.jsxs)("div",{className:"flex gap-4",children:[X("start",t,G,B,()=>N(null),S?w?_("firstFrameImage"):_("chooseStartingImage"):A||_("uploadImage")),S&&w&&X("end",a,P,H,()=>C(null),_("lastFrameImage"))]}),(0,s.jsxs)("div",{className:"flex items-start gap-2 text-xs text-muted-foreground",children:[(0,s.jsx)(h.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,s.jsx)("p",{children:Y})]}),(0,s.jsx)(l.lG,{open:null!==J,onOpenChange:e=>{e||$(null)},children:(0,s.jsxs)(l.Cf,{className:"h-[88vh] w-[92vw] max-w-[min(1200px,92vw)] overflow-hidden rounded-[28px] border border-white/10 bg-black p-0 shadow-2xl",children:[(0,s.jsx)(l.c7,{className:"sr-only",children:(0,s.jsx)(l.L3,{children:_("previewImage")})}),(0,s.jsx)("button",{type:"button",className:"absolute right-4 top-4 z-10 inline-flex h-11 w-11 items-center justify-center rounded-full border border-white/10 bg-black/75 text-white shadow-lg transition-colors hover:bg-black","aria-label":_("closePreview"),onClick:()=>$(null),children:(0,s.jsx)(f.A,{className:"h-5 w-5"})}),("start"===J?t:a)&&(0,s.jsx)("div",{className:"relative h-full w-full bg-black",children:(0,s.jsx)(b.default,{src:"start"===J?t:a,alt:_("previewImage"),fill:!0,className:"object-contain",sizes:"92vw"})})]})}),(0,s.jsx)(r.n,{mode:"modal",open:O,onOpenChange:K,callbackUrl:U})]})}},24854:(e,t,a)=>{a.d(t,{ResolutionSelector:()=>o});var s=a(76947),r=a(15428),l=a(50021),n=a(9493);let i=[{value:"1K",label:"1K",description:"Standard"},{value:"2K",label:"2K",description:"High quality"},{value:"4K",label:"4K",description:"Ultra HD"}];function o(e){let{value:t,onChange:a,disabled:o,disabledOptions:d=[],label:c="Resolution",options:u}=e;return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(r.J,{className:"text-sm font-medium",children:c}),(0,s.jsx)("div",{className:"flex gap-2",children:(null!=u?u:i).map(e=>{let r=t===e.value,i=d.includes(e.value);return(0,s.jsxs)("button",{type:"button",disabled:o||i,onClick:()=>a(e.value),className:(0,l.cn)("relative flex-1 px-3 py-2 rounded-lg text-center transition-all border-2",r?"border-primary bg-primary/5":"border-border hover:border-primary/50 hover:bg-accent/50",o&&"opacity-50 cursor-not-allowed",i&&"opacity-40 cursor-not-allowed hover:border-border hover:bg-transparent"),children:[r&&(0,s.jsx)("div",{className:"absolute top-1 right-1",children:(0,s.jsx)(n.A,{className:"w-3 h-3 text-primary"})}),(0,s.jsx)("div",{className:"font-medium text-sm",children:e.label}),e.description&&(0,s.jsx)("div",{className:"text-[10px] text-muted-foreground",children:e.description})]},e.value)})})]})}},26387:(e,t,a)=>{a.d(t,{d:()=>n});var s=a(76947),r=a(23894),l=a(50021);function n(e){let{options:t,value:a,onChange:n,disabled:i,label:o}=e;return 0===t.length?null:(0,s.jsxs)("fieldset",{className:"flex min-w-0 items-start gap-2","aria-label":o,children:[(0,s.jsx)("span",{className:"shrink-0 py-1 text-xs text-muted-foreground",children:"Top:"}),(0,s.jsx)("div",{className:"flex min-w-0 flex-1 flex-wrap gap-1.5",children:t.map(e=>{let t=e.id===a;return(0,s.jsx)(r.$,{type:"button",variant:"ghost",size:"sm",className:(0,l.cn)("h-6 rounded-full border px-2.5 text-xs font-normal shadow-none active:scale-100",t?"border-primary bg-primary text-primary-foreground [@media(hover:hover)]:hover:bg-primary [@media(hover:hover)]:hover:text-primary-foreground":"border-input text-foreground"),"aria-pressed":t,disabled:i,onClick:()=>{i||t||n(e.id)},children:e.label},e.id)})})]})}},26693:(e,t,a)=>{a.d(t,{StyleSelector:()=>c});var s=a(76947),r=a(82821),l=a(50021),n=a(73705),i=a(77077),o=a(9493),d=a(98547);function c(e){var t,a;let{value:c,onChange:u,options:m,disabled:p,noneValue:x,columns:h=3,maxHeight:f=320}=e,[g,b]=(0,d.useState)(!1),v=(0,d.useMemo)(()=>{var e;return null!=(e=m.find(e=>e.id===c))?e:m[0]},[m,c]),j=null!=x?x:null==(t=m[0])?void 0:t.id,y=(null==v?void 0:v.id)===j,w=null==v||null==(a=v.emoji)?void 0:a.trim();return(0,s.jsx)("div",{className:"shrink-0",children:(0,s.jsxs)(r.AM,{open:g,onOpenChange:b,children:[(0,s.jsxs)("div",{className:(0,l.cn)("inline-flex items-center rounded-full border transition-colors",y?"border-border":"border-primary/30",p&&"opacity-50 cursor-not-allowed"),children:[(0,s.jsx)(r.Wv,{asChild:!0,children:(0,s.jsxs)("button",{type:"button",disabled:p,className:(0,l.cn)("inline-flex items-center gap-1.5 px-3 py-1 text-sm font-medium transition-colors",y?"text-muted-foreground hover:bg-muted/50":"text-foreground hover:bg-accent/50",p&&"cursor-not-allowed"),"aria-pressed":!y,children:[w?(0,s.jsx)("span",{className:"text-base leading-none",children:w}):null,(0,s.jsx)("span",{children:v.label}),(0,s.jsx)(n.A,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),!y&&(0,s.jsx)("button",{type:"button",disabled:p,className:(0,l.cn)("mr-1 inline-flex h-5 w-5 items-center justify-center rounded-full transition-colors",p?"cursor-not-allowed":"hover:bg-muted"),onClick:()=>j&&u(j),"aria-label":"Clear selection",children:(0,s.jsx)(i.A,{className:"h-3 w-3"})})]}),(0,s.jsx)(r.hl,{className:"w-[360px] sm:w-[420px] max-w-[calc(100vw-2rem)] p-3",align:"start",children:(0,s.jsx)("div",{className:"grid gap-2 overflow-y-auto pr-1",style:{gridTemplateColumns:"repeat(".concat(h,", minmax(0, 1fr))"),maxHeight:f},children:m.map(e=>{let t=e.id===c;return(0,s.jsxs)("button",{type:"button",onClick:()=>{u(e.id),b(!1)},disabled:p,"aria-pressed":t,className:(0,l.cn)("relative flex min-h-[64px] flex-col items-center justify-center gap-1 rounded-lg border-2 px-2 py-3 text-center transition-all",t?"border-primary bg-primary/5":"border-border hover:border-primary/50 hover:bg-accent/50",p&&"opacity-50 cursor-not-allowed"),children:[t&&(0,s.jsx)("span",{className:"absolute top-1 right-1",children:(0,s.jsx)(o.A,{className:"h-3 w-3 text-primary"})}),e.emoji?(0,s.jsx)("span",{className:"text-lg leading-none",children:e.emoji}):null,(0,s.jsx)("span",{className:"text-xs font-medium leading-tight break-words hyphens-auto text-center",children:e.label})]},e.id)})})})]})})}},26991:(e,t,a)=>{a.d(t,{AspectRatioSelector:()=>i});var s=a(76947),r=a(15428),l=a(13850),n=a(94076);function i(e){let{value:t,onChange:a,disabled:i,options:o}=e,d=(0,n.c3)("Generator.common"),c=(0,n.c3)("Generator.aspectRatios"),u=[{value:"auto",label:c("auto")},{value:"1:1",label:c("1:1")},{value:"16:9",label:c("16:9")},{value:"9:16",label:c("9:16")},{value:"4:3",label:c("4:3")},{value:"3:4",label:c("3:4")},{value:"5:4",label:c("5:4")},{value:"4:5",label:c("4:5")},{value:"3:2",label:c("3:2")},{value:"2:3",label:c("2:3")},{value:"21:9",label:c("21:9")}];return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(r.J,{className:"text-sm font-medium",children:d("aspectRatio")}),(0,s.jsxs)(l.l6,{value:t,onValueChange:a,disabled:i,children:[(0,s.jsx)(l.bq,{className:"w-full",children:(0,s.jsx)(l.yv,{placeholder:d("selectAspectRatio")})}),(0,s.jsx)(l.gC,{children:(o||u).map(e=>(0,s.jsx)(l.eb,{value:e.value,children:e.label},e.value))})]})]})}},29496:(e,t,a)=>{a.d(t,{AvatarScriptPresets:()=>i});var s=a(76947);let r=[{key:"general",emoji:"\uD83D\uDCAC"},{key:"birthday",emoji:"\uD83C\uDF82"},{key:"wedding",emoji:"\uD83D\uDC8D"},{key:"pepTalk",emoji:"\uD83D\uDCAA"},{key:"roast",emoji:"\uD83D\uDD25"},{key:"congrats",emoji:"\uD83C\uDF89"},{key:"thanks",emoji:"\uD83D\uDE4F"},{key:"anniversary",emoji:"â¤ï¸"}];var l=a(50021),n=a(94076);function i(e){let{onSelect:t,disabled:a}=e,i=(0,n.c3)("Generator.aiAvatar");return(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:r.map(e=>(0,s.jsxs)("button",{type:"button",disabled:a,onClick:()=>t(i("scriptPresets.".concat(e.key,".text"))),className:(0,l.cn)("rounded-full border bg-foreground
1/5 px-2.5 py-1 text-xs text-muted-foreground transition-colors",a?"cursor-not-allowed opacity-50":"hover:bg-foreground/10 hover:text-foreground"),children:[e.emoji," ",i("scriptPresets.".concat(e.key,".label"))]},e.key))})}},30896:(e,t,a)=>{a.d(t,{DurationSelector:()=>y,HappyHorseDurationSelector:()=>L,HappyHorseResolutionSelector:()=>F,Kling30DurationSelector:()=>k,Kling30ModeSelector:()=>M,KlingDurationSelector:()=>C,SeedanceDurationSelector:()=>S,VariableDurationSelector:()=>A,VeoDurationSelector:()=>w,VeoResolutionSelector:()=>N,WanDurationSelector:()=>D,WanResolutionSelector:()=>I});var s=a(76947),r=a(15428),l=a(91549),n=a(41303),i=a(50021),o=a(81591),d=a(9493),c=a(94076);let u=[{value:"10",label:"10s",descriptionKey:"durationStandard"},{value:"15",label:"15s",descriptionKey:"durationExtended"}],m=[{value:"4",label:"4s",descriptionKey:"durationFastest"},{value:"6",label:"6s",descriptionKey:"durationBalanced"},{value:"8",label:"8s",descriptionKey:"durationLongest"}],p=[{value:"720p",label:"720p",descriptionKey:"durationStandard"},{value:"1080p",label:"1080p",descriptionKey:"resolutionHd"},{value:"4k",label:"4K",descriptionKey:"resolution4k"}],x=[{value:"5",label:"5s",descriptionKey:"durationStandard"},{value:"10",label:"10s",descriptionKey:"durationExtended"}],h=[{value:"std",labelKey:"modeStd",descriptionKey:"modeStdHelper"},{value:"pro",labelKey:"modePro",descriptionKey:"modeProHelper"},{value:"4K",labelKey:"mode4k",descriptionKey:"mode4kHelper"}],f=[{value:"5",label:"5s",descriptionKey:"durationFastest"},{value:"10",label:"10s",descriptionKey:"durationBalanced"},{value:"15",label:"15s",descriptionKey:"durationLongest"}],g=[{value:"720p",label:"720p",descriptionKey:"durationStandard"},{value:"1080p",label:"1080p",descriptionKey:"resolutionHd"}],b=[{value:"720p",label:"720p",descriptionKey:"durationStandard"},{value:"1080p",label:"1080p",descriptionKey:"resolutionHd"}];function v(e){let{value:t,min:a,max:d,markers:u,tooltip:m,disabled:p,onChange:x}=e,h=(0,c.c3)("Generator.video"),f=Number.isFinite(t)?t:a;return(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(r.J,{className:"text-sm font-medium",children:h("duration")}),(0,s.jsxs)(n.m_,{children:[(0,s.jsx)(n.k$,{asChild:!0,children:(0,s.jsx)("button",{type:"button",className:"text-muted-foreground transition-colors hover:text-foreground",children:(0,s.jsx)(o.A,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(n.ZI,{className:"max-w-xs",children:(0,s.jsx)("p",{children:m})})]})]}),(0,s.jsxs)("div",{className:"rounded-full border bg-muted px-3 py-1 text-sm font-medium",children:[f,"s"]})]}),(0,s.jsx)(l.A,{min:a,max:d,step:1,value:[f],onValueChange:e=>{let[t]=e;x(t)},disabled:p}),(0,s.jsx)("div",{className:"relative h-4 text-xs text-muted-foreground",children:u.map((e,t,r)=>{let l=(e-a)/(d-a)*100,n=0===t?"translate-x-0":t===r.length-1?"-translate-x-full":"-translate-x-1/2";return(0,s.jsxs)("span",{className:(0,i.cn)("absolute top-0",n),style:{left:"".concat(l,"%")},children:[e,"s"]},e)})})]})}function j(e){let{isSelected:t,disabled:a,onClick:r,label:l,description:n}=e;return(0,s.jsxs)("button",{type:"button",disabled:a,onClick:r,className:(0,i.cn)("relative flex-1 px-3 py-2 rounded-lg text-center transition-all border-2",t?"border-primary bg-primary/5":"border-border hover:border-primary/50 hover:bg-accent/50",a&&"opacity-50 cursor-not-allowed"),children:[t&&(0,s.jsx)("div",{className:"absolute top-1 right-1",children:(0,s.jsx)(d.A,{className:"w-3 h-3 text-primary"})}),(0,s.jsx)("div",{className:"font-medium text-sm",children:l}),(0,s.jsx)("div",{className:"text-[10px] text-muted-foreground",children:n})]})}function y(e){let{value:t,onChange:a,disabled:l}=e,n=(0,c.c3)("Generator.video");return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(r.J,{className:"text-sm font-medium",children:n("duration")}),(0,s.jsx)("div",{className:"flex gap-2",children:u.map(e=>(0,s.jsx)(j,{isSelected:t===e.value,disabled:l,onClick:()=>a(e.value),label:e.label,description:n(e.descriptionKey)},e.value))})]})}function w(e){let{value:t,onChange:a,disabled:l}=e,n=(0,c.c3)("Generator.video");return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(r.J,{className:"text-sm font-medium",children:n("duration")}),(0,s.jsx)("div",{className:"flex gap-2",children:m.map(e=>(0,s.jsx)(j,{isSelected:t===e.value,disabled:l,onClick:()=>a(e.value),label:e.label,description:n(e.descriptionKey)},e.value))})]})}function N(e){let{value:t,onChange:a,disabled:l}=e,n=(0,c.c3)("Generator.video");return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(r.J,{className:"text-sm font-medium",children:n("resolution")}),(0,s.jsx)("div",{className:"flex gap-2",children:p.map(e=>(0,s.jsx)(j,{isSelected:t===e.value,disabled:l,onClick:()=>a(e.value),label:e.label,description:n(e.descriptionKey)},e.value))})]})}function C(e){let{value:t,onChange:a,disabled:l}=e,n=(0,c.c3)("Generator.video");return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(r.J,{className:"text-sm font-medium",children:n("duration")}),(0,s.jsx)("div",{className:"flex gap-2",children:x.map(e=>(0,s.jsx)(j,{isSelected:t===e.value,disabled:l,onClick:()=>a(e.value),label:e.label,description:n(e.descriptionKey)},e.value))})]})}function k(e){let{value:t,onChange:a,disabled:r}
1=e,l=(0,c.c3)("Generator.video");return(0,s.jsx)(v,{value:Number.parseInt(t,10),min:3,max:15,markers:[3,6,9,12,15],tooltip:l("durationTooltip"),disabled:r,onChange:e=>{a(String(e))}})}function L(e){let{value:t,onChange:a,disabled:r}=e,l=(0,c.c3)("Generator.video");return(0,s.jsx)(v,{value:Number.parseInt(t,10),min:3,max:15,markers:[3,6,9,12,15],tooltip:l("durationTooltip"),disabled:r,onChange:e=>{a(String(e))}})}function S(e){let{...t}=e;return(0,s.jsx)(A,{...t})}function A(e){let{value:t,onChange:a,disabled:r,min:l=4,max:n=15,tooltip:i}=e,o=Array.from(new Set((n<=15?[l,7,10,13,n]:[l,10,15,20,25,n]).filter(e=>e>=l&&e<=n))).sort((e,t)=>e-t);return(0,s.jsx)(v,{value:t,min:l,max:n,markers:o,tooltip:i,disabled:r,onChange:a})}function M(e){let{value:t,onChange:a,disabled:l}=e,n=(0,c.c3)("Generator.video");return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(r.J,{className:"text-sm font-medium",children:n("modeLabel")}),(0,s.jsx)("div",{className:"flex gap-2",children:h.map(e=>(0,s.jsx)(j,{isSelected:t===e.value,disabled:l,onClick:()=>a(e.value),label:n(e.labelKey),description:n(e.descriptionKey)},e.value))})]})}function D(e){let{value:t,onChange:a,disabled:l}=e,n=(0,c.c3)("Generator.video");return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(r.J,{className:"text-sm font-medium",children:n("duration")}),(0,s.jsx)("div",{className:"flex gap-2",children:f.map(e=>(0,s.jsx)(j,{isSelected:t===e.value,disabled:l,onClick:()=>a(e.value),label:e.label,description:n(e.descriptionKey)},e.value))})]})}function I(e){let{value:t,onChange:a,disabled:l}=e,n=(0,c.c3)("Generator.video");return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(r.J,{className:"text-sm font-medium",children:n("resolution")}),(0,s.jsx)("div",{className:"flex gap-2",children:g.map(e=>(0,s.jsx)(j,{isSelected:t===e.value,disabled:l,onClick:()=>a(e.value),label:e.label,description:n(e.descriptionKey)},e.value))})]})}function F(e){let{value:t,onChange:a,disabled:l}=e,n=(0,c.c3)("Generator.video");return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(r.J,{className:"text-sm font-medium",children:n("resolution")}),(0,s.jsx)("div",{className:"flex gap-2",children:b.map(e=>(0,s.jsx)(j,{isSelected:t===e.value,disabled:l,onClick:()=>a(e.value),label:e.label,description:n(e.descriptionKey)},e.value))})]})}},31023:(e,t,a)=>{a.d(t,{VideoModelDropdownSelector:()=>v,getVideoModelInfo:()=>j});var s=a(76947),r=a(63185),l=a(23894),n=a(9713),i=a(15428),o=a(82821),d=a(755),c=a(73705),u=a(9493),m=a(94076),p=a(98547),x=a(26387),h=a(90215);let f=[{id:"seedance2.5",name:"Seedance 2.5",provider:"ByteDance",description:"Multimodal video generation",estimatedTime:"5-15 min",creditsRange:"84-1800",isNew:!0},{id:"seedance2",name:"Seedance 2",provider:"ByteDance",description:"Dance, action, and controlled motion ⢠4-15s",estimatedTime:"5-15 min",creditsRange:"60-3060"},{id:"seedance2-fast",name:"Seedance 2 Fast",provider:"ByteDance",description:"Quick drafts for motion ideas ⢠4-15s",estimatedTime:"5-15 min",creditsRange:"42-480"},{id:"kling3.0",name:"Kling 3.0",provider:"Kuaishou",description:"Std/Pro/4K ⢠Multi-shot ⢠Start/end frames ⢠3-15s",estimatedTime:"2-10 min",creditsRange:"33-810",isNew:!0},{id:"kling2.6",name:"Kling 2.6",provider:"Kuaishou",description:"Fast generation ⢠Sound option ⢠5-10s",estimatedTime:"2-10 min",creditsRange:"55-220"},{id:"veo3",name:"Veo 3.1",provider:"Google",description:"Cinematic video with AI audio ⢠4-8s ⢠720p-4K",estimatedTime:"2-10 min",creditsRange:"15-285"},{id:"happyhorse",name:"HappyHorse 1.0",provider:"Alibaba",description:"Text, image, and reference video ⢠3-15s",estimatedTime:"2-10 min",creditsRange:"66-570",isNew:!0},{id:"wan3.0",name:"Wan 3.0",provider:"Alibaba",description:"Multimodal control ⢠Consistent storytelling",estimatedTime:"2-10 min",creditsRange:"12-780",isNew:!0},{id:"wan2.6",name:"Wan 2.6",provider:"Alibaba",description:"Multi-shot storytelling ⢠Smooth transitions",estimatedTime:"2-10 min",creditsRange:"70-310"}],g=["seedance2.5","seedance2-fast","kling3.0"].flatMap(e=>{let t=f.find(t=>
1t.id===e);return t?[{id:e,label:t.name}]:[]});function b(e){let{modelId:t,className:a}=e;return"veo3"===t?(0,s.jsx)(r.q_,{className:a}):"kling2.6"===t||"kling3.0"===t?(0,s.jsx)(r.hx,{className:a}):"seedance2.5"===t||"seedance2"===t||"seedance2-fast"===t?(0,s.jsx)(r.gu,{className:a}):"happyhorse"===t?(0,s.jsx)(r.tB,{className:a}):"wan3.0"===t||"wan2.6"===t?(0,s.jsx)(r.Z$,{className:a}):(0,s.jsx)(r.zs,{className:a})}function v(e){let{value:t,onChange:a,disabled:r}=e,[v,j]=(0,p.useState)(!1),y=(0,m.c3)("Generator.common"),w=(0,m.c3)("Generator.video"),N=f.find(e=>e.id===t);return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(i.J,{className:"text-sm font-medium",children:y("model")}),(0,s.jsxs)(o.AM,{open:v,onOpenChange:j,children:[(0,s.jsx)(o.Wv,{asChild:!0,children:(0,s.jsxs)(l.$,{variant:"outline","aria-haspopup":"listbox","aria-expanded":v,disabled:r,className:(0,h.Ul)({open:v,disabled:r}),children:[(0,s.jsxs)("div",{className:"flex flex-1 min-w-0 items-center gap-3",children:[(0,s.jsx)(b,{modelId:t,className:"w-6 h-6 flex-shrink-0"}),(0,s.jsxs)("div",{className:"flex flex-1 min-w-0 flex-col items-start whitespace-normal",children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-sm text-left",children:(null==N?void 0:N.name)||y("selectModel")}),(null==N?void 0:N.isNew)&&(0,s.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-primary/10 text-primary font-medium",children:w("newBadge")})]}),(0,s.jsx)("span",{className:"w-full whitespace-normal text-left text-xs text-muted-foreground leading-relaxed line-clamp-2 break-words",children:(null==N?void 0:N.description)||y("selectModel")}),N&&(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[10px] text-muted-foreground",children:N.provider}),(0,s.jsxs)("span",{className:"text-[10px] text-muted-foreground px-1.5 py-0.5 rounded bg-muted",children:[(0,s.jsx)("span",{className:"text-xs",children:"â±"})," ",N.estimatedTime]}),(0,s.jsxs)("span",{className:"text-[10px] text-muted-foreground px-1.5 py-0.5 rounded bg-muted",children:[(0,s.jsx)("span",{className:"text-xs",children:"â"})," ",N.creditsRange," ",y("creditUnit",{count:2})]})]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,s.jsx)(d.A,{className:h.TF}),(0,s.jsx)(c.A,{className:(0,h.pk)(v)})]})]})}),(0,s.jsx)(o.hl,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:(0,s.jsx)(n.uB,{children:(0,s.jsxs)(n.oI,{className:"max-h-[400px]",children:[(0,s.jsx)(n.xL,{children:y("noM
1odelFound")}),(0,s.jsx)(n.L$,{children:f.map(e=>{let r=t===e.id;return(0,s.jsxs)(n.h_,{value:e.id,onSelect:()=>{a(e.id),j(!1)},className:(0,h.jy)(r),children:[r&&(0,s.jsx)("span",{className:h.iD}),(0,s.jsx)("div",{className:(0,h.Ks)(r),children:r&&(0,s.jsx)(u.A,{className:"w-3 h-3"})}),(0,s.jsx)(b,{modelId:e.id,className:"w-6 h-6 flex-shrink-0"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-sm",children:e.name}),e.isNew&&(0,s.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-primary/10 text-primary font-medium",children:w("newBadge")})]}),(0,s.jsx)("p",{className:"w-full whitespace-normal text-left text-xs text-muted-foreground leading-relaxed line-clamp-2 break-words",children:e.description}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,s.jsx)("span",{className:"text-[10px] text-muted-foreground",children:e.provider}),(0,s.jsxs)("span",{className:"text-[10px] text-muted-foreground px-1.5 py-0.5 rounded bg-muted",children:[(0,s.jsx)("span",{className:"text-xs",children:"â±"})," ",e.estimatedTime]}),(0,s.jsxs)("span",{className:"text-[10px] text-muted-foreground px-1.5 py-0.5 rounded bg-muted",children:[(0,s.jsx)("span",{className:"text-xs",children:"â"})," ",e.creditsRange," ",y("creditUnit",{count:2})]})]})]})]},e.id)})})]})})})]}),(0,s.jsx)(x.d,{value:t,onChange:a,disabled:r,label:y("model"),options:g})]})}function j(e){return f.find(t=>t.id===e)}},31055:(e,t,a)=>{a.d(t,{Fm:()=>u,Qs:()=>p,cj:()=>i,h:()=>c,qp:()=>m});var s=a(76947);a(98547);var r=a(86708),l=a(77077),n=a(50021);function i(e){let{...t}=e;return(0,s.jsx)(r.bL,{"data-slot":"sheet",...t})}function o(e){let{...t}=e;return(0,s.jsx)(r.ZL,{"data-slot":"sheet-portal",...t})}function d(e){let{className:t,...a}=e;return(0,s.jsx)(r.hJ,{"data-slot":"sheet-overlay",className:(0,n.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function c(e){let{className:t,children:a,side:i="right",...c}=e;return(0,s.jsxs)(o,{children:[(0,s.jsx)(d,{}),(0,s.jsxs)(r.UC,{"data-slot":"sheet-content",className:(0,n.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500","right"===i&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm","left"===i&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm","top"===i&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b","bottom"===i&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...c,children:[a,(0,s.jsxs)(r.bm,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 end-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[(0,s.jsx)(l.A,{className:"size-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function u(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"sheet-header",className:(0,n.cn)("flex flex-col gap-1.5 p-4",t),...a})}function m(e){let{className:t,...a}=e;return(0,s.jsx)(r.hE,{"data-slot":"sheet-title",className:(0,n.cn)("text-foreground font-semibold",t),...a})}function p(e){let{className:t,...a}=e;return(0,s.jsx)(r.VY,{"data-slot":"sheet-description",className:(0,n.cn)("text-muted-foreground text-sm",t),...a})}},32861:(e,t,a)=>{a.d(t,{AudioTagsPanel:()=>f});var s,r=a(76947);let l=[{id:"emotion",i18nKey:"emotion",tags:["excited","happy","sad","angry","surprised","disgusted","fearful","calm","serious","confused"]},{id:"delivery",i18nKey:"delivery",tags:["whispering","shouting","singing","laughing","crying","mumbling","yelling"]},{id:"nonverbal",i18nKey:"nonverbal",tags:["sigh","gasp","laugh","cough","clearing throat","sniff","yawn"]},{id:"soundEffect",i18nKey:"soundEffect",tags:["phone ringing","door knocking","footsteps","rain","wind","thunder","birds chirping"]},{id:"accent",i18nKey:"accent",tags:["British accent","American accent","Australian accent","Indian accent"]},{id:"pacing",i18nKey:"pacing",tags:["slowly","quickly","with a pause","dramatically"]}];var n=a(29511),i=a(15428),o=a(82821),d=a(41303),c=a(50021),u=a(81591),m=a(41625),p=a(94076),x=a(98547);let h=null!=(s=l.find(e=>"emotion"===e.id))?s:l[0];function f(e){let{onInsertTag:t,disabled:a}=e,s=(0,p.c3)("Generator.textToSpeech"),[f,g]=(0,x.useState)(!1);return(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)(i.J,{className:"text-sm font-medium",children:s("audioTags")}),(0,r.jsx)(d.Bc,{children:(0,r.jsxs)(d.m_,{children:[(0,r.jsx)(d.k$,{children:(0,r.jsx)(u.A,{className:"w-3.5 h-3.5 text-muted-foreground"})}),(0,r.jsx)(d.ZI,{className:"max-w-xs",children:(0,r.jsx)("p",{children:s("audioTagsTooltip")})})]})})]}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-1",children:[h.tags.slice(0,5).map(e=>
1(0,r.jsxs)(n.E,{variant:"outline",className:(0,c.cn)("cursor-pointer text-xs hover:bg-accent transition-colors select-none",a&&"opacity-50 cursor-not-allowed"),onClick:()=>{!a&&t(e)},children:["[",e,"]"]},e)),(0,r.jsxs)(o.AM,{open:f,onOpenChange:g,children:[(0,r.jsx)(o.Wv,{asChild:!0,children:(0,r.jsxs)(n.E,{variant:"outline",className:"cursor-pointer text-xs hover:bg-accent transition-colors select-none gap-1",children:[(0,r.jsx)(m.A,{className:"w-3 h-3"}),s("moreTags")]})}),(0,r.jsx)(o.hl,{className:"w-72 p-3",align:"start",children:(0,r.jsx)("div",{className:"space-y-3",children:l.map(e=>(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:s("audioTagCategories.".concat(e.i18nKey))}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1",children:e.tags.map(e=>(0,r.jsxs)(n.E,{variant:"outline",className:(0,c.cn)("cursor-pointer text-xs hover:bg-accent transition-colors select-none",a&&"opacity-50 cursor-not-allowed"),onClick:()=>{!a&&(t(e),g(!1))},children:["[",e,"]"]},e))})]},e.id))})})]})]})]})}},35622:(e,t,a)=>{a.d(t,{useTaskQueue:()=>l});var s=a(98547);function r(e){var t;return"failed"!==e.status&&("submitting"!==e.status||!!("object"==typeof(t=e.meta)&&null!==t&&Object.keys(t).length>0))}function l(e){let{storageKey:t,userId:a,enabled:l=!0,maxConcurrency:n=1,autoMarkSubmitting:i=!0,execute:o,onTaskComplete:d,onTaskFail:c,autoRemoveCompleted:u=!0}=e,[m,p]=(0,s.useState)([]),x=(0,s.useRef)(m),h=(0,s.useRef)(new Set),f=(0,s.useRef)(!1),g=(0,s.useRef)(0),b=(0,s.useRef)(!1),[v,j]=(0,s.useState)(null),y=Number.isFinite(n)?Math.max(1,Math.floor(n)):1,w=(0,s.useMemo)(()=>t?a?"".concat(t,":").concat(a):null:"memory:".concat(null!=a?a:"anonymous"),[t,a]),N=(0,s.useRef)(w);N.current=w,(0,s.useEffect)(()=>{x.current=m},[m]);let C=(0,s.useCallback)(e=>{p(t=>{let a=e(t);return x.current=a,a})},[]),k=(0,s.useCallback)(e=>{b.current=!0,x.current=e,p(e)},[]);(0,s.useEffect)(()=>(f.current=!1,()=>{f.current=!0}),[]);let L=(0,s.useCallback)((e,t)=>{f.current||C(a=>a.map(a=>{var s;if(a.id!==e)return a;let r=t.meta?{...null!=(s=a.meta)?s:{},...t.meta}:a.meta;return{...a,...t,meta:r}}))},[C]),S=(0,s.useCallback)(e=>{if(f.current)return;let t=Date.now(),a=e.map(e=>({id:"undefined"!=typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():"".concat(Date.now(),"-").concat(Math.random().toString(16).slice(2)),payload:e,meta:null,status:"queued",error:null,result:null,createdAt:t,startedAt:null,completedAt:null}));C(e=>[...e,...a])},[C]),A=(0,s.useCallback)(e=>{S([e])},[S]),M=(0,s.useMemo)(()=>m.some(e=>"queued"===e.status||"submitting"===e.status||"generating"===e.status),[m]),D=(0,s.useCallback)(()=>{if(!t||!a)return[];let e=sessionStorage.getItem(t);if(!e)return[];try{let s=JSON.parse(e);if(!(null==s?void 0:s.userId)||s.userId!==a||!Array.isArray(s.tasks))return sessionStorage.removeItem(t),[];let l=s.tasks.filter(r);return l.length!==s.tasks.length&&(0===l.length?sessionStorage.removeItem(t):sessionStorage.setItem(t,JSON.stringify({userId:a,tasks:l}))),l}catch(e){return sessionStorage.removeItem(t),[]}},[t,a]);(0,s.useEffect)(()=>{if(g.current+=1,h.current.clear(),!w){k([]),j(null);return}k(D()),j(w)},[w,D,k]),(0,s.useEffect)(()=>{if(!t||!a||v!==w)return;if(b.current){b.current=!1;return}let e=m.filter(r);if(0===e.length)return void sessionStorage.removeItem(t);sessionStorage.setItem(t,JSON.stringify({userId:a,tasks:e}))},[v,w,t,m,a]);let I=(0,s.useCallback)(e=>{var t;return null!=(t=x.current.find(t=>t.id===e))?t:null},[]),F=(0,s.useMemo)(()=>{var e;return null!=(e=m.find(e=>"submitting"===e.status||"generating"===e.status))?e:null},[m]),T=(0,s.useMemo)(()=>m.filter(e=>"submitting"===e.status||"generating"===e.status),[m]);return(0,s.useEffect)(()=>{if(f.current||!l||!M||!w||v!==w)return;let e=y-h.current.size;if(e<=0)return;let t=g.current,a=()=>f.current||g.current!==t||N.current!==w;for(let t of m.filter(e=>!h.current.has(e.id)&&("queued"===e.status||"submitting"===e.status||"generating"===e.status)).slice(0,e)){h.current.add(t.id),i&&"queued"===t.status&&L(t.id,{status:"submitting",startedAt:Date.now()});let e={updateTask:e=>{a()||L(t.id,e)},setStatus:e=>{a()||L(t.id,{status:e})}
1,setMeta:e=>{a()||L(t.id,{meta:e})},isCancelled:a};o(t,e).then(e=>{var s;if(a())return;let r=null!=(s=I(t.id))?s:t,l=Date.now(),n={...r,status:"completed",result:e,error:null,completedAt:l};null==d||d(n),C(e=>{let a=e.map(e=>e.id===t.id?n:e);return u?a.filter(e=>e.id!==t.id):a})}).catch(e=>{var s;if(a())return;let r=null!=(s=I(t.id))?s:t,l=Date.now(),n={...r,status:"failed",error:e instanceof Error?e.message:"Task failed",completedAt:l};null==c||c(n),C(e=>e.filter(e=>e.id!==t.id))}).finally(()=>{h.current.delete(t.id)})}},[u,i,y,l,o,I,M,v,d,c,w,m,L,C]),{tasks:m,activeTask:F,activeTasks:T,enqueue:A,enqueueMany:S}}},37810:(e,t,a)=>{a.d(t,{PromptStyleControls:()=>p});var s=a(76947),r=a(82821),l=a(50021),n=a(73705),i=a(77077),o=a(9493),d=a(94076),c=a(78799),u=a(98547),m=a(94907);function p(e){var t;let{style:a,color:p,lighting:x,composition:h,onStyleChange:f,onColorChange:g,onLightingChange:b,onCompositionChange:v,disabled:j,columns:y=3,maxHeight:w=320}=e,N=(0,d.c3)("Generator.styles.style"),C=(0,d.c3)("Generator.styles.color"),k=(0,d.c3)("Generator.styles.lighting"),L=(0,d.c3)("Generator.styles.composition"),[S,A]=(0,u.useState)(!1),[M,D]=(0,u.useState)("style"),I=(0,u.useRef)(null),F=(0,u.useMemo)(()=>m.$J.map(e=>({...e,label:N(e.id)})),[N]),T=(0,u.useMemo)(()=>m.Lq.map(e=>({...e,label:C(e.id)})),[C]),z=(0,u.useMemo)(()=>m.wk.map(e=>({...e,label:k(e.id)})),[k]),E=(0,u.useMemo)(()=>m.aZ.map(e=>({...e,label:L(e.id)})),[L]),_=[{id:"style",value:a,noneValue:m.DT,options:F,onChange:e=>f(e)},{id:"color",value:p,noneValue:m.LM,options:T,onChange:e=>g(e)},{id:"lighting",value:x,noneValue:m.wG,options:z,onChange:e=>b(e)},{id:"composition",value:h,noneValue:m.yL,options:E,onChange:e=>v(e)}],R=null!=(t=_.find(e=>e.id===M))?t:_[0],U="style"===R.id;return(0,s.jsx)("div",{className:"relative",children:(0,s.jsxs)(r.AM,{open:S,onOpenChange:A,children:[(0,s.jsx)(r.dT,{asChild:!0,children:(0,s.jsx)("div",{ref:I,className:"grid grid-cols-2 gap-2",children:_.map(e=>{var t,a,r;let o=(t=e.options,a=e.value,null!=(r=t.find(e=>e.id===a))?r:t[0]),d=(null==o?void 0:o.id)===e.noneValue,c=S&&M===e.id;return(0,s.jsx)("div",{className:"min-w-0",children:(0,s.jsxs)("div",{className:(0,l.cn)("inline-flex w-full items-center rounded-full border transition-colors",c?"border-primary bg-primary/5":d?"border-border":"border-primary/30",j&&"opacity-50 cursor-not-allowed"),children:[(0,s.jsxs)("button",{type:"button",onClick:()=>(e=>{if(S&&M===e)return void A(!1);D(e),A(!0)})(e.id),disabled:j,className:(0,l.cn)("inline-flex min-w-0 flex-1 items-center gap-1.5 px-3 py-1 text-sm font-medium transition-colors",d?"text-muted-foreground hover:bg-muted/50":"text-foreground hover:bg-accent/50",j&&"cursor-not-allowed"),"aria-pressed":!d,children:[o.emoji?(0,s.jsx)("span",{className:"text-base leading-none",children:o.emoji}):null,(0,s.jsx)("span",{className:"truncate",children:o.label}),(0,s.jsx)(n.A,{className:(0,l.cn)("ml-auto h-3.5 w-3.5 text-muted-foreground transition-transform duration-200",c&&"rotate-180")})]}),!d&&(0,s.jsx)("button",{type:"button",disabled:j,className:(0,l.cn)("mr-1 inline-flex h-5 w-5 items-center justify-center rounded-full transition-colors",j?"cursor-not-allowed":"hover:bg-muted"),onClick:()=>e.onChange(e.noneValue),"aria-label":"Clear selection",children:(0,s.jsx)(i.A,{className:"h-3 w-3"})})]})},e.id)})})}),(0,s.jsx)(r.hl,{className:"w-[360px] sm:w-[420px] max-w-[calc(100vw-2rem)] p-3",align:"start",sideOffset:8,onInteractOutside:e=>{var t;let a=e.target;a&&(null==(t=I.current)?void 0:t.contains(a))&&e.preventDefault()},children:(0,s.jsx)("div",{className:"grid gap-2 overflow-y-auto pr-1",style:{gridTemplateColumns:"repeat(".concat(y,", minmax(0, 1fr))"),maxHeight:w},children:R.options.map(e=>{let t=e.id===R.value;return(0,s.jsxs)("button",{type:"button",onClick:()=>{R.onChange(e.id),A(!1)},disabled:j,"aria-pressed":t,className:(0,l.cn)("relative flex min-h-[64px] flex-col items-center justify-center gap-1 rounded-lg border-2 px-2 py-3 text-center transition-all",U&&"min-w-0 justify-start gap-0 overflow-hidden p-0",t?"border-primary bg-primary/5":"border-border hover:border-primary/50 hover:bg-accent/50",j&&"opacity-50 cursor-not-allowed"),children:[t&&(0,s.jsx)("span",{className:(0,l.cn)("absolute top-1 right-1",U&&"z-10 rounded-full bg-background/95 p-1 shadow-sm"),children:(0,s.jsx)(o.A,{className:"h-3 w-3 text-primary"})}),U?(0,s.jsx)("span",{className:"relative flex aspect-[4/3] w-full shrink-0 items-center justify-center bg-muted/30",children:e.thumbnail?(0,s.jsx)(c.default,{src:e.thumbnail,alt:"",width:256,height:192,unoptimized:!0,draggable:!1,
1className:(0,l.cn)("h-full w-full object-cover","pixel-art"===e.id&&"[image-rendering:pixelated]")}):(0,s.jsx)("span",{className:"text-2xl leading-none","aria-hidden":"true",children:e.emoji})}):e.emoji?(0,s.jsx)("span",{className:"text-lg leading-none",children:e.emoji}):null,(0,s.jsx)("span",{className:(0,l.cn)("text-xs font-medium leading-tight break-words hyphens-auto text-center",U&&"flex min-h-8 w-full flex-1 items-center justify-center px-1 py-1.5"),children:e.label})]},e.id)})})})]})})}},39680:(e,t,a)=>{a.d(t,{useSequentialQueue:()=>r});var s=a(35622);function r(e){return(0,s.useTaskQueue)({...e,maxConcurrency:1})}},39951:(e,t,a)=>{a.d(t,{KlingElementImageUploader:()=>i});var s=a(76947),r=a(94076),l=a(3468);let n=["image/jpeg","image/png"];function i(e){let{images:t,onImagesChange:a,disabled:i}=e,o=(0,r.c3)("Generator.video");return(0,s.jsx)(l.ImageUploader,{images:t,onImagesChange:a,disabled:i,maxImages:4,label:o("elementImages"),helperText:o("elementImagesHelper"),showStatus:!1,uploadFolder:"video-input",uploadPurpose:"image",allowedMimeTypes:n,accept:n.join(",")})}},45463:(e,t,a)=>{a.d(t,{LanguageSelector:()=>o});var s=a(76947);let r=[{code:"",label:"Auto (Recommended)"},{code:"en",label:"English"},{code:"zh",label:"Chinese"},{code:"ja",label:"Japanese"},{code:"ko",label:"Korean"},{code:"fr",label:"French"},{code:"de",label:"German"},{code:"es",label:"Spanish"},{code:"pt",label:"Portuguese"},{code:"it",label:"Italian"},{code:"nl",label:"Dutch"},{code:"ru",label:"Russian"},{code:"ar",label:"Arabic"},{code:"hi",label:"Hindi"},{code:"bn",label:"Bengali"},{code:"pl",label:"Polish"},{code:"tr",label:"Turkish"},{code:"vi",label:"Vietnamese"},{code:"th",label:"Thai"},{code:"sv",label:"Swedish"},{code:"da",label:"Danish"},{code:"fi",label:"Finnish"},{code:"no",label:"Norwegian"},{code:"cs",label:"Czech"},{code:"sk",label:"Slovak"},{code:"ro",label:"Romanian"},{code:"hu",label:"Hungarian"},{code:"bg",label:"Bulgarian"},{code:"hr",label:"Croatian"},{code:"sr",label:"Serbian"},{code:"bs",label:"Bosnian"},{code:"sl",label:"Slovenian"},{code:"el",label:"Greek"},{code:"uk",label:"Ukrainian"},{code:"he",label:"Hebrew"},{code:"fa",label:"Persian"},{code:"ur",label:"Urdu"},{code:"af",label:"Afrikaans"},{code:"sw",label:"Swahili"},{code:"id",label:"Indonesian"},{code:"ms",label:"Malay"},{code:"fil",label:"Filipino"},{code:"ta",label:"Tamil"},{code:"te",label:"Telugu"},{code:"ml",label:"Malayalam"},{code:"kn",label:"Kannada"},{code:"gu",label:"Gujarati"},{code:"mr",label:"Marathi"},{code:"pa",label:"Punjabi"},{code:"ne",label:"Nepali"},{code:"ka",label:"Georgian"},{code:"hy",label:"Armenian"},{code:"az",label:"Azerbaijani"},{code:"kk",label:"Kazakh"},{code:"ky",label:"Kyrgyz"},{code:"lv",label:"Latvian"},{code:"lt",label:"Lithuanian"},{code:"et",label:"Estonian"},{code:"is",label:"Icelandic"},{code:"ga",label:"Irish"},{code:"cy",label:"Welsh"},{code:"lb",label:"Luxembourgish"},{code:"mk",label:"Macedonian"},{code:"ca",label:"Catalan"},{code:"gl",label:"Galician"},{code:"as",label:"Assamese"},{code:"be",label:"Belarusian"},{code:"ceb",label:"Cebuano"},{code:"ny",label:"Chichewa"},{code:"ha",label:"Hausa"},{code:"jv",label:"Javanese"},{code:"ln",label:"Lingala"},{code:"ps",label:"Pashto"},{code:"sd",label:"Sindhi"},{code:"so",label:"Somali"}];var l=a(15428),n=a(13850),i=a(94076);function o(e){let{value:t,onChange:a,disabled:o}=e,d=(0,i.c3)("Generator.textToSpeech");return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(l.J,{className:"text-sm font-medium",children:d("language")}),(0,s.jsxs)(n.l6,{value:t||"_auto",onValueChange:e=>a("_auto"===e?"":e),disabled:o,children:[(0,s.jsx)(n.bq,{className:"w-full",children:(0,s.jsx)(n.yv,{placeholder:d("selectLanguage")})}),(0,s.jsx)(n.gC,{className:"max-h-[280px]",children:r.map(e=>(0,s.jsx)(n.eb,{value:e.code||"_auto",children:e.label},e.code||"_auto"))})]})]})}},47644:(e,t,a)=>{a.d(t,{ReferenceLinkInput:()=>p});var s=a(76947),r=a(23894),l=a(78110),n=a(15428),i=a(73287),o=a(82643),d=a(94076),c=a(98547),u=a(23941),m=a(88125);function p(e){let{urls:t,onUrlsChange:a,label:p,helperText:x,placeholder:h,addLabel:f,invali
1dUrlMessage:g,maxUrls:b=1,disabled:v}=e,j=(0,d.c3)("Generator.upload"),y=(0,c.useId)(),[w,N]=(0,c.useState)(""),C=t.length<b,k=()=>{if(!C||v)return;let e=function(e){let t=e.trim();if(!t)return null;let a=/^[a-z][a-z\d+.-]*:\/\//i.test(t)?t:"https://".concat(t);try{let e=new URL(a);if("http:"!==e.protocol&&"https:"!==e.protocol||!e.hostname)return null;return e.toString()}catch(e){return null}}(w);if(!e)return void u.o.error(g);a([...t,e]),N("")};return(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)(n.J,{htmlFor:y,className:"text-sm font-medium",children:p}),x&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:x})]}),C&&(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.p,{id:y,type:"text",inputMode:"url",value:w,onChange:e=>N(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),k())},placeholder:h,disabled:v,"aria-label":p}),(0,s.jsxs)(r.$,{type:"button",variant:"outline",onClick:k,disabled:v||!w.trim(),className:"shrink-0 gap-1.5",children:[(0,s.jsx)(i.A,{className:"h-4 w-4"}),f]})]}),t.length>0&&(0,s.jsxs)("div",{className:"space-y-2",children:[t.map((e,r)=>(0,s.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border bg-muted/40 p-3",children:[(0,s.jsx)(o.A,{className:"h-4 w-4 shrink-0 text-primary"}),(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm",title:e,children:e}),(0,s.jsx)(m.L,{onClick:()=>a(t.filter((e,t)=>t!==r)),disabled:v,ariaLabel:j("remove")})]},"".concat(e,"-").concat(r))),b>1&&(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:[t.length,"/",b]})]})]})}},53076:(e,t,a)=>{a.d(t,{$D:()=>l,RI:()=>i,Z5:()=>n,dV:()=>o,sE:()=>d,sb:()=>s.sb});var s=a(19165);let r={docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",doc:"application/msword",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xls:"application/vnd.ms-excel",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",ppt:"application/vnd.ms-powerpoint",pdf:"application/pdf",txt:"text/plain",key:"application/x-iwork-keynote-sffkey",pages:"application/x-iwork-pages-sffpages",numbers:"application/x-iwork-numbers-sffnumbers",md:"text/markdown"};Object.fromEntries(Object.entries(r).map(e=>{let[t,a]=e;return[a,t]}));let l=Object.values(r),n=Object.keys(r).map(e=>".".concat(e)).join(","),i="DOCX, DOC, XLSX, XLS, PPTX, PPT, PDF, TXT, KEY, PAGES, NUMBERS, MD",o="DOCX, XLSX, PPTX, PDF, TXT";function d(e){var t;let a=e.trim().toLowerCase().split(".").pop();return a&&null!=(t=r[a])?t:null}},54328:(e,t,a)=>{a.d(t,{T:()=>l});var s=a(76947);a(98547);var r=a(50021);function l(e){let{className:t,...a}=e;return(0,s.jsx)("textarea",{"data-slot":"textarea",className:(0,r.cn)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...a})}},56513:(e,t,a)=>{a.d(t,{AudioUploader:()=>y});var s=a(76947),r=a(50243),l=a(23894),n=a(15428),i=a(39188),o=a(1777),d=a(840),c=a(19165),u=a(50021),m=a(11097),p=a(77077),x=a(79627),h=a(15266),f=a(8901),g=a(94076),b=a(98547),v=a(23941);let j=["audio/mpeg","audio/wav","audio/x-wav","audio/aac","audio/mp4","audio/ogg"];function y(e){let{audioUrl:t,onAudioChange:a,disabled:y,maxSizeBytes:w=c.Z,allowedMimeTypes:N=j,accept:C,formatHint:k,helperText:L,label:S,hideLabel:A=!1,maxDurationSeconds:M=15,minDurationSeconds:D,durationLimitLabel:I,uploadPurpose:F="ai-avatar"}=e,T=(0,g.c3)("Generator.upload"),z=(0,o.w)(),E=(0,i.z)({includeSearch:!0}),[_,R]=(0,b.useState)(!1),[U,G]=(0,b.useState)(!1),[B,P]=(0,b.useState)(!1),H=null!=I?I:"".concat(M,"s"),O=(0,b.useCallback)(async e=>{let t;if(y||!e||0===e.length)return;let s=e[0];if(!new Set(N).has(s.type))return void v.o.error(T("invalidFileType"),{description:T("pleaseUploadSupportedAudio")});if(s.size>w)return void v.o.error(T("fileTooLarge"),{description:T("pleaseUploadAudioSmaller",{size:Math.round(w/1048576)})});if(!(null==z?void 0:z.user))return void G(!0);try{t=await (0,d.c)(s)}catch(e){console.error("[AudioUploader] Failed to read duration:",e),v.o.error(T("audioDurationUnreadable"));return}if(t>M)return void v.o.error(T("audioDurationTooLong",{duration:H,seconds:M}));if(D&&t<D)return void v.o.error(T("audioDurationTooShort",{seconds:D}));P(!0);try{let e=await (0,m.Q)(s,F,{purpose:F,allowFallback:!1});a(e.url,t)}catch(e){console.error("[AudioUploader] Upload error:",e),v.o.error(T("uploadFailed"),{description:e instanceof Error?e.message:T("pleaseRetry")})}finally{P(!1)}}
1,[N,y,H,M,w,D,a,null==z?void 0:z.user,T,F]),K=(0,b.useCallback)(e=>{e.preventDefault(),y||(R(!1),O(e.dataTransfer.files))},[y,O]);return(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:(0,u.cn)("flex items-center justify-between",A&&!t&&"hidden"),children:[A?(0,s.jsx)("span",{}):(0,s.jsx)(n.J,{className:"text-sm font-medium",children:S||T("inputAudio")}),t&&(0,s.jsx)(l.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>a(null,null),disabled:y,className:"h-6 px-2 text-xs text-muted-foreground hover:text-destructive",children:T("remove")})]}),t?(0,s.jsxs)("div",{className:"relative overflow-hidden rounded-xl border border-border bg-muted p-3",children:[(0,s.jsx)("audio",{src:t,controls:!0,className:"w-full"}),(0,s.jsx)(l.$,{type:"button",variant:"destructive",size:"icon",className:"absolute top-2 right-2 h-7 w-7",onClick:()=>a(null,null),disabled:y,children:(0,s.jsx)(p.A,{className:"h-4 w-4"})})]}):(0,s.jsxs)("label",{className:(0,u.cn)("flex flex-col items-center justify-center w-full min-h-[140px] border-2 border-dashed rounded-xl cursor-pointer transition-all",_?"border-primary bg-primary/5":"border-border hover:border-primary/50 hover:bg-accent/30",(y||B)&&"opacity-50 cursor-not-allowed"),onDrop:K,onDragOver:e=>{e.preventDefault(),y||R(!0)},onDragLeave:e=>{e.preventDefault(),y||R(!1)},children:[(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-4",children:[(0,s.jsx)("div",{className:"w-10 h-10 mb-3 bg-gradient-to-r from-blue-500/10 to-purple-500/10 rounded-full flex items-center justify-center",children:B?(0,s.jsx)(x.A,{className:"w-5 h-5 text-blue-500 animate-spin"}):(0,s.jsx)(h.A,{className:"w-5 h-5 text-blue-500"})}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground mb-1",children:B?(0,s.jsx)("span",{className:"font-medium text-primary",children:T("uploading")}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"font-medium text-primary",children:T("clickToUpload")})," ",T("orDragAndDrop")]})}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:k||T("audioFormatHint",{size:Math.round(w/1048576),duration:H,seconds:M})})]}),(0,s.jsx)("input",{type:"file",className:"hidden",accept:C||N.join(","),onChange:e=>O(e.target.files),disabled:y||B})]}),!t&&""!==L&&(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,s.jsx)(f.A,{className:"w-3.5 h-3.5"}),(0,s.jsx)("span",{children:L||T("audioHelperText")})]}),(0,s.jsx)(r.n,{mode:"modal",open:U,onOpenChange:G,callbackUrl:E})]})}},56864:(e,t,a)=>{a.d(t,{VoiceSelector:()=>f});var s=a(76947),r=a(66632),l=a(23894),n=a(9713),i=a(82821),o=a(50021),d=a(9493),c=a(72799),u=a(1353),m=a(25828),p=a(73705),x=a(94076),h=a(98547);function f(e){let{value:t,onChange:a,disabled:f,compact:g}=e,b=(0,x.c3)("Generator.textToSpeech"),[v,j]=(0,h.useState)(!1),[y,w]=(0,h.useState)(null),N=(0,h.useRef)(null),C=(0,h.useMemo)(()=>r.SQ.find(e=>e.value===t),[t]),k=(0,h.useMemo)(()=>C?C.description?"".concat(C.label," \xb7 ").concat(C.description):C.label:"",[C]),L=(0,h.useCallback)((e,t)=>{e.stopPropagation(),e.preventDefault();let a=(0,r.Sz)(t);if(!a)return;if(y===t){var s;null==(s=N.current)||s.pause(),w(null);return}N.current&&N.current.pause();let l=new Audio(a);N.current=l,w(t);let n=()=>{N.current===l&&w(null)};l.onended=n,l.onerror=n,l.play().catch(n)},[y]);return(0,h.useEffect)(()=>{if(!v&&y){var e;null==(e=N.current)||e.pause(),N.current=null,w(null)}},[v,y]),(0,h.useEffect)(()=>()=>{var e;null==(e=N.current)||e.pause(),N.current=null},[]),(0,s.jsxs)(i.AM,{open:v,onOpenChange:j,children:[(0,s.jsx)(i.Wv,{asChild:!0,children:(0,s.jsxs)(l.$,{variant:"outline","aria-haspopup":"listbox","aria-expanded":v,disabled:f,className:(0,o.cn)("w-full justify-between transition-colors",g?"h-8 px-2 text-xs":"h-9 px-3 text-sm",!t&&"text-muted-foreground"),children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0 truncate",children:[(0,s.jsx)(m.A,{className:(0,o.cn)("flex-shrink-0",g?"w-3 h-3":"w-3.5 h-3.5")}),(0,s.jsx)("span",{className:"truncate",children:k||b("selectVoice")})]}),(0,s.jsx)(p.A,{className:(0,o.cn)("text-muted-foreground transition-transform duration-200 flex-shrink-0 ml-1",g?"h-3 w-3":"h-3.5 w-3.5",v&&"rotate-180")}
1)]})}),(0,s.jsx)(i.hl,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:(0,s.jsxs)(n.uB,{children:[(0,s.jsx)(n.G7,{placeholder:b("searchVoice")}),(0,s.jsxs)(n.oI,{className:"max-h-[280px]",children:[(0,s.jsx)(n.xL,{children:b("noVoiceFound")}),r.im.map(e=>(0,s.jsx)(n.L$,{heading:e.label,children:e.voiceIds.map(l=>(function(e,l){let i=(0,r.Gl)(e);if(!i)return null;let m=t===i.value,p=y===i.value;return(0,s.jsxs)(n.h_,{value:"".concat(i.label," ").concat(i.description||""),onSelect:()=>{a(i.value),j(!1)},className:"flex items-center gap-2 py-2 px-2 cursor-pointer",children:[(0,s.jsx)("div",{className:(0,o.cn)("w-4 h-4 rounded-full border-2 flex items-center justify-center flex-shrink-0",m?"border-primary bg-primary text-primary-foreground":"border-muted-foreground/30"),children:m&&(0,s.jsx)(d.A,{className:"w-2.5 h-2.5"})}),(0,s.jsx)("div",{className:"flex-1 min-w-0",children:(0,s.jsxs)("div",{className:"flex flex-wrap items-baseline gap-x-1",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:i.label}),i.description&&(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:i.description})]})}),(0,s.jsx)("button",{type:"button",className:"flex-shrink-0 p-1 rounded hover:bg-accent",onClick:e=>L(e,i.value),tabIndex:-1,children:p?(0,s.jsx)(c.A,{className:"w-3 h-3"}):(0,s.jsx)(u.A,{className:"w-3 h-3"})})]},"".concat(l,"-").concat(i.value))})(l,e.id))},e.id))]})]})})]})}},58764:(e,t,a)=>{a.d(t,{AvatarCharacterPicker:()=>d});var s=a(76947),r=a(12504);let l=[{slug:"elon-musk",name:"Elon Musk",voiceId:"cme76jn8k00018t6scj4fgmbh"},{slug:"donald-trump",name:"Donald Trump",voiceId:"cme74f5ia00078tp63k96ksk8"},{slug:"joe-biden",name:"Joe Biden",voiceId:"cme77gxc6000v8tom7fqx4uzv"},{slug:"barack-obama",name:"Barack Obama",voiceId:"cme77h8lt001n8tomveye4mps"},{slug:"morgan-freeman",name:"Morgan Freeman",voiceId:"3ad4d432023c47ee9e6c7805b973630a"},{slug:"taylor-swift",name:"Taylor Swift",voiceId:"cmdwrfmlz047bri6q5h5t8s4u"}].map(e=>({...e,imageUrl:(0,r.L)("/images/avatar-characters/".concat(e.slug,".jpg")),thumbnailUrl:(0,r.L)("/images/avatar-characters/".concat(e.slug,"-thumb.webp"))}));var n=a(50021),i=a(94076),o=a(78799);function d(e){let{selectedImageUrl:t,onSelect:a,disabled:r}=e,d=(0,i.c3)("Generator.aiAvatar");return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:d("tryACharacter")}),(0,s.jsx)("div",{className:"flex gap-2 overflow-x-auto pb-1",children:l.map(e=>{let l=t===e.imageUrl;return(0,s.jsxs)("button",{type:"button",disabled:r,onClick:()=>a(e),title:e.name,"aria-pressed":l,className:(0,n.cn)("group flex w-16 shrink-0 flex-col items-center gap-1",r&&"cursor-not-allowed opacity-50"),children:[(0,s.jsx)("span",{className:(0,n.cn)("relative h-16 w-16 overflow-hidden rounded-full border-2 transition-colors",l?"border-primary":"border-transparent group-hover:border-primary/50"),children:(0,s.jsx)(o.default,{src:e.thumbnailUrl,alt:e.name,fill:!0,sizes:"64px",className:"object-cover object-top"})}),(0,s.jsx)("span",{className:"w-full truncate text-center text-[10px] text-muted-foreground",children:e.name})]},e.slug)})})]})}},63185:(e,t,a)=>{a.d(t,{Z$:()=>p,eI:()=>u,g9:()=>m,gu:()=>c,hx:()=>o,ky:()=>x,q_:()=>n,tB:()=>d,xZ:()=>i,zs:()=>l});var s=a(76947),r=a(98547);function l(e){return(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",focusable:"false",...e,children:(0,s.jsx)("path",{d:"M22.282 9.821a5.985 5.985 0 0 0-.516-4.91 6.046 6.046 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a5.985 5.985 0 0 0-3.998 2.9 6.046 6.046 0 0 0 .743 7.097 5.98 5.98 0 0 0 .51 4.911 6.051 6.051 0 0 0 6.515 2.9A5.985 5.985 0 0 0 13.26 24a6.056 6.056 0 0 0 5.772-4.206 5.99 5.99 0 0 0 3.997-2.9 6.056 6.056 0 0 0-.747-7.073zM13.26 22.43a4.476 4.476 0 0 1-2.876-1.04l.141-.081 4.779-2.758a.795.795 0 0 0 .392-.681v-6.737l2.02 1.168a.071.071 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494zM3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085 4.783 2.759a.771.771 0 0 0 .78 0l5.843-3.369v2.332a.08.08 0 0 1-.033.062L9.74 19.95a4.5 4.5 0 0 1-6.14-1.646zM2.34 7.896a4.485 4.485 0 0 1 2.366-1.973V11.6a.766.766 0 0 0 .388.676l5.815 3.355-2.02 1.168a.076.076 0 0 1-.071 0l-4.83-2.786A4.504 4.504 0 0 1 2.34 7.896zm16.597 3.855-5.833-3.387L15.119 7.2a.076.076 0 0 1 .071 0l4.83 2.791a4.494 4.494 0 0 1-.676 8.105v-5.678a.79.79 0 0 0-.407-.667zm2.01-3.023-.141-.085-4.774-2.782a.776.776 0 0 0-.785 0L9.409 9.23V6.897a.066.066 0 0 1 .028-.061l4.83-2.787a4.5 4.5 0 0 1 6.68 4.66zm-12.64 4.135-2.02-1.164a.08.08 0 0 1-.038-.057V6.075a4.5 4.5 0 0 1 7.375-3.453l-.142.08-4.778 2.758a.795.795 0 0 0-.393.681zm1.097-2.365 2.602-1.5 2.607 1.5v2.999l-2.597 1.5-2.607-1.5z"})})}function n(e){return(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",...e,children:[(0,s.jsx)("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),(0,s.jsx)("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),(0,s.jsx)("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),(0,s.jsx)("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]})}function i(e){let t=(0,r.useId)().replace(/:/g,""),a="gemini-gradient-".concat(t);return(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",...e,children:[(0,s.jsx)("defs",{children:(0,s.jsxs)("linearGradient",{id:a,x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:"#4285F4"}),(0,s.jsx)("stop",{offset:"50%",stopColor:"#9B72CB"}),(0,s.jsx)("stop",{offset:"100%",stopColor:"#D96570"})]})}
1),(0,s.jsx)("path",{d:"M12 2L14.4 9.6L22 12L14.4 14.4L12 22L9.6 14.4L2 12L9.6 9.6L12 2Z",fill:"url(#".concat(a,")")}),(0,s.jsx)("path",{d:"M12 6L13.2 10.8L18 12L13.2 13.2L12 18L10.8 13.2L6 12L10.8 10.8L12 6Z",fill:"white",fillOpacity:"0.4"})]})}function o(e){let t=(0,r.useId)().replace(/:/g,""),a="kling-gradient-".concat(t);return(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 22",fill:"none","aria-hidden":"true",focusable:"false",...e,children:[(0,s.jsx)("defs",{children:(0,s.jsxs)("linearGradient",{id:a,x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:"#3B82F6"}),(0,s.jsx)("stop",{offset:"40%",stopColor:"#06B6D4"}),(0,s.jsx)("stop",{offset:"70%",stopColor:"#10B981"}),(0,s.jsx)("stop",{offset:"100%",stopColor:"#FBBF24"})]})}),(0,s.jsx)("path",{d:"M9.39506 1.02694C9.8995 0.999483 10.19 0.995013 10.6302 1.00459C12.8646 1.10548 16.0591 2.41702 17.4155 4.23492C18.7739 6.05473 17.3416 9.25569 16.207 10.9088L20 14.6628C17.4162 20.0622 10.6516 22.7134 5.13843 19.7991C4.28775 19.3496 2.81657 18.3318 2.3627 17.4979C1.32205 15.5842 2.72126 12.7797 3.75024 11.1081L0 7.43843V7.24751C0.560851 5.67417 1.83816 4.26876 3.18161 3.25031C4.91733 1.93429 7.02004 1.20764 9.39506 1.02694ZM14.5763 3.23753C14.3053 3.19411 14.0971 2.99362 13.8631 2.88762C9.86903 1.07483 5.09693 2.36275 2.33418 5.62564C2.1442 5.84977 1.25008 7.0004 1.30519 7.20154L4.50302 10.3655C6.68547 7.55528 9.84439 4.57526 13.3774 3.55425C13.7418 3.44889 14.1043 3.42399 14.4492 3.33331C14.5095 3.31735 14.5951 3.31735 14.5763 3.23753ZM15.484 10.4299C16.9734 8.52393 18.6922 3.65322 14.4875 4.00888C13.1116 4.12509 11.6916 4.91304 10.5265 5.5918C10.437 5.72142 10.6367 5.62436 10.6802 5.61543C14.0537 4.91432 16.205 7.15875 15.484 10.4299ZM11.6482 6.1205C8.63256 6.26928 5.53459 9.17524 5.071 12.0703C4.58406 15.1104 6.88063 16.5062 9.70369 15.6678C12.4107 14.8639 15.176 11.7638 14.9569 8.87832C14.8207 7.08468 13.4364 6.03239 11.6482 6.1205ZM9.39376 16.4143C7.73196 16.7667 6.00337 16.4934 4.98671 15.0465C4.2871 14.0511 4.31045 13.0013 4.46152 11.8539C4.46735 11.8073 4.51663 11.578 4.40511 11.6706C3.43578 13.0696 1.75452 16.7067 3.82092 17.7833C5.40491 18.6083 8.05421 17.3574 9.39376 16.4143ZM5.37703 18.706C6.08247 19.2008 7.04921 19.5629 7.90313 19.7557C12.1377 20.7109 16.6719 18.5578 18.7045 14.8531L15.4529 11.7032C14.101 13.5089 12.4425 15.1647 10.5797 16.4653C9.0767 17.5151 7.23595 18.531 5.37703 18.706Z",fill:"url(#".concat(a,")")})]})}function d(e){return(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",focusable:"false",...e,children:[(0,s.jsx)("path",{d:"M23.4667 0H8.53333C3.8205 0 0 3.8205 0 8.53333V23.4667C0 28.1795 3.8205 32 8.53333 32H23.4667C28.1795 32 32 28.1795 32 23.4667V8.53333C32 3.8205 28.1795 0 23.4667 0Z",fill:"black"}),(0,s.jsx)("path",{d:"M10.2184 5C10.7149 5.05185 11.009 5.15936 11.4701 5.34801C11.5656 5.32605 11.6616 5.30648 11.758 5.28935C12.9122 5.07858 14.1028 5.33833 15.0643 6.01072C15.7104 6.46129 16.2241 7.07687 16.5515 7.79336C16.8808 8.51947 17.0383 9.78439 17.1837 10.6093L17.8128 14.1766C18.5934 14.3699 19.4303 14.4352 20.2011 14.6718C20.403 14.7338 20.6197 14.8579 20.8003 14.9648C20.845 14.8851 20.9224 14.7693 20.9772 14.6973C21.3448 14.2126 21.8916 13.8956 22.495 13.8173C23.0987 13.7375 23.7095 13.9011 24.1924 14.2721C24.6351 14.61 24.9385 15.0985 25.0454 15.6451C25.0796 15.8225 25.0888 16.0282 25.1139 16.2097C25.2243 17.0045 25.6035 17.6054 26.2311 18.0881C25.831 18.3863 25.4291 18.5535 24.9192 18.5168C24.1903 18.4696 23.5563 18.0008 23.2973 17.3178C23.129 16.8753 23.14 16.5132 22.7675 16.112C22.3633 15.6767 21.9787 15.553 21.4089 15.517C21.6474 15.8536 21.8004 16.1018 21.9128 16.5095C22.1103 17.2226 22.0063 17.9855 21.6254 18.62C21.4806 18.8596 21.3082 19.056 21.1641 19.3121C20.8266 19.9095 20.7124 20.6073 20.8418 21.281C20.8934 21.5481 20.9859 21.8142 21.0632 22.0759C21.1933 22.5166 21.3376 22.9563 21.4601 23.399C20.7175 23.7648 19.7174 24.0692 18.9152 24.255C18.7764 23.8821 18.5194 23.3511 18.3528 22.9775C18.0408 22.2785 17.7288 21.5621 17.4081 20.8681C17.9712 20.7588 18.1935 20.6471 18.6421 20.2977C17.8563 20.4561 17.4177 20.293 16.6984 20.0378L15.7021 19.6811C15.0922 19.4776 14.4753 19.2272 13.8642 19.0323C13.0581 19.5502 12.2148 20.0823 11.4206 20.6138L11.7914 21.9274C11.9943 22.6482 12.2518 23.2296 11.5398 23.776C11.2148 23.6657 10.6701 23.4487 10.3705 23.2837C10.0695 22.3505 9.79594 21.4063 9.49862 20.4716C9.41861 20.2201 9.33284 19.9725 9.38564 19.7055C9.41991 19.5361 9.49715 19.3784 9.60996 19.2474C9.77336 19.0616 10.977 18.2702 11.2479 18.0943C10.4438 17.7888 9.58682 17.5026 8.77245 17.2074C8.61148 17.7486 8.46488 18.6855 8.23655 19.1602C8.13163 19.3771 7.98322 19.57 7.80057 19.7269C7.37094 20.0951 6.94387 20.1609 6.40135 20.1218C6.69797 18.7229 7.13223 17.2973 7.46673 15.9031C7.56565 15.4907 8.09149 15.0863 8.52011 15.1707C9.08798 15.2826 9.74825 15.4976 10.2979 15.6983C10.6357 14.6586 11.0097 13.5998 11.3617 12.5623L11.7785 11.3348C11.851 11.1214 11.9251 10.9021 12.0017 10.6898C12.0545 10.5435 12.2478 10.4164 12.3575 10.2894C12.7542 9.83005 12.9218 9.40704 13.0486 8.8315C13.0149 8.89877 12.98 8.9655 12.9441 9.03162C12.6186 9.62663 12.3797 9.78538 11.7748 10.037C10.9606 10.3756 10.1566 10.7675 9.33286 11.0831C9.13631 11.
11584 8.79969 11.0723 8.62928 10.9661C8.41294 10.8317 8.26146 10.6142 8.21039 10.3647C8.18209 10.2219 8.1869 9.97057 8.2546 9.84627C8.4492 9.489 8.73764 9.09579 8.9694 8.75519L10.5293 6.46423C10.4253 5.98908 10.3039 5.47537 10.2184 5Z",fill:"white"}),(0,s.jsx)("path",{d:"M7.73985 22.2384C8.12723 22.2639 8.48958 22.5923 8.81626 22.8023C9.22332 23.0654 9.64606 23.3035 10.0821 23.515C12.0497 24.4845 14.2246 24.9577 16.4171 24.8931C17.8887 24.8542 19.3438 24.5733 20.724 24.0615C21.5332 23.7612 22.3116 23.3831 23.0479 22.9324C23.3794 22.7306 23.6907 22.4983 24.0215 22.303C24.1062 22.2531 24.3125 22.2364 24.4162 22.2472C24.6126 22.2693 24.792 22.3687 24.9151 22.5234C25.0426 22.6806 25.1018 22.8824 25.0795 23.0834C25.0346 23.4961 24.4863 23.8644 24.1667 24.1278C22.3996 25.5553 20.2876 26.4924 18.0436 26.8445C14.6248 27.3788 11.1345 26.5241 8.3494 24.4707C7.95172 24.1782 7.41179 23.7637 7.09818 23.3824C6.85844 23.0912 7.0336 22.4756 7.38455 22.3323C7.53793 22.2697 7.57027 22.2559 7.73985 22.2384Z",fill:"white"})]})}function c(e){let t=(0,r.useId)().replace(/:/g,""),a="seedream-gradient-".concat(t);return(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 22",fill:"none","aria-hidden":"true",focusable:"false",...e,children:[(0,s.jsx)("defs",{children:(0,s.jsxs)("linearGradient",{id:a,x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:"#60A5FA"}),(0,s.jsx)("stop",{offset:"50%",stopColor:"#38BDF8"}),(0,s.jsx)("stop",{offset:"100%",stopColor:"#22D3EE"})]})}),(0,s.jsx)("path",{d:"M3.06993 17.2011L0 17.9902V4.00708L3.06993 4.79626V17.2011Z",fill:"url(#".concat(a,")")}),(0,s.jsx)("path",{d:"M17.9 18.0207L14.8242 18.8099V3.18994L17.9 3.97328V18.0207Z",fill:"url(#".concat(a,")")}),(0,s.jsx)("path",{d:"M7.94299 17.6287L4.87305 18.4179V10.1812L7.94299 10.9703V17.6287Z",fill:"url(#".concat(a,")")}),(0,s.jsx)("path",{d:"M9.94434 8.95913L13.0201 8.16992V16.4066L9.94434 15.6174V8.95913Z",fill:"url(#".concat(a,")")})]})}function u(e){let t=(0,r.useId)().replace(/:/g,""),a="flux-clip-".concat(t);return(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 22 22",fill:"none","aria-hidden":"true",focusable:"false",...e,children:[(0,s.jsxs)("g",{clipPath:"url(#".concat(a,")"),children:[(0,s.jsx)("path",{d:"M17.9592 19H16.0335L11.0391 11.3298H12.9648L17.9592 19Z",fill:"currentColor"}),(0,s.jsx)("path",{d:"M0 18.9589L10.5553 3L21.09 19H19.1127C19.0822 18.9271 19.0334 18.8491 18.9897 18.7831C16.1706 14.5237 13.3795 10.2456 10.5553 5.9896L3.06867 17.3299H13.7167L14.7628 18.9321L14.7875 19H0V18.9589Z",fill:"currentColor"}),(0,s.jsx)("path",{d:"M17.3733 11.0823C17.368 11.081 17.3331 11.0519 17.3525 11.0414L19.237 8.25757L21.0821 11.0404C21.1002 11.053 21.0627 11.0825 21.06 11.0825H17.3733V11.0823Z",fill:"currentColor"}),(0,s.jsx)("path",{d:"M7.08496 15.5155L8.92822 12.7729L10.7305 15.5155H7.08496Z",fill:"currentColor"})]}),(0,s.jsx)("defs",{children:(0,s.jsx)("clipPath",{id:a,children:(0,s.jsx)("rect",{width:"21.09",height:"22",fill:"white"})})})]})}function m(e){return(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 28 28",fill:"none","aria-hidden":"true",focusable:"false",...e,children:[(0,s.jsx)("rect",{x:"2.34979",y:"8.19965",width:"8.27497",height:"24.703",rx:"4.13748",transform:"rotate(-45 2.34979 8.19965)",fill:"black",stroke:"#34E0A1",strokeWidth:"3.30999"}),(0,s.jsx)("rect",{x:"4.06402",y:"12.3399",width:"8.27497",height:"19.8599",rx:"4.13748",transform:"rotate(-90 4.06402 12.3399)",fill:"black",stroke:"#34E0A1",strokeWidth:"3.30999"}),(0,s.jsx)("rect",{x:"4.06402",y:"4.06491",width:"8.27497",height:"19.8599",rx:"4.13748",fill:"black",stroke:"#34E0A1",strokeWidth:"3.30999"})]})}function p(e){let t=(0,r.useId)().replace(/:/g,""),a="zimage-paint0-".concat(t),l="zimage-paint1-".concat(t),n="zimage-paint2-".concat(t),i="zimage-paint3-".concat(t),o="zimage-paint4-".concat(t),d="zimage-paint5-".concat(t);return(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",focusable:"false",...e,children:[(0,s.jsx)("path",{d:"M11.6443 0.753845L13.8229 4.52806L11.6443 8.29908H29.0703L26.8917 12.0717H9.90298L7.50568 7.922L11.6443 0.753845Z",fill:"white"}),(0,s.jsx)("path",{d:"M2.93243 8.29797H7.28815L15.7809 23.0114L13.3868 27.1627L5.11108 27.1611L7.28973 23.3869L11.6455 23.3885L2.93243 8.29797Z",fill:"white"}),(0,s.jsx)("path",{d:"M13.8218 27.1617L16.0004 30.9343L24.7134 15.8438L26.8905 19.6165H31.2478L27.1108 12.4483L22.3193 12.4499L13.8218 27.1617Z",fill:"white"}),(0,s.jsx)("path",{d:"M11.6443 0.753845L13.8229 4.52806L11.6443 8.29908H29.0703L26.8917 12.0717H9.90298L7.50568 7.922L11.6443 0.753845Z",fill:"url(#".concat(a,")")}),(0,s.jsx)("path",{d:"M5.1095 27.1627L7.28815 23.3885L11.6439 23.3901L2.93243 8.29797H7.28656L15.7809 23.0114L13.3868 27.1627H5.1095Z",fill:"url(#".concat(l,")")}),(0,s.jsx)("path",{d:"M31.2496 19.6165H26.8923L24.7136 15.8438L16.0022 30.9343L13.8235 27.1633L22.3195 12.4499L27.1109 12.4483L31.2496 19.6165Z",fill:"url(#".concat(n,")")}),(0,s.jsx)("path",{d:"M31.9002 19.2387L28.1989 12.8263L27.7631 12.0705L29.7231 8.67659C29.7897 8.56088 29.8245 8.42937 29.8245 8.29946C29.8245 8.16955 29.7912 8.03804 29.7231 7.92237L27.5445 4.14973C27.4779 4.03406 27.3813 3.939 27.2687 3.87403C27.1563 3.80907 27.0263 3.77263 26.8917 3.77263H18.6143L16.6544 0.377104C16.5197 0.144187 16.2709 0 16.0016 0H11.6459C11.5112 0 11.3813 0.0364428 11.2687 0.101406C11.1563 0.16637 11.0596 0.261438 10.9915 0.377104L7.28857 6.79107L6.85285 7.54369H2.93285C2.79817 7.54369 2.66825 7.58013 2.55575 7.64506C2.44325 7.71004 2.3466 7.80511 2.27847 7.92077L0.101406 11.6918C0.0348584 11.8075 0 11.939 0 12.0689C0 12.1989 0.0332739 12.3304 0.101406 12.446L4.24005 19.6142L2.28006 23.0097C2.21351 23.127 2.17865 23.2569 2.17865 23.3868C2.17865 23.5167 2.21192 23.6483 2.28006 23.7639L4.4587 27.5365C4.52525 27.6522 4.6219 27.7473 4.7344 27.8122C4.8469 27.8772 4.97683 27.9137 5.1115 27.9
1137H13.3872L15.3472 31.3092C15.4819 31.5421 15.7306 31.6862 16 31.6862H20.3557C20.4904 31.6862 20.6203 31.6498 20.7328 31.5849C20.8453 31.5199 20.942 31.4248 21.0085 31.3092L25.1471 24.141H29.0671C29.2018 24.141 29.3317 24.1046 29.4442 24.0396C29.5567 23.9747 29.6534 23.8796 29.7199 23.7639L31.8986 19.9913C31.9667 19.8756 32 19.7441 32 19.6142C32 19.4842 31.9667 19.3527 31.8986 19.2371L31.9002 19.2387ZM11.6443 0.752625L13.8229 4.52525L11.6443 8.29786H29.0703L26.8932 12.0689H9.90297L7.50565 7.91917L11.6443 0.752625ZM13.3872 27.1626H5.1115L7.29017 23.3868H11.6459L2.93286 8.29786H7.28857L9.46565 12.0705L15.7813 23.0128L13.3856 27.1642L13.3872 27.1626ZM26.8901 19.6142L24.713 15.8415L16 30.9321L13.8214 27.1594L16 23.3868L22.3173 12.4476H27.1103L31.2474 19.6126H26.8901V19.6142Z",fill:"url(#".concat(i,")")}),(0,s.jsx)("path",{d:"M31.9002 19.2387L28.1989 12.8263L27.7631 12.0705L29.7231 8.67659C29.7897 8.56088 29.8245 8.42937 29.8245 8.29946C29.8245 8.16955 29.7912 8.03804 29.7231 7.92237L27.5445 4.14973C27.4779 4.03406 27.3813 3.939 27.2687 3.87403C27.1563 3.80907 27.0263 3.77263 26.8917 3.77263H18.6143L16.6544 0.377104C16.5197 0.144187 16.2709 0 16.0016 0H11.6459C11.5112 0 11.3813 0.0364428 11.2687 0.101406C11.1563 0.16637 11.0596 0.261438 10.9915 0.377104L7.28857 6.79107L6.85285 7.54369H2.93285C2.79817 7.54369 2.66825 7.58013 2.55575 7.64506C2.44325 7.71004 2.3466 7.80511 2.27847 7.92077L0.101406 11.6918C0.0348584 11.8075 0 11.939 0 12.0689C0 12.1989 0.0332739 12.3304 0.101406 12.446L4.24005 19.6142L2.28006 23.0097C2.21351 23.127 2.17865 23.2569 2.17865 23.3868C2.17865 23.5167 2.21192 23.6483 2.28006 23.7639L4.4587 27.5365C4.52525 27.6522 4.6219 27.7473 4.7344 27.8122C4.8469 27.8772 4.97683 27.9137 5.1115 27.9137H13.3872L15.3472 31.3092C15.4819 31.5421 15.7306 31.6862 16 31.6862H20.3557C20.4904 31.6862 20.6203 31.6498 20.7328 31.5849C20.8453 31.5199 20.942 31.4248 21.0085 31.3092L25.1471 24.141H29.0671C29.2018 24.141 29.3317 24.1046 29.4442 24.0396C29.5567 23.9747 29.6534 23.8796 29.7199 23.7639L31.8986 19.9913C31.9667 19.8756 32 19.7441 32 19.6142C32 19.4842 31.9667 19.3527 31.8986 19.2371L31.9002 19.2387ZM11.6443 0.752625L13.8229 4.52525L11.6443 8.29786H29.0703L26.8932 12.0689H9.90297L7.50565 7.91917L11.6443 0.752625ZM13.3872 27.1626H5.1115L7.29017 23.3868H11.6459L2.93286 8.29786H7.28857L9.46565 12.0705L15.7813 23.0128L13.3856 27.1642L13.3872 27.1626ZM26.8901 19.6142L24.713 15.8415L16 30.9321L13.8214 27.1594L16 23.3868L22.3173 12.4476H27.1103L31.2474 19.6126H26.8901V19.6142Z",fill:"url(#".concat(o,")")}),(0,s.jsx)("path",{d:"M31.9002 19.2387L28.1989 12.8263L27.7631 12.0705L29.7231 8.67659C29.7897 8.56088 29.8245 8.42937 29.8245 8.29946C29.8245 8.16955 29.7912 8.03804 29.7231 7.92237L27.5445 4.14973C27.4779 4.03406 27.3813 3.939 27.2687 3.87403C27.1563 3.80907 27.0263 3.77263 26.8917 3.77263H18.6143L16.6544 0.377104C16.5197 0.144187 16.2709 0 16.0016 0H11.6459C11.5112 0 11.3813 0.0364428 11.2687 0.101406C11.1563 0.16637 11.0596 0.261438 10.9915 0.377104L7.28857 6.79107L6.85285 7.54369H2.93285C2.79817 7.54369 2.66825 7.58013 2.55575 7.64506C2.44325 7.71004 2.3466 7.80511 2.27847 7.92077L0.101406 11.6918C0.0348584 11.8075 0 11.939 0 12.0689C0 12.1989 0.0332739 12.3304 0.101406 12.446L4.24005 19.6142L2.28006 23.0097C2.21351 23.127 2.17865 23.2569 2.17865 23.3868C2.17865 23.5167 2.21192 23.6483 2.28006 23.7639L4.4587 27.5365C4.52525 27.6522 4.6219 27.7473 4.7344 27.8122C4.8469 27.8772 4.97683 27.9137 5.1115 27.9137H13.3872L15.3472 31.3092C15.4819 31.5421 15.7306 31.6862 16 31.6862H20.3557C20.4904 31.6862 20.6203 31.6498 20.7328 31.5849C20.8453 31.5199 20.942 31.4248 21.0085 31.3092L25.1471 24.141H29.0671C29.2018 24.141 29.3317 24.1046 29.4442 24.0396C29.5567 23.9747 29.6534 23.8796 29.7199 23.7639L31.8986 19.9913C31.9667 19.8756 32 19.7441 32 19.6142C32 19.4842 31.9667 19.3527 31.8986 19.2371L31.9002 19.2387ZM11.6443 0.752625L13.8229 4.52525L11.6443 8.29786H29.0703L26.8932 12.0689H9.90297L7.50565 7.91917L11.6443 0.752625ZM13.3872 27.1626H5.1115L7.29017 23.3868H11.6459L2.93286 8.29786H7.28857L9.46565 12.0705L15.7813 23.0128L13.3856 27.1642L13.3872 27.1626ZM26.8901 19.6142L24.713 15.8415L16 30.9321L13.8214 27.1594L16 23.3868L22.3173 12.4476H27.1103L31.2474 19.6126H26.8901V19.6142Z",fill:"url(#".concat(d,")")}),(0,s.jsxs)("defs",{children:[(0,s.jsxs)("linearGradient",{id:a,x1:"9.79365",y1:"11.8832",x2:"16.3546",y2:"-1.86734",gradientUnits:"userSpaceOnUse",children:[(0,s.jsx)("stop",{stopColor:"#6964ED",stopOpacity:"0.53"}),(0,s.jsx)("stop",{offset:"0.01",stopColor:"#8884F1",stopOpacity:"0.62"}),(0,s.jsx)("stop",{offset:"0.03",stopColor:"#A4A2F4",stopOpacity:"0.72"}),(0,s.jsx)("stop",{offset:"0.04",stopColor:"#BDBBF7",stopOpacity:"0.79"}),(0,s.jsx)("stop",{offset:"0.06",stopColor:"#D2D0F9",stopOpacity:"0.86"}),(0,s.jsx)("stop",{offset:"0.07",stopColor:"#E2E1FB",stopOpacity:"0.91"}),(0,s.jsx)("stop",{offset:"0.09",stopColor:"#EFEFFD",stopOpacity:"0.95"}),(0,s.jsx)("stop",{offset:"0.12",stopColor:"#F8F8FE",stopOpacity:"0.98"}),(0,s.jsx)("stop",{offset:"0.15",stopColor:"#FDFDFE"}),(0,s.jsx)("stop",{offset:"0.25",stopColor:"white"})]}),(0,s.jsxs)("linearGradient",{id:l,x1:"15.6744",y1:"23.2002",x2:"-1.5739",y2:"18.5812",gradientUnits:"userSpaceOnUse",children:[(0,s.jsx)("stop",{stopColor:"#6964ED",stopOpacity:"0.53"}),(0,s.jsx)("stop",{offset:"0.01",stopColor:"#8884F1",stopOpacity:"0.62"}),(0,s.jsx)("stop",{offset:"0.03",stopColor:"#A4A2F4",stopOpacity:"0.72"}),(0,s.jsx)("stop",{offset:"0.04",stopColor:"#BDBBF7",stopOpacity:"0.79"}),(0,s.jsx)("stop",{offset:"0.06",stopColor:"#D2D0F9",stopOpacity:"0.86"}),(0,s.jsx)("stop",{offset:"0.07",stopColor:"#E2E1FB",stopOpacity:"0.91"}),(0,s.jsx)("stop",{offset:"0.09",stopColor:"#EFEFFD",stopOpacity:"0.95"}),(0,s.jsx)("stop",{offset:"0.12",stopColor:"#F8F8FE",stopOpacity:"0.98"}),(0,s.jsx)("stop",{offset:"0.15",stopColor:"#FDFDFE"}),(0,s.jsx)("stop",{offset:"0.25",stopColor:"white"})]}),(0,s.jsxs)("linearGradient",{id:n,x1:"22.5368",y1:"12.4482",x2:"22.5375",y2:"30.9348",gradientUnits:"userSpaceOnUse",children:[(0,s.jsx)("stop",{stopColor:"#6964ED",stopOpacity:"0.53"}),(0,s.jsx)("stop",{offset:"0.01",stopColor:"#8884F1",stopOpacity:"0.62"}),(0,s.jsx)("stop",{offset:"0.03",stopColor:"#A4A2F4",stopOpacity:"0.72"}),(0,s.jsx)("stop",{offset:"0.04",stopColor:"#BDBBF7",stopOpacity:"0.79"}),(0,s.jsx)("stop",{offset:"0.06",stopColor:"#D2D0F9",stopOpacity:"0.86"}),(0,s.jsx)("stop",{offset:"0.07",stopColor:"#E2E1FB",stopOpacity:"0.91"}),(0,s.jsx)("stop",{offset:"0.09",stopColor:"#EFEFFD",stopOpacity:"0.95"}),(0,s.jsx)("stop",{offset:"0.12",stopColor:"#F8F8FE",stopOpacity:"0.98"}),(0,s.jsx)("stop",{offset:"0.15",stopColor:"#FDFDFE"}),(0,s.jsx)("stop",{offset:"0.25",stopColor:"white"})]}),(0,s.jsxs)("linearGradient",{id:i,x1:"29.7231",y1:"7.92077",x2:"2.41794",y2:"23.9996",gradientUnits:"userSpaceOnUse",children:[(0,s.jsx)("stop",{stopColor:"#615CED"}),(0,s.jsx)("stop",{offset:"0.17",stopColor:"#6156EC"}),(0,s.jsx)("stop",{offset:"0.38",stopColor:"#6147E9"}),(0,s.jsx)("stop",{offset:"0.61",stopColor:"#622FE4"}),(0,s.jsx)("stop",{offset:"0.62",stopColor:"#632DE4"})]}),(0,s.jsxs)("linearGradient",{id:o,x1:"0",y1:"15.8431",x2:"32.0016",y2:"15.8431",gradientUnits:"userSpaceOnUse",children:[(0,s.jsx)("stop",{stopColor:"#615CED"}),(0,s.jsx)("stop",{offset:"0.04",stopColor:"#615CED",stopOpacity:"0.96"}),(0,s.jsx)("stop",{offset:"0.09",stopColor:"#615CED",stopOpacity:"0.86"}),(0,s.jsx)("stop",{offset:"0.17",stopColor:"#615CED",stopOpacity:"0.69"}),(0,s.jsx)("stop",{offset:"0.25",stopColor:"#615CED",stopOpacity:"0.46"}),(0,s.jsx)("stop",{offset:"0.35",stopColor:"#615CED",stopOpacity:"0.16"}),(0,s.jsx)("stop",{offset:"0.4",stopColor:"#615CED",stopOpacity:"0"})]}),(0,s.jsxs)("linearGradient",{id:d,x1:"24.0016",y1:"1.98534",x2:"8.23646",y2:"29.8332",gradientUnits:"userSpaceOnUse",children:[(0,s.jsx)("stop",{stopColor:"#A7A5F6"}),(0,s.jsx)("stop",{offset:"0.05",stopColor:"#9895F4",stopOpacity:"0.79"}),(0,s.jsx)("stop",{offset:"0.12",stopColor:"#8784F1",stopOpacity:"0.55"}),(0,s.jsx)("stop",{offset:"0.19",stopColor:"#7975F0",stopOpacity:"0.35"}),(0,s.jsx)("stop",{offset:"0.25",stopColor:"#6F6AEE",stopOpacity:"0.2"}),(0,s.jsx)("stop",{offset:"0.31",stopColor:"#6762ED",stopOpacity:"0.09"}),(0,s.jsx)("stop",{offset:"0.36",stopColor:"#625DED",stopOpacity:"0.02"}),(0,s.jsx)("stop",{offset:"0.4",stopColor:"#615CED",stopOpacity:"0"})]})]})]})}function x(e){let t=(0,r.useId)().replace(/:/g,""),a="latiai-top-r-".concat(t),l="latiai-top-l-".concat(t),n="latiai-bot-l-".concat(t),i="latiai-bot-r-".concat(t),o="latiai-glow-".concat(t);return(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",...e,children:[(0,s.jsxs)("defs",{children:[(0,s.jsxs)("linearGradient",{id:a,x1:"0%",y1:"100%",x2:"100%",y2:"0%",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:"#9AABB8"}),(0,s.jsx)("stop",{offset:"100%",stopColor:"#C8D4DC"})]}),(0,s.jsxs)("linearGradient",{id:l,x1:"100%",y1:"100%",x2:"0%",y2:"0%",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:"#7A8A98"}),(0,s.jsx)("stop",{offset:"100%",stopColor:"#A8B8C4"})]}),(0,s.jsxs)("linearGradient",{id:n,x1:"100%",y1:"0%",x2:"0%",y2:"100%",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:"#5A6A78"}),(0,s.jsx)("stop",{offset:"100%",stopColor:"#3A4A58"})]}),(0,s.jsxs)("linearGradient",{id:i,x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:"#4A5A68"}),(0,s.jsx)("stop",{offset:"100%",stopColor:"#2A3A48"})]}),(0,s.jsxs)("linearGradient",{id:o,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:"#22D3EE",stopOpacity:"0.4"}),(0,s.jsx)("stop",{offset:"50%",stopColor:"#06B6D4"}),(0,s.jsx)("stop",{offset:"100%",stopColor:"#22D3EE",stopOpacity:"0.4"})]})]}),(0,s.jsx)("ellipse",{cx:"12",cy:"12",rx:"11",ry:"4",stroke:"#A0B8C8",strokeWidth:"0.7",strokeDasharray:"2 1.5",fill:"none",transform:"rotate(-25 12 12)",opacity:"0.35"}),(0,s.jsx)("path",{d:"M12 1L21 11H12V1Z",fill:"url(#".concat(a,")")}),(0,s.jsx)("path",{d:"M12 1L3 11H12V1Z",fill:"url(#".concat(l,")")}),(0,s.jsx)("path",{d:"M12 23L3 13H12V23Z",fill:"url(#".concat(n,")")}),(0,s.jsx)("path",{d:"M12 23L21 13H12V23Z",fill:"url(#".concat(i,")")}),(0,s.jsx)("rect",{x:"2",y:"11",width:"20",height:"2",rx:"1",fill:"url(#".concat(o,")")}),(0,s.jsx)("rect",{x:"1",y:"10.5",width:"22",height:"3",rx:"1.5",fill:"#06B6D4",opacity:"0.15"}),(0,s.jsx)("path",{d:"M 1.5 15 Q 5 17.5 12 17.5",stroke:"#B0C8D8",strokeWidth:"0.7",fill:"none",opacity:"0.5"}),(0,s.jsx)("circle",{cx:"2.5",cy:"14.5",r:"0.5",fill:"#B0D0E0",opacity:"0.6"}),(0,s.jsx)("circle",{cx:"4.5",cy:"16",r:"0.4",fill:"#B0D0E0",opacity:"0.5"})]})}},64208:(e,t,a)=>{a.d(t,{MotionControlModelSelector:()=>g});var s=a(76947),r=a(4010),l=a(63185),n=a(23894),i=a(9713),o=a(15428),d=a(82821),c=a(755),u=a(73705),m=a(9493),p=a(94076),x=a(98547),h=a(90215);function f(e){let{className:t}=e;return(0,s.jsx)(l.hx,{className:t})}function g(e){let{value:t,onChange:a,disabled:l}=e,g=(0,p.c3)("Generator.motionControl"),b=(0,p.c3)("Generator.common"),[v,j]=(0,x.useState)(!1),y=r.G4.find(e=>e.id===t);return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(o.J,{className:"text-sm font-medium",children:"Model"}),(0,s.jsxs)(d.AM,{open:v,onOpenChange:j,children:[(0,s.jsx)(d.Wv,{asChild:!0,children:(0,s.jsxs)(n.$,{variant:"outline","aria-haspopup":"listbox","aria-expanded":v,disabled:l,className:(0,h.Ul)({open:v,disabled:l}),children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[(0,s.jsx)(f,{className:"w-6 h-6"}),(0,s.jsxs)("div",{className:"flex flex-1 flex-col items-start min-w-0
1whitespace-normal",children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-sm",children:(null==y?void 0:y.name)||g("selectModel")}),(null==y?void 0:y.isNew)&&(0,s.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-primary/10 text-primary font-medium",children:g("newBadge")})]}),(0,s.jsx)("span",{className:"w-full whitespace-normal text-left text-xs text-muted-foreground line-clamp-2 break-words",children:(null==y?void 0:y.description)||g("chooseModelToRun")}),y&&(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[10px] text-muted-foreground",children:y.provider}),(0,s.jsxs)("span",{className:"text-[10px] text-muted-foreground px-1.5 py-0.5 rounded bg-muted",children:[(0,s.jsx)("span",{className:"text-xs",children:"â±"})," ",y.estimatedTime]}),(0,s.jsxs)("span",{className:"text-[10px] text-muted-foreground px-1.5 py-0.5 rounded bg-muted",children:[(0,s.jsx)("span",{className:"text-xs",children:"â"})," ",y.creditsLabel?b("creditsPerSecondRange",{range:y.creditsLabel}):b("nCredits",{count:Number(y.credits)})]})]})]})]}),(0,s.jsxs)("div",{className:"flex flex-shrink-0 items-center gap-2",children:[(0,s.jsx)(c.A,{className:h.TF}),(0,s.jsx)(u.A,{className:(0,h.pk)(v)})]})]})}),(0,s.jsx)(d.hl,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:(0,s.jsx)(i.uB,{children:(0,s.jsxs)(i.oI,{className:"max-h-[320px]",children:[(0,s.jsx)(i.xL,{children:g("noModelFound")}),(0,s.jsx)(i.L$,{children:r.G4.map(e=>{let r=t===e.id,l=e.creditsLabel?b("creditsPerSecondRange",{range:e.creditsLabel}):b("nCredits",{count:Number(e.credits)});return(0,s.jsxs)(i.h_,{value:e.id,onSelect:()=>{a(e.id),j(!1)},className:(0,h.jy)(r),children:[r&&(0,s.jsx)("span",{className:h.iD}),(0,s.jsx)("div",{className:(0,h.Ks)(r),children:r&&(0,s.jsx)(m.A,{className:"w-3 h-3"})}),(0,s.jsx)(f,{className:"w-6 h-6 flex-shrink-0"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-sm",children:e.name}),e.isNew&&(0,s.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-primary/10 text-primary font-medium",children:g("newBadge")})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:e.description}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,s.jsx)("span",{className:"text-[10px] text-muted-foreground",children:e.provider}),(0,s.jsxs)("span",{className:"text-[10px] text-muted-foreground px-1.5 py-0.5 rounded bg-muted",children:[(0,s.jsx)("span",{className:"text-xs",children:"â±"})," ",e.estimatedTime]}),(0,s.jsxs)("span",{className:"text-[10px] text-muted-foreground px-1.5 py-0.5 rounded bg-muted",children:[(0,s.jsx)("span",{className:"text-xs",children:"â"})," ",l," "]})]})]})]},e.id)})})]})})})]})]})}},66055:(e,t,a)=>{a.d(t,{pC:()=>d,JB:()=>c,G4:()=>u,A7:()=>m});var s=a(42758);let r=(0,s.createServerReference)("7fa5e7bf8bcad73154cdaba9f6a291ea860ceff628",s.callServer,void 0,s.findSourceMapURL,"getCreditBalanceAction"),l=(0,s.createServerReference)("7f7a40c90fd3a189a66e6e58a7153a2109c5a07763",s.callServer,void 0,s.findSourceMapURL,"getCreditStatsAction"),n=(0,s.createServerReference)("7f571b87404078c6e53fea53df0cfc169b45ededcc",s.callServer,void 0,s.findSourceMapURL,"getCreditTransactionsAction");var i=a(95136),o=a(24184);let d={all:["credits"],balance:()=>[...d.all,"balance"],stats:()=>[...d.all,"stats"],transactions:()=>[...d.all,"transactions"],transactionsList:e=>[...d.transactions(),e]};function c(){return(0,i.I)({queryKey:d.balance(),queryFn:async()=>{var e,t;let a=await r();if(!(null==a||null==(e=a.data)?void 0:e.success))throw Error((null==a||null==(t=a.data)?void 0:t.error)||"Failed to fetch credit balance");return a.data.credits||0}})}function u(){return(0,i.I)({queryKey:d.stats(),queryFn:async()=>{var e,t;let a=await l();if(!(null==a||null==(e=a.data)?void 0:e.success))throw Error((null==a||null==(t=a.data)?void 0:t.error)||"Failed to fetch credit stats");return a.data.data}})}function m(e,t,a,s){return(0,i.I)({queryKey:d.transactionsList({pageIndex:e,pageSize:t,search:a,sorting:s}),queryFn:async()=>{var r,l,i,o;let d=await n({pageIndex:e,pageSize:t,search:a,sorting:s});if(!(null==d||null==(r=d.data)?void 0:r.success))throw Error((null==d||null==(o=d.data)?void 0:o.error)||"Failed to fetch credit transactions");return{items:(null==(l=d.data.data)?void 0:l.items)||[],total:(null==(i=d.data.data)?void 0:i.total)||0}},placeholderData:o.rX})}},67078:(e,t,a)=>{a.d(t,{KlingElementsEditor:()=>y,createEmptyKlingElementDraft:()=>j});
1var s=a(76947),r=a(23894),l=a(64156),n=a(81261),i=a(78110),o=a(15428),d=a(31055),c=a(54328),u=a(41303),m=a(94441),p=a(50021),x=a(81591),h=a(73287),f=a(94076),g=a(98547),b=a(39951);function v(e){let{label:t,tooltip:a}=e;return(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(o.J,{className:"text-sm font-medium",children:t}),(0,s.jsxs)(u.m_,{children:[(0,s.jsx)(u.k$,{asChild:!0,children:(0,s.jsx)("button",{type:"button",className:"text-muted-foreground transition-colors hover:text-foreground",children:(0,s.jsx)(x.A,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(u.ZI,{className:"max-w-xs",children:(0,s.jsx)("p",{children:a})})]})]})}function j(){return{id:(0,p.$)("element"),name:"",description:"",element_input_urls:[]}}function y(e){let{elements:t,onChange:a,disabled:u}=e,x=(0,f.c3)("Generator.video"),y=(0,m.a)(),[w,N]=(0,g.useState)(!1),C=(e,s)=>{let r=[...t];r[e]={...r[e],...s},a(r)},k=t.map(e=>e.name.trim()).filter(Boolean).map(e=>"@".concat(e)),L=t.length>0&&t.every(e=>/^[A-Za-z0-9_]+$/.test(e.name.trim())&&e.description.trim().length>0&&e.element_input_urls.length>=2&&e.element_input_urls.length<=4),S=t.length>0&&!L,A=(0,s.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[t.length>0&&(0,s.jsx)("div",{className:"space-y-3",children:t.map((e,n)=>(0,s.jsx)(l.Zp,{className:"py-0",children:(0,s.jsxs)(l.Wu,{className:"space-y-4 p-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsxs)("div",{className:"text-sm font-medium",children:[x("element")," ",n+1]}),(0,s.jsx)(r.$,{type:"button",variant:"outline",size:"sm",className:"h-8",onClick:()=>{a(t.filter((e,t)=>t!==n))},disabled:u,children:x("removeElement")})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(v,{label:x("elementName"),tooltip:x("elementNameHelper")}),(0,s.jsx)(i.p,{value:e.name,onChange:e=>C(n,{name:e.target.value.replace(/\s+/g,"_").replace(/[^A-Za-z0-9_]/g,"").slice(0,40)}),placeholder:x("elementNamePlaceholder"),disabled:u})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(o.J,{className:"text-sm font-medium",children:x("elementDescription")}),(0,s.jsx)(c.T,{value:e.description,onChange:e=>C(n,{description:e.target.value.slice(0,200)}),placeholder:x("elementDescriptionPlaceholder"),disabled:u,className:"min-h-[80px] resize-none text-sm",rows:3})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(b.KlingElementImageUploader,{images:e.element_input_urls,onImagesChange:e=>C(n,{element_input_urls:e}),disabled:u}),e.element_input_urls.length>0&&e.element_input_urls.length<2&&(0,s.jsx)("p",{className:"text-xs text-destructive",children:x("elementImagesMinHint")})]})]})},e.id))}),(0,s.jsxs)(r.$,{type:"button",variant:"outline",size:"sm",className:"w-full",onClick:()=>{t.length>=3||a([...t,j()])},disabled:u||t.length>=3,children:[(0,s.jsx)(h.A,{className:"mr-1.5 h-3.5 w-3.5"}),x("addElement")]})]});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"rounded-xl border bg-muted/20 p-3",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,s.jsx)(v,{label:x("klingElements"),tooltip:x("klingElementsGuide")}),(0,s.jsx)("p",{className:(0,p.cn)("text-xs",S?"text-amber-600":"text-muted-foreground"),children:0===t.length?x("klingElementsEmpty"):S?x("klingElementsIncomplete"):x("klingElementsReady")})]}),(0,s.jsx)(r.$,{type:"button",variant:"outline",size:"sm",className:"shrink-0",onClick:()=>N(!0),disabled:u,children:t.length>0?x("manageElements"):x("addElement")})]}),k.length>0&&(0,s.jsx)("div",{className:"mt-3 flex flex-wrap gap-1.5",children:k.map(e=>(0,s.jsx)("span",{className:"rounded-full border bg-background px-2 py-1 text-xs text-muted-foreground",children:e},e))})]}),y?(0,s.jsx)(n._s,{open:w,onOpenChange:N,children:(0,s.jsxs)(n.zj,{className:"max-h-[85vh] overflow-hidden",children:[(0,s.jsx)(n.BE,{className:"border-b",children:(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsx)(n.gk,{children:x("klingElements")}),(0,s.jsxs)("span",{className:"rounded-full border bg-muted px-2.5 py-1 text-xs text-muted-foreground",children:[t.length,"/",3]})]})}),A]})}):(0,s.jsx)(d.cj,{open:w,onOpenChange:N,children:(0,s.jsxs)(d.h,{side:"right",className:"w-full gap-0 overflow-hidden sm:max-w-xl",children:[(0,s.jsx)(d.Fm,{className:"border-b pr-10",children:(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsx)(d.qp,{children:x("klingElements")}),(0,s.jsxs)("span",{className:"rounded-full border bg-muted px-2.5 py-1 text-xs text-muted-foreground",children:[t.length,"/",3]})]})}),A]})})]})}},69081:(e,t,a)=>{a.d(t,{QualitySelector:()=>d});var s=a(76947),r=a(15428),l=a(50021),n=a(9493),i=a(94076),o=a(98547);function d(e){let{value:t,onChange:a,disabled:d}=e,c=(0,i.c3)("Generator.common"),u=(0,o.useMemo)(()=>[{value:"standard",label:c("qualityStandard"),description:c("qualityBalanced")},{value:"high",label:c("qualityHigh"),description:c("qualityPremium")}],[c]);return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(r.J,{className:"text-sm font-medium",children:c("qualityLabel")}),(0,s.jsx)("div",{className:"flex gap-2",children:u.map(e=>{let r=t===e.value;return(0,s.jsxs)("button",{type:"button",disabled:d,onClick:()=>a(e.value),className:(0,l.cn)("relative flex-1 px-3 py-2 rounded-lg text-center transition-all border-2",r?"border-primary bg-primary/5":"border-border hover:border-primary/50 hover:bg-accent/50",d&&"opacity-50 cursor-not-allowed"),children:[r&&(0,s.jsx)("div",{className:"absolute top-1 right-1",children:(0,s.jsx)(n.A,{className:"w-3 h-3 text-primary"})}),(0,s.jsx)("div",{className:"font-medium text-sm",children:e.label}),(0,s.jsx)("div",{className:"text-[10px] text-muted-foreground",children:e.description})]},e.value)})})]})}},70026:(e,t,a)=>{a.d(t,{ModelDropdownSelector:()=>C,getModelInfo:()=>k});var s=a(76947),r=a(67579),l=a(63185),n=a(23894),i=a(9713),o=a(15428),d=a(82821),c=a(50021),u=a(755),m=a(73705),p=a(9493),x=a(94076),h=a(98547),f=a(26387),g=a(90215);let b=["gpt-image-2.5","nano-banana-2"],v=[{id:"nano-banana-2",name:"Nano Banana 2 (Gemini 3.1 Flash)",provider:"Google",description:"Google Search grounding, up to 14 refs, 4K",estimatedTime:"30 sec",credits:"5+",supportsResolution:!0,maxImages:14,isNew:!0},{id:"nano-banana-pro",name:"Nano Banana Pro (Gemini Pro)",provider:"Google",description:"4K output, strongest prompt-following",estimatedTime:"30 sec",credits:"8+",supportsResolution:!0,maxImages:8,isNew:!0},{id:"nano-banana",name:"Nano Banana (Gemini 2.5)",provider:"Google",description:"Best for character & face consistency",estimatedTime:"30 sec",credits:"3",supportsResolution:!1,maxImages:0},{id:"latiai-flash",name:"LatiAI Flash",provider:"LatiAI",description:"Fast, best value, great results",estimatedTime:"30 sec",credits:"1",supportsResolution:!1,maxImages:0,badge:"Best Deal"},{id:"gpt-image-2.5",name:"GPT Image 2.5",provider:"OpenAI",description:"Flare and Sunburst versions, up to 4K",estimatedTime:"30 sec",credits:"1+",supp
1ortsResolution:!0,maxImages:0,isNew:!0},{id:"gpt-image-2",name:"GPT Image 2",provider:"OpenAI",description:"Superior text rendering, top-tier visual quality",estimatedTime:"30 sec",credits:"2+",supportsResolution:!0,maxImages:0},{id:"gpt-image-1.5",name:"GPT Image 1.5",provider:"OpenAI",description:"Best text rendering, high fidelity",estimatedTime:"30 sec",credits:"4+",supportsResolution:!0,maxImages:0},{id:"seedream-5-lite",name:"Seedream 5 Lite",provider:"ByteDance",description:"Cleaner composition, stronger style consistency",estimatedTime:"30 sec",credits:"6",supportsResolution:!0,maxImages:0,isNew:!0},{id:"seedream-4.5",name:"Seedream 4.5",provider:"ByteDance",description:"Sharp text rendering, 4K cinematic",estimatedTime:"30 sec",credits:"7",supportsResolution:!0,maxImages:0},{id:"z-image",name:"Z-Image",provider:"Alibaba",description:"Quick generation, solid output",estimatedTime:"30 sec",credits:"1",supportsResolution:!1,maxImages:0},{id:"flux2-pro",name:"Flux 2 Pro",provider:"BFL",description:"Fast generation, BFL quality",estimatedTime:"30 sec",credits:"6+",supportsResolution:!0,maxImages:0,isNew:!0},{id:"flux2-flex",name:"Flux 2 Flex",provider:"BFL",description:"Fine control with adjustable parameters",estimatedTime:"30 sec",credits:"14+",supportsResolution:!0,maxImages:0,isNew:!0}],j=new Set(["latiai-flash"]),y=[{id:"nano-banana-2",name:"Nano Banana 2 (Gemini 3.1 Flash)",provider:"Google",description:"Google Search grounding, up to 14 refs, 4K",estimatedTime:"30 sec",credits:"5+",supportsResolution:!0,maxImages:14,isNew:!0},{id:"nano-banana-pro",name:"Nano Banana Pro (Gemini Pro)",provider:"Google",description:"4K output, strongest prompt-following",estimatedTime:"30 sec",credits:"8+",supportsResolution:!0,maxImages:8,isNew:!0},{id:"nano-banana-edit",name:"Nano Banana (Gemini 2.5)",provider:"Google",description:"Quick edits with up to 10 refs",estimatedTime:"30 sec",credits:"3",supportsResolution:!1,maxImages:10},{id:"gpt-image-2.5",name:"GPT Image 2.5",provider:"OpenAI",description:"Flare and Sunburst versions",estimatedTime:"30 sec",credits:"1+",supportsResolution:!0,maxImages:16,isNew:!0},{id:"gpt-image-2-edit",name:"GPT Image 2",provider:"OpenAI",description:"Superior text rendering, up to 16 refs",estimatedTime:"30 sec",credits:"2+",supportsResolution:!0,maxImages:16},{id:"gpt-image-1.5-edit",name:"GPT Image 1.5",provider:"OpenAI",description:"High fidelity edits, up to 16 refs",estimatedTime:"30 sec",credits:"4+",supportsResolution:!0,maxImages:16},{id:"seedream-5-lite-edit",name:"Seedream 5 Lite",provider:"ByteDance",description:"14 refs, stable identity and style transfer",estimatedTime:"30 sec",credits:"6",supportsResolution:!0,maxImages:14,isNew:!0},{id:"seedream-4.5-edit",name:"Seedream 4.5",provider:"ByteDance",description:"14 refs, precise style transfer",estimatedTime:"30 sec",credits:"7",supportsResolution:!0,maxImages:14},{id:"flux2-pro-edit",name:"Flux 2 Pro",provider:"BFL",description:"Fast, 8 refs, multi-reference consistency",estimatedTime:"30 sec",credits:"6+",supportsResolution:!0,maxImages:8,isNew:!0},{id:"flux2-flex-edit",name:"Flux 2 Flex",provider:"BFL",description:"Fine control, adjustable steps/guidance",estimatedTime:"30 sec",credits:"14+",supportsResolution:!0,maxImages:8,isNew:!0}];function w(e){return(0,r.hh)(e)?"gptImage25":"gpt-image-2"===e||"gpt-image-2-edit"===e?"gptImage2":"seedream-5-lite"===e||"seedream-5-lite-edit"===e?"seedream5Lite":"seedream-4.5"===e||"seedream-4.5-edit"===e?"seedream45":null}function N(e){let{modelId:t,className:a}=e,n="latiai-flash"===t,i=t.includes("seedream"),o=t.includes("flux"),d="z-image"===t,u=(0,r.hh)(t)||"gpt-image-1.5"===t||"gpt-image-1.5-edit"===t||"gpt-image-2"===t||"gpt-image-2-edit"===t;return n?(0,s.jsx)(l.ky,{className:(0,c.cn)("w-6 h-6",a)}):d?(0,s.jsx)(l.Z$,{className:(0,c.cn)("w-6 h-6",a)}):u?(0,s.jsx)(l.zs,{className:(0,c.cn)("w-6 h-6",a)}):i?(0,s.jsx)(l.gu,{className:(0,c.cn)("w-6 h-6",a)}):o?(0,s.jsx)(l.eI,{className:(0,c.cn)("w-6 h-6",a)}):(0,s.jsx)(l.q_,{className:(0,c.cn)("w-6 h-6",a)})}function C(e){let{value:t,onChange:a,disabled:r,mode:l="text-to-image"}=e,[c,C]=(0,h.useState)(!1),k=(0,x.c3)("Generator.common"),L=(0,x.c3)("Generator.aiModels"),S="text-to-image"===l?v.filter(e=>!j.has(e.id)):y,A="text-to-image"===l?"textToImage":"imageToImage",M=S.find(e=>e.id===t),D=!!M&&"isNew"in M&&!0===M.isNew,I=e=>{if(!e)return k("selectModel");let t=w(e.id);if(!t)return e.name;try{return L("".concat(A,".").concat(t,".name"))}catch(t){return e.name}},F=e=>{if(!e)return k("selectModel");let t=w(e.id);if(!t)return e.description;try{return L("".concat(A,".").concat(t,".description"))}catch(t){return e.description}};return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(o.J,{className:"text-sm font-medium",children:k("model")}),(0,s.jsxs)(d.AM,{open:c,onOpenChange:C,children:[(0,s.jsx)(d.Wv,{asChild:!0,children:(0,s.jsxs)(n.$,{variant:"outline","aria-haspopup":"listbox","aria-expanded":c,disabled:r,className:(0,g.Ul)({open:c,disabled:r}),children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[(0,s.jsx)(N,{modelId:t,className:"w-6 h-6"}),(0,s.jsxs)("div",{className:"flex flex-1 flex-col items-start min-w-0
1whitespace-normal",children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-sm",children:I(M)}),M&&"badge"in M&&M.badge&&(0,s.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 font-medium",children:M.badge}),D&&(0,s.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-primary/10 text-primary font-medium",children:"New"})]}),(0,s.jsx)("span",{className:"w-full whitespace-normal text-left text-xs text-muted-foreground line-clamp-2 break-words",children:F(M)}),M&&(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:["provider"in M&&M.provider&&(0,s.jsx)("span",{className:"text-[10px] text-muted-foreground",children:M.provider}),(0,s.jsxs)("span",{className:"text-[10px] text-muted-foreground px-1.5 py-0.5 rounded bg-muted",children:[(0,s.jsx)("span",{className:"text-xs",children:"â±"})," ",M.estimatedTime]}),(0,s.jsxs)("span",{className:"text-[10px] text-muted-foreground px-1.5 py-0.5 rounded bg-muted",children:[(0,s.jsx)("span",{className:"text-xs",children:"â"})," ",M.credits," ",k("creditUnit",{count:Number.parseInt(M.credits,10)||0})]})]})]})]}),(0,s.jsxs)("div",{className:"flex flex-shrink-0 items-center gap-2",children:[(0,s.jsx)(u.A,{className:g.TF}),(0,s.jsx)(m.A,{className:(0,g.pk)(c)})]})]})}),(0,s.jsx)(d.hl,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:(0,s.jsx)(i.uB,{children:(0,s.jsxs)(i.oI,{className:"max-h-[400px]",children:[(0,s.jsx)(i.xL,{children:k("noModelFound")}),(0,s.jsx)(i.L$,{children:S.map(e=>{let r=t===e.id,l="isNew"in e&&!0===e.isNew;return(0,s.jsxs)(i.h_,{value:e.id,onSelect:()=>{a(e.id),C(!1)},className:(0,g.jy)(r),children:[r&&(0,s.jsx)("span",{className:g.iD}),(0,s.jsx)("div",{className:(0,g.Ks)(r),children:r&&(0,s.jsx)(p.A,{className:"w-3 h-3"})}),(0,s.jsx)(N,{modelId:e.id,className:"w-6 h-6 flex-shrink-0"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-sm",children:I(e)}),"badge"in e&&e.badge&&(0,s.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 font-medium",children:e.badge}),l&&(0,s.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-primary/10 text-primary font-medium",children:"New"})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:F(e)}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:["provider"in e&&e.provider&&(0,s.jsx)("span",{className:"text-[10px] text-muted-foreground",children:e.provider}),(0,s.jsxs)("span",{className:"text-[10px] text-muted-foreground px-1.5 py-0.5 rounded bg-muted",children:[(0,s.jsx)("span",{className:"text-xs",children:"â±"})," ",e.estimatedTime]}),(0,s.jsxs)("span",{className:"text-[10px] text-muted-foreground px-1.5 py-0.5 rounded bg-muted",children:[(0,s.jsx)("span",{className:"text-xs",children:"â"})," ",e.credits," ",k("creditUnit",{count:Number.parseInt(e.credits,10)||0})]})]})]})]},e.id)})})]})})})]}),(0,s.jsx)(f.d,{value:t,onChange:a,disabled:r,label:k("model"),options:b.flatMap(e=>{let t=S.find(t=>t.id===e);return t?[{id:e,label:"nano-banana-2"===e?"Nano Banana 2":I(t)}]:[]})})]})}function k(e,t){let a=("text-to-image"===t?v:y).find(t=>t.id===e);if(a)return{id:a.id,name:a.name,description:a.description,supportsResolution:a.supportsResolution,maxImages:a.maxImages,estimatedTime:a.estimatedTime,credits:a.credits,isNew:"isNew"in a?a.isNew:void 0}}},71458:(e,t,a)=>{a.d(t,{KlingMultiShotEditor:()=>h});var s=a(76947),r=a(23894),l=a(64156),n=a(15428),i=a(91549),o=a(54328),d=a(41303),c=a(50021),u=a(81591),m=a(73287),p=a(94076);function x(e){let{label:t,tooltip:a}=e;return(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(n.J,{className:"text-sm font-medium",children:t}),(0,s.jsxs)(d.m_,{children:[(0,s.jsx)(d.k$,{asChild:!0,children:(0,s.jsx)("button",{type:"button",className:"text-muted-foreground transition-colors hover:text-foreground",children:(0,s.jsx)(u.A,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(d.ZI,{className:"max-w-xs",children:(0,s.jsx)("p",{children:a})})]})]})}function h(e){let{shots:t,onChange:a,disabled:d,targetDuration:u}=e,h=(0,p.c3)("Generator.video"),f=t.reduce((e,t)=>
1e+t.duration,0),g=void 0===u?0:u-f,b=void 0===u||0===g,v=(e,s)=>{let r=[...t];r[e]={...r[e],...s},a(r)};return(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(x,{label:h("shots"),tooltip:h("shotsHelper")}),(0,s.jsxs)("div",{className:"text-[11px] text-muted-foreground",children:[t.length,"/",5]})]}),(0,s.jsxs)("div",{className:(0,c.cn)("flex items-center gap-4 text-xs",b?"text-emerald-600":g>0?"text-muted-foreground":"text-destructive"),children:[(0,s.jsx)("div",{className:"font-medium text-foreground",children:h("shotTotalDuration",{total:f,target:null!=u?u:f})}),(0,s.jsx)("div",{children:b?h("shotDurationMatched"):g>0?h("shotDurationRemaining",{remaining:g}):h("shotDurationExceeded",{exceeded:Math.abs(g)})})]})]}),(0,s.jsx)("div",{className:"space-y-3",children:t.map((e,c)=>(0,s.jsx)(l.Zp,{className:"py-0",children:(0,s.jsxs)(l.Wu,{className:"space-y-4 p-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsxs)("div",{className:"text-sm font-medium",children:[h("shot")," ",c+1]}),t.length>1&&(0,s.jsx)(r.$,{type:"button",variant:"outline",size:"sm",className:"h-8",onClick:()=>{!(t.length<=1)&&a(t.filter((e,t)=>t!==c))},disabled:d,children:h("removeShot")})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.J,{className:"text-sm font-medium",children:h("shotPrompt")}),(0,s.jsx)(o.T,{value:e.prompt,onChange:e=>v(c,{prompt:e.target.value.slice(0,2500)}),placeholder:h("shotPromptPlaceholder"),disabled:d,className:"min-h-[88px] resize-none text-sm",rows:3}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:[e.prompt.length," / 2500"]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsx)(n.J,{className:"text-sm font-medium",children:h("shotDuration")}),(0,s.jsxs)("div",{className:"rounded-full border bg-muted px-3 py-1 text-sm font-medium",children:[e.duration,"s"]})]}),(0,s.jsx)(i.A,{min:1,max:12,step:1,value:[e.duration],onValueChange:t=>{let[a]=t;v(c,{duration:null!=a?a:e.duration})},disabled:d}),(0,s.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,s.jsx)("span",{children:"1s"}),(0,s.jsx)("span",{children:"12s"})]})]})]})},e.id))}),(0,s.jsxs)(r.$,{type:"button",variant:"outline",size:"sm",className:"w-full",onClick:()=>{if(t.length>=5)return;let e=void 0===u?3:Math.max(1,Math.min(12,u-f||1));a([...t,{id:(0,c.$)("shot"),prompt:"",duration:e}])},disabled:d||t.length>=5,children:[(0,s.jsx)(m.A,{className:"mr-1.5 h-3.5 w-3.5"}),h("addShot")]})]})}},80507:(e,t,a)=>{a.d(t,{SeedControl:()=>x});var s=a(76947),r=a(23894),l=a(78110),n=a(15428),i=a(41303),o=a(81591),d=a(79533),c=a(38132),u=a(26539),m=a(94076),p=a(98547);function x(e){let{value:t,locked:a,onValueChange:x,onLockedChange:h,tooltip:f,disabled:g}=e,b=(0,m.c3)("Generator.common"),v=(0,p.useId)(),j=Number(t),y=t.trim().length>0&&Number.isInteger(j)&&j>=1e4&&j<=99999,w=b(a?"unlockSeed":"lockSeed");return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(n.J,{htmlFor:v,className:"text-sm font-medium",children:b("seed")}),(0,s.jsx)(i.Bc,{children:(0,s.jsxs)(i.m_,{children:[(0,s.jsx)(i.k$,{asChild:!0,children:(0,s.jsx)("button",{type:"button","aria-label":f,className:"text-muted-foreground",children:(0,s.jsx)(o.A,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(i.ZI,{className:"max-w-xs",children:(0,s.jsx)("p",{children:f})})]})})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.p,{id:v,type:"number",min:1e4,max:99999,value:t,onChange:e=>x(e.target.value),placeholder:b("seedPlaceholder"),disabled:g||a,className:"flex-1"}),(0,s.jsx)(i.Bc,{children:(0,s.jsxs)(i.m_,{children:[(0,s.jsx)(i.k$,{asChild:!0,children:(0,s.jsx)(r.$,{type:"button",variant:"outline",size:"icon","aria-label":b("generateRandomSeed"),onClick:()=>{x(String(Math.floor(9e4*Math.random())+1e4))},disabled:g||a,children:(0,s.jsx)(d.A,{className:"h-4 w-4"})})}),(0,s.jsx)(i.ZI,{children:(0,s.jsx)("p",{children:b("generateRandomSeed")})})]})}),(0,s.jsx)(i.Bc,{children:(0,s.jsxs)(i.m_,{children:[(0,s.jsx)(i.k$,{asChild:!0,children:(0,s.jsx)(r.$,{type:"button",variant:a?"default":"outline",size:"icon","aria-label":w,onClick:()=>h(!a),disabled:g||!a&&!y,children:a?(0,s.jsx)(c.A,{className:"h-4 w-4"}):(0,s.jsx)(u.A,{className:"h-4 w-4"})})}),(0,s.jsx)(i.ZI,{children:(0,s.jsx)("p",{children:w})})]})})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:b(
1a?"seedLocked":"seedUnlocked")})]})}},81261:(e,t,a)=>{a.d(t,{BE:()=>m,QP:()=>c,Uz:()=>i,_s:()=>n,cp:()=>d,gk:()=>x,tb:()=>p,uT:()=>o,zj:()=>u});var s=a(76947);a(98547);var r=a(65625),l=a(50021);function n(e){let{...t}=e;return(0,s.jsx)(r._s.Root,{"data-slot":"drawer",...t})}function i(e){let{...t}=e;return(0,s.jsx)(r._s.Trigger,{"data-slot":"drawer-trigger",...t})}function o(e){let{...t}=e;return(0,s.jsx)(r._s.Portal,{"data-slot":"drawer-portal",...t})}function d(e){let{...t}=e;return(0,s.jsx)(r._s.Close,{"data-slot":"drawer-close",...t})}function c(e){let{className:t,...a}=e;return(0,s.jsx)(r._s.Overlay,{"data-slot":"drawer-overlay",className:(0,l.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function u(e){let{className:t,children:a,...n}=e;return(0,s.jsxs)(o,{"data-slot":"drawer-portal",children:[(0,s.jsx)(c,{}),(0,s.jsxs)(r._s.Content,{"data-slot":"drawer-content",className:(0,l.cn)("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",t),...n,children:[(0,s.jsx)("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),a]})]})}function m(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"drawer-header",className:(0,l.cn)("flex flex-col gap-1.5 p-4",t),...a})}function p(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"drawer-footer",className:(0,l.cn)("mt-auto flex flex-col gap-2 p-4",t),...a})}function x(e){let{className:t,...a}=e;return(0,s.jsx)(r._s.Title,{"data-slot":"drawer-title",className:(0,l.cn)("text-foreground font-semibold",t),...a})}},82821:(e,t,a)=>{a.d(t,{AM:()=>n,Wv:()=>i,dT:()=>d,hl:()=>o});var s=a(76947);a(98547);var r=a(31319),l=a(50021);function n(e){let{...t}=e;return(0,s.jsx)(r.bL,{"data-slot":"popover",...t})}function i(e){let{...t}=e;return(0,s.jsx)(r.l9,{"data-slot":"popover-trigger",...t})}function o(e){let{className:t,align:a="center",sideOffset:n=4,...i}=e;return(0,s.jsx)(r.ZL,{children:(0,s.jsx)(r.UC,{"data-slot":"popover-content",align:a,sideOffset:n,className:(0,l.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...i})})}function d(e){let{...t}=e;return(0,s.jsx)(r.Mz,{"data-slot":"popover-anchor",...t})}},84186:(e,t,a)=>{a.d(t,{DialogueEditor:()=>x});var s=a(76947),r=a(23894),l=a(64156),n=a(15428),i=a(54328),o=a(19165),d=a(50021),c=a(73287),u=a(94076),m=a(98547),p=a(56864);let x=(0,m.forwardRef)(function(e,t){let{lines:a,onChange:x,disabled:h,maxLines:f=20}=e,g=(0,u.c3)("Generator.textToSpeech"),b=(0,m.useRef)(0),v=(0,m.useRef)(new Map),j=(0,m.useCallback)(()=>"undefined"!=typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():"line-".concat(Date.now(),"-").concat(Math.random().toString(16).slice(2)),[]),y=a.reduce((e,t)=>
1e+t.text.trim().length,0),w=y>o.To;(0,m.useImperativeHandle)(t,()=>({insertTagToFocusedLine:e=>{var t;let s=b.current;if(s<0||s>=a.length)return;let r=v.current.get(s),l=a[s].text,n="[".concat(e,"] "),i=r&&null!=(t=r.selectionStart)?t:l.length,o=l.slice(0,i)+n+l.slice(i),d=[...a];d[s]={...d[s],text:o},x(d);let c=i+n.length;requestAnimationFrame(()=>{let e=v.current.get(s);e&&(e.focus(),e.setSelectionRange(c,c))})}}));let N=(0,m.useCallback)((e,t)=>{let s=[...a];s[e]={...s[e],...t},x(s)},[a,x]),C=(0,m.useCallback)(()=>{var e;if(a.length>=f)return;let t=(null==(e=a[a.length-1])?void 0:e.voice)||"";x([...a,{id:j(),text:"",voice:t}])},[j,a,x,f]),k=(0,m.useCallback)(e=>{if(!(a.length<=1)){if(x(a.filter((t,a)=>a!==e)),b.current===e){b.current=Math.max(0,e-1);return}b.current>e&&(b.current-=1)}},[a,x]),L=(0,m.useCallback)((e,t)=>{t?v.current.set(e,t):v.current.delete(e)},[]);return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)(n.J,{className:"text-sm font-medium",children:g("dialogue")}),(0,s.jsxs)("span",{className:(0,d.cn)("text-xs",w?"text-destructive font-medium":"text-muted-foreground"),children:[y.toLocaleString()," /"," ",o.To.toLocaleString()]})]}),(0,s.jsx)("div",{className:"space-y-3",children:a.map((e,t)=>(0,s.jsx)(l.Zp,{className:"py-0",children:(0,s.jsxs)(l.Wu,{className:"p-4 space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsxs)("div",{className:"text-sm font-medium",children:[g("dialogue")," ",t+1]}),a.length>1&&(0,s.jsx)(r.$,{type:"button",variant:"outline",size:"sm",className:"h-8",onClick:()=>k(t),disabled:h,children:g("removeLine")})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.J,{className:"text-sm font-medium",children:g("text")}),(0,s.jsx)(i.T,{ref:e=>L(t,e),value:e.text,onChange:e=>N(t,{text:e.target.value}),onFocus:()=>{b.current=t},placeholder:g("dialogueExamples.line".concat(Math.min(t+1,3))),disabled:h,className:"min-h-[92px] resize-none text-sm",rows:3}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:g("dialogueTextHelper")})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.J,{className:"text-sm font-medium",children:g("voice")}),(0,s.jsx)(p.VoiceSelector,{value:e.voice,onChange:e=>N(t,{voice:e}),disabled:h}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:g("dialogueVoiceHelper")})]})]})},e.id))}),(0,s.jsxs)(r.$,{type:"button",variant:"outline",size:"sm",className:"w-full",onClick:C,disabled:h||a.length>=f,children:[(0,s.jsx)(c.A,{className:"w-3.5 h-3.5 mr-1.5"}),g("addLine")]})]})})},84710:(e,t,a)=>{a.d(t,{GenerateButton:()=>d});var s=a(76947),r=a(23894),l=a(50021),n=a(10468),i=a(79627),o=a(81183);let d=a(98547).forwardRef((e,t)=>{let{onClick:a,isLoading:d,disabled:c,variant:u="cta",creditsRequired:m,creditsText:p,creditLabel:x,modelName:h="Generate",label:f,loadingLabel:g,icon:b,showCredits:v=!0,className:j,...y}=e,w=null!=b?b:(0,s.jsx)(n.A,{className:"w-4 h-4 mr-2"}),N=null!=p?p:"number"==typeof m?null!=x?x:"".concat(m," credit").concat(1===m?"":"s"):"";return(0,s.jsx)(r.$,{ref:t,type:"button",size:"lg",variant:u,className:(0,l.cn)("w-full h-12 text-base font-medium",j),onClick:a,disabled:c||d,...y,children:d?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.A,{className:"w-4 h-4 mr-2 animate-spin"}),(0,s.jsx)("span",{children:null!=g?g:"Generating..."})]}):(0,s.jsxs)(s.Fragment,{children:[w,(0,s.jsx)("span",{children:null!=f?f:h}),v&&("number"==typeof m||!!p)&&(0,s.jsxs)("span",{className:"ml-2 flex items-center gap-1 text-sm opacity-80",children:[(0,s.jsx)(o.A,{className:"w-3.5 h-3.5"}),(0,s.jsx)("span",{children:N})]})]})})});d.displayName="GenerateButton"},86712:(e,t,a)=>{a.d(t,{OutputCountStepper:()=>m});var s=a(76947),r=a(23894),l=a(78110),n=a(15428),i=a(50021),o=a(86237),d=a(73287),c=a(94076),u=a(98547);function m(e){let{value:t,onChange:a,min:m=1,max:p=10,disabled:x=!1,className:h}=e,f=(0,c.c3)("Generator.common"),g=(0,u.useId)(),[b,v]=(0,u.useState)(!1),j=e=>{v(!1);let s=Math.max(m,Math.min(p,Math.trunc(e)));s!==t&&a(s)};return(0,s.jsxs)("div",{className:(0,i.cn)("flex items-center justify-between gap-3",h),children:[(0,s.jsx)(n.J,{htmlFor:g,className:"text-sm font-medium",children:f("outputNumber")}),(0,s.jsxs)("div",{className:"flex h-8 w-[120px] shrink-0 items-center overflow-hidden rounded-full border border-input bg-background focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/50",children:[(0,s.jsx)(r.$,{type:"button",variant:"ghost",className:"h-full w-9 shrink-0 rounded-none p-0 active:scale-100","aria-label":f("decreaseOutputNumber"),disabled:x||t<=m,onClick:()=>j(t-1),children:(0,s.jsx)(o.A,{className:"size-3.5"})}),(0,s.jsx)(l.p,{id:g,type:"number",inputMode:"numeric",min:m,max:p,step:1,value:b?"":t,disabled:x,className:"h-full min-w-0 rounded-none border-0 border-x border-input bg-transparent p-0 text-center text-sm shadow-none [appearance:textfield] focu
1s-visible:ring-0 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",onChange:e=>{if(""===e.target.value)return void v(!0);let t=e.target.valueAsNumber;Number.isFinite(t)&&j(t)},onBlur:()=>v(!1),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),e.currentTarget.blur())}}),(0,s.jsx)(r.$,{type:"button",variant:"ghost",className:"h-full w-9 shrink-0 rounded-none p-0 active:scale-100","aria-label":f("increaseOutputNumber"),disabled:x||t>=p,onClick:()=>j(t+1),children:(0,s.jsx)(d.A,{className:"size-3.5"})})]})]})}},87713:(e,t,a)=>{a.d(t,{Tm:()=>s,l1:()=>r});let s=[{id:"runwayml/gen4-aleph",name:"Runway Gen-4 Aleph",provider:"Runway",description:"Prompt-based video edits on short clips",estimatedTime:"2-10 min",credits:a(49780).Hp}];function r(){return s[0]}},88125:(e,t,a)=>{a.d(t,{L:()=>n});var s=a(76947),r=a(50021),l=a(77077);function n(e){let{ariaLabel:t,className:a,disabled:n,onClick:i}=e;return(0,s.jsx)("button",{type:"button",className:(0,r.cn)("inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-black/75 text-white shadow-md transition-colors hover:bg-destructive focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-destructive focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",a),onClick:i,disabled:n,"aria-label":t,children:(0,s.jsx)(l.A,{className:"h-4 w-4"})})}},88168:(e,t,a)=>{a.d(t,{h:()=>s.AspectRatioSelector,IM:()=>B.AudioTagsPanel,Te:()=>p.AudioUploader,jR:()=>x.AvatarCharacterPicker,RK:()=>h.AvatarScriptPresets,km:()=>P.DialogueEditor,s$:()=>r.DurationSelector,li:()=>l.FrameImageUploader,CJ:()=>c.GenerateButton,W9:()=>d,X4:()=>u.GeneratorRouteTabs,TQ:()=>r.HappyHorseDurationSelector,vV:()=>r.HappyHorseResolutionSelector,LM:()=>_.LM,yL:()=>_.yL,wG:()=>_.wG,DT:()=>_.DT,GA:()=>f.ImageUploader,I$:()=>r.Kling30DurationSelector,fi:()=>r.Kling30ModeSelector,rM:()=>r.KlingDurationSelector,qj:()=>O.KlingElementsEditor,wK:()=>H.KlingMultiShotEditor,Gv:()=>G.LanguageSelector,M0:()=>j.ModelDropdownSelector,Yd:()=>g.MotionControlModelSelector,K2:()=>w.OutputCountStepper,_P:()=>y.OutputFormatSelector,Pl:()=>N.PromptInput,qZ:()=>C.PromptStyleControls,HX:()=>D.ReferenceDocumentUploader,VG:()=>k.ReferenceImageUploader,YW:()=>I.ReferenceLinkInput,o9:()=>M.ReferenceMediaUploader,ex:()=>A,Mk:()=>F.ResolutionSelector,dO:()=>T.SeedControl,EC:()=>r.SeedanceDurationSelector,_m:()=>r.VariableDurationSelector,ym:()=>r.VeoDurationSelector,qz:()=>r.VeoResolutionSelector,jo:()=>b.VideoEditorModelSelector,Ng:()=>R.VideoModelDropdownSelector,At:()=>U.VideoQualitySelector,qN:()=>v.VideoUploader,sD:()=>r.WanDurationSelector,sU:()=>r.WanResolutionSelector,wu:()=>m.w,mA:()=>j.getModelInfo,nQ:()=>R.getVideoModelInfo,U_:()=>z.useSequentialQueue,yI:()=>E.useTaskQueue});var s=a(26991),r=a(30896),l=a(24355),n=a(76947),i=a(64156),o=a(50021);function d(e){let{children:t,footer:a,className:s,bodyClassName:r,footerClassName:l}=e;return(0,n.jsx)(i.Zp,{className:(0,o.cn)("h-full overflow-hidden py-0",s),children:(0,n.jsxs)(i.Wu,{className:"flex h-full min-h-0 flex-col p-0",children:[(0,n.jsx)("div",{className:(0,o.cn)("flex-1 min-h-0 overflow-y-auto p-4",r),children:t}),(0,n.jsx)("div",{className:(0,o.cn)("border-t bg-background px-4 py-3",l),children:(0,n.jsx)("div",{className:"space-y-1",children:a})})]})})}var c=a(84710),u=a(23753),m=a(7483),p=a(56513),x=a(58764),h=a(29496),f=a(3468);a(39951);var g=a(64208),b=a(10506),v=a(1630),j=a(70026),y=a(14106),w=a(86712),N=a(99367),C=a(37810);a(69081);var k=a(13411),L=a(1279),S=a(36083);function A(e){let{href:t,description:a,title:s,onClick:r}=e;return(0,n.jsxs)(L.XO,{href:t,onClick:r,className:"group flex min-w-0 items-center gap-3 rounded-lg border bg-muted/30 px-4 py-3 transition-colors hover:border-primary/40 hover:bg-primary/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"block text-xs leading-5 text-muted-foreground",children:a}),(0,n.jsx)("span",{className:"mt-0.5 block text-sm font-medium leading-5 text-foreground",children:s})]}),(0,n.jsx)(S.A,{className:"size-4 shrink-0 text-muted-foreground transition-all group-hover:translate-x-0.5 group-hover:text-foreground","aria-hidden":"true"})]})}var M=a(22960),D=a(98335),I=a(47644),F=a(24854),T=a(80507),z=a(39680),E=a(35622);a(26693);var _=a(94907),R=a(31023),U=a(13092);a(56864);
1var G=a(45463),B=a(32861),P=a(84186),H=a(71458),O=a(67078)},90215:(e,t,a)=>{a.d(t,{Ks:()=>d,TF:()=>l,Ul:()=>r,iD:()=>o,jy:()=>i,pk:()=>n});var s=a(50021);function r(e){let{open:t,disabled:a}=e;return(0,s.cn)("group w-full justify-between h-auto py-3 px-4","border-primary/55 bg-background ring-2 ring-primary/25","shadow-[0_0_0_1px_color-mix(in_oklch,var(--primary)_18%,transparent),0_0_18px_color-mix(in_oklch,var(--primary)_28%,transparent)]","hover:border-primary/70 hover:bg-primary/[0.035] hover:ring-primary/35 hover:shadow-[0_0_0_2px_color-mix(in_oklch,var(--primary)_24%,transparent),0_0_24px_color-mix(in_oklch,var(--primary)_36%,transparent)]","focus-visible:ring-2 focus-visible:ring-primary/40",t&&"border-primary/75 bg-primary/[0.04] ring-primary/40 shadow-[0_0_0_2px_color-mix(in_oklch,var(--primary)_28%,transparent),0_0_28px_color-mix(in_oklch,var(--primary)_42%,transparent)]",a&&"opacity-50 cursor-not-allowed")}let l="h-4 w-4 text-primary drop-shadow-[0_0_5px_color-mix(in_oklch,var(--primary)_55%,transparent)] transition-[filter,color] duration-200 group-hover:drop-shadow-[0_0_7px_color-mix(in_oklch,var(--primary)_70%,transparent)]";function n(e){return(0,s.cn)("h-4 w-4 text-muted-foreground transition-all duration-200 group-hover:text-primary",e&&"rotate-180 text-primary")}function i(e){return(0,s.cn)("relative flex items-center gap-3 py-3 px-3 cursor-pointer border border-transparent transition-all",e&&"border-primary/50 bg-background ring-1 ring-primary/25 text-foreground shadow-[0_0_14px_color-mix(in_oklch,var(--primary)_20%,transparent)] data-[selected=true]:bg-background data-[selected=true]:text-foreground")}let o="absolute left-0 top-2 bottom-2 w-0.5 rounded-r bg-primary shadow-[0_0_10px_color-mix(in_oklch,var(--primary)_65%,transparent)]";function d(e){return(0,s.cn)("w-5 h-5 rounded-full border-2 flex items-center justify-center flex-shrink-0",e?"border-primary bg-primary text-primary-foreground shadow-[0_0_10px_color-mix(in_oklch,var(--primary)_60%,transparent)]":"border-muted-foreground/30")}},91549:(e,t,a)=>{a.d(t,{A:()=>i});var s=a(76947),r=a(98547),l=a(40597),n=a(50021);function i(e){let{className:t,defaultValue:a,value:i,min:o=0,max:d=100,...c}=e,u=r.useMemo(()=>Array.isArray(i)?i:Array.isArray(a)?a:[o,d],[i,a,o,d]);return(0,s.jsxs)(l.bL,{"data-slot":"slider",defaultValue:a,value:i,min:o,max:d,className:(0,n.cn)("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",t),...c,children:[(0,s.jsx)(l.CC,{"data-slot":"slider-track",className:(0,n.cn)("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:(0,s.jsx)(l.Q6,{"data-slot":"slider-range",className:(0,n.cn)("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:u.length},(e,t)=>(0,s.jsx)(l.zi,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},t))]})}},92646:(e,t,a)=>{a.d(t,{d:()=>n});var s=a(76947);a(98547);var r=a(84807),l=a(50021);function n(e){let{className:t,...a}=e;return(0,s.jsx)(r.bL,{"data-slot":"switch",className:(0,l.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 dark:data-[state=checked]:bg-foreground inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:(0,s.jsx)(r.zi,{"data-slot":"switch-thumb",className:(0,l.cn)("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-background pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}},94441:(e,t,a)=>{a.d(t,{a:()=>r});var s=a(98547);function r(){let[e,t]=s.useState(void 0);return s.useEffect(()=>{let e=window.matchMedia("(max-width: ".concat(767,"px)")),a=()=>{t(window.innerWidth<768)};return e.addEventListener("change",a),t(window.innerWidth<768),()=>e.removeEventListener("change",a)},[]),!!e}},94907:(e,t,a)=>{a.d(t,{$J:()=>
1i,DT:()=>s,LM:()=>r,Lq:()=>o,aZ:()=>c,wG:()=>l,wk:()=>d,yL:()=>n});let s="none",r="none",l="none",n="none",i=[{id:"none",label:"No Style",emoji:"â"},{id:"ghibli",thumbnail:"/images/styles/ghibli.webp",label:"Ghibli",emoji:"\uD83C\uDF3F"},{id:"3d",thumbnail:"/images/styles/3d.webp",label:"3D",emoji:"\uD83E\uDDCA"},{id:"anime",thumbnail:"/images/styles/anime.webp",label:"Anime",emoji:"â©ï¸"},{id:"cartoon",thumbnail:"/images/styles/cartoon.webp",label:"Cartoon",emoji:"\uD83C\uDF88"},{id:"fantasy",thumbnail:"/images/styles/fantasy.webp",label:"Fantasy",emoji:"\uD83E\uDE84"},{id:"cyberpunk",thumbnail:"/images/styles/cyberpunk.webp",label:"Cyberpunk",emoji:"\uD83C\uDF03"},{id:"coloring-page",thumbnail:"/images/styles/coloring-page.webp",label:"Coloring Page",emoji:"âï¸"},{id:"painting",thumbnail:"/images/styles/painting.webp",label:"Painting",emoji:"\uD83D\uDDBCï¸"},{id:"pixel-art",thumbnail:"/images/styles/pixel-art.webp",label:"Pixel Art",emoji:"\uD83D\uDC7E"},{id:"sketch",thumbnail:"/images/styles/sketch.webp",label:"Sketch",emoji:"\uD83D\uDCDD"},{id:"realistic",thumbnail:"/images/styles/realistic.webp",label:"Realistic",emoji:"\uD83D\uDCF7"}],o=[{id:"none",label:"No Color",emoji:"â"},{id:"warm-tone",label:"Warm Tone",emoji:"\uD83D\uDD25"},{id:"cool-tone",label:"Cool Tone",emoji:"âï¸"},{id:"muted-colors",label:"Muted Colors",emoji:"\uD83C\uDF2Bï¸"},{id:"vibrant-colors",label:"Vibrant Colors",emoji:"\uD83C\uDF08"},{id:"pastel-colors",label:"Pastel Colors",emoji:"\uD83C\uDF38"},{id:"black-and-white",label:"Black and White",emoji:"\uD83D\uDDA4"}],d=[{id:"none",label:"No Lighting",emoji:"â"},{id:"backlight",label:"Backlight",emoji:"\uD83C\uDF05"},{id:"dramatic",label:"Dramatic",emoji:"\uD83C\uDFAD"},{id:"volumetric",label:"Volumetric",emoji:"\uD83D\uDCA8"},{id:"crepuscular-rays",label:"Crepuscular Rays",emoji:"\uD83C\uDF24ï¸"},{id:"studio",label:"Studio",emoji:"\uD83D\uDCA1"},{id:"sunlight",label:"Sunlight",emoji:"âï¸"},{id:"low-light",label:"Low Light",emoji:"\uD83C\uDF19"},{id:"rim-lighting",label:"Rim Lighting",emoji:"â¨"},{id:"golden-hour",label:"Golden Hour",emoji:"\uD83C\uDF07"}],c=[{id:"none",label:"No Composition",emoji:"â"},{id:"blurry-background",label:"Blurry Background",emoji:"\uD83C\uDF00"},{id:"close-up",label:"Close Up",emoji:"\uD83D\uDD0D"},{id:"wide-angle",label:"Wide Angle",emoji:"\uD83D\uDCD0"},{id:"narrow-depth-of-field",label:"Narrow Depth of Field",emoji:"\uD83C\uDFAF"},{id:"shot-from-below",label:"Shot from Below",emoji:"â¬ï¸"},{id:"shot-from-above",label:"Shot from Above",emoji:"â¬ï¸"},{id:"macrophotography",label:"Macro Photo",emoji:"\uD83D\uDD2C"}]},98335:(e,t,a)=>{a.d(t,{ReferenceDocumentUploader:()=>j});var s=a(76947),r=a(50243),l=a(15428),n=a(39188),i=a(1777),o=a(2903),d=a(50021),c=a(11097),u=a(53076),m=a(79627),p=a(73287),x=a(15266),h=a(94411),f=a(94076),g=a(98547),b=a(23941),v=a(88125);function j(e){let{files:t,onFilesChange:a,label:j,helperText:y,formatHint:w,maxFiles:N=1,maxSizeBytes:C,accept:k=u.Z5,allowedMimeTypes:L=u.$D,disabled:S}=e,A=(0,f.c3)("Generator.upload"),M=(0,g.useId)(),D=(0,i.w)(),I=(0,n.z)({includeSearch:!0}),[F,T]=(0,g.useState)(!1),[z,E]=(0,g.useState)(!1),[_,R]=(0,g.useState)(!1),U=(0,g.useRef)(!1),G=t.length<N,B=(0,g.useCallback)(async e=>{if(S||z||U.current||!(null==e?void 0:e.length))return;let s=N-t.length;if(s<=0)return;let r=Array.from(e).slice(0,s).flatMap(e=>{let t=(0,u.sE)(e.name);return t&&L.includes(t)?e.size<=0||e.size>C?(b.o.error(A("fileTooLarge")),[]):[{file:e,contentType:t}]:(b.o.error(A("invalidFileType")),[])});if(0!==r.length){if(!(null==D?void 0:D.user))return void R(!0);U.current=!0,E(!0);try{var l;let e=await (0,o.W)(r,4,async e=>{let{file:t,contentType:a}=e;try{return{item:{url:(await (0,c.Q)(t,void 0,{purpose:"reference-document",allowFallback:!1,contentType:a})).url,name:t.name},error:null}}catch(e){return{item:null,error:e}}}),s=e.flatMap(e=>e.item?[e.item]:[]),n=null==(l=e.find(e=>e.error))?void 0:l.error;s.length>0&&a([...t,...s]),n&&b.o.error(A("uploadFailed"),{description:n instanceof Error?n.message:A("pleaseRetry")})}catch(e){console.error("[ReferenceDocumentUploader] Upload error:",e),b.o.error(A("uploadFailed"),{description:e instanceof Error?e.message:A("pleaseRetry")})}finally{U.current=!1,E(!1)}}},[S,t,z,L,N,C,a,null==D?void 0:D.user,A]),P=(0,s.jsxs)("div",{className:(0,d.cn)("flex min-h-[120px] flex-col items-center justify-center rounded-xl border-2 border-dashed transition-all",F?"border-primary bg-primary/5":"border-border hover:border-primary/50 hover:bg-accent/30",(S||z)&&"opacity-50"),onDrop:e=>{e.preventDefault(),T(!1),B(e.dataTransfer.files)},onDragOver:e=>{e.preventDefault(),S||z||T(!0)},onDragLeave:e=>{e.preventDefault(),T(!1)},children:[(0,s.jsxs)("label",{htmlFor:M,className:(0,d.cn)("flex w-full flex-1 cursor-pointer flex-col items-center justify-center",(S||z)&&"cursor-not-allowed"),children:[z?(0,s.jsx)(m.A,{className:"mb-2 h-5 w-5 animate-spin text-primary"}):t.length>0?(0,s.jsx)(p.A,{className:"mb-2 h-5 w-5 text-muted-foreground"}):(0,s.jsx)(x.A,{className:"mb-2 h-5 w-5 text-primary"}),(0,s.jsxs)("span",{className:"text-sm text-muted-foreground",children:[(0,s.jsx)("span",{className:"font-medium text-primary",children:z?A("uploading"):A("clickToUpload")})," ",!z&&A("orDragAndDrop")]})]}),w&&(0,s.jsx)("div",{className:"px-3 pb-3 text-center text-xs text-muted-foreground",children:w}),(0,s.jsx)("input",{id:M,type:"file",className:"hidden",accept:k,multiple:N>1,onChange:e=>void B(e.target.files),disabled:S||z})]});return(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)(l.J,{htmlFor:M,className:"text-sm font-medium",children:j}),y&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:y})]}),t.length>0&&(0,s.jsx)("div",{className:"space-y-2",children:t.map((e,r)=>(0,s.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border bg-muted/40 p-3",children:[(0,s.jsx)(h.A,{className:"h-5 w-5 shrink-0 text-primary"}),(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm",title:e.name,children:e.name}),(0,s.jsx)(v.L,{onClick:()=>a(t.filter((e,t)=>
1t!==r)),disabled:S||z,ariaLabel:A("remove")})]},"".concat(e.url,"-").concat(r)))}),G&&P,(0,s.jsx)(r.n,{mode:"modal",open:_,onOpenChange:R,callbackUrl:I})]})}},99367:(e,t,a)=>{a.d(t,{PromptInput:()=>g});var s=a(76947),r=a(50243),l=a(23894),n=a(15428),i=a(92646),o=a(54328),d=a(41303),c=a(50021),u=a(81591),m=a(77077),p=a(194),x=a(31043),h=a(94076),f=a(98547);function g(e){let{value:t,onChange:a,disabled:g,placeholder:b,maxLength:v=5e3,translatePrompt:j=!1,onTranslatePromptChange:y,showTranslateToggle:w=!0,enhancePrompt:N=!1,onEnhancePromptChange:C,showEnhanceToggle:k=!1,onUndoEnhancement:L,isEnhancementAuthenticated:S=!1,enhancementCallbackUrl:A,tooltip:M,label:D,required:I=!1,minHeightClassName:F="min-h-[120px]",footerStart:T}=e,z=(0,h.c3)("Generator.common"),E=(0,f.useId)(),_="".concat(E,"-enhance-prompt"),R="".concat(E,"-translate-prompt"),[U,G]=(0,f.useState)(!1),B=t.length>0,P=w&&!k;return(0,s.jsxs)("div",{className:"space-y-2",children:[k&&!S&&(0,s.jsx)(r.n,{mode:"modal",callbackUrl:A,open:U,onOpenChange:G}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)(n.J,{className:"gap-0 text-sm font-medium",children:[null!=D?D:z("prompt"),I&&(0,s.jsx)("span",{className:"ml-1 text-destructive","aria-hidden":"true",children:"*"})]}),M&&(0,s.jsxs)(d.m_,{children:[(0,s.jsx)(d.k$,{asChild:!0,children:(0,s.jsx)("button",{type:"button",className:"text-muted-foreground transition-colors hover:text-foreground",children:(0,s.jsx)(u.A,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(d.ZI,{className:"max-w-xs",children:(0,s.jsx)("p",{children:M})})]})]}),(P||k||B)&&(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[B&&(0,s.jsx)("button",{type:"button",onClick:()=>a(""),disabled:g,className:"inline-flex h-6 w-6 items-center justify-center rounded-full text-muted-foreground transition-colors ".concat(g?"cursor-not-allowed opacity-50":"hover:bg-muted"),"aria-label":z("clearPrompt"),children:(0,s.jsx)(m.A,{className:"h-3.5 w-3.5"})}),k&&L&&(0,s.jsxs)(l.$,{type:"button",variant:"ghost",size:"sm",onClick:L,disabled:g,className:"h-7 gap-1 px-2 text-xs text-muted-foreground",children:[(0,s.jsx)(p.A,{className:"h-3.5 w-3.5"}),z("undoEnhancement")]}),k&&(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)(d.m_,{children:[(0,s.jsx)(d.k$,{asChild:!0,children:(0,s.jsxs)(n.J,{htmlFor:_,className:"inline-flex cursor-pointer items-center gap-1.5 text-sm text-muted-foreground",children:[(0,s.jsx)(x.A,{className:"h-3.5 w-3.5"}),z("enhancePrompt")]})}),(0,s.jsx)(d.ZI,{className:"max-w-xs",children:(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"block",children:z("enhancePromptTooltip")}),(0,s.jsx)("span",{className:"block",children:z("enhancePromptTooltipHint")})]})})]}),(0,s.jsx)(i.d,{id:_,checked:S&&N,onCheckedChange:e=>{if(!S)return void G(!0);null==C||C(e)},disabled:g})]}),P&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.J,{htmlFor:R,className:"cursor-pointer text-sm text-muted-foreground",children:z("translatePrompt")}),(0,s.jsx)(i.d,{id:R,checked:j,onCheckedChange:y,disabled:g})]})]})]}),(0,s.jsx)(o.T,{value:t,onChange:e=>a(e.target.value.slice(0,v)),placeholder:b||z("defaultImagePlaceholder"),disabled:g,className:(0,c.cn)("resize-none",F),maxLength:v,required:I,"aria-required":I}),T?(0,s.jsxs)("div",{className:"flex min-h-7 items-center justify-between gap-3 text-xs text-muted-foreground",children:[(0,s.jsx)("div",{className:"min-w-0",children:T}),(0,s.jsxs)("span",{className:"shrink-0",children:[t.length," / ",v]})]}):(0,s.jsxs)("p",{className:"text-right text-xs text-muted-foreground",children:[t.length," / ",v]})]})}}}]);
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.