1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[94266],{38291:(e,t,a)=>{a.d(t,{E:()=>l});var r=a(95155);a(12115);var n=a(18460),i=a(91337);let s=(0,n.F)("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function l({className:e,variant:t,...a}){return(0,r.jsx)("div",{className:(0,i.cn)(s({variant:t}),e),...a})}},43447:(e,t,a)=>{a.d(t,{Hr:()=>p,Ht:()=>b,M5:()=>g,SQ:()=>x,_2:()=>v,lp:()=>w,lv:()=>f,mB:()=>j,nV:()=>h,rI:()=>c,ty:()=>m});var r=a(95155),n=a(12115),i=a(61108),s=a(21362),l=a(94514),o=a(16950),d=a(1832),u=a(91337);let c=i.bL,m=i.l9;i.YJ,i.ZL;let f=i.Pb,p=i.z6,h=n.forwardRef(({className:e,inset:t,children:a,...n},l)=>(0,r.jsxs)(i.ZP,{ref:l,className:(0,u.cn)("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...n,children:[a,(0,r.jsx)(s.A,{className:"ml-auto h-4 w-4"})]}));h.displayName=i.ZP.displayName;let g=n.forwardRef(({className:e,...t},a)=>(0,r.jsx)(i.G5,{ref:a,className:(0,u.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",e),...t}));g.displayName=i.G5.displayName;let x=n.forwardRef(({className:e,sideOffset:t=4,...a},n)=>{let s=(0,d.O)();return(0,r.jsx)(i.ZL,{children:(0,r.jsx)(i.UC,{ref:n,sideOffset:t,className:(0,u.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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",s&&"dashboard-radius-portal",e),...a})})});x.displayName=i.UC.displayName;let v=n.forwardRef(({className:e,inset:t,...a},n)=>(0,r.jsx)(i.q7,{ref:n,className:(0,u.cn)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...a}));v.displayName=i.q7.displayName,n.forwardRef(({className:e,children:t,checked:a,...n},s)=>(0,r.jsxs)(i.H_,{ref:s,className:(0,u.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...n,children:[(0,r.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(i.VF,{children:(0,r.jsx)(l.A,{className:"h-4 w-4"})})}),t]})).displayName=i.H_.displayName;let b=n.forwardRef(({className:e,children:t,indicatorPosition:a="left",...n},s)=>(0,r.jsxs)(i.hN,{ref:s,className:(0,u.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50","right"===a?"pl-2 pr-8":"pl-8 pr-2",e),...n,children:[(0,r.jsx)("span",{className:(0,u.cn)("absolute flex h-3.5 w-3.5 items-center justify-center","right"===a?"right-2":"left-2"),children:(0,r.jsx)(i.VF,{children:"right"===a?(0,r.jsx)(l.A,{className:"h-4 w-4"}):(0,r.jsx)(o.A,{className:"h-2 w-2 fill-current"})})}),t]}));b.displayName=i.hN.displayName;let w=n.forwardRef(({className:e,inset:t,...a},n)=>(0,r.jsx)(i.JU,{ref:n,className:(0,u.cn)("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));w.displayName=i.JU.displayName;let j=n.forwardRef(({className:e,...t},a)=>(0,r.jsx)(i.wv,{ref:a,className:(0,u.cn)("-mx-1 my-1 h-px bg-muted",e),...t}));j.displayName=i.wv.displayName},53318:(e,t,a)=>{a.d(t,{$:()=>d,L:()=>u});var r=a(95155);a(12115);var n=a(68822),i=a(79792),s=a(91459),l=a(91337),o=a(62909);function d({className:e,...t}){return(0,r.jsx)(i.J,{className:(0,l.cn)("min-w-0 text-sm font-medium",e),...t})}function u({name:e,label:t,children:a,htmlFor:i,required:c=!1,requiredLabel:m="required",hint:f,hintLabel:p="Parameter info",error:h,description:g,counter:x,headerEnd:v,disabled:b=!1,className:w,labelClassName:j,contentClassName:N}){let y=e.replace(/[^a-zA-Z0-9_-]+/g,"-"),_=`${y}-label`,U=`${y}-error`,C=`${y}
1-description`,S=[h?U:null,g?C:null].filter(Boolean).join(" ")||void 0,R=!!x&&x.current>x.max;return(0,r.jsxs)("div",{"data-tool-field":e,"data-invalid":h?"true":void 0,className:(0,l.cn)("space-y-2",b&&"opacity-60",w),children:[(0,r.jsxs)("div",{className:o.m.fieldHeader,children:[(0,r.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-1",children:[(0,r.jsxs)(d,{id:_,htmlFor:i,className:j,children:[t,c?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"ml-1 text-red-500",children:"*"}),(0,r.jsxs)("span",{className:"sr-only",children:[" (",m,")"]})]}):null]}),f?(0,r.jsx)(s.Bc,{delayDuration:150,children:(0,r.jsxs)(s.m_,{children:[(0,r.jsx)(s.k$,{asChild:!0,children:(0,r.jsx)("button",{type:"button","aria-label":p,className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",children:(0,r.jsx)(n.A,{className:"h-4 w-4","aria-hidden":"true"})})}),(0,r.jsx)(s.ZI,{side:"right",className:"max-w-sm text-sm leading-5",children:f})]})}):null,h?(0,r.jsx)("span",{id:U,role:"alert",className:o.m.fieldError,children:h}):null]}),v||x?(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[v,x?(0,r.jsxs)("span",{className:R?o.m.fieldCounterError:o.m.fieldCounter,children:[x.current,"/",x.max]}):null]}):null]}),null!=a?(0,r.jsx)("div",{className:N,role:i?void 0:"group","aria-labelledby":i?void 0:_,"aria-describedby":S,"aria-invalid":!!h||void 0,children:a}):null,g?(0,r.jsx)("p",{id:C,className:"text-xs leading-5 text-muted-foreground",children:g}):null]})}},55433:(e,t,a)=>{a.d(t,{M:()=>r});function r(e,t){if(!e||"object"!=typeof e)return null;for(let a of t){let t=function(e,t){if(null==e)return null;if("string"!=typeof e)return`${t.field} must be a string`;let a=e.length;return void 0!==t.min&&a>0&&a<t.min?`${t.field} must be ${t.min}-${t.max} characters`:a>t.max?`${t.field} must be ${t.max} characters or less`:null}(e[a.field],a);if(t)return t}return null}},59838:(e,t,a)=>{a.d(t,{KI:()=>u,KW:()=>o,O5:()=>i,Pt:()=>v,Pz:()=>m,T0:()=>b,Vs:()=>p,X6:()=>s,Y3:()=>d,bi:()=>c,r2:()=>f});var r=a(66);function n(e,t=0){let a="number"==typeof e?e:"string"==typeof e&&""!==e.trim()?Number(e):NaN;return Number.isFinite(a)?a:t}function i(e){let t=Math.max(0,n(e,0));return Number.isInteger(t)?String(t):t.toFixed(2).replace(/\.?0+$/,"")}function s(e,t){return n(e,0)*n(t,0)}function l(e){return Math.round(1e6*n(e,0))}function o(e,t){return l(e)*l(t)/1e12}function d(e,t){return Math.ceil(o(e,t))}function u(e,t){return Math.ceil(n(e,0)/60)*n(t,0)}function c(e,t){return n(e,1)*n(t,0)}function m(e,t,a){return n(t[String(e??"").trim().toUpperCase()],a)}function f({width:e,height:t,duration:a,fps:r,scale:i,creditsPerOutputMegapixel:s}){let l=n(i,2),o=Math.ceil(n(a,5)*n(r,24));return n(e,1280)*n(t,720)*o*l*l/1e6*n(s,.1)}function p(e,t={}){let a=t.file;return a&&(0,r.E)(a)?Promise.resolve({width:a.width,height:a.height,duration:a.duration,fps:a.fps}):"u"<typeof document?Promise.resolve({}):new Promise(r=>{let n=document.createElement("video");n.preload="metadata",n.muted=!0,n.onloadedmetadata=async()=>{let i={width:n.videoWidth||void 0,height:n.videoHeight||void 0,duration:Number.isFinite(n.duration)?n.duration:void 0};n.removeAttribute("src"),n.load();let s=t.includeFps?await h(e,a):void 0;r({...i,fps:s})},n.onerror=()=>r({}),n.src=e})}async function h(e,t){if(t)try{return g(await t.arrayBuffer())}catch{return}if("u">typeof fetch)try{let t=await fetch(e);if(!t.ok)return;let a=Number(t.headers.get("content-length"));if(Number.isFinite(a)&&a>0x7800000)return;return g(await t.arrayBuffer())}catch{return}}function g(e){let t=new DataView(e),a=[],r=null,n=(e,i)=>{let s=e;for(;s+8<=i;){var l,o,d;let e=t.getUint32(s),u=x(t,s+4),c=8,m=e;if(1===e){if(s+16>i)break;l=t,o=s+8,m=0x100000000*l.getUint32(o)+l.getUint32(o+4),c=16}else 0===e&&(m=i-s);if(m<c||s+m>i)break;let f=s+c,p=s+m;if("trak"===u){let e=r,t={};r=t,n(f,p),a.push(t),r=e}else{(function(e,t,a,r,n){if(n){if("hdlr"===e&&a+12<=r){n.isVideo="vide"===x(t,a+8);return}if("mdhd"===e&&a+24<=r){let e=1===t.getUint8(a)?a+20:a+12;e+4<=r&&(n.timescale=t.getUint32(e));return}if("stts"===e&&a+8<=r){let e=a+4,i=t.getUint32(e);e+=4;let s=0,l=0;for(let a=0;a<i&&e+8<=r;a+=1){let a=t.getUint32(e),r=t.getUint32(e+4);s+=a,l+=a*r,e+=8}n.sampleCount=s,n.sampleDurationUnits=l}}})(u,t,f,p,r),("moov"===(d=u)||"mdia"===d||"minf"===d||"stbl"===d)&&n(f,p)}s=p}};for(let e of(n(0,t.byteLength),a)){if(!e.isVideo||!e.timescale||!e.sampleC
1ount||!e.sampleDurationUnits)continue;let t=e.sampleDurationUnits/e.timescale,a=e.sampleCount/t;if(Number.isFinite(a)&&a>0)return a}}function x(e,t){return String.fromCharCode(e.getUint8(t),e.getUint8(t+1),e.getUint8(t+2),e.getUint8(t+3))}function v(e){return"u"<typeof document?Promise.resolve(void 0):new Promise(t=>{let a=document.createElement("audio");a.preload="metadata",a.onloadedmetadata=()=>{t(Number.isFinite(a.duration)?a.duration:void 0),a.src=""},a.onerror=()=>t(void 0),a.src=e})}function b(e,t){return t?.startsWith("audio/")?v(e):p(e).then(e=>e.duration)}},70589:(e,t,a)=>{a.d(t,{s:()=>u});var r=a(95155),n=a(12115),i=a(53318),s=a(26518),l=a(94791),o=a(91337);function d(e){return"string"==typeof e?{value:e,label:e,disabled:!1}:{value:e.value,label:e.label??e.value,disabled:e.disabled??!1}}function u({label:e="Model",value:t,options:a,onValueChange:c,disabled:m,placeholder:f="Select model",className:p,triggerClassName:h}){let g=n.useId(),x=`tool-model-${g.replace(/[^a-zA-Z0-9_-]+/g,"-")}`;if((0,l.Cy)())return null;let v=(a?.length?a:[t]).map(d),b=m??(!c||v.length<=1),w=v.find(e=>e.value===t)?.label;return(0,r.jsx)(i.L,{name:`${x}-field`,label:e,htmlFor:x,disabled:b,className:p,children:(0,r.jsxs)(s.l6,{value:t,onValueChange:e=>c?.(e),disabled:b,children:[(0,r.jsx)(s.bq,{id:x,className:(0,o.cn)(b&&"cursor-not-allowed bg-muted",h),children:(0,r.jsx)(s.yv,{placeholder:f,children:w})}),(0,r.jsx)(s.gC,{children:v.map(e=>(0,r.jsx)(s.eb,{value:e.value,disabled:e.disabled,children:e.label},e.value))})]})})}},73819:(e,t,a)=>{a.r(t),a.d(t,{default:()=>O});var r=a(95155),n=a(14973),i=a(76684),s=a(83414),l=a(62909),o=a(55433),d=a(59838),u=a(53318),c=a(70589),m=a(12115),f=a(6296),p=a(6962),h=a(5872),g=a(50910),x=a(66609),v=a(81491),b=a(4474),w=a(79984),j=a(74350),N=a(39658),y=a(26518),_=a(39540),U=a(14851),C=a(31691);let S={async submit(e){let t=await C.apiService.post("/api/generate/submit",e,U.U.appName);if(200!==t.code&&0!==t.code)throw Error(t.message||`API request failed with code ${t.code}`);return t},async checkStatus(e){let t=await C.apiService.get(`/api/generate/status/${e}`,U.U.appName);if(200!==t.code&&0!==t.code)throw Error(t.message||`Failed to check task status: ${t.code}`);return t}};var R=a(55236);let k=["image/jpeg","image/png","image/webp"],L={"wan2.5-image-to-video":{prompt:"A figure skater performing in a surreal underground cavern with bioluminescent water",duration:5,imageResolution:"720p",startImageUrl:"https://cdn.doculator.org/wan-2-5/start-image.png",exampleTaskId:"poyo-example",exampleCreatedTime:"Poyo official example",outputUrl:"https://cdn.doculator.org/wan-2-5/example-output-image-to-video.mp4"},"wan2.5-text-to-video":{prompt:"70s broadcast news announcing that Wan 2.5 is now on PoYo.ai, as seen through a 70s TV set in a cosy 70s living room",duration:10,textAspectRatio:"1280*720",exampleTaskId:"637N32NYKYOIGDMT",exampleCreatedTime:"2026-03-11T04:43:25",outputUrl:"https://storage.poyo.ai/wan-2-5/example-output-text-to-video.mp4"}},$=e=>({task_id:L[e].exampleTaskId,status:"finished",created_time:L[e].exampleCreatedTime,files:[{file_url:L[e].outputUrl,file_type:"video"}]}),F={"832*480":{5:30,10:60},"480*832":{5:30,10:60},"1280*720":{5:60,10:120},"720*1280":{5:60,10:120},"1920*1080":{5:90,10:180},"1080*1920":{5:90,10:180}},I={"480p":{5:30,10:60},"720p":{5:60,10:120},"1080p":{5:90,10:180}},O=({selectedModel:e})=>{let t=(0,g.c)("modelDetail.model"),a=(0,g.c)("Global.Common"),[O,E]=(0,m.useState)(!1),[P,A]=(0,m.useState)(!1),[M,V]=(0,m.useState)(!1),[z,D]=(0,m.useState)("form"),[T,q]=(0,m.useState)("preview"),[B,H]=(0,m.useState)(L[e].prompt),[J,W]=(0,m.useState)(L[e].duration),[Z,G]=(0,m.useState)("832*480"),[Y,K]=(0,m.useState)("720p"),[Q,X]=(0,m.useState)(""),[ee,et]=(0,m.useState)(""),[ea,er]=(0,m.useState)(""),[en,ei]=(0,m.useState)(L[e].startImageUrl?{url:L[e].startImageUrl}:null),[es,el]=(0,m.useState)(""),[eo,ed]=(0,m.useState)(!1),[eu,ec]=(0,m.useState)(!1),[em,ef]=(0,m.useState)(!1),[ep,eh]=(0,m.useState)(null),[eg,ex]=(0,m.useState)(null),[ev,eb]=(0,m.useState)(null),ew=(0,m.useRef)(null),ej=(0,n.n)(()=>{ei(null),el("")}
1),eN="wan2.5-image-to-video"===e;(0,m.useEffect)(()=>{V(C.apiService.isLoggedInToApp(U.U.appName))},[]),(0,m.useEffect)(()=>{let t=L[e];H(t.prompt),W(t.duration),G(t.textAspectRatio||"832*480"),K(t.imageResolution||"720p"),X(""),et(""),er(""),en?.url.startsWith("blob:")&&URL.revokeObjectURL(en.url),ei(t.startImageUrl?{url:t.startImageUrl}:null),ex(null),eh(null)},[e]),(0,m.useEffect)(()=>{if("json"!==z)return;let t={prompt:B,duration:J,...Q.trim()?{audio:Q.trim()}:{},...ee.trim()?{negative_prompt:ee.trim()}:{},...ea.trim()?{seed:Number(ea)}:{}};eN?(t.image_urls=[en?.url||"[uploaded_start_image_url]"],t.resolution=Y):t.aspect_ratio=Z,el(JSON.stringify({model:e,input:t},null,2))},[Q,z,J,Y,eN,ee,B,ea,e,en,Z]),(0,m.useEffect)(()=>()=>{ew.current&&clearInterval(ew.current),en?.url.startsWith("blob:")&&URL.revokeObjectURL(en.url)},[en]);let ey=(e,t)=>{console.error(e),x.oR.error(e instanceof Error?e.message:t),ec(!1),ed(!1),ef(!1)},e_=async e=>{let t=async()=>{try{let t=await S.checkStatus(e);if(!t.data)return;ex(t.data),("finished"===t.data.status||"failed"===t.data.status)&&(ew.current&&clearInterval(ew.current),ew.current=null,ef(!1),"finished"===t.data.status?x.oR.success("Video generated successfully!"):x.oR.error(t.data.error_message||"Video generation failed"))}catch(e){console.error(e)}};await t(),ew.current=setInterval(t,1e4)},eU=async()=>{let t;if(!ej.busy){if(!M)return void E(!0);if(!eu){try{if("json"===z){let e=JSON.parse(es);if(!e?.input?.prompt?.trim())throw Error("prompt is required");let a=(0,o.M)(e.input,[{field:"prompt",max:1500}]);if(a)throw Error(a);if("wan2.5-image-to-video"!==e.model&&"wan2.5-text-to-video"!==e.model)throw Error("model must be wan2.5-image-to-video or wan2.5-text-to-video");if("wan2.5-image-to-video"===e.model&&(!Array.isArray(e?.input?.image_urls)||1!==e.input.image_urls.length))throw Error("image_urls must contain exactly 1 image");t=e}else{let a;if(!B.trim())return void x.oR.error("Please enter a prompt");let r=(0,o.M)({prompt:B},[{field:"prompt",max:1500}]);if(r)return void x.oR.error(r);if(eN&&!en)return void x.oR.error("Please upload a start image");eN&&(ed(!0),a=en?.file?(await (0,R.f)(en.file,`wan-2-5-start-${Date.now()}-${en.file.name}`)).url:en?.url),t={model:e,input:{prompt:B.trim(),duration:J,...eN?{image_urls:[a],resolution:Y}:{aspect_ratio:Z},...Q.trim()?{audio:Q.trim()}:{},...ee.trim()?{negative_prompt:ee.trim()}:{},...ea.trim()?{seed:Number(ea)}:{}}}}}catch(e){ey(e,"Invalid configuration");return}try{let e,a="json"===z?(e=Number(t?.input?.duration||5),"wan2.5-image-to-video"===t.model?I[String(t?.input?.resolution||"720p").toLowerCase()][e]:F[String(t?.input?.aspect_ratio||"832*480")][e]):eN?I[Y][J]:F[Z][J];if((await C.apiService.getUserInfo(U.U.appName)).data.credits_amount<a)return void A(!0);ec(!0),ef(!0),ex(null),eh(null);let r=await S.submit(t);if(!r.data?.task_id)throw Error("Failed to generate video");eh(r.data.task_id),x.oR.success("Video generation started!"),await e_(r.data.task_id)}catch(e){ey(e,"Failed to generate video")}finally{ec(!1),ed(!1)}}}},eC=async(e,t,a)=>{try{eb(a);let r=await fetch(`/api/download?url=${encodeURIComponent(e)}`);
1if(!r.ok)throw Error("Download failed");let n=await r.blob(),i=URL.createObjectURL(n),s=document.createElement("a");s.href=i,s.download=`wan-2-5_${t}_${a}.mp4`,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i),x.oR.success("Video downloaded successfully!")}catch(e){console.error(e),x.oR.error("Failed to download video")}finally{eb(null)}},eS="json"===z?(()=>{try{let e=JSON.parse(es),t=Number(e?.input?.duration||5);if("wan2.5-image-to-video"===e.model)return I[String(e?.input?.resolution||"720p").toLowerCase()][t];return F[String(e?.input?.aspect_ratio||"832*480")][t]}catch{return eN?I[Y][J]:F[Z][J]}})():eN?I[Y][J]:F[Z][J];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(v.default,{app_name:U.U.appName,open:O,onOpenChange:E,onLoginSuccess:()=>{E(!1),window.location.reload()}}),(0,r.jsx)(j.lG,{open:P,onOpenChange:A,children:(0,r.jsx)(j.Cf,{className:"sm:max-w-[425px]",children:(0,r.jsxs)("div",{className:"space-y-4 py-4",children:[(0,r.jsxs)("div",{className:"space-y-2 text-center",children:[(0,r.jsx)(h.A,{className:"mx-auto h-12 w-12 text-orange-500"}),(0,r.jsx)("h3",{className:"text-lg font-semibold",children:"Insufficient Credits"})]}),(0,r.jsxs)("div",{className:"flex gap-3",children:[(0,r.jsx)(b.$,{variant:"outline",className:"flex-1",onClick:()=>A(!1),children:a("buttons.cancel")}),(0,r.jsx)(b.$,{className:"flex-1",onClick:()=>window.open("/dashboard/billing","_blank"),children:"Recharge Now"})]})]})})}),(0,r.jsx)("div",{className:"container mx-auto max-w-7xl px-3 py-4 sm:px-4 sm:py-8",children:(0,r.jsxs)("div",{className:l.m.shell,children:[(0,r.jsx)(w.Zp,{className:l.m.panel,children:(0,r.jsx)(w.Wu,{className:l.m.content,children:(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:l.m.header,children:[(0,r.jsx)("div",{className:"text-lg font-semibold",children:"Input"}),(0,r.jsxs)("div",{className:l.m.segmented,children:[(0,r.jsx)(b.$,{size:"sm",variant:"form"===z?"default":"ghost",onClick:()=>D("form"),className:"h-8",children:"Form"}),(0,r.jsx)(b.$,{size:"sm",variant:"json"===z?"default":"ghost",onClick:()=>D("json"),className:"h-8",children:"JSON"})]})]}),"json"===z?(0,r.jsx)(u.L,{name:"wan-2-5-json",label:"JSON Configuration",htmlFor:"wan-2-5-json",children:(0,r.jsx)(_.T,{id:"wan-2-5-json",value:es,onChange:e=>el(e.target.value),className:"min-h-[420px] font-mono text-sm"})}):(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)(c.s,{label:t("model"),value:e}),(0,r.jsx)(u.L,{name:"wan-2-5-prompt",label:t("prompt"),htmlFor:"wan-2-5-prompt",required:!0,counter:{current:B.length,max:1500},children:(0,r.jsx)(_.T,{id:"wan-2-5-prompt",value:B,onChange:e=>H(e.target.value),maxLength:1500,className:"min-h-[120px] resize-y"})}),eN?(0,r.jsx)(n.H,{id:"wan-2-5-image",label:"Image Urls",kind:"image",value:en?[en]:[],onChange:e=>ei(e[0]||null),accept:k.join(","),maxBytes:0xa00000,disabled:eu||ej.isOtherBusy("wan-2-5-image"),onBusyChange:e=>ej.onBusyChange("wan-2-5-image",e),required:!0},"wan-2-5-image:"+e+":"+ej.revision):(0,r.jsx)(u.L,{name:"wan-2-5-aspect-ratio",label:t("aspectRatio"),htmlFor:"wan-2-5-aspect-ratio",required:!0,children:(0,r.jsxs)(y.l6,{value:Z,onValueChange:e=>G(e),children:[(0,r.jsx)(y.bq,{id:"wan-2-5-aspect-ratio",children:(0,r.jsx)(y.yv,{})}),(0,r.jsxs)(y.gC,{children:[(0,r.jsx)(y.eb,{value:"832*480",children:"16:9 (832*480)"}),(0,r.jsx)(y.eb,{value:"480*832",children:"9:16 (480*832)"}),(0,r.jsx)(y.eb,{value:"1280*720",children:"16:9 HD (1280*720)"}),(0,r.jsx)(y.eb,{value:"720*1280",children:"9:16 HD (720*1280)"}),(0,r.jsx)(y.eb,{value:"1920*1080",children:"16:9 Full HD (1920*1080)"}),(0,r.jsx)(y.eb,{value:"1080*1920",children:"9:16 Full HD (1080*1920)"})]})]})}),(0,r.jsx)(u.L,{name:"wan-2-5-duration",label:t("duration"),required:!0,children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(b.$,{type:"button",variant:5===J?"default":"outline",className:"flex-1",onClick:()=>W(5),children:"5s"}),(0,r.jsx)(b.$,{type:"button",variant:10===J?"default":"outline",className:"flex-1",onClick:()=>W(10),children:"10s"})]})}),eN&&(0,r.jsx)(u.L,{name:"wan-2-5-resolution",label:t("resolution"),htmlFor:"wan-2-5-resolution",required:!0,children:(0,r.jsxs)(y.l6,{value:Y,onValueChange:e=>K(e),children:[(0,r.jsx)(y.bq,{id:"wan-2-5-resolution",children:(0,r.jsx)(y.yv,{})}),(0,r.jsxs)(y.gC,{children:[(0,r.jsx)(y.eb,{value:"480p",children:"480p"}),(0,r.jsx)(y.eb,{value:"720p",children:"720p"}),(0,r.jsx)(y.eb,{value:"1080p",children:"1080p"})]})]})}),(0,r.jsx)(u.L,{name:"wan-2-5-audio",label:"Audio",htmlFor:"wan-2-5-audio",children:(0,r.jsx)(N.p,{id:"wan-2-5-audio",value:Q,onChange:e=>X(e.target.value),placeholder:"Optional string passed to audio"})}),(0,r.jsx)(u.L,{name:"wan-2-5-negative-prompt",label:"Negative Prompt",htmlFor:"wan-2-5-negative-prompt",children:(0,r.jsx)(_.T,{id:"wan-2-5-negative-prompt",value:ee,onChange:e=>et(e.target.value),className:"min-h-[90px] resize-y"})}),(0,r.jsx)(u.L,{name:"wan-2-5-seed",label:"Seed",htmlFor:"wan-2-5-seed",children:(0,r.jsx)(N.p,{id:"wan-2-5-seed",value:ea,onChange:e=>er(e.target.value),placeholder:"Optional integer seed"})})]}),(0,r.jsx)(i.Bn,{estimatedCredits:(0,d.O5)(eS),onReset:()=>{ej.cancelPending(),D("form"),en?.url.startsWith("blob:")&&URL.revokeObjectURL(en.url),H(L[e].prompt),W(L[e].duration),G("832*480"),K("720p"),X(""),et(""),er(""),ei(L[e].startImageUrl?{url:L[e].startImageUrl}:null),el("")},onRun:eU,disabled:ej.busy||eu||eo,resetDisabled:ej.busy||eo||eu||em,loading:eo||eu||em,loadingText:eo?"Uploading...":eu?"Submitting...":"Processing..."})]})})}),(0,r.jsx)(w.Zp,{className:l.m.panel,children:(0,r.jsx)(w.Wu,{className:l.m.content,children:(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:l.m.header,children:[(0,r.jsx)("div",{className:"text-lg font-semibold",children:"Output"}),(0,r.jsxs)("div",{className:l.m.segmented,children:[(0,r.jsx)(b.$,{size:"sm",variant:"preview"===T?"default":"ghost",onClick:()=>q("preview"),className:"h-8",children:"Preview"}),(0,r.jsx)(b.$,{size:"sm",variant:"json"===T?"default":"ghost",onClick:()=>q("json"),className:"h-8",children:"JSON"})]})]}),(()=>{if("json"===T)return(0,r.jsx)(_.T,{value:JSON.stringify(eg||$(e),null,2),readOnly:!0,className:"min-h-[500px] bg-muted font-mono text-sm"});let t=eg||(em?null:$(e));return em&&(!t||"not_started"===t.status||"running"===t.status)?(0,r.jsx)(s.EV,{active:em,taskId:t?.task_id||ep}):t?(0,r.jsxs)("div",{className:"space-y-4",children:[!eg&&!ep&&(0,r.jsx)(s.G1,{mediaLabel:"video"}),(0,r.jsx)(s.BP,{data:t}),(0,r.jsx)(s.V6,{message:t?.error_message}),t?.files?.filter(e=>"video"===e.file_type).map((e,a)=>(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("video",{src:e.f
1ile_url,controls:!0,className:"w-full rounded-lg bg-black"}),(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsx)(b.$,{variant:"outline",size:"sm",disabled:ev===a,onClick:()=>eC(e.file_url,t.task_id,a),children:ev===a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(f.A,{className:"mr-2 h-4 w-4 animate-spin"}),"Downloading..."]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.A,{className:"mr-2 h-4 w-4"}),"Download"]})})})]},e.file_url))]}):(0,r.jsxs)("div",{className:"flex aspect-video flex-col items-center justify-center rounded-lg border-2 border-dashed border-muted-foreground/20 bg-muted/30 text-center",children:[(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"No data yet"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"Generated video will appear here"})]})})()]})})})]})})]})}},78152:(e,t,a)=>{a.d(t,{CG:()=>i,F7:()=>n,Lv:()=>s});let r={enableUtm:!0,enableReferrer:!0};function n(e){return e?e.source:function(e={}){let t,a,n={...r,...e};if(n.enableUtm){let e,t,a,r,n=(t=(e=new URLSearchParams(window.location.search)).get("utm_source"),a=e.get("utm_medium"),r=e.get("utm_campaign"),t?{source:t,utmSource:t,utmMedium:a||void 0,utmCampaign:r||void 0,detectionMethod:"utm"}:null);if(n)return n}let i=(a=(t=new URLSearchParams(window.location.search)).get("source")||t.get("ref"))?{source:a,detectionMethod:"query_param"}:null;if(i)return i;if(n.enableReferrer){let e=function(e){if("u"<typeof document||!document.referrer)return null;let t=document.referrer,a=new URL(t).hostname;if(e){for(let[r,n]of Object.entries(e))if(a.includes(r.toLowerCase()))return{source:n,rawReferrer:t,detectionMethod:"referrer"}}return a===window.location.hostname?null:{source:a,rawReferrer:t,detectionMethod:"referrer"}}(n.customDomainMapping);if(e)return e}return{source:"direct_visit",detectionMethod:"default"}}().source}function i(){try{if(document.referrer){let e=new URL(document.referrer);if(e.hostname===window.location.hostname)return`${e.pathname}${e.search}`}return`${window.location.pathname}${window.location.search}`}catch(e){console.error("Error detecting internal source:",e);return}}function s(){let e=new URLSearchParams(window.location.search);return{utm_source:e.get("utm_source")||void 0,utm_medium:e.get("utm_medium")||void 0,utm_campaign:e.get("utm_campaign")||void 0,registration_page:window.location.pathname}}}}]);
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.