@glitchlab/vue-video-player 1.4.0 → 1.6.0

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.
Files changed (43) hide show
  1. package/README.md +228 -21
  2. package/dist/HLSPlayer.vue.d.ts +6 -0
  3. package/dist/HLSPlayer.vue.d.ts.map +1 -1
  4. package/dist/VideoPlayer.vue.d.ts +30 -1
  5. package/dist/VideoPlayer.vue.d.ts.map +1 -1
  6. package/dist/components/ControlBar.vue.d.ts +58 -0
  7. package/dist/components/ControlBar.vue.d.ts.map +1 -1
  8. package/dist/components/{IconQuality.vue.d.ts → IconAlert.vue.d.ts} +1 -1
  9. package/dist/components/IconAlert.vue.d.ts.map +1 -0
  10. package/dist/components/IconCheck.vue.d.ts +16 -0
  11. package/dist/components/IconCheck.vue.d.ts.map +1 -0
  12. package/dist/components/IconChevronRight.vue.d.ts +16 -0
  13. package/dist/components/IconChevronRight.vue.d.ts.map +1 -0
  14. package/dist/components/IconGear.vue.d.ts +16 -0
  15. package/dist/components/IconGear.vue.d.ts.map +1 -0
  16. package/dist/components/IconNext.vue.d.ts +16 -0
  17. package/dist/components/IconNext.vue.d.ts.map +1 -0
  18. package/dist/components/IconPrev.vue.d.ts +16 -0
  19. package/dist/components/IconPrev.vue.d.ts.map +1 -0
  20. package/dist/components/IconRefresh.vue.d.ts +16 -0
  21. package/dist/components/{IconQuality.vue.d.ts.map → IconRefresh.vue.d.ts.map} +1 -1
  22. package/dist/components/SettingsMenu.vue.d.ts +61 -0
  23. package/dist/components/SettingsMenu.vue.d.ts.map +1 -0
  24. package/dist/index.cjs +3 -1
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.ts +4 -1
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.mjs +1869 -1058
  29. package/dist/index.mjs.map +1 -1
  30. package/dist/style.css +1 -1
  31. package/dist/utils/caption-style.d.ts +17 -0
  32. package/dist/utils/caption-style.d.ts.map +1 -0
  33. package/dist/utils/chapters.d.ts +33 -0
  34. package/dist/utils/chapters.d.ts.map +1 -0
  35. package/dist/utils/preferences.d.ts +26 -0
  36. package/dist/utils/preferences.d.ts.map +1 -0
  37. package/dist/utils/theme.d.ts +15 -0
  38. package/dist/utils/theme.d.ts.map +1 -0
  39. package/dist/utils/thumbnails.d.ts +37 -0
  40. package/dist/utils/thumbnails.d.ts.map +1 -0
  41. package/dist/utils/types.d.ts +95 -1
  42. package/dist/utils/types.d.ts.map +1 -1
  43. package/package.json +1 -1
@@ -0,0 +1,16 @@
1
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
2
+ class?: string;
3
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
4
+ class?: string;
5
+ }>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
6
+ export default _default;
7
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
8
+ type __VLS_TypePropsToRuntimeProps<T> = {
9
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
10
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
11
+ } : {
12
+ type: import('vue').PropType<T[K]>;
13
+ required: true;
14
+ };
15
+ };
16
+ //# sourceMappingURL=IconRefresh.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IconQuality.vue.d.ts","sourceRoot":"","sources":["../../src/components/IconQuality.vue"],"names":[],"mappings":";YAuEqD,MAAM;;YAAN,MAAM;;AAnE3D,wBAqEI;AAAA,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACrE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC"}
1
+ {"version":3,"file":"IconRefresh.vue.d.ts","sourceRoot":"","sources":["../../src/components/IconRefresh.vue"],"names":[],"mappings":";YA+DqD,MAAM;;YAAN,MAAM;;AA3D3D,wBA6DI;AAAA,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACrE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC"}
@@ -0,0 +1,61 @@
1
+ import { QualityLevelInfo } from '../utils/quality-levels';
2
+ import { AudioTrackInfo } from '../utils/audio-tracks';
3
+
4
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
5
+ video: HTMLVideoElement | null;
6
+ qualityLevels?: QualityLevelInfo[];
7
+ currentLevel?: number;
8
+ selectedLevel?: number;
9
+ audioTracks?: AudioTrackInfo[];
10
+ audioTrackIndex?: number;
11
+ }>, {
12
+ qualityLevels: () => never[];
13
+ currentLevel: number;
14
+ selectedLevel: number;
15
+ audioTracks: () => never[];
16
+ audioTrackIndex: number;
17
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
18
+ "select-level": (index: number) => void;
19
+ "select-audio-track": (index: number) => void;
20
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
21
+ video: HTMLVideoElement | null;
22
+ qualityLevels?: QualityLevelInfo[];
23
+ currentLevel?: number;
24
+ selectedLevel?: number;
25
+ audioTracks?: AudioTrackInfo[];
26
+ audioTrackIndex?: number;
27
+ }>, {
28
+ qualityLevels: () => never[];
29
+ currentLevel: number;
30
+ selectedLevel: number;
31
+ audioTracks: () => never[];
32
+ audioTrackIndex: number;
33
+ }>>> & Readonly<{
34
+ "onSelect-level"?: ((index: number) => any) | undefined;
35
+ "onSelect-audio-track"?: ((index: number) => any) | undefined;
36
+ }>, {
37
+ audioTrackIndex: number;
38
+ currentLevel: number;
39
+ audioTracks: AudioTrackInfo[];
40
+ qualityLevels: QualityLevelInfo[];
41
+ selectedLevel: number;
42
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
43
+ export default _default;
44
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
45
+ type __VLS_TypePropsToRuntimeProps<T> = {
46
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
47
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
48
+ } : {
49
+ type: import('vue').PropType<T[K]>;
50
+ required: true;
51
+ };
52
+ };
53
+ type __VLS_WithDefaults<P, D> = {
54
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
55
+ default: D[K];
56
+ }> : P[K];
57
+ };
58
+ type __VLS_Prettify<T> = {
59
+ [K in keyof T]: T[K];
60
+ } & {};
61
+ //# sourceMappingURL=SettingsMenu.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SettingsMenu.vue.d.ts","sourceRoot":"","sources":["../../src/components/SettingsMenu.vue"],"names":[],"mappings":"AAMA,OAAO,EAAgB,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;;WA82BjD,gBAAgB,GAAG,IAAI;oBACd,gBAAgB,EAAE;mBACnB,MAAM;oBACL,MAAM;kBACR,cAAc,EAAE;sBACZ,MAAM;;;;;;;;;;;WALjB,gBAAgB,GAAG,IAAI;oBACd,gBAAgB,EAAE;mBACnB,MAAM;oBACL,MAAM;kBACR,cAAc,EAAE;sBACZ,MAAM;;;;;;;;;;;qBAAN,MAAM;kBAHT,MAAM;iBAEP,cAAc,EAAE;mBAHd,gBAAgB,EAAE;mBAElB,MAAM;;AA72B1B,wBAm3BI;AAAA,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACrE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QACxE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACT,CAAC;AACN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
package/dist/index.cjs CHANGED
@@ -1,2 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),q=require("hls.js");function re(n,l,r){const t=n==null?void 0:n.trim();if(t)return t;if(l){try{const a=new Intl.DisplayNames(void 0,{type:"language"}).of(l);if(a&&a!==l)return a}catch{}return l}return`Audio ${r+1}`}const he={index:-1,height:0,label:"Auto"};function ye(n,l){return n>0?`${n}p`:`Level ${l+1}`}const Ce=["muted","loop","controls","autoplay","playsinline","preload","poster"],ie=e.defineComponent({__name:"HLSPlayer",props:{src:{},hlsConfig:{},isHls:{type:Boolean},muted:{type:Boolean,default:!0},loop:{type:Boolean,default:!1},controls:{type:Boolean,default:!1},autoPlay:{type:Boolean,default:!1},playsInline:{type:Boolean,default:!0},preload:{default:"metadata"},poster:{},class:{},audioTrackIndex:{default:-1},qualityLevelIndex:{default:-1}},emits:["play","pause","audio-tracks","quality-levels","current-level"],setup(n,{expose:l,emit:r}){const t=n,v=r,a=e.ref(null),k=e.ref(null);let p,b;const E=globalThis.window!==void 0&&q.isSupported(),C=i=>!!t.isHls||E&&i.endsWith(".m3u8");function V(){b==null||b(),b=void 0,p==null||p(),p=void 0,k.value&&(k.value.destroy(),k.value=null);const i=a.value;if(i){for(i.pause(),i.removeAttribute("src");i.firstChild;)i.firstChild.remove();i.load(),v("audio-tracks",[]),v("quality-levels",[]),v("current-level",-1)}}function g(i){var D,x,T;const h=a.value;if(!h||!i)return;V();const N=()=>{t.autoPlay&&h.play().catch(()=>{})};if(C(i)){const f=new q(t.hlsConfig);k.value=f;const B=()=>{const _=f.audioTracks.map((L,z)=>({index:z,label:re(L.name,L.lang,z),lang:L.lang||void 0}));v("audio-tracks",_)},$=()=>{const _=f.levels.map((L,z)=>({index:z,height:L.height||0,label:ye(L.height||0,z)}));v("quality-levels",_)};f.on(q.Events.MANIFEST_PARSED,N),f.on(q.Events.MANIFEST_PARSED,$),f.on(q.Events.LEVELS_UPDATED,$),f.on(q.Events.LEVEL_SWITCHED,(_,L)=>{v("current-level",L.level)}),f.on(q.Events.AUDIO_TRACKS_UPDATED,B),f.on(q.Events.AUDIO_TRACK_SWITCHED,B),f.on(q.Events.ERROR,(_,L)=>{L.fatal&&(f.destroy(),k.value=null)}),f.attachMedia(h),f.loadSource(i)}else{h.src=i,h.load(),h.addEventListener("loadedmetadata",N,{once:!0}),b=()=>{h.removeEventListener("loadedmetadata",N)};const f=h.audioTracks;if(f){const B=()=>{const $=[];for(let _=0;_<f.length;_++){const L=f[_];$.push({index:_,label:re(L.label,L.language,_),lang:L.language||void 0})}v("audio-tracks",$)};(D=f.addEventListener)==null||D.call(f,"addtrack",B),(x=f.addEventListener)==null||x.call(f,"removetrack",B),(T=f.addEventListener)==null||T.call(f,"change",B),f.length>0&&B(),p=()=>{var $,_,L;($=f.removeEventListener)==null||$.call(f,"addtrack",B),(_=f.removeEventListener)==null||_.call(f,"removetrack",B),(L=f.removeEventListener)==null||L.call(f,"change",B)}}}}function m(i){var D;if(i==null||i<0)return;const h=k.value;if(h){h.audioTrack!==i&&(h.audioTrack=i);return}const N=(D=a.value)==null?void 0:D.audioTracks;if(N)for(let x=0;x<N.length;x++)N[x].enabled=x===i}function y(i){if(i==null)return;const h=k.value;h&&h.currentLevel!==i&&(h.currentLevel=i)}return e.onMounted(()=>{t.src&&g(t.src)}),e.watch(()=>t.src,i=>{i&&g(i)}),e.watch(()=>t.audioTrackIndex,i=>m(i)),e.watch(()=>t.qualityLevelIndex,i=>y(i)),e.onBeforeUnmount(V),l({videoEl:a}),(i,h)=>(e.openBlock(),e.createElementBlock("video",{ref_key:"videoEl",ref:a,muted:n.muted,loop:n.loop,controls:n.controls,autoplay:n.autoPlay,playsinline:n.playsInline,preload:n.preload,poster:n.poster,class:e.normalizeClass(t.class),onPlay:h[0]||(h[0]=N=>v("play")),onPause:h[1]||(h[1]=N=>v("pause"))},[e.renderSlot(i.$slots,"default")],42,Ce))}}),Ee={name:"IconAudio"},we=e.defineComponent({...Ee,props:{class:{}},setup(n){const l=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16M19 5.5C20.5 7 21.5 9.5 21.5 12C21.5 14.5 20.5 17 19 18.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),be={name:"IconChevron"},ce=e.defineComponent({...be,props:{class:{}},setup(n){const l=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M6 9L12 15L18 9",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),Be=["aria-expanded"],xe={class:"gvp-audio-label"},_e={key:0,class:"gvp-audio-menu",role:"listbox","aria-label":"Audio tracks"},Le=["aria-selected","onClick"],Ve=e.defineComponent({__name:"AudioTrackSwitcher",props:{tracks:{},activeIndex:{}},emits:["select"],setup(n,{emit:l}){const r=n,t=l,v=e.ref(!1),a=e.ref(null),k=e.computed(()=>r.tracks.find(C=>C.index===r.activeIndex)??r.tracks[0]);function p(C){a.value&&!a.value.contains(C.target)&&(v.value=!1)}function b(C){C.key==="Escape"&&(v.value=!1)}e.watch(v,C=>{C?(document.addEventListener("mousedown",p),document.addEventListener("keydown",b)):(document.removeEventListener("mousedown",p),document.removeEventListener("keydown",b))}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",b)});function E(C){t("select",C),v.value=!1}return(C,V)=>{var g;return e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:a,class:"gvp-audio"},[e.createElementVNode("button",{type:"button",class:"gvp-audio-btn","aria-haspopup":"listbox","aria-expanded":v.value,"aria-label":"Audio track",onClick:V[0]||(V[0]=m=>v.value=!v.value)},[e.createVNode(we),e.createElementVNode("span",xe,e.toDisplayString((g=k.value)==null?void 0:g.label),1),e.createVNode(ce)],8,Be),v.value?(e.openBlock(),e.createElementBlock("ul",_e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.tracks,m=>(e.openBlock(),e.createElementBlock("li",{key:m.index},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":m.index===n.activeIndex,class:e.normalizeClass(["gvp-audio-menu-item",{"is-active":m.index===n.activeIndex}]),onClick:y=>E(m.index)},e.toDisplayString(m.label),11,Le)]))),128))])):e.createCommentVNode("",!0)],512)}}}),Ne={name:"IconSpeed"},ue=e.defineComponent({...Ne,props:{class:{}},setup(n){const l=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2Z",stroke:"currentColor","stroke-width":"1.5"},null,-1),e.createElementVNode("path",{d:"M12 8V12L14.5 14.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),$e=["aria-expanded"],Pe={class:"gvp-speed-label"},Me={key:0,class:"gvp-speed-menu",role:"listbox","aria-label":"Playback speed"},Se=["aria-selected","onClick"],Te=e.defineComponent({__name:"SpeedSwitcher",props:{speed:{}},emits:["select"],setup(n,{emit:l}){const r=[.5,.75,1,1.25,1.5,2],t=l,v=e.ref(!1),a=e.ref(null);function k(E){a.value&&!a.value.contains(E.target)&&(v.value=!1)}function p(E){E.key==="Escape"&&(v.value=!1)}e.watch(v,E=>{E?(document.addEventListener("mousedown",k),document.addEventListener("keydown",p)):(document.removeEventListener("mousedown",k),document.removeEventListener("keydown",p))}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",k),document.removeEventListener("keydown",p)});function b(E){t("select",E),v.value=!1}return(E,C)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:a,class:"gvp-speed"},[e.createElementVNode("button",{type:"button",class:"gvp-speed-btn","aria-haspopup":"listbox","aria-expanded":v.value,"aria-label":"`Playback speed: ${speed === 1 ? '1×' : speed + '×'}`",onClick:C[0]||(C[0]=V=>v.value=!v.value)},[e.createVNode(ue),e.createElementVNode("span",Pe,e.toDisplayString(n.speed===1?"1×":`${n.speed}×`),1),e.createVNode(ce)],8,$e),v.value?(e.openBlock(),e.createElementBlock("ul",Me,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(r,V=>e.createElementVNode("li",{key:V},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":V===n.speed,class:e.normalizeClass(["gvp-speed-menu-item",{"is-active":V===n.speed}]),onClick:g=>b(V)},e.toDisplayString(V===1?"Normal":`${V}×`),11,Se)])),64))])):e.createCommentVNode("",!0)],512))}}),Ie={name:"IconCaptions"},de=e.defineComponent({...Ie,props:{class:{}},setup(n){const l=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("rect",{x:"2",y:"5",width:"20",height:"14",rx:"3",stroke:"currentColor","stroke-width":"1.5"},null,-1),e.createElementVNode("path",{d:"M7 12H11M13 12H17M7 15H9M11 15H13M15 15H17",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),De=["aria-expanded","aria-pressed"],ze={key:0,class:"gvp-captions-menu",role:"listbox","aria-label":"Captions"},He=["aria-selected"],Ae=["aria-selected","onClick"],qe=e.defineComponent({__name:"CaptionsSwitcher",props:{video:{}},setup(n){const l=n,r=e.ref([]),t=e.ref(-1),v=e.ref(!1),a=e.ref(null);function k(g){const m=[];for(let i=0;i<g.length;i++){const h=g[i];(h.kind==="subtitles"||h.kind==="captions")&&m.push({index:i,label:h.label||h.language||`Track ${i+1}`})}r.value=m;let y=-1;for(let i=0;i<g.length;i++)if(g[i].mode==="showing"){y=i;break}t.value=y}let p=null;e.watch(()=>l.video,g=>{if(p==null||p(),p=null,!g){r.value=[],t.value=-1;return}const m=g.textTracks;k(m);const y=()=>k(m);typeof m.addEventListener=="function"&&(m.addEventListener("addtrack",y),m.addEventListener("removetrack",y),m.addEventListener("change",y),p=()=>{m.removeEventListener("addtrack",y),m.removeEventListener("removetrack",y),m.removeEventListener("change",y)})},{immediate:!0}),e.onBeforeUnmount(()=>{p==null||p(),document.removeEventListener("mousedown",b),document.removeEventListener("keydown",E)});function b(g){a.value&&!a.value.contains(g.target)&&(v.value=!1)}function E(g){g.key==="Escape"&&(v.value=!1)}e.watch(v,g=>{g?(document.addEventListener("mousedown",b),document.addEventListener("keydown",E)):(document.removeEventListener("mousedown",b),document.removeEventListener("keydown",E))});function C(){if(!l.video)return;const g=l.video.textTracks;for(let m=0;m<g.length;m++)g[m].mode="hidden";t.value=-1,v.value=!1}function V(g){if(!l.video)return;const m=l.video.textTracks;for(let y=0;y<m.length;y++)m[y].mode=y===g?"showing":"hidden";t.value=g,v.value=!1}return(g,m)=>r.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"rootEl",ref:a,class:"gvp-captions"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["gvp-captions-btn",{"is-active":t.value>=0}]),"aria-haspopup":"listbox","aria-expanded":v.value,"aria-pressed":t.value>=0,"aria-label":"Captions",onClick:m[0]||(m[0]=y=>v.value=!v.value)},[e.createVNode(de)],10,De),v.value?(e.openBlock(),e.createElementBlock("ul",ze,[e.createElementVNode("li",null,[e.createElementVNode("button",{type:"button",role:"option","aria-selected":t.value===-1,class:e.normalizeClass(["gvp-captions-menu-item",{"is-active":t.value===-1}]),onClick:C}," Off ",10,He)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,y=>(e.openBlock(),e.createElementBlock("li",{key:y.index},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":y.index===t.value,class:e.normalizeClass(["gvp-captions-menu-item",{"is-active":y.index===t.value}]),onClick:i=>V(y.index)},e.toDisplayString(y.label),11,Ae)]))),128))])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0)}}),Re={name:"IconPause"},Fe=e.defineComponent({...Re,props:{class:{}},setup(n){const l=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("rect",{x:"6",y:"5",width:"4",height:"14",rx:"1",fill:"currentColor"},null,-1),e.createElementVNode("rect",{x:"14",y:"5",width:"4",height:"14",rx:"1",fill:"currentColor"},null,-1)])],2))}}),Ue={name:"IconPlaySolid"},Oe=e.defineComponent({...Ue,props:{class:{}},setup(n){const l=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M7 5.5V18.5C7 19.2659 7.84856 19.7261 8.4899 19.3071L19.0801 12.4014C19.6644 12.0204 19.6644 11.9796 19.0801 11.5986L8.4899 4.69288C7.84856 4.27388 7 4.73408 7 5.5Z",fill:"currentColor"},null,-1)])],2))}}),je={name:"IconVolumeHigh"},Ze=e.defineComponent({...je,props:{class:{}},setup(n){const l=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16M19 5.5C20.5 7 21.5 9.5 21.5 12C21.5 14.5 20.5 17 19 18.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),Qe={name:"IconVolumeLow"},We=e.defineComponent({...Qe,props:{class:{}},setup(n){const l=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),Ye={name:"IconVolumeMuted"},Ke=e.defineComponent({...Ye,props:{class:{}},setup(n){const l=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M16 9L22 15M22 9L16 15",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),Je={name:"IconQuality"},Xe=e.defineComponent({...Je,props:{class:{}},setup(n){const l=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z",stroke:"currentColor","stroke-width":"1.5"},null,-1),e.createElementVNode("path",{d:"M3 12C3 12.6 3.08 13.18 3.23 13.73L4.6 14.5C4.86 14.65 5.02 14.94 5 15.24C4.98 15.58 4.96 15.92 5.07 16.24C5.18 16.56 5.39 16.83 5.62 17.08C5.83 17.3 6.13 17.4 6.42 17.36L7.99 17.13C8.28 17.09 8.57 17.21 8.74 17.45C9.07 17.93 9.49 18.34 9.97 18.66C10.21 18.83 10.34 19.11 10.31 19.4L10.13 20.97C10.1 21.26 10.21 21.55 10.43 21.74C10.91 22.16 11.45 22 12 22C12.55 22 13.09 22.16 13.57 21.74C13.79 21.55 13.9 21.26 13.87 20.97L13.69 19.4C13.66 19.11 13.79 18.83 14.03 18.66",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),Ge={name:"IconPiP"},ve=e.defineComponent({...Ge,props:{class:{}},setup(n){const l=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",stroke:"currentColor","stroke-width":"1.5"},null,-1),e.createElementVNode("rect",{x:"12",y:"12",width:"8",height:"5",rx:"1",fill:"currentColor"},null,-1)])],2))}}),et={name:"IconFullscreen"},tt=e.defineComponent({...et,props:{class:{}},setup(n){const l=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M4 9V4H9M15 4H20V9M20 15V20H15M9 20H4V15",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),nt={name:"IconFullscreenExit"},ot=e.defineComponent({...nt,props:{class:{}},setup(n){const l=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M9 4V9H4M15 9V4H20M15 20V15H20M9 15H4V20",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}});function se(n){if(!Number.isFinite(n)||n<0)return"--:--";const l=Math.floor(n),r=Math.floor(l/3600),t=Math.floor(l%3600/60),a=(l%60).toString().padStart(2,"0");if(r>0){const k=t.toString().padStart(2,"0");return`${r}:${k}:${a}`}return`${t}:${a}`}const lt={class:"gvp-controls-row"},at=["aria-label","aria-pressed"],rt={class:"gvp-seek"},st={class:"gvp-seek-track"},it=["value","disabled","aria-valuemax","aria-valuenow"],ct={class:"gvp-time","aria-live":"off"},ut=["aria-expanded","aria-label"],dt={class:"gvp-speed-label"},vt={key:0,class:"gvp-speed-menu",role:"listbox","aria-label":"Playback speed"},pt=["aria-selected","onClick"],mt=["aria-expanded","aria-label"],ft={class:"gvp-quality-label"},kt={key:0,class:"gvp-quality-menu",role:"listbox","aria-label":"Quality"},gt=["aria-selected"],ht=["aria-selected","onClick"],yt=["aria-expanded","aria-pressed"],Ct={key:0,class:"gvp-captions-menu",role:"listbox","aria-label":"Captions"},Et=["aria-selected"],wt=["aria-selected","onClick"],bt=["aria-label","aria-pressed"],Bt={key:0,class:"gvp-volume-slider-wrap"},xt={class:"gvp-volume-track"},_t=["value","aria-valuenow"],Lt=["aria-label","aria-pressed"],Vt=["aria-label","aria-pressed"],Nt=3e3,$t=e.defineComponent({__name:"ControlBar",props:{video:{},isPlaying:{type:Boolean},container:{},onTogglePlay:{},qualityLevels:{default:()=>[]},currentLevel:{default:-1},selectedLevel:{default:-1}},emits:["select-level"],setup(n,{emit:l}){const r=(()=>{if(typeof navigator>"u")return!1;const o=navigator.userAgent;return/iPad|iPhone|iPod/.test(o)||o.includes("Mac")&&navigator.maxTouchPoints>1})(),t=typeof navigator>"u"?!1:/iPhone|iPod/.test(navigator.userAgent),v=[.5,.75,1,1.25,1.5,2],a=n,k=l,p=e.ref(!0);let b=null;function E(){b!==null&&(clearTimeout(b),b=null)}function C(){E(),a.isPlaying&&(b=setTimeout(()=>{p.value=!1},Nt))}function V(){p.value=!0,C()}e.watch(()=>a.isPlaying,o=>{o?C():(E(),p.value=!0)},{immediate:!0}),e.watch(()=>a.container,o=>{if(!o)return;const s=()=>V();o.addEventListener("mousemove",s),o.addEventListener("touchstart",s),o.addEventListener("focusin",s)},{immediate:!0});const g=e.ref(0),m=e.ref(0),y=e.ref(0);e.watch(()=>a.video,o=>{if(!o)return;const s=()=>{g.value=o.currentTime},d=()=>{m.value=Number.isFinite(o.duration)?o.duration:0},w=()=>{const P=o.buffered;if(!P||P.length===0){y.value=0;return}let ae=P.end(P.length-1);for(let Z=0;Z<P.length;Z++)if(P.start(Z)<=o.currentTime&&o.currentTime<=P.end(Z)){ae=P.end(Z);break}y.value=ae};s(),d(),w(),o.addEventListener("timeupdate",s),o.addEventListener("durationchange",d),o.addEventListener("loadedmetadata",d),o.addEventListener("progress",w),o.addEventListener("timeupdate",w)},{immediate:!0});const i=()=>m.value>0,h=()=>i()?g.value/m.value*100:0,N=()=>i()?y.value/m.value*100:0;function D(o){const s=a.video;if(!s||!i())return;const d=Number(o.target.value)/100*m.value;s.currentTime=d,g.value=d}const x=e.ref(1),T=e.ref(!1);e.watch(()=>a.video,o=>{if(!o)return;const s=()=>{x.value=o.volume,T.value=o.muted};s(),o.addEventListener("volumechange",s)},{immediate:!0});function f(){a.video&&(a.video.muted=!a.video.muted)}function B(o){const s=a.video;if(!s)return;const d=Number(o.target.value)/100;s.volume=d,d>0&&s.muted&&(s.muted=!1)}const $=e.ref(1),_=e.ref(!1),L=e.ref(null);e.watch(()=>a.video,o=>{if(!o)return;const s=()=>{$.value=o.playbackRate};s(),o.addEventListener("ratechange",s)},{immediate:!0});function z(o){a.video&&(a.video.playbackRate=o),$.value=o,_.value=!1}const R=e.ref(!1),Q=e.ref(null),ne=e.computed(()=>a.qualityLevels.length>=2),I=e.computed(()=>[...a.qualityLevels].sort((o,s)=>s.height-o.height)),U=e.computed(()=>a.qualityLevels.find(o=>o.index===a.currentLevel)),j=e.computed(()=>{if(a.selectedLevel<0)return U.value?`Auto (${U.value.label})`:"Auto";const o=a.qualityLevels.find(s=>s.index===a.selectedLevel);return(o==null?void 0:o.label)??"Auto"});function W(o){k("select-level",o),R.value=!1}const O=e.ref([]),S=e.ref(-1),H=e.ref(!1),Y=e.ref(null);function K(o){const s=[];for(let w=0;w<o.length;w++){const P=o[w];(P.kind==="subtitles"||P.kind==="captions")&&s.push({index:w,label:P.label||P.language||`Track ${w+1}`})}O.value=s;let d=-1;for(let w=0;w<o.length;w++)if(o[w].mode==="showing"){d=w;break}S.value=d}e.watch(()=>a.video,o=>{if(!o){O.value=[],S.value=-1;return}const s=o.textTracks;K(s);const d=()=>K(s);typeof s.addEventListener=="function"&&(s.addEventListener("addtrack",d),s.addEventListener("removetrack",d),s.addEventListener("change",d))},{immediate:!0});function J(o){var d;const s=(d=a.video)==null?void 0:d.textTracks;if(s){for(let w=0;w<s.length;w++)s[w].mode=w===o?"showing":"hidden";S.value=o,H.value=!1}}function X(){var s;const o=(s=a.video)==null?void 0:s.textTracks;if(o){for(let d=0;d<o.length;d++)o[d].mode="hidden";S.value=-1,H.value=!1}}const c=e.ref(!1),u=typeof document<"u"&&!!document.pictureInPictureEnabled;e.watch(()=>a.video,o=>{o&&(o.addEventListener("enterpictureinpicture",()=>{c.value=!0}),o.addEventListener("leavepictureinpicture",()=>{c.value=!1}))},{immediate:!0});function M(){a.video&&(document.pictureInPictureElement?document.exitPictureInPicture().catch(()=>{}):a.video.requestPictureInPicture().catch(()=>{}))}const A=e.ref(!1),G=typeof document>"u"?!1:!!(document.fullscreenEnabled||document.webkitFullscreenEnabled);function ee(){return document.fullscreenElement??document.webkitFullscreenElement??null}function oe(o){const s=o.requestFullscreen??o.webkitRequestFullscreen;return s?s.call(o):Promise.reject(new Error("unsupported"))}function te(){const o=document.exitFullscreen??document.webkitExitFullscreen;return o?o.call(document):Promise.reject(new Error("unsupported"))}function F(){A.value=ee()===a.container}e.onMounted(()=>{document.addEventListener("fullscreenchange",F),document.addEventListener("webkitfullscreenchange",F)}),e.onBeforeUnmount(()=>{E(),document.removeEventListener("fullscreenchange",F),document.removeEventListener("webkitfullscreenchange",F)});function ke(){var o,s;if(t){(s=(o=a.video)==null?void 0:o.webkitEnterFullscreen)==null||s.call(o);return}A.value?te().catch(()=>{}):a.container&&oe(a.container).catch(()=>{})}const ge=G||t&&a.video!==null&&typeof a.video.webkitEnterFullscreen=="function";function le(o,s){function d(P){s.value&&!s.value.contains(P.target)&&(o.value=!1)}function w(P){P.key==="Escape"&&(o.value=!1)}e.watch(o,P=>{P?(document.addEventListener("mousedown",d),document.addEventListener("keydown",w)):(document.removeEventListener("mousedown",d),document.removeEventListener("keydown",w))}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",d),document.removeEventListener("keydown",w)})}return le(_,L),le(H,Y),le(R,Q),(o,s)=>(e.openBlock(),e.createElementBlock("div",{role:"toolbar","aria-label":"Video controls",class:e.normalizeClass(["gvp-controls",!p.value&&"is-hidden"]),onMouseenter:E,onMouseleave:C},[e.createElementVNode("div",lt,[e.createElementVNode("button",{type:"button",class:"gvp-ctrl-btn","aria-label":n.isPlaying?"Pause":"Play","aria-pressed":n.isPlaying,onClick:s[0]||(s[0]=(...d)=>n.onTogglePlay&&n.onTogglePlay(...d))},[n.isPlaying?(e.openBlock(),e.createBlock(Fe,{key:0})):(e.openBlock(),e.createBlock(Oe,{key:1}))],8,at),e.createElementVNode("div",rt,[e.createElementVNode("div",st,[e.createElementVNode("div",{class:"gvp-seek-buffered",style:e.normalizeStyle({width:`${N()}%`})},null,4),e.createElementVNode("div",{class:"gvp-seek-progress",style:e.normalizeStyle({width:`${h()}%`})},null,4)]),e.createElementVNode("input",{type:"range",class:"gvp-seek-input",min:0,max:100,step:.1,value:h(),disabled:!i(),"aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.floor(m.value),"aria-valuenow":Math.floor(g.value),onInput:D},null,40,it)]),e.createElementVNode("span",ct,e.toDisplayString(e.unref(se)(g.value))+" / "+e.toDisplayString(e.unref(se)(m.value)),1),e.createElementVNode("div",{ref_key:"speedRootEl",ref:L,class:"gvp-speed"},[e.createElementVNode("button",{type:"button",class:"gvp-ctrl-btn gvp-speed-btn","aria-haspopup":"listbox","aria-expanded":_.value,"aria-label":`Playback speed: ${$.value===1?"1×":$.value+"×"}`,onClick:s[1]||(s[1]=d=>_.value=!_.value)},[e.createVNode(ue),e.createElementVNode("span",dt,e.toDisplayString($.value===1?"1×":`${$.value}×`),1)],8,ut),_.value?(e.openBlock(),e.createElementBlock("ul",vt,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(v,d=>e.createElementVNode("li",{key:d},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":d===$.value,class:e.normalizeClass(["gvp-speed-menu-item",{"is-active":d===$.value}]),onClick:w=>z(d)},e.toDisplayString(d===1?"Normal":`${d}×`),11,pt)])),64))])):e.createCommentVNode("",!0)],512),ne.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"qualityRootEl",ref:Q,class:"gvp-quality"},[e.createElementVNode("button",{type:"button",class:"gvp-ctrl-btn gvp-quality-btn","aria-haspopup":"listbox","aria-expanded":R.value,"aria-label":`Quality: ${j.value}`,onClick:s[2]||(s[2]=d=>R.value=!R.value)},[e.createVNode(Xe),e.createElementVNode("span",ft,e.toDisplayString(j.value),1)],8,mt),R.value?(e.openBlock(),e.createElementBlock("ul",kt,[e.createElementVNode("li",null,[e.createElementVNode("button",{type:"button",role:"option","aria-selected":n.selectedLevel<0,class:e.normalizeClass(["gvp-quality-menu-item",{"is-active":n.selectedLevel<0}]),onClick:s[3]||(s[3]=d=>W(e.unref(he).index))},e.toDisplayString(U.value?`Auto (${U.value.label})`:"Auto"),11,gt)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,d=>(e.openBlock(),e.createElementBlock("li",{key:d.index},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":d.index===n.selectedLevel,class:e.normalizeClass(["gvp-quality-menu-item",{"is-active":d.index===n.selectedLevel}]),onClick:w=>W(d.index)},e.toDisplayString(d.label),11,ht)]))),128))])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),O.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"captionsRootEl",ref:Y,class:"gvp-captions"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["gvp-ctrl-btn",S.value>=0&&"is-active"]),"aria-haspopup":"listbox","aria-expanded":H.value,"aria-label":"Captions","aria-pressed":S.value>=0,onClick:s[4]||(s[4]=d=>H.value=!H.value)},[e.createVNode(de)],10,yt),H.value?(e.openBlock(),e.createElementBlock("ul",Ct,[e.createElementVNode("li",null,[e.createElementVNode("button",{type:"button",role:"option","aria-selected":S.value===-1,class:e.normalizeClass(["gvp-captions-menu-item",{"is-active":S.value===-1}]),onClick:X},"Off",10,Et)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,d=>(e.openBlock(),e.createElementBlock("li",{key:d.index},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":d.index===S.value,class:e.normalizeClass(["gvp-captions-menu-item",{"is-active":d.index===S.value}]),onClick:w=>J(d.index)},e.toDisplayString(d.label),11,wt)]))),128))])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["gvp-volume",!e.unref(r)&&"is-expandable"])},[e.createElementVNode("button",{type:"button",class:"gvp-ctrl-btn","aria-label":T.value?"Unmute":"Mute","aria-pressed":T.value,onClick:f},[T.value||x.value===0?(e.openBlock(),e.createBlock(Ke,{key:0})):x.value<.5?(e.openBlock(),e.createBlock(We,{key:1})):(e.openBlock(),e.createBlock(Ze,{key:2}))],8,bt),e.unref(r)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Bt,[e.createElementVNode("div",xt,[e.createElementVNode("div",{class:"gvp-volume-fill",style:e.normalizeStyle({width:`${T.value?0:Math.round(x.value*100)}%`})},null,4)]),e.createElementVNode("input",{type:"range",class:"gvp-volume-input",min:0,max:100,step:1,value:T.value?0:Math.round(x.value*100),"aria-label":"Volume","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":T.value?0:Math.round(x.value*100),onInput:B},null,40,_t)]))],2),e.unref(u)?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:e.normalizeClass(["gvp-ctrl-btn",c.value&&"is-active"]),"aria-label":c.value?"Exit picture-in-picture":"Picture-in-picture","aria-pressed":c.value,onClick:M},[e.createVNode(ve)],10,Lt)):e.createCommentVNode("",!0),e.unref(ge)?(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",class:e.normalizeClass(["gvp-ctrl-btn",A.value&&"is-active"]),"aria-label":A.value?"Exit fullscreen":"Enter fullscreen","aria-pressed":A.value,onClick:ke},[A.value?(e.openBlock(),e.createBlock(ot,{key:0})):(e.openBlock(),e.createBlock(tt,{key:1}))],10,Vt)):e.createCommentVNode("",!0)])],34))}}),Pt={name:"IconDesktop"},Mt=e.defineComponent({...Pt,props:{class:{}},setup(n){const l=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M14 2H10C6.72077 2 5.08116 2 3.91891 2.81382C3.48891 3.1149 3.1149 3.48891 2.81382 3.91891C2 5.08116 2 6.72077 2 10C2 13.2792 2 14.9188 2.81382 16.0811C3.1149 16.5111 3.48891 16.8851 3.91891 17.1862C5.08116 18 6.72077 18 10 18H14C17.2792 18 18.9188 18 20.0811 17.1862C20.5111 16.8851 20.8851 16.5111 21.1862 16.0811C22 14.9188 22 13.2792 22 10C22 6.72077 22 5.08116 21.1862 3.91891C20.8851 3.48891 20.5111 3.1149 20.0811 2.81382C18.9188 2 17.2792 2 14 2Z",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1),e.createElementVNode("path",{d:"M11 15H13",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M14.5 22L14.1845 21.5811C13.4733 20.6369 13.2969 19.1944 13.7468 18M9.5 22L9.8155 21.5811C10.5267 20.6369 10.7031 19.1944 10.2532 18",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1),e.createElementVNode("path",{d:"M7 22H17",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),St={name:"IconMobile"},Tt=e.defineComponent({...St,props:{class:{}},setup(n){const l=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M5 9C5 5.70017 5 4.05025 6.02513 3.02513C7.05025 2 8.70017 2 12 2C15.2998 2 16.9497 2 17.9749 3.02513C19 4.05025 19 5.70017 19 9V15C19 18.2998 19 19.9497 17.9749 20.9749C16.9497 22 15.2998 22 12 22C8.70017 22 7.05025 22 6.02513 20.9749C5 19.9497 5 18.2998 5 15V9Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},null,-1),e.createElementVNode("path",{d:"M11 19H13",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M9 2L9.089 2.53402C9.28188 3.69129 9.37832 4.26993 9.77519 4.62204C10.1892 4.98934 10.7761 5 12 5C13.2239 5 13.8108 4.98934 14.2248 4.62204C14.6217 4.26993 14.7181 3.69129 14.911 2.53402L15 2",stroke:"currentColor","stroke-width":"2","stroke-linejoin":"round"},null,-1)])],2))}}),It={name:"IconPlay"},Dt=e.defineComponent({...It,props:{class:{}},setup(n){const l=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"22",height:"22",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M5.3335 11.45V4.54997C5.3335 4.36108 5.40016 4.20275 5.5335 4.07497C5.66683 3.94719 5.82238 3.8833 6.00016 3.8833C6.05572 3.8833 6.11405 3.89163 6.17516 3.9083C6.23627 3.92497 6.29461 3.94997 6.35016 3.9833L11.7835 7.4333C11.8835 7.49997 11.9585 7.5833 12.0085 7.6833C12.0585 7.7833 12.0835 7.88886 12.0835 7.99997C12.0835 8.11108 12.0585 8.21663 12.0085 8.31663C11.9585 8.41663 11.8835 8.49997 11.7835 8.56663L6.35016 12.0166C6.29461 12.05 6.23627 12.075 6.17516 12.0916C6.11405 12.1083 6.05572 12.1166 6.00016 12.1166C5.82238 12.1166 5.66683 12.0527 5.5335 11.925C5.40016 11.7972 5.3335 11.6389 5.3335 11.45Z",fill:"currentColor"},null,-1)])],2))}}),zt={name:"IconX"},Ht=e.defineComponent({...zt,props:{class:{}},setup(n){const l=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M6.94994 5.53594L12.1929 0.292938C12.5834 -0.0975275 13.2165 -0.0975279 13.6069 0.292938C13.9974 0.683403 13.9974 1.31647 13.6069 1.70694L8.36394 6.94994L13.6069 12.1929C13.9974 12.5834 13.9974 13.2165 13.6069 13.6069C13.2165 13.9974 12.5834 13.9974 12.1929 13.6069L6.94994 8.36394L1.70694 13.6069C1.31647 13.9974 0.683403 13.9974 0.292938 13.6069C-0.0975279 13.2165 -0.0975277 12.5834 0.292938 12.1929L5.53594 6.94994L0.292938 1.70694C-0.0975279 1.31647 -0.0975279 0.683403 0.292938 0.292938C0.683403 -0.0975279 1.31647 -0.0975277 1.70694 0.292938L6.94994 5.53594Z",fill:"currentColor"},null,-1)])],2))}});function pe(n){if(!n)return null;if(/^[A-Za-z0-9_-]{11}$/.test(n))return n;let l;try{l=new URL(n)}catch{return null}const r=l.hostname.replace(/^www\./,"");if(r==="youtu.be"){const t=l.pathname.slice(1).split("/")[0];return/^[A-Za-z0-9_-]{11}$/.test(t)?t:null}if(r==="youtube.com"||r==="m.youtube.com"||r==="music.youtube.com"||r==="youtube-nocookie.com"){const t=l.searchParams.get("v");if(t&&/^[A-Za-z0-9_-]{11}$/.test(t))return t;const v=/^\/(?:embed|shorts|v|live)\/([A-Za-z0-9_-]{11})/.exec(l.pathname);if(v)return v[1]}return null}function me(n){try{const l=new URL(n),r=l.searchParams.get("t")??l.searchParams.get("start");if(!r)return null;if(/^\d+s?$/.test(r))return Number.parseInt(r,10);const t=/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/.exec(r);if(t){const v=Number.parseInt(t[1]??"0",10),a=Number.parseInt(t[2]??"0",10),k=Number.parseInt(t[3]??"0",10),p=v*3600+a*60+k;return p>0?p:null}}catch{}return null}function fe(n,l={}){const{autoPlay:r=!1,muted:t=!0,loop:v=!1,controls:a=!0,startSeconds:k}=l,p=new URLSearchParams({rel:"0",modestbranding:"1",playsinline:"1",controls:a?"1":"0"});return r?(p.set("autoplay","1"),p.set("mute","1")):t&&p.set("mute","1"),v&&(p.set("loop","1"),p.set("playlist",n)),k&&k>0&&p.set("start",String(k)),`https://www.youtube-nocookie.com/embed/${n}?${p.toString()}`}const At=["src"],qt={key:2,class:"gvp-vignette"},Rt={key:3,class:"gvp-toggle"},Ft={class:"gvp-toggle-pill"},Ut=["aria-pressed"],Ot=["aria-pressed"],jt=["aria-label","aria-pressed"],Zt=["aria-label"],Qt={key:10,class:"gvp-play-wrap"},Wt={key:0,class:"gvp-tooltip",role:"tooltip"},Yt={key:12,class:"gvp-bottom-fade"},Kt=e.defineComponent({__name:"VideoPlayer",props:{src:{},poster:{},showDeviceToggle:{type:Boolean,default:!0},defaultDevice:{default:"desktop"},hoverPlay:{type:Boolean,default:!1},tooltipText:{},muted:{type:Boolean,default:!0},loop:{type:Boolean,default:!1},controls:{type:[Boolean,String],default:!0},autoPlay:{type:Boolean,default:!1},frameMaxWidth:{},aspectRatio:{},hlsConfig:{},isHls:{type:Boolean},class:{default:""},closable:{type:Boolean,default:!1}},emits:["close","play","pause"],setup(n,{emit:l}){const r=n,t=l,v=e.ref(null),a=e.ref(r.defaultDevice),k=e.ref(!1),p=e.ref(!1),b=e.ref(null),E=e.ref([]),C=e.ref(-1),V=e.ref([]),g=e.ref(-1),m=e.ref(-1),y=e.ref(1),i=e.ref(!1),h=e.ref(!1),N=e.ref(null),D=typeof document<"u"&&!!document.pictureInPictureEnabled,x=e.computed(()=>r.controls===!0||r.controls==="custom"),T=e.computed(()=>r.controls==="native"),f=e.computed(()=>pe(r.src)),B=e.computed(()=>f.value!==null),$=e.computed(()=>f.value?fe(f.value,{autoPlay:r.autoPlay,muted:r.muted,loop:r.loop,controls:x.value?!0:T.value,startSeconds:me(r.src)}):null);function _(c){E.value=c,C.value=-1}function L(c){V.value=c,m.value=-1}const z=e.computed(()=>!B.value&&E.value.length>1),R=e.computed(()=>{var c;return C.value>=0?C.value:((c=E.value[0])==null?void 0:c.index)??-1}),Q=e.computed(()=>{var c,u;return a.value==="mobile"?((c=r.aspectRatio)==null?void 0:c.mobile)??"9/16":((u=r.aspectRatio)==null?void 0:u.desktop)??"16/9"}),ne=e.computed(()=>{var c,u;return a.value==="mobile"?((c=r.frameMaxWidth)==null?void 0:c.mobile)??"420px":((u=r.frameMaxWidth)==null?void 0:u.desktop)??"960px"}),I=e.computed(()=>{var c;return((c=v.value)==null?void 0:c.videoEl)??null});async function U(){const c=I.value;if(c)try{c.readyState<2&&c.load();const u=c.play();b.value=u,await u,k.value=!0}catch{k.value=!1}finally{b.value=null}}async function j(){const c=I.value;if(c){if(b.value)try{await b.value}catch{}c.pause()}}async function W(){!r.hoverPlay||B.value||await U()}async function O(){!r.hoverPlay||B.value||(await j(),k.value=!1)}async function S(){const c=I.value;c&&(c.paused?await U():(await j(),k.value=!1))}function H(){p.value=!0,W()}function Y(){p.value=!1,O()}function K(c){y.value=c;const u=I.value;u&&(u.playbackRate=c)}e.watch(I,c=>{c&&(c.addEventListener("ratechange",()=>{y.value=c.playbackRate}),c.addEventListener("enterpictureinpicture",()=>{i.value=!0}),c.addEventListener("leavepictureinpicture",()=>{i.value=!1}))});function J(){const c=I.value;c&&(document.pictureInPictureElement?document.exitPictureInPicture().catch(()=>{}):c.requestPictureInPicture().catch(()=>{}))}function X(c){var A,G,ee;const u=I.value;if(!(!u||!h.value&&!((A=N.value)!=null&&A.contains(document.activeElement))||c.target.tagName==="INPUT"&&c.key!==" "))switch(c.key){case" ":case"k":c.preventDefault(),S();break;case"ArrowLeft":c.preventDefault(),u.currentTime=Math.max(0,u.currentTime-5);break;case"ArrowRight":c.preventDefault(),u.currentTime=Math.min(u.duration||0,u.currentTime+5);break;case"ArrowUp":c.preventDefault(),u.volume=Math.min(1,u.volume+.1),u.muted&&(u.muted=!1);break;case"ArrowDown":c.preventDefault(),u.volume=Math.max(0,u.volume-.1);break;case"m":u.muted=!u.muted;break;case"f":{const oe=document.fullscreenElement??document.webkitFullscreenElement??null,te=((G=N.value)==null?void 0:G.requestFullscreen)??((ee=N.value)==null?void 0:ee.webkitRequestFullscreen),F=document.exitFullscreen??document.webkitExitFullscreen;oe===N.value?F==null||F.call(document).catch(()=>{}):te&&N.value&&te.call(N.value).catch(()=>{});break}case"p":D&&J();break}}return e.onMounted(()=>{document.addEventListener("keydown",X)}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",X)}),(c,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:N,class:e.normalizeClass(["gvp-root",r.class]),style:e.normalizeStyle({width:ne.value,aspectRatio:Q.value}),onMouseenter:u[10]||(u[10]=M=>{h.value=!0,H()}),onMouseleave:u[11]||(u[11]=M=>{h.value=!1,Y()})},[B.value?(e.openBlock(),e.createElementBlock("iframe",{key:0,class:"gvp-video gvp-youtube",src:$.value??void 0,title:"YouTube video player",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowfullscreen:"",referrerpolicy:"strict-origin-when-cross-origin"},null,8,At)):(e.openBlock(),e.createBlock(ie,{key:1,ref_key:"hlsPlayerRef",ref:v,controls:T.value,"hls-config":n.hlsConfig,"is-hls":n.isHls,loop:n.loop,muted:n.muted,"auto-play":n.autoPlay,"audio-track-index":C.value,"quality-level-index":m.value,"plays-inline":!0,poster:n.poster,src:n.src,class:"gvp-video",preload:"metadata",onAudioTracks:_,onQualityLevels:L,onCurrentLevel:u[0]||(u[0]=M=>g.value=M),onPause:u[1]||(u[1]=M=>{k.value=!1,t("pause")}),onPlay:u[2]||(u[2]=M=>{k.value=!0,t("play")})},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"default")]),_:3},8,["controls","hls-config","is-hls","loop","muted","auto-play","audio-track-index","quality-level-index","poster","src"])),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",qt)),n.showDeviceToggle?(e.openBlock(),e.createElementBlock("div",Rt,[e.createElementVNode("div",Ft,[e.createElementVNode("button",{"aria-pressed":a.value==="desktop",class:e.normalizeClass(["gvp-toggle-btn",{"is-active":a.value==="desktop"}]),"aria-label":"Desktop view",type:"button",onClick:u[3]||(u[3]=M=>a.value="desktop")},[e.createVNode(Mt)],10,Ut),u[12]||(u[12]=e.createElementVNode("div",{class:"gvp-toggle-divider"},null,-1)),e.createElementVNode("button",{"aria-pressed":a.value==="mobile",class:e.normalizeClass(["gvp-toggle-btn",{"is-active":a.value==="mobile"}]),"aria-label":"Mobile view",type:"button",onClick:u[4]||(u[4]=M=>a.value="mobile")},[e.createVNode(Tt)],10,Ot)])])):e.createCommentVNode("",!0),n.closable?(e.openBlock(),e.createElementBlock("button",{key:4,"aria-label":"Close",class:"gvp-close",type:"button",onClick:u[5]||(u[5]=M=>t("close"))},[e.createVNode(Ht)])):e.createCommentVNode("",!0),z.value&&!x.value?(e.openBlock(),e.createBlock(Ve,{key:5,tracks:E.value,"active-index":R.value,onSelect:u[6]||(u[6]=M=>C.value=M)},null,8,["tracks","active-index"])):e.createCommentVNode("",!0),!B.value&&!x.value?(e.openBlock(),e.createBlock(Te,{key:6,speed:y.value,onSelect:K},null,8,["speed"])):e.createCommentVNode("",!0),!B.value&&!x.value?(e.openBlock(),e.createBlock(qe,{key:7,video:I.value},null,8,["video"])):e.createCommentVNode("",!0),!B.value&&e.unref(D)&&!x.value?(e.openBlock(),e.createElementBlock("button",{key:8,type:"button",class:e.normalizeClass(["gvp-pip-btn",{"is-active":i.value}]),"aria-label":i.value?"Exit picture-in-picture":"Picture-in-picture","aria-pressed":i.value,onClick:J},[e.createVNode(ve)],10,jt)):e.createCommentVNode("",!0),!B.value&&x.value?(e.openBlock(),e.createElementBlock("button",{key:9,type:"button",class:"gvp-click-layer","aria-label":k.value?"Pause":"Play",onClick:S},null,8,Zt)):e.createCommentVNode("",!0),!B.value&&!x.value&&!k.value?(e.openBlock(),e.createElementBlock("div",Qt,[e.createElementVNode("button",{"aria-label":"Play",class:"gvp-play",type:"button",onClick:S,onMouseenter:u[7]||(u[7]=M=>p.value=!0),onMouseleave:u[8]||(u[8]=M=>p.value=!1)},[e.createVNode(Dt),n.tooltipText&&p.value?(e.openBlock(),e.createElementBlock("span",Wt,e.toDisplayString(n.tooltipText),1)):e.createCommentVNode("",!0)],32)])):e.createCommentVNode("",!0),!B.value&&x.value?(e.openBlock(),e.createBlock($t,{key:11,video:I.value,"is-playing":k.value,container:N.value,"on-toggle-play":S,"quality-levels":V.value,"current-level":g.value,"selected-level":m.value,onSelectLevel:u[9]||(u[9]=M=>m.value=M)},null,8,["video","is-playing","container","quality-levels","current-level","selected-level"])):e.createCommentVNode("",!0),!B.value&&!x.value?(e.openBlock(),e.createElementBlock("div",Yt)):e.createCommentVNode("",!0)],38))}});exports.HLSPlayer=ie;exports.VueVideoPlayer=Kt;exports.parseYouTubeId=pe;exports.parseYouTubeStart=me;exports.youTubeEmbedUrl=fe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Z=require("hls.js");function we(t,l,n){const o=t==null?void 0:t.trim();if(o)return o;if(l){try{const u=new Intl.DisplayNames(void 0,{type:"language"}).of(l);if(u&&u!==l)return u}catch{}return l}return`Audio ${n+1}`}const Ze={index:-1,height:0,label:"Auto"};function We(t,l){return t>0?`${t}p`:`Level ${l+1}`}const Ke=["muted","loop","controls","autoplay","playsinline","preload","poster"],Ve=e.defineComponent({__name:"HLSPlayer",props:{src:{},hlsConfig:{},isHls:{type:Boolean},muted:{type:Boolean,default:!0},loop:{type:Boolean,default:!1},controls:{type:Boolean,default:!1},autoPlay:{type:Boolean,default:!1},playsInline:{type:Boolean,default:!0},preload:{default:"metadata"},poster:{},class:{},audioTrackIndex:{default:-1},qualityLevelIndex:{default:-1}},emits:["play","pause","ended","fatal-error","live-change","audio-tracks","quality-levels","current-level"],setup(t,{expose:l,emit:n}){const o=t,r=n,u=e.ref(null),c=e.ref(null);let p,C;const N=globalThis.window!==void 0&&Z.isSupported(),V=v=>!!o.isHls||N&&v.endsWith(".m3u8");function b(){C==null||C(),C=void 0,p==null||p(),p=void 0,c.value&&(c.value.destroy(),c.value=null);const v=u.value;if(v){for(v.pause(),v.removeAttribute("src");v.firstChild;)v.firstChild.remove();v.load(),r("audio-tracks",[]),r("quality-levels",[]),r("current-level",-1),r("live-change",!1)}}function h(v){var M,D,W;const x=u.value;if(!x||!v)return;b();const A=()=>{o.autoPlay&&x.play().catch(()=>{})};if(V(v)){const y=new Z(o.hlsConfig);c.value=y;const z=()=>{const S=y.audioTracks.map((L,_)=>({index:_,label:we(L.name,L.lang,_),lang:L.lang||void 0}));r("audio-tracks",S)},$=()=>{const S=y.levels.map((L,_)=>({index:_,height:L.height||0,label:We(L.height||0,_)}));r("quality-levels",S)};y.on(Z.Events.MANIFEST_PARSED,A),y.on(Z.Events.MANIFEST_PARSED,$),y.on(Z.Events.LEVELS_UPDATED,$),y.on(Z.Events.LEVEL_SWITCHED,(S,L)=>{r("current-level",L.level)}),y.on(Z.Events.AUDIO_TRACKS_UPDATED,z),y.on(Z.Events.AUDIO_TRACK_SWITCHED,z),y.on(Z.Events.LEVEL_LOADED,(S,L)=>{var _;r("live-change",!!((_=L.details)!=null&&_.live))});let P=!1;y.on(Z.Events.ERROR,(S,L)=>{L.fatal&&(L.type===Z.ErrorTypes.NETWORK_ERROR&&!P?(P=!0,y.startLoad()):L.type===Z.ErrorTypes.MEDIA_ERROR&&!P?(P=!0,y.recoverMediaError()):(y.destroy(),c.value=null,r("fatal-error")))}),y.attachMedia(x),y.loadSource(v)}else{x.src=v,x.load(),x.addEventListener("loadedmetadata",A,{once:!0}),C=()=>{x.removeEventListener("loadedmetadata",A)};const y=x.audioTracks;if(y){const z=()=>{const $=[];for(let P=0;P<y.length;P++){const S=y[P];$.push({index:P,label:we(S.label,S.language,P),lang:S.language||void 0})}r("audio-tracks",$)};(M=y.addEventListener)==null||M.call(y,"addtrack",z),(D=y.addEventListener)==null||D.call(y,"removetrack",z),(W=y.addEventListener)==null||W.call(y,"change",z),y.length>0&&z(),p=()=>{var $,P,S;($=y.removeEventListener)==null||$.call(y,"addtrack",z),(P=y.removeEventListener)==null||P.call(y,"removetrack",z),(S=y.removeEventListener)==null||S.call(y,"change",z)}}}}function E(v){var M;if(v==null||v<0)return;const x=c.value;if(x){x.audioTrack!==v&&(x.audioTrack=v);return}const A=(M=u.value)==null?void 0:M.audioTracks;if(A)for(let D=0;D<A.length;D++)A[D].enabled=D===v}function B(v){if(v==null)return;const x=c.value;x&&x.currentLevel!==v&&(x.currentLevel=v)}return e.onMounted(()=>{o.src&&h(o.src)}),e.watch(()=>o.src,v=>{v&&h(v)}),e.watch(()=>o.audioTrackIndex,v=>E(v)),e.watch(()=>o.qualityLevelIndex,v=>B(v)),e.onBeforeUnmount(b),l({videoEl:u}),(v,x)=>(e.openBlock(),e.createElementBlock("video",{ref_key:"videoEl",ref:u,muted:t.muted,loop:t.loop,controls:t.controls,autoplay:t.autoPlay,playsinline:t.playsInline,preload:t.preload,poster:t.poster,class:e.normalizeClass(o.class),onPlay:x[0]||(x[0]=A=>r("play")),onPause:x[1]||(x[1]=A=>r("pause")),onEnded:x[2]||(x[2]=A=>r("ended"))},[e.renderSlot(v.$slots,"default")],42,Ke))}}),Qe={name:"IconAudio"},Ye=e.defineComponent({...Qe,props:{class:{}},setup(t){const l=t;return(n,o)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16M19 5.5C20.5 7 21.5 9.5 21.5 12C21.5 14.5 20.5 17 19 18.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),Ge={name:"IconChevron"},Le=e.defineComponent({...Ge,props:{class:{}},setup(t){const l=t;return(n,o)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M6 9L12 15L18 9",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),Je=["aria-expanded"],Xe={class:"gvp-audio-label"},et={key:0,class:"gvp-audio-menu",role:"listbox","aria-label":"Audio tracks"},tt=["aria-selected","onClick"],nt=e.defineComponent({__name:"AudioTrackSwitcher",props:{tracks:{},activeIndex:{}},emits:["select"],setup(t,{emit:l}){const n=t,o=l,r=e.ref(!1),u=e.ref(null),c=e.computed(()=>n.tracks.find(V=>V.index===n.activeIndex)??n.tracks[0]);function p(V){u.value&&!u.value.contains(V.target)&&(r.value=!1)}function C(V){V.key==="Escape"&&(r.value=!1)}e.watch(r,V=>{V?(document.addEventListener("mousedown",p),document.addEventListener("keydown",C)):(document.removeEventListener("mousedown",p),document.removeEventListener("keydown",C))}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",C)});function N(V){o("select",V),r.value=!1}return(V,b)=>{var h;return e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:u,class:"gvp-audio"},[e.createElementVNode("button",{type:"button",class:"gvp-audio-btn","aria-haspopup":"listbox","aria-expanded":r.value,"aria-label":"Audio track",onClick:b[0]||(b[0]=E=>r.value=!r.value)},[e.createVNode(Ye),e.createElementVNode("span",Xe,e.toDisplayString((h=c.value)==null?void 0:h.label),1),e.createVNode(Le)],8,Je),r.value?(e.openBlock(),e.createElementBlock("ul",et,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.tracks,E=>(e.openBlock(),e.createElementBlock("li",{key:E.index},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":E.index===t.activeIndex,class:e.normalizeClass(["gvp-audio-menu-item",{"is-active":E.index===t.activeIndex}]),onClick:B=>N(E.index)},e.toDisplayString(E.label),11,tt)]))),128))])):e.createCommentVNode("",!0)],512)}}}),ot={name:"IconSpeed"},lt=e.defineComponent({...ot,props:{class:{}},setup(t){const l=t;return(n,o)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2Z",stroke:"currentColor","stroke-width":"1.5"},null,-1),e.createElementVNode("path",{d:"M12 8V12L14.5 14.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),at=["aria-expanded"],rt={class:"gvp-speed-label"},st={key:0,class:"gvp-speed-menu",role:"listbox","aria-label":"Playback speed"},it=["aria-selected","onClick"],ct=e.defineComponent({__name:"SpeedSwitcher",props:{speed:{}},emits:["select"],setup(t,{emit:l}){const n=[.5,.75,1,1.25,1.5,2],o=l,r=e.ref(!1),u=e.ref(null);function c(N){u.value&&!u.value.contains(N.target)&&(r.value=!1)}function p(N){N.key==="Escape"&&(r.value=!1)}e.watch(r,N=>{N?(document.addEventListener("mousedown",c),document.addEventListener("keydown",p)):(document.removeEventListener("mousedown",c),document.removeEventListener("keydown",p))}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",c),document.removeEventListener("keydown",p)});function C(N){o("select",N),r.value=!1}return(N,V)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:u,class:"gvp-speed"},[e.createElementVNode("button",{type:"button",class:"gvp-speed-btn","aria-haspopup":"listbox","aria-expanded":r.value,"aria-label":"`Playback speed: ${speed === 1 ? '1×' : speed + '×'}`",onClick:V[0]||(V[0]=b=>r.value=!r.value)},[e.createVNode(lt),e.createElementVNode("span",rt,e.toDisplayString(t.speed===1?"1×":`${t.speed}×`),1),e.createVNode(Le)],8,at),r.value?(e.openBlock(),e.createElementBlock("ul",st,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(n,b=>e.createElementVNode("li",{key:b},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":b===t.speed,class:e.normalizeClass(["gvp-speed-menu-item",{"is-active":b===t.speed}]),onClick:h=>C(b)},e.toDisplayString(b===1?"Normal":`${b}×`),11,it)])),64))])):e.createCommentVNode("",!0)],512))}}),ut={name:"IconCaptions"},dt=e.defineComponent({...ut,props:{class:{}},setup(t){const l=t;return(n,o)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...o[0]||(o[0]=[e.createElementVNode("rect",{x:"2",y:"5",width:"20",height:"14",rx:"3",stroke:"currentColor","stroke-width":"1.5"},null,-1),e.createElementVNode("path",{d:"M7 12H11M13 12H17M7 15H9M11 15H13M15 15H17",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),vt=["aria-expanded","aria-pressed"],mt={key:0,class:"gvp-captions-menu",role:"listbox","aria-label":"Captions"},pt=["aria-selected"],ft=["aria-selected","onClick"],kt=e.defineComponent({__name:"CaptionsSwitcher",props:{video:{}},setup(t){const l=t,n=e.ref([]),o=e.ref(-1),r=e.ref(!1),u=e.ref(null);function c(h){const E=[];for(let v=0;v<h.length;v++){const x=h[v];(x.kind==="subtitles"||x.kind==="captions")&&E.push({index:v,label:x.label||x.language||`Track ${v+1}`})}n.value=E;let B=-1;for(let v=0;v<h.length;v++)if(h[v].mode==="showing"){B=v;break}o.value=B}let p=null;e.watch(()=>l.video,h=>{if(p==null||p(),p=null,!h){n.value=[],o.value=-1;return}const E=h.textTracks;c(E);const B=()=>c(E);typeof E.addEventListener=="function"&&(E.addEventListener("addtrack",B),E.addEventListener("removetrack",B),E.addEventListener("change",B),p=()=>{E.removeEventListener("addtrack",B),E.removeEventListener("removetrack",B),E.removeEventListener("change",B)})},{immediate:!0}),e.onBeforeUnmount(()=>{p==null||p(),document.removeEventListener("mousedown",C),document.removeEventListener("keydown",N)});function C(h){u.value&&!u.value.contains(h.target)&&(r.value=!1)}function N(h){h.key==="Escape"&&(r.value=!1)}e.watch(r,h=>{h?(document.addEventListener("mousedown",C),document.addEventListener("keydown",N)):(document.removeEventListener("mousedown",C),document.removeEventListener("keydown",N))});function V(){if(!l.video)return;const h=l.video.textTracks;for(let E=0;E<h.length;E++)h[E].mode="hidden";o.value=-1,r.value=!1}function b(h){if(!l.video)return;const E=l.video.textTracks;for(let B=0;B<E.length;B++)E[B].mode=B===h?"showing":"hidden";o.value=h,r.value=!1}return(h,E)=>n.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"rootEl",ref:u,class:"gvp-captions"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["gvp-captions-btn",{"is-active":o.value>=0}]),"aria-haspopup":"listbox","aria-expanded":r.value,"aria-pressed":o.value>=0,"aria-label":"Captions",onClick:E[0]||(E[0]=B=>r.value=!r.value)},[e.createVNode(dt)],10,vt),r.value?(e.openBlock(),e.createElementBlock("ul",mt,[e.createElementVNode("li",null,[e.createElementVNode("button",{type:"button",role:"option","aria-selected":o.value===-1,class:e.normalizeClass(["gvp-captions-menu-item",{"is-active":o.value===-1}]),onClick:V}," Off ",10,pt)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,B=>(e.openBlock(),e.createElementBlock("li",{key:B.index},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":B.index===o.value,class:e.normalizeClass(["gvp-captions-menu-item",{"is-active":B.index===o.value}]),onClick:v=>b(B.index)},e.toDisplayString(B.label),11,ft)]))),128))])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0)}}),gt={name:"IconPause"},ht=e.defineComponent({...gt,props:{class:{}},setup(t){const l=t;return(n,o)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...o[0]||(o[0]=[e.createElementVNode("rect",{x:"6",y:"5",width:"4",height:"14",rx:"1",fill:"currentColor"},null,-1),e.createElementVNode("rect",{x:"14",y:"5",width:"4",height:"14",rx:"1",fill:"currentColor"},null,-1)])],2))}}),yt={name:"IconPlaySolid"},Et=e.defineComponent({...yt,props:{class:{}},setup(t){const l=t;return(n,o)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M7 5.5V18.5C7 19.2659 7.84856 19.7261 8.4899 19.3071L19.0801 12.4014C19.6644 12.0204 19.6644 11.9796 19.0801 11.5986L8.4899 4.69288C7.84856 4.27388 7 4.73408 7 5.5Z",fill:"currentColor"},null,-1)])],2))}}),Ct={name:"IconPrev"},wt=e.defineComponent({...Ct,props:{class:{}},setup(t){const l=t;return(n,o)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M16.5 18.5V5.5C16.5 4.73408 15.6514 4.27388 15.0101 4.69288L6.91993 9.98432C6.33563 10.3653 6.33563 11.0347 6.91993 11.4157L15.0101 16.7071C15.6514 17.1261 16.5 16.6659 16.5 15.9V18.5Z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M6 5V19",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},null,-1)])],2))}}),bt={name:"IconNext"},Bt=e.defineComponent({...bt,props:{class:{}},setup(t){const l=t;return(n,o)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M7.5 5.5V18.5C7.5 19.2659 8.34856 19.7261 8.98990 19.3071L17.0801 14.0157C17.6644 13.6347 17.6644 12.9653 17.0801 12.5843L8.98990 7.29288C8.34856 6.87388 7.5 7.33408 7.5 8.1V5.5Z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 5V19",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},null,-1)])],2))}}),xt={name:"IconVolumeHigh"},Nt=e.defineComponent({...xt,props:{class:{}},setup(t){const l=t;return(n,o)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16M19 5.5C20.5 7 21.5 9.5 21.5 12C21.5 14.5 20.5 17 19 18.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),Vt={name:"IconVolumeLow"},Lt=e.defineComponent({...Vt,props:{class:{}},setup(t){const l=t;return(n,o)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),$t={name:"IconVolumeMuted"},_t=e.defineComponent({...$t,props:{class:{}},setup(t){const l=t;return(n,o)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M16 9L22 15M22 9L16 15",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),Pt={name:"IconPiP"},$e=e.defineComponent({...Pt,props:{class:{}},setup(t){const l=t;return(n,o)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...o[0]||(o[0]=[e.createElementVNode("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",stroke:"currentColor","stroke-width":"1.5"},null,-1),e.createElementVNode("rect",{x:"12",y:"12",width:"8",height:"5",rx:"1",fill:"currentColor"},null,-1)])],2))}}),St={name:"IconFullscreen"},Tt=e.defineComponent({...St,props:{class:{}},setup(t){const l=t;return(n,o)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M4 9V4H9M15 4H20V9M20 15V20H15M9 20H4V15",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),Mt={name:"IconFullscreenExit"},It=e.defineComponent({...Mt,props:{class:{}},setup(t){const l=t;return(n,o)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M9 4V9H4M15 9V4H20M15 20V15H20M9 15H4V20",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),At={name:"IconGear"},zt=e.defineComponent({...At,props:{class:{}},setup(t){const l=t;return(n,o)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M12 15.5A3.5 3.5 0 1 0 12 8.5A3.5 3.5 0 0 0 12 15.5Z",stroke:"currentColor","stroke-width":"2"},null,-1),e.createElementVNode("path",{d:"M19.4 13A1.65 1.65 0 0 0 19.73 14.82L19.79 14.88A2 2 0 1 1 16.96 17.71L16.9 17.65A1.65 1.65 0 0 0 15.08 17.32A1.65 1.65 0 0 0 14 18.83V19A2 2 0 1 1 10 19V18.91A1.65 1.65 0 0 0 8.83 17.4A1.65 1.65 0 0 0 7.01 17.73L6.95 17.79A2 2 0 1 1 4.12 14.96L4.18 14.9A1.65 1.65 0 0 0 4.51 13.08A1.65 1.65 0 0 0 3 12H2.91A2 2 0 1 1 2.91 8H3A1.65 1.65 0 0 0 4.51 6.83A1.65 1.65 0 0 0 4.18 5.01L4.12 4.95A2 2 0 1 1 6.95 2.12L7.01 2.18A1.65 1.65 0 0 0 8.83 2.51H8.91A1.65 1.65 0 0 0 10 1V0.91A2 2 0 1 1 14 0.91V1A1.65 1.65 0 0 0 15.08 2.51A1.65 1.65 0 0 0 16.9 2.18L16.96 2.12A2 2 0 1 1 19.79 4.95L19.73 5.01A1.65 1.65 0 0 0 19.4 6.83V6.91A1.65 1.65 0 0 0 21 8H21.09A2 2 0 1 1 21.09 12H21A1.65 1.65 0 0 0 19.4 13Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),Dt={name:"IconChevronRight"},ue=e.defineComponent({...Dt,props:{class:{}},setup(t){const l=t;return(n,o)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M9 6L15 12L9 18",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),Ht={name:"IconCheck"},ae=e.defineComponent({...Ht,props:{class:{}},setup(t){const l=t;return(n,o)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M5 12L10 17L19 7",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),Ft=["aria-expanded"],Rt={key:0,class:"gvp-settings-menu",role:"menu"},qt={class:"gvp-settings-row-value"},Ot={class:"gvp-settings-row-value"},Ut={class:"gvp-settings-row-value"},jt={class:"gvp-settings-row-value"},Zt=["aria-checked","onClick"],Wt={class:"gvp-settings-check"},Kt=["aria-checked"],Qt={class:"gvp-settings-check"},Yt=["aria-checked","onClick"],Gt={class:"gvp-settings-check"},Jt=["aria-checked"],Xt={class:"gvp-settings-check"},en=["aria-checked","onClick"],tn={class:"gvp-settings-check"},nn=["aria-checked","onClick"],on={class:"gvp-settings-check"},ln={name:"SettingsMenu"},an=e.defineComponent({...ln,props:{video:{},qualityLevels:{default:()=>[]},currentLevel:{default:-1},selectedLevel:{default:-1},audioTracks:{default:()=>[]},audioTrackIndex:{default:-1}},emits:["select-level","select-audio-track"],setup(t,{emit:l}){const n=t,o=l,r=[.5,.75,1,1.25,1.5,2],u=e.ref(!1),c=e.ref("root"),p=e.ref(null),C=e.ref(1);e.watch(()=>n.video,k=>{if(!k)return;const d=()=>{C.value=k.playbackRate};d(),k.addEventListener("ratechange",d)},{immediate:!0});function N(k){n.video&&(n.video.playbackRate=k),C.value=k,c.value="root"}const V=e.ref([]),b=e.ref(-1);function h(k){const d=[];for(let m=0;m<k.length;m++){const H=k[m];(H.kind==="subtitles"||H.kind==="captions")&&d.push({index:m,label:H.label||H.language||`Track ${m+1}`})}V.value=d;let O=-1;for(let m=0;m<k.length;m++)if(k[m].mode==="showing"){O=m;break}b.value=O}e.watch(()=>n.video,k=>{if(!k){V.value=[],b.value=-1;return}const d=k.textTracks;h(d);const O=()=>h(d);typeof d.addEventListener=="function"&&(d.addEventListener("addtrack",O),d.addEventListener("removetrack",O),d.addEventListener("change",O))},{immediate:!0});function E(k){var O;const d=(O=n.video)==null?void 0:O.textTracks;if(d)for(let m=0;m<d.length;m++)d[m].mode=m===k?"showing":"hidden";b.value=k,c.value="root"}const B=e.computed(()=>[...n.qualityLevels].sort((k,d)=>d.height-k.height)),v=e.computed(()=>n.qualityLevels.find(k=>k.index===n.currentLevel)),x=e.computed(()=>{var k;return n.selectedLevel<0?v.value?`Auto (${v.value.label})`:"Auto":((k=n.qualityLevels.find(d=>d.index===n.selectedLevel))==null?void 0:k.label)??"Auto"});function A(k){o("select-level",k),c.value="root"}const M=e.computed(()=>n.audioTracks.find(k=>k.index===n.audioTrackIndex)??n.audioTracks[0]);function D(k){o("select-audio-track",k),c.value="root"}const W=e.computed(()=>n.qualityLevels.length>=2),y=e.computed(()=>V.value.length>0),z=e.computed(()=>n.audioTracks.length>1),$=e.computed(()=>C.value===1?"Normal":`${C.value}×`),P=e.computed(()=>{var k;return b.value<0?"Off":((k=V.value.find(d=>d.index===b.value))==null?void 0:k.label)??"Off"});function S(){u.value=!1,c.value="root"}function L(k){p.value&&!p.value.contains(k.target)&&S()}function _(k){k.key==="Escape"&&S()}e.watch(u,k=>{k?(document.addEventListener("mousedown",L),document.addEventListener("keydown",_)):(document.removeEventListener("mousedown",L),document.removeEventListener("keydown",_))}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",L),document.removeEventListener("keydown",_)});function J(){u.value=!u.value,c.value="root"}return(k,d)=>{var O;return e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:p,class:"gvp-settings"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["gvp-ctrl-btn",{"is-active":u.value}]),"aria-haspopup":"menu","aria-expanded":u.value,"aria-label":"Settings",onClick:J},[e.createVNode(zt)],10,Ft),u.value?(e.openBlock(),e.createElementBlock("div",Rt,[c.value==="root"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("button",{type:"button",role:"menuitem",class:"gvp-settings-row",onClick:d[0]||(d[0]=m=>c.value="speed")},[d[7]||(d[7]=e.createElementVNode("span",{class:"gvp-settings-row-label"},"Speed",-1)),e.createElementVNode("span",qt,e.toDisplayString($.value),1),e.createVNode(ue,{class:"gvp-settings-chevron"})]),W.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",role:"menuitem",class:"gvp-settings-row",onClick:d[1]||(d[1]=m=>c.value="quality")},[d[8]||(d[8]=e.createElementVNode("span",{class:"gvp-settings-row-label"},"Quality",-1)),e.createElementVNode("span",Ot,e.toDisplayString(x.value),1),e.createVNode(ue,{class:"gvp-settings-chevron"})])):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",role:"menuitem",class:"gvp-settings-row",onClick:d[2]||(d[2]=m=>c.value="captions")},[d[9]||(d[9]=e.createElementVNode("span",{class:"gvp-settings-row-label"},"Subtitles",-1)),e.createElementVNode("span",Ut,e.toDisplayString(P.value),1),e.createVNode(ue,{class:"gvp-settings-chevron"})])):e.createCommentVNode("",!0),z.value?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",role:"menuitem",class:"gvp-settings-row",onClick:d[3]||(d[3]=m=>c.value="audio")},[d[10]||(d[10]=e.createElementVNode("span",{class:"gvp-settings-row-label"},"Audio",-1)),e.createElementVNode("span",jt,e.toDisplayString((O=M.value)==null?void 0:O.label),1),e.createVNode(ue,{class:"gvp-settings-chevron"})])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),c.value!=="root"?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"gvp-settings-back",onClick:d[4]||(d[4]=m=>c.value="root")},[e.createVNode(ue,{class:"gvp-settings-back-icon"}),e.createElementVNode("span",null,e.toDisplayString(c.value==="speed"?"Speed":c.value==="quality"?"Quality":c.value==="captions"?"Subtitles":"Audio"),1)])):e.createCommentVNode("",!0),c.value==="speed"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},e.renderList(r,m=>e.createElementVNode("button",{key:m,type:"button",role:"menuitemradio","aria-checked":m===C.value,class:e.normalizeClass(["gvp-settings-option",{"is-active":m===C.value}]),onClick:H=>N(m)},[e.createElementVNode("span",Wt,[m===C.value?(e.openBlock(),e.createBlock(ae,{key:0})):e.createCommentVNode("",!0)]),e.createElementVNode("span",null,e.toDisplayString(m===1?"Normal":`${m}×`),1)],10,Zt)),64)):e.createCommentVNode("",!0),c.value==="quality"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("button",{type:"button",role:"menuitemradio","aria-checked":t.selectedLevel<0,class:e.normalizeClass(["gvp-settings-option",{"is-active":t.selectedLevel<0}]),onClick:d[5]||(d[5]=m=>A(e.unref(Ze).index))},[e.createElementVNode("span",Qt,[t.selectedLevel<0?(e.openBlock(),e.createBlock(ae,{key:0})):e.createCommentVNode("",!0)]),e.createElementVNode("span",null,e.toDisplayString(v.value?`Auto (${v.value.label})`:"Auto"),1)],10,Kt),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,m=>(e.openBlock(),e.createElementBlock("button",{key:m.index,type:"button",role:"menuitemradio","aria-checked":m.index===t.selectedLevel,class:e.normalizeClass(["gvp-settings-option",{"is-active":m.index===t.selectedLevel}]),onClick:H=>A(m.index)},[e.createElementVNode("span",Gt,[m.index===t.selectedLevel?(e.openBlock(),e.createBlock(ae,{key:0})):e.createCommentVNode("",!0)]),e.createElementVNode("span",null,e.toDisplayString(m.label),1)],10,Yt))),128))],64)):e.createCommentVNode("",!0),c.value==="captions"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("button",{type:"button",role:"menuitemradio","aria-checked":b.value===-1,class:e.normalizeClass(["gvp-settings-option",{"is-active":b.value===-1}]),onClick:d[6]||(d[6]=m=>E(-1))},[e.createElementVNode("span",Xt,[b.value===-1?(e.openBlock(),e.createBlock(ae,{key:0})):e.createCommentVNode("",!0)]),d[11]||(d[11]=e.createElementVNode("span",null,"Off",-1))],10,Jt),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,m=>(e.openBlock(),e.createElementBlock("button",{key:m.index,type:"button",role:"menuitemradio","aria-checked":m.index===b.value,class:e.normalizeClass(["gvp-settings-option",{"is-active":m.index===b.value}]),onClick:H=>E(m.index)},[e.createElementVNode("span",tn,[m.index===b.value?(e.openBlock(),e.createBlock(ae,{key:0})):e.createCommentVNode("",!0)]),e.createElementVNode("span",null,e.toDisplayString(m.label),1)],10,en))),128))],64)):e.createCommentVNode("",!0),c.value==="audio"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:5},e.renderList(t.audioTracks,m=>{var H,F,q;return e.openBlock(),e.createElementBlock("button",{key:m.index,type:"button",role:"menuitemradio","aria-checked":m.index===(((H=M.value)==null?void 0:H.index)??-1),class:e.normalizeClass(["gvp-settings-option",{"is-active":m.index===(((F=M.value)==null?void 0:F.index)??-1)}]),onClick:R=>D(m.index)},[e.createElementVNode("span",on,[m.index===(((q=M.value)==null?void 0:q.index)??-1)?(e.openBlock(),e.createBlock(ae,{key:0})):e.createCommentVNode("",!0)]),e.createElementVNode("span",null,e.toDisplayString(m.label),1)],10,nn)}),128)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],512)}}});function de(t){if(!Number.isFinite(t)||t<0)return"--:--";const l=Math.floor(t),n=Math.floor(l/3600),o=Math.floor(l%3600/60),u=(l%60).toString().padStart(2,"0");if(n>0){const c=o.toString().padStart(2,"0");return`${n}:${c}:${u}`}return`${o}:${u}`}function be(t){const l=t.trim().split(":");if(l.length<2||l.length>3)return NaN;const n=l.map(Number);return n.some(o=>!Number.isFinite(o))?NaN:n.length===3?n[0]*3600+n[1]*60+n[2]:n[0]*60+n[1]}function rn(t,l){try{return new URL(t,l).href}catch{return t}}function sn(t,l){const n=[],o=t.replace(/\r/g,"").split(`
2
+ `);for(let r=0;r<o.length;r++){const u=o[r].indexOf("-->");if(u===-1)continue;const c=be(o[r].slice(0,u)),p=be(o[r].slice(u+3));if(!Number.isFinite(c)||!Number.isFinite(p))continue;const C=(o[r+1]??"").trim();if(!C)continue;const N=C.indexOf("#xywh=");let V=C,b=0,h=0,E=0,B=0;if(N!==-1){V=C.slice(0,N);const v=C.slice(N+6).split(",").map(Number);v.length===4&&v.every(Number.isFinite)&&([b,h,E,B]=v)}n.push({start:c,end:p,url:rn(V,l),x:b,y:h,w:E,h:B})}return n.sort((r,u)=>r.start-u.start),n}function cn(t){return{cues:t,cueAt(l){if(t.length===0)return null;let n=0,o=t.length-1,r=t[0];for(;n<=o;){const u=n+o>>1,c=t[u];if(l<c.start)o=u-1;else if(l>c.end)r=c,n=u+1;else return c}return r}}}function Be(t){const l=t.trim().split(":");if(l.length<2||l.length>3)return NaN;const n=l.map(Number);return n.some(o=>!Number.isFinite(o))?NaN:n.length===3?n[0]*3600+n[1]*60+n[2]:n[0]*60+n[1]}function un(t){const l=[],n=t.replace(/\r/g,"").split(`
3
+ `);for(let o=0;o<n.length;o++){const r=n[o].indexOf("-->");if(r===-1)continue;const u=Be(n[o].slice(0,r)),c=Be(n[o].slice(r+3));if(!Number.isFinite(u)||!Number.isFinite(c))continue;const p=(n[o+1]??"").trim();p&&l.push({start:u,end:c,title:p})}return l.sort((o,r)=>o.start-r.start),l}function dn(t,l){const n=t.filter(o=>Number.isFinite(o.start)&&o.start>=0&&o.title).sort((o,r)=>o.start-r.start);return n.map((o,r)=>{var u;return{start:o.start,end:Number.isFinite(o.end)?o.end:((u=n[r+1])==null?void 0:u.start)??l,title:o.title}})}function vn(t,l){for(const n of t)if(l>=n.start&&l<n.end)return n;return null}const mn={class:"gvp-controls-seek"},pn={key:1,class:"gvp-seek-preview-chapter"},fn={class:"gvp-seek-preview-time"},kn=["value","disabled","aria-valuemax","aria-valuenow","aria-valuetext"],gn={class:"gvp-controls-row"},hn={class:"gvp-controls-left"},yn=["aria-label","aria-pressed"],En=["disabled"],Cn=["disabled"],wn=["aria-label","aria-pressed"],bn={key:0,class:"gvp-volume-slider-wrap"},Bn={class:"gvp-volume-track"},xn=["value","aria-valuenow","aria-valuetext"],Nn={key:2,class:"gvp-time","aria-live":"off"},Vn=["disabled","aria-label"],Ln={class:"gvp-controls-right"},$n=["aria-label","aria-pressed"],_n=["aria-label","aria-pressed"],Pn=3e3,Sn=10,Tn=e.defineComponent({__name:"ControlBar",props:{video:{},isPlaying:{type:Boolean},container:{},onTogglePlay:{},qualityLevels:{default:()=>[]},currentLevel:{default:-1},selectedLevel:{default:-1},thumbnails:{},chapters:{},hasPrev:{type:Boolean,default:!1},hasNext:{type:Boolean,default:!1},isLive:{type:Boolean,default:!1},audioTracks:{default:()=>[]},audioTrackIndex:{default:-1}},emits:["select-level","select-audio-track","prev","next"],setup(t,{emit:l}){const n=(()=>{if(typeof navigator>"u")return!1;const i=navigator.userAgent;return/iPad|iPhone|iPod/.test(i)||i.includes("Mac")&&navigator.maxTouchPoints>1})(),o=typeof navigator>"u"?!1:/iPhone|iPod/.test(navigator.userAgent),r=t,u=l,c=e.ref(!0);let p=null;function C(){p!==null&&(clearTimeout(p),p=null)}function N(){C(),r.isPlaying&&(p=setTimeout(()=>{c.value=!1},Pn))}function V(){c.value=!0,N()}e.watch(()=>r.isPlaying,i=>{i?N():(C(),c.value=!0)},{immediate:!0}),e.watch(()=>r.container,i=>{if(!i)return;const g=()=>V();i.addEventListener("mousemove",g),i.addEventListener("touchstart",g),i.addEventListener("focusin",g)},{immediate:!0});const b=e.ref(0),h=e.ref(0),E=e.ref(0),B=e.ref(!1),v=e.ref(!0),x=e.computed(()=>r.isLive||B.value);e.watch(()=>r.video,i=>{if(!i)return;const g=()=>{b.value=i.currentTime},w=()=>{h.value=Number.isFinite(i.duration)?i.duration:0},U=()=>{const T=i.buffered;if(!T||T.length===0){E.value=0;return}let ne=T.end(T.length-1);for(let G=0;G<T.length;G++)if(T.start(G)<=i.currentTime&&i.currentTime<=T.end(G)){ne=T.end(G);break}E.value=ne},te=()=>{if(B.value=!Number.isFinite(i.duration)&&i.duration>0,x.value&&i.seekable.length>0){const T=i.seekable.end(i.seekable.length-1);v.value=T-i.currentTime<=Sn}};g(),w(),U(),te(),i.addEventListener("timeupdate",g),i.addEventListener("durationchange",w),i.addEventListener("loadedmetadata",w),i.addEventListener("progress",U),i.addEventListener("timeupdate",U),i.addEventListener("durationchange",te),i.addEventListener("loadedmetadata",te),i.addEventListener("timeupdate",te)},{immediate:!0});function A(){const i=r.video;!i||i.seekable.length===0||(i.currentTime=i.seekable.end(i.seekable.length-1))}const M=()=>h.value>0,D=()=>M()?b.value/h.value*100:0,W=()=>M()?E.value/h.value*100:0;function y(i){const g=r.video;if(!g||!M())return;const w=Number(i.target.value)/100*h.value;g.currentTime=w,b.value=w}const z=e.ref(null),$=e.ref(null),P=e.ref(0),S=e.ref(0),L=e.ref(!1);e.watch(()=>r.thumbnails,i=>{if(z.value=null,!i)return;let g=!1;fetch(i).then(w=>w.ok?w.text():Promise.reject(new Error("fetch failed"))).then(w=>{if(g)return;const U=sn(w,new URL(i,location.href).href);z.value=U.length>0?cn(U):null}).catch(()=>{g||(z.value=null)}),e.onBeforeUnmount(()=>{g=!0})},{immediate:!0});function _(i){const g=$.value;if(!g||!M())return;const w=g.getBoundingClientRect(),U=Math.min(Math.max(i.clientX-w.left,0),w.width);S.value=U,P.value=U/w.width*h.value,L.value=!0}function J(){L.value=!1}const k=e.computed(()=>{var i;return L.value?((i=z.value)==null?void 0:i.cueAt(P.value))??null:null}),d=e.computed(()=>{const i=k.value;return i!==null&&i.w>0&&i.h>0}),O=e.computed(()=>{var U;const i=k.value,g=((U=$.value)==null?void 0:U.clientWidth)??0;if(!d.value||!i||g===0)return S.value;const w=i.w/2;return Math.min(Math.max(S.value,w),g-w)}),m=e.ref([]);e.watch(()=>r.chapters,i=>{if(m.value=[],typeof i!="string"||!i)return;let g=!1;fetch(i).then(w=>w.ok?w.text():Promise.reject(new Error("fetch failed"))).then(w=>{g||(m.value=un(w))}).catch(()=>{g||(m.value=[])}),e.onBeforeUnmount(()=>{g=!0})},{immediate:!0});const H=e.computed(()=>typeof r.chapters=="string"?m.value:Array.isArray(r.chapters)?dn(r.chapters,h.value):[]),F=e.computed(()=>L.value?vn(H.value,P.value):null),q=e.ref(1),R=e.ref(!1);e.watch(()=>r.video,i=>{if(!i)return;const g=()=>{q.value=i.volume,R.value=i.muted};g(),i.addEventListener("volumechange",g)},{immediate:!0});function ee(){r.video&&(r.video.muted=!r.video.muted)}function Q(i){const g=r.video;if(!g)return;const w=Number(i.target.value)/100;g.volume=w,w>0&&g.muted&&(g.muted=!1)}const X=e.ref(!1),fe=typeof document<"u"&&!!document.pictureInPictureEnabled;e.watch(()=>r.video,i=>{i&&(i.addEventListener("enterpictureinpicture",()=>{X.value=!0}),i.addEventListener("leavepictureinpicture",()=>{X.value=!1}))},{immediate:!0});function ke(){r.video&&(document.pictureInPictureElement?document.exitPictureInPicture().catch(()=>{}):r.video.requestPictureInPicture().catch(()=>{}))}const Y=e.ref(!1),ve=typeof document>"u"?!1:!!(document.fullscreenEnabled||document.webkitFullscreenEnabled);function re(){return document.fullscreenElement??document.webkitFullscreenElement??null}function se(i){const g=i.requestFullscreen??i.webkitRequestFullscreen;return g?g.call(i):Promise.reject(new Error("unsupported"))}function ie(){const i=document.exitFullscreen??document.webkitExitFullscreen;return i?i.call(document):Promise.reject(new Error("unsupported"))}function I(){Y.value=re()===r.container}e.onMounted(()=>{document.addEventListener("fullscreenchange",I),document.addEventListener("webkitfullscreenchange",I)}),e.onBeforeUnmount(()=>{C(),document.removeEventListener("fullscreenchange",I),document.removeEventListener("webkitfullscreenchange",I)});function ge(){var i,g;if(o){(g=(i=r.video)==null?void 0:i.webkitEnterFullscreen)==null||g.call(i);return}Y.value?ie().catch(()=>{}):r.container&&se(r.container).catch(()=>{})}const he=ve||o&&r.video!==null&&typeof r.video.webkitEnterFullscreen=="function";return(i,g)=>(e.openBlock(),e.createElementBlock("div",{role:"toolbar","aria-label":"Video controls",class:e.normalizeClass(["gvp-controls",!c.value&&"is-hidden"]),onMouseenter:C,onMouseleave:N},[e.createElementVNode("div",mn,[e.createElementVNode("div",{class:"gvp-seek",onPointermove:_,onPointerleave:J},[e.createElementVNode("div",{ref_key:"seekTrackEl",ref:$,class:"gvp-seek-track"},[e.createElementVNode("div",{class:"gvp-seek-buffered",style:e.normalizeStyle({width:`${W()}%`})},null,4),e.createElementVNode("div",{class:"gvp-seek-progress",style:e.normalizeStyle({width:`${D()}%`})},null,4),M()?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(H.value,w=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:`${w.start}-${w.title}`,class:"gvp-seek-chapter-tick",style:e.normalizeStyle({left:`${w.start/h.value*100}%`})},null,4)),[[e.vShow,w.start>0&&w.start<h.value]])),128)):e.createCommentVNode("",!0)],512),L.value&&M()?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["gvp-seek-preview",{"has-thumb":d.value}]),style:e.normalizeStyle({left:`${O.value}px`})},[d.value&&k.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"gvp-seek-preview-thumb",style:e.normalizeStyle({width:`${k.value.w}px`,height:`${k.value.h}px`,backgroundImage:`url(${JSON.stringify(k.value.url)})`,backgroundPosition:`-${k.value.x}px -${k.value.y}px`})},null,4)):e.createCommentVNode("",!0),F.value?(e.openBlock(),e.createElementBlock("span",pn,e.toDisplayString(F.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("span",fn,e.toDisplayString(e.unref(de)(P.value)),1)],6)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"range",class:"gvp-seek-input",min:0,max:100,step:.1,value:D(),disabled:!M(),"aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.floor(h.value),"aria-valuenow":Math.floor(b.value),"aria-valuetext":`${e.unref(de)(b.value)} of ${e.unref(de)(h.value)}`,onInput:y},null,40,kn)],32)]),e.createElementVNode("div",gn,[e.createElementVNode("div",hn,[e.createElementVNode("button",{type:"button",class:"gvp-ctrl-btn","aria-label":t.isPlaying?"Pause":"Play","aria-pressed":t.isPlaying,onClick:g[0]||(g[0]=(...w)=>t.onTogglePlay&&t.onTogglePlay(...w))},[t.isPlaying?(e.openBlock(),e.createBlock(ht,{key:0})):(e.openBlock(),e.createBlock(Et,{key:1}))],8,yn),t.hasPrev||t.hasNext?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"gvp-ctrl-btn","aria-label":"Previous video",disabled:!t.hasPrev,onClick:g[1]||(g[1]=w=>u("prev"))},[e.createVNode(wt)],8,En)):e.createCommentVNode("",!0),t.hasPrev||t.hasNext?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"gvp-ctrl-btn","aria-label":"Next video",disabled:!t.hasNext,onClick:g[2]||(g[2]=w=>u("next"))},[e.createVNode(Bt)],8,Cn)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["gvp-volume",!e.unref(n)&&"is-expandable"])},[e.createElementVNode("button",{type:"button",class:"gvp-ctrl-btn","aria-label":R.value?"Unmute":"Mute","aria-pressed":R.value,onClick:ee},[R.value||q.value===0?(e.openBlock(),e.createBlock(_t,{key:0})):q.value<.5?(e.openBlock(),e.createBlock(Lt,{key:1})):(e.openBlock(),e.createBlock(Nt,{key:2}))],8,wn),e.unref(n)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",bn,[e.createElementVNode("div",Bn,[e.createElementVNode("div",{class:"gvp-volume-fill",style:e.normalizeStyle({width:`${R.value?0:Math.round(q.value*100)}%`})},null,4)]),e.createElementVNode("input",{type:"range",class:"gvp-volume-input",min:0,max:100,step:1,value:R.value?0:Math.round(q.value*100),"aria-label":"Volume","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":R.value?0:Math.round(q.value*100),"aria-valuetext":`${R.value?0:Math.round(q.value*100)}%`,onInput:Q},null,40,xn)]))],2),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Nn,e.toDisplayString(e.unref(de)(b.value))+" / "+e.toDisplayString(e.unref(de)(h.value)),1)),x.value?(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",class:e.normalizeClass(["gvp-live",{"is-at-edge":v.value}]),disabled:v.value,"aria-label":v.value?"Live":"Go to live edge",onClick:A},[...g[5]||(g[5]=[e.createElementVNode("span",{class:"gvp-live-dot"},null,-1),e.createElementVNode("span",null,"LIVE",-1)])],10,Vn)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ln,[e.createVNode(an,{video:t.video,"quality-levels":t.qualityLevels,"current-level":t.currentLevel,"selected-level":t.selectedLevel,"audio-tracks":t.audioTracks,"audio-track-index":t.audioTrackIndex,onSelectLevel:g[3]||(g[3]=w=>u("select-level",w)),onSelectAudioTrack:g[4]||(g[4]=w=>u("select-audio-track",w))},null,8,["video","quality-levels","current-level","selected-level","audio-tracks","audio-track-index"]),e.unref(fe)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["gvp-ctrl-btn",X.value&&"is-active"]),"aria-label":X.value?"Exit picture-in-picture":"Picture-in-picture","aria-pressed":X.value,onClick:ke},[e.createVNode($e)],10,$n)):e.createCommentVNode("",!0),e.unref(he)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:e.normalizeClass(["gvp-ctrl-btn",Y.value&&"is-active"]),"aria-label":Y.value?"Exit fullscreen":"Enter fullscreen","aria-pressed":Y.value,onClick:ge},[Y.value?(e.openBlock(),e.createBlock(It,{key:0})):(e.openBlock(),e.createBlock(Tt,{key:1}))],10,_n)):e.createCommentVNode("",!0)])])],34))}}),Mn={name:"IconDesktop"},In=e.defineComponent({...Mn,props:{class:{}},setup(t){const l=t;return(n,o)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M14 2H10C6.72077 2 5.08116 2 3.91891 2.81382C3.48891 3.1149 3.1149 3.48891 2.81382 3.91891C2 5.08116 2 6.72077 2 10C2 13.2792 2 14.9188 2.81382 16.0811C3.1149 16.5111 3.48891 16.8851 3.91891 17.1862C5.08116 18 6.72077 18 10 18H14C17.2792 18 18.9188 18 20.0811 17.1862C20.5111 16.8851 20.8851 16.5111 21.1862 16.0811C22 14.9188 22 13.2792 22 10C22 6.72077 22 5.08116 21.1862 3.91891C20.8851 3.48891 20.5111 3.1149 20.0811 2.81382C18.9188 2 17.2792 2 14 2Z",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1),e.createElementVNode("path",{d:"M11 15H13",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M14.5 22L14.1845 21.5811C13.4733 20.6369 13.2969 19.1944 13.7468 18M9.5 22L9.8155 21.5811C10.5267 20.6369 10.7031 19.1944 10.2532 18",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1),e.createElementVNode("path",{d:"M7 22H17",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),An={name:"IconMobile"},zn=e.defineComponent({...An,props:{class:{}},setup(t){const l=t;return(n,o)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M5 9C5 5.70017 5 4.05025 6.02513 3.02513C7.05025 2 8.70017 2 12 2C15.2998 2 16.9497 2 17.9749 3.02513C19 4.05025 19 5.70017 19 9V15C19 18.2998 19 19.9497 17.9749 20.9749C16.9497 22 15.2998 22 12 22C8.70017 22 7.05025 22 6.02513 20.9749C5 19.9497 5 18.2998 5 15V9Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},null,-1),e.createElementVNode("path",{d:"M11 19H13",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M9 2L9.089 2.53402C9.28188 3.69129 9.37832 4.26993 9.77519 4.62204C10.1892 4.98934 10.7761 5 12 5C13.2239 5 13.8108 4.98934 14.2248 4.62204C14.6217 4.26993 14.7181 3.69129 14.911 2.53402L15 2",stroke:"currentColor","stroke-width":"2","stroke-linejoin":"round"},null,-1)])],2))}}),Dn={name:"IconPlay"},Hn=e.defineComponent({...Dn,props:{class:{}},setup(t){const l=t;return(n,o)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"22",height:"22",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M5.3335 11.45V4.54997C5.3335 4.36108 5.40016 4.20275 5.5335 4.07497C5.66683 3.94719 5.82238 3.8833 6.00016 3.8833C6.05572 3.8833 6.11405 3.89163 6.17516 3.9083C6.23627 3.92497 6.29461 3.94997 6.35016 3.9833L11.7835 7.4333C11.8835 7.49997 11.9585 7.5833 12.0085 7.6833C12.0585 7.7833 12.0835 7.88886 12.0835 7.99997C12.0835 8.11108 12.0585 8.21663 12.0085 8.31663C11.9585 8.41663 11.8835 8.49997 11.7835 8.56663L6.35016 12.0166C6.29461 12.05 6.23627 12.075 6.17516 12.0916C6.11405 12.1083 6.05572 12.1166 6.00016 12.1166C5.82238 12.1166 5.66683 12.0527 5.5335 11.925C5.40016 11.7972 5.3335 11.6389 5.3335 11.45Z",fill:"currentColor"},null,-1)])],2))}}),Fn={name:"IconX"},xe=e.defineComponent({...Fn,props:{class:{}},setup(t){const l=t;return(n,o)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M6.94994 5.53594L12.1929 0.292938C12.5834 -0.0975275 13.2165 -0.0975279 13.6069 0.292938C13.9974 0.683403 13.9974 1.31647 13.6069 1.70694L8.36394 6.94994L13.6069 12.1929C13.9974 12.5834 13.9974 13.2165 13.6069 13.6069C13.2165 13.9974 12.5834 13.9974 12.1929 13.6069L6.94994 8.36394L1.70694 13.6069C1.31647 13.9974 0.683403 13.9974 0.292938 13.6069C-0.0975279 13.2165 -0.0975277 12.5834 0.292938 12.1929L5.53594 6.94994L0.292938 1.70694C-0.0975279 1.31647 -0.0975279 0.683403 0.292938 0.292938C0.683403 -0.0975279 1.31647 -0.0975277 1.70694 0.292938L6.94994 5.53594Z",fill:"currentColor"},null,-1)])],2))}}),Rn={name:"IconAlert"},qn=e.defineComponent({...Rn,props:{class:{}},setup(t){const l=t;return(n,o)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M12 9V13M12 17H12.01M10.29 3.86L1.82 18A2 2 0 0 0 3.53 21H20.47A2 2 0 0 0 22.18 18L13.71 3.86A2 2 0 0 0 10.29 3.86Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),On={name:"IconRefresh"},Un=e.defineComponent({...On,props:{class:{}},setup(t){const l=t;return(n,o)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",l.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M21 12A9 9 0 1 1 18.36 5.64M21 3V9H15",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}});function _e(t){if(!t)return null;if(/^[A-Za-z0-9_-]{11}$/.test(t))return t;let l;try{l=new URL(t)}catch{return null}const n=l.hostname.replace(/^www\./,"");if(n==="youtu.be"){const o=l.pathname.slice(1).split("/")[0];return/^[A-Za-z0-9_-]{11}$/.test(o)?o:null}if(n==="youtube.com"||n==="m.youtube.com"||n==="music.youtube.com"||n==="youtube-nocookie.com"){const o=l.searchParams.get("v");if(o&&/^[A-Za-z0-9_-]{11}$/.test(o))return o;const r=/^\/(?:embed|shorts|v|live)\/([A-Za-z0-9_-]{11})/.exec(l.pathname);if(r)return r[1]}return null}function Pe(t){try{const l=new URL(t),n=l.searchParams.get("t")??l.searchParams.get("start");if(!n)return null;if(/^\d+s?$/.test(n))return Number.parseInt(n,10);const o=/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/.exec(n);if(o){const r=Number.parseInt(o[1]??"0",10),u=Number.parseInt(o[2]??"0",10),c=Number.parseInt(o[3]??"0",10),p=r*3600+u*60+c;return p>0?p:null}}catch{}return null}function Se(t,l={}){const{autoPlay:n=!1,muted:o=!0,loop:r=!1,controls:u=!0,startSeconds:c}=l,p=new URLSearchParams({rel:"0",modestbranding:"1",playsinline:"1",controls:u?"1":"0"});return n?(p.set("autoplay","1"),p.set("mute","1")):o&&p.set("mute","1"),r&&(p.set("loop","1"),p.set("playlist",t)),c&&c>0&&p.set("start",String(c)),`https://www.youtube-nocookie.com/embed/${t}?${p.toString()}`}const jn="gvp:prefs:";function Te(t){return jn+t}function pe(t){if(typeof localStorage>"u")return{};try{const l=localStorage.getItem(Te(t));if(!l)return{};const n=JSON.parse(l);return typeof n=="object"&&n!==null?n:{}}catch{return{}}}function Me(t,l){if(!(typeof localStorage>"u"))try{const o={...pe(t),...l};localStorage.setItem(Te(t),JSON.stringify(o))}catch{}}function Ne(t,l,n){if(typeof localStorage>"u"||!l)return;const r={...pe(t).positions};n>0?r[l]=n:delete r[l],Me(t,{positions:r})}function Zn(t,l){var r;const o=(r=pe(t).positions)==null?void 0:r[l];return typeof o=="number"&&o>0?o:0}function Wn(t){const l=t.trim().replace(/^#/,"");if(/^[0-9a-f]{3}$/i.test(l))return[parseInt(l[0]+l[0],16),parseInt(l[1]+l[1],16),parseInt(l[2]+l[2],16)];if(/^[0-9a-f]{6}$/i.test(l))return[parseInt(l.slice(0,2),16),parseInt(l.slice(2,4),16),parseInt(l.slice(4,6),16)];const n=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(t);return n?[Number(n[1]),Number(n[2]),Number(n[3])]:null}function Kn(t,l){const n=Wn(t);return n?`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${l})`:t}function Qn(t,l){if(!l)return"";const n=[];if(l.fontSize&&n.push(`font-size: ${l.fontSize};`),l.textColor&&n.push(`color: ${l.textColor};`),l.backgroundColor){const o=typeof l.backgroundOpacity=="number"?Kn(l.backgroundColor,l.backgroundOpacity):l.backgroundColor;n.push(`background-color: ${o};`)}else typeof l.backgroundOpacity=="number"&&n.push(`background-color: rgba(0, 0, 0, ${l.backgroundOpacity});`);return n.length===0?"":`.${t}::cue { ${n.join(" ")} }`}function Yn(t){const l=t.trim().replace(/^#/,"");if(/^[0-9a-f]{3}$/i.test(l)){const o=parseInt(l[0]+l[0],16),r=parseInt(l[1]+l[1],16),u=parseInt(l[2]+l[2],16);return`${o} ${r} ${u}`}if(/^[0-9a-f]{6}$/i.test(l)){const o=parseInt(l.slice(0,2),16),r=parseInt(l.slice(2,4),16),u=parseInt(l.slice(4,6),16);return`${o} ${r} ${u}`}const n=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(t);return n?`${n[1]} ${n[2]} ${n[3]}`:null}function Gn(t){if(!t)return{};const l={};if(t.accent){const n=Yn(t.accent);n?l["--gvp-accent-rgb"]=n:l["--gvp-accent"]=t.accent}return t.radius&&(l["--gvp-radius"]=t.radius),l}const Jn=["src"],Xn={key:3,class:"gvp-vignette"},eo={key:4,class:"gvp-sr-only",role:"status","aria-live":"polite"},to={key:5,class:"gvp-loading",role:"status","aria-live":"polite"},no={key:6,class:"gvp-error",role:"alert"},oo={key:7,class:"gvp-toggle"},lo={class:"gvp-toggle-pill"},ao=["aria-pressed"],ro=["aria-pressed"],so=["aria-label","aria-pressed"],io=["aria-label"],co={key:14,class:"gvp-play-wrap"},uo={key:0,class:"gvp-tooltip",role:"tooltip"},vo={key:16,class:"gvp-bottom-fade"},mo=e.defineComponent({__name:"VideoPlayer",props:{src:{},poster:{},playlist:{},defaultIndex:{default:0},autoAdvance:{type:Boolean,default:!0},showDeviceToggle:{type:Boolean,default:!0},defaultDevice:{default:"desktop"},hoverPlay:{type:Boolean,default:!1},tooltipText:{},muted:{type:Boolean,default:!0},loop:{type:Boolean,default:!1},controls:{type:[Boolean,String],default:!0},autoPlay:{type:Boolean,default:!1},frameMaxWidth:{},aspectRatio:{},hlsConfig:{},isHls:{type:Boolean},thumbnails:{},chapters:{},persistKey:{},captionStyle:{},theme:{},miniPlayer:{type:Boolean,default:!1},miniPlayerPosition:{default:"bottom-right"},ambientMode:{type:Boolean,default:!1},class:{default:""},closable:{type:Boolean,default:!1}},emits:["close","play","pause","ended","time-update","seeked","volume-change","milestone","error","playlist-change"],setup(t,{emit:l}){const n=t,o=l,r=e.ref(null),u=e.ref(n.defaultDevice),c=e.ref(!1),p=e.ref(!1),C=e.ref(!1),N=e.ref(!1),V=e.ref(!1),b=e.ref(0),h=e.ref(null),E=e.ref([]),B=e.ref(-1),v=e.ref([]),x=e.ref(-1),A=e.ref(-1),M=e.ref(1),D=e.ref(!1),W=e.ref(!1),y=e.ref(null),z=typeof document<"u"&&!!document.pictureInPictureEnabled,$=e.computed(()=>n.controls===!0||n.controls==="custom"),P=e.computed(()=>n.controls==="native"),S=`gvp-video-${Math.random().toString(36).slice(2,10)}`,L=e.computed(()=>Gn(n.theme)),_=e.ref(!1),J=e.ref(!1),k=e.ref(null);let d=null;e.watch(k,a=>{d==null||d.disconnect(),d=null,!(!n.miniPlayer||!a||typeof IntersectionObserver>"u")&&(d=new IntersectionObserver(([s])=>{s.isIntersecting?(_.value=!1,J.value=!1):c.value&&!J.value&&(_.value=!0)},{threshold:0}),d.observe(a))}),e.watch(c,a=>{a||(_.value=!1)});function O(){_.value=!1,J.value=!0}const m=e.ref(null);let H=0;e.onBeforeUnmount(()=>{d==null||d.disconnect(),d=null,cancelAnimationFrame(H)});let F=null;e.watch(()=>n.captionStyle,a=>{if(typeof document>"u")return;const s=Qn(S,a);if(!s){F==null||F.remove(),F=null;return}F||(F=document.createElement("style"),document.head.appendChild(F)),F.textContent=s},{immediate:!0,deep:!0}),e.onBeforeUnmount(()=>{F==null||F.remove(),F=null});const q=e.computed(()=>Array.isArray(n.playlist)&&n.playlist.length>0),R=e.ref(q.value?Math.min(Math.max(n.defaultIndex,0),n.playlist.length-1):0),ee=e.computed(()=>q.value?n.playlist[Math.min(R.value,n.playlist.length-1)]:null),Q=e.computed(()=>{var a;return((a=ee.value)==null?void 0:a.src)??n.src??""}),X=e.computed(()=>{var a;return((a=ee.value)==null?void 0:a.poster)??n.poster}),fe=e.computed(()=>{var a;return((a=ee.value)==null?void 0:a.thumbnails)??n.thumbnails}),ke=e.computed(()=>{var a;return((a=ee.value)==null?void 0:a.chapters)??n.chapters}),Y=e.computed(()=>q.value&&R.value>0),ve=e.computed(()=>q.value&&R.value<n.playlist.length-1);let re=!1;function se(a,s=!1){if(!q.value)return;const f=Math.min(Math.max(a,0),n.playlist.length-1);f!==R.value&&(re=s,R.value=f,o("playlist-change",f,n.playlist[f]))}const ie=e.computed(()=>_e(Q.value)),I=e.computed(()=>ie.value!==null),ge=e.computed(()=>ie.value?Se(ie.value,{autoPlay:n.autoPlay,muted:n.muted,loop:n.loop,controls:$.value?!0:P.value,startSeconds:Pe(Q.value)}):null);function he(a){E.value=a,B.value=-1}function i(a){v.value=a,A.value=-1}const g=e.computed(()=>!I.value&&E.value.length>1),w=e.computed(()=>{var a;return B.value>=0?B.value:((a=E.value[0])==null?void 0:a.index)??-1}),U=e.computed(()=>{var a,s;return u.value==="mobile"?((a=n.aspectRatio)==null?void 0:a.mobile)??"9/16":((s=n.aspectRatio)==null?void 0:s.desktop)??"16/9"}),te=e.computed(()=>{var a,s;return u.value==="mobile"?((a=n.frameMaxWidth)==null?void 0:a.mobile)??"420px":((s=n.frameMaxWidth)==null?void 0:s.desktop)??"960px"}),T=e.computed(()=>{var a;return((a=r.value)==null?void 0:a.videoEl)??null});e.watch([m,T],([a,s])=>{if(cancelAnimationFrame(H),!n.ambientMode||!a||!s||I.value)return;const f=a.getContext("2d");if(!f)return;let j=0;const K=ce=>{if(H=requestAnimationFrame(K),!(ce-j<250)&&(j=ce,!(s.readyState<2||s.paused)))try{f.drawImage(s,0,0,a.width,a.height)}catch{}};H=requestAnimationFrame(K)});async function ne(){const a=T.value;if(a)try{a.readyState<2&&a.load();const s=a.play();h.value=s,await s,c.value=!0}catch{c.value=!1}finally{h.value=null}}async function G(){const a=T.value;if(a){if(h.value)try{await h.value}catch{}a.pause()}}async function Ie(){!n.hoverPlay||I.value||await ne()}async function Ae(){!n.hoverPlay||I.value||(await G(),c.value=!1)}async function me(){const a=T.value;a&&(a.paused?await ne():(await G(),c.value=!1))}function ye(){const a=y.value;if(!a)return;if((document.fullscreenElement??document.webkitFullscreenElement??null)===a){const f=document.exitFullscreen??document.webkitExitFullscreen;f==null||f.call(document).catch(()=>{})}else{const f=a.requestFullscreen??a.webkitRequestFullscreen;f==null||f.call(a).catch(()=>{})}}let oe=null;function ze(){oe===null&&(oe=setTimeout(()=>{oe=null,me()},250))}function De(){oe!==null&&(clearTimeout(oe),oe=null),ye()}function He(){c.value=!1,o("ended"),q.value&&n.autoAdvance&&ve.value&&se(R.value+1,!0)}e.watch(Q,()=>{re&&(re=!1,ne())});function Fe(){p.value=!0,Ie()}function Re(){p.value=!1,Ae()}function qe(a){M.value=a;const s=T.value;s&&(s.playbackRate=a)}e.watch(T,a=>{if(!a)return;a.addEventListener("ratechange",()=>{M.value=a.playbackRate}),a.addEventListener("enterpictureinpicture",()=>{D.value=!0}),a.addEventListener("leavepictureinpicture",()=>{D.value=!1});const s=new Set;a.addEventListener("timeupdate",()=>{const f=a.duration;if(o("time-update",a.currentTime,Number.isFinite(f)?f:0),!Number.isFinite(f)||f<=0)return;const j=a.currentTime/f*100;for(const K of[25,50,75,100])j>=K&&!s.has(K)&&(s.add(K),o("milestone",K))}),a.addEventListener("seeked",()=>{o("seeked",a.currentTime)}),a.addEventListener("volumechange",()=>{o("volume-change",a.volume,a.muted)}),a.addEventListener("error",()=>{N.value=!0,C.value=!1,o("error")}),a.addEventListener("waiting",()=>{C.value=!0}),a.addEventListener("stalled",()=>{C.value=!0}),a.addEventListener("playing",()=>{C.value=!1}),a.addEventListener("canplay",()=>{C.value=!1}),a.addEventListener("seeked",()=>{C.value=!1})}),e.watch(Q,()=>{N.value=!1,C.value=!1});function Oe(){N.value=!0,C.value=!1,o("error")}const Ue=e.computed(()=>N.value?"Video failed to load":C.value?"Loading":c.value?"Playing":"Paused");function je(){N.value=!1,C.value=!1,b.value+=1}e.watch(T,a=>{if(!a||!n.persistKey)return;const s=n.persistKey,f=pe(s);typeof f.volume=="number"&&(a.volume=f.volume),typeof f.muted=="boolean"&&(a.muted=f.muted),typeof f.speed=="number"&&(a.playbackRate=f.speed);const j=()=>{Me(s,{volume:a.volume,muted:a.muted,speed:a.playbackRate})};a.addEventListener("volumechange",j),a.addEventListener("ratechange",j)}),e.watch([T,Q],([a,s])=>{if(!a||!n.persistKey||!s)return;const f=n.persistKey,j=()=>{const le=Zn(f,s);le>0&&(!Number.isFinite(a.duration)||le<a.duration-1)&&(a.currentTime=le)};a.readyState>=1?j():a.addEventListener("loadedmetadata",j,{once:!0});let K=0;const ce=()=>{const le=Date.now();le-K<1e3||(K=le,Ne(f,s,a.currentTime))};a.addEventListener("timeupdate",ce),a.addEventListener("pause",ce),a.addEventListener("ended",()=>Ne(f,s,0))},{immediate:!0});function Ee(){const a=T.value;a&&(document.pictureInPictureElement?document.exitPictureInPicture().catch(()=>{}):a.requestPictureInPicture().catch(()=>{}))}function Ce(a){var j;const s=T.value;if(!(!s||!W.value&&!((j=y.value)!=null&&j.contains(document.activeElement))||a.target.tagName==="INPUT"&&a.key!==" "))switch(a.key){case" ":case"k":a.preventDefault(),me();break;case"ArrowLeft":a.preventDefault(),s.currentTime=Math.max(0,s.currentTime-5);break;case"ArrowRight":a.preventDefault(),s.currentTime=Math.min(s.duration||0,s.currentTime+5);break;case"ArrowUp":a.preventDefault(),s.volume=Math.min(1,s.volume+.1),s.muted&&(s.muted=!1);break;case"ArrowDown":a.preventDefault(),s.volume=Math.max(0,s.volume-.1);break;case"m":s.muted=!s.muted;break;case"f":ye();break;case"p":z&&Ee();break}}return e.onMounted(()=>{document.addEventListener("keydown",Ce)}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",Ce)}),(a,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["gvp-ambient-wrap",{"is-ambient":t.ambientMode}]),style:e.normalizeStyle({width:te.value})},[t.miniPlayer?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"miniSentinelEl",ref:k,class:"gvp-mini-sentinel","aria-hidden":"true"},null,512)):e.createCommentVNode("",!0),t.ambientMode&&!I.value&&!_.value?(e.openBlock(),e.createElementBlock("canvas",{key:1,ref_key:"ambientCanvasEl",ref:m,class:"gvp-ambient-canvas",width:"32",height:"18"},null,512)):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"gvp-mini-placeholder",style:e.normalizeStyle({width:"100%",aspectRatio:U.value}),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"rootEl",ref:y,class:e.normalizeClass(["gvp-root",n.class,{"gvp-mini":_.value},_.value?`gvp-mini-${t.miniPlayerPosition}`:""]),style:e.normalizeStyle({width:"100%",aspectRatio:U.value,...L.value}),onMouseenter:s[14]||(s[14]=f=>{W.value=!0,Fe()}),onMouseleave:s[15]||(s[15]=f=>{W.value=!1,Re()})},[_.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"gvp-mini-close","aria-label":"Close mini player",onClick:O},[e.createVNode(xe)])):e.createCommentVNode("",!0),I.value?(e.openBlock(),e.createElementBlock("iframe",{key:1,class:"gvp-video gvp-youtube",src:ge.value??void 0,title:"YouTube video player",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowfullscreen:"",referrerpolicy:"strict-origin-when-cross-origin"},null,8,Jn)):(e.openBlock(),e.createBlock(Ve,{ref_key:"hlsPlayerRef",ref:r,key:`${Q.value}#${b.value}`,controls:P.value,"hls-config":t.hlsConfig,"is-hls":t.isHls,loop:t.loop,muted:t.muted,"auto-play":t.autoPlay,"audio-track-index":B.value,"quality-level-index":A.value,"plays-inline":!0,poster:X.value,src:Q.value,class:e.normalizeClass(["gvp-video",S]),preload:"metadata",onAudioTracks:he,onQualityLevels:i,onCurrentLevel:s[0]||(s[0]=f=>x.value=f),onEnded:He,onFatalError:Oe,onLiveChange:s[1]||(s[1]=f=>V.value=f),onPause:s[2]||(s[2]=f=>{c.value=!1,o("pause")}),onPlay:s[3]||(s[3]=f=>{c.value=!0,o("play")})},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},8,["controls","hls-config","is-hls","loop","muted","auto-play","audio-track-index","quality-level-index","poster","src","class"])),I.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Xn)),I.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",eo,e.toDisplayString(Ue.value),1)),!I.value&&C.value&&!N.value?(e.openBlock(),e.createElementBlock("div",to,[...s[16]||(s[16]=[e.createElementVNode("div",{class:"gvp-spinner"},null,-1),e.createElementVNode("span",{class:"gvp-sr-only"},"Loading…",-1)])])):e.createCommentVNode("",!0),!I.value&&N.value?(e.openBlock(),e.createElementBlock("div",no,[e.createVNode(qn,{class:"gvp-error-icon"}),s[18]||(s[18]=e.createElementVNode("p",{class:"gvp-error-text"},"This video couldn't be played.",-1)),e.createElementVNode("button",{type:"button",class:"gvp-error-retry",onClick:je},[e.createVNode(Un),s[17]||(s[17]=e.createElementVNode("span",null,"Retry",-1))])])):e.createCommentVNode("",!0),t.showDeviceToggle?(e.openBlock(),e.createElementBlock("div",oo,[e.createElementVNode("div",lo,[e.createElementVNode("button",{"aria-pressed":u.value==="desktop",class:e.normalizeClass(["gvp-toggle-btn",{"is-active":u.value==="desktop"}]),"aria-label":"Desktop view",type:"button",onClick:s[4]||(s[4]=f=>u.value="desktop")},[e.createVNode(In)],10,ao),s[19]||(s[19]=e.createElementVNode("div",{class:"gvp-toggle-divider"},null,-1)),e.createElementVNode("button",{"aria-pressed":u.value==="mobile",class:e.normalizeClass(["gvp-toggle-btn",{"is-active":u.value==="mobile"}]),"aria-label":"Mobile view",type:"button",onClick:s[5]||(s[5]=f=>u.value="mobile")},[e.createVNode(zn)],10,ro)])])):e.createCommentVNode("",!0),t.closable?(e.openBlock(),e.createElementBlock("button",{key:8,"aria-label":"Close",class:"gvp-close",type:"button",onClick:s[6]||(s[6]=f=>o("close"))},[e.createVNode(xe)])):e.createCommentVNode("",!0),g.value&&!$.value?(e.openBlock(),e.createBlock(nt,{key:9,tracks:E.value,"active-index":w.value,onSelect:s[7]||(s[7]=f=>B.value=f)},null,8,["tracks","active-index"])):e.createCommentVNode("",!0),!I.value&&!$.value?(e.openBlock(),e.createBlock(ct,{key:10,speed:M.value,onSelect:qe},null,8,["speed"])):e.createCommentVNode("",!0),!I.value&&!$.value?(e.openBlock(),e.createBlock(kt,{key:11,video:T.value},null,8,["video"])):e.createCommentVNode("",!0),!I.value&&e.unref(z)&&!$.value?(e.openBlock(),e.createElementBlock("button",{key:12,type:"button",class:e.normalizeClass(["gvp-pip-btn",{"is-active":D.value}]),"aria-label":D.value?"Exit picture-in-picture":"Picture-in-picture","aria-pressed":D.value,onClick:Ee},[e.createVNode($e)],10,so)):e.createCommentVNode("",!0),!I.value&&$.value?(e.openBlock(),e.createElementBlock("button",{key:13,type:"button",class:"gvp-click-layer","aria-label":c.value?"Pause":"Play",onClick:ze,onDblclick:De},null,40,io)):e.createCommentVNode("",!0),!I.value&&!$.value&&!c.value?(e.openBlock(),e.createElementBlock("div",co,[e.createElementVNode("button",{"aria-label":"Play",class:"gvp-play",type:"button",onClick:me,onMouseenter:s[8]||(s[8]=f=>p.value=!0),onMouseleave:s[9]||(s[9]=f=>p.value=!1)},[e.createVNode(Hn),t.tooltipText&&p.value?(e.openBlock(),e.createElementBlock("span",uo,e.toDisplayString(t.tooltipText),1)):e.createCommentVNode("",!0)],32)])):e.createCommentVNode("",!0),!I.value&&$.value?(e.openBlock(),e.createBlock(Tn,{key:15,video:T.value,"is-playing":c.value,container:y.value,"on-toggle-play":me,"quality-levels":v.value,"current-level":x.value,"selected-level":A.value,thumbnails:fe.value,chapters:ke.value,"has-prev":Y.value,"has-next":ve.value,"is-live":V.value,"audio-tracks":E.value,"audio-track-index":w.value,onSelectLevel:s[10]||(s[10]=f=>A.value=f),onSelectAudioTrack:s[11]||(s[11]=f=>B.value=f),onPrev:s[12]||(s[12]=f=>se(R.value-1,!0)),onNext:s[13]||(s[13]=f=>se(R.value+1,!0))},null,8,["video","is-playing","container","quality-levels","current-level","selected-level","thumbnails","chapters","has-prev","has-next","is-live","audio-tracks","audio-track-index"])):e.createCommentVNode("",!0),!I.value&&!$.value?(e.openBlock(),e.createElementBlock("div",vo)):e.createCommentVNode("",!0)],38)],6))}});exports.HLSPlayer=Ve;exports.VueVideoPlayer=mo;exports.parseYouTubeId=_e;exports.parseYouTubeStart=Pe;exports.youTubeEmbedUrl=Se;
2
4
  //# sourceMappingURL=index.cjs.map