lcny-vue3-antd-admin/dist/assets/index.4b37ed3f.js

216 lines
782 KiB
JavaScript

var fm=Object.defineProperty;var Dl=Object.getOwnPropertySymbols;var pm=Object.prototype.hasOwnProperty,mm=Object.prototype.propertyIsEnumerable;var wl=(i,e,t)=>e in i?fm(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ra=(i,e)=>{for(var t in e||(e={}))pm.call(e,t)&&wl(i,t,e[t]);if(Dl)for(var t of Dl(e))mm.call(e,t)&&wl(i,t,e[t]);return i};var Ll=(i,e,t)=>new Promise((r,s)=>{var n=l=>{try{o(t.next(l))}catch(h){s(h)}},a=l=>{try{o(t.throw(l))}catch(h){s(h)}},o=l=>l.done?r(l.value):Promise.resolve(l.value).then(n,a);o((t=t.apply(i,e)).next())});import{i as gm}from"./other.d43d2a78.js";import{O as vn,Q as _m,fn as vm,a as Wn,v as nr,K as Oo,aj as Po,o as Ri,h as yn,fo as ym,k as is,dR as Tm,f as xm,l as nn,j as to,aF as Il}from"./index.203f4f59.js";var rs;typeof window!="undefined"?rs=window:typeof vn!="undefined"?rs=vn:typeof self!="undefined"?rs=self:rs={};var R=rs,kl=typeof vn!="undefined"?vn:typeof window!="undefined"?window:{},bm=_m,ss;typeof document!="undefined"?ss=document:(ss=kl["__GLOBAL_DOCUMENT_CACHE@4"],ss||(ss=kl["__GLOBAL_DOCUMENT_CACHE@4"]=bm));var J=ss,io={exports:{}};(function(i,e){function t(l){if(l&&typeof l=="object"){var h=l.which||l.keyCode||l.charCode;h&&(l=h)}if(typeof l=="number")return a[l];var c=String(l),p=r[c.toLowerCase()];if(p)return p;var p=s[c.toLowerCase()];if(p)return p;if(c.length===1)return c.charCodeAt(0)}t.isEventKey=function(h,c){if(h&&typeof h=="object"){var p=h.which||h.keyCode||h.charCode;if(p==null)return!1;if(typeof c=="string"){var _=r[c.toLowerCase()];if(_)return _===p;var _=s[c.toLowerCase()];if(_)return _===p}else if(typeof c=="number")return c===p;return!1}},e=i.exports=t;var r=e.code=e.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},s=e.aliases={windows:91,"\u21E7":16,"\u2325":18,"\u2303":17,"\u2318":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};/*!
* Programatically add the following
*/for(n=97;n<123;n++)r[String.fromCharCode(n)]=n-32;for(var n=48;n<58;n++)r[n-48]=n;for(n=1;n<13;n++)r["f"+n]=n+111;for(n=0;n<10;n++)r["numpad "+n]=n+96;var a=e.names=e.title={};for(n in r)a[r[n]]=n;for(var o in s)r[o]=s[o]})(io,io.exports);var he=io.exports,Em=Sm;function Sm(i,e){var t,r=null;try{t=JSON.parse(i,e)}catch(s){r=s}return[r,t]}var Ro={exports:{}};function ui(){return ui=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},ui.apply(this,arguments)}var Cm=Object.freeze(Object.defineProperty({__proto__:null,default:ui},Symbol.toStringTag,{value:"Module"})),Am=vm(Cm),Dm=Lm,wm=Object.prototype.toString;function Lm(i){if(!i)return!1;var e=wm.call(i);return e==="[object Function]"||typeof i=="function"&&e!=="[object RegExp]"||typeof window!="undefined"&&(i===window.setTimeout||i===window.alert||i===window.confirm||i===window.prompt)}var Im=R,km=function(e,t){return t===void 0&&(t=!1),function(r,s,n){if(r){e(r);return}if(s.statusCode>=400&&s.statusCode<=599){var a=n;if(t)if(Im.TextDecoder){var o=Om(s.headers&&s.headers["content-type"]);try{a=new TextDecoder(o).decode(n)}catch(l){}}else a=String.fromCharCode.apply(null,new Uint8Array(n));e({cause:a});return}e(null,n)}};function Om(i){return i===void 0&&(i=""),i.toLowerCase().split(";").reduce(function(e,t){var r=t.split("="),s=r[0],n=r[1];return s.trim()==="charset"?n.trim():e},"utf-8")}var Pm=km,ac=R,Rm=Am,Mm=Dm;qt.httpHandler=Pm;/**
* @license
* slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
* Copyright (c) 2014 David Björklund
* Available under the MIT license
* <https://github.com/kesla/parse-headers/blob/master/LICENCE>
*/var Bm=function(e){var t={};return e&&e.trim().split(`
`).forEach(function(r){var s=r.indexOf(":"),n=r.slice(0,s).trim().toLowerCase(),a=r.slice(s+1).trim();typeof t[n]=="undefined"?t[n]=a:Array.isArray(t[n])?t[n].push(a):t[n]=[t[n],a]}),t};Ro.exports=qt;Ro.exports.default=qt;qt.XMLHttpRequest=ac.XMLHttpRequest||jm;qt.XDomainRequest="withCredentials"in new qt.XMLHttpRequest?qt.XMLHttpRequest:ac.XDomainRequest;Nm(["get","put","post","patch","head","delete"],function(i){qt[i==="delete"?"del":i]=function(e,t,r){return t=oc(e,t,r),t.method=i.toUpperCase(),uc(t)}});function Nm(i,e){for(var t=0;t<i.length;t++)e(i[t])}function Fm(i){for(var e in i)if(i.hasOwnProperty(e))return!1;return!0}function oc(i,e,t){var r=i;return Mm(e)?(t=e,typeof i=="string"&&(r={uri:i})):r=Rm({},e,{uri:i}),r.callback=t,r}function qt(i,e,t){return e=oc(i,e,t),uc(e)}function uc(i){if(typeof i.callback=="undefined")throw new Error("callback argument missing");var e=!1,t=function(D,S,v){e||(e=!0,i.callback(D,S,v))};function r(){o.readyState===4&&setTimeout(a,0)}function s(){var y=void 0;if(o.response?y=o.response:y=o.responseText||Um(o),b)try{y=JSON.parse(y)}catch(D){}return y}function n(y){return clearTimeout(C),y instanceof Error||(y=new Error(""+(y||"Unknown XMLHttpRequest Error"))),y.statusCode=0,t(y,x)}function a(){if(!h){var y;clearTimeout(C),i.useXDR&&o.status===void 0?y=200:y=o.status===1223?204:o.status;var D=x,S=null;return y!==0?(D={body:s(),statusCode:y,method:p,headers:{},url:c,rawRequest:o},o.getAllResponseHeaders&&(D.headers=Bm(o.getAllResponseHeaders()))):S=new Error("Internal XMLHttpRequest Error"),t(S,D,D.body)}}var o=i.xhr||null;o||(i.cors||i.useXDR?o=new qt.XDomainRequest:o=new qt.XMLHttpRequest);var l,h,c=o.url=i.uri||i.url,p=o.method=i.method||"GET",_=i.body||i.data,E=o.headers=i.headers||{},g=!!i.sync,b=!1,C,x={body:void 0,headers:{},statusCode:0,method:p,url:c,rawRequest:o};if("json"in i&&i.json!==!1&&(b=!0,E.accept||E.Accept||(E.Accept="application/json"),p!=="GET"&&p!=="HEAD"&&(E["content-type"]||E["Content-Type"]||(E["Content-Type"]="application/json"),_=JSON.stringify(i.json===!0?_:i.json))),o.onreadystatechange=r,o.onload=a,o.onerror=n,o.onprogress=function(){},o.onabort=function(){h=!0},o.ontimeout=n,o.open(p,c,!g,i.username,i.password),g||(o.withCredentials=!!i.withCredentials),!g&&i.timeout>0&&(C=setTimeout(function(){if(!h){h=!0,o.abort("timeout");var y=new Error("XMLHttpRequest timeout");y.code="ETIMEDOUT",n(y)}},i.timeout)),o.setRequestHeader)for(l in E)E.hasOwnProperty(l)&&o.setRequestHeader(l,E[l]);else if(i.headers&&!Fm(i.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in i&&(o.responseType=i.responseType),"beforeSend"in i&&typeof i.beforeSend=="function"&&i.beforeSend(o),o.send(_||null),o}function Um(i){try{if(i.responseType==="document")return i.responseXML;var e=i.responseXML&&i.responseXML.documentElement.nodeName==="parsererror";if(i.responseType===""&&!e)return i.responseXML}catch(t){}return null}function jm(){}var lc=Ro.exports,dc={exports:{}},Ol=J,Mo=Object.create||function(){function i(){}return function(e){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return i.prototype=e,new i}}();function yt(i,e){this.name="ParsingError",this.code=i.code,this.message=e||i.message}yt.prototype=Mo(Error.prototype);yt.prototype.constructor=yt;yt.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function Bo(i){function e(r,s,n,a){return(r|0)*3600+(s|0)*60+(n|0)+(a|0)/1e3}var t=i.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return t?t[3]?e(t[1],t[2],t[3].replace(":",""),t[4]):t[1]>59?e(t[1],t[2],0,t[4]):e(0,t[1],t[2],t[4]):null}function ls(){this.values=Mo(null)}ls.prototype={set:function(i,e){!this.get(i)&&e!==""&&(this.values[i]=e)},get:function(i,e,t){return t?this.has(i)?this.values[i]:e[t]:this.has(i)?this.values[i]:e},has:function(i){return i in this.values},alt:function(i,e,t){for(var r=0;r<t.length;++r)if(e===t[r]){this.set(i,e);break}},integer:function(i,e){/^-?\d+$/.test(e)&&this.set(i,parseInt(e,10))},percent:function(i,e){return e.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(e=parseFloat(e),e>=0&&e<=100)?(this.set(i,e),!0):!1}};function ns(i,e,t,r){var s=r?i.split(r):[i];for(var n in s)if(typeof s[n]=="string"){var a=s[n].split(t);if(a.length===2){var o=a[0].trim(),l=a[1].trim();e(o,l)}}}function Vm(i,e,t){var r=i;function s(){var o=Bo(i);if(o===null)throw new yt(yt.Errors.BadTimeStamp,"Malformed timestamp: "+r);return i=i.replace(/^[^\sa-zA-Z-]+/,""),o}function n(o,l){var h=new ls;ns(o,function(c,p){switch(c){case"region":for(var _=t.length-1;_>=0;_--)if(t[_].id===p){h.set(c,t[_].region);break}break;case"vertical":h.alt(c,p,["rl","lr"]);break;case"line":var E=p.split(","),g=E[0];h.integer(c,g),h.percent(c,g)&&h.set("snapToLines",!1),h.alt(c,g,["auto"]),E.length===2&&h.alt("lineAlign",E[1],["start","center","end"]);break;case"position":E=p.split(","),h.percent(c,E[0]),E.length===2&&h.alt("positionAlign",E[1],["start","center","end"]);break;case"size":h.percent(c,p);break;case"align":h.alt(c,p,["start","center","end","left","right"]);break}},/:/,/\s/),l.region=h.get("region",null),l.vertical=h.get("vertical","");try{l.line=h.get("line","auto")}catch(c){}l.lineAlign=h.get("lineAlign","start"),l.snapToLines=h.get("snapToLines",!0),l.size=h.get("size",100);try{l.align=h.get("align","center")}catch(c){l.align=h.get("align","middle")}try{l.position=h.get("position","auto")}catch(c){l.position=h.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},l.align)}l.positionAlign=h.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},l.align)}function a(){i=i.replace(/^\s+/,"")}if(a(),e.startTime=s(),a(),i.substr(0,3)!=="-->")throw new yt(yt.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+r);i=i.substr(3),a(),e.endTime=s(),a(),n(i,e)}var Ma=Ol.createElement&&Ol.createElement("textarea"),$m={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},Pl={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},Hm={v:"title",lang:"lang"},Rl={rt:"ruby"};function cc(i,e){function t(){if(!e)return null;function g(C){return e=e.substr(C.length),C}var b=e.match(/^([^<]*)(<[^>]*>?)?/);return g(b[1]?b[1]:b[2])}function r(g){return Ma.innerHTML=g,g=Ma.textContent,Ma.textContent="",g}function s(g,b){return!Rl[b.localName]||Rl[b.localName]===g.localName}function n(g,b){var C=$m[g];if(!C)return null;var x=i.document.createElement(C),y=Hm[g];return y&&b&&(x[y]=b.trim()),x}for(var a=i.document.createElement("div"),o=a,l,h=[];(l=t())!==null;){if(l[0]==="<"){if(l[1]==="/"){h.length&&h[h.length-1]===l.substr(2).replace(">","")&&(h.pop(),o=o.parentNode);continue}var c=Bo(l.substr(1,l.length-2)),p;if(c){p=i.document.createProcessingInstruction("timestamp",c),o.appendChild(p);continue}var _=l.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!_||(p=n(_[1],_[3]),!p)||!s(o,p))continue;if(_[2]){var E=_[2].split(".");E.forEach(function(g){var b=/^bg_/.test(g),C=b?g.slice(3):g;if(Pl.hasOwnProperty(C)){var x=b?"background-color":"color",y=Pl[C];p.style[x]=y}}),p.className=E.join(" ")}h.push(_[1]),o.appendChild(p),o=p;continue}o.appendChild(i.document.createTextNode(r(l)))}return a}var Ml=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function Gm(i){for(var e=0;e<Ml.length;e++){var t=Ml[e];if(i>=t[0]&&i<=t[1])return!0}return!1}function qm(i){var e=[],t="",r;if(!i||!i.childNodes)return"ltr";function s(o,l){for(var h=l.childNodes.length-1;h>=0;h--)o.push(l.childNodes[h])}function n(o){if(!o||!o.length)return null;var l=o.pop(),h=l.textContent||l.innerText;if(h){var c=h.match(/^.*(\n|\r)/);return c?(o.length=0,c[0]):h}if(l.tagName==="ruby")return n(o);if(l.childNodes)return s(o,l),n(o)}for(s(e,i);t=n(e);)for(var a=0;a<t.length;a++)if(r=t.charCodeAt(a),Gm(r))return"rtl";return"ltr"}function Wm(i){if(typeof i.line=="number"&&(i.snapToLines||i.line>=0&&i.line<=100))return i.line;if(!i.track||!i.track.textTrackList||!i.track.textTrackList.mediaElement)return-1;for(var e=i.track,t=e.textTrackList,r=0,s=0;s<t.length&&t[s]!==e;s++)t[s].mode==="showing"&&r++;return++r*-1}function zn(){}zn.prototype.applyStyles=function(i,e){e=e||this.div;for(var t in i)i.hasOwnProperty(t)&&(e.style[t]=i[t])};zn.prototype.formatStyle=function(i,e){return i===0?0:i+e};function Tn(i,e,t){zn.call(this),this.cue=e,this.cueDiv=cc(i,e.text);var r={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:e.vertical===""?"horizontal-tb":e.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(r,this.cueDiv),this.div=i.document.createElement("div"),r={direction:qm(this.cueDiv),writingMode:e.vertical===""?"horizontal-tb":e.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:e.align==="middle"?"center":e.align,font:t.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(r),this.div.appendChild(this.cueDiv);var s=0;switch(e.positionAlign){case"start":case"line-left":s=e.position;break;case"center":s=e.position-e.size/2;break;case"end":case"line-right":s=e.position-e.size;break}e.vertical===""?this.applyStyles({left:this.formatStyle(s,"%"),width:this.formatStyle(e.size,"%")}):this.applyStyles({top:this.formatStyle(s,"%"),height:this.formatStyle(e.size,"%")}),this.move=function(n){this.applyStyles({top:this.formatStyle(n.top,"px"),bottom:this.formatStyle(n.bottom,"px"),left:this.formatStyle(n.left,"px"),right:this.formatStyle(n.right,"px"),height:this.formatStyle(n.height,"px"),width:this.formatStyle(n.width,"px")})}}Tn.prototype=Mo(zn.prototype);Tn.prototype.constructor=Tn;function st(i){var e,t,r,s;if(i.div){t=i.div.offsetHeight,r=i.div.offsetWidth,s=i.div.offsetTop;var n=(n=i.div.childNodes)&&(n=n[0])&&n.getClientRects&&n.getClientRects();i=i.div.getBoundingClientRect(),e=n?Math.max(n[0]&&n[0].height||0,i.height/n.length):0}this.left=i.left,this.right=i.right,this.top=i.top||s,this.height=i.height||t,this.bottom=i.bottom||s+(i.height||t),this.width=i.width||r,this.lineHeight=e!==void 0?e:i.lineHeight}st.prototype.move=function(i,e){switch(e=e!==void 0?e:this.lineHeight,i){case"+x":this.left+=e,this.right+=e;break;case"-x":this.left-=e,this.right-=e;break;case"+y":this.top+=e,this.bottom+=e;break;case"-y":this.top-=e,this.bottom-=e;break}};st.prototype.overlaps=function(i){return this.left<i.right&&this.right>i.left&&this.top<i.bottom&&this.bottom>i.top};st.prototype.overlapsAny=function(i){for(var e=0;e<i.length;e++)if(this.overlaps(i[e]))return!0;return!1};st.prototype.within=function(i){return this.top>=i.top&&this.bottom<=i.bottom&&this.left>=i.left&&this.right<=i.right};st.prototype.overlapsOppositeAxis=function(i,e){switch(e){case"+x":return this.left<i.left;case"-x":return this.right>i.right;case"+y":return this.top<i.top;case"-y":return this.bottom>i.bottom}};st.prototype.intersectPercentage=function(i){var e=Math.max(0,Math.min(this.right,i.right)-Math.max(this.left,i.left)),t=Math.max(0,Math.min(this.bottom,i.bottom)-Math.max(this.top,i.top)),r=e*t;return r/(this.height*this.width)};st.prototype.toCSSCompatValues=function(i){return{top:this.top-i.top,bottom:i.bottom-this.bottom,left:this.left-i.left,right:i.right-this.right,height:this.height,width:this.width}};st.getSimpleBoxPosition=function(i){var e=i.div?i.div.offsetHeight:i.tagName?i.offsetHeight:0,t=i.div?i.div.offsetWidth:i.tagName?i.offsetWidth:0,r=i.div?i.div.offsetTop:i.tagName?i.offsetTop:0;i=i.div?i.div.getBoundingClientRect():i.tagName?i.getBoundingClientRect():i;var s={left:i.left,right:i.right,top:i.top||r,height:i.height||e,bottom:i.bottom||r+(i.height||e),width:i.width||t};return s};function zm(i,e,t,r){function s(C,x){for(var y,D=new st(C),S=1,v=0;v<x.length;v++){for(;C.overlapsOppositeAxis(t,x[v])||C.within(t)&&C.overlapsAny(r);)C.move(x[v]);if(C.within(t))return C;var w=C.intersectPercentage(t);S>w&&(y=new st(C),S=w),C=new st(D)}return y||D}var n=new st(e),a=e.cue,o=Wm(a),l=[];if(a.snapToLines){var h;switch(a.vertical){case"":l=["+y","-y"],h="height";break;case"rl":l=["+x","-x"],h="width";break;case"lr":l=["-x","+x"],h="width";break}var c=n.lineHeight,p=c*Math.round(o),_=t[h]+c,E=l[0];Math.abs(p)>_&&(p=p<0?-1:1,p*=Math.ceil(_/c)*c),o<0&&(p+=a.vertical===""?t.height:t.width,l=l.reverse()),n.move(E,p)}else{var g=n.lineHeight/t.height*100;switch(a.lineAlign){case"center":o-=g/2;break;case"end":o-=g;break}switch(a.vertical){case"":e.applyStyles({top:e.formatStyle(o,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(o,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(o,"%")});break}l=["+y","-x","+x","-y"],n=new st(e)}var b=s(n,l);e.move(b.toCSSCompatValues(t))}function Sr(){}Sr.StringDecoder=function(){return{decode:function(i){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))}}};Sr.convertCueToDOMTree=function(i,e){return!i||!e?null:cc(i,e)};var Km=.05,Xm="sans-serif",Ym="1.5%";Sr.processCues=function(i,e,t){if(!i||!e||!t)return null;for(;t.firstChild;)t.removeChild(t.firstChild);var r=i.document.createElement("div");r.style.position="absolute",r.style.left="0",r.style.right="0",r.style.top="0",r.style.bottom="0",r.style.margin=Ym,t.appendChild(r);function s(c){for(var p=0;p<c.length;p++)if(c[p].hasBeenReset||!c[p].displayState)return!0;return!1}if(!s(e)){for(var n=0;n<e.length;n++)r.appendChild(e[n].displayState);return}var a=[],o=st.getSimpleBoxPosition(r),l=Math.round(o.height*Km*100)/100,h={font:l+"px "+Xm};(function(){for(var c,p,_=0;_<e.length;_++)p=e[_],c=new Tn(i,p,h),r.appendChild(c.div),zm(i,c,o,a),p.displayState=c.div,a.push(st.getSimpleBoxPosition(c))})()};Sr.Parser=function(i,e,t){t||(t=e,e={}),e||(e={}),this.window=i,this.vttjs=e,this.state="INITIAL",this.buffer="",this.decoder=t||new TextDecoder("utf8"),this.regionList=[]};Sr.Parser.prototype={reportOrThrowError:function(i){if(i instanceof yt)this.onparsingerror&&this.onparsingerror(i);else throw i},parse:function(i){var e=this;i&&(e.buffer+=e.decoder.decode(i,{stream:!0}));function t(){for(var c=e.buffer,p=0;p<c.length&&c[p]!=="\r"&&c[p]!==`
`;)++p;var _=c.substr(0,p);return c[p]==="\r"&&++p,c[p]===`
`&&++p,e.buffer=c.substr(p),_}function r(c){var p=new ls;if(ns(c,function(E,g){switch(E){case"id":p.set(E,g);break;case"width":p.percent(E,g);break;case"lines":p.integer(E,g);break;case"regionanchor":case"viewportanchor":var b=g.split(",");if(b.length!==2)break;var C=new ls;if(C.percent("x",b[0]),C.percent("y",b[1]),!C.has("x")||!C.has("y"))break;p.set(E+"X",C.get("x")),p.set(E+"Y",C.get("y"));break;case"scroll":p.alt(E,g,["up"]);break}},/=/,/\s/),p.has("id")){var _=new(e.vttjs.VTTRegion||e.window.VTTRegion);_.width=p.get("width",100),_.lines=p.get("lines",3),_.regionAnchorX=p.get("regionanchorX",0),_.regionAnchorY=p.get("regionanchorY",100),_.viewportAnchorX=p.get("viewportanchorX",0),_.viewportAnchorY=p.get("viewportanchorY",100),_.scroll=p.get("scroll",""),e.onregion&&e.onregion(_),e.regionList.push({id:p.get("id"),region:_})}}function s(c){var p=new ls;ns(c,function(_,E){switch(_){case"MPEGT":p.integer(_+"S",E);break;case"LOCA":p.set(_+"L",Bo(E));break}},/[^\d]:/,/,/),e.ontimestampmap&&e.ontimestampmap({MPEGTS:p.get("MPEGTS"),LOCAL:p.get("LOCAL")})}function n(c){c.match(/X-TIMESTAMP-MAP/)?ns(c,function(p,_){switch(p){case"X-TIMESTAMP-MAP":s(_);break}},/=/):ns(c,function(p,_){switch(p){case"Region":r(_);break}},/:/)}try{var a;if(e.state==="INITIAL"){if(!/\r\n|\n/.test(e.buffer))return this;a=t();var o=a.match(/^WEBVTT([ \t].*)?$/);if(!o||!o[0])throw new yt(yt.Errors.BadSignature);e.state="HEADER"}for(var l=!1;e.buffer;){if(!/\r\n|\n/.test(e.buffer))return this;switch(l?l=!1:a=t(),e.state){case"HEADER":/:/.test(a)?n(a):a||(e.state="ID");continue;case"NOTE":a||(e.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(a)){e.state="NOTE";break}if(!a)continue;e.cue=new(e.vttjs.VTTCue||e.window.VTTCue)(0,0,"");try{e.cue.align="center"}catch(c){e.cue.align="middle"}if(e.state="CUE",a.indexOf("-->")===-1){e.cue.id=a;continue}case"CUE":try{Vm(a,e.cue,e.regionList)}catch(c){e.reportOrThrowError(c),e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":var h=a.indexOf("-->")!==-1;if(!a||h&&(l=!0)){e.oncue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}e.cue.text&&(e.cue.text+=`
`),e.cue.text+=a.replace(/\u2028/g,`
`).replace(/u2029/g,`
`);continue;case"BADCUE":a||(e.state="ID");continue}}}catch(c){e.reportOrThrowError(c),e.state==="CUETEXT"&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state=e.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var i=this;try{if(i.buffer+=i.decoder.decode(),(i.cue||i.state==="HEADER")&&(i.buffer+=`
`,i.parse()),i.state==="INITIAL")throw new yt(yt.Errors.BadSignature)}catch(e){i.reportOrThrowError(e)}return i.onflush&&i.onflush(),this}};var Qm=Sr,Jm="auto",Zm={"":1,lr:1,rl:1},eg={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function tg(i){if(typeof i!="string")return!1;var e=Zm[i.toLowerCase()];return e?i.toLowerCase():!1}function Ba(i){if(typeof i!="string")return!1;var e=eg[i.toLowerCase()];return e?i.toLowerCase():!1}function hc(i,e,t){this.hasBeenReset=!1;var r="",s=!1,n=i,a=e,o=t,l=null,h="",c=!0,p="auto",_="start",E="auto",g="auto",b=100,C="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return r},set:function(x){r=""+x}},pauseOnExit:{enumerable:!0,get:function(){return s},set:function(x){s=!!x}},startTime:{enumerable:!0,get:function(){return n},set:function(x){if(typeof x!="number")throw new TypeError("Start time must be set to a number.");n=x,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return a},set:function(x){if(typeof x!="number")throw new TypeError("End time must be set to a number.");a=x,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(x){o=""+x,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return l},set:function(x){l=x,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return h},set:function(x){var y=tg(x);if(y===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");h=y,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return c},set:function(x){c=!!x,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return p},set:function(x){if(typeof x!="number"&&x!==Jm)throw new SyntaxError("Line: an invalid number or illegal string was specified.");p=x,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return _},set:function(x){var y=Ba(x);y?(_=y,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return E},set:function(x){if(x<0||x>100)throw new Error("Position must be between 0 and 100.");E=x,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return g},set:function(x){var y=Ba(x);y?(g=y,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return b},set:function(x){if(x<0||x>100)throw new Error("Size must be between 0 and 100.");b=x,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return C},set:function(x){var y=Ba(x);if(!y)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");C=y,this.hasBeenReset=!0}}}),this.displayState=void 0}hc.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var ig=hc,rg={"":!0,up:!0};function sg(i){if(typeof i!="string")return!1;var e=rg[i.toLowerCase()];return e?i.toLowerCase():!1}function Kr(i){return typeof i=="number"&&i>=0&&i<=100}function ng(){var i=100,e=3,t=0,r=100,s=0,n=100,a="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return i},set:function(o){if(!Kr(o))throw new Error("Width must be between 0 and 100.");i=o}},lines:{enumerable:!0,get:function(){return e},set:function(o){if(typeof o!="number")throw new TypeError("Lines must be set to a number.");e=o}},regionAnchorY:{enumerable:!0,get:function(){return r},set:function(o){if(!Kr(o))throw new Error("RegionAnchorX must be between 0 and 100.");r=o}},regionAnchorX:{enumerable:!0,get:function(){return t},set:function(o){if(!Kr(o))throw new Error("RegionAnchorY must be between 0 and 100.");t=o}},viewportAnchorY:{enumerable:!0,get:function(){return n},set:function(o){if(!Kr(o))throw new Error("ViewportAnchorY must be between 0 and 100.");n=o}},viewportAnchorX:{enumerable:!0,get:function(){return s},set:function(o){if(!Kr(o))throw new Error("ViewportAnchorX must be between 0 and 100.");s=o}},scroll:{enumerable:!0,get:function(){return a},set:function(o){var l=sg(o);l===!1?console.warn("Scroll: an invalid or illegal string was specified."):a=l}}})}var ag=ng,li=R,Vi=dc.exports={WebVTT:Qm,VTTCue:ig,VTTRegion:ag};li.vttjs=Vi;li.WebVTT=Vi.WebVTT;var og=Vi.VTTCue,ug=Vi.VTTRegion,lg=li.VTTCue,dg=li.VTTRegion;Vi.shim=function(){li.VTTCue=og,li.VTTRegion=ug};Vi.restore=function(){li.VTTCue=lg,li.VTTRegion=dg};li.VTTCue||Vi.shim();var Bl=dc.exports,fc={exports:{}};(function(i,e){(function(t){var r=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,s=/^(?=([^\/?#]*))\1([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(l,h,c){if(c=c||{},l=l.trim(),h=h.trim(),!h){if(!c.alwaysNormalize)return l;var p=o.parseURL(l);if(!p)throw new Error("Error trying to parse base URL.");return p.path=o.normalizePath(p.path),o.buildURLFromParts(p)}var _=o.parseURL(h);if(!_)throw new Error("Error trying to parse relative URL.");if(_.scheme)return c.alwaysNormalize?(_.path=o.normalizePath(_.path),o.buildURLFromParts(_)):h;var E=o.parseURL(l);if(!E)throw new Error("Error trying to parse base URL.");if(!E.netLoc&&E.path&&E.path[0]!=="/"){var g=s.exec(E.path);E.netLoc=g[1],E.path=g[2]}E.netLoc&&!E.path&&(E.path="/");var b={scheme:E.scheme,netLoc:_.netLoc,path:null,params:_.params,query:_.query,fragment:_.fragment};if(!_.netLoc&&(b.netLoc=E.netLoc,_.path[0]!=="/"))if(!_.path)b.path=E.path,_.params||(b.params=E.params,_.query||(b.query=E.query));else{var C=E.path,x=C.substring(0,C.lastIndexOf("/")+1)+_.path;b.path=o.normalizePath(x)}return b.path===null&&(b.path=c.alwaysNormalize?o.normalizePath(_.path):_.path),o.buildURLFromParts(b)},parseURL:function(l){var h=r.exec(l);return h?{scheme:h[1]||"",netLoc:h[2]||"",path:h[3]||"",params:h[4]||"",query:h[5]||"",fragment:h[6]||""}:null},normalizePath:function(l){for(l=l.split("").reverse().join("").replace(n,"");l.length!==(l=l.replace(a,"")).length;);return l.split("").reverse().join("")},buildURLFromParts:function(l){return l.scheme+l.netLoc+l.path+l.params+l.query+l.fragment}};i.exports=o})()})(fc);var xn=fc.exports,Nl="http://example.com",cg=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=R.location&&R.location.href||"");var r=typeof R.URL=="function",s=/^\/\//.test(e),n=!R.location&&!/\/\//i.test(e);if(r?e=new R.URL(e,R.location||Nl):/\/\//i.test(e)||(e=xn.buildAbsoluteURL(R.location&&R.location.href||"",e)),r){var a=new URL(t,e);return n?a.href.slice(Nl.length):s?a.href.slice(a.protocol.length):a.href}return xn.buildAbsoluteURL(e,t)},No=function(){function i(){this.listeners={}}var e=i.prototype;return e.on=function(r,s){this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push(s)},e.off=function(r,s){if(!this.listeners[r])return!1;var n=this.listeners[r].indexOf(s);return this.listeners[r]=this.listeners[r].slice(0),this.listeners[r].splice(n,1),n>-1},e.trigger=function(r){var s=this.listeners[r];if(!!s)if(arguments.length===2)for(var n=s.length,a=0;a<n;++a)s[a].call(this,arguments[1]);else for(var o=Array.prototype.slice.call(arguments,1),l=s.length,h=0;h<l;++h)s[h].apply(this,o)},e.dispose=function(){this.listeners={}},e.pipe=function(r){this.on("data",function(s){r.push(s)})},i}(),hg=function(e){return R.atob?R.atob(e):Buffer.from(e,"base64").toString("binary")};function pc(i){for(var e=hg(i),t=new Uint8Array(e.length),r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}/*! @name m3u8-parser @version 6.2.0 @license Apache-2.0 */class fg extends No{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf(`
`);t>-1;t=this.buffer.indexOf(`
`))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const pg=String.fromCharCode(9),Na=function(i){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(i||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t},mg=function(){const i="[^=]*",e='"[^"]*"|[^,]*',t="(?:"+i+")=(?:"+e+")";return new RegExp("(?:^|,)("+t+")")},Ct=function(i){const e={};if(!i)return e;const t=i.split(mg());let r=t.length,s;for(;r--;)t[r]!==""&&(s=/([^=]*)=(.*)/.exec(t[r]).slice(1),s[0]=s[0].replace(/^\s+|\s+$/g,""),s[1]=s[1].replace(/^\s+|\s+$/g,""),s[1]=s[1].replace(/^['"](.*)['"]$/g,"$1"),e[s[0]]=s[1]);return e};class gg extends No{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,r;if(e=e.trim(),e.length===0)return;if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}this.tagMappers.reduce((n,a)=>{const o=a(e);return o===e?n:n.concat([o])},[e]).forEach(n=>{for(let a=0;a<this.customParsers.length;a++)if(this.customParsers[a].call(this,n))return;if(n.indexOf("#EXT")!==0){this.trigger("data",{type:"comment",text:n.slice(1)});return}if(n=n.replace("\r",""),t=/^#EXTM3U/.exec(n),t){this.trigger("data",{type:"tag",tagType:"m3u"});return}if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(n),t){r={type:"tag",tagType:"inf"},t[1]&&(r.duration=parseFloat(t[1])),t[2]&&(r.title=t[2]),this.trigger("data",r);return}if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(n),t){r={type:"tag",tagType:"targetduration"},t[1]&&(r.duration=parseInt(t[1],10)),this.trigger("data",r);return}if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(n),t){r={type:"tag",tagType:"version"},t[1]&&(r.version=parseInt(t[1],10)),this.trigger("data",r);return}if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(n),t){r={type:"tag",tagType:"media-sequence"},t[1]&&(r.number=parseInt(t[1],10)),this.trigger("data",r);return}if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(n),t){r={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(r.number=parseInt(t[1],10)),this.trigger("data",r);return}if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(n),t){r={type:"tag",tagType:"playlist-type"},t[1]&&(r.playlistType=t[1]),this.trigger("data",r);return}if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(n),t){r=ui(Na(t[1]),{type:"tag",tagType:"byterange"}),this.trigger("data",r);return}if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(n),t){r={type:"tag",tagType:"allow-cache"},t[1]&&(r.allowed=!/NO/.test(t[1])),this.trigger("data",r);return}if(t=/^#EXT-X-MAP:(.*)$/.exec(n),t){if(r={type:"tag",tagType:"map"},t[1]){const a=Ct(t[1]);a.URI&&(r.uri=a.URI),a.BYTERANGE&&(r.byterange=Na(a.BYTERANGE))}this.trigger("data",r);return}if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(n),t){if(r={type:"tag",tagType:"stream-inf"},t[1]){if(r.attributes=Ct(t[1]),r.attributes.RESOLUTION){const a=r.attributes.RESOLUTION.split("x"),o={};a[0]&&(o.width=parseInt(a[0],10)),a[1]&&(o.height=parseInt(a[1],10)),r.attributes.RESOLUTION=o}r.attributes.BANDWIDTH&&(r.attributes.BANDWIDTH=parseInt(r.attributes.BANDWIDTH,10)),r.attributes["FRAME-RATE"]&&(r.attributes["FRAME-RATE"]=parseFloat(r.attributes["FRAME-RATE"])),r.attributes["PROGRAM-ID"]&&(r.attributes["PROGRAM-ID"]=parseInt(r.attributes["PROGRAM-ID"],10))}this.trigger("data",r);return}if(t=/^#EXT-X-MEDIA:(.*)$/.exec(n),t){r={type:"tag",tagType:"media"},t[1]&&(r.attributes=Ct(t[1])),this.trigger("data",r);return}if(t=/^#EXT-X-ENDLIST/.exec(n),t){this.trigger("data",{type:"tag",tagType:"endlist"});return}if(t=/^#EXT-X-DISCONTINUITY/.exec(n),t){this.trigger("data",{type:"tag",tagType:"discontinuity"});return}if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(n),t){r={type:"tag",tagType:"program-date-time"},t[1]&&(r.dateTimeString=t[1],r.dateTimeObject=new Date(t[1])),this.trigger("data",r);return}if(t=/^#EXT-X-KEY:(.*)$/.exec(n),t){r={type:"tag",tagType:"key"},t[1]&&(r.attributes=Ct(t[1]),r.attributes.IV&&(r.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(r.attributes.IV=r.attributes.IV.substring(2)),r.attributes.IV=r.attributes.IV.match(/.{8}/g),r.attributes.IV[0]=parseInt(r.attributes.IV[0],16),r.attributes.IV[1]=parseInt(r.attributes.IV[1],16),r.attributes.IV[2]=parseInt(r.attributes.IV[2],16),r.attributes.IV[3]=parseInt(r.attributes.IV[3],16),r.attributes.IV=new Uint32Array(r.attributes.IV))),this.trigger("data",r);return}if(t=/^#EXT-X-START:(.*)$/.exec(n),t){r={type:"tag",tagType:"start"},t[1]&&(r.attributes=Ct(t[1]),r.attributes["TIME-OFFSET"]=parseFloat(r.attributes["TIME-OFFSET"]),r.attributes.PRECISE=/YES/.test(r.attributes.PRECISE)),this.trigger("data",r);return}if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(n),t){r={type:"tag",tagType:"cue-out-cont"},t[1]?r.data=t[1]:r.data="",this.trigger("data",r);return}if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(n),t){r={type:"tag",tagType:"cue-out"},t[1]?r.data=t[1]:r.data="",this.trigger("data",r);return}if(t=/^#EXT-X-CUE-IN:(.*)?$/.exec(n),t){r={type:"tag",tagType:"cue-in"},t[1]?r.data=t[1]:r.data="",this.trigger("data",r);return}if(t=/^#EXT-X-SKIP:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"skip"},r.attributes=Ct(t[1]),r.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(r.attributes["SKIPPED-SEGMENTS"]=parseInt(r.attributes["SKIPPED-SEGMENTS"],10)),r.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(r.attributes["RECENTLY-REMOVED-DATERANGES"]=r.attributes["RECENTLY-REMOVED-DATERANGES"].split(pg)),this.trigger("data",r);return}if(t=/^#EXT-X-PART:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"part"},r.attributes=Ct(t[1]),["DURATION"].forEach(function(a){r.attributes.hasOwnProperty(a)&&(r.attributes[a]=parseFloat(r.attributes[a]))}),["INDEPENDENT","GAP"].forEach(function(a){r.attributes.hasOwnProperty(a)&&(r.attributes[a]=/YES/.test(r.attributes[a]))}),r.attributes.hasOwnProperty("BYTERANGE")&&(r.attributes.byterange=Na(r.attributes.BYTERANGE)),this.trigger("data",r);return}if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"server-control"},r.attributes=Ct(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(a){r.attributes.hasOwnProperty(a)&&(r.attributes[a]=parseFloat(r.attributes[a]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(a){r.attributes.hasOwnProperty(a)&&(r.attributes[a]=/YES/.test(r.attributes[a]))}),this.trigger("data",r);return}if(t=/^#EXT-X-PART-INF:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"part-inf"},r.attributes=Ct(t[1]),["PART-TARGET"].forEach(function(a){r.attributes.hasOwnProperty(a)&&(r.attributes[a]=parseFloat(r.attributes[a]))}),this.trigger("data",r);return}if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"preload-hint"},r.attributes=Ct(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(a){if(r.attributes.hasOwnProperty(a)){r.attributes[a]=parseInt(r.attributes[a],10);const o=a==="BYTERANGE-LENGTH"?"length":"offset";r.attributes.byterange=r.attributes.byterange||{},r.attributes.byterange[o]=r.attributes[a],delete r.attributes[a]}}),this.trigger("data",r);return}if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"rendition-report"},r.attributes=Ct(t[1]),["LAST-MSN","LAST-PART"].forEach(function(a){r.attributes.hasOwnProperty(a)&&(r.attributes[a]=parseInt(r.attributes[a],10))}),this.trigger("data",r);return}if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"daterange"},r.attributes=Ct(t[1]),["ID","CLASS"].forEach(function(o){r.attributes.hasOwnProperty(o)&&(r.attributes[o]=String(r.attributes[o]))}),["START-DATE","END-DATE"].forEach(function(o){r.attributes.hasOwnProperty(o)&&(r.attributes[o]=new Date(r.attributes[o]))}),["DURATION","PLANNED-DURATION"].forEach(function(o){r.attributes.hasOwnProperty(o)&&(r.attributes[o]=parseFloat(r.attributes[o]))}),["END-ON-NEXT"].forEach(function(o){r.attributes.hasOwnProperty(o)&&(r.attributes[o]=/YES/i.test(r.attributes[o]))}),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach(function(o){r.attributes.hasOwnProperty(o)&&(r.attributes[o]=r.attributes[o].toString(16))});const a=/^X-([A-Z]+-)+[A-Z]+$/;for(const o in r.attributes){if(!a.test(o))continue;const l=/[0-9A-Fa-f]{6}/g.test(r.attributes[o]),h=/^\d+(\.\d+)?$/.test(r.attributes[o]);r.attributes[o]=l?r.attributes[o].toString(16):h?parseFloat(r.attributes[o]):String(r.attributes[o])}this.trigger("data",r);return}if(t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(n),t){this.trigger("data",{type:"tag",tagType:"independent-segments"});return}this.trigger("data",{type:"tag",data:n.slice(4)})})}addParser({expression:e,customType:t,dataParser:r,segment:s}){typeof r!="function"&&(r=n=>n),this.customParsers.push(n=>{if(e.exec(n))return this.trigger("data",{type:"custom",data:r(n),customType:t,segment:s}),!0})}addTagMapper({expression:e,map:t}){const r=s=>e.test(s)?t(s):s;this.tagMappers.push(r)}}const _g=i=>i.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),Ii=function(i){const e={};return Object.keys(i).forEach(function(t){e[_g(t)]=i[t]}),e},Fa=function(i){const{serverControl:e,targetDuration:t,partTargetDuration:r}=i;if(!e)return;const s="#EXT-X-SERVER-CONTROL",n="holdBack",a="partHoldBack",o=t&&t*3,l=r&&r*2;t&&!e.hasOwnProperty(n)&&(e[n]=o,this.trigger("info",{message:`${s} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&e[n]<o&&(this.trigger("warn",{message:`${s} clamping HOLD-BACK (${e[n]}) to targetDuration * 3 (${o})`}),e[n]=o),r&&!e.hasOwnProperty(a)&&(e[a]=r*3,this.trigger("info",{message:`${s} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${e[a]}).`})),r&&e[a]<l&&(this.trigger("warn",{message:`${s} clamping PART-HOLD-BACK (${e[a]}) to partTargetDuration * 2 (${l}).`}),e[a]=l)};class vg extends No{constructor(){super(),this.lineStream=new fg,this.parseStream=new gg,this.lineStream.pipe(this.parseStream);const e=this,t=[];let r={},s,n,a=!1;const o=function(){},l={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},h="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";let c=0;this.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};let p=0,_=0;const E={};this.on("end",()=>{r.uri||!r.parts&&!r.preloadHints||(!r.map&&s&&(r.map=s),!r.key&&n&&(r.key=n),!r.timeline&&typeof c=="number"&&(r.timeline=c),this.manifest.preloadSegment=r)}),this.parseStream.on("data",function(g){let b,C;({tag(){({version(){g.version&&(this.manifest.version=g.version)},"allow-cache"(){this.manifest.allowCache=g.allowed,"allowed"in g||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const x={};"length"in g&&(r.byterange=x,x.length=g.length,"offset"in g||(g.offset=p)),"offset"in g&&(r.byterange=x,x.offset=g.offset),p=x.offset+x.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),g.duration>0&&(r.duration=g.duration),g.duration===0&&(r.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=t},key(){if(!g.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(g.attributes.METHOD==="NONE"){n=null;return}if(!g.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(g.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:g.attributes};return}if(g.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:g.attributes.URI};return}if(g.attributes.KEYFORMAT===h){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(g.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(g.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),g.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(g.attributes.KEYID&&g.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:g.attributes.KEYFORMAT,keyId:g.attributes.KEYID.substring(2)},pssh:pc(g.attributes.URI.split(",")[1])};return}g.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),n={method:g.attributes.METHOD||"AES-128",uri:g.attributes.URI},typeof g.attributes.IV!="undefined"&&(n.iv=g.attributes.IV)},"media-sequence"(){if(!isFinite(g.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+g.number});return}this.manifest.mediaSequence=g.number},"discontinuity-sequence"(){if(!isFinite(g.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+g.number});return}this.manifest.discontinuitySequence=g.number,c=g.number},"playlist-type"(){if(!/VOD|EVENT/.test(g.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+g.playlist});return}this.manifest.playlistType=g.playlistType},map(){s={},g.uri&&(s.uri=g.uri),g.byterange&&(s.byterange=g.byterange),n&&(s.key=n)},"stream-inf"(){if(this.manifest.playlists=t,this.manifest.mediaGroups=this.manifest.mediaGroups||l,!g.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}r.attributes||(r.attributes={}),ui(r.attributes,g.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||l,!(g.attributes&&g.attributes.TYPE&&g.attributes["GROUP-ID"]&&g.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const x=this.manifest.mediaGroups[g.attributes.TYPE];x[g.attributes["GROUP-ID"]]=x[g.attributes["GROUP-ID"]]||{},b=x[g.attributes["GROUP-ID"]],C={default:/yes/i.test(g.attributes.DEFAULT)},C.default?C.autoselect=!0:C.autoselect=/yes/i.test(g.attributes.AUTOSELECT),g.attributes.LANGUAGE&&(C.language=g.attributes.LANGUAGE),g.attributes.URI&&(C.uri=g.attributes.URI),g.attributes["INSTREAM-ID"]&&(C.instreamId=g.attributes["INSTREAM-ID"]),g.attributes.CHARACTERISTICS&&(C.characteristics=g.attributes.CHARACTERISTICS),g.attributes.FORCED&&(C.forced=/yes/i.test(g.attributes.FORCED)),b[g.attributes.NAME]=C},discontinuity(){c+=1,r.discontinuity=!0,this.manifest.discontinuityStarts.push(t.length)},"program-date-time"(){typeof this.manifest.dateTimeString=="undefined"&&(this.manifest.dateTimeString=g.dateTimeString,this.manifest.dateTimeObject=g.dateTimeObject),r.dateTimeString=g.dateTimeString,r.dateTimeObject=g.dateTimeObject},targetduration(){if(!isFinite(g.duration)||g.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+g.duration});return}this.manifest.targetDuration=g.duration,Fa.call(this,this.manifest)},start(){if(!g.attributes||isNaN(g.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:g.attributes["TIME-OFFSET"],precise:g.attributes.PRECISE}},"cue-out"(){r.cueOut=g.data},"cue-out-cont"(){r.cueOutCont=g.data},"cue-in"(){r.cueIn=g.data},skip(){this.manifest.skip=Ii(g.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",g.attributes,["SKIPPED-SEGMENTS"])},part(){a=!0;const x=this.manifest.segments.length,y=Ii(g.attributes);r.parts=r.parts||[],r.parts.push(y),y.byterange&&(y.byterange.hasOwnProperty("offset")||(y.byterange.offset=_),_=y.byterange.offset+y.byterange.length);const D=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${D} for segment #${x}`,g.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((S,v)=>{S.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${v} lacks required attribute(s): LAST-PART`})})},"server-control"(){const x=this.manifest.serverControl=Ii(g.attributes);x.hasOwnProperty("canBlockReload")||(x.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),Fa.call(this,this.manifest),x.canSkipDateranges&&!x.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const x=this.manifest.segments.length,y=Ii(g.attributes),D=y.type&&y.type==="PART";r.preloadHints=r.preloadHints||[],r.preloadHints.push(y),y.byterange&&(y.byterange.hasOwnProperty("offset")||(y.byterange.offset=D?_:0,D&&(_=y.byterange.offset+y.byterange.length)));const S=r.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${S} for segment #${x}`,g.attributes,["TYPE","URI"]),!!y.type)for(let v=0;v<r.preloadHints.length-1;v++){const w=r.preloadHints[v];!w.type||w.type===y.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${S} for segment #${x} has the same TYPE ${y.type} as preload hint #${v}`})}},"rendition-report"(){const x=Ii(g.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(x);const y=this.manifest.renditionReports.length-1,D=["LAST-MSN","URI"];a&&D.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${y}`,g.attributes,D)},"part-inf"(){this.manifest.partInf=Ii(g.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",g.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),Fa.call(this,this.manifest)},daterange(){this.manifest.daterange=this.manifest.daterange||[],this.manifest.daterange.push(Ii(g.attributes));const x=this.manifest.daterange.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${x}`,g.attributes,["ID","START-DATE"]);const y=this.manifest.daterange[x];y.endDate&&y.startDate&&new Date(y.endDate)<new Date(y.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),y.duration&&y.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),y.plannedDuration&&y.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const D=!!y.endOnNext;if(D&&!y.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"}),D&&(y.duration||y.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),y.duration&&y.endDate){const S=y.startDate,v=S.setSeconds(S.getSeconds()+y.duration);this.manifest.daterange[x].endDate=new Date(v)}if(y&&!this.manifest.dateTimeString&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}),!E[y.id])E[y.id]=y;else for(const S in E[y.id])if(E[y.id][S]!==y[S]){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes and same attribute values"});break}},"independent-segments"(){this.manifest.independentSegments=!0}}[g.tagType]||o).call(e)},uri(){r.uri=g.uri,t.push(r),this.manifest.targetDuration&&!("duration"in r)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),r.duration=this.manifest.targetDuration),n&&(r.key=n),r.timeline=c,s&&(r.map=s),_=0,r={}},comment(){},custom(){g.segment?(r.custom=r.custom||{},r.custom[g.customType]=g.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[g.customType]=g.data)}})[g.type].call(e)})}warnOnMissingAttributes_(e,t,r){const s=[];r.forEach(function(n){t.hasOwnProperty(n)||s.push(n)}),s.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${s.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push(`
`),this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var Bi={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},yg=["video","audio","text"],Fl=["Video","Audio","Text"],mc=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(t,r,s){var n=("00"+Number(r).toString(16)).slice(-2),a=("00"+Number(s).toString(16)).slice(-2);return"avc1."+n+"00"+a})},jt=function(e){e===void 0&&(e="");var t=e.split(","),r=[];return t.forEach(function(s){s=s.trim();var n;yg.forEach(function(a){var o=Bi[a].exec(s.toLowerCase());if(!(!o||o.length<=1)){n=a;var l=s.substring(0,o[1].length),h=s.replace(l,"");r.push({type:l,details:h,mediaType:a})}}),n||r.push({type:s,details:"",mediaType:"unknown"})}),r},Tg=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var r=e.mediaGroups.AUDIO[t];if(!r)return null;for(var s in r){var n=r[s];if(n.default&&n.playlists)return jt(n.playlists[0].attributes.CODECS)}return null},gc=function(e){return e===void 0&&(e=""),Bi.audio.test(e.trim().toLowerCase())},xg=function(e){return e===void 0&&(e=""),Bi.text.test(e.trim().toLowerCase())},gs=function(e){if(!(!e||typeof e!="string")){var t=e.toLowerCase().split(",").map(function(n){return mc(n.trim())}),r="video";t.length===1&&gc(t[0])?r="audio":t.length===1&&xg(t[0])&&(r="application");var s="mp4";return t.every(function(n){return Bi.mp4.test(n)})?s="mp4":t.every(function(n){return Bi.webm.test(n)})?s="webm":t.every(function(n){return Bi.ogg.test(n)})&&(s="ogg"),r+"/"+s+';codecs="'+e+'"'}},pn=function(e){return e===void 0&&(e=""),R.MediaSource&&R.MediaSource.isTypeSupported&&R.MediaSource.isTypeSupported(gs(e))||!1},Ua=function(e){return e===void 0&&(e=""),e.toLowerCase().split(",").every(function(t){t=t.trim();for(var r=0;r<Fl.length;r++){var s=Fl[r];if(Bi["muxer"+s].test(t))return!0}return!1})},Ul="mp4a.40.2",bg="avc1.4d400d",Eg=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,Sg=/^application\/dash\+xml/i,_c=function(e){return Eg.test(e)?"hls":Sg.test(e)?"dash":e==="application/vnd.videojs.vhs+json"?"vhs-json":null},Cg=function(e){return e.toString(2).length},Ag=function(e){return Math.ceil(Cg(e)/8)},vc=function(e){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},Dg=function(e){return vc(e)},re=function(e){return e instanceof Uint8Array?e:(!Array.isArray(e)&&!Dg(e)&&!(e instanceof ArrayBuffer)&&(typeof e!="number"||typeof e=="number"&&e!==e?e=0:e=[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},Ke=R.BigInt||Number,ro=[Ke("0x1"),Ke("0x100"),Ke("0x10000"),Ke("0x1000000"),Ke("0x100000000"),Ke("0x10000000000"),Ke("0x1000000000000"),Ke("0x100000000000000"),Ke("0x10000000000000000")];(function(){var i=new Uint16Array([65484]),e=new Uint8Array(i.buffer,i.byteOffset,i.byteLength);return e[0]===255?"big":e[0]===204?"little":"unknown"})();var wg=function(e,t){var r=t===void 0?{}:t,s=r.signed,n=s===void 0?!1:s,a=r.le,o=a===void 0?!1:a;e=re(e);var l=o?"reduce":"reduceRight",h=e[l]?e[l]:Array.prototype[l],c=h.call(e,function(_,E,g){var b=o?g:Math.abs(g+1-e.length);return _+Ke(E)*ro[b]},Ke(0));if(n){var p=ro[e.length]/Ke(2)-Ke(1);c=Ke(c),c>p&&(c-=p,c-=p,c-=Ke(2))}return Number(c)},Lg=function(e,t){var r=t===void 0?{}:t,s=r.le,n=s===void 0?!1:s;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!==e)&&(e=0),e=Ke(e);for(var a=Ag(e),o=new Uint8Array(new ArrayBuffer(a)),l=0;l<a;l++){var h=n?l:Math.abs(l+1-o.length);o[h]=Number(e/ro[l]&Ke(255)),e<0&&(o[h]=Math.abs(~o[h]),o[h]-=l===0?1:2)}return o},yc=function(e,t){if(typeof e!="string"&&e&&typeof e.toString=="function"&&(e=e.toString()),typeof e!="string")return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var r=new Uint8Array(e.length),s=0;s<e.length;s++)r[s]=e.charCodeAt(s);return r},Ig=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t=t.filter(function(o){return o&&(o.byteLength||o.length)&&typeof o!="string"}),t.length<=1)return re(t[0]);var s=t.reduce(function(o,l,h){return o+(l.byteLength||l.length)},0),n=new Uint8Array(s),a=0;return t.forEach(function(o){o=re(o),n.set(o,a),a+=o.byteLength}),n},Oe=function(e,t,r){var s=r===void 0?{}:r,n=s.offset,a=n===void 0?0:n,o=s.mask,l=o===void 0?[]:o;e=re(e),t=re(t);var h=t.every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&h.call(t,function(c,p){var _=l[p]?l[p]&e[a+p]:e[a+p];return c===_})},jl="http://example.com",Fo=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=R.location&&R.location.href||"");var r=typeof R.URL=="function",s=/^\/\//.test(e),n=!R.location&&!/\/\//i.test(e);if(r?e=new R.URL(e,R.location||jl):/\/\//i.test(e)||(e=xn.buildAbsoluteURL(R.location&&R.location.href||"",e)),r){var a=new URL(t,e);return n?a.href.slice(jl.length):s?a.href.slice(a.protocol.length):a.href}return xn.buildAbsoluteURL(e,t)},kg=function(e,t,r){t.forEach(function(s){for(var n in e.mediaGroups[s])for(var a in e.mediaGroups[s][n]){var o=e.mediaGroups[s][n][a];r(o,s,n,a)}})},bi={},fi={};function Og(i,e,t){if(t===void 0&&(t=Array.prototype),i&&typeof t.find=="function")return t.find.call(i,e);for(var r=0;r<i.length;r++)if(Object.prototype.hasOwnProperty.call(i,r)){var s=i[r];if(e.call(void 0,s,r,i))return s}}function Uo(i,e){return e===void 0&&(e=Object),e&&typeof e.freeze=="function"?e.freeze(i):i}function Pg(i,e){if(i===null||typeof i!="object")throw new TypeError("target is not an object");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t]);return i}var Tc=Uo({HTML:"text/html",isHTML:function(i){return i===Tc.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),xc=Uo({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(i){return i===xc.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});fi.assign=Pg;fi.find=Og;fi.freeze=Uo;fi.MIME_TYPE=Tc;fi.NAMESPACE=xc;var bc=fi,Wt=bc.find,_s=bc.NAMESPACE;function Rg(i){return i!==""}function Mg(i){return i?i.split(/[\t\n\f\r ]+/).filter(Rg):[]}function Bg(i,e){return i.hasOwnProperty(e)||(i[e]=!0),i}function Vl(i){if(!i)return[];var e=Mg(i);return Object.keys(e.reduce(Bg,{}))}function Ng(i){return function(e){return i&&i.indexOf(e)!==-1}}function Ss(i,e){for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t])}function pt(i,e){var t=i.prototype;if(!(t instanceof e)){let r=function(){};r.prototype=e.prototype,r=new r,Ss(t,r),i.prototype=t=r}t.constructor!=i&&(typeof i!="function"&&console.error("unknown Class:"+i),t.constructor=i)}var mt={},Mt=mt.ELEMENT_NODE=1,hr=mt.ATTRIBUTE_NODE=2,bn=mt.TEXT_NODE=3,Ec=mt.CDATA_SECTION_NODE=4,Sc=mt.ENTITY_REFERENCE_NODE=5,Fg=mt.ENTITY_NODE=6,Cc=mt.PROCESSING_INSTRUCTION_NODE=7,Ac=mt.COMMENT_NODE=8,Dc=mt.DOCUMENT_NODE=9,wc=mt.DOCUMENT_TYPE_NODE=10,di=mt.DOCUMENT_FRAGMENT_NODE=11,Ug=mt.NOTATION_NODE=12,Je={},We={};Je.INDEX_SIZE_ERR=(We[1]="Index size error",1);Je.DOMSTRING_SIZE_ERR=(We[2]="DOMString size error",2);var ct=Je.HIERARCHY_REQUEST_ERR=(We[3]="Hierarchy request error",3);Je.WRONG_DOCUMENT_ERR=(We[4]="Wrong document",4);Je.INVALID_CHARACTER_ERR=(We[5]="Invalid character",5);Je.NO_DATA_ALLOWED_ERR=(We[6]="No data allowed",6);Je.NO_MODIFICATION_ALLOWED_ERR=(We[7]="No modification allowed",7);var Lc=Je.NOT_FOUND_ERR=(We[8]="Not found",8);Je.NOT_SUPPORTED_ERR=(We[9]="Not supported",9);var $l=Je.INUSE_ATTRIBUTE_ERR=(We[10]="Attribute in use",10);Je.INVALID_STATE_ERR=(We[11]="Invalid state",11);Je.SYNTAX_ERR=(We[12]="Syntax error",12);Je.INVALID_MODIFICATION_ERR=(We[13]="Invalid modification",13);Je.NAMESPACE_ERR=(We[14]="Invalid namespace",14);Je.INVALID_ACCESS_ERR=(We[15]="Invalid access",15);function Fe(i,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,We[i]),this.message=We[i],Error.captureStackTrace&&Error.captureStackTrace(this,Fe);return t.code=i,e&&(this.message=this.message+": "+e),t}Fe.prototype=Error.prototype;Ss(Je,Fe);function ai(){}ai.prototype={length:0,item:function(i){return i>=0&&i<this.length?this[i]:null},toString:function(i,e){for(var t=[],r=0;r<this.length;r++)tr(this[r],t,i,e);return t.join("")},filter:function(i){return Array.prototype.filter.call(this,i)},indexOf:function(i){return Array.prototype.indexOf.call(this,i)}};function fr(i,e){this._node=i,this._refresh=e,jo(this)}function jo(i){var e=i._node._inc||i._node.ownerDocument._inc;if(i._inc!==e){var t=i._refresh(i._node);if(Vc(i,"length",t.length),!i.$$length||t.length<i.$$length)for(var r=t.length;r in i;r++)Object.prototype.hasOwnProperty.call(i,r)&&delete i[r];Ss(t,i),i._inc=e}}fr.prototype.item=function(i){return jo(this),this[i]||null};pt(fr,ai);function En(){}function Ic(i,e){for(var t=i.length;t--;)if(i[t]===e)return t}function Hl(i,e,t,r){if(r?e[Ic(e,r)]=t:e[e.length++]=t,i){t.ownerElement=i;var s=i.ownerDocument;s&&(r&&Pc(s,i,r),jg(s,i,t))}}function Gl(i,e,t){var r=Ic(e,t);if(r>=0){for(var s=e.length-1;r<s;)e[r]=e[++r];if(e.length=s,i){var n=i.ownerDocument;n&&(Pc(n,i,t),t.ownerElement=null)}}else throw new Fe(Lc,new Error(i.tagName+"@"+t))}En.prototype={length:0,item:ai.prototype.item,getNamedItem:function(i){for(var e=this.length;e--;){var t=this[e];if(t.nodeName==i)return t}},setNamedItem:function(i){var e=i.ownerElement;if(e&&e!=this._ownerElement)throw new Fe($l);var t=this.getNamedItem(i.nodeName);return Hl(this._ownerElement,this,i,t),t},setNamedItemNS:function(i){var e=i.ownerElement,t;if(e&&e!=this._ownerElement)throw new Fe($l);return t=this.getNamedItemNS(i.namespaceURI,i.localName),Hl(this._ownerElement,this,i,t),t},removeNamedItem:function(i){var e=this.getNamedItem(i);return Gl(this._ownerElement,this,e),e},removeNamedItemNS:function(i,e){var t=this.getNamedItemNS(i,e);return Gl(this._ownerElement,this,t),t},getNamedItemNS:function(i,e){for(var t=this.length;t--;){var r=this[t];if(r.localName==e&&r.namespaceURI==i)return r}return null}};function kc(){}kc.prototype={hasFeature:function(i,e){return!0},createDocument:function(i,e,t){var r=new Cs;if(r.implementation=this,r.childNodes=new ai,r.doctype=t||null,t&&r.appendChild(t),e){var s=r.createElementNS(i,e);r.appendChild(s)}return r},createDocumentType:function(i,e,t){var r=new Kn;return r.name=i,r.nodeName=i,r.publicId=e||"",r.systemId=t||"",r}};function Ee(){}Ee.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(i,e){return Sn(this,i,e)},replaceChild:function(i,e){Sn(this,i,e,Mc),e&&this.removeChild(e)},removeChild:function(i){return Rc(this,i)},appendChild:function(i){return this.insertBefore(i,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(i){return so(this.ownerDocument||this,this,i)},normalize:function(){for(var i=this.firstChild;i;){var e=i.nextSibling;e&&e.nodeType==bn&&i.nodeType==bn?(this.removeChild(e),i.appendData(e.data)):(i.normalize(),i=e)}},isSupported:function(i,e){return this.ownerDocument.implementation.hasFeature(i,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(i){for(var e=this;e;){var t=e._nsMap;if(t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&t[r]===i)return r}e=e.nodeType==hr?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(i){for(var e=this;e;){var t=e._nsMap;if(t&&Object.prototype.hasOwnProperty.call(t,i))return t[i];e=e.nodeType==hr?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(i){var e=this.lookupPrefix(i);return e==null}};function Oc(i){return i=="<"&&"&lt;"||i==">"&&"&gt;"||i=="&"&&"&amp;"||i=='"'&&"&quot;"||"&#"+i.charCodeAt()+";"}Ss(mt,Ee);Ss(mt,Ee.prototype);function vs(i,e){if(e(i))return!0;if(i=i.firstChild)do if(vs(i,e))return!0;while(i=i.nextSibling)}function Cs(){this.ownerDocument=this}function jg(i,e,t){i&&i._inc++;var r=t.namespaceURI;r===_s.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}function Pc(i,e,t,r){i&&i._inc++;var s=t.namespaceURI;s===_s.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}function Vo(i,e,t){if(i&&i._inc){i._inc++;var r=e.childNodes;if(t)r[r.length++]=t;else{for(var s=e.firstChild,n=0;s;)r[n++]=s,s=s.nextSibling;r.length=n,delete r[r.length]}}}function Rc(i,e){var t=e.previousSibling,r=e.nextSibling;return t?t.nextSibling=r:i.firstChild=r,r?r.previousSibling=t:i.lastChild=t,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,Vo(i.ownerDocument,i),e}function Vg(i){return i&&(i.nodeType===Ee.DOCUMENT_NODE||i.nodeType===Ee.DOCUMENT_FRAGMENT_NODE||i.nodeType===Ee.ELEMENT_NODE)}function $g(i){return i&&(zt(i)||$o(i)||ci(i)||i.nodeType===Ee.DOCUMENT_FRAGMENT_NODE||i.nodeType===Ee.COMMENT_NODE||i.nodeType===Ee.PROCESSING_INSTRUCTION_NODE)}function ci(i){return i&&i.nodeType===Ee.DOCUMENT_TYPE_NODE}function zt(i){return i&&i.nodeType===Ee.ELEMENT_NODE}function $o(i){return i&&i.nodeType===Ee.TEXT_NODE}function ql(i,e){var t=i.childNodes||[];if(Wt(t,zt)||ci(e))return!1;var r=Wt(t,ci);return!(e&&r&&t.indexOf(r)>t.indexOf(e))}function Wl(i,e){var t=i.childNodes||[];function r(n){return zt(n)&&n!==e}if(Wt(t,r))return!1;var s=Wt(t,ci);return!(e&&s&&t.indexOf(s)>t.indexOf(e))}function Hg(i,e,t){if(!Vg(i))throw new Fe(ct,"Unexpected parent node type "+i.nodeType);if(t&&t.parentNode!==i)throw new Fe(Lc,"child not in parent");if(!$g(e)||ci(e)&&i.nodeType!==Ee.DOCUMENT_NODE)throw new Fe(ct,"Unexpected node type "+e.nodeType+" for parent node type "+i.nodeType)}function Gg(i,e,t){var r=i.childNodes||[],s=e.childNodes||[];if(e.nodeType===Ee.DOCUMENT_FRAGMENT_NODE){var n=s.filter(zt);if(n.length>1||Wt(s,$o))throw new Fe(ct,"More than one element or text in fragment");if(n.length===1&&!ql(i,t))throw new Fe(ct,"Element in fragment can not be inserted before doctype")}if(zt(e)&&!ql(i,t))throw new Fe(ct,"Only one element can be added and only after doctype");if(ci(e)){if(Wt(r,ci))throw new Fe(ct,"Only one doctype is allowed");var a=Wt(r,zt);if(t&&r.indexOf(a)<r.indexOf(t))throw new Fe(ct,"Doctype can only be inserted before an element");if(!t&&a)throw new Fe(ct,"Doctype can not be appended since element is present")}}function Mc(i,e,t){var r=i.childNodes||[],s=e.childNodes||[];if(e.nodeType===Ee.DOCUMENT_FRAGMENT_NODE){var n=s.filter(zt);if(n.length>1||Wt(s,$o))throw new Fe(ct,"More than one element or text in fragment");if(n.length===1&&!Wl(i,t))throw new Fe(ct,"Element in fragment can not be inserted before doctype")}if(zt(e)&&!Wl(i,t))throw new Fe(ct,"Only one element can be added and only after doctype");if(ci(e)){if(Wt(r,function(l){return ci(l)&&l!==t}))throw new Fe(ct,"Only one doctype is allowed");var a=Wt(r,zt);if(t&&r.indexOf(a)<r.indexOf(t))throw new Fe(ct,"Doctype can only be inserted before an element")}}function Sn(i,e,t,r){Hg(i,e,t),i.nodeType===Ee.DOCUMENT_NODE&&(r||Gg)(i,e,t);var s=e.parentNode;if(s&&s.removeChild(e),e.nodeType===di){var n=e.firstChild;if(n==null)return e;var a=e.lastChild}else n=a=e;var o=t?t.previousSibling:i.lastChild;n.previousSibling=o,a.nextSibling=t,o?o.nextSibling=n:i.firstChild=n,t==null?i.lastChild=a:t.previousSibling=a;do n.parentNode=i;while(n!==a&&(n=n.nextSibling));return Vo(i.ownerDocument||i,i),e.nodeType==di&&(e.firstChild=e.lastChild=null),e}function qg(i,e){return e.parentNode&&e.parentNode.removeChild(e),e.parentNode=i,e.previousSibling=i.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:i.firstChild=e,i.lastChild=e,Vo(i.ownerDocument,i,e),e}Cs.prototype={nodeName:"#document",nodeType:Dc,doctype:null,documentElement:null,_inc:1,insertBefore:function(i,e){if(i.nodeType==di){for(var t=i.firstChild;t;){var r=t.nextSibling;this.insertBefore(t,e),t=r}return i}return Sn(this,i,e),i.ownerDocument=this,this.documentElement===null&&i.nodeType===Mt&&(this.documentElement=i),i},removeChild:function(i){return this.documentElement==i&&(this.documentElement=null),Rc(this,i)},replaceChild:function(i,e){Sn(this,i,e,Mc),i.ownerDocument=this,e&&this.removeChild(e),zt(i)&&(this.documentElement=i)},importNode:function(i,e){return jc(this,i,e)},getElementById:function(i){var e=null;return vs(this.documentElement,function(t){if(t.nodeType==Mt&&t.getAttribute("id")==i)return e=t,!0}),e},getElementsByClassName:function(i){var e=Vl(i);return new fr(this,function(t){var r=[];return e.length>0&&vs(t.documentElement,function(s){if(s!==t&&s.nodeType===Mt){var n=s.getAttribute("class");if(n){var a=i===n;if(!a){var o=Vl(n);a=e.every(Ng(o))}a&&r.push(s)}}}),r})},createElement:function(i){var e=new Ui;e.ownerDocument=this,e.nodeName=i,e.tagName=i,e.localName=i,e.childNodes=new ai;var t=e.attributes=new En;return t._ownerElement=e,e},createDocumentFragment:function(){var i=new Xn;return i.ownerDocument=this,i.childNodes=new ai,i},createTextNode:function(i){var e=new Ho;return e.ownerDocument=this,e.appendData(i),e},createComment:function(i){var e=new Go;return e.ownerDocument=this,e.appendData(i),e},createCDATASection:function(i){var e=new qo;return e.ownerDocument=this,e.appendData(i),e},createProcessingInstruction:function(i,e){var t=new zo;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=i,t.nodeValue=t.data=e,t},createAttribute:function(i){var e=new Cn;return e.ownerDocument=this,e.name=i,e.nodeName=i,e.localName=i,e.specified=!0,e},createEntityReference:function(i){var e=new Wo;return e.ownerDocument=this,e.nodeName=i,e},createElementNS:function(i,e){var t=new Ui,r=e.split(":"),s=t.attributes=new En;return t.childNodes=new ai,t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.namespaceURI=i,r.length==2?(t.prefix=r[0],t.localName=r[1]):t.localName=e,s._ownerElement=t,t},createAttributeNS:function(i,e){var t=new Cn,r=e.split(":");return t.ownerDocument=this,t.nodeName=e,t.name=e,t.namespaceURI=i,t.specified=!0,r.length==2?(t.prefix=r[0],t.localName=r[1]):t.localName=e,t}};pt(Cs,Ee);function Ui(){this._nsMap={}}Ui.prototype={nodeType:Mt,hasAttribute:function(i){return this.getAttributeNode(i)!=null},getAttribute:function(i){var e=this.getAttributeNode(i);return e&&e.value||""},getAttributeNode:function(i){return this.attributes.getNamedItem(i)},setAttribute:function(i,e){var t=this.ownerDocument.createAttribute(i);t.value=t.nodeValue=""+e,this.setAttributeNode(t)},removeAttribute:function(i){var e=this.getAttributeNode(i);e&&this.removeAttributeNode(e)},appendChild:function(i){return i.nodeType===di?this.insertBefore(i,null):qg(this,i)},setAttributeNode:function(i){return this.attributes.setNamedItem(i)},setAttributeNodeNS:function(i){return this.attributes.setNamedItemNS(i)},removeAttributeNode:function(i){return this.attributes.removeNamedItem(i.nodeName)},removeAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);t&&this.removeAttributeNode(t)},hasAttributeNS:function(i,e){return this.getAttributeNodeNS(i,e)!=null},getAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);return t&&t.value||""},setAttributeNS:function(i,e,t){var r=this.ownerDocument.createAttributeNS(i,e);r.value=r.nodeValue=""+t,this.setAttributeNode(r)},getAttributeNodeNS:function(i,e){return this.attributes.getNamedItemNS(i,e)},getElementsByTagName:function(i){return new fr(this,function(e){var t=[];return vs(e,function(r){r!==e&&r.nodeType==Mt&&(i==="*"||r.tagName==i)&&t.push(r)}),t})},getElementsByTagNameNS:function(i,e){return new fr(this,function(t){var r=[];return vs(t,function(s){s!==t&&s.nodeType===Mt&&(i==="*"||s.namespaceURI===i)&&(e==="*"||s.localName==e)&&r.push(s)}),r})}};Cs.prototype.getElementsByTagName=Ui.prototype.getElementsByTagName;Cs.prototype.getElementsByTagNameNS=Ui.prototype.getElementsByTagNameNS;pt(Ui,Ee);function Cn(){}Cn.prototype.nodeType=hr;pt(Cn,Ee);function As(){}As.prototype={data:"",substringData:function(i,e){return this.data.substring(i,i+e)},appendData:function(i){i=this.data+i,this.nodeValue=this.data=i,this.length=i.length},insertData:function(i,e){this.replaceData(i,0,e)},appendChild:function(i){throw new Error(We[ct])},deleteData:function(i,e){this.replaceData(i,e,"")},replaceData:function(i,e,t){var r=this.data.substring(0,i),s=this.data.substring(i+e);t=r+t+s,this.nodeValue=this.data=t,this.length=t.length}};pt(As,Ee);function Ho(){}Ho.prototype={nodeName:"#text",nodeType:bn,splitText:function(i){var e=this.data,t=e.substring(i);e=e.substring(0,i),this.data=this.nodeValue=e,this.length=e.length;var r=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}};pt(Ho,As);function Go(){}Go.prototype={nodeName:"#comment",nodeType:Ac};pt(Go,As);function qo(){}qo.prototype={nodeName:"#cdata-section",nodeType:Ec};pt(qo,As);function Kn(){}Kn.prototype.nodeType=wc;pt(Kn,Ee);function Bc(){}Bc.prototype.nodeType=Ug;pt(Bc,Ee);function Nc(){}Nc.prototype.nodeType=Fg;pt(Nc,Ee);function Wo(){}Wo.prototype.nodeType=Sc;pt(Wo,Ee);function Xn(){}Xn.prototype.nodeName="#document-fragment";Xn.prototype.nodeType=di;pt(Xn,Ee);function zo(){}zo.prototype.nodeType=Cc;pt(zo,Ee);function Fc(){}Fc.prototype.serializeToString=function(i,e,t){return Uc.call(i,e,t)};Ee.prototype.toString=Uc;function Uc(i,e){var t=[],r=this.nodeType==9&&this.documentElement||this,s=r.prefix,n=r.namespaceURI;if(n&&s==null){var s=r.lookupPrefix(n);if(s==null)var a=[{namespace:n,prefix:null}]}return tr(this,t,i,e,a),t.join("")}function zl(i,e,t){var r=i.prefix||"",s=i.namespaceURI;if(!s||r==="xml"&&s===_s.XML||s===_s.XMLNS)return!1;for(var n=t.length;n--;){var a=t[n];if(a.prefix===r)return a.namespace!==s}return!0}function ja(i,e,t){i.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,Oc),'"')}function tr(i,e,t,r,s){if(s||(s=[]),r)if(i=r(i),i){if(typeof i=="string"){e.push(i);return}}else return;switch(i.nodeType){case Mt:var n=i.attributes,a=n.length,x=i.firstChild,o=i.tagName;t=_s.isHTML(i.namespaceURI)||t;var l=o;if(!t&&!i.prefix&&i.namespaceURI){for(var h,c=0;c<n.length;c++)if(n.item(c).name==="xmlns"){h=n.item(c).value;break}if(!h)for(var p=s.length-1;p>=0;p--){var _=s[p];if(_.prefix===""&&_.namespace===i.namespaceURI){h=_.namespace;break}}if(h!==i.namespaceURI)for(var p=s.length-1;p>=0;p--){var _=s[p];if(_.namespace===i.namespaceURI){_.prefix&&(l=_.prefix+":"+o);break}}}e.push("<",l);for(var E=0;E<a;E++){var g=n.item(E);g.prefix=="xmlns"?s.push({prefix:g.localName,namespace:g.value}):g.nodeName=="xmlns"&&s.push({prefix:"",namespace:g.value})}for(var E=0;E<a;E++){var g=n.item(E);if(zl(g,t,s)){var b=g.prefix||"",C=g.namespaceURI;ja(e,b?"xmlns:"+b:"xmlns",C),s.push({prefix:b,namespace:C})}tr(g,e,t,r,s)}if(o===l&&zl(i,t,s)){var b=i.prefix||"",C=i.namespaceURI;ja(e,b?"xmlns:"+b:"xmlns",C),s.push({prefix:b,namespace:C})}if(x||t&&!/^(?:meta|link|img|br|hr|input)$/i.test(o)){if(e.push(">"),t&&/^script$/i.test(o))for(;x;)x.data?e.push(x.data):tr(x,e,t,r,s.slice()),x=x.nextSibling;else for(;x;)tr(x,e,t,r,s.slice()),x=x.nextSibling;e.push("</",l,">")}else e.push("/>");return;case Dc:case di:for(var x=i.firstChild;x;)tr(x,e,t,r,s.slice()),x=x.nextSibling;return;case hr:return ja(e,i.name,i.value);case bn:return e.push(i.data.replace(/[<&>]/g,Oc));case Ec:return e.push("<![CDATA[",i.data,"]]>");case Ac:return e.push("<!--",i.data,"-->");case wc:var y=i.publicId,D=i.systemId;if(e.push("<!DOCTYPE ",i.name),y)e.push(" PUBLIC ",y),D&&D!="."&&e.push(" ",D),e.push(">");else if(D&&D!=".")e.push(" SYSTEM ",D,">");else{var S=i.internalSubset;S&&e.push(" [",S,"]"),e.push(">")}return;case Cc:return e.push("<?",i.target," ",i.data,"?>");case Sc:return e.push("&",i.nodeName,";");default:e.push("??",i.nodeName)}}function jc(i,e,t){var r;switch(e.nodeType){case Mt:r=e.cloneNode(!1),r.ownerDocument=i;case di:break;case hr:t=!0;break}if(r||(r=e.cloneNode(!1)),r.ownerDocument=i,r.parentNode=null,t)for(var s=e.firstChild;s;)r.appendChild(jc(i,s,t)),s=s.nextSibling;return r}function so(i,e,t){var r=new e.constructor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var n=e[s];typeof n!="object"&&n!=r[s]&&(r[s]=n)}switch(e.childNodes&&(r.childNodes=new ai),r.ownerDocument=i,r.nodeType){case Mt:var a=e.attributes,o=r.attributes=new En,l=a.length;o._ownerElement=r;for(var h=0;h<l;h++)r.setAttributeNode(so(i,a.item(h),!0));break;case hr:t=!0}if(t)for(var c=e.firstChild;c;)r.appendChild(so(i,c,t)),c=c.nextSibling;return r}function Vc(i,e,t){i[e]=t}try{if(Object.defineProperty){let i=function(e){switch(e.nodeType){case Mt:case di:var t=[];for(e=e.firstChild;e;)e.nodeType!==7&&e.nodeType!==8&&t.push(i(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}};Object.defineProperty(fr.prototype,"length",{get:function(){return jo(this),this.$$length}}),Object.defineProperty(Ee.prototype,"textContent",{get:function(){return i(this)},set:function(e){switch(this.nodeType){case Mt:case di:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),Vc=function(e,t,r){e["$$"+t]=r}}}catch(i){}bi.DocumentType=Kn;bi.DOMException=Fe;bi.DOMImplementation=kc;bi.Element=Ui;bi.Node=Ee;bi.NodeList=ai;bi.XMLSerializer=Fc;var Yn={},$c={};(function(i){var e=fi.freeze;i.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),i.HTML_ENTITIES=e({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"}),i.entityMap=i.HTML_ENTITIES})($c);var Ko={},ys=fi.NAMESPACE,no=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Kl=new RegExp("[\\-\\.0-9"+no.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Xl=new RegExp("^"+no.source+Kl.source+"*(?::"+no.source+Kl.source+"*)?$"),Xr=0,_i=1,Ki=2,Yr=3,Xi=4,Yi=5,Qr=6,an=7;function pr(i,e){this.message=i,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,pr)}pr.prototype=new Error;pr.prototype.name=pr.name;function Hc(){}Hc.prototype={parse:function(i,e,t){var r=this.domBuilder;r.startDocument(),Gc(e,e={}),Wg(i,e,t,r,this.errorHandler),r.endDocument()}};function Wg(i,e,t,r,s){function n(q){if(q>65535){q-=65536;var Q=55296+(q>>10),oe=56320+(q&1023);return String.fromCharCode(Q,oe)}else return String.fromCharCode(q)}function a(q){var Q=q.slice(1,-1);return Object.hasOwnProperty.call(t,Q)?t[Q]:Q.charAt(0)==="#"?n(parseInt(Q.substr(1).replace("x","0x"))):(s.error("entity not found:"+q),q)}function o(q){if(q>b){var Q=i.substring(b,q).replace(/&#?\w+;/g,a);_&&l(b),r.characters(Q,0,q-b),b=q}}function l(q,Q){for(;q>=c&&(Q=p.exec(i));)h=Q.index,c=h+Q[0].length,_.lineNumber++;_.columnNumber=q-h+1}for(var h=0,c=0,p=/.*(?:\r\n?|\n)|.*$/g,_=r.locator,E=[{currentNSMap:e}],g={},b=0;;){try{var C=i.indexOf("<",b);if(C<0){if(!i.substr(b).match(/^\s*$/)){var x=r.doc,y=x.createTextNode(i.substr(b));x.appendChild(y),r.currentElement=y}return}switch(C>b&&o(C),i.charAt(C+1)){case"/":var U=i.indexOf(">",C+3),D=i.substring(C+2,U).replace(/[ \t\n\r]+$/g,""),S=E.pop();U<0?(D=i.substring(C+2).replace(/[\s<].*/,""),s.error("end tag name: "+D+" is not complete:"+S.tagName),U=C+1+D.length):D.match(/\s</)&&(D=D.replace(/[\s<].*/,""),s.error("end tag name: "+D+" maybe not complete"),U=C+1+D.length);var v=S.localNSMap,w=S.tagName==D,L=w||S.tagName&&S.tagName.toLowerCase()==D.toLowerCase();if(L){if(r.endElement(S.uri,S.localName,D),v)for(var O in v)Object.prototype.hasOwnProperty.call(v,O)&&r.endPrefixMapping(O);w||s.fatalError("end tag name: "+D+" is not match the current start tagName:"+S.tagName)}else E.push(S);U++;break;case"?":_&&l(C),U=Qg(i,C,r);break;case"!":_&&l(C),U=Yg(i,C,r,s);break;default:_&&l(C);var F=new qc,V=E[E.length-1].currentNSMap,U=zg(i,C,F,V,a,s),B=F.length;if(!F.closed&&Xg(i,U,F.tagName,g)&&(F.closed=!0,t.nbsp||s.warning("unclosed xml attribute")),_&&B){for(var N=Yl(_,{}),$=0;$<B;$++){var K=F[$];l(K.offset),K.locator=Yl(_,{})}r.locator=N,Ql(F,r,V)&&E.push(F),r.locator=_}else Ql(F,r,V)&&E.push(F);ys.isHTML(F.uri)&&!F.closed?U=Kg(i,U,F.tagName,a,r):U++}}catch(q){if(q instanceof pr)throw q;s.error("element parse error: "+q),U=-1}U>b?b=U:o(Math.max(C,b)+1)}}function Yl(i,e){return e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber,e}function zg(i,e,t,r,s,n){function a(_,E,g){t.attributeNames.hasOwnProperty(_)&&n.fatalError("Attribute "+_+" redefined"),t.addValue(_,E.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),g)}for(var o,l,h=++e,c=Xr;;){var p=i.charAt(h);switch(p){case"=":if(c===_i)o=i.slice(e,h),c=Yr;else if(c===Ki)c=Yr;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(c===Yr||c===_i)if(c===_i&&(n.warning('attribute value must after "="'),o=i.slice(e,h)),e=h+1,h=i.indexOf(p,e),h>0)l=i.slice(e,h),a(o,l,e-1),c=Yi;else throw new Error("attribute value no end '"+p+"' match");else if(c==Xi)l=i.slice(e,h),a(o,l,e),n.warning('attribute "'+o+'" missed start quot('+p+")!!"),e=h+1,c=Yi;else throw new Error('attribute value must after "="');break;case"/":switch(c){case Xr:t.setTagName(i.slice(e,h));case Yi:case Qr:case an:c=an,t.closed=!0;case Xi:case _i:break;case Ki:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return n.error("unexpected end of input"),c==Xr&&t.setTagName(i.slice(e,h)),h;case">":switch(c){case Xr:t.setTagName(i.slice(e,h));case Yi:case Qr:case an:break;case Xi:case _i:l=i.slice(e,h),l.slice(-1)==="/"&&(t.closed=!0,l=l.slice(0,-1));case Ki:c===Ki&&(l=o),c==Xi?(n.warning('attribute "'+l+'" missed quot(")!'),a(o,l,e)):((!ys.isHTML(r[""])||!l.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+l+'" missed value!! "'+l+'" instead!!'),a(l,l,e));break;case Yr:throw new Error("attribute value missed!!")}return h;case"\x80":p=" ";default:if(p<=" ")switch(c){case Xr:t.setTagName(i.slice(e,h)),c=Qr;break;case _i:o=i.slice(e,h),c=Ki;break;case Xi:var l=i.slice(e,h);n.warning('attribute "'+l+'" missed quot(")!!'),a(o,l,e);case Yi:c=Qr;break}else switch(c){case Ki:t.tagName,(!ys.isHTML(r[""])||!o.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),a(o,o,e),e=h,c=_i;break;case Yi:n.warning('attribute space is required"'+o+'"!!');case Qr:c=_i,e=h;break;case Yr:c=Xi,e=h;break;case an:throw new Error("elements closed character '/' and '>' must be connected to")}}h++}}function Ql(i,e,t){for(var r=i.tagName,s=null,p=i.length;p--;){var n=i[p],a=n.qName,o=n.value,_=a.indexOf(":");if(_>0)var l=n.prefix=a.slice(0,_),h=a.slice(_+1),c=l==="xmlns"&&h;else h=a,l=null,c=a==="xmlns"&&"";n.localName=h,c!==!1&&(s==null&&(s={},Gc(t,t={})),t[c]=s[c]=o,n.uri=ys.XMLNS,e.startPrefixMapping(c,o))}for(var p=i.length;p--;){n=i[p];var l=n.prefix;l&&(l==="xml"&&(n.uri=ys.XML),l!=="xmlns"&&(n.uri=t[l||""]))}var _=r.indexOf(":");_>0?(l=i.prefix=r.slice(0,_),h=i.localName=r.slice(_+1)):(l=null,h=i.localName=r);var E=i.uri=t[l||""];if(e.startElement(E,h,r,i),i.closed){if(e.endElement(E,h,r),s)for(l in s)Object.prototype.hasOwnProperty.call(s,l)&&e.endPrefixMapping(l)}else return i.currentNSMap=t,i.localNSMap=s,!0}function Kg(i,e,t,r,s){if(/^(?:script|textarea)$/i.test(t)){var n=i.indexOf("</"+t+">",e),a=i.substring(e+1,n);if(/[&<]/.test(a))return/^script$/i.test(t)?(s.characters(a,0,a.length),n):(a=a.replace(/&#?\w+;/g,r),s.characters(a,0,a.length),n)}return e+1}function Xg(i,e,t,r){var s=r[t];return s==null&&(s=i.lastIndexOf("</"+t+">"),s<e&&(s=i.lastIndexOf("</"+t)),r[t]=s),s<e}function Gc(i,e){for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t])}function Yg(i,e,t,r){var s=i.charAt(e+2);switch(s){case"-":if(i.charAt(e+3)==="-"){var n=i.indexOf("-->",e+4);return n>e?(t.comment(i,e+4,n-e-4),n+3):(r.error("Unclosed comment"),-1)}else return-1;default:if(i.substr(e+3,6)=="CDATA["){var n=i.indexOf("]]>",e+9);return t.startCDATA(),t.characters(i,e+9,n-e-9),t.endCDATA(),n+3}var a=Jg(i,e),o=a.length;if(o>1&&/!doctype/i.test(a[0][0])){var l=a[1][0],h=!1,c=!1;o>3&&(/^public$/i.test(a[2][0])?(h=a[3][0],c=o>4&&a[4][0]):/^system$/i.test(a[2][0])&&(c=a[3][0]));var p=a[o-1];return t.startDTD(l,h,c),t.endDTD(),p.index+p[0].length}}return-1}function Qg(i,e,t){var r=i.indexOf("?>",e);if(r){var s=i.substring(e,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return s?(s[0].length,t.processingInstruction(s[1],s[2]),r+2):-1}return-1}function qc(){this.attributeNames={}}qc.prototype={setTagName:function(i){if(!Xl.test(i))throw new Error("invalid tagName:"+i);this.tagName=i},addValue:function(i,e,t){if(!Xl.test(i))throw new Error("invalid attribute:"+i);this.attributeNames[i]=this.length,this[this.length++]={qName:i,value:e,offset:t}},length:0,getLocalName:function(i){return this[i].localName},getLocator:function(i){return this[i].locator},getQName:function(i){return this[i].qName},getURI:function(i){return this[i].uri},getValue:function(i){return this[i].value}};function Jg(i,e){var t,r=[],s=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(s.lastIndex=e,s.exec(i);t=s.exec(i);)if(r.push(t),t[1])return r}Ko.XMLReader=Hc;Ko.ParseError=pr;var Zg=fi,e_=bi,Jl=$c,Wc=Ko,t_=e_.DOMImplementation,Zl=Zg.NAMESPACE,i_=Wc.ParseError,r_=Wc.XMLReader;function zc(i){return i.replace(/\r[\n\u0085]/g,`
`).replace(/[\r\u0085\u2028]/g,`
`)}function Kc(i){this.options=i||{locator:{}}}Kc.prototype.parseFromString=function(i,e){var t=this.options,r=new r_,s=t.domBuilder||new Ds,n=t.errorHandler,a=t.locator,o=t.xmlns||{},l=/\/x?html?$/.test(e),h=l?Jl.HTML_ENTITIES:Jl.XML_ENTITIES;a&&s.setDocumentLocator(a),r.errorHandler=s_(n,s,a),r.domBuilder=t.domBuilder||s,l&&(o[""]=Zl.HTML),o.xml=o.xml||Zl.XML;var c=t.normalizeLineEndings||zc;return i&&typeof i=="string"?r.parse(c(i),o,h):r.errorHandler.error("invalid doc source"),s.doc};function s_(i,e,t){if(!i){if(e instanceof Ds)return e;i=e}var r={},s=i instanceof Function;t=t||{};function n(a){var o=i[a];!o&&s&&(o=i.length==2?function(l){i(a,l)}:i),r[a]=o&&function(l){o("[xmldom "+a+"] "+l+ao(t))}||function(){}}return n("warning"),n("error"),n("fatalError"),r}function Ds(){this.cdata=!1}function Qi(i,e){e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber}Ds.prototype={startDocument:function(){this.doc=new t_().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(i,e,t,r){var s=this.doc,n=s.createElementNS(i,t||e),a=r.length;on(this,n),this.currentElement=n,this.locator&&Qi(this.locator,n);for(var o=0;o<a;o++){var i=r.getURI(o),l=r.getValue(o),t=r.getQName(o),h=s.createAttributeNS(i,t);this.locator&&Qi(r.getLocator(o),h),h.value=h.nodeValue=l,n.setAttributeNode(h)}},endElement:function(i,e,t){var r=this.currentElement;r.tagName,this.currentElement=r.parentNode},startPrefixMapping:function(i,e){},endPrefixMapping:function(i){},processingInstruction:function(i,e){var t=this.doc.createProcessingInstruction(i,e);this.locator&&Qi(this.locator,t),on(this,t)},ignorableWhitespace:function(i,e,t){},characters:function(i,e,t){if(i=ed.apply(this,arguments),i){if(this.cdata)var r=this.doc.createCDATASection(i);else var r=this.doc.createTextNode(i);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(i)&&this.doc.appendChild(r),this.locator&&Qi(this.locator,r)}},skippedEntity:function(i){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(i){(this.locator=i)&&(i.lineNumber=0)},comment:function(i,e,t){i=ed.apply(this,arguments);var r=this.doc.createComment(i);this.locator&&Qi(this.locator,r),on(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(i,e,t){var r=this.doc.implementation;if(r&&r.createDocumentType){var s=r.createDocumentType(i,e,t);this.locator&&Qi(this.locator,s),on(this,s),this.doc.doctype=s}},warning:function(i){console.warn("[xmldom warning] "+i,ao(this.locator))},error:function(i){console.error("[xmldom error] "+i,ao(this.locator))},fatalError:function(i){throw new i_(i,this.locator)}};function ao(i){if(i)return`
@`+(i.systemId||"")+"#[line:"+i.lineNumber+",col:"+i.columnNumber+"]"}function ed(i,e,t){return typeof i=="string"?i.substr(e,t):i.length>=e+t||e?new java.lang.String(i,e,t)+"":i}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(i){Ds.prototype[i]=function(){return null}});function on(i,e){i.currentElement?i.currentElement.appendChild(e):i.doc.appendChild(e)}Yn.__DOMHandler=Ds;Yn.normalizeLineEndings=zc;Yn.DOMParser=Kc;var n_=Yn.DOMParser;/*! @name mpd-parser @version 1.2.2 @license Apache-2.0 */const td=i=>!!i&&typeof i=="object",qe=(...i)=>i.reduce((e,t)=>(typeof t!="object"||Object.keys(t).forEach(r=>{Array.isArray(e[r])&&Array.isArray(t[r])?e[r]=e[r].concat(t[r]):td(e[r])&&td(t[r])?e[r]=qe(e[r],t[r]):e[r]=t[r]}),e),{}),Xc=i=>Object.keys(i).map(e=>i[e]),a_=(i,e)=>{const t=[];for(let r=i;r<e;r++)t.push(r);return t},mr=i=>i.reduce((e,t)=>e.concat(t),[]),Yc=i=>{if(!i.length)return[];const e=[];for(let t=0;t<i.length;t++)e.push(i[t]);return e},o_=(i,e)=>i.reduce((t,r,s)=>(r[e]&&t.push(s),t),[]),u_=(i,e)=>Xc(i.reduce((t,r)=>(r.forEach(s=>{t[e(s)]=s}),t),{}));var gr={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",INVALID_NUMBER_OF_CONTENT_STEERING:"INVALID_NUMBER_OF_CONTENT_STEERING",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const Ts=({baseUrl:i="",source:e="",range:t="",indexRange:r=""})=>{const s={uri:e,resolvedUri:Fo(i||"",e)};if(t||r){const a=(t||r).split("-");let o=R.BigInt?R.BigInt(a[0]):parseInt(a[0],10),l=R.BigInt?R.BigInt(a[1]):parseInt(a[1],10);o<Number.MAX_SAFE_INTEGER&&typeof o=="bigint"&&(o=Number(o)),l<Number.MAX_SAFE_INTEGER&&typeof l=="bigint"&&(l=Number(l));let h;typeof l=="bigint"||typeof o=="bigint"?h=R.BigInt(l)-R.BigInt(o)+R.BigInt(1):h=l-o+1,typeof h=="bigint"&&h<Number.MAX_SAFE_INTEGER&&(h=Number(h)),s.byterange={length:h,offset:o}}return s},l_=i=>{let e;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=R.BigInt(i.offset)+R.BigInt(i.length)-R.BigInt(1):e=i.offset+i.length-1,`${i.offset}-${e}`},id=i=>(i&&typeof i!="number"&&(i=parseInt(i,10)),isNaN(i)?null:i),d_={static(i){const{duration:e,timescale:t=1,sourceDuration:r,periodDuration:s}=i,n=id(i.endNumber),a=e/t;return typeof n=="number"?{start:0,end:n}:typeof s=="number"?{start:0,end:s/a}:{start:0,end:r/a}},dynamic(i){const{NOW:e,clientOffset:t,availabilityStartTime:r,timescale:s=1,duration:n,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=1/0}=i,h=id(i.endNumber),c=(e+t)/1e3,p=r+a,E=c+o-p,g=Math.ceil(E*s/n),b=Math.floor((c-p-l)*s/n),C=Math.floor((c-p)*s/n);return{start:Math.max(0,b),end:typeof h=="number"?h:Math.min(g,C)}}},c_=i=>e=>{const{duration:t,timescale:r=1,periodStart:s,startNumber:n=1}=i;return{number:n+e,duration:t/r,timeline:s,time:e*t}},Xo=i=>{const{type:e,duration:t,timescale:r=1,periodDuration:s,sourceDuration:n}=i,{start:a,end:o}=d_[e](i),l=a_(a,o).map(c_(i));if(e==="static"){const h=l.length-1,c=typeof s=="number"?s:n;l[h].duration=c-t/r*h}return l},Qc=i=>{const{baseUrl:e,initialization:t={},sourceDuration:r,indexRange:s="",periodStart:n,presentationTime:a,number:o=0,duration:l}=i;if(!e)throw new Error(gr.NO_BASE_URL);const h=Ts({baseUrl:e,source:t.sourceURL,range:t.range}),c=Ts({baseUrl:e,source:e,indexRange:s});if(c.map=h,l){const p=Xo(i);p.length&&(c.duration=p[0].duration,c.timeline=p[0].timeline)}else r&&(c.duration=r,c.timeline=n);return c.presentationTime=a||n,c.number=o,[c]},Yo=(i,e,t)=>{const r=i.sidx.map?i.sidx.map:null,s=i.sidx.duration,n=i.timeline||0,a=i.sidx.byterange,o=a.offset+a.length,l=e.timescale,h=e.references.filter(C=>C.referenceType!==1),c=[],p=i.endList?"static":"dynamic",_=i.sidx.timeline;let E=_,g=i.mediaSequence||0,b;typeof e.firstOffset=="bigint"?b=R.BigInt(o)+e.firstOffset:b=o+e.firstOffset;for(let C=0;C<h.length;C++){const x=e.references[C],y=x.referencedSize,D=x.subsegmentDuration;let S;typeof b=="bigint"?S=b+R.BigInt(y)-R.BigInt(1):S=b+y-1;const v=`${b}-${S}`,L=Qc({baseUrl:t,timescale:l,timeline:n,periodStart:_,presentationTime:E,number:g,duration:D,sourceDuration:s,indexRange:v,type:p})[0];r&&(L.map=r),c.push(L),typeof b=="bigint"?b+=R.BigInt(y):b+=y,E+=D/l,g++}return i.segments=c,i},h_=["AUDIO","SUBTITLES"],f_=1/60,Jc=i=>u_(i,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),p_=(i,e)=>{for(let t=0;t<i.length;t++)if(i[t].attributes.NAME===e)return i[t];return null},rd=i=>{let e=[];return kg(i,h_,(t,r,s,n)=>{e=e.concat(t.playlists||[])}),e},sd=({playlist:i,mediaSequence:e})=>{i.mediaSequence=e,i.segments.forEach((t,r)=>{t.number=i.mediaSequence+r})},m_=({oldPlaylists:i,newPlaylists:e,timelineStarts:t})=>{e.forEach(r=>{r.discontinuitySequence=t.findIndex(function({timeline:l}){return l===r.timeline});const s=p_(i,r.attributes.NAME);if(!s||r.sidx)return;const n=r.segments[0],a=s.segments.findIndex(function(l){return Math.abs(l.presentationTime-n.presentationTime)<f_});if(a===-1){sd({playlist:r,mediaSequence:s.mediaSequence+s.segments.length}),r.segments[0].discontinuity=!0,r.discontinuityStarts.unshift(0),(!s.segments.length&&r.timeline>s.timeline||s.segments.length&&r.timeline>s.segments[s.segments.length-1].timeline)&&r.discontinuitySequence--;return}s.segments[a].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,r.discontinuityStarts.unshift(0),r.discontinuitySequence--),sd({playlist:r,mediaSequence:s.segments[a].number})})},g_=({oldManifest:i,newManifest:e})=>{const t=i.playlists.concat(rd(i)),r=e.playlists.concat(rd(e));return e.timelineStarts=Jc([i.timelineStarts,e.timelineStarts]),m_({oldPlaylists:t,newPlaylists:r,timelineStarts:e.timelineStarts}),e},Qn=i=>i&&i.uri+"-"+l_(i.byterange),Va=i=>{const e=i.reduce(function(r,s){return r[s.attributes.baseUrl]||(r[s.attributes.baseUrl]=[]),r[s.attributes.baseUrl].push(s),r},{});let t=[];return Object.values(e).forEach(r=>{const s=Xc(r.reduce((n,a)=>{const o=a.attributes.id+(a.attributes.lang||"");return n[o]?(a.segments&&(a.segments[0]&&(a.segments[0].discontinuity=!0),n[o].segments.push(...a.segments)),a.attributes.contentProtection&&(n[o].attributes.contentProtection=a.attributes.contentProtection)):(n[o]=a,n[o].attributes.timelineStarts=[]),n[o].attributes.timelineStarts.push({start:a.attributes.periodStart,timeline:a.attributes.periodStart}),n},{}));t=t.concat(s)}),t.map(r=>(r.discontinuityStarts=o_(r.segments||[],"discontinuity"),r))},Qo=(i,e)=>{const t=Qn(i.sidx),r=t&&e[t]&&e[t].sidx;return r&&Yo(i,r,i.sidx.resolvedUri),i},__=(i,e={})=>{if(!Object.keys(e).length)return i;for(const t in i)i[t]=Qo(i[t],e);return i},v_=({attributes:i,segments:e,sidx:t,mediaSequence:r,discontinuitySequence:s,discontinuityStarts:n},a)=>{const o={attributes:{NAME:i.id,BANDWIDTH:i.bandwidth,CODECS:i.codecs,["PROGRAM-ID"]:1},uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuitySequence:s,discontinuityStarts:n,timelineStarts:i.timelineStarts,mediaSequence:r,segments:e};return i.contentProtection&&(o.contentProtection=i.contentProtection),i.serviceLocation&&(o.attributes.serviceLocation=i.serviceLocation),t&&(o.sidx=t),a&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o},y_=({attributes:i,segments:e,mediaSequence:t,discontinuityStarts:r,discontinuitySequence:s})=>{typeof e=="undefined"&&(e=[{uri:i.baseUrl,timeline:i.periodStart,resolvedUri:i.baseUrl||"",duration:i.sourceDuration,number:0}],i.duration=i.sourceDuration);const n={NAME:i.id,BANDWIDTH:i.bandwidth,["PROGRAM-ID"]:1};i.codecs&&(n.CODECS=i.codecs);const a={attributes:n,uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,timelineStarts:i.timelineStarts,discontinuityStarts:r,discontinuitySequence:s,mediaSequence:t,segments:e};return i.serviceLocation&&(a.attributes.serviceLocation=i.serviceLocation),a},T_=(i,e={},t=!1)=>{let r;const s=i.reduce((n,a)=>{const o=a.attributes.role&&a.attributes.role.value||"",l=a.attributes.lang||"";let h=a.attributes.label||"main";if(l&&!a.attributes.label){const p=o?` (${o})`:"";h=`${a.attributes.lang}${p}`}n[h]||(n[h]={language:l,autoselect:!0,default:o==="main",playlists:[],uri:""});const c=Qo(v_(a,t),e);return n[h].playlists.push(c),typeof r=="undefined"&&o==="main"&&(r=a,r.default=!0),n},{});if(!r){const n=Object.keys(s)[0];s[n].default=!0}return s},x_=(i,e={})=>i.reduce((t,r)=>{const s=r.attributes.label||r.attributes.lang||"text";return t[s]||(t[s]={language:s,default:!1,autoselect:!1,playlists:[],uri:""}),t[s].playlists.push(Qo(y_(r),e)),t},{}),b_=i=>i.reduce((e,t)=>(t&&t.forEach(r=>{const{channel:s,language:n}=r;e[n]={autoselect:!1,default:!1,instreamId:s,language:n},r.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=r.aspectRatio),r.hasOwnProperty("easyReader")&&(e[n].easyReader=r.easyReader),r.hasOwnProperty("3D")&&(e[n]["3D"]=r["3D"])}),e),{}),E_=({attributes:i,segments:e,sidx:t,discontinuityStarts:r})=>{const s={attributes:{NAME:i.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:i.width,height:i.height},CODECS:i.codecs,BANDWIDTH:i.bandwidth,["PROGRAM-ID"]:1},uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuityStarts:r,timelineStarts:i.timelineStarts,segments:e};return i.frameRate&&(s.attributes["FRAME-RATE"]=i.frameRate),i.contentProtection&&(s.contentProtection=i.contentProtection),i.serviceLocation&&(s.attributes.serviceLocation=i.serviceLocation),t&&(s.sidx=t),s},S_=({attributes:i})=>i.mimeType==="video/mp4"||i.mimeType==="video/webm"||i.contentType==="video",C_=({attributes:i})=>i.mimeType==="audio/mp4"||i.mimeType==="audio/webm"||i.contentType==="audio",A_=({attributes:i})=>i.mimeType==="text/vtt"||i.contentType==="text",D_=(i,e)=>{i.forEach(t=>{t.mediaSequence=0,t.discontinuitySequence=e.findIndex(function({timeline:r}){return r===t.timeline}),t.segments&&t.segments.forEach((r,s)=>{r.number=s})})},nd=i=>i?Object.keys(i).reduce((e,t)=>{const r=i[t];return e.concat(r.playlists)},[]):[],w_=({dashPlaylists:i,locations:e,contentSteering:t,sidxMapping:r={},previousManifest:s,eventStream:n})=>{if(!i.length)return{};const{sourceDuration:a,type:o,suggestedPresentationDelay:l,minimumUpdatePeriod:h}=i[0].attributes,c=Va(i.filter(S_)).map(E_),p=Va(i.filter(C_)),_=Va(i.filter(A_)),E=i.map(S=>S.attributes.captionServices).filter(Boolean),g={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},["CLOSED-CAPTIONS"]:{},SUBTITLES:{}},uri:"",duration:a,playlists:__(c,r)};h>=0&&(g.minimumUpdatePeriod=h*1e3),e&&(g.locations=e),t&&(g.contentSteering=t),o==="dynamic"&&(g.suggestedPresentationDelay=l),n&&n.length>0&&(g.eventStream=n);const b=g.playlists.length===0,C=p.length?T_(p,r,b):null,x=_.length?x_(_,r):null,y=c.concat(nd(C),nd(x)),D=y.map(({timelineStarts:S})=>S);return g.timelineStarts=Jc(D),D_(y,g.timelineStarts),C&&(g.mediaGroups.AUDIO.audio=C),x&&(g.mediaGroups.SUBTITLES.subs=x),E.length&&(g.mediaGroups["CLOSED-CAPTIONS"].cc=b_(E)),s?g_({oldManifest:s,newManifest:g}):g},L_=(i,e,t)=>{const{NOW:r,clientOffset:s,availabilityStartTime:n,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:l=0}=i,h=(r+s)/1e3,c=n+o,_=h+l-c;return Math.ceil((_*a-e)/t)},Zc=(i,e)=>{const{type:t,minimumUpdatePeriod:r=0,media:s="",sourceDuration:n,timescale:a=1,startNumber:o=1,periodStart:l}=i,h=[];let c=-1;for(let p=0;p<e.length;p++){const _=e[p],E=_.d,g=_.r||0,b=_.t||0;c<0&&(c=b),b&&b>c&&(c=b);let C;if(g<0){const D=p+1;D===e.length?t==="dynamic"&&r>0&&s.indexOf("$Number$")>0?C=L_(i,c,E):C=(n*a-c)/E:C=(e[D].t-c)/E}else C=g+1;const x=o+h.length+C;let y=o+h.length;for(;y<x;)h.push({number:y,duration:E/a,time:c,timeline:l}),c+=E,y++}return h},I_=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,k_=i=>(e,t,r,s)=>{if(e==="$$")return"$";if(typeof i[t]=="undefined")return e;const n=""+i[t];return t==="RepresentationID"||(r?s=parseInt(s,10):s=1,n.length>=s)?n:`${new Array(s-n.length+1).join("0")}${n}`},ad=(i,e)=>i.replace(I_,k_(e)),O_=(i,e)=>!i.duration&&!e?[{number:i.startNumber||1,duration:i.sourceDuration,time:0,timeline:i.periodStart}]:i.duration?Xo(i):Zc(i,e),P_=(i,e)=>{const t={RepresentationID:i.id,Bandwidth:i.bandwidth||0},{initialization:r={sourceURL:"",range:""}}=i,s=Ts({baseUrl:i.baseUrl,source:ad(r.sourceURL,t),range:r.range});return O_(i,e).map(a=>{t.Number=a.number,t.Time=a.time;const o=ad(i.media||"",t),l=i.timescale||1,h=i.presentationTimeOffset||0,c=i.periodStart+(a.time-h)/l;return{uri:o,timeline:a.timeline,duration:a.duration,resolvedUri:Fo(i.baseUrl||"",o),map:s,number:a.number,presentationTime:c}})},R_=(i,e)=>{const{baseUrl:t,initialization:r={}}=i,s=Ts({baseUrl:t,source:r.sourceURL,range:r.range}),n=Ts({baseUrl:t,source:e.media,range:e.mediaRange});return n.map=s,n},M_=(i,e)=>{const{duration:t,segmentUrls:r=[],periodStart:s}=i;if(!t&&!e||t&&e)throw new Error(gr.SEGMENT_TIME_UNSPECIFIED);const n=r.map(l=>R_(i,l));let a;return t&&(a=Xo(i)),e&&(a=Zc(i,e)),a.map((l,h)=>{if(n[h]){const c=n[h],p=i.timescale||1,_=i.presentationTimeOffset||0;return c.timeline=l.timeline,c.duration=l.duration,c.number=l.number,c.presentationTime=s+(l.time-_)/p,c}}).filter(l=>l)},B_=({attributes:i,segmentInfo:e})=>{let t,r;e.template?(r=P_,t=qe(i,e.template)):e.base?(r=Qc,t=qe(i,e.base)):e.list&&(r=M_,t=qe(i,e.list));const s={attributes:i};if(!r)return s;const n=r(t,e.segmentTimeline);if(t.duration){const{duration:a,timescale:o=1}=t;t.duration=a/o}else n.length?t.duration=n.reduce((a,o)=>Math.max(a,Math.ceil(o.duration)),0):t.duration=0;return s.attributes=t,s.segments=n,e.base&&t.indexRange&&(s.sidx=n[0],s.segments=[]),s},N_=i=>i.map(B_),Pe=(i,e)=>Yc(i.childNodes).filter(({tagName:t})=>t===e),ws=i=>i.textContent.trim(),F_=i=>parseFloat(i.split("/").reduce((e,t)=>e/t)),Ji=i=>{const o=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(i);if(!o)return 0;const[l,h,c,p,_,E]=o.slice(1);return parseFloat(l||0)*31536e3+parseFloat(h||0)*2592e3+parseFloat(c||0)*86400+parseFloat(p||0)*3600+parseFloat(_||0)*60+parseFloat(E||0)},U_=i=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(i)&&(i+="Z"),Date.parse(i)),od={mediaPresentationDuration(i){return Ji(i)},availabilityStartTime(i){return U_(i)/1e3},minimumUpdatePeriod(i){return Ji(i)},suggestedPresentationDelay(i){return Ji(i)},type(i){return i},timeShiftBufferDepth(i){return Ji(i)},start(i){return Ji(i)},width(i){return parseInt(i,10)},height(i){return parseInt(i,10)},bandwidth(i){return parseInt(i,10)},frameRate(i){return F_(i)},startNumber(i){return parseInt(i,10)},timescale(i){return parseInt(i,10)},presentationTimeOffset(i){return parseInt(i,10)},duration(i){const e=parseInt(i,10);return isNaN(e)?Ji(i):e},d(i){return parseInt(i,10)},t(i){return parseInt(i,10)},r(i){return parseInt(i,10)},presentationTime(i){return parseInt(i,10)},DEFAULT(i){return i}},je=i=>i&&i.attributes?Yc(i.attributes).reduce((e,t)=>{const r=od[t.name]||od.DEFAULT;return e[t.name]=r(t.value),e},{}):{},j_={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},Jn=(i,e)=>e.length?mr(i.map(function(t){return e.map(function(r){const s=ws(r),n=Fo(t.baseUrl,s),a=qe(je(r),{baseUrl:n});return n!==s&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):i,Jo=i=>{const e=Pe(i,"SegmentTemplate")[0],t=Pe(i,"SegmentList")[0],r=t&&Pe(t,"SegmentURL").map(p=>qe({tag:"SegmentURL"},je(p))),s=Pe(i,"SegmentBase")[0],n=t||e,a=n&&Pe(n,"SegmentTimeline")[0],o=t||s||e,l=o&&Pe(o,"Initialization")[0],h=e&&je(e);h&&l?h.initialization=l&&je(l):h&&h.initialization&&(h.initialization={sourceURL:h.initialization});const c={template:h,segmentTimeline:a&&Pe(a,"S").map(p=>je(p)),list:t&&qe(je(t),{segmentUrls:r,initialization:je(l)}),base:s&&qe(je(s),{initialization:je(l)})};return Object.keys(c).forEach(p=>{c[p]||delete c[p]}),c},V_=(i,e,t)=>r=>{const s=Pe(r,"BaseURL"),n=Jn(e,s),a=qe(i,je(r)),o=Jo(r);return n.map(l=>({segmentInfo:qe(t,o),attributes:qe(a,l)}))},$_=i=>i.reduce((e,t)=>{const r=je(t);r.schemeIdUri&&(r.schemeIdUri=r.schemeIdUri.toLowerCase());const s=j_[r.schemeIdUri];if(s){e[s]={attributes:r};const n=Pe(t,"cenc:pssh")[0];if(n){const a=ws(n);e[s].pssh=a&&pc(a)}}return e},{}),H_=i=>{if(i.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{let r,s;return s=t,/^CC\d=/.test(t)?[r,s]=t.split("="):/^CC\d$/.test(t)&&(r=t),{channel:r,language:s}});if(i.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{const r={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(t)){const[s,n=""]=t.split("=");r.channel=s,r.language=t,n.split(",").forEach(a=>{const[o,l]=a.split(":");o==="lang"?r.language=l:o==="er"?r.easyReader=Number(l):o==="war"?r.aspectRatio=Number(l):o==="3D"&&(r["3D"]=Number(l))})}else r.language=t;return r.channel&&(r.channel="SERVICE"+r.channel),r})},G_=i=>mr(Pe(i.node,"EventStream").map(e=>{const t=je(e),r=t.schemeIdUri;return Pe(e,"Event").map(s=>{const n=je(s),a=n.presentationTime||0,o=t.timescale||1,l=n.duration||0,h=a/o+i.attributes.start;return{schemeIdUri:r,value:t.value,id:n.id,start:h,end:h+l/o,messageData:ws(s)||n.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),q_=(i,e,t)=>r=>{const s=je(r),n=Jn(e,Pe(r,"BaseURL")),a=Pe(r,"Role")[0],o={role:je(a)};let l=qe(i,s,o);const h=Pe(r,"Accessibility")[0],c=H_(je(h));c&&(l=qe(l,{captionServices:c}));const p=Pe(r,"Label")[0];if(p&&p.childNodes.length){const C=p.childNodes[0].nodeValue.trim();l=qe(l,{label:C})}const _=$_(Pe(r,"ContentProtection"));Object.keys(_).length&&(l=qe(l,{contentProtection:_}));const E=Jo(r),g=Pe(r,"Representation"),b=qe(t,E);return mr(g.map(V_(l,n,b)))},W_=(i,e)=>(t,r)=>{const s=Jn(e,Pe(t.node,"BaseURL")),n=qe(i,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(n.periodDuration=t.attributes.duration);const a=Pe(t.node,"AdaptationSet"),o=Jo(t.node);return mr(a.map(q_(n,s,o)))},z_=(i,e)=>{if(i.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!i.length)return null;const t=qe({serverURL:ws(i[0])},je(i[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},K_=({attributes:i,priorPeriodAttributes:e,mpdType:t})=>typeof i.start=="number"?i.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:!e&&t==="static"?0:null,X_=(i,e={})=>{const{manifestUri:t="",NOW:r=Date.now(),clientOffset:s=0,eventHandler:n=function(){}}=e,a=Pe(i,"Period");if(!a.length)throw new Error(gr.INVALID_NUMBER_OF_PERIOD);const o=Pe(i,"Location"),l=je(i),h=Jn([{baseUrl:t}],Pe(i,"BaseURL")),c=Pe(i,"ContentSteering");l.type=l.type||"static",l.sourceDuration=l.mediaPresentationDuration||0,l.NOW=r,l.clientOffset=s,o.length&&(l.locations=o.map(ws));const p=[];return a.forEach((_,E)=>{const g=je(_),b=p[E-1];g.start=K_({attributes:g,priorPeriodAttributes:b?b.attributes:null,mpdType:l.type}),p.push({node:_,attributes:g})}),{locations:l.locations,contentSteeringInfo:z_(c,n),representationInfo:mr(p.map(W_(l,h))),eventStream:mr(p.map(G_))}},eh=i=>{if(i==="")throw new Error(gr.DASH_EMPTY_MANIFEST);const e=new n_;let t,r;try{t=e.parseFromString(i,"application/xml"),r=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch(s){}if(!r||r&&r.getElementsByTagName("parsererror").length>0)throw new Error(gr.DASH_INVALID_XML);return r},Y_=i=>{const e=Pe(i,"UTCTiming")[0];if(!e)return null;const t=je(e);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(gr.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},Q_=(i,e={})=>{const t=X_(eh(i),e),r=N_(t.representationInfo);return w_({dashPlaylists:r,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},J_=i=>Y_(eh(i));var th=Math.pow(2,32),Z_=function(i){var e=new DataView(i.buffer,i.byteOffset,i.byteLength),t;return e.getBigUint64?(t=e.getBigUint64(0),t<Number.MAX_SAFE_INTEGER?Number(t):t):e.getUint32(0)*th+e.getUint32(4)},ev={getUint64:Z_,MAX_UINT32:th},ud=ev.getUint64,tv=function(i){var e=new DataView(i.buffer,i.byteOffset,i.byteLength),t={version:i[0],flags:new Uint8Array(i.subarray(1,4)),references:[],referenceId:e.getUint32(4),timescale:e.getUint32(8)},r=12;t.version===0?(t.earliestPresentationTime=e.getUint32(r),t.firstOffset=e.getUint32(r+4),r+=8):(t.earliestPresentationTime=ud(i.subarray(r)),t.firstOffset=ud(i.subarray(r+8)),r+=16),r+=2;var s=e.getUint16(r);for(r+=2;s>0;r+=12,s--)t.references.push({referenceType:(i[r]&128)>>>7,referencedSize:e.getUint32(r)&2147483647,subsegmentDuration:e.getUint32(r+4),startsWithSap:!!(i[r+8]&128),sapType:(i[r+8]&112)>>>4,sapDeltaTime:e.getUint32(r+8)&268435455});return t},iv=tv,rv=re([73,68,51]),sv=function(e,t){t===void 0&&(t=0),e=re(e);var r=e[t+5],s=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=(r&16)>>4;return n?s+20:s+10},as=function i(e,t){return t===void 0&&(t=0),e=re(e),e.length-t<10||!Oe(e,rv,{offset:t})?t:(t+=sv(e,t),i(e,t))},ld=function(e){return typeof e=="string"?yc(e):e},nv=function(e){return Array.isArray(e)?e.map(function(t){return ld(t)}):[ld(e)]},av=function i(e,t,r){r===void 0&&(r=!1),t=nv(t),e=re(e);var s=[];if(!t.length)return s;for(var n=0;n<e.length;){var a=(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3])>>>0,o=e.subarray(n+4,n+8);if(a===0)break;var l=n+a;if(l>e.length){if(r)break;l=e.length}var h=e.subarray(n+8,l);Oe(o,t[0])&&(t.length===1?s.push(h):s.push.apply(s,i(h,t.slice(1),r))),n=l}return s},un={EBML:re([26,69,223,163]),DocType:re([66,130]),Segment:re([24,83,128,103]),SegmentInfo:re([21,73,169,102]),Tracks:re([22,84,174,107]),Track:re([174]),TrackNumber:re([215]),DefaultDuration:re([35,227,131]),TrackEntry:re([174]),TrackType:re([131]),FlagDefault:re([136]),CodecID:re([134]),CodecPrivate:re([99,162]),VideoTrack:re([224]),AudioTrack:re([225]),Cluster:re([31,67,182,117]),Timestamp:re([231]),TimestampScale:re([42,215,177]),BlockGroup:re([160]),BlockDuration:re([155]),Block:re([161]),SimpleBlock:re([163])},oo=[128,64,32,16,8,4,2,1],ov=function(e){for(var t=1,r=0;r<oo.length&&!(e&oo[r]);r++)t++;return t},An=function(e,t,r,s){r===void 0&&(r=!0),s===void 0&&(s=!1);var n=ov(e[t]),a=e.subarray(t,t+n);return r&&(a=Array.prototype.slice.call(e,t,t+n),a[0]^=oo[n-1]),{length:n,value:wg(a,{signed:s}),bytes:a}},dd=function i(e){return typeof e=="string"?e.match(/.{1,2}/g).map(function(t){return i(t)}):typeof e=="number"?Lg(e):e},uv=function(e){return Array.isArray(e)?e.map(function(t){return dd(t)}):[dd(e)]},lv=function i(e,t,r){if(r>=t.length)return t.length;var s=An(t,r,!1);if(Oe(e.bytes,s.bytes))return r;var n=An(t,r+s.length);return i(e,t,r+n.length+n.value+s.length)},cd=function i(e,t){t=uv(t),e=re(e);var r=[];if(!t.length)return r;for(var s=0;s<e.length;){var n=An(e,s,!1),a=An(e,s+n.length),o=s+n.length+a.length;a.value===127&&(a.value=lv(n,e,o),a.value!==e.length&&(a.value-=o));var l=o+a.value>e.length?e.length:o+a.value,h=e.subarray(o,l);Oe(t[0],n.bytes)&&(t.length===1?r.push(h):r=r.concat(i(h,t.slice(1))));var c=n.length+a.length+h.length;s+=c}return r},dv=re([0,0,0,1]),cv=re([0,0,1]),hv=re([0,0,3]),fv=function(e){for(var t=[],r=1;r<e.length-2;)Oe(e.subarray(r,r+3),hv)&&(t.push(r+2),r++),r++;if(t.length===0)return e;var s=e.length-t.length,n=new Uint8Array(s),a=0;for(r=0;r<s;a++,r++)a===t[0]&&(a++,t.shift()),n[r]=e[a];return n},ih=function(e,t,r,s){s===void 0&&(s=1/0),e=re(e),r=[].concat(r);for(var n=0,a,o=0;n<e.length&&(o<s||a);){var l=void 0;if(Oe(e.subarray(n),dv)?l=4:Oe(e.subarray(n),cv)&&(l=3),!l){n++;continue}if(o++,a)return fv(e.subarray(a,n));var h=void 0;t==="h264"?h=e[n+l]&31:t==="h265"&&(h=e[n+l]>>1&63),r.indexOf(h)!==-1&&(a=n+l),n+=l+(t==="h264"?1:2)}return e.subarray(0,0)},pv=function(e,t,r){return ih(e,"h264",t,r)},mv=function(e,t,r){return ih(e,"h265",t,r)},it={webm:re([119,101,98,109]),matroska:re([109,97,116,114,111,115,107,97]),flac:re([102,76,97,67]),ogg:re([79,103,103,83]),ac3:re([11,119]),riff:re([82,73,70,70]),avi:re([65,86,73]),wav:re([87,65,86,69]),"3gp":re([102,116,121,112,51,103]),mp4:re([102,116,121,112]),fmp4:re([115,116,121,112]),mov:re([102,116,121,112,113,116]),moov:re([109,111,111,118]),moof:re([109,111,111,102])},_r={aac:function(e){var t=as(e);return Oe(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=as(e);return Oe(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=cd(e,[un.EBML,un.DocType])[0];return Oe(t,it.webm)},mkv:function(e){var t=cd(e,[un.EBML,un.DocType])[0];return Oe(t,it.matroska)},mp4:function(e){if(_r["3gp"](e)||_r.mov(e))return!1;if(Oe(e,it.mp4,{offset:4})||Oe(e,it.fmp4,{offset:4})||Oe(e,it.moof,{offset:4})||Oe(e,it.moov,{offset:4}))return!0},mov:function(e){return Oe(e,it.mov,{offset:4})},"3gp":function(e){return Oe(e,it["3gp"],{offset:4})},ac3:function(e){var t=as(e);return Oe(e,it.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var t=0;t+188<e.length&&t<188;){if(e[t]===71&&e[t+188]===71)return!0;t+=1}return!1},flac:function(e){var t=as(e);return Oe(e,it.flac,{offset:t})},ogg:function(e){return Oe(e,it.ogg)},avi:function(e){return Oe(e,it.riff)&&Oe(e,it.avi,{offset:8})},wav:function(e){return Oe(e,it.riff)&&Oe(e,it.wav,{offset:8})},h264:function(e){return pv(e,7,3).length},h265:function(e){return mv(e,[32,33],3).length}},uo=Object.keys(_r).filter(function(i){return i!=="ts"&&i!=="h264"&&i!=="h265"}).concat(["ts","h264","h265"]);uo.forEach(function(i){var e=_r[i];_r[i]=function(t){return e(re(t))}});var gv=_r,Zo=function(e){e=re(e);for(var t=0;t<uo.length;t++){var r=uo[t];if(gv[r](e))return r}return""},_v=function(e){return av(e,["moof"]).length>0},eu=9e4,tu,iu,Zn,ru,rh,sh,nh;tu=function(i){return i*eu};iu=function(i,e){return i*e};Zn=function(i){return i/eu};ru=function(i,e){return i/e};rh=function(i,e){return tu(ru(i,e))};sh=function(i,e){return iu(Zn(i),e)};nh=function(i,e,t){return Zn(t?i:i-e)};var Dn={ONE_SECOND_IN_TS:eu,secondsToVideoTs:tu,secondsToAudioTs:iu,videoTsToSeconds:Zn,audioTsToSeconds:ru,audioTsToVideoTs:rh,videoTsToAudioTs:sh,metadataTsToSeconds:nh};/**
* @license
* Video.js 8.6.0 <http://videojs.com/>
* Copyright Brightcove, Inc. <https://www.brightcove.com/>
* Available under Apache License Version 2.0
* <https://github.com/videojs/video.js/blob/main/LICENSE>
*
* Includes vtt.js <https://github.com/mozilla/vtt.js>
* Available under Apache License Version 2.0
* <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
*/var ah="8.6.0";const si={},yi=function(i,e){return si[i]=si[i]||[],e&&(si[i]=si[i].concat(e)),si[i]},vv=function(i,e){yi(i,e)},oh=function(i,e){const t=yi(i).indexOf(e);return t<=-1?!1:(si[i]=si[i].slice(),si[i].splice(t,1),!0)},yv=function(i,e){yi(i,[].concat(e).map(t=>{const r=(...s)=>(oh(i,r),t(...s));return r}))},wn={prefixed:!0},mn=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],hd=mn[0];let os;for(let i=0;i<mn.length;i++)if(mn[i][1]in J){os=mn[i];break}if(os){for(let i=0;i<os.length;i++)wn[hd[i]]=os[i];wn.prefixed=os[0]!==hd[0]}let dt=[];const Tv=(i,e,t)=>(r,s,n)=>{const a=e.levels[s],o=new RegExp(`^(${a})$`);let l=i;if(r!=="log"&&n.unshift(r.toUpperCase()+":"),t&&(l=`%c${i}`,n.unshift(t)),n.unshift(l+":"),dt){dt.push([].concat(n));const c=dt.length-1e3;dt.splice(0,c>0?c:0)}if(!R.console)return;let h=R.console[r];!h&&r==="debug"&&(h=R.console.info||R.console.log),!(!h||!a||!o.test(r))&&h[Array.isArray(n)?"apply":"call"](R.console,n)};function lo(i,e=":",t=""){let r="info",s;const n=function(...a){s("log",r,a)};return s=Tv(i,n,t),n.createLogger=(a,o,l)=>{const h=o!==void 0?o:e,c=l!==void 0?l:t,p=`${i} ${h} ${a}`;return lo(p,h,c)},n.createNewLogger=(a,o,l)=>lo(a,o,l),n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:r},n.level=a=>{if(typeof a=="string"){if(!n.levels.hasOwnProperty(a))throw new Error(`"${a}" in not a valid log level`);r=a}return r},n.history=()=>dt?[].concat(dt):[],n.history.filter=a=>(dt||[]).filter(o=>new RegExp(`.*${a}.*`).test(o[0])),n.history.clear=()=>{dt&&(dt.length=0)},n.history.disable=()=>{dt!==null&&(dt.length=0,dt=null)},n.history.enable=()=>{dt===null&&(dt=[])},n.error=(...a)=>s("error",r,a),n.warn=(...a)=>s("warn",r,a),n.debug=(...a)=>s("debug",r,a),n}const ye=lo("VIDEOJS"),uh=ye.createLogger,xv=Object.prototype.toString,lh=function(i){return Xt(i)?Object.keys(i):[]};function ar(i,e){lh(i).forEach(t=>e(i[t],t))}function dh(i,e,t=0){return lh(i).reduce((r,s)=>e(r,i[s],s),t)}function Xt(i){return!!i&&typeof i=="object"}function vr(i){return Xt(i)&&xv.call(i)==="[object Object]"&&i.constructor===Object}function we(...i){const e={};return i.forEach(t=>{!t||ar(t,(r,s)=>{if(!vr(r)){e[s]=r;return}vr(e[s])||(e[s]={}),e[s]=we(e[s],r)})}),e}function ch(i={}){const e=[];for(const t in i)if(i.hasOwnProperty(t)){const r=i[t];e.push(r)}return e}function ea(i,e,t,r=!0){const s=a=>Object.defineProperty(i,e,{value:a,enumerable:!0,writable:!0}),n={configurable:!0,enumerable:!0,get(){const a=t();return s(a),a}};return r&&(n.set=s),Object.defineProperty(i,e,n)}var bv=Object.freeze({__proto__:null,each:ar,reduce:dh,isObject:Xt,isPlain:vr,merge:we,values:ch,defineLazyProperty:ea});let su=!1,hh=null,Yt=!1,fh,ph=!1,or=!1,ur=!1,Qt=!1,nu=null,ta=null,mh=null,Ln=!1,ia=!1,In=!1,ra=!1;const xs=Boolean(Cr()&&("ontouchstart"in R||R.navigator.maxTouchPoints||R.DocumentTouch&&R.document instanceof R.DocumentTouch)),Zi=R.navigator&&R.navigator.userAgentData;Zi&&(Yt=Zi.platform==="Android",or=Boolean(Zi.brands.find(i=>i.brand==="Microsoft Edge")),ur=Boolean(Zi.brands.find(i=>i.brand==="Chromium")),Qt=!or&&ur,nu=ta=(Zi.brands.find(i=>i.brand==="Chromium")||{}).version||null,ia=Zi.platform==="Windows");if(!ur){const i=R.navigator&&R.navigator.userAgent||"";su=/iPod/i.test(i),hh=function(){const e=i.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),Yt=/Android/i.test(i),fh=function(){const e=i.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),r=e[2]&&parseFloat(e[2]);return t&&r?parseFloat(e[1]+"."+e[2]):t||null}(),ph=/Firefox/i.test(i),or=/Edg/i.test(i),ur=/Chrome/i.test(i)||/CriOS/i.test(i),Qt=!or&&ur,nu=ta=function(){const e=i.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),mh=function(){const e=/MSIE\s(\d+)\.\d/.exec(i);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(i)&&/rv:11.0/.test(i)&&(t=11),t}(),Ln=/Safari/i.test(i)&&!Qt&&!Yt&&!or,ia=/Windows/i.test(i),In=/iPad/i.test(i)||Ln&&xs&&!/iPhone/i.test(i),ra=/iPhone/i.test(i)&&!In}const ot=ra||In||su,sa=(Ln||ot)&&!Qt;var Ev=Object.freeze({__proto__:null,get IS_IPOD(){return su},get IOS_VERSION(){return hh},get IS_ANDROID(){return Yt},get ANDROID_VERSION(){return fh},get IS_FIREFOX(){return ph},get IS_EDGE(){return or},get IS_CHROMIUM(){return ur},get IS_CHROME(){return Qt},get CHROMIUM_VERSION(){return nu},get CHROME_VERSION(){return ta},get IE_VERSION(){return mh},get IS_SAFARI(){return Ln},get IS_WINDOWS(){return ia},get IS_IPAD(){return In},get IS_IPHONE(){return ra},TOUCH_ENABLED:xs,IS_IOS:ot,IS_ANY_SAFARI:sa});function fd(i){return typeof i=="string"&&Boolean(i.trim())}function Sv(i){if(i.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function Cr(){return J===R.document}function Ar(i){return Xt(i)&&i.nodeType===1}function gh(){try{return R.parent!==R.self}catch(i){return!0}}function _h(i){return function(e,t){if(!fd(e))return J[i](null);fd(t)&&(t=J.querySelector(t));const r=Ar(t)?t:J;return r[i]&&r[i](e)}}function me(i="div",e={},t={},r){const s=J.createElement(i);return Object.getOwnPropertyNames(e).forEach(function(n){const a=e[n];n==="textContent"?Ei(s,a):(s[n]!==a||n==="tabIndex")&&(s[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){s.setAttribute(n,t[n])}),r&&au(s,r),s}function Ei(i,e){return typeof i.textContent=="undefined"?i.innerText=e:i.textContent=e,i}function co(i,e){e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i)}function ds(i,e){return Sv(e),i.classList.contains(e)}function Ni(i,...e){return i.classList.add(...e.reduce((t,r)=>t.concat(r.split(/\s+/)),[])),i}function na(i,...e){return i?(i.classList.remove(...e.reduce((t,r)=>t.concat(r.split(/\s+/)),[])),i):(ye.warn("removeClass was called with an element that doesn't exist"),null)}function vh(i,e,t){return typeof t=="function"&&(t=t(i,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEach(r=>i.classList.toggle(r,t)),i}function yh(i,e){Object.getOwnPropertyNames(e).forEach(function(t){const r=e[t];r===null||typeof r=="undefined"||r===!1?i.removeAttribute(t):i.setAttribute(t,r===!0?"":r)})}function vi(i){const e={},t=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(i&&i.attributes&&i.attributes.length>0){const r=i.attributes;for(let s=r.length-1;s>=0;s--){const n=r[s].name;let a=r[s].value;t.includes(n)&&(a=a!==null),e[n]=a}}return e}function Th(i,e){return i.getAttribute(e)}function yr(i,e,t){i.setAttribute(e,t)}function aa(i,e){i.removeAttribute(e)}function xh(){J.body.focus(),J.onselectstart=function(){return!1}}function bh(){J.onselectstart=function(){return!0}}function Tr(i){if(i&&i.getBoundingClientRect&&i.parentNode){const e=i.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(r=>{e[r]!==void 0&&(t[r]=e[r])}),t.height||(t.height=parseFloat(xr(i,"height"))),t.width||(t.width=parseFloat(xr(i,"width"))),t}}function bs(i){if(!i||i&&!i.offsetParent)return{left:0,top:0,width:0,height:0};const e=i.offsetWidth,t=i.offsetHeight;let r=0,s=0;for(;i.offsetParent&&i!==J[wn.fullscreenElement];)r+=i.offsetLeft,s+=i.offsetTop,i=i.offsetParent;return{left:r,top:s,width:e,height:t}}function oa(i,e){const t={x:0,y:0};if(ot){let c=i;for(;c&&c.nodeName.toLowerCase()!=="html";){const p=xr(c,"transform");if(/^matrix/.test(p)){const _=p.slice(7,-1).split(/,\s/).map(Number);t.x+=_[4],t.y+=_[5]}else if(/^matrix3d/.test(p)){const _=p.slice(9,-1).split(/,\s/).map(Number);t.x+=_[12],t.y+=_[13]}c=c.parentNode}}const r={},s=bs(e.target),n=bs(i),a=n.width,o=n.height;let l=e.offsetY-(n.top-s.top),h=e.offsetX-(n.left-s.left);return e.changedTouches&&(h=e.changedTouches[0].pageX-n.left,l=e.changedTouches[0].pageY+n.top,ot&&(h-=t.x,l-=t.y)),r.y=1-Math.max(0,Math.min(1,l/o)),r.x=Math.max(0,Math.min(1,h/a)),r}function Eh(i){return Xt(i)&&i.nodeType===3}function ua(i){for(;i.firstChild;)i.removeChild(i.firstChild);return i}function Sh(i){return typeof i=="function"&&(i=i()),(Array.isArray(i)?i:[i]).map(e=>{if(typeof e=="function"&&(e=e()),Ar(e)||Eh(e))return e;if(typeof e=="string"&&/\S/.test(e))return J.createTextNode(e)}).filter(e=>e)}function au(i,e){return Sh(e).forEach(t=>i.appendChild(t)),i}function Ch(i,e){return au(ua(i),e)}function Es(i){return i.button===void 0&&i.buttons===void 0||i.button===0&&i.buttons===void 0||i.type==="mouseup"&&i.button===0&&i.buttons===0?!0:!(i.button!==0||i.buttons!==1)}const Ti=_h("querySelector"),Ah=_h("querySelectorAll");function xr(i,e){if(!i||!e)return"";if(typeof R.getComputedStyle=="function"){let t;try{t=R.getComputedStyle(i)}catch(r){return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function Dh(i){[...J.styleSheets].forEach(e=>{try{const t=[...e.cssRules].map(s=>s.cssText).join(""),r=J.createElement("style");r.textContent=t,i.document.head.appendChild(r)}catch(t){const r=J.createElement("link");r.rel="stylesheet",r.type=e.type,r.media=e.media.mediaText,r.href=e.href,i.document.head.appendChild(r)}})}var wh=Object.freeze({__proto__:null,isReal:Cr,isEl:Ar,isInFrame:gh,createEl:me,textContent:Ei,prependTo:co,hasClass:ds,addClass:Ni,removeClass:na,toggleClass:vh,setAttributes:yh,getAttributes:vi,getAttribute:Th,setAttribute:yr,removeAttribute:aa,blockTextSelection:xh,unblockTextSelection:bh,getBoundingClientRect:Tr,findPosition:bs,getPointerPosition:oa,isTextNode:Eh,emptyEl:ua,normalizeContent:Sh,appendContent:au,insertContent:Ch,isSingleLeftClick:Es,$:Ti,$$:Ah,computedStyle:xr,copyStyleSheetsToWindow:Dh});let Lh=!1,ho;const Cv=function(){if(ho.options.autoSetup===!1)return;const i=Array.prototype.slice.call(J.getElementsByTagName("video")),e=Array.prototype.slice.call(J.getElementsByTagName("audio")),t=Array.prototype.slice.call(J.getElementsByTagName("video-js")),r=i.concat(e,t);if(r&&r.length>0)for(let s=0,n=r.length;s<n;s++){const a=r[s];if(a&&a.getAttribute)a.player===void 0&&a.getAttribute("data-setup")!==null&&ho(a);else{fo(1);break}}else Lh||fo(1)};function fo(i,e){!Cr()||(e&&(ho=e),R.setTimeout(Cv,i))}function po(){Lh=!0,R.removeEventListener("load",po)}Cr()&&(J.readyState==="complete"?po():R.addEventListener("load",po));const Ih=function(i){const e=J.createElement("style");return e.className=i,e},kh=function(i,e){i.styleSheet?i.styleSheet.cssText=e:i.textContent=e};var nt=new WeakMap;const Av=3;let Dv=Av;function Jt(){return Dv++}function pd(i,e){if(!nt.has(i))return;const t=nt.get(i);t.handlers[e].length===0&&(delete t.handlers[e],i.removeEventListener?i.removeEventListener(e,t.dispatcher,!1):i.detachEvent&&i.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&&nt.delete(i)}function ou(i,e,t,r){t.forEach(function(s){i(e,s,r)})}function la(i){if(i.fixed_)return i;function e(){return!0}function t(){return!1}if(!i||!i.isPropagationStopped||!i.isImmediatePropagationStopped){const r=i||R.event;i={};for(const s in r)s!=="layerX"&&s!=="layerY"&&s!=="keyLocation"&&s!=="webkitMovementX"&&s!=="webkitMovementY"&&s!=="path"&&(s==="returnValue"&&r.preventDefault||(i[s]=r[s]));if(i.target||(i.target=i.srcElement||J),i.relatedTarget||(i.relatedTarget=i.fromElement===i.target?i.toElement:i.fromElement),i.preventDefault=function(){r.preventDefault&&r.preventDefault(),i.returnValue=!1,r.returnValue=!1,i.defaultPrevented=!0},i.defaultPrevented=!1,i.stopPropagation=function(){r.stopPropagation&&r.stopPropagation(),i.cancelBubble=!0,r.cancelBubble=!0,i.isPropagationStopped=e},i.isPropagationStopped=t,i.stopImmediatePropagation=function(){r.stopImmediatePropagation&&r.stopImmediatePropagation(),i.isImmediatePropagationStopped=e,i.stopPropagation()},i.isImmediatePropagationStopped=t,i.clientX!==null&&i.clientX!==void 0){const s=J.documentElement,n=J.body;i.pageX=i.clientX+(s&&s.scrollLeft||n&&n.scrollLeft||0)-(s&&s.clientLeft||n&&n.clientLeft||0),i.pageY=i.clientY+(s&&s.scrollTop||n&&n.scrollTop||0)-(s&&s.clientTop||n&&n.clientTop||0)}i.which=i.charCode||i.keyCode,i.button!==null&&i.button!==void 0&&(i.button=i.button&1?0:i.button&4?1:i.button&2?2:0)}return i.fixed_=!0,i}let ln;const wv=function(){if(typeof ln!="boolean"){ln=!1;try{const i=Object.defineProperty({},"passive",{get(){ln=!0}});R.addEventListener("test",null,i),R.removeEventListener("test",null,i)}catch(i){}}return ln},Lv=["touchstart","touchmove"];function xt(i,e,t){if(Array.isArray(e))return ou(xt,i,e,t);nt.has(i)||nt.set(i,{});const r=nt.get(i);if(r.handlers||(r.handlers={}),r.handlers[e]||(r.handlers[e]=[]),t.guid||(t.guid=Jt()),r.handlers[e].push(t),r.dispatcher||(r.disabled=!1,r.dispatcher=function(s,n){if(r.disabled)return;s=la(s);const a=r.handlers[s.type];if(a){const o=a.slice(0);for(let l=0,h=o.length;l<h&&!s.isImmediatePropagationStopped();l++)try{o[l].call(i,s,n)}catch(c){ye.error(c)}}}),r.handlers[e].length===1)if(i.addEventListener){let s=!1;wv()&&Lv.indexOf(e)>-1&&(s={passive:!0}),i.addEventListener(e,r.dispatcher,s)}else i.attachEvent&&i.attachEvent("on"+e,r.dispatcher)}function Qe(i,e,t){if(!nt.has(i))return;const r=nt.get(i);if(!r.handlers)return;if(Array.isArray(e))return ou(Qe,i,e,t);const s=function(a,o){r.handlers[o]=[],pd(a,o)};if(e===void 0){for(const a in r.handlers)Object.prototype.hasOwnProperty.call(r.handlers||{},a)&&s(i,a);return}const n=r.handlers[e];if(!!n){if(!t){s(i,e);return}if(t.guid)for(let a=0;a<n.length;a++)n[a].guid===t.guid&&n.splice(a--,1);pd(i,e)}}function Dr(i,e,t){const r=nt.has(i)?nt.get(i):{},s=i.parentNode||i.ownerDocument;if(typeof e=="string"?e={type:e,target:i}:e.target||(e.target=i),e=la(e),r.dispatcher&&r.dispatcher.call(i,e,t),s&&!e.isPropagationStopped()&&e.bubbles===!0)Dr.call(null,s,e,t);else if(!s&&!e.defaultPrevented&&e.target&&e.target[e.type]){nt.has(e.target)||nt.set(e.target,{});const n=nt.get(e.target);e.target[e.type]&&(n.disabled=!0,typeof e.target[e.type]=="function"&&e.target[e.type](),n.disabled=!1)}return!e.defaultPrevented}function da(i,e,t){if(Array.isArray(e))return ou(da,i,e,t);const r=function(){Qe(i,e,r),t.apply(this,arguments)};r.guid=t.guid=t.guid||Jt(),xt(i,e,r)}function uu(i,e,t){const r=function(){Qe(i,e,r),t.apply(this,arguments)};r.guid=t.guid=t.guid||Jt(),xt(i,e,r)}var Iv=Object.freeze({__proto__:null,fixEvent:la,on:xt,off:Qe,trigger:Dr,one:da,any:uu});const wt=30,Le=function(i,e,t){e.guid||(e.guid=Jt());const r=e.bind(i);return r.guid=t?t+"_"+e.guid:e.guid,r},Zt=function(i,e){let t=R.performance.now();return function(...s){const n=R.performance.now();n-t>=e&&(i(...s),t=n)}},Oh=function(i,e,t,r=R){let s;const n=()=>{r.clearTimeout(s),s=null},a=function(){const o=this,l=arguments;let h=function(){s=null,h=null,t||i.apply(o,l)};!s&&t&&i.apply(o,l),r.clearTimeout(s),s=r.setTimeout(h,e)};return a.cancel=n,a};var kv=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:wt,bind_:Le,throttle:Zt,debounce:Oh});let Jr;class Lt{on(e,t){const r=this.addEventListener;this.addEventListener=()=>{},xt(this,e,t),this.addEventListener=r}off(e,t){Qe(this,e,t)}one(e,t){const r=this.addEventListener;this.addEventListener=()=>{},da(this,e,t),this.addEventListener=r}any(e,t){const r=this.addEventListener;this.addEventListener=()=>{},uu(this,e,t),this.addEventListener=r}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=la(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Dr(this,e)}queueTrigger(e){Jr||(Jr=new Map);const t=e.type||e;let r=Jr.get(this);r||(r=new Map,Jr.set(this,r));const s=r.get(t);r.delete(t),R.clearTimeout(s);const n=R.setTimeout(()=>{r.delete(t),r.size===0&&(r=null,Jr.delete(this)),this.trigger(e)},0);r.set(t,n)}}Lt.prototype.allowedEvents_={};Lt.prototype.addEventListener=Lt.prototype.on;Lt.prototype.removeEventListener=Lt.prototype.off;Lt.prototype.dispatchEvent=Lt.prototype.trigger;const ca=i=>typeof i.name=="function"?i.name():typeof i.name=="string"?i.name:i.name_?i.name_:i.constructor&&i.constructor.name?i.constructor.name:typeof i,oi=i=>i instanceof Lt||!!i.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof i[e]=="function"),Ov=(i,e)=>{oi(i)?e():(i.eventedCallbacks||(i.eventedCallbacks=[]),i.eventedCallbacks.push(e))},mo=i=>typeof i=="string"&&/\S/.test(i)||Array.isArray(i)&&!!i.length,kn=(i,e,t)=>{if(!i||!i.nodeName&&!oi(i))throw new Error(`Invalid target for ${ca(e)}#${t}; must be a DOM node or evented object.`)},Ph=(i,e,t)=>{if(!mo(i))throw new Error(`Invalid event type for ${ca(e)}#${t}; must be a non-empty string or array.`)},Rh=(i,e,t)=>{if(typeof i!="function")throw new Error(`Invalid listener for ${ca(e)}#${t}; must be a function.`)},$a=(i,e,t)=>{const r=e.length<3||e[0]===i||e[0]===i.eventBusEl_;let s,n,a;return r?(s=i.eventBusEl_,e.length>=3&&e.shift(),[n,a]=e):[s,n,a]=e,kn(s,i,t),Ph(n,i,t),Rh(a,i,t),a=Le(i,a),{isTargetingSelf:r,target:s,type:n,listener:a}},ki=(i,e,t,r)=>{kn(i,i,e),i.nodeName?Iv[e](i,t,r):i[e](t,r)},Pv={on(...i){const{isTargetingSelf:e,target:t,type:r,listener:s}=$a(this,i,"on");if(ki(t,"on",r,s),!e){const n=()=>this.off(t,r,s);n.guid=s.guid;const a=()=>this.off("dispose",n);a.guid=s.guid,ki(this,"on","dispose",n),ki(t,"on","dispose",a)}},one(...i){const{isTargetingSelf:e,target:t,type:r,listener:s}=$a(this,i,"one");if(e)ki(t,"one",r,s);else{const n=(...a)=>{this.off(t,r,n),s.apply(null,a)};n.guid=s.guid,ki(t,"one",r,n)}},any(...i){const{isTargetingSelf:e,target:t,type:r,listener:s}=$a(this,i,"any");if(e)ki(t,"any",r,s);else{const n=(...a)=>{this.off(t,r,n),s.apply(null,a)};n.guid=s.guid,ki(t,"any",r,n)}},off(i,e,t){if(!i||mo(i))Qe(this.eventBusEl_,i,e);else{const r=i,s=e;kn(r,this,"off"),Ph(s,this,"off"),Rh(t,this,"off"),t=Le(this,t),this.off("dispose",t),r.nodeName?(Qe(r,s,t),Qe(r,"dispose",t)):oi(r)&&(r.off(s,t),r.off("dispose",t))}},trigger(i,e){kn(this.eventBusEl_,this,"trigger");const t=i&&typeof i!="string"?i.type:i;if(!mo(t))throw new Error(`Invalid event type for ${ca(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return Dr(this.eventBusEl_,i,e)}};function lu(i,e={}){const{eventBusKey:t}=e;if(t){if(!i[t].nodeName)throw new Error(`The eventBusKey "${t}" does not refer to an element.`);i.eventBusEl_=i[t]}else i.eventBusEl_=me("span",{className:"vjs-event-bus"});return Object.assign(i,Pv),i.eventedCallbacks&&i.eventedCallbacks.forEach(r=>{r()}),i.on("dispose",()=>{i.off(),[i,i.el_,i.eventBusEl_].forEach(function(r){r&&nt.has(r)&&nt.delete(r)}),R.setTimeout(()=>{i.eventBusEl_=null},0)}),i}const Rv={state:{},setState(i){typeof i=="function"&&(i=i());let e;return ar(i,(t,r)=>{this.state[r]!==t&&(e=e||{},e[r]={from:this.state[r],to:t}),this.state[r]=t}),e&&oi(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function Mh(i,e){return Object.assign(i,Rv),i.state=Object.assign({},i.state,e),typeof i.handleStateChanged=="function"&&oi(i)&&i.on("statechanged",i.handleStateChanged),i}const cs=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toLowerCase())},Me=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toUpperCase())},Bh=function(i,e){return Me(i)===Me(e)};var Mv=Object.freeze({__proto__:null,toLowerCase:cs,toTitleCase:Me,titleCaseEquals:Bh});class z{constructor(e,t,r){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=we({},this.options_),t=this.options_=we(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const s=e&&e.id&&e.id()||"no_player";this.id_=`${s}_component_${Jt()}`}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(s=>this.addClass(s)),["on","off","one","any","trigger"].forEach(s=>{this[s]=void 0}),t.evented!==!1&&(lu(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),Mh(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(r),t.reportTouchActivity!==!1&&this.enableTouchActivity()}on(e,t){}off(e,t){}one(e,t){}any(e,t){}trigger(e,t){}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 Boolean(this.isDisposed_)}player(){return this.player_}options(e){return e?(this.options_=we(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,r){return me(e,t,r)}localize(e,t,r=e){const s=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),a=n&&n[s],o=s&&s.split("-")[0],l=n&&n[o];let h=r;return a&&a[e]?h=a[e]:l&&l[e]&&(h=l[e]),t&&(h=h.replace(/\{(\d+)\}/g,function(c,p){const _=t[p-1];let E=_;return typeof _=="undefined"&&(E=c),E})),h}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]}getDescendant(...e){e=e.reduce((r,s)=>r.concat(s),[]);let t=this;for(let r=0;r<e.length;r++)if(t=t.getChild(e[r]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;const r="http://www.w3.org/2000/svg",s=me("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),n=J.createElementNS(r,"svg");n.setAttributeNS(null,"viewBox","0 0 512 512");const a=J.createElementNS(r,"use");return n.appendChild(a),a.setAttributeNS(null,"href",`#vjs-icon-${e}`),s.appendChild(n),this.iconIsSet_?t.replaceChild(s,t.querySelector(".vjs-icon-placeholder")):t.appendChild(s),this.iconIsSet_=!0,s}addChild(e,t={},r=this.children_.length){let s,n;if(typeof e=="string"){n=Me(e);const a=t.componentClass||n;t.name=n;const o=z.getComponent(a);if(!o)throw new Error(`Component ${a} does not exist`);if(typeof o!="function")return null;s=new o(this.player_||this,t)}else s=e;if(s.parentComponent_&&s.parentComponent_.removeChild(s),this.children_.splice(r,0,s),s.parentComponent_=this,typeof s.id=="function"&&(this.childIndex_[s.id()]=s),n=n||s.name&&Me(s.name()),n&&(this.childNameIndex_[n]=s,this.childNameIndex_[cs(n)]=s),typeof s.el=="function"&&s.el()){let a=null;this.children_[r+1]&&(this.children_[r+1].el_?a=this.children_[r+1].el_:Ar(this.children_[r+1])&&(a=this.children_[r+1])),this.contentEl().insertBefore(s.el(),a)}return s}removeChild(e){if(typeof e=="string"&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let s=this.children_.length-1;s>=0;s--)if(this.children_[s]===e){t=!0,this.children_.splice(s,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[Me(e.name())]=null,this.childNameIndex_[cs(e.name())]=null;const r=e.el();r&&r.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,r=a=>{const o=a.name;let l=a.opts;if(t[o]!==void 0&&(l=t[o]),l===!1)return;l===!0&&(l={}),l.playerOptions=this.options_.playerOptions;const h=this.addChild(o,l);h&&(this[o]=h)};let s;const n=z.getComponent("Tech");Array.isArray(e)?s=e:s=Object.keys(e),s.concat(Object.keys(this.options_).filter(function(a){return!s.some(function(o){return typeof o=="string"?a===o:a===o.name})})).map(a=>{let o,l;return typeof a=="string"?(o=a,l=e[o]||this.options_[o]||{}):(o=a.name,l=a),{name:o,opts:l}}).filter(a=>{const o=z.getComponent(a.opts.componentClass||Me(a.name));return o&&!n.isTech(o)}).forEach(r)}}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 Ti(e,t||this.contentEl())}$$(e,t){return Ah(e,t||this.contentEl())}hasClass(e){return ds(this.el_,e)}addClass(...e){Ni(this.el_,...e)}removeClass(...e){na(this.el_,...e)}toggleClass(e,t){vh(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 Th(this.el_,e)}setAttribute(e,t){yr(this.el_,e,t)}removeAttribute(e){aa(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,r){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",r||this.trigger("componentresize");return}if(!this.el_)return 0;const s=this.el_.style[e],n=s.indexOf("px");return parseInt(n!==-1?s.slice(0,n):this.el_["offset"+Me(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=xr(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const r=`offset${Me(e)}`;t=this.el_[r]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(he.isEventKey(e,"Tab")||e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;const r=10,s=200;let n;this.on("touchstart",function(o){o.touches.length===1&&(t={pageX:o.touches[0].pageX,pageY:o.touches[0].pageY},e=R.performance.now(),n=!0)}),this.on("touchmove",function(o){if(o.touches.length>1)n=!1;else if(t){const l=o.touches[0].pageX-t.pageX,h=o.touches[0].pageY-t.pageY;Math.sqrt(l*l+h*h)>r&&(n=!1)}});const a=function(){n=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(o){t=null,n===!0&&R.performance.now()-e<s&&(o.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=Le(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});const r=function(s){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",r),this.on("touchcancel",r)}setTimeout(e,t){var r;return e=Le(this,e),this.clearTimersOnDispose_(),r=R.setTimeout(()=>{this.setTimeoutIds_.has(r)&&this.setTimeoutIds_.delete(r),e()},t),this.setTimeoutIds_.add(r),r}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),R.clearTimeout(e)),e}setInterval(e,t){e=Le(this,e),this.clearTimersOnDispose_();const r=R.setInterval(e,t);return this.setIntervalIds_.add(r),r}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),R.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=Le(this,e),t=R.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){if(this.namedRafs_.has(e))return;this.clearTimersOnDispose_(),t=Le(this,t);const r=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,r),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),R.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((r,s)=>this[t](s))}),this.clearingTimersOnDispose_=!1}))}static registerComponent(e,t){if(typeof e!="string"||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const r=z.getComponent("Tech"),s=r&&r.isTech(t),n=z===t||z.prototype.isPrototypeOf(t.prototype);if(s||!n){let o;throw s?o="techs must be registered using Tech.registerTech()":o="must be a Component subclass",new Error(`Illegal component, "${e}"; ${o}.`)}e=Me(e),z.components_||(z.components_={});const a=z.getComponent("Player");if(e==="Player"&&a&&a.players){const o=a.players,l=Object.keys(o);if(o&&l.length>0&&l.map(h=>o[h]).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return z.components_[e]=t,z.components_[cs(e)]=t,t}static getComponent(e){if(!(!e||!z.components_))return z.components_[e]}}z.registerComponent("Component",z);function Bv(i,e,t){if(typeof e!="number"||e<0||e>t)throw new Error(`Failed to execute '${i}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${t}).`)}function md(i,e,t,r){return Bv(i,r,t.length-1),t[r][e]}function Ha(i){let e;return i===void 0||i.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:i.length,start:md.bind(null,"start",0,i),end:md.bind(null,"end",1,i)},R.Symbol&&R.Symbol.iterator&&(e[R.Symbol.iterator]=()=>(i||[]).values()),e}function Kt(i,e){return Array.isArray(i)?Ha(i):i===void 0||e===void 0?Ha():Ha([[i,e]])}const Nh=function(i,e){i=i<0?0:i;let t=Math.floor(i%60),r=Math.floor(i/60%60),s=Math.floor(i/3600);const n=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(s=r=t="-"),s=s>0||a>0?s+":":"",r=((s||n>=10)&&r<10?"0"+r:r)+":",t=t<10?"0"+t:t,s+r+t};let du=Nh;function Fh(i){du=i}function Uh(){du=Nh}function ji(i,e=i){return du(i,e)}var Nv=Object.freeze({__proto__:null,createTimeRanges:Kt,createTimeRange:Kt,setFormatTime:Fh,resetFormatTime:Uh,formatTime:ji});function jh(i,e){let t=0,r,s;if(!e)return 0;(!i||!i.length)&&(i=Kt(0,0));for(let n=0;n<i.length;n++)r=i.start(n),s=i.end(n),s>e&&(s=e),t+=s-r;return t/e}function at(i){if(i instanceof at)return i;typeof i=="number"?this.code=i:typeof i=="string"?this.message=i:Xt(i)&&(typeof i.code=="number"&&(this.code=i.code),Object.assign(this,i)),this.message||(this.message=at.defaultMessages[this.code]||"")}at.prototype.code=0;at.prototype.message="";at.prototype.status=null;at.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];at.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."};for(let i=0;i<at.errorTypes.length;i++)at[at.errorTypes[i]]=i,at.prototype[at.errorTypes[i]]=i;function hs(i){return i!=null&&typeof i.then=="function"}function $t(i){hs(i)&&i.then(null,e=>{})}const go=function(i){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,r,s)=>(i[r]&&(t[r]=i[r]),t),{cues:i.cues&&Array.prototype.map.call(i.cues,function(t){return{startTime:t.startTime,endTime:t.endTime,text:t.text,id:t.id}})})},Fv=function(i){const e=i.$$("track"),t=Array.prototype.map.call(e,s=>s.track);return Array.prototype.map.call(e,function(s){const n=go(s.track);return s.src&&(n.src=s.src),n}).concat(Array.prototype.filter.call(i.textTracks(),function(s){return t.indexOf(s)===-1}).map(go))},Uv=function(i,e){return i.forEach(function(t){const r=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(s=>r.addCue(s))}),e.textTracks()};var gd={textTracksToJson:Fv,jsonToTextTracks:Uv,trackToJson_:go};const Ga="vjs-modal-dialog";class wr extends z{constructor(e,t){super(e,t),this.handleKeyDown_=r=>this.handleKeyDown(r),this.close_=r=>this.close(r),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=me("div",{className:`${Ga}-content`},{role:"document"}),this.descEl_=me("p",{className:`${Ga}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),Ei(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"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Ga} 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_){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("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e=="boolean"){const t=this.closeable_=!!e;let r=this.getChild("closeButton");if(t&&!r){const s=this.contentEl_;this.contentEl_=this.el_,r=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=s,this.on(r,"close",this.close_)}!t&&r&&(this.off(r,"close",this.close_),this.removeChild(r),r.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),r=t.parentNode,s=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,r.removeChild(t),this.empty(),Ch(t,e),this.trigger("modalfill"),s?r.insertBefore(t,s):r.appendChild(t);const n=this.getChild("closeButton");n&&r.appendChild(n.el_)}empty(){this.trigger("beforemodalempty"),ua(this.contentEl()),this.trigger("modalempty")}content(e){return typeof e!="undefined"&&(this.content_=e),this.content_}conditionalFocus_(){const e=J.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(e.stopPropagation(),he.isEventKey(e,"Escape")&&this.closeable()){e.preventDefault(),this.close();return}if(!he.isEventKey(e,"Tab"))return;const t=this.focusableEls_(),r=this.el_.querySelector(":focus");let s;for(let n=0;n<t.length;n++)if(r===t[n]){s=n;break}J.activeElement===this.el_&&(s=0),e.shiftKey&&s===0?(t[t.length-1].focus(),e.preventDefault()):!e.shiftKey&&s===t.length-1&&(t[0].focus(),e.preventDefault())}focusableEls_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,t=>(t instanceof R.HTMLAnchorElement||t instanceof R.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof R.HTMLInputElement||t instanceof R.HTMLSelectElement||t instanceof R.HTMLTextAreaElement||t instanceof R.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof R.HTMLIFrameElement||t instanceof R.HTMLObjectElement||t instanceof R.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}}wr.prototype.options_={pauseOnOpen:!0,temporary:!0};z.registerComponent("ModalDialog",wr);class br extends Lt{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t<e.length;t++)this.addTrack(e[t])}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})},oi(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let r=0,s=this.length;r<s;r++)if(this[r]===e){t=this[r],t.off&&t.off(),this.tracks_.splice(r,1);break}!t||this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let r=0,s=this.length;r<s;r++){const n=this[r];if(n.id===e){t=n;break}}return t}}br.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const i in br.prototype.allowedEvents_)br.prototype["on"+i]=null;const qa=function(i,e){for(let t=0;t<i.length;t++)!Object.keys(i[t]).length||e.id===i[t].id||(i[t].enabled=!1)};class jv extends br{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){qa(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&qa(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,qa(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 Wa=function(i,e){for(let t=0;t<i.length;t++)!Object.keys(i[t]).length||e.id===i[t].id||(i[t].selected=!1)};class Vv extends br{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){Wa(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&&Wa(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,Wa(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 Vh extends br{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_))}}class $v{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,r=e.length;t<r;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 r=0,s=this.trackElements_.length;r<s;r++)if(e===this.trackElements_[r].track){t=this.trackElements_[r];break}return t}removeTrackElement_(e){for(let t=0,r=this.trackElements_.length;t<r;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 On{constructor(e){On.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let r=0;const s=e.length;this.cues_=e,this.length_=e.length;const n=function(a){""+a in this||Object.defineProperty(this,""+a,{get(){return this.cues_[a]}})};if(t<s)for(r=t;r<s;r++)n.call(this,r)}getCueById(e){let t=null;for(let r=0,s=this.length;r<s;r++){const n=this[r];if(n.id===e){t=n;break}}return t}}const Hv={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Gv={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},qv={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},_d={disabled:"disabled",hidden:"hidden",showing:"showing"};class cu extends Lt{constructor(e={}){super();const t={id:e.id||"vjs_track_"+Jt(),kind:e.kind||"",language:e.language||""};let r=e.label||"";for(const s in t)Object.defineProperty(this,s,{get(){return t[s]},set(){}});Object.defineProperty(this,"label",{get(){return r},set(s){s!==r&&(r=s,this.trigger("labelchange"))}})}}const hu=function(i){const e=["protocol","hostname","port","pathname","search","hash","host"],t=J.createElement("a");t.href=i;const r={};for(let s=0;s<e.length;s++)r[e[s]]=t[e[s]];return r.protocol==="http:"&&(r.host=r.host.replace(/:80$/,"")),r.protocol==="https:"&&(r.host=r.host.replace(/:443$/,"")),r.protocol||(r.protocol=R.location.protocol),r.host||(r.host=R.location.host),r},$h=function(i){if(!i.match(/^https?:\/\//)){const e=J.createElement("a");e.href=i,i=e.href}return i},fu=function(i){if(typeof i=="string"){const t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(i);if(t)return t.pop().toLowerCase()}return""},ha=function(i,e=R.location){const t=hu(i);return(t.protocol===":"?e.protocol:t.protocol)+t.host!==e.protocol+e.host};var Wv=Object.freeze({__proto__:null,parseUrl:hu,getAbsoluteURL:$h,getFileExtension:fu,isCrossOrigin:ha});const vd=function(i,e){const t=new R.WebVTT.Parser(R,R.vttjs,R.WebVTT.StringDecoder()),r=[];t.oncue=function(s){e.addCue(s)},t.onparsingerror=function(s){r.push(s)},t.onflush=function(){e.trigger({type:"loadeddata",target:e})},t.parse(i),r.length>0&&(R.console&&R.console.groupCollapsed&&R.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),r.forEach(s=>ye.error(s)),R.console&&R.console.groupEnd&&R.console.groupEnd()),t.flush()},yd=function(i,e){const t={uri:i},r=ha(i);r&&(t.cors=r);const s=e.tech_.crossOrigin()==="use-credentials";s&&(t.withCredentials=s),lc(t,Le(this,function(n,a,o){if(n)return ye.error(n,a);e.loaded_=!0,typeof R.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],l=>{if(l.type==="vttjserror"){ye.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return vd(o,e)}):vd(o,e)}))};class Ls extends cu{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=we(e,{kind:qv[e.kind]||"subtitles",language:e.language||e.srclang||""});let r=_d[t.mode]||"disabled";const s=t.default;(t.kind==="metadata"||t.kind==="chapters")&&(r="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const n=new On(this.cues_),a=new On(this.activeCues_);let o=!1;this.timeupdateHandler=Le(this,function(h={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){h.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,o&&(this.trigger("cuechange"),o=!1),h.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});const l=()=>{this.stopTracking()};this.tech_.one("dispose",l),r!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get(){return s},set(){}},mode:{get(){return r},set(h){!_d[h]||r!==h&&(r=h,!this.preload_&&r!=="disabled"&&this.cues.length===0&&yd(this.src,this),this.stopTracking(),r!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?n:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return a;const h=this.tech_.currentTime(),c=[];for(let p=0,_=this.cues.length;p<_;p++){const E=this.cues[p];E.startTime<=h&&E.endTime>=h&&c.push(E)}if(o=!1,c.length!==this.activeCues_.length)o=!0;else for(let p=0;p<c.length;p++)this.activeCues_.indexOf(c[p])===-1&&(o=!0);return this.activeCues_=c,a.setCues_(this.activeCues_),a},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||t.kind!=="subtitles"&&t.kind!=="captions")&&yd(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(t.constructor&&t.constructor.name!=="VTTCue"){t=new R.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(const s in e)s in t||(t[s]=e[s]);t.id=e.id,t.originalCue_=e}const r=this.tech_.textTracks();for(let s=0;s<r.length;s++)r[s]!==this&&r[s].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}removeCue(e){let t=this.cues_.length;for(;t--;){const r=this.cues_[t];if(r===e||r.originalCue_&&r.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}Ls.prototype.allowedEvents_={cuechange:"cuechange"};class Hh extends cu{constructor(e={}){const t=we(e,{kind:Gv[e.kind]||""});super(t);let r=!1;Object.defineProperty(this,"enabled",{get(){return r},set(s){typeof s!="boolean"||s===r||(r=s,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class Gh extends cu{constructor(e={}){const t=we(e,{kind:Hv[e.kind]||""});super(t);let r=!1;Object.defineProperty(this,"selected",{get(){return r},set(s){typeof s!="boolean"||s===r||(r=s,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class hi extends Lt{constructor(e={}){super();let t;const r=new Ls(e);this.kind=r.kind,this.src=r.src,this.srclang=r.language,this.label=r.label,this.default=r.default,Object.defineProperties(this,{readyState:{get(){return t}},track:{get(){return r}}}),t=hi.NONE,r.addEventListener("loadeddata",()=>{t=hi.LOADED,this.trigger({type:"load",target:this})})}}hi.prototype.allowedEvents_={load:"load"};hi.NONE=0;hi.LOADING=1;hi.LOADED=2;hi.ERROR=3;const Dt={audio:{ListClass:jv,TrackClass:Hh,capitalName:"Audio"},video:{ListClass:Vv,TrackClass:Gh,capitalName:"Video"},text:{ListClass:Vh,TrackClass:Ls,capitalName:"Text"}};Object.keys(Dt).forEach(function(i){Dt[i].getterName=`${i}Tracks`,Dt[i].privateName=`${i}Tracks_`});const Er={remoteText:{ListClass:Vh,TrackClass:Ls,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:$v,TrackClass:hi,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},rt=Object.assign({},Dt,Er);Er.names=Object.keys(Er);Dt.names=Object.keys(Dt);rt.names=[].concat(Er.names).concat(Dt.names);function zv(i,e,t,r,s={}){const n=i.textTracks();s.kind=e,t&&(s.label=t),r&&(s.language=r),s.tech=i;const a=new rt.text.TrackClass(s);return n.addTrack(a),a}class fe extends z{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=r=>this.onDurationChange(r),this.trackProgress_=r=>this.trackProgress(r),this.trackCurrentTime_=r=>this.trackCurrentTime(r),this.stopTrackingCurrentTime_=r=>this.stopTrackingCurrentTime(r),this.disposeSourceHandler_=r=>this.disposeSourceHandler(r),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),rt.names.forEach(r=>{const s=rt[r];e&&e[s.getterName]&&(this[s.privateName]=e[s.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(r=>{e[`native${r}Tracks`]===!1&&(this[`featuresNative${r}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 rt.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(Le(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 Kt(0,0)}bufferedPercent(){return jh(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(Dt.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(t=>{const r=this[`${t}Tracks`]()||[];let s=r.length;for(;s--;){const n=r[s];t==="text"&&this.removeRemoteTextTrack(n),r.removeTrack(n)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const r=e[t];this.removeRemoteTextTrack(r)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new at(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Kt(0,0):Kt()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){Dt.names.forEach(e=>{const t=Dt[e],r=()=>{this.trigger(`${e}trackchange`)},s=this[t.getterName]();s.addEventListener("removetrack",r),s.addEventListener("addtrack",r),this.on("dispose",()=>{s.removeEventListener("removetrack",r),s.removeEventListener("addtrack",r)})})}addWebVttScript_(){if(!R.WebVTT)if(J.body.contains(this.el())){if(!this.options_["vtt.js"]&&vr(Bl)&&Object.keys(Bl).length>0){this.trigger("vttjsloaded");return}const e=J.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}),R.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),r=o=>e.addTrack(o.track),s=o=>e.removeTrack(o.track);t.on("addtrack",r),t.on("removetrack",s),this.addWebVttScript_();const n=()=>this.trigger("texttrackchange"),a=()=>{n();for(let o=0;o<e.length;o++){const l=e[o];l.removeEventListener("cuechange",n),l.mode==="showing"&&l.addEventListener("cuechange",n)}};a(),e.addEventListener("change",a),e.addEventListener("addtrack",a),e.addEventListener("removetrack",a),this.on("dispose",function(){t.off("addtrack",r),t.off("removetrack",s),e.removeEventListener("change",a),e.removeEventListener("addtrack",a),e.removeEventListener("removetrack",a);for(let o=0;o<e.length;o++)e[o].removeEventListener("cuechange",n)})}addTextTrack(e,t,r){if(!e)throw new Error("TextTrack kind is required but was not provided");return zv(this,e,t,r)}createRemoteTextTrack(e){const t=we(e,{tech:this});return new Er.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const r=this.createRemoteTextTrack(e);return typeof t!="boolean"&&(t=!1),this.remoteTextTrackEls().addTrackElement_(r),this.remoteTextTracks().addTrack(r.track),t===!1&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(r.track)),r}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=Jt();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 fe.canPlayType(e.type)}static isTech(e){return e.prototype instanceof fe||e instanceof fe||e===fe}static registerTech(e,t){if(fe.techs_||(fe.techs_={}),!fe.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!fe.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!fe.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=Me(e),fe.techs_[e]=t,fe.techs_[cs(e)]=t,e!=="Tech"&&fe.defaultTechOrder_.push(e),t}static getTech(e){if(!!e){if(fe.techs_&&fe.techs_[e])return fe.techs_[e];if(e=Me(e),R&&R.videojs&&R.videojs[e])return ye.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),R.videojs[e]}}}rt.names.forEach(function(i){const e=rt[i];fe.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});fe.prototype.featuresVolumeControl=!0;fe.prototype.featuresMuteControl=!0;fe.prototype.featuresFullscreenResize=!1;fe.prototype.featuresPlaybackRate=!1;fe.prototype.featuresProgressEvents=!1;fe.prototype.featuresSourceset=!1;fe.prototype.featuresTimeupdateEvents=!1;fe.prototype.featuresNativeTextTracks=!1;fe.prototype.featuresVideoFrameCallback=!1;fe.withSourceHandlers=function(i){i.registerSourceHandler=function(t,r){let s=i.sourceHandlers;s||(s=i.sourceHandlers=[]),r===void 0&&(r=s.length),s.splice(r,0,t)},i.canPlayType=function(t){const r=i.sourceHandlers||[];let s;for(let n=0;n<r.length;n++)if(s=r[n].canPlayType(t),s)return s;return""},i.selectSourceHandler=function(t,r){const s=i.sourceHandlers||[];let n;for(let a=0;a<s.length;a++)if(n=s[a].canHandleSource(t,r),n)return s[a];return null},i.canPlaySource=function(t,r){const s=i.selectSourceHandler(t,r);return s?s.canHandleSource(t,r):""},["seekable","seeking","duration"].forEach(function(t){const r=this[t];typeof r=="function"&&(this[t]=function(){return this.sourceHandler_&&this.sourceHandler_[t]?this.sourceHandler_[t].apply(this.sourceHandler_,arguments):r.apply(this,arguments)})},i.prototype),i.prototype.setSource=function(t){let r=i.selectSourceHandler(t,this.options_);r||(i.nativeSourceHandler?r=i.nativeSourceHandler:ye.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),r!==i.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=r.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},i.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)}};z.registerComponent("Tech",fe);fe.registerTech("Tech",fe);fe.defaultTechOrder_=[];const Fi={},_o={},Pn={};function Kv(i,e){Fi[i]=Fi[i]||[],Fi[i].push(e)}function Xv(i,e,t){i.setTimeout(()=>Oi(e,Fi[e.type],t,i),1)}function Yv(i,e){i.forEach(t=>t.setTech&&t.setTech(e))}function Qv(i,e,t){return i.reduceRight(pu(t),e[t]())}function Jv(i,e,t,r){return e[t](i.reduce(pu(t),r))}function Td(i,e,t,r=null){const s="call"+Me(t),n=i.reduce(pu(s),r),a=n===Pn,o=a?null:e[t](n);return ty(i,t,o,a),o}const Zv={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},ey={setCurrentTime:1,setMuted:1,setVolume:1},xd={play:1,pause:1};function pu(i){return(e,t)=>e===Pn?Pn:t[i]?t[i](e):e}function ty(i,e,t,r){for(let s=i.length-1;s>=0;s--){const n=i[s];n[e]&&n[e](r,t)}}function iy(i){_o[i.id()]=null}function ry(i,e){const t=_o[i.id()];let r=null;if(t==null)return r=e(i),_o[i.id()]=[[e,r]],r;for(let s=0;s<t.length;s++){const[n,a]=t[s];n===e&&(r=a)}return r===null&&(r=e(i),t.push([e,r])),r}function Oi(i={},e=[],t,r,s=[],n=!1){const[a,...o]=e;if(typeof a=="string")Oi(i,Fi[a],t,r,s,n);else if(a){const l=ry(r,a);if(!l.setSource)return s.push(l),Oi(i,o,t,r,s,n);l.setSource(Object.assign({},i),function(h,c){if(h)return Oi(i,o,t,r,s,n);s.push(l),Oi(c,i.type===c.type?o:Fi[c.type],t,r,s,n)})}else o.length?Oi(i,o,t,r,s,n):n?t(i,s):Oi(i,Fi["*"],t,r,s,!0)}const sy={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"},Rn=function(i=""){const e=fu(i);return sy[e.toLowerCase()]||""},ny=(i,e)=>{if(!e)return"";if(i.cache_.source.src===e&&i.cache_.source.type)return i.cache_.source.type;const t=i.cache_.sources.filter(s=>s.src===e);if(t.length)return t[0].type;const r=i.$$("source");for(let s=0;s<r.length;s++){const n=r[s];if(n.type&&n.src&&n.src===e)return n.type}return Rn(e)},qh=function(i){if(Array.isArray(i)){let e=[];i.forEach(function(t){t=qh(t),Array.isArray(t)?e=e.concat(t):Xt(t)&&e.push(t)}),i=e}else typeof i=="string"&&i.trim()?i=[bd({src:i})]:Xt(i)&&typeof i.src=="string"&&i.src&&i.src.trim()?i=[bd(i)]:i=[];return i};function bd(i){if(!i.type){const e=Rn(i.src);e&&(i.type=e)}return i}var ay=`<svg xmlns="http://www.w3.org/2000/svg">
<defs>
<symbol viewBox="0 0 48 48" id="vjs-icon-play">
<path d="M16 10v28l22-14z"></path>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-pause">
<path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-audio">
<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>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-captions">
<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>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">
<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>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">
<path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">
<path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">
<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>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">
<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>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">
<path d="M14 18v12h8l10 10V8L22 18h-8z"></path>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">
<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>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">
<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>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-spinner">
<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>
</symbol>
<symbol viewBox="0 0 24 24" id="vjs-icon-hd">
<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>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-chapters">
<path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>
</symbol>
<symbol viewBox="0 0 40 40" id="vjs-icon-downloading">
<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>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-file-download">
<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>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">
<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>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">
<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>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-share">
<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>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-cog">
<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>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-square">
<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>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-circle">
<circle cx="24" cy="24" r="20"></circle>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">
<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>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">
<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>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-cancel">
<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>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-replay">
<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-7.16 16-16-7.16-16-16-16z"></path>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-repeat">
<path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>
</symbol>
<symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">
<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>
</symbol>
<symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">
<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>
</symbol>
<symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">
<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>
</symbol>
<symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">
<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>
</symbol>
<symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">
<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>
</symbol>
<symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">
<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>
</symbol>
<symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">
<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>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-next-item">
<path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">
<path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">
<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>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-cast">
<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>
</symbol>
<symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">
<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>
</symbol>
<symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">
<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>
<path fill="none" d="M-1-3h24v24H-1z"></path>
</symbol>
<symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">
<path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>
</symbol>
<symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">
<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>
</symbol>
<symbol viewBox="0 0 1792 1792" id="vjs-icon-twitter">
<path d="M1684 408q-67 98-162 167 1 14 1 42 0 130-38 259.5T1369.5 1125 1185 1335.5t-258 146-323 54.5q-271 0-496-145 35 4 78 4 225 0 401-138-105-2-188-64.5T285 1033q33 5 61 5 43 0 85-11-112-23-185.5-111.5T172 710v-4q68 38 146 41-66-44-105-115t-39-154q0-88 44-163 121 149 294.5 238.5T884 653q-8-38-8-74 0-134 94.5-228.5T1199 256q140 0 236 102 109-21 205-78-37 115-142 178 93-10 186-50z"></path>
</symbol>
<symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">
<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>
</symbol>
<symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">
<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>
</symbol>
</defs>
</svg>`;class oy extends z{constructor(e,t,r){const s=we({createEl:!1},t);if(super(e,s,r),!t.playerOptions.sources||t.playerOptions.sources.length===0)for(let n=0,a=t.playerOptions.techOrder;n<a.length;n++){const o=Me(a[n]);let l=fe.getTech(o);if(o||(l=z.getComponent(o)),l&&l.isSupported()){e.loadTech_(o);break}}else e.src(t.playerOptions.sources)}}z.registerComponent("MediaLoader",oy);class fa extends z{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=r=>this.handleMouseOver(r),this.handleMouseOut_=r=>this.handleMouseOut(r),this.handleClick_=r=>this.handleClick(r),this.handleKeyDown_=r=>this.handleKeyDown(r),this.emitTapEvents(),this.enable()}createEl(e="div",t={},r={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e==="button"&&ye.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),r=Object.assign({role:"button"},r),this.tabIndex_=t.tabIndex;const s=me(e,t,r);return this.player_.options_.experimentalSvgIcons||s.appendChild(me("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(s),s}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=me("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 r=this.localize(e);this.controlText_=e,Ei(this.controlTextEl_,r),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute("title",r)}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){he.isEventKey(e,"Space")||he.isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}z.registerComponent("ClickableComponent",fa);class vo extends fa{constructor(e,t){super(e,t),this.update(),this.update_=r=>this.update(r),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return me("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(me("picture",{className:"vjs-poster",tabIndex:-1},{},me("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e}handleClick(e){!this.player_.controls()||(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?$t(this.player_.play()):this.player_.pause())}}vo.prototype.crossorigin=vo.prototype.crossOrigin;z.registerComponent("PosterImage",vo);const At="#222",Ed="#ccc",uy={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',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function za(i,e){let t;if(i.length===4)t=i[1]+i[1]+i[2]+i[2]+i[3]+i[3];else if(i.length===7)t=i.slice(1);else throw new Error("Invalid color code provided, "+i+"; 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 Zr(i,e,t){try{i.style[e]=t}catch(r){return}}function Sd(i){return i?`${i}px`:""}class ly extends z{constructor(e,t,r){super(e,t,r);const s=a=>this.updateDisplay(a),n=a=>{this.updateDisplayOverlay(),this.updateDisplay(a)};e.on("loadstart",a=>this.toggleDisplay(a)),e.on("texttrackchange",s),e.on("loadedmetadata",a=>{this.updateDisplayOverlay(),this.preselectTrack(a)}),e.ready(Le(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",n),e.on("playerresize",n);const a=R.screen.orientation||R,o=R.screen.orientation?"change":"orientationchange";a.addEventListener(o,n),e.on("dispose",()=>a.removeEventListener(o,n));const l=this.options_.playerOptions.tracks||[];for(let h=0;h<l.length;h++)this.player_.addRemoteTextTrack(l[h],!0);this.preselectTrack()}))}preselectTrack(){const e={captions:1,subtitles:1},t=this.player_.textTracks(),r=this.player_.cache_.selectedLanguage;let s,n,a;for(let o=0;o<t.length;o++){const l=t[o];r&&r.enabled&&r.language&&r.language===l.language&&l.kind in e?l.kind===r.kind?a=l:a||(a=l):r&&!r.enabled?(a=null,s=null,n=null):l.default&&(l.kind==="descriptions"&&!s?s=l:l.kind in e&&!n&&(n=l))}a?a.mode="showing":n?n.mode="showing":s&&(s.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 R.WebVTT=="function"&&R.WebVTT.processCues(R,[],this.el_)}updateDisplay(){const e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){const a=[];for(let o=0;o<e.length;++o){const l=e[o];l.mode==="showing"&&a.push(l)}this.updateForTrack(a);return}let r=null,s=null,n=e.length;for(;n--;){const a=e[n];a.mode==="showing"&&(a.kind==="descriptions"?r=a:s=a)}s?(this.getAttribute("aria-live")!=="off"&&this.setAttribute("aria-live","off"),this.updateForTrack(s)):r&&(this.getAttribute("aria-live")!=="assertive"&&this.setAttribute("aria-live","assertive"),this.updateForTrack(r))}updateDisplayOverlay(){if(!this.player_.videoHeight()||!R.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),r=e/t,s=this.player_.videoWidth()/this.player_.videoHeight();let n=0,a=0;Math.abs(r-s)>.1&&(r>s?n=Math.round((e-t*s)/2):a=Math.round((t-e/s)/2)),Zr(this.el_,"insetInline",Sd(n)),Zr(this.el_,"insetBlock",Sd(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),r=e.activeCues;let s=r.length;for(;s--;){const n=r[s];if(!n)continue;const a=n.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&Zr(a.firstChild,"color",za(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&Zr(a.firstChild,"backgroundColor",za(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?Zr(a,"backgroundColor",za(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${At}, 2px 2px 4px ${At}, 2px 2px 5px ${At}`:t.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${At}, 2px 2px ${At}, 3px 3px ${At}`:t.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${Ed}, 0 1px ${Ed}, -1px -1px ${At}, 0 -1px ${At}`:t.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${At}, 0 0 4px ${At}, 0 0 4px ${At}, 0 0 4px ${At}`)),t.fontPercent&&t.fontPercent!==1){const o=R.parseFloat(a.style.fontSize);a.style.fontSize=o*t.fontPercent+"px",a.style.height="auto",a.style.top="auto"}t.fontFamily&&t.fontFamily!=="default"&&(t.fontFamily==="small-caps"?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=uy[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof R.WebVTT!="function"||e.every(r=>!r.activeCues))return;const t=[];for(let r=0;r<e.length;++r){const s=e[r];for(let n=0;n<s.activeCues.length;++n)t.push(s.activeCues[n])}R.WebVTT.processCues(R,t,this.el_);for(let r=0;r<e.length;++r){const s=e[r];for(let n=0;n<s.activeCues.length;++n){const a=s.activeCues[n].displayState;Ni(a,"vjs-text-track-cue","vjs-text-track-cue-"+(s.language?s.language:r)),s.language&&yr(a,"lang",s.language)}this.player_.textTrackSettings&&this.updateDisplayState(s)}}}z.registerComponent("TextTrackDisplay",ly);class dy extends z{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),r=me("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),s=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return s.appendChild(r),s}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}}z.registerComponent("LoadingSpinner",dy);class Tt extends fa{createEl(e,t={},r={}){e="button",t=Object.assign({className:this.buildCSSClass()},t),r=Object.assign({type:"button"},r);const s=me(e,t,r);return this.player_.options_.experimentalSvgIcons||s.appendChild(me("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(s),s}addChild(e,t={}){const r=this.constructor.name;return ye.warn(`Adding an actionable (user controllable) child to a Button (${r}) is not supported; use a ClickableComponent instead.`),z.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){if(he.isEventKey(e,"Space")||he.isEventKey(e,"Enter")){e.stopPropagation();return}super.handleKeyDown(e)}}z.registerComponent("Button",Tt);class Wh extends Tt{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",r=>this.handleMouseDown(r))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY){$t(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}const r=this.player_.getChild("controlBar"),s=r&&r.getChild("playToggle");if(!s){this.player_.tech(!0).focus();return}const n=()=>s.focus();hs(t)?t.then(n,()=>{}):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}Wh.prototype.controlText_="Play Video";z.registerComponent("BigPlayButton",Wh);class cy extends Tt{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){he.isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}z.registerComponent("CloseButton",cy);class zh extends Tt{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon("play"),this.on(e,"play",r=>this.handlePlay(r)),this.on(e,"pause",r=>this.handlePause(r)),t.replay&&this.on(e,"ended",r=>this.handleEnded(r))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?$t(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))}}zh.prototype.controlText_="Play";z.registerComponent("PlayToggle",zh);class Lr extends z{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended"],r=>this.updateContent(r)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),r=me("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)}\xA0`},{role:"presentation"});return t.appendChild(r),this.contentEl_=me("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}updateTextNode_(e=0){e=ji(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,ye.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_=J.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}Lr.prototype.labelText_="Time";Lr.prototype.controlText_="Time";z.registerComponent("TimeDisplay",Lr);class mu extends Lr{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;this.player_.ended()?t=this.player_.duration():t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}mu.prototype.labelText_="Current Time";mu.prototype.controlText_="Current Time";z.registerComponent("CurrentTimeDisplay",mu);class gu extends Lr{constructor(e,t){super(e,t);const r=s=>this.updateContent(s);this.on(e,"durationchange",r),this.on(e,"loadstart",r),this.on(e,"loadedmetadata",r)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}gu.prototype.labelText_="Duration";gu.prototype.controlText_="Duration";z.registerComponent("DurationDisplay",gu);class hy extends z{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),r=super.createEl("span",{textContent:"/"});return t.appendChild(r),e.appendChild(t),e}}z.registerComponent("TimeDivider",hy);class _u extends Lr{constructor(e,t){super(e,t),this.on(e,"durationchange",r=>this.updateContent(r))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(me("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)}}_u.prototype.labelText_="Remaining Time";_u.prototype.controlText_="Remaining Time";z.registerComponent("RemainingTimeDisplay",_u);class fy extends z{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",r=>this.updateShowing(r))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=me("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(me("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")}\xA0`})),this.contentEl_.appendChild(J.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()}}z.registerComponent("LiveDisplay",fy);class Kh extends Tt{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=r=>this.updateLiveEdgeStatus(r),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_=me("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()}}Kh.prototype.controlText_="Seek to live, currently playing live";z.registerComponent("SeekToLive",Kh);function Is(i,e,t){return i=Number(i),Math.min(t,Math.max(e,isNaN(i)?e:i))}var py=Object.freeze({__proto__:null,clamp:Is});class vu extends z{constructor(e,t){super(e,t),this.handleMouseDown_=r=>this.handleMouseDown(r),this.handleMouseUp_=r=>this.handleMouseUp(r),this.handleKeyDown_=r=>this.handleKeyDown(r),this.handleClick_=r=>this.handleClick(r),this.handleMouseMove_=r=>this.handleMouseMove(r),this.update_=r=>this.update(r),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={},r={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),r=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},r),super.createEl(e,t,r)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!Qt&&e.preventDefault(),xh(),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;bh(),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(Is(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=oa(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){he.isEventKey(e,"Left")||he.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):he.isEventKey(e,"Right")||he.isEventKey(e,"Up")?(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")}}z.registerComponent("Slider",vu);const Ka=(i,e)=>Is(i/e*100,0,100).toFixed(2)+"%";class my extends z{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",r=>this.update(r))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=me("span",{className:"vjs-control-text"}),r=me("span",{textContent:this.localize("Loaded")}),s=J.createTextNode(": ");return this.percentageEl_=me("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(r),t.appendChild(s),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,r=this.player_.buffered(),s=t&&t.isLive()?t.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),a=this.partEls_,o=Ka(n,s);this.percent_!==o&&(this.el_.style.width=o,Ei(this.percentageEl_,o),this.percent_=o);for(let l=0;l<r.length;l++){const h=r.start(l),c=r.end(l);let p=a[l];p||(p=this.el_.appendChild(me()),a[l]=p),!(p.dataset.start===h&&p.dataset.end===c)&&(p.dataset.start=h,p.dataset.end=c,p.style.left=Ka(h,n),p.style.width=Ka(c-h,n))}for(let l=a.length;l>r.length;l--)this.el_.removeChild(a[l-1]);a.length=r.length})}}z.registerComponent("LoadProgressBar",my);class gy extends z{constructor(e,t){super(e,t),this.update=Zt(Le(this,this.update),wt)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,r){const s=bs(this.el_),n=Tr(this.player_.el()),a=e.width*t;if(!n||!s)return;const o=e.left-n.left+a,l=e.width-a+(n.right-e.right);let h=s.width/2;o<h?h+=h-o:l<h&&(h=l),h<0?h=0:h>s.width&&(h=s.width),h=Math.round(h),this.el_.style.right=`-${h}px`,this.write(r)}write(e){Ei(this.el_,e)}updateTime(e,t,r,s){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let n;const a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const o=this.player_.liveTracker.liveWindow(),l=o-t*o;n=(l<1?"":"-")+ji(l,o)}else n=ji(r,a);this.update(e,t,n),s&&s()})}}z.registerComponent("TimeTooltip",gy);class yu extends z{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=Zt(Le(this,this.update),wt)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const r=this.getChild("timeTooltip");if(!r)return;const s=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();r.updateTime(e,t,s)}}yu.prototype.options_={children:[]};!ot&&!Yt&&yu.prototype.options_.children.push("timeTooltip");z.registerComponent("PlayProgressBar",yu);class Xh extends z{constructor(e,t){super(e,t),this.update=Zt(Le(this,this.update),wt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const r=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,r,()=>{this.el_.style.left=`${e.width*t}px`})}}Xh.prototype.options_={children:["timeTooltip"]};z.registerComponent("MouseTimeDisplay",Xh);const dn=5,Cd=12;class Tu extends vu{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=Le(this,this.update),this.update=Zt(this.update_,wt),this.on(this.player_,["ended","durationchange","timeupdate"],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 J&&"visibilityState"in J&&this.on(J,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){J.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,wt))}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(J.visibilityState==="hidden")return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const r=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),s=this.player_.liveTracker;let n=this.player_.duration();s&&s.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(t*100).toFixed(2)),this.percent_=t),(this.currentTime_!==r||this.duration_!==n)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[ji(r,n),ji(n,n)],"{1} of {2}")),this.currentTime_=r,this.duration_=n),this.bar&&this.bar.update(Tr(this.el()),this.getProgress())}),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()}getPercent(){const e=this.getCurrentTime_();let t;const r=this.player_.liveTracker;return r&&r.isLive()?(t=(e-r.seekableStart())/r.liveWindow(),r.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){!Es(e)||(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!Es(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let r;const s=this.calculateDistance(e),n=this.player_.liveTracker;if(!n||!n.isLive())r=s*this.player_.duration(),r===this.player_.duration()&&(r=r-.1);else{if(s>=.99){n.seekToLiveEdge();return}const a=n.seekableStart(),o=n.liveCurrentTime();if(r=a+s*n.liveWindow(),r>=o&&(r=o),r<=a&&(r=a+.1),r===1/0)return}this.userSeek_(r)}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.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?$t(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+dn)}stepBack(){this.userSeek_(this.player_.currentTime()-dn)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(he.isEventKey(e,"Space")||he.isEventKey(e,"Enter"))e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(he.isEventKey(e,"Home"))e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(he.isEventKey(e,"End"))e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(he(e))){e.preventDefault(),e.stopPropagation();const r=(he.codes[he(e)]-he.codes[0])*10/100;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*r):this.userSeek_(this.player_.duration()*r)}else he.isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-dn*Cd)):he.isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+dn*Cd)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],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 J&&"visibilityState"in J&&this.off(J,"visibilitychange",this.toggleVisibility_),super.dispose()}}Tu.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};!ot&&!Yt&&Tu.prototype.options_.children.splice(1,0,"mouseTimeDisplay");z.registerComponent("SeekBar",Tu);class Yh extends z{constructor(e,t){super(e,t),this.handleMouseMove=Zt(Le(this,this.handleMouseMove),wt),this.throttledHandleMouseSeek=Zt(Le(this,this.handleMouseSeek),wt),this.handleMouseUpHandler_=r=>this.handleMouseUp(r),this.handleMouseDownHandler_=r=>this.handleMouseDown(r),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const r=t.getChild("playProgressBar"),s=t.getChild("mouseTimeDisplay");if(!r&&!s)return;const n=t.el(),a=bs(n);let o=oa(n,e).x;o=Is(o,0,1),s&&s.update(a,o),r&&r.update(a,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&$t(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",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,r=this.getChild("seekBar");r&&r.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()}}Yh.prototype.options_={children:["seekBar"]};z.registerComponent("ProgressControl",Yh);class Qh extends Tt{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],r=>this.handlePictureInPictureChange(r)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],r=>this.handlePictureInPictureEnabledChange(r)),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(){J.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in R?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 J.exitPictureInPicture=="function"&&super.show()}}Qh.prototype.controlText_="Picture-in-Picture";z.registerComponent("PictureInPictureToggle",Qh);class Jh extends Tt{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",r=>this.handleFullscreenChange(r)),J[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()}}Jh.prototype.controlText_="Fullscreen";z.registerComponent("FullscreenToggle",Jh);const _y=function(i,e){e.tech_&&!e.tech_.featuresVolumeControl&&i.addClass("vjs-hidden"),i.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})};class vy extends z{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}}z.registerComponent("VolumeLevel",vy);class yy extends z{constructor(e,t){super(e,t),this.update=Zt(Le(this,this.update),wt)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,r,s){if(!r){const n=Tr(this.el_),a=Tr(this.player_.el()),o=e.width*t;if(!a||!n)return;const l=e.left-a.left+o,h=e.width-o+(a.right-e.right);let c=n.width/2;l<c?c+=c-l:h<c&&(c=h),c<0?c=0:c>n.width&&(c=n.width),this.el_.style.right=`-${c}px`}this.write(`${s}%`)}write(e){Ei(this.el_,e)}updateVolume(e,t,r,s,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,r,s.toFixed(0)),n&&n()})}}z.registerComponent("VolumeLevelTooltip",yy);class Zh extends z{constructor(e,t){super(e,t),this.update=Zt(Le(this,this.update),wt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,r){const s=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,r,s,()=>{r?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}}Zh.prototype.options_={children:["volumeLevelTooltip"]};z.registerComponent("MouseVolumeLevelDisplay",Zh);class pa extends vu{constructor(e,t){super(e,t),this.on("slideractive",r=>this.updateLastVolume_(r)),this.on(e,"volumechange",r=>this.updateARIAAttributes(r)),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){!Es(e)||super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const r=this.el(),s=Tr(r),n=this.vertical();let a=oa(r,e);a=n?a.y:a.x,a=Is(a,0,1),t.update(s,a,n)}!Es(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)})}}pa.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!ot&&!Yt&&pa.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");pa.prototype.playerEvent="volumechange";z.registerComponent("VolumeBar",pa);class ef extends z{constructor(e,t={}){t.vertical=t.vertical||!1,(typeof t.volumeBar=="undefined"||vr(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),_y(this,e),this.throttledHandleMouseMove=Zt(Le(this,this.handleMouseMove),wt),this.handleMouseUpHandler_=r=>this.handleMouseUp(r),this.on("mousedown",r=>this.handleMouseDown(r)),this.on("touchstart",r=>this.handleMouseDown(r)),this.on("mousemove",r=>this.handleMouseMove(r)),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)}}ef.prototype.options_={children:["volumeBar"]};z.registerComponent("VolumeControl",ef);const Ty=function(i,e){e.tech_&&!e.tech_.featuresMuteControl&&i.addClass("vjs-hidden"),i.on(e,"loadstart",function(){e.tech_.featuresMuteControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})};class tf extends Tt{constructor(e,t){super(e,t),Ty(this,e),this.on(e,["loadstart","volumechange"],r=>this.update(r))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),r=this.player_.lastVolume_();if(t===0){const s=r<.1?.1:r;this.player_.volume(s),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"),ot&&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),na(this.el_,[0,1,2,3].reduce((r,s)=>r+`${s?" ":""}vjs-vol-${s}`,"")),Ni(this.el_,`vjs-vol-${t}`)}updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)}}tf.prototype.controlText_="Mute";z.registerComponent("MuteToggle",tf);class rf extends z{constructor(e,t={}){typeof t.inline!="undefined"?t.inline=t.inline:t.inline=!0,(typeof t.volumeControl=="undefined"||vr(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=r=>this.handleKeyPress(r),this.on(e,["loadstart"],r=>this.volumePanelState_(r)),this.on(this.muteToggle,"keyup",r=>this.handleKeyPress(r)),this.on(this.volumeControl,"keyup",r=>this.handleVolumeControlKeyUp(r)),this.on("keydown",r=>this.handleKeyPress(r)),this.on("mouseover",r=>this.handleMouseOver(r)),this.on("mouseout",r=>this.handleMouseOut(r)),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){he.isEventKey(e,"Esc")&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),xt(J,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),Qe(J,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){he.isEventKey(e,"Esc")&&this.handleMouseOut()}}rf.prototype.options_={children:["muteToggle","volumeControl"]};z.registerComponent("VolumePanel",rf);class xy extends Tt{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])),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(),r=this.player_.liveTracker,s=r&&r.isLive()?r.seekableEnd():this.player_.duration();let n;t+this.skipTime<=s?n=t+this.skipTime:n=s,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}z.registerComponent("SkipForward",xy);class sf extends Tt{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} seconds",[this.skipTime])),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(),r=this.player_.liveTracker,s=r&&r.isLive()&&r.seekableStart();let n;s&&t-this.skipTime<=s?n=s:t>=this.skipTime?n=t-this.skipTime:n=0,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}sf.prototype.controlText_="Skip Backward";z.registerComponent("SkipBackward",sf);class nf extends z{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",r=>this.handleKeyDown(r)),this.boundHandleBlur_=r=>this.handleBlur(r),this.boundHandleTapClick_=r=>this.handleTapClick(r)}addEventListenerForItem(e){e instanceof z&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof z&&(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_=me(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_),xt(t,"click",function(r){r.preventDefault(),r.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||J.activeElement;if(!this.children().some(r=>r.el()===t)){const r=this.menuButton_;r&&r.buttonPressed_&&t!==r.el().firstChild&&r.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const r=t.filter(s=>s.el()===e.target)[0];if(!r)return;r.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}}handleKeyDown(e){he.isEventKey(e,"Left")||he.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(he.isEventKey(e,"Right")||he.isEventKey(e,"Up"))&&(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())}}z.registerComponent("Menu",nf);class xu extends z{constructor(e,t={}){super(e,t),this.menuButton_=new Tt(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const r=Tt.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+r,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const s=n=>this.handleClick(n);this.handleMenuKeyUp_=n=>this.handleMenuKeyUp(n),this.on(this.menuButton_,"tap",s),this.on(this.menuButton_,"click",s),this.on(this.menuButton_,"keydown",n=>this.handleKeyDown(n)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),xt(J,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",n=>this.handleMouseLeave(n)),this.on("keydown",n=>this.handleSubmenuKeyDown(n))}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 nf(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=me("li",{className:"vjs-menu-title",textContent:Me(this.options_.title),tabIndex:-1}),r=new z(this.player_,{el:t});e.addItem(r)}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){super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";this.options_.inline===!0?e+="-inline":e+="-popup";const t=Tt.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"),Qe(J,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){he.isEventKey(e,"Esc")||he.isEventKey(e,"Tab")?(this.buttonPressed_&&this.unpressButton(),he.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus())):(he.isEventKey(e,"Up")||he.isEventKey(e,"Down"))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))}handleMenuKeyUp(e){(he.isEventKey(e,"Esc")||he.isEventKey(e,"Tab"))&&this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){(he.isEventKey(e,"Esc")||he.isEventKey(e,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),he.isEventKey(e,"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"),ot&&gh())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}}z.registerComponent("MenuButton",xu);class bu extends xu{constructor(e,t){const r=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!r)return;const s=Le(this,this.update);r.addEventListener("removetrack",s),r.addEventListener("addtrack",s),r.addEventListener("labelchange",s),this.player_.on("ready",s),this.player_.on("dispose",function(){r.removeEventListener("removetrack",s),r.removeEventListener("addtrack",s),r.removeEventListener("labelchange",s)})}}z.registerComponent("TrackButton",bu);const by=["Tab","Esc","Up","Down","Right","Left"];class ks extends fa{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,r){this.nonIconControl=!0;const s=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),r),n=me("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?s.appendChild(n):s.replaceChild(n,s.querySelector(".vjs-icon-placeholder")),s}handleKeyDown(e){by.some(t=>he.isEventKey(e,t))||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))}}z.registerComponent("MenuItem",ks);class Os extends ks{constructor(e,t){const r=t.track,s=e.textTracks();t.label=r.label||r.language||"Unknown",t.selected=r.mode==="showing",super(e,t),this.track=r,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const n=(...o)=>{this.handleTracksChange.apply(this,o)},a=(...o)=>{this.handleSelectedLanguageChange.apply(this,o)};if(e.on(["loadstart","texttrackchange"],n),s.addEventListener("change",n),s.addEventListener("selectedlanguagechange",a),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],n),s.removeEventListener("change",n),s.removeEventListener("selectedlanguagechange",a)}),s.onchange===void 0){let o;this.on(["tap","click"],function(){if(typeof R.Event!="object")try{o=new R.Event("change")}catch(l){}o||(o=J.createEvent("Event"),o.initEvent("change",!0,!0)),s.dispatchEvent(o)})}this.handleTracksChange()}handleClick(e){const t=this.track,r=this.player_.textTracks();if(super.handleClick(e),!!r)for(let s=0;s<r.length;s++){const n=r[s];this.kinds.indexOf(n.kind)!==-1&&(n===t?n.mode!=="showing"&&(n.mode="showing"):n.mode!=="disabled"&&(n.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()}}z.registerComponent("TextTrackMenuItem",Os);class af extends Os{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 r=!0;for(let s=0,n=t.length;s<n;s++){const a=t[s];if(this.options_.kinds.indexOf(a.kind)>-1&&a.mode==="showing"){r=!1;break}}r!==this.isSelected_&&this.selected(r)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let r=!0;for(let s=0,n=t.length;s<n;s++){const a=t[s];if(["captions","descriptions","subtitles"].indexOf(a.kind)>-1&&a.mode==="showing"){r=!1;break}}r&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}z.registerComponent("OffTextTrackMenuItem",af);class Ir extends bu{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=Os){let r;this.label_&&(r=`${this.label_} off`),e.push(new af(this.player_,{kinds:this.kinds_,kind:this.kind_,label:r})),this.hideThreshold_+=1;const s=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n<s.length;n++){const a=s[n];if(this.kinds_.indexOf(a.kind)>-1){const o=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});o.addClass(`vjs-${a.kind}-menu-item`),e.push(o)}}return e}}z.registerComponent("TextTrackButton",Ir);class of extends ks{constructor(e,t){const r=t.track,s=t.cue,n=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=s.text,t.selected=s.startTime<=n&&n<s.endTime,super(e,t),this.track=r,this.cue=s}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}z.registerComponent("ChaptersTrackMenuItem",of);class Eu extends Ir{constructor(e,t,r){super(e,t,r),this.setIcon("chapters"),this.selectCurrentItem_=()=>{this.items.forEach(s=>{s.selected(this.track_.activeCues[0]===s.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 r=e[t];if(r.kind===this.kind_)return r}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(Me(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 r=0,s=t.length;r<s;r++){const n=t[r],a=new of(this.player_,{track:this.track_,cue:n});e.push(a)}return e}}Eu.prototype.kind_="chapters";Eu.prototype.controlText_="Chapters";z.registerComponent("ChaptersButton",Eu);class Su extends Ir{constructor(e,t,r){super(e,t,r),this.setIcon("audio-description");const s=e.textTracks(),n=Le(this,this.handleTracksChange);s.addEventListener("change",n),this.on("dispose",function(){s.removeEventListener("change",n)})}handleTracksChange(e){const t=this.player().textTracks();let r=!1;for(let s=0,n=t.length;s<n;s++){const a=t[s];if(a.kind!==this.kind_&&a.mode==="showing"){r=!0;break}}r?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}Su.prototype.kind_="descriptions";Su.prototype.controlText_="Descriptions";z.registerComponent("DescriptionsButton",Su);class Cu extends Ir{constructor(e,t,r){super(e,t,r),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}Cu.prototype.kind_="subtitles";Cu.prototype.controlText_="Subtitles";z.registerComponent("SubtitlesButton",Cu);class Au extends Os{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()}}z.registerComponent("CaptionSettingsMenuItem",Au);class Du extends Ir{constructor(e,t,r){super(e,t,r),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 Au(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}Du.prototype.kind_="captions";Du.prototype.controlText_="Captions";z.registerComponent("CaptionsButton",Du);class uf extends Os{createEl(e,t,r){const s=super.createEl(e,t,r),n=s.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="captions"&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",s):n.appendChild(me("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(me("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),s}}z.registerComponent("SubsCapsMenuItem",uf);class wu extends Ir{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(Me(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 Au(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,uf),e}}wu.prototype.kinds_=["captions","subtitles"];wu.prototype.controlText_="Subtitles";z.registerComponent("SubsCapsButton",wu);class lf extends ks{constructor(e,t){const r=t.track,s=e.audioTracks();t.label=r.label||r.language||"Unknown",t.selected=r.enabled,super(e,t),this.track=r,this.addClass(`vjs-${r.kind}-menu-item`);const n=(...a)=>{this.handleTracksChange.apply(this,a)};s.addEventListener("change",n),this.on("dispose",()=>{s.removeEventListener("change",n)})}createEl(e,t,r){const s=super.createEl(e,t,r),n=s.querySelector(".vjs-menu-item-text");return["main-desc","description"].indexOf(this.options_.track.kind)>=0&&(n.appendChild(me("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(me("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),s}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let r=0;r<t.length;r++){const s=t[r];s!==this.track&&(s.enabled=s===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}z.registerComponent("AudioTrackMenuItem",lf);class df extends bu{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 r=0;r<t.length;r++){const s=t[r];e.push(new lf(this.player_,{track:s,selectable:!0,multiSelectable:!1}))}return e}}df.prototype.controlText_="Audio Track";z.registerComponent("AudioTrackButton",df);class Lu extends ks{constructor(e,t){const r=t.rate,s=parseFloat(r,10);t.label=r,t.selected=s===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=r,this.rate=s,this.on(e,"ratechange",n=>this.update(n))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}Lu.prototype.contentElType="button";z.registerComponent("PlaybackRateMenuItem",Lu);class cf extends xu{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",r=>this.updateVisibility(r)),this.on(e,"ratechange",r=>this.updateLabel(r)),this.on(e,"playbackrateschange",r=>this.handlePlaybackRateschange(r))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=me("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 r=e.length-1;r>=0;r--)t.push(new Lu(this.player(),{rate:e[r]+"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")}}cf.prototype.controlText_="Playback Rate";z.registerComponent("PlaybackRateMenuButton",cf);class hf extends z{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},r={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,r)}}z.registerComponent("Spacer",hf);class Ey extends hf{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:"\xA0"})}}z.registerComponent("CustomControlSpacer",Ey);class ff extends z{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}ff.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]};z.registerComponent("ControlBar",ff);class pf extends wr{constructor(e,t){super(e,t),this.on(e,"error",r=>this.open(r))}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}pf.prototype.options_=Object.assign({},wr.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});z.registerComponent("ErrorDisplay",pf);const Xa="vjs-text-track-settings",Ad=["#000","Black"],Dd=["#00F","Blue"],wd=["#0FF","Cyan"],Ld=["#0F0","Green"],Id=["#F0F","Magenta"],kd=["#F00","Red"],Od=["#FFF","White"],Pd=["#FF0","Yellow"],Ya=["1","Opaque"],Qa=["0.5","Semi-Transparent"],Rd=["0","Transparent"],Pi={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Ad,Od,kd,Ld,Dd,Pd,Id,wd]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Ya,Qa,Rd]},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Od,Ad,kd,Ld,Dd,Pd,Id,wd]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",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:"captions-font-size-%s",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:i=>i==="1.00"?null:Number(i)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[Ya,Qa]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[Rd,Qa,Ya]}};Pi.windowColor.options=Pi.backgroundColor.options;function mf(i,e){if(e&&(i=e(i)),i&&i!=="none")return i}function Sy(i,e){const t=i.options[i.options.selectedIndex].value;return mf(t,e)}function Cy(i,e,t){if(!!e){for(let r=0;r<i.options.length;r++)if(mf(i.options[r].value,t)===e){i.selectedIndex=r;break}}}class Ay extends wr{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.endDialog=me("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.on(this.$(".vjs-done-button"),"click",()=>{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),"click",()=>{this.setDefaults(),this.updateDisplay()}),ar(Pi,r=>{this.on(this.$(r.selector),"change",this.updateDisplay)}),this.options_.persistTextTrackSettings&&this.restoreSettings()}dispose(){this.endDialog=null,super.dispose()}createElSelect_(e,t="",r="label"){const s=Pi[e],n=s.id.replace("%s",this.id_),a=[t,n].join(" ").trim();return[`<${r} id="${n}" class="${r==="label"?"vjs-label":""}">`,this.localize(s.label),`</${r}>`,`<select aria-labelledby="${a}">`].concat(s.options.map(o=>{const l=n+"-"+o[1].replace(/\W+/g,"");return[`<option id="${l}" value="${o[0]}" `,`aria-labelledby="${a} ${l}">`,this.localize(o[1]),"</option>"].join("")})).concat("</select>").join("")}createElFgColor_(){const e=`captions-text-legend-${this.id_}`;return['<fieldset class="vjs-fg vjs-track-setting">',`<legend id="${e}">`,this.localize("Text"),"</legend>",'<span class="vjs-text-color">',this.createElSelect_("color",e),"</span>",'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")}createElBgColor_(){const e=`captions-background-${this.id_}`;return['<fieldset class="vjs-bg vjs-track-setting">',`<legend id="${e}">`,this.localize("Text Background"),"</legend>",'<span class="vjs-bg-color">',this.createElSelect_("backgroundColor",e),"</span>",'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")}createElWinColor_(){const e=`captions-window-${this.id_}`;return['<fieldset class="vjs-window vjs-track-setting">',`<legend id="${e}">`,this.localize("Caption Area Background"),"</legend>",'<span class="vjs-window-color">',this.createElSelect_("windowColor",e),"</span>",'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")}createElColors_(){return me("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})}createElFont_(){return me("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})}createElControls_(){const e=this.localize("restore all settings to the default values");return me("div",{className:"vjs-track-settings-controls",innerHTML:[`<button type="button" class="vjs-default-button" title="${e}">`,this.localize("Reset"),`<span class="vjs-control-text"> ${e}</span>`,"</button>",`<button type="button" class="vjs-done-button">${this.localize("Done")}</button>`].join("")})}content(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]}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 dh(Pi,(e,t,r)=>{const s=Sy(this.$(t.selector),t.parser);return s!==void 0&&(e[r]=s),e},{})}setValues(e){ar(Pi,(t,r)=>{Cy(this.$(t.selector),e[r],t.parser)})}setDefaults(){ar(Pi,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(R.localStorage.getItem(Xa))}catch(t){ye.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?R.localStorage.setItem(Xa,JSON.stringify(e)):R.localStorage.removeItem(Xa)}catch(t){ye.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}conditionalBlur_(){this.previouslyActiveEl_=null;const e=this.player_.controlBar,t=e&&e.subsCapsButton,r=e&&e.captionsButton;t?t.focus():r&&r.focus()}handleLanguagechange(){this.fill()}}z.registerComponent("TextTrackSettings",Ay);class Dy extends z{constructor(e,t){let r=t.ResizeObserver||R.ResizeObserver;t.ResizeObserver===null&&(r=!1);const s=we({createEl:!r,reportTouchActivity:!1},t);super(e,s),this.ResizeObserver=t.ResizeObserver||R.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=Oh(()=>{this.resizeHandler()},100,!1,this),r?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const n=this.debouncedHandler_;let a=this.unloadListener_=function(){Qe(this,"resize",n),Qe(this,"unload",a),a=null};xt(this.el_.contentWindow,"unload",a),xt(this.el_.contentWindow,"resize",n)},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()}}z.registerComponent("ResizeManager",Dy);const wy={trackingThreshold:20,liveTolerance:15};class Ly extends z{constructor(e,t){const r=we(wy,t,{createEl:!1});super(e,r),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=s=>this.handlePlay(s),this.handleFirstTimeupdate_=s=>this.handleFirstTimeupdate(s),this.handleSeeked_=s=>this.handleSeeked(s),this.seekToLiveEdge_=s=>this.seekToLiveEdge(s),this.reset_(),this.on(this.player_,"durationchange",s=>this.handleDurationchange(s)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(R.performance.now().toFixed(4)),r=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+r;const s=this.liveCurrentTime(),n=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(s-n)>this.options_.liveTolerance;(!this.timeupdateSeen_||s===1/0)&&(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,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_,wt),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 r=e?e.length:0;for(;r--;)t.push(e.end(r));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let r=e?e.length:0;for(;r--;)t.push(e.start(r));return t.length?t.sort()[0]:0}liveWindow(){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()}}z.registerComponent("LiveTracker",Ly);class Iy extends z{constructor(e,t){super(e,t),this.on("statechanged",r=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:me("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${Jt()}`}),description:me("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${Jt()}`})},me("div",{className:"vjs-title-bar"},{},ch(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,r={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(s=>{const n=this.state[s],a=this.els[s],o=r[s];ua(a),n&&Ei(a,n),t&&(t.removeAttribute(o),n&&t.setAttribute(o,a.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}}z.registerComponent("TitleBar",Iy);const yo=i=>{const e=i.el();if(e.hasAttribute("src"))return i.triggerSourceset(e.src),!0;const t=i.$$("source"),r=[];let s="";if(!t.length)return!1;for(let n=0;n<t.length;n++){const a=t[n].src;a&&r.indexOf(a)===-1&&r.push(a)}return r.length?(r.length===1&&(s=r[0]),i.triggerSourceset(s),!0):!1},ky=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(i){const e=J.createElement(this.nodeName.toLowerCase());e.innerHTML=i;const t=J.createDocumentFragment();for(;e.childNodes.length;)t.appendChild(e.childNodes[0]);return this.innerText="",R.Element.prototype.appendChild.call(this,t),this.innerHTML}}),gf=(i,e)=>{let t={};for(let r=0;r<i.length&&(t=Object.getOwnPropertyDescriptor(i[r],e),!(t&&t.set&&t.get));r++);return t.enumerable=!0,t.configurable=!0,t},Oy=i=>gf([i.el(),R.HTMLMediaElement.prototype,R.Element.prototype,ky],"innerHTML"),Md=function(i){const e=i.el();if(e.resetSourceWatch_)return;const t={},r=Oy(i),s=n=>(...a)=>{const o=n.apply(e,a);return yo(i),o};["append","appendChild","insertAdjacentHTML"].forEach(n=>{!e[n]||(t[n]=e[n],e[n]=s(t[n]))}),Object.defineProperty(e,"innerHTML",we(r,{set:s(r.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(t).forEach(n=>{e[n]=t[n]}),Object.defineProperty(e,"innerHTML",r)},i.one("sourceset",e.resetSourceWatch_)},Py=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?$h(R.Element.prototype.getAttribute.call(this,"src")):""},set(i){return R.Element.prototype.setAttribute.call(this,"src",i),i}}),Ry=i=>gf([i.el(),R.HTMLMediaElement.prototype,Py],"src"),My=function(i){if(!i.featuresSourceset)return;const e=i.el();if(e.resetSourceset_)return;const t=Ry(i),r=e.setAttribute,s=e.load;Object.defineProperty(e,"src",we(t,{set:n=>{const a=t.set.call(e,n);return i.triggerSourceset(e.src),a}})),e.setAttribute=(n,a)=>{const o=r.call(e,n,a);return/src/i.test(n)&&i.triggerSourceset(e.src),o},e.load=()=>{const n=s.call(e);return yo(i)||(i.triggerSourceset(""),Md(i)),n},e.currentSrc?i.triggerSourceset(e.currentSrc):yo(i)||Md(i),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=s,e.setAttribute=r,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};class te extends fe{constructor(e,t){super(e,t);const r=e.source;let s=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",r&&(this.el_.currentSrc!==r.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(r):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const n=this.el_.childNodes;let a=n.length;const o=[];for(;a--;){const l=n[a];l.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(l),this.remoteTextTracks().addTrack(l.track),this.textTracks().addTrack(l.track),!s&&!this.el_.hasAttribute("crossorigin")&&ha(l.src)&&(s=!0)):o.push(l))}for(let l=0;l<o.length;l++)this.el_.removeChild(o[l])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&s&&ye.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
This may prevent text tracks from loading.`),this.restoreMetadataTracksInIOSNativePlayer_(),(xs||ra)&&e.nativeControlsForTouch===!0&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),te.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){My(this)}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const r=()=>{t=[];for(let n=0;n<e.length;n++){const a=e[n];a.kind==="metadata"&&t.push({track:a,storedMode:a.mode})}};r(),e.addEventListener("change",r),this.on("dispose",()=>e.removeEventListener("change",r));const s=()=>{for(let n=0;n<t.length;n++){const a=t[n];a.track.mode==="disabled"&&a.track.mode!==a.storedMode&&(a.track.mode=a.storedMode)}e.removeEventListener("change",s)};this.on("webkitbeginfullscreen",()=>{e.removeEventListener("change",r),e.removeEventListener("change",s),e.addEventListener("change",s)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",r),e.addEventListener("change",r),e.removeEventListener("change",s)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const r=e.toLowerCase();this[`${r}TracksListeners_`]&&Object.keys(this[`${r}TracksListeners_`]).forEach(s=>{this.el()[`${r}Tracks`].removeEventListener(s,this[`${r}TracksListeners_`][s])}),this[`featuresNative${e}Tracks`]=!t,this[`${r}TracksListeners_`]=null,this.proxyNativeTracksForType_(r)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=Dt[e],r=this.el()[t.getterName],s=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!r||!r.addEventListener)return;const n={change:o=>{const l={type:"change",target:s,currentTarget:s,srcElement:s};s.trigger(l),e==="text"&&this[Er.remoteText.getterName]().trigger(l)},addtrack(o){s.addTrack(o.track)},removetrack(o){s.removeTrack(o.track)}},a=function(){const o=[];for(let l=0;l<s.length;l++){let h=!1;for(let c=0;c<r.length;c++)if(r[c]===s[l]){h=!0;break}h||o.push(s[l])}for(;o.length;)s.removeTrack(o.shift())};this[t.getterName+"Listeners_"]=n,Object.keys(n).forEach(o=>{const l=n[o];r.addEventListener(o,l),this.on("dispose",h=>r.removeEventListener(o,l))}),this.on("loadstart",a),this.on("dispose",o=>this.off("loadstart",a))}proxyNativeTracks_(){Dt.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){const r=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(r,e),te.disposeMediaElement(e),e=r}else{e=J.createElement("video");const r=this.options_.tag&&vi(this.options_.tag),s=we({},r);(!xs||this.options_.nativeControlsForTouch!==!0)&&delete s.controls,yh(e,Object.assign(s,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload!="undefined"&&yr(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let r=0;r<t.length;r++){const s=t[r],n=this.options_[s];typeof n!="undefined"&&(n?yr(e,s,s):aa(e,s),e[s]=n)}return e}handleLateInit_(e){if(e.networkState===0||e.networkState===3)return;if(e.readyState===0){let r=!1;const s=function(){r=!0};this.on("loadstart",s);const n=function(){r||this.trigger("loadstart")};this.on("loadedmetadata",n),this.ready(function(){this.off("loadstart",s),this.off("loadedmetadata",n),r||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(r){this.trigger(r)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&sa?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){ye(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&Yt&&Qt&&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)$t(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)}reset(){te.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,r){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,r):super.addTextTrack(e,t,r)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=J.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 r=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(r),r}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let r=t.length;for(;r--;)(e===t[r]||e===t[r].track)&&this.el().removeChild(t[r])}}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),R.performance&&(e.creationTime=R.performance.now()),e}}ea(te,"TEST_VID",function(){if(!Cr())return;const i=J.createElement("video"),e=J.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",i.appendChild(e),i});te.isSupported=function(){try{te.TEST_VID.volume=.5}catch(i){return!1}return!!(te.TEST_VID&&te.TEST_VID.canPlayType)};te.canPlayType=function(i){return te.TEST_VID.canPlayType(i)};te.canPlaySource=function(i,e){return te.canPlayType(i.type)};te.canControlVolume=function(){try{const i=te.TEST_VID.volume;te.TEST_VID.volume=i/2+.1;const e=i!==te.TEST_VID.volume;return e&&ot?(R.setTimeout(()=>{te&&te.prototype&&(te.prototype.featuresVolumeControl=i!==te.TEST_VID.volume)}),!1):e}catch(i){return!1}};te.canMuteVolume=function(){try{const i=te.TEST_VID.muted;return te.TEST_VID.muted=!i,te.TEST_VID.muted?yr(te.TEST_VID,"muted","muted"):aa(te.TEST_VID,"muted","muted"),i!==te.TEST_VID.muted}catch(i){return!1}};te.canControlPlaybackRate=function(){if(Yt&&Qt&&ta<58)return!1;try{const i=te.TEST_VID.playbackRate;return te.TEST_VID.playbackRate=i/2+.1,i!==te.TEST_VID.playbackRate}catch(i){return!1}};te.canOverrideAttributes=function(){try{const i=()=>{};Object.defineProperty(J.createElement("video"),"src",{get:i,set:i}),Object.defineProperty(J.createElement("audio"),"src",{get:i,set:i}),Object.defineProperty(J.createElement("video"),"innerHTML",{get:i,set:i}),Object.defineProperty(J.createElement("audio"),"innerHTML",{get:i,set:i})}catch(i){return!1}return!0};te.supportsNativeTextTracks=function(){return sa||ot&&Qt};te.supportsNativeVideoTracks=function(){return!!(te.TEST_VID&&te.TEST_VID.videoTracks)};te.supportsNativeAudioTracks=function(){return!!(te.TEST_VID&&te.TEST_VID.audioTracks)};te.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"]].forEach(function([i,e]){ea(te.prototype,i,()=>te[e](),!0)});te.prototype.featuresVolumeControl=te.canControlVolume();te.prototype.movingMediaElementInDOM=!ot;te.prototype.featuresFullscreenResize=!0;te.prototype.featuresProgressEvents=!0;te.prototype.featuresTimeupdateEvents=!0;te.prototype.featuresVideoFrameCallback=!!(te.TEST_VID&&te.TEST_VID.requestVideoFrameCallback);te.disposeMediaElement=function(i){if(!!i){for(i.parentNode&&i.parentNode.removeChild(i);i.hasChildNodes();)i.removeChild(i.firstChild);i.removeAttribute("src"),typeof i.load=="function"&&function(){try{i.load()}catch(e){}}()}};te.resetMediaElement=function(i){if(!i)return;const e=i.querySelectorAll("source");let t=e.length;for(;t--;)i.removeChild(e[t]);i.removeAttribute("src"),typeof i.load=="function"&&function(){try{i.load()}catch(r){}}()};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(i){te.prototype[i]=function(){return this.el_[i]||this.el_.hasAttribute(i)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(i){te.prototype["set"+Me(i)]=function(e){this.el_[i]=e,e?this.el_.setAttribute(i,i):this.el_.removeAttribute(i)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(i){te.prototype[i]=function(){return this.el_[i]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(i){te.prototype["set"+Me(i)]=function(e){this.el_[i]=e}});["pause","load","play"].forEach(function(i){te.prototype[i]=function(){return this.el_[i]()}});fe.withSourceHandlers(te);te.nativeSourceHandler={};te.nativeSourceHandler.canPlayType=function(i){try{return te.TEST_VID.canPlayType(i)}catch(e){return""}};te.nativeSourceHandler.canHandleSource=function(i,e){if(i.type)return te.nativeSourceHandler.canPlayType(i.type);if(i.src){const t=fu(i.src);return te.nativeSourceHandler.canPlayType(`video/${t}`)}return""};te.nativeSourceHandler.handleSource=function(i,e,t){e.setSrc(i.src)};te.nativeSourceHandler.dispose=function(){};te.registerSourceHandler(te.nativeSourceHandler);fe.registerTech("Html5",te);const _f=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Ja={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},To=["tiny","xsmall","small","medium","large","xlarge","huge"],gn={};To.forEach(i=>{const e=i.charAt(0)==="x"?`x-${i.substring(1)}`:i;gn[i]=`vjs-layout-${e}`});const By={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class Ie extends z{constructor(e,t,r){if(e.id=e.id||t.id||`vjs_video_${Jt()}`,t=Object.assign(Ie.getTagSettings(e),t),t.initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const a=e.closest("[lang]");a&&(t.language=a.getAttribute("lang"))}if(super(null,t,r),this.boundDocumentFullscreenChange_=a=>this.documentFullscreenChange_(a),this.boundFullWindowOnEscKey_=a=>this.fullWindowOnEscKey(a),this.boundUpdateStyleEl_=a=>this.updateStyleEl_(a),this.boundApplyInitTime_=a=>this.applyInitTime_(a),this.boundUpdateCurrentBreakpoint_=a=>this.updateCurrentBreakpoint_(a),this.boundHandleTechClick_=a=>this.handleTechClick_(a),this.boundHandleTechDoubleClick_=a=>this.handleTechDoubleClick_(a),this.boundHandleTechTouchStart_=a=>this.handleTechTouchStart_(a),this.boundHandleTechTouchMove_=a=>this.handleTechTouchMove_(a),this.boundHandleTechTouchEnd_=a=>this.handleTechTouchEnd_(a),this.boundHandleTechTap_=a=>this.handleTechTap_(a),this.isFullscreen_=!1,this.log=uh(this.id_),this.fsApi_=wn,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_={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&&vi(e),this.language(this.options_.language),t.languages){const a={};Object.getOwnPropertyNames(t.languages).forEach(function(o){a[o.toLowerCase()]=t.languages[o]}),this.languages_=a}else this.languages_=Ie.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(a=>{if(typeof this[a]!="function")throw new Error(`plugin "${a}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),lu(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(xt(J,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const s=we(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(a=>{this[a](t.plugins[a])}),t.debug&&this.debug(!0),this.options_.playerOptions=s,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const o=new R.DOMParser().parseFromString(ay,"image/svg+xml");if(o.querySelector("parsererror"))ye.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const h=o.documentElement;h.style.display="none",this.el_.appendChild(h),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"),xs&&this.addClass("vjs-touch-enabled"),ot||this.addClass("vjs-workinghover"),Ie.players[this.id_]=this;const n=ah.split(".")[0];this.addClass(`vjs-v${n}`),this.userActive(!0),this.reportUserActivity(),this.one("play",a=>this.listenForUserActivity_(a)),this.on("keydown",a=>this.handleKeyDown(a)),this.on("languagechange",a=>this.handleLanguagechange(a)),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"),Qe(J,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Qe(J,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),Ie.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),iy(this),rt.names.forEach(e=>{const t=rt[e],r=this[t.getterName]();r&&r.off&&r.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,t,r=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player");const s=this.tag.tagName.toLowerCase()==="video-js";r?t=this.el_=e.parentNode:s||(t=this.el_=super.createEl("div"));const n=vi(e);if(s){for(t=this.el_=e,e=this.tag=J.createElement("video");t.children.length;)e.appendChild(t.firstChild);ds(t,"video-js")||Ni(t,"video-js"),t.appendChild(e),r=this.playerElIngest_=t,Object.keys(t).forEach(o=>{try{e[o]=t[o]}catch(l){}})}if(e.setAttribute("tabindex","-1"),n.tabindex="-1",Qt&&ia&&(e.setAttribute("role","application"),n.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in n&&delete n.width,"height"in n&&delete n.height,Object.getOwnPropertyNames(n).forEach(function(o){s&&o==="class"||t.setAttribute(o,n[o]),s&&e.setAttribute(o,n[o])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=t.player=this,this.addClass("vjs-paused"),R.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=Ih("vjs-styles-dimensions");const o=Ti(".vjs-styles-defaults"),l=Ti("head");l.insertBefore(this.styleEl_,o?o.nextSibling:l.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 a=e.getElementsByTagName("a");for(let o=0;o<a.length;o++){const l=a.item(o);Ni(l,"vjs-hidden"),l.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!r&&e.parentNode.insertBefore(t,e),co(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"){ye.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 r=e+"_";if(t===void 0)return this[r]||0;if(t===""||t==="auto"){this[r]=void 0,this.updateStyleEl_();return}const s=parseFloat(t);if(isNaN(s)){ye.error(`Improper value "${t}" supplied for for ${e}`);return}this[r]=s,this.updateStyleEl_()}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,oi(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),Ov(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(R.VIDEOJS_NO_DYNAMIC_STYLE===!0){const o=typeof this.width_=="number"?this.width_:this.options_.width,l=typeof this.height_=="number"?this.height_:this.options_.height,h=this.tech_&&this.tech_.el();h&&(o>=0&&(h.width=o),l>=0&&(h.height=l));return}let e,t,r,s;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?r=this.aspectRatio_:this.videoWidth()>0?r=this.videoWidth()+":"+this.videoHeight():r="16:9";const n=r.split(":"),a=n[1]/n[0];this.width_!==void 0?e=this.width_:this.height_!==void 0?e=this.height_/a:e=this.videoWidth()||300,this.height_!==void 0?t=this.height_:t=e*a,/^[^a-zA-Z]/.test(this.id())?s="dimensions-"+this.id():s=this.id()+"-dimensions",this.addClass(s),kh(this.styleEl_,`
.${s} {
width: ${e}px;
height: ${t}px;
}
.${s}.vjs-fluid:not(.vjs-audio-only-mode) {
padding-top: ${a*100}%;
}
`)}loadTech_(e,t){this.tech_&&this.unloadTech_();const r=Me(e),s=e.charAt(0).toLowerCase()+e.slice(1);r!=="Html5"&&this.tag&&(fe.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=r,this.isReady_=!1;let n=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(n=!1);const a={source:t,autoplay:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${s}_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};rt.names.forEach(l=>{const h=rt[l];a[h.getterName]=this[h.privateName]}),Object.assign(a,this.options_[r]),Object.assign(a,this.options_[s]),Object.assign(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);const o=fe.getTech(e);if(!o)throw new Error(`No Tech named '${r}' exists! '${r}' should be registered using videojs.registerTech()'`);this.tech_=new o(a),this.tech_.ready(Le(this,this.handleTechReady_),!0),gd.jsonToTextTracks(this.textTracksJson_||[],this.tech_),_f.forEach(l=>{this.on(this.tech_,l,h=>this[`handleTech${Me(l)}_`](h))}),Object.keys(Ja).forEach(l=>{this.on(this.tech_,l,h=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${Ja[l]}_`].bind(this),event:h});return}this[`handleTech${Ja[l]}_`](h)})}),this.on(this.tech_,"loadstart",l=>this.handleTechLoadStart_(l)),this.on(this.tech_,"sourceset",l=>this.handleTechSourceset_(l)),this.on(this.tech_,"waiting",l=>this.handleTechWaiting_(l)),this.on(this.tech_,"ended",l=>this.handleTechEnded_(l)),this.on(this.tech_,"seeking",l=>this.handleTechSeeking_(l)),this.on(this.tech_,"play",l=>this.handleTechPlay_(l)),this.on(this.tech_,"pause",l=>this.handleTechPause_(l)),this.on(this.tech_,"durationchange",l=>this.handleTechDurationChange_(l)),this.on(this.tech_,"fullscreenchange",(l,h)=>this.handleTechFullscreenChange_(l,h)),this.on(this.tech_,"fullscreenerror",(l,h)=>this.handleTechFullscreenError_(l,h)),this.on(this.tech_,"enterpictureinpicture",l=>this.handleTechEnterPictureInPicture_(l)),this.on(this.tech_,"leavepictureinpicture",l=>this.handleTechLeavePictureInPicture_(l)),this.on(this.tech_,"error",l=>this.handleTechError_(l)),this.on(this.tech_,"posterchange",l=>this.handleTechPosterChange_(l)),this.on(this.tech_,"textdata",l=>this.handleTechTextData_(l)),this.on(this.tech_,"ratechange",l=>this.handleTechRateChange_(l)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(r!=="Html5"||!this.tag)&&co(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){rt.names.forEach(e=>{const t=rt[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=gd.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&&ye.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
See https://github.com/videojs/video.js/issues/2617 for more info.
`),this.tech_}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 s=this.muted();this.muted(!0);const n=()=>{this.muted(s)};this.playTerminatedQueue_.push(n);const a=this.play();if(!!hs(a))return a.catch(o=>{throw n(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${o||""}`)})};let r;if(e==="any"&&!this.muted()?(r=this.play(),hs(r)&&(r=r.catch(t))):e==="muted"&&!this.muted()?r=t():r=this.play(),!!hs(r))return r.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e,r="";typeof t!="string"&&(t=e.src,r=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!r&&(r=ny(this,t)),this.cache_.source=we({},e,{src:t,type:r});const s=this.cache_.sources.filter(l=>l.src&&l.src===t),n=[],a=this.$$("source"),o=[];for(let l=0;l<a.length;l++){const h=vi(a[l]);n.push(h),h.src&&h.src===t&&o.push(h.src)}o.length&&!s.length?this.cache_.sources=n:s.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=n=>this.updateSourceCaches_(n);const r=this.currentSource().src,s=e.src;r&&!/^blob:/.test(r)&&/^blob:/.test(s)&&(!this.lastSource_||this.lastSource_.tech!==s&&this.lastSource_.player!==r)&&(t=()=>{}),t(s),e.src||this.tech_.any(["sourceset","loadstart"],n=>{if(n.type==="sourceset")return;const a=this.techGet_("currentSrc");this.lastSource_.tech=a,this.updateSourceCaches_(a)})}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")}handleTechSeeked_(){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()?$t(this.play()):this.pause())}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),r=>r.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.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 r=this.el();let s=J[this.fsApi_.fullscreenElement]===r;!s&&r.matches&&(s=r.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(s)}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();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 ey)return Jv(this.middleware_,this.tech_,e,t);if(e in xd)return Td(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(r){throw ye(r),r}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in Zv)return Qv(this.middleware_,this.tech_,e);if(e in xd)return Td(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(ye(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(ye(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(ye(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=$t){this.playCallbacks_.push(e);const t=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc())),r=Boolean(sa||ot);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t){this.waitToPlay_=a=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!t&&r&&this.load();return}const s=this.techGet_("play");r&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),s===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(s)}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(r){r(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||Kt(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=Kt(0,0)),e}bufferedPercent(){return jh(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let r=e.end(e.length-1);return r>t&&(r=t),r}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_=Boolean(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((r,s)=>{function n(){t.off("fullscreenerror",o),t.off("fullscreenchange",a)}function a(){n(),r()}function o(h,c){n(),s(c)}t.one("fullscreenchange",a),t.one("fullscreenerror",o);const l=t.requestFullscreenHelper_(e);l&&(l.then(n,n),l.then(r,s))})}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 r=this.el_[this.fsApi_.requestFullscreen](t);return r&&r.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),r}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,r)=>{function s(){e.off("fullscreenerror",a),e.off("fullscreenchange",n)}function n(){s(),t()}function a(l,h){s(),r(h)}e.one("fullscreenchange",n),e.one("fullscreenerror",a);const o=e.exitFullscreenHelper_();o&&(o.then(s,s),o.then(t,r))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=J[this.fsApi_.exitFullscreen]();return e&&$t(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=J.documentElement.style.overflow,xt(J,"keydown",this.boundFullWindowOnEscKey_),J.documentElement.style.overflow="hidden",Ni(J.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){he.isEventKey(e,"Esc")&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,Qe(J,"keydown",this.boundFullWindowOnEscKey_),J.documentElement.style.overflow=this.docOrigOverflow,na(J.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&&R.documentPictureInPicture){const e=J.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(me("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),R.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(Dh(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("enterpictureinpicture"),t.addEventListener("pagehide",r=>{const s=r.target.querySelector(".video-js");e.parentNode.replaceChild(s,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in J&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(R.documentPictureInPicture&&R.documentPictureInPicture.window)return R.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in J)return J.exitPictureInPicture()}handleKeyDown(e){const{userActions:t}=this.options_;!t||!t.hotkeys||(s=>{const n=s.tagName.toLowerCase();if(s.isContentEditable)return!0;const a=["button","checkbox","hidden","radio","reset","submit"];return n==="input"?a.indexOf(s.type)===-1:["textarea"].indexOf(n)!==-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:r=a=>he.isEventKey(a,"f"),muteKey:s=a=>he.isEventKey(a,"m"),playPauseKey:n=a=>he.isEventKey(a,"k")||he.isEventKey(a,"Space")}=t;if(r.call(this,e)){e.preventDefault(),e.stopPropagation();const a=z.getComponent("FullscreenToggle");J[this.fsApi_.fullscreenEnabled]!==!1&&a.prototype.handleClick.call(this,e)}else s.call(this,e)?(e.preventDefault(),e.stopPropagation(),z.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),z.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let r=0,s=this.options_.techOrder;r<s.length;r++){const n=s[r];let a=fe.getTech(n);if(a||(a=z.getComponent(n)),!a){ye.error(`The "${n}" tech is undefined. Skipped browser support check for that tech.`);continue}if(a.isSupported()&&(t=a.canPlayType(e),t))return t}return""}selectSource(e){const t=this.options_.techOrder.map(o=>[o,fe.getTech(o)]).filter(([o,l])=>l?l.isSupported():(ye.error(`The "${o}" tech is undefined. Skipped browser support check for that tech.`),!1)),r=function(o,l,h){let c;return o.some(p=>l.some(_=>{if(c=h(p,_),c)return!0})),c};let s;const n=o=>(l,h)=>o(h,l),a=([o,l],h)=>{if(l.canPlaySource(h,this.options_[o.toLowerCase()]))return{source:h,tech:o}};return this.options_.sourceOrder?s=r(e,t,n(a)):s=r(t,e,a),s||!1}handleSrc_(e,t){if(typeof e=="undefined")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const r=qh(e);if(!r.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,t||(this.cache_.sources=r),this.updateSourceCaches_(r[0]),Xv(this,r[0],(s,n)=>{if(this.middleware_=n,t||(this.cache_.sources=r),this.updateSourceCaches_(s),this.src_(s)){if(r.length>1)return this.handleSrc_(r.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}Yv(n,this.tech_)}),r.length>1){const s=()=>{this.error(null),this.handleSrc_(r.slice(1),!0)},n=()=>{this.off("error",s)};this.one("error",s),this.one("playing",n),this.resetRetryOnError_=()=>{this.off("error",s),this.off("playing",n)}}}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return t?Bh(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}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();$t(e.then(()=>this.doReset_()))}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),oi(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:r,remainingTimeDisplay:s}=this.controlBar||{},{seekBar:n}=r||{};e&&e.updateContent(),t&&t.updateContent(),s&&s.updateContent(),n&&(n.update(),n.loadProgressBar&&n.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.addTechControlsListeners_()):(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(yi("beforeerror").forEach(t=>{const r=t(this,e);if(!(Xt(r)&&!Array.isArray(r)||typeof r=="string"||typeof r=="number"||r===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=r}),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 at(e),this.addClass("vjs-error"),ye.error(`(CODE:${this.error_.code} ${at.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),yi("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,r;const s=Le(this,this.reportUserActivity),n=function(p){(p.screenX!==t||p.screenY!==r)&&(t=p.screenX,r=p.screenY,s())},a=function(){s(),this.clearInterval(e),e=this.setInterval(s,250)},o=function(p){s(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",n),this.on("mouseup",o),this.on("mouseleave",o);const l=this.getChild("controlBar");l&&!ot&&!Yt&&(l.on("mouseenter",function(p){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),l.on("mouseleave",function(p){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",s),this.on("keyup",s);let h;const c=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(h);const p=this.options_.inactivityTimeout;p<=0||(h=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},p))};this.setInterval(c,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_}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),r=t&&t.currentHeight();e.forEach(s=>{s!==t&&s.el_&&!s.hasClass("vjs-hidden")&&(s.hide(),this.audioOnlyCache_.hiddenChildren.push(s))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(r),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach(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,r){if(this.tech_)return this.tech_.addTextTrack(e,t,r)}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(),oi(this)&&this.trigger("languagechange"))}languages(){return we(Ie.prototype.options_.languages,this.languages_)}toJSON(){const e=we(this.options_),t=e.tracks;e.tracks=[];for(let r=0;r<t.length;r++){let s=t[r];s=we(s),s.player=void 0,e.tracks[r]=s}return e}createModal(e,t){t=t||{},t.content=e||"";const r=new wr(this,t);return this.addChild(r),r.on("dispose",()=>{this.removeChild(r)}),r.open(),r}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let r=0;r<To.length;r++){const s=To[r],n=this.breakpoints_[s];if(t<=n){if(e===s)return;e&&this.removeClass(gn[e]),this.addClass(gn[s]),this.breakpoint_=s;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return e===void 0?Object.assign(this.breakpoints_):(this.breakpoint_="",this.breakpoints_=Object.assign({},By,e),this.updateCurrentBreakpoint_(),Object.assign(this.breakpoints_))}responsive(e){if(e===void 0)return this.responsive_;e=Boolean(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 gn[this.breakpoint_]||""}loadMedia(e,t){if(!e||typeof e!="object")return;const r=this.crossOrigin();this.reset(),this.cache_.media=we(e);const{artist:s,artwork:n,description:a,poster:o,src:l,textTracks:h,title:c}=this.cache_.media;!n&&o&&(this.cache_.media.artwork=[{src:o,type:Rn(o)}]),r&&this.crossOrigin(r),l&&this.src(l),o&&this.poster(o),Array.isArray(h)&&h.forEach(p=>this.addRemoteTextTrack(p,!1)),this.titleBar&&this.titleBar.update({title:c,description:a||s||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t=this.currentSources(),r=Array.prototype.map.call(this.remoteTextTracks(),n=>({kind:n.kind,label:n.label,language:n.language,src:n.src})),s={src:t,textTracks:r};return e&&(s.poster=e,s.artwork=[{src:s.poster,type:Rn(s.poster)}]),s}return we(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},r=vi(e),s=r["data-setup"];if(ds(e,"vjs-fill")&&(r.fill=!0),ds(e,"vjs-fluid")&&(r.fluid=!0),s!==null){const[n,a]=Em(s||"{}");n&&ye.error(n),Object.assign(r,a)}if(Object.assign(t,r),e.hasChildNodes()){const n=e.childNodes;for(let a=0,o=n.length;a<o;a++){const l=n[a],h=l.nodeName.toLowerCase();h==="source"?t.sources.push(vi(l)):h==="track"&&t.tracks.push(vi(l))}}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"))}}rt.names.forEach(function(i){const e=rt[i];Ie.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});Ie.prototype.crossorigin=Ie.prototype.crossOrigin;Ie.players={};const es=R.navigator;Ie.prototype.options_={techOrder:fe.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:es&&(es.languages&&es.languages[0]||es.userLanguage||es.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};["ended","seeking","seekable","networkState","readyState"].forEach(function(i){Ie.prototype[i]=function(){return this.techGet_(i)}});_f.forEach(function(i){Ie.prototype[`handleTech${Me(i)}_`]=function(){return this.trigger(i)}});z.registerComponent("Player",Ie);const Mn="plugin",lr="activePlugins_",ir={},Bn=i=>ir.hasOwnProperty(i),_n=i=>Bn(i)?ir[i]:void 0,vf=(i,e)=>{i[lr]=i[lr]||{},i[lr][e]=!0},Nn=(i,e,t)=>{const r=(t?"before":"")+"pluginsetup";i.trigger(r,e),i.trigger(r+":"+e.name,e)},Ny=function(i,e){const t=function(){Nn(this,{name:i,plugin:e,instance:null},!0);const r=e.apply(this,arguments);return vf(this,i),Nn(this,{name:i,plugin:e,instance:r}),r};return Object.keys(e).forEach(function(r){t[r]=e[r]}),t},Bd=(i,e)=>(e.prototype.name=i,function(...t){Nn(this,{name:i,plugin:e,instance:null},!0);const r=new e(this,...t);return this[i]=()=>r,Nn(this,r.getEventHash()),r});class ft{constructor(e){if(this.constructor===ft)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),lu(this),delete this.trigger,Mh(this,this.constructor.defaultState),vf(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 Dr(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[lr][e]=!1,this.player=this.state=null,t[e]=Bd(e,ir[e])}static isBasic(e){const t=typeof e=="string"?_n(e):e;return typeof t=="function"&&!ft.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(Bn(e))ye.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(Ie.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 ir[e]=t,e!==Mn&&(ft.isBasic(t)?Ie.prototype[e]=Ny(e,t):Ie.prototype[e]=Bd(e,t)),t}static deregisterPlugin(e){if(e===Mn)throw new Error("Cannot de-register base plugin.");Bn(e)&&(delete ir[e],delete Ie.prototype[e])}static getPlugins(e=Object.keys(ir)){let t;return e.forEach(r=>{const s=_n(r);s&&(t=t||{},t[r]=s)}),t}static getPluginVersion(e){const t=_n(e);return t&&t.VERSION||""}}ft.getPlugin=_n;ft.BASE_PLUGIN_NAME=Mn;ft.registerPlugin(Mn,ft);Ie.prototype.usingPlugin=function(i){return!!this[lr]&&this[lr][i]===!0};Ie.prototype.hasPlugin=function(i){return!!Bn(i)};function Fy(i,e){let t=!1;return function(...r){return t||ye.warn(i),t=!0,e.apply(this,r)}}function Bt(i,e,t,r){return Fy(`${e} is deprecated and will be removed in ${i}.0; please use ${t} instead.`,r)}const yf=i=>i.indexOf("#")===0?i.slice(1):i;function G(i,e,t){let r=G.getPlayer(i);if(r)return e&&ye.warn(`Player "${i}" is already initialised. Options will not be applied.`),t&&r.ready(t),r;const s=typeof i=="string"?Ti("#"+yf(i)):i;if(!Ar(s))throw new TypeError("The element or ID supplied is not valid. (videojs)");const a=("getRootNode"in s?s.getRootNode()instanceof R.ShadowRoot:!1)?s.getRootNode():s.ownerDocument.body;(!s.ownerDocument.defaultView||!a.contains(s))&&ye.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(s.parentNode&&s.parentNode.hasAttribute("data-vjs-player")?s.parentNode:s).cloneNode(!0)),yi("beforesetup").forEach(l=>{const h=l(s,we(e));if(!Xt(h)||Array.isArray(h)){ye.error("please return an object in beforesetup hooks");return}e=we(e,h)});const o=z.getComponent("Player");return r=new o(s,e,t),yi("setup").forEach(l=>l(r)),r}G.hooks_=si;G.hooks=yi;G.hook=vv;G.hookOnce=yv;G.removeHook=oh;if(R.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Cr()){let i=Ti(".vjs-styles-defaults");if(!i){i=Ih("vjs-styles-defaults");const e=Ti("head");e&&e.insertBefore(i,e.firstChild),kh(i,`
.video-js {
width: 300px;
height: 150px;
}
.vjs-fluid:not(.vjs-audio-only-mode) {
padding-top: 56.25%
}
`)}}fo(1,G);G.VERSION=ah;G.options=Ie.prototype.options_;G.getPlayers=()=>Ie.players;G.getPlayer=i=>{const e=Ie.players;let t;if(typeof i=="string"){const r=yf(i),s=e[r];if(s)return s;t=Ti("#"+r)}else t=i;if(Ar(t)){const{player:r,playerId:s}=t;if(r||e[s])return r||e[s]}};G.getAllPlayers=()=>Object.keys(Ie.players).map(i=>Ie.players[i]).filter(Boolean);G.players=Ie.players;G.getComponent=z.getComponent;G.registerComponent=(i,e)=>(fe.isTech(e)&&ye.warn(`The ${i} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),z.registerComponent.call(z,i,e));G.getTech=fe.getTech;G.registerTech=fe.registerTech;G.use=Kv;Object.defineProperty(G,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(G.middleware,"TERMINATOR",{value:Pn,writeable:!1,enumerable:!0});G.browser=Ev;G.obj=bv;G.mergeOptions=Bt(9,"videojs.mergeOptions","videojs.obj.merge",we);G.defineLazyProperty=Bt(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",ea);G.bind=Bt(9,"videojs.bind","native Function.prototype.bind",Le);G.registerPlugin=ft.registerPlugin;G.deregisterPlugin=ft.deregisterPlugin;G.plugin=(i,e)=>(ye.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),ft.registerPlugin(i,e));G.getPlugins=ft.getPlugins;G.getPlugin=ft.getPlugin;G.getPluginVersion=ft.getPluginVersion;G.addLanguage=function(i,e){return i=(""+i).toLowerCase(),G.options.languages=we(G.options.languages,{[i]:e}),G.options.languages[i]};G.log=ye;G.createLogger=uh;G.time=Nv;G.createTimeRange=Bt(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Kt);G.createTimeRanges=Bt(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Kt);G.formatTime=Bt(9,"videojs.formatTime","videojs.time.formatTime",ji);G.setFormatTime=Bt(9,"videojs.setFormatTime","videojs.time.setFormatTime",Fh);G.resetFormatTime=Bt(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",Uh);G.parseUrl=Bt(9,"videojs.parseUrl","videojs.url.parseUrl",hu);G.isCrossOrigin=Bt(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",ha);G.EventTarget=Lt;G.any=uu;G.on=xt;G.one=da;G.off=Qe;G.trigger=Dr;G.xhr=lc;G.TextTrack=Ls;G.AudioTrack=Hh;G.VideoTrack=Gh;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(i=>{G[i]=function(){return ye.warn(`videojs.${i}() is deprecated; use videojs.dom.${i}() instead`),wh[i].apply(null,arguments)}});G.computedStyle=Bt(9,"videojs.computedStyle","videojs.dom.computedStyle",xr);G.dom=wh;G.fn=kv;G.num=py;G.str=Mv;G.url=Wv;/*! @name videojs-contrib-quality-levels @version 4.0.0 @license Apache-2.0 */class Uy{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(r){t.enabled_(r)}}),t}}class Fn extends G.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 r=this.levels_.length;return t=new Uy(e),""+r in this||Object.defineProperty(this,r,{get(){return this.levels_[r]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let r=0,s=this.length;r<s;r++)if(this[r]===e){t=this.levels_.splice(r,1)[0],this.selectedIndex_===r?this.selectedIndex_=-1:this.selectedIndex_>r&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,r=this.length;t<r;t++){const s=this[t];if(s.id===e)return s}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}Fn.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const i in Fn.prototype.allowedEvents_)Fn.prototype["on"+i]=null;var Tf="4.0.0";const jy=function(i,e){const t=i.qualityLevels,r=new Fn,s=function(){r.dispose(),i.qualityLevels=t,i.off("dispose",s)};return i.on("dispose",s),i.qualityLevels=()=>r,i.qualityLevels.VERSION=Tf,r},xf=function(i){return jy(this,G.obj.merge({},i))};G.registerPlugin("qualityLevels",xf);xf.VERSION=Tf;/*! @name @videojs/http-streaming @version 3.6.0 @license Apache-2.0 */const Rt=cg,Un=(i,e)=>e&&e.responseURL&&i!==e.responseURL?e.responseURL:i,Nt=i=>G.log.debug?G.log.debug.bind(G,"VHS:",`${i} >`):function(){};function Se(...i){const e=G.obj||G;return(e.merge||e.mergeOptions).apply(e,i)}function Ye(...i){const e=G.time||G;return(e.createTimeRanges||e.createTimeRanges).apply(e,i)}function Vy(i){let e="";for(let t=0;t<i.length;t++){const r=i.start(t),s=i.end(t),n=s-r;e.length&&(e+=`
`),e+=`[${n}](${r} -> ${s})`}return e||"empty"}const xi=1/30,Ht=xi*3,bf=function(i,e){const t=[];let r;if(i&&i.length)for(r=0;r<i.length;r++)e(i.start(r),i.end(r))&&t.push([i.start(r),i.end(r)]);return Ye(t)},rr=function(i,e){return bf(i,function(t,r){return t-Ht<=e&&r+Ht>=e})},cn=function(i,e){return bf(i,function(t){return t-xi>=e})},$y=function(i){if(i.length<2)return Ye();const e=[];for(let t=1;t<i.length;t++){const r=i.end(t-1),s=i.start(t);e.push([r,s])}return Ye(e)},Hy=function(i,e){let t=null,r=null,s=0;const n=[],a=[];if(!i||!i.length||!e||!e.length)return Ye();let o=i.length;for(;o--;)n.push({time:i.start(o),type:"start"}),n.push({time:i.end(o),type:"end"});for(o=e.length;o--;)n.push({time:e.start(o),type:"start"}),n.push({time:e.end(o),type:"end"});for(n.sort(function(l,h){return l.time-h.time}),o=0;o<n.length;o++)n[o].type==="start"?(s++,s===2&&(t=n[o].time)):n[o].type==="end"&&(s--,s===1&&(r=n[o].time)),t!==null&&r!==null&&(a.push([t,r]),t=null,r=null);return Ye(a)},Ef=i=>{const e=[];if(!i||!i.length)return"";for(let t=0;t<i.length;t++)e.push(i.start(t)+" => "+i.end(t));return e.join(", ")},Gy=function(i,e,t=1){return((i.length?i.end(i.length-1):0)-e)/t},Mi=i=>{const e=[];for(let t=0;t<i.length;t++)e.push({start:i.start(t),end:i.end(t)});return e},qy=function(i,e){if(i===e)return!1;if(!i&&e||!e&&i||i.length!==e.length)return!0;for(let t=0;t<i.length;t++)if(i.start(t)!==e.start(t)||i.end(t)!==e.end(t))return!0;return!1},Nd=function(i){if(!(!i||!i.length||!i.end))return i.end(i.length-1)},Iu=function(i,e){let t=0;if(!i||!i.length)return t;for(let r=0;r<i.length;r++){const s=i.start(r),n=i.end(r);if(!(e>n)){if(e>s&&e<=n){t+=n-e;continue}t+=n-s}}return t},ku=(i,e)=>{if(!e.preload)return e.duration;let t=0;return(e.parts||[]).forEach(function(r){t+=r.duration}),(e.preloadHints||[]).forEach(function(r){r.type==="PART"&&(t+=i.partTargetDuration)}),t},xo=i=>(i.segments||[]).reduce((e,t,r)=>(t.parts?t.parts.forEach(function(s,n){e.push({duration:s.duration,segmentIndex:r,partIndex:n,part:s,segment:t})}):e.push({duration:t.duration,segmentIndex:r,partIndex:null,segment:t,part:null}),e),[]),Sf=i=>{const e=i.segments&&i.segments.length&&i.segments[i.segments.length-1];return e&&e.parts||[]},Cf=({preloadSegment:i})=>{if(!i)return;const{parts:e,preloadHints:t}=i;let r=(t||[]).reduce((s,n)=>s+(n.type==="PART"?1:0),0);return r+=e&&e.length?e.length:0,r},Af=(i,e)=>{if(e.endList)return 0;if(i&&i.suggestedPresentationDelay)return i.suggestedPresentationDelay;const t=Sf(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},Wy=function(i,e){let t=0,r=e-i.mediaSequence,s=i.segments[r];if(s){if(typeof s.start!="undefined")return{result:s.start,precise:!0};if(typeof s.end!="undefined")return{result:s.end-s.duration,precise:!0}}for(;r--;){if(s=i.segments[r],typeof s.end!="undefined")return{result:t+s.end,precise:!0};if(t+=ku(i,s),typeof s.start!="undefined")return{result:t+s.start,precise:!0}}return{result:t,precise:!1}},zy=function(i,e){let t=0,r,s=e-i.mediaSequence;for(;s<i.segments.length;s++){if(r=i.segments[s],typeof r.start!="undefined")return{result:r.start-t,precise:!0};if(t+=ku(i,r),typeof r.end!="undefined")return{result:r.end-t,precise:!0}}return{result:-1,precise:!1}},Df=function(i,e,t){if(typeof e=="undefined"&&(e=i.mediaSequence+i.segments.length),e<i.mediaSequence)return 0;const r=Wy(i,e);if(r.precise)return r.result;const s=zy(i,e);return s.precise?s.result:r.result+t},wf=function(i,e,t){if(!i)return 0;if(typeof t!="number"&&(t=0),typeof e=="undefined"){if(i.totalDuration)return i.totalDuration;if(!i.endList)return R.Infinity}return Df(i,e,t)},fs=function({defaultDuration:i,durationList:e,startIndex:t,endIndex:r}){let s=0;if(t>r&&([t,r]=[r,t]),t<0){for(let n=t;n<Math.min(0,r);n++)s+=i;t=0}for(let n=t;n<r;n++)s+=e[n].duration;return s},Lf=function(i,e,t,r){if(!i||!i.segments)return null;if(i.endList)return wf(i);if(e===null)return null;e=e||0;let s=Df(i,i.mediaSequence+i.segments.length,e);return t&&(r=typeof r=="number"?r:Af(null,i),s-=r),Math.max(0,s)},Ky=function(i,e,t){const s=e||0,n=Lf(i,e,!0,t);return n===null?Ye():Ye(s,n)},Xy=function({playlist:i,currentTime:e,startingSegmentIndex:t,startingPartIndex:r,startTime:s,exactManifestTimings:n}){let a=e-s;const o=xo(i);let l=0;for(let h=0;h<o.length;h++){const c=o[h];if(t===c.segmentIndex&&!(typeof r=="number"&&typeof c.partIndex=="number"&&r!==c.partIndex)){l=h;break}}if(a<0){if(l>0)for(let h=l-1;h>=0;h--){const c=o[h];if(a+=c.duration,n){if(a<0)continue}else if(a+xi<=0)continue;return{partIndex:c.partIndex,segmentIndex:c.segmentIndex,startTime:s-fs({defaultDuration:i.targetDuration,durationList:o,startIndex:l,endIndex:h})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e}}if(l<0){for(let h=l;h<0;h++)if(a-=i.targetDuration,a<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e};l=0}for(let h=l;h<o.length;h++){const c=o[h];if(a-=c.duration,n){if(a>0)continue}else if(a-xi>=0)continue;return{partIndex:c.partIndex,segmentIndex:c.segmentIndex,startTime:s+fs({defaultDuration:i.targetDuration,durationList:o,startIndex:l,endIndex:h})}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:e}},If=function(i){return i.excludeUntil&&i.excludeUntil>Date.now()},Ou=function(i){return i.excludeUntil&&i.excludeUntil===1/0},ma=function(i){const e=If(i);return!i.disabled&&!e},Yy=function(i){return i.disabled},Qy=function(i){for(let e=0;e<i.segments.length;e++)if(i.segments[e].key)return!0;return!1},kf=function(i,e){return e.attributes&&e.attributes[i]},Jy=function(i,e,t,r=0){return kf("BANDWIDTH",t)?(i*t.attributes.BANDWIDTH-r*8)/e:NaN},bo=(i,e)=>{if(i.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return i.playlists.filter(r=>ma(r)?(r.attributes.BANDWIDTH||0)<t:!1).length===0},Pu=(i,e)=>!i&&!e||!i&&e||i&&!e?!1:!!(i===e||i.id&&e.id&&i.id===e.id||i.resolvedUri&&e.resolvedUri&&i.resolvedUri===e.resolvedUri||i.uri&&e.uri&&i.uri===e.uri),Fd=function(i,e){const t=i&&i.mediaGroups&&i.mediaGroups.AUDIO||{};let r=!1;for(const s in t){for(const n in t[s])if(r=e(t[s][n]),r)break;if(r)break}return!!r},Ps=i=>{if(!i||!i.playlists||!i.playlists.length)return Fd(i,t=>t.playlists&&t.playlists.length||t.uri);for(let e=0;e<i.playlists.length;e++){const t=i.playlists[e],r=t.attributes&&t.attributes.CODECS;if(!(r&&r.split(",").every(n=>gc(n))||Fd(i,n=>Pu(t,n))))return!1}return!0};var ht={liveEdgeDelay:Af,duration:wf,seekable:Ky,getMediaInfoForTime:Xy,isEnabled:ma,isDisabled:Yy,isExcluded:If,isIncompatible:Ou,playlistEnd:Lf,isAes:Qy,hasAttribute:kf,estimateSegmentRequestTime:Jy,isLowestEnabledRendition:bo,isAudioOnly:Ps,playlistMatch:Pu,segmentDurationWithParts:ku};const{log:Of}=G,Ru=(i,e)=>`${i}-${e}`,Zy=(i,e,t)=>`placeholder-uri-${i}-${e}-${t}`,eT=({onwarn:i,oninfo:e,manifestString:t,customTagParsers:r=[],customTagMappers:s=[],llhls:n})=>{const a=new vg;i&&a.on("warn",i),e&&a.on("info",e),r.forEach(h=>a.addParser(h)),s.forEach(h=>a.addTagMapper(h)),a.push(t),a.end();const o=a.manifest;if(n||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(h){o.hasOwnProperty(h)&&delete o[h]}),o.segments&&o.segments.forEach(function(h){["parts","preloadHints"].forEach(function(c){h.hasOwnProperty(c)&&delete h[c]})})),!o.targetDuration){let h=10;o.segments&&o.segments.length&&(h=o.segments.reduce((c,p)=>Math.max(c,p.duration),0)),i&&i(`manifest has no targetDuration defaulting to ${h}`),o.targetDuration=h}const l=Sf(o);if(l.length&&!o.partTargetDuration){const h=l.reduce((c,p)=>Math.max(c,p.duration),0);i&&(i(`manifest has no partTargetDuration defaulting to ${h}`),Of.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.")),o.partTargetDuration=h}return o},kr=(i,e)=>{!i.mediaGroups||["AUDIO","SUBTITLES"].forEach(t=>{if(!!i.mediaGroups[t])for(const r in i.mediaGroups[t])for(const s in i.mediaGroups[t][r]){const n=i.mediaGroups[t][r][s];e(n,t,r,s)}})},Pf=({playlist:i,uri:e,id:t})=>{i.id=t,i.playlistErrors_=0,e&&(i.uri=e),i.attributes=i.attributes||{}},tT=i=>{let e=i.playlists.length;for(;e--;){const t=i.playlists[e];Pf({playlist:t,id:Ru(e,t.uri)}),t.resolvedUri=Rt(i.uri,t.uri),i.playlists[t.id]=t,i.playlists[t.uri]=t,t.attributes.BANDWIDTH||Of.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},iT=i=>{kr(i,e=>{e.uri&&(e.resolvedUri=Rt(i.uri,e.uri))})},rT=(i,e)=>{const t=Ru(0,e),r={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:R.location.href,resolvedUri:R.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return r.playlists[t]=r.playlists[0],r.playlists[e]=r.playlists[0],r},Rf=(i,e,t=Zy)=>{i.uri=e;for(let s=0;s<i.playlists.length;s++)if(!i.playlists[s].uri){const n=`placeholder-uri-${s}`;i.playlists[s].uri=n}const r=Ps(i);kr(i,(s,n,a,o)=>{if(!s.playlists||!s.playlists.length){if(r&&n==="AUDIO"&&!s.uri)for(let l=0;l<i.playlists.length;l++){const h=i.playlists[l];if(h.attributes&&h.attributes.AUDIO&&h.attributes.AUDIO===a)return}s.playlists=[ui({},s)]}s.playlists.forEach(function(l,h){const c=t(n,a,o,l),p=Ru(h,c);l.uri?l.resolvedUri=l.resolvedUri||Rt(i.uri,l.uri):(l.uri=h===0?c:p,l.resolvedUri=l.uri),l.id=l.id||p,l.attributes=l.attributes||{},i.playlists[l.id]=l,i.playlists[l.uri]=l})}),tT(i),iT(i)};class Ud{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,r=t.startDate.getTime();this.trimProcessedDateRanges_(r),this.pendingDateRanges_=e.reduce((s,n)=>(s.set(n.id,n),s),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((r,s)=>{if(!this.processedDateRanges_.has(s)&&(r.startTime=r.startDate.getTime()/1e3-this.offset_,r.processDateRange=()=>this.processDateRange(r),t.push(r),!!r.class))if(e[r.class]){const n=e[r.class].push(r);r.classListIndex=n-1}else e[r.class]=[r],r.classListIndex=0});for(const r of t){const s=e[r.class]||[];r.endDate?r.endTime=r.endDate.getTime()/1e3-this.offset_:r.endOnNext&&s[r.classListIndex+1]?r.endTime=s[r.classListIndex+1].startTime:r.duration?r.endTime=r.startTime+r.duration:r.plannedDuration?r.endTime=r.startTime+r.plannedDuration:r.endTime=r.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((r,s)=>{r.startDate.getTime()<e&&this.processedDateRanges_.delete(s)})}}const{EventTarget:sT}=G,nT=(i,e)=>{if(e.endList||!e.serverControl)return i;const t={};if(e.serverControl.canBlockReload){const{preloadSegment:r}=e;let s=e.mediaSequence+e.segments.length;if(r){const n=r.parts||[],a=Cf(e)-1;a>-1&&a!==n.length-1&&(t._HLS_part=a),(a>-1||n.length)&&s--}t._HLS_msn=s}if(e.serverControl&&e.serverControl.canSkipUntil&&(t._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(t).length){const r=new R.URL(i);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(s){!t.hasOwnProperty(s)||r.searchParams.set(s,t[s])}),i=r.toString()}return i},aT=(i,e)=>{if(!i)return e;const t=Se(i,e);if(i.preloadHints&&!e.preloadHints&&delete t.preloadHints,i.parts&&!e.parts)delete t.parts;else if(i.parts&&e.parts)for(let r=0;r<e.parts.length;r++)i.parts&&i.parts[r]&&(t.parts[r]=Se(i.parts[r],e.parts[r]));return!i.skipped&&e.skipped&&(t.skipped=!1),i.preload&&!e.preload&&(t.preload=!1),t},oT=(i,e,t)=>{const r=i.slice(),s=e.slice();t=t||0;const n=[];let a;for(let o=0;o<s.length;o++){const l=r[o+t],h=s[o];l?(a=l.map||a,n.push(aT(l,h))):(a&&!h.map&&(h.map=a),n.push(h))}return n},Mf=(i,e)=>{!i.resolvedUri&&i.uri&&(i.resolvedUri=Rt(e,i.uri)),i.key&&!i.key.resolvedUri&&(i.key.resolvedUri=Rt(e,i.key.uri)),i.map&&!i.map.resolvedUri&&(i.map.resolvedUri=Rt(e,i.map.uri)),i.map&&i.map.key&&!i.map.key.resolvedUri&&(i.map.key.resolvedUri=Rt(e,i.map.key.uri)),i.parts&&i.parts.length&&i.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=Rt(e,t.uri))}),i.preloadHints&&i.preloadHints.length&&i.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=Rt(e,t.uri))})},Bf=function(i){const e=i.segments||[],t=i.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let r=0;r<t.preloadHints.length;r++)if(t.preloadHints[r].type==="MAP")return e}t.duration=i.targetDuration,t.preload=!0,e.push(t)}return e},Nf=(i,e)=>i===e||i.segments&&e.segments&&i.segments.length===e.segments.length&&i.endList===e.endList&&i.mediaSequence===e.mediaSequence&&i.preloadSegment===e.preloadSegment,Eo=(i,e,t=Nf)=>{const r=Se(i,{}),s=r.playlists[e.id];if(!s||t(s,e))return null;e.segments=Bf(e);const n=Se(s,e);if(n.preloadSegment&&!e.preloadSegment&&delete n.preloadSegment,s.segments){if(e.skip){e.segments=e.segments||[];for(let a=0;a<e.skip.skippedSegments;a++)e.segments.unshift({skipped:!0})}n.segments=oT(s.segments,e.segments,e.mediaSequence-s.mediaSequence)}n.segments.forEach(a=>{Mf(a,n.resolvedUri)});for(let a=0;a<r.playlists.length;a++)r.playlists[a].id===e.id&&(r.playlists[a]=n);return r.playlists[e.id]=n,r.playlists[e.uri]=n,kr(i,(a,o,l,h)=>{if(!!a.playlists)for(let c=0;c<a.playlists.length;c++)e.id===a.playlists[c].id&&(a.playlists[c]=n)}),r},So=(i,e)=>{const t=i.segments||[],r=t[t.length-1],s=r&&r.parts&&r.parts[r.parts.length-1],n=s&&s.duration||r&&r.duration;return e&&n?n*1e3:(i.partTargetDuration||i.targetDuration||10)*500};class sr extends sT{constructor(e,t,r={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=Nt("PlaylistLoader");const{withCredentials:s=!1}=r;this.src=e,this.vhs_=t,this.withCredentials=s,this.addDateRangesToTextTrack_=r.addDateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new Ud,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=Rt(this.main.uri,e.uri);this.llhls&&(t=nT(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials},(r,s)=>{if(!!this.request){if(r)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,r){const{uri:s,id:n}=t;this.request=null,r&&(this.state=r),this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${s}.`,responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")}parseManifest_({url:e,manifestString:t}){return eT({onwarn:({message:r})=>this.logger_(`m3u8-parser warn for ${e}: ${r}`),oninfo:({message:r})=>this.logger_(`m3u8-parser info for ${e}: ${r}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}haveMetadata({playlistString:e,playlistObject:t,url:r,id:s}){this.request=null,this.state="HAVE_METADATA";const n=t||this.parseManifest_({url:r,manifestString:e});n.lastRequest=Date.now(),Pf({playlist:n,uri:r,id:s});const a=Eo(this.main,n);this.targetDuration=n.partTargetDuration||n.targetDuration,this.pendingMedia_=null,a?(this.main=a,this.media_=this.main.playlists[s]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(So(this.media(),!!a)),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),R.clearTimeout(this.mediaUpdateTimeout),R.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new Ud,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(R.clearTimeout(this.finalRenditionTimeout),t){const a=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=R.setTimeout(this.media.bind(this,e,!1),a);return}const r=this.state,s=!this.media_||e.id!==this.media_.id,n=this.main.playlists[e.id];if(n&&n.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,s&&(this.trigger("mediachanging"),r==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(So(e,!0)),!!s){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,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},(a,o)=>{if(!!this.request){if(e.lastRequest=Date.now(),e.resolvedUri=Un(e.resolvedUri,o),a)return this.playlistRequestError(this.request,e,r);this.haveMetadata({playlistString:o.responseText,url:e.uri,id:e.id}),r==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}}pause(){this.mediaUpdateTimeout&&(R.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&&(R.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const r=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=R.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},r);return}if(!this.started){this.start();return}t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(R.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=R.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=R.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},(e,t)=>{if(!this.request)return;if(this.request=null,e)return this.error={status:t.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:t.responseText,code:2},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.src=Un(this.src,t);const r=this.parseManifest_({manifestString:t.responseText,url:this.src});this.setupInitialPlaylist(r)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,Rf(this.main,this.srcUri()),e.playlists.forEach(r=>{r.segments=Bf(r),r.segments.forEach(s=>{Mf(s,r.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const t=this.srcUri()||R.location.href;this.main=rT(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}}const{xhr:uT}=G,Co=function(i,e,t,r){const s=i.responseType==="arraybuffer"?i.response:i.responseText;!e&&s&&(i.responseTime=Date.now(),i.roundTripTime=i.responseTime-i.requestTime,i.bytesReceived=s.byteLength||s.length,i.bandwidth||(i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3))),t.headers&&(i.responseHeaders=t.headers),e&&e.code==="ETIMEDOUT"&&(i.timedout=!0),!e&&!i.aborted&&t.statusCode!==200&&t.statusCode!==206&&t.statusCode!==0&&(e=new Error("XHR Failed with a response of: "+(i&&(s||i.responseText)))),r(e,i)},lT=(i,e)=>{if(!i||!i.size)return;let t=e;return i.forEach(r=>{t=r(t)}),t},dT=(i,e,t,r)=>{!i||!i.size||i.forEach(s=>{s(e,t,r)})},Ff=function(){const i=function e(t,r){t=Se({timeout:45e3},t);const s=e.beforeRequest||G.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||G.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||G.Vhs.xhr._responseCallbackSet;s&&typeof s=="function"&&(G.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(s));const o=G.Vhs.xhr.original===!0?uT:G.Vhs.xhr,l=lT(n,t);n.delete(s);const h=o(l||t,function(p,_){return dT(a,h,p,_),Co(h,p,_,r)}),c=h.abort;return h.abort=function(){return h.aborted=!0,c.apply(h,arguments)},h.uri=t.uri,h.requestTime=Date.now(),h};return i.original=!0,i},cT=function(i){let e;const t=i.offset;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=R.BigInt(i.offset)+R.BigInt(i.length)-R.BigInt(1):e=i.offset+i.length-1,"bytes="+t+"-"+e},Ao=function(i){const e={};return i.byterange&&(e.Range=cT(i.byterange)),e},hT=function(i,e){return i.start(e)+"-"+i.end(e)},fT=function(i,e){const t=i.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},pT=function(i){return i>=32&&i<126?String.fromCharCode(i):"."},Uf=function(i){const e={};return Object.keys(i).forEach(t=>{const r=i[t];vc(r)?e[t]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:e[t]=r}),e},jn=function(i){const e=i.byterange||{length:1/0,offset:0};return[e.length,e.offset,i.resolvedUri].join(",")},jf=function(i){return i.resolvedUri},Vf=i=>{const e=Array.prototype.slice.call(i),t=16;let r="",s,n;for(let a=0;a<e.length/t;a++)s=e.slice(a*t,a*t+t).map(fT).join(""),n=e.slice(a*t,a*t+t).map(pT).join(""),r+=s+" "+n+`
`;return r},mT=({bytes:i})=>Vf(i),gT=i=>{let e="",t;for(t=0;t<i.length;t++)e+=hT(i,t)+" ";return e};var _T=Object.freeze({__proto__:null,createTransferableMessage:Uf,initSegmentId:jn,segmentKeyId:jf,hexDump:Vf,tagDump:mT,textRanges:gT});const $f=.25,vT=(i,e)=>{if(!e.dateTimeObject)return null;const t=e.videoTimingInfo.transmuxerPrependedSeconds,s=e.videoTimingInfo.transmuxedPresentationStart+t,n=i-s;return new Date(e.dateTimeObject.getTime()+n*1e3)},yT=i=>i.transmuxedPresentationEnd-i.transmuxedPresentationStart-i.transmuxerPrependedSeconds,TT=(i,e)=>{let t;try{t=new Date(i)}catch(l){return null}if(!e||!e.segments||e.segments.length===0)return null;let r=e.segments[0];if(t<new Date(r.dateTimeObject))return null;for(let l=0;l<e.segments.length-1;l++){r=e.segments[l];const h=new Date(e.segments[l+1].dateTimeObject);if(t<h)break}const s=e.segments[e.segments.length-1],n=s.dateTimeObject,a=s.videoTimingInfo?yT(s.videoTimingInfo):s.duration+s.duration*$f,o=new Date(n.getTime()+a*1e3);return t>o?null:(t>new Date(n)&&(r=s),{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:ht.duration(e,e.mediaSequence+e.segments.indexOf(r)),type:r.videoTimingInfo?"accurate":"estimate"})},xT=(i,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let t=0,r;for(let n=0;n<e.segments.length&&(r=e.segments[n],t=r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationEnd:t+r.duration,!(i<=t));n++);const s=e.segments[e.segments.length-1];if(s.videoTimingInfo&&s.videoTimingInfo.transmuxedPresentationEnd<i)return null;if(i>t){if(i>t+s.duration*$f)return null;r=s}return{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:t-r.duration,type:r.videoTimingInfo?"accurate":"estimate"}},bT=(i,e)=>{let t,r;try{t=new Date(i),r=new Date(e)}catch(a){}const s=t.getTime();return(r.getTime()-s)/1e3},ET=i=>{if(!i.segments||i.segments.length===0)return!1;for(let e=0;e<i.segments.length;e++)if(!i.segments[e].dateTimeObject)return!1;return!0},ST=({playlist:i,time:e=void 0,callback:t})=>{if(!t)throw new Error("getProgramTime: callback must be provided");if(!i||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const r=xT(e,i);if(!r)return t({message:"valid programTime was not found"});if(r.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:r.estimatedStart});const s={mediaSeconds:e},n=vT(e,r.segment);return n&&(s.programDateTime=n.toISOString()),t(null,s)},Hf=({programTime:i,playlist:e,retryCount:t=2,seekTo:r,pauseAfterSeek:s=!0,tech:n,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(typeof i=="undefined"||!e||!r)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!n.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!ET(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const o=TT(i,e);if(!o)return a({message:`${i} was not found in the stream`});const l=o.segment,h=bT(l.dateTimeObject,i);if(o.type==="estimate"){if(t===0)return a({message:`${i} is not buffered yet. Try again`});r(o.estimatedStart+h),n.one("seeked",()=>{Hf({programTime:i,playlist:e,retryCount:t-1,seekTo:r,pauseAfterSeek:s,tech:n,callback:a})});return}const c=l.start+h,p=()=>a(null,n.currentTime());n.one("seeked",p),s&&n.pause(),r(c)},Za=(i,e)=>{if(i.readyState===4)return e()},CT=(i,e,t)=>{let r=[],s,n=!1;const a=function(c,p,_,E){return p.abort(),n=!0,t(c,p,_,E)},o=function(c,p){if(n)return;if(c)return a(c,p,"",r);const _=p.responseText.substring(r&&r.byteLength||0,p.responseText.length);if(r=Ig(r,yc(_,!0)),s=s||as(r),r.length<10||s&&r.length<s+2)return Za(p,()=>a(c,p,"",r));const E=Zo(r);return E==="ts"&&r.length<188?Za(p,()=>a(c,p,"",r)):!E&&r.length<376?Za(p,()=>a(c,p,"",r)):a(null,p,E,r)},h=e({uri:i,beforeSend(c){c.overrideMimeType("text/plain; charset=x-user-defined"),c.addEventListener("progress",function({total:p,loaded:_}){return Co(c,null,{statusCode:c.status},o)})}},function(c,p){return Co(h,c,p,o)});return h},{EventTarget:AT}=G,jd=function(i,e){if(!Nf(i,e)||i.sidx&&e.sidx&&(i.sidx.offset!==e.sidx.offset||i.sidx.length!==e.sidx.length))return!1;if(!i.sidx&&e.sidx||i.sidx&&!e.sidx||i.segments&&!e.segments||!i.segments&&e.segments)return!1;if(!i.segments&&!e.segments)return!0;for(let t=0;t<i.segments.length;t++){const r=i.segments[t],s=e.segments[t];if(r.uri!==s.uri)return!1;if(!r.byterange&&!s.byterange)continue;const n=r.byterange,a=s.byterange;if(n&&!a||!n&&a||n.offset!==a.offset||n.length!==a.length)return!1}return!0},DT=(i,e,t,r)=>{const s=r.attributes.NAME||t;return`placeholder-uri-${i}-${e}-${s}`},wT=({mainXml:i,srcUrl:e,clientOffset:t,sidxMapping:r,previousManifest:s})=>{const n=Q_(i,{manifestUri:e,clientOffset:t,sidxMapping:r,previousManifest:s});return Rf(n,e,DT),n},LT=(i,e)=>{kr(i,(t,r,s,n)=>{n in e.mediaGroups[r][s]||delete i.mediaGroups[r][s][n]})},IT=(i,e,t)=>{let r=!0,s=Se(i,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let n=0;n<e.playlists.length;n++){const a=e.playlists[n];if(a.sidx){const l=Qn(a.sidx);t&&t[l]&&t[l].sidx&&Yo(a,t[l].sidx,a.sidx.resolvedUri)}const o=Eo(s,a,jd);o&&(s=o,r=!1)}return kr(e,(n,a,o,l)=>{if(n.playlists&&n.playlists.length){const h=n.playlists[0].id,c=Eo(s,n.playlists[0],jd);c&&(s=c,l in s.mediaGroups[a][o]||(s.mediaGroups[a][o][l]=n),s.mediaGroups[a][o][l].playlists[0]=s.playlists[h],r=!1)}}),LT(s,e),e.minimumUpdatePeriod!==i.minimumUpdatePeriod&&(r=!1),r?null:s},kT=(i,e)=>(Boolean(!i.map&&!e.map)||Boolean(i.map&&e.map&&i.map.byterange.offset===e.map.byterange.offset&&i.map.byterange.length===e.map.byterange.length))&&i.uri===e.uri&&i.byterange.offset===e.byterange.offset&&i.byterange.length===e.byterange.length,Vd=(i,e)=>{const t={};for(const r in i){const n=i[r].sidx;if(n){const a=Qn(n);if(!e[a])break;const o=e[a].sidxInfo;kT(o,n)&&(t[a]=e[a])}}return t},OT=(i,e)=>{let r=Vd(i.playlists,e);return kr(i,(s,n,a,o)=>{if(s.playlists&&s.playlists.length){const l=s.playlists;r=Se(r,Vd(l,e))}}),r};class Do extends AT{constructor(e,t,r={},s){super(),this.mainPlaylistLoader_=s||this,s||(this.isMain_=!0);const{withCredentials:n=!1}=r;if(this.vhs_=t,this.withCredentials=n,this.addMetadataToTextTrack=r.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_=Nt("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}requestErrored_(e,t,r){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},r&&(this.state=r),this.trigger("error"),!0}addSidxSegments_(e,t,r){const s=e.sidx&&Qn(e.sidx);if(!e.sidx||!s||this.mainPlaylistLoader_.sidxMapping_[s]){this.mediaRequest_=R.setTimeout(()=>r(!1),0);return}const n=Un(e.sidx.resolvedUri),a=(o,l)=>{if(this.requestErrored_(o,l,t))return;const h=this.mainPlaylistLoader_.sidxMapping_;let c;try{c=iv(re(l.response).subarray(8))}catch(p){this.requestErrored_(p,l,t);return}return h[s]={sidxInfo:e.sidx,sidx:c},Yo(e,c,e.sidx.resolvedUri),r(!0)};this.request=CT(n,this.vhs_.xhr,(o,l,h,c)=>{if(o)return a(o,l);if(!h||h!=="mp4")return a({status:l.status,message:`Unsupported ${h||"unknown"} container type for sidx segment at URL: ${n}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},l);const{offset:p,length:_}=e.sidx.byterange;if(c.length>=_+p)return a(o,{response:c.subarray(p,p+_),status:l.status,uri:l.uri});this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",headers:Ao({byterange:e.sidx.byterange})},a)})}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},R.clearTimeout(this.minimumUpdatePeriodTimeout_),R.clearTimeout(this.mediaRequest_),R.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 r=!this.media_||e.id!==this.media_.id;if(r&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,r&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}!r||(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,s=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,this.mediaRequest_=null,this.refreshMedia_(t.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),R.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(R.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){R.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const r=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=R.setTimeout(()=>this.load(),r);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")}start(){if(this.started=!0,!this.isMain_){this.mediaRequest_=R.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},(t,r)=>{if(this.requestErrored_(t,r)){this.state==="HAVE_NOTHING"&&(this.started=!1);return}const s=r.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?this.mainLoaded_=Date.parse(r.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=Un(this.mainPlaylistLoader_.srcUrl,r),s){this.handleMain_(),this.syncClientServerClock_(()=>e(r,s));return}return e(r,s)})}syncClientServerClock_(e){const t=J_(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:Rt(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials},(r,s)=>{if(!this.request)return;if(r)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();let n;t.method==="HEAD"?!s.responseHeaders||!s.responseHeaders.date?n=this.mainLoaded_:n=Date.parse(s.responseHeaders.date):n=Date.parse(s.responseText),this.mainPlaylistLoader_.clientOffset_=n-Date.now(),e()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main;let t=wT({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(t=IT(e,t,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=t||e;const r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];return r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!e||t&&t.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(t),Boolean(t)}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(R.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_=R.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_=OT(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,r=>{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,r=!this.media_||this.media_!==t[e];if(r?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const s=()=>{this.media().endList||(this.mediaUpdateTimeout=R.setTimeout(()=>{this.trigger("mediaupdatetimeout"),s()},So(this.media(),Boolean(r))))};s()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(r=>({cueTime:r.start,frames:[{data:r.messageData}]}));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}}var Ge={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 PT=i=>{const e=new Uint8Array(new ArrayBuffer(i.length));for(let t=0;t<i.length;t++)e[t]=i.charCodeAt(t);return e.buffer},Gf=function(i){return i.on=i.addEventListener,i.off=i.removeEventListener,i},RT=function(i){try{return URL.createObjectURL(new Blob([i],{type:"application/javascript"}))}catch(e){const t=new BlobBuilder;return t.append(i),URL.createObjectURL(t.getBlob())}},qf=function(i){return function(){const e=RT(i),t=Gf(new Worker(e));t.objURL=e;const r=t.terminate;return t.on=t.addEventListener,t.off=t.removeEventListener,t.terminate=function(){return URL.revokeObjectURL(e),r.call(this)},t}},Wf=function(i){return`var browserWorkerPolyFill = ${Gf.toString()};
browserWorkerPolyFill(self);
`+i},zf=function(i){return i.toString().replace(/^function.+?{/,"").slice(0,-1)},MT=Wf(zf(function(){var i=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},e=function(){this.init=function(){var u={};this.on=function(d,m){u[d]||(u[d]=[]),u[d]=u[d].concat(m)},this.off=function(d,m){var f;return u[d]?(f=u[d].indexOf(m),u[d]=u[d].slice(),u[d].splice(f,1),f>-1):!1},this.trigger=function(d){var m,f,T,A;if(m=u[d],!!m)if(arguments.length===2)for(T=m.length,f=0;f<T;++f)m[f].call(this,arguments[1]);else{for(A=[],f=arguments.length,f=1;f<arguments.length;++f)A.push(arguments[f]);for(T=m.length,f=0;f<T;++f)m[f].apply(this,A)}},this.dispose=function(){u={}}}};e.prototype.pipe=function(u){return this.on("data",function(d){u.push(d)}),this.on("done",function(d){u.flush(d)}),this.on("partialdone",function(d){u.partialFlush(d)}),this.on("endedtimeline",function(d){u.endTimeline(d)}),this.on("reset",function(d){u.reset(d)}),u},e.prototype.push=function(u){this.trigger("data",u)},e.prototype.flush=function(u){this.trigger("done",u)},e.prototype.partialFlush=function(u){this.trigger("partialdone",u)},e.prototype.endTimeline=function(u){this.trigger("endedtimeline",u)},e.prototype.reset=function(u){this.trigger("reset",u)};var t=e,r=Math.pow(2,32),s=function(u){var d=new DataView(u.buffer,u.byteOffset,u.byteLength),m;return d.getBigUint64?(m=d.getBigUint64(0),m<Number.MAX_SAFE_INTEGER?Number(m):m):d.getUint32(0)*r+d.getUint32(4)},n={getUint64:s,MAX_UINT32:r},a=n.MAX_UINT32,o,l,h,c,p,_,E,g,b,C,x,y,D,S,v,w,L,O,F,V,U,B,N,$,K,q,Q,oe,le,se,pe,Te,ae,_e,gt,xe;(function(){var u;if(N={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(u in N)N.hasOwnProperty(u)&&(N[u]=[u.charCodeAt(0),u.charCodeAt(1),u.charCodeAt(2),u.charCodeAt(3)]);$=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),q=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),K=new Uint8Array([0,0,0,1]),Q=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]),oe=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]),le={video:Q,audio:oe},Te=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),pe=new Uint8Array([0,0,0,0,0,0,0,0]),ae=new Uint8Array([0,0,0,0,0,0,0,0]),_e=ae,gt=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),xe=ae,se=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),o=function(u){var d=[],m=0,f,T,A;for(f=1;f<arguments.length;f++)d.push(arguments[f]);for(f=d.length;f--;)m+=d[f].byteLength;for(T=new Uint8Array(m+8),A=new DataView(T.buffer,T.byteOffset,T.byteLength),A.setUint32(0,T.byteLength),T.set(u,4),f=0,m=8;f<d.length;f++)T.set(d[f],m),m+=d[f].byteLength;return T},l=function(){return o(N.dinf,o(N.dref,Te))},h=function(u){return o(N.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,u.audioobjecttype<<3|u.samplingfrequencyindex>>>1,u.samplingfrequencyindex<<7|u.channelcount<<3,6,1,2]))},c=function(){return o(N.ftyp,$,K,$,q)},w=function(u){return o(N.hdlr,le[u])},p=function(u){return o(N.mdat,u)},v=function(u){var d=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,u.duration>>>24&255,u.duration>>>16&255,u.duration>>>8&255,u.duration&255,85,196,0,0]);return u.samplerate&&(d[12]=u.samplerate>>>24&255,d[13]=u.samplerate>>>16&255,d[14]=u.samplerate>>>8&255,d[15]=u.samplerate&255),o(N.mdhd,d)},S=function(u){return o(N.mdia,v(u),w(u.type),E(u))},_=function(u){return o(N.mfhd,new Uint8Array([0,0,0,0,(u&4278190080)>>24,(u&16711680)>>16,(u&65280)>>8,u&255]))},E=function(u){return o(N.minf,u.type==="video"?o(N.vmhd,se):o(N.smhd,pe),l(),O(u))},g=function(u,d){for(var m=[],f=d.length;f--;)m[f]=V(d[f]);return o.apply(null,[N.moof,_(u)].concat(m))},b=function(u){for(var d=u.length,m=[];d--;)m[d]=y(u[d]);return o.apply(null,[N.moov,x(4294967295)].concat(m).concat(C(u)))},C=function(u){for(var d=u.length,m=[];d--;)m[d]=U(u[d]);return o.apply(null,[N.mvex].concat(m))},x=function(u){var d=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(u&4278190080)>>24,(u&16711680)>>16,(u&65280)>>8,u&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 o(N.mvhd,d)},L=function(u){var d=u.samples||[],m=new Uint8Array(4+d.length),f,T;for(T=0;T<d.length;T++)f=d[T].flags,m[T+4]=f.dependsOn<<4|f.isDependedOn<<2|f.hasRedundancy;return o(N.sdtp,m)},O=function(u){return o(N.stbl,F(u),o(N.stts,xe),o(N.stsc,_e),o(N.stsz,gt),o(N.stco,ae))},function(){var u,d;F=function(m){return o(N.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),m.type==="video"?u(m):d(m))},u=function(m){var f=m.sps||[],T=m.pps||[],A=[],I=[],k,P;for(k=0;k<f.length;k++)A.push((f[k].byteLength&65280)>>>8),A.push(f[k].byteLength&255),A=A.concat(Array.prototype.slice.call(f[k]));for(k=0;k<T.length;k++)I.push((T[k].byteLength&65280)>>>8),I.push(T[k].byteLength&255),I=I.concat(Array.prototype.slice.call(T[k]));if(P=[N.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,(m.width&65280)>>8,m.width&255,(m.height&65280)>>8,m.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]),o(N.avcC,new Uint8Array([1,m.profileIdc,m.profileCompatibility,m.levelIdc,255].concat([f.length],A,[T.length],I))),o(N.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],m.sarRatio){var M=m.sarRatio[0],j=m.sarRatio[1];P.push(o(N.pasp,new Uint8Array([(M&4278190080)>>24,(M&16711680)>>16,(M&65280)>>8,M&255,(j&4278190080)>>24,(j&16711680)>>16,(j&65280)>>8,j&255])))}return o.apply(null,P)},d=function(m){return o(N.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(m.channelcount&65280)>>8,m.channelcount&255,(m.samplesize&65280)>>8,m.samplesize&255,0,0,0,0,(m.samplerate&65280)>>8,m.samplerate&255,0,0]),h(m))}}(),D=function(u){var d=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(u.id&4278190080)>>24,(u.id&16711680)>>16,(u.id&65280)>>8,u.id&255,0,0,0,0,(u.duration&4278190080)>>24,(u.duration&16711680)>>16,(u.duration&65280)>>8,u.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,(u.width&65280)>>8,u.width&255,0,0,(u.height&65280)>>8,u.height&255,0,0]);return o(N.tkhd,d)},V=function(u){var d,m,f,T,A,I,k;return d=o(N.tfhd,new Uint8Array([0,0,0,58,(u.id&4278190080)>>24,(u.id&16711680)>>16,(u.id&65280)>>8,u.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),I=Math.floor(u.baseMediaDecodeTime/a),k=Math.floor(u.baseMediaDecodeTime%a),m=o(N.tfdt,new Uint8Array([1,0,0,0,I>>>24&255,I>>>16&255,I>>>8&255,I&255,k>>>24&255,k>>>16&255,k>>>8&255,k&255])),A=32+20+8+16+8+8,u.type==="audio"?(f=B(u,A),o(N.traf,d,m,f)):(T=L(u),f=B(u,T.length+A),o(N.traf,d,m,f,T))},y=function(u){return u.duration=u.duration||4294967295,o(N.trak,D(u),S(u))},U=function(u){var d=new Uint8Array([0,0,0,0,(u.id&4278190080)>>24,(u.id&16711680)>>16,(u.id&65280)>>8,u.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return u.type!=="video"&&(d[d.length-1]=0),o(N.trex,d)},function(){var u,d,m;m=function(f,T){var A=0,I=0,k=0,P=0;return f.length&&(f[0].duration!==void 0&&(A=1),f[0].size!==void 0&&(I=2),f[0].flags!==void 0&&(k=4),f[0].compositionTimeOffset!==void 0&&(P=8)),[0,0,A|I|k|P,1,(f.length&4278190080)>>>24,(f.length&16711680)>>>16,(f.length&65280)>>>8,f.length&255,(T&4278190080)>>>24,(T&16711680)>>>16,(T&65280)>>>8,T&255]},d=function(f,T){var A,I,k,P,M,j;for(P=f.samples||[],T+=8+12+16*P.length,k=m(P,T),I=new Uint8Array(k.length+P.length*16),I.set(k),A=k.length,j=0;j<P.length;j++)M=P[j],I[A++]=(M.duration&4278190080)>>>24,I[A++]=(M.duration&16711680)>>>16,I[A++]=(M.duration&65280)>>>8,I[A++]=M.duration&255,I[A++]=(M.size&4278190080)>>>24,I[A++]=(M.size&16711680)>>>16,I[A++]=(M.size&65280)>>>8,I[A++]=M.size&255,I[A++]=M.flags.isLeading<<2|M.flags.dependsOn,I[A++]=M.flags.isDependedOn<<6|M.flags.hasRedundancy<<4|M.flags.paddingValue<<1|M.flags.isNonSyncSample,I[A++]=M.flags.degradationPriority&240<<8,I[A++]=M.flags.degradationPriority&15,I[A++]=(M.compositionTimeOffset&4278190080)>>>24,I[A++]=(M.compositionTimeOffset&16711680)>>>16,I[A++]=(M.compositionTimeOffset&65280)>>>8,I[A++]=M.compositionTimeOffset&255;return o(N.trun,I)},u=function(f,T){var A,I,k,P,M,j;for(P=f.samples||[],T+=8+12+8*P.length,k=m(P,T),A=new Uint8Array(k.length+P.length*8),A.set(k),I=k.length,j=0;j<P.length;j++)M=P[j],A[I++]=(M.duration&4278190080)>>>24,A[I++]=(M.duration&16711680)>>>16,A[I++]=(M.duration&65280)>>>8,A[I++]=M.duration&255,A[I++]=(M.size&4278190080)>>>24,A[I++]=(M.size&16711680)>>>16,A[I++]=(M.size&65280)>>>8,A[I++]=M.size&255;return o(N.trun,A)},B=function(f,T){return f.type==="audio"?u(f,T):d(f,T)}}();var De={ftyp:c,mdat:p,moof:g,moov:b,initSegment:function(u){var d=c(),m=b(u),f;return f=new Uint8Array(d.byteLength+m.byteLength),f.set(d),f.set(m,d.byteLength),f}},ut=function(u){var d,m,f=[],T=[];for(T.byteLength=0,T.nalCount=0,T.duration=0,f.byteLength=0,d=0;d<u.length;d++)m=u[d],m.nalUnitType==="access_unit_delimiter_rbsp"?(f.length&&(f.duration=m.dts-f.dts,T.byteLength+=f.byteLength,T.nalCount+=f.length,T.duration+=f.duration,T.push(f)),f=[m],f.byteLength=m.data.byteLength,f.pts=m.pts,f.dts=m.dts):(m.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(f.keyFrame=!0),f.duration=m.dts-f.dts,f.byteLength+=m.data.byteLength,f.push(m));return T.length&&(!f.duration||f.duration<=0)&&(f.duration=T[T.length-1].duration),T.byteLength+=f.byteLength,T.nalCount+=f.length,T.duration+=f.duration,T.push(f),T},Ve=function(u){var d,m,f=[],T=[];for(f.byteLength=0,f.nalCount=0,f.duration=0,f.pts=u[0].pts,f.dts=u[0].dts,T.byteLength=0,T.nalCount=0,T.duration=0,T.pts=u[0].pts,T.dts=u[0].dts,d=0;d<u.length;d++)m=u[d],m.keyFrame?(f.length&&(T.push(f),T.byteLength+=f.byteLength,T.nalCount+=f.nalCount,T.duration+=f.duration),f=[m],f.nalCount=m.length,f.byteLength=m.byteLength,f.pts=m.pts,f.dts=m.dts,f.duration=m.duration):(f.duration+=m.duration,f.nalCount+=m.length,f.byteLength+=m.byteLength,f.push(m));return T.length&&f.duration<=0&&(f.duration=T[T.length-1].duration),T.byteLength+=f.byteLength,T.nalCount+=f.nalCount,T.duration+=f.duration,T.push(f),T},Ze=function(u){var d;return!u[0][0].keyFrame&&u.length>1&&(d=u.shift(),u.byteLength-=d.byteLength,u.nalCount-=d.nalCount,u[0][0].dts=d.dts,u[0][0].pts=d.pts,u[0][0].duration+=d.duration),u},It=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},Ce=function(u,d){var m=It();return m.dataOffset=d,m.compositionTimeOffset=u.pts-u.dts,m.duration=u.duration,m.size=4*u.length,m.size+=u.byteLength,u.keyFrame&&(m.flags.dependsOn=2,m.flags.isNonSyncSample=0),m},ue=function(u,d){var m,f,T,A,I,k=d||0,P=[];for(m=0;m<u.length;m++)for(A=u[m],f=0;f<A.length;f++)I=A[f],T=Ce(I,k),k+=T.size,P.push(T);return P},et=function(u){var d,m,f,T,A,I,k=0,P=u.byteLength,M=u.nalCount,j=P+4*M,H=new Uint8Array(j),ee=new DataView(H.buffer);for(d=0;d<u.length;d++)for(T=u[d],m=0;m<T.length;m++)for(A=T[m],f=0;f<A.length;f++)I=A[f],ee.setUint32(k,I.data.byteLength),k+=4,H.set(I.data,k),k+=I.data.byteLength;return H},bt=function(u,d){var m,f=d||0,T=[];return m=Ce(u,f),T.push(m),T},ei=function(u){var d,m,f=0,T=u.byteLength,A=u.length,I=T+4*A,k=new Uint8Array(I),P=new DataView(k.buffer);for(d=0;d<u.length;d++)m=u[d],P.setUint32(f,m.data.byteLength),f+=4,k.set(m.data,f),f+=m.data.byteLength;return k},kt={groupNalsIntoFrames:ut,groupFramesIntoGops:Ve,extendFirstKeyFrame:Ze,generateSampleTable:ue,concatenateNalData:et,generateSampleTableForFrame:bt,concatenateNalDataForFrame:ei},ze=[33,16,5,32,164,27],Ft=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],ve=function(u){for(var d=[];u--;)d.push(0);return d},Et=function(u){return Object.keys(u).reduce(function(d,m){return d[m]=new Uint8Array(u[m].reduce(function(f,T){return f.concat(T)},[])),d},{})},Xe,Si=function(){if(!Xe){var u={96e3:[ze,[227,64],ve(154),[56]],88200:[ze,[231],ve(170),[56]],64e3:[ze,[248,192],ve(240),[56]],48e3:[ze,[255,192],ve(268),[55,148,128],ve(54),[112]],44100:[ze,[255,192],ve(268),[55,163,128],ve(84),[112]],32e3:[ze,[255,192],ve(268),[55,234],ve(226),[112]],24e3:[ze,[255,192],ve(268),[55,255,128],ve(268),[111,112],ve(126),[224]],16e3:[ze,[255,192],ve(268),[55,255,128],ve(268),[111,255],ve(269),[223,108],ve(195),[1,192]],12e3:[Ft,ve(268),[3,127,248],ve(268),[6,255,240],ve(268),[13,255,224],ve(268),[27,253,128],ve(259),[56]],11025:[Ft,ve(268),[3,127,248],ve(268),[6,255,240],ve(268),[13,255,224],ve(268),[27,255,192],ve(268),[55,175,128],ve(108),[112]],8e3:[Ft,ve(268),[3,121,16],ve(47),[7]]};Xe=Et(u)}return Xe},pi=9e4,Or,Pr,$i,He,Rs,W,Z;Or=function(u){return u*pi},Pr=function(u,d){return u*d},$i=function(u){return u/pi},He=function(u,d){return u/d},Rs=function(u,d){return Or(He(u,d))},W=function(u,d){return Pr($i(u),d)},Z=function(u,d,m){return $i(m?u:u-d)};var Y={ONE_SECOND_IN_TS:pi,secondsToVideoTs:Or,secondsToAudioTs:Pr,videoTsToSeconds:$i,audioTsToSeconds:He,audioTsToVideoTs:Rs,videoTsToAudioTs:W,metadataTsToSeconds:Z},ie=Si,ce=Y,ge=function(u){var d,m,f=0;for(d=0;d<u.length;d++)m=u[d],f+=m.data.byteLength;return f},Ue=function(u,d,m,f){var T,A=0,I=0,k=0,P=0,M,j,H;if(!!d.length&&(T=ce.audioTsToVideoTs(u.baseMediaDecodeTime,u.samplerate),A=Math.ceil(ce.ONE_SECOND_IN_TS/(u.samplerate/1024)),m&&f&&(I=T-Math.max(m,f),k=Math.floor(I/A),P=k*A),!(k<1||P>ce.ONE_SECOND_IN_TS/2))){for(M=ie()[u.samplerate],M||(M=d[0].data),j=0;j<k;j++)H=d[0],d.splice(0,0,{data:M,dts:H.dts-A,pts:H.pts-A});return u.baseMediaDecodeTime-=Math.floor(ce.videoTsToAudioTs(P,u.samplerate)),P}},mi=function(u,d,m){return d.minSegmentDts>=m?u:(d.minSegmentDts=1/0,u.filter(function(f){return f.dts>=m?(d.minSegmentDts=Math.min(d.minSegmentDts,f.dts),d.minSegmentPts=d.minSegmentDts,!0):!1}))},Hi=function(u){var d,m,f=[];for(d=0;d<u.length;d++)m=u[d],f.push({size:m.data.byteLength,duration:1024});return f},Rr=function(u){var d,m,f=0,T=new Uint8Array(ge(u));for(d=0;d<u.length;d++)m=u[d],T.set(m.data,f),f+=m.data.byteLength;return T},Mr={prefixWithSilence:Ue,trimAdtsFramesByEarliestDts:mi,generateSampleTable:Hi,concatenateFrameData:Rr},yp=Y.ONE_SECOND_IN_TS,Tp=function(u,d){typeof d.pts=="number"&&(u.timelineStartInfo.pts===void 0&&(u.timelineStartInfo.pts=d.pts),u.minSegmentPts===void 0?u.minSegmentPts=d.pts:u.minSegmentPts=Math.min(u.minSegmentPts,d.pts),u.maxSegmentPts===void 0?u.maxSegmentPts=d.pts:u.maxSegmentPts=Math.max(u.maxSegmentPts,d.pts)),typeof d.dts=="number"&&(u.timelineStartInfo.dts===void 0&&(u.timelineStartInfo.dts=d.dts),u.minSegmentDts===void 0?u.minSegmentDts=d.dts:u.minSegmentDts=Math.min(u.minSegmentDts,d.dts),u.maxSegmentDts===void 0?u.maxSegmentDts=d.dts:u.maxSegmentDts=Math.max(u.maxSegmentDts,d.dts))},xp=function(u){delete u.minSegmentDts,delete u.maxSegmentDts,delete u.minSegmentPts,delete u.maxSegmentPts},bp=function(u,d){var m,f,T=u.minSegmentDts;return d||(T-=u.timelineStartInfo.dts),m=u.timelineStartInfo.baseMediaDecodeTime,m+=T,m=Math.max(0,m),u.type==="audio"&&(f=u.samplerate/yp,m*=f,m=Math.floor(m)),m},Ep={clearDtsInfo:xp,calculateTrackBaseMediaDecodeTime:bp,collectDtsInfo:Tp},Nu=4,Sp=128,Cp=function(u){for(var d=0,m={payloadType:-1,payloadSize:0},f=0,T=0;d<u.byteLength&&u[d]!==Sp;){for(;u[d]===255;)f+=255,d++;for(f+=u[d++];u[d]===255;)T+=255,d++;if(T+=u[d++],!m.payload&&f===Nu){var A=String.fromCharCode(u[d+3],u[d+4],u[d+5],u[d+6]);if(A==="GA94"){m.payloadType=f,m.payloadSize=T,m.payload=u.subarray(d,d+T);break}else m.payload=void 0}d+=T,f=0,T=0}return m},Ap=function(u){return u.payload[0]!==181||(u.payload[1]<<8|u.payload[2])!==49||String.fromCharCode(u.payload[3],u.payload[4],u.payload[5],u.payload[6])!=="GA94"||u.payload[7]!==3?null:u.payload.subarray(8,u.payload.length-1)},Dp=function(u,d){var m=[],f,T,A,I;if(!(d[0]&64))return m;for(T=d[0]&31,f=0;f<T;f++)A=f*3,I={type:d[A+2]&3,pts:u},d[A+2]&4&&(I.ccData=d[A+3]<<8|d[A+4],m.push(I));return m},wp=function(u){for(var d=u.byteLength,m=[],f=1,T,A;f<d-2;)u[f]===0&&u[f+1]===0&&u[f+2]===3?(m.push(f+2),f+=2):f++;if(m.length===0)return u;T=d-m.length,A=new Uint8Array(T);var I=0;for(f=0;f<T;I++,f++)I===m[0]&&(I++,m.shift()),A[f]=u[I];return A},Fu={parseSei:Cp,parseUserData:Ap,parseCaptionPackets:Dp,discardEmulationPreventionBytes:wp,USER_DATA_REGISTERED_ITU_T_T35:Nu},ga=t,Ms=Fu,lt=function(u){u=u||{},lt.prototype.init.call(this),this.parse708captions_=typeof u.parse708captions=="boolean"?u.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new ke(0,0),new ke(0,1),new ke(1,0),new ke(1,1)],this.parse708captions_&&(this.cc708Stream_=new Ae({captionServices:u.captionServices})),this.reset(),this.ccStreams_.forEach(function(d){d.on("data",this.trigger.bind(this,"data")),d.on("partialdone",this.trigger.bind(this,"partialdone")),d.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")))};lt.prototype=new ga,lt.prototype.push=function(u){var d,m,f;if(u.nalUnitType==="sei_rbsp"&&(d=Ms.parseSei(u.escapedRBSP),!!d.payload&&d.payloadType===Ms.USER_DATA_REGISTERED_ITU_T_T35&&(m=Ms.parseUserData(d),!!m))){if(u.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(u.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}f=Ms.parseCaptionPackets(u.pts,m),this.captionPackets_=this.captionPackets_.concat(f),this.latestDts_!==u.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=u.dts}},lt.prototype.flushCCStreams=function(u){this.ccStreams_.forEach(function(d){return u==="flush"?d.flush():d.partialFlush()},this)},lt.prototype.flushStream=function(u){if(!this.captionPackets_.length){this.flushCCStreams(u);return}this.captionPackets_.forEach(function(d,m){d.presortIndex=m}),this.captionPackets_.sort(function(d,m){return d.pts===m.pts?d.presortIndex-m.presortIndex:d.pts-m.pts}),this.captionPackets_.forEach(function(d){d.type<2?this.dispatchCea608Packet(d):this.dispatchCea708Packet(d)},this),this.captionPackets_.length=0,this.flushCCStreams(u)},lt.prototype.flush=function(){return this.flushStream("flush")},lt.prototype.partialFlush=function(){return this.flushStream("partialFlush")},lt.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(u){u.reset()})},lt.prototype.dispatchCea608Packet=function(u){this.setsTextOrXDSActive(u)?this.activeCea608Channel_[u.type]=null:this.setsChannel1Active(u)?this.activeCea608Channel_[u.type]=0:this.setsChannel2Active(u)&&(this.activeCea608Channel_[u.type]=1),this.activeCea608Channel_[u.type]!==null&&this.ccStreams_[(u.type<<1)+this.activeCea608Channel_[u.type]].push(u)},lt.prototype.setsChannel1Active=function(u){return(u.ccData&30720)===4096},lt.prototype.setsChannel2Active=function(u){return(u.ccData&30720)===6144},lt.prototype.setsTextOrXDSActive=function(u){return(u.ccData&28928)===256||(u.ccData&30974)===4138||(u.ccData&30974)===6186},lt.prototype.dispatchCea708Packet=function(u){this.parse708captions_&&this.cc708Stream_.push(u)};var Lp={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},Ip=function(u){var d=Lp[u]||u;return u&4096&&u===d?"":String.fromCharCode(d)},Bs=function(u){return 32<=u&&u<=127||160<=u&&u<=255},ti=function(u){this.windowNum=u,this.reset()};ti.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},ti.prototype.getText=function(){return this.rows.join(`
`)},ti.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},ti.prototype.newLine=function(u){for(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(u),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},ti.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},ti.prototype.addText=function(u){this.rows[this.rowIdx]+=u},ti.prototype.backspace=function(){if(!this.isEmpty()){var u=this.rows[this.rowIdx];this.rows[this.rowIdx]=u.substr(0,u.length-1)}};var Ns=function(u,d,m){this.serviceNum=u,this.text="",this.currentWindow=new ti(-1),this.windows=[],this.stream=m,typeof d=="string"&&this.createTextDecoder(d)};Ns.prototype.init=function(u,d){this.startPts=u;for(var m=0;m<8;m++)this.windows[m]=new ti(m),typeof d=="function"&&(this.windows[m].beforeRowOverflow=d)},Ns.prototype.setCurrentWindow=function(u){this.currentWindow=this.windows[u]},Ns.prototype.createTextDecoder=function(u){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(u)}catch(d){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+u+" encoding. "+d})}};var Ae=function(u){u=u||{},Ae.prototype.init.call(this);var d=this,m=u.captionServices||{},f={},T;Object.keys(m).forEach(A=>{T=m[A],/^SERVICE/.test(A)&&(f[A]=T.encoding)}),this.serviceEncodings=f,this.current708Packet=null,this.services={},this.push=function(A){A.type===3?(d.new708Packet(),d.add708Bytes(A)):(d.current708Packet===null&&d.new708Packet(),d.add708Bytes(A))}};Ae.prototype=new ga,Ae.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},Ae.prototype.add708Bytes=function(u){var d=u.ccData,m=d>>>8,f=d&255;this.current708Packet.ptsVals.push(u.pts),this.current708Packet.data.push(m),this.current708Packet.data.push(f)},Ae.prototype.push708Packet=function(){var u=this.current708Packet,d=u.data,m=null,f=null,T=0,A=d[T++];for(u.seq=A>>6,u.sizeCode=A&63;T<d.length;T++)A=d[T++],m=A>>5,f=A&31,m===7&&f>0&&(A=d[T++],m=A),this.pushServiceBlock(m,T,f),f>0&&(T+=f-1)},Ae.prototype.pushServiceBlock=function(u,d,m){var f,T=d,A=this.current708Packet.data,I=this.services[u];for(I||(I=this.initService(u,T));T<d+m&&T<A.length;T++)f=A[T],Bs(f)?T=this.handleText(T,I):f===24?T=this.multiByteCharacter(T,I):f===16?T=this.extendedCommands(T,I):128<=f&&f<=135?T=this.setCurrentWindow(T,I):152<=f&&f<=159?T=this.defineWindow(T,I):f===136?T=this.clearWindows(T,I):f===140?T=this.deleteWindows(T,I):f===137?T=this.displayWindows(T,I):f===138?T=this.hideWindows(T,I):f===139?T=this.toggleWindows(T,I):f===151?T=this.setWindowAttributes(T,I):f===144?T=this.setPenAttributes(T,I):f===145?T=this.setPenColor(T,I):f===146?T=this.setPenLocation(T,I):f===143?I=this.reset(T,I):f===8?I.currentWindow.backspace():f===12?I.currentWindow.clearText():f===13?I.currentWindow.pendingNewLine=!0:f===14?I.currentWindow.clearText():f===141&&T++},Ae.prototype.extendedCommands=function(u,d){var m=this.current708Packet.data,f=m[++u];return Bs(f)&&(u=this.handleText(u,d,{isExtended:!0})),u},Ae.prototype.getPts=function(u){return this.current708Packet.ptsVals[Math.floor(u/2)]},Ae.prototype.initService=function(u,d){var f="SERVICE"+u,m=this,f,T;return f in this.serviceEncodings&&(T=this.serviceEncodings[f]),this.services[u]=new Ns(u,T,m),this.services[u].init(this.getPts(d),function(A){m.flushDisplayed(A,m.services[u])}),this.services[u]},Ae.prototype.handleText=function(u,d,m){var f=m&&m.isExtended,T=m&&m.isMultiByte,A=this.current708Packet.data,I=f?4096:0,k=A[u],P=A[u+1],M=d.currentWindow,j,H;return d.textDecoder_&&!f?(T?(H=[k,P],u++):H=[k],j=d.textDecoder_.decode(new Uint8Array(H))):j=Ip(I|k),M.pendingNewLine&&!M.isEmpty()&&M.newLine(this.getPts(u)),M.pendingNewLine=!1,M.addText(j),u},Ae.prototype.multiByteCharacter=function(u,d){var m=this.current708Packet.data,f=m[u+1],T=m[u+2];return Bs(f)&&Bs(T)&&(u=this.handleText(++u,d,{isMultiByte:!0})),u},Ae.prototype.setCurrentWindow=function(u,d){var m=this.current708Packet.data,f=m[u],T=f&7;return d.setCurrentWindow(T),u},Ae.prototype.defineWindow=function(u,d){var m=this.current708Packet.data,f=m[u],T=f&7;d.setCurrentWindow(T);var A=d.currentWindow;return f=m[++u],A.visible=(f&32)>>5,A.rowLock=(f&16)>>4,A.columnLock=(f&8)>>3,A.priority=f&7,f=m[++u],A.relativePositioning=(f&128)>>7,A.anchorVertical=f&127,f=m[++u],A.anchorHorizontal=f,f=m[++u],A.anchorPoint=(f&240)>>4,A.rowCount=f&15,f=m[++u],A.columnCount=f&63,f=m[++u],A.windowStyle=(f&56)>>3,A.penStyle=f&7,A.virtualRowCount=A.rowCount+1,u},Ae.prototype.setWindowAttributes=function(u,d){var m=this.current708Packet.data,f=m[u],T=d.currentWindow.winAttr;return f=m[++u],T.fillOpacity=(f&192)>>6,T.fillRed=(f&48)>>4,T.fillGreen=(f&12)>>2,T.fillBlue=f&3,f=m[++u],T.borderType=(f&192)>>6,T.borderRed=(f&48)>>4,T.borderGreen=(f&12)>>2,T.borderBlue=f&3,f=m[++u],T.borderType+=(f&128)>>5,T.wordWrap=(f&64)>>6,T.printDirection=(f&48)>>4,T.scrollDirection=(f&12)>>2,T.justify=f&3,f=m[++u],T.effectSpeed=(f&240)>>4,T.effectDirection=(f&12)>>2,T.displayEffect=f&3,u},Ae.prototype.flushDisplayed=function(u,d){for(var m=[],f=0;f<8;f++)d.windows[f].visible&&!d.windows[f].isEmpty()&&m.push(d.windows[f].getText());d.endPts=u,d.text=m.join(`
`),this.pushCaption(d),d.startPts=u},Ae.prototype.pushCaption=function(u){u.text!==""&&(this.trigger("data",{startPts:u.startPts,endPts:u.endPts,text:u.text,stream:"cc708_"+u.serviceNum}),u.text="",u.startPts=u.endPts)},Ae.prototype.displayWindows=function(u,d){var m=this.current708Packet.data,f=m[++u],T=this.getPts(u);this.flushDisplayed(T,d);for(var A=0;A<8;A++)f&1<<A&&(d.windows[A].visible=1);return u},Ae.prototype.hideWindows=function(u,d){var m=this.current708Packet.data,f=m[++u],T=this.getPts(u);this.flushDisplayed(T,d);for(var A=0;A<8;A++)f&1<<A&&(d.windows[A].visible=0);return u},Ae.prototype.toggleWindows=function(u,d){var m=this.current708Packet.data,f=m[++u],T=this.getPts(u);this.flushDisplayed(T,d);for(var A=0;A<8;A++)f&1<<A&&(d.windows[A].visible^=1);return u},Ae.prototype.clearWindows=function(u,d){var m=this.current708Packet.data,f=m[++u],T=this.getPts(u);this.flushDisplayed(T,d);for(var A=0;A<8;A++)f&1<<A&&d.windows[A].clearText();return u},Ae.prototype.deleteWindows=function(u,d){var m=this.current708Packet.data,f=m[++u],T=this.getPts(u);this.flushDisplayed(T,d);for(var A=0;A<8;A++)f&1<<A&&d.windows[A].reset();return u},Ae.prototype.setPenAttributes=function(u,d){var m=this.current708Packet.data,f=m[u],T=d.currentWindow.penAttr;return f=m[++u],T.textTag=(f&240)>>4,T.offset=(f&12)>>2,T.penSize=f&3,f=m[++u],T.italics=(f&128)>>7,T.underline=(f&64)>>6,T.edgeType=(f&56)>>3,T.fontStyle=f&7,u},Ae.prototype.setPenColor=function(u,d){var m=this.current708Packet.data,f=m[u],T=d.currentWindow.penColor;return f=m[++u],T.fgOpacity=(f&192)>>6,T.fgRed=(f&48)>>4,T.fgGreen=(f&12)>>2,T.fgBlue=f&3,f=m[++u],T.bgOpacity=(f&192)>>6,T.bgRed=(f&48)>>4,T.bgGreen=(f&12)>>2,T.bgBlue=f&3,f=m[++u],T.edgeRed=(f&48)>>4,T.edgeGreen=(f&12)>>2,T.edgeBlue=f&3,u},Ae.prototype.setPenLocation=function(u,d){var m=this.current708Packet.data,f=m[u],T=d.currentWindow.penLoc;return d.currentWindow.pendingNewLine=!0,f=m[++u],T.row=f&15,f=m[++u],T.column=f&63,u},Ae.prototype.reset=function(u,d){var m=this.getPts(u);return this.flushDisplayed(m,d),this.initService(d.serviceNum,u)};var kp={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},Fs=function(u){return u===null?"":(u=kp[u]||u,String.fromCharCode(u))},Us=14,Op=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Ci=function(){for(var u=[],d=Us+1;d--;)u.push({text:"",indent:0,offset:0});return u},ke=function(u,d){ke.prototype.init.call(this),this.field_=u||0,this.dataChannel_=d||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(m){var f,T,A,I,k;if(f=m.ccData&32639,f===this.lastControlCode_){this.lastControlCode_=null;return}if((f&61440)===4096?this.lastControlCode_=f:f!==this.PADDING_&&(this.lastControlCode_=null),A=f>>>8,I=f&255,f!==this.PADDING_)if(f===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(f===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(m.pts),this.flushDisplayed(m.pts),T=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=T,this.startPts_=m.pts;else if(f===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(m.pts);else if(f===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(m.pts);else if(f===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(m.pts);else if(f===this.CARRIAGE_RETURN_)this.clearFormatting(m.pts),this.flushDisplayed(m.pts),this.shiftRowsUp_(),this.startPts_=m.pts;else if(f===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(f===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(m.pts),this.displayed_=Ci();else if(f===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Ci();else if(f===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(m.pts),this.displayed_=Ci()),this.mode_="paintOn",this.startPts_=m.pts;else if(this.isSpecialCharacter(A,I))A=(A&3)<<8,k=Fs(A|I),this[this.mode_](m.pts,k),this.column_++;else if(this.isExtCharacter(A,I))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),A=(A&3)<<8,k=Fs(A|I),this[this.mode_](m.pts,k),this.column_++;else if(this.isMidRowCode(A,I))this.clearFormatting(m.pts),this[this.mode_](m.pts," "),this.column_++,(I&14)===14&&this.addFormatting(m.pts,["i"]),(I&1)===1&&this.addFormatting(m.pts,["u"]);else if(this.isOffsetControlCode(A,I)){const M=I&3;this.nonDisplayed_[this.row_].offset=M,this.column_+=M}else if(this.isPAC(A,I)){var P=Op.indexOf(f&7968);if(this.mode_==="rollUp"&&(P-this.rollUpRows_+1<0&&(P=this.rollUpRows_-1),this.setRollUp(m.pts,P)),P!==this.row_&&(this.clearFormatting(m.pts),this.row_=P),I&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(m.pts,["u"]),(f&16)===16){const M=(f&14)>>1;this.column_=M*4,this.nonDisplayed_[this.row_].indent+=M}this.isColorPAC(I)&&(I&14)===14&&this.addFormatting(m.pts,["i"])}else this.isNormalChar(A)&&(I===0&&(I=null),k=Fs(A),k+=Fs(I),this[this.mode_](m.pts,k),this.column_+=k.length)}};ke.prototype=new ga,ke.prototype.flushDisplayed=function(u){const d=f=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+f+"."})},m=[];this.displayed_.forEach((f,T)=>{if(f&&f.text&&f.text.length){try{f.text=f.text.trim()}catch(A){d(T)}f.text.length&&m.push({text:f.text,line:T+1,position:10+Math.min(70,f.indent*10)+f.offset*2.5})}else f==null&&d(T)}),m.length&&this.trigger("data",{startPts:this.startPts_,endPts:u,content:m,stream:this.name_})},ke.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Ci(),this.nonDisplayed_=Ci(),this.lastControlCode_=null,this.column_=0,this.row_=Us,this.rollUpRows_=2,this.formatting_=[]},ke.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},ke.prototype.isSpecialCharacter=function(u,d){return u===this.EXT_&&d>=48&&d<=63},ke.prototype.isExtCharacter=function(u,d){return(u===this.EXT_+1||u===this.EXT_+2)&&d>=32&&d<=63},ke.prototype.isMidRowCode=function(u,d){return u===this.EXT_&&d>=32&&d<=47},ke.prototype.isOffsetControlCode=function(u,d){return u===this.OFFSET_&&d>=33&&d<=35},ke.prototype.isPAC=function(u,d){return u>=this.BASE_&&u<this.BASE_+8&&d>=64&&d<=127},ke.prototype.isColorPAC=function(u){return u>=64&&u<=79||u>=96&&u<=127},ke.prototype.isNormalChar=function(u){return u>=32&&u<=127},ke.prototype.setRollUp=function(u,d){if(this.mode_!=="rollUp"&&(this.row_=Us,this.mode_="rollUp",this.flushDisplayed(u),this.nonDisplayed_=Ci(),this.displayed_=Ci()),d!==void 0&&d!==this.row_)for(var m=0;m<this.rollUpRows_;m++)this.displayed_[d-m]=this.displayed_[this.row_-m],this.displayed_[this.row_-m]={text:"",indent:0,offset:0};d===void 0&&(d=this.row_),this.topRow_=d-this.rollUpRows_+1},ke.prototype.addFormatting=function(u,d){this.formatting_=this.formatting_.concat(d);var m=d.reduce(function(f,T){return f+"<"+T+">"},"");this[this.mode_](u,m)},ke.prototype.clearFormatting=function(u){if(!!this.formatting_.length){var d=this.formatting_.reverse().reduce(function(m,f){return m+"</"+f+">"},"");this.formatting_=[],this[this.mode_](u,d)}},ke.prototype.popOn=function(u,d){var m=this.nonDisplayed_[this.row_].text;m+=d,this.nonDisplayed_[this.row_].text=m},ke.prototype.rollUp=function(u,d){var m=this.displayed_[this.row_].text;m+=d,this.displayed_[this.row_].text=m},ke.prototype.shiftRowsUp_=function(){var u;for(u=0;u<this.topRow_;u++)this.displayed_[u]={text:"",indent:0,offset:0};for(u=this.row_+1;u<Us+1;u++)this.displayed_[u]={text:"",indent:0,offset:0};for(u=this.topRow_;u<this.row_;u++)this.displayed_[u]=this.displayed_[u+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},ke.prototype.paintOn=function(u,d){var m=this.displayed_[this.row_].text;m+=d,this.displayed_[this.row_].text=m};var Uu={CaptionStream:lt,Cea608Stream:ke,Cea708Stream:Ae},js={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Pp=t,Rp=8589934592,Mp=4294967296,ju="shared",_a=function(u,d){var m=1;for(u>d&&(m=-1);Math.abs(d-u)>Mp;)u+=m*Rp;return u},va=function(u){var d,m;va.prototype.init.call(this),this.type_=u||ju,this.push=function(f){this.type_!==ju&&f.type!==this.type_||(m===void 0&&(m=f.dts),f.dts=_a(f.dts,m),f.pts=_a(f.pts,m),d=f.dts,this.trigger("data",f))},this.flush=function(){m=d,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){m=void 0,d=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};va.prototype=new Pp;var Vu={TimestampRolloverStream:va,handleRollover:_a},Bp=(u,d,m)=>{if(!u)return-1;for(var f=m;f<u.length;f++)if(u[f]===d)return f;return-1},Np={typedArrayIndexOf:Bp},Vs=Np.typedArrayIndexOf,$s={Iso88591:0,Utf16:1,Utf16be:2,Utf8:3},$u=function(u,d,m){var f,T="";for(f=d;f<m;f++)T+="%"+("00"+u[f].toString(16)).slice(-2);return T},Br=function(u,d,m){return decodeURIComponent($u(u,d,m))},Nr=function(u,d,m){return unescape($u(u,d,m))},Fr=function(u){return u[0]<<21|u[1]<<14|u[2]<<7|u[3]},Ur={APIC:function(u){var d=1,m,f,T="-->";u.data[0]===$s.Utf8&&(m=Vs(u.data,0,d),!(m<0)&&(u.mimeType=Nr(u.data,d,m),d=m+1,u.pictureType=u.data[d],d++,f=Vs(u.data,0,d),!(f<0)&&(u.description=Br(u.data,d,f),d=f+1,u.mimeType===T?u.url=Nr(u.data,d,u.data.length):u.pictureData=u.data.subarray(d,u.data.length))))},"T*":function(u){u.data[0]===$s.Utf8&&(u.value=Br(u.data,1,u.data.length).replace(/\0*$/,""),u.values=u.value.split("\0"))},TXXX:function(u){var d;u.data[0]===$s.Utf8&&(d=Vs(u.data,0,1),d!==-1&&(u.description=Br(u.data,1,d),u.value=Br(u.data,d+1,u.data.length).replace(/\0*$/,""),u.data=u.value))},"W*":function(u){u.url=Nr(u.data,0,u.data.length).replace(/\0.*$/,"")},WXXX:function(u){var d;u.data[0]===$s.Utf8&&(d=Vs(u.data,0,1),d!==-1&&(u.description=Br(u.data,1,d),u.url=Nr(u.data,d+1,u.data.length).replace(/\0.*$/,"")))},PRIV:function(u){var d;for(d=0;d<u.data.length;d++)if(u.data[d]===0){u.owner=Nr(u.data,0,d);break}u.privateData=u.data.subarray(d+1),u.data=u.privateData}},Fp=function(u){var d,m,f=10,T=0,A=[];if(!(u.length<10||u[0]!=="I".charCodeAt(0)||u[1]!=="D".charCodeAt(0)||u[2]!=="3".charCodeAt(0))){T=Fr(u.subarray(6,10)),T+=10;var I=u[5]&64;I&&(f+=4,f+=Fr(u.subarray(10,14)),T-=Fr(u.subarray(16,20)));do{if(d=Fr(u.subarray(f+4,f+8)),d<1)break;m=String.fromCharCode(u[f],u[f+1],u[f+2],u[f+3]);var k={id:m,data:u.subarray(f+10,f+d+10)};k.key=k.id,Ur[k.id]?Ur[k.id](k):k.id[0]==="T"?Ur["T*"](k):k.id[0]==="W"&&Ur["W*"](k),A.push(k),f+=10,f+=d}while(f<T);return A}},Hu={parseId3Frames:Fp,parseSyncSafeInteger:Fr,frameParsers:Ur},Up=t,jp=js,gi=Hu,Hs;Hs=function(u){var d={descriptor:u&&u.descriptor},m=0,f=[],T=0,A;if(Hs.prototype.init.call(this),this.dispatchType=jp.METADATA_STREAM_TYPE.toString(16),d.descriptor)for(A=0;A<d.descriptor.length;A++)this.dispatchType+=("00"+d.descriptor[A].toString(16)).slice(-2);this.push=function(I){var k,P,M,j,H,ee;if(I.type==="timed-metadata"){if(I.dataAlignmentIndicator&&(T=0,f.length=0),f.length===0&&(I.data.length<10||I.data[0]!=="I".charCodeAt(0)||I.data[1]!=="D".charCodeAt(0)||I.data[2]!=="3".charCodeAt(0))){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(f.push(I),T+=I.data.byteLength,f.length===1&&(m=gi.parseSyncSafeInteger(I.data.subarray(6,10)),m+=10),!(T<m)){for(k={data:new Uint8Array(m),frames:[],pts:f[0].pts,dts:f[0].dts},H=0;H<m;)k.data.set(f[0].data.subarray(0,m-H),H),H+=f[0].data.byteLength,T-=f[0].data.byteLength,f.shift();P=10,k.data[5]&64&&(P+=4,P+=gi.parseSyncSafeInteger(k.data.subarray(10,14)),m-=gi.parseSyncSafeInteger(k.data.subarray(16,20)));do{if(M=gi.parseSyncSafeInteger(k.data.subarray(P+4,P+8)),M<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if(ee=String.fromCharCode(k.data[P],k.data[P+1],k.data[P+2],k.data[P+3]),j={id:ee,data:k.data.subarray(P+10,P+M+10)},j.key=j.id,gi.frameParsers[j.id]?gi.frameParsers[j.id](j):j.id[0]==="T"?gi.frameParsers["T*"](j):j.id[0]==="W"&&gi.frameParsers["W*"](j),j.owner==="com.apple.streaming.transportStreamTimestamp"){var X=j.data,ne=(X[3]&1)<<30|X[4]<<22|X[5]<<14|X[6]<<6|X[7]>>>2;ne*=4,ne+=X[7]&3,j.timeStamp=ne,k.pts===void 0&&k.dts===void 0&&(k.pts=j.timeStamp,k.dts=j.timeStamp),this.trigger("timestamp",j)}k.frames.push(j),P+=10,P+=M}while(P<m);this.trigger("data",k)}}}},Hs.prototype=new Up;var Vp=Hs,ya=t,Ta=Uu,Ot=js,$p=Vu.TimestampRolloverStream,Gs,jr,qs,Gi=188,xa=71;Gs=function(){var u=new Uint8Array(Gi),d=0;Gs.prototype.init.call(this),this.push=function(m){var f=0,T=Gi,A;for(d?(A=new Uint8Array(m.byteLength+d),A.set(u.subarray(0,d)),A.set(m,d),d=0):A=m;T<A.byteLength;){if(A[f]===xa&&A[T]===xa){this.trigger("data",A.subarray(f,T)),f+=Gi,T+=Gi;continue}f++,T++}f<A.byteLength&&(u.set(A.subarray(f),0),d=A.byteLength-f)},this.flush=function(){d===Gi&&u[0]===xa&&(this.trigger("data",u),d=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){d=0,this.trigger("reset")}},Gs.prototype=new ya,jr=function(){var u,d,m,f;jr.prototype.init.call(this),f=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,u=function(T,A){var I=0;A.payloadUnitStartIndicator&&(I+=T[I]+1),A.type==="pat"?d(T.subarray(I),A):m(T.subarray(I),A)},d=function(T,A){A.section_number=T[7],A.last_section_number=T[8],f.pmtPid=(T[10]&31)<<8|T[11],A.pmtPid=f.pmtPid},m=function(T,A){var I,k,P,M;if(!!(T[5]&1)){for(f.programMapTable={video:null,audio:null,"timed-metadata":{}},I=(T[1]&15)<<8|T[2],k=3+I-4,P=(T[10]&15)<<8|T[11],M=12+P;M<k;){var j=T[M],H=(T[M+1]&31)<<8|T[M+2];j===Ot.H264_STREAM_TYPE&&f.programMapTable.video===null?f.programMapTable.video=H:j===Ot.ADTS_STREAM_TYPE&&f.programMapTable.audio===null?f.programMapTable.audio=H:j===Ot.METADATA_STREAM_TYPE&&(f.programMapTable["timed-metadata"][H]=j),M+=((T[M+3]&15)<<8|T[M+4])+5}A.programMapTable=f.programMapTable}},this.push=function(T){var A={},I=4;if(A.payloadUnitStartIndicator=!!(T[1]&64),A.pid=T[1]&31,A.pid<<=8,A.pid|=T[2],(T[3]&48)>>>4>1&&(I+=T[I]+1),A.pid===0)A.type="pat",u(T.subarray(I),A),this.trigger("data",A);else if(A.pid===this.pmtPid)for(A.type="pmt",u(T.subarray(I),A),this.trigger("data",A);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([T,I,A]):this.processPes_(T,I,A)},this.processPes_=function(T,A,I){I.pid===this.programMapTable.video?I.streamType=Ot.H264_STREAM_TYPE:I.pid===this.programMapTable.audio?I.streamType=Ot.ADTS_STREAM_TYPE:I.streamType=this.programMapTable["timed-metadata"][I.pid],I.type="pes",I.data=T.subarray(A),this.trigger("data",I)}},jr.prototype=new ya,jr.STREAM_TYPES={h264:27,adts:15},qs=function(){var u=this,d=!1,m={data:[],size:0},f={data:[],size:0},T={data:[],size:0},A,I=function(P,M){var j;const H=P[0]<<16|P[1]<<8|P[2];M.data=new Uint8Array,H===1&&(M.packetLength=6+(P[4]<<8|P[5]),M.dataAlignmentIndicator=(P[6]&4)!==0,j=P[7],j&192&&(M.pts=(P[9]&14)<<27|(P[10]&255)<<20|(P[11]&254)<<12|(P[12]&255)<<5|(P[13]&254)>>>3,M.pts*=4,M.pts+=(P[13]&6)>>>1,M.dts=M.pts,j&64&&(M.dts=(P[14]&14)<<27|(P[15]&255)<<20|(P[16]&254)<<12|(P[17]&255)<<5|(P[18]&254)>>>3,M.dts*=4,M.dts+=(P[18]&6)>>>1)),M.data=P.subarray(9+P[8]))},k=function(P,M,j){var H=new Uint8Array(P.size),ee={type:M},X=0,ne=0,de=!1,$e;if(!(!P.data.length||P.size<9)){for(ee.trackId=P.data[0].pid,X=0;X<P.data.length;X++)$e=P.data[X],H.set($e.data,ne),ne+=$e.data.byteLength;I(H,ee),de=M==="video"||ee.packetLength<=P.size,(j||de)&&(P.size=0,P.data.length=0),de&&u.trigger("data",ee)}};qs.prototype.init.call(this),this.push=function(P){({pat:function(){},pes:function(){var M,j;switch(P.streamType){case Ot.H264_STREAM_TYPE:M=m,j="video";break;case Ot.ADTS_STREAM_TYPE:M=f,j="audio";break;case Ot.METADATA_STREAM_TYPE:M=T,j="timed-metadata";break;default:return}P.payloadUnitStartIndicator&&k(M,j,!0),M.data.push(P),M.size+=P.data.byteLength},pmt:function(){var M={type:"metadata",tracks:[]};A=P.programMapTable,A.video!==null&&M.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+A.video,codec:"avc",type:"video"}),A.audio!==null&&M.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+A.audio,codec:"adts",type:"audio"}),d=!0,u.trigger("data",M)}})[P.type]()},this.reset=function(){m.size=0,m.data.length=0,f.size=0,f.data.length=0,this.trigger("reset")},this.flushStreams_=function(){k(m,"video"),k(f,"audio"),k(T,"timed-metadata")},this.flush=function(){if(!d&&A){var P={type:"metadata",tracks:[]};A.video!==null&&P.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+A.video,codec:"avc",type:"video"}),A.audio!==null&&P.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+A.audio,codec:"adts",type:"audio"}),u.trigger("data",P)}d=!1,this.flushStreams_(),this.trigger("done")}},qs.prototype=new ya;var Gu={PAT_PID:0,MP2T_PACKET_LENGTH:Gi,TransportPacketStream:Gs,TransportParseStream:jr,ElementaryStream:qs,TimestampRolloverStream:$p,CaptionStream:Ta.CaptionStream,Cea608Stream:Ta.Cea608Stream,Cea708Stream:Ta.Cea708Stream,MetadataStream:Vp};for(var ba in Ot)Ot.hasOwnProperty(ba)&&(Gu[ba]=Ot[ba]);var Hp=Gu,Gp=t,qp=Y.ONE_SECOND_IN_TS,Ws,qu=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];Ws=function(u){var d,m=0;Ws.prototype.init.call(this),this.skipWarn_=function(f,T){this.trigger("log",{level:"warn",message:`adts skiping bytes ${f} to ${T} in frame ${m} outside syncword`})},this.push=function(f){var T=0,A,I,k,P,M;if(u||(m=0),f.type==="audio"){d&&d.length?(k=d,d=new Uint8Array(k.byteLength+f.data.byteLength),d.set(k),d.set(f.data,k.byteLength)):d=f.data;for(var j;T+7<d.length;){if(d[T]!==255||(d[T+1]&246)!==240){typeof j!="number"&&(j=T),T++;continue}if(typeof j=="number"&&(this.skipWarn_(j,T),j=null),I=(~d[T+1]&1)*2,A=(d[T+3]&3)<<11|d[T+4]<<3|(d[T+5]&224)>>5,P=((d[T+6]&3)+1)*1024,M=P*qp/qu[(d[T+2]&60)>>>2],d.byteLength-T<A)break;this.trigger("data",{pts:f.pts+m*M,dts:f.dts+m*M,sampleCount:P,audioobjecttype:(d[T+2]>>>6&3)+1,channelcount:(d[T+2]&1)<<2|(d[T+3]&192)>>>6,samplerate:qu[(d[T+2]&60)>>>2],samplingfrequencyindex:(d[T+2]&60)>>>2,samplesize:16,data:d.subarray(T+7+I,T+A)}),m++,T+=A}typeof j=="number"&&(this.skipWarn_(j,T),j=null),d=d.subarray(T)}},this.flush=function(){m=0,this.trigger("done")},this.reset=function(){d=void 0,this.trigger("reset")},this.endTimeline=function(){d=void 0,this.trigger("endedtimeline")}},Ws.prototype=new Gp;var Wp=Ws,Wu;Wu=function(u){var d=u.byteLength,m=0,f=0;this.length=function(){return 8*d},this.bitsAvailable=function(){return 8*d+f},this.loadWord=function(){var T=u.byteLength-d,A=new Uint8Array(4),I=Math.min(4,d);if(I===0)throw new Error("no bytes available");A.set(u.subarray(T,T+I)),m=new DataView(A.buffer).getUint32(0),f=I*8,d-=I},this.skipBits=function(T){var A;f>T?(m<<=T,f-=T):(T-=f,A=Math.floor(T/8),T-=A*8,d-=A,this.loadWord(),m<<=T,f-=T)},this.readBits=function(T){var A=Math.min(f,T),I=m>>>32-A;return f-=A,f>0?m<<=A:d>0&&this.loadWord(),A=T-A,A>0?I<<A|this.readBits(A):I},this.skipLeadingZeros=function(){var T;for(T=0;T<f;++T)if((m&2147483648>>>T)!==0)return m<<=T,f-=T,T;return this.loadWord(),T+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var T=this.skipLeadingZeros();return this.readBits(T+1)-1},this.readExpGolomb=function(){var T=this.readUnsignedExpGolomb();return 1&T?1+T>>>1:-1*(T>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var zp=Wu,zu=t,Kp=zp,zs,Vr,Ku;Vr=function(){var u=0,d,m;Vr.prototype.init.call(this),this.push=function(f){var T;m?(T=new Uint8Array(m.byteLength+f.data.byteLength),T.set(m),T.set(f.data,m.byteLength),m=T):m=f.data;for(var A=m.byteLength;u<A-3;u++)if(m[u+2]===1){d=u+5;break}for(;d<A;)switch(m[d]){case 0:if(m[d-1]!==0){d+=2;break}else if(m[d-2]!==0){d++;break}u+3!==d-2&&this.trigger("data",m.subarray(u+3,d-2));do d++;while(m[d]!==1&&d<A);u=d-2,d+=3;break;case 1:if(m[d-1]!==0||m[d-2]!==0){d+=3;break}this.trigger("data",m.subarray(u+3,d-2)),u=d-2,d+=3;break;default:d+=3;break}m=m.subarray(u),d-=u,u=0},this.reset=function(){m=null,u=0,this.trigger("reset")},this.flush=function(){m&&m.byteLength>3&&this.trigger("data",m.subarray(u+3)),m=null,u=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Vr.prototype=new zu,Ku={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},zs=function(){var u=new Vr,d,m,f,T,A,I,k;zs.prototype.init.call(this),d=this,this.push=function(P){P.type==="video"&&(m=P.trackId,f=P.pts,T=P.dts,u.push(P))},u.on("data",function(P){var M={trackId:m,pts:f,dts:T,data:P,nalUnitTypeCode:P[0]&31};switch(M.nalUnitTypeCode){case 5:M.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:M.nalUnitType="sei_rbsp",M.escapedRBSP=A(P.subarray(1));break;case 7:M.nalUnitType="seq_parameter_set_rbsp",M.escapedRBSP=A(P.subarray(1)),M.config=I(M.escapedRBSP);break;case 8:M.nalUnitType="pic_parameter_set_rbsp";break;case 9:M.nalUnitType="access_unit_delimiter_rbsp";break}d.trigger("data",M)}),u.on("done",function(){d.trigger("done")}),u.on("partialdone",function(){d.trigger("partialdone")}),u.on("reset",function(){d.trigger("reset")}),u.on("endedtimeline",function(){d.trigger("endedtimeline")}),this.flush=function(){u.flush()},this.partialFlush=function(){u.partialFlush()},this.reset=function(){u.reset()},this.endTimeline=function(){u.endTimeline()},k=function(P,M){var j=8,H=8,ee,X;for(ee=0;ee<P;ee++)H!==0&&(X=M.readExpGolomb(),H=(j+X+256)%256),j=H===0?j:H},A=function(P){for(var M=P.byteLength,j=[],H=1,ee,X;H<M-2;)P[H]===0&&P[H+1]===0&&P[H+2]===3?(j.push(H+2),H+=2):H++;if(j.length===0)return P;ee=M-j.length,X=new Uint8Array(ee);var ne=0;for(H=0;H<ee;ne++,H++)ne===j[0]&&(ne++,j.shift()),X[H]=P[ne];return X},I=function(P){var M=0,j=0,H=0,ee=0,X,ne,de,$e,St,wi,bl,El,Sl,Pa,Cl,Ne=[1,1],Al,Li;if(X=new Kp(P),ne=X.readUnsignedByte(),$e=X.readUnsignedByte(),de=X.readUnsignedByte(),X.skipUnsignedExpGolomb(),Ku[ne]&&(St=X.readUnsignedExpGolomb(),St===3&&X.skipBits(1),X.skipUnsignedExpGolomb(),X.skipUnsignedExpGolomb(),X.skipBits(1),X.readBoolean()))for(Cl=St!==3?8:12,Li=0;Li<Cl;Li++)X.readBoolean()&&(Li<6?k(16,X):k(64,X));if(X.skipUnsignedExpGolomb(),wi=X.readUnsignedExpGolomb(),wi===0)X.readUnsignedExpGolomb();else if(wi===1)for(X.skipBits(1),X.skipExpGolomb(),X.skipExpGolomb(),bl=X.readUnsignedExpGolomb(),Li=0;Li<bl;Li++)X.skipExpGolomb();if(X.skipUnsignedExpGolomb(),X.skipBits(1),El=X.readUnsignedExpGolomb(),Sl=X.readUnsignedExpGolomb(),Pa=X.readBits(1),Pa===0&&X.skipBits(1),X.skipBits(1),X.readBoolean()&&(M=X.readUnsignedExpGolomb(),j=X.readUnsignedExpGolomb(),H=X.readUnsignedExpGolomb(),ee=X.readUnsignedExpGolomb()),X.readBoolean()&&X.readBoolean()){switch(Al=X.readUnsignedByte(),Al){case 1:Ne=[1,1];break;case 2:Ne=[12,11];break;case 3:Ne=[10,11];break;case 4:Ne=[16,11];break;case 5:Ne=[40,33];break;case 6:Ne=[24,11];break;case 7:Ne=[20,11];break;case 8:Ne=[32,11];break;case 9:Ne=[80,33];break;case 10:Ne=[18,11];break;case 11:Ne=[15,11];break;case 12:Ne=[64,33];break;case 13:Ne=[160,99];break;case 14:Ne=[4,3];break;case 15:Ne=[3,2];break;case 16:Ne=[2,1];break;case 255:{Ne=[X.readUnsignedByte()<<8|X.readUnsignedByte(),X.readUnsignedByte()<<8|X.readUnsignedByte()];break}}Ne&&Ne[0]/Ne[1]}return{profileIdc:ne,levelIdc:de,profileCompatibility:$e,width:(El+1)*16-M*2-j*2,height:(2-Pa)*(Sl+1)*16-H*2-ee*2,sarRatio:Ne}}},zs.prototype=new zu;var Xp={H264Stream:zs,NalByteStream:Vr},Yp=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Xu=function(u,d){var m=u[d+6]<<21|u[d+7]<<14|u[d+8]<<7|u[d+9],f=u[d+5],T=(f&16)>>4;return m=m>=0?m:0,T?m+20:m+10},Yu=function(u,d){return u.length-d<10||u[d]!=="I".charCodeAt(0)||u[d+1]!=="D".charCodeAt(0)||u[d+2]!=="3".charCodeAt(0)?d:(d+=Xu(u,d),Yu(u,d))},Qp=function(u){var d=Yu(u,0);return u.length>=d+2&&(u[d]&255)===255&&(u[d+1]&240)===240&&(u[d+1]&22)===16},Qu=function(u){return u[0]<<21|u[1]<<14|u[2]<<7|u[3]},Jp=function(u,d,m){var f,T="";for(f=d;f<m;f++)T+="%"+("00"+u[f].toString(16)).slice(-2);return T},Zp=function(u,d,m){return unescape(Jp(u,d,m))},e0=function(u,d){var m=(u[d+5]&224)>>5,f=u[d+4]<<3,T=u[d+3]&3<<11;return T|f|m},t0=function(u,d){return u[d]==="I".charCodeAt(0)&&u[d+1]==="D".charCodeAt(0)&&u[d+2]==="3".charCodeAt(0)?"timed-metadata":u[d]&!0&&(u[d+1]&240)===240?"audio":null},i0=function(u){for(var d=0;d+5<u.length;){if(u[d]!==255||(u[d+1]&246)!==240){d++;continue}return Yp[(u[d+2]&60)>>>2]}return null},r0=function(u){var d,m,f,T;d=10,u[5]&64&&(d+=4,d+=Qu(u.subarray(10,14)));do{if(m=Qu(u.subarray(d+4,d+8)),m<1)return null;if(T=String.fromCharCode(u[d],u[d+1],u[d+2],u[d+3]),T==="PRIV"){f=u.subarray(d+10,d+m+10);for(var A=0;A<f.byteLength;A++)if(f[A]===0){var I=Zp(f,0,A);if(I==="com.apple.streaming.transportStreamTimestamp"){var k=f.subarray(A+1),P=(k[3]&1)<<30|k[4]<<22|k[5]<<14|k[6]<<6|k[7]>>>2;return P*=4,P+=k[7]&3,P}break}}d+=10,d+=m}while(d<u.byteLength);return null},Ea={isLikelyAacData:Qp,parseId3TagSize:Xu,parseAdtsSize:e0,parseType:t0,parseSampleRate:i0,parseAacTimestamp:r0},s0=t,Ju=Ea,Ks;Ks=function(){var u=new Uint8Array,d=0;Ks.prototype.init.call(this),this.setTimestamp=function(m){d=m},this.push=function(m){var f=0,T=0,A,I,k,P;for(u.length?(P=u.length,u=new Uint8Array(m.byteLength+P),u.set(u.subarray(0,P)),u.set(m,P)):u=m;u.length-T>=3;){if(u[T]==="I".charCodeAt(0)&&u[T+1]==="D".charCodeAt(0)&&u[T+2]==="3".charCodeAt(0)){if(u.length-T<10||(f=Ju.parseId3TagSize(u,T),T+f>u.length))break;I={type:"timed-metadata",data:u.subarray(T,T+f)},this.trigger("data",I),T+=f;continue}else if((u[T]&255)===255&&(u[T+1]&240)===240){if(u.length-T<7||(f=Ju.parseAdtsSize(u,T),T+f>u.length))break;k={type:"audio",data:u.subarray(T,T+f),pts:d,dts:d},this.trigger("data",k),T+=f;continue}T++}A=u.length-T,A>0?u=u.subarray(T):u=new Uint8Array},this.reset=function(){u=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){u=new Uint8Array,this.trigger("endedtimeline")}},Ks.prototype=new s0;var n0=Ks,a0=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],o0=a0,u0=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],l0=u0,Xs=t,$r=De,Hr=kt,Ys=Mr,Pt=Ep,ii=Hp,Qs=Y,Zu=Wp,d0=Xp.H264Stream,c0=n0,h0=Ea.isLikelyAacData,f0=Y.ONE_SECOND_IN_TS,Sa=o0,Ca=l0,Gr,qi,Js,Ai,p0=function(u,d){d.stream=u,this.trigger("log",d)},el=function(u,d){for(var m=Object.keys(d),f=0;f<m.length;f++){var T=m[f];T==="headOfPipeline"||!d[T].on||d[T].on("log",p0.bind(u,T))}},tl=function(u,d){var m;if(u.length!==d.length)return!1;for(m=0;m<u.length;m++)if(u[m]!==d[m])return!1;return!0},Aa=function(u,d,m,f,T,A){var I=m-d,k=f-d,P=T-m;return{start:{dts:u,pts:u+I},end:{dts:u+k,pts:u+P},prependedContentDuration:A,baseMediaDecodeTime:u}};qi=function(u,d){var m=[],f,T=0,A=0,I=1/0;d=d||{},f=d.firstSequenceNumber||0,qi.prototype.init.call(this),this.push=function(k){Pt.collectDtsInfo(u,k),u&&Sa.forEach(function(P){u[P]=k[P]}),m.push(k)},this.setEarliestDts=function(k){T=k},this.setVideoBaseMediaDecodeTime=function(k){I=k},this.setAudioAppendStart=function(k){A=k},this.flush=function(){var k,P,M,j,H,ee,X;if(m.length===0){this.trigger("done","AudioSegmentStream");return}k=Ys.trimAdtsFramesByEarliestDts(m,u,T),u.baseMediaDecodeTime=Pt.calculateTrackBaseMediaDecodeTime(u,d.keepOriginalTimestamps),X=Ys.prefixWithSilence(u,k,A,I),u.samples=Ys.generateSampleTable(k),M=$r.mdat(Ys.concatenateFrameData(k)),m=[],P=$r.moof(f,[u]),j=new Uint8Array(P.byteLength+M.byteLength),f++,j.set(P),j.set(M,P.byteLength),Pt.clearDtsInfo(u),H=Math.ceil(f0*1024/u.samplerate),k.length&&(ee=k.length*H,this.trigger("segmentTimingInfo",Aa(Qs.audioTsToVideoTs(u.baseMediaDecodeTime,u.samplerate),k[0].dts,k[0].pts,k[0].dts+ee,k[0].pts+ee,X||0)),this.trigger("timingInfo",{start:k[0].pts,end:k[0].pts+ee})),this.trigger("data",{track:u,boxes:j}),this.trigger("done","AudioSegmentStream")},this.reset=function(){Pt.clearDtsInfo(u),m=[],this.trigger("reset")}},qi.prototype=new Xs,Gr=function(u,d){var m,f=[],T=[],A,I;d=d||{},m=d.firstSequenceNumber||0,Gr.prototype.init.call(this),delete u.minPTS,this.gopCache_=[],this.push=function(k){Pt.collectDtsInfo(u,k),k.nalUnitType==="seq_parameter_set_rbsp"&&!A&&(A=k.config,u.sps=[k.data],Ca.forEach(function(P){u[P]=A[P]},this)),k.nalUnitType==="pic_parameter_set_rbsp"&&!I&&(I=k.data,u.pps=[k.data]),f.push(k)},this.flush=function(){for(var k,P,M,j,H,ee,X=0,ne,de;f.length&&f[0].nalUnitType!=="access_unit_delimiter_rbsp";)f.shift();if(f.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(k=Hr.groupNalsIntoFrames(f),M=Hr.groupFramesIntoGops(k),M[0][0].keyFrame||(P=this.getGopForFusion_(f[0],u),P?(X=P.duration,M.unshift(P),M.byteLength+=P.byteLength,M.nalCount+=P.nalCount,M.pts=P.pts,M.dts=P.dts,M.duration+=P.duration):M=Hr.extendFirstKeyFrame(M)),T.length){var $e;if(d.alignGopsAtEnd?$e=this.alignGopsAtEnd_(M):$e=this.alignGopsAtStart_(M),!$e){this.gopCache_.unshift({gop:M.pop(),pps:u.pps,sps:u.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),f=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}Pt.clearDtsInfo(u),M=$e}Pt.collectDtsInfo(u,M),u.samples=Hr.generateSampleTable(M),H=$r.mdat(Hr.concatenateNalData(M)),u.baseMediaDecodeTime=Pt.calculateTrackBaseMediaDecodeTime(u,d.keepOriginalTimestamps),this.trigger("processedGopsInfo",M.map(function(St){return{pts:St.pts,dts:St.dts,byteLength:St.byteLength}})),ne=M[0],de=M[M.length-1],this.trigger("segmentTimingInfo",Aa(u.baseMediaDecodeTime,ne.dts,ne.pts,de.dts+de.duration,de.pts+de.duration,X)),this.trigger("timingInfo",{start:M[0].pts,end:M[M.length-1].pts+M[M.length-1].duration}),this.gopCache_.unshift({gop:M.pop(),pps:u.pps,sps:u.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),f=[],this.trigger("baseMediaDecodeTime",u.baseMediaDecodeTime),this.trigger("timelineStartInfo",u.timelineStartInfo),j=$r.moof(m,[u]),ee=new Uint8Array(j.byteLength+H.byteLength),m++,ee.set(j),ee.set(H,j.byteLength),this.trigger("data",{track:u,boxes:ee}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),f=[],this.gopCache_.length=0,T.length=0,this.trigger("reset")},this.resetStream_=function(){Pt.clearDtsInfo(u),A=void 0,I=void 0},this.getGopForFusion_=function(k){var P=45e3,M=1e4,j=1/0,H,ee,X,ne,de;for(de=0;de<this.gopCache_.length;de++)ne=this.gopCache_[de],X=ne.gop,!(!(u.pps&&tl(u.pps[0],ne.pps[0]))||!(u.sps&&tl(u.sps[0],ne.sps[0])))&&(X.dts<u.timelineStartInfo.dts||(H=k.dts-X.dts-X.duration,H>=-M&&H<=P&&(!ee||j>H)&&(ee=ne,j=H)));return ee?ee.gop:null},this.alignGopsAtStart_=function(k){var P,M,j,H,ee,X,ne,de;for(ee=k.byteLength,X=k.nalCount,ne=k.duration,P=M=0;P<T.length&&M<k.length&&(j=T[P],H=k[M],j.pts!==H.pts);){if(H.pts>j.pts){P++;continue}M++,ee-=H.byteLength,X-=H.nalCount,ne-=H.duration}return M===0?k:M===k.length?null:(de=k.slice(M),de.byteLength=ee,de.duration=ne,de.nalCount=X,de.pts=de[0].pts,de.dts=de[0].dts,de)},this.alignGopsAtEnd_=function(k){var P,M,j,H,ee,X;for(P=T.length-1,M=k.length-1,ee=null,X=!1;P>=0&&M>=0;){if(j=T[P],H=k[M],j.pts===H.pts){X=!0;break}if(j.pts>H.pts){P--;continue}P===T.length-1&&(ee=M),M--}if(!X&&ee===null)return null;var ne;if(X?ne=M:ne=ee,ne===0)return k;var de=k.slice(ne),$e=de.reduce(function(St,wi){return St.byteLength+=wi.byteLength,St.duration+=wi.duration,St.nalCount+=wi.nalCount,St},{byteLength:0,duration:0,nalCount:0});return de.byteLength=$e.byteLength,de.duration=$e.duration,de.nalCount=$e.nalCount,de.pts=de[0].pts,de.dts=de[0].dts,de},this.alignGopsWith=function(k){T=k}},Gr.prototype=new Xs,Ai=function(u,d){this.numberOfTracks=0,this.metadataStream=d,u=u||{},typeof u.remux!="undefined"?this.remuxTracks=!!u.remux:this.remuxTracks=!0,typeof u.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=u.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,Ai.prototype.init.call(this),this.push=function(m){if(m.content||m.text)return this.pendingCaptions.push(m);if(m.frames)return this.pendingMetadata.push(m);this.pendingTracks.push(m.track),this.pendingBytes+=m.boxes.byteLength,m.track.type==="video"&&(this.videoTrack=m.track,this.pendingBoxes.push(m.boxes)),m.track.type==="audio"&&(this.audioTrack=m.track,this.pendingBoxes.unshift(m.boxes))}},Ai.prototype=new Xs,Ai.prototype.flush=function(u){var d=0,m={captions:[],captionStreams:{},metadata:[],info:{}},f,T,A,I=0,k;if(this.pendingTracks.length<this.numberOfTracks){if(u!=="VideoSegmentStream"&&u!=="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?(I=this.videoTrack.timelineStartInfo.pts,Ca.forEach(function(P){m.info[P]=this.videoTrack[P]},this)):this.audioTrack&&(I=this.audioTrack.timelineStartInfo.pts,Sa.forEach(function(P){m.info[P]=this.audioTrack[P]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?m.type=this.pendingTracks[0].type:m.type="combined",this.emittedTracks+=this.pendingTracks.length,A=$r.initSegment(this.pendingTracks),m.initSegment=new Uint8Array(A.byteLength),m.initSegment.set(A),m.data=new Uint8Array(this.pendingBytes),k=0;k<this.pendingBoxes.length;k++)m.data.set(this.pendingBoxes[k],d),d+=this.pendingBoxes[k].byteLength;for(k=0;k<this.pendingCaptions.length;k++)f=this.pendingCaptions[k],f.startTime=Qs.metadataTsToSeconds(f.startPts,I,this.keepOriginalTimestamps),f.endTime=Qs.metadataTsToSeconds(f.endPts,I,this.keepOriginalTimestamps),m.captionStreams[f.stream]=!0,m.captions.push(f);for(k=0;k<this.pendingMetadata.length;k++)T=this.pendingMetadata[k],T.cueTime=Qs.metadataTsToSeconds(T.pts,I,this.keepOriginalTimestamps),m.metadata.push(T);for(m.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",m),k=0;k<m.captions.length;k++)f=m.captions[k],this.trigger("caption",f);for(k=0;k<m.metadata.length;k++)T=m.metadata[k],this.trigger("id3Frame",T)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},Ai.prototype.setRemux=function(u){this.remuxTracks=u},Js=function(u){var d=this,m=!0,f,T;Js.prototype.init.call(this),u=u||{},this.baseMediaDecodeTime=u.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var A={};this.transmuxPipeline_=A,A.type="aac",A.metadataStream=new ii.MetadataStream,A.aacStream=new c0,A.audioTimestampRolloverStream=new ii.TimestampRolloverStream("audio"),A.timedMetadataTimestampRolloverStream=new ii.TimestampRolloverStream("timed-metadata"),A.adtsStream=new Zu,A.coalesceStream=new Ai(u,A.metadataStream),A.headOfPipeline=A.aacStream,A.aacStream.pipe(A.audioTimestampRolloverStream).pipe(A.adtsStream),A.aacStream.pipe(A.timedMetadataTimestampRolloverStream).pipe(A.metadataStream).pipe(A.coalesceStream),A.metadataStream.on("timestamp",function(I){A.aacStream.setTimestamp(I.timeStamp)}),A.aacStream.on("data",function(I){I.type!=="timed-metadata"&&I.type!=="audio"||A.audioSegmentStream||(T=T||{timelineStartInfo:{baseMediaDecodeTime:d.baseMediaDecodeTime},codec:"adts",type:"audio"},A.coalesceStream.numberOfTracks++,A.audioSegmentStream=new qi(T,u),A.audioSegmentStream.on("log",d.getLogTrigger_("audioSegmentStream")),A.audioSegmentStream.on("timingInfo",d.trigger.bind(d,"audioTimingInfo")),A.adtsStream.pipe(A.audioSegmentStream).pipe(A.coalesceStream),d.trigger("trackinfo",{hasAudio:!!T,hasVideo:!!f}))}),A.coalesceStream.on("data",this.trigger.bind(this,"data")),A.coalesceStream.on("done",this.trigger.bind(this,"done")),el(this,A)},this.setupTsPipeline=function(){var A={};this.transmuxPipeline_=A,A.type="ts",A.metadataStream=new ii.MetadataStream,A.packetStream=new ii.TransportPacketStream,A.parseStream=new ii.TransportParseStream,A.elementaryStream=new ii.ElementaryStream,A.timestampRolloverStream=new ii.TimestampRolloverStream,A.adtsStream=new Zu,A.h264Stream=new d0,A.captionStream=new ii.CaptionStream(u),A.coalesceStream=new Ai(u,A.metadataStream),A.headOfPipeline=A.packetStream,A.packetStream.pipe(A.parseStream).pipe(A.elementaryStream).pipe(A.timestampRolloverStream),A.timestampRolloverStream.pipe(A.h264Stream),A.timestampRolloverStream.pipe(A.adtsStream),A.timestampRolloverStream.pipe(A.metadataStream).pipe(A.coalesceStream),A.h264Stream.pipe(A.captionStream).pipe(A.coalesceStream),A.elementaryStream.on("data",function(I){var k;if(I.type==="metadata"){for(k=I.tracks.length;k--;)!f&&I.tracks[k].type==="video"?(f=I.tracks[k],f.timelineStartInfo.baseMediaDecodeTime=d.baseMediaDecodeTime):!T&&I.tracks[k].type==="audio"&&(T=I.tracks[k],T.timelineStartInfo.baseMediaDecodeTime=d.baseMediaDecodeTime);f&&!A.videoSegmentStream&&(A.coalesceStream.numberOfTracks++,A.videoSegmentStream=new Gr(f,u),A.videoSegmentStream.on("log",d.getLogTrigger_("videoSegmentStream")),A.videoSegmentStream.on("timelineStartInfo",function(P){T&&!u.keepOriginalTimestamps&&(T.timelineStartInfo=P,A.audioSegmentStream.setEarliestDts(P.dts-d.baseMediaDecodeTime))}),A.videoSegmentStream.on("processedGopsInfo",d.trigger.bind(d,"gopInfo")),A.videoSegmentStream.on("segmentTimingInfo",d.trigger.bind(d,"videoSegmentTimingInfo")),A.videoSegmentStream.on("baseMediaDecodeTime",function(P){T&&A.audioSegmentStream.setVideoBaseMediaDecodeTime(P)}),A.videoSegmentStream.on("timingInfo",d.trigger.bind(d,"videoTimingInfo")),A.h264Stream.pipe(A.videoSegmentStream).pipe(A.coalesceStream)),T&&!A.audioSegmentStream&&(A.coalesceStream.numberOfTracks++,A.audioSegmentStream=new qi(T,u),A.audioSegmentStream.on("log",d.getLogTrigger_("audioSegmentStream")),A.audioSegmentStream.on("timingInfo",d.trigger.bind(d,"audioTimingInfo")),A.audioSegmentStream.on("segmentTimingInfo",d.trigger.bind(d,"audioSegmentTimingInfo")),A.adtsStream.pipe(A.audioSegmentStream).pipe(A.coalesceStream)),d.trigger("trackinfo",{hasAudio:!!T,hasVideo:!!f})}}),A.coalesceStream.on("data",this.trigger.bind(this,"data")),A.coalesceStream.on("id3Frame",function(I){I.dispatchType=A.metadataStream.dispatchType,d.trigger("id3Frame",I)}),A.coalesceStream.on("caption",this.trigger.bind(this,"caption")),A.coalesceStream.on("done",this.trigger.bind(this,"done")),el(this,A)},this.setBaseMediaDecodeTime=function(A){var I=this.transmuxPipeline_;u.keepOriginalTimestamps||(this.baseMediaDecodeTime=A),T&&(T.timelineStartInfo.dts=void 0,T.timelineStartInfo.pts=void 0,Pt.clearDtsInfo(T),I.audioTimestampRolloverStream&&I.audioTimestampRolloverStream.discontinuity()),f&&(I.videoSegmentStream&&(I.videoSegmentStream.gopCache_=[]),f.timelineStartInfo.dts=void 0,f.timelineStartInfo.pts=void 0,Pt.clearDtsInfo(f),I.captionStream.reset()),I.timestampRolloverStream&&I.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(A){T&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(A)},this.setRemux=function(A){var I=this.transmuxPipeline_;u.remux=A,I&&I.coalesceStream&&I.coalesceStream.setRemux(A)},this.alignGopsWith=function(A){f&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(A)},this.getLogTrigger_=function(A){var I=this;return function(k){k.stream=A,I.trigger("log",k)}},this.push=function(A){if(m){var I=h0(A);I&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!I&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),m=!1}this.transmuxPipeline_.headOfPipeline.push(A)},this.flush=function(){m=!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()}},Js.prototype=new Xs;var m0={Transmuxer:Js,VideoSegmentStream:Gr,AudioSegmentStream:qi,AUDIO_PROPERTIES:Sa,VIDEO_PROPERTIES:Ca,generateSegmentTimingInfo:Aa},g0=function(u){return u>>>0},_0=function(u){return("00"+u.toString(16)).slice(-2)},Zs={toUnsigned:g0,toHexString:_0},v0=function(u){var d="";return d+=String.fromCharCode(u[0]),d+=String.fromCharCode(u[1]),d+=String.fromCharCode(u[2]),d+=String.fromCharCode(u[3]),d},il=v0,y0=Zs.toUnsigned,T0=il,rl=function(u,d){var m=[],f,T,A,I,k;if(!d.length)return null;for(f=0;f<u.byteLength;)T=y0(u[f]<<24|u[f+1]<<16|u[f+2]<<8|u[f+3]),A=T0(u.subarray(f+4,f+8)),I=T>1?f+T:u.byteLength,A===d[0]&&(d.length===1?m.push(u.subarray(f+8,I)):(k=rl(u.subarray(f+8,I),d.slice(1)),k.length&&(m=m.concat(k)))),f=I;return m},sl=rl,x0=Zs.toUnsigned,b0=n.getUint64,E0=function(u){var d={version:u[0],flags:new Uint8Array(u.subarray(1,4))};return d.version===1?d.baseMediaDecodeTime=b0(u.subarray(4)):d.baseMediaDecodeTime=x0(u[4]<<24|u[5]<<16|u[6]<<8|u[7]),d},nl=E0,S0=function(u){return{isLeading:(u[0]&12)>>>2,dependsOn:u[0]&3,isDependedOn:(u[1]&192)>>>6,hasRedundancy:(u[1]&48)>>>4,paddingValue:(u[1]&14)>>>1,isNonSyncSample:u[1]&1,degradationPriority:u[2]<<8|u[3]}},C0=S0,al=C0,A0=function(u){var d={version:u[0],flags:new Uint8Array(u.subarray(1,4)),samples:[]},m=new DataView(u.buffer,u.byteOffset,u.byteLength),f=d.flags[2]&1,T=d.flags[2]&4,A=d.flags[1]&1,I=d.flags[1]&2,k=d.flags[1]&4,P=d.flags[1]&8,M=m.getUint32(4),j=8,H;for(f&&(d.dataOffset=m.getInt32(j),j+=4),T&&M&&(H={flags:al(u.subarray(j,j+4))},j+=4,A&&(H.duration=m.getUint32(j),j+=4),I&&(H.size=m.getUint32(j),j+=4),P&&(d.version===1?H.compositionTimeOffset=m.getInt32(j):H.compositionTimeOffset=m.getUint32(j),j+=4),d.samples.push(H),M--);M--;)H={},A&&(H.duration=m.getUint32(j),j+=4),I&&(H.size=m.getUint32(j),j+=4),k&&(H.flags=al(u.subarray(j,j+4)),j+=4),P&&(d.version===1?H.compositionTimeOffset=m.getInt32(j):H.compositionTimeOffset=m.getUint32(j),j+=4),d.samples.push(H);return d},ol=A0,D0=function(u){var d=new DataView(u.buffer,u.byteOffset,u.byteLength),m={version:u[0],flags:new Uint8Array(u.subarray(1,4)),trackId:d.getUint32(4)},f=m.flags[2]&1,T=m.flags[2]&2,A=m.flags[2]&8,I=m.flags[2]&16,k=m.flags[2]&32,P=m.flags[0]&65536,M=m.flags[0]&131072,j;return j=8,f&&(j+=4,m.baseDataOffset=d.getUint32(12),j+=4),T&&(m.sampleDescriptionIndex=d.getUint32(j),j+=4),A&&(m.defaultSampleDuration=d.getUint32(j),j+=4),I&&(m.defaultSampleSize=d.getUint32(j),j+=4),k&&(m.defaultSampleFlags=d.getUint32(j)),P&&(m.durationIsEmpty=!0),!f&&M&&(m.baseDataOffsetIsMoof=!0),m},ul=D0,qr;typeof window!="undefined"?qr=window:typeof i!="undefined"?qr=i:typeof self!="undefined"?qr=self:qr={};var ll=qr,w0=Fu.discardEmulationPreventionBytes,L0=Uu.CaptionStream,Wr=sl,I0=nl,k0=ol,O0=ul,dl=ll,P0=function(u,d){for(var m=u,f=0;f<d.length;f++){var T=d[f];if(m<T.size)return T;m-=T.size}return null},R0=function(u,d,m){var f=new DataView(u.buffer,u.byteOffset,u.byteLength),T={logs:[],seiNals:[]},A,I,k,P;for(I=0;I+4<u.length;I+=k)if(k=f.getUint32(I),I+=4,!(k<=0))switch(u[I]&31){case 6:var M=u.subarray(I+1,I+1+k),j=P0(I,d);if(A={nalUnitType:"sei_rbsp",size:k,data:M,escapedRBSP:w0(M),trackId:m},j)A.pts=j.pts,A.dts=j.dts,P=j;else if(P)A.pts=P.pts,A.dts=P.dts;else{T.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+I+" for trackId "+m+". See mux.js#223."});break}T.seiNals.push(A);break}return T},M0=function(u,d,m){var f=d,T=m.defaultSampleDuration||0,A=m.defaultSampleSize||0,I=m.trackId,k=[];return u.forEach(function(P){var M=k0(P),j=M.samples;j.forEach(function(H){H.duration===void 0&&(H.duration=T),H.size===void 0&&(H.size=A),H.trackId=I,H.dts=f,H.compositionTimeOffset===void 0&&(H.compositionTimeOffset=0),typeof f=="bigint"?(H.pts=f+dl.BigInt(H.compositionTimeOffset),f+=dl.BigInt(H.duration)):(H.pts=f+H.compositionTimeOffset,f+=H.duration)}),k=k.concat(j)}),k},B0=function(u,d){var m=Wr(u,["moof","traf"]),f=Wr(u,["mdat"]),T={},A=[];return f.forEach(function(I,k){var P=m[k];A.push({mdat:I,traf:P})}),A.forEach(function(I){var k=I.mdat,P=I.traf,M=Wr(P,["tfhd"]),j=O0(M[0]),H=j.trackId,ee=Wr(P,["tfdt"]),X=ee.length>0?I0(ee[0]).baseMediaDecodeTime:0,ne=Wr(P,["trun"]),de,$e;d===H&&ne.length>0&&(de=M0(ne,X,j),$e=R0(k,de,H),T[H]||(T[H]={seiNals:[],logs:[]}),T[H].seiNals=T[H].seiNals.concat($e.seiNals),T[H].logs=T[H].logs.concat($e.logs))}),T},N0=function(u,d,m){var f;if(d===null)return null;f=B0(u,d);var T=f[d]||{};return{seiNals:T.seiNals,logs:T.logs,timescale:m}},F0=function(){var u=!1,d,m,f,T,A,I;this.isInitialized=function(){return u},this.init=function(k){d=new L0,u=!0,I=k?k.isPartial:!1,d.on("data",function(P){P.startTime=P.startPts/T,P.endTime=P.endPts/T,A.captions.push(P),A.captionStreams[P.stream]=!0}),d.on("log",function(P){A.logs.push(P)})},this.isNewInit=function(k,P){return k&&k.length===0||P&&typeof P=="object"&&Object.keys(P).length===0?!1:f!==k[0]||T!==P[f]},this.parse=function(k,P,M){var j;if(this.isInitialized()){if(!P||!M)return null;if(this.isNewInit(P,M))f=P[0],T=M[f];else if(f===null||!T)return m.push(k),null}else return null;for(;m.length>0;){var H=m.shift();this.parse(H,P,M)}return j=N0(k,f,T),j&&j.logs&&(A.logs=A.logs.concat(j.logs)),j===null||!j.seiNals?A.logs.length?{logs:A.logs,captions:[],captionStreams:[]}:null:(this.pushNals(j.seiNals),this.flushStream(),A)},this.pushNals=function(k){if(!this.isInitialized()||!k||k.length===0)return null;k.forEach(function(P){d.push(P)})},this.flushStream=function(){if(!this.isInitialized())return null;I?d.partialFlush():d.flush()},this.clearParsedCaptions=function(){A.captions=[],A.captionStreams={},A.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;d.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){m=[],f=null,T=null,A?this.clearParsedCaptions():A={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},U0=F0,j0=function(u){for(var d=0,m=String.fromCharCode(u[d]),f="";m!=="\0";)f+=m,d++,m=String.fromCharCode(u[d]);return f+=m,f},V0={uint8ToCString:j0},en=V0.uint8ToCString,$0=n.getUint64,H0=function(u){var d=4,m=u[0],f,T,A,I,k,P,M,j;if(m===0){f=en(u.subarray(d)),d+=f.length,T=en(u.subarray(d)),d+=T.length;var H=new DataView(u.buffer);A=H.getUint32(d),d+=4,k=H.getUint32(d),d+=4,P=H.getUint32(d),d+=4,M=H.getUint32(d),d+=4}else if(m===1){var H=new DataView(u.buffer);A=H.getUint32(d),d+=4,I=$0(u.subarray(d)),d+=8,P=H.getUint32(d),d+=4,M=H.getUint32(d),d+=4,f=en(u.subarray(d)),d+=f.length,T=en(u.subarray(d)),d+=T.length}j=new Uint8Array(u.subarray(d,u.byteLength));var ee={scheme_id_uri:f,value:T,timescale:A||1,presentation_time:I,presentation_time_delta:k,event_duration:P,id:M,message_data:j};return q0(m,ee)?ee:void 0},G0=function(u,d,m,f){return u||u===0?u/d:f+m/d},q0=function(u,d){var m=d.scheme_id_uri!=="\0",f=u===0&&cl(d.presentation_time_delta)&&m,T=u===1&&cl(d.presentation_time)&&m;return!(u>1)&&f||T},cl=function(u){return u!==void 0||u!==null},W0={parseEmsgBox:H0,scaleTime:G0},tn=Zs.toUnsigned,zr=Zs.toHexString,Be=sl,Wi=il,Da=W0,z0=ul,K0=ol,X0=nl,Y0=n.getUint64,hl,fl,pl,ml,gl,wa,_l,La=ll,Q0=Hu.parseId3Frames;hl=function(u){var d={},m=Be(u,["moov","trak"]);return m.reduce(function(f,T){var A,I,k,P,M;return A=Be(T,["tkhd"])[0],!A||(I=A[0],k=I===0?12:20,P=tn(A[k]<<24|A[k+1]<<16|A[k+2]<<8|A[k+3]),M=Be(T,["mdia","mdhd"])[0],!M)?null:(I=M[0],k=I===0?12:20,f[P]=tn(M[k]<<24|M[k+1]<<16|M[k+2]<<8|M[k+3]),f)},d)},fl=function(u,d){var m;m=Be(d,["moof","traf"]);var f=m.reduce(function(T,A){var I=Be(A,["tfhd"])[0],k=tn(I[4]<<24|I[5]<<16|I[6]<<8|I[7]),P=u[k]||9e4,M=Be(A,["tfdt"])[0],j=new DataView(M.buffer,M.byteOffset,M.byteLength),H;M[0]===1?H=Y0(M.subarray(4,12)):H=j.getUint32(4);let ee;return typeof H=="bigint"?ee=H/La.BigInt(P):typeof H=="number"&&!isNaN(H)&&(ee=H/P),ee<Number.MAX_SAFE_INTEGER&&(ee=Number(ee)),ee<T&&(T=ee),T},1/0);return typeof f=="bigint"||isFinite(f)?f:0},pl=function(u,d){var m=Be(d,["moof","traf"]),f=0,T=0,A;if(m&&m.length){var I=Be(m[0],["tfhd"])[0],k=Be(m[0],["trun"])[0],P=Be(m[0],["tfdt"])[0];if(I){var M=z0(I);A=M.trackId}if(P){var j=X0(P);f=j.baseMediaDecodeTime}if(k){var H=K0(k);H.samples&&H.samples.length&&(T=H.samples[0].compositionTimeOffset||0)}}var ee=u[A]||9e4;typeof f=="bigint"&&(T=La.BigInt(T),ee=La.BigInt(ee));var X=(f+T)/ee;return typeof X=="bigint"&&X<Number.MAX_SAFE_INTEGER&&(X=Number(X)),X},ml=function(u){var d=Be(u,["moov","trak"]),m=[];return d.forEach(function(f){var T=Be(f,["mdia","hdlr"]),A=Be(f,["tkhd"]);T.forEach(function(I,k){var P=Wi(I.subarray(8,12)),M=A[k],j,H,ee;P==="vide"&&(j=new DataView(M.buffer,M.byteOffset,M.byteLength),H=j.getUint8(0),ee=H===0?j.getUint32(12):j.getUint32(20),m.push(ee))})}),m},wa=function(u){var d=u[0],m=d===0?12:20;return tn(u[m]<<24|u[m+1]<<16|u[m+2]<<8|u[m+3])},gl=function(u){var d=Be(u,["moov","trak"]),m=[];return d.forEach(function(f){var T={},A=Be(f,["tkhd"])[0],I,k;A&&(I=new DataView(A.buffer,A.byteOffset,A.byteLength),k=I.getUint8(0),T.id=k===0?I.getUint32(12):I.getUint32(20));var P=Be(f,["mdia","hdlr"])[0];if(P){var M=Wi(P.subarray(8,12));M==="vide"?T.type="video":M==="soun"?T.type="audio":T.type=M}var j=Be(f,["mdia","minf","stbl","stsd"])[0];if(j){var H=j.subarray(8);T.codec=Wi(H.subarray(4,8));var ee=Be(H,[T.codec])[0],X,ne;ee&&(/^[asm]vc[1-9]$/i.test(T.codec)?(X=ee.subarray(78),ne=Wi(X.subarray(4,8)),ne==="avcC"&&X.length>11?(T.codec+=".",T.codec+=zr(X[9]),T.codec+=zr(X[10]),T.codec+=zr(X[11])):T.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(T.codec)?(X=ee.subarray(28),ne=Wi(X.subarray(4,8)),ne==="esds"&&X.length>20&&X[19]!==0?(T.codec+="."+zr(X[19]),T.codec+="."+zr(X[20]>>>2&63).replace(/^0/,"")):T.codec="mp4a.40.2"):T.codec=T.codec.toLowerCase())}var de=Be(f,["mdia","mdhd"])[0];de&&(T.timescale=wa(de)),m.push(T)}),m},_l=function(u,d=0){var m=Be(u,["emsg"]);return m.map(f=>{var T=Da.parseEmsgBox(new Uint8Array(f)),A=Q0(T.message_data);return{cueTime:Da.scaleTime(T.presentation_time,T.timescale,T.presentation_time_delta,d),duration:Da.scaleTime(T.event_duration,T.timescale),frames:A}})};var Ia={findBox:Be,parseType:Wi,timescale:hl,startTime:fl,compositionStartTime:pl,videoTrackIds:ml,tracks:gl,getTimescaleFromMediaHeader:wa,getEmsgID3:_l},ka=js,vl=function(u){var d=u[1]&31;return d<<=8,d|=u[2],d},rn=function(u){return!!(u[1]&64)},sn=function(u){var d=0;return(u[3]&48)>>>4>1&&(d+=u[4]+1),d},J0=function(u,d){var m=vl(u);return m===0?"pat":m===d?"pmt":d?"pes":null},Z0=function(u){var d=rn(u),m=4+sn(u);return d&&(m+=u[m]+1),(u[m+10]&31)<<8|u[m+11]},em=function(u){var d={},m=rn(u),f=4+sn(u);if(m&&(f+=u[f]+1),!!(u[f+5]&1)){var T,A,I;T=(u[f+1]&15)<<8|u[f+2],A=3+T-4,I=(u[f+10]&15)<<8|u[f+11];for(var k=12+I;k<A;){var P=f+k;d[(u[P+1]&31)<<8|u[P+2]]=u[P],k+=((u[P+3]&15)<<8|u[P+4])+5}return d}},tm=function(u,d){var m=vl(u),f=d[m];switch(f){case ka.H264_STREAM_TYPE:return"video";case ka.ADTS_STREAM_TYPE:return"audio";case ka.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},im=function(u){var d=rn(u);if(!d)return null;var m=4+sn(u);if(m>=u.byteLength)return null;var f=null,T;return T=u[m+7],T&192&&(f={},f.pts=(u[m+9]&14)<<27|(u[m+10]&255)<<20|(u[m+11]&254)<<12|(u[m+12]&255)<<5|(u[m+13]&254)>>>3,f.pts*=4,f.pts+=(u[m+13]&6)>>>1,f.dts=f.pts,T&64&&(f.dts=(u[m+14]&14)<<27|(u[m+15]&255)<<20|(u[m+16]&254)<<12|(u[m+17]&255)<<5|(u[m+18]&254)>>>3,f.dts*=4,f.dts+=(u[m+18]&6)>>>1)),f},Oa=function(u){switch(u){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}},rm=function(u){for(var d=4+sn(u),m=u.subarray(d),f=0,T=0,A=!1,I;T<m.byteLength-3;T++)if(m[T+2]===1){f=T+5;break}for(;f<m.byteLength;)switch(m[f]){case 0:if(m[f-1]!==0){f+=2;break}else if(m[f-2]!==0){f++;break}T+3!==f-2&&(I=Oa(m[T+3]&31),I==="slice_layer_without_partitioning_rbsp_idr"&&(A=!0));do f++;while(m[f]!==1&&f<m.length);T=f-2,f+=3;break;case 1:if(m[f-1]!==0||m[f-2]!==0){f+=3;break}I=Oa(m[T+3]&31),I==="slice_layer_without_partitioning_rbsp_idr"&&(A=!0),T=f-2,f+=3;break;default:f+=3;break}return m=m.subarray(T),f-=T,T=0,m&&m.byteLength>3&&(I=Oa(m[T+3]&31),I==="slice_layer_without_partitioning_rbsp_idr"&&(A=!0)),A},sm={parseType:J0,parsePat:Z0,parsePmt:em,parsePayloadUnitStartIndicator:rn,parsePesType:tm,parsePesTime:im,videoPacketContainsKeyFrame:rm},yl=js,zi=Vu.handleRollover,be={};be.ts=sm,be.aac=Ea;var Di=Y.ONE_SECOND_IN_TS,tt=188,Ut=71,nm=function(u,d){for(var m=0,f=tt,T,A;f<u.byteLength;){if(u[m]===Ut&&u[f]===Ut){switch(T=u.subarray(m,f),A=be.ts.parseType(T,d.pid),A){case"pat":d.pid=be.ts.parsePat(T);break;case"pmt":var I=be.ts.parsePmt(T);d.table=d.table||{},Object.keys(I).forEach(function(k){d.table[k]=I[k]});break}m+=tt,f+=tt;continue}m++,f++}},Tl=function(u,d,m){for(var f=0,T=tt,A,I,k,P,M,j=!1;T<=u.byteLength;){if(u[f]===Ut&&(u[T]===Ut||T===u.byteLength)){switch(A=u.subarray(f,T),I=be.ts.parseType(A,d.pid),I){case"pes":k=be.ts.parsePesType(A,d.table),P=be.ts.parsePayloadUnitStartIndicator(A),k==="audio"&&P&&(M=be.ts.parsePesTime(A),M&&(M.type="audio",m.audio.push(M),j=!0));break}if(j)break;f+=tt,T+=tt;continue}f++,T++}for(T=u.byteLength,f=T-tt,j=!1;f>=0;){if(u[f]===Ut&&(u[T]===Ut||T===u.byteLength)){switch(A=u.subarray(f,T),I=be.ts.parseType(A,d.pid),I){case"pes":k=be.ts.parsePesType(A,d.table),P=be.ts.parsePayloadUnitStartIndicator(A),k==="audio"&&P&&(M=be.ts.parsePesTime(A),M&&(M.type="audio",m.audio.push(M),j=!0));break}if(j)break;f-=tt,T-=tt;continue}f--,T--}},am=function(u,d,m){for(var f=0,T=tt,A,I,k,P,M,j,H,ee,X=!1,ne={data:[],size:0};T<u.byteLength;){if(u[f]===Ut&&u[T]===Ut){switch(A=u.subarray(f,T),I=be.ts.parseType(A,d.pid),I){case"pes":if(k=be.ts.parsePesType(A,d.table),P=be.ts.parsePayloadUnitStartIndicator(A),k==="video"&&(P&&!X&&(M=be.ts.parsePesTime(A),M&&(M.type="video",m.video.push(M),X=!0)),!m.firstKeyFrame)){if(P&&ne.size!==0){for(j=new Uint8Array(ne.size),H=0;ne.data.length;)ee=ne.data.shift(),j.set(ee,H),H+=ee.byteLength;if(be.ts.videoPacketContainsKeyFrame(j)){var de=be.ts.parsePesTime(j);de?(m.firstKeyFrame=de,m.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.")}ne.size=0}ne.data.push(A),ne.size+=A.byteLength}break}if(X&&m.firstKeyFrame)break;f+=tt,T+=tt;continue}f++,T++}for(T=u.byteLength,f=T-tt,X=!1;f>=0;){if(u[f]===Ut&&u[T]===Ut){switch(A=u.subarray(f,T),I=be.ts.parseType(A,d.pid),I){case"pes":k=be.ts.parsePesType(A,d.table),P=be.ts.parsePayloadUnitStartIndicator(A),k==="video"&&P&&(M=be.ts.parsePesTime(A),M&&(M.type="video",m.video.push(M),X=!0));break}if(X)break;f-=tt,T-=tt;continue}f--,T--}},om=function(u,d){if(u.audio&&u.audio.length){var m=d;(typeof m=="undefined"||isNaN(m))&&(m=u.audio[0].dts),u.audio.forEach(function(A){A.dts=zi(A.dts,m),A.pts=zi(A.pts,m),A.dtsTime=A.dts/Di,A.ptsTime=A.pts/Di})}if(u.video&&u.video.length){var f=d;if((typeof f=="undefined"||isNaN(f))&&(f=u.video[0].dts),u.video.forEach(function(A){A.dts=zi(A.dts,f),A.pts=zi(A.pts,f),A.dtsTime=A.dts/Di,A.ptsTime=A.pts/Di}),u.firstKeyFrame){var T=u.firstKeyFrame;T.dts=zi(T.dts,f),T.pts=zi(T.pts,f),T.dtsTime=T.dts/Di,T.ptsTime=T.pts/Di}}},um=function(u){for(var d=!1,m=0,f=null,T=null,A=0,I=0,k;u.length-I>=3;){var P=be.aac.parseType(u,I);switch(P){case"timed-metadata":if(u.length-I<10){d=!0;break}if(A=be.aac.parseId3TagSize(u,I),A>u.length){d=!0;break}T===null&&(k=u.subarray(I,I+A),T=be.aac.parseAacTimestamp(k)),I+=A;break;case"audio":if(u.length-I<7){d=!0;break}if(A=be.aac.parseAdtsSize(u,I),A>u.length){d=!0;break}f===null&&(k=u.subarray(I,I+A),f=be.aac.parseSampleRate(k)),m++,I+=A;break;default:I++;break}if(d)return null}if(f===null||T===null)return null;var M=Di/f,j={audio:[{type:"audio",dts:T,pts:T},{type:"audio",dts:T+m*1024*M,pts:T+m*1024*M}]};return j},lm=function(u){var d={pid:null,table:null},m={};nm(u,d);for(var f in d.table)if(d.table.hasOwnProperty(f)){var T=d.table[f];switch(T){case yl.H264_STREAM_TYPE:m.video=[],am(u,d,m),m.video.length===0&&delete m.video;break;case yl.ADTS_STREAM_TYPE:m.audio=[],Tl(u,d,m),m.audio.length===0&&delete m.audio;break}}return m},dm=function(u,d){var m=be.aac.isLikelyAacData(u),f;return m?f=um(u):f=lm(u),!f||!f.audio&&!f.video?null:(om(f,d),f)},cm={inspect:dm,parseAudioPes_:Tl};const hm=function(u,d){d.on("data",function(m){const f=m.initSegment;m.initSegment={data:f.buffer,byteOffset:f.byteOffset,byteLength:f.byteLength};const T=m.data;m.data=T.buffer,u.postMessage({action:"data",segment:m,byteOffset:T.byteOffset,byteLength:T.byteLength},[m.data])}),d.on("done",function(m){u.postMessage({action:"done"})}),d.on("gopInfo",function(m){u.postMessage({action:"gopInfo",gopInfo:m})}),d.on("videoSegmentTimingInfo",function(m){const f={start:{decode:Y.videoTsToSeconds(m.start.dts),presentation:Y.videoTsToSeconds(m.start.pts)},end:{decode:Y.videoTsToSeconds(m.end.dts),presentation:Y.videoTsToSeconds(m.end.pts)},baseMediaDecodeTime:Y.videoTsToSeconds(m.baseMediaDecodeTime)};m.prependedContentDuration&&(f.prependedContentDuration=Y.videoTsToSeconds(m.prependedContentDuration)),u.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:f})}),d.on("audioSegmentTimingInfo",function(m){const f={start:{decode:Y.videoTsToSeconds(m.start.dts),presentation:Y.videoTsToSeconds(m.start.pts)},end:{decode:Y.videoTsToSeconds(m.end.dts),presentation:Y.videoTsToSeconds(m.end.pts)},baseMediaDecodeTime:Y.videoTsToSeconds(m.baseMediaDecodeTime)};m.prependedContentDuration&&(f.prependedContentDuration=Y.videoTsToSeconds(m.prependedContentDuration)),u.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:f})}),d.on("id3Frame",function(m){u.postMessage({action:"id3Frame",id3Frame:m})}),d.on("caption",function(m){u.postMessage({action:"caption",caption:m})}),d.on("trackinfo",function(m){u.postMessage({action:"trackinfo",trackInfo:m})}),d.on("audioTimingInfo",function(m){u.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:Y.videoTsToSeconds(m.start),end:Y.videoTsToSeconds(m.end)}})}),d.on("videoTimingInfo",function(m){u.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:Y.videoTsToSeconds(m.start),end:Y.videoTsToSeconds(m.end)}})}),d.on("log",function(m){u.postMessage({action:"log",log:m})})};class xl{constructor(d,m){this.options=m||{},this.self=d,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new m0.Transmuxer(this.options),hm(this.self,this.transmuxer)}pushMp4Captions(d){this.captionParser||(this.captionParser=new U0,this.captionParser.init());const m=new Uint8Array(d.data,d.byteOffset,d.byteLength),f=this.captionParser.parse(m,d.trackIds,d.timescales);this.self.postMessage({action:"mp4Captions",captions:f&&f.captions||[],logs:f&&f.logs||[],data:m.buffer},[m.buffer])}probeMp4StartTime({timescales:d,data:m}){const f=Ia.startTime(d,m);this.self.postMessage({action:"probeMp4StartTime",startTime:f,data:m},[m.buffer])}probeMp4Tracks({data:d}){const m=Ia.tracks(d);this.self.postMessage({action:"probeMp4Tracks",tracks:m,data:d},[d.buffer])}probeEmsgID3({data:d,offset:m}){const f=Ia.getEmsgID3(d,m);this.self.postMessage({action:"probeEmsgID3",id3Frames:f,emsgData:d},[d.buffer])}probeTs({data:d,baseStartTime:m}){const f=typeof m=="number"&&!isNaN(m)?m*Y.ONE_SECOND_IN_TS:void 0,T=cm.inspect(d,f);let A=null;T&&(A={hasVideo:T.video&&T.video.length===2||!1,hasAudio:T.audio&&T.audio.length===2||!1},A.hasVideo&&(A.videoStart=T.video[0].ptsTime),A.hasAudio&&(A.audioStart=T.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:A,data:d},[d.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(d){const m=new Uint8Array(d.data,d.byteOffset,d.byteLength);this.transmuxer.push(m)}reset(){this.transmuxer.reset()}setTimestampOffset(d){const m=d.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(Y.secondsToVideoTs(m)))}setAudioAppendStart(d){this.transmuxer.setAudioAppendStart(Math.ceil(Y.secondsToVideoTs(d.appendStart)))}setRemux(d){this.transmuxer.setRemux(d.remux)}flush(d){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(d){this.transmuxer.alignGopsWith(d.gopsToAlignWith.slice())}}self.onmessage=function(u){if(u.data.action==="init"&&u.data.options){this.messageHandlers=new xl(self,u.data.options);return}this.messageHandlers||(this.messageHandlers=new xl(self)),u.data&&u.data.action&&u.data.action!=="init"&&this.messageHandlers[u.data.action]&&this.messageHandlers[u.data.action](u.data)}}));var BT=qf(MT);const NT=(i,e,t)=>{const{type:r,initSegment:s,captions:n,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:h}=i.data.segment;e.buffer.push({captions:n,captionStreams:a,metadata:o});const c=i.data.segment.boxes||{data:i.data.segment.data},p={type:r,data:new Uint8Array(c.data,c.data.byteOffset,c.data.byteLength),initSegment:new Uint8Array(s.data,s.byteOffset,s.byteLength)};typeof l!="undefined"&&(p.videoFrameDtsTime=l),typeof h!="undefined"&&(p.videoFramePtsTime=h),t(p)},FT=({transmuxedData:i,callback:e})=>{i.buffer=[],e(i)},UT=(i,e)=>{e.gopInfo=i.data.gopInfo},Kf=i=>{const{transmuxer:e,bytes:t,audioAppendStart:r,gopsToAlignWith:s,remux:n,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:h,onVideoSegmentTimingInfo:c,onAudioSegmentTimingInfo:p,onId3:_,onCaptions:E,onDone:g,onEndedTimeline:b,onTransmuxerLog:C,isEndOfTimeline:x}=i,y={buffer:[]};let D=x;const S=v=>{e.currentTransmux===i&&(v.data.action==="data"&&NT(v,y,a),v.data.action==="trackinfo"&&o(v.data.trackInfo),v.data.action==="gopInfo"&&UT(v,y),v.data.action==="audioTimingInfo"&&l(v.data.audioTimingInfo),v.data.action==="videoTimingInfo"&&h(v.data.videoTimingInfo),v.data.action==="videoSegmentTimingInfo"&&c(v.data.videoSegmentTimingInfo),v.data.action==="audioSegmentTimingInfo"&&p(v.data.audioSegmentTimingInfo),v.data.action==="id3Frame"&&_([v.data.id3Frame],v.data.id3Frame.dispatchType),v.data.action==="caption"&&E(v.data.caption),v.data.action==="endedtimeline"&&(D=!1,b()),v.data.action==="log"&&C(v.data.log),v.data.type==="transmuxed"&&(D||(e.onmessage=null,FT({transmuxedData:y,callback:g}),Xf(e))))};if(e.onmessage=S,r&&e.postMessage({action:"setAudioAppendStart",appendStart:r}),Array.isArray(s)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:s}),typeof n!="undefined"&&e.postMessage({action:"setRemux",remux:n}),t.byteLength){const v=t instanceof ArrayBuffer?t:t.buffer,w=t instanceof ArrayBuffer?0:t.byteOffset;e.postMessage({action:"push",data:v,byteOffset:w,byteLength:t.byteLength},[v])}x&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},Xf=i=>{i.currentTransmux=null,i.transmuxQueue.length&&(i.currentTransmux=i.transmuxQueue.shift(),typeof i.currentTransmux=="function"?i.currentTransmux():Kf(i.currentTransmux))},$d=(i,e)=>{i.postMessage({action:e}),Xf(i)},Yf=(i,e)=>{if(!e.currentTransmux){e.currentTransmux=i,$d(e,i);return}e.transmuxQueue.push($d.bind(null,e,i))},jT=i=>{Yf("reset",i)},VT=i=>{Yf("endTimeline",i)},Qf=i=>{if(!i.transmuxer.currentTransmux){i.transmuxer.currentTransmux=i,Kf(i);return}i.transmuxer.transmuxQueue.push(i)},$T=i=>{const e=new BT;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:i}),e};var eo={reset:jT,endTimeline:VT,transmux:Qf,createTransmuxer:$T};const ps=function(i){const e=i.transmuxer,t=i.endAction||i.action,r=i.callback,s=ui({},i,{endAction:null,transmuxer:null,callback:null}),n=a=>{a.data.action===t&&(e.removeEventListener("message",n),a.data.data&&(a.data.data=new Uint8Array(a.data.data,i.byteOffset||0,i.byteLength||a.data.data.byteLength),i.data&&(i.data=a.data.data)),r(a.data))};if(e.addEventListener("message",n),i.data){const a=i.data instanceof ArrayBuffer;s.byteOffset=a?0:i.data.byteOffset,s.byteLength=i.data.byteLength;const o=[a?i.data:i.data.buffer];e.postMessage(s,o)}else e.postMessage(s)},Gt={FAILURE:2,TIMEOUT:-101,ABORTED:-102},wo=i=>{i.forEach(e=>{e.abort()})},HT=i=>({bandwidth:i.bandwidth,bytesReceived:i.bytesReceived||0,roundTripTime:i.roundTripTime||0}),GT=i=>{const e=i.target,t=Date.now()-e.requestTime,r={bandwidth:1/0,bytesReceived:0,roundTripTime:t||0};return r.bytesReceived=i.loaded,r.bandwidth=Math.floor(r.bytesReceived/r.roundTripTime*8*1e3),r},Mu=(i,e)=>e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:Gt.TIMEOUT,xhr:e}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:Gt.ABORTED,xhr:e}:i?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:Gt.FAILURE,xhr:e}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:Gt.FAILURE,xhr:e}:null,Hd=(i,e,t)=>(r,s)=>{const n=s.response,a=Mu(r,s);if(a)return t(a,i);if(n.byteLength!==16)return t({status:s.status,message:"Invalid HLS key at URL: "+s.uri,code:Gt.FAILURE,xhr:s},i);const o=new DataView(n),l=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]);for(let h=0;h<e.length;h++)e[h].bytes=l;return t(null,i)},Jf=(i,e)=>{const t=Zo(i.map.bytes);if(t!=="mp4"){const r=i.map.resolvedUri||i.map.uri;return e({internal:!0,message:`Found unsupported ${t||"unknown"} container for initialization segment at URL: ${r}`,code:Gt.FAILURE})}ps({action:"probeMp4Tracks",data:i.map.bytes,transmuxer:i.transmuxer,callback:({tracks:r,data:s})=>(i.map.bytes=s,r.forEach(function(n){i.map.tracks=i.map.tracks||{},!i.map.tracks[n.type]&&(i.map.tracks[n.type]=n,typeof n.id=="number"&&n.timescale&&(i.map.timescales=i.map.timescales||{},i.map.timescales[n.id]=n.timescale))}),e(null))})},qT=({segment:i,finishProcessingFn:e})=>(t,r)=>{const s=Mu(t,r);if(s)return e(s,i);const n=new Uint8Array(r.response);if(i.map.key)return i.map.encryptedBytes=n,e(null,i);i.map.bytes=n,Jf(i,function(a){if(a)return a.xhr=r,a.status=r.status,e(a,i);e(null,i)})},WT=({segment:i,finishProcessingFn:e,responseType:t})=>(r,s)=>{const n=Mu(r,s);if(n)return e(n,i);const a=t==="arraybuffer"||!s.responseText?s.response:PT(s.responseText.substring(i.lastReachedChar||0));return i.stats=HT(s),i.key?i.encryptedBytes=new Uint8Array(a):i.bytes=new Uint8Array(a),e(null,i)},zT=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:h,dataFn:c,doneFn:p,onTransmuxerLog:_})=>{const E=i.map&&i.map.tracks||{},g=Boolean(E.audio&&E.video);let b=r.bind(null,i,"audio","start");const C=r.bind(null,i,"audio","end");let x=r.bind(null,i,"video","start");const y=r.bind(null,i,"video","end"),D=()=>Qf({bytes:e,transmuxer:i.transmuxer,audioAppendStart:i.audioAppendStart,gopsToAlignWith:i.gopsToAlignWith,remux:g,onData:S=>{S.type=S.type==="combined"?"video":S.type,c(i,S)},onTrackInfo:S=>{t&&(g&&(S.isMuxed=!0),t(i,S))},onAudioTimingInfo:S=>{b&&typeof S.start!="undefined"&&(b(S.start),b=null),C&&typeof S.end!="undefined"&&C(S.end)},onVideoTimingInfo:S=>{x&&typeof S.start!="undefined"&&(x(S.start),x=null),y&&typeof S.end!="undefined"&&y(S.end)},onVideoSegmentTimingInfo:S=>{s(S)},onAudioSegmentTimingInfo:S=>{n(S)},onId3:(S,v)=>{a(i,S,v)},onCaptions:S=>{o(i,[S])},isEndOfTimeline:l,onEndedTimeline:()=>{h()},onTransmuxerLog:_,onDone:S=>{!p||(S.type=S.type==="combined"?"video":S.type,p(null,i,S))}});ps({action:"probeTs",transmuxer:i.transmuxer,data:e,baseStartTime:i.baseStartTime,callback:S=>{i.bytes=e=S.data;const v=S.result;v&&(t(i,{hasAudio:v.hasAudio,hasVideo:v.hasVideo,isMuxed:g}),t=null),D()}})},Zf=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:h,dataFn:c,doneFn:p,onTransmuxerLog:_})=>{let E=new Uint8Array(e);if(_v(E)){i.isFmp4=!0;const{tracks:g}=i.map,b={isFmp4:!0,hasVideo:!!g.video,hasAudio:!!g.audio};g.audio&&g.audio.codec&&g.audio.codec!=="enca"&&(b.audioCodec=g.audio.codec),g.video&&g.video.codec&&g.video.codec!=="encv"&&(b.videoCodec=g.video.codec),g.video&&g.audio&&(b.isMuxed=!0),t(i,b);const C=(x,y)=>{c(i,{data:E,type:b.hasAudio&&!b.isMuxed?"audio":"video"}),y&&y.length&&a(i,y),x&&x.length&&o(i,x),p(null,i,{})};ps({action:"probeMp4StartTime",timescales:i.map.timescales,data:E,transmuxer:i.transmuxer,callback:({data:x,startTime:y})=>{e=x.buffer,i.bytes=E=x,b.hasAudio&&!b.isMuxed&&r(i,"audio","start",y),b.hasVideo&&r(i,"video","start",y),ps({action:"probeEmsgID3",data:E,transmuxer:i.transmuxer,offset:y,callback:({emsgData:D,id3Frames:S})=>{if(e=D.buffer,i.bytes=E=D,!g.video||!x.byteLength||!i.transmuxer){C(void 0,S);return}ps({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:i.transmuxer,data:E,timescales:i.map.timescales,trackIds:[g.video.id],callback:v=>{e=v.data.buffer,i.bytes=E=v.data,v.logs.forEach(function(w){_(Se(w,{stream:"mp4CaptionParser"}))}),C(v.captions,S)}})}})}});return}if(!i.transmuxer){p(null,i,{});return}if(typeof i.container=="undefined"&&(i.container=Zo(E)),i.container!=="ts"&&i.container!=="aac"){t(i,{hasAudio:!1,hasVideo:!1}),p(null,i,{});return}zT({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:h,dataFn:c,doneFn:p,onTransmuxerLog:_})},ep=function({id:i,key:e,encryptedBytes:t,decryptionWorker:r},s){const n=o=>{if(o.data.source===i){r.removeEventListener("message",n);const l=o.data.decrypted;s(new Uint8Array(l.bytes,l.byteOffset,l.byteLength))}};r.addEventListener("message",n);let a;e.bytes.slice?a=e.bytes.slice():a=new Uint32Array(Array.prototype.slice.call(e.bytes)),r.postMessage(Uf({source:i,encrypted:t,key:a,iv:e.iv}),[t.buffer,a.buffer])},KT=({decryptionWorker:i,segment:e,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:h,dataFn:c,doneFn:p,onTransmuxerLog:_})=>{ep({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:i},E=>{e.bytes=E,Zf({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:h,dataFn:c,doneFn:p,onTransmuxerLog:_})})},XT=({activeXhrs:i,decryptionWorker:e,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:h,dataFn:c,doneFn:p,onTransmuxerLog:_})=>{let E=0,g=!1;return(b,C)=>{if(!g){if(b)return g=!0,wo(i),p(b,C);if(E+=1,E===i.length){const x=function(){if(C.encryptedBytes)return KT({decryptionWorker:e,segment:C,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:h,dataFn:c,doneFn:p,onTransmuxerLog:_});Zf({segment:C,bytes:C.bytes,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:h,dataFn:c,doneFn:p,onTransmuxerLog:_})};if(C.endOfAllRequests=Date.now(),C.map&&C.map.encryptedBytes&&!C.map.bytes)return ep({decryptionWorker:e,id:C.requestId+"-init",encryptedBytes:C.map.encryptedBytes,key:C.map.key},y=>{C.map.bytes=y,Jf(C,D=>{if(D)return wo(i),p(D,C);x()})});x()}}}},YT=({loadendState:i,abortFn:e})=>t=>{t.target.aborted&&e&&!i.calledAbortFn&&(e(),i.calledAbortFn=!0)},QT=({segment:i,progressFn:e,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:h,dataFn:c})=>p=>{if(!p.target.aborted)return i.stats=Se(i.stats,GT(p)),!i.stats.firstBytesReceivedAt&&i.stats.bytesReceived&&(i.stats.firstBytesReceivedAt=Date.now()),e(p,i)},JT=({xhr:i,xhrOptions:e,decryptionWorker:t,segment:r,abortFn:s,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:h,id3Fn:c,captionsFn:p,isEndOfTimeline:_,endedTimelineFn:E,dataFn:g,doneFn:b,onTransmuxerLog:C})=>{const x=[],y=XT({activeXhrs:x,decryptionWorker:t,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:h,id3Fn:c,captionsFn:p,isEndOfTimeline:_,endedTimelineFn:E,dataFn:g,doneFn:b,onTransmuxerLog:C});if(r.key&&!r.key.bytes){const L=[r.key];r.map&&!r.map.bytes&&r.map.key&&r.map.key.resolvedUri===r.key.resolvedUri&&L.push(r.map.key);const O=Se(e,{uri:r.key.resolvedUri,responseType:"arraybuffer"}),F=Hd(r,L,y),V=i(O,F);x.push(V)}if(r.map&&!r.map.bytes){if(r.map.key&&(!r.key||r.key.resolvedUri!==r.map.key.resolvedUri)){const U=Se(e,{uri:r.map.key.resolvedUri,responseType:"arraybuffer"}),B=Hd(r,[r.map.key],y),N=i(U,B);x.push(N)}const O=Se(e,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:Ao(r.map)}),F=qT({segment:r,finishProcessingFn:y}),V=i(O,F);x.push(V)}const D=Se(e,{uri:r.part&&r.part.resolvedUri||r.resolvedUri,responseType:"arraybuffer",headers:Ao(r)}),S=WT({segment:r,finishProcessingFn:y,responseType:D.responseType}),v=i(D,S);v.addEventListener("progress",QT({segment:r,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:h,id3Fn:c,captionsFn:p,isEndOfTimeline:_,endedTimelineFn:E,dataFn:g})),x.push(v);const w={};return x.forEach(L=>{L.addEventListener("loadend",YT({loadendState:w,abortFn:s}))}),()=>wo(x)},ZT=Nt("CodecUtils"),ex=function(i){const e=i.attributes||{};if(e.CODECS)return jt(e.CODECS)},tp=(i,e)=>{const t=e.attributes||{};return i&&i.mediaGroups&&i.mediaGroups.AUDIO&&t.AUDIO&&i.mediaGroups.AUDIO[t.AUDIO]},tx=(i,e)=>{if(!tp(i,e))return!0;const t=e.attributes||{},r=i.mediaGroups.AUDIO[t.AUDIO];for(const s in r)if(!r[s].uri&&!r[s].playlists)return!0;return!1},Vn=function(i){const e={};return i.forEach(({mediaType:t,type:r,details:s})=>{e[t]=e[t]||[],e[t].push(mc(`${r}${s}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1){ZT(`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},Gd=function(i){let e=0;return i.audio&&e++,i.video&&e++,e},ms=function(i,e){const t=e.attributes||{},r=Vn(ex(e)||[]);if(tp(i,e)&&!r.audio&&!tx(i,e)){const s=Vn(Tg(i,t.AUDIO)||[]);s.audio&&(r.audio=s.audio)}return r},hn=Nt("PlaylistSelector"),qd=function(i){if(!i||!i.playlist)return;const e=i.playlist;return JSON.stringify({id:e.id,bandwidth:i.bandwidth,width:i.width,height:i.height,codecs:e.attributes&&e.attributes.CODECS||""})},$n=function(i,e){if(!i)return"";const t=R.getComputedStyle(i);return t?t[e]:""},dr=function(i,e){const t=i.slice();i.sort(function(r,s){const n=e(r,s);return n===0?t.indexOf(r)-t.indexOf(s):n})},Bu=function(i,e){let t,r;return i.attributes.BANDWIDTH&&(t=i.attributes.BANDWIDTH),t=t||R.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(r=e.attributes.BANDWIDTH),r=r||R.Number.MAX_VALUE,t-r},ix=function(i,e){let t,r;return i.attributes.RESOLUTION&&i.attributes.RESOLUTION.width&&(t=i.attributes.RESOLUTION.width),t=t||R.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(r=e.attributes.RESOLUTION.width),r=r||R.Number.MAX_VALUE,t===r&&i.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?i.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-r};let ip=function(i,e,t,r,s,n){if(!i)return;const a={bandwidth:e,width:t,height:r,limitRenditionByPlayerDimensions:s};let o=i.playlists;ht.isAudioOnly(i)&&(o=n.getAudioTrackPlaylists_(),a.audioOnly=!0);let l=o.map(v=>{let w;const L=v.attributes&&v.attributes.RESOLUTION&&v.attributes.RESOLUTION.width,O=v.attributes&&v.attributes.RESOLUTION&&v.attributes.RESOLUTION.height;return w=v.attributes&&v.attributes.BANDWIDTH,w=w||R.Number.MAX_VALUE,{bandwidth:w,width:L,height:O,playlist:v}});dr(l,(v,w)=>v.bandwidth-w.bandwidth),l=l.filter(v=>!ht.isIncompatible(v.playlist));let h=l.filter(v=>ht.isEnabled(v.playlist));h.length||(h=l.filter(v=>!ht.isDisabled(v.playlist)));const c=h.filter(v=>v.bandwidth*Ge.BANDWIDTH_VARIANCE<e);let p=c[c.length-1];const _=c.filter(v=>v.bandwidth===p.bandwidth)[0];if(s===!1){const v=_||h[0]||l[0];if(v&&v.playlist){let w="sortedPlaylistReps";return _&&(w="bandwidthBestRep"),h[0]&&(w="enabledPlaylistReps"),hn(`choosing ${qd(v)} using ${w} with options`,a),v.playlist}return hn("could not choose a playlist with options",a),null}const E=c.filter(v=>v.width&&v.height);dr(E,(v,w)=>v.width-w.width);const g=E.filter(v=>v.width===t&&v.height===r);p=g[g.length-1];const b=g.filter(v=>v.bandwidth===p.bandwidth)[0];let C,x,y;b||(C=E.filter(v=>v.width>t||v.height>r),x=C.filter(v=>v.width===C[0].width&&v.height===C[0].height),p=x[x.length-1],y=x.filter(v=>v.bandwidth===p.bandwidth)[0]);let D;if(n.leastPixelDiffSelector){const v=E.map(w=>(w.pixelDiff=Math.abs(w.width-t)+Math.abs(w.height-r),w));dr(v,(w,L)=>w.pixelDiff===L.pixelDiff?L.bandwidth-w.bandwidth:w.pixelDiff-L.pixelDiff),D=v[0]}const S=D||y||b||_||h[0]||l[0];if(S&&S.playlist){let v="sortedPlaylistReps";return D?v="leastPixelDiffRep":y?v="resolutionPlusOneRep":b?v="resolutionBestRep":_?v="bandwidthBestRep":h[0]&&(v="enabledPlaylistReps"),hn(`choosing ${qd(S)} using ${v} with options`,a),S.playlist}return hn("could not choose a playlist with options",a),null};const Wd=function(){const i=this.useDevicePixelRatio&&R.devicePixelRatio||1;return ip(this.playlists.main,this.systemBandwidth,parseInt($n(this.tech_.el(),"width"),10)*i,parseInt($n(this.tech_.el(),"height"),10)*i,this.limitRenditionByPlayerDimensions,this.playlistController_)},rx=function(i){let e=-1,t=-1;if(i<0||i>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){const r=this.useDevicePixelRatio&&R.devicePixelRatio||1;return e<0&&(e=this.systemBandwidth,t=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==t&&(e=i*this.systemBandwidth+(1-i)*e,t=this.systemBandwidth),ip(this.playlists.main,e,parseInt($n(this.tech_.el(),"width"),10)*r,parseInt($n(this.tech_.el(),"height"),10)*r,this.limitRenditionByPlayerDimensions,this.playlistController_)}},sx=function(i){const{main:e,currentTime:t,bandwidth:r,duration:s,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=i,h=e.playlists.filter(g=>!ht.isIncompatible(g));let c=h.filter(ht.isEnabled);c.length||(c=h.filter(g=>!ht.isDisabled(g)));const _=c.filter(ht.hasAttribute.bind(null,"BANDWIDTH")).map(g=>{const C=l.getSyncPoint(g,s,o,t)?1:2,y=ht.estimateSegmentRequestTime(n,r,g)*C-a;return{playlist:g,rebufferingImpact:y}}),E=_.filter(g=>g.rebufferingImpact<=0);return dr(E,(g,b)=>Bu(b.playlist,g.playlist)),E.length?E[0]:(dr(_,(g,b)=>g.rebufferingImpact-b.rebufferingImpact),_[0]||null)},nx=function(){const i=this.playlists.main.playlists.filter(ht.isEnabled);return dr(i,(t,r)=>Bu(t,r)),i.filter(t=>!!ms(this.playlists.main,t).video)[0]||null},ax=i=>{let e=0,t;return i.bytes&&(t=new Uint8Array(i.bytes),i.segments.forEach(r=>{t.set(r,e),e+=r.byteLength})),t},ox=function(i,e,t){if(!i[t]){e.trigger({type:"usage",name:"vhs-608"});let r=t;/^cc708_/.test(t)&&(r="SERVICE"+t.split("_")[1]);const s=e.textTracks().getTrackById(r);if(s)i[t]=s;else{const n=e.options_.vhs&&e.options_.vhs.captionServices||{};let a=t,o=t,l=!1;const h=n[r];h&&(a=h.label,o=h.language,l=h.default),i[t]=e.addRemoteTextTrack({kind:"captions",id:r,default:l,label:a,language:o},!1).track}}},ux=function({inbandTextTracks:i,captionArray:e,timestampOffset:t}){if(!e)return;const r=R.WebKitDataCue||R.VTTCue;e.forEach(s=>{const n=s.stream;s.content?s.content.forEach(a=>{const o=new r(s.startTime+t,s.endTime+t,a.text);o.line=a.line,o.align="left",o.position=a.position,o.positionAlign="line-left",i[n].addCue(o)}):i[n].addCue(new r(s.startTime+t,s.endTime+t,s.text))})},lx=function(i){Object.defineProperties(i.frame,{id:{get(){return G.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),i.value.key}},value:{get(){return G.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),i.value.data}},privateData:{get(){return G.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),i.value.data}}})},dx=({inbandTextTracks:i,metadataArray:e,timestampOffset:t,videoDuration:r})=>{if(!e)return;const s=R.WebKitDataCue||R.VTTCue,n=i.metadataTrack_;if(!n||(e.forEach(c=>{const p=c.cueTime+t;typeof p!="number"||R.isNaN(p)||p<0||!(p<1/0)||!c.frames||!c.frames.length||c.frames.forEach(_=>{const E=new s(p,p,_.value||_.url||_.data||"");E.frame=_,E.value=_,lx(E),n.addCue(E)})}),!n.cues||!n.cues.length))return;const a=n.cues,o=[];for(let c=0;c<a.length;c++)a[c]&&o.push(a[c]);const l=o.reduce((c,p)=>{const _=c[p.startTime]||[];return _.push(p),c[p.startTime]=_,c},{}),h=Object.keys(l).sort((c,p)=>Number(c)-Number(p));h.forEach((c,p)=>{const _=l[c],E=isFinite(r)?r:0,g=Number(h[p+1])||E;_.forEach(b=>{b.endTime=g})})},cx={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"},hx=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),fx=({inbandTextTracks:i,dateRanges:e})=>{const t=i.metadataTrack_;if(!t)return;const r=R.WebKitDataCue||R.VTTCue;e.forEach(s=>{for(const n of Object.keys(s)){if(hx.has(n))continue;const a=new r(s.startTime,s.endTime,"");a.id=s.id,a.type="com.apple.quicktime.HLS",a.value={key:cx[n],data:s[n]},(n==="scte35Out"||n==="scte35In")&&(a.value.data=new Uint8Array(a.value.data.match(/[\da-f]{2}/gi)).buffer),t.addCue(a)}s.processDateRange()})},zd=(i,e,t)=>{i.metadataTrack_||(i.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,G.browser.IS_ANY_SAFARI||(i.metadataTrack_.inBandMetadataTrackDispatchType=e))},us=function(i,e,t){let r,s;if(!!t&&!!t.cues)for(r=t.cues.length;r--;)s=t.cues[r],s.startTime>=i&&s.endTime<=e&&t.removeCue(s)},px=function(i){const e=i.cues;if(!e)return;const t={};for(let r=e.length-1;r>=0;r--){const s=e[r],n=`${s.startTime}-${s.endTime}-${s.text}`;t[n]?i.removeCue(s):t[n]=s}},mx=(i,e,t)=>{if(typeof e=="undefined"||e===null||!i.length)return[];const r=Math.ceil((e-t+3)*Dn.ONE_SECOND_IN_TS);let s;for(s=0;s<i.length&&!(i[s].pts>r);s++);return i.slice(s)},gx=(i,e,t)=>{if(!e.length)return i;if(t)return e.slice();const r=e[0].pts;let s=0;for(s;s<i.length&&!(i[s].pts>=r);s++);return i.slice(0,s).concat(e)},_x=(i,e,t,r)=>{const s=Math.ceil((e-r)*Dn.ONE_SECOND_IN_TS),n=Math.ceil((t-r)*Dn.ONE_SECOND_IN_TS),a=i.slice();let o=i.length;for(;o--&&!(i[o].pts<=n););if(o===-1)return a;let l=o+1;for(;l--&&!(i[l].pts<=s););return l=Math.max(l,0),a.splice(l,o-l+1),a},vx=function(i,e){if(!i&&!e||!i&&e||i&&!e)return!1;if(i===e)return!0;const t=Object.keys(i).sort(),r=Object.keys(e).sort();if(t.length!==r.length)return!1;for(let s=0;s<t.length;s++){const n=t[s];if(n!==r[s]||i[n]!==e[n])return!1}return!0},rp=22,yx=function(i,e,t){e=e||[];const r=[];let s=0;for(let n=0;n<e.length;n++){const a=e[n];if(i===a.timeline&&(r.push(n),s+=a.duration,s>t))return n}return r.length===0?0:r[r.length-1]},ts=1,Tx=500,Kd=i=>typeof i=="number"&&isFinite(i),fn=1/60,xx=(i,e,t)=>i!=="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,bx=(i,e,t)=>{let r=e-Ge.BACK_BUFFER_LENGTH;i.length&&(r=Math.max(r,i.start(0)));const s=e-t;return Math.min(s,r)},er=i=>{const{startOfSegment:e,duration:t,segment:r,part:s,playlist:{mediaSequence:n,id:a,segments:o=[]},mediaIndex:l,partIndex:h,timeline:c}=i,p=o.length-1;let _="mediaIndex/partIndex increment";i.getMediaInfoForTime?_=`getMediaInfoForTime (${i.getMediaInfoForTime})`:i.isSyncRequest&&(_="getSyncSegmentCandidate (isSyncRequest)"),i.independent&&(_+=` with independent ${i.independent}`);const E=typeof h=="number",g=i.segment.uri?"segment":"pre-segment",b=E?Cf({preloadSegment:r})-1:0;return`${g} [${n+l}/${n+p}]`+(E?` part [${h}/${b}]`:"")+` segment start/end [${r.start} => ${r.end}]`+(E?` part start/end [${s.start} => ${s.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${c}] selected by [${_}] playlist [${a}]`},Xd=i=>`${i}TimingInfo`,Yd=(i,e)=>i.length?i.end(i.length-1):e,Ex=({segmentTimeline:i,currentTimeline:e,startOfSegment:t,buffered:r,calculateTimestampOffsetForEachSegment:s,overrideCheck:n})=>s?Yd(r,t):!n&&i===e?null:i<e?t:Yd(r,t),Qd=({timelineChangeController:i,currentTimeline:e,segmentTimeline:t,loaderType:r,audioDisabled:s})=>{if(e===t)return!1;if(r==="audio"){const n=i.lastTimelineChange({type:"main"});return!n||n.to!==t}if(r==="main"&&s){const n=i.pendingTimelineChange({type:"audio"});return!(n&&n.to===t)}return!1},Sx=i=>{let e=0;return["video","audio"].forEach(function(t){const r=i[`${t}TimingInfo`];if(!r)return;const{start:s,end:n}=r;let a;typeof s=="bigint"||typeof n=="bigint"?a=R.BigInt(n)-R.BigInt(s):typeof s=="number"&&typeof n=="number"&&(a=n-s),typeof a!="undefined"&&a>e&&(e=a)}),typeof e=="bigint"&&e<Number.MAX_SAFE_INTEGER&&(e=Number(e)),e},Jd=({segmentDuration:i,maxDuration:e})=>i?Math.round(i)>e+xi:!1,Cx=(i,e)=>{if(e!=="hls")return null;const t=Sx({audioTimingInfo:i.audioTimingInfo,videoTimingInfo:i.videoTimingInfo});if(!t)return null;const r=i.playlist.targetDuration,s=Jd({segmentDuration:t,maxDuration:r*2}),n=Jd({segmentDuration:t,maxDuration:r}),a=`Segment with index ${i.mediaIndex} from playlist ${i.playlist.id} has a duration of ${t} when the reported duration is ${i.duration} and the target duration is ${r}. 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 s||n?{severity:s?"warn":"info",message:a}:null};class Lo extends G.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.calculateTimestampOffsetForEachSegment_=e.calculateTimestampOffsetForEachSegment,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-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_={},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.replaceSegmentsUntil_=-1,this.logger_=Nt(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(r){r!==this.state_&&(this.logger_(`${this.state_} -> ${r}`),this.state_=r,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",()=>{this.hasEnoughInfoToLoad_()&&this.processLoadQueue_(),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()})}createTransmuxer_(){return eo.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_&&R.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);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,R.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_&&eo.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Ye();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:r,isMuxed:s}=e;if(r&&t&&!this.audioDisabled_&&!s)return this.sourceUpdater_.buffered();if(r)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const r=jn(e);let s=this.initSegments_[r];return t&&!s&&e.bytes&&(this.initSegments_[r]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),s||e}segmentKey(e,t=!1){if(!e)return null;const r=jf(e);let s=this.keyCache_[r];this.cacheEncryptionKeys_&&t&&!s&&e.bytes&&(this.keyCache_[r]=s={resolvedUri:e.resolvedUri,bytes:e.bytes});const n={resolvedUri:(s||e).resolvedUri};return s&&(n.bytes=s.bytes),n}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)return;const r=this.playlist_,s=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 n=null;if(r&&(r.id?n=r.id:r.uri&&(n=r.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!r||r.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 a=e.mediaSequence-r.mediaSequence;if(this.logger_(`live window shift [${a}]`),this.mediaIndex!==null)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const o=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!o.parts||!o.parts.length||!o.parts[this.partIndex])){const l=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=l}}s&&(s.mediaIndex-=a,s.mediaIndex<0?(s.mediaIndex=null,s.partIndex=null):(s.mediaIndex>=0&&(s.segment=e.segments[s.mediaIndex]),s.partIndex>=0&&s.segment.parts&&(s.part=s.segment.parts[s.partIndex]))),this.syncController_.saveExpiredSegmentInfo(r,e)}pause(){this.checkBufferTimeout_&&(R.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetLoaderProperties(){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0}}resetEverything(e){this.resetLoaderProperties(),this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.resyncLoader()}resyncLoader(){this.transmuxer_&&eo.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,r=()=>{},s=!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 n=1;const a=()=>{n--,n===0&&r()};(s||!this.audioDisabled_)&&(n++,this.sourceUpdater_.removeAudio(e,t,a)),(s||this.loaderType_==="main")&&(this.gopBuffer_=_x(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,a));for(const o in this.inbandTextTracks_)us(e,t,this.inbandTextTracks_[o]);us(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&R.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=R.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&R.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=R.setTimeout(this.monitorBufferTick_.bind(this),Tx)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();!e||(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_,r=this.partIndex){if(!t||!this.mediaSource_)return!1;const s=typeof e=="number"&&t.segments[e],n=e+1===t.segments.length,a=!s||!s.parts||r+1===s.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&a}chooseNextRequest_(){const e=this.buffered_(),t=Nd(e)||0,r=Iu(e,this.currentTime_()),s=!this.hasPlayed_()&&r>=1,n=r>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||s||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());const o={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(o.isSyncRequest)o.mediaIndex=yx(this.currentTimeline_,a,t);else if(this.mediaIndex!==null){const _=a[this.mediaIndex],E=typeof this.partIndex=="number"?this.partIndex:-1;o.startOfSegment=_.end?_.end:t,_.parts&&_.parts[E+1]?(o.mediaIndex=this.mediaIndex,o.partIndex=E+1):o.mediaIndex=this.mediaIndex+1}else{const{segmentIndex:_,startTime:E,partIndex:g}=ht.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?t:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});o.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${t}`:`currentTime ${this.currentTime_()}`,o.mediaIndex=_,o.startOfSegment=E,o.partIndex=g}const l=a[o.mediaIndex];let h=l&&typeof o.partIndex=="number"&&l.parts&&l.parts[o.partIndex];if(!l||typeof o.partIndex=="number"&&!h)return null;typeof o.partIndex!="number"&&l.parts&&(o.partIndex=0,h=l.parts[0]);const c=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!r&&h&&!c&&!h.independent)if(o.partIndex===0){const _=a[o.mediaIndex-1],E=_.parts&&_.parts.length&&_.parts[_.parts.length-1];E&&E.independent&&(o.mediaIndex-=1,o.partIndex=_.parts.length-1,o.independent="previous segment")}else l.parts[o.partIndex-1].independent&&(o.partIndex-=1,o.independent="previous part");const p=this.mediaSource_&&this.mediaSource_.readyState==="ended";return o.mediaIndex>=a.length-1&&p&&!this.seeking_()?null:this.generateSegmentInfo_(o)}generateSegmentInfo_(e){const{independent:t,playlist:r,mediaIndex:s,startOfSegment:n,isSyncRequest:a,partIndex:o,forceTimestampOffset:l,getMediaInfoForTime:h}=e,c=r.segments[s],p=typeof o=="number"&&c.parts[o],_={requestId:"segment-loader-"+Math.random(),uri:p&&p.resolvedUri||c.resolvedUri,mediaIndex:s,partIndex:p?o:null,isSyncRequest:a,startOfSegment:n,playlist:r,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:c.timeline,duration:p&&p.duration||c.duration,segment:c,part:p,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:h,independent:t},E=typeof l!="undefined"?l:this.isPendingTimestampOffset_;_.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:c.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),calculateTimestampOffsetForEachSegment:this.calculateTimestampOffsetForEachSegment_,overrideCheck:E});const g=Nd(this.sourceUpdater_.audioBuffered());return typeof g=="number"&&(_.audioAppendStart=g-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(_.gopsToAlignWith=mx(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),_}timestampOffsetForSegment_(e){return Ex(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_(),r=e.bandwidth,s=this.pendingSegment_.duration,n=ht.estimateSegmentRequestTime(s,r,this.playlist_,e.bytesReceived),a=Gy(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=a)return;const o=sx({main:this.vhs_.playlists.main,currentTime:t,bandwidth:r,duration:this.duration_(),segmentDuration:s,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!o)return;const h=n-a-o.rebufferingImpact;let c=.5;a<=xi&&(c=1),!(!o.playlist||o.playlist.uri===this.playlist_.uri||h<c)&&(this.bandwidth=o.playlist.attributes.BANDWIDTH*Ge.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${er(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId)&&this.trigger("progress")}handleTrackInfo_(e,t){this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(t)||(t=t||{},vx(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_())))}handleTimingInfo_(e,t,r,s){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const n=this.pendingSegment_,a=Xd(t);n[a]=n[a]||{},n[a][r]=s,this.logger_(`timinginfo: ${t} - ${r} - ${s}`),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}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 s=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),n={};t.forEach(a=>{n[a.stream]=n[a.stream]||{startTime:1/0,captions:[],endTime:0};const o=n[a.stream];o.startTime=Math.min(o.startTime,a.startTime+s),o.endTime=Math.max(o.endTime,a.endTime+s),o.captions.push(a)}),Object.keys(n).forEach(a=>{const{startTime:o,endTime:l,captions:h}=n[a],c=this.inbandTextTracks_;this.logger_(`adding cues from ${o} -> ${l} for ${a}`),ox(c,this.vhs_.tech_,a),us(o,l,c[a]),ux({captionArray:h,inbandTextTracks:c,timestampOffset:s})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,r));return}this.addMetadataToTextTrack(r,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_()?!Qd({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:r,hasVideo:s,isMuxed:n}=t;return!(s&&!e.videoTimingInfo||r&&!this.audioDisabled_&&!n&&!e.audioTimingInfo||Qd({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_()){this.callQueue_.push(this.handleData_.bind(this,e,t));return}const r=this.pendingSegment_;if(this.setTimeMapping_(r.timeline),this.updateMediaSecondsLoaded_(r.part||r.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),r.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),r.isFmp4=e.isFmp4,r.timingInfo=r.timingInfo||{},r.isFmp4)this.trigger("fmp4"),r.timingInfo.start=r[Xd(t.type)].start;else{const s=this.getCurrentMediaInfo_(),n=this.loaderType_==="main"&&s&&s.hasVideo;let a;n&&(a=r.videoTimingInfo.start),r.timingInfo.start=this.trueSegmentStart_({currentStart:r.timingInfo.start,playlist:r.playlist,mediaIndex:r.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:a,videoTimingInfo:r.videoTimingInfo,audioTimingInfo:r.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(r,t.type),this.updateSourceBufferTimestampOffset_(r),r.isSyncRequest){this.updateTimingInfoEnd_(r),this.syncController_.saveSegmentTimingInfo({segmentInfo:r,shouldSaveTimelineMapping:this.loaderType_==="main"});const s=this.chooseNextRequest_();if(s.mediaIndex!==r.mediaIndex||s.partIndex!==r.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}r.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(r,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:r,playlist:s}){if(r){const n=jn(r);if(this.activeInitSegmentId_===n)return null;t=this.initSegmentForMap(r,!0).bytes,this.activeInitSegmentId_=n}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=s,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:r},s){const n=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Mi(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Mi(a).join(", "));const o=n.length?n.start(0):0,l=n.length?n.end(n.length-1):0,h=a.length?a.start(0):0,c=a.length?a.end(a.length-1):0;if(l-o<=ts&&c-h<=ts){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${r.byteLength}, audio buffer: ${Mi(n).join(", ")}, video buffer: ${Mi(a).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:r}));const _=this.currentTime_()-ts;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${_}`),this.remove(0,_,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${ts}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=R.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},ts*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:r},s){if(!!s){if(s.code===rp){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:r});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",s),this.error(`${t} append of ${r.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:r,data:s,bytes:n}){if(!n){const a=[s];let o=s.byteLength;r&&(a.unshift(r),o+=r.byteLength),n=ax({bytes:o,segments:a})}this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,r){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const s=this.pendingSegment_.segment,n=`${e}TimingInfo`;s[n]||(s[n]={}),s[n].transmuxerPrependedSeconds=r.prependedContentDuration||0,s[n].transmuxedPresentationStart=r.start.presentation,s[n].transmuxedDecodeStart=r.start.decode,s[n].transmuxedPresentationEnd=r.end.presentation,s[n].transmuxedDecodeEnd=r.end.decode,s[n].baseMediaDecodeTime=r.baseMediaDecodeTime}appendData_(e,t){const{type:r,data:s}=t;if(!s||!s.byteLength||r==="audio"&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:r,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:r,initSegment:n,data:s})}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_()){this.loadQueue_.push(()=>{const t=ui({},e,{forceTimestampOffset:!0});ui(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),r=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),s=this.mediaIndex!==null,n=e.timeline!==this.currentTimeline_&&e.timeline>0,a=r||s&&n;this.logger_(`Requesting ${er(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=JT({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:a,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:o,level:l,stream:h})=>{this.logger_(`${er(e)} logged from transmuxer stream ${h} as a ${l}: ${o}`)}})}trimBackBuffer_(e){const t=bx(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,r=e.part,s={resolvedUri:r?r.resolvedUri:t.resolvedUri,byterange:r?r.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},n=e.playlist.segments[e.mediaIndex-1];if(n&&n.timeline===t.timeline&&(n.videoTimingInfo?s.baseStartTime=n.videoTimingInfo.transmuxedDecodeEnd:n.audioTimingInfo&&(s.baseStartTime=n.audioTimingInfo.transmuxedDecodeEnd)),t.key){const a=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);s.key=this.segmentKey(t.key),s.key.iv=a}return t.map&&(s.map=this.initSegmentForMap(t.map)),s}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<fn){this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record ${fn}`);return}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,r){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,r));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===Gt.ABORTED)return;if(this.pause(),e.code===Gt.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(e),this.trigger("error");return}const s=this.pendingSegment_;this.saveBandwidthRelatedStats_(s.duration,t.stats),s.endOfAllRequests=t.endOfAllRequests,r.gopInfo&&(this.gopBuffer_=gx(this.gopBuffer_,r.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(s)}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:r,firstVideoFrameTimeForData:s,currentVideoTimestampOffset:n,useVideoTimingInfo:a,videoTimingInfo:o,audioTimingInfo:l}){if(typeof e!="undefined")return e;if(!a)return l.start;const h=t.segments[r-1];return r===0||!h||typeof h.start=="undefined"||h.end!==s+n?s:o.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:r,hasVideo:s,isMuxed:n}=t,a=this.loaderType_==="main"&&s,o=!this.audioDisabled_&&r&&!n;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}a&&e.waitingOnAppends++,o&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),o&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=xx(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:r}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart=="number"?t.transmuxedDecodeStart:r.start:r.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),s=this.loaderType_==="main"&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;!s||(e.timingInfo.end=typeof s.end=="number"?s.end:s.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});const t=Cx(e,this.sourceType_);if(t&&(t.severity==="warn"?G.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 ${er(e)}`);return}this.logger_(`Appended ${er(e)}`),this.addSegmentMetadataCue_(e),this.currentTime_()>=this.replaceSegmentsUntil_&&(this.replaceSegmentsUntil_=-1,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 r=e.segment,s=e.part,n=r.end&&this.currentTime_()-r.end>e.playlist.targetDuration*3,a=s&&s.end&&this.currentTime_()-s.end>e.playlist.partTargetDuration*3;if(n||a){this.logger_(`bad ${n?"segment":"part"} ${er(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<fn){this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record ${fn}`);return}const t=this.throughput.rate,r=Date.now()-e.endOfAllRequests+1,s=Math.floor(e.byteLength/r*8*1e3);this.throughput.rate+=(s-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,r=t.start,s=t.end;if(!Kd(r)||!Kd(s))return;us(r,s,this.segmentMetadataTrack_);const n=R.WebKitDataCue||R.VTTCue,a={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.uri,timeline:e.timeline,playlist:e.playlist.id,start:r,end:s},o=JSON.stringify(a),l=new n(r,s,o);l.value=a,this.segmentMetadataTrack_.addCue(l)}set replaceSegmentsUntil(e){this.logger_(`Replacing currently buffered segments until ${e}`),this.replaceSegmentsUntil_=e}}function ni(){}const sp=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toUpperCase())},Ax=["video","audio"],Io=(i,e)=>{const t=e[`${i}Buffer`];return t&&t.updating||e.queuePending[i]},Dx=(i,e)=>{for(let t=0;t<e.length;t++){const r=e[t];if(r.type==="mediaSource")return null;if(r.type===i)return t}return null},cr=(i,e)=>{if(e.queue.length===0)return;let t=0,r=e.queue[t];if(r.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),r.action(e),r.doneFn&&r.doneFn(),cr("audio",e),cr("video",e));return}if(i!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||Io(i,e))){if(r.type!==i){if(t=Dx(i,e.queue),t===null)return;r=e.queue[t]}if(e.queue.splice(t,1),e.queuePending[i]=r,r.action(i,e),!r.doneFn){e.queuePending[i]=null,cr(i,e);return}}},np=(i,e)=>{const t=e[`${i}Buffer`],r=sp(i);!t||(t.removeEventListener("updateend",e[`on${r}UpdateEnd_`]),t.removeEventListener("error",e[`on${r}Error_`]),e.codecs[i]=null,e[`${i}Buffer`]=null)},Vt=(i,e)=>i&&e&&Array.prototype.indexOf.call(i.sourceBuffers,e)!==-1,_t={appendBuffer:(i,e,t)=>(r,s)=>{const n=s[`${r}Buffer`];if(!!Vt(s.mediaSource,n)){s.logger_(`Appending segment ${e.mediaIndex}'s ${i.length} bytes to ${r}Buffer`);try{n.appendBuffer(i)}catch(a){s.logger_(`Error with code ${a.code} `+(a.code===rp?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${r}Buffer`),s.queuePending[r]=null,t(a)}}},remove:(i,e)=>(t,r)=>{const s=r[`${t}Buffer`];if(!!Vt(r.mediaSource,s)){r.logger_(`Removing ${i} to ${e} from ${t}Buffer`);try{s.remove(i,e)}catch(n){r.logger_(`Remove ${i} to ${e} from ${t}Buffer failed`)}}},timestampOffset:i=>(e,t)=>{const r=t[`${e}Buffer`];!Vt(t.mediaSource,r)||(t.logger_(`Setting ${e}timestampOffset to ${i}`),r.timestampOffset=i)},callback:i=>(e,t)=>{i()},endOfStream:i=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${i||""})`);try{e.mediaSource.endOfStream(i)}catch(t){G.log.warn("Failed to call media source endOfStream",t)}}},duration:i=>e=>{e.logger_(`Setting mediaSource duration to ${i}`);try{e.mediaSource.duration=i}catch(t){G.log.warn("Failed to set media source duration",t)}},abort:()=>(i,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${i}Buffer`];if(!!Vt(e.mediaSource,t)){e.logger_(`calling abort on ${i}Buffer`);try{t.abort()}catch(r){G.log.warn(`Failed to abort on ${i}Buffer`,r)}}},addSourceBuffer:(i,e)=>t=>{const r=sp(i),s=gs(e);t.logger_(`Adding ${i}Buffer with codec ${e} to mediaSource`);const n=t.mediaSource.addSourceBuffer(s);n.addEventListener("updateend",t[`on${r}UpdateEnd_`]),n.addEventListener("error",t[`on${r}Error_`]),t.codecs[i]=e,t[`${i}Buffer`]=n},removeSourceBuffer:i=>e=>{const t=e[`${i}Buffer`];if(np(i,e),!!Vt(e.mediaSource,t)){e.logger_(`Removing ${i}Buffer with codec ${e.codecs[i]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(r){G.log.warn(`Failed to removeSourceBuffer ${i}Buffer`,r)}}},changeType:i=>(e,t)=>{const r=t[`${e}Buffer`],s=gs(i);!Vt(t.mediaSource,r)||t.codecs[e]!==i&&(t.logger_(`changing ${e}Buffer codec from ${t.codecs[e]} to ${i}`),r.changeType(s),t.codecs[e]=i)}},vt=({type:i,sourceUpdater:e,action:t,doneFn:r,name:s})=>{e.queue.push({type:i,action:t,doneFn:r,name:s}),cr(i,e)},Zd=(i,e)=>t=>{const r=e[`${i}Buffered`](),s=Vy(r);if(e.logger_(`${i} source buffer update end. Buffered:
`,s),e.queuePending[i]){const n=e.queuePending[i].doneFn;e.queuePending[i]=null,n&&n(e[`${i}Error_`])}cr(i,e)};class ap extends G.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>cr("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=Nt("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=Zd("video",this),this.onAudioUpdateEnd_=Zd("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())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){vt({type:"mediaSource",sourceUpdater:this,action:_t.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){vt({type:e,sourceUpdater:this,action:_t.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){G.log.error("removeSourceBuffer is not supported!");return}vt({type:"mediaSource",sourceUpdater:this,action:_t.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!G.browser.IS_FIREFOX&&R.MediaSource&&R.MediaSource.prototype&&typeof R.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return R.SourceBuffer&&R.SourceBuffer.prototype&&typeof R.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){G.log.error("changeType is not supported!");return}vt({type:e,sourceUpdater:this,action:_t.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 r=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,r);this.canChangeType()&&this.changeType(t,r)})}appendBuffer(e,t){const{segmentInfo:r,type:s,bytes:n}=e;if(this.processedAppend_=!0,s==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${n.length} until video append`);return}const a=t;if(vt({type:s,sourceUpdater:this,action:_t.appendBuffer(n,r||{mediaIndex:-1},a),doneFn:t,name:"appendBuffer"}),s==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const o=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${o.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,o.forEach(l=>{this.appendBuffer.apply(this,l)})}}audioBuffered(){return Vt(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Ye()}videoBuffered(){return Vt(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Ye()}buffered(){const e=Vt(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Vt(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():Hy(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=ni){vt({type:"mediaSource",sourceUpdater:this,action:_t.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=ni){typeof e!="string"&&(e=void 0),vt({type:"mediaSource",sourceUpdater:this,action:_t.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,r=ni){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){r();return}vt({type:"audio",sourceUpdater:this,action:_t.remove(e,t),doneFn:r,name:"remove"})}removeVideo(e,t,r=ni){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){r();return}vt({type:"video",sourceUpdater:this,action:_t.remove(e,t),doneFn:r,name:"remove"})}updating(){return!!(Io("audio",this)||Io("video",this))}audioTimestampOffset(e){return typeof e!="undefined"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(vt({type:"audio",sourceUpdater:this,action:_t.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e!="undefined"&&this.videoBuffer&&this.videoTimestampOffset!==e&&(vt({type:"video",sourceUpdater:this,action:_t.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){!this.audioBuffer||vt({type:"audio",sourceUpdater:this,action:_t.callback(e),name:"callback"})}videoQueueCallback(e){!this.videoBuffer||vt({type:"video",sourceUpdater:this,action:_t.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),Ax.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>np(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const ec=i=>decodeURIComponent(escape(String.fromCharCode.apply(null,i))),tc=new Uint8Array(`
`.split("").map(i=>i.charCodeAt(0)));class wx extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class Lx extends Lo{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.loaderType_="subtitle",this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Ye();const e=this.subtitlesTrack_.cues,t=e[0].startTime,r=e[e.length-1].startTime;return Ye([[t,r]])}initSegmentForMap(e,t=!1){if(!e)return null;const r=jn(e);let s=this.initSegments_[r];if(t&&!s&&e.bytes){const n=tc.byteLength+e.bytes.byteLength,a=new Uint8Array(n);a.set(e.bytes),a.set(tc,e.bytes.byteLength),this.initSegments_[r]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return s||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){us(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,r){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===Gt.TIMEOUT&&this.handleTimeout_(),e.code===Gt.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const s=this.pendingSegment_;this.saveBandwidthRelatedStats_(s.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const n=s.segment;if(n.map&&(n.map.bytes=t.map.bytes),s.bytes=t.bytes,typeof R.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,r),()=>this.stopForError({message:"Error loading vtt.js"}));return}n.requested=!0;try{this.parseVTTCues_(s)}catch(a){this.stopForError({message:a.message});return}if(this.updateTimeMapping_(s,this.syncController_.timelines[s.timeline],this.playlist_),s.cues.length?s.timingInfo={start:s.cues[0].startTime,end:s.cues[s.cues.length-1].endTime}:s.timingInfo={start:s.startOfSegment,end:s.startOfSegment+s.duration},s.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}s.byteLength=s.bytes.byteLength,this.mediaSecondsLoaded+=n.duration,s.cues.forEach(a=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new R.VTTCue(a.startTime,a.endTime,a.text):a)}),px(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let t,r=!1;if(typeof R.WebVTT!="function")throw new wx;typeof R.TextDecoder=="function"?t=new R.TextDecoder("utf8"):(t=R.WebVTT.StringDecoder(),r=!0);const s=new R.WebVTT.Parser(R,R.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},s.oncue=e.cues.push.bind(e.cues),s.ontimestampmap=a=>{e.timestampmap=a},s.onparsingerror=a=>{G.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;r&&(a=ec(a)),s.parse(a)}let n=e.bytes;r&&(n=ec(n)),s.parse(n),s.flush()}updateTimeMapping_(e,t,r){const s=e.segment;if(!t)return;if(!e.cues.length){s.empty=!0;return}const n=e.timestampmap,a=n.MPEGTS/Dn.ONE_SECOND_IN_TS-n.LOCAL+t.mapping;if(e.cues.forEach(o=>{o.startTime+=a,o.endTime+=a}),!r.syncInfo){const o=e.cues[0].startTime,l=e.cues[e.cues.length-1].startTime;r.syncInfo={mediaSequence:r.mediaSequence+e.mediaIndex,time:Math.min(o,l-s.duration)}}}}const Ix=function(i,e){const t=i.cues;for(let r=0;r<t.length;r++){const s=t[r];if(e>=s.adStartTime&&e<=s.adEndTime)return s}return null},kx=function(i,e,t=0){if(!i.segments)return;let r=t,s;for(let n=0;n<i.segments.length;n++){const a=i.segments[n];if(s||(s=Ix(e,r+a.duration/2)),s){if("cueIn"in a){s.endTime=r,s.adEndTime=r,r+=a.duration,s=null;continue}if(r<s.endTime){r+=a.duration;continue}s.endTime+=a.duration}else if("cueOut"in a&&(s=new R.VTTCue(r,r+a.duration,a.cueOut),s.adStartTime=r,s.adEndTime=r+parseFloat(a.cueOut),e.addCue(s)),"cueOutCont"in a){const[o,l]=a.cueOutCont.split("/").map(parseFloat);s=new R.VTTCue(r,r+a.duration,""),s.adStartTime=r-o,s.adEndTime=s.adStartTime+l,e.addCue(s)}r+=a.duration}},Ox=86400,ic=[{name:"VOD",run:(i,e,t,r,s)=>t!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"ProgramDateTime",run:(i,e,t,r,s)=>{if(!Object.keys(i.timelineToDatetimeMappings).length)return null;let n=null,a=null;const o=xo(e);s=s||0;for(let l=0;l<o.length;l++){const h=e.endList||s===0?l:o.length-(l+1),c=o[h],p=c.segment,_=i.timelineToDatetimeMappings[p.timeline];if(!_||!p.dateTimeObject)continue;let g=p.dateTimeObject.getTime()/1e3+_;if(p.parts&&typeof c.partIndex=="number")for(let C=0;C<c.partIndex;C++)g+=p.parts[C].duration;const b=Math.abs(s-g);if(a!==null&&(b===0||a<b))break;a=b,n={time:g,segmentIndex:c.segmentIndex,partIndex:c.partIndex}}return n}},{name:"Segment",run:(i,e,t,r,s)=>{let n=null,a=null;s=s||0;const o=xo(e);for(let l=0;l<o.length;l++){const h=e.endList||s===0?l:o.length-(l+1),c=o[h],p=c.segment,_=c.part&&c.part.start||p&&p.start;if(p.timeline===r&&typeof _!="undefined"){const E=Math.abs(s-_);if(a!==null&&a<E)break;(!n||a===null||a>=E)&&(a=E,n={time:_,segmentIndex:c.segmentIndex,partIndex:c.partIndex})}}return n}},{name:"Discontinuity",run:(i,e,t,r,s)=>{let n=null;if(s=s||0,e.discontinuityStarts&&e.discontinuityStarts.length){let a=null;for(let o=0;o<e.discontinuityStarts.length;o++){const l=e.discontinuityStarts[o],h=e.discontinuitySequence+o+1,c=i.discontinuities[h];if(c){const p=Math.abs(s-c.time);if(a!==null&&a<p)break;(!n||a===null||a>=p)&&(a=p,n={time:c.time,segmentIndex:l,partIndex:null})}}}return n}},{name:"Playlist",run:(i,e,t,r,s)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class Px extends G.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={},this.logger_=Nt("SyncController")}getSyncPoint(e,t,r,s){const n=this.runStrategies_(e,t,r,s);return n.length?this.selectSyncPoint_(n,{key:"time",value:s}):null}getExpiredTime(e,t){if(!e||!e.segments)return null;const r=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!r.length)return null;const s=this.selectSyncPoint_(r,{key:"segmentIndex",value:0});return s.segmentIndex>0&&(s.time*=-1),Math.abs(s.time+fs({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:s.segmentIndex,endIndex:0}))}runStrategies_(e,t,r,s){const n=[];for(let a=0;a<ic.length;a++){const o=ic[a],l=o.run(this,e,t,r,s);l&&(l.strategy=o.name,n.push({strategy:o.name,syncPoint:l}))}return n}selectSyncPoint_(e,t){let r=e[0].syncPoint,s=Math.abs(e[0].syncPoint[t.key]-t.value),n=e[0].strategy;for(let a=1;a<e.length;a++){const o=Math.abs(e[a].syncPoint[t.key]-t.value);o<s&&(s=o,r=e[a].syncPoint,n=e[a].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${n}]: [time:${r.time}, segmentIndex:${r.segmentIndex}`+(typeof r.partIndex=="number"?`,partIndex:${r.partIndex}`:"")+"]"),r}saveExpiredSegmentInfo(e,t){const r=t.mediaSequence-e.mediaSequence;if(r>Ox){G.log.warn(`Not saving expired segment info. Media sequence gap ${r} is too large.`);return}for(let s=r-1;s>=0;s--){const n=e.segments[s];if(n&&typeof n.start!="undefined"){t.syncInfo={mediaSequence:e.mediaSequence+s,time:n.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],r=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-r}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const r=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),s=e.segment;r&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:s.start}));const n=s.dateTimeObject;s.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[s.timeline]=-(n.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,r){const s=e.segment,n=e.part;let a=this.timelines[e.timeline],o,l;if(typeof e.timestampOffset=="number")a={time:e.startOfSegment,mapping:e.startOfSegment-t.start},r&&(this.timelines[e.timeline]=a,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${a.time}] [mapping: ${a.mapping}]`)),o=e.startOfSegment,l=t.end+a.mapping;else if(a)o=t.start+a.mapping,l=t.end+a.mapping;else return!1;return n&&(n.start=o,n.end=l),(!s.start||o<s.start)&&(s.start=o),s.end=l,!0}saveDiscontinuitySyncInfo_(e){const t=e.playlist,r=e.segment;if(r.discontinuity)this.discontinuities[r.timeline]={time:r.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let s=0;s<t.discontinuityStarts.length;s++){const n=t.discontinuityStarts[s],a=t.discontinuitySequence+s+1,o=n-e.mediaIndex,l=Math.abs(o);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>l){let h;o<0?h=r.start-fs({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):h=r.end+fs({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[a]={time:h,accuracy:l}}}}dispose(){this.trigger("dispose"),this.off()}}class Rx extends G.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:r}){return typeof t=="number"&&typeof r=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:r},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:r}){return typeof t=="number"&&typeof r=="number"&&(this.lastTimelineChanges_[e]={type:e,from:t,to:r},delete this.pendingTimelineChanges_[e],this.trigger("timelinechange")),this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const Mx=Wf(zf(function(){var i=function(){function b(){this.listeners={}}var C=b.prototype;return C.on=function(y,D){this.listeners[y]||(this.listeners[y]=[]),this.listeners[y].push(D)},C.off=function(y,D){if(!this.listeners[y])return!1;var S=this.listeners[y].indexOf(D);return this.listeners[y]=this.listeners[y].slice(0),this.listeners[y].splice(S,1),S>-1},C.trigger=function(y){var D=this.listeners[y];if(!!D)if(arguments.length===2)for(var S=D.length,v=0;v<S;++v)D[v].call(this,arguments[1]);else for(var w=Array.prototype.slice.call(arguments,1),L=D.length,O=0;O<L;++O)D[O].apply(this,w)},C.dispose=function(){this.listeners={}},C.pipe=function(y){this.on("data",function(D){y.push(D)})},b}();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function e(b){return b.subarray(0,b.byteLength-b[b.byteLength-1])}/*! @name aes-decrypter @version 4.0.1 @license Apache-2.0 */const t=function(){const b=[[[],[],[],[],[]],[[],[],[],[],[]]],C=b[0],x=b[1],y=C[4],D=x[4];let S,v,w;const L=[],O=[];let F,V,U,B,N,$;for(S=0;S<256;S++)O[(L[S]=S<<1^(S>>7)*283)^S]=S;for(v=w=0;!y[v];v^=F||1,w=O[w]||1)for(B=w^w<<1^w<<2^w<<3^w<<4,B=B>>8^B&255^99,y[v]=B,D[B]=v,U=L[V=L[F=L[v]]],$=U*16843009^V*65537^F*257^v*16843008,N=L[B]*257^B*16843008,S=0;S<4;S++)C[S][v]=N=N<<24^N>>>8,x[S][B]=$=$<<24^$>>>8;for(S=0;S<5;S++)C[S]=C[S].slice(0),x[S]=x[S].slice(0);return b};let r=null;class s{constructor(C){r||(r=t()),this._tables=[[r[0][0].slice(),r[0][1].slice(),r[0][2].slice(),r[0][3].slice(),r[0][4].slice()],[r[1][0].slice(),r[1][1].slice(),r[1][2].slice(),r[1][3].slice(),r[1][4].slice()]];let x,y,D;const S=this._tables[0][4],v=this._tables[1],w=C.length;let L=1;if(w!==4&&w!==6&&w!==8)throw new Error("Invalid aes key size");const O=C.slice(0),F=[];for(this._key=[O,F],x=w;x<4*w+28;x++)D=O[x-1],(x%w===0||w===8&&x%w===4)&&(D=S[D>>>24]<<24^S[D>>16&255]<<16^S[D>>8&255]<<8^S[D&255],x%w===0&&(D=D<<8^D>>>24^L<<24,L=L<<1^(L>>7)*283)),O[x]=O[x-w]^D;for(y=0;x;y++,x--)D=O[y&3?x:x-4],x<=4||y<4?F[y]=D:F[y]=v[0][S[D>>>24]]^v[1][S[D>>16&255]]^v[2][S[D>>8&255]]^v[3][S[D&255]]}decrypt(C,x,y,D,S,v){const w=this._key[1];let L=C^w[0],O=D^w[1],F=y^w[2],V=x^w[3],U,B,N;const $=w.length/4-2;let K,q=4;const Q=this._tables[1],oe=Q[0],le=Q[1],se=Q[2],pe=Q[3],Te=Q[4];for(K=0;K<$;K++)U=oe[L>>>24]^le[O>>16&255]^se[F>>8&255]^pe[V&255]^w[q],B=oe[O>>>24]^le[F>>16&255]^se[V>>8&255]^pe[L&255]^w[q+1],N=oe[F>>>24]^le[V>>16&255]^se[L>>8&255]^pe[O&255]^w[q+2],V=oe[V>>>24]^le[L>>16&255]^se[O>>8&255]^pe[F&255]^w[q+3],q+=4,L=U,O=B,F=N;for(K=0;K<4;K++)S[(3&-K)+v]=Te[L>>>24]<<24^Te[O>>16&255]<<16^Te[F>>8&255]<<8^Te[V&255]^w[q++],U=L,L=O,O=F,F=V,V=U}}class n extends i{constructor(){super(i),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(C){this.jobs.push(C),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(b){return b<<24|(b&65280)<<8|(b&16711680)>>8|b>>>24},o=function(b,C,x){const y=new Int32Array(b.buffer,b.byteOffset,b.byteLength>>2),D=new s(Array.prototype.slice.call(C)),S=new Uint8Array(b.byteLength),v=new Int32Array(S.buffer);let w,L,O,F,V,U,B,N,$;for(w=x[0],L=x[1],O=x[2],F=x[3],$=0;$<y.length;$+=4)V=a(y[$]),U=a(y[$+1]),B=a(y[$+2]),N=a(y[$+3]),D.decrypt(V,U,B,N,v,$),v[$]=a(v[$]^w),v[$+1]=a(v[$+1]^L),v[$+2]=a(v[$+2]^O),v[$+3]=a(v[$+3]^F),w=V,L=U,O=B,F=N;return S};class l{constructor(C,x,y,D){const S=l.STEP,v=new Int32Array(C.buffer),w=new Uint8Array(C.byteLength);let L=0;for(this.asyncStream_=new n,this.asyncStream_.push(this.decryptChunk_(v.subarray(L,L+S),x,y,w)),L=S;L<v.length;L+=S)y=new Uint32Array([a(v[L-4]),a(v[L-3]),a(v[L-2]),a(v[L-1])]),this.asyncStream_.push(this.decryptChunk_(v.subarray(L,L+S),x,y,w));this.asyncStream_.push(function(){D(null,e(w))})}static get STEP(){return 32e3}decryptChunk_(C,x,y,D){return function(){const S=o(C,x,y);D.set(S,C.byteOffset)}}}var h=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},c;typeof window!="undefined"?c=window:typeof h!="undefined"?c=h:typeof self!="undefined"?c=self:c={};var p=c,_=function(C){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(C):C&&C.buffer instanceof ArrayBuffer},E=p.BigInt||Number;E("0x1"),E("0x100"),E("0x10000"),E("0x1000000"),E("0x100000000"),E("0x10000000000"),E("0x1000000000000"),E("0x100000000000000"),E("0x10000000000000000"),function(){var b=new Uint16Array([65484]),C=new Uint8Array(b.buffer,b.byteOffset,b.byteLength);return C[0]===255?"big":C[0]===204?"little":"unknown"}();const g=function(b){const C={};return Object.keys(b).forEach(x=>{const y=b[x];_(y)?C[x]={bytes:y.buffer,byteOffset:y.byteOffset,byteLength:y.byteLength}:C[x]=y}),C};self.onmessage=function(b){const C=b.data,x=new Uint8Array(C.encrypted.bytes,C.encrypted.byteOffset,C.encrypted.byteLength),y=new Uint32Array(C.key.bytes,C.key.byteOffset,C.key.byteLength/4),D=new Uint32Array(C.iv.bytes,C.iv.byteOffset,C.iv.byteLength/4);new l(x,y,D,function(S,v){self.postMessage(g({source:C.source,decrypted:v}),[v.buffer])})}}));var Bx=qf(Mx);const Nx=i=>{let e=i.default?"main":"alternative";return i.characteristics&&i.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},Hn=(i,e)=>{i.abort(),i.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},ko=(i,e)=>{e.activePlaylistLoader=i,i.load()},Fx=(i,e)=>()=>{const{segmentLoaders:{[i]:t,main:r},mediaTypes:{[i]:s}}=e,n=s.activeTrack(),a=s.getActiveGroup(),o=s.activePlaylistLoader,l=s.lastGroup_;if(!(a&&l&&a.id===l.id)&&(s.lastGroup_=a,s.lastTrack_=n,Hn(t,s),!(!a||a.isMainPlaylist))){if(!a.playlistLoader){o&&r.resetEverything();return}t.resyncLoader(),ko(a.playlistLoader,s)}},Ux=(i,e)=>()=>{const{segmentLoaders:{[i]:t},mediaTypes:{[i]:r}}=e;r.lastGroup_=null,t.abort(),t.pause()},jx=(i,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[i]:r,main:s},mediaTypes:{[i]:n}}=e,a=n.activeTrack(),o=n.getActiveGroup(),l=n.activePlaylistLoader,h=n.lastTrack_;if(!(h&&a&&h.id===a.id)&&(n.lastGroup_=o,n.lastTrack_=a,Hn(r,n),!!o)){if(o.isMainPlaylist){if(!a||!h||a.id===h.id)return;const c=e.vhs.playlistController_,p=c.selectPlaylist();if(c.media()===p)return;n.logger_(`track change. Switching main audio from ${h.id} to ${a.id}`),t.pause(),s.resetEverything(),c.fastQualityChange_(p);return}if(i==="AUDIO"){if(!o.playlistLoader){s.setAudio(!0),s.resetEverything();return}r.setAudio(!0),s.setAudio(!1)}if(l===o.playlistLoader){ko(o.playlistLoader,n);return}r.track&&r.track(a),r.resetEverything(),ko(o.playlistLoader,n)}},Gn={AUDIO:(i,e)=>()=>{const{segmentLoaders:{[i]:t},mediaTypes:{[i]:r},excludePlaylist:s}=e;Hn(t,r);const n=r.activeTrack(),a=r.activeGroup(),o=(a.filter(h=>h.default)[0]||a[0]).id,l=r.tracks[o];if(n===l){s({error:{message:"Problem encountered loading the default audio track."}});return}G.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const h in r.tracks)r.tracks[h].enabled=r.tracks[h]===l;r.onTrackChanged()},SUBTITLES:(i,e)=>()=>{const{segmentLoaders:{[i]:t},mediaTypes:{[i]:r}}=e;G.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Hn(t,r);const s=r.activeTrack();s&&(s.mode="disabled"),r.onTrackChanged()}},rc={AUDIO:(i,e,t)=>{if(!e)return;const{tech:r,requestOptions:s,segmentLoaders:{[i]:n}}=t;e.on("loadedmetadata",()=>{const a=e.media();n.playlist(a,s),(!r.paused()||a.endList&&r.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),s),r.paused()||n.load()}),e.on("error",Gn[i](i,t))},SUBTITLES:(i,e,t)=>{const{tech:r,requestOptions:s,segmentLoaders:{[i]:n},mediaTypes:{[i]:a}}=t;e.on("loadedmetadata",()=>{const o=e.media();n.playlist(o,s),n.track(a.activeTrack()),(!r.paused()||o.endList&&r.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),s),r.paused()||n.load()}),e.on("error",Gn[i](i,t))}},Vx={AUDIO:(i,e)=>{const{vhs:t,sourceType:r,segmentLoaders:{[i]:s},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[i]:{groups:o,tracks:l,logger_:h}},mainPlaylistLoader:c}=e,p=Ps(c.main);(!a[i]||Object.keys(a[i]).length===0)&&(a[i]={main:{default:{default:!0}}},p&&(a[i].main.default.playlists=c.main.playlists));for(const _ in a[i]){o[_]||(o[_]=[]);for(const E in a[i][_]){let g=a[i][_][E],b;if(p?(h(`AUDIO group '${_}' label '${E}' is a main playlist`),g.isMainPlaylist=!0,b=null):r==="vhs-json"&&g.playlists?b=new sr(g.playlists[0],t,n):g.resolvedUri?b=new sr(g.resolvedUri,t,n):g.playlists&&r==="dash"?b=new Do(g.playlists[0],t,n,c):b=null,g=Se({id:E,playlistLoader:b},g),rc[i](i,g.playlistLoader,e),o[_].push(g),typeof l[E]=="undefined"){const C=new G.AudioTrack({id:E,kind:Nx(g),enabled:!1,language:g.language,default:g.default,label:E});l[E]=C}}}s.on("error",Gn[i](i,e))},SUBTITLES:(i,e)=>{const{tech:t,vhs:r,sourceType:s,segmentLoaders:{[i]:n},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[i]:{groups:l,tracks:h}},mainPlaylistLoader:c}=e;for(const p in o[i]){l[p]||(l[p]=[]);for(const _ in o[i][p]){if(!r.options_.useForcedSubtitles&&o[i][p][_].forced)continue;let E=o[i][p][_],g;if(s==="hls")g=new sr(E.resolvedUri,r,a);else if(s==="dash"){if(!E.playlists.filter(C=>C.excludeUntil!==1/0).length)return;g=new Do(E.playlists[0],r,a,c)}else s==="vhs-json"&&(g=new sr(E.playlists?E.playlists[0]:E.resolvedUri,r,a));if(E=Se({id:_,playlistLoader:g},E),rc[i](i,E.playlistLoader,e),l[p].push(E),typeof h[_]=="undefined"){const b=t.addRemoteTextTrack({id:_,kind:"subtitles",default:E.default&&E.autoselect,language:E.language,label:_},!1).track;h[_]=b}}}n.on("error",Gn[i](i,e))},"CLOSED-CAPTIONS":(i,e)=>{const{tech:t,main:{mediaGroups:r},mediaTypes:{[i]:{groups:s,tracks:n}}}=e;for(const a in r[i]){s[a]||(s[a]=[]);for(const o in r[i][a]){const l=r[i][a][o];if(!/^(?:CC|SERVICE)/.test(l.instreamId))continue;const h=t.options_.vhs&&t.options_.vhs.captionServices||{};let c={label:o,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(h[c.instreamId]&&(c=Se(c,h[c.instreamId])),c.default===void 0&&delete c.default,s[a].push(Se({id:o},l)),typeof n[o]=="undefined"){const p=t.addRemoteTextTrack({id:c.instreamId,kind:"captions",default:c.default,language:c.language,label:c.label},!1).track;n[o]=p}}}}},op=(i,e)=>{for(let t=0;t<i.length;t++)if(Pu(e,i[t])||i[t].playlists&&op(i[t].playlists,e))return!0;return!1},$x=(i,e)=>t=>{const{mainPlaylistLoader:r,mediaTypes:{[i]:{groups:s}}}=e,n=r.media();if(!n)return null;let a=null;n.attributes[i]&&(a=s[n.attributes[i]]);const o=Object.keys(s);if(!a)if(i==="AUDIO"&&o.length>1&&Ps(e.main))for(let l=0;l<o.length;l++){const h=s[o[l]];if(op(h,n)){a=h;break}}else s.main?a=s.main:o.length===1&&(a=s[o[0]]);return typeof t=="undefined"?a:t===null||!a?null:a.filter(l=>l.id===t.id)[0]||null},Hx={AUDIO:(i,e)=>()=>{const{mediaTypes:{[i]:{tracks:t}}}=e;for(const r in t)if(t[r].enabled)return t[r];return null},SUBTITLES:(i,e)=>()=>{const{mediaTypes:{[i]:{tracks:t}}}=e;for(const r in t)if(t[r].mode==="showing"||t[r].mode==="hidden")return t[r];return null}},Gx=(i,{mediaTypes:e})=>()=>{const t=e[i].activeTrack();return t?e[i].activeGroup(t):null},qx=i=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(h=>{Vx[h](h,i)});const{mediaTypes:e,mainPlaylistLoader:t,tech:r,vhs:s,segmentLoaders:{["AUDIO"]:n,main:a}}=i;["AUDIO","SUBTITLES"].forEach(h=>{e[h].activeGroup=$x(h,i),e[h].activeTrack=Hx[h](h,i),e[h].onGroupChanged=Fx(h,i),e[h].onGroupChanging=Ux(h,i),e[h].onTrackChanged=jx(h,i),e[h].getActiveGroup=Gx(h,i)});const o=e.AUDIO.activeGroup();if(o){const h=(o.filter(p=>p.default)[0]||o[0]).id;e.AUDIO.tracks[h].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),n.setAudio(!0)):a.setAudio(!0)}t.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(h=>e[h].onGroupChanged())}),t.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(h=>e[h].onGroupChanging())});const l=()=>{e.AUDIO.onTrackChanged(),r.trigger({type:"usage",name:"vhs-audio-change"})};r.audioTracks().addEventListener("change",l),r.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),s.on("dispose",()=>{r.audioTracks().removeEventListener("change",l),r.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),r.clearTracks("audio");for(const h in e.AUDIO.tracks)r.audioTracks().addTrack(e.AUDIO.tracks[h])},Wx=()=>{const i={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{i[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:ni,activeTrack:ni,getActiveGroup:ni,onGroupChanged:ni,onTrackChanged:ni,lastTrack_:null,logger_:Nt(`MediaGroups[${e}]`)}}),i},zx=10;let ri;const Kx=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],Xx=function(i){return this.audioSegmentLoader_[i]+this.mainSegmentLoader_[i]},Yx=function({currentPlaylist:i,buffered:e,currentTime:t,nextPlaylist:r,bufferLowWaterLine:s,bufferHighWaterLine:n,duration:a,bufferBasedABR:o,log:l}){if(!r)return G.log.warn("We received no playlist to switch to. Please check your stream."),!1;const h=`allowing switch ${i&&i.id||"null"} -> ${r.id}`;if(!i)return l(`${h} as current playlist is not set`),!0;if(r.id===i.id)return!1;const c=Boolean(rr(e,t).length);if(!i.endList)return!c&&typeof i.partTargetDuration=="number"?(l(`not ${h} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(l(`${h} as current playlist is live`),!0);const p=Iu(e,t),_=o?Ge.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Ge.MAX_BUFFER_LOW_WATER_LINE;if(a<_)return l(`${h} as duration < max low water line (${a} < ${_})`),!0;const E=r.attributes.BANDWIDTH,g=i.attributes.BANDWIDTH;if(E<g&&(!o||p<n)){let b=`${h} as next bandwidth < current bandwidth (${E} < ${g})`;return o&&(b+=` and forwardBuffer < bufferHighWaterLine (${p} < ${n})`),l(b),!0}if((!o||E>g)&&p>=s){let b=`${h} as forwardBuffer >= bufferLowWaterLine (${p} >= ${s})`;return o&&(b+=` and next bandwidth > current bandwidth (${E} > ${g})`),l(b),!0}return l(`not ${h} as no switching criteria met`),!1};class Qx extends G.EventTarget{constructor(e){super();const{src:t,withCredentials:r,tech:s,bandwidth:n,externVhs:a,useCueTags:o,playlistExclusionDuration:l,enableLowInitialPlaylist:h,sourceType:c,cacheEncryptionKeys:p,bufferBasedABR:_,leastPixelDiffSelector:E,captionServices:g}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:b}=e;(b===null||typeof b=="undefined")&&(b=1/0),ri=a,this.bufferBasedABR=Boolean(_),this.leastPixelDiffSelector=Boolean(E),this.withCredentials=r,this.tech_=s,this.vhs_=s.vhs,this.sourceType_=c,this.useCueTags_=o,this.playlistExclusionDuration=l,this.maxPlaylistRetries=b,this.enableLowInitialPlaylist=h,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:r,maxPlaylistRetries:b,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=Wx(),this.mediaSource=new R.MediaSource,this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.seekable_=Ye(),this.hasPlayed_=!1,this.syncController_=new Px(e),this.segmentMetadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new Bx,this.sourceUpdater_=new ap(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new Rx;const C={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,calculateTimestampOffsetForEachSegment:e.calculateTimestampOffsetForEachSegment,captionServices:g,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:n,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:p,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new Do(t,this.vhs_,Se(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new sr(t,this.vhs_,Se(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Lo(Se(C,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new Lo(Se(C,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new Lx(Se(C,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((y,D)=>{function S(){s.off("vttjserror",v),y()}function v(){s.off("vttjsloaded",S),D()}s.one("vttjsloaded",S),s.one("vttjserror",v),s.addWebVttScript_()})}),e),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),Kx.forEach(y=>{this[y+"_"]=Xx.bind(this,y)}),this.logger_=Nt("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 x=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(x,()=>{const y=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-y,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,r){const s=this.media(),n=s&&(s.id||s.uri),a=e.id||e.uri;n&&n!==a&&(this.logger_(`switch media ${n} -> ${a} from ${t}`),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})),this.mainPlaylistLoader_.media(e,r)}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=R.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(R.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 r=e.mediaGroups.AUDIO,s=Object.keys(r);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{const o=r.main||s.length&&r[s[0]];for(const l in o)if(o[l].default){n={label:l};break}}if(!n)return t;const a=[];for(const o in r)if(r[o][n.label]){const l=r[o][n.label];if(l.playlists&&l.playlists.length)a.push.apply(a,l.playlists);else if(l.uri)a.push(l);else if(e.playlists.length)for(let h=0;h<e.playlists.length;h++){const c=e.playlists[h];c.attributes&&c.attributes.AUDIO&&c.attributes.AUDIO===o&&a.push(c)}}return a.length?a:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const e=this.mainPlaylistLoader_.media(),t=e.targetDuration*1.5*1e3;bo(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),qx({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(),e),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 e=this.mainPlaylistLoader_.media();if(!e){this.excludeUnsupportedVariants_();let t;if(this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||(t=this.selectPlaylist()),!t||!this.shouldSwitchToMedia_(t)||(this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),this.mainPlaylistLoader_.on("error",()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const e=this.mainPlaylistLoader_.media(),t=e.targetDuration*1.5*1e3;bo(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const e=this.mainPlaylistLoader_.media();if(e.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(e)&&(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"})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const r=e.mediaGroups||{};let s=!0;const n=Object.keys(r.AUDIO);for(const a in r.AUDIO)for(const o in r.AUDIO[a])r.AUDIO[a][o].uri||(s=!1);s&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(r.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),ri.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(r.AUDIO[n[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_.pendingMedia_,r=this.tech_.currentTime(),s=this.bufferLowWaterLine(),n=this.bufferHighWaterLine(),a=this.tech_.buffered();return Yx({buffered:a,currentTime:r,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:s,bufferHighWaterLine:n,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 t=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:t.playlist,error:t})}),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.mainSegmentLoader_.on("earlyabort",t=>{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:zx}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const t=this.getCodecsOrExclude_();!t||this.sourceUpdater_.addOrChangeSourceBuffers(t)};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",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()})}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()}fastQualityChange_(e=this.selectPlaylist()){if(e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.resetMainLoaderReplaceSegments()}resetMainLoaderReplaceSegments(){const e=this.tech_.buffered(),t=e.end(e.length-1);this.mainSegmentLoader_.replaceSegmentsUntil=t,this.mainSegmentLoader_.resetLoaderProperties(),this.mainSegmentLoader_.resetLoader()}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 r=t.end(0);let s=r;if(e.start){const n=e.start.timeOffset;n<0?s=Math.max(r+n,t.start(0)):s=Math.min(r,n)}this.trigger("firstplay"),this.tech_.setCurrentTime(s)}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 r=this.syncController_.getExpiredTime(e,this.duration());if(r===null)return!1;const s=ri.Playlist.playlistEnd(e,r),n=this.tech_.currentTime(),a=this.tech_.buffered();if(!a.length)return s-n<=Ht;const o=a.end(a.length-1);return o-n<=Ht&&s-o<=Ht}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:r}){if(e=e||this.mainPlaylistLoader_.media(),r=r||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const s=this.mainPlaylistLoader_.main.playlists,n=s.filter(ma),a=n.length===1&&n[0]===e;if(s.length===1&&r!==1/0)return G.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){let E=!1;s.forEach(g=>{if(g===e)return;const b=g.excludeUntil;typeof b!="undefined"&&b!==1/0&&(E=!0,delete g.excludeUntil)}),E&&(G.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let o;e.playlistErrors_>this.maxPlaylistRetries?o=1/0:o=Date.now()+r*1e3,e.excludeUntil=o,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const l=this.selectPlaylist();if(!l){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const h=t.internal?this.logger_:G.log.warn,c=t.message?" "+t.message:"";h(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${c} Switching to playlist ${l.id}.`),l.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),l.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const p=l.targetDuration/2*1e3||5*1e3,_=typeof l.lastRequest=="number"&&Date.now()-l.lastRequest<=p;return this.switchMedia_(l,"exclude",a||_)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const r=[],s=e==="all";(s||e==="main")&&r.push(this.mainPlaylistLoader_);const n=[];(s||e==="audio")&&n.push("AUDIO"),(s||e==="subtitle")&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEach(a=>{const o=this.mediaTypes_[a]&&this.mediaTypes_[a].activePlaylistLoader;o&&r.push(o)}),["main","audio","subtitle"].forEach(a=>{const o=this[`${a}SegmentLoader_`];o&&(e===a||e==="all")&&r.push(o)}),r.forEach(a=>t.forEach(o=>{typeof a[o]=="function"&&a[o]()}))}setCurrentTime(e){const t=rr(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(t&&t.length)return e;this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.resetEverything(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&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:ri.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_)return;let t=this.mainPlaylistLoader_.media();if(!t)return;let r=this.syncController_.getExpiredTime(t,this.duration());if(r===null)return;const s=this.mainPlaylistLoader_.main,n=ri.Playlist.seekable(t,r,ri.Playlist.liveEdgeDelay(s,t));if(n.length===0||this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),r=this.syncController_.getExpiredTime(t,this.duration()),r===null||(e=ri.Playlist.seekable(t,r,ri.Playlist.liveEdgeDelay(s,t)),e.length===0)))return;let a,o;this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),o=this.seekable_.start(0)),e?e.start(0)>n.end(0)||n.start(0)>e.end(0)?this.seekable_=n:this.seekable_=Ye([[e.start(0)>n.start(0)?e.start(0):n.start(0),e.end(0)<n.end(0)?e.end(0):n.end(0)]]):this.seekable_=n,!(this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===a&&this.seekable_.start(0)===o)&&(this.logger_(`seekable updated [${Ef(this.seekable_)}]`),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 s=this.seekable();if(!s.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<s.end(s.length-1))&&this.sourceUpdater_.setDuration(s.end(s.length-1));return}const t=this.tech_.buffered();let r=ri.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(r=Math.max(r,t.end(t.length-1))),this.mediaSource.duration!==r&&this.sourceUpdater_.setDuration(r)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const r in t)t[r].forEach(s=>{s.playlistLoader&&s.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_(),r=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!t||!r)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const r=ms(this.main(),t),s={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(s.video=r.video||e.main.videoCodec||bg),e.main.isMuxed&&(s.video+=`,${r.audio||e.main.audioCodec||Ul}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(s.audio=r.audio||e.main.audioCodec||e.audio.audioCodec||Ul,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!s.audio&&!s.video){this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const a=(h,c)=>h?pn(c):Ua(c),o={};let l;if(["video","audio"].forEach(function(h){if(s.hasOwnProperty(h)&&!a(e[h].isFmp4,s[h])){const c=e[h].isFmp4?"browser":"muxer";o[c]=o[c]||[],o[c].push(s[h]),h==="audio"&&(l=c)}}),n&&l&&t.attributes.AUDIO){const h=t.attributes.AUDIO;this.main().playlists.forEach(c=>{(c.attributes&&c.attributes.AUDIO)===h&&c!==t&&(c.excludeUntil=1/0)}),this.logger_(`excluding audio group ${h} as ${l} does not support codec(s): "${s.audio}"`)}if(Object.keys(o).length){const h=Object.keys(o).reduce((c,p)=>(c&&(c+=", "),c+=`${p} does not support codec(s): "${o[p].join(",")}"`,c),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:h},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const h=[];if(["video","audio"].forEach(c=>{const p=(jt(this.sourceUpdater_.codecs[c]||"")[0]||{}).type,_=(jt(s[c]||"")[0]||{}).type;p&&_&&p.toLowerCase()!==_.toLowerCase()&&h.push(`"${this.sourceUpdater_.codecs[c]}" -> "${s[c]}"`)}),h.length){this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${h.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return s}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(r=>{const s=e[r];if(t.indexOf(s.id)!==-1)return;t.push(s.id);const n=ms(this.main,s),a=[];n.audio&&!Ua(n.audio)&&!pn(n.audio)&&a.push(`audio codec ${n.audio}`),n.video&&!Ua(n.video)&&!pn(n.video)&&a.push(`video codec ${n.video}`),n.text&&n.text==="stpp.ttml.im1t"&&a.push(`text codec ${n.text}`),a.length&&(s.excludeUntil=1/0,this.logger_(`excluding ${s.id} for unsupported: ${a.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],r=this.main().playlists,s=Vn(jt(e)),n=Gd(s),a=s.video&&jt(s.video)[0]||null,o=s.audio&&jt(s.audio)[0]||null;Object.keys(r).forEach(l=>{const h=r[l];if(t.indexOf(h.id)!==-1||h.excludeUntil===1/0)return;t.push(h.id);const c=[],p=ms(this.mainPlaylistLoader_.main,h),_=Gd(p);if(!(!p.audio&&!p.video)){if(_!==n&&c.push(`codec count "${_}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const E=p.video&&jt(p.video)[0]||null,g=p.audio&&jt(p.audio)[0]||null;E&&a&&E.type.toLowerCase()!==a.type.toLowerCase()&&c.push(`video codec "${E.type}" !== "${a.type}"`),g&&o&&g.type.toLowerCase()!==o.type.toLowerCase()&&c.push(`audio codec "${g.type}" !== "${o.type}"`)}c.length&&(h.excludeUntil=1/0,this.logger_(`excluding ${h.id}: ${c.join(" && ")}`))}})}updateAdCues_(e){let t=0;const r=this.seekable();r.length&&(t=r.start(0)),kx(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=Ge.GOAL_BUFFER_LENGTH,r=Ge.GOAL_BUFFER_LENGTH_RATE,s=Math.max(t,Ge.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*r,s)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=Ge.BUFFER_LOW_WATER_LINE,r=Ge.BUFFER_LOW_WATER_LINE_RATE,s=Math.max(t,Ge.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,Ge.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*r,this.bufferBasedABR?n:s)}bufferHighWaterLine(){return Ge.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){zd(this.inbandTextTracks_,"com.apple.streaming",this.tech_),fx({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,r){const s=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();zd(this.inbandTextTracks_,e,this.tech_),dx({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:s,videoDuration:r})}}const Jx=(i,e,t)=>r=>{const s=i.main.playlists[e],n=Ou(s),a=ma(s);return typeof r=="undefined"?a:(r?delete s.disabled:s.disabled=!0,r!==a&&!n&&(t(),r?i.trigger("renditionenabled"):i.trigger("renditiondisabled")),r)};class Zx{constructor(e,t,r){const{playlistController_:s}=e,n=s.fastQualityChange_.bind(s);if(t.attributes){const a=t.attributes.RESOLUTION;this.width=a&&a.width,this.height=a&&a.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=ms(s.main(),t),this.playlist=t,this.id=r,this.enabled=Jx(e.playlists,t.id,n)}}const e2=function(i){i.representations=()=>{const e=i.playlistController_.main(),t=Ps(e)?i.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(r=>!Ou(r)).map((r,s)=>new Zx(i,r,r.id)):[]}},sc=["seeking","seeked","pause","playing","error"];class t2{constructor(e){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.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=Nt("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),r=()=>this.monitorCurrentTime_(),s=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),a=this.playlistController_,o=["main","subtitle","audio"],l={};o.forEach(c=>{l[c]={reset:()=>this.resetSegmentDownloads_(c),updateend:()=>this.checkSegmentDownloads_(c)},a[`${c}SegmentLoader_`].on("appendsdone",l[c].updateend),a[`${c}SegmentLoader_`].on("playlistupdate",l[c].reset),this.tech_.on(["seeked","seeking"],l[c].reset)});const h=c=>{["main","audio"].forEach(p=>{a[`${p}SegmentLoader_`][c]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),h("off"))},this.clearSeekingAppendCheck_=()=>h("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),h("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",s),this.tech_.on(sc,n),this.tech_.on("canplay",r),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",s),this.tech_.off(sc,n),this.tech_.off("canplay",r),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),o.forEach(c=>{a[`${c}SegmentLoader_`].off("appendsdone",l[c].updateend),a[`${c}SegmentLoader_`].off("playlistupdate",l[c].reset),this.tech_.off(["seeked","seeking"],l[c].reset)}),this.checkCurrentTimeTimeout_&&R.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&R.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=R.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_,r=t[`${e}SegmentLoader_`],s=r.buffered_(),n=qy(this[`${e}Buffered_`],s);if(this[`${e}Buffered_`]=s,n){this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:r.playlist_&&r.playlist_.id,buffered:Mi(s)}),!(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+Ht>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const t=this.seekable(),r=this.tech_.currentTime(),s=this.afterSeekableWindow_(t,r,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let n;if(s&&(n=t.end(t.length-1)),this.beforeSeekableWindow_(t,r)){const g=t.start(0);n=g+(g===t.end(0)?0:Ht)}if(typeof n!="undefined")return this.logger_(`Trying to seek outside of seekable at time ${r} with seekable range ${Ef(t)}. Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0;const a=this.playlistController_.sourceUpdater_,o=this.tech_.buffered(),l=a.audioBuffer?a.audioBuffered():null,h=a.videoBuffer?a.videoBuffered():null,c=this.media(),p=c.partTargetDuration?c.partTargetDuration:(c.targetDuration-xi)*2,_=[l,h];for(let g=0;g<_.length;g++){if(!_[g])continue;if(Iu(_[g],r)<p)return!1}const E=cn(o,r);return E.length===0?!1:(n=E.start(0)+Ht,this.logger_(`Buffered region starts (${E.start(0)}) just beyond seek point (${r}). Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),r=rr(t,e);if(r.length&&e+3<=r.end(0)){this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${r.start(0)} -> ${r.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 o=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${o}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(o),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const r=this.tech_.vhs.playlistController_.sourceUpdater_,s=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:r.audioBuffered(),videoBuffered:r.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const a=cn(s,t);return a.length>0?(this.logger_(`Stopped at ${t} and seeking to ${a.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0):!1}afterSeekableWindow_(e,t,r,s=!1){if(!e.length)return!1;let n=e.end(e.length-1)+Ht;const a=!r.endList,o=typeof r.partTargetDuration=="number";return a&&(o||s)&&(n=e.end(e.length-1)+r.targetDuration*3),t>n}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:r}){if(!e)return;let s;if(e.length&&t.length){const n=rr(e,r-3),a=rr(e,r),o=rr(t,r);o.length&&!a.length&&n.length&&(s={start:n.end(0),end:o.end(0)})}else cn(e,r).length||(s=this.gapFromVideoUnderflow_(e,r));return s?(this.logger_(`Encountered a gap in video from ${s.start} to ${s.end}. Seeking to current time ${r}`),!0):!1}skipTheGap_(e){const t=this.tech_.buffered(),r=this.tech_.currentTime(),s=cn(t,r);this.resetTimeUpdate_(),!(s.length===0||r!==e)&&(this.logger_("skipTheGap_:","currentTime:",r,"scheduled currentTime:",e,"nextRange start:",s.start(0)),this.tech_.setCurrentTime(s.start(0)+xi),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}))}gapFromVideoUnderflow_(e,t){const r=$y(e);for(let s=0;s<r.length;s++){const n=r.start(s),a=r.end(s);if(t-n<4&&t-n>2)return{start:n,end:a}}return null}}const i2={errorInterval:30,getSource(i){const t=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return i(t)}},up=function(i,e){let t=0,r=0;const s=Se(i2,e);i.ready(()=>{i.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const n=function(){r&&i.currentTime(r)},a=function(c){c!=null&&(r=i.duration()!==1/0&&i.currentTime()||0,i.one("loadedmetadata",n),i.src(c),i.trigger({type:"usage",name:"vhs-error-reload"}),i.play())},o=function(){if(Date.now()-t<s.errorInterval*1e3){i.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!s.getSource||typeof s.getSource!="function"){G.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return t=Date.now(),s.getSource.call(i,a)},l=function(){i.off("loadedmetadata",n),i.off("error",o),i.off("dispose",l)},h=function(c){l(),up(i,c)};i.on("error",o),i.on("dispose",l),i.reloadSourceOnError=h},r2=function(i){up(this,i)};var lp="3.6.0",s2="7.0.0",n2="1.2.2",a2="7.1.0",o2="4.0.1";const Re={PlaylistLoader:sr,Playlist:ht,utils:_T,STANDARD_PLAYLIST_SELECTOR:Wd,INITIAL_PLAYLIST_SELECTOR:nx,lastBandwidthSelector:Wd,movingAverageBandwidthSelector:rx,comparePlaylistBandwidth:Bu,comparePlaylistResolution:ix,xhr:Ff()};Object.keys(Ge).forEach(i=>{Object.defineProperty(Re,i,{get(){return G.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),Ge[i]},set(e){if(G.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){G.log.warn(`value of Vhs.${i} must be greater than or equal to 0`);return}Ge[i]=e}})});const dp="videojs-vhs",cp=function(i,e){const t=e.media();let r=-1;for(let s=0;s<i.length;s++)if(i[s].id===t.id){r=s;break}i.selectedIndex_=r,i.trigger({selectedIndex:r,type:"change"})},u2=function(i,e){e.representations().forEach(t=>{i.addQualityLevel(t)}),cp(i,e.playlists)};Re.canPlaySource=function(){return G.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const l2=(i,e,t)=>{if(!i)return i;let r={};e&&e.attributes&&e.attributes.CODECS&&(r=Vn(jt(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(r.audio=t.attributes.CODECS);const s=gs(r.video),n=gs(r.audio),a={};for(const o in i)a[o]={},n&&(a[o].audioContentType=n),s&&(a[o].videoContentType=s),e.contentProtection&&e.contentProtection[o]&&e.contentProtection[o].pssh&&(a[o].pssh=e.contentProtection[o].pssh),typeof i[o]=="string"&&(a[o].url=i[o]);return Se(i,a)},d2=(i,e)=>i.reduce((t,r)=>{if(!r.contentProtection)return t;const s=e.reduce((n,a)=>{const o=r.contentProtection[a];return o&&o.pssh&&(n[a]={pssh:o.pssh}),n},{});return Object.keys(s).length&&t.push(s),t},[]),c2=({player:i,sourceKeySystems:e,audioMedia:t,mainPlaylists:r})=>{if(!i.eme.initializeMediaKeys)return Promise.resolve();const s=t?r.concat([t]):r,n=d2(s,Object.keys(e)),a=[],o=[];return n.forEach(l=>{o.push(new Promise((h,c)=>{i.tech_.one("keysessioncreated",h)})),a.push(new Promise((h,c)=>{i.eme.initializeMediaKeys({keySystems:l},p=>{if(p){c(p);return}h()})}))}),Promise.race([Promise.all(a),Promise.race(o)])},h2=({player:i,sourceKeySystems:e,media:t,audioMedia:r})=>{const s=l2(e,t,r);return s?(i.currentSource().keySystems=s,s&&!i.eme?(G.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},hp=()=>{if(!R.localStorage)return null;const i=R.localStorage.getItem(dp);if(!i)return null;try{return JSON.parse(i)}catch(e){return null}},f2=i=>{if(!R.localStorage)return!1;let e=hp();e=e?Se(e,i):i;try{R.localStorage.setItem(dp,JSON.stringify(e))}catch(t){return!1}return e},p2=i=>i.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(i.substring(i.indexOf(",")+1)):i,fp=(i,e)=>{i._requestCallbackSet||(i._requestCallbackSet=new Set),i._requestCallbackSet.add(e)},pp=(i,e)=>{i._responseCallbackSet||(i._responseCallbackSet=new Set),i._responseCallbackSet.add(e)},mp=(i,e)=>{!i._requestCallbackSet||(i._requestCallbackSet.delete(e),i._requestCallbackSet.size||delete i._requestCallbackSet)},gp=(i,e)=>{!i._responseCallbackSet||(i._responseCallbackSet.delete(e),i._responseCallbackSet.size||delete i._responseCallbackSet)};Re.supportsNativeHls=function(){if(!J||!J.createElement)return!1;const i=J.createElement("video");return G.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(i.canPlayType(t))}):!1}();Re.supportsNativeDash=function(){return!J||!J.createElement||!G.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(J.createElement("video").canPlayType("application/dash+xml"))}();Re.supportsTypeNatively=i=>i==="hls"?Re.supportsNativeHls:i==="dash"?Re.supportsNativeDash:!1;Re.isSupported=function(){return G.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};Re.xhr.onRequest=function(i){fp(Re.xhr,i)};Re.xhr.onResponse=function(i){pp(Re.xhr,i)};Re.xhr.offRequest=function(i){mp(Re.xhr,i)};Re.xhr.offResponse=function(i){gp(Re.xhr,i)};const m2=G.getComponent("Component");class _p extends m2{constructor(e,t,r){if(super(t,r.vhs),typeof r.initialBandwidth=="number"&&(this.options_.bandwidth=r.initialBandwidth),this.logger_=Nt("VhsHandler"),t.options_&&t.options_.playerId){const s=G.getPlayer(t.options_.playerId);this.player_=s}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(J,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],s=>{const n=J.fullscreenElement||J.webkitFullscreenElement||J.mozFullScreenElement||J.msFullscreenElement;n&&n.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_(){if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!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=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.calculateTimestampOffsetForEachSegment=this.options_.calculateTimestampOffsetForEachSegment||!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 e=hp();e&&e.bandwidth&&(this.options_.bandwidth=e.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),e&&e.throughput&&(this.options_.throughput=e.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Ge.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Ge.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","calculateTimestampOffsetForEachSegment","exactManifestTimings","leastPixelDiffSelector"].forEach(e=>{typeof this.source_[e]!="undefined"&&(this.options_[e]=this.source_[e])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=p2(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Re,this.options_.sourceType=_c(t),this.options_.seekTo=n=>{this.tech_.setCurrentTime(n)},this.playlistController_=new Qx(this.options_);const r=Se({liveRangeSafeTimeDelta:Ht},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new t2(r),this.playlistController_.on("error",()=>{const n=G.players[this.tech_.options_.playerId];let a=this.playlistController_.error;typeof a=="object"&&!a.code?a.code=3:typeof a=="string"&&(a={message:a,code:3}),n.error(a)});const s=this.options_.bufferBasedABR?Re.movingAverageBandwidthSelector(.55):Re.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):s.bind(this),this.playlistController_.selectInitialPlaylist=Re.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(n){this.playlistController_.selectPlaylist=n.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(n){this.playlistController_.mainSegmentLoader_.throughput.rate=n,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let n=this.playlistController_.mainSegmentLoader_.bandwidth;const a=R.navigator.connection||R.navigator.mozConnection||R.navigator.webkitConnection,o=1e7;if(this.options_.useNetworkInformationApi&&a){const l=a.downlink*1e3*1e3;l>=o&&n>=o?n=Math.max(n,l):n=l}return n},set(n){this.playlistController_.mainSegmentLoader_.bandwidth=n,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const n=1/(this.bandwidth||1);let a;return this.throughput>0?a=1/this.throughput:a=0,Math.floor(1/(n+a))},set(){G.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:()=>Mi(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:()=>Mi(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&&f2({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{e2(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_=R.URL.createObjectURL(this.playlistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),c2({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 keys 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=h2({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",r=>{if(r.status!=="output-restricted")return;const s=this.playlistController_.main();if(!s||!s.playlists)return;const n=[];s.playlists.forEach(a=>{a&&a.attributes&&a.attributes.RESOLUTION&&a.attributes.RESOLUTION.height>=720&&(!a.excludeUntil||a.excludeUntil<1/0)&&(a.excludeUntil=1/0,n.push(a))}),n.length&&(G.log.warn('DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.',...n),this.playlistController_.mainSegmentLoader_.resetEverything(),this.playlistController_.fastQualityChange_())}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=G.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{u2(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{cp(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":lp,"mux.js":s2,"mpd-parser":n2,"m3u8-parser":a2,"aes-decrypter":o2}}version(){return this.constructor.version()}canChangeType(){return ap.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_&&R.URL.revokeObjectURL&&(R.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return ST({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,r=!0,s=2){return Hf({programTime:e,playlist:this.playlistController_.media(),retryCount:s,pauseAfterSeek:r,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{fp(this.xhr,e)},this.xhr.onResponse=e=>{pp(this.xhr,e)},this.xhr.offRequest=e=>{mp(this.xhr,e)},this.xhr.offResponse=e=>{gp(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}}const qn={name:"videojs-http-streaming",VERSION:lp,canHandleSource(i,e={}){const t=Se(G.options,e);return qn.canPlayType(i.type,t)},handleSource(i,e,t={}){const r=Se(G.options,t);return e.vhs=new _p(i,e,r),e.vhs.xhr=Ff(),e.vhs.setupXhrHooks_(),e.vhs.src(i.src,i.type),e.vhs},canPlayType(i,e){const t=_c(i);if(!t)return"";const r=qn.getOverrideNative(e);return!Re.supportsTypeNatively(t)||r?"maybe":""},getOverrideNative(i={}){const{vhs:e={}}=i,t=!(G.browser.IS_ANY_SAFARI||G.browser.IS_IOS),{overrideNative:r=t}=e;return r}},g2=()=>pn("avc1.4d400d,mp4a.40.2");g2()&&G.getTech("Html5").registerSourceHandler(qn,0);G.VhsHandler=_p;G.VhsSourceHandler=qn;G.Vhs=Re;G.use||G.registerComponent("Vhs",Re);G.options.vhs=G.options.vhs||{};(!G.getPlugin||!G.getPlugin("reloadSourceOnError"))&&G.registerPlugin("reloadSourceOnError",r2);const _2=Wn({__name:"m3up",props:{url:{type:String,default:""}},setup(i){const e=i,t=nr(null),r=nr(null);Oo(()=>{s()});function s(){const n=e.url;n&&(r.value=G(t.value,{controls:!1,autoplay:!0,muted:!0,width:"100%",height:"100%",sources:[{src:n,type:"application/x-mpegURL"}]}),r.value&&r.value.on("play",()=>{}))}return Po(()=>{var n;r.value&&((n=r.value)==null||n.dispose())}),(n,a)=>(Ri(),yn("video",{ref_key:"videoRef",ref:t,class:"w-full h-full myvideo",autoplay:"",controls:""},null,512))}});var vp={exports:{}};(function(i,e){(function(r,s){i.exports=s()})(self,function(){return function(){var t={"./node_modules/es6-promise/dist/es6-promise.js":function(a,o,l){/*!
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
* @version v4.2.8+1e68dce6
*/(function(h,c){a.exports=c()})(this,function(){function h(W){var Z=typeof W;return W!==null&&(Z==="object"||Z==="function")}function c(W){return typeof W=="function"}var p=void 0;Array.isArray?p=Array.isArray:p=function(W){return Object.prototype.toString.call(W)==="[object Array]"};var _=p,E=0,g=void 0,b=void 0,C=function(Z,Y){N[E]=Z,N[E+1]=Y,E+=2,E===2&&(b?b($):q())};function x(W){b=W}function y(W){C=W}var D=typeof window!="undefined"?window:void 0,S=D||{},v=S.MutationObserver||S.WebKitMutationObserver,w=typeof self=="undefined"&&typeof process!="undefined"&&{}.toString.call(process)==="[object process]",L=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function O(){return function(){return process.nextTick($)}}function F(){return typeof g!="undefined"?function(){g($)}:B()}function V(){var W=0,Z=new v($),Y=document.createTextNode("");return Z.observe(Y,{characterData:!0}),function(){Y.data=W=++W%2}}function U(){var W=new MessageChannel;return W.port1.onmessage=$,function(){return W.port2.postMessage(0)}}function B(){var W=setTimeout;return function(){return W($,1)}}var N=new Array(1e3);function $(){for(var W=0;W<E;W+=2){var Z=N[W],Y=N[W+1];Z(Y),N[W]=void 0,N[W+1]=void 0}E=0}function K(){try{var W=Function("return this")().require("vertx");return g=W.runOnLoop||W.runOnContext,F()}catch(Z){return B()}}var q=void 0;w?q=O():v?q=V():L?q=U():D===void 0?q=K():q=B();function Q(W,Z){var Y=this,ie=new this.constructor(se);ie[le]===void 0&&ve(ie);var ce=Y._state;if(ce){var ge=arguments[ce-1];C(function(){return ei(ce,ie,ge,Y._result)})}else et(Y,ie,W,Z);return ie}function oe(W){var Z=this;if(W&&typeof W=="object"&&W.constructor===Z)return W;var Y=new Z(se);return Ze(Y,W),Y}var le=Math.random().toString(36).substring(2);function se(){}var pe=void 0,Te=1,ae=2;function _e(){return new TypeError("You cannot resolve a promise with itself")}function gt(){return new TypeError("A promises callback cannot return that same promise.")}function xe(W,Z,Y,ie){try{W.call(Z,Y,ie)}catch(ce){return ce}}function De(W,Z,Y){C(function(ie){var ce=!1,ge=xe(Y,Z,function(Ue){ce||(ce=!0,Z!==Ue?Ze(ie,Ue):Ce(ie,Ue))},function(Ue){ce||(ce=!0,ue(ie,Ue))},"Settle: "+(ie._label||" unknown promise"));!ce&&ge&&(ce=!0,ue(ie,ge))},W)}function ut(W,Z){Z._state===Te?Ce(W,Z._result):Z._state===ae?ue(W,Z._result):et(Z,void 0,function(Y){return Ze(W,Y)},function(Y){return ue(W,Y)})}function Ve(W,Z,Y){Z.constructor===W.constructor&&Y===Q&&Z.constructor.resolve===oe?ut(W,Z):Y===void 0?Ce(W,Z):c(Y)?De(W,Z,Y):Ce(W,Z)}function Ze(W,Z){if(W===Z)ue(W,_e());else if(h(Z)){var Y=void 0;try{Y=Z.then}catch(ie){ue(W,ie);return}Ve(W,Z,Y)}else Ce(W,Z)}function It(W){W._onerror&&W._onerror(W._result),bt(W)}function Ce(W,Z){W._state===pe&&(W._result=Z,W._state=Te,W._subscribers.length!==0&&C(bt,W))}function ue(W,Z){W._state===pe&&(W._state=ae,W._result=Z,C(It,W))}function et(W,Z,Y,ie){var ce=W._subscribers,ge=ce.length;W._onerror=null,ce[ge]=Z,ce[ge+Te]=Y,ce[ge+ae]=ie,ge===0&&W._state&&C(bt,W)}function bt(W){var Z=W._subscribers,Y=W._state;if(Z.length!==0){for(var ie=void 0,ce=void 0,ge=W._result,Ue=0;Ue<Z.length;Ue+=3)ie=Z[Ue],ce=Z[Ue+Y],ie?ei(Y,ie,ce,ge):ce(ge);W._subscribers.length=0}}function ei(W,Z,Y,ie){var ce=c(Y),ge=void 0,Ue=void 0,mi=!0;if(ce){try{ge=Y(ie)}catch(Hi){mi=!1,Ue=Hi}if(Z===ge){ue(Z,gt());return}}else ge=ie;Z._state!==pe||(ce&&mi?Ze(Z,ge):mi===!1?ue(Z,Ue):W===Te?Ce(Z,ge):W===ae&&ue(Z,ge))}function kt(W,Z){try{Z(function(ie){Ze(W,ie)},function(ie){ue(W,ie)})}catch(Y){ue(W,Y)}}var ze=0;function Ft(){return ze++}function ve(W){W[le]=ze++,W._state=void 0,W._result=void 0,W._subscribers=[]}function Et(){return new Error("Array Methods must be provided an Array")}var Xe=function(){function W(Z,Y){this._instanceConstructor=Z,this.promise=new Z(se),this.promise[le]||ve(this.promise),_(Y)?(this.length=Y.length,this._remaining=Y.length,this._result=new Array(this.length),this.length===0?Ce(this.promise,this._result):(this.length=this.length||0,this._enumerate(Y),this._remaining===0&&Ce(this.promise,this._result))):ue(this.promise,Et())}return W.prototype._enumerate=function(Y){for(var ie=0;this._state===pe&&ie<Y.length;ie++)this._eachEntry(Y[ie],ie)},W.prototype._eachEntry=function(Y,ie){var ce=this._instanceConstructor,ge=ce.resolve;if(ge===oe){var Ue=void 0,mi=void 0,Hi=!1;try{Ue=Y.then}catch(Mr){Hi=!0,mi=Mr}if(Ue===Q&&Y._state!==pe)this._settledAt(Y._state,ie,Y._result);else if(typeof Ue!="function")this._remaining--,this._result[ie]=Y;else if(ce===He){var Rr=new ce(se);Hi?ue(Rr,mi):Ve(Rr,Y,Ue),this._willSettleAt(Rr,ie)}else this._willSettleAt(new ce(function(Mr){return Mr(Y)}),ie)}else this._willSettleAt(ge(Y),ie)},W.prototype._settledAt=function(Y,ie,ce){var ge=this.promise;ge._state===pe&&(this._remaining--,Y===ae?ue(ge,ce):this._result[ie]=ce),this._remaining===0&&Ce(ge,this._result)},W.prototype._willSettleAt=function(Y,ie){var ce=this;et(Y,void 0,function(ge){return ce._settledAt(Te,ie,ge)},function(ge){return ce._settledAt(ae,ie,ge)})},W}();function Si(W){return new Xe(this,W).promise}function pi(W){var Z=this;return _(W)?new Z(function(Y,ie){for(var ce=W.length,ge=0;ge<ce;ge++)Z.resolve(W[ge]).then(Y,ie)}):new Z(function(Y,ie){return ie(new TypeError("You must pass an array to race."))})}function Or(W){var Z=this,Y=new Z(se);return ue(Y,W),Y}function Pr(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function $i(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var He=function(){function W(Z){this[le]=Ft(),this._result=this._state=void 0,this._subscribers=[],se!==Z&&(typeof Z!="function"&&Pr(),this instanceof W?kt(this,Z):$i())}return W.prototype.catch=function(Y){return this.then(null,Y)},W.prototype.finally=function(Y){var ie=this,ce=ie.constructor;return c(Y)?ie.then(function(ge){return ce.resolve(Y()).then(function(){return ge})},function(ge){return ce.resolve(Y()).then(function(){throw ge})}):ie.then(Y,Y)},W}();He.prototype.then=Q,He.all=Si,He.race=pi,He.resolve=oe,He.reject=Or,He._setScheduler=x,He._setAsap=y,He._asap=C;function Rs(){var W=void 0;if(typeof l.g!="undefined")W=l.g;else if(typeof self!="undefined")W=self;else try{W=Function("return this")()}catch(ie){throw new Error("polyfill failed because global object is unavailable in this environment")}var Z=W.Promise;if(Z){var Y=null;try{Y=Object.prototype.toString.call(Z.resolve())}catch(ie){}if(Y==="[object Promise]"&&!Z.cast)return}W.Promise=He}return He.polyfill=Rs,He.Promise=He,He})},"./node_modules/events/events.js":function(a){var o=typeof Reflect=="object"?Reflect:null,l=o&&typeof o.apply=="function"?o.apply:function(B,N,$){return Function.prototype.apply.call(B,N,$)},h;o&&typeof o.ownKeys=="function"?h=o.ownKeys:Object.getOwnPropertySymbols?h=function(B){return Object.getOwnPropertyNames(B).concat(Object.getOwnPropertySymbols(B))}:h=function(B){return Object.getOwnPropertyNames(B)};function c(U){console&&console.warn&&console.warn(U)}var p=Number.isNaN||function(B){return B!==B};function _(){_.init.call(this)}a.exports=_,a.exports.once=O,_.EventEmitter=_,_.prototype._events=void 0,_.prototype._eventsCount=0,_.prototype._maxListeners=void 0;var E=10;function g(U){if(typeof U!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof U)}Object.defineProperty(_,"defaultMaxListeners",{enumerable:!0,get:function(){return E},set:function(U){if(typeof U!="number"||U<0||p(U))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+U+".");E=U}}),_.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},_.prototype.setMaxListeners=function(B){if(typeof B!="number"||B<0||p(B))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+B+".");return this._maxListeners=B,this};function b(U){return U._maxListeners===void 0?_.defaultMaxListeners:U._maxListeners}_.prototype.getMaxListeners=function(){return b(this)},_.prototype.emit=function(B){for(var N=[],$=1;$<arguments.length;$++)N.push(arguments[$]);var K=B==="error",q=this._events;if(q!==void 0)K=K&&q.error===void 0;else if(!K)return!1;if(K){var Q;if(N.length>0&&(Q=N[0]),Q instanceof Error)throw Q;var oe=new Error("Unhandled error."+(Q?" ("+Q.message+")":""));throw oe.context=Q,oe}var le=q[B];if(le===void 0)return!1;if(typeof le=="function")l(le,this,N);else for(var se=le.length,pe=v(le,se),$=0;$<se;++$)l(pe[$],this,N);return!0};function C(U,B,N,$){var K,q,Q;if(g(N),q=U._events,q===void 0?(q=U._events=Object.create(null),U._eventsCount=0):(q.newListener!==void 0&&(U.emit("newListener",B,N.listener?N.listener:N),q=U._events),Q=q[B]),Q===void 0)Q=q[B]=N,++U._eventsCount;else if(typeof Q=="function"?Q=q[B]=$?[N,Q]:[Q,N]:$?Q.unshift(N):Q.push(N),K=b(U),K>0&&Q.length>K&&!Q.warned){Q.warned=!0;var oe=new Error("Possible EventEmitter memory leak detected. "+Q.length+" "+String(B)+" listeners added. Use emitter.setMaxListeners() to increase limit");oe.name="MaxListenersExceededWarning",oe.emitter=U,oe.type=B,oe.count=Q.length,c(oe)}return U}_.prototype.addListener=function(B,N){return C(this,B,N,!1)},_.prototype.on=_.prototype.addListener,_.prototype.prependListener=function(B,N){return C(this,B,N,!0)};function x(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function y(U,B,N){var $={fired:!1,wrapFn:void 0,target:U,type:B,listener:N},K=x.bind($);return K.listener=N,$.wrapFn=K,K}_.prototype.once=function(B,N){return g(N),this.on(B,y(this,B,N)),this},_.prototype.prependOnceListener=function(B,N){return g(N),this.prependListener(B,y(this,B,N)),this},_.prototype.removeListener=function(B,N){var $,K,q,Q,oe;if(g(N),K=this._events,K===void 0)return this;if($=K[B],$===void 0)return this;if($===N||$.listener===N)--this._eventsCount===0?this._events=Object.create(null):(delete K[B],K.removeListener&&this.emit("removeListener",B,$.listener||N));else if(typeof $!="function"){for(q=-1,Q=$.length-1;Q>=0;Q--)if($[Q]===N||$[Q].listener===N){oe=$[Q].listener,q=Q;break}if(q<0)return this;q===0?$.shift():w($,q),$.length===1&&(K[B]=$[0]),K.removeListener!==void 0&&this.emit("removeListener",B,oe||N)}return this},_.prototype.off=_.prototype.removeListener,_.prototype.removeAllListeners=function(B){var N,$,K;if($=this._events,$===void 0)return this;if($.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):$[B]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete $[B]),this;if(arguments.length===0){var q=Object.keys($),Q;for(K=0;K<q.length;++K)Q=q[K],Q!=="removeListener"&&this.removeAllListeners(Q);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(N=$[B],typeof N=="function")this.removeListener(B,N);else if(N!==void 0)for(K=N.length-1;K>=0;K--)this.removeListener(B,N[K]);return this};function D(U,B,N){var $=U._events;if($===void 0)return[];var K=$[B];return K===void 0?[]:typeof K=="function"?N?[K.listener||K]:[K]:N?L(K):v(K,K.length)}_.prototype.listeners=function(B){return D(this,B,!0)},_.prototype.rawListeners=function(B){return D(this,B,!1)},_.listenerCount=function(U,B){return typeof U.listenerCount=="function"?U.listenerCount(B):S.call(U,B)},_.prototype.listenerCount=S;function S(U){var B=this._events;if(B!==void 0){var N=B[U];if(typeof N=="function")return 1;if(N!==void 0)return N.length}return 0}_.prototype.eventNames=function(){return this._eventsCount>0?h(this._events):[]};function v(U,B){for(var N=new Array(B),$=0;$<B;++$)N[$]=U[$];return N}function w(U,B){for(;B+1<U.length;B++)U[B]=U[B+1];U.pop()}function L(U){for(var B=new Array(U.length),N=0;N<B.length;++N)B[N]=U[N].listener||U[N];return B}function O(U,B){return new Promise(function(N,$){function K(Q){U.removeListener(B,q),$(Q)}function q(){typeof U.removeListener=="function"&&U.removeListener("error",K),N([].slice.call(arguments))}V(U,B,q,{once:!0}),B!=="error"&&F(U,K,{once:!0})})}function F(U,B,N){typeof U.on=="function"&&V(U,"error",B,N)}function V(U,B,N,$){if(typeof U.on=="function")$.once?U.once(B,N):U.on(B,N);else if(typeof U.addEventListener=="function")U.addEventListener(B,function K(q){$.once&&U.removeEventListener(B,K),N(q)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof U)}},"./node_modules/webworkify-webpack/index.js":function(a,o,l){function h(x){var y={};function D(v){if(y[v])return y[v].exports;var w=y[v]={i:v,l:!1,exports:{}};return x[v].call(w.exports,w,w.exports,D),w.l=!0,w.exports}D.m=x,D.c=y,D.i=function(v){return v},D.d=function(v,w,L){D.o(v,w)||Object.defineProperty(v,w,{configurable:!1,enumerable:!0,get:L})},D.r=function(v){Object.defineProperty(v,"__esModule",{value:!0})},D.n=function(v){var w=v&&v.__esModule?function(){return v.default}:function(){return v};return D.d(w,"a",w),w},D.o=function(v,w){return Object.prototype.hasOwnProperty.call(v,w)},D.p="/",D.oe=function(v){throw console.error(v),v};var S=D(D.s=ENTRY_MODULE);return S.default||S}var c="[\\.|\\-|\\+|\\w|/|@]+",p="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+c+").*?\\)";function _(x){return(x+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function E(x){return!isNaN(1*x)}function g(x,y,D){var S={};S[D]=[];var v=y.toString(),w=v.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!w)return S;for(var L=w[1],O=new RegExp("(\\\\n|\\W)"+_(L)+p,"g"),F;F=O.exec(v);)F[3]!=="dll-reference"&&S[D].push(F[3]);for(O=new RegExp("\\("+_(L)+'\\("(dll-reference\\s('+c+'))"\\)\\)'+p,"g");F=O.exec(v);)x[F[2]]||(S[D].push(F[1]),x[F[2]]=l(F[1]).m),S[F[2]]=S[F[2]]||[],S[F[2]].push(F[4]);for(var V=Object.keys(S),U=0;U<V.length;U++)for(var B=0;B<S[V[U]].length;B++)E(S[V[U]][B])&&(S[V[U]][B]=1*S[V[U]][B]);return S}function b(x){var y=Object.keys(x);return y.reduce(function(D,S){return D||x[S].length>0},!1)}function C(x,y){for(var D={main:[y]},S={main:[]},v={main:{}};b(D);)for(var w=Object.keys(D),L=0;L<w.length;L++){var O=w[L],F=D[O],V=F.pop();if(v[O]=v[O]||{},!(v[O][V]||!x[O][V])){v[O][V]=!0,S[O]=S[O]||[],S[O].push(V);for(var U=g(x,x[O][V],O),B=Object.keys(U),N=0;N<B.length;N++)D[B[N]]=D[B[N]]||[],D[B[N]]=D[B[N]].concat(U[B[N]])}}return S}a.exports=function(x,y){y=y||{};var D={main:l.m},S=y.all?{main:Object.keys(D.main)}:C(D,x),v="";Object.keys(S).filter(function(V){return V!=="main"}).forEach(function(V){for(var U=0;S[V][U];)U++;S[V].push(U),D[V][U]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",v=v+"var "+V+" = ("+h.toString().replace("ENTRY_MODULE",JSON.stringify(U))+")({"+S[V].map(function(B){return""+JSON.stringify(B)+": "+D[V][B].toString()}).join(",")+`});
`}),v=v+"new (("+h.toString().replace("ENTRY_MODULE",JSON.stringify(x))+")({"+S.main.map(function(V){return""+JSON.stringify(V)+": "+D.main[V].toString()}).join(",")+"}))(self);";var w=new window.Blob([v],{type:"text/javascript"});if(y.bare)return w;var L=window.URL||window.webkitURL||window.mozURL||window.msURL,O=L.createObjectURL(w),F=new window.Worker(O);return F.objectURL=O,F}},"./src/config.js":function(a,o,l){l.r(o),l.d(o,{defaultConfig:function(){return h},createDefaultConfig:function(){return c}});var h={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:3*60,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:3*60,autoCleanupMinBackwardDuration:2*60,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0};function c(){return Object.assign({},h)}},"./src/core/features.js":function(a,o,l){l.r(o);var h=l("./src/io/io-controller.js"),c=l("./src/config.js"),p=function(){function _(){}return _.supportMSEH264Playback=function(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')},_.supportNetworkStreamIO=function(){var E=new h.default({},(0,c.createDefaultConfig)()),g=E.loaderType;return E.destroy(),g=="fetch-stream-loader"||g=="xhr-moz-chunked-loader"},_.getNetworkLoaderTypeName=function(){var E=new h.default({},(0,c.createDefaultConfig)()),g=E.loaderType;return E.destroy(),g},_.supportNativeMediaPlayback=function(E){_.videoElement==null&&(_.videoElement=window.document.createElement("video"));var g=_.videoElement.canPlayType(E);return g==="probably"||g=="maybe"},_.getFeatureList=function(){var E={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return E.mseFlvPlayback=_.supportMSEH264Playback(),E.networkStreamIO=_.supportNetworkStreamIO(),E.networkLoaderName=_.getNetworkLoaderTypeName(),E.mseLiveFlvPlayback=E.mseFlvPlayback&&E.networkStreamIO,E.nativeMP4H264Playback=_.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),E.nativeWebmVP8Playback=_.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),E.nativeWebmVP9Playback=_.supportNativeMediaPlayback('video/webm; codecs="vp9"'),E},_}();o.default=p},"./src/core/media-info.js":function(a,o,l){l.r(o);var h=function(){function c(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return c.prototype.isComplete=function(){var p=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,_=this.hasVideo===!1||this.hasVideo===!0&&this.videoCodec!=null&&this.width!=null&&this.height!=null&&this.fps!=null&&this.profile!=null&&this.level!=null&&this.refFrames!=null&&this.chromaFormat!=null&&this.sarNum!=null&&this.sarDen!=null;return this.mimeType!=null&&this.duration!=null&&this.metadata!=null&&this.hasKeyframesIndex!=null&&p&&_},c.prototype.isSeekable=function(){return this.hasKeyframesIndex===!0},c.prototype.getNearestKeyframe=function(p){if(this.keyframesIndex==null)return null;var _=this.keyframesIndex,E=this._search(_.times,p);return{index:E,milliseconds:_.times[E],fileposition:_.filepositions[E]}},c.prototype._search=function(p,_){var E=0,g=p.length-1,b=0,C=0,x=g;for(_<p[0]&&(E=0,C=x+1);C<=x;)if(b=C+Math.floor((x-C)/2),b===g||_>=p[b]&&_<p[b+1]){E=b;break}else p[b]<_?C=b+1:x=b-1;return E},c}();o.default=h},"./src/core/media-segment-info.js":function(a,o,l){l.r(o),l.d(o,{SampleInfo:function(){return h},MediaSegmentInfo:function(){return c},IDRSampleList:function(){return p},MediaSegmentInfoList:function(){return _}});var h=function(){function E(g,b,C,x,y){this.dts=g,this.pts=b,this.duration=C,this.originalDts=x,this.isSyncPoint=y,this.fileposition=null}return E}(),c=function(){function E(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return E.prototype.appendSyncPoint=function(g){g.isSyncPoint=!0,this.syncPoints.push(g)},E}(),p=function(){function E(){this._list=[]}return E.prototype.clear=function(){this._list=[]},E.prototype.appendArray=function(g){var b=this._list;g.length!==0&&(b.length>0&&g[0].originalDts<b[b.length-1].originalDts&&this.clear(),Array.prototype.push.apply(b,g))},E.prototype.getLastSyncPointBeforeDts=function(g){if(this._list.length==0)return null;var b=this._list,C=0,x=b.length-1,y=0,D=0,S=x;for(g<b[0].dts&&(C=0,D=S+1);D<=S;)if(y=D+Math.floor((S-D)/2),y===x||g>=b[y].dts&&g<b[y+1].dts){C=y;break}else b[y].dts<g?D=y+1:S=y-1;return this._list[C]},E}(),_=function(){function E(g){this._type=g,this._list=[],this._lastAppendLocation=-1}return Object.defineProperty(E.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"length",{get:function(){return this._list.length},enumerable:!1,configurable:!0}),E.prototype.isEmpty=function(){return this._list.length===0},E.prototype.clear=function(){this._list=[],this._lastAppendLocation=-1},E.prototype._searchNearestSegmentBefore=function(g){var b=this._list;if(b.length===0)return-2;var C=b.length-1,x=0,y=0,D=C,S=0;if(g<b[0].originalBeginDts)return S=-1,S;for(;y<=D;)if(x=y+Math.floor((D-y)/2),x===C||g>b[x].lastSample.originalDts&&g<b[x+1].originalBeginDts){S=x;break}else b[x].originalBeginDts<g?y=x+1:D=x-1;return S},E.prototype._searchNearestSegmentAfter=function(g){return this._searchNearestSegmentBefore(g)+1},E.prototype.append=function(g){var b=this._list,C=g,x=this._lastAppendLocation,y=0;x!==-1&&x<b.length&&C.originalBeginDts>=b[x].lastSample.originalDts&&(x===b.length-1||x<b.length-1&&C.originalBeginDts<b[x+1].originalBeginDts)?y=x+1:b.length>0&&(y=this._searchNearestSegmentBefore(C.originalBeginDts)+1),this._lastAppendLocation=y,this._list.splice(y,0,C)},E.prototype.getLastSegmentBefore=function(g){var b=this._searchNearestSegmentBefore(g);return b>=0?this._list[b]:null},E.prototype.getLastSampleBefore=function(g){var b=this.getLastSegmentBefore(g);return b!=null?b.lastSample:null},E.prototype.getLastSyncPointBefore=function(g){for(var b=this._searchNearestSegmentBefore(g),C=this._list[b].syncPoints;C.length===0&&b>0;)b--,C=this._list[b].syncPoints;return C.length>0?C[C.length-1]:null},E}()},"./src/core/mse-controller.js":function(a,o,l){l.r(o);var h=l("./node_modules/events/events.js"),c=l.n(h),p=l("./src/utils/logger.js"),_=l("./src/utils/browser.js"),E=l("./src/core/mse-events.js"),g=l("./src/core/media-segment-info.js"),b=l("./src/utils/exception.js"),C=function(){function x(y){this.TAG="MSEController",this._config=y,this._emitter=new(c()),this._config.isLive&&this._config.autoCleanupSourceBuffer==null&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new g.IDRSampleList}return x.prototype.destroy=function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null},x.prototype.on=function(y,D){this._emitter.addListener(y,D)},x.prototype.off=function(y,D){this._emitter.removeListener(y,D)},x.prototype.attachMediaElement=function(y){if(this._mediaSource)throw new b.IllegalStateException("MediaSource has been attached to an HTMLMediaElement!");var D=this._mediaSource=new window.MediaSource;D.addEventListener("sourceopen",this.e.onSourceOpen),D.addEventListener("sourceended",this.e.onSourceEnded),D.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=y,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),y.src=this._mediaSourceObjectURL},x.prototype.detachMediaElement=function(){if(this._mediaSource){var y=this._mediaSource;for(var D in this._sourceBuffers){var S=this._pendingSegments[D];S.splice(0,S.length),this._pendingSegments[D]=null,this._pendingRemoveRanges[D]=null,this._lastInitSegments[D]=null;var v=this._sourceBuffers[D];if(v){if(y.readyState!=="closed"){try{y.removeSourceBuffer(v)}catch(w){p.default.e(this.TAG,w.message)}v.removeEventListener("error",this.e.onSourceBufferError),v.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[D]=null,this._sourceBuffers[D]=null}}if(y.readyState==="open")try{y.endOfStream()}catch(w){p.default.e(this.TAG,w.message)}y.removeEventListener("sourceopen",this.e.onSourceOpen),y.removeEventListener("sourceended",this.e.onSourceEnded),y.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)},x.prototype.appendInitSegment=function(y,D){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(y),this._pendingSegments[y.type].push(y);return}var S=y,v=""+S.container;S.codec&&S.codec.length>0&&(v+=";codecs="+S.codec);var w=!1;if(p.default.v(this.TAG,"Received Initialization Segment, mimeType: "+v),this._lastInitSegments[S.type]=S,v!==this._mimeTypes[S.type]){if(this._mimeTypes[S.type])p.default.v(this.TAG,"Notice: "+S.type+" mimeType changed, origin: "+this._mimeTypes[S.type]+", target: "+v);else{w=!0;try{var L=this._sourceBuffers[S.type]=this._mediaSource.addSourceBuffer(v);L.addEventListener("error",this.e.onSourceBufferError),L.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(O){p.default.e(this.TAG,O.message),this._emitter.emit(E.default.ERROR,{code:O.code,msg:O.message});return}}this._mimeTypes[S.type]=v}D||this._pendingSegments[S.type].push(S),w||this._sourceBuffers[S.type]&&!this._sourceBuffers[S.type].updating&&this._doAppendSegments(),_.default.safari&&S.container==="audio/mpeg"&&S.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=S.mediaDuration/1e3,this._updateMediaSourceDuration())},x.prototype.appendMediaSegment=function(y){var D=y;this._pendingSegments[D.type].push(D),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var S=this._sourceBuffers[D.type];S&&!S.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()},x.prototype.seek=function(y){for(var D in this._sourceBuffers)if(!!this._sourceBuffers[D]){var S=this._sourceBuffers[D];if(this._mediaSource.readyState==="open")try{S.abort()}catch(V){p.default.e(this.TAG,V.message)}this._idrList.clear();var v=this._pendingSegments[D];if(v.splice(0,v.length),this._mediaSource.readyState!=="closed"){for(var w=0;w<S.buffered.length;w++){var L=S.buffered.start(w),O=S.buffered.end(w);this._pendingRemoveRanges[D].push({start:L,end:O})}if(S.updating||this._doRemoveRanges(),_.default.safari){var F=this._lastInitSegments[D];F&&(this._pendingSegments[D].push(F),S.updating||this._doAppendSegments())}}}},x.prototype.endOfStream=function(){var y=this._mediaSource,D=this._sourceBuffers;if(!y||y.readyState!=="open"){y&&y.readyState==="closed"&&this._hasPendingSegments()&&(this._hasPendingEos=!0);return}D.video&&D.video.updating||D.audio&&D.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,y.endOfStream())},x.prototype.getNearestKeyframe=function(y){return this._idrList.getLastSyncPointBeforeDts(y)},x.prototype._needCleanupSourceBuffer=function(){if(!this._config.autoCleanupSourceBuffer)return!1;var y=this._mediaElement.currentTime;for(var D in this._sourceBuffers){var S=this._sourceBuffers[D];if(S){var v=S.buffered;if(v.length>=1&&y-v.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1},x.prototype._doCleanupSourceBuffer=function(){var y=this._mediaElement.currentTime;for(var D in this._sourceBuffers){var S=this._sourceBuffers[D];if(S){for(var v=S.buffered,w=!1,L=0;L<v.length;L++){var O=v.start(L),F=v.end(L);if(O<=y&&y<F+3){if(y-O>=this._config.autoCleanupMaxBackwardDuration){w=!0;var V=y-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[D].push({start:O,end:V})}}else F<y&&(w=!0,this._pendingRemoveRanges[D].push({start:O,end:F}))}w&&!S.updating&&this._doRemoveRanges()}}},x.prototype._updateMediaSourceDuration=function(){var y=this._sourceBuffers;if(!(this._mediaElement.readyState===0||this._mediaSource.readyState!=="open")&&!(y.video&&y.video.updating||y.audio&&y.audio.updating)){var D=this._mediaSource.duration,S=this._pendingMediaDuration;S>0&&(isNaN(D)||S>D)&&(p.default.v(this.TAG,"Update MediaSource duration from "+D+" to "+S),this._mediaSource.duration=S),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},x.prototype._doRemoveRanges=function(){for(var y in this._pendingRemoveRanges)if(!(!this._sourceBuffers[y]||this._sourceBuffers[y].updating))for(var D=this._sourceBuffers[y],S=this._pendingRemoveRanges[y];S.length&&!D.updating;){var v=S.shift();D.remove(v.start,v.end)}},x.prototype._doAppendSegments=function(){var y=this._pendingSegments;for(var D in y)if(!(!this._sourceBuffers[D]||this._sourceBuffers[D].updating)&&y[D].length>0){var S=y[D].shift();if(S.timestampOffset){var v=this._sourceBuffers[D].timestampOffset,w=S.timestampOffset/1e3,L=Math.abs(v-w);L>.1&&(p.default.v(this.TAG,"Update MPEG audio timestampOffset from "+v+" to "+w),this._sourceBuffers[D].timestampOffset=w),delete S.timestampOffset}if(!S.data||S.data.byteLength===0)continue;try{this._sourceBuffers[D].appendBuffer(S.data),this._isBufferFull=!1,D==="video"&&S.hasOwnProperty("info")&&this._idrList.appendArray(S.info.syncPoints)}catch(O){this._pendingSegments[D].unshift(S),O.code===22?(this._isBufferFull||this._emitter.emit(E.default.BUFFER_FULL),this._isBufferFull=!0):(p.default.e(this.TAG,O.message),this._emitter.emit(E.default.ERROR,{code:O.code,msg:O.message}))}}},x.prototype._onSourceOpen=function(){if(p.default.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var y=this._pendingSourceBufferInit;y.length;){var D=y.shift();this.appendInitSegment(D,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(E.default.SOURCE_OPEN)},x.prototype._onSourceEnded=function(){p.default.v(this.TAG,"MediaSource onSourceEnded")},x.prototype._onSourceClose=function(){p.default.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&this.e!=null&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))},x.prototype._hasPendingSegments=function(){var y=this._pendingSegments;return y.video.length>0||y.audio.length>0},x.prototype._hasPendingRemoveRanges=function(){var y=this._pendingRemoveRanges;return y.video.length>0||y.audio.length>0},x.prototype._onSourceBufferUpdateEnd=function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(E.default.UPDATE_END)},x.prototype._onSourceBufferError=function(y){p.default.e(this.TAG,"SourceBuffer Error: "+y)},x}();o.default=C},"./src/core/mse-events.js":function(a,o,l){l.r(o);var h={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"};o.default=h},"./src/core/transmuxer.js":function(a,o,l){l.r(o);var h=l("./node_modules/events/events.js"),c=l.n(h),p=l("./node_modules/webworkify-webpack/index.js"),_=l.n(p),E=l("./src/utils/logger.js"),g=l("./src/utils/logging-control.js"),b=l("./src/core/transmuxing-controller.js"),C=l("./src/core/transmuxing-events.js"),x=l("./src/core/media-info.js"),y=function(){function D(S,v){if(this.TAG="Transmuxer",this._emitter=new(c()),v.enableWorker&&typeof Worker!="undefined")try{this._worker=_()("./src/core/transmuxing-worker.js"),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[S,v]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},g.default.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:g.default.getConfig()})}catch(L){E.default.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new b.default(S,v)}else this._controller=new b.default(S,v);if(this._controller){var w=this._controller;w.on(C.default.IO_ERROR,this._onIOError.bind(this)),w.on(C.default.DEMUX_ERROR,this._onDemuxError.bind(this)),w.on(C.default.INIT_SEGMENT,this._onInitSegment.bind(this)),w.on(C.default.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),w.on(C.default.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),w.on(C.default.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),w.on(C.default.MEDIA_INFO,this._onMediaInfo.bind(this)),w.on(C.default.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),w.on(C.default.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),w.on(C.default.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),w.on(C.default.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return D.prototype.destroy=function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),g.default.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null},D.prototype.on=function(S,v){this._emitter.addListener(S,v)},D.prototype.off=function(S,v){this._emitter.removeListener(S,v)},D.prototype.hasWorker=function(){return this._worker!=null},D.prototype.open=function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()},D.prototype.close=function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()},D.prototype.seek=function(S){this._worker?this._worker.postMessage({cmd:"seek",param:S}):this._controller.seek(S)},D.prototype.pause=function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()},D.prototype.resume=function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()},D.prototype._onInitSegment=function(S,v){var w=this;Promise.resolve().then(function(){w._emitter.emit(C.default.INIT_SEGMENT,S,v)})},D.prototype._onMediaSegment=function(S,v){var w=this;Promise.resolve().then(function(){w._emitter.emit(C.default.MEDIA_SEGMENT,S,v)})},D.prototype._onLoadingComplete=function(){var S=this;Promise.resolve().then(function(){S._emitter.emit(C.default.LOADING_COMPLETE)})},D.prototype._onRecoveredEarlyEof=function(){var S=this;Promise.resolve().then(function(){S._emitter.emit(C.default.RECOVERED_EARLY_EOF)})},D.prototype._onMediaInfo=function(S){var v=this;Promise.resolve().then(function(){v._emitter.emit(C.default.MEDIA_INFO,S)})},D.prototype._onMetaDataArrived=function(S){var v=this;Promise.resolve().then(function(){v._emitter.emit(C.default.METADATA_ARRIVED,S)})},D.prototype._onScriptDataArrived=function(S){var v=this;Promise.resolve().then(function(){v._emitter.emit(C.default.SCRIPTDATA_ARRIVED,S)})},D.prototype._onStatisticsInfo=function(S){var v=this;Promise.resolve().then(function(){v._emitter.emit(C.default.STATISTICS_INFO,S)})},D.prototype._onIOError=function(S,v){var w=this;Promise.resolve().then(function(){w._emitter.emit(C.default.IO_ERROR,S,v)})},D.prototype._onDemuxError=function(S,v){var w=this;Promise.resolve().then(function(){w._emitter.emit(C.default.DEMUX_ERROR,S,v)})},D.prototype._onRecommendSeekpoint=function(S){var v=this;Promise.resolve().then(function(){v._emitter.emit(C.default.RECOMMEND_SEEKPOINT,S)})},D.prototype._onLoggingConfigChanged=function(S){this._worker&&this._worker.postMessage({cmd:"logging_config",param:S})},D.prototype._onWorkerMessage=function(S){var v=S.data,w=v.data;if(v.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(v.msg){case C.default.INIT_SEGMENT:case C.default.MEDIA_SEGMENT:this._emitter.emit(v.msg,w.type,w.data);break;case C.default.LOADING_COMPLETE:case C.default.RECOVERED_EARLY_EOF:this._emitter.emit(v.msg);break;case C.default.MEDIA_INFO:Object.setPrototypeOf(w,x.default.prototype),this._emitter.emit(v.msg,w);break;case C.default.METADATA_ARRIVED:case C.default.SCRIPTDATA_ARRIVED:case C.default.STATISTICS_INFO:this._emitter.emit(v.msg,w);break;case C.default.IO_ERROR:case C.default.DEMUX_ERROR:this._emitter.emit(v.msg,w.type,w.info);break;case C.default.RECOMMEND_SEEKPOINT:this._emitter.emit(v.msg,w);break;case"logcat_callback":E.default.emitter.emit("log",w.type,w.logcat);break}},D}();o.default=y},"./src/core/transmuxing-controller.js":function(a,o,l){l.r(o);var h=l("./node_modules/events/events.js"),c=l.n(h),p=l("./src/utils/logger.js"),_=l("./src/utils/browser.js"),E=l("./src/core/media-info.js"),g=l("./src/demux/flv-demuxer.js"),b=l("./src/remux/mp4-remuxer.js"),C=l("./src/demux/demux-errors.js"),x=l("./src/io/io-controller.js"),y=l("./src/core/transmuxing-events.js"),D=function(){function S(v,w){this.TAG="TransmuxingController",this._emitter=new(c()),this._config=w,v.segments||(v.segments=[{duration:v.duration,filesize:v.filesize,url:v.url}]),typeof v.cors!="boolean"&&(v.cors=!0),typeof v.withCredentials!="boolean"&&(v.withCredentials=!1),this._mediaDataSource=v,this._currentSegmentIndex=0;var L=0;this._mediaDataSource.segments.forEach(function(O){O.timestampBase=L,L+=O.duration,O.cors=v.cors,O.withCredentials=v.withCredentials,w.referrerPolicy&&(O.referrerPolicy=w.referrerPolicy)}),!isNaN(L)&&this._mediaDataSource.duration!==L&&(this._mediaDataSource.duration=L),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return S.prototype.destroy=function(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null},S.prototype.on=function(v,w){this._emitter.addListener(v,w)},S.prototype.off=function(v,w){this._emitter.removeListener(v,w)},S.prototype.start=function(){this._loadSegment(0),this._enableStatisticsReporter()},S.prototype._loadSegment=function(v,w){this._currentSegmentIndex=v;var L=this._mediaDataSource.segments[v],O=this._ioctl=new x.default(L,this._config,v);O.onError=this._onIOException.bind(this),O.onSeeked=this._onIOSeeked.bind(this),O.onComplete=this._onIOComplete.bind(this),O.onRedirect=this._onIORedirect.bind(this),O.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),w?this._demuxer.bindDataSource(this._ioctl):O.onDataArrival=this._onInitChunkArrival.bind(this),O.open(w)},S.prototype.stop=function(){this._internalAbort(),this._disableStatisticsReporter()},S.prototype._internalAbort=function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)},S.prototype.pause=function(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())},S.prototype.resume=function(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())},S.prototype.seek=function(v){if(!(this._mediaInfo==null||!this._mediaInfo.isSeekable())){var w=this._searchSegmentIndexContains(v);if(w===this._currentSegmentIndex){var L=this._mediaInfo.segments[w];if(L==null)this._pendingSeekTime=v;else{var O=L.getNearestKeyframe(v);this._remuxer.seek(O.milliseconds),this._ioctl.seek(O.fileposition),this._pendingResolveSeekPoint=O.milliseconds}}else{var F=this._mediaInfo.segments[w];if(F==null)this._pendingSeekTime=v,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(w);else{var O=F.getNearestKeyframe(v);this._internalAbort(),this._remuxer.seek(v),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[w].timestampBase,this._loadSegment(w,O.fileposition),this._pendingResolveSeekPoint=O.milliseconds,this._reportSegmentMediaInfo(w)}}this._enableStatisticsReporter()}},S.prototype._searchSegmentIndexContains=function(v){for(var w=this._mediaDataSource.segments,L=w.length-1,O=0;O<w.length;O++)if(v<w[O].timestampBase){L=O-1;break}return L},S.prototype._onInitChunkArrival=function(v,w){var L=this,O=null,F=0;if(w>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,F=this._demuxer.parseChunks(v,w);else if((O=g.default.probe(v)).match){this._demuxer=new g.default(O,this._config),this._remuxer||(this._remuxer=new b.default(this._config));var V=this._mediaDataSource;V.duration!=null&&!isNaN(V.duration)&&(this._demuxer.overridedDuration=V.duration),typeof V.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=V.hasAudio),typeof V.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=V.hasVideo),this._demuxer.timestampBase=V.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),F=this._demuxer.parseChunks(v,w)}else O=null,p.default.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(function(){L._internalAbort()}),this._emitter.emit(y.default.DEMUX_ERROR,C.default.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),F=0;return F},S.prototype._onMediaInfo=function(v){var w=this;this._mediaInfo==null&&(this._mediaInfo=Object.assign({},v),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,E.default.prototype));var L=Object.assign({},v);Object.setPrototypeOf(L,E.default.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=L,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var O=w._pendingSeekTime;w._pendingSeekTime=null,w.seek(O)})},S.prototype._onMetaDataArrived=function(v){this._emitter.emit(y.default.METADATA_ARRIVED,v)},S.prototype._onScriptDataArrived=function(v){this._emitter.emit(y.default.SCRIPTDATA_ARRIVED,v)},S.prototype._onIOSeeked=function(){this._remuxer.insertDiscontinuity()},S.prototype._onIOComplete=function(v){var w=v,L=w+1;L<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment(L)):(this._remuxer.flushStashedSamples(),this._emitter.emit(y.default.LOADING_COMPLETE),this._disableStatisticsReporter())},S.prototype._onIORedirect=function(v){var w=this._ioctl.extraData;this._mediaDataSource.segments[w].redirectedURL=v},S.prototype._onIORecoveredEarlyEof=function(){this._emitter.emit(y.default.RECOVERED_EARLY_EOF)},S.prototype._onIOException=function(v,w){p.default.e(this.TAG,"IOException: type = "+v+", code = "+w.code+", msg = "+w.msg),this._emitter.emit(y.default.IO_ERROR,v,w),this._disableStatisticsReporter()},S.prototype._onDemuxException=function(v,w){p.default.e(this.TAG,"DemuxException: type = "+v+", info = "+w),this._emitter.emit(y.default.DEMUX_ERROR,v,w)},S.prototype._onRemuxerInitSegmentArrival=function(v,w){this._emitter.emit(y.default.INIT_SEGMENT,v,w)},S.prototype._onRemuxerMediaSegmentArrival=function(v,w){if(this._pendingSeekTime==null&&(this._emitter.emit(y.default.MEDIA_SEGMENT,v,w),this._pendingResolveSeekPoint!=null&&v==="video")){var L=w.info.syncPoints,O=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,_.default.safari&&L.length>0&&L[0].originalDts===O&&(O=L[0].pts),this._emitter.emit(y.default.RECOMMEND_SEEKPOINT,O)}},S.prototype._enableStatisticsReporter=function(){this._statisticsReporter==null&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))},S.prototype._disableStatisticsReporter=function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},S.prototype._reportSegmentMediaInfo=function(v){var w=this._mediaInfo.segments[v],L=Object.assign({},w);L.duration=this._mediaInfo.duration,L.segmentCount=this._mediaInfo.segmentCount,delete L.segments,delete L.keyframesIndex,this._emitter.emit(y.default.MEDIA_INFO,L)},S.prototype._reportStatisticsInfo=function(){var v={};v.url=this._ioctl.currentURL,v.hasRedirect=this._ioctl.hasRedirect,v.hasRedirect&&(v.redirectedURL=this._ioctl.currentRedirectedURL),v.speed=this._ioctl.currentSpeed,v.loaderType=this._ioctl.loaderType,v.currentSegmentIndex=this._currentSegmentIndex,v.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(y.default.STATISTICS_INFO,v)},S}();o.default=D},"./src/core/transmuxing-events.js":function(a,o,l){l.r(o);var h={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"};o.default=h},"./src/core/transmuxing-worker.js":function(a,o,l){l.r(o);var h=l("./src/utils/logging-control.js"),c=l("./src/utils/polyfill.js"),p=l("./src/core/transmuxing-controller.js"),_=l("./src/core/transmuxing-events.js"),E=function(g){var b=null,C=B.bind(this);c.default.install(),g.addEventListener("message",function(N){switch(N.data.cmd){case"init":b=new p.default(N.data.param[0],N.data.param[1]),b.on(_.default.IO_ERROR,F.bind(this)),b.on(_.default.DEMUX_ERROR,V.bind(this)),b.on(_.default.INIT_SEGMENT,x.bind(this)),b.on(_.default.MEDIA_SEGMENT,y.bind(this)),b.on(_.default.LOADING_COMPLETE,D.bind(this)),b.on(_.default.RECOVERED_EARLY_EOF,S.bind(this)),b.on(_.default.MEDIA_INFO,v.bind(this)),b.on(_.default.METADATA_ARRIVED,w.bind(this)),b.on(_.default.SCRIPTDATA_ARRIVED,L.bind(this)),b.on(_.default.STATISTICS_INFO,O.bind(this)),b.on(_.default.RECOMMEND_SEEKPOINT,U.bind(this));break;case"destroy":b&&(b.destroy(),b=null),g.postMessage({msg:"destroyed"});break;case"start":b.start();break;case"stop":b.stop();break;case"seek":b.seek(N.data.param);break;case"pause":b.pause();break;case"resume":b.resume();break;case"logging_config":{var $=N.data.param;h.default.applyConfig($),$.enableCallback===!0?h.default.addLogListener(C):h.default.removeLogListener(C);break}}});function x(N,$){var K={msg:_.default.INIT_SEGMENT,data:{type:N,data:$}};g.postMessage(K,[$.data])}function y(N,$){var K={msg:_.default.MEDIA_SEGMENT,data:{type:N,data:$}};g.postMessage(K,[$.data])}function D(){var N={msg:_.default.LOADING_COMPLETE};g.postMessage(N)}function S(){var N={msg:_.default.RECOVERED_EARLY_EOF};g.postMessage(N)}function v(N){var $={msg:_.default.MEDIA_INFO,data:N};g.postMessage($)}function w(N){var $={msg:_.default.METADATA_ARRIVED,data:N};g.postMessage($)}function L(N){var $={msg:_.default.SCRIPTDATA_ARRIVED,data:N};g.postMessage($)}function O(N){var $={msg:_.default.STATISTICS_INFO,data:N};g.postMessage($)}function F(N,$){g.postMessage({msg:_.default.IO_ERROR,data:{type:N,info:$}})}function V(N,$){g.postMessage({msg:_.default.DEMUX_ERROR,data:{type:N,info:$}})}function U(N){g.postMessage({msg:_.default.RECOMMEND_SEEKPOINT,data:N})}function B(N,$){g.postMessage({msg:"logcat_callback",data:{type:N,logcat:$}})}};o.default=E},"./src/demux/amf-parser.js":function(a,o,l){l.r(o);var h=l("./src/utils/logger.js"),c=l("./src/utils/utf8-conv.js"),p=l("./src/utils/exception.js"),_=function(){var g=new ArrayBuffer(2);return new DataView(g).setInt16(0,256,!0),new Int16Array(g)[0]===256}(),E=function(){function g(){}return g.parseScriptData=function(b,C,x){var y={};try{var D=g.parseValue(b,C,x),S=g.parseValue(b,C+D.size,x-D.size);y[D.data]=S.data}catch(v){h.default.e("AMF",v.toString())}return y},g.parseObject=function(b,C,x){if(x<3)throw new p.IllegalStateException("Data not enough when parse ScriptDataObject");var y=g.parseString(b,C,x),D=g.parseValue(b,C+y.size,x-y.size),S=D.objectEnd;return{data:{name:y.data,value:D.data},size:y.size+D.size,objectEnd:S}},g.parseVariable=function(b,C,x){return g.parseObject(b,C,x)},g.parseString=function(b,C,x){if(x<2)throw new p.IllegalStateException("Data not enough when parse String");var y=new DataView(b,C,x),D=y.getUint16(0,!_),S;return D>0?S=(0,c.default)(new Uint8Array(b,C+2,D)):S="",{data:S,size:2+D}},g.parseLongString=function(b,C,x){if(x<4)throw new p.IllegalStateException("Data not enough when parse LongString");var y=new DataView(b,C,x),D=y.getUint32(0,!_),S;return D>0?S=(0,c.default)(new Uint8Array(b,C+4,D)):S="",{data:S,size:4+D}},g.parseDate=function(b,C,x){if(x<10)throw new p.IllegalStateException("Data size invalid when parse Date");var y=new DataView(b,C,x),D=y.getFloat64(0,!_),S=y.getInt16(8,!_);return D+=S*60*1e3,{data:new Date(D),size:8+2}},g.parseValue=function(b,C,x){if(x<1)throw new p.IllegalStateException("Data not enough when parse Value");var y=new DataView(b,C,x),D=1,S=y.getUint8(0),v,w=!1;try{switch(S){case 0:v=y.getFloat64(1,!_),D+=8;break;case 1:{var L=y.getUint8(1);v=!!L,D+=1;break}case 2:{var O=g.parseString(b,C+1,x-1);v=O.data,D+=O.size;break}case 3:{v={};var F=0;for((y.getUint32(x-4,!_)&16777215)===9&&(F=3);D<x-4;){var V=g.parseObject(b,C+D,x-D-F);if(V.objectEnd)break;v[V.data.name]=V.data.value,D+=V.size}if(D<=x-3){var U=y.getUint32(D-1,!_)&16777215;U===9&&(D+=3)}break}case 8:{v={},D+=4;var F=0;for((y.getUint32(x-4,!_)&16777215)===9&&(F=3);D<x-8;){var B=g.parseVariable(b,C+D,x-D-F);if(B.objectEnd)break;v[B.data.name]=B.data.value,D+=B.size}if(D<=x-3){var U=y.getUint32(D-1,!_)&16777215;U===9&&(D+=3)}break}case 9:v=void 0,D=1,w=!0;break;case 10:{v=[];var N=y.getUint32(1,!_);D+=4;for(var $=0;$<N;$++){var K=g.parseValue(b,C+D,x-D);v.push(K.data),D+=K.size}break}case 11:{var q=g.parseDate(b,C+1,x-1);v=q.data,D+=q.size;break}case 12:{var Q=g.parseString(b,C+1,x-1);v=Q.data,D+=Q.size;break}default:D=x,h.default.w("AMF","Unsupported AMF value type "+S)}}catch(oe){h.default.e("AMF",oe.toString())}return{data:v,size:D,objectEnd:w}},g}();o.default=E},"./src/demux/demux-errors.js":function(a,o,l){l.r(o);var h={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"};o.default=h},"./src/demux/exp-golomb.js":function(a,o,l){l.r(o);var h=l("./src/utils/exception.js"),c=function(){function p(_){this.TAG="ExpGolomb",this._buffer=_,this._buffer_index=0,this._total_bytes=_.byteLength,this._total_bits=_.byteLength*8,this._current_word=0,this._current_word_bits_left=0}return p.prototype.destroy=function(){this._buffer=null},p.prototype._fillCurrentWord=function(){var _=this._total_bytes-this._buffer_index;if(_<=0)throw new h.IllegalStateException("ExpGolomb: _fillCurrentWord() but no bytes available");var E=Math.min(4,_),g=new Uint8Array(4);g.set(this._buffer.subarray(this._buffer_index,this._buffer_index+E)),this._current_word=new DataView(g.buffer).getUint32(0,!1),this._buffer_index+=E,this._current_word_bits_left=E*8},p.prototype.readBits=function(_){if(_>32)throw new h.InvalidArgumentException("ExpGolomb: readBits() bits exceeded max 32bits!");if(_<=this._current_word_bits_left){var E=this._current_word>>>32-_;return this._current_word<<=_,this._current_word_bits_left-=_,E}var g=this._current_word_bits_left?this._current_word:0;g=g>>>32-this._current_word_bits_left;var b=_-this._current_word_bits_left;this._fillCurrentWord();var C=Math.min(b,this._current_word_bits_left),x=this._current_word>>>32-C;return this._current_word<<=C,this._current_word_bits_left-=C,g=g<<C|x,g},p.prototype.readBool=function(){return this.readBits(1)===1},p.prototype.readByte=function(){return this.readBits(8)},p.prototype._skipLeadingZero=function(){var _;for(_=0;_<this._current_word_bits_left;_++)if((this._current_word&2147483648>>>_)!==0)return this._current_word<<=_,this._current_word_bits_left-=_,_;return this._fillCurrentWord(),_+this._skipLeadingZero()},p.prototype.readUEG=function(){var _=this._skipLeadingZero();return this.readBits(_+1)-1},p.prototype.readSEG=function(){var _=this.readUEG();return _&1?_+1>>>1:-1*(_>>>1)},p}();o.default=c},"./src/demux/flv-demuxer.js":function(a,o,l){l.r(o);var h=l("./src/utils/logger.js"),c=l("./src/demux/amf-parser.js"),p=l("./src/demux/sps-parser.js"),_=l("./src/demux/demux-errors.js"),E=l("./src/core/media-info.js"),g=l("./src/utils/exception.js");function b(x,y){return x[y]<<24|x[y+1]<<16|x[y+2]<<8|x[y+3]}var C=function(){function x(y,D){this.TAG="FLVDemuxer",this._config=D,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=y.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=y.hasAudioTrack,this._hasVideo=y.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new E.default,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var S=new ArrayBuffer(2);return new DataView(S).setInt16(0,256,!0),new Int16Array(S)[0]===256}()}return x.prototype.destroy=function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null},x.probe=function(y){var D=new Uint8Array(y),S={match:!1};if(D[0]!==70||D[1]!==76||D[2]!==86||D[3]!==1)return S;var v=(D[4]&4)>>>2!==0,w=(D[4]&1)!==0,L=b(D,5);return L<9?S:{match:!0,consumed:L,dataOffset:L,hasAudioTrack:v,hasVideoTrack:w}},x.prototype.bindDataSource=function(y){return y.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(x.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(y){this._onTrackMetadata=y},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(y){this._onMediaInfo=y},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(y){this._onMetaDataArrived=y},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(y){this._onScriptDataArrived=y},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onError",{get:function(){return this._onError},set:function(y){this._onError=y},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(y){this._onDataAvailable=y},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(y){this._timestampBase=y},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"overridedDuration",{get:function(){return this._duration},set:function(y){this._durationOverrided=!0,this._duration=y,this._mediaInfo.duration=y},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"overridedHasAudio",{set:function(y){this._hasAudioFlagOverrided=!0,this._hasAudio=y,this._mediaInfo.hasAudio=y},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"overridedHasVideo",{set:function(y){this._hasVideoFlagOverrided=!0,this._hasVideo=y,this._mediaInfo.hasVideo=y},enumerable:!1,configurable:!0}),x.prototype.resetMediaInfo=function(){this._mediaInfo=new E.default},x.prototype._isInitialMetadataDispatched=function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!this._hasAudio&&this._hasVideo?this._videoInitialMetadataDispatched:!1},x.prototype.parseChunks=function(y,D){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new g.IllegalStateException("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var S=0,v=this._littleEndian;if(D===0)if(y.byteLength>13){var w=x.probe(y);S=w.dataOffset}else return 0;if(this._firstParse){this._firstParse=!1,D+S!==this._dataOffset&&h.default.w(this.TAG,"First time parsing but chunk byteStart invalid!");var L=new DataView(y,S),O=L.getUint32(0,!v);O!==0&&h.default.w(this.TAG,"PrevTagSize0 !== 0 !!!"),S+=4}for(;S<y.byteLength;){this._dispatch=!0;var L=new DataView(y,S);if(S+11+4>y.byteLength)break;var F=L.getUint8(0),V=L.getUint32(0,!v)&16777215;if(S+11+V+4>y.byteLength)break;if(F!==8&&F!==9&&F!==18){h.default.w(this.TAG,"Unsupported tag type "+F+", skipped"),S+=11+V+4;continue}var U=L.getUint8(4),B=L.getUint8(5),N=L.getUint8(6),$=L.getUint8(7),K=N|B<<8|U<<16|$<<24,q=L.getUint32(7,!v)&16777215;q!==0&&h.default.w(this.TAG,"Meet tag which has StreamID != 0!");var Q=S+11;switch(F){case 8:this._parseAudioData(y,Q,V,K);break;case 9:this._parseVideoData(y,Q,V,K,D+S);break;case 18:this._parseScriptData(y,Q,V);break}var oe=L.getUint32(11+V,!v);oe!==11+V&&h.default.w(this.TAG,"Invalid PrevTagSize "+oe),S+=11+V+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),S},x.prototype._parseScriptData=function(y,D,S){var v=c.default.parseScriptData(y,D,S);if(v.hasOwnProperty("onMetaData")){if(v.onMetaData==null||typeof v.onMetaData!="object"){h.default.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&h.default.w(this.TAG,"Found another onMetaData tag!"),this._metadata=v;var w=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},w)),typeof w.hasAudio=="boolean"&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=w.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),typeof w.hasVideo=="boolean"&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=w.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),typeof w.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=w.audiodatarate),typeof w.videodatarate=="number"&&(this._mediaInfo.videoDataRate=w.videodatarate),typeof w.width=="number"&&(this._mediaInfo.width=w.width),typeof w.height=="number"&&(this._mediaInfo.height=w.height),typeof w.duration=="number"){if(!this._durationOverrided){var L=Math.floor(w.duration*this._timescale);this._duration=L,this._mediaInfo.duration=L}}else this._mediaInfo.duration=0;if(typeof w.framerate=="number"){var O=Math.floor(w.framerate*1e3);if(O>0){var F=O/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=F,this._referenceFrameRate.fps_num=O,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=F}}if(typeof w.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var V=w.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(V),w.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=w,h.default.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(v).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},v))},x.prototype._parseKeyframesIndex=function(y){for(var D=[],S=[],v=1;v<y.times.length;v++){var w=this._timestampBase+Math.floor(y.times[v]*1e3);D.push(w),S.push(y.filepositions[v])}return{times:D,filepositions:S}},x.prototype._parseAudioData=function(y,D,S,v){if(S<=1){h.default.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");return}if(!(this._hasAudioFlagOverrided===!0&&this._hasAudio===!1)){this._littleEndian;var w=new DataView(y,D,S),L=w.getUint8(0),O=L>>>4;if(O!==2&&O!==10){this._onError(_.default.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+O);return}var F=0,V=(L&12)>>>2;if(V>=0&&V<=4)F=this._flvSoundRateTable[V];else{this._onError(_.default.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+V);return}var U=L&1,B=this._audioMetadata,N=this._audioTrack;if(B||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),B=this._audioMetadata={},B.type="audio",B.id=N.id,B.timescale=this._timescale,B.duration=this._duration,B.audioSampleRate=F,B.channelCount=U===0?1:2),O===10){var $=this._parseAACAudioData(y,D+1,S-1);if($==null)return;if($.packetType===0){B.config&&h.default.w(this.TAG,"Found another AudioSpecificConfig!");var K=$.data;B.audioSampleRate=K.samplingRate,B.channelCount=K.channelCount,B.codec=K.codec,B.originalCodec=K.originalCodec,B.config=K.config,B.refSampleDuration=1024/B.audioSampleRate*B.timescale,h.default.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",B);var q=this._mediaInfo;q.audioCodec=B.originalCodec,q.audioSampleRate=B.audioSampleRate,q.audioChannelCount=B.channelCount,q.hasVideo?q.videoCodec!=null&&(q.mimeType='video/x-flv; codecs="'+q.videoCodec+","+q.audioCodec+'"'):q.mimeType='video/x-flv; codecs="'+q.audioCodec+'"',q.isComplete()&&this._onMediaInfo(q)}else if($.packetType===1){var Q=this._timestampBase+v,oe={unit:$.data,length:$.data.byteLength,dts:Q,pts:Q};N.samples.push(oe),N.length+=$.data.length}else h.default.e(this.TAG,"Flv: Unsupported AAC data type "+$.packetType)}else if(O===2){if(!B.codec){var K=this._parseMP3AudioData(y,D+1,S-1,!0);if(K==null)return;B.audioSampleRate=K.samplingRate,B.channelCount=K.channelCount,B.codec=K.codec,B.originalCodec=K.originalCodec,B.refSampleDuration=1152/B.audioSampleRate*B.timescale,h.default.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",B);var q=this._mediaInfo;q.audioCodec=B.codec,q.audioSampleRate=B.audioSampleRate,q.audioChannelCount=B.channelCount,q.audioDataRate=K.bitRate,q.hasVideo?q.videoCodec!=null&&(q.mimeType='video/x-flv; codecs="'+q.videoCodec+","+q.audioCodec+'"'):q.mimeType='video/x-flv; codecs="'+q.audioCodec+'"',q.isComplete()&&this._onMediaInfo(q)}var le=this._parseMP3AudioData(y,D+1,S-1,!1);if(le==null)return;var Q=this._timestampBase+v,se={unit:le,length:le.byteLength,dts:Q,pts:Q};N.samples.push(se),N.length+=le.length}}},x.prototype._parseAACAudioData=function(y,D,S){if(S<=1){h.default.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}var v={},w=new Uint8Array(y,D,S);return v.packetType=w[0],w[0]===0?v.data=this._parseAACAudioSpecificConfig(y,D+1,S-1):v.data=w.subarray(1),v},x.prototype._parseAACAudioSpecificConfig=function(y,D,S){var v=new Uint8Array(y,D,S),w=null,L=0,O=0,F=0,V=null;if(L=O=v[0]>>>3,F=(v[0]&7)<<1|v[1]>>>7,F<0||F>=this._mpegSamplingRates.length){this._onError(_.default.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}var U=this._mpegSamplingRates[F],B=(v[1]&120)>>>3;if(B<0||B>=8){this._onError(_.default.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}L===5&&(V=(v[1]&7)<<1|v[2]>>>7,(v[2]&124)>>>2);var N=self.navigator.userAgent.toLowerCase();return N.indexOf("firefox")!==-1?F>=6?(L=5,w=new Array(4),V=F-3):(L=2,w=new Array(2),V=F):N.indexOf("android")!==-1?(L=2,w=new Array(2),V=F):(L=5,V=F,w=new Array(4),F>=6?V=F-3:B===1&&(L=2,w=new Array(2),V=F)),w[0]=L<<3,w[0]|=(F&15)>>>1,w[1]=(F&15)<<7,w[1]|=(B&15)<<3,L===5&&(w[1]|=(V&15)>>>1,w[2]=(V&1)<<7,w[2]|=2<<2,w[3]=0),{config:w,samplingRate:U,channelCount:B,codec:"mp4a.40."+L,originalCodec:"mp4a.40."+O}},x.prototype._parseMP3AudioData=function(y,D,S,v){if(S<4){h.default.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}this._littleEndian;var w=new Uint8Array(y,D,S),L=null;if(v){if(w[0]!==255)return;var O=w[1]>>>3&3,F=(w[1]&6)>>1,V=(w[2]&240)>>>4,U=(w[2]&12)>>>2,B=w[3]>>>6&3,N=B!==3?2:1,$=0,K=0,q="mp3";switch(O){case 0:$=this._mpegAudioV25SampleRateTable[U];break;case 2:$=this._mpegAudioV20SampleRateTable[U];break;case 3:$=this._mpegAudioV10SampleRateTable[U];break}switch(F){case 1:V<this._mpegAudioL3BitRateTable.length&&(K=this._mpegAudioL3BitRateTable[V]);break;case 2:V<this._mpegAudioL2BitRateTable.length&&(K=this._mpegAudioL2BitRateTable[V]);break;case 3:V<this._mpegAudioL1BitRateTable.length&&(K=this._mpegAudioL1BitRateTable[V]);break}L={bitRate:K,samplingRate:$,channelCount:N,codec:q,originalCodec:q}}else L=w;return L},x.prototype._parseVideoData=function(y,D,S,v,w){if(S<=1){h.default.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");return}if(!(this._hasVideoFlagOverrided===!0&&this._hasVideo===!1)){var L=new Uint8Array(y,D,S)[0],O=(L&240)>>>4,F=L&15;if(F!==7){this._onError(_.default.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: "+F);return}this._parseAVCVideoPacket(y,D+1,S-1,v,w,O)}},x.prototype._parseAVCVideoPacket=function(y,D,S,v,w,L){if(S<4){h.default.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}var O=this._littleEndian,F=new DataView(y,D,S),V=F.getUint8(0),U=F.getUint32(0,!O)&16777215,B=U<<8>>8;if(V===0)this._parseAVCDecoderConfigurationRecord(y,D+4,S-4);else if(V===1)this._parseAVCVideoData(y,D+4,S-4,v,w,L,B);else if(V!==2){this._onError(_.default.FORMAT_ERROR,"Flv: Invalid video packet type "+V);return}},x.prototype._parseAVCDecoderConfigurationRecord=function(y,D,S){if(S<7){h.default.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}var v=this._videoMetadata,w=this._videoTrack,L=this._littleEndian,O=new DataView(y,D,S);v?typeof v.avcc!="undefined"&&h.default.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),v=this._videoMetadata={},v.type="video",v.id=w.id,v.timescale=this._timescale,v.duration=this._duration);var F=O.getUint8(0),V=O.getUint8(1);if(O.getUint8(2),O.getUint8(3),F!==1||V===0){this._onError(_.default.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(O.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(_.default.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: "+(this._naluLengthSize-1));return}var U=O.getUint8(5)&31;if(U===0){this._onError(_.default.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else U>1&&h.default.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = "+U);for(var B=6,N=0;N<U;N++){var $=O.getUint16(B,!L);if(B+=2,$!==0){var K=new Uint8Array(y,D+B,$);B+=$;var q=p.default.parseSPS(K);if(N===0){v.codecWidth=q.codec_size.width,v.codecHeight=q.codec_size.height,v.presentWidth=q.present_size.width,v.presentHeight=q.present_size.height,v.profile=q.profile_string,v.level=q.level_string,v.bitDepth=q.bit_depth,v.chromaFormat=q.chroma_format,v.sarRatio=q.sar_ratio,v.frameRate=q.frame_rate,(q.frame_rate.fixed===!1||q.frame_rate.fps_num===0||q.frame_rate.fps_den===0)&&(v.frameRate=this._referenceFrameRate);var Q=v.frameRate.fps_den,oe=v.frameRate.fps_num;v.refSampleDuration=v.timescale*(Q/oe);for(var le=K.subarray(1,4),se="avc1.",pe=0;pe<3;pe++){var Te=le[pe].toString(16);Te.length<2&&(Te="0"+Te),se+=Te}v.codec=se;var ae=this._mediaInfo;ae.width=v.codecWidth,ae.height=v.codecHeight,ae.fps=v.frameRate.fps,ae.profile=v.profile,ae.level=v.level,ae.refFrames=q.ref_frames,ae.chromaFormat=q.chroma_format_string,ae.sarNum=v.sarRatio.width,ae.sarDen=v.sarRatio.height,ae.videoCodec=se,ae.hasAudio?ae.audioCodec!=null&&(ae.mimeType='video/x-flv; codecs="'+ae.videoCodec+","+ae.audioCodec+'"'):ae.mimeType='video/x-flv; codecs="'+ae.videoCodec+'"',ae.isComplete()&&this._onMediaInfo(ae)}}}var _e=O.getUint8(B);if(_e===0){this._onError(_.default.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS");return}else _e>1&&h.default.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = "+_e);B++;for(var N=0;N<_e;N++){var $=O.getUint16(B,!L);B+=2,$!==0&&(B+=$)}v.avcc=new Uint8Array(S),v.avcc.set(new Uint8Array(y,D,S),0),h.default.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",v)},x.prototype._parseAVCVideoData=function(y,D,S,v,w,L,O){for(var F=this._littleEndian,V=new DataView(y,D,S),U=[],B=0,N=0,$=this._naluLengthSize,K=this._timestampBase+v,q=L===1;N<S;){if(N+4>=S){h.default.w(this.TAG,"Malformed Nalu near timestamp "+K+", offset = "+N+", dataSize = "+S);break}var Q=V.getUint32(N,!F);if($===3&&(Q>>>=8),Q>S-$){h.default.w(this.TAG,"Malformed Nalus near timestamp "+K+", NaluSize > DataSize!");return}var oe=V.getUint8(N+$)&31;oe===5&&(q=!0);var le=new Uint8Array(y,D+N,$+Q),se={type:oe,data:le};U.push(se),B+=le.byteLength,N+=$+Q}if(U.length){var pe=this._videoTrack,Te={units:U,length:B,isKeyframe:q,dts:K,cts:O,pts:K+O};q&&(Te.fileposition=w),pe.samples.push(Te),pe.length+=B}},x}();o.default=C},"./src/demux/sps-parser.js":function(a,o,l){l.r(o);var h=l("./src/demux/exp-golomb.js"),c=function(){function p(){}return p._ebsp2rbsp=function(_){for(var E=_,g=E.byteLength,b=new Uint8Array(g),C=0,x=0;x<g;x++)x>=2&&E[x]===3&&E[x-1]===0&&E[x-2]===0||(b[C]=E[x],C++);return new Uint8Array(b.buffer,0,C)},p.parseSPS=function(_){var E=p._ebsp2rbsp(_),g=new h.default(E);g.readByte();var b=g.readByte();g.readByte();var C=g.readByte();g.readUEG();var x=p.getProfileString(b),y=p.getLevelString(C),D=1,S=420,v=[0,420,422,444],w=8;if((b===100||b===110||b===122||b===244||b===44||b===83||b===86||b===118||b===128||b===138||b===144)&&(D=g.readUEG(),D===3&&g.readBits(1),D<=3&&(S=v[D]),w=g.readUEG()+8,g.readUEG(),g.readBits(1),g.readBool()))for(var L=D!==3?8:12,O=0;O<L;O++)g.readBool()&&(O<6?p._skipScalingList(g,16):p._skipScalingList(g,64));g.readUEG();var F=g.readUEG();if(F===0)g.readUEG();else if(F===1){g.readBits(1),g.readSEG(),g.readSEG();for(var V=g.readUEG(),O=0;O<V;O++)g.readSEG()}var U=g.readUEG();g.readBits(1);var B=g.readUEG(),N=g.readUEG(),$=g.readBits(1);$===0&&g.readBits(1),g.readBits(1);var K=0,q=0,Q=0,oe=0,le=g.readBool();le&&(K=g.readUEG(),q=g.readUEG(),Q=g.readUEG(),oe=g.readUEG());var se=1,pe=1,Te=0,ae=!0,_e=0,gt=0,xe=g.readBool();if(xe){if(g.readBool()){var De=g.readByte(),ut=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],Ve=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];De>0&&De<16?(se=ut[De-1],pe=Ve[De-1]):De===255&&(se=g.readByte()<<8|g.readByte(),pe=g.readByte()<<8|g.readByte())}if(g.readBool()&&g.readBool(),g.readBool()&&(g.readBits(4),g.readBool()&&g.readBits(24)),g.readBool()&&(g.readUEG(),g.readUEG()),g.readBool()){var Ze=g.readBits(32),It=g.readBits(32);ae=g.readBool(),_e=It,gt=Ze*2,Te=_e/gt}}var Ce=1;(se!==1||pe!==1)&&(Ce=se/pe);var ue=0,et=0;if(D===0)ue=1,et=2-$;else{var bt=D===3?1:2,ei=D===1?2:1;ue=bt,et=ei*(2-$)}var kt=(B+1)*16,ze=(2-$)*((N+1)*16);kt-=(K+q)*ue,ze-=(Q+oe)*et;var Ft=Math.ceil(kt*Ce);return g.destroy(),g=null,{profile_string:x,level_string:y,bit_depth:w,ref_frames:U,chroma_format:S,chroma_format_string:p.getChromaFormatString(S),frame_rate:{fixed:ae,fps:Te,fps_den:gt,fps_num:_e},sar_ratio:{width:se,height:pe},codec_size:{width:kt,height:ze},present_size:{width:Ft,height:ze}}},p._skipScalingList=function(_,E){for(var g=8,b=8,C=0,x=0;x<E;x++)b!==0&&(C=_.readSEG(),b=(g+C+256)%256),g=b===0?g:b},p.getProfileString=function(_){switch(_){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}},p.getLevelString=function(_){return(_/10).toFixed(1)},p.getChromaFormatString=function(_){switch(_){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}},p}();o.default=c},"./src/flv.js":function(a,o,l){l.r(o);var h=l("./src/utils/polyfill.js"),c=l("./src/core/features.js"),p=l("./src/io/loader.js"),_=l("./src/player/flv-player.js"),E=l("./src/player/native-player.js"),g=l("./src/player/player-events.js"),b=l("./src/player/player-errors.js"),C=l("./src/utils/logging-control.js"),x=l("./src/utils/exception.js");h.default.install();function y(w,L){var O=w;if(O==null||typeof O!="object")throw new x.InvalidArgumentException("MediaDataSource must be an javascript object!");if(!O.hasOwnProperty("type"))throw new x.InvalidArgumentException("MediaDataSource must has type field to indicate video file type!");switch(O.type){case"flv":return new _.default(O,L);default:return new E.default(O,L)}}function D(){return c.default.supportMSEH264Playback()}function S(){return c.default.getFeatureList()}var v={};v.createPlayer=y,v.isSupported=D,v.getFeatureList=S,v.BaseLoader=p.BaseLoader,v.LoaderStatus=p.LoaderStatus,v.LoaderErrors=p.LoaderErrors,v.Events=g.default,v.ErrorTypes=b.ErrorTypes,v.ErrorDetails=b.ErrorDetails,v.FlvPlayer=_.default,v.NativePlayer=E.default,v.LoggingControl=C.default,Object.defineProperty(v,"version",{enumerable:!0,get:function(){return"1.6.2"}}),o.default=v},"./src/index.js":function(a,o,l){a.exports=l("./src/flv.js").default},"./src/io/fetch-stream-loader.js":function(a,o,l){l.r(o);var h=l("./src/utils/browser.js"),c=l("./src/io/loader.js"),p=l("./src/utils/exception.js"),_=function(){var g=function(b,C){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,y){x.__proto__=y}||function(x,y){for(var D in y)Object.prototype.hasOwnProperty.call(y,D)&&(x[D]=y[D])},g(b,C)};return function(b,C){if(typeof C!="function"&&C!==null)throw new TypeError("Class extends value "+String(C)+" is not a constructor or null");g(b,C);function x(){this.constructor=b}b.prototype=C===null?Object.create(C):(x.prototype=C.prototype,new x)}}(),E=function(g){_(b,g);function b(C,x){var y=g.call(this,"fetch-stream-loader")||this;return y.TAG="FetchStreamLoader",y._seekHandler=C,y._config=x,y._needStash=!0,y._requestAbort=!1,y._contentLength=null,y._receivedLength=0,y}return b.isSupported=function(){try{var C=h.default.msedge&&h.default.version.minor>=15048,x=h.default.msedge?C:!0;return self.fetch&&self.ReadableStream&&x}catch(y){return!1}},b.prototype.destroy=function(){this.isWorking()&&this.abort(),g.prototype.destroy.call(this)},b.prototype.open=function(C,x){var y=this;this._dataSource=C,this._range=x;var D=C.url;this._config.reuseRedirectedURL&&C.redirectedURL!=null&&(D=C.redirectedURL);var S=this._seekHandler.getConfig(D,x),v=new self.Headers;if(typeof S.headers=="object"){var w=S.headers;for(var L in w)w.hasOwnProperty(L)&&v.append(L,w[L])}var O={method:"GET",headers:v,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var L in this._config.headers)v.append(L,this._config.headers[L]);C.cors===!1&&(O.mode="same-origin"),C.withCredentials&&(O.credentials="include"),C.referrerPolicy&&(O.referrerPolicy=C.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,O.signal=this._abortController.signal),this._status=c.LoaderStatus.kConnecting,self.fetch(S.url,O).then(function(F){if(y._requestAbort){y._status=c.LoaderStatus.kIdle,F.body.cancel();return}if(F.ok&&F.status>=200&&F.status<=299){if(F.url!==S.url&&y._onURLRedirect){var V=y._seekHandler.removeURLParameters(F.url);y._onURLRedirect(V)}var U=F.headers.get("Content-Length");return U!=null&&(y._contentLength=parseInt(U),y._contentLength!==0&&y._onContentLengthKnown&&y._onContentLengthKnown(y._contentLength)),y._pump.call(y,F.body.getReader())}else if(y._status=c.LoaderStatus.kError,y._onError)y._onError(c.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:F.status,msg:F.statusText});else throw new p.RuntimeException("FetchStreamLoader: Http code invalid, "+F.status+" "+F.statusText)}).catch(function(F){if(!(y._abortController&&y._abortController.signal.aborted))if(y._status=c.LoaderStatus.kError,y._onError)y._onError(c.LoaderErrors.EXCEPTION,{code:-1,msg:F.message});else throw F})},b.prototype.abort=function(){if(this._requestAbort=!0,(this._status!==c.LoaderStatus.kBuffering||!h.default.chrome)&&this._abortController)try{this._abortController.abort()}catch(C){}},b.prototype._pump=function(C){var x=this;return C.read().then(function(y){if(y.done)if(x._contentLength!==null&&x._receivedLength<x._contentLength){x._status=c.LoaderStatus.kError;var D=c.LoaderErrors.EARLY_EOF,S={code:-1,msg:"Fetch stream meet Early-EOF"};if(x._onError)x._onError(D,S);else throw new p.RuntimeException(S.msg)}else x._status=c.LoaderStatus.kComplete,x._onComplete&&x._onComplete(x._range.from,x._range.from+x._receivedLength-1);else{if(x._abortController&&x._abortController.signal.aborted){x._status=c.LoaderStatus.kComplete;return}else if(x._requestAbort===!0)return x._status=c.LoaderStatus.kComplete,C.cancel();x._status=c.LoaderStatus.kBuffering;var v=y.value.buffer,w=x._range.from+x._receivedLength;x._receivedLength+=v.byteLength,x._onDataArrival&&x._onDataArrival(v,w,x._receivedLength),x._pump(C)}}).catch(function(y){if(x._abortController&&x._abortController.signal.aborted){x._status=c.LoaderStatus.kComplete;return}if(!(y.code===11&&h.default.msedge)){x._status=c.LoaderStatus.kError;var D=0,S=null;if((y.code===19||y.message==="network error")&&(x._contentLength===null||x._contentLength!==null&&x._receivedLength<x._contentLength)?(D=c.LoaderErrors.EARLY_EOF,S={code:y.code,msg:"Fetch stream meet Early-EOF"}):(D=c.LoaderErrors.EXCEPTION,S={code:y.code,msg:y.message}),x._onError)x._onError(D,S);else throw new p.RuntimeException(S.msg)}})},b}(c.BaseLoader);o.default=E},"./src/io/io-controller.js":function(a,o,l){l.r(o);var h=l("./src/utils/logger.js"),c=l("./src/io/speed-sampler.js"),p=l("./src/io/loader.js"),_=l("./src/io/fetch-stream-loader.js"),E=l("./src/io/xhr-moz-chunked-loader.js"),g=l("./src/io/xhr-range-loader.js"),b=l("./src/io/websocket-loader.js"),C=l("./src/io/range-seek-handler.js"),x=l("./src/io/param-seek-handler.js"),y=l("./src/utils/exception.js"),D=function(){function S(v,w,L){this.TAG="IOController",this._config=w,this._extraData=L,this._stashInitialSize=1024*384,w.stashInitialSize!=null&&w.stashInitialSize>0&&(this._stashInitialSize=w.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=1024*1024*3,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,w.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=v,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(v.url),this._refTotalLength=v.filesize?v.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new c.default,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return S.prototype.destroy=function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null},S.prototype.isWorking=function(){return this._loader&&this._loader.isWorking()&&!this._paused},S.prototype.isPaused=function(){return this._paused},Object.defineProperty(S.prototype,"status",{get:function(){return this._loader.status},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"extraData",{get:function(){return this._extraData},set:function(v){this._extraData=v},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(v){this._onDataArrival=v},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onSeeked",{get:function(){return this._onSeeked},set:function(v){this._onSeeked=v},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onError",{get:function(){return this._onError},set:function(v){this._onError=v},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onComplete",{get:function(){return this._onComplete},set:function(v){this._onComplete=v},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onRedirect",{get:function(){return this._onRedirect},set:function(v){this._onRedirect=v},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onRecoveredEarlyEof",{get:function(){return this._onRecoveredEarlyEof},set:function(v){this._onRecoveredEarlyEof=v},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"currentURL",{get:function(){return this._dataSource.url},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"hasRedirect",{get:function(){return this._redirectedURL!=null||this._dataSource.redirectedURL!=null},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"currentRedirectedURL",{get:function(){return this._redirectedURL||this._dataSource.redirectedURL},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"currentSpeed",{get:function(){return this._loaderClass===g.default?this._loader.currentSpeed:this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"loaderType",{get:function(){return this._loader.type},enumerable:!1,configurable:!0}),S.prototype._selectSeekHandler=function(){var v=this._config;if(v.seekType==="range")this._seekHandler=new C.default(this._config.rangeLoadZeroStart);else if(v.seekType==="param"){var w=v.seekParamStart||"bstart",L=v.seekParamEnd||"bend";this._seekHandler=new x.default(w,L)}else if(v.seekType==="custom"){if(typeof v.customSeekHandler!="function")throw new y.InvalidArgumentException("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new v.customSeekHandler}else throw new y.InvalidArgumentException("Invalid seekType in config: "+v.seekType)},S.prototype._selectLoader=function(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=b.default;else if(_.default.isSupported())this._loaderClass=_.default;else if(E.default.isSupported())this._loaderClass=E.default;else if(g.default.isSupported())this._loaderClass=g.default;else throw new y.RuntimeException("Your browser doesn't support xhr with arraybuffer responseType!")},S.prototype._createLoader=function(){this._loader=new this._loaderClass(this._seekHandler,this._config),this._loader.needStashBuffer===!1&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)},S.prototype.open=function(v){this._currentRange={from:0,to:-1},v&&(this._currentRange.from=v),this._speedSampler.reset(),v||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))},S.prototype.abort=function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)},S.prototype.pause=function(){this.isWorking()&&(this._loader.abort(),this._stashUsed!==0?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)},S.prototype.resume=function(){if(this._paused){this._paused=!1;var v=this._resumeFrom;this._resumeFrom=0,this._internalSeek(v,!0)}},S.prototype.seek=function(v){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(v,!0)},S.prototype._internalSeek=function(v,w){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(w),this._loader.destroy(),this._loader=null;var L={from:v,to:-1};this._currentRange={from:L.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,L),this._onSeeked&&this._onSeeked()},S.prototype.updateUrl=function(v){if(!v||typeof v!="string"||v.length===0)throw new y.InvalidArgumentException("Url must be a non-empty string!");this._dataSource.url=v},S.prototype._expandBuffer=function(v){for(var w=this._stashSize;w+1024*1024*1<v;)w*=2;if(w+=1024*1024*1,w!==this._bufferSize){var L=new ArrayBuffer(w);if(this._stashUsed>0){var O=new Uint8Array(this._stashBuffer,0,this._stashUsed),F=new Uint8Array(L,0,w);F.set(O,0)}this._stashBuffer=L,this._bufferSize=w}},S.prototype._normalizeSpeed=function(v){var w=this._speedNormalizeList,L=w.length-1,O=0,F=0,V=L;if(v<w[0])return w[0];for(;F<=V;){if(O=F+Math.floor((V-F)/2),O===L||v>=w[O]&&v<w[O+1])return w[O];w[O]<v?F=O+1:V=O-1}},S.prototype._adjustStashSize=function(v){var w=0;this._config.isLive||v<512?w=v:v>=512&&v<=1024?w=Math.floor(v*1.5):w=v*2,w>8192&&(w=8192);var L=w*1024+1024*1024*1;this._bufferSize<L&&this._expandBuffer(L),this._stashSize=w*1024},S.prototype._dispatchChunks=function(v,w){return this._currentRange.to=w+v.byteLength-1,this._onDataArrival(v,w)},S.prototype._onURLRedirect=function(v){this._redirectedURL=v,this._onRedirect&&this._onRedirect(v)},S.prototype._onContentLengthKnown=function(v){v&&this._fullRequestFlag&&(this._totalLength=v,this._fullRequestFlag=!1)},S.prototype._onLoaderChunkArrival=function(v,w,L){if(!this._onDataArrival)throw new y.IllegalStateException("IOController: No existing consumer (onDataArrival) callback!");if(!this._paused){this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(v.byteLength);var O=this._speedSampler.lastSecondKBps;if(O!==0){var F=this._normalizeSpeed(O);this._speedNormalized!==F&&(this._speedNormalized=F,this._adjustStashSize(F))}if(this._enableStash)if(this._stashUsed===0&&this._stashByteStart===0&&(this._stashByteStart=w),this._stashUsed+v.byteLength<=this._stashSize){var B=new Uint8Array(this._stashBuffer,0,this._stashSize);B.set(new Uint8Array(v),this._stashUsed),this._stashUsed+=v.byteLength}else{var B=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){var $=this._stashBuffer.slice(0,this._stashUsed),V=this._dispatchChunks($,this._stashByteStart);if(V<$.byteLength){if(V>0){var N=new Uint8Array($,V);B.set(N,0),this._stashUsed=N.byteLength,this._stashByteStart+=V}}else this._stashUsed=0,this._stashByteStart+=V;this._stashUsed+v.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+v.byteLength),B=new Uint8Array(this._stashBuffer,0,this._bufferSize)),B.set(new Uint8Array(v),this._stashUsed),this._stashUsed+=v.byteLength}else{var V=this._dispatchChunks(v,w);if(V<v.byteLength){var U=v.byteLength-V;U>this._bufferSize&&(this._expandBuffer(U),B=new Uint8Array(this._stashBuffer,0,this._bufferSize)),B.set(new Uint8Array(v,V),0),this._stashUsed+=U,this._stashByteStart=w+V}}}else if(this._stashUsed===0){var V=this._dispatchChunks(v,w);if(V<v.byteLength){var U=v.byteLength-V;U>this._bufferSize&&this._expandBuffer(U);var B=new Uint8Array(this._stashBuffer,0,this._bufferSize);B.set(new Uint8Array(v,V),0),this._stashUsed+=U,this._stashByteStart=w+V}}else{this._stashUsed+v.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+v.byteLength);var B=new Uint8Array(this._stashBuffer,0,this._bufferSize);B.set(new Uint8Array(v),this._stashUsed),this._stashUsed+=v.byteLength;var V=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(V<this._stashUsed&&V>0){var N=new Uint8Array(this._stashBuffer,V);B.set(N,0)}this._stashUsed-=V,this._stashByteStart+=V}}},S.prototype._flushStashBuffer=function(v){if(this._stashUsed>0){var w=this._stashBuffer.slice(0,this._stashUsed),L=this._dispatchChunks(w,this._stashByteStart),O=w.byteLength-L;if(L<w.byteLength)if(v)h.default.w(this.TAG,O+" bytes unconsumed data remain when flush buffer, dropped");else{if(L>0){var F=new Uint8Array(this._stashBuffer,0,this._bufferSize),V=new Uint8Array(w,L);F.set(V,0),this._stashUsed=V.byteLength,this._stashByteStart+=L}return 0}return this._stashUsed=0,this._stashByteStart=0,O}return 0},S.prototype._onLoaderComplete=function(v,w){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)},S.prototype._onLoaderError=function(v,w){switch(h.default.e(this.TAG,"Loader error, code = "+w.code+", msg = "+w.msg),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,v=p.LoaderErrors.UNRECOVERABLE_EARLY_EOF),v){case p.LoaderErrors.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){var L=this._currentRange.to+1;L<this._totalLength&&(h.default.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(L,!1));return}v=p.LoaderErrors.UNRECOVERABLE_EARLY_EOF;break}case p.LoaderErrors.UNRECOVERABLE_EARLY_EOF:case p.LoaderErrors.CONNECTING_TIMEOUT:case p.LoaderErrors.HTTP_STATUS_CODE_INVALID:case p.LoaderErrors.EXCEPTION:break}if(this._onError)this._onError(v,w);else throw new y.RuntimeException("IOException: "+w.msg)},S}();o.default=D},"./src/io/loader.js":function(a,o,l){l.r(o),l.d(o,{LoaderStatus:function(){return c},LoaderErrors:function(){return p},BaseLoader:function(){return _}});var h=l("./src/utils/exception.js"),c={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},p={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},_=function(){function E(g){this._type=g||"undefined",this._status=c.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return E.prototype.destroy=function(){this._status=c.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null},E.prototype.isWorking=function(){return this._status===c.kConnecting||this._status===c.kBuffering},Object.defineProperty(E.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"needStashBuffer",{get:function(){return this._needStash},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"onContentLengthKnown",{get:function(){return this._onContentLengthKnown},set:function(g){this._onContentLengthKnown=g},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"onURLRedirect",{get:function(){return this._onURLRedirect},set:function(g){this._onURLRedirect=g},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(g){this._onDataArrival=g},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"onError",{get:function(){return this._onError},set:function(g){this._onError=g},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"onComplete",{get:function(){return this._onComplete},set:function(g){this._onComplete=g},enumerable:!1,configurable:!0}),E.prototype.open=function(g,b){throw new h.NotImplementedException("Unimplemented abstract function!")},E.prototype.abort=function(){throw new h.NotImplementedException("Unimplemented abstract function!")},E}()},"./src/io/param-seek-handler.js":function(a,o,l){l.r(o);var h=function(){function c(p,_){this._startName=p,this._endName=_}return c.prototype.getConfig=function(p,_){var E=p;if(_.from!==0||_.to!==-1){var g=!0;E.indexOf("?")===-1&&(E+="?",g=!1),g&&(E+="&"),E+=this._startName+"="+_.from.toString(),_.to!==-1&&(E+="&"+this._endName+"="+_.to.toString())}return{url:E,headers:{}}},c.prototype.removeURLParameters=function(p){var _=p.split("?")[0],E=void 0,g=p.indexOf("?");g!==-1&&(E=p.substring(g+1));var b="";if(E!=null&&E.length>0)for(var C=E.split("&"),x=0;x<C.length;x++){var y=C[x].split("="),D=x>0;y[0]!==this._startName&&y[0]!==this._endName&&(D&&(b+="&"),b+=C[x])}return b.length===0?_:_+"?"+b},c}();o.default=h},"./src/io/range-seek-handler.js":function(a,o,l){l.r(o);var h=function(){function c(p){this._zeroStart=p||!1}return c.prototype.getConfig=function(p,_){var E={};if(_.from!==0||_.to!==-1){var g=void 0;_.to!==-1?g="bytes="+_.from.toString()+"-"+_.to.toString():g="bytes="+_.from.toString()+"-",E.Range=g}else this._zeroStart&&(E.Range="bytes=0-");return{url:p,headers:E}},c.prototype.removeURLParameters=function(p){return p},c}();o.default=h},"./src/io/speed-sampler.js":function(a,o,l){l.r(o);var h=function(){function c(){this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return c.prototype.reset=function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0},c.prototype.addBytes=function(p){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=p,this._totalBytes+=p):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=p,this._totalBytes+=p):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=p,this._totalBytes+=p,this._lastCheckpoint=this._now())},Object.defineProperty(c.prototype,"currentKBps",{get:function(){this.addBytes(0);var p=(this._now()-this._lastCheckpoint)/1e3;return p==0&&(p=1),this._intervalBytes/p/1024},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"lastSecondKBps",{get:function(){return this.addBytes(0),this._lastSecondBytes!==0?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"averageKBps",{get:function(){var p=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/p/1024},enumerable:!1,configurable:!0}),c}();o.default=h},"./src/io/websocket-loader.js":function(a,o,l){l.r(o);var h=l("./src/io/loader.js"),c=l("./src/utils/exception.js"),p=function(){var E=function(g,b){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,x){C.__proto__=x}||function(C,x){for(var y in x)Object.prototype.hasOwnProperty.call(x,y)&&(C[y]=x[y])},E(g,b)};return function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");E(g,b);function C(){this.constructor=g}g.prototype=b===null?Object.create(b):(C.prototype=b.prototype,new C)}}(),_=function(E){p(g,E);function g(){var b=E.call(this,"websocket-loader")||this;return b.TAG="WebSocketLoader",b._needStash=!0,b._ws=null,b._requestAbort=!1,b._receivedLength=0,b}return g.isSupported=function(){try{return typeof self.WebSocket!="undefined"}catch(b){return!1}},g.prototype.destroy=function(){this._ws&&this.abort(),E.prototype.destroy.call(this)},g.prototype.open=function(b){try{var C=this._ws=new self.WebSocket(b.url);C.binaryType="arraybuffer",C.onopen=this._onWebSocketOpen.bind(this),C.onclose=this._onWebSocketClose.bind(this),C.onmessage=this._onWebSocketMessage.bind(this),C.onerror=this._onWebSocketError.bind(this),this._status=h.LoaderStatus.kConnecting}catch(y){this._status=h.LoaderStatus.kError;var x={code:y.code,msg:y.message};if(this._onError)this._onError(h.LoaderErrors.EXCEPTION,x);else throw new c.RuntimeException(x.msg)}},g.prototype.abort=function(){var b=this._ws;b&&(b.readyState===0||b.readyState===1)&&(this._requestAbort=!0,b.close()),this._ws=null,this._status=h.LoaderStatus.kComplete},g.prototype._onWebSocketOpen=function(b){this._status=h.LoaderStatus.kBuffering},g.prototype._onWebSocketClose=function(b){if(this._requestAbort===!0){this._requestAbort=!1;return}this._status=h.LoaderStatus.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)},g.prototype._onWebSocketMessage=function(b){var C=this;if(b.data instanceof ArrayBuffer)this._dispatchArrayBuffer(b.data);else if(b.data instanceof Blob){var x=new FileReader;x.onload=function(){C._dispatchArrayBuffer(x.result)},x.readAsArrayBuffer(b.data)}else{this._status=h.LoaderStatus.kError;var y={code:-1,msg:"Unsupported WebSocket message type: "+b.data.constructor.name};if(this._onError)this._onError(h.LoaderErrors.EXCEPTION,y);else throw new c.RuntimeException(y.msg)}},g.prototype._dispatchArrayBuffer=function(b){var C=b,x=this._receivedLength;this._receivedLength+=C.byteLength,this._onDataArrival&&this._onDataArrival(C,x,this._receivedLength)},g.prototype._onWebSocketError=function(b){this._status=h.LoaderStatus.kError;var C={code:b.code,msg:b.message};if(this._onError)this._onError(h.LoaderErrors.EXCEPTION,C);else throw new c.RuntimeException(C.msg)},g}(h.BaseLoader);o.default=_},"./src/io/xhr-moz-chunked-loader.js":function(a,o,l){l.r(o);var h=l("./src/utils/logger.js"),c=l("./src/io/loader.js"),p=l("./src/utils/exception.js"),_=function(){var g=function(b,C){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,y){x.__proto__=y}||function(x,y){for(var D in y)Object.prototype.hasOwnProperty.call(y,D)&&(x[D]=y[D])},g(b,C)};return function(b,C){if(typeof C!="function"&&C!==null)throw new TypeError("Class extends value "+String(C)+" is not a constructor or null");g(b,C);function x(){this.constructor=b}b.prototype=C===null?Object.create(C):(x.prototype=C.prototype,new x)}}(),E=function(g){_(b,g);function b(C,x){var y=g.call(this,"xhr-moz-chunked-loader")||this;return y.TAG="MozChunkedLoader",y._seekHandler=C,y._config=x,y._needStash=!0,y._xhr=null,y._requestAbort=!1,y._contentLength=null,y._receivedLength=0,y}return b.isSupported=function(){try{var C=new XMLHttpRequest;return C.open("GET","https://example.com",!0),C.responseType="moz-chunked-arraybuffer",C.responseType==="moz-chunked-arraybuffer"}catch(x){return h.default.w("MozChunkedLoader",x.message),!1}},b.prototype.destroy=function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),g.prototype.destroy.call(this)},b.prototype.open=function(C,x){this._dataSource=C,this._range=x;var y=C.url;this._config.reuseRedirectedURL&&C.redirectedURL!=null&&(y=C.redirectedURL);var D=this._seekHandler.getConfig(y,x);this._requestURL=D.url;var S=this._xhr=new XMLHttpRequest;if(S.open("GET",D.url,!0),S.responseType="moz-chunked-arraybuffer",S.onreadystatechange=this._onReadyStateChange.bind(this),S.onprogress=this._onProgress.bind(this),S.onloadend=this._onLoadEnd.bind(this),S.onerror=this._onXhrError.bind(this),C.withCredentials&&(S.withCredentials=!0),typeof D.headers=="object"){var v=D.headers;for(var w in v)v.hasOwnProperty(w)&&S.setRequestHeader(w,v[w])}if(typeof this._config.headers=="object"){var v=this._config.headers;for(var w in v)v.hasOwnProperty(w)&&S.setRequestHeader(w,v[w])}this._status=c.LoaderStatus.kConnecting,S.send()},b.prototype.abort=function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=c.LoaderStatus.kComplete},b.prototype._onReadyStateChange=function(C){var x=C.target;if(x.readyState===2){if(x.responseURL!=null&&x.responseURL!==this._requestURL&&this._onURLRedirect){var y=this._seekHandler.removeURLParameters(x.responseURL);this._onURLRedirect(y)}if(x.status!==0&&(x.status<200||x.status>299))if(this._status=c.LoaderStatus.kError,this._onError)this._onError(c.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:x.status,msg:x.statusText});else throw new p.RuntimeException("MozChunkedLoader: Http code invalid, "+x.status+" "+x.statusText);else this._status=c.LoaderStatus.kBuffering}},b.prototype._onProgress=function(C){if(this._status!==c.LoaderStatus.kError){this._contentLength===null&&C.total!==null&&C.total!==0&&(this._contentLength=C.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var x=C.target.response,y=this._range.from+this._receivedLength;this._receivedLength+=x.byteLength,this._onDataArrival&&this._onDataArrival(x,y,this._receivedLength)}},b.prototype._onLoadEnd=function(C){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===c.LoaderStatus.kError)return;this._status=c.LoaderStatus.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)},b.prototype._onXhrError=function(C){this._status=c.LoaderStatus.kError;var x=0,y=null;if(this._contentLength&&C.loaded<this._contentLength?(x=c.LoaderErrors.EARLY_EOF,y={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(x=c.LoaderErrors.EXCEPTION,y={code:-1,msg:C.constructor.name+" "+C.type}),this._onError)this._onError(x,y);else throw new p.RuntimeException(y.msg)},b}(c.BaseLoader);o.default=E},"./src/io/xhr-range-loader.js":function(a,o,l){l.r(o);var h=l("./src/utils/logger.js"),c=l("./src/io/speed-sampler.js"),p=l("./src/io/loader.js"),_=l("./src/utils/exception.js"),E=function(){var b=function(C,x){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,D){y.__proto__=D}||function(y,D){for(var S in D)Object.prototype.hasOwnProperty.call(D,S)&&(y[S]=D[S])},b(C,x)};return function(C,x){if(typeof x!="function"&&x!==null)throw new TypeError("Class extends value "+String(x)+" is not a constructor or null");b(C,x);function y(){this.constructor=C}C.prototype=x===null?Object.create(x):(y.prototype=x.prototype,new y)}}(),g=function(b){E(C,b);function C(x,y){var D=b.call(this,"xhr-range-loader")||this;return D.TAG="RangeLoader",D._seekHandler=x,D._config=y,D._needStash=!1,D._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],D._currentChunkSizeKB=384,D._currentSpeedNormalized=0,D._zeroSpeedChunkCount=0,D._xhr=null,D._speedSampler=new c.default,D._requestAbort=!1,D._waitForTotalLength=!1,D._totalLengthReceived=!1,D._currentRequestURL=null,D._currentRedirectedURL=null,D._currentRequestRange=null,D._totalLength=null,D._contentLength=null,D._receivedLength=0,D._lastTimeLoaded=0,D}return C.isSupported=function(){try{var x=new XMLHttpRequest;return x.open("GET","https://example.com",!0),x.responseType="arraybuffer",x.responseType==="arraybuffer"}catch(y){return h.default.w("RangeLoader",y.message),!1}},C.prototype.destroy=function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),b.prototype.destroy.call(this)},Object.defineProperty(C.prototype,"currentSpeed",{get:function(){return this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),C.prototype.open=function(x,y){this._dataSource=x,this._range=y,this._status=p.LoaderStatus.kConnecting;var D=!1;this._dataSource.filesize!=null&&this._dataSource.filesize!==0&&(D=!0,this._totalLength=this._dataSource.filesize),!this._totalLengthReceived&&!D?(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1})):this._openSubRange()},C.prototype._openSubRange=function(){var x=this._currentChunkSizeKB*1024,y=this._range.from+this._receivedLength,D=y+x;this._contentLength!=null&&D-this._range.from>=this._contentLength&&(D=this._range.from+this._contentLength-1),this._currentRequestRange={from:y,to:D},this._internalOpen(this._dataSource,this._currentRequestRange)},C.prototype._internalOpen=function(x,y){this._lastTimeLoaded=0;var D=x.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?D=this._currentRedirectedURL:x.redirectedURL!=null&&(D=x.redirectedURL));var S=this._seekHandler.getConfig(D,y);this._currentRequestURL=S.url;var v=this._xhr=new XMLHttpRequest;if(v.open("GET",S.url,!0),v.responseType="arraybuffer",v.onreadystatechange=this._onReadyStateChange.bind(this),v.onprogress=this._onProgress.bind(this),v.onload=this._onLoad.bind(this),v.onerror=this._onXhrError.bind(this),x.withCredentials&&(v.withCredentials=!0),typeof S.headers=="object"){var w=S.headers;for(var L in w)w.hasOwnProperty(L)&&v.setRequestHeader(L,w[L])}if(typeof this._config.headers=="object"){var w=this._config.headers;for(var L in w)w.hasOwnProperty(L)&&v.setRequestHeader(L,w[L])}v.send()},C.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=p.LoaderStatus.kComplete},C.prototype._internalAbort=function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)},C.prototype._onReadyStateChange=function(x){var y=x.target;if(y.readyState===2){if(y.responseURL!=null){var D=this._seekHandler.removeURLParameters(y.responseURL);y.responseURL!==this._currentRequestURL&&D!==this._currentRedirectedURL&&(this._currentRedirectedURL=D,this._onURLRedirect&&this._onURLRedirect(D))}if(y.status>=200&&y.status<=299){if(this._waitForTotalLength)return;this._status=p.LoaderStatus.kBuffering}else if(this._status=p.LoaderStatus.kError,this._onError)this._onError(p.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:y.status,msg:y.statusText});else throw new _.RuntimeException("RangeLoader: Http code invalid, "+y.status+" "+y.statusText)}},C.prototype._onProgress=function(x){if(this._status!==p.LoaderStatus.kError){if(this._contentLength===null){var y=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,y=!0;var D=x.total;this._internalAbort(),D!=null&D!==0&&(this._totalLength=D)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,y){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var S=x.loaded-this._lastTimeLoaded;this._lastTimeLoaded=x.loaded,this._speedSampler.addBytes(S)}},C.prototype._normalizeSpeed=function(x){var y=this._chunkSizeKBList,D=y.length-1,S=0,v=0,w=D;if(x<y[0])return y[0];for(;v<=w;){if(S=v+Math.floor((w-v)/2),S===D||x>=y[S]&&x<y[S+1])return y[S];y[S]<x?v=S+1:w=S-1}},C.prototype._onLoad=function(x){if(this._status!==p.LoaderStatus.kError){if(this._waitForTotalLength){this._waitForTotalLength=!1;return}this._lastTimeLoaded=0;var y=this._speedSampler.lastSecondKBps;if(y===0&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(y=this._speedSampler.currentKBps)),y!==0){var D=this._normalizeSpeed(y);this._currentSpeedNormalized!==D&&(this._currentSpeedNormalized=D,this._currentChunkSizeKB=D)}var S=x.target.response,v=this._range.from+this._receivedLength;this._receivedLength+=S.byteLength;var w=!1;this._contentLength!=null&&this._receivedLength<this._contentLength?this._openSubRange():w=!0,this._onDataArrival&&this._onDataArrival(S,v,this._receivedLength),w&&(this._status=p.LoaderStatus.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}},C.prototype._onXhrError=function(x){this._status=p.LoaderStatus.kError;var y=0,D=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(y=p.LoaderErrors.EARLY_EOF,D={code:-1,msg:"RangeLoader meet Early-Eof"}):(y=p.LoaderErrors.EXCEPTION,D={code:-1,msg:x.constructor.name+" "+x.type}),this._onError)this._onError(y,D);else throw new _.RuntimeException(D.msg)},C}(p.BaseLoader);o.default=g},"./src/player/flv-player.js":function(a,o,l){l.r(o);var h=l("./node_modules/events/events.js"),c=l.n(h),p=l("./src/utils/logger.js"),_=l("./src/utils/browser.js"),E=l("./src/player/player-events.js"),g=l("./src/core/transmuxer.js"),b=l("./src/core/transmuxing-events.js"),C=l("./src/core/mse-controller.js"),x=l("./src/core/mse-events.js"),y=l("./src/player/player-errors.js"),D=l("./src/config.js"),S=l("./src/utils/exception.js"),v=function(){function w(L,O){if(this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new(c()),this._config=(0,D.createDefaultConfig)(),typeof O=="object"&&Object.assign(this._config,O),L.type.toLowerCase()!=="flv")throw new S.InvalidArgumentException("FlvPlayer requires an flv MediaDataSource input!");L.isLive===!0&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=L,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;var F=_.default.chrome&&(_.default.version.major<50||_.default.version.major===50&&_.default.version.build<2661);this._alwaysSeekKeyframe=!!(F||_.default.msedge||_.default.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return w.prototype.destroy=function(){this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null},w.prototype.on=function(L,O){var F=this;L===E.default.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(function(){F._emitter.emit(E.default.MEDIA_INFO,F.mediaInfo)}):L===E.default.STATISTICS_INFO&&this._statisticsInfo!=null&&Promise.resolve().then(function(){F._emitter.emit(E.default.STATISTICS_INFO,F.statisticsInfo)}),this._emitter.addListener(L,O)},w.prototype.off=function(L,O){this._emitter.removeListener(L,O)},w.prototype.attachMediaElement=function(L){var O=this;if(this._mediaElement=L,L.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),L.addEventListener("seeking",this.e.onvSeeking),L.addEventListener("canplay",this.e.onvCanPlay),L.addEventListener("stalled",this.e.onvStalled),L.addEventListener("progress",this.e.onvProgress),this._msectl=new C.default(this._config),this._msectl.on(x.default.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(x.default.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(x.default.SOURCE_OPEN,function(){O._mseSourceOpened=!0,O._hasPendingLoad&&(O._hasPendingLoad=!1,O.load())}),this._msectl.on(x.default.ERROR,function(F){O._emitter.emit(E.default.ERROR,y.ErrorTypes.MEDIA_ERROR,y.ErrorDetails.MEDIA_MSE_ERROR,F)}),this._msectl.attachMediaElement(L),this._pendingSeekTime!=null)try{L.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(F){}},w.prototype.detachMediaElement=function(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)},w.prototype.load=function(){var L=this;if(!this._mediaElement)throw new S.IllegalStateException("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new S.IllegalStateException("FlvPlayer.load() has been called, please call unload() first!");if(!this._hasPendingLoad){if(this._config.deferLoadAfterSourceOpen&&this._mseSourceOpened===!1){this._hasPendingLoad=!0;return}this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new g.default(this._mediaDataSource,this._config),this._transmuxer.on(b.default.INIT_SEGMENT,function(O,F){L._msectl.appendInitSegment(F)}),this._transmuxer.on(b.default.MEDIA_SEGMENT,function(O,F){if(L._msectl.appendMediaSegment(F),L._config.lazyLoad&&!L._config.isLive){var V=L._mediaElement.currentTime;F.info.endDts>=(V+L._config.lazyLoadMaxDuration)*1e3&&L._progressChecker==null&&(p.default.v(L.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),L._suspendTransmuxer())}}),this._transmuxer.on(b.default.LOADING_COMPLETE,function(){L._msectl.endOfStream(),L._emitter.emit(E.default.LOADING_COMPLETE)}),this._transmuxer.on(b.default.RECOVERED_EARLY_EOF,function(){L._emitter.emit(E.default.RECOVERED_EARLY_EOF)}),this._transmuxer.on(b.default.IO_ERROR,function(O,F){L._emitter.emit(E.default.ERROR,y.ErrorTypes.NETWORK_ERROR,O,F)}),this._transmuxer.on(b.default.DEMUX_ERROR,function(O,F){L._emitter.emit(E.default.ERROR,y.ErrorTypes.MEDIA_ERROR,O,{code:-1,msg:F})}),this._transmuxer.on(b.default.MEDIA_INFO,function(O){L._mediaInfo=O,L._emitter.emit(E.default.MEDIA_INFO,Object.assign({},O))}),this._transmuxer.on(b.default.METADATA_ARRIVED,function(O){L._emitter.emit(E.default.METADATA_ARRIVED,O)}),this._transmuxer.on(b.default.SCRIPTDATA_ARRIVED,function(O){L._emitter.emit(E.default.SCRIPTDATA_ARRIVED,O)}),this._transmuxer.on(b.default.STATISTICS_INFO,function(O){L._statisticsInfo=L._fillStatisticsInfo(O),L._emitter.emit(E.default.STATISTICS_INFO,Object.assign({},L._statisticsInfo))}),this._transmuxer.on(b.default.RECOMMEND_SEEKPOINT,function(O){L._mediaElement&&!L._config.accurateSeek&&(L._requestSetTime=!0,L._mediaElement.currentTime=O/1e3)}),this._transmuxer.open()}},w.prototype.unload=function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)},w.prototype.play=function(){return this._mediaElement.play()},w.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(w.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(L){this._mediaElement.volume=L},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(L){this._mediaElement.muted=L},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(L){this._mediaElement?this._internalSeek(L):this._pendingSeekTime=L},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"mediaInfo",{get:function(){return Object.assign({},this._mediaInfo)},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"statisticsInfo",{get:function(){return this._statisticsInfo==null&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)},enumerable:!1,configurable:!0}),w.prototype._fillStatisticsInfo=function(L){if(L.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return L;var O=!0,F=0,V=0;if(this._mediaElement.getVideoPlaybackQuality){var U=this._mediaElement.getVideoPlaybackQuality();F=U.totalVideoFrames,V=U.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(F=this._mediaElement.webkitDecodedFrameCount,V=this._mediaElement.webkitDroppedFrameCount):O=!1;return O&&(L.decodedFrames=F,L.droppedFrames=V),L},w.prototype._onmseUpdateEnd=function(){if(!(!this._config.lazyLoad||this._config.isLive)){for(var L=this._mediaElement.buffered,O=this._mediaElement.currentTime,F=0,V=0;V<L.length;V++){var U=L.start(V),B=L.end(V);if(U<=O&&O<B){F=B;break}}F>=O+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(p.default.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},w.prototype._onmseBufferFull=function(){p.default.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._progressChecker==null&&this._suspendTransmuxer()},w.prototype._suspendTransmuxer=function(){this._transmuxer&&(this._transmuxer.pause(),this._progressChecker==null&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))},w.prototype._checkProgressAndResume=function(){for(var L=this._mediaElement.currentTime,O=this._mediaElement.buffered,F=!1,V=0;V<O.length;V++){var U=O.start(V),B=O.end(V);if(L>=U&&L<B){L>=B-this._config.lazyLoadRecoverDuration&&(F=!0);break}}F&&(window.clearInterval(this._progressChecker),this._progressChecker=null,F&&(p.default.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))},w.prototype._isTimepointBuffered=function(L){for(var O=this._mediaElement.buffered,F=0;F<O.length;F++){var V=O.start(F),U=O.end(F);if(L>=V&&L<U)return!0}return!1},w.prototype._internalSeek=function(L){var O=this._isTimepointBuffered(L),F=!1,V=0;if(L<1&&this._mediaElement.buffered.length>0){var U=this._mediaElement.buffered.start(0);(U<1&&L<U||_.default.safari)&&(F=!0,V=_.default.safari?.1:U)}if(F)this._requestSetTime=!0,this._mediaElement.currentTime=V;else if(O){if(!this._alwaysSeekKeyframe)this._requestSetTime=!0,this._mediaElement.currentTime=L;else{var B=this._msectl.getNearestKeyframe(Math.floor(L*1e3));this._requestSetTime=!0,B!=null?this._mediaElement.currentTime=B.dts/1e3:this._mediaElement.currentTime=L}this._progressChecker!=null&&this._checkProgressAndResume()}else this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(L),this._transmuxer.seek(Math.floor(L*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=L)},w.prototype._checkAndApplyUnbufferedSeekpoint=function(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){var L=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(L)||(this._progressChecker!=null&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(L),this._transmuxer.seek(Math.floor(L*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=L))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)},w.prototype._checkAndResumeStuckPlayback=function(L){var O=this._mediaElement;if(L||!this._receivedCanPlay||O.readyState<2){var F=O.buffered;F.length>0&&O.currentTime<F.start(0)&&(p.default.w(this.TAG,"Playback seems stuck at "+O.currentTime+", seek to "+F.start(0)),this._requestSetTime=!0,this._mediaElement.currentTime=F.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)},w.prototype._onvLoadedMetadata=function(L){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)},w.prototype._onvSeeking=function(L){var O=this._mediaElement.currentTime,F=this._mediaElement.buffered;if(this._requestSetTime){this._requestSetTime=!1;return}if(O<1&&F.length>0){var V=F.start(0);if(V<1&&O<V||_.default.safari){this._requestSetTime=!0,this._mediaElement.currentTime=_.default.safari?.1:V;return}}if(this._isTimepointBuffered(O)){if(this._alwaysSeekKeyframe){var U=this._msectl.getNearestKeyframe(Math.floor(O*1e3));U!=null&&(this._requestSetTime=!0,this._mediaElement.currentTime=U.dts/1e3)}this._progressChecker!=null&&this._checkProgressAndResume();return}this._seekpointRecord={seekPoint:O,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)},w.prototype._onvCanPlay=function(L){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)},w.prototype._onvStalled=function(L){this._checkAndResumeStuckPlayback(!0)},w.prototype._onvProgress=function(L){this._checkAndResumeStuckPlayback()},w}();o.default=v},"./src/player/native-player.js":function(a,o,l){l.r(o);var h=l("./node_modules/events/events.js"),c=l.n(h),p=l("./src/player/player-events.js"),_=l("./src/config.js"),E=l("./src/utils/exception.js"),g=function(){function b(C,x){if(this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new(c()),this._config=(0,_.createDefaultConfig)(),typeof x=="object"&&Object.assign(this._config,x),C.type.toLowerCase()==="flv")throw new E.InvalidArgumentException("NativePlayer does't support flv MediaDataSource input!");if(C.hasOwnProperty("segments"))throw new E.InvalidArgumentException("NativePlayer("+C.type+") doesn't support multipart playback!");this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=C,this._mediaElement=null}return b.prototype.destroy=function(){this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null},b.prototype.on=function(C,x){var y=this;C===p.default.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){y._emitter.emit(p.default.MEDIA_INFO,y.mediaInfo)}):C===p.default.STATISTICS_INFO&&this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){y._emitter.emit(p.default.STATISTICS_INFO,y.statisticsInfo)}),this._emitter.addListener(C,x)},b.prototype.off=function(C,x){this._emitter.removeListener(C,x)},b.prototype.attachMediaElement=function(C){if(this._mediaElement=C,C.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{C.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(x){}},b.prototype.detachMediaElement=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},b.prototype.load=function(){if(!this._mediaElement)throw new E.IllegalStateException("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)},b.prototype.unload=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},b.prototype.play=function(){return this._mediaElement.play()},b.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(b.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(C){this._mediaElement.volume=C},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(C){this._mediaElement.muted=C},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(C){this._mediaElement?this._mediaElement.currentTime=C:this._pendingSeekTime=C},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"mediaInfo",{get:function(){var C=this._mediaElement instanceof HTMLAudioElement?"audio/":"video/",x={mimeType:C+this._mediaDataSource.type};return this._mediaElement&&(x.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(x.width=this._mediaElement.videoWidth,x.height=this._mediaElement.videoHeight)),x},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"statisticsInfo",{get:function(){var C={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return C;var x=!0,y=0,D=0;if(this._mediaElement.getVideoPlaybackQuality){var S=this._mediaElement.getVideoPlaybackQuality();y=S.totalVideoFrames,D=S.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(y=this._mediaElement.webkitDecodedFrameCount,D=this._mediaElement.webkitDroppedFrameCount):x=!1;return x&&(C.decodedFrames=y,C.droppedFrames=D),C},enumerable:!1,configurable:!0}),b.prototype._onvLoadedMetadata=function(C){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(p.default.MEDIA_INFO,this.mediaInfo)},b.prototype._reportStatisticsInfo=function(){this._emitter.emit(p.default.STATISTICS_INFO,this.statisticsInfo)},b}();o.default=g},"./src/player/player-errors.js":function(a,o,l){l.r(o),l.d(o,{ErrorTypes:function(){return p},ErrorDetails:function(){return _}});var h=l("./src/io/loader.js"),c=l("./src/demux/demux-errors.js"),p={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},_={NETWORK_EXCEPTION:h.LoaderErrors.EXCEPTION,NETWORK_STATUS_CODE_INVALID:h.LoaderErrors.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:h.LoaderErrors.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:h.LoaderErrors.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:c.default.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:c.default.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:c.default.CODEC_UNSUPPORTED}},"./src/player/player-events.js":function(a,o,l){l.r(o);var h={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info"};o.default=h},"./src/remux/aac-silent.js":function(a,o,l){l.r(o);var h=function(){function c(){}return c.getSilentFrame=function(p,_){if(p==="mp4a.40.2"){if(_===1)return new Uint8Array([0,200,0,128,35,128]);if(_===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(_===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(_===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(_===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(_===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(_===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(_===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(_===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null},c}();o.default=h},"./src/remux/mp4-generator.js":function(a,o,l){l.r(o);var h=function(){function c(){}return c.init=function(){c.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]};for(var p in c.types)c.types.hasOwnProperty(p)&&(c.types[p]=[p.charCodeAt(0),p.charCodeAt(1),p.charCodeAt(2),p.charCodeAt(3)]);var _=c.constants={};_.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),_.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),_.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),_.STSC=_.STCO=_.STTS,_.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),_.HDLR_VIDEO=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]),_.HDLR_AUDIO=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]),_.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),_.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),_.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])},c.box=function(p){for(var _=8,E=null,g=Array.prototype.slice.call(arguments,1),b=g.length,C=0;C<b;C++)_+=g[C].byteLength;E=new Uint8Array(_),E[0]=_>>>24&255,E[1]=_>>>16&255,E[2]=_>>>8&255,E[3]=_&255,E.set(p,4);for(var x=8,C=0;C<b;C++)E.set(g[C],x),x+=g[C].byteLength;return E},c.generateInitSegment=function(p){var _=c.box(c.types.ftyp,c.constants.FTYP),E=c.moov(p),g=new Uint8Array(_.byteLength+E.byteLength);return g.set(_,0),g.set(E,_.byteLength),g},c.moov=function(p){var _=c.mvhd(p.timescale,p.duration),E=c.trak(p),g=c.mvex(p);return c.box(c.types.moov,_,E,g)},c.mvhd=function(p,_){return c.box(c.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,p>>>24&255,p>>>16&255,p>>>8&255,p&255,_>>>24&255,_>>>16&255,_>>>8&255,_&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]))},c.trak=function(p){return c.box(c.types.trak,c.tkhd(p),c.mdia(p))},c.tkhd=function(p){var _=p.id,E=p.duration,g=p.presentWidth,b=p.presentHeight;return c.box(c.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,_>>>24&255,_>>>16&255,_>>>8&255,_&255,0,0,0,0,E>>>24&255,E>>>16&255,E>>>8&255,E&255,0,0,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,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,g>>>8&255,g&255,0,0,b>>>8&255,b&255,0,0]))},c.mdia=function(p){return c.box(c.types.mdia,c.mdhd(p),c.hdlr(p),c.minf(p))},c.mdhd=function(p){var _=p.timescale,E=p.duration;return c.box(c.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,_>>>24&255,_>>>16&255,_>>>8&255,_&255,E>>>24&255,E>>>16&255,E>>>8&255,E&255,85,196,0,0]))},c.hdlr=function(p){var _=null;return p.type==="audio"?_=c.constants.HDLR_AUDIO:_=c.constants.HDLR_VIDEO,c.box(c.types.hdlr,_)},c.minf=function(p){var _=null;return p.type==="audio"?_=c.box(c.types.smhd,c.constants.SMHD):_=c.box(c.types.vmhd,c.constants.VMHD),c.box(c.types.minf,_,c.dinf(),c.stbl(p))},c.dinf=function(){var p=c.box(c.types.dinf,c.box(c.types.dref,c.constants.DREF));return p},c.stbl=function(p){var _=c.box(c.types.stbl,c.stsd(p),c.box(c.types.stts,c.constants.STTS),c.box(c.types.stsc,c.constants.STSC),c.box(c.types.stsz,c.constants.STSZ),c.box(c.types.stco,c.constants.STCO));return _},c.stsd=function(p){return p.type==="audio"?p.codec==="mp3"?c.box(c.types.stsd,c.constants.STSD_PREFIX,c.mp3(p)):c.box(c.types.stsd,c.constants.STSD_PREFIX,c.mp4a(p)):c.box(c.types.stsd,c.constants.STSD_PREFIX,c.avc1(p))},c.mp3=function(p){var _=p.channelCount,E=p.audioSampleRate,g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,_,0,16,0,0,0,0,E>>>8&255,E&255,0,0]);return c.box(c.types[".mp3"],g)},c.mp4a=function(p){var _=p.channelCount,E=p.audioSampleRate,g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,_,0,16,0,0,0,0,E>>>8&255,E&255,0,0]);return c.box(c.types.mp4a,g,c.esds(p))},c.esds=function(p){var _=p.config||[],E=_.length,g=new Uint8Array([0,0,0,0,3,23+E,0,1,0,4,15+E,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([E]).concat(_).concat([6,1,2]));return c.box(c.types.esds,g)},c.avc1=function(p){var _=p.avcc,E=p.codecWidth,g=p.codecHeight,b=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,E>>>8&255,E&255,g>>>8&255,g&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return c.box(c.types.avc1,b,c.box(c.types.avcC,_))},c.mvex=function(p){return c.box(c.types.mvex,c.trex(p))},c.trex=function(p){var _=p.id,E=new Uint8Array([0,0,0,0,_>>>24&255,_>>>16&255,_>>>8&255,_&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return c.box(c.types.trex,E)},c.moof=function(p,_){return c.box(c.types.moof,c.mfhd(p.sequenceNumber),c.traf(p,_))},c.mfhd=function(p){var _=new Uint8Array([0,0,0,0,p>>>24&255,p>>>16&255,p>>>8&255,p&255]);return c.box(c.types.mfhd,_)},c.traf=function(p,_){var E=p.id,g=c.box(c.types.tfhd,new Uint8Array([0,0,0,0,E>>>24&255,E>>>16&255,E>>>8&255,E&255])),b=c.box(c.types.tfdt,new Uint8Array([0,0,0,0,_>>>24&255,_>>>16&255,_>>>8&255,_&255])),C=c.sdtp(p),x=c.trun(p,C.byteLength+16+16+8+16+8+8);return c.box(c.types.traf,g,b,x,C)},c.sdtp=function(p){for(var _=p.samples||[],E=_.length,g=new Uint8Array(4+E),b=0;b<E;b++){var C=_[b].flags;g[b+4]=C.isLeading<<6|C.dependsOn<<4|C.isDependedOn<<2|C.hasRedundancy}return c.box(c.types.sdtp,g)},c.trun=function(p,_){var E=p.samples||[],g=E.length,b=12+16*g,C=new Uint8Array(b);_+=8+b,C.set([0,0,15,1,g>>>24&255,g>>>16&255,g>>>8&255,g&255,_>>>24&255,_>>>16&255,_>>>8&255,_&255],0);for(var x=0;x<g;x++){var y=E[x].duration,D=E[x].size,S=E[x].flags,v=E[x].cts;C.set([y>>>24&255,y>>>16&255,y>>>8&255,y&255,D>>>24&255,D>>>16&255,D>>>8&255,D&255,S.isLeading<<2|S.dependsOn,S.isDependedOn<<6|S.hasRedundancy<<4|S.isNonSync,0,0,v>>>24&255,v>>>16&255,v>>>8&255,v&255],12+16*x)}return c.box(c.types.trun,C)},c.mdat=function(p){return c.box(c.types.mdat,p)},c}();h.init(),o.default=h},"./src/remux/mp4-remuxer.js":function(a,o,l){l.r(o);var h=l("./src/utils/logger.js"),c=l("./src/remux/mp4-generator.js"),p=l("./src/remux/aac-silent.js"),_=l("./src/utils/browser.js"),E=l("./src/core/media-segment-info.js"),g=l("./src/utils/exception.js"),b=function(){function C(x){this.TAG="MP4Remuxer",this._config=x,this._isLive=x.isLive===!0,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new E.MediaSegmentInfoList("audio"),this._videoSegmentInfoList=new E.MediaSegmentInfoList("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(_.default.chrome&&(_.default.version.major<50||_.default.version.major===50&&_.default.version.build<2661)),this._fillSilentAfterSeek=_.default.msedge||_.default.msie,this._mp3UseMpegAudio=!_.default.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return C.prototype.destroy=function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null},C.prototype.bindDataSource=function(x){return x.onDataAvailable=this.remux.bind(this),x.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this},Object.defineProperty(C.prototype,"onInitSegment",{get:function(){return this._onInitSegment},set:function(x){this._onInitSegment=x},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"onMediaSegment",{get:function(){return this._onMediaSegment},set:function(x){this._onMediaSegment=x},enumerable:!1,configurable:!0}),C.prototype.insertDiscontinuity=function(){this._audioNextDts=this._videoNextDts=void 0},C.prototype.seek=function(x){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()},C.prototype.remux=function(x,y){if(!this._onMediaSegment)throw new g.IllegalStateException("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(x,y),this._remuxVideo(y),this._remuxAudio(x)},C.prototype._onTrackMetadataReceived=function(x,y){var D=null,S="mp4",v=y.codec;if(x==="audio")this._audioMeta=y,y.codec==="mp3"&&this._mp3UseMpegAudio?(S="mpeg",v="",D=new Uint8Array):D=c.default.generateInitSegment(y);else if(x==="video")this._videoMeta=y,D=c.default.generateInitSegment(y);else return;if(!this._onInitSegment)throw new g.IllegalStateException("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(x,{type:x,data:D.buffer,codec:v,container:x+"/"+S,mediaDuration:y.duration})},C.prototype._calculateDtsBase=function(x,y){this._dtsBaseInited||(x.samples&&x.samples.length&&(this._audioDtsBase=x.samples[0].dts),y.samples&&y.samples.length&&(this._videoDtsBase=y.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)},C.prototype.flushStashedSamples=function(){var x=this._videoStashedLastSample,y=this._audioStashedLastSample,D={type:"video",id:1,sequenceNumber:0,samples:[],length:0};x!=null&&(D.samples.push(x),D.length=x.length);var S={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};y!=null&&(S.samples.push(y),S.length=y.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(D,!0),this._remuxAudio(S,!0)},C.prototype._remuxAudio=function(x,y){if(this._audioMeta!=null){var D=x,S=D.samples,v=void 0,w=-1,L=-1,O=this._audioMeta.refSampleDuration,F=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,V=this._dtsBaseInited&&this._audioNextDts===void 0,U=!1;if(!(!S||S.length===0)&&!(S.length===1&&!y)){var B=0,N=null,$=0;F?(B=0,$=D.length):(B=8,$=8+D.length);var K=null;if(S.length>1&&(K=S.pop(),$-=K.length),this._audioStashedLastSample!=null){var q=this._audioStashedLastSample;this._audioStashedLastSample=null,S.unshift(q),$+=q.length}K!=null&&(this._audioStashedLastSample=K);var Q=S[0].dts-this._dtsBase;if(this._audioNextDts)v=Q-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())v=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&this._audioMeta.originalCodec!=="mp3"&&(U=!0);else{var oe=this._audioSegmentInfoList.getLastSampleBefore(Q);if(oe!=null){var le=Q-(oe.originalDts+oe.duration);le<=3&&(le=0);var se=oe.dts+oe.duration+le;v=Q-se}else v=0}if(U){var pe=Q-v,Te=this._videoSegmentInfoList.getLastSegmentBefore(Q);if(Te!=null&&Te.beginDts<pe){var ae=p.default.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(ae){var _e=Te.beginDts,gt=pe-Te.beginDts;h.default.v(this.TAG,"InsertPrefixSilentAudio: dts: "+_e+", duration: "+gt),S.unshift({unit:ae,dts:_e,pts:_e}),$+=ae.byteLength}}else U=!1}for(var xe=[],De=0;De<S.length;De++){var q=S[De],ut=q.unit,Ve=q.dts-this._dtsBase,_e=Ve,Ze=!1,It=null,Ce=0;if(!(Ve<-.001)){if(this._audioMeta.codec!=="mp3"){var ue=Ve,et=3;if(this._audioNextDts&&(ue=this._audioNextDts),v=Ve-ue,v<=-et*O){h.default.w(this.TAG,"Dropping 1 audio frame (originalDts: "+Ve+" ms ,curRefDts: "+ue+" ms) due to dtsCorrection: "+v+" ms overlap.");continue}else if(v>=et*O&&this._fillAudioTimestampGap&&!_.default.safari){Ze=!0;var bt=Math.floor(v/O);h.default.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.
`+("originalDts: "+Ve+" ms, curRefDts: "+ue+" ms, ")+("dtsCorrection: "+Math.round(v)+" ms, generate: "+bt+" frames")),_e=Math.floor(ue),Ce=Math.floor(ue+O)-_e;var ae=p.default.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);ae==null&&(h.default.w(this.TAG,"Unable to generate silent frame for "+(this._audioMeta.originalCodec+" with "+this._audioMeta.channelCount+" channels, repeat last frame")),ae=ut),It=[];for(var ei=0;ei<bt;ei++){ue=ue+O;var kt=Math.floor(ue),ze=Math.floor(ue+O)-kt,Ft={dts:kt,pts:kt,cts:0,unit:ae,size:ae.byteLength,duration:ze,originalDts:Ve,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};It.push(Ft),$+=Ft.size}this._audioNextDts=ue+O}else _e=Math.floor(ue),Ce=Math.floor(ue+O)-_e,this._audioNextDts=ue+O}else{if(_e=Ve-v,De!==S.length-1){var ve=S[De+1].dts-this._dtsBase-v;Ce=ve-_e}else if(K!=null){var ve=K.dts-this._dtsBase-v;Ce=ve-_e}else xe.length>=1?Ce=xe[xe.length-1].duration:Ce=Math.floor(O);this._audioNextDts=_e+Ce}w===-1&&(w=_e),xe.push({dts:_e,pts:_e,cts:0,unit:q.unit,size:q.unit.byteLength,duration:Ce,originalDts:Ve,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),Ze&&xe.push.apply(xe,It)}}if(xe.length===0){D.samples=[],D.length=0;return}F?N=new Uint8Array($):(N=new Uint8Array($),N[0]=$>>>24&255,N[1]=$>>>16&255,N[2]=$>>>8&255,N[3]=$&255,N.set(c.default.types.mdat,4));for(var De=0;De<xe.length;De++){var ut=xe[De].unit;N.set(ut,B),B+=ut.byteLength}var Et=xe[xe.length-1];L=Et.dts+Et.duration;var Xe=new E.MediaSegmentInfo;Xe.beginDts=w,Xe.endDts=L,Xe.beginPts=w,Xe.endPts=L,Xe.originalBeginDts=xe[0].originalDts,Xe.originalEndDts=Et.originalDts+Et.duration,Xe.firstSample=new E.SampleInfo(xe[0].dts,xe[0].pts,xe[0].duration,xe[0].originalDts,!1),Xe.lastSample=new E.SampleInfo(Et.dts,Et.pts,Et.duration,Et.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(Xe),D.samples=xe,D.sequenceNumber++;var Si=null;F?Si=new Uint8Array:Si=c.default.moof(D,w),D.samples=[],D.length=0;var pi={type:"audio",data:this._mergeBoxes(Si,N).buffer,sampleCount:xe.length,info:Xe};F&&V&&(pi.timestampOffset=w),this._onMediaSegment("audio",pi)}}},C.prototype._remuxVideo=function(x,y){if(this._videoMeta!=null){var D=x,S=D.samples,v=void 0,w=-1,L=-1,O=-1,F=-1;if(!(!S||S.length===0)&&!(S.length===1&&!y)){var V=8,U=null,B=8+x.length,N=null;if(S.length>1&&(N=S.pop(),B-=N.length),this._videoStashedLastSample!=null){var $=this._videoStashedLastSample;this._videoStashedLastSample=null,S.unshift($),B+=$.length}N!=null&&(this._videoStashedLastSample=N);var K=S[0].dts-this._dtsBase;if(this._videoNextDts)v=K-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())v=0;else{var q=this._videoSegmentInfoList.getLastSampleBefore(K);if(q!=null){var Q=K-(q.originalDts+q.duration);Q<=3&&(Q=0);var oe=q.dts+q.duration+Q;v=K-oe}else v=0}for(var le=new E.MediaSegmentInfo,se=[],pe=0;pe<S.length;pe++){var $=S[pe],Te=$.dts-this._dtsBase,ae=$.isKeyframe,_e=Te-v,gt=$.cts,xe=_e+gt;w===-1&&(w=_e,O=xe);var De=0;if(pe!==S.length-1){var ut=S[pe+1].dts-this._dtsBase-v;De=ut-_e}else if(N!=null){var ut=N.dts-this._dtsBase-v;De=ut-_e}else se.length>=1?De=se[se.length-1].duration:De=Math.floor(this._videoMeta.refSampleDuration);if(ae){var Ve=new E.SampleInfo(_e,xe,De,$.dts,!0);Ve.fileposition=$.fileposition,le.appendSyncPoint(Ve)}se.push({dts:_e,pts:xe,cts:gt,units:$.units,size:$.length,isKeyframe:ae,duration:De,originalDts:Te,flags:{isLeading:0,dependsOn:ae?2:1,isDependedOn:ae?1:0,hasRedundancy:0,isNonSync:ae?0:1}})}U=new Uint8Array(B),U[0]=B>>>24&255,U[1]=B>>>16&255,U[2]=B>>>8&255,U[3]=B&255,U.set(c.default.types.mdat,4);for(var pe=0;pe<se.length;pe++)for(var Ze=se[pe].units;Ze.length;){var It=Ze.shift(),Ce=It.data;U.set(Ce,V),V+=Ce.byteLength}var ue=se[se.length-1];if(L=ue.dts+ue.duration,F=ue.pts+ue.duration,this._videoNextDts=L,le.beginDts=w,le.endDts=L,le.beginPts=O,le.endPts=F,le.originalBeginDts=se[0].originalDts,le.originalEndDts=ue.originalDts+ue.duration,le.firstSample=new E.SampleInfo(se[0].dts,se[0].pts,se[0].duration,se[0].originalDts,se[0].isKeyframe),le.lastSample=new E.SampleInfo(ue.dts,ue.pts,ue.duration,ue.originalDts,ue.isKeyframe),this._isLive||this._videoSegmentInfoList.append(le),D.samples=se,D.sequenceNumber++,this._forceFirstIDR){var et=se[0].flags;et.dependsOn=2,et.isNonSync=0}var bt=c.default.moof(D,w);D.samples=[],D.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(bt,U).buffer,sampleCount:se.length,info:le})}}},C.prototype._mergeBoxes=function(x,y){var D=new Uint8Array(x.byteLength+y.byteLength);return D.set(x,0),D.set(y,x.byteLength),D},C}();o.default=b},"./src/utils/browser.js":function(a,o,l){l.r(o);var h={};function c(){var p=self.navigator.userAgent.toLowerCase(),_=/(edge)\/([\w.]+)/.exec(p)||/(opr)[\/]([\w.]+)/.exec(p)||/(chrome)[ \/]([\w.]+)/.exec(p)||/(iemobile)[\/]([\w.]+)/.exec(p)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(p)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(p)||/(webkit)[ \/]([\w.]+)/.exec(p)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(p)||/(msie) ([\w.]+)/.exec(p)||p.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(p)||p.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(p)||[],E=/(ipad)/.exec(p)||/(ipod)/.exec(p)||/(windows phone)/.exec(p)||/(iphone)/.exec(p)||/(kindle)/.exec(p)||/(android)/.exec(p)||/(windows)/.exec(p)||/(mac)/.exec(p)||/(linux)/.exec(p)||/(cros)/.exec(p)||[],g={browser:_[5]||_[3]||_[1]||"",version:_[2]||_[4]||"0",majorVersion:_[4]||_[2]||"0",platform:E[0]||""},b={};if(g.browser){b[g.browser]=!0;var C=g.majorVersion.split(".");b.version={major:parseInt(g.majorVersion,10),string:g.version},C.length>1&&(b.version.minor=parseInt(C[1],10)),C.length>2&&(b.version.build=parseInt(C[2],10))}if(g.platform&&(b[g.platform]=!0),(b.chrome||b.opr||b.safari)&&(b.webkit=!0),b.rv||b.iemobile){b.rv&&delete b.rv;var x="msie";g.browser=x,b[x]=!0}if(b.edge){delete b.edge;var y="msedge";g.browser=y,b[y]=!0}if(b.opr){var D="opera";g.browser=D,b[D]=!0}if(b.safari&&b.android){var S="android";g.browser=S,b[S]=!0}b.name=g.browser,b.platform=g.platform;for(var v in h)h.hasOwnProperty(v)&&delete h[v];Object.assign(h,b)}c(),o.default=h},"./src/utils/exception.js":function(a,o,l){l.r(o),l.d(o,{RuntimeException:function(){return c},IllegalStateException:function(){return p},InvalidArgumentException:function(){return _},NotImplementedException:function(){return E}});var h=function(){var g=function(b,C){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,y){x.__proto__=y}||function(x,y){for(var D in y)Object.prototype.hasOwnProperty.call(y,D)&&(x[D]=y[D])},g(b,C)};return function(b,C){if(typeof C!="function"&&C!==null)throw new TypeError("Class extends value "+String(C)+" is not a constructor or null");g(b,C);function x(){this.constructor=b}b.prototype=C===null?Object.create(C):(x.prototype=C.prototype,new x)}}(),c=function(){function g(b){this._message=b}return Object.defineProperty(g.prototype,"name",{get:function(){return"RuntimeException"},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),g.prototype.toString=function(){return this.name+": "+this.message},g}(),p=function(g){h(b,g);function b(C){return g.call(this,C)||this}return Object.defineProperty(b.prototype,"name",{get:function(){return"IllegalStateException"},enumerable:!1,configurable:!0}),b}(c),_=function(g){h(b,g);function b(C){return g.call(this,C)||this}return Object.defineProperty(b.prototype,"name",{get:function(){return"InvalidArgumentException"},enumerable:!1,configurable:!0}),b}(c),E=function(g){h(b,g);function b(C){return g.call(this,C)||this}return Object.defineProperty(b.prototype,"name",{get:function(){return"NotImplementedException"},enumerable:!1,configurable:!0}),b}(c)},"./src/utils/logger.js":function(a,o,l){l.r(o);var h=l("./node_modules/events/events.js"),c=l.n(h),p=function(){function _(){}return _.e=function(E,g){(!E||_.FORCE_GLOBAL_TAG)&&(E=_.GLOBAL_TAG);var b="["+E+"] > "+g;_.ENABLE_CALLBACK&&_.emitter.emit("log","error",b),_.ENABLE_ERROR&&(console.error?console.error(b):console.warn&&console.warn(b))},_.i=function(E,g){(!E||_.FORCE_GLOBAL_TAG)&&(E=_.GLOBAL_TAG);var b="["+E+"] > "+g;_.ENABLE_CALLBACK&&_.emitter.emit("log","info",b),!!_.ENABLE_INFO&&console.info&&console.info(b)},_.w=function(E,g){(!E||_.FORCE_GLOBAL_TAG)&&(E=_.GLOBAL_TAG);var b="["+E+"] > "+g;_.ENABLE_CALLBACK&&_.emitter.emit("log","warn",b),!!_.ENABLE_WARN&&console.warn&&console.warn(b)},_.d=function(E,g){(!E||_.FORCE_GLOBAL_TAG)&&(E=_.GLOBAL_TAG);var b="["+E+"] > "+g;_.ENABLE_CALLBACK&&_.emitter.emit("log","debug",b),!!_.ENABLE_DEBUG&&console.debug&&console.debug(b)},_.v=function(E,g){(!E||_.FORCE_GLOBAL_TAG)&&(E=_.GLOBAL_TAG);var b="["+E+"] > "+g;_.ENABLE_CALLBACK&&_.emitter.emit("log","verbose",b),_.ENABLE_VERBOSE},_}();p.GLOBAL_TAG="flv.js",p.FORCE_GLOBAL_TAG=!1,p.ENABLE_ERROR=!0,p.ENABLE_INFO=!0,p.ENABLE_WARN=!0,p.ENABLE_DEBUG=!0,p.ENABLE_VERBOSE=!0,p.ENABLE_CALLBACK=!1,p.emitter=new(c()),o.default=p},"./src/utils/logging-control.js":function(a,o,l){l.r(o);var h=l("./node_modules/events/events.js"),c=l.n(h),p=l("./src/utils/logger.js"),_=function(){function E(){}return Object.defineProperty(E,"forceGlobalTag",{get:function(){return p.default.FORCE_GLOBAL_TAG},set:function(g){p.default.FORCE_GLOBAL_TAG=g,E._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(E,"globalTag",{get:function(){return p.default.GLOBAL_TAG},set:function(g){p.default.GLOBAL_TAG=g,E._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(E,"enableAll",{get:function(){return p.default.ENABLE_VERBOSE&&p.default.ENABLE_DEBUG&&p.default.ENABLE_INFO&&p.default.ENABLE_WARN&&p.default.ENABLE_ERROR},set:function(g){p.default.ENABLE_VERBOSE=g,p.default.ENABLE_DEBUG=g,p.default.ENABLE_INFO=g,p.default.ENABLE_WARN=g,p.default.ENABLE_ERROR=g,E._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(E,"enableDebug",{get:function(){return p.default.ENABLE_DEBUG},set:function(g){p.default.ENABLE_DEBUG=g,E._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(E,"enableVerbose",{get:function(){return p.default.ENABLE_VERBOSE},set:function(g){p.default.ENABLE_VERBOSE=g,E._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(E,"enableInfo",{get:function(){return p.default.ENABLE_INFO},set:function(g){p.default.ENABLE_INFO=g,E._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(E,"enableWarn",{get:function(){return p.default.ENABLE_WARN},set:function(g){p.default.ENABLE_WARN=g,E._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(E,"enableError",{get:function(){return p.default.ENABLE_ERROR},set:function(g){p.default.ENABLE_ERROR=g,E._notifyChange()},enumerable:!1,configurable:!0}),E.getConfig=function(){return{globalTag:p.default.GLOBAL_TAG,forceGlobalTag:p.default.FORCE_GLOBAL_TAG,enableVerbose:p.default.ENABLE_VERBOSE,enableDebug:p.default.ENABLE_DEBUG,enableInfo:p.default.ENABLE_INFO,enableWarn:p.default.ENABLE_WARN,enableError:p.default.ENABLE_ERROR,enableCallback:p.default.ENABLE_CALLBACK}},E.applyConfig=function(g){p.default.GLOBAL_TAG=g.globalTag,p.default.FORCE_GLOBAL_TAG=g.forceGlobalTag,p.default.ENABLE_VERBOSE=g.enableVerbose,p.default.ENABLE_DEBUG=g.enableDebug,p.default.ENABLE_INFO=g.enableInfo,p.default.ENABLE_WARN=g.enableWarn,p.default.ENABLE_ERROR=g.enableError,p.default.ENABLE_CALLBACK=g.enableCallback},E._notifyChange=function(){var g=E.emitter;if(g.listenerCount("change")>0){var b=E.getConfig();g.emit("change",b)}},E.registerListener=function(g){E.emitter.addListener("change",g)},E.removeListener=function(g){E.emitter.removeListener("change",g)},E.addLogListener=function(g){p.default.emitter.addListener("log",g),p.default.emitter.listenerCount("log")>0&&(p.default.ENABLE_CALLBACK=!0,E._notifyChange())},E.removeLogListener=function(g){p.default.emitter.removeListener("log",g),p.default.emitter.listenerCount("log")===0&&(p.default.ENABLE_CALLBACK=!1,E._notifyChange())},E}();_.emitter=new(c()),o.default=_},"./src/utils/polyfill.js":function(a,o,l){l.r(o);var h=function(){function c(){}return c.install=function(){Object.setPrototypeOf=Object.setPrototypeOf||function(p,_){return p.__proto__=_,p},Object.assign=Object.assign||function(p){if(p==null)throw new TypeError("Cannot convert undefined or null to object");for(var _=Object(p),E=1;E<arguments.length;E++){var g=arguments[E];if(g!=null)for(var b in g)g.hasOwnProperty(b)&&(_[b]=g[b])}return _},typeof self.Promise!="function"&&l("./node_modules/es6-promise/dist/es6-promise.js").polyfill()},c}();h.install(),o.default=h},"./src/utils/utf8-conv.js":function(a,o,l){l.r(o);function h(p,_,E){var g=p;if(_+E<g.length){for(;E--;)if((g[++_]&192)!==128)return!1;return!0}else return!1}function c(p){for(var _=[],E=p,g=0,b=p.length;g<b;){if(E[g]<128){_.push(String.fromCharCode(E[g])),++g;continue}else if(!(E[g]<192)){if(E[g]<224){if(h(E,g,1)){var C=(E[g]&31)<<6|E[g+1]&63;if(C>=128){_.push(String.fromCharCode(C&65535)),g+=2;continue}}}else if(E[g]<240){if(h(E,g,2)){var C=(E[g]&15)<<12|(E[g+1]&63)<<6|E[g+2]&63;if(C>=2048&&(C&63488)!==55296){_.push(String.fromCharCode(C&65535)),g+=3;continue}}}else if(E[g]<248&&h(E,g,3)){var C=(E[g]&7)<<18|(E[g+1]&63)<<12|(E[g+2]&63)<<6|E[g+3]&63;if(C>65536&&C<1114112){C-=65536,_.push(String.fromCharCode(C>>>10|55296)),_.push(String.fromCharCode(C&1023|56320)),g+=4;continue}}}_.push(String.fromCharCode(65533)),++g}return _.join("")}o.default=c}},r={};function s(a){var o=r[a];if(o!==void 0)return o.exports;var l=r[a]={exports:{}};return t[a].call(l.exports,l,l.exports,s),l.exports}s.m=t,function(){s.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return s.d(o,{a:o}),o}}(),function(){s.d=function(a,o){for(var l in o)s.o(o,l)&&!s.o(a,l)&&Object.defineProperty(a,l,{enumerable:!0,get:o[l]})}}(),function(){s.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch(a){if(typeof window=="object")return window}}()}(),function(){s.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)}}(),function(){s.r=function(a){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})}}();var n=s("./src/index.js");return n}()})})(vp);var nc=ym(vp.exports);const v2=Wn({__name:"flv",props:{url:{type:String,default:""}},setup(i){const e=i,t=nr(null);let r=null;Oo(()=>{s()});function s(){if(!!e.url&&nc.isSupported()){let o=is(t);var a=nc.createPlayer({type:"flv",isLive:!0,url:e.url});a.attachMediaElement(o),a.load(),a.play(),r=a}}function n(){!r||(r==null||r.pause(),r==null||r.unload(),r==null||r.detachMediaElement(),r==null||r.destroy(),r=null)}return Po(()=>{n()}),(a,o)=>(Ri(),yn("video",{ref_key:"videoRefF",ref:t,class:"w-full h-full",autoplay:"",controls:"",muted:""},null,512))}}),y2={key:0,class:"w-full h-full"},T2=["src"],x2=Wn({__name:"index1",props:{url:{type:String,default:""},type:{type:String}},setup(i){const e=i,t=Tm(),r=xm(()=>Ra(Ra({},is(t)),is(e)));return(s,n)=>i.url?(Ri(),yn("div",y2,[i.type=="iframe"?(Ri(),yn("iframe",{key:0,class:"h-full w-full",src:i.url},null,8,T2)):nn("",!0),i.type=="m3u8"?(Ri(),to(_2,Il({key:1},is(r),{url:i.url}),null,16,["url"])):nn("",!0),i.type=="flv"?(Ri(),to(v2,Il({key:2},is(r),{url:i.url}),null,16,["url"])):nn("",!0)])):nn("",!0)}}),C2=Wn({__name:"index",props:{id:{type:[String,Number]}},setup(i){const e=i,t=nr(""),r=nr(""),s=nr(60);let n=null;Oo(()=>{a()});function a(){return Ll(this,null,function*(){if(e.id!=null)try{const l=yield gm(e.id);t.value=l.type,r.value=l.address,s.value=l.expires,o()}catch(l){}})}function o(){s.value<=0||(n=setTimeout(()=>{a()},s.value*1e3))}return Po(()=>{n&&clearTimeout(n)}),(l,h)=>(Ri(),to(x2,{type:t.value,url:r.value},null,8,["type","url"]))}});export{C2 as _};