PageSourceSearch

https://seela.ai/_next/static/chunks/app/%5Blocale%5D/(app)/text-t…?dpl=dpl_5HuU1wW926ev5cRxGiwmjVnrJmsG

js seela.ai collected 2026-10-05 12:40:06 UTC 204,179 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6658,8074],{2428:(e,t,a)=>{Promise.resolve().then(a.bind(a,42255)),Promise.resolve().then(a.bind(a,20830)),Promise.resolve().then(a.bind(a,83491)),Promise.resolve().then(a.bind(a,65679)),Promise.resolve().then(a.bind(a,71493))},2779:(e,t,a)=>{"use strict";a.d(t,{d:()=>c});var s=a(15395),l=a(1657),i=a(50395),r=a(23557),n=a(17537),o=a(38117),d=a(3e4);let c=n.forwardRef((e,t)=>{var{className:a,thumbClassName:n}=e,c=(0,i._)(e,["className","thumbClassName"]);return(0,r.jsx)(o.bL,(0,l._)((0,s._)({className:(0,d.cn)("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-muted-foreground/70",a)},c),{ref:t,children:(0,r.jsx)(o.zi,{className:(0,d.cn)("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",n)})}))});c.displayName=o.bL.displayName},2870:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});var s=a(15395),l=a(23557),i=a(3e4),r=a(17537);function n(e){let{children:t,onClick:a,className:n="",style:o}=e,d=(0,r.useId)().replace(/:/g,""),[c,u]=(0,r.useState)(!1);return(0,l.jsxs)("button",{onClick:a,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),className:(0,i.cn)("relative px-10 lg:px-11 h-14 rounded-full text-nowrap text-white text-base font-medium transition-all duration-500 font-inter isolate",n),style:(0,s._)({background:c?"linear-gradient(to bottom, #4f46e5, rgba(99, 102, 241, 0.8))":"linear-gradient(to bottom, rgba(79, 93, 245, 0.8), rgba(79, 93, 245, 0.6))",boxShadow:c?"0px 0px 24px 6px rgba(79, 93, 245, 0.5)":"0px 0px 32px 0px rgba(79, 93, 245, 0.3)"},o),children:[(0,l.jsx)("span",{className:"absolute inset-0 rounded-full pointer-events-none transition-opacity duration-500",style:{border:"".concat(2,"px solid #4b98ff"),opacity:+!c}}),(0,l.jsx)("span",{className:"absolute rounded-full pointer-events-none transition-opacity duration-500",style:{inset:"-".concat(3,"px"),border:"".concat(5,"px solid rgba(255, 255, 255, 0.2)"),opacity:+!!c}}),(0,l.jsxs)("span",{className:"absolute inset-0 rounded-full overflow-hidden pointer-events-none transition-opacity duration-500",style:{opacity:+!!c},children:[(0,l.jsx)("span",{className:"absolute left-0 top-0 bottom-0 w-[30%]",style:{background:"linear-gradient(to right, rgba(37, 99, 235, 0.8), transparent)",filter:"blur(8px)"}}),(0,l.jsx)("span",{className:"absolute right-0 top-0 bottom-0 w-[30%]",style:{background:"linear-gradient(to left, rgba(37, 99, 235, 0.8), transparent)",filter:"blur(8px)"}}),(0,l.jsx)("span",{className:"absolute left-[15%] right-[25%] bottom-[8%] h-[25%]",style:{background:"linear-gradient(to right, #4338ca, #7c3aed, #a78bfa, #ddd6fe)",filter:"blur(12px)",animation:"glow1-".concat(d," 2s ease-in-out infinite")}}),(0,l.jsx)("span",{className:"absolute right-[12%] bottom-[5%] w-[25%] h-[30%]",style:{background:"radial-gradient(ellipse at center, rgba(229, 231, 235, 0.9) 0%, transparent 70%)",filter:"blur(10px)",animation:"glow2-".concat(d," 2.3s ease-in-out infinite 0.5s")}})]}),(0,l.jsx)("span",{className:"relative z-10",children:t}),(0,l.jsx)("span",{className:"absolute pointer-events-none rounded-full overflow-hidden",style:{inset:0,mask:"\n            linear-gradient(#fff 0 0) content-box,\n            linear-gradient(#fff 0 0)\n          ",maskComposite:"exclude",WebkitMaskComposite:"xor",padding:"".concat(2,"px")},children:(0,l.jsxs)("span",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-[400px] h-[400px] block",style:{animation:"spin-".concat(d," 3s linear infinite")},children:[(0,l.jsx)("span",{className:"absolute inset-0 block",style:{background:"conic-gradient(\n                from 0deg at 50% 50%,\n                #60a5fa 0deg,\n                #60a5fa ".concat(60,"deg,\n                transparent ").concat(60,"deg,\n                transparent 360deg\n              )")}}),(0,l.jsx)("span",{className:"absolute inset-0 block",style:{background:"conic-gradient(\n                from 0deg at 50% 50%,\n                rgba(255,255,255,0) 0deg,\n                rgba(255,255,255,1) ".concat(30,"deg,\n                rgba(255,255,255,0) ").concat(60,"deg,\n                transparent ").concat(60,"deg,\n                transparent 360deg\n              )")}})]})}),(0,l.jsx)("style",{dangerouslySetInnerHTML:{__html:"\n        @keyframes spin-".concat(d," {\n          from {\n            transform: translate(-50%, -50%) rotate(0deg);\n          }\n          to {\n            transform: translate(-50%, -50%) rotate(360deg);\n          }\n        }\n        @keyframes glow1-").concat(d," {\n          0%, 100% {\n            opacity: 0.9;\n          }\n          50% {\n            opacity: 1;\n          }\n        }\n        @keyframes glow2-").concat(d," {\n          0%, 100% {\n            opacity: 0.8;\n          }\n          50% {\n            opacity: 1;\n          }\n        }\n      ")}})]})}},7502:(e,t,a)=>{"use strict";a.d(t,{FT:()=>d,HY:()=>x,Kr:()=>u,Sv:()=>o,cz:()=>m});var s=a(15395),l=a(50395),i=a(23557),r=a(90287),n=a(3e4);function o(e){var{className:t}=e,a=(0,l._)(e,["className"]);return(0,i.jsx)("div",(0,s._)({"data-slot":"empty",className:(0,n.cn)("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 text-balance rounded-lg border-dashed p-6 text-center md:p-12",t)},a))}function d(e){var{className:t}=e,a=(0,l._)(e,["className"]);return(0,i.jsx)("div",(0,s._)({"data-slot":"empty-header",className:(0,n.cn)("flex max-w-sm flex-col items-center gap-2 text-center",t)},a))}let c=(0,r.F)("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6"}},defaultVariants:{variant:"default"}});function u(e){var{className:t,variant:a="default"}=e,r=(0,l._)(e,["className","variant"]);return(0,i.jsx)("div",(0,s._)({"data-slot":"empty-icon","data-variant":a,className:(0,n.cn)(c({variant:a,className:t}))},r))}function m(e){var{className:t}=e,a=(0,l._)(e,["className"]);return(0,i.jsx)("div",(0,s._)({"data-slot":"empty-title",className:(0,n.cn)("text-lg font-medium tracking-tight",t)},a))}function x(e){var{className:t}=e,a=(0,l._)(e,["className"]);return(0,i.jsx)("div",(0,s._)({"data-slot":"empty-content",className:(0,n.cn)("flex w-full min-w-0 max-w-sm flex-col items-center gap-4 text-balance text-sm",t)},a))}},13958:(e,t,a)=>{"use strict";a.d(t,{R:()=>d});var s=a(15395),l=a(1657),i=a(50395),r=a(23557),n=a(17537),o=a(3e4);let d=n.forwardRef((e,t)=>
1{var{className:a,children:n}=e,d=(0,i._)(e,["className","children"]);return(0,r.jsx)("button",(0,l._)((0,s._)({ref:t,style:{backgroundImage:"url('/button-bg.png')",backgroundSize:"110% 100%",backgroundPosition:"center",backgroundRepeat:"no-repeat"},className:(0,o.cn)("relative inline-flex items-center justify-center gap-2","h-8 px-3 py-2","rounded-[2rem] text-sm font-semibold text-white","overflow-visible","transition-all duration-300","focus-visible:outline-none md:focus-visible:ring-2 md:focus-visible:ring-ring md:focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50","active:scale-95","border-1.5","hover:scale-[1.02]","shadow-[0_8px_32px_rgba(83,113,255,0.5)] hover:shadow-[0_12px_48px_rgba(83,113,255,0.6)]","before:absolute before:inset-[-3px] before:rounded-[2rem]","before:bg-[linear-gradient(45deg,#ff0000,#ff7300,#fffb00,#48ff00,#00ffd5,#002bff,#7a00ff,#ff00c8,#ff0000)]","before:bg-[length:400%]","before:opacity-0 before:blur-[8px]","before:animate-[rainbow-glow_20s_linear_infinite]","before:transition-opacity before:duration-400","hover:before:opacity-100","before:-z-10",a)},d),{children:(0,r.jsx)("span",{className:"relative z-10",children:n})}))});d.displayName="UpgradeButton"},14550:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var s=a(23557),l=a(3e4);function i(e){let{children:t,className:a=""}=e;return(0,s.jsx)("h2",{className:(0,l.cn)("text-2xl md:text-4xl lg:text-5xl font-extrabold -tracking-tighter md:tracking-normal leading-10 text-center font-plus-jakarta",a),style:{background:"linear-gradient(-7.5398deg, rgb(146, 146, 146) 5.2985%, rgb(255, 255, 255) 75.313%), linear-gradient(-9.29331deg, rgba(255, 255, 255, 0.55) 0%, rgb(255, 255, 255) 100%)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text"},children:t})}},15399:(e,t,a)=>{"use strict";a.d(t,{GD:()=>o,QE:()=>r,gs:()=>n});var s=a(23557),l=a(17537),i=a(3e4);let r=e=>{let{value:t,onValueChange:a,children:r,className:n}=e;return(0,s.jsx)("div",{className:(0,i.cn)("w-full",n),children:l.Children.map(r,e=>l.isValidElement(e)?l.cloneElement(e,{value:t,onValueChange:a}):e)})},n=e=>{let{value:t,onValueChange:a,children:r,className:n}=e;return(0,s.jsx)("div",{className:(0,i.cn)("flex items-center gap-6 border-b",n),children:l.Children.map(r,e=>{if(l.isValidElement(e)){let s=e.props.value;return l.cloneElement(e,{isActive:s===t,onClick:s?()=>{null==a||a(s)}:e.props.onClick})}return e})})},o=e=>{let{value:t,isActive:a,onClick:l,children:r,className:n}=e;return(0,s.jsxs)("button",{type:"button",onClick:l,className:(0,i.cn)("relative pb-3 px-1 text-sm font-medium transition-colors","hover:text-foreground",a?"text-foreground":"text-muted-foreground",n),children:[r,a&&(0,s.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary rounded-full"})]})}},19662:(e,t,a)=>{"use strict";a.d(t,{G7:()=>u,L$:()=>p,h_:()=>h,oI:()=>m,uB:()=>c,xL:()=>x});var s=a(15395),l=a(50395),i=a(23557),r=a(17537),n=a(24494),o=a(53571),d=a(3e4);a(60095);let c=r.forwardRef((e,t)=>{var{className:a}=e,r=(0,l._)(e,["className"]);return(0,i.jsx)(n.uB,(0,s._)({ref:t,className:(0,d.cn)("flex h-full w-full flex-col overflow-hidden rounded-2xl bg-popover text-popover-foreground outline-none focus:outline-none focus-visible:outline-none",a)},r))});c.displayName=n.uB.displayName;let u=r.forwardRef((e,t)=>{var{className:a}=e,r=(0,l._)(e,["className"]);return(0,i.jsxs)("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[(0,i.jsx)(o.A,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,i.jsx)(n.uB.Input,(0,s._)({ref:t,className:(0,d.cn)("flex h-11 w-full rounded-xl bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",a)},r))]})});u.displayName=n.uB.Input.displayName;let m=r.forwardRef((e,t)=>{var{className:a}=e,r=(0,l._)(e,["className"]);return(0,i.jsx)(n.uB.List,(0,s._)({ref:t,className:(0,d.cn)("max-h-80 overflow-y-auto overflow-x-hidden outline-none focus:outline-none focus-visible:outline-none",a)},r))});m.displayName=n.uB.List.displayName;let x=r.forwardRef((e,t)=>
1(0,i.jsx)(n.uB.Empty,(0,s._)({ref:t,className:"py-6 text-center text-sm"},e)));x.displayName=n.uB.Empty.displayName;let p=r.forwardRef((e,t)=>{var{className:a}=e,r=(0,l._)(e,["className"]);return(0,i.jsx)(n.uB.Group,(0,s._)({ref:t,className:(0,d.cn)("overflow-hidden text-foreground  [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-4 [&_[cmdk-group-heading]]:text-[14px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",a)},r))});p.displayName=n.uB.Group.displayName,r.forwardRef((e,t)=>{var{className:a}=e,r=(0,l._)(e,["className"]);return(0,i.jsx)(n.uB.Separator,(0,s._)({ref:t,className:(0,d.cn)("-mx-1 h-px bg-border",a)},r))}).displayName=n.uB.Separator.displayName;let h=r.forwardRef((e,t)=>{var{className:a}=e,r=(0,l._)(e,["className"]);return(0,i.jsx)(n.uB.Item,(0,s._)({ref:t,className:(0,d.cn)("relative flex cursor-default gap-2 select-none items-center rounded-xl px-2 py-1.5 text-sm outline-none focus:outline-none focus-visible:outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",a)},r))});h.displayName=n.uB.Item.displayName},21687:(e,t,a)=>{"use strict";a.d(t,{r:()=>r});var s=a(23557),l=a(17537),i=a(19786);function r(e){let{children:t}=e,a=(0,i.n)(e=>e.hasToken),[r,n]=(0,l.useState)(!1);return((0,l.useEffect)(()=>{n(!0)},[]),r&&a)?null:(0,s.jsx)("div",{className:"w-full",id:"seo-content-section",children:t})}},40708:(e,t,a)=>{"use strict";a.d(t,{x:()=>r});var s=a(99891),l=a(51599),i=a(61007);function r(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],a=(0,l.Ym)();return(0,s.I)({queryKey:["videoModels",e,a],queryFn:()=>(0,i.me)({model_type:e}),staleTime:3e5,gcTime:6e5,retry:2,enabled:t})}},41633:(e,t,a)=>{"use strict";a.d(t,{T:()=>o});var s=a(15395),l=a(50395),i=a(23557),r=a(17537),n=a(3e4);let o=r.forwardRef((e,t)=>{var{className:a,maxLengthClassName:r}=e,o=(0,l._)(e,["className","maxLengthClassName"]);return(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsx)("textarea",(0,s._)({className:(0,n.cn)("flex min-h-20 w-full rounded-md border border-border bg-input/70 px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm appearance-none placeholder:text-muted-foreground/60",a),ref:t},o)),!!o.maxLength&&(0,i.jsx)("div",{className:(0,n.cn)("absolute right-[8px] bottom-[5px]",r),children:(0,i.jsxs)("span",{className:"text-xs text-muted-foreground/80 pointer-events-none",children:[String(o.value).length,"/",o.maxLength]})})]})});o.displayName="Textarea"},42255:(e,t,a)=>{"use strict";a.d(t,{default:()=>tP});var s=a(23557),l=a(17537),i=a(45527),r=a(7476),n=a(65288),o=a(53601),d=a(94842),c=a(62625),u=a(51648),m=a(21687),x=a(3338),p=a(92085),h=a(14550),g=a(64195),f=a(2870),v=a(73424),b=a(40708),j=a(45210),y=a(61007);function w(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],a=["videoDemo",e.parent_type_id];return(0,j.q)({queryKey:a,enabled:t,queryFn:async t=>{let{pageParam:a=1}=t,s={parent_type_id:e.parent_type_id,page:"number"==typeof a?a:1,size:100},l=await (0,y.Fk)(s);return{code:l.code,msg:l.msg,data:l.data}},getNextPageParam:e=>{let t=e.data;if(!(null==t?void 0:t.last))return((null==t?void 0:t.page)||1)+1},initialPageParam:1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1})}var N=a(22130),C=a(6211),k=a(70070),_=a(6055);function S(e){let{videos:t}=e,a=(0,i.c)(),r=(0,k.K)(e=>e.setCreateSimilarVideo),[n,o]=(0,l.useState)(0),d=(0,l.useRef)(new Map),c=(0,l.useRef)(null),[u,m]=(0,l.useState)(!1),[x,p]=(0,l.useState)(0),h=(0,l.useRef)(0);(0,l.useEffect)(()=>{if(0===t.length)return;if(u)return void d.current.forEach(e=>{e.pause()});let e=t[n];d.current.forEach((t,a)=>{a===(null==e?void 0:e.id)?t.play().catch(()=>{}):t.pause()})},[n,t,u]),(0,l.useEffect)(()=>
1{if(0===t.length)return;let e=t[n],a=d.current.get(null==e?void 0:e.id);if(!a)return;let s=()=>{o(e=>e===t.length-1?0:e+1)};return a.addEventListener("ended",s),()=>{a.removeEventListener("ended",s)}},[n,t]);let g=(0,l.useCallback)(()=>{o(e=>0===e?t.length-1:e-1)},[t.length]),f=(0,l.useCallback)(()=>{o(e=>e===t.length-1?0:e+1)},[t.length]),v=(0,l.useCallback)(e=>{m(!0),h.current=e,p(0)},[]),b=(0,l.useCallback)(e=>{u&&p(e-h.current)},[u]),j=(0,l.useCallback)(()=>{u&&(m(!1),Math.abs(x)>80&&(x>0?g():f()),p(0))},[u,x,g,f]),y=(0,l.useCallback)(e=>{e.preventDefault(),v(e.clientX)},[v]),w=(0,l.useCallback)(e=>{b(e.clientX)},[b]),S=(0,l.useCallback)(()=>{j()},[j]),M=(0,l.useCallback)(()=>{u&&j()},[u,j]),A=(0,l.useCallback)(e=>{v(e.touches[0].clientX)},[v]),T=(0,l.useCallback)(e=>{b(e.touches[0].clientX)},[b]),P=(0,l.useCallback)(()=>{j()},[j]),F=(0,l.useMemo)(()=>{if(0===t.length)return{prev:null,current:null,next:null};let e=0===n?t.length-1:n-1,a=n===t.length-1?0:n+1;return{prev:t[e],current:t[n],next:t[a]}},[t,n]);if(0===t.length)return(0,s.jsx)("div",{className:"w-full text-center text-white/50 py-40 border border-dashed border-white/20 rounded-xl",children:"Loading videos..."});let z=Math.max(-1,Math.min(1,x/250));return(0,s.jsxs)("div",{className:"w-full relative overflow-hidden",children:[(0,s.jsxs)("div",{ref:c,className:"relative flex items-center justify-center [--gap:5px] md:[--gap:20px] select-none",style:{height:"min(479px, 56.25vw)",cursor:u?"grabbing":"grab"},onMouseDown:y,onMouseMove:w,onMouseUp:S,onMouseLeave:M,onTouchStart:A,onTouchMove:T,onTouchEnd:P,children:[t.map((e,a)=>{let l,i,r=a-n,o=Math.floor(t.length/2);if(r>o&&(r-=t.length),r<-o&&(r+=t.length),Math.abs(r)>2)return null;let c=r+z,m=Math.abs(c);l=m<1?1-.21*m:.79-.09*Math.min(m-1,1),i=m<1?1-.3*m:Math.max(0,.7-(m-1)*.7);let x=m<.5,p=Math.min(.5,.5*m);return(0,s.jsxs)("div",{className:"absolute rounded-2xl overflow-hidden",style:{width:"min(851px, 85vw)",aspectRatio:"16/9",transform:"translateX(calc(".concat(m<1?89.5*c:(c>0?1:-1)*(89.5+(m-1)*30.5),"% + var(--gap) * ").concat(c<-.1?-1:+(c>.1),")) scale(").concat(l,")"),zIndex:m<.5?20:m<1.5?10:5,opacity:i,border:x?"1px solid rgba(255,255,255,0.5)":"1px solid rgba(255,255,255,0.2)",boxShadow:x?"0 25px 50px -12px rgba(0, 0, 0, 0.25)":"none",transition:u?"none":"transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1), opacity 0.4s cubic-bezier(0.25, 0.1, 0.25, 1), box-shadow 0.4s cubic-bezier(0.25, 0.1, 0.25, 1)"},children:[(0,s.jsx)("video",{ref:t=>{t?d.current.set(e.id,t):d.current.delete(e.id)},muted:!0,playsInline:!0,className:"absolute inset-0 w-full h-full object-cover",poster:e.coverUrl,children:(0,s.jsx)("source",{src:e.videoUrl,type:"video/mp4"})}),p>.01&&(0,s.jsx)("div",{className:"absolute inset-0 bg-black rounded-2xl pointer-events-none",style:{opacity:p,transition:u?"none":"opacity 0.4s cubic-bezier(0.25, 0.1, 0.25, 1)"}})]},e.id)}),(0,s.jsx)("button",{onClick:g,className:"hidden md:flex absolute top-1/2 -translate-y-1/2 z-30 w-12 h-12 rounded-full bg-white/10 backdrop-blur-sm border border-white/20 items-center justify-center hover:bg-white/20 transition-colors",style:{left:"calc(50% - min(851px, 85vw) / 2 - var(--gap) * 3 - 24px)"},"aria-label":"Previous video",children:(0,s.jsx)(N.A,{className:"w-6 h-6 text-white"})}),(0,s.jsx)("button",{onClick:f,className:"hidden md:flex absolute top-1/2 -translate-y-1/2 z-30 w-12 h-12 rounded-full bg-white/10 backdrop-blur-sm border border-white/20 items-center justify-center hover:bg-white/20 transition-colors",style:{right:"calc(50% - min(851px, 85vw) / 2 - var(--gap) * 3 - 24px)"},"aria-label":"Next video",children:(0,s.jsx)(C.A,{className:"w-6 h-6 text-white"})})]}),F.current&&(0,s.jsx)("div",{className:"mt-4 w-full max-w-[851px] mx-auto px-4",children:(0,s.jsxs)("div",{className:"relative group",children:[(0,s.jsx)("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 w-[620px] max-w-[calc(100vw-32px)] opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200 z-40",children:(0,s.jsx)("div",{className:"backdrop-blur-[25px] bg-[rgba(15,15,15,0.5)] border border-[rgba(255,255,255,0.1)] rounded-xl p-6",children:(0,s.jsx)("p",{className:"text-white/60 text-xs leading-[18px] whitespace-pre-wrap",children:F.current.prompt||"No prompt available"})})}),(0,s.jsxs)("div",{className:"w-full h-10 backdrop-blur-[15px] bg-[rgba(64,64,64,0.5)] rounded-xl px-4 flex items-center gap-3",children:[F.current.modelLogo?(0,s.jsx)("img",{src:F.current.modelLogo,alt:"Model",className:"w-6 h-6 shrink-0 rounded object-contain"}):(0,s.jsx)("div",{className:"w-6 h-6 shrink-0 rounded bg-white/20"}),(0,s.jsxs)("p",{className:"text-white/70 text-sm leading-6 truncate flex-1",children:[(0,s.jsx)("span",{className:"opacity-100",children:"Prompt:"}),F.current.prompt||"No prompt available"]}),(0,s.jsx)("button",{onClick:()=>{let e=F.current;e&&(r({prompt:e.prompt||"",videoModelId:e.videoModelId,modelDisplayName:e.modelDisplayName||"",modelLogo:e.modelLogo||"",ratio:e.aspectRatio||"",resolution:e.resolution||"",durationSeconds:e.durationSeconds||5,negativePrompt:e.negativePrompt,seed:e.seed,multiShots:e.multiSh
1ots,cameraFixed:e.cameraFixed,hasAudio:e.hasAudio,videoType:e.videoType,promptOptimizer:e.promptOptimizer}),_.toast.success(a("settingsApplied")));let t=document.getElementById("text-to-video-page-container");t?t.scrollTo({top:0,behavior:"smooth"}):window.scrollTo({top:0,behavior:"smooth"})},className:"shrink-0 h-7 px-3 bg-white border border-white text-black text-xs font-normal rounded-[8px] hover:bg-white/90 transition-colors",children:a("createSimilarVideo")})]})]})})]})}function M(e){let{step:t,title:a,description:l,children:i}=e;return(0,s.jsxs)("div",{className:"flex-1 relative rounded-b-xl rounded-t-3xl backdrop-blur-[12.5px]",style:{background:"rgba(35, 35, 35, 0.95)",boxShadow:"-1px 3px 6px 0px rgba(0,0,0,0.08), -3px 11px 11px 0px rgba(0,0,0,0.07), -7px 24px 15px 0px rgba(0,0,0,0.04), -13px 43px 18px 0px rgba(0,0,0,0.01)"},children:[(0,s.jsx)("div",{className:"absolute inset-0 rounded-b-xl rounded-t-3xl pointer-events-none",style:{padding:"1px",background:"conic-gradient(from 90deg at 50% 50%, rgba(108,108,108,0.23) 0deg, rgba(64,64,64,0.25) 10.52deg, rgba(64,64,64,0.18) 32.12deg, rgba(255,255,255,0.15) 60.28deg, rgba(255,255,255,0.15) 107.79deg, rgba(64,64,64,0.18) 187.59deg, rgba(249,249,249,0.25) 207.58deg, rgba(255,255,255,0.15) 287.31deg, rgba(249,249,249,0.15) 327.05deg, rgba(108,108,108,0.23) 360deg)",WebkitMask:"linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)",WebkitMaskComposite:"xor",maskComposite:"exclude"}}),(0,s.jsxs)("div",{className:"h-full w-full relative z-10 rounded-b-xl",children:[(0,s.jsx)("div",{className:"p-6 rounded-t-[20px] relative backdrop-blur-[6px] overflow-hidden min-h-[232px]",style:{background:"rgba(35, 35, 35, 0.95)",boxShadow:"inset 0px 0px 22px 0px rgba(242,242,242,0.05), inset 0px 0px 0px 1px rgba(166,166,166,0.15), inset 2px 2px 1px -2px rgba(102,102,102,0.3), inset -2px -2px 1px -2px rgba(102,102,102,0.3), inset 3px 3px 0.5px -3.5px rgba(255,255,255,0.5)"},children:i}),(0,s.jsxs)("div",{className:t?"p-6 pt-3":"p-6",children:[t&&(0,s.jsx)("p",{className:"opacity-90 text-white text-xl font-extrabold leading-8 font-inter",children:t}),(0,s.jsx)("h3",{className:"text-white text-lg font-bold mb-2 font-poppins",children:a}),(0,s.jsx)("p",{className:"opacity-50 text-white text-sm font-normal leading-5 font-inter",children:l})]})]})]})}function A(){var e;let t=(0,i.c)(),a=(0,x.rd)(),{data:r=[]}=(0,b.x)(1),{data:n}=w({parent_type_id:5},!0),o=()=>{let e=document.getElementById("text-to-video-page-container");e?e.scrollTo({top:0,behavior:"smooth"}):window.scrollTo({top:0,behavior:"smooth"})},d=(0,l.useMemo)(()=>{if(!(null==n?void 0:n.pages))return[];let e=[];return n.pages.forEach(t=>{var a;(null==(a=t.data)?void 0:a.content)&&t.data.content.forEach(t=>{var a;if("16:9"!==t.aspect_ratio)return;let s=null==(a=t.watermark_urls)?void 0:a[0];(null==s?void 0:s.url)&&e.push({id:s.id||t.group||"video-".concat(e.length),videoUrl:s.url,coverUrl:s.cover_url||"",prompt:t.prompt||"",modelLogo:t.model_logo||"",videoModelId:t.video_model_id,modelDisplayName:t.model_display_name||"",aspectRatio:t.aspect_ratio||"",resolution:t.resolution||"",durationSeconds:t.duration_seconds||5,negativePrompt:t.negative_prompt,seed:t.seed,multiShots:t.multi_shots,cameraFixed:t.camera_fixed,hasAudio:t.has_audio,videoType:t.video_type,promptOptimizer:t.prompt_optimizer})})}),e.slice(0,10)},[n]),c=[{title:t("videoSeoPremuimBenefit1Title"),description:t("videoSeoPremuimBenefit1Desc"),icon:"/images/image/benefits01.svg"},{title:t("videoSeoPremuimBenefit2Title"),description:t("videoSeoPremuimBenefit2Desc"),icon:"/images/image/benefits02.svg"},{title:t("videoSeoPremuimBenefit3Title"),description:t("videoSeoPremuimBenefit3Desc"),icon:"/images/image/benefits03.svg"}],u=[{title:t("videoSeoWhyChoosing1Title"),description:t("videoSeoWhyChoosing1Desc"),icon:"/images/video/why-choosing-01.svg"},{title:t("videoSeoWhyChoosing2Title"),description:t("videoSeoWhyChoosing2Desc"),icon:"/images/video/why-choosing-02.svg"},{title:t("videoSeoWhyChoosing3Title"),description:t("videoSeoWhyChoosing3Desc"),icon:"/images/video/why-choosing-03.svg"}],m=t.raw("textToVideoPageFaqs");return(0,s.jsxs)("div",{className:"w-full bg-black pb-20",children:[(0,s.jsxs)("section",{className:"w-full flex flex-col items-center justify-center py-16 md:py-24",children:[(0,s.jsxs)("div",{className:"px-4 lg:container flex flex-col items-center",children:[(0,s.jsx)(h.A,{className:"pb-6",children:t("videoSeoTopCarouselTitle")}),(0,s.jsx)(g.A,{className:"md:max-w-3xl mb-8",children:t("videoSeoTopCarouselDesc")})]}),(0,s.jsx)(S,{videos:d})]}),(0,s.jsxs)("section",{className:"w-full flex flex-col items-center justify-center px-4 lg:container py-16 md:py-24",children:[(0,s.jsx)(h.A,{className:"pb-6",children:t("videoSeoHeroTitle")}),(0,s.jsx)(g.A,{className:"md:max-w-3xl mb-8",children:t("videoSeoHeroDesc")}),r.length>0&&(0,s.jsx)("div",{className:"w-full grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 ga
1p-3 md:gap-4",children:r.map(e=>(0,s.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3 md:px-6 md:py-4 rounded-xl border border-[rgba(64,64,64,0.5)] bg-[rgba(255,255,255,0.05)] backdrop-blur-sm hover:bg-[rgba(255,255,255,0.08)] transition-colors cursor-pointer",children:[e.logo?(0,s.jsx)(p.default,{src:e.logo,alt:e.display_name,width:24,height:24,className:"object-contain flex-shrink-0"}):(0,s.jsx)("span",{className:"text-xl flex-shrink-0",children:"\uD83C\uDFAC"}),(0,s.jsx)("span",{className:"text-white text-sm font-medium whitespace-nowrap overflow-hidden text-ellipsis font-inter",children:e.display_name})]},e.id))}),(0,s.jsx)(f.A,{onClick:o,className:"mt-12",children:t("videoSeoHeroButton")})]}),(0,s.jsxs)("section",{className:"w-full flex flex-col items-center justify-center px-4 lg:container py-16 md:py-24",children:[(0,s.jsx)(h.A,{className:"pb-14",children:t("videoSeoHowToUseTitle")}),(0,s.jsxs)("div",{className:"flex flex-col md:flex-row gap-6 w-full mx-auto",children:[(0,s.jsxs)(M,{step:"STEP1",title:t("videoSeoStep1Title"),description:t("videoSeoStep1Desc"),children:[(0,s.jsxs)("div",{className:"h-32 relative border border-dashed border-white/20 rounded-xl p-5 mb-4",children:[(0,s.jsx)("p",{className:"text-white/30 text-sm font-inter leading-6",children:"rainy neon alley, slow walk forward, wet asphalt reflections, hard rim lighting..."}),(0,s.jsxs)("div",{className:"absolute bottom-3 left-5 flex items-center gap-1 text-white/30",children:[(0,s.jsx)(p.default,{src:"/images/video/steps/ai-generate-f2.svg",alt:"Optimize",width:16,height:16}),(0,s.jsx)("span",{className:"text-xs font-inter",children:t("optimizePrompt")})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 bg-white/15 rounded-[12px] px-3 py-2",children:[(0,s.jsx)(p.default,{src:"/images/video/steps/google-icon.svg",alt:"Google",width:18,height:18}),(0,s.jsx)("span",{className:"text-[#e2e2e2] text-xs font-inter",children:"Veo 3.1"}),(0,s.jsx)(p.default,{src:"/images/video/steps/arrow-down.svg",alt:"Arrow",width:16,height:16,className:"rotate-180"})]}),(0,s.jsxs)("button",{className:"flex items-center gap-2 px-5 py-2 rounded-[12px] text-[#0f0f0f] text-sm font-semibold font-inter transition-all hover:scale-105",style:{background:"linear-gradient(to top, #fff 0%, #999 100%)",border:"1px solid white"},children:[(0,s.jsx)(p.default,{src:"/images/video/steps/ai-generate-f1.svg",alt:"Generate",width:16,height:16}),t("generate")]})]})]}),(0,s.jsxs)(M,{step:"STEP2",title:t("videoSeoStep2Title"),description:t("videoSeoStep2Desc"),children:[(0,s.jsxs)("div",{className:"relative w-full h-[184px] rounded-xl overflow-hidden",children:[(0,s.jsx)(p.default,{src:"/images/video/steps/step2-preview.png",alt:"Video Preview",fill:!0,className:"object-cover"}),(0,s.jsx)("div",{className:"absolute inset-0 rounded-xl",style:{background:"linear-gradient(to left, rgba(0,0,0,0.7), rgba(119,119,119,0.28) 53%, rgba(255,255,255,0.7))"}}),(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,s.jsx)(p.default,{src:"/images/video/steps/sparkle.png",alt:"Sparkle",width:22,height:22,className:"opacity-80"})})]}),(0,s.jsxs)("div",{className:"absolute bottom-10 right-10 flex items-center gap-1",children:[(0,s.jsx)(p.default,{src:"/images/video/steps/generating-icon.svg",alt:"Generating",width:24,height:24}),(0,s.jsx)("span",{className:"text-sm font-semibold font-inter text-white",style:{textShadow:"0px 2px 4px rgba(0,0,0,0.3)"},children:t("generating")})]})]}),(0,s.jsxs)(M,{step:"STEP3",title:t("videoSeoStep3Title"),description:t("videoSeoStep3Desc"),children:[(0,s.jsx)("div",{className:"relative w-full h-[184px] rounded-xl overflow-hidden",children:(0,s.jsx)("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"absolute inset-0 w-full h-full object-cover rounded-xl",children:(0,s.jsx)("source",{src:"/videos/video/video-step3-demo.mp4",type:"video/mp4"})})}),(0,s.jsx)("div",{className:"absolute bottom-10 left-0 right-0 flex items-center justify-center",children:(0,s.jsx)(p.default,{src:"/images/video/steps/download-btn.svg",alt:"Download",width:40,height:40,className:"cursor-pointer hover:scale-110 transition-transform"})})]})]}),(0,s.jsx)(f.A,{onClick:o,className:"mt-12",children:t("videoSeoHowToUseButton")})]}),(0,s.jsxs)("section",{className:"w-full flex flex-col items-center justify-center px-4 lg:container py-16 md:py-24",children:[(0,s.jsx)(h.A,{className:"pb-14",children:t("exploreCreativeUseCases")}),(0,s.jsxs)("div",{className:"w-full grid grid-cols-1 md:grid-cols-3 gap-6",children:[(0,s.jsx)(M,{title:t("exploreCreativeUseCasesStep1"),description:t("exploreCreativeUseCasesStep1Desc"),children:(0,s.jsxs)("div",{className:"h-[200px] flex flex-col",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("div",{className:"relative w-[36px] h-[36px]",children:[(0,s.jsx)(p.default,{src:"/images/video/use
1-cases/avatar.svg",alt:"Seela",width:36,height:36,className:"rounded-full"}),(0,s.jsx)(p.default,{src:"/images/video/use-cases/logo-icon.svg",alt:"Logo",width:18,height:18,className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"})]}),(0,s.jsx)("span",{className:"text-white font-semibold text-base font-poppins",children:"Seela"}),(0,s.jsx)(p.default,{src:"/images/video/use-cases/checkmark-badge.svg",alt:"Verified",width:16,height:16})]}),(0,s.jsx)("button",{className:"px-4 py-1 border border-white text-white text-sm font-normal rounded-full",children:"Follow"})]}),(0,s.jsx)("div",{className:"h-3 bg-[#2f2f2f] rounded-[2px] mb-4 w-3/5"}),(0,s.jsx)("div",{className:"flex gap-2 flex-1 min-h-0",children:[1,2,3].map(e=>(0,s.jsxs)("div",{className:"flex-1 h-full rounded-lg overflow-hidden relative bg-zinc-800",children:[(0,s.jsx)("video",{src:"/videos/video/video".concat(e,".mp4"),className:"w-full h-full object-cover",muted:!0,loop:!0,playsInline:!0,autoPlay:!0}),(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,s.jsx)("div",{className:"w-8 h-8 rounded-full bg-black/50 backdrop-blur-sm flex items-center justify-center",children:(0,s.jsx)("div",{className:"w-0 h-0 border-t-[5px] border-t-transparent border-l-[8px] border-l-white border-b-[5px] border-b-transparent ml-0.5"})})})]},e))})]})}),(0,s.jsx)(M,{title:t("exploreCreativeUseCasesStep2"),description:t("exploreCreativeUseCasesStep2Desc"),children:(0,s.jsxs)("div",{className:"flex gap-4 h-[200px]",children:[(0,s.jsx)("div",{className:"w-1/2 h-full rounded-sm overflow-hidden bg-zinc-800 relative",children:(null==(e=d[3])?void 0:e.coverUrl)?(0,s.jsx)(p.default,{src:d[3].coverUrl,alt:"Video Preview",fill:!0,className:"object-cover"}):(0,s.jsx)("div",{className:"w-full h-full bg-gradient-to-br from-zinc-700 to-zinc-900"})}),(0,s.jsxs)("div",{className:"flex-1 flex flex-col",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,s.jsxs)("div",{className:"relative w-[30px] h-[30px]",children:[(0,s.jsx)(p.default,{src:"/images/video/use
1-cases/avatar.svg",alt:"Seela",width:30,height:30,className:"rounded-full"}),(0,s.jsx)(p.default,{src:"/images/video/use-cases/logo-icon.svg",alt:"Logo",width:15,height:15,className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"})]}),(0,s.jsx)("span",{className:"text-white font-semibold text-lg font-poppins",children:"Seela"}),(0,s.jsx)(p.default,{src:"/images/video/use-cases/checkmark-badge.svg",alt:"Verified",width:16,height:16})]}),(0,s.jsxs)("div",{className:"space-y-3 flex-1",children:[(0,s.jsx)("div",{className:"h-3 bg-[#2f2f2f] rounded-[2px] w-full"}),(0,s.jsx)("div",{className:"h-3 bg-[#2f2f2f] rounded-[2px] w-full"}),(0,s.jsx)("div",{className:"h-3 bg-[#2f2f2f] rounded-[2px] w-full"}),(0,s.jsx)("div",{className:"h-3 bg-[rgba(64,64,64,0.35)] rounded-[2px] w-[85px]"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 mt-4",children:[(0,s.jsx)(p.default,{src:"/images/video/use-cases/like-icon.svg",alt:"Like",width:18,height:18}),(0,s.jsx)(p.default,{src:"/images/video/use-cases/comment-icon.svg",alt:"Comment",width:18,height:18,className:"-scale-y-100"}
1),(0,s.jsx)(p.default,{src:"/images/video/use-cases/send-icon.svg",alt:"Send",width:16,height:16})]})]})]})}),(0,s.jsx)(M,{title:t("exploreCreativeUseCasesStep3"),description:t("exploreCreativeUseCasesStep3Desc"),children:(0,s.jsx)("div",{className:"h-[200px] flex items-center justify-center",children:(0,s.jsx)(p.default,{src:"/images/video/use-cases/concept-visualization.png",alt:"Concept Visualization",width:358,height:200,className:"h-full w-auto object-contain"})})})]}),(0,s.jsx)(f.A,{onClick:o,className:"mt-12",children:t("unlockYourCreativityInstantly")})]}),(0,s.jsxs)("section",{className:"w-full flex flex-col items-center justify-center px-4 lg:container py-16 md:py-24",children:[(0,s.jsx)(h.A,{className:"pb-14",children:t("videoSeoWhyChoosingTitle")}),(0,s.jsx)("div",{className:"w-full grid grid-cols-1 md:grid-cols-3 gap-6",children:u.map((e,t)=>(0,s.jsxs)("div",{className:"flex items-start gap-4 p-6 rounded-[20px] backdrop-blur-[12.5px] bg-white/10 border border-[rgba(64,64,64,0.5)]",style:{boxShadow:"-20px 68px 20px 0px rgba(0,0,0,0), -13px 43px 18px 0px rgba(0,0,0,0.01), -7px 24px 15px 0px rgba(0,0,0,0.04), -3px 11px 11px 0px rgba(0,0,0,0.07), -1px 3px 6px 0px rgba(0,0,0,0.08)"},children:[(0,s.jsx)(p.default,{src:e.icon,alt:e.title,width:40,height:40,className:"flex-shrink-0"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-white text-lg font-bold mb-2 font-inter",children:e.title}),(0,s.jsx)("p",{className:"text-white/60 text-sm leading-[18px] font-inter",children:e.description})]})]},t))}),(0,s.jsx)(f.A,{onClick:o,className:"mt-12",children:t("videoSeoWhyChoosingButton")})]}),(0,s.jsxs)("section",{className:"w-full flex flex-col items-center justify-center px-4 lg:container py-16 md:py-24",children:[(0,s.jsx)(h.A,{className:"pb-7 md:pb-14",children:t("videoSeoPremiumTitle")}),(0,s.jsxs)("div",{className:"flex flex-col md:flex-row gap-8 w-full max-w-[1200px]",children:[(0,s.jsx)("div",{className:"flex-1 flex flex-col justify-between",children:c.map((e,t)=>(0,s.jsxs)("div",{className:"flex items-start justify-start gap-4",children:[(0,s.jsx)("div",{className:"mt-1",children:2===t?(0,s.jsx)(p.default,{src:e.icon,alt:e.title,width:30,height:30}):(0,s.jsx)(p.default,{src:e.icon,alt:e.title,width:22,height:22})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-white text-xl font-bold mb-2 font-inter",children:e.title}),(0,s.jsx)("p",{className:"text-white/60 text-base leading-relaxed font-inter",children:e.description})]})]},t))}),(0,s.jsx)("div",{className:"flex-1 w-full h-96 p-3 bg-blend-linear-dodge bg-zinc-900 rounded-3xl shadow-[inset_3px_3px_0.5px_-3.5px_rgba(255,255,255,0.50)]",children:(0,s.jsx)("div",{className:"relative w-full h-full min-h-72 rounded-xl overflow-hidden",children:(0,s.jsx)(p.default,{src:"/images/video/01.png",alt:"Premium Benefits",fill:!0,className:"object-cover"})})})]}),(0,s.jsx)(f.A,{onClick:()=>a.push("/pricing"),className:"mt-12",children:t("videoSeoPremiumButton")})]}),(0,s.jsxs)("section",{className:"relative w-full max-w-[860px] mx-auto px-4 py-16 md:py-24",children:[(0,s.jsx)(h.A,{className:"mb-12",children:t("FAQs")}),(0,s.jsx)("div",{className:"space-y-4",children:m.map((e,t)=>(0,s.jsx)(v.M,{faq:e,index:t},t))})]}),(0,s.jsxs)("section",{className:"relative w-full",children:[(0,s.jsx)(p.default,{src:"/images/video/seo-bg.jpg",alt:"Video SEO Backgroun
1d",width:4096,height:2286,className:"w-full h-auto",priority:!0}),(0,s.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black via-transparent to-transparent"}),(0,s.jsxs)("div",{className:"absolute inset-0 flex flex-col max-md:gap-10 items-center justify-center text-center px-6",children:[(0,s.jsx)("h2",{className:"text-3xl md:text-5xl lg:text-[70px] font-extrabold mb-8 leading-tight md:leading-[88px] text-white",children:t("videoSeoCtaTitle")}),(0,s.jsx)(f.A,{onClick:o,children:t("videoSeoCtaButton")})]})]})]})}var T=a(83491),P=a(76803),F=a(87478),z=a(9603),D=a(3e4),L=a(57927),I=a(10164),E=a(59020),V=a(38812);let B=[{label:"16:9",value:"16:9",width:24,height:14},{label:"4:3",value:"4:3",width:24,height:18},{label:"1:1",value:"1:1",width:20,height:20},{label:"3:4",value:"3:4",width:18,height:24},{label:"9:16",value:"9:16",width:14,height:24},{label:"21:9",value:"21:9",width:24,height:10}];function R(e){var t,a;let{value:r,onChange:n,selectedModel:o}=e,d=(0,i.c)(),c=l.useMemo(()=>{var e;let t=null==o||null==(e=o.parameter)?void 0:e.aspect_ratio;return t&&0!==t.length?B.filter(e=>t.includes(e.value)):B},[o]);return(null==o||null==(t=o.display_parameters)?void 0:t.support_ratio)!==1&&(null==o||null==(a=o.display_parameters)?void 0:a.size)!==1?null:(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(z.J,{className:"text-sm font-medium",children:d("aspectRatio")}),(0,s.jsx)("div",{className:"flex gap-2",children:c.map(e=>(0,s.jsxs)(P.$,{variant:"outline",size:"sm",className:(0,D.cn)("flex flex-col h-auto py-2 gap-1 rounded-md flex-1 min-w-0 transition-colors",r===e.value?"relative border border-transparent bg-primary/5 text-foreground font-semibold before:content-[''] before:absolute before:inset-0 before:rounded-md before:p-[1px] before:bg-[linear-gradient(117deg,#4B98FF_0%,#5859FF_100%)] before:[-webkit-mask:linear-gradient(#fff_0_0)_content-box,linear-gradient(#fff_0_0)] before:[-webkit-mask-composite:xor] before:[mask-composite:exclude]":"border bg-background text-muted-foreground hover:text-accent-foreground"),onClick:()=>n(e.value),children:[(0,s.jsx)("div",{className:"flex items-center justify-center h-7",children:(0,s.jsx)("div",{className:(0,D.cn)("border rounded transition-colors",r===e.value?"border-primary border-2":"border-muted-foreground"),style:{width:"".concat(e.width,"px"),height:"".concat(e.height,"px")}})}),(0,s.jsx)("span",{className:"text-xs",children:e.label})]},e.value))})]})}function O(e){var t;let a=null==e||null==(t=e.parameter)?void 0:t.aspect_ratio;return a&&0!==a.length?B.filter(e=>a.includes(e.value)):B}var $=a(88416);function G(e){return e.length?e.map(e=>parseInt(String(e).replace("s",""),10)).filter(e=>!Number.isNaN(e)):[]}function U(e){var t,a,s;if(!e)return;let l=(null==(t=e.parameter)?void 0:t.duration)||[],i=G(l);if(2===(null!=(s=null==(a=e.display_parameters)?void 0:a.duration_display_mode)?s:1)){if(0===i.length)return"5";let e=Math.min(...i),t=Math.max(...i);return String(5>=e&&5<=t?5:e)}let r=function(e){let t=G(e);if(t.length)return String(Math.min(...t))}(l);return null!=r?r:"2"}function Z(e){var t;let a=(0,$.L$)(null!=e?e:void 0);if(a.length)return null==(t=[...a].sort((e,t)=>e.order-t.order)[0])?void 0:t.value}var H=a(85999),W=a(34875),Y=a(82418),q=a(19662),K=a(63246),X=a(91694),J=a(17264);let Q=e=>{let{models:t,selectedModel:a,onModelChange:r,loading:n=!1}=e,o=(0,i.c)(),[d,c]=(0,l.useState)(!1),[u,m]=(0,l.useState)(""),x=(0,l.useMemo)(()=>u?t.filter(e=>e.display_name.toLowerCase().includes(u.toLowerCase())||e.name.toLowerCase().includes(u.toLowerCase())||e.description.toLowerCase().includes(u.toLowerCase())):t,[t,u]),p=(0,l.useMemo)(()=>t.find(e=>e.name===a),[t,a]);return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-medium",children:o("model")}),(0,s.jsxs)(Y.AM,{open:d,onOpenChange:e=>{c(e),e||m("")},children:[(0,s.jsx)(Y.Wv,{asChild:!0,children:(0,s.jsxs)(P.$,{variant:"outline",role:"combobox","aria-expanded":d,className:"h-12 w-full justify-between rounded-md bg-transparent hover:bg-transparent",disabled:n,children:[a&&p?(0,s.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[p.logo?(0,s.jsx)(J.default,{src:p.logo,alt:p.display_name,width:24,height:24,className:"rounded shrink-0"}):(0,s.jsx)("div",{className:"w-5 h-5 shrink-0 bg-gradient-to-br from-blue-400 to-purple-600 rounded flex items-center justify-center text-xs text-white font-bold",children:p.display_name.charAt(0)}),(0,s.jsxs)("div",{className:"min-w-0 flex-1 text-left",children:[(0,s.jsx)("div",{className:"font-medium truncate",children:p.display_name}
1),(0,s.jsx)("div",{className:"text-xs text-muted-foreground/60 truncate",children:p.description})]})]}):(0,s.jsx)("span",{className:"text-muted-foreground",children:n?"Loading...":o("selectModel")}),(0,s.jsx)(X.A,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,s.jsx)(Y.hl,{className:"w-[var(--radix-popover-trigger-width)] p-0 rounded-xl",style:{background:"rgba(121, 132, 255, 0.15)"},align:"start",children:(0,s.jsxs)(q.uB,{children:[(0,s.jsx)(q.G7,{placeholder:o("searchVideoModelsPlaceholder"),value:u,onValueChange:m}),(0,s.jsxs)(q.oI,{className:"max-h-80",children:[(0,s.jsx)(q.xL,{children:o("noMatchingModels")||"No model found."}),(0,s.jsx)(q.L$,{children:x.map(e=>{var t;return(0,s.jsxs)(K.jc,{openDelay:200,closeDelay:100,children:[(0,s.jsx)(K.d0,{asChild:!0,children:(0,s.jsxs)(q.h_,{value:e.display_name,onSelect:()=>{r(e.name),c(!1),m("")},className:"flex items-center gap-2 cursor-pointer",children:[e.logo?(0,s.jsx)(J.default,{src:e.logo,alt:e.display_name,width:24,height:24,className:"rounded shrink-0"}):(0,s.jsx)("div",{className:"w-5 h-5 shrink-0 bg-gradient-to-br from-blue-400 to-purple-600 rounded flex items-center justify-center text-xs text-white font-bold",children:e.display_name.charAt(0)}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"font-medium truncate flex items-center gap-2",children:[e.display_name,"NEW"===e.badge&&(0,s.jsxs)("svg",{width:"26",height:"14",viewBox:"0 0 26 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{d:"M23.9682 0H3.0318C1.88339 0 1 0.880503 1 2.02516V11.9748C1 13.1195 1.88339 14 3.0318 14H23.9682C25.1166 14 26 13.1195 26 11.9748V2.02516C26 0.880503 25.1166 0 23.9682 0Z",fill:"url(#paint0_linear_58_748)"}),(0,s.jsx)("path",{d:"M8.24382 10.3019H6.83039L4.09187 4.93082V10.3019H3.20848V3.87421H4.44523L7.27208 9.42138H7.36042V3.87421H8.24382V10.3019ZM10.4523 6.60377H13.8975V7.48428H10.4523C10.4523 7.57233 10.4523 7.57233 10.4523 7.66038C10.4523 8.80503 10.8057 9.33333 11.5124 9.33333H13.9859V10.2138H11.5124C10.9823 10.2138 10.5406 10.0377 10.1873 9.59748C9.83392 9.15723 9.65724 8.45283 9.65724 7.66038C9.65724 7.30818 9.65724 6.86792 9.65724 6.16352C9.65724 4.66667 10.629 4.05031 11.6007 3.87421C11.9541 3.87421 13.8092 3.87421 13.9859 3.87421V4.75472C13.1908 4.75472 11.9541 4.75472 11.689 4.75472C11.3357 4.84277 10.5406 5.10692 10.5406 6.16352C10.4523 6.33962 10.4523 6.42767 10.4523 6.60377ZM21.9364 10.3019H20.6996L19.4629 5.19497L18.0495 10.3019H16.7244L14.8693 3.87421H15.841L17.4311 9.15723H17.5194L18.9329 3.87421H19.9929L21.4064 9.42138L23.0848 3.87421H23.9682L21.9364 10.3019Z",fill:"white"}),(0,s.jsx)("defs",{children:(0,s.jsxs)("linearGradient",{id:"paint0_linear_58_748",x1:"-11.4515",y1:"6.97285",x2:"0.438848",y2:"28.2056",gradientUnits:"userSpaceOnUse",children:[(0,s.jsx)("stop",{stopColor:"#4B98FF"}),(0,s.jsx)("stop",{offset:"1",stopColor:"#5859FF"})]})})]}),(null==(t=e.content_type_tag)?void 0:t.includes("Audio"))&&(0,s.jsx)("div",{className:"flex items-center justify-center rounded-[2px] border border-[rgba(0,0,0,0.20)] dark:border-[rgba(255,255,255,0.20)] w-[30px] h-[14px] text-[8px] leading-[14px] text-[rgba(0,0,0,0.60)] dark:text-[rgba(255,255,255,0.60)]",style:{borderWidth:"0.6px"},children:"Audio"}),(0,s.jsxs)("div",{className:"flex items-center justify-center gap-[1px] rounded-[2px] border border-[rgba(0,0,0,0.20)] dark:border-[rgba(255,255,255,0.20)] w-[40px] h-[14px] text-[8px] leading-[14px] text-[rgba(0,0,0,0.60)] dark:text-[rgba(255,255,255,0.60)]",style:{borderWidth:"0.6px"},children:[(0,s.jsxs)("svg",{viewBox:"0 0 6 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"opacity-60 shrink-0",style:{width:"8px",height:"8px"},children:[(0,s.jsx)("path",{d:"M0.321411 1.07143C0.321411 1.21213 0.390694 1.35145 0.525305 1.48145C0.659916 1.61144 0.857218 1.72955 1.10595 1.82904C1.35468 1.92853 1.64996 2.00746 1.97494 2.0613C2.29992 2.11514 2.64823 2.14286 2.99998 2.14286C3.35174 2.14286 3.70005 2.11514 4.02503 2.0613C4.35001 2.00746 4.64529 1.92853 4.89402 1.82904C5.14275 1.72955 5.34005 1.61144 5.47466 1.48145C5.60927 1.35145 5.67856 1.21213 5.67856 1.07143C5.67856 0.930727 5.60927 0.791402 5.47466 0.661411C5.34005 0.531419 5.14275 0.413306 4.89402 0.313814C4.64529 0.214323 4.35001 0.135402 4.02503 0.0815577C3.70005 0.0277133 3.35174 0 2.99998 0C2.64823 0 2.29992 0.0277133 1.97494 0.0815577C1.64996 0.135402 1.35468 0.214323 1.10595 0.313814C0.857218 0.413306 0.659916 0.531419 0.525305 0.661411C0.390694 0.791402 0.321411 0.930727 0.321411 1.07143Z",fill:"currentColor"}),(0,s.jsx)("path",{d:"M5.4557 1.92856C5.04239 2.30697 4.0982 2.57142 2.99998 2.57142C1.90177 2.57142 0.957572 2.30697 0.544268 1.92856C0.400965 2.05981 0.321411 2.20472 0.321411 2.35713C0.321411 2.94889 1.52067 3.42856 2.99998 3.42856C4.47929 3.42856 5.67856 2.94889 5.67856 2.35713C5.67856 2.20472 5.599 2.05981 5.4557 1.92856Z",fill:"currentColor"}),(0,s.jsx)("path",{d:"M5.4557 3.21429C5.04239 3.59271 4.0982 3.85715 2.99998 3.85715C1.90177 3.85715 0.957572 3.59271 0.544268 3.21429C0.400965 3.34554 0.321411 3.49046 0.321411 3.64287C0.321411 4.23463 1.52067 4.71429 2.99998 4.71429C4.47929 4.71429 5.67856 4.23463 5.67856 3.64287C5.67856 3.49046 5.599 3.34554 5.4557 3.21429Z",fill:"currentColor"}),(0,s.jsx)("path",{d:"M5.4557 4.5C5.04239 4.87842 4.0982 5.14286 2.99998 5.14286C1.90177 5.14286 0.957572 4.87842 0.544268 4.5C0.400965 4.63125 0.321411 4.77616 0.321411 4.92857C0.321411 5.52033 1.52067 6 2.99998 6C4.47929 6 5.67856 5.52033 5.67856 4.92857C5.67856 4.77616 5.599 4.63125 5.4557 4.5Z",fill:"currentColor"})]}),(0,s.jsxs)("span",{children:[e.points,"+/s"]})]})]}
1),(0,s.jsx)("div",{className:"text-xs text-muted-foreground/60 truncate",children:e.description})]}),a===e.name&&(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"ml-auto shrink-0",children:[(0,s.jsx)("path",{d:"M14.6622 3.56808L6.76235 11.5877C6.57635 11.7755 6.27588 11.7755 6.09524 11.5913L2.62911 8.07333C2.53432 7.97854 2.52359 7.81757 2.60407 7.71384L2.91527 7.315C2.99575 7.21127 3.15135 7.18981 3.26224 7.26313L6.03443 9.14286C6.25084 9.28952 6.59244 9.27163 6.79455 9.10709L14.1829 3.01364C14.199 3.00112 14.2151 2.99039 14.2347 2.98144C12.7664 1.16432 10.52 0 8 0C3.5806 0 0 3.5806 0 8C0 12.4194 3.5806 16 8 16C12.4194 16 16 12.4194 16 8C16 6.36173 15.5082 4.83792 14.6622 3.56808Z",fill:"url(#paint0_linear_170_1901)"}),(0,s.jsx)("defs",{children:(0,s.jsxs)("linearGradient",{id:"paint0_linear_170_1901",x1:"-7.96897",y1:"7.96897",x2:"7.96897",y2:"23.9069",gradientUnits:"userSpaceOnUse",children:[(0,s.jsx)("stop",{stopColor:"#4B98FF"}),(0,s.jsx)("stop",{offset:"1",stopColor:"#5859FF"})]})})]})]})}),(0,s.jsx)(K.Et,{className:"w-80 text-xs",side:"right",align:"start",children:(0,s.jsxs)("div",{className:"flex gap-3",children:[e.logo?(0,s.jsx)(J.default,{src:e.logo,alt:e.display_name,width:24,height:24,className:"rounded shrink-0 w-8 h-8"}):(0,s.jsx)("div",{className:"w-8 h-8 shrink-0 bg-gradient-to-br from-blue-400 to-purple-600 rounded flex items-center justify-center text-sm text-white font-bold",children:e.display_name.charAt(0)}),(0,s.jsxs)("div",{className:"space-y-2 flex-1 min-w-0",children:[(0,s.jsx)("div",{className:"font-semibold",children:e.display_name}),(0,s.jsx)("p",{className:"text-muted-foreground whitespace-pre-wrap",children:e.description}),(0,s.jsx)("div",{className:"pt-2 space-y-1 border-t",children:(0,s.jsxs)("div",{className:"flex items-center justify-between text-muted-foreground",children:[(0,s.jsxs)("span",{children:[o("creditsRequired"),":"]}),(0,s.jsx)("span",{className:"font-medium",children:o("creditsFromPerSecond",{points:e.points})})]})})]})]})})]},e.id)})})]})]})})]})]})};var ee=a(92421),et=a(81371),ea=a(23914),es=a(64076),el=a(76658),ei=a(51599),er=a(54836),en=a(19786);function eo(e){var t;let{audioFile:a,onAudioFileChange:r}=e,n=(0,i.c)(),o=function(){let e=(0,i.c)(),t=(0,ei.Ym)();return(0,es.n)({mutationFn:e=>(0,el.uploadAudioFile)(e,t),onError:t=>{console.error("Audio upload failed:",t),_.toast.error(t.message||e("uploadFailed"))},retry:1})}(),[d,c]=(0,l.useState)(!1),u=(0,l.useRef)(null),m=async e=>{var t;let a=null==(t=e.target.files)?void 0:t[0];if(a){if(e.target.value="",!["audio/mpeg","audio/wav","audio/x-wav","audio/mp3","audio/vnd.wav","audio/wave","audio/x-pn-wav"].includes(a.type)&&!a.name.match(/\.(mp3|wav)$/i))return void _.toast.error("".concat(n("unsupportedFileType")," (").concat(a.type||"unknown",")"));if(a.size>0xf00000)return void _.toast.error(n("audioFileSize"));try{let e=await o.mutateAsync(a);r({id:e.id,url:e.url,original_filename:e.original_filename,file_size:e.file_size,file_extension:e.file_extension,duration:e.duration}),_.toast.success(n("uploadSuccess"))}catch(e){console.error("Upload failed:",e)}}};return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(z.J,{className:"text-sm font-medium",children:n("audio")}),a?(0,s.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg border-2 border-dashed",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,s.jsx)(p.default,{src:"/audio/audio.svg",alt:"audio",width:40,height:40,className:"shrink-0"}),(0,s.jsxs)("div",{className:"min-w-0 flex flex-col gap-0.5",children:[(0,s.jsx)("span",{className:"text-sm font-medium truncate max-w-[140px]",children:a.original_filename}),(0,s.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsxs)("svg",{className:"w-3 h-3",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{d:"M2 3C2 2.44772 2.44772 2 3 2H9C9.55228 2 10 2.44772 10 3V9C10 9.55228 9.55228 10 9 10H3C2.44772 10 2 9.55228 2 9V3Z",stroke:"currentColor",strokeWidth:"1.2"}),(0,s.jsx)("path",{d:"M4 5H8M4 7H6",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]}),a.file_size,"MB"]}),a.duration&&(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsxs)("svg",{className:"w-3 h-3",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.2"}),(0,s.jsx)("path",{d:"M6 4V6.5H8",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]}),(t=a.duration)?"".concat(t.toFixed(1),"S"):""]})]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{onClick:()=>
1{(null==a?void 0:a.url)&&(u.current||(u.current=new Audio(a.url),u.current.onended=()=>c(!1)),d?(u.current.pause(),c(!1)):(u.current.play(),c(!0)))},className:"w-8 h-8 flex items-center justify-center rounded-full transition-colors hover:opacity-80",children:(0,s.jsx)(p.default,{src:d?"/audio/stopAudio.svg":"/audio/startAudio.svg",alt:d?"pause":"play",width:20,height:20})}),(0,s.jsx)("button",{onClick:()=>{u.current&&(u.current.pause(),u.current=null),c(!1),r(null)},className:"w-6 h-6 flex items-center justify-center rounded-full bg-muted transition-colors hover:bg-muted/80",children:(0,s.jsx)(ee.A,{className:"w-3 h-3"})})]})]}):(0,s.jsxs)("div",{className:(0,D.cn)("border-2 border-dashed rounded-lg p-3 text-center cursor-pointer hover:bg-accent/50 transition-colors",o.isPending&&"pointer-events-none opacity-60"),onClick:()=>{var e;if(!er.apiClient.getToken()){en.n.getState().setIsAuthDialog(!0),en.n.getState().setAuthDialogPageName("SignIn");return}null==(e=document.getElementById("audio-upload"))||e.click()},children:[o.isPending?(0,s.jsxs)("div",{className:"flex flex-col items-center py-1",children:[(0,s.jsx)(et.A,{className:"w-6 h-6 animate-spin text-primary mb-1"}),(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground",children:n("uploading")})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ea.A,{className:"w-6 h-6 mx-auto mb-1.5 text-muted-foreground/60"}),(0,s.jsxs)("div",{className:"text-[11px] text-muted-foreground/60",children:[n("clickToUploadAudio"),(0,s.jsx)("div",{className:"mt-0.5 opacity-80",children:n("audioSupported")})]})]}),(0,s.jsx)("input",{id:"audio-upload",type:"file",accept:".mp3,.wav,audio/mpeg,audio/wav,audio/x-wav",className:"hidden",onChange:m})]})]})}var ed=a(62188);let ec=e=>{let{value:t,checked:a,onChange:l,label:i,disabled:r}=e;return(0,s.jsxs)("button",{type:"button",role:"radio","aria-checked":a,disabled:r,onClick:()=>l(t),className:(0,D.cn)("flex items-center gap-2 shrink-0 min-h-8",r?"cursor-not-allowed opacity-40":"cursor-pointer"),children:[a?(0,s.jsxs)("span",{className:"relative flex h-4 w-4 items-center justify-center rounded-full bg-[linear-gradient(135deg,#4B98FF_0%,#5859FF_100%)] p-[1.5px] shadow-[0_0_0_1px_rgba(255,255,255,0.08)]",children:[(0,s.jsx)("span",{className:"absolute inset-[1.5px] rounded-full bg-[linear-gradient(180deg,rgba(95,112,255,0.55)_0%,rgba(46,56,130,0.55)_100%)]"}),(0,s.jsx)("span",{className:"relative h-[6px] w-[6px] rounded-full bg-white"})]}):(0,s.jsx)("span",{className:"relative flex h-4 w-4 items-center justify-center rounded-full border border-white/35 bg-transparent transition-colors"}),(0,s.jsx)("span",{className:(0,D.cn)("text-sm",r?"text-muted-foreground":"text-foreground"),children:i})]})},eu=e=>parseInt(e.replace("s",""));function em(e){var t,a,l,i,r,n,o,d;let{value:c,onChange:u,label:m,selectedModel:x,resolution:p}=e;if(0===(null!=(n=null==x||null==(t=x.display_parameters)?void 0:t.support_duration)?n:1))return null;let h=null!=(o=null==x||null==(a=x.display_parameters)?void 0:a.duration_display_mode)?o:1;if(0===h)return null;let g=(null==(d=null==x||null==(l=x.parameter)?void 0:l.duration)?void 0:d.length)?d.map(e=>parseInt(String(e).replace("s",""),10)).filter(e=>!Number.isNaN(e)):[],f=g.length?Math.min(...g):2,v=g.length?Math.max(...g):12,b=Math.min(Math.max(eu(c),f),v);return(0,s.jsxs)("div",{className:"",children:[(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)(z.J,{className:"text-sm font-medium min-w-[60px]",children:m}),1===h&&(0,s.jsx)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2",children:((null==x||null==(r=x.parameter)||null==(i=r.duration)?void 0:i.length)?x.parameter.duration.map(e=>String(e)):["2","3","4","5","6","7","8","9","10","11","12"]).map(e=>(0,s.jsx)(ec,{value:e,checked:eu(c)===eu(e),onChange:u,label:"".concat(eu(e),"s"),disabled:((e,t,a)=>{let s=(null==t?void 0:t.name)==="minimax/hailuo-2.3",l=String(e).replace("s","");return!!s&&"1080p"===a&&"10"===l})(e,x,p)},e))})]}),2===h&&(0,s.jsx)("div",{className:"pt-2",children:(0,s.jsx)(ed.A,{value:[b],onValueChange:e=>{let t;u((t=e[0],"".concat(t)))},min:f,max:v,step:1,className:"w-full [&>span:first-child>span]:bg-[linear-gradient(117deg,#4B98FF_19.99%,#5859FF_86.67%)]",formatLabel:e=>"".concat(e,"s")})})]})}var ex=a(15399),ep=a(83267);function eh(e){let{value:t,onChange:a}=e,r=(0,i.c)(),n=(0,V.a)();return((0,l.useEffect)(()=>{"text"!==t&&a("text")},[t,a]),n)?(0,s.jsx)(ep.tU,{value:t,onValueChange:e=>a(e),className:"w-auto",children:(0,s.jsx)(ep.j7,{className:"w-auto h-9",children:(0,s.jsx)(ep.Xi,{value:"text",className:"text-sm h-8",children:r("navTextToVideo")})})}):(0,s.jsx)("div",{className:"w-full overflow-x-auto scrollbar-none",children:(0,s.jsx)(ex.QE,{value:t,onValueChange:e=>a(e),children:(0,s.jsx)(ex.gs,{className:"gap-1 min-w-max",children:(0,s.jsx)(ex.GD,{value:"text",className:"whitespace-nowrap text-xs px-2",children:r("navTextToVideo")})})})})}var eg=a(45753),ef=a(27653);function ev(e){let{models:t,selectedModel:a,onModelChange:n,loading:o=!1}=e,d=(0,i.c)(),[c,u]=l.useState(!1),m=l.useMemo(()=>t.find(e=>e.name===a),[t,a]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(z.J,{className:"text-sm font-medium",children:d("model")}),(0,s.jsxs)(P.$,{variant:"outline",className:"h-12 w-full justify-between rounded-lg bg-transparent dark:bg-transparent hover:bg-accent/50 dark:hover:bg-accent/50",onClick:()=>u(!0),disabled:o,children:[m?(0,s.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[(0,s.jsx)("div",{className:(0,D.cn)("w-5 h-5 shrink-0 rounded flex items-center justify-center text-xs font-bold overflow-hidden",m.logo?"bg-transparent text-inherit":"bg-gradient-to-br from-blue-400 to-purple-600 text-white"),children:m.logo?(0,s.jsx)(J.default,{src:m.logo,alt:m.display_name,width:20,height:20,className:"w-full h-full object-cover"}):m.display_name.charAt(0)}),(0,s.jsxs)("div",{className:"min-w-0 flex-1 text-left",children:[(0,s.jsx)("div",{className:"font-medium truncate",children:m.display_name}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:m.description})]})]}):(0,s.jsx)("span",{className:"text-muted-foreground",children:o?"Loading...":d("selectModel")}),(0,s.jsx)(eg.A,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]})]}),(0,s.jsx)(r._s,{open:c,onOpenChange:u,children:(0,s.jsxs)(r.zj,{className:"h-[80vh]",showHandle:!0,children:[(0,s.jsx)(r.gk,{className:"sr-only",children:"Select Model"}),(0,s.jsx)("div",{className:"flex flex-col h-full",children:(0,s.jsx)("div",{className:"flex-1 overflow-y-auto px-4 pb-4",children:(0,s.jsx)("div",{className:"space-y-3",children:t.map(e=>(0,s.jsxs)("button",{className:(0,D.cn)("w-full flex flex-col gap-2 p-3 rounded-lg border transition-colors text-left",a===e.name?"border-primary bg-primary/5":"border-border hover:bg-accent"),onClick:()=>{n(e.name),u(!1)},children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:(0,D.cn)("w-10 h-10 shrink-0 rounded flex items-center justify-center font-bold overflow-hidden",e.logo?"bg-transparent text-inherit":"bg-gradient-to-br from-blue-400 to-purple-600 text-white"),children:e.logo?(0,s.jsx)(J.default,{src:e.logo,alt:e.display_name,width:40,height:40,className:"w-full h-full object-cover"}):e.display_name.charAt(0)}),(0,s.jsxs)("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[(0,s.jsx)("div",{className:"font-medium",children:e.display_name}),a===e.name&&(0,s.jsx)(ef.A,{className:"w-4 h-4 text-primary shrink-0"})]})]}),(0,s.jsx)("div",{className:"text-sm text-muted-foreground line-clamp-2",children:e.description}),(0,s.jsxs)("div",{className:"text-xs text-muted-foreground",children:[d("creditsRequired"),": ",e.points," ",d("credits")]})]},e.id))})})})]})})]})}var eb=a(41633),ej=a(2779);function ey(e){let{checked:t,onCheckedChange:a,id:l}=e;return(0,s.jsx)(ej.d,{id:l,checked:t,onCheckedChange:a,style:{width:"25.667px",height:"14px",aspectRatio:"25.67 / 14"},className:"!h-[14px] !w-[25.667px] data-[state=checked]:bg-[linear-gradient(135deg,#4B98FF_0%,#5859FF_100%)] data-[state=unchecked]:bg-[#7E7F85]",thumbClassName:"!h-[10px] !w-[10px] data-[state=checked]:!translate-x-[11.667px] data-[state=unchecked]:!translate-x-0 data-[state=checked]:bg-white data-[state=unchecked]:bg-black"})}var ew=a(61181);let eN=[{id:1,content:"Golden Hour Portrait",summary:"soft golden-hour light, close-up portrait, gentle head turn, shallow depth of field, smooth stabilised pan, warm skin texture, slow cinematic pacing"},{id:2,content:"Neon Alley",summary:"rainy neon alley, slow walk forward, wet asphalt reflections, hard rim lighting, glossy surfaces, steady gimbal shot, moody rhythm"},{id:3,content:"Desert Dunes",summary:"wide desert dunes, slow push-in, warm sunset glow, sand ripple texture, subtle heat haze, locked horizon, calm pacing"},{id:4,content:"Ocean Wave",summary:"crashing ocean wave, slow motion, backlit sea spray, high contrast, detailed foam texture, smooth camera drift, dramatic beat"},{id:5,content:"Mountain Sunrise",summary:"mountain sunrise timelapse, locked tripod, rolling low clouds, golden rays, crisp atmosphere, gradual exposure shift, steady cadence"},{id:6,content:"Cosy Caf\xe9",summary:"cosy caf\xe9 interior, close-up steaming cup, warm tungsten lighting, ceramic texture, shallow focus pull, gentle handheld sway, relaxed tempo"},{id:7,content:"Forest Fog",summary:"misty forest path, slow dolly forward, diffuse soft light, damp bark texture, muted greens, stabilised motion, quiet pacing"},{id:8,content:"City Time-lapse",summary:"city night timelapse, high-angle locked shot, light trails, glass reflections, sharp highlights, rhythm
1ic flow, clean frames"},{id:9,content:"Snowfall Street",summary:"snowfall under streetlights, slow tilt up, soft bokeh, cold blue ambience, powdery snow texture, steady tripod, peaceful tempo"},{id:10,content:"Retro Arcade",summary:"retro arcade glow, slow lateral slide, neon signage lighting, plastic shine, subtle flicker highlights, upbeat pacing, stabilised shot"},{id:11,content:"Underwater World",summary:"underwater glide, slow drifting camera, sun-ray caustics, floating particles, soft blue lighting, silky motion, tranquil rhythm"},{id:12,content:"Kitchen Close-up",summary:"cooking close-up, quick cuts, steam and sizzle, soft window light, oily sheen texture, crisp focus pulls, punchy pacing"},{id:13,content:"Space View",summary:"earth from space, slow orbital movement, deep shadows, crisp terminator line, subtle lens flare, smooth motion, serene pacing"},{id:14,content:"Autumn Leaves",summary:"autumn leaves falling, tracking shot, golden-hour light, papery leaf texture, gentle wind motion, steady gimbal, warm rhythm"},{id:15,content:"Paper Lanterns",summary:"floating paper lanterns, slow pullback, warm glow lighting, rippling water highlights, soft haze, stabilised camera, calm pacing"}];function eC(e){let{videoType:t,onIdeaClick:a}=e,r=(0,i.c)(),n=(0,V.a)(),o=(0,ei.Ym)(),[d,c]=l.useState(0),[u,m]=l.useState(!1),x=l.useMemo(()=>{let e=4*d;return eN.slice(e,e+4)},[d]);l.useEffect(()=>{c(0)},[o]);let p=e=>{a(e.summary)},h=()=>{m(!0);let e=Math.ceil(eN.length/4);c(t=>{let a=t+1;return a>=e?0:a}),setTimeout(()=>{m(!1)},300)};return"text"!==t||0===x.length?null:n?(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-muted-foreground/70",children:r("videoIdeas")}),(0,s.jsx)("button",{type:"button",onClick:h,className:"text-muted-foreground/70 hover:text-foreground transition-all cursor-pointer shrink-0","aria-label":r("ideas"),children:(0,s.jsx)(ew.A,{className:(0,D.cn)("w-3 h-3",u&&"animate-spin")})})]}),(0,s.jsx)("div",{className:"mt-1 grid grid-cols-2 gap-x-2 gap-y-1",children:x.map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>p(e),className:"text-[12px] text-muted-foreground/80 hover:text-foreground transition-colors text-left truncate",title:e.summary,children:e.content},e.id))})]}):(0,s.jsxs)("div",{className:"flex items-start gap-2 mt-2",children:[(0,s.jsx)("span",{className:"text-[13px] text-muted-foreground/60 flex-shrink-0",children:r("videoIdeas")}),(0,s.jsx)("div",{className:"grid grid-cols-2 gap-x-1 gap-y-0.5 flex-1",children:x.map(e=>(0,s.jsx)(E.Bc,{children:(0,s.jsxs)(E.m_,{children:[(0,s.jsx)(E.k$,{asChild:!0,children:(0,s.jsx)("button",{type:"button",onClick:()=>p(e),className:"text-[11px] text-muted-foreground/60 hover:text-foreground transition-colors cursor-pointer rounded px-2 py-0 text-left truncate max-w-full",children:e.content})}),(0,s.jsx)(E.ZI,{side:"top",className:"max-w-xs break-words",children:(0,s.jsx)("p",{className:"text-xs",children:e.summary})})]})},e.id))}),(0,s.jsx)("button",{type:"button",onClick:h,className:"text-muted-foreground/60 hover:text-foreground transition-all cursor-pointer flex-shrink-0 mt-0.5",children:(0,s.jsx)(ew.A,{className:(0,D.cn)("w-3 h-3",u&&"animate-spin")})})]})}let ek=()=>(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"w-3 h-3",children:[(0,s.jsx)("path",{d:"M6.11657 12.8823C5.78197 11.8023 5.18928 10.82 4.38978 10.0205C3.59027 9.22101 2.60802 8.62832 1.528 8.29372C1.43047 8.29372 1.33295 8.19619 1.23543 8.00115C1.13828 7.80572 1.33257 7.61029 1.528 7.51315C2.60802 7.17854 3.59027 6.58586 4.38978 5.78635C5.18928 4.98685 5.78197 4.0046 6.11657 2.92457C6.11657 2.82705 6.21409 2.72953 6.40914 2.632C6.60457 2.53486 6.8 2.72915 6.89714 2.92457C7.23174 4.0046 7.82443 4.98685 8.62393 5.78635C9.42344 6.58586 10.4057 7.17854 11.4857 7.51315C11.5463 7.55861 11.5954 7.61754 11.6293 7.68528C11.6631 7.75302 11.6808 7.8277 11.6808 7.90343C11.6808 7.97916 11.6631 8.05385 11.6293 8.12159C11.5954 8.18933 11.5463 8.24826 11.4857 8.29372
1C10.4057 8.62832 9.42344 9.22101 8.62393 10.0205C7.82443 10.82 7.23174 11.8023 6.89714 12.8823C6.89714 13.0777 6.70171 13.1749 6.50628 13.1749C6.31085 13.1749 6.11657 13.0777 6.11657 12.8823Z",fill:"#88888A"}),(0,s.jsx)("path",{d:"M12.3292 14.7611C12.1846 14.2863 11.9254 13.8543 11.5744 13.5033C11.2235 13.1523 10.7915 12.8931 10.3166 12.7486C10.287 12.7255 10.263 12.6961 10.2464 12.6624C10.2297 12.6288 10.2209 12.5918 10.2206 12.5543C10.2206 12.5063 10.2686 12.4583 10.3166 12.4103C10.7915 12.2658 11.2235 12.0066 11.5744 11.6556C11.9254 11.3046 12.1846 10.8726 12.3292 10.3977C12.3308 10.3728 12.3414 10.3493 12.3591 10.3316C12.3767 10.314 12.4002 10.3033 12.4252 10.3017C12.447 10.2911 12.4709 10.2852 12.4952 10.2843C12.5195 10.2835 12.5438 10.2877 12.5664 10.2967C12.5889 10.3058 12.6094 10.3194 12.6264 10.3368C12.6434 10.3542 12.6566 10.3749 12.6652 10.3977C12.8093 10.873 13.0684 11.3055 13.4194 11.6569C13.7704 12.0083 14.2026 12.2678 14.6777 12.4126C14.7027 12.4142 14.7261 12.4248 14.7438 12.4425C14.7615 12.4602 14.7721 12.4836 14.7737 12.5086C14.7843 12.5305 14.7903 12.5543 14.7911 12.5786C14.792 12.603 14.7878 12.6272 14.7787 12.6498C14.7697 12.6724 14.756 12.6928 14.7386 12.7098C14.7213 12.7268 14.7005 12.74 14.6777 12.7486C14.2028 12.8931 13.7709 13.1523 13.4199 13.5033C13.0689 13.8543 12.8097 14.2863 12.6652 14.7611C12.6172 14.8091 12.5692 14.8571 12.5212 14.8571C12.3772 14.8571 12.3292 14.8091 12.3292 14.7611Z",fill:"#88888A"}),(0,s.jsx)("path",{d:"M11.8023 4.49942C11.6939 4.1432 11.4994 3.81914 11.2361 3.55585C10.9729 3.29256 10.6488 3.09812 10.2926 2.9897C10.2706 2.97261 10.2527 2.9508 10.2402 2.92588C10.2278 2.90096 10.221 2.87356 10.2206 2.8457C10.2206 2.81027 10.256 2.7737 10.2926 2.73827C10.6488 2.62985 10.9729 2.43542 11.2361 2.17212C11.4994 1.90883 11.6939 1.58478 11.8023 1.22856C11.8036 1.2099 11.8116 1.19235 11.8249 1.17912C11.8381 1.1659 11.8556 1.15789 11.8743 1.15656C11.8907 1.14874 11.9085 1.14441 11.9267 1.14383C11.9449 1.14326 11.9629 1.14646 11.9798 1.15322C11.9967 1.15999 12.0119 1.17018 12.0247 1.18314C12.0374 1.19611 12.0473 1.21157 12.0537 1.22856C12.1621 1.58478 12.3566 1.90883 12.6199 2.17212C12.8832 2.43542 13.2072 2.62985 13.5634 2.73827C13.5821 2.7396 13.5996 2.74761 13.6129 2.76084C13.6261 2.77406 13.6341 2.79162 13.6354 2.81027C13.6433 2.82667 13.6476 2.84451 13.6482 2.86267C13.6487 2.88083 13.6455 2.89891 13.6388 2.91577C13.632 2.93263 13.6218 2.94791 13.6089 2.96063C13.5959 2.97336 13.5804 2.98325 13.5634 2.9897C13.2064 3.09747 12.8814 3.29162 12.6173 3.55495C12.3531 3.81829 12.158 4.14268 12.0492 4.49942C12.0137 4.53484 11.9772 4.57142 11.9417 4.57142C11.8377 4.57142 11.8023 4.53484 11.8023 4.49942Z",fill:"#88888A"})]});function e_(e){let{value:t,onChange:a,translatePrompt:l,onTranslatePromptChange:r,videoType:n}=e,o=(0,i.c)(),d=(0,es.n)({mutationFn:e=>(0,y.Ds)({prompt:e}),onSuccess:e=>{var t;let s=null==e||null==(t=e.data)?void 0:t.optimized_prompt;if(!s||"string"!=typeof s||!s.trim())return void _.toast.error(o("optimizeFailed"));if(s.trim().startsWith("{"))try{let e=JSON.parse(s);a(e.prompt||""),_.toast.success(o("optimizeSuccess"));return}catch(e){console.error("Failed to parse optimized prompt:",e)}a(s),_.toast.success(o("optimizeSuccess"))},onError:e=>{_.toast.error(e instanceof Error?e.message:o("optimizeFailed"))}});return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)(z.J,{className:"text-sm font-medium",children:[o("prompt")," *"]}),(0,s.jsx)(E.Bc,{children:(0,s.jsxs)(E.m_,{children:[(0,s.jsx)(E.k$,{asChild:!0,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:o("translatePrompt")}),(0,s.jsx)(ey,{checked:l,onCheckedChange:r})]})}),(0,s.jsx)(E.ZI,{side:"top",align:"end",className:"max-w-xs",children:(0,s.jsx)("p",{className:"text-xs",children:o("translatePromptDesc")})})]})})]}),(0,s.jsxs)("div",{className:"relative rounded-md border border-border bg-transparent min-h-32 transition-colors",children:[(0,s.jsx)(eb.T,{placeholder:o("videoPromptPlaceholder"),className:"min-h-28 resize-none p-2 border-0 focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent",value:t,onChange:e=>a(e.target.value),maxLength:2e3,maxLengthClassName:"bottom-[-10px]"}),(0,s.jsx)("div",{className:"absolute bottom-0 left-0 right-2 flex items-center justify-between pointer-events-none",children:(0,s.jsxs)(P.$,{variant:"ghost",size:"sm",className:(0,D.cn)("h-6 px-2 text-xs gap-1 pointer-events-auto",t.trim()?"text-primary hover:text-primary":"text-muted-foreground
1/60"),disabled:!t.trim()||d.isPending,onClick:()=>{if(!t.trim())return void _.toast.error(o("enterPrompt"));d.mutate(t)},children:[(0,s.jsx)(ek,{}),d.isPending?o("optimizing"):o("optimizePrompt")]})})]}),(0,s.jsx)(eC,{videoType:n,onIdeaClick:a})]})}var eS=a(20389);function eM(e){var t,a,r,n,o,d,c,u;let{selectedModel:m,negativePrompt:x,onNegativePromptChange:p,cameraFixed:h,onCameraFixedChange:g,multiShots:f,onMultiShotsChange:v,seed:b,onSeedChange:j,isOpen:y,onOpenChange:w}=e,N=(0,i.c)(),[C,k]=l.useState(!1),_=void 0!==y,S=_?y:C,M=l.useCallback(e=>{_?null==w||w(e):k(e)},[_,w]);return(null==m||null==(t=m.display_parameters)?void 0:t.negative_prompt)!==1&&(null==m||null==(a=m.display_parameters)?void 0:a.seed)!==1&&(null==m||null==(r=m.display_parameters)?void 0:r.multi_shots)!==1&&(null==m||null==(n=m.display_parameters)?void 0:n.camera_fixed)!==1?null:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("button",{className:"flex items-center justify-between w-full text-sm font-medium hover:text-primary transition-colors",onClick:()=>M(!S),children:[(0,s.jsx)("span",{children:N("advanced")}),(0,s.jsx)(eg.A,{className:(0,D.cn)("w-4 h-4 transition-transform duration-200",S&&"rotate-180")})]}),S&&(0,s.jsxs)("div",{className:"space-y-4 animate-in slide-in-from-top-2 fade-in duration-200",children:[(null==m||null==(o=m.display_parameters)?void 0:o.negative_prompt)===1&&(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(z.J,{className:"text-sm font-medium",children:N("negativePrompt")}),(0,s.jsx)(eb.T,{placeholder:"".concat(N("negativePromptPlaceholder"),"\n").concat(N("negativePromptExample")),className:"min-h-[150px] !text-[14px] resize-none bg-secondary/30 focus-visible:ring-0 focus-visible:ring-offset-0",value:x,onChange:e=>p(e.target.value),maxLength:2e3})]}),(null==m||null==(d=m.display_parameters)?void 0:d.camera_fixed)===1&&(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(z.J,{className:"text-sm font-medium",children:N("cameraFixed")}),(0,s.jsx)(E.Bc,{children:(0,s.jsxs)(E.m_,{children:[(0,s.jsx)(E.k$,{asChild:!0,children:(0,s.jsx)(L.A,{className:"w-3 h-3 text-muted-foreground cursor-help"})}),(0,s.jsx)(E.ZI,{children:(0,s.jsx)("p",{className:"text-xs",children:N("cameraFixedDesc")})})]})})]}),(0,s.jsx)(ey,{checked:h,onCheckedChange:g})]}),(null==m||null==(c=m.display_parameters)?void 0:c.multi_shots)===1&&(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(z.J,{className:"text-sm font-medium",children:N("multiShots")}),(0,s.jsx)(E.Bc,{children:(0,s.jsxs)(E.m_,{children:[(0,s.jsx)(E.k$,{asChild:!0,children:(0,s.jsx)(L.A,{className:"w-3 h-3 text-muted-foreground cursor-help"})}),(0,s.jsx)(E.ZI,{children:(0,s.jsx)("p",{className:"text-xs",children:N("multiShotsDesc")})})]})})]}),(0,s.jsx)(ey,{checked:f,onCheckedChange:v})]}),(null==m||null==(u=m.display_parameters)?void 0:u.seed)===1&&(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,s.jsx)(z.J,{className:"text-sm font-medium",children:N("videoSeed")}),(0,s.jsx)(E.Bc,{children:(0,s.jsxs)(E.m_,{children:[(0,s.jsx)(E.k$,{asChild:!0,children:(0,s.jsx)(L.A,{className:"w-3 h-3 text-muted-foreground cursor-help"})}),(0,s.jsx)(E.ZI,{children:(0,s.jsx)("p",{className:"text-xs",children:N("seedDesc")})})]})})]}),(0,s.jsx)(eS.p,{type:"text",placeholder:"",value:b,onChange:e=>j(e.target.value),className:"h-8 flex-1 bg-secondary/30 focus-visible:ring-0 focus-visible:ring-offset-0"})]})]})]})}var eA=a(79346);function eT(e){return e.toLowerCase()}function eP(e){let{selectedModel:t,duration:a,ratio:s,resolution:i,generateAudio:r,audioFile:n,prompt:o="",modelName:d="",isLoadingModels:c=!1,isGenerating:u=!1}=e,m=l.useMemo(()=>{var e;let a=null==t||null==(e=t.display_parameters)?void 0:e.audio_type;return 1===a?r:2===a&&null!=n},[t,r,n]),x=l.useMemo(()=>{let e=function(e){let{priceList:t,duration:a,resolution:s,hasAudio:l}=e;if(!t||0===t.length)return{totalPrice:0,matched:!1};let i=parseInt(a.replace("s",""),10),r=function(e,t,a,s){let l=eT(a),i=+!!s;for(let a of[...e].sort((e,t)=>
1{let a=4*(null!==e.resolution)+2*(null!==e.duration_seconds)+ +(null!==e.has_audio);return 4*(null!==t.resolution)+2*(null!==t.duration_seconds)+ +(null!==t.has_audio)-a})){let e=null===a.resolution||eT(a.resolution)===l,s=null===a.duration_seconds||a.duration_seconds===t,r=null===a.has_audio||a.has_audio===i;if(e&&s&&r)return a}}(t,i,s,l);return r?{totalPrice:"BY_COUNT"===r.billing_mode?r.unit_points:r.unit_points*i,matched:!0,matchedConfig:r}:{totalPrice:0,matched:!1}}({priceList:null==t?void 0:t.price,duration:a,resolution:i,hasAudio:m});return e.matched?e.totalPrice:(null==t?void 0:t.points)||0},[t,a,i,m]),p=l.useMemo(()=>{var e,s,l,i,r,n,o;let d=null!=(l=null==t||null==(e=t.display_parameters)?void 0:e.support_duration)?l:1,c=null!=(i=null==t||null==(s=t.display_parameters)?void 0:s.duration_display_mode)?i:1;if(0===d||0===c)return!0;if(!(null==a?void 0:a.toString().trim()))return!1;if(!(null==t||null==(n=t.parameter)||null==(r=n.duration)?void 0:r.length))return!0;let u=parseInt(String(a).replace("s",""),10);return!Number.isNaN(u)&&(!(null==(o=t.parameter.duration)?void 0:o.length)?[]:o.map(e=>parseInt(String(e).replace("s",""),10)).filter(e=>!Number.isNaN(e))).includes(u)},[t,a]),h=l.useMemo(()=>{var e,a;let l=(null==t||null==(e=t.display_parameters)?void 0:e.support_ratio)===1,i=(null==t||null==(a=t.display_parameters)?void 0:a.size)===1;if(!l&&!i)return!0;let r=O(t);return!r.length||r.some(e=>e.value===s)},[t,s]),g=l.useMemo(()=>{var e,a;let s=(null==t||null==(e=t.display_parameters)?void 0:e.support_resolution)===1,l=(null==t||null==(a=t.display_parameters)?void 0:a.size)===1;if(!s&&!l)return!0;let r=(0,$.L$)(t);return!r.length||r.some(e=>e.value===i)},[t,i]),f=c||!d||!o.trim()||!p||!h||!g;return{hasAudioValue:m,totalPoints:x,isGenerateDisabled:f,canGenerate:!f&&!u}}let eF=()=>(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"w-4 h-4 mr-2",children:[(0,s.jsx)("path",{d:"M6.11657 12.8823C5.78197 11.8023 5.18928 10.82 4.38978 10.0205C3.59027 9.22101 2.60802 8.62832 1.528 8.29372C1.43047 8.29372 1.33295 8.19619 1.23543 8.00115C1.13828 7.80572 1.33257 7.61029 1.528 7.51315C2.60802 7.17854 3.59027 6.58586 4.38978 5.78635C5.18928 4.98685 5.78197 4.0046 6.11657 2.92457C6.11657 2.82705 6.21409 2.72953 6.40914 2.632C6.60457 2.53486 6.8 2.72915 6.89714 2.92457C7.23174 4.0046 7.82443 4.98685 8.62393 5.78635C9.42344 6.58586 10.4057 7.17854 11.4857 7.51315C11.5463 7.55861 11.5954 7.61754 11.6293 7.68528C11.6631 7.75302 11.6808 7.8277 11.6808 7.90343C11.6808 7.97916 11.6631 8.05385 11.6293 8.12159C11.5954 8.18933 11.5463 8.24826 11.4857 8.29372C10.4057 8.62832 9.42344 9.22101 8.62393 10.0205C7.82443 10.82 7.23174 11.8023 6.89714 12.8823C6.89714 13.0777 6.70171 13.1749 6.50628 13.1749C6.31085 13.1749 6.11657 13.0777 6.11657 12.8823Z",fill:"#88888A"}),(0,s.jsx)("path",{d:"M12.3292 14.7611C12.1846 14.2863 11.9254 13.8543 11.5744 13.5033C11.2235 13.1523 10.7915 12.8931 10.3166 12.7486C10.287 12.7255 10.263 12.6961 10.2464 12.6624C10.2297 12.6288 10.2209 12.5918 10.2206 12.5543C10.2206 12.5063 10.2686 12.4583 10.3166 12.4103C10.7915 12.2658 11.2235 12.0066 11.5744 11.6556C11.9254 11.3046 12.1846 10.8726 12.3292 10.3977C12.3308 10.3728 12.3414 10.3493 12.3591 10.3316C12.3767 10.314 12.4002 10.3033 12.4252 10.3017C12.447 10.2911 12.4709 10.2852 12.4952 10.2843C12.5195 10.2835 12.5438 10.2877 12.5664 10.2967C12.5889 10.3058 12.6094 10.3194 12.6264 10.3368C12.6434 10.3542 12.6566 10.3749 12.6652 10.3977C12.8093 10.873 13.0684 11.3055 13.4194 11.6569C13.7704 12.0083 14.2026 12.2678 14.6777 12.4126C14.7027 12.4142 14.7261 12.4248 14.7438 12.4425C14.7615 12.4602 14.7721 12.4836 14.7737 12.5086C14.7843 12.5305 14.7903 12.5543 14.7911 12.5786C14.792 12.603 14.7878 12.6272 14.7787 12.6498C14.7697 12.6724 14.756 12.6928 14.7386 12.7098C14.7213 12.7268 14.7005 12.74 14.6777 12.7486C14.2028 12.8931 13.7709 13.1523 13.4199 13.5033C13.0689 13.8543 12.8097 14.2863 12.6652 14.7611C12.6172 14.8091 12.5692 14.8571 12.5212 14.8571C12.3772 14.8571 12.3292 14.8091 12.3292 14.7611Z",fill:"#88888A"}),(0,s.jsx)("path",{d:"M11.8023 4.49942C11.6939 4.1432 11.4994 3.81914 11.2361 3.55585C10.9729 3.29256 10.6488 3.09812 10.2926 2.9897C10.2706 2.97261 10.2527 2.9508 10.2402 2.92588C10.2278 2.90096 10.221 2.87356 10.2206 2.8457C10.2206 2.81027 10.256 2.7737 10.2926 2.73827C10.6488 2.62985 10.9729 2.43542 11.2361 2.17212C11.4994 1.90883 11.6939 1.58478 11.8023 1.22856C11.8036 1.2099 11.8116 1.19235 11.8249 1.17912C11.8381 1.1659 11.8556 1.15789 11.8743 1.15656C11.8907 1.14874 11.9085 1.14441 11.9267 1.14383C11.9449 1.14326 11.9629 1.14646 11.9798 1.15322C11.9967 1.15999 12.0119 1.17018 12.0247 1.18314C12.0374 1.19611 12.0473 1.21157 12.0537 1.22856C12.1621 1.58478 12.3566 1.90883 12.6199 2.17212C12.8832 2.43542 13.2072 2.62985 13.5634 2.73827C13.5821 2.7396 13.5996 2.74761 13.6129 2.76084C13.6261 2.77406 13.6341 2.79162 13.6354 2.81027C13.6433 2.82667 13.6476 2.84451 13.6482 2.86267C13.6487 2.88083 13.6455 2.89891 13.6388 2.91577C13.632 2.93263 13.6218 2.94791 13.6089 2.96063C13.5959 2.97336 13.5804 2.98325 13.5634 2.9897C13.2064 3.09747 12.8814 3.29162 12.6173 3.55495C12.3531 3.81829 12.158 4.14268 12.0492 4.49942C12.0137 4.53484 11.9772 4.57142 11.9417 4.57142C11.8377 4.57142 11.8023 4.53484 11.8023 4.49942Z",fill:"#88888A"})]});function ez(e){let{onGenerate:t,selectedModel:a,disabled:l=!1,isGenerating:r=!1,duration:n,ratio:o,resolution:d,generateAudio:c,audioFile:u}=e,m=(0,i.c)(),{totalPoints:x}=eP({selectedModel:a,duration:n,ratio:o,resolution:d,generateAudio:c,audioFile:u});return(0,s.jsxs)("div",{className:"px-4 py-4 space-y-2 shrink-0 border-t",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(eA.A,{className:"w-3.5 h-3.5 text-yellow-500 fill-yellow-500"}),(0,s.jsx)("span",{className:"text-muted-foreground",children:m("creditsRequired")}),(0,s.jsx)(E.Bc,{children:(0,s.jsxs)(E.m_,{children:[(0,s.jsx)(E.k$,{asChild:!0,children:(0,s.jsx)(L.A,{className:"w-3.5 h-3.5 text-muted-foreground cursor-help"})}),(0,s.jsxs)(E.ZI,{children:[(0,s.jsx)("p",{className:"text-xs",children:m("videoCreditsRequired1")}),(0,s.jsx)("p",{className:"text-xs",children:m("videoCreditsRequired2")})]})]})})]}),(0,s.jsxs)("span",{className:"font-medium",children:[(0,s.jsx)("span",{className:"bg-clip-text text-transparent",style:{backgroundImage:"linear-gradient(135deg, #4B98FF 0%, #5859FF 99.61%)"},children:x})," ",m("credits")]})]}),(0,s.jsx)(P.$,{className:"w-full h-11 text-base font-semibold shadow-lg shadow-primary/20",onClick:t,disabled:l||r,children:r?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(et.A,{className:"w-4 h-4 mr-2 animate-spin"}),m("generating")||"Generating..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eF,{}),m("generate")]})})]})}function eD(e){var t,a;let{onGenerate:r,className:n}=e,d=(0,i.c)(),c=(0,V.a)(),{videoType:m,prompt:x,model:p,models:h,isLoadingModels:g,duration:f,ratio:v,resolution:b,generateAudio:j,audioFile:y,translatePrompt:w,negativePrompt:N,cameraFixed:C,multiShots:_,seed:S,isGenerating:M,advancedSettingsOpen:A,setVideoType:T,setPrompt:B,setModel:Y,setDuration:q,setRatio:K,setResolution:X,setGenerateAudio:J,setAudioFile:ee,setTranslatePrompt:et,setNegativePrompt:ea,setCameraFixed:es,setMultiShots:el,setSeed:ei,setAdvancedSettingsOpen:er}=(0,k.K)((0,F.k)(e=>({videoType:e.videoType,prompt:e.prompt,model:e.model,models:e.models,isLoadingModels:e.isLoadingModels,duration:e.duration,ratio:e.ratio,resolution:e.resolution,generateAudio:e.generateAudio,audioFile:e.audioFile,translatePrompt:e.translatePrompt,negativePrompt:e.negativePrompt,cameraFixed:e.cameraFixed,multiShots:e.multiSh
1ots,seed:e.seed,isGenerating:e.isGenerating,advancedSettingsOpen:e.advancedSettingsOpen,setVideoType:e.setVideoType,setPrompt:e.setPrompt,setModel:e.setModel,setDuration:e.setDuration,setRatio:e.setRatio,setResolution:e.setResolution,setGenerateAudio:e.setGenerateAudio,setAudioFile:e.setAudioFile,setTranslatePrompt:e.setTranslatePrompt,setNegativePrompt:e.setNegativePrompt,setCameraFixed:e.setCameraFixed,setMultiShots:e.setMultiShots,setSeed:e.setSeed,setAdvancedSettingsOpen:e.setAdvancedSettingsOpen}))),en=l.useMemo(()=>h.find(e=>e.name===p),[h,p]),{createSimilarVideo:ed,isLoadingModels:ec,models:eu,setModel:ex,setPrompt:ep,setRatio:eg,setResolution:ef,setDuration:eb,setGenerateAudio:ej,setNegativePrompt:ew,setSeed:eN,setMultiShots:eC,setCameraFixed:ek,clearCreateSimilarVideo:eS,setSkipModelAutoAdjust:eA,setLastAppliedCreateSimilarModelName:eT}=(0,k.K)((0,F.k)(e=>({createSimilarVideo:e.createSimilarVideo,isLoadingModels:e.isLoadingModels,models:e.models,setModel:e.setModel,setPrompt:e.setPrompt,setRatio:e.setRatio,setResolution:e.setResolution,setDuration:e.setDuration,setGenerateAudio:e.setGenerateAudio,setNegativePrompt:e.setNegativePrompt,setSeed:e.setSeed,setMultiShots:e.setMultiShots,setCameraFixed:e.setCameraFixed,clearCreateSimilarVideo:e.clearCreateSimilarVideo,setSkipModelAutoAdjust:e.setSkipModelAutoAdjust,setLastAppliedCreateSimilarModelName:e.setLastAppliedCreateSimilarModelName})));(0,l.useEffect)(()=>{if(!ed||ec||0===eu.length)return;(function(e){let t=null!=e.videoModelId&&eu.find(t=>Number(t.id)===Number(e.videoModelId))||eu.find(t=>t.display_name===e.modelDisplayName||t.logo===e.modelLogo);if(t&&(ex(t.name),eT(t.name)),e.prompt&&ep(e.prompt),e.ratio&&eg(e.ratio),e.resolution&&ef(e.resolution),e.durationSeconds){var a;let s=(null==t||null==(a=t.parameter)?void 0:a.duration)||[];eb(function(e,t){let a="".concat(e);return t.includes(a)||t.includes("".concat(e,"s")),a}(e.durationSeconds,s))}void 0!==e.hasAudio&&ej(1===e.hasAudio),ew(e.negativePrompt||""),eN(e.seed||""),eC(1===e.multiShots),ek(1===e.cameraFixed)})(ed),eS();let e=setTimeout(()=>eA(!1),200);return()=>clearTimeout(e)},[ed,ec,eu]);let eF=(0,l.useRef)(!1),{isLoadingModels:eD,models:eL,setModel:eI,setPrompt:eE,setRatio:eV,setResolution:eB,setSkipModelAutoAdjust:eR,setLastAppliedCreateSimilarModelName:eO}=(0,k.K)((0,F.k)(e=>({isLoadingModels:e.isLoadingModels,models:e.models,setModel:e.setModel,setPrompt:e.setPrompt,setRatio:e.setRatio,setResolution:e.setResolution,setSkipModelAutoAdjust:e.setSkipModelAutoAdjust,setLastAppliedCreateSimilarModelName:e.setLastAppliedCreateSimilarModelName})));(0,l.useEffect)(()=>{if(eF.current||eD||0===eL.length)return;let e=W.a.getState().peekVideoPayload();if(!e)return;eF.current=!0,eR(!0);let t=e.model&&eL.some(t=>t.name===e.model)?eL.find(t=>t.name===e.model):eL[0];if(t&&(eI(t.name),eO(t.name)),e.prompt&&eE(e.prompt),e.aspectRatio&&t){var a;let s=O(t),l=0===s.length||s.some(t=>t.value===e.aspectRatio)?e.aspectRatio:null==(a=s[0])?void 0:a.value;l&&eV(l)}let s=(0,H.W6)(e.quality,t);s&&eB(s),W.a.getState().clearVideoPayload();let l=setTimeout(()=>eR(!1),200);return()=>clearTimeout(l)},[eD,eL,eO,eI,eE,eV,eB,eR]),function(e){var t;let{lastAppliedCreateSimilarModelName:a,ratio:s,resolution:i,duration:r,setDuration:n,setRatio:o,setResolution:d,setGenerateAudio:c,setTranslatePrompt:u,setSeed:m,setCameraFixed:x,setMultiShots:p,setLastAppliedCreateSimilarModelName:h}=(0,k.K)((0,F.k)(e=>({lastAppliedCreateSimilarModelName:e.lastAppliedCreateSimilarModelName,ratio:e.ratio,resolution:e.resolution,duration:e.duration,setDuration:e.setDuration,setRatio:e.setRatio,setResolution:e.setResolution,setGenerateAudio:e.setGenerateAudio,setTranslatePrompt:e.setTranslatePrompt,setSeed:e.setSeed,setCameraFixed:e.setCameraFixed,setMultiShots:e.setMultiShots,setLastAppliedCreateSimilarModelName:e.setLastAppliedCreateSimilarModelName}))),g=(0,l.useRef)(null);(0,l.useEffect)(()=>{null!=a&&(g.current=a,h(null))},[a,h]);let f=null!=(t=null==e?void 0:e.name)?t:null,v=null!=f&&g.current!==f,b=null!=a;(0,l.useEffect)(()=>{if(!e||!v||b)return;c(!0),u(!1),m(""),x(!1),p(!1);let t=U(e);t&&n(t);let a=Z(e);a&&d(a),g.current=f},[e,v,f,b,n,d,c,u,m,x,p]),(0,l.useEffect)(()=>
1{if(!e||function(e,t){var a,s;if(!(null==t||null==(s=t.parameter)||null==(a=s.duration)?void 0:a.length))return!0;let l=parseInt(String(e).replace("s",""),10);return!Number.isNaN(l)&&G(t.parameter.duration).includes(l)}(r,e))return;let t=U(e);t&&n(t)},[e,r,n]),(0,l.useEffect)(()=>{let t=O(null!=e?e:void 0);if(!t.length||t.some(e=>e.value===s))return;let a=function(e){var t;let a=O(null!=e?e:void 0);if(!a.length)return;let s=a.find(e=>"16:9"===e.value);return(null==s?void 0:s.value)||(null==(t=a[0])?void 0:t.value)}(e);a&&o(a)},[e,s,o]),(0,l.useEffect)(()=>{if(!e||(0,$.L$)(e).some(e=>e.value===i))return;let t=Z(e);t&&d(t)},[e,i,d]),(0,l.useEffect)(()=>{if(!e)return;let t="minimax/hailuo-2.3"===e.name,a=String(r).replace("s","");t&&"1080p"===i&&"10"===a&&n("6")},[e,i,r,n]),(0,l.useEffect)(()=>{if(!e||!(0,$.VT)(i,e,r))return;let t=[...(0,$.L$)(e)].filter(t=>!(0,$.VT)(t.value,e,r)).sort((e,t)=>e.order-t.order)[0];t&&d(t.value)},[e,i,r,d])}(en);let e$=c?ev:Q,eG=null==en||null==(t=en.display_parameters)?void 0:t.audio_type,eU=(null==en||null==(a=en.parameter)?void 0:a.aspect_ratio)&&en.parameter.aspect_ratio.length>0,{totalPoints:eZ,isGenerateDisabled:eH,canGenerate:eW}=eP({selectedModel:en,duration:f,ratio:v,resolution:b,generateAudio:j,audioFile:y,prompt:x,modelName:p,isLoadingModels:g,isGenerating:M});return(0,s.jsx)("div",{className:(0,D.cn)("h-full min-h-0 flex justify-center",n),children:(0,s.jsxs)(o.Zp,{className:(0,D.cn)("w-full h-full min-h-0 flex flex-col overflow-hidden",!c&&"md:w-88 fhd:w-96",c&&"border-none dark:bg-transparent dark:shadow-none"),children:[!c&&(0,s.jsx)("div",{className:"px-4 pt-4 shrink-0",children:(0,s.jsx)("div",{className:"flex items-center gap-2 justify-between",children:(0,s.jsx)(eh,{value:m,onChange:T})})}),(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-4 min-h-0 scrollbar-none",children:[(0,s.jsx)(e$,{models:h,selectedModel:p,onModelChange:Y,loading:g}),(0,s.jsx)(e_,{value:x,onChange:B,translatePrompt:w,onTranslatePromptChange:et,videoType:m}),1===eG&&(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(z.J,{className:"text-sm font-medium",children:d("generateAudio")}),(0,s.jsx)(E.Bc,{children:(0,s.jsxs)(E.m_,{children:[(0,s.jsx)(E.k$,{asChild:!0,children:(0,s.jsx)(L.A,{className:"w-3 h-3 text-muted-foreground cursor-help"})}),(0,s.jsx)(E.ZI,{children:(0,s.jsx)("p",{className:"text-xs",children:d("generateAudioContext")})})]})})]}),(0,s.jsx)(ey,{checked:j,onCheckedChange:J})]}),2===eG&&(0,s.jsx)(eo,{audioFile:y,onAudioFileChange:ee}),(0,s.jsx)(em,{value:f,onChange:q,label:d("duration"),selectedModel:en,resolution:b}),eU&&(0,s.jsx)(R,{value:v,onChange:K,selectedModel:en}),(0,s.jsx)($.Mk,{value:b,onChange:X,selectedModel:en,duration:f}),(0,s.jsx)(eM,{selectedModel:en,negativePrompt:N,onNegativePromptChange:ea,cameraFixed:C,onCameraFixedChange:es,multiShots:_,onMultiShotsChange:el,seed:S,onSeedChange:ei,isOpen:A,onOpenChange:er}),c&&(0,s.jsxs)("div",{className:"pt-4 space-y-2 border-t border-border/60",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)(u.g,{className:"text-[14px] shrink-0"}),(0,s.jsx)("span",{className:"text-muted-foreground",children:d("creditsRequired")}),(0,s.jsx)(E.Bc,{children:(0,s.jsxs)(E.m_,{children:[(0,s.jsx)(E.k$,{asChild:!0,children:(0,s.jsx)(L.A,{className:"w-3.5 h-3.5 text-muted-foreground cursor-help shrink-0"})}),(0,s.jsxs)(E.ZI,{className:"max-w-xs",children:[(0,s.jsx)("p",{className:"text-xs",children:d("videoCreditsRequired1")}),(0,s.jsx)("p",{className:"text-xs",children:d("videoCreditsRequired2")})]})]})})]}),(0,s.jsxs)("span",{className:"font-medium text-primary",children:[eZ," ",d("credits")]})]}),(0,s.jsx)(P.$,{type:"button",className:(0,D.cn)("w-full h-10 rounded-sm border-0 overflow-hidden",eW?"!bg-transparent text-white hover:opacity-90":"bg-muted text-muted-foreground"),style:eW?{backgroundImage:"url('/generate.svg')",backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}:void 0,disabled:!eW,onClick:()=>null==r?void 0:r(),"data-track-id":"video-generate",children:M?d("generating"):(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,s.jsx)(I.A,{className:"w-4 h-4 shrink-0"}),d("generate")]})})]})]}),!c&&(0,s.jsx)(ez,{onGenerate:()=>null==r?void 0:r(),selectedModel:en,disabled:eH,isGenerating:M,duration:f,ratio:v,resolution:b,generateAudio:j,audioFile:y})]})})}var eL=a(15395),eI=a(1657),eE=a(55164),eV=a(2656),eB=a(15452),eR=a(81757),eO=a(59923),e$=a.n(eO);let eG=e=>{let{label:t,isSelected:a,hasSubmenu:l,isExpanded:i,onClick:r,isSubItem:n}=e;return(0,s.jsxs)("button",{className:(0,D.cn)("w-full text-left rounded-md text-sm hover:bg-accent flex items-center justify-between",n?"px-2 py-1.5":"px-2 py-2",a&&"bg-accent"),onClick:r,children:[(0,s.jsx)("span",{children:t}),l?(0,s.jsx)(eg.A,{className:(0,D.cn)("w-4 h-4 transition-transform",i&&"rotate-180")}
1):a&&(0,s.jsx)(ef.A,{className:"w-4 h-4"})]})},eU=e=>{let{filters:t,onFiltersChange:a,showOnlyType:r=!1}=e,n=(0,i.c)(),[o,d]=l.useState(!1),[c,u]=l.useState(!1),[m,x]=l.useState(!1),[p,h]=l.useState(t.start_time?new Date(t.start_time):void 0),[g,f]=l.useState(t.end_time?new Date(t.end_time):void 0),[v,b]=l.useState("all"),[j,y]=l.useState(null),w=l.useMemo(()=>[{id:"all",value:"all",label:n("allCategory")},{id:"image",label:n("imageCategory"),children:[{value:"text_to_image",label:n("textToImageType")},{value:"image_to_image",label:n("imageToImageType")}]},{id:"video",label:n("videoCategory"),children:[{value:"text_to_video",label:n("textToVideoType")}]},{id:"effects",value:"effects",label:n("effectsCategory")},{id:"tools",value:"tools",label:n("toolsCategory")}],[n]),N=l.useMemo(()=>[{value:"all",label:n("all"),days:0},{value:"lastWeek",label:n("lastWeek"),days:7},{value:"lastMonth",label:n("lastMonth"),days:30},{value:"lastThreeMonths",label:n("lastThreeMonths"),days:90}],[n]);l.useEffect(()=>{if(h(t.start_time?new Date(t.start_time):void 0),f(t.end_time?new Date(t.end_time):void 0),t.start_time||t.end_time){let e=N.find(e=>{if(0===e.days)return!1;let a=e$()().subtract(e.days,"day").format("YYYY-MM-DD"),s=e$()().format("YYYY-MM-DD");return t.start_time===a&&t.end_time===s});b((null==e?void 0:e.value)||"custom")}else b("all")},[t.start_time,t.end_time,N]);let C=e=>s=>{let l="start"===e?"start_time":"end_time";("start"===e?h:f)(s),b("custom");let i=(0,eL._)({},t);s?i[l]=e$()(s).format("YYYY-MM-DD"):delete i[l],a(i)},k=e=>{let s=(0,eL._)({},t);"all"===e?delete s.category_type:s.category_type=e,a(s),u(!1),y(null)};return(0,s.jsx)("div",{className:"flex items-center gap-2",children:(0,s.jsxs)("div",{className:"flex items-center border rounded-xl h-[1.95rem] bg-background",children:[!r&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(Y.AM,{open:o,onOpenChange:d,children:[(0,s.jsx)(Y.Wv,{asChild:!0,children:(0,s.jsxs)("button",{className:"flex items-center gap-1 px-3 h-full hover:bg-accent rounded-l-md transition-colors",children:[(0,s.jsx)("span",{className:"text-sm",children:(()=>{if(!t.start_time&&!t.end_time)return n("time");let e=N.find(e=>e.value===v&&"all"!==e.value);return e?e.label:p&&g?"".concat(e$()(p).format("YYYY-MM-DD")," ~ ").concat(e$()(g).format("YYYY-MM-DD")):n("time")})()}),(0,s.jsx)(eg.A,{className:(0,D.cn)("w-4 h-4 transition-transform",o&&"rotate-180")})]})}),(0,s.jsx)(Y.hl,{className:"w-auto p-0",align:"start",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4 p-4",children:[(0,s.jsxs)("div",{className:"flex gap-1 items-center",children:[(0,s.jsx)(eR.l,{value:p,onChange:C("start"),placeholder:n("startDate"),allowClear:!0,disabled:e=>e>new Date||!!g&&e>g}),(0,s.jsx)("span",{className:"text-muted-foreground",children:"-"}),(0,s.jsx)(eR.l,{value:g,onChange:C("end"),placeholder:n("endDate"),allowClear:!0,disabled:e=>e>new Date||!!p&&e<p})]}),(0,s.jsx)("div",{className:"space-y-1 border-t pt-3",children:N.map(e=>(0,s.jsx)(eG,{label:e.label,isSelected:v===e.value,onClick:()=>(e=>{b(e.value);let s=(0,eL._)({},t);if(0===e.days)delete s.start_time,delete s.end_time,h(void 0),f(void 0);else{let t=new Date(Date.now()-864e5*e.days),a=new Date;s.start_time=e$()(t).format("YYYY-MM-DD"),s.end_time=e$()(a).format("YYYY-MM-DD"),h(t),f(a)}a(s),d(!1)})(e)},e.value))})]})})]}),(0,s.jsx)("div",{className:"w-px h-4 bg-border"})]}),(0,s.jsxs)(Y.AM,{open:c,onOpenChange:e=>{u(e),e||y(null)},children:[(0,s.jsx)(Y.Wv,{asChild:!0,children:(0,s.jsxs)("button",{className:(0,D.cn)("flex items-center gap-1 px-3 h-full hover:bg-accent transition-colors",r&&"rounded-xl"),children:[(0,s.jsx)("span",{className:"text-sm",children:t.category_type&&"all"!==t.category_type&&({text_to_video:n("textToVideo"),text_to_image:n("textToImageType"),image_to_image:n("imageToImageType"),effects:n("effectsCategory"),tools:n("toolsCategory")})[t.category_type]||n("allCategory")}),(0,s.jsx)(eg.A,{className:(0,D.cn)("w-4 h-4 transition-transform",c&&"rotate-180")})]})}),(0,s.jsx)(Y.hl,{className:"w-auto p-0",align:"start",children:(0,s.jsx)("div",{className:"p-2 min-w-[160px]",children:w.map(e=>(0,s.jsx)("div",{children:"children"in e&&e.children?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eG,{label:e.label,isSelected:(e=>"children"in e&&e.children?e.children.some(e=>e.value===t.category_type):"all"===e.id?!t.category_type||"all"===t.category_type:t.category_type===e.value)(e),hasSubmenu:!0,isExpanded:j===e.id,onClick:()=>y(j===e.id?null:e.id)}),j===e.id&&(0,s.jsx)("div",{className:"ml-3 mt-1 border-l pl-2 space-y-1",children:e.children.map(e=>(0,s.jsx)(eG,{label:e.label,isSelected:t.category_type===e.value,onClick:()=>k(e.value),isSubItem:!0},e.value))})]}):(0,s.jsx)(eG,{label:e.label,isSelected:t.category_type===e.value,onClick:()=>k(e.value)})},e.id))})})]}),!r&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"w-px h-4 bg-border"}),(0,s.jsxs)(Y.AM,{open:m,onOpenChange:x,children:[(0,s.jsx)(Y.Wv,{asChild:!0,children:(0,s.jsxs)("button",{className:"flex items-center gap-1 px-3 h-full hover:bg-accent rounded-r-xl transition-colors",children:[(0,s.jsx)("span",{className:"text-sm",children:1===t.operation?n("collectedOnly"):n("operationType")}),(0,s.jsx)(eg.A,{className:(0,D.cn)("w-4 h-4 transition-transform",m&&"rotate-180")}
1)]})}),(0,s.jsx)(Y.hl,{className:"w-auto p-0",align:"start",children:(0,s.jsx)("div",{className:"p-2",children:[{value:0,label:n("allOperations")},{value:1,label:n("collectedOnly")}].map(e=>(0,s.jsx)(eG,{label:e.label,isSelected:0===e.value?!t.operation:t.operation===e.value,onClick:()=>(e=>{let s=(0,eL._)({},t);0===e?delete s.operation:s.operation=e,a(s),x(!1)})(e.value)},e.value))})})]})]})]})})};var eZ=a(63701);let eH=e=>{let{filters:t,onFiltersChange:a,showOnlyType:n=!1,className:o}=e,d=(0,i.c)(),[c,u]=l.useState(!1),[m,x]=l.useState(!1),[p,h]=l.useState(!1),g=l.useMemo(()=>[{value:"all",label:d("all"),days:0},{value:"lastWeek",label:d("lastWeek"),days:7},{value:"lastMonth",label:d("lastMonth"),days:30},{value:"lastThreeMonths",label:d("lastThreeMonths"),days:90}],[d]),f=l.useMemo(()=>[{id:"all",value:"all",label:d("allCategory")},{id:"image",label:d("imageCategory"),children:[{value:"text_to_image",label:d("textToImageType")},{value:"image_to_image",label:d("imageToImageType")}]},{id:"video",label:d("videoCategory"),children:[{value:"text_to_video",label:d("textToVideoType")}]},{id:"effects",value:"effects",label:d("effectsCategory")},{id:"tools",value:"tools",label:d("toolsCategory")}],[d]),v=l.useMemo(()=>[{value:0,label:d("all")},{value:1,label:d("collectedOnly")}],[d]),b=e=>{let s=(0,eL._)({},t);"all"===e?delete s.category_type:s.category_type=e,a(s),u(!1)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(P.$,{variant:"ghost",size:"icon",onClick:()=>u(!0),className:(0,D.cn)("text-sm w-5",o),children:(0,s.jsx)(eZ.A,{className:"h-4 w-4"})}),(0,s.jsx)(r._s,{open:c,onOpenChange:u,children:(0,s.jsxs)(r.zj,{className:"h-auto max-h-[80vh]",children:[(0,s.jsx)(r.gk,{className:"sr-only",children:d("filter")}),(0,s.jsxs)("div",{className:"p-3 pt-4 space-y-6",children:[!n&&(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("label",{className:"text-sm font-medium",children:d("time")}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:g.map(e=>(0,s.jsx)(P.$,{variant:(e=>{if(!t.start_time&&!t.end_time)return 0===e.days;if(0===e.days)return!1;let a=new Date,s=new Date(a.getTime()-864e5*e.days).toISOString().split("T")[0],l=a.toISOString().split("T")[0];return t.start_time===s&&t.end_time===l})(e)?"default":"outline",size:"sm",className:"rounded-full border border-transparent px-3 text-xs",onClick:()=>(e=>{let s=(0,eL._)({},t);if(0===e.days)delete s.start_time,delete s.end_time;else{let t=new Date;s.start_time=new Date(t.getTime()-864e5*e.days).toISOString().split("T")[0],s.end_time=t.toISOString().split("T")[0]}a(s)})(e),children:e.label},e.value))})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("label",{className:"text-sm font-medium",children:d("textToVideo")}),(0,s.jsx)("div",{className:"flex flex-col gap-2",children:f.map(e=>(0,s.jsx)("div",{children:"children"in e&&e.children?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(P.$,{variant:(e=>"children"in e&&e.children?e.children.some(e=>e.value===t.category_type):"all"===e.id?!t.category_type||"all"===t.category_type:t.category_type===e.value)(e)?"default":"outline",size:"sm",className:"rounded-full border border-transparent px-3 text-xs",onClick:()=>{"image"===e.id&&x(!m),"video"===e.id&&h(!p)},children:[e.label,(0,s.jsx)(eg.A,{className:(0,D.cn)("w-3 h-3 ml-1 transition-transform","image"===e.id&&m&&"rotate-180")})]}),("image"===e.id&&m||"video"===e.id&&p)&&(0,s.jsx)("div",{className:"ml-4 mt-2 flex flex-wrap gap-2",children:e.children.map(e=>(0,s.jsx)(P.$,{variant:t.category_type===e.value?"default":"outline",size:"sm",className:"rounded-full border border-transparent px-3 text-xs",onClick:()=>b(e.value),children:e.label},e.value))})]}):(0,s.jsx)(P.$,{variant:t.category_type===e.value?"default":"outline",size:"sm",className:"rounded-full border border-transparent px-3 text-xs",onClick:()=>b(e.value),children:e.label})},e.id))})]}),!n&&(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("label",{className:"text-sm font-medium",children:d("operationType")}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:v.map(e=>(0,s.jsx)(P.$,{variant:0===e.value?t.operation?"outline":"default":t.operation===e.value?"default":"outline",size:"sm",className:"rounded-full border border-transparent px-3 text-xs",onClick:()=>(e=>{let s=(0,eL._)({},t);0===e?delete s.operation:s.operation=e,a(s)})(e.value),children:e.label},e.value))})]})]})]})})]})},eW=e=>{let{activeTab:t,onTabChange:a,onMobileMenuOpen:l,filters:r,onFiltersChange:n}=e,o=(0,i.c)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"hidden",children:(0,s.jsxs)("div",{className:"h-12 px-3 flex items-center justify-between gap-3",children:[(0,s.jsx)(P.$,{variant:"ghost",size:"icon",className:"flex-shrink-0 w-5",onClick:l,children:(0,s.jsx)(eB.A,{className:"!size-5"})}),(0,s.jsx)("div",{className:"flex-1 flex justify-center",children:a&&(0,s.jsx)(ep.tU,{value:t,onValueChange:e=>a(e),children:(0,s.jsxs)(ep.j7,{className:"h-8",children:[(0,s.jsx)(ep.Xi,{value:"myCreations",className:"h-7 text-xs px-3 whitespace-nowrap",children:o("myProjects")}),(0,s.jsx)(ep.Xi,{value:"examples",className:"h-7 text-xs px-3 whitespace-nowrap",children:o("examples")})]})})}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[r&&n&&"myCreations"===t&&(0,s.jsx)(eH,{filters:r,onFiltersChange:n,showOnlyType:!1}),(!r||!n||"myCreations"!==t)&&(0,s.jsx)("div",{className:"w-5"})]})]})}),(0,s.jsx)("div",{className:"hidden md:block border-b",children:(0,s.jsxs)("div",{className:"px-4 py-3 flex items-center justify-between gap-4",children:[(0,s.jsx)("div",{className:"flex items-center gap-3",children:a&&(0,s.jsx)(ep.tU,{value:t,onValueChange:e=>a(e),children:(0,s.jsxs)(ep.j7,{className:"h-8",children:[(0,s.jsx)(ep.Xi,{value:"myCreations",className:"h-7 px-4 whitespace-nowrap",children:o("myProjects")}),(0,s.jsx)(ep.Xi,{value:"examples",className:"h-7 px-4 whitespace-nowrap",children:o("examples")})]})})}),r&&n&&"myCreations"===t&&(0,s.jsx)(eU,{filters:r,onFiltersChange:n,showOnlyType:!1})]})})]})};var eY=a(72996),eq=a(77914),eK=a(17789);let eX=e=>{let{prompt:t,videoId:a,isGenerating:r,copiedPromptId:n,hoveredPromptId:o,onCopyPrompt:d,onUsePromptOnly:c,onMouseEnter:u,onMouseLeave:m}=e,x=(0,V.a)(),p=(0,i.c)(),h=t||"",g=h.length>100,[f,v]=l.useState(!1),b=!!t;return x?(0,s.jsx)("div",{className:"py-1 pb-2",children:(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)("div",{className:(0,D.cn)("text-sm font-medium leading-relaxed transition-all flex-1 text-foreground",!f&&"line-clamp-2"),children:h}),g&&(0,s.jsx)(P.$,{variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>v(!f),children:f?(0,s.jsx)(eY.A,{className:"h-3 w-3"}):(0,s.jsx)(eg.A,{className:"h-3 w-3"})})]})}):(0,s.jsx)("div",{className:"py-4 pb-3",children:(0,s.jsxs)("div",{className:"relative",onMouseEnter:u,onMouseLeave:m,children:[(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("div",{className:(0,D.cn)("text-sm font-medium leading-relaxed transition-all flex-1 line-clamp-2 text-foreground"),children:h}),!g&&b&&(0,s.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0",children:[(0,s.jsx)(P.$,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:e=>t&&d(e,t,a),children:(0,s.jsx)(eq.A,{className:"w-4 h-4"})}),(0,s.jsx)(E.Bc,{delayDuration:300,children:(0,s.jsxs)(E.m_,{children:[(0,s.jsx)(E.k$,{asChild:!0,children:(0,s.jsxs)(P.$,{variant:"outline",size:"sm",className:"h-7 px-2",onClick:c,children:[(0,s.jsx)(eK.A,{className:"w-4 h-4"}),p("useThisPromptButton")]})}),(0,s.jsx)(E.ZI,{align:"end",children:p("useThisPromptTooltip")})]})})]})]}),o===a&&g&&!r&&(0,s.jsx)("div",{className:"absolute left-0 top-0 right-0 z-20 bg-muted backdrop-blur-sm rounded-sm max-h-96 p-0 pb-10 shadow-sm overflow-y-auto",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("p",{className:"text-sm font-medium leading-relaxed flex-1",children:h}),b&&(0,s.jsxs)("div",{className:"absolute -bottom-7 right-2",children:[(0,s.jsxs)(P.$,{variant:"outline",size:"sm",className:"h-7 px-2",onClick:e=>t&&d(e,t,a),children:[n===a?(0,s.jsx)(ef.A,{className:"w-4 h-4 text-primary"}):(0,s.jsx)(eq.A,{className:"w-4 h-4"}),p("copy")]}),(0,s.jsx)(E.Bc,{delayDuration:300,children:(0,s.jsxs)(E.m_,{children:[(0,s.jsx)(E.k$,{asChild:!0,children:(0,s.jsxs)(P.$,{variant:"outline",size:"sm",className:"h-7 px-2",onClick:c,children:[(0,s.jsx)(eK.A,{}),p("useThisPromptButton")]})}),(0,s.jsx)(E.ZI,{align:"end",children:p("useThisPromptTooltip")})]})})]})]})})]})})};var eJ=a(83108),eQ=a(29764),e0=a(55624),e1=a(99247),e2=a(7737),e5=a(30620),e3=a(8338),e4=a(93171),e8=a(80357),e6=a(62841),e7=a(17773),e9=a(31964);let te=e=>{let{icon:t,tooltip:a,onClick:l,disabled:i,className:r}=e;return(0,s.jsx)(E.Bc,{delayDuration:300,children:(0,s.jsxs)(E.m_,{children:[(0,s.jsx)(E.k$,{asChild:!0,children:(0,s.jsx)(P.$,{size:"icon",variant:"secondary",className:(0,D.cn)("h-8 w-8 rounded-full bg-black/50 hover:bg-black/70 text-white border-none",r),onClick:l,disabled:i,children:t})}),(0,s.jsx)(E.ZI,{children:a})]})})},tt=e=>{let{onDelete:t,deleteText:a,moreText:l}=e;return(0,s.jsxs)(e9.rI,{children:[(0,s.jsx)(E.Bc,{delayDuration:300,children:(0,s.jsxs)(E.m_,{children:[(0,s.jsx)(E.k$,{asChild:!0,children:(0,s.jsx)(e9.ty,{asChild:!0,children:(0,s.jsx)(P.$,{size:"icon",variant:"secondary",className:"h-8 w-8 rounded-full bg-black/50 hover:bg-black/70 text-white border-none",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(eQ.A,{className:"w-4 h-4"})})})}),(0,s.jsx)(E.ZI,{children:l})]})}),(0,s.jsx)(e9.SQ,{align:"end",children:(0,s.jsxs)(e9._2,{onClick:t,className:"text-destructive cursor-pointer",children:[(0,s.jsx)(e0.A,{className:"h-4 w-4 mr-2"}),a]})})]})},ta=e=>{let{icon:t,tooltip:a,onClick:l,disabled:i,className:r}=e;return(0,s.jsx)(E.Bc,{delayDuration:300,children:(0,s.jsxs)(E.m_,{children:[(0,s.jsx)(E.k$,{asChild:!0,children:(0,s.jsx)(P.$,{size:"icon",variant:"secondary",className:(0,D.cn)("h-8 w-8 bg-background/80 backdrop-blur-sm hover:bg-background shadow-md",r),onClick:l,disabled:i,children:t})}),(0,s.jsx)(E.ZI,{children:a})]})})},ts=e=>{let{thumbnail:t,video:a,readOnly:n,isGenerating:o,onVideoClick:d,onDownload:c,onShare:u,onCollect:m,onDelete:x,onCreateSimilar:p,isDownloading:h,isCollecting:g}=e,f=(0,V.a)(),v=(0,i.c)(),b=function(e){return void 0!==e&&e>=1&&e<=4}(a.parent_type_id),j=b?null:a.watermark_url||a.video_url,y=a.cover_url||t,[w,N]=(0,l.useState)(!1),[C,k]=(0,l.useState)(!1),[_,S]=(0,l.useState)(!1),[M,A]=(0,l.useState)(!1),T=(0,l.useRef)(null),[F,z]=(0,l.useState)(!0),[L,I]=(0,l.useState)(!0),[E,B]=(0,l.useState)(0),[R,O]=(0,l.useState)(0),{videoRef:$,isPlaying:G,setIsPlaying:U,isMuted:Z,currentTime:H,duration:W,isHovering:Y,setIsHovering:q,togglePlay:K,toggleMute:X,handleFullscreen:Q,handleProgressClick:et,handleTimeUpdate:ea,handleLoadedMetadata:es}=function(e,t){let a=(0,l.useRef)(null),[s,i]=(0,l.useState)(!1),[r,n]=(0,l.useState)(!0),[o,d]=(0,l.useState)(0),[c,u]=(0,l.useState)(0),[m,x]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let s=a.current;s&&e&&!t&&(m&&s.paused?s.play().catch(()=>{}):m||s.paused||s.pause())},[m,e,t]);let p=(0,l.useCallback)(e=>{e.stopPropagation(),a.current&&(s?a.current.pause():a.current.play())},[s]),h=(0,l.useCallback)(e=>{e.stopPropagation(),a.current&&(a.current.muted=!r,n(!r))},[r]),g=(0,l.useCallback)(e=>{var t;e.stopPropagation(),null==(t=a.current)||t.requestFullscreen()},[]),f=(0,l.useCallback)(e=>{if(e.stopPropagation(),!a.current||!c)return;let t=e.currentTarget.getBoundingClientRect(),s=(e.clientX-t.left)/t.width*c;a.current.currentTime=s,d(s)},[c]);return{videoRef:a,isPlaying:s,setIsPlaying:i,isMuted:r,currentTime:o,duration:c,isHovering:m,setIsHovering:x,togglePlay:p,toggleMute:h,handleFullscreen:g,handleProgressClick:f,handleTimeUpdate:(0,l.useCallback)(e=>{d(e.currentTarget.currentTime)},[]),handleLoadedMetadata:(0,l.useCallback)(e=>{u(e.currentTarget.duration)},[])}}(j,o),el=(0,l.useCallback)(()=>{q(!0),j&&!o&&N(e=>e||!0)},[j,o]),ei=(0,l.useCallback)(()=>{q(!1)},[]),er=(0,l.useCallback)(()=>
1{if(j&&!o&&N(e=>e||!0),f&&j&&!o){$.current&&!$.current.paused&&$.current.pause(),U(!1),S(!0);return}d()},[f,$,j,o,d,U]);(0,l.useEffect)(()=>{f&&j&&!o&&N(e=>e||!0)},[f,j,o]),(0,l.useEffect)(()=>{j&&w||k(!1)},[j,w]),(0,l.useEffect)(()=>{if(!_||!f)return;let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[_,f]),(0,l.useEffect)(()=>{if(!_)return;let e=window.setTimeout(()=>{let e=T.current;e&&(e.currentTime=0,e.play().then(()=>{z(!0)}).catch(()=>{z(!1)}))},0);return()=>window.clearTimeout(e)},[_]);let en=e=>{let t=Math.floor(e/60),a=Math.floor(e%60);return"".concat(t,":").concat(a.toString().padStart(2,"0"))},eo=(0,D.cn)("16:9"===a.ratio&&"aspect-video w-full","9:16"===a.ratio&&"aspect-[9/16] w-full max-w-sm","1:1"===a.ratio&&"aspect-square w-full max-w-md",!["16:9","9:16","1:1"].includes(a.ratio)&&"aspect-video w-full"),ed=(0,l.useMemo)(()=>{var e;return W||parseFloat((null==(e=a.duration)?void 0:e.replace("s",""))||"5")||5},[W,a.duration]),ec=(0,l.useMemo)(()=>ed?H/ed*100:0,[H,ed]),eu=(0,l.useMemo)(()=>{var e;return R||parseFloat((null==(e=a.duration)?void 0:e.replace("s",""))||"5")||5},[R,a.duration]),em=(0,l.useMemo)(()=>eu?E/eu*100:0,[E,eu]),ex=(0,l.useCallback)(()=>({stopPropagation:()=>{}}),[]),ep=(0,l.useCallback)(()=>{c(ex())},[c,ex]),eh=(0,l.useCallback)(()=>{u(ex())},[u,ex]),eg=(0,l.useCallback)(()=>{p&&p(ex())},[p,ex]),ef=(0,l.useCallback)(()=>{m&&m(ex())},[m,ex]),ev=(0,l.useCallback)(()=>{x&&x(ex())},[x,ex]),eb=(0,l.useCallback)(()=>{let e=T.current;e&&(e.paused?e.play().catch(()=>{}):e.pause())},[]),ej=(0,l.useCallback)(()=>{let e=T.current;e&&(e.muted=!e.muted,I(e.muted))},[]),ey=(0,l.useCallback)(e=>{e.stopPropagation();let t=T.current;if(!t||!eu)return;let a=e.currentTarget.getBoundingClientRect(),s=(e.clientX-a.left)/a.width*eu;t.currentTime=s,B(s)},[eu]),ew=f&&_&&j?(0,eJ.createPortal)((0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"fixed inset-0 z-[40] bg-black flex flex-col",children:[(0,s.jsx)("div",{className:"absolute top-4 right-4 z-10",children:(0,s.jsx)(P.$,{variant:"ghost",size:"icon",className:"text-white hover:bg-white/20 h-10 w-10 rounded-full bg-black/40 backdrop-blur-sm",onClick:()=>S(!1),children:(0,s.jsx)(ee.A,{className:"h-6 w-6"})})}),(0,s.jsxs)("div",{className:"relative flex-1 flex items-center justify-center",children:[(0,s.jsx)("video",{ref:T,src:j,poster:y||void 0,className:"w-full h-full object-contain",muted:L,loop:!0,playsInline:!0,onTimeUpdate:e=>B(e.currentTarget.currentTime),onLoadedMetadata:e=>O(e.currentTarget.duration),onPlay:()=>z(!0),onPause:()=>z(!1)}),(0,s.jsx)("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/85 to-transparent p-3 pt-8",children:(0,s.jsxs)("div",{className:"flex items-center gap-2 text-white",children:[(0,s.jsx)("button",{className:"hover:text-primary transition-colors",onClick:eb,children:F?(0,s.jsx)(e1.A,{className:"w-5 h-5"}):(0,s.jsx)(e2.A,{className:"w-5 h-5"})}),(0,s.jsxs)("div",{className:"text-xs font-medium min-w-[70px]",children:[en(E)," / ",en(eu)]}),(0,s.jsx)("div",{className:"flex-1 h-1 bg-white/30 rounded-full overflow-hidden cursor-pointer",onClick:ey,children:(0,s.jsx)("div",{className:"h-full bg-white transition-all",style:{width:"".concat(em,"%")}})}),(0,s.jsx)("button",{className:"hover:text-primary transition-colors",onClick:ej,children:L?(0,s.jsx)(e5.A,{className:"w-4 h-4"}):(0,s.jsx)(e3.A,{className:"w-4 h-4"})}),(0,s.jsx)("button",{className:"hover:text-primary transition-colors",onClick:()=>A(!0),children:(0,s.jsx)(eQ.A,{className:"w-5 h-5"})})]})})]})]}),(0,s.jsx)(r._s,{open:M,onOpenChange:A,children:(0,s.jsxs)(r.zj,{className:"pb-safe bg-zinc-900 border-zinc-800 z-[140]",showHandle:!1,children:[(0,s.jsx)(r.gk,{className:"sr-only",children:"Actions"}),(0,s.jsxs)("div",{className:"flex flex-col items-center px-6 pt-6 pb-4",children:[(0,s.jsxs)("div",{className:"inline-flex flex-col items-stretch",children:[(0,s.jsxs)("div",{className:"flex gap-6 justify-center",children:[(0,s.jsxs)("button",{className:"flex flex-col items-center gap-2",onClick:()=>{ep(),A(!1)},disabled:h,children:[(0,s.jsx)("div",{className:"w-14 h-14 roun
1ded-full bg-zinc-800 flex items-center justify-center",children:(0,s.jsx)(e4.A,{className:"h-6 w-6 text-white"})}),(0,s.jsx)("span",{className:"text-xs text-white/70",children:v("download")})]}),(0,s.jsxs)("button",{className:"flex flex-col items-center gap-2",onClick:()=>{eh(),A(!1)},children:[(0,s.jsx)("div",{className:"w-14 h-14 rounded-full bg-zinc-800 flex items-center justify-center",children:(0,s.jsx)(e8.A,{className:"h-6 w-6 text-white"})}),(0,s.jsx)("span",{className:"text-xs text-white/70",children:v("share")})]}),!n&&m&&(0,s.jsxs)("button",{className:"flex flex-col items-center gap-2",onClick:()=>{ef(),A(!1)},disabled:g,children:[(0,s.jsx)("div",{className:"w-14 h-14 rounded-full bg-zinc-800 flex items-center justify-center",children:(0,s.jsx)(e6.A,{className:(0,D.cn)("h-6 w-6",a.is_collected?"text-red-500 fill-current":"text-white")})}),(0,s.jsx)("span",{className:"text-xs text-white/70",children:a.is_collected?v("unfavorite"):v("collect")})]}),!n&&x&&(0,s.jsxs)("button",{className:"flex flex-col items-center gap-2",onClick:()=>{A(!1),ev()},children:[(0,s.jsx)("div",{className:"w-14 h-14 rounded-full bg-zinc-800 flex items-center justify-center",children:(0,s.jsx)(e0.A,{className:"h-6 w-6 text-red-400"})}),(0,s.jsx)("span",{className:"text-xs text-white/70",children:v("delete")})]})]}),p&&(0,s.jsx)("button",{className:"mt-6 w-[18.5rem] mx-auto py-3 rounded-full bg-white text-black text-base font-medium disabled:opacity-60",onClick:()=>{eg(),A(!1),S(!1)},children:v("createSimilarVideo")})]}),(0,s.jsx)("button",{className:"w-full mt-3 py-3 text-white/60 text-base",onClick:()=>A(!1),children:v("cancel")})]})]})})]}),document.body):null,eN=()=>(0,s.jsxs)("div",{className:"absolute top-2 right-2 flex gap-1.5 z-10",children:[(0,s.jsx)(te,{icon:(0,s.jsx)(e4.A,{className:"w-4 h-4"}),tooltip:v("download"),onClick:c,disabled:h}),!n&&m&&(0,s.jsx)(te,{icon:(0,s.jsx)(e6.A,{className:(0,D.cn)("w-4 h-4",a.is_collected&&"fill-current")}),tooltip:a.is_collected?v("unfavorite"):v("collect"),onClick:m,disabled:g,className:a.is_collected?"text-red-500":void 0}),(0,s.jsx)(te,{icon:(0,s.jsx)(e8.A,{className:"w-4 h-4"}),tooltip:v("share"),onClick:u}),!n&&x&&(0,s.jsx)(tt,{onDelete:x,deleteText:v("deleteThisGeneration"),moreText:v("more")})]});if(b&&!o&&"failed"!==a.status){let e=a.all_image_urls||[];if(0===e.length&&t&&e.push({url:t,id:0,is_collected:!1}),0===e.length)return null;let l=a.ratio?a.ratio.replace(":","/"):"1";return(0,s.jsx)("div",{className:"flex flex-wrap gap-[10px] md:gap-2",children:e.map((e,t)=>(0,s.jsxs)("div",{className:(0,D.cn)("group/image relative flex-shrink-0 rounded-md overflow-hidden transition-all duration-300 cursor-pointer","max-md:aspect-[3/2] md:bg-background","w-[calc(100%-2.5rem)] mx-auto md:w-[calc((100%-2rem)/4)] md:mx-0"),style:{aspectRatio:f?void 0:l},onClick:()=>d(t),children:[f?(0,s.jsx)("div",{className:"flex items-center justify-center w-full h-full",children:(0,s.jsx)("img",{src:e.url,alt:a.prompt||"Generated image",className:"h-full w-auto object-contain transition-opacity duration-300"})}):(0,s.jsx)(J.default,{src:e.url,alt:a.prompt||"Generated image",f
1ill:!0,className:"object-cover !rounded-md transition-opacity duration-300",sizes:"(max-width: 25rem) 100vw, 25rem",loading:"lazy",quality:85}),!f&&(0,s.jsxs)("div",{className:"absolute top-2 right-2 flex gap-1 z-10 opacity-0 group-hover/image:opacity-100 transition-opacity",children:[(0,s.jsx)(ta,{icon:(0,s.jsx)(e4.A,{className:"w-4 h-4"}),tooltip:v("download"),onClick:c,disabled:h}),!n&&m&&(0,s.jsx)(ta,{icon:(0,s.jsx)(e6.A,{className:(0,D.cn)("w-4 h-4",a.is_collected&&"fill-current")}),tooltip:a.is_collected?v("unfavorite"):v("collect"),onClick:m,disabled:g,className:a.is_collected?"text-red-500":void 0}),(0,s.jsx)(ta,{icon:(0,s.jsx)(e8.A,{className:"w-4 h-4"}),tooltip:v("share"),onClick:u}),!n&&x&&(0,s.jsx)(ta,{icon:(0,s.jsx)(e0.A,{className:"w-4 h-4"}),tooltip:v("deleteThisImage"),onClick:x})]})]},e.id||t))})}return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:(0,D.cn)("group/video relative flex-shrink-0 overflow-hidden transition-all duration-300",f?"w-full aspect-[34/19] rounded-none bg-[#efe9ec] dark:bg-[#1f1f1f]":"rounded-xl bg-black/5 border border-border/50",!o&&"failed"!==a.status&&"cursor-pointer",!f&&eo),onClick:er,onMouseEnter:f?void 0:el,onMouseLeave:f?void 0:ei,children:o||"failed"===a.status?(0,s.jsxs)("div",{className:"absolute inset-0 overflow-hidden rounded-xl bg-[linear-gradient(145deg,#50515a_0%,#3c3d58_48%,#2b255f_100%)]",children:[(0,s.jsx)("div",{className:"absolute inset-0 animate-pulse bg-[linear-gradient(135deg,rgba(255,255,255,0.08),rgba(255,255,255,0.02),rgba(0,0,0,0.08))]"}),(0,s.jsx)("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_30%_20%,rgba(255,255,255,0.16),transparent_45%)]"}),(0,s.jsx)("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none px-4 text-center",children:"failed"===a.status?(0,s.jsx)("span",{className:"text-sm font-medium text-red-400 drop-shadow-md",children:a.video_error_message||v("videoGenerationFailed")||"Video generation failed."}):(0,s.jsxs)("span",{className:"text-sm font-medium text-white drop-shadow-md",children:[v("generating"),"..."]})})]}):j&&w?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("video",{ref:$,src:j,poster:y||void 0,className:(0,D.cn)("absolute inset-0 w-full h-full",f?"object-contain":"object-cover"),muted:Z,loop:!0,playsInline:!0,preload:"metadata",onTimeUpdate:ea,onLoadedMetadata:es,onCanPlay:()=>k(!0),onPlay:()=>U(!0),onPause:()=>U(!1)}),!C&&y?(0,s.jsx)("div",{className:"absolute inset-0 z-[1] flex items-center justify-center bg-black/5",children:(0,s.jsx)(J.default,{src:y,alt:a.prompt||"Video thumbnail",fill:!0,className:(0,D.cn)(f?"object-contain":"object-cover"),sizes:"(max-width: 768px) 100vw, 50vw",loading:"eager",quality:85})}):null,!f&&eN(),f?(0,s.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/85 to-transparent p-3 pt-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-white",children:[(0,s.jsx)("button",{className:"hover:text-primary transition-colors",onClick:K,children:G?(0,s.jsx)(e1.A,{className:"w-5 h-5"}):(0,s.jsx)(e2.A,{className:"w-5 h-5"})}),(0,s.jsxs)("div",{className:"text-xs font-medium min-w-[70px]",children:[en(H)," / ",en(ed)]}),(0,s.jsx)("div",{className:"flex-1"}),(0,s.jsx)("button",{className:"hover:text-primary transition-colors",onClick:X,children:Z?(0,s.jsx)(e5.A,{className:"w-4 h-4"}):(0,s.jsx)(e3.A,{className:"w-4 h-4"})})]}),(0,s.jsx)("div",{className:"mt-2 h-1.5 w-full bg-white/30 rounded-full overflow-hidden cursor-pointer",onClick:et,children:(0,s.jsx)("div",{className:"h-full bg-white transition-all",style:{width:"".concat(ec,"%")}})})]}):(0,s.jsx)("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 to-transparent p-3 pt-8",children:(0,s.jsxs)("div",{className:"flex items-center gap-2 text-white",children:[(0,s.jsx)("button",{className:"hover:text-primary transition-colors",onClick:K,children:G?(0,s.jsx)(e1.A,{className:"w-5 h-5"}):(0,s.jsx)(e2.A,{className:"w-5 h-5"})}),(0,s.jsxs)("div",{className:"text-xs font-medium min-w-[70px]",children:[en(H)," / ",en(ed)]}),(0,s.jsx)("div",{className:"flex-1 h-1 bg-white/30 rounded-full overflow-hidden cursor-pointer",onClick:et,children:(0,s.jsx)("div",{className:"h-full bg-primary transition-all",style:{width:"".concat(ec,"%")}})}),(0,s.jsx)("button",{className:"hover:text-primary transition-colors",onClick:X,children:Z?(0,s.jsx)(e5.A,{className:"w-4 h-4"}):(0,s.jsx)(e3.A,{className:"w-4 h-4"})}),(0,s.jsx)("button",{className:"hover:text-primary transition-colors",onClick:Q,children:(0,s.jsx)(e7.A,{className:"w-4 h-4"})})]})})]}):y?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(J.default,{src:y,alt:a.prompt||"Video thumbnail",fill:!0,className:(0,D.cn)(f?"object-contain":"object-cover"),sizes:"(max-width: 768px) 100vw, 50vw",loading:"lazy",quality:85}),(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:(0,s.jsx)("div",{className:"w-16 h-16 rounded-full bg-black/50 flex items-center justify-center",children:(0,s.jsx)(e2.A,{className:"w-8 h-8 text-white ml-1"})})}),!f&&eN()]}):null}),ew]})};var tl=a(39552);let ti=e=>{var t,a,l;let{video:r,readOnly:n,onCreateSimilar:o,onDelete:d}=e,c=(0,i.c)(),u=(0,V.a)(),m="generating"===r.status,x="failed"===r.status,p=function(e){return void 0!==e&&e>=1&&e<=4}(r.parent_type_id),h=function(e){return 3===e||4===e}(r.parent_type_id),g=()=>{switch(r.parent_type_id){case 1:return c("textToImage");case 2:return c("imageToImage");case 3:return r.image_type_name||c("effectsCategory");case 4:return r.image_type_name||c("toolsCategory");default:return c("textToVideo")}},f=p?c("createSimilarImage"):c("createSimilarVideo"),v=!!(null==(t=r.model_logo)?void 0:t.trim()),b=!h;
1if(u){let e=p?g():[r.model,r.ratio,r.resolution].filter(Boolean).join(" | ");return(0,s.jsx)("div",{className:"w-full aspect-[7/1] bg-[#f2eeed] dark:bg-[#242424] px-3",children:(0,s.jsxs)("div",{className:"h-full flex items-center justify-between gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[!p&&r.model_logo?(0,s.jsx)(J.default,{src:r.model_logo,alt:r.model||"Model logo",width:16,height:16,className:"rounded-sm flex-shrink-0"}):null,(0,s.jsx)("span",{className:"text-[12px] text-foreground/80 truncate",children:e})]}),x&&d?(0,s.jsxs)(P.$,{variant:"default",size:"sm",onClick:d,className:"h-7 text-xs flex-shrink-0 text-destructive hover:text-destructive gap-1.5",children:[(0,s.jsx)(e0.A,{className:"h-3.5 w-3.5"}),c("delete")]}):!m&&(0,s.jsx)(P.$,{variant:"default",size:"sm",onClick:o,className:"h-7 text-xs flex-shrink-0",children:f})]})})}return p?(0,s.jsxs)("div",{className:"pb-4 flex items-center justify-between border-b",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground flex-1 min-w-0",children:[r.created_at&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:r.created_at}),(0,s.jsx)(tl.w,{orientation:"vertical",className:"h-4"})]}),b&&v&&(0,s.jsx)(J.default,{src:r.model_logo,alt:r.model||"Model logo",width:20,height:20,className:"rounded flex-shrink-0"}),b&&r.model&&(0,s.jsx)("span",{className:"font-medium text-foreground truncate",children:r.model}),b&&(0,s.jsx)(tl.w,{orientation:"vertical",className:"h-4"}),(0,s.jsx)("span",{className:"text-muted-foreground",children:g()}),r.ratio&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tl.w,{orientation:"vertical",className:"h-4"}),(0,s.jsx)("span",{children:r.ratio})]})]}),(0,s.jsx)("div",{className:"h-10",children:x&&!n&&d?(0,s.jsx)("div",{className:"ml-2 flex-shrink-0",children:(0,s.jsxs)(P.$,{variant:"default",size:"sm",onClick:d,className:"text-destructive hover:text-destructive gap-1.5",children:[(0,s.jsx)(e0.A,{className:"h-4 w-4"}),c("delete")]})}):!m&&(0,s.jsxs)("div",{className:"ml-2 flex-shrink-0 flex gap-2",children:[!n&&d&&(0,s.jsxs)(e9.rI,{children:[(0,s.jsx)(e9.ty,{asChild:!0,children:(0,s.jsx)(P.$,{variant:"outline",size:"sm",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(eQ.A,{className:"h-4 w-4"})})}),(0,s.jsx)(e9.SQ,{align:"end",children:(0,s.jsxs)(e9._2,{onClick:d,className:"text-destructive cursor-pointer",children:[(0,s.jsx)(e0.A,{className:"h-4 w-4 mr-2"}),c("deleteThisGeneration")]})})]}),(0,s.jsx)(P.$,{variant:"default",size:"sm",onClick:o,children:f})]})})]}):(0,s.jsxs)("div",{className:"pb-4 flex items-center justify-between border-b",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground flex-1 min-w-0",children:[r.model_logo?(0,s.jsx)(J.default,{src:r.model_logo,alt:r.model||"Model logo",width:20,height:20,className:"rounded flex-shrink-0"}):(0,s.jsx)("div",{className:"flex items-center justify-center w-5 h-5 rounded bg-primary/10 text-[10px] font-bold text-primary flex-shrink-0",children:(null==(l=r.model)||null==(a=l.charAt(0))?void 0:a.toUpperCase())||"M"}),(0,s.jsx)("span",{className:"font-medium text-foreground truncate",children:r.model}),(0,s.jsx)(tl.w,{orientation:"vertical",className:"h-4"}),(0,s.jsx)("span",{className:"text-muted-foreground",children:g()}),r.ratio&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tl.w,{orientation:"vertical",className:"h-4"}),(0,s.jsx)("span",{children:r.ratio})]}),r.resolution&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tl.w,{orientation:"vertical",className:"h-4"}),(0,s.jsx)("span",{children:r.resolution})]}),r.duration&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tl.w,{orientation:"vertical",className:"h-4"}),(0,s.jsx)("span",{children:r.duration})]})]}),(0,s.jsx)("div",{className:"h-10",children:x&&!n&&d?(0,s.jsx)("div",{className:"ml-2 flex-shrink-0",children:(0,s.jsxs)(P.$,{variant:"default",size:"sm",onClick:d,className:"text-destructive hover:text-destructive gap-1.5",children:[(0,s.jsx)(e0.A,{className:"h-4 w-4"}),c("delete")]})}):!m&&(0,s.jsxs)("div",{className:"ml-2 flex-shrink-0 flex gap-2",children:[!n&&d&&(0,s.jsxs)(e9.rI,{children:[(0,s.jsx)(e9.ty,{asChild:!0,children:(0,s.jsx)(P.$,{variant:"outline",size:"sm",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(eQ.A,{className:"h-4 w-4"})})}),(0,s.jsx)(e9.SQ,{align:"end",children:(0,s.jsxs)(e9._2,{onClick:d,className:"text-destructive cursor-pointer",children:[(0,s.jsx)(e0.A,{className:"h-4 w-4 mr-2"}),c("deleteThisGeneration")]})})]}),(0,s.jsx)(P.$,{variant:"default",size:"sm",onClick:o,children:f})]})})]})},tr=e=>{var t;let{video:a,videoIndex:l,stableKey:r,isLoaded:n,copiedPromptId:o,hoveredPromptId:d,readOnly:c,onVideoClick:u,onCopyPrompt:m,onUsePromptOnly:x,onCreateSimilar:p,onDelete:h,onDownload:g,onShare:f,onCollect:v,onSetHoveredPromptId:b,onSetLoadedVideos:j,isDownloading:y,isCollecting:w,scrollContainerRef:N,observerRef:C,observedElementsRef:k}=e,_=a.id||"video-".concat(l),S=(0,i.c)(),M=(0,V.a)(),A="generating"===a.status;return(0,s.jsx)("div",{ref:e=>{if(e&&C.current&&!k.current.has(e)){var t;C.current.observe(e),k.current.add(e);let a=e.getBoundingClientRect(),s=null==(t=N.current)?void 0:t.getBoundingClientRect();s&&a.top<s.bottom&&a.bottom>s.top&&j(e=>{if(!e.has(r)){let t=new Set(e);return t.add(r),t}return e})}}
1,"data-video-id":r,className:"px-5 md:px-4 mb-4 transition-all duration-300",children:(0,s.jsx)("div",{className:(0,D.cn)("group relative rounded-md shadow-sm overflow-hidden transition-all duration-300 md:px-2",n?"md:hover:bg-primary/0":"bg-muted/30 animate-pulse"),children:n?(0,s.jsxs)("div",{className:"animate-in fade-in duration-300",children:[(0,s.jsx)(eX,{prompt:null!=(t=a.prompt)?t:null,videoId:_,isGenerating:A,copiedPromptId:o,hoveredPromptId:d,onCopyPrompt:m,onUsePromptOnly:x,onMouseEnter:()=>b(_),onMouseLeave:()=>b(null)}),M?(0,s.jsxs)("div",{className:"overflow-hidden rounded-xl",children:[(0,s.jsx)("div",{className:"transition-all duration-300",children:(0,s.jsx)(ts,{thumbnail:a.thumbnail,video:a,readOnly:c,isGenerating:A,onVideoClick:u,onCreateSimilar:p,onDownload:g,onShare:f,onCollect:v,onDelete:h,isDownloading:y,isCollecting:w})}),(0,s.jsx)(ti,{video:a,readOnly:c,onCreateSimilar:p,onDelete:h})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"pb-3 transition-all duration-300",children:(0,s.jsx)(ts,{thumbnail:a.thumbnail,video:a,readOnly:c,isGenerating:A,onVideoClick:u,onCreateSimilar:p,onDownload:g,onShare:f,onCollect:v,onDelete:h,isDownloading:y,isCollecting:w})}),(0,s.jsx)(ti,{video:a,readOnly:c,onCreateSimilar:p,onDelete:h})]})]}):(0,s.jsx)("div",{className:"flex items-center justify-center text-muted-foreground transition-opacity duration-300",style:{minHeight:"300px"},children:(0,s.jsxs)("div",{className:"text-sm",children:[S("loading"),"..."]})})})})};var tn=a(7502),to=a(94411),td=a(77195),tc=a(69404);async function tu(e,t){let a=await fetch(e),s=await a.blob(),l=window.URL.createObjectURL(s),i=document.createElement("a");i.href=l,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(l)}function tm(e){let t="number"==typeof e?e:parseInt(String(e),10);return isNaN(t)?null:t}var tx=a(60095);let tp=e=>{let t=Math.floor(e/60),a=Math.floor(e%60);return"".concat(t,":").concat(a.toString().padStart(2,"0"))},th=e=>"number"==typeof e?e:parseInt(String(e),10),tg=async(e,t)=>{let a=await fetch(e),s=await a.blob(),l=window.URL.createObjectURL(s),i=document.createElement("a");i.href=l,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(l)},tf=e=>{let{icon:t,tooltip:a,onClick:l,disabled:i,className:r}=e;return(0,s.jsxs)(E.m_,{children:[(0,s.jsx)(E.k$,{asChild:!0,children:(0,s.jsx)(P.$,{variant:"secondary",size:"icon",className:(0,D.cn)("h-9 w-9 rounded-full bg-black/50 hover:bg-black/70 text-white border-none",r),onClick:l,disabled:i,children:t})}),(0,s.jsx)(E.ZI,{children:a})]})},tv=e=>{let{isPlaying:t,isMuted:a,currentTime:l,duration:i,videoDuration:r,onTogglePlay:n,onToggleMute:o,onFullscreen:d,onProgressClick:c,className:u}=e,m=i||parseFloat((null==r?void 0:r.replace("s",""))||"5");return(0,s.jsxs)("div",{className:(0,D.cn)("flex items-center gap-2 text-white w-full",u),children:[(0,s.jsx)("button",{className:"hover:text-primary transition-colors",onClick:n,children:t?(0,s.jsx)(e1.A,{className:"w-5 h-5"}):(0,s.jsx)(e2.A,{className:"w-5 h-5"})}),(0,s.jsxs)("div",{className:"text-xs font-medium min-w-[70px]",children:[tp(l)," / ",tp(m)]}),(0,s.jsx)("div",{className:"flex-1 h-1 bg-white/30 rounded-full overflow-hidden cursor-pointer",onClick:c,children:(0,s.jsx)("div",{className:"h-full bg-primary transition-all",style:{width:"".concat(m?l/m*100:0,"%")}})}),(0,s.jsx)("button",{className:"hover:text-primary transition-colors",onClick:o,children:a?(0,s.jsx)(e5.A,{className:"w-4 h-4"}):(0,s.jsx)(e3.A,{className:"w-4 h-4"})}),(0,s.jsx)("button",{className:"hover:text-primary transition-colors",onClick:d,children:(0,s.jsx)(e7.A,{className:"w-4 h-4"})})]})},tb=e=>{let{onClick:t}=e;return(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center cursor-pointer",onClick:t,children:(0,s.jsx)("div",{className:"w-16 h-16 rounded-full bg-black/50 flex items-center justify-center hover:bg-black/70 transition-colors",children:(0,s.jsx)(e2.A,{className:"w-8 h-8 text-white ml-1"})})})},tj=e=>{let{label:t,value:a,valueClassName:l}=e;return a?(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:t}),(0,s.jsx)("span",{className:(0,D.cn)("font-medium",l),children:a})]}):null},ty=e=>{var t,a,n;let{video:o,open:d,onOpenChange:c,onDelete:u,readOnly:m=!1,onMobileOpenControlPanel:x,originalVideo:p}=e,h=(0,i.c)(),g=(0,V.a)(),f=function(e,t){let a=(0,l.useRef)(null),[s,i]=(0,l.useState)(!1),[r,n]=(0,l.useState)(!0),[o,d]=(0,l.useState)(0),[c,u]=(0,l.useState)(0);(0,l.useEffect)(()=>{e&&(i(!1),d(0),a.current&&(a.current.currentTime=0,a.current.pause()))},[e,t]);let m=(0,l.useCallback)(()=>{a.current&&(s?a.current.pause():a.current.play())},[s]),x=(0,l.useCallback)(()=>{a.current&&(a.current.muted=!r,n(!r))},[r]),p=(0,l.useCallback)(()=>{var e;null==(e=a.current)||e.requestFullscreen()},[]),h=(0,l.useCallback)(e=>{if(!a.current||!c)return;let t=e.currentTarget.getBoundingClientRect(),s=(e.clientX-t.left)/t.width*c;a.current.currentTime=s,d(s)},[c]);return{videoRef:a,isPlaying:s,setIsPlaying:i,isMuted:r,currentTime:o,duration:c,togglePlay:m,toggleMute:x,handleFullscreen:p,handleProgressClick:h,handleTimeUpdate:(0,l.useCallback)(e=>{d(e.currentTarget.currentTime)},[]),handleLoadedMetadata:(0,l.useCallback)(e=>{u(e.currentTarget.duration)},[])}}(d,null==o?void 0:o.id),[v,b]=(0,l.useState)(!1),[j,y]=(0,l.useState)(!1),[w,N]=(0,l.useState)(null),[C,S]=(0,l.useState)(!1);(0,l.useEffect)(()=>{d&&N(null)},[d]);let M=(0,tc.d)(),A=(0,td.N)(),T=(0,to.X)(),{setCreateSimilarVideo:z,setAdvancedSettingsOpen:L,setPrompt:B,setNegativePrompt:R,setModel:O,models:$}=(0,k.K)((0,F.k)(e=>({setCreateSimilarVideo:e.setCreateSimilarVideo,setAdvancedSettingsOpen:e.setAdvancedSettingsOpen,setPrompt:e.setPrompt,setNegativePrompt:e.setNegativePrompt,setModel:e.setModel,models:e.models}))),G=(null==o?void 0:o.watermark_url)||(null==o?void 0:o.video_url)||"",U=(null==o?void 0:o.cover_url)||(null==o?void 0:o.thumbnail)||"",Z=(null==o?void 0:o.model)||"",H=(null==o?void 0:o.model_logo)||"",W=null!=(n=null!=w?w:null==o?void 0:o.is_collected)&&n,Y=null==o?void 0:o.id;(0,l.useEffect)(()=>{d&&S(!1)},[d,null==o?void 0:o.id]);let q=(0,l.useCallback)(()=>{let e=(null==p?void 0:p.video_type)||1;return({1:h("textToVideo"),2:h("imageToVideoType"),3:h("videoToVideoType")})[e]||h("textToVideo")},[null==p?void 0:p.video_type,h]),K=(0,l.useCallback)(async()=>
1{if(!G||!Y)return void _.toast.error(h("downloadFailed"));let e=th(Y);y(!0);try{let t=isNaN(e)?G:(await M.mutateAsync(e)).data.url;await tg(t,"video-".concat(Date.now(),".mp4")),_.toast.success(h("downloadSuccess"))}catch(e){console.error("Download failed:",e),_.toast.error(h("downloadFailed"))}finally{y(!1)}},[Y,G,M,h]),X=(0,l.useCallback)(()=>{var e,t;if(!Y)return void _.toast.error(h("collectFailed"));let a=(null==p||null==(t=p.watermark_urls)||null==(e=t[0])?void 0:e.id)||th(Y);if(!a||isNaN(a))return void _.toast.error(h("collectFailed"));N(!W),A.mutate(a,{onSuccess:e=>{_.toast.success(e.data.is_collected?h("collectSuccess"):h("uncollectSuccess"))},onError:e=>{N(null),console.error("Toggle collection failed:",e),_.toast.error(e.message||h("collectFailed"))}})},[Y,W,p,A,h]),Q=(0,l.useCallback)(async()=>{let e=G||U;if(!e)return void _.toast.error(h("copyFailed"));try{await navigator.clipboard.writeText(e),_.toast.success(h("shareLinkCopied"))}catch(e){_.toast.error(h("copyFailed"))}},[G,U,h]),ee=(0,l.useCallback)(()=>{(null==p?void 0:p.group)&&T.mutate(p.group,{onSuccess:()=>{var e;_.toast.success(h("deleted")),b(!1),c(!1),null==u||u(null!=(e=p.group)?e:void 0)},onError:e=>{console.error("Delete video failed:",e),_.toast.error(h("deleteFailed"))}})},[null==p?void 0:p.group,T,h,c,u]),et=(0,l.useCallback)(()=>{let e=(null==p?void 0:p.prompt)||(null==o?void 0:o.prompt);e&&(B(e),_.toast.success(h("promptApplied")))},[null==p?void 0:p.prompt,null==o?void 0:o.prompt,B,h]),ea=(0,l.useCallback)(()=>{let e=null==p?void 0:p.negative_prompt;e&&(R(e),L(!0),_.toast.success(h("promptApplied")))},[null==p?void 0:p.negative_prompt,R,L,h]),es=(0,l.useCallback)(()=>{let e=(null==p?void 0:p.model_display_name)||Z;if(!e)return;let t=$.find(t=>t.display_name===e);t&&(O(t.name),_.toast.success(h("modelSelected")))},[null==p?void 0:p.model_display_name,Z,$,O,h]),el=(0,l.useCallback)(()=>{var e,t,a,s,l,i;if(!p){_.toast.success(h("settingsApplied")),c(!1);return}let r=(null!=(a=null==(e=p.negative_prompt)?void 0:e.trim())?a:"")!==""||(null!=(s=null==(t=p.seed)?void 0:t.trim())?s:"")!==""||1===p.multi_shots||1===p.camera_fixed,n={prompt:p.prompt||"",videoModelId:p.video_model_id,modelDisplayName:p.model_display_name||"",modelLogo:p.model_logo||"",ratio:p.aspect_ratio||"",resolution:p.resolution||"",durationSeconds:null!=(i=null!=(l=p.duration_seconds)?l:(e=>{if(!e)return;let t=parseInt(String(e).replace("s",""),10);return Number.isNaN(t)?void 0:t})(null==o?void 0:o.duration))?i:5,negativePrompt:p.negative_prompt,seed:p.seed,multiShots:p.multi_shots,cameraFixed:p.camera_fixed,hasAudio:p.has_audio,videoType:p.video_type,promptOptimizer:p.prompt_optimizer};r&&L(!0),z(n),g&&(null==x||x()),_.toast.success(h("settingsApplied")),c(!1)},[p,z,L,g,x,h,c]);if(!o)return null;let ei=g?null:(0,s.jsx)(tx.lG,{open:d,onOpenChange:c,children:(0,s.jsx)(tx.Cf,{className:"!max-w-[80dvw] !max-h-[90dvh] w-full h-full min-w-80 min-h-96 p-0 gap-0 overflow-hidden",onOpenAutoFocus:e=>e.preventDefault(),children:(0,s.jsxs)("div",{className:"flex flex-col md:flex-row h-full w-full gap-4 p-4",children:[(0,s.jsxs)("div",{className:"flex-1 relative min-w-0 min-h-0 bg-black rounded-md overflow-hidden",children:[(0,s.jsx)("div",{className:"absolute inset-0 bottom-12 flex items-center justify-center",children:G?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("video",{ref:f.videoRef,src:G,poster:U||void 0,className:"w-full h-full object-contain",muted:f.isMuted,loop:!0,playsInline:!0,onTimeUpdate:f.handleTimeUpdate,onLoadedMetadata:f.handleLoadedMetadata,onCanPlay:()=>S(!0),onPlay:()=>f.setIsPlaying(!0),onPause:()=>f.setIsPlaying(!1)}),!C&&U?(0,s.jsx)("div",{className:"absolute inset-0 z-[1] flex items-center justify-center",children:(0,s.jsx)(J.default,{src:U,alt:o.prompt||"Video thumbnail",fill:!0,className:"object-contain",sizes:"(max-width: 768px) 100vw, 70vw",loading:"eager"})}):null,!f.isPlaying&&(0,s.jsx)(tb,{onClick:f.togglePlay}),(0,s.jsx)("div",{className:"absolute top-3 right-3 flex gap-2 z-10",children:(0,s.jsxs)(E.Bc,{delayDuration:300,children:[(0,s.jsx)(tf,{icon:(0,s.jsx)(e4.A,{className:"h-4 w-4"}),tooltip:h("download"),onClick:K,disabled:j}),!m&&(0,s.jsx)(tf,{icon:(0,s.jsx)(e6.A,{className:(0,D.cn)("h-4 w-4",W&&"fill-current")}),tooltip:W?h("unfavorite"):h("collect"),onClick:X,disabled:A.isPending,className:W?"text-red-500":void 0}),(0,s.jsx)(tf,{icon:(0,s.jsx)(e8.A,{className:"h-4 w-4"}),tooltip:h("share"),onClick:Q}),!m&&(null==p?void 0:p.group)&&(0,s.jsxs)(e9.rI,{children:[(0,s.jsx)(e9.ty,{asChild:!0,children:(0,s.jsx)(P.$,{variant:"secondary",size:"icon",className:"h-9 w-9 rounded-full bg-black/50 hover:bg-black/70 text-white border-none",children:(0,s.jsx)(eQ.A,{className:"h-4 w-4"})})}),(0,s.jsx)(e9.SQ,{align:"end",children:(0,s.jsxs)(e9._2,{onClick:()=>b(!0),className:"text-destructive cursor-pointer",children:[(0,s.jsx)(e0.A,{className:"h-4 w-4 mr-2"}),h("deleteThisGeneration")]})})]})]})})]}):U?(0,s.jsx)(J.default,{src:U,alt:o.prompt||"Video thumbnail",fill:!0,className:"object-contain",sizes:"(max-width: 768px) 100vw, 70vw"}):null}),G&&(0,s.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-12 bg-black/90 px-3 flex items-center z-10",children:(0,s.jsx)(tv,{isPlaying:f.isPlaying,isMuted:f.isMuted,currentTime:f.currentTime,duration:f.duration,videoDuration:o.duration,onTogglePlay:f.togglePlay,onToggleMute:f.toggleMute,onFullscreen:f.handleFullscreen,onProgressClick:f.handleProgressClick})})]}),(0,s.jsxs)("div",{className:"w-full md:w-96 flex flex-col shrink-0 min-w-0 min-h-96 overflow-y-auto h-[calc(90dvh-1.5rem)]",children:[(0,s.jsx)(tx.c7,{className:"py-2 shrink-0 border-b border-border/60",children:(0,s.jsxs)(tx.L3,{className:"flex items-center gap-2",children:[h("details"),(0,s.jsx)("div",{className:"text-sm ml-2 bg-muted/60 rounded-md px-2 py-1/2 w-fit font-normal text-muted-foreground
1/90",children:q()})]})}),(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto py-4 space-y-4",children:[o.prompt&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"text-sm font-medium text-muted-foreground/80 mb-1 flex justify-between items-center gap-2",children:[(0,s.jsx)("span",{children:h("prompt")}),!m&&(0,s.jsx)(E.Bc,{delayDuration:300,children:(0,s.jsxs)(E.m_,{children:[(0,s.jsx)(E.k$,{asChild:!0,children:(0,s.jsx)(P.$,{variant:"outline",size:"sm",onClick:et,className:"h-6 flex-shrink-0",children:h("reuse")})}),(0,s.jsx)(E.ZI,{align:"end",children:h("reusePromptTooltip")})]})})]}),(0,s.jsx)("div",{className:"text-sm bg-muted rounded-md p-3 leading-relaxed max-h-32 overflow-y-auto",children:o.prompt})]}),(null==p||null==(t=p.negative_prompt)?void 0:t.trim())&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"text-sm font-medium text-muted-foreground/80 mb-1 flex justify-between items-center gap-2",children:[(0,s.jsx)("span",{children:h("negativePrompt")}),!m&&(0,s.jsx)(E.Bc,{delayDuration:300,children:(0,s.jsxs)(E.m_,{children:[(0,s.jsx)(E.k$,{asChild:!0,children:(0,s.jsx)(P.$,{variant:"outline",size:"sm",onClick:ea,className:"h-6 flex-shrink-0",children:h("reuse")})}),(0,s.jsx)(E.ZI,{align:"end",children:h("reuseNegativePromptTooltip")})]})})]}),(0,s.jsx)("div",{className:"text-sm bg-muted rounded-md p-3 leading-relaxed max-h-32 overflow-y-auto",children:p.negative_prompt})]}),Z&&(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-medium text-muted-foreground/80 mb-2",children:h("model")}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2 border-border/60 border rounded-md p-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[(null==H?void 0:H.trim())&&(0,s.jsx)(J.default,{src:H,alt:Z,width:32,height:32,className:"rounded flex-shrink-0"}),(0,s.jsx)("div",{className:"font-medium truncate",children:Z})]}),!m&&(0,s.jsx)(E.Bc,{delayDuration:300,children:(0,s.jsxs)(E.m_,{children:[(0,s.jsx)(E.k$,{asChild:!0,children:(0,s.jsx)(P.$,{variant:"outline",size:"sm",onClick:es,className:"flex-shrink-0 h-6",children:h("tryModel")})}),(0,s.jsx)(E.ZI,{children:h("tryModelContent")})]})})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-medium text-muted-foreground/80 mb-2",children:h("details")}),(0,s.jsxs)("div",{className:"space-y-2 text-sm",children:[(null==p?void 0:p.has_audio)===1&&(0,s.jsx)(tj,{label:h("audioGeneration"),value:"On"}),(0,s.jsx)(tj,{label:h("ratio"),value:o.ratio}),(0,s.jsx)(tj,{label:h("resolution"),value:o.resolution}),(0,s.jsx)(tj,{label:h("duration"),value:o.duration}),(null==p?void 0:p.camera_fixed)===1&&(0,s.jsx)(tj,{label:h("cameraFixed"),value:"On"}),(null==p?void 0:p.multi_shots)===1&&(0,s.jsx)(tj,{label:h("multiShots"),value:"On"}),(null==p||null==(a=p.seed)?void 0:a.trim())&&(0,s.jsx)(tj,{label:h("seed"),value:p.seed})]})]}),(null==p?void 0:p.image_input_urls)&&p.image_input_urls.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-medium text-muted-foreground/80 mb-2",children:h("referenceImage")}),(0,s.jsx)("div",{className:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-2",children:p.image_input_urls.map((e,t)=>(0,s.jsx)("div",{className:"relative w-full aspect-square rounded-md overflow-hidden border border-border/60",children:(0,s.jsx)(J.default,{src:e,alt:"Reference",fill:!0,className:"object-cover"})},t))})]})]}),(0,s.jsx)("div",{className:"py-4 shrink-0",children:(0,s.jsxs)(P.$,{className:"w-full",size:"default",onClick:el,children:[(0,s.jsx)(I.A,{className:"w-4 h-4 mr-2"}),h("createSimilarVideo")]})})]})]})})}),er=g&&d?(0,s.jsx)(r._s,{open:d,onOpenChange:c,children:(0,s.jsx)(r.zj,{className:"h-[90vh] p-0",children:(0,s.jsxs)("div",{className:"flex flex-col h-full",children:[(0,s.jsx)("div",{className:"relative flex-1 bg-black flex items-center justify-center min-h-0",children:G?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("video",{ref:f.videoRef,src:G,poster:U||void 0,className:"max-w-full max-h-full object-contain",muted:f.isMuted,loop:!0,playsInline:!0,onTimeUpdate:f.handleTimeUpdate,onLoadedMetadata:f.handleLoadedMetadata,onCanPlay:()=>S(!0),onPlay:()=>f.setIsPlaying(!0),onPause:()=>f.setIsPlaying(!1)}),!C&&U?(0,s.jsx)("div",{className:"absolute inset-0 z-[1] flex items-center justify-center",children:(0,s.jsx)(J.default,{src:U,alt:o.prompt||"Video thumbnail",fill:!0,className:"object-contain",loading:"eager"})}):null,(0,s.jsx)("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 to-transparent p-3 pt-8",children:(0,s.jsx)(tv,{isPlaying:f.isPlaying,isMuted:f.isMuted,currentTime:f.currentTime,duration:f.duration,videoDuration:o.duration,onTogglePlay:f.togglePlay,onToggleMute:f.toggleMute,onFullscreen:f.handleFullscreen,onProgressClick:f.handleProgressClick})}),!f.isPlaying&&(0,s.jsx)(tb,{onClick:f.togglePlay})]}):U?(0,s.jsx)(J.default,{src:U,alt:o.prompt||"Video thumbnail",fill:!0,className:"object-contain"}):null}),(0,s.jsxs)("div",{className:"p-4 space-y-4 overflow-y-auto max-h-[40vh]",children:[o.prompt&&(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-medium text-muted-foreground mb-1",children:h("prompt")}),(0,s.jsx)("div",{className:"text-sm bg-muted rounded-md p-3 max-h-24 overflow-y-auto",children:o.prompt})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2 text-xs text-muted-foreground",children:[o.ratio&&(0,s.jsx)("span",{className:"bg-muted px-2 py-1 rounded",children:o.ratio}),o.resolution&&(0,s.jsx)("span",{className:"bg-muted px-2 py-1 rounded",children:o.resolution}),o.duration&&(0,s.jsx)("span",{className:"bg-muted px-2 py-1 rounded",children:o.duration})]}),(0,s.jsxs)("div",{className:"flex items-center justify-center gap-3",children:[(0,s.jsx)(P.$,{variant:"outline",size:"icon",onClick:K,disabled:j,children:(0,s.jsx)(e4.A,{className:"h-4 w-4"})}),!m&&(0,s.jsx)(P.$,{variant:"outline",size:"icon",onClick:X,className:(0,D.cn)(W&&"text-red-500"),children:(0,s.jsx)(e6.A,{className:(0,D.cn)("h-4 w-4",W&&"fill-current")})}),(0,s.jsx)(P.$,{variant:"outline",size:"icon",onClick:Q,children:(0,s.jsx)(e8.A,{className:"h-4 w-4"})}),!m&&(null==p?void 0:p.group)&&(0,s.jsx)(P.$,{variant:"outline",size:"icon",onClick:()=>b(!0),children:(0,s.jsx)(e0.A,{className:"h-4 w-4"})})]}),(0,s.jsxs)(P.$,{className:"w-full",onClick:el,children:[(0,s.jsx)(I.A,{className:"w-4 h-4 mr-2"}),h("createSimilarVideo")]})]})]})})}):null;return(0,s.jsxs)(s.Fragment,{children:[g?er:ei,(0,s.jsx)(eV.Lt,{open:v,onOpenChange:b,children:(0,s.jsxs)(eV.EO,{children:[(0,s.jsxs)(eV.wd,{children:[(0,s.jsx)(eV.r7,{children:h("delete")}),(0,s.jsx)(eV.$v,{children:h("confirmDeleteGeneration")})]}),(0,s.jsxs)(eV.ck,{children:[(0,s.jsx)(eV.Zr,{disabled:T.isPending,children:h("cancel")}),(0,s.jsx)(eV.Rx,{onClick:ee,disabled:T.isPending,children:T.isPending?h("deleting"):h("confirm")})]})]})})]})};var tw=a(28487),tN=a(45939);function tC(e){return void 0!==e&&e>=1&&e<=4}function tk(e,t){var a,s;let l=(null==t||null==(a=t.watermark_urls)?void 0:a.map(e=>({id:e.id,url:e.url,is_collected:+!!e.is_collected})))||(null==(s=e.all_image_urls)?void 0:s.map(e=>({id:e.id,url:e.url,is_collected:+!!e.is_collected})))||[];return 0===l.length&&e.thumbnail&&l.push({id:0,url:e.thumbnail,is_collected:0}),{id:(null==t?void 0:t.group)||e.id,group:(null==t?void 0:t.group)||void 0,prompt:(null==t?void 0:t.prompt)||e.prompt||null,model_display_name:(null==t?void 0:t.model_display_name)||e.model||null,model_logo:(null==t?void 0:t.model_logo)||e.model_logo||null,aspect_ratio:(null==t?void 0:t.as
1pect_ratio)||e.ratio||"1:1",mode:(null==t?void 0:t.video_mode)||"standard",created_at:(null==t?void 0:t.created_at)||e.created_at,created_at_datetime:null==t?void 0:t.created_at_datetime,image_input_urls:(null==t?void 0:t.image_input_urls)||null,watermark_urls:l,parent_type_id:(null==t?void 0:t.parent_type_id)||e.parent_type_id,image_type_id:null==t?void 0:t.image_type_id,image_type_name:(null==t?void 0:t.image_type_name)||e.image_type_name,effects_name:null==t?void 0:t.effects_name,effects_id:null==t?void 0:t.effects_id,tools_url_name:null==t?void 0:t.tools_url_name,tool_id:null==t?void 0:t.tool_id}}let t_=e=>{let{onLoginClick:t,prefix:a,suffix:l,loginText:i}=e;return(0,s.jsx)("div",{className:"flex flex-col items-center gap-2",children:(0,s.jsxs)("span",{children:[a,(0,s.jsx)(P.$,{variant:"link",className:"h-auto p-0 font-normal inline no-underline hover:no-underline bg-clip-text text-transparent",style:{backgroundImage:"linear-gradient(to right, rgba(75, 152, 255, 1), rgba(88, 89, 255, 1))"},onClick:t,children:i}),l]})})};function tS(e){let{videos:t=[],onVideoClick:a,onLoadMore:r,hasMore:n=!1,isLoadingMore:o=!1,isInitialLoading:d=!1,activeTab:c="myCreations",onTabChange:u,readOnly:m=!1,onMobileMenuOpen:x,onMobileCreateSimilar:h,className:g,filters:f,onFiltersChange:v,allVideosMap:b,noMobileBottomPadding:j=!1,scrollToGeneratingTrigger:y}=e,w=(0,i.c)(),N=(0,V.a)(),C=(0,l.useRef)(null),S=!!er.apiClient.getToken(),{userData:M}=(0,en.n)(),A=l.useMemo(()=>!!(S&&(null==M?void 0:M.id)),[S,M]),z=l.useCallback(()=>{let e=null==f?void 0:f.category_type;return e&&({text_to_video:w("textToVideoType"),text_to_image:w("textToImageType"),image_to_image:w("imageToImageType"),effects:w("effectType"),tools:w("toolType")})[e]||null},[null==f?void 0:f.category_type,w]),L=l.useCallback(()=>{if("myCreations"!==c)return w("noHistory");if(!A)return null;let e=z();return e?w("noCreationTypeRecords",{type:e}):w("noTextToVideoRecords")},[c,A,z,w]),I=l.useCallback(()=>{let{setIsAuthDialog:e,setAuthDialogPageName:t}=en.n.getState();t("SignIn"),e(!0)},[]),[B,R]=(0,l.useState)(null),[O,$]=(0,l.useState)(null),[G,U]=(0,l.useState)({open:!1,groupId:null}),[Z,H]=(0,l.useState)({open:!1,video:null}),[W,Y]=(0,l.useState)({open:!1,image:null,imageIndex:0}),q=(0,k.K)((0,F.k)(e=>e.videos)),K=(0,k.K)(e=>e.setPrompt),X=(0,l.useMemo)(()=>{let e=new Map;return q.forEach((t,a)=>{var s,l,i;let r=(null==(l=t.watermark_urls)||null==(s=l[0])?void 0:s.id)||t.group||"fallback-".concat(a,"-").concat(null==(i=t.prompt)?void 0:i.substring(0,20),"-").concat(t.created_at_datetime||t.created_at||Date.now());e.set(r,t)}),e},[q]),J=b||X,{loadedVideos:Q,setLoadedVideos:ee,observerRef:et,observedElementsRef:ea}=(e=>{let{scrollContainerRef:t,filters:a}=e,[s,i]=l.useState(new Set),r=l.useRef(null),n=l.useRef(new Set);return l.useEffect(()=>(r.current=new IntersectionObserver(e=>{let t=[];e.forEach(e=>{if(e.isIntersecting){let a=e.target.getAttribute("data-video-id");a&&t.push(a)}}),t.length>0&&i(e=>{let a=new Set(e);return t.forEach(e=>a.add(e)),a})},{root:t.current,rootMargin:"500px",threshold:.01}),()=>{var e;null==(e=r.current)||e.disconnect(),n.current.clear()}),[t]),l.useEffect(()=>{i(new Set),n.current.clear()},[a]),{loadedVideos:s,setLoadedVideos:i,observerRef:r,observedElementsRef:n}})({scrollContainerRef:C,filters:f}),{showScrollToBottom:es,scrollToBottom:el}=function(e,t,a,s){let[i,r]=(0,l.useState)(!1),n=(0,l.useRef)(!1),o=(0,l.useCallback)(function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=e.current;a&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{a.scrollTo({top:a.scrollHeight,behavior:t?"smooth":"auto"}),setTimeout(()=>{a.scrollHeight-a.scrollTop-a.clientHeight>10&&(a.scrollTop=a.scrollHeight)},100)})})},[e]);return(0,l.useEffect)(()=>{let l=e.current;if(!l)return;let i=()=>{let{scrollTop:e,scrollHeight:i,clientHeight:o}=l;r(Math.abs(e)>800),t&&!a&&!n.current&&e<200&&(null==s||s())};return l.addEventListener("scroll",i,{passive:!0}),i(),()=>l.removeEventListener("scroll",i)},[e,t,a,s]),{showScrollToBottom:i,scrollToBottom:(0,l.useCallback)(()=>{n.current=!0,o(!0),r(!1),setTimeout(()=>{n.current=!1,r(!1)},600)},[o])}}(C,n,o,r);(0,l.useEffect)(()=>{null!=y&&y>0&&el()},[y,el]);let{handleDownload:ei,handleCollect:eo,handleShare:ed,handleCreateSimilar:ec,handleDelete:eu,getVideoGroupId:em,isDownloading:ex,isCollecting:ep,isDeleting:eh}=function(e){let{onMobileCreateSimilar:t,isMobile:a=!1,videoIdToOriginalMap:s,filters:r}=e,n=(0,i.c)(),[o,d]=(0,l.useState)(!1),c=(0,to.X)(),u=(0,td.N)(),m=(0,tc.d)(),{setCreateSimilarVideo:x,setAdvancedSettingsOpen:p,removeVideoByGroup:h,removeVideoByVideoId:g,updateVideoCollection:f}=(0,k.K)((0,F.k)(e=>({setCreateSimilarVideo:e.setCreateSimilarVideo,setAdvancedSettingsOpen:e.setAdvancedSettingsOpen,removeVideoByGroup:e.removeVideoByGroup,removeVideoByVideoId:e.removeVideoByVideoId,updateVideoCollection:e.updateVideoCollection}))),v=(0,l.useCallback)(async(e,t)=>{null==t||t.stopPropagation();let a=tm(e.id),s=e.watermark_url||e.video_url;if(!s)return void _.toast.error(n("downloadFailed"));d(!0);try{if(a){let e=await m.mutateAsync(a);await tu(e.data.url,"video-".concat(Date.now(),".mp4"))}else await tu(s,"video-".concat(Date.now(),".mp4"));_.toast.success(n("downloadSuccess"))}catch(e){console.error("Download failed:",e),_.toast.error(n("downloadFailed"))}finally{d(!1)}},[n,m]),b=(0,l.useCallback)((e,t)=>{var a,l;null==t||t.stopPropagation();let i=s.get(e.id),o=(null==i||null==(l=i.watermark_urls)||null==(a=l[0])?void 0:a.id)||tm(e.id);if(!o||"number"!=typeof o)return void _.toast.error(n("collectFailed"));let d=e.is_collected||!1,c=(null==r?void 0:r.operation)===1;f(o,!d),u.mutate(o,{onSuccess:e=>{_.toast.success(e.data.is_collected?n("collectSuccess"):n("uncollectSuccess")),c&&!e.data.is_collected&&g(o)},onError:e=>{f(o,d),console.error("Toggle collection failed:",e),_.toast.error(e.message||n("collectFailed"))}})},[n,u,f,g,s,r]),j=(0,l.useCallback)(async(e,t)=>{null==t||t.stopPropagation();let a=e.watermark_url||e.video_url||e.thumbnail;try{await navigator.clipboard.writeText(a),_.toast.success(n("shareLinkCopied"))}catch(e){_.toast.error(n("copyFailed"))}},[n]),y=(0,l.useCallback)((e,l)=>{var i,r,o,d;null==l||l.stopPropagation();let c=s.get(e.id);if(!c)return void _.toast.success(n("settingsApplied"));let u=(null!=(o=null==(i=c.negative_prompt)?void 0:i.trim())?o:"")!==""||(null!=(d=null==(r=c.seed)?void 0:r.trim())?d:"")!==""||1===c.multi_shots||1===c.camera_fixed,m={prompt:c.prompt||"",videoModelId:c.video_model_id,modelDisplayName:c.model_display_name||"",modelLogo:c.model_logo||"",ratio:c.aspect_ratio||"",resolution:c.resolution||"",durationSeconds:c.duration_seconds||5,negativePrompt:c.negative_prompt,seed:c.seed,multiShots:c.multi_shots,cameraFixed:c.camera_fixed,hasAudio:c.has_audio,videoType:c.video_type,promptOptimizer:c.prompt_optimizer};u&&p(!0),x(m),a&&(null==t||t()),_.toast.success(n("settingsApplied"))},[s,x,p,a,t,n]);return{handleDownload:v,handleCollect:b,handleShare:j,handleCreateSimilar:y,handleDelete:(0,l.useCallback)((e,t)=>{c.mutate(e,{onSuccess:()=>{h(e),_.toast.success(n("deleted")),null==t||t()},onError:e=>{console.error("Delete video failed:",e),_.toast.error(n("deleteFailed"))}})},[c,h,n]),getVideoGroupId:(0,l.useCallback)(e=>{let t=s.get(e.id);return(null==t?void 0:t.group)||null},[s]),isDownloading:o,isCollecting:u.isPending,isDeleting:c.isPending}}({isMobile:N,onMobileCreateSimilar:h,videoIdToOriginalMap:J,filters:f}),eg=(0,tN.u)({isMobile:N,onMobileOpenControlPanel:h}),ef=(0,l.useCallback)((e,t)=>{if(null==t||t.stopPropagation(),tC(e.parent_type_id)){let t=J.get(e.id),a=tk(e,t);eg.handleCreateSimilar(a);return}ec(e,t)},[J,eg,ec]),ev=(0,l.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if("generating"===e.status)return;if(tC(e.parent_type_id)){let s=J.get(e.id);Y({open:!0,image:tk(e,s),imageIndex:t}),null==a||a(e);return}let s=!!(e.watermark_url||e.video_url);if(N&&s){null==a||a(e);return}H({open:!0,video:e}),null==a||a(e)},[N,a,J]),eb=(0,l.useCallback)(e=>{H(t=>(0,eI._)((0,eL._)({},t),{open:e}))},[]),ej=(0,l.useCallback)(e=>{e&&H({open:!1,video:null})},[]),ey=(0,l.useCallback)(e=>{Y(t=>(0,eI._)((0,eL._)({},t),{open:e}))},[]),ew=(0,l.useCallback)(()=>{Y({open:!1,image:null,imageIndex:0})},[]),eN=(0,l.useCallback)((e,t,a)=>{e.stopPropagation(),navigator.clipboard.writeText(t),R(a),_.toast.success(w("copied")),setTimeout(()=>R(null),2e3)},[w]),eC=(0,l.useCallback)(e=>t=>{t.stopPropagation(),e&&(K(e),_.toast.success(w("promptApplied")))},[w,K]),ek=(0,l.useCallback)(e=>t=>{t.stopPropagation();let a=em(e);a&&U({open:!0,groupId:a})},[em]),e_=(0,l.useCallback)(()=>{G.groupId&&eu(G.groupId,()=>{U({open:!1,groupId:null})})},[G.groupId,eu]);return(0,s.jsxs)("div",{className:(0,D.cn)("flex-1 flex flex-col relative min-h-0",g),children:[(0,s.jsx)(eW,{activeTab:c,onTabChange:u,onMobileMenuOpen:x,filters:f,onFiltersChange:v}),(0,s.jsx)("div",{ref:C,className:(0,D.cn)("flex-1 overflow-y-auto relative scrollbar-thin min-h-0 flex flex-col-reverse",N?j?"pb-4":"pb-24":"pt-2"),children:d&&0===t.length?(0,s.jsx)(T.default,{fullscreen:!1}):0===t.length?(0,s.jsxs)(tn.Sv,{className:"h-full text-muted-foreground
1/70",children:[(0,s.jsx)(tn.cz,{children:(0,s.jsx)(p.default,{src:"/images/icons/noImage.png",alt:"",width:120,height:120,className:"size-[120px]"})}),(0,s.jsx)(tn.HY,{children:"myCreations"!==c||A?L():(0,s.jsx)(t_,{onLoginClick:I,prefix:w("loginToStartCreatingPrefix"),suffix:w("loginToStartCreatingSuffix"),loginText:w("login")})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"pb-4",children:t.map((e,t)=>{var a,l;let i=e.id?"video-".concat(e.id):"fallback-".concat(t,"-").concat(null==(a=e.prompt)?void 0:a.substring(0,10)),r="generating"===e.status||Q.has(i)||t<3;return(0,s.jsx)(tr,{video:e,videoIndex:t,stableKey:i,isLoaded:r,copiedPromptId:B,hoveredPromptId:O,readOnly:m,onVideoClick:t=>ev(e,t),onCopyPrompt:eN,onUsePromptOnly:eC(null!=(l=e.prompt)?l:void 0),onCreateSimilar:t=>ef(e,t),onDelete:m?void 0:ek(e),onDownload:t=>ei(e,t),onShare:t=>ed(e,t),onCollect:m?void 0:t=>eo(e,t),onSetHoveredPromptId:$,onSetLoadedVideos:ee,isDownloading:ex,isCollecting:ep,scrollContainerRef:C,observerRef:et,observedElementsRef:ea},i)})}),o&&(0,s.jsx)("div",{className:"flex justify-center py-4",children:(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,s.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-1.5 border-border/60"}),(0,s.jsx)("span",{children:w("loading")})]})})]})}),es&&(0,s.jsx)("div",{className:"absolute bottom-24 md:bottom-6 right-3 md:right-6 z-30",children:(0,s.jsx)(E.Bc,{children:(0,s.jsxs)(E.m_,{children:[(0,s.jsx)(E.k$,{asChild:!0,children:(0,s.jsx)(P.$,{variant:"default",size:"icon",className:"h-10 w-10 rounded-full shadow-lg hover:shadow-xl transition-all",onClick:el,children:(0,s.jsx)(eE.A,{className:"!size-5"})})}),(0,s.jsx)(E.ZI,{side:"left",children:w("scrollToBottom")})]})})}),(0,s.jsx)(eV.Lt,{open:G.open,onOpenChange:e=>U(t=>(0,eI._)((0,eL._)({},t),{open:e})),children:(0,s.jsxs)(eV.EO,{children:[(0,s.jsxs)(eV.wd,{children:[(0,s.jsx)(eV.r7,{children:w("delete")}),(0,s.jsx)(eV.$v,{children:w("confirmDeleteGeneration")})]}),(0,s.jsxs)(eV.ck,{children:[(0,s.jsx)(eV.Zr,{disabled:eh,children:w("cancel")}),(0,s.jsx)(eV.Rx,{onClick:e_,disabled:eh,children:eh?w("deleting"):w("confirm")})]})]})}),(0,s.jsx)(ty,{video:Z.video,open:Z.open,onOpenChange:eb,onDelete:ej,readOnly:m,onMobileOpenControlPanel:h,originalVideo:Z.video?J.get(Z.video.id):null}),(0,s.jsx)(tw.D,{image:W.image,open:W.open,onOpenChange:ey,initialImageIndex:W.imageIndex,onDelete:ew,readOnly:m,onMobileOpenControlPanel:h})]})}function tM(e){let{onOpenParams:t,onGenerate:a}=e,r=(0,i.c)(),{prompt:n,model:o,models:d,isLoadingModels:c,isGenerating:m,duration:x,ratio:p,resolution:h,generateAudio:g,audioFile:f}=(0,k.K)(),v=(0,l.useMemo)(()=>d.find(e=>e.name===o),[d,o]),{totalPoints:b,canGenerate:j}=eP({selectedModel:v,duration:x,ratio:p,resolution:h,generateAudio:g,audioFile:f,prompt:n,modelName:o,isLoadingModels:c,isGenerating:m}),y=m||n.trim()?n:r("enterPrompt"),w=y.length>20?"".concat(y.slice(0,20),"…"):y,N=!!n.trim();return(0,s.jsx)("div",{className:"w-full shrink-0 px-4 pt-3 pb-[calc(0.75rem+env(safe-area-inset-bottom))] bg-background dark:bg-[#0F0F0F] border-t rounded-t-xl md:hidden",children:(0,s.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,s.jsxs)("div",{role:"button",tabIndex:0,className:"flex-1 flex items-center gap-2 h-10 rounded-lg px-3 bg-muted/50 cursor-pointer overflow-hidden min-w-0",onClick:t,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),t())},children:[(null==v?void 0:v.logo)?(0,s.jsx)(J.default,{src:v.logo,alt:v.display_name,width:20,height:20,className:"rounded shrink-0 flex-shrink-0"}):(0,s.jsx)("div",{className:"w-5 h-5 shrink-0 rounded bg-gradient-to-br from-blue-400 to-purple-600 flex-shrink-0"}),(0,s.jsx)("span",{className:"shrink-0 text-muted-foreground/60",children:"|"}),(0,s.jsx)("span",{className:(0,D.cn)("truncate flex-1 min-w-0 text-left text-sm",N?"text-white":"text-muted-foreground/50"),children:w}),(0,s.jsx)(eY.A,{className:"h-4 w-4 shrink-0 text-muted-foreground flex-shrink-0 ml-auto"})]}),(0,s.jsxs)(P.$,{type:"button",className:(0,D.cn)("h-10 rounded-lg px-4 shrink-0 gap-1.5 min-w-0 border-0",j&&"!bg-transparent text-white hover:opacity-90",!j&&"bg-muted text-muted-foreground"),style:j?{backgroundImage:"url('/generate.svg')",backgroundSize:"100% 100%",backgroundRepeat:"no-repeat"}:void 0,disabled:!j,onClick:a,children:[(0,s.jsx)("span",{className:"truncate",children:r(m?"generating":"generate")}),!m&&(0,s.jsxs)("span",{className:"flex items-center gap-1 shrink-0",children:[(0,s.jsx)(u.g,{className:"text-[14px]"}),(0,s.jsx)("span",{children:b})]})]})]})})}var tA=a(23372),tT=a(47713);function tP(e){var t,a;let{defaultTab:x="examples"}=e;(0,i.c)();let p=(0,en.n)(e=>e.hasToken),h=(0,en.n)(e=>e.userData),[g,f]=l.useState(!1);(0,tT.l5)(),l.useEffect(()=>{f(!0)},[]);let v=!g||!p,[b,j]=l.useState({category_type:"text_to_video"}),{activeTab:N,setActiveTab:C,controlPanelOpen:S,setControlPanelOpen:M,mobileMenuOpen:P,setMobileMenuOpen:F,scrollToGeneratingTrigger:z,handleGenerate:D,generatedVideos:L,isInitialLoading:I,isLoadingMore:E,hasMore:V,handleLoadMore:B,allVideosMap:R}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"examples",t=arguments.length>
11?arguments[1]:void 0,a=(0,i.c)(),s=(0,tA.jE)(),r=(0,k.K)(),[n,o]=(0,l.useState)(!1),[d,c]=(0,l.useState)(0),u=(0,k.K)(e=>e.activeTab),m=(0,k.K)(e=>e.setActiveTab);(0,l.useEffect)(()=>{u!==e&&m(e)},[e]),(0,l.useEffect)(()=>{(async()=>{try{r.setIsLoadingModels(!0);let e=function(e){switch(e){case"text":return 1;case"image":return 2;case"video":return 3;default:return 0}}(r.videoType),t=await (0,y.me)({model_type:e});if(r.setModels(t),t.length>0){let e=r.model;t.some(t=>t.name===e)||r.setModel(t[0].name)}}catch(e){console.error("Failed to fetch video models:",e),_.toast.error("Failed to load video models")}finally{r.setIsLoadingModels(!1)}})()},[r.videoType]);let x=(0,l.useRef)(null),p=(0,l.useRef)(new Set),h=(0,l.useCallback)(e=>{switch(e){case"text":default:return 5;case"image":return 6;case"video":return 7}},[]),g=(0,l.useCallback)(e=>{if(e&&"all"!==e)return({text_to_image:1,image_to_image:2,text_to_video:5,effects:3,tools:4})[e]},[]),f=(0,l.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{a?r.setIsLoadingMoreVideos(!0):r.setIsLoadingVideos(!0);let s=g(null==t?void 0:t.category_type),l={page:e,size:20};void 0!==s&&(l.parent_type_id=s),(null==t?void 0:t.start_time)&&(l.start_time=t.start_time),(null==t?void 0:t.end_time)&&(l.end_time=t.end_time),(null==t?void 0:t.operation)!==void 0&&(l.operation=t.operation);let{content:i,total_pages:n,last:o}=(await (0,y.sY)(l)).data;return a?r.appendVideos(i):r.setVideos(i),r.setCurrentPage(e),r.setTotalPages(n),r.setHasMoreVideos(!o),i}catch(e){return console.error("Failed to fetch video history:",e),a||_.toast.error("Failed to load video history"),[]}finally{r.setIsLoadingVideos(!1),r.setIsLoadingMoreVideos(!1)}},[r.videoType,h,g,null==t?void 0:t.category_type,null==t?void 0:t.start_time,null==t?void 0:t.end_time,null==t?void 0:t.operation]),v=(0,l.useCallback)(e=>{var t,a,s;return e.group||(null==(s=e.watermark_urls)||null==(a=s[0])||null==(t=a.id)?void 0:t.toString())||e.created_at_datetime||""},[]),b=(0,l.useCallback)(e=>e.some(e=>"pending"===e.generation_status||"processing"===e.generation_status),[]),j=(0,l.useCallback)(()=>{x.current&&clearInterval(x.current),x.current=setInterval(async()=>{let e=await f(1,!1),t=p.current;p.current=new Set(e.filter(e=>"pending"===e.generation_status||"processing"===e.generation_status).map(e=>v(e)).filter(Boolean)),b(e)||(N(),t.size>0&&(e.filter(e=>("completed"===e.generation_status||"failed"===e.generation_status)&&t.has(v(e))).some(e=>"failed"===e.generation_status)?_.toast.error(a("videoGenerationFailed")||"Video generation failed."):_.toast.success(a("videoGenerationCompleted")||"Video generation completed!")),s.invalidateQueries({queryKey:["useQueryUserData"]}))},5e3)},[f,b,v,s,a]),N=(0,l.useCallback)(()=>{x.current&&(clearInterval(x.current),x.current=null)},[]),C=(0,l.useCallback)(async()=>{!r.isLoadingMoreVideos&&r.hasMoreVideos&&await f(r.currentPage+1,!0)},[r.currentPage,r.isLoadingMoreVideos,r.hasMoreVideos,f]),S=(0,l.useCallback)(async()=>{b(await f(1,!1))&&j()},[f,b,j]),{data:M,fetchNextPage:A,hasNextPage:T,isFetchingNextPage:P,isLoading:F}=w({parent_type_id:(0,l.useMemo)(()=>h(r.videoType),[r.videoType,h])},"examples"===u),z=!!er.apiClient.getToken(),{userData:D}=(0,en.n)(),L=(0,l.useMemo)(()=>!!(z&&(null==D?void 0:D.id)),[z,D]),I=(0,l.useRef)(!1);(0,l.useEffect)(()=>("myCreations"===u&&L&&S(),()=>{N()}),[r.videoType,u,L,null==t?void 0:t.category_type,null==t?void 0:t.start_time,null==t?void 0:t.end_time,null==t?void 0:t.operation]),(0,l.useEffect)(()=>{!I.current&&L&&"myCreations"===u&&S(),I.current=L},[L,u]);let E=(0,l.useCallback)(async()=>{var e,t,l,i;if(!(null==(e=r.prompt)?void 0:e.trim()))return void _.toast.error(a("enterPrompt")||"Please enter a prompt");let n=r.models.find(e=>e.name===r.model);if(!n)return void _.toast.error(a("selectModel")||"Please select a model");if(!r.isGenerating)try{r.setIsGenerating(!0);let e={model_id:n.id,prompt:r.prompt.trim(),translate_prompt:+!!r.translatePrompt};r.ratio&&(e.aspect_ratio=r.ratio),r.resolution&&(e.resolution=r.resolution),r.duration&&(e.duration=r.duration.replace(/s$/i,"")),(null==(t=r.negativePrompt)?void 0:t.trim())&&(e.negative_prompt=r.negativePrompt.trim()),(null==(l=r.seed)?void 0:l.trim())&&(e.seed=r.seed.trim()),r.cameraFixed&&(e.camera_fixed="true"),r.multiSh
1ots&&(e.multi_shots="true"),r.generateAudio&&(e.generate_audio="true"),(null==(i=r.audioFile)?void 0:i.url)&&(e.audio_file=r.audioFile.url);let o=await (0,y.n2)(e);return await s.refetchQueries({queryKey:["useQueryUserData"]}),_.toast.success(a("videoGenerationStarted")||"Video generation started! This may take 30-40 seconds."),m("myCreations"),r.setControlPanelOpen(!1),await S(),j(),c(e=>e+1),o}catch(t){console.error("Failed to generate video:",t);let e=t instanceof Error?t.message:"Failed to generate video";throw _.toast.error(e),t}finally{r.setIsGenerating(!1)}},[s,r.prompt,r.model,r.models,r.ratio,r.resolution,r.duration,r.negativePrompt,r.seed,r.cameraFixed,r.multiShots,r.generateAudio,r.audioFile,r.translatePrompt,r.isGenerating,r.setIsGenerating,m,r.setControlPanelOpen,S,j,a]),V=(0,l.useMemo)(()=>{if(!(null==M?void 0:M.pages))return[];let e=[],t=new Set;return M.pages.forEach((a,s)=>{var l;(null==(l=a.data)?void 0:l.content)&&a.data.content.forEach((a,l)=>{var i,r,n;let o=(null==(r=a.watermark_urls)||null==(i=r[0])?void 0:i.id)||a.group||"fallback-".concat(s,"-").concat(l,"-").concat(null==(n=a.prompt)?void 0:n.substring(0,20),"-").concat(a.created_at_datetime||a.created_at||Date.now());t.has(o)||(t.add(o),e.push(a))})}),e.reverse()},[M]),B=(0,l.useMemo)(()=>{let e=new Map;return r.videos.forEach(t=>{var a,s,l;let i=t.group||(null==(s=t.watermark_urls)||null==(a=s[0])?void 0:a.id)||"demo-".concat(null==(l=t.prompt)?void 0:l.substring(0,20),"-").concat(t.created_at_datetime||t.created_at||Date.now());e.set(i,t)}),V.forEach(t=>{var a,s,l;let i=t.group||(null==(s=t.watermark_urls)||null==(a=s[0])?void 0:a.id)||"demo-".concat(null==(l=t.prompt)?void 0:l.substring(0,20),"-").concat(t.created_at_datetime||t.created_at||Date.now());e.set(i,t)}),e},[r.videos,V]),R=(0,l.useMemo)(()=>{let e=e=>{let t=new Set,a=[];for(let s of e){let e=function(e){var t,a,s,l,i,r;let n=null==(t=e.watermark_urls)?void 0:t[0],o=e.generation_status||"completed";("pending"===o||"processing"===o)&&(o="generating");let d=e.group||(null==n?void 0:n.id)||"demo-".concat(null==(a=e.prompt)?void 0:a.substring(0,20),"-").concat(e.created_at_datetime||e.created_at||Date.now()),c=void 0!==(r=e.parent_type_id)&&r>=1&&r<=4;return{id:d,thumbnail:(null==n?void 0:n.cover_url)||c&&(null==n?void 0:n.url)||"",prompt:e.prompt,duration:e.duration_seconds?"".concat(e.duration_seconds,"s"):"",model:e.model_display_name,model_logo:e.model_logo||"",ratio:e.aspect_ratio||"",resolution:e.resolution||"",status:o,video_url:c?null:(null==n?void 0:n.url)||null,watermark_url:c?null:(null==n?void 0:n.url)||null,cover_url:(null==n?void 0:n.cover_url)||null,points_used:null!=(l=e.points_used)?l:void 0,is_collected:(null==n?void 0:n.is_collected)||!1,parent_type_id:e.parent_type_id,image_type_name:e.image_type_name,all_image_urls:c?null==(s=e.watermark_urls)?void 0:s.map(e=>({url:e.url,id:e.id,is_collected:e.is_collected})):void 0,created_at:e.created_at,video_error_message:null!=(i=e.video_error_message)?i:void 0}}(s);t.has(e.id)||(t.add(e.id),a.push(e))}return a};return e("examples"===u?V:[...r.videos].reverse())},[u,r.videos,V]),O="myCreations"===u?r.isLoadingVideos&&0===r.videos.length:F&&!M,$="myCreations"===u?r.hasMoreVideos:null!=T&&T,G="myCreations"===u?r.isLoadingMoreVideos:null!=P&&P,U=(0,l.useCallback)(async()=>{"examples"===u?T&&!P&&await A():await C()},[u,T,P,A,C]);return(0,eI._)((0,eL._)({},r),{activeTab:u,setActiveTab:m,mobileMenuOpen:n,setMobileMenuOpen:o,scrollToGeneratingTrigger:d,handleGenerate:E,loadMoreVideos:C,refreshVideos:S,handleLoadMore:U,generatedVideos:R,isInitialLoading:O,hasMore:$,isLoadingMore:G,allVideosMap:B})}(x,b);return(0,s.jsxs)("div",{className:"flex flex-col h-full min-h-0 w-full",children:[(0,s.jsx)("div",{className:"md:hidden shrink-0",children:(0,s.jsx)(c.q,{bottomBorder:!0,title:"Text to Video",onMenuClick:()=>F(!0),rightSlot:g?p&&h?(0,s.jsx)(u.S,{total:null!=(t=h.points)?t:0,used:Math.max(0,null!=(a=h.used_points)?a:0),hoverTrigger:!1}):(0,s.jsx)("span",{className:"text-sm font-bold",style:{background:"linear-gradient(to right, rgba(75,152,255,1), rgba(88,89,255,1))",WebkitBackgroun
1dClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text"},children:"Examples"}):(0,s.jsx)("span",{className:"w-8","aria-hidden":!0})})}),(0,s.jsxs)("div",{id:"text-to-video-page-container",className:"flex-1 min-h-0 flex flex-col w-full ".concat(v?"overflow-y-auto":"overflow-hidden"),children:[(0,s.jsxs)("div",{id:"video-workspace",className:"".concat(v?"h-full shrink-0":"flex-1"," min-h-0 overflow-hidden flex flex-col"),children:[(0,s.jsxs)("div",{className:"hidden md:flex h-full min-h-0 flex-1 overflow-hidden",children:[(0,s.jsx)("div",{className:"h-full min-h-0",children:(0,s.jsx)(eD,{onGenerate:D})}),(0,s.jsx)(o.Zp,{className:"h-full min-h-0 w-full ml-2 overflow-hidden flex flex-col",children:(0,s.jsx)(tS,{videos:L,activeTab:N,onTabChange:C,filters:b,onFiltersChange:j,onMobileMenuOpen:()=>F(!0),isInitialLoading:I,isLoadingMore:E,hasMore:V,onLoadMore:B,readOnly:"examples"===N,allVideosMap:R,onMobileCreateSimilar:()=>M(!0),scrollToGeneratingTrigger:z})})]}),(0,s.jsxs)("div",{className:"flex md:hidden flex-1 min-h-0 flex-col overflow-hidden dark:bg-[#0f0f0f]",children:[g?(0,s.jsx)(tS,{videos:L,activeTab:N,onTabChange:C,filters:b,onFiltersChange:j,onMobileMenuOpen:()=>F(!0),isInitialLoading:I,isLoadingMore:E,hasMore:V,onLoadMore:B,readOnly:"examples"===N,allVideosMap:R,onMobileCreateSimilar:()=>M(!0),noMobileBottomPadding:!0,scrollToGeneratingTrigger:z}):(0,s.jsx)("div",{className:"flex-1 relative",children:(0,s.jsx)(T.default,{fullscreen:!1})}),(0,s.jsx)(tM,{onOpenParams:()=>M(!0),onGenerate:D})]})]}),(0,s.jsx)(m.r,{children:(0,s.jsx)(A,{})})]}),(0,s.jsx)(r._s,{open:S,onOpenChange:M,children:(0,s.jsxs)(r.zj,{className:"h-[70dvh] p-0",showHandle:!0,children:[(0,s.jsx)(r.gk,{className:"sr-only",children:"Video Control Panel"}),(0,s.jsx)("div",{className:"h-full min-h-0 overflow-hidden",children:(0,s.jsx)(eD,{className:"w-full h-full border-none shadow-none",onGenerate:D})})]})}),(0,s.jsx)(n.cj,{open:P,onOpenChange:F,children:(0,s.jsxs)(n.h,{side:"left",className:"p-0 sm:max-w-none",showClose:!1,children:[(0,s.jsx)(n.qp,{className:"sr-only",children:"Navigation"}),(0,s.jsx)("div",{className:"h-full flex",children:(0,s.jsx)("div",{className:"shrink-0",children:(0,s.jsx)(d.AppSidebar,{})})})]})})]})}},51648:(e,t,a)=>{"use strict";a.d(t,{S:()=>m,g:()=>u});var s=a(23557);a(17537);var l=a(79346),i=a(45527),r=a(3338),n=a(3e4),o=a(682),d=a(12080),c=a(13958);let u=e=>{let{className:t}=e;return(0,s.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{d:"M9.78951 8.56245C8.98731 8.56105 8.22361 8.41895 7.54391 7.98775C6.70951 7.45855 6.71021 6.67595 7.53901 6.14885C8.77661 5.36275 10.899 5.37745 12.1268 6.18035C12.8828 6.67525 12.8709 7.48655 12.1002 7.96745C11.3981 8.40565 10.6176 8.56735 9.78951 8.56245Z",fill:"#FF8E12"}),(0,s.jsx)("path",{d:"M1.62609 8.80322C2.88889 10.1283 4.47089 10.4069 6.15299 10.4783C6.09909 11.2252 6.24469 11.8342 6.83829 12.2878L6.82359 12.3949C6.46169 12.3949 6.22159 12.4061 5.86109 12.3879C4.64869 12.3277 3.48599 12.0897 2.46889 11.4156C1.81089 10.9795 1.34609 10.4188 1.41259 9.60122C1.43289 9.35692 1.53929 9.11752 1.62609 8.80322Z",fill:"#FCA315"}),(0,s.jsx)("path",{d:"M7.07839 8.36084C8.33069 9.70064 11.403 9.57954 12.5027 8.38604C12.7911 8.73534 12.7617 9.20154 12.4089 9.58794C11.9434 10.0968 11.312 10.2998 10.6407 10.4048C9.51439 10.5805 8.43709 10.4755 7.48299 9.81754C6.91389 9.42484 6.77809 8.89004 7.07839 8.36084Z",fill:"#FF8E12"}),(0,s.jsx)("path",{d:"M7.07349 10.2509C8.28729 11.5879 11.3484 11.5375 12.5062 10.2943C12.789 10.6618 12.7554 11.1245 12.4075 11.5025C11.8944 12.0597 11.1979 12.255 10.4678 12.3481C9.40169 12.4839 8.38039 12.3621 7.48649 11.7328C6.91599 11.331 6.77459 10.8095 7.07349 10.2509Z",fill:"#FF8E12"}),(0,s.jsx)("path",{d:"M10.878 3.90038L10.8773 3.89968C10.9844 3.30258 10.6694 2.66628 10.0205 2.23088C8.8571 1.44968 7.5278 1.23688 5.9542 1.20398C5.6973 1.22918 5.2528 1.26208 4.8111 1.31738C3.9004 1.43078 3.0513 1.71218 2.2988 2.22178C1.1578 2.99528 1.0934 4.11388 2.1602 4.97208C2.478 5.22758 2.8574 5.42848 3.2382 5.59368C4.0502 5.94508 4.9231 6.05358 5.8072 6.11028C5.8268 6.11168 5.8464 6.11238 5.8653 6.11308H5.866C5.9066 6.11518 5.9465 6.11588 5.985 6.11518C6.2314 6.11868 6.4834 6.11378 6.573 6.09838C6.6283 5.98778 6.8579 5.75398 6.958 5.65458C7.7567 4.99938 8.7696 4.83068 9.7986 4.86708C9.7986 4.86708 10.1325 4.87688 10.3362 4.90138C10.6638 4.68368 10.8101 4.18948 10.8577 3.98858C10.8598 3.97878 10.8626 3.96898 10.8647 3.95918C10.8738 3.92348 10.878 3.90038 10.878 3.90038ZM6.4652 7.87568C6.3644 7.72098 6.2475 7.35418 6.2475 7.35418L5.8324 7.34438C4.2707 7.25758 2.8231 6.89
1638 1.6933 5.73788C1.232 6.40848 1.3237 7.20298 1.9306 7.82178C2.7321 8.63868 3.787 8.96698 4.8972 9.15808C5.0435 9.18328 5.1905 9.19938 5.3354 9.21058C5.6784 9.24908 6.09 9.27918 6.2426 9.27008C6.1425 8.72198 6.2909 8.17108 6.4652 7.87568ZM7.0735 10.2508C6.7746 10.8094 6.916 11.3309 7.4865 11.7327C7.637 11.8384 7.791 11.9287 7.9478 12.0071C8.3041 11.753 8.6387 11.4723 8.9509 11.1671C8.2019 11.039 7.5152 10.7373 7.0735 10.2508ZM10.4048 9.28688C9.1805 9.43038 7.8148 9.14898 7.0784 8.36078C6.7781 8.89068 6.9139 9.42548 7.4823 9.81748C8.1333 10.2669 8.8424 10.458 9.5851 10.4783C9.891 10.1059 10.1654 9.70758 10.4048 9.28688ZM7.5397 6.14878C6.7102 6.67588 6.7102 7.45918 7.5446 7.98768C8.2243 8.41818 8.988 8.56098 9.7902 8.56238C10.1409 8.56448 10.4825 8.53648 10.8136 8.46998C11.1664 7.65728 11.396 6.77948 11.4786 5.85828C10.2438 5.39558 8.5799 5.48798 7.5397 6.14878Z",fill:"#FCA315"}),(0,s.jsx)("path",{d:"M1.6261 8.80324C1.5393 9.11754 1.4329 9.35694 1.4133 9.60194C1.3846 9.95124 1.4539 10.2536 1.5932 10.5196C2.2862 10.4468 2.9547 10.2914 3.5875 10.0625C2.8784 9.81474 2.2169 9.42414 1.6261 8.80324ZM5.8324 7.34374C4.2707 7.25694 2.8231 6.89574 1.6933 5.73724C1.232 6.40784 1.3237 7.20234 1.9306 7.82114C2.7321 8.63804 3.787 8.96634 4.8972 9.15744C5.0337 9.18124 5.1716 9.19594 5.3074 9.20714C5.6371 8.99364 5.9507 8.75844 6.2468 8.50294C6.2923 8.24884 6.3749 8.02764 6.4659 7.87434C6.3651 7.71964 6.2482 7.35284 6.2482 7.35284L5.8324 7.34374ZM4.8111 1.31744C3.9004 1.43084 3.0513 1.71224 2.2988 2.22184C1.1578 2.99534 1.0934 4.11394 2.1602 4.97214C2.478 5.22764 2.8574 5.42854 3.2382 5.59374C4.0502 5.94514 4.9231 6.05364 5.8072 6.11034C5.8268 6.11174 5.8464 6.11244 5.8653 6.11314H5.866C5.9066 6.11524 5.9465 6.11594 5.985 6.11524C6.2314 6.11874 6.4834 6.11384 6.573 6.09844C6.6283 5.98784 6.8579 5.75404 6.958 5.65464C7.4683 5.23604 8.0668 5.01694 8.7003 4.92174C9.0167 4.03204 9.1896 3.07374 9.1896 2.07484C9.1896 1.97474 9.1875 1.87464 9.184 1.77524C8.2278 1.36084 7.1624 1.22854 5.9535 1.20264C5.6973 1.22924 5.2528 1.26214 4.8111 1.31744Z",fill:"#FFBC42"}),(0,s.jsx)("path",{d:"M1.6933 5.73788C1.4077 6.15228 1.3349 6.61498 1.4637 7.05388C1.8809 6.90198 2.2827 6.71858 2.667 6.50648C2.31066 6.29332 1.98338 6.03498 1.6933 5.73788ZM5.9542 1.20398C5.6973 1.22918 5.2528 1.26208 4.8111 1.31738C3.9004 1.43078 3.0513 1.71218 2.2988 2.22178C1.1578 2.99528 1.0934 4.11388 2.1602 4.97208C2.478 5.22758 2.8574 5.42848 3.2382 5.59368C3.4097 5.66788 3.584 5.73088 3.7611 5.78548C5.2143 4.65918 6.2916 3.07158 6.7739 1.24178C6.5079 1.22218 6.2349 1.20958 5.9542 1.20398Z",fill:"#FFC65E"})]})},m=e=>{let{total:t,used:a,hoverTrigger:m=!1,side:x="bottom",align:p="start"}=e,h=(0,i.c)(),g=(0,r.rd)();(0,o.j)().getRouterURL;let f=Math.max(0,t-a),v=t>0?Math.min(100,Math.round(a/t*100)):0,b=(0,s.jsxs)("div",{"data-track-id":"header-credits",className:(0,n.cn)("flex items-center gap-1.5 px-2.5 py-1.5 rounded-[100px] h-8","transition-all duration-200","group cursor-pointer","bg-[#9e9e9e]/20"),children:[(0,s.jsx)(u,{}),(0,s.jsx)("span",{className:"text-xs font-medium leading-[18px] text-[#ffc65e]",children:f.toLocaleString()})]});return(0,s.jsx)(d.$B,{trigger:b,side:x,align:p,hoverTrigger:m,contentClassName:"p-5",gradientAngle:-18.0459,children:(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between text-sm font-medium leading-[18px]",children:[(0,s.jsx)("span",{className:"whitespace-nowrap text-white",children:h("creditsUsed")}),(0,s.jsxs)("span",{className:"whitespace-nowrap text-white",children:[a.toLocaleString()," ",h("credits")]})]}),(0,s.jsx)("div",{className:"relative w-full h-[6px] rounded-[6px] bg-[rgba(255,255,255,0.1)]",children:(0,s.jsx)("div",{className:"absolute h-[6px] rounded-[6px]",style:{width:"".concat(v,"%"),backgroundImage:"linear-gradient(176.666deg, rgb(75, 152, 255) 0%, rgb(88, 89, 255) 99.612%)"}})}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-sm leading-[18px]",children:[(0,s.jsxs)("div",{className:"opacity-50 whitespace-nowrap text-white",children:[h("creditsUsed"),": ",a.toLocaleStr
1ing()]}),(0,s.jsxs)("div",{className:"text-right opacity-50 whitespace-nowrap text-white",children:[h("creditsTotal"),": ",t.toLocaleString()]})]})]}),(0,s.jsx)(c.R,{className:"w-full h-10",style:{backgroundImage:"url('/button-bg.png')",backgroundSize:"120% 100%",backgroundPosition:"center",backgroundRepeat:"no-repeat"},onClick:()=>{g.push("/pricing")},children:(0,s.jsxs)("span",{className:"relative z-10 flex items-center justify-center gap-2",children:[(0,s.jsx)(l.A,{className:"w-4 h-10 group-hover/btn:animate-pulse"}),h("upgrade")]})})]})})}},62188:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});var s=a(15395),l=a(1657),i=a(50395),r=a(23557),n=a(17537),o=a(59982),d=a(3e4);let c=n.forwardRef((e,t)=>{var{className:a,formatLabel:n}=e,c=(0,i._)(e,["className","formatLabel"]);let u=c.value||c.defaultValue;return(0,r.jsxs)(o.bL,(0,l._)((0,s._)({ref:t,className:(0,d.cn)("relative flex w-full touch-none select-none items-center","data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed",a)},c),{children:[(0,r.jsx)(o.CC,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary data-[disabled]:bg-muted",children:(0,r.jsx)(o.Q6,{className:"absolute h-full bg-primary data-[disabled]:bg-muted-foreground"})}),(0,r.jsx)(o.zi,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 relative group",children:n&&u&&(0,r.jsx)("div",{className:"absolute -top-9 left-1/2 -translate-x-1/2 bg-black text-white text-xs px-2 py-1 rounded shadow-md opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 group-active:opacity-100 pointer-events-none whitespace-nowrap after:content-[''] after:absolute after:top-full after:left-1/2 after:-translate-x-1/2 after:border-4 after:border-transparent after:border-t-black",children:n(u[0])})})]}))});c.displayName=o.bL.displayName},62625:(e,t,a)=>{"use strict";a.d(t,{q:()=>r});var s=a(23557),l=a(92085),i=a(15452);function r(e){let{title:t,titleInteractive:a=!1,onMenuClick:r,rightSlot:n,children:o,bottomBorder:d=!1}=e;return(0,s.jsxs)("div",{suppressHydrationWarning:!0,className:"md:hidden sticky top-0 z-20 shrink-0 bg-background dark:bg-[#0f0f0f] safe-top relative",children:[(0,s.jsx)("div",{suppressHydrationWarning:!0,className:"absolute left-0 right-0 top-0 h-[env(safe-area-inset-top)] bg-transparent dark:bg-black pointer-events-none -z-10","aria-hidden":!0}),(0,s.jsxs)("header",{className:"relative flex items-center justify-between px-3 py-2 h-[60px] ".concat(d?"border-b border-border":""),children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 min-w-0 shrink-0",children:[(0,s.jsx)("button",{type:"button",className:"shrink-0 p-1.5 -ml-1 rounded-md hover:bg-muted/80 transition-colors",onClick:r,"aria-label":"Menu",children:(0,s.jsx)(i.A,{className:"w-6 h-6 text-foreground"})}),(0,s.jsx)("div",{className:"flex items-center justify-center w-[60px] h-[60px] shrink-0 overflow-hidden",children:(0,s.jsx)(l.default,{src:"/images/logo.png",alt:"Seela",width:60,height:60,priority:!0,sizes:"60px",className:"object-contain dark:invert-0 invert",style:{objectFit:"contain"}})})]}),(0,s.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 flex items-center justify-center ".concat(a?"pointer-events-auto":"pointer-events-none"),children:(0,s.jsx)("span",{className:"text-sm font-bold text-foreground",children:t})}),(0,s.jsx)("div",{className:"flex items-center justify-end shrink-0 min-w-0",children:n})]}),o]})}},63246:(e,t,a)=>{"use strict";a.d(t,{Et:()=>u,d0:()=>c,jc:()=>d});var s=a(15395),l=a(50395),i=a(23557),r=a(17537),n=a(66261),o=a(3e4);let d=n.bL,c=n.l9,u=r.forwardRef((e,t)=>{var{className:a,align:r="center",sideOffset:d=4}=e,c=(0,l._)(e,["className","align","sideOffset"]);return(0,i.jsx)(n.ZL,{children:(0,i.jsx)(n.UC,(0,s._)({ref:t,align:r,sideOffset:d,className:(0,o.cn)("z-50 w-64 roun
1ded-2xl border bg-popover p-4 text-popover-foreground shadow-md outline-none 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 origin-[--radix-hover-card-content-transform-origin]",a)},c))})});u.displayName=n.UC.displayName},64195:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var s=a(23557),l=a(3e4);function i(e){let{children:t,className:a}=e;return(0,s.jsx)("p",{className:(0,l.cn)("text-white text-sm leading-6 text-center opacity-60 max-w-88 sm:max-w-[728px]",a),style:{fontFamily:"PingFang SC"},children:t})}},73424:(e,t,a)=>{"use strict";a.d(t,{M:()=>n});var s=a(23557),l=a(31543),i=a(84813),r=a(17537);function n(e){let{faq:t,index:a}=e,n=(0,r.useId)().replace(/:/g,""),o=(0,r.useRef)(null),[d,c]=(0,r.useState)({width:0,height:0}),[u,m]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e,t=()=>{if(o.current){let{offsetWidth:e,offsetHeight:t}=o.current;c({width:e,height:t})}},a=()=>{clearTimeout(e),e=setTimeout(t,150)};t();let s=o.current,l=()=>{var e;m(null!=(e=null==s?void 0:s.open)&&e),setTimeout(t,50)};return null==s||s.addEventListener("toggle",l),window.addEventListener("resize",a),()=>{null==s||s.removeEventListener("toggle",l),window.removeEventListener("resize",a),clearTimeout(e)}},[]);let{width:x,height:p}=d;return(0,s.jsxs)("details",{ref:o,className:"relative z-30 rounded-2xl border-[2px] bg-white/[0.08] border-white/[0.15] group transition-all duration-300 open:border-[#4b98ff] overflow-visible isolate",children:[x>0&&p>0&&(0,s.jsx)("div",{className:"absolute pointer-events-none opacity-0 group-open:opacity-100 transition-opacity duration-300 rounded-2xl",style:{left:-2,top:-2,right:-2,bottom:-2,mask:"\n              linear-gradient(#fff 0 0) content-box,\n              linear-gradient(#fff 0 0)\n            ",maskComposite:"exclude",WebkitMaskComposite:"xor",padding:2,boxSizing:"border-box",zIndex:10,overflow:"hidden"},children:(0,s.jsxs)("div",{className:"absolute",style:{left:"50%",top:"50%",width:2*Math.max(x,p),height:2*Math.max(x,p),marginLeft:-Math.max(x,p),marginTop:-Math.max(x,p),animation:"spin-faq-".concat(n," 3s linear infinite")},children:[(0,s.jsx)("div",{className:"absolute inset-0",style:{background:"conic-gradient(\n                  from 0deg at 50% 50%,\n                  #60a5fa 0deg,\n                  #60a5fa ".concat(60,"deg,\n                  transparent ").concat(60,"deg,\n                  transparent 360deg\n                )")}}),(0,s.jsx)("div",{className:"absolute inset-0",style:{background:"conic-gradient(\n                  from 0deg at 50% 50%,\n                  rgba(255,255,255,0) 0deg,\n                  rgba(255,255,255,1) ".concat(30,"deg,\n                  rgba(255,255,255,0) ").concat(60,"deg,\n                  transparent ").concat(60,"deg,\n                  transparent 360deg\n                )")}})]})}),(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:"\n        @keyframes spin-faq-".concat(n," {\n          from {\n            transform: rotate(0deg);\n          }\n          to {\n            transform: rotate(360deg);\n          }\n        }\n      ")}}),(0,s.jsxs)("summary",{className:"relative z-30 w-full flex justify-between items-center px-6 py-5 text-left cursor-pointer list-none bg-white/[0.08] backdrop-blur-sm rounded-t-2xl group-open:rounded-b-none rounded-b-2xl",children:[(0,s.jsx)("span",{className:"text-white text-base font-medium flex-1 font-inter relative z-10",children:t.question}),(0,s.jsxs)("div",{className:"relative z-10 size-5 flex-shrink-0 ml-4",children:[(0,s.jsx)(l.A,{className:"size-5 text-white absolute top-0 right-0 transition-all duration-300 group-open:rotate-90 group-open:opacity-0 group-open:scale-0"}),(0,s.jsx)(i.A,{className:"size-5 text-white absolute top-0 right-0 transition-all duration-300 opacity-0 scale-0 -rotate-90 group-open:opacity-100 group-open:scale-100 group-open:rotate-0"})]})]}),(0,s.jsx)("div",{className:"relative z-30 px-6 pb-6 bg-white/[0.08] backdrop-blur-sm rounded-b-2xl",children:(0,s.jsx)("p",{className:"text-white/50 text-sm leading-relaxed font-inter whitespace-pre-line relative z-10",children:t.answer})})]},a)}},76658:(e,t,a)=>{"use strict";a.r(t),a.d(t,{uploadAiFile:()=>l,uploadAudioFile:()=>i});var s=a(54836);async function l(e){let t=new FormData;t.append("file",e);let a=await s.apiClient.upload("/chat_api/v1/uploads/ai-upload",t);if(200===a.code&&a.data)return a.data;throw Error(a.msg||"Upload failed")}async function i(e,t){let a=new FormData;a.append("file",e);let l={};t&&(l.language=t);let i=await s.apiClient.upload("/chat_api/v1/uploads/upload-audio",a,{headers:l});if(200===i.code&&i.data)return i.data;throw Error(i.msg||"Upload failed")}},81757:(e,t,a)=>{"use strict";a.d(t,{l:()=>k});var s=a(23557),l=a(17537),i=a(57469),r=a(92421),n=a(3e4),o=a(76803),d=a(15395),c=a(1657),u=a(50395),m=a(28448),x=a(6856),p=a(32105),h=a(45753),g=a(23313),f=a(95712);function v(){let e=(0,m._)(["rtl:**:[.rdp-button_next>svg]:rotate-180"],["rtl:**:[.rdp-button\\_next>svg]:rotate-180"]);return v=function(){return e},e}function b(){let e=(0,m._)(["rtl:**:[.rdp-button_previous>svg]:rotate-180"],["rtl:**:[.rdp-button\\_previous>svg]:rotate-180"]);return b=function(){return e},e}function j(e){var{className:t,classNames:a,showOutsideDays:l=!0,captionLayout:i="label",buttonVariant:r="ghost",formatters:m,components:j}=e,w=(0,u._)(e,["className","classNames","showOutsideDays","captionLayout","buttonVariant","formatters","components"]);let N=(0,g.a)();return(0,s.jsx)(f.h,(0,d._)({showOutsideDays:l,className:(0,n.cn)("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw(v()),String.raw(b()),t),captionLayout:i,formatters:(0,d._)({formatMonthDropdown:e=>
1e.toLocaleString("default",{month:"short"})},m),classNames:(0,d._)({root:(0,n.cn)("w-fit",N.root),months:(0,n.cn)("relative flex flex-col gap-4 md:flex-row",N.months),month:(0,n.cn)("flex w-full flex-col gap-4",N.month),nav:(0,n.cn)("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",N.nav),button_previous:(0,n.cn)((0,o.r)({variant:r}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",N.button_previous),button_next:(0,n.cn)((0,o.r)({variant:r}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",N.button_next),month_caption:(0,n.cn)("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",N.month_caption),dropdowns:(0,n.cn)("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",N.dropdowns),dropdown_root:(0,n.cn)("has-focus:border-ring border-border shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-2xl border",N.dropdown_root),dropdown:(0,n.cn)("bg-popover absolute inset-0 opacity-0",N.dropdown),caption_label:(0,n.cn)("select-none font-medium","label"===i?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-2xl pl-2 pr-1 text-sm [&>svg]:size-3.5",N.caption_label),table:"w-full border-collapse",weekdays:(0,n.cn)("flex",N.weekdays),weekday:(0,n.cn)("text-muted-foreground flex-1 select-none rounded-2xl text-[0.8rem] font-normal",N.weekday),week:(0,n.cn)("mt-2 flex w-full",N.week),week_number_header:(0,n.cn)("w-[--cell-size] select-none",N.week_number_header),week_number:(0,n.cn)("text-muted-foreground select-none text-[0.8rem]",N.week_number),day:(0,n.cn)("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",N.day),range_start:(0,n.cn)("bg-accent rounded-l-md",N.range_start),range_middle:(0,n.cn)("rounded-none",N.range_middle),range_end:(0,n.cn)("bg-accent rounded-r-md",N.range_end),today:(0,n.cn)("bg-accent text-accent-foreground rounded-2xl data-[selected=true]:rounded-none",N.today),outside:(0,n.cn)("text-muted-foreground aria-selected:text-muted-foreground",N.outside),disabled:(0,n.cn)("text-muted-foreground opacity-50",N.disabled),hidden:(0,n.cn)("invisible",N.hidden)},a),components:(0,d._)({Root:e=>{var{className:t,rootRef:a}=e,l=(0,u._)(e,["className","rootRef"]);return(0,s.jsx)("div",(0,d._)({"data-slot":"calendar",ref:a,className:(0,n.cn)(t)},l))},Chevron:e=>{var{className:t,orientation:a}=e,l=(0,u._)(e,["className","orientation"]);return"left"===a?(0,s.jsx)(x.A,(0,d._)({className:(0,n.cn)("size-4",t)},l)):"right"===a?(0,s.jsx)(p.A,(0,d._)({className:(0,n.cn)("size-4",t)},l)):(0,s.jsx)(h.A,(0,d._)({className:(0,n.cn)("size-4",t)},l))},DayButton:y,WeekNumber:e=>{var{children:t}=e,a=(0,u._)(e,["children"]);return(0,s.jsx)("td",(0,c._)((0,d._)({},a),{children:(0,s.jsx)("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:t})}))}},j)},w))}function y(e){var{className:t,day:a,modifiers:i}=e,r=(0,u._)(e,["className","day","modifiers"]);let c=(0,g.a)(),m=l.useRef(null);return l.useEffect(()=>{var e;i.focused&&(null==(e=m.current)||e.focus())},[i.focused]),(0,s.jsx)(o.$,(0,d._)({ref:m,variant:"ghost",size:"icon","data-day":a.date.toLocaleDateString(),"data-selected-single":i.selected&&!i.range_start&&!i.range_end&&!i.range_middle,"data-range-start":i.range_start,"data-range-end":i.range_end,"data-range-middle":i.range_middle,className:(0,n.cn)("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-2xl data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-2xl group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",c.day,t)},r))}var w=a(82418),N=a(59923),C=a.n(N);function k(e){let{value:t,onChange:a,placeholder:d="选择日期",disabled:c,allowClear:u=!1,className:m,format:x="YYYY-MM-DD"}=e,[p,h]=l.useState(!1);return(0,s.jsxs)(w.AM,{open:p,onOpenChange:h,children:[(0,s.jsx)(w.Wv,{asChild:!0,children:(0,s.jsxs)(o.$,{variant:"outline",className:(0,n.cn)("w-36 justify-start text-left font-normal relative pr-8 h-8 group",!t&&"text-muted-foreground",m),children:[(0,s.jsx)("span",{className:"flex-1 truncate",children:t?C()(t).format(x):d}),(0,s.jsx)(i.A,{className:(0,n.cn)("absolute right-2 h-4 w-4 shrink-0 transition-opacity",u&&t&&"group-hover:opacity-0")}),u&&t&&(0,s.jsx)("div",{className:"absolute right-2 h-4 w-4 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",onClick:e=>{e.preventDefault(),e.stopPropagation(),null==a||a(void 0)},onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},children:(0,s.jsx)(r.A,{className:"h-3.5 w-3.5 text-muted-foreground hover:text-foreground cursor-pointer transition-colors"})})]})}),(0,s.jsx)(w.hl,{className:"w-auto p-0",align:"start",children:(0,s.jsx)(j,{mode:"single",selected:t,onSelect:e=>{null==a||a(e),h(!1)},disabled:c,autoFocus:!0,className:"[--cell-size:1.75rem]"})})]})}},83491:(e,t,a)=>{"use strict";a.d(t,{default:()=>o});var s=a(23557),l=a(17537),i=a(69143);
1let r=JSON.parse('{"v":"4.8.0","meta":{"g":"LottieFiles AE 3.1.1","a":"","k":"","d":"","tc":""},"fr":60,"ip":0,"op":179,"w":3500,"h":3500,"nm":"Loading Balls","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"ball-5","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.22,"y":1},"o":{"x":0.769,"y":0},"t":-180,"s":[2919,740,0],"to":[0,336.5,0],"ti":[0,0,0]},{"i":{"x":0.234,"y":1},"o":{"x":0.784,"y":0},"t":-90,"s":[2919,2759,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.22,"y":1},"o":{"x":0.333,"y":0},"t":0,"s":[2919,740,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.234,"y":1},"o":{"x":0.784,"y":0},"t":89,"s":[2919,2759,0],"to":[0,0,0],"ti":[0,336.5,0]},{"t":179,"s":[2919,740,0]}],"ix":2},"a":{"a":0,"k":[-118,-142,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[480,480],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.133333333333,0.133333333333,0.133333333333,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-118,-142],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":179,"st":-180,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"ball-4","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.22,"y":1},"o":{"x":0.769,"y":0}
vendor: 6,794 bytes, line 1
1,"t":-165,"s":[2335,740,0],"to":[0,336.5,0],"ti":[0,0,0]},{"i":{"x":0.234,"y":1},"o":{"x":0.784,"y":0},"t":-75,"s":[2335,2759,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.22,"y":1},"o":{"x":0.333,"y":0},"t":15,"s":[2335,740,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.234,"y":1},"o":{"x":0.784,"y":0},"t":105,"s":[2335,2759,0],"to":[0,0,0],"ti":[0,336.5,0]},{"t":195,"s":[2335,740,0]}],"ix":2},"a":{"a":0,"k":[-118,-142,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[480,480],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.133333333333,0.133333333333,0.133333333333,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-118,-142],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":179,"st":-165,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"ball-3","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.22,"y":1},"o":{"x":0.769,"y":0},"t":-150,"s":[1751,740,0],"to":[0,336.5,0],"ti":[0,0,0]},{"i":{"x":0.234,"y":1},"o":{"x":0.784,"y":0},"t":-60,"s":[1751,2759,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.22,"y":1},"o":{"x":0.333,"y":0},"t":30,"s":[1751,740,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.234,"y":1},"o":{"x":0.784,"y":0},"t":120,"s":[1751,2759,0],"to":[0,0,0],"ti":[0,336.5,0]},{"t":210,"s":[1751,740,0]}],"ix":2},"a":{"a":0,"k":[-118,-142,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[480,480],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.133333333333,0.133333333333,0.133333333333,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-118,-142],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":179,"st":-150,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"ball-2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.22,"y":1},"o":{"x":0.769,"y":0},"t":-135,"s":[1169,740,0],"to":[0,336.5,0],"ti":[0,0,0]},{"i":{"x":0.234,"y":1},"o":{"x":0.784,"y":0},"t":-45,"s":[1169,2759,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.22,"y":1},"o":{"x":0.333,"y":0},"t":45,"s":[1169,740,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.234,"y":1},"o":{"x":0.784,"y":0},"t":135,"s":[1169,2759,0],"to":[0,0,0],"ti":[0,336.5,0]},{"t":225,"s":[1169,740,0]}],"ix":2},"a":{"a":0,"k":[-118,-142,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[480,480],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.133333333333,0.133333333333,0.133333333333,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-118,-142],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":179,"st":-135,"bm":0},{"ddd":0,"ind":5,"ty":4,"nm":"ball-1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.22,"y":1},"o":{"x":0.769,"y":0},"t":-120,"s":[588,740,0],"to":[0,336.5,0],"ti":[0,0,0]},{"i":{"x":0.234,"y":1},"o":{"x":0.784,"y":0},"t":-30,"s":[588,2759,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.22,"y":1},"o":{"x":0.333,"y":0},"t":60,"s":[588,740,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.234,"y":1},"o":{"x":0.784,"y":0},"t":150,"s":[588,2759,0],"to":[0,0,0],"ti":[0,336.5,0]},{"t":240,"s":[588,740,0]}],"ix":2},"a":{"a":0,"k":[-118,-142,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-132.548,0],[0,-132.548],[132.548,0],[0,132.548]],"o":[[132.548,0],[0,132.548],[-132.548,0],[0,-132.548]],"v":[[0,-240],[240,0],[0,240],[-240,0]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.133333333333,0.133333333333,0.133333333333,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-118,-142],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":179,"st":-120,"bm":0}],"markers":[]}'),n=(0,i.default)(()=>Promise.all([a.e(1453),a.e(6152)]).then(a.t.bind(a,26152,23)).then(e=>e.default),{loadableGenerated:{webpack:()=>[26152]},ssr:!1}),o=e=>{let{message:t,fullscreen:a=!0}=e,[i,o]=l.useState(null);return l.useEffect(()=>{if(!r)return;let e=JSON.parse(JSON.stringify(r)),t=[1,1,1,1],a=e=>{if(!e)return;let a=e.k;if(Array.isArray(a)&&a.length>0&&"object"==typeof a[0]&&null!==a[0]&&Array.isArray(a[0].s))for(let e of a)Array.isArray(e.s)&&(e.s=t);else e.k=t},s=e=>{for(let t of e||[])"fl"===t.ty&&t.c&&a(t.c),"st"===t.ty&&t.c&&a(t.c),t.it&&s(t.it)};for(let t of e.layers||[])t.shapes&&s(t.shapes);o(e)},[r]),(0,s.jsx)("div",{className:a?"fixed inset-0 z-50 flex items-center justify-center":"absolute inset-0 z-50 flex items-center justify-center","aria-live":"polite",role:"status",children:(0,s.jsxs)("div",{className:"flex flex-col items-center",children:[(0,s.jsx)("div",{className:"relative",style:{width:88,height:88},children:(0,s.jsx)("div",{className:"absolute inset-2 rounded-full overflow-hidden flex items-center justify-center",children:(0,s.jsx)(n,{animationData:i,loop:!0,autoplay:!0,style:{width:"80%",height:"80%"}})})}),t?(0,s.jsx)("div",{className:"mt-2 text-xs text-muted-foreground tracking-wide text-center",children:t}):null]})})}}},e=>{e.O(0,[6116,3765,6055,7768,403,7799,9312,6905,7513,5070,431,7252,205,2872,6374,9654,9333,6843,7240,9982,5834,4836,4096,8956,4842,3481,4168,919,7358],()=>e(e.s=2428)),_N_E=e.O()}]);

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.