PageSourceSearch

https://www.myria.pro/_next/static/chunks/44984.63500ff6dcb766bf.js

js myria.pro collected 2026-10-02 02:08:18 UTC 59,870 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="741a2882-245b-4ce8-9449-ff6f1aa8f2c1",e._sentryDebugIdIdentifier="sentry-dbid-741a2882-245b-4ce8-9449-ff6f1aa8f2c1")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44984],{44984:(e,t,i)=>{i.r(t),i.d(t,{VideofyPanel:()=>eo});var s=i(73365),r=i(1521),o=i(10738),n=i(80298),a=i(88248),l=i(83892);function d(e,t){return"".concat("myria:wow:lastShown:").concat(e||"anon",":").concat(t)}function c(e,t){try{let i=window.localStorage.getItem(d(e,t));if(!i)return!0;let s=Number(i);if(!Number.isFinite(s))return!0;return Date.now()-s>864e5}catch(e){return!0}}function u(e,t){try{window.localStorage.setItem(d(e,t),String(Date.now()))}catch(e){}}var m=i(8649),h=i(72841),x=i(33612),f=i(90614),v=i(84689),b=i(52272);let g={version:1,overrides:{}};async function p(){try{let e=await fetch("".concat("https://api.myria.pro","/api/config/video-modes"),{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)return b.Lu;let t=await e.json();if(!(null==t?void 0:t.config)||"object"!=typeof t.config||!t.config.overrides)return b.Lu;return t.config}catch(e){return b.Lu}}let w=new Set(i(97661).F5),j={config:g,availableModeModelIds:[]};async function y(){try{let e=await fetch("".concat("https://api.myria.pro","/api/config/video-models"),{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)return j;let t=await e.json();if(!(null==t?void 0:t.config)||"object"!=typeof t.config||!t.config.overrides)return j;let i=function(e){if(!Array.isArray(e))return null;let t=new Set,i=[];for(let s of e)"string"==typeof s&&w.has(s)&&(t.has(s)||(t.add(s),i.push(s)));return i}(t.availableModeModelIds);if(!i)return j;return{config:t.config,availableModeModelIds:i}}catch(e){return j}}var N=i(36184),k=i(84131),M=i(3162);function C(e){let{model:t,modelConfig:i,duration:s,resolution:r,generateAudio:o,useNextFrameAsEnding:n,mode:a,selectionOrigin:l,dialogMode:d,customDirective:c,negativePrompt:u,cameraMotion:m,pacing:h,motionRefRevisionIds:x,triggerSource:f}=e,v=function(e,t,i){let s=e.trim(),r=[];return("none"!==t&&r.push("Camera: ".concat(t,".")),"none"!==i&&r.push("Pacing: ".concat(i,".")),0===r.length)?s:s?"".concat(r.join(" ")," ").concat(s):r.join(" ")}(c,m,h);return{model:t,durationSeconds:s,generateAudio:!!i.hasNativeAudio||!!i.supportsAudio&&o,useNextFrameAsEnding:!!i.supportsEndFrame&&n,mode:a,selectionOrigin:l,dialogMode:i.supportsDialogMode?d:void 0,customDirective:i.supportsCustomDirective&&v||void 0,negativePrompt:i.supportsNegativePrompt&&u.trim()||void 0,resolution:r,motionRefRevisionIds:(null==x?void 0:x.length)?x:void 0,triggerSource:f}}let A={flexible:{titleKey:"viewer.videofy.mode.flexible",titleFallback:"Flexible"},fast:{titleKey:"viewer.videofy.mode.fast",titleFallback:"Fast"},quality:{titleKey:"viewer.videofy.mode.quality",titleFallback:"Quality"},voice:{titleKey:"viewer.videofy.mode.voice",titleFallback:"Voice"}};function L(e){let{t,model:i,setModel:o,mode:n,setMode:a,modelConfig:l,resolution:d,setResolution:c,duration:u,setDuration:m,userTier:h,isAnyGenerating:f,modeOverrides:v=b.Lu.overrides,modelOverrides:p=g.overrides,availableModeModelIds:w}=e,j=(0,r.useId)(),y="".concat(j,"-model"),N="".concat(j,"-resolution"),k="".concat(j,"-duration"),M=(0,r.useMemo)(()=>(function(e,t){let i={};for(let[s,r]of Object.entries(e)){let e=function(e,t){if(!t)return e;if(!0===t.disabled)return null;let i=e.durations;if(Array.isArray(t.durations)&&t.durations.length>0){let s=new Set(e.durations),r=t.durations.filter(e=>"number"==typeof e&&Number.isFinite(e)&&s.has(e));r.length>0&&(i=r)}let s=e.resolutions,r=e.defaultResolution;if(Array.isArray(t.resolutions)&&t.resolutions.length>0&&e.resolutions){let i=new Map(e.resolutions.map(e=>[e.id,e])),o=[];for(let e of t.resolutions){let t=i.get(e);t&&o.push(t)}o.length>0&&(s=o,r&&!o.some(e=>e.id===r)&&(r=o[0].id))}return{...e,durations:i,...s?{resolutions:s}:{},...r?{defaultResolution:r}:{}}}(r,t[s]);e&&(i[s]=e)}return i}
1)(x.Nn,p),[p]),C=(0,r.useMemo)(()=>new Set(w),[w]),L=(0,r.useMemo)(()=>b.Ty.map(e=>({modeId:e,resolvedModelId:(0,b.QN)(e,v,e=>null!=M[e]&&C.has(e))})),[v,M,C]),R=(0,r.useMemo)(()=>x.F5.filter(e=>null!=M[e]),[M]),E=(0,x.cX)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mb-5",children:[(0,s.jsxs)("div",{id:y,className:"flex items-center gap-2 text-sm font-medium text-[--muted] mb-3",children:[(0,s.jsx)(S,{className:"w-4 h-4"}),t("viewer.videofy.mode","Style")]}),(0,s.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",role:"group","aria-labelledby":y,children:L.map(e=>{let{modeId:i,resolvedModelId:r}=e,l=r?M[r]:void 0,d=!l||f;return(0,s.jsxs)("button",{type:"button",onClick:()=>{r&&(a(i),o(r))},disabled:d,"aria-pressed":n===i,className:"px-4 py-2.5 rounded-lg border text-left text-sm font-medium motion-safe:transition-colors ".concat(n===i?"border-white bg-white text-black":"border-white/10 bg-white/[0.04] text-white/70 hover:bg-white/[0.07]"," disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40"),children:[(0,s.jsxs)("span",{className:"block",children:[t(A[i].titleKey,A[i].titleFallback),r===E&&(0,s.jsx)("span",{className:"ml-1.5 align-middle rounded px-1.5 py-0.5 text-[10px] font-semibold bg-white/20",children:t("generationStyles.category.recommended.v2","Recommended")})]}),l&&(0,s.jsxs)("span",{className:"block text-xs mt-0.5 ".concat(n===i?"text-black/60":"opacity-70"),children:[l.displayName,l.costMultiplier>1&&" (".concat(l.costMultiplier,"x)")]})]},i)})})]}),(0,s.jsxs)("div",{className:"mb-5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-[--muted] mb-3",children:[(0,s.jsx)(F,{className:"w-4 h-4"}),t("viewer.videofy.advanced","Advanced")]}),(0,s.jsx)("div",{className:"flex gap-2 flex-wrap",role:"group","aria-label":t("viewer.videofy.advanced","Advanced"),children:R.map(e=>{let r=M[e];return r?(0,s.jsxs)("button",{type:"button",onClick:()=>{a(void 0),o(e)},disabled:f,"aria-pressed":void 0===n&&i===e,className:"px-4 py-2.5 rounded-lg border text-sm font-medium motion-safe:transition-colors ".concat(void 0===n&&i===e?"border-white bg-white text-black":"border-white/10 bg-white/[0.04] text-white/70 hover:bg-white/[0.07]"," disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40"),children:[r.displayName,e===E&&(0,s.jsx)("span",{className:"ml-1.5 rounded px-1.5 py-0.5 text-[10px] font-semibold bg-white/20",children:t("generationStyles.category.recommended.v2","Recommended")}),r.costMultiplier>1&&(0,s.jsxs)("span",{className:"ml-1 text-xs opacity-70",children:["(",r.costMultiplier,"x)"]})]},e):null})})]}),l.resolutions&&(0,s.jsxs)("div",{className:"mb-5",children:[(0,s.jsx)("div",{id:N,className:"block text-xs text-[--muted] mb-1.5",children:t("viewer.videofy.resolution","Resolution")}),(0,s.jsx)("div",{className:"grid gap-1.5 ".concat(l.resolutions.length>2?"grid-cols-2 sm:grid-cols-3":"grid-cols-2"),role:"group","aria-labelledby":N,children:l.resolutions.map(e=>{let t=0>(0,x.NA)(h,e.minTier);return(0,s.jsxs)("button",{type:"button",disabled:f||t,onClick:()=>!t&&c(e.id),"aria-pressed":d===e.id,className:"min-h-9 min-w-0 px-2.5 py-1.5 rounded-lg border text-xs font-medium motion-safe:transition-colors ".concat(d===e.id?"border-white/30 bg-white/10 text-white":t?"border-white/5 bg-white/[0.04] text-white/30 curs
1or-not-allowed":"border-white/10 bg-white/[0.04] text-white/70 hover:bg-white/[0.07]"," focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40"),children:[t&&(0,s.jsx)("span",{className:"mr-1",children:"\uD83D\uDD12"}),e.label,1!==e.costMultiplier&&(0,s.jsxs)("span",{className:"ml-1 text-white/40",children:["(",e.costMultiplier,"x)"]})]},e.id)})})]}),(0,s.jsxs)("div",{className:"mb-5",children:[(0,s.jsxs)("div",{id:k,className:"flex items-center gap-2 text-sm font-medium text-[--muted] mb-3",children:[(0,s.jsx)(z,{className:"w-4 h-4"}),t("viewer.videofy.duration","Duration")]}),l.useSlider&&void 0!==l.minDuration&&void 0!==l.maxDuration?(0,s.jsxs)("div",{className:"grid grid-cols-[2rem_minmax(0,1fr)_2rem] items-center gap-3 sm:grid-cols-[2rem_minmax(0,1fr)_2rem_3.5rem]",children:[(0,s.jsxs)("span",{className:"text-xs text-[--muted] min-w-[2rem]",children:[l.minDuration,"s"]}),(0,s.jsx)("input",{type:"range",min:l.minDuration,max:l.maxDuration,value:u,onChange:e=>m(Number(e.target.value)),disabled:f,"aria-labelledby":k,"aria-valuetext":"".concat(u," ").concat(t("common.sec","sec")),className:"flex-1 h-2 bg-white/10 rounded-lg appearance-none cursor-pointer accent-white disabled:opacity-50 disabled:cursor-not-allowed [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-5 [&::-webkit-slider-thumb]:h-5 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border [&::-webkit-slider-thumb]:border-white/20 [&::-webkit-slider-thumb]:bg-white [&::-moz-range-thumb]:w-5 [&::-moz-range-thumb]:h-5 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border [&::-moz-range-thumb]:border-white/20 [&::-moz-range-thumb]:bg-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40"}),(0,s.jsxs)("span",{className:"text-xs text-[--muted] min-w-[2rem]",children:[l.maxDuration,"s"]}),(0,s.jsxs)("span",{className:"col-span-3 text-sm font-medium text-white bg-white/10 px-3 py-1.5 rounded-lg text-center sm:col-span-1",children:[u,"s"]})]}):(0,s.jsx)("div",{className:"flex gap-2",role:"group","aria-labelledby":k,children:l.durations.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>m(e),disabled:f,"aria-pressed":u===e,className:"flex-1 py-3 rounded-lg border text-sm font-medium motion-safe:transition-colors ".concat(u===e?"border-white bg-white text-black":"border-white/10 bg-white/[0.04] text-white/70 hover:bg-white/[0.07]"," disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40"),children:[e," ",t("common.sec","sec")]},e))})]})]})}function S(e){let{className:t}=e;return(0,s.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 00-2.456 2.456zM16.894 20.567L16.5 21.75l-.394-1.183a2.25 2.25 0 00-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 001.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 001.423 1.423l1.183.394-1.183.394a2.25 2.25 0 00-1.423 1.423z"})})}function F(e){let{className:t}=e;return(0,s.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.75 3v3m4.5-3v3M9.75 18v3m4.5-3v3M3 9.75h3m-3 4.5h3m12-4.5h3m-3 4.5h3M5.25 6.75h13.5a1.5 1.5 0 011.5 1.5v7.5a1.5 1.5 0 01-1.5 1.5H5.25a1.5 1.5 0 01-1.5-1.5v-7.5a1.5 1.5 0 011.5-1.5z"})})}function z(e){let{className:t}=e;return(0,s.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})})}function R(e){let{t,modelConfig:i,hasNextFrame:o,useNextFrameAsEnding:n,setUseNextFrameAsEnding:a,generateAudio:l,setGenerateAudio:d,dialogMode:c,setDialogMode:u,cameraMotion:m,setCameraMotion:h,pacing:x,setPacing:f,customDirective:v,setCustomDirective:b,negativePrompt:g,setNegativePrompt:p,isAnyGenerating:w}=e,j=(0,r.useId)(),y="".concat(j,"-ending"),N="".concat(j,"-audio"),k="".concat(j,"-audio-description"),M="".concat(j,"-dialog"),C="".concat(j,"-camera-motion"),A="".concat(j,"-pacing"),L="".concat(j,"-directive"),S="".concat(j,"-negative-prompt");return(0,s.jsxs)(s.Fragment,{children:[o&&i.supportsEndFrame&&(0,s.jsxs)("div",{className:"mb-5",children:[(0,s.jsxs)("div",{id:y,className:"flex items-center gap-2 text-sm font-medium text-[--muted] mb-3",children:[(0,s.jsx)(E,{className:"w-4 h-4"}),t("viewer.videofy.ending","Ending")]}),(0,s.jsxs)("div",{className:"flex gap-2",role:"group","aria-labelledby":y,children:[(0,s.jsx)("button",{type:"button",onClick:()=>a(!1),disabled:w,"aria-pressed":!n,className:"flex-1 py-3 rounded-lg border text-sm font-medium motion-safe:transition-colors ".concat(n?"border-white/10 bg-white/[0.04] text-white/70 hover:bg-white/[0.07]":"border-white bg-white text-black"," disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40"),children:t("viewer.videofy.endingCurrent.v2","This frame")}),(0,s.jsx)("button",{type:"button",onClick:()=>a(!0),disabled:w,"aria-pressed":n,className:"flex-1 py-3 rounded-lg border text-sm font-medium motion-safe:transition-colors ".concat(n?"border-white bg-white text-black":"border-white/10 bg-white/[0.04] text-white/70 hover:bg-white/[0.07]"," disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40"),children:t("viewer.videofy.endingNext","Next frame")})]})]}),i.supportsAudio&&(0,s.jsx)("div",{className:"mb-5 p-4 bg-white/[0.04] rounded-lg border border-white/10",children:(0,s.jsxs)("label",{className:"flex items-center justify-between ".concat(i.hasNativeAudio?"cursor-default":"cursor-pointer"),children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"w-8 h-8 rounded-lg bg-white/10 flex items-center justify-center",children:(0,s.jsx)(I,{className:"w-4 h-4 text-[--muted]"})}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("span",{id:N,className:"text-sm text-white/80",children:t("viewer.videofy.audio","Generate audio")}),i.hasNativeAudio&&(0,s.jsx)("span",{id:k,className:"text-xs text-[--muted]",children:t("viewer.videofy.audioNative","Always included with this model")})]})]}),(0,s.jsx)("button",{type:"button",role:"switch","aria-checked":l,"aria-labelledby":N,"aria-describedby":i.hasNativeAudio?k:void 0,onClick:()=>
1{if(w||i.hasNativeAudio)return;let e=!l;d(e),e?"no"===c&&u("auto"):u("no")},disabled:w||i.hasNativeAudio,title:i.hasNativeAudio?t("viewer.videofy.audioNative","Always included with this model"):void 0,className:"relative w-12 h-7 rounded-full border motion-safe:transition-colors ".concat(l?"border-white bg-white":"border-white/10 bg-white/20"," ").concat(i.hasNativeAudio?"opacity-60 cursor-not-allowed":""," disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40"),children:(0,s.jsx)("span",{className:"absolute top-1 left-1 w-5 h-5 rounded-full motion-safe:transition-transform ".concat(l?"translate-x-5":"translate-x-0"," ").concat(l?"bg-black":"bg-white")})})]})}),i.supportsDialogMode&&(0,s.jsxs)("div",{className:"mb-5",children:[(0,s.jsxs)("div",{id:M,className:"flex items-center gap-2 text-sm font-medium text-[--muted] mb-3",children:[(0,s.jsx)(D,{className:"w-4 h-4"}),t("viewer.videofy.dialog.v2","Lip sync")]}),(0,s.jsx)("div",{className:"flex gap-2",role:"group","aria-labelledby":M,children:["auto","yes","no"].map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>u(e),disabled:w,"aria-pressed":c===e,className:"flex-1 py-2.5 rounded-lg border text-sm font-medium motion-safe:transition-colors ".concat(c===e?"border-white bg-white text-black":"border-white/10 bg-white/[0.04] text-white/70 hover:bg-white/[0.07]"," disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40"),children:"auto"===e?t("viewer.videofy.dialog.auto","Auto"):"yes"===e?t("viewer.videofy.dialog.on","On"):t("viewer.videofy.dialog.off","Off")},e))})]}),(0,s.jsxs)("div",{className:"mb-5 grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{htmlFor:C,className:"flex items-center gap-2 text-sm font-medium text-[--muted] mb-2",children:[(0,s.jsx)(B,{className:"w-4 h-4"}),t("viewer.videofy.cameraMotion","Camera")]}),(0,s.jsxs)("select",{id:C,value:m,onChange:e=>h(e.target.value),disabled:w,className:"w-full px-3 py-2.5 bg-white/[0.04] border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-white/30 focus:ring-2 focus:ring-white/20 disabled:opacity-50 disabled:cursor-not-allowed motion-safe:transition-colors appearance-none cursor-pointer",style:{colorScheme:"dark",backgroundImage:"url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='rgba(255,255,255,0.5)' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E\")",backgroundRepeat:"no-repeat",backgroundPosition:"right 12px center"},children:[(0,s.jsx)("option",{value:"none",className:"bg-zinc-900 text-white",children:t("viewer.videofy.cameraMotion.none","None")}),(0,s.jsx)("option",{value:"pan-left",className:"bg-zinc-900 text-white",children:t("viewer.videofy.cameraMotion.panLeft","Pan left")}),(0,s.jsx)("option",{value:"pan-right",className:"bg-zinc-900 text-white",children:t("viewer.videofy.cameraMotion.panRight","Pan right")}),(0,s.jsx)("option",{value:"tilt-up",className:"bg-zinc-900 text-white",children:t("viewer.videofy.cameraMotion.tiltUp","Tilt up")}),(0,s.jsx)("option",{value:"tilt-down",className:"bg-zinc-900 text-white",children:t("viewer.videofy.cameraMotion.tiltDown","Tilt down")}),(0,s.jsx)("option",{value:"zoom-in",className:"bg-zinc-900 text-white",children:t("viewer.videofy.cameraMotion.zoomIn","Zoom in")}),(0,s.jsx)("option",{value:"zoom-out",className:"bg-zinc-900 text-white",children:t("viewer.videofy.cameraMotion.zoomOut","Zoom out")}),(0,s.jsx)("option",{value:"dolly-in",className:"bg-zinc-900 text-white",children:t("viewer.videofy.cameraMotion.dollyIn","Dolly in")}),(0,s.jsx)("option",{value:"dolly-out",className:"bg-zinc-900 text-white",children:t("viewer.videofy.cameraMotion.dollyOut","Dolly out")}),(0,s.jsx)("option",{value:"orbit",className:"bg-zinc-900 text-white",children:t("viewer.videofy.cameraMotion.orbit","Orbit")}),(0,s.jsx)("option",{value:"shake",className:"bg-zinc-900 text-white",children:t("viewer.videofy.cameraMotion.shake","Shake")}),(0,s.jsx)("option",{value:"handheld",className:"bg-zinc-900 text-white",children:t("viewer.videofy.cameraMotion.handheld","Handheld")}),(0,s.jsx)("option",{value:"static",className:"bg-zinc-900 text-white",children:t("viewer.videofy.cameraMotion.static","Static")})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{htmlFor:A,className:"flex items-center gap-2 text-sm font-medium text-[--muted] mb-2",children:[(0,s.jsx)(T,{className:"w-4 h-4"}),t("viewer.videofy.pacing","Pacing")]}),(0,s.jsxs)("select",{id:A,value:x,onChange:e=>f(e.target.value),disabled:w,className:"w-full px-3 py-2.5 bg-white/[0.04] border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-white/30 focus:ring-2 focus:ring-white/20 disabled:opacity-50 disabled:cursor-not-allowed motion-safe:transition-colors appearance-none cursor-pointer",style:{colorScheme:"dark",backgroundImage:"url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='rgba(255,255,255,0.5)' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E\")",backgroundRepeat:"no-repeat",backgroundPosition:"right 12px center"},children:[(0,s.jsx)("option",{value:"none",className:"bg-zinc-900 text-white",children:t("viewer.videofy.pacing.none","None")}),(0,s.jsx)("option",{value:"slow",className:"bg-zinc-900 text-white",children:t("viewer.videofy.pacing.slow","Slow")}),(0,s.jsx)("option",{value:"normal",className:"bg-zinc-900 text-white",children:t("viewer.videofy.pacing.normal","Normal")}),(0,s.jsx)("option",{value:"fast",className:"bg-zinc-900 text-white",children:t("viewer.videofy.pacing.fast","Fast")}),(0,s.jsx)("option",{value:"intense",className:"bg-zinc-900 text-white",children:t("viewer.videofy.pacing.intense","Intense")})]})]})]}),(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsxs)("label",{htmlFor:L,className:"flex items-center gap-2 text-sm font-medium text-[--muted] mb-3",children:[(0,s.jsx)(P,{className:"w-4 h-4"}),t("viewer.videofy.directive.v2","Motion style"),(0,s.jsx)("span",{className:"text-[--muted] font-normal",children:t("videofy.optional","(optional)")})]}
1),(0,s.jsx)("input",{id:L,type:"text",value:v,onChange:e=>b(e.target.value),disabled:w,placeholder:t("viewer.videofy.directivePlaceholder.v2","e.g., 'cinematic zoom', 'slow pan'"),maxLength:2e3,className:"w-full px-4 py-3 bg-white/[0.04] border border-white/10 rounded-lg text-white placeholder:text-white/30 focus:outline-none focus:border-white/30 focus:ring-2 focus:ring-white/20 disabled:opacity-50 disabled:cursor-not-allowed motion-safe:transition-colors"})]}),i.supportsNegativePrompt&&(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsxs)("label",{htmlFor:S,className:"flex items-center gap-2 text-sm font-medium text-[--muted] mb-3",children:[(0,s.jsx)(_,{className:"w-4 h-4"}),t("viewer.videofy.negativePrompt","Negative prompt"),(0,s.jsx)("span",{className:"text-[--muted] font-normal",children:t("videofy.optional","(optional)")})]}),(0,s.jsx)("input",{id:S,type:"text",value:g,onChange:e=>p(e.target.value),disabled:w,placeholder:t("viewer.videofy.negativePromptPlaceholder","Things to avoid, e.g., 'blurry, shaky camera'"),maxLength:2e3,className:"w-full px-4 py-3 bg-white/[0.04] border border-white/10 rounded-lg text-white placeholder:text-white/30 focus:outline-none focus:border-white/30 focus:ring-2 focus:ring-white/20 disabled:opacity-50 disabled:cursor-not-allowed motion-safe:transition-colors"})]})]})}function E(e){let{className:t}=e;return(0,s.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 4.5L21 12m0 0l-7.5 7.5M21 12H3"})})}function I(e){let{className:t}=e;return(0,s.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.114 5.636a9 9 0 010 12.728M16.463 8.288a5.25 5.25 0 010 7.424M6.75 8.25l4.72-4.72a.75.75 0 011.28.53v15.88a.75.75 0 01-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 012.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75z"})})}function D(e){let{className:t}=e;return(0,s.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.625 12a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375M21 12c0 4.556-4.03 8.25-9 8.25a9.764 9.764 0 01-2.555-.337A5.972 5.972 0 015.41 20.97a5.969 5.969 0 01-.474-.065 4.48 4.48 0 00.978-2.025c.09-.457-.133-.901-.467-1.226C3.93 16.178 3 14.189 3 12c0-4.556 4.03-8.25 9-8.25s9 3.694 9 8.25z"})})}function P(e){let{className:t}=e;return(0,s.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.042 21.672L13.684 16.6m0 0l-2.51 2.225.569-9.47 5.227 7.917-3.286-.672zM12 2.25V4.5m5.834.166l-1.591 1.591M20.25 10.5H18M7.757 14.743l-1.59 1.59M6 10.5H3.75m4.007-4.243l-1.59-1.59"})})}function _(e){let{className:t}=e;return(0,s.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})})}function B(e){let{className:t}=e;return(0,s.jsxs)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.827 6.175A2.31 2.31 0 015.186 7.23c-.38.054-.757.112-1.134.175C2.999 7.58 2.25 8.507 2.25 9.574V18a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9.574c0-1.067-.75-1.994-1.802-2.169a47.865 47.865 0 00-1.134-.175 2.31 2.31 0 01-1.64-1.055l-.822-1.316a2.192 2.192 0 00-1.736-1.039 48.774 48.774 0 00-5.232 0 2.192 2.192 0 00-1.736 1.039l-.821 1.316z"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 12.75a4.5 4.5 0 11-9 0 4.5 4.5 0 019 0z"})]})}function T(e){let{className:t}=e;return(0,s.jsxs)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6l4 2"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]})}var G=i(37413);function H(e){return e?"veo"===e?"Veo":"ark"===e?"Seedance":"kling"===e?"Kling":e.charAt(0).toUpperCase()+e.slice(1):""}function V(e){let{t,locale:i,modelConfig:r,model:o,nodeId:n,motionRefRevisions:a,loadingMotionRefRevisions:l,motionRefRevisionIds:d,setMotionRefRevisionIds:c,motionRefExpanded:u,setMotionRefExpanded:m,motionRefPanelFramePosition:h,revisions:x,loadingRevisions:f,setPreviewRevision:v,recentFailures:b,retryingJobId:g,onRetryWithModel:p,retryError:w}=e,j="videofy-motion-ref-toggle-".concat(n),y="videofy-motion-ref-panel-".concat(n),N="videofy-revisions-heading-".concat(n);return(0,s.jsxs)(s.Fragment,{children:[(l||a.length>0)&&"ark"===r.provider&&("seedance-2.0"===o||"seedance-2.0-fast"===o)&&(0,s.jsxs)("div",{className:"mt-8",role:"region","aria-labelledby":j,"aria-busy":l,children:[(0,s.jsxs)("button",{id:j,type:"button",onClick:()=>m(e=>!e),className:"flex items-center justify-between w-full gap-2 text-sm font-medium text-white/60 mb-3 hover:text-white/80 motion-safe:transition-colors rounded-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40","aria-expanded":u,"aria-controls":y,children:[(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsx)(O,{className:"w-4 h-4"}),t("viewer.videofy.motionRef","Motion reference"),d.length>0&&(0,s.jsxs)("span",{className:"px-1.5 py-0.5 rounded-md border border-white/10 bg-white/10 text-xs text-white/70",children:[d.length,"/3"]})]}),(0,s.jsx)("span",{className:"text-xs text-[--muted]","aria-hidden":"true",children:u?"−":"+"})]}),u&&(0,s.jsx)("div",{id:y,children:(()=>
1{if(l)return(0,s.jsx)("div",{className:"flex justify-center py-4",role:"status","aria-label":t("common.loading","Loading..."),children:(0,s.jsx)("div",{className:"w-6 h-6 border-2 border-white/30 border-t-white rounded-full motion-safe:animate-spin"})});let e=[],i=[],r=[];for(let t of a){if(t.nodeId===n){i.push(t);continue}"number"==typeof t.framePosition&&"number"==typeof h?t.framePosition<h?e.push(t):t.framePosition>h?r.push(t):i.push(t):i.push(t)}let o=e=>{let i=d.includes(e.id),r=d.length,o=!i&&r>=3,n="number"==typeof e.framePosition?"".concat(t("viewer.videofy.motionRefFrameBadge","Frame")," ").concat(e.framePosition+1):null;return(0,s.jsxs)("label",{className:"flex items-center gap-3 p-2.5 rounded-lg border motion-safe:transition-colors cursor-pointer ".concat(i?"border-white/20 bg-white/10":o?"border-white/5 bg-white/[0.04] opacity-40 cursor-not-allowed":"border-white/10 bg-white/[0.04] hover:bg-white/[0.07]"),children:[(0,s.jsx)("input",{type:"checkbox",className:"shrink-0 accent-white",checked:i,disabled:o,onChange:t=>{c(i=>t.target.checked?i.includes(e.id)?i:[...i,e.id].slice(0,3):i.filter(t=>t!==e.id))}}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("span",{className:"text-sm text-white font-medium",children:[e.durationSec,"s"]}),(0,s.jsx)("span",{className:"text-xs text-[--muted]",children:e.model}),n&&(0,s.jsx)("span",{className:"px-1.5 py-0.5 rounded-md border border-white/10 bg-white/10 text-[--muted] text-[10px]",children:n})]}),(0,s.jsx)("div",{className:"text-xs text-[--muted]",children:new Date(e.createdAt).toLocaleDateString()})]})]},"motion-ref-".concat(e.id))},u=e=>(0,s.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-[--muted] mt-3 mb-1.5 px-1",children:e});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-xs text-[--muted] mb-3",children:t("viewer.videofy.motionRefHint","Carry camera motion and pacing from up to 3 existing versions into this generation (Seedance 2.0 only).")}),(0,s.jsxs)("div",{className:"space-y-2",children:[e.length>0&&(0,s.jsxs)(s.Fragment,{children:[u(t("viewer.videofy.motionRefEarlier","Earlier frames")),e.map(o)]}),i.length>0&&(0,s.jsxs)(s.Fragment,{children:[u(t("viewer.videofy.motionRefThis","This frame")),i.map(o)]}),r.length>0&&(0,s.jsxs)(s.Fragment,{children:[u(t("viewer.videofy.motionRefLater","Later frames")),r.map(o)]})]})]})})()})]}),b.length>0&&(0,s.jsxs)("div",{className:"mt-8",children:[(0,s.jsxs)("h3",{className:"flex items-center gap-2 text-sm font-medium text-red-400/80 mb-3",children:[(0,s.jsx)(q,{className:"w-4 h-4"}),t("viewer.videofy.recentFailures","Recent failures"),(0,s.jsx)("span",{className:"px-1.5 py-0.5 rounded-md border border-red-400/20 bg-red-500/10 text-xs text-red-200",children:b.length})]}),(0,s.jsx)("div",{className:"space-y-2",children:b.map(e=>{let r=g===e.jobId,o=H(e.fallbackProvider),n=(null==w?void 0:w.jobId)===e.jobId;return(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 p-3 rounded-lg bg-red-500/5 border border-red-500/20 sm:flex-row sm:items-center",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm text-red-300 truncate",children:e.friendlyReason}),(0,s.jsxs)("p",{className:"text-xs text-white/40 truncate",children:[e.model||H(e.provider)," \xb7 ",e.durationSec,"s \xb7 ",(0,G.Nt)(e.createdAt,t,i)]})]}),!0===e.retryAvailable?e.fallbackModelId&&o?(0,s.jsx)("button",{type:"button",onClick:()=>p(e.jobId,e.fallbackModelId),disabled:r,className:"w-full px-3 py-1.5 rounded-lg border border-red-400/20 bg-red-500/10 hover:bg-red-500/15 disabled:opacity-50 disabled:cursor-not-allowed text-red-100 text-xs font-medium text-center motion-safe:transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-200/50 sm:w-auto sm:whitespace-nowrap",children:r?t("viewer.videofy.retrying","Retrying…"):t("viewer.videofy.retryOn","Retry on ".concat(o),{provider:o})}):(0,s.jsx)("button",{type:"button",onClick:()=>p(e.jobId),disabled:r,className:"w-full px-3 py-1.5 rounded-lg border border-red-400/20 bg-red-500/10 hover:bg-red-500/15 disabled:opacity-50 disabled:cursor-not-allowed text-red-100 text-xs font-medium text-center motion-safe:transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-200/50 sm:w-auto 
1sm:whitespace-nowrap",children:r?t("viewer.videofy.retrying","Retrying…"):t("viewer.videofy.retry","Retry")}):null]}),n&&w?(0,s.jsx)("p",{className:"text-xs text-red-300/90 px-3",role:"status","aria-live":"polite",children:w.message}):null]},e.jobId)})})]}),(f||x.length>0)&&(0,s.jsxs)("div",{className:"mt-8",role:"region","aria-labelledby":N,"aria-busy":f,"aria-live":"polite",children:[(0,s.jsxs)("h3",{id:N,className:"flex items-center gap-2 text-sm font-medium text-white/60 mb-4",children:[(0,s.jsx)(O,{className:"w-4 h-4"}),t("viewer.videofy.revisions","Previous versions"),(0,s.jsx)("span",{className:"px-1.5 py-0.5 rounded-md border border-white/10 bg-white/10 text-[--muted] text-xs",children:x.length})]}),(0,s.jsx)("div",{className:"space-y-2",children:f?(0,s.jsx)("div",{className:"flex justify-center py-4",role:"status","aria-label":t("common.loading","Loading..."),children:(0,s.jsx)("div",{className:"w-6 h-6 border-2 border-white/30 border-t-white rounded-full motion-safe:animate-spin"})}):x.map(e=>(0,s.jsxs)("div",{className:"flex flex-col gap-3 p-3 rounded-lg border motion-safe:transition-colors sm:flex-row sm:items-center ".concat(e.selected?"border-white/20 bg-white/10":"border-white/10 bg-white/[0.04] hover:bg-white/[0.07]"),children:[(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("span",{className:"text-sm text-white font-medium",children:[e.durationSec,"s"]}),(0,s.jsx)("span",{className:"text-xs text-[--muted]",children:e.model}),e.selected&&(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-md border border-white/10 bg-white/10 text-xs text-white/70",children:t("viewer.videofy.current","Current")})]}),(0,s.jsx)("span",{className:"text-xs text-[--muted]",children:new Date(e.createdAt).toLocaleDateString()})]}),(0,s.jsxs)("button",{type:"button",onClick:()=>v(e),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-white/10 bg-white/[0.06] px-4 py-2 text-sm text-white motion-safe:transition-colors hover:bg-white/[0.09] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40 sm:w-auto",children:[(0,s.jsx)(W,{className:"w-3.5 h-3.5"}),t("viewer.videofy.preview","Preview")]})]},e.id))})]})]})}function W(e){let{className:t}=e;return(0,s.jsx)("svg",{className:t,fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M8 5v14l11-7z"})})}function O(e){let{className:t}=e;return(0,s.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})})}function q(e){let{className:t}=e;return(0,s.jsxs)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,s.jsx)("path",{strokeLinecap:"round",d:"M12 8v4"}),(0,s.jsx)("circle",{cx:"12",cy:"16",r:"0.5",fill:"currentColor"})]})}var K=i(89548);function U(e){let{t,revision:i,selecting:o,selectionError:n,onClose:a,onSelect:l}=e,d=(0,r.useRef)(null);return(0,k.r)(d,!0),(0,s.jsxs)("div",{className:"fixed inset-0 z-[60] flex items-center justify-center p-4",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:a}),(0,s.jsxs)("div",{ref:d,role:"dialog","aria-modal":"true","aria-label":t("viewer.videofy.previewLabel","Video revision preview"),className:"relative bg-sheet-gradient rounded-lg max-w-lg w-full overflow-hidden border border-white/10",children:[(0,s.jsx)("div",{className:"aspect-video bg-black",children:(0,s.jsx)(K.L,{src:i.url,autoPlay:!0,isActive:!0,muted:!1,loop:!1,className:"w-full h-full"})}),(0,s.jsxs)("div",{className:"p-4 space-y-3",children:[n&&(0,s.jsx)("div",{className:"p-3 bg-red-500/10 border border-red-500/20 rounded-lg",role:"alert",children:(0,s.jsx)("p",{className:"text-sm text-red-400",children:n})}),(0,s.jsxs)("div",{className:"flex gap-3",children:[(0,s.jsx)("button",{type:"button",onClick:a,disabled:o,className:"flex-1 py-3 rounded-lg border border-white/10 bg-white/[0.04] text-white hover:bg-white/[0.07] motion-safe:transition-colors disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40",children:t("common.close","Close")}),(0,s.jsx)("button",{type:"button",onClick:()=>l(i),disabled:o,className:"flex-1 py-3 rounded-lg bg-white text-black font-semibold hover:bg-white/90 motion-safe:transition-colors disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-white flex items-center justify-center gap-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:o?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"w-4 h-4 border-2 border-black/20 border-t-black rounded-full motion-safe:animate-spin"}),t("common.loading","Loading...")]}):t("viewer.videofy.setCurrent.v2","Use this")})]})]})]})]})}function Q(e){let{t,isGenerating:i,hasProgress:r,canonicalStatus:o,estimatedSecondsRemaining:n,isBatchGenerating:a,batchProgress:l}=e;return(0,s.jsxs)(s.Fragment,{children:[i&&r&&(0,s.jsxs)("div",{className:"mb-4 p-4 bg-white/[0.04] border border-white/10 rounded-lg",role:"status","aria-live":"polite",children:[(0,s.jsx)("div",{className:"grid grid-cols-3 gap-2 mb-3",children:["queued","processing","completed"].map((e,i)=>{var r;let n={queued:0,processing:1,completed:2,failed:1}
1,a=o?null!=(r=n[o])?r:1:0,l=n[e],d=l===a,c=l<a,u={queued:t("viewer.videofy.step.queued","Queued"),processing:t("viewer.videofy.step.generating","Generating"),completed:t("viewer.videofy.step.done","Done")};return(0,s.jsxs)("div",{className:"min-w-0",children:[i>0&&(0,s.jsx)("div",{className:"mb-2 h-px ".concat(c||d?"bg-white/35":"bg-white/10")}),0===i&&(0,s.jsx)("div",{className:"mb-2 h-px bg-transparent"}),(0,s.jsxs)("div",{className:"flex min-w-0 items-center justify-center gap-1.5",children:[(0,s.jsx)("div",{className:"w-2 h-2 rounded-full ".concat(c?"bg-white/60":d?"bg-white ring-2 ring-white/20":"bg-white/20")}),(0,s.jsx)("span",{className:"text-xs font-medium ".concat(c?"text-white/45":d?"text-white/80":"text-white/30"," truncate"),children:u[e]})]})]},e)})}),null!=n&&n>0&&(0,s.jsx)("p",{className:"text-xs text-white/50 mb-2",children:n<60?t("viewer.videofy.eta.seconds","~{{seconds}}s remaining").replace("{{seconds}}",String(n)):t("viewer.videofy.eta.minutes","~{{minutes}}m remaining").replace("{{minutes}}",String(Math.ceil(n/60)))}),(0,s.jsx)("div",{className:"h-1.5 bg-white/10 rounded-full overflow-hidden",role:"progressbar","aria-label":t("viewer.videofy.step.generating","Generating"),children:null!=n?(0,s.jsx)("div",{className:"h-full bg-white/75 rounded-full motion-safe:transition-[width] duration-1000 ease-linear",style:{width:"".concat(Math.min(95,Math.max(5,100-n/(n+10)*100)),"%")}}):(0,s.jsx)("div",{className:"h-full w-1/3 bg-white/60 rounded-full motion-safe:animate-pulse"})})]}),a&&l&&(0,s.jsxs)("div",{className:"mb-4 p-4 bg-white/[0.04] border border-white/10 rounded-lg",role:"status","aria-live":"polite",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,s.jsx)("div",{className:"w-8 h-8 rounded-lg border border-white/10 bg-white/[0.06] flex items-center justify-center",children:(0,s.jsx)("div",{className:"w-4 h-4 border-2 border-white/20 border-t-white/70 rounded-full motion-safe:animate-spin"})}),(0,s.jsxs)("p",{className:"min-w-0 flex-1 text-sm text-white/70 font-medium",children:[t("viewer.videofy.batchProgress","Videofying all frames...")," ",l.completed,"/",l.total]})]}),(0,s.jsx)("div",{className:"h-1.5 bg-white/10 rounded-full overflow-hidden",role:"progressbar","aria-label":t("viewer.videofy.batchProgress","Videofying all frames..."),"aria-valuemin":0,"aria-valuemax":l.total,"aria-valuenow":l.completed,"aria-valuetext":"".concat(l.completed,"/").concat(l.total),children:(0,s.jsx)("div",{className:"h-full bg-white/75 rounded-full motion-safe:transition-[width] duration-500",style:{width:"".concat(Math.max(5,l.completed/l.total*100),"%")}})})]})]})}function Y(e){let{className:t}=e;return(0,s.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}function Z(e){let{className:t}=e;return(0,s.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 10.5l4.72-4.72a.75.75 0 011.28.53v11.38a.75.75 0 01-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 002.25-2.25v-9a2.25 2.25 0 00-2.25-2.25h-9A2.25 2.25 0 002.25 7.5v9a2.25 2.25 0 002.25 2.25z"})})}function J(e){let{className:t}=e;return(0,s.jsx)("svg",{className:t,fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M6 6h12v12H6z"})})}function X(e){let{className:t}=e;return(0,s.jsx)("svg",{className:t,fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M8 5v14l11-7z"})})}function $(e){let{className:t}=e;return(0,s.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"})})}function ee(e){let{className:t}=e;return(0,s.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m9-.75
1a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"})})}function et(e){let{className:t}=e;return(0,s.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6zM3.75 15.75A2.25 2.25 0 016 13.5h2.25a2.25 2.25 0 012.25 2.25V18a2.25 2.25 0 01-2.25 2.25H6A2.25 2.25 0 013.75 18v-2.25zM13.5 6a2.25 2.25 0 012.25-2.25H18A2.25 2.25 0 0120.25 6v2.25A2.25 2.25 0 0118 10.5h-2.25a2.25 2.25 0 01-2.25-2.25V6zM13.5 15.75a2.25 2.25 0 012.25-2.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-2.25A2.25 2.25 0 0113.5 18v-2.25z"})})}function ei(e){let{t,costExplanation:i,estimatedCost:r,hasEnoughCredits:o,videoSeconds:n,creditPercentage:a}=e;return(0,s.jsxs)("div",{className:"mb-6 p-4 bg-white/[0.04] rounded-lg border border-white/10",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3 mb-3",children:[(0,s.jsxs)("span",{className:"text-sm text-white/60 flex items-center gap-2",children:[(0,s.jsx)($,{className:"w-4 h-4"}),t("viewer.videofy.cost.v2","Cost")]}),(0,s.jsxs)("span",{className:"shrink-0 text-xl font-bold ".concat(o?"text-white":"text-red-400"),children:[r,"s"]})]}),(0,s.jsxs)("div",{className:"mb-2 text-[11px] text-white/50 flex items-center gap-1.5 flex-wrap",children:[(0,s.jsx)("span",{children:t("viewer.videofy.costRate.v2","{{rate}}\xd7 per second",{rate:i.effectiveRate.toFixed(i.effectiveRate>=10?1:2)})}),"surcharge"===i.audioState&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-white/30",children:"\xb7"}),(0,s.jsx)("span",{children:t("viewer.videofy.costIncludesAudioSurcharge","Includes audio surcharge")})]}),"included"===i.audioState&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-white/30",children:"\xb7"}),(0,s.jsx)("span",{children:t("viewer.videofy.costIncludesAudio.v2","Audio included in cost")})]})]}),(0,s.jsx)("div",{className:"h-2 bg-white/10 rounded-full overflow-hidden mb-2",role:"meter","aria-label":t("viewer.videofy.balance.v2","Balance"),"aria-valuemin":0,"aria-valuemax":r,"aria-valuenow":Math.min(n,r),"aria-valuetext":"".concat(n).concat(t("common.secAvailable","s available")),children:(0,s.jsx)("div",{className:"h-full rounded-full motion-safe:transition-[width] ".concat(o?"bg-white/75":"bg-red-400"),style:{width:"".concat(Math.min(a,100),"%")}})}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1 text-xs",children:[(0,s.jsx)("span",{className:"text-[--muted]",children:t("viewer.videofy.balance.v2","Balance")}),(0,s.jsxs)("span",{className:o?"text-white/60":"text-red-400",children:[n,t("common.secAvailable","s available")]})]}),!o&&(0,s.jsxs)("p",{className:"text-xs text-red-400 mt-2 flex items-center gap-1",children:[(0,s.jsx)(ee,{className:"w-3 h-3"}),t("viewer.videofy.notEnoughCredits.v2","Not enough credits")]})]})}function es(e){let{t,isGenerating:i,isBatchGenerating:r,hasEnoughCredits:o,hasEnoughForBatch:n,batchNodeCount:a,batchCost:l,onGenerate:d,onBatchGenerate:c,onAbort:u}=e;return(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-3 ".concat(a>1?"sm:grid-cols-2":""),children:[(0,s.jsx)("button",{type:"button",onClick:i?u:d,disabled:!o&&!i||r,title:i||o?r?t("viewer.videofy.batchInProgress","Batch generation in progress"):void 0:t("viewer.videofy.notEnoughCredits.v3","Not enough credits"),className:"min-h-[56px] w-full min-w-0 py-4 rounded-lg font-semibold motion-safe:transition-colors flex items-center justify-center gap-2.5 text-center leading-tight disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ".concat(i?"border border-red-400/30 bg-red-500/10 text-red-100 hover:bg-red-500/15":"bg-white text-black hover:bg-white/90 disabled:hover:bg-white"),children:i?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(J,{className:"w-5 h-5"}),t("viewer.videofy.cancel","Cancel")]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(X,{className:"w-5 h-5"}),t("viewer.videofy.generate","Generate Video")]})}),a>1&&(0,s.jsx)("button",{type:"button",onClick:r?u:c,disabled:!n&&!r||i,title:r||n?i?t("viewer.videofy.singleInProgress","Single generation in progress"):void 0:t("viewer.videofy.notEnoughCredits.v4","Not enough credits"),className:"min-h-[56px] w-full min-w-0 py-4 rounded-lg font-semibold motion-safe:transition-colors flex flex-col items-center justify-center gap-1 text-center leading-tight disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40 ".concat(r?"border border-red-400/30 bg-red-500/10 text-red-100 hover:bg-red-500/15":"border border-white/10 bg-white/[0.06] text-white hover:bg-white/[0.09]"),children:r?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(J,{className:"w-5 h-5"}),(0,s.jsx)("span",{className:"text-xs",children:t("viewer.videofy.cancel","Cancel")})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("span",{className:"flex max-w-full items-center justify-center gap-1.5",children:[(0,s.jsx)(et,{className:"w-4 h-4"}),(0,s.jsx)("span",{className:"truncate",children:t("viewer.videofy.batchGenerate","Videofy All")})]}),(0,s.jsxs)("span",{className:"text-xs opacity-70",children:[a," ",t("viewer.videofy.batchFrames","frames")," \xb7 ",l,"s"]})]})})]})}var er=i(68146);function eo(e){let{open:t,onClose:i,storyId:d,nodeId:g,allNodeIds:w,hasNextFrame:A,onVideoGenerated:S,onBatchComplete:F,oneTapPending:z,onOneTapHandled:E,triggerSource:I,onShowBackgroun
1dToast:D,videofy:P,recoveringActiveJob:_}=e,{t:B}=(0,o.s)(),T=(0,n.Y)(),G=(0,m.k)(e=>e.getTotalCredits),H=(0,m.k)(e=>e.profile),W=(null==H?void 0:H.tier)||"free",O=G("video_seconds"),{generateVideo:q,resumeActiveJob:K,generateBatchVideo:J,abort:X,getRevisions:$,selectRevision:et,retryWithModel:eo,explainCost:en,isGenerating:ea,inFlightNodeId:el,isBatchGenerating:ed,batchProgress:ec,error:eu,errorType:em,progress:eh,canonicalStatus:ex,estimatedSecondsRemaining:ef,phase:ev,attempt:eb,providerLabel:eg,elapsedSeconds:ep,recovering:ew,clearError:ej}=P;!function(e){let{userId:t,isPremium:i,canonicalStatus:s,isBatchGenerating:o,batchFailed:n}=e,d=(0,r.useRef)(s),m=(0,r.useRef)(o);(0,r.useEffect)(()=>{if(i||!t){d.current=s,m.current=o;return}let e="videofy_success";"completed"===s&&"completed"!==d.current&&c(t,e)&&(u(t,e),(0,a.u4)("paywall_shown",{kind:e,source:"web_viewer_single"}),(0,l.H)("paywall_shown",{kind:e,source:"web_viewer_single"})),m.current&&!o&&!n&&c(t,e)&&(u(t,e),(0,a.u4)("paywall_shown",{kind:e,source:"web_viewer_batch"}),(0,l.H)("paywall_shown",{kind:e,source:"web_viewer_batch"})),d.current=s,m.current=o},[t,i,s,o,n])}({userId:null==H?void 0:H.id,isPremium:null==H?void 0:H.isPremium,canonicalStatus:ex,isBatchGenerating:ed,batchFailed:"failed"===ex});let[ey,eN]=(0,r.useState)(f.j),ek=(0,r.useRef)(!1),eM=(0,r.useCallback)(e=>{ek.current=!0,eN(e)},[]),[eC,eA]=(0,r.useState)(void 0),[eL,eS]=(0,r.useState)(()=>{let e=(0,x.Ac)((0,f.j)());return e.hasNativeAudio||e.supportsAudio&&!1!==e.defaultGenerateAudio}),[eF,ez]=(0,r.useState)(!1),[eR,eE]=(0,r.useState)(4),[eI,eD]=(0,r.useState)("no"),[eP,e_]=(0,r.useState)(""),[eB,eT]=(0,r.useState)(""),[eG,eH]=(0,r.useState)("none"),[eV,eW]=(0,r.useState)("none"),[eO,eq]=(0,r.useState)(()=>(0,x.Ov)((0,f.j)())),eK=(0,r.useRef)(null),eU=function(){let{data:e}=(0,v.I)({queryKey:["video-modes-config"],queryFn:p,staleTime:6e5,gcTime:18e5,placeholderData:b.Lu});return null!=e?e:b.Lu}(),eQ=function(){let{data:e}=(0,v.I)({queryKey:["video-models-config"],queryFn:y,staleTime:6e5,gcTime:18e5,placeholderData:j});return null!=e?e:j}(),eY=(0,r.useMemo)(()=>(0,x.Ac)(ey),[ey]),[eZ,eJ]=(0,r.useState)([]),[eX,e$]=(0,r.useState)(!1),[e0,e2]=(0,r.useState)(null),[e5,e1]=(0,r.useState)(!1),[e4,e3]=(0,r.useState)(null),[e7,e8]=(0,r.useState)([]),[e6,e9]=(0,r.useState)(null),[te,tt]=(0,r.useState)(null),[ti,ts]=(0,r.useState)([]),[tr,to]=(0,r.useState)(!1),[tn,ta]=(0,r.useState)([]),[tl,td]=(0,r.useState)(!1),[tc,tu]=(0,r.useState)(null),[tm,th]=(0,r.useState)(!1),tx=(0,r.useRef)(null),tf=(0,r.useRef)(null),tv=(0,r.useRef)(null),tb=en(eR,ey,eO,eL),tg=tb.total,tp=O>=tg,tw=Math.min(100,O/Math.max(tg,1)*100);(0,r.useEffect)(()=>{eY.useSlider&&void 0!==eY.minDuration&&void 0!==eY.maxDuration?(eR<eY.minDuration||eR>eY.maxDuration)&&eE(eY.defaultDuration):eY.durations.includes(eR)||eE(eY.defaultDuration)},[ey,eY]);let tj=(0,r.useRef)(null);(0,r.useEffect)(()=>{var e;let t=P.admittedVideofy;if(!t)return;let i=t.tuple;tj.current=i.modelId&&i.modelId!==ey&&void 0!==i.resolution?i.modelId:null,i.modelId&&eN(i.modelId),void 0!==i.resolution&&eq(i.resolution),void 0!==i.selectedMode&&eA(null!=(e=i.selectedMode)?e:void 0)},[P.admittedVideofy]),(0,r.useEffect)(()=>{let e=tj.current;if(e){e===ey&&(tj.current=null);return}eq(eY.defaultResolution)},[ey,eY.defaultResolution]),(0,r.useEffect)(()=>{!eY.supportsEndFrame&&eF&&ez(!1);let e=eK.current!==ey;eK.current=ey,eY.hasNativeAudio&&!eL?eS(!0):(!eY.supportsAudio||e&&!1===eY.defaultGenerateAudio)&&eL&&eS(!1),eY.supportsDialogMode||"no"===eI||eD("no")},[ey,eY,eF,eL,eI]),(0,r.useEffect)(()=>{ts([])},[g]),(0,r.useEffect)(()=>{t&&d&&g&&(e$(!0),$(d,g).then(e=>{eJ(e.revisions),e8(e.recentFailures)}).catch(()=>{eJ([]),e8([])}).finally(()=>e$(!1)),td(!0),$(d,g,2).then(e=>{let t=e.revisions;ta(t);let i=t.find(e=>e.nodeId===g);tu("number"==typeof(null==i?void 0:i.framePosition)?i.framePosition:null)}).catch(()=>{ta([]),tu(null)}).finally(()=>td(!1)))},[t,d,g,$]),(0,r.useEffect)(()=>{t&&(ej(),e2(null))},[t,ej]),(0,r.useEffect)(()=>{eu&&tf.current&&tf.current.scrollTo({top:0,behavior:"smooth"})},[eu]);let{frames:ty}=(0,h.p)(),tN=(0,r.useMemo)(()=>{let e=ty.findIndex(e=>e.nodeId===g);return e>=0?e+1:null},[ty,g]),tk=(0,r.useCallback)(()=>e2(null),[]);(0,N.K)({open:t,onClose:i,hasPreview:!!e0,closePreview:tk}),(0,k.r)(tv,t&&!e0),(0,r.useEffect)(()=>
1{if(!t)return;let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[t]);let tM=(0,r.useCallback)(async()=>{if(!d||!g||!tp)return;let e=C({model:ey,modelConfig:eY,selectionOrigin:ek.current||void 0!==eC||ey!==(0,f.j)()?void 0:"mode",duration:eR,resolution:eO,generateAudio:eL,useNextFrameAsEnding:eF,mode:eC,dialogMode:eI,customDirective:eP,negativePrompt:eB,cameraMotion:eG,pacing:eV,motionRefRevisionIds:ti,triggerSource:I||"manual_api"}),t=await q(d,g,e);if(t){S(t,d,g,"generated");let e=await $(d,g);eJ(e.revisions),e8(e.recentFailures)}},[d,g,tp,ey,eY,eR,eL,eF,eC,eI,eP,eB,eO,eG,eV,ti,I,q,S,$]),tC=(0,r.useCallback)(async e=>{e1(!0),e3(null);try{let t=await et(d,g,e.id);if(t){S(t,d,g,"selected"),e2(null);let e=await $(d,g);eJ(e.revisions),e8(e.recentFailures)}else e3(B("viewer.videofy.selectionFailed","Failed to select revision"))}catch(e){e3(B("viewer.videofy.selectionFailed","Failed to select revision"))}finally{e1(!1)}},[d,g,et,S,$,B]),tA=(0,r.useCallback)(()=>{X()},[X]),tL=(0,r.useCallback)(async(e,t)=>{if(d){e9(e),tt(null);try{let i=await eo(d,e,t);if(!1===i.ok){let t;t=409===i.status||"ALREADY_GENERATING"===i.code?B("viewer.videofy.retryError.alreadyGenerating","Wait for the current generation to finish, then retry."):503===i.status||"MODEL_DISABLED"===i.code?B("viewer.videofy.retryError.modelDisabled","This model is temporarily unavailable. Try again later."):i.message||B("viewer.videofy.retryError.generic","Retry failed. Please try again."),tt({jobId:e,message:t}),setTimeout(()=>tt(t=>(null==t?void 0:t.jobId)===e?null:t),6e3)}else e8(t=>t.filter(t=>t.jobId!==e)),$(d,g).then(e=>{eJ(e.revisions),e8(e.recentFailures)}).catch(()=>{}),K(d,e,g).catch(()=>{})}finally{e9(null)}}},[d,g,eo,$,K]),tS=(0,r.useMemo)(()=>w.filter(Boolean),[w]),tF=(0,r.useMemo)(()=>tg*tS.length,[tg,tS.length]),tz=O>=tF,tR=(0,r.useCallback)(async()=>{if(!d||0===tS.length||!tz)return;let e=C({model:ey,modelConfig:eY,selectionOrigin:ek.current||void 0!==eC||ey!==(0,f.j)()?void 0:"mode",duration:eR,resolution:eO,generateAudio:eL,useNextFrameAsEnding:!1,mode:eC,dialogMode:eI,customDirective:eP,negativePrompt:eB,cameraMotion:eG,pacing:eV,triggerSource:"batch_manual"});await J(d,tS,e),null==F||F()},[d,tS,tz,ey,eY,eR,eL,eC,eI,eP,eB,eO,eG,eV,J,F]),tE=ea&&el===g,tI=tE||ed||_,tD=(0,r.useCallback)(()=>{if(_||ea||ed)return;let e=z?"videofy_pressed_one_tap":"videofy_pressed_after_customize";(0,l.H)(e,{storyId:d,model:ey,durationSec:eR}),tg>0||z?(tx.current="single",th(!0)):tM()},[tg,tM,z,d,ey,eR,_,ea,ed]),tP=(0,r.useRef)(!1),t_=(0,r.useRef)(!1),tB=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(!t){tP.current=!1,t_.current=!1,tB.current=null;return}if(!z||tP.current||t_.current||_)return;if(ea||ed){null==E||E(),tP.current=!0;return}let e=function(e){let t=(0,x.Ac)(e);return{model:e,resolution:(0,x.Ov)(e),duration:t.defaultDuration,generateAudio:t.hasNativeAudio||t.supportsAudio&&!1!==t.defaultGenerateAudio,useNextFrameAsEnding:!1,mode:void 0,selectionOrigin:"mode"}}((0,f.j)());tB.current=e.model,ek.current=!1,eN(e.model),eq(e.resolution),eE(e.duration),eS(e.generateAudio),ez(e.useNextFrameAsEnding),eA(e.mode),t_.current=!0},[t,z,_,ea,ed,E]),(0,r.useEffect)(()=>{t_.current&&null!==tB.current&&ey===tB.current&&(t_.current=!1,tP.current=!0,tD())},[ey,tg,tD]);let tT=(0,r.useCallback)(()=>{_||ea||ed||(tF>0?(tx.current="batch",th(!0)):tR())},[tF,tR,_,ea,ed]),tG=(0,r.useCallback)(()=>{th(!1),"single"===tx.current?tM():"batch"===tx.current&&tR(),tx.current=null,z&&(null==D||D(),null==E||E())},[tM,tR,z,D,E]),tH=(0,r.useCallback)(()=>{th(!1),tx.current=null,z&&((0,l.H)("videofy_one_tap_cancelled",{storyId:d,model:ey,duration:eR}),null==E||E())},[z,E,d,ey,eR]),tV="batch"===tx.current?tF:tg;return t?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-md z-40",onClick:i}),e0&&(0,s.jsx)(U,{t:B,revision:e0,selecting:e5,selectionError:e4,onClose:()=>{e2(null),e3(null)},onSelect:tC}),(0,s.jsx)("div",{className:"fixed bottom-0 left-0 right-0 lg:inset-0 lg:flex lg:items-center lg:justify-center lg:p-6 z-50 motion-safe:animate-scale-in",role:"dialog","aria-modal":"true","aria-labelledby":"videofy-panel-title",onClick:i,children:(0,s.jsxs)("div",{ref:tv,className:"bg-sheet-gradient rounded-t-3xl lg:rou
1nded-lg max-h-[85vh] lg:max-h-[80vh] overflow-hidden border-t lg:border border-white/10 w-full lg:max-w-2xl",onClick:e=>e.stopPropagation(),children:[(0,s.jsx)("div",{className:"flex justify-center pt-3 pb-1 lg:hidden",children:(0,s.jsx)("div",{className:"w-12 h-1.5 bg-white/20 rounded-full"})}),(0,s.jsxs)("div",{className:"px-5 sm:px-6 py-4 flex items-start justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"w-10 h-10 rounded-lg border border-white/10 bg-white/[0.06] flex items-center justify-center",children:(0,s.jsx)(Z,{className:"w-5 h-5 text-white/70"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{id:"videofy-panel-title",className:"text-lg font-semibold text-white",children:B("viewer.videofy.title","Videofy")}),(0,s.jsx)("p",{className:"text-sm text-[--muted]",children:B("viewer.videofy.subtitle.v2","Animate this frame")})]})]}),(0,s.jsx)("button",{type:"button",onClick:i,className:"p-2 hover:bg-white/10 rounded-lg motion-safe:transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40","aria-label":B("common.close","Close"),children:(0,s.jsx)(Y,{className:"w-5 h-5 text-white/60"})})]}),(0,s.jsxs)("div",{ref:tf,className:"px-5 sm:px-6 pb-[max(2rem,env(safe-area-inset-bottom))] overflow-y-auto scrollbar-thin max-h-[65vh] lg:max-h-[60vh]",children:[eu&&(0,s.jsxs)("div",{className:"mb-4 p-4 bg-red-500/10 border border-red-500/20 rounded-lg flex items-start gap-3",children:[(0,s.jsx)("div",{className:"w-8 h-8 rounded-lg bg-red-500/20 flex items-center justify-center flex-shrink-0",children:(0,s.jsx)(ee,{className:"w-4 h-4 text-red-400"})}),(0,s.jsx)("div",{className:"pt-1",children:em?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-sm text-red-400 font-medium",children:B("viewer.videofy.error.".concat(em,".message"),eu)}),(0,s.jsx)("p",{className:"text-sm text-red-400/70 mt-1",children:B("viewer.videofy.error.".concat(em,".hint"),"")})]}):(0,s.jsx)("p",{className:"text-sm text-red-400",children:eu})})]}),!_||tE||ed||eu?(0,s.jsx)(Q,{t:B,isGenerating:tE,hasProgress:!!eh,canonicalStatus:ex,estimatedSecondsRemaining:ef,isBatchGenerating:ed,batchProgress:ec}):(0,s.jsxs)("div",{className:"my-8 flex flex-col items-center justify-center gap-3 text-center",role:"status","aria-live":"polite",children:[(0,s.jsx)("div",{className:"w-8 h-8 border-2 border-white/20 border-t-white/70 rounded-full animate-spin","aria-hidden":"true"}),(0,s.jsx)("p",{className:"text-sm text-white/70",children:B("viewer.videofy.checkingStatus","Checking your video status…")})]}),(0,s.jsxs)("div",{className:"lg:grid lg:grid-cols-2 lg:gap-x-6",children:[(0,s.jsx)("div",{children:(0,s.jsx)(L,{t:B,model:ey,setModel:eM,mode:eC,setMode:eA,modeOverrides:eU.overrides,modelOverrides:eQ.config.overrides,availableModeModelIds:eQ.availableModeModelIds,modelConfig:eY,resolution:eO,setResolution:eq,duration:eR,setDuration:eE,userTier:W,isAnyGenerating:tI})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(R,{t:B,modelConfig:eY,hasNextFrame:A,useNextFrameAsEnding:eF,setUseNextFrameAsEnding:ez,generateAudio:eL,setGenerateAudio:eS,dialogMode:eI,setDialogMode:eD,cameraMotion:eG,setCameraMotion:eH,pacing:eV,setPacing:eW,customDirective:eP,setCustomDirective:e_,negativePrompt:eB,setNegativePrompt:eT,isAnyGenerating:tI}),(0,s.jsx)(ei,{t:B,costExplanation:tb,estimatedCost:tg,hasEnoughCredits:tp,videoSeconds:O,creditPercentage:tw})]})]}),(0,s.jsx)(er.b,{storyId:d,frameNumber:tN,disabled:tI,scope:"video",actionOverrideActive:eP.trim().length>0}),!(_&&!tE&&!ed)&&(0,s.jsx)(es,{t:B,isGenerating:tE,isBatchGenerating:ed,hasEnoughCredits:tp&&!(ea&&!tE),hasEnoughForBatch:tz,batchNodeCount:tS.length,batchCost:tF,onGenerate:tD,onBatchGenerate:tT,onAbort:tA}),(0,s.jsx)(V,{t:B,locale:T,modelConfig:eY,model:ey,nodeId:g,motionRefRevisions:tn,loadingMotionRefRevisions:tl,motionRefRevisionIds:ti,setMotionRefRevisionIds:ts,motionRefExpanded:tr,setMotionRefExpanded:to,motionRefPanelFramePosition:tc,revisions:eZ,loadingRevisions:eX,setPreviewRevision:e2,recentFailures:e7,retryingJobId:e6,retryError:te,onRetryWithModel:tL})]})]})}),(0,s.jsx)(M.ConfirmDialog,{open:tm,onConfirm:tG,onCancel:tH,title:B("videofy.confirmTitle","Start video generation?"),description:B("videofy.confirmBody","This will use {credits} credits.").replace("{credits}",String(tV)),confirmLabel:B("common.continue","Continue"),cancelLabel:B("common.cancel","Cancel")})]}):null}}}]);

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.