1import{o as _e}from"./rolldown-runtime-ChpBd9eV.js";import{$n as Pe,Ci as q,Dt as xe,Ei as ze,Fi as m,La as Be,Lt as He,Ma as qe,Na as Xe,Ni as u,On as he,Sr as d,St as me,T as Oe,Ta as Ye,Ti as j,Yn as v,_i as Ge,_r as We,at as Ke,bi as Ze,bn as X,da as p,fn as Je,ft as Qe,g as et,gi as O,gn as tt,ha as N,ja as st,ji as at,mi as Y,mn as lt,mt as pe,pt as rt,qt as fe,tt as be,vi as it,vt as ge,xi as ot}from"./chat-page-evUfHQgD.js";import{Vr as nt}from"./community-page-CrngAMw5.js";import{At as ct,St as dt,_t as ut,bt as xt,kt as ht,l as mt,zt as pt}from"./education-page-vD6yUpCZ.js";import{u as ft}from"./icons-vendor-Td9zWZcy.js";import{_ as bt}from"./dashboard-page-CleTLBe1.js";var a=_e(Be(),1),e=Ye(),r={DEFAULT:"default",THEATER:"theater",FULLSCREEN:"fullscreen"},yt=()=>{const{videoId:o}=Xe(),U=qe(),G=st(),{user:c}=We(),[l,W]=(0,a.useState)(G.state?.videoData||null),[we,K]=(0,a.useState)(!G.state?.videoData),[Z,J]=(0,a.useState)(null),[i,f]=(0,a.useState)(r.DEFAULT),[b,Q]=(0,a.useState)(!1),[T,je]=(0,a.useState)(0),[g,ve]=(0,a.useState)(0),[S,ee]=(0,a.useState)(1),[w,F]=(0,a.useState)(!1),[te,Ne]=(0,a.useState)(1),[se,V]=(0,a.useState)(!0),[ke,ae]=(0,a.useState)(!1),[le,re]=(0,a.useState)(!1),[ye,Ee]=(0,a.useState)(0),[k,R]=(0,a.useState)(!1),[$,C]=(0,a.useState)(!1),[L,ie]=(0,a.useState)(!1),[I,Te]=(0,a.useState)(!1),[Se,y]=(0,a.useState)(!1),[x,Fe]=(0,a.useState)([]),n=(0,a.useRef)(null),_=(0,a.useRef)(null),P=(0,a.useRef)(null),z=(0,a.useRef)(null),Re=(0,a.useMemo)(()=>{if(!l)return!1;const t=l.videoUrl||l.url||"";return t.includes("youtube.com")||t.includes("youtu.be")},[l]),$e=(0,a.useMemo)(()=>{if(!l)return null;const t=l.videoUrl||l.url||"";for(const s of[/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([^&\s?]+)/,/^([a-zA-Z0-9_-]{11})$/]){const h=t.match(s);if(h)return h[1]}return null},[l]);(0,a.useEffect)(()=>{l?j(u(d,"videos",o),{views:m(1)}).catch(()=>{}):(async()=>{if(o)try{K(!0);const s=await O(u(d,"videos",o));s.exists()?(W({id:s.id,...s.data()}),await j(u(d,"videos",o),{views:m(1)})):J("Video not found")}catch(s){console.error("Error fetching video:",s),J("Failed to load video")}finally{K(!1)}})()},[o,l]),(0,a.useEffect)(()=>{(async()=>{if(l)try{Fe((await Ge(ot(at(d,"videos"),ze("category","==",l.category||"Trading"),Ze("views","desc"),it(12)))).docs.map(s=>({id:s.id,...s.data()})).filter(s=>s.id!==o))}catch(s){console.error("Error fetching related:",s)}})()},[l,o]),(0,a.useEffect)(()=>{(async()=>{if(!(!c?.uid||!o))try{const[s,h]=await Promise.all([O(u(d,"videoLikes",`${c.uid}_${o}`)),O(u(d,"videoBookmarks",`${c.uid}_${o}`))]);if(s.exists()){const E=s.data();R(E.type==="like"),C(E.type==="dislike")}ie(h.exists())}catch(s){console.error("Error checking interactions:",s)}})()},[c,o]),(0,a.useEffect)(()=>{const t=s=>{if(!(s.target.tagName==="INPUT"||s.target.tagName==="TEXTAREA"))switch(s.key.toLowerCase()){case" ":case"k":s.preventDefault(),D();break;case"f":s.preventDefault(),M();break;case"t":s.preventDefault(),B();break;case"m":s.preventDefault(),oe();break;case"arrowleft":s.preventDefault(),A(-10);break;case"arrowright":s.preventDefault(),A(10);break;case"arrowup":s.preventDefault(),ne(.1);break;case"arrowdown":s.preventDefault(),ne(-.1);break;case"escape":(i===r.FULLSCREEN||i===r.THEATER)&&f(r.DEFAULT);break}};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[i]);const Ce=(0,a.useCallback)(()=>{V(!0),P.current&&clearTimeout(P.current),b&&(P.current=setTimeout(()=>{V(!1)},3e3))},[b]),D=(0,a.useCallback)(()=>{n.current&&(b?n.current.pause():n.current.play())},[b]),oe=(0,a.useCallback)(()=>{n.current&&(n.current.muted=!w,F(!w))},[w]),ne=(0,a.useCallback)(t=>{const s=Math.max(0,Math.min(1,S+t));ee(s),n.current&&(n.current.volume=s),s===0?F(!0):w&&F(!1)},[S,w]),A=(0,a.useCallback)(t=>{n.current&&(n.current.currentTime=Math.max(0,Math.min(g,T+t)))},[T,g]),Le=(0,a.useCallback)(t=>{if(!z.current||!n.current)return;const s=z.current.getBoundingClientRect(),h=(t.clientX-s.left)/s.width;n.current.currentTime=h*g},[g]),De=(0,a.useCallback)(t=>{Ne(t),n.current&&(n.current.playbackRate=t),re(!1)},[]),M=(0,a.useCallback)(()=>{i===r.FULLSCREEN?(document.exitFullscreen&&document.exitFullscreen(),f(r.DEFAULT)):(_.current?.requestFullscreen&&_.current.requestFullscreen(),f(r.FULLSCREEN))},[i]),B=(0,a.useCallback)(()=>{f(t=>t===r.THEATER?r.DEFAULT:r.THEATER)},[]);(0,a.useEffect)(()=>{const t=()=>{!document.fullscreenElement&&i===r.FULLSCREEN&&f(r.DEFAULT)};return document.addEventListener("fullscreenchange",t),()=>document.removeEventListener("fullscreenchange",t)},[i]);const Ae=async()=>
1{if(!c?.uid)return;const t=u(d,"videoLikes",`${c.uid}_${o}`);try{k?(await Y(t),await j(u(d,"videos",o),{likes:m(-1)}),R(!1)):(await q(t,{type:"like",userId:c.uid,videoId:o,createdAt:new Date}),await j(u(d,"videos",o),{likes:m(1),...$?{dislikes:m(-1)}:{}}),R(!0),C(!1)),W(s=>({...s,likes:(s.likes||0)+(k?-1:1)}))}catch(s){console.error("Error liking:",s)}},Me=async()=>{if(!c?.uid)return;const t=u(d,"videoLikes",`${c.uid}_${o}`);try{$?(await Y(t),await j(u(d,"videos",o),{dislikes:m(-1)}),C(!1)):(await q(t,{type:"dislike",userId:c.uid,videoId:o,createdAt:new Date}),await j(u(d,"videos",o),{dislikes:m(1),...k?{likes:m(-1)}:{}}),C(!0),R(!1))}catch(s){console.error("Error disliking:",s)}},Ue=async()=>{if(!c?.uid)return;const t=u(d,"videoBookmarks",`${c.uid}_${o}`);try{L?await Y(t):await q(t,{userId:c.uid,videoId:o,videoData:{title:l.title,thumbnail:l.thumbnail,duration:l.duration},createdAt:new Date}),ie(!L)}catch(s){console.error("Error bookmarking:",s)}},ce=async()=>{const t=window.location.href;if(navigator.share)try{await navigator.share({title:l?.title,text:`Check out this video: ${l?.title}`,url:t})}catch(s){s.name!=="AbortError"&&y(!0)}else y(!0)},Ve=async()=>{try{await navigator.clipboard.writeText(window.location.href),y(!1)}catch(t){console.error("Failed to copy:",t)}},de=t=>{if(isNaN(t))return"0:00";const s=Math.floor(t/3600),h=Math.floor(t%3600/60),E=Math.floor(t%60);return s>0?`${s}:${h.toString().padStart(2,"0")}:${E.toString().padStart(2,"0")}`:`${h}:${E.toString().padStart(2,"0")}`},Ie=t=>t?(t?.toDate?t.toDate():new Date(t)).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"",H=t=>{U(`/education/video/${t.id}`,{state:{videoData:t}})};if(we)return(0,e.jsx)(Oe,{});if(Z||!l)return(0,e.jsx)("div",{className:"min-h-screen bg-black flex items-center justify-center",children:(0,e.jsxs)("div",{className:"text-center max-w-md",children:[(0,e.jsx)("div",{className:"w-20 h-20 bg-red-500/20 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,e.jsx)(be,{className:"w-10 h-10 text-red-400"})}),(0,e.jsx)("h2",{className:"text-2xl font-bold text-white mb-2",children:"Video Not Found"}),(0,e.jsx)("p",{className:"text-slate-400 mb-6",children:Z||"This video may have been removed or is unavailable."}),(0,e.jsx)("button",{onClick:()=>U(-1),className:"px-6 py-3 bg-purple-600 hover:bg-purple-700 text-white rounded-xl transition-colors",children:"Go Back"})]})});const ue=g>0?T/g*100:0;return(0,e.jsxs)("div",{className:`min-h-screen theme-page bg-[var(--bg-primary)] ${i===r.THEATER?"overflow-x-hidden":""}`,children:[(0,e.jsx)(N,{children:i===r.DEFAULT&&(0,e.jsx)(p.header,{initial:{y:-60,opacity:0},animate:{y:0,opacity:1},exit:{y:-60,opacity:0},className:"sticky top-0 z-50 bg-slate-950/95 backdrop-blur-xl border-b border-slate-800/50",children:(0,e.jsxs)("div",{className:"px-4 lg:px-6 py-3 flex items-center justify-between",children:[(0,e.jsxs)("button",{onClick:()=>U(-1),className:"flex items-center gap-2 text-slate-400 hover:text-white transition-colors",children:[(0,e.jsx)(he,{className:"w-5 h-5"}),(0,e.jsx)("span",{className:"hidden sm:inline font-medium",children:"Back"})]}),(0,e.jsx)("h1",{className:"text-base lg:text-lg font-semibold text-white truncate max-w-lg px-4 hidden md:block",children:l.title}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("button",{onClick:B,className:"p-2 hover:bg-slate-800 rounded-lg transition-colors group",title:"Theater Mode (T)",children:(0,e.jsx)(ut,{className:"w-5 h-5 text-slate-400 group-hover:text-purple-400"})}),(0,e.jsx)("button",{onClick:M,className:"p-2 hover:bg-slate-800 rounded-lg transition-colors group",title:"Fullscreen (F)",children:(0,e.jsx)(X,{className:"w-5 h-5 text-slate-400 group-hover:text-purple-400"})}),(0,e.jsx)("button",{onClick:ce,className:"p-2 hover:bg-slate-800 rounded-lg transition-colors",title:"Share",children:(0,e.jsx)(ge,{className:"w-5 h-5 text-slate-400"})})]})]})})}),(0,e.jsx)(N,{children:i===r.THEATER&&(0,e.jsx)(p.div,{initial:{opacity:0}
1,animate:{opacity:se?1:0},className:"fixed top-0 left-0 right-0 z-[60] bg-gradient-to-b from-black via-black/70 to-transparent px-6 transition-opacity duration-300",style:{paddingTop:"calc(env(safe-area-inset-top, 0px) + 1rem)",paddingBottom:"1rem"},children:(0,e.jsxs)("div",{className:"flex items-center justify-between max-w-[2000px] mx-auto",children:[(0,e.jsxs)("button",{onClick:()=>f(r.DEFAULT),className:"flex items-center gap-2 text-white/80 hover:text-white transition-colors",children:[(0,e.jsx)(he,{className:"w-5 h-5"}),(0,e.jsx)("span",{className:"font-medium",children:"Exit Theater"})]}),(0,e.jsx)("h1",{className:"text-lg font-semibold text-white truncate max-w-3xl px-4",children:l.title}),(0,e.jsx)("button",{onClick:M,className:"p-2 hover:bg-white/10 rounded-lg transition-colors",children:(0,e.jsx)(X,{className:"w-5 h-5 text-white"})})]})})}),(0,e.jsxs)("div",{className:i===r.THEATER?"":"px-0 lg:px-4 xl:px-6",children:[(0,e.jsxs)("div",{className:`flex flex-col ${i===r.DEFAULT?"xl:flex-row gap-6 max-w-[1920px] mx-auto":""}`,children:[(0,e.jsxs)("div",{className:i===r.DEFAULT?"flex-1 min-w-0":"w-full",children:[(0,e.jsx)("div",{ref:_,className:` 2 relative bg-black w-full 3 ${i===r.FULLSCREEN?"fixed inset-0 z-[100]":""} 4 ${i===r.THEATER?"":"lg:rounded-xl overflow-hidden"} 5 `,onMouseMove:Ce,onMouseLeave:()=>b&&V(!1),children:(0,e.jsx)("div",{className:` 6 relative w-full 7 ${i===r.FULLSCREEN?"h-screen":""} 8 ${i===r.THEATER?"h-[calc(100vh-120px)] min-h-[500px]":""} 9 ${i===r.DEFAULT?"aspect-video":""} 10 `,children:Re?(0,e.jsx)(et,{videoId:$e,title:l.title,className:"absolute inset-0 w-full h-full"}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("video",{ref:n,src:l.videoUrl||l.url,className:"absolute inset-0 w-full h-full object-contain bg-black",playsInline:!0,onClick:D,onTimeUpdate:t=>je(t.target.currentTime),onLoadedMetadata:t=>ve(t.target.duration),onProgress:t=>{t.target.buffered.length>0&&Ee(t.target.buffered.end(0)/t.target.duration*100)},onPlay:()=>Q(!0),onPause:()=>Q(!1)}),(0,e.jsx)(N,{children:se&&(0,e.jsxs)(p.div,{initial:{opacity:0}
10,animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 flex flex-col justify-between",children:[(0,e.jsx)("div",{className:"h-32 bg-gradient-to-b from-black/80 to-transparent"}),(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,e.jsx)(p.button,{whileHover:{scale:1.1},whileTap:{scale:.95},onClick:D,className:"w-20 h-20 lg:w-28 lg:h-28 bg-purple-600/90 backdrop-blur-sm rounded-full flex items-center justify-center shadow-2xl shadow-purple-500/30",children:b?(0,e.jsx)(xe,{className:"w-10 h-10 lg:w-14 lg:h-14 text-white"}):(0,e.jsx)(me,{className:"w-10 h-10 lg:w-14 lg:h-14 text-white ml-1"})})}),(0,e.jsxs)("div",{className:"bg-gradient-to-t from-black/90 via-black/70 to-transparent p-4 lg:p-6 xl:p-8",children:[(0,e.jsxs)("div",{ref:z,className:"relative h-1.5 lg:h-2 bg-white/20 rounded-full cursor-pointer group mb-4 lg:mb-6",onClick:Le,children:[(0,e.jsx)("div",{className:"absolute inset-y-0 left-0 bg-white/30 rounded-full transition-all",style:{width:`${ye}%`}}),(0,e.jsx)("div",{className:"absolute inset-y-0 left-0 bg-gradient-to-r from-purple-500 to-purple-400 rounded-full transition-all",style:{width:`${ue}%`}}),(0,e.jsx)("div",{className:"absolute top-1/2 -translate-y-1/2 w-4 h-4 lg:w-5 lg:h-5 bg-purple-500 rounded-full shadow-lg opacity-0 group-hover:opacity-100 transition-opacity",style:{left:`calc(${ue}% - 10px)`}})]}),(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 lg:gap-4",children:[(0,e.jsx)("button",{onClick:()=>A(-10),className:"p-2 lg:p-3 hover:bg-white/20 rounded-lg transition-colors hidden sm:block",title:"Back 10s",children:(0,e.jsx)(ht,{className:"w-5 h-5 lg:w-6 lg:h-6 text-white"})}),(0,e.jsx)("button",{onClick:D,className:"p-2 lg:p-3 hover:bg-white/20 rounded-lg transition-colors",children:b?(0,e.jsx)(xe,{className:"w-6 h-6 lg:w-8 lg:h-8 text-white"}):(0,e.jsx)(me,{className:"w-6 h-6 lg:w-8 lg:h-8 text-white"})}),(0,e.jsx)("button",{onClick:()=>A(10),className:"p-2 lg:p-3 hover:bg-white/20 rounded-lg transition-colors hidden sm:block",title:"Forward 10s",children:(0,e.jsx)(dt,{className:"w-5 h-5 lg:w-6 lg:h-6 text-white"})}),(0,e.jsxs)("div",{className:"relative flex items-center gap-2",onMouseEnter:()=>ae(!0),onMouseLeave:()=>ae(!1),children:[(0,e.jsx)("button",{onClick:oe,className:"p-2 lg:p-3 hover:bg-white/20 rounded-lg transition-colors",children:w||S===0?(0,e.jsx)(Qe,{className:"w-5 h-5 lg:w-6 lg:h-6 text-white"}):(0,e.jsx)(rt,{className:"w-5 h-5 lg:w-6 lg:h-6 text-white"})}),(0,e.jsx)(N,{children:ke&&(0,e.jsx)(p.div,{initial:{width:0,opacity:0},animate:{width:100,opacity:1},exit:{width:0,opacity:0},className:"hidden sm:block overflow-hidden",children:(0,e.jsx)("input",{type:"range",min:"0",max:"1",step:"0.05",value:w?0:S,onChange:t=>{const s=parseFloat(t.target.value);ee(s),n.current&&(n.current.volume=s),F(s===0)},className:"w-full accent-purple-500"})})})]}),(0,e.jsxs)("span",{className:"text-white text-sm lg:text-base font-medium tabular-nums ml-2",children:[de(T)," / ",de(g)]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1 lg:gap-3",children:[(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)("button",{onClick:()=>re(!le),className:"px-3 py-2 hover:bg-white/20 rounded-lg transition-colors text-white text-sm lg:text-base font-medium",children:[te,"x"]}),(0,e.jsx)(N,{children:le&&(0,e.jsx)(p.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},className:"absolute bottom-full right-0 mb-2 bg-slate-900/95 backdrop-blur-xl rounded-xl shadow-2xl overflow-hidden border border-slate-700",children:[.25,.5,.75,1,1.25,1.5,1.75,2].map(t=>(0,e.jsx)("button",{onClick:()=>De(t),className:`block w-full px-5 py-3 text-sm text-left hover:bg-slate-800 transition-colors ${te===t?"text-purple-400 bg-purple-500/10":"text-white"}`,children:t===1?"Normal":`${t}x`},t))})})]}),(0,e.jsx)("button",{onClick:B,className:`p-2 lg:p-3 hover:bg-white/20 rounded-lg transition-colors ${i===r.THEATER?"text-purple-400 bg-purple-500/20":"text-white"}`,title:"Theater Mode (T)",children:(0,e.jsx)(ft,{className:"w-5 h-5 lg:w-6 lg:h-6"})}),(0,e.jsx)("button",{onClick:M,className:"p-2 lg:p-3 hover:bg-white/20 rounded-lg transition-colors",title:"Fullscreen (F)",children:i===r.FULLSCREEN?(0,e.jsx)(ct,{className:"w-5 h-5 lg:w-6 lg:h-6 text-white"}):(0,e.jsx)(X,{className:"w-5 h-5 lg:w-6 lg:h-6 text-white"})})]})]})]})]})})]})})}),(0,e.jsxs)("div",{className:`${i===r.THEATER?"max-w-[1400px] mx-auto px-4 lg:px-8":"px-4 lg:px-0"} py-4 lg:py-6`,children:[(0,e.jsx)("h1",{className:"text-xl lg:text-2xl xl:text-3xl font-bold text-white mb-4 leading-tight",children:l.title}),(0,e.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4 pb-4 border-b border-slate-800",children:[(0,e.jsxs)("div",{className:"flex items-center gap-4 text-sm text-slate-400",children:[(0,e.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,e.jsx)(fe,{className:"w-4 h-4"}
10),(l.views||0).toLocaleString()," views"]}),(0,e.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,e.jsx)(lt,{className:"w-4 h-4"}),Ie(l.createdAt)]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,e.jsxs)("button",{onClick:Ae,className:`flex items-center gap-2 px-4 py-2.5 rounded-full font-medium transition-all ${k?"bg-purple-600 text-white shadow-lg shadow-purple-500/30":"bg-slate-800 text-slate-300 hover:bg-slate-700"}`,children:[k?(0,e.jsx)(nt,{className:"w-5 h-5"}):(0,e.jsx)(He,{className:"w-5 h-5"}),(0,e.jsx)("span",{children:l.likes||0})]}),(0,e.jsx)("button",{onClick:Me,className:`flex items-center gap-2 px-4 py-2.5 rounded-full font-medium transition-all ${$?"bg-red-600 text-white":"bg-slate-800 text-slate-300 hover:bg-slate-700"}`,children:$?(0,e.jsx)(pt,{className:"w-5 h-5"}):(0,e.jsx)(xt,{className:"w-5 h-5"})}),(0,e.jsxs)("button",{onClick:Ue,className:`flex items-center gap-2 px-4 py-2.5 rounded-full font-medium transition-all ${L?"bg-blue-600 text-white":"bg-slate-800 text-slate-300 hover:bg-slate-700"}`,children:[L?(0,e.jsx)(Pe,{className:"w-5 h-5"}):(0,e.jsx)(tt,{className:"w-5 h-5"}),(0,e.jsx)("span",{className:"hidden sm:inline",children:"Save"})]}),(0,e.jsxs)("button",{onClick:ce,className:"flex items-center gap-2 px-4 py-2.5 bg-slate-800 text-slate-300 hover:bg-slate-700 rounded-full font-medium transition-all",children:[(0,e.jsx)(ge,{className:"w-5 h-5"}),(0,e.jsx)("span",{className:"hidden sm:inline",children:"Share"})]})]})]}),(0,e.jsxs)("div",{className:"flex items-center justify-between py-4 border-b border-slate-800",children:[(0,e.jsxs)("div",{className:"flex items-center gap-4",children:[(0,e.jsx)("div",{className:"w-12 h-12 lg:w-14 lg:h-14 bg-gradient-to-br from-purple-600 to-blue-600 rounded-full flex items-center justify-center shadow-lg",children:(0,e.jsx)(Ke,{className:"w-6 h-6 lg:w-7 lg:h-7 text-white"})}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h3",{className:"font-semibold text-white text-lg",children:l.creatorName||l.authorInfo?.name||"TradeIntelX"}),(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm text-slate-400",children:[(0,e.jsx)("span",{className:"capitalize",children:l.category||"Education"}),(0,e.jsx)("span",{children:"â¢"}),(0,e.jsx)("span",{className:"capitalize",children:l.difficulty||"All Levels"})]})]})]}),l.tags&&l.tags.length>0&&(0,e.jsx)("div",{className:"hidden lg:flex flex-wrap gap-2",children:l.tags.slice(0,4).map((t,s)=>(0,e.jsxs)("span",{className:"px-3 py-1.5 bg-purple-600/20 text-purple-300 text-xs font-medium rounded-full",children:["#",t]},s))})]}),(0,e.jsxs)("div",{className:"py-4 border-b border-slate-800",children:[(0,e.jsx)("div",{className:`text-slate-300 leading-relaxed ${I?"":"line-clamp-2"}`,children:l.description||"No description available for this video."}),l.description&&l.description.length>100&&(0,e.jsx)("button",{onClick:()=>Te(!I),className:"text-purple-400 hover:text-purple-300 text-sm mt-2 font-medium transition-colors",children:I?"Show less":"Show more"})]}),(0,e.jsxs)("div",{className:"py-6",children:[(0,e.jsxs)("h3",{className:"text-lg font-semibold text-white mb-4 flex items-center gap-2",children:[(0,e.jsx)(Je,{className:"w-5 h-5 text-purple-400"}),"Comments"]}),(0,e.jsx)(mt,{videoId:l.id,user:c})]})]})]}),i===r.DEFAULT&&(0,e.jsx)("aside",{className:"w-full xl:w-[420px] 2xl:w-[480px] shrink-0 px-4 xl:px-0",children:(0,e.jsxs)("div",{className:"xl:sticky xl:top-20 space-y-6",children:[x.length>0&&(0,e.jsxs)("div",{children:[(0,e.jsxs)("h3",{className:"text-lg font-semibold text-white mb-4 flex items-center gap-2",children:[(0,e.jsx)(bt,{className:"w-5 h-5 text-purple-400"}),"Up Next"]}),(0,e.jsxs)("div",{onClick:()=>H(x[0]),className:"relative rounded-xl overflow-hidden cursor-pointer group mb-4",children:[(0,e.jsx)("div",{className:"aspect-video bg-slate-800",children:x[0].thumbnail?(0,e.jsx)("img",{src:x[0].thumbnail,alt:x[0].title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"}):(0,e.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-gradient-to-br from-purple-600/20 to-blue-600/20",children:(0,e.jsx)(v,{className:"w-12 h-12 text-white/40"})})}),(0,e.jsxs)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/20 to-transparent flex flex-col justify-end p-4",children:[(0,e.jsx)("h4",{className:"font-semibold text-white line-clamp-2 mb-1",children:x[0].title}),(0,e.jsxs)("div",{className:"flex items-center gap-2 text-xs text-slate-300",children:[(0,e.jsx)(fe,{className:"w-3 h-3"}
10),(0,e.jsxs)("span",{children:[(x[0].views||0).toLocaleString()," views"]})]})]}),(0,e.jsx)("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:(0,e.jsx)("div",{className:"w-16 h-16 bg-purple-600/90 rounded-full flex items-center justify-center shadow-2xl shadow-purple-500/30",children:(0,e.jsx)(v,{className:"w-7 h-7 text-white ml-1"})})})]})]}),(0,e.jsxs)("div",{children:[(0,e.jsxs)("h3",{className:"text-lg font-semibold text-white mb-4 flex items-center gap-2",children:[(0,e.jsx)(pe,{className:"w-5 h-5 text-yellow-400"}),"Related Videos"]}),(0,e.jsxs)("div",{className:"space-y-3 max-h-[calc(100vh-400px)] overflow-y-auto pr-2 custom-scrollbar",children:[x.slice(1).map(t=>(0,e.jsxs)("div",{onClick:()=>H(t),className:"flex gap-3 p-2 hover:bg-slate-800/50 rounded-xl cursor-pointer transition-all group",children:[(0,e.jsxs)("div",{className:"w-40 lg:w-44 h-24 lg:h-[100px] bg-slate-800 rounded-lg flex-shrink-0 overflow-hidden relative",children:[t.thumbnail?(0,e.jsx)("img",{src:t.thumbnail,alt:t.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"}):(0,e.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-gradient-to-br from-purple-600/20 to-blue-600/20",children:(0,e.jsx)(v,{className:"w-8 h-8 text-white/40"})}),t.duration&&(0,e.jsx)("span",{className:"absolute bottom-1 right-1 px-1.5 py-0.5 bg-black/80 text-white text-xs rounded font-medium",children:t.duration}),(0,e.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black/0 group-hover:bg-black/30 transition-colors",children:(0,e.jsx)(v,{className:"w-10 h-10 text-white opacity-0 group-hover:opacity-100 transition-opacity"})})]}),(0,e.jsxs)("div",{className:"flex-1 min-w-0 py-1",children:[(0,e.jsx)("h4",{className:"font-medium text-white text-sm line-clamp-2 mb-2 group-hover:text-purple-400 transition-colors",children:t.title}),(0,e.jsx)("p",{className:"text-xs text-slate-500 mb-1",children:t.creatorName||"TradeIntelX"}),(0,e.jsx)("div",{className:"flex items-center gap-2 text-xs text-slate-500",children:(0,e.jsxs)("span",{children:[(t.views||0).toLocaleString()," views"]})})]})]},t.id)),x.length===0&&(0,e.jsx)("div",{className:"text-center py-8",children:(0,e.jsx)("p",{className:"text-slate-500",children:"No related videos found"})})]})]})]})})]}),i===r.THEATER&&x.length>0&&(0,e.jsxs)("div",{className:"max-w-[1400px] mx-auto px-4 lg:px-8 py-8 border-t border-slate-800",children:[(0,e.jsxs)("h3",{className:"text-lg font-semibold text-white mb-4 flex items-center gap-2",children:[(0,e.jsx)(pe,{className:"w-5 h-5 text-yellow-400"}),"More Videos"]}),(0,e.jsx)("div",{className:"flex gap-4 overflow-x-auto pb-4 custom-scrollbar-horizontal",children:x.map(t=>(0,e.jsxs)("div",{onClick:()=>H(t),className:"flex-shrink-0 w-72 cursor-pointer group",children:[(0,e.jsxs)("div",{className:"aspect-video bg-slate-800 rounded-xl overflow-hidden relative mb-2",children:[t.thumbnail?(0,e.jsx)("img",{src:t.thumbnail,alt:t.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"}):(0,e.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-gradient-to-br from-purple-600/20 to-blue-600/20",children:(0,e.jsx)(v,{className:"w-10 h-10 text-white/40"})}),(0,e.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black/0 group-hover:bg-black/40 transition-colors",children:(0,e.jsx)(v,{className:"w-12 h-12 text-white opacity-0 group-hover:opacity-100 transition-opacity"})})]}),(0,e.jsx)("h4",{className:"font-medium text-white text-sm line-clamp-2 group-hover:text-purple-400 transition-colors",children:t.title}),(0,e.jsxs)("p",{className:"text-xs text-slate-500 mt-1",children:[(t.views||0).toLocaleString()," views"]})]},t.id))})]})]}),(0,e.jsx)(N,{children:Se&&(0,e.jsx)(p.div,{initial:{opacity:0}
10,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[100] bg-black/70 backdrop-blur-sm flex items-center justify-center p-4",onClick:()=>y(!1),children:(0,e.jsxs)(p.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},className:"bg-slate-900 rounded-2xl p-6 w-full max-w-md border border-slate-700",onClick:t=>t.stopPropagation(),children:[(0,e.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,e.jsx)("h3",{className:"text-xl font-bold text-white",children:"Share Video"}),(0,e.jsx)("button",{onClick:()=>y(!1),className:"p-2 hover:bg-slate-800 rounded-lg transition-colors",children:(0,e.jsx)(be,{className:"w-5 h-5 text-slate-400"})})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-slate-800 rounded-lg mb-4",children:[(0,e.jsx)("input",{type:"text",value:window.location.href,readOnly:!0,className:"flex-1 bg-transparent text-slate-300 text-sm outline-none"}),(0,e.jsx)("button",{onClick:Ve,className:"px-4 py-2 bg-purple-600 hover:bg-purple-700 text-white text-sm font-medium rounded-lg transition-colors",children:"Copy"})]})]})})}),(0,e.jsx)("style",{children:` 11 .custom-scrollbar::-webkit-scrollbar {
12 width: 6px; 13 } 14 .custom-scrollbar::-webkit-scrollbar-track { 15 background: transparent; 16 } 17 .custom-scrollbar::-webkit-scrollbar-thumb { 18 background: #475569; 19 border-radius: 3px; 20 } 21 .custom-scrollbar::-webkit-scrollbar-thumb:hover { 22 background: #64748b; 23 } 24 .custom-scrollbar-horizontal::-webkit-scrollbar { 25 height: 6px; 26 } 27 .custom-scrollbar-horizontal::-webkit-scrollbar-track { 28 background: transparent; 29 } 30 .custom-scrollbar-horizontal::-webkit-scrollbar-thumb { 31 background: #475569; 32 border-radius: 3px; 33 } 34 .custom-scrollbar-horizontal::-webkit-scrollbar-thumb:hover { 35 background: #64748b; 36 } 37 `})]})};export{yt as default};
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.