PageSourceSearch

https://appcms.monumentalsportsnetwork.com/build/7595/278.0f6a011906d24a34e6f0.js

js monumentalsportsnetwork.com collected 2026-09-24 18:30:33 UTC 564,802 bytes, 212 lines download raw bytes

1"use strict";(()=>{(self.webpackChunkweb_v2=self.webpackChunkweb_v2||[]).push([[278],{10278(y_,T_,le){var Ud=le(89840),S=le.n(Ud),Bd=le(49697),U=le.n(Bd),Fd=le(21036),Ta=le.n(Fd),Nd=le(72403),va=le.n(Nd),Ce=le(58168),jd=le(27098),$d=le(18320),se=le(60279),ba=le(94866),ls=le(47222),Pt=le(59451),Hd=le(98962),Vd=le.n(Hd),qd=le(21320),hs=le(72580),At=le(79622);/**
2 * @license
3 * Video.js 8.24.1 <http://videojs.com/>
4 * Copyright 2010-present Video.js contributors
5 * Available under Apache License Version 2.0
6 * <https://github.com/videojs/video.js/blob/main/LICENSE>
7 *
8 * Includes vtt.js <https://github.com/mozilla/vtt.js>
9 * Available under Apache License Version 2.0
10 * <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
11 */var In="8.24.1";const ot={},mt=function(s,e){return ot[s]=ot[s]||[],e&&(ot[s]=ot[s].concat(e)),ot[s]},zd=function(s,e){mt(s,e)},Sa=function(s,e){const t=mt(s).indexOf(e);return t<=-1?!1:(ot[s]=ot[s].slice(),ot[s].splice(t,1),!0)},Wd=function(s,e){mt(s,[].concat(e).map(t=>{const i=(...n)=>(Sa(s,i),t(...n));return i}))},ds={prefixed:!0},us=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],xa=us[0];let Ci;for(let s=0;s<us.length;s++)if(us[s][1]in U()){Ci=us[s];break}if(Ci){for(let s=0;s<Ci.length;s++)ds[xa[s]]=Ci[s];ds.prefixed=Ci[0]!==xa[0]}let Ie=[];const Gd=(s,e,t)=>(i,n,a)=>{const o=e.levels[n],u=new RegExp(`^(${o})$`);let f=s;if(i!=="log"&&a.unshift(i.toUpperCase()+":"),t&&(f=`%c${s}`,a.unshift(t)),a.unshift(f+":"),Ie){Ie.push([].concat(a));const g=Ie.length-1e3;Ie.splice(0,g>0?g:0)}if(!S().console)return;let m=S().console[i];!m&&i==="debug"&&(m=S().console.info||S().console.log),!(!m||!o||!u.test(i))&&m[Array.isArray(a)?"apply":"call"](S().console,a)};function Pn(s,e=":",t=""){let i="info",n;function a(...o){n("log",i,o)}return n=Gd(s,a,t),a.createLogger=(o,u,f)=>{const m=u!==void 0?u:e,g=f!==void 0?f:t,b=`${s} ${m} ${o}`;return Pn(b,m,g)},a.createNewLogger=(o,u,f)=>Pn(o,u,f),a.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:i},a.level=o=>{if(typeof o=="string"){if(!a.levels.hasOwnProperty(o))throw new Error(`"${o}" in not a valid log level`);i=o}return i},a.history=()=>Ie?[].concat(Ie):[],a.history.filter=o=>(Ie||[]).filter(u=>new RegExp(`.*${o}.*`).test(u[0])),a.history.clear=()=>{Ie&&(Ie.length=0)},a.history.disable=()=>{Ie!==null&&(Ie.length=0,Ie=null)},a.history.enable=()=>{Ie===null&&(Ie=[])},a.error=(...o)=>n("error",i,o),a.warn=(...o)=>n("warn",i,o),a.debug=(...o)=>n("debug",i,o),a}const Q=Pn("VIDEOJS"),Ca=Q.createLogger,Kd=Object.prototype.toString,Ea=function(s){return Xe(s)?Object.keys(s):[]};function Qt(s,e){Ea(s).forEach(t=>e(s[t],t))}function ka(s,e,t=0){return Ea(s).reduce((i,n)=>e(i,s[n],n),t)}function Xe(s){return!!s&&typeof s=="object"}function Yt(s){return Xe(s)&&Kd.call(s)==="[object Object]"&&s.constructor===Object}function ie(...s){const e={};return s.forEach(t=>{t&&Qt(t,(i,n)=>{if(!Yt(i)){e[n]=i;return}Yt(e[n])||(e[n]={}),e[n]=ie(e[n],i)})}),e}function wa(s={}){const e=[];for(const t in s)if(s.hasOwnProperty(t)){const i=s[t];e.push(i)}return e}function cs(s,e,t,i=!0){const n=o=>Object.defineProperty(s,e,{value:o,enumerable:!0,writable:!0}),a={configurable:!0,enumerable:!0,get(){const o=t();return n(o),o}};return i&&(a.set=n),Object.defineProperty(s,e,a)}var Qd=Object.freeze({__proto__:null,each:Qt,reduce:ka,isObject:Xe,isPlain:Yt,merge:ie,values:wa,defineLazyProperty:cs});let An=!1,Ia=null,ze=!1,Pa,Aa=!1,gt=!1,Xt=!1,Je=!1,Ln=null,fs=null;const Yd=!!(S().cast&&S().cast.framework&&S().cast.framework.CastReceiverContext);let La=null,ps=!1,ms=!1,gs=!1,_s=!1,ys=!1,Ts=!1,vs=!1;const Ei=!!(Jt()&&("ontouchstart"in S()||S().navigator.maxTouchPoints||S().DocumentTouch&&S().document instanceof S().DocumentTouch)),_t=S().navigator&&S().navigator.userAgentData;if(_t&&_t.platform&&_t.brands&&(ze=_t.platform==="Android",gt=!!_t.brands.find(s=>s.brand==="Microsoft Edge"),Xt=!!_t.brands.find(s=>s.brand==="Chromium"),Je=!gt&&Xt,Ln=fs=(_t.brands.find(s=>s.brand==="Chromium")||{}).version||null,ms=_t.platform==="Windows"),!Xt){const s=S().navigator&&S().navigator.userAgent||"";An=/iPod/i.test(s),Ia=(function(){const e=s.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null})(),ze=/Android/i.test(s),Pa=(function(){const e=s.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null}
11)(),Aa=/Firefox/i.test(s),gt=/Edg/i.test(s),Xt=/Chrome/i.test(s)||/CriOS/i.test(s),Je=!gt&&Xt,Ln=fs=(function(){const e=s.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null})(),La=(function(){const e=/MSIE\s(\d+)\.\d/.exec(s);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(s)&&/rv:11.0/.test(s)&&(t=11),t})(),ys=/Tizen/i.test(s),Ts=/Web0S/i.test(s),vs=ys||Ts,ps=/Safari/i.test(s)&&!Je&&!ze&&!gt&&!vs,ms=/Windows/i.test(s),gs=/iPad/i.test(s)||ps&&Ei&&!/iPhone/i.test(s),_s=/iPhone/i.test(s)&&!gs}const ve=_s||gs||An,bs=(ps||ve)&&!Je;var Da=Object.freeze({__proto__:null,get IS_IPOD(){return An},get IOS_VERSION(){return Ia},get IS_ANDROID(){return ze},get ANDROID_VERSION(){return Pa},get IS_FIREFOX(){return Aa},get IS_EDGE(){return gt},get IS_CHROMIUM(){return Xt},get IS_CHROME(){return Je},get CHROMIUM_VERSION(){return Ln},get CHROME_VERSION(){return fs},IS_CHROMECAST_RECEIVER:Yd,get IE_VERSION(){return La},get IS_SAFARI(){return ps},get IS_WINDOWS(){return ms},get IS_IPAD(){return gs},get IS_IPHONE(){return _s},get IS_TIZEN(){return ys},get IS_WEBOS(){return Ts},get IS_SMART_TV(){return vs},TOUCH_ENABLED:Ei,IS_IOS:ve,IS_ANY_SAFARI:bs});function Oa(s){return typeof s=="string"&&!!s.trim()}function Xd(s){if(s.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function Jt(){return U()===S().document}function Zt(s){return Xe(s)&&s.nodeType===1}function Ma(){try{return S().parent!==S().self}catch(s){return!0}}function Ra(s){return function(e,t){if(!Oa(e))return U()[s](null);Oa(t)&&(t=U().querySelector(t));const i=Zt(t)?t:U();return i[s]&&i[s](e)}}function W(s="div",e={},t={},i){const n=U().createElement(s);return Object.getOwnPropertyNames(e).forEach(function(a){const o=e[a];a==="textContent"?yt(n,o):(n[a]!==o||a==="tabIndex")&&(n[a]=o)}),Object.getOwnPropertyNames(t).forEach(function(a){n.setAttribute(a,t[a])}),i&&On(n,i),n}function yt(s,e){return typeof s.textContent=="undefined"?s.innerText=e:s.textContent=e,s}function Dn(s,e){e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}function ki(s,e){return Xd(e),s.classList.contains(e)}function Lt(s,...e){return s.classList.add(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),s}function Ss(s,...e){return s?(s.classList.remove(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),s):(Q.warn("removeClass was called with an element that doesn't exist"),null)}function Ua(s,e,t){return typeof t=="function"&&(t=t(s,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEach(i=>s.classList.toggle(i,t)),s}function Ba(s,e){Object.getOwnPropertyNames(e).forEach(function(t){const i=e[t];i===null||typeof i=="undefined"||i===!1?s.removeAttribute(t):s.setAttribute(t,i===!0?"":i)})}function Tt(s){const e={},t=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(s&&s.attributes&&s.attributes.length>0){const i=s.attributes;for(let n=i.length-1;n>=0;n--){const a=i[n].name;let o=i[n].value;t.includes(a)&&(o=o!==null),e[a]=o}}return e}function Fa(s,e){return s.getAttribute(e)}function ei(s,e,t){s.setAttribute(e,t)}function xs(s,e){s.removeAttribute(e)}function Na(){U().body.focus(),U().onselectstart=function(){return!1}}function ja(){U().onselectstart=function(){return!0}}function ti(s){if(s&&s.getBoundingClientRect&&s.parentNode){const e=s.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(i=>{e[i]!==void 0&&(t[i]=e[i])}),t.height||(t.height=parseFloat(ii(s,"height"))),t.width||(t.width=parseFloat(ii(s,"width"))),t}}function wi(s){if(!s||s&&!s.offsetParent)return{left:0,top:0,width:0,height:0};const e=s.offsetWidth,t=s.offsetHeight;let i=0,n=0;for(;s.offsetParent&&s!==U()[ds.fullscreenElement];)i+=s.offsetLeft,n+=s.offsetTop,s=s.offsetParent;return{left:i,top:n,width:e,height:t}}function Cs(s,e){const t={x:0,y:0};if(ve){let g=s;for(;g&&g.nodeName.toLowerCase()!=="html";){const b=ii(g,"transform");
11if(/^matrix/.test(b)){const C=b.slice(7,-1).split(/,\s/).map(Number);t.x+=C[4],t.y+=C[5]}else if(/^matrix3d/.test(b)){const C=b.slice(9,-1).split(/,\s/).map(Number);t.x+=C[12],t.y+=C[13]}if(g.assignedSlot&&g.assignedSlot.parentElement&&S().WebKitCSSMatrix){const C=S().getComputedStyle(g.assignedSlot.parentElement).transform,k=new(S()).WebKitCSSMatrix(C);t.x+=k.m41,t.y+=k.m42}g=g.parentNode||g.host}}const i={},n=wi(e.target),a=wi(s),o=a.width,u=a.height;let f=e.offsetY-(a.top-n.top),m=e.offsetX-(a.left-n.left);return e.changedTouches&&(m=e.changedTouches[0].pageX-a.left,f=e.changedTouches[0].pageY+a.top,ve&&(m-=t.x,f-=t.y)),i.y=1-Math.max(0,Math.min(1,f/u)),i.x=Math.max(0,Math.min(1,m/o)),i}function $a(s){return Xe(s)&&s.nodeType===3}function Es(s){for(;s.firstChild;)s.removeChild(s.firstChild);return s}function Ha(s){return typeof s=="function"&&(s=s()),(Array.isArray(s)?s:[s]).map(e=>{if(typeof e=="function"&&(e=e()),Zt(e)||$a(e))return e;if(typeof e=="string"&&/\S/.test(e))return U().createTextNode(e)}).filter(e=>e)}function On(s,e){return Ha(e).forEach(t=>s.appendChild(t)),s}function Va(s,e){return On(Es(s),e)}function Ii(s){return s.button===void 0&&s.buttons===void 0||s.button===0&&s.buttons===void 0||s.type==="mouseup"&&s.button===0&&s.buttons===0||s.type==="mousedown"&&s.button===0&&s.buttons===0?!0:!(s.button!==0||s.buttons!==1)}const vt=Ra("querySelector"),qa=Ra("querySelectorAll");function ii(s,e){if(!s||!e)return"";if(typeof S().getComputedStyle=="function"){let t;try{t=S().getComputedStyle(s)}catch(i){return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function za(s){[...U().styleSheets].forEach(e=>{try{const t=[...e.cssRules].map(n=>n.cssText).join(""),i=U().createElement("style");i.textContent=t,s.document.head.appendChild(i)}catch(t){const i=U().createElement("link");i.rel="stylesheet",i.type=e.type,i.media=e.media.mediaText,i.href=e.href,s.document.head.appendChild(i)}})}var Wa=Object.freeze({__proto__:null,isReal:Jt,isEl:Zt,isInFrame:Ma,createEl:W,textContent:yt,prependTo:Dn,hasClass:ki,addClass:Lt,removeClass:Ss,toggleClass:Ua,setAttributes:Ba,getAttributes:Tt,getAttribute:Fa,setAttribute:ei,removeAttribute:xs,blockTextSelection:Na,unblockTextSelection:ja,getBoundingClientRect:ti,findPosition:wi,getPointerPosition:Cs,isTextNode:$a,emptyEl:Es,normalizeContent:Ha,appendContent:On,insertContent:Va,isSingleLeftClick:Ii,$:vt,$$:qa,computedStyle:ii,copyStyleSheetsToWindow:za});let Ga=!1,Mn;const Jd=function(){if(Mn.options.autoSetup===!1)return;const s=Array.prototype.slice.call(U().getElementsByTagName("video")),e=Array.prototype.slice.call(U().getElementsByTagName("audio")),t=Array.prototype.slice.call(U().getElementsByTagName("video-js")),i=s.concat(e,t);if(i&&i.length>0)for(let n=0,a=i.length;n<a;n++){const o=i[n];if(o&&o.getAttribute)o.player===void 0&&o.getAttribute("data-setup")!==null&&Mn(o);else{Rn(1);break}}else Ga||Rn(1)};function Rn(s,e){Jt()&&(e&&(Mn=e),S().setTimeout(Jd,s))}function Un(){Ga=!0,S().removeEventListener("load",Un)}Jt()&&(U().readyState==="complete"?Un():S().addEventListener("load",Un));const Ka=function(s){const e=U().createElement("style");return e.className=s,e},Qa=function(s,e){s.styleSheet?s.styleSheet.cssText=e:s.textContent=e};var Ee=new WeakMap;let Zd=3;function Fe(){return Zd++}function Ya(s,e){if(!Ee.has(s))return;const t=Ee.get(s);t.handlers[e].length===0&&(delete t.handlers[e],s.removeEventListener?s.removeEventListener(e,t.dispatcher,!1):s.detachEvent&&s.detachEvent("on"+e,t.dispatcher)),Object.getOwnPropertyNames(t.handlers).length<=0&&(delete t.handlers,delete t.dispatcher,delete t.disabled),Object.getOwnPropertyNames(t).length===0&&Ee.delete(s)}function Bn(s,e,t,i){t.forEach(function(n){s(e,n,i)})}function ks(s){if(s.fixed_)return s;function e(){return!0}function t(){return!1}if(!s||!s.isPropagationStopped||!s.isImmediatePropagationStopped){const i=s||S().event;s={};const n=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(const a in i)n.includes(a)||a==="returnValue"&&i.preventDefault||(s[a]=i[a]);if(s.target||(s.target=s.srcElement||U()),s.relatedTarget||(s.relatedTarget=s.fromElement===s.target?s.toElement:s.fromElement),s.preventDefault=function(){i.preventDefault&&i.preventDefault(),s.returnValue=!1,i.returnValue=!1,s.defaultPrevented=!0},s.defaultPrevented=!1,s.stopPropagation=function(){i.stopPropagation&&i.stopPropagation(),s.cancelBubble=!0,i.cancelBubble=!0,s.isPropagationStopped=e},s.isPropagationStopped=t,s.stopImmediatePropagation=function(){i.stopImmediatePropagation&&i.stopImmediatePropagation(),s.isImmediatePropagationStopped=e,s.stopPropagation()},s.isImmediatePropagationStopped=t,s.clientX!==null&&s.clientX!==void 0){const a=U().documentElement,o=U().body;s.pageX=s.clientX+(a&&a.scrollLeft||o&&o.scrollLeft||0)-(a&&a.clientLeft||o&&o.clientLeft||0),s.pageY=s.clientY+(a&&a.scrollTop||o&&o.scrollTop||0)-(a&&a.clientTop||o&&o.clientTop||0)}s.which=s.charCode||s.keyCode,s.button!==null&&s.button!==void 0&&(s.button=s.button&1?0:s.button&4?1:s.button&2?2:0)}return s.fixed_=!0,s}let ws;const eu=function(){if(typeof ws!="boolean"){ws=!1;try{const s=Object.defineProperty({},"passive",{get(){ws=!0}});S().addEventListener("test",null,s),S().removeEventListener("test",null,s)}catch(s){}}return ws},tu=["touchstart","touchmove"];function Oe(s,e,t){if(Array.isArray(e))return Bn(Oe,s,e,t);Ee.has(s)||Ee.set(s,{});const i=Ee.get(s);if(i.handlers||(i.handlers={}),i.handlers[e]||(i.handlers[e]=[]),t.guid||(t.guid=Fe()),i.handlers[e].push(t),i.dispatcher||(i.disabled=!1,i.dispatcher=function(n,a){if(i.disabled)return;n=ks(n);const o=i.handlers[n.type];if(o){const u=o.slice(0);for(let f=0,m=u.length;f<m&&!n.isImmediatePropagationStopped();f++)try{u[f].call(s,n,a)}catch(g){Q.error(g)}}}),i.handlers[e].length===1)if(s.addEventListener){let n=!1;eu()&&tu.indexOf(e)>-1&&(n={passive:!0}),s.addEventListener(e,i.dispatcher,n)}else s.attachEvent&&s.attachEvent("on"+e,i.dispatcher)}function be(s,e,t){if(!Ee.has(s))return;const i=Ee.get(s);if(!i.handlers)return;if(Array.isArray(e))return Bn(be,s,e,t);const n=function(o,u){i.handlers[u]=[],Ya(o,u)};if(e===void 0){for(const o in i.handlers)Object.prototype.hasOwnProperty.call(i.handlers||{},o)&&n(s,o);return}const a=i.handlers[e];if(a){if(!t){n(s,e);return}if(t.guid)for(let o=0;o<a.length;o++)a[o].guid===t.guid&&a.splice(o--,1);Ya(s,e)}}function si(s,e,t){const i=Ee.has(s)?Ee.get(s):{},n=s.parentNode||s.ownerDocument;if(typeof e=="string"?e={type:e,target:s}:e.target||(e.target=s),e=ks(e),i.dispatcher&&i.dispatcher.call(s,e,t),n&&!e.isPropagationStopped()&&e.bubbles===!0)si.call(null,n,e,t);else if(!n&&!e.defaultPrevented&&e.target&&e.target[e.type]){Ee.has(e.target)||Ee.set(e.target,{});const a=Ee.get(e.target);e.target[e.type]&&(a.disabled=!0,typeof e.target[e.type]=="function"&&e.target[e.type](),a.disabled=!1)}return!e.defaultPrevented}function Is(s,e,t){if(Array.isArray(e))return Bn(Is,s,e,t);const i=function(){be(s,e,i),t.apply(this,arguments)};i.guid=t.guid=t.guid||Fe(),Oe(s,e,i)}function Fn(s,e,t){const i=function(){be(s,e,i),t.apply(this,arguments)};i.guid=t.guid=t.guid||Fe(),Oe(s,e,i)}var iu=Object.freeze({__proto__:null,fixEvent:ks,on:Oe,off:be,trigger:si,one:Is,any:Fn});const Ne=30,ne=function(s,e,t){e.guid||(e.guid=Fe());const i=e.bind(s);return i.guid=t?t+"_"+e.guid:e.guid,i},Ze=function(s,e){let t=S().performance.now();return function(...n){const a=S().performance.now();a-t>=e&&(s(...n),t=a)}},Xa=function(s,e,t,i=S()){let n;const a=()=>{i.clearTimeout(n),n=null},o=function(){const u=this,f=arguments;let m=function(){n=null,m=null,t||s.apply(u,f)};!n&&t&&s.apply(u,f),i.clearTimeout(n),n=i.setTimeout(m,e)};return o.cancel=a,o};var su=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:Ne,bind_:ne,throttle:Ze,debounce:Xa});let Pi;class Me{on(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Oe(this,e,t),this.addEventListener=i}off(e,t){be(this,e,t)}
11one(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Is(this,e,t),this.addEventListener=i}any(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Fn(this,e,t),this.addEventListener=i}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=ks(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),si(this,e)}queueTrigger(e){Pi||(Pi=new Map);const t=e.type||e;let i=Pi.get(this);i||(i=new Map,Pi.set(this,i));const n=i.get(t);i.delete(t),S().clearTimeout(n);const a=S().setTimeout(()=>{i.delete(t),i.size===0&&(i=null,Pi.delete(this)),this.trigger(e)},0);i.set(t,a)}}Me.prototype.allowedEvents_={},Me.prototype.addEventListener=Me.prototype.on,Me.prototype.removeEventListener=Me.prototype.off,Me.prototype.dispatchEvent=Me.prototype.trigger;const Ps=s=>typeof s.name=="function"?s.name():typeof s.name=="string"?s.name:s.name_?s.name_:s.constructor&&s.constructor.name?s.constructor.name:typeof s,lt=s=>s instanceof Me||!!s.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof s[e]=="function"),nu=(s,e)=>{lt(s)?e():(s.eventedCallbacks||(s.eventedCallbacks=[]),s.eventedCallbacks.push(e))},Nn=s=>typeof s=="string"&&/\S/.test(s)||Array.isArray(s)&&!!s.length,As=(s,e,t)=>{if(!s||!s.nodeName&&!lt(s))throw new Error(`Invalid target for ${Ps(e)}#${t}; must be a DOM node or evented object.`)},Ja=(s,e,t)=>{if(!Nn(s))throw new Error(`Invalid event type for ${Ps(e)}#${t}; must be a non-empty string or array.`)},Za=(s,e,t)=>{if(typeof s!="function")throw new Error(`Invalid listener for ${Ps(e)}#${t}; must be a function.`)},jn=(s,e,t)=>{const i=e.length<3||e[0]===s||e[0]===s.eventBusEl_;let n,a,o;return i?(n=s.eventBusEl_,e.length>=3&&e.shift(),[a,o]=e):(n=e[0],a=e[1],o=e[2]),As(n,s,t),Ja(a,s,t),Za(o,s,t),o=ne(s,o),{isTargetingSelf:i,target:n,type:a,listener:o}},Dt=(s,e,t,i)=>{As(s,s,e),s.nodeName?iu[e](s,t,i):s[e](t,i)},ru={on(...s){const{isTargetingSelf:e,target:t,type:i,listener:n}=jn(this,s,"on");if(Dt(t,"on",i,n),!e){const a=()=>this.off(t,i,n);a.guid=n.guid;const o=()=>this.off("dispose",a);o.guid=n.guid,Dt(this,"on","dispose",a),Dt(t,"on","dispose",o)}},one(...s){const{isTargetingSelf:e,target:t,type:i,listener:n}=jn(this,s,"one");if(e)Dt(t,"one",i,n);else{const a=(...o)=>{this.off(t,i,a),n.apply(null,o)};a.guid=n.guid,Dt(t,"one",i,a)}},any(...s){const{isTargetingSelf:e,target:t,type:i,listener:n}=jn(this,s,"any");if(e)Dt(t,"any",i,n);else{const a=(...o)=>{this.off(t,i,a),n.apply(null,o)};a.guid=n.guid,Dt(t,"any",i,a)}},off(s,e,t){if(!s||Nn(s))be(this.eventBusEl_,s,e);else{const i=s,n=e;As(i,this,"off"),Ja(n,this,"off"),Za(t,this,"off"),t=ne(this,t),this.off("dispose",t),i.nodeName?(be(i,n,t),be(i,"dispose",t)):lt(i)&&(i.off(n,t),i.off("dispose",t))}},trigger(s,e){As(this.eventBusEl_,this,"trigger");const t=s&&typeof s!="string"?s.type:s;if(!Nn(t))throw new Error(`Invalid event type for ${Ps(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return si(this.eventBusEl_,s,e)}};function $n(s,e={}){const{eventBusKey:t}=e;if(t){if(!s[t].nodeName)throw new Error(`The eventBusKey "${t}" does not refer to an element.`);s.eventBusEl_=s[t]}else s.eventBusEl_=W("span",{className:"vjs-event-bus"});return Object.assign(s,ru),s.eventedCallbacks&&s.eventedCallbacks.forEach(i=>{i()}),s.on("dispose",()=>{s.off(),[s,s.el_,s.eventBusEl_].forEach(function(i){i&&Ee.has(i)&&Ee.delete(i)}),S().setTimeout(()=>{s.eventBusEl_=null},0)}),s}const au={state:{},setState(s){typeof s=="function"&&(s=s());let e;return Qt(s,(t,i)=>{this.state[i]!==t&&(e=e||{},e[i]={from:this.state[i],to:t}),this.state[i]=t}),e&&lt(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function eo(s,e){return Object.assign(s,au),s.state=Object.assign({},s.state,e),typeof s.handleStateChanged=="function"&&lt(s)&&s.on("statechanged",s.handleStateChanged),s}const Ai=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toLowerCase())},pe=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},to=function(s,e){return pe(s)===pe(e)};var ou=Object.freeze({__proto__:null,toLowerCase:Ai,toTitleCase:pe,titleCaseEquals:to});class I{constructor(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=ie({},this.options_),t=this.options_=ie(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const n=e&&e.id&&e.id()||"no_player";this.id_=`${n}_component_${Fe()}`}this.name_=t.name||null,t.el?this.el_=t.el:t.createEl!==!1&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(n=>this.addClass(n)),["on","off","one","any","trigger"].forEach(n=>{this[n]=void 0}),t.evented!==!1&&($n(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),eo(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,t.initChildren!==!1&&this.initChildren(),this.ready(i),t.reportTouchActivity!==!1&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e?(this.options_=ie(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,i){return W(e,t,i)}localize(e,t,i=e){const n=this.player_.language&&this.player_.language(),a=this.player_.languages&&this.player_.languages(),o=a&&a[n],u=n&&n.split("-")[0],f=a&&a[u];let m=i;return o&&o[e]?m=o[e]:f&&f[e]&&(m=f[e]),t&&(m=m.replace(/\{(\d+)\}/g,function(g,b){const C=t[b-1];let k=C;return typeof C=="undefined"&&(k=g),k})),m}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}
11getDescendant(...e){e=e.reduce((i,n)=>i.concat(n),[]);let t=this;for(let i=0;i<e.length;i++)if(t=t.getChild(e[i]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;const i="http://www.w3.org/2000/svg",n=W("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),a=U().createElementNS(i,"svg");a.setAttributeNS(null,"viewBox","0 0 512 512");const o=U().createElementNS(i,"use");return a.appendChild(o),o.setAttributeNS(null,"href",`#vjs-icon-${e}`),n.appendChild(a),this.iconIsSet_?t.replaceChild(n,t.querySelector(".vjs-icon-placeholder")):t.appendChild(n),this.iconIsSet_=!0,n}addChild(e,t={},i=this.children_.length){let n,a;if(typeof e=="string"){a=pe(e);const o=t.componentClass||a;t.name=a;const u=I.getComponent(o);if(!u)throw new Error(`Component ${o} does not exist`);if(typeof u!="function")return null;n=new u(this.player_||this,t)}else n=e;if(n.parentComponent_&&n.parentComponent_.removeChild(n),this.children_.splice(i,0,n),n.parentComponent_=this,typeof n.id=="function"&&(this.childIndex_[n.id()]=n),a=a||n.name&&pe(n.name()),a&&(this.childNameIndex_[a]=n,this.childNameIndex_[Ai(a)]=n),typeof n.el=="function"&&n.el()){let o=null;this.children_[i+1]&&(this.children_[i+1].el_?o=this.children_[i+1].el_:Zt(this.children_[i+1])&&(o=this.children_[i+1])),this.contentEl().insertBefore(n.el(),o)}return n}removeChild(e){if(typeof e=="string"&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let n=this.children_.length-1;n>=0;n--)if(this.children_[n]===e){t=!0,this.children_.splice(n,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[pe(e.name())]=null,this.childNameIndex_[Ai(e.name())]=null;const i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,i=o=>{const u=o.name;let f=o.opts;if(t[u]!==void 0&&(f=t[u]),f===!1)return;f===!0&&(f={}),f.playerOptions=this.options_.playerOptions;const m=this.addChild(u,f);m&&(this[u]=m)};let n;const a=I.getComponent("Tech");Array.isArray(e)?n=e:n=Object.keys(e),n.concat(Object.keys(this.options_).filter(function(o){return!n.some(function(u){return typeof u=="string"?o===u:o===u.name})})).map(o=>{let u,f;return typeof o=="string"?(u=o,f=e[u]||this.options_[u]||{}):(u=o.name,f=o),{name:u,opts:f}}).filter(o=>{const u=I.getComponent(o.opts.componentClass||pe(o.name));return u&&!a.isTech(u)}).forEach(i)}}buildCSSClass(){return""}ready(e,t=!1){if(e){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e);return}t?e.call(this):this.setTimeout(e,1)}}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)}$(e,t){return vt(e,t||this.contentEl())}$$(e,t){return qa(e,t||this.contentEl())}hasClass(e){return ki(this.el_,e)}addClass(...e){Lt(this.el_,...e)}removeClass(...e){Ss(this.el_,...e)}toggleClass(e,t){Ua(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return Fa(this.el_,e)}setAttribute(e,t){ei(this.el_,e,t)}removeAttribute(e){xs(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,i){if(t!==void 0){(t===null||t!==t)&&(t=0),(""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1?this.el_.style[e]=t:t==="auto"?this.el_.style[e]="":this.el_.style[e]=t+"px",i||this.trigger("componentresize");return}if(!this.el_)return 0;const n=this.el_.style[e],a=n.indexOf("px");return parseInt(a!==-1?n.slice(0,a):this.el_["offset"+pe(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=ii(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const i=`offset${pe(e)}`;t=this.el_[i]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect(),t={x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},i={x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2};return{boundingClientRect:t,center:i}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(e.key!=="Tab"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)&&e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;const i=10,n=200;let a;this.on("touchstart",function(u){u.touches.length===1&&(t={pageX:u.touches[0].pageX,pageY:u.touches[0].pageY},e=S().performance.now(),a=!0)}),this.on("touchmove",function(u){if(u.touches.length>1)a=!1;else if(t){const f=u.touches[0].pageX-t.pageX,m=u.touches[0].pageY-t.pageY;Math.sqrt(f*f+m*m)>i&&(a=!1)}});const o=function(){a=!1};this.on("touchleave",o),this.on("touchcancel",o),this.on("touchend",function(u){t
11=null,a===!0&&S().performance.now()-e<n&&(u.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=ne(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});const i=function(n){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",i),this.on("touchcancel",i)}setTimeout(e,t){var i;return e=ne(this,e),this.clearTimersOnDispose_(),i=S().setTimeout(()=>{this.setTimeoutIds_.has(i)&&this.setTimeoutIds_.delete(i),e()},t),this.setTimeoutIds_.add(i),i}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),S().clearTimeout(e)),e}setInterval(e,t){e=ne(this,e),this.clearTimersOnDispose_();const i=S().setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),S().clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=ne(this,e),t=S().requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=ne(this,t);const i=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,i),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),S().cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((i,n)=>this[t](n))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(a){const o=S().getComputedStyle(a,null),u=o.getPropertyValue("visibility");return o.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(u)}function i(a){return!(!t(a.parentElement)||!t(a)||a.style.opacity==="0"||S().getComputedStyle(a).height==="0px"||S().getComputedStyle(a).width==="0px")}function n(a){if(a.offsetWidth+a.offsetHeight+a.getBoundingClientRect().height+a.getBoundingClientRect().width===0)return!1;const o={x:a.getBoundingClientRect().left+a.offsetWidth/2,y:a.getBoundingClientRect().top+a.offsetHeight/2};if(o.x<0||o.x>(U().documentElement.clientWidth||S().innerWidth)||o.y<0||o.y>(U().documentElement.clientHeight||S().innerHeight))return!1;let u=U().elementFromPoint(o.x,o.y);for(;u;){if(u===a)return!0;if(u.parentNode)u=u.parentNode;else return!1}}return e||(e=this.el()),!!(n(e)&&i(e)&&(!e.parentElement||e.tabIndex>=0))}static registerComponent(e,t){if(typeof e!="string"||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const i=I.getComponent("Tech"),n=i&&i.isTech(t),a=I===t||I.prototype.isPrototypeOf(t.prototype);if(n||!a){let u;throw n?u="techs must be registered using Tech.registerTech()":u="must be a Component subclass",new Error(`Illegal component, "${e}"; ${u}.`)}e=pe(e),I.components_||(I.components_={});const o=I.getComponent("Player");if(e==="Player"&&o&&o.players){const u=o.players,f=Object.keys(u);if(u&&f.length>0){for(let m=0;m<f.length;m++)if(u[f[m]]!==null)throw new Error("Can not register Player component after player has been created.")}}return I.components_[e]=t,I.components_[Ai(e)]=t,t}static getComponent(e){if(!(!e||!I.components_))return I.components_[e]}}I.registerComponent("Component",I);function lu(s,e,t){if(typeof e!="number"||e<0||e>t)throw new Error(`Failed to execute '${s}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${t}).`)}function io(s,e,t,i){return lu(s,i,t.length-1),t[i][e]}function Hn(s){let e;return s===void 0||s.length===0?e={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:e={length:s.length,start:io.bind(null,"start",0,s),end:io.bind(null,"end",1,s)},S().Symbol&&S().Symbol.iterator&&(e[S().Symbol.iterator]=()=>(s||[]).values()),e}function We(s,e){return Array.isArray(s)?Hn(s):s===void 0||e===void 0?Hn():Hn([[s,e]])}const so=function(s,e){s=s<0?0:s;let t=Math.floor(s%60),i=Math.floor(s/60%60),n=Math.floor(s/3600);const a=Math.floor(e/60%60),o=Math.floor(e/3600);return(isNaN(s)||s===1/0)&&(n=i=t="-"),n=n>0||o>0?n+":":"",i=((n||a>=10)&&i<10?"0"+i:i)+":",t=t<10?"0"+t:t,n+i+t};let Vn=so;function no(s){Vn=s}function ro(){Vn=so}function Ot(s,e=s){return Vn(s,e)}var hu=Object.freeze({__proto__:null,createTimeRanges:We,createTimeRange:We,setFormatTime:no,resetFormatTime:ro,formatTime:Ot});function ao(s,e){let t=0,i,n;if(!e)return 0;(!s||!s.length)&&(s=We(0,0));for(let a=0;a<s.length;a++)i=s.start(a),n=s.end(a),n>e&&(n=e),t+=n-i;return t/e}function ce(s){if(s instanceof ce)return s;typeof s=="number"?this.code=s:typeof s=="string"?this.message=s:Xe(s)&&(typeof s.code=="number"&&(this.code=s.code),Object.assign(this,s)),this.message||(this.message=ce.defaultMessages[this.code]||"")}ce.prototype.code=0,ce.prototype.message="",ce.prototype.status=null,ce.prototype.metadata=null,ce.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],ce.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."},ce.MEDIA_ERR_CUSTOM=0,ce.prototype.MEDIA_ERR_CUSTOM=0,ce.MEDIA_ERR_ABORTED=1,ce.prototype.MEDIA_ERR_ABORTED=1,ce.MEDIA_ERR_NETWORK=2,ce.prototype.MEDIA_ERR_NETWORK=2,ce.MEDIA_ERR_DECODE=3,ce.prototype.MEDIA_ERR_DECODE=3,ce.MEDIA_ERR_SRC_NOT_SUPPORTED=4,ce.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4,ce.MEDIA_ERR_ENCRYPTED=5,ce.prototype.MEDIA_ERR_ENCRYPTED=5;function Li(s){return s!=null&&typeof s.then=="function"}function et(s){Li(s)&&s.then(null,e=>{})}const qn=function(s){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,i,n)=>(s[i]&&(t[i]=s[i]),t),{cues:s.cues&&Array.prototype.map.call(s.cues,function(t){return{startTime:t.startTime,endTime:t.endTime,text:t.text,id:t.id}})})};var zn={textTracksToJson:function(s){const e=s.$$("track"),t=Array.prototype.map.call(e,n=>n.track);return Array.prototype.map.call(e,function(n){const a=qn(n.track);return n.src&&(a.src=n.src),a}).concat(Array.prototype.filter.call(s.textTracks(),function(n){return t.indexOf(n)===-1}).map(qn))}
11,jsonToTextTracks:function(s,e){return s.forEach(function(t){const i=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(n=>i.addCue(n))}),e.textTracks()},trackToJson:qn};const Wn="vjs-modal-dialog";class ni extends I{constructor(e,t){super(e,t),this.handleKeyDown_=i=>this.handleKeyDown(i),this.close_=i=>this.close(i),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=W("div",{className:`${Wn}-content`},{role:"document"}),this.descEl_=W("p",{className:`${Wn}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),yt(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Wn} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_){this.options_.fillAlways&&this.fill();return}const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e=="boolean"){const t=this.closeable_=!!e;let i=this.getChild("closeButton");if(t&&!i){const n=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=n,this.on(i,"close",this.close_)}!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),i=t.parentNode,n=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),Va(t,e),this.trigger("modalfill"),n?i.insertBefore(t,n):i.appendChild(t);const a=this.getChild("closeButton");a&&i.appendChild(a.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),Es(this.contentEl()),this.trigger("modalempty")}content(e){return typeof e!="undefined"&&(this.content_=e),this.content_}conditionalFocus_(){const e=U().activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),e.key==="Escape"&&this.closeable()){e.preventDefault(),this.close();return}if(e.key!=="Tab")return;const t=this.focusableEls_(),i=this.el_.querySelector(":focus");let n;for(let a=0;a<t.length;a++)if(i===t[a]){n=a;break}U().activeElement===this.el_&&(n=0),e.shiftKey&&n===0?(t[t.length-1].focus(),e.preventDefault()):!e.shiftKey&&n===t.length-1&&(t[0].focus(),e.preventDefault())}focusableEls_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,t=>(t instanceof S().HTMLAnchorElement||t instanceof S().HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof S().HTMLInputElement||t instanceof S().HTMLSelectElement||t instanceof S().HTMLTextAreaElement||t instanceof S().HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof S().HTMLIFrameElement||t instanceof S().HTMLObjectElement||t instanceof S().HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}}
11ni.prototype.options_={pauseOnOpen:!0,temporary:!0},I.registerComponent("ModalDialog",ni);class Mt extends Me{constructor(e=[]){super(),this.tracks_=[];for(let t=0;t<e.length;t++)this.addTrack(e[t])}get length(){return this.tracks_.length}addTrack(e){const t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),this.tracks_.indexOf(e)===-1&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},lt(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let i=0,n=this.length;i<n;i++)if(this[i]===e){t=this[i],t.off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let i=0,n=this.length;i<n;i++){const a=this[i];if(a.id===e){t=a;break}}return t}}Mt.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const s in Mt.prototype.allowedEvents_)Mt.prototype["on"+s]=null;const Gn=function(s,e){for(let t=0;t<s.length;t++)!Object.keys(s[t]).length||e.id===s[t].id||(s[t].enabled=!1)};class oo extends Mt{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){Gn(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&Gn(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,Gn(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}const Kn=function(s,e){for(let t=0;t<s.length;t++)!Object.keys(s[t]).length||e.id===s[t].id||(s[t].selected=!1)};class lo extends Mt{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){Kn(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let t=0;t<this.length;t++)if(this[t].selected)return t;return-1},set(){}})}addTrack(e){e.selected&&Kn(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,Kn(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class Qn extends Mt{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}toJSON(){return this.tracks_.map(e=>e.toJSON())}}class du{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,i=e.length;t<i;t++)this.addTrackElement_(e[t])}addTrackElement_(e){const t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}),this.trackElements_.indexOf(e)===-1&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let i=0,n=this.trackElements_.length;i<n;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t}removeTrackElement_(e){for(let t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&typeof this.trackElements_[t].track.off=="function"&&this.trackElements_[t].track.off(),typeof this.trackElements_[t].off=="function"&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}}class Ls{constructor(e){Ls.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let i=0;const n=e.length;this.cues_=e,this.length_=e.length;const a=function(o){""+o in this||Object.defineProperty(this,""+o,{get(){return this.cues_[o]}})};if(t<n)for(i=t;i<n;i++)a.call(this,i)}getCueById(e){let t=null;for(let i=0,n=this.length;i<n;i++){const a=this[i];if(a.id===e){t=a;break}}return t}}const uu={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},cu={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},fu={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},ho={disabled:"disabled",hidden:"hidden",showing:"showing"};class Yn extends Me{constructor(e={}){super();const t={id:e.id||"vjs_track_"+Fe(),kind:e.kind||"",language:e.language||""};let i=e.label||"";for(const n in t)Object.defineProperty(this,n,{get(){return t[n]},set(){}});Object.defineProperty(this,"label",{get(){return i},set(n){n!==i&&(i=n,this.trigger("labelchange"))}})}}const Xn=function(s){return new URL(s,U().baseURI)},uo=function(s){return new URL(s,U().baseURI).href},Jn=function(s){if(typeof s=="string"){const t=s.split("?")[0].replace(/\/+$/,"").match(/\.([^.\/]+)$/);return t?t[1].toLowerCase():""}return""},Ds=function(s,e=S().location){return Xn(s).origin!==e.origin};var pu=Object.freeze({__proto__:null,parseUrl:Xn,getAbsoluteURL:uo,getFileExtension:Jn,isCrossOrigin:Ds});const co=function(s,e){const t=new(S()).WebVTT.Parser(S(),S().vttjs,S().WebVTT.StringDecoder()),i=[];t.oncue=function(n){e.addCue(n)},t.onparsingerror=function(n){i.push(n)},t.onflush=function(){e.trigger({type:"loadeddata",target:e})},t.parse(s),i.length>
110&&(S().console&&S().console.groupCollapsed&&S().console.groupCollapsed(`Text Track parsing errors for ${e.src}`),i.forEach(n=>Q.error(n)),S().console&&S().console.groupEnd&&S().console.groupEnd()),t.flush()},fo=function(s,e){const t={uri:s},i=Ds(s);i&&(t.cors=i);const n=e.tech_.crossOrigin()==="use-credentials";n&&(t.withCredentials=n),Ta()(t,ne(this,function(a,o,u){if(a)return Q.error(a,o);e.loaded_=!0,typeof S().WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],f=>{if(f.type==="vttjserror"){Q.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return co(u,e)}):co(u,e)}))};class Di extends Yn{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=ie(e,{kind:fu[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=ho[t.mode]||"disabled";const n=t.default;(t.kind==="metadata"||t.kind==="chapters")&&(i="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const a=new Ls(this.cues_),o=new Ls(this.activeCues_);let u=!1;this.timeupdateHandler=ne(this,function(m={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){m.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,u&&(this.trigger("cuechange"),u=!1),m.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});const f=()=>{this.stopTracking()};this.tech_.one("dispose",f),i!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get(){return n},set(){}},mode:{get(){return i},set(m){ho[m]&&i!==m&&(i=m,!this.preload_&&i!=="disabled"&&this.cues.length===0&&fo(this.src,this),this.stopTracking(),i!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?a:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return o;const m=this.tech_.currentTime(),g=[];for(let b=0,C=this.cues.length;b<C;b++){const k=this.cues[b];k.startTime<=m&&k.endTime>=m&&g.push(k)}if(u=!1,g.length!==this.activeCues_.length)u=!0;else for(let b=0;b<g.length;b++)this.activeCues_.indexOf(g[b])===-1&&(u=!0);return this.activeCues_=g,o.setCues_(this.activeCues_),o},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||t.kind!=="subtitles"&&t.kind!=="captions")&&fo(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(e){let t=e;if(!("getCueAsHTML"in t)){t=new(S()).vttjs.VTTCue(e.startTime,e.endTime,e.text);for(const n in e)n in t||(t[n]=e[n]);t.id=e.id,t.originalCue_=e}const i=this.tech_.textTracks();for(let n=0;n<i.length;n++)i[n]!==this&&i[n].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}toJSON(){return zn.trackToJson(this)}removeCue(e){let t=this.cues_.length;for(;t--;){const i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}Di.prototype.allowedEvents_={cuechange:"cuechange"};class po extends Yn{constructor(e={}){const t=ie(e,{kind:cu[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"enabled",{get(){return i},set(n){typeof n!="boolean"||n===i||(i=n,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class mo extends Yn{constructor(e={}){const t=ie(e,{kind:uu[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"selected",{get(){return i},set(n){typeof n!="boolean"||n===i||(i=n,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class ht extends Me{constructor(e={}){super();let t;const i=new Di(e);this.kind=i.kind,this.src=i.src,this.srclang=i.language,this.label=i.label,this.default=i.default,Object.defineProperties(this,{readyState:{get(){return t}},track:{get(){return i}}}),t=ht.NONE,i.addEventListener("loadeddata",()=>{t=ht.LOADED,this.trigger({type:"load",target:this})})}}ht.prototype.allowedEvents_={load:"load"},ht.NONE=0,ht.LOADING=1,ht.LOADED=2,ht.ERROR=3;
11const je={audio:{ListClass:oo,TrackClass:po,capitalName:"Audio"},video:{ListClass:lo,TrackClass:mo,capitalName:"Video"},text:{ListClass:Qn,TrackClass:Di,capitalName:"Text"}};Object.keys(je).forEach(function(s){je[s].getterName=`${s}Tracks`,je[s].privateName=`${s}Tracks_`});const ri={remoteText:{ListClass:Qn,TrackClass:Di,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:du,TrackClass:ht,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},ke=Object.assign({},je,ri);ri.names=Object.keys(ri),je.names=Object.keys(je),ke.names=[].concat(ri.names).concat(je.names);function mu(s,e,t,i,n={}){const a=s.textTracks();n.kind=e,t&&(n.label=t),i&&(n.language=i),n.tech=s;const o=new ke.text.TrackClass(n);return a.addTrack(o),o}class K extends I{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=i=>this.onDurationChange(i),this.trackProgress_=i=>this.trackProgress(i),this.trackCurrentTime_=i=>this.trackCurrentTime(i),this.stopTrackingCurrentTime_=i=>this.stopTrackingCurrentTime(i),this.disposeSourceHandler_=i=>this.disposeSourceHandler(i),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),ke.names.forEach(i=>{const n=ke[i];e&&e[n.getterName]&&(this[n.privateName]=e[n.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(i=>{e[`native${i}Tracks`]===!1&&(this[`featuresNative${i}Tracks`]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?this.featuresNativeTextTracks=!1:(e.nativeCaptions===!0||e.nativeTextTracks===!0)&&(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=e.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new ke.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(ne(this,function(){const t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,t===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return We(0,0)}bufferedPercent(){return ao(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(je.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(t=>{const i=this[`${t}Tracks`]()||[];let n=i.length;for(;n--;){const a=i[n];t==="text"&&this.removeRemoteTextTrack(a),i.removeTrack(a)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new ce(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?We(0,0):We()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}
11initTrackListeners(){je.names.forEach(e=>{const t=je[e],i=()=>{this.trigger(`${e}trackchange`)},n=this[t.getterName]();n.addEventListener("removetrack",i),n.addEventListener("addtrack",i),this.on("dispose",()=>{n.removeEventListener("removetrack",i),n.removeEventListener("addtrack",i)})})}addWebVttScript_(){if(!S().WebVTT)if(U().body.contains(this.el())){if(!this.options_["vtt.js"]&&Yt(va())&&Object.keys(va()).length>0){this.trigger("vttjsloaded");return}const e=U().createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),S().WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),i=u=>e.addTrack(u.track),n=u=>e.removeTrack(u.track);t.on("addtrack",i),t.on("removetrack",n),this.addWebVttScript_();const a=()=>this.trigger("texttrackchange"),o=()=>{a();for(let u=0;u<e.length;u++){const f=e[u];f.removeEventListener("cuechange",a),f.mode==="showing"&&f.addEventListener("cuechange",a)}};o(),e.addEventListener("change",o),e.addEventListener("addtrack",o),e.addEventListener("removetrack",o),this.on("dispose",function(){t.off("addtrack",i),t.off("removetrack",n),e.removeEventListener("change",o),e.removeEventListener("addtrack",o),e.removeEventListener("removetrack",o);for(let u=0;u<e.length;u++)e[u].removeEventListener("cuechange",a)})}addTextTrack(e,t,i){if(!e)throw new Error("TextTrack kind is required but was not provided");return mu(this,e,t,i)}createRemoteTextTrack(e){const t=ie(e,{tech:this});return new ri.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const i=this.createRemoteTextTrack(e);return typeof t!="boolean"&&(t=!1),this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),t===!1&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(i.track)),i}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=Fe();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return K.canPlayType(e.type)}static isTech(e){return e.prototype instanceof K||e instanceof K||e===K}static registerTech(e,t){if(K.techs_||(K.techs_={}),!K.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!K.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!K.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=pe(e),K.techs_[e]=t,K.techs_[Ai(e)]=t,e!=="Tech"&&K.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(K.techs_&&K.techs_[e])return K.techs_[e];if(e=pe(e),S()&&S().videojs&&S().videojs[e])return Q.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),S().videojs[e]}}}ke.names.forEach(function(s){const e=ke[s];K.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}}),K.prototype.featuresVolumeControl=!0,K.prototype.featuresMuteControl=!0,K.prototype.featuresFullscreenResize=!1,K.prototype.featuresPlaybackRate=!1,K.prototype.featuresProgressEvents=!1,K.prototype.featuresSourceset=!1,K.prototype.featuresTimeupdateEvents=!1,K.prototype.featuresNativeTextTracks=!1,K.prototype.featuresVideoFrameCallback=!1,K.withSourceHandlers=function(s){s.registerSourceHandler=function(t,i){let n=s.sourceHandlers;n||(n=s.sourceHandlers=[]),i===void 0&&(i=n.length),n.splice(i,0,t)},s.canPlayType=function(t){const i=s.sourceHandlers||[];let n;for(let a=0;a<i.length;a++)if(n=i[a].canPlayType(t),n)return n;return""},s.selectSourceHandler=function(t,i){const n=s.sourceHandlers||[];let a;for(let o=0;o<n.length;o++)if(a=n[o].canHandleSource(t,i),a)return n[o];return null},s.canPlaySource=function(t,i){const n=s.selectSourceHandler(t,i);return n?n.canHandleSource(t,i):""},["seekable","seeking","duration"].forEach(function(t){const i=this[t];typeof i=="function"&&(this[t]=function(){return this.sourceHandler_&&this.sourceHandler_[t]?this.sourceHandler_[t].apply(this.sourceHandler_,arguments):i.apply(this,arguments)})},s.prototype),s.prototype.setSource=function(t){let i=s.selectSourceHandler(t,this.options_);i||(s.nativeSourceHandler?i=s.nativeSourceHandler:Q.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),i!==s.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=i.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},s.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},I.registerComponent("Tech",K),K.registerTech("Tech",K),K.defaultTechOrder_=[];const Rt={},Os={},Ms={};function gu(s,e){Rt[s]=Rt[s]||[],Rt[s].push(e)}function _u(s,e,t){s.setTimeout(()=>Ut(e,Rt[e.type],t,s),1)}
11function yu(s,e){s.forEach(t=>t.setTech&&t.setTech(e))}function Tu(s,e,t){return s.reduceRight(Zn(t),e[t]())}function vu(s,e,t,i){return e[t](s.reduce(Zn(t),i))}function go(s,e,t,i=null){const n="call"+pe(t),a=s.reduce(Zn(n),i),o=a===Ms,u=o?null:e[t](a);return xu(s,t,u,o),u}const bu={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},Su={setCurrentTime:1,setMuted:1,setVolume:1},_o={play:1,pause:1};function Zn(s){return(e,t)=>e===Ms?Ms:t[s]?t[s](e):e}function xu(s,e,t,i){for(let n=s.length-1;n>=0;n--){const a=s[n];a[e]&&a[e](i,t)}}function Cu(s){Os.hasOwnProperty(s.id())&&delete Os[s.id()]}function Eu(s,e){const t=Os[s.id()];let i=null;if(t==null)return i=e(s),Os[s.id()]=[[e,i]],i;for(let n=0;n<t.length;n++){const[a,o]=t[n];a===e&&(i=o)}return i===null&&(i=e(s),t.push([e,i])),i}function Ut(s={},e=[],t,i,n=[],a=!1){const[o,...u]=e;if(typeof o=="string")Ut(s,Rt[o],t,i,n,a);else if(o){const f=Eu(i,o);if(!f.setSource)return n.push(f),Ut(s,u,t,i,n,a);f.setSource(Object.assign({},s),function(m,g){if(m)return Ut(s,u,t,i,n,a);n.push(f),Ut(g,s.type===g.type?u:Rt[g.type],t,i,n,a)})}else u.length?Ut(s,u,t,i,n,a):a?t(s,n):Ut(s,Rt["*"],t,i,n,!0)}const ku={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},Rs=function(s=""){const e=Jn(s);return ku[e.toLowerCase()]||""},wu=(s,e)=>{if(!e)return"";if(s.cache_.source.src===e&&s.cache_.source.type)return s.cache_.source.type;const t=s.cache_.sources.filter(n=>n.src===e);if(t.length)return t[0].type;const i=s.$$("source");for(let n=0;n<i.length;n++){const a=i[n];if(a.type&&a.src&&a.src===e)return a.type}return Rs(e)},yo=function(s){if(Array.isArray(s)){let e=[];s.forEach(function(t){t=yo(t),Array.isArray(t)?e=e.concat(t):Xe(t)&&e.push(t)}),s=e}else typeof s=="string"&&s.trim()?s=[To({src:s})]:Xe(s)&&typeof s.src=="string"&&s.src&&s.src.trim()?s=[To(s)]:s=[];return s};function To(s){if(!s.type){const e=Rs(s.src);e&&(s.type=e)}return s}var Iu=`<svg xmlns="http://www.w3.org/2000/svg">
12  <defs>
13    <symbol viewBox="0 0 48 48" id="vjs-icon-play">
14      <path d="M16 10v28l22-14z"></path>
15    </symbol>
16    <symbol viewBox="0 0 48 48" id="vjs-icon-pause">
17      <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>
18    </symbol>
19    <symbol viewBox="0 0 48 48" id="vjs-icon-audio">
20      <path d="M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"></path>
21    </symbol>
22    <symbol viewBox="0 0 48 48" id="vjs-icon-captions">
23      <path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"></path>
24    </symbol>
25    <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">
26      <path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"></path>
27    </symbol>
28    <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">
29      <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>
30    </symbol>
31    <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">
32      <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>
33    </symbol>
34    <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">
35      <path d="M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>
36    </symbol>
37    <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">
38      <path d="M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"></path>
39    </symbol>
40    <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">
41      <path d="M14 18v12h8l10 10V8L22 18h-8z"></path>
42    </symbol>
43    <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">
44      <path d="M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"></path>
45    </symbol>
46    <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">
47      <path d="M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"></path>
48    </symbol>
49    <symbol viewBox="0 0 48 48" id="vjs-icon-spinner">
50      <path d="M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"></path>
51    </symbol>
52    <symbol viewBox="0 0 24 24" id="vjs-icon-hd">
53      <path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"></path>
54    </symbol>
55    <symbol viewBox="0 0 48 48" id="vjs-icon-chapters">
56      <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>
57    </symbol>
58    <symbol viewBox="0 0 40 40" id="vjs-icon-downloading">
59      <path d="M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"></path>
60    </symbol>
61    <symbol viewBox="0 0 48 48" id="vjs-icon-file-download">
62      <path d="M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"></path>
63    </symbol>
64    <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">
65      <path d="M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"></path>
66    </symbol>
67    <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">
68      <path d="M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"></path>
69    </symbol>
70    <symbol viewBox="0 0 48 48" id="vjs-icon-share">
71      <path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"></path>
72    </symbol>
73    <symbol viewBox="0 0 48 48" id="vjs-icon-cog">
74      <path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"></path>
75    </symbol>
76    <symbol viewBox="0 0 48 48" id="vjs-icon-square">
77      <path d="M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"></path>
78    </symbol>
79    <symbol viewBox="0 0 48 48" id="vjs-icon-circle">
80      <circle cx="24" cy="24" r="20"></circle>
81    </symbol>
82    <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">
83      <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>
84    </symbol>
85    <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">
86      <path d="M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"></path>
87    </symbol>
88    <symbol viewBox="0 0 48 48" id="vjs-icon-cancel">
89      <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"></path>
90    </symbol>
91    <symbol viewBox="0 0 48 48" id="vjs-icon-replay">
92      <path d="M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-
927.16 16-16-7.16-16-16-16z"></path>
93    </symbol>
94    <symbol viewBox="0 0 48 48" id="vjs-icon-repeat">
95      <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>
96    </symbol>
97    <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">
98      <path d="M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"></path>
99    </symbol>
100    <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">
101      <path d="M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"></path>
102    </symbol>
103    <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">
104      <path d="M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"></path>
105    </symbol>
106    <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">
107      <path d="M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"></path>
108    </symbol>
109    <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">
110      <path d="M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"></path>
111    </symbol>
112    <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">
113      <path d="M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"></path>
114    </symbol>
115    <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">
116      <g fill-rule="evenodd"><path d="M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"></path><path d="M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"></path></g>
117    </symbol>
118    <symbol viewBox="0 0 48 48" id="vjs-icon-next-item">
119      <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>
120    </symbol>
121    <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">
122      <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>
123    </symbol>
124    <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">
125      <path d="M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"></path>
126    </symbol>
127    <symbol viewBox="0 0 48 48" id="vjs-icon-cast">
128      <path d="M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"></path>
129    </symbol>
130    <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">
131      <path d="M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"></path>
132    </symbol>
133    <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">
134      <path d="M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"></path>
135      <path fill="none" d="M-1-3h24v24H-1z"></path>
136    </symbol>
137    <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">
138      <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>
139    </symbol>
140    <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">
141      <path d="M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"></path>
142    </symbol>
143    <symbol viewBox="0 0 1200 1227" id="vjs-icon-twitter">
144      <path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"/>
145    </symbol>
146    <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">
147      <path d="M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"></path>
148    </symbol>
149    <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">
150      <path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path>
151    </symbol>
152  </defs>
153</svg>`;const vo=ys?10009:Ts?461:8,ai={codes:{play:415,pause:19,ff:417,rw:412,back:vo},names:{415:"play",19:"pause",417:"ff",412:"rw",[vo]:"back"},isEventKey(s,e){return e=e.toLowerCase(),!!(this.names[s.keyCode]&&this.names[s.keyCode]===e)},getEventName(s){if(this.names[s.keyCode])return this.names[s.keyCode];if(this.codes[s.code]){const e=this.codes[s.code];return this.names[e]}return null}},bo=5;class Pu extends Me{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();const i=t.key.substring(5).toLowerCase();this.move(i)}else if(ai.isEventKey(t,"play")||ai.isEventKey(t,"pause")||ai.isEventKey(t,"ff")||ai.isEventKey(t,"rw")){t.preventDefault();const i=ai.getEventName(t);this.performMediaAction_(i)}else ai.isEventKey(t,"Back")&&e.target&&typeof e.target.closeable=="function"&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+bo);break;case"rw":this.userSeek_(this.player_.currentTime()-bo);break}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const t=e.relatedTarget;let i=null;const n=this.getCurrentComponent(e.target);t&&(i=!!t.closest(".video-js"),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!i||!t)&&(n&&n.name()==="CloseButton"?this.refocusComponent():(this.pause(),n&&n.el()&&(this.lastFocusedComponent_=n)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsF
153ocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,t=[];function i(n){for(const a of n)a.hasOwnProperty("el_")&&a.getIsFocusable()&&a.getIsAvailableToBeFocused(a.el())&&t.push(a),a.hasOwnProperty("children_")&&a.children_.length>0&&i(a.children_)}return e.children_.forEach(n=>{if(n.hasOwnProperty("el_"))if(n.getIsFocusable&&n.getIsAvailableToBeFocused&&n.getIsFocusable()&&n.getIsAvailableToBeFocused(n.el())){t.push(n);return}else n.hasOwnProperty("children_")&&n.children_.length>0?i(n.children_):n.hasOwnProperty("items")&&n.items.length>0?i(n.items):this.findSuitableDOMChild(n)&&t.push(n);if(n.name_==="ErrorDisplay"&&n.opened_){const a=n.el_.querySelector(".vjs-errors-ok-button-container");a&&a.querySelectorAll("button").forEach((u,f)=>{t.push({name:()=>"ModalButton"+(f+1),el:()=>u,getPositions:()=>{const m=u.getBoundingClientRect(),g={x:m.x,y:m.y,width:m.width,height:m.height,top:m.top,right:m.right,bottom:m.bottom,left:m.left},b={x:m.left+m.width/2,y:m.top+m.height/2,width:0,height:0,top:m.top+m.height/2,right:m.left+m.width/2,bottom:m.top+m.height/2,left:m.left+m.width/2};return{boundingClientRect:g,center:b}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:m=>!0,focus:()=>u.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){function t(i){if(e.getIsFocusable(i)&&e.getIsAvailableToBeFocused(i))return i;for(let n=0;n<i.children.length;n++){const a=i.children[n],o=t(a);if(o)return o}return null}return e.el()?t(e.el()):null}getCurrentComponent(e){this.updateFocusableComponents();const t=e||document.activeElement;if(this.focusableComponents.length){for(const i of this.focusableComponents)if(i.el()===t)return i}}add(e){const t=[...this.focusableComponents];e.hasOwnProperty("el_")&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())&&t.push(e),this.focusableComponents=t,this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}remove(e){for(let t=0;t<this.focusableComponents.length;t++)if(this.focusableComponents[t].name()===e.name()){this.focusableComponents.splice(t,1),this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents});return}}clear(){this.focusableComponents.length>0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const t=this.getCurrentComponent();if(!t)return;const i=t.getPositions(),n=this.focusableComponents.filter(o=>o!==t&&this.isInDirection_(i.boundingClientRect,o.getPositions().boundingClientRect,e)),a=this.findBestCandidate_(i.center,n,e);a?this.focus(a):this.trigger({type:"endOfFocusableComponents",direction:e,focu
153sedComponent:t})}findBestCandidate_(e,t,i){let n=1/0,a=null;for(const o of t){const u=o.getPositions().center,f=this.calculateDistance_(e,u,i);f<n&&(n=f,a=o)}return a}isInDirection_(e,t,i){switch(i){case"right":return t.left>=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;e<this.focusableComponents.length;e++)if(this.focusableComponents[e].name()===this.lastFocusedComponent_.name()){this.focus(this.focusableComponents[e]);return}}else this.focus(this.updateFocusableComponents()[0])}focus(e){typeof e=="object"&&(e.getIsAvailableToBeFocused(e.el())?e.focus():this.findSuitableDOMChild(e)&&this.findSuitableDOMChild(e).focus())}calculateDistance_(e,t,i){const n=Math.abs(e.x-t.x),a=Math.abs(e.y-t.y);let o;switch(i){case"right":case"left":o=n+a*100;break;case"up":o=a*2+n*.5;break;case"down":o=a*5+n;break;default:o=n+a}return o}searchForTrackSelect_(){const e=this;for(const t of e.updateFocusableComponents())if(t.constructor.name==="TextTrackSelect"){e.focus(t);break}}}class Au extends I{constructor(e,t,i){const n=ie({createEl:!1},t);if(super(e,n,i),!t.playerOptions.sources||t.playerOptions.sources.length===0)for(let a=0,o=t.playerOptions.techOrder;a<o.length;a++){const u=pe(o[a]);let f=K.getTech(u);if(u||(f=I.getComponent(u)),f&&f.isSupported()){e.loadTech_(u);break}}else e.src(t.playerOptions.sources)}}I.registerComponent("MediaLoader",Au);class Us extends I{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=i=>this.handleMouseOver(i),this.handleMouseOut_=i=>this.handleMouseOut(i),this.handleClick_=i=>this.handleClick(i),this.handleKeyDown_=i=>this.handleKeyDown(i),this.emitTapEvents(),this.enable()}createEl(e="div",t={},i={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e==="button"&&Q.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),i=Object.assign({role:"button"},i),this.tabIndex_=t.tabIndex;const n=W(e,t,i);return this.player_.options_.experimentalSvgIcons||n.appendChild(W("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(n),n}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=W("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(e===void 0)return this.controlText_||"Need Text";const i=this.localize(e);this.controlText_=e,yt(this.controlTextEl_,i),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute("title",i)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),typeof this.tabIndex_!="undefined"&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),typeof this.tabIndex_!="undefined"&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){e.key===" "||e.key==="Enter"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}I.registerComponent("ClickableComponent",Us);class er extends Us{constructor(e,t){super(e,t);const{mainContent:i}=t&&t.playerOptions||{};this.isMainContent=i,this.update(),this.update_=n=>this.update(n),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return W("div",{className:"vjs-poster"})}crossOrigin(e){if(typeof e=="undefined")return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null,  "anonymous" or "use-credentials", given "${e}"`);return}this.$("img")&&(this.$("img").crossOrigin=e)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){if(!e){this.el_.textContent="";return}this.$("img")||this.el_.appendChild(W("picture",{className:"vjs-poster",tabIndex:-1},{},W("img",{loading:this.isMainContent?"eager":"lazy",fetchPriority:this.isMainContent?"high":"auto",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e}handleClick(e){if(!this.player_.controls())return;const t=this.player_.getChild("controlBar"),i=t&&t.getChild("playToggle");gt?(i||this.player_).focus():this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?et(this.player_.play()):this.player_.pause()}}er.prototype.crossorigin=er.prototype.crossOrigin,I.registerComponent("PosterImage",er);const $e="#222",So="#ccc",Lu={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',
153script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function tr(s,e){let t;if(s.length===4)t=s[1]+s[1]+s[2]+s[2]+s[3]+s[3];else if(s.length===7)t=s.slice(1);else throw new Error("Invalid color code provided, "+s+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+e+")"}function tt(s,e,t){try{s.style[e]=t}catch(i){return}}function xo(s){return s?`${s}px`:""}class Du extends I{constructor(e,t,i){super(e,t,i);const n=o=>this.updateDisplay(o),a=o=>{this.updateDisplayOverlay(),this.updateDisplay(o)};e.on("loadstart",o=>this.toggleDisplay(o)),e.on("useractive",n),e.on("userinactive",n),e.on("texttrackchange",n),e.on("loadedmetadata",o=>{this.updateDisplayOverlay(),this.preselectTrack(o)}),e.ready(ne(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",a),e.on("playerresize",a);const o=S().screen.orientation||S(),u=S().screen.orientation?"change":"orientationchange";o.addEventListener(u,a),e.on("dispose",()=>o.removeEventListener(u,a));const f=this.options_.playerOptions.tracks||[];for(let m=0;m<f.length;m++)this.player_.addRemoteTextTrack(f[m],!0);this.preselectTrack()}))}preselectTrack(){const e={captions:1,subtitles:1},t=this.player_.textTracks(),i=this.player_.cache_.selectedLanguage;let n,a,o;for(let u=0;u<t.length;u++){const f=t[u];i&&i.enabled&&i.language&&i.language===f.language&&f.kind in e?f.kind===i.kind?o=f:o||(o=f):i&&!i.enabled?(o=null,n=null,a=null):f.default&&(f.kind==="descriptions"&&!n?n=f:f.kind in e&&!a&&(a=f))}o?o.mode="showing":a?a.mode="showing":n&&(n.mode="showing")}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){typeof S().WebVTT=="function"&&S().WebVTT.processCues(S(),[],this.el_)}updateDisplay(){const e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){const o=[];for(let u=0;u<e.length;++u){const f=e[u];f.mode==="showing"&&o.push(f)}this.updateForTrack(o);return}let i=null,n=null,a=e.length;for(;a--;){const o=e[a];o.mode==="showing"&&(o.kind==="descriptions"?i=o:n=o)}if(n?(this.getAttribute("aria-live")!=="off"&&this.setAttribute("aria-live","off"),this.updateForTrack(n)):i&&(this.getAttribute("aria-live")!=="assertive"&&this.setAttribute("aria-live","assertive"),this.updateForTrack(i)),!(S().CSS!==void 0&&S().CSS.supports("inset","10px"))){const o=this.el_,u=o.querySelectorAll(".vjs-text-track-cue"),f=this.player_.controlBar.el_.getBoundingClientRect().height,m=this.player_.el_.getBoundingClientRect().height;o.style="",tt(o,"position","relative"),tt(o,"height",m-f+"px"),tt(o,"top","unset"),vs?tt(o,"bottom",m+"px"):tt(o,"bottom","0px"),u.length>0&&u.forEach(g=>{if(g.style.inset){const b=g.style.inset.split(" ");b.length===3&&Object.assign(g.style,{top:b[0],right:b[1],bottom:b[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!(S().CSS!==void 0&&S().CSS.supports("inset-inline: 10px")))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),i=e/t,n=this.player_.videoWidth()/this.player_.videoHeight();let a=0,o=0;Math.abs(i-n)>.1&&(i>n?a=Math.round((e-t*n)/2):o=Math.round((t-e/n)/2)),tt(this.el_,"insetInline",xo(a)),tt(this.el_,"insetBlock",xo(o))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),i=e.activeCues;let n=i.length;for(;n--;){const a=i[n];if(!a)continue;const o=a.displayState;if(t.color&&(o.firstChild.style.color=t.color),t.textOpacity&&tt(o.firstChild,"color",tr(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(o.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&tt(o.firstChild,"backgroundColor",tr(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?tt(o,"backgroundColor",tr(t.windowColor,t.windowOpacity)):o.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?o.firstChild.style.textShadow=`2px 2px 3px ${$e}, 2px 2px 4px ${$e}, 2px 2px 5px ${$e}`:t.edgeStyle==="raised"?o.firstChild.style.textShadow=`1px 1px ${$e}, 2px 2px ${$e}, 3px 3px ${$e}`:t.edgeStyle==="depressed"?o.firstChild.style.textShadow=`1px 1px ${So}, 0 1px ${So}, -1px -1px ${$e}, 0 -1px ${$e}`:t.edgeStyle==="uniform"&&(o.firstChild.style.textShadow=`0 0 4px ${$e}, 0 0 4px ${$e}, 0 0 4px ${$e}, 0 0 4px ${$e}`)),t.fontPercent&&t.fontPercent!==1){const u=S().parseFloat(o.style.fontSize);o.style.fontSize=u*t.fontPercent+"px",o.style.height="auto",o.style.top="auto"}t.fontFamily&&t.fontFamily!=="default"&&(t.fontFamily==="small-caps"?o.firstChild.style.fontVariant="small-caps":o.firstChild.style.fontFamily=Lu[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof S().WebVTT!="function"||e.every(i=>!i.activeCues))return;const t=[];for(let i=0;i<e.length;++i){const n=e[i];for(let a=0;a<n.activeCues.length;++a)t.push(n.activeCues[a])}S().WebVTT.processCues(S(),t,this.el_);for(let i=0;i<e.length;++i){const n=e[i];for(let a=0;a<n.activeCues.length;++a){const o=n.activeCues[a].displayState;Lt(o,"vjs-text-track-cue","vjs-text-track-cue-"+(n.language?n.language:i)),n.language&&ei(o,"lang",n.language)}this.player_.textTrackSettings&&this.updateDisplayState(n)}}}I.registerComponent("TextTrackDisplay",Du);class Ou extends I{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"
153Video Player"),i=W("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),n=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return n.appendChild(i),n}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}}I.registerComponent("LoadingSpinner",Ou);class Se extends Us{createEl(e,t={},i={}){e="button",t=Object.assign({className:this.buildCSSClass()},t),i=Object.assign({type:"button"},i);const n=W(e,t,i);return this.player_.options_.experimentalSvgIcons||n.appendChild(W("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(n),n}addChild(e,t={}){const i=this.constructor.name;return Q.warn(`Adding an actionable (user controllable) child to a Button (${i}) is not supported; use a ClickableComponent instead.`),I.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){if(e.key===" "||e.key==="Enter"){e.stopPropagation();return}super.handleKeyDown(e)}}I.registerComponent("Button",Se);class Co extends Se{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",i=>this.handleMouseDown(i))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play(),i=this.player_.getChild("controlBar"),n=i&&i.getChild("playToggle");if(e.type==="tap"||this.mouseused_&&"clientX"in e&&"clientY"in e){et(t),gt?(n||this.player_).focus():this.player_.tech(!0)&&this.player_.tech(!0).focus();return}if(!n){this.player_.tech(!0).focus();return}const a=()=>n.focus();Li(t)?t.then(a,()=>{}):this.setTimeout(a,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}Co.prototype.controlText_="Play Video",I.registerComponent("BigPlayButton",Co);class Mu extends Se{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){e.key==="Escape"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}I.registerComponent("CloseButton",Mu);class Eo extends Se{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon("play"),this.on(e,"play",i=>this.handlePlay(i)),this.on(e,"pause",i=>this.handlePause(i)),t.replay&&this.on(e,"ended",i=>this.handleEnded(i))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?et(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",t=>this.handleSeeked(t))}}Eo.prototype.controlText_="Play",I.registerComponent("PlayToggle",Eo);class oi extends I{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],i=>this.update(i)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),i=W("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)}\xA0`},{role:"presentation"});return t.appendChild(i),this.contentEl_=W("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){!this.player_.options_.enableSmoothSeeking&&e.type==="seeking"||this.updateContent(e)}updateTextNode_(e=0){e=Ot(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let t=this.textNode_;t&&this.contentEl_.firstChild!==t&&(t=null,Q.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=U().createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}oi.prototype.labelText_="Time",oi.prototype.controlText_="Time",I.registerComponent("TimeDisplay",oi);class ir extends oi{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;this.player_.ended()?t=this.player_.duration():e&&e.target&&typeof e.target.pendingSeekTime=="function"&&e.target.pendingSeekTime()!==null?t=e.target.pendingSeekTime():t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}ir.prototype.labelText_="Current Time",ir.prototype.controlText_="Current Time",I.registerComponent("CurrentTimeDisplay",ir);class sr extends oi{constructor(e,t){super(e,t);const i=n=>this.updateContent(n);
vendor: 8,982 bytes, line 153
153this.on(e,"durationchange",i),this.on(e,"loadstart",i),this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}sr.prototype.labelText_="Duration",sr.prototype.controlText_="Duration",I.registerComponent("DurationDisplay",sr);class Ru extends I{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),i=super.createEl("span",{textContent:"/"});return t.appendChild(i),e.appendChild(t),e}}I.registerComponent("TimeDivider",Ru);class nr extends oi{constructor(e,t){super(e,t),this.on(e,"durationchange",i=>this.updateContent(i))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(W("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!="number")return;let t;this.player_.ended()?t=0:this.player_.remainingTimeDisplay?t=this.player_.remainingTimeDisplay():t=this.player_.remainingTime(),this.updateTextNode_(t)}}nr.prototype.labelText_="Remaining Time",nr.prototype.controlText_="Remaining Time",I.registerComponent("RemainingTimeDisplay",nr);class Uu extends I{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",i=>this.updateShowing(i))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=W("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(W("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")}\xA0`})),this.contentEl_.appendChild(U().createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}}I.registerComponent("LiveDisplay",Uu);class ko extends Se{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=i=>this.updateLiveEdgeStatus(i),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=W("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}ko.prototype.controlText_="Seek to live, currently playing live",I.registerComponent("SeekToLive",ko);function Oi(s,e,t){return s=Number(s),Math.min(t,Math.max(e,isNaN(s)?e:s))}var Bu=Object.freeze({__proto__:null,clamp:Oi});class rr extends I{constructor(e,t){super(e,t),this.handleMouseDown_=i=>this.handleMouseDown(i),this.handleMouseUp_=i=>this.handleMouseUp(i),this.handleKeyDown_=i=>this.handleKeyDown(i),this.handleClick_=i=>this.handleClick(i),this.handleMouseMove_=i=>this.handleMouseMove(i),this.update_=i=>this.update(i),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},i={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i),super.createEl(e,t,i)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!Je&&e.preventDefault(),Na(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;ja(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(e*100).toFixed(2)+"%"})),e}getProgress(){return Number(Oi(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=Cs(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,i=t&&t.enabled,n=t&&t.horizontalSeek;i?n&&e.key==="ArrowLeft"||!n&&e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):n&&e.key==="ArrowRight"||!n&&e.key==="ArrowUp"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(this.pendingSeekTime()&&(this.pendingSeekTime(null),this.userSeek_(this.player_.currentTime())),super.handleKeyDown(e)):e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):e.key==="ArrowUp"||e.key==="ArrowRight"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}I.registerComponent("Slider",rr);const ar=(s,e)=>Oi(s/e*100,0,100).toFixed(2)+"%";class Fu extends I{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",i=>this.update(i))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=W("span",{className:"vjs-control-text"}),i=W("span",{textContent:this.localize("Loaded")}),n=U().createTextNode(": ");return this.percentageEl_=W("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(i),t.appendChild(n),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const t=this.player_.liveTracker,i=this.player_.buffered(),n=t&&t.isLive()?t.seekableEnd():this.player_.duration(),a=this.player_.bufferedEnd(),o=this.partEls_,u=ar(a,n);this.percent_!==u&&(this.el_.style.width=u,yt(this.percentageEl_,u),this.percent_=u);for(let f=0;f<i.length;f++){const m=i.start(f),g=i.end(f);let b=o[f];b||(b=this.el_.appendChild(W()),o[f]=b),!(b.dataset.start===m&&b.dataset.end===g)&&(b.dataset.start=m,b.dataset.end=g,b.style.left=ar(m,a),b.style.width=ar(g-m,a))}for(let f=o.length;f>i.length;f--)this.el_.removeChild(o[f-1]);o.length=i.length})}}I.registerComponent("LoadProgressBar",Fu);class Nu extends I{constructor(e,t){super(e,t),this.update=Ze(ne(this,this.update),Ne)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){const n=wi(this.el_),a=ti(this.player_.el()),o=e.width*t;if(!a||!n)return;let u=e.left-a.left+o,f=e.width-o+(a.right-e.right);f||(f=e.width-o,u=o);let m=n.width/2;u<m?m+=m-u:f<m&&(m=f),m<0?m=0:m>n.width&&(m=n.width),m=Math.round(m),this.el_.style.right=`-${m}px`,this.write(i)}write(e){yt(this.el_,e)}updateTime(e,t,i,n){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let a;const o=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const u=this.player_.liveTracker.liveWindow(),f=u-t*u;a=(f<1?"":"-")+Ot(f,u)}
153else a=Ot(i,o);this.update(e,t,a),n&&n()})}}I.registerComponent("TimeTooltip",Nu);class or extends I{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=Ze(ne(this,this.update),Ne)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t,i){const n=this.getChild("timeTooltip");if(!n)return;const a=i&&i.target&&typeof i.target.pendingSeekTime=="function"?i.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();n.updateTime(e,t,a)}}or.prototype.options_={children:[]},!ve&&!ze&&or.prototype.options_.children.push("timeTooltip"),I.registerComponent("PlayProgressBar",or);class wo extends I{constructor(e,t){super(e,t),this.update=Ze(ne(this,this.update),Ne)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,()=>{this.el_.style.left=`${e.width*t}px`})}}wo.prototype.options_={children:["timeTooltip"]},I.registerComponent("MouseTimeDisplay",wo);class Bs extends rr{constructor(e,t){t=ie(Bs.prototype.options_,t),t.children=[...t.children];const i=e.options_.disableSeekWhileScrubbingOnMobile&&(ve||ze)||e.options_.disableSeekWhileScrubbingOnSTV;(!ve&&!ze||i)&&t.children.splice(1,0,"mouseTimeDisplay"),super(e,t),this.shouldDisableSeekWhileScrubbing_=i,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){this.update_=ne(this,this.update),this.update=Ze(this.update_,Ne),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in U()&&"visibilityState"in U()&&this.on(U(),"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){U().visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,Ne))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(U().visibilityState==="hidden")return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const i=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),n=this.player_.liveTracker;let a=this.player_.duration();n&&n.isLive()&&(a=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(t*100).toFixed(2)),this.percent_=t),(this.currentTime_!==i||this.duration_!==a)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[Ot(i,a),Ot(a,a)],"{1} of {2}")),this.currentTime_=i,this.duration_=a),this.bar&&this.bar.update(ti(this.el()),this.getProgress(),e)}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}pendingSeekTime(e){if(e!==void 0)if(e!==null){const t=this.player_.duration();this.pendingSeekTime_=Math.max(0,Math.min(e,t))}else this.pendingSeekTime_=null;return this.pendingSeekTime_}getPercent(){if(this.pendingSeekTime()!==null)return this.pendingSeekTime()/this.player_.duration();const e=this.getCurrentTime_();let t;const i=this.player_.liveTracker;
153return i&&i.isLive()?(t=(e-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){Ii(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbing_||this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!Ii(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let i;const n=this.calculateDistance(e),a=this.player_.liveTracker;if(!a||!a.isLive())i=n*this.player_.duration(),i===this.player_.duration()&&(i=i-.1);else{if(n>=.99){a.seekToLiveEdge();return}const o=a.seekableStart(),u=a.liveCurrentTime();if(i=o+n*a.liveWindow(),i>=u&&(i=u),i<=o&&(i=o+.1),i===1/0)return}this.shouldDisableSeekWhileScrubbing_?this.pendingSeekTime(i):this.userSeek_(i),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.pendingSeekTime()!==null&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?et(this.player_.play()):this.update_()}handlePendingSeek_(e){this.player_.paused()||this.player_.pause();const t=this.pendingSeekTime()!==null?this.pendingSeekTime():this.player_.currentTime();this.pendingSeekTime(t+e),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}stepForward(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(this.options().stepSeconds):this.userSeek_(this.player_.currentTime()+this.options().stepSeconds)}stepBack(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(-this.options().stepSeconds):this.userSeek_(this.player_.currentTime()-this.options().stepSeconds)}handleAction(e){this.pendingSeekTime()!==null&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(e.key===" "||e.key==="Enter")e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(e.key==="Home")e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(e.key==="End")e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const i=parseInt(e.key,10)*.1;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}else e.key==="PageDown"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-this.options().stepSeconds*this.options().pageMultiplier)):e.key==="PageUp"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+this.options().stepSeconds*this.options().pageMultiplier)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in U()&&"visibilityState"in U()&&this.off(U(),"visibilitychange",this.toggleVisibility_),super.dispose()}}Bs.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar",stepSeconds:5,pageMultiplier:12},I.registerComponent("SeekBar",Bs);class Io extends I{constructor(e,t){super(e,t),this.handleMouseMove=Ze(ne(this,this.handleMouseMove),Ne),this.throttledHandleMouseSeek=Ze(ne(this,this.handleMouseSeek),Ne),this.handleMouseUpHandler_=i=>this.handleMouseUp(i),this.handleMouseDownHandler_=i=>this.handleMouseDown(i),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const i=t.getChild("playProgressBar"),n=t.getChild("mouseTimeDisplay");if(!i&&!n)return;const a=t.el(),o=wi(a);let u=Cs(a,e).x;u=Oi(u,0,1),n&&n.update(o,u),i&&i.update(o,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}
153disable(){if(this.children().forEach(e=>e.disable&&e.disable()),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&et(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}Io.prototype.options_={children:["seekBar"]},I.registerComponent("ProgressControl",Io);class Po extends Se{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],i=>this.handlePictureInPictureChange(i)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],i=>this.handlePictureInPictureEnabledChange(i)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){if(!(this.player_.currentType().substring(0,5)==="audio"||this.player_.audioPosterMode()||this.player_.audioOnlyMode())){this.show();return}this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()}handlePictureInPictureEnabledChange(){U().pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in S()?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){typeof U().exitPictureInPicture=="function"&&super.show()}}Po.prototype.controlText_="Picture-in-Picture",I.registerComponent("PictureInPictureToggle",Po);class Ao extends Se{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",i=>this.handleFullscreenChange(i)),U()[e.fsApi_.fullscreenEnabled]===!1&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}Ao.prototype.controlText_="Fullscreen",I.registerComponent("FullscreenToggle",Ao);const ju=function(s,e){e.tech_&&!e.tech_.featuresVolumeControl&&s.addClass("vjs-hidden"),s.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})};class $u extends I{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}
vendor: 4,239 bytes, line 153
153I.registerComponent("VolumeLevel",$u);class Hu extends I{constructor(e,t){super(e,t),this.update=Ze(ne(this,this.update),Ne)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,n){if(!i){const a=ti(this.el_),o=ti(this.player_.el()),u=e.width*t;if(!o||!a)return;const f=e.left-o.left+u,m=e.width-u+(o.right-e.right);let g=a.width/2;f<g?g+=g-f:m<g&&(g=m),g<0?g=0:g>a.width&&(g=a.width),this.el_.style.right=`-${g}px`}this.write(`${n}%`)}write(e){yt(this.el_,e)}updateVolume(e,t,i,n,a){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,i,n.toFixed(0)),a&&a()})}}I.registerComponent("VolumeLevelTooltip",Hu);class Lo extends I{constructor(e,t){super(e,t),this.update=Ze(ne(this,this.update),Ne)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){const n=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,n,()=>{i?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}}Lo.prototype.options_={children:["volumeLevelTooltip"]},I.registerComponent("MouseVolumeLevelDisplay",Lo);class Fs extends rr{constructor(e,t){super(e,t),this.on("slideractive",i=>this.updateLastVolume_(i)),this.on(e,"volumechange",i=>this.updateARIAAttributes(i)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){Ii(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const i=this.el(),n=ti(i),a=this.vertical();let o=Cs(i,e);o=a?o.y:o.x,o=Oi(o,0,1),t.update(n,o,a)}Ii(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}}Fs.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},!ve&&!ze&&Fs.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),Fs.prototype.playerEvent="volumechange",I.registerComponent("VolumeBar",Fs);class Do extends I{constructor(e,t={}){t.vertical=t.vertical||!1,(typeof t.volumeBar=="undefined"||Yt(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),ju(this,e),this.throttledHandleMouseMove=Ze(ne(this,this.handleMouseMove),Ne),this.handleMouseUpHandler_=i=>this.handleMouseUp(i),this.on("mousedown",i=>this.handleMouseDown(i)),this.on("touchstart",i=>this.handleMouseDown(i)),this.on("mousemove",i=>this.handleMouseMove(i)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}Do.prototype.options_={children:["volumeBar"]}
153,I.registerComponent("VolumeControl",Do);const Vu=function(s,e){e.tech_&&!e.tech_.featuresMuteControl&&s.addClass("vjs-hidden"),s.on(e,"loadstart",function(){e.tech_.featuresMuteControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})};class Oo extends Se{constructor(e,t){super(e,t),Vu(this,e),this.on(e,["loadstart","volumechange"],i=>this.update(i))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),i=this.player_.lastVolume_();if(t===0){const n=i<.1?.1:i;this.player_.volume(n),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),ve&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),Ss(this.el_,[0,1,2,3].reduce((i,n)=>i+`${n?" ":""}vjs-vol-${n}`,"")),Lt(this.el_,`vjs-vol-${t}`)}updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)}}Oo.prototype.controlText_="Mute",I.registerComponent("MuteToggle",Oo);class Mo extends I{constructor(e,t={}){typeof t.inline!="undefined"?t.inline=t.inline:t.inline=!0,(typeof t.volumeControl=="undefined"||Yt(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=i=>this.handleKeyPress(i),this.on(e,["loadstart"],i=>this.volumePanelState_(i)),this.on(this.muteToggle,"keyup",i=>this.handleKeyPress(i)),this.on(this.volumeControl,"keyup",i=>this.handleVolumeControlKeyUp(i)),this.on("keydown",i=>this.handleKeyPress(i)),this.on("mouseover",i=>this.handleMouseOver(i)),this.on("mouseout",i=>this.handleMouseOut(i)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){e.key==="Escape"&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),Oe(U(),"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),be(U(),"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}}Mo.prototype.options_={children:["muteToggle","volumeControl"]},I.registerComponent("VolumePanel",Mo);class Ro extends Se{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),i=this.player_.liveTracker,n=i&&i.isLive()?i.seekableEnd():this.player_.duration();let a;t+this.skipTime<=n?a=t+this.skipTime:a=n,this.player_.currentTime(a)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}Ro.prototype.controlText_="Skip Forward",I.registerComponent("SkipForward",Ro);class Uo extends Se{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1}
153 seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),i=this.player_.liveTracker,n=i&&i.isLive()&&i.seekableStart();let a;n&&t-this.skipTime<=n?a=n:t>=this.skipTime?a=t-this.skipTime:a=0,this.player_.currentTime(a)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}Uo.prototype.controlText_="Skip Backward",I.registerComponent("SkipBackward",Uo);class Bo extends I{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",i=>this.handleKeyDown(i)),this.boundHandleBlur_=i=>this.handleBlur(i),this.boundHandleTapClick_=i=>this.handleTapClick(i)}addEventListenerForItem(e){e instanceof I&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof I&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=W(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),Oe(t,"click",function(i){i.preventDefault(),i.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||U().activeElement;if(!this.children().some(i=>i.el()===t)){const i=this.menuButton_;i&&i.buttonPressed_&&t!==i.el().firstChild&&i.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const i=t.filter(n=>n.el()===e.target)[0];if(!i)return;i.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}}handleKeyDown(e){e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(e.key==="ArrowRight"||e.key==="ArrowUp")&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}I.registerComponent("Menu",Bo);class lr extends I{constructor(e,t={}){super(e,t),this.menuButton_=new Se(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=Se.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const n=a=>this.handleClick(a);this.handleMenuKeyUp_=a=>this.handleMenuKeyUp(a),this.on(this.menuButton_,"tap",n),this.on(this.menuButton_,"click",n),this.on(this.menuButton_,"keydown",a=>this.handleKeyDown(a)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),Oe(U(),"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",a=>this.handleMouseLeave(a)),this.on("keydown",a=>this.handleSubmenuKeyDown(a))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new Bo(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=W("li",{className:"vjs-menu-title",textContent:pe(this.options_.title),tabIndex:-1}),i=new I(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(e){return super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";this.options_.inline===!0?e+="-inline":e+="-popup";const t=Se.prototype.buildCSSClass();return`vjs-menu-button ${e} ${t} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";return this.options_.inline===!0?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(e,t=this.menuButton_.el()){return this.menuButton_.controlText(e,t)}dispose(){this.handleMouseLeave(),super.dispose()}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(e){this.removeClass("vjs-hover"),be(U(),"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){e.key==="Escape"||e.key==="Tab"?(this.buttonPressed_&&this.unpressButton(),!e.key==="Tab"&&(e.preventDefault(),this.menuButton_.focus())):(e.key==="Up"||e.key==="Down"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))}handleMenuKeyUp(e){(e.key==="Escape"||e.key==="Tab")&&this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){(e.key==="Escape"||e.key==="Tab")&&(this.buttonPressed_&&this.unpressButton(),!e.key==="Tab"&&(e.preventDefault(),this.menuButton_.focus()))}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),ve&&Ma())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","fal
153se"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}}I.registerComponent("MenuButton",lr);class hr extends lr{constructor(e,t){const i=t.tracks;super(e,t),this.items.length<=1&&this.hide(),i&&(this.updateHandler_=ne(this,this.update),this.cleanupHandler_=ne(this,this.cleanupTrackListeners_),i.addEventListener("removetrack",this.updateHandler_),i.addEventListener("addtrack",this.updateHandler_),i.addEventListener("labelchange",this.updateHandler_),this.player_.on("ready",this.updateHandler_),this.player_.on("dispose",this.cleanupHandler_))}cleanupTrackListeners_(){if(!this.updateHandler_)return;const e=this.options_.tracks;e&&(e.removeEventListener("removetrack",this.updateHandler_),e.removeEventListener("addtrack",this.updateHandler_),e.removeEventListener("labelchange",this.updateHandler_)),this.player_&&(this.player_.off("ready",this.updateHandler_),this.player_.off("dispose",this.cleanupHandler_)),this.updateHandler_=null,this.cleanupHandler_=null}dispose(){this.cleanupTrackListeners_(),super.dispose()}}I.registerComponent("TrackButton",hr);class Mi extends Us{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem")}createEl(e,t,i){this.nonIconControl=!0;const n=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),i),a=W("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?n.appendChild(a):n.replaceChild(a,n.querySelector(".vjs-icon-placeholder")),n}handleKeyDown(e){["Tab","Escape","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"].includes(e.key)||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}}I.registerComponent("MenuItem",Mi);class Ri extends Mi{constructor(e,t){const i=t.track,n=e.textTracks();t.label=i.label||i.language||"Unknown",t.selected=i.mode==="showing",super(e,t),this.track=i,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const a=(...u)=>{this.handleTracksChange.apply(this,u)},o=(...u)=>{this.handleSelectedLanguageChange.apply(this,u)};if(e.on(["loadstart","texttrackchange"],a),n.addEventListener("change",a),n.addEventListener("selectedlanguagechange",o),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],a),n.removeEventListener("change",a),n.removeEventListener("selectedlanguagechange",o)}),n.onchange===void 0){let u;this.on(["tap","click"],function(){if(typeof S().Event!="object")try{u=new(S()).Event("change")}catch(f){}u||(u=U().createEvent("Event"),u.initEvent("change",!0,!0)),n.dispatchEvent(u)})}this.handleTracksChange()}handleClick(e){const t=this.track,i=this.player_.textTracks();if(super.handleClick(e),!!i)for(let n=0;n<i.length;n++){const a=i[n];this.kinds.indexOf(a.kind)!==-1&&(a===t?a.mode!=="showing"&&(a.mode="showing"):a.mode!=="disabled"&&(a.mode="disabled"))}}handleTracksChange(e){const t=this.track.mode==="showing";t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if(this.track.mode==="showing"){const t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null,super.dispose()}}I.registerComponent("TextTrackMenuItem",Ri);class Fo extends Ri{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleTracksChange(e){const t=this.player().textTracks();let i=!0;for(let n=0,a=t.length;n<a;n++){const o=t[n];
vendor: 11,412 bytes, line 153
153if(this.options_.kinds.indexOf(o.kind)>-1&&o.mode==="showing"){i=!1;break}}i!==this.isSelected_&&this.selected(i)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let i=!0;for(let n=0,a=t.length;n<a;n++){const o=t[n];if(["captions","descriptions","subtitles"].indexOf(o.kind)>-1&&o.mode==="showing"){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}I.registerComponent("OffTextTrackMenuItem",Fo);class li extends hr{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=Ri){let i;this.label_&&(i=`${this.label_} off`),e.push(new Fo(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;const n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let a=0;a<n.length;a++){const o=n[a];if(this.kinds_.indexOf(o.kind)>-1){const u=new t(this.player_,{track:o,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});u.addClass(`vjs-${o.kind}-menu-item`),e.push(u)}}return e}}I.registerComponent("TextTrackButton",li);class No extends Mi{constructor(e,t){const i=t.track,n=t.cue,a=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=n.text,t.selected=n.startTime<=a&&a<n.endTime,super(e,t),this.track=i,this.cue=n}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}I.registerComponent("ChaptersTrackMenuItem",No);class dr extends li{constructor(e,t,i){super(e,t,i),this.setIcon("chapters"),this.selectCurrentItem_=()=>{this.items.forEach(n=>{n.selected(this.track_.activeCues[0]===n.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters")return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const i=e[t];if(i.kind===this.kind_)return i}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(pe(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let i=0,n=t.length;i<n;i++){const a=t[i],o=new No(this.player_,{track:this.track_,cue:a});e.push(o)}return e}}dr.prototype.kind_="chapters",dr.prototype.controlText_="Chapters",I.registerComponent("ChaptersButton",dr);class ur extends li{constructor(e,t,i){super(e,t,i),this.setIcon("audio-description");const n=e.textTracks(),a=ne(this,this.handleTracksChange);n.addEventListener("change",a),this.on("dispose",function(){n.removeEventListener("change",a)})}handleTracksChange(e){const t=this.player().textTracks();let i=!1;for(let n=0,a=t.length;n<a;n++){const o=t[n];if(o.kind!==this.kind_&&o.mode==="showing"){i=!0;break}}i?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}ur.prototype.kind_="descriptions",ur.prototype.controlText_="Descriptions",I.registerComponent("DescriptionsButton",ur);class cr extends li{constructor(e,t,i){super(e,t,i),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}cr.prototype.kind_="subtitles",cr.prototype.controlText_="Subtitles",I.registerComponent("SubtitlesButton",cr);class fr extends Ri{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+t.kind+" settings dialog")}handleClick(e){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings"),super.handleLanguagechange()}}I.registerComponent("CaptionSettingsMenuItem",fr);class pr extends li{constructor(e,t,i){super(e,t,i),this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new fr(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}pr.prototype.kind_="captions",pr.prototype.controlText_="Captions",I.registerComponent("CaptionsButton",pr);class jo extends Ri{createEl(e,t,i){const n=super.createEl(e,t,i),a=n.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="captions"&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",n):a.appendChild(W("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),a.appendChild(W("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),n}}I.registerComponent("SubsCapsMenuItem",jo);class mr extends li{constructor(e,t={}){super(e,t),this.label_="subtitles",this.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(pe(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new fr(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,jo),e}}mr.prototype.kinds_=["captions","subtitles"],mr.prototype.controlText_="Subtitles",I.registerComponent("SubsCapsButton",mr);class $o extends Mi{constructor(e,t){const i=t.track,n=e.audioTracks();t.label=i.label||i.language||"Unknown",t.selected=i.enabled,super(e,t),this.track=i,this.addClass(`vjs-${i.kind}-menu-item`);const a=(...o)=>{this.handleTracksChange.apply(this,o)};n.addEventListener("change",a),this.on("dispose",()=>{n.removeEventListener("change",a)})}createEl(e,t,i){const n=super.createEl(e,t,i),a=n.querySelector(".vjs-menu-item-text");return["main-desc","descriptions","description"].indexOf(this.options_.track.kind)>=0&&(a.appendChild(W("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),a.appendChild(W("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),n}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let i=0;i<t.length;i++){const n=t[i];n!==this.track&&(n.enabled=n===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}I.registerComponent("AudioTrackMenuItem",$o);class Ho extends hr{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t),this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(e=[]){this.hideThreshold_=1;const t=this.player_.audioTracks();for(let i=0;i<t.length;i++){const n=t[i];e.push(new $o(this.player_,{track:n,selectable:!0,multiSelectable:!1}))}return e}}Ho.prototype.controlText_="Audio Track",I.registerComponent("AudioTrackButton",Ho);class gr extends Mi{constructor(e,t){const i=t.rate,n=parseFloat(i,10);t.label=i,t.selected=n===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=i,this.rate=n,this.on(e,"ratechange",a=>this.update(a))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}gr.prototype.contentElType="button",I.registerComponent("PlaybackRateMenuItem",gr);class Vo extends lr{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",i=>this.updateVisibility(i)),this.on(e,"ratechange",i=>this.updateLabel(i)),this.on(e,"playbackrateschange",i=>this.handlePlaybackRateschange(i))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=W("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let i=e.length-1;i>=0;i--)t.push(new gr(this.player(),{rate:e[i]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}Vo.prototype.controlText_="Playback Rate",I.registerComponent("PlaybackRateMenuButton",Vo);class qo extends I{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},i={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,i)}}I.registerComponent("Spacer",qo);class qu extends qo{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:"\xA0"})}}I.registerComponent("CustomControlSpacer",qu);class zo extends I{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}zo.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]},I.registerComponent("ControlBar",zo);class Wo extends ni{constructor(e,t){super(e,t),this.on(e,"error",i=>{this.open(i)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}Wo.prototype.options_=Object.assign({}
153,ni.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),I.registerComponent("ErrorDisplay",Wo);class Go extends I{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),W("select",{id:this.options_.id},{},this.options_.SelectOptions.map(t=>{const i=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${Fe()}`)+"-"+t[1].replace(/\W+/g,""),n=W("option",{id:i,value:this.localize(t[0]),textContent:this.localize(t[1])});return n.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${i}`),n}))}}I.registerComponent("TextTrackSelect",Go);class Bt extends I{constructor(e,t={}){super(e,t);const i=W("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(i);const n=this.options_.selects;for(const a of n){const o=this.options_.selectConfigs[a],u=o.className,f=o.id.replace("%s",this.options_.id_);let m=null;const g=`vjs_select_${Fe()}`;if(this.options_.type==="colors"){m=W("span",{className:u});const C=W("label",{id:f,className:"vjs-label",textContent:this.localize(o.label)});C.setAttribute("for",g),m.appendChild(C)}const b=new Go(e,{SelectOptions:o.options,legendId:this.options_.legendId,id:g,labelId:f});this.addChild(b),this.options_.type==="colors"&&(m.appendChild(b.el()),this.el().appendChild(m))}}createEl(){return W("fieldset",{className:this.options_.className})}}I.registerComponent("TextTrackFieldset",Bt);class Ko extends I{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,n=new Bt(e,{id_:i,legendId:`captions-text-legend-${i}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(n);const a=new Bt(e,{id_:i,legendId:`captions-background-${i}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(a);const o=new Bt(e,{id_:i,legendId:`captions-window-${i}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(o)}createEl(){return W("div",{className:"vjs-track-settings-colors"})}}I.registerComponent("TextTrackSettingsColors",Ko);class Qo extends I{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,n=new Bt(e,{id_:i,legendId:`captions-font-size-${i}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(n);const a=new Bt(e,{id_:i,legendId:`captions-edge-style-${i}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(a);const o=new Bt(e,{id_:i,legendId:`captions-font-family-${i}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(o)}createEl(){return W("div",{className:"vjs-track-settings-font"})}}I.registerComponent("TextTrackSettingsFont",Qo);class Yo extends I{constructor(e,t={}){super(e,t);const i=new Se(e,{controlText:this.localize("restore all settings to the default values"),className:"vjs-default-button"});i.el().classList.remove("vjs-control","vjs-button"),i.el().textContent=this.localize("Reset"),this.addChild(i);const n=this.localize("Done"),a=new Se(e,{controlText:n,className:"vjs-done-button"});a.el().classList.remove("vjs-control","vjs-button"),a.el().textContent=n,this.addChild(a)}createEl(){return W("div",{className:"vjs-track-settings-controls"})}}I.registerComponent("TrackSettingsControls",Yo);const _r="vjs-text-track-settings",Xo=["#000","Black"],Jo=["#00F","Blue"],Zo=["#0FF","Cyan"],el=["#0F0","Green"],tl=["#F0F","Magenta"],il=["#F00","Red"],sl=["#FFF","White"],nl=["#FF0","Yellow"],yr=["1","Opaque"],Tr=["0.5","Semi-Transparent"],rl=["0","Transparent"],bt={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Xo,sl,il,el,Jo,nl,tl,Zo],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[yr,Tr,rl],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[sl,Xo,il,el,Jo,nl,tl,Zo],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:s=>s==="1.00"?null:Number(s)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[yr,Tr],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[rl,Tr,yr],className:"vjs-window-opacity vjs-opacity"}};bt.windowColor.options=bt.backgroundColor.options;function al(s,e){if(e&&(s=e(s)),s&&s!=="none")return s}function zu(s,e){const t=s.options[s.options.selectedIndex].value;return al(t,e)}function Wu(s,e,t){if(e){for(let i=0;i<s.options.length;
vendor: 6,999 bytes, line 153
153i++)if(al(s.options[i].value,t)===e){s.selectedIndex=i;break}}}class Gu extends ni{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.renderModalComponents(e),this.endDialog=W("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),t.persistTextTrackSettings===void 0&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.bindFunctionsToSelectsAndButtons(),this.options_.persistTextTrackSettings&&this.restoreSettings()}renderModalComponents(e){const t=new Ko(e,{textTrackComponentid:this.id_,selectConfigs:bt,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);const i=new Qo(e,{textTrackComponentid:this.id_,selectConfigs:bt,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(i);const n=new Yo(e);this.addChild(n)}bindFunctionsToSelectsAndButtons(){this.on(this.$(".vjs-done-button"),["click","tap"],()=>{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),Qt(bt,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return ka(bt,(e,t,i)=>{const n=zu(this.$(t.selector),t.parser);return n!==void 0&&(e[i]=n),e},{})}setValues(e){Qt(bt,(t,i)=>{Wu(this.$(t.selector),e[i],t.parser)})}setDefaults(){Qt(bt,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(S().localStorage.getItem(_r))}catch(t){Q.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?S().localStorage.setItem(_r,JSON.stringify(e)):S().localStorage.removeItem(_r)}catch(t){Q.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}I.registerComponent("TextTrackSettings",Gu);class Ku extends I{constructor(e,t){let i=t.ResizeObserver||S().ResizeObserver;t.ResizeObserver===null&&(i=!1);const n=ie({createEl:!i,reportTouchActivity:!1},t);super(e,n),this.ResizeObserver=t.ResizeObserver||S().ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=Xa(()=>{this.resizeHandler()},100,!1,this),i?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const a=this.debouncedHandler_;let o=this.unloadListener_=function(){be(this,"resize",a),be(this,"unload",o),o=null};Oe(this.el_.contentWindow,"unload",o),Oe(this.el_.contentWindow,"resize",a)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}}I.registerComponent("ResizeManager",Ku);const Qu={trackingThreshold:20,liveTolerance:15};class Yu extends I{constructor(e,t){const i=ie(Qu,t,{createEl:!1});super(e,i),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=n=>this.handlePlay(n),this.handleFirstTimeupdate_=n=>this.handleFirstTimeupdate(n),this.handleSeeked_=n=>this.handleSeeked(n),this.seekToLiveEdge_=n=>this.seekToLiveEdge(n),this.reset_(),this.on(this.player_,"durationchange",n=>this.handleDurationchange(n)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(S().performance.now().toFixed(4)),i=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+i;const n=this.liveCurrentTime(),a=this.player_.currentTime();let o=this.player_.paused()||this.seekedBehindLive_||Math.abs(n-a)>this.options_.liveTolerance;(!this.timeupdateSeen_||n===1/0)&&(o=!1),o!==this.behindLiveEdge_&&(this.behindLiveEdge_=o,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Ne),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0}
153liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_=="number"}seekToLiveEdge(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}I.registerComponent("LiveTracker",Yu);class Xu extends I{constructor(e,t){super(e,t),this.on("statechanged",i=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:W("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${Fe()}`}),description:W("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${Fe()}`})},W("div",{className:"vjs-title-bar"},{},wa(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(n=>{const a=this.state[n],o=this.els[n],u=i[n];Es(o),a&&yt(o,a),t&&(t.removeAttribute(u),a&&t.setAttribute(u,o.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}}I.registerComponent("TitleBar",Xu);const Ju={initialDisplay:4e3,position:[],takeFocus:!1};class Zu extends Se{constructor(e,t){t=ie(Ju,t),super(e,t),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],i=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=W("button",{},{type:"button",class:this.buildCSSClass()},W("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}}I.registerComponent("TransientButton",Zu);const vr=s=>{const e=s.el();if(e.hasAttribute("src"))return s.triggerSourceset(e.src),!0;const t=s.$$("source"),i=[];let n="";if(!t.length)return!1;for(let a=0;a<t.length;a++){const o=t[a].src;o&&i.indexOf(o)===-1&&i.push(o)}return i.length?(i.length===1&&(n=i[0]),s.triggerSourceset(n),!0):!1},ec=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(s){const e=U().createElement(this.nodeName.toLowerCase());e.innerHTML=s;const t=U().createDocumentFragment();for(;e.childNodes.length;)t.appendChild(e.childNodes[0]);return this.innerText="",S().Element.prototype.appendChild.call(this,t),this.innerHTML}}),ol=(s,e)=>{let t={};for(let i=0;i<s.length&&(t=Object.getOwnPropertyDescriptor(s[i],e),!(t&&t.set&&t.get));i++);return t.enumerable=!0,t.configurable=!0,t},tc=s=>ol([s.el(),S().HTMLMediaElement.prototype,S().Element.prototype,ec],"innerHTML"),ll=function(s){const e=s.el();if(e.resetSourceWatch_)return;const t={},i=tc(s),n=a=>(...o)=>{const u=a.apply(e,o);return vr(s),u};["append","appendChild","insertAdjacentHTML"].forEach(a=>{e[a]&&(t[a]=e[a],e[a]=n(t[a]))}),Object.defineProperty(e,"innerHTML",ie(i,{set:n(i.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(t).forEach(a=>{e[a]=t[a]}),Object.defineProperty(e,"innerHTML",i)},s.one("sourceset",e.resetSourceWatch_)},ic=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?uo(S().Element.prototype.getAttribute.call(this,"src")):""},set(s){return S().Element.prototype.setAttribute.call(this,"src",s),s}}),sc=s=>ol([s.el(),S().HTMLMediaElement.prototype,ic],"src"),nc=function(s){if(!s.featuresSourceset)return;const e=s.el();if(e.resetSourceset_)return;const t=sc(s),i=e.setAttribute,n=e.load;Object.defineProperty(e,"src",ie(t,{set:a=>{const o=t.set.call(e,a);return s.triggerSourceset(e.src),o}})),e.setAttribute=(a,o)=>{const u=i.call(e,a,o);return/src/i.test(a)&&s.triggerSourceset(e.src),u},e.load=()=>{const a=n.call(e);return vr(s)||(s.triggerSourceset(""),ll(s)),a},e.currentSrc?s.triggerSourceset(e.currentSrc):vr(s)||ll(s),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=n,e.setAttribute=i,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};class V extends K{constructor(e,t){super(e,t);const i=e.source;let n=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",i&&(this.el_.currentSrc!==i.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(i):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const a=this.el_.childNodes;let o=a.length;const u=[];for(;o--;){const f=a[o];f.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(f),this.remoteTextTracks().addTrack(f.track),this.textTracks().addTrack(f.track),!n&&!this.el_.hasAttribute("crossorigin")&&Ds(f.src)&&(n=!0)):u.push(f))}for(let f=0;f<u.length;f++)this.el_.removeChild(u[f])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&n&&Q.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
154This may prevent text tracks from loading.`),this.restoreMetadataTracksInIOSNativePlayer_(),(Ei||_s)&&e.nativeControlsForTouch===!0&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),V.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){nc(this)}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const i=()=>{t=[];for(let a=0;a<e.length;a++){const o=e[a];o.kind==="metadata"&&t.push({track:o,storedMode:o.mode})}};
154i(),e.addEventListener("change",i),this.on("dispose",()=>e.removeEventListener("change",i));const n=()=>{for(let a=0;a<t.length;a++){const o=t[a];o.track.mode==="disabled"&&o.track.mode!==o.storedMode&&(o.track.mode=o.storedMode)}e.removeEventListener("change",n)};this.on("webkitbeginfullscreen",()=>{e.removeEventListener("change",i),e.removeEventListener("change",n),e.addEventListener("change",n)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",i),e.addEventListener("change",i),e.removeEventListener("change",n)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const i=e.toLowerCase();this[`${i}TracksListeners_`]&&Object.keys(this[`${i}TracksListeners_`]).forEach(n=>{this.el()[`${i}Tracks`].removeEventListener(n,this[`${i}TracksListeners_`][n])}),this[`featuresNative${e}Tracks`]=!t,this[`${i}TracksListeners_`]=null,this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=je[e],i=this.el()[t.getterName],n=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!i||!i.addEventListener)return;const a={change:u=>{const f={type:"change",target:n,currentTarget:n,srcElement:n};n.trigger(f),e==="text"&&this[ri.remoteText.getterName]().trigger(f)},addtrack(u){n.addTrack(u.track)},removetrack(u){n.removeTrack(u.track)}},o=function(){const u=[];for(let f=0;f<n.length;f++){let m=!1;for(let g=0;g<i.length;g++)if(i[g]===n[f]){m=!0;break}m||u.push(n[f])}for(;u.length;)n.removeTrack(u.shift())};this[t.getterName+"Listeners_"]=a,Object.keys(a).forEach(u=>{const f=a[u];i.addEventListener(u,f),this.on("dispose",m=>i.removeEventListener(u,f))}),this.on("loadstart",o),this.on("dispose",u=>this.off("loadstart",o))}proxyNativeTracks_(){je.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){const i=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(i,e),V.disposeMediaElement(e),e=i}else{e=U().createElement("video");const i=this.options_.tag&&Tt(this.options_.tag),n=ie({},i);(!Ei||this.options_.nativeControlsForTouch!==!0)&&delete n.controls,Ba(e,Object.assign(n,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload!="undefined"&&ei(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let i=0;i<t.length;i++){const n=t[i],a=this.options_[n];typeof a!="undefined"&&(a?ei(e,n,n):xs(e,n),e[n]=a)}return e}handleLateInit_(e){if(e.networkState===0||e.networkState===3)return;if(e.readyState===0){let i=!1;const n=function(){i=!0};this.on("loadstart",n);const a=function(){i||this.trigger("loadstart")};this.on("loadedmetadata",a),this.ready(function(){this.off("loadstart",n),this.off("loadedmetadata",a),i||this.trigger("loadstart")});return}const t=["loadstart"];t.push("loadedmetadata"),e.readyState>=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(i){this.trigger(i)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&bs?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){Q(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&ze&&Je&&this.el_.currentTime===0){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen=="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)et(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}addSourceElement(e,t){if(!e)return Q.error("Invalid source URL."),!1;const i={src:e};t&&(i.type=t);const n=W("source",{},i);return this.el_.appendChild(n),!0}removeSourceElement(e){if(!e)return Q.error("Source URL is required to remove the source element."),!1;const t=this.el_.querySelectorAll("source");for(const i of t)if(i.src===e)return this.el_.removeChild(i),!0;return Q.warn(`No matching source element found with src: ${e}`),!1}reset(){V.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,i):super.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=U().createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const i=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(i),i}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let i=t.length;for(;i--;)(e===t[i]||e===t[i].track)&&this.el().removeChild(t[i])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();const e={};return typeof this.el().webkitDroppedFrameCount!="undefined"&&typeof this.el().webkitDecodedFrameCount!="undefined"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),S().performance&&(e.creationTime=S().performance.now()),e}}cs(V,"TEST_VID",function(){if(!Jt())return;const s=U().createElement("video"),e=U().createElement("track");return e.kind="captions",e.srclang="en",e.label="English",s.appendChild(e),s}),V.isSupported=function(){try{V.TEST_VID.volume=.5}catch(s){return!1}return!!(V.TEST_VID&&V.TEST_VID.canPlayType)},V.canPlayType=function(s){return V.TEST_VID.canPlayType(s)},V.canPlaySource=function(s,e){return V.canPlayType(s.type)},V.canControlVolume=function(){try{const s=V.TEST_VID.volume;V.TEST_VID.volume=s/2+.1;const e=s!==V.TEST_VID.volume;return e&&ve?(S().setTimeout(()=>{V&&V.prototype&&(V.prototype.featuresVolumeControl=s!==V.TEST_VID.volume)}),!1):e}catch(s){return!1}},V.canMuteVolume=function(){try{const s=V.TEST_VID.muted;return V.TEST_VID.muted=!s,V.TEST_VID.muted?ei(V.TEST_VID,"muted","muted"):xs(V.TEST_VID,"muted","muted"),s!==V.TEST_VID.muted}catch(s){return!1}},V.canControlPlaybackRate=function(){if(ze&&Je&&fs<58)return!1;try{const s=V.TEST_VID.playbackRate;return V.TEST_VID.playbackRate=s/2+.1,s!==V.TEST_VID.playbackRate}catch(s){return!1}},V.canOverrideAttributes=function(){try{const s=()=>{};Object.defineProperty(U().createElement("video"),"src",{get:s,set:s}),Object.defineProperty(U().createElement("audio"),"src",{get:s,set:s}),Object.defineProperty(U().createElement("video"),"innerHTML",{get:s,set:s}),Object.defineProperty(U().createElement("audio"),"innerHTML",{get:s,set:s})}catch(s){return!1}return!0},V.supportsNativeTextTracks=function(){return bs||ve&&Je},V.supportsNativeVideoTracks=function(){return!!(V.TEST_VID&&V.TEST_VID.videoTracks)},V.supportsNativeAudioTracks=function(){return!!(V.TEST_VID&&V.TEST_VID.audioTracks)},V.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEac
154h(function([s,e]){cs(V.prototype,s,()=>V[e](),!0)}),V.prototype.featuresVolumeControl=V.canControlVolume(),V.prototype.movingMediaElementInDOM=!ve,V.prototype.featuresFullscreenResize=!0,V.prototype.featuresProgressEvents=!0,V.prototype.featuresTimeupdateEvents=!0,V.prototype.featuresVideoFrameCallback=!!(V.TEST_VID&&V.TEST_VID.requestVideoFrameCallback),V.disposeMediaElement=function(s){if(s){for(s.parentNode&&s.parentNode.removeChild(s);s.hasChildNodes();)s.removeChild(s.firstChild);s.removeAttribute("src"),typeof s.load=="function"&&(function(){try{s.load()}catch(e){}})()}},V.resetMediaElement=function(s){if(!s)return;const e=s.querySelectorAll("source");let t=e.length;for(;t--;)s.removeChild(e[t]);s.removeAttribute("src"),typeof s.load=="function"&&(function(){try{s.load()}catch(i){}})()},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(s){V.prototype[s]=function(){return this.el_[s]||this.el_.hasAttribute(s)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(s){V.prototype["set"+pe(s)]=function(e){this.el_[s]=e,e?this.el_.setAttribute(s,s):this.el_.removeAttribute(s)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(s){V.prototype[s]=function(){return this.el_[s]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(s){V.prototype["set"+pe(s)]=function(e){this.el_[s]=e}}),["pause","load","play"].forEach(function(s){V.prototype[s]=function(){return this.el_[s]()}}),K.withSourceHandlers(V),V.nativeSourceHandler={},V.nativeSourceHandler.canPlayType=function(s){try{return V.TEST_VID.canPlayType(s)}catch(e){return""}},V.nativeSourceHandler.canHandleSource=function(s,e){if(s.type)return V.nativeSourceHandler.canPlayType(s.type);if(s.src){const t=Jn(s.src);return V.nativeSourceHandler.canPlayType(`video/${t}`)}return""},V.nativeSourceHandler.handleSource=function(s,e,t){e.setSrc(s.src)},V.nativeSourceHandler.dispose=function(){},V.registerSourceHandler(V.nativeSourceHandler),K.registerTech("Html5",V);const hl=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],br={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Sr=["tiny","xsmall","small","medium","large","xlarge","huge"],Ns={};Sr.forEach(s=>{const e=s.charAt(0)==="x"?`x-${s.substring(1)}`:s;Ns[s]=`vjs-layout-${e}`});const rc={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class X extends I{constructor(e,t,i){if(e.id=e.id||t.id||`vjs_video_${Fe()}`,t=Object.assign(X.getTagSettings(e),t),t.initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const o=e.closest("[lang]");o&&(t.language=o.getAttribute("lang"))}if(super(null,t,i),this.boundDocumentFullscreenChange_=o=>this.documentFullscreenChange_(o),this.boundFullWindowOnEscKey_=o=>this.fullWindowOnEscKey(o),this.boundUpdateStyleEl_=o=>this.updateStyleEl_(o),this.boundApplyInitTime_=o=>this.applyInitTime_(o),this.boundUpdateCurrentBreakpoint_=o=>this.updateCurrentBreakpoint_(o),this.boundHandleTechClick_=o=>this.handleTechClick_(o),this.boundHandleTechDoubleClick_=o=>this.handleTechDoubleClick_(o),this.boundHandleTechTouchStart_=o=>this.handleTechTouchStart_(o),this.boundHandleTechTouchMove_=o=>this.handleTechTouchMove_(o),this.boundHandleTechTouchEnd_=o=>this.handleTechTouchEnd_(o),this.boundHandleTechTap_=o=>this.handleTechTap_(o),this.boundUpdatePlayerHeightOnAudioOnlyMode_=o=>this.updatePlayerHeightOnAudioOnlyMode_(o),this.isFullscreen_=!1,this.log=Ca(this.id_),this.fsApi_=ds,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&Tt(e),this.language(this.options_.language),t.languages){const o={};
154Object.getOwnPropertyNames(t.languages).forEach(function(u){o[u.toLowerCase()]=t.languages[u]}),this.languages_=o}else this.languages_=X.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(o=>{if(typeof this[o]!="function")throw new Error(`plugin "${o}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),$n(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(Oe(U(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const n=ie(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(o=>{this[o](t.plugins[o])}),t.debug&&this.debug(!0),this.options_.playerOptions=n,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const u=new(S()).DOMParser().parseFromString(Iu,"image/svg+xml");if(u.querySelector("parsererror"))Q.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const m=u.documentElement;m.style.display="none",this.el_.appendChild(m),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()==="audio"),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new Pu(this),this.addClass("vjs-spatial-navigation-enabled")),Ei&&this.addClass("vjs-touch-enabled"),ve||this.addClass("vjs-workinghover"),X.players[this.id_]=this;const a=In.split(".")[0];this.addClass(`vjs-v${a}`),this.userActive(!0),this.reportUserActivity(),this.one("play",o=>this.listenForUserActivity_(o)),this.on("keydown",o=>this.handleKeyDown(o)),this.on("languagechange",o=>this.handleLanguagechange(o)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),be(U(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),be(U(),"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),X.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),Cu(this),ke.names.forEach(e=>{const t=ke[e],i=this[t.getterName]();i&&i.off&&i.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,t,i=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player");const n=this.tag.tagName.toLowerCase()==="video-js";i?t=this.el_=e.parentNode:n||(t=this.el_=super.createEl("div"));const a=Tt(e);if(n){for(t=this.el_=e,e=this.tag=U().createElement("video");t.children.length;)e.appendChild(t.firstChild);ki(t,"video-js")||Lt(t,"video-js"),t.appendChild(e),i=this.playerElIngest_=t,Object.keys(t).forEach(f=>{try{e[f]=t[f]}catch(m){}})}e.setAttribute("tabindex","-1"),a.tabindex="-1",Je&&ms&&(e.setAttribute("role","application"),a.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in a&&delete a.width,"height"in a&&delete a.height,Object.getOwnPropertyNames(a).forEach(function(f){n&&f==="class"||t.setAttribute(f,a[f]),n&&e.setAttribute(f,a[f])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=t.player=this,this.addClass("vjs-paused");const o=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(f=>Da[f]).map(f=>"vjs-device-"+f.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...o),S().VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=Ka("vjs-styles-dimensions");const f=vt(".vjs-styles-defaults"),m=vt("head");m.insertBefore(this.styleEl_,f?f.nextSibling:m.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const u=e.getElementsByTagName("a");for(let f=0;f<u.length;f++){const m=u.item(f);Lt(m,"vjs-hidden"),m.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!i&&e.parentNode.insertBefore(t,e),Dn(e,t),this.children_.unshift(e),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=t,t}crossOrigin(e){if(typeof e=="undefined")return this.techGet_("crossOrigin");if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){Q.warn(`crossOrigin must be null,  "anonymous" or "use-credentials", given "${e}"`);return}this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const i=e+"_";if(t===void 0)return this[i]||0;if(t===""||t==="auto"){this[i]=void 0,this.updateStyleEl_();return}const n=parseFloat(t);if(isNaN(n)){Q.error(`Improper value "${t}" supplied for for ${e}`);return}this[i]=n,this.updateStyleEl_()}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,lt(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),nu(this,()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(S().VIDEOJS_NO_DYNAMIC_STYLE===!0){const u=typeof this.width_=="number"?this.width_:this.options_.width,f=typeof this.height_=="number"?this.height_:this.options_.height,m=this.tech_&&this.tech_.el();m&&(u>=0&&(m.width=u),f>=0&&(m.height=f));return}let e,t,i,n;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?i=this.aspectRatio_:this.videoWidth()>0?i=this.videoWidth()+":"+this.videoHeight():i="16:9";const a=i.split(":"),o=a[1]/a[0];this.width_!==void 0?e=this.width_:this.height_!==void 0?e=this.height_/o:e=this.videoWidth()||300,this.height_!==void 0?t=this.height_:t=e*o,/^[^a-zA-Z]/.test(this.id())?n="dimensions-"+this.id():n=this.id()+"-dimensions",this.addClass(n),Qa(this.styleEl_,`
155      .${n} {
156        width: ${e}px;
157        height: ${t}px;
158      }
159
160      .${n}.vjs-fluid:not(.vjs-audio-only-mode) {
161        padding-top: ${o*100}%;
162      }
163    `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const i=pe(e),n=e.charAt(0).toLowerCase()+e.slice(1);i!=="Html5"&&this.tag&&(K.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;let a=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(a=!1);const o={source:t,autoplay:a,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${n}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};
163ke.names.forEach(f=>{const m=ke[f];o[m.getterName]=this[m.privateName]}),Object.assign(o,this.options_[i]),Object.assign(o,this.options_[n]),Object.assign(o,this.options_[e.toLowerCase()]),this.tag&&(o.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(o.startTime=this.cache_.currentTime);const u=K.getTech(e);if(!u)throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`);this.tech_=new u(o),this.tech_.ready(ne(this,this.handleTechReady_),!0),zn.jsonToTextTracks(this.textTracksJson_||[],this.tech_),hl.forEach(f=>{this.on(this.tech_,f,m=>this[`handleTech${pe(f)}_`](m))}),Object.keys(br).forEach(f=>{this.on(this.tech_,f,m=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${br[f]}_`].bind(this),event:m});return}this[`handleTech${br[f]}_`](m)})}),this.on(this.tech_,"loadstart",f=>this.handleTechLoadStart_(f)),this.on(this.tech_,"sourceset",f=>this.handleTechSourceset_(f)),this.on(this.tech_,"waiting",f=>this.handleTechWaiting_(f)),this.on(this.tech_,"ended",f=>this.handleTechEnded_(f)),this.on(this.tech_,"seeking",f=>
163this.handleTechSeeking_(f)),this.on(this.tech_,"play",f=>this.handleTechPlay_(f)),this.on(this.tech_,"pause",f=>this.handleTechPause_(f)),this.on(this.tech_,"durationchange",f=>this.handleTechDurationChange_(f)),this.on(this.tech_,"fullscreenchange",(f,m)=>this.handleTechFullscreenChange_(f,m)),this.on(this.tech_,"fullscreenerror",(f,m)=>this.handleTechFullscreenError_(f,m)),this.on(this.tech_,"enterpictureinpicture",f=>this.handleTechEnterPictureInPicture_(f)),this.on(this.tech_,"leavepictureinpicture",f=>this.handleTechLeavePictureInPicture_(f)),this.on(this.tech_,"error",f=>this.handleTechError_(f)),this.on(this.tech_,"posterchange",f=>this.handleTechPosterChange_(f)),this.on(this.tech_,"textdata",f=>this.handleTechTextData_(f)),this.on(this.tech_,"ratechange",f=>this.handleTechRateChange_(f)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(i!=="Html5"||!this.tag)&&Dn(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){ke.names.forEach(e=>{const t=ke[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=zn.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return e===void 0&&Q.warn(`Using the tech directly can be dangerous. I hope you know 
163what you're doing.
164See https://github.com/videojs/video.js/issues/2617 for more info.
165`),this.tech_}version(){return{"video.js":In}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!="string")return;const t=()=>{const n=this.muted();this.muted(!0);const a=()=>{this.muted(n)};this.playTerminatedQueue_.push(a);const o=this.play();if(Li(o))return o.catch(u=>{throw a(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${u||""}`)})};let i;if(e==="any"&&!this.muted()?(i=this.play(),Li(i)&&(i=i.catch(t))):e==="muted"&&!this.muted()?i=t():i=this.play(),!!Li(i))return i.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e,i="";typeof t!="string"&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=wu(this,t)),this.cache_.source=ie({},e,{src:t,type:i});const n=this.cache_.sources.filter(f=>f.src&&f.src===t),a=[],o=this.$$("source"),u=[];for(let f=0;f<o.length;f++){const m=Tt(o[f]);a.push(m),m.src&&m.src===t&&u.push(m.src)}u.length&&!n.length?this.cache_.sources=a:n.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=a=>this.updateSourceCaches_(a);const i=this.currentSource().src,n=e.src;i&&!/^blob:/.test(i)&&/^blob:/.test(n)&&(!this.lastSource_||this.lastSource_.tech!==n&&this.lastSource_.player!==i)&&(t=()=>{}),t(n),e.src||this.tech_.any(["sourceset","loadstart"],a=>{if(a.type==="sourceset")return;const o=this.techGet_("currentSrc");this.lastSource_.tech=o,this.updateSourceCaches_(o)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}
165handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?et(this.play()):this.pause())}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),i=>i.contains(e.target))||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isInPictureInPicture()&&!U().pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const i=this.el();let n=U()[this.fsApi_.fullscreenElement]===i;!n&&i.matches&&(n=i.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(n)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in Su)return vu(this.middleware_,this.tech_,e,t);if(e in _o)return go(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(i){throw Q(i),i}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in bu)return Tu(this.middleware_,this.tech_,e);if(e in _o)return go(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(Q(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(Q(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(Q(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=et){this.playCallbacks_.push(e);const t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),i=!!(bs||ve);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t){this.waitToPlay_=o=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!t&&i&&this.load();return}const n=this.techGet_("play");i&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),n===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(n)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(t){t()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(i){i(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||We(0,0)}scrubbing(e){if(typeof e=="undefined")return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){if(e===void 0)return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime;if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;e=parseFloat(e),e<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return(!e||!e.length)&&(e=We(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=We(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return ao(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let i=e.end(e.length-1);return i>t&&(i=t),i}volume(e){let t;if(e!==void 0){t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),t>0&&this.lastVolume_(t);return}return t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t}muted(e){if(e!==void 0){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1}defaultMuted(e){return e!==void 0&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(e!==void 0&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(e!==void 0){const t=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((i,n)=>{function a(){t.off("fullscreenerror",u),t.off("fullscreenchange",o)}function o(){a(),i()}function u(m,g){a(),n(g)}t.one("fullscreenchange",o),t.one("fullscreenerror",u);const f=t.requestFullscreenHelper_(e);f&&(f.then(a,a),f.then(i,n))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(t=e)),this.fsApi_.requestFullscreen){const i=this.el_[this.fsApi_.requestFullscreen](t);return i&&i.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),i}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,i)=>{function n(){e.off("fullscreenerror",o),e.off("fullscreenchange",a)}function a(){n(),t()}function o(f,m){n(),i(m)}e.one("fullscreenchange",a),e.one("fullscreenerror",o);const u=e.exitFullscreenHelper_();u&&(u.then(n,n),u.then(t,i))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=U()[this.fsApi_.exitFullscreen]();return e&&et(e.then(()=>this.isFullscreen(!1))),e}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=U().documentElement.style.overflow,Oe(U(),"keydown",this.boundFullWindowOnEscKey_),U().documentElement.style.overflow="hidden",Lt(U().body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){e.key==="Escape"&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,be(U(),"keydown",this.boundFullWindowOnEscKey_),U().documentElement.style.overflow=this.docOrigOverflow,Ss(U().body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(e!==void 0){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&S().documentPictureInPicture){const e=U().createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(W("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),S().documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(za(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",i=>{const n=i.target.querySelector(".video-js");e.parentNode.replaceChild(n,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in U()&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(S().documentPictureInPicture&&S().documentPictureInPicture.window)return S().documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in U())return U().exitPictureInPicture()}handleKeyDown(e){const{userActions:t}=this.options_;!t||!t.hotkeys||(n=>{const a=n.tagName.toLowerCase();if(n.isContentEditable)return!0;const o=["button","checkbox","hidden","radio","reset","submit"];return a==="input"?o.indexOf(n.type)===-1:["textarea"].indexOf(a)!==-1})(this.el_.ownerDocument.activeElement)||(typeof t.hotkeys=="function"?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:i=o=>e.key.toLowerCase()==="f",muteKey:n=o=>e.key.toLowerCase()==="m",playPauseKey:a=o=>e.key.toLowerCase()==="k"||e.key.toLowerCase()===" "}=t;if(i.call(this,e)){e.preventDefault(),e.stopPropagation();const o=I.getComponent("FullscreenToggle");U()[this.fsApi_.fullscreenEnabled]!==!1&&o.prototype.handleClick.call(this,e)}else n.call(this,e)?(e.preventDefault(),e.stopPropagation(),I.getComponent("MuteToggle").prototype.handleClick.call(this,e)):a.call(this,e)&&(e.preventDefault(),e.stopPropagation(),I.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let i=0,n=this.options_.techOrder;i<n.length;i++){const a=n[i];let o=K.getTech(a);if(o||(o=I.getComponent(a)),!o){Q.error(`The "${a}" tech is undefined. Skipped browser support check for that tech.`);continue}if(o.isSupported()&&(t=o.canPlayType(e),t))return t}return""}selectSource(e){const t=this.options_.techOrder.map(u=>[u,K.getTech(u)]).filter(([u,f])=>f?f.isSupported():(Q.error(`The "${u}" tech is undefined. Skipped browser support check for that tech.`),!1)),i=function(u,f,m){let g;return u.some(b=>f.some(C=>{if(g=m(b,C),g)return!0})),g};let n;const a=u=>(f,m)=>u(m,f),o=([u,f],m)=>{if(f.canPlaySource(m,this.options_[u.toLowerCase()]))return{source:m,tech:u}};
165return this.options_.sourceOrder?n=i(e,t,a(o)):n=i(t,e,o),n||!1}handleSrc_(e,t){if(typeof e=="undefined")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const i=yo(e);if(!i.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,t||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),_u(this,i[0],(n,a)=>{if(this.middleware_=a,t||(this.cache_.sources=i),this.updateSourceCaches_(n),this.src_(n)){if(i.length>1)return this.handleSrc_(i.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}yu(a,this.tech_)}),i.length>1){const n=()=>{this.error(null),this.handleSrc_(i.slice(1),!0)},a=()=>{this.off("error",n)};this.one("error",n),this.one("playing",a),this.resetRetryOnError_=()=>{this.off("error",n),this.off("playing",a)}}}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return t?to(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1):!0}addSourceElement(e,t){return this.tech_?this.tech_.addSourceElement(e,t):!1}removeSourceElement(e){return this.tech_?this.tech_.removeSourceElement(e):!1}load(){if(this.tech_&&this.tech_.vhs){this.src(this.currentSource());return}this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{const e=this.play();et(e.then(()=>this.doReset_()))}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),lt(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:n}=this.controlBar||{},{seekBar:a}=i||{};e&&e.updateContent(),t&&t.updateContent(),n&&n.updateContent(),a&&(a.update(),a.loadProgressBar&&a.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return Object.keys(e).length!==0&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(e!==void 0){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){if(e===void 0)return this.options_.autoplay||!1;let t;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),t=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,t=typeof t=="undefined"?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return e!==void 0&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){if(e!==void 0){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")}poster(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControl
165sListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(e===void 0)return this.error_||null;if(mt("beforeerror").forEach(t=>{const i=t(this,e);if(!(Xe(i)&&!Array.isArray(i)||typeof i=="string"||typeof i=="number"||i===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=i}),this.options_.suppressNotSupportedError&&e&&e.code===4){const t=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),this.one("loadstart",function(){this.off(["click","touchstart"],t)});return}if(e===null){this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new ce(e),this.addClass("vjs-error"),Q.error(`(CODE:${this.error_.code} ${ce.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),mt("error").forEach(t=>t(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,i;const n=ne(this,this.reportUserActivity),a=function(b){(b.screenX!==t||b.screenY!==i)&&(t=b.screenX,i=b.screenY,n())},o=function(){n(),this.clearInterval(e),e=this.setInterval(n,250)},u=function(b){n(),this.clearInterval(e)};this.on("mousedown",o),this.on("mousemove",a),this.on("mouseup",u),this.on("mouseleave",u);const f=this.getChild("controlBar");f&&!ve&&!ze&&(f.on("mouseenter",function(b){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),f.on("mouseleave",function(b){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",n),this.on("keyup",n);let m;const g=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(m);const b=this.options_.inactivityTimeout;b<=0||(m=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},b))};this.setInterval(g,250)}playbackRate(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1}defaultPlaybackRate(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");!e||this.audioOnlyCache_.controlBarHeight===e.currentHeight()||(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),i=t&&t.currentHeight();e.forEach(n=>{n!==t&&n.el_&&!n.hasClass("vjs-hidden")&&(n.hide(),this.audioOnlyCache_.hiddenChildren.push(n))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=i,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(i),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEac
165h(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const t=[];return this.isInPictureInPicture()&&t.push(this.exitPictureInPicture()),this.isFullscreen()&&t.push(this.exitFullscreen()),this.audioPosterMode()&&t.push(this.audioPosterMode(!1)),Promise.all(t).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return typeof e!="boolean"||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),lt(this)&&this.trigger("languagechange"))}languages(){return ie(X.prototype.options_.languages,this.languages_)}toJSON(){const e=ie(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i<t.length;i++){let n=t[i];n=ie(n),n.player=void 0,e.tracks[i]=n}return e}createModal(e,t){t=t||{},t.content=e||"";const i=new ni(this,t);return this.addChild(i),i.on("dispose",()=>{this.removeChild(i)}),i.open(),i}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let i=0;i<Sr.length;i++){const n=Sr[i],a=this.breakpoints_[n];if(t<=a){if(e===n)return;e&&this.removeClass(Ns[e]),this.addClass(Ns[n]),this.breakpoint_=n;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return e===void 0?Object.assign(this.breakpoints_):(this.removeCurrentBreakpoint_(),this.breakpoints_=Object.assign({},rc,e),this.updateCurrentBreakpoint_(),Object.assign(this.breakpoints_))}responsive(e){if(e===void 0)return this.responsive_;e=!!e;const t=this.responsive_;if(e!==t)return this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return Ns[this.breakpoint_]||""}loadMedia(e,t){if(!e||typeof e!="object")return;const i=this.crossOrigin();this.reset(),this.cache_.media=ie(e);const{artist:n,artwork:a,description:o,poster:u,src:f,textTracks:m,title:g}=this.cache_.media;!a&&u&&(this.cache_.media.artwork=[{src:u,type:Rs(u)}]),i&&this.crossOrigin(i),f&&this.src(f),u&&this.poster(u),Array.isArray(m)&&m.forEach(b=>this.addRemoteTextTrack(b,!1)),this.titleBar&&this.titleBar.update({title:g,description:o||n||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t=this.currentSources(),i=Array.prototype.map.call(this.remoteTextTracks(),a=>({kind:a.kind,label:a.label,language:a.language,src:a.src})),n={src:t,textTracks:i};return e&&(n.poster=e,n.artwork=[{src:n.poster,type:Rs(n.poster)}]),n}return ie(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},i=Tt(e),n=i["data-setup"];if(ki(e,"vjs-fill")&&(i.fill=!0),ki(e,"vjs-fluid")&&(i.fluid=!0),n!==null)try{Object.assign(i,JSON.parse(n||"{}"))}catch(a){Q.error("data-setup",a)}if(Object.assign(t,i),e.hasChildNodes()){const a=e.childNodes;for(let o=0,u=a.length;o<u;o++){const f=a[o],m=f.nodeName.toLowerCase();m==="source"?t.sources.push(Tt(f)):m==="track"&&t.tracks.push(Tt(f))}}return t}debug(e){if(e===void 0)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(e){if(e===void 0)return this.cache_.playbackRates;Array.isArray(e)&&e.every(t=>typeof t=="number")&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}X.prototype.videoTracks=()=>{},X.prototype.audioTracks=()=>{},X.prototype.textTracks=()=>{},X.prototype.remoteTextTracks=()=>{},X.prototype.remoteTextTrackEls=()=>{}
165,ke.names.forEach(function(s){const e=ke[s];X.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}}),X.prototype.crossorigin=X.prototype.crossOrigin,X.players={};const Ui=S().navigator;X.prototype.options_={techOrder:K.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Ui&&(Ui.languages&&Ui.languages[0]||Ui.userLanguage||Ui.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1,disableSeekWhileScrubbingOnMobile:!1,disableSeekWhileScrubbingOnSTV:!1},hl.forEach(function(s){X.prototype[`handleTech${pe(s)}_`]=function(){return this.trigger(s)}}),I.registerComponent("Player",X);const js="plugin",hi="activePlugins_",di={},$s=s=>di.hasOwnProperty(s),Hs=s=>$s(s)?di[s]:void 0,dl=(s,e)=>{s[hi]=s[hi]||{},s[hi][e]=!0},Vs=(s,e,t)=>{const i=(t?"before":"")+"pluginsetup";s.trigger(i,e),s.trigger(i+":"+e.name,e)},ac=function(s,e){const t=function(){Vs(this,{name:s,plugin:e,instance:null},!0);const i=e.apply(this,arguments);return dl(this,s),Vs(this,{name:s,plugin:e,instance:i}),i};return Object.keys(e).forEach(function(i){t[i]=e[i]}),t},ul=(s,e)=>(e.prototype.name=s,function(...t){Vs(this,{name:s,plugin:e,instance:null},!0);const i=new e(this,...t);return this[s]=()=>i,Vs(this,i.getEventHash()),i});class Pe{constructor(e){if(this.constructor===Pe)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),$n(this),delete this.trigger,eo(this,this.constructor.defaultState),dl(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return si(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[hi][e]=!1,this.player=this.state=null,t[e]=ul(e,di[e])}static isBasic(e){const t=typeof e=="string"?Hs(e):e;return typeof t=="function"&&!Pe.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if(typeof e!="string")throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if($s(e))Q.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(X.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof t!="function")throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return di[e]=t,e!==js&&(Pe.isBasic(t)?X.prototype[e]=ac(e,t):X.prototype[e]=ul(e,t)),t}static deregisterPlugin(e){if(e===js)throw new Error("Cannot de-register base plugin.");$s(e)&&(delete di[e],delete X.prototype[e])}static getPlugins(e=Object.keys(di)){let t;return e.forEach(i=>{const n=Hs(i);n&&(t=t||{},t[i]=n)}),t}static getPluginVersion(e){const t=Hs(e);return t&&t.VERSION||""}}Pe.getPlugin=Hs,Pe.BASE_PLUGIN_NAME=js,Pe.registerPlugin(js,Pe),X.prototype.usingPlugin=function(s){return!!this[hi]&&this[hi][s]===!0},X.prototype.hasPlugin=function(s){return!!$s(s)};function oc(s,e){let t=!1;return function(...i){return t||Q.warn(s),t=!0,e.apply(this,i)}}function Ge(s,e,t,i){return oc(`${e} is deprecated and will be removed in ${s}.0; please use ${t} instead.`,i)}var lc={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};const cl=s=>s.indexOf("#")===0?s.slice(1):s;function E(s,e,t){let i=E.getPlayer(s);if(i)return e&&Q.warn(`Player "${s}" is already initialised. Options will not be applied.`),t&&i.ready(t),i;const n=typeof s=="string"?vt("#"+cl(s)):s;if(!Zt(n))throw new TypeError("The element or ID supplied is not val
165id. (videojs)");const o=("getRootNode"in n?n.getRootNode()instanceof S().ShadowRoot:!1)?n.getRootNode():n.ownerDocument.body;(!n.ownerDocument.defaultView||!o.contains(n))&&Q.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(n.parentNode&&n.parentNode.hasAttribute&&n.parentNode.hasAttribute("data-vjs-player")?n.parentNode:n).cloneNode(!0)),mt("beforesetup").forEach(f=>{const m=f(n,ie(e));if(!Xe(m)||Array.isArray(m)){Q.error("please return an object in beforesetup hooks");return}e=ie(e,m)});const u=I.getComponent("Player");return i=new u(n,e,t),mt("setup").forEach(f=>f(i)),i}if(E.hooks_=ot,E.hooks=mt,E.hook=zd,E.hookOnce=Wd,E.removeHook=Sa,S().VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Jt()){let s=vt(".vjs-styles-defaults");if(!s){s=Ka("vjs-styles-defaults");const e=vt("head");e&&e.insertBefore(s,e.firstChild),Qa(s,`
166      .video-js {
167        width: 300px;
168        height: 150px;
169      }
170
171      .vjs-fluid:not(.vjs-audio-only-mode) {
172        padding-top: 56.25%
173      }
174    `)}}Rn(1,E),E.VERSION=In,E.options=X.prototype.options_,E.getPlayers=()=>X.players,E.getPlayer=s=>{const e=X.players;let t;if(typeof s=="string"){const i=cl(s),n=e[i];if(n)return n;t=vt("#"+i)}else t=s;if(Zt(t)){const{player:i,playerId:n}=t;if(i||e[n])return i||e[n]}},E.getAllPlayers=()=>Object.keys(X.players).map(s=>X.players[s]).filter(Boolean),E.players=X.players,E.getComponent=I.getComponent,E.registerComponent=(s,e)=>(K.isTech(e)&&Q.warn(`The ${s} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),I.registerComponent.call(I,s,e)),E.getTech=K.getTech,E.registerTech=K.registerTech,E.use=gu,Object.defineProperty(E,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(E.middleware,"TERMINATOR",{value:Ms,writeable:!1,enumerable:!0}),E.browser=Da,E.obj=Qd,E.mergeOptions=Ge(9,"videojs.mergeOptions","videojs.obj.merge",ie),E.defineLazyProperty=Ge(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",cs),E.bind=Ge(9,"videojs.bind","native Function.prototype.bind",ne),E.registerPlugin=Pe.registerPlugin,E.deregisterPlugin=Pe.deregisterPlugin,E.plugin=(s,e)=>(Q.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Pe.registerPlugin(s,e)),E.getPlugins=Pe.getPlugins,E.getPlugin=Pe.getPlugin,E.getPluginVersion=Pe.getPluginVersion,E.addLanguage=function(s,e){return s=(""+s).toLowerCase(),E.options.languages=ie(E.options.languages,{[s]:e}),E.options.languages[s]},E.log=Q,E.createLogger=Ca,E.time=hu,E.createTimeRange=Ge(9,"videojs.createTimeRange","videojs.time.createTimeRanges",We),E.createTimeRanges=Ge(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",We),E.formatTime=Ge(9,"videojs.formatTime","videojs.time.formatTime",Ot),E.setFormatTime=Ge(9,"videojs.setFormatTime","videojs.time.setFormatTime",no),E.resetFormatTime=Ge(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",ro),E.parseUrl=Ge(9,"videojs.parseUrl","videojs.url.parseUrl",Xn),E.isCrossOrigin=Ge(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",Ds),E.EventTarget=Me,E.any=Fn,E.on=Oe,E.one=Is,E.off=be,E.trigger=si,E.xhr=Ta(),E.TrackList=Mt,E.TextTrack=Di,E.TextTrackList=Qn,E.AudioTrack=po,E.AudioTrackList=oo,E.VideoTrack=mo,E.VideoTrackList=lo,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(s=>{E[s]=function(){return Q.warn(`videojs.${s}() is deprecated; use videojs.dom.${s}() instead`),Wa[s].apply(null,arguments)}}),E.computedStyle=Ge(9,"videojs.computedStyle","videojs.dom.computedStyle",ii),E.dom=Wa,E.fn=su,E.num=Bu,E.str=ou,E.url=pu,E.Error=lc;/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */class hc{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get(){return t.enabled_()},set(i){t.enabled_(i)}}),t}}class qs extends E.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}}),Object.defineProperty(e,"length",{get(){return e.levels_.length}}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const i=this.levels_.length;return t=new hc(e),""+i in this||Object.defineProperty(this,i,{get(){return this.levels_[i]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let i=0,n=this.length;i<n;i++)if(this[i]===e){t=this.levels_.splice(i,1)[0],this.selectedIndex_===i?this.selectedIndex_=-1:this.selectedIndex_>i&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,i=this.length;t<i;t++){const n=this[t];if(n.id===e)return n}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}qs.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const s in qs.prototype.allowedEvents_)qs.prototype["on"+s]=null;var fl="4.1.0";const dc=function(s,e){const t=s.qualityLevels,i=new qs,n=function(){i.dispose(),s.qualityLevels=t,s.off("dispose",n)};return s.on("dispose",n),s.qualityLevels=()=>i,s.qualityLevels.VERSION=fl,i},pl=function(s){return dc(this,E.obj.merge({},s))};E.registerPlugin("qualityLevels",pl),pl.VERSION=fl;/*! @name @videojs/http-streaming @version 3.17.5 @license Apache-2.0 */const Ae=jd.A,zs=(s,e)=>e&&e.responseURL&&s!==e.responseURL?e.responseURL:s,He=s=>E.log.debug?E.log.debug.bind(E,"VHS:",`${s} >`):function(){};function J(...s){const e=E.obj||E;return(e.merge||e.mergeOptions).apply(e,s)}function ge(...s){const e=E.time||E;return(e.createTimeRanges||e.createTimeRanges).apply(e,s)}
174function uc(s){if(s.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges: 
175`;for(let t=0;t<s.length;t++){const i=s.start(t),n=s.end(t);e+=`${i} --> ${n}. Duration (${n-i})
176`}return e}const it=1/30,st=it*3,ml=function(s,e){const t=[];let i;if(s&&s.length)for(i=0;i<s.length;i++)e(s.start(i),s.end(i))&&t.push([s.start(i),s.end(i)]);return ge(t)},ui=function(s,e){return ml(s,function(t,i){return t-st<=e&&i+st>=e})},Ws=function(s,e){return ml(s,function(t){return t-it>=e})},cc=function(s){if(s.length<2)return ge();const e=[];for(let t=1;t<s.length;t++){const i=s.end(t-1),n=s.start(t);e.push([i,n])}return ge(e)},fc=function(s,e){let t=null,i=null,n=0;const a=[],o=[];if(!s||!s.length||!e||!e.length)return ge();let u=s.length;for(;u--;)a.push({time:s.start(u),type:"start"}),a.push({time:s.end(u),type:"end"});for(u=e.length;u--;)a.push({time:e.start(u),type:"start"}),a.push({time:e.end(u),type:"end"});for(a.sort(function(f,m){return f.time-m.time}),u=0;u<a.length;u++)a[u].type==="start"?(n++,n===2&&(t=a[u].time)):a[u].type==="end"&&(n--,n===1&&(i=a[u].time)),t!==null&&i!==null&&(o.push([t,i]),t=null,i=null);return ge(o)},gl=s=>{const e=[];if(!s||!s.length)return"";for(let t=0;t<s.length;t++)e.push(s.start(t)+" => "+s.end(t));return e.join(", ")},pc=function(s,e,t=1){return((s.length?s.end(s.length-1):0)-e)/t},Ft=s=>{const e=[];for(let t=0;t<s.length;t++)e.push({start:s.start(t),end:s.end(t)});return e},mc=function(s,e){if(s===e)return!1;if(!s&&e||!e&&s||s.length!==e.length)return!0;for(let t=0;t<s.length;t++)if(s.start(t)!==e.start(t)||s.end(t)!==e.end(t))return!0;return!1},xr=function(s){if(!(!s||!s.length||!s.end))return s.end(s.length-1)},Cr=function(s,e){let t=0;if(!s||!s.length)return t;for(let i=0;i<s.length;i++){const n=s.start(i),a=s.end(i);if(!(e>a)){if(e>n&&e<=a){t+=a-e;continue}t+=a-n}}return t},Er=(s,e)=>{if(!e.preload)return e.duration;let t=0;return(e.parts||[]).forEach(function(i){t+=i.duration}),(e.preloadHints||[]).forEach(function(i){i.type==="PART"&&(t+=s.partTargetDuration)}),t},kr=s=>(s.segments||[]).reduce((e,t,i)=>(t.parts?t.parts.forEach(function(n,a){e.push({duration:n.duration,segmentIndex:i,partIndex:a,part:n,segment:t})}):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e),[]),_l=s=>{const e=s.segments&&s.segments.length&&s.segments[s.segments.length-1];return e&&e.parts||[]},yl=({preloadSegment:s})=>{if(!s)return;const{parts:e,preloadHints:t}=s;let i=(t||[]).reduce((n,a)=>n+(a.type==="PART"?1:0),0);return i+=e&&e.length?e.length:0,i},Tl=(s,e)=>{if(e.endList)return 0;if(s&&s.suggestedPresentationDelay)return s.suggestedPresentationDelay;const t=_l(e).length>0;return t&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:t&&e.partTargetDuration?e.partTargetDuration*3:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?e.targetDuration*3:0},gc=function(s,e){let t=0,i=e-s.mediaSequence,n=s.segments[i];if(n){if(typeof n.start!="undefined")return{result:n.start,precise:!0};if(typeof n.end!="undefined")return{result:n.end-n.duration,precise:!0}}for(;i--;){if(n=s.segments[i],typeof n.end!="undefined")return{result:t+n.end,precise:!0};if(t+=Er(s,n),typeof n.start!="undefined")return{result:t+n.start,precise:!0}}return{result:t,precise:!1}},_c=function(s,e){let t=0,i,n=e-s.mediaSequence;for(;n<s.segments.length;n++){if(i=s.segments[n],typeof i.start!="undefined")return{result:i.start-t,precise:!0};if(t+=Er(s,i),typeof i.end!="undefined")return{result:i.end-t,precise:!0}}return{result:-1,precise:!1}},vl=function(s,e,t){if(typeof e=="undefined"&&(e=s.mediaSequence+s.segments.length),e<s.mediaSequence)return 0;const i=gc(s,e);if(i.precise)return i.result;const n=_c(s,e);return n.precise?n.result:i.result+t},bl=function(s,e,t){if(!s)return 0;if(typeof t!="number"&&(t=0),typeof e=="undefined"){if(s.totalDuration)return s.totalDuration;if(!s.endList)return S()[1/0]}return vl(s,e,t)},Bi=function({defaultDuration:s,durationList:e,startIndex:t,endIndex:i}){let n=0;if(t>i&&([t,i]=[i,t]),t<0){for(let a=t;a<Math.min(0,i);a++)n+=s;t=0}for(let a=t;a<i;a++)n+=e[a].duration;return n},Sl=function(s,e,t,i){if(!s||!s.segments)return null;if(s.endList)return bl(s);if(e===null)return null;e=e||0;let n=vl(s,s.mediaSequence+s.segments.length,e);return t&&(i=typeof i=="number"?i:Tl(null,s),n-=i),Math.max(0,n)},yc=function(s,e,t){const n=e||0;let a=Sl(s,e,!0,t);return a===null?ge():(a<n&&(a=n),ge(n,a))},Tc=function({playlist:s,currentTime:e,startingSegmentIndex:t,startingPartIndex:i,startTime:n,exactManifestTimings:a}){let o=e-n;const u=kr(s);let f=0;for(let m=0;m<u.length;m++){const g=u[m];if(t===g.segmentIndex&&!(typeof i=="number"&&typeof g.partIndex=="number"&&i!==g.partIndex)){f=m;break}}if(o<0){if(f>0)for(let m=f-1;m>=0;m--){const g=u[m];if(o+=g.duration,a){if(o<0)continue}else if(o+it<=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:n-Bi({defaultDuration:s.targetDuration,durationList:u,startIndex:f,endIndex:m})}}return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:e}}if(f<0){for(let m=f;m<0;m++)if(o-=s.targetDuration,o<0)return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:e};f=0}for(let m=f;m<u.length;m++){const g=u[m];o-=g.duration;const b=g.duration>it,C=o===0,k=b&&o+it>=0;if(!((C||k)&&m!==u.length-1)){if(a){if(o>0)continue}else if(o-it>=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:n+Bi({defaultDuration:s.targetDuration,durationList:u,startIndex:f,endIndex:m})}}}return{segmentIndex:u[u.length-1].segmentIndex,partIndex:u[u.length-1].partIndex,startTime:e}},xl=function(s){return s.excludeUntil&&s.excludeUntil>Date.now()},wr=function(s){return s.excludeUntil&&s.excludeUntil===1/0},Gs=function(s){const e=xl(s);return!s.disabled&&!e},vc=function(s){return s.disabled},bc=function(s){for(let e=0;e<s.segments.length;e++)if(s.segments[e].key)return!0;return!1},Cl=function(s,e){return e.attributes&&e.attributes[s]},Sc=function(s,e,t,i=0){return Cl("BANDWIDTH",t)?(s*t.attributes.BANDWIDTH-i*8)/e:NaN},Ir=(s,e)=>{if(s.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return s.playlists.filter(i=>Gs(i)?(i.attributes.BANDWIDTH||0)<t:!1).length===0},Pr=(s,e)=>!s&&!e||!s&&e||s&&!e?!1:!!(s===e||s.id&&e.id&&s.id===e.id||s.resolvedUri&&e.resolvedUri&&s.resolvedUri===e.resolvedUri||s.uri&&e.uri&&s.uri===e.uri),El=function(s,e){const t=s&&s.mediaGroups&&s.mediaGroups.AUDIO||{};let i=!1;for(const n in t){for(const a in t[n])if(i=e(t[n][a]),i)break;if(i)break}return!!i},Fi=s=>{if(!s||!s.playlists||!s.playlists.length)return El(s,t=>t.playlists&&t.playlists.length||t.uri);for(let e=0;e<s.playlists.length;e++){const t=s.playlists[e],i=t.attributes&&t.attributes.CODECS;if(!(i&&i.split(",").every(a=>(0,se.fz)(a))||El(s,a=>Pr(t,a))))return!1}return!0};var Le={liveEdgeDelay:Tl,duration:bl,seekable:yc,getMediaInfoForTime:Tc,isEnabled:Gs,isDisabled:vc,isExcluded:xl,isIncompatible:wr,playlistEnd:Sl,isAes:bc,hasAttribute:Cl,estimateSegmentRequestTime:Sc,isLowestEnabledRendition:Ir,isAudioOnly:Fi,playlistMatch:Pr,segmentDurationWithParts:Er};const{log:kl}=E,ci=(s,e)=>`${s}-${e}`,wl=(s,e,t)=>`placeholder-uri-${s}-${e}-${t}`,xc=({onwarn:s,oninfo:e,manifestString:t,customTagParsers:i=[],customTagMappers:n=[],llhls:a})=>{const o=new $d.iX;
176s&&o.on("warn",s),e&&o.on("info",e),i.forEach(m=>o.addParser(m)),n.forEach(m=>o.addTagMapper(m)),o.push(t),o.end();const u=o.manifest;if(a||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(m){u.hasOwnProperty(m)&&delete u[m]}),u.segments&&u.segments.forEach(function(m){["parts","preloadHints"].forEach(function(g){m.hasOwnProperty(g)&&delete m[g]})})),!u.targetDuration){let m=10;u.segments&&u.segments.length&&(m=u.segments.reduce((g,b)=>Math.max(g,b.duration),0)),s&&s({message:`manifest has no targetDuration defaulting to ${m}`}),u.targetDuration=m}const f=_l(u);if(f.length&&!u.partTargetDuration){const m=f.reduce((g,b)=>Math.max(g,b.duration),0);s&&(s({message:`manifest has no partTargetDuration defaulting to ${m}`}),kl.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),u.partTargetDuration=m}return u},fi=(s,e)=>{s.mediaGroups&&["AUDIO","SUBTITLES"].forEach(t=>{if(s.mediaGroups[t])for(const i in s.mediaGroups[t])for(const n in s.mediaGroups[t][i]){const a=s.mediaGroups[t][i][n];e(a,t,i,n)}})},Il=({playlist:s,uri:e,id:t})=>{s.id=t,s.playlistErrors_=0,e&&(s.uri=e),s.attributes=s.attributes||{}},Cc=s=>{let e=s.playlists.length;for(;e--;){const t=s.playlists[e];Il({playlist:t,id:ci(e,t.uri)}),t.resolvedUri=Ae(s.uri,t.uri),s.playlists[t.id]=t,s.playlists[t.uri]=t,t.attributes.BANDWIDTH||kl.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},Ec=s=>{fi(s,e=>{e.uri&&(e.resolvedUri=Ae(s.uri,e.uri))})},kc=(s,e)=>{const t=ci(0,e),i={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:S().location.href,resolvedUri:S().location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return i.playlists[t]=i.playlists[0],i.playlists[e]=i.playlists[0],i},Pl=(s,e,t=wl)=>{s.uri=e;for(let n=0;n<s.playlists.length;n++)if(!s.playlists[n].uri){const a=`placeholder-uri-${n}`;s.playlists[n].uri=a}const i=Fi(s);fi(s,(n,a,o,u)=>{if(!n.playlists||!n.playlists.length){if(i&&a==="AUDIO"&&!n.uri)for(let f=0;f<s.playlists.length;f++){const m=s.playlists[f];if(m.attributes&&m.attributes.AUDIO&&m.attributes.AUDIO===o)return}n.playlists=[(0,Ce.A)({},n)]}
176n.playlists.forEach(function(f,m){const g=t(a,o,u,f),b=ci(m,g);f.uri?f.resolvedUri=f.resolvedUri||Ae(s.uri,f.uri):(f.uri=m===0?g:b,f.resolvedUri=f.uri),f.id=f.id||b,f.attributes=f.attributes||{},s.playlists[f.id]=f,s.playlists[f.uri]=f})}),Cc(s),Ec(s)};class Al{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(this.offset_!==null||!e.length)return;const[t]=e;t.programDateTime!==void 0&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;const[t]=e,i=t.startDate.getTime();this.trimProcessedDateRanges_(i),this.pendingDateRanges_=e.reduce((n,a)=>(n.set(a.id,a),n),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];const e={},t=[];this.pendingDateRanges_.forEach((i,n)=>{if(!this.processedDateRanges_.has(n)&&(i.startTime=i.startDate.getTime()/1e3-this.offset_,i.processDateRange=()=>this.processDateRange(i),t.push(i),!!i.class))if(e[i.class]){const a=e[i.class].push(i);i.classListIndex=a-1}else e[i.class]=[i],i.classListIndex=0});for(const i of t){const n=e[i.class]||[];i.endDate?i.endTime=i.endDate.getTime()/1e3-this.offset_:i.endOnNext&&n[i.classListIndex+1]?i.endTime=n[i.classListIndex+1].startTime:i.duration?i.endTime=i.startTime+i.duration:i.plannedDuration?i.endTime=i.startTime+i.plannedDuration:i.endTime=i.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((i,n)=>{i.startDate.getTime()<e&&this.processedDateRanges_.delete(n)})}}const Ll=22,Nt=({requestType:s,request:e,error:t,parseFailure:i})=>{const n=e.status<200||e.status>299,a=e.status>=400&&e.status<=499,o={uri:e.uri,requestType:s},u=n&&!a||i;if(t&&a)o.error=(0,Ce.A)({},t),o.errorType=E.Error.NetworkRequestFailed;else if(e.aborted)o.errorType=E.Error.NetworkRequestAborted;else if(e.timedout)o.errorType=E.Error.NetworkRequestTimeout;else if(u){const f=i?E.Error.NetworkBodyParserFailed:E.Error.NetworkBadStatus;o.errorType=f,o.status=e.status,o.headers=e.headers}return o},wc=He("CodecUtils"),Dl=function(s){const e=s.attributes||{};if(e.CODECS)return(0,se.tB)(e.CODECS)},Ol=(s,e)=>{const t=e.attributes||{};return s&&s.mediaGroups&&s.mediaGroups.AUDIO&&t.AUDIO&&s.mediaGroups.AUDIO[t.AUDIO]},Ic=(s,e)=>{if(!Ol(s,e))return!0;const t=e.attributes||{},i=s.mediaGroups.AUDIO[t.AUDIO];for(const n in i)if(!i[n].uri&&!i[n].playlists)return!0;return!1},Ni=function(s){const e={};return s.forEach(({mediaType:t,type:i,details:n})=>{e[t]=e[t]||[],e[t].push((0,se.Et)(`${i}${n}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1){wc(`multiple ${t} codecs found as attributes: ${e[t].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),e[t]=null;return}e[t]=e[t][0]}),e},Ml=function(s){let e=0;return s.audio&&e++,s.video&&e++,e},ji=function(s,e){const t=e.attributes||{},i=Ni(Dl(e)||[]);if(Ol(s,e)&&!i.audio&&!Ic(s,e)){const n=Ni((0,se.BX)(s,t.AUDIO)||[]);n.audio&&(i.audio=n.audio)}return i},{EventTarget:Pc}=E,Ac=(s,e)=>{if(e.endList||!e.serverControl)return s;const t={};if(e.serverControl.canBlockReload){const{preloadSegment:i}=e;let n=e.mediaSequence+e.segments.length;if(i){const a=i.parts||[],o=yl(e)-1;o>-1&&o!==a.length-1&&(t._HLS_part=o),(o>-1||a.length)&&n--}t._HLS_msn=n}if(e.serverControl&&e.serverControl.canSkipUntil&&(t._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(t).length){const i=new(S()).URL(s);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(n){t.hasOwnProperty(n)&&i.searchParams.set(n,t[n])}),s=i.toString()}return s},Lc=(s,e)=>{if(!s)return e;const t=J(s,e);if(s.preloadHints&&!e.preloadHints&&delete t.preloadHints,s.parts&&!e.parts)delete t.parts;else if(s.parts&&e.parts)for(let i=0;i<e.parts.length;i++)s.parts&&s.parts[i]&&(t.parts[i]=J(s.parts[i],e.parts[i]));return!s.skipped&&e.skipped&&(t.skipped=!1),s.preload&&!e.preload&&(t.preload=!1),t},Dc=(s,e,t)=>{const i=s.slice(),n=e.slice();t=t||0;const a=[];let o;for(let u=0;u<n.length;u++){const f=i[u+t],m=n[u];f?(o=f.map||o,a.push(Lc(f,m))):(o&&!m.map&&(m.map=o),a.push(m))}return a},Rl=(s,e)=>{!s.resolvedUri&&s.uri&&(s.resolvedUri=Ae(e,s.uri)),s.key&&!s.key.resolvedUri&&(s.key.resolvedUri=Ae(e,s.key.uri)),s.map&&!s.map.resolvedUri&&(s.map.resolvedUri=Ae(e,s.map.uri)),s.map&&s.map.key&&!s.map.key.resolvedUri&&(s.map.key.resolvedUri=Ae(e,s.map.key.uri)),s.parts&&s.parts.length&&s.parts.forEac
176h(t=>{t.resolvedUri||(t.resolvedUri=Ae(e,t.uri))}),s.preloadHints&&s.preloadHints.length&&s.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=Ae(e,t.uri))})},Ul=function(s){const e=s.segments||[],t=s.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let i=0;i<t.preloadHints.length;i++)if(t.preloadHints[i].type==="MAP")return e}t.duration=s.targetDuration,t.preload=!0,e.push(t)}return e},Bl=(s,e)=>s===e||s.segments&&e.segments&&s.segments.length===e.segments.length&&s.endList===e.endList&&s.mediaSequence===e.mediaSequence&&s.preloadSegment===e.preloadSegment,Ar=(s,e,t=Bl)=>{const i=J(s,{}),n=i.playlists[e.id];if(!n||t(n,e))return null;e.segments=Ul(e);const a=J(n,e);if(a.preloadSegment&&!e.preloadSegment&&delete a.preloadSegment,n.segments){if(e.skip){e.segments=e.segments||[];for(let o=0;o<e.skip.skippedSegments;o++)e.segments.unshift({skipped:!0})}a.segments=Dc(n.segments,e.segments,e.mediaSequence-n.mediaSequence)}a.segments.forEach(o=>{Rl(o,a.resolvedUri)});for(let o=0;o<i.playlists.length;o++)i.playlists[o].id===e.id&&(i.playlists[o]=a);return i.playlists[e.id]=a,i.playlists[e.uri]=a,fi(s,(o,u,f,m)=>{if(o.playlists)for(let g=0;g<o.playlists.length;g++)e.id===o.playlists[g].id&&(o.playlists[g]=a)}),i},Lr=(s,e)=>{const t=s.segments||[],i=t[t.length-1],n=i&&i.parts&&i.parts[i.parts.length-1],a=n&&n.duration||i&&i.duration;return e&&a?a*1e3:(s.partTargetDuration||s.targetDuration||10)*500},Fl=(s,e,t)=>{if(!s)return;const i=[];return s.forEach(n=>{if(!n.attributes)return;const{BANDWIDTH:a,RESOLUTION:o,CODECS:u}=n.attributes;i.push({id:n.id,bandwidth:a,resolution:o,codecs:u})}),{type:e,isLive:t,renditions:i}};class pi extends Pc{constructor(e,t,i={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=He("PlaylistLoader");const{withCredentials:n=!1}=i;this.src=e,this.vhs_=t,this.withCredentials=n,this.addDateRangesToTextTrack_=i.addD
176ateRangesToTextTrack;const a=t.options_;this.customTagParsers=a&&a.customTagParsers||[],this.customTagMappers=a&&a.customTagMappers||[],this.llhls=a&&a.llhls,this.dateRangesStorage_=new Al,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();!t.length||!this.addDateRangesToTextTrack_||this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;const e=this.media();let t=Ae(this.main.uri,e.uri);this.llhls&&(t=Ac(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(i,n)=>{if(this.request){if(i)return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA");this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}})}playlistRequestError(e,t,i){const{uri:n,id:a}=t;this.request=null,i&&(this.state=i),this.error={playlist:this.main.playlists[a],status:e.status,message:`HLS playlist request error at URL: ${n}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:Nt({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{const i=xc({onwarn:({message:n})=>this.logger_(`m3u8-parser warn for ${e}: ${n}`),oninfo:({message:n})=>this.logger_(`m3u8-parser info for ${e}: ${n}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls});return!i.playlists||!i.playlists.length||this.excludeAudioOnlyVariants(i.playlists),i}catch(i){this.error=i,this.error.metadata={errorType:E.Error.StreamingHlsPlaylistParserError,error:i}}}excludeAudioOnlyVariants(e){const t=i=>{const n=i.attributes||{},{width:a,height:o}=n.RESOLUTION||{};if(a&&o)return!0;const u=Dl(i)||[];return!!Ni(u).video};e.some(t)&&e.forEach(i=>{t(i)||(i.excludeUntil=1/0)})}haveMetadata({playlistString:e,playlistObject:t,url:i,id:n}){this.request=null,this.state="HAVE_METADATA";const a={playlistInfo:{type:"media",uri:i}};this.trigger({type:"playlistparsestart",metadata:a});const o=t||this.parseManifest_({url:i,manifestString:e});o.lastRequest=Date.now(),Il({playlist:o,uri:i,id:n});const u=Ar(this.main,o);this.targetDuration=o.partTargetDuration||o.targetDuration,this.pendingMedia_=null,u?(this.main=u,this.media_=this.main.playlists[n]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Lr(this.media(),!!u)),a.parsedPlaylist=Fl(this.main.playlists,a.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:a}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),S().clearTimeout(this.mediaUpdateTimeout),S().clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new Al,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(S().clearTimeout(this.finalRenditionTimeout),t){const u=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=S().setTimeout(this.media.bind(this,e,!1),u);return}const i=this.state,n=!this.media_||e.id!==this.media_.id,a=this.main.playlists[e.id];if(a&&a.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,n&&(this.trigger("mediachanging"),i==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(Lr(e,!0)),!n)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;
176const o={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:o}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(u,f)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=zs(e.resolvedUri,f),u)return this.playlistRequestError(this.request,e,i);this.trigger({type:"playlistrequestcomplete",metadata:o}),this.haveMetadata({playlistString:f.responseText,url:e.uri,id:e.id}),i==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(S().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(S().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const i=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=S().setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},i);return}if(!this.started){this.start();return}t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(S().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=S().setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=S().location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}
176const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,i)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:i.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:i.responseText,code:2,metadata:Nt({requestType:i.requestType,request:i,error:t})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=zs(this.src,i),this.trigger({type:"playlistparsestart",metadata:e});const n=this.parseManifest_({manifestString:i.responseText,url:this.src});e.parsedPlaylist=Fl(n.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(n)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,Pl(this.main,this.srcUri()),e.playlists.forEac
176h(i=>{i.segments=Ul(i),i.segments.forEach(n=>{Rl(n,i.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const t=this.srcUri()||S().location.href;this.main=kc(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const i=this.main,n=e.ID;let a=i.playlists.length;for(;a--;){const o=i.playlists[a];if(o.attributes["PATHWAY-ID"]===n){const u=o.resolvedUri,f=o.id;if(t){const m=this.createCloneURI_(o.resolvedUri,e),g=ci(n,m),b=this.createCloneAttributes_(n,o.attributes),C=this.createClonePlaylist_(o,g,e,b);i.playlists[a]=C,i.playlists[g]=C,i.playlists[m]=C}else i.playlists.splice(a,1);delete i.playlists[f],delete i.playlists[u]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const i=this.main,n=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(a=>{if(!(!i.mediaGroups[a]||!i.mediaGroups[a][n])){for(const o in i.mediaGroups[a])if(o===n){for(const u in i.mediaGroups[a][o])i.mediaGroups[a][o][u].playlists.forEac
176h((m,g)=>{const b=i.playlists[m.id],C=b.id,k=b.resolvedUri;delete i.playlists[C],delete i.playlists[k]});delete i.mediaGroups[a][o]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const i=this.main,n=i.playlists.length,a=this.createCloneURI_(t.resolvedUri,e),o=ci(e.ID,a),u=this.createCloneAttributes_(e.ID,t.attributes),f=this.createClonePlaylist_(t,o,e,u);i.playlists[n]=f,i.playlists[o]=f,i.playlists[a]=f,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,i=e["BASE-ID"],n=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(a=>{if(!(!n.mediaGroups[a]||n.mediaGroups[a][t]))for(const o in n.mediaGroups[a]){if(o===i)n.mediaGroups[a][t]={};else continue;for(const u in n.mediaGroups[a][o]){const f=n.mediaGroups[a][o][u];n.mediaGroups[a][t][u]=(0,Ce.A)({},f);const m=n.mediaGroups[a][t][u],g=this.createCloneURI_(f.resolvedUri,e);m.resolvedUri=g,m.uri=g,m.playlists=[],f.playlists.forEach((b,C)=>{const k=n.playlists[b.id],P=wl(a,t,u),A=ci(t,P);if(k&&!n.playlists[A]){const R=this.createClonePlaylist_(k,A,e),O=R.resolvedUri;n.playlists[A]=R,n.playlists[O]=R}m.playlists[C]=this.createClonePlaylist_(b,A,e)})}}})}createClonePlaylist_(e,t,i,n){const a=this.createCloneURI_(e.resolvedUri,i),o={resolvedUri:a,uri:a,id:t};return e.segments&&(o.segments=[]),n&&(o.attributes=n),J(e,o)}createCloneURI_(e,t){const i=new URL(e);i.hostname=t["URI-REPLACEMENT"].HOST;const n=t["URI-REPLACEMENT"].PARAMS;for(const a of Object.keys(n))i.searchParams.set(a,n[a]);return i.href}createCloneAttributes_(e,t){const i={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{t[n]&&(i[n]=e)}),i}getKeyIdSet(e){const t=new Set;if(!e||!e.contentProtection)return t;for(const i in e.contentProtection)if(e.contentProtection[i]&&e.contentProtection[i].attributes&&e.contentProtection[i].attributes.keyId){const n=e.contentProtection[i].attributes.keyId;t.add(n.toLowerCase())}return t}}const Dr=function(s,e,t,i){const n=s.responseType==="arraybuffer"?s.response:s.responseText;!e&&n&&(s.responseTime=Date.now(),s.roundTripTime=s.responseTime-s.requestTime,s.bytesReceived=n.byteLength||n.length,s.bandwidth||(s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3))),t.headers&&(s.responseHeaders=t.headers),e&&e.code==="ETIMEDOUT"&&(s.timedout=!0),!e&&!s.aborted&&t.statusCode!==200&&t.statusCode!==206&&t.statusCode!==0&&(e=new Error("XHR Failed with a response of: "+(s&&(n||s.responseText)))),i(e,s)},Oc=(s,e)=>{if(!s||!s.size)return;let t=e;return s.forEach(i=>{t=i(t)}),t},Mc=(s,e,t,i)=>{!s||!s.size||s.forEach(n=>{n(e,t,i)})},Nl=function(){const s=function e(t,i){t=J({timeout:45e3},t);const n=e.beforeRequest||E.Vhs.xhr.beforeRequest,a=e._requestCallbackSet||E.Vhs.xhr._requestCallbackSet||new Set,o=e._responseCallbackSet||E.Vhs.xhr._responseCallbackSet;n&&typeof n=="function"&&(E.log.warn("beforeRequest is deprecated, use onRequest instead."),a.add(n));const u=E.Vhs.xhr.original===!0?E.xhr:E.Vhs.xhr,f=Oc(a,t);a.delete(n);const m=u(f||t,function(b,C){return Mc(o,m,b,C),Dr(m,b,C,i)}),g=m.abort;return m.abort=function(){return m.aborted=!0,g.apply(m,arguments)},m.uri=t.uri,m.requestType=t.requestType,m.requestTime=Date.now(),m};return s.original=!0,s},Rc=function(s){let e;const t=s.offset;return typeof s.offset=="bigint"||typeof s.length=="bigint"?e=S().BigInt(s.offset)+S().BigInt(s.length)-S().BigInt(1):e=s.offset+s.length-1,"bytes="+t+"-"+e},Or=function(s){const e={};return s.byterange&&(e.Range=Rc(s.byterange)),e},Uc=function(s,e){return s.start(e)+"-"+s.end(e)},Bc=function(s,e){const t=s.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},Fc=function(s){return s>=32&&s<126?String.fromCharCode(s):"."},jl=function(s){const e={};return Object.keys(s).forEach(t=>{const i=s[t];(0,ls.hc)(i)?e[t]={bytes:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength}:e[t]=i}),e},Ks=function(s){const e=s.byterange||{length:1/0,offset:0};return[e.length,e.offset,s.resolvedUri].join(",")},$l=function(s){return s.resolvedUri},Hl=s=>{const e=Array.prototype.slice.call(s),t=16;let i="",n,a;for(let o=0;o<e.length/t;o++)n=e.slice(o*t,o*t+t).map(Bc).join(""),a=e.slice(o*t,o*t+t).map(Fc).join(""),i+=n+" "+a+`
177`;return i};var Nc=Object.freeze({__proto__:null,createTransferableMessage:jl,initSegmentId:Ks,segmentKeyId:$l,hexDump:Hl,tagDump:({bytes:s})=>Hl(s),textRanges:s=>{let e="",t;for(t=0;t<s.length;t++)e+=Uc(s,t)+" ";return e}});const Vl=.25,jc=(s,e)=>{if(!e.dateTimeObject)return null;const t=e.videoTimingInfo.transmuxerPrependedSeconds,n=e.videoTimingInfo.transmuxedPresentationStart+t,a=s-n;return new Date(e.dateTimeObject.getTime()+a*1e3)},$c=s=>s.transmuxedPresentationEnd-s.transmuxedPresentationStart-s.transmuxerPrependedSeconds,Hc=(s,e)=>{let t;try{t=new Date(s)}catch(f){return null}if(!e||!e.segments||e.segments.length===0)return null;let i=e.segments[0];if(t<new Date(i.dateTimeObject))return null;for(let f=0;f<e.segments.length-1;f++){i=e.segments[f];const m=new Date(e.segments[f+1].dateTimeObject);if(t<m)break}const n=e.segments[e.segments.length-1],a=n.dateTimeObject,o=n.videoTimingInfo?$c(n.videoTimingInfo):n.duration+n.duration*Vl,u=new Date(a.getTime()+o*1e3);return t>u?null:(t>
177new Date(a)&&(i=n),{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:Le.duration(e,e.mediaSequence+e.segments.indexOf(i)),type:i.videoTimingInfo?"accurate":"estimate"})},Vc=(s,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let t=0,i;for(let a=0;a<e.segments.length&&(i=e.segments[a],t=i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationEnd:t+i.duration,!(s<=t));a++);const n=e.segments[e.segments.length-1];if(n.videoTimingInfo&&n.videoTimingInfo.transmuxedPresentationEnd<s)return null;if(s>t){if(s>t+n.duration*Vl)return null;i=n}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:t-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}},qc=(s,e)=>{let t,i;try{t=new Date(s),i=new Date(e)}catch(o){}const n=t.getTime();return(i.getTime()-n)/1e3},zc=s=>{if(!s.segments||s.segments.length===0)return!1;for(let e=0;e<s.segments.length;e++)if(!s.segments[e].dateTimeObject)return!1;return!0},Wc=({playlist:s,time:e=void 0,callback:t})=>{if(!t)throw new Error("getProgramTime: callback must be provided");if(!s||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const i=Vc(e,s);if(!i)return t({message:"valid programTime was not found"});if(i.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:i.estimatedStart});const n={mediaSeconds:e},a=jc(e,i.segment);return a&&(n.programDateTime=a.toISOString()),t(null,n)},ql=({programTime:s,playlist:e,retryCount:t=2,seekTo:i,pauseAfterSeek:n=!0,tech:a,callback:o})=>{if(!o)throw new Error("seekToProgramTime: callback must be provided");if(typeof s=="undefined"||!e||!i)return o({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!a.hasStarted_)return o({message:"player must be playing a live stream to start buffering"});if(!zc(e))return o({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const u=Hc(s,e);if(!u)return o({message:`${s} was not found in the stream`});const f=u.segment,m=qc(f.dateTimeObject,s);if(u.type==="estimate"){if(t===0)return o({message:`${s} is not buffered yet. Try again`});i(u.estimatedStart+m),a.one("seeked",()=>{ql({programTime:s,playlist:e,retryCount:t-1,seekTo:i,pauseAfterSeek:n,tech:a,callback:o})});return}const g=f.start+m,b=()=>o(null,a.currentTime());a.one("seeked",b),n&&a.pause(),i(g)},Mr=(s,e)=>{if(s.readyState===4)return e()},Gc=(s,e,t,i)=>{let n=[],a,o=!1;const u=function(b,C,k,P){return C.abort(),o=!0,t(b,C,k,P)},f=function(b,C){if(o)return;if(b)return b.metadata=Nt({requestType:i,request:C,error:b}),u(b,C,"",n);const k=C.responseText.substring(n&&n.byteLength||0,C.responseText.length);if(n=(0,ls.Bu)(n,(0,ls.Af)(k,!0)),a=a||(0,qd.A)(n),n.length<10||a&&n.length<a+2)return Mr(C,()=>u(b,C,"",n));const P=(0,hs.ne)(n);return P==="ts"&&n.length<188?Mr(C,()=>u(b,C,"",n)):!P&&n.length<376?Mr(C,()=>u(b,C,"",n)):u(null,C,P,n)},g=e({uri:s,beforeSend(b){b.overrideMimeType("text/plain; charset=x-user-defined"),b.addEventListener("progress",function({total:C,loaded:k}){return Dr(b,null,{statusCode:b.status},f)})}},function(b,C){return Dr(g,b,C,f)});return g},{EventTarget:Kc}=E,zl=function(s,e){if(!Bl(s,e)||s.sidx&&e.sidx&&(s.sidx.offset!==e.sidx.offset||s.sidx.length!==e.sidx.length))return!1;if(!s.sidx&&e.sidx||s.sidx&&!e.sidx||s.segments&&!e.segments||!s.segments&&e.segments)return!1;if(!s.segments&&!e.segments)return!0;for(let t=0;t<s.segments.length;t++){const i=s.segments[t],n=e.segments[t];if(i.uri!==n.uri)return!1;if(!i.byterange&&!n.byterange)continue;const a=i.byterange,o=n.byterange;if(a&&!o||!a&&o||a.offset!==o.offset||a.length!==o.length)return!1}return!0},Qc=(s,e,t,i)=>{const n=i.attributes.NAME||t;return`placeholder-uri-${s}-${e}-${n}`},Yc=({mainXml:s,srcUrl:e,clientOffset:t,sidxMapping:i,previousManifest:n})=>{const a=(0,Pt.qg)(s,{manifestUri:e,clientOffset:t,sidxMapping:i,previousManifest:n});return Pl(a,e,Qc),a},Xc=(s,e)=>{fi(s,(t,i,n,a)=>{(!e.mediaGroups[i][n]||!(a in e.mediaGroups[i][n]))&&delete s.mediaGroups[i][n][a]})},Jc=(s,e,t)=>{let i=!0,n=J(s,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let a=0;a<e.playlists.length;a++){const o=e.playlists[a];if(o.sidx){const f=(0,Pt.Ze)(o.sidx);
177t&&t[f]&&t[f].sidx&&(0,Pt.Tt)(o,t[f].sidx,o.sidx.resolvedUri)}const u=Ar(n,o,zl);u&&(n=u,i=!1)}return fi(e,(a,o,u,f)=>{if(a.playlists&&a.playlists.length){const m=a.playlists[0].id,g=Ar(n,a.playlists[0],zl);g&&(n=g,f in n.mediaGroups[o][u]||(n.mediaGroups[o][u][f]=a),n.mediaGroups[o][u][f].playlists[0]=n.playlists[m],i=!1)}}),Xc(n,e),e.minimumUpdatePeriod!==s.minimumUpdatePeriod&&(i=!1),i?null:n},Zc=(s,e)=>(!s.map&&!e.map||!!(s.map&&e.map&&s.map.byterange.offset===e.map.byterange.offset&&s.map.byterange.length===e.map.byterange.length))&&s.uri===e.uri&&s.byterange.offset===e.byterange.offset&&s.byterange.length===e.byterange.length,Wl=(s,e)=>{const t={};for(const i in s){const a=s[i].sidx;if(a){const o=(0,Pt.Ze)(a);if(!e[o])break;const u=e[o].sidxInfo;Zc(u,a)&&(t[o]=e[o])}}return t},ef=(s,e)=>{let i=Wl(s.playlists,e);return fi(s,(n,a,o,u)=>{if(n.playlists&&n.playlists.length){const f=n.playlists;i=J(i,Wl(f,e))}}),i};class Rr extends Kc{constructor(e,t,i={},n){super(),this.isPaused_=!0,this.mainPlaylistLoader_=n||this,n||(this.isMain_=!0);const{withCredentials:a=!1}=i;if(this.vhs_=t,this.withCredentials=a,this.addMetadataToTextTrack=i.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=He("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}get isPaused(){return this.isPaused_}requestErrored_(e,t,i){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e=="object"&&!(e instanceof Error)?e:{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata},i&&(this.state=i),this.trigger("error"),!0}addSidxSegments_(e,t,i){const n=e.sidx&&(0,Pt.Ze)(e.sidx);if(!e.sidx||!n||this.mainPlaylistLoader_.sidxMapping_[n]){S().clearTimeout(this.mediaRequest_),this.mediaRequest_=S().setTimeout(()=>i(!1),0);return}const a=zs(e.sidx.resolvedUri),o=(f,m)=>{if(this.requestErrored_(f,m,t))return;const g=this.mainPlaylistLoader_.sidxMapping_,{requestType:b}=m;let C;try{C=Vd()((0,ls.W_)(m.response).subarray(8))}catch(k){k.metadata=Nt({requestType:b,request:m,parseFailure:!0}),this.requestErrored_(k,m,t);return}return g[n]={sidxInfo:e.sidx,sidx:C},(0,Pt.Tt)(e,C,e.sidx.resolvedUri),i(!0)},u="dash-sidx";this.request=Gc(a,this.vhs_.xhr,(f,m,g,b)=>{if(f)return o(f,m);if(!g||g!=="mp4"){const P=g||"unknown";return o({status:m.status,message:`Unsupported ${P} container type for sidx segment at URL: ${a}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},m)}const{offset:C,length:k}=e.sidx.byterange;if(b.length>=k+C)return o(f,{response:b.subarray(C,C+k),status:m.status,uri:m.uri});this.request=this.vhs_.xhr({uri:a,responseType:"arraybuffer",requestType:"dash-sidx",headers:Or({byterange:e.sidx.byterange})},o)},u)}dispose(){this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},S().clearTimeout(this.minimumUpdatePeriodTimeout_),S().clearTimeout(this.mediaRequest_),S().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,i&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,n=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,S().clearTimeout(this.mediaRequest_),this.mediaRequest_=null,this.refreshMedia_(t.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.isPaused_=!0,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),S().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(S().clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){this.isPaused_=!1,S().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const i=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=S().setTimeout(()=>this.load(),i);return}if(!this.started){this.start();return}t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")}
177start(){if(this.started=!0,!this.isMain_){S().clearTimeout(this.mediaRequest_),this.mediaRequest_=S().setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){const t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(i,n)=>{if(i){const{requestType:o}=n;i.metadata=Nt({requestType:o,request:n,error:i})}if(this.requestErrored_(i,n)){this.state==="HAVE_NOTHING"&&(this.started=!1);return}this.trigger({type:"manifestrequestcomplete",metadata:t});const a=n.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=n.responseText,n.responseHeaders&&n.responseHeaders.date?this.mainLoaded_=Date.parse(n.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=zs(this.mainPlaylistLoader_.srcUrl,n),a){this.handleMain_(),this.syncClientServerClock_(()=>e(n,a));return}return e(n,a)})}syncClientServerClock_(e){const t=(0,Pt.i6)(this.mainPlaylistLoader_.mainXml_);if(t===null)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();if(t.method==="DIRECT")return this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e();this.request=this.vhs_.xhr({uri:Ae(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(i,n)=>{if(!this.request)return;if(i){const{requestType:o}=n;return this.error.metadata=Nt({requestType:o,request:n,error:i}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let a;t.method==="HEAD"?!n.responseHeaders||!n.responseHeaders.date?a=this.mainLoaded_:a=Date.parse(n.responseHeaders.date):a=Date.parse(n.responseText),this.mainPlaylistLoader_.clientOffset_=a-Date.now(),e()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){S().clearTimeout(this.mediaRequest_),this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:t});let i;try{i=Yc({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(a){this.error=a,this.error.metadata={errorType:E.Error.StreamingDashManifestParserError,error:a},this.trigger("error")}e&&(i=Jc(e,i,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=i||e;const n=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(n&&n!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=n),(!e||i&&i.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(i),i){const{duration:a,endList:o}=i,u=[];
177i.playlists.forEach(m=>{u.push({id:m.id,bandwidth:m.attributes.BANDWIDTH,resolution:m.attributes.RESOLUTION,codecs:m.attributes.CODECS})});const f={duration:a,isLive:!o,renditions:u};t.parsedManifest=f,this.trigger({type:"manifestparsecomplete",metadata:t})}return!!i}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(S().clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;if(t===0&&(e.media()?t=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof t!="number"||t<=0){t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`);return}this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=S().setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=ef(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,i=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,i=!this.media_||this.media_!==t[e];if(i?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const n=()=>{this.media().endList||(this.mediaUpdateTimeout=S().setTimeout(()=>{this.trigger("mediaupdatetimeout"),n()},Lr(this.media(),!!i)))};n()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(i=>({cueTime:i.start,frames:[{data:i.messageData}]}));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const n=e.contentProtection[i].attributes["cenc:default_KID"];n&&t.add(n.replace(/-/g,"").toLowerCase())}return t}}}var _e={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const tf=s=>{const e=new Uint8Array(new ArrayBuffer(s.length));for(let t=0;t<s.length;t++)e[t]=s.charCodeAt(t);return e.buffer},Gl=function(s){return s.on=s.addEventListener,s.off=s.removeEventListener,s},sf=function(s){try{return URL.createObjectURL(new Blob([s],{type:"application/javascript"}))}catch(e){const t=new BlobBuilder;return t.append(s),URL.createObjectURL(t.getBlob())}},Kl=function(s){return function(){const e=sf(s),t=Gl(new Worker(e));t.objURL=e;const i=t.terminate;return t.on=t.addEventListener,t.off=t.removeEventListener,t.terminate=function(){return URL.revokeObjectURL(e),i.call(this)},t}},Ql=function(s){return`var browserWorkerPolyFill = ${Gl.toString()};
178browserWorkerPolyFill(self);
179`+s},Yl=function(s){return s.toString().replace(/^function.+?{/,"").slice(0,-1)},nf=Ql(Yl(function(){var s=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof le.g!="undefined"?le.g:typeof self!="undefined"?self:{},e=function(){this.init=function(){var r={};this.on=function(l,h){r[l]||(r[l]=[]),r[l]=r[l].concat(h)},this.off=function(l,h){var d;return r[l]?(d=r[l].indexOf(h),r[l]=r[l].slice(),r[l].splice(d,1),d>-1):!1},this.trigger=function(l){var h,d,c,p;if(h=r[l],!!h)if(arguments.length===2)for(c=h.length,d=0;d<c;++d)h[d].call(this,arguments[1]);else{for(p=[],d=arguments.length,d=1;d<arguments.length;++d)p.push(arguments[d]);for(c=h.length,d=0;d<c;++d)h[d].apply(this,p)}},this.dispose=function(){r={}}}};e.prototype.pipe=function(r){return this.on("data",function(l){r.push(l)}),this.on("done",function(l){r.flush(l)}),this.on("partialdone",function(l){r.partialFlush(l)}),this.on("endedtimeline",function(l){r.endTimeline(l)}),this.on("reset",function(l){r.reset(l)}),r},e.prototype.push=function(r){this.trigger("data",r)},e.prototype.flush=function(r){this.trigger("done",r)},e.prototype.partialFlush=function(r){this.trigger("partialdone",r)},e.prototype.endTimeline=function(r){this.trigger("endedtimeline",r)},e.prototype.reset=function(r){this.trigger("reset",r)};var t=e,i=Math.pow(2,32),n=function(r){var l=new DataView(r.buffer,r.byteOffset,r.byteLength),h;return l.getBigUint64?(h=l.getBigUint64(0),h<Number.MAX_SAFE_INTEGER?
179Number(h):h):l.getUint32(0)*i+l.getUint32(4)},a={getUint64:n,MAX_UINT32:i},o=a.MAX_UINT32,u,f,m,g,b,C,k,P,A,R,O,N,H,F,M,$,D,B,Y,he,ye,de,q,Z,Ve,ct,xt,$t,Ht,Vt,qt,zt,Zs,Hh,Vh,qh;(function(){var r;if(q={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},typeof Uint8Array!="undefined"){for(r in q)q.hasOwnProperty(r)&&(q[r]=[r.charCodeAt(0),r.charCodeAt(1),r.charCodeAt(2),r.charCodeAt(3)]);Z=new Uint8Array([105,115,111,109]),ct=new Uint8Array([97,118,99,49]),Ve=new Uint8Array([0,0,0,1]),xt=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),$t=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),Ht={video:xt,audio:$t},zt=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),qt=new Uint8Array([0,0,0,0,0,0,0,0]),Zs=new Uint8Array([0,0,0,0,0,0,0,0]),Hh=Zs,Vh=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),qh=Zs,Vt=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),u=function(r){var l=[],h=0,d,c,p;for(d=1;d<arguments.length;d++)l.push(arguments[d]);for(d=l.length;d--;)h+=l[d].byteLength;for(c=new Uint8Array(h+8),p=new DataView(c.buffer,c.byteOffset,c.byteLength),p.setUint32(0,c.byteLength),c.set(r,4),d=0,h=8;d<l.length;d++)c.set(l[d],h),h+=l[d].byteLength;return c},f=function(){return u(q.dinf,u(q.dref,zt))},m=function(r){return u(q.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,r.audioobjecttype<<3|r.samplingfrequencyindex>>>1,r.samplingfrequencyindex<<7|r.channelcount<<3,6,1,2]))},g=function(){return u(q.ftyp,Z,Ve,Z,ct)},$=function(r){return u(q.hdlr,Ht[r])},b=function(r){return u(q.mdat,r)},M=function(r){var l=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,r.duration>>>24&255,r.duration>>>16&255,r.duration>>>8&255,r.duration&255,85,196,0,0]);return r.samplerate&&(l[12]=r.samplerate>>>24&255,l[13]=r.samplerate>>>16&255,l[14]=r.samplerate>>>8&255,l[15]=r.samplerate&255),u(q.mdhd,l)},F=function(r){return u(q.mdia,M(r),$(r.type),k(r))},C=function(r){return u(q.mfhd,new Uint8Array([0,0,0,0,(r&4278190080)>>24,(r&16711680)>>16,(r&65280)>>8,r&255]))},k=function(r){return u(q.minf,r.type==="video"?u(q.vmhd,Vt):u(q.smhd,qt),f(),B(r))},P=function(r,l){for(var h=[],d=l.length;d--;)h[d]=he(l[d]);return u.apply(null,[q.moof,C(r)].concat(h))},A=function(r){for(var l=r.length,h=[];l--;)h[l]=N(r[l]);return u.apply(null,[q.moov,O(4294967295)].concat(h).concat(R(r)))},R=function(r){for(var l=r.length,h=[];l--;)h[l]=ye(r[l]);return u.apply(null,[q.mvex].concat(h))},O=function(r){var l=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(r&4278190080)>>24,(r&16711680)>>16,(r&65280)>>8,r&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return u(q.mvhd,l)},D=function(r){var l=r.samples||[],h=new Uint8Array(4+l.length),d,c;for(c=0;c<l.length;c++)d=l[c].flags,h[c+4]=d.dependsOn<<4|d.isDependedOn<<2|d.hasRedundancy;return u(q.sdtp,h)},B=function(r){return u(q.stbl,Y(r),u(q.stts,qh),u(q.stsc,Hh),u(q.stsz,Vh),u(q.stco,Zs))},(function(){var r,l;Y=function(h){return u(q.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),h.type==="video"?r(h):l(h))},r=function(h){var d=h.sps||[],c=h.pps||[],p=[],_=[],y,T;for(y=0;y<d.length;y++)p.push((d[y].byteLength&65280)>>>8),p.push(d[y].byteLength&255),p=p.concat(Array.prototype.slice.call(d[y]));for(y=0;y<c.length;y++)_.push((c[y].byteLength&65280)>>>8),_.push(c[y].byteLength&255),_=_.concat(Array.prototype.slice.call(c[y]));if(T=[q.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(h.width&65280)>>8,h.width&255,(h.height&65280)>>8,h.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),u(q.avcC,new Uint8Array([1,h.profileIdc,h.profileCompatibility,h.levelIdc,255].concat([d.length],p,[c.length],_))),u(q.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],h.sarRatio){var v=h.sarRatio[0],x=h.sarRatio[1];T.push(u(q.pasp,new Uint8Array([(v&4278190080)>>24,(v&16711680)>>16,(v&65280)>>8,v&255,(x&4278190080)>>24,(x&16711680)>>16,(x&65280)>>8,x&255])))}return u.apply(null,T)},l=function(h){return u(q.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(h.channelcount&65280)>>8,h.channelcount&255,(h.samplesize&65280)>>8,h.samplesize&255,0,0,0,0,(h.samplerate&65280)>>8,h.samplerate&255,0,0]),m(h))}})(),H=function(r){var l=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(r.id&4278190080)>>24,(r.id&16711680)>>16,(r.id&65280)>>8,r.id&255,0,0,0,0,(r.duration&4278190080)>>24,(r.duration&16711680)>>16,(r.duration&65280)>>8,r.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(r.width&65280)>>8,r.width&255,0,0,(r.height&65280)>>8,r.height&255,0,0]);return u(q.tkhd,l)},he=function(r){var l,h,d,c,p,_,y;return l=u(q.tfhd,new Uint8Array([0,0,0,58,(r.id&4278190080)>>24,(r.id&16711680)>>16,(r.id&65280)>>8,r.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),_=Math.floor(r.baseMediaDecodeTime/o),y=Math.floor(r.baseMediaDecodeTime%o),h=u(q.tfdt,new Uint8Array([1,0,0,0,_>>>24&255,_>>>16&255,_>>
179>8&255,_&255,y>>>24&255,y>>>16&255,y>>>8&255,y&255])),p=92,r.type==="audio"?(d=de(r,p),u(q.traf,l,h,d)):(c=D(r),d=de(r,c.length+p),u(q.traf,l,h,d,c))},N=function(r){return r.duration=r.duration||4294967295,u(q.trak,H(r),F(r))},ye=function(r){var l=new Uint8Array([0,0,0,0,(r.id&4278190080)>>24,(r.id&16711680)>>16,(r.id&65280)>>8,r.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return r.type!=="video"&&(l[l.length-1]=0),u(q.trex,l)},(function(){var r,l,h;h=function(d,c){var p=0,_=0,y=0,T=0;return d.length&&(d[0].duration!==void 0&&(p=1),d[0].size!==void 0&&(_=2),d[0].flags!==void 0&&(y=4),d[0].compositionTimeOffset!==void 0&&(T=8)),[0,0,p|_|y|T,1,(d.length&4278190080)>>>24,(d.length&16711680)>>>16,(d.length&65280)>>>8,d.length&255,(c&4278190080)>>>24,(c&16711680)>>>16,(c&65280)>>>8,c&255]},l=function(d,c){var p,_,y,T,v,x;for(T=d.samples||[],c+=20+16*T.length,y=h(T,c),_=new Uint8Array(y.length+T.length*16),_.set(y),p=y.length,x=0;x<T.length;x++)v=T[x],_[p++]=(v.duration&4278190080)>>>24,_[p++]=(v.duration&16711680)>>>16,_[p++]=(v.duration&65280)>>>8,_[p++]=v.duration&255,_[p++]=(v.size&4278190080)>>>24,_[p++]=(v.size&16711680)>>>16,_[p++]=(v.size&65280)>>>8,_[p++]=v.size&255,_[p++]=v.flags.isLeading<<2|v.flags.dependsOn,_[p++]=v.flags.isDependedOn<<6|v.flags.hasRedundancy<<4|v.flags.paddingValue<<1|v.flags.isNonSyncSample,_[p++]=v.flags.degradationPriority&61440,_[p++]=v.flags.degradationPriority&15,_[p++]=(v.compositionTimeOffset&4278190080)>>>24,_[p++]=(v.compositionTimeOffset&16711680)>>>16,_[p++]=(v.compositionTimeOffset&65280)>>>8,_[p++]=v.compositionTimeOffset&255;return u(q.trun,_)},r=function(d,c){var p,_,y,T,v,x;for(T=d.samples||[],c+=20+8*T.length,y=h(T,c),p=new Uint8Array(y.length+T.length*8),p.set(y),_=y.length,x=0;x<T.length;x++)v=T[x],p[_++]=(v.duration&4278190080)>>>24,p[_++]=(v.duration&16711680)>>>16,p[_++]=(v.duration&65280)>>>8,p[_++]=v.duration&255,p[_++]=(v.size&4278190080)>>>24,p[_++]=(v.size&16711680)>>>16,p[_++]=(v.size&65280)>>>8,p[_++]=v.size&255;return u(q.trun,p)},de=function(d,c){return d.type==="audio"?r(d,c):l(d,c)}})();var Gp={ftyp:g,mdat:b,moof:P,moov:A,initSegment:function(r){var l=g(),h=A(r),d;return d=new Uint8Array(l.byteLength+h.byteLength),d.set(l),d.set(h,l.byteLength),d}},Kp=function(r){var l,h,d=[],c=[];for(c.byteLength=0,c.nalCount=0,c.duration=0,d.byteLength=0,l=0;l<r.length;l++)h=r[l],h.nalUnitType==="access_unit_delimiter_rbsp"?(d.length&&(d.duration=h.dts-d.dts,c.byteLength+=d.byteLength,c.nalCount+=d.length,c.duration+=d.duration,c.push(d)),d=[h],d.byteLength=h.data.byteLength,d.pts=h.pts,d.dts=h.dts):(h.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(d.keyFrame=!0),d.duration=h.dts-d.dts,d.byteLength+=h.data.byteLength,d.push(h));return c.length&&(!d.duration||d.duration<=0)&&(d.duration=c[c.length-1].duration),c.byteLength+=d.byteLength,c.nalCount+=d.length,c.duration+=d.duration,c.push(d),c},Qp=function(r){var l,h,d=[],c=[];for(d.byteLength=0,d.nalCount=0,d.duration=0,d.pts=r[0].pts,d.dts=r[0].dts,c.byteLength=0,c.nalCount=0,c.duration=0,c.pts=r[0].pts,c.dts=r[0].dts,l=0;l<r.length;l++)h=r[l],h.keyFrame?(d.length&&(c.push(d),c.byteLength+=d.byteLength,c.nalCount+=d.nalCount,c.duration+=d.duration),d=[h],d.nalCount=h.length,d.byteLength=h.byteLength,d.pts=h.pts,d.dts=h.dts,d.duration=h.duration):(d.duration+=h.duration,d.nalCount+=h.length,d.byteLength+=h.byteLength,d.push(h));return c.length&&d.duration<=0&&(d.duration=c[c.length-1].duration),c.byteLength+=d.byteLength,c.nalCount+=d.nalCount,c.duration+=d.duration,c.push(d),c},Yp=function(r){var l;return!r[0][0].keyFrame&&r.length>1&&(l=r.shift(),r.byteLength-=l.byteLength,r.nalCount-=l.nalCount,r[0][0].dts=l.dts,r[0][0].pts=l.pts,r[0][0].duration+=l.duration),r},Xp=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},zh=function(r,l){var h=Xp();return h.dataOffset=l,h.compositionTimeOffset=r.pts-r.dts,h.duration=r.duration,h.size=4*r.length,h.size+=r.byteLength,r.keyFrame&&(h.flags.dependsOn=2,h.flags.isNonSyncSample=0),h},Jp=function(r,l){var h,d,c,p,_,y=l||0,T=[];for(h=0;h<r.length;h++)for(p=r[h],d=0;d<p.length;d++)_=p[d],c=zh(_,y),y+=c.size,T.push(c);return T},Zp=function(r){var l,h,d,c,p,_,y=0,T=r.byteLength,v=r.nalCount,x=T+4*v,w=new Uint8Array(x),j=new DataView(w.buffer);for(l=0;l<r.length;l++)for(c=r[l],h=0;h<c.length;h++)for(p=c[h],d=0;d<p.length;d++)_=p[d],j.setUint32(y,_.data.byteLength),y+=4,w.set(_.data,y),y+=_.data.byteLength;return w},em=function(r,l){var h,d=l||0,c=[];return h=zh(r,d),c.push(h),c}
179,tm=function(r){var l,h,d=0,c=r.byteLength,p=r.length,_=c+4*p,y=new Uint8Array(_),T=new DataView(y.buffer);for(l=0;l<r.length;l++)h=r[l],T.setUint32(d,h.data.byteLength),d+=4,y.set(h.data,d),d+=h.data.byteLength;return y},im={groupNalsIntoFrames:Kp,groupFramesIntoGops:Qp,extendFirstKeyFrame:Yp,generateSampleTable:Jp,concatenateNalData:Zp,generateSampleTableForFrame:em,concatenateNalDataForFrame:tm},Ct=[33,16,5,32,164,27],Wr=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],ee=function(r){for(var l=[];r--;)l.push(0);return l},sm=function(r){return Object.keys(r).reduce(function(l,h){return l[h]=new Uint8Array(r[h].reduce(function(d,c){return d.concat(c)},[])),l},{})},Gr,nm=function(){if(!Gr){var r={96e3:[Ct,[227,64],ee(154),[56]],88200:[Ct,[231],ee(170),[56]],64e3:[Ct,[248,192],ee(240),[56]],48e3:[Ct,[255,192],ee(268),[55,148,128],ee(54),[112]],44100:[Ct,[255,192],ee(268),[55,163,128],ee(84),[112]],32e3:[Ct,[255,192],ee(268),[55,234],ee(226),[112]],24e3:[Ct,[255,192],ee(268),[55,255,128],ee(268),[111,112],ee(126),[224]],16e3:[Ct,[255,192],ee(268),[55,255,128],ee(268),[111,255],ee(269),[223,108],ee(195),[1,192]],12e3:[Wr,ee(268),[3,127,248],ee(268),[6,255,240],ee(268),[13,255,224],ee(268),[27,253,128],ee(259),[56]],11025:[Wr,ee(268),[3,127,248],ee(268),[6,255,240],ee(268),[13,255,224],ee(268),[27,255,192],ee(268),[55,175,128],ee(108),[112]],8e3:[Wr,ee(268),[3,121,16],ee(47),[7]]};Gr=sm(r)}return Gr},Kr=9e4,Qr,Yr,en,Xr,Wh,Gh,Kh;Qr=function(r){return r*Kr},Yr=function(r,l){return r*l},en=function(r){return r/Kr},Xr=function(r,l){return r/l},Wh=function(r,l){return Qr(Xr(r,l))},Gh=function(r,l){return Yr(en(r),l)},Kh=function(r,l,h){return en(h?r:r-l)};var ae={ONE_SECOND_IN_TS:Kr,secondsToVideoTs:Qr,secondsToAudioTs:Yr,videoTsToSeconds:en,audioTsToSeconds:Xr,audioTsToVideoTs:Wh,videoTsToAudioTs:Gh,metadataTsToSeconds:Kh},rm=nm,tn=ae,am=function(r){var l,h,d=0;for(l=0;l<r.length;l++)h=r[l],d+=h.data.byteLength;return d},om=function(r,l,h,d){var c,p=0,_=0,y=0,T=0,v,x,w;if(l.length&&(c=tn.audioTsToVideoTs(r.baseMediaDecodeTime,r.samplerate),p=Math.ceil(tn.ONE_SECOND_IN_TS/(r.samplerate/1024)),h&&d&&(_=c-Math.max(h,d),y=Math.floor(_/p),T=y*p),!(y<1||T>tn.ONE_SECOND_IN_TS/2))){for(v=rm()[r.samplerate],v||(v=l[0].data),x=0;x<y;x++)w=l[0],l.splice(0,0,{data:v,dts:w.dts-p,pts:w.pts-p});return r.baseMediaDecodeTime-=Math.floor(tn.videoTsToAudioTs(T,r.samplerate)),T}},lm=function(r,l,h){return l.minSegmentDts>=h?r:(l.minSegmentDts=1/0,r.filter(function(d){return d.dts>=h?(l.minSegmentDts=Math.min(l.minSegmentDts,d.dts),l.minSegmentPts=l.minSegmentDts,!0):!1}))},hm=function(r){var l,h,d=[];for(l=0;l<r.length;l++)h=r[l],d.push({size:h.data.byteLength,duration:1024});return d},dm=function(r){var l,h,d=0,c=new Uint8Array(am(r));for(l=0;l<r.length;l++)h=r[l],c.set(h.data,d),d+=h.data.byteLength;return c},um={prefixWithSilence:om,trimAdtsFramesByEarliestDts:lm,generateSampleTable:hm,concatenateFrameData:dm},cm=ae.ONE_SECOND_IN_TS,fm=function(r,l){typeof l.pts=="number"&&(r.timelineStartInfo.pts===void 0&&(r.timelineStartInfo.pts=l.pts),r.minSegmentPts===void 0?r.minSegmentPts=l.pts:r.minSegmentPts=Math.min(r.minSegmentPts,l.pts),r.maxSegmentPts===void 0?r.maxSegmentPts=l.pts:r.maxSegmentPts=Math.max(r.maxSegmentPts,l.pts)),typeof l.dts=="number"&&(r.timelineStartInfo.dts===void 0&&(r.timelineStartInfo.dts=l.dts),r.minSegmentDts===void 0?r.minSegmentDts=l.dts:r.minSegmentDts=Math.min(r.minSegmentDts,l.dts),r.maxSegmentDts===void 0?r.maxSegmentDts=l.dts:r.maxSegmentDts=Math.max(r.maxSegmentDts,l.dts))},pm=function(r){delete r.minSegmentDts,delete r.maxSegmentDts,delete r.minSegmentPts,delete r.maxSegmentPts},mm=function(r,l){var h,d,c=r.minSegmentDts;return l||(c-=r.timelineStartInfo.dts),h=r.timelineStartInfo.baseMediaDecodeTime,h+=c,h=Math.max(0,h),r.type==="audio"&&(d=r.samplerate/cm,h*=d,h=Math.floor(h)),h},gm={clearDtsInfo:pm,calculateTrackBaseMediaDecodeTime:mm,collectDtsInfo:fm},Qh=4,_m=128,ym=function(r){for(var l=0,h={payloadType:-1,payloadSize:0},d=0,c=0;l<r.byteLength&&r[l]!==_m;){for(;r[l]===255;)d+=255,l++;for(d+=r[l++];r[l]===255;)c+=255,l++;if(c+=r[l++],!h.payload&&d===Qh){var p=String.fromCharCode(r[l+3],r[l+4],r[l+5],r[l+6]);if(p==="GA94"){h.payloadType=d,h.payloadSize=c,h.payload=r.subarray(l,l+c);break}else h.payload=void 0}
179l+=c,d=0,c=0}return h},Tm=function(r){return r.payload[0]!==181||(r.payload[1]<<8|r.payload[2])!==49||String.fromCharCode(r.payload[3],r.payload[4],r.payload[5],r.payload[6])!=="GA94"||r.payload[7]!==3?null:r.payload.subarray(8,r.payload.length-1)},vm=function(r,l){var h=[],d,c,p,_;if(!(l[0]&64))return h;for(c=l[0]&31,d=0;d<c;d++)p=d*3,_={type:l[p+2]&3,pts:r},l[p+2]&4&&(_.ccData=l[p+3]<<8|l[p+4],h.push(_));return h},bm=function(r){for(var l=r.byteLength,h=[],d=1,c,p;d<l-2;)r[d]===0&&r[d+1]===0&&r[d+2]===3?(h.push(d+2),d+=2):d++;if(h.length===0)return r;c=l-h.length,p=new Uint8Array(c);var _=0;for(d=0;d<c;_++,d++)_===h[0]&&(_++,h.shift()),p[d]=r[_];return p},Yh={parseSei:ym,parseUserData:Tm,parseCaptionPackets:vm,discardEmulationPreventionBytes:bm,USER_DATA_REGISTERED_ITU_T_T35:Qh},Jr=t,sn=Yh,De=function(r){r=r||{},De.prototype.init.call(this),this.parse708captions_=typeof r.parse708captions=="boolean"?r.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new ue(0,0),new ue(0,1),new ue(1,0),new ue(1,1)],this.parse708captions_&&(this.cc708Stream_=new re({captionServices:r.captionServices})),this.reset(),this.ccStreams_.forEach(function(l){l.on("data",this.trigger.bind(this,"data")),l.on("partialdone",this.trigger.bind(this,"partialdone")),l.on("done",this.trigger.bind(this,"done"))},this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};De.prototype=new Jr,De.prototype.push=function(r){var l,h,d;if(r.nalUnitType==="sei_rbsp"&&(l=sn.parseSei(r.escapedRBSP),!!l.payload&&l.payloadType===sn.USER_DATA_REGISTERED_ITU_T_T35&&(h=sn.parseUserData(l),!!h))){if(r.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(r.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}d=sn.parseCaptionPackets(r.pts,h),this.captionPackets_=this.captionPackets_.concat(d),this.latestDts_!==r.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=r.dts}},De.prototype.flushCCStreams=function(r){this.ccStreams_.forEach(function(l){return r==="flush"?l.flush():l.partialFlush()},this)},De.prototype.flushStream=function(r){if(!this.captionPackets_.length){this.flushCCStreams(r);return}this.captionPackets_.forEach(function(l,h){l.presortIndex=h}),this.captionPackets_.sort(function(l,h){return l.pts===h.pts?l.presortIndex-h.presortIndex:l.pts-h.pts}),this.captionPackets_.forEach(function(l){l.type<2?this.dispatchCea608Packet(l):this.dispatchCea708Packet(l)},this),this.captionPackets_.length=0,this.flushCCStreams(r)},De.prototype.flush=function(){return this.flushStream("flush")},De.prototype.partialFlush=function(){return this.flushStream("partialFlush")},De.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(r){r.reset()})},De.prototype.dispatchCea608Packet=function(r){this.setsTextOrXDSActive(r)?this.activeCea608Channel_[r.type]=null:this.setsChannel1Active(r)?this.activeCea608Channel_[r.type]=0:this.setsChannel2Active(r)&&(this.activeCea608Channel_[r.type]=1),this.activeCea608Channel_[r.type]!==null&&this.ccStreams_[(r.type<<1)+this.activeCea608Channel_[r.type]].push(r)},De.prototype.setsChannel1Active=function(r){return(r.ccData&30720)===4096},De.prototype.setsChannel2Active=function(r){return(r.ccData&30720)===6144},De.prototype.setsTextOrXDSActive=function(r){return(r.ccData&28928)===256||(r.ccData&30974)===4138||(r.ccData&30974)===6186},De.prototype.dispatchCea708Packet=function(r){this.parse708captions_&&this.cc708Stream_.push(r)};var Sm={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},xm=function(r){var l=Sm[r]||r;return r&4096&&r===l?"":String.fromCharCode(l)},nn=function(r){return 32<=r&&r<=127||160<=r&&r<=255}
179,ft=function(r){this.windowNum=r,this.reset()};ft.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},ft.prototype.getText=function(){return this.rows.join(`
180`)},ft.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},ft.prototype.newLine=function(r){for(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(r),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},ft.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},ft.prototype.addText=function(r){this.rows[this.rowIdx]+=r},ft.prototype.backspace=function(){if(!this.isEmpty()){var r=this.rows[this.rowIdx];this.rows[this.rowIdx]=r.substr(0,r.length-1)}};var rn=function(r,l,h){this.serviceNum=r,this.text="",this.currentWindow=new ft(-1),this.windows=[],this.stream=h,typeof l=="string"&&this.createTextDecoder(l)};rn.prototype.init=function(r,l){this.startPts=r;for(var h=0;h<8;h++)this.windows[h]=new ft(h),typeof l=="function"&&(this.windows[h].beforeRowOverflow=l)},rn.prototype.setCurrentWindow=function(r){this.currentWindow=this.windows[r]},rn.prototype.createTextDecoder=function(r){if(typeof TextDecoder=="undefined")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(r)}catch(l){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+r+" encoding. "+l})}};var re=function(r){r=r||{},re.prototype.init.call(this);var l=this,h=r.captionServices||{},d={},c;Object.keys(h).forEach(p=>{c=h[p],/^SERVICE/.test(p)&&(d[p]=c.encoding)}),this.serviceEncodings=d,this.current708Packet=null,this.services={},this.push=function(p){p.type===3?(l.new708Packet(),l.add708Bytes(p)):(l.current708Packet===null&&l.new708Packet(),l.add708Bytes(p))}};re.prototype=new Jr,re.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},re.prototype.add708Bytes=function(r){var l=r.ccData,h=l>>>8,d=l&255;this.current708Packet.ptsVals.push(r.pts),this.current708Packet.data.push(h),this.current708Packet.data.push(d)},re.prototype.push708Packet=function(){var r=this.current708Packet,l=r.data,h=null,d=null,c=0,p=l[c++];for(r.seq=p>>6,r.sizeCode=p&63;c<l.length;c++)p=l[c++],h=p>>5,d=p&31,h===7&&d>0&&(p=l[c++],h=p),this.pushServiceBlock(h,c,d),d>0&&(c+=d-1)},re.prototype.pushServiceBlock=function(r,l,h){var d,c=l,p=this.current708Packet.data,_=this.services[r];for(_||(_=this.initService(r,c));c<l+h&&c<p.length;c++)d=p[c],nn(d)?c=this.handleText(c,_):d===24?c=this.multiByteCharacter(c,_):d===16?c=this.extendedCommands(c,_):128<=d&&d<=135?c=this.setCurrentWindow(c,_):152<=d&&d<=159?c=this.defineWindow(c,_):d===136?c=this.clearWindows(c,_):d===140?c=this.deleteWindows(c,_):d===137?c=this.displayWindows(c,_):d===138?c=this.hideWindows(c,_):d===139?c=this.toggleWindows(c,_):d===151?c=this.setWindowAttributes(c,_):d===144?c=this.setPenAttributes(c,_):d===145?c=this.setPenColor(c,_):d===146?c=this.setPenLocation(c,_):d===143?_=this.reset(c,_):d===8?_.currentWindow.backspace():d===12?_.currentWindow.clearText():d===13?_.currentWindow.pendingNewLine=!0:d===14?_.currentWindow.clearText():d===141&&c++},re.prototype.extendedCommands=function(r,l){var h=this.current708Packet.data,d=h[++r];return nn(d)&&(r=this.handleText(r,l,{isExtended:!0})),r},re.prototype.getPts=function(r){return this.current708Packet.ptsVals[Math.floor(r/2)]},re.prototype.initService=function(r,l){var d="SERVICE"+r,h=this,d,c;return d in this.serviceEncodings&&(c=this.serviceEncodings[d]),this.services[r]=new rn(r,c,h),this.services[r].init(this.getPts(l),function(p){h.flushDisplayed(p,h.services[r])}),this.services[r]},re.prototype.handleText=function(r,l,h){var d=h&&h.isExtended,c=h&&h.isMultiByte,p=this.current708Packet.data,_=d?4096:0,y=p[r],T=p[r+1],v=l.currentWindow,x,w;function j(L){return L.map(z=>("0"+(z&255).toString(16)).slice(-2)).join("")}if(c?(w=[y,T],r++):w=[y],l.textDecoder_&&!d)x=l.textDecoder_.decode(new Uint8Array(w));else if(c){const L=j(w);x=String.fromCharCode(parseInt(L,16))}else x=xm(_|y);return v.pendingNewLine&&!v.isEmpty()&&v.newLine(this.getPts(r)),v.pendingNewLine=!1,v.addText(x),r},re.prototype.multiByteCharacter=function(r,l){var h=this.current708Packet.data,d=h[r+1],c=h[r+2];return nn(d)&&nn(c)&&(r=this.handleText(++r,l,{isMultiByte:!0})),r},re.prototype.setCurrentWindow=function(r,l){var h=this.current708Packet.data,d=h[r],c=d&7;return l.setCurrentWindow(c),r},re.prototype.defineWindow=function(r,l){var h=this.current708Packet.data,d=h[r],c=d&7;l.setCurrentWindow(c);var p=l.currentWindow;return d=h[++r],p.visible=(d&32)>>5,p.rowLock=(d&16)>>4,p.columnLock=(d&8)>>3,p.priority=d&7,d=h[++r],p.relativePositioning=(d&128)>>7,p.anchorVertical=d&127,d=h[++r],p.anchorHorizontal=d,d=h[++r],p.anchorPoint=(d&240)>>4,p.rowCount=d&15,d=h[++r],p.columnCount=d&63,d=h[++r],p.windowStyle=(d&56)>>3,p.penStyle=d&7,p.virtualRowCount=p.rowCount+1,r},re.prototype.setWindowAttributes=function(r,l){var h=this.current708Packet.data,d=h[r],c=l.currentWindow.winAttr;return d=h[++r],c.fillOpacity=(d&192)>>6,c.fillRed=(d&48)>>4,c.fillGreen=(d&12)>>2,c.fillBlue=d&3,d=h[++r],c.borderType=(d&192)>>6,c.borderRed=(d&48)>>4,c.borderGreen=(d&12)>>2,c.borderBlue=d&3,d=h[++r],c.borderType+=(d&128)>>5,c.wordWrap=(d&64)>>6,c.printDirection=(d&48)>>4,c.scrollDirection=(d&12)>>
1802,c.justify=d&3,d=h[++r],c.effectSpeed=(d&240)>>4,c.effectDirection=(d&12)>>2,c.displayEffect=d&3,r},re.prototype.flushDisplayed=function(r,l){for(var h=[],d=0;d<8;d++)l.windows[d].visible&&!l.windows[d].isEmpty()&&h.push(l.windows[d].getText());l.endPts=r,l.text=h.join(`
181
182`),this.pushCaption(l),l.startPts=r},re.prototype.pushCaption=function(r){r.text!==""&&(this.trigger("data",{startPts:r.startPts,endPts:r.endPts,text:r.text,stream:"cc708_"+r.serviceNum}),r.text="",r.startPts=r.endPts)},re.prototype.displayWindows=function(r,l){var h=this.current708Packet.data,d=h[++r],c=this.getPts(r);this.flushDisplayed(c,l);for(var p=0;p<8;p++)d&1<<p&&(l.windows[p].visible=1);return r},re.prototype.hideWindows=function(r,l){var h=this.current708Packet.data,d=h[++r],c=this.getPts(r);this.flushDisplayed(c,l);for(var p=0;p<8;p++)d&1<<p&&(l.windows[p].visible=0);return r},re.prototype.toggleWindows=function(r,l){var h=this.current708Packet.data,d=h[++r],c=this.getPts(r);this.flushDisplayed(c,l);for(var p=0;p<8;p++)d&1<<p&&(l.windows[p].visible^=1);return r},re.prototype.clearWindows=function(r,l){var h=this.current708Packet.data,d=h[++r],c=this.getPts(r);this.flushDisplayed(c,l);for(var p=0;p<8;p++)d&1<<p&&l.windows[p].clearText();return r},re.prototype.deleteWindows=function(r,l){var h=this.current708Packet.data,d=h[++r],c=this.getPts(r);this.flushDisplayed(c,l);for(var p=0;p<8;p++)d&1<<p&&l.windows[p].reset();return r},re.prototype.setPenAttributes=function(r,l){var h=this.current708Packet.data,d=h[r],c=l.currentWindow.penAttr;return d=h[++r],c.textTag=(d&240)>>4,c.offset=(d&12)>>2,c.penSize=d&3,d=h[++r],c.italics=(d&128)>>7,c.underline=(d&64)>>6,c.edgeType=(d&56)>>3,c.fontStyle=d&7,r},re.prototype.setPenColor=function(r,l){var h=this.current708Packet.data,d=h[r],c=l.currentWindow.penColor;return d=h[++r],c.fgOpacity=(d&192)>>6,c.fgRed=(d&48)>>4,c.fgGreen=(d&12)>>2,c.fgBlue=d&3,d=h[++r],c.bgOpacity=(d&192)>>6,c.bgRed=(d&48)>>4,c.bgGreen=(d&12)>>2,c.bgBlue=d&3,d=h[++r],c.edgeRed=(d&48)>>4,c.edgeGreen=(d&12)>>2,c.edgeBlue=d&3,r},re.prototype.setPenLocation=function(r,l){var h=this.current708Packet.data,d=h[r],c=l.currentWindow.penLoc;return l.currentWindow.pendingNewLine=!0,d=h[++r],c.row=d&15,d=h[++r],c.column=d&63,r},re.prototype.reset=function(r,l){var h=this.getPts(r);return this.flushDisplayed(h,l),this.initService(l.serviceNum,r)};var Cm={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},an=function(r){return r===null?"":(r=Cm[r]||r,String.fromCharCode(r))},on=14,Em=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Wt=function(){for(var r=[],l=on+1;l--;)r.push({text:"",indent:0,offset:0});return r},ue=function(r,l){ue.prototype.init.call(this),this.field_=r||0,this.dataChannel_=l||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(h){var d,c,p,_,y;if(d=h.ccData&32639,d===this.lastControlCode_){this.lastControlCode_=null;return}if((d&61440)===4096?this.lastControlCode_=d:d!==this.PADDING_&&(this.lastControlCode_=null),p=d>>>8,_=d&255,d!==this.PADDING_)if(d===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(d===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(h.pts),this.flushDisplayed(h.pts),c=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=c,this.startPts_=h.pts;else if(d===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(h.pts);else if(d===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(h.pts);else if(d===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(h.pts);else if(d===this.CARRIAGE_RETURN_)this.clearFormatting(h.pts),this.flushDisplayed(h.pts),this.shiftRowsUp_(),this.startPts_=h.pts;else if(d===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(d===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(h.pts),this.displayed_=Wt();else if(d===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Wt();else if(d===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(h.pts),this.displayed_=Wt()),this.mode_="paintOn",this.startPts_=h.pts;else if(this.isSpecialCharacter(p,_))p=(p&3)<<8,y=an(p|_),this[this.mode_](h.pts,y),this.column_++;else if(this.isExtCharacter(p,_))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),p=(p&3)<<8,y=an(p|_),this[this.mode_](h.pts,y),this.column_++;else if(this.isMidRowCode(p,_))this.clearFormatting(h.pts),this[this.mode_](h.pts," "),this.column_++,(_&14)===14&&this.addFormatting(h.pts,["i"]),(_&1)===1&&this.addFormatting(h.pts,["u"]);else if(this.isOffsetControlCode(p,_)){const v=_&3;this.nonDisplayed_[this.row_].offset=v,this.column_+=v}else if(this.isPAC(p,_)){var T=Em.indexOf(d&7968);
182if(this.mode_==="rollUp"&&(T-this.rollUpRows_+1<0&&(T=this.rollUpRows_-1),this.setRollUp(h.pts,T)),T!==this.row_&&T>=0&&T<=14&&(this.clearFormatting(h.pts),this.row_=T),_&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(h.pts,["u"]),(d&16)===16){const v=(d&14)>>1;this.column_=v*4,this.nonDisplayed_[this.row_].indent+=v}this.isColorPAC(_)&&(_&14)===14&&this.addFormatting(h.pts,["i"])}else this.isNormalChar(p)&&(_===0&&(_=null),y=an(p),y+=an(_),this[this.mode_](h.pts,y),this.column_+=y.length)}};ue.prototype=new Jr,ue.prototype.flushDisplayed=function(r){const l=d=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+d+"."})},h=[];this.displayed_.forEach((d,c)=>{if(d&&d.text&&d.text.length){try{d.text=d.text.trim()}catch(p){l(c)}d.text.length&&h.push({text:d.text,line:c+1,position:10+Math.min(70,d.indent*10)+d.offset*2.5})}else d==null&&l(c)}),h.length&&this.trigger("data",{startPts:this.startPts_,endPts:r,content:h,stream:this.name_})},ue.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Wt(),this.nonDisplayed_=Wt(),this.lastControlCode_=null,this.column_=0,this.row_=on,this.rollUpRows_=2,this.formatting_=[]},ue.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},ue.prototype.isSpecialCharacter=function(r,l){return r===this.EXT_&&l>=48&&l<=63},ue.prototype.isExtCharacter=function(r,l){return(r===this.EXT_+1||r===this.EXT_+2)&&l>=32&&l<=63},ue.prototype.isMidRowCode=function(r,l){return r===this.EXT_&&l>=32&&l<=47},ue.prototype.isOffsetControlCode=function(r,l){return r===this.OFFSET_&&l>=33&&l<=35},ue.prototype.isPAC=function(r,l){return r>=this.BASE_&&r<this.BASE_+8&&l>=64&&l<=127},ue.prototype.isColorPAC=function(r){return r>=64&&r<=79||r>=96&&r<=127},ue.prototype.isNormalChar=function(r){return r>=32&&r<=127},ue.prototype.setRollUp=function(r,l){if(this.mode_!=="rollUp"&&(this.row_=on,this.mode_="rollUp",this.flushDisplayed(r),this.nonDisplayed_=Wt(),this.displayed_=Wt()),l!==void 0&&l!==this.row_)for(var h=0;h<this.rollUpRows_;h++)this.displayed_[l-h]=this.displayed_[this.row_-h],this.displayed_[this.row_-h]={text:"",indent:0,offset:0};l===void 0&&(l=this.row_),this.topRow_=l-this.rollUpRows_+1},ue.prototype.addFormatting=function(r,l){this.formatting_=this.formatting_.concat(l);var h=l.reduce(function(d,c){return d+"<"+c+">"},"");this[this.mode_](r,h)},ue.prototype.clearFormatting=function(r){if(this.formatting_.length){var l=this.formatting_.reverse().reduce(function(h,d){return h+"</"+d+">"},"");this.formatting_=[],this[this.mode_](r,l)}},ue.prototype.popOn=function(r,l){var h=this.nonDisplayed_[this.row_].text;h+=l,this.nonDisplayed_[this.row_].text=h},ue.prototype.rollUp=function(r,l){var h=this.displayed_[this.row_].text;h+=l,this.displayed_[this.row_].text=h},ue.prototype.shiftRowsUp_=function(){var r;for(r=0;r<this.topRow_;r++)this.displayed_[r]={text:"",indent:0,offset:0};for(r=this.row_+1;r<on+1;r++)this.displayed_[r]={text:"",indent:0,offset:0};for(r=this.topRow_;r<this.row_;r++)this.displayed_[r]=this.displayed_[r+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},ue.prototype.paintOn=function(r,l){var h=this.displayed_[this.row_].text;h+=l,this.displayed_[this.row_].text=h};var Xh={CaptionStream:De,Cea608Stream:ue,Cea708Stream:re},ln={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},km=t,wm=8589934592,Im=4294967296,Jh="shared",Zr=function(r,l){var h=1;for(r>l&&(h=-1);Math.abs(l-r)>Im;)r+=h*wm;return r},ea=function(r){var l,h;ea.prototype.init.call(this),this.type_=r||Jh,this.push=function(d){if(d.type==="metadata"){this.trigger("data",d);return}this.type_!==Jh&&d.type!==this.type_||(h===void 0&&(h=d.dts),d.dts=Zr(d.dts,h),d.pts=Zr(d.pts,h),l=d.dts,this.trigger("data",d))},this.flush=function(){h=l,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){h=void 0,l=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};ea.prototype=new km;var Zh={TimestampRolloverStream:ea,handleRollover:Zr},Pm=(r,l,h)=>
182{if(!r)return-1;for(var d=h;d<r.length;d++)if(r[d]===l)return d;return-1},Am={typedArrayIndexOf:Pm},hn=Am.typedArrayIndexOf,dn={Iso88591:0,Utf16:1,Utf16be:2,Utf8:3},ed=function(r,l,h){var d,c="";for(d=l;d<h;d++)c+="%"+("00"+r[d].toString(16)).slice(-2);return c},qi=function(r,l,h){return decodeURIComponent(ed(r,l,h))},zi=function(r,l,h){return unescape(ed(r,l,h))},Wi=function(r){return r[0]<<21|r[1]<<14|r[2]<<7|r[3]},Gi={APIC:function(r){var l=1,h,d,c="-->";r.data[0]===dn.Utf8&&(h=hn(r.data,0,l),!(h<0)&&(r.mimeType=zi(r.data,l,h),l=h+1,r.pictureType=r.data[l],l++,d=hn(r.data,0,l),!(d<0)&&(r.description=qi(r.data,l,d),l=d+1,r.mimeType===c?r.url=zi(r.data,l,r.data.length):r.pictureData=r.data.subarray(l,r.data.length))))},"T*":function(r){r.data[0]===dn.Utf8&&(r.value=qi(r.data,1,r.data.length).replace(/\0*$/,""),r.values=r.value.split("\0"))},TXXX:function(r){var l;r.data[0]===dn.Utf8&&(l=hn(r.data,0,1),l!==-1&&(r.description=qi(r.data,1,l),r.value=qi(r.data,l+1,r.data.length).replace(/\0*$/,""),r.data=r.value))},"W*":function(r){r.url=zi(r.data,0,r.data.length).replace(/\0.*$/,"")},WXXX:function(r){var l;r.data[0]===dn.Utf8&&(l=hn(r.data,0,1),l!==-1&&(r.description=qi(r.data,1,l),r.url=zi(r.data,l+1,r.data.length).replace(/\0.*$/,"")))},PRIV:function(r){var l;for(l=0;l<r.data.length;l++)if(r.data[l]===0){r.owner=zi(r.data,0,l);break}r.privateData=r.data.subarray(l+1),r.data=r.privateData}},Lm=function(r){var l,h,d=10,c=0,p=[];if(!(r.length<10||r[0]!==73||r[1]!==68||r[2]!==51)){c=Wi(r.subarray(6,10)),c+=10;var _=r[5]&64;_&&(d+=4,d+=Wi(r.subarray(10,14)),c-=Wi(r.subarray(16,20)));do{if(l=Wi(r.subarray(d+4,d+8)),l<1)break;h=String.fromCharCode(r[d],r[d+1],r[d+2],r[d+3]);var y={id:h,data:r.subarray(d+10,d+l+10)};y.key=y.id,Gi[y.id]?Gi[y.id](y):y.id[0]==="T"?Gi["T*"](y):y.id[0]==="W"&&Gi["W*"](y),p.push(y),d+=10,d+=l}while(d<c);return p}},td={parseId3Frames:Lm,parseSyncSafeInteger:Wi,frameParsers:Gi},Dm=t,Om=ln,Et=td,un;un=function(r){var l={descriptor:r&&r.descriptor},h=0,d=[],c=0,p;if(un.prototype.init.call(this),this.dispatchType=Om.METADATA_STREAM_TYPE.toString(16),l.descriptor)for(p=0;p<l.descriptor.length;p++)this.dispatchType+=("00"+l.descriptor[p].toString(16)).slice(-2);this.push=function(_){var y,T,v,x,w,j;if(_.type==="timed-metadata"){if(_.dataAlignmentIndicator&&(c=0,d.length=0),d.length===0&&(_.data.length<10||_.data[0]!==73||_.data[1]!==68||_.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(d.push(_),c+=_.data.byteLength,d.length===1&&(h=Et.parseSyncSafeInteger(_.data.subarray(6,10)),h+=10),!(c<h)){for(y={data:new Uint8Array(h),frames:[],pts:d[0].pts,dts:d[0].dts},w=0;w<h;)y.data.set(d[0].data.subarray(0,h-w),w),w+=d[0].data.byteLength,c-=d[0].data.byteLength,d.shift();T=10,y.data[5]&64&&(T+=4,T+=Et.parseSyncSafeInteger(y.data.subarray(10,14)),h-=Et.parseSyncSafeInteger(y.data.subarray(16,20)));do{if(v=Et.parseSyncSafeInteger(y.data.subarray(T+4,T+8)),v<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if(j=String.fromCharCode(y.data[T],y.data[T+1],y.data[T+2],y.data[T+3]),x={id:j,data:y.data.subarray(T+10,T+v+10)},x.key=x.id,Et.frameParsers[x.id]?Et.frameParsers[x.id](x):x.id[0]==="T"?Et.frameParsers["T*"](x):x.id[0]==="W"&&Et.frameParsers["W*"](x),x.owner==="com.apple.streaming.transportStreamTimestamp"){var L=x.data,z=(L[3]&1)<<30|L[4]<<22|L[5]<<14|L[6]<<6|L[7]>>>2;z*=4,z+=L[7]&3,x.timeStamp=z,y.pts===void 0&&y.dts===void 0&&(y.pts=x.timeStamp,y.dts=x.timeStamp),this.trigger("timestamp",x)}y.frames.push(x),T+=10,T+=v}while(T<h);this.trigger("data",y)}}}},un.prototype=new Dm;var Mm=un,ta=t,ia=Xh,Ke=ln,Rm=Zh.TimestampRolloverStream,cn,Ki,fn,vi=188,sa=71;cn=function(){var r=new Uint8Array(vi),l=0;cn.prototype.init.call(this),this.push=function(h){var d=0,c=vi,p;for(l?(p=new Uint8Array(h.byteLength+l),p.set(r.subarray(0,l)),p.set(h,l),l=0):p=h;c<p.byteLength;){if(p[d]===sa&&p[c]===sa){this.trigger("data",p.subarray(d,c)),d+=vi,c+=vi;continue}d++,c++}d<p.byteLength&&(r.set(p.subarray(d),0),l=p.byteLength-d)},this.flush=function(){l===vi&&r[0]===sa&&(this.trigger("data",r),l=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){l=0,this.trigger("reset")}},cn.prototype=new ta,Ki=function(){var r,l,h,d;Ki.prototype.init.call(this),d=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,r=function(c,p){var _=0;p.payloadUnitStartIndicator&&(_+=c[_]+1),p.type==="pat"?l(c.subarray(_),p):h(c.subarray(_),p)},l=function(c,p){p.section_number=c[7],p.last_section_number=c[8],d.pmtPid=(c[10]&31)<<8|c[11],p.pmtPid=d.pmtPid},h=function(c,p){var _,y,T,v;
182if(c[5]&1){for(d.programMapTable={video:null,audio:null,"timed-metadata":{}},_=(c[1]&15)<<8|c[2],y=3+_-4,T=(c[10]&15)<<8|c[11],v=12+T;v<y;){var x=c[v],w=(c[v+1]&31)<<8|c[v+2];x===Ke.H264_STREAM_TYPE&&d.programMapTable.video===null?d.programMapTable.video=w:x===Ke.ADTS_STREAM_TYPE&&d.programMapTable.audio===null?d.programMapTable.audio=w:x===Ke.METADATA_STREAM_TYPE&&(d.programMapTable["timed-metadata"][w]=x),v+=((c[v+3]&15)<<8|c[v+4])+5}p.programMapTable=d.programMapTable}},this.push=function(c){var p={},_=4;if(p.payloadUnitStartIndicator=!!(c[1]&64),p.pid=c[1]&31,p.pid<<=8,p.pid|=c[2],(c[3]&48)>>>4>1&&(_+=c[_]+1),p.pid===0)p.type="pat",r(c.subarray(_),p),this.trigger("data",p);else if(p.pid===this.pmtPid)for(p.type="pmt",r(c.subarray(_),p),this.trigger("data",p);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([c,_,p]):this.processPes_(c,_,p)},this.processPes_=function(c,p,_){_.pid===this.programMapTable.video?_.streamType=Ke.H264_STREAM_TYPE:_.pid===this.programMapTable.audio?_.streamType=Ke.ADTS_STREAM_TYPE:_.streamType=this.programMapTable["timed-metadata"][_.pid],_.type="pes",_.data=c.subarray(p),this.trigger("data",_)}},Ki.prototype=new ta,Ki.STREAM_TYPES={h264:27,adts:15},fn=function(){var r=this,l=!1,h={data:[],size:0},d={data:[],size:0},c={data:[],size:0},p,_=function(T,v){var x;const w=T[0]<<16|T[1]<<8|T[2];v.data=new Uint8Array,w===1&&(v.packetLength=6+(T[4]<<8|T[5]),v.dataAlignmentIndicator=(T[6]&4)!==0,x=T[7],x&192&&(v.pts=(T[9]&14)<<27|(T[10]&255)<<20|(T[11]&254)<<12|(T[12]&255)<<5|(T[13]&254)>>>3,v.pts*=4,v.pts+=(T[13]&6)>>>1,v.dts=v.pts,x&64&&(v.dts=(T[14]&14)<<27|(T[15]&255)<<20|(T[16]&254)<<12|(T[17]&255)<<5|(T[18]&254)>>>3,v.dts*=4,v.dts+=(T[18]&6)>>>1)),v.data=T.subarray(9+T[8]))},y=function(T,v,x){var w=new Uint8Array(T.size),j={type:v},L=0,z=0,G=!1,Te;if(!(!T.data.length||T.size<9)){for(j.trackId=T.data[0].pid,L=0;L<T.data.length;L++)Te=T.data[L],w.set(Te.data,z),z+=Te.data.byteLength;_(w,j),G=v==="video"||j.packetLength<=T.size,(x||G)&&(T.size=0,T.data.length=0),G&&r.trigger("data",j)}};fn.prototype.init.call(this),this.push=function(T){({pat:function(){},pes:function(){var v,x;switch(T.streamType){case Ke.H264_STREAM_TYPE:v=h,x="video";break;case Ke.ADTS_STREAM_TYPE:v=d,x="audio";break;case Ke.METADATA_STREAM_TYPE:v=c,x="timed-metadata";break;default:return}T.payloadUnitStartIndicator&&y(v,x,!0),v.data.push(T),v.size+=T.data.byteLength},pmt:function(){var v={type:"metadata",tracks:[]};p=T.programMapTable,p.video!==null&&v.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+p.video,codec:"avc",type:"video"}),p.audio!==null&&v.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+p.audio,codec:"adts",type:"audio"}),l=!0,r.trigger("data",v)}})[T.type]()},this.reset=function(){h.size=0,h.data.length=0,d.size=0,d.data.length=0,this.trigger("reset")},this.flushStreams_=function(){y(h,"video"),y(d,"audio"),y(c,"timed-metadata")},this.flush=function(){if(!l&&p){var T={type:"metadata",tracks:[]};p.video!==null&&T.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+p.video,codec:"avc",type:"video"}),p.audio!==null&&T.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+p.audio,codec:"adts",type:"audio"}),r.trigger("data",T)}l=!1,this.flushStreams_(),this.trigger("done")}},fn.prototype=new ta;var id={PAT_PID:0,MP2T_PACKET_LENGTH:vi,TransportPacketStream:cn,TransportParseStream:Ki,ElementaryStream:fn,TimestampRolloverStream:Rm,CaptionStream:ia.CaptionStream,Cea608Stream:ia.Cea608Stream,Cea708Stream:ia.Cea708Stream,MetadataStream:Mm};for(var na in Ke)Ke.hasOwnProperty(na)&&(id[na]=Ke[na]);var Um=id,Bm=t,Fm=ae.ONE_SECOND_IN_TS,pn,sd=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];pn=function(r){var l,h=0;pn.prototype.init.call(this),this.skipWarn_=function(d,c){this.trigger("log",{level:"warn",message:`adts ski
182ping bytes ${d} to ${c} in frame ${h} outside syncword`})},this.push=function(d){var c=0,p,_,y,T,v;if(r||(h=0),d.type==="audio"){l&&l.length?(y=l,l=new Uint8Array(y.byteLength+d.data.byteLength),l.set(y),l.set(d.data,y.byteLength)):l=d.data;for(var x;c+7<l.length;){if(l[c]!==255||(l[c+1]&246)!==240){typeof x!="number"&&(x=c),c++;continue}if(typeof x=="number"&&(this.skipWarn_(x,c),x=null),_=(~l[c+1]&1)*2,p=(l[c+3]&3)<<11|l[c+4]<<3|(l[c+5]&224)>>5,T=((l[c+6]&3)+1)*1024,v=T*Fm/sd[(l[c+2]&60)>>>2],l.byteLength-c<p)break;this.trigger("data",{pts:d.pts+h*v,dts:d.dts+h*v,sampleCount:T,audioobjecttype:(l[c+2]>>>6&3)+1,channelcount:(l[c+2]&1)<<2|(l[c+3]&192)>>>6,samplerate:sd[(l[c+2]&60)>>>2],samplingfrequencyindex:(l[c+2]&60)>>>2,samplesize:16,data:l.subarray(c+7+_,c+p)}),h++,c+=p}typeof x=="number"&&(this.skipWarn_(x,c),x=null),l=l.subarray(c)}},this.flush=function(){h=0,this.trigger("done")},this.reset=function(){l=void 0,this.trigger("reset")},this.endTimeline=function(){l=void 0,this.trigger("endedtimeline")}},pn.prototype=new Bm;var Nm=pn,nd;nd=function(r){var l=r.byteLength,h=0,d=0;this.length=function(){return 8*l},this.bitsAvailable=function(){return 8*l+d},this.loadWord=function(){var c=r.byteLength-l,p=new Uint8Array(4),_=Math.min(4,l);if(_===0)throw new Error("no bytes available");p.set(r.subarray(c,c+_)),h=new DataView(p.buffer).getUint32(0),d=_*8,l-=_},this.skipBits=function(c){var p;d>c?(h<<=c,d-=c):(c-=d,p=Math.floor(c/8),c-=p*8,l-=p,this.loadWord(),h<<=c,d-=c)},this.readBits=function(c){var p=Math.min(d,c),_=h>>>32-p;return d-=p,d>0?h<<=p:l>0&&this.loadWord(),p=c-p,p>0?_<<p|this.readBits(p):_},this.skipLeadingZeros=function(){var c;for(c=0;c<d;++c)if((h&2147483648>>>c)!==0)return h<<=c,d-=c,c;return this.loadWord(),c+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var c=this.skipLeadingZeros();return this.readBits(c+1)-1},this.readExpGolomb=function(){var c=this.readUnsignedExpGolomb();return 1&c?1+c>>>1:-1*(c>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var jm=nd,rd=t,$m=jm,mn,Qi,ad;Qi=function(){var r=0,l,h;Qi.prototype.init.call(this),this.push=function(d){var c;h?(c=new Uint8Array(h.byteLength+d.data.byteLength),c.set(h),c.set(d.data,h.byteLength),h=c):h=d.data;for(var p=h.byteLength;r<p-3;r++)if(h[r+2]===1){l=r+5;break}for(;l<p;)switch(h[l]){case 0:if(h[l-1]!==0){l+=2;break}else if(h[l-2]!==0){l++;break}r+3!==l-2&&this.trigger("data",h.subarray(r+3,l-2));do l++;while(h[l]!==1&&l<p);r=l-2,l+=3;break;case 1:if(h[l-1]!==0||h[l-2]!==0){l+=3;break}this.trigger("data",h.subarray(r+3,l-2)),r=l-2,l+=3;break;default:l+=3;break}h=h.subarray(r),l-=r,r=0},this.reset=function(){h=null,r=0,this.trigger("reset")},this.flush=function(){h&&h.byteLength>3&&this.trigger("data",h.subarray(r+3)),h=null,r=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Qi.prototype=new rd,ad={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},mn=function(){var r=new Qi,l,h,d,c,p,_,y;mn.prototype.init.call(this),l=this,this.push=function(T){T.type==="video"&&(h=T.trackId,d=T.pts,c=T.dts,r.push(T))},r.on("data",function(T){var v={trackId:h,pts:d,dts:c,data:T,nalUnitTypeCode:T[0]&3
1821};switch(v.nalUnitTypeCode){case 5:v.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:v.nalUnitType="sei_rbsp",v.escapedRBSP=p(T.subarray(1));break;case 7:v.nalUnitType="seq_parameter_set_rbsp",v.escapedRBSP=p(T.subarray(1)),v.config=_(v.escapedRBSP);break;case 8:v.nalUnitType="pic_parameter_set_rbsp";break;case 9:v.nalUnitType="access_unit_delimiter_rbsp";break}l.trigger("data",v)}),r.on("done",function(){l.trigger("done")}),r.on("partialdone",function(){l.trigger("partialdone")}),r.on("reset",function(){l.trigger("reset")}),r.on("endedtimeline",function(){l.trigger("endedtimeline")}),this.flush=function(){r.flush()},this.partialFlush=function(){r.partialFlush()},this.reset=function(){r.reset()},this.endTimeline=function(){r.endTimeline()},y=function(T,v){var x=8,w=8,j,L;for(j=0;j<T;j++)w!==0&&(L=v.readExpGolomb(),w=(x+L+256)%256),x=w===0?x:w},p=function(T){for(var v=T.byteLength,x=[],w=1,j,L;w<v-2;)T[w]===0&&T[w+1]===0&&T[w+2]===3?(x.push(w+2),w+=2):w++;if(x.length===0)return T;j=v-x.length,L=new Uint8Array(j);var z=0;for(w=0;w<j;z++,w++)z===x[0]&&(z++,x.shift()),L[w]=T[z];return L},_=function(T){var v=0,x=0,w=0,j=0,L,z,G,Te,Be,It,ss,ns,rs,as,wn,oe=[1,1],os,Ye;if(L=new $m(T),z=L.readUnsignedByte(),Te=L.readUnsignedByte(),G=L.readUnsignedByte(),L.skipUnsignedExpGolomb(),ad[z]&&(Be=L.readUnsignedExpGolomb(),Be===3&&L.skipBits(1),L.skipUnsignedExpGolomb(),L.skipUnsignedExpGolomb(),L.skipBits(1),L.readBoolean()))for(wn=Be!==3?8:12,Ye=0;Ye<wn;Ye++)L.readBoolean()&&(Ye<6?y(16,L):y(64,L));if(L.skipUnsignedExpGolomb(),It=L.readUnsignedExpGolomb(),It===0)L.readUnsignedExpGolomb();else if(It===1)for(L.skipBits(1),L.skipExpGolomb(),L.skipExpGolomb(),ss=L.readUnsignedExpGolomb(),Ye=0;Ye<ss;Ye++)L.skipExpGolomb();if(L.skipUnsignedExpGolomb(),L.skipBits(1),ns=L.readUnsignedExpGolomb(),rs=L.readUnsignedExpGolomb(),as=L.readBits(1),as===0&&L.skipBits(1),L.skipBits(1),L.readBoolean()&&(v=L.readUnsignedExpGolomb(),x=L.readUnsignedExpGolomb(),w=L.readUnsignedExpGolomb(),j=L.readUnsignedExpGolomb()),L.readBoolean()&&L.readBoolean()){switch(os=L.readUnsignedByte(),os){case 1:oe=[1,1];break;case 2:oe=[12,11];break;case 3:oe=[10,11];break;case 4:oe=[16,11];break;case 5:oe=[40,33];break;case 6:oe=[24,11];break;case 7:oe=[20,11];break;case 8:oe=[32,11];break;case 9:oe=[80,33];break;case 10:oe=[18,11];break;case 11:oe=[15,11];break;case 12:oe=[64,33];break;case 13:oe=[160,99];break;case 14:oe=[4,3];break;case 15:oe=[3,2];break;case 16:oe=[2,1];break;case 255:{oe=[L.readUnsignedByte()<<8|L.readUnsignedByte(),L.readUnsignedByte()<<8|L.readUnsignedByte()];break}}oe&&oe[0]/oe[1]}return{profileIdc:z,levelIdc:G,profileCompatibility:Te,width:(ns+1)*16-v*2-x*2,height:(2-as)*(rs+1)*16-w*2-j*2,sarRatio:oe}}},mn.prototype=new rd;var Hm={H264Stream:mn,NalByteStream:Qi},Vm=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],od=function(r,l){var h=r[l+6]<<21|r[l+7]<<14|r[l+8]<<7|r[l+9],d=r[l+5],c=(d&16)>>4;return h=h>=0?h:0,c?h+20:h+10},ld=function(r,l){return r.length-l<10||r[l]!==73||r[l+1]!==68||r[l+2]!==51?l:(l+=od(r,l),ld(r,l))},qm=function(r){var l=ld(r,0);return r.length>=l+2&&(r[l]&255)===255&&(r[l+1]&240)===240&&(r[l+1]&22)===16},hd=function(r){return r[0]<<21|r[1]<<14|r[2]<<7|r[3]},zm=function(r,l,h){var d,c="";for(d=l;d<h;d++)c+="%"+("00"+r[d].toString(16)).slice(-2);return c},Wm=function(r,l,h){return unescape(zm(r,l,h))},Gm=function(r,l){var h=(r[l+5]&224)>>5,d=r[l+4]<<3,c=r[l+3]&6144;return c|d|h},Km=function(r,l){return r[l]===73&&r[l+1]===68&&r[l+2]===51?"timed-metadata":r[l]&!0&&(r[l+1]&240)===240?"audio":null},Qm=function(r){for(var l=0;l+5<r.length;){if(r[l]!==255||(r[l+1]&246)!==240){l++;continue}return Vm[(r[l+2]&60)>>>2]}return null},Ym=function(r){var l,h,d,c;l=10,r[5]&64&&(l+=4,l+=hd(r.subarray(10,14)));do{if(h=hd(r.subarray(l+4,l+8)),h<1)return null;if(c=String.fromCharCode(r[l],r[l+1],r[l+2],r[l+3]),c==="PRIV"){d=r.subarray(l+10,l+h+10);for(var p=0;p<d.byteLength;p++)if(d[p]===0){var _=Wm(d,0,p);if(_==="com.apple.streaming.transportStreamTimestamp"){var y=d.subarray(p+1),T=(y[3]&1)<<30|y[4]<<22|y[5]<<14|y[6]<<6|y[7]>>>2;return T*=4,T+=y[7]&3,T}break}}l+=10,l+=h}while(l<r.byteLength);return null},ra={isLikelyAacData:qm,parseId3TagSize:od,parseAdtsSize:Gm,parseType:Km,parseSampleRate:Qm,parseAacTimestamp:Ym},Xm=t,dd=ra,gn;
182gn=function(){var r=new Uint8Array,l=0;gn.prototype.init.call(this),this.setTimestamp=function(h){l=h},this.push=function(h){var d=0,c=0,p,_,y,T;for(r.length?(T=r.length,r=new Uint8Array(h.byteLength+T),r.set(r.subarray(0,T)),r.set(h,T)):r=h;r.length-c>=3;){if(r[c]===73&&r[c+1]===68&&r[c+2]===51){if(r.length-c<10||(d=dd.parseId3TagSize(r,c),c+d>r.length))break;_={type:"timed-metadata",data:r.subarray(c,c+d)},this.trigger("data",_),c+=d;continue}else if((r[c]&255)===255&&(r[c+1]&240)===240){if(r.length-c<7||(d=dd.parseAdtsSize(r,c),c+d>r.length))break;y={type:"audio",data:r.subarray(c,c+d),pts:l,dts:l},this.trigger("data",y),c+=d;continue}c++}p=r.length-c,p>0?r=r.subarray(c):r=new Uint8Array},this.reset=function(){r=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){r=new Uint8Array,this.trigger("endedtimeline")}},gn.prototype=new Xm;var Jm=gn,Zm=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],eg=Zm,tg=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],ig=tg,_n=t,Yi=Gp,Xi=im,yn=um,Qe=gm,pt=Um,Tn=ae,ud=Nm,sg=Hm.H264Stream,ng=Jm,rg=ra.isLikelyAacData,ag=ae.ONE_SECOND_IN_TS,aa=eg,oa=ig,Ji,bi,vn,Gt,og=function(r,l){l.stream=r,this.trigger("log",l)},cd=function(r,l){for(var h=Object.keys(l),d=0;d<h.length;d++){var c=h[d];c==="headOfPipeline"||!l[c].on||l[c].on("log",og.bind(r,c))}},fd=function(r,l){var h;if(r.length!==l.length)return!1;for(h=0;h<r.length;h++)if(r[h]!==l[h])return!1;return!0},la=function(r,l,h,d,c,p){var _=h-l,y=d-l,T=c-h;return{start:{dts:r,pts:r+_},end:{dts:r+y,pts:r+T},prependedContentDuration:p,baseMediaDecodeTime:r}};bi=function(r,l){var h=[],d,c=0,p=0,_=1/0;l=l||{},d=l.firstSequenceNumber||0,bi.prototype.init.call(this),this.push=function(y){Qe.collectDtsInfo(r,y),r&&aa.forEach(function(T){r[T]=y[T]}),h.push(y)},this.setEarliestDts=function(y){c=y},this.setVideoBaseMediaDecodeTime=function(y){_=y},this.setAudioAppendStart=function(y){p=y},this.flush=function(){var y,T,v,x,w,j,L;if(h.length===0){this.trigger("done","AudioSegmentStream");return}y=yn.trimAdtsFramesByEarliestDts(h,r,c),r.baseMediaDecodeTime=Qe.calculateTrackBaseMediaDecodeTime(r,l.keepOriginalTimestamps),L=yn.prefixWithSilence(r,y,p,_),r.samples=yn.generateSampleTable(y),v=Yi.mdat(yn.concatenateFrameData(y)),h=[],T=Yi.moof(d,[r]),x=new Uint8Array(T.byteLength+v.byteLength),d++,x.set(T),x.set(v,T.byteLength),Qe.clearDtsInfo(r),w=Math.ceil(ag*1024/r.samplerate),y.length&&(j=y.length*w,this.trigger("segmentTimingInfo",la(Tn.audioTsToVideoTs(r.baseMediaDecodeTime,r.samplerate),y[0].dts,y[0].pts,y[0].dts+j,y[0].pts+j,L||0)),this.trigger("timingInfo",{start:y[0].pts,end:y[0].pts+j})),this.trigger("data",{track:r,boxes:x}),this.trigger("done","AudioSegmentStream")},this.reset=function(){Qe.clearDtsInfo(r),h=[],this.trigger("reset")}},bi.prototype=new _n,Ji=function(r,l){var h,d=[],c=[],p,_;l=l||{},h=l.firstSequenceNumber||0,Ji.prototype.init.call(this),delete r.minPTS,this.gopCache_=[],this.push=function(y){Qe.collectDtsInfo(r,y),y.nalUnitType==="seq_parameter_set_rbsp"&&!p&&(p=y.config,r.sps=[y.data],oa.forEach(function(T){r[T]=p[T]},this)),y.nalUnitType==="pic_parameter_set_rbsp"&&!_&&(_=y.data,r.pps=[y.data]),d.push(y)},this.flush=function(){for(var y,T,v,x,w,j,L=0,z,G;d.length&&d[0].nalUnitType!=="access_unit_delimiter_rbsp";)d.shift();if(d.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(y=Xi.groupNalsIntoFrames(d),v=Xi.groupFramesIntoGops(y),v[0][0].keyFrame||(T=this.getGopForFusion_(d[0],r),T?(L=T.duration,v.unshift(T),v.byteLength+=T.byteLength,v.nalCount+=T.nalCount,v.pts=T.pts,v.dts=T.dts,v.duration+=T.duration):v=Xi.extendFirstKeyFrame(v)),c.length){var Te;if(l.alignGopsAtEnd?Te=this.alignGopsAtEnd_(v):Te=this.alignGopsAtStart_(v),!Te){this.gopCache_.unshift({gop:v.pop(),pps:r.pps,sps:r.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),d=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}Qe.clearDtsInfo(r),v=Te}Qe.collectDtsInfo(r,v),r.samples=Xi.generateSampleTable(v),w=Yi.mdat(Xi.concatenateNalData(v)),r.baseMediaDecodeTime=Qe.calculateTrackBaseMediaDecodeTime(r,l.keepOriginalTimestamps),this.trigger("processedGopsInfo",v.map(function(Be){return{pts:Be.pts,dts:Be.dts,byteLength:Be.byteLength}})),z=v[0],G=v[v.length-1],this.trigger("segmentTimingInfo",la(r.baseMediaDecodeTime,z.dts,z.pts,G.dts+G.duration,G.pts+G.duration,L)),this.trigger("timingInfo",{start:v[0].pts,end:v[v.length-1].pts+v[v.length-1].duration}),this.gopCache_.unshift({gop:v.pop(),pps:r.pps,sps:r.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),d=[],this.trigger("baseMediaDecodeTime",r.baseMediaDecodeTime),this.trigger("timelineStartInfo",r.timelineStartInfo),x=Yi.moof(h,[r]),j=new Uint8Array(x.byteLength+w.byteLength),h++,j.set(x),j.set(w,x.byteLength),this.trigger("data",{track:r,boxes:j}
182),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),d=[],this.gopCache_.length=0,c.length=0,this.trigger("reset")},this.resetStream_=function(){Qe.clearDtsInfo(r),p=void 0,_=void 0},this.getGopForFusion_=function(y){var T=45e3,v=1e4,x=1/0,w,j,L,z,G;for(G=0;G<this.gopCache_.length;G++)z=this.gopCache_[G],L=z.gop,!(!(r.pps&&fd(r.pps[0],z.pps[0]))||!(r.sps&&fd(r.sps[0],z.sps[0])))&&(L.dts<r.timelineStartInfo.dts||(w=y.dts-L.dts-L.duration,w>=-v&&w<=T&&(!j||x>w)&&(j=z,x=w)));return j?j.gop:null},this.alignGopsAtStart_=function(y){var T,v,x,w,j,L,z,G;for(j=y.byteLength,L=y.nalCount,z=y.duration,T=v=0;T<c.length&&v<y.length&&(x=c[T],w=y[v],x.pts!==w.pts);){if(w.pts>x.pts){T++;continue}v++,j-=w.byteLength,L-=w.nalCount,z-=w.duration}return v===0?y:v===y.length?null:(G=y.slice(v),G.byteLength=j,G.duration=z,G.nalCount=L,G.pts=G[0].pts,G.dts=G[0].dts,G)},this.alignGopsAtEnd_=function(y){var T,v,x,w,j,L;for(T=c.length-1,v=y.length-1,j=null,L=!1;T>=0&&v>=0;){if(x=c[T],w=y[v],x.pts===w.pts){L=!0;break}if(x.pts>w.pts){T--;continue}T===c.length-1&&(j=v),v--}if(!L&&j===null)return null;var z;if(L?z=v:z=j,z===0)return y;var G=y.slice(z),Te=G.reduce(function(Be,It){return Be.byteLength+=It.byteLength,Be.duration+=It.duration,Be.nalCount+=It.nalCount,Be},{byteLength:0,duration:0,nalCount:0});return G.byteLength=Te.byteLength,G.duration=Te.duration,G.nalCount=Te.nalCount,G.pts=G[0].pts,G.dts=G[0].dts,G},this.alignGopsWith=function(y){c=y}},Ji.prototype=new _n,Gt=function(r,l){this.numberOfTracks=0,this.metadataStream=l,r=r||{},typeof r.remux!="undefined"?this.remuxTracks=!!r.remux:this.remuxTracks=!0,typeof r.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=r.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,Gt.prototype.init.call(this),this.push=function(h){if(h.content||h.text)return this.pendingCaptions.push(h);if(h.frames)return this.pendingMetadata.push(h);this.pendingTracks.push(h.track),this.pendingBytes+=h.boxes.byteLength,h.track.type==="video"&&(this.videoTrack=h.track,this.pendingBoxes.push(h.boxes)),h.track.type==="audio"&&(this.audioTrack=h.track,this.pendingBoxes.unshift(h.boxes))}},Gt.prototype=new _n,Gt.prototype.flush=function(r){var l=0,h={captions:[],captionStreams:{},metadata:[],info:{}},d,c,p,_=0,y;if(this.pendingTracks.length<this.numberOfTracks){if(r!=="VideoSegmentStream"&&r!=="AudioSegmentStream")return;if(this.remuxTracks)return;if(this.pendingTracks.length===0){this.emittedTracks++,this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(_=this.videoTrack.timelineStartInfo.pts,oa.forEach(function(T){h.info[T]=this.videoTrack[T]},this)):this.audioTrack&&(_=this.audioTrack.timelineStartInfo.pts,aa.forEach(function(T){h.info[T]=this.audioTrack[T]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?h.type=this.pendingTracks[0].type:h.type="combined",this.emittedTracks+=this.pendingTracks.length,p=Yi.initSegment(this.pendingTracks),h.initSegment=new Uint8Array(p.byteLength),h.initSegment.set(p),h.data=new Uint8Array(this.pendingBytes),y=0;y<this.pendingBoxes.length;y++)h.data.set(this.pendingBoxes[y],l),l+=this.pendingBoxes[y].byteLength;for(y=0;y<this.pendingCaptions.length;y++)d=this.pendingCaptions[y],d.startTime=Tn.metadataTsToSeconds(d.startPts,_,this.keepOriginalTimestamps),d.endTime=Tn.metadataTsToSeconds(d.endPts,_,this.keepOriginalTimestamps),h.captionStreams[d.stream]=!0,h.captions.push(d);for(y=0;y<this.pendingMetadata.length;y++)c=this.pendingMetadata[y],c.cueTime=Tn.metadataTsToSeconds(c.pts,_,this.keepOriginalTimestamps),h.metadata.push(c);for(h.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",h),y=0;
182y<h.captions.length;y++)d=h.captions[y],this.trigger("caption",d);for(y=0;y<h.metadata.length;y++)c=h.metadata[y],this.trigger("id3Frame",c)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},Gt.prototype.setRemux=function(r){this.remuxTracks=r},vn=function(r){var l=this,h=!0,d,c;vn.prototype.init.call(this),r=r||{},this.baseMediaDecodeTime=r.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var p={};this.transmuxPipeline_=p,p.type="aac",p.metadataStream=new pt.MetadataStream,p.aacStream=new ng,p.audioTimestampRolloverStream=new pt.TimestampRolloverStream("audio"),p.timedMetadataTimestampRolloverStream=new pt.TimestampRolloverStream("timed-metadata"),p.adtsStream=new ud,p.coalesceStream=new Gt(r,p.metadataStream),p.headOfPipeline=p.aacStream,p.aacStream.pipe(p.audioTimestampRolloverStream).pipe(p.adtsStream),p.aacStream.pipe(p.timedMetadataTimestampRolloverStream).pipe(p.metadataStream).pipe(p.coalesceStream),p.metadataStream.on("timestamp",function(_){p.aacStream.setTimestamp(_.timeStamp)}),p.aacStream.on("data",function(_){_.type!=="timed-metadata"&&_.type!=="audio"||p.audioSegmentStream||(c=c||{timelineStartInfo:{baseMediaDecodeTime:l.baseMediaDecodeTime},codec:"adts",type:"audio"},p.coalesceStream.numberOfTracks++,p.audioSegmentStream=new bi(c,r),p.audioSegmentStream.on("log",l.getLogTrigger_("audioSegmentStream")),p.audioSegmentStream.on("timingInfo",l.trigger.bind(l,"audioTimingInfo")),p.adtsStream.pipe(p.audioSegmentStream).pipe(p.coalesceStream),l.trigger("trackinfo",{hasAudio:!!c,hasVideo:!!d}))}),p.coalesceStream.on("data",this.trigger.bind(this,"data")),p.coalesceStream.on("done",this.trigger.bind(this,"done")),cd(this,p)},this.setupTsPipeline=function(){var p={};this.transmuxPipeline_=p,p.type="ts",p.metadataStream=new pt.MetadataStream,p.packetStream=new pt.TransportPacketStream,p.parseStream=new pt.TransportParseStream,p.elementaryStream=new pt.ElementaryStream,p.timestampRolloverStream=new pt.TimestampRolloverStream,p.adtsStream=new ud,p.h264Stream=new sg,p.captionStream=new pt.CaptionStream(r),p.coalesceStream=new Gt(r,p.metadataStream),p.headOfPipeline=p.packetStream,p.packetStream.pipe(p.parseStream).pipe(p.elementaryStream).pipe(p.timestampRolloverStream),p.timestampRolloverStream.pipe(p.h264Stream),p.timestampRolloverStream.pipe(p.adtsStream),p.timestampRolloverStream.pipe(p.metadataStream).pipe(p.coalesceStream),p.h264Stream.pipe(p.captionStream).pipe(p.coalesceStream),p.elementaryStream.on("data",function(_){var y;if(_.type==="metadata"){for(y=_.tracks.length;y--;)!d&&_.tracks[y].type==="video"?(d=_.tracks[y],d.timelineStartInfo.baseMediaDecodeTime=l.baseMediaDecodeTime):!c&&_.tracks[y].type==="audio"&&(c=_.tracks[y],c.timelineStartInfo.baseMediaDecodeTime=l.baseMediaDecodeTime);d&&!p.videoSegmentStream&&(p.coalesceStream.numberOfTracks++,p.videoSegmentStream=new Ji(d,r),p.videoSegmentStream.on("log",l.getLogTrigger_("videoSegmentStream")),p.videoSegmentStream.on("timelineStartInfo",function(T){c&&!r.keepOriginalTimestamps&&(c.timelineStartInfo=T,p.audioSegmentStream.setEarliestDts(T.dts-l.baseMediaDecodeTime))}),p.videoSegmentStream.on("processedGopsInfo",l.trigger.bind(l,"gopInfo")),p.videoSegmentStream.on("segmentTimingInfo",l.trigger.bind(l,"videoSegmentTimingInfo")),p.videoSegmentStream.on("baseMediaDecodeTime",function(T){c&&p.audioSegmentStream.setVideoBaseMediaDecodeTime(T)}),p.videoSegmentStream.on("timingInfo",l.trigger.bind(l,"videoTimingInfo")),p.h264Stream.pipe(p.videoSegmentStream).pipe(p.coalesceStream)),c&&!p.audioSegmentStream&&(p.coalesceStream.numberOfTracks++,p.audioSegmentStream=new bi(c,r),p.audioSegmentStream.on("log",l.getLogTrigger_("audioSegmentStream")),p.audioSegmentStream.on("timingInfo",l.trigger.bind(l,"audioTimingInfo")),p.audioSegmentStream.on("segmentTimingInfo",l.trigger.bind(l,"audioSegmentTimingInfo")),p.adtsStream.pipe(p.audioSegmentStream).pipe(p.coalesceStream)),l.trigger("trackinfo",{hasAudio:!!c,hasVideo:!!d})}}),p.coalesceStream.on("data",this.trigger.bind(this,"data")),p.coalesceStream.on("id3Frame",function(_){_.dispatchType=p.metadataStream.dispatchType,l.trigger("id3Frame",_)}),p.coalesceStream.on("caption",this.trigger.bind(this,"caption")),p.coalesceStream.on("done",this.trigger.bind(this,"done")),cd(this,p)},this.setBaseMediaDecodeTime=function(p){var _=this.transmuxPipeline_;r.keepOriginalTimestamps||(this.baseMediaDecodeTime=p),c&&(c.timelineStartInfo.dts=void 0,c.timelineStartInfo.pts=void 0,Qe.clearDtsInfo(c),_.audioTimestampRolloverStream&&_.audioTimestampRolloverStream.discontinuity()),d&&(_.videoSegmentStream&&(_.videoSegmentStream.gopCache_=[]),d.timelineStartInfo.dts=void 0,d.timelineStartInfo.pts=void 0,Qe.clearDtsInfo(d),_.captionStream.reset()),_.timestampRolloverStream&&_.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(p){c&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(p)},this.setRemux=function(p){var _=this.transmuxPipeline_;r.remux=p,_&&_.coalesceStream&&_.coalesceStream.setRemux(p)},this.alignGopsWith=function(p){d&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(p)},this.getLogTrigger_=function(p){var _=this;return function(y){y.stream=p,_.trigger("log",y)}},this.push=function(p){if(h){var _=rg(p);_&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!_&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),h=!1}this.transmuxPipeline_.headOfPipeline.push(p)},this.flush=function(){h=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},vn.prototype=new _n;var lg={Transmuxer:vn,VideoSegmentStream:Ji,AudioSegmentStream:bi,AUDIO_PROPERTIES:aa,VIDEO_PROPERTIES:oa,generateSegmentTimingInfo:la},hg=function(r){return r>>>0},dg=function(r){return("00"+r.toString(16)).slice(-2)},bn={toUnsigned:hg,toHexString:dg},ug=function(r){var l="";return l+=String.fromCharCode(r[0]),l+=String.fromCharCode(r[1]),l+=String.fromCharCode(r[2]),l+=String.fromCharCode(r[3]),l},ha=ug,cg=bn.toUnsigned,fg=ha,pd=function(r,l){var h=[],d,c,p,_,y;if(!l.length)return null;for(d=0;d<r.byteLength;)c=cg(r[d]<<24|r[d+1]<<16|r[d+2]<<8|r[d+3]),p=fg(r.subarray(d+4,d+8)),_=c>1?d+c:r.byteLength,p===l[0]&&(l.length===1?h.push(r.subarray(d+8,_)):(y=pd(r.subarray(d+8,_),l.slice(1)),y.length&&(h=h.concat(y)))),d=_;return h},Sn=pd,pg=bn.toUnsigned,mg=a.getUint64,gg=function(r){var l={ver
182sion:r[0],flags:new Uint8Array(r.subarray(1,4))};return l.version===1?l.baseMediaDecodeTime=mg(r.subarray(4)):l.baseMediaDecodeTime=pg(r[4]<<24|r[5]<<16|r[6]<<8|r[7]),l},da=gg,_g=function(r){var l=new DataView(r.buffer,r.byteOffset,r.byteLength),h={version:r[0],flags:new Uint8Array(r.subarray(1,4)),trackId:l.getUint32(4)},d=h.flags[2]&1,c=h.flags[2]&2,p=h.flags[2]&8,_=h.flags[2]&16,y=h.flags[2]&32,T=h.flags[0]&65536,v=h.flags[0]&131072,x;return x=8,d&&(x+=4,h.baseDataOffset=l.getUint32(12),x+=4),c&&(h.sampleDescriptionIndex=l.getUint32(x),x+=4),p&&(h.defaultSampleDuration=l.getUint32(x),x+=4),_&&(h.defaultSampleSize=l.getUint32(x),x+=4),y&&(h.defaultSampleFlags=l.getUint32(x)),T&&(h.durationIsEmpty=!0),!d&&v&&(h.baseDataOffsetIsMoof=!0),h},ua=_g,md=a.getUint64,yg=function(r){var l=new DataView(r.buffer,r.byteOffset,r.byteLength),h={version:r[0],flags:new Uint8Array(r.subarray(1,4)),references:[],referenceId:l.getUint32(4),timescale:l.getUint32(8)},d=12;h.version===0?(h.earliestPresentationTime=l.getUint32(d),h.firstOffset=l.getUint32(d+4),d+=8):(h.earliestPresentationTime=md(r.subarray(d)),h.firstOffset=md(r.subarray(d+8)),d+=16),d+=2;var c=l.getUint16(d);for(d+=2;c>0;d+=12,c--)h.references.push({referenceType:(r[d]&128)>>>7,referencedSize:l.getUint32(d)&2147483647,subsegmentDuration:l.getUint32(d+4),startsWithSap:!!(r[d+8]&128),sapType:(r[d+8]&112)>>>4,sapDeltaTime:l.getUint32(d+8)&268435455});return h},Tg=yg,vg=function(r){return{isLeading:(r[0]&12)>>>2,dependsOn:r[0]&3,isDependedOn:(r[1]&192)>>>6,hasRedundancy:(r[1]&48)>>>4,paddingValue:(r[1]&14)>>>1,isNonSyncSample:r[1]&1,degradationPriority:r[2]<<8|r[3]}},bg=vg,gd=bg,Sg=function(r){var l={version:r[0],flags:new Uint8Array(r.subarray(1,4)),samples:[]},h=new DataView(r.buffer,r.byteOffset,r.byteLength),d=l.flags[2]&1,c=l.flags[2]&4,p=l.flags[1]&1,_=l.flags[1]&2,y=l.flags[1]&4,T=l.flags[1]&8,v=h.getUint32(4),x=8,w;for(d&&(l.dataOffset=h.getInt32(x),x+=4),c&&v&&(w={flags:gd(r.subarray(x,x+4))},x+=4,p&&(w.duration=h.getUint32(x),x+=4),_&&(w.size=h.getUint32(x),x+=4),T&&(l.version===1?w.compositionTimeOffset=h.getInt32(x):w.compositionTimeOffset=h.getUint32(x),x+=4),l.samples.push(w),v--);v--;)w={},p&&(w.duration=h.getUint32(x),x+=4),_&&(w.size=h.getUint32(x),x+=4),y&&(w.flags=gd(r.subarray(x,x+4)),x+=4),T&&(l.version===1?w.compositionTimeOffset=h.getInt32(x):w.compositionTimeOffset=h.getUint32(x),x+=4),l.samples.push(w);return l},_d=Sg,xg=a,yd=xg.getUint64,xe,ca,qe=function(r){return new Date(r*1e3-20828448e5)},Zi=ha,Cg=Sn,Eg=function(r){var l=new DataView(r.buffer,r.byteOffset,r.byteLength),h=[],d,c;for(d=0;d+4<r.length;d+=c){if(c=l.getUint32(d),d+=4,c<=0){h.push("<span style='color:red;'>MALFORMED DATA</span>");continue}switch(r[d]&31){case 1:h.push("slice_layer_without_partitioning_rbsp");break;case 5:h.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:h.push("sei_rbsp");break;case 7:h.push("seq_parameter_set_rbsp");break;case 8:h.push("pic_parameter_set_rbsp");break;case 9:h.push("access_unit_delimiter_rbsp");break;default:h.push("UNKNOWN NAL - "+r[d]&31);break}}return h},kt={avc1:function(r){var l=new DataView(r.buffer,r.byteOffset,r.byteLength);return{dataReferenceIndex:l.getUint16(6),width:l.getUint16(24),height:l.getUint16(26),horizresolution:l.getUint16(28)+l.getUint16(30)/16,vertresolution:l.getUint16(32)+l.getUint16(34)/16,frameCount:l.getUint16(40),depth:l.getUint16(74),config:xe(r.subarray(78,r.byteLength))}},avcC:function(r){var l=new DataView(r.buffer,r.byteOffset,r.byteLength),h={configurationVersion:r[0],avcProfileIndication:r[1],profileCompatibility:r[2],avcLevelIndication:r[3],lengthSizeMinusOne:r[4]&3,sps:[],pps:[]},d=r[5]&31,c,p,_,y;for(_=6,y=0;y<d;y++)p=l.getUint16(_),_+=2,h.sps.push(new Uint8Array(r.subarray(_,_+p))),_+=p;for(c=r[_],_++,y=0;y<c;y++)p=l.getUint16(_),_+=2,h.pps.push(new Uint8Array(r.subarray(_,_+p))),_+=p;return h},btrt:function(r){var l=new DataView(r.buffer,r.byteOffset,r.byteLength);return{bufferSizeDB:l.getUint32(0),maxBitrate:l.getUint32(4),avgBitrate:l.getUint32(8)}},edts:function(l){return{boxes:xe(l)}},elst:function(l){var h=new DataView(l.buffer,l.byteOffset,l.byteLength),d={version:h.getUint8(0),flags:new Uint8Array(l.subarray(1,4)),edits:[]},c=h.getUint32(4),p;for(p=8;c;c--)d.version===0?(d.edits.push({segmentDuration:h.getUint32(p),mediaTime:h.getInt32(p+4),mediaRate:h.getUint16(p+8)+h.getUint16(p+10)/(256*256)}),p+=12):(d.edits.push({segmentDuration:yd(l.subarray(p)),mediaTime:yd(l.subarray(p+8)),mediaRate:h.getUint16(p+16)+h.getUint16(p+18)/(256*256)}),p+=20);return d},esds:function(r){return{version:r[0],flags:new Uint8Array(r.subarray(1,4)),esId:r[6]<<8|r[7],streamPriority:r[8]&31,decoderConfig:{objectProfileIndication:r[11
182],streamType:r[12]>>>2&63,bufferSize:r[13]<<16|r[14]<<8|r[15],maxBitrate:r[16]<<24|r[17]<<16|r[18]<<8|r[19],avgBitrate:r[20]<<24|r[21]<<16|r[22]<<8|r[23],decoderConfigDescriptor:{tag:r[24],length:r[25],audioObjectType:r[26]>>>3&31,samplingFrequencyIndex:(r[26]&7)<<1|r[27]>>>7&1,channelConfiguration:r[27]>>>3&15}}}},ftyp:function(r){for(var l=new DataView(r.buffer,r.byteOffset,r.byteLength),h={majorBrand:Zi(r.subarray(0,4)),minorVersion:l.getUint32(4),compatibleBrands:[]},d=8;d<r.byteLength;)h.compatibleBrands.push(Zi(r.subarray(d,d+4))),d+=4;return h},dinf:function(r){return{boxes:xe(r)}},dref:function(r){return{version:r[0],flags:new Uint8Array(r.subarray(1,4)),dataReferences:xe(r.subarray(8))}},hdlr:function(r){var l=new DataView(r.buffer,r.byteOffset,r.byteLength),h={version:l.getUint8(0),flags:new Uint8Array(r.subarray(1,4)),handlerType:Zi(r.subarray(8,12)),name:""},d=8;for(d=24;d<r.byteLength;d++){if(r[d]===0){d++;break}h.name+=String.fromCharCode(r[d])}return h.name=decodeURIComponent(escape(h.name)),h},mdat:function(r){return{byteLength:r.byteLength,nals:Eg(r)}},mdhd:function(r){var l=new DataView(r.buffer,r.byteOffset,r.byteLength),h=4,d,c={version:l.getUint8(0),flags:new Uint8Array(r.subarray(1,4)),language:""};return c.version===1?(h+=4,c.creationTime=qe(l.getUint32(h)),h+=8,c.modificationTime=qe(l.getUint32(h)),h+=4,c.timescale=l.getUint32(h),h+=8,c.duration=l.getUint32(h)):(c.creationTime=qe(l.getUint32(h)),h+=4,c.modificationTime=qe(l.getUint32(h)),h+=4,c.timescale=l.getUint32(h),h+=4,c.duration=l.getUint32(h)),h+=4,d=l.getUint16(h),c.language+=String.fromCharCode((d>>10)+96),c.language+=String.fromCharCode(((d&992)>>5)+96),c.language+=String.fromCharCode((d&31)+96),c},mdia:function(r){return{boxes:xe(r)}},mfhd:function(r){return{version:r[0],flags:new Uint8Array(r.subarray(1,4)),sequenceNumber:r[4]<<24|r[5]<<16|r[6]<<8|r[7]}},minf:function(r){return{boxes:xe(r)}},mp4a:function(r){var l=new DataView(r.buffer,r.byteOffset,r.byteLength),h={dataReferenceIndex:l.getUint16(6),channelcount:l.getUint16(16),samplesize:l.getUint16(18),samplerate:l.getUint16(24)+l.getUint16(26)/65536};return r.byteLength>28&&(h.streamDescriptor=xe(r.subarray(28))[0]),h},moof:function(r){return{boxes:xe(r)}},moov:function(r){return{boxes:xe(r)}},mvex:function(r){return{boxes:xe(r)}},mvhd:function(r){var l=new DataView(r.buffer,r.byteOffset,r.byteLength),h=4,d={version:l.getUint8(0),flags:new Uint8Array(r.subarray(1,4))};return d.version===1?(h+=4,d.creationTime=qe(l.getUint32(h)),h+=8,d.modificationTime=qe(l.getUint32(h)),h+=4,d.timescale=l.getUint32(h),h+=8,d.duration=l.getUint32(h)):(d.creationTime=qe(l.getUint32(h)),h+=4,d.modificationTime=qe(l.getUint32(h)),h+=4,d.timescale=l.getUint32(h),h+=4,d.duration=l.getUint32(h)),h+=4,d.rate=l.getUint16(h)+l.getUint16(h+2)/16,h+=4,d.volume=l.getUint8(h)+l.getUint8(h+1)/8,h+=2,h+=2,h+=8,d.matrix=new Uint32Array(r.subarray(h,h+36)),h+=36,h+=24,d.nextTrackId=l.getUint32(h),d},pdin:function(r){var l=new DataView(r.buffer,r.byteOffset,r.byteLength);return{version:l.getUint8(0),flags:new Uint8Array(r.subarray(1,4)),rate:l.getUint32(4),initialDelay:l.getUint32(8)}},sdtp:function(r){var l={version:r[0],flags:new Uint8Array(r.subarray(1,4)),samples:[]},h;for(h=4;h<r.byteLength;h++)l.samples.push({dependsOn:(r[h]&48)>>4,isDependedOn:(r[h]&12)>>2,hasRedundancy:r[h]&3});return l},sidx:Tg,smhd:function(r){return{version:r[0],flags:new Uint8Array(r.subarray(1,4)),balance:r[4]+r[5]/256}},stbl:function(r){return{boxes:xe(r)}},ctts:function(r){var l=new DataView(r.buffer,r.byteOffset,r.byteLength),h={version:l.getUint8(0),flags:new Uint8Array(r.subarray(1,4)),compositionOffsets:[]},d=l.getUint32(4),c;for(c=8;d;c+=8,d--)h.compositionOffsets.push({sampleCount:l.getUint32(c),sampleOffset:l[h.version===0?"getUint32":"getInt32"](c+4)});return h},stss:function(r){var l=new DataView(r.buffer,r.byteOffset,r.byteLength),h={version:l.getUint8(0),flags:new Uint8Array(r.subarray(1,4)),syncSamples:[]},d=l.getUint32(4),c;for(c=8;d;c+=4,d--)h.syncSamples.push(l.getUint32(c));return h},stco:function(r){var l=new DataView(r.buffer,r.byteOffset,r.byteLength),h={version:r[0],flags:new Uint8Array(r.subarray(1,4)),chunkOffsets:[]},d=l.getUint32(4),c;for(c=8;d;c+=4,d--)h.chunkOffsets.push(l.getUint32(c));return h},stsc:function(r){var l=new DataView(r.buffer,r.byteOffset,r.byteLength),h=l.getUint32(4),d={version:r[0],flags:new Uint8Array(r.subarray(1,4)),sampleToChunks:[]},c;for(c=8;h;
182c+=12,h--)d.sampleToChunks.push({firstChunk:l.getUint32(c),samplesPerChunk:l.getUint32(c+4),sampleDescriptionIndex:l.getUint32(c+8)});return d},stsd:function(r){return{version:r[0],flags:new Uint8Array(r.subarray(1,4)),sampleDescriptions:xe(r.subarray(8))}},stsz:function(r){var l=new DataView(r.buffer,r.byteOffset,r.byteLength),h={version:r[0],flags:new Uint8Array(r.subarray(1,4)),sampleSize:l.getUint32(4),entries:[]},d;for(d=12;d<r.byteLength;d+=4)h.entries.push(l.getUint32(d));return h},stts:function(r){var l=new DataView(r.buffer,r.byteOffset,r.byteLength),h={version:r[0],flags:new Uint8Array(r.subarray(1,4)),timeToSamples:[]},d=l.getUint32(4),c;for(c=8;d;c+=8,d--)h.timeToSamples.push({sampleCount:l.getUint32(c),sampleDelta:l.getUint32(c+4)});return h},styp:function(r){return kt.ftyp(r)},tfdt:da,tfhd:ua,tkhd:function(r){var l=new DataView(r.buffer,r.byteOffset,r.byteLength),h=4,d={version:l.getUint8(0),flags:new Uint8Array(r.subarray(1,4))};return d.version===1?(h+=4,d.creationTime=qe(l.getUint32(h)),h+=8,d.modificationTime=qe(l.getUint32(h)),h+=4,d.trackId=l.getUint32(h),h+=4,h+=8,d.duration=l.getUint32(h)):(d.creationTime=qe(l.getUint32(h)),h+=4,d.modificationTime=qe(l.getUint32(h)),h+=4,d.trackId=l.getUint32(h),h+=4,h+=4,d.duration=l.getUint32(h)),h+=4,h+=8,d.layer=l.getUint16(h),h+=2,d.alternateGroup=l.getUint16(h),h+=2,d.volume=l.getUint8(h)+l.getUint8(h+1)/8,h+=2,h+=2,d.matrix=new Uint32Array(r.subarray(h,h+36)),h+=36,d.width=l.getUint16(h)+l.getUint16(h+2)/65536,h+=4,d.height=l.getUint16(h)+l.getUint16(h+2)/65536,d},traf:function(r){return{boxes:xe(r)}},trak:function(r){return{boxes:xe(r)}},trex:function(r){var l=new DataView(r.buffer,r.byteOffset,r.byteLength);return{version:r[0],flags:new Uint8Array(r.subarray(1,4)),trackId:l.getUint32(4),defaultSampleDescriptionIndex:l.getUint32(8),defaultSampleDuration:l.getUint32(12),defaultSampleSize:l.getUint32(16),sampleDependsOn:r[20]&3,sampleIsDependedOn:(r[21]&192)>>6,sampleHasRedundancy:(r[21]&48)>>4,samplePaddingValue:(r[21]&14)>>1,sampleIsDifferenceSample:!!(r[21]&1),sampleDegradationPriority:l.getUint16(22)}},trun:_d,"url ":function(r){return{version:r[0],flags:new Uint8Array(r.subarray(1,4))}},vmhd:function(r){var l=new DataView(r.buffer,r.byteOffset,r.byteLength);return{version:r[0],flags:new Uint8Array(r.subarray(1,4)),graphicsmode:l.getUint16(4),opcolor:new Uint16Array([l.getUint16(6),l.getUint16(8),l.getUint16(10)])}}};xe=function(r){for(var l=0,h=[],d,c,p,_,y,T=new ArrayBuffer(r.length),v=new Uint8Array(T),x=0;x<r.length;++x)v[x]=r[x];for(d=new DataView(T);l<r.byteLength;)c=d.getUint32(l),p=Zi(r.subarray(l+4,l+8)),_=c>1?l+c:r.byteLength,y=(kt[p]||function(w){return{data:w}})(r.subarray(l+8,_)),y.size=c,y.type=p,h.push(y),l=_;return h},ca=function(r,l){var h;return l=l||0,h=new Array(l*2+1).join(" "),r.map(function(d,c){return h+d.type+`
183`+Object.keys(d).filter(function(p){return p!=="type"&&p!=="boxes"}).map(function(p){var _=h+"  "+p+": ",y=d[p];if(y instanceof Uint8Array||y instanceof Uint32Array){var T=Array.prototype.slice.call(new Uint8Array(y.buffer,y.byteOffset,y.byteLength)).map(function(v){return" "+("00"+v.toString(16)).slice(-2)}).join("").match(/.{1,24}/g);return T?T.length===1?_+"<"+T.join("").slice(1)+">":_+`<
184`+T.map(function(v){return h+"  "+v}).join(`
185`)+`
186`+h+"  >":_+"<>"}return _+JSON.stringify(y,null,2).split(`
187`).map(function(v,x){return x===0?v:h+"  "+v}).join(`
188`)}).join(`
189`)+(d.boxes?`
190`+ca(d.boxes,l+1):"")}).join(`
191`)};var Td={inspect:xe,textify:ca,parseType:Zi,findBox:Cg,parseTraf:kt.traf,parseTfdt:kt.tfdt,parseHdlr:kt.hdlr,parseTfhd:kt.tfhd,parseTrun:kt.trun,parseSidx:kt.sidx},kg=function(r){for(var l=0,h=String.fromCharCode(r[l]),d="";h!=="\0";)d+=h,l++,h=String.fromCharCode(r[l]);return d+=h,d},wg={uint8ToCString:kg},xn=wg.uint8ToCString,Ig=a.getUint64,Pg=function(r){var l=4,h=r[0],d,c,p,_,y,T,v,x;if(h===0){d=xn(r.subarray(l)),l+=d.length,c=xn(r.subarray(l)),l+=c.length;var w=new DataView(r.buffer);p=w.getUint32(l),l+=4,y=w.getUint32(l),l+=4,T=w.getUint32(l),l+=4,v=w.getUint32(l),l+=4}else if(h===1){var w=new DataView(r.buffer);p=w.getUint32(l),l+=4,_=Ig(r.subarray(l)),l+=8,T=w.getUint32(l),l+=4,v=w.getUint32(l),l+=4,d=xn(r.subarray(l)),l+=d.length,c=xn(r.subarray(l)),l+=c.length}x=new Uint8Array(r.subarray(l,r.byteLength));var j={scheme_id_uri:d,value:c,timescale:p||1,presentation_time:_,presentation_time_delta:y,event_duration:T,id:v,message_data:x};return Lg(h,j)?j:void 0},Ag=function(r,l,h,d){return r||r===0?r/l:d+h/l},Lg=function(r,l){var h=l.scheme_id_uri!=="\0",d=r===0&&vd(l.presentation_time_delta)&&h,c=r===1&&vd(l.presentation_time)&&h;return!(r>1)&&d||c},vd=function(r){return r!==void 0||r!==null},Dg={parseEmsgBox:Pg,scaleTime:Ag},es;typeof window!="undefined"?es=window:typeof s!="undefined"?es=s:typeof self!="undefined"?es=self:es={};var bd=es,Cn=bn.toUnsigned,ts=bn.toHexString,me=Sn,Si=ha,fa=Dg,Og=ua,Mg=_d,Rg=da,Ug=a.getUint64,Sd,xd,C
191d,Ed,kd,pa,wd,ma=bd,Bg=td.parseId3Frames;Sd=function(r){var l={},h=me(r,["moov","trak"]);return h.reduce(function(d,c){var p,_,y,T,v;return p=me(c,["tkhd"])[0],!p||(_=p[0],y=_===0?12:20,T=Cn(p[y]<<24|p[y+1]<<16|p[y+2]<<8|p[y+3]),v=me(c,["mdia","mdhd"])[0],!v)?null:(_=v[0],y=_===0?12:20,d[T]=Cn(v[y]<<24|v[y+1]<<16|v[y+2]<<8|v[y+3]),d)},l)},xd=function(r,l){var h;h=me(l,["moof","traf"]);var d=h.reduce(function(c,p){var _=me(p,["tfhd"])[0],y=Cn(_[4]<<24|_[5]<<16|_[6]<<8|_[7]),T=r[y]||9e4,v=me(p,["tfdt"])[0],x=new DataView(v.buffer,v.byteOffset,v.byteLength),w;v[0]===1?w=Ug(v.subarray(4,12)):w=x.getUint32(4);let j;return typeof w=="bigint"?j=w/ma.BigInt(T):typeof w=="number"&&!isNaN(w)&&(j=w/T),j<Number.MAX_SAFE_INTEGER&&(j=Number(j)),j<c&&(c=j),c},1/0);return typeof d=="bigint"||isFinite(d)?d:0},Cd=function(r,l){var h=me(l,["moof","traf"]),d=0,c=0,p;if(h&&h.length){var _=me(h[0],["tfhd"])[0],y=me(h[0],["trun"])[0],T=me(h[0],["tfdt"])[0];if(_){var v=Og(_);p=v.trackId}if(T){var x=Rg(T);d=x.baseMediaDecodeTime}if(y){var w=Mg(y);w.samples&&w.samples.length&&(c=w.samples[0].compositionTimeOffset||0)}}var j=r[p]||9e4;typeof d=="bigint"&&(c=ma.BigInt(c),j=ma.BigInt(j));var L=(d+c)/j;return typeof L=="bigint"&&L<Number.MAX_SAFE_INTEGER&&(L=Number(L)),L},Ed=function(r){var l=me(r,["moov","trak"]),h=[];return l.forEach(function(d){var c=me(d,["mdia","hdlr"]),p=me(d,["tkhd"]);c.forEach(function(_,y){var T=Si(_.subarray(8,12)),v=p[y],x,w,j;T==="vide"&&(x=new DataView(v.buffer,v.byteOffset,v.byteLength),w=x.getUint8(0),j=w===0?x.getUint32(12):x.getUint32(20),h.push(j))})}),h},pa=function(r){var l=r[0],h=l===0?12:20;return Cn(r[h]<<24|r[h+1]<<16|r[h+2]<<8|r[h+3])},kd=function(r){var l=me(r,["moov","trak"]),h=[];return l.forEach(function(d){var c={},p=me(d,["tkhd"])[0],_,y;p&&(_=new DataView(p.buffer,p.byteOffset,p.byteLength),y=_.getUint8(0),c.id=y===0?_.getUint32(12):_.getUint32(20));var T=me(d,["mdia","hdlr"])[0];if(T){var v=Si(T.subarray(8,12));v==="vide"?c.type="video":v==="soun"?c.type="audio":c.type=v}var x=me(d,["mdia","minf","stbl","stsd"])[0];if(x){var w=x.subarray(8);c.codec=Si(w.subarray(4,8));var j=me(w,[c.codec])[0],L,z;j&&(/^[asm]vc[1-9]$/i.test(c.codec)?(L=j.subarray(78),z=Si(L.subarray(4,8)),z==="avcC"&&L.length>11?(c.codec+=".",c.codec+=ts(L[9]),c.codec+=ts(L[10]),c.codec+=ts(L[11])):c.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(c.codec)?(L=j.subarray(28),z=Si(L.subarray(4,8)),z==="esds"&&L.length>20&&L[19]!==0?(c.codec+="."+ts(L[19]),c.codec+="."+ts(L[20]>>>2&63).replace(/^0/,"")):c.codec="mp4a.40.2"):c.codec=c.codec.toLowerCase())}var G=me(d,["mdia","mdhd"])[0];G&&(c.timescale=pa(G)),h.push(c)}),h},wd=function(r,l=0){var h=me(r,["emsg"]);return h.map(d=>{var c=fa.parseEmsgBox(new Uint8Array(d)),p=Bg(c.message_data);return{cueTime:fa.scaleTime(c.presentation_time,c.timescale,c.presentation_time_delta,l),duration:fa.scaleTime(c.event_duration,c.timescale),frames:p}})};var is={findBox:me,parseType:Si,timescale:Sd,startTime:xd,compositionStartTime:Cd,videoTrackIds:Ed,tracks:kd,getTimescaleFromMediaHeader:pa,getEmsgID3:wd};const{parseTrun:Fg}=Td,{findBox:Id}=is;var Pd=bd,Ng=function(r){var l=Id(r,["moof","traf"]),h=Id(r,["mdat"]),d=[];return h.forEach(function(c,p){var _=l[p];d.push({mdat:c,traf:_})}),d},jg=function(r,l,h){var d=l,c=h.defaultSampleDuration||0,p=h.defaultSampleSize||0,_=h.trackId,y=[];return r.forEach(function(T){var v=Fg(T),x=v.samples;x.forEach(function(w){w.duration===void 0&&(w.duration=c),w.size===void 0&&(w.size=p),w.trackId=_,w.dts=d,w.compositionTimeOffset===void 0&&(w.compositionTimeOffset=0),typeof d=="bigint"?(w.pts=d+Pd.BigInt(w.compositionTimeOffset),d+=Pd.BigInt(w.duration)):(w.pts=d+w.compositionTimeOffset,d+=w.duration)}),y=y.concat(x)}),y},Ad={getMdatTrafPairs:Ng,parseSamples:jg},$g=Yh.discardEmulationPreventionBytes,Hg=Xh.CaptionStream,ga=Sn,Vg=da,qg=ua,{getMdatTrafPairs:zg,parseSamples:Wg}=Ad,Gg=function(r,l){for(var h=r,d=0;d<l.length;d++){var c=l[d];if(h<c.size)return c;h-=c.size}return null},Kg=function(r,l,h){var d=new DataView(r.buffer,r.byteOffset,r.byteLength),c={logs:[],seiNals:[]},p,_,y,T;for(_=0;_+4<r.length;_+=y)if(y=d.getUint32(_),_+=4,!(y<=0))switch(r[_]&31){case 6:var v=r.subarray(_+1,_+1+y),x=Gg(_,l);if(p={nalUnitType:"sei_rbsp",size:y,data:v,escapedRBSP:$g(v),trackId:h},x)p.pts=x.pts,p.dts=x.dts,T=x;else if(T)p.pts=T.pts,p.dts=T.dts;else{c.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+_+" for trackId "+h+". See mux.js#223."});break}c.seiNals.push(p);break}return c},Qg=function(r,l){var h={},d=zg(r);return d.forEach(function(c){var p=c.mdat,_=c.traf,y=ga(_,["tfhd"]),T=qg(y[0]),v=T.trackId,x=ga(_,["tfdt"]),w=x.length>0?Vg(x[0]).baseMediaDecodeTime:0,j=ga(_,["trun"]),L,z;l===v&&j.length>0&&(L=Wg(j,w,T),z=Kg(p,L,v),h[v]||(h[v]={seiNals:[],logs:[]}),h[v].seiNals=h[v].seiNals.concat(z.seiNals),h[v].logs=h[v].logs.concat(z.logs))}),h},Yg=function(r,l,h){var d;if(l===null)return null;d=Qg(r,l);var c=d[l]||{};return{seiNals:c.seiNals,logs:c.logs,timescale:h}},Xg=function(){var r=!1,l,h,d,c,p,_;this.isInitialized=function(){return r},this.init=function(y){l=new Hg,r=!0,_=y?y.isPartial:!1,l.on("data",function(T){T.startTime=T.startPts/c,T.endTime=T.endPts/c,p.captions.push(T),p.captionStream
191s[T.stream]=!0}),l.on("log",function(T){p.logs.push(T)})},this.isNewInit=function(y,T){return y&&y.length===0||T&&typeof T=="object"&&Object.keys(T).length===0?!1:d!==y[0]||c!==T[d]},this.parse=function(y,T,v){var x;if(this.isInitialized()){if(!T||!v)return null;if(this.isNewInit(T,v))d=T[0],c=v[d];else if(d===null||!c)return h.push(y),null}else return null;for(;h.length>0;){var w=h.shift();this.parse(w,T,v)}return x=Yg(y,d,c),x&&x.logs&&(p.logs=p.logs.concat(x.logs)),x===null||!x.seiNals?p.logs.length?{logs:p.logs,captions:[],captionStreams:[]}:null:(this.pushNals(x.seiNals),this.flushStream(),p)},this.pushNals=function(y){if(!this.isInitialized()||!y||y.length===0)return null;y.forEach(function(T){l.push(T)})},this.flushStream=function(){if(!this.isInitialized())return null;_?l.partialFlush():l.flush()},this.clearParsedCaptions=function(){p.captions=[],p.captionStreams={},p.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;l.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){h=[],d=null,c=null,p?this.clearParsedCaptions():p={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Jg=Xg;const{parseTfdt:Zg}=Td,wt=Sn,{getTimescaleFromMediaHeader:e_}=is,{parseSamples:t_,getMdatTrafPairs:i_}=Ad;var Ld=function(){let r=9e4;this.init=function(l){const h=wt(l,["moov","trak","mdia","mdhd"])[0];h&&(r=e_(h))},this.parseSegment=function(l){const h=[],d=i_(l);let c=0;return d.forEach(function(p){const _=p.mdat,y=p.traf,T=wt(y,["tfdt"])[0],v=wt(y,["tfhd"])[0],x=wt(y,["trun"]);if(T&&(c=Zg(T).baseMediaDecodeTime),x.length&&v){const w=t_(x,c,v);let j=0;w.forEach(function(L){const z="utf-8",G=new TextDecoder(z),Te=_.slice(j,j+L.size);if(wt(Te,["vtte"])[0]){j+=L.size;return}wt(Te,["vttc"]).forEach(function(ss){const ns=wt(ss,["payl"])[0],rs=wt(ss,["sttg"])[0],as=L.pts/r,wn=(L.pts+L.duration)/r;let oe,os;if(ns)try{oe=G.decode(ns)}catch(Ye){console.error(Ye)}if(rs)try{os=G.decode(rs)}catch(Ye){console.error(Ye)}L.duration&&oe&&h.push({cueText:oe,start:as,end:wn,settings:os})}),j+=L.size})}}),h}},_a=ln,Dd=function(r){var l=r[1]&31;return l<<=8,l|=r[2],l},En=function(r){return!!(r[1]&64)},kn=function(r){var l=0;return(r[3]&48)>>>4>1&&(l+=r[4]+1),l},s_=function(r,l){var h=Dd(r);return h===0?"pat":h===l?"pmt":l?"pes":null},n_=function(r){var l=En(r),h=4+kn(r);return l&&(h+=r[h]+1),(r[h+10]&31)<<8|r[h+11]},r_=function(r){var l={},h=En(r),d=4+kn(r);if(h&&(d+=r[d]+1),!!(r[d+5]&1)){var c,p,_;c=(r[d+1]&15)<<8|r[d+2],p=3+c-4,_=(r[d+10]&15)<<8|r[d+11];for(var y=12+_;y<p;){var T=d+y;l[(r[T+1]&31)<<8|r[T+2]]=r[T],y+=((r[T+3]&15)<<8|r[T+4])+5}return l}},a_=function(r,l){var h=Dd(r),d=l[h];switch(d){case _a.H264_STREAM_TYPE:return"video";case _a.ADTS_STREAM_TYPE:return"audio";case _a.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},o_=function(r){var l=En(r);if(!l)return null;var h=4+kn(r);if(h>=r.byteLength)return null;var d=null,c;return c=r[h+7],c&192&&(d={},d.pts=(r[h+9]&14)<<27|(r[h+10]&255)<<20|(r[h+11]&254)<<12|(r[h+12]&255)<<5|(r[h+13]&254)>>>3,d.pts*=4,d.pts+=(r[h+13]&6)>>>1,d.dts=d.pts,c&64&&(d.dts=(r[h+14]&14)<<27|(r[h+15]&255)<<20|(r[h+16]&254)<<12|(r[h+17]&255)<<5|(r[h+18]&254)>>>3,d.dts*=4,d.dts+=(r[h+18]&6)>>>1)),d},ya=function(r){switch(r){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},l_=function(r){for(var l=4+kn(r),h=r.subarray(l),d=0,c=0,p=!1,_;c<h.byteLength-3;c++)if(h[c+2]===1){d=c+5;break}for(;d<h.byteLength;)switch(h[d]){case 0:if(h[d-1]!==0){d+=2;break}else if(h[d-2]!==0){d++;break}c+3!==d-2&&(_=ya(h[c+3]&31),_==="slice_layer_without_partitioning_rbsp_idr"&&(p=!0));do d++;while(h[d]!==1&&d<h.length);c=d-2,d+=3;break;case 1:if(h[d-1]!==0||h[d-2]!==0){d+=3;break}_=ya(h[c+3]&31),_==="slice_layer_without_partitioning_rbsp_idr"&&(p=!0),c=d-2,d+=3;break;default:d+=3;break}return h=h.subarray(c),d-=c,c=0,h&&h.byteLength>3&&(_=ya(h[c+3]&31),_==="slice_layer_without_partitioning_rbsp_idr"&&(p=!0)),p},h_={parseType:s_,parsePat:n_,parsePmt:r_,parsePayloadUnitStartIndicator:En,parsePesType:a_,parsePesTime:o_,videoPacketContainsKeyFrame:l_}
191,Od=ln,xi=Zh.handleRollover,te={};te.ts=h_,te.aac=ra;var Kt=ae.ONE_SECOND_IN_TS,we=188,at=71,d_=function(r,l){for(var h=0,d=we,c,p;d<r.byteLength;){if(r[h]===at&&r[d]===at){switch(c=r.subarray(h,d),p=te.ts.parseType(c,l.pid),p){case"pat":l.pid=te.ts.parsePat(c);break;case"pmt":var _=te.ts.parsePmt(c);l.table=l.table||{},Object.keys(_).forEach(function(y){l.table[y]=_[y]});break}h+=we,d+=we;continue}h++,d++}},Md=function(r,l,h){for(var d=0,c=we,p,_,y,T,v,x=!1;c<=r.byteLength;){if(r[d]===at&&(r[c]===at||c===r.byteLength)){if(p=r.subarray(d,c),_=te.ts.parseType(p,l.pid),_==="pes"&&(y=te.ts.parsePesType(p,l.table),T=te.ts.parsePayloadUnitStartIndicator(p),y==="audio"&&T&&(v=te.ts.parsePesTime(p),v&&(v.type="audio",h.audio.push(v),x=!0))),x)break;d+=we,c+=we;continue}d++,c++}for(c=r.byteLength,d=c-we,x=!1;d>=0;){if(r[d]===at&&(r[c]===at||c===r.byteLength)){if(p=r.subarray(d,c),_=te.ts.parseType(p,l.pid),_==="pes"&&(y=te.ts.parsePesType(p,l.table),T=te.ts.parsePayloadUnitStartIndicator(p),y==="audio"&&T&&(v=te.ts.parsePesTime(p),v&&(v.type="audio",h.audio.push(v),x=!0))),x)break;d-=we,c-=we;continue}d--,c--}},u_=function(r,l,h){for(var d=0,c=we,p,_,y,T,v,x,w,j,L=!1,z={data:[],size:0};c<r.byteLength;){if(r[d]===at&&r[c]===at){switch(p=r.subarray(d,c),_=te.ts.parseType(p,l.pid),_){case"pes":if(y=te.ts.parsePesType(p,l.table),T=te.ts.parsePayloadUnitStartIndicator(p),y==="video"&&(T&&!L&&(v=te.ts.parsePesTime(p),v&&(v.type="video",h.video.push(v),L=!0)),!h.firstKeyFrame)){if(T&&z.size!==0){for(x=new Uint8Array(z.size),w=0;z.data.length;)j=z.data.shift(),x.set(j,w),w+=j.byteLength;if(te.ts.videoPacketContainsKeyFrame(x)){var G=te.ts.parsePesTime(x);G?(h.firstKeyFrame=G,h.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}z.size=0}z.data.push(p),z.size+=p.byteLength}break}if(L&&h.firstKeyFrame)break;d+=we,c+=we;continue}d++,c++}for(c=r.byteLength,d=c-we,L=!1;d>=0;){if(r[d]===at&&r[c]===at){if(p=r.subarray(d,c),_=te.ts.parseType(p,l.pid),_==="pes"&&(y=te.ts.parsePesType(p,l.table),T=te.ts.parsePayloadUnitStartIndicator(p),y==="video"&&T&&(v=te.ts.parsePesTime(p),v&&(v.type="video",h.video.push(v),L=!0))),L)break;d-=we,c-=we;continue}d--,c--}},c_=function(r,l){if(r.audio&&r.audio.length){var h=l;(typeof h=="undefined"||isNaN(h))&&(h=r.audio[0].dts),r.audio.forEach(function(p){p.dts=xi(p.dts,h),p.pts=xi(p.pts,h),p.dtsTime=p.dts/Kt,p.ptsTime=p.pts/Kt})}if(r.video&&r.video.length){var d=l;if((typeof d=="undefined"||isNaN(d))&&(d=r.video[0].dts),r.video.forEach(function(p){p.dts=xi(p.dts,d),p.pts=xi(p.pts,d),p.dtsTime=p.dts/Kt,p.ptsTime=p.pts/Kt}),r.firstKeyFrame){var c=r.firstKeyFrame;c.dts=xi(c.dts,d),c.pts=xi(c.pts,d),c.dtsTime=c.dts/Kt,c.ptsTime=c.pts/Kt}}},f_=function(r){for(var l=!1,h=0,d=null,c=null,p=0,_=0,y;r.length-_>=3;){var T=te.aac.parseType(r,_);switch(T){case"timed-metadata":if(r.length-_<10){l=!0;break}if(p=te.aac.parseId3TagSize(r,_),p>r.length){l=!0;break}c===null&&(y=r.subarray(_,_+p),c=te.aac.parseAacTimestamp(y)),_+=p;break;case"audio":if(r.length-_<7){l=!0;break}if(p=te.aac.parseAdtsSize(r,_),p>r.length){l=!0;break}d===null&&(y=r.subarray(_,_+p),d=te.aac.parseSampleRate(y)),h++,_+=p;break;default:_++;break}if(l)return null}if(d===null||c===null)return null;var v=Kt/d,x={audio:[{type:"audio",dts:c,pts:c},{type:"audio",dts:c+h*1024*v,pts:c+h*1024*v}]};return x},p_=function(r){var l={pid:null,table:null},h={};d_(r,l);for(var d in l.table)if(l.table.hasOwnProperty(d)){var c=l.table[d];switch(c){case Od.H264_STREAM_TYPE:h.video=[],u_(r,l,h),h.video.length===0&&delete h.video;break;case Od.ADTS_STREAM_TYPE:h.audio=[],Md(r,l,h),h.audio.length===0&&delete h.audio;break}}return h},m_=function(r,l){var h=te.aac.isLikelyAacData(r),d;return h?d=f_(r):d=p_(r),!d||!d.audio&&!d.video?null:(c_(d,l),d)},g_={inspect:m_,parseAudioPes_:Md};const __=function(r,l){l.on("data",function(h){const d=h.initSegment;h.initSegment={data:d.buffer,byteOffset:d.byteOffset,byteLength:d.byteLength};const c=h.data;h.data=c.buffer,r.postMessage({action:"data",segment:h,byteOffset:c.byteOffset,byteLength:c.byteLength},[h.data])}),l.on("done",function(h){r.postMessage({action:"done"})}),l.on("gopInfo",function(h){r.postMessage({action:"gopInfo",gopInfo:h})}),l.on("videoSegmentTimingInfo",function(h){const d={start:{decode:ae.videoTsToSeconds(h.start.dts),presentation:ae.videoTsToSeconds(h.start.pts)},end:{decode:ae.videoTsToSeconds(h.end.dts),presentation:ae.videoTsToSeconds(h.end.pts)},baseMediaDecodeTime:ae.videoTsToSeconds(h.baseMediaDecodeTime)};h.prependedContentDuration&&(d.prependedContentDuration=ae.videoTsToSeconds(h.prependedContentDuration)),r.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:d})}),l.on("audioSegmentTimingInfo",function(h){const d={start:{decode:ae.videoTsToSeconds(h.start.dts),presentation:ae.videoTsToSeconds(h.start.pts)},end:{decode:ae.videoTsToSeconds(h.end.dts),presentation:ae.videoTsToSeconds(h.end.pts)},baseMediaDecodeTime:ae.videoTsToSeconds(h.baseMediaDecodeTime)};h.prependedContentDuration&&(d.prependedContentDuration=ae.videoTsToSeconds(h.prependedContentDuration)),r.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:d})}),l.on("id3Frame",function(h){r.postMessage({action:"id3Frame",id3Frame:h})}),l.on("caption",function(h){r.postMessage({action:"caption",caption:h})}),l.on("trackinfo",function(h){r.postMessage({action:"trackinfo",trackInfo:h})}),l.on("audioTimingInfo",function(h){r.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:ae.videoTsToSeconds(h.start),end:ae.videoTsToSeconds(h.end)}})}),l.on("videoTimingInfo",function(h){r.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:ae.videoTsToSeconds(h.start),end:ae.videoTsToSeconds(h.end)}})}),l.on("log",function(h){r.postMessage({action:"log",log:h})})};class Rd{constructor(l,h){this.options=h||{},this.self=l,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new lg.Transmuxer(this.options),__(this.self,this.transmuxer)}pushMp4Captions(l){this.captionParser||(this.captionParser=new Jg,this.captionParser.init());const h=new Uint8Array(l.data,l.byteOffset,l.byteLength),d=this.captionParser.parse(h,l.trackIds,l.timescales);this.self.postMessage({action:"mp4Captions",captions:d&&d.captions||[],logs:d&&d.logs||[],data:h.buffer},[h.buffer])}initMp4WebVttParser(l){this.webVttParser||(this.webVttParser=new Ld);const h=new Uint8Array(l.data,l.byteOffset,l.byteLength);this.webVttParser.init(h)}getMp4WebVttText(l){this.webVttParser||(this.webVttParser=new Ld);const h=new Uint8Array(l.data,l.byteOffset,l.byteLength),d=this.webVttParser.parseSegment(h);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:d||[],data:h.buffer},[h.buffer])}probeMp4StartTime({timescales:l,data:h}){const d=is.startTime(l,h);this.self.postMessage({action:"probeMp4StartTime",startTime:d,data:h},[h.buffer])}probeMp4Tracks({data:l}){const h=is.tracks(l);this.self.postMessage({action:"probeMp4Tracks",tracks:h,data:l},[l.buffer])}probeEmsgID3({data:l,offset:h}){const d=is.getEmsgID3(l,h);this.self.postMessage({action:"probeEmsgID3",id3Frames:d,emsgData:l},[l.buffer])}probeTs({data:l,baseStartTime:h}){const d=typeof h=="number"&&!isNaN(h)?h*ae.ONE_SECOND_IN_TS:void 0,c=g_.
191inspect(l,d);let p=null;c&&(p={hasVideo:c.video&&c.video.length===2||!1,hasAudio:c.audio&&c.audio.length===2||!1},p.hasVideo&&(p.videoStart=c.video[0].ptsTime),p.hasAudio&&(p.audioStart=c.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:p,data:l},[l.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(l){const h=new Uint8Array(l.data,l.byteOffset,l.byteLength);this.transmuxer.push(h)}reset(){this.transmuxer.reset()}setTimestampOffset(l){const h=l.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(ae.secondsToVideoTs(h)))}setAudioAppendStart(l){this.transmuxer.setAudioAppendStart(Math.ceil(ae.secondsToVideoTs(l.appendStart)))}setRemux(l){this.transmuxer.setRemux(l.remux)}flush(l){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(l){this.transmuxer.alignGopsWith(l.gopsToAlignWith.slice())}}self.onmessage=function(r){if(r.data.action==="init"&&r.data.options){this.messageHandlers=new Rd(self,r.data.options);return}this.messageHandlers||(this.messageHandlers=new Rd(self)),r.data&&r.data.action&&r.data.action!=="init"&&this.messageHandlers[r.data.action]&&this.messageHandlers[r.data.action](r.data)}}));var rf=Kl(nf);const af=(s,e,t)=>{const{type:i,initSegment:n,captions:a,captionStreams:o,metadata:u,videoFrameDtsTime:f,videoFramePtsTime:m}=s.data.segment;e.buffer.push({captions:a,captionStreams:o,metadata:u});const g=s.data.segment.boxes||{data:s.data.segment.data},b={type:i,data:new Uint8Array(g.data,g.data.byteOffset,g.data.byteLength),initSegment:new Uint8Array(n.data,n.byteOffset,n.byteLength)};typeof f!="undefined"&&(b.videoFrameDtsTime=f),typeof m!="undefined"&&(b.videoFramePtsTime=m),t(b)},of=({transmuxedData:s,callback:e})=>{s.buffer=[],e(s)},lf=(s,e)=>{e.gopInfo=s.data.gopInfo},Xl=s=>{const{transmuxer:e,bytes:t,audioAppendStart:i,gopsToAlignWith:n,remux:a,onData:o,onTrackInfo:u,onAudioTimingInfo:f,onVideoTimingInfo:m,onVideoSegmentTimingInfo:g,onAudioSegmentTimingInfo:b,onId3:C,onCaptions:k,onDone:P,onEndedTimeline:A,onTransmuxerLog:R,isEndOfTimeline:O,segment:N,triggerSegmentEventFn:H}=s,F={buffer:[]};let M=O;const $=B=>{e.currentTransmux===s&&(B.data.action==="data"&&af(B,F,o),B.data.action==="trackinfo"&&u(B.data.trackInfo),B.data.action==="gopInfo"&&lf(B,F),B.data.action==="audioTimingInfo"&&f(B.data.audioTimingInfo),B.data.action==="videoTimingInfo"&&m(B.data.videoTimingInfo),B.data.action==="videoSegmentTimingInfo"&&g(B.data.videoSegmentTimingInfo),B.data.action==="audioSegmentTimingInfo"&&b(B.data.audioSegmentTimingInfo),B.data.action==="id3Frame"&&C([B.data.id3Frame],B.data.id3Frame.dispatchType),B.data.action==="caption"&&k(B.data.caption),B.data.action==="endedtimeline"&&(M=!1,A()),B.data.action==="log"&&R(B.data.log),B.data.type==="transmuxed"&&(M||(e.onmessage=null,of({transmuxedData:F,callback:P}),Jl(e))))},D=()=>{const B={message:"Received an error message from the transmuxer worker",metadata:{errorType:E.Error.StreamingFailedToTransmuxSegment,segmentInfo:jt({segment:N})}};P(null,B)};if(e.onmessage=$,e.onerror=D,i&&e.postMessage({action:"setAudioAppendStart",appendStart:i}),Array.isArray(n)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:n}),typeof a!="undefined"&&e.postMessage({action:"setRemux",remux:a}),t.byteLength){const B=t instanceof ArrayBuffer?t:t.buffer,Y=t instanceof ArrayBuffer?0:t.byteOffset;H({type:"segmenttransmuxingstart",segment:N}),e.postMessage({action:"push",data:B,byteOffset:Y,byteLength:t.byteLength},[B])}O&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},Jl=s=>{s.currentTransmux=null,s.transmuxQueue.length&&(s.currentTransmux=s.transmuxQueue.shift(),typeof s.currentTransmux=="function"?s.currentTransmux():Xl(s.currentTransmux))},Zl=(s,e)=>{s.postMessage({action:e}),Jl(s)},eh=(s,e)=>{if(!e.currentTransmux){e.currentTransmux=s,Zl(e,s);return}e.transmuxQueue.push(Zl.bind(null,e,s))},hf=s=>
191{eh("reset",s)},df=s=>{eh("endTimeline",s)},th=s=>{if(!s.transmuxer.currentTransmux){s.transmuxer.currentTransmux=s,Xl(s);return}s.transmuxer.transmuxQueue.push(s)};var Ur={reset:hf,endTimeline:df,transmux:th,createTransmuxer:s=>{const e=new rf;e.currentTransmux=null,e.transmuxQueue=[];const t=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,t.call(e)),e.postMessage({action:"init",options:s}),e}};const mi=function(s){const e=s.transmuxer,t=s.endAction||s.action,i=s.callback,n=(0,Ce.A)({},s,{endAction:null,transmuxer:null,callback:null}),a=o=>{o.data.action===t&&(e.removeEventListener("message",a),o.data.data&&(o.data.data=new Uint8Array(o.data.data,s.byteOffset||0,s.byteLength||o.data.data.byteLength),s.data&&(s.data=o.data.data)),i(o.data))};if(e.addEventListener("message",a),s.data){const o=s.data instanceof ArrayBuffer;n.byteOffset=o?0:s.data.byteOffset,n.byteLength=s.data.byteLength;const u=[o?s.data:s.data.buffer];e.postMessage(n,u)}else e.postMessage(n)},nt={FAILURE:2,TIMEOUT:-101,ABORTED:-102},ih="wvtt",Br=s=>{s.forEach(e=>{e.abort()})},uf=s=>({bandwidth:s.bandwidth,bytesReceived:s.bytesReceived||0,roundTripTime:s.roundTripTime||0}),cf=s=>{const e=s.target,i={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return i.bytesReceived=s.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3),i},Fr=(s,e)=>{const{requestType:t}=e,i=Nt({requestType:t,request:e,error:s});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:nt.TIMEOUT,xhr:e,metadata:i}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:nt.ABORTED,xhr:e,metadata:i}:s?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:nt.FAILURE,xhr:e,metadata:i}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:nt.FAILURE,xhr:e,metadata:i}:null},sh=(s,e,t,i)=>(n,a)=>{const o=a.response,u=Fr(n,a);if(u)return t(u,s);if(o.byteLength!==16)return t({status:a.status,message:"Invalid HLS key at URL: "+a.uri,code:nt.FAILURE,xhr:a},s);const f=new DataView(o),m=new Uint32Array([f.getUint32(0),f.getUint32(4),f.getUint32(8),f.getUint32(12)]);for(let b=0;b<e.length;b++)e[b].bytes=m;const g={uri:a.uri};return i({type:"segmentkeyloadcomplete",segment:s,keyInfo:g}),t(null,s)},ff=(s,e)=>{e===ih&&s.transmuxer.postMessage({action:"initMp4WebVttParser",data:s.map.bytes})},pf=(s,e,t)=>{e===ih&&mi({action:"getMp4WebVttText",data:s.bytes,transmuxer:s.transmuxer,callback:({data:i,mp4VttCues:n})=>{s.bytes=i,t(null,s,{mp4VttCues:n})}})},nh=(s,e)=>{const t=(0,hs.ne)(s.map.bytes);if(t!=="mp4"){const i=s.map.resolvedUri||s.map.uri,n=t||"unknown";return e({internal:!0,message:`Found unsupported ${n} container for initialization segment at URL: ${i}`,code:nt.FAILURE,metadata:{mediaType:n}})}mi({action:"probeMp4Tracks",data:s.map.bytes,transmuxer:s.transmuxer,callback:({tracks:i,data:n})=>(s.map.bytes=n,i.forEach(function(a){s.map.tracks=s.map.tracks||{},!s.map.tracks[a.type]&&(s.map.tracks[a.type]=a,typeof a.id=="number"&&a.timescale&&(s.map.timescales=s.map.timescales||{},s.map.timescales[a.id]=a.timescale),a.type==="text"&&ff(s,a.codec))}),e(null))})},mf=({segment:s,finishProcessingFn:e,triggerSegmentEventFn:t})=>(i,n)=>{const a=Fr(i,n);if(a)return e(a,s);const o=new Uint8Array(n.response);if(t({type:"segmentloaded",segment:s}),s.map.key)return s.map.encryptedBytes=o,e(null,s);s.map.bytes=o,nh(s,function(u){if(u)return u.xhr=n,u.status=n.status,e(u,s);e(null,s)})},gf=({segment:s,finishProcessingFn:e,responseType:t,triggerSegmentEventFn:i})=>(n,a)=>{const o=Fr(n,a);if(o)return e(o,s);i({type:"segmentloaded",segment:s});const u=t==="arraybuffer"||!a.responseText?a.response:tf(a.responseText.substring(s.lastReachedChar||0));return s.stats=uf(a),s.key?s.encryptedBytes=new Uint8Array(u):s.bytes=new Uint8Array(u),e(null,s)},_f=({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:u,isEndOfTimeline:f,endedTimelineFn:m,dataFn:g,doneFn:b,onTransmuxerLog:C,triggerSegmentEventFn:k})=>{const P=s.map&&s.map.tracks||{},A=!!(P.audio&&P.video);let R=i.bind(null,s,"audio","start");const O=i.bind(null,s,"audio","end");let N=i.bind(null,s,"video","start");const H=i.bind(null,s,"video","end"),F=()=>th({bytes:e,transmuxer:s.transmuxer,audioAppendStart:s.audioAppendStart,gopsToAlignWith:s.gopsToAlignWith,remux:A,onData:M=>{M.type=M.type==="combined"?"video":M.type,g(s,M)},onTrackInfo:M=>{t&&(A&&(M.isMuxed=!0),t(s,M))},onAudioTimingInfo:M=>{R&&typeof M.start!="undefined"&&(R(M.start),R=null),O&&typeof M.end!="undefined"&&O(M.end)},onVideoTimingInfo:M=>
191{N&&typeof M.start!="undefined"&&(N(M.start),N=null),H&&typeof M.end!="undefined"&&H(M.end)},onVideoSegmentTimingInfo:M=>{const $={pts:{start:M.start.presentation,end:M.end.presentation},dts:{start:M.start.decode,end:M.end.decode}};k({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:$}),n(M)},onAudioSegmentTimingInfo:M=>{const $={pts:{start:M.start.pts,end:M.end.pts},dts:{start:M.start.dts,end:M.end.dts}};k({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:$}),a(M)},onId3:(M,$)=>{o(s,M,$)},onCaptions:M=>{u(s,[M])},isEndOfTimeline:f,onEndedTimeline:()=>{m()},onTransmuxerLog:C,onDone:(M,$)=>{b&&(M.type=M.type==="combined"?"video":M.type,k({type:"segmenttransmuxingcomplete",segment:s}),b($,s,M))},segment:s,triggerSegmentEventFn:k});mi({action:"probeTs",transmuxer:s.transmuxer,data:e,baseStartTime:s.baseStartTime,callback:M=>{s.bytes=e=M.data;const $=M.result;$&&(t(s,{hasAudio:$.hasAudio,hasVideo:$.hasVideo,isMuxed:A}),t=null),F()}})},rh=({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:u,isEndOfTimeline:f,endedTimelineFn:m,dataFn:g,doneFn:b,onTransmuxerLog:C,triggerSegmentEventFn:k})=>{let P=new Uint8Array(e);if((0,hs.J2)(P)){s.isFmp4=!0;const{tracks:A}=s.map;if(A.text&&(!A.audio||!A.video)){g(s,{data:P,type:"text"}),pf(s,A.text.codec,b);return}const O={isFmp4:!0,hasVideo:!!A.video,hasAudio:!!A.audio};A.audio&&A.audio.codec&&A.audio.codec!=="enca"&&(O.audioCodec=A.audio.codec),A.video&&A.video.codec&&A.video.codec!=="encv"&&(O.videoCodec=A.video.codec),A.video&&A.audio&&(O.isMuxed=!0),t(s,O);const N=(H,F)=>{g(s,{data:P,type:O.hasAudio&&!O.isMuxed?"audio":"video"}),F&&F.length&&o(s,F),H&&H.length&&u(s,H),b(null,s,{})};mi({action:"probeMp4StartTime",timescales:s.map.timescales,data:P,transmuxer:s.transmuxer,callback:({data:H,startTime:F})=>{e=H.buffer,s.bytes=P=H,O.hasAudio&&!O.isMuxed&&i(s,"audio","start",F),O.hasVideo&&i(s,"video","start",F),mi({action:"probeEmsgID3",data:P,transmuxer:s.transmuxer,offset:F,callback:({emsgData:M,id3Frames:$})=>{if(e=M.buffer,s.bytes=P=M,!A.video||!M.byteLength||!s.transmuxer){N(void 0,$);return}mi({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:s.transmuxer,data:P,timescales:s.map.timescales,trackIds:[A.video.id],callback:D=>{e=D.data.buffer,s.bytes=P=D.data,D.logs.forEach(function(B){C(J(B,{stream:"mp4CaptionParser"}))}),N(D.captions,$)}})}})}});return}if(!s.transmuxer){b(null,s,{});return}if(typeof s.container=="undefined"&&(s.container=(0,hs.ne)(P)),s.container!=="ts"&&s.container!=="aac"){t(s,{hasAudio:!1,hasVideo:!1}),b(null,s,{});return}_f({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:u,isEndOfTimeline:f,endedTimelineFn:m,dataFn:g,doneFn:b,onTransmuxerLog:C,triggerSegmentEventFn:k})},ah=function({id:s,key:e,encryptedBytes:t,decryptionWorker:i,segment:n,doneFn:a},o){const u=m=>{if(m.data.source===s){i.removeEventListener("message",u);const g=m.data.decrypted;o(new Uint8Array(g.bytes,g.byteOffset,g.byteLength))}};i.onerror=()=>{const m="An error occurred in the decryption worker",g=jt({segment:n}),b={message:m,metadata:{error:new Error(m),errorType:E.Error.StreamingFailedToDecryptSegment,segmentInfo:g,keyInfo:{uri:n.key.resolvedUri||n.map.key.resolvedUri}}};a(b,n)},i.addEventListener("message",u);let f;e.bytes.slice?f=e.bytes.slice():f=new Uint32Array(Array.prototype.slice.call(e.bytes)),i.postMessage(jl({source:s,encrypted:t,key:f,iv:e.iv}),[t.buffer,f.buffer])},yf=({decryptionWorker:s,segment:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:u,isEndOfTimeline:f,endedTimelineFn:m,dataFn:g,doneFn:b,onTransmuxerLog:C,triggerSegmentEventFn:k})=>{k({type:"segmentdecryptionstart"}),ah({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:s,segment:e,doneFn:b},P=>{e.bytes=P,k({type:"segmentdecryptioncomplete",segment:e}),rh({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:u,isEndOfTimeline:f,endedT
191imelineFn:m,dataFn:g,doneFn:b,onTransmuxerLog:C,triggerSegmentEventFn:k})})},Tf=({activeXhrs:s,decryptionWorker:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:u,isEndOfTimeline:f,endedTimelineFn:m,dataFn:g,doneFn:b,onTransmuxerLog:C,triggerSegmentEventFn:k})=>{let P=0,A=!1;return(R,O)=>{if(!A){if(R)return A=!0,Br(s),b(R,O);if(P+=1,P===s.length){const N=function(){if(O.encryptedBytes)return yf({decryptionWorker:e,segment:O,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:u,isEndOfTimeline:f,endedTimelineFn:m,dataFn:g,doneFn:b,onTransmuxerLog:C,triggerSegmentEventFn:k});rh({segment:O,bytes:O.bytes,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:u,isEndOfTimeline:f,endedTimelineFn:m,dataFn:g,doneFn:b,onTransmuxerLog:C,triggerSegmentEventFn:k})};if(O.endOfAllRequests=Date.now(),O.map&&O.map.encryptedBytes&&!O.map.bytes)return k({type:"segmentdecryptionstart",segment:O}),ah({decryptionWorker:e,id:O.requestId+"-init",encryptedBytes:O.map.encryptedBytes,key:O.map.key,segment:O,doneFn:b},H=>{O.map.bytes=H,k({type:"segmentdecryptioncomplete",segment:O}),nh(O,F=>{if(F)return Br(s),b(F,O);N()})});N()}}}},vf=({loadendState:s,abortFn:e})=>t=>{t.target.aborted&&e&&!s.calledAbortFn&&(e(),s.calledAbortFn=!0)},bf=({segment:s,progressFn:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:u,isEndOfTimeline:f,endedTimelineFn:m,dataFn:g})=>b=>{if(!b.target.aborted)return s.stats=J(s.stats,cf(b)),!s.stats.firstBytesReceivedAt&&s.stats.bytesReceived&&(s.stats.firstBytesReceivedAt=Date.now()),e(b,s)},Sf=({xhr:s,xhrOptions:e,decryptionWorker:t,segment:i,abortFn:n,progressFn:a,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:f,audioSegmentTimingInfoFn:m,id3Fn:g,captionsFn:b,isEndOfTimeline:C,endedTimelineFn:k,dataFn:P,doneFn:A,onTransmuxerLog:R,triggerSegmentEventFn:O})=>{const N=[],H=Tf({activeXhrs:N,decryptionWorker:t,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:f,audioSegmentTimingInfoFn:m,id3Fn:g,captionsFn:b,isEndOfTimeline:C,endedTimelineFn:k,dataFn:P,doneFn:A,onTransmuxerLog:R,triggerSegmentEventFn:O});if(i.key&&!i.key.bytes){const B=[i.key];i.map&&!i.map.bytes&&i.map.key&&i.map.key.resolvedUri===i.key.resolvedUri&&B.push(i.map.key);const Y=J(e,{uri:i.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),he=sh(i,B,H,O),ye={uri:i.key.resolvedUri};O({type:"segmentkeyloadstart",segment:i,keyInfo:ye});const de=s(Y,he);N.push(de)}if(i.map&&!i.map.bytes){if(i.map.key&&(!i.key||i.key.resolvedUri!==i.map.key.resolvedUri)){const de=J(e,{uri:i.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),q=sh(i,[i.map.key],H,O),Z={uri:i.map.key.resolvedUri};O({type:"segmentkeyloadstart",segment:i,keyInfo:Z});const Ve=s(de,q);N.push(Ve)}const Y=J(e,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:Or(i.map),requestType:"segment-media-initialization"}),he=mf({segment:i,finishProcessingFn:H,triggerSegmentEventFn:O});O({type:"segmentloadstart",segment:i});const ye=s(Y,he);N.push(ye)}const F=J(e,{uri:i.part&&i.part.resolvedUri||i.resolvedUri,responseType:"arraybuffer",headers:Or(i),requestType:"segment"}),M=gf({segment:i,finishProcessingFn:H,responseType:F.responseType,triggerSegmentEventFn:O});O({type:"segmentloadstart",segment:i});const $=s(F,M);$.addEventListener("progress",bf({segment:i,progressFn:a,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:f,audioSegmentTimingInfoFn:m,id3Fn:g,captionsFn:b,isEndOfTimeline:C,endedTimelineFn:k,dataFn:P})),N.push($);const D={};return N.forEach(B=>{B.addEventListener("loadend",vf({loadendState:D,abortFn:n}))}),()=>Br(N)},Qs=He("PlaylistSelector"),oh=function(s){if(!s||!s.playlist)return;const e=s.playlist;return JSON.stringify({id:e.id,bandwidth:s.bandwidth,width:s.width,height:s.height,codecs:e.attributes&&e.attributes.CODECS||""})},gi=function(s,e){if(!s)return"";const t=S().getComputedStyle(s);return t?t[e]:""},_i=function(s,e){const t=s.slice();s.sort(function(i,n){const a=e(i,n);return a===0?t.indexOf(i)-t.indexOf(n):a})},Nr=function(s,e){let t,i;return s.attributes.BANDWIDTH&&(t=s.attributes.BANDWIDTH),t=t||S().Number.MAX_VALUE,e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||S().Number.MAX_VALUE,t-i},xf=function(s,e){let t,i;return s.attributes.RESOLUTION&&s.attributes.RESOLUTION.width&&(t=s.attributes.RESOLUTION.width),t=t||S().Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||S().Number.MAX_VALUE,t===i&&s.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?s.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-i};let lh=function(s){const{main:e,bandwidth:t,playerWidth:i,playerHe
191ight:n,playerObjectFit:a,limitRenditionByPlayerDimensions:o,playlistController:u}=s;if(!e)return;const f={bandwidth:t,width:i,height:n,limitRenditionByPlayerDimensions:o};let m=e.playlists;Le.isAudioOnly(e)&&(m=u.getAudioTrackPlaylists_(),f.audioOnly=!0);let g=m.map(D=>{let B;const Y=D.attributes&&D.attributes.RESOLUTION&&D.attributes.RESOLUTION.width,he=D.attributes&&D.attributes.RESOLUTION&&D.attributes.RESOLUTION.height;return B=D.attributes&&D.attributes.BANDWIDTH,B=B||S().Number.MAX_VALUE,{bandwidth:B,width:Y,height:he,playlist:D}});_i(g,(D,B)=>D.bandwidth-B.bandwidth),g=g.filter(D=>!Le.isIncompatible(D.playlist));let b=g.filter(D=>Le.isEnabled(D.playlist));b.length||(b=g.filter(D=>!Le.isDisabled(D.playlist)));const C=b.filter(D=>D.bandwidth*_e.BANDWIDTH_VARIANCE<t);let k=C[C.length-1];const P=C.filter(D=>D.bandwidth===k.bandwidth)[0];if(o===!1){const D=P||b[0]||g[0];if(D&&D.playlist){let B="sortedPlaylistReps";return P&&(B="bandwidthBestRep"),b[0]&&(B="enabledPlaylistReps"),Qs(`choosing ${oh(D)} using ${B} with options`,f),D.playlist}return Qs("could not choose a playlist with options",f),null}const A=C.filter(D=>D.width&&D.height);_i(A,(D,B)=>D.width-B.width);const R=A.filter(D=>D.width===i&&D.height===n);k=R[R.length-1];const O=R.filter(D=>D.bandwidth===k.bandwidth)[0];let N,H,F;O||(N=A.filter(D=>a==="cover"?D.width>i&&D.height>n:D.width>i||D.height>n),H=N.filter(D=>D.width===N[0].width&&D.height===N[0].height),k=H[H.length-1],F=H.filter(D=>D.bandwidth===k.bandwidth)[0]);let M;if(u.leastPixelDiffSelector){const D=A.map(B=>(B.pixelDiff=Math.abs(B.width-i)+Math.abs(B.height-n),B));_i(D,(B,Y)=>B.pixelDiff===Y.pixelDiff?Y.bandwidth-B.bandwidth:B.pixelDiff-Y.pixelDiff),M=D[0]}const $=M||F||O||P||b[0]||g[0];if($&&$.playlist){let D="sortedPlaylistReps";return M?D="leastPixelDiffRep":F?D="resolutionPlusOneRep":O?D="resolutionBestRep":P?D="bandwidthBestRep":b[0]&&(D="enabledPlaylistReps"),Qs(`choosing ${oh($)} using ${D} with options`,f),$.playlist}return Qs("could not choose a playlist with options",f),null};const hh=function(){let s=this.useDevicePixelRatio&&S().devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),lh({main:this.playlists.main,bandwidth:this.systemBandwidth,playerWidth:parseInt(gi(this.tech_.el(),"width"),10)*s,playerHeight:parseInt(gi(this.tech_.el(),"height"),10)*s,playerObjectFit:this.usePlayerObjectFit?gi(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})},Cf=function(s){let e=-1,t=-1;if(s<0||s>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let i=this.useDevicePixelRatio&&S().devicePixelRatio||1;return isNaN(this.customPixelRatio)||(i=this.customPixelRatio),e<0&&(e=this.systemBandwidth,t=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==t&&(e=s*this.systemBandwidth+(1-s)*e,t=this.systemBandwidth),lh({main:this.playlists.main,bandwidth:e,playerWidth:parseInt(gi(this.tech_.el(),"width"),10)*i,playerHeight:parseInt(gi(this.tech_.el(),"height"),10)*i,playerObjectFit:this.usePlayerObjectFit?gi(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})}},Ef=function(s){const{main:e,currentTime:t,bandwidth:i,duration:n,segmentDuration:a,timeUntilRebuffer:o,currentTimeline:u,syncController:f}=s,m=e.playlists.filter(P=>!Le.isIncompatible(P));let g=m.filter(Le.isEnabled);g.length||(g=m.filter(P=>!Le.isDisabled(P)));const C=g.filter(Le.hasAttribute.bind(null,"BANDWIDTH")).map(P=>{const R=f.getSyncPoint(P,n,u,t)?1:2,N=Le.estimateSegmentRequestTime(a,i,P)*R-o;return{playlist:P,rebufferingImpact:N}}),k=C.filter(P=>P.rebufferingImpact<=0);return _i(k,(P,A)=>Nr(A.playlist,P.playlist)),k.length?k[0]:(_i(C,(P,A)=>P.rebufferingImpact-A.rebufferingImpact),C[0]||null)},kf=function(){const s=this.playlists.main.playlists.filter(Le.isEnabled);return _i(s,(t,i)=>Nr(t,i)),s.filter(t=>!!ji(this.playlists.main,t).video)[0]||null},wf=s=>{let e=0,t;
191return s.bytes&&(t=new Uint8Array(s.bytes),s.segments.forEach(i=>{t.set(i,e),e+=i.byteLength})),t};function dh(s){try{return new URL(s).pathname.split("/").slice(-2).join("/")}catch(e){return""}}const If=function(s,e,t){if(!s[t]){e.trigger({type:"usage",name:"vhs-608"});let i=t;/^cc708_/.test(t)&&(i="SERVICE"+t.split("_")[1]);const n=e.textTracks().getTrackById(i);if(n)s[t]=n;else{const a=e.options_.vhs&&e.options_.vhs.captionServices||{};let o=t,u=t,f=!1;const m=a[i];m&&(o=m.label,u=m.language,f=m.default),s[t]=e.addRemoteTextTrack({kind:"captions",id:i,default:f,label:o,language:u},!1).track}}},Pf=function({inbandTextTracks:s,captionArray:e,timestampOffset:t}){if(!e)return;const i=S().WebKitDataCue||S().VTTCue;e.forEach(n=>{const a=n.stream;n.content?n.content.forEach(o=>{const u=new i(n.startTime+t,n.endTime+t,o.text);u.line=o.line,u.align="left",u.position=o.position,u.positionAlign="line-left",s[a].addCue(u)}):s[a].addCue(new i(n.startTime+t,n.endTime+t,n.text))})},Af=function(s){Object.defineProperties(s.frame,{id:{get(){return E.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),s.value.key}},value:{get(){return E.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),s.value.data}},privateData:{get(){return E.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),s.value.data}}})},Lf=({inbandTextTracks:s,metadataArray:e,timestampOffset:t,videoDuration:i})=>{if(!e)return;const n=S().WebKitDataCue||S().VTTCue,a=s.metadataTrack_;if(!a||(e.forEach(g=>{const b=g.cueTime+t;typeof b!="number"||S().isNaN(b)||b<0||!(b<1/0)||!g.frames||!g.frames.length||g.frames.forEach(C=>{const k=new n(b,b,C.value||C.url||C.data||"");k.frame=C,k.value=C,Af(k),a.addCue(k)})}),!a.cues||!a.cues.length))return;const o=a.cues,u=[];for(let g=0;g<o.length;g++)o[g]&&u.push(o[g]);const f=u.reduce((g,b)=>{const C=g[b.startTime]||[];return C.push(b),g[b.startTime]=C,g},{}),m=Object.keys(f).sort((g,b)=>Number(g)-Number(b));m.forEach((g,b)=>{const C=f[g],k=isFinite(i)?i:g,P=Number(m[b+1])||k;C.forEach(A=>{A.endTime=P})})},Df={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},Of=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),Mf=({inbandTextTracks:s,dateRanges:e})=>{const t=s.metadataTrack_;if(!t)return;const i=S().WebKitDataCue||S().VTTCue;e.forEach(n=>{for(const a of Object.keys(n)){if(Of.has(a))continue;const o=new i(n.startTime,n.endTime,"");o.id=n.id,o.type="com.apple.quicktime.HLS",o.value={key:Df[a],data:n[a]},(a==="scte35Out"||a==="scte35In")&&(o.value.data=new Uint8Array(o.value.data.match(/[\da-f]{2}/gi)).buffer),t.addCue(o)}n.processDateRange()})},uh=(s,e,t)=>{s.metadataTrack_||(s.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,E.browser.IS_ANY_SAFARI||(s.metadataTrack_.inBandMetadataTrackDispatchType=e))},$i=function(s,e,t){let i,n;if(t&&t.cues)for(i=t.cues.length;i--;)n=t.cues[i],n.startTime>=s&&n.endTime<=e&&t.removeCue(n)},Rf=function(s){const e=s.cues;if(!e)return;const t={};for(let i=e.length-1;i>=0;i--){const n=e[i],a=`${n.startTime}-${n.endTime}-${n.text}`;t[a]?s.removeCue(n):t[a]=n}},Uf=(s,e,t)=>{if(typeof e=="undefined"||e===null||!s.length)return[];const i=Math.ceil((e-t+3)*At.ONE_SECOND_IN_TS);let n;for(n=0;n<s.length&&!(s[n].pts>i);n++);return s.slice(n)},Bf=(s,e,t)=>{if(!e.length)return s;if(t)return e.slice();const i=e[0].pts;let n=0;for(n;n<s.length&&!(s[n].pts>=i);n++);return s.slice(0,n).concat(e)},Ff=(s,e,t,i)=>{const n=Math.ceil((e-i)*At.ONE_SECOND_IN_TS),a=Math.ceil((t-i)*At.ONE_SECOND_IN_TS),o=s.slice();let u=s.length;for(;u--&&!(s[u].pts<=a););if(u===-1)return o;let f=u+1;for(;f--&&!(s[f].pts<=n););return f=Math.max(f,0),o.splice(f,u-f+1),o},Nf=function(s,e){if(!s&&!e||!s&&e||s&&!e)return!1;if(s===e)return!0;const t=Object.keys(s).sort(),i=Object.keys(e).sort();if(t.length!==i.length)return!1;for(let n=0;n<t.length;n++){const a=t[n];if(a!==i[n]||s[a]!==e[a])return!1}return!0},jf=function(s,e,t){e=e||[];const i=[];let n=0;for(let a=0;a<e.length;a++){const o=e[a];if(s===o.timeline&&(i.push(a),n+=o.duration,n>t))return a}return i.length===0?0:i[i.length-1]}
191,Hi=1,$f=500,ch=s=>typeof s=="number"&&isFinite(s),Ys=1/60,Hf=(s,e,t)=>s!=="main"||!e||!t?null:!t.hasAudio&&!t.hasVideo?"Neither audio nor video found in segment.":e.hasVideo&&!t.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&t.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null,Vf=(s,e,t)=>{let i=e-_e.BACK_BUFFER_LENGTH;s.length&&(i=Math.max(i,s.start(0)));const n=e-t;return Math.min(n,i)},yi=s=>{const{startOfSegment:e,duration:t,segment:i,part:n,playlist:{mediaSequence:a,id:o,segments:u=[]},mediaIndex:f,partIndex:m,timeline:g}=s,b=u.length-1;let C="mediaIndex/partIndex increment";s.getMediaInfoForTime?C=`getMediaInfoForTime (${s.getMediaInfoForTime})`:s.isSyncRequest&&(C="getSyncSegmentCandidate (isSyncRequest)"),s.independent&&(C+=` with independent ${s.independent}`);const k=typeof m=="number",P=s.segment.uri?"segment":"pre-segment",A=k?yl({preloadSegment:i})-1:0;return`${P} [${a+f}/${a+b}]`+(k?` part [${m}/${A}]`:"")+` segment start/end [${i.start} => ${i.end}]`+(k?` part start/end [${n.start} => ${n.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${g}] selected by [${C}] playlist [${o}]`},fh=s=>`${s}TimingInfo`,qf=({segmentTimeline:s,currentTimeline:e,startOfSegment:t,buffered:i,overrideCheck:n})=>!n&&s===e?null:s<e?t:i.length?i.end(i.length-1):t,jr=({timelineChangeController:s,currentTimeline:e,segmentTimeline:t,loaderType:i,audioDisabled:n})=>{if(e===t)return!1;if(i==="audio"){const a=s.lastTimelineChange({type:"main"});return!a||a.to!==t}if(i==="main"&&n){const a=s.pendingTimelineChange({type:"audio"});return!(a&&a.to===t)}return!1},zf=s=>{if(!s)return!1;const e=s.pendingTimelineChange({type:"audio"}),t=s.pendingTimelineChange({type:"main"}),i=e&&t,n=i&&e.to!==t.to;return!!(i&&e.from!==-1&&t.from!==-1&&n)},Wf=s=>{const e=s.timelineChangeController_.pendingTimelineChange({type:"audio"}),t=s.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&t&&e.to<t.to},St=s=>{const e=s.pendingSegment_;if(!e)return;if(jr({timelineChangeController:s.timelineChangeController_,currentTimeline:s.currentTimeline_,segmentTimeline:e.timeline,loaderType:s.loaderType_,audioDisabled:s.audioDisabled_})&&zf(s.timelineChangeController_)){if(Wf(s)){s.timelineChangeController_.trigger("audioTimelineBehind");return}s.timelineChangeController_.trigger("fixBadTimelineChange")}},Gf=s=>{let e=0;return["video","audio"].forEach(function(t){const i=s[`${t}TimingInfo`];if(!i)return;const{start:n,end:a}=i;let o;typeof n=="bigint"||typeof a=="bigint"?o=S().BigInt(a)-S().BigInt(n):typeof n=="number"&&typeof a=="number"&&(o=a-n),typeof o!="undefined"&&o>e&&(e=o)}),typeof e=="bigint"&&e<Number.MAX_SAFE_INTEGER&&(e=Number(e)),e},ph=({segmentDuration:s,maxDuration:e})=>s?Math.round(s)>e+it:!1,Kf=(s,e)=>{if(e!=="hls")return null;const t=Gf({audioTimingInfo:s.audioTimingInfo,videoTimingInfo:s.videoTimingInfo});if(!t)return null;const i=s.playlist.targetDuration,n=ph({segmentDuration:t,maxDuration:i*2}),a=ph({segmentDuration:t,maxDuration:i}),o=`Segment with index ${s.mediaIndex} from playlist ${s.playlist.id} has a duration of ${t} when the reported duration is ${s.duration} and the target duration is ${i}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return n||a?{severity:n?"warn":"info",message:o}:null},jt=({type:s,segment:e})=>{if(!e)return;const t=!!(e.key||e.map&&e.map.ke),i=!!(e.map&&!e.map.bytes),n=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:s||e.type,uri:e.resolvedUri||e.uri,start:n,duration:e.duration,isEncrypted:t,isMediaInitialization:i}};class $r extends E.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={}
191,this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=He(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(i){i!==this.state_&&(this.logger_(`${this.state_} -> ${i}`),this.state_=i,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():St(this)}),this.sourceUpdater_.on("codecschange",i=>{this.trigger((0,Ce.A)({type:"codecschange"},i))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():St(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",i=>{this.trigger((0,Ce.A)({type:"timelinechange"},i)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():St(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():St(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return Ur.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&S().clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null),this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,S().clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e}error(e){return typeof e!="undefined"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&Ur.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return ge();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:i,isMuxed:n}=e;if(i&&t&&!this.audioDisabled_&&!n)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const i=Ks(e);let n=this.initSegments_[i];return t&&!n&&e.bytes&&(this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),n||e}segmentKey(e,t=!1){if(!e)return null;const i=$l(e);let n=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!n&&e.bytes&&(this.keyCache_[i]=n={resolvedUri:e.resolvedUri,bytes:e.bytes});const a={resolvedUri:(n||e).resolvedUri};return n&&(a.bytes=n.bytes),a}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e||this.playlist_&&this.playlist_.endList&&e.endList&&this.playlist_.uri===e.uri)return;const i=this.playlist_,n=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let a=null;if(i&&(i.id?a=i.id:i.uri&&(a=i.uri)),this.logger_(`playlist update [${a} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update:
192currentTime: ${this.currentTime_()}
193bufferedEnd: ${xr(this.buffered_())}
194`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}const o=e.mediaSequence-i.mediaSequence;if(this.logger_(`live window shift [${o}]`),this.mediaIndex!==null)if(this.mediaIndex-=o,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const u=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!u.parts||!u.parts.length||!u.parts[this.partIndex])){const f=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=f}}n&&(n.mediaIndex-=o,n.mediaIndex<0?(n.mediaIndex=null,n.partIndex=null):(n.mediaIndex>=0&&(n.segment=e.segments[n.mediaIndex]),n.partIndex>=0&&n.segment.parts&&(n.part=n.segment.parts[n.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){this.checkBufferTimeout_&&(S().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}
194resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&Ur.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,i=()=>{},n=!1){if(t===1/0&&(t=this.duration_()),t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let a=1;const o=()=>{a--,a===0&&i()};(n||!this.audioDisabled_)&&(a++,this.sourceUpdater_.removeAudio(e,t,o)),(n||this.loaderType_==="main")&&(this.gopBuffer_=Ff(this.gopBuffer_,e,t,this.timeMapping_),a++,this.sourceUpdater_.removeVideo(e,t,o));for(const u in this.inbandTextTracks_)$i(e,t,this.inbandTextTracks_[u]);$i(e,t,this.segmentMetadataTrack_),o()}monitorBuffer_(){this.checkBufferTimeout_&&S().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=S().setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&S().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=S().setTimeout(this.monitorBufferTick_.bind(this),$f)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:jt({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,i=this.partIndex){if(!t||!this.mediaSource_)return!1;const n=typeof e=="number"&&t.segments[e],a=e+1===t.segments.length,o=!n||!n.parts||i+1===n.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&a&&o}chooseNextRequest_(){const e=this.buffered_(),t=xr(e)||0,i=Cr(e,this.currentTime_()),n=!this.hasPlayed_()&&i>=1,a=i>=this.goalBufferLength_(),o=this.playlist_.segments;if(!o.length||n||a)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const u={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(u.isSyncRequest)u.mediaIndex=jf(this.currentTimeline_,o,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${u.mediaIndex}`);else if(this.mediaIndex!==null){const C=o[this.mediaIndex],k=typeof this.partIndex=="number"?this.partIndex:-1;u.startOfSegment=C.end?C.end:t,C.parts&&C.parts[k+1]?(u.mediaIndex=this.mediaIndex,u.partIndex=k+1):u.mediaIndex=this.mediaIndex+1}else{let C,k,P;const A=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch:
195For TargetTime: ${A}.
196CurrentTime: ${this.currentTime_()}
197BufferedEnd: ${t}
198Fetch At Buffer: ${this.fetchAtBuffer_}
199`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const R=this.getSyncInfoFromMediaSequenceSync_(A);if(!R){const O="No sync info found while using media sequence sync";return this.error({message:O,metadata:{errorType:E.Error.StreamingFailedToSelectNextSegment,error:new Error(O)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${R.start} --> ${R.end})`),C=R.segmentIndex,k=R.partIndex,P=R.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const R=Le.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:A,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});C=R.segmentIndex,k=R.partIndex,P=R.startTime}u.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${A}`:`currentTime ${A}`,u.mediaIndex=C,u.startOfSegment=P,u.partIndex=k,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${u.mediaIndex} `)}const f=o[u.mediaIndex];let m=f&&typeof u.partIndex=="number"&&f.parts&&f.parts[u.partIndex];if(!f||typeof u.partIndex=="number"&&!m)return null;typeof u.partIndex!="number"&&f.parts&&(u.partIndex=0,m=f.parts[0]);const g=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&m&&!g&&!m.independent)if(u.partIndex===0){const C=o[u.mediaIndex-1],k=C.parts&&C.parts.length&&C.parts[C.parts.length-1];k&&k.independent&&(u.mediaIndex-=1,u.partIndex=C.parts.length-1,u.independent="previous segment")}else f.parts[u.partIndex-1].independent&&(u.partIndex-=1,u.independent="previous part");const b=this.mediaSource_&&this.mediaSource_.readyState==="ended";return u.mediaIndex>=o.length-1&&b&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,u.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(u))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const i=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!i)return null;if(!i.isAppended)return i;const n=this.mediaSequenceSync_.getSyncInfoForTime(i.end);return n?(n.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),n):null}generateSegmentInfo_(e){const{independent:t,playlist:i,mediaIndex:n,startOfSegment:a,isSyncRequest:o,partIndex:u,forceTimestampOffset:f,getMediaInfoForTime:m}=e,g=i.segments[n],b=typeof u=="number"&&g.parts[u],C={requestId:"segment-loader-"+Math.random(),uri:b&&b.resolvedUri||g.resolvedUri,mediaIndex:n,partIndex:b?u:null,isSyncRequest:o,startOfSegment:a,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:g.timeline,duration:b&&b.duration||g.duration,segment:g,part:b,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:m,independent:t},k=typeof f!="undefined"?f:this.isPendingTimestampOffset_;C.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:g.timeline,currentTimeline:this.currentTimeline_,startOfSegment:a,buffered:this.buffered_(),overrideCheck:k});
199const P=xr(this.sourceUpdater_.audioBuffered());return typeof P=="number"&&(C.audioAppendStart=P-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(C.gopsToAlignWith=Uf(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),C}timestampOffsetForSegment_(e){return qf(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),i=e.bandwidth,n=this.pendingSegment_.duration,a=Le.estimateSegmentRequestTime(n,i,this.playlist_,e.bytesReceived),o=pc(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(a<=o)return;const u=Ef({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:n,timeUntilRebuffer:o,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!u)return;const m=a-o-u.rebufferingImpact;let g=.5;o<=it&&(g=1),!(!u.playlist||u.playlist.uri===this.playlist_.uri||m<g)&&(this.bandwidth=u.playlist.attributes.BANDWIDTH*_e.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${yi(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId)&&this.trigger("progress")}handleTrackInfo_(e,t){const{hasAudio:i,hasVideo:n}=t,a={segmentInfo:jt({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:i,hasVideo:n}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:a}),this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(t)||(t=t||{},Nf(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()?this.processCallQueue_():St(this))))}handleTimingInfo_(e,t,i,n){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const a=this.pendingSegment_,o=fh(t);a[o]=a[o]||{},a[o][i]=n,this.logger_(`timinginfo: ${t} - ${i} - ${n}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():St(this)}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(t.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));return}const n=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),a={};t.forEach(o=>{a[o.stream]=a[o.stream]||{startTime:1/0,captions:[],endTime:0};const u=a[o.stream];u.startTime=Math.min(u.startTime,o.startTime+n),u.endTime=Math.max(u.endTime,o.endTime+n),u.captions.push(o)}),Object.keys(a).forEach(o=>{const{startTime:u,endTime:f,captions:m}=a[o],g=this.inbandTextTracks_;this.logger_(`adding cues from ${u} -> ${f} for ${o}`),If(g,this.vhs_.tech_,o),$i(u,f,g[o]),Pf({captionArray:m,inbandTextTracks:g,timestampOffset:n})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,i){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i));return}this.addMetadataToTextTrack(i,t,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(t=>t())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(t=>t())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!jr({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:i,hasVideo:n,isMuxed:a}=t;return!(n&&!e.videoTimingInfo||i&&!this.audioDisabled_&&!a&&!e.audioTimingInfo||jr({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){St(this),this.callQueue_.push(this.handleData_.bind(this,e,t));return}const i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.ke
199y,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[fh(t.type)].start;else{const n=this.getCurrentMediaInfo_(),a=this.loaderType_==="main"&&n&&n.hasVideo;let o;a&&(o=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:a,firstVideoFrameTimeForData:o,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:this.loaderType_==="main"});const n=this.chooseNextRequest_();if(n.mediaIndex!==i.mediaIndex||n.partIndex!==i.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}updateAppendInitSegmentStatus(e,t){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:i,playlist:n}){if(i){const a=Ks(i);if(this.activeInitSegmentId_===a)return null;t=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=a}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=n,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},n){const a=this.sourceUpdater_.audioBuffered(),o=this.sourceUpdater_.videoBuffered();a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Ft(a).join(", ")),o.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Ft(o).join(", "));const u=a.length?a.start(0):0,f=a.length?a.end(a.length-1):0,m=o.length?o.start(0):0,g=o.length?o.end(o.length-1):0;if(f-u<=Hi&&g-m<=Hi){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${Ft(a).join(", ")}, video buffer: ${Ft(o).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:i}));const C=this.currentTime_()-Hi;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${C}`),this.remove(0,C,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${Hi}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=S().setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},Hi*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:i},n){if(n){if(n.code===Ll){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",n),this.error({message:`${t} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:E.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:n,bytes:a}){if(!a){const u=[n];let f=n.byteLength;i&&(u.unshift(i),f+=i.byteLength),a=wf({bytes:f,segments:u})}const o={segmentInfo:jt({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:o}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:a},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:a}))}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const n=this.pendingSegment_.segment,a=`${e}TimingInfo`;n[a]||(n[a]={}),n[a].transmuxerPrependedSeconds=i.prependedContentDuration||0,n[a].transmuxedPresentationStart=i.start.presentation,n[a].transmuxedDecodeStart=i.start.decode,n[a].transmuxedPresentationEnd=i.end.presentation,n[a].transmuxedDecodeEnd=i.end.decode,n[a].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){const{type:i,data:n}=t;if(!n||!n.byteLength||i==="audio"&&this.audioDisabled_)return;const a=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:a,data:n})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){St(this),this.loadQueue_.push(()=>{const t=(0,Ce.A)({},e,{forceTimestampOffset:!0});(0,Ce.A)(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_
199(e.mediaIndex,e.playlist,e.partIndex),n=this.mediaIndex!==null,a=e.timeline!==this.currentTimeline_&&e.timeline>0,o=i||n&&a;this.logger_(`Requesting
200${dh(e.uri)}
201${yi(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=Sf({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:o,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:u,level:f,stream:m})=>{this.logger_(`${yi(e)} logged from transmuxer stream ${m} as a ${f}: ${u}`)},triggerSegmentEventFn:({type:u,segment:f,keyInfo:m,trackInfo:g,timingInfo:b})=>{const k={segmentInfo:jt({segment:f})};m&&(k.keyInfo=m),g&&(k.trackInfo=g),b&&(k.timingInfo=b),this.trigger({type:u,metadata:k})}})}trimBackBuffer_(e){const t=Vf(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,i=e.part,n=e.segment.key||e.segment.map&&e.segment.map.key,a=e.segment.map&&!e.segment.map.bytes,o={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:n,isMediaInitialization:a},u=e.playlist.segments[e.mediaIndex-1];if(u&&u.timeline===t.timeline&&(u.videoTimingInfo?o.baseStartTime=u.videoTimingInfo.transmuxedDecodeEnd:u.audioTimingInfo&&(o.baseStartTime=u.audioTimingInfo.transmuxedDecodeEnd)),t.key){const f=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);o.key=this.segmentKey(t.key),o.key.iv=f}return t.map&&(o.map=this.initSegmentForMap(t.map)),o}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<Ys){this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record ${Ys}`);return}const i={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:i}),this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,i){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_||t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state="READY",e.code===nt.ABORTED)return;if(this.pause(),e.code===nt.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(e),this.trigger("error");return}const n=this.pendingSegment_;this.saveBandwidthRelatedStats_(n.duration,t.stats),n.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=Bf(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(n)}setTimeMapping_(e){const t=this.syncController_.mappingForTimeline(e);t!==null&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){typeof e.start=="number"&&typeof e.end=="number"?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return e===null?!1:this.loaderType_==="main"&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset()}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:i,firstVideoFrameTimeForData:n,currentVideoTimestampOffset:a,useVideoTimingInfo:o,videoTimingInfo:u,audioTimingInfo:f}){if(typeof e!="undefined")return e;if(!o)return f.start;const m=t.segments[i-1];return i===0||!m||typeof m.start=="undefined"||m.end!==n+a?n:u.start}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error");return}const{hasAudio:i,hasVideo:n,isMuxed:a}=t,o=this.loaderType_==="main"&&n,u=!this.audioDisabled_&&i&&!a;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}o&&e.waitingOnAppends++,u&&e.waitingOnAppends++,o&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),u&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}
201checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=Hf(this.loaderType_,this.getCurrentMediaInfo_(),e);return t?(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger("error"),!0):!1}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:i}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart=="number"?t.transmuxedDecodeStart:i.start:i.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),n=this.loaderType_==="main"&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;n&&(e.timingInfo.end=typeof n.end=="number"?n.end:n.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const f={segmentInfo:jt({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:f})}if(!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});const t=Kf(e,this.sourceType_);if(t&&(t.severity==="warn"?E.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${yi(e)}`);return}this.logger_(`Appended ${yi(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const i=e.segment,n=e.part,a=i.end&&this.currentTime_()-i.end>e.playlist.targetDuration*3,o=n&&n.end&&this.currentTime_()-n.end>e.playlist.partTargetDuration*3;if(a||o){this.logger_(`bad ${a?"segment":"part"} ${yi(e)}`),this.resetEverything();return}this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duration<Ys){this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record ${Ys}`);return}const t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,n=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(n-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,i=t.start,n=t.end;if(!ch(i)||!ch(n))return;$i(i,n,this.segmentMetadataTrack_);const a=S().WebKitDataCue||S().VTTCue,o={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.ur
201i,timeline:e.timeline,playlist:e.playlist.id,start:i,end:n},u=JSON.stringify(o),f=new a(i,n,u);f.value=o,this.segmentMetadataTrack_.addCue(f)}}function dt(){}const mh=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},Qf=["video","audio"],Hr=(s,e)=>{const t=e[`${s}Buffer`];return t&&t.updating||e.queuePending[s]},Yf=(s,e)=>{for(let t=0;t<e.length;t++){const i=e[t];if(i.type==="mediaSource")return null;if(i.type===s)return t}return null},Ti=(s,e)=>{if(e.queue.length===0)return;let t=0,i=e.queue[t];if(i.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),i.action(e),i.doneFn&&i.doneFn(),Ti("audio",e),Ti("video",e));return}if(s!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||Hr(s,e))){if(i.type!==s){if(t=Yf(s,e.queue),t===null)return;i=e.queue[t]}if(e.queue.splice(t,1),e.queuePending[s]=i,i.action(s,e),!i.doneFn){e.queuePending[s]=null,Ti(s,e);return}}},gh=(s,e)=>{const t=e[`${s}Buffer`],i=mh(s);t&&(t.removeEventListener("updateend",e[`on${i}UpdateEnd_`]),t.removeEventListener("error",e[`on${i}Error_`]),e.codecs[s]=null,e[`${s}Buffer`]=null)},rt=(s,e)=>s&&e&&Array.prototype.indexOf.call(s.sourceBuffers,e)!==-1,Re={appendBuffer:(s,e,t)=>(i,n)=>{const a=n[`${i}Buffer`];if(rt(n.mediaSource,a)){n.logger_(`Appending segment ${e.mediaIndex}'s ${s.length} bytes to ${i}Buffer`);try{a.appendBuffer(s)}catch(o){n.logger_(`Error with code ${o.code} `+(o.code===Ll?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${i}Buffer`),n.queuePending[i]=null,t(o)}}},remove:(s,e)=>(t,i)=>{const n=i[`${t}Buffer`];if(rt(i.mediaSource,n)){i.logger_(`Removing ${s} to ${e} from ${t}Buffer`);try{n.remove(s,e)}catch(a){i.logger_(`Remove ${s} to ${e} from ${t}Buffer failed`)}}},timestampOffset:s=>(e,t)=>{const i=t[`${e}Buffer`];rt(t.mediaSource,i)&&(t.logger_(`Setting ${e}timestampOffset to ${s}`),i.timestampOffset=s)},callback:s=>(e,t)=>{s()},endOfStream:s=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${s||""})`);try{e.mediaSource.endOfStream(s)}catch(t){E.log.warn("Failed to call media source endOfStream",t)}}},duration:s=>e=>{e.logger_(`Setting mediaSource duration to ${s}`);try{e.mediaSource.duration=s}catch(t){E.log.warn("Failed to set media source duration",t)}},abort:()=>(s,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${s}Buffer`];if(rt(e.mediaSource,t)){e.logger_(`calling abort on ${s}Buffer`);try{t.abort()}catch(i){E.log.warn(`Failed to abort on ${s}Buffer`,i)}}},addSourceBuffer:(s,e)=>t=>{const i=mh(s),n=(0,se.UD)(e);t.logger_(`Adding ${s}Buffer with codec ${e} to mediaSource`);const a=t.mediaSource.addSourceBuffer(n);a.addEventListener("updateend",t[`on${i}UpdateEnd_`]),a.addEventListener("error",t[`on${i}Error_`]),t.codecs[s]=e,t[`${s}Buffer`]=a},removeSourceBuffer:s=>e=>{const t=e[`${s}Buffer`];if(gh(s,e),!!rt(e.mediaSource,t)){e.logger_(`Removing ${s}Buffer with codec ${e.codecs[s]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(i){E.log.warn(`Failed to removeSourceBuffer ${s}Buffer`,i)}}},changeType:s=>(e,t)=>{const i=t[`${e}Buffer`],n=(0,se.UD)(s);if(!rt(t.mediaSource,i))return;const a=s.substring(0,s.indexOf(".")),o=t.codecs[e];if(o.substring(0,o.indexOf("."))===a)return;const f={codecsChangeInfo:{from:o,to:s}};t.trigger({type:"codecschange",metadata:f}),t.logger_(`changing ${e}Buffer codec from ${o} to ${s}`);try{i.changeType(n),t.codecs[e]=s}catch(m){f.errorType=E.Error.StreamingCodecsChangeError,f.error=m,m.metadata=f,t.error_=m,t.trigger("error"),E.log.warn(`Failed to changeType on ${e}Buffer`,m)}}},Ue=({type:s,sourceUpdater:e,action:t,doneFn:i,name:n})=>{e.queue.push({type:s,action:t,doneFn:i,name:n}),Ti(s,e)},_h=(s,e)=>t=>{const i=e[`${s}Buffered`](),n=uc(i);if(e.logger_(`received "updateend" event for ${s} Source Buffer: `,n),e.queuePending[s]){const a=e.queuePending[s].doneFn;e.queuePending[s]=null,a&&a(e[`${s}Error_`])}Ti(s,e)};class yh extends E.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Ti("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=He("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=_h("video",this),this.onAudioUpdateEnd_=_h("audio",this),this.onVideoError_=t=>{this.videoError_=t},this.onAudioError_=t=>{this.audioError_=t},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}
201triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){Ue({type:"mediaSource",sourceUpdater:this,action:Re.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){Ue({type:e,sourceUpdater:this,action:Re.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){E.log.error("removeSourceBuffer is not supported!");return}Ue({type:"mediaSource",sourceUpdater:this,action:Re.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!E.browser.IS_FIREFOX&&S().MediaSource&&S().MediaSource.prototype&&typeof S().MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return S().SourceBuffer&&S().SourceBuffer.prototype&&typeof S().SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){E.log.error("changeType is not supported!");return}Ue({type:e,sourceUpdater:this,action:Re.changeType(t),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const i=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,i);this.canChangeType()&&this.changeType(t,i)})}appendBuffer(e,t){const{segmentInfo:i,type:n,bytes:a}=e;if(this.processedAppend_=!0,n==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${a.length} until video append`);return}const o=t;if(Ue({type:n,sourceUpdater:this,action:Re.appendBuffer(a,i||{mediaIndex:-1},o),doneFn:t,name:"appendBuffer"}),n==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const u=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${u.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,u.forEach(f=>{this.appendBuffer.apply(this,f)})}}audioBuffered(){return rt(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:ge()}videoBuffered(){return rt(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:ge()}buffered(){const e=rt(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=rt(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():fc(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=dt){Ue({type:"mediaSource",sourceUpdater:this,action:Re.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=dt){typeof e!="string"&&(e=void 0),Ue({type:"mediaSource",sourceUpdater:this,action:Re.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=dt){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){i();return}Ue({type:"audio",sourceUpdater:this,action:Re.remove(e,t),doneFn:i,name:"remove"})}removeVideo(e,t,i=dt){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){i();return}Ue({type:"video",sourceUpdater:this,action:Re.remove(e,t),doneFn:i,name:"remove"})}updating(){return!!(Hr("audio",this)||Hr("video",this))}audioTimestampOffset(e){return typeof e!="undefined"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Ue({type:"audio",sourceUpdater:this,action:Re.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e!="undefined"&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(Ue({type:"video",sourceUpdater:this,action:Re.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&Ue({type:"audio",sourceUpdater:this,action:Re.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&Ue({type:"video",sourceUpdater:this,action:Re.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),Qf.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>gh(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const Th=s=>decodeURIComponent(escape(String.fromCharCode.apply(null,s))),Xf=s=>{const e=new Uint8Array(s);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},vh=new Uint8Array(`
202
203`.split("").map(s=>s.charCodeAt(0)));
203class Jf extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class Zf extends $r{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return ge();const e=this.subtitlesTrack_.cues,t=e[0].startTime,i=e[e.length-1].startTime;return ge([[t,i]])}initSegmentForMap(e,t=!1){if(!e)return null;const i=Ks(e);let n=this.initSegments_[i];if(t&&!n&&e.bytes){const a=vh.byteLength+e.bytes.byteLength,o=new Uint8Array(a);o.set(e.bytes),o.set(vh,e.bytes.byteLength),this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:o}}return n||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return typeof e=="undefined"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,t){$i(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",t),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,i){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===nt.TIMEOUT&&this.handleTimeout_(),e.code===nt.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const n=this.pendingSegment_,a=i.mp4VttCues&&i.mp4VttCues.length;a&&(n.mp4VttCues=i.mp4VttCues),this.saveBandwidthRelatedStats_(n.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const o=n.segment;if(o.map&&(o.map.bytes=t.map.bytes),n.bytes=t.bytes,typeof S().WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,i),()=>this.stopForError({message:"Error loading vtt.js"}));return}o.requested=!0;try{this.parseVTTCues_(n)}catch(u){this.stopForError({message:u.message,metadata:{errorType:E.Error.StreamingVttParserError,error:u}});return}if(a||this.updateTimeMapping_(n,this.syncController_.timelines[n.timeline],this.playlist_),n.cues.length?n.timingInfo={start:n.cues[0].startTime,end:n.cues[n.cues.length-1].endTime}:n.timingInfo={start:n.startOfSegment,end:n.startOfSegment+n.duration},n.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}n.byteLength=n.bytes.byteLength,this.mediaSecondsLoaded+=o.duration,n.cues.forEach(u=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new(S()).VTTCue(u.startTime,u.endTime,u.text):u)}),Rf(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(e,t){const i=e&&e.type==="vtt",n=t&&t.type==="text";i&&n&&super.handleData_(e,t)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){const t=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(i=>{const n=i.start+t,a=i.end+t,o=new(S()).VTTCue(n,a,i.cueText);i.settings&&i.settings.split(" ").forEach(u=>{const f=u.split(":"),m=f[0],g=f[1];o[m]=isNaN(g)?g:Number(g)}),e.cues.push(o)})}parseVTTCues_(e){let t,i=!1;if(typeof S().WebVTT!="function")throw new Jf;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues){this.parseMp4VttCues_(e);return}typeof S().TextDecoder=="function"?t=new(S()).TextDecoder("utf8"):(t=S().WebVTT.StringDecoder(),i=!0);const n=new(S()).WebVTT.Parser(S(),S().vttjs,t);if(n.oncue=e.cues.push.bind(e.cues),n.ontimestampmap=o=>{e.timestampmap=o},n.onparsingerror=o=>{E.log.warn("Error encountered when parsing cues: "+o.message)},e.segment.map){let o=e.segment.map.bytes;i&&(o=Th(o)),n.parse(o)}let a=e.bytes;i&&(a=Th(a)),n.parse(a),n.flush()}updateTimeMapping_(e,t,i){const n=e.segment;if(!t)return;if(!e.cues.length){n.empty=!0;return}const{MPEGTS:a,LOCAL:o}=e.timestampmap,f=a/At.ONE_SECOND_IN_TS-o+t.mapping;
203if(e.cues.forEach(m=>{const g=m.endTime-m.startTime,b=this.handleRollover_(m.startTime+f,t.time);m.startTime=Math.max(b,0),m.endTime=Math.max(b+g,0)}),!i.syncInfo){const m=e.cues[0].startTime,g=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(m,g-n.duration)}}}handleRollover_(e,t){if(t===null)return e;let i=e*At.ONE_SECOND_IN_TS;const n=t*At.ONE_SECOND_IN_TS;let a;for(n<i?a=-8589934592:a=8589934592;Math.abs(i-n)>4294967296;)i+=a;return i/At.ONE_SECOND_IN_TS}}const ep=function(s,e){const t=s.cues;for(let i=0;i<t.length;i++){const n=t[i];if(e>=n.adStartTime&&e<=n.adEndTime)return n}return null},tp=function(s,e,t=0){if(!s.segments)return;let i=t,n;for(let a=0;a<s.segments.length;a++){const o=s.segments[a];if(n||(n=ep(e,i+o.duration/2)),n){if("cueIn"in o){n.endTime=i,n.adEndTime=i,i+=o.duration,n=null;continue}if(i<n.endTime){i+=o.duration;continue}n.endTime+=o.duration}else if("cueOut"in o&&(n=new(S()).VTTCue(i,i+o.duration,o.cueOut),n.adStartTime=i,n.adEndTime=i+parseFloat(o.cueOut),e.addCue(n)),"cueOutCont"in o){const[u,f]=o.cueOutCont.split("/").map(parseFloat);n=new(S()).VTTCue(i,i+o.duration,""),n.adStartTime=i-u,n.adEndTime=n.adStartTime+f,e.addCue(n)}i+=o.duration}};class bh{constructor({start:e,end:t,segmentIndex:i,partIndex:n=null,appended:a=!1}){this.start_=e,this.end_=t,this.segmentIndex_=i,this.partIndex_=n,this.appended_=a}isInRange(e){return e>=this.start&&e<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class ip{constructor(e,t=[]){this.segmentSyncInfo_=e,this.partsSyncInfo_=t}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class Sh{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){const{mediaSequence:i,segments:n}=e;if(this.isReliable_=this.isReliablePlaylist_(i,n),!!this.isReliable_)return this.updateStorage_(n,i,this.calculateBaseTime_(i,n,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:i}of this.storage_.values())if(i.length){for(const n of i)if(n.isInRange(e))return n}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,i){const n=new Map;let a=`
204`,o=i,u=t;this.start_=o,e.forEach((f,m)=>{const g=this.storage_.get(u),b=o,C=b+f.duration,k=!!(g&&g.segmentSyncInfo&&g.segmentSyncInfo.isAppended),P=new bh({start:b,end:C,appended:k,segmentIndex:m});f.syncInfo=P;let A=o;const R=(f.parts||[]).map((O,N)=>{const H=A,F=A+O.duration,M=!!(g&&g.partsSyncInfo&&g.partsSyncInfo[N]&&g.partsSyncInfo[N].isAppended),$=new bh({start:H,end:F,appended:M,segmentIndex:m,partIndex:N});return A=F,a+=`Media Sequence: ${u}.${N} | Range: ${H} --> ${F} | Appended: ${M}
205`,O.syncInfo=$,$});n.set(u,new ip(P,R)),a+=`${dh(f.resolvedUri)} | Media Sequence: ${u} | Range: ${b} --> ${C} | Appended: ${k}
206`,u++,o=C}),this.end_=o,this.storage_=n,this.diagnostics_=a}calculateBaseTime_(e,t,i){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;const n=Math.min(...this.storage_.keys());if(e<n){const a=n-e;let o=this.storage_.get(n).segmentSyncInfo.start;for(let u=0;u<a;u++){const f=t[u];o-=f.duration}return o}return i}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}class xh extends Sh{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t,i){if(!this.storage_.size){const n=this.parent_.getSyncInfoForMediaSequence(e);return n?n.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t,i)}}const sp=86400,Vr=[{name:"VOD",run:(s,e,t,i,n)=>t!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(s,e,t,i,n,a)=>{const o=s.getMediaSequenceSync(a);if(!o||!o.isReliable)return null;const u=o.getSyncInfoForTime(n);return u?{time:u.start,partIndex:u.partIndex,segmentIndex:u.segmentIndex}:null}},{name:"ProgramDateTime",run:(s,e,t,i,n)=>{if(!Object.keys(s.timelineToDatetimeMappings).length)return null;let a=null,o=null;const u=kr(e);n=n||0;for(let f=0;f<u.length;f++){const m=e.endList||n===0?f:u.length-(f+1),g=u[m],b=g.segment,C=s.timelineToDatetimeMappings[b.timeline];if(!C||!b.dateTimeObject)continue;let P=b.dateTimeObject.getTime()/1e3+C;if(b.parts&&typeof g.partIndex=="number")for(let R=0;R<g.partIndex;R++)P+=b.parts[R].duration;const A=Math.abs(n-P);if(o!==null&&(A===0||o<A))break;o=A,a={time:P,segmentIndex:g.segmentIndex,partIndex:g.partIndex}}return a}},{name:"Segment",run:(s,e,t,i,n)=>{let a=null,o=null;n=n||0;const u=kr(e);for(let f=0;f<u.length;f++){const m=e.endList||n===0?f:u.length-(f+1),g=u[m],b=g.segment,C=g.part&&g.part.start||b&&b.start;if(b.timeline===i&&typeof C!="undefined"){const k=Math.abs(n-C);if(o!==null&&o<k)break;(!a||o===null||o>=k)&&(o=k,a={time:C,segmentIndex:g.segmentIndex,partIndex:g.partIndex})}}return a}},{name:"Discontinuity",run:(s,e,t,i,n)=>{let a=null;if(n=n||0,e.discontinuityStarts&&e.discontinuityStarts.length){let o=null;for(let u=0;u<e.discontinuityStarts.length;u++){const f=e.discontinuityStarts[u],m=e.discontinuitySequence+u+1,g=s.discontinuities[m];if(g){const b=Math.abs(n-g.time);if(o!==null&&o<b)break;(!a||o===null||o>=b)&&(o=b,a={time:g.time,segmentIndex:f,partIndex:null})}}}return a}},{name:"Playlist",run:(s,e,t,i,n)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];
206class np extends E.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new Sh,i=new xh(t),n=new xh(t);this.mediaSequenceStorage_={main:t,audio:i,vtt:n},this.logger_=He("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,i,n,a){if(t!==1/0)return Vr.find(({name:f})=>f==="VOD").run(this,e,t);const o=this.runStrategies_(e,t,i,n,a);if(!o.length)return null;for(const u of o){const{syncPoint:f,strategy:m}=u,{segmentIndex:g,time:b}=f;if(g<0)continue;const C=e.segments[g],k=b,P=k+C.duration;if(this.logger_(`Strategy: ${m}. Current time: ${n}. selected segment: ${g}. Time: [${k} -> ${P}]}`),n>=k&&n<P)return this.logger_("Found sync point with exact match: ",f),f}return this.selectSyncPoint_(o,{key:"time",value:n})}getExpiredTime(e,t){if(!e||!e.segments)return null;const i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;const n=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return n.segmentIndex>0&&(n.time*=-1),Math.abs(n.time+Bi({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:n.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,n,a){const o=[];for(let u=0;u<Vr.length;u++){const f=Vr[u],m=f.run(this,e,t,i,n,a);m&&(m.strategy=f.name,o.push({strategy:f.name,syncPoint:m}))}return o}selectSyncPoint_(e,t){let i=e[0].syncPoint,n=Math.abs(e[0].syncPoint[t.key]-t.value),a=e[0].strategy;for(let o=1;o<e.length;o++){const u=Math.abs(e[o].syncPoint[t.key]-t.value);u<n&&(n=u,i=e[o].syncPoint,a=e[o].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${a}]: [time:${i.time}, segmentIndex:${i.segmentIndex}`+(typeof i.partIndex=="number"?`,partIndex:${i.partIndex}`:"")+"]"),i}saveExpiredSegmentInfo(e,t){const i=t.mediaSequence-e.mediaSequence;if(i>sp){E.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);return}for(let n=i-1;n>=0;n--){const a=e.segments[n];if(a&&typeof a.start!="undefined"){t.syncInfo={mediaSequence:e.mediaSequence+n,time:a.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),n=e.segment;i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:n.start}));const a=n.dateTimeObject;n.discontinuity&&t&&a&&(this.timelineToDatetimeMappings[n.timeline]=-(a.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]=="undefined"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]=="undefined"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){const n=e.segment,a=e.part;let o=this.timelines[e.timeline],u,f;if(typeof e.timestampOffset=="number")o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${o.time}] [mapping: ${o.mapping}]`)),u=e.startOfSegment,f=t.end+o.mapping;else if(o)u=t.start+o.mapping,f=t.end+o.mapping;else return!1;return a&&(a.start=u,a.end=f),(!n.start||u<n.start)&&(n.start=u),n.end=f,!0}saveDiscontinuitySyncInfo_(e){const t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let n=0;n<t.discontinuityStarts.length;n++){const a=t.discontinuityStarts[n],o=t.discontinuitySequence+n+1,u=a-e.mediaIndex,f=Math.abs(u);if(!this.discontinuities[o]||this.discontinuities[o].accuracy>f){let m;u<0?m=i.start-Bi({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:a}
206):m=i.end+Bi({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:a}),this.discontinuities[o]={time:m,accuracy:f}}}}dispose(){this.trigger("dispose"),this.off()}}class rp extends E.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){return typeof t=="number"&&typeof i=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){if(typeof t=="number"&&typeof i=="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:i},delete this.pendingTimelineChanges_[e];const n={timelineChangeInfo:{from:t,to:i}};this.trigger({type:"timelinechange",metadata:n})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const ap=Ql(Yl(function(){var s=(function(){function A(){this.listeners={}}var R=A.prototype;return R.on=function(N,H){this.listeners[N]||(this.listeners[N]=[]),this.listeners[N].push(H)},R.off=function(N,H){if(!this.listeners[N])return!1;var F=this.listeners[N].indexOf(H);return this.listeners[N]=this.listeners[N].slice(0),this.listeners[N].splice(F,1),F>-1},R.trigger=function(N){var H=this.listeners[N];if(H)if(arguments.length===2)for(var F=H.length,M=0;M<F;++M)H[M].call(this,arguments[1]);else for(var $=Array.prototype.slice.call(arguments,1),D=H.length,B=0;B<D;++B)H[B].apply(this,$)},R.dispose=function(){this.listeners={}},R.pipe=function(N){this.on("data",function(H){N.push(H)})},A})();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function e(A){return A.subarray(0,A.byteLength-A[A.byteLength-1])}/*! @name aes-decrypter @version 4.0.2 @license Apache-2.0 */const t=function(){const A=[[[],[],[],[],[]],[[],[],[],[],[]]],R=A[0],O=A[1],N=R[4],H=O[4];let F,M,$;const D=[],B=[];let Y,he,ye,de,q,Z;for(F=0;F<256;F++)B[(D[F]=F<<1^(F>>7)*283)^F]=F;for(M=$=0;!N[M];M^=Y||1,$=B[$]||1)for(de=$^$<<1^$<<2^$<<3^$<<4,de=de>>8^de&255^99,N[M]=de,H[de]=M,ye=D[he=D[Y=D[M]]],Z=ye*16843009^he*65537^Y*257^M*16843008,q=D[de]*257^de*16843008,F=0;F<4;F++)R[F][M]=q=q<<24^q>>>8,O[F][de]=Z=Z<<24^Z>>>8;for(F=0;F<5;F++)R[F]=R[F].slice(0),O[F]=O[F].slice(0);return A};let i=null;class n{constructor(R){i||(i=t()),this._tables=[[i[0][0].slice(),i[0][1].slice(),i[0][2].slice(),i[0][3].slice(),i[0][4].slice()],[i[1][0].slice(),i[1][1].slice(),i[1][2].slice(),i[1][3].slice(),i[1][4].slice()]];let O,N,H;const F=this._tables[0][4],M=this._tables[1],$=R.length;let D=1;if($!==4&&$!==6&&$!==8)throw new Error("Invalid aes key size");const B=R.slice(0),Y=[];for(this._key=[B,Y],O=$;O<4*$+28;O++)H=B[O-1],(O%$===0||$===8&&O%$===4)&&(H=F[H>>>24]<<24^F[H>>16&255]<<16^F[H>>8&255]<<8^F[H&255],O%$===0&&(H=H<<8^H>>>24^D<<24,D=D<<1^(D>>7)*283)),B[O]=B[O-$]^H;for(N=0;O;N++,O--)H=B[N&3?O:O-4],O<=4||N<4?Y[N]=H:Y[N]=M[0][F[H>>>24]]^M[1][F[H>>16&255]]^M[2][F[H>>8&255]]^M[3][F[H&255]]}decrypt(R,O,N,H,F,M){const $=this._key[1];let D=R^$[0],B=H^$[1],Y=N^$[2],he=O^$[3],ye,de,q;const Z=$.length/4-2;let Ve,ct=4;const xt=this._tables[1],$t=xt[0],Ht=xt[1],Vt=xt[2],qt=xt[3],zt=xt[4];for(Ve=0;Ve<Z;Ve++)ye=$t[D>>>24]^Ht[B>>16&255]^Vt[Y>>8&255]^qt[he&255]^$[ct],de=$t[B>>>24]^Ht[Y>>16&255]^Vt[he>>8&255]^qt[D&255]^$[ct+1],q=$t[Y>>>24]^Ht[he>>16&255]^Vt[D>>8&255]^qt[B&255]^$[ct+2],he=$t[he>>>24]^Ht[D>>16&255]^Vt[B>>8&255]^qt[Y&255]^$[ct+3],ct+=4,D=ye,B=de,Y=q;for(Ve=0;Ve<4;Ve++)F[(3&-Ve)+M]=zt[D>>>24]<<24^zt[B>>16&255]<<16^zt[Y>>8&255]<<8^zt[he&255]^$[ct++],ye=D,D=B,B=Y,Y=he,he=ye}}class a extends s{constructor(){super(s),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(R){this.jobs.push(R),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const o=function(A){return A<<24|(A&65280)<<8|(A&16711680)>>8|A>>>24},u=function(A,R,O){const N=new Int32Array(A.buffer,A.byteOffset,A.byteLength>>2),H=new n(Array.prototype.slice.call(R)),F=new Uint8Array(A.byteLength),M=new Int32Array(F.buffer);let $,D,B,Y,he,ye,de,q,Z;for($=O[0],D=O[1],B=O[2],Y=O[3],Z=0;Z<N.length;Z+=4)he=o(N[Z]),ye=o(N[Z+1]),de=o(N[Z+2]),q=o(N[Z+3]),H.decrypt(he,ye,de,q,M,Z),M[Z]=o(M[Z]^$),M[Z+1]=o(M[Z+1]^D),M[Z+2]=o(M[Z+2]^B),M[Z+3]=o(M[Z+3]^Y),$=he,D=ye,B=de,Y=q;return F};class f{constructor(R,O,N,H){const F=f.STEP,M=new Int32Array(R.buffer),$=new Uint8Array(R.byteLength);let D=0;for(this.asyncStream_=new a,this.asyncStream_.push(this.decryptChunk_(M.subarray(D,D+F),O,N,$)),D=F;D<M.length;D+=F)N=new Uint32Array([o(M[D-4]),o(M[D-3]),o(M[D-2]),o(M[D-1])]),this.asyncStream_.push(this.decryptChunk_(M.subarray(D,D+F),O,N,$));this.asyncStream_.push(function(){H(null,e($))})}static get STEP(){return 32e3}decryptChunk_(R,O,N,H){return function(){const F=u(R,O,N);H.set(F,R.byteOffset)}}}var m=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof le.g!="undefined"?le.g:typeof self!="undefined"?self:{},g;typeof window!="undefined"?g=window:typeof m!="undefined"?g=m:typeof self!="undefined"?g=self:g={};var b=g,C=function(R){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(R):R&&R.buffer instanceof ArrayBuffer},k=b.BigInt||Number;k("0x1"),k("0x100"),k("0x10000"),k("0x1000000"),k("0x100000000"),k("0x10000000000"),k("0x1000000000000"),k("0x100000000000000"),k("0x10000000000000000"),(function(){var A=new Uint16Array([65484]),R=new Uint8Array(A.buffer,A.byteOffset,A.byteLength);return R[0]===255?"big":R[0]===204?"little":"unknown"})();const P=function(A){const R={};return Object.keys(A).forEach(O=>{const N=A[O];C(N)?R[O]={bytes:N.buffer,byteOffset:N.byteOffset,byteLength:N.byteLength}:R[O]=N}),R};self.onmessage=function(A){const R=A.data,O=new Uint8Array(R.encrypted.bytes,R.encrypted.byteOffset,R.encrypted.byteLength),N=new Uint32Array(R.key.bytes,R.key.byteOffset,R.key.byteLength/4),H=new Uint32Array(R.iv.bytes,R.iv.byteOffset,R.iv.byteLength/4);
206new f(O,N,H,function(F,M){self.postMessage(P({source:R.source,decrypted:M}),[M.buffer])})}}));var op=Kl(ap);const lp=s=>{let e=s.default?"main":"alternative";return s.characteristics&&s.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},Ch=(s,e)=>{s.abort(),s.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},qr=(s,e)=>{e.activePlaylistLoader=s,s.load()},hp=(s,e)=>()=>{const{segmentLoaders:{[s]:t,main:i},mediaTypes:{[s]:n}}=e,a=n.activeTrack(),o=n.getActiveGroup(),u=n.activePlaylistLoader,f=n.lastGroup_;if(!(o&&f&&o.id===f.id)&&(n.lastGroup_=o,n.lastTrack_=a,Ch(t,n),!(!o||o.isMainPlaylist))){if(!o.playlistLoader){u&&i.resetEverything();return}t.resyncLoader(),qr(o.playlistLoader,n)}},dp=(s,e)=>()=>{const{segmentLoaders:{[s]:t},mediaTypes:{[s]:i}}=e;i.lastGroup_=null,t.abort(),t.pause()},up=(s,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[s]:i,main:n},mediaTypes:{[s]:a}}=e,o=a.activeTrack(),u=a.getActiveGroup(),f=a.activePlaylistLoader,m=a.lastTrack_;if(!(m&&o&&m.id===o.id)&&(a.lastGroup_=u,a.lastTrack_=o,Ch(i,a),!!u)){if(u.isMainPlaylist){if(!o||!m||o.id===m.id)return;const g=e.vhs.playlistController_,b=g.selectPlaylist();if(g.media()===b)return;a.logger_(`track change. Switching main audio from ${m.id} to ${o.id}`),t.pause(),n.resetEverything(),g.fastQualityChange_(b);return}if(s==="AUDIO"){if(!u.playlistLoader){n.setAudio(!0),n.resetEverything();return}i.setAudio(!0),n.setAudio(!1)}if(f===u.playlistLoader){qr(u.playlistLoader,a);return}i.track&&i.track(o),i.resetEverything(),qr(u.playlistLoader,a)}},Xs={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:t},excludePlaylist:i}=e,n=t.activeTrack(),a=t.activeGroup(),o=(a.filter(f=>f.default)[0]||a[0]).id,u=t.tracks[o];if(n===u){i({error:{message:"Problem encountered loading the default audio track."}});return}E.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const f in t.tracks)t.tracks[f].enabled=t.tracks[f]===u;t.onTrackChanged()},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:t}}=e;E.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const i=t.activeTrack();i&&(i.mode="disabled"),t.onTrackChanged()}},Eh={AUDIO:(s,e,t)=>{if(!e)return;const{tech:i,requestOptions:n,segmentLoaders:{[s]:a}}=t;e.on("loadedmetadata",()=>{const o=e.media();a.playlist(o,n),(!i.paused()||o.endList&&i.preload()!=="none")&&a.load()}),e.on("loadedplaylist",()=>{a.playlist(e.media(),n),i.paused()||a.load()}),e.on("error",Xs[s](s,t))},SUBTITLES:(s,e,t)=>{const{tech:i,requestOptions:n,segmentLoaders:{[s]:a},mediaTypes:{[s]:o}}=t;e.on("loadedmetadata",()=>{const u=e.media();a.playlist(u,n),a.track(o.activeTrack()),(!i.paused()||u.endList&&i.preload()!=="none")&&a.load()}),e.on("loadedplaylist",()=>{a.playlist(e.media(),n),i.paused()||a.load()}),e.on("error",Xs[s](s,t))}},cp={AUDIO:(s,e)=>{const{vhs:t,sourceType:i,segmentLoaders:{[s]:n},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[s]:{groups:u,tracks:f,logger_:m}},mainPlaylistLoader:g}=e,b=Fi(g.main);(!o[s]||Object.keys(o[s]).length===0)&&(o[s]={main:{default:{default:!0}}},b&&(o[s].main.default.playlists=g.main.playlists));for(const C in o[s]){u[C]||(u[C]=[]);for(const k in o[s][C]){let P=o[s][C][k],A;if(b?(m(`AUDIO group '${C}' label '${k}' is a main playlist`),P.isMainPlaylist=!0,A=null):i==="vhs-json"&&P.playlists?A=new pi(P.playlists[0],t,a):P.resolvedUri?A=new pi(P.resolvedUri,t,a):P.playlists&&i==="dash"?A=new Rr(P.playlists[0],t,a,g):A=null,P=J({id:k,playlistLoader:A},P),Eh[s](s,P.playlistLoader,e),u[C].push(P),typeof f[k]=="undefined"){const R=new E.AudioTrack({id:k,kind:lp(P),enabled:!1,language:P.language,default:P.default,label:k});f[k]=R}}}n.on("error",Xs[s](s,e))},SUBTITLES:(s,e)=>{const{tech:t,vhs:i,sourceType:n,segmentLoaders:{[s]:a},requestOptions:o,main:{mediaGroups:u},mediaTypes:{[s]:{groups:f,tracks:m}},mainPlaylistLoader:g}=e;for(const b in u[s]){f[b]||(f[b]=[]);for(const C in u[s][b]){if(!i.options_.useForcedSubtitles&&u[s][b][C].forced)continue;let k=u[s][b][C],P;if(n==="hls")P=new pi(k.resolvedUri,i,o);else if(n==="dash"){if(!k.playlists.filter(R=>R.excludeUntil!==1/0).length)return;P=new Rr(k.playlists[0],i,o,g)}else n==="vhs-json"&&(P=new pi(k.playlists?k.playlists[0]:k.resolvedUri,i,o));if(k=J({id:C,playlistLoader:P},k),Eh[s](s,k.playlistLoader,e),f[b].push(k),typeof m[C]=="undefined"){const A=t.addRemoteTextTrack({id:C,kind:"subtitles",default:k.default&&k.autoselect,language:k.language,label:C},!1).track;m[C]=A}}}a.on("error",Xs[s](s,e))},"CLOSED-CAPTIONS":(s,e)=>{const{tech:t,main:{mediaGroups:i},mediaTypes:{[s]:{groups:n,tracks:a}}}=e;
206for(const o in i[s]){n[o]||(n[o]=[]);for(const u in i[s][o]){const f=i[s][o][u];if(!/^(?:CC|SERVICE)/.test(f.instreamId))continue;const m=t.options_.vhs&&t.options_.vhs.captionServices||{};let g={label:u,language:f.language,instreamId:f.instreamId,default:f.default&&f.autoselect};if(m[g.instreamId]&&(g=J(g,m[g.instreamId])),g.default===void 0&&delete g.default,n[o].push(J({id:u},f)),typeof a[u]=="undefined"){const b=t.addRemoteTextTrack({id:g.instreamId,kind:"captions",default:g.default,language:g.language,label:g.label},!1).track;a[u]=b}}}}},kh=(s,e)=>{for(let t=0;t<s.length;t++)if(Pr(e,s[t])||s[t].playlists&&kh(s[t].playlists,e))return!0;return!1},fp=(s,e)=>t=>{const{mainPlaylistLoader:i,mediaTypes:{[s]:{groups:n}}}=e,a=i.media();if(!a)return null;let o=null;a.attributes[s]&&(o=n[a.attributes[s]]);const u=Object.keys(n);if(!o)if(s==="AUDIO"&&u.length>1&&Fi(e.main))for(let f=0;f<u.length;f++){const m=n[u[f]];if(kh(m,a)){o=m;break}}else n.main?o=n.main:u.length===1&&(o=n[u[0]]);return typeof t=="undefined"?o:t===null||!o?null:o.filter(f=>f.id===t.id)[0]||null},pp={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:{tracks:t}}}=e;for(const i in t)if(t[i].enabled)return t[i];return null},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:{tracks:t}}}=e;for(const i in t)if(t[i].mode==="showing"||t[i].mode==="hidden")return t[i];return null}},mp=(s,{mediaTypes:e})=>()=>{const t=e[s].activeTrack();return t?e[s].activeGroup(t):null},gp=s=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(m=>{cp[m](m,s)});const{mediaTypes:e,mainPlaylistLoader:t,tech:i,vhs:n,segmentLoaders:{["AUDIO"]:a,main:o}}=s;["AUDIO","SUBTITLES"].forEach(m=>{e[m].activeGroup=fp(m,s),e[m].activeTrack=pp[m](m,s),e[m].onGroupChanged=hp(m,s),e[m].onGroupChanging=dp(m,s),e[m].onTrackChanged=up(m,s),e[m].getActiveGroup=mp(m,s)});const u=e.AUDIO.activeGroup();if(u){const m=(u.filter(b=>b.default)[0]||u[0]).id;e.AUDIO.tracks[m].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(o.setAudio(!1),a.setAudio(!0)):o.setAudio(!0)}t.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(m=>e[m].onGroupChanged())}),t.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(m=>e[m].onGroupChanging())});const f=()=>{e.AUDIO.onTrackChanged(),i.trigger({type:"usage",name:"vhs-audio-change"})};i.audioTracks().addEventListener("change",f),i.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),n.on("dispose",()=>{i.audioTracks().removeEventListener("change",f),i.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),i.clearTracks("audio");for(const m in e.AUDIO.tracks)i.audioTracks().addTrack(e.AUDIO.tracks[m])},_p=()=>{const s={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{s[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:dt,activeTrack:dt,getActiveGroup:dt,onGroupChanged:dt,onTrackChanged:dt,lastTrack_:null,logger_:He(`MediaGroups[${e}]`)}}),s};class wh{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=Ae(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(t=>[t.ID,t])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class yp extends E.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new wh,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=He("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const i=t.serverUri||t.serverURL;if(!i){this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`),this.trigger("error");return}if(i.startsWith("data:")){this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1));return}this.steeringManifest.reloadUri=Ae(e,i),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const i=e?t:this.getRequestURI(t);if(!i){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const n={contentSteeringInfo:{uri:i}};this.trigger({type:"contentsteeringloadstart",metadata:n}),this.request_=this.xhr_({uri:i,requestType:"content-steering-manifest"},(a,o)=>
206{if(a){if(o.status===410){this.logger_(`manifest request 410 ${a}.`),this.logger_(`There will be no more content steering requests to ${i} this session.`),this.excludedSteeringManifestURLs.add(i);return}if(o.status===429){const m=o.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${a}.`),this.logger_(`content steering will retry in ${m} seconds.`),this.startTTLTimeout_(parseInt(m,10));return}this.logger_(`manifest failed to load ${a}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:n});let u;try{u=JSON.parse(this.request_.responseText)}catch(m){const g={errorType:E.Error.StreamingContentSteeringParserError,error:m};this.trigger({type:"error",metadata:g})}this.assignSteeringProperties_(u);const f={contentSteeringInfo:n.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:f}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new(S()).URL(e),i=new(S()).URL(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){const t=JSON.parse(S().atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new(S()).URL(e),i=this.getPathway(),n=this.getBandwidth_();if(i){const a=`_${this.manifestType_}_pathway`;t.searchParams.set(a,i)}if(n){const a=`_${this.manifestType_}_throughput`;t.searchParams.set(a,n)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const i=(n=>{for(const a of n)if(this.availablePathways_.has(a))return a;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==i&&(this.currentPathway=i,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=n=>this.excludedSteeringManifestURLs.has(n);if(this.proxyServerUrl_){const n=this.setProxyServerUrl_(e);if(!t(n))return n}const i=this.setSteeringParams_(e);return t(i)?null:i}startTTLTimeout_(e=this.steeringManifest.ttl){const t=e*1e3;this.ttlTimeout_=S().setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){S().clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new wh}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(Ae(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const Tp=(s,e)=>{let t=null;return(...i)=>{clearTimeout(t),t=setTimeout(()=>{s.apply(null,i)},e)}},vp=10;let ut;const bp=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],Sp=function(s){return this.audioSegmentLoader_[s]+this.mainSegmentLoader_[s]},xp=function({currentPlaylist:s,buffered:e,currentTime:t,nextPlaylist:i,bufferLowWaterLine:n,bufferHighWaterLine:a,duration:o,bufferBasedABR:u,log:f}){if(!i)return E.log.warn("We received no playlist to switch to. Please check your stream."),!1;const m=`allowing switch ${s&&s.id||"null"} -> ${i.id}`;if(!s)return f(`${m} as current playlist is not set`),!0;if(i.id===s.id)return!1;const g=!!ui(e,t).length;if(!s.endList)return!g&&typeof s.partTargetDuration=="number"?(f(`not ${m} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(f(`${m} as current playlist is live`),!0);const b=Cr(e,t),C=u?_e.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:_e.MAX_BUFFER_LOW_WATER_LINE;if(o<C)return f(`${m} as duration < max low water line (${o} < ${C})`),!0;const k=i.attributes.BANDWIDTH,P=s.attributes.BANDWIDTH;if(k<P&&(!u||b<a)){let A=`${m}
206 as next bandwidth < current bandwidth (${k} < ${P})`;return u&&(A+=` and forwardBuffer < bufferHighWaterLine (${b} < ${a})`),f(A),!0}if((!u||k>P)&&b>=n){let A=`${m} as forwardBuffer >= bufferLowWaterLine (${b} >= ${n})`;return u&&(A+=` and next bandwidth > current bandwidth (${k} > ${P})`),f(A),!0}return f(`not ${m} as no switching criteria met`),!1};class Cp extends E.EventTarget{constructor(e){super(),this.fastQualityChange_=Tp(this.fastQualityChange_.bind(this),100);const{src:t,withCredentials:i,tech:n,bandwidth:a,externVhs:o,useCueTags:u,playlistExclusionDuration:f,enableLowInitialPlaylist:m,sourceType:g,cacheEncryptionKeys:b,bufferBasedABR:C,leastPixelDiffSelector:k,captionServices:P,experimentalUseMMS:A}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:R}=e;(R===null||typeof R=="undefined")&&(R=1/0),ut=o,this.bufferBasedABR=!!C,this.leastPixelDiffSelector=!!k,this.withCredentials=i,this.tech_=n,this.vhs_=n.vhs,this.player_=e.player_,this.sourceType_=g,this.useCueTags_=u,this.playlistExclusionDuration=f,this.maxPlaylistRetries=R,this.enableLowInitialPlaylist=m,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:R,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=_p(),A&&S().ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new(S()).ManagedMediaSource,this.usingManagedMediaSource_=!0,E.log("Using ManagedMediaSource")):S().MediaSource&&(this.mediaSource=new(S()).MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=ge(),this.hasPlayed_=!1,this.syncController_=new np(e),this.segmentMetadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new op,this.sourceUpdater_=new yh(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new rp,this.keyStatusMap_=new Map;const O={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:P,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:a,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:b,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new Rr(t,this.vhs_,J(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new pi(t,this.vhs_,J(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new $r(J(O,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new $r(J(O,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new Zf(J(O,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((F,M)=>{function $(){n.off("vttjserror",D),F()}function D(){n.off("vttjsloaded",$),M()}n.one("vttjsloaded",$),n.one("vttjserror",D),n.addWebVttScript_()})}),e);const N=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new yp(this.vhs_.xhr,N),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),bp.forEach(F=>{this[F+"_"]=Sp.bind(this,F)}),this.logger_=He("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const H=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(H,()=>{const F=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-F,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,i){const n=this.media(),a=n&&(n.id||n.uri),o=e&&(e.id||e.uri);if(a&&a!==o){this.logger_(`switch media ${a} -> ${o} from ${t}`);const u={renditionInfo:{id:o,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:u}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e
vendor: 5,617 bytes, line 206
206=>{const t=this.mediaTypes_[e],i=t?t.activeGroup():null,n=this.contentSteeringController_.getPathway();if(i&&n){const o=(i.length?i[0].playlists:i.playlists).filter(u=>u.attributes.serviceLocation===n);o.length&&this.mediaTypes_[e].activePlaylistLoader.media(o[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=S().setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(S().clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const i=e.mediaGroups.AUDIO,n=Object.keys(i);let a;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)a=this.mediaTypes_.AUDIO.activeTrack();else{const u=i.main||n.length&&i[n[0]];for(const f in u)if(u[f].default){a={label:f};break}}if(!a)return t;const o=[];for(const u in i)if(i[u][a.label]){const f=i[u][a.label];if(f.playlists&&f.playlists.length)o.push.apply(o,f.playlists);else if(f.uri)o.push(f);else if(e.playlists.length)for(let m=0;m<e.playlists.length;m++){const g=e.playlists[m];g.attributes&&g.attributes.AUDIO&&g.attributes.AUDIO===u&&o.push(g)}}return o.length?o:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const t=this.mainPlaylistLoader_.media(),i=t.targetDuration*1.5*1e3;Ir(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=i,t.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.mainSegmentLoader_.load()),gp({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),t),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let t=this.mainPlaylistLoader_.media();if(!t){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let i;if(this.enableLowInitialPlaylist&&(i=this.selectInitialPlaylist()),i||(i=this.selectPlaylist()),!i||!this.shouldSwitchToMedia_(i)||(this.initialMedia_=i,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;t=this.initialMedia_}this.handleUpdatedMediaPlaylist(t)}),this.mainPlaylistLoader_.on("error",()=>{const t=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:t.playlist,error:t})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const t=this.mainPlaylistLoader_.media(),i=t.targetDuration*1.5*1e3;Ir(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=i,this.sourceType_==="dash"&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const t=this.mainPlaylistLoader_.media();if(t.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(t)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(t=>{this.mainPlaylistLoader_.on(t,i=>{this.player_.trigger((0,Ce.A)({},i))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const i=e.mediaGroups||{};let n=!0;const a=Object.keys(i.AUDIO);for(const o in i.AUDIO)for(const u in i.AUDIO[o])i.AUDIO[o][u].uri||(n=!1);n&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),ut.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),a.length&&Object.keys(i.AUDIO[a[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pen
vendor: 2,979 bytes, line 206
206dingMedia_,i=this.tech_.currentTime(),n=this.bufferLowWaterLine(),a=this.bufferHighWaterLine(),o=this.tech_.buffered();return xp({buffered:o,currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:n,bufferHighWaterLine:a,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const i=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:i.playlist,error:i})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const i=this.audioSegmentLoader_.pendingSegment_;if(!i||!i.segment||!i.segment.syncInfo)return;const n=i.segment.syncInfo.end+.01;this.tech_.setCurrentTime(n)}),this.timelineChangeController_.on("fixBadTimelineChange",()=>{this.logger_("Fix bad timeline change. Restarting al segment loaders..."),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}),this.mainSegmentLoader_.on("earlyabort",i=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:vp}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const i=this.getCodecsOrExclude_();i&&this.sourceUpdater_.addOrChangeSourceBuffers(i)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>
206{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(i=>{this.mainSegmentLoader_.on(i,n=>{this.player_.trigger((0,Ce.A)({},n))}),this.audioSegmentLoader_.on(i,n=>{this.player_.trigger((0,Ce.A)({},n))}),this.subtitleSegmentLoader_.on(i,n=>{this.player_.trigger((0,Ce.A)({},n))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0))return this.tech_.setCurrentTime(e.end(e.length-1))}setupFirstPlay(){const e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){const t=this.seekable();if(!t.length)return!1;const i=t.end(0);let n=i;if(e.start){const a=e.start.timeOffset;if(a<0){const o=this.mainPlaylistLoader_.main,u=ut.Playlist.liveEdgeDelay(o,e),f=i+u;n=Math.max(Math.min(f+a,i),t.start(0))}else n=Math.min(i,a)}this.trigger("firstplay"),this.tech_.setCurrentTime(n)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();typeof e!="undefined"&&typeof e.then=="function"&&e.then(null,t=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();!t||t.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const i=this.syncController_.getExpiredTime(e,this.duration());if(i===null)return!1;const n=ut.Playlist.playlistEnd(e,i),a=this.tech_.currentTime(),o=this.tech_.buffered();if(!o.length)return n-a<=st;const u=o.end(o.length-1);return u-a<=st&&n-u<=st}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:i}){if(e=e||this.mainPlaylistLoader_.media(),i=i||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const n=this.mainPlaylistLoader_.main.playlists,a=n.filter(Gs),o=a.length===1&&a[0]===e;if(n.length===1&&i!==1/0)return E.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(o);if(o){if(this.main().contentSteering){const P=this.pathwayAttribute_(e),A=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(P),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(P)},A);return}let k=!1;
206n.forEach(P=>{if(P===e)return;const A=P.excludeUntil;typeof A!="undefined"&&A!==1/0&&(k=!0,delete P.excludeUntil)}),k&&(E.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let u;e.playlistErrors_>this.maxPlaylistRetries?u=1/0:u=Date.now()+i*1e3,e.excludeUntil=u,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const f=this.selectPlaylist();if(!f){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const m=t.internal?this.logger_:E.log.warn,g=t.message?" "+t.message:"";m(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${g} Switching to playlist ${f.id}.`),f.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),f.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const b=f.targetDuration/2*1e3||5*1e3,C=typeof f.lastRequest=="number"&&Date.now()-f.lastRequest<=b;return this.switchMedia_(f,"exclude",o||C)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const i=[],n=e==="all";(n||e==="main")&&i.push(this.mainPlaylistLoader_);const a=[];(n||e==="audio")&&a.push("AUDIO"),(n||e==="subtitle")&&(a.push("CLOSED-CAPTIONS"),a.push("SUBTITLES")),a.forEach(o=>{const u=this.mediaTypes_[o]&&this.mediaTypes_[o].activePlaylistLoader;u&&i.push(u)}),["main","audio","subtitle"].forEach(o=>{const u=this[`${o}SegmentLoader_`];u&&(e===o||e==="all")&&i.push(u)}),i.forEach(o=>t.forEach(u=>{typeof o[u]=="function"&&o[u]()}))}setCurrentTime(e){const t=ui(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(t&&t.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:ut.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,t){const i=e.media();if(!i)return null;const n=this.syncController_.getMediaSequenceSync(t);if(n&&n.isReliable){const u=n.start,f=n.end;if(!isFinite(u)||!isFinite(f))return null;const m=ut.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i),g=Math.max(u,f-m);return ge([[u,g]])}const a=this.syncController_.getExpiredTime(i,this.duration());if(a===null)return null;const o=ut.Playlist.seekable(i,a,ut.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i));return o.length?o:null}computeFinalSeekable_(e,t){if(!t)return e;const i=e.start(0),n=e.end(0),a=t.start(0),o=t.end(0);return a>n||i>o?e:ge([[Math.max(i,a),Math.min(n,o)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;const e=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!e)return;let t;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!t))return;const i=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(e,t),!this.seekable_||i&&i.length&&this.seekable_.length&&i.start(0)===this.seekable_.start(0)&&i.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${gl(this.seekable_)}]`);const n={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:n}),this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){const n=this.seekable();if(!n.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<n.end(n.length-1))&&this.sourceUpdater_.setDuration(n.end(n.length-1));return}const t=this.tech_.buffered();let i=ut.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(i=Math.max(i,t.end(t.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e
206=>{const t=this.mediaTypes_[e].groups;for(const i in t)t[i].forEach(n=>{n.playlistLoader&&n.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!t||!i)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const i=ji(this.main(),t),n={},a=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(n.video=i.video||e.main.videoCodec||se.dv),e.main.isMuxed&&(n.video+=`,${i.audio||e.main.audioCodec||se.Yg}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||a)&&(n.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||se.Yg,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!n.audio&&!n.video){this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const o=(m,g)=>m?(0,se.TY)(g,this.usingManagedMediaSource_):(0,se.YZ)(g),u={};let f;if(["video","audio"].forEach(function(m){if(n.hasOwnProperty(m)&&!o(e[m].isFmp4,n[m])){const g=e[m].isFmp4?"browser":"muxer";u[g]=u[g]||[],u[g].push(n[m]),m==="audio"&&(f=g)}}),a&&f&&t.attributes.AUDIO){const m=t.attributes.AUDIO;
206this.main().playlists.forEach(g=>{(g.attributes&&g.attributes.AUDIO)===m&&g!==t&&(g.excludeUntil=1/0)}),this.logger_(`excluding audio group ${m} as ${f} does not support codec(s): "${n.audio}"`)}if(Object.keys(u).length){const m=Object.keys(u).reduce((g,b)=>(g&&(g+=", "),g+=`${b} does not support codec(s): "${u[b].join(",")}"`,g),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:m},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const m=[];if(["video","audio"].forEach(g=>{const b=((0,se.tB)(this.sourceUpdater_.codecs[g]||"")[0]||{}).type,C=((0,se.tB)(n[g]||"")[0]||{}).type;b&&C&&b.toLowerCase()!==C.toLowerCase()&&m.push(`"${this.sourceUpdater_.codecs[g]}" -> "${n[g]}"`)}),m.length){this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${m.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return n}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(i=>{const n=e[i];if(t.indexOf(n.id)!==-1)return;t.push(n.id);const a=ji(this.main,n),o=[];a.audio&&!(0,se.YZ)(a.audio)&&!(0,se.TY)(a.audio,this.usingManagedMediaSource_)&&o.push(`audio codec ${a.audio}`),a.video&&!(0,se.YZ)(a.video)&&!(0,se.TY)(a.video,this.usingManagedMediaSource_)&&o.push(`video codec ${a.video}`),a.text&&a.text==="stpp.ttml.im1t"&&o.push(`text codec ${a.text}`),o.length&&(n.excludeUntil=1/0,this.logger_(`excluding ${n.id} for unsupported: ${o.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],i=this.main().playlists,n=Ni((0,se.tB)(e)),a=Ml(n),o=n.video&&(0,se.tB)(n.video)[0]||null,u=n.audio&&(0,se.tB)(n.audio)[0]||null;
206Object.keys(i).forEach(f=>{const m=i[f];if(t.indexOf(m.id)!==-1||m.excludeUntil===1/0)return;t.push(m.id);const g=[],b=ji(this.mainPlaylistLoader_.main,m),C=Ml(b);if(!(!b.audio&&!b.video)){if(C!==a&&g.push(`codec count "${C}" !== "${a}"`),!this.sourceUpdater_.canChangeType()){const k=b.video&&(0,se.tB)(b.video)[0]||null,P=b.audio&&(0,se.tB)(b.audio)[0]||null;k&&o&&k.type.toLowerCase()!==o.type.toLowerCase()&&g.push(`video codec "${k.type}" !== "${o.type}"`),P&&u&&P.type.toLowerCase()!==u.type.toLowerCase()&&g.push(`audio codec "${P.type}" !== "${u.type}"`)}g.length&&(m.excludeUntil=1/0,this.logger_(`excluding ${m.id}: ${g.join(" && ")}`))}})}updateAdCues_(e){let t=0;const i=this.seekable();i.length&&(t=i.start(0)),tp(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=_e.GOAL_BUFFER_LENGTH,i=_e.GOAL_BUFFER_LENGTH_RATE,n=Math.max(t,_e.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,n)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=_e.BUFFER_LOW_WATER_LINE,i=_e.BUFFER_LOW_WATER_LINE_RATE,n=Math.max(t,_e.MAX_BUFFER_LOW_WATER_LINE),a=Math.max(t,_e.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?a:n)}bufferHighWaterLine(){return _e.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){uh(this.inbandTextTracks_,"com.apple.streaming",this.tech_),Mf({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){const n=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();uh(this.inbandTextTracks_,e,this.tech_),Lf({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:n,videoDuration:i})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(t=>{this.contentSteeringController_.on(t,i=>{this.trigger((0,Ce.A)({},i))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const t=this.main();(this.contentSteeringController_.didDASHTagChange(t.uri,t.contentSteering)||(()=>{const a=this.contentSteeringController_.getAvailablePathways(),o=[];for(const u of t.playlists){const f=u.attributes.serviceLocation;if(f&&(o.push(f),!a.has(f)))return!0}return!!(!o.length&&a.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const i=this.main().playlists,n=new Set;let a=!1;
206Object.keys(i).forEach(o=>{const u=i[o],f=this.pathwayAttribute_(u),m=f&&e!==f;u.excludeUntil===1/0&&u.lastExcludeReason_==="content-steering"&&!m&&(delete u.excludeUntil,delete u.lastExcludeReason_,a=!0);const b=!u.excludeUntil&&u.excludeUntil!==1/0;!n.has(u.id)&&m&&b&&(n.add(u.id),u.excludeUntil=1/0,u.lastExcludeReason_="content-steering",this.logger_(`excluding ${u.id} for ${u.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(o=>{const u=this.mediaTypes_[o];if(u.activePlaylistLoader){const f=u.activePlaylistLoader.media_;f&&f.attributes.serviceLocation!==e&&(a=!0)}}),a&&this.changeSegmentPathway_()}handlePathwayClones_(){const t=this.main().playlists,i=this.contentSteeringController_.currentPathwayClones,n=this.contentSteeringController_.nextPathwayClones;if(i&&i.size||n&&n.size){for(const[o,u]of i.entries())n.get(o)||(this.mainPlaylistLoader_.updateOrDeleteClone(u),this.contentSteeringController_.excludePathway(o));for(const[o,u]of n.entries()){const f=i.get(o);if(!f){t.filter(g=>
vendor: 1,039 bytes, line 206
206g.attributes["PATHWAY-ID"]===u["BASE-ID"]).forEach(g=>{this.mainPlaylistLoader_.addClonePathway(u,g)}),this.contentSteeringController_.addAvailablePathway(o);continue}this.equalPathwayClones_(f,u)||(this.mainPlaylistLoader_.updateOrDeleteClone(u,!0),this.contentSteeringController_.addAvailablePathway(o))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...n])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const i=e["URI-REPLACEMENT"].PARAMS,n=t["URI-REPLACEMENT"].PARAMS;for(const a in i)if(i[a]!==n[a])return!1;for(const a in n)if(i[a]!==n[a])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";
206this.mainPlaylistLoader_.main.playlists.forEach(i=>{const n=this.mainPlaylistLoader_.getKeyIdSet(i);!n||!n.size||n.forEach(a=>{const o="usable",u=this.keyStatusMap_.has(a)&&this.keyStatusMap_.get(a)===o,f=i.lastExcludeReason_===t&&i.excludeUntil===1/0;u?u&&f&&(delete i.excludeUntil,delete i.lastExcludeReason_,this.logger_(`enabling playlist ${i.id} because key ID ${a} is ${o}`)):(i.excludeUntil!==1/0&&i.lastExcludeReason_!==t&&(i.excludeUntil=1/0,i.lastExcludeReason_=t,this.logger_(`excluding playlist ${i.id} because the key ID ${a} doesn't exist in the keyStatusMap or is not ${o}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(i=>{const n=i&&i.attributes&&i.attributes.RESOLUTION&&i.attributes.RESOLUTION.height<720,a=i.excludeUntil===1/0&&i.lastExcludeReason_===t;n&&a&&(delete i.excludeUntil,E.log.warn(`enabling non-HD playlist ${i.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const a=(typeof e=="string"?e:Xf(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${a} added to the keyStatusMap`),this.keyStatusMap_.set(a,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const Ep=(s,e,t)=>i=>{const n=s.main.playlists[e],a=wr(n),o=Gs(n);if(typeof i=="undefined")return o;i?delete n.disabled:n.disabled=!0;const u={renditionInfo:{id:e,bandwidth:n.attributes.BANDWIDTH,resolution:n.attributes.RESOLUTION,codecs:n.attributes.CODECS},cause:"fast-quality"};return i!==o&&!a&&(i?(t(n),s.trigger({type:"renditionenabled",metadata:u})):s.trigger({type:"renditiondisabled",metadata:u})),i};class kp{constructor(e,t,i){const{playlistController_:n}=e,a=n.fastQualityChange_.bind(n);if(t.attributes){const o=t.attributes.RESOLUTION;this.width=o&&o.width,this.height=o&&o.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=ji(n.main(),t),this.playlist=t,this.id=i,this.enabled=Ep(e.playlists,t.id,a)}}const wp=function(s){s.representations=()=>{const e=s.playlistController_.main(),t=Fi(e)?s.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(i=>!wr(i)).map((i,n)=>new kp(s,i,i.id)):[]}},Ih=["seeking","seeked","pause","playing","error"];class Ip extends E.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=He("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),n=()=>this.techWaiting_(),a=()=>this.resetTimeUpdate_(),o=this.playlistController_,u=["main","subtitle","audio"],f={};u.forEach(g=>{f[g]={reset:()=>this.resetSegmentDownloads_(g),updateend:()=>this.checkSegmentDownloads_(g)},o[`${g}SegmentLoader_`].on("appendsdone",f[g].updateend),o[`${g}SegmentLoader_`].on("playlistupdate",f[g].reset),this.tech_.on(["seeked","seeking"],f[g].reset)});const m=g=>{["main","audio"].forEach(b=>{o[`${b}SegmentLoader_`][g]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),m("off"))},this.clearSeekingAppendCheck_=()=>m("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),m("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",n),this.tech_.on(Ih,a),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",n),this.tech_.off(Ih,a),this.tech_.off("canplay",i),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),u.forEach(g=>{o[`${g}SegmentLoader_`].off("appendsdone",f[g].updateend),o[`${g}SegmentLoader_`].off("playlistupdate",f[g].reset),this.tech_.off(["seeked","seeking"],f[g].reset)}),this.checkCurrentTimeTimeout_&&S().clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&S().clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=S().setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,i=t[`${e}SegmentLoader_`],n=i.buffered_(),a=mc(this[`${e}Buffered_`],n);if(this[`${e}Buffered_`]=n,a){const o={bufferedRanges:n};t.trigger({type:"bufferedrangeschanged",metadata:o}),this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:Ft(n)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+st>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(ge([this.lastRecordedTime,e]));const i={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:i}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const t=this.seekable(),i=this.tech_.currentTime(),n=this.afterSeekableWindow_(t,
206i,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let a;if(n&&(a=t.end(t.length-1)),this.beforeSeekableWindow_(t,i)){const P=t.start(0);a=P+(P===t.end(0)?0:st)}if(typeof a!="undefined")return this.logger_(`Trying to seek outside of seekable at time ${i} with seekable range ${gl(t)}. Seeking to ${a}.`),this.tech_.setCurrentTime(a),!0;const o=this.playlistController_.sourceUpdater_,u=this.tech_.buffered(),f=o.audioBuffer?o.audioBuffered():null,m=o.videoBuffer?o.videoBuffered():null,g=this.media(),b=g.partTargetDuration?g.partTargetDuration:(g.targetDuration-it)*2,C=[f,m];for(let P=0;P<C.length;P++){if(!C[P])continue;if(Cr(C[P],i)<b)return!1}const k=Ws(u,i);return k.length===0?!1:(a=k.start(0)+st,this.logger_(`Buffered region starts (${k.start(0)})  just beyond seek point (${i}). Seeking to ${a}.`),this.tech_.setCurrentTime(a),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),i=ui(t,e);if(i.length&&e+3<=i.end(0)){this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${i.start(0)} -> ${i.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const u=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${u}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(u),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const i=this.tech_.vhs.playlistController_.sourceUpdater_,n=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const o=Ws(n,t);return o.length>0?(this.logger_(`Stopped at ${t} and seeking to ${o.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0):!1}afterSeekableWindow_(e,t,i,n=!1){if(!e.length)return!1;let a=e.end(e.length-1)+st;const o=!i.endList,u=typeof i.partTargetDuration=="number";return o&&(u||n)&&(a=e.end(e.length-1)+i.targetDuration*3),t>a}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:i}){if(!e)return;let n;if(e.length&&t.length){const a=ui(e,i-3),o=ui(e,i),u=ui(t,i);u.length&&!o.length&&a.length&&(n={start:a.end(0),end:u.end(0)})}else Ws(e,i).length||(n=this.gapFromVideoUnderflow_(e,i));return n?(this.logger_(`Encountered a gap in video from ${n.start} to ${n.end}. Seeking to current time ${i}`),!0):!1}skipTheGap_(e){const t=this.tech_.buffered(),i=this.tech_.currentTime(),n=Ws(t,i);if(this.resetTimeUpdate_(),n.length===0||i!==e)return;this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",n.start(0)),this.tech_.setCurrentTime(n.start(0)+it);const a={gapInfo:{from:i,to:n.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:a}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(e,t){const i=cc(e);for(let n=0;n<i.length;n++){const a=i.start(n),o=i.end(n);if(t-a<4&&t-a>2)return{start:a,end:o}}return null}}const Pp={errorInterval:30,getSource(s){const t=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return s(t)}},Ph=function(s,e){let t=0,i=0;const n=J(Pp,e);s.ready(()=>{s.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const a=function(){i&&s.currentTime(i)},o=function(g){g!=null&&(i=s.duration()!==1/0&&s.currentTime()||0,s.one("loadedmetadata",a),s.src(g),s.trigger({type:"usage",name:"vhs-error-reload"}),s.play())},u=function(){if(Date.now()-t<n.errorInterval*1e3){s.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!n.getSource||typeof n.getSource!="function"){E.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return t=Date.now(),n.getSource.call(s,o)},f=function(){s.off("loadedmetadata",a),s.off("error",u),s.off("dispose",f)},m=function(g){f(),Ph(s,g)};s.on("error",u),s.on("dispose",f),s.reloadSourceOnError=m},Ap=function(s){Ph(this,s)};var Ah="3.17.5",Lp="7.1.0",Dp="1.4.0",Op="7.2.0",Mp="4.0.2";const fe={PlaylistLoader:pi,Playlist:Le,utils:Nc,STANDARD_PLAYLIST_SELECTOR:hh,INITIAL_PLAYLIST_SELECTOR:kf,lastBandwidthSelector:hh,movingAverageBandwidthSelector:Cf,comparePlaylistBandwidth:Nr,comparePlaylistResolution:xf,xhr:Nl()};Object.keys(_e).forEach(s=>{Object.defineProperty(fe,s,{get(){return E.log.warn(`using Vhs.${s}
206 is UNSAFE be sure you know what you are doing`),_e[s]},set(e){if(E.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){E.log.warn(`value of Vhs.${s} must be greater than or equal to 0`);return}_e[s]=e}})});const Lh="videojs-vhs",Dh=function(s,e){const t=e.media();let i=-1;for(let n=0;n<s.length;n++)if(s[n].id===t.id){i=n;break}s.selectedIndex_=i,s.trigger({selectedIndex:i,type:"change"})},Rp=function(s,e){e.representations().forEach(t=>{s.addQualityLevel(t)}),Dh(s,e.playlists)};fe.canPlaySource=function(){return E.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const Up=(s,e,t)=>{if(!s)return s;let i={};e&&e.attributes&&e.attributes.CODECS&&(i=Ni((0,se.tB)(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(i.audio=t.attributes.CODECS);const n=(0,se.UD)(i.video),a=(0,se.UD)(i.audio),o={};for(const u in s)o[u]={},a&&(o[u].audioContentType=a),n&&(o[u].videoContentType=n),e.contentProtection&&e.contentProtection[u]&&e.contentProtection[u].pssh&&(o[u].pssh=e.contentProtection[u].pssh),typeof s[u]=="string"&&(o[u].url=s[u]);return J(s,o)},Bp=(s,e)=>s.reduce((t,i)=>{if(!i.contentProtection)return t;const n=e.reduce((a,o)=>{const u=i.contentProtection[o];return u&&u.pssh&&(a[o]={pssh:u.pssh}),a},{});return Object.keys(n).length&&t.push(n),t},[]),Fp=({player:s,sourceKeySystems:e,audioMedia:t,mainPlaylists:i})=>{if(!s.eme.initializeMediaKeys)return Promise.resolve();const n=t?i.concat([t]):i,a=Bp(n,Object.keys(e)),o=[],u=[];return a.forEach(f=>{u.push(new Promise((m,g)=>{s.tech_.one("keysessioncreated",m)})),o.push(new Promise((m,g)=>{s.eme.initializeMediaKeys({keySystems:f},b=>{if(b){g(b);return}m()})}))}),Promise.race([Promise.all(o),Promise.race(u)])},Np=({player:s,sourceKeySystems:e,media:t,audioMedia:i})=>{const n=Up(e,t,i);return n?(s.currentSource().keySystems=n,n&&!s.eme?(E.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},Oh=()=>{if(!S().localStorage)return null;const s=S().localStorage.getItem(Lh);if(!s)return null;try{return JSON.parse(s)}catch(e){return null}},jp=s=>{if(!S().localStorage)return!1;let e=Oh();e=e?J(e,s):s;try{S().localStorage.setItem(Lh,JSON.stringify(e))}catch(t){return!1}return e},$p=s=>s.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(s.substring(s.indexOf(",")+1)):s,Mh=(s,e)=>{s._requestCallbackSet||(s._requestCallbackSet=new Set),s._requestCallbackSet.add(e)},Rh=(s,e)=>{s._responseCallbackSet||(s._responseCallbackSet=new Set),s._responseCallbackSet.add(e)},Uh=(s,e)=>{s._requestCallbackSet&&(s._requestCallbackSet.delete(e),s._requestCallbackSet.size||delete s._requestCallbackSet)},Bh=(s,e)=>{s._responseCallbackSet&&(s._responseCallbackSet.delete(e),s._responseCallbackSet.size||delete s._responseCallbackSet)};fe.supportsNativeHls=(function(){if(!U()||!U().createElement)return!1;const s=U().createElement("video");return E.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(t){return/maybe|probably/i.test(s.canPlayType(t))}):!1}
206)(),fe.supportsNativeDash=(function(){return!U()||!U().createElement||!E.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(U().createElement("video").canPlayType("application/dash+xml"))})(),fe.supportsTypeNatively=s=>s==="hls"?fe.supportsNativeHls:s==="dash"?fe.supportsNativeDash:!1,fe.isSupported=function(){return E.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},fe.xhr.onRequest=function(s){Mh(fe.xhr,s)},fe.xhr.onResponse=function(s){Rh(fe.xhr,s)},fe.xhr.offRequest=function(s){Uh(fe.xhr,s)},fe.xhr.offResponse=function(s){Bh(fe.xhr,s)};const Hp=E.getComponent("Component");class Fh extends Hp{constructor(e,t,i){if(super(t,i.vhs),typeof i.initialBandwidth=="number"&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=He("VhsHandler"),t.options_&&t.options_.playerId){const n=E.getPlayer(t.options_.playerId);this.player_=n}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(U(),["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],n=>{const a=U().fullscreenElement||U().webkitFullscreenElement||U().mozFullScreenElement||U().msFullscreenElement;a&&a.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=J(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage!="undefined"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=typeof this.options_.useNetworkInformationApi!="undefined"?this.options_.useNetworkInformationApi:!0,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const i=Oh();i&&i.bandwidth&&(this.options_.bandwidth=i.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),i&&i.throughput&&(this.options_.throughput=i.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=_e.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===_e.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","usePlayerObjectFit","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(i=>
206{typeof this.source_[i]!="undefined"&&(this.options_[i]=this.source_[i])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;const t=this.options_.customPixelRatio;typeof t=="number"&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=$p(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=fe,this.options_.sourceType=(0,ba.I)(t),this.options_.seekTo=a=>{this.tech_.setCurrentTime(a)},this.options_.player_=this.player_,this.playlistController_=new Cp(this.options_);const i=J({liveRangeSafeTimeDelta:st},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new Ip(i),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const a=E.players[this.tech_.options_.playerId];let o=this.playlistController_.error;typeof o=="object"&&!o.code?o.code=3:typeof o=="string"&&(o={message:o,code:3}),a.error(o)});const n=this.options_.bufferBasedABR?fe.movingAverageBandwidthSelector(.55):fe.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):n.bind(this),this.playlistController_.selectInitialPlaylist=fe.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(a){this.playlistController_.selectPlaylist=a.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(a){this.playlistController_.mainSegmentLoader_.throughput.rate=a,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let a=this.playlistController_.mainSegmentLoader_.bandwidth;const o=S().navigator.connection||S().navigator.mozConnection||S().navigator.webkitConnection,u=1e7;if(this.options_.useNetworkInformationApi&&o){const f=o.downlink*1e3*1e3;f>=u&&a>=u?a=Math.max(a,f):a=f}return a},set(a){this.playlistController_.mainSegmentLoader_.bandwidth=a,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const a=1/(this.bandwidth||1);let o;return this.throughput>0?o=1/this.throughput:o=0,Math.floor(1/(a+o))},set(){E.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Ft(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>Ft(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&jp({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{wp(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=S().URL.createObjectURL(this.playlistController_.mediaSource),(E.browser.IS_ANY_SAFARI||E.browser.IS_IOS)&&this.options_.overrideNative&&this.options_.sourceType==="hls"&&typeof this.tech_.addSourceElement=="function"?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),Fp({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(t=>{this.logger_("error while creating EME key session",t),this.player_.error({message:"Failed to initialize media ke
206ys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=Np({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",i=>{this.playlistController_.updatePlaylistByKeyStatus(i.keyId,i.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=E.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{Rp(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{Dh(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":Ah,"mux.js":Lp,"mpd-parser":Dp,"m3u8-parser":Op,"aes-decrypter":Mp}}version(){return this.constructor.version()}canChangeType(){return yh.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&S().URL.revokeObjectURL&&(S().URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return Wc({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,n=2){return ql({programTime:e,playlist:this.playlistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{Mh(this.xhr,e)},this.xhr.onResponse=e=>{Rh(this.xhr,e)},this.xhr.offRequest=e=>{Uh(this.xhr,e)},this.xhr.offResponse=e=>{Bh(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],t=["gapjumped","playedrangeschanged"];e.forEach(i=>{this.playlistController_.on(i,n=>{this.player_.trigger((0,Ce.A)({},n))})}),t.forEach(i=>{this.playbackWatcher_.on(i,n=>{this.player_.trigger((0,Ce.A)({},n))})})}}const Js={name:"videojs-http-streaming",VERSION:Ah,canHandleSource(s,e={}){const t=J(E.options,e);return!t.vhs.experimentalUseMMS&&!(0,se.TY)("avc1.4d400d,mp4a.40.2",!1)?!1:Js.canPlayType(s.type,t)},handleSource(s,e,t={}){const i=J(E.options,t);return e.vhs=new Fh(s,e,i),e.vhs.xhr=Nl(),e.vhs.setupXhrHooks_(),e.vhs.src(s.src,s.type),e.vhs},canPlayType(s,e){const t=(0,ba.I)(s);if(!t)return"";const i=Js.getOverrideNative(e);return!fe.supportsTypeNatively(t)||i?"maybe":""},getOverrideNative(s={}){const{vhs:e={}}=s,t=!(E.browser.IS_ANY_SAFARI||E.browser.IS_IOS),{overrideNative:i=t}=e;return i}};(0,se.TY)("avc1.4d400d,mp4a.40.2",!0)&&E.getTech("Html5").registerSourceHandler(Js,0),E.VhsHandler=Fh,E.VhsSourceHandler=Js,E.Vhs=fe,E.use||E.registerComponent("Vhs",fe),E.options.vhs=E.options.vhs||{},(!E.getPlugin||!E.getPlugin("reloadSourceOnError"))&&E.registerPlugin("reloadSourceOnError",Ap);/*! @name videojs-overlay @version 3.1.0 @license Apache-2.0 */var Vp="3.1.0";const qp={align:"top-left",class:"",content:"This overlay will show up while the video is playing",debug:!1,showBackground:!0,attachToControlBar:!1,overlays:[{start:"playing",end:"paused"}]},zp=E.getComponent("Component"),Nh=E.dom||E,Wp=E.registerPlugin||E.plugin,Vi=s=>typeof s=="number"&&s===s,jh=s=>typeof s=="string"&&/^\S+$/.test(s);class zr extends zp{constructor(e,t){super(e,t),["start","end"].forEach(i=>
206{const n=this.options_[i];if(Vi(n))this[i+"Event_"]="timeupdate";else if(jh(n))this[i+"Event_"]=n;else if(i==="start")throw new Error('invalid "start" option; expected number or string')}),["endListener_","rewindListener_","startListener_"].forEach(i=>{this[i]=n=>zr.prototype[i].call(this,n)}),this.startEvent_==="timeupdate"&&this.on(e,"timeupdate",this.rewindListener_),this.debug(`created, listening to "${this.startEvent_}" for "start" and "${this.endEvent_||"nothing"}" for "end"`),this.hide()}createEl(){const e=this.options_,t=e.content,i=e.showBackground?"vjs-overlay-background":"vjs-overlay-no-background",n=Nh.createEl("div",{className:`
207        vjs-overlay
208        vjs-overlay-${e.align}
209        ${e.class}
210        ${i}
211        vjs-hidden
212      `});return typeof t=="string"?n.innerHTML=t:t instanceof S().DocumentFragment?n.appendChild(t):Nh.appendContent(n,t),n}debug(...e){if(!this.options_.debug)return;const t=E.log;let i=t;t.hasOwnProperty(e[0])&&typeof t[e[0]]=="function"&&(i=t[e.shift()]),i(`overlay#${this.id()}: `,...e)}hide(){return super.hide(),this.debug("hidden"),this.debug(`bound \`startListener_\` to "${this.startEvent_}"`),this.endEvent_&&(this.debug(`unbound \`endListener_\` from "${this.endEvent_}"`),this.off(this.player(),this.endEvent_,this.endListener_)),this.on(this.player(),this.startEvent_,this.startListener_),this}shouldHide_(e,t){const i=this.options_.end;return Vi(i)?e>=i:i===t}show(){return super.show(),this.off(this.player(),this.startEvent_,this.startListener_),this.debug("shown"),this.debug(`unbound \`startListener_\` from "${this.startEvent_}"`),this.endEvent_&&(this.debug(`bound \`endListener_\` to "${this.endEvent_}"`),this.on(this.player(),this.endEvent_,this.endListener_)),this}shouldShow_(e,t){const i=this.options_.start,n=this.options_.end;return Vi(i)?Vi(n)?e>=i&&e<n:this.hasShownSinceSeek_?Math.floor(e)===i:(this.hasShownSinceSeek_=!0,e>=i):i===t}startListener_(e){const t=this.player().currentTime();this.shouldShow_(t,e.type)&&this.show()}endListener_(e){const t=this.player().currentTime();this.shouldHide_(t,e.type)&&this.hide()}rewindListener_(e){const t=this.player().currentTime(),i=this.previousTime_,n=this.options_.start,a=this.options_.end;t<i&&(this.debug("rewind detected"),Vi(a)&&!this.shouldShow_(t)?(this.debug(`hiding; ${a} is an integer and overlay should not show at this time`),this.hasShownSinceSeek_=!1,this.hide()):jh(a)&&t<n&&(this.debug(`hiding; show point (${n}) is before now (${t}) and end point (${a}) is an event`),this.hasShownSinceSeek_=!1,this.hide())),this.previousTime_=t}}E.registerComponent("Overlay",zr);const $h=function(s){const e=this,t=E.mergeOptions(qp,s);Array.isArray(this.overlays_)&&this.overlays_.forEach(f=>{this.removeChild(f),this.controlBar&&this.controlBar.removeChild(f),f.dispose()});const i=t.overlays;delete t.overlays;const n=f=>f.map(m=>{const g=E.mergeOptions(t,m),b=typeof g.attachToControlBar=="string"||g.attachToControlBar===!0;if(!this.controls()||!this.controlBar)return this.addChild("overlay",g);if(b&&g.align.indexOf("bottom")!==-1){let k=this.controlBar.children()[0];if(this.controlBar.getChild(g.attachToControlBar)!==void 0&&(k=this.controlBar.getChild(g.attachToControlBar)),k){const P=this.controlBar.children().indexOf(k);return this.controlBar.addChild("overlay",g,P)}}const C=this.addChild("overlay",g);return this.el().insertBefore(C.el(),this.controlBar.el()),C});this.overlays_=n(i);function a(f){Array.isArray(f)||(f=[f]);const m=n(f);return e.overlays_=e.overlays_.concat(m),m}function o(f){const m=e.overlays_.indexOf(f);m!==-1?(f.el().parentNode.removeChild(f.el()),e.overlays_.splice(m,1)):e.log.warn("overlay does not exist and cannot be removed")}function u(){return e.overlays_}return{add:a,remove:o,get:u}};$h.VERSION=Vp,Wp("overlay",$h)}}]);})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.