playron 1.0.11 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  export interface SubtitleStyle {
3
- /** Alt kenara olan mesafe (px). Varsayılan: 40 */
3
+ /** Alt kenara olan mesafe (px). Varsayılan: 80 */
4
4
  bottomOffset: number;
5
5
  /** Font boyutu (px). Varsayılan: 18 */
6
6
  fontSize: number;
package/dist/index.d.ts CHANGED
@@ -34,7 +34,7 @@ export type { CastState, ChromecastManagerOptions } from './core/cast/Chromecast
34
34
  export { default as EndCard } from './ui/Overlay/EndCard';
35
35
  export { default as KeyboardShortcutsOverlay } from './ui/Overlay/KeyboardShortcutsOverlay';
36
36
  export { default as ContextMenu } from './ui/Overlay/ContextMenu';
37
- export type { ContextMenuAction } from './ui/Overlay/ContextMenu';
37
+ export type { ContextMenuAction, ContextMenuTheme } from './ui/Overlay/ContextMenu';
38
38
  export { default as GestureHintOverlay } from './ui/Overlay/GestureHintOverlay';
39
39
  export { ThumbnailManager } from './core/streaming/ThumbnailManager';
40
40
  export type { ThumbnailCue } from './core/streaming/ThumbnailManager';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAKtC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChF,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAA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,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI;IAIrF,GAAG,CAAC,CAAC,SAAS,eAAe,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI;IAKtF,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,KAAK,IAAI,IAAI;IAIb,UAAU,IAAI,IAAI;IAIlB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAI/B,QAAQ,IAAI,WAAW,GAAG,IAAI;IAI9B;;OAEG;IACG,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3C;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAI1B;;OAEG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAInC;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAI/B;;OAEG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAIpE;;OAEG;IACH,OAAO,IAAI,IAAI;CAYhB;AAGD,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -67,7 +67,7 @@ Char: `+L[G])}return G+1&&(G+=1),U}if(L.charCodeAt(G+1)===M){G=L.indexOf(de,G),G
67
67
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
68
68
  to { opacity: 1; transform: scale(1) translateY(0); }
69
69
  }
70
- `})]}):null}function Rm({x:u,y:e,isOpen:t,onClose:n,actions:r}){const i=yt.useRef(null);return yt.useEffect(()=>{if(!t)return;const o=l=>{if("key"in l){l.key==="Escape"&&n();return}i.current&&!i.current.contains(l.target)&&n()};return document.addEventListener("mousedown",o),document.addEventListener("keydown",o),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("keydown",o)}},[t,n]),t?fe.jsxs(fe.Fragment,{children:[fe.jsx("div",{ref:i,role:"menu","aria-label":"Video options",style:{position:"absolute",left:u,top:e,zIndex:99998,background:"rgba(12, 12, 20, 0.97)",backdropFilter:"blur(16px)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"14px",boxShadow:"0 12px 48px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.08)",minWidth:"240px",padding:"4px 0",fontFamily:"system-ui, -apple-system, sans-serif",animation:"ctxFadeIn 0.14s ease-out",overflow:"hidden"},children:r.map((o,l)=>fe.jsxs("div",{children:[fe.jsxs("button",{role:"menuitem",onClick:()=>{o.onClick(),n()},style:{display:"flex",alignItems:"center",gap:"10px",width:"100%",padding:"9px 14px",background:"transparent",border:"none",color:o.danger?"#f87171":"#fff",fontSize:"13.5px",textAlign:"left",cursor:"pointer",transition:"background 0.1s"},onMouseEnter:d=>{d.currentTarget.style.background=o.danger?"rgba(239,68,68,0.12)":"rgba(255,255,255,0.07)"},onMouseLeave:d=>{d.currentTarget.style.background="transparent"},children:[o.icon!==void 0&&fe.jsx("span",{style:{width:"28px",height:"28px",borderRadius:"7px",background:o.danger?"rgba(239,68,68,0.15)":"rgba(255,255,255,0.08)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:o.danger?"#f87171":"rgba(255,255,255,0.65)",fontSize:"13px",lineHeight:1},children:o.icon}),fe.jsx("span",{style:{flex:1},children:o.label})]}),o.dividerAfter&&fe.jsx("div",{style:{height:"1px",background:"rgba(255,255,255,0.07)",margin:"3px 0"}})]},l))}),fe.jsx("style",{children:`
70
+ `})]}):null}function Rm({x:u,y:e,isOpen:t,onClose:n,actions:r,theme:i}){const o={background:i?.background??"rgba(12, 12, 20, 0.97)",borderColor:i?.borderColor??"rgba(255,255,255,0.1)",textColor:i?.textColor??"#fff",dangerColor:i?.dangerColor??"#f87171",hoverBackground:i?.hoverBackground??"rgba(255,255,255,0.07)",iconBackground:i?.iconBackground??"rgba(255,255,255,0.08)",dividerColor:i?.dividerColor??"rgba(255,255,255,0.07)"},l=yt.useRef(null);return yt.useEffect(()=>{if(!t)return;const d=c=>{if("key"in c){c.key==="Escape"&&n();return}l.current&&!l.current.contains(c.target)&&n()};return document.addEventListener("mousedown",d),document.addEventListener("keydown",d),()=>{document.removeEventListener("mousedown",d),document.removeEventListener("keydown",d)}},[t,n]),t?fe.jsxs(fe.Fragment,{children:[fe.jsx("div",{ref:l,role:"menu","aria-label":"Video options",style:{position:"absolute",left:u,top:e,zIndex:99998,background:o.background,backdropFilter:"blur(16px)",border:`1px solid ${o.borderColor}`,borderRadius:"14px",boxShadow:`0 12px 48px rgba(0,0,0,0.7), 0 0 0 1px ${o.borderColor}`,minWidth:"240px",padding:"4px 0",fontFamily:"system-ui, -apple-system, sans-serif",animation:"ctxFadeIn 0.14s ease-out",overflow:"hidden"},children:r.map((d,c)=>fe.jsxs("div",{children:[fe.jsxs("button",{role:"menuitem",onClick:()=>{d.onClick(),n()},style:{display:"flex",alignItems:"center",gap:"10px",width:"100%",padding:"9px 14px",background:"transparent",border:"none",color:d.danger?o.dangerColor:o.textColor,fontSize:"13.5px",textAlign:"left",cursor:"pointer",transition:"background 0.1s"},onMouseEnter:g=>{g.currentTarget.style.background=d.danger?"rgba(239,68,68,0.12)":o.hoverBackground},onMouseLeave:g=>{g.currentTarget.style.background="transparent"},children:[d.icon!==void 0&&fe.jsx("span",{style:{width:"28px",height:"28px",borderRadius:"7px",background:d.danger?"rgba(239,68,68,0.15)":o.iconBackground,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:d.danger?o.dangerColor:o.textColor,fontSize:"13px",lineHeight:1},children:d.icon}),fe.jsx("span",{style:{flex:1},children:d.label})]}),d.dividerAfter&&fe.jsx("div",{style:{height:"1px",background:o.dividerColor,margin:"3px 0"}})]},c))}),fe.jsx("style",{children:`
71
71
  @keyframes ctxFadeIn {
72
72
  from { opacity: 0; transform: scale(0.96) translateY(-4px); }
73
73
  to { opacity: 1; transform: scale(1) translateY(0); }
@@ -177,7 +177,7 @@ Char: `+L[G])}return G+1&&(G+=1),U}if(L.charCodeAt(G+1)===M){G=L.indexOf(de,G),G
177
177
  0% { transform: rotate(0deg); }
178
178
  100% { transform: rotate(360deg); }
179
179
  }
180
- `,document.head.appendChild(n)}t.appendChild(this.loadingContainer),console.log("[AdManager] Loading spinner shown")}}hideAdLoading(){if(this.onLoadingChange){this.onLoadingChange(!1),console.log("[AdManager] External loading callback triggered (false)");return}this.loadingContainer&&(this.loadingContainer.remove(),this.loadingContainer=null,console.log("[AdManager] Loading spinner hidden"))}destroy(){this.hideAdLoading(),this.adPlayer.destroy(),this.preRollPlayed=!1,this.midRollsPlayed.clear(),this.postRollPlayed=!1,this.vmapData=null,console.log("[AdManager] Destroyed")}}const Dm={bottomOffset:40,fontSize:18,color:"#ffffff",background:"rgba(0,0,0,0.75)"},Pm=yt.createContext({style:Dm,setStyle:()=>{}});function W_({children:u}){const[e,t]=yt.useState(Dm),n=r=>t(i=>({...i,...r}));return fe.jsx(Pm.Provider,{value:{style:e,setStyle:n},children:u})}function Nm(){return yt.useContext(Pm)}function X_({videoElement:u}){const{style:e}=Nm(),[t,n]=yt.useState([]),r=yt.useRef(""),i=yt.useRef(0);return yt.useEffect(()=>{if(!u)return;const o=()=>{const l=u.textTracks,d=[];for(let g=0;g<l.length;g++){const f=l[g];if(f.kind!=="subtitles"&&f.kind!=="captions"||f.mode==="disabled")continue;f.mode==="showing"&&(f.mode="hidden");const h=f.activeCues;if(h)for(let y=0;y<h.length;y++){const E=h[y];E.text&&d.push(E.text)}}const c=d.join("\0");c!==r.current&&(r.current=c,n(d)),i.current=requestAnimationFrame(o)};return i.current=requestAnimationFrame(o),()=>{cancelAnimationFrame(i.current)}},[u]),t.length===0?null:fe.jsx("div",{"aria-live":"polite",style:{position:"absolute",bottom:e.bottomOffset,left:"50%",transform:"translateX(-50%)",textAlign:"center",pointerEvents:"none",zIndex:200,maxWidth:"85%",display:"flex",flexDirection:"column",alignItems:"center",gap:"2px"},children:t.map((o,l)=>fe.jsx("span",{style:{display:"inline-block",fontSize:e.fontSize,lineHeight:1.4,color:e.color,background:e.background||"transparent",padding:e.background?"2px 10px":"0",borderRadius:4,whiteSpace:"pre-wrap",wordBreak:"break-word",textShadow:e.background?"none":"0 1px 4px rgba(0,0,0,0.9), 0 0 8px rgba(0,0,0,0.8)"},dangerouslySetInnerHTML:{__html:o}},l))})}const yo=yt.createContext(!0);function Mm({src:u="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",defaultControls:e=!1,autoplay:t=!1,muted:n=!1,poster:r,className:i,children:o,config:l,onAdLoading:d,onNextEpisode:c,nextEpisodeTitle:g,nextEpisodeThumbnail:f,endCardCountdown:h=5}){const y=yt.useRef(null),E=yt.useRef(null),[S,C]=yt.useState(null),K=yt.useRef(null),[J,re]=yt.useState(!1),[ye,Ie]=yt.useState(!1),we=yt.useCallback(()=>Ie(!0),[]),$=yt.useCallback(()=>Ie(!1),[]),[Z,pe]=yt.useState(!1),[be,Ce]=yt.useState({x:0,y:0,open:!1}),Qe=yt.useCallback(()=>Ce(st=>({...st,open:!1})),[]),xe=yt.useCallback(st=>{st.preventDefault();const jt=y.current?.getBoundingClientRect();if(!jt)return;const Qt=st.clientX-jt.left,Ne=st.clientY-jt.top;Ce({x:Qt,y:Ne,open:!0})},[]),Je=yt.useMemo(()=>{if(!S)return[];const st=S.getVideoElement(),jt=st?.loop??!1;return[{label:jt?"Loop: On":"Loop: Off",icon:fe.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[fe.jsx("polyline",{points:"17 1 21 5 17 9"}),fe.jsx("path",{d:"M3 11V9a4 4 0 0 1 4-4h14"}),fe.jsx("polyline",{points:"7 23 3 19 7 15"}),fe.jsx("path",{d:"M21 13v2a4 4 0 0 1-4 4H3"}),jt&&fe.jsx("circle",{cx:"12",cy:"12",r:"2",fill:"currentColor",stroke:"none"})]}),onClick:()=>{if(st){const Qt=!st.loop;S.setLoop(Qt)}},dividerAfter:!1},{label:`Copy Speed (${st?.playbackRate??1}×)`,icon:fe.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[fe.jsx("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0 1 1 0 0 0-2 0"}),fe.jsx("path",{d:"M12 2a10 10 0 0 1 7.39 16.74M12 2A10 10 0 0 0 4.61 18.74"}),fe.jsx("path",{d:"m16.24 7.76-2.12 2.12"})]}),onClick:()=>{const Qt=st?.playbackRate??1;navigator.clipboard?.writeText(String(Qt)).catch(()=>{})},dividerAfter:!1},{label:"Copy Video URL",icon:fe.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[fe.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),fe.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]}),onClick:()=>{const Qt=st?.currentSrc??u??"";navigator.clipboard?.writeText(Qt).catch(()=>{})},dividerAfter:!0},{label:"Keyboard Shortcuts",icon:fe.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[fe.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),fe.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M8 12h.01M12 12h.01M16 12h.01M7 16h10"})]}),onClick:()=>Ie(!0),dividerAfter:!1}]},[S,u]),{onTouchStart:Oe,onTouchMove:Me,onTouchEnd:Ve,gestureHint:ct}=Lm({player:S,skipSec:10}),{isActive:at}=q_({timeout:3e3,initialVisible:!0});G_({player:S,seekStep:10,enabled:!0,onShowShortcuts:we});const vt=yt.useMemo(()=>!l?.ads?.enabled||!l.ads.vastUrl&&!l.ads.vmapUrl?null:{enabled:!0,vastUrl:l.ads.vastUrl,vmapUrl:l.ads.vmapUrl,skipAfter:l.ads.skipAfter,timeout:l.ads.timeout,maxWrapperDepth:l.ads.maxWrapperDepth},[l?.ads?.enabled,l?.ads?.vastUrl,l?.ads?.vmapUrl,l?.ads?.skipAfter,l?.ads?.timeout,l?.ads?.maxWrapperDepth]);yt.useEffect(()=>{if(!E.current||!y.current)return;console.log("[Player] Initializing PlayerCore");const st=new Da(E.current);return st.container=y.current,C(st),()=>{console.log("[Player] Cleanup called - destroying PlayerCore"),K.current&&(console.log("[Player] Destroying AdManager"),K.current.destroy(),K.current=null),st.destroy(),C(null)}},[]),yt.useEffect(()=>{if(!S||!vt)return;console.log("[Player] Setting up ads");const st=Qt=>{re(Qt),d?.(Qt)},jt=new Y_(S,vt,st);return K.current=jt,jt.setup().catch(Qt=>{console.error("[Player] Failed to setup ads:",Qt)}),()=>{K.current&&(console.log("[Player] Cleaning up ads"),K.current.destroy(),K.current=null)}},[S,vt]);const nt=yt.useMemo(()=>l?.drm??null,[l?.drm]);return yt.useEffect(()=>{!S||!nt?.enabled||S.setupDrm(nt)},[S,nt]),yt.useEffect(()=>{S&&u&&(console.log("[Player] Setting source:",u),S.setSource(u).catch(st=>{console.error("[Player] setSource failed:",st)}))},[S,u]),yt.useEffect(()=>{if(!S||!c)return;const st=S.getVideoElement();if(!st)return;const jt=()=>pe(!0);return st.addEventListener("ended",jt),()=>st.removeEventListener("ended",jt)},[S,c]),fe.jsxs(W_,{children:[fe.jsxs("div",{ref:y,role:"region","aria-label":"Video Player",className:`playron-wrapper ${i||""}`,onContextMenu:xe,onTouchStart:Oe,onTouchMove:Me,onTouchEnd:Ve,style:{position:"relative",backgroundColor:"#000",overflow:"hidden",cursor:at?"default":"none"},children:[fe.jsx("div",{"aria-live":"polite","aria-atomic":"true",style:{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}}),fe.jsx("video",{ref:E,className:`virtus-video-element ${i||""}`,style:{width:"100%",height:"100%",display:"block",aspectRatio:"16/9",objectFit:"cover",objectPosition:"center"},autoPlay:t,muted:n,controls:e,poster:r,crossOrigin:"anonymous",tabIndex:e?0:-1}),S?fe.jsx(Im,{playerInstance:S,children:fe.jsxs(yo.Provider,{value:at,children:[fe.jsx(X_,{videoElement:E.current}),fe.jsx(E_,{config:l,isAdLoading:J}),fe.jsx(Cm,{type:ct?.type??null,value:ct?.value??""}),fe.jsx(z_,{drmConfig:l?.drm}),fe.jsx(wm,{isOpen:ye,onClose:$}),c&&fe.jsx(km,{isVisible:Z,onNextEpisode:()=>{pe(!1),c()},onDismiss:()=>pe(!1),countdownSec:h,nextTitle:g,thumbnail:f}),fe.jsx(Rm,{x:be.x,y:be.y,isOpen:be.open,onClose:Qe,actions:Je}),o]})}):null]}),fe.jsx("style",{children:`
180
+ `,document.head.appendChild(n)}t.appendChild(this.loadingContainer),console.log("[AdManager] Loading spinner shown")}}hideAdLoading(){if(this.onLoadingChange){this.onLoadingChange(!1),console.log("[AdManager] External loading callback triggered (false)");return}this.loadingContainer&&(this.loadingContainer.remove(),this.loadingContainer=null,console.log("[AdManager] Loading spinner hidden"))}destroy(){this.hideAdLoading(),this.adPlayer.destroy(),this.preRollPlayed=!1,this.midRollsPlayed.clear(),this.postRollPlayed=!1,this.vmapData=null,console.log("[AdManager] Destroyed")}}const Dm={bottomOffset:80,fontSize:18,color:"#ffffff",background:"rgba(0,0,0,0.75)"},Pm=yt.createContext({style:Dm,setStyle:()=>{}});function W_({children:u}){const[e,t]=yt.useState(Dm),n=r=>t(i=>({...i,...r}));return fe.jsx(Pm.Provider,{value:{style:e,setStyle:n},children:u})}function Nm(){return yt.useContext(Pm)}function X_({videoElement:u}){const{style:e}=Nm(),[t,n]=yt.useState([]),r=yt.useRef(""),i=yt.useRef(0);return yt.useEffect(()=>{if(!u)return;const o=()=>{const l=u.textTracks,d=[];for(let g=0;g<l.length;g++){const f=l[g];if(f.kind!=="subtitles"&&f.kind!=="captions"||f.mode==="disabled")continue;f.mode==="showing"&&(f.mode="hidden");const h=f.activeCues;if(h)for(let y=0;y<h.length;y++){const E=h[y];E.text&&d.push(E.text)}}const c=d.join("\0");c!==r.current&&(r.current=c,n(d)),i.current=requestAnimationFrame(o)};return i.current=requestAnimationFrame(o),()=>{cancelAnimationFrame(i.current)}},[u]),t.length===0?null:fe.jsx("div",{"aria-live":"polite",style:{position:"absolute",bottom:e.bottomOffset,left:"50%",transform:"translateX(-50%)",textAlign:"center",pointerEvents:"none",zIndex:200,maxWidth:"85%",display:"flex",flexDirection:"column",alignItems:"center",gap:"2px"},children:t.map((o,l)=>fe.jsx("span",{style:{display:"inline-block",fontSize:e.fontSize,lineHeight:1.4,color:e.color,background:e.background||"transparent",padding:e.background?"2px 10px":"0",borderRadius:4,whiteSpace:"pre-wrap",wordBreak:"break-word",textShadow:e.background?"none":"0 1px 4px rgba(0,0,0,0.9), 0 0 8px rgba(0,0,0,0.8)"},dangerouslySetInnerHTML:{__html:o}},l))})}const yo=yt.createContext(!0);function Mm({src:u="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",defaultControls:e=!1,autoplay:t=!1,muted:n=!1,poster:r,className:i,children:o,config:l,onAdLoading:d,onNextEpisode:c,nextEpisodeTitle:g,nextEpisodeThumbnail:f,endCardCountdown:h=5}){const y=yt.useRef(null),E=yt.useRef(null),[S,C]=yt.useState(null),K=yt.useRef(null),[J,re]=yt.useState(!1),[ye,Ie]=yt.useState(!1),we=yt.useCallback(()=>Ie(!0),[]),$=yt.useCallback(()=>Ie(!1),[]),[Z,pe]=yt.useState(!1),[be,Ce]=yt.useState({x:0,y:0,open:!1}),Qe=yt.useCallback(()=>Ce(st=>({...st,open:!1})),[]),xe=yt.useCallback(st=>{st.preventDefault();const jt=y.current?.getBoundingClientRect();if(!jt)return;const Qt=st.clientX-jt.left,Ne=st.clientY-jt.top;Ce({x:Qt,y:Ne,open:!0})},[]),Je=yt.useMemo(()=>{if(!S)return[];const st=S.getVideoElement(),jt=st?.loop??!1;return[{label:jt?"Loop: On":"Loop: Off",icon:fe.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[fe.jsx("polyline",{points:"17 1 21 5 17 9"}),fe.jsx("path",{d:"M3 11V9a4 4 0 0 1 4-4h14"}),fe.jsx("polyline",{points:"7 23 3 19 7 15"}),fe.jsx("path",{d:"M21 13v2a4 4 0 0 1-4 4H3"}),jt&&fe.jsx("circle",{cx:"12",cy:"12",r:"2",fill:"currentColor",stroke:"none"})]}),onClick:()=>{if(st){const Qt=!st.loop;S.setLoop(Qt)}},dividerAfter:!1},{label:`Copy Speed (${st?.playbackRate??1}×)`,icon:fe.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[fe.jsx("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0 1 1 0 0 0-2 0"}),fe.jsx("path",{d:"M12 2a10 10 0 0 1 7.39 16.74M12 2A10 10 0 0 0 4.61 18.74"}),fe.jsx("path",{d:"m16.24 7.76-2.12 2.12"})]}),onClick:()=>{const Qt=st?.playbackRate??1;navigator.clipboard?.writeText(String(Qt)).catch(()=>{})},dividerAfter:!1},{label:"Copy Video URL",icon:fe.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[fe.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),fe.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]}),onClick:()=>{const Qt=st?.currentSrc??u??"";navigator.clipboard?.writeText(Qt).catch(()=>{})},dividerAfter:!0},{label:"Keyboard Shortcuts",icon:fe.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[fe.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),fe.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M8 12h.01M12 12h.01M16 12h.01M7 16h10"})]}),onClick:()=>Ie(!0),dividerAfter:!1}]},[S,u]),{onTouchStart:Oe,onTouchMove:Me,onTouchEnd:Ve,gestureHint:ct}=Lm({player:S,skipSec:10}),{isActive:at}=q_({timeout:3e3,initialVisible:!0});G_({player:S,seekStep:10,enabled:!0,onShowShortcuts:we});const vt=yt.useMemo(()=>!l?.ads?.enabled||!l.ads.vastUrl&&!l.ads.vmapUrl?null:{enabled:!0,vastUrl:l.ads.vastUrl,vmapUrl:l.ads.vmapUrl,skipAfter:l.ads.skipAfter,timeout:l.ads.timeout,maxWrapperDepth:l.ads.maxWrapperDepth},[l?.ads?.enabled,l?.ads?.vastUrl,l?.ads?.vmapUrl,l?.ads?.skipAfter,l?.ads?.timeout,l?.ads?.maxWrapperDepth]);yt.useEffect(()=>{if(!E.current||!y.current)return;console.log("[Player] Initializing PlayerCore");const st=new Da(E.current);return st.container=y.current,C(st),()=>{console.log("[Player] Cleanup called - destroying PlayerCore"),K.current&&(console.log("[Player] Destroying AdManager"),K.current.destroy(),K.current=null),st.destroy(),C(null)}},[]),yt.useEffect(()=>{if(!S||!vt)return;console.log("[Player] Setting up ads");const st=Qt=>{re(Qt),d?.(Qt)},jt=new Y_(S,vt,st);return K.current=jt,jt.setup().catch(Qt=>{console.error("[Player] Failed to setup ads:",Qt)}),()=>{K.current&&(console.log("[Player] Cleaning up ads"),K.current.destroy(),K.current=null)}},[S,vt]);const nt=yt.useMemo(()=>l?.drm??null,[l?.drm]);return yt.useEffect(()=>{!S||!nt?.enabled||S.setupDrm(nt)},[S,nt]),yt.useEffect(()=>{S&&u&&(console.log("[Player] Setting source:",u),S.setSource(u).catch(st=>{console.error("[Player] setSource failed:",st)}))},[S,u]),yt.useEffect(()=>{if(!S||!c)return;const st=S.getVideoElement();if(!st)return;const jt=()=>pe(!0);return st.addEventListener("ended",jt),()=>st.removeEventListener("ended",jt)},[S,c]),fe.jsxs(W_,{children:[fe.jsxs("div",{ref:y,role:"region","aria-label":"Video Player",className:`playron-wrapper ${i||""}`,onContextMenu:xe,onTouchStart:Oe,onTouchMove:Me,onTouchEnd:Ve,style:{position:"relative",backgroundColor:"#000",overflow:"hidden",cursor:at?"default":"none"},children:[fe.jsx("div",{"aria-live":"polite","aria-atomic":"true",style:{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}}),fe.jsx("video",{ref:E,className:`virtus-video-element ${i||""}`,style:{width:"100%",height:"100%",display:"block",aspectRatio:"16/9",objectFit:"cover",objectPosition:"center"},autoPlay:t,muted:n,controls:e,poster:r,crossOrigin:"anonymous",tabIndex:e?0:-1}),S?fe.jsx(Im,{playerInstance:S,children:fe.jsxs(yo.Provider,{value:at,children:[fe.jsx(X_,{videoElement:E.current}),fe.jsx(E_,{config:l,isAdLoading:J}),fe.jsx(Cm,{type:ct?.type??null,value:ct?.value??""}),fe.jsx(z_,{drmConfig:l?.drm}),fe.jsx(wm,{isOpen:ye,onClose:$}),c&&fe.jsx(km,{isVisible:Z,onNextEpisode:()=>{pe(!1),c()},onDismiss:()=>pe(!1),countdownSec:h,nextTitle:g,thumbnail:f}),fe.jsx(Rm,{x:be.x,y:be.y,isOpen:be.open,onClose:Qe,actions:Je}),o]})}):null]}),fe.jsx("style",{children:`
181
181
  @keyframes gestureHintFade {
182
182
  0% { opacity: 1; }
183
183
  60% { opacity: 1; }
@@ -240,7 +240,7 @@ Char: `+L[G])}return G+1&&(G+=1),U}if(L.charCodeAt(G+1)===M){G=L.indexOf(de,G),G
240
240
  opacity: 0.5;
241
241
  }
242
242
  }
243
- `})]})}function Ym({seconds:u=15}){const{skipBackward:e}=kr(),{isLive:t}=Lr();if(t)return null;const n=()=>{e(u)};return fe.jsx("button",{className:`virtus-btn virtus-skip-backward-button ${as.controlButton}`,"aria-label":`Skip Backward ${u}s`,onClick:n,style:{position:"relative"},children:fe.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[fe.jsx("path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),fe.jsx("path",{d:"M2 12l-2-2m2 2l2-2",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),fe.jsx("text",{x:"12",y:"16",fontSize:"10",fill:"currentColor",textAnchor:"middle",fontWeight:"bold",children:u})]})})}function Wm({seconds:u=15}){const{skipForward:e}=kr(),{isLive:t}=Lr();if(t)return null;const n=()=>{e(u)};return fe.jsx("button",{className:`virtus-btn virtus-skip-forward-button ${as.controlButton}`,"aria-label":`Skip Forward ${u}s`,onClick:n,style:{position:"relative"},children:fe.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[fe.jsx("path",{d:"M12 2c5.5 0 10 4.5 10 10s-4.5 10-10 10-10-4.5-10-10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),fe.jsx("path",{d:"M22 12l2-2m-2 2l-2-2",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),fe.jsx("text",{x:"12",y:"16",fontSize:"10",fill:"currentColor",textAnchor:"middle",fontWeight:"bold",children:u})]})})}function Xm({sliderDirection:u="right",theme:e}){const t={sliderBackground:e?.sliderBackground??"rgba(10, 10, 20, 0.88)",borderColor:e?.borderColor??"rgba(255,255,255,0.1)",buttonBackground:e?.buttonBackground??"rgba(255,255,255,0.1)",buttonHoverBackground:e?.buttonHoverBackground??"rgba(255,255,255,0.2)",iconColor:e?.iconColor??"#fff",trackColor:e?.trackColor??"rgba(255,255,255,0.3)",fillColor:e?.fillColor??"#3b82f6",handleColor:e?.handleColor??"#fff"},{isMuted:n,volume:r}=Lr(),{toggleMute:i,setVolume:o}=kr(),[l,d]=yt.useState(!1),[c,g]=yt.useState(!1),f=yt.useRef(null),h=u==="top"||u==="bottom",y=yt.useCallback((Z,pe)=>{if(!f.current)return;const be=f.current.getBoundingClientRect(),Ce=h?Math.max(0,Math.min(1,1-(pe-be.top)/be.height)):Math.max(0,Math.min(1,(Z-be.left)/be.width));o(Ce)},[o,h]),E=yt.useCallback(Z=>{g(!0),n&&i(),y(Z.clientX,Z.clientY)},[y,n,i]);yt.useEffect(()=>{if(!c)return;const Z=be=>y(be.clientX,be.clientY),pe=()=>g(!1);return window.addEventListener("mousemove",Z),window.addEventListener("mouseup",pe),()=>{window.removeEventListener("mousemove",Z),window.removeEventListener("mouseup",pe)}},[c,y]);const S=c?r:n?0:r,C=l||c,K={position:"absolute",opacity:C?1:0,transition:"all 0.25s ease",pointerEvents:C?"auto":"none",zIndex:10,background:t.sliderBackground,backdropFilter:"blur(12px)",boxShadow:"4px 0 16px rgba(0,0,0,0.5)",overflow:"hidden"},J=(()=>{const Z=`1px solid ${t.borderColor}`;switch(u){case"left":return{...K,right:"40px",top:"0",width:C?"118px":"0px",height:"40px",paddingRight:"8px",borderRadius:"8px 0 0 8px",border:Z,borderRight:"none"};case"top":return{...K,bottom:"40px",left:"0",width:"40px",height:C?"118px":"0px",paddingBottom:"8px",borderRadius:"8px 8px 0 0",border:Z,borderBottom:"none"};case"bottom":return{...K,top:"40px",left:"0",width:"40px",height:C?"118px":"0px",paddingTop:"8px",borderRadius:"0 0 8px 8px",border:Z,borderTop:"none"};default:return{...K,left:"40px",top:"0",width:C?"118px":"0px",height:"40px",paddingLeft:"8px",borderRadius:"0 8px 8px 0",border:Z,borderLeft:"none"}}})(),re=h?{width:"40px",height:"110px",display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",position:"relative",outline:"none"}:{width:"110px",height:"40px",display:"flex",alignItems:"center",cursor:"pointer",position:"relative",paddingRight:"8px",outline:"none"},ye=h?{width:"4px",height:"100%",backgroundColor:t.trackColor,borderRadius:"2px",position:"relative"}:{width:"100%",height:"4px",backgroundColor:t.trackColor,borderRadius:"2px",position:"relative"},Ie=h?{position:"absolute",bottom:0,left:0,right:0,height:`${S*100}%`,backgroundColor:t.fillColor,borderRadius:"2px",transition:c?"none":"height 0.1s ease"}:{position:"absolute",left:0,top:0,bottom:0,width:`${S*100}%`,backgroundColor:t.fillColor,borderRadius:"2px",transition:c?"none":"width 0.1s ease"},we=c?14:12,$=h?{position:"absolute",bottom:`calc(${S*100}% - ${S*we}px)`,left:"50%",transform:"translateX(-50%)",width:`${we}px`,height:`${we}px`,backgroundColor:t.handleColor,borderRadius:"50%",boxShadow:"0 2px 4px rgba(0,0,0,0.3)",transition:c?"none":"all 0.2s ease"}:{position:"absolute",left:`calc(${S*100}% - ${S*we}px)`,top:"50%",transform:"translateY(-50%)",width:`${we}px`,height:`${we}px`,backgroundColor:t.handleColor,borderRadius:"50%",boxShadow:"0 2px 4px rgba(0,0,0,0.3)",transition:c?"none":"all 0.2s ease"};return fe.jsxs("div",{className:"virtus-volume-control",style:{position:"relative",display:"flex",alignItems:"center",height:"40px",width:"40px"},children:[fe.jsx("button",{className:"virtus-btn virtus-mute-button","aria-label":n?"Unmute":"Mute",onClick:i,style:{background:t.buttonBackground,border:"none",borderRadius:"8px",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"all 0.2s ease",flexShrink:0,position:"relative",zIndex:1},onMouseEnter:Z=>{d(!0),Z.currentTarget.style.background=t.buttonHoverBackground,Z.currentTarget.style.transform="scale(1.05)"},onMouseLeave:Z=>{Z.currentTarget.style.background=t.buttonBackground,Z.currentTarget.style.transform="scale(1)"},children:n||r===0?fe.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:t.iconColor,viewBox:"0 0 24 24",children:fe.jsx("path",{d:"M13.5 4.06c0-1.336-1.616-2.005-2.56-1.06l-4.5 4.5H4.508c-1.141 0-2.318.664-2.66 1.905A9.76 9.76 0 0 0 1.5 12c0 .898.121 1.768.35 2.595.341 1.24 1.518 1.905 2.659 1.905h1.93l4.5 4.5c.945.945 2.561.276 2.561-1.06V4.06ZM17.78 9.22a.75.75 0 1 0-1.06 1.06L18.44 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06l1.72-1.72 1.72 1.72a.75.75 0 1 0 1.06-1.06L20.56 12l1.72-1.72a.75.75 0 1 0-1.06-1.06l-1.72 1.72-1.72-1.72Z"})}):r<.5?fe.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:t.iconColor,viewBox:"0 0 24 24",children:fe.jsx("path",{d:"M13.5 4.06c0-1.336-1.616-2.005-2.56-1.06l-4.5 4.5H4.508c-1.141 0-2.318.664-2.66 1.905A9.76 9.76 0 0 0 1.5 12c0 .898.121 1.768.35 2.595.341 1.24 1.518 1.905 2.659 1.905h1.93l4.5 4.5c.945.945 2.561.276 2.561-1.06V4.06Z"})}):fe.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:t.iconColor,viewBox:"0 0 24 24",children:[fe.jsx("path",{d:"M13.5 4.06c0-1.336-1.616-2.005-2.56-1.06l-4.5 4.5H4.508c-1.141 0-2.318.664-2.66 1.905A9.76 9.76 0 0 0 1.5 12c0 .898.121 1.768.35 2.595.341 1.24 1.518 1.905 2.659 1.905h1.93l4.5 4.5c.945.945 2.561.276 2.561-1.06V4.06Z"}),fe.jsx("path",{d:"M18.584 5.106a.75.75 0 0 1 1.06 0 11.5 11.5 0 0 1 0 13.588.75.75 0 0 1-1.06-1.06 10 10 0 0 0 0-11.468.75.75 0 0 1 0-1.06Z"}),fe.jsx("path",{d:"M15.932 7.757a.75.75 0 0 1 1.061 0 6.5 6.5 0 0 1 0 8.486.75.75 0 0 1-1.06-1.06 5 5 0 0 0 0-6.366.75.75 0 0 1 0-1.06Z"})]})}),fe.jsx("div",{onMouseEnter:()=>d(!0),onMouseLeave:()=>{c||d(!1)},style:J,children:fe.jsx("div",{ref:f,role:"slider",tabIndex:0,"aria-label":"Volume","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(S*100),"aria-valuetext":n?"Muted":`${Math.round(S*100)}%`,onMouseDown:E,onKeyDown:Z=>{const Ce=n?0:r;switch(Z.key){case"ArrowRight":case"ArrowUp":Z.preventDefault(),o(Math.min(1,Ce+.05));break;case"ArrowLeft":case"ArrowDown":Z.preventDefault(),o(Math.max(0,Ce-.05));break;case"PageUp":Z.preventDefault(),o(Math.min(1,Ce+.2));break;case"PageDown":Z.preventDefault(),o(Math.max(0,Ce-.2));break;case"Home":Z.preventDefault(),o(0);break;case"End":Z.preventDefault(),o(1);break;case"m":case"M":Z.preventDefault(),i();break}},style:re,children:fe.jsxs("div",{style:ye,children:[fe.jsx("div",{style:Ie}),fe.jsx("div",{style:$})]})})})]})}const hA=[.25,.5,.75,1,1.25,1.5,1.75,2];function gA(){const{setPlaybackRate:u}=kr(),[e,t]=yt.useState(1),n=yt.useCallback(i=>{u(i),t(i)},[u]),r=e===1?"1×":`${e}×`;return fe.jsxs(Bm,{children:[fe.jsx(jm,{children:fe.jsx("button",{className:"virtus-speed-button","aria-label":`Playback speed: ${r}`,"aria-haspopup":"true",style:{background:"transparent",border:"none",color:"white",cursor:"pointer",padding:"8px",borderRadius:"8px",display:"flex",alignItems:"center",justifyContent:"center",height:"40px",minWidth:"40px",transition:"all 0.2s ease",fontSize:"13px",fontWeight:"600",letterSpacing:"-0.3px",whiteSpace:"nowrap"},onMouseEnter:i=>{i.currentTarget.style.background="rgba(255, 255, 255, 0.15)",i.currentTarget.style.transform="scale(1.05)"},onMouseLeave:i=>{i.currentTarget.style.background="transparent",i.currentTarget.style.transform="scale(1)"},title:"Playback speed",children:r})}),fe.jsx(qm,{placement:"top-right",children:fe.jsxs("div",{style:{minWidth:"130px"},children:[fe.jsx("div",{style:{padding:"8px 12px",fontSize:"12px",fontWeight:"600",color:"rgba(255, 255, 255, 0.6)",borderBottom:"1px solid rgba(255, 255, 255, 0.1)",textTransform:"uppercase",letterSpacing:"0.5px"},children:"Speed"}),[...hA].reverse().map(i=>fe.jsx(Yl,{selected:e===i,onClick:()=>n(i),children:fe.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:fe.jsx("span",{children:i===1?"1× (Normal)":`${i}×`})})},i))]})})]})}const bu=yt.createContext({textColor:"#fff",accentColor:"#6366f1",accentAlpha15:"rgba(99,102,241,0.15)",accentAlpha30:"rgba(99,102,241,0.3)",borderColor:"rgba(255,255,255,0.07)"});function Ih(u,e){const t=u.replace("#",""),n=t.length===3?t.split("").map(l=>l+l).join(""):t,r=parseInt(n.slice(0,2),16),i=parseInt(n.slice(2,4),16),o=parseInt(n.slice(4,6),16);return isNaN(r)||isNaN(i)||isNaN(o)?`rgba(99,102,241,${e})`:`rgba(${r},${i},${o},${e})`}const mA=60,pA=[.25,.5,.75,1,1.25,1.5,1.75,2],yA={position:"absolute",backdropFilter:"blur(16px)",borderRadius:"14px",overflow:"hidden",zIndex:9999,animation:"settingsFadeIn 0.18s ease-out",fontFamily:"system-ui, -apple-system, sans-serif",transition:"width 0.2s ease"},EA={display:"flex",alignItems:"center",gap:"8px",padding:"11px 14px",fontSize:"13px",fontWeight:600},bA={display:"flex",alignItems:"center",width:"100%",padding:"9px 14px",background:"transparent",border:"none",cursor:"pointer",fontSize:"13.5px",textAlign:"left",gap:"10px",outline:"none",transition:"background 0.12s"};function wh({values:u,color:e,gradId:t}){if(u.length<2)return fe.jsx("svg",{width:292,height:52,style:{display:"block"},children:fe.jsx("line",{x1:0,y1:52/2,x2:292,y2:52/2,stroke:"rgba(255,255,255,0.08)",strokeWidth:1,strokeDasharray:"4 4"})});const i=Math.max(...u,.001),o=u.map((g,f)=>[f/(mA-1)*292,48-g/i*42]),l=o.map(([g,f],h)=>`${h===0?"M":"L"}${g.toFixed(1)},${f.toFixed(1)}`).join(" "),d=l+` L${292 .toFixed(1)},52 L0,52 Z`,c=o[o.length-1];return fe.jsxs("svg",{width:292,height:52,style:{display:"block",overflow:"visible"},children:[fe.jsx("defs",{children:fe.jsxs("linearGradient",{id:t,x1:"0",y1:"0",x2:"0",y2:"1",children:[fe.jsx("stop",{offset:"0%",stopColor:e,stopOpacity:.4}),fe.jsx("stop",{offset:"100%",stopColor:e,stopOpacity:.02})]})}),fe.jsx("path",{d,fill:`url(#${t})`}),fe.jsx("path",{d:l,fill:"none",stroke:e,strokeWidth:1.8,strokeLinejoin:"round",strokeLinecap:"round"}),fe.jsx("circle",{cx:c[0],cy:c[1],r:3.5,fill:e}),fe.jsx("circle",{cx:c[0],cy:c[1],r:6,fill:e,fillOpacity:.25})]})}function Sr({label:u,value:e,icon:t,onClick:n,selected:r=!1,isBack:i=!1}){const[o,l]=yt.useState(!1),{textColor:d,accentColor:c,accentAlpha15:g,accentAlpha30:f}=yt.useContext(bu);return fe.jsxs("button",{role:"menuitem","aria-checked":r,onClick:n,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{...bA,color:d,background:o?"rgba(255,255,255,0.07)":r?g:"transparent",fontWeight:r?600:400,justifyContent:"space-between"},children:[fe.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"10px",flex:1,minWidth:0},children:[i?fe.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"rgba(255,255,255,0.6)",strokeWidth:"2.5",style:{flexShrink:0},children:fe.jsx("polyline",{points:"15 18 9 12 15 6"})}):t?fe.jsx("span",{style:{width:"28px",height:"28px",borderRadius:"7px",background:r?f:"rgba(255,255,255,0.08)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:r?c:"rgba(255,255,255,0.65)",transition:"background 0.15s, color 0.15s"},children:t}):r?fe.jsx("svg",{"aria-hidden":"true",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:c,strokeWidth:"3",style:{flexShrink:0},children:fe.jsx("polyline",{points:"20 6 9 17 4 12"})}):fe.jsx("span",{style:{display:"inline-block",width:"14px",flexShrink:0}}),fe.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u})]}),e!==void 0&&fe.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"4px",flexShrink:0},children:[fe.jsx("span",{style:{fontSize:"12px",color:"rgba(255,255,255,0.45)",maxWidth:"90px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),fe.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"rgba(255,255,255,0.35)",strokeWidth:"2.5",children:fe.jsx("polyline",{points:"9 18 15 12 9 6"})})]})]})}function Rh(){const{borderColor:u}=yt.useContext(bu);return fe.jsx("div",{style:{height:"1px",background:u,margin:"2px 0"}})}function Qm({theme:u,panelPosition:e}={}){const t=u?.accentColor??"#6366f1",n=u?.textColor??"#fff",r=u?.background??"rgba(12, 12, 20, 0.97)",i=u?.borderColor??"rgba(255,255,255,0.1)",o={textColor:n,accentColor:t,accentAlpha15:t.startsWith("#")?Ih(t,.15):"rgba(99,102,241,0.15)",accentAlpha30:t.startsWith("#")?Ih(t,.3):"rgba(99,102,241,0.3)",borderColor:i.replace("0.1)","0.07)")},l={...EA,color:n,borderBottom:`1px solid ${i.replace("0.1)","0.08)")}`},d=e?.vertical??"top",c=e?.horizontal??"right",{setQuality:g,setAudioTrack:f,setPlaybackRate:h,setSubtitleTrack:y,getPlayerStats:E}=kr(),S=is(),{playbackRate:C=1,isLive:K}=Lr(),{style:J,setStyle:re}=Nm(),[ye,Ie]=yt.useState(!1),[we,$]=yt.useState("root");yt.useEffect(()=>{K&&we==="speed"&&$("root")},[K,we]);const[Z,pe]=yt.useState([]),[be,Ce]=yt.useState(null),[Qe,xe]=yt.useState([]),[Je,Oe]=yt.useState(""),[Me,Ve]=yt.useState([]),[ct,at]=yt.useState(null),[vt,nt]=yt.useState(null),[st,jt]=yt.useState([]);yt.useEffect(()=>{const rt=()=>{pe(S.getAvailableQualities()),Ce(S.getQuality()),xe(S.getAvailableAudioTracks()),Oe(S.getAudioTrack()),Ve(S.getSubtitleTracks()),at(S.getActiveSubtitleLanguage())};S.events.on("tracksready",rt),S.events.on("streamTypeDetected",rt),S.events.on("qualitychange",rt),S.events.on("loadedmetadata",rt),rt();const xt=setTimeout(rt,100);return()=>{S.events.off("tracksready",rt),S.events.off("streamTypeDetected",rt),S.events.off("qualitychange",rt),S.events.off("loadedmetadata",rt),clearTimeout(xt)}},[S]),yt.useEffect(()=>{ye&&(pe(S.getAvailableQualities()),Ce(S.getQuality()),xe(S.getAvailableAudioTracks()),Oe(S.getAudioTrack()),Ve(S.getSubtitleTracks()),at(S.getActiveSubtitleLanguage()))},[ye,S]);const Qt=Qe.length>1;yt.useEffect(()=>{if(we!=="statistics")return;const rt=()=>{const gn=E();nt(gn),jt(Nn=>[...Nn.slice(-59),gn])};rt();const xt=setInterval(rt,1e3);return()=>{clearInterval(xt),jt([])}},[we,E]);const Ne=yt.useRef(null);yt.useEffect(()=>{if(!ye)return;const rt=xt=>{Ne.current&&!Ne.current.contains(xt.target)&&(Ie(!1),$("root"))};return document.addEventListener("pointerdown",rt),()=>document.removeEventListener("pointerdown",rt)},[ye]),yt.useEffect(()=>{if(!ye)return;const rt=xt=>{xt.key==="Escape"&&(Ie(!1),$("root")),xt.key==="Backspace"&&we!=="root"&&$("root")};return document.addEventListener("keydown",rt),()=>document.removeEventListener("keydown",rt)},[ye,we]);const Pe=yt.useCallback(()=>{Ie(rt=>(rt&&$("root"),!rt))},[]),ft=be?be.id==="auto"?"Auto":be.label:"Auto",W=C===1?"1×":`${C}×`,V=Qe.find(rt=>rt.id===Je)?.label??"Auto",I=ct===null?"Off":Me.find(rt=>rt.language===ct)?.label??ct,D=fe.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[fe.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),fe.jsx("path",{d:"M8 21h8M12 17v4"}),fe.jsx("path",{d:"m7 8 2 2 4-4 2 2"})]}),oe=fe.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[fe.jsx("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0 1 1 0 0 0-2 0"}),fe.jsx("path",{d:"M12 2a10 10 0 0 1 7.39 16.74M12 2A10 10 0 0 0 4.61 18.74"}),fe.jsx("path",{d:"m16.24 7.76-2.12 2.12"})]}),Q=fe.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[fe.jsx("path",{d:"M3 18v-6a9 9 0 0 1 18 0v6"}),fe.jsx("path",{d:"M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3zM3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3z"})]}),Fe=fe.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[fe.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"}),fe.jsx("line",{x1:"9",y1:"10",x2:"15",y2:"10"}),fe.jsx("line",{x1:"9",y1:"14",x2:"12",y2:"14"})]}),Ye=fe.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[fe.jsx("circle",{cx:"12",cy:"12",r:"3"}),fe.jsx("path",{d:"M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"}),fe.jsx("polyline",{points:"16 16 12 20 8 16"})]}),Ue=fe.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[fe.jsx("line",{x1:"18",y1:"20",x2:"18",y2:"10"}),fe.jsx("line",{x1:"12",y1:"20",x2:"12",y2:"4"}),fe.jsx("line",{x1:"6",y1:"20",x2:"6",y2:"14"})]}),qe=()=>fe.jsxs(fe.Fragment,{children:[fe.jsxs("div",{style:l,children:[fe.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"rgba(255,255,255,0.6)",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[fe.jsx("circle",{cx:"12",cy:"12",r:"3"}),fe.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),"Settings"]}),fe.jsxs("div",{style:{padding:"4px 0"},children:[fe.jsx(Sr,{icon:D,label:"Quality",value:ft,onClick:()=>$("quality")}),!K&&fe.jsx(Sr,{icon:oe,label:"Speed",value:W,onClick:()=>$("speed")}),Qt&&fe.jsx(Sr,{icon:Q,label:"Audio Track",value:V,onClick:()=>$("audio")}),fe.jsx(Rh,{}),fe.jsx(Sr,{icon:Fe,label:"Subtitles",value:I,onClick:()=>$("subtitles")}),fe.jsx(Sr,{icon:Ye,label:"Subtitle Style",value:`${J.fontSize}px`,onClick:()=>$("subtitleStyle")}),fe.jsx(Rh,{}),fe.jsx(Sr,{icon:Ue,label:"Statistics",onClick:()=>$("statistics")})]})]}),De=()=>fe.jsxs(fe.Fragment,{children:[fe.jsx("div",{style:l,children:fe.jsx(Sr,{label:"Quality",isBack:!0,onClick:()=>$("root")})}),fe.jsxs("div",{style:{padding:"4px 0",maxHeight:"280px",overflowY:"auto"},children:[Z.map(rt=>fe.jsx(Sr,{label:rt.id==="auto"?"Auto":rt.label,selected:be?.id===rt.id,onClick:()=>{g(rt.id),Ce(rt),Ie(!1),$("root")}},rt.id)),Z.length===0&&fe.jsx("div",{style:{padding:"10px 14px",color:"rgba(255,255,255,0.4)",fontSize:"13px"},children:"No quality levels available"})]})]}),je=()=>fe.jsxs(fe.Fragment,{children:[fe.jsx("div",{style:l,children:fe.jsx(Sr,{label:"Speed",isBack:!0,onClick:()=>$("root")})}),fe.jsx("div",{style:{padding:"4px 0"},children:pA.map(rt=>fe.jsx(Sr,{label:rt===1?"1× (Normal)":`${rt}×`,selected:C===rt,onClick:()=>{h(rt),Ie(!1),$("root")}},rt))})]}),et=()=>fe.jsxs(fe.Fragment,{children:[fe.jsx("div",{style:l,children:fe.jsx(Sr,{label:"Audio Track",isBack:!0,onClick:()=>$("root")})}),fe.jsx("div",{style:{padding:"4px 0"},children:Qe.map(rt=>fe.jsx(Sr,{label:rt.label||rt.language||rt.id,selected:Je===rt.id,onClick:()=>{f(rt.id),Oe(rt.id),Ie(!1),$("root")}},rt.id))})]}),Xe=()=>fe.jsxs(fe.Fragment,{children:[fe.jsx("div",{style:l,children:fe.jsx(Sr,{label:"Subtitles",isBack:!0,onClick:()=>$("root")})}),fe.jsxs("div",{style:{padding:"4px 0"},children:[fe.jsx(Sr,{label:"Off",selected:ct===null,onClick:()=>{y(null),at(null),Ie(!1),$("root")}},"off"),Me.map((rt,xt)=>fe.jsx(Sr,{label:rt.label||rt.language,selected:ct===rt.language,onClick:()=>{y(rt.language),at(rt.language),Ie(!1),$("root")}},rt.url||`${rt.language}-${xt}`)),Me.length===0&&fe.jsx("div",{style:{padding:"10px 14px",color:"rgba(255,255,255,0.4)",fontSize:"13px"},children:"No subtitle tracks available"})]})]}),ht=()=>fe.jsxs(fe.Fragment,{children:[fe.jsx("div",{style:l,children:fe.jsx(Sr,{label:"Subtitle Style",isBack:!0,onClick:()=>$("root")})}),fe.jsxs("div",{style:{padding:"8px 14px 12px",display:"flex",flexDirection:"column",gap:"14px"},children:[fe.jsxs("div",{children:[fe.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"6px"},children:[fe.jsx("span",{style:{fontSize:"13px",color:"rgba(255,255,255,0.8)"},children:"Position"}),fe.jsxs("span",{style:{fontSize:"12px",color:"rgba(255,255,255,0.5)"},children:[J.bottomOffset,"px from bottom"]})]}),fe.jsx("input",{type:"range",min:10,max:200,step:5,value:J.bottomOffset,onChange:rt=>re({bottomOffset:Number(rt.target.value)}),style:{width:"100%",accentColor:"#3b82f6",cursor:"pointer"}})]}),fe.jsxs("div",{children:[fe.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"6px"},children:[fe.jsx("span",{style:{fontSize:"13px",color:"rgba(255,255,255,0.8)"},children:"Font Size"}),fe.jsxs("span",{style:{fontSize:"12px",color:"rgba(255,255,255,0.5)"},children:[J.fontSize,"px"]})]}),fe.jsx("input",{type:"range",min:12,max:40,step:1,value:J.fontSize,onChange:rt=>re({fontSize:Number(rt.target.value)}),style:{width:"100%",accentColor:"#3b82f6",cursor:"pointer"}})]}),fe.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[fe.jsx("span",{style:{fontSize:"13px",color:"rgba(255,255,255,0.8)"},children:"Background"}),fe.jsx("button",{onClick:()=>re({background:J.background?"":"rgba(0,0,0,0.75)"}),style:{padding:"4px 12px",borderRadius:"6px",border:"1px solid rgba(255,255,255,0.2)",background:J.background?"#3b82f6":"transparent",color:"#fff",fontSize:"12px",cursor:"pointer"},children:J.background?"On":"Off"})]}),fe.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[fe.jsx("span",{style:{fontSize:"13px",color:"rgba(255,255,255,0.8)"},children:"Text Color"}),fe.jsx("div",{style:{display:"flex",gap:"6px"},children:["#ffffff","#ffff00","#00ff00","#00cfff"].map(rt=>fe.jsx("button",{onClick:()=>re({color:rt}),title:rt,style:{width:"22px",height:"22px",borderRadius:"50%",background:rt,border:J.color===rt?"2px solid #3b82f6":"2px solid transparent",cursor:"pointer",outline:"none",padding:0,flexShrink:0}},rt))})]})]})]}),Jt=()=>{const rt=st.map(Pt=>Pt.bandwidth),xt=st.map(Pt=>Pt.bufferHealth),gn=vt?.bandwidth??0,Nn=vt?.bufferHealth??0,Hn=Pt=>Pt>=1e3?`${(Pt/1e3).toFixed(2)} Mbps`:`${Pt.toFixed(0)} kbps`,sr=(Pt,Bt)=>fe.jsxs("div",{style:{background:"rgba(255,255,255,0.04)",borderRadius:"8px",padding:"7px 10px",flex:"1 1 0",minWidth:0},children:[fe.jsx("div",{style:{fontSize:"10px",color:"rgba(255,255,255,0.4)",textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:"3px"},children:Pt}),fe.jsx("div",{style:{fontSize:"12px",color:"#fff",fontFamily:"monospace",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Bt})]}),ar=vt?.segmentUrl??"",fr=ar.length>36?"…"+ar.slice(-36):ar||"—";return fe.jsxs(fe.Fragment,{children:[fe.jsxs("div",{style:{...l,justifyContent:"space-between"},children:[fe.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:fe.jsx(Sr,{label:"Statistics",isBack:!0,onClick:()=>$("root")})}),fe.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",paddingRight:"14px",flexShrink:0},children:[fe.jsx("span",{style:{width:"7px",height:"7px",borderRadius:"50%",background:"#22c55e",boxShadow:"0 0 6px #22c55e",animation:"statsPulse 1.6s ease-in-out infinite",display:"inline-block"}}),fe.jsx("span",{style:{fontSize:"11px",color:"rgba(255,255,255,0.4)"},children:"LIVE"})]})]}),fe.jsxs("div",{style:{padding:"0 14px 12px",overflowY:"auto",maxHeight:"420px"},children:[fe.jsxs("div",{style:{marginTop:"12px"},children:[fe.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginBottom:"6px"},children:[fe.jsx("span",{style:{fontSize:"11px",color:"rgba(255,255,255,0.45)",textTransform:"uppercase",letterSpacing:"0.07em"},children:"Connection Speed"}),fe.jsx("span",{style:{fontSize:"16px",fontWeight:600,color:"#4ade80",fontFamily:"monospace"},children:vt?Hn(gn):"—"})]}),fe.jsx("div",{style:{background:"rgba(0,0,0,0.3)",borderRadius:"8px",padding:"6px 8px"},children:fe.jsx(wh,{values:rt,color:"#4ade80",gradId:"bw-grad"})})]}),fe.jsxs("div",{style:{marginTop:"14px"},children:[fe.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginBottom:"6px"},children:[fe.jsx("span",{style:{fontSize:"11px",color:"rgba(255,255,255,0.45)",textTransform:"uppercase",letterSpacing:"0.07em"},children:"Buffer Health"}),fe.jsx("span",{style:{fontSize:"16px",fontWeight:600,color:"#60a5fa",fontFamily:"monospace"},children:vt?`${Nn.toFixed(1)} s`:"—"})]}),fe.jsx("div",{style:{background:"rgba(0,0,0,0.3)",borderRadius:"8px",padding:"6px 8px"},children:fe.jsx(wh,{values:xt,color:"#60a5fa",gradId:"buf-grad"})})]}),fe.jsx("div",{style:{height:"1px",background:"rgba(255,255,255,0.07)",margin:"14px 0 12px"}}),fe.jsxs("div",{style:{display:"flex",gap:"6px"},children:[sr("Codec",vt?.codec||"—"),sr("Resolution",vt?.resolution||"—"),sr("Dropped",vt?`${vt.droppedFrames}/${vt.totalFrames}`:"—")]}),fe.jsxs("div",{style:{display:"flex",gap:"6px",marginTop:"6px"},children:[sr("Stream",vt?.streamType||"—"),fe.jsxs("div",{style:{background:"rgba(255,255,255,0.04)",borderRadius:"8px",padding:"7px 10px",flex:"2 1 0",minWidth:0},children:[fe.jsx("div",{style:{fontSize:"10px",color:"rgba(255,255,255,0.4)",textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:"3px"},children:"Segment"}),fe.jsx("div",{style:{fontSize:"11px",color:"rgba(255,255,255,0.7)",fontFamily:"monospace",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:ar,children:fr})]})]})]}),fe.jsx("style",{children:`
243
+ `})]})}function Ym({seconds:u=15}){const{skipBackward:e}=kr(),{isLive:t}=Lr();if(t)return null;const n=()=>{e(u)};return fe.jsx("button",{className:`virtus-btn virtus-skip-backward-button ${as.controlButton}`,"aria-label":`Skip Backward ${u}s`,onClick:n,style:{position:"relative"},children:fe.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[fe.jsx("path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),fe.jsx("path",{d:"M2 12l-2-2m2 2l2-2",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),fe.jsx("text",{x:"12",y:"16",fontSize:"10",fill:"currentColor",textAnchor:"middle",fontWeight:"bold",children:u})]})})}function Wm({seconds:u=15}){const{skipForward:e}=kr(),{isLive:t}=Lr();if(t)return null;const n=()=>{e(u)};return fe.jsx("button",{className:`virtus-btn virtus-skip-forward-button ${as.controlButton}`,"aria-label":`Skip Forward ${u}s`,onClick:n,style:{position:"relative"},children:fe.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[fe.jsx("path",{d:"M12 2c5.5 0 10 4.5 10 10s-4.5 10-10 10-10-4.5-10-10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),fe.jsx("path",{d:"M22 12l2-2m-2 2l-2-2",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),fe.jsx("text",{x:"12",y:"16",fontSize:"10",fill:"currentColor",textAnchor:"middle",fontWeight:"bold",children:u})]})})}function Xm({sliderDirection:u="right",theme:e}){const t={sliderBackground:e?.sliderBackground??"rgba(10, 10, 20, 0.88)",borderColor:e?.borderColor??"rgba(255,255,255,0.1)",buttonBackground:e?.buttonBackground??"rgba(255,255,255,0.1)",buttonHoverBackground:e?.buttonHoverBackground??"rgba(255,255,255,0.2)",iconColor:e?.iconColor??"#fff",trackColor:e?.trackColor??"rgba(255,255,255,0.3)",fillColor:e?.fillColor??"#3b82f6",handleColor:e?.handleColor??"#fff"},{isMuted:n,volume:r}=Lr(),{toggleMute:i,setVolume:o}=kr(),[l,d]=yt.useState(!1),[c,g]=yt.useState(!1),f=yt.useRef(null),h=u==="top"||u==="bottom",y=yt.useCallback((Z,pe)=>{if(!f.current)return;const be=f.current.getBoundingClientRect(),Ce=h?Math.max(0,Math.min(1,1-(pe-be.top)/be.height)):Math.max(0,Math.min(1,(Z-be.left)/be.width));o(Ce)},[o,h]),E=yt.useCallback(Z=>{g(!0),n&&i(),y(Z.clientX,Z.clientY)},[y,n,i]);yt.useEffect(()=>{if(!c)return;const Z=be=>y(be.clientX,be.clientY),pe=()=>g(!1);return window.addEventListener("mousemove",Z),window.addEventListener("mouseup",pe),()=>{window.removeEventListener("mousemove",Z),window.removeEventListener("mouseup",pe)}},[c,y]);const S=c?r:n?0:r,C=l||c,K={position:"absolute",opacity:C?1:0,transition:"all 0.25s ease",pointerEvents:C?"auto":"none",zIndex:10,background:t.sliderBackground,backdropFilter:"blur(12px)",boxShadow:"4px 0 16px rgba(0,0,0,0.5)",overflow:"hidden"},J=(()=>{const Z=`1px solid ${t.borderColor}`;switch(u){case"left":return{...K,right:"40px",top:"0",width:C?"118px":"0px",height:"40px",paddingRight:"8px",borderRadius:"8px 0 0 8px",border:Z,borderRight:"none"};case"top":return{...K,bottom:"40px",left:"0",width:"40px",height:C?"118px":"0px",paddingBottom:"8px",borderRadius:"8px 8px 0 0",border:Z,borderBottom:"none"};case"bottom":return{...K,top:"40px",left:"0",width:"40px",height:C?"118px":"0px",paddingTop:"8px",borderRadius:"0 0 8px 8px",border:Z,borderTop:"none"};default:return{...K,left:"40px",top:"0",width:C?"118px":"0px",height:"40px",paddingLeft:"8px",borderRadius:"0 8px 8px 0",border:Z,borderLeft:"none"}}})(),re=h?{width:"40px",height:"110px",display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",position:"relative",outline:"none"}:{width:"110px",height:"40px",display:"flex",alignItems:"center",cursor:"pointer",position:"relative",paddingRight:"8px",outline:"none"},ye=h?{width:"4px",height:"100%",backgroundColor:t.trackColor,borderRadius:"2px",position:"relative"}:{width:"100%",height:"4px",backgroundColor:t.trackColor,borderRadius:"2px",position:"relative"},Ie=h?{position:"absolute",bottom:0,left:0,right:0,height:`${S*100}%`,backgroundColor:t.fillColor,borderRadius:"2px",transition:c?"none":"height 0.1s ease"}:{position:"absolute",left:0,top:0,bottom:0,width:`${S*100}%`,backgroundColor:t.fillColor,borderRadius:"2px",transition:c?"none":"width 0.1s ease"},we=c?14:12,$=h?{position:"absolute",bottom:`calc(${S*100}% - ${S*we}px)`,left:"50%",transform:"translateX(-50%)",width:`${we}px`,height:`${we}px`,backgroundColor:t.handleColor,borderRadius:"50%",boxShadow:"0 2px 4px rgba(0,0,0,0.3)",transition:c?"none":"all 0.2s ease"}:{position:"absolute",left:`calc(${S*100}% - ${S*we}px)`,top:"50%",transform:"translateY(-50%)",width:`${we}px`,height:`${we}px`,backgroundColor:t.handleColor,borderRadius:"50%",boxShadow:"0 2px 4px rgba(0,0,0,0.3)",transition:c?"none":"all 0.2s ease"};return fe.jsxs("div",{className:"virtus-volume-control",style:{position:"relative",display:"flex",alignItems:"center",height:"40px",width:"40px"},onMouseLeave:()=>{c||d(!1)},children:[fe.jsx("button",{className:"virtus-btn virtus-mute-button","aria-label":n?"Unmute":"Mute",onClick:i,style:{background:t.buttonBackground,border:"none",borderRadius:"8px",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"all 0.2s ease",flexShrink:0,position:"relative",zIndex:1},onMouseEnter:Z=>{d(!0),Z.currentTarget.style.background=t.buttonHoverBackground,Z.currentTarget.style.transform="scale(1.05)"},onMouseLeave:Z=>{Z.currentTarget.style.background=t.buttonBackground,Z.currentTarget.style.transform="scale(1)"},children:n||r===0?fe.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:t.iconColor,viewBox:"0 0 24 24",children:fe.jsx("path",{d:"M13.5 4.06c0-1.336-1.616-2.005-2.56-1.06l-4.5 4.5H4.508c-1.141 0-2.318.664-2.66 1.905A9.76 9.76 0 0 0 1.5 12c0 .898.121 1.768.35 2.595.341 1.24 1.518 1.905 2.659 1.905h1.93l4.5 4.5c.945.945 2.561.276 2.561-1.06V4.06ZM17.78 9.22a.75.75 0 1 0-1.06 1.06L18.44 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06l1.72-1.72 1.72 1.72a.75.75 0 1 0 1.06-1.06L20.56 12l1.72-1.72a.75.75 0 1 0-1.06-1.06l-1.72 1.72-1.72-1.72Z"})}):r<.5?fe.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:t.iconColor,viewBox:"0 0 24 24",children:fe.jsx("path",{d:"M13.5 4.06c0-1.336-1.616-2.005-2.56-1.06l-4.5 4.5H4.508c-1.141 0-2.318.664-2.66 1.905A9.76 9.76 0 0 0 1.5 12c0 .898.121 1.768.35 2.595.341 1.24 1.518 1.905 2.659 1.905h1.93l4.5 4.5c.945.945 2.561.276 2.561-1.06V4.06Z"})}):fe.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:t.iconColor,viewBox:"0 0 24 24",children:[fe.jsx("path",{d:"M13.5 4.06c0-1.336-1.616-2.005-2.56-1.06l-4.5 4.5H4.508c-1.141 0-2.318.664-2.66 1.905A9.76 9.76 0 0 0 1.5 12c0 .898.121 1.768.35 2.595.341 1.24 1.518 1.905 2.659 1.905h1.93l4.5 4.5c.945.945 2.561.276 2.561-1.06V4.06Z"}),fe.jsx("path",{d:"M18.584 5.106a.75.75 0 0 1 1.06 0 11.5 11.5 0 0 1 0 13.588.75.75 0 0 1-1.06-1.06 10 10 0 0 0 0-11.468.75.75 0 0 1 0-1.06Z"}),fe.jsx("path",{d:"M15.932 7.757a.75.75 0 0 1 1.061 0 6.5 6.5 0 0 1 0 8.486.75.75 0 0 1-1.06-1.06 5 5 0 0 0 0-6.366.75.75 0 0 1 0-1.06Z"})]})}),fe.jsx("div",{onMouseEnter:()=>d(!0),style:J,children:fe.jsx("div",{ref:f,role:"slider",tabIndex:0,"aria-label":"Volume","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(S*100),"aria-valuetext":n?"Muted":`${Math.round(S*100)}%`,onMouseDown:E,onKeyDown:Z=>{const Ce=n?0:r;switch(Z.key){case"ArrowRight":case"ArrowUp":Z.preventDefault(),o(Math.min(1,Ce+.05));break;case"ArrowLeft":case"ArrowDown":Z.preventDefault(),o(Math.max(0,Ce-.05));break;case"PageUp":Z.preventDefault(),o(Math.min(1,Ce+.2));break;case"PageDown":Z.preventDefault(),o(Math.max(0,Ce-.2));break;case"Home":Z.preventDefault(),o(0);break;case"End":Z.preventDefault(),o(1);break;case"m":case"M":Z.preventDefault(),i();break}},style:re,children:fe.jsxs("div",{style:ye,children:[fe.jsx("div",{style:Ie}),fe.jsx("div",{style:$})]})})})]})}const hA=[.25,.5,.75,1,1.25,1.5,1.75,2];function gA(){const{setPlaybackRate:u}=kr(),[e,t]=yt.useState(1),n=yt.useCallback(i=>{u(i),t(i)},[u]),r=e===1?"1×":`${e}×`;return fe.jsxs(Bm,{children:[fe.jsx(jm,{children:fe.jsx("button",{className:"virtus-speed-button","aria-label":`Playback speed: ${r}`,"aria-haspopup":"true",style:{background:"transparent",border:"none",color:"white",cursor:"pointer",padding:"8px",borderRadius:"8px",display:"flex",alignItems:"center",justifyContent:"center",height:"40px",minWidth:"40px",transition:"all 0.2s ease",fontSize:"13px",fontWeight:"600",letterSpacing:"-0.3px",whiteSpace:"nowrap"},onMouseEnter:i=>{i.currentTarget.style.background="rgba(255, 255, 255, 0.15)",i.currentTarget.style.transform="scale(1.05)"},onMouseLeave:i=>{i.currentTarget.style.background="transparent",i.currentTarget.style.transform="scale(1)"},title:"Playback speed",children:r})}),fe.jsx(qm,{placement:"top-right",children:fe.jsxs("div",{style:{minWidth:"130px"},children:[fe.jsx("div",{style:{padding:"8px 12px",fontSize:"12px",fontWeight:"600",color:"rgba(255, 255, 255, 0.6)",borderBottom:"1px solid rgba(255, 255, 255, 0.1)",textTransform:"uppercase",letterSpacing:"0.5px"},children:"Speed"}),[...hA].reverse().map(i=>fe.jsx(Yl,{selected:e===i,onClick:()=>n(i),children:fe.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:fe.jsx("span",{children:i===1?"1× (Normal)":`${i}×`})})},i))]})})]})}const bu=yt.createContext({textColor:"#fff",accentColor:"#6366f1",accentAlpha15:"rgba(99,102,241,0.15)",accentAlpha30:"rgba(99,102,241,0.3)",borderColor:"rgba(255,255,255,0.07)"});function Ih(u,e){const t=u.replace("#",""),n=t.length===3?t.split("").map(l=>l+l).join(""):t,r=parseInt(n.slice(0,2),16),i=parseInt(n.slice(2,4),16),o=parseInt(n.slice(4,6),16);return isNaN(r)||isNaN(i)||isNaN(o)?`rgba(99,102,241,${e})`:`rgba(${r},${i},${o},${e})`}const mA=60,pA=[.25,.5,.75,1,1.25,1.5,1.75,2],yA={position:"absolute",backdropFilter:"blur(16px)",borderRadius:"14px",overflow:"hidden",zIndex:9999,animation:"settingsFadeIn 0.18s ease-out",fontFamily:"system-ui, -apple-system, sans-serif",transition:"width 0.2s ease"},EA={display:"flex",alignItems:"center",gap:"8px",padding:"11px 14px",fontSize:"13px",fontWeight:600},bA={display:"flex",alignItems:"center",width:"100%",padding:"9px 14px",background:"transparent",border:"none",cursor:"pointer",fontSize:"13.5px",textAlign:"left",gap:"10px",outline:"none",transition:"background 0.12s"};function wh({values:u,color:e,gradId:t}){if(u.length<2)return fe.jsx("svg",{width:292,height:52,style:{display:"block"},children:fe.jsx("line",{x1:0,y1:52/2,x2:292,y2:52/2,stroke:"rgba(255,255,255,0.08)",strokeWidth:1,strokeDasharray:"4 4"})});const i=Math.max(...u,.001),o=u.map((g,f)=>[f/(mA-1)*292,48-g/i*42]),l=o.map(([g,f],h)=>`${h===0?"M":"L"}${g.toFixed(1)},${f.toFixed(1)}`).join(" "),d=l+` L${292 .toFixed(1)},52 L0,52 Z`,c=o[o.length-1];return fe.jsxs("svg",{width:292,height:52,style:{display:"block",overflow:"visible"},children:[fe.jsx("defs",{children:fe.jsxs("linearGradient",{id:t,x1:"0",y1:"0",x2:"0",y2:"1",children:[fe.jsx("stop",{offset:"0%",stopColor:e,stopOpacity:.4}),fe.jsx("stop",{offset:"100%",stopColor:e,stopOpacity:.02})]})}),fe.jsx("path",{d,fill:`url(#${t})`}),fe.jsx("path",{d:l,fill:"none",stroke:e,strokeWidth:1.8,strokeLinejoin:"round",strokeLinecap:"round"}),fe.jsx("circle",{cx:c[0],cy:c[1],r:3.5,fill:e}),fe.jsx("circle",{cx:c[0],cy:c[1],r:6,fill:e,fillOpacity:.25})]})}function Sr({label:u,value:e,icon:t,onClick:n,selected:r=!1,isBack:i=!1}){const[o,l]=yt.useState(!1),{textColor:d,accentColor:c,accentAlpha15:g,accentAlpha30:f}=yt.useContext(bu);return fe.jsxs("button",{role:"menuitem","aria-checked":r,onClick:n,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{...bA,color:d,background:o?"rgba(255,255,255,0.07)":r?g:"transparent",fontWeight:r?600:400,justifyContent:"space-between"},children:[fe.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"10px",flex:1,minWidth:0},children:[i?fe.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"rgba(255,255,255,0.6)",strokeWidth:"2.5",style:{flexShrink:0},children:fe.jsx("polyline",{points:"15 18 9 12 15 6"})}):t?fe.jsx("span",{style:{width:"28px",height:"28px",borderRadius:"7px",background:r?f:"rgba(255,255,255,0.08)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:r?c:"rgba(255,255,255,0.65)",transition:"background 0.15s, color 0.15s"},children:t}):r?fe.jsx("svg",{"aria-hidden":"true",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:c,strokeWidth:"3",style:{flexShrink:0},children:fe.jsx("polyline",{points:"20 6 9 17 4 12"})}):fe.jsx("span",{style:{display:"inline-block",width:"14px",flexShrink:0}}),fe.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u})]}),e!==void 0&&fe.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"4px",flexShrink:0},children:[fe.jsx("span",{style:{fontSize:"12px",color:"rgba(255,255,255,0.45)",maxWidth:"90px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),fe.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"rgba(255,255,255,0.35)",strokeWidth:"2.5",children:fe.jsx("polyline",{points:"9 18 15 12 9 6"})})]})]})}function Rh(){const{borderColor:u}=yt.useContext(bu);return fe.jsx("div",{style:{height:"1px",background:u,margin:"2px 0"}})}function Qm({theme:u,panelPosition:e}={}){const t=u?.accentColor??"#6366f1",n=u?.textColor??"#fff",r=u?.background??"rgba(12, 12, 20, 0.97)",i=u?.borderColor??"rgba(255,255,255,0.1)",o={textColor:n,accentColor:t,accentAlpha15:t.startsWith("#")?Ih(t,.15):"rgba(99,102,241,0.15)",accentAlpha30:t.startsWith("#")?Ih(t,.3):"rgba(99,102,241,0.3)",borderColor:i.replace("0.1)","0.07)")},l={...EA,color:n,borderBottom:`1px solid ${i.replace("0.1)","0.08)")}`},d=e?.vertical??"top",c=e?.horizontal??"right",{setQuality:g,setAudioTrack:f,setPlaybackRate:h,setSubtitleTrack:y,getPlayerStats:E}=kr(),S=is(),{playbackRate:C=1,isLive:K}=Lr(),{style:J,setStyle:re}=Nm(),[ye,Ie]=yt.useState(!1),[we,$]=yt.useState("root");yt.useEffect(()=>{K&&we==="speed"&&$("root")},[K,we]);const[Z,pe]=yt.useState([]),[be,Ce]=yt.useState(null),[Qe,xe]=yt.useState([]),[Je,Oe]=yt.useState(""),[Me,Ve]=yt.useState([]),[ct,at]=yt.useState(null),[vt,nt]=yt.useState(null),[st,jt]=yt.useState([]);yt.useEffect(()=>{const rt=()=>{pe(S.getAvailableQualities()),Ce(S.getQuality()),xe(S.getAvailableAudioTracks()),Oe(S.getAudioTrack()),Ve(S.getSubtitleTracks()),at(S.getActiveSubtitleLanguage())};S.events.on("tracksready",rt),S.events.on("streamTypeDetected",rt),S.events.on("qualitychange",rt),S.events.on("loadedmetadata",rt),rt();const xt=setTimeout(rt,100);return()=>{S.events.off("tracksready",rt),S.events.off("streamTypeDetected",rt),S.events.off("qualitychange",rt),S.events.off("loadedmetadata",rt),clearTimeout(xt)}},[S]),yt.useEffect(()=>{ye&&(pe(S.getAvailableQualities()),Ce(S.getQuality()),xe(S.getAvailableAudioTracks()),Oe(S.getAudioTrack()),Ve(S.getSubtitleTracks()),at(S.getActiveSubtitleLanguage()))},[ye,S]);const Qt=Qe.length>1;yt.useEffect(()=>{if(we!=="statistics")return;const rt=()=>{const gn=E();nt(gn),jt(Nn=>[...Nn.slice(-59),gn])};rt();const xt=setInterval(rt,1e3);return()=>{clearInterval(xt),jt([])}},[we,E]);const Ne=yt.useRef(null);yt.useEffect(()=>{if(!ye)return;const rt=xt=>{Ne.current&&!Ne.current.contains(xt.target)&&(Ie(!1),$("root"))};return document.addEventListener("pointerdown",rt),()=>document.removeEventListener("pointerdown",rt)},[ye]),yt.useEffect(()=>{if(!ye)return;const rt=xt=>{xt.key==="Escape"&&(Ie(!1),$("root")),xt.key==="Backspace"&&we!=="root"&&$("root")};return document.addEventListener("keydown",rt),()=>document.removeEventListener("keydown",rt)},[ye,we]);const Pe=yt.useCallback(()=>{Ie(rt=>(rt&&$("root"),!rt))},[]),ft=be?be.id==="auto"?"Auto":be.label:"Auto",W=C===1?"1×":`${C}×`,V=Qe.find(rt=>rt.id===Je)?.label??"Auto",I=ct===null?"Off":Me.find(rt=>rt.language===ct)?.label??ct,D=fe.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[fe.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),fe.jsx("path",{d:"M8 21h8M12 17v4"}),fe.jsx("path",{d:"m7 8 2 2 4-4 2 2"})]}),oe=fe.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[fe.jsx("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0 1 1 0 0 0-2 0"}),fe.jsx("path",{d:"M12 2a10 10 0 0 1 7.39 16.74M12 2A10 10 0 0 0 4.61 18.74"}),fe.jsx("path",{d:"m16.24 7.76-2.12 2.12"})]}),Q=fe.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[fe.jsx("path",{d:"M3 18v-6a9 9 0 0 1 18 0v6"}),fe.jsx("path",{d:"M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3zM3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3z"})]}),Fe=fe.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[fe.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"}),fe.jsx("line",{x1:"9",y1:"10",x2:"15",y2:"10"}),fe.jsx("line",{x1:"9",y1:"14",x2:"12",y2:"14"})]}),Ye=fe.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[fe.jsx("circle",{cx:"12",cy:"12",r:"3"}),fe.jsx("path",{d:"M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"}),fe.jsx("polyline",{points:"16 16 12 20 8 16"})]}),Ue=fe.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[fe.jsx("line",{x1:"18",y1:"20",x2:"18",y2:"10"}),fe.jsx("line",{x1:"12",y1:"20",x2:"12",y2:"4"}),fe.jsx("line",{x1:"6",y1:"20",x2:"6",y2:"14"})]}),qe=()=>fe.jsxs(fe.Fragment,{children:[fe.jsxs("div",{style:l,children:[fe.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"rgba(255,255,255,0.6)",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[fe.jsx("circle",{cx:"12",cy:"12",r:"3"}),fe.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),"Settings"]}),fe.jsxs("div",{style:{padding:"4px 0"},children:[fe.jsx(Sr,{icon:D,label:"Quality",value:ft,onClick:()=>$("quality")}),!K&&fe.jsx(Sr,{icon:oe,label:"Speed",value:W,onClick:()=>$("speed")}),Qt&&fe.jsx(Sr,{icon:Q,label:"Audio Track",value:V,onClick:()=>$("audio")}),fe.jsx(Rh,{}),fe.jsx(Sr,{icon:Fe,label:"Subtitles",value:I,onClick:()=>$("subtitles")}),fe.jsx(Sr,{icon:Ye,label:"Subtitle Style",value:`${J.fontSize}px`,onClick:()=>$("subtitleStyle")}),fe.jsx(Rh,{}),fe.jsx(Sr,{icon:Ue,label:"Statistics",onClick:()=>$("statistics")})]})]}),De=()=>fe.jsxs(fe.Fragment,{children:[fe.jsx("div",{style:l,children:fe.jsx(Sr,{label:"Quality",isBack:!0,onClick:()=>$("root")})}),fe.jsxs("div",{style:{padding:"4px 0",maxHeight:"280px",overflowY:"auto"},children:[Z.map(rt=>fe.jsx(Sr,{label:rt.id==="auto"?"Auto":rt.label,selected:be?.id===rt.id,onClick:()=>{g(rt.id),Ce(rt),Ie(!1),$("root")}},rt.id)),Z.length===0&&fe.jsx("div",{style:{padding:"10px 14px",color:"rgba(255,255,255,0.4)",fontSize:"13px"},children:"No quality levels available"})]})]}),je=()=>fe.jsxs(fe.Fragment,{children:[fe.jsx("div",{style:l,children:fe.jsx(Sr,{label:"Speed",isBack:!0,onClick:()=>$("root")})}),fe.jsx("div",{style:{padding:"4px 0"},children:pA.map(rt=>fe.jsx(Sr,{label:rt===1?"1× (Normal)":`${rt}×`,selected:C===rt,onClick:()=>{h(rt),Ie(!1),$("root")}},rt))})]}),et=()=>fe.jsxs(fe.Fragment,{children:[fe.jsx("div",{style:l,children:fe.jsx(Sr,{label:"Audio Track",isBack:!0,onClick:()=>$("root")})}),fe.jsx("div",{style:{padding:"4px 0"},children:Qe.map(rt=>fe.jsx(Sr,{label:rt.label||rt.language||rt.id,selected:Je===rt.id,onClick:()=>{f(rt.id),Oe(rt.id),Ie(!1),$("root")}},rt.id))})]}),Xe=()=>fe.jsxs(fe.Fragment,{children:[fe.jsx("div",{style:l,children:fe.jsx(Sr,{label:"Subtitles",isBack:!0,onClick:()=>$("root")})}),fe.jsxs("div",{style:{padding:"4px 0"},children:[fe.jsx(Sr,{label:"Off",selected:ct===null,onClick:()=>{y(null),at(null),Ie(!1),$("root")}},"off"),Me.map((rt,xt)=>fe.jsx(Sr,{label:rt.label||rt.language,selected:ct===rt.language,onClick:()=>{y(rt.language),at(rt.language),Ie(!1),$("root")}},rt.url||`${rt.language}-${xt}`)),Me.length===0&&fe.jsx("div",{style:{padding:"10px 14px",color:"rgba(255,255,255,0.4)",fontSize:"13px"},children:"No subtitle tracks available"})]})]}),ht=()=>fe.jsxs(fe.Fragment,{children:[fe.jsx("div",{style:l,children:fe.jsx(Sr,{label:"Subtitle Style",isBack:!0,onClick:()=>$("root")})}),fe.jsxs("div",{style:{padding:"8px 14px 12px",display:"flex",flexDirection:"column",gap:"14px"},children:[fe.jsxs("div",{children:[fe.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"6px"},children:[fe.jsx("span",{style:{fontSize:"13px",color:"rgba(255,255,255,0.8)"},children:"Position"}),fe.jsxs("span",{style:{fontSize:"12px",color:"rgba(255,255,255,0.5)"},children:[J.bottomOffset,"px from bottom"]})]}),fe.jsx("input",{type:"range",min:10,max:200,step:5,value:J.bottomOffset,onChange:rt=>re({bottomOffset:Number(rt.target.value)}),style:{width:"100%",accentColor:"#3b82f6",cursor:"pointer"}})]}),fe.jsxs("div",{children:[fe.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"6px"},children:[fe.jsx("span",{style:{fontSize:"13px",color:"rgba(255,255,255,0.8)"},children:"Font Size"}),fe.jsxs("span",{style:{fontSize:"12px",color:"rgba(255,255,255,0.5)"},children:[J.fontSize,"px"]})]}),fe.jsx("input",{type:"range",min:12,max:40,step:1,value:J.fontSize,onChange:rt=>re({fontSize:Number(rt.target.value)}),style:{width:"100%",accentColor:"#3b82f6",cursor:"pointer"}})]}),fe.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[fe.jsx("span",{style:{fontSize:"13px",color:"rgba(255,255,255,0.8)"},children:"Background"}),fe.jsx("button",{onClick:()=>re({background:J.background?"":"rgba(0,0,0,0.75)"}),style:{padding:"4px 12px",borderRadius:"6px",border:"1px solid rgba(255,255,255,0.2)",background:J.background?"#3b82f6":"transparent",color:"#fff",fontSize:"12px",cursor:"pointer"},children:J.background?"On":"Off"})]}),fe.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[fe.jsx("span",{style:{fontSize:"13px",color:"rgba(255,255,255,0.8)"},children:"Text Color"}),fe.jsx("div",{style:{display:"flex",gap:"6px"},children:["#ffffff","#ffff00","#00ff00","#00cfff"].map(rt=>fe.jsx("button",{onClick:()=>re({color:rt}),title:rt,style:{width:"22px",height:"22px",borderRadius:"50%",background:rt,border:J.color===rt?"2px solid #3b82f6":"2px solid transparent",cursor:"pointer",outline:"none",padding:0,flexShrink:0}},rt))})]})]})]}),Jt=()=>{const rt=st.map(Pt=>Pt.bandwidth),xt=st.map(Pt=>Pt.bufferHealth),gn=vt?.bandwidth??0,Nn=vt?.bufferHealth??0,Hn=Pt=>Pt>=1e3?`${(Pt/1e3).toFixed(2)} Mbps`:`${Pt.toFixed(0)} kbps`,sr=(Pt,Bt)=>fe.jsxs("div",{style:{background:"rgba(255,255,255,0.04)",borderRadius:"8px",padding:"7px 10px",flex:"1 1 0",minWidth:0},children:[fe.jsx("div",{style:{fontSize:"10px",color:"rgba(255,255,255,0.4)",textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:"3px"},children:Pt}),fe.jsx("div",{style:{fontSize:"12px",color:"#fff",fontFamily:"monospace",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Bt})]}),ar=vt?.segmentUrl??"",fr=ar.length>36?"…"+ar.slice(-36):ar||"—";return fe.jsxs(fe.Fragment,{children:[fe.jsxs("div",{style:{...l,justifyContent:"space-between"},children:[fe.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:fe.jsx(Sr,{label:"Statistics",isBack:!0,onClick:()=>$("root")})}),fe.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",paddingRight:"14px",flexShrink:0},children:[fe.jsx("span",{style:{width:"7px",height:"7px",borderRadius:"50%",background:"#22c55e",boxShadow:"0 0 6px #22c55e",animation:"statsPulse 1.6s ease-in-out infinite",display:"inline-block"}}),fe.jsx("span",{style:{fontSize:"11px",color:"rgba(255,255,255,0.4)"},children:"LIVE"})]})]}),fe.jsxs("div",{style:{padding:"0 14px 12px",overflowY:"auto",maxHeight:"420px"},children:[fe.jsxs("div",{style:{marginTop:"12px"},children:[fe.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginBottom:"6px"},children:[fe.jsx("span",{style:{fontSize:"11px",color:"rgba(255,255,255,0.45)",textTransform:"uppercase",letterSpacing:"0.07em"},children:"Connection Speed"}),fe.jsx("span",{style:{fontSize:"16px",fontWeight:600,color:"#4ade80",fontFamily:"monospace"},children:vt?Hn(gn):"—"})]}),fe.jsx("div",{style:{background:"rgba(0,0,0,0.3)",borderRadius:"8px",padding:"6px 8px"},children:fe.jsx(wh,{values:rt,color:"#4ade80",gradId:"bw-grad"})})]}),fe.jsxs("div",{style:{marginTop:"14px"},children:[fe.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginBottom:"6px"},children:[fe.jsx("span",{style:{fontSize:"11px",color:"rgba(255,255,255,0.45)",textTransform:"uppercase",letterSpacing:"0.07em"},children:"Buffer Health"}),fe.jsx("span",{style:{fontSize:"16px",fontWeight:600,color:"#60a5fa",fontFamily:"monospace"},children:vt?`${Nn.toFixed(1)} s`:"—"})]}),fe.jsx("div",{style:{background:"rgba(0,0,0,0.3)",borderRadius:"8px",padding:"6px 8px"},children:fe.jsx(wh,{values:xt,color:"#60a5fa",gradId:"buf-grad"})})]}),fe.jsx("div",{style:{height:"1px",background:"rgba(255,255,255,0.07)",margin:"14px 0 12px"}}),fe.jsxs("div",{style:{display:"flex",gap:"6px"},children:[sr("Codec",vt?.codec||"—"),sr("Resolution",vt?.resolution||"—"),sr("Dropped",vt?`${vt.droppedFrames}/${vt.totalFrames}`:"—")]}),fe.jsxs("div",{style:{display:"flex",gap:"6px",marginTop:"6px"},children:[sr("Stream",vt?.streamType||"—"),fe.jsxs("div",{style:{background:"rgba(255,255,255,0.04)",borderRadius:"8px",padding:"7px 10px",flex:"2 1 0",minWidth:0},children:[fe.jsx("div",{style:{fontSize:"10px",color:"rgba(255,255,255,0.4)",textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:"3px"},children:"Segment"}),fe.jsx("div",{style:{fontSize:"11px",color:"rgba(255,255,255,0.7)",fontFamily:"monospace",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:ar,children:fr})]})]})]}),fe.jsx("style",{children:`
244
244
  @keyframes statsPulse {
245
245
  0%, 100% { opacity: 1; }
246
246
  50% { opacity: 0.3; }
@@ -43942,25 +43942,33 @@ function C_({ isOpen: u, onClose: e }) {
43942
43942
  }
43943
43943
  ) : null;
43944
43944
  }
43945
- function L_({ x: u, y: e, isOpen: t, onClose: n, actions: r }) {
43946
- const i = yr(null);
43945
+ function L_({ x: u, y: e, isOpen: t, onClose: n, actions: r, theme: i }) {
43946
+ const o = {
43947
+ background: i?.background ?? "rgba(12, 12, 20, 0.97)",
43948
+ borderColor: i?.borderColor ?? "rgba(255,255,255,0.1)",
43949
+ textColor: i?.textColor ?? "#fff",
43950
+ dangerColor: i?.dangerColor ?? "#f87171",
43951
+ hoverBackground: i?.hoverBackground ?? "rgba(255,255,255,0.07)",
43952
+ iconBackground: i?.iconBackground ?? "rgba(255,255,255,0.08)",
43953
+ dividerColor: i?.dividerColor ?? "rgba(255,255,255,0.07)"
43954
+ }, l = yr(null);
43947
43955
  return Fn(() => {
43948
43956
  if (!t) return;
43949
- const o = (l) => {
43950
- if ("key" in l) {
43951
- l.key === "Escape" && n();
43957
+ const d = (c) => {
43958
+ if ("key" in c) {
43959
+ c.key === "Escape" && n();
43952
43960
  return;
43953
43961
  }
43954
- i.current && !i.current.contains(l.target) && n();
43962
+ l.current && !l.current.contains(c.target) && n();
43955
43963
  };
43956
- return document.addEventListener("mousedown", o), document.addEventListener("keydown", o), () => {
43957
- document.removeEventListener("mousedown", o), document.removeEventListener("keydown", o);
43964
+ return document.addEventListener("mousedown", d), document.addEventListener("keydown", d), () => {
43965
+ document.removeEventListener("mousedown", d), document.removeEventListener("keydown", d);
43958
43966
  };
43959
43967
  }, [t, n]), t ? /* @__PURE__ */ Bt(Oi, { children: [
43960
43968
  /* @__PURE__ */ ke(
43961
43969
  "div",
43962
43970
  {
43963
- ref: i,
43971
+ ref: l,
43964
43972
  role: "menu",
43965
43973
  "aria-label": "Video options",
43966
43974
  style: {
@@ -43968,24 +43976,24 @@ function L_({ x: u, y: e, isOpen: t, onClose: n, actions: r }) {
43968
43976
  left: u,
43969
43977
  top: e,
43970
43978
  zIndex: 99998,
43971
- background: "rgba(12, 12, 20, 0.97)",
43979
+ background: o.background,
43972
43980
  backdropFilter: "blur(16px)",
43973
- border: "1px solid rgba(255,255,255,0.1)",
43981
+ border: `1px solid ${o.borderColor}`,
43974
43982
  borderRadius: "14px",
43975
- boxShadow: "0 12px 48px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.08)",
43983
+ boxShadow: `0 12px 48px rgba(0,0,0,0.7), 0 0 0 1px ${o.borderColor}`,
43976
43984
  minWidth: "240px",
43977
43985
  padding: "4px 0",
43978
43986
  fontFamily: "system-ui, -apple-system, sans-serif",
43979
43987
  animation: "ctxFadeIn 0.14s ease-out",
43980
43988
  overflow: "hidden"
43981
43989
  },
43982
- children: r.map((o, l) => /* @__PURE__ */ Bt("div", { children: [
43990
+ children: r.map((d, c) => /* @__PURE__ */ Bt("div", { children: [
43983
43991
  /* @__PURE__ */ Bt(
43984
43992
  "button",
43985
43993
  {
43986
43994
  role: "menuitem",
43987
43995
  onClick: () => {
43988
- o.onClick(), n();
43996
+ d.onClick(), n();
43989
43997
  },
43990
43998
  style: {
43991
43999
  display: "flex",
@@ -43995,38 +44003,38 @@ function L_({ x: u, y: e, isOpen: t, onClose: n, actions: r }) {
43995
44003
  padding: "9px 14px",
43996
44004
  background: "transparent",
43997
44005
  border: "none",
43998
- color: o.danger ? "#f87171" : "#fff",
44006
+ color: d.danger ? o.dangerColor : o.textColor,
43999
44007
  fontSize: "13.5px",
44000
44008
  textAlign: "left",
44001
44009
  cursor: "pointer",
44002
44010
  transition: "background 0.1s"
44003
44011
  },
44004
- onMouseEnter: (d) => {
44005
- d.currentTarget.style.background = o.danger ? "rgba(239,68,68,0.12)" : "rgba(255,255,255,0.07)";
44012
+ onMouseEnter: (g) => {
44013
+ g.currentTarget.style.background = d.danger ? "rgba(239,68,68,0.12)" : o.hoverBackground;
44006
44014
  },
44007
- onMouseLeave: (d) => {
44008
- d.currentTarget.style.background = "transparent";
44015
+ onMouseLeave: (g) => {
44016
+ g.currentTarget.style.background = "transparent";
44009
44017
  },
44010
44018
  children: [
44011
- o.icon !== void 0 && /* @__PURE__ */ ke("span", { style: {
44019
+ d.icon !== void 0 && /* @__PURE__ */ ke("span", { style: {
44012
44020
  width: "28px",
44013
44021
  height: "28px",
44014
44022
  borderRadius: "7px",
44015
- background: o.danger ? "rgba(239,68,68,0.15)" : "rgba(255,255,255,0.08)",
44023
+ background: d.danger ? "rgba(239,68,68,0.15)" : o.iconBackground,
44016
44024
  display: "flex",
44017
44025
  alignItems: "center",
44018
44026
  justifyContent: "center",
44019
44027
  flexShrink: 0,
44020
- color: o.danger ? "#f87171" : "rgba(255,255,255,0.65)",
44028
+ color: d.danger ? o.dangerColor : o.textColor,
44021
44029
  fontSize: "13px",
44022
44030
  lineHeight: 1
44023
- }, children: o.icon }),
44024
- /* @__PURE__ */ ke("span", { style: { flex: 1 }, children: o.label })
44031
+ }, children: d.icon }),
44032
+ /* @__PURE__ */ ke("span", { style: { flex: 1 }, children: d.label })
44025
44033
  ]
44026
44034
  }
44027
44035
  ),
44028
- o.dividerAfter && /* @__PURE__ */ ke("div", { style: { height: "1px", background: "rgba(255,255,255,0.07)", margin: "3px 0" } })
44029
- ] }, l))
44036
+ d.dividerAfter && /* @__PURE__ */ ke("div", { style: { height: "1px", background: o.dividerColor, margin: "3px 0" } })
44037
+ ] }, c))
44030
44038
  }
44031
44039
  ),
44032
44040
  /* @__PURE__ */ ke("style", { children: `
@@ -45484,7 +45492,7 @@ class q_ {
45484
45492
  }
45485
45493
  }
45486
45494
  const Rm = {
45487
- bottomOffset: 40,
45495
+ bottomOffset: 80,
45488
45496
  fontSize: 18,
45489
45497
  color: "#ffffff",
45490
45498
  background: "rgba(0,0,0,0.75)"
@@ -47479,6 +47487,9 @@ function gA({ sliderDirection: u = "right", theme: e }) {
47479
47487
  {
47480
47488
  className: "virtus-volume-control",
47481
47489
  style: { position: "relative", display: "flex", alignItems: "center", height: "40px", width: "40px" },
47490
+ onMouseLeave: () => {
47491
+ c || d(!1);
47492
+ },
47482
47493
  children: [
47483
47494
  /* @__PURE__ */ ke(
47484
47495
  "button",
@@ -47521,9 +47532,6 @@ function gA({ sliderDirection: u = "right", theme: e }) {
47521
47532
  "div",
47522
47533
  {
47523
47534
  onMouseEnter: () => d(!0),
47524
- onMouseLeave: () => {
47525
- c || d(!1);
47526
- },
47527
47535
  style: J,
47528
47536
  children: /* @__PURE__ */ ke(
47529
47537
  "div",
@@ -5,13 +5,31 @@ export interface ContextMenuAction {
5
5
  dividerAfter?: boolean;
6
6
  danger?: boolean;
7
7
  }
8
+ /** Customize the visual appearance of the ContextMenu. */
9
+ export interface ContextMenuTheme {
10
+ /** Panel background. Default: 'rgba(12, 12, 20, 0.97)' */
11
+ background?: string;
12
+ /** Panel border color. Default: 'rgba(255,255,255,0.1)' */
13
+ borderColor?: string;
14
+ /** Normal item text color. Default: '#fff' */
15
+ textColor?: string;
16
+ /** Danger item color. Default: '#f87171' */
17
+ dangerColor?: string;
18
+ /** Row hover background. Default: 'rgba(255,255,255,0.07)' */
19
+ hoverBackground?: string;
20
+ /** Icon pill background. Default: 'rgba(255,255,255,0.08)' */
21
+ iconBackground?: string;
22
+ /** Divider line color. Default: 'rgba(255,255,255,0.07)' */
23
+ dividerColor?: string;
24
+ }
8
25
  interface ContextMenuProps {
9
26
  x: number;
10
27
  y: number;
11
28
  isOpen: boolean;
12
29
  onClose: () => void;
13
30
  actions: ContextMenuAction[];
31
+ theme?: ContextMenuTheme;
14
32
  }
15
- export default function ContextMenu({ x, y, isOpen, onClose, actions }: ContextMenuProps): import("react/jsx-runtime").JSX.Element | null;
33
+ export default function ContextMenu({ x, y, isOpen, onClose, actions, theme }: ContextMenuProps): import("react/jsx-runtime").JSX.Element | null;
16
34
  export {};
17
35
  //# sourceMappingURL=ContextMenu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../src/ui/Overlay/ContextMenu.tsx"],"names":[],"mappings":"AAQA,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,UAAU,gBAAgB;IACxB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,iBAAiB,EAAE,CAAC;CAC9B;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,gBAAgB,kDAuGvF"}
1
+ {"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../src/ui/Overlay/ContextMenu.tsx"],"names":[],"mappings":"AAQA,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,0DAA0D;AAC1D,MAAM,WAAW,gBAAgB;IAC/B,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8DAA8D;IAC9D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,8DAA8D;IAC9D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,4DAA4D;IAC5D,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,gBAAgB;IACxB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,gBAAgB,kDAiH9F"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playron",
3
- "version": "1.0.11",
3
+ "version": "1.0.14",
4
4
  "description": "Modern OTT video player for React, Next.js, and vanilla JS",
5
5
  "type": "module",
6
6
  "main": "./dist/playron.cjs.js",