1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,151742,e=>{"use strict";let t=(0,e.i(360229).default)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["default",()=>t])},979985,e=>{"use strict";var t=e.i(605821);e.s(["Clock",()=>t.default])},281020,e=>{"use strict";var t=e.i(658457),i=e.i(487486),a=e.i(975157),s=e.i(696191),r=e.i(979985),l=e.i(230245),n=e.i(151742),n=n;let o={pending:{label:"Pending",icon:(0,t.jsx)(r.Clock,{className:"h-3 w-3"}),variant:"secondary",className:"bg-gray-100 text-gray-700"},processing:{label:"Processing",icon:(0,t.jsx)(l.Loader2,{className:"h-3 w-3 animate-spin"}),variant:"default",className:"bg-blue-100 text-blue-700"},completed:{label:"Completed",icon:(0,t.jsx)(s.CheckCircle2,{className:"h-3 w-3"}),variant:"outline",className:"bg-green-100 text-green-700"},failed:{label:"Failed",icon:(0,t.jsx)(n.default,{className:"h-3 w-3"}),variant:"destructive",className:"bg-red-100 text-red-700"}};function d({status:e,className:s}){let r=o[e];return(0,t.jsxs)(i.Badge,{variant:r.variant,className:(0,a.cn)("flex items-center gap-1.5",r.className,s),children:[r.icon,(0,t.jsx)("span",{children:r.label})]})}e.s(["VideoStatusBadge",()=>d],281020)},367692,e=>{"use strict";var t=e.i(658457),i=e.i(481554),a=e.i(527069),s=e.i(291967),r=e.i(806148),l=e.i(669122),n=e.i(892857),o=e.i(887996),d=e.i(842728),c=e.i(729085),u=e.i(645579),m=e.i(735146),h=["PageUp","PageDown"],p=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],f={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},v="Slider",[x,g,b]=(0,m.createCollection)(v),[j,w]=(0,l.createContextScope)(v,[b]),[y,N]=j(v),S=i.forwardRef((e,r)=>{let{name:l,min:o=0,max:d=100,step:c=1,orientation:u="horizontal",disabled:m=!1,minStepsBetweenThumbs:f=0,defaultValue:v=[o],value:g,onValueChange:b=()=>{},onValueCommit:j=()=>{},inverted:w=!1,form:N,...S}=e,k=i.useRef(new Set),D=i.useRef(0),E="horizontal"===u,[A=[],P]=(0,n.useControllableState)({prop:g,defaultProp:v,onChange:e=>{let t=[...k.current];t[D.current]?.focus(),b(e)}}),T=i.useRef(A);function R(e,t,{commit:i}={commit:!1}){let s,r=(String(c).split(".")[1]||"").length,l=Math.round((Math.round((e-o)/c)*c+o)*(s=Math.pow(10,r)))/s,n=(0,a.clamp)(l,[o,d]);P((e=[])=>{let a=function(e=[],t,i){let a=[...e];return a[i]=t,a.sort((e,t)=>e-t)}(e,n,t);if(!function(e,t){if(t>0)return Math.min(...e.slice(0,-1).map((t,i)=>e[i+1]-t))>=t;return!0}(a,f*c))return e;{D.current=a.indexOf(n);let t=String(a)!==String(e);return t&&i&&j(a),t?a:e}})}return(0,t.jsx)(y,{scope:e.__scopeSlider,name:l,disabled:m,min:o,max:d,valueIndexToChangeRef:D,thumbs:k.current,values:A,orientation:u,form:N,children:(0,t.jsx)(x.Provider,{scope:e.__scopeSlider,children:(0,t.jsx)(x.Slot,{scope:e.__scopeSlider,children:(0,t.jsx)(E?C:M,{"aria-disabled":m,"data-disabled":m?"":void 0,...S,ref:r,onPointerDown:(0,s.composeEventHandlers)(S.onPointerDown,()=>{m||(T.current=A)}),min:o,max:d,inverted:w,onSlideStart:m?void 0:function(e){let t=function(e,t){if(1===e.length)return 0;let i=e.map(e=>Math.abs(e-t)),a=Math.min(...i);return i.indexOf(a)}(A,e);R(e,t)},onSlideMove:m?void 0:function(e){R(e,D.current)},onSlideEnd:m?void 0:function(){let e=T.current[D.current];A[D.current]!==e&&j(A)},onHomeKeyDown:()=>!m&&R(o,0,{commit:!0}),onEndKeyDown:()=>!m&&R(d,A.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!m){let i=h.includes(e.key)||e.shiftKey&&p.includes(e.key),a=D.current;R(A[a]+c*(i?10:1)*t,a,{commit:!0})}}})})})})});S.displayName=v;var[k,D]=j(v,{startEdge:"left",endEdge:"right",size:"width",direction:1}),C=i.forwardRef((e,a)=>{let{min:s,max:l,dir:n,inverted:d,onSlideStart:c,onSlideMove:u,onSlideEnd:m,onStepKeyDown:h,...p}=e,[v,x]=i.useState(null),g=(0,r.useComposedRefs)(a,e=>x(e)),b=i.useRef(void 0),j=(0,o.useDirection)(n),w="ltr"===j,y=w&&!d||!w&&d;function N(e){let t=b.current||v.getBoundingClientRect(),i=L([0,t.width],y?[s,l]:[l,s]);return b.current=t,i(e-t.left)}return(0,t.jsx)(k,{scope:e.__scopeSlider,startEdge:y?"left":"right",endEdge:y?"right":"left",direction:y?1:-1,size:"width",children:(0,t.jsx)(E,{dir:j,"data-orientation":"horizontal",...p,ref:g,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{let t=N(e.clientX);c?.(t)},onSlideMove:e=>{let t=N(e.clientX);u?.(t)},onSlideEnd:()=>{b.current=void 0,m?.()},onStepKeyDown:e=>
1{let t=f[y?"from-left":"from-right"].includes(e.key);h?.({event:e,direction:t?-1:1})}})})}),M=i.forwardRef((e,a)=>{let{min:s,max:l,inverted:n,onSlideStart:o,onSlideMove:d,onSlideEnd:c,onStepKeyDown:u,...m}=e,h=i.useRef(null),p=(0,r.useComposedRefs)(a,h),v=i.useRef(void 0),x=!n;function g(e){let t=v.current||h.current.getBoundingClientRect(),i=L([0,t.height],x?[l,s]:[s,l]);return v.current=t,i(e-t.top)}return(0,t.jsx)(k,{scope:e.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:(0,t.jsx)(E,{"data-orientation":"vertical",...m,ref:p,style:{...m.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{let t=g(e.clientY);o?.(t)},onSlideMove:e=>{let t=g(e.clientY);d?.(t)},onSlideEnd:()=>{v.current=void 0,c?.()},onStepKeyDown:e=>{let t=f[x?"from-bottom":"from-top"].includes(e.key);u?.({event:e,direction:t?-1:1})}})})}),E=i.forwardRef((e,i)=>{let{__scopeSlider:a,onSlideStart:r,onSlideMove:l,onSlideEnd:n,onHomeKeyDown:o,onEndKeyDown:d,onStepKeyDown:c,...m}=e,f=N(v,a);return(0,t.jsx)(u.Primitive.span,{...m,ref:i,onKeyDown:(0,s.composeEventHandlers)(e.onKeyDown,e=>{"Home"===e.key?(o(e),e.preventDefault()):"End"===e.key?(d(e),e.preventDefault()):h.concat(p).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:(0,s.composeEventHandlers)(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),f.thumbs.has(t)?t.focus():r(e)}
1),onPointerMove:(0,s.composeEventHandlers)(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&l(e)}),onPointerUp:(0,s.composeEventHandlers)(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),n(e))})})}),A="SliderTrack",P=i.forwardRef((e,i)=>{let{__scopeSlider:a,...s}=e,r=N(A,a);return(0,t.jsx)(u.Primitive.span,{"data-disabled":r.disabled?"":void 0,"data-orientation":r.orientation,...s,ref:i})});P.displayName=A;var T="SliderRange",R=i.forwardRef((e,a)=>{let{__scopeSlider:s,...l}=e,n=N(T,s),o=D(T,s),d=i.useRef(null),c=(0,r.useComposedRefs)(a,d),m=n.values.length,h=n.values.map(e=>O(e,n.min,n.max)),p=m>1?Math.min(...h):0,f=100-Math.max(...h);return(0,t.jsx)(u.Primitive.span,{"data-orientation":n.orientation,"data-disabled":n.disabled?"":void 0,...l,ref:c,style:{...e.style,[o.startEdge]:p+"%",[o.endEdge]:f+"%"}})});R.displayName=T;var z="SliderThumb",V=i.forwardRef((e,a)=>{let s=g(e.__scopeSlider),[l,n]=i.useState(null),o=(0,r.useComposedRefs)(a,e=>n(e)),d=i.useMemo(()=>l?s().findIndex(e=>e.ref.current===l):-1,[s,l]);return(0,t.jsx)(I,{...e,ref:o,index:d})}),I=i.forwardRef((e,a)=>{var l,n,o,d,m;let h,p,{__scopeSlider:f,index:v,name:g,...b}=e,j=N(z,f),w=D(z,f),[y,S]=i.useState(null),k=(0,r.useComposedRefs)(a,e=>S(e)),C=!y||j.form||!!y.closest("form"),M=(0,c.useSize)(y),E=j.values[v],A=void 0===E?0:O(E,j.min,j.max),P=(l=v,(n=j.values.length)>2?`Value ${l+1} of ${n}`:2===n?["Minimum","Maximum"][l]:void 0),T=M?.[w.size],R=T?(o=T,d=A,m=w.direction,p=L([0,50],[0,h=o/2]),(h-p(d)*m)*m):0;return i.useEffect(()=>{if(y)return j.thumbs.add(y),()=>{j.thumbs.delete(y)}},[y,j.thumbs]),(0,t.jsxs)("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[w.startEdge]:`calc(${A}% + ${R}px)`},children:[(0,t.jsx)(x.ItemSlot,{scope:e.__scopeSlider,children:(0,t.jsx)(u.Primitive.span,{role:"slider","aria-label":e["aria-label"]||P,"aria-valuemin":j.min,"aria-valuenow":E,"aria-valuemax":j.max,"aria-orientation":j.orientation,"data-orientation":j.orientation,"data-disabled":j.disabled?"":void 0,tabIndex:j.disabled?void 0:0,...b,ref:k,style:void 0===E?{display:"none"}:e.style,onFocus:(0,s.composeEventHandlers)(e.onFocus,()=>{j.valueIndexToChangeRef.current=v})})}),C&&(0,t.jsx)(_,{name:g??(j.name?j.name+(j.values.length>1?"[]":""):void 0),form:j.form,value:E},v)]})});V.displayName=z;var _=i.forwardRef(({__scopeSlider:e,value:a,...s},l)=>{let n=i.useRef(null),o=(0,r.useComposedRefs)(n,l),c=(0,d.usePrevious)(a);return i.useEffect(()=>{let e=n.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set;if(c!==a&&t){let i=new Event("input",{bubbles:!0});t.call(e,a),e.dispatchEvent(i)}},[c,a]),(0,t.jsx)(u.Primitive.input,{style:{display:"none"},...s,ref:o,defaultValue:a})});function O(e,t,i){return(0,a.clamp)(100/(i-t)*(e-t),[0,100])}function L(e,t){return i=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let a=(t[1]-t[0])/(e[1]-e[0]);return t[0]+a*(i-e[0])}}_.displayName="RadioBubbleInput";var H=e.i(975157);function B({className:e,defaultValue:a,value:s,min:r=0,max:l=100,...n}){let o=i.useMemo(()=>Array.isArray(s)?s:Array.isArray(a)?a:[r,l],[s,a,r,l]);return(0,t.jsxs)(S,{"data-slot":"slider",defaultValue:a,value:s,min:r,max:l,className:(0,H.cn)("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...n,children:[(0,t.jsx)(P,{"data-slot":"slider-track",className:(0,H.cn)("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:(0,t.jsx)(R,{"data-slot":"slider-range",className:(0,H.cn)("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:o.length},(e,i)=>(0,t.jsx)(V,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},i))]})}e.s(["Slider",()=>B],367692)},951535,e=>{"use strict";let t=(0,e.i(360229).default)("Maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]);e.s(["default",()=>t])},223206,e=>{"use strict";var t=e.i(951535);e.s(["Maximize",()=>t.default])},994426,e=>{"use strict";let t=(0,e.i(360229).default)("Minimize",[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]]);e.s(["default",()=>t])},122689,e=>{"use strict";var t=e.i(994426);e.s(["Minimize",()=>t.default])},138321,e=>{"use strict";let t=(0,e.i(360229).default)("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);e.s(["default",()=>t])},898591,e=>{"use strict";var t=e.i(138321);e.s(["Pause",()=>t.default])},472520,e=>{"use strict";let t=(0,e.i(360229).default)("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["default",()=>t])},404638,e=>{"use strict";var t=e.i(472520);e.s(["RotateCcw",()=>t.default])},717904,e=>{"use strict";let t=(0,e.i(360229).default)("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);e.s(["default",()=>t])},876829,e=>{"use strict";var t=e.i(717904);e.s(["Volume2",()=>t.default])},963504,e=>{"use strict";let t=(0,e.i(360229).default)("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);e.s(["default",()=>t])},623020,296410,908406,719735,e=>{"use strict";var t=e.i(658457),i=e.i(473536),a=e.i(868499),s=e.i(519455),r=e.i(624687),l=e.i(515288),n=e.i(367692),o=e.i(975157),d=e.i(861475),c=e.i(223206),u=e.i(122689),m=e.i(898591),h=e.i(130867),p=e.i(404638),f=e.i(876829),v=e.i(963504),v=v,x=e.i(481554);function g({videoUrl:e,thumbnailUrl:i,className:a,autoPlay:r=!1,loop:g=!1,controls:b=!0}){let j=(0,x.useRef)(null),[w,y]=(0,x.useState)(r),[N,S]=(0,x.useState)(!1),[k,D]=(0,x.useState)(1),[C,M]=(0,x.useState)(0),[E,A]=(0,x.useState)(0),[P,T]=(0,x.useState)(!1),R=()=>{j.current&&(w?j.current.pause():j.current.play(),y(!w))};(0,x.useEffect)(()=>{let e=j.current;if(!e)return;let t=()=>M(e.currentTime),i=()=>A(e.duration),a=()=>y(!1);return e.addEventListener("timeupdate",t),e.addEventListener("loadedmetadata",i),e.addEventListener("ended",a),()=>{e.removeEventListener("timeupdate",t),e.removeEventListener("loadedmetadata",i),e.removeEventListener("ended",a)}},[]);let z=e=>{let t=Math.floor(e/60),i=Math.floor(e%60);return`${t}:${i.toString().padStart(2,"0")}`};return(0,t.jsx)(l.Card,{className:(0,o.cn)("overflow-hidden",a),children:(0,t.jsxs)("div",{className:"relative group",children:[(0,t.jsx)("video",{ref:j,src:e,poster:i,loop:g,className:"w-full aspect-video bg-black",onClick:R}),b&&(0,t.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 to-transparent p-4 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,t.jsx)(n.Slider,{value:[C],onValueChange:e=>{let t=e[0];M(t),j.current&&(j.current.currentTime=t)},max:E||100,step:.1,className:"mb-3"}),(0,t.jsxs)("div",{className:"flex items-center justify-between text-white",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(s.Button,{variant:"ghost",size:"icon",onClick:R,className:"text-white hover:bg-white/20",children:w?(0,t.jsx)(m.Pause,{className:"h-5 w-5"}):(0,t.jsx)(h.Play,{className:"h-5 w-5"})}),(0,t.jsx)(s.Button,{variant:"ghost",size:"icon",onClick:()=>{j.current&&(j.current.currentTime=0,j.current.play(),y(!0))},className:"text-white hover:bg-white/20",children:(0,t.jsx)(p.RotateCcw,{className:"h-4 w-4"})}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(s.Button,{variant:"ghost",size:"icon",onClick:()=>{j.current&&(j.current.muted=!N,S(!N))},className:"text-white hover:bg-white/20",children:N||0===k?(0,t.jsx)(v.default,{className:"h-4 w-4"}):(0,t.jsx)(f.Volume2,{className:"h-4 w-4"})}),(0,t.jsx)(n.Slider,{value:[N?0:k],onValueChange:e=>{let t=e[0];D(t),j.current&&(j.current.volume=t,0===t?S(!0):N&&S(!1))}
1,max:1,step:.01,className:"w-20"})]}),(0,t.jsxs)("span",{className:"text-sm",children:[z(C)," / ",z(E)]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(s.Button,{variant:"ghost",size:"icon",onClick:()=>{let t=document.createElement("a");t.href=e,t.download=`video-${Date.now()}.mp4`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},className:"text-white hover:bg-white/20",children:(0,t.jsx)(d.Download,{className:"h-4 w-4"})}),(0,t.jsx)(s.Button,{variant:"ghost",size:"icon",onClick:()=>{document.fullscreenElement?(document.exitFullscreen(),T(!1)):(j.current?.requestFullscreen(),T(!0))},className:"text-white hover:bg-white/20",children:P?(0,t.jsx)(u.Minimize,{className:"h-4 w-4"}):(0,t.jsx)(c.Maximize,{className:"h-4 w-4"})})]})]})]})]})})}e.s(["VideoPlayer",()=>g],296410);var b=e.i(281020),j=e.i(669122),w=e.i(645579),y="Progress",[N,S]=(0,j.createContextScope)(y),[k,D]=N(y),C=x.forwardRef((e,i)=>{var a,s;let{__scopeProgress:r,value:l=null,max:n,getValueLabel:o=A,...d}=e;(n||0===n)&&!R(n)&&console.error((a=`${n}`,`Invalid prop \`max\` of value \`${a}\` supplied to \`Progress\`. Only numbers greater than 0 are valid max values. Defaulting to \`100\`.`));let c=R(n)?n:100;null===l||z(l,c)||console.error((s=`${l}`,`Invalid prop \`value\` of value \`${s}\` supplied to \`Progress\`. The \`value\` prop must be: 2 - a positive number 3 - less than the value passed to \`max\` (or 100 if no \`max\` prop is set) 4 - \`null\` or \`undefined\` if the progress is indeterminate. 5 6Defaulting to \`null\`.`));let u=z(l,c)?l:null,m=T(u)?o(u,c):void 0;return(0,t.jsx)(k,{scope:r,value:u,max:c,children:(0,t.jsx)(w.Primitive.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":T(u)?u:void 0,"aria-valuetext":m,role:"progressbar","data-state":P(u,c),"data-value":u??void 0,"data-max":c,...d,ref:i})})});C.displayName=y;var M="ProgressIndicator",E=x.forwardRef((e,i)=>{let{__scopeProgress:a,...s}=e,r=D(M,a);return(0,t.jsx)(w.Primitive.div,{"data-state":P(r.value,r.max),"data-value":r.value??void 0,"data-max":r.max,...s,ref:i})});function A(e,t){return`${Math.round(e/t*100)}%`}function P(e,t){return null==e?"indeterminate":e===t?"complete":"loading"}function T(e){return"number"==typeof e}function R(e){return T(e)&&!isNaN(e)&&e>0}function z(e,t){return T(e)&&!isNaN(e)&&e<=t&&e>=0}function V({className:e,value:i,...a}){return(0,t.jsx)(C,{"data-slot":"progress",className:(0,o.cn)("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",e),...a,children:(0,t.jsx)(E,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(i||0)}%)`}})})}E.displayName=M;var I=e.i(880749),_=e.i(230245);function O({model:e,progress:i,estimatedTimeLeft:a,className:s}){let r=I.VIDEO_MODELS[e];return(0,t.jsx)(l.Card,{className:(0,o.cn)("w-full",s),children:(0,t.jsx)(l.CardContent,{className:"pt-6",children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(_.Loader2,{className:"h-5 w-5 animate-spin text-primary"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"font-semibold",children:"Video is generating..."}),(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Using ",r?.name||e]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Progress"}),(0,t.jsxs)("span",{className:"font-medium",children:[Math.round(i),"%"]})]}),(0,t.jsx)(V,{value:i,className:"h-2"})]}),null!==a&&a>0&&(0,t.jsxs)("div",{className:"text-sm text-muted-foreground",children:[(0,t.jsx)("span",{children:"Estimated time remaining: "}),(0,t.jsxs)("span",{className:"font-medium text-foreground",children:[Math.ceil(a)," seconds"]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"This page will automatically refresh when the video is ready. Please don't close this page."})]})})})}var L=e.i(991776),H=e.i(699375);let B=0,U=new Map,$=e=>{if(U.has(e))return;let t=setTimeout(()=>{U.delete(e),X({type:"REMOVE_TOAST",toastId:e})},1e6);U.set(e,t)},F=[],K={toasts:[]};function X(e){K=((e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case"DISMISS_TOAST":{let{toastId:i}=t;
6return i?$(i):e.toasts.forEach(e=>{$(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===i||void 0===i?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===t.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}})(K,e),F.forEach(e=>{e(K)})}function q({...e}){let t=(B=(B+1)%Number.MAX_SAFE_INTEGER).toString(),i=()=>X({type:"DISMISS_TOAST",toastId:t});return X({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:e=>{e||i()}}}),{id:t,dismiss:i,update:e=>X({type:"UPDATE_TOAST",toast:{...e,id:t}})}}function G(){let[e,t]=x.useState(K);return x.useEffect(()=>(F.push(t),()=>{let e=F.indexOf(t);e>-1&&F.splice(e,1)}),[e]),{...e,toast:q,dismiss:e=>X({type:"DISMISS_TOAST",toastId:e})}}e.s(["useToast",()=>G],908406);var Y=e.i(937729),W=e.i(736761),J=e.i(46957);function Q({videoId:e,isPublic:i,onVisibilityChange:a}){let[s,r]=(0,x.useState)(!1),{toast:l}=G(),n=(0,J.useTranslations)("Scene"),o=async t=>{if(!s){r(!0);try{let i=await (0,L.updateVideoVisibility)(e,t);i.success?(a?.(t),l({title:t?n("visibility.publicSuccess"):n("visibility.privateSuccess"),description:t?n("visibility.publicDescription"):n("visibility.privateDescription"),variant:"default"})):l({title:n("visibility.updateFailed"),description:i.error||n("visibility.updateError"),variant:"destructive"})}catch(e){console.error("Failed to update video visibility:",e),l({title:n("visibility.updateFailed"),description:n("visibility.unknownError"),variant:"destructive"})}finally{r(!1)}}};return(0,t.jsxs)("div",{className:"flex items-center justify-between rounded-lg border p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[i?(0,t.jsx)(Y.Globe,{className:"h-4 w-4 text-green-600"}):(0,t.jsx)(W.Lock,{className:"h-4 w-4 text-orange-600"}),(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:i?n("visibility.public"):n("visibility.private")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:i?n("visibility.publicHint"):n("visibility.privateHint")})]})]}),s?(0,t.jsx)(_.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"}):(0,t.jsx)(H.Switch,{checked:i,onCheckedChange:o,"aria-label":"Toggle video visibility"})]})}var Z=e.i(341093),ee=e.i(99309);e.s(["RefreshCw",()=>ee.default],719735);var ee=ee,et=e.i(429110),ei=e.i(898760),ea=e.i(637667),es=e.i(236772);function er({video:e,progress:l=0,estimatedTimeLeft:n=0,onRefresh:o,isOwner:c=!1,onVisibilityChange:u,onDeleteSuccess:m}){let h=(0,J.useTranslations)("Scene"),[p,f]=(0,x.useState)(!1),[v,j]=(0,x.useState)(!1),w=I.VIDEO_MODELS[e.model],y="completed"===e.status,N="pending"===e.status||"processing"===e.status,S="failed"===e.status,k=window.location.origin+`/video/${e.id}`,D=e.prompt||"AI Generated Video",C=async()=>{if(!v){j(!0);try{let t=await (0,i.deleteVideo)(e.id);t.success?(ea.toast.success(h("common.deleteSuccess")||"Video deleted successfully"),m&&m(e.id)):ea.toast.error(t.error||"Failed to delete video")}catch(e){console.error("Failed to delete video:",e),ea.toast.error("Failed to delete video")}finally{j(!1)}}};return(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-3 lg:gap-8",children:[(0,t.jsx)("div",{className:"lg:col-span-2 space-y-4",children:(0,t.jsxs)("div",{className:"rounded-lg border bg-card p-6 shadow-sm",children:[(0,t.jsxs)("div",{className:"mb-4 flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold",children:"Generated Result"}),(0,t.jsx)(b.VideoStatusBadge,{status:e.status})]}),o&&(0,t.jsx)(s.Button,{onClick:o,variant:"ghost",size:"icon",title:"Refresh status",children:(0,t.jsx)(ee.default,{className:`h-4 w-4 ${N?"animate-spin":""}`})})]}),(0,t.jsx)("div",{className:"overflow-hidden rounded-lg border bg-muted/50 min-h-[300px] flex items-center justify-center bg-black/5",children:N?(0,t.jsx)("div",{className:"w-full p-8",children:(0,t.jsx)(O,{model:e.model,progress:l,estimatedTimeLeft:n})}):y&&e.videoUrl?(0,t.jsx)(g,{videoUrl:e.videoUrl,thumbnailUrl:e.thumbnailUrl||void 0,autoPlay:!1,loop:!0,className:"w-full h-full object-contain max-h-[60vh]"}):S?(0,t.jsxs)("div",{className:"text-center p-8 space-y-4",children:[(0,t.jsx)("p",{className:"text-red-500 font-semibold",children:"Video generation failed"}),e.errorMessage&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e.errorMessage})]}):null})]})}),(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"rounded-lg border bg-card shadow-sm",children:[(0,t.jsx)("div",{className:"p-6 pb-3",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h3",{className:"flex items-center gap-2 text-lg font-semibold",children:"ð¬ Prompt"}),(0,t.jsxs)(s.Button,{variant:"outline",size:"sm",onClick:()=>{navigator.clipboard.writeText(e.prompt),f(!0),ea.toast.success("Prompt copied"),setTimeout(()=>f(!1),2e3)},className:"h-8 px-2",children:[(0,t.jsx)(Z.Copy,{className:"h-3 w-3"}),p?"Copied":"Copy"]})]})}),(0,t.jsx)("div",{className:"px-6 pb-6",children:(0,t.jsx)(r.Textarea,{value:e.prompt,readOnly:!0,className:"max-h-[150px] resize-none cursor-text focus:ring-0 focus:ring-offset-0 bg-muted/30"})})]}),(0,t.jsxs)("div",{className:"rounded-lg border bg-card shadow-sm p-6 space-y-4",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold border-b pb-2",children:"Details"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground block mb-1",children:"Model"}),(0,t.jsx)("span",{className:"font-medium",children:w?.name||e.model})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground block mb-1",children:"Duration"}),(0,t.jsxs)("span",{className:"font-medium",children:[e.duration,"s"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground block mb-1",children:"Aspect Ratio"}),(0,t.jsx)("span",{className:"font-medium",children:e.aspectRatio})]}),e.resolution&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground block mb-1",children:"Resolution"}),(0,t.jsx)("span",{className:"font-medium",children:e.resolution})]})]})]}),c&&y&&(0,t.jsx)(Q,{videoId:e.id,isPublic:e.isPublic??!1,onVisibilityChange:u}),y&&e.videoUrl&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)(s.Button,{className:"w-full",size:"lg",onClick:()=>{let t=document.createElement("a");t.href=e.videoUrl,t.download=`video-${e.id}.mp4`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},children:[(0,t.jsx)(d.Download,{className:"mr-2 h-4 w-4"}),"Download Video"]}),(0,t.jsxs)(s.Button,{className:"w-full",size:"lg",variant:"outline",onClick:()=>{window.location.href=`/video?remix_id=${e.id}`},children:[(0,t.jsx)(ei.Wand2,{className:"mr-2 h-4 w-4"}),"Make Same (Remix)"]}),(0,t.jsx)(es.default,{pageUrl:k,pageTitle:D,shareLabel:h("work.share")||"Share",linkCopiedText:h("work.linkCopied")||"Link copied!",compact:!0}),c&&(0,t.jsxs)(a.AlertDialog,{children:[(0,t.jsx)(a.AlertDialogTrigger,{asChild:!0,children:(0,t.jsxs)(s.Button,{variant:"ghost",size:"sm",className:"w-full text-destructive hover:text-destructive hover:bg-destructive/10",disabled:v,children:[(0,t.jsx)(et.Trash2,{className:"mr-2 h-4 w-4"}),v?"Deleting...":"Delete Video"]})}),(0,t.jsxs)(a.AlertDialogContent,{children:[(0,t.jsxs)(a.AlertDialogHeader,{children:[(0,t.jsx)(a.AlertDialogTitle,{children:"Delete Video"}),(0,t.jsx)(a.AlertDialogDescription,{children:"Are you sure you want to delete this video? This action cannot be undone."})]}),(0,t.jsxs)(a.AlertDialogFooter,{children:[(0,t.jsx)(a.AlertDialogCancel,{children:"Cancel"}),(0,t.jsx)(a.AlertDialogAction,{onClick:e=>{e.preventDefault(),C()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:v?"Deleting...":"Delete"})]})]})]})]})]})]})}e.s(["VideoDetailContent",()=>er],623020)}]);
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.