@mux/mux-player 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +180 -180
- package/dist/index.mjs +1 -1
- package/dist/mux-player.js +166 -166
- package/dist/mux-player.mjs +166 -166
- package/package.json +3 -3
package/dist/mux-player.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var Ql=Object.create;var Va=Object.defineProperty;var Zl=Object.getOwnPropertyDescriptor;var Jl=Object.getOwnPropertyNames;var ql=Object.getPrototypeOf,eu=Object.prototype.hasOwnProperty;var $a=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var tu=(r,t,e,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Jl(t))!eu.call(r,n)&&n!==e&&Va(r,n,{get:()=>t[n],enumerable:!(a=Zl(t,n))||a.enumerable});return r};var vi=(r,t,e)=>(e=r!=null?Ql(ql(r)):{},tu(t||!r||!r.__esModule?Va(e,"default",{value:r,enumerable:!0}):e,r));var pn=(r,t,e)=>{if(!t.has(r))throw TypeError("Cannot "+e)};var ge=(r,t,e)=>(pn(r,t,"read from private field"),e?e.call(r):t.get(r)),Le=(r,t,e)=>{if(t.has(r))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(r):t.set(r,e)},qe=(r,t,e,a)=>(pn(r,t,"write to private field"),a?a.call(r,e):t.set(r,e),e);var Me=(r,t,e)=>(pn(r,t,"access private method"),e);var ro=$a((Ni,ha)=>{(function(){var r=!1;(function(t,e){typeof Ni=="object"&&typeof ha=="object"?ha.exports=e():typeof r=="function"&&r.amd?r("mux",[],e):typeof Ni=="object"?Ni.mux=e():t.mux=e()})(typeof self!="undefined"?self:this,function(){return function(t){function e(n){if(a[n])return a[n].exports;var u=a[n]={i:n,l:!1,exports:{}};return t[n].call(u.exports,u,u.exports,e),u.l=!0,u.exports}var a={};return e.m=t,e.c=a,e.d=function(n,u,M){e.o(n,u)||Object.defineProperty(n,u,{configurable:!1,enumerable:!0,get:M})},e.n=function(n){var u=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(u,"a",u),u},e.o=function(n,u){return Object.prototype.hasOwnProperty.call(n,u)},e.p="",e(e.s=18)}([function(t,e,a){(function(n){var u;u=typeof window!="undefined"?window:n!==void 0?n:typeof self!="undefined"?self:{},t.exports=u}).call(e,a(20))},function(t,e){function a(k,N,F){switch(F.length){case 0:return k.call(N);case 1:return k.call(N,F[0]);case 2:return k.call(N,F[0],F[1]);case 3:return k.call(N,F[0],F[1],F[2])}return k.apply(N,F)}function n(k,N){for(var F=-1,H=Array(k);++F<k;)H[F]=N(F);return H}function u(k,N){var F=w(k)||T(k)?n(k.length,String):[],H=F.length,W=!!H;for(var B in k)!N&&!h.call(k,B)||W&&(B=="length"||A(B,H))||F.push(B);return F}function M(k,N,F){var H=k[N];h.call(k,N)&&L(H,F)&&(F!==void 0||N in k)||(k[N]=F)}function y(k){if(!R(k))return O(k);var N=[];for(var F in Object(k))h.call(k,F)&&F!="constructor"&&N.push(F);return N}function I(k,N){return N=C(N===void 0?k.length-1:N,0),function(){for(var F=arguments,H=-1,W=C(F.length-N,0),B=Array(W);++H<W;)B[H]=F[N+H];H=-1;for(var j=Array(N+1);++H<N;)j[H]=F[H];return j[N]=B,a(k,this,j)}}function x(k,N,F,H){F||(F={});for(var W=-1,B=N.length;++W<B;){var j=N[W],V=H?H(F[j],k[j],j,F,k):void 0;M(F,j,V===void 0?k[j]:V)}return F}function A(k,N){return!!(N=N==null?s:N)&&(typeof k=="number"||E.test(k))&&k>-1&&k%1==0&&k<N}function D(k,N,F){if(!m(F))return!1;var H=typeof N;return!!(H=="number"?S(F)&&A(N,F.length):H=="string"&&N in F)&&L(F[N],k)}function R(k){var N=k&&k.constructor;return k===(typeof N=="function"&&N.prototype||g)}function L(k,N){return k===N||k!==k&&N!==N}function T(k){return c(k)&&h.call(k,"callee")&&(!_.call(k,"callee")||b.call(k)==v)}function S(k){return k!=null&&f(k.length)&&!i(k)}function c(k){return d(k)&&S(k)}function i(k){var N=m(k)?b.call(k):"";return N==p||N==o}function f(k){return typeof k=="number"&&k>-1&&k%1==0&&k<=s}function m(k){var N=typeof k;return!!k&&(N=="object"||N=="function")}function d(k){return!!k&&typeof k=="object"}function l(k){return S(k)?u(k):y(k)}var s=9007199254740991,v="[object Arguments]",p="[object Function]",o="[object GeneratorFunction]",E=/^(?:0|[1-9]\d*)$/,g=Object.prototype,h=g.hasOwnProperty,b=g.toString,_=g.propertyIsEnumerable,O=function(k,N){return function(F){return k(N(F))}}(Object.keys,Object),C=Math.max,P=!_.call({valueOf:1},"valueOf"),w=Array.isArray,U=function(k){return I(function(N,F){var H=-1,W=F.length,B=W>1?F[W-1]:void 0,j=W>2?F[2]:void 0;for(B=k.length>3&&typeof B=="function"?(W--,B):void 0,j&&D(F[0],F[1],j)&&(B=W<3?void 0:B,W=1),N=Object(N);++H<W;){var V=F[H];V&&k(N,V,H,B)}return N})}(function(k,N){if(P||R(N)||S(N))return void x(N,l(N),k);for(var F in N)h.call(N,F)&&M(k,F,N[F])});t.exports=U},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a(0),u=function(y){return y&&y.__esModule?y:{default:y}}(n),M={};M.now=function(){var y=u.default.performance,I=y&&y.timing;return I&&typeof I.navigationStart=="number"&&typeof y.now=="function"?I.navigationStart+y.now():Date.now()},e.default=M},function(t,e,a){"use strict";function n(u,M,y){y=y===void 0?1:y,u[M]=u[M]||0,u[M]+=y}Object.defineProperty(e,"__esModule",{value:!0}),e.default=n},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a(21),u=function(y){return y&&y.__esModule?y:{default:y}}(n),M=u.default.methodFactory;u.default.methodFactory=function(y,I,x){var A=M(y,I,x);return function(){for(var D=["[mux]"],R=0;R<arguments.length;R++)D.push(arguments[R]);A.apply(void 0,D)}},u.default.setLevel(u.default.getLevel()),e.default=u.default},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(y){return M(y)[0]},u=function(y){return M(y)[1]},M=function(y){if(typeof y!="string"||y==="")return["localhost"];var I=/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,x=y.match(I)||[],A=x[4],D=void 0;return A&&(D=(A.match(/[^\.]+\.[^\.]+$/)||[])[0]),[A,D]};e.extractHostnameAndDomain=M,e.extractHostname=n,e.extractDomain=u},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(M){var y=16*Math.random()|0;return(M==="x"?y:3&y|8).toString(16)})},u=function(){return("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6)};e.generateUUID=n,e.generateShortID=u},function(t,e,a){"use strict";function n(M){M=M||"";var y={};return M.trim().split(/[\r\n]+/).forEach(function(I){if(I){var x=I.split(": "),A=x.shift();A&&(u.indexOf(A.toLowerCase())>=0||A.toLowerCase().indexOf("x-litix-")===0)&&(y[A]=x.join(": "))}}),y}Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;var u=["x-cdn","content-type"]},function(t,e,a){"use strict";var n=SyntaxError,u=Function,M=TypeError,y=function(h){try{return u('"use strict"; return ('+h+").constructor;")()}catch{}},I=Object.getOwnPropertyDescriptor;if(I)try{I({},"")}catch{I=null}var x=function(){throw new M},A=I?function(){try{return arguments.callee,x}catch{try{return I(arguments,"callee").get}catch{return x}}}():x,D=a(43)(),R=Object.getPrototypeOf||function(h){return h.__proto__},L={},T=typeof Uint8Array=="undefined"?void 0:R(Uint8Array),S={"%AggregateError%":typeof AggregateError=="undefined"?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":D?R([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":L,"%AsyncGenerator%":L,"%AsyncGeneratorFunction%":L,"%AsyncIteratorPrototype%":L,"%Atomics%":typeof Atomics=="undefined"?void 0:Atomics,"%BigInt%":typeof BigInt=="undefined"?void 0:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array=="undefined"?void 0:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?void 0:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?void 0:FinalizationRegistry,"%Function%":u,"%GeneratorFunction%":L,"%Int8Array%":typeof Int8Array=="undefined"?void 0:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?void 0:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":D?R(R([][Symbol.iterator]())):void 0,"%JSON%":typeof JSON=="object"?JSON:void 0,"%Map%":typeof Map=="undefined"?void 0:Map,"%MapIteratorPrototype%":typeof Map!="undefined"&&D?R(new Map()[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?void 0:Promise,"%Proxy%":typeof Proxy=="undefined"?void 0:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect=="undefined"?void 0:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?void 0:Set,"%SetIteratorPrototype%":typeof Set!="undefined"&&D?R(new Set()[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":D?R(""[Symbol.iterator]()):void 0,"%Symbol%":D?Symbol:void 0,"%SyntaxError%":n,"%ThrowTypeError%":A,"%TypedArray%":T,"%TypeError%":M,"%Uint8Array%":typeof Uint8Array=="undefined"?void 0:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?void 0:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?void 0:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?void 0:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap=="undefined"?void 0:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?void 0:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?void 0:WeakSet},c=function h(b){var _;if(b==="%AsyncFunction%")_=y("async function () {}");else if(b==="%GeneratorFunction%")_=y("function* () {}");else if(b==="%AsyncGeneratorFunction%")_=y("async function* () {}");else if(b==="%AsyncGenerator%"){var O=h("%AsyncGeneratorFunction%");O&&(_=O.prototype)}else if(b==="%AsyncIteratorPrototype%"){var C=h("%AsyncGenerator%");C&&(_=R(C.prototype))}return S[b]=_,_},i={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},f=a(9),m=a(46),d=f.call(Function.call,Array.prototype.concat),l=f.call(Function.apply,Array.prototype.splice),s=f.call(Function.call,String.prototype.replace),v=f.call(Function.call,String.prototype.slice),p=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,o=/\\(\\)?/g,E=function(h){var b=v(h,0,1),_=v(h,-1);if(b==="%"&&_!=="%")throw new n("invalid intrinsic syntax, expected closing `%`");if(_==="%"&&b!=="%")throw new n("invalid intrinsic syntax, expected opening `%`");var O=[];return s(h,p,function(C,P,w,U){O[O.length]=w?s(U,o,"$1"):P||C}),O},g=function(h,b){var _,O=h;if(m(i,O)&&(_=i[O],O="%"+_[0]+"%"),m(S,O)){var C=S[O];if(C===L&&(C=c(O)),C===void 0&&!b)throw new M("intrinsic "+h+" exists, but is not available. Please file an issue!");return{alias:_,name:O,value:C}}throw new n("intrinsic "+h+" does not exist!")};t.exports=function(h,b){if(typeof h!="string"||h.length===0)throw new M("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof b!="boolean")throw new M('"allowMissing" argument must be a boolean');var _=E(h),O=_.length>0?_[0]:"",C=g("%"+O+"%",b),P=C.name,w=C.value,U=!1,k=C.alias;k&&(O=k[0],l(_,d([0,1],k)));for(var N=1,F=!0;N<_.length;N+=1){var H=_[N],W=v(H,0,1),B=v(H,-1);if((W==='"'||W==="'"||W==="`"||B==='"'||B==="'"||B==="`")&&W!==B)throw new n("property names with quotes must have matching quotes");if(H!=="constructor"&&F||(U=!0),O+="."+H,P="%"+O+"%",m(S,P))w=S[P];else if(w!=null){if(!(H in w)){if(!b)throw new M("base intrinsic for "+h+" exists, but the property is not available.");return}if(I&&N+1>=_.length){var j=I(w,H);F=!!j,w=F&&"get"in j&&!("originalValue"in j.get)?j.get:w[H]}else F=m(w,H),w=w[H];F&&!U&&(S[P]=w)}}return w}},function(t,e,a){"use strict";var n=a(45);t.exports=Function.prototype.bind||n},function(t,e,a){"use strict";var n=String.prototype.replace,u=/%20/g,M={RFC1738:"RFC1738",RFC3986:"RFC3986"};t.exports={default:M.RFC3986,formatters:{RFC1738:function(y){return n.call(y,u,"+")},RFC3986:function(y){return String(y)}},RFC1738:M.RFC1738,RFC3986:M.RFC3986}},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.findMediaElement=e.getMuxPlayerId=void 0;var n=a(6),u=function(y){return y&&y.nodeName!==void 0?(y.muxId||(y.muxId=y.id||(0,n.generateShortID)()),y.muxId):y},M=function(y){var I=void 0;return y&&y.nodeName!==void 0?(I=y,y=u(I)):I=document.querySelector(y),[I,y,I&&I.nodeName?I.nodeName.toLowerCase():""]};e.getMuxPlayerId=u,e.findMediaElement=M},function(t,e,a){"use strict";function n(){return(M.default.doNotTrack||M.default.navigator&&(M.default.navigator.doNotTrack||M.default.navigator.msDoNotTrack))==="1"}Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;var u=a(0),M=function(y){return y&&y.__esModule?y:{default:y}}(u)},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a(0),u=function(y){return y&&y.__esModule?y:{default:y}}(n),M={};M.exists=function(){var y=u.default.performance;return(y&&y.timing)!==void 0},M.domContentLoadedEventEnd=function(){var y=u.default.performance,I=y&&y.timing;return I&&I.domContentLoadedEventEnd},M.navigationStart=function(){var y=u.default.performance,I=y&&y.timing;return I&&I.navigationStart},e.default=M},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(u){var M={};for(var y in u){var I=u[y];I["DATA-ID"].search("io.litix.data.")!==-1&&(M[I["DATA-ID"].replace("io.litix.data.","")]=I.VALUE)}return M};e.default=n},function(t,e,a){"use strict";var n=a(41),u=a(51),M=a(10);t.exports={formats:M,parse:u,stringify:n}},function(t,e,a){"use strict";var n=a(10),u=Object.prototype.hasOwnProperty,M=Array.isArray,y=function(){for(var m=[],d=0;d<256;++d)m.push("%"+((d<16?"0":"")+d.toString(16)).toUpperCase());return m}(),I=function(m){for(;m.length>1;){var d=m.pop(),l=d.obj[d.prop];if(M(l)){for(var s=[],v=0;v<l.length;++v)l[v]!==void 0&&s.push(l[v]);d.obj[d.prop]=s}}},x=function(m,d){for(var l=d&&d.plainObjects?Object.create(null):{},s=0;s<m.length;++s)m[s]!==void 0&&(l[s]=m[s]);return l},A=function m(d,l,s){if(!l)return d;if(typeof l!="object"){if(M(d))d.push(l);else{if(!d||typeof d!="object")return[d,l];(s&&(s.plainObjects||s.allowPrototypes)||!u.call(Object.prototype,l))&&(d[l]=!0)}return d}if(!d||typeof d!="object")return[d].concat(l);var v=d;return M(d)&&!M(l)&&(v=x(d,s)),M(d)&&M(l)?(l.forEach(function(p,o){if(u.call(d,o)){var E=d[o];E&&typeof E=="object"&&p&&typeof p=="object"?d[o]=m(E,p,s):d.push(p)}else d[o]=p}),d):Object.keys(l).reduce(function(p,o){var E=l[o];return u.call(p,o)?p[o]=m(p[o],E,s):p[o]=E,p},v)},D=function(m,d){return Object.keys(d).reduce(function(l,s){return l[s]=d[s],l},m)},R=function(m,d,l){var s=m.replace(/\+/g," ");if(l==="iso-8859-1")return s.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(s)}catch{return s}},L=function(m,d,l,s,v){if(m.length===0)return m;var p=m;if(typeof m=="symbol"?p=Symbol.prototype.toString.call(m):typeof m!="string"&&(p=String(m)),l==="iso-8859-1")return escape(p).replace(/%u[0-9a-f]{4}/gi,function(h){return"%26%23"+parseInt(h.slice(2),16)+"%3B"});for(var o="",E=0;E<p.length;++E){var g=p.charCodeAt(E);g===45||g===46||g===95||g===126||g>=48&&g<=57||g>=65&&g<=90||g>=97&&g<=122||v===n.RFC1738&&(g===40||g===41)?o+=p.charAt(E):g<128?o+=y[g]:g<2048?o+=y[192|g>>6]+y[128|63&g]:g<55296||g>=57344?o+=y[224|g>>12]+y[128|g>>6&63]+y[128|63&g]:(E+=1,g=65536+((1023&g)<<10|1023&p.charCodeAt(E)),o+=y[240|g>>18]+y[128|g>>12&63]+y[128|g>>6&63]+y[128|63&g])}return o},T=function(m){for(var d=[{obj:{o:m},prop:"o"}],l=[],s=0;s<d.length;++s)for(var v=d[s],p=v.obj[v.prop],o=Object.keys(p),E=0;E<o.length;++E){var g=o[E],h=p[g];typeof h=="object"&&h!==null&&l.indexOf(h)===-1&&(d.push({obj:p,prop:g}),l.push(h))}return I(d),m},S=function(m){return Object.prototype.toString.call(m)==="[object RegExp]"},c=function(m){return!(!m||typeof m!="object")&&!!(m.constructor&&m.constructor.isBuffer&&m.constructor.isBuffer(m))},i=function(m,d){return[].concat(m,d)},f=function(m,d){if(M(m)){for(var l=[],s=0;s<m.length;s+=1)l.push(d(m[s]));return l}return d(m)};t.exports={arrayToObject:x,assign:D,combine:i,compact:T,decode:R,encode:L,isBuffer:c,isRegExp:S,maybeMap:f,merge:A}},function(t,e,a){"use strict";function n(S){return S&&S.__esModule?S:{default:S}}function u(S){var c={};for(var i in S)S.hasOwnProperty(i)&&(c[S[i]]=i);return c}function M(S){var c={},i={};return Object.keys(S).forEach(function(f){var m=!1;if(S.hasOwnProperty(f)&&S[f]!==void 0){var d=f.split("_"),l=d[0],s=R[l];s||(I.default.info("Data key word `"+d[0]+"` not expected in "+f),s=l+"_"),d.splice(1).forEach(function(v){v==="url"&&(m=!0),T[v]?s+=T[v]:Number(v)&&Math.floor(Number(v))===Number(v)?s+=v:(I.default.info("Data key word `"+v+"` not expected in "+f),s+="_"+v+"_")}),m?i[s]=S[f]:c[s]=S[f]}}),(0,A.default)(c,i)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=M;var y=a(4),I=n(y),x=a(1),A=n(x),D={a:"env",b:"beacon",c:"custom",d:"ad",e:"event",f:"experiment",i:"internal",m:"mux",n:"response",p:"player",q:"request",r:"retry",s:"session",t:"timestamp",u:"viewer",v:"video",w:"page",x:"view",y:"sub"},R=u(D),L={ad:"ad",ag:"aggregate",ap:"api",al:"application",ar:"architecture",as:"asset",au:"autoplay",av:"average",bi:"bitrate",br:"break",bw:"browser",by:"bytes",ca:"cached",cb:"cancel",cd:"code",cg:"category",ch:"changed",cn:"config",co:"count",ce:"counter",cp:"complete",cr:"creative",ct:"content",cu:"current",cx:"connection",dg:"downscaling",dm:"domain",dn:"cdn",do:"downscale",du:"duration",dv:"device",ec:"encoding",ed:"edge",en:"end",eg:"engine",em:"embed",er:"error",es:"errorcode",et:"errortext",ee:"event",ev:"events",ex:"expires",ep:"experiments",fi:"first",fm:"family",ft:"format",fq:"frequency",fr:"frame",fs:"fullscreen",hb:"holdback",he:"headers",ho:"host",hn:"hostname",ht:"height",id:"id",ii:"init",in:"instance",ip:"ip",is:"is",ke:"key",la:"language",lb:"labeled",le:"level",li:"live",ld:"loaded",lo:"load",ls:"lists",lt:"latency",ma:"max",md:"media",me:"message",mf:"manifest",mi:"mime",ml:"midroll",mm:"min",mn:"manufacturer",mo:"model",mx:"mux",ne:"newest",nm:"name",no:"number",on:"on",os:"os",pa:"paused",pb:"playback",pd:"producer",pe:"percentage",pf:"played",pg:"program",ph:"playhead",pi:"plugin",pl:"preroll",pn:"playing",po:"poster",pr:"preload",ps:"position",pt:"part",py:"property",ra:"rate",rd:"requested",re:"rebuffer",rf:"rendition",rm:"remote",ro:"ratio",rp:"response",rq:"request",rs:"requests",sa:"sample",se:"session",sk:"seek",sm:"stream",so:"source",sq:"sequence",sr:"series",st:"start",su:"startup",sv:"server",sw:"software",ta:"tag",tc:"tech",te:"text",tg:"target",th:"throughput",ti:"time",tl:"total",to:"to",tt:"title",ty:"type",ug:"upscaling",up:"upscale",ur:"url",us:"user",va:"variant",vd:"viewed",vi:"video",ve:"version",vw:"view",vr:"viewer",wd:"width",wa:"watch",wt:"waiting"},T=u(L)},function(t,e,a){"use strict";t.exports=a(19).default},function(t,e,a){"use strict";function n(o){return o&&o.__esModule?o:{default:o}}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function o(E,g){var h=[],b=!0,_=!1,O=void 0;try{for(var C,P=E[Symbol.iterator]();!(b=(C=P.next()).done)&&(h.push(C.value),!g||h.length!==g);b=!0);}catch(w){_=!0,O=w}finally{try{!b&&P.return&&P.return()}finally{if(_)throw O}}return h}return function(E,g){if(Array.isArray(E))return E;if(Symbol.iterator in Object(E))return o(E,g);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),M=a(0),y=n(M),I=a(11),x=a(4),A=n(x),D=a(12),R=n(D),L=a(2),T=n(L),S=a(22),c=n(S),i=a(58),f=n(i),m=a(59),d=n(m),l=a(64),s=n(l),v={},p=function o(E){var g=arguments;typeof E=="string"?o.hasOwnProperty(E)?y.default.setTimeout(function(){g=Array.prototype.splice.call(g,1),o[E].apply(null,g)},0):A.default.warn("`"+E+"` is an unknown task"):typeof E=="function"?y.default.setTimeout(function(){E(o)},0):A.default.warn("`"+E+"` is invalid.")};p.loaded=T.default.now(),p.NAME="mux-embed",p.VERSION="4.8.0",p.API_VERSION="2.1",p.PLAYER_TRACKED=!1,p.monitor=function(o,E){return(0,f.default)(p,o,E)},p.destroyMonitor=function(o){var E=(0,I.findMediaElement)(o),g=u(E,1),h=g[0];h&&h.mux&&typeof h.mux.destroy=="function"?h.mux.destroy():A.default.error("A video element monitor for `"+o+"` has not been initialized via `mux.monitor`.")},p.addHLSJS=function(o,E){var g=(0,I.getMuxPlayerId)(o);v[g]?v[g].addHLSJS(E):A.default.error("A monitor for `"+g+"` has not been initialized.")},p.addDashJS=function(o,E){var g=(0,I.getMuxPlayerId)(o);v[g]?v[g].addDashJS(E):A.default.error("A monitor for `"+g+"` has not been initialized.")},p.removeHLSJS=function(o){var E=(0,I.getMuxPlayerId)(o);v[E]?v[E].removeHLSJS():A.default.error("A monitor for `"+E+"` has not been initialized.")},p.removeDashJS=function(o){var E=(0,I.getMuxPlayerId)(o);v[E]?v[E].removeDashJS():A.default.error("A monitor for `"+E+"` has not been initialized.")},p.init=function(o,E){(0,R.default)()&&E&&E.respectDoNotTrack&&A.default.info("The browser's Do Not Track flag is enabled - Mux beaconing is disabled.");var g=(0,I.getMuxPlayerId)(o);v[g]=new c.default(p,g,E)},p.emit=function(o,E,g){var h=(0,I.getMuxPlayerId)(o);v[h]?(v[h].emit(E,g),E==="destroy"&&delete v[h]):A.default.error("A monitor for `"+h+"` has not been initialized.")},y.default!==void 0&&typeof y.default.addEventListener=="function"&&y.default.addEventListener("pagehide",function(o){o.persisted||(p.WINDOW_UNLOADING=!0)},!1),p.checkDoNotTrack=R.default,p.log=A.default,p.utils=d.default,p.events=s.default,e.default=p},function(t,e){var a;a=function(){return this}();try{a=a||Function("return this")()||(0,eval)("this")}catch{typeof window=="object"&&(a=window)}t.exports=a},function(t,e,a){var n,u;(function(M,y){"use strict";n=y,(u=typeof n=="function"?n.call(e,a,e,t):n)!==void 0&&(t.exports=u)})(0,function(){"use strict";function M(d,l){var s=d[l];if(typeof s.bind=="function")return s.bind(d);try{return Function.prototype.bind.call(s,d)}catch{return function(){return Function.prototype.apply.apply(s,[d,arguments])}}}function y(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function I(d){return d==="debug"&&(d="log"),typeof console!==T&&(d==="trace"&&S?y:console[d]!==void 0?M(console,d):console.log!==void 0?M(console,"log"):L)}function x(d,l){for(var s=0;s<c.length;s++){var v=c[s];this[v]=s<d?L:this.methodFactory(v,d,l)}this.log=this.debug}function A(d,l,s){return function(){typeof console!==T&&(x.call(this,l,s),this[d].apply(this,arguments))}}function D(d,l,s){return I(d)||A.apply(this,arguments)}function R(d,l,s){function v(_){var O=(c[_]||"silent").toUpperCase();if(typeof window!==T&&h){try{return void(window.localStorage[h]=O)}catch{}try{window.document.cookie=encodeURIComponent(h)+"="+O+";"}catch{}}}function p(){var _;if(typeof window!==T&&h){try{_=window.localStorage[h]}catch{}if(typeof _===T)try{var O=window.document.cookie,C=O.indexOf(encodeURIComponent(h)+"=");C!==-1&&(_=/^([^;]+)/.exec(O.slice(C))[1])}catch{}return g.levels[_]===void 0&&(_=void 0),_}}function o(){if(typeof window!==T&&h){try{return void window.localStorage.removeItem(h)}catch{}try{window.document.cookie=encodeURIComponent(h)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}var E,g=this;l=l==null?"WARN":l;var h="loglevel";typeof d=="string"?h+=":"+d:typeof d=="symbol"&&(h=void 0),g.name=d,g.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},g.methodFactory=s||D,g.getLevel=function(){return E},g.setLevel=function(_,O){if(typeof _=="string"&&g.levels[_.toUpperCase()]!==void 0&&(_=g.levels[_.toUpperCase()]),!(typeof _=="number"&&_>=0&&_<=g.levels.SILENT))throw"log.setLevel() called with invalid level: "+_;if(E=_,O!==!1&&v(_),x.call(g,_,d),typeof console===T&&_<g.levels.SILENT)return"No console available for logging"},g.setDefaultLevel=function(_){l=_,p()||g.setLevel(_,!1)},g.resetLevel=function(){g.setLevel(l,!1),o()},g.enableAll=function(_){g.setLevel(g.levels.TRACE,_)},g.disableAll=function(_){g.setLevel(g.levels.SILENT,_)};var b=p();b==null&&(b=l),g.setLevel(b,!1)}var L=function(){},T="undefined",S=typeof window!==T&&typeof window.navigator!==T&&/Trident\/|MSIE /.test(window.navigator.userAgent),c=["trace","debug","info","warn","error"],i=new R,f={};i.getLogger=function(d){if(typeof d!="symbol"&&typeof d!="string"||d==="")throw new TypeError("You must supply a name when creating a logger.");var l=f[d];return l||(l=f[d]=new R(d,i.getLevel(),i.methodFactory)),l};var m=typeof window!==T?window.log:void 0;return i.noConflict=function(){return typeof window!==T&&window.log===i&&(window.log=m),i},i.getLoggers=function(){return f},i.default=i,i})},function(t,e,a){"use strict";function n(q){return q&&q.__esModule?q:{default:q}}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function q(ie,ne){var Te=[],Se=!0,he=!1,Oe=void 0;try{for(var Ce,Ue=ie[Symbol.iterator]();!(Se=(Ce=Ue.next()).done)&&(Te.push(Ce.value),!ne||Te.length!==ne);Se=!0);}catch(me){he=!0,Oe=me}finally{try{!Se&&Ue.return&&Ue.return()}finally{if(he)throw Oe}}return Te}return function(ie,ne){if(Array.isArray(ie))return ie;if(Symbol.iterator in Object(ie))return q(ie,ne);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),M=a(4),y=n(M),I=a(1),x=n(I),A=a(6),D=a(5),R=a(0),L=n(R),T=a(13),S=n(T),c=a(3),i=n(c),f=a(23),m=a(24),d=a(25),l=n(d),s=a(26),v=n(s),p=a(27),o=n(p),E=a(28),g=n(E),h=a(29),b=n(h),_=a(30),O=n(_),C=a(31),P=n(C),w=a(32),U=n(w),k=a(33),N=n(k),F=a(34),H=n(F),W=a(35),B=n(W),j=a(36),V=n(j),Y=a(37),Q=n(Y),J=a(38),z=n(J),te=a(39),se=n(te),Z=a(57),Ee=n(Z),fe=["viewstart","ended","loadstart","pause","play","playing","ratechange","waiting","adplay","adpause","adended","aderror","adplaying","adrequest","adresponse","adbreakstart","adbreakend","adfirstquartile","admidpoint","adthirdquartile","rebufferstart","rebufferend","seeked","error","hb","requestcompleted","requestfailed","requestcanceled","renditionchange"],re=function(q,ie,ne){var Te=this;this.DOM_CONTENT_LOADED_EVENT_END=S.default.domContentLoadedEventEnd(),this.NAVIGATION_START=S.default.navigationStart();var Se={debug:!1,minimumRebufferDuration:250,sustainedRebufferThreshold:1e3,playbackHeartbeatTime:25,beaconDomain:"litix.io",sampleRate:1,disableCookies:!1,respectDoNotTrack:!1,disableRebufferTracking:!1,disablePlayheadRebufferTracking:!1,errorTranslator:function(me){return me}};this.mux=q,this.id=ie,ne=(0,x.default)(Se,ne),ne.data=ne.data||{},ne.data.property_key&&(ne.data.env_key=ne.data.property_key,delete ne.data.property_key),y.default.setLevel(ne.debug?"debug":"warn"),this.getPlayheadTime=ne.getPlayheadTime,this.getStateData=ne.getStateData||function(){},this.getAdData=ne.getAdData||function(){},this.minimumRebufferDuration=ne.minimumRebufferDuration,this.sustainedRebufferThreshold=ne.sustainedRebufferThreshold,this.playbackHeartbeatTime=ne.playbackHeartbeatTime,this.disableRebufferTracking=ne.disableRebufferTracking,this.disableRebufferTracking&&this.mux.log.warn("Disabling rebuffer tracking. This should only be used in specific circumstances as a last resort when your player is known to unreliably track rebuffering."),this.errorTranslator=ne.errorTranslator,this.playbackEventDispatcher=new se.default(q,ne.data.env_key,ne),this.data={player_instance_id:(0,A.generateUUID)(),mux_sample_rate:ne.sampleRate,beacon_domain:ne.beaconCollectionDomain?ne.beaconCollectionDomain:ne.beaconDomain},this.data.view_sequence_number=1,this.data.player_sequence_number=1,this.oldEmit=this.emit,this.emit=function(me,Ae){Ae=(0,x.default)({viewer_time:this.mux.utils.now()},Ae),this.oldEmit(me,Ae)};var he=function(){this.data.view_start===void 0&&(this.data.view_start=this.mux.utils.now(),this.emit("viewstart"))}.bind(this);this.on("viewinit",function(me,Ae){this._resetVideoData(),this._resetViewData(),this._resetErrorData(),this._updateStateData(),(0,x.default)(this.data,Ae),this._initializeViewData(),this.one("play",he),this.one("adbreakstart",he)});var Oe=function(me){this.emit("viewend"),this.send("viewend"),this.emit("viewinit",me)}.bind(this);if(this.on("videochange",function(me,Ae){Oe(Ae)}),this.on("programchange",function(me,Ae){this.data.player_is_paused&&this.mux.log.warn("The `programchange` event is intended to be used when the content changes mid playback without the video source changing, however the video is not currently playing. If the video source is changing please use the videochange event otherwise you will lose startup time information."),Oe((0,x.default)(Ae,{view_program_changed:!0})),he(),this.emit("play"),this.emit("playing")}),this.on("fragmentchange",function(me,Ae){this.currentFragmentPDT=Ae.currentFragmentPDT,this.currentFragmentStart=Ae.currentFragmentStart}),this.on("destroy",this.destroy),L.default!==void 0&&typeof L.default.addEventListener=="function"&&typeof L.default.removeEventListener=="function"){var Ce=function(me){me.persisted||Te.destroy()};L.default.addEventListener("pagehide",Ce,!1),this.on("destroy",function(){L.default.removeEventListener("pagehide",Ce)})}this.on("playerready",function(me,Ae){(0,x.default)(this.data,Ae)}),fe.forEach(function(me){Te.on(me,function(Ae,Re){me.indexOf("ad")!==0&&this._updateStateData(),(0,x.default)(this.data,Re),this._sanitizeData()}),Te.on("after"+me,function(){(me!=="error"||this.viewErrored)&&this.send(me)})}),this.on("viewend",function(me,Ae){(0,x.default)(Te.data,Ae)});var Ue=function(me){var Ae=this.mux.utils.now();this.data.player_init_time&&(this.data.player_startup_time=Ae-this.data.player_init_time),!this.mux.PLAYER_TRACKED&&this.NAVIGATION_START&&(this.mux.PLAYER_TRACKED=!0,(this.data.player_init_time||this.DOM_CONTENT_LOADED_EVENT_END)&&(this.data.page_load_time=Math.min(this.data.player_init_time||1/0,this.DOM_CONTENT_LOADED_EVENT_END||1/0)-this.NAVIGATION_START)),this.send("playerready"),delete this.data.player_startup_time,delete this.data.page_load_time};this.one("playerready",Ue),o.default.apply(this),z.default.apply(this),B.default.apply(this),O.default.apply(this),v.default.apply(this),H.default.apply(this),g.default.apply(this),b.default.apply(this),V.default.apply(this),P.default.apply(this),U.default.apply(this),N.default.apply(this),Q.default.apply(this),Ee.default.apply(this),ne.hlsjs&&this.addHLSJS(ne),ne.dashjs&&this.addDashJS(ne),this.emit("viewinit",ne.data)};(0,x.default)(re.prototype,l.default.prototype),(0,x.default)(re.prototype,O.default.prototype),(0,x.default)(re.prototype,B.default.prototype),(0,x.default)(re.prototype,v.default.prototype),(0,x.default)(re.prototype,g.default.prototype),(0,x.default)(re.prototype,b.default.prototype),(0,x.default)(re.prototype,V.default.prototype),(0,x.default)(re.prototype,U.default.prototype),(0,x.default)(re.prototype,N.default.prototype),re.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.data.view_start!==void 0&&(this.emit("viewend"),this.send("viewend")),this.playbackEventDispatcher.destroy(),this.removeHLSJS(),this.removeDashJS(),L.default.clearTimeout(this._heartBeatTimeout))},re.prototype.send=function(q){var ie=(0,x.default)({},this.data),ne=["player_program_time","player_manifest_newest_program_time","video_holdback","video_part_holdback","video_target_duration","video_part_target_duration"];if(ie.video_source_is_live===void 0&&(ie.player_source_duration===1/0||ie.video_source_duration===1/0?ie.video_source_is_live=!0:(ie.player_source_duration>0||ie.video_source_duration>0)&&(ie.video_source_is_live=!1)),ie.video_source_is_live||ne.forEach(function(Ce){ie[Ce]=void 0}),ie.video_source_url=ie.video_source_url||ie.player_source_url,ie.video_source_url){var Te=(0,D.extractHostnameAndDomain)(ie.video_source_url),Se=u(Te,2),he=Se[0],Oe=Se[1];ie.video_source_domain=Oe,ie.video_source_hostname=he}delete ie.ad_request_id,this.playbackEventDispatcher.send(q,ie),this.data.view_sequence_number++,this.data.player_sequence_number++,this._restartHeartBeat()},re.prototype._updateStateData=function(){(0,x.default)(this.data,this.getStateData()),this._updatePlayheadTime(),this._sanitizeData()},re.prototype._sanitizeData=function(){var q=this;["player_width","player_height","video_source_width","video_source_height","player_playhead_time","video_source_bitrate"].forEach(function(ie){var ne=parseInt(q.data[ie],10);q.data[ie]=isNaN(ne)?void 0:ne}),["player_source_url","video_source_url"].forEach(function(ie){if(q.data[ie]){var ne=q.data[ie].toLowerCase();ne.indexOf("data:")!==0&&ne.indexOf("blob:")!==0||(q.data[ie]="MSE style URL")}})},re.prototype._resetVideoData=function(q,ie){var ne=this;Object.keys(this.data).forEach(function(Te){Te.indexOf("video_")===0&&delete ne.data[Te]})},re.prototype._resetViewData=function(){var q=this;Object.keys(this.data).forEach(function(ie){ie.indexOf("view_")===0&&delete q.data[ie]}),this.data.view_sequence_number=1},re.prototype._resetErrorData=function(q,ie){delete this.data.player_error_code,delete this.data.player_error_message},re.prototype._initializeViewData=function(){var q=this,ie=this.data.view_id=(0,A.generateUUID)(),ne=function(){ie===q.data.view_id&&(0,i.default)(q.data,"player_view_count",1)};this.data.player_is_paused?this.one("play",ne):ne()},re.prototype._restartHeartBeat=function(){var q=this;L.default.clearTimeout(this._heartBeatTimeout),this.viewErrored||(this._heartBeatTimeout=L.default.setTimeout(function(){q.data.player_is_paused||q.emit("hb")},1e4))},re.prototype.addHLSJS=function(q){return q.hlsjs?this.hlsjs?void this.mux.log.warn("An instance of HLS.js is already being monitored for this player."):(this.hlsjs=q.hlsjs,void(0,f.monitorHlsJs)(this.mux,this.id,q.hlsjs,{},q.Hls||L.default.Hls)):void this.mux.log.warn("You must pass a valid hlsjs instance in order to track it.")},re.prototype.removeHLSJS=function(){this.hlsjs&&((0,f.stopMonitoringHlsJs)(this.hlsjs),this.hlsjs=void 0)},re.prototype.addDashJS=function(q){return q.dashjs?this.dashjs?void this.mux.log.warn("An instance of Dash.js is already being monitored for this player."):(this.dashjs=q.dashjs,void(0,m.monitorDashJS)(this.mux,this.id,q.dashjs)):void this.mux.log.warn("You must pass a valid dashjs instance in order to track it.")},re.prototype.removeDashJS=function(){this.dashjs&&((0,m.stopMonitoringDashJS)(this.dashjs),this.dashjs=void 0)},e.default=re},function(t,e,a){"use strict";function n(c){return c&&c.__esModule?c:{default:c}}Object.defineProperty(e,"__esModule",{value:!0}),e.stopMonitoringHlsJs=e.monitorHlsJs=void 0;var u=a(7),M=n(u),y=a(13),I=n(y),x=a(5),A=a(14),D=n(A),R=function(c){if(!c)return{};var i=I.default.navigationStart(),f=c.loading,m=f?f.start:c.trequest,d=f?f.first:c.tfirst,l=f?f.end:c.tload;return{bytesLoaded:c.total,requestStart:Math.round(i+m),responseStart:Math.round(i+d),responseEnd:Math.round(i+l)}},L=function(c){if(c&&typeof c.getAllResponseHeaders=="function")return(0,M.default)(c.getAllResponseHeaders())},T=function(c,i,f){var m=(arguments.length>3&&arguments[3]!==void 0&&arguments[3],arguments[4]),d=c.log,l=c.utils.secondsToMs,s=function(C){var P=parseInt(m.version),w=void 0;return P===1&&C.programDateTime!==null&&(w=C.programDateTime),P===0&&C.pdt!==null&&(w=C.pdt),w};if(!I.default.exists())return void d.warn("performance timing not supported. Not tracking HLS.js.");var v=function(C,P){return c.emit(i,C,P)},p=function(C,P){var w=P.levels,U=P.audioTracks,k=P.url,N=P.stats,F=P.networkDetails,H=P.sessionData,W={},B={},j={};j=(0,D.default)(H),w.forEach(function(te,se){W[se]={width:te.width,height:te.height,bitrate:te.bitrate,attrs:te.attrs}}),U.forEach(function(te,se){B[se]={name:te.name,language:te.lang,bitrate:te.bitrate}});var V=R(N),Y=V.bytesLoaded,Q=V.requestStart,J=V.responseStart,z=V.responseEnd;j.request_event_type=C,j.request_bytes_loaded=Y,j.request_start=Q,j.request_response_start=J,j.request_response_end=z,j.request_type="manifest",j.request_hostname=(0,x.extractHostname)(k),j.request_response_headers=L(F),j.request_rendition_lists={media:W,audio:B,video:{}},v("requestcompleted",j)};f.on(m.Events.MANIFEST_LOADED,p);var o=function(C,P){var w=P.details,U=P.level,k=P.networkDetails,N=P.stats,F=R(N),H=F.bytesLoaded,W=F.requestStart,B=F.responseStart,j=F.responseEnd,V=w.fragments[w.fragments.length-1],Y=s(V)+l(V.duration);v("requestcompleted",{request_event_type:C,request_bytes_loaded:H,request_start:W,request_response_start:B,request_response_end:j,request_current_level:U,request_type:"manifest",request_hostname:(0,x.extractHostname)(w.url),request_response_headers:L(k),video_holdback:w.holdBack&&l(w.holdBack),video_part_holdback:w.partHoldBack&&l(w.partHoldBack),video_part_target_duration:w.partTarget&&l(w.partTarget),video_target_duration:w.targetduration&&l(w.targetduration),video_source_is_live:w.live,player_manifest_newest_program_time:isNaN(Y)?void 0:Y})};f.on(m.Events.LEVEL_LOADED,o);var E=function(C,P){var w=P.details,U=P.networkDetails,k=P.stats,N=R(k),F=N.bytesLoaded,H=N.requestStart,W=N.responseStart,B=N.responseEnd;v("requestcompleted",{request_event_type:C,request_bytes_loaded:F,request_start:H,request_response_start:W,request_response_end:B,request_type:"manifest",request_hostname:(0,x.extractHostname)(w.url),request_response_headers:L(U)})};f.on(m.Events.AUDIO_TRACK_LOADED,E);var g=function(C,P){var w=P.stats,U=P.networkDetails,k=P.frag,N=R(w),F=N.bytesLoaded,H=N.requestStart,W=N.responseStart,B=N.responseEnd,j={request_event_type:C,request_bytes_loaded:F,request_start:H,request_response_start:W,request_response_end:B,request_hostname:U?(0,x.extractHostname)(U.responseURL):void 0,request_response_headers:L(U),request_media_duration:k.duration};k.type==="main"?(j.request_type="media",j.request_current_level=k.level,j.request_video_width=(f.levels[k.level]||{}).width,j.request_video_height=(f.levels[k.level]||{}).height):j.request_type=k.type,v("requestcompleted",j)};f.on(m.Events.FRAG_LOADED,g);var h=function(C,P){var w=P.frag,U=w.start,k=s(w),N={currentFragmentPDT:k,currentFragmentStart:l(U)};v("fragmentchange",N)};f.on(m.Events.FRAG_CHANGED,h);var b=function(C,P){var w=P.type,U=P.details,k=P.response,N=P.fatal,F=P.context,H=P.frag;if(U===m.ErrorDetails.MANIFEST_LOAD_ERROR||U===m.ErrorDetails.MANIFEST_LOAD_TIMEOUT||U===m.ErrorDetails.FRAG_LOAD_ERROR||U===m.ErrorDetails.FRAG_LOAD_TIMEOUT||U===m.ErrorDetails.LEVEL_LOAD_ERROR||U===m.ErrorDetails.LEVEL_LOAD_TIMEOUT){var W=H&&H.url||F&&F.url||"";v("requestfailed",{request_error:U,request_url:W,request_hostname:(0,x.extractHostname)(W),request_type:U===m.ErrorDetails.FRAG_LOAD_ERROR||U===m.ErrorDetails.FRAG_LOAD_TIMEOUT?"media":"manifest",request_error_code:k&&k.code,request_error_text:k&&k.text})}N&&v("error",{player_error_code:w,player_error_message:U})};f.on(m.Events.ERROR,b);var _=function(C,P){var w=P.frag,U=w&&w._url||"";v("requestcanceled",{request_cancel:C,request_url:U,request_type:"media",request_hostname:(0,x.extractHostname)(U)})};f.on(m.Events.FRAG_LOAD_EMERGENCY_ABORTED,_);var O=function(C,P){var w=P.level,U=f.levels[w];if(U&&U.attrs&&U.attrs.BANDWIDTH){var k=U.attrs.BANDWIDTH;k?v("renditionchange",{video_source_bitrate:k,video_source_width:U.width,video_source_height:U.height}):d.warn("missing BANDWIDTH from HLS manifest parsed by HLS.js")}};f.on(m.Events.LEVEL_SWITCHED,O),f._stopMuxMonitor=function(){f.off(m.Events.MANIFEST_LOADED,p),f.off(m.Events.LEVEL_LOADED,o),f.off(m.Events.AUDIO_TRACK_LOADED,E),f.off(m.Events.FRAG_LOADED,g),f.off(m.Events.FRAG_CHANGED,h),f.off(m.Events.ERROR,b),f.off(m.Events.FRAG_LOAD_EMERGENCY_ABORTED,_),f.off(m.Events.LEVEL_SWITCHED,O),f.off(m.Events.DESTROYING,f._stopMuxMonitor),delete f._stopMuxMonitor},f.on(m.Events.DESTROYING,f._stopMuxMonitor)},S=function(c){c&&typeof c._stopMuxMonitor=="function"&&c._stopMuxMonitor()};e.monitorHlsJs=T,e.stopMonitoringHlsJs=S},function(t,e,a){"use strict";function n(T){return T&&T.__esModule?T:{default:T}}Object.defineProperty(e,"__esModule",{value:!0}),e.stopMonitoringDashJS=e.monitorDashJS=void 0;var u=a(0),M=n(u),y=a(7),I=n(y),x=a(5),A=function(T,S){if(!T||typeof T.getRequests!="function")return{};var c=T.getRequests({state:"executed"});if(c.length===0)return{};var i=c[c.length-1],f=(0,x.extractHostname)(i.url),m=i.bytesLoaded,d=new Date(i.requestStartDate).getTime(),l=new Date(i.firstByteDate).getTime(),s=new Date(i.requestEndDate).getTime(),v=isNaN(i.duration)?0:i.duration,p=typeof S.getMetricsFor=="function"?S.getMetricsFor(i.mediaType).HttpList:S.getDashMetrics().getHttpRequests(i.mediaType),o=void 0;return p.length>0&&(o=(0,I.default)(p[p.length-1]._responseHeaders||"")),{requestStart:d,requestResponseStart:l,requestResponseEnd:s,requestBytesLoaded:m,requestResponseHeaders:o,requestMediaDuration:v,requestHostname:f}},D=function(T,S){var c=S.getQualityFor(T),i=S.getCurrentTrackFor(T),f=i.bitrateList;return f?{currentLevel:c,renditionWidth:f[c].width||null,renditionHeight:f[c].height||null,renditionBitrate:f[c].bandwidth}:{}},R=function(T,S,c){var i=(arguments.length>3&&arguments[3]!==void 0&&arguments[3],T.log);if(!c||!c.on)return void i.warn("Invalid dash.js player reference. Monitoring blocked.");var f=function(g,h){return T.emit(S,g,h)},m=function(g){var h=g.type,b=g.data,_=b||{},O=_.url;f("requestcompleted",{request_event_type:h,request_start:0,request_response_start:0,request_response_end:0,request_bytes_loaded:-1,request_type:"manifest",request_hostname:(0,x.extractHostname)(O)})};c.on("manifestLoaded",m);var d={},l=function(g){var h=g.type,b=g.fragmentModel,_=g.chunk,O=_||{},C=O.mediaInfo,P=C||{},w=P.type,U=P.bitrateList;U=U||[];var k={};U.forEach(function(Y,Q){k[Q]={},k[Q].width=Y.width,k[Q].height=Y.height,k[Q].bitrate=Y.bandwidth,k[Q].attrs={}}),w==="video"?d.video=k:w==="audio"?d.audio=k:d.media=k;var N=A(b,c),F=N.requestStart,H=N.requestResponseStart,W=N.requestResponseEnd,B=N.requestResponseHeaders,j=N.requestMediaDuration,V=N.requestHostname;f("requestcompleted",{request_event_type:h,request_start:F,request_response_start:H,request_response_end:W,request_bytes_loaded:-1,request_type:w+"_init",request_response_headers:B,request_hostname:V,request_media_duration:j,request_rendition_lists:d})};c.on("initFragmentLoaded",l);var s=function(g){var h=g.type,b=g.fragmentModel,_=g.chunk,O=_||{},C=O.mediaInfo,P=O.start,w=C||{},U=w.type,k=A(b,c),N=k.requestStart,F=k.requestResponseStart,H=k.requestResponseEnd,W=k.requestBytesLoaded,B=k.requestResponseHeaders,j=k.requestMediaDuration,V=k.requestHostname,Y=D(U,c),Q=Y.currentLevel,J=Y.renditionWidth,z=Y.renditionHeight,te=Y.renditionBitrate;f("requestcompleted",{request_event_type:h,request_start:N,request_response_start:F,request_response_end:H,request_bytes_loaded:W,request_type:U,request_response_headers:B,request_hostname:V,request_media_start_time:P,request_media_duration:j,request_current_level:Q,request_labeled_bitrate:te,request_video_width:J,request_video_height:z})};c.on("mediaFragmentLoaded",s);var v={video:void 0,audio:void 0,totalBitrate:void 0},p=function(){if(v.video&&typeof v.video.bitrate=="number"){if(!v.video.width||!v.video.height)return void i.warn("have bitrate info for video but missing width/height");var g=v.video.bitrate;return v.audio&&typeof v.audio.bitrate=="number"&&(g+=v.audio.bitrate),g!==v.totalBitrate?(v.totalBitrate=g,{video_source_bitrate:g,video_source_height:v.video.height,video_source_width:v.video.width}):void 0}},o=function(g,h,b){if(typeof g.newQuality!="number")return void i.warn("missing evt.newQuality in qualityChangeRendered event",g);var _=g.mediaType;if(_==="audio"||_==="video"){var O=c.getBitrateInfoListFor(_).find(function(P){return P.qualityIndex===g.newQuality});if(!O||typeof O.bitrate!="number")return void i.warn("missing bitrate info for "+_);v[_]=O;var C=p();C&&f("renditionchange",C)}};c.on("qualityChangeRendered",o);var E=function(g){var h=g.error,b=g.event;b=b||{};var _=b.request||{},O=M.default.event&&M.default.event.currentTarget||{};f("requestfailed",{request_error:h+"_"+b.id+"_"+_.type,request_url:b.url,request_hostname:(0,x.extractHostname)(b.url),request_type:_.mediaType,request_error_code:O.status,request_error_type:O.statusText})};c.on("error",E),c._stopMuxMonitor=function(){c.off("manifestLoaded",m),c.off("initFragmentLoaded",l),c.off("mediaFragmentLoaded",s),c.off("qualityChangeRendered",o),c.off("error",E),delete c._stopMuxMonitor}},L=function(T){T&&typeof T._stopMuxMonitor=="function"&&T._stopMuxMonitor()};e.monitorDashJS=R,e.stopMonitoringDashJS=L},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){},u=0;n.prototype.on=function(M,y,I){return y._eventEmitterGuid=y._eventEmitterGuid||++u,this._listeners=this._listeners||{},this._listeners[M]=this._listeners[M]||[],I&&(y=y.bind(I)),this._listeners[M].push(y),y},n.prototype.off=function(M,y){var I=this._listeners&&this._listeners[M];I&&I.forEach(function(x,A){x._eventEmitterGuid===y._eventEmitterGuid&&I.splice(A,1)})},n.prototype.one=function(M,y,I){var x=this;y._eventEmitterGuid=y._eventEmitterGuid||++u;var A=function D(){x.off(M,D),y.apply(I||this,arguments)};A._eventEmitterGuid=y._eventEmitterGuid,this.on(M,A)},n.prototype.emit=function(M,y){var I=this;if(this._listeners){y=y||{};var x=this._listeners["before*"]||[],A=this._listeners[M]||[],D=this._listeners["after"+M]||[],R=function(L,T){L=L.slice(),L.forEach(function(S){S.call(I,{type:M},T)})};R(x,y),R(A,y),R(D,y)}},e.default=n},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a(0),u=function(y){return y&&y.__esModule?y:{default:y}}(n),M=function(){this._playbackHeartbeatInterval=null,this._playheadShouldBeProgressing=!1,this.on("playing",function(){this._playheadShouldBeProgressing=!0}),this.on("play",this._startPlaybackHeartbeatInterval),this.on("playing",this._startPlaybackHeartbeatInterval),this.on("adbreakstart",this._startPlaybackHeartbeatInterval),this.on("adplay",this._startPlaybackHeartbeatInterval),this.on("adplaying",this._startPlaybackHeartbeatInterval),this.on("seeking",this._startPlaybackHeartbeatInterval),this.on("devicewake",this._startPlaybackHeartbeatInterval),this.on("viewstart",this._startPlaybackHeartbeatInterval),this.on("rebufferstart",this._startPlaybackHeartbeatInterval),this.on("pause",this._stopPlaybackHeartbeatInterval),this.on("ended",this._stopPlaybackHeartbeatInterval),this.on("viewend",this._stopPlaybackHeartbeatInterval),this.on("error",this._stopPlaybackHeartbeatInterval),this.on("aderror",this._stopPlaybackHeartbeatInterval),this.on("adpause",this._stopPlaybackHeartbeatInterval),this.on("adended",this._stopPlaybackHeartbeatInterval),this.on("adbreakend",this._stopPlaybackHeartbeatInterval),this.on("seeked",function(){this.data.player_is_paused?this._stopPlaybackHeartbeatInterval():this._startPlaybackHeartbeatInterval()}),this.on("timeupdate",function(){this._playbackHeartbeatInterval!==null&&this.emit("playbackheartbeat")}),this.on("devicesleep",function(y,I){this._playbackHeartbeatInterval!==null&&(u.default.clearInterval(this._playbackHeartbeatInterval),this.emit("playbackheartbeatend",{viewer_time:I.viewer_time}),this._playbackHeartbeatInterval=null)})};M.prototype._startPlaybackHeartbeatInterval=function(){var y=this;this._playbackHeartbeatInterval===null&&(this.emit("playbackheartbeat"),this._playbackHeartbeatInterval=u.default.setInterval(function(){y.emit("playbackheartbeat")},this.playbackHeartbeatTime))},M.prototype._stopPlaybackHeartbeatInterval=function(){this._playheadShouldBeProgressing=!1,this._playbackHeartbeatInterval!==null&&(u.default.clearInterval(this._playbackHeartbeatInterval),this.emit("playbackheartbeatend"),this._playbackHeartbeatInterval=null)},e.default=M},function(t,e,a){"use strict";function n(){var u=this;this.on("viewinit",function(){u.viewErrored=!1}),this.on("error",function(){try{var M=u.errorTranslator({player_error_code:u.data.player_error_code,player_error_message:u.data.player_error_message});M?(u.data.player_error_code=M.player_error_code,u.data.player_error_message=M.player_error_message,u.viewErrored=!0):(delete u.data.player_error_code,delete u.data.player_error_message)}catch(y){u.mux.log.warn("Exception in error translator callback.",y),u.viewErrored=!0}})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=n},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a(3),u=function(y){return y&&y.__esModule?y:{default:y}}(n),M=function(){this._watchTimeTrackerLastCheckedTime=null,this.on("playbackheartbeat",this._updateWatchTime),this.on("playbackheartbeatend",this._clearWatchTimeState)};M.prototype._updateWatchTime=function(y,I){var x=I.viewer_time;this._watchTimeTrackerLastCheckedTime===null&&(this._watchTimeTrackerLastCheckedTime=x),(0,u.default)(this.data,"view_watch_time",x-this._watchTimeTrackerLastCheckedTime),this._watchTimeTrackerLastCheckedTime=x},M.prototype._clearWatchTimeState=function(y,I){this._updateWatchTime(y,I),this._watchTimeTrackerLastCheckedTime=null},e.default=M},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a(3),u=function(y){return y&&y.__esModule?y:{default:y}}(n),M=function(){this._playbackTimeTrackerLastPlayheadPosition=-1,this.on("playbackheartbeat",this._updatePlaybackTime),this.on("playbackheartbeatend",this._clearPlaybackTimeState),this.on("seeking",this._clearPlaybackTimeState)};M.prototype._updatePlaybackTime=function(){var y=this.data.player_playhead_time;if(this._playbackTimeTrackerLastPlayheadPosition>=0&&y>this._playbackTimeTrackerLastPlayheadPosition){var I=y-this._playbackTimeTrackerLastPlayheadPosition;I<=1e3&&(0,u.default)(this.data,"view_content_playback_time",I)}this._playbackTimeTrackerLastPlayheadPosition=y},M.prototype._clearPlaybackTimeState=function(){this._updatePlaybackTime(),this._playbackTimeTrackerLastPlayheadPosition=-1},e.default=M},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){this.on("playbackheartbeat",this._updatePlayheadTime),this.on("playbackheartbeatend",this._updatePlayheadTime),this.on("timeupdate",this._updatePlayheadTime),this.on("destroy",function(){this.off("timeupdate",this._updatePlayheadTime)})};n.prototype._updateMaxPlayheadPosition=function(){this.data.view_max_playhead_position=this.data.view_max_playhead_position===void 0?this.data.player_playhead_time:Math.max(this.data.view_max_playhead_position,this.data.player_playhead_time)},n.prototype._updatePlayheadTime=function(u,M){var y=this,I=function(){y.currentFragmentPDT&&y.currentFragmentStart&&(y.data.player_program_time=y.currentFragmentPDT+y.data.player_playhead_time-y.currentFragmentStart)};if(M&&M.player_playhead_time)this.data.player_playhead_time=M.player_playhead_time,I(),this._updateMaxPlayheadPosition();else if(this.getPlayheadTime){var x=this.getPlayheadTime();x!==void 0&&(this.data.player_playhead_time=x,I(),this._updateMaxPlayheadPosition())}},e.default=n},function(t,e,a){"use strict";function n(){var y=this;if(!this.disableRebufferTracking){var I=void 0,x=function(){if(I){var A=y.data.viewer_time-I;(0,M.default)(y.data,"view_rebuffer_duration",A),I=y.data.viewer_time}y.data.view_watch_time>=0&&y.data.view_rebuffer_count>0&&(y.data.view_rebuffer_frequency=y.data.view_rebuffer_count/y.data.view_watch_time,y.data.view_rebuffer_percentage=y.data.view_rebuffer_duration/y.data.view_watch_time)};this.on("playbackheartbeat",function(){return x()}),this.on("rebufferstart",function(){I||((0,M.default)(y.data,"view_rebuffer_count",1),I=y.data.viewer_time,y.one("rebufferend",function(){x(),I=void 0}))})}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;var u=a(3),M=function(y){return y&&y.__esModule?y:{default:y}}(u)},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a(2),u=function(y){return y&&y.__esModule?y:{default:y}}(n),M=function(){this.disableRebufferTracking||this.disablePlayheadRebufferTracking||(this._lastCheckedTime=null,this._lastPlayheadTime=null,this._lastPlayheadTimeUpdatedTime=null,this.on("playbackheartbeat",this._checkIfRebuffering),this.on("playbackheartbeatend",this._cleanupRebufferTracker),this.on("seeking",function(){this._cleanupRebufferTracker(null,{viewer_time:u.default.now()})}))};M.prototype._checkIfRebuffering=function(y,I){return this.isSeeking||this.isAdBreak||!this._playheadShouldBeProgressing?void this._cleanupRebufferTracker(y,I):this._lastCheckedTime===null?void this._prepareRebufferTrackerState(I.viewer_time):this._lastPlayheadTime!==this.data.player_playhead_time?void this._cleanupRebufferTracker(y,I,!0):(I.viewer_time-this._lastPlayheadTimeUpdatedTime>=this.sustainedRebufferThreshold&&(this._rebuffering||(this._rebuffering=!0,this.emit("rebufferstart",{viewer_time:this._lastPlayheadTimeUpdatedTime}))),void(this._lastCheckedTime=I.viewer_time))},M.prototype._clearRebufferTrackerState=function(){this._lastCheckedTime=null,this._lastPlayheadTime=null,this._lastPlayheadTimeUpdatedTime=null},M.prototype._prepareRebufferTrackerState=function(y){this._lastCheckedTime=y,this._lastPlayheadTime=this.data.player_playhead_time,this._lastPlayheadTimeUpdatedTime=y},M.prototype._cleanupRebufferTracker=function(y,I){var x=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(this._rebuffering)this._rebuffering=!1,this.emit("rebufferend",{viewer_time:I.viewer_time});else{if(this._lastCheckedTime===null)return;var A=this.data.player_playhead_time-this._lastPlayheadTime,D=I.viewer_time-this._lastPlayheadTimeUpdatedTime;A>0&&D-A>this.minimumRebufferDuration&&(this.emit("rebufferstart",{viewer_time:this._lastPlayheadTimeUpdatedTime}),this.emit("rebufferend",{viewer_time:this._lastPlayheadTimeUpdatedTime+D-A}))}x?this._prepareRebufferTrackerState(I.viewer_time):this._clearRebufferTrackerState()},e.default=M},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a(2),u=function(y){return y&&y.__esModule?y:{default:y}}(n),M=function(){this.on("viewinit",function(){var y=this.data,I=y.view_id;if(!y.view_program_changed){var x=function(A,D){var R=D.viewer_time;A.type==="playing"&&this.data.view_time_to_first_frame===void 0?this.calculateTimeToFirstFrame(R||u.default.now(),I):A.type!=="adplaying"||this.data.view_time_to_first_frame!==void 0&&!this.inPrerollPosition()||this.calculateTimeToFirstFrame(R||u.default.now(),I)};this.one("playing",x),this.one("adplaying",x),this.one("viewend",function(){this.off("playing",x),this.off("adplaying",x)})}})};M.prototype.calculateTimeToFirstFrame=function(y,I){I===this.data.view_id&&(this._updateWatchTime(null,{viewer_time:y}),this.data.view_time_to_first_frame=this.data.view_watch_time,(this.data.player_autoplay_on||this.data.video_is_autoplay)&&this.NAVIGATION_START&&(this.data.view_aggregate_startup_time=this.data.view_start+this.data.view_watch_time-this.NAVIGATION_START))},e.default=M},function(t,e,a){"use strict";function n(){var y=this;this.on("viewinit",function(){this._lastPlayheadPosition=-1});var I=["pause","rebufferstart","seeking","error","adbreakstart","hb"],x=["playing","hb"];I.forEach(function(A){y.on(A,function(){if(this._lastPlayheadPosition>=0&&this.data.player_playhead_time>=0&&this._lastPlayerWidth>=0&&this._lastSourceWidth>0&&this._lastPlayerHeight>=0&&this._lastSourceHeight>0){var D=this.data.player_playhead_time-this._lastPlayheadPosition;if(D<0)return void(this._lastPlayheadPosition=-1);var R=Math.min(this._lastPlayerWidth/this._lastSourceWidth,this._lastPlayerHeight/this._lastSourceHeight),L=Math.max(0,R-1),T=Math.max(0,1-R);this.data.view_max_upscale_percentage=Math.max(this.data.view_max_upscale_percentage||0,L),this.data.view_max_downscale_percentage=Math.max(this.data.view_max_downscale_percentage||0,T),(0,M.default)(this.data,"view_total_content_playback_time",D),(0,M.default)(this.data,"view_total_upscaling",L*D),(0,M.default)(this.data,"view_total_downscaling",T*D)}this._lastPlayheadPosition=-1})}),x.forEach(function(A){y.on(A,function(){this._lastPlayheadPosition=this.data.player_playhead_time,this._lastPlayerWidth=this.data.player_width,this._lastPlayerHeight=this.data.player_height,this._lastSourceWidth=this.data.video_source_width,this._lastSourceHeight=this.data.video_source_height})})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;var u=a(3),M=function(y){return y&&y.__esModule?y:{default:y}}(u)},function(t,e,a){"use strict";function n(R){return R&&R.__esModule?R:{default:R}}function u(){this.isSeeking=!1,this.on("seeking",function(R,L){(0,D.default)(this.data,L),this._lastSeekingTime=y.default.now(),this.isSeeking===!1&&(this.isSeeking=!0,this.send("seeking"))}),this.on("seeked",function(){this.isSeeking=!1;var R=this._lastSeekingTime||y.default.now(),L=y.default.now()-R;(0,x.default)(this.data,"view_seek_count",1),(0,x.default)(this.data,"view_seek_duration",L);var T=this.data.view_max_seek_time||0;this.data.view_max_seek_time=Math.max(T,L)}),this.on("viewend",function(){this.isSeeking=!1})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var M=a(2),y=n(M),I=a(3),x=n(I),A=a(1),D=n(A)},function(t,e,a){"use strict";function n(T){return T&&T.__esModule?T:{default:T}}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function T(S,c){var i=[],f=!0,m=!1,d=void 0;try{for(var l,s=S[Symbol.iterator]();!(f=(l=s.next()).done)&&(i.push(l.value),!c||i.length!==c);f=!0);}catch(v){m=!0,d=v}finally{try{!f&&s.return&&s.return()}finally{if(m)throw d}}return i}return function(S,c){if(Array.isArray(S))return S;if(Symbol.iterator in Object(S))return T(S,c);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),M=a(3),y=n(M),I=a(5),x=a(1),A=n(x),D=function(T,S){T.push(S),T.sort(function(c,i){return c.viewer_time-i.viewer_time})},R=["adbreakstart","adrequest","adresponse","adplay","adplaying","adpause","adended","adbreakend","aderror"],L=function(){var T=this;this.on("viewinit",function(){this.isAdBreak=!1,this._currentAdRequestNumber=0,this._currentAdResponseNumber=0,this._adRequests=[],this._adResponses=[],this._adHasPlayed=!1,this._wouldBeNewAdPlay=!0,this._prerollPlayTime=void 0}),R.forEach(function(c){return T.on(c,T._updateAdData)});var S=function(){T.isAdBreak=!1};this.on("adbreakstart",function(){this.isAdBreak=!0}),this.on("play",S),this.on("playing",S),this.on("viewend",S),this.on("adrequest",function(c,i){i=(0,A.default)({ad_request_id:"generatedAdRequestId"+this._currentAdRequestNumber++},i),D(this._adRequests,i),(0,y.default)(this.data,"view_ad_request_count"),this.inPrerollPosition()&&(this.data.view_preroll_requested=!0,this._adHasPlayed||(0,y.default)(this.data,"view_preroll_request_count"))}),this.on("adresponse",function(c,i){i=(0,A.default)({ad_request_id:"generatedAdRequestId"+this._currentAdResponseNumber++},i),D(this._adResponses,i);var f=this.findAdRequest(i.ad_request_id);f&&(0,y.default)(this.data,"view_ad_request_time",Math.max(0,i.viewer_time-f.viewer_time))}),this.on("adplay",function(c,i){this._adHasPlayed=!0,this._wouldBeNewAdPlay&&(this._wouldBeNewAdPlay=!1,(0,y.default)(this.data,"view_ad_played_count")),this.inPrerollPosition()&&!this.data.view_preroll_played&&(this.data.view_preroll_played=!0,this._adRequests.length>0&&(this.data.view_preroll_request_time=Math.max(0,i.viewer_time-this._adRequests[0].viewer_time)),this.data.view_start&&(this.data.view_startup_preroll_request_time=Math.max(0,i.viewer_time-this.data.view_start)),this._prerollPlayTime=i.viewer_time)}),this.on("adplaying",function(c,i){this.inPrerollPosition()&&this.data.view_preroll_load_time===void 0&&this._prerollPlayTime!==void 0&&(this.data.view_preroll_load_time=i.viewer_time-this._prerollPlayTime,this.data.view_startup_preroll_load_time=i.viewer_time-this._prerollPlayTime)}),this.on("adended",function(){this._wouldBeNewAdPlay=!0}),this.on("aderror",function(){this._wouldBeNewAdPlay=!0})};L.prototype.inPrerollPosition=function(){return this.data.view_content_playback_time===void 0||this.data.view_content_playback_time<=1e3},L.prototype.findAdRequest=function(T){for(var S=0;S<this._adRequests.length;S++)if(this._adRequests[S].ad_request_id===T)return this._adRequests[S]},L.prototype._updateAdData=function(T,S){if(this.inPrerollPosition()){if(!this.data.view_preroll_ad_tag_hostname&&S.ad_tag_url){var c=(0,I.extractHostnameAndDomain)(S.ad_tag_url),i=u(c,2),f=i[0],m=i[1];this.data.view_preroll_ad_tag_domain=m,this.data.view_preroll_ad_tag_hostname=f}if(!this.data.view_preroll_ad_asset_hostname&&S.ad_asset_url){var d=(0,I.extractHostnameAndDomain)(S.ad_asset_url),l=u(d,2),s=l[0],v=l[1];this.data.view_preroll_ad_asset_domain=v,this.data.view_preroll_ad_asset_hostname=s}}},e.default=L},function(t,e,a){"use strict";function n(A){return A&&A.__esModule?A:{default:A}}function u(){var A=this,D=void 0,R=void 0,L=function(){A.disableRebufferTracking||((0,x.default)(A.data,"view_waiting_rebuffer_count",1),D=y.default.now(),R=window.setInterval(function(){if(D){var f=y.default.now();(0,x.default)(A.data,"view_waiting_rebuffer_duration",f-D),D=f}},250))},T=function(){A.disableRebufferTracking||D&&((0,x.default)(A.data,"view_waiting_rebuffer_duration",y.default.now()-D),D=!1,window.clearInterval(R))},S=!1,c=function(){S=!0},i=function(){S=!1,T()};this.on("waiting",function(){S&&L()}),this.on("playing",function(){T(),c()}),this.on("pause",i),this.on("seeking",i)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var M=a(2),y=n(M),I=a(3),x=n(I)},function(t,e,a){"use strict";function n(R){return R&&R.__esModule?R:{default:R}}function u(){var R=this;this.one("playbackheartbeat",A),this.on("playbackheartbeatend",function(){R.off("before*",D),R.one("playbackheartbeat",A)})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var M=a(1),y=n(M),I=a(2),x=n(I),A=function(){this.lastWallClockTime=x.default.now(),this.on("before*",D)},D=function(R){var L=x.default.now(),T=this.lastWallClockTime;this.lastWallClockTime=L,L-T>3e4&&(this.emit("devicesleep",{viewer_time:T}),(0,y.default)(this.data,{viewer_time:T}),this.send("devicesleep"),this.emit("devicewake",{viewer_time:L}),(0,y.default)(this.data,{viewer_time:L}),this.send("devicewake"))}},function(t,e,a){"use strict";function n(h){return h&&h.__esModule?h:{default:h}}Object.defineProperty(e,"__esModule",{value:!0});var u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},M=a(0),y=n(M),I=a(40),x=a(4),A=n(x),D=a(53),R=n(D),L=a(12),T=n(L),S=a(54),c=n(S),i=a(17),f=n(i),m=a(55),d=n(m),l=a(1),s=n(l),v=["env_key","view_id","view_sequence_number","player_sequence_number","beacon_domain","player_playhead_time","viewer_time","mux_api_version","event","video_id","player_instance_id"],p=["viewstart","error","ended","viewend"],o=function(h,b){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.mux=h,this.envKey=b,this.eventQueue=new d.default((0,R.default)(b,_)),this.previousBeaconData=null,this.lastEventTime=null,this.sampleRate=_.sampleRate,this.disableCookies=_.disableCookies,this.respectDoNotTrack=_.respectDoNotTrack;var O=_.platform||{};this.pageLevelData={mux_api_version:this.mux.API_VERSION,mux_embed:this.mux.NAME,mux_embed_version:this.mux.VERSION,viewer_application_name:O.name,viewer_application_version:O.version,viewer_application_engine:O.layout,viewer_device_name:O.product,viewer_device_category:"",viewer_device_manufacturer:O.manufacturer,viewer_os_family:O.os&&O.os.family,viewer_os_architecture:O.os&&O.os.architecture,viewer_os_version:O.os&&O.os.version};var C=(0,c.default)();C&&(this.pageLevelData=(0,s.default)(this.pageLevelData,{viewer_connection_type:C})),y.default!==void 0&&y.default.location&&y.default.location.href&&(this.pageLevelData.page_url=y.default.location.href),this.viewerData=this.disableCookies?{}:(0,I.getAndUpdateViewerData)()};o.prototype.send=function(h,b){if(h){if(this.respectDoNotTrack&&(0,T.default)())return A.default.info("Not sending `"+h+"` because Do Not Track is enabled");if(!b||(b===void 0?"undefined":u(b))!=="object")return A.default.error("A data object was expected in send() but was not provided");var _=this.disableCookies?{}:(0,I.getAndUpdateSessionData)(),O={};(0,s.default)(O,this.pageLevelData),(0,s.default)(O,b),(0,s.default)(O,_),(0,s.default)(O,this.viewerData),O.event=h,O.env_key=this.envKey,O.user_id&&(O.viewer_user_id=O.user_id,delete O.user_id);var C=O.mux_sample_number>=this.sampleRate,P=this._deduplicateBeaconData(h,O),w=(0,f.default)(P);if(this.lastEventTime=this.mux.utils.now(),C)return A.default.info("Not sending event due to sample rate restriction",h,O,w);if(this.envKey||A.default.info("Missing environment key (envKey) - beacons will be dropped if the video source is not a valid mux video URL",h,O,w),!this.rateLimited){if(A.default.info("Sending event",h,O,w),this.rateLimited=!this.eventQueue.queueEvent(h,w),this.mux.WINDOW_UNLOADING&&h==="viewend")this.eventQueue.destroy(!0);else if((p.indexOf(h)>=0||this.mux.WINDOW_VISIBLE===!1&&h==="hb")&&this.eventQueue.flushEvents(),this.rateLimited)return O.event="eventrateexceeded",w=(0,f.default)(O),this.eventQueue.queueEvent(O.event,w),A.default.error("Beaconing disabled due to rate limit.")}}},o.prototype.destroy=function(){this.eventQueue.destroy(!1)};var E=function(h,b,_,O){return!(!h||b.indexOf("request_")!==0)&&(b==="request_response_headers"||(_===void 0?"undefined":u(_))!=="object"||(O===void 0?"undefined":u(O))!=="object"||Object.keys(_||{}).length!==Object.keys(O||{}).length)},g=function(h,b){return h==="renditionchange"&&b.indexOf("video_source_")===0};o.prototype._deduplicateBeaconData=function(h,b){var _=this,O={},C=b.view_id;if(!C||h==="viewstart"||h==="viewend"||!this.previousBeaconData||this.mux.utils.now()-this.lastEventTime>=6e5)O=(0,s.default)({},b),C&&(this.previousBeaconData=O),C&&h==="viewend"&&(this.previousBeaconData=null);else{var P=h.indexOf("request")===0;Object.keys(b).forEach(function(w){var U=b[w];(U!==_.previousBeaconData[w]||v.indexOf(w)>-1||E(P,w,U,_.previousBeaconData[w])||g(h,w))&&(O[w]=U,_.previousBeaconData[w]=U)})}return O},e.default=o},function(t,e,a){"use strict";function n(c){return c&&c.__esModule?c:{default:c}}Object.defineProperty(e,"__esModule",{value:!0}),e.getAndUpdateSessionData=e.getAndUpdateViewerData=void 0;var u=a(15),M=n(u),y=a(52),I=n(y),x=a(6),A=a(2),D=n(A),R=function(){var c=void 0;try{c=M.default.parse(I.default.get("muxData")||"")}catch{c={}}return c},L=function(c){try{I.default.set("muxData",M.default.stringify(c),{expires:7300})}catch{}},T=function(){var c=R();return c.mux_viewer_id=c.mux_viewer_id||(0,x.generateUUID)(),c.msn=c.msn||Math.random(),L(c),{mux_viewer_id:c.mux_viewer_id,mux_sample_number:c.msn}},S=function(){var c=R(),i=D.default.now();return c.session_start&&(c.sst=c.session_start,delete c.session_start),c.session_id&&(c.sid=c.session_id,delete c.session_id),c.session_expires&&(c.sex=c.session_expires,delete c.session_expires),(!c.sex||c.sex<i)&&(c.sid=(0,x.generateUUID)(),c.sst=i),c.sex=i+15e5,L(c),{session_id:c.sid,session_start:c.sst,session_expires:c.sex}};e.getAndUpdateViewerData=T,e.getAndUpdateSessionData=S},function(t,e,a){"use strict";var n=a(42),u=a(16),M=a(10),y=Object.prototype.hasOwnProperty,I={brackets:function(d){return d+"[]"},comma:"comma",indices:function(d,l){return d+"["+l+"]"},repeat:function(d){return d}},x=Array.isArray,A=String.prototype.split,D=Array.prototype.push,R=function(d,l){D.apply(d,x(l)?l:[l])},L=Date.prototype.toISOString,T=M.default,S={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:u.encode,encodeValuesOnly:!1,format:T,formatter:M.formatters[T],indices:!1,serializeDate:function(d){return L.call(d)},skipNulls:!1,strictNullHandling:!1},c=function(d){return typeof d=="string"||typeof d=="number"||typeof d=="boolean"||typeof d=="symbol"||typeof d=="bigint"},i={},f=function d(l,s,v,p,o,E,g,h,b,_,O,C,P,w,U){for(var k=l,N=U,F=0,H=!1;(N=N.get(i))!==void 0&&!H;){var W=N.get(l);if(F+=1,W!==void 0){if(W===F)throw new RangeError("Cyclic object value");H=!0}N.get(i)===void 0&&(F=0)}if(typeof g=="function"?k=g(s,k):k instanceof Date?k=_(k):v==="comma"&&x(k)&&(k=u.maybeMap(k,function(re){return re instanceof Date?_(re):re})),k===null){if(p)return E&&!P?E(s,S.encoder,w,"key",O):s;k=""}if(c(k)||u.isBuffer(k)){if(E){var B=P?s:E(s,S.encoder,w,"key",O);if(v==="comma"&&P){for(var j=A.call(String(k),","),V="",Y=0;Y<j.length;++Y)V+=(Y===0?"":",")+C(E(j[Y],S.encoder,w,"value",O));return[C(B)+"="+V]}return[C(B)+"="+C(E(k,S.encoder,w,"value",O))]}return[C(s)+"="+C(String(k))]}var Q=[];if(k===void 0)return Q;var J;if(v==="comma"&&x(k))J=[{value:k.length>0?k.join(",")||null:void 0}];else if(x(g))J=g;else{var z=Object.keys(k);J=h?z.sort(h):z}for(var te=0;te<J.length;++te){var se=J[te],Z=typeof se=="object"&&se.value!==void 0?se.value:k[se];if(!o||Z!==null){var Ee=x(k)?typeof v=="function"?v(s,se):s:s+(b?"."+se:"["+se+"]");U.set(l,F);var fe=n();fe.set(i,U),R(Q,d(Z,Ee,v,p,o,E,g,h,b,_,O,C,P,w,fe))}}return Q},m=function(d){if(!d)return S;if(d.encoder!==null&&d.encoder!==void 0&&typeof d.encoder!="function")throw new TypeError("Encoder has to be a function.");var l=d.charset||S.charset;if(d.charset!==void 0&&d.charset!=="utf-8"&&d.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var s=M.default;if(d.format!==void 0){if(!y.call(M.formatters,d.format))throw new TypeError("Unknown format option provided.");s=d.format}var v=M.formatters[s],p=S.filter;return(typeof d.filter=="function"||x(d.filter))&&(p=d.filter),{addQueryPrefix:typeof d.addQueryPrefix=="boolean"?d.addQueryPrefix:S.addQueryPrefix,allowDots:d.allowDots===void 0?S.allowDots:!!d.allowDots,charset:l,charsetSentinel:typeof d.charsetSentinel=="boolean"?d.charsetSentinel:S.charsetSentinel,delimiter:d.delimiter===void 0?S.delimiter:d.delimiter,encode:typeof d.encode=="boolean"?d.encode:S.encode,encoder:typeof d.encoder=="function"?d.encoder:S.encoder,encodeValuesOnly:typeof d.encodeValuesOnly=="boolean"?d.encodeValuesOnly:S.encodeValuesOnly,filter:p,format:s,formatter:v,serializeDate:typeof d.serializeDate=="function"?d.serializeDate:S.serializeDate,skipNulls:typeof d.skipNulls=="boolean"?d.skipNulls:S.skipNulls,sort:typeof d.sort=="function"?d.sort:null,strictNullHandling:typeof d.strictNullHandling=="boolean"?d.strictNullHandling:S.strictNullHandling}};t.exports=function(d,l){var s,v,p=d,o=m(l);typeof o.filter=="function"?(v=o.filter,p=v("",p)):x(o.filter)&&(v=o.filter,s=v);var E=[];if(typeof p!="object"||p===null)return"";var g;g=l&&l.arrayFormat in I?l.arrayFormat:l&&"indices"in l?l.indices?"indices":"repeat":"indices";var h=I[g];s||(s=Object.keys(p)),o.sort&&s.sort(o.sort);for(var b=n(),_=0;_<s.length;++_){var O=s[_];o.skipNulls&&p[O]===null||R(E,f(p[O],O,h,o.strictNullHandling,o.skipNulls,o.encode?o.encoder:null,o.filter,o.sort,o.allowDots,o.serializeDate,o.format,o.formatter,o.encodeValuesOnly,o.charset,b))}var C=E.join(o.delimiter),P=o.addQueryPrefix===!0?"?":"";return o.charsetSentinel&&(o.charset==="iso-8859-1"?P+="utf8=%26%2310003%3B&":P+="utf8=%E2%9C%93&"),C.length>0?P+C:""}},function(t,e,a){"use strict";var n=a(8),u=a(47),M=a(49),y=n("%TypeError%"),I=n("%WeakMap%",!0),x=n("%Map%",!0),A=u("WeakMap.prototype.get",!0),D=u("WeakMap.prototype.set",!0),R=u("WeakMap.prototype.has",!0),L=u("Map.prototype.get",!0),T=u("Map.prototype.set",!0),S=u("Map.prototype.has",!0),c=function(d,l){for(var s,v=d;(s=v.next)!==null;v=s)if(s.key===l)return v.next=s.next,s.next=d.next,d.next=s,s},i=function(d,l){var s=c(d,l);return s&&s.value},f=function(d,l,s){var v=c(d,l);v?v.value=s:d.next={key:l,next:d.next,value:s}},m=function(d,l){return!!c(d,l)};t.exports=function(){var d,l,s,v={assert:function(p){if(!v.has(p))throw new y("Side channel does not contain "+M(p))},get:function(p){if(I&&p&&(typeof p=="object"||typeof p=="function")){if(d)return A(d,p)}else if(x){if(l)return L(l,p)}else if(s)return i(s,p)},has:function(p){if(I&&p&&(typeof p=="object"||typeof p=="function")){if(d)return R(d,p)}else if(x){if(l)return S(l,p)}else if(s)return m(s,p);return!1},set:function(p,o){I&&p&&(typeof p=="object"||typeof p=="function")?(d||(d=new I),D(d,p,o)):x?(l||(l=new x),T(l,p,o)):(s||(s={key:{},next:null}),f(s,p,o))}};return v}},function(t,e,a){"use strict";var n=typeof Symbol!="undefined"&&Symbol,u=a(44);t.exports=function(){return typeof n=="function"&&typeof Symbol=="function"&&typeof n("foo")=="symbol"&&typeof Symbol("bar")=="symbol"&&u()}},function(t,e,a){"use strict";t.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var n={},u=Symbol("test"),M=Object(u);if(typeof u=="string"||Object.prototype.toString.call(u)!=="[object Symbol]"||Object.prototype.toString.call(M)!=="[object Symbol]")return!1;n[u]=42;for(u in n)return!1;if(typeof Object.keys=="function"&&Object.keys(n).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(n).length!==0)return!1;var y=Object.getOwnPropertySymbols(n);if(y.length!==1||y[0]!==u||!Object.prototype.propertyIsEnumerable.call(n,u))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var I=Object.getOwnPropertyDescriptor(n,u);if(I.value!==42||I.enumerable!==!0)return!1}return!0}},function(t,e,a){"use strict";var n=Array.prototype.slice,u=Object.prototype.toString;t.exports=function(M){var y=this;if(typeof y!="function"||u.call(y)!=="[object Function]")throw new TypeError("Function.prototype.bind called on incompatible "+y);for(var I,x=n.call(arguments,1),A=function(){if(this instanceof I){var S=y.apply(this,x.concat(n.call(arguments)));return Object(S)===S?S:this}return y.apply(M,x.concat(n.call(arguments)))},D=Math.max(0,y.length-x.length),R=[],L=0;L<D;L++)R.push("$"+L);if(I=Function("binder","return function ("+R.join(",")+"){ return binder.apply(this,arguments); }")(A),y.prototype){var T=function(){};T.prototype=y.prototype,I.prototype=new T,T.prototype=null}return I}},function(t,e,a){"use strict";var n=a(9);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},function(t,e,a){"use strict";var n=a(8),u=a(48),M=u(n("String.prototype.indexOf"));t.exports=function(y,I){var x=n(y,!!I);return typeof x=="function"&&M(y,".prototype.")>-1?u(x):x}},function(t,e,a){"use strict";var n=a(9),u=a(8),M=u("%Function.prototype.apply%"),y=u("%Function.prototype.call%"),I=u("%Reflect.apply%",!0)||n.call(y,M),x=u("%Object.getOwnPropertyDescriptor%",!0),A=u("%Object.defineProperty%",!0),D=u("%Math.max%");if(A)try{A({},"a",{value:1})}catch{A=null}t.exports=function(L){var T=I(n,y,arguments);return x&&A&&x(T,"length").configurable&&A(T,"length",{value:1+D(0,L.length-(arguments.length-1))}),T};var R=function(){return I(n,M,arguments)};A?A(t.exports,"apply",{value:R}):t.exports.apply=R},function(t,e,a){function n(G,$){if(G===1/0||G===-1/0||G!==G||G&&G>-1e3&&G<1e3||Te.call(/e/,$))return $;var ye=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof G=="number"){var _e=G<0?-Ce(-G):Ce(G);if(_e!==G){var xe=String(_e),Ke=re.call($,xe.length+1);return q.call(xe,ye,"$&_")+"."+q.call(q.call(Ke,/([0-9]{3})/g,"$&_"),/_$/,"")}}return q.call($,ye,"$&_")}function u(G,$,ye){var _e=(ye.quoteStyle||$)==="double"?'"':"'";return _e+G+_e}function M(G){return q.call(String(G),/"/g,""")}function y(G){return!(i(G)!=="[object Array]"||Ie&&typeof G=="object"&&Ie in G)}function I(G){return!(i(G)!=="[object Date]"||Ie&&typeof G=="object"&&Ie in G)}function x(G){return!(i(G)!=="[object RegExp]"||Ie&&typeof G=="object"&&Ie in G)}function A(G){return!(i(G)!=="[object Error]"||Ie&&typeof G=="object"&&Ie in G)}function D(G){return!(i(G)!=="[object String]"||Ie&&typeof G=="object"&&Ie in G)}function R(G){return!(i(G)!=="[object Number]"||Ie&&typeof G=="object"&&Ie in G)}function L(G){return!(i(G)!=="[object Boolean]"||Ie&&typeof G=="object"&&Ie in G)}function T(G){if(Re)return G&&typeof G=="object"&&G instanceof Symbol;if(typeof G=="symbol")return!0;if(!G||typeof G!="object"||!Ae)return!1;try{return Ae.call(G),!0}catch{}return!1}function S(G){if(!G||typeof G!="object"||!Ue)return!1;try{return Ue.call(G),!0}catch{}return!1}function c(G,$){return ke.call(G,$)}function i(G){return Z.call(G)}function f(G){if(G.name)return G.name;var $=fe.call(Ee.call(G),/^function\s*([\w$]+)/);return $?$[1]:null}function m(G,$){if(G.indexOf)return G.indexOf($);for(var ye=0,_e=G.length;ye<_e;ye++)if(G[ye]===$)return ye;return-1}function d(G){if(!N||!G||typeof G!="object")return!1;try{N.call(G);try{B.call(G)}catch{return!0}return G instanceof Map}catch{}return!1}function l(G){if(!Y||!G||typeof G!="object")return!1;try{Y.call(G,Y);try{J.call(G,J)}catch{return!0}return G instanceof WeakMap}catch{}return!1}function s(G){if(!te||!G||typeof G!="object")return!1;try{return te.call(G),!0}catch{}return!1}function v(G){if(!B||!G||typeof G!="object")return!1;try{B.call(G);try{N.call(G)}catch{return!0}return G instanceof Set}catch{}return!1}function p(G){if(!J||!G||typeof G!="object")return!1;try{J.call(G,J);try{Y.call(G,Y)}catch{return!0}return G instanceof WeakSet}catch{}return!1}function o(G){return!(!G||typeof G!="object")&&(typeof HTMLElement!="undefined"&&G instanceof HTMLElement||typeof G.nodeName=="string"&&typeof G.getAttribute=="function")}function E(G,$){if(G.length>$.maxStringLength){var ye=G.length-$.maxStringLength,_e="... "+ye+" more character"+(ye>1?"s":"");return E(re.call(G,0,$.maxStringLength),$)+_e}return u(q.call(q.call(G,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,g),"single",$)}function g(G){var $=G.charCodeAt(0),ye={8:"b",9:"t",10:"n",12:"f",13:"r"}[$];return ye?"\\"+ye:"\\x"+($<16?"0":"")+ie.call($.toString(16))}function h(G){return"Object("+G+")"}function b(G){return G+" { ? }"}function _(G,$,ye,_e){return G+" ("+$+") {"+(_e?P(ye,_e):he.call(ye,", "))+"}"}function O(G){for(var $=0;$<G.length;$++)if(m(G[$],`
|
|
1
|
+
var Zl=Object.create;var $a=Object.defineProperty;var Jl=Object.getOwnPropertyDescriptor;var ql=Object.getOwnPropertyNames;var eu=Object.getPrototypeOf,tu=Object.prototype.hasOwnProperty;var Ya=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var ru=(r,t,e,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ql(t))!tu.call(r,n)&&n!==e&&$a(r,n,{get:()=>t[n],enumerable:!(a=Jl(t,n))||a.enumerable});return r};var vi=(r,t,e)=>(e=r!=null?Zl(eu(r)):{},ru(t||!r||!r.__esModule?$a(e,"default",{value:r,enumerable:!0}):e,r));var pn=(r,t,e)=>{if(!t.has(r))throw TypeError("Cannot "+e)};var ge=(r,t,e)=>(pn(r,t,"read from private field"),e?e.call(r):t.get(r)),Le=(r,t,e)=>{if(t.has(r))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(r):t.set(r,e)},qe=(r,t,e,a)=>(pn(r,t,"write to private field"),a?a.call(r,e):t.set(r,e),e);var Me=(r,t,e)=>(pn(r,t,"access private method"),e);var io=Ya((Ni,va)=>{(function(){var r=!1;(function(t,e){typeof Ni=="object"&&typeof va=="object"?va.exports=e():typeof r=="function"&&r.amd?r("mux",[],e):typeof Ni=="object"?Ni.mux=e():t.mux=e()})(typeof self!="undefined"?self:this,function(){return function(t){function e(n){if(a[n])return a[n].exports;var u=a[n]={i:n,l:!1,exports:{}};return t[n].call(u.exports,u,u.exports,e),u.l=!0,u.exports}var a={};return e.m=t,e.c=a,e.d=function(n,u,M){e.o(n,u)||Object.defineProperty(n,u,{configurable:!1,enumerable:!0,get:M})},e.n=function(n){var u=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(u,"a",u),u},e.o=function(n,u){return Object.prototype.hasOwnProperty.call(n,u)},e.p="",e(e.s=18)}([function(t,e,a){(function(n){var u;u=typeof window!="undefined"?window:n!==void 0?n:typeof self!="undefined"?self:{},t.exports=u}).call(e,a(20))},function(t,e){function a(k,N,F){switch(F.length){case 0:return k.call(N);case 1:return k.call(N,F[0]);case 2:return k.call(N,F[0],F[1]);case 3:return k.call(N,F[0],F[1],F[2])}return k.apply(N,F)}function n(k,N){for(var F=-1,H=Array(k);++F<k;)H[F]=N(F);return H}function u(k,N){var F=w(k)||T(k)?n(k.length,String):[],H=F.length,W=!!H;for(var B in k)!N&&!h.call(k,B)||W&&(B=="length"||A(B,H))||F.push(B);return F}function M(k,N,F){var H=k[N];h.call(k,N)&&L(H,F)&&(F!==void 0||N in k)||(k[N]=F)}function y(k){if(!R(k))return O(k);var N=[];for(var F in Object(k))h.call(k,F)&&F!="constructor"&&N.push(F);return N}function I(k,N){return N=C(N===void 0?k.length-1:N,0),function(){for(var F=arguments,H=-1,W=C(F.length-N,0),B=Array(W);++H<W;)B[H]=F[N+H];H=-1;for(var j=Array(N+1);++H<N;)j[H]=F[H];return j[N]=B,a(k,this,j)}}function x(k,N,F,H){F||(F={});for(var W=-1,B=N.length;++W<B;){var j=N[W],V=H?H(F[j],k[j],j,F,k):void 0;M(F,j,V===void 0?k[j]:V)}return F}function A(k,N){return!!(N=N==null?s:N)&&(typeof k=="number"||E.test(k))&&k>-1&&k%1==0&&k<N}function D(k,N,F){if(!m(F))return!1;var H=typeof N;return!!(H=="number"?S(F)&&A(N,F.length):H=="string"&&N in F)&&L(F[N],k)}function R(k){var N=k&&k.constructor;return k===(typeof N=="function"&&N.prototype||g)}function L(k,N){return k===N||k!==k&&N!==N}function T(k){return c(k)&&h.call(k,"callee")&&(!_.call(k,"callee")||b.call(k)==v)}function S(k){return k!=null&&f(k.length)&&!i(k)}function c(k){return d(k)&&S(k)}function i(k){var N=m(k)?b.call(k):"";return N==p||N==o}function f(k){return typeof k=="number"&&k>-1&&k%1==0&&k<=s}function m(k){var N=typeof k;return!!k&&(N=="object"||N=="function")}function d(k){return!!k&&typeof k=="object"}function l(k){return S(k)?u(k):y(k)}var s=9007199254740991,v="[object Arguments]",p="[object Function]",o="[object GeneratorFunction]",E=/^(?:0|[1-9]\d*)$/,g=Object.prototype,h=g.hasOwnProperty,b=g.toString,_=g.propertyIsEnumerable,O=function(k,N){return function(F){return k(N(F))}}(Object.keys,Object),C=Math.max,P=!_.call({valueOf:1},"valueOf"),w=Array.isArray,U=function(k){return I(function(N,F){var H=-1,W=F.length,B=W>1?F[W-1]:void 0,j=W>2?F[2]:void 0;for(B=k.length>3&&typeof B=="function"?(W--,B):void 0,j&&D(F[0],F[1],j)&&(B=W<3?void 0:B,W=1),N=Object(N);++H<W;){var V=F[H];V&&k(N,V,H,B)}return N})}(function(k,N){if(P||R(N)||S(N))return void x(N,l(N),k);for(var F in N)h.call(N,F)&&M(k,F,N[F])});t.exports=U},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a(0),u=function(y){return y&&y.__esModule?y:{default:y}}(n),M={};M.now=function(){var y=u.default.performance,I=y&&y.timing;return I&&typeof I.navigationStart=="number"&&typeof y.now=="function"?I.navigationStart+y.now():Date.now()},e.default=M},function(t,e,a){"use strict";function n(u,M,y){y=y===void 0?1:y,u[M]=u[M]||0,u[M]+=y}Object.defineProperty(e,"__esModule",{value:!0}),e.default=n},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a(21),u=function(y){return y&&y.__esModule?y:{default:y}}(n),M=u.default.methodFactory;u.default.methodFactory=function(y,I,x){var A=M(y,I,x);return function(){for(var D=["[mux]"],R=0;R<arguments.length;R++)D.push(arguments[R]);A.apply(void 0,D)}},u.default.setLevel(u.default.getLevel()),e.default=u.default},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(y){return M(y)[0]},u=function(y){return M(y)[1]},M=function(y){if(typeof y!="string"||y==="")return["localhost"];var I=/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,x=y.match(I)||[],A=x[4],D=void 0;return A&&(D=(A.match(/[^\.]+\.[^\.]+$/)||[])[0]),[A,D]};e.extractHostnameAndDomain=M,e.extractHostname=n,e.extractDomain=u},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(M){var y=16*Math.random()|0;return(M==="x"?y:3&y|8).toString(16)})},u=function(){return("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6)};e.generateUUID=n,e.generateShortID=u},function(t,e,a){"use strict";function n(M){M=M||"";var y={};return M.trim().split(/[\r\n]+/).forEach(function(I){if(I){var x=I.split(": "),A=x.shift();A&&(u.indexOf(A.toLowerCase())>=0||A.toLowerCase().indexOf("x-litix-")===0)&&(y[A]=x.join(": "))}}),y}Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;var u=["x-cdn","content-type"]},function(t,e,a){"use strict";var n=SyntaxError,u=Function,M=TypeError,y=function(h){try{return u('"use strict"; return ('+h+").constructor;")()}catch{}},I=Object.getOwnPropertyDescriptor;if(I)try{I({},"")}catch{I=null}var x=function(){throw new M},A=I?function(){try{return arguments.callee,x}catch{try{return I(arguments,"callee").get}catch{return x}}}():x,D=a(43)(),R=Object.getPrototypeOf||function(h){return h.__proto__},L={},T=typeof Uint8Array=="undefined"?void 0:R(Uint8Array),S={"%AggregateError%":typeof AggregateError=="undefined"?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":D?R([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":L,"%AsyncGenerator%":L,"%AsyncGeneratorFunction%":L,"%AsyncIteratorPrototype%":L,"%Atomics%":typeof Atomics=="undefined"?void 0:Atomics,"%BigInt%":typeof BigInt=="undefined"?void 0:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array=="undefined"?void 0:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?void 0:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?void 0:FinalizationRegistry,"%Function%":u,"%GeneratorFunction%":L,"%Int8Array%":typeof Int8Array=="undefined"?void 0:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?void 0:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":D?R(R([][Symbol.iterator]())):void 0,"%JSON%":typeof JSON=="object"?JSON:void 0,"%Map%":typeof Map=="undefined"?void 0:Map,"%MapIteratorPrototype%":typeof Map!="undefined"&&D?R(new Map()[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?void 0:Promise,"%Proxy%":typeof Proxy=="undefined"?void 0:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect=="undefined"?void 0:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?void 0:Set,"%SetIteratorPrototype%":typeof Set!="undefined"&&D?R(new Set()[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":D?R(""[Symbol.iterator]()):void 0,"%Symbol%":D?Symbol:void 0,"%SyntaxError%":n,"%ThrowTypeError%":A,"%TypedArray%":T,"%TypeError%":M,"%Uint8Array%":typeof Uint8Array=="undefined"?void 0:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?void 0:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?void 0:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?void 0:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap=="undefined"?void 0:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?void 0:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?void 0:WeakSet},c=function h(b){var _;if(b==="%AsyncFunction%")_=y("async function () {}");else if(b==="%GeneratorFunction%")_=y("function* () {}");else if(b==="%AsyncGeneratorFunction%")_=y("async function* () {}");else if(b==="%AsyncGenerator%"){var O=h("%AsyncGeneratorFunction%");O&&(_=O.prototype)}else if(b==="%AsyncIteratorPrototype%"){var C=h("%AsyncGenerator%");C&&(_=R(C.prototype))}return S[b]=_,_},i={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},f=a(9),m=a(46),d=f.call(Function.call,Array.prototype.concat),l=f.call(Function.apply,Array.prototype.splice),s=f.call(Function.call,String.prototype.replace),v=f.call(Function.call,String.prototype.slice),p=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,o=/\\(\\)?/g,E=function(h){var b=v(h,0,1),_=v(h,-1);if(b==="%"&&_!=="%")throw new n("invalid intrinsic syntax, expected closing `%`");if(_==="%"&&b!=="%")throw new n("invalid intrinsic syntax, expected opening `%`");var O=[];return s(h,p,function(C,P,w,U){O[O.length]=w?s(U,o,"$1"):P||C}),O},g=function(h,b){var _,O=h;if(m(i,O)&&(_=i[O],O="%"+_[0]+"%"),m(S,O)){var C=S[O];if(C===L&&(C=c(O)),C===void 0&&!b)throw new M("intrinsic "+h+" exists, but is not available. Please file an issue!");return{alias:_,name:O,value:C}}throw new n("intrinsic "+h+" does not exist!")};t.exports=function(h,b){if(typeof h!="string"||h.length===0)throw new M("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof b!="boolean")throw new M('"allowMissing" argument must be a boolean');var _=E(h),O=_.length>0?_[0]:"",C=g("%"+O+"%",b),P=C.name,w=C.value,U=!1,k=C.alias;k&&(O=k[0],l(_,d([0,1],k)));for(var N=1,F=!0;N<_.length;N+=1){var H=_[N],W=v(H,0,1),B=v(H,-1);if((W==='"'||W==="'"||W==="`"||B==='"'||B==="'"||B==="`")&&W!==B)throw new n("property names with quotes must have matching quotes");if(H!=="constructor"&&F||(U=!0),O+="."+H,P="%"+O+"%",m(S,P))w=S[P];else if(w!=null){if(!(H in w)){if(!b)throw new M("base intrinsic for "+h+" exists, but the property is not available.");return}if(I&&N+1>=_.length){var j=I(w,H);F=!!j,w=F&&"get"in j&&!("originalValue"in j.get)?j.get:w[H]}else F=m(w,H),w=w[H];F&&!U&&(S[P]=w)}}return w}},function(t,e,a){"use strict";var n=a(45);t.exports=Function.prototype.bind||n},function(t,e,a){"use strict";var n=String.prototype.replace,u=/%20/g,M={RFC1738:"RFC1738",RFC3986:"RFC3986"};t.exports={default:M.RFC3986,formatters:{RFC1738:function(y){return n.call(y,u,"+")},RFC3986:function(y){return String(y)}},RFC1738:M.RFC1738,RFC3986:M.RFC3986}},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.findMediaElement=e.getMuxPlayerId=void 0;var n=a(6),u=function(y){return y&&y.nodeName!==void 0?(y.muxId||(y.muxId=y.id||(0,n.generateShortID)()),y.muxId):y},M=function(y){var I=void 0;return y&&y.nodeName!==void 0?(I=y,y=u(I)):I=document.querySelector(y),[I,y,I&&I.nodeName?I.nodeName.toLowerCase():""]};e.getMuxPlayerId=u,e.findMediaElement=M},function(t,e,a){"use strict";function n(){return(M.default.doNotTrack||M.default.navigator&&(M.default.navigator.doNotTrack||M.default.navigator.msDoNotTrack))==="1"}Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;var u=a(0),M=function(y){return y&&y.__esModule?y:{default:y}}(u)},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a(0),u=function(y){return y&&y.__esModule?y:{default:y}}(n),M={};M.exists=function(){var y=u.default.performance;return(y&&y.timing)!==void 0},M.domContentLoadedEventEnd=function(){var y=u.default.performance,I=y&&y.timing;return I&&I.domContentLoadedEventEnd},M.navigationStart=function(){var y=u.default.performance,I=y&&y.timing;return I&&I.navigationStart},e.default=M},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(u){var M={};for(var y in u){var I=u[y];I["DATA-ID"].search("io.litix.data.")!==-1&&(M[I["DATA-ID"].replace("io.litix.data.","")]=I.VALUE)}return M};e.default=n},function(t,e,a){"use strict";var n=a(41),u=a(51),M=a(10);t.exports={formats:M,parse:u,stringify:n}},function(t,e,a){"use strict";var n=a(10),u=Object.prototype.hasOwnProperty,M=Array.isArray,y=function(){for(var m=[],d=0;d<256;++d)m.push("%"+((d<16?"0":"")+d.toString(16)).toUpperCase());return m}(),I=function(m){for(;m.length>1;){var d=m.pop(),l=d.obj[d.prop];if(M(l)){for(var s=[],v=0;v<l.length;++v)l[v]!==void 0&&s.push(l[v]);d.obj[d.prop]=s}}},x=function(m,d){for(var l=d&&d.plainObjects?Object.create(null):{},s=0;s<m.length;++s)m[s]!==void 0&&(l[s]=m[s]);return l},A=function m(d,l,s){if(!l)return d;if(typeof l!="object"){if(M(d))d.push(l);else{if(!d||typeof d!="object")return[d,l];(s&&(s.plainObjects||s.allowPrototypes)||!u.call(Object.prototype,l))&&(d[l]=!0)}return d}if(!d||typeof d!="object")return[d].concat(l);var v=d;return M(d)&&!M(l)&&(v=x(d,s)),M(d)&&M(l)?(l.forEach(function(p,o){if(u.call(d,o)){var E=d[o];E&&typeof E=="object"&&p&&typeof p=="object"?d[o]=m(E,p,s):d.push(p)}else d[o]=p}),d):Object.keys(l).reduce(function(p,o){var E=l[o];return u.call(p,o)?p[o]=m(p[o],E,s):p[o]=E,p},v)},D=function(m,d){return Object.keys(d).reduce(function(l,s){return l[s]=d[s],l},m)},R=function(m,d,l){var s=m.replace(/\+/g," ");if(l==="iso-8859-1")return s.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(s)}catch{return s}},L=function(m,d,l,s,v){if(m.length===0)return m;var p=m;if(typeof m=="symbol"?p=Symbol.prototype.toString.call(m):typeof m!="string"&&(p=String(m)),l==="iso-8859-1")return escape(p).replace(/%u[0-9a-f]{4}/gi,function(h){return"%26%23"+parseInt(h.slice(2),16)+"%3B"});for(var o="",E=0;E<p.length;++E){var g=p.charCodeAt(E);g===45||g===46||g===95||g===126||g>=48&&g<=57||g>=65&&g<=90||g>=97&&g<=122||v===n.RFC1738&&(g===40||g===41)?o+=p.charAt(E):g<128?o+=y[g]:g<2048?o+=y[192|g>>6]+y[128|63&g]:g<55296||g>=57344?o+=y[224|g>>12]+y[128|g>>6&63]+y[128|63&g]:(E+=1,g=65536+((1023&g)<<10|1023&p.charCodeAt(E)),o+=y[240|g>>18]+y[128|g>>12&63]+y[128|g>>6&63]+y[128|63&g])}return o},T=function(m){for(var d=[{obj:{o:m},prop:"o"}],l=[],s=0;s<d.length;++s)for(var v=d[s],p=v.obj[v.prop],o=Object.keys(p),E=0;E<o.length;++E){var g=o[E],h=p[g];typeof h=="object"&&h!==null&&l.indexOf(h)===-1&&(d.push({obj:p,prop:g}),l.push(h))}return I(d),m},S=function(m){return Object.prototype.toString.call(m)==="[object RegExp]"},c=function(m){return!(!m||typeof m!="object")&&!!(m.constructor&&m.constructor.isBuffer&&m.constructor.isBuffer(m))},i=function(m,d){return[].concat(m,d)},f=function(m,d){if(M(m)){for(var l=[],s=0;s<m.length;s+=1)l.push(d(m[s]));return l}return d(m)};t.exports={arrayToObject:x,assign:D,combine:i,compact:T,decode:R,encode:L,isBuffer:c,isRegExp:S,maybeMap:f,merge:A}},function(t,e,a){"use strict";function n(S){return S&&S.__esModule?S:{default:S}}function u(S){var c={};for(var i in S)S.hasOwnProperty(i)&&(c[S[i]]=i);return c}function M(S){var c={},i={};return Object.keys(S).forEach(function(f){var m=!1;if(S.hasOwnProperty(f)&&S[f]!==void 0){var d=f.split("_"),l=d[0],s=R[l];s||(I.default.info("Data key word `"+d[0]+"` not expected in "+f),s=l+"_"),d.splice(1).forEach(function(v){v==="url"&&(m=!0),T[v]?s+=T[v]:Number(v)&&Math.floor(Number(v))===Number(v)?s+=v:(I.default.info("Data key word `"+v+"` not expected in "+f),s+="_"+v+"_")}),m?i[s]=S[f]:c[s]=S[f]}}),(0,A.default)(c,i)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=M;var y=a(4),I=n(y),x=a(1),A=n(x),D={a:"env",b:"beacon",c:"custom",d:"ad",e:"event",f:"experiment",i:"internal",m:"mux",n:"response",p:"player",q:"request",r:"retry",s:"session",t:"timestamp",u:"viewer",v:"video",w:"page",x:"view",y:"sub"},R=u(D),L={ad:"ad",ag:"aggregate",ap:"api",al:"application",ar:"architecture",as:"asset",au:"autoplay",av:"average",bi:"bitrate",br:"break",bw:"browser",by:"bytes",ca:"cached",cb:"cancel",cd:"code",cg:"category",ch:"changed",cn:"config",co:"count",ce:"counter",cp:"complete",cr:"creative",ct:"content",cu:"current",cx:"connection",dg:"downscaling",dm:"domain",dn:"cdn",do:"downscale",du:"duration",dv:"device",ec:"encoding",ed:"edge",en:"end",eg:"engine",em:"embed",er:"error",es:"errorcode",et:"errortext",ee:"event",ev:"events",ex:"expires",ep:"experiments",fi:"first",fm:"family",ft:"format",fq:"frequency",fr:"frame",fs:"fullscreen",hb:"holdback",he:"headers",ho:"host",hn:"hostname",ht:"height",id:"id",ii:"init",in:"instance",ip:"ip",is:"is",ke:"key",la:"language",lb:"labeled",le:"level",li:"live",ld:"loaded",lo:"load",ls:"lists",lt:"latency",ma:"max",md:"media",me:"message",mf:"manifest",mi:"mime",ml:"midroll",mm:"min",mn:"manufacturer",mo:"model",mx:"mux",ne:"newest",nm:"name",no:"number",on:"on",os:"os",pa:"paused",pb:"playback",pd:"producer",pe:"percentage",pf:"played",pg:"program",ph:"playhead",pi:"plugin",pl:"preroll",pn:"playing",po:"poster",pr:"preload",ps:"position",pt:"part",py:"property",ra:"rate",rd:"requested",re:"rebuffer",rf:"rendition",rm:"remote",ro:"ratio",rp:"response",rq:"request",rs:"requests",sa:"sample",se:"session",sk:"seek",sm:"stream",so:"source",sq:"sequence",sr:"series",st:"start",su:"startup",sv:"server",sw:"software",ta:"tag",tc:"tech",te:"text",tg:"target",th:"throughput",ti:"time",tl:"total",to:"to",tt:"title",ty:"type",ug:"upscaling",up:"upscale",ur:"url",us:"user",va:"variant",vd:"viewed",vi:"video",ve:"version",vw:"view",vr:"viewer",wd:"width",wa:"watch",wt:"waiting"},T=u(L)},function(t,e,a){"use strict";t.exports=a(19).default},function(t,e,a){"use strict";function n(o){return o&&o.__esModule?o:{default:o}}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function o(E,g){var h=[],b=!0,_=!1,O=void 0;try{for(var C,P=E[Symbol.iterator]();!(b=(C=P.next()).done)&&(h.push(C.value),!g||h.length!==g);b=!0);}catch(w){_=!0,O=w}finally{try{!b&&P.return&&P.return()}finally{if(_)throw O}}return h}return function(E,g){if(Array.isArray(E))return E;if(Symbol.iterator in Object(E))return o(E,g);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),M=a(0),y=n(M),I=a(11),x=a(4),A=n(x),D=a(12),R=n(D),L=a(2),T=n(L),S=a(22),c=n(S),i=a(58),f=n(i),m=a(59),d=n(m),l=a(64),s=n(l),v={},p=function o(E){var g=arguments;typeof E=="string"?o.hasOwnProperty(E)?y.default.setTimeout(function(){g=Array.prototype.splice.call(g,1),o[E].apply(null,g)},0):A.default.warn("`"+E+"` is an unknown task"):typeof E=="function"?y.default.setTimeout(function(){E(o)},0):A.default.warn("`"+E+"` is invalid.")};p.loaded=T.default.now(),p.NAME="mux-embed",p.VERSION="4.8.0",p.API_VERSION="2.1",p.PLAYER_TRACKED=!1,p.monitor=function(o,E){return(0,f.default)(p,o,E)},p.destroyMonitor=function(o){var E=(0,I.findMediaElement)(o),g=u(E,1),h=g[0];h&&h.mux&&typeof h.mux.destroy=="function"?h.mux.destroy():A.default.error("A video element monitor for `"+o+"` has not been initialized via `mux.monitor`.")},p.addHLSJS=function(o,E){var g=(0,I.getMuxPlayerId)(o);v[g]?v[g].addHLSJS(E):A.default.error("A monitor for `"+g+"` has not been initialized.")},p.addDashJS=function(o,E){var g=(0,I.getMuxPlayerId)(o);v[g]?v[g].addDashJS(E):A.default.error("A monitor for `"+g+"` has not been initialized.")},p.removeHLSJS=function(o){var E=(0,I.getMuxPlayerId)(o);v[E]?v[E].removeHLSJS():A.default.error("A monitor for `"+E+"` has not been initialized.")},p.removeDashJS=function(o){var E=(0,I.getMuxPlayerId)(o);v[E]?v[E].removeDashJS():A.default.error("A monitor for `"+E+"` has not been initialized.")},p.init=function(o,E){(0,R.default)()&&E&&E.respectDoNotTrack&&A.default.info("The browser's Do Not Track flag is enabled - Mux beaconing is disabled.");var g=(0,I.getMuxPlayerId)(o);v[g]=new c.default(p,g,E)},p.emit=function(o,E,g){var h=(0,I.getMuxPlayerId)(o);v[h]?(v[h].emit(E,g),E==="destroy"&&delete v[h]):A.default.error("A monitor for `"+h+"` has not been initialized.")},y.default!==void 0&&typeof y.default.addEventListener=="function"&&y.default.addEventListener("pagehide",function(o){o.persisted||(p.WINDOW_UNLOADING=!0)},!1),p.checkDoNotTrack=R.default,p.log=A.default,p.utils=d.default,p.events=s.default,e.default=p},function(t,e){var a;a=function(){return this}();try{a=a||Function("return this")()||(0,eval)("this")}catch{typeof window=="object"&&(a=window)}t.exports=a},function(t,e,a){var n,u;(function(M,y){"use strict";n=y,(u=typeof n=="function"?n.call(e,a,e,t):n)!==void 0&&(t.exports=u)})(0,function(){"use strict";function M(d,l){var s=d[l];if(typeof s.bind=="function")return s.bind(d);try{return Function.prototype.bind.call(s,d)}catch{return function(){return Function.prototype.apply.apply(s,[d,arguments])}}}function y(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function I(d){return d==="debug"&&(d="log"),typeof console!==T&&(d==="trace"&&S?y:console[d]!==void 0?M(console,d):console.log!==void 0?M(console,"log"):L)}function x(d,l){for(var s=0;s<c.length;s++){var v=c[s];this[v]=s<d?L:this.methodFactory(v,d,l)}this.log=this.debug}function A(d,l,s){return function(){typeof console!==T&&(x.call(this,l,s),this[d].apply(this,arguments))}}function D(d,l,s){return I(d)||A.apply(this,arguments)}function R(d,l,s){function v(_){var O=(c[_]||"silent").toUpperCase();if(typeof window!==T&&h){try{return void(window.localStorage[h]=O)}catch{}try{window.document.cookie=encodeURIComponent(h)+"="+O+";"}catch{}}}function p(){var _;if(typeof window!==T&&h){try{_=window.localStorage[h]}catch{}if(typeof _===T)try{var O=window.document.cookie,C=O.indexOf(encodeURIComponent(h)+"=");C!==-1&&(_=/^([^;]+)/.exec(O.slice(C))[1])}catch{}return g.levels[_]===void 0&&(_=void 0),_}}function o(){if(typeof window!==T&&h){try{return void window.localStorage.removeItem(h)}catch{}try{window.document.cookie=encodeURIComponent(h)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}var E,g=this;l=l==null?"WARN":l;var h="loglevel";typeof d=="string"?h+=":"+d:typeof d=="symbol"&&(h=void 0),g.name=d,g.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},g.methodFactory=s||D,g.getLevel=function(){return E},g.setLevel=function(_,O){if(typeof _=="string"&&g.levels[_.toUpperCase()]!==void 0&&(_=g.levels[_.toUpperCase()]),!(typeof _=="number"&&_>=0&&_<=g.levels.SILENT))throw"log.setLevel() called with invalid level: "+_;if(E=_,O!==!1&&v(_),x.call(g,_,d),typeof console===T&&_<g.levels.SILENT)return"No console available for logging"},g.setDefaultLevel=function(_){l=_,p()||g.setLevel(_,!1)},g.resetLevel=function(){g.setLevel(l,!1),o()},g.enableAll=function(_){g.setLevel(g.levels.TRACE,_)},g.disableAll=function(_){g.setLevel(g.levels.SILENT,_)};var b=p();b==null&&(b=l),g.setLevel(b,!1)}var L=function(){},T="undefined",S=typeof window!==T&&typeof window.navigator!==T&&/Trident\/|MSIE /.test(window.navigator.userAgent),c=["trace","debug","info","warn","error"],i=new R,f={};i.getLogger=function(d){if(typeof d!="symbol"&&typeof d!="string"||d==="")throw new TypeError("You must supply a name when creating a logger.");var l=f[d];return l||(l=f[d]=new R(d,i.getLevel(),i.methodFactory)),l};var m=typeof window!==T?window.log:void 0;return i.noConflict=function(){return typeof window!==T&&window.log===i&&(window.log=m),i},i.getLoggers=function(){return f},i.default=i,i})},function(t,e,a){"use strict";function n(q){return q&&q.__esModule?q:{default:q}}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function q(ie,ne){var Te=[],Se=!0,he=!1,Oe=void 0;try{for(var Ce,Ue=ie[Symbol.iterator]();!(Se=(Ce=Ue.next()).done)&&(Te.push(Ce.value),!ne||Te.length!==ne);Se=!0);}catch(me){he=!0,Oe=me}finally{try{!Se&&Ue.return&&Ue.return()}finally{if(he)throw Oe}}return Te}return function(ie,ne){if(Array.isArray(ie))return ie;if(Symbol.iterator in Object(ie))return q(ie,ne);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),M=a(4),y=n(M),I=a(1),x=n(I),A=a(6),D=a(5),R=a(0),L=n(R),T=a(13),S=n(T),c=a(3),i=n(c),f=a(23),m=a(24),d=a(25),l=n(d),s=a(26),v=n(s),p=a(27),o=n(p),E=a(28),g=n(E),h=a(29),b=n(h),_=a(30),O=n(_),C=a(31),P=n(C),w=a(32),U=n(w),k=a(33),N=n(k),F=a(34),H=n(F),W=a(35),B=n(W),j=a(36),V=n(j),Y=a(37),Q=n(Y),J=a(38),z=n(J),te=a(39),se=n(te),Z=a(57),Ee=n(Z),fe=["viewstart","ended","loadstart","pause","play","playing","ratechange","waiting","adplay","adpause","adended","aderror","adplaying","adrequest","adresponse","adbreakstart","adbreakend","adfirstquartile","admidpoint","adthirdquartile","rebufferstart","rebufferend","seeked","error","hb","requestcompleted","requestfailed","requestcanceled","renditionchange"],re=function(q,ie,ne){var Te=this;this.DOM_CONTENT_LOADED_EVENT_END=S.default.domContentLoadedEventEnd(),this.NAVIGATION_START=S.default.navigationStart();var Se={debug:!1,minimumRebufferDuration:250,sustainedRebufferThreshold:1e3,playbackHeartbeatTime:25,beaconDomain:"litix.io",sampleRate:1,disableCookies:!1,respectDoNotTrack:!1,disableRebufferTracking:!1,disablePlayheadRebufferTracking:!1,errorTranslator:function(me){return me}};this.mux=q,this.id=ie,ne=(0,x.default)(Se,ne),ne.data=ne.data||{},ne.data.property_key&&(ne.data.env_key=ne.data.property_key,delete ne.data.property_key),y.default.setLevel(ne.debug?"debug":"warn"),this.getPlayheadTime=ne.getPlayheadTime,this.getStateData=ne.getStateData||function(){},this.getAdData=ne.getAdData||function(){},this.minimumRebufferDuration=ne.minimumRebufferDuration,this.sustainedRebufferThreshold=ne.sustainedRebufferThreshold,this.playbackHeartbeatTime=ne.playbackHeartbeatTime,this.disableRebufferTracking=ne.disableRebufferTracking,this.disableRebufferTracking&&this.mux.log.warn("Disabling rebuffer tracking. This should only be used in specific circumstances as a last resort when your player is known to unreliably track rebuffering."),this.errorTranslator=ne.errorTranslator,this.playbackEventDispatcher=new se.default(q,ne.data.env_key,ne),this.data={player_instance_id:(0,A.generateUUID)(),mux_sample_rate:ne.sampleRate,beacon_domain:ne.beaconCollectionDomain?ne.beaconCollectionDomain:ne.beaconDomain},this.data.view_sequence_number=1,this.data.player_sequence_number=1,this.oldEmit=this.emit,this.emit=function(me,Ae){Ae=(0,x.default)({viewer_time:this.mux.utils.now()},Ae),this.oldEmit(me,Ae)};var he=function(){this.data.view_start===void 0&&(this.data.view_start=this.mux.utils.now(),this.emit("viewstart"))}.bind(this);this.on("viewinit",function(me,Ae){this._resetVideoData(),this._resetViewData(),this._resetErrorData(),this._updateStateData(),(0,x.default)(this.data,Ae),this._initializeViewData(),this.one("play",he),this.one("adbreakstart",he)});var Oe=function(me){this.emit("viewend"),this.send("viewend"),this.emit("viewinit",me)}.bind(this);if(this.on("videochange",function(me,Ae){Oe(Ae)}),this.on("programchange",function(me,Ae){this.data.player_is_paused&&this.mux.log.warn("The `programchange` event is intended to be used when the content changes mid playback without the video source changing, however the video is not currently playing. If the video source is changing please use the videochange event otherwise you will lose startup time information."),Oe((0,x.default)(Ae,{view_program_changed:!0})),he(),this.emit("play"),this.emit("playing")}),this.on("fragmentchange",function(me,Ae){this.currentFragmentPDT=Ae.currentFragmentPDT,this.currentFragmentStart=Ae.currentFragmentStart}),this.on("destroy",this.destroy),L.default!==void 0&&typeof L.default.addEventListener=="function"&&typeof L.default.removeEventListener=="function"){var Ce=function(me){me.persisted||Te.destroy()};L.default.addEventListener("pagehide",Ce,!1),this.on("destroy",function(){L.default.removeEventListener("pagehide",Ce)})}this.on("playerready",function(me,Ae){(0,x.default)(this.data,Ae)}),fe.forEach(function(me){Te.on(me,function(Ae,Re){me.indexOf("ad")!==0&&this._updateStateData(),(0,x.default)(this.data,Re),this._sanitizeData()}),Te.on("after"+me,function(){(me!=="error"||this.viewErrored)&&this.send(me)})}),this.on("viewend",function(me,Ae){(0,x.default)(Te.data,Ae)});var Ue=function(me){var Ae=this.mux.utils.now();this.data.player_init_time&&(this.data.player_startup_time=Ae-this.data.player_init_time),!this.mux.PLAYER_TRACKED&&this.NAVIGATION_START&&(this.mux.PLAYER_TRACKED=!0,(this.data.player_init_time||this.DOM_CONTENT_LOADED_EVENT_END)&&(this.data.page_load_time=Math.min(this.data.player_init_time||1/0,this.DOM_CONTENT_LOADED_EVENT_END||1/0)-this.NAVIGATION_START)),this.send("playerready"),delete this.data.player_startup_time,delete this.data.page_load_time};this.one("playerready",Ue),o.default.apply(this),z.default.apply(this),B.default.apply(this),O.default.apply(this),v.default.apply(this),H.default.apply(this),g.default.apply(this),b.default.apply(this),V.default.apply(this),P.default.apply(this),U.default.apply(this),N.default.apply(this),Q.default.apply(this),Ee.default.apply(this),ne.hlsjs&&this.addHLSJS(ne),ne.dashjs&&this.addDashJS(ne),this.emit("viewinit",ne.data)};(0,x.default)(re.prototype,l.default.prototype),(0,x.default)(re.prototype,O.default.prototype),(0,x.default)(re.prototype,B.default.prototype),(0,x.default)(re.prototype,v.default.prototype),(0,x.default)(re.prototype,g.default.prototype),(0,x.default)(re.prototype,b.default.prototype),(0,x.default)(re.prototype,V.default.prototype),(0,x.default)(re.prototype,U.default.prototype),(0,x.default)(re.prototype,N.default.prototype),re.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.data.view_start!==void 0&&(this.emit("viewend"),this.send("viewend")),this.playbackEventDispatcher.destroy(),this.removeHLSJS(),this.removeDashJS(),L.default.clearTimeout(this._heartBeatTimeout))},re.prototype.send=function(q){var ie=(0,x.default)({},this.data),ne=["player_program_time","player_manifest_newest_program_time","video_holdback","video_part_holdback","video_target_duration","video_part_target_duration"];if(ie.video_source_is_live===void 0&&(ie.player_source_duration===1/0||ie.video_source_duration===1/0?ie.video_source_is_live=!0:(ie.player_source_duration>0||ie.video_source_duration>0)&&(ie.video_source_is_live=!1)),ie.video_source_is_live||ne.forEach(function(Ce){ie[Ce]=void 0}),ie.video_source_url=ie.video_source_url||ie.player_source_url,ie.video_source_url){var Te=(0,D.extractHostnameAndDomain)(ie.video_source_url),Se=u(Te,2),he=Se[0],Oe=Se[1];ie.video_source_domain=Oe,ie.video_source_hostname=he}delete ie.ad_request_id,this.playbackEventDispatcher.send(q,ie),this.data.view_sequence_number++,this.data.player_sequence_number++,this._restartHeartBeat()},re.prototype._updateStateData=function(){(0,x.default)(this.data,this.getStateData()),this._updatePlayheadTime(),this._sanitizeData()},re.prototype._sanitizeData=function(){var q=this;["player_width","player_height","video_source_width","video_source_height","player_playhead_time","video_source_bitrate"].forEach(function(ie){var ne=parseInt(q.data[ie],10);q.data[ie]=isNaN(ne)?void 0:ne}),["player_source_url","video_source_url"].forEach(function(ie){if(q.data[ie]){var ne=q.data[ie].toLowerCase();ne.indexOf("data:")!==0&&ne.indexOf("blob:")!==0||(q.data[ie]="MSE style URL")}})},re.prototype._resetVideoData=function(q,ie){var ne=this;Object.keys(this.data).forEach(function(Te){Te.indexOf("video_")===0&&delete ne.data[Te]})},re.prototype._resetViewData=function(){var q=this;Object.keys(this.data).forEach(function(ie){ie.indexOf("view_")===0&&delete q.data[ie]}),this.data.view_sequence_number=1},re.prototype._resetErrorData=function(q,ie){delete this.data.player_error_code,delete this.data.player_error_message},re.prototype._initializeViewData=function(){var q=this,ie=this.data.view_id=(0,A.generateUUID)(),ne=function(){ie===q.data.view_id&&(0,i.default)(q.data,"player_view_count",1)};this.data.player_is_paused?this.one("play",ne):ne()},re.prototype._restartHeartBeat=function(){var q=this;L.default.clearTimeout(this._heartBeatTimeout),this.viewErrored||(this._heartBeatTimeout=L.default.setTimeout(function(){q.data.player_is_paused||q.emit("hb")},1e4))},re.prototype.addHLSJS=function(q){return q.hlsjs?this.hlsjs?void this.mux.log.warn("An instance of HLS.js is already being monitored for this player."):(this.hlsjs=q.hlsjs,void(0,f.monitorHlsJs)(this.mux,this.id,q.hlsjs,{},q.Hls||L.default.Hls)):void this.mux.log.warn("You must pass a valid hlsjs instance in order to track it.")},re.prototype.removeHLSJS=function(){this.hlsjs&&((0,f.stopMonitoringHlsJs)(this.hlsjs),this.hlsjs=void 0)},re.prototype.addDashJS=function(q){return q.dashjs?this.dashjs?void this.mux.log.warn("An instance of Dash.js is already being monitored for this player."):(this.dashjs=q.dashjs,void(0,m.monitorDashJS)(this.mux,this.id,q.dashjs)):void this.mux.log.warn("You must pass a valid dashjs instance in order to track it.")},re.prototype.removeDashJS=function(){this.dashjs&&((0,m.stopMonitoringDashJS)(this.dashjs),this.dashjs=void 0)},e.default=re},function(t,e,a){"use strict";function n(c){return c&&c.__esModule?c:{default:c}}Object.defineProperty(e,"__esModule",{value:!0}),e.stopMonitoringHlsJs=e.monitorHlsJs=void 0;var u=a(7),M=n(u),y=a(13),I=n(y),x=a(5),A=a(14),D=n(A),R=function(c){if(!c)return{};var i=I.default.navigationStart(),f=c.loading,m=f?f.start:c.trequest,d=f?f.first:c.tfirst,l=f?f.end:c.tload;return{bytesLoaded:c.total,requestStart:Math.round(i+m),responseStart:Math.round(i+d),responseEnd:Math.round(i+l)}},L=function(c){if(c&&typeof c.getAllResponseHeaders=="function")return(0,M.default)(c.getAllResponseHeaders())},T=function(c,i,f){var m=(arguments.length>3&&arguments[3]!==void 0&&arguments[3],arguments[4]),d=c.log,l=c.utils.secondsToMs,s=function(C){var P=parseInt(m.version),w=void 0;return P===1&&C.programDateTime!==null&&(w=C.programDateTime),P===0&&C.pdt!==null&&(w=C.pdt),w};if(!I.default.exists())return void d.warn("performance timing not supported. Not tracking HLS.js.");var v=function(C,P){return c.emit(i,C,P)},p=function(C,P){var w=P.levels,U=P.audioTracks,k=P.url,N=P.stats,F=P.networkDetails,H=P.sessionData,W={},B={},j={};j=(0,D.default)(H),w.forEach(function(te,se){W[se]={width:te.width,height:te.height,bitrate:te.bitrate,attrs:te.attrs}}),U.forEach(function(te,se){B[se]={name:te.name,language:te.lang,bitrate:te.bitrate}});var V=R(N),Y=V.bytesLoaded,Q=V.requestStart,J=V.responseStart,z=V.responseEnd;j.request_event_type=C,j.request_bytes_loaded=Y,j.request_start=Q,j.request_response_start=J,j.request_response_end=z,j.request_type="manifest",j.request_hostname=(0,x.extractHostname)(k),j.request_response_headers=L(F),j.request_rendition_lists={media:W,audio:B,video:{}},v("requestcompleted",j)};f.on(m.Events.MANIFEST_LOADED,p);var o=function(C,P){var w=P.details,U=P.level,k=P.networkDetails,N=P.stats,F=R(N),H=F.bytesLoaded,W=F.requestStart,B=F.responseStart,j=F.responseEnd,V=w.fragments[w.fragments.length-1],Y=s(V)+l(V.duration);v("requestcompleted",{request_event_type:C,request_bytes_loaded:H,request_start:W,request_response_start:B,request_response_end:j,request_current_level:U,request_type:"manifest",request_hostname:(0,x.extractHostname)(w.url),request_response_headers:L(k),video_holdback:w.holdBack&&l(w.holdBack),video_part_holdback:w.partHoldBack&&l(w.partHoldBack),video_part_target_duration:w.partTarget&&l(w.partTarget),video_target_duration:w.targetduration&&l(w.targetduration),video_source_is_live:w.live,player_manifest_newest_program_time:isNaN(Y)?void 0:Y})};f.on(m.Events.LEVEL_LOADED,o);var E=function(C,P){var w=P.details,U=P.networkDetails,k=P.stats,N=R(k),F=N.bytesLoaded,H=N.requestStart,W=N.responseStart,B=N.responseEnd;v("requestcompleted",{request_event_type:C,request_bytes_loaded:F,request_start:H,request_response_start:W,request_response_end:B,request_type:"manifest",request_hostname:(0,x.extractHostname)(w.url),request_response_headers:L(U)})};f.on(m.Events.AUDIO_TRACK_LOADED,E);var g=function(C,P){var w=P.stats,U=P.networkDetails,k=P.frag,N=R(w),F=N.bytesLoaded,H=N.requestStart,W=N.responseStart,B=N.responseEnd,j={request_event_type:C,request_bytes_loaded:F,request_start:H,request_response_start:W,request_response_end:B,request_hostname:U?(0,x.extractHostname)(U.responseURL):void 0,request_response_headers:L(U),request_media_duration:k.duration};k.type==="main"?(j.request_type="media",j.request_current_level=k.level,j.request_video_width=(f.levels[k.level]||{}).width,j.request_video_height=(f.levels[k.level]||{}).height):j.request_type=k.type,v("requestcompleted",j)};f.on(m.Events.FRAG_LOADED,g);var h=function(C,P){var w=P.frag,U=w.start,k=s(w),N={currentFragmentPDT:k,currentFragmentStart:l(U)};v("fragmentchange",N)};f.on(m.Events.FRAG_CHANGED,h);var b=function(C,P){var w=P.type,U=P.details,k=P.response,N=P.fatal,F=P.context,H=P.frag;if(U===m.ErrorDetails.MANIFEST_LOAD_ERROR||U===m.ErrorDetails.MANIFEST_LOAD_TIMEOUT||U===m.ErrorDetails.FRAG_LOAD_ERROR||U===m.ErrorDetails.FRAG_LOAD_TIMEOUT||U===m.ErrorDetails.LEVEL_LOAD_ERROR||U===m.ErrorDetails.LEVEL_LOAD_TIMEOUT){var W=H&&H.url||F&&F.url||"";v("requestfailed",{request_error:U,request_url:W,request_hostname:(0,x.extractHostname)(W),request_type:U===m.ErrorDetails.FRAG_LOAD_ERROR||U===m.ErrorDetails.FRAG_LOAD_TIMEOUT?"media":"manifest",request_error_code:k&&k.code,request_error_text:k&&k.text})}N&&v("error",{player_error_code:w,player_error_message:U})};f.on(m.Events.ERROR,b);var _=function(C,P){var w=P.frag,U=w&&w._url||"";v("requestcanceled",{request_cancel:C,request_url:U,request_type:"media",request_hostname:(0,x.extractHostname)(U)})};f.on(m.Events.FRAG_LOAD_EMERGENCY_ABORTED,_);var O=function(C,P){var w=P.level,U=f.levels[w];if(U&&U.attrs&&U.attrs.BANDWIDTH){var k=U.attrs.BANDWIDTH;k?v("renditionchange",{video_source_bitrate:k,video_source_width:U.width,video_source_height:U.height}):d.warn("missing BANDWIDTH from HLS manifest parsed by HLS.js")}};f.on(m.Events.LEVEL_SWITCHED,O),f._stopMuxMonitor=function(){f.off(m.Events.MANIFEST_LOADED,p),f.off(m.Events.LEVEL_LOADED,o),f.off(m.Events.AUDIO_TRACK_LOADED,E),f.off(m.Events.FRAG_LOADED,g),f.off(m.Events.FRAG_CHANGED,h),f.off(m.Events.ERROR,b),f.off(m.Events.FRAG_LOAD_EMERGENCY_ABORTED,_),f.off(m.Events.LEVEL_SWITCHED,O),f.off(m.Events.DESTROYING,f._stopMuxMonitor),delete f._stopMuxMonitor},f.on(m.Events.DESTROYING,f._stopMuxMonitor)},S=function(c){c&&typeof c._stopMuxMonitor=="function"&&c._stopMuxMonitor()};e.monitorHlsJs=T,e.stopMonitoringHlsJs=S},function(t,e,a){"use strict";function n(T){return T&&T.__esModule?T:{default:T}}Object.defineProperty(e,"__esModule",{value:!0}),e.stopMonitoringDashJS=e.monitorDashJS=void 0;var u=a(0),M=n(u),y=a(7),I=n(y),x=a(5),A=function(T,S){if(!T||typeof T.getRequests!="function")return{};var c=T.getRequests({state:"executed"});if(c.length===0)return{};var i=c[c.length-1],f=(0,x.extractHostname)(i.url),m=i.bytesLoaded,d=new Date(i.requestStartDate).getTime(),l=new Date(i.firstByteDate).getTime(),s=new Date(i.requestEndDate).getTime(),v=isNaN(i.duration)?0:i.duration,p=typeof S.getMetricsFor=="function"?S.getMetricsFor(i.mediaType).HttpList:S.getDashMetrics().getHttpRequests(i.mediaType),o=void 0;return p.length>0&&(o=(0,I.default)(p[p.length-1]._responseHeaders||"")),{requestStart:d,requestResponseStart:l,requestResponseEnd:s,requestBytesLoaded:m,requestResponseHeaders:o,requestMediaDuration:v,requestHostname:f}},D=function(T,S){var c=S.getQualityFor(T),i=S.getCurrentTrackFor(T),f=i.bitrateList;return f?{currentLevel:c,renditionWidth:f[c].width||null,renditionHeight:f[c].height||null,renditionBitrate:f[c].bandwidth}:{}},R=function(T,S,c){var i=(arguments.length>3&&arguments[3]!==void 0&&arguments[3],T.log);if(!c||!c.on)return void i.warn("Invalid dash.js player reference. Monitoring blocked.");var f=function(g,h){return T.emit(S,g,h)},m=function(g){var h=g.type,b=g.data,_=b||{},O=_.url;f("requestcompleted",{request_event_type:h,request_start:0,request_response_start:0,request_response_end:0,request_bytes_loaded:-1,request_type:"manifest",request_hostname:(0,x.extractHostname)(O)})};c.on("manifestLoaded",m);var d={},l=function(g){var h=g.type,b=g.fragmentModel,_=g.chunk,O=_||{},C=O.mediaInfo,P=C||{},w=P.type,U=P.bitrateList;U=U||[];var k={};U.forEach(function(Y,Q){k[Q]={},k[Q].width=Y.width,k[Q].height=Y.height,k[Q].bitrate=Y.bandwidth,k[Q].attrs={}}),w==="video"?d.video=k:w==="audio"?d.audio=k:d.media=k;var N=A(b,c),F=N.requestStart,H=N.requestResponseStart,W=N.requestResponseEnd,B=N.requestResponseHeaders,j=N.requestMediaDuration,V=N.requestHostname;f("requestcompleted",{request_event_type:h,request_start:F,request_response_start:H,request_response_end:W,request_bytes_loaded:-1,request_type:w+"_init",request_response_headers:B,request_hostname:V,request_media_duration:j,request_rendition_lists:d})};c.on("initFragmentLoaded",l);var s=function(g){var h=g.type,b=g.fragmentModel,_=g.chunk,O=_||{},C=O.mediaInfo,P=O.start,w=C||{},U=w.type,k=A(b,c),N=k.requestStart,F=k.requestResponseStart,H=k.requestResponseEnd,W=k.requestBytesLoaded,B=k.requestResponseHeaders,j=k.requestMediaDuration,V=k.requestHostname,Y=D(U,c),Q=Y.currentLevel,J=Y.renditionWidth,z=Y.renditionHeight,te=Y.renditionBitrate;f("requestcompleted",{request_event_type:h,request_start:N,request_response_start:F,request_response_end:H,request_bytes_loaded:W,request_type:U,request_response_headers:B,request_hostname:V,request_media_start_time:P,request_media_duration:j,request_current_level:Q,request_labeled_bitrate:te,request_video_width:J,request_video_height:z})};c.on("mediaFragmentLoaded",s);var v={video:void 0,audio:void 0,totalBitrate:void 0},p=function(){if(v.video&&typeof v.video.bitrate=="number"){if(!v.video.width||!v.video.height)return void i.warn("have bitrate info for video but missing width/height");var g=v.video.bitrate;return v.audio&&typeof v.audio.bitrate=="number"&&(g+=v.audio.bitrate),g!==v.totalBitrate?(v.totalBitrate=g,{video_source_bitrate:g,video_source_height:v.video.height,video_source_width:v.video.width}):void 0}},o=function(g,h,b){if(typeof g.newQuality!="number")return void i.warn("missing evt.newQuality in qualityChangeRendered event",g);var _=g.mediaType;if(_==="audio"||_==="video"){var O=c.getBitrateInfoListFor(_).find(function(P){return P.qualityIndex===g.newQuality});if(!O||typeof O.bitrate!="number")return void i.warn("missing bitrate info for "+_);v[_]=O;var C=p();C&&f("renditionchange",C)}};c.on("qualityChangeRendered",o);var E=function(g){var h=g.error,b=g.event;b=b||{};var _=b.request||{},O=M.default.event&&M.default.event.currentTarget||{};f("requestfailed",{request_error:h+"_"+b.id+"_"+_.type,request_url:b.url,request_hostname:(0,x.extractHostname)(b.url),request_type:_.mediaType,request_error_code:O.status,request_error_type:O.statusText})};c.on("error",E),c._stopMuxMonitor=function(){c.off("manifestLoaded",m),c.off("initFragmentLoaded",l),c.off("mediaFragmentLoaded",s),c.off("qualityChangeRendered",o),c.off("error",E),delete c._stopMuxMonitor}},L=function(T){T&&typeof T._stopMuxMonitor=="function"&&T._stopMuxMonitor()};e.monitorDashJS=R,e.stopMonitoringDashJS=L},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){},u=0;n.prototype.on=function(M,y,I){return y._eventEmitterGuid=y._eventEmitterGuid||++u,this._listeners=this._listeners||{},this._listeners[M]=this._listeners[M]||[],I&&(y=y.bind(I)),this._listeners[M].push(y),y},n.prototype.off=function(M,y){var I=this._listeners&&this._listeners[M];I&&I.forEach(function(x,A){x._eventEmitterGuid===y._eventEmitterGuid&&I.splice(A,1)})},n.prototype.one=function(M,y,I){var x=this;y._eventEmitterGuid=y._eventEmitterGuid||++u;var A=function D(){x.off(M,D),y.apply(I||this,arguments)};A._eventEmitterGuid=y._eventEmitterGuid,this.on(M,A)},n.prototype.emit=function(M,y){var I=this;if(this._listeners){y=y||{};var x=this._listeners["before*"]||[],A=this._listeners[M]||[],D=this._listeners["after"+M]||[],R=function(L,T){L=L.slice(),L.forEach(function(S){S.call(I,{type:M},T)})};R(x,y),R(A,y),R(D,y)}},e.default=n},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a(0),u=function(y){return y&&y.__esModule?y:{default:y}}(n),M=function(){this._playbackHeartbeatInterval=null,this._playheadShouldBeProgressing=!1,this.on("playing",function(){this._playheadShouldBeProgressing=!0}),this.on("play",this._startPlaybackHeartbeatInterval),this.on("playing",this._startPlaybackHeartbeatInterval),this.on("adbreakstart",this._startPlaybackHeartbeatInterval),this.on("adplay",this._startPlaybackHeartbeatInterval),this.on("adplaying",this._startPlaybackHeartbeatInterval),this.on("seeking",this._startPlaybackHeartbeatInterval),this.on("devicewake",this._startPlaybackHeartbeatInterval),this.on("viewstart",this._startPlaybackHeartbeatInterval),this.on("rebufferstart",this._startPlaybackHeartbeatInterval),this.on("pause",this._stopPlaybackHeartbeatInterval),this.on("ended",this._stopPlaybackHeartbeatInterval),this.on("viewend",this._stopPlaybackHeartbeatInterval),this.on("error",this._stopPlaybackHeartbeatInterval),this.on("aderror",this._stopPlaybackHeartbeatInterval),this.on("adpause",this._stopPlaybackHeartbeatInterval),this.on("adended",this._stopPlaybackHeartbeatInterval),this.on("adbreakend",this._stopPlaybackHeartbeatInterval),this.on("seeked",function(){this.data.player_is_paused?this._stopPlaybackHeartbeatInterval():this._startPlaybackHeartbeatInterval()}),this.on("timeupdate",function(){this._playbackHeartbeatInterval!==null&&this.emit("playbackheartbeat")}),this.on("devicesleep",function(y,I){this._playbackHeartbeatInterval!==null&&(u.default.clearInterval(this._playbackHeartbeatInterval),this.emit("playbackheartbeatend",{viewer_time:I.viewer_time}),this._playbackHeartbeatInterval=null)})};M.prototype._startPlaybackHeartbeatInterval=function(){var y=this;this._playbackHeartbeatInterval===null&&(this.emit("playbackheartbeat"),this._playbackHeartbeatInterval=u.default.setInterval(function(){y.emit("playbackheartbeat")},this.playbackHeartbeatTime))},M.prototype._stopPlaybackHeartbeatInterval=function(){this._playheadShouldBeProgressing=!1,this._playbackHeartbeatInterval!==null&&(u.default.clearInterval(this._playbackHeartbeatInterval),this.emit("playbackheartbeatend"),this._playbackHeartbeatInterval=null)},e.default=M},function(t,e,a){"use strict";function n(){var u=this;this.on("viewinit",function(){u.viewErrored=!1}),this.on("error",function(){try{var M=u.errorTranslator({player_error_code:u.data.player_error_code,player_error_message:u.data.player_error_message});M?(u.data.player_error_code=M.player_error_code,u.data.player_error_message=M.player_error_message,u.viewErrored=!0):(delete u.data.player_error_code,delete u.data.player_error_message)}catch(y){u.mux.log.warn("Exception in error translator callback.",y),u.viewErrored=!0}})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=n},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a(3),u=function(y){return y&&y.__esModule?y:{default:y}}(n),M=function(){this._watchTimeTrackerLastCheckedTime=null,this.on("playbackheartbeat",this._updateWatchTime),this.on("playbackheartbeatend",this._clearWatchTimeState)};M.prototype._updateWatchTime=function(y,I){var x=I.viewer_time;this._watchTimeTrackerLastCheckedTime===null&&(this._watchTimeTrackerLastCheckedTime=x),(0,u.default)(this.data,"view_watch_time",x-this._watchTimeTrackerLastCheckedTime),this._watchTimeTrackerLastCheckedTime=x},M.prototype._clearWatchTimeState=function(y,I){this._updateWatchTime(y,I),this._watchTimeTrackerLastCheckedTime=null},e.default=M},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a(3),u=function(y){return y&&y.__esModule?y:{default:y}}(n),M=function(){this._playbackTimeTrackerLastPlayheadPosition=-1,this.on("playbackheartbeat",this._updatePlaybackTime),this.on("playbackheartbeatend",this._clearPlaybackTimeState),this.on("seeking",this._clearPlaybackTimeState)};M.prototype._updatePlaybackTime=function(){var y=this.data.player_playhead_time;if(this._playbackTimeTrackerLastPlayheadPosition>=0&&y>this._playbackTimeTrackerLastPlayheadPosition){var I=y-this._playbackTimeTrackerLastPlayheadPosition;I<=1e3&&(0,u.default)(this.data,"view_content_playback_time",I)}this._playbackTimeTrackerLastPlayheadPosition=y},M.prototype._clearPlaybackTimeState=function(){this._updatePlaybackTime(),this._playbackTimeTrackerLastPlayheadPosition=-1},e.default=M},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){this.on("playbackheartbeat",this._updatePlayheadTime),this.on("playbackheartbeatend",this._updatePlayheadTime),this.on("timeupdate",this._updatePlayheadTime),this.on("destroy",function(){this.off("timeupdate",this._updatePlayheadTime)})};n.prototype._updateMaxPlayheadPosition=function(){this.data.view_max_playhead_position=this.data.view_max_playhead_position===void 0?this.data.player_playhead_time:Math.max(this.data.view_max_playhead_position,this.data.player_playhead_time)},n.prototype._updatePlayheadTime=function(u,M){var y=this,I=function(){y.currentFragmentPDT&&y.currentFragmentStart&&(y.data.player_program_time=y.currentFragmentPDT+y.data.player_playhead_time-y.currentFragmentStart)};if(M&&M.player_playhead_time)this.data.player_playhead_time=M.player_playhead_time,I(),this._updateMaxPlayheadPosition();else if(this.getPlayheadTime){var x=this.getPlayheadTime();x!==void 0&&(this.data.player_playhead_time=x,I(),this._updateMaxPlayheadPosition())}},e.default=n},function(t,e,a){"use strict";function n(){var y=this;if(!this.disableRebufferTracking){var I=void 0,x=function(){if(I){var A=y.data.viewer_time-I;(0,M.default)(y.data,"view_rebuffer_duration",A),I=y.data.viewer_time}y.data.view_watch_time>=0&&y.data.view_rebuffer_count>0&&(y.data.view_rebuffer_frequency=y.data.view_rebuffer_count/y.data.view_watch_time,y.data.view_rebuffer_percentage=y.data.view_rebuffer_duration/y.data.view_watch_time)};this.on("playbackheartbeat",function(){return x()}),this.on("rebufferstart",function(){I||((0,M.default)(y.data,"view_rebuffer_count",1),I=y.data.viewer_time,y.one("rebufferend",function(){x(),I=void 0}))})}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;var u=a(3),M=function(y){return y&&y.__esModule?y:{default:y}}(u)},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a(2),u=function(y){return y&&y.__esModule?y:{default:y}}(n),M=function(){this.disableRebufferTracking||this.disablePlayheadRebufferTracking||(this._lastCheckedTime=null,this._lastPlayheadTime=null,this._lastPlayheadTimeUpdatedTime=null,this.on("playbackheartbeat",this._checkIfRebuffering),this.on("playbackheartbeatend",this._cleanupRebufferTracker),this.on("seeking",function(){this._cleanupRebufferTracker(null,{viewer_time:u.default.now()})}))};M.prototype._checkIfRebuffering=function(y,I){return this.isSeeking||this.isAdBreak||!this._playheadShouldBeProgressing?void this._cleanupRebufferTracker(y,I):this._lastCheckedTime===null?void this._prepareRebufferTrackerState(I.viewer_time):this._lastPlayheadTime!==this.data.player_playhead_time?void this._cleanupRebufferTracker(y,I,!0):(I.viewer_time-this._lastPlayheadTimeUpdatedTime>=this.sustainedRebufferThreshold&&(this._rebuffering||(this._rebuffering=!0,this.emit("rebufferstart",{viewer_time:this._lastPlayheadTimeUpdatedTime}))),void(this._lastCheckedTime=I.viewer_time))},M.prototype._clearRebufferTrackerState=function(){this._lastCheckedTime=null,this._lastPlayheadTime=null,this._lastPlayheadTimeUpdatedTime=null},M.prototype._prepareRebufferTrackerState=function(y){this._lastCheckedTime=y,this._lastPlayheadTime=this.data.player_playhead_time,this._lastPlayheadTimeUpdatedTime=y},M.prototype._cleanupRebufferTracker=function(y,I){var x=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(this._rebuffering)this._rebuffering=!1,this.emit("rebufferend",{viewer_time:I.viewer_time});else{if(this._lastCheckedTime===null)return;var A=this.data.player_playhead_time-this._lastPlayheadTime,D=I.viewer_time-this._lastPlayheadTimeUpdatedTime;A>0&&D-A>this.minimumRebufferDuration&&(this.emit("rebufferstart",{viewer_time:this._lastPlayheadTimeUpdatedTime}),this.emit("rebufferend",{viewer_time:this._lastPlayheadTimeUpdatedTime+D-A}))}x?this._prepareRebufferTrackerState(I.viewer_time):this._clearRebufferTrackerState()},e.default=M},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a(2),u=function(y){return y&&y.__esModule?y:{default:y}}(n),M=function(){this.on("viewinit",function(){var y=this.data,I=y.view_id;if(!y.view_program_changed){var x=function(A,D){var R=D.viewer_time;A.type==="playing"&&this.data.view_time_to_first_frame===void 0?this.calculateTimeToFirstFrame(R||u.default.now(),I):A.type!=="adplaying"||this.data.view_time_to_first_frame!==void 0&&!this.inPrerollPosition()||this.calculateTimeToFirstFrame(R||u.default.now(),I)};this.one("playing",x),this.one("adplaying",x),this.one("viewend",function(){this.off("playing",x),this.off("adplaying",x)})}})};M.prototype.calculateTimeToFirstFrame=function(y,I){I===this.data.view_id&&(this._updateWatchTime(null,{viewer_time:y}),this.data.view_time_to_first_frame=this.data.view_watch_time,(this.data.player_autoplay_on||this.data.video_is_autoplay)&&this.NAVIGATION_START&&(this.data.view_aggregate_startup_time=this.data.view_start+this.data.view_watch_time-this.NAVIGATION_START))},e.default=M},function(t,e,a){"use strict";function n(){var y=this;this.on("viewinit",function(){this._lastPlayheadPosition=-1});var I=["pause","rebufferstart","seeking","error","adbreakstart","hb"],x=["playing","hb"];I.forEach(function(A){y.on(A,function(){if(this._lastPlayheadPosition>=0&&this.data.player_playhead_time>=0&&this._lastPlayerWidth>=0&&this._lastSourceWidth>0&&this._lastPlayerHeight>=0&&this._lastSourceHeight>0){var D=this.data.player_playhead_time-this._lastPlayheadPosition;if(D<0)return void(this._lastPlayheadPosition=-1);var R=Math.min(this._lastPlayerWidth/this._lastSourceWidth,this._lastPlayerHeight/this._lastSourceHeight),L=Math.max(0,R-1),T=Math.max(0,1-R);this.data.view_max_upscale_percentage=Math.max(this.data.view_max_upscale_percentage||0,L),this.data.view_max_downscale_percentage=Math.max(this.data.view_max_downscale_percentage||0,T),(0,M.default)(this.data,"view_total_content_playback_time",D),(0,M.default)(this.data,"view_total_upscaling",L*D),(0,M.default)(this.data,"view_total_downscaling",T*D)}this._lastPlayheadPosition=-1})}),x.forEach(function(A){y.on(A,function(){this._lastPlayheadPosition=this.data.player_playhead_time,this._lastPlayerWidth=this.data.player_width,this._lastPlayerHeight=this.data.player_height,this._lastSourceWidth=this.data.video_source_width,this._lastSourceHeight=this.data.video_source_height})})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;var u=a(3),M=function(y){return y&&y.__esModule?y:{default:y}}(u)},function(t,e,a){"use strict";function n(R){return R&&R.__esModule?R:{default:R}}function u(){this.isSeeking=!1,this.on("seeking",function(R,L){(0,D.default)(this.data,L),this._lastSeekingTime=y.default.now(),this.isSeeking===!1&&(this.isSeeking=!0,this.send("seeking"))}),this.on("seeked",function(){this.isSeeking=!1;var R=this._lastSeekingTime||y.default.now(),L=y.default.now()-R;(0,x.default)(this.data,"view_seek_count",1),(0,x.default)(this.data,"view_seek_duration",L);var T=this.data.view_max_seek_time||0;this.data.view_max_seek_time=Math.max(T,L)}),this.on("viewend",function(){this.isSeeking=!1})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var M=a(2),y=n(M),I=a(3),x=n(I),A=a(1),D=n(A)},function(t,e,a){"use strict";function n(T){return T&&T.__esModule?T:{default:T}}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function T(S,c){var i=[],f=!0,m=!1,d=void 0;try{for(var l,s=S[Symbol.iterator]();!(f=(l=s.next()).done)&&(i.push(l.value),!c||i.length!==c);f=!0);}catch(v){m=!0,d=v}finally{try{!f&&s.return&&s.return()}finally{if(m)throw d}}return i}return function(S,c){if(Array.isArray(S))return S;if(Symbol.iterator in Object(S))return T(S,c);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),M=a(3),y=n(M),I=a(5),x=a(1),A=n(x),D=function(T,S){T.push(S),T.sort(function(c,i){return c.viewer_time-i.viewer_time})},R=["adbreakstart","adrequest","adresponse","adplay","adplaying","adpause","adended","adbreakend","aderror"],L=function(){var T=this;this.on("viewinit",function(){this.isAdBreak=!1,this._currentAdRequestNumber=0,this._currentAdResponseNumber=0,this._adRequests=[],this._adResponses=[],this._adHasPlayed=!1,this._wouldBeNewAdPlay=!0,this._prerollPlayTime=void 0}),R.forEach(function(c){return T.on(c,T._updateAdData)});var S=function(){T.isAdBreak=!1};this.on("adbreakstart",function(){this.isAdBreak=!0}),this.on("play",S),this.on("playing",S),this.on("viewend",S),this.on("adrequest",function(c,i){i=(0,A.default)({ad_request_id:"generatedAdRequestId"+this._currentAdRequestNumber++},i),D(this._adRequests,i),(0,y.default)(this.data,"view_ad_request_count"),this.inPrerollPosition()&&(this.data.view_preroll_requested=!0,this._adHasPlayed||(0,y.default)(this.data,"view_preroll_request_count"))}),this.on("adresponse",function(c,i){i=(0,A.default)({ad_request_id:"generatedAdRequestId"+this._currentAdResponseNumber++},i),D(this._adResponses,i);var f=this.findAdRequest(i.ad_request_id);f&&(0,y.default)(this.data,"view_ad_request_time",Math.max(0,i.viewer_time-f.viewer_time))}),this.on("adplay",function(c,i){this._adHasPlayed=!0,this._wouldBeNewAdPlay&&(this._wouldBeNewAdPlay=!1,(0,y.default)(this.data,"view_ad_played_count")),this.inPrerollPosition()&&!this.data.view_preroll_played&&(this.data.view_preroll_played=!0,this._adRequests.length>0&&(this.data.view_preroll_request_time=Math.max(0,i.viewer_time-this._adRequests[0].viewer_time)),this.data.view_start&&(this.data.view_startup_preroll_request_time=Math.max(0,i.viewer_time-this.data.view_start)),this._prerollPlayTime=i.viewer_time)}),this.on("adplaying",function(c,i){this.inPrerollPosition()&&this.data.view_preroll_load_time===void 0&&this._prerollPlayTime!==void 0&&(this.data.view_preroll_load_time=i.viewer_time-this._prerollPlayTime,this.data.view_startup_preroll_load_time=i.viewer_time-this._prerollPlayTime)}),this.on("adended",function(){this._wouldBeNewAdPlay=!0}),this.on("aderror",function(){this._wouldBeNewAdPlay=!0})};L.prototype.inPrerollPosition=function(){return this.data.view_content_playback_time===void 0||this.data.view_content_playback_time<=1e3},L.prototype.findAdRequest=function(T){for(var S=0;S<this._adRequests.length;S++)if(this._adRequests[S].ad_request_id===T)return this._adRequests[S]},L.prototype._updateAdData=function(T,S){if(this.inPrerollPosition()){if(!this.data.view_preroll_ad_tag_hostname&&S.ad_tag_url){var c=(0,I.extractHostnameAndDomain)(S.ad_tag_url),i=u(c,2),f=i[0],m=i[1];this.data.view_preroll_ad_tag_domain=m,this.data.view_preroll_ad_tag_hostname=f}if(!this.data.view_preroll_ad_asset_hostname&&S.ad_asset_url){var d=(0,I.extractHostnameAndDomain)(S.ad_asset_url),l=u(d,2),s=l[0],v=l[1];this.data.view_preroll_ad_asset_domain=v,this.data.view_preroll_ad_asset_hostname=s}}},e.default=L},function(t,e,a){"use strict";function n(A){return A&&A.__esModule?A:{default:A}}function u(){var A=this,D=void 0,R=void 0,L=function(){A.disableRebufferTracking||((0,x.default)(A.data,"view_waiting_rebuffer_count",1),D=y.default.now(),R=window.setInterval(function(){if(D){var f=y.default.now();(0,x.default)(A.data,"view_waiting_rebuffer_duration",f-D),D=f}},250))},T=function(){A.disableRebufferTracking||D&&((0,x.default)(A.data,"view_waiting_rebuffer_duration",y.default.now()-D),D=!1,window.clearInterval(R))},S=!1,c=function(){S=!0},i=function(){S=!1,T()};this.on("waiting",function(){S&&L()}),this.on("playing",function(){T(),c()}),this.on("pause",i),this.on("seeking",i)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var M=a(2),y=n(M),I=a(3),x=n(I)},function(t,e,a){"use strict";function n(R){return R&&R.__esModule?R:{default:R}}function u(){var R=this;this.one("playbackheartbeat",A),this.on("playbackheartbeatend",function(){R.off("before*",D),R.one("playbackheartbeat",A)})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var M=a(1),y=n(M),I=a(2),x=n(I),A=function(){this.lastWallClockTime=x.default.now(),this.on("before*",D)},D=function(R){var L=x.default.now(),T=this.lastWallClockTime;this.lastWallClockTime=L,L-T>3e4&&(this.emit("devicesleep",{viewer_time:T}),(0,y.default)(this.data,{viewer_time:T}),this.send("devicesleep"),this.emit("devicewake",{viewer_time:L}),(0,y.default)(this.data,{viewer_time:L}),this.send("devicewake"))}},function(t,e,a){"use strict";function n(h){return h&&h.__esModule?h:{default:h}}Object.defineProperty(e,"__esModule",{value:!0});var u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},M=a(0),y=n(M),I=a(40),x=a(4),A=n(x),D=a(53),R=n(D),L=a(12),T=n(L),S=a(54),c=n(S),i=a(17),f=n(i),m=a(55),d=n(m),l=a(1),s=n(l),v=["env_key","view_id","view_sequence_number","player_sequence_number","beacon_domain","player_playhead_time","viewer_time","mux_api_version","event","video_id","player_instance_id"],p=["viewstart","error","ended","viewend"],o=function(h,b){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.mux=h,this.envKey=b,this.eventQueue=new d.default((0,R.default)(b,_)),this.previousBeaconData=null,this.lastEventTime=null,this.sampleRate=_.sampleRate,this.disableCookies=_.disableCookies,this.respectDoNotTrack=_.respectDoNotTrack;var O=_.platform||{};this.pageLevelData={mux_api_version:this.mux.API_VERSION,mux_embed:this.mux.NAME,mux_embed_version:this.mux.VERSION,viewer_application_name:O.name,viewer_application_version:O.version,viewer_application_engine:O.layout,viewer_device_name:O.product,viewer_device_category:"",viewer_device_manufacturer:O.manufacturer,viewer_os_family:O.os&&O.os.family,viewer_os_architecture:O.os&&O.os.architecture,viewer_os_version:O.os&&O.os.version};var C=(0,c.default)();C&&(this.pageLevelData=(0,s.default)(this.pageLevelData,{viewer_connection_type:C})),y.default!==void 0&&y.default.location&&y.default.location.href&&(this.pageLevelData.page_url=y.default.location.href),this.viewerData=this.disableCookies?{}:(0,I.getAndUpdateViewerData)()};o.prototype.send=function(h,b){if(h){if(this.respectDoNotTrack&&(0,T.default)())return A.default.info("Not sending `"+h+"` because Do Not Track is enabled");if(!b||(b===void 0?"undefined":u(b))!=="object")return A.default.error("A data object was expected in send() but was not provided");var _=this.disableCookies?{}:(0,I.getAndUpdateSessionData)(),O={};(0,s.default)(O,this.pageLevelData),(0,s.default)(O,b),(0,s.default)(O,_),(0,s.default)(O,this.viewerData),O.event=h,O.env_key=this.envKey,O.user_id&&(O.viewer_user_id=O.user_id,delete O.user_id);var C=O.mux_sample_number>=this.sampleRate,P=this._deduplicateBeaconData(h,O),w=(0,f.default)(P);if(this.lastEventTime=this.mux.utils.now(),C)return A.default.info("Not sending event due to sample rate restriction",h,O,w);if(this.envKey||A.default.info("Missing environment key (envKey) - beacons will be dropped if the video source is not a valid mux video URL",h,O,w),!this.rateLimited){if(A.default.info("Sending event",h,O,w),this.rateLimited=!this.eventQueue.queueEvent(h,w),this.mux.WINDOW_UNLOADING&&h==="viewend")this.eventQueue.destroy(!0);else if((p.indexOf(h)>=0||this.mux.WINDOW_VISIBLE===!1&&h==="hb")&&this.eventQueue.flushEvents(),this.rateLimited)return O.event="eventrateexceeded",w=(0,f.default)(O),this.eventQueue.queueEvent(O.event,w),A.default.error("Beaconing disabled due to rate limit.")}}},o.prototype.destroy=function(){this.eventQueue.destroy(!1)};var E=function(h,b,_,O){return!(!h||b.indexOf("request_")!==0)&&(b==="request_response_headers"||(_===void 0?"undefined":u(_))!=="object"||(O===void 0?"undefined":u(O))!=="object"||Object.keys(_||{}).length!==Object.keys(O||{}).length)},g=function(h,b){return h==="renditionchange"&&b.indexOf("video_source_")===0};o.prototype._deduplicateBeaconData=function(h,b){var _=this,O={},C=b.view_id;if(!C||h==="viewstart"||h==="viewend"||!this.previousBeaconData||this.mux.utils.now()-this.lastEventTime>=6e5)O=(0,s.default)({},b),C&&(this.previousBeaconData=O),C&&h==="viewend"&&(this.previousBeaconData=null);else{var P=h.indexOf("request")===0;Object.keys(b).forEach(function(w){var U=b[w];(U!==_.previousBeaconData[w]||v.indexOf(w)>-1||E(P,w,U,_.previousBeaconData[w])||g(h,w))&&(O[w]=U,_.previousBeaconData[w]=U)})}return O},e.default=o},function(t,e,a){"use strict";function n(c){return c&&c.__esModule?c:{default:c}}Object.defineProperty(e,"__esModule",{value:!0}),e.getAndUpdateSessionData=e.getAndUpdateViewerData=void 0;var u=a(15),M=n(u),y=a(52),I=n(y),x=a(6),A=a(2),D=n(A),R=function(){var c=void 0;try{c=M.default.parse(I.default.get("muxData")||"")}catch{c={}}return c},L=function(c){try{I.default.set("muxData",M.default.stringify(c),{expires:7300})}catch{}},T=function(){var c=R();return c.mux_viewer_id=c.mux_viewer_id||(0,x.generateUUID)(),c.msn=c.msn||Math.random(),L(c),{mux_viewer_id:c.mux_viewer_id,mux_sample_number:c.msn}},S=function(){var c=R(),i=D.default.now();return c.session_start&&(c.sst=c.session_start,delete c.session_start),c.session_id&&(c.sid=c.session_id,delete c.session_id),c.session_expires&&(c.sex=c.session_expires,delete c.session_expires),(!c.sex||c.sex<i)&&(c.sid=(0,x.generateUUID)(),c.sst=i),c.sex=i+15e5,L(c),{session_id:c.sid,session_start:c.sst,session_expires:c.sex}};e.getAndUpdateViewerData=T,e.getAndUpdateSessionData=S},function(t,e,a){"use strict";var n=a(42),u=a(16),M=a(10),y=Object.prototype.hasOwnProperty,I={brackets:function(d){return d+"[]"},comma:"comma",indices:function(d,l){return d+"["+l+"]"},repeat:function(d){return d}},x=Array.isArray,A=String.prototype.split,D=Array.prototype.push,R=function(d,l){D.apply(d,x(l)?l:[l])},L=Date.prototype.toISOString,T=M.default,S={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:u.encode,encodeValuesOnly:!1,format:T,formatter:M.formatters[T],indices:!1,serializeDate:function(d){return L.call(d)},skipNulls:!1,strictNullHandling:!1},c=function(d){return typeof d=="string"||typeof d=="number"||typeof d=="boolean"||typeof d=="symbol"||typeof d=="bigint"},i={},f=function d(l,s,v,p,o,E,g,h,b,_,O,C,P,w,U){for(var k=l,N=U,F=0,H=!1;(N=N.get(i))!==void 0&&!H;){var W=N.get(l);if(F+=1,W!==void 0){if(W===F)throw new RangeError("Cyclic object value");H=!0}N.get(i)===void 0&&(F=0)}if(typeof g=="function"?k=g(s,k):k instanceof Date?k=_(k):v==="comma"&&x(k)&&(k=u.maybeMap(k,function(re){return re instanceof Date?_(re):re})),k===null){if(p)return E&&!P?E(s,S.encoder,w,"key",O):s;k=""}if(c(k)||u.isBuffer(k)){if(E){var B=P?s:E(s,S.encoder,w,"key",O);if(v==="comma"&&P){for(var j=A.call(String(k),","),V="",Y=0;Y<j.length;++Y)V+=(Y===0?"":",")+C(E(j[Y],S.encoder,w,"value",O));return[C(B)+"="+V]}return[C(B)+"="+C(E(k,S.encoder,w,"value",O))]}return[C(s)+"="+C(String(k))]}var Q=[];if(k===void 0)return Q;var J;if(v==="comma"&&x(k))J=[{value:k.length>0?k.join(",")||null:void 0}];else if(x(g))J=g;else{var z=Object.keys(k);J=h?z.sort(h):z}for(var te=0;te<J.length;++te){var se=J[te],Z=typeof se=="object"&&se.value!==void 0?se.value:k[se];if(!o||Z!==null){var Ee=x(k)?typeof v=="function"?v(s,se):s:s+(b?"."+se:"["+se+"]");U.set(l,F);var fe=n();fe.set(i,U),R(Q,d(Z,Ee,v,p,o,E,g,h,b,_,O,C,P,w,fe))}}return Q},m=function(d){if(!d)return S;if(d.encoder!==null&&d.encoder!==void 0&&typeof d.encoder!="function")throw new TypeError("Encoder has to be a function.");var l=d.charset||S.charset;if(d.charset!==void 0&&d.charset!=="utf-8"&&d.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var s=M.default;if(d.format!==void 0){if(!y.call(M.formatters,d.format))throw new TypeError("Unknown format option provided.");s=d.format}var v=M.formatters[s],p=S.filter;return(typeof d.filter=="function"||x(d.filter))&&(p=d.filter),{addQueryPrefix:typeof d.addQueryPrefix=="boolean"?d.addQueryPrefix:S.addQueryPrefix,allowDots:d.allowDots===void 0?S.allowDots:!!d.allowDots,charset:l,charsetSentinel:typeof d.charsetSentinel=="boolean"?d.charsetSentinel:S.charsetSentinel,delimiter:d.delimiter===void 0?S.delimiter:d.delimiter,encode:typeof d.encode=="boolean"?d.encode:S.encode,encoder:typeof d.encoder=="function"?d.encoder:S.encoder,encodeValuesOnly:typeof d.encodeValuesOnly=="boolean"?d.encodeValuesOnly:S.encodeValuesOnly,filter:p,format:s,formatter:v,serializeDate:typeof d.serializeDate=="function"?d.serializeDate:S.serializeDate,skipNulls:typeof d.skipNulls=="boolean"?d.skipNulls:S.skipNulls,sort:typeof d.sort=="function"?d.sort:null,strictNullHandling:typeof d.strictNullHandling=="boolean"?d.strictNullHandling:S.strictNullHandling}};t.exports=function(d,l){var s,v,p=d,o=m(l);typeof o.filter=="function"?(v=o.filter,p=v("",p)):x(o.filter)&&(v=o.filter,s=v);var E=[];if(typeof p!="object"||p===null)return"";var g;g=l&&l.arrayFormat in I?l.arrayFormat:l&&"indices"in l?l.indices?"indices":"repeat":"indices";var h=I[g];s||(s=Object.keys(p)),o.sort&&s.sort(o.sort);for(var b=n(),_=0;_<s.length;++_){var O=s[_];o.skipNulls&&p[O]===null||R(E,f(p[O],O,h,o.strictNullHandling,o.skipNulls,o.encode?o.encoder:null,o.filter,o.sort,o.allowDots,o.serializeDate,o.format,o.formatter,o.encodeValuesOnly,o.charset,b))}var C=E.join(o.delimiter),P=o.addQueryPrefix===!0?"?":"";return o.charsetSentinel&&(o.charset==="iso-8859-1"?P+="utf8=%26%2310003%3B&":P+="utf8=%E2%9C%93&"),C.length>0?P+C:""}},function(t,e,a){"use strict";var n=a(8),u=a(47),M=a(49),y=n("%TypeError%"),I=n("%WeakMap%",!0),x=n("%Map%",!0),A=u("WeakMap.prototype.get",!0),D=u("WeakMap.prototype.set",!0),R=u("WeakMap.prototype.has",!0),L=u("Map.prototype.get",!0),T=u("Map.prototype.set",!0),S=u("Map.prototype.has",!0),c=function(d,l){for(var s,v=d;(s=v.next)!==null;v=s)if(s.key===l)return v.next=s.next,s.next=d.next,d.next=s,s},i=function(d,l){var s=c(d,l);return s&&s.value},f=function(d,l,s){var v=c(d,l);v?v.value=s:d.next={key:l,next:d.next,value:s}},m=function(d,l){return!!c(d,l)};t.exports=function(){var d,l,s,v={assert:function(p){if(!v.has(p))throw new y("Side channel does not contain "+M(p))},get:function(p){if(I&&p&&(typeof p=="object"||typeof p=="function")){if(d)return A(d,p)}else if(x){if(l)return L(l,p)}else if(s)return i(s,p)},has:function(p){if(I&&p&&(typeof p=="object"||typeof p=="function")){if(d)return R(d,p)}else if(x){if(l)return S(l,p)}else if(s)return m(s,p);return!1},set:function(p,o){I&&p&&(typeof p=="object"||typeof p=="function")?(d||(d=new I),D(d,p,o)):x?(l||(l=new x),T(l,p,o)):(s||(s={key:{},next:null}),f(s,p,o))}};return v}},function(t,e,a){"use strict";var n=typeof Symbol!="undefined"&&Symbol,u=a(44);t.exports=function(){return typeof n=="function"&&typeof Symbol=="function"&&typeof n("foo")=="symbol"&&typeof Symbol("bar")=="symbol"&&u()}},function(t,e,a){"use strict";t.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var n={},u=Symbol("test"),M=Object(u);if(typeof u=="string"||Object.prototype.toString.call(u)!=="[object Symbol]"||Object.prototype.toString.call(M)!=="[object Symbol]")return!1;n[u]=42;for(u in n)return!1;if(typeof Object.keys=="function"&&Object.keys(n).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(n).length!==0)return!1;var y=Object.getOwnPropertySymbols(n);if(y.length!==1||y[0]!==u||!Object.prototype.propertyIsEnumerable.call(n,u))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var I=Object.getOwnPropertyDescriptor(n,u);if(I.value!==42||I.enumerable!==!0)return!1}return!0}},function(t,e,a){"use strict";var n=Array.prototype.slice,u=Object.prototype.toString;t.exports=function(M){var y=this;if(typeof y!="function"||u.call(y)!=="[object Function]")throw new TypeError("Function.prototype.bind called on incompatible "+y);for(var I,x=n.call(arguments,1),A=function(){if(this instanceof I){var S=y.apply(this,x.concat(n.call(arguments)));return Object(S)===S?S:this}return y.apply(M,x.concat(n.call(arguments)))},D=Math.max(0,y.length-x.length),R=[],L=0;L<D;L++)R.push("$"+L);if(I=Function("binder","return function ("+R.join(",")+"){ return binder.apply(this,arguments); }")(A),y.prototype){var T=function(){};T.prototype=y.prototype,I.prototype=new T,T.prototype=null}return I}},function(t,e,a){"use strict";var n=a(9);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},function(t,e,a){"use strict";var n=a(8),u=a(48),M=u(n("String.prototype.indexOf"));t.exports=function(y,I){var x=n(y,!!I);return typeof x=="function"&&M(y,".prototype.")>-1?u(x):x}},function(t,e,a){"use strict";var n=a(9),u=a(8),M=u("%Function.prototype.apply%"),y=u("%Function.prototype.call%"),I=u("%Reflect.apply%",!0)||n.call(y,M),x=u("%Object.getOwnPropertyDescriptor%",!0),A=u("%Object.defineProperty%",!0),D=u("%Math.max%");if(A)try{A({},"a",{value:1})}catch{A=null}t.exports=function(L){var T=I(n,y,arguments);return x&&A&&x(T,"length").configurable&&A(T,"length",{value:1+D(0,L.length-(arguments.length-1))}),T};var R=function(){return I(n,M,arguments)};A?A(t.exports,"apply",{value:R}):t.exports.apply=R},function(t,e,a){function n(G,$){if(G===1/0||G===-1/0||G!==G||G&&G>-1e3&&G<1e3||Te.call(/e/,$))return $;var ye=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof G=="number"){var _e=G<0?-Ce(-G):Ce(G);if(_e!==G){var xe=String(_e),Ke=re.call($,xe.length+1);return q.call(xe,ye,"$&_")+"."+q.call(q.call(Ke,/([0-9]{3})/g,"$&_"),/_$/,"")}}return q.call($,ye,"$&_")}function u(G,$,ye){var _e=(ye.quoteStyle||$)==="double"?'"':"'";return _e+G+_e}function M(G){return q.call(String(G),/"/g,""")}function y(G){return!(i(G)!=="[object Array]"||Ie&&typeof G=="object"&&Ie in G)}function I(G){return!(i(G)!=="[object Date]"||Ie&&typeof G=="object"&&Ie in G)}function x(G){return!(i(G)!=="[object RegExp]"||Ie&&typeof G=="object"&&Ie in G)}function A(G){return!(i(G)!=="[object Error]"||Ie&&typeof G=="object"&&Ie in G)}function D(G){return!(i(G)!=="[object String]"||Ie&&typeof G=="object"&&Ie in G)}function R(G){return!(i(G)!=="[object Number]"||Ie&&typeof G=="object"&&Ie in G)}function L(G){return!(i(G)!=="[object Boolean]"||Ie&&typeof G=="object"&&Ie in G)}function T(G){if(Re)return G&&typeof G=="object"&&G instanceof Symbol;if(typeof G=="symbol")return!0;if(!G||typeof G!="object"||!Ae)return!1;try{return Ae.call(G),!0}catch{}return!1}function S(G){if(!G||typeof G!="object"||!Ue)return!1;try{return Ue.call(G),!0}catch{}return!1}function c(G,$){return ke.call(G,$)}function i(G){return Z.call(G)}function f(G){if(G.name)return G.name;var $=fe.call(Ee.call(G),/^function\s*([\w$]+)/);return $?$[1]:null}function m(G,$){if(G.indexOf)return G.indexOf($);for(var ye=0,_e=G.length;ye<_e;ye++)if(G[ye]===$)return ye;return-1}function d(G){if(!N||!G||typeof G!="object")return!1;try{N.call(G);try{B.call(G)}catch{return!0}return G instanceof Map}catch{}return!1}function l(G){if(!Y||!G||typeof G!="object")return!1;try{Y.call(G,Y);try{J.call(G,J)}catch{return!0}return G instanceof WeakMap}catch{}return!1}function s(G){if(!te||!G||typeof G!="object")return!1;try{return te.call(G),!0}catch{}return!1}function v(G){if(!B||!G||typeof G!="object")return!1;try{B.call(G);try{N.call(G)}catch{return!0}return G instanceof Set}catch{}return!1}function p(G){if(!J||!G||typeof G!="object")return!1;try{J.call(G,J);try{Y.call(G,Y)}catch{return!0}return G instanceof WeakSet}catch{}return!1}function o(G){return!(!G||typeof G!="object")&&(typeof HTMLElement!="undefined"&&G instanceof HTMLElement||typeof G.nodeName=="string"&&typeof G.getAttribute=="function")}function E(G,$){if(G.length>$.maxStringLength){var ye=G.length-$.maxStringLength,_e="... "+ye+" more character"+(ye>1?"s":"");return E(re.call(G,0,$.maxStringLength),$)+_e}return u(q.call(q.call(G,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,g),"single",$)}function g(G){var $=G.charCodeAt(0),ye={8:"b",9:"t",10:"n",12:"f",13:"r"}[$];return ye?"\\"+ye:"\\x"+($<16?"0":"")+ie.call($.toString(16))}function h(G){return"Object("+G+")"}function b(G){return G+" { ? }"}function _(G,$,ye,_e){return G+" ("+$+") {"+(_e?P(ye,_e):he.call(ye,", "))+"}"}function O(G){for(var $=0;$<G.length;$++)if(m(G[$],`
|
|
2
2
|
`)>=0)return!1;return!0}function C(G,$){var ye;if(G.indent===" ")ye=" ";else{if(!(typeof G.indent=="number"&&G.indent>0))return null;ye=he.call(Array(G.indent+1)," ")}return{base:ye,prev:he.call(Array($+1),ye)}}function P(G,$){if(G.length===0)return"";var ye=`
|
|
3
3
|
`+$.prev+$.base;return ye+he.call(G,","+ye)+`
|
|
4
|
-
`+$.prev}function w(G,$){var ye=y(G),_e=[];if(ye){_e.length=G.length;for(var xe=0;xe<G.length;xe++)_e[xe]=c(G,xe)?$(G[xe],G):""}var Ke,ve=typeof me=="function"?me(G):[];if(Re){Ke={};for(var Ve=0;Ve<ve.length;Ve++)Ke["$"+ve[Ve]]=ve[Ve]}for(var We in G)c(G,We)&&(ye&&String(Number(We))===We&&We<G.length||Re&&Ke["$"+We]instanceof Symbol||(Te.call(/[^\w$]/,We)?_e.push($(We,G)+": "+$(G[We],G)):_e.push(We+": "+$(G[We],G))));if(typeof me=="function")for(var ze=0;ze<ve.length;ze++)Ne.call(G,ve[ze])&&_e.push("["+$(ve[ze])+"]: "+$(G[ve[ze]],G));return _e}var U=typeof Map=="function"&&Map.prototype,k=Object.getOwnPropertyDescriptor&&U?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,N=U&&k&&typeof k.get=="function"?k.get:null,F=U&&Map.prototype.forEach,H=typeof Set=="function"&&Set.prototype,W=Object.getOwnPropertyDescriptor&&H?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,B=H&&W&&typeof W.get=="function"?W.get:null,j=H&&Set.prototype.forEach,V=typeof WeakMap=="function"&&WeakMap.prototype,Y=V?WeakMap.prototype.has:null,Q=typeof WeakSet=="function"&&WeakSet.prototype,J=Q?WeakSet.prototype.has:null,z=typeof WeakRef=="function"&&WeakRef.prototype,te=z?WeakRef.prototype.deref:null,se=Boolean.prototype.valueOf,Z=Object.prototype.toString,Ee=Function.prototype.toString,fe=String.prototype.match,re=String.prototype.slice,q=String.prototype.replace,ie=String.prototype.toUpperCase,ne=String.prototype.toLowerCase,Te=RegExp.prototype.test,Se=Array.prototype.concat,he=Array.prototype.join,Oe=Array.prototype.slice,Ce=Math.floor,Ue=typeof BigInt=="function"?BigInt.prototype.valueOf:null,me=Object.getOwnPropertySymbols,Ae=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Re=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Ie=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Re?"object":"symbol")?Symbol.toStringTag:null,Ne=Object.prototype.propertyIsEnumerable,je=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(G){return G.__proto__}:null),Qe=a(50).custom,Fe=Qe&&T(Qe)?Qe:null;t.exports=function G($,ye,_e,xe){function Ke(tr,hi,Xl){if(hi&&(xe=Oe.call(xe),xe.push(hi)),Xl){var Ga={depth:ve.depth};return c(ve,"quoteStyle")&&(Ga.quoteStyle=ve.quoteStyle),G(tr,Ga,_e+1,xe)}return G(tr,ve,_e+1,xe)}var ve=ye||{};if(c(ve,"quoteStyle")&&ve.quoteStyle!=="single"&&ve.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(c(ve,"maxStringLength")&&(typeof ve.maxStringLength=="number"?ve.maxStringLength<0&&ve.maxStringLength!==1/0:ve.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Ve=!c(ve,"customInspect")||ve.customInspect;if(typeof Ve!="boolean"&&Ve!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(c(ve,"indent")&&ve.indent!==null&&ve.indent!==" "&&!(parseInt(ve.indent,10)===ve.indent&&ve.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(c(ve,"numericSeparator")&&typeof ve.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var We=ve.numericSeparator;if($===void 0)return"undefined";if($===null)return"null";if(typeof $=="boolean")return $?"true":"false";if(typeof $=="string")return E($,ve);if(typeof $=="number"){if($===0)return 1/0/$>0?"0":"-0";var ze=String($);return We?n($,ze):ze}if(typeof $=="bigint"){var kt=String($)+"n";return We?n($,kt):kt}var yt=ve.depth===void 0?5:ve.depth;if(_e===void 0&&(_e=0),_e>=yt&&yt>0&&typeof $=="object")return y($)?"[Array]":"[Object]";var Dt=C(ve,_e);if(xe===void 0)xe=[];else if(m(xe,$)>=0)return"[Circular]";if(typeof $=="function"){var Lr=f($),Jt=w($,Ke);return"[Function"+(Lr?": "+Lr:" (anonymous)")+"]"+(Jt.length>0?" { "+he.call(Jt,", ")+" }":"")}if(T($)){var rt=Re?q.call(String($),/^(Symbol\(.*\))_[^)]*$/,"$1"):Ae.call($);return typeof $!="object"||Re?rt:h(rt)}if(o($)){for(var wt="<"+ne.call(String($.nodeName)),qt=$.attributes||[],er=0;er<qt.length;er++)wt+=" "+qt[er].name+"="+u(M(qt[er].value),"double",ve);return wt+=">",$.childNodes&&$.childNodes.length&&(wt+="..."),wt+="</"+ne.call(String($.nodeName))+">"}if(y($)){if($.length===0)return"[]";var Dr=w($,Ke);return Dt&&!O(Dr)?"["+P(Dr,Dt)+"]":"[ "+he.call(Dr,", ")+" ]"}if(A($)){var Ir=w($,Ke);return"cause"in $&&!Ne.call($,"cause")?"{ ["+String($)+"] "+he.call(Se.call("[cause]: "+Ke($.cause),Ir),", ")+" }":Ir.length===0?"["+String($)+"]":"{ ["+String($)+"] "+he.call(Ir,", ")+" }"}if(typeof $=="object"&&Ve){if(Fe&&typeof $[Fe]=="function")return $[Fe]();if(Ve!=="symbol"&&typeof $.inspect=="function")return $.inspect()}if(d($)){var di=[];return F.call($,function(tr,hi){di.push(Ke(hi,$,!0)+" => "+Ke(tr,$))}),_("Map",N.call($),di,Dt)}if(v($)){var ci=[];return j.call($,function(tr){ci.push(Ke(tr,$))}),_("Set",B.call($),ci,Dt)}if(l($))return b("WeakMap");if(p($))return b("WeakSet");if(s($))return b("WeakRef");if(R($))return h(Ke(Number($)));if(S($))return h(Ke(Ue.call($)));if(L($))return h(se.call($));if(D($))return h(Ke(String($)));if(!I($)&&!x($)){var Ut=w($,Ke),Mr=je?je($)===Object.prototype:$ instanceof Object||$.constructor===Object,Rr=$ instanceof Object?"":"null prototype",fi=!Mr&&Ie&&Object($)===$&&Ie in $?re.call(i($),8,-1):Rr?"Object":"",zl=Mr||typeof $.constructor!="function"?"":$.constructor.name?$.constructor.name+" ":"",gn=zl+(fi||Rr?"["+he.call(Se.call([],fi||[],Rr||[]),": ")+"] ":"");return Ut.length===0?gn+"{}":Dt?gn+"{"+P(Ut,Dt)+"}":gn+"{ "+he.call(Ut,", ")+" }"}return String($)};var ke=Object.prototype.hasOwnProperty||function(G){return G in this}},function(t,e){},function(t,e,a){"use strict";var n=a(16),u=Object.prototype.hasOwnProperty,M=Array.isArray,y={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},I=function(T){return T.replace(/&#(\d+);/g,function(S,c){return String.fromCharCode(parseInt(c,10))})},x=function(T,S){return T&&typeof T=="string"&&S.comma&&T.indexOf(",")>-1?T.split(","):T},A=function(T,S){var c,i={},f=S.ignoreQueryPrefix?T.replace(/^\?/,""):T,m=S.parameterLimit===1/0?void 0:S.parameterLimit,d=f.split(S.delimiter,m),l=-1,s=S.charset;if(S.charsetSentinel)for(c=0;c<d.length;++c)d[c].indexOf("utf8=")===0&&(d[c]==="utf8=%E2%9C%93"?s="utf-8":d[c]==="utf8=%26%2310003%3B"&&(s="iso-8859-1"),l=c,c=d.length);for(c=0;c<d.length;++c)if(c!==l){var v,p,o=d[c],E=o.indexOf("]="),g=E===-1?o.indexOf("="):E+1;g===-1?(v=S.decoder(o,y.decoder,s,"key"),p=S.strictNullHandling?null:""):(v=S.decoder(o.slice(0,g),y.decoder,s,"key"),p=n.maybeMap(x(o.slice(g+1),S),function(h){return S.decoder(h,y.decoder,s,"value")})),p&&S.interpretNumericEntities&&s==="iso-8859-1"&&(p=I(p)),o.indexOf("[]=")>-1&&(p=M(p)?[p]:p),u.call(i,v)?i[v]=n.combine(i[v],p):i[v]=p}return i},D=function(T,S,c,i){for(var f=i?S:x(S,c),m=T.length-1;m>=0;--m){var d,l=T[m];if(l==="[]"&&c.parseArrays)d=[].concat(f);else{d=c.plainObjects?Object.create(null):{};var s=l.charAt(0)==="["&&l.charAt(l.length-1)==="]"?l.slice(1,-1):l,v=parseInt(s,10);c.parseArrays||s!==""?!isNaN(v)&&l!==s&&String(v)===s&&v>=0&&c.parseArrays&&v<=c.arrayLimit?(d=[],d[v]=f):s!=="__proto__"&&(d[s]=f):d={0:f}}f=d}return f},R=function(T,S,c,i){if(T){var f=c.allowDots?T.replace(/\.([^.[]+)/g,"[$1]"):T,m=/(\[[^[\]]*])/,d=/(\[[^[\]]*])/g,l=c.depth>0&&m.exec(f),s=l?f.slice(0,l.index):f,v=[];if(s){if(!c.plainObjects&&u.call(Object.prototype,s)&&!c.allowPrototypes)return;v.push(s)}for(var p=0;c.depth>0&&(l=d.exec(f))!==null&&p<c.depth;){if(p+=1,!c.plainObjects&&u.call(Object.prototype,l[1].slice(1,-1))&&!c.allowPrototypes)return;v.push(l[1])}return l&&v.push("["+f.slice(l.index)+"]"),D(v,S,c,i)}},L=function(T){if(!T)return y;if(T.decoder!==null&&T.decoder!==void 0&&typeof T.decoder!="function")throw new TypeError("Decoder has to be a function.");if(T.charset!==void 0&&T.charset!=="utf-8"&&T.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var S=T.charset===void 0?y.charset:T.charset;return{allowDots:T.allowDots===void 0?y.allowDots:!!T.allowDots,allowPrototypes:typeof T.allowPrototypes=="boolean"?T.allowPrototypes:y.allowPrototypes,allowSparse:typeof T.allowSparse=="boolean"?T.allowSparse:y.allowSparse,arrayLimit:typeof T.arrayLimit=="number"?T.arrayLimit:y.arrayLimit,charset:S,charsetSentinel:typeof T.charsetSentinel=="boolean"?T.charsetSentinel:y.charsetSentinel,comma:typeof T.comma=="boolean"?T.comma:y.comma,decoder:typeof T.decoder=="function"?T.decoder:y.decoder,delimiter:typeof T.delimiter=="string"||n.isRegExp(T.delimiter)?T.delimiter:y.delimiter,depth:typeof T.depth=="number"||T.depth===!1?+T.depth:y.depth,ignoreQueryPrefix:T.ignoreQueryPrefix===!0,interpretNumericEntities:typeof T.interpretNumericEntities=="boolean"?T.interpretNumericEntities:y.interpretNumericEntities,parameterLimit:typeof T.parameterLimit=="number"?T.parameterLimit:y.parameterLimit,parseArrays:T.parseArrays!==!1,plainObjects:typeof T.plainObjects=="boolean"?T.plainObjects:y.plainObjects,strictNullHandling:typeof T.strictNullHandling=="boolean"?T.strictNullHandling:y.strictNullHandling}};t.exports=function(T,S){var c=L(S);if(T===""||T===null||T===void 0)return c.plainObjects?Object.create(null):{};for(var i=typeof T=="string"?A(T,c):T,f=c.plainObjects?Object.create(null):{},m=Object.keys(i),d=0;d<m.length;++d){var l=m[d],s=R(l,i[l],c,typeof T=="string");f=n.merge(f,s,c)}return c.allowSparse===!0?f:n.compact(f)}},function(t,e,a){"use strict";var n,u,M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(y){return typeof y}:function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y};(function(y){var I=!1;if(n=y,(u=typeof n=="function"?n.call(e,a,e,t):n)!==void 0&&(t.exports=u),I=!0,M(e)==="object"&&(t.exports=y(),I=!0),!I){var x=window.Cookies,A=window.Cookies=y();A.noConflict=function(){return window.Cookies=x,A}}})(function(){function y(x){function A(D,R,L){var T;if(typeof document!="undefined"){if(arguments.length>1){if(L=I({path:"/"},A.defaults,L),typeof L.expires=="number"){var S=new Date;S.setMilliseconds(S.getMilliseconds()+864e5*L.expires),L.expires=S}try{T=JSON.stringify(R),/^[\{\[]/.test(T)&&(R=T)}catch{}return R=x.write?x.write(R,D):encodeURIComponent(String(R)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),D=encodeURIComponent(String(D)),D=D.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),D=D.replace(/[\(\)]/g,escape),document.cookie=[D,"=",R,L.expires?"; expires="+L.expires.toUTCString():"",L.path?"; path="+L.path:"",L.domain?"; domain="+L.domain:"",L.secure?"; secure":""].join("")}D||(T={});for(var c=document.cookie?document.cookie.split("; "):[],i=/(%[0-9A-Z]{2})+/g,f=0;f<c.length;f++){var m=c[f].split("="),d=m.slice(1).join("=");d.charAt(0)==='"'&&(d=d.slice(1,-1));try{var l=m[0].replace(i,decodeURIComponent);if(d=x.read?x.read(d,l):x(d,l)||d.replace(i,decodeURIComponent),this.json)try{d=JSON.parse(d)}catch{}if(D===l){T=d;break}D||(T[l]=d)}catch{}}return T}}return A.set=A,A.get=function(D){return A.call(A,D)},A.getJSON=function(){return A.apply({json:!0},[].slice.call(arguments))},A.defaults={},A.remove=function(D,R){A(D,"",I(R,{expires:-1}))},A.withConverter=y,A}var I=function(){for(var x=0,A={};x<arguments.length;x++){var D=arguments[x];for(var R in D)A[R]=D[R]}return A};return y(function(){})})},function(t,e,a){"use strict";function n(u,M){var y=M.beaconCollectionDomain,I=M.beaconDomain;if(y)return"https://"+y;u=u||"inferred";var x=I||"litix.io";return u.match(/^[a-z0-9]+$/)?"https://"+u+"."+x:"https://img.litix.io/a.gif"}Object.defineProperty(e,"__esModule",{value:!0}),e.default=n},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a(0),u=function(I){return I&&I.__esModule?I:{default:I}}(n),M=function(){var I=void 0;switch(y()){case"cellular":I="cellular";break;case"ethernet":I="wired";break;case"wifi":I="wifi";break;case void 0:break;default:I="other"}return I},y=function(){var I=u.default.navigator,x=I&&(I.connection||I.mozConnection||I.webkitConnection);return x&&x.type};e.default=M},function(t,e,a){"use strict";function n(d){return d&&d.__esModule?d:{default:d}}Object.defineProperty(e,"__esModule",{value:!0});var u=a(0),M=n(u),y=a(4),I=n(y),x=a(56),A=n(x),D=a(1),R=n(D),L=a(17),T=n(L),S=a(2),c=n(S),i=!!M.default.XMLHttpRequest&&"withCredentials"in new M.default.XMLHttpRequest,f={maxBeaconSize:300,maxQueueLength:3600,baseTimeBetweenBeacons:1e4},m=function(d,l){this._beaconUrl=d||"https://img.litix.io",this._eventQueue=[],this._postInFlight=!1,this._failureCount=0,this._sendTimeout=!1,this._options=(0,R.default)({},f,l)};m.prototype.queueEvent=function(d,l){var s=(0,R.default)({},l);return i?(this._eventQueue.length<=this._options.maxQueueLength||d==="eventrateexceeded")&&(this._eventQueue.push(s),this._sendTimeout||this._startBeaconSending(),this._eventQueue.length<=this._options.maxQueueLength):(A.default.send(this._beaconUrl,s),!0)},m.prototype.flushEvents=function(){i&&(this._eventQueue.length&&this._sendBeaconQueue(),this._startBeaconSending())},m.prototype.destroy=function(){var d=arguments.length>0&&arguments[0]!==void 0&&arguments[0];this.destroyed=!0,d?this._clearBeaconQueue():this.flushEvents(),M.default.clearTimeout(this._sendTimeout)},m.prototype._clearBeaconQueue=function(){var d=M.default.navigator,l=this._eventQueue.length>this._options.maxBeaconSize?this._eventQueue.length-this._options.maxBeaconSize:0,s=this._eventQueue.slice(l);l>0&&(0,R.default)(s[s.length-1],(0,T.default)({mux_view_message:"event queue truncated"}));var v=this._createPayload(s);if(d.sendBeacon)d.sendBeacon(this._beaconUrl,v);else if(M.default.XMLHttpRequest){var p=new M.default.XMLHttpRequest;p.open("POST",this._beaconUrl),p.setRequestHeader("Content-Type","application/json"),p.send(v)}else A.default.send(this._beaconUrl,s[s.length-1])},m.prototype._sendBeaconQueue=function(){var d=this;if(M.default.XMLHttpRequest&&!this._postInFlight){var l=new M.default.XMLHttpRequest,s=this._eventQueue.slice(0,this._options.maxBeaconSize);this._eventQueue=this._eventQueue.slice(this._options.maxBeaconSize),this._postInFlight=!0,l.onreadystatechange=function(){l.readyState===4&&(l.status!==200?(d._eventQueue=s.concat(d._eventQueue),d._failureCount+=1,I.default.info("Error sending beacon: "+l.status),I.default.info(l.responseText)):d._failureCount=0,d._roundTripTime=c.default.now()-p,d._postInFlight=!1)},l.open("POST",this._beaconUrl),l.setRequestHeader("Content-Type","application/json");var v=this._createPayload(s),p=c.default.now();l.send(v)}},m.prototype._getNextBeaconTime=function(){if(!this._failureCount)return this._options.baseTimeBetweenBeacons;var d=Math.pow(2,this._failureCount-1);return(1+(d*=Math.random()))*this._options.baseTimeBetweenBeacons},m.prototype._startBeaconSending=function(){var d=this;M.default.clearTimeout(this._sendTimeout),this.destroyed||(this._sendTimeout=M.default.setTimeout(function(){d._eventQueue.length&&d._sendBeaconQueue(),d._startBeaconSending()},this._getNextBeaconTime()))},m.prototype._createPayload=function(d){var l={transmission_timestamp:Math.round(c.default.now())};return this._roundTripTime&&(l.rtt_ms=Math.round(this._roundTripTime)),JSON.stringify({metadata:l,events:d})},e.default=m},function(t,e,a){"use strict";function n(A){return A&&A.__esModule?A:{default:A}}Object.defineProperty(e,"__esModule",{value:!0});var u=a(15),M=n(u),y=a(0),I=n(y),x={};x.send=function(A,D){function R(){L.src=S+(T?"&rc="+T:"")}var L=new Image,T=0,S=A+"?"+M.default.stringify(D);return L.addEventListener("error",function(){T>3||I.default.setTimeout(function(){T++,R()},5e3*T)}),R(),L},e.default=x},function(t,e,a){"use strict";function n(){function u(S,c){var i=c.request_start,f=c.request_response_start,m=c.request_response_end,d=c.request_bytes_loaded;D++;var l=void 0,s=void 0;if(f?(l=f-i,s=m-f):s=m-i,s>0&&d>0){var v=d/s*8e3;R++,x+=d,A+=s,this.data.view_min_request_throughput=Math.min(this.data.view_min_request_throughput||1/0,v),this.data.view_average_request_throughput=x/A*8e3,this.data.view_request_count=D,l>0&&(I+=l,this.data.view_max_request_latency=Math.max(this.data.view_max_request_latency||0,l),this.data.view_average_request_latency=I/R)}}function M(S,c){D++,L++,this.data.view_request_count=D,this.data.view_request_failed_count=L}function y(S,c){D++,T++,this.data.view_request_count=D,this.data.view_request_canceled_count=T}var I=0,x=0,A=0,D=0,R=0,L=0,T=0;this.on("requestcompleted",u),this.on("requestfailed",M),this.on("requestcanceled",y)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=n},function(t,e,a){"use strict";function n(R,L,T){var S=(0,x.findMediaElement)(L),c=M(S,3),i=c[0],f=c[1],m=c[2],d=R.log,l=R.utils.getComputedStyle,s=R.utils.secondsToMs,v={automaticErrorTracking:!0};if(!i)return d.error("No element was found with the `"+f+"` query selector.");if(m!=="video"&&m!=="audio")return d.error("The element of `"+f+"` was not a media element.");T=(0,I.default)(v,T),T.data=(0,I.default)({player_software:"HTML5 Video Element",player_mux_plugin_name:"VideoElementMonitor",player_mux_plugin_version:"4.8.0"},T.data),T.getPlayheadTime=function(){return s(i.currentTime)},T.getStateData=function(){var o=this.hlsjs&&this.hlsjs.url,E=this.dashjs&&u(this.dashjs.getSource==="function")&&this.dashjs.getSource();return{player_is_paused:i.paused,player_playhead_time:s(i.currentTime),player_width:parseInt(l(i,"width")),player_height:parseInt(l(i,"height")),player_autoplay_on:i.autoplay,player_preload_on:i.preload,video_poster_url:i.poster,video_source_url:o||E||i.currentSrc,video_source_duration:s(i.duration),video_source_height:i.videoHeight,video_source_width:i.videoWidth}},i.mux=i.mux||{},i.mux.deleted=!1,i.mux.emit=function(o,E){R.emit(f,o,E)};var p=function(){d.error("The monitor for this video element has already been destroyed.")};i.mux.destroy=function(){Object.keys(i.mux.listeners).forEach(function(o){i.removeEventListener(o,i.mux.listeners[o],!1)}),delete i.mux.listeners,i.mux.destroy=p,i.mux.swapElement=p,i.mux.emit=p,i.mux.addHLSJS=p,i.mux.addDashJS=p,i.mux.removeHLSJS=p,i.mux.removeDashJS=p,i.mux.deleted=!0,R.emit(f,"destroy")},i.mux.swapElement=function(o){var E=(0,x.findMediaElement)(o),g=M(E,3),h=g[0],b=g[1],_=g[2];return h?_!=="video"&&_!=="audio"?R.log.error("The element of `"+b+"` was not a media element."):(h.muxId=i.muxId,delete i.muxId,h.mux=h.mux||{},h.mux.listeners=(0,I.default)({},i.mux.listeners),delete i.mux.listeners,Object.keys(h.mux.listeners).forEach(function(O){i.removeEventListener(O,h.mux.listeners[O],!1),h.addEventListener(O,h.mux.listeners[O],!1)}),h.mux.swapElement=i.mux.swapElement,h.mux.destroy=i.mux.destroy,delete i.mux,void(i=h)):R.log.error("No element was found with the `"+b+"` query selector.")},i.mux.addHLSJS=function(o){R.addHLSJS(f,o)},i.mux.addDashJS=function(o){R.addDashJS(f,o)},i.mux.removeHLSJS=function(){R.removeHLSJS(f)},i.mux.removeDashJS=function(){R.removeDashJS(f)},R.init(f,T),R.emit(f,"playerready"),i.paused||(R.emit(f,"play"),i.readyState>2&&R.emit(f,"playing")),i.mux.listeners={},A.forEach(function(o){(o!=="error"||T.automaticErrorTracking)&&(i.mux.listeners[o]=function(){var E={};if(o==="error"){if(!i.error||i.error.code===1)return;E.player_error_code=i.error.code,E.player_error_message=D[i.error.code]||i.error.message}R.emit(f,o,E)},i.addEventListener(o,i.mux.listeners[o],!1))})}Object.defineProperty(e,"__esModule",{value:!0});var u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},M=function(){function R(L,T){var S=[],c=!0,i=!1,f=void 0;try{for(var m,d=L[Symbol.iterator]();!(c=(m=d.next()).done)&&(S.push(m.value),!T||S.length!==T);c=!0);}catch(l){i=!0,f=l}finally{try{!c&&d.return&&d.return()}finally{if(i)throw f}}return S}return function(L,T){if(Array.isArray(L))return L;if(Symbol.iterator in Object(L))return R(L,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.default=n;var y=a(1),I=function(R){return R&&R.__esModule?R:{default:R}}(y),x=a(11),A=["loadstart","pause","play","playing","seeking","seeked","timeupdate","ratechange","stalled","waiting","error","ended"],D={1:"MEDIA_ERR_ABORTED",2:"MEDIA_ERR_NETWORK",3:"MEDIA_ERR_DECODE",4:"MEDIA_ERR_SRC_NOT_SUPPORTED"}},function(t,e,a){"use strict";function n(v){return v&&v.__esModule?v:{default:v}}Object.defineProperty(e,"__esModule",{value:!0});var u=a(60),M=n(u),y=a(3),I=n(y),x=a(61),A=n(x),D=a(62),R=n(D),L=a(1),T=n(L),S=a(7),c=n(S),i=a(5),f=a(2),m=n(f),d=a(63),l=n(d),s={};s.safeCall=M.default,s.safeIncrement=I.default,s.getComputedStyle=A.default,s.secondsToMs=R.default,s.assign=T.default,s.headersStringToObject=c.default,s.extractHostnameAndDomain=i.extractHostnameAndDomain,s.extractHostname=i.extractHostname,s.now=m.default.now,s.manifestParser=l.default,e.default=s},function(t,e,a){"use strict";function n(y,I,x,A){var D=A;if(y&&typeof y[I]=="function")try{D=y[I].apply(y,x)}catch(R){M.default.info("safeCall error",R)}return D}Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;var u=a(4),M=function(y){return y&&y.__esModule?y:{default:y}}(u)},function(t,e,a){"use strict";function n(I,x){if(I&&x&&M.default&&typeof M.default.getComputedStyle=="function"){var A=void 0;return y&&y.has(I)&&(A=y.get(I)),A||(A=M.default.getComputedStyle(I,null),y&&y.set(I,A)),A.getPropertyValue(x)}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;var u=a(0),M=function(I){return I&&I.__esModule?I:{default:I}}(u),y=void 0;M.default&&M.default.WeakMap&&(y=new WeakMap)},function(t,e,a){"use strict";function n(u){return Math.floor(1e3*u)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=n},function(t,e,a){"use strict";function n(m){return m&&m.__esModule?m:{default:m}}Object.defineProperty(e,"__esModule",{value:!0});var u=a(1),M=n(u),y=a(14),I=n(y),x={TARGET_DURATION:"#EXT-X-TARGETDURATION",PART_INF:"#EXT-X-PART-INF",SERVER_CONTROL:"#EXT-X-SERVER-CONTROL",INF:"#EXTINF",PROGRAM_DATE_TIME:"#EXT-X-PROGRAM-DATE-TIME",VERSION:"#EXT-X-VERSION",SESSION_DATA:"#EXT-X-SESSION-DATA"},A=function(m){return this.buffer="",this.manifest={segments:[],serverControl:{},sessionData:{}},this.currentUri={},this.process(m),this.manifest};A.prototype.process=function(m){var d=void 0;for(this.buffer+=m,d=this.buffer.indexOf(`
|
|
4
|
+
`+$.prev}function w(G,$){var ye=y(G),_e=[];if(ye){_e.length=G.length;for(var xe=0;xe<G.length;xe++)_e[xe]=c(G,xe)?$(G[xe],G):""}var Ke,ve=typeof me=="function"?me(G):[];if(Re){Ke={};for(var Ve=0;Ve<ve.length;Ve++)Ke["$"+ve[Ve]]=ve[Ve]}for(var We in G)c(G,We)&&(ye&&String(Number(We))===We&&We<G.length||Re&&Ke["$"+We]instanceof Symbol||(Te.call(/[^\w$]/,We)?_e.push($(We,G)+": "+$(G[We],G)):_e.push(We+": "+$(G[We],G))));if(typeof me=="function")for(var ze=0;ze<ve.length;ze++)Ne.call(G,ve[ze])&&_e.push("["+$(ve[ze])+"]: "+$(G[ve[ze]],G));return _e}var U=typeof Map=="function"&&Map.prototype,k=Object.getOwnPropertyDescriptor&&U?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,N=U&&k&&typeof k.get=="function"?k.get:null,F=U&&Map.prototype.forEach,H=typeof Set=="function"&&Set.prototype,W=Object.getOwnPropertyDescriptor&&H?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,B=H&&W&&typeof W.get=="function"?W.get:null,j=H&&Set.prototype.forEach,V=typeof WeakMap=="function"&&WeakMap.prototype,Y=V?WeakMap.prototype.has:null,Q=typeof WeakSet=="function"&&WeakSet.prototype,J=Q?WeakSet.prototype.has:null,z=typeof WeakRef=="function"&&WeakRef.prototype,te=z?WeakRef.prototype.deref:null,se=Boolean.prototype.valueOf,Z=Object.prototype.toString,Ee=Function.prototype.toString,fe=String.prototype.match,re=String.prototype.slice,q=String.prototype.replace,ie=String.prototype.toUpperCase,ne=String.prototype.toLowerCase,Te=RegExp.prototype.test,Se=Array.prototype.concat,he=Array.prototype.join,Oe=Array.prototype.slice,Ce=Math.floor,Ue=typeof BigInt=="function"?BigInt.prototype.valueOf:null,me=Object.getOwnPropertySymbols,Ae=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Re=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Ie=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Re?"object":"symbol")?Symbol.toStringTag:null,Ne=Object.prototype.propertyIsEnumerable,je=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(G){return G.__proto__}:null),Qe=a(50).custom,Fe=Qe&&T(Qe)?Qe:null;t.exports=function G($,ye,_e,xe){function Ke(rr,hi,Ql){if(hi&&(xe=Oe.call(xe),xe.push(hi)),Ql){var Va={depth:ve.depth};return c(ve,"quoteStyle")&&(Va.quoteStyle=ve.quoteStyle),G(rr,Va,_e+1,xe)}return G(rr,ve,_e+1,xe)}var ve=ye||{};if(c(ve,"quoteStyle")&&ve.quoteStyle!=="single"&&ve.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(c(ve,"maxStringLength")&&(typeof ve.maxStringLength=="number"?ve.maxStringLength<0&&ve.maxStringLength!==1/0:ve.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Ve=!c(ve,"customInspect")||ve.customInspect;if(typeof Ve!="boolean"&&Ve!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(c(ve,"indent")&&ve.indent!==null&&ve.indent!==" "&&!(parseInt(ve.indent,10)===ve.indent&&ve.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(c(ve,"numericSeparator")&&typeof ve.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var We=ve.numericSeparator;if($===void 0)return"undefined";if($===null)return"null";if(typeof $=="boolean")return $?"true":"false";if(typeof $=="string")return E($,ve);if(typeof $=="number"){if($===0)return 1/0/$>0?"0":"-0";var ze=String($);return We?n($,ze):ze}if(typeof $=="bigint"){var kt=String($)+"n";return We?n($,kt):kt}var yt=ve.depth===void 0?5:ve.depth;if(_e===void 0&&(_e=0),_e>=yt&&yt>0&&typeof $=="object")return y($)?"[Array]":"[Object]";var Dt=C(ve,_e);if(xe===void 0)xe=[];else if(m(xe,$)>=0)return"[Circular]";if(typeof $=="function"){var Dr=f($),qt=w($,Ke);return"[Function"+(Dr?": "+Dr:" (anonymous)")+"]"+(qt.length>0?" { "+he.call(qt,", ")+" }":"")}if(T($)){var rt=Re?q.call(String($),/^(Symbol\(.*\))_[^)]*$/,"$1"):Ae.call($);return typeof $!="object"||Re?rt:h(rt)}if(o($)){for(var wt="<"+ne.call(String($.nodeName)),er=$.attributes||[],tr=0;tr<er.length;tr++)wt+=" "+er[tr].name+"="+u(M(er[tr].value),"double",ve);return wt+=">",$.childNodes&&$.childNodes.length&&(wt+="..."),wt+="</"+ne.call(String($.nodeName))+">"}if(y($)){if($.length===0)return"[]";var Ir=w($,Ke);return Dt&&!O(Ir)?"["+P(Ir,Dt)+"]":"[ "+he.call(Ir,", ")+" ]"}if(A($)){var Mr=w($,Ke);return"cause"in $&&!Ne.call($,"cause")?"{ ["+String($)+"] "+he.call(Se.call("[cause]: "+Ke($.cause),Mr),", ")+" }":Mr.length===0?"["+String($)+"]":"{ ["+String($)+"] "+he.call(Mr,", ")+" }"}if(typeof $=="object"&&Ve){if(Fe&&typeof $[Fe]=="function")return $[Fe]();if(Ve!=="symbol"&&typeof $.inspect=="function")return $.inspect()}if(d($)){var di=[];return F.call($,function(rr,hi){di.push(Ke(hi,$,!0)+" => "+Ke(rr,$))}),_("Map",N.call($),di,Dt)}if(v($)){var ci=[];return j.call($,function(rr){ci.push(Ke(rr,$))}),_("Set",B.call($),ci,Dt)}if(l($))return b("WeakMap");if(p($))return b("WeakSet");if(s($))return b("WeakRef");if(R($))return h(Ke(Number($)));if(S($))return h(Ke(Ue.call($)));if(L($))return h(se.call($));if(D($))return h(Ke(String($)));if(!I($)&&!x($)){var Ut=w($,Ke),Rr=je?je($)===Object.prototype:$ instanceof Object||$.constructor===Object,Or=$ instanceof Object?"":"null prototype",fi=!Rr&&Ie&&Object($)===$&&Ie in $?re.call(i($),8,-1):Or?"Object":"",Xl=Rr||typeof $.constructor!="function"?"":$.constructor.name?$.constructor.name+" ":"",gn=Xl+(fi||Or?"["+he.call(Se.call([],fi||[],Or||[]),": ")+"] ":"");return Ut.length===0?gn+"{}":Dt?gn+"{"+P(Ut,Dt)+"}":gn+"{ "+he.call(Ut,", ")+" }"}return String($)};var ke=Object.prototype.hasOwnProperty||function(G){return G in this}},function(t,e){},function(t,e,a){"use strict";var n=a(16),u=Object.prototype.hasOwnProperty,M=Array.isArray,y={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},I=function(T){return T.replace(/&#(\d+);/g,function(S,c){return String.fromCharCode(parseInt(c,10))})},x=function(T,S){return T&&typeof T=="string"&&S.comma&&T.indexOf(",")>-1?T.split(","):T},A=function(T,S){var c,i={},f=S.ignoreQueryPrefix?T.replace(/^\?/,""):T,m=S.parameterLimit===1/0?void 0:S.parameterLimit,d=f.split(S.delimiter,m),l=-1,s=S.charset;if(S.charsetSentinel)for(c=0;c<d.length;++c)d[c].indexOf("utf8=")===0&&(d[c]==="utf8=%E2%9C%93"?s="utf-8":d[c]==="utf8=%26%2310003%3B"&&(s="iso-8859-1"),l=c,c=d.length);for(c=0;c<d.length;++c)if(c!==l){var v,p,o=d[c],E=o.indexOf("]="),g=E===-1?o.indexOf("="):E+1;g===-1?(v=S.decoder(o,y.decoder,s,"key"),p=S.strictNullHandling?null:""):(v=S.decoder(o.slice(0,g),y.decoder,s,"key"),p=n.maybeMap(x(o.slice(g+1),S),function(h){return S.decoder(h,y.decoder,s,"value")})),p&&S.interpretNumericEntities&&s==="iso-8859-1"&&(p=I(p)),o.indexOf("[]=")>-1&&(p=M(p)?[p]:p),u.call(i,v)?i[v]=n.combine(i[v],p):i[v]=p}return i},D=function(T,S,c,i){for(var f=i?S:x(S,c),m=T.length-1;m>=0;--m){var d,l=T[m];if(l==="[]"&&c.parseArrays)d=[].concat(f);else{d=c.plainObjects?Object.create(null):{};var s=l.charAt(0)==="["&&l.charAt(l.length-1)==="]"?l.slice(1,-1):l,v=parseInt(s,10);c.parseArrays||s!==""?!isNaN(v)&&l!==s&&String(v)===s&&v>=0&&c.parseArrays&&v<=c.arrayLimit?(d=[],d[v]=f):s!=="__proto__"&&(d[s]=f):d={0:f}}f=d}return f},R=function(T,S,c,i){if(T){var f=c.allowDots?T.replace(/\.([^.[]+)/g,"[$1]"):T,m=/(\[[^[\]]*])/,d=/(\[[^[\]]*])/g,l=c.depth>0&&m.exec(f),s=l?f.slice(0,l.index):f,v=[];if(s){if(!c.plainObjects&&u.call(Object.prototype,s)&&!c.allowPrototypes)return;v.push(s)}for(var p=0;c.depth>0&&(l=d.exec(f))!==null&&p<c.depth;){if(p+=1,!c.plainObjects&&u.call(Object.prototype,l[1].slice(1,-1))&&!c.allowPrototypes)return;v.push(l[1])}return l&&v.push("["+f.slice(l.index)+"]"),D(v,S,c,i)}},L=function(T){if(!T)return y;if(T.decoder!==null&&T.decoder!==void 0&&typeof T.decoder!="function")throw new TypeError("Decoder has to be a function.");if(T.charset!==void 0&&T.charset!=="utf-8"&&T.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var S=T.charset===void 0?y.charset:T.charset;return{allowDots:T.allowDots===void 0?y.allowDots:!!T.allowDots,allowPrototypes:typeof T.allowPrototypes=="boolean"?T.allowPrototypes:y.allowPrototypes,allowSparse:typeof T.allowSparse=="boolean"?T.allowSparse:y.allowSparse,arrayLimit:typeof T.arrayLimit=="number"?T.arrayLimit:y.arrayLimit,charset:S,charsetSentinel:typeof T.charsetSentinel=="boolean"?T.charsetSentinel:y.charsetSentinel,comma:typeof T.comma=="boolean"?T.comma:y.comma,decoder:typeof T.decoder=="function"?T.decoder:y.decoder,delimiter:typeof T.delimiter=="string"||n.isRegExp(T.delimiter)?T.delimiter:y.delimiter,depth:typeof T.depth=="number"||T.depth===!1?+T.depth:y.depth,ignoreQueryPrefix:T.ignoreQueryPrefix===!0,interpretNumericEntities:typeof T.interpretNumericEntities=="boolean"?T.interpretNumericEntities:y.interpretNumericEntities,parameterLimit:typeof T.parameterLimit=="number"?T.parameterLimit:y.parameterLimit,parseArrays:T.parseArrays!==!1,plainObjects:typeof T.plainObjects=="boolean"?T.plainObjects:y.plainObjects,strictNullHandling:typeof T.strictNullHandling=="boolean"?T.strictNullHandling:y.strictNullHandling}};t.exports=function(T,S){var c=L(S);if(T===""||T===null||T===void 0)return c.plainObjects?Object.create(null):{};for(var i=typeof T=="string"?A(T,c):T,f=c.plainObjects?Object.create(null):{},m=Object.keys(i),d=0;d<m.length;++d){var l=m[d],s=R(l,i[l],c,typeof T=="string");f=n.merge(f,s,c)}return c.allowSparse===!0?f:n.compact(f)}},function(t,e,a){"use strict";var n,u,M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(y){return typeof y}:function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y};(function(y){var I=!1;if(n=y,(u=typeof n=="function"?n.call(e,a,e,t):n)!==void 0&&(t.exports=u),I=!0,M(e)==="object"&&(t.exports=y(),I=!0),!I){var x=window.Cookies,A=window.Cookies=y();A.noConflict=function(){return window.Cookies=x,A}}})(function(){function y(x){function A(D,R,L){var T;if(typeof document!="undefined"){if(arguments.length>1){if(L=I({path:"/"},A.defaults,L),typeof L.expires=="number"){var S=new Date;S.setMilliseconds(S.getMilliseconds()+864e5*L.expires),L.expires=S}try{T=JSON.stringify(R),/^[\{\[]/.test(T)&&(R=T)}catch{}return R=x.write?x.write(R,D):encodeURIComponent(String(R)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),D=encodeURIComponent(String(D)),D=D.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),D=D.replace(/[\(\)]/g,escape),document.cookie=[D,"=",R,L.expires?"; expires="+L.expires.toUTCString():"",L.path?"; path="+L.path:"",L.domain?"; domain="+L.domain:"",L.secure?"; secure":""].join("")}D||(T={});for(var c=document.cookie?document.cookie.split("; "):[],i=/(%[0-9A-Z]{2})+/g,f=0;f<c.length;f++){var m=c[f].split("="),d=m.slice(1).join("=");d.charAt(0)==='"'&&(d=d.slice(1,-1));try{var l=m[0].replace(i,decodeURIComponent);if(d=x.read?x.read(d,l):x(d,l)||d.replace(i,decodeURIComponent),this.json)try{d=JSON.parse(d)}catch{}if(D===l){T=d;break}D||(T[l]=d)}catch{}}return T}}return A.set=A,A.get=function(D){return A.call(A,D)},A.getJSON=function(){return A.apply({json:!0},[].slice.call(arguments))},A.defaults={},A.remove=function(D,R){A(D,"",I(R,{expires:-1}))},A.withConverter=y,A}var I=function(){for(var x=0,A={};x<arguments.length;x++){var D=arguments[x];for(var R in D)A[R]=D[R]}return A};return y(function(){})})},function(t,e,a){"use strict";function n(u,M){var y=M.beaconCollectionDomain,I=M.beaconDomain;if(y)return"https://"+y;u=u||"inferred";var x=I||"litix.io";return u.match(/^[a-z0-9]+$/)?"https://"+u+"."+x:"https://img.litix.io/a.gif"}Object.defineProperty(e,"__esModule",{value:!0}),e.default=n},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a(0),u=function(I){return I&&I.__esModule?I:{default:I}}(n),M=function(){var I=void 0;switch(y()){case"cellular":I="cellular";break;case"ethernet":I="wired";break;case"wifi":I="wifi";break;case void 0:break;default:I="other"}return I},y=function(){var I=u.default.navigator,x=I&&(I.connection||I.mozConnection||I.webkitConnection);return x&&x.type};e.default=M},function(t,e,a){"use strict";function n(d){return d&&d.__esModule?d:{default:d}}Object.defineProperty(e,"__esModule",{value:!0});var u=a(0),M=n(u),y=a(4),I=n(y),x=a(56),A=n(x),D=a(1),R=n(D),L=a(17),T=n(L),S=a(2),c=n(S),i=!!M.default.XMLHttpRequest&&"withCredentials"in new M.default.XMLHttpRequest,f={maxBeaconSize:300,maxQueueLength:3600,baseTimeBetweenBeacons:1e4},m=function(d,l){this._beaconUrl=d||"https://img.litix.io",this._eventQueue=[],this._postInFlight=!1,this._failureCount=0,this._sendTimeout=!1,this._options=(0,R.default)({},f,l)};m.prototype.queueEvent=function(d,l){var s=(0,R.default)({},l);return i?(this._eventQueue.length<=this._options.maxQueueLength||d==="eventrateexceeded")&&(this._eventQueue.push(s),this._sendTimeout||this._startBeaconSending(),this._eventQueue.length<=this._options.maxQueueLength):(A.default.send(this._beaconUrl,s),!0)},m.prototype.flushEvents=function(){i&&(this._eventQueue.length&&this._sendBeaconQueue(),this._startBeaconSending())},m.prototype.destroy=function(){var d=arguments.length>0&&arguments[0]!==void 0&&arguments[0];this.destroyed=!0,d?this._clearBeaconQueue():this.flushEvents(),M.default.clearTimeout(this._sendTimeout)},m.prototype._clearBeaconQueue=function(){var d=M.default.navigator,l=this._eventQueue.length>this._options.maxBeaconSize?this._eventQueue.length-this._options.maxBeaconSize:0,s=this._eventQueue.slice(l);l>0&&(0,R.default)(s[s.length-1],(0,T.default)({mux_view_message:"event queue truncated"}));var v=this._createPayload(s);if(d.sendBeacon)d.sendBeacon(this._beaconUrl,v);else if(M.default.XMLHttpRequest){var p=new M.default.XMLHttpRequest;p.open("POST",this._beaconUrl),p.setRequestHeader("Content-Type","application/json"),p.send(v)}else A.default.send(this._beaconUrl,s[s.length-1])},m.prototype._sendBeaconQueue=function(){var d=this;if(M.default.XMLHttpRequest&&!this._postInFlight){var l=new M.default.XMLHttpRequest,s=this._eventQueue.slice(0,this._options.maxBeaconSize);this._eventQueue=this._eventQueue.slice(this._options.maxBeaconSize),this._postInFlight=!0,l.onreadystatechange=function(){l.readyState===4&&(l.status!==200?(d._eventQueue=s.concat(d._eventQueue),d._failureCount+=1,I.default.info("Error sending beacon: "+l.status),I.default.info(l.responseText)):d._failureCount=0,d._roundTripTime=c.default.now()-p,d._postInFlight=!1)},l.open("POST",this._beaconUrl),l.setRequestHeader("Content-Type","application/json");var v=this._createPayload(s),p=c.default.now();l.send(v)}},m.prototype._getNextBeaconTime=function(){if(!this._failureCount)return this._options.baseTimeBetweenBeacons;var d=Math.pow(2,this._failureCount-1);return(1+(d*=Math.random()))*this._options.baseTimeBetweenBeacons},m.prototype._startBeaconSending=function(){var d=this;M.default.clearTimeout(this._sendTimeout),this.destroyed||(this._sendTimeout=M.default.setTimeout(function(){d._eventQueue.length&&d._sendBeaconQueue(),d._startBeaconSending()},this._getNextBeaconTime()))},m.prototype._createPayload=function(d){var l={transmission_timestamp:Math.round(c.default.now())};return this._roundTripTime&&(l.rtt_ms=Math.round(this._roundTripTime)),JSON.stringify({metadata:l,events:d})},e.default=m},function(t,e,a){"use strict";function n(A){return A&&A.__esModule?A:{default:A}}Object.defineProperty(e,"__esModule",{value:!0});var u=a(15),M=n(u),y=a(0),I=n(y),x={};x.send=function(A,D){function R(){L.src=S+(T?"&rc="+T:"")}var L=new Image,T=0,S=A+"?"+M.default.stringify(D);return L.addEventListener("error",function(){T>3||I.default.setTimeout(function(){T++,R()},5e3*T)}),R(),L},e.default=x},function(t,e,a){"use strict";function n(){function u(S,c){var i=c.request_start,f=c.request_response_start,m=c.request_response_end,d=c.request_bytes_loaded;D++;var l=void 0,s=void 0;if(f?(l=f-i,s=m-f):s=m-i,s>0&&d>0){var v=d/s*8e3;R++,x+=d,A+=s,this.data.view_min_request_throughput=Math.min(this.data.view_min_request_throughput||1/0,v),this.data.view_average_request_throughput=x/A*8e3,this.data.view_request_count=D,l>0&&(I+=l,this.data.view_max_request_latency=Math.max(this.data.view_max_request_latency||0,l),this.data.view_average_request_latency=I/R)}}function M(S,c){D++,L++,this.data.view_request_count=D,this.data.view_request_failed_count=L}function y(S,c){D++,T++,this.data.view_request_count=D,this.data.view_request_canceled_count=T}var I=0,x=0,A=0,D=0,R=0,L=0,T=0;this.on("requestcompleted",u),this.on("requestfailed",M),this.on("requestcanceled",y)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=n},function(t,e,a){"use strict";function n(R,L,T){var S=(0,x.findMediaElement)(L),c=M(S,3),i=c[0],f=c[1],m=c[2],d=R.log,l=R.utils.getComputedStyle,s=R.utils.secondsToMs,v={automaticErrorTracking:!0};if(!i)return d.error("No element was found with the `"+f+"` query selector.");if(m!=="video"&&m!=="audio")return d.error("The element of `"+f+"` was not a media element.");T=(0,I.default)(v,T),T.data=(0,I.default)({player_software:"HTML5 Video Element",player_mux_plugin_name:"VideoElementMonitor",player_mux_plugin_version:"4.8.0"},T.data),T.getPlayheadTime=function(){return s(i.currentTime)},T.getStateData=function(){var o=this.hlsjs&&this.hlsjs.url,E=this.dashjs&&u(this.dashjs.getSource==="function")&&this.dashjs.getSource();return{player_is_paused:i.paused,player_playhead_time:s(i.currentTime),player_width:parseInt(l(i,"width")),player_height:parseInt(l(i,"height")),player_autoplay_on:i.autoplay,player_preload_on:i.preload,video_poster_url:i.poster,video_source_url:o||E||i.currentSrc,video_source_duration:s(i.duration),video_source_height:i.videoHeight,video_source_width:i.videoWidth}},i.mux=i.mux||{},i.mux.deleted=!1,i.mux.emit=function(o,E){R.emit(f,o,E)};var p=function(){d.error("The monitor for this video element has already been destroyed.")};i.mux.destroy=function(){Object.keys(i.mux.listeners).forEach(function(o){i.removeEventListener(o,i.mux.listeners[o],!1)}),delete i.mux.listeners,i.mux.destroy=p,i.mux.swapElement=p,i.mux.emit=p,i.mux.addHLSJS=p,i.mux.addDashJS=p,i.mux.removeHLSJS=p,i.mux.removeDashJS=p,i.mux.deleted=!0,R.emit(f,"destroy")},i.mux.swapElement=function(o){var E=(0,x.findMediaElement)(o),g=M(E,3),h=g[0],b=g[1],_=g[2];return h?_!=="video"&&_!=="audio"?R.log.error("The element of `"+b+"` was not a media element."):(h.muxId=i.muxId,delete i.muxId,h.mux=h.mux||{},h.mux.listeners=(0,I.default)({},i.mux.listeners),delete i.mux.listeners,Object.keys(h.mux.listeners).forEach(function(O){i.removeEventListener(O,h.mux.listeners[O],!1),h.addEventListener(O,h.mux.listeners[O],!1)}),h.mux.swapElement=i.mux.swapElement,h.mux.destroy=i.mux.destroy,delete i.mux,void(i=h)):R.log.error("No element was found with the `"+b+"` query selector.")},i.mux.addHLSJS=function(o){R.addHLSJS(f,o)},i.mux.addDashJS=function(o){R.addDashJS(f,o)},i.mux.removeHLSJS=function(){R.removeHLSJS(f)},i.mux.removeDashJS=function(){R.removeDashJS(f)},R.init(f,T),R.emit(f,"playerready"),i.paused||(R.emit(f,"play"),i.readyState>2&&R.emit(f,"playing")),i.mux.listeners={},A.forEach(function(o){(o!=="error"||T.automaticErrorTracking)&&(i.mux.listeners[o]=function(){var E={};if(o==="error"){if(!i.error||i.error.code===1)return;E.player_error_code=i.error.code,E.player_error_message=D[i.error.code]||i.error.message}R.emit(f,o,E)},i.addEventListener(o,i.mux.listeners[o],!1))})}Object.defineProperty(e,"__esModule",{value:!0});var u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},M=function(){function R(L,T){var S=[],c=!0,i=!1,f=void 0;try{for(var m,d=L[Symbol.iterator]();!(c=(m=d.next()).done)&&(S.push(m.value),!T||S.length!==T);c=!0);}catch(l){i=!0,f=l}finally{try{!c&&d.return&&d.return()}finally{if(i)throw f}}return S}return function(L,T){if(Array.isArray(L))return L;if(Symbol.iterator in Object(L))return R(L,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.default=n;var y=a(1),I=function(R){return R&&R.__esModule?R:{default:R}}(y),x=a(11),A=["loadstart","pause","play","playing","seeking","seeked","timeupdate","ratechange","stalled","waiting","error","ended"],D={1:"MEDIA_ERR_ABORTED",2:"MEDIA_ERR_NETWORK",3:"MEDIA_ERR_DECODE",4:"MEDIA_ERR_SRC_NOT_SUPPORTED"}},function(t,e,a){"use strict";function n(v){return v&&v.__esModule?v:{default:v}}Object.defineProperty(e,"__esModule",{value:!0});var u=a(60),M=n(u),y=a(3),I=n(y),x=a(61),A=n(x),D=a(62),R=n(D),L=a(1),T=n(L),S=a(7),c=n(S),i=a(5),f=a(2),m=n(f),d=a(63),l=n(d),s={};s.safeCall=M.default,s.safeIncrement=I.default,s.getComputedStyle=A.default,s.secondsToMs=R.default,s.assign=T.default,s.headersStringToObject=c.default,s.extractHostnameAndDomain=i.extractHostnameAndDomain,s.extractHostname=i.extractHostname,s.now=m.default.now,s.manifestParser=l.default,e.default=s},function(t,e,a){"use strict";function n(y,I,x,A){var D=A;if(y&&typeof y[I]=="function")try{D=y[I].apply(y,x)}catch(R){M.default.info("safeCall error",R)}return D}Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;var u=a(4),M=function(y){return y&&y.__esModule?y:{default:y}}(u)},function(t,e,a){"use strict";function n(I,x){if(I&&x&&M.default&&typeof M.default.getComputedStyle=="function"){var A=void 0;return y&&y.has(I)&&(A=y.get(I)),A||(A=M.default.getComputedStyle(I,null),y&&y.set(I,A)),A.getPropertyValue(x)}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;var u=a(0),M=function(I){return I&&I.__esModule?I:{default:I}}(u),y=void 0;M.default&&M.default.WeakMap&&(y=new WeakMap)},function(t,e,a){"use strict";function n(u){return Math.floor(1e3*u)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=n},function(t,e,a){"use strict";function n(m){return m&&m.__esModule?m:{default:m}}Object.defineProperty(e,"__esModule",{value:!0});var u=a(1),M=n(u),y=a(14),I=n(y),x={TARGET_DURATION:"#EXT-X-TARGETDURATION",PART_INF:"#EXT-X-PART-INF",SERVER_CONTROL:"#EXT-X-SERVER-CONTROL",INF:"#EXTINF",PROGRAM_DATE_TIME:"#EXT-X-PROGRAM-DATE-TIME",VERSION:"#EXT-X-VERSION",SESSION_DATA:"#EXT-X-SESSION-DATA"},A=function(m){return this.buffer="",this.manifest={segments:[],serverControl:{},sessionData:{}},this.currentUri={},this.process(m),this.manifest};A.prototype.process=function(m){var d=void 0;for(this.buffer+=m,d=this.buffer.indexOf(`
|
|
5
5
|
`);d>-1;d=this.buffer.indexOf(`
|
|
6
|
-
`))this.processLine(this.buffer.substring(0,d)),this.buffer=this.buffer.substring(d+1)},A.prototype.processLine=function(m){var d=m.indexOf(":"),l=i(m,d),s=l[0],v=l.length===2?L(l[1]):void 0;if(s[0]!=="#")this.currentUri.uri=s,this.manifest.segments.push(this.currentUri),!this.manifest.targetDuration||"duration"in this.currentUri||(this.currentUri.duration=this.manifest.targetDuration),this.currentUri={};else switch(s){case x.TARGET_DURATION:if(!isFinite(v)||v<0)return;this.manifest.targetDuration=v,this.setHoldBack();break;case x.PART_INF:D(this.manifest,l),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),this.setHoldBack();break;case x.SERVER_CONTROL:D(this.manifest,l),this.setHoldBack();break;case x.INF:v===0?this.currentUri.duration=.01:v>0&&(this.currentUri.duration=v);break;case x.PROGRAM_DATE_TIME:var p=v,o=new Date(p);this.manifest.dateTimeString||(this.manifest.dateTimeString=p,this.manifest.dateTimeObject=o),this.currentUri.dateTimeString=p,this.currentUri.dateTimeObject=o;break;case x.VERSION:D(this.manifest,l);break;case x.SESSION_DATA:var E=f(l[1]),g=(0,I.default)(E);(0,M.default)(this.manifest.sessionData,g)}},A.prototype.setHoldBack=function(){var m=this.manifest,d=m.serverControl,l=m.targetDuration,s=m.partTargetDuration;if(d){var v="holdBack",p="partHoldBack",o=l&&3*l,E=s&&2*s;l&&!d.hasOwnProperty(v)&&(d[v]=o),o&&d[v]<o&&(d[v]=o),s&&!d.hasOwnProperty(p)&&(d[p]=3*s),s&&d[p]<E&&(d[p]=E)}};var D=function(m,d){var l=R(d[0].replace("#EXT-X-","")),s=void 0;c(d[1])?(s={},s=(0,M.default)(S(d[1]),s)):s=L(d[1]),m[l]=s},R=function(m){return m.toLowerCase().replace(/-(\w)/g,function(d){return d[1].toUpperCase()})},L=function(m){if(m.toLowerCase()==="yes"||m.toLowerCase()==="no")return m.toLowerCase()==="yes";var d=m.indexOf(":")!==-1?m:parseFloat(m);return isNaN(d)?m:d},T=function(m){var d={},l=m.split("=");return l.length>1&&(d[R(l[0])]=L(l[1])),d},S=function(m){for(var d=m.split(","),l={},s=0;d.length>s;s++){var v=d[s],p=T(v);l=(0,M.default)(p,l)}return l},c=function(m){return m.indexOf("=")>-1},i=function(m,d){return d===-1?[m]:[m.substring(0,d),m.substring(d+1)]},f=function(m){var d={};if(m){var l=m.search(",");return[m.slice(0,l),m.slice(l+1)].forEach(function(s,v){for(var p=s.replace(/['"]+/g,"").split("="),o=0;o<p.length;o++)p[o]==="DATA-ID"&&(d["DATA-ID"]=p[1-o]),p[o]==="VALUE"&&(d.VALUE=p[1-o])}),{data:d}}};e.default=A},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={PLAYER_READY:"playerready",VIEW_INIT:"viewinit",VIDEO_CHANGE:"videochange",PLAY:"play",PAUSE:"pause",PLAYING:"playing",TIME_UPDATE:"timeupdate",SEEKING:"seeking",SEEKED:"seeked",REBUFFER_START:"rebufferstart",REBUFFER_END:"rebufferend",ERROR:"error",ENDED:"ended",RENDITION_CHANGE:"renditionchange",ORIENTATION_CHANGE:"orientationchange",AD_REQUEST:"adrequest",AD_RESPONSE:"adresponse",AD_BREAK_START:"adbreakstart",AD_PLAY:"adplay",AD_PLAYING:"adplaying",AD_PAUSE:"adpause",AD_FIRST_QUARTILE:"adfirstquartile",AD_MID_POINT:"admidpoint",AD_THIRD_QUARTILE:"adthirdquartile",AD_ENDED:"adended",AD_BREAK_END:"adbreakend",AD_ERROR:"aderror",REQUEST_COMPLETED:"requestcompleted",REQUEST_FAILED:"requestfailed",REQUEST_CANCELLED:"requestcanceled"};e.default=n}])})})()});var Fi=$a((Yr,va)=>{typeof window!="undefined"&&function(t,e){typeof Yr=="object"&&typeof va=="object"?va.exports=e():typeof define=="function"&&define.amd?define([],e):typeof Yr=="object"?Yr.Hls=e():t.Hls=e()}(Yr,function(){return function(r){var t={};function e(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return r[a].call(n.exports,n,n.exports,e),n.l=!0,n.exports}return e.m=r,e.c=t,e.d=function(a,n,u){e.o(a,n)||Object.defineProperty(a,n,{enumerable:!0,get:u})},e.r=function(a){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},e.t=function(a,n){if(n&1&&(a=e(a)),n&8||n&4&&typeof a=="object"&&a&&a.__esModule)return a;var u=Object.create(null);if(e.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:a}),n&2&&typeof a!="string")for(var M in a)e.d(u,M,function(y){return a[y]}.bind(null,M));return u},e.n=function(a){var n=a&&a.__esModule?function(){return a.default}:function(){return a};return e.d(n,"a",n),n},e.o=function(a,n){return Object.prototype.hasOwnProperty.call(a,n)},e.p="/dist/",e(e.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(r,t,e){"use strict";var a=Object.prototype.hasOwnProperty,n="~";function u(){}Object.create&&(u.prototype=Object.create(null),new u().__proto__||(n=!1));function M(A,D,R){this.fn=A,this.context=D,this.once=R||!1}function y(A,D,R,L,T){if(typeof R!="function")throw new TypeError("The listener must be a function");var S=new M(R,L||A,T),c=n?n+D:D;return A._events[c]?A._events[c].fn?A._events[c]=[A._events[c],S]:A._events[c].push(S):(A._events[c]=S,A._eventsCount++),A}function I(A,D){--A._eventsCount===0?A._events=new u:delete A._events[D]}function x(){this._events=new u,this._eventsCount=0}x.prototype.eventNames=function(){var D=[],R,L;if(this._eventsCount===0)return D;for(L in R=this._events)a.call(R,L)&&D.push(n?L.slice(1):L);return Object.getOwnPropertySymbols?D.concat(Object.getOwnPropertySymbols(R)):D},x.prototype.listeners=function(D){var R=n?n+D:D,L=this._events[R];if(!L)return[];if(L.fn)return[L.fn];for(var T=0,S=L.length,c=new Array(S);T<S;T++)c[T]=L[T].fn;return c},x.prototype.listenerCount=function(D){var R=n?n+D:D,L=this._events[R];return L?L.fn?1:L.length:0},x.prototype.emit=function(D,R,L,T,S,c){var i=n?n+D:D;if(!this._events[i])return!1;var f=this._events[i],m=arguments.length,d,l;if(f.fn){switch(f.once&&this.removeListener(D,f.fn,void 0,!0),m){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,R),!0;case 3:return f.fn.call(f.context,R,L),!0;case 4:return f.fn.call(f.context,R,L,T),!0;case 5:return f.fn.call(f.context,R,L,T,S),!0;case 6:return f.fn.call(f.context,R,L,T,S,c),!0}for(l=1,d=new Array(m-1);l<m;l++)d[l-1]=arguments[l];f.fn.apply(f.context,d)}else{var s=f.length,v;for(l=0;l<s;l++)switch(f[l].once&&this.removeListener(D,f[l].fn,void 0,!0),m){case 1:f[l].fn.call(f[l].context);break;case 2:f[l].fn.call(f[l].context,R);break;case 3:f[l].fn.call(f[l].context,R,L);break;case 4:f[l].fn.call(f[l].context,R,L,T);break;default:if(!d)for(v=1,d=new Array(m-1);v<m;v++)d[v-1]=arguments[v];f[l].fn.apply(f[l].context,d)}}return!0},x.prototype.on=function(D,R,L){return y(this,D,R,L,!1)},x.prototype.once=function(D,R,L){return y(this,D,R,L,!0)},x.prototype.removeListener=function(D,R,L,T){var S=n?n+D:D;if(!this._events[S])return this;if(!R)return I(this,S),this;var c=this._events[S];if(c.fn)c.fn===R&&(!T||c.once)&&(!L||c.context===L)&&I(this,S);else{for(var i=0,f=[],m=c.length;i<m;i++)(c[i].fn!==R||T&&!c[i].once||L&&c[i].context!==L)&&f.push(c[i]);f.length?this._events[S]=f.length===1?f[0]:f:I(this,S)}return this},x.prototype.removeAllListeners=function(D){var R;return D?(R=n?n+D:D,this._events[R]&&I(this,R)):(this._events=new u,this._eventsCount=0),this},x.prototype.off=x.prototype.removeListener,x.prototype.addListener=x.prototype.on,x.prefixed=n,x.EventEmitter=x,r.exports=x},"./node_modules/url-toolkit/src/url-toolkit.js":function(r,t,e){(function(a){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,u=/^(?=([^\/?#]*))\1([^]*)$/,M=/(?:\/|^)\.(?=\/)/g,y=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,I={buildAbsoluteURL:function(x,A,D){if(D=D||{},x=x.trim(),A=A.trim(),!A){if(!D.alwaysNormalize)return x;var R=I.parseURL(x);if(!R)throw new Error("Error trying to parse base URL.");return R.path=I.normalizePath(R.path),I.buildURLFromParts(R)}var L=I.parseURL(A);if(!L)throw new Error("Error trying to parse relative URL.");if(L.scheme)return D.alwaysNormalize?(L.path=I.normalizePath(L.path),I.buildURLFromParts(L)):A;var T=I.parseURL(x);if(!T)throw new Error("Error trying to parse base URL.");if(!T.netLoc&&T.path&&T.path[0]!=="/"){var S=u.exec(T.path);T.netLoc=S[1],T.path=S[2]}T.netLoc&&!T.path&&(T.path="/");var c={scheme:T.scheme,netLoc:L.netLoc,path:null,params:L.params,query:L.query,fragment:L.fragment};if(!L.netLoc&&(c.netLoc=T.netLoc,L.path[0]!=="/"))if(!L.path)c.path=T.path,L.params||(c.params=T.params,L.query||(c.query=T.query));else{var i=T.path,f=i.substring(0,i.lastIndexOf("/")+1)+L.path;c.path=I.normalizePath(f)}return c.path===null&&(c.path=D.alwaysNormalize?I.normalizePath(L.path):L.path),I.buildURLFromParts(c)},parseURL:function(x){var A=n.exec(x);return A?{scheme:A[1]||"",netLoc:A[2]||"",path:A[3]||"",params:A[4]||"",query:A[5]||"",fragment:A[6]||""}:null},normalizePath:function(x){for(x=x.split("").reverse().join("").replace(M,"");x.length!==(x=x.replace(y,"")).length;);return x.split("").reverse().join("")},buildURLFromParts:function(x){return x.scheme+x.netLoc+x.path+x.params+x.query+x.fragment}};r.exports=I})(this)},"./node_modules/webworkify-webpack/index.js":function(r,t,e){function a(D){var R={};function L(S){if(R[S])return R[S].exports;var c=R[S]={i:S,l:!1,exports:{}};return D[S].call(c.exports,c,c.exports,L),c.l=!0,c.exports}L.m=D,L.c=R,L.i=function(S){return S},L.d=function(S,c,i){L.o(S,c)||Object.defineProperty(S,c,{configurable:!1,enumerable:!0,get:i})},L.r=function(S){Object.defineProperty(S,"__esModule",{value:!0})},L.n=function(S){var c=S&&S.__esModule?function(){return S.default}:function(){return S};return L.d(c,"a",c),c},L.o=function(S,c){return Object.prototype.hasOwnProperty.call(S,c)},L.p="/",L.oe=function(S){throw console.error(S),S};var T=L(L.s=ENTRY_MODULE);return T.default||T}var n="[\\.|\\-|\\+|\\w|/|@]+",u="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+n+").*?\\)";function M(D){return(D+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function y(D){return!isNaN(1*D)}function I(D,R,L){var T={};T[L]=[];var S=R.toString(),c=S.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!c)return T;for(var i=c[1],f=new RegExp("(\\\\n|\\W)"+M(i)+u,"g"),m;m=f.exec(S);)m[3]!=="dll-reference"&&T[L].push(m[3]);for(f=new RegExp("\\("+M(i)+'\\("(dll-reference\\s('+n+'))"\\)\\)'+u,"g");m=f.exec(S);)D[m[2]]||(T[L].push(m[1]),D[m[2]]=e(m[1]).m),T[m[2]]=T[m[2]]||[],T[m[2]].push(m[4]);for(var d=Object.keys(T),l=0;l<d.length;l++)for(var s=0;s<T[d[l]].length;s++)y(T[d[l]][s])&&(T[d[l]][s]=1*T[d[l]][s]);return T}function x(D){var R=Object.keys(D);return R.reduce(function(L,T){return L||D[T].length>0},!1)}function A(D,R){for(var L={main:[R]},T={main:[]},S={main:{}};x(L);)for(var c=Object.keys(L),i=0;i<c.length;i++){var f=c[i],m=L[f],d=m.pop();if(S[f]=S[f]||{},!(S[f][d]||!D[f][d])){S[f][d]=!0,T[f]=T[f]||[],T[f].push(d);for(var l=I(D,D[f][d],f),s=Object.keys(l),v=0;v<s.length;v++)L[s[v]]=L[s[v]]||[],L[s[v]]=L[s[v]].concat(l[s[v]])}}return T}r.exports=function(D,R){R=R||{};var L={main:e.m},T=R.all?{main:Object.keys(L.main)}:A(L,D),S="";Object.keys(T).filter(function(d){return d!=="main"}).forEach(function(d){for(var l=0;T[d][l];)l++;T[d].push(l),L[d][l]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",S=S+"var "+d+" = ("+a.toString().replace("ENTRY_MODULE",JSON.stringify(l))+")({"+T[d].map(function(s){return""+JSON.stringify(s)+": "+L[d][s].toString()}).join(",")+`});
|
|
6
|
+
`))this.processLine(this.buffer.substring(0,d)),this.buffer=this.buffer.substring(d+1)},A.prototype.processLine=function(m){var d=m.indexOf(":"),l=i(m,d),s=l[0],v=l.length===2?L(l[1]):void 0;if(s[0]!=="#")this.currentUri.uri=s,this.manifest.segments.push(this.currentUri),!this.manifest.targetDuration||"duration"in this.currentUri||(this.currentUri.duration=this.manifest.targetDuration),this.currentUri={};else switch(s){case x.TARGET_DURATION:if(!isFinite(v)||v<0)return;this.manifest.targetDuration=v,this.setHoldBack();break;case x.PART_INF:D(this.manifest,l),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),this.setHoldBack();break;case x.SERVER_CONTROL:D(this.manifest,l),this.setHoldBack();break;case x.INF:v===0?this.currentUri.duration=.01:v>0&&(this.currentUri.duration=v);break;case x.PROGRAM_DATE_TIME:var p=v,o=new Date(p);this.manifest.dateTimeString||(this.manifest.dateTimeString=p,this.manifest.dateTimeObject=o),this.currentUri.dateTimeString=p,this.currentUri.dateTimeObject=o;break;case x.VERSION:D(this.manifest,l);break;case x.SESSION_DATA:var E=f(l[1]),g=(0,I.default)(E);(0,M.default)(this.manifest.sessionData,g)}},A.prototype.setHoldBack=function(){var m=this.manifest,d=m.serverControl,l=m.targetDuration,s=m.partTargetDuration;if(d){var v="holdBack",p="partHoldBack",o=l&&3*l,E=s&&2*s;l&&!d.hasOwnProperty(v)&&(d[v]=o),o&&d[v]<o&&(d[v]=o),s&&!d.hasOwnProperty(p)&&(d[p]=3*s),s&&d[p]<E&&(d[p]=E)}};var D=function(m,d){var l=R(d[0].replace("#EXT-X-","")),s=void 0;c(d[1])?(s={},s=(0,M.default)(S(d[1]),s)):s=L(d[1]),m[l]=s},R=function(m){return m.toLowerCase().replace(/-(\w)/g,function(d){return d[1].toUpperCase()})},L=function(m){if(m.toLowerCase()==="yes"||m.toLowerCase()==="no")return m.toLowerCase()==="yes";var d=m.indexOf(":")!==-1?m:parseFloat(m);return isNaN(d)?m:d},T=function(m){var d={},l=m.split("=");return l.length>1&&(d[R(l[0])]=L(l[1])),d},S=function(m){for(var d=m.split(","),l={},s=0;d.length>s;s++){var v=d[s],p=T(v);l=(0,M.default)(p,l)}return l},c=function(m){return m.indexOf("=")>-1},i=function(m,d){return d===-1?[m]:[m.substring(0,d),m.substring(d+1)]},f=function(m){var d={};if(m){var l=m.search(",");return[m.slice(0,l),m.slice(l+1)].forEach(function(s,v){for(var p=s.replace(/['"]+/g,"").split("="),o=0;o<p.length;o++)p[o]==="DATA-ID"&&(d["DATA-ID"]=p[1-o]),p[o]==="VALUE"&&(d.VALUE=p[1-o])}),{data:d}}};e.default=A},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={PLAYER_READY:"playerready",VIEW_INIT:"viewinit",VIDEO_CHANGE:"videochange",PLAY:"play",PAUSE:"pause",PLAYING:"playing",TIME_UPDATE:"timeupdate",SEEKING:"seeking",SEEKED:"seeked",REBUFFER_START:"rebufferstart",REBUFFER_END:"rebufferend",ERROR:"error",ENDED:"ended",RENDITION_CHANGE:"renditionchange",ORIENTATION_CHANGE:"orientationchange",AD_REQUEST:"adrequest",AD_RESPONSE:"adresponse",AD_BREAK_START:"adbreakstart",AD_PLAY:"adplay",AD_PLAYING:"adplaying",AD_PAUSE:"adpause",AD_FIRST_QUARTILE:"adfirstquartile",AD_MID_POINT:"admidpoint",AD_THIRD_QUARTILE:"adthirdquartile",AD_ENDED:"adended",AD_BREAK_END:"adbreakend",AD_ERROR:"aderror",REQUEST_COMPLETED:"requestcompleted",REQUEST_FAILED:"requestfailed",REQUEST_CANCELLED:"requestcanceled"};e.default=n}])})})()});var Fi=Ya((Yr,ma)=>{typeof window!="undefined"&&function(t,e){typeof Yr=="object"&&typeof ma=="object"?ma.exports=e():typeof define=="function"&&define.amd?define([],e):typeof Yr=="object"?Yr.Hls=e():t.Hls=e()}(Yr,function(){return function(r){var t={};function e(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return r[a].call(n.exports,n,n.exports,e),n.l=!0,n.exports}return e.m=r,e.c=t,e.d=function(a,n,u){e.o(a,n)||Object.defineProperty(a,n,{enumerable:!0,get:u})},e.r=function(a){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},e.t=function(a,n){if(n&1&&(a=e(a)),n&8||n&4&&typeof a=="object"&&a&&a.__esModule)return a;var u=Object.create(null);if(e.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:a}),n&2&&typeof a!="string")for(var M in a)e.d(u,M,function(y){return a[y]}.bind(null,M));return u},e.n=function(a){var n=a&&a.__esModule?function(){return a.default}:function(){return a};return e.d(n,"a",n),n},e.o=function(a,n){return Object.prototype.hasOwnProperty.call(a,n)},e.p="/dist/",e(e.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(r,t,e){"use strict";var a=Object.prototype.hasOwnProperty,n="~";function u(){}Object.create&&(u.prototype=Object.create(null),new u().__proto__||(n=!1));function M(A,D,R){this.fn=A,this.context=D,this.once=R||!1}function y(A,D,R,L,T){if(typeof R!="function")throw new TypeError("The listener must be a function");var S=new M(R,L||A,T),c=n?n+D:D;return A._events[c]?A._events[c].fn?A._events[c]=[A._events[c],S]:A._events[c].push(S):(A._events[c]=S,A._eventsCount++),A}function I(A,D){--A._eventsCount===0?A._events=new u:delete A._events[D]}function x(){this._events=new u,this._eventsCount=0}x.prototype.eventNames=function(){var D=[],R,L;if(this._eventsCount===0)return D;for(L in R=this._events)a.call(R,L)&&D.push(n?L.slice(1):L);return Object.getOwnPropertySymbols?D.concat(Object.getOwnPropertySymbols(R)):D},x.prototype.listeners=function(D){var R=n?n+D:D,L=this._events[R];if(!L)return[];if(L.fn)return[L.fn];for(var T=0,S=L.length,c=new Array(S);T<S;T++)c[T]=L[T].fn;return c},x.prototype.listenerCount=function(D){var R=n?n+D:D,L=this._events[R];return L?L.fn?1:L.length:0},x.prototype.emit=function(D,R,L,T,S,c){var i=n?n+D:D;if(!this._events[i])return!1;var f=this._events[i],m=arguments.length,d,l;if(f.fn){switch(f.once&&this.removeListener(D,f.fn,void 0,!0),m){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,R),!0;case 3:return f.fn.call(f.context,R,L),!0;case 4:return f.fn.call(f.context,R,L,T),!0;case 5:return f.fn.call(f.context,R,L,T,S),!0;case 6:return f.fn.call(f.context,R,L,T,S,c),!0}for(l=1,d=new Array(m-1);l<m;l++)d[l-1]=arguments[l];f.fn.apply(f.context,d)}else{var s=f.length,v;for(l=0;l<s;l++)switch(f[l].once&&this.removeListener(D,f[l].fn,void 0,!0),m){case 1:f[l].fn.call(f[l].context);break;case 2:f[l].fn.call(f[l].context,R);break;case 3:f[l].fn.call(f[l].context,R,L);break;case 4:f[l].fn.call(f[l].context,R,L,T);break;default:if(!d)for(v=1,d=new Array(m-1);v<m;v++)d[v-1]=arguments[v];f[l].fn.apply(f[l].context,d)}}return!0},x.prototype.on=function(D,R,L){return y(this,D,R,L,!1)},x.prototype.once=function(D,R,L){return y(this,D,R,L,!0)},x.prototype.removeListener=function(D,R,L,T){var S=n?n+D:D;if(!this._events[S])return this;if(!R)return I(this,S),this;var c=this._events[S];if(c.fn)c.fn===R&&(!T||c.once)&&(!L||c.context===L)&&I(this,S);else{for(var i=0,f=[],m=c.length;i<m;i++)(c[i].fn!==R||T&&!c[i].once||L&&c[i].context!==L)&&f.push(c[i]);f.length?this._events[S]=f.length===1?f[0]:f:I(this,S)}return this},x.prototype.removeAllListeners=function(D){var R;return D?(R=n?n+D:D,this._events[R]&&I(this,R)):(this._events=new u,this._eventsCount=0),this},x.prototype.off=x.prototype.removeListener,x.prototype.addListener=x.prototype.on,x.prefixed=n,x.EventEmitter=x,r.exports=x},"./node_modules/url-toolkit/src/url-toolkit.js":function(r,t,e){(function(a){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,u=/^(?=([^\/?#]*))\1([^]*)$/,M=/(?:\/|^)\.(?=\/)/g,y=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,I={buildAbsoluteURL:function(x,A,D){if(D=D||{},x=x.trim(),A=A.trim(),!A){if(!D.alwaysNormalize)return x;var R=I.parseURL(x);if(!R)throw new Error("Error trying to parse base URL.");return R.path=I.normalizePath(R.path),I.buildURLFromParts(R)}var L=I.parseURL(A);if(!L)throw new Error("Error trying to parse relative URL.");if(L.scheme)return D.alwaysNormalize?(L.path=I.normalizePath(L.path),I.buildURLFromParts(L)):A;var T=I.parseURL(x);if(!T)throw new Error("Error trying to parse base URL.");if(!T.netLoc&&T.path&&T.path[0]!=="/"){var S=u.exec(T.path);T.netLoc=S[1],T.path=S[2]}T.netLoc&&!T.path&&(T.path="/");var c={scheme:T.scheme,netLoc:L.netLoc,path:null,params:L.params,query:L.query,fragment:L.fragment};if(!L.netLoc&&(c.netLoc=T.netLoc,L.path[0]!=="/"))if(!L.path)c.path=T.path,L.params||(c.params=T.params,L.query||(c.query=T.query));else{var i=T.path,f=i.substring(0,i.lastIndexOf("/")+1)+L.path;c.path=I.normalizePath(f)}return c.path===null&&(c.path=D.alwaysNormalize?I.normalizePath(L.path):L.path),I.buildURLFromParts(c)},parseURL:function(x){var A=n.exec(x);return A?{scheme:A[1]||"",netLoc:A[2]||"",path:A[3]||"",params:A[4]||"",query:A[5]||"",fragment:A[6]||""}:null},normalizePath:function(x){for(x=x.split("").reverse().join("").replace(M,"");x.length!==(x=x.replace(y,"")).length;);return x.split("").reverse().join("")},buildURLFromParts:function(x){return x.scheme+x.netLoc+x.path+x.params+x.query+x.fragment}};r.exports=I})(this)},"./node_modules/webworkify-webpack/index.js":function(r,t,e){function a(D){var R={};function L(S){if(R[S])return R[S].exports;var c=R[S]={i:S,l:!1,exports:{}};return D[S].call(c.exports,c,c.exports,L),c.l=!0,c.exports}L.m=D,L.c=R,L.i=function(S){return S},L.d=function(S,c,i){L.o(S,c)||Object.defineProperty(S,c,{configurable:!1,enumerable:!0,get:i})},L.r=function(S){Object.defineProperty(S,"__esModule",{value:!0})},L.n=function(S){var c=S&&S.__esModule?function(){return S.default}:function(){return S};return L.d(c,"a",c),c},L.o=function(S,c){return Object.prototype.hasOwnProperty.call(S,c)},L.p="/",L.oe=function(S){throw console.error(S),S};var T=L(L.s=ENTRY_MODULE);return T.default||T}var n="[\\.|\\-|\\+|\\w|/|@]+",u="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+n+").*?\\)";function M(D){return(D+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function y(D){return!isNaN(1*D)}function I(D,R,L){var T={};T[L]=[];var S=R.toString(),c=S.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!c)return T;for(var i=c[1],f=new RegExp("(\\\\n|\\W)"+M(i)+u,"g"),m;m=f.exec(S);)m[3]!=="dll-reference"&&T[L].push(m[3]);for(f=new RegExp("\\("+M(i)+'\\("(dll-reference\\s('+n+'))"\\)\\)'+u,"g");m=f.exec(S);)D[m[2]]||(T[L].push(m[1]),D[m[2]]=e(m[1]).m),T[m[2]]=T[m[2]]||[],T[m[2]].push(m[4]);for(var d=Object.keys(T),l=0;l<d.length;l++)for(var s=0;s<T[d[l]].length;s++)y(T[d[l]][s])&&(T[d[l]][s]=1*T[d[l]][s]);return T}function x(D){var R=Object.keys(D);return R.reduce(function(L,T){return L||D[T].length>0},!1)}function A(D,R){for(var L={main:[R]},T={main:[]},S={main:{}};x(L);)for(var c=Object.keys(L),i=0;i<c.length;i++){var f=c[i],m=L[f],d=m.pop();if(S[f]=S[f]||{},!(S[f][d]||!D[f][d])){S[f][d]=!0,T[f]=T[f]||[],T[f].push(d);for(var l=I(D,D[f][d],f),s=Object.keys(l),v=0;v<s.length;v++)L[s[v]]=L[s[v]]||[],L[s[v]]=L[s[v]].concat(l[s[v]])}}return T}r.exports=function(D,R){R=R||{};var L={main:e.m},T=R.all?{main:Object.keys(L.main)}:A(L,D),S="";Object.keys(T).filter(function(d){return d!=="main"}).forEach(function(d){for(var l=0;T[d][l];)l++;T[d].push(l),L[d][l]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",S=S+"var "+d+" = ("+a.toString().replace("ENTRY_MODULE",JSON.stringify(l))+")({"+T[d].map(function(s){return""+JSON.stringify(s)+": "+L[d][s].toString()}).join(",")+`});
|
|
7
7
|
`}),S=S+"new (("+a.toString().replace("ENTRY_MODULE",JSON.stringify(D))+")({"+T.main.map(function(d){return""+JSON.stringify(d)+": "+L.main[d].toString()}).join(",")+"}))(self);";var c=new window.Blob([S],{type:"text/javascript"});if(R.bare)return c;var i=window.URL||window.webkitURL||window.mozURL||window.msURL,f=i.createObjectURL(c),m=new window.Worker(f);return m.objectURL=f,m}},"./src/config.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"hlsDefaultConfig",function(){return v}),e.d(t,"mergeConfig",function(){return o}),e.d(t,"enableStreamingMode",function(){return E});var a=e("./src/controller/abr-controller.ts"),n=e("./src/controller/audio-stream-controller.ts"),u=e("./src/controller/audio-track-controller.ts"),M=e("./src/controller/subtitle-stream-controller.ts"),y=e("./src/controller/subtitle-track-controller.ts"),I=e("./src/controller/buffer-controller.ts"),x=e("./src/controller/timeline-controller.ts"),A=e("./src/controller/cap-level-controller.ts"),D=e("./src/controller/fps-controller.ts"),R=e("./src/controller/eme-controller.ts"),L=e("./src/controller/cmcd-controller.ts"),T=e("./src/utils/xhr-loader.ts"),S=e("./src/utils/fetch-loader.ts"),c=e("./src/utils/cues.ts"),i=e("./src/utils/mediakeys-helper.ts"),f=e("./src/utils/logger.ts");function m(){return m=Object.assign?Object.assign.bind():function(g){for(var h=1;h<arguments.length;h++){var b=arguments[h];for(var _ in b)Object.prototype.hasOwnProperty.call(b,_)&&(g[_]=b[_])}return g},m.apply(this,arguments)}function d(g,h){var b=Object.keys(g);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(g);h&&(_=_.filter(function(O){return Object.getOwnPropertyDescriptor(g,O).enumerable})),b.push.apply(b,_)}return b}function l(g){for(var h=1;h<arguments.length;h++){var b=arguments[h]!=null?arguments[h]:{};h%2?d(Object(b),!0).forEach(function(_){s(g,_,b[_])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(b)):d(Object(b)).forEach(function(_){Object.defineProperty(g,_,Object.getOwnPropertyDescriptor(b,_))})}return g}function s(g,h,b){return h in g?Object.defineProperty(g,h,{value:b,enumerable:!0,configurable:!0,writable:!0}):g[h]=b,g}var v=l(l({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:T.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:a.default,bufferController:I.default,capLevelController:A.default,fpsController:D.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:i.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0},p()),{},{subtitleStreamController:M.SubtitleStreamController,subtitleTrackController:y.default,timelineController:x.TimelineController,audioStreamController:n.default,audioTrackController:u.default,emeController:R.default,cmcdController:L.default});function p(){return{cueHandler:c.default,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function o(g,h){if((h.liveSyncDurationCount||h.liveMaxLatencyDurationCount)&&(h.liveSyncDuration||h.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(h.liveMaxLatencyDurationCount!==void 0&&(h.liveSyncDurationCount===void 0||h.liveMaxLatencyDurationCount<=h.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(h.liveMaxLatencyDuration!==void 0&&(h.liveSyncDuration===void 0||h.liveMaxLatencyDuration<=h.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return m({},g,h)}function E(g){var h=g.loader;if(h!==S.default&&h!==T.default)f.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),g.progressive=!1;else{var b=Object(S.fetchSupported)();b&&(g.loader=S.default,g.progressive=!0,g.enableSoftwareAES=!0,f.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(r,t,e){"use strict";e.r(t);var a=e("./src/polyfills/number.ts"),n=e("./src/utils/ewma-bandwidth-estimator.ts"),u=e("./src/events.ts"),M=e("./src/utils/buffer-helper.ts"),y=e("./src/errors.ts"),I=e("./src/types/loader.ts"),x=e("./src/utils/logger.ts");function A(L,T){for(var S=0;S<T.length;S++){var c=T[S];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(L,c.key,c)}}function D(L,T,S){return T&&A(L.prototype,T),S&&A(L,S),Object.defineProperty(L,"prototype",{writable:!1}),L}var R=function(){function L(S){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=S;var c=S.config;this.bwEstimator=new n.default(c.abrEwmaSlowVoD,c.abrEwmaFastVoD,c.abrEwmaDefaultEstimate),this.registerListeners()}var T=L.prototype;return T.registerListeners=function(){var c=this.hls;c.on(u.Events.FRAG_LOADING,this.onFragLoading,this),c.on(u.Events.FRAG_LOADED,this.onFragLoaded,this),c.on(u.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.on(u.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(u.Events.ERROR,this.onError,this)},T.unregisterListeners=function(){var c=this.hls;c.off(u.Events.FRAG_LOADING,this.onFragLoading,this),c.off(u.Events.FRAG_LOADED,this.onFragLoaded,this),c.off(u.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.off(u.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(u.Events.ERROR,this.onError,this)},T.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},T.onFragLoading=function(c,i){var f=i.frag;if(f.type===I.PlaylistLevelType.MAIN&&!this.timer){var m;this.fragCurrent=f,this.partCurrent=(m=i.part)!=null?m:null,this.timer=self.setInterval(this.onCheck,100)}},T.onLevelLoaded=function(c,i){var f=this.hls.config;i.details.live?this.bwEstimator.update(f.abrEwmaSlowLive,f.abrEwmaFastLive):this.bwEstimator.update(f.abrEwmaSlowVoD,f.abrEwmaFastVoD)},T._abandonRulesCheck=function(){var c=this.fragCurrent,i=this.partCurrent,f=this.hls,m=f.autoLevelEnabled,d=f.config,l=f.media;if(!(!c||!l)){var s=i?i.stats:c.stats,v=i?i.duration:c.duration;if(s.aborted){x.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!(!m||l.paused||!l.playbackRate||!l.readyState)){var p=performance.now()-s.loading.start,o=Math.abs(l.playbackRate);if(!(p<=500*v/o)){var E=f.levels,g=f.minAutoLevel,h=E[c.level],b=s.total||Math.max(s.loaded,Math.round(v*h.maxBitrate/8)),_=Math.max(1,s.bwEstimate?s.bwEstimate/8:s.loaded*1e3/p),O=(b-s.loaded)/_,C=l.currentTime,P=(M.BufferHelper.bufferInfo(l,C,d.maxBufferHole).end-C)/o;if(!(P>=2*v/o||O<=P)){var w=Number.POSITIVE_INFINITY,U;for(U=c.level-1;U>g;U--){var k=E[U].maxBitrate;if(w=v*k/(8*.8*_),w<P)break}if(!(w>=O)){var N=this.bwEstimator.getEstimate();x.logger.warn("Fragment "+c.sn+(i?" part "+i.index:"")+" of level "+c.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+U+`
|
|
8
8
|
Current BW estimate: `+(Object(a.isFiniteNumber)(N)?(N/1024).toFixed(3):"Unknown")+` Kb/s
|
|
9
9
|
Estimated load time for current fragment: `+O.toFixed(3)+` s
|
|
@@ -15,7 +15,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
15
15
|
contiguous: `+W+`
|
|
16
16
|
accurateTimeOffset: `+p+`
|
|
17
17
|
timeOffset: `+C+`
|
|
18
|
-
initSegmentChange: `+j);var Y=new M.TransmuxConfig(m,d,f,v,E);this.configureTransmuxer(Y)}if(this.frag=l,this.part=s,O)O.postMessage({cmd:"demux",data:i,decryptdata:P,chunkMeta:o,state:V},i instanceof ArrayBuffer?[i]:[]);else if(_){var Q=_.push(i,P,o,V);Object(M.isPromise)(Q)?Q.then(function(J){b.handleTransmuxComplete(J)}):this.handleTransmuxComplete(Q)}},S.flush=function(i){var f=this;i.transmuxing.start=self.performance.now();var m=this.transmuxer,d=this.worker;if(d)d.postMessage({cmd:"flush",chunkMeta:i});else if(m){var l=m.flush(i);Object(M.isPromise)(l)?l.then(function(s){f.handleFlushResult(s,i)}):this.handleFlushResult(l,i)}},S.handleFlushResult=function(i,f){var m=this;i.forEach(function(d){m.handleTransmuxComplete(d)}),this.onFlush(f)},S.onWorkerMessage=function(i){var f=i.data,m=this.hls;switch(f.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(f.data);break}case"flush":{this.onFlush(f.data);break}case"workerLog":y.logger[f.data.logType]&&y.logger[f.data.logType](f.data.message);break;default:{f.data=f.data||{},f.data.frag=this.frag,f.data.id=this.id,m.trigger(f.event,f.data);break}}},S.configureTransmuxer=function(i){var f=this.worker,m=this.transmuxer;f?f.postMessage({cmd:"configure",config:i}):m&&m.configure(i)},S.handleTransmuxComplete=function(i){i.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(i)},T}()},"./src/demux/transmuxer-worker.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"default",function(){return I});var a=e("./src/demux/transmuxer.ts"),n=e("./src/events.ts"),u=e("./src/utils/logger.ts"),M=e("./node_modules/eventemitter3/index.js"),y=e.n(M);function I(L){var T=new M.EventEmitter,S=function(f,m){L.postMessage({event:f,data:m})};T.on(n.Events.FRAG_DECRYPTED,S),T.on(n.Events.ERROR,S);var c=function(){var f=function(l){var s=function(p){S("workerLog",{logType:l,message:p})};u.logger[l]=s};for(var m in u.logger)f(m)};L.addEventListener("message",function(i){var f=i.data;switch(f.cmd){case"init":{var m=JSON.parse(f.config);L.transmuxer=new a.default(T,f.typeSupported,m,f.vendor,f.id),Object(u.enableLogs)(m.debug),c(),S("init",null);break}case"configure":{L.transmuxer.configure(f.config);break}case"demux":{var d=L.transmuxer.push(f.data,f.decryptdata,f.chunkMeta,f.state);Object(a.isPromise)(d)?d.then(function(v){x(L,v)}):x(L,d);break}case"flush":{var l=f.chunkMeta,s=L.transmuxer.flush(l);Object(a.isPromise)(s)?s.then(function(v){D(L,v,l)}):D(L,s,l);break}default:break}})}function x(L,T){if(R(T.remuxResult))return!1;var S=[],c=T.remuxResult,i=c.audio,f=c.video;return i&&A(S,i),f&&A(S,f),L.postMessage({event:"transmuxComplete",data:T},S),!0}function A(L,T){T.data1&&L.push(T.data1.buffer),T.data2&&L.push(T.data2.buffer)}function D(L,T,S){var c=T.reduce(function(i,f){return x(L,f)||i},!1);c||L.postMessage({event:"transmuxComplete",data:T[0]}),L.postMessage({event:"flush",data:S})}function R(L){return!L.audio&&!L.video&&!L.text&&!L.id3&&!L.initSegment}},"./src/demux/transmuxer.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"default",function(){return S}),e.d(t,"isPromise",function(){return f}),e.d(t,"TransmuxConfig",function(){return m}),e.d(t,"TransmuxState",function(){return d});var a=e("./src/events.ts"),n=e("./src/errors.ts"),u=e("./src/crypt/decrypter.ts"),M=e("./src/demux/aacdemuxer.ts"),y=e("./src/demux/mp4demuxer.ts"),I=e("./src/demux/tsdemuxer.ts"),x=e("./src/demux/mp3demuxer.ts"),A=e("./src/remux/mp4-remuxer.ts"),D=e("./src/remux/passthrough-remuxer.ts"),R=e("./src/utils/logger.ts"),L;try{L=self.performance.now.bind(self.performance)}catch{R.logger.debug("Unable to use Performance API on this environment"),L=self.Date.now}var T=[{demux:I.default,remux:A.default},{demux:y.default,remux:D.default},{demux:M.default,remux:A.default},{demux:x.default,remux:A.default}],S=function(){function l(v,p,o,E,g){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=v,this.typeSupported=p,this.config=o,this.vendor=E,this.id=g}var s=l.prototype;return s.configure=function(p){this.transmuxConfig=p,this.decrypter&&this.decrypter.reset()},s.push=function(p,o,E,g){var h=this,b=E.transmuxing;b.executeStart=L();var _=new Uint8Array(p),O=this.config,C=this.currentTransmuxState,P=this.transmuxConfig;g&&(this.currentTransmuxState=g);var w=g||C,U=w.contiguous,k=w.discontinuity,N=w.trackSwitch,F=w.accurateTimeOffset,H=w.timeOffset,W=w.initSegmentChange,B=P.audioCodec,j=P.videoCodec,V=P.defaultInitPts,Y=P.duration,Q=P.initSegmentData;(k||N||W)&&this.resetInitSegment(Q,B,j,Y),(k||W)&&this.resetInitialTimestamp(V),U||this.resetContiguity();var J=c(_,o);if(J&&J.method==="AES-128"){var z=this.getDecrypter();if(O.enableSoftwareAES){var te=z.softwareDecrypt(_,J.key.buffer,J.iv.buffer);if(!te)return b.executeEnd=L(),i(E);_=new Uint8Array(te)}else return this.decryptionPromise=z.webCryptoDecrypt(_,J.key.buffer,J.iv.buffer).then(function(Ee){var fe=h.push(Ee,null,E);return h.decryptionPromise=null,fe}),this.decryptionPromise}this.needsProbing(_,k,N)&&this.configureTransmuxer(_,P);var se=this.transmux(_,J,H,F,E),Z=this.currentTransmuxState;return Z.contiguous=!0,Z.discontinuity=!1,Z.trackSwitch=!1,b.executeEnd=L(),se},s.flush=function(p){var o=this,E=p.transmuxing;E.executeStart=L();var g=this.decrypter,h=this.currentTransmuxState,b=this.decryptionPromise;if(b)return b.then(function(){return o.flush(p)});var _=[],O=h.timeOffset;if(g){var C=g.flush();C&&_.push(this.push(C,null,p))}var P=this.demuxer,w=this.remuxer;if(!P||!w)return this.observer.emit(a.Events.ERROR,a.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),E.executeEnd=L(),[i(p)];var U=P.flush(O);return f(U)?U.then(function(k){return o.flushRemux(_,k,p),_}):(this.flushRemux(_,U,p),_)},s.flushRemux=function(p,o,E){var g=o.audioTrack,h=o.videoTrack,b=o.id3Track,_=o.textTrack,O=this.currentTransmuxState,C=O.accurateTimeOffset,P=O.timeOffset;R.logger.log("[transmuxer.ts]: Flushed fragment "+E.sn+(E.part>-1?" p: "+E.part:"")+" of level "+E.level);var w=this.remuxer.remux(g,h,b,_,P,C,!0,this.id);p.push({remuxResult:w,chunkMeta:E}),E.transmuxing.executeEnd=L()},s.resetInitialTimestamp=function(p){var o=this.demuxer,E=this.remuxer;!o||!E||(o.resetTimeStamp(p),E.resetTimeStamp(p))},s.resetContiguity=function(){var p=this.demuxer,o=this.remuxer;!p||!o||(p.resetContiguity(),o.resetNextTimestamp())},s.resetInitSegment=function(p,o,E,g){var h=this.demuxer,b=this.remuxer;!h||!b||(h.resetInitSegment(p,o,E,g),b.resetInitSegment(p,o,E))},s.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},s.transmux=function(p,o,E,g,h){var b;return o&&o.method==="SAMPLE-AES"?b=this.transmuxSampleAes(p,o,E,g,h):b=this.transmuxUnencrypted(p,E,g,h),b},s.transmuxUnencrypted=function(p,o,E,g){var h=this.demuxer.demux(p,o,!1,!this.config.progressive),b=h.audioTrack,_=h.videoTrack,O=h.id3Track,C=h.textTrack,P=this.remuxer.remux(b,_,O,C,o,E,!1,this.id);return{remuxResult:P,chunkMeta:g}},s.transmuxSampleAes=function(p,o,E,g,h){var b=this;return this.demuxer.demuxSampleAes(p,o,E).then(function(_){var O=b.remuxer.remux(_.audioTrack,_.videoTrack,_.id3Track,_.textTrack,E,g,!1,b.id);return{remuxResult:O,chunkMeta:h}})},s.configureTransmuxer=function(p,o){for(var E=this.config,g=this.observer,h=this.typeSupported,b=this.vendor,_=o.audioCodec,O=o.defaultInitPts,C=o.duration,P=o.initSegmentData,w=o.videoCodec,U,k=0,N=T.length;k<N;k++)if(T[k].demux.probe(p)){U=T[k];break}U||(R.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),U={demux:y.default,remux:D.default});var F=this.demuxer,H=this.remuxer,W=U.remux,B=U.demux;(!H||!(H instanceof W))&&(this.remuxer=new W(g,E,h,b)),(!F||!(F instanceof B))&&(this.demuxer=new B(g,E,h),this.probe=B.probe),this.resetInitSegment(P,_,w,C),this.resetInitialTimestamp(O)},s.needsProbing=function(p,o,E){return!this.demuxer||!this.remuxer||o||E},s.getDecrypter=function(){var p=this.decrypter;return p||(p=this.decrypter=new u.default(this.observer,this.config)),p},l}();function c(l,s){var v=null;return l.byteLength>0&&s!=null&&s.key!=null&&s.iv!==null&&s.method!=null&&(v=s),v}var i=function(s){return{remuxResult:{},chunkMeta:s}};function f(l){return"then"in l&&l.then instanceof Function}var m=function(s,v,p,o,E){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=s,this.videoCodec=v,this.initSegmentData=p,this.duration=o,this.defaultInitPts=E},d=function(s,v,p,o,E,g){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=s,this.contiguous=v,this.accurateTimeOffset=p,this.trackSwitch=o,this.timeOffset=E,this.initSegmentChange=g}},"./src/demux/tsdemuxer.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"discardEPB",function(){return m});var a=e("./src/demux/adts.ts"),n=e("./src/demux/mpegaudio.ts"),u=e("./src/demux/exp-golomb.ts"),M=e("./src/demux/sample-aes.ts"),y=e("./src/events.ts"),I=e("./src/utils/mp4-tools.ts"),x=e("./src/utils/logger.ts"),A=e("./src/errors.ts"),D=e("./src/types/demuxer.ts");function R(){return R=Object.assign?Object.assign.bind():function(d){for(var l=1;l<arguments.length;l++){var s=arguments[l];for(var v in s)Object.prototype.hasOwnProperty.call(s,v)&&(d[v]=s[v])}return d},R.apply(this,arguments)}var L=function(){function d(s,v,p){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=s,this.config=v,this.typeSupported=p}d.probe=function(v){return v[0]===71&&v[188]===71},d.createTrack=function(v,p){return{container:v==="video"||v==="audio"?"video/mp2t":void 0,type:v,id:I.RemuxerTrackIdConfig[v],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:v==="audio"?p:void 0}};var l=d.prototype;return l.resetInitSegment=function(v,p,o,E){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=d.createTrack("video"),this._audioTrack=d.createTrack("audio",E),this._id3Track=d.createTrack("id3"),this._txtTrack=d.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.audioCodec=p,this.videoCodec=o,this._duration=E},l.resetTimeStamp=function(){},l.resetContiguity=function(){var v=this._audioTrack,p=this._avcTrack,o=this._id3Track;v&&(v.pesData=null),p&&(p.pesData=null),o&&(o.pesData=null),this.aacOverFlow=null},l.demux=function(v,p,o,E){o===void 0&&(o=!1),E===void 0&&(E=!1),o||(this.sampleAes=null);var g,h=this._avcTrack,b=this._audioTrack,_=this._id3Track,O=this._txtTrack,C=h.pid,P=h.pesData,w=b.pid,U=_.pid,k=b.pesData,N=_.pesData,F=null,H=this.pmtParsed,W=this._pmtId,B=v.length;if(this.remainderData&&(v=Object(I.appendUint8Array)(this.remainderData,v),B=v.length,this.remainderData=null),B<188&&!E)return this.remainderData=v,{audioTrack:b,videoTrack:h,id3Track:_,textTrack:O};B-=B%188,B<v.byteLength&&!E&&(this.remainderData=new Uint8Array(v.buffer,B,v.buffer.byteLength-B));for(var j=0,V=0;V<B;V+=188)if(v[V]===71){var Y=!!(v[V+1]&64),Q=((v[V+1]&31)<<8)+v[V+2],J=(v[V+3]&48)>>4,z=void 0;if(J>1){if(z=V+5+v[V+4],z===V+188)continue}else z=V+4;switch(Q){case C:Y&&(P&&(g=i(P))&&this.parseAVCPES(h,O,g,!1),P={data:[],size:0}),P&&(P.data.push(v.subarray(z,V+188)),P.size+=V+188-z);break;case w:if(Y){if(k&&(g=i(k)))switch(b.segmentCodec){case"aac":this.parseAACPES(b,g);break;case"mp3":this.parseMPEGPES(b,g);break}k={data:[],size:0}}k&&(k.data.push(v.subarray(z,V+188)),k.size+=V+188-z);break;case U:Y&&(N&&(g=i(N))&&this.parseID3PES(_,g),N={data:[],size:0}),N&&(N.data.push(v.subarray(z,V+188)),N.size+=V+188-z);break;case 0:Y&&(z+=v[z]+1),W=this._pmtId=S(v,z);break;case W:{Y&&(z+=v[z]+1);var te=c(v,z,this.typeSupported,o);C=te.avc,C>0&&(h.pid=C),w=te.audio,w>0&&(b.pid=w,b.segmentCodec=te.segmentCodec),U=te.id3,U>0&&(_.pid=U),F!==null&&!H&&(x.logger.log("unknown PID '"+F+"' in TS found"),F=null),H=this.pmtParsed=!0;break}case 17:case 8191:break;default:F=Q;break}}else j++;j>0&&this.observer.emit(y.Events.ERROR,y.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"Found "+j+" TS packet/s that do not start with 0x47"}),h.pesData=P,b.pesData=k,_.pesData=N;var se={audioTrack:b,videoTrack:h,id3Track:_,textTrack:O};return E&&this.extractRemainingSamples(se),se},l.flush=function(){var v=this.remainderData;this.remainderData=null;var p;return v?p=this.demux(v,-1,!1,!0):p={videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(p),this.sampleAes?this.decrypt(p,this.sampleAes):p},l.extractRemainingSamples=function(v){var p=v.audioTrack,o=v.videoTrack,E=v.id3Track,g=v.textTrack,h=o.pesData,b=p.pesData,_=E.pesData,O;if(h&&(O=i(h))?(this.parseAVCPES(o,g,O,!0),o.pesData=null):o.pesData=h,b&&(O=i(b))){switch(p.segmentCodec){case"aac":this.parseAACPES(p,O);break;case"mp3":this.parseMPEGPES(p,O);break}p.pesData=null}else b!=null&&b.size&&x.logger.log("last AAC PES packet truncated,might overlap between fragments"),p.pesData=b;_&&(O=i(_))?(this.parseID3PES(E,O),E.pesData=null):E.pesData=_},l.demuxSampleAes=function(v,p,o){var E=this.demux(v,o,!0,!this.config.progressive),g=this.sampleAes=new M.default(this.observer,this.config,p);return this.decrypt(E,g)},l.decrypt=function(v,p){return new Promise(function(o){var E=v.audioTrack,g=v.videoTrack;E.samples&&E.segmentCodec==="aac"?p.decryptAacSamples(E.samples,0,function(){g.samples?p.decryptAvcSamples(g.samples,0,0,function(){o(v)}):o(v)}):g.samples&&p.decryptAvcSamples(g.samples,0,0,function(){o(v)})})},l.destroy=function(){this._duration=0},l.parseAVCPES=function(v,p,o,E){var g=this,h=this.parseAVCNALu(v,o.data),b=!1,_=this.avcSample,O,C=!1;o.data=null,_&&h.length&&!v.audFound&&(f(_,v),_=this.avcSample=T(!1,o.pts,o.dts,"")),h.forEach(function(P){switch(P.type){case 1:{O=!0,_||(_=g.avcSample=T(!0,o.pts,o.dts,"")),b&&(_.debug+="NDR "),_.frame=!0;var w=P.data;if(C&&w.length>4){var U=new u.default(w).readSliceType();(U===2||U===4||U===7||U===9)&&(_.key=!0)}break}case 5:O=!0,_||(_=g.avcSample=T(!0,o.pts,o.dts,"")),b&&(_.debug+="IDR "),_.key=!0,_.frame=!0;break;case 6:{O=!0,b&&_&&(_.debug+="SEI "),Object(I.parseSEIMessageFromNALu)(m(P.data),o.pts,p.samples);break}case 7:if(O=!0,C=!0,b&&_&&(_.debug+="SPS "),!v.sps){var k=new u.default(P.data),N=k.readSPS();v.width=N.width,v.height=N.height,v.pixelRatio=N.pixelRatio,v.sps=[P.data],v.duration=g._duration;for(var F=P.data.subarray(1,4),H="avc1.",W=0;W<3;W++){var B=F[W].toString(16);B.length<2&&(B="0"+B),H+=B}v.codec=H}break;case 8:O=!0,b&&_&&(_.debug+="PPS "),v.pps||(v.pps=[P.data]);break;case 9:O=!1,v.audFound=!0,_&&f(_,v),_=g.avcSample=T(!1,o.pts,o.dts,b?"AUD ":"");break;case 12:O=!0;break;default:O=!1,_&&(_.debug+="unknown NAL "+P.type+" ");break}if(_&&O){var j=_.units;j.push(P)}}),E&&_&&(f(_,v),this.avcSample=null)},l.getLastNalUnit=function(v){var p,o=this.avcSample,E;if((!o||o.units.length===0)&&(o=v[v.length-1]),(p=o)!==null&&p!==void 0&&p.units){var g=o.units;E=g[g.length-1]}return E},l.parseAVCNALu=function(v,p){var o=p.byteLength,E=v.naluState||0,g=E,h=[],b=0,_,O,C,P=-1,w=0;for(E===-1&&(P=0,w=p[0]&31,E=0,b=1);b<o;){if(_=p[b++],!E){E=_?0:1;continue}if(E===1){E=_?0:2;continue}if(!_)E=3;else if(_===1){if(P>=0){var U={data:p.subarray(P,b-E-1),type:w};h.push(U)}else{var k=this.getLastNalUnit(v.samples);if(k&&(g&&b<=4-g&&k.state&&(k.data=k.data.subarray(0,k.data.byteLength-g)),O=b-E-1,O>0)){var N=new Uint8Array(k.data.byteLength+O);N.set(k.data,0),N.set(p.subarray(0,O),k.data.byteLength),k.data=N,k.state=0}}b<o?(C=p[b]&31,P=b,w=C,E=0):E=-1}else E=0}if(P>=0&&E>=0){var F={data:p.subarray(P,o),type:w,state:E};h.push(F)}if(h.length===0){var H=this.getLastNalUnit(v.samples);if(H){var W=new Uint8Array(H.data.byteLength+p.byteLength);W.set(H.data,0),W.set(p,H.data.byteLength),H.data=W}}return v.naluState=E,h},l.parseAACPES=function(v,p){var o=0,E=this.aacOverFlow,g=p.data;if(E){this.aacOverFlow=null;var h=E.missing,b=E.sample.unit.byteLength;if(h===-1){var _=new Uint8Array(b+g.byteLength);_.set(E.sample.unit,0),_.set(g,b),g=_}else{var O=b-h;E.sample.unit.set(g.subarray(0,h),O),v.samples.push(E.sample),o=E.missing}}var C,P;for(C=o,P=g.length;C<P-1&&!a.isHeader(g,C);C++);if(C!==o){var w,U;if(C<P-1?(w="AAC PES did not start with ADTS header,offset:"+C,U=!1):(w="no ADTS header found in AAC PES",U=!0),x.logger.warn("parsing error:"+w),this.observer.emit(y.Events.ERROR,y.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.FRAG_PARSING_ERROR,fatal:U,reason:w}),U)return}a.initTrackConfig(v,this.observer,g,C,this.audioCodec);var k;if(p.pts!==void 0)k=p.pts;else if(E){var N=a.getFrameDuration(v.samplerate);k=E.sample.pts+N}else{x.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var F=0,H;C<P;)if(H=a.appendFrame(v,g,C,k,F),C+=H.length,H.missing){this.aacOverFlow=H;break}else for(F++;C<P-1&&!a.isHeader(g,C);C++);},l.parseMPEGPES=function(v,p){var o=p.data,E=o.length,g=0,h=0,b=p.pts;if(b===void 0){x.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;h<E;)if(n.isHeader(o,h)){var _=n.appendFrame(v,o,h,b,g);if(_)h+=_.length,g++;else break}else h++},l.parseID3PES=function(v,p){if(p.pts===void 0){x.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}var o=R({},p,{type:this._avcTrack?D.MetadataSchema.emsg:D.MetadataSchema.audioId3});v.samples.push(o)},d}();function T(d,l,s,v){return{key:d,frame:!1,pts:l,dts:s,units:[],debug:v,length:0}}function S(d,l){return(d[l+10]&31)<<8|d[l+11]}function c(d,l,s,v){var p={audio:-1,avc:-1,id3:-1,segmentCodec:"aac"},o=(d[l+1]&15)<<8|d[l+2],E=l+3+o-4,g=(d[l+10]&15)<<8|d[l+11];for(l+=12+g;l<E;){var h=(d[l+1]&31)<<8|d[l+2];switch(d[l]){case 207:if(!v){x.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:p.audio===-1&&(p.audio=h);break;case 21:p.id3===-1&&(p.id3=h);break;case 219:if(!v){x.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:p.avc===-1&&(p.avc=h);break;case 3:case 4:s.mpeg!==!0&&s.mp3!==!0?x.logger.log("MPEG audio found, not supported in this browser"):p.audio===-1&&(p.audio=h,p.segmentCodec="mp3");break;case 36:x.logger.warn("Unsupported HEVC stream type found");break;default:break}l+=((d[l+3]&15)<<8|d[l+4])+5}return p}function i(d){var l=0,s,v,p,o,E,g=d.data;if(!d||d.size===0)return null;for(;g[0].length<19&&g.length>1;){var h=new Uint8Array(g[0].length+g[1].length);h.set(g[0]),h.set(g[1],g[0].length),g[0]=h,g.splice(1,1)}s=g[0];var b=(s[0]<<16)+(s[1]<<8)+s[2];if(b===1){if(v=(s[4]<<8)+s[5],v&&v>d.size-6)return null;var _=s[7];_&192&&(o=(s[9]&14)*536870912+(s[10]&255)*4194304+(s[11]&254)*16384+(s[12]&255)*128+(s[13]&254)/2,_&64?(E=(s[14]&14)*536870912+(s[15]&255)*4194304+(s[16]&254)*16384+(s[17]&255)*128+(s[18]&254)/2,o-E>60*9e4&&(x.logger.warn(Math.round((o-E)/9e4)+"s delta between PTS and DTS, align them"),o=E)):E=o),p=s[8];var O=p+9;if(d.size<=O)return null;d.size-=O;for(var C=new Uint8Array(d.size),P=0,w=g.length;P<w;P++){s=g[P];var U=s.byteLength;if(O)if(O>U){O-=U;continue}else s=s.subarray(O),U-=O,O=0;C.set(s,l),l+=U}return v&&(v-=p+3),{data:C,pts:o,dts:E,len:v}}return null}function f(d,l){if(d.units.length&&d.frame){if(d.pts===void 0){var s=l.samples,v=s.length;if(v){var p=s[v-1];d.pts=p.pts,d.dts=p.dts}else{l.dropped++;return}}l.samples.push(d)}d.debug.length&&x.logger.log(d.pts+"/"+d.dts+":"+d.debug)}function m(d){for(var l=d.byteLength,s=[],v=1;v<l-2;)d[v]===0&&d[v+1]===0&&d[v+2]===3?(s.push(v+2),v+=2):v++;if(s.length===0)return d;var p=l-s.length,o=new Uint8Array(p),E=0;for(v=0;v<p;E++,v++)E===s[0]&&(E++,s.shift()),o[v]=d[E];return o}t.default=L},"./src/errors.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"ErrorTypes",function(){return a}),e.d(t,"ErrorDetails",function(){return n});var a;(function(u){u.NETWORK_ERROR="networkError",u.MEDIA_ERROR="mediaError",u.KEY_SYSTEM_ERROR="keySystemError",u.MUX_ERROR="muxError",u.OTHER_ERROR="otherError"})(a||(a={}));var n;(function(u){u.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",u.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",u.KEY_SYSTEM_NO_SESSION="keySystemNoSession",u.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",u.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",u.MANIFEST_LOAD_ERROR="manifestLoadError",u.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",u.MANIFEST_PARSING_ERROR="manifestParsingError",u.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",u.LEVEL_EMPTY_ERROR="levelEmptyError",u.LEVEL_LOAD_ERROR="levelLoadError",u.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",u.LEVEL_SWITCH_ERROR="levelSwitchError",u.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",u.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",u.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",u.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",u.FRAG_LOAD_ERROR="fragLoadError",u.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",u.FRAG_DECRYPT_ERROR="fragDecryptError",u.FRAG_PARSING_ERROR="fragParsingError",u.REMUX_ALLOC_ERROR="remuxAllocError",u.KEY_LOAD_ERROR="keyLoadError",u.KEY_LOAD_TIMEOUT="keyLoadTimeOut",u.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",u.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",u.BUFFER_APPEND_ERROR="bufferAppendError",u.BUFFER_APPENDING_ERROR="bufferAppendingError",u.BUFFER_STALLED_ERROR="bufferStalledError",u.BUFFER_FULL_ERROR="bufferFullError",u.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",u.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",u.INTERNAL_EXCEPTION="internalException",u.INTERNAL_ABORTED="aborted",u.UNKNOWN="unknown"})(n||(n={}))},"./src/events.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"Events",function(){return a});var a;(function(n){n.MEDIA_ATTACHING="hlsMediaAttaching",n.MEDIA_ATTACHED="hlsMediaAttached",n.MEDIA_DETACHING="hlsMediaDetaching",n.MEDIA_DETACHED="hlsMediaDetached",n.BUFFER_RESET="hlsBufferReset",n.BUFFER_CODECS="hlsBufferCodecs",n.BUFFER_CREATED="hlsBufferCreated",n.BUFFER_APPENDING="hlsBufferAppending",n.BUFFER_APPENDED="hlsBufferAppended",n.BUFFER_EOS="hlsBufferEos",n.BUFFER_FLUSHING="hlsBufferFlushing",n.BUFFER_FLUSHED="hlsBufferFlushed",n.MANIFEST_LOADING="hlsManifestLoading",n.MANIFEST_LOADED="hlsManifestLoaded",n.MANIFEST_PARSED="hlsManifestParsed",n.LEVEL_SWITCHING="hlsLevelSwitching",n.LEVEL_SWITCHED="hlsLevelSwitched",n.LEVEL_LOADING="hlsLevelLoading",n.LEVEL_LOADED="hlsLevelLoaded",n.LEVEL_UPDATED="hlsLevelUpdated",n.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",n.LEVELS_UPDATED="hlsLevelsUpdated",n.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",n.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",n.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",n.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",n.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",n.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",n.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",n.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",n.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",n.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",n.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",n.CUES_PARSED="hlsCuesParsed",n.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",n.INIT_PTS_FOUND="hlsInitPtsFound",n.FRAG_LOADING="hlsFragLoading",n.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",n.FRAG_LOADED="hlsFragLoaded",n.FRAG_DECRYPTED="hlsFragDecrypted",n.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",n.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",n.FRAG_PARSING_METADATA="hlsFragParsingMetadata",n.FRAG_PARSED="hlsFragParsed",n.FRAG_BUFFERED="hlsFragBuffered",n.FRAG_CHANGED="hlsFragChanged",n.FPS_DROP="hlsFpsDrop",n.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",n.ERROR="hlsError",n.DESTROYING="hlsDestroying",n.KEY_LOADING="hlsKeyLoading",n.KEY_LOADED="hlsKeyLoaded",n.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",n.BACK_BUFFER_REACHED="hlsBackBufferReached"})(a||(a={}))},"./src/hls.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"default",function(){return l});var a=e("./node_modules/url-toolkit/src/url-toolkit.js"),n=e.n(a),u=e("./src/loader/playlist-loader.ts"),M=e("./src/loader/key-loader.ts"),y=e("./src/controller/id3-track-controller.ts"),I=e("./src/controller/latency-controller.ts"),x=e("./src/controller/level-controller.ts"),A=e("./src/controller/fragment-tracker.ts"),D=e("./src/controller/stream-controller.ts"),R=e("./src/is-supported.ts"),L=e("./src/utils/logger.ts"),T=e("./src/config.ts"),S=e("./node_modules/eventemitter3/index.js"),c=e.n(S),i=e("./src/events.ts"),f=e("./src/errors.ts");function m(s,v){for(var p=0;p<v.length;p++){var o=v[p];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(s,o.key,o)}}function d(s,v,p){return v&&m(s.prototype,v),p&&m(s,p),Object.defineProperty(s,"prototype",{writable:!1}),s}var l=function(){s.isSupported=function(){return Object(R.isSupported)()};function s(p){p===void 0&&(p={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new S.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var o=this.config=Object(T.mergeConfig)(s.DefaultConfig,p);this.userConfig=p,Object(L.enableLogs)(o.debug),this._autoLevelCapping=-1,o.progressive&&Object(T.enableStreamingMode)(o);var E=o.abrController,g=o.bufferController,h=o.capLevelController,b=o.fpsController,_=this.abrController=new E(this),O=this.bufferController=new g(this),C=this.capLevelController=new h(this),P=new b(this),w=new u.default(this),U=new M.default(this),k=new y.default(this),N=this.levelController=new x.default(this),F=new A.FragmentTracker(this),H=this.streamController=new D.default(this,F);C.setStreamController(H),P.setStreamController(H);var W=[w,U,N,H];this.networkControllers=W;var B=[_,O,C,P,k,F];this.audioTrackController=this.createController(o.audioTrackController,null,W),this.createController(o.audioStreamController,F,W),this.subtitleTrackController=this.createController(o.subtitleTrackController,null,W),this.createController(o.subtitleStreamController,F,W),this.createController(o.timelineController,null,B),this.emeController=this.createController(o.emeController,null,B),this.cmcdController=this.createController(o.cmcdController,null,B),this.latencyController=this.createController(I.default,null,B),this.coreComponents=B}var v=s.prototype;return v.createController=function(o,E,g){if(o){var h=E?new o(this,E):new o(this);return g&&g.push(h),h}return null},v.on=function(o,E,g){g===void 0&&(g=this),this._emitter.on(o,E,g)},v.once=function(o,E,g){g===void 0&&(g=this),this._emitter.once(o,E,g)},v.removeAllListeners=function(o){this._emitter.removeAllListeners(o)},v.off=function(o,E,g,h){g===void 0&&(g=this),this._emitter.off(o,E,g,h)},v.listeners=function(o){return this._emitter.listeners(o)},v.emit=function(o,E,g){return this._emitter.emit(o,E,g)},v.trigger=function(o,E){if(this.config.debug)return this.emit(o,o,E);try{return this.emit(o,o,E)}catch(g){L.logger.error("An internal error happened while handling event "+o+'. Error message: "'+g.message+'". Here is a stacktrace:',g),this.trigger(i.Events.ERROR,{type:f.ErrorTypes.OTHER_ERROR,details:f.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:o,error:g})}return!1},v.listenerCount=function(o){return this._emitter.listenerCount(o)},v.destroy=function(){L.logger.log("destroy"),this.trigger(i.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(o){return o.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(o){return o.destroy()}),this.coreComponents.length=0},v.attachMedia=function(o){L.logger.log("attachMedia"),this._media=o,this.trigger(i.Events.MEDIA_ATTACHING,{media:o})},v.detachMedia=function(){L.logger.log("detachMedia"),this.trigger(i.Events.MEDIA_DETACHING,void 0),this._media=null},v.loadSource=function(o){this.stopLoad();var E=this.media,g=this.url,h=this.url=a.buildAbsoluteURL(self.location.href,o,{alwaysNormalize:!0});L.logger.log("loadSource:"+h),E&&g&&g!==h&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(E)),this.trigger(i.Events.MANIFEST_LOADING,{url:o})},v.startLoad=function(o){o===void 0&&(o=-1),L.logger.log("startLoad("+o+")"),this.networkControllers.forEach(function(E){E.startLoad(o)})},v.stopLoad=function(){L.logger.log("stopLoad"),this.networkControllers.forEach(function(o){o.stopLoad()})},v.swapAudioCodec=function(){L.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},v.recoverMediaError=function(){L.logger.log("recoverMediaError");var o=this._media;this.detachMedia(),o&&this.attachMedia(o)},v.removeLevel=function(o,E){E===void 0&&(E=0),this.levelController.removeLevel(o,E)},d(s,[{key:"levels",get:function(){var o=this.levelController.levels;return o||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(o){L.logger.log("set currentLevel:"+o),this.loadLevel=o,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(o){L.logger.log("set nextLevel:"+o),this.levelController.manualLevel=o,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(o){L.logger.log("set loadLevel:"+o),this.levelController.manualLevel=o}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(o){this.levelController.nextLoadLevel=o}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(o){L.logger.log("set firstLevel:"+o),this.levelController.firstLevel=o}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(o){L.logger.log("set startLevel:"+o),o!==-1&&(o=Math.max(o,this.minAutoLevel)),this.levelController.startLevel=o}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(o){var E=!!o;E!==this.config.capLevelToPlayerSize&&(E?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=E)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(o){this._autoLevelCapping!==o&&(L.logger.log("set autoLevelCapping:"+o),this._autoLevelCapping=o)}},{key:"bandwidthEstimate",get:function(){var o=this.abrController.bwEstimator;return o?o.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var o=this.levels,E=this.config.minAutoBitrate;if(!o)return 0;for(var g=o.length,h=0;h<g;h++)if(o[h].maxBitrate>=E)return h;return 0}},{key:"maxAutoLevel",get:function(){var o=this.levels,E=this.autoLevelCapping,g;return E===-1&&o&&o.length?g=o.length-1:g=E,g}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(o){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,o)}},{key:"playingDate",get:function(){return this.streamController.currentProgramDateTime}},{key:"audioTracks",get:function(){var o=this.audioTrackController;return o?o.audioTracks:[]}},{key:"audioTrack",get:function(){var o=this.audioTrackController;return o?o.audioTrack:-1},set:function(o){var E=this.audioTrackController;E&&(E.audioTrack=o)}},{key:"subtitleTracks",get:function(){var o=this.subtitleTrackController;return o?o.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var o=this.subtitleTrackController;return o?o.subtitleTrack:-1},set:function(o){var E=this.subtitleTrackController;E&&(E.subtitleTrack=o)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var o=this.subtitleTrackController;return o?o.subtitleDisplay:!1},set:function(o){var E=this.subtitleTrackController;E&&(E.subtitleDisplay=o)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(o){this.config.lowLatencyMode=o}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.2.3"}},{key:"Events",get:function(){return i.Events}},{key:"ErrorTypes",get:function(){return f.ErrorTypes}},{key:"ErrorDetails",get:function(){return f.ErrorDetails}},{key:"DefaultConfig",get:function(){return s.defaultConfig?s.defaultConfig:T.hlsDefaultConfig},set:function(o){s.defaultConfig=o}}]),s}();l.defaultConfig=void 0},"./src/is-supported.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"isSupported",function(){return u}),e.d(t,"changeTypeSupported",function(){return M});var a=e("./src/utils/mediasource-helper.ts");function n(){return self.SourceBuffer||self.WebKitSourceBuffer}function u(){var y=Object(a.getMediaSource)();if(!y)return!1;var I=n(),x=y&&typeof y.isTypeSupported=="function"&&y.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),A=!I||I.prototype&&typeof I.prototype.appendBuffer=="function"&&typeof I.prototype.remove=="function";return!!x&&!!A}function M(){var y,I=n();return typeof(I==null||(y=I.prototype)===null||y===void 0?void 0:y.changeType)=="function"}},"./src/loader/date-range.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"DateRangeAttribute",function(){return x}),e.d(t,"DateRange",function(){return A});var a=e("./src/polyfills/number.ts"),n=e("./src/utils/attr-list.ts"),u=e("./src/utils/logger.ts");function M(){return M=Object.assign?Object.assign.bind():function(D){for(var R=1;R<arguments.length;R++){var L=arguments[R];for(var T in L)Object.prototype.hasOwnProperty.call(L,T)&&(D[T]=L[T])}return D},M.apply(this,arguments)}function y(D,R){for(var L=0;L<R.length;L++){var T=R[L];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(D,T.key,T)}}function I(D,R,L){return R&&y(D.prototype,R),L&&y(D,L),Object.defineProperty(D,"prototype",{writable:!1}),D}var x;(function(D){D.ID="ID",D.CLASS="CLASS",D.START_DATE="START-DATE",D.DURATION="DURATION",D.END_DATE="END-DATE",D.END_ON_NEXT="END-ON-NEXT",D.PLANNED_DURATION="PLANNED-DURATION",D.SCTE35_OUT="SCTE35-OUT",D.SCTE35_IN="SCTE35-IN"})(x||(x={}));var A=function(){function D(R,L){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,L){var T=L.attr;for(var S in T)if(Object.prototype.hasOwnProperty.call(R,S)&&R[S]!==T[S]){u.logger.warn('DATERANGE tag attribute: "'+S+'" does not match for tags with ID: "'+R.ID+'"'),this._badValueForSameId=S;break}R=M(new n.AttrList({}),T,R)}if(this.attr=R,this._startDate=new Date(R[x.START_DATE]),x.END_DATE in this.attr){var c=new Date(this.attr[x.END_DATE]);Object(a.isFiniteNumber)(c.getTime())&&(this._endDate=c)}}return I(D,[{key:"id",get:function(){return this.attr.ID}},{key:"class",get:function(){return this.attr.CLASS}},{key:"startDate",get:function(){return this._startDate}},{key:"endDate",get:function(){if(this._endDate)return this._endDate;var L=this.duration;return L!==null?new Date(this._startDate.getTime()+L*1e3):null}},{key:"duration",get:function(){if(x.DURATION in this.attr){var L=this.attr.decimalFloatingPoint(x.DURATION);if(Object(a.isFiniteNumber)(L))return L}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}},{key:"plannedDuration",get:function(){return x.PLANNED_DURATION in this.attr?this.attr.decimalFloatingPoint(x.PLANNED_DURATION):null}},{key:"endOnNext",get:function(){return this.attr.bool(x.END_ON_NEXT)}},{key:"isValid",get:function(){return!!this.id&&!this._badValueForSameId&&Object(a.isFiniteNumber)(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}]),D}()},"./src/loader/fragment-loader.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"default",function(){return L}),e.d(t,"LoadError",function(){return S});var a=e("./src/polyfills/number.ts"),n=e("./src/errors.ts");function u(c,i){c.prototype=Object.create(i.prototype),c.prototype.constructor=c,A(c,i)}function M(c){var i=typeof Map=="function"?new Map:void 0;return M=function(m){if(m===null||!x(m))return m;if(typeof m!="function")throw new TypeError("Super expression must either be null or a function");if(typeof i!="undefined"){if(i.has(m))return i.get(m);i.set(m,d)}function d(){return y(m,arguments,D(this).constructor)}return d.prototype=Object.create(m.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),A(d,m)},M(c)}function y(c,i,f){return I()?y=Reflect.construct.bind():y=function(d,l,s){var v=[null];v.push.apply(v,l);var p=Function.bind.apply(d,v),o=new p;return s&&A(o,s.prototype),o},y.apply(null,arguments)}function I(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function x(c){return Function.toString.call(c).indexOf("[native code]")!==-1}function A(c,i){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(m,d){return m.__proto__=d,m},A(c,i)}function D(c){return D=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(f){return f.__proto__||Object.getPrototypeOf(f)},D(c)}var R=Math.pow(2,17),L=function(){function c(f){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=f}var i=c.prototype;return i.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},i.abort=function(){this.loader&&this.loader.abort()},i.load=function(m,d){var l=this,s=m.url;if(!s)return Promise.reject(new S({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:m,networkDetails:null},"Fragment does not have a "+(s?"part list":"url")));this.abort();var v=this.config,p=v.fLoader,o=v.loader;return new Promise(function(E,g){l.loader&&l.loader.destroy();var h=l.loader=m.loader=p?new p(v):new o(v),b=T(m),_={timeout:v.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:v.fragLoadingMaxRetryTimeout,highWaterMark:m.sn==="initSegment"?1/0:R};m.stats=h.stats,h.load(b,_,{onSuccess:function(C,P,w,U){l.resetLoader(m,h),E({frag:m,part:null,payload:C.data,networkDetails:U})},onError:function(C,P,w){l.resetLoader(m,h),g(new S({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:m,response:C,networkDetails:w}))},onAbort:function(C,P,w){l.resetLoader(m,h),g(new S({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:m,networkDetails:w}))},onTimeout:function(C,P,w){l.resetLoader(m,h),g(new S({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:m,networkDetails:w}))},onProgress:function(C,P,w,U){d&&d({frag:m,part:null,payload:w,networkDetails:U})}})})},i.loadPart=function(m,d,l){var s=this;this.abort();var v=this.config,p=v.fLoader,o=v.loader;return new Promise(function(E,g){s.loader&&s.loader.destroy();var h=s.loader=m.loader=p?new p(v):new o(v),b=T(m,d),_={timeout:v.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:v.fragLoadingMaxRetryTimeout,highWaterMark:R};d.stats=h.stats,h.load(b,_,{onSuccess:function(C,P,w,U){s.resetLoader(m,h),s.updateStatsFromPart(m,d);var k={frag:m,part:d,payload:C.data,networkDetails:U};l(k),E(k)},onError:function(C,P,w){s.resetLoader(m,h),g(new S({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:m,part:d,response:C,networkDetails:w}))},onAbort:function(C,P,w){m.stats.aborted=d.stats.aborted,s.resetLoader(m,h),g(new S({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:m,part:d,networkDetails:w}))},onTimeout:function(C,P,w){s.resetLoader(m,h),g(new S({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:m,part:d,networkDetails:w}))}})})},i.updateStatsFromPart=function(m,d){var l=m.stats,s=d.stats,v=s.total;if(l.loaded+=s.loaded,v){var p=Math.round(m.duration/d.duration),o=Math.min(Math.round(l.loaded/v),p),E=p-o,g=E*Math.round(l.loaded/o);l.total=l.loaded+g}else l.total=Math.max(l.loaded,l.total);var h=l.loading,b=s.loading;h.start?h.first+=b.first-b.start:(h.start=b.start,h.first=b.first),h.end=b.end},i.resetLoader=function(m,d){m.loader=null,this.loader===d&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),d.destroy()},c}();function T(c,i){i===void 0&&(i=null);var f=i||c,m={frag:c,part:i,responseType:"arraybuffer",url:f.url,headers:{},rangeStart:0,rangeEnd:0},d=f.byteRangeStartOffset,l=f.byteRangeEndOffset;return Object(a.isFiniteNumber)(d)&&Object(a.isFiniteNumber)(l)&&(m.rangeStart=d,m.rangeEnd=l),m}var S=function(c){u(i,c);function i(f){for(var m,d=arguments.length,l=new Array(d>1?d-1:0),s=1;s<d;s++)l[s-1]=arguments[s];return m=c.call.apply(c,[this].concat(l))||this,m.data=void 0,m.data=f,m}return i}(M(Error))},"./src/loader/fragment.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"ElementaryStreamTypes",function(){return L}),e.d(t,"BaseSegment",function(){return T}),e.d(t,"Fragment",function(){return S}),e.d(t,"Part",function(){return c});var a=e("./src/polyfills/number.ts"),n=e("./node_modules/url-toolkit/src/url-toolkit.js"),u=e.n(n),M=e("./src/utils/logger.ts"),y=e("./src/loader/level-key.ts"),I=e("./src/loader/load-stats.ts");function x(i,f){i.prototype=Object.create(f.prototype),i.prototype.constructor=i,A(i,f)}function A(i,f){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,l){return d.__proto__=l,d},A(i,f)}function D(i,f){for(var m=0;m<f.length;m++){var d=f[m];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(i,d.key,d)}}function R(i,f,m){return f&&D(i.prototype,f),m&&D(i,m),Object.defineProperty(i,"prototype",{writable:!1}),i}var L;(function(i){i.AUDIO="audio",i.VIDEO="video",i.AUDIOVIDEO="audiovideo"})(L||(L={}));var T=function(){function i(m){var d;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(d={},d[L.AUDIO]=null,d[L.VIDEO]=null,d[L.AUDIOVIDEO]=null,d),this.baseurl=m}var f=i.prototype;return f.setByteRange=function(d,l){var s=d.split("@",2),v=[];s.length===1?v[0]=l?l.byteRangeEndOffset:0:v[0]=parseInt(s[1]),v[1]=parseInt(s[0])+v[0],this._byteRange=v},R(i,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(n.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(d){this._url=d}}]),i}(),S=function(i){x(f,i);function f(d,l){var s;return s=i.call(this,l)||this,s._decryptdata=null,s.rawProgramDateTime=null,s.programDateTime=null,s.tagList=[],s.duration=0,s.sn=0,s.levelkey=void 0,s.type=void 0,s.loader=null,s.level=-1,s.cc=0,s.startPTS=void 0,s.endPTS=void 0,s.appendedPTS=void 0,s.startDTS=void 0,s.endDTS=void 0,s.start=0,s.deltaPTS=void 0,s.maxStartPTS=void 0,s.minEndPTS=void 0,s.stats=new I.LoadStats,s.urlId=0,s.data=void 0,s.bitrateTest=!1,s.title=null,s.initSegment=null,s.type=d,s}var m=f.prototype;return m.createInitializationVector=function(l){for(var s=new Uint8Array(16),v=12;v<16;v++)s[v]=l>>8*(15-v)&255;return s},m.setDecryptDataFromLevelKey=function(l,s){var v=l;return(l==null?void 0:l.method)==="AES-128"&&l.uri&&!l.iv&&(v=y.LevelKey.fromURI(l.uri),v.method=l.method,v.iv=this.createInitializationVector(s),v.keyFormat="identity"),v},m.setElementaryStreamInfo=function(l,s,v,p,o,E){E===void 0&&(E=!1);var g=this.elementaryStreams,h=g[l];if(!h){g[l]={startPTS:s,endPTS:v,startDTS:p,endDTS:o,partial:E};return}h.startPTS=Math.min(h.startPTS,s),h.endPTS=Math.max(h.endPTS,v),h.startDTS=Math.min(h.startDTS,p),h.endDTS=Math.max(h.endDTS,o)},m.clearElementaryStreamInfo=function(){var l=this.elementaryStreams;l[L.AUDIO]=null,l[L.VIDEO]=null,l[L.AUDIOVIDEO]=null},R(f,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var l=this.sn;typeof l!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&M.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),l=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,l)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null||!Object(a.isFiniteNumber)(this.programDateTime))return null;var l=Object(a.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+l*1e3}},{key:"encrypted",get:function(){var l;return!!((l=this.decryptdata)!==null&&l!==void 0&&l.keyFormat&&this.decryptdata.uri)}}]),f}(T),c=function(i){x(f,i);function f(m,d,l,s,v){var p;p=i.call(this,l)||this,p.fragOffset=0,p.duration=0,p.gap=!1,p.independent=!1,p.relurl=void 0,p.fragment=void 0,p.index=void 0,p.stats=new I.LoadStats,p.duration=m.decimalFloatingPoint("DURATION"),p.gap=m.bool("GAP"),p.independent=m.bool("INDEPENDENT"),p.relurl=m.enumeratedString("URI"),p.fragment=d,p.index=s;var o=m.enumeratedString("BYTERANGE");return o&&p.setByteRange(o,v),v&&(p.fragOffset=v.fragOffset+v.duration),p}return R(f,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var d=this.elementaryStreams;return!!(d.audio||d.video||d.audiovideo)}}]),f}(T)},"./src/loader/key-loader.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"default",function(){return M});var a=e("./src/events.ts"),n=e("./src/errors.ts"),u=e("./src/utils/logger.ts"),M=function(){function y(x){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=x,this.registerListeners()}var I=y.prototype;return I.startLoad=function(A){},I.stopLoad=function(){this.destroyInternalLoaders()},I.registerListeners=function(){this.hls.on(a.Events.KEY_LOADING,this.onKeyLoading,this)},I.unregisterListeners=function(){this.hls.off(a.Events.KEY_LOADING,this.onKeyLoading)},I.destroyInternalLoaders=function(){for(var A in this.loaders){var D=this.loaders[A];D&&D.destroy()}this.loaders={}},I.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},I.onKeyLoading=function(A,D){var R=D.frag,L=R.type,T=this.loaders[L];if(!R.decryptdata){u.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var S=R.decryptdata.uri;if(S!==this.decrypturl||this.decryptkey===null){var c=this.hls.config;if(T&&(u.logger.warn("abort previous key loader for type:"+L),T.abort()),!S){u.logger.warn("key uri is falsy");return}var i=c.loader,f=R.loader=this.loaders[L]=new i(c);this.decrypturl=S,this.decryptkey=null;var m={url:S,frag:R,responseType:"arraybuffer"},d={timeout:c.fragLoadingTimeOut,maxRetry:0,retryDelay:c.fragLoadingRetryDelay,maxRetryDelay:c.fragLoadingMaxRetryTimeout,highWaterMark:0},l={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};f.load(m,d,l)}else this.decryptkey&&(R.decryptdata.key=this.decryptkey,this.hls.trigger(a.Events.KEY_LOADED,{frag:R}))},I.loadsuccess=function(A,D,R){var L=R.frag;if(!L.decryptdata){u.logger.error("after key load, decryptdata unset");return}this.decryptkey=L.decryptdata.key=new Uint8Array(A.data),L.loader=null,delete this.loaders[L.type],this.hls.trigger(a.Events.KEY_LOADED,{frag:L})},I.loaderror=function(A,D){var R=D.frag,L=R.loader;L&&L.abort(),delete this.loaders[R.type],this.hls.trigger(a.Events.ERROR,{type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:R,response:A})},I.loadtimeout=function(A,D){var R=D.frag,L=R.loader;L&&L.abort(),delete this.loaders[R.type],this.hls.trigger(a.Events.ERROR,{type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:R})},y}()},"./src/loader/level-details.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"LevelDetails",function(){return y});var a=e("./src/polyfills/number.ts");function n(I,x){for(var A=0;A<x.length;A++){var D=x[A];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(I,D.key,D)}}function u(I,x,A){return x&&n(I.prototype,x),A&&n(I,A),Object.defineProperty(I,"prototype",{writable:!1}),I}var M=10,y=function(){function I(A){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.dateRanges={},this.url=A}var x=I.prototype;return x.reloaded=function(D){if(!D){this.advanced=!0,this.updated=!0;return}var R=this.lastPartSn-D.lastPartSn,L=this.lastPartIndex-D.lastPartIndex;this.updated=this.endSN!==D.endSN||!!L||!!R,this.advanced=this.endSN>D.endSN||R>0||R===0&&L>0,this.updated||this.advanced?this.misses=Math.floor(D.misses*.6):this.misses=D.misses+1,this.availabilityDelay=D.availabilityDelay},u(I,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(a.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||M}},{key:"drift",get:function(){var D=this.driftEndTime-this.driftStartTime;if(D>0){var R=this.driftEnd-this.driftStart;return R*1e3/D}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var D;return(D=this.partList)!==null&&D!==void 0&&D.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var D;return(D=this.fragments)!==null&&D!==void 0&&D.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var D;return(D=this.partList)!==null&&D!==void 0&&D.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var D;return(D=this.partList)!==null&&D!==void 0&&D.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),I}()},"./src/loader/level-key.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"LevelKey",function(){return y});var a=e("./node_modules/url-toolkit/src/url-toolkit.js"),n=e.n(a);function u(I,x){for(var A=0;A<x.length;A++){var D=x[A];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(I,D.key,D)}}function M(I,x,A){return x&&u(I.prototype,x),A&&u(I,A),Object.defineProperty(I,"prototype",{writable:!1}),I}var y=function(){I.fromURL=function(A,D){return new I(A,D)},I.fromURI=function(A){return new I(A)};function I(x,A){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,A?this._uri=Object(a.buildAbsoluteURL)(x,A,{alwaysNormalize:!0}):this._uri=x}return M(I,[{key:"uri",get:function(){return this._uri}}]),I}()},"./src/loader/load-stats.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"LoadStats",function(){return a});var a=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"default",function(){return m});var a=e("./src/polyfills/number.ts"),n=e("./node_modules/url-toolkit/src/url-toolkit.js"),u=e.n(n),M=e("./src/loader/date-range.ts"),y=e("./src/loader/fragment.ts"),I=e("./src/loader/level-details.ts"),x=e("./src/loader/level-key.ts"),A=e("./src/utils/attr-list.ts"),D=e("./src/utils/logger.ts"),R=e("./src/utils/codecs.ts"),L=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,T=/#EXT-X-MEDIA:(.*)/g,S=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),c=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),i=/\.(mp4|m4s|m4v|m4a)$/i;function f(o){var E,g;return i.test((E=(g=n.parseURL(o))===null||g===void 0?void 0:g.path)!=null?E:"")}var m=function(){function o(){}return o.findGroup=function(g,h){for(var b=0;b<g.length;b++){var _=g[b];if(_.id===h)return _}},o.convertAVC1ToAVCOTI=function(g){var h=g.split(".");if(h.length>2){var b=h.shift()+".";return b+=parseInt(h.shift()).toString(16),b+=("000"+parseInt(h.shift()).toString(16)).slice(-4),b}return g},o.resolve=function(g,h){return n.buildAbsoluteURL(h,g,{alwaysNormalize:!0})},o.parseMasterPlaylist=function(g,h){var b=[],_={},O=!1;L.lastIndex=0;for(var C;(C=L.exec(g))!=null;)if(C[1]){var P=new A.AttrList(C[1]),w={attrs:P,bitrate:P.decimalInteger("AVERAGE-BANDWIDTH")||P.decimalInteger("BANDWIDTH"),name:P.NAME,url:o.resolve(C[2],h)},U=P.decimalResolution("RESOLUTION");U&&(w.width=U.width,w.height=U.height),d((P.CODECS||"").split(/[ ,]+/).filter(function(N){return N}),w),w.videoCodec&&w.videoCodec.indexOf("avc1")!==-1&&(w.videoCodec=o.convertAVC1ToAVCOTI(w.videoCodec)),b.push(w)}else if(C[3]){var k=new A.AttrList(C[3]);k["DATA-ID"]&&(O=!0,_[k["DATA-ID"]]=k)}return{levels:b,sessionData:O?_:null}},o.parseMasterPlaylistMedia=function(g,h,b,_){_===void 0&&(_=[]);var O,C=[],P=0;for(T.lastIndex=0;(O=T.exec(g))!==null;){var w=new A.AttrList(O[1]);if(w.TYPE===b){var U={attrs:w,bitrate:0,id:P++,groupId:w["GROUP-ID"],instreamId:w["INSTREAM-ID"],name:w.NAME||w.LANGUAGE||"",type:b,default:w.bool("DEFAULT"),autoselect:w.bool("AUTOSELECT"),forced:w.bool("FORCED"),lang:w.LANGUAGE,url:w.URI?o.resolve(w.URI,h):""};if(_.length){var k=o.findGroup(_,U.groupId)||_[0];l(U,k,"audioCodec"),l(U,k,"textCodec")}C.push(U)}}return C},o.parseLevelPlaylist=function(g,h,b,_,O){var C=new I.LevelDetails(h),P=C.fragments,w=null,U=0,k=0,N=0,F=0,H=null,W=new y.Fragment(_,h),B,j,V,Y=-1,Q=!1;for(S.lastIndex=0,C.m3u8=g;(B=S.exec(g))!==null;){Q&&(Q=!1,W=new y.Fragment(_,h),W.start=N,W.sn=U,W.cc=F,W.level=b,w&&(W.initSegment=w,W.rawProgramDateTime=w.rawProgramDateTime,w.rawProgramDateTime=null));var J=B[1];if(J){W.duration=parseFloat(J);var z=(" "+B[2]).slice(1);W.title=z||null,W.tagList.push(z?["INF",J,z]:["INF",J])}else if(B[3])Object(a.isFiniteNumber)(W.duration)&&(W.start=N,V&&(W.levelkey=V),W.sn=U,W.level=b,W.cc=F,W.urlId=O,P.push(W),W.relurl=(" "+B[3]).slice(1),v(W,H),H=W,N+=W.duration,U++,k=0,Q=!0);else if(B[4]){var te=(" "+B[4]).slice(1);H?W.setByteRange(te,H):W.setByteRange(te)}else if(B[5])W.rawProgramDateTime=(" "+B[5]).slice(1),W.tagList.push(["PROGRAM-DATE-TIME",W.rawProgramDateTime]),Y===-1&&(Y=P.length);else{if(B=B[0].match(c),!B){D.logger.warn("No matches on slow regex match for level playlist!");continue}for(j=1;j<B.length&&typeof B[j]=="undefined";j++);var se=(" "+B[j]).slice(1),Z=(" "+B[j+1]).slice(1),Ee=B[j+2]?(" "+B[j+2]).slice(1):"";switch(se){case"PLAYLIST-TYPE":C.type=Z.toUpperCase();break;case"MEDIA-SEQUENCE":U=C.startSN=parseInt(Z);break;case"SKIP":{var fe=new A.AttrList(Z),re=fe.decimalInteger("SKIPPED-SEGMENTS");if(Object(a.isFiniteNumber)(re)){C.skippedSegments=re;for(var q=re;q--;)P.unshift(null);U+=re}var ie=fe.enumeratedString("RECENTLY-REMOVED-DATERANGES");ie&&(C.recentlyRemovedDateranges=ie.split(" "));break}case"TARGETDURATION":C.targetduration=parseFloat(Z);break;case"VERSION":C.version=parseInt(Z);break;case"EXTM3U":break;case"ENDLIST":C.live=!1;break;case"#":(Z||Ee)&&W.tagList.push(Ee?[Z,Ee]:[Z]);break;case"DISCONTINUITY":F++,W.tagList.push(["DIS"]);break;case"GAP":W.tagList.push([se]);break;case"BITRATE":W.tagList.push([se,Z]);break;case"DATERANGE":{var ne=new A.AttrList(Z),Te=new M.DateRange(ne,C.dateRanges[ne.ID]);Te.isValid||C.skippedSegments?C.dateRanges[Te.id]=Te:D.logger.warn('Ignoring invalid DATERANGE tag: "'+Z+'"'),W.tagList.push(["EXT-X-DATERANGE",Z]);break}case"DISCONTINUITY-SEQUENCE":F=parseInt(Z);break;case"KEY":{var Se,he=new A.AttrList(Z),Oe=he.enumeratedString("METHOD"),Ce=he.URI,Ue=he.hexadecimalInteger("IV"),me=he.enumeratedString("KEYFORMATVERSIONS"),Ae=he.enumeratedString("KEYID"),Re=(Se=he.enumeratedString("KEYFORMAT"))!=null?Se:"identity",Ie=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Ie.indexOf(Re)>-1){D.logger.warn("Keyformat "+Re+" is not supported from the manifest");continue}else if(Re!=="identity")continue;Oe&&(V=x.LevelKey.fromURL(h,Ce),Ce&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Oe)>=0&&(V.method=Oe,V.keyFormat=Re,Ae&&(V.keyID=Ae),me&&(V.keyFormatVersions=me),V.iv=Ue));break}case"START":{var Ne=new A.AttrList(Z),je=Ne.decimalFloatingPoint("TIME-OFFSET");Object(a.isFiniteNumber)(je)&&(C.startTimeOffset=je);break}case"MAP":{var Qe=new A.AttrList(Z);if(W.duration){var Fe=new y.Fragment(_,h);p(Fe,Qe,b,V),w=Fe,W.initSegment=w,w.rawProgramDateTime&&!W.rawProgramDateTime&&(W.rawProgramDateTime=w.rawProgramDateTime)}else p(W,Qe,b,V),w=W,Q=!0;break}case"SERVER-CONTROL":{var ke=new A.AttrList(Z);C.canBlockReload=ke.bool("CAN-BLOCK-RELOAD"),C.canSkipUntil=ke.optionalFloat("CAN-SKIP-UNTIL",0),C.canSkipDateRanges=C.canSkipUntil>0&&ke.bool("CAN-SKIP-DATERANGES"),C.partHoldBack=ke.optionalFloat("PART-HOLD-BACK",0),C.holdBack=ke.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var G=new A.AttrList(Z);C.partTarget=G.decimalFloatingPoint("PART-TARGET");break}case"PART":{var $=C.partList;$||($=C.partList=[]);var ye=k>0?$[$.length-1]:void 0,_e=k++,xe=new y.Part(new A.AttrList(Z),W,h,_e,ye);$.push(xe),W.duration+=xe.duration;break}case"PRELOAD-HINT":{var Ke=new A.AttrList(Z);C.preloadHint=Ke;break}case"RENDITION-REPORT":{var ve=new A.AttrList(Z);C.renditionReports=C.renditionReports||[],C.renditionReports.push(ve);break}default:D.logger.warn("line parsed but not handled: "+B);break}}}H&&!H.relurl?(P.pop(),N-=H.duration,C.partList&&(C.fragmentHint=H)):C.partList&&(v(W,H),W.cc=F,C.fragmentHint=W);var Ve=P.length,We=P[0],ze=P[Ve-1];if(N+=C.skippedSegments*C.targetduration,N>0&&Ve&&ze){C.averagetargetduration=N/Ve;var kt=ze.sn;C.endSN=kt!=="initSegment"?kt:0,We&&(C.startCC=We.cc,We.initSegment||C.fragments.every(function(yt){return yt.relurl&&f(yt.relurl)})&&(D.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),W=new y.Fragment(_,h),W.relurl=ze.relurl,W.level=b,W.sn="initSegment",We.initSegment=W,C.needSidxRanges=!0))}else C.endSN=0,C.startCC=0;return C.fragmentHint&&(N+=C.fragmentHint.duration),C.totalduration=N,C.endCC=F,Y>0&&s(P,Y),C},o}();function d(o,E){["video","audio","text"].forEach(function(g){var h=o.filter(function(_){return Object(R.isCodecType)(_,g)});if(h.length){var b=h.filter(function(_){return _.lastIndexOf("avc1",0)===0||_.lastIndexOf("mp4a",0)===0});E[g+"Codec"]=b.length>0?b[0]:h[0],o=o.filter(function(_){return h.indexOf(_)===-1})}}),E.unknownCodecs=o}function l(o,E,g){var h=E[g];h&&(o[g]=h)}function s(o,E){for(var g=o[E],h=E;h--;){var b=o[h];if(!b)return;b.programDateTime=g.programDateTime-b.duration*1e3,g=b}}function v(o,E){o.rawProgramDateTime?o.programDateTime=Date.parse(o.rawProgramDateTime):E!=null&&E.programDateTime&&(o.programDateTime=E.endProgramDateTime),Object(a.isFiniteNumber)(o.programDateTime)||(o.programDateTime=null,o.rawProgramDateTime=null)}function p(o,E,g,h){o.relurl=E.URI,E.BYTERANGE&&o.setByteRange(E.BYTERANGE),o.level=g,o.sn="initSegment",h&&(o.levelkey=h),o.initSegment=null}},"./src/loader/playlist-loader.ts":function(r,t,e){"use strict";e.r(t);var a=e("./src/polyfills/number.ts"),n=e("./src/events.ts"),u=e("./src/errors.ts"),M=e("./src/utils/logger.ts"),y=e("./src/utils/mp4-tools.ts"),I=e("./src/loader/m3u8-parser.ts"),x=e("./src/types/loader.ts"),A=e("./src/utils/attr-list.ts");function D(T){var S=T.type;switch(S){case x.PlaylistContextType.AUDIO_TRACK:return x.PlaylistLevelType.AUDIO;case x.PlaylistContextType.SUBTITLE_TRACK:return x.PlaylistLevelType.SUBTITLE;default:return x.PlaylistLevelType.MAIN}}function R(T,S){var c=T.url;return(c===void 0||c.indexOf("data:")===0)&&(c=S.url),c}var L=function(){function T(c){this.hls=void 0,this.loaders=Object.create(null),this.hls=c,this.registerListeners()}var S=T.prototype;return S.startLoad=function(i){},S.stopLoad=function(){this.destroyInternalLoaders()},S.registerListeners=function(){var i=this.hls;i.on(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(n.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(n.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),i.on(n.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},S.unregisterListeners=function(){var i=this.hls;i.off(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(n.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(n.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),i.off(n.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},S.createInternalLoader=function(i){var f=this.hls.config,m=f.pLoader,d=f.loader,l=m||d,s=new l(f);return i.loader=s,this.loaders[i.type]=s,s},S.getInternalLoader=function(i){return this.loaders[i.type]},S.resetInternalLoader=function(i){this.loaders[i]&&delete this.loaders[i]},S.destroyInternalLoaders=function(){for(var i in this.loaders){var f=this.loaders[i];f&&f.destroy(),this.resetInternalLoader(i)}},S.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},S.onManifestLoading=function(i,f){var m=f.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:x.PlaylistContextType.MANIFEST,url:m,deliveryDirectives:null})},S.onLevelLoading=function(i,f){var m=f.id,d=f.level,l=f.url,s=f.deliveryDirectives;this.load({id:m,groupId:null,level:d,responseType:"text",type:x.PlaylistContextType.LEVEL,url:l,deliveryDirectives:s})},S.onAudioTrackLoading=function(i,f){var m=f.id,d=f.groupId,l=f.url,s=f.deliveryDirectives;this.load({id:m,groupId:d,level:null,responseType:"text",type:x.PlaylistContextType.AUDIO_TRACK,url:l,deliveryDirectives:s})},S.onSubtitleTrackLoading=function(i,f){var m=f.id,d=f.groupId,l=f.url,s=f.deliveryDirectives;this.load({id:m,groupId:d,level:null,responseType:"text",type:x.PlaylistContextType.SUBTITLE_TRACK,url:l,deliveryDirectives:s})},S.load=function(i){var f,m=this.hls.config,d=this.getInternalLoader(i);if(d){var l=d.context;if(l&&l.url===i.url){M.logger.trace("[playlist-loader]: playlist request ongoing");return}M.logger.log("[playlist-loader]: aborting previous loader for type: "+i.type),d.abort()}var s,v,p,o;switch(i.type){case x.PlaylistContextType.MANIFEST:s=m.manifestLoadingMaxRetry,v=m.manifestLoadingTimeOut,p=m.manifestLoadingRetryDelay,o=m.manifestLoadingMaxRetryTimeout;break;case x.PlaylistContextType.LEVEL:case x.PlaylistContextType.AUDIO_TRACK:case x.PlaylistContextType.SUBTITLE_TRACK:s=0,v=m.levelLoadingTimeOut;break;default:s=m.levelLoadingMaxRetry,v=m.levelLoadingTimeOut,p=m.levelLoadingRetryDelay,o=m.levelLoadingMaxRetryTimeout;break}if(d=this.createInternalLoader(i),(f=i.deliveryDirectives)!==null&&f!==void 0&&f.part){var E;if(i.type===x.PlaylistContextType.LEVEL&&i.level!==null?E=this.hls.levels[i.level].details:i.type===x.PlaylistContextType.AUDIO_TRACK&&i.id!==null?E=this.hls.audioTracks[i.id].details:i.type===x.PlaylistContextType.SUBTITLE_TRACK&&i.id!==null&&(E=this.hls.subtitleTracks[i.id].details),E){var g=E.partTarget,h=E.targetduration;g&&h&&(v=Math.min(Math.max(g*3,h*.8)*1e3,v))}}var b={timeout:v,maxRetry:s,retryDelay:p,maxRetryDelay:o,highWaterMark:0},_={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};d.load(i,b,_)},S.loadsuccess=function(i,f,m,d){if(d===void 0&&(d=null),m.isSidxRequest){this.handleSidxRequest(i,m),this.handlePlaylistLoaded(i,f,m,d);return}this.resetInternalLoader(m.type);var l=i.data;if(l.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(i,m,"no EXTM3U delimiter",d);return}f.parsing.start=performance.now(),l.indexOf("#EXTINF:")>0||l.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(i,f,m,d):this.handleMasterPlaylist(i,f,m,d)},S.loaderror=function(i,f,m){m===void 0&&(m=null),this.handleNetworkError(f,m,!1,i)},S.loadtimeout=function(i,f,m){m===void 0&&(m=null),this.handleNetworkError(f,m,!0)},S.handleMasterPlaylist=function(i,f,m,d){var l=this.hls,s=i.data,v=R(i,m),p=I.default.parseMasterPlaylist(s,v),o=p.levels,E=p.sessionData;if(!o.length){this.handleManifestParsingError(i,m,"no level found in manifest",d);return}var g=o.map(function(P){return{id:P.attrs.AUDIO,audioCodec:P.audioCodec}}),h=o.map(function(P){return{id:P.attrs.SUBTITLES,textCodec:P.textCodec}}),b=I.default.parseMasterPlaylistMedia(s,v,"AUDIO",g),_=I.default.parseMasterPlaylistMedia(s,v,"SUBTITLES",h),O=I.default.parseMasterPlaylistMedia(s,v,"CLOSED-CAPTIONS");if(b.length){var C=b.some(function(P){return!P.url});!C&&o[0].audioCodec&&!o[0].attrs.AUDIO&&(M.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),b.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new A.AttrList({}),bitrate:0,url:""}))}l.trigger(n.Events.MANIFEST_LOADED,{levels:o,audioTracks:b,subtitles:_,captions:O,url:v,stats:f,networkDetails:d,sessionData:E})},S.handleTrackOrLevelPlaylist=function(i,f,m,d){var l=this.hls,s=m.id,v=m.level,p=m.type,o=R(i,m),E=Object(a.isFiniteNumber)(s)?s:0,g=Object(a.isFiniteNumber)(v)?v:E,h=D(m),b=I.default.parseLevelPlaylist(i.data,o,g,h,E);if(!b.fragments.length){l.trigger(n.Events.ERROR,{type:u.ErrorTypes.NETWORK_ERROR,details:u.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:o,reason:"no fragments found in level",level:typeof m.level=="number"?m.level:void 0});return}if(p===x.PlaylistContextType.MANIFEST){var _={attrs:new A.AttrList({}),bitrate:0,details:b,name:"",url:o};l.trigger(n.Events.MANIFEST_LOADED,{levels:[_],audioTracks:[],url:o,stats:f,networkDetails:d,sessionData:null})}if(f.parsing.end=performance.now(),b.needSidxRanges){var O,C=(O=b.fragments[0].initSegment)===null||O===void 0?void 0:O.url;this.load({url:C,isSidxRequest:!0,type:p,level:v,levelDetails:b,id:s,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}m.levelDetails=b,this.handlePlaylistLoaded(i,f,m,d)},S.handleSidxRequest=function(i,f){var m=new Uint8Array(i.data),d=Object(y.findBox)(m,["sidx"])[0];if(!!d){var l=Object(y.parseSegmentIndex)(d);if(!!l){var s=l.references,v=f.levelDetails;s.forEach(function(p,o){var E=p.info,g=v.fragments[o];if(g.byteRange.length===0&&g.setByteRange(String(1+E.end-E.start)+"@"+String(E.start)),g.initSegment){var h=Object(y.findBox)(m,["moov"])[0],b=h?h.length:null;g.initSegment.setByteRange(String(b)+"@0")}})}}},S.handleManifestParsingError=function(i,f,m,d){this.hls.trigger(n.Events.ERROR,{type:u.ErrorTypes.NETWORK_ERROR,details:u.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:f.type===x.PlaylistContextType.MANIFEST,url:i.url,reason:m,response:i,context:f,networkDetails:d})},S.handleNetworkError=function(i,f,m,d){m===void 0&&(m=!1),M.logger.warn("[playlist-loader]: A network "+(m?"timeout":"error")+" occurred while loading "+i.type+" level: "+i.level+" id: "+i.id+' group-id: "'+i.groupId+'"');var l=u.ErrorDetails.UNKNOWN,s=!1,v=this.getInternalLoader(i);switch(i.type){case x.PlaylistContextType.MANIFEST:l=m?u.ErrorDetails.MANIFEST_LOAD_TIMEOUT:u.ErrorDetails.MANIFEST_LOAD_ERROR,s=!0;break;case x.PlaylistContextType.LEVEL:l=m?u.ErrorDetails.LEVEL_LOAD_TIMEOUT:u.ErrorDetails.LEVEL_LOAD_ERROR,s=!1;break;case x.PlaylistContextType.AUDIO_TRACK:l=m?u.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:u.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,s=!1;break;case x.PlaylistContextType.SUBTITLE_TRACK:l=m?u.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:u.ErrorDetails.SUBTITLE_LOAD_ERROR,s=!1;break}v&&this.resetInternalLoader(i.type);var p={type:u.ErrorTypes.NETWORK_ERROR,details:l,fatal:s,url:i.url,loader:v,context:i,networkDetails:f};d&&(p.response=d),this.hls.trigger(n.Events.ERROR,p)},S.handlePlaylistLoaded=function(i,f,m,d){var l=m.type,s=m.level,v=m.id,p=m.groupId,o=m.loader,E=m.levelDetails,g=m.deliveryDirectives;if(!(E!=null&&E.targetduration)){this.handleManifestParsingError(i,m,"invalid target duration",d);return}if(!!o)switch(E.live&&(o.getCacheAge&&(E.ageHeader=o.getCacheAge()||0),(!o.getCacheAge||isNaN(E.ageHeader))&&(E.ageHeader=0)),l){case x.PlaylistContextType.MANIFEST:case x.PlaylistContextType.LEVEL:this.hls.trigger(n.Events.LEVEL_LOADED,{details:E,level:s||0,id:v||0,stats:f,networkDetails:d,deliveryDirectives:g});break;case x.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(n.Events.AUDIO_TRACK_LOADED,{details:E,id:v||0,groupId:p||"",stats:f,networkDetails:d,deliveryDirectives:g});break;case x.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(n.Events.SUBTITLE_TRACK_LOADED,{details:E,id:v||0,groupId:p||"",stats:f,networkDetails:d,deliveryDirectives:g});break}},T}();t.default=L},"./src/polyfills/number.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"isFiniteNumber",function(){return a}),e.d(t,"MAX_SAFE_INTEGER",function(){return n});var a=Number.isFinite||function(u){return typeof u=="number"&&isFinite(u)},n=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(r,t,e){"use strict";e.r(t);var a=function(){function n(){}return n.getSilentFrame=function(M,y){switch(M){case"mp4a.40.2":if(y===1)return new Uint8Array([0,200,0,128,35,128]);if(y===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(y===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(y===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(y===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(y===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]);break;default:if(y===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(y===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(y===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]);break}},n}();t.default=a},"./src/remux/mp4-generator.ts":function(r,t,e){"use strict";e.r(t);var a=Math.pow(2,32)-1,n=function(){function u(){}return u.init=function(){u.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var y;for(y in u.types)u.types.hasOwnProperty(y)&&(u.types[y]=[y.charCodeAt(0),y.charCodeAt(1),y.charCodeAt(2),y.charCodeAt(3)]);var I=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]),x=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]);u.HDLR_TYPES={video:I,audio:x};var A=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),D=new Uint8Array([0,0,0,0,0,0,0,0]);u.STTS=u.STSC=u.STCO=D,u.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),u.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),u.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),u.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var R=new Uint8Array([105,115,111,109]),L=new Uint8Array([97,118,99,49]),T=new Uint8Array([0,0,0,1]);u.FTYP=u.box(u.types.ftyp,R,T,R,L),u.DINF=u.box(u.types.dinf,u.box(u.types.dref,A))},u.box=function(y){for(var I=8,x=arguments.length,A=new Array(x>1?x-1:0),D=1;D<x;D++)A[D-1]=arguments[D];for(var R=A.length,L=R;R--;)I+=A[R].byteLength;var T=new Uint8Array(I);for(T[0]=I>>24&255,T[1]=I>>16&255,T[2]=I>>8&255,T[3]=I&255,T.set(y,4),R=0,I=8;R<L;R++)T.set(A[R],I),I+=A[R].byteLength;return T},u.hdlr=function(y){return u.box(u.types.hdlr,u.HDLR_TYPES[y])},u.mdat=function(y){return u.box(u.types.mdat,y)},u.mdhd=function(y,I){I*=y;var x=Math.floor(I/(a+1)),A=Math.floor(I%(a+1));return u.box(u.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,y>>24&255,y>>16&255,y>>8&255,y&255,x>>24,x>>16&255,x>>8&255,x&255,A>>24,A>>16&255,A>>8&255,A&255,85,196,0,0]))},u.mdia=function(y){return u.box(u.types.mdia,u.mdhd(y.timescale,y.duration),u.hdlr(y.type),u.minf(y))},u.mfhd=function(y){return u.box(u.types.mfhd,new Uint8Array([0,0,0,0,y>>24,y>>16&255,y>>8&255,y&255]))},u.minf=function(y){return y.type==="audio"?u.box(u.types.minf,u.box(u.types.smhd,u.SMHD),u.DINF,u.stbl(y)):u.box(u.types.minf,u.box(u.types.vmhd,u.VMHD),u.DINF,u.stbl(y))},u.moof=function(y,I,x){return u.box(u.types.moof,u.mfhd(y),u.traf(x,I))},u.moov=function(y){for(var I=y.length,x=[];I--;)x[I]=u.trak(y[I]);return u.box.apply(null,[u.types.moov,u.mvhd(y[0].timescale,y[0].duration)].concat(x).concat(u.mvex(y)))},u.mvex=function(y){for(var I=y.length,x=[];I--;)x[I]=u.trex(y[I]);return u.box.apply(null,[u.types.mvex].concat(x))},u.mvhd=function(y,I){I*=y;var x=Math.floor(I/(a+1)),A=Math.floor(I%(a+1)),D=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,y>>24&255,y>>16&255,y>>8&255,y&255,x>>24,x>>16&255,x>>8&255,x&255,A>>24,A>>16&255,A>>8&255,A&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return u.box(u.types.mvhd,D)},u.sdtp=function(y){var I=y.samples||[],x=new Uint8Array(4+I.length),A,D;for(A=0;A<I.length;A++)D=I[A].flags,x[A+4]=D.dependsOn<<4|D.isDependedOn<<2|D.hasRedundancy;return u.box(u.types.sdtp,x)},u.stbl=function(y){return u.box(u.types.stbl,u.stsd(y),u.box(u.types.stts,u.STTS),u.box(u.types.stsc,u.STSC),u.box(u.types.stsz,u.STSZ),u.box(u.types.stco,u.STCO))},u.avc1=function(y){var I=[],x=[],A,D,R;for(A=0;A<y.sps.length;A++)D=y.sps[A],R=D.byteLength,I.push(R>>>8&255),I.push(R&255),I=I.concat(Array.prototype.slice.call(D));for(A=0;A<y.pps.length;A++)D=y.pps[A],R=D.byteLength,x.push(R>>>8&255),x.push(R&255),x=x.concat(Array.prototype.slice.call(D));var L=u.box(u.types.avcC,new Uint8Array([1,I[3],I[4],I[5],255,224|y.sps.length].concat(I).concat([y.pps.length]).concat(x))),T=y.width,S=y.height,c=y.pixelRatio[0],i=y.pixelRatio[1];return u.box(u.types.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,T>>8&255,T&255,S>>8&255,S&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),L,u.box(u.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),u.box(u.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,c&255,i>>24,i>>16&255,i>>8&255,i&255])))},u.esds=function(y){var I=y.config.length;return new Uint8Array([0,0,0,0,3,23+I,0,1,0,4,15+I,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([I]).concat(y.config).concat([6,1,2]))},u.mp4a=function(y){var I=y.samplerate;return u.box(u.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,y.channelCount,0,16,0,0,0,0,I>>8&255,I&255,0,0]),u.box(u.types.esds,u.esds(y)))},u.mp3=function(y){var I=y.samplerate;return u.box(u.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,y.channelCount,0,16,0,0,0,0,I>>8&255,I&255,0,0]))},u.stsd=function(y){return y.type==="audio"?y.segmentCodec==="mp3"&&y.codec==="mp3"?u.box(u.types.stsd,u.STSD,u.mp3(y)):u.box(u.types.stsd,u.STSD,u.mp4a(y)):u.box(u.types.stsd,u.STSD,u.avc1(y))},u.tkhd=function(y){var I=y.id,x=y.duration*y.timescale,A=y.width,D=y.height,R=Math.floor(x/(a+1)),L=Math.floor(x%(a+1));return u.box(u.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,I>>24&255,I>>16&255,I>>8&255,I&255,0,0,0,0,R>>24,R>>16&255,R>>8&255,R&255,L>>24,L>>16&255,L>>8&255,L&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,A>>8&255,A&255,0,0,D>>8&255,D&255,0,0]))},u.traf=function(y,I){var x=u.sdtp(y),A=y.id,D=Math.floor(I/(a+1)),R=Math.floor(I%(a+1));return u.box(u.types.traf,u.box(u.types.tfhd,new Uint8Array([0,0,0,0,A>>24,A>>16&255,A>>8&255,A&255])),u.box(u.types.tfdt,new Uint8Array([1,0,0,0,D>>24,D>>16&255,D>>8&255,D&255,R>>24,R>>16&255,R>>8&255,R&255])),u.trun(y,x.length+16+20+8+16+8+8),x)},u.trak=function(y){return y.duration=y.duration||4294967295,u.box(u.types.trak,u.tkhd(y),u.mdia(y))},u.trex=function(y){var I=y.id;return u.box(u.types.trex,new Uint8Array([0,0,0,0,I>>24,I>>16&255,I>>8&255,I&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},u.trun=function(y,I){var x=y.samples||[],A=x.length,D=12+16*A,R=new Uint8Array(D),L,T,S,c,i,f;for(I+=8+D,R.set([y.type==="video"?1:0,0,15,1,A>>>24&255,A>>>16&255,A>>>8&255,A&255,I>>>24&255,I>>>16&255,I>>>8&255,I&255],0),L=0;L<A;L++)T=x[L],S=T.duration,c=T.size,i=T.flags,f=T.cts,R.set([S>>>24&255,S>>>16&255,S>>>8&255,S&255,c>>>24&255,c>>>16&255,c>>>8&255,c&255,i.isLeading<<2|i.dependsOn,i.isDependedOn<<6|i.hasRedundancy<<4|i.paddingValue<<1|i.isNonSync,i.degradPrio&240<<8,i.degradPrio&15,f>>>24&255,f>>>16&255,f>>>8&255,f&255],12+16*L);return u.box(u.types.trun,R)},u.initSegment=function(y){u.types||u.init();var I=u.moov(y),x=new Uint8Array(u.FTYP.byteLength+I.byteLength);return x.set(u.FTYP),x.set(I,u.FTYP.byteLength),x},u}();n.types=void 0,n.HDLR_TYPES=void 0,n.STTS=void 0,n.STSC=void 0,n.STCO=void 0,n.STSZ=void 0,n.VMHD=void 0,n.SMHD=void 0,n.STSD=void 0,n.FTYP=void 0,n.DINF=void 0,t.default=n},"./src/remux/mp4-remuxer.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"default",function(){return i}),e.d(t,"normalizePts",function(){return f}),e.d(t,"flushTextTrackMetadataCueSamples",function(){return d}),e.d(t,"flushTextTrackUserdataCueSamples",function(){return l});var a=e("./src/polyfills/number.ts"),n=e("./src/remux/aac-helper.ts"),u=e("./src/remux/mp4-generator.ts"),M=e("./src/events.ts"),y=e("./src/errors.ts"),I=e("./src/utils/logger.ts"),x=e("./src/types/loader.ts"),A=e("./src/utils/timescale-conversion.ts");function D(){return D=Object.assign?Object.assign.bind():function(p){for(var o=1;o<arguments.length;o++){var E=arguments[o];for(var g in E)Object.prototype.hasOwnProperty.call(E,g)&&(p[g]=E[g])}return p},D.apply(this,arguments)}var R=10*1e3,L=1024,T=1152,S=null,c=null,i=function(){function p(E,g,h,b){if(b===void 0&&(b=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=E,this.config=g,this.typeSupported=h,this.ISGenerated=!1,S===null){var _=navigator.userAgent||"",O=_.match(/Chrome\/(\d+)/i);S=O?parseInt(O[1]):0}if(c===null){var C=navigator.userAgent.match(/Safari\/(\d+)/i);c=C?parseInt(C[1]):0}}var o=p.prototype;return o.destroy=function(){},o.resetTimeStamp=function(g){I.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=g},o.resetNextTimestamp=function(){I.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},o.resetInitSegment=function(){I.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},o.getVideoStartPts=function(g){var h=!1,b=g.reduce(function(_,O){var C=O.pts-_;return C<-4294967296?(h=!0,f(_,O.pts)):C>0?_:O.pts},g[0].pts);return h&&I.logger.debug("PTS rollover detected"),b},o.remux=function(g,h,b,_,O,C,P,w){var U,k,N,F,H,W,B=O,j=O,V=g.pid>-1,Y=h.pid>-1,Q=h.samples.length,J=g.samples.length>0,z=P&&Q>0||Q>1,te=(!V||J)&&(!Y||z)||this.ISGenerated||P;if(te){this.ISGenerated||(N=this.generateIS(g,h,O));var se=this.isVideoContiguous,Z=-1,Ee;if(z&&(Z=m(h.samples),!se&&this.config.forceKeyFrameOnDiscontinuity))if(W=!0,Z>0){I.logger.warn("[mp4-remuxer]: Dropped "+Z+" out of "+Q+" video samples due to a missing keyframe");var fe=this.getVideoStartPts(h.samples);h.samples=h.samples.slice(Z),h.dropped+=Z,j+=(h.samples[0].pts-fe)/h.inputTimeScale,Ee=j}else Z===-1&&(I.logger.warn("[mp4-remuxer]: No keyframe found out of "+Q+" video samples"),W=!1);if(this.ISGenerated){if(J&&z){var re=this.getVideoStartPts(h.samples),q=f(g.samples[0].pts,re)-re,ie=q/h.inputTimeScale;B+=Math.max(0,ie),j+=Math.max(0,-ie)}if(J){if(g.samplerate||(I.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),N=this.generateIS(g,h,O)),k=this.remuxAudio(g,B,this.isAudioContiguous,C,Y||z||w===x.PlaylistLevelType.AUDIO?j:void 0),z){var ne=k?k.endPTS-k.startPTS:0;h.inputTimeScale||(I.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),N=this.generateIS(g,h,O)),U=this.remuxVideo(h,j,se,ne)}}else z&&(U=this.remuxVideo(h,j,se,0));U&&(U.firstKeyFrame=Z,U.independent=Z!==-1,U.firstKeyFramePTS=Ee)}}return this.ISGenerated&&(b.samples.length&&(H=d(b,O,this._initPTS,this._initDTS)),_.samples.length&&(F=l(_,O,this._initPTS))),{audio:k,video:U,initSegment:N,independent:W,text:F,id3:H}},o.generateIS=function(g,h,b){var _=g.samples,O=h.samples,C=this.typeSupported,P={},w=!Object(a.isFiniteNumber)(this._initPTS),U="audio/mp4",k,N,F;if(w&&(k=N=1/0),g.config&&_.length){switch(g.timescale=g.samplerate,g.segmentCodec){case"mp3":C.mpeg?(U="audio/mpeg",g.codec=""):C.mp3&&(g.codec="mp3");break}P.audio={id:"audio",container:U,codec:g.codec,initSegment:g.segmentCodec==="mp3"&&C.mpeg?new Uint8Array(0):u.default.initSegment([g]),metadata:{channelCount:g.channelCount}},w&&(F=g.inputTimeScale,k=N=_[0].pts-Math.round(F*b))}if(h.sps&&h.pps&&O.length&&(h.timescale=h.inputTimeScale,P.video={id:"main",container:"video/mp4",codec:h.codec,initSegment:u.default.initSegment([h]),metadata:{width:h.width,height:h.height}},w)){F=h.inputTimeScale;var H=this.getVideoStartPts(O),W=Math.round(F*b);N=Math.min(N,f(O[0].dts,H)-W),k=Math.min(k,H-W)}if(Object.keys(P).length)return this.ISGenerated=!0,w&&(this._initPTS=k,this._initDTS=N),{tracks:P,initPTS:k,timescale:F}},o.remuxVideo=function(g,h,b,_){var O=g.inputTimeScale,C=g.samples,P=[],w=C.length,U=this._initPTS,k=this.nextAvcDts,N=8,F=this.videoSampleDuration,H,W,B=Number.POSITIVE_INFINITY,j=Number.NEGATIVE_INFINITY,V=!1;if(!b||k===null){var Y=h*O,Q=C[0].pts-f(C[0].dts,C[0].pts);k=Y-Q}for(var J=0;J<w;J++){var z=C[J];z.pts=f(z.pts-U,k),z.dts=f(z.dts-U,k),z.dts<C[J>0?J-1:J].dts&&(V=!0)}V&&C.sort(function(Ut,Mr){var Rr=Ut.dts-Mr.dts,fi=Ut.pts-Mr.pts;return Rr||fi}),H=C[0].dts,W=C[C.length-1].dts;var te=W-H,se=te?Math.round(te/(w-1)):F||g.inputTimeScale/30;if(b){var Z=H-k,Ee=Z>se,fe=Z<-1;if(Ee||fe){Ee?I.logger.warn("AVC: "+Object(A.toMsFromMpegTsClock)(Z,!0)+" ms ("+Z+"dts) hole between fragments detected, filling it"):I.logger.warn("AVC: "+Object(A.toMsFromMpegTsClock)(-Z,!0)+" ms ("+Z+"dts) overlapping between fragments detected"),H=k;var re=C[0].pts-Z;C[0].dts=H,C[0].pts=re,I.logger.log("Video: First PTS/DTS adjusted: "+Object(A.toMsFromMpegTsClock)(re,!0)+"/"+Object(A.toMsFromMpegTsClock)(H,!0)+", delta: "+Object(A.toMsFromMpegTsClock)(Z,!0)+" ms")}}H=Math.max(0,H);for(var q=0,ie=0,ne=0;ne<w;ne++){for(var Te=C[ne],Se=Te.units,he=Se.length,Oe=0,Ce=0;Ce<he;Ce++)Oe+=Se[Ce].data.length;ie+=Oe,q+=he,Te.length=Oe,Te.dts=Math.max(Te.dts,H),B=Math.min(Te.pts,B),j=Math.max(Te.pts,j)}W=C[w-1].dts;var Ue=ie+4*q+8,me;try{me=new Uint8Array(Ue)}catch{this.observer.emit(M.Events.ERROR,M.Events.ERROR,{type:y.ErrorTypes.MUX_ERROR,details:y.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ue,reason:"fail allocating video mdat "+Ue});return}var Ae=new DataView(me.buffer);Ae.setUint32(0,Ue),me.set(u.default.types.mdat,4);for(var Re=!1,Ie=Number.POSITIVE_INFINITY,Ne=Number.POSITIVE_INFINITY,je=Number.NEGATIVE_INFINITY,Qe=Number.NEGATIVE_INFINITY,Fe=0;Fe<w;Fe++){for(var ke=C[Fe],G=ke.units,$=0,ye=0,_e=G.length;ye<_e;ye++){var xe=G[ye],Ke=xe.data,ve=xe.data.byteLength;Ae.setUint32(N,ve),N+=4,me.set(Ke,N),N+=ve,$+=4+ve}var Ve=void 0;if(Fe<w-1)F=C[Fe+1].dts-ke.dts,Ve=C[Fe+1].pts-ke.pts;else{var We=this.config,ze=Fe>0?ke.dts-C[Fe-1].dts:se;if(Ve=Fe>0?ke.pts-C[Fe-1].pts:se,We.stretchShortVideoTrack&&this.nextAudioPts!==null){var kt=Math.floor(We.maxBufferHole*O),yt=(_?B+_*O:this.nextAudioPts)-ke.pts;yt>kt?(F=yt-ze,F<0?F=ze:Re=!0,I.logger.log("[mp4-remuxer]: It is approximately "+yt/90+" ms to the next segment; using duration "+F/90+" ms for the last video frame.")):F=ze}else F=ze}var Dt=Math.round(ke.pts-ke.dts);Ie=Math.min(Ie,F),je=Math.max(je,F),Ne=Math.min(Ne,Ve),Qe=Math.max(Qe,Ve),P.push(new s(ke.key,F,$,Dt))}if(P.length){if(S){if(S<70){var Lr=P[0].flags;Lr.dependsOn=2,Lr.isNonSync=0}}else if(c&&Qe-Ne<je-Ie&&se/je<.025&&P[0].cts===0){I.logger.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");for(var Jt=H,rt=0,wt=P.length;rt<wt;rt++){var qt=Jt+P[rt].duration,er=Jt+P[rt].cts;if(rt<wt-1){var Dr=qt+P[rt+1].cts;P[rt].duration=Dr-er}else P[rt].duration=rt?P[rt-1].duration:se;P[rt].cts=0,Jt=qt}}}console.assert(F!==null,"mp4SampleDuration must be computed"),F=Re||!F?se:F,this.nextAvcDts=k=W+F,this.videoSampleDuration=F,this.isVideoContiguous=!0;var Ir=u.default.moof(g.sequenceNumber++,H,D({},g,{samples:P})),di="video",ci={data1:Ir,data2:me,startPTS:B/O,endPTS:(j+F)/O,startDTS:H/O,endDTS:k/O,type:di,hasAudio:!1,hasVideo:!0,nb:P.length,dropped:g.dropped};return g.samples=[],g.dropped=0,console.assert(me.length,"MDAT length must not be zero"),ci},o.remuxAudio=function(g,h,b,_,O){var C=g.inputTimeScale,P=g.samplerate?g.samplerate:C,w=C/P,U=g.segmentCodec==="aac"?L:T,k=U*w,N=this._initPTS,F=g.segmentCodec==="mp3"&&this.typeSupported.mpeg,H=[],W=O!==void 0,B=g.samples,j=F?0:8,V=this.nextAudioPts||-1,Y=h*C;if(this.isAudioContiguous=b=b||B.length&&V>0&&(_&&Math.abs(Y-V)<9e3||Math.abs(f(B[0].pts-N,Y)-V)<20*k),B.forEach(function(xe){xe.pts=f(xe.pts-N,Y)}),!b||V<0){if(B=B.filter(function(xe){return xe.pts>=0}),!B.length)return;O===0?V=0:_&&!W?V=Math.max(0,Y):V=B[0].pts}if(g.segmentCodec==="aac")for(var Q=this.config.maxAudioFramesDrift,J=0,z=V;J<B.length;J++){var te=B[J],se=te.pts,Z=se-z,Ee=Math.abs(1e3*Z/C);if(Z<=-Q*k&&W)J===0&&(I.logger.warn("Audio frame @ "+(se/C).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Z/C)+" ms."),this.nextAudioPts=V=z=se);else if(Z>=Q*k&&Ee<R&&W){var fe=Math.round(Z/k);z=se-fe*k,z<0&&(fe--,z+=k),J===0&&(this.nextAudioPts=V=z),I.logger.warn("[mp4-remuxer]: Injecting "+fe+" audio frame @ "+(z/C).toFixed(3)+"s due to "+Math.round(1e3*Z/C)+" ms gap.");for(var re=0;re<fe;re++){var q=Math.max(z,0),ie=n.default.getSilentFrame(g.manifestCodec||g.codec,g.channelCount);ie||(I.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ie=te.unit.subarray()),B.splice(J,0,{unit:ie,pts:q}),z+=k,J++}}te.pts=z,z+=k}for(var ne=null,Te=null,Se,he=0,Oe=B.length;Oe--;)he+=B[Oe].unit.byteLength;for(var Ce=0,Ue=B.length;Ce<Ue;Ce++){var me=B[Ce],Ae=me.unit,Re=me.pts;if(Te!==null){var Ie=H[Ce-1];Ie.duration=Math.round((Re-Te)/w)}else if(b&&g.segmentCodec==="aac"&&(Re=V),ne=Re,he>0){he+=j;try{Se=new Uint8Array(he)}catch{this.observer.emit(M.Events.ERROR,M.Events.ERROR,{type:y.ErrorTypes.MUX_ERROR,details:y.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:he,reason:"fail allocating audio mdat "+he});return}if(!F){var Ne=new DataView(Se.buffer);Ne.setUint32(0,he),Se.set(u.default.types.mdat,4)}}else return;Se.set(Ae,j);var je=Ae.byteLength;j+=je,H.push(new s(!0,U,je,0)),Te=Re}var Qe=H.length;if(!!Qe){var Fe=H[H.length-1];this.nextAudioPts=V=Te+w*Fe.duration;var ke=F?new Uint8Array(0):u.default.moof(g.sequenceNumber++,ne/w,D({},g,{samples:H}));g.samples=[];var G=ne/C,$=V/C,ye="audio",_e={data1:ke,data2:Se,startPTS:G,endPTS:$,startDTS:G,endDTS:$,type:ye,hasAudio:!0,hasVideo:!1,nb:Qe};return this.isAudioContiguous=!0,console.assert(Se.length,"MDAT length must not be zero"),_e}},o.remuxEmptyAudio=function(g,h,b,_){var O=g.inputTimeScale,C=g.samplerate?g.samplerate:O,P=O/C,w=this.nextAudioPts,U=(w!==null?w:_.startDTS*O)+this._initDTS,k=_.endDTS*O+this._initDTS,N=P*L,F=Math.ceil((k-U)/N),H=n.default.getSilentFrame(g.manifestCodec||g.codec,g.channelCount);if(I.logger.warn("[mp4-remuxer]: remux empty Audio"),!H){I.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var W=[],B=0;B<F;B++){var j=U+B*N;W.push({unit:H,pts:j,dts:j})}return g.samples=W,this.remuxAudio(g,h,b,!1)},p}();function f(p,o){var E;if(o===null)return p;for(o<p?E=-8589934592:E=8589934592;Math.abs(p-o)>4294967296;)p+=E;return p}function m(p){for(var o=0;o<p.length;o++)if(p[o].key)return o;return-1}function d(p,o,E,g){var h=p.samples.length;if(!!h){for(var b=p.inputTimeScale,_=0;_<h;_++){var O=p.samples[_];O.pts=f(O.pts-E,o*b)/b,O.dts=f(O.dts-g,o*b)/b}var C=p.samples;return p.samples=[],{samples:C}}}function l(p,o,E){var g=p.samples.length;if(!!g){for(var h=p.inputTimeScale,b=0;b<g;b++){var _=p.samples[b];_.pts=f(_.pts-E,o*h)/h}p.samples.sort(function(C,P){return C.pts-P.pts});var O=p.samples;return p.samples=[],{samples:O}}}var s=function(o,E,g,h){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=E,this.size=g,this.cts=h,this.flags=new v(o)},v=function(o){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=o?2:1,this.isNonSync=o?0:1}},"./src/remux/passthrough-remuxer.ts":function(r,t,e){"use strict";e.r(t);var a=e("./src/polyfills/number.ts"),n=e("./src/remux/mp4-remuxer.ts"),u=e("./src/utils/mp4-tools.ts"),M=e("./src/loader/fragment.ts"),y=e("./src/utils/logger.ts"),I=function(){function A(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndTime=null}var D=A.prototype;return D.destroy=function(){},D.resetTimeStamp=function(L){this.initPTS=L,this.lastEndTime=null},D.resetNextTimestamp=function(){this.lastEndTime=null},D.resetInitSegment=function(L,T,S){this.audioCodec=T,this.videoCodec=S,this.generateInitSegment(L),this.emitInitSegment=!0},D.generateInitSegment=function(L){var T=this.audioCodec,S=this.videoCodec;if(!L||!L.byteLength){this.initTracks=void 0,this.initData=void 0;return}var c=this.initData=Object(u.parseInitSegment)(L);T||(T=x(c.audio,M.ElementaryStreamTypes.AUDIO)),S||(S=x(c.video,M.ElementaryStreamTypes.VIDEO));var i={};c.audio&&c.video?i.audiovideo={container:"video/mp4",codec:T+","+S,initSegment:L,id:"main"}:c.audio?i.audio={container:"audio/mp4",codec:T,initSegment:L,id:"audio"}:c.video?i.video={container:"video/mp4",codec:S,initSegment:L,id:"main"}:y.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=i},D.remux=function(L,T,S,c,i){var f,m=this.initPTS,d=this.lastEndTime,l={audio:void 0,video:void 0,text:c,id3:S,initSegment:void 0};Object(a.isFiniteNumber)(d)||(d=this.lastEndTime=i||0);var s=T.samples;if(!s||!s.length)return l;var v={initPTS:void 0,timescale:1},p=this.initData;if((!p||!p.length)&&(this.generateInitSegment(s),p=this.initData),!p||!p.length)return y.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),l;this.emitInitSegment&&(v.tracks=this.initTracks,this.emitInitSegment=!1);var o=Object(u.getStartDTS)(p,s);Object(a.isFiniteNumber)(m)||(this.initPTS=v.initPTS=m=o-i);var E=Object(u.getDuration)(s,p),g=L?o-m:d,h=g+E;Object(u.offsetStartDTS)(p,s,m),E>0?this.lastEndTime=h:(y.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var b=!!p.audio,_=!!p.video,O="";b&&(O+="audio"),_&&(O+="video");var C={data1:s,startPTS:g,startDTS:g,endPTS:h,endDTS:h,type:O,hasAudio:b,hasVideo:_,nb:1,dropped:0};l.audio=C.type==="audio"?C:void 0,l.video=C.type!=="audio"?C:void 0,l.initSegment=v;var P=(f=this.initPTS)!=null?f:0;return l.id3=Object(n.flushTextTrackMetadataCueSamples)(S,i,P,P),c.samples.length&&(l.text=Object(n.flushTextTrackUserdataCueSamples)(c,i,P)),l},A}();function x(A,D){var R=A==null?void 0:A.codec;return R&&R.length>4?R:R==="hvc1"||R==="hev1"?"hvc1.1.c.L120.90":R==="av01"?"av01.0.04M.08":R==="avc1"||D===M.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}t.default=I},"./src/task-loop.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"default",function(){return a});var a=function(){function n(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var u=n.prototype;return u.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},u.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},u.onHandlerDestroyed=function(){},u.hasInterval=function(){return!!this._tickInterval},u.hasNextTick=function(){return!!this._tickTimer},u.setInterval=function(y){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,y),!0)},u.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},u.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},u.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},u.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},u.doTick=function(){},n}()},"./src/types/cmcd.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"CMCDVersion",function(){return a}),e.d(t,"CMCDObjectType",function(){return n}),e.d(t,"CMCDStreamingFormat",function(){return u}),e.d(t,"CMCDStreamType",function(){return M});var a=1,n;(function(y){y.MANIFEST="m",y.AUDIO="a",y.VIDEO="v",y.MUXED="av",y.INIT="i",y.CAPTION="c",y.TIMED_TEXT="tt",y.KEY="k",y.OTHER="o"})(n||(n={}));var u;(function(y){y.DASH="d",y.HLS="h",y.SMOOTH="s",y.OTHER="o"})(u||(u={}));var M;(function(y){y.VOD="v",y.LIVE="l"})(M||(M={}))},"./src/types/demuxer.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"MetadataSchema",function(){return a});var a;(function(n){n.audioId3="org.id3",n.dateRange="com.apple.quicktime.HLS",n.emsg="https://aomedia.org/emsg/ID3"})(a||(a={}))},"./src/types/level.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"HlsSkip",function(){return u}),e.d(t,"getSkipValue",function(){return M}),e.d(t,"HlsUrlParameters",function(){return y}),e.d(t,"Level",function(){return I});function a(x,A){for(var D=0;D<A.length;D++){var R=A[D];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(x,R.key,R)}}function n(x,A,D){return A&&a(x.prototype,A),D&&a(x,D),Object.defineProperty(x,"prototype",{writable:!1}),x}var u;(function(x){x.No="",x.Yes="YES",x.v2="v2"})(u||(u={}));function M(x,A){var D=x.canSkipUntil,R=x.canSkipDateRanges,L=x.endSN,T=A!==void 0?A-L:0;return D&&T<D?R?u.v2:u.Yes:u.No}var y=function(){function x(D,R,L){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=D,this.part=R,this.skip=L}var A=x.prototype;return A.addDirectives=function(R){var L=new self.URL(R);return this.msn!==void 0&&L.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&L.searchParams.set("_HLS_part",this.part.toString()),this.skip&&L.searchParams.set("_HLS_skip",this.skip),L.toString()},x}(),I=function(){function x(A){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[A.url],this.attrs=A.attrs,this.bitrate=A.bitrate,A.details&&(this.details=A.details),this.id=A.id||0,this.name=A.name,this.width=A.width||0,this.height=A.height||0,this.audioCodec=A.audioCodec,this.videoCodec=A.videoCodec,this.unknownCodecs=A.unknownCodecs,this.codecSet=[A.videoCodec,A.audioCodec].filter(function(D){return D}).join(",").replace(/\.[^.,]+/g,"")}return n(x,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(D){var R=D%this.url.length;this._urlId!==R&&(this.details=void 0,this._urlId=R)}}]),x}()},"./src/types/loader.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"PlaylistContextType",function(){return a}),e.d(t,"PlaylistLevelType",function(){return n});var a;(function(u){u.MANIFEST="manifest",u.LEVEL="level",u.AUDIO_TRACK="audioTrack",u.SUBTITLE_TRACK="subtitleTrack"})(a||(a={}));var n;(function(u){u.MAIN="main",u.AUDIO="audio",u.SUBTITLE="subtitle"})(n||(n={}))},"./src/types/transmuxer.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"ChunkMetadata",function(){return a});var a=function(M,y,I,x,A,D){x===void 0&&(x=0),A===void 0&&(A=-1),D===void 0&&(D=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=n(),this.buffering={audio:n(),video:n(),audiovideo:n()},this.level=M,this.sn=y,this.id=I,this.size=x,this.part=A,this.partial=D};function n(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"AttrList",function(){return u});var a=/^(\d+)x(\d+)$/,n=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,u=function(){function M(I){typeof I=="string"&&(I=M.parseAttrList(I));for(var x in I)I.hasOwnProperty(x)&&(this[x]=I[x])}var y=M.prototype;return y.decimalInteger=function(x){var A=parseInt(this[x],10);return A>Number.MAX_SAFE_INTEGER?1/0:A},y.hexadecimalInteger=function(x){if(this[x]){var A=(this[x]||"0x").slice(2);A=(A.length&1?"0":"")+A;for(var D=new Uint8Array(A.length/2),R=0;R<A.length/2;R++)D[R]=parseInt(A.slice(R*2,R*2+2),16);return D}else return null},y.hexadecimalIntegerAsNumber=function(x){var A=parseInt(this[x],16);return A>Number.MAX_SAFE_INTEGER?1/0:A},y.decimalFloatingPoint=function(x){return parseFloat(this[x])},y.optionalFloat=function(x,A){var D=this[x];return D?parseFloat(D):A},y.enumeratedString=function(x){return this[x]},y.bool=function(x){return this[x]==="YES"},y.decimalResolution=function(x){var A=a.exec(this[x]);if(A!==null)return{width:parseInt(A[1],10),height:parseInt(A[2],10)}},M.parseAttrList=function(x){var A,D={},R='"';for(n.lastIndex=0;(A=n.exec(x))!==null;){var L=A[2];L.indexOf(R)===0&&L.lastIndexOf(R)===L.length-1&&(L=L.slice(1,-1)),D[A[1]]=L}return D},M}()},"./src/utils/binary-search.ts":function(r,t,e){"use strict";e.r(t);var a={search:function(u,M){for(var y=0,I=u.length-1,x=null,A=null;y<=I;){x=(y+I)/2|0,A=u[x];var D=M(A);if(D>0)y=x+1;else if(D<0)I=x-1;else return A}return null}};t.default=a},"./src/utils/buffer-helper.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"BufferHelper",function(){return u});var a=e("./src/utils/logger.ts"),n={length:0,start:function(){return 0},end:function(){return 0}},u=function(){function M(){}return M.isBuffered=function(I,x){try{if(I){for(var A=M.getBuffered(I),D=0;D<A.length;D++)if(x>=A.start(D)&&x<=A.end(D))return!0}}catch{}return!1},M.bufferInfo=function(I,x,A){try{if(I){var D=M.getBuffered(I),R=[],L;for(L=0;L<D.length;L++)R.push({start:D.start(L),end:D.end(L)});return this.bufferedInfo(R,x,A)}}catch{}return{len:0,start:x,end:x,nextStart:void 0}},M.bufferedInfo=function(I,x,A){x=Math.max(0,x),I.sort(function(s,v){var p=s.start-v.start;return p||v.end-s.end});var D=[];if(A)for(var R=0;R<I.length;R++){var L=D.length;if(L){var T=D[L-1].end;I[R].start-T<A?I[R].end>T&&(D[L-1].end=I[R].end):D.push(I[R])}else D.push(I[R])}else D=I;for(var S=0,c,i=x,f=x,m=0;m<D.length;m++){var d=D[m].start,l=D[m].end;if(x+A>=d&&x<l)i=d,f=l,S=f-x;else if(x+A<d){c=d;break}}return{len:S,start:i||0,end:f||0,nextStart:c}},M.getBuffered=function(I){try{return I.buffered}catch(x){return a.logger.log("failed to get media.buffered",x),n}},M}()},"./src/utils/cea-608-parser.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"Row",function(){return f}),e.d(t,"CaptionScreen",function(){return m});var a=e("./src/utils/logger.ts"),n={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},u=function(E){var g=E;return n.hasOwnProperty(E)&&(g=n[E]),String.fromCharCode(g)},M=15,y=100,I={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},x={17:2,18:4,21:6,22:8,23:10,19:13,20:15},A={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},D={25:2,26:4,29:6,30:8,31:10,27:13,28:15},R=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],L;(function(o){o[o.ERROR=0]="ERROR",o[o.TEXT=1]="TEXT",o[o.WARNING=2]="WARNING",o[o.INFO=2]="INFO",o[o.DEBUG=3]="DEBUG",o[o.DATA=3]="DATA"})(L||(L={}));var T=function(){function o(){this.time=null,this.verboseLevel=L.ERROR}var E=o.prototype;return E.log=function(h,b){this.verboseLevel>=h&&a.logger.log(this.time+" ["+h+"] "+b)},o}(),S=function(E){for(var g=[],h=0;h<E.length;h++)g.push(E[h].toString(16));return g},c=function(){function o(g,h,b,_,O){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=g||"white",this.underline=h||!1,this.italics=b||!1,this.background=_||"black",this.flash=O||!1}var E=o.prototype;return E.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},E.setStyles=function(h){for(var b=["foreground","underline","italics","background","flash"],_=0;_<b.length;_++){var O=b[_];h.hasOwnProperty(O)&&(this[O]=h[O])}},E.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},E.equals=function(h){return this.foreground===h.foreground&&this.underline===h.underline&&this.italics===h.italics&&this.background===h.background&&this.flash===h.flash},E.copy=function(h){this.foreground=h.foreground,this.underline=h.underline,this.italics=h.italics,this.background=h.background,this.flash=h.flash},E.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},o}(),i=function(){function o(g,h,b,_,O,C){this.uchar=void 0,this.penState=void 0,this.uchar=g||" ",this.penState=new c(h,b,_,O,C)}var E=o.prototype;return E.reset=function(){this.uchar=" ",this.penState.reset()},E.setChar=function(h,b){this.uchar=h,this.penState.copy(b)},E.setPenState=function(h){this.penState.copy(h)},E.equals=function(h){return this.uchar===h.uchar&&this.penState.equals(h.penState)},E.copy=function(h){this.uchar=h.uchar,this.penState.copy(h.penState)},E.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},o}(),f=function(){function o(g){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var h=0;h<y;h++)this.chars.push(new i);this.logger=g,this.pos=0,this.currPenState=new c}var E=o.prototype;return E.equals=function(h){for(var b=!0,_=0;_<y;_++)if(!this.chars[_].equals(h.chars[_])){b=!1;break}return b},E.copy=function(h){for(var b=0;b<y;b++)this.chars[b].copy(h.chars[b])},E.isEmpty=function(){for(var h=!0,b=0;b<y;b++)if(!this.chars[b].isEmpty()){h=!1;break}return h},E.setCursor=function(h){this.pos!==h&&(this.pos=h),this.pos<0?(this.logger.log(L.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>y&&(this.logger.log(L.DEBUG,"Too large cursor position "+this.pos),this.pos=y)},E.moveCursor=function(h){var b=this.pos+h;if(h>1)for(var _=this.pos+1;_<b+1;_++)this.chars[_].setPenState(this.currPenState);this.setCursor(b)},E.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},E.insertChar=function(h){h>=144&&this.backSpace();var b=u(h);if(this.pos>=y){this.logger.log(L.ERROR,"Cannot insert "+h.toString(16)+" ("+b+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(b,this.currPenState),this.moveCursor(1)},E.clearFromPos=function(h){var b;for(b=h;b<y;b++)this.chars[b].reset()},E.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},E.clearToEndOfRow=function(){this.clearFromPos(this.pos)},E.getTextString=function(){for(var h=[],b=!0,_=0;_<y;_++){var O=this.chars[_].uchar;O!==" "&&(b=!1),h.push(O)}return b?"":h.join("")},E.setPenStyles=function(h){this.currPenState.setStyles(h);var b=this.chars[this.pos];b.setPenState(this.currPenState)},o}(),m=function(){function o(g){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var h=0;h<M;h++)this.rows.push(new f(g));this.logger=g,this.currRow=M-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var E=o.prototype;return E.reset=function(){for(var h=0;h<M;h++)this.rows[h].clear();this.currRow=M-1},E.equals=function(h){for(var b=!0,_=0;_<M;_++)if(!this.rows[_].equals(h.rows[_])){b=!1;break}return b},E.copy=function(h){for(var b=0;b<M;b++)this.rows[b].copy(h.rows[b])},E.isEmpty=function(){for(var h=!0,b=0;b<M;b++)if(!this.rows[b].isEmpty()){h=!1;break}return h},E.backSpace=function(){var h=this.rows[this.currRow];h.backSpace()},E.clearToEndOfRow=function(){var h=this.rows[this.currRow];h.clearToEndOfRow()},E.insertChar=function(h){var b=this.rows[this.currRow];b.insertChar(h)},E.setPen=function(h){var b=this.rows[this.currRow];b.setPenStyles(h)},E.moveCursor=function(h){var b=this.rows[this.currRow];b.moveCursor(h)},E.setCursor=function(h){this.logger.log(L.INFO,"setCursor: "+h);var b=this.rows[this.currRow];b.setCursor(h)},E.setPAC=function(h){this.logger.log(L.INFO,"pacData = "+JSON.stringify(h));var b=h.row-1;if(this.nrRollUpRows&&b<this.nrRollUpRows-1&&(b=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==b){for(var _=0;_<M;_++)this.rows[_].clear();var O=this.currRow+1-this.nrRollUpRows,C=this.lastOutputScreen;if(C){var P=C.rows[O].cueStartTime,w=this.logger.time;if(P&&w!==null&&P<w)for(var U=0;U<this.nrRollUpRows;U++)this.rows[b-this.nrRollUpRows+U+1].copy(C.rows[O+U])}}this.currRow=b;var k=this.rows[this.currRow];if(h.indent!==null){var N=h.indent,F=Math.max(N-1,0);k.setCursor(h.indent),h.color=k.chars[F].penState.foreground}var H={foreground:h.color,underline:h.underline,italics:h.italics,background:"black",flash:!1};this.setPen(H)},E.setBkgData=function(h){this.logger.log(L.INFO,"bkgData = "+JSON.stringify(h)),this.backSpace(),this.setPen(h),this.insertChar(32)},E.setRollUpRows=function(h){this.nrRollUpRows=h},E.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(L.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(L.TEXT,this.getDisplayText());var h=this.currRow+1-this.nrRollUpRows,b=this.rows.splice(h,1)[0];b.clear(),this.rows.splice(this.currRow,0,b),this.logger.log(L.INFO,"Rolling up")},E.getDisplayText=function(h){h=h||!1;for(var b=[],_="",O=-1,C=0;C<M;C++){var P=this.rows[C].getTextString();P&&(O=C+1,h?b.push("Row "+O+": '"+P+"'"):b.push(P.trim()))}return b.length>0&&(h?_="["+b.join(" | ")+"]":_=b.join(`
|
|
18
|
+
initSegmentChange: `+j);var Y=new M.TransmuxConfig(m,d,f,v,E);this.configureTransmuxer(Y)}if(this.frag=l,this.part=s,O)O.postMessage({cmd:"demux",data:i,decryptdata:P,chunkMeta:o,state:V},i instanceof ArrayBuffer?[i]:[]);else if(_){var Q=_.push(i,P,o,V);Object(M.isPromise)(Q)?Q.then(function(J){b.handleTransmuxComplete(J)}):this.handleTransmuxComplete(Q)}},S.flush=function(i){var f=this;i.transmuxing.start=self.performance.now();var m=this.transmuxer,d=this.worker;if(d)d.postMessage({cmd:"flush",chunkMeta:i});else if(m){var l=m.flush(i);Object(M.isPromise)(l)?l.then(function(s){f.handleFlushResult(s,i)}):this.handleFlushResult(l,i)}},S.handleFlushResult=function(i,f){var m=this;i.forEach(function(d){m.handleTransmuxComplete(d)}),this.onFlush(f)},S.onWorkerMessage=function(i){var f=i.data,m=this.hls;switch(f.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(f.data);break}case"flush":{this.onFlush(f.data);break}case"workerLog":y.logger[f.data.logType]&&y.logger[f.data.logType](f.data.message);break;default:{f.data=f.data||{},f.data.frag=this.frag,f.data.id=this.id,m.trigger(f.event,f.data);break}}},S.configureTransmuxer=function(i){var f=this.worker,m=this.transmuxer;f?f.postMessage({cmd:"configure",config:i}):m&&m.configure(i)},S.handleTransmuxComplete=function(i){i.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(i)},T}()},"./src/demux/transmuxer-worker.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"default",function(){return I});var a=e("./src/demux/transmuxer.ts"),n=e("./src/events.ts"),u=e("./src/utils/logger.ts"),M=e("./node_modules/eventemitter3/index.js"),y=e.n(M);function I(L){var T=new M.EventEmitter,S=function(f,m){L.postMessage({event:f,data:m})};T.on(n.Events.FRAG_DECRYPTED,S),T.on(n.Events.ERROR,S);var c=function(){var f=function(l){var s=function(p){S("workerLog",{logType:l,message:p})};u.logger[l]=s};for(var m in u.logger)f(m)};L.addEventListener("message",function(i){var f=i.data;switch(f.cmd){case"init":{var m=JSON.parse(f.config);L.transmuxer=new a.default(T,f.typeSupported,m,f.vendor,f.id),Object(u.enableLogs)(m.debug),c(),S("init",null);break}case"configure":{L.transmuxer.configure(f.config);break}case"demux":{var d=L.transmuxer.push(f.data,f.decryptdata,f.chunkMeta,f.state);Object(a.isPromise)(d)?d.then(function(v){x(L,v)}):x(L,d);break}case"flush":{var l=f.chunkMeta,s=L.transmuxer.flush(l);Object(a.isPromise)(s)?s.then(function(v){D(L,v,l)}):D(L,s,l);break}default:break}})}function x(L,T){if(R(T.remuxResult))return!1;var S=[],c=T.remuxResult,i=c.audio,f=c.video;return i&&A(S,i),f&&A(S,f),L.postMessage({event:"transmuxComplete",data:T},S),!0}function A(L,T){T.data1&&L.push(T.data1.buffer),T.data2&&L.push(T.data2.buffer)}function D(L,T,S){var c=T.reduce(function(i,f){return x(L,f)||i},!1);c||L.postMessage({event:"transmuxComplete",data:T[0]}),L.postMessage({event:"flush",data:S})}function R(L){return!L.audio&&!L.video&&!L.text&&!L.id3&&!L.initSegment}},"./src/demux/transmuxer.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"default",function(){return S}),e.d(t,"isPromise",function(){return f}),e.d(t,"TransmuxConfig",function(){return m}),e.d(t,"TransmuxState",function(){return d});var a=e("./src/events.ts"),n=e("./src/errors.ts"),u=e("./src/crypt/decrypter.ts"),M=e("./src/demux/aacdemuxer.ts"),y=e("./src/demux/mp4demuxer.ts"),I=e("./src/demux/tsdemuxer.ts"),x=e("./src/demux/mp3demuxer.ts"),A=e("./src/remux/mp4-remuxer.ts"),D=e("./src/remux/passthrough-remuxer.ts"),R=e("./src/utils/logger.ts"),L;try{L=self.performance.now.bind(self.performance)}catch{R.logger.debug("Unable to use Performance API on this environment"),L=self.Date.now}var T=[{demux:I.default,remux:A.default},{demux:y.default,remux:D.default},{demux:M.default,remux:A.default},{demux:x.default,remux:A.default}],S=function(){function l(v,p,o,E,g){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=v,this.typeSupported=p,this.config=o,this.vendor=E,this.id=g}var s=l.prototype;return s.configure=function(p){this.transmuxConfig=p,this.decrypter&&this.decrypter.reset()},s.push=function(p,o,E,g){var h=this,b=E.transmuxing;b.executeStart=L();var _=new Uint8Array(p),O=this.config,C=this.currentTransmuxState,P=this.transmuxConfig;g&&(this.currentTransmuxState=g);var w=g||C,U=w.contiguous,k=w.discontinuity,N=w.trackSwitch,F=w.accurateTimeOffset,H=w.timeOffset,W=w.initSegmentChange,B=P.audioCodec,j=P.videoCodec,V=P.defaultInitPts,Y=P.duration,Q=P.initSegmentData;(k||N||W)&&this.resetInitSegment(Q,B,j,Y),(k||W)&&this.resetInitialTimestamp(V),U||this.resetContiguity();var J=c(_,o);if(J&&J.method==="AES-128"){var z=this.getDecrypter();if(O.enableSoftwareAES){var te=z.softwareDecrypt(_,J.key.buffer,J.iv.buffer);if(!te)return b.executeEnd=L(),i(E);_=new Uint8Array(te)}else return this.decryptionPromise=z.webCryptoDecrypt(_,J.key.buffer,J.iv.buffer).then(function(Ee){var fe=h.push(Ee,null,E);return h.decryptionPromise=null,fe}),this.decryptionPromise}this.needsProbing(_,k,N)&&this.configureTransmuxer(_,P);var se=this.transmux(_,J,H,F,E),Z=this.currentTransmuxState;return Z.contiguous=!0,Z.discontinuity=!1,Z.trackSwitch=!1,b.executeEnd=L(),se},s.flush=function(p){var o=this,E=p.transmuxing;E.executeStart=L();var g=this.decrypter,h=this.currentTransmuxState,b=this.decryptionPromise;if(b)return b.then(function(){return o.flush(p)});var _=[],O=h.timeOffset;if(g){var C=g.flush();C&&_.push(this.push(C,null,p))}var P=this.demuxer,w=this.remuxer;if(!P||!w)return this.observer.emit(a.Events.ERROR,a.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),E.executeEnd=L(),[i(p)];var U=P.flush(O);return f(U)?U.then(function(k){return o.flushRemux(_,k,p),_}):(this.flushRemux(_,U,p),_)},s.flushRemux=function(p,o,E){var g=o.audioTrack,h=o.videoTrack,b=o.id3Track,_=o.textTrack,O=this.currentTransmuxState,C=O.accurateTimeOffset,P=O.timeOffset;R.logger.log("[transmuxer.ts]: Flushed fragment "+E.sn+(E.part>-1?" p: "+E.part:"")+" of level "+E.level);var w=this.remuxer.remux(g,h,b,_,P,C,!0,this.id);p.push({remuxResult:w,chunkMeta:E}),E.transmuxing.executeEnd=L()},s.resetInitialTimestamp=function(p){var o=this.demuxer,E=this.remuxer;!o||!E||(o.resetTimeStamp(p),E.resetTimeStamp(p))},s.resetContiguity=function(){var p=this.demuxer,o=this.remuxer;!p||!o||(p.resetContiguity(),o.resetNextTimestamp())},s.resetInitSegment=function(p,o,E,g){var h=this.demuxer,b=this.remuxer;!h||!b||(h.resetInitSegment(p,o,E,g),b.resetInitSegment(p,o,E))},s.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},s.transmux=function(p,o,E,g,h){var b;return o&&o.method==="SAMPLE-AES"?b=this.transmuxSampleAes(p,o,E,g,h):b=this.transmuxUnencrypted(p,E,g,h),b},s.transmuxUnencrypted=function(p,o,E,g){var h=this.demuxer.demux(p,o,!1,!this.config.progressive),b=h.audioTrack,_=h.videoTrack,O=h.id3Track,C=h.textTrack,P=this.remuxer.remux(b,_,O,C,o,E,!1,this.id);return{remuxResult:P,chunkMeta:g}},s.transmuxSampleAes=function(p,o,E,g,h){var b=this;return this.demuxer.demuxSampleAes(p,o,E).then(function(_){var O=b.remuxer.remux(_.audioTrack,_.videoTrack,_.id3Track,_.textTrack,E,g,!1,b.id);return{remuxResult:O,chunkMeta:h}})},s.configureTransmuxer=function(p,o){for(var E=this.config,g=this.observer,h=this.typeSupported,b=this.vendor,_=o.audioCodec,O=o.defaultInitPts,C=o.duration,P=o.initSegmentData,w=o.videoCodec,U,k=0,N=T.length;k<N;k++)if(T[k].demux.probe(p)){U=T[k];break}U||(R.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),U={demux:y.default,remux:D.default});var F=this.demuxer,H=this.remuxer,W=U.remux,B=U.demux;(!H||!(H instanceof W))&&(this.remuxer=new W(g,E,h,b)),(!F||!(F instanceof B))&&(this.demuxer=new B(g,E,h),this.probe=B.probe),this.resetInitSegment(P,_,w,C),this.resetInitialTimestamp(O)},s.needsProbing=function(p,o,E){return!this.demuxer||!this.remuxer||o||E},s.getDecrypter=function(){var p=this.decrypter;return p||(p=this.decrypter=new u.default(this.observer,this.config)),p},l}();function c(l,s){var v=null;return l.byteLength>0&&s!=null&&s.key!=null&&s.iv!==null&&s.method!=null&&(v=s),v}var i=function(s){return{remuxResult:{},chunkMeta:s}};function f(l){return"then"in l&&l.then instanceof Function}var m=function(s,v,p,o,E){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=s,this.videoCodec=v,this.initSegmentData=p,this.duration=o,this.defaultInitPts=E},d=function(s,v,p,o,E,g){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=s,this.contiguous=v,this.accurateTimeOffset=p,this.trackSwitch=o,this.timeOffset=E,this.initSegmentChange=g}},"./src/demux/tsdemuxer.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"discardEPB",function(){return m});var a=e("./src/demux/adts.ts"),n=e("./src/demux/mpegaudio.ts"),u=e("./src/demux/exp-golomb.ts"),M=e("./src/demux/sample-aes.ts"),y=e("./src/events.ts"),I=e("./src/utils/mp4-tools.ts"),x=e("./src/utils/logger.ts"),A=e("./src/errors.ts"),D=e("./src/types/demuxer.ts");function R(){return R=Object.assign?Object.assign.bind():function(d){for(var l=1;l<arguments.length;l++){var s=arguments[l];for(var v in s)Object.prototype.hasOwnProperty.call(s,v)&&(d[v]=s[v])}return d},R.apply(this,arguments)}var L=function(){function d(s,v,p){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=s,this.config=v,this.typeSupported=p}d.probe=function(v){return v[0]===71&&v[188]===71},d.createTrack=function(v,p){return{container:v==="video"||v==="audio"?"video/mp2t":void 0,type:v,id:I.RemuxerTrackIdConfig[v],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:v==="audio"?p:void 0}};var l=d.prototype;return l.resetInitSegment=function(v,p,o,E){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=d.createTrack("video"),this._audioTrack=d.createTrack("audio",E),this._id3Track=d.createTrack("id3"),this._txtTrack=d.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.audioCodec=p,this.videoCodec=o,this._duration=E},l.resetTimeStamp=function(){},l.resetContiguity=function(){var v=this._audioTrack,p=this._avcTrack,o=this._id3Track;v&&(v.pesData=null),p&&(p.pesData=null),o&&(o.pesData=null),this.aacOverFlow=null},l.demux=function(v,p,o,E){o===void 0&&(o=!1),E===void 0&&(E=!1),o||(this.sampleAes=null);var g,h=this._avcTrack,b=this._audioTrack,_=this._id3Track,O=this._txtTrack,C=h.pid,P=h.pesData,w=b.pid,U=_.pid,k=b.pesData,N=_.pesData,F=null,H=this.pmtParsed,W=this._pmtId,B=v.length;if(this.remainderData&&(v=Object(I.appendUint8Array)(this.remainderData,v),B=v.length,this.remainderData=null),B<188&&!E)return this.remainderData=v,{audioTrack:b,videoTrack:h,id3Track:_,textTrack:O};B-=B%188,B<v.byteLength&&!E&&(this.remainderData=new Uint8Array(v.buffer,B,v.buffer.byteLength-B));for(var j=0,V=0;V<B;V+=188)if(v[V]===71){var Y=!!(v[V+1]&64),Q=((v[V+1]&31)<<8)+v[V+2],J=(v[V+3]&48)>>4,z=void 0;if(J>1){if(z=V+5+v[V+4],z===V+188)continue}else z=V+4;switch(Q){case C:Y&&(P&&(g=i(P))&&this.parseAVCPES(h,O,g,!1),P={data:[],size:0}),P&&(P.data.push(v.subarray(z,V+188)),P.size+=V+188-z);break;case w:if(Y){if(k&&(g=i(k)))switch(b.segmentCodec){case"aac":this.parseAACPES(b,g);break;case"mp3":this.parseMPEGPES(b,g);break}k={data:[],size:0}}k&&(k.data.push(v.subarray(z,V+188)),k.size+=V+188-z);break;case U:Y&&(N&&(g=i(N))&&this.parseID3PES(_,g),N={data:[],size:0}),N&&(N.data.push(v.subarray(z,V+188)),N.size+=V+188-z);break;case 0:Y&&(z+=v[z]+1),W=this._pmtId=S(v,z);break;case W:{Y&&(z+=v[z]+1);var te=c(v,z,this.typeSupported,o);C=te.avc,C>0&&(h.pid=C),w=te.audio,w>0&&(b.pid=w,b.segmentCodec=te.segmentCodec),U=te.id3,U>0&&(_.pid=U),F!==null&&!H&&(x.logger.log("unknown PID '"+F+"' in TS found"),F=null),H=this.pmtParsed=!0;break}case 17:case 8191:break;default:F=Q;break}}else j++;j>0&&this.observer.emit(y.Events.ERROR,y.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"Found "+j+" TS packet/s that do not start with 0x47"}),h.pesData=P,b.pesData=k,_.pesData=N;var se={audioTrack:b,videoTrack:h,id3Track:_,textTrack:O};return E&&this.extractRemainingSamples(se),se},l.flush=function(){var v=this.remainderData;this.remainderData=null;var p;return v?p=this.demux(v,-1,!1,!0):p={videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(p),this.sampleAes?this.decrypt(p,this.sampleAes):p},l.extractRemainingSamples=function(v){var p=v.audioTrack,o=v.videoTrack,E=v.id3Track,g=v.textTrack,h=o.pesData,b=p.pesData,_=E.pesData,O;if(h&&(O=i(h))?(this.parseAVCPES(o,g,O,!0),o.pesData=null):o.pesData=h,b&&(O=i(b))){switch(p.segmentCodec){case"aac":this.parseAACPES(p,O);break;case"mp3":this.parseMPEGPES(p,O);break}p.pesData=null}else b!=null&&b.size&&x.logger.log("last AAC PES packet truncated,might overlap between fragments"),p.pesData=b;_&&(O=i(_))?(this.parseID3PES(E,O),E.pesData=null):E.pesData=_},l.demuxSampleAes=function(v,p,o){var E=this.demux(v,o,!0,!this.config.progressive),g=this.sampleAes=new M.default(this.observer,this.config,p);return this.decrypt(E,g)},l.decrypt=function(v,p){return new Promise(function(o){var E=v.audioTrack,g=v.videoTrack;E.samples&&E.segmentCodec==="aac"?p.decryptAacSamples(E.samples,0,function(){g.samples?p.decryptAvcSamples(g.samples,0,0,function(){o(v)}):o(v)}):g.samples&&p.decryptAvcSamples(g.samples,0,0,function(){o(v)})})},l.destroy=function(){this._duration=0},l.parseAVCPES=function(v,p,o,E){var g=this,h=this.parseAVCNALu(v,o.data),b=!1,_=this.avcSample,O,C=!1;o.data=null,_&&h.length&&!v.audFound&&(f(_,v),_=this.avcSample=T(!1,o.pts,o.dts,"")),h.forEach(function(P){switch(P.type){case 1:{O=!0,_||(_=g.avcSample=T(!0,o.pts,o.dts,"")),b&&(_.debug+="NDR "),_.frame=!0;var w=P.data;if(C&&w.length>4){var U=new u.default(w).readSliceType();(U===2||U===4||U===7||U===9)&&(_.key=!0)}break}case 5:O=!0,_||(_=g.avcSample=T(!0,o.pts,o.dts,"")),b&&(_.debug+="IDR "),_.key=!0,_.frame=!0;break;case 6:{O=!0,b&&_&&(_.debug+="SEI "),Object(I.parseSEIMessageFromNALu)(m(P.data),o.pts,p.samples);break}case 7:if(O=!0,C=!0,b&&_&&(_.debug+="SPS "),!v.sps){var k=new u.default(P.data),N=k.readSPS();v.width=N.width,v.height=N.height,v.pixelRatio=N.pixelRatio,v.sps=[P.data],v.duration=g._duration;for(var F=P.data.subarray(1,4),H="avc1.",W=0;W<3;W++){var B=F[W].toString(16);B.length<2&&(B="0"+B),H+=B}v.codec=H}break;case 8:O=!0,b&&_&&(_.debug+="PPS "),v.pps||(v.pps=[P.data]);break;case 9:O=!1,v.audFound=!0,_&&f(_,v),_=g.avcSample=T(!1,o.pts,o.dts,b?"AUD ":"");break;case 12:O=!0;break;default:O=!1,_&&(_.debug+="unknown NAL "+P.type+" ");break}if(_&&O){var j=_.units;j.push(P)}}),E&&_&&(f(_,v),this.avcSample=null)},l.getLastNalUnit=function(v){var p,o=this.avcSample,E;if((!o||o.units.length===0)&&(o=v[v.length-1]),(p=o)!==null&&p!==void 0&&p.units){var g=o.units;E=g[g.length-1]}return E},l.parseAVCNALu=function(v,p){var o=p.byteLength,E=v.naluState||0,g=E,h=[],b=0,_,O,C,P=-1,w=0;for(E===-1&&(P=0,w=p[0]&31,E=0,b=1);b<o;){if(_=p[b++],!E){E=_?0:1;continue}if(E===1){E=_?0:2;continue}if(!_)E=3;else if(_===1){if(P>=0){var U={data:p.subarray(P,b-E-1),type:w};h.push(U)}else{var k=this.getLastNalUnit(v.samples);if(k&&(g&&b<=4-g&&k.state&&(k.data=k.data.subarray(0,k.data.byteLength-g)),O=b-E-1,O>0)){var N=new Uint8Array(k.data.byteLength+O);N.set(k.data,0),N.set(p.subarray(0,O),k.data.byteLength),k.data=N,k.state=0}}b<o?(C=p[b]&31,P=b,w=C,E=0):E=-1}else E=0}if(P>=0&&E>=0){var F={data:p.subarray(P,o),type:w,state:E};h.push(F)}if(h.length===0){var H=this.getLastNalUnit(v.samples);if(H){var W=new Uint8Array(H.data.byteLength+p.byteLength);W.set(H.data,0),W.set(p,H.data.byteLength),H.data=W}}return v.naluState=E,h},l.parseAACPES=function(v,p){var o=0,E=this.aacOverFlow,g=p.data;if(E){this.aacOverFlow=null;var h=E.missing,b=E.sample.unit.byteLength;if(h===-1){var _=new Uint8Array(b+g.byteLength);_.set(E.sample.unit,0),_.set(g,b),g=_}else{var O=b-h;E.sample.unit.set(g.subarray(0,h),O),v.samples.push(E.sample),o=E.missing}}var C,P;for(C=o,P=g.length;C<P-1&&!a.isHeader(g,C);C++);if(C!==o){var w,U;if(C<P-1?(w="AAC PES did not start with ADTS header,offset:"+C,U=!1):(w="no ADTS header found in AAC PES",U=!0),x.logger.warn("parsing error:"+w),this.observer.emit(y.Events.ERROR,y.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.FRAG_PARSING_ERROR,fatal:U,reason:w}),U)return}a.initTrackConfig(v,this.observer,g,C,this.audioCodec);var k;if(p.pts!==void 0)k=p.pts;else if(E){var N=a.getFrameDuration(v.samplerate);k=E.sample.pts+N}else{x.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var F=0,H;C<P;)if(H=a.appendFrame(v,g,C,k,F),C+=H.length,H.missing){this.aacOverFlow=H;break}else for(F++;C<P-1&&!a.isHeader(g,C);C++);},l.parseMPEGPES=function(v,p){var o=p.data,E=o.length,g=0,h=0,b=p.pts;if(b===void 0){x.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;h<E;)if(n.isHeader(o,h)){var _=n.appendFrame(v,o,h,b,g);if(_)h+=_.length,g++;else break}else h++},l.parseID3PES=function(v,p){if(p.pts===void 0){x.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}var o=R({},p,{type:this._avcTrack?D.MetadataSchema.emsg:D.MetadataSchema.audioId3});v.samples.push(o)},d}();function T(d,l,s,v){return{key:d,frame:!1,pts:l,dts:s,units:[],debug:v,length:0}}function S(d,l){return(d[l+10]&31)<<8|d[l+11]}function c(d,l,s,v){var p={audio:-1,avc:-1,id3:-1,segmentCodec:"aac"},o=(d[l+1]&15)<<8|d[l+2],E=l+3+o-4,g=(d[l+10]&15)<<8|d[l+11];for(l+=12+g;l<E;){var h=(d[l+1]&31)<<8|d[l+2];switch(d[l]){case 207:if(!v){x.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:p.audio===-1&&(p.audio=h);break;case 21:p.id3===-1&&(p.id3=h);break;case 219:if(!v){x.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:p.avc===-1&&(p.avc=h);break;case 3:case 4:s.mpeg!==!0&&s.mp3!==!0?x.logger.log("MPEG audio found, not supported in this browser"):p.audio===-1&&(p.audio=h,p.segmentCodec="mp3");break;case 36:x.logger.warn("Unsupported HEVC stream type found");break;default:break}l+=((d[l+3]&15)<<8|d[l+4])+5}return p}function i(d){var l=0,s,v,p,o,E,g=d.data;if(!d||d.size===0)return null;for(;g[0].length<19&&g.length>1;){var h=new Uint8Array(g[0].length+g[1].length);h.set(g[0]),h.set(g[1],g[0].length),g[0]=h,g.splice(1,1)}s=g[0];var b=(s[0]<<16)+(s[1]<<8)+s[2];if(b===1){if(v=(s[4]<<8)+s[5],v&&v>d.size-6)return null;var _=s[7];_&192&&(o=(s[9]&14)*536870912+(s[10]&255)*4194304+(s[11]&254)*16384+(s[12]&255)*128+(s[13]&254)/2,_&64?(E=(s[14]&14)*536870912+(s[15]&255)*4194304+(s[16]&254)*16384+(s[17]&255)*128+(s[18]&254)/2,o-E>60*9e4&&(x.logger.warn(Math.round((o-E)/9e4)+"s delta between PTS and DTS, align them"),o=E)):E=o),p=s[8];var O=p+9;if(d.size<=O)return null;d.size-=O;for(var C=new Uint8Array(d.size),P=0,w=g.length;P<w;P++){s=g[P];var U=s.byteLength;if(O)if(O>U){O-=U;continue}else s=s.subarray(O),U-=O,O=0;C.set(s,l),l+=U}return v&&(v-=p+3),{data:C,pts:o,dts:E,len:v}}return null}function f(d,l){if(d.units.length&&d.frame){if(d.pts===void 0){var s=l.samples,v=s.length;if(v){var p=s[v-1];d.pts=p.pts,d.dts=p.dts}else{l.dropped++;return}}l.samples.push(d)}d.debug.length&&x.logger.log(d.pts+"/"+d.dts+":"+d.debug)}function m(d){for(var l=d.byteLength,s=[],v=1;v<l-2;)d[v]===0&&d[v+1]===0&&d[v+2]===3?(s.push(v+2),v+=2):v++;if(s.length===0)return d;var p=l-s.length,o=new Uint8Array(p),E=0;for(v=0;v<p;E++,v++)E===s[0]&&(E++,s.shift()),o[v]=d[E];return o}t.default=L},"./src/errors.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"ErrorTypes",function(){return a}),e.d(t,"ErrorDetails",function(){return n});var a;(function(u){u.NETWORK_ERROR="networkError",u.MEDIA_ERROR="mediaError",u.KEY_SYSTEM_ERROR="keySystemError",u.MUX_ERROR="muxError",u.OTHER_ERROR="otherError"})(a||(a={}));var n;(function(u){u.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",u.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",u.KEY_SYSTEM_NO_SESSION="keySystemNoSession",u.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",u.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",u.MANIFEST_LOAD_ERROR="manifestLoadError",u.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",u.MANIFEST_PARSING_ERROR="manifestParsingError",u.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",u.LEVEL_EMPTY_ERROR="levelEmptyError",u.LEVEL_LOAD_ERROR="levelLoadError",u.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",u.LEVEL_SWITCH_ERROR="levelSwitchError",u.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",u.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",u.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",u.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",u.FRAG_LOAD_ERROR="fragLoadError",u.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",u.FRAG_DECRYPT_ERROR="fragDecryptError",u.FRAG_PARSING_ERROR="fragParsingError",u.REMUX_ALLOC_ERROR="remuxAllocError",u.KEY_LOAD_ERROR="keyLoadError",u.KEY_LOAD_TIMEOUT="keyLoadTimeOut",u.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",u.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",u.BUFFER_APPEND_ERROR="bufferAppendError",u.BUFFER_APPENDING_ERROR="bufferAppendingError",u.BUFFER_STALLED_ERROR="bufferStalledError",u.BUFFER_FULL_ERROR="bufferFullError",u.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",u.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",u.INTERNAL_EXCEPTION="internalException",u.INTERNAL_ABORTED="aborted",u.UNKNOWN="unknown"})(n||(n={}))},"./src/events.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"Events",function(){return a});var a;(function(n){n.MEDIA_ATTACHING="hlsMediaAttaching",n.MEDIA_ATTACHED="hlsMediaAttached",n.MEDIA_DETACHING="hlsMediaDetaching",n.MEDIA_DETACHED="hlsMediaDetached",n.BUFFER_RESET="hlsBufferReset",n.BUFFER_CODECS="hlsBufferCodecs",n.BUFFER_CREATED="hlsBufferCreated",n.BUFFER_APPENDING="hlsBufferAppending",n.BUFFER_APPENDED="hlsBufferAppended",n.BUFFER_EOS="hlsBufferEos",n.BUFFER_FLUSHING="hlsBufferFlushing",n.BUFFER_FLUSHED="hlsBufferFlushed",n.MANIFEST_LOADING="hlsManifestLoading",n.MANIFEST_LOADED="hlsManifestLoaded",n.MANIFEST_PARSED="hlsManifestParsed",n.LEVEL_SWITCHING="hlsLevelSwitching",n.LEVEL_SWITCHED="hlsLevelSwitched",n.LEVEL_LOADING="hlsLevelLoading",n.LEVEL_LOADED="hlsLevelLoaded",n.LEVEL_UPDATED="hlsLevelUpdated",n.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",n.LEVELS_UPDATED="hlsLevelsUpdated",n.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",n.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",n.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",n.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",n.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",n.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",n.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",n.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",n.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",n.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",n.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",n.CUES_PARSED="hlsCuesParsed",n.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",n.INIT_PTS_FOUND="hlsInitPtsFound",n.FRAG_LOADING="hlsFragLoading",n.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",n.FRAG_LOADED="hlsFragLoaded",n.FRAG_DECRYPTED="hlsFragDecrypted",n.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",n.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",n.FRAG_PARSING_METADATA="hlsFragParsingMetadata",n.FRAG_PARSED="hlsFragParsed",n.FRAG_BUFFERED="hlsFragBuffered",n.FRAG_CHANGED="hlsFragChanged",n.FPS_DROP="hlsFpsDrop",n.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",n.ERROR="hlsError",n.DESTROYING="hlsDestroying",n.KEY_LOADING="hlsKeyLoading",n.KEY_LOADED="hlsKeyLoaded",n.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",n.BACK_BUFFER_REACHED="hlsBackBufferReached"})(a||(a={}))},"./src/hls.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"default",function(){return l});var a=e("./node_modules/url-toolkit/src/url-toolkit.js"),n=e.n(a),u=e("./src/loader/playlist-loader.ts"),M=e("./src/loader/key-loader.ts"),y=e("./src/controller/id3-track-controller.ts"),I=e("./src/controller/latency-controller.ts"),x=e("./src/controller/level-controller.ts"),A=e("./src/controller/fragment-tracker.ts"),D=e("./src/controller/stream-controller.ts"),R=e("./src/is-supported.ts"),L=e("./src/utils/logger.ts"),T=e("./src/config.ts"),S=e("./node_modules/eventemitter3/index.js"),c=e.n(S),i=e("./src/events.ts"),f=e("./src/errors.ts");function m(s,v){for(var p=0;p<v.length;p++){var o=v[p];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(s,o.key,o)}}function d(s,v,p){return v&&m(s.prototype,v),p&&m(s,p),Object.defineProperty(s,"prototype",{writable:!1}),s}var l=function(){s.isSupported=function(){return Object(R.isSupported)()};function s(p){p===void 0&&(p={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new S.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var o=this.config=Object(T.mergeConfig)(s.DefaultConfig,p);this.userConfig=p,Object(L.enableLogs)(o.debug),this._autoLevelCapping=-1,o.progressive&&Object(T.enableStreamingMode)(o);var E=o.abrController,g=o.bufferController,h=o.capLevelController,b=o.fpsController,_=this.abrController=new E(this),O=this.bufferController=new g(this),C=this.capLevelController=new h(this),P=new b(this),w=new u.default(this),U=new M.default(this),k=new y.default(this),N=this.levelController=new x.default(this),F=new A.FragmentTracker(this),H=this.streamController=new D.default(this,F);C.setStreamController(H),P.setStreamController(H);var W=[w,U,N,H];this.networkControllers=W;var B=[_,O,C,P,k,F];this.audioTrackController=this.createController(o.audioTrackController,null,W),this.createController(o.audioStreamController,F,W),this.subtitleTrackController=this.createController(o.subtitleTrackController,null,W),this.createController(o.subtitleStreamController,F,W),this.createController(o.timelineController,null,B),this.emeController=this.createController(o.emeController,null,B),this.cmcdController=this.createController(o.cmcdController,null,B),this.latencyController=this.createController(I.default,null,B),this.coreComponents=B}var v=s.prototype;return v.createController=function(o,E,g){if(o){var h=E?new o(this,E):new o(this);return g&&g.push(h),h}return null},v.on=function(o,E,g){g===void 0&&(g=this),this._emitter.on(o,E,g)},v.once=function(o,E,g){g===void 0&&(g=this),this._emitter.once(o,E,g)},v.removeAllListeners=function(o){this._emitter.removeAllListeners(o)},v.off=function(o,E,g,h){g===void 0&&(g=this),this._emitter.off(o,E,g,h)},v.listeners=function(o){return this._emitter.listeners(o)},v.emit=function(o,E,g){return this._emitter.emit(o,E,g)},v.trigger=function(o,E){if(this.config.debug)return this.emit(o,o,E);try{return this.emit(o,o,E)}catch(g){L.logger.error("An internal error happened while handling event "+o+'. Error message: "'+g.message+'". Here is a stacktrace:',g),this.trigger(i.Events.ERROR,{type:f.ErrorTypes.OTHER_ERROR,details:f.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:o,error:g})}return!1},v.listenerCount=function(o){return this._emitter.listenerCount(o)},v.destroy=function(){L.logger.log("destroy"),this.trigger(i.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(o){return o.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(o){return o.destroy()}),this.coreComponents.length=0},v.attachMedia=function(o){L.logger.log("attachMedia"),this._media=o,this.trigger(i.Events.MEDIA_ATTACHING,{media:o})},v.detachMedia=function(){L.logger.log("detachMedia"),this.trigger(i.Events.MEDIA_DETACHING,void 0),this._media=null},v.loadSource=function(o){this.stopLoad();var E=this.media,g=this.url,h=this.url=a.buildAbsoluteURL(self.location.href,o,{alwaysNormalize:!0});L.logger.log("loadSource:"+h),E&&g&&g!==h&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(E)),this.trigger(i.Events.MANIFEST_LOADING,{url:o})},v.startLoad=function(o){o===void 0&&(o=-1),L.logger.log("startLoad("+o+")"),this.networkControllers.forEach(function(E){E.startLoad(o)})},v.stopLoad=function(){L.logger.log("stopLoad"),this.networkControllers.forEach(function(o){o.stopLoad()})},v.swapAudioCodec=function(){L.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},v.recoverMediaError=function(){L.logger.log("recoverMediaError");var o=this._media;this.detachMedia(),o&&this.attachMedia(o)},v.removeLevel=function(o,E){E===void 0&&(E=0),this.levelController.removeLevel(o,E)},d(s,[{key:"levels",get:function(){var o=this.levelController.levels;return o||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(o){L.logger.log("set currentLevel:"+o),this.loadLevel=o,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(o){L.logger.log("set nextLevel:"+o),this.levelController.manualLevel=o,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(o){L.logger.log("set loadLevel:"+o),this.levelController.manualLevel=o}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(o){this.levelController.nextLoadLevel=o}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(o){L.logger.log("set firstLevel:"+o),this.levelController.firstLevel=o}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(o){L.logger.log("set startLevel:"+o),o!==-1&&(o=Math.max(o,this.minAutoLevel)),this.levelController.startLevel=o}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(o){var E=!!o;E!==this.config.capLevelToPlayerSize&&(E?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=E)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(o){this._autoLevelCapping!==o&&(L.logger.log("set autoLevelCapping:"+o),this._autoLevelCapping=o)}},{key:"bandwidthEstimate",get:function(){var o=this.abrController.bwEstimator;return o?o.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var o=this.levels,E=this.config.minAutoBitrate;if(!o)return 0;for(var g=o.length,h=0;h<g;h++)if(o[h].maxBitrate>=E)return h;return 0}},{key:"maxAutoLevel",get:function(){var o=this.levels,E=this.autoLevelCapping,g;return E===-1&&o&&o.length?g=o.length-1:g=E,g}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(o){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,o)}},{key:"playingDate",get:function(){return this.streamController.currentProgramDateTime}},{key:"audioTracks",get:function(){var o=this.audioTrackController;return o?o.audioTracks:[]}},{key:"audioTrack",get:function(){var o=this.audioTrackController;return o?o.audioTrack:-1},set:function(o){var E=this.audioTrackController;E&&(E.audioTrack=o)}},{key:"subtitleTracks",get:function(){var o=this.subtitleTrackController;return o?o.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var o=this.subtitleTrackController;return o?o.subtitleTrack:-1},set:function(o){var E=this.subtitleTrackController;E&&(E.subtitleTrack=o)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var o=this.subtitleTrackController;return o?o.subtitleDisplay:!1},set:function(o){var E=this.subtitleTrackController;E&&(E.subtitleDisplay=o)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(o){this.config.lowLatencyMode=o}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.2.3"}},{key:"Events",get:function(){return i.Events}},{key:"ErrorTypes",get:function(){return f.ErrorTypes}},{key:"ErrorDetails",get:function(){return f.ErrorDetails}},{key:"DefaultConfig",get:function(){return s.defaultConfig?s.defaultConfig:T.hlsDefaultConfig},set:function(o){s.defaultConfig=o}}]),s}();l.defaultConfig=void 0},"./src/is-supported.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"isSupported",function(){return u}),e.d(t,"changeTypeSupported",function(){return M});var a=e("./src/utils/mediasource-helper.ts");function n(){return self.SourceBuffer||self.WebKitSourceBuffer}function u(){var y=Object(a.getMediaSource)();if(!y)return!1;var I=n(),x=y&&typeof y.isTypeSupported=="function"&&y.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),A=!I||I.prototype&&typeof I.prototype.appendBuffer=="function"&&typeof I.prototype.remove=="function";return!!x&&!!A}function M(){var y,I=n();return typeof(I==null||(y=I.prototype)===null||y===void 0?void 0:y.changeType)=="function"}},"./src/loader/date-range.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"DateRangeAttribute",function(){return x}),e.d(t,"DateRange",function(){return A});var a=e("./src/polyfills/number.ts"),n=e("./src/utils/attr-list.ts"),u=e("./src/utils/logger.ts");function M(){return M=Object.assign?Object.assign.bind():function(D){for(var R=1;R<arguments.length;R++){var L=arguments[R];for(var T in L)Object.prototype.hasOwnProperty.call(L,T)&&(D[T]=L[T])}return D},M.apply(this,arguments)}function y(D,R){for(var L=0;L<R.length;L++){var T=R[L];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(D,T.key,T)}}function I(D,R,L){return R&&y(D.prototype,R),L&&y(D,L),Object.defineProperty(D,"prototype",{writable:!1}),D}var x;(function(D){D.ID="ID",D.CLASS="CLASS",D.START_DATE="START-DATE",D.DURATION="DURATION",D.END_DATE="END-DATE",D.END_ON_NEXT="END-ON-NEXT",D.PLANNED_DURATION="PLANNED-DURATION",D.SCTE35_OUT="SCTE35-OUT",D.SCTE35_IN="SCTE35-IN"})(x||(x={}));var A=function(){function D(R,L){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,L){var T=L.attr;for(var S in T)if(Object.prototype.hasOwnProperty.call(R,S)&&R[S]!==T[S]){u.logger.warn('DATERANGE tag attribute: "'+S+'" does not match for tags with ID: "'+R.ID+'"'),this._badValueForSameId=S;break}R=M(new n.AttrList({}),T,R)}if(this.attr=R,this._startDate=new Date(R[x.START_DATE]),x.END_DATE in this.attr){var c=new Date(this.attr[x.END_DATE]);Object(a.isFiniteNumber)(c.getTime())&&(this._endDate=c)}}return I(D,[{key:"id",get:function(){return this.attr.ID}},{key:"class",get:function(){return this.attr.CLASS}},{key:"startDate",get:function(){return this._startDate}},{key:"endDate",get:function(){if(this._endDate)return this._endDate;var L=this.duration;return L!==null?new Date(this._startDate.getTime()+L*1e3):null}},{key:"duration",get:function(){if(x.DURATION in this.attr){var L=this.attr.decimalFloatingPoint(x.DURATION);if(Object(a.isFiniteNumber)(L))return L}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}},{key:"plannedDuration",get:function(){return x.PLANNED_DURATION in this.attr?this.attr.decimalFloatingPoint(x.PLANNED_DURATION):null}},{key:"endOnNext",get:function(){return this.attr.bool(x.END_ON_NEXT)}},{key:"isValid",get:function(){return!!this.id&&!this._badValueForSameId&&Object(a.isFiniteNumber)(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}]),D}()},"./src/loader/fragment-loader.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"default",function(){return L}),e.d(t,"LoadError",function(){return S});var a=e("./src/polyfills/number.ts"),n=e("./src/errors.ts");function u(c,i){c.prototype=Object.create(i.prototype),c.prototype.constructor=c,A(c,i)}function M(c){var i=typeof Map=="function"?new Map:void 0;return M=function(m){if(m===null||!x(m))return m;if(typeof m!="function")throw new TypeError("Super expression must either be null or a function");if(typeof i!="undefined"){if(i.has(m))return i.get(m);i.set(m,d)}function d(){return y(m,arguments,D(this).constructor)}return d.prototype=Object.create(m.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),A(d,m)},M(c)}function y(c,i,f){return I()?y=Reflect.construct.bind():y=function(d,l,s){var v=[null];v.push.apply(v,l);var p=Function.bind.apply(d,v),o=new p;return s&&A(o,s.prototype),o},y.apply(null,arguments)}function I(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function x(c){return Function.toString.call(c).indexOf("[native code]")!==-1}function A(c,i){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(m,d){return m.__proto__=d,m},A(c,i)}function D(c){return D=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(f){return f.__proto__||Object.getPrototypeOf(f)},D(c)}var R=Math.pow(2,17),L=function(){function c(f){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=f}var i=c.prototype;return i.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},i.abort=function(){this.loader&&this.loader.abort()},i.load=function(m,d){var l=this,s=m.url;if(!s)return Promise.reject(new S({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:m,networkDetails:null},"Fragment does not have a "+(s?"part list":"url")));this.abort();var v=this.config,p=v.fLoader,o=v.loader;return new Promise(function(E,g){l.loader&&l.loader.destroy();var h=l.loader=m.loader=p?new p(v):new o(v),b=T(m),_={timeout:v.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:v.fragLoadingMaxRetryTimeout,highWaterMark:m.sn==="initSegment"?1/0:R};m.stats=h.stats,h.load(b,_,{onSuccess:function(C,P,w,U){l.resetLoader(m,h),E({frag:m,part:null,payload:C.data,networkDetails:U})},onError:function(C,P,w){l.resetLoader(m,h),g(new S({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:m,response:C,networkDetails:w}))},onAbort:function(C,P,w){l.resetLoader(m,h),g(new S({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:m,networkDetails:w}))},onTimeout:function(C,P,w){l.resetLoader(m,h),g(new S({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:m,networkDetails:w}))},onProgress:function(C,P,w,U){d&&d({frag:m,part:null,payload:w,networkDetails:U})}})})},i.loadPart=function(m,d,l){var s=this;this.abort();var v=this.config,p=v.fLoader,o=v.loader;return new Promise(function(E,g){s.loader&&s.loader.destroy();var h=s.loader=m.loader=p?new p(v):new o(v),b=T(m,d),_={timeout:v.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:v.fragLoadingMaxRetryTimeout,highWaterMark:R};d.stats=h.stats,h.load(b,_,{onSuccess:function(C,P,w,U){s.resetLoader(m,h),s.updateStatsFromPart(m,d);var k={frag:m,part:d,payload:C.data,networkDetails:U};l(k),E(k)},onError:function(C,P,w){s.resetLoader(m,h),g(new S({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:m,part:d,response:C,networkDetails:w}))},onAbort:function(C,P,w){m.stats.aborted=d.stats.aborted,s.resetLoader(m,h),g(new S({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:m,part:d,networkDetails:w}))},onTimeout:function(C,P,w){s.resetLoader(m,h),g(new S({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:m,part:d,networkDetails:w}))}})})},i.updateStatsFromPart=function(m,d){var l=m.stats,s=d.stats,v=s.total;if(l.loaded+=s.loaded,v){var p=Math.round(m.duration/d.duration),o=Math.min(Math.round(l.loaded/v),p),E=p-o,g=E*Math.round(l.loaded/o);l.total=l.loaded+g}else l.total=Math.max(l.loaded,l.total);var h=l.loading,b=s.loading;h.start?h.first+=b.first-b.start:(h.start=b.start,h.first=b.first),h.end=b.end},i.resetLoader=function(m,d){m.loader=null,this.loader===d&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),d.destroy()},c}();function T(c,i){i===void 0&&(i=null);var f=i||c,m={frag:c,part:i,responseType:"arraybuffer",url:f.url,headers:{},rangeStart:0,rangeEnd:0},d=f.byteRangeStartOffset,l=f.byteRangeEndOffset;return Object(a.isFiniteNumber)(d)&&Object(a.isFiniteNumber)(l)&&(m.rangeStart=d,m.rangeEnd=l),m}var S=function(c){u(i,c);function i(f){for(var m,d=arguments.length,l=new Array(d>1?d-1:0),s=1;s<d;s++)l[s-1]=arguments[s];return m=c.call.apply(c,[this].concat(l))||this,m.data=void 0,m.data=f,m}return i}(M(Error))},"./src/loader/fragment.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"ElementaryStreamTypes",function(){return L}),e.d(t,"BaseSegment",function(){return T}),e.d(t,"Fragment",function(){return S}),e.d(t,"Part",function(){return c});var a=e("./src/polyfills/number.ts"),n=e("./node_modules/url-toolkit/src/url-toolkit.js"),u=e.n(n),M=e("./src/utils/logger.ts"),y=e("./src/loader/level-key.ts"),I=e("./src/loader/load-stats.ts");function x(i,f){i.prototype=Object.create(f.prototype),i.prototype.constructor=i,A(i,f)}function A(i,f){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,l){return d.__proto__=l,d},A(i,f)}function D(i,f){for(var m=0;m<f.length;m++){var d=f[m];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(i,d.key,d)}}function R(i,f,m){return f&&D(i.prototype,f),m&&D(i,m),Object.defineProperty(i,"prototype",{writable:!1}),i}var L;(function(i){i.AUDIO="audio",i.VIDEO="video",i.AUDIOVIDEO="audiovideo"})(L||(L={}));var T=function(){function i(m){var d;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(d={},d[L.AUDIO]=null,d[L.VIDEO]=null,d[L.AUDIOVIDEO]=null,d),this.baseurl=m}var f=i.prototype;return f.setByteRange=function(d,l){var s=d.split("@",2),v=[];s.length===1?v[0]=l?l.byteRangeEndOffset:0:v[0]=parseInt(s[1]),v[1]=parseInt(s[0])+v[0],this._byteRange=v},R(i,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(n.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(d){this._url=d}}]),i}(),S=function(i){x(f,i);function f(d,l){var s;return s=i.call(this,l)||this,s._decryptdata=null,s.rawProgramDateTime=null,s.programDateTime=null,s.tagList=[],s.duration=0,s.sn=0,s.levelkey=void 0,s.type=void 0,s.loader=null,s.level=-1,s.cc=0,s.startPTS=void 0,s.endPTS=void 0,s.appendedPTS=void 0,s.startDTS=void 0,s.endDTS=void 0,s.start=0,s.deltaPTS=void 0,s.maxStartPTS=void 0,s.minEndPTS=void 0,s.stats=new I.LoadStats,s.urlId=0,s.data=void 0,s.bitrateTest=!1,s.title=null,s.initSegment=null,s.type=d,s}var m=f.prototype;return m.createInitializationVector=function(l){for(var s=new Uint8Array(16),v=12;v<16;v++)s[v]=l>>8*(15-v)&255;return s},m.setDecryptDataFromLevelKey=function(l,s){var v=l;return(l==null?void 0:l.method)==="AES-128"&&l.uri&&!l.iv&&(v=y.LevelKey.fromURI(l.uri),v.method=l.method,v.iv=this.createInitializationVector(s),v.keyFormat="identity"),v},m.setElementaryStreamInfo=function(l,s,v,p,o,E){E===void 0&&(E=!1);var g=this.elementaryStreams,h=g[l];if(!h){g[l]={startPTS:s,endPTS:v,startDTS:p,endDTS:o,partial:E};return}h.startPTS=Math.min(h.startPTS,s),h.endPTS=Math.max(h.endPTS,v),h.startDTS=Math.min(h.startDTS,p),h.endDTS=Math.max(h.endDTS,o)},m.clearElementaryStreamInfo=function(){var l=this.elementaryStreams;l[L.AUDIO]=null,l[L.VIDEO]=null,l[L.AUDIOVIDEO]=null},R(f,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var l=this.sn;typeof l!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&M.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),l=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,l)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null||!Object(a.isFiniteNumber)(this.programDateTime))return null;var l=Object(a.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+l*1e3}},{key:"encrypted",get:function(){var l;return!!((l=this.decryptdata)!==null&&l!==void 0&&l.keyFormat&&this.decryptdata.uri)}}]),f}(T),c=function(i){x(f,i);function f(m,d,l,s,v){var p;p=i.call(this,l)||this,p.fragOffset=0,p.duration=0,p.gap=!1,p.independent=!1,p.relurl=void 0,p.fragment=void 0,p.index=void 0,p.stats=new I.LoadStats,p.duration=m.decimalFloatingPoint("DURATION"),p.gap=m.bool("GAP"),p.independent=m.bool("INDEPENDENT"),p.relurl=m.enumeratedString("URI"),p.fragment=d,p.index=s;var o=m.enumeratedString("BYTERANGE");return o&&p.setByteRange(o,v),v&&(p.fragOffset=v.fragOffset+v.duration),p}return R(f,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var d=this.elementaryStreams;return!!(d.audio||d.video||d.audiovideo)}}]),f}(T)},"./src/loader/key-loader.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"default",function(){return M});var a=e("./src/events.ts"),n=e("./src/errors.ts"),u=e("./src/utils/logger.ts"),M=function(){function y(x){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=x,this.registerListeners()}var I=y.prototype;return I.startLoad=function(A){},I.stopLoad=function(){this.destroyInternalLoaders()},I.registerListeners=function(){this.hls.on(a.Events.KEY_LOADING,this.onKeyLoading,this)},I.unregisterListeners=function(){this.hls.off(a.Events.KEY_LOADING,this.onKeyLoading)},I.destroyInternalLoaders=function(){for(var A in this.loaders){var D=this.loaders[A];D&&D.destroy()}this.loaders={}},I.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},I.onKeyLoading=function(A,D){var R=D.frag,L=R.type,T=this.loaders[L];if(!R.decryptdata){u.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var S=R.decryptdata.uri;if(S!==this.decrypturl||this.decryptkey===null){var c=this.hls.config;if(T&&(u.logger.warn("abort previous key loader for type:"+L),T.abort()),!S){u.logger.warn("key uri is falsy");return}var i=c.loader,f=R.loader=this.loaders[L]=new i(c);this.decrypturl=S,this.decryptkey=null;var m={url:S,frag:R,responseType:"arraybuffer"},d={timeout:c.fragLoadingTimeOut,maxRetry:0,retryDelay:c.fragLoadingRetryDelay,maxRetryDelay:c.fragLoadingMaxRetryTimeout,highWaterMark:0},l={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};f.load(m,d,l)}else this.decryptkey&&(R.decryptdata.key=this.decryptkey,this.hls.trigger(a.Events.KEY_LOADED,{frag:R}))},I.loadsuccess=function(A,D,R){var L=R.frag;if(!L.decryptdata){u.logger.error("after key load, decryptdata unset");return}this.decryptkey=L.decryptdata.key=new Uint8Array(A.data),L.loader=null,delete this.loaders[L.type],this.hls.trigger(a.Events.KEY_LOADED,{frag:L})},I.loaderror=function(A,D){var R=D.frag,L=R.loader;L&&L.abort(),delete this.loaders[R.type],this.hls.trigger(a.Events.ERROR,{type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:R,response:A})},I.loadtimeout=function(A,D){var R=D.frag,L=R.loader;L&&L.abort(),delete this.loaders[R.type],this.hls.trigger(a.Events.ERROR,{type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:R})},y}()},"./src/loader/level-details.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"LevelDetails",function(){return y});var a=e("./src/polyfills/number.ts");function n(I,x){for(var A=0;A<x.length;A++){var D=x[A];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(I,D.key,D)}}function u(I,x,A){return x&&n(I.prototype,x),A&&n(I,A),Object.defineProperty(I,"prototype",{writable:!1}),I}var M=10,y=function(){function I(A){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.dateRanges={},this.url=A}var x=I.prototype;return x.reloaded=function(D){if(!D){this.advanced=!0,this.updated=!0;return}var R=this.lastPartSn-D.lastPartSn,L=this.lastPartIndex-D.lastPartIndex;this.updated=this.endSN!==D.endSN||!!L||!!R,this.advanced=this.endSN>D.endSN||R>0||R===0&&L>0,this.updated||this.advanced?this.misses=Math.floor(D.misses*.6):this.misses=D.misses+1,this.availabilityDelay=D.availabilityDelay},u(I,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(a.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||M}},{key:"drift",get:function(){var D=this.driftEndTime-this.driftStartTime;if(D>0){var R=this.driftEnd-this.driftStart;return R*1e3/D}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var D;return(D=this.partList)!==null&&D!==void 0&&D.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var D;return(D=this.fragments)!==null&&D!==void 0&&D.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var D;return(D=this.partList)!==null&&D!==void 0&&D.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var D;return(D=this.partList)!==null&&D!==void 0&&D.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),I}()},"./src/loader/level-key.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"LevelKey",function(){return y});var a=e("./node_modules/url-toolkit/src/url-toolkit.js"),n=e.n(a);function u(I,x){for(var A=0;A<x.length;A++){var D=x[A];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(I,D.key,D)}}function M(I,x,A){return x&&u(I.prototype,x),A&&u(I,A),Object.defineProperty(I,"prototype",{writable:!1}),I}var y=function(){I.fromURL=function(A,D){return new I(A,D)},I.fromURI=function(A){return new I(A)};function I(x,A){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,A?this._uri=Object(a.buildAbsoluteURL)(x,A,{alwaysNormalize:!0}):this._uri=x}return M(I,[{key:"uri",get:function(){return this._uri}}]),I}()},"./src/loader/load-stats.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"LoadStats",function(){return a});var a=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"default",function(){return m});var a=e("./src/polyfills/number.ts"),n=e("./node_modules/url-toolkit/src/url-toolkit.js"),u=e.n(n),M=e("./src/loader/date-range.ts"),y=e("./src/loader/fragment.ts"),I=e("./src/loader/level-details.ts"),x=e("./src/loader/level-key.ts"),A=e("./src/utils/attr-list.ts"),D=e("./src/utils/logger.ts"),R=e("./src/utils/codecs.ts"),L=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,T=/#EXT-X-MEDIA:(.*)/g,S=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),c=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),i=/\.(mp4|m4s|m4v|m4a)$/i;function f(o){var E,g;return i.test((E=(g=n.parseURL(o))===null||g===void 0?void 0:g.path)!=null?E:"")}var m=function(){function o(){}return o.findGroup=function(g,h){for(var b=0;b<g.length;b++){var _=g[b];if(_.id===h)return _}},o.convertAVC1ToAVCOTI=function(g){var h=g.split(".");if(h.length>2){var b=h.shift()+".";return b+=parseInt(h.shift()).toString(16),b+=("000"+parseInt(h.shift()).toString(16)).slice(-4),b}return g},o.resolve=function(g,h){return n.buildAbsoluteURL(h,g,{alwaysNormalize:!0})},o.parseMasterPlaylist=function(g,h){var b=[],_={},O=!1;L.lastIndex=0;for(var C;(C=L.exec(g))!=null;)if(C[1]){var P=new A.AttrList(C[1]),w={attrs:P,bitrate:P.decimalInteger("AVERAGE-BANDWIDTH")||P.decimalInteger("BANDWIDTH"),name:P.NAME,url:o.resolve(C[2],h)},U=P.decimalResolution("RESOLUTION");U&&(w.width=U.width,w.height=U.height),d((P.CODECS||"").split(/[ ,]+/).filter(function(N){return N}),w),w.videoCodec&&w.videoCodec.indexOf("avc1")!==-1&&(w.videoCodec=o.convertAVC1ToAVCOTI(w.videoCodec)),b.push(w)}else if(C[3]){var k=new A.AttrList(C[3]);k["DATA-ID"]&&(O=!0,_[k["DATA-ID"]]=k)}return{levels:b,sessionData:O?_:null}},o.parseMasterPlaylistMedia=function(g,h,b,_){_===void 0&&(_=[]);var O,C=[],P=0;for(T.lastIndex=0;(O=T.exec(g))!==null;){var w=new A.AttrList(O[1]);if(w.TYPE===b){var U={attrs:w,bitrate:0,id:P++,groupId:w["GROUP-ID"],instreamId:w["INSTREAM-ID"],name:w.NAME||w.LANGUAGE||"",type:b,default:w.bool("DEFAULT"),autoselect:w.bool("AUTOSELECT"),forced:w.bool("FORCED"),lang:w.LANGUAGE,url:w.URI?o.resolve(w.URI,h):""};if(_.length){var k=o.findGroup(_,U.groupId)||_[0];l(U,k,"audioCodec"),l(U,k,"textCodec")}C.push(U)}}return C},o.parseLevelPlaylist=function(g,h,b,_,O){var C=new I.LevelDetails(h),P=C.fragments,w=null,U=0,k=0,N=0,F=0,H=null,W=new y.Fragment(_,h),B,j,V,Y=-1,Q=!1;for(S.lastIndex=0,C.m3u8=g;(B=S.exec(g))!==null;){Q&&(Q=!1,W=new y.Fragment(_,h),W.start=N,W.sn=U,W.cc=F,W.level=b,w&&(W.initSegment=w,W.rawProgramDateTime=w.rawProgramDateTime,w.rawProgramDateTime=null));var J=B[1];if(J){W.duration=parseFloat(J);var z=(" "+B[2]).slice(1);W.title=z||null,W.tagList.push(z?["INF",J,z]:["INF",J])}else if(B[3])Object(a.isFiniteNumber)(W.duration)&&(W.start=N,V&&(W.levelkey=V),W.sn=U,W.level=b,W.cc=F,W.urlId=O,P.push(W),W.relurl=(" "+B[3]).slice(1),v(W,H),H=W,N+=W.duration,U++,k=0,Q=!0);else if(B[4]){var te=(" "+B[4]).slice(1);H?W.setByteRange(te,H):W.setByteRange(te)}else if(B[5])W.rawProgramDateTime=(" "+B[5]).slice(1),W.tagList.push(["PROGRAM-DATE-TIME",W.rawProgramDateTime]),Y===-1&&(Y=P.length);else{if(B=B[0].match(c),!B){D.logger.warn("No matches on slow regex match for level playlist!");continue}for(j=1;j<B.length&&typeof B[j]=="undefined";j++);var se=(" "+B[j]).slice(1),Z=(" "+B[j+1]).slice(1),Ee=B[j+2]?(" "+B[j+2]).slice(1):"";switch(se){case"PLAYLIST-TYPE":C.type=Z.toUpperCase();break;case"MEDIA-SEQUENCE":U=C.startSN=parseInt(Z);break;case"SKIP":{var fe=new A.AttrList(Z),re=fe.decimalInteger("SKIPPED-SEGMENTS");if(Object(a.isFiniteNumber)(re)){C.skippedSegments=re;for(var q=re;q--;)P.unshift(null);U+=re}var ie=fe.enumeratedString("RECENTLY-REMOVED-DATERANGES");ie&&(C.recentlyRemovedDateranges=ie.split(" "));break}case"TARGETDURATION":C.targetduration=parseFloat(Z);break;case"VERSION":C.version=parseInt(Z);break;case"EXTM3U":break;case"ENDLIST":C.live=!1;break;case"#":(Z||Ee)&&W.tagList.push(Ee?[Z,Ee]:[Z]);break;case"DISCONTINUITY":F++,W.tagList.push(["DIS"]);break;case"GAP":W.tagList.push([se]);break;case"BITRATE":W.tagList.push([se,Z]);break;case"DATERANGE":{var ne=new A.AttrList(Z),Te=new M.DateRange(ne,C.dateRanges[ne.ID]);Te.isValid||C.skippedSegments?C.dateRanges[Te.id]=Te:D.logger.warn('Ignoring invalid DATERANGE tag: "'+Z+'"'),W.tagList.push(["EXT-X-DATERANGE",Z]);break}case"DISCONTINUITY-SEQUENCE":F=parseInt(Z);break;case"KEY":{var Se,he=new A.AttrList(Z),Oe=he.enumeratedString("METHOD"),Ce=he.URI,Ue=he.hexadecimalInteger("IV"),me=he.enumeratedString("KEYFORMATVERSIONS"),Ae=he.enumeratedString("KEYID"),Re=(Se=he.enumeratedString("KEYFORMAT"))!=null?Se:"identity",Ie=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Ie.indexOf(Re)>-1){D.logger.warn("Keyformat "+Re+" is not supported from the manifest");continue}else if(Re!=="identity")continue;Oe&&(V=x.LevelKey.fromURL(h,Ce),Ce&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Oe)>=0&&(V.method=Oe,V.keyFormat=Re,Ae&&(V.keyID=Ae),me&&(V.keyFormatVersions=me),V.iv=Ue));break}case"START":{var Ne=new A.AttrList(Z),je=Ne.decimalFloatingPoint("TIME-OFFSET");Object(a.isFiniteNumber)(je)&&(C.startTimeOffset=je);break}case"MAP":{var Qe=new A.AttrList(Z);if(W.duration){var Fe=new y.Fragment(_,h);p(Fe,Qe,b,V),w=Fe,W.initSegment=w,w.rawProgramDateTime&&!W.rawProgramDateTime&&(W.rawProgramDateTime=w.rawProgramDateTime)}else p(W,Qe,b,V),w=W,Q=!0;break}case"SERVER-CONTROL":{var ke=new A.AttrList(Z);C.canBlockReload=ke.bool("CAN-BLOCK-RELOAD"),C.canSkipUntil=ke.optionalFloat("CAN-SKIP-UNTIL",0),C.canSkipDateRanges=C.canSkipUntil>0&&ke.bool("CAN-SKIP-DATERANGES"),C.partHoldBack=ke.optionalFloat("PART-HOLD-BACK",0),C.holdBack=ke.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var G=new A.AttrList(Z);C.partTarget=G.decimalFloatingPoint("PART-TARGET");break}case"PART":{var $=C.partList;$||($=C.partList=[]);var ye=k>0?$[$.length-1]:void 0,_e=k++,xe=new y.Part(new A.AttrList(Z),W,h,_e,ye);$.push(xe),W.duration+=xe.duration;break}case"PRELOAD-HINT":{var Ke=new A.AttrList(Z);C.preloadHint=Ke;break}case"RENDITION-REPORT":{var ve=new A.AttrList(Z);C.renditionReports=C.renditionReports||[],C.renditionReports.push(ve);break}default:D.logger.warn("line parsed but not handled: "+B);break}}}H&&!H.relurl?(P.pop(),N-=H.duration,C.partList&&(C.fragmentHint=H)):C.partList&&(v(W,H),W.cc=F,C.fragmentHint=W);var Ve=P.length,We=P[0],ze=P[Ve-1];if(N+=C.skippedSegments*C.targetduration,N>0&&Ve&&ze){C.averagetargetduration=N/Ve;var kt=ze.sn;C.endSN=kt!=="initSegment"?kt:0,We&&(C.startCC=We.cc,We.initSegment||C.fragments.every(function(yt){return yt.relurl&&f(yt.relurl)})&&(D.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),W=new y.Fragment(_,h),W.relurl=ze.relurl,W.level=b,W.sn="initSegment",We.initSegment=W,C.needSidxRanges=!0))}else C.endSN=0,C.startCC=0;return C.fragmentHint&&(N+=C.fragmentHint.duration),C.totalduration=N,C.endCC=F,Y>0&&s(P,Y),C},o}();function d(o,E){["video","audio","text"].forEach(function(g){var h=o.filter(function(_){return Object(R.isCodecType)(_,g)});if(h.length){var b=h.filter(function(_){return _.lastIndexOf("avc1",0)===0||_.lastIndexOf("mp4a",0)===0});E[g+"Codec"]=b.length>0?b[0]:h[0],o=o.filter(function(_){return h.indexOf(_)===-1})}}),E.unknownCodecs=o}function l(o,E,g){var h=E[g];h&&(o[g]=h)}function s(o,E){for(var g=o[E],h=E;h--;){var b=o[h];if(!b)return;b.programDateTime=g.programDateTime-b.duration*1e3,g=b}}function v(o,E){o.rawProgramDateTime?o.programDateTime=Date.parse(o.rawProgramDateTime):E!=null&&E.programDateTime&&(o.programDateTime=E.endProgramDateTime),Object(a.isFiniteNumber)(o.programDateTime)||(o.programDateTime=null,o.rawProgramDateTime=null)}function p(o,E,g,h){o.relurl=E.URI,E.BYTERANGE&&o.setByteRange(E.BYTERANGE),o.level=g,o.sn="initSegment",h&&(o.levelkey=h),o.initSegment=null}},"./src/loader/playlist-loader.ts":function(r,t,e){"use strict";e.r(t);var a=e("./src/polyfills/number.ts"),n=e("./src/events.ts"),u=e("./src/errors.ts"),M=e("./src/utils/logger.ts"),y=e("./src/utils/mp4-tools.ts"),I=e("./src/loader/m3u8-parser.ts"),x=e("./src/types/loader.ts"),A=e("./src/utils/attr-list.ts");function D(T){var S=T.type;switch(S){case x.PlaylistContextType.AUDIO_TRACK:return x.PlaylistLevelType.AUDIO;case x.PlaylistContextType.SUBTITLE_TRACK:return x.PlaylistLevelType.SUBTITLE;default:return x.PlaylistLevelType.MAIN}}function R(T,S){var c=T.url;return(c===void 0||c.indexOf("data:")===0)&&(c=S.url),c}var L=function(){function T(c){this.hls=void 0,this.loaders=Object.create(null),this.hls=c,this.registerListeners()}var S=T.prototype;return S.startLoad=function(i){},S.stopLoad=function(){this.destroyInternalLoaders()},S.registerListeners=function(){var i=this.hls;i.on(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(n.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(n.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),i.on(n.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},S.unregisterListeners=function(){var i=this.hls;i.off(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(n.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(n.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),i.off(n.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},S.createInternalLoader=function(i){var f=this.hls.config,m=f.pLoader,d=f.loader,l=m||d,s=new l(f);return i.loader=s,this.loaders[i.type]=s,s},S.getInternalLoader=function(i){return this.loaders[i.type]},S.resetInternalLoader=function(i){this.loaders[i]&&delete this.loaders[i]},S.destroyInternalLoaders=function(){for(var i in this.loaders){var f=this.loaders[i];f&&f.destroy(),this.resetInternalLoader(i)}},S.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},S.onManifestLoading=function(i,f){var m=f.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:x.PlaylistContextType.MANIFEST,url:m,deliveryDirectives:null})},S.onLevelLoading=function(i,f){var m=f.id,d=f.level,l=f.url,s=f.deliveryDirectives;this.load({id:m,groupId:null,level:d,responseType:"text",type:x.PlaylistContextType.LEVEL,url:l,deliveryDirectives:s})},S.onAudioTrackLoading=function(i,f){var m=f.id,d=f.groupId,l=f.url,s=f.deliveryDirectives;this.load({id:m,groupId:d,level:null,responseType:"text",type:x.PlaylistContextType.AUDIO_TRACK,url:l,deliveryDirectives:s})},S.onSubtitleTrackLoading=function(i,f){var m=f.id,d=f.groupId,l=f.url,s=f.deliveryDirectives;this.load({id:m,groupId:d,level:null,responseType:"text",type:x.PlaylistContextType.SUBTITLE_TRACK,url:l,deliveryDirectives:s})},S.load=function(i){var f,m=this.hls.config,d=this.getInternalLoader(i);if(d){var l=d.context;if(l&&l.url===i.url){M.logger.trace("[playlist-loader]: playlist request ongoing");return}M.logger.log("[playlist-loader]: aborting previous loader for type: "+i.type),d.abort()}var s,v,p,o;switch(i.type){case x.PlaylistContextType.MANIFEST:s=m.manifestLoadingMaxRetry,v=m.manifestLoadingTimeOut,p=m.manifestLoadingRetryDelay,o=m.manifestLoadingMaxRetryTimeout;break;case x.PlaylistContextType.LEVEL:case x.PlaylistContextType.AUDIO_TRACK:case x.PlaylistContextType.SUBTITLE_TRACK:s=0,v=m.levelLoadingTimeOut;break;default:s=m.levelLoadingMaxRetry,v=m.levelLoadingTimeOut,p=m.levelLoadingRetryDelay,o=m.levelLoadingMaxRetryTimeout;break}if(d=this.createInternalLoader(i),(f=i.deliveryDirectives)!==null&&f!==void 0&&f.part){var E;if(i.type===x.PlaylistContextType.LEVEL&&i.level!==null?E=this.hls.levels[i.level].details:i.type===x.PlaylistContextType.AUDIO_TRACK&&i.id!==null?E=this.hls.audioTracks[i.id].details:i.type===x.PlaylistContextType.SUBTITLE_TRACK&&i.id!==null&&(E=this.hls.subtitleTracks[i.id].details),E){var g=E.partTarget,h=E.targetduration;g&&h&&(v=Math.min(Math.max(g*3,h*.8)*1e3,v))}}var b={timeout:v,maxRetry:s,retryDelay:p,maxRetryDelay:o,highWaterMark:0},_={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};d.load(i,b,_)},S.loadsuccess=function(i,f,m,d){if(d===void 0&&(d=null),m.isSidxRequest){this.handleSidxRequest(i,m),this.handlePlaylistLoaded(i,f,m,d);return}this.resetInternalLoader(m.type);var l=i.data;if(l.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(i,m,"no EXTM3U delimiter",d);return}f.parsing.start=performance.now(),l.indexOf("#EXTINF:")>0||l.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(i,f,m,d):this.handleMasterPlaylist(i,f,m,d)},S.loaderror=function(i,f,m){m===void 0&&(m=null),this.handleNetworkError(f,m,!1,i)},S.loadtimeout=function(i,f,m){m===void 0&&(m=null),this.handleNetworkError(f,m,!0)},S.handleMasterPlaylist=function(i,f,m,d){var l=this.hls,s=i.data,v=R(i,m),p=I.default.parseMasterPlaylist(s,v),o=p.levels,E=p.sessionData;if(!o.length){this.handleManifestParsingError(i,m,"no level found in manifest",d);return}var g=o.map(function(P){return{id:P.attrs.AUDIO,audioCodec:P.audioCodec}}),h=o.map(function(P){return{id:P.attrs.SUBTITLES,textCodec:P.textCodec}}),b=I.default.parseMasterPlaylistMedia(s,v,"AUDIO",g),_=I.default.parseMasterPlaylistMedia(s,v,"SUBTITLES",h),O=I.default.parseMasterPlaylistMedia(s,v,"CLOSED-CAPTIONS");if(b.length){var C=b.some(function(P){return!P.url});!C&&o[0].audioCodec&&!o[0].attrs.AUDIO&&(M.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),b.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new A.AttrList({}),bitrate:0,url:""}))}l.trigger(n.Events.MANIFEST_LOADED,{levels:o,audioTracks:b,subtitles:_,captions:O,url:v,stats:f,networkDetails:d,sessionData:E})},S.handleTrackOrLevelPlaylist=function(i,f,m,d){var l=this.hls,s=m.id,v=m.level,p=m.type,o=R(i,m),E=Object(a.isFiniteNumber)(s)?s:0,g=Object(a.isFiniteNumber)(v)?v:E,h=D(m),b=I.default.parseLevelPlaylist(i.data,o,g,h,E);if(!b.fragments.length){l.trigger(n.Events.ERROR,{type:u.ErrorTypes.NETWORK_ERROR,details:u.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:o,reason:"no fragments found in level",level:typeof m.level=="number"?m.level:void 0});return}if(p===x.PlaylistContextType.MANIFEST){var _={attrs:new A.AttrList({}),bitrate:0,details:b,name:"",url:o};l.trigger(n.Events.MANIFEST_LOADED,{levels:[_],audioTracks:[],url:o,stats:f,networkDetails:d,sessionData:null})}if(f.parsing.end=performance.now(),b.needSidxRanges){var O,C=(O=b.fragments[0].initSegment)===null||O===void 0?void 0:O.url;this.load({url:C,isSidxRequest:!0,type:p,level:v,levelDetails:b,id:s,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}m.levelDetails=b,this.handlePlaylistLoaded(i,f,m,d)},S.handleSidxRequest=function(i,f){var m=new Uint8Array(i.data),d=Object(y.findBox)(m,["sidx"])[0];if(!!d){var l=Object(y.parseSegmentIndex)(d);if(!!l){var s=l.references,v=f.levelDetails;s.forEach(function(p,o){var E=p.info,g=v.fragments[o];if(g.byteRange.length===0&&g.setByteRange(String(1+E.end-E.start)+"@"+String(E.start)),g.initSegment){var h=Object(y.findBox)(m,["moov"])[0],b=h?h.length:null;g.initSegment.setByteRange(String(b)+"@0")}})}}},S.handleManifestParsingError=function(i,f,m,d){this.hls.trigger(n.Events.ERROR,{type:u.ErrorTypes.NETWORK_ERROR,details:u.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:f.type===x.PlaylistContextType.MANIFEST,url:i.url,reason:m,response:i,context:f,networkDetails:d})},S.handleNetworkError=function(i,f,m,d){m===void 0&&(m=!1),M.logger.warn("[playlist-loader]: A network "+(m?"timeout":"error")+" occurred while loading "+i.type+" level: "+i.level+" id: "+i.id+' group-id: "'+i.groupId+'"');var l=u.ErrorDetails.UNKNOWN,s=!1,v=this.getInternalLoader(i);switch(i.type){case x.PlaylistContextType.MANIFEST:l=m?u.ErrorDetails.MANIFEST_LOAD_TIMEOUT:u.ErrorDetails.MANIFEST_LOAD_ERROR,s=!0;break;case x.PlaylistContextType.LEVEL:l=m?u.ErrorDetails.LEVEL_LOAD_TIMEOUT:u.ErrorDetails.LEVEL_LOAD_ERROR,s=!1;break;case x.PlaylistContextType.AUDIO_TRACK:l=m?u.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:u.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,s=!1;break;case x.PlaylistContextType.SUBTITLE_TRACK:l=m?u.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:u.ErrorDetails.SUBTITLE_LOAD_ERROR,s=!1;break}v&&this.resetInternalLoader(i.type);var p={type:u.ErrorTypes.NETWORK_ERROR,details:l,fatal:s,url:i.url,loader:v,context:i,networkDetails:f};d&&(p.response=d),this.hls.trigger(n.Events.ERROR,p)},S.handlePlaylistLoaded=function(i,f,m,d){var l=m.type,s=m.level,v=m.id,p=m.groupId,o=m.loader,E=m.levelDetails,g=m.deliveryDirectives;if(!(E!=null&&E.targetduration)){this.handleManifestParsingError(i,m,"invalid target duration",d);return}if(!!o)switch(E.live&&(o.getCacheAge&&(E.ageHeader=o.getCacheAge()||0),(!o.getCacheAge||isNaN(E.ageHeader))&&(E.ageHeader=0)),l){case x.PlaylistContextType.MANIFEST:case x.PlaylistContextType.LEVEL:this.hls.trigger(n.Events.LEVEL_LOADED,{details:E,level:s||0,id:v||0,stats:f,networkDetails:d,deliveryDirectives:g});break;case x.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(n.Events.AUDIO_TRACK_LOADED,{details:E,id:v||0,groupId:p||"",stats:f,networkDetails:d,deliveryDirectives:g});break;case x.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(n.Events.SUBTITLE_TRACK_LOADED,{details:E,id:v||0,groupId:p||"",stats:f,networkDetails:d,deliveryDirectives:g});break}},T}();t.default=L},"./src/polyfills/number.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"isFiniteNumber",function(){return a}),e.d(t,"MAX_SAFE_INTEGER",function(){return n});var a=Number.isFinite||function(u){return typeof u=="number"&&isFinite(u)},n=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(r,t,e){"use strict";e.r(t);var a=function(){function n(){}return n.getSilentFrame=function(M,y){switch(M){case"mp4a.40.2":if(y===1)return new Uint8Array([0,200,0,128,35,128]);if(y===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(y===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(y===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(y===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(y===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]);break;default:if(y===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(y===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(y===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]);break}},n}();t.default=a},"./src/remux/mp4-generator.ts":function(r,t,e){"use strict";e.r(t);var a=Math.pow(2,32)-1,n=function(){function u(){}return u.init=function(){u.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var y;for(y in u.types)u.types.hasOwnProperty(y)&&(u.types[y]=[y.charCodeAt(0),y.charCodeAt(1),y.charCodeAt(2),y.charCodeAt(3)]);var I=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]),x=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]);u.HDLR_TYPES={video:I,audio:x};var A=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),D=new Uint8Array([0,0,0,0,0,0,0,0]);u.STTS=u.STSC=u.STCO=D,u.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),u.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),u.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),u.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var R=new Uint8Array([105,115,111,109]),L=new Uint8Array([97,118,99,49]),T=new Uint8Array([0,0,0,1]);u.FTYP=u.box(u.types.ftyp,R,T,R,L),u.DINF=u.box(u.types.dinf,u.box(u.types.dref,A))},u.box=function(y){for(var I=8,x=arguments.length,A=new Array(x>1?x-1:0),D=1;D<x;D++)A[D-1]=arguments[D];for(var R=A.length,L=R;R--;)I+=A[R].byteLength;var T=new Uint8Array(I);for(T[0]=I>>24&255,T[1]=I>>16&255,T[2]=I>>8&255,T[3]=I&255,T.set(y,4),R=0,I=8;R<L;R++)T.set(A[R],I),I+=A[R].byteLength;return T},u.hdlr=function(y){return u.box(u.types.hdlr,u.HDLR_TYPES[y])},u.mdat=function(y){return u.box(u.types.mdat,y)},u.mdhd=function(y,I){I*=y;var x=Math.floor(I/(a+1)),A=Math.floor(I%(a+1));return u.box(u.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,y>>24&255,y>>16&255,y>>8&255,y&255,x>>24,x>>16&255,x>>8&255,x&255,A>>24,A>>16&255,A>>8&255,A&255,85,196,0,0]))},u.mdia=function(y){return u.box(u.types.mdia,u.mdhd(y.timescale,y.duration),u.hdlr(y.type),u.minf(y))},u.mfhd=function(y){return u.box(u.types.mfhd,new Uint8Array([0,0,0,0,y>>24,y>>16&255,y>>8&255,y&255]))},u.minf=function(y){return y.type==="audio"?u.box(u.types.minf,u.box(u.types.smhd,u.SMHD),u.DINF,u.stbl(y)):u.box(u.types.minf,u.box(u.types.vmhd,u.VMHD),u.DINF,u.stbl(y))},u.moof=function(y,I,x){return u.box(u.types.moof,u.mfhd(y),u.traf(x,I))},u.moov=function(y){for(var I=y.length,x=[];I--;)x[I]=u.trak(y[I]);return u.box.apply(null,[u.types.moov,u.mvhd(y[0].timescale,y[0].duration)].concat(x).concat(u.mvex(y)))},u.mvex=function(y){for(var I=y.length,x=[];I--;)x[I]=u.trex(y[I]);return u.box.apply(null,[u.types.mvex].concat(x))},u.mvhd=function(y,I){I*=y;var x=Math.floor(I/(a+1)),A=Math.floor(I%(a+1)),D=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,y>>24&255,y>>16&255,y>>8&255,y&255,x>>24,x>>16&255,x>>8&255,x&255,A>>24,A>>16&255,A>>8&255,A&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return u.box(u.types.mvhd,D)},u.sdtp=function(y){var I=y.samples||[],x=new Uint8Array(4+I.length),A,D;for(A=0;A<I.length;A++)D=I[A].flags,x[A+4]=D.dependsOn<<4|D.isDependedOn<<2|D.hasRedundancy;return u.box(u.types.sdtp,x)},u.stbl=function(y){return u.box(u.types.stbl,u.stsd(y),u.box(u.types.stts,u.STTS),u.box(u.types.stsc,u.STSC),u.box(u.types.stsz,u.STSZ),u.box(u.types.stco,u.STCO))},u.avc1=function(y){var I=[],x=[],A,D,R;for(A=0;A<y.sps.length;A++)D=y.sps[A],R=D.byteLength,I.push(R>>>8&255),I.push(R&255),I=I.concat(Array.prototype.slice.call(D));for(A=0;A<y.pps.length;A++)D=y.pps[A],R=D.byteLength,x.push(R>>>8&255),x.push(R&255),x=x.concat(Array.prototype.slice.call(D));var L=u.box(u.types.avcC,new Uint8Array([1,I[3],I[4],I[5],255,224|y.sps.length].concat(I).concat([y.pps.length]).concat(x))),T=y.width,S=y.height,c=y.pixelRatio[0],i=y.pixelRatio[1];return u.box(u.types.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,T>>8&255,T&255,S>>8&255,S&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),L,u.box(u.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),u.box(u.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,c&255,i>>24,i>>16&255,i>>8&255,i&255])))},u.esds=function(y){var I=y.config.length;return new Uint8Array([0,0,0,0,3,23+I,0,1,0,4,15+I,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([I]).concat(y.config).concat([6,1,2]))},u.mp4a=function(y){var I=y.samplerate;return u.box(u.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,y.channelCount,0,16,0,0,0,0,I>>8&255,I&255,0,0]),u.box(u.types.esds,u.esds(y)))},u.mp3=function(y){var I=y.samplerate;return u.box(u.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,y.channelCount,0,16,0,0,0,0,I>>8&255,I&255,0,0]))},u.stsd=function(y){return y.type==="audio"?y.segmentCodec==="mp3"&&y.codec==="mp3"?u.box(u.types.stsd,u.STSD,u.mp3(y)):u.box(u.types.stsd,u.STSD,u.mp4a(y)):u.box(u.types.stsd,u.STSD,u.avc1(y))},u.tkhd=function(y){var I=y.id,x=y.duration*y.timescale,A=y.width,D=y.height,R=Math.floor(x/(a+1)),L=Math.floor(x%(a+1));return u.box(u.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,I>>24&255,I>>16&255,I>>8&255,I&255,0,0,0,0,R>>24,R>>16&255,R>>8&255,R&255,L>>24,L>>16&255,L>>8&255,L&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,A>>8&255,A&255,0,0,D>>8&255,D&255,0,0]))},u.traf=function(y,I){var x=u.sdtp(y),A=y.id,D=Math.floor(I/(a+1)),R=Math.floor(I%(a+1));return u.box(u.types.traf,u.box(u.types.tfhd,new Uint8Array([0,0,0,0,A>>24,A>>16&255,A>>8&255,A&255])),u.box(u.types.tfdt,new Uint8Array([1,0,0,0,D>>24,D>>16&255,D>>8&255,D&255,R>>24,R>>16&255,R>>8&255,R&255])),u.trun(y,x.length+16+20+8+16+8+8),x)},u.trak=function(y){return y.duration=y.duration||4294967295,u.box(u.types.trak,u.tkhd(y),u.mdia(y))},u.trex=function(y){var I=y.id;return u.box(u.types.trex,new Uint8Array([0,0,0,0,I>>24,I>>16&255,I>>8&255,I&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},u.trun=function(y,I){var x=y.samples||[],A=x.length,D=12+16*A,R=new Uint8Array(D),L,T,S,c,i,f;for(I+=8+D,R.set([y.type==="video"?1:0,0,15,1,A>>>24&255,A>>>16&255,A>>>8&255,A&255,I>>>24&255,I>>>16&255,I>>>8&255,I&255],0),L=0;L<A;L++)T=x[L],S=T.duration,c=T.size,i=T.flags,f=T.cts,R.set([S>>>24&255,S>>>16&255,S>>>8&255,S&255,c>>>24&255,c>>>16&255,c>>>8&255,c&255,i.isLeading<<2|i.dependsOn,i.isDependedOn<<6|i.hasRedundancy<<4|i.paddingValue<<1|i.isNonSync,i.degradPrio&240<<8,i.degradPrio&15,f>>>24&255,f>>>16&255,f>>>8&255,f&255],12+16*L);return u.box(u.types.trun,R)},u.initSegment=function(y){u.types||u.init();var I=u.moov(y),x=new Uint8Array(u.FTYP.byteLength+I.byteLength);return x.set(u.FTYP),x.set(I,u.FTYP.byteLength),x},u}();n.types=void 0,n.HDLR_TYPES=void 0,n.STTS=void 0,n.STSC=void 0,n.STCO=void 0,n.STSZ=void 0,n.VMHD=void 0,n.SMHD=void 0,n.STSD=void 0,n.FTYP=void 0,n.DINF=void 0,t.default=n},"./src/remux/mp4-remuxer.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"default",function(){return i}),e.d(t,"normalizePts",function(){return f}),e.d(t,"flushTextTrackMetadataCueSamples",function(){return d}),e.d(t,"flushTextTrackUserdataCueSamples",function(){return l});var a=e("./src/polyfills/number.ts"),n=e("./src/remux/aac-helper.ts"),u=e("./src/remux/mp4-generator.ts"),M=e("./src/events.ts"),y=e("./src/errors.ts"),I=e("./src/utils/logger.ts"),x=e("./src/types/loader.ts"),A=e("./src/utils/timescale-conversion.ts");function D(){return D=Object.assign?Object.assign.bind():function(p){for(var o=1;o<arguments.length;o++){var E=arguments[o];for(var g in E)Object.prototype.hasOwnProperty.call(E,g)&&(p[g]=E[g])}return p},D.apply(this,arguments)}var R=10*1e3,L=1024,T=1152,S=null,c=null,i=function(){function p(E,g,h,b){if(b===void 0&&(b=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=E,this.config=g,this.typeSupported=h,this.ISGenerated=!1,S===null){var _=navigator.userAgent||"",O=_.match(/Chrome\/(\d+)/i);S=O?parseInt(O[1]):0}if(c===null){var C=navigator.userAgent.match(/Safari\/(\d+)/i);c=C?parseInt(C[1]):0}}var o=p.prototype;return o.destroy=function(){},o.resetTimeStamp=function(g){I.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=g},o.resetNextTimestamp=function(){I.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},o.resetInitSegment=function(){I.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},o.getVideoStartPts=function(g){var h=!1,b=g.reduce(function(_,O){var C=O.pts-_;return C<-4294967296?(h=!0,f(_,O.pts)):C>0?_:O.pts},g[0].pts);return h&&I.logger.debug("PTS rollover detected"),b},o.remux=function(g,h,b,_,O,C,P,w){var U,k,N,F,H,W,B=O,j=O,V=g.pid>-1,Y=h.pid>-1,Q=h.samples.length,J=g.samples.length>0,z=P&&Q>0||Q>1,te=(!V||J)&&(!Y||z)||this.ISGenerated||P;if(te){this.ISGenerated||(N=this.generateIS(g,h,O));var se=this.isVideoContiguous,Z=-1,Ee;if(z&&(Z=m(h.samples),!se&&this.config.forceKeyFrameOnDiscontinuity))if(W=!0,Z>0){I.logger.warn("[mp4-remuxer]: Dropped "+Z+" out of "+Q+" video samples due to a missing keyframe");var fe=this.getVideoStartPts(h.samples);h.samples=h.samples.slice(Z),h.dropped+=Z,j+=(h.samples[0].pts-fe)/h.inputTimeScale,Ee=j}else Z===-1&&(I.logger.warn("[mp4-remuxer]: No keyframe found out of "+Q+" video samples"),W=!1);if(this.ISGenerated){if(J&&z){var re=this.getVideoStartPts(h.samples),q=f(g.samples[0].pts,re)-re,ie=q/h.inputTimeScale;B+=Math.max(0,ie),j+=Math.max(0,-ie)}if(J){if(g.samplerate||(I.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),N=this.generateIS(g,h,O)),k=this.remuxAudio(g,B,this.isAudioContiguous,C,Y||z||w===x.PlaylistLevelType.AUDIO?j:void 0),z){var ne=k?k.endPTS-k.startPTS:0;h.inputTimeScale||(I.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),N=this.generateIS(g,h,O)),U=this.remuxVideo(h,j,se,ne)}}else z&&(U=this.remuxVideo(h,j,se,0));U&&(U.firstKeyFrame=Z,U.independent=Z!==-1,U.firstKeyFramePTS=Ee)}}return this.ISGenerated&&(b.samples.length&&(H=d(b,O,this._initPTS,this._initDTS)),_.samples.length&&(F=l(_,O,this._initPTS))),{audio:k,video:U,initSegment:N,independent:W,text:F,id3:H}},o.generateIS=function(g,h,b){var _=g.samples,O=h.samples,C=this.typeSupported,P={},w=!Object(a.isFiniteNumber)(this._initPTS),U="audio/mp4",k,N,F;if(w&&(k=N=1/0),g.config&&_.length){switch(g.timescale=g.samplerate,g.segmentCodec){case"mp3":C.mpeg?(U="audio/mpeg",g.codec=""):C.mp3&&(g.codec="mp3");break}P.audio={id:"audio",container:U,codec:g.codec,initSegment:g.segmentCodec==="mp3"&&C.mpeg?new Uint8Array(0):u.default.initSegment([g]),metadata:{channelCount:g.channelCount}},w&&(F=g.inputTimeScale,k=N=_[0].pts-Math.round(F*b))}if(h.sps&&h.pps&&O.length&&(h.timescale=h.inputTimeScale,P.video={id:"main",container:"video/mp4",codec:h.codec,initSegment:u.default.initSegment([h]),metadata:{width:h.width,height:h.height}},w)){F=h.inputTimeScale;var H=this.getVideoStartPts(O),W=Math.round(F*b);N=Math.min(N,f(O[0].dts,H)-W),k=Math.min(k,H-W)}if(Object.keys(P).length)return this.ISGenerated=!0,w&&(this._initPTS=k,this._initDTS=N),{tracks:P,initPTS:k,timescale:F}},o.remuxVideo=function(g,h,b,_){var O=g.inputTimeScale,C=g.samples,P=[],w=C.length,U=this._initPTS,k=this.nextAvcDts,N=8,F=this.videoSampleDuration,H,W,B=Number.POSITIVE_INFINITY,j=Number.NEGATIVE_INFINITY,V=!1;if(!b||k===null){var Y=h*O,Q=C[0].pts-f(C[0].dts,C[0].pts);k=Y-Q}for(var J=0;J<w;J++){var z=C[J];z.pts=f(z.pts-U,k),z.dts=f(z.dts-U,k),z.dts<C[J>0?J-1:J].dts&&(V=!0)}V&&C.sort(function(Ut,Rr){var Or=Ut.dts-Rr.dts,fi=Ut.pts-Rr.pts;return Or||fi}),H=C[0].dts,W=C[C.length-1].dts;var te=W-H,se=te?Math.round(te/(w-1)):F||g.inputTimeScale/30;if(b){var Z=H-k,Ee=Z>se,fe=Z<-1;if(Ee||fe){Ee?I.logger.warn("AVC: "+Object(A.toMsFromMpegTsClock)(Z,!0)+" ms ("+Z+"dts) hole between fragments detected, filling it"):I.logger.warn("AVC: "+Object(A.toMsFromMpegTsClock)(-Z,!0)+" ms ("+Z+"dts) overlapping between fragments detected"),H=k;var re=C[0].pts-Z;C[0].dts=H,C[0].pts=re,I.logger.log("Video: First PTS/DTS adjusted: "+Object(A.toMsFromMpegTsClock)(re,!0)+"/"+Object(A.toMsFromMpegTsClock)(H,!0)+", delta: "+Object(A.toMsFromMpegTsClock)(Z,!0)+" ms")}}H=Math.max(0,H);for(var q=0,ie=0,ne=0;ne<w;ne++){for(var Te=C[ne],Se=Te.units,he=Se.length,Oe=0,Ce=0;Ce<he;Ce++)Oe+=Se[Ce].data.length;ie+=Oe,q+=he,Te.length=Oe,Te.dts=Math.max(Te.dts,H),B=Math.min(Te.pts,B),j=Math.max(Te.pts,j)}W=C[w-1].dts;var Ue=ie+4*q+8,me;try{me=new Uint8Array(Ue)}catch{this.observer.emit(M.Events.ERROR,M.Events.ERROR,{type:y.ErrorTypes.MUX_ERROR,details:y.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ue,reason:"fail allocating video mdat "+Ue});return}var Ae=new DataView(me.buffer);Ae.setUint32(0,Ue),me.set(u.default.types.mdat,4);for(var Re=!1,Ie=Number.POSITIVE_INFINITY,Ne=Number.POSITIVE_INFINITY,je=Number.NEGATIVE_INFINITY,Qe=Number.NEGATIVE_INFINITY,Fe=0;Fe<w;Fe++){for(var ke=C[Fe],G=ke.units,$=0,ye=0,_e=G.length;ye<_e;ye++){var xe=G[ye],Ke=xe.data,ve=xe.data.byteLength;Ae.setUint32(N,ve),N+=4,me.set(Ke,N),N+=ve,$+=4+ve}var Ve=void 0;if(Fe<w-1)F=C[Fe+1].dts-ke.dts,Ve=C[Fe+1].pts-ke.pts;else{var We=this.config,ze=Fe>0?ke.dts-C[Fe-1].dts:se;if(Ve=Fe>0?ke.pts-C[Fe-1].pts:se,We.stretchShortVideoTrack&&this.nextAudioPts!==null){var kt=Math.floor(We.maxBufferHole*O),yt=(_?B+_*O:this.nextAudioPts)-ke.pts;yt>kt?(F=yt-ze,F<0?F=ze:Re=!0,I.logger.log("[mp4-remuxer]: It is approximately "+yt/90+" ms to the next segment; using duration "+F/90+" ms for the last video frame.")):F=ze}else F=ze}var Dt=Math.round(ke.pts-ke.dts);Ie=Math.min(Ie,F),je=Math.max(je,F),Ne=Math.min(Ne,Ve),Qe=Math.max(Qe,Ve),P.push(new s(ke.key,F,$,Dt))}if(P.length){if(S){if(S<70){var Dr=P[0].flags;Dr.dependsOn=2,Dr.isNonSync=0}}else if(c&&Qe-Ne<je-Ie&&se/je<.025&&P[0].cts===0){I.logger.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");for(var qt=H,rt=0,wt=P.length;rt<wt;rt++){var er=qt+P[rt].duration,tr=qt+P[rt].cts;if(rt<wt-1){var Ir=er+P[rt+1].cts;P[rt].duration=Ir-tr}else P[rt].duration=rt?P[rt-1].duration:se;P[rt].cts=0,qt=er}}}console.assert(F!==null,"mp4SampleDuration must be computed"),F=Re||!F?se:F,this.nextAvcDts=k=W+F,this.videoSampleDuration=F,this.isVideoContiguous=!0;var Mr=u.default.moof(g.sequenceNumber++,H,D({},g,{samples:P})),di="video",ci={data1:Mr,data2:me,startPTS:B/O,endPTS:(j+F)/O,startDTS:H/O,endDTS:k/O,type:di,hasAudio:!1,hasVideo:!0,nb:P.length,dropped:g.dropped};return g.samples=[],g.dropped=0,console.assert(me.length,"MDAT length must not be zero"),ci},o.remuxAudio=function(g,h,b,_,O){var C=g.inputTimeScale,P=g.samplerate?g.samplerate:C,w=C/P,U=g.segmentCodec==="aac"?L:T,k=U*w,N=this._initPTS,F=g.segmentCodec==="mp3"&&this.typeSupported.mpeg,H=[],W=O!==void 0,B=g.samples,j=F?0:8,V=this.nextAudioPts||-1,Y=h*C;if(this.isAudioContiguous=b=b||B.length&&V>0&&(_&&Math.abs(Y-V)<9e3||Math.abs(f(B[0].pts-N,Y)-V)<20*k),B.forEach(function(xe){xe.pts=f(xe.pts-N,Y)}),!b||V<0){if(B=B.filter(function(xe){return xe.pts>=0}),!B.length)return;O===0?V=0:_&&!W?V=Math.max(0,Y):V=B[0].pts}if(g.segmentCodec==="aac")for(var Q=this.config.maxAudioFramesDrift,J=0,z=V;J<B.length;J++){var te=B[J],se=te.pts,Z=se-z,Ee=Math.abs(1e3*Z/C);if(Z<=-Q*k&&W)J===0&&(I.logger.warn("Audio frame @ "+(se/C).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Z/C)+" ms."),this.nextAudioPts=V=z=se);else if(Z>=Q*k&&Ee<R&&W){var fe=Math.round(Z/k);z=se-fe*k,z<0&&(fe--,z+=k),J===0&&(this.nextAudioPts=V=z),I.logger.warn("[mp4-remuxer]: Injecting "+fe+" audio frame @ "+(z/C).toFixed(3)+"s due to "+Math.round(1e3*Z/C)+" ms gap.");for(var re=0;re<fe;re++){var q=Math.max(z,0),ie=n.default.getSilentFrame(g.manifestCodec||g.codec,g.channelCount);ie||(I.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ie=te.unit.subarray()),B.splice(J,0,{unit:ie,pts:q}),z+=k,J++}}te.pts=z,z+=k}for(var ne=null,Te=null,Se,he=0,Oe=B.length;Oe--;)he+=B[Oe].unit.byteLength;for(var Ce=0,Ue=B.length;Ce<Ue;Ce++){var me=B[Ce],Ae=me.unit,Re=me.pts;if(Te!==null){var Ie=H[Ce-1];Ie.duration=Math.round((Re-Te)/w)}else if(b&&g.segmentCodec==="aac"&&(Re=V),ne=Re,he>0){he+=j;try{Se=new Uint8Array(he)}catch{this.observer.emit(M.Events.ERROR,M.Events.ERROR,{type:y.ErrorTypes.MUX_ERROR,details:y.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:he,reason:"fail allocating audio mdat "+he});return}if(!F){var Ne=new DataView(Se.buffer);Ne.setUint32(0,he),Se.set(u.default.types.mdat,4)}}else return;Se.set(Ae,j);var je=Ae.byteLength;j+=je,H.push(new s(!0,U,je,0)),Te=Re}var Qe=H.length;if(!!Qe){var Fe=H[H.length-1];this.nextAudioPts=V=Te+w*Fe.duration;var ke=F?new Uint8Array(0):u.default.moof(g.sequenceNumber++,ne/w,D({},g,{samples:H}));g.samples=[];var G=ne/C,$=V/C,ye="audio",_e={data1:ke,data2:Se,startPTS:G,endPTS:$,startDTS:G,endDTS:$,type:ye,hasAudio:!0,hasVideo:!1,nb:Qe};return this.isAudioContiguous=!0,console.assert(Se.length,"MDAT length must not be zero"),_e}},o.remuxEmptyAudio=function(g,h,b,_){var O=g.inputTimeScale,C=g.samplerate?g.samplerate:O,P=O/C,w=this.nextAudioPts,U=(w!==null?w:_.startDTS*O)+this._initDTS,k=_.endDTS*O+this._initDTS,N=P*L,F=Math.ceil((k-U)/N),H=n.default.getSilentFrame(g.manifestCodec||g.codec,g.channelCount);if(I.logger.warn("[mp4-remuxer]: remux empty Audio"),!H){I.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var W=[],B=0;B<F;B++){var j=U+B*N;W.push({unit:H,pts:j,dts:j})}return g.samples=W,this.remuxAudio(g,h,b,!1)},p}();function f(p,o){var E;if(o===null)return p;for(o<p?E=-8589934592:E=8589934592;Math.abs(p-o)>4294967296;)p+=E;return p}function m(p){for(var o=0;o<p.length;o++)if(p[o].key)return o;return-1}function d(p,o,E,g){var h=p.samples.length;if(!!h){for(var b=p.inputTimeScale,_=0;_<h;_++){var O=p.samples[_];O.pts=f(O.pts-E,o*b)/b,O.dts=f(O.dts-g,o*b)/b}var C=p.samples;return p.samples=[],{samples:C}}}function l(p,o,E){var g=p.samples.length;if(!!g){for(var h=p.inputTimeScale,b=0;b<g;b++){var _=p.samples[b];_.pts=f(_.pts-E,o*h)/h}p.samples.sort(function(C,P){return C.pts-P.pts});var O=p.samples;return p.samples=[],{samples:O}}}var s=function(o,E,g,h){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=E,this.size=g,this.cts=h,this.flags=new v(o)},v=function(o){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=o?2:1,this.isNonSync=o?0:1}},"./src/remux/passthrough-remuxer.ts":function(r,t,e){"use strict";e.r(t);var a=e("./src/polyfills/number.ts"),n=e("./src/remux/mp4-remuxer.ts"),u=e("./src/utils/mp4-tools.ts"),M=e("./src/loader/fragment.ts"),y=e("./src/utils/logger.ts"),I=function(){function A(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndTime=null}var D=A.prototype;return D.destroy=function(){},D.resetTimeStamp=function(L){this.initPTS=L,this.lastEndTime=null},D.resetNextTimestamp=function(){this.lastEndTime=null},D.resetInitSegment=function(L,T,S){this.audioCodec=T,this.videoCodec=S,this.generateInitSegment(L),this.emitInitSegment=!0},D.generateInitSegment=function(L){var T=this.audioCodec,S=this.videoCodec;if(!L||!L.byteLength){this.initTracks=void 0,this.initData=void 0;return}var c=this.initData=Object(u.parseInitSegment)(L);T||(T=x(c.audio,M.ElementaryStreamTypes.AUDIO)),S||(S=x(c.video,M.ElementaryStreamTypes.VIDEO));var i={};c.audio&&c.video?i.audiovideo={container:"video/mp4",codec:T+","+S,initSegment:L,id:"main"}:c.audio?i.audio={container:"audio/mp4",codec:T,initSegment:L,id:"audio"}:c.video?i.video={container:"video/mp4",codec:S,initSegment:L,id:"main"}:y.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=i},D.remux=function(L,T,S,c,i){var f,m=this.initPTS,d=this.lastEndTime,l={audio:void 0,video:void 0,text:c,id3:S,initSegment:void 0};Object(a.isFiniteNumber)(d)||(d=this.lastEndTime=i||0);var s=T.samples;if(!s||!s.length)return l;var v={initPTS:void 0,timescale:1},p=this.initData;if((!p||!p.length)&&(this.generateInitSegment(s),p=this.initData),!p||!p.length)return y.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),l;this.emitInitSegment&&(v.tracks=this.initTracks,this.emitInitSegment=!1);var o=Object(u.getStartDTS)(p,s);Object(a.isFiniteNumber)(m)||(this.initPTS=v.initPTS=m=o-i);var E=Object(u.getDuration)(s,p),g=L?o-m:d,h=g+E;Object(u.offsetStartDTS)(p,s,m),E>0?this.lastEndTime=h:(y.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var b=!!p.audio,_=!!p.video,O="";b&&(O+="audio"),_&&(O+="video");var C={data1:s,startPTS:g,startDTS:g,endPTS:h,endDTS:h,type:O,hasAudio:b,hasVideo:_,nb:1,dropped:0};l.audio=C.type==="audio"?C:void 0,l.video=C.type!=="audio"?C:void 0,l.initSegment=v;var P=(f=this.initPTS)!=null?f:0;return l.id3=Object(n.flushTextTrackMetadataCueSamples)(S,i,P,P),c.samples.length&&(l.text=Object(n.flushTextTrackUserdataCueSamples)(c,i,P)),l},A}();function x(A,D){var R=A==null?void 0:A.codec;return R&&R.length>4?R:R==="hvc1"||R==="hev1"?"hvc1.1.c.L120.90":R==="av01"?"av01.0.04M.08":R==="avc1"||D===M.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}t.default=I},"./src/task-loop.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"default",function(){return a});var a=function(){function n(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var u=n.prototype;return u.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},u.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},u.onHandlerDestroyed=function(){},u.hasInterval=function(){return!!this._tickInterval},u.hasNextTick=function(){return!!this._tickTimer},u.setInterval=function(y){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,y),!0)},u.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},u.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},u.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},u.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},u.doTick=function(){},n}()},"./src/types/cmcd.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"CMCDVersion",function(){return a}),e.d(t,"CMCDObjectType",function(){return n}),e.d(t,"CMCDStreamingFormat",function(){return u}),e.d(t,"CMCDStreamType",function(){return M});var a=1,n;(function(y){y.MANIFEST="m",y.AUDIO="a",y.VIDEO="v",y.MUXED="av",y.INIT="i",y.CAPTION="c",y.TIMED_TEXT="tt",y.KEY="k",y.OTHER="o"})(n||(n={}));var u;(function(y){y.DASH="d",y.HLS="h",y.SMOOTH="s",y.OTHER="o"})(u||(u={}));var M;(function(y){y.VOD="v",y.LIVE="l"})(M||(M={}))},"./src/types/demuxer.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"MetadataSchema",function(){return a});var a;(function(n){n.audioId3="org.id3",n.dateRange="com.apple.quicktime.HLS",n.emsg="https://aomedia.org/emsg/ID3"})(a||(a={}))},"./src/types/level.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"HlsSkip",function(){return u}),e.d(t,"getSkipValue",function(){return M}),e.d(t,"HlsUrlParameters",function(){return y}),e.d(t,"Level",function(){return I});function a(x,A){for(var D=0;D<A.length;D++){var R=A[D];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(x,R.key,R)}}function n(x,A,D){return A&&a(x.prototype,A),D&&a(x,D),Object.defineProperty(x,"prototype",{writable:!1}),x}var u;(function(x){x.No="",x.Yes="YES",x.v2="v2"})(u||(u={}));function M(x,A){var D=x.canSkipUntil,R=x.canSkipDateRanges,L=x.endSN,T=A!==void 0?A-L:0;return D&&T<D?R?u.v2:u.Yes:u.No}var y=function(){function x(D,R,L){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=D,this.part=R,this.skip=L}var A=x.prototype;return A.addDirectives=function(R){var L=new self.URL(R);return this.msn!==void 0&&L.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&L.searchParams.set("_HLS_part",this.part.toString()),this.skip&&L.searchParams.set("_HLS_skip",this.skip),L.toString()},x}(),I=function(){function x(A){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[A.url],this.attrs=A.attrs,this.bitrate=A.bitrate,A.details&&(this.details=A.details),this.id=A.id||0,this.name=A.name,this.width=A.width||0,this.height=A.height||0,this.audioCodec=A.audioCodec,this.videoCodec=A.videoCodec,this.unknownCodecs=A.unknownCodecs,this.codecSet=[A.videoCodec,A.audioCodec].filter(function(D){return D}).join(",").replace(/\.[^.,]+/g,"")}return n(x,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(D){var R=D%this.url.length;this._urlId!==R&&(this.details=void 0,this._urlId=R)}}]),x}()},"./src/types/loader.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"PlaylistContextType",function(){return a}),e.d(t,"PlaylistLevelType",function(){return n});var a;(function(u){u.MANIFEST="manifest",u.LEVEL="level",u.AUDIO_TRACK="audioTrack",u.SUBTITLE_TRACK="subtitleTrack"})(a||(a={}));var n;(function(u){u.MAIN="main",u.AUDIO="audio",u.SUBTITLE="subtitle"})(n||(n={}))},"./src/types/transmuxer.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"ChunkMetadata",function(){return a});var a=function(M,y,I,x,A,D){x===void 0&&(x=0),A===void 0&&(A=-1),D===void 0&&(D=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=n(),this.buffering={audio:n(),video:n(),audiovideo:n()},this.level=M,this.sn=y,this.id=I,this.size=x,this.part=A,this.partial=D};function n(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"AttrList",function(){return u});var a=/^(\d+)x(\d+)$/,n=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,u=function(){function M(I){typeof I=="string"&&(I=M.parseAttrList(I));for(var x in I)I.hasOwnProperty(x)&&(this[x]=I[x])}var y=M.prototype;return y.decimalInteger=function(x){var A=parseInt(this[x],10);return A>Number.MAX_SAFE_INTEGER?1/0:A},y.hexadecimalInteger=function(x){if(this[x]){var A=(this[x]||"0x").slice(2);A=(A.length&1?"0":"")+A;for(var D=new Uint8Array(A.length/2),R=0;R<A.length/2;R++)D[R]=parseInt(A.slice(R*2,R*2+2),16);return D}else return null},y.hexadecimalIntegerAsNumber=function(x){var A=parseInt(this[x],16);return A>Number.MAX_SAFE_INTEGER?1/0:A},y.decimalFloatingPoint=function(x){return parseFloat(this[x])},y.optionalFloat=function(x,A){var D=this[x];return D?parseFloat(D):A},y.enumeratedString=function(x){return this[x]},y.bool=function(x){return this[x]==="YES"},y.decimalResolution=function(x){var A=a.exec(this[x]);if(A!==null)return{width:parseInt(A[1],10),height:parseInt(A[2],10)}},M.parseAttrList=function(x){var A,D={},R='"';for(n.lastIndex=0;(A=n.exec(x))!==null;){var L=A[2];L.indexOf(R)===0&&L.lastIndexOf(R)===L.length-1&&(L=L.slice(1,-1)),D[A[1]]=L}return D},M}()},"./src/utils/binary-search.ts":function(r,t,e){"use strict";e.r(t);var a={search:function(u,M){for(var y=0,I=u.length-1,x=null,A=null;y<=I;){x=(y+I)/2|0,A=u[x];var D=M(A);if(D>0)y=x+1;else if(D<0)I=x-1;else return A}return null}};t.default=a},"./src/utils/buffer-helper.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"BufferHelper",function(){return u});var a=e("./src/utils/logger.ts"),n={length:0,start:function(){return 0},end:function(){return 0}},u=function(){function M(){}return M.isBuffered=function(I,x){try{if(I){for(var A=M.getBuffered(I),D=0;D<A.length;D++)if(x>=A.start(D)&&x<=A.end(D))return!0}}catch{}return!1},M.bufferInfo=function(I,x,A){try{if(I){var D=M.getBuffered(I),R=[],L;for(L=0;L<D.length;L++)R.push({start:D.start(L),end:D.end(L)});return this.bufferedInfo(R,x,A)}}catch{}return{len:0,start:x,end:x,nextStart:void 0}},M.bufferedInfo=function(I,x,A){x=Math.max(0,x),I.sort(function(s,v){var p=s.start-v.start;return p||v.end-s.end});var D=[];if(A)for(var R=0;R<I.length;R++){var L=D.length;if(L){var T=D[L-1].end;I[R].start-T<A?I[R].end>T&&(D[L-1].end=I[R].end):D.push(I[R])}else D.push(I[R])}else D=I;for(var S=0,c,i=x,f=x,m=0;m<D.length;m++){var d=D[m].start,l=D[m].end;if(x+A>=d&&x<l)i=d,f=l,S=f-x;else if(x+A<d){c=d;break}}return{len:S,start:i||0,end:f||0,nextStart:c}},M.getBuffered=function(I){try{return I.buffered}catch(x){return a.logger.log("failed to get media.buffered",x),n}},M}()},"./src/utils/cea-608-parser.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"Row",function(){return f}),e.d(t,"CaptionScreen",function(){return m});var a=e("./src/utils/logger.ts"),n={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},u=function(E){var g=E;return n.hasOwnProperty(E)&&(g=n[E]),String.fromCharCode(g)},M=15,y=100,I={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},x={17:2,18:4,21:6,22:8,23:10,19:13,20:15},A={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},D={25:2,26:4,29:6,30:8,31:10,27:13,28:15},R=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],L;(function(o){o[o.ERROR=0]="ERROR",o[o.TEXT=1]="TEXT",o[o.WARNING=2]="WARNING",o[o.INFO=2]="INFO",o[o.DEBUG=3]="DEBUG",o[o.DATA=3]="DATA"})(L||(L={}));var T=function(){function o(){this.time=null,this.verboseLevel=L.ERROR}var E=o.prototype;return E.log=function(h,b){this.verboseLevel>=h&&a.logger.log(this.time+" ["+h+"] "+b)},o}(),S=function(E){for(var g=[],h=0;h<E.length;h++)g.push(E[h].toString(16));return g},c=function(){function o(g,h,b,_,O){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=g||"white",this.underline=h||!1,this.italics=b||!1,this.background=_||"black",this.flash=O||!1}var E=o.prototype;return E.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},E.setStyles=function(h){for(var b=["foreground","underline","italics","background","flash"],_=0;_<b.length;_++){var O=b[_];h.hasOwnProperty(O)&&(this[O]=h[O])}},E.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},E.equals=function(h){return this.foreground===h.foreground&&this.underline===h.underline&&this.italics===h.italics&&this.background===h.background&&this.flash===h.flash},E.copy=function(h){this.foreground=h.foreground,this.underline=h.underline,this.italics=h.italics,this.background=h.background,this.flash=h.flash},E.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},o}(),i=function(){function o(g,h,b,_,O,C){this.uchar=void 0,this.penState=void 0,this.uchar=g||" ",this.penState=new c(h,b,_,O,C)}var E=o.prototype;return E.reset=function(){this.uchar=" ",this.penState.reset()},E.setChar=function(h,b){this.uchar=h,this.penState.copy(b)},E.setPenState=function(h){this.penState.copy(h)},E.equals=function(h){return this.uchar===h.uchar&&this.penState.equals(h.penState)},E.copy=function(h){this.uchar=h.uchar,this.penState.copy(h.penState)},E.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},o}(),f=function(){function o(g){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var h=0;h<y;h++)this.chars.push(new i);this.logger=g,this.pos=0,this.currPenState=new c}var E=o.prototype;return E.equals=function(h){for(var b=!0,_=0;_<y;_++)if(!this.chars[_].equals(h.chars[_])){b=!1;break}return b},E.copy=function(h){for(var b=0;b<y;b++)this.chars[b].copy(h.chars[b])},E.isEmpty=function(){for(var h=!0,b=0;b<y;b++)if(!this.chars[b].isEmpty()){h=!1;break}return h},E.setCursor=function(h){this.pos!==h&&(this.pos=h),this.pos<0?(this.logger.log(L.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>y&&(this.logger.log(L.DEBUG,"Too large cursor position "+this.pos),this.pos=y)},E.moveCursor=function(h){var b=this.pos+h;if(h>1)for(var _=this.pos+1;_<b+1;_++)this.chars[_].setPenState(this.currPenState);this.setCursor(b)},E.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},E.insertChar=function(h){h>=144&&this.backSpace();var b=u(h);if(this.pos>=y){this.logger.log(L.ERROR,"Cannot insert "+h.toString(16)+" ("+b+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(b,this.currPenState),this.moveCursor(1)},E.clearFromPos=function(h){var b;for(b=h;b<y;b++)this.chars[b].reset()},E.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},E.clearToEndOfRow=function(){this.clearFromPos(this.pos)},E.getTextString=function(){for(var h=[],b=!0,_=0;_<y;_++){var O=this.chars[_].uchar;O!==" "&&(b=!1),h.push(O)}return b?"":h.join("")},E.setPenStyles=function(h){this.currPenState.setStyles(h);var b=this.chars[this.pos];b.setPenState(this.currPenState)},o}(),m=function(){function o(g){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var h=0;h<M;h++)this.rows.push(new f(g));this.logger=g,this.currRow=M-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var E=o.prototype;return E.reset=function(){for(var h=0;h<M;h++)this.rows[h].clear();this.currRow=M-1},E.equals=function(h){for(var b=!0,_=0;_<M;_++)if(!this.rows[_].equals(h.rows[_])){b=!1;break}return b},E.copy=function(h){for(var b=0;b<M;b++)this.rows[b].copy(h.rows[b])},E.isEmpty=function(){for(var h=!0,b=0;b<M;b++)if(!this.rows[b].isEmpty()){h=!1;break}return h},E.backSpace=function(){var h=this.rows[this.currRow];h.backSpace()},E.clearToEndOfRow=function(){var h=this.rows[this.currRow];h.clearToEndOfRow()},E.insertChar=function(h){var b=this.rows[this.currRow];b.insertChar(h)},E.setPen=function(h){var b=this.rows[this.currRow];b.setPenStyles(h)},E.moveCursor=function(h){var b=this.rows[this.currRow];b.moveCursor(h)},E.setCursor=function(h){this.logger.log(L.INFO,"setCursor: "+h);var b=this.rows[this.currRow];b.setCursor(h)},E.setPAC=function(h){this.logger.log(L.INFO,"pacData = "+JSON.stringify(h));var b=h.row-1;if(this.nrRollUpRows&&b<this.nrRollUpRows-1&&(b=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==b){for(var _=0;_<M;_++)this.rows[_].clear();var O=this.currRow+1-this.nrRollUpRows,C=this.lastOutputScreen;if(C){var P=C.rows[O].cueStartTime,w=this.logger.time;if(P&&w!==null&&P<w)for(var U=0;U<this.nrRollUpRows;U++)this.rows[b-this.nrRollUpRows+U+1].copy(C.rows[O+U])}}this.currRow=b;var k=this.rows[this.currRow];if(h.indent!==null){var N=h.indent,F=Math.max(N-1,0);k.setCursor(h.indent),h.color=k.chars[F].penState.foreground}var H={foreground:h.color,underline:h.underline,italics:h.italics,background:"black",flash:!1};this.setPen(H)},E.setBkgData=function(h){this.logger.log(L.INFO,"bkgData = "+JSON.stringify(h)),this.backSpace(),this.setPen(h),this.insertChar(32)},E.setRollUpRows=function(h){this.nrRollUpRows=h},E.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(L.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(L.TEXT,this.getDisplayText());var h=this.currRow+1-this.nrRollUpRows,b=this.rows.splice(h,1)[0];b.clear(),this.rows.splice(this.currRow,0,b),this.logger.log(L.INFO,"Rolling up")},E.getDisplayText=function(h){h=h||!1;for(var b=[],_="",O=-1,C=0;C<M;C++){var P=this.rows[C].getTextString();P&&(O=C+1,h?b.push("Row "+O+": '"+P+"'"):b.push(P.trim()))}return b.length>0&&(h?_="["+b.join(" | ")+"]":_=b.join(`
|
|
19
19
|
`)),_},E.getTextAndFormat=function(){return this.rows},o}(),d=function(){function o(g,h,b){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=g,this.outputFilter=h,this.mode=null,this.verbose=0,this.displayedMemory=new m(b),this.nonDisplayedMemory=new m(b),this.lastOutputScreen=new m(b),this.currRollUpRow=this.displayedMemory.rows[M-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=b}var E=o.prototype;return E.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[M-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},E.getHandler=function(){return this.outputFilter},E.setHandler=function(h){this.outputFilter=h},E.setPAC=function(h){this.writeScreen.setPAC(h)},E.setBkgData=function(h){this.writeScreen.setBkgData(h)},E.setMode=function(h){h!==this.mode&&(this.mode=h,this.logger.log(L.INFO,"MODE="+h),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=h)},E.insertChars=function(h){for(var b=0;b<h.length;b++)this.writeScreen.insertChar(h[b]);var _=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(L.INFO,_+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(L.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},E.ccRCL=function(){this.logger.log(L.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},E.ccBS=function(){this.logger.log(L.INFO,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},E.ccAOF=function(){},E.ccAON=function(){},E.ccDER=function(){this.logger.log(L.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},E.ccRU=function(h){this.logger.log(L.INFO,"RU("+h+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(h)},E.ccFON=function(){this.logger.log(L.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},E.ccRDC=function(){this.logger.log(L.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},E.ccTR=function(){this.logger.log(L.INFO,"TR"),this.setMode("MODE_TEXT")},E.ccRTD=function(){this.logger.log(L.INFO,"RTD"),this.setMode("MODE_TEXT")},E.ccEDM=function(){this.logger.log(L.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},E.ccCR=function(){this.logger.log(L.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},E.ccENM=function(){this.logger.log(L.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},E.ccEOC=function(){if(this.logger.log(L.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var h=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=h,this.writeScreen=this.nonDisplayedMemory,this.logger.log(L.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},E.ccTO=function(h){this.logger.log(L.INFO,"TO("+h+") - Tab Offset"),this.writeScreen.moveCursor(h)},E.ccMIDROW=function(h){var b={flash:!1};if(b.underline=h%2===1,b.italics=h>=46,b.italics)b.foreground="white";else{var _=Math.floor(h/2)-16,O=["white","green","blue","cyan","red","yellow","magenta"];b.foreground=O[_]}this.logger.log(L.INFO,"MIDROW: "+JSON.stringify(b)),this.writeScreen.setPen(b)},E.outputDataUpdate=function(h){h===void 0&&(h=!1);var b=this.logger.time;b!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=b:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,b,this.lastOutputScreen),h&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:b),this.lastOutputScreen.copy(this.displayedMemory))},E.cueSplitAtTime=function(h){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,h,this.displayedMemory),this.cueStartTime=h))},o}(),l=function(){function o(g,h,b){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var _=new T;this.channels=[null,new d(g,h,_),new d(g+1,b,_)],this.cmdHistory=p(),this.logger=_}var E=o.prototype;return E.getHandler=function(h){return this.channels[h].getHandler()},E.setHandler=function(h,b){this.channels[h].setHandler(b)},E.addData=function(h,b){var _,O,C,P=!1;this.logger.time=h;for(var w=0;w<b.length;w+=2)if(O=b[w]&127,C=b[w+1]&127,!(O===0&&C===0)){if(this.logger.log(L.DATA,"["+S([b[w],b[w+1]])+"] -> ("+S([O,C])+")"),_=this.parseCmd(O,C),_||(_=this.parseMidrow(O,C)),_||(_=this.parsePAC(O,C)),_||(_=this.parseBackgroundAttributes(O,C)),!_&&(P=this.parseChars(O,C),P)){var U=this.currentChannel;if(U&&U>0){var k=this.channels[U];k.insertChars(P)}else this.logger.log(L.WARNING,"No channel found yet. TEXT-MODE?")}!_&&!P&&this.logger.log(L.WARNING,"Couldn't parse cleaned data "+S([O,C])+" orig: "+S([b[w],b[w+1]]))}},E.parseCmd=function(h,b){var _=this.cmdHistory,O=(h===20||h===28||h===21||h===29)&&b>=32&&b<=47,C=(h===23||h===31)&&b>=33&&b<=35;if(!(O||C))return!1;if(v(h,b,_))return s(null,null,_),this.logger.log(L.DEBUG,"Repeated command ("+S([h,b])+") is dropped"),!0;var P=h===20||h===21||h===23?1:2,w=this.channels[P];return h===20||h===21||h===28||h===29?b===32?w.ccRCL():b===33?w.ccBS():b===34?w.ccAOF():b===35?w.ccAON():b===36?w.ccDER():b===37?w.ccRU(2):b===38?w.ccRU(3):b===39?w.ccRU(4):b===40?w.ccFON():b===41?w.ccRDC():b===42?w.ccTR():b===43?w.ccRTD():b===44?w.ccEDM():b===45?w.ccCR():b===46?w.ccENM():b===47&&w.ccEOC():w.ccTO(b-32),s(h,b,_),this.currentChannel=P,!0},E.parseMidrow=function(h,b){var _=0;if((h===17||h===25)&&b>=32&&b<=47){if(h===17?_=1:_=2,_!==this.currentChannel)return this.logger.log(L.ERROR,"Mismatch channel in midrow parsing"),!1;var O=this.channels[_];return O?(O.ccMIDROW(b),this.logger.log(L.DEBUG,"MIDROW ("+S([h,b])+")"),!0):!1}return!1},E.parsePAC=function(h,b){var _,O=this.cmdHistory,C=(h>=17&&h<=23||h>=25&&h<=31)&&b>=64&&b<=127,P=(h===16||h===24)&&b>=64&&b<=95;if(!(C||P))return!1;if(v(h,b,O))return s(null,null,O),!0;var w=h<=23?1:2;b>=64&&b<=95?_=w===1?I[h]:A[h]:_=w===1?x[h]:D[h];var U=this.channels[w];return U?(U.setPAC(this.interpretPAC(_,b)),s(h,b,O),this.currentChannel=w,!0):!1},E.interpretPAC=function(h,b){var _,O={color:null,italics:!1,indent:null,underline:!1,row:h};return b>95?_=b-96:_=b-64,O.underline=(_&1)===1,_<=13?O.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(_/2)]:_<=15?(O.italics=!0,O.color="white"):O.indent=Math.floor((_-16)/2)*4,O},E.parseChars=function(h,b){var _,O=null,C=null;if(h>=25?(_=2,C=h-8):(_=1,C=h),C>=17&&C<=19){var P;C===17?P=b+80:C===18?P=b+112:P=b+144,this.logger.log(L.INFO,"Special char '"+u(P)+"' in channel "+_),O=[P]}else h>=32&&h<=127&&(O=b===0?[h]:[h,b]);if(O){var w=S(O);this.logger.log(L.DEBUG,"Char codes = "+w.join(",")),s(h,b,this.cmdHistory)}return O},E.parseBackgroundAttributes=function(h,b){var _=(h===16||h===24)&&b>=32&&b<=47,O=(h===23||h===31)&&b>=45&&b<=47;if(!(_||O))return!1;var C,P={};h===16||h===24?(C=Math.floor((b-32)/2),P.background=R[C],b%2===1&&(P.background=P.background+"_semi")):b===45?P.background="transparent":(P.foreground="black",b===47&&(P.underline=!0));var w=h<=23?1:2,U=this.channels[w];return U.setBkgData(P),s(h,b,this.cmdHistory),!0},E.reset=function(){for(var h=0;h<Object.keys(this.channels).length;h++){var b=this.channels[h];b&&b.reset()}this.cmdHistory=p()},E.cueSplitAtTime=function(h){for(var b=0;b<this.channels.length;b++){var _=this.channels[b];_&&_.cueSplitAtTime(h)}},o}();function s(o,E,g){g.a=o,g.b=E}function v(o,E,g){return g.a===o&&g.b===E}function p(){return{a:null,b:null}}t.default=l},"./src/utils/codecs.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"isCodecType",function(){return n}),e.d(t,"isCodecSupportedInMp4",function(){return u});var a={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function n(M,y){var I=a[y];return!!I&&I[M.slice(0,4)]===!0}function u(M,y){return MediaSource.isTypeSupported((y||"video")+'/mp4;codecs="'+M+'"')}},"./src/utils/cues.ts":function(r,t,e){"use strict";e.r(t);var a=e("./src/utils/vttparser.ts"),n=e("./src/utils/webvtt-parser.ts"),u=e("./src/utils/texttrack-utils.ts"),M=/\s/,y={newCue:function(x,A,D,R){for(var L=[],T,S,c,i,f,m=self.VTTCue||self.TextTrackCue,d=0;d<R.rows.length;d++)if(T=R.rows[d],c=!0,i=0,f="",!T.isEmpty()){for(var l=0;l<T.chars.length;l++)M.test(T.chars[l].uchar)&&c?i++:(f+=T.chars[l].uchar,c=!1);T.cueStartTime=A,A===D&&(D+=1e-4),i>=16?i--:i++;var s=Object(a.fixLineBreaks)(f.trim()),v=Object(n.generateCueId)(A,D,s);(!x||!x.cues||!x.cues.getCueById(v))&&(S=new m(A,D,s),S.id=v,S.line=d+1,S.align="left",S.position=10+Math.min(80,Math.floor(i*8/32)*10),L.push(S))}return x&&L.length&&(L.sort(function(p,o){return p.line==="auto"||o.line==="auto"?0:p.line>8&&o.line>8?o.line-p.line:p.line-o.line}),L.forEach(function(p){return Object(u.addCueToTrack)(x,p)})),L}};t.default=y},"./src/utils/discontinuities.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"findFirstFragWithCC",function(){return M}),e.d(t,"shouldAlignOnDiscontinuities",function(){return y}),e.d(t,"findDiscontinuousReferenceFrag",function(){return I}),e.d(t,"adjustSlidingStart",function(){return A}),e.d(t,"alignStream",function(){return D}),e.d(t,"alignPDT",function(){return L}),e.d(t,"alignFragmentByPDTDelta",function(){return T}),e.d(t,"alignMediaPlaylistByPDT",function(){return S});var a=e("./src/polyfills/number.ts"),n=e("./src/utils/logger.ts"),u=e("./src/controller/level-helper.ts");function M(c,i){for(var f=null,m=0,d=c.length;m<d;m++){var l=c[m];if(l&&l.cc===i){f=l;break}}return f}function y(c,i,f){return!!(i.details&&(f.endCC>f.startCC||c&&c.cc<f.startCC))}function I(c,i){var f=c.fragments,m=i.fragments;if(!m.length||!f.length){n.logger.log("No fragments to align");return}var d=M(f,m[0].cc);if(!d||d&&!d.startPTS){n.logger.log("No frag in previous level to align on");return}return d}function x(c,i){if(c){var f=c.start+i;c.start=c.startPTS=f,c.endPTS=f+c.duration}}function A(c,i){for(var f=i.fragments,m=0,d=f.length;m<d;m++)x(f[m],c);i.fragmentHint&&x(i.fragmentHint,c),i.alignedSliding=!0}function D(c,i,f){!i||(R(c,f,i),!f.alignedSliding&&i.details&&L(f,i.details),!f.alignedSliding&&i.details&&!f.skippedSegments&&Object(u.adjustSliding)(i.details,f))}function R(c,i,f){if(y(c,f,i)){var m=I(f.details,i);m&&Object(a.isFiniteNumber)(m.start)&&(n.logger.log("Adjusting PTS using last level due to CC increase within current level "+i.url),A(m.start,i))}}function L(c,i){if(!(!i.fragments.length||!c.hasProgramDateTime||!i.hasProgramDateTime)){var f=i.fragments[0].programDateTime,m=c.fragments[0].programDateTime,d=(m-f)/1e3+i.fragments[0].start;d&&Object(a.isFiniteNumber)(d)&&(n.logger.log("Adjusting PTS using programDateTime delta "+(m-f)+"ms, sliding:"+d.toFixed(3)+" "+c.url+" "),A(d,c))}}function T(c,i){var f=c.programDateTime;if(!!f){var m=(f-i)/1e3;c.start=c.startPTS=m,c.endPTS=m+c.duration}}function S(c,i){if(!(!i.fragments.length||!c.hasProgramDateTime||!i.hasProgramDateTime)){var f=i.fragments[0].programDateTime,m=i.fragments[0].start,d=f-m*1e3;c.fragments.forEach(function(l){T(l,d)}),c.fragmentHint&&T(c.fragmentHint,d),c.alignedSliding=!0}}},"./src/utils/ewma-bandwidth-estimator.ts":function(r,t,e){"use strict";e.r(t);var a=e("./src/utils/ewma.ts"),n=function(){function u(y,I,x){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=x,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new a.default(y),this.fast_=new a.default(I)}var M=u.prototype;return M.update=function(I,x){var A=this.slow_,D=this.fast_;this.slow_.halfLife!==I&&(this.slow_=new a.default(I,A.getEstimate(),A.getTotalWeight())),this.fast_.halfLife!==x&&(this.fast_=new a.default(x,D.getEstimate(),D.getTotalWeight()))},M.sample=function(I,x){I=Math.max(I,this.minDelayMs_);var A=8*x,D=I/1e3,R=A/D;this.fast_.sample(D,R),this.slow_.sample(D,R)},M.canEstimate=function(){var I=this.fast_;return I&&I.getTotalWeight()>=this.minWeight_},M.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},M.destroy=function(){},u}();t.default=n},"./src/utils/ewma.ts":function(r,t,e){"use strict";e.r(t);var a=function(){function n(M,y,I){y===void 0&&(y=0),I===void 0&&(I=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=M,this.alpha_=M?Math.exp(Math.log(.5)/M):0,this.estimate_=y,this.totalWeight_=I}var u=n.prototype;return u.sample=function(y,I){var x=Math.pow(this.alpha_,y);this.estimate_=I*(1-x)+x*this.estimate_,this.totalWeight_+=y},u.getTotalWeight=function(){return this.totalWeight_},u.getEstimate=function(){if(this.alpha_){var y=1-Math.pow(this.alpha_,this.totalWeight_);if(y)return this.estimate_/y}return this.estimate_},n}();t.default=a},"./src/utils/fetch-loader.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"fetchSupported",function(){return T});var a=e("./src/polyfills/number.ts"),n=e("./src/loader/load-stats.ts"),u=e("./src/demux/chunk-cache.ts");function M(m,d){m.prototype=Object.create(d.prototype),m.prototype.constructor=m,D(m,d)}function y(m){var d=typeof Map=="function"?new Map:void 0;return y=function(s){if(s===null||!A(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof d!="undefined"){if(d.has(s))return d.get(s);d.set(s,v)}function v(){return I(s,arguments,R(this).constructor)}return v.prototype=Object.create(s.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),D(v,s)},y(m)}function I(m,d,l){return x()?I=Reflect.construct.bind():I=function(v,p,o){var E=[null];E.push.apply(E,p);var g=Function.bind.apply(v,E),h=new g;return o&&D(h,o.prototype),h},I.apply(null,arguments)}function x(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function A(m){return Function.toString.call(m).indexOf("[native code]")!==-1}function D(m,d){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,v){return s.__proto__=v,s},D(m,d)}function R(m){return R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(l){return l.__proto__||Object.getPrototypeOf(l)},R(m)}function L(){return L=Object.assign?Object.assign.bind():function(m){for(var d=1;d<arguments.length;d++){var l=arguments[d];for(var s in l)Object.prototype.hasOwnProperty.call(l,s)&&(m[s]=l[s])}return m},L.apply(this,arguments)}function T(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}var S=function(){function m(l){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=l.fetchSetup||i,this.controller=new self.AbortController,this.stats=new n.LoadStats}var d=m.prototype;return d.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},d.abortInternal=function(){var s=this.response;(!s||!s.ok)&&(this.stats.aborted=!0,this.controller.abort())},d.abort=function(){var s;this.abortInternal(),(s=this.callbacks)!==null&&s!==void 0&&s.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},d.load=function(s,v,p){var o=this,E=this.stats;if(E.loading.start)throw new Error("Loader can only be used once.");E.loading.start=self.performance.now();var g=c(s,this.controller.signal),h=p.onProgress,b=s.responseType==="arraybuffer",_=b?"byteLength":"length";this.context=s,this.config=v,this.callbacks=p,this.request=this.fetchSetup(s,g),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){o.abortInternal(),p.onTimeout(E,s,o.response)},v.timeout),self.fetch(this.request).then(function(O){if(o.response=o.loader=O,!O.ok){var C=O.status,P=O.statusText;throw new f(P||"fetch, bad network response",C,O)}return E.loading.first=Math.max(self.performance.now(),E.loading.start),E.total=parseInt(O.headers.get("Content-Length")||"0"),h&&Object(a.isFiniteNumber)(v.highWaterMark)?o.loadProgressively(O,E,s,v.highWaterMark,h):b?O.arrayBuffer():O.text()}).then(function(O){var C=o.response;self.clearTimeout(o.requestTimeout),E.loading.end=Math.max(self.performance.now(),E.loading.first),E.loaded=E.total=O[_];var P={url:C.url,data:O};h&&!Object(a.isFiniteNumber)(v.highWaterMark)&&h(E,s,O,C),p.onSuccess(P,E,s,C)}).catch(function(O){if(self.clearTimeout(o.requestTimeout),!E.aborted){var C=O&&O.code||0,P=O?O.message:null;p.onError({code:C,text:P},s,O?O.details:null)}})},d.getCacheAge=function(){var s=null;if(this.response){var v=this.response.headers.get("age");s=v?parseFloat(v):null}return s},d.loadProgressively=function(s,v,p,o,E){o===void 0&&(o=0);var g=new u.default,h=s.body.getReader(),b=function _(){return h.read().then(function(O){if(O.done)return g.dataLength&&E(v,p,g.flush(),s),Promise.resolve(new ArrayBuffer(0));var C=O.value,P=C.length;return v.loaded+=P,P<o||g.dataLength?(g.push(C),g.dataLength>=o&&E(v,p,g.flush(),s)):E(v,p,C,s),_()}).catch(function(){return Promise.reject()})};return b()},m}();function c(m,d){var l={method:"GET",mode:"cors",credentials:"same-origin",signal:d,headers:new self.Headers(L({},m.headers))};return m.rangeEnd&&l.headers.set("Range","bytes="+m.rangeStart+"-"+String(m.rangeEnd-1)),l}function i(m,d){return new self.Request(m.url,d)}var f=function(m){M(d,m);function d(l,s,v){var p;return p=m.call(this,l)||this,p.code=void 0,p.details=void 0,p.code=s,p.details=v,p}return d}(y(Error));t.default=S},"./src/utils/imsc1-ttml-parser.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"IMSC1_CODEC",function(){return A}),e.d(t,"parseIMSC1",function(){return T});var a=e("./src/utils/mp4-tools.ts"),n=e("./src/utils/vttparser.ts"),u=e("./src/utils/vttcue.ts"),M=e("./src/demux/id3.ts"),y=e("./src/utils/timescale-conversion.ts"),I=e("./src/utils/webvtt-parser.ts");function x(){return x=Object.assign?Object.assign.bind():function(o){for(var E=1;E<arguments.length;E++){var g=arguments[E];for(var h in g)Object.prototype.hasOwnProperty.call(g,h)&&(o[h]=g[h])}return o},x.apply(this,arguments)}var A="stpp.ttml.im1t",D=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,R=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,L={left:"start",center:"center",right:"end",start:"start",end:"end"};function T(o,E,g,h,b){var _=Object(a.findBox)(new Uint8Array(o),["mdat"]);if(_.length===0){b(new Error("Could not parse IMSC1 mdat"));return}var O=_.map(function(P){return Object(M.utf8ArrayToStr)(P)}),C=Object(y.toTimescaleFromScale)(E,1,g);try{O.forEach(function(P){return h(S(P,C))})}catch(P){b(P)}}function S(o,E){var g=new DOMParser,h=g.parseFromString(o,"text/xml"),b=h.getElementsByTagName("tt")[0];if(!b)throw new Error("Invalid ttml");var _={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},O=Object.keys(_).reduce(function(k,N){return k[N]=b.getAttribute("ttp:"+N)||_[N],k},{}),C=b.getAttribute("xml:space")!=="preserve",P=i(c(b,"styling","style")),w=i(c(b,"layout","region")),U=c(b,"body","[begin]");return[].map.call(U,function(k){var N=f(k,C);if(!N||!k.hasAttribute("begin"))return null;var F=s(k.getAttribute("begin"),O),H=s(k.getAttribute("dur"),O),W=s(k.getAttribute("end"),O);if(F===null)throw l(k);if(W===null){if(H===null)throw l(k);W=F+H}var B=new u.default(F-E,W-E,N);B.id=Object(I.generateCueId)(B.startTime,B.endTime,B.text);var j=w[k.getAttribute("region")],V=P[k.getAttribute("style")];B.position=10,B.size=80;var Y=m(j,V,P),Q=Y.textAlign;if(Q){var J=L[Q];J&&(B.lineAlign=J),B.align=Q}return x(B,Y),B}).filter(function(k){return k!==null})}function c(o,E,g){var h=o.getElementsByTagName(E)[0];return h?[].slice.call(h.querySelectorAll(g)):[]}function i(o){return o.reduce(function(E,g){var h=g.getAttribute("xml:id");return h&&(E[h]=g),E},{})}function f(o,E){return[].slice.call(o.childNodes).reduce(function(g,h,b){var _;return h.nodeName==="br"&&b?g+`
|
|
20
20
|
`:(_=h.childNodes)!==null&&_!==void 0&&_.length?f(h,E):E?g+h.textContent.trim().replace(/\s+/g," "):g+h.textContent},"")}function m(o,E,g){var h="http://www.w3.org/ns/ttml#styling",b=null,_=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],O=o!=null&&o.hasAttribute("style")?o.getAttribute("style"):null;return O&&g.hasOwnProperty(O)&&(b=g[O]),_.reduce(function(C,P){var w=d(E,h,P)||d(o,h,P)||d(b,h,P);return w&&(C[P]=w),C},{})}function d(o,E,g){return o&&o.hasAttributeNS(E,g)?o.getAttributeNS(E,g):null}function l(o){return new Error("Could not parse ttml timestamp "+o)}function s(o,E){if(!o)return null;var g=Object(n.parseTimeStamp)(o);return g===null&&(D.test(o)?g=v(o,E):R.test(o)&&(g=p(o,E))),g}function v(o,E){var g=D.exec(o),h=(g[4]|0)+(g[5]|0)/E.subFrameRate;return(g[1]|0)*3600+(g[2]|0)*60+(g[3]|0)+h/E.frameRate}function p(o,E){var g=R.exec(o),h=Number(g[1]),b=g[2];switch(b){case"h":return h*3600;case"m":return h*60;case"ms":return h*1e3;case"f":return h/E.frameRate;case"t":return h/E.tickRate}return h}},"./src/utils/logger.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"enableLogs",function(){return I}),e.d(t,"logger",function(){return x});var a=function(){},n={trace:a,debug:a,log:a,warn:a,info:a,error:a},u=n;function M(A){var D=self.console[A];return D?D.bind(self.console,"["+A+"] >"):a}function y(A){for(var D=arguments.length,R=new Array(D>1?D-1:0),L=1;L<D;L++)R[L-1]=arguments[L];R.forEach(function(T){u[T]=A[T]?A[T].bind(A):M(T)})}function I(A){if(self.console&&A===!0||typeof A=="object"){y(A,"debug","log","info","warn","error");try{u.log()}catch{u=n}}else u=n}var x=u},"./src/utils/mediakeys-helper.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"KeySystems",function(){return a}),e.d(t,"requestMediaKeySystemAccess",function(){return n});var a;(function(u){u.WIDEVINE="com.widevine.alpha",u.PLAYREADY="com.microsoft.playready"})(a||(a={}));var n=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"getMediaSource",function(){return a});function a(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"RemuxerTrackIdConfig",function(){return I}),e.d(t,"bin2str",function(){return x}),e.d(t,"readUint16",function(){return A}),e.d(t,"readUint32",function(){return D}),e.d(t,"readSint32",function(){return R}),e.d(t,"writeUint32",function(){return L}),e.d(t,"findBox",function(){return T}),e.d(t,"parseSegmentIndex",function(){return S}),e.d(t,"parseInitSegment",function(){return c}),e.d(t,"getStartDTS",function(){return i}),e.d(t,"getDuration",function(){return f}),e.d(t,"computeRawDurationFromSamples",function(){return m}),e.d(t,"offsetStartDTS",function(){return d}),e.d(t,"segmentValidRange",function(){return l}),e.d(t,"appendUint8Array",function(){return s}),e.d(t,"parseSamples",function(){return v}),e.d(t,"parseSEIMessageFromNALu",function(){return E}),e.d(t,"parseEmsg",function(){return h});var a=e("./src/utils/typed-array.ts"),n=e("./src/loader/fragment.ts"),u=e("./src/demux/id3.ts"),M=Math.pow(2,32)-1,y=[].push,I={video:1,audio:2,id3:3,text:4};function x(b){return String.fromCharCode.apply(null,b)}function A(b,_){var O=b[_]<<8|b[_+1];return O<0?65536+O:O}function D(b,_){var O=R(b,_);return O<0?4294967296+O:O}function R(b,_){return b[_]<<24|b[_+1]<<16|b[_+2]<<8|b[_+3]}function L(b,_,O){b[_]=O>>24,b[_+1]=O>>16&255,b[_+2]=O>>8&255,b[_+3]=O&255}function T(b,_){var O=[];if(!_.length)return O;for(var C=b.byteLength,P=0;P<C;){var w=D(b,P),U=x(b.subarray(P+4,P+8)),k=w>1?P+w:C;if(U===_[0])if(_.length===1)O.push(b.subarray(P+8,k));else{var N=T(b.subarray(P+8,k),_.slice(1));N.length&&y.apply(O,N)}P=k}return O}function S(b){var _=[],O=b[0],C=8,P=D(b,C);C+=4;var w=0,U=0;O===0?C+=8:C+=16,C+=2;var k=b.length+U,N=A(b,C);C+=2;for(var F=0;F<N;F++){var H=C,W=D(b,H);H+=4;var B=W&2147483647,j=(W&2147483648)>>>31;if(j===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var V=D(b,H);H+=4,_.push({referenceSize:B,subsegmentDuration:V,info:{duration:V/P,start:k,end:k+B-1}}),k+=B,H+=4,C=H}return{earliestPresentationTime:w,timescale:P,version:O,referencesCount:N,references:_}}function c(b){for(var _=[],O=T(b,["moov","trak"]),C=0;C<O.length;C++){var P=O[C],w=T(P,["tkhd"])[0];if(w){var U=w[0],k=U===0?12:20,N=D(w,k),F=T(P,["mdia","mdhd"])[0];if(F){U=F[0],k=U===0?12:20;var H=D(F,k),W=T(P,["mdia","hdlr"])[0];if(W){var B=x(W.subarray(8,12)),j={soun:n.ElementaryStreamTypes.AUDIO,vide:n.ElementaryStreamTypes.VIDEO}[B];if(j){var V=T(P,["mdia","minf","stbl","stsd"])[0],Y=void 0;V&&(Y=x(V.subarray(12,16))),_[N]={timescale:H,type:j},_[j]={timescale:H,id:N,codec:Y}}}}}}var Q=T(b,["moov","mvex","trex"]);return Q.forEach(function(J){var z=D(J,4),te=_[z];te&&(te.default={duration:D(J,12),flags:D(J,20)})}),_}function i(b,_){return T(_,["moof","traf"]).reduce(function(O,C){var P=T(C,["tfdt"])[0],w=P[0],U=T(C,["tfhd"]).reduce(function(k,N){var F=D(N,4),H=b[F];if(H){var W=D(P,4);w===1&&(W*=Math.pow(2,32),W+=D(P,8));var B=H.timescale||9e4,j=W/B;if(isFinite(j)&&(k===null||j<k))return j}return k},null);return U!==null&&isFinite(U)&&(O===null||U<O)?U:O},null)||0}function f(b,_){for(var O=0,C=0,P=0,w=T(b,["moof","traf"]),U=0;U<w.length;U++){var k=w[U],N=T(k,["tfhd"])[0],F=D(N,4),H=_[F];if(!!H){var W=H.default,B=D(N,0)|(W==null?void 0:W.flags),j=W==null?void 0:W.duration;B&8&&(B&2?j=D(N,12):j=D(N,8));for(var V=H.timescale||9e4,Y=T(k,["trun"]),Q=0;Q<Y.length;Q++){if(O=m(Y[Q]),!O&&j){var J=D(Y[Q],4);O=j*J}H.type===n.ElementaryStreamTypes.VIDEO?C+=O/V:H.type===n.ElementaryStreamTypes.AUDIO&&(P+=O/V)}}}if(C===0&&P===0){for(var z=0,te=T(b,["sidx"]),se=0;se<te.length;se++){var Z=S(te[se]);Z!=null&&Z.references&&(z+=Z.references.reduce(function(Ee,fe){return Ee+fe.info.duration||0},0))}return z}return C||P}function m(b){var _=D(b,0),O=8;_&1&&(O+=4),_&4&&(O+=4);for(var C=0,P=D(b,4),w=0;w<P;w++){if(_&256){var U=D(b,O);C+=U,O+=4}_&512&&(O+=4),_&1024&&(O+=4),_&2048&&(O+=4)}return C}function d(b,_,O){T(_,["moof","traf"]).forEach(function(C){T(C,["tfhd"]).forEach(function(P){var w=D(P,4),U=b[w];if(!!U){var k=U.timescale||9e4;T(C,["tfdt"]).forEach(function(N){var F=N[0],H=D(N,4);if(F===0)H-=O*k,H=Math.max(H,0),L(N,4,H);else{H*=Math.pow(2,32),H+=D(N,8),H-=O*k,H=Math.max(H,0);var W=Math.floor(H/(M+1)),B=Math.floor(H%(M+1));L(N,4,W),L(N,8,B)}})}})})}function l(b){var _={valid:null,remainder:null},O=T(b,["moof"]);if(O){if(O.length<2)return _.remainder=b,_}else return _;var C=O[O.length-1];return _.valid=Object(a.sliceUint8)(b,0,C.byteOffset-8),_.remainder=Object(a.sliceUint8)(b,C.byteOffset-8),_}function s(b,_){var O=new Uint8Array(b.length+_.length);return O.set(b),O.set(_,b.length),O}function v(b,_){var O=[],C=_.samples,P=_.timescale,w=_.id,U=!1,k=T(C,["moof"]);return k.map(function(N){var F=N.byteOffset-8,H=T(N,["traf"]);H.map(function(W){var B=T(W,["tfdt"]).map(function(j){var V=j[0],Y=D(j,4);return V===1&&(Y*=Math.pow(2,32),Y+=D(j,8)),Y/P})[0];return B!==void 0&&(b=B),T(W,["tfhd"]).map(function(j){var V=D(j,4),Y=D(j,0)&16777215,Q=(Y&1)!==0,J=(Y&2)!==0,z=(Y&8)!==0,te=0,se=(Y&16)!==0,Z=0,Ee=(Y&32)!==0,fe=8;V===w&&(Q&&(fe+=8),J&&(fe+=4),z&&(te=D(j,fe),fe+=4),se&&(Z=D(j,fe),fe+=4),Ee&&(fe+=4),_.type==="video"&&(U=p(_.codec)),T(W,["trun"]).map(function(re){var q=re[0],ie=D(re,0)&16777215,ne=(ie&1)!==0,Te=0,Se=(ie&4)!==0,he=(ie&256)!==0,Oe=0,Ce=(ie&512)!==0,Ue=0,me=(ie&1024)!==0,Ae=(ie&2048)!==0,Re=0,Ie=D(re,4),Ne=8;ne&&(Te=D(re,Ne),Ne+=4),Se&&(Ne+=4);for(var je=Te+F,Qe=0;Qe<Ie;Qe++){if(he?(Oe=D(re,Ne),Ne+=4):Oe=te,Ce?(Ue=D(re,Ne),Ne+=4):Ue=Z,me&&(Ne+=4),Ae&&(q===0?Re=D(re,Ne):Re=R(re,Ne),Ne+=4),_.type===n.ElementaryStreamTypes.VIDEO)for(var Fe=0;Fe<Ue;){var ke=D(C,je);je+=4;var G=C[je]&31;if(o(U,G)){var $=C.subarray(je,je+ke);E($,b+Re/P,O)}je+=ke,Fe+=ke+4}b+=Oe/P}}))})})}),O}function p(b){if(!b)return!1;var _=b.indexOf("."),O=_<0?b:b.substring(0,_);return O==="hvc1"||O==="hev1"||O==="dvh1"||O==="dvhe"}function o(b,_){return b?_===39||_===40:_===6}function E(b,_,O){var C=g(b),P=0;P++;for(var w=0,U=0,k=!1,N=0;P<C.length;){w=0;do{if(P>=C.length)break;N=C[P++],w+=N}while(N===255);U=0;do{if(P>=C.length)break;N=C[P++],U+=N}while(N===255);var F=C.length-P;if(!k&&w===4&&P<C.length){k=!0;var H=C[P++];if(H===181){var W=A(C,P);if(P+=2,W===49){var B=D(C,P);if(P+=4,B===1195456820){var j=C[P++];if(j===3){var V=C[P++],Y=31&V,Q=64&V,J=Q?2+Y*3:0,z=new Uint8Array(J);if(Q){z[0]=V;for(var te=1;te<J;te++)z[te]=C[P++]}O.push({type:j,payloadType:w,pts:_,bytes:z})}}}}}else if(w===5&&U<F){if(k=!0,U>16){for(var se=[],Z=0;Z<16;Z++){var Ee=C[P++].toString(16);se.push(Ee.length==1?"0"+Ee:Ee),(Z===3||Z===5||Z===7||Z===9)&&se.push("-")}for(var fe=U-16,re=new Uint8Array(fe),q=0;q<fe;q++)re[q]=C[P++];O.push({payloadType:w,pts:_,uuid:se.join(""),userData:Object(u.utf8ArrayToStr)(re),userDataBytes:re})}}else if(U<F)P+=U;else if(U>F)break}}function g(b){for(var _=b.byteLength,O=[],C=1;C<_-2;)b[C]===0&&b[C+1]===0&&b[C+2]===3?(O.push(C+2),C+=2):C++;if(O.length===0)return b;var P=_-O.length,w=new Uint8Array(P),U=0;for(C=0;C<P;U++,C++)U===O[0]&&(U++,O.shift()),w[C]=b[U];return w}function h(b){var _=b[0],O="",C="",P=0,w=0,U=0,k=0,N=0,F=0;if(_===0){for(;x(b.subarray(F,F+1))!=="\0";)O+=x(b.subarray(F,F+1)),F+=1;for(O+=x(b.subarray(F,F+1)),F+=1;x(b.subarray(F,F+1))!=="\0";)C+=x(b.subarray(F,F+1)),F+=1;C+=x(b.subarray(F,F+1)),F+=1,P=D(b,12),w=D(b,16),k=D(b,20),N=D(b,24),F=28}else if(_===1){F+=4,P=D(b,F),F+=4;var H=D(b,F);F+=4;var W=D(b,F);for(F+=4,U=Math.pow(2,32)*H+W,Number.isSafeInteger(U)||(U=Number.MAX_SAFE_INTEGER,console.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),k=D(b,F),F+=4,N=D(b,F),F+=4;x(b.subarray(F,F+1))!=="\0";)O+=x(b.subarray(F,F+1)),F+=1;for(O+=x(b.subarray(F,F+1)),F+=1;x(b.subarray(F,F+1))!=="\0";)C+=x(b.subarray(F,F+1)),F+=1;C+=x(b.subarray(F,F+1)),F+=1}var B=b.subarray(F,b.byteLength);return{schemeIdUri:O,value:C,timeScale:P,presentationTime:U,presentationTimeDelta:w,eventDuration:k,id:N,payload:B}}},"./src/utils/output-filter.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"default",function(){return a});var a=function(){function n(M,y){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=M,this.trackName=y}var u=n.prototype;return u.dispatchCue=function(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)},u.newCue=function(y,I,x){(this.startTime===null||this.startTime>y)&&(this.startTime=y),this.endTime=I,this.screen=x,this.timelineController.createCaptionsTrack(this.trackName)},u.reset=function(){this.cueRanges=[],this.startTime=null},n}()},"./src/utils/texttrack-utils.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"sendAddTrackEvent",function(){return n}),e.d(t,"addCueToTrack",function(){return u}),e.d(t,"clearCurrentCues",function(){return M}),e.d(t,"removeCuesInRange",function(){return y}),e.d(t,"getCuesInRange",function(){return x});var a=e("./src/utils/logger.ts");function n(A,D){var R;try{R=new Event("addtrack")}catch{R=document.createEvent("Event"),R.initEvent("addtrack",!1,!1)}R.track=A,D.dispatchEvent(R)}function u(A,D){var R=A.mode;if(R==="disabled"&&(A.mode="hidden"),A.cues&&!A.cues.getCueById(D.id))try{if(A.addCue(D),!A.cues.getCueById(D.id))throw new Error("addCue is failed for: "+D)}catch(T){a.logger.debug("[texttrack-utils]: "+T);var L=new self.TextTrackCue(D.startTime,D.endTime,D.text);L.id=D.id,A.addCue(L)}R==="disabled"&&(A.mode=R)}function M(A){var D=A.mode;if(D==="disabled"&&(A.mode="hidden"),A.cues)for(var R=A.cues.length;R--;)A.removeCue(A.cues[R]);D==="disabled"&&(A.mode=D)}function y(A,D,R,L){var T=A.mode;if(T==="disabled"&&(A.mode="hidden"),A.cues&&A.cues.length>0)for(var S=x(A.cues,D,R),c=0;c<S.length;c++)(!L||L(S[c]))&&A.removeCue(S[c]);T==="disabled"&&(A.mode=T)}function I(A,D){if(D<A[0].startTime)return 0;var R=A.length-1;if(D>A[R].endTime)return-1;for(var L=0,T=R;L<=T;){var S=Math.floor((T+L)/2);if(D<A[S].startTime)T=S-1;else if(D>A[S].startTime&&L<R)L=S+1;else return S}return A[L].startTime-D<D-A[T].startTime?L:T}function x(A,D,R){var L=[],T=I(A,D);if(T>-1)for(var S=T,c=A.length;S<c;S++){var i=A[S];if(i.startTime>=D&&i.endTime<=R)L.push(i);else if(i.startTime>R)return L}return L}},"./src/utils/time-ranges.ts":function(r,t,e){"use strict";e.r(t);var a={toString:function(u){for(var M="",y=u.length,I=0;I<y;I++)M+="["+u.start(I).toFixed(3)+","+u.end(I).toFixed(3)+"]";return M}};t.default=a},"./src/utils/timescale-conversion.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"toTimescaleFromBase",function(){return n}),e.d(t,"toTimescaleFromScale",function(){return u}),e.d(t,"toMsFromMpegTsClock",function(){return M}),e.d(t,"toMpegTsClockFromTimescale",function(){return y});var a=9e4;function n(I,x,A,D){A===void 0&&(A=1),D===void 0&&(D=!1);var R=I*x*A;return D?Math.round(R):R}function u(I,x,A,D){return A===void 0&&(A=1),D===void 0&&(D=!1),n(I,x,1/A,D)}function M(I,x){return x===void 0&&(x=!1),n(I,1e3,1/a,x)}function y(I,x){return x===void 0&&(x=1),n(I,a,1/x)}},"./src/utils/typed-array.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"sliceUint8",function(){return a});function a(n,u,M){return Uint8Array.prototype.slice?n.slice(u,M):new Uint8Array(Array.prototype.slice.call(n,u,M))}},"./src/utils/vttcue.ts":function(r,t,e){"use strict";e.r(t),t.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var a=["","lr","rl"],n=["start","middle","end","left","right"];function u(A,D){if(typeof D!="string"||!Array.isArray(A))return!1;var R=D.toLowerCase();return~A.indexOf(R)?R:!1}function M(A){return u(a,A)}function y(A){return u(n,A)}function I(A){for(var D=arguments.length,R=new Array(D>1?D-1:0),L=1;L<D;L++)R[L-1]=arguments[L];for(var T=1;T<arguments.length;T++){var S=arguments[T];for(var c in S)A[c]=S[c]}return A}function x(A,D,R){var L=this,T={enumerable:!0};L.hasBeenReset=!1;var S="",c=!1,i=A,f=D,m=R,d=null,l="",s=!0,v="auto",p="start",o=50,E="middle",g=50,h="middle";Object.defineProperty(L,"id",I({},T,{get:function(){return S},set:function(_){S=""+_}})),Object.defineProperty(L,"pauseOnExit",I({},T,{get:function(){return c},set:function(_){c=!!_}})),Object.defineProperty(L,"startTime",I({},T,{get:function(){return i},set:function(_){if(typeof _!="number")throw new TypeError("Start time must be set to a number.");i=_,this.hasBeenReset=!0}})),Object.defineProperty(L,"endTime",I({},T,{get:function(){return f},set:function(_){if(typeof _!="number")throw new TypeError("End time must be set to a number.");f=_,this.hasBeenReset=!0}})),Object.defineProperty(L,"text",I({},T,{get:function(){return m},set:function(_){m=""+_,this.hasBeenReset=!0}})),Object.defineProperty(L,"region",I({},T,{get:function(){return d},set:function(_){d=_,this.hasBeenReset=!0}})),Object.defineProperty(L,"vertical",I({},T,{get:function(){return l},set:function(_){var O=M(_);if(O===!1)throw new SyntaxError("An invalid or illegal string was specified.");l=O,this.hasBeenReset=!0}})),Object.defineProperty(L,"snapToLines",I({},T,{get:function(){return s},set:function(_){s=!!_,this.hasBeenReset=!0}})),Object.defineProperty(L,"line",I({},T,{get:function(){return v},set:function(_){if(typeof _!="number"&&_!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");v=_,this.hasBeenReset=!0}})),Object.defineProperty(L,"lineAlign",I({},T,{get:function(){return p},set:function(_){var O=y(_);if(!O)throw new SyntaxError("An invalid or illegal string was specified.");p=O,this.hasBeenReset=!0}})),Object.defineProperty(L,"position",I({},T,{get:function(){return o},set:function(_){if(_<0||_>100)throw new Error("Position must be between 0 and 100.");o=_,this.hasBeenReset=!0}})),Object.defineProperty(L,"positionAlign",I({},T,{get:function(){return E},set:function(_){var O=y(_);if(!O)throw new SyntaxError("An invalid or illegal string was specified.");E=O,this.hasBeenReset=!0}})),Object.defineProperty(L,"size",I({},T,{get:function(){return g},set:function(_){if(_<0||_>100)throw new Error("Size must be between 0 and 100.");g=_,this.hasBeenReset=!0}})),Object.defineProperty(L,"align",I({},T,{get:function(){return h},set:function(_){var O=y(_);if(!O)throw new SyntaxError("An invalid or illegal string was specified.");h=O,this.hasBeenReset=!0}})),L.displayState=void 0}return x.prototype.getCueAsHTML=function(){var A=self.WebVTT;return A.convertCueToDOMTree(self,this.text)},x}()},"./src/utils/vttparser.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"parseTimeStamp",function(){return u}),e.d(t,"fixLineBreaks",function(){return D}),e.d(t,"VTTParser",function(){return R});var a=e("./src/utils/vttcue.ts"),n=function(){function L(){}var T=L.prototype;return T.decode=function(c,i){if(!c)return"";if(typeof c!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(c))},L}();function u(L){function T(c,i,f,m){return(c|0)*3600+(i|0)*60+(f|0)+parseFloat(m||0)}var S=L.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return S?parseFloat(S[2])>59?T(S[2],S[3],0,S[4]):T(S[1],S[2],S[3],S[4]):null}var M=function(){function L(){this.values=Object.create(null)}var T=L.prototype;return T.set=function(c,i){!this.get(c)&&i!==""&&(this.values[c]=i)},T.get=function(c,i,f){return f?this.has(c)?this.values[c]:i[f]:this.has(c)?this.values[c]:i},T.has=function(c){return c in this.values},T.alt=function(c,i,f){for(var m=0;m<f.length;++m)if(i===f[m]){this.set(c,i);break}},T.integer=function(c,i){/^-?\d+$/.test(i)&&this.set(c,parseInt(i,10))},T.percent=function(c,i){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(i)){var f=parseFloat(i);if(f>=0&&f<=100)return this.set(c,f),!0}return!1},L}();function y(L,T,S,c){var i=c?L.split(c):[L];for(var f in i)if(typeof i[f]=="string"){var m=i[f].split(S);if(m.length===2){var d=m[0],l=m[1];T(d,l)}}}var I=new a.default(0,0,""),x=I.align==="middle"?"middle":"center";function A(L,T,S){var c=L;function i(){var d=u(L);if(d===null)throw new Error("Malformed timestamp: "+c);return L=L.replace(/^[^\sa-zA-Z-]+/,""),d}function f(d,l){var s=new M;y(d,function(o,E){var g;switch(o){case"region":for(var h=S.length-1;h>=0;h--)if(S[h].id===E){s.set(o,S[h].region);break}break;case"vertical":s.alt(o,E,["rl","lr"]);break;case"line":g=E.split(","),s.integer(o,g[0]),s.percent(o,g[0])&&s.set("snapToLines",!1),s.alt(o,g[0],["auto"]),g.length===2&&s.alt("lineAlign",g[1],["start",x,"end"]);break;case"position":g=E.split(","),s.percent(o,g[0]),g.length===2&&s.alt("positionAlign",g[1],["start",x,"end","line-left","line-right","auto"]);break;case"size":s.percent(o,E);break;case"align":s.alt(o,E,["start",x,"end","left","right"]);break}},/:/,/\s/),l.region=s.get("region",null),l.vertical=s.get("vertical","");var v=s.get("line","auto");v==="auto"&&I.line===-1&&(v=-1),l.line=v,l.lineAlign=s.get("lineAlign","start"),l.snapToLines=s.get("snapToLines",!0),l.size=s.get("size",100),l.align=s.get("align",x);var p=s.get("position","auto");p==="auto"&&I.position===50&&(p=l.align==="start"||l.align==="left"?0:l.align==="end"||l.align==="right"?100:50),l.position=p}function m(){L=L.replace(/^\s+/,"")}if(m(),T.startTime=i(),m(),L.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+c);L=L.slice(3),m(),T.endTime=i(),m(),f(L,T)}function D(L){return L.replace(/<br(?: \/)?>/gi,`
|
|
21
21
|
`)}var R=function(){function L(){this.state="INITIAL",this.buffer="",this.decoder=new n,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var T=L.prototype;return T.parse=function(c){var i=this;c&&(i.buffer+=i.decoder.decode(c,{stream:!0}));function f(){var p=i.buffer,o=0;for(p=D(p);o<p.length&&p[o]!=="\r"&&p[o]!==`
|
|
@@ -26,7 +26,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
26
26
|
`,c.parse()),c.state==="INITIAL"||c.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(i){c.onparsingerror&&c.onparsingerror(i)}return c.onflush&&c.onflush(),this},L}()},"./src/utils/webvtt-parser.ts":function(r,t,e){"use strict";e.r(t),e.d(t,"generateCueId",function(){return R}),e.d(t,"parseWebVTT",function(){return T});var a=e("./src/polyfills/number.ts"),n=e("./src/utils/vttparser.ts"),u=e("./src/demux/id3.ts"),M=e("./src/utils/timescale-conversion.ts"),y=e("./src/remux/mp4-remuxer.ts"),I=/\r\n|\n\r|\n|\r/g,x=function(c,i,f){return f===void 0&&(f=0),c.slice(f,f+i.length)===i},A=function(c){var i=parseInt(c.slice(-3)),f=parseInt(c.slice(-6,-4)),m=parseInt(c.slice(-9,-7)),d=c.length>9?parseInt(c.substring(0,c.indexOf(":"))):0;if(!Object(a.isFiniteNumber)(i)||!Object(a.isFiniteNumber)(f)||!Object(a.isFiniteNumber)(m)||!Object(a.isFiniteNumber)(d))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+c);return i+=1e3*f,i+=60*1e3*m,i+=60*60*1e3*d,i},D=function(c){for(var i=5381,f=c.length;f;)i=i*33^c.charCodeAt(--f);return(i>>>0).toString()};function R(S,c,i){return D(S.toString())+D(c.toString())+D(i)}var L=function(c,i,f){var m=c[i],d=c[m.prevCC];if(!d||!d.new&&m.new){c.ccOffset=c.presentationOffset=m.start,m.new=!1;return}for(;(l=d)!==null&&l!==void 0&&l.new;){var l;c.ccOffset+=m.start-d.start,m.new=!1,m=d,d=c[m.prevCC]}c.presentationOffset=f};function T(S,c,i,f,m,d,l,s){var v=new n.VTTParser,p=Object(u.utf8ArrayToStr)(new Uint8Array(S)).trim().replace(I,`
|
|
27
27
|
`).split(`
|
|
28
28
|
`),o=[],E=Object(M.toMpegTsClockFromTimescale)(c,i),g="00:00.000",h=0,b=0,_,O=!0;v.oncue=function(C){var P=f[m],w=f.ccOffset,U=(h-E)/9e4;P!=null&&P.new&&(b!==void 0?w=f.ccOffset=P.start:L(f,m,U)),U&&(w=U-f.presentationOffset);var k=C.endTime-C.startTime,N=Object(y.normalizePts)((C.startTime+w-b)*9e4,d*9e4)/9e4;C.startTime=Math.max(N,0),C.endTime=Math.max(N+k,0);var F=C.text.trim();C.text=decodeURIComponent(encodeURIComponent(F)),C.id||(C.id=R(C.startTime,C.endTime,F)),C.endTime>0&&o.push(C)},v.onparsingerror=function(C){_=C},v.onflush=function(){if(_){s(_);return}l(o)},p.forEach(function(C){if(O)if(x(C,"X-TIMESTAMP-MAP=")){O=!1,C.slice(16).split(",").forEach(function(P){x(P,"LOCAL:")?g=P.slice(6):x(P,"MPEGTS:")&&(h=parseInt(P.slice(7)))});try{b=A(g)/1e3}catch(P){_=P}return}else C===""&&(O=!1);v.parse(C+`
|
|
29
|
-
`)}),v.flush()}},"./src/utils/xhr-loader.ts":function(r,t,e){"use strict";e.r(t);var a=e("./src/utils/logger.ts"),n=e("./src/loader/load-stats.ts"),u=/^age:\s*[\d.]+\s*$/m,M=function(){function y(x){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=x?x.xhrSetup:null,this.stats=new n.LoadStats,this.retryDelay=0}var I=y.prototype;return I.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},I.abortInternal=function(){var A=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),A&&(A.onreadystatechange=null,A.onprogress=null,A.readyState!==4&&(this.stats.aborted=!0,A.abort()))},I.abort=function(){var A;this.abortInternal(),(A=this.callbacks)!==null&&A!==void 0&&A.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},I.load=function(A,D,R){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=A,this.config=D,this.callbacks=R,this.retryDelay=D.retryDelay,this.loadInternal()},I.loadInternal=function(){var A=this.config,D=this.context;if(!!A){var R=this.loader=new self.XMLHttpRequest,L=this.stats;L.loading.first=0,L.loaded=0;var T=this.xhrSetup;try{if(T)try{T(R,D.url)}catch{R.open("GET",D.url,!0),T(R,D.url)}R.readyState||R.open("GET",D.url,!0);var S=this.context.headers;if(S)for(var c in S)R.setRequestHeader(c,S[c])}catch(i){this.callbacks.onError({code:R.status,text:i.message},D,R);return}D.rangeEnd&&R.setRequestHeader("Range","bytes="+D.rangeStart+"-"+(D.rangeEnd-1)),R.onreadystatechange=this.readystatechange.bind(this),R.onprogress=this.loadprogress.bind(this),R.responseType=D.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),A.timeout),R.send()}},I.readystatechange=function(){var A=this.context,D=this.loader,R=this.stats;if(!(!A||!D)){var L=D.readyState,T=this.config;if(!R.aborted&&L>=2)if(self.clearTimeout(this.requestTimeout),R.loading.first===0&&(R.loading.first=Math.max(self.performance.now(),R.loading.start)),L===4){D.onreadystatechange=null,D.onprogress=null;var S=D.status;if(S>=200&&S<300){R.loading.end=Math.max(self.performance.now(),R.loading.first);var c,i;if(A.responseType==="arraybuffer"?(c=D.response,i=c.byteLength):(c=D.responseText,i=c.length),R.loaded=R.total=i,!this.callbacks)return;var f=this.callbacks.onProgress;if(f&&f(R,A,c,D),!this.callbacks)return;var m={url:D.responseURL,data:c};this.callbacks.onSuccess(m,R,A,D)}else R.retry>=T.maxRetry||S>=400&&S<499?(a.logger.error(S+" while loading "+A.url),this.callbacks.onError({code:S,text:D.statusText},A,D)):(a.logger.warn(S+" while loading "+A.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,T.maxRetryDelay),R.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),T.timeout)}},I.loadtimeout=function(){a.logger.warn("timeout while loading "+this.context.url);var A=this.callbacks;A&&(this.abortInternal(),A.onTimeout(this.stats,this.context,this.loader))},I.loadprogress=function(A){var D=this.stats;D.loaded=A.loaded,A.lengthComputable&&(D.total=A.total)},I.getCacheAge=function(){var A=null;if(this.loader&&u.test(this.loader.getAllResponseHeaders())){var D=this.loader.getResponseHeader("age");A=D?parseFloat(D):null}return A},y}();t.default=M}}).default})});var rr=class{addEventListener(){}removeEventListener(){}dispatchEvent(t){return!0}};if(typeof DocumentFragment=="undefined"){class r extends rr{}globalThis.DocumentFragment=r}var Or=class extends rr{},En=class extends rr{},ru={get(r){},define(r,t,e){},upgrade(r){},whenDefined(r){return Promise.resolve(Or)}},Cr,yn=class{constructor(t,e={}){Le(this,Cr,void 0);qe(this,Cr,e==null?void 0:e.detail)}get detail(){return ge(this,Cr)}initCustomEvent(){}};Cr=new WeakMap;function iu(r,t){return new Or}var Ya={document:{createElement:iu},DocumentFragment,customElements:ru,CustomEvent:yn,EventTarget:rr,HTMLElement:Or,HTMLVideoElement:En},za=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Pe=za?Ya:globalThis,ot=za?Ya.document:globalThis.document;var oe={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_CAPTIONS_REQUEST:"mediashowcaptionsrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_CAPTIONS_REQUEST:"mediadisablecaptionsrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},Pr={MEDIA_AIRPLAY_UNAVAILABLE:"mediaairplayunavailablechange",MEDIA_PIP_UNAVAILABLE:"mediapipunavailablechange",MEDIA_PAUSED:"mediapausedchange",MEDIA_HAS_PLAYED:"mediahasplayedchange",MEDIA_MUTED:"mediamutedchange",MEDIA_VOLUME_LEVEL:"mediavolumelevelchange",MEDIA_VOLUME:"mediavolumechange",MEDIA_VOLUME_UNAVAILABLE:"mediavolumeunavailablechange",MEDIA_IS_PIP:"mediaispipchange",MEDIA_IS_CASTING:"mediaiscastingchange",MEDIA_CAPTIONS_LIST:"mediacaptionslistchange",MEDIA_SUBTITLES_LIST:"mediasubtitleslistchange",MEDIA_CAPTIONS_SHOWING:"mediacaptionsshowingchange",MEDIA_SUBTITLES_SHOWING:"mediasubtitlesshowingchange",MEDIA_IS_FULLSCREEN:"mediaisfullscreenchange",MEDIA_PLAYBACK_RATE:"mediaplaybackratechange",MEDIA_CURRENT_TIME:"mediacurrenttimechange",MEDIA_DURATION:"mediadurationchange",MEDIA_SEEKABLE:"mediaseekablechange",MEDIA_PREVIEW_IMAGE:"mediapreviewimagechange",MEDIA_PREVIEW_COORDS:"mediapreviewcoordschange",MEDIA_LOADING:"medialoadingchange",USER_INACTIVE:"userinactivechange"},K={MEDIA_AIRPLAY_UNAVAILABLE:"media-airplay-unavailable",MEDIA_FULLSCREEN_UNAVAILABLE:"media-fullscreen-unavailable",MEDIA_PIP_UNAVAILABLE:"media-pip-unavailable",MEDIA_CAST_UNAVAILABLE:"media-cast-unavailable",MEDIA_PAUSED:"media-paused",MEDIA_HAS_PLAYED:"media-has-played",MEDIA_MUTED:"media-muted",MEDIA_VOLUME_LEVEL:"media-volume-level",MEDIA_VOLUME:"media-volume",MEDIA_VOLUME_UNAVAILABLE:"media-volume-unavailable",MEDIA_IS_PIP:"media-is-pip",MEDIA_IS_CASTING:"media-is-casting",MEDIA_CAPTIONS_LIST:"media-captions-list",MEDIA_SUBTITLES_LIST:"media-subtitles-list",MEDIA_CAPTIONS_SHOWING:"media-captions-showing",MEDIA_SUBTITLES_SHOWING:"media-subtitles-showing",MEDIA_IS_FULLSCREEN:"media-is-fullscreen",MEDIA_PLAYBACK_RATE:"media-playback-rate",MEDIA_CURRENT_TIME:"media-current-time",MEDIA_DURATION:"media-duration",MEDIA_SEEKABLE:"media-seekable",MEDIA_PREVIEW_TIME:"media-preview-time",MEDIA_PREVIEW_IMAGE:"media-preview-image",MEDIA_PREVIEW_COORDS:"media-preview-coords",MEDIA_CHROME_ATTRIBUTES:"media-chrome-attributes",MEDIA_CONTROLLER:"media-controller",MEDIA_LOADING:"media-loading",MEDIA_BUFFERED:"media-buffered"},zc=Object.entries(Pr).reduce((r,[t,e])=>{let a=K[t];return a&&(r[e]=a),r},{userinactivechange:"user-inactive"}),Xa=Object.entries(K).reduce((r,[t,e])=>{let a=Pr[t];return a&&(r[e]=a),r},{"user-inactive":"userinactivechange"}),ir={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Nt={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Tn={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},lt={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"};var Ze={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:r=1}={})=>`current playback rate ${r}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading"},Be={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",AIRPLAY:()=>"air play",ENTER_CAST:()=>"start casting",EXIT_CAST:()=>"stop casting",ENTER_FULLSCREEN:()=>"enter fullscreen mode",EXIT_FULLSCREEN:()=>"exit fullscreen mode",ENTER_PIP:()=>"enter picture in picture mode",EXIT_PIP:()=>"exit picture in picture mode",SEEK_FORWARD_N_SECS:({seekOffset:r=30}={})=>`seek forward ${r} seconds`,SEEK_BACK_N_SECS:({seekOffset:r=30}={})=>`seek back ${r} seconds`},au={...Ze,...Be};var su=r=>typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r),Qa=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],ou=(r,t)=>{let e=r===1?Qa[t].singular:Qa[t].plural;return`${r} ${e}`},Ft=r=>{if(!su(r))return"";let t=Math.abs(r),e=t!==r,a=new Date(0,0,0,0,0,t,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((y,I)=>y&&ou(y,I)).filter(y=>y).join(", ")}${e?" remaining":""}`};function ct(r,t){let e=!1;r<0&&(e=!0,r=0-r),r=r<0?0:r;let a=Math.floor(r%60),n=Math.floor(r/60%60),u=Math.floor(r/3600),M=Math.floor(t/60%60),y=Math.floor(t/3600);return(isNaN(r)||r===1/0)&&(u=n=a="-"),u=u>0||y>0?u+":":"",n=((u||M>=10)&&n<10?"0"+n:n)+":",a=a<10?"0"+a:a,(e?"-":"")+u+n+a}var Za={HTMLElement:function(){this.addEventListener=()=>{},this.removeEventListener=()=>{},this.dispatchEvent=()=>{}},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){}},uu={createElement:function(){return new Za.HTMLElement}},Ja=typeof window=="undefined"||typeof window.customElements=="undefined",ee=Ja?Za:window,X=Ja?uu:window.document;function le(r,t){ee.customElements.get(r)||(ee.customElements.define(r,t),ee[t.name]=t)}var du=(r,t,e)=>{if(!t.has(r))throw TypeError("Cannot "+e)},nr=(r,t,e)=>(du(r,t,"read from private field"),e?e.call(r):t.get(r)),bn=(r,t,e)=>{if(t.has(r))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(r):t.set(r,e)},mi,kr,An,qa=X.createElement("template");qa.innerHTML=`
|
|
29
|
+
`)}),v.flush()}},"./src/utils/xhr-loader.ts":function(r,t,e){"use strict";e.r(t);var a=e("./src/utils/logger.ts"),n=e("./src/loader/load-stats.ts"),u=/^age:\s*[\d.]+\s*$/m,M=function(){function y(x){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=x?x.xhrSetup:null,this.stats=new n.LoadStats,this.retryDelay=0}var I=y.prototype;return I.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},I.abortInternal=function(){var A=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),A&&(A.onreadystatechange=null,A.onprogress=null,A.readyState!==4&&(this.stats.aborted=!0,A.abort()))},I.abort=function(){var A;this.abortInternal(),(A=this.callbacks)!==null&&A!==void 0&&A.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},I.load=function(A,D,R){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=A,this.config=D,this.callbacks=R,this.retryDelay=D.retryDelay,this.loadInternal()},I.loadInternal=function(){var A=this.config,D=this.context;if(!!A){var R=this.loader=new self.XMLHttpRequest,L=this.stats;L.loading.first=0,L.loaded=0;var T=this.xhrSetup;try{if(T)try{T(R,D.url)}catch{R.open("GET",D.url,!0),T(R,D.url)}R.readyState||R.open("GET",D.url,!0);var S=this.context.headers;if(S)for(var c in S)R.setRequestHeader(c,S[c])}catch(i){this.callbacks.onError({code:R.status,text:i.message},D,R);return}D.rangeEnd&&R.setRequestHeader("Range","bytes="+D.rangeStart+"-"+(D.rangeEnd-1)),R.onreadystatechange=this.readystatechange.bind(this),R.onprogress=this.loadprogress.bind(this),R.responseType=D.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),A.timeout),R.send()}},I.readystatechange=function(){var A=this.context,D=this.loader,R=this.stats;if(!(!A||!D)){var L=D.readyState,T=this.config;if(!R.aborted&&L>=2)if(self.clearTimeout(this.requestTimeout),R.loading.first===0&&(R.loading.first=Math.max(self.performance.now(),R.loading.start)),L===4){D.onreadystatechange=null,D.onprogress=null;var S=D.status;if(S>=200&&S<300){R.loading.end=Math.max(self.performance.now(),R.loading.first);var c,i;if(A.responseType==="arraybuffer"?(c=D.response,i=c.byteLength):(c=D.responseText,i=c.length),R.loaded=R.total=i,!this.callbacks)return;var f=this.callbacks.onProgress;if(f&&f(R,A,c,D),!this.callbacks)return;var m={url:D.responseURL,data:c};this.callbacks.onSuccess(m,R,A,D)}else R.retry>=T.maxRetry||S>=400&&S<499?(a.logger.error(S+" while loading "+A.url),this.callbacks.onError({code:S,text:D.statusText},A,D)):(a.logger.warn(S+" while loading "+A.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,T.maxRetryDelay),R.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),T.timeout)}},I.loadtimeout=function(){a.logger.warn("timeout while loading "+this.context.url);var A=this.callbacks;A&&(this.abortInternal(),A.onTimeout(this.stats,this.context,this.loader))},I.loadprogress=function(A){var D=this.stats;D.loaded=A.loaded,A.lengthComputable&&(D.total=A.total)},I.getCacheAge=function(){var A=null;if(this.loader&&u.test(this.loader.getAllResponseHeaders())){var D=this.loader.getResponseHeader("age");A=D?parseFloat(D):null}return A},y}();t.default=M}}).default})});var ir=class{addEventListener(){}removeEventListener(){}dispatchEvent(t){return!0}};if(typeof DocumentFragment=="undefined"){class r extends ir{}globalThis.DocumentFragment=r}var Cr=class extends ir{},En=class extends ir{},iu={get(r){},define(r,t,e){},upgrade(r){},whenDefined(r){return Promise.resolve(Cr)}},Pr,yn=class{constructor(t,e={}){Le(this,Pr,void 0);qe(this,Pr,e==null?void 0:e.detail)}get detail(){return ge(this,Pr)}initCustomEvent(){}};Pr=new WeakMap;function nu(r,t){return new Cr}var za={document:{createElement:nu},DocumentFragment,customElements:iu,CustomEvent:yn,EventTarget:ir,HTMLElement:Cr,HTMLVideoElement:En},Xa=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Pe=Xa?za:globalThis,ot=Xa?za.document:globalThis.document;var oe={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_CAPTIONS_REQUEST:"mediashowcaptionsrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_CAPTIONS_REQUEST:"mediadisablecaptionsrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},kr={MEDIA_AIRPLAY_UNAVAILABLE:"mediaairplayunavailablechange",MEDIA_PIP_UNAVAILABLE:"mediapipunavailablechange",MEDIA_PAUSED:"mediapausedchange",MEDIA_HAS_PLAYED:"mediahasplayedchange",MEDIA_MUTED:"mediamutedchange",MEDIA_VOLUME_LEVEL:"mediavolumelevelchange",MEDIA_VOLUME:"mediavolumechange",MEDIA_VOLUME_UNAVAILABLE:"mediavolumeunavailablechange",MEDIA_IS_PIP:"mediaispipchange",MEDIA_IS_CASTING:"mediaiscastingchange",MEDIA_CAPTIONS_LIST:"mediacaptionslistchange",MEDIA_SUBTITLES_LIST:"mediasubtitleslistchange",MEDIA_CAPTIONS_SHOWING:"mediacaptionsshowingchange",MEDIA_SUBTITLES_SHOWING:"mediasubtitlesshowingchange",MEDIA_IS_FULLSCREEN:"mediaisfullscreenchange",MEDIA_PLAYBACK_RATE:"mediaplaybackratechange",MEDIA_CURRENT_TIME:"mediacurrenttimechange",MEDIA_DURATION:"mediadurationchange",MEDIA_SEEKABLE:"mediaseekablechange",MEDIA_PREVIEW_IMAGE:"mediapreviewimagechange",MEDIA_PREVIEW_COORDS:"mediapreviewcoordschange",MEDIA_LOADING:"medialoadingchange",USER_INACTIVE:"userinactivechange"},K={MEDIA_AIRPLAY_UNAVAILABLE:"media-airplay-unavailable",MEDIA_FULLSCREEN_UNAVAILABLE:"media-fullscreen-unavailable",MEDIA_PIP_UNAVAILABLE:"media-pip-unavailable",MEDIA_CAST_UNAVAILABLE:"media-cast-unavailable",MEDIA_PAUSED:"media-paused",MEDIA_HAS_PLAYED:"media-has-played",MEDIA_MUTED:"media-muted",MEDIA_VOLUME_LEVEL:"media-volume-level",MEDIA_VOLUME:"media-volume",MEDIA_VOLUME_UNAVAILABLE:"media-volume-unavailable",MEDIA_IS_PIP:"media-is-pip",MEDIA_IS_CASTING:"media-is-casting",MEDIA_CAPTIONS_LIST:"media-captions-list",MEDIA_SUBTITLES_LIST:"media-subtitles-list",MEDIA_CAPTIONS_SHOWING:"media-captions-showing",MEDIA_SUBTITLES_SHOWING:"media-subtitles-showing",MEDIA_IS_FULLSCREEN:"media-is-fullscreen",MEDIA_PLAYBACK_RATE:"media-playback-rate",MEDIA_CURRENT_TIME:"media-current-time",MEDIA_DURATION:"media-duration",MEDIA_SEEKABLE:"media-seekable",MEDIA_PREVIEW_TIME:"media-preview-time",MEDIA_PREVIEW_IMAGE:"media-preview-image",MEDIA_PREVIEW_COORDS:"media-preview-coords",MEDIA_CHROME_ATTRIBUTES:"media-chrome-attributes",MEDIA_CONTROLLER:"media-controller",MEDIA_LOADING:"media-loading",MEDIA_BUFFERED:"media-buffered"},Qc=Object.entries(kr).reduce((r,[t,e])=>{let a=K[t];return a&&(r[e]=a),r},{userinactivechange:"user-inactive"}),Qa=Object.entries(K).reduce((r,[t,e])=>{let a=kr[t];return a&&(r[e]=a),r},{"user-inactive":"userinactivechange"}),nr={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Nt={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Tn={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},lt={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"};var Ze={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:r=1}={})=>`current playback rate ${r}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading"},Be={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",AIRPLAY:()=>"air play",ENTER_CAST:()=>"start casting",EXIT_CAST:()=>"stop casting",ENTER_FULLSCREEN:()=>"enter fullscreen mode",EXIT_FULLSCREEN:()=>"exit fullscreen mode",ENTER_PIP:()=>"enter picture in picture mode",EXIT_PIP:()=>"exit picture in picture mode",SEEK_FORWARD_N_SECS:({seekOffset:r=30}={})=>`seek forward ${r} seconds`,SEEK_BACK_N_SECS:({seekOffset:r=30}={})=>`seek back ${r} seconds`},su={...Ze,...Be};var ou=r=>typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r),Za=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],lu=(r,t)=>{let e=r===1?Za[t].singular:Za[t].plural;return`${r} ${e}`},Ft=r=>{if(!ou(r))return"";let t=Math.abs(r),e=t!==r,a=new Date(0,0,0,0,0,t,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((y,I)=>y&&lu(y,I)).filter(y=>y).join(", ")}${e?" remaining":""}`};function ct(r,t){let e=!1;r<0&&(e=!0,r=0-r),r=r<0?0:r;let a=Math.floor(r%60),n=Math.floor(r/60%60),u=Math.floor(r/3600),M=Math.floor(t/60%60),y=Math.floor(t/3600);return(isNaN(r)||r===1/0)&&(u=n=a="-"),u=u>0||y>0?u+":":"",n=((u||M>=10)&&n<10?"0"+n:n)+":",a=a<10?"0"+a:a,(e?"-":"")+u+n+a}var Ja={HTMLElement:function(){this.addEventListener=()=>{},this.removeEventListener=()=>{},this.dispatchEvent=()=>{}},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){}},du={createElement:function(){return new Ja.HTMLElement}},qa=typeof window=="undefined"||typeof window.customElements=="undefined",ee=qa?Ja:window,X=qa?du:window.document;function le(r,t){ee.customElements.get(r)||(ee.customElements.define(r,t),ee[t.name]=t)}var cu=(r,t,e)=>{if(!t.has(r))throw TypeError("Cannot "+e)},Bt=(r,t,e)=>(cu(r,t,"read from private field"),e?e.call(r):t.get(r)),bn=(r,t,e)=>{if(t.has(r))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(r):t.set(r,e)},mi,ar,An,es=X.createElement("template");es.innerHTML=`
|
|
30
30
|
<style>
|
|
31
31
|
:host {
|
|
32
32
|
display: inline-flex;
|
|
@@ -78,12 +78,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
78
78
|
min-width: 100%;
|
|
79
79
|
}
|
|
80
80
|
</style>
|
|
81
|
-
`;var gi=class extends ee.HTMLElement{constructor(t={}){super(),bn(this,mi,u=>{this.handleClick(u)}),bn(this,
|
|
81
|
+
`;var gi=class extends ee.HTMLElement{constructor(t={}){super(),bn(this,mi,u=>{this.handleClick(u)}),bn(this,ar,u=>{let{key:M}=u;if(!this.keysUsed.includes(M)){this.removeEventListener("keyup",Bt(this,ar));return}this.handleClick(u)}),bn(this,An,u=>{let{metaKey:M,altKey:y,key:I}=u;if(M||y||!this.keysUsed.includes(I)){this.removeEventListener("keyup",Bt(this,ar));return}this.addEventListener("keyup",Bt(this,ar),{once:!0})});let e=this.attachShadow({mode:"open"}),a=es.content.cloneNode(!0);this.nativeEl=a;let n=t.slotTemplate;n||(n=X.createElement("template"),n.innerHTML=`<slot>${t.defaultContent||""}</slot>`),this.nativeEl.appendChild(n.content.cloneNode(!0)),e.appendChild(a),this.enable()}static get observedAttributes(){return["disabled",K.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",Bt(this,mi)),this.addEventListener("keydown",Bt(this,An)),this.setAttribute("tabindex",0)}disable(){this.removeEventListener("click",Bt(this,mi)),this.removeEventListener("keyup",Bt(this,ar)),this.removeAttribute("tabindex")}attributeChangedCallback(t,e,a){var n,u;if(t===K.MEDIA_CONTROLLER){if(e){let M=X.getElementById(e);(n=M==null?void 0:M.unassociateElement)==null||n.call(M,this)}if(a){let M=X.getElementById(a);(u=M==null?void 0:M.associateElement)==null||u.call(M,this)}}else t==="disabled"&&a!==e&&(a==null?this.enable():this.disable())}connectedCallback(){var t;this.setAttribute("role","button");let e=this.getAttribute(K.MEDIA_CONTROLLER);if(e){let a=X.getElementById(e);(t=a==null?void 0:a.associateElement)==null||t.call(a,this)}}disconnectedCallback(){var t;let e=this.getAttribute(K.MEDIA_CONTROLLER);if(e){let a=X.getElementById(e);(t=a==null?void 0:a.unassociateElement)==null||t.call(a,this)}}get keysUsed(){return["Enter"," "]}handleClick(){}};mi=new WeakMap;ar=new WeakMap;An=new WeakMap;le("media-chrome-button",gi);var He=gi;var fu=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
82
82
|
<path d="M22.13 3H3.87a.87.87 0 0 0-.87.87v13.26a.87.87 0 0 0 .87.87h3.4L9 16H5V5h16v11h-4l1.72 2h3.4a.87.87 0 0 0 .87-.87V3.87a.87.87 0 0 0-.86-.87Zm-8.75 11.44a.5.5 0 0 0-.76 0l-4.91 5.73a.5.5 0 0 0 .38.83h9.82a.501.501 0 0 0 .38-.83l-4.91-5.73Z"/>
|
|
83
83
|
</svg>
|
|
84
|
-
`,
|
|
85
|
-
<slot name="airplay">${
|
|
86
|
-
`;var _n=class extends He{static get observedAttributes(){return[...super.observedAttributes,K.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(t={}){super({slotTemplate:
|
|
84
|
+
`,ts=X.createElement("template");ts.innerHTML=`
|
|
85
|
+
<slot name="airplay">${fu}</slot>
|
|
86
|
+
`;var _n=class extends He{static get observedAttributes(){return[...super.observedAttributes,K.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(t={}){super({slotTemplate:ts,...t})}connectedCallback(){this.setAttribute("aria-label",Be.AIRPLAY()),super.connectedCallback()}handleClick(t){let e=new ee.CustomEvent(oe.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};le("media-airplay-button",_n);var hu='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/></g></svg>',vu='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/><path class="cast_caf_icon_boxfill" d="M5,7 L5,8.63 C8,8.6 13.37,14 13.37,17 L19,17 L19,7 Z"/></g></svg>',is=X.createElement("template");is.innerHTML=`
|
|
87
87
|
<style>
|
|
88
88
|
:host([${K.MEDIA_IS_CASTING}]) slot:not([name=exit]) > *,
|
|
89
89
|
:host([${K.MEDIA_IS_CASTING}]) ::slotted(:not([slot=exit])) {
|
|
@@ -97,16 +97,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
97
97
|
}
|
|
98
98
|
</style>
|
|
99
99
|
|
|
100
|
-
<slot name="enter">${
|
|
101
|
-
<slot name="exit">${
|
|
102
|
-
`;var
|
|
100
|
+
<slot name="enter">${hu}</slot>
|
|
101
|
+
<slot name="exit">${vu}</slot>
|
|
102
|
+
`;var rs=r=>{let e=r.getAttribute(K.MEDIA_IS_CASTING)!=null?Be.EXIT_CAST():Be.ENTER_CAST();r.setAttribute("aria-label",e)},Sn=class extends He{static get observedAttributes(){return[...super.observedAttributes,K.MEDIA_IS_CASTING,K.MEDIA_CAST_UNAVAILABLE]}constructor(t={}){super({slotTemplate:is,...t})}connectedCallback(){rs(this),super.connectedCallback()}attributeChangedCallback(t,e,a){t===K.MEDIA_IS_CASTING&&rs(this),super.attributeChangedCallback(t,e,a)}handleClick(t){let e=this.getAttribute(K.MEDIA_IS_CASTING)!=null?oe.MEDIA_EXIT_CAST_REQUEST:oe.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new ee.CustomEvent(e,{composed:!0,bubbles:!0}))}};le("media-cast-button",Sn);var pi=(r,t,e=".value")=>{let a=r.querySelector(e);!a||(a.textContent=t)},mu=(r,t)=>{let e=`slot[name="${t}"]`,a=r.shadowRoot.querySelector(e);return a?a.children:[]},Ei=(r,t)=>mu(r,t)[0],wr=(r,t)=>!r||!t?!1:r.contains(t)?!0:wr(r,t.getRootNode().host),xn=(r,t)=>{if(!r)return null;let e=r.closest(t);return e||xn(r.getRootNode().host,t)};function Tt(r,t){var e,a;let n;for(n of r.querySelectorAll("style"))for(let u of(a=(e=n.sheet)==null?void 0:e.cssRules)!=null?a:[])if(u.selectorText===t)return u;return n!=null&&n.sheet?(n.sheet.insertRule(`${t}{}`,n.sheet.cssRules.length),n.sheet.cssRules[n.sheet.cssRules.length-1]):{style:{setProperty:()=>{}}}}var as=X.createElement("template");as.innerHTML=`
|
|
103
103
|
<style>
|
|
104
104
|
:host {
|
|
105
105
|
display: inline-block;
|
|
106
106
|
box-sizing: border-box;
|
|
107
107
|
}
|
|
108
108
|
</style>
|
|
109
|
-
`;var Ln=class extends ee.HTMLElement{static get observedAttributes(){return[K.MEDIA_CONTROLLER,K.MEDIA_PAUSED]}constructor(t={}){super();let e=this.attachShadow({mode:"open"}),a=
|
|
109
|
+
`;var Ln=class extends ee.HTMLElement{static get observedAttributes(){return[K.MEDIA_CONTROLLER,K.MEDIA_PAUSED]}constructor(t={}){super();let e=this.attachShadow({mode:"open"}),a=as.content.cloneNode(!0);this.nativeEl=a;let n=t.slotTemplate;n||(n=X.createElement("template"),n.innerHTML=`<slot>${t.defaultContent||""}</slot>`),this.nativeEl.appendChild(n.content.cloneNode(!0)),e.appendChild(a)}attributeChangedCallback(t,e,a){var n,u;if(t===K.MEDIA_CONTROLLER){if(e){let M=X.getElementById(e);(n=M==null?void 0:M.unassociateElement)==null||n.call(M,this)}if(a){let M=X.getElementById(a);(u=M==null?void 0:M.associateElement)==null||u.call(M,this)}}}connectedCallback(){var t;this.setAttribute("tabindex",-1),this.setAttribute("aria-hidden",!0);let e=ns(this);this.getAttribute(K.MEDIA_CONTROLLER)&&((t=e==null?void 0:e.associateElement)==null||t.call(e,this)),e==null||e.addEventListener("pointerdown",this),e==null||e.addEventListener("click",this)}disconnectedCallback(){var t;let e=ns(this);this.getAttribute(K.MEDIA_CONTROLLER)&&((t=e==null?void 0:e.unassociateElement)==null||t.call(e,this)),e==null||e.removeEventListener("pointerdown",this),e==null||e.removeEventListener("click",this)}handleEvent(t){var e;let a=(e=t.composedPath())==null?void 0:e[0];if(!!["video","media-controller"].includes(a==null?void 0:a.localName)){if(t.type==="pointerdown")this._pointerType=t.pointerType;else if(t.type==="click"){let{clientX:u,clientY:M}=t,{left:y,top:I,width:x,height:A}=this.getBoundingClientRect(),D=u-y,R=M-I;if(D<0||R<0||D>x||R>A||x===0&&A===0)return;let{pointerType:L=this._pointerType}=t;if(this._pointerType=void 0,L===Tn.TOUCH){this.handleTap(t);return}else if(L===Tn.MOUSE){this.handleMouseClick(t);return}}}}handleTap(){}handleMouseClick(){let t=this.getAttribute(K.MEDIA_PAUSED)!=null?oe.MEDIA_PLAY_REQUEST:oe.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new ee.CustomEvent(t,{composed:!0,bubbles:!0}))}};function ns(r){let t=r.getAttribute(K.MEDIA_CONTROLLER);return t?X.getElementById(t):xn(r,"media-controller")}le("media-gesture-receiver",Ln);var ss=X.createElement("template");ss.innerHTML=`
|
|
110
110
|
<style>
|
|
111
111
|
|
|
112
112
|
:host([media-is-fullscreen]) ::slotted([slot=media]) {
|
|
@@ -217,7 +217,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
217
217
|
|
|
218
218
|
<slot part="bottom chrome"></slot>
|
|
219
219
|
</span>
|
|
220
|
-
`;var mu=Object.values(K),yi=class extends ee.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(as.content.cloneNode(!0));let t=u=>{let M=this.media;for(let y of u)y.type==="childList"&&(y.removedNodes.forEach(I=>{if(I.slot=="media"&&y.target==this){let x=y.previousSibling&&y.previousSibling.previousElementSibling;if(!x||!M)this.mediaUnsetCallback(I);else{let A=x.slot!=="media";for(;(x=x.previousSibling)!==null;)x.slot=="media"&&(A=!1);A&&this.mediaUnsetCallback(I)}}}),M&&y.addedNodes.forEach(I=>{I==M&&this.handleMediaUpdated(M).then(x=>this.mediaSetCallback(x))}))};new MutationObserver(t).observe(this,{childList:!0,subtree:!0});let a=this.media,n=this.querySelector(":scope > slot[slot=media]");n&&n.addEventListener("slotchange",()=>{if(!n.assignedElements({flatten:!0}).length){this.mediaUnsetCallback(a);return}this.media&&(a=this.media,this.handleMediaUpdated(this.media).then(M=>this.mediaSetCallback(M)))})}static get observedAttributes(){return["autohide","gestures-disabled"].concat(mu)}attributeChangedCallback(t,e,a){t.toLowerCase()=="autohide"&&(this.autohide=a)}get media(){let t=this.querySelector(":scope > [slot=media]");return(t==null?void 0:t.nodeName)=="SLOT"&&(t=t.assignedElements({flatten:!0})[0]),t}mediaSetCallback(t){this._mediaClickPlayToggle=()=>{let e=t.paused?oe.MEDIA_PLAY_REQUEST:oe.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new ee.CustomEvent(e,{composed:!0,bubbles:!0}))}}handleMediaUpdated(t){let e=u=>Promise.resolve(u),a=u=>(console.error('<media-chrome>: Media element set with slot="media" does not appear to be compatible.',u),Promise.reject(u));if(!t)return a(t);let n=t.nodeName.toLowerCase();return n.includes("-")?ee.customElements.whenDefined(n).then(()=>e(t)):e(t)}mediaUnsetCallback(){}connectedCallback(){let e=this.getAttribute("audio")!=null?Ze.AUDIO_PLAYER():Ze.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",e),this.media&&this.handleMediaUpdated(this.media).then(M=>this.mediaSetCallback(M)),this.setAttribute("user-inactive","user-inactive");let a=()=>{if(this.autohide<0)return;this.setAttribute("user-inactive","user-inactive");let M=new ee.CustomEvent(Pr.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(M)},n=()=>{this.removeAttribute("user-inactive");let M=new ee.CustomEvent(Pr.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(M)},u=()=>{n(),ee.clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=ee.setTimeout(()=>{a()},this.autohide*1e3))};this.addEventListener("keyup",()=>{u()}),this.addEventListener("pointerup",M=>{M.pointerType==="touch"&&([this,this.media].includes(M.target)&&!this.hasAttribute("user-inactive")?a():u())}),this.addEventListener("pointermove",M=>{M.pointerType==="mouse"&&M.target!==this&&(n(),ee.clearTimeout(this._inactiveTimeout),[this,this.media].includes(M.target)&&u())}),this.addEventListener("mouseleave",()=>{a()}),this.addEventListener("keyup",()=>{this.setAttribute("media-keyboard-control","")}),this.addEventListener("mouseup",()=>{this.removeAttribute("media-keyboard-control")})}set autohide(t){t=Number(t),this._autohide=isNaN(t)?0:t}get autohide(){return this._autohide===void 0?2:this._autohide}};le("media-container-temp",yi);var ss=yi;var os=(r,t,e)=>{if(!t.has(r))throw TypeError("Cannot "+e)},Xe=(r,t,e)=>(os(r,t,"read from private field"),e?e.call(r):t.get(r)),Dn=(r,t,e)=>{if(t.has(r))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(r):t.set(r,e)},In=(r,t,e,a)=>(os(r,t,"write to private field"),a?a.call(r,e):t.set(r,e),e),ar,sr,it,Ti=class{constructor(t,e){Dn(this,ar,void 0),Dn(this,sr,void 0),Dn(this,it,[]),In(this,ar,t),In(this,sr,e)}[Symbol.iterator](){return Xe(this,it).values()}get length(){return Xe(this,it).length}get value(){var t;return(t=Xe(this,it).join(" "))!=null?t:""}set value(t){var e;t!==this.value&&(In(this,it,[]),this.add(...(e=t==null?void 0:t.split(" "))!=null?e:[]))}toString(){return this.value}item(t){return Xe(this,it)[t]}values(){return Xe(this,it).values()}keys(){return Xe(this,it).keys()}forEach(t){Xe(this,it).forEach(t)}add(...t){var e,a;t.forEach(n=>{this.contains(n)||Xe(this,it).push(n)}),!(this.value===""&&!((e=Xe(this,ar))!=null&&e.hasAttribute(`${Xe(this,sr)}`)))&&((a=Xe(this,ar))==null||a.setAttribute(`${Xe(this,sr)}`,`${this.value}`))}remove(...t){var e;t.forEach(a=>{Xe(this,it).splice(Xe(this,it).indexOf(a),1)}),(e=Xe(this,ar))==null||e.setAttribute(`${Xe(this,sr)}`,`${this.value}`)}contains(t){return Xe(this,it).includes(t)}toggle(t,e){return typeof e!="undefined"?e?(this.add(t),!0):(this.remove(t),!1):this.contains(t)?(this.remove(t),!1):(this.add(t),!0)}replace(t,e){this.remove(t),this.add(e)}};ar=new WeakMap;sr=new WeakMap;it=new WeakMap;var Ge={enter:"requestFullscreen",exit:"exitFullscreen",event:"fullscreenchange",element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};X.fullscreenElement===void 0&&(Ge.enter="webkitRequestFullScreen",Ge.exit=X.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",Ge.event="webkitfullscreenchange",Ge.element="webkitFullscreenElement",Ge.error="webkitfullscreenerror",Ge.enabled="webkitFullscreenEnabled");function bi(r,t=!1){return r.split("_").map(function(e,a){return(a||t?e[0].toUpperCase():e[0].toLowerCase())+e.slice(1).toLowerCase()}).join("")}var Mn=(r="")=>r.split(/\s+/),ls=(r="")=>{let[t,e]=r.split(":"),a=e?decodeURIComponent(e):void 0;return{language:t,label:a}},gu=(r="",t={})=>Mn(r).map(e=>{let a=ls(e);return{...t,...a}}),pu=r=>Array.isArray(r)?r.map(t=>typeof t=="string"?ls(t):t):typeof r=="string"?gu(r):[r],Eu=({label:r,language:t}={})=>r?`${t}:${encodeURIComponent(r)}`:t,ut=(r=[])=>Array.prototype.map.call(r,Eu).join(" "),yu=(r,t)=>e=>e[r]===t,us=r=>{let t=Object.entries(r).map(([e,a])=>yu(e,a));return e=>t.every(a=>a(e))},Ur=(r,t=[],e=[])=>{let a=pu(e).map(us),n=u=>a.some(M=>M(u));Array.from(t).filter(n).forEach(u=>{u.mode=r})},or=(r,t=()=>!0)=>{if(!(r!=null&&r.textTracks))return[];let e=typeof t=="function"?t:us(t);return Array.from(r.textTracks).filter(e)},Rn=r=>{let t=!!r.getAttribute(K.MEDIA_CAPTIONS_SHOWING),e=!r.hasAttribute("no-subtitles-fallback")&&!!r.getAttribute(K.MEDIA_SUBTITLES_SHOWING);return t||e},Ai=r=>{var t,e,a,n;if(Rn(r)){let M=r.getAttribute(K.MEDIA_CAPTIONS_SHOWING);if(M){let I=new window.CustomEvent(oe.MEDIA_DISABLE_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:M});r.dispatchEvent(I)}let y=r.getAttribute(K.MEDIA_SUBTITLES_SHOWING);if(y&&!r.hasAttribute("no-subtitles-fallback")){let I=new window.CustomEvent(oe.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:y});r.dispatchEvent(I)}}else{let[M]=(e=Mn((t=r.getAttribute(K.MEDIA_CAPTIONS_LIST))!=null?t:""))!=null?e:[];if(M){let y=new window.CustomEvent(oe.MEDIA_SHOW_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:M});r.dispatchEvent(y)}else if(r.hasAttribute("no-subtitles-fallback"))console.error("Attempting to enable closed captions but none are available! Please verify your media content if this is unexpected.");else{let[y]=(n=Mn((a=r.getAttribute(K.MEDIA_SUBTITLES_LIST))!=null?a:""))!=null?n:[];if(y){let I=new window.CustomEvent(oe.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:y});r.dispatchEvent(I)}}}};var fs=(r,t,e)=>{if(!t.has(r))throw TypeError("Cannot "+e)},lr=(r,t,e)=>(fs(r,t,"read from private field"),e?e.call(r):t.get(r)),On=(r,t,e)=>{if(t.has(r))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(r):t.set(r,e)},ur=(r,t,e)=>(fs(r,t,"access private method"),e),It,dr,Kr,Si,Pn,hs=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],Tu=10,Li=class extends ss{constructor(){super(),On(this,dr),On(this,Si),On(this,It,new Ti(this,"hotkeys")),Mu||(this._airplayUnavailable=lt.UNSUPPORTED),cs||(this._fullscreenUnavailable=lt.UNAVAILABLE),Ru||(this._castUnavailable=lt.UNSUPPORTED),Du||(this._pipUnavailable=lt.UNSUPPORTED),Br!==void 0?Br||(this._volumeUnavailable=lt.UNSUPPORTED):Iu.then(()=>{Br||(this._volumeUnavailable=lt.UNSUPPORTED,this.propagateMediaState(K.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associatedElements=[],this.associateElement(this);let t={MEDIA_PLAY_REQUEST:()=>this.media.play(),MEDIA_PAUSE_REQUEST:()=>this.media.pause(),MEDIA_MUTE_REQUEST:()=>this.media.muted=!0,MEDIA_UNMUTE_REQUEST:()=>{let e=this.media;e.muted=!1,e.volume===0&&(e.volume=.25)},MEDIA_VOLUME_REQUEST:e=>{let a=this.media,n=e.detail;a.volume=n,n>0&&a.muted&&(a.muted=!1);try{ee.localStorage.setItem("media-chrome-pref-volume",n.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:()=>{if(!cs){console.warn("Fullscreen support is unavailable; not entering fullscreen");return}let e=this.media;X.pictureInPictureElement&&X.exitPictureInPicture(),super[Ge.enter]?super[Ge.enter]():e.webkitEnterFullscreen?e.webkitEnterFullscreen():e.requestFullscreen?e.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{X[Ge.exit]()},MEDIA_ENTER_PIP_REQUEST:()=>{let e=this.media;if(!X.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!e.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}X[Ge.element]&&X[Ge.exit]();let a=n=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};e.requestPictureInPicture().catch(n=>{if(n.code===11)if(e.readyState===0&&e.preload==="none"){let u=function(){e.removeEventListener("loadedmetadata",M),e.preload="none"},M=function(){e.requestPictureInPicture().catch(a),u()};e.addEventListener("loadedmetadata",M),e.preload="metadata",setTimeout(()=>{e.readyState===0&&a(),u()},1e3)}else throw n;else throw n})},MEDIA_EXIT_PIP_REQUEST:()=>{X.pictureInPictureElement&&X.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:()=>{var e;let a=this.media;!((e=globalThis.CastableVideoElement)!=null&&e.castEnabled)||(X[Ge.element]&&X[Ge.exit](),a.requestCast())},MEDIA_EXIT_CAST_REQUEST:async()=>{var e;(e=globalThis.CastableVideoElement)!=null&&e.castElement&&globalThis.CastableVideoElement.exitCast()},MEDIA_SEEK_REQUEST:e=>{let a=this.media,n=e.detail;(a.readyState>0||a.readyState===void 0)&&(a.currentTime=n)},MEDIA_PLAYBACK_RATE_REQUEST:e=>{this.media.playbackRate=e.detail},MEDIA_PREVIEW_REQUEST:e=>{var a;let n=this.media;if(!n)return;let u=e.detail;u===null&&this.propagateMediaState(K.MEDIA_PREVIEW_TIME,void 0),this.propagateMediaState(K.MEDIA_PREVIEW_TIME,u);let[M]=or(n,{kind:ir.METADATA,label:"thumbnails"});if(!(M&&M.cues))return;if(u===null){this.propagateMediaState(K.MEDIA_PREVIEW_IMAGE,void 0),this.propagateMediaState(K.MEDIA_PREVIEW_COORDS,void 0);return}let y=Array.prototype.find.call(M.cues,D=>D.startTime>=u);if(!y)return;let I=/'^(?:[a-z]+:)?\/\//i.test(y.text)||(a=n.querySelector('track[label="thumbnails"]'))==null?void 0:a.src,x=new URL(y.text,I),A=new URLSearchParams(x.hash).get("#xywh");this.propagateMediaState(K.MEDIA_PREVIEW_IMAGE,x.href),this.propagateMediaState(K.MEDIA_PREVIEW_COORDS,A.split(",").join(" "))},MEDIA_SHOW_CAPTIONS_REQUEST:e=>{let a=xi(this),{detail:n=[]}=e;Ur(Nt.SHOWING,a,n)},MEDIA_DISABLE_CAPTIONS_REQUEST:e=>{let a=xi(this),{detail:n=[]}=e;Ur(Nt.DISABLED,a,n)},MEDIA_SHOW_SUBTITLES_REQUEST:e=>{let a=Fr(this),{detail:n=[]}=e;Ur(Nt.SHOWING,a,n)},MEDIA_DISABLE_SUBTITLES_REQUEST:e=>{let a=Fr(this),{detail:n=[]}=e;Ur(Nt.DISABLED,a,n)},MEDIA_AIRPLAY_REQUEST:()=>{let{media:e}=this;if(!!e){if(!(e.webkitShowPlaybackTargetPicker&&ee.WebKitPlaybackTargetAvailabilityEvent)){console.warn("received a request to select AirPlay but AirPlay is not supported in this environment");return}e.webkitShowPlaybackTargetPicker()}}};if(Object.keys(t).forEach(e=>{let a=`_handle${bi(e,!0)}`;this[a]=n=>{if(n.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}t[e](n,this.media)},this.addEventListener(oe[e],this[a])}),this._mediaStatePropagators={"play,pause,emptied":()=>{this.propagateMediaState(K.MEDIA_PAUSED,vs(this))},"playing,emptied":()=>{var e;this.propagateMediaState(K.MEDIA_HAS_PLAYED,!((e=this.media)!=null&&e.paused))},volumechange:()=>{this.propagateMediaState(K.MEDIA_MUTED,ms(this)),this.propagateMediaState(K.MEDIA_VOLUME,gs(this)),this.propagateMediaState(K.MEDIA_VOLUME_LEVEL,ps(this))},[Ge.event]:e=>{let n=!!X[Ge.element]&&(e==null?void 0:e.target),u=wr(this,n);this.propagateMediaState(K.MEDIA_IS_FULLSCREEN,u)},"enterpictureinpicture,leavepictureinpicture":e=>{var a;let n;if(e)n=e.type=="enterpictureinpicture";else{let u=(a=this.getRootNode().pictureInPictureElement)!=null?a:X.pictureInPictureElement;n=this.media&&wr(this.media,u)}this.propagateMediaState(K.MEDIA_IS_PIP,n)},"entercast,leavecast,castchange":e=>{var a;let n=(a=globalThis.CastableVideoElement)==null?void 0:a.castElement,u=this.media&&wr(this.media,n);(e==null?void 0:e.type)==="castchange"&&(e==null?void 0:e.detail)==="CONNECTING"&&(u="connecting"),this.propagateMediaState(K.MEDIA_IS_CASTING,u)},"timeupdate,loadedmetadata":()=>{this.propagateMediaState(K.MEDIA_CURRENT_TIME,Es(this))},"durationchange,loadedmetadata,emptied":()=>{this.propagateMediaState(K.MEDIA_DURATION,ys(this))},"loadedmetadata,emptied,progress":()=>{var e;this.propagateMediaState(K.MEDIA_SEEKABLE,(e=Ts(this))==null?void 0:e.join(":"))},"progress,emptied":()=>{var e;this.propagateMediaState(K.MEDIA_BUFFERED,Ou((e=this.media)==null?void 0:e.buffered))},"ratechange,loadstart":()=>{this.propagateMediaState(K.MEDIA_PLAYBACK_RATE,bs(this))},"waiting,playing,emptied":()=>{var e;let a=((e=this.media)==null?void 0:e.readyState)<3;this.propagateMediaState(K.MEDIA_LOADING,a)}},this._airplayUnavailable!==lt.UNSUPPORTED){let e=a=>{(a==null?void 0:a.availability)==="available"?this._airplayUnavailable=void 0:(a==null?void 0:a.availability)==="not-available"&&(this._airplayUnavailable=lt.UNAVAILABLE),this.propagateMediaState(K.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable)};this._mediaStatePropagators.webkitplaybacktargetavailabilitychanged=e}if(this._castUnavailable!==lt.UNSUPPORTED){let e=()=>{var a;let n=(a=globalThis.CastableVideoElement)==null?void 0:a.castState;n!=null&&n.includes("CONNECT")?this._castUnavailable=void 0:this._castUnavailable=lt.UNAVAILABLE,this.propagateMediaState(K.MEDIA_CAST_UNAVAILABLE,this._castUnavailable)};this._mediaStatePropagators.castchange=e}this._textTrackMediaStatePropagators={"addtrack,removetrack,loadstart":()=>{this.propagateMediaState(K.MEDIA_CAPTIONS_LIST,ut(xi(this))||void 0),this.propagateMediaState(K.MEDIA_SUBTITLES_LIST,ut(Fr(this))||void 0),this.propagateMediaState(K.MEDIA_CAPTIONS_SHOWING,ut(kn(this))||void 0),this.propagateMediaState(K.MEDIA_SUBTITLES_SHOWING,ut(ds(this))||void 0)},change:()=>{this.propagateMediaState(K.MEDIA_CAPTIONS_SHOWING,ut(kn(this))||void 0),this.propagateMediaState(K.MEDIA_SUBTITLES_SHOWING,ut(ds(this))||void 0)}},this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat("nohotkeys","hotkeys")}attributeChangedCallback(t,e,a){t==="nohotkeys"?a!==e&&a===""?(this.hasAttribute("hotkeys")&&console.warn("Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==e&&a===null&&this.enableHotkeys():t==="hotkeys"&&(lr(this,It).value=a),super.attributeChangedCallback(t,e,a)}mediaSetCallback(t){super.mediaSetCallback(t),t.hasAttribute("tabindex")||t.setAttribute("tabindex",-1),Object.keys(this._mediaStatePropagators).forEach(e=>{let a=e.split(","),n=this._mediaStatePropagators[e];a.forEach(u=>{(u==Ge.event?this.getRootNode():t).addEventListener(u,n)}),n()}),Object.entries(this._textTrackMediaStatePropagators).forEach(([e,a])=>{e.split(",").forEach(u=>{t.textTracks&&t.textTracks.addEventListener(u,a)}),a()});try{let e=ee.localStorage.getItem("media-chrome-pref-volume");e!==null&&(t.volume=e)}catch(e){console.debug("Error getting volume pref",e)}}mediaUnsetCallback(t){super.mediaUnsetCallback(t),Object.keys(this._mediaStatePropagators).forEach(e=>{let a=e.split(","),n=this._mediaStatePropagators[e];a.forEach(u=>{(u==Ge.event?this.getRootNode():t).removeEventListener(u,n)})}),Object.entries(this._textTrackMediaStatePropagators).forEach(([e,a])=>{e.split(",").forEach(u=>{t.textTracks&&t.textTracks.removeEventListener(u,a)}),a()}),this.propagateMediaState(K.MEDIA_PAUSED,!0)}propagateMediaState(t,e){Bt(this.mediaStateReceivers,t,e);let a=new ee.CustomEvent(Xa[t],{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(a)}associateElement(t){if(!t)return;let{associatedElementSubscriptions:e}=this;if(e.has(t))return;let a=this.registerMediaStateReceiver.bind(this),n=this.unregisterMediaStateReceiver.bind(this),u=Su(t,a,n);Object.keys(oe).forEach(M=>{t.addEventListener(oe[M],this[`_handle${bi(M,!0)}`])}),e.set(t,u)}unassociateElement(t){if(!t)return;let{associatedElementSubscriptions:e}=this;if(!e.has(t))return;e.get(t)(),e.delete(t),Object.keys(oe).forEach(n=>{t.removeEventListener(oe[n],this[`_handle${bi(n,!0)}`])})}registerMediaStateReceiver(t){if(!t)return;let e=this.mediaStateReceivers;e.indexOf(t)>-1||(e.push(t),Bt([t],K.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable),Bt([t],K.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable),Bt([t],K.MEDIA_FULLSCREEN_UNAVAILABLE,this._fullscreenUnavailable),Bt([t],K.MEDIA_CAST_UNAVAILABLE,this._castUnavailable),Bt([t],K.MEDIA_PIP_UNAVAILABLE,this._pipUnavailable),this.media&&Object.keys(K).forEach(n=>{n.includes("UNAVAILABLE")||Bt([t],K[n],Cn[K[n]]?Cn[K[n]](this):Cn.default(this,K[n]))}))}unregisterMediaStateReceiver(t){let e=this.mediaStateReceivers,a=e.indexOf(t);a<0||e.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",ur(this,Si,Pn))}disableHotkeys(){this.removeEventListener("keydown",ur(this,Si,Pn)),this.removeEventListener("keyup",ur(this,dr,Kr))}get hotkeys(){return lr(this,It)}keyboardShortcutHandler(t){var e,a,n,u;if(((u=(n=(e=t.target.getAttribute("keysused"))==null?void 0:e.split(" "))!=null?n:(a=t.target)==null?void 0:a.keysUsed)!=null?u:[]).map(L=>L==="Space"?" ":L).filter(Boolean).includes(t.key))return;let y,I,x,A,D,R=Tu;if(!lr(this,It).contains(`no${t.key.toLowerCase()}`)&&!(t.key===" "&&lr(this,It).contains("nospace")))switch(t.key){case" ":case"k":y=this.getAttribute(K.MEDIA_PAUSED)!=null?oe.MEDIA_PLAY_REQUEST:oe.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new ee.CustomEvent(y,{composed:!0,bubbles:!0}));break;case"m":y=this.getAttribute(K.MEDIA_VOLUME_LEVEL)==="off"?oe.MEDIA_UNMUTE_REQUEST:oe.MEDIA_MUTE_REQUEST,this.dispatchEvent(new ee.CustomEvent(y,{composed:!0,bubbles:!0}));break;case"f":y=this.getAttribute(K.MEDIA_IS_FULLSCREEN)!=null?oe.MEDIA_EXIT_FULLSCREEN_REQUEST:oe.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new ee.CustomEvent(y,{composed:!0,bubbles:!0}));break;case"c":Ai(this);break;case"ArrowLeft":I=this.getAttribute(K.MEDIA_CURRENT_TIME),x=I&&!Number.isNaN(+I)?+I:DEFAULT_TIME,A=Math.max(x-R,0),D=new ee.CustomEvent(oe.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(D);break;case"ArrowRight":I=this.getAttribute(K.MEDIA_CURRENT_TIME),x=I&&!Number.isNaN(+I)?+I:DEFAULT_TIME,A=Math.max(x+R,0),D=new ee.CustomEvent(oe.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(D);break;default:break}}};It=new WeakMap;dr=new WeakSet;Kr=function(r){let{key:t}=r;if(!hs.includes(t)){this.removeEventListener("keyup",ur(this,dr,Kr));return}this.keyboardShortcutHandler(r)};Si=new WeakSet;Pn=function(r){let{metaKey:t,altKey:e,key:a}=r;if(t||e||!hs.includes(a)){this.removeEventListener("keyup",ur(this,dr,Kr));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(lr(this,It).contains(`no${a.toLowerCase()}`)||a===" "&&lr(this,It).contains("nospace"))&&r.preventDefault(),this.addEventListener("keyup",ur(this,dr,Kr),{once:!0})};var Cn={default(r,t){return r.getAttribute(t)},[K.MEDIA_CAPTIONS_LIST](r){return ut(xi(r))||void 0},[K.MEDIA_SUBTITLES_LIST](r){return ut(Fr(r))||void 0},[K.MEDIA_SUBTITLES_LIST](r){return ut(Fr(r))||void 0},[K.MEDIA_CAPTIONS_SHOWING](r){return ut(kn(r))||void 0},[K.MEDIA_PAUSED](r){return vs(r)},[K.MEDIA_MUTED](r){return ms(r)},[K.MEDIA_VOLUME](r){return gs(r)},[K.MEDIA_VOLUME_LEVEL](r){return ps(r)},[K.MEDIA_CURRENT_TIME](r){return Es(r)},[K.MEDIA_DURATION](r){return ys(r)},[K.MEDIA_SEEKABLE](r){var t;return(t=Ts(r))==null?void 0:t.join(":")},[K.MEDIA_PLAYBACK_RATE](r){return bs(r)}},vs=r=>r.media?r.media.paused:!0,ms=r=>!!(r.media&&r.media.muted),gs=r=>{let t=r.media;return t?t.volume:1},ps=r=>{let t="high";if(!r.media)return t;let{muted:e,volume:a}=r.media;return a===0||e?t="off":a<.5?t="low":a<.75&&(t="medium"),t},Es=r=>{let t=r.media;return t?t.currentTime:0},ys=r=>{let t=r==null?void 0:r.media;return Number.isFinite(t==null?void 0:t.duration)?t.duration:NaN},Ts=r=>{var t;let e=r==null?void 0:r.media;if(!((t=e==null?void 0:e.seekable)!=null&&t.length))return;let a=e.seekable.start(0),n=e.seekable.end(e.seekable.length-1);if(!(!a&&!n))return[Number(a.toFixed(3)),Number(n.toFixed(3))]},bs=r=>{let t=r.media;return t?t.playbackRate:1},Fr=r=>or(r.media,{kind:ir.SUBTITLES}),xi=r=>or(r.media,{kind:ir.CAPTIONS}),ds=r=>or(r.media,{kind:ir.SUBTITLES,mode:Nt.SHOWING}),kn=r=>or(r.media,{kind:ir.CAPTIONS,mode:Nt.SHOWING}),bu=Object.values(K),As=r=>{var t,e,a,n;let{observedAttributes:u}=r.constructor;!u&&((t=r.nodeName)==null?void 0:t.includes("-"))&&(ee.customElements.upgrade(r),{observedAttributes:u}=r.constructor);let M=(n=(a=(e=r==null?void 0:r.getAttribute)==null?void 0:e.call(r,K.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:n.call(a,/\s+/);return Array.isArray(u||M)?(u||M).filter(y=>bu.includes(y)):[]},wn=r=>!!As(r).length,Au=async(r,t,e)=>(r.isConnected||await Ss(0),e==null?r.removeAttribute(t):typeof e=="boolean"?e?r.setAttribute(t,""):r.removeAttribute(t):Number.isNaN(e)?r.removeAttribute(t):r.setAttribute(t,e)),_u=r=>{var t;return!!((t=r.closest)!=null&&t.call(r,'*[slot="media"]'))},Nr=(r,t)=>{if(_u(r))return;let e=(n,u)=>{var M,y;wn(n)&&u(n);let{children:I=[]}=n!=null?n:{},x=(y=(M=n==null?void 0:n.shadowRoot)==null?void 0:M.children)!=null?y:[];[...I,...x].forEach(D=>Nr(D,u))},a=r==null?void 0:r.nodeName.toLowerCase();if(a.includes("-")&&!wn(r)){ee.customElements.whenDefined(a).then(()=>{e(r,t)});return}e(r,t)},Bt=(r,t,e)=>{r.forEach(a=>{!As(a).includes(t)||Au(a,t,e)})},Su=(r,t,e)=>{Nr(r,t);let a=I=>{var x;let A=(x=I==null?void 0:I.composedPath()[0])!=null?x:I.target;t(A)},n=I=>{var x;let A=(x=I==null?void 0:I.composedPath()[0])!=null?x:I.target;e(A)};r.addEventListener(oe.REGISTER_MEDIA_STATE_RECEIVER,a),r.addEventListener(oe.UNREGISTER_MEDIA_STATE_RECEIVER,n);let u=I=>{I.forEach(x=>{let{addedNodes:A=[],removedNodes:D=[],type:R,target:L,attributeName:T}=x;R==="childList"?(Array.prototype.forEach.call(A,S=>Nr(S,t)),Array.prototype.forEach.call(D,S=>Nr(S,e))):R==="attributes"&&T===K.MEDIA_CHROME_ATTRIBUTES&&(wn(L)?t(L):e(L))})},M=new MutationObserver(u);return M.observe(r,{childList:!0,attributes:!0,subtree:!0}),()=>{Nr(r,e),M.disconnect(),r.removeEventListener(oe.REGISTER_MEDIA_STATE_RECEIVER,a),r.removeEventListener(oe.UNREGISTER_MEDIA_STATE_RECEIVER,n)}},_i,_s=()=>{var r,t;return _i||(_i=(t=(r=X)==null?void 0:r.createElement)==null?void 0:t.call(r,"video"),_i)},xu=async(r=_s())=>{if(!r)return!1;let t=r.volume;return r.volume=t/2+.1,await Ss(0),r.volume!==t},Ss=r=>new Promise(t=>setTimeout(t,r)),Lu=(r=_s())=>typeof(r==null?void 0:r.requestPictureInPicture)=="function",Du=Lu(),Br,Iu=xu().then(r=>(Br=r,Br)),Mu=!!ee.WebKitPlaybackTargetAvailabilityEvent,Ru=!!ee.chrome,cs=X[Ge.enabled];function Ou(r=[]){return Array.from(r).map((t,e)=>[Number(r.start(e).toFixed(3)),Number(r.end(e).toFixed(3))].join(":")).join(" ")}le("media-controller",Li);var Wr=Li;var Ls=X.createElement("template"),xs=`
|
|
220
|
+
`;var gu=Object.values(K),yi=class extends ee.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(ss.content.cloneNode(!0));let t=u=>{let M=this.media;for(let y of u)y.type==="childList"&&(y.removedNodes.forEach(I=>{if(I.slot=="media"&&y.target==this){let x=y.previousSibling&&y.previousSibling.previousElementSibling;if(!x||!M)this.mediaUnsetCallback(I);else{let A=x.slot!=="media";for(;(x=x.previousSibling)!==null;)x.slot=="media"&&(A=!1);A&&this.mediaUnsetCallback(I)}}}),M&&y.addedNodes.forEach(I=>{I==M&&this.handleMediaUpdated(M).then(x=>this.mediaSetCallback(x))}))};new MutationObserver(t).observe(this,{childList:!0,subtree:!0});let a=this.media,n=this.querySelector(":scope > slot[slot=media]");n&&n.addEventListener("slotchange",()=>{if(!n.assignedElements({flatten:!0}).length){this.mediaUnsetCallback(a);return}this.media&&(a=this.media,this.handleMediaUpdated(this.media).then(M=>this.mediaSetCallback(M)))})}static get observedAttributes(){return["autohide","gestures-disabled"].concat(gu)}attributeChangedCallback(t,e,a){t.toLowerCase()=="autohide"&&(this.autohide=a)}get media(){let t=this.querySelector(":scope > [slot=media]");return(t==null?void 0:t.nodeName)=="SLOT"&&(t=t.assignedElements({flatten:!0})[0]),t}mediaSetCallback(t){this._mediaClickPlayToggle=()=>{let e=t.paused?oe.MEDIA_PLAY_REQUEST:oe.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new ee.CustomEvent(e,{composed:!0,bubbles:!0}))}}handleMediaUpdated(t){let e=u=>Promise.resolve(u),a=u=>(console.error('<media-chrome>: Media element set with slot="media" does not appear to be compatible.',u),Promise.reject(u));if(!t)return a(t);let n=t.nodeName.toLowerCase();return n.includes("-")?ee.customElements.whenDefined(n).then(()=>e(t)):e(t)}mediaUnsetCallback(){}connectedCallback(){let e=this.getAttribute("audio")!=null?Ze.AUDIO_PLAYER():Ze.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",e),this.media&&this.handleMediaUpdated(this.media).then(M=>this.mediaSetCallback(M)),this.setAttribute("user-inactive","user-inactive");let a=()=>{if(this.autohide<0)return;this.setAttribute("user-inactive","user-inactive");let M=new ee.CustomEvent(kr.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(M)},n=()=>{this.removeAttribute("user-inactive");let M=new ee.CustomEvent(kr.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(M)},u=()=>{n(),ee.clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=ee.setTimeout(()=>{a()},this.autohide*1e3))};this.addEventListener("keyup",()=>{u()}),this.addEventListener("pointerup",M=>{M.pointerType==="touch"&&([this,this.media].includes(M.target)&&!this.hasAttribute("user-inactive")?a():u())}),this.addEventListener("pointermove",M=>{M.pointerType==="mouse"&&M.target!==this&&(n(),ee.clearTimeout(this._inactiveTimeout),[this,this.media].includes(M.target)&&u())}),this.addEventListener("mouseleave",()=>{a()}),this.addEventListener("keyup",()=>{this.setAttribute("media-keyboard-control","")}),this.addEventListener("mouseup",()=>{this.removeAttribute("media-keyboard-control")})}set autohide(t){t=Number(t),this._autohide=isNaN(t)?0:t}get autohide(){return this._autohide===void 0?2:this._autohide}};le("media-container-temp",yi);var os=yi;var ls=(r,t,e)=>{if(!t.has(r))throw TypeError("Cannot "+e)},Xe=(r,t,e)=>(ls(r,t,"read from private field"),e?e.call(r):t.get(r)),Dn=(r,t,e)=>{if(t.has(r))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(r):t.set(r,e)},In=(r,t,e,a)=>(ls(r,t,"write to private field"),a?a.call(r,e):t.set(r,e),e),sr,or,it,Ti=class{constructor(t,e){Dn(this,sr,void 0),Dn(this,or,void 0),Dn(this,it,[]),In(this,sr,t),In(this,or,e)}[Symbol.iterator](){return Xe(this,it).values()}get length(){return Xe(this,it).length}get value(){var t;return(t=Xe(this,it).join(" "))!=null?t:""}set value(t){var e;t!==this.value&&(In(this,it,[]),this.add(...(e=t==null?void 0:t.split(" "))!=null?e:[]))}toString(){return this.value}item(t){return Xe(this,it)[t]}values(){return Xe(this,it).values()}keys(){return Xe(this,it).keys()}forEach(t){Xe(this,it).forEach(t)}add(...t){var e,a;t.forEach(n=>{this.contains(n)||Xe(this,it).push(n)}),!(this.value===""&&!((e=Xe(this,sr))!=null&&e.hasAttribute(`${Xe(this,or)}`)))&&((a=Xe(this,sr))==null||a.setAttribute(`${Xe(this,or)}`,`${this.value}`))}remove(...t){var e;t.forEach(a=>{Xe(this,it).splice(Xe(this,it).indexOf(a),1)}),(e=Xe(this,sr))==null||e.setAttribute(`${Xe(this,or)}`,`${this.value}`)}contains(t){return Xe(this,it).includes(t)}toggle(t,e){return typeof e!="undefined"?e?(this.add(t),!0):(this.remove(t),!1):this.contains(t)?(this.remove(t),!1):(this.add(t),!0)}replace(t,e){this.remove(t),this.add(e)}};sr=new WeakMap;or=new WeakMap;it=new WeakMap;var Ge={enter:"requestFullscreen",exit:"exitFullscreen",event:"fullscreenchange",element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};X.fullscreenElement===void 0&&(Ge.enter="webkitRequestFullScreen",Ge.exit=X.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",Ge.event="webkitfullscreenchange",Ge.element="webkitFullscreenElement",Ge.error="webkitfullscreenerror",Ge.enabled="webkitFullscreenEnabled");function bi(r,t=!1){return r.split("_").map(function(e,a){return(a||t?e[0].toUpperCase():e[0].toLowerCase())+e.slice(1).toLowerCase()}).join("")}var Mn=(r="")=>r.split(/\s+/),us=(r="")=>{let[t,e]=r.split(":"),a=e?decodeURIComponent(e):void 0;return{language:t,label:a}},pu=(r="",t={})=>Mn(r).map(e=>{let a=us(e);return{...t,...a}}),Eu=r=>Array.isArray(r)?r.map(t=>typeof t=="string"?us(t):t):typeof r=="string"?pu(r):[r],yu=({label:r,language:t}={})=>r?`${t}:${encodeURIComponent(r)}`:t,ut=(r=[])=>Array.prototype.map.call(r,yu).join(" "),Tu=(r,t)=>e=>e[r]===t,ds=r=>{let t=Object.entries(r).map(([e,a])=>Tu(e,a));return e=>t.every(a=>a(e))},Ur=(r,t=[],e=[])=>{let a=Eu(e).map(ds),n=u=>a.some(M=>M(u));Array.from(t).filter(n).forEach(u=>{u.mode=r})},lr=(r,t=()=>!0)=>{if(!(r!=null&&r.textTracks))return[];let e=typeof t=="function"?t:ds(t);return Array.from(r.textTracks).filter(e)},Rn=r=>{let t=!!r.getAttribute(K.MEDIA_CAPTIONS_SHOWING),e=!r.hasAttribute("no-subtitles-fallback")&&!!r.getAttribute(K.MEDIA_SUBTITLES_SHOWING);return t||e},Ai=r=>{var t,e,a,n;if(Rn(r)){let M=r.getAttribute(K.MEDIA_CAPTIONS_SHOWING);if(M){let I=new window.CustomEvent(oe.MEDIA_DISABLE_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:M});r.dispatchEvent(I)}let y=r.getAttribute(K.MEDIA_SUBTITLES_SHOWING);if(y&&!r.hasAttribute("no-subtitles-fallback")){let I=new window.CustomEvent(oe.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:y});r.dispatchEvent(I)}}else{let[M]=(e=Mn((t=r.getAttribute(K.MEDIA_CAPTIONS_LIST))!=null?t:""))!=null?e:[];if(M){let y=new window.CustomEvent(oe.MEDIA_SHOW_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:M});r.dispatchEvent(y)}else if(r.hasAttribute("no-subtitles-fallback"))console.error("Attempting to enable closed captions but none are available! Please verify your media content if this is unexpected.");else{let[y]=(n=Mn((a=r.getAttribute(K.MEDIA_SUBTITLES_LIST))!=null?a:""))!=null?n:[];if(y){let I=new window.CustomEvent(oe.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:y});r.dispatchEvent(I)}}}};var vs=(r,t,e)=>{if(!t.has(r))throw TypeError("Cannot "+e)},ur=(r,t,e)=>(vs(r,t,"read from private field"),e?e.call(r):t.get(r)),On=(r,t,e)=>{if(t.has(r))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(r):t.set(r,e)},dr=(r,t,e)=>(vs(r,t,"access private method"),e),It,cr,Kr,Si,Pn,ms=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],bu=10,cs=0,Li=class extends os{constructor(){super(),On(this,cr),On(this,Si),On(this,It,new Ti(this,"hotkeys")),Ru||(this._airplayUnavailable=lt.UNSUPPORTED),hs||(this._fullscreenUnavailable=lt.UNAVAILABLE),Ou||(this._castUnavailable=lt.UNSUPPORTED),Iu||(this._pipUnavailable=lt.UNSUPPORTED),Br!==void 0?Br||(this._volumeUnavailable=lt.UNSUPPORTED):Mu.then(()=>{Br||(this._volumeUnavailable=lt.UNSUPPORTED,this.propagateMediaState(K.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associatedElements=[],this.associateElement(this);let t={MEDIA_PLAY_REQUEST:()=>this.media.play(),MEDIA_PAUSE_REQUEST:()=>this.media.pause(),MEDIA_MUTE_REQUEST:()=>this.media.muted=!0,MEDIA_UNMUTE_REQUEST:()=>{let e=this.media;e.muted=!1,e.volume===0&&(e.volume=.25)},MEDIA_VOLUME_REQUEST:e=>{let a=this.media,n=e.detail;a.volume=n,n>0&&a.muted&&(a.muted=!1);try{ee.localStorage.setItem("media-chrome-pref-volume",n.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:()=>{if(!hs){console.warn("Fullscreen support is unavailable; not entering fullscreen");return}let e=this.media;X.pictureInPictureElement&&X.exitPictureInPicture(),super[Ge.enter]?super[Ge.enter]():e.webkitEnterFullscreen?e.webkitEnterFullscreen():e.requestFullscreen?e.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{X[Ge.exit]()},MEDIA_ENTER_PIP_REQUEST:()=>{let e=this.media;if(!X.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!e.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}X[Ge.element]&&X[Ge.exit]();let a=n=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};e.requestPictureInPicture().catch(n=>{if(n.code===11)if(e.readyState===0&&e.preload==="none"){let u=function(){e.removeEventListener("loadedmetadata",M),e.preload="none"},M=function(){e.requestPictureInPicture().catch(a),u()};e.addEventListener("loadedmetadata",M),e.preload="metadata",setTimeout(()=>{e.readyState===0&&a(),u()},1e3)}else throw n;else throw n})},MEDIA_EXIT_PIP_REQUEST:()=>{X.pictureInPictureElement&&X.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:()=>{var e;let a=this.media;!((e=globalThis.CastableVideoElement)!=null&&e.castEnabled)||(X[Ge.element]&&X[Ge.exit](),a.requestCast())},MEDIA_EXIT_CAST_REQUEST:async()=>{var e;(e=globalThis.CastableVideoElement)!=null&&e.castElement&&globalThis.CastableVideoElement.exitCast()},MEDIA_SEEK_REQUEST:e=>{let a=this.media,n=e.detail;(a.readyState>0||a.readyState===void 0)&&(a.currentTime=n)},MEDIA_PLAYBACK_RATE_REQUEST:e=>{this.media.playbackRate=e.detail},MEDIA_PREVIEW_REQUEST:e=>{var a;let n=this.media;if(!n)return;let u=e.detail;u===null&&this.propagateMediaState(K.MEDIA_PREVIEW_TIME,void 0),this.propagateMediaState(K.MEDIA_PREVIEW_TIME,u);let[M]=lr(n,{kind:nr.METADATA,label:"thumbnails"});if(!(M&&M.cues))return;if(u===null){this.propagateMediaState(K.MEDIA_PREVIEW_IMAGE,void 0),this.propagateMediaState(K.MEDIA_PREVIEW_COORDS,void 0);return}let y=Array.prototype.find.call(M.cues,D=>D.startTime>=u);if(!y)return;let I=/'^(?:[a-z]+:)?\/\//i.test(y.text)||(a=n.querySelector('track[label="thumbnails"]'))==null?void 0:a.src,x=new URL(y.text,I),A=new URLSearchParams(x.hash).get("#xywh");this.propagateMediaState(K.MEDIA_PREVIEW_IMAGE,x.href),this.propagateMediaState(K.MEDIA_PREVIEW_COORDS,A.split(",").join(" "))},MEDIA_SHOW_CAPTIONS_REQUEST:e=>{let a=xi(this),{detail:n=[]}=e;Ur(Nt.SHOWING,a,n)},MEDIA_DISABLE_CAPTIONS_REQUEST:e=>{let a=xi(this),{detail:n=[]}=e;Ur(Nt.DISABLED,a,n)},MEDIA_SHOW_SUBTITLES_REQUEST:e=>{let a=Fr(this),{detail:n=[]}=e;Ur(Nt.SHOWING,a,n)},MEDIA_DISABLE_SUBTITLES_REQUEST:e=>{let a=Fr(this),{detail:n=[]}=e;Ur(Nt.DISABLED,a,n)},MEDIA_AIRPLAY_REQUEST:()=>{let{media:e}=this;if(!!e){if(!(e.webkitShowPlaybackTargetPicker&&ee.WebKitPlaybackTargetAvailabilityEvent)){console.warn("received a request to select AirPlay but AirPlay is not supported in this environment");return}e.webkitShowPlaybackTargetPicker()}}};if(Object.keys(t).forEach(e=>{let a=`_handle${bi(e,!0)}`;this[a]=n=>{if(n.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}t[e](n,this.media)},this.addEventListener(oe[e],this[a])}),this._mediaStatePropagators={"play,pause,emptied":()=>{this.propagateMediaState(K.MEDIA_PAUSED,gs(this))},"playing,emptied":()=>{var e;this.propagateMediaState(K.MEDIA_HAS_PLAYED,!((e=this.media)!=null&&e.paused))},volumechange:()=>{this.propagateMediaState(K.MEDIA_MUTED,ps(this)),this.propagateMediaState(K.MEDIA_VOLUME,Es(this)),this.propagateMediaState(K.MEDIA_VOLUME_LEVEL,ys(this))},[Ge.event]:e=>{let n=!!X[Ge.element]&&(e==null?void 0:e.target),u=wr(this,n);this.propagateMediaState(K.MEDIA_IS_FULLSCREEN,u)},"enterpictureinpicture,leavepictureinpicture":e=>{var a;let n;if(e)n=e.type=="enterpictureinpicture";else{let u=(a=this.getRootNode().pictureInPictureElement)!=null?a:X.pictureInPictureElement;n=this.media&&wr(this.media,u)}this.propagateMediaState(K.MEDIA_IS_PIP,n)},"entercast,leavecast,castchange":e=>{var a;let n=(a=globalThis.CastableVideoElement)==null?void 0:a.castElement,u=this.media&&wr(this.media,n);(e==null?void 0:e.type)==="castchange"&&(e==null?void 0:e.detail)==="CONNECTING"&&(u="connecting"),this.propagateMediaState(K.MEDIA_IS_CASTING,u)},"timeupdate,loadedmetadata":()=>{this.propagateMediaState(K.MEDIA_CURRENT_TIME,Ts(this))},"durationchange,loadedmetadata,emptied":()=>{this.propagateMediaState(K.MEDIA_DURATION,bs(this))},"loadedmetadata,emptied,progress":()=>{var e;this.propagateMediaState(K.MEDIA_SEEKABLE,(e=As(this))==null?void 0:e.join(":"))},"progress,emptied":()=>{var e;this.propagateMediaState(K.MEDIA_BUFFERED,Pu((e=this.media)==null?void 0:e.buffered))},"ratechange,loadstart":()=>{this.propagateMediaState(K.MEDIA_PLAYBACK_RATE,_s(this))},"waiting,playing,emptied":()=>{var e;let a=((e=this.media)==null?void 0:e.readyState)<3;this.propagateMediaState(K.MEDIA_LOADING,a)}},this._airplayUnavailable!==lt.UNSUPPORTED){let e=a=>{(a==null?void 0:a.availability)==="available"?this._airplayUnavailable=void 0:(a==null?void 0:a.availability)==="not-available"&&(this._airplayUnavailable=lt.UNAVAILABLE),this.propagateMediaState(K.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable)};this._mediaStatePropagators.webkitplaybacktargetavailabilitychanged=e}if(this._castUnavailable!==lt.UNSUPPORTED){let e=()=>{var a;let n=(a=globalThis.CastableVideoElement)==null?void 0:a.castState;n!=null&&n.includes("CONNECT")?this._castUnavailable=void 0:this._castUnavailable=lt.UNAVAILABLE,this.propagateMediaState(K.MEDIA_CAST_UNAVAILABLE,this._castUnavailable)};this._mediaStatePropagators.castchange=e}this._textTrackMediaStatePropagators={"addtrack,removetrack,loadstart":()=>{this.propagateMediaState(K.MEDIA_CAPTIONS_LIST,ut(xi(this))||void 0),this.propagateMediaState(K.MEDIA_SUBTITLES_LIST,ut(Fr(this))||void 0),this.propagateMediaState(K.MEDIA_CAPTIONS_SHOWING,ut(kn(this))||void 0),this.propagateMediaState(K.MEDIA_SUBTITLES_SHOWING,ut(fs(this))||void 0)},change:()=>{this.propagateMediaState(K.MEDIA_CAPTIONS_SHOWING,ut(kn(this))||void 0),this.propagateMediaState(K.MEDIA_SUBTITLES_SHOWING,ut(fs(this))||void 0)}},this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat("nohotkeys","hotkeys")}attributeChangedCallback(t,e,a){t==="nohotkeys"?a!==e&&a===""?(this.hasAttribute("hotkeys")&&console.warn("Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==e&&a===null&&this.enableHotkeys():t==="hotkeys"&&(ur(this,It).value=a),super.attributeChangedCallback(t,e,a)}mediaSetCallback(t){super.mediaSetCallback(t),t.hasAttribute("tabindex")||t.setAttribute("tabindex",-1),Object.keys(this._mediaStatePropagators).forEach(e=>{let a=e.split(","),n=this._mediaStatePropagators[e];a.forEach(u=>{(u==Ge.event?this.getRootNode():t).addEventListener(u,n)}),n()}),Object.entries(this._textTrackMediaStatePropagators).forEach(([e,a])=>{e.split(",").forEach(u=>{t.textTracks&&t.textTracks.addEventListener(u,a)}),a()});try{let e=ee.localStorage.getItem("media-chrome-pref-volume");e!==null&&(t.volume=e)}catch(e){console.debug("Error getting volume pref",e)}}mediaUnsetCallback(t){super.mediaUnsetCallback(t),Object.keys(this._mediaStatePropagators).forEach(e=>{let a=e.split(","),n=this._mediaStatePropagators[e];a.forEach(u=>{(u==Ge.event?this.getRootNode():t).removeEventListener(u,n)})}),Object.entries(this._textTrackMediaStatePropagators).forEach(([e,a])=>{e.split(",").forEach(u=>{t.textTracks&&t.textTracks.removeEventListener(u,a)}),a()}),this.propagateMediaState(K.MEDIA_PAUSED,!0)}propagateMediaState(t,e){Kt(this.mediaStateReceivers,t,e);let a=new ee.CustomEvent(Qa[t],{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(a)}associateElement(t){if(!t)return;let{associatedElementSubscriptions:e}=this;if(e.has(t))return;let a=this.registerMediaStateReceiver.bind(this),n=this.unregisterMediaStateReceiver.bind(this),u=xu(t,a,n);Object.keys(oe).forEach(M=>{t.addEventListener(oe[M],this[`_handle${bi(M,!0)}`])}),e.set(t,u)}unassociateElement(t){if(!t)return;let{associatedElementSubscriptions:e}=this;if(!e.has(t))return;e.get(t)(),e.delete(t),Object.keys(oe).forEach(n=>{t.removeEventListener(oe[n],this[`_handle${bi(n,!0)}`])})}registerMediaStateReceiver(t){if(!t)return;let e=this.mediaStateReceivers;e.indexOf(t)>-1||(e.push(t),Kt([t],K.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable),Kt([t],K.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable),Kt([t],K.MEDIA_FULLSCREEN_UNAVAILABLE,this._fullscreenUnavailable),Kt([t],K.MEDIA_CAST_UNAVAILABLE,this._castUnavailable),Kt([t],K.MEDIA_PIP_UNAVAILABLE,this._pipUnavailable),this.media&&Object.keys(K).forEach(n=>{n.includes("UNAVAILABLE")||Kt([t],K[n],Cn[K[n]]?Cn[K[n]](this):Cn.default(this,K[n]))}))}unregisterMediaStateReceiver(t){let e=this.mediaStateReceivers,a=e.indexOf(t);a<0||e.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",dr(this,Si,Pn))}disableHotkeys(){this.removeEventListener("keydown",dr(this,Si,Pn)),this.removeEventListener("keyup",dr(this,cr,Kr))}get hotkeys(){return ur(this,It)}keyboardShortcutHandler(t){var e,a,n,u;if(((u=(n=(e=t.target.getAttribute("keysused"))==null?void 0:e.split(" "))!=null?n:(a=t.target)==null?void 0:a.keysUsed)!=null?u:[]).map(L=>L==="Space"?" ":L).filter(Boolean).includes(t.key))return;let y,I,x,A,D,R=bu;if(!ur(this,It).contains(`no${t.key.toLowerCase()}`)&&!(t.key===" "&&ur(this,It).contains("nospace")))switch(t.key){case" ":case"k":y=this.getAttribute(K.MEDIA_PAUSED)!=null?oe.MEDIA_PLAY_REQUEST:oe.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new ee.CustomEvent(y,{composed:!0,bubbles:!0}));break;case"m":y=this.getAttribute(K.MEDIA_VOLUME_LEVEL)==="off"?oe.MEDIA_UNMUTE_REQUEST:oe.MEDIA_MUTE_REQUEST,this.dispatchEvent(new ee.CustomEvent(y,{composed:!0,bubbles:!0}));break;case"f":y=this.getAttribute(K.MEDIA_IS_FULLSCREEN)!=null?oe.MEDIA_EXIT_FULLSCREEN_REQUEST:oe.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new ee.CustomEvent(y,{composed:!0,bubbles:!0}));break;case"c":Ai(this);break;case"ArrowLeft":I=this.getAttribute(K.MEDIA_CURRENT_TIME),x=I&&!Number.isNaN(+I)?+I:cs,A=Math.max(x-R,0),D=new ee.CustomEvent(oe.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(D);break;case"ArrowRight":I=this.getAttribute(K.MEDIA_CURRENT_TIME),x=I&&!Number.isNaN(+I)?+I:cs,A=Math.max(x+R,0),D=new ee.CustomEvent(oe.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(D);break;default:break}}};It=new WeakMap;cr=new WeakSet;Kr=function(r){let{key:t}=r;if(!ms.includes(t)){this.removeEventListener("keyup",dr(this,cr,Kr));return}this.keyboardShortcutHandler(r)};Si=new WeakSet;Pn=function(r){let{metaKey:t,altKey:e,key:a}=r;if(t||e||!ms.includes(a)){this.removeEventListener("keyup",dr(this,cr,Kr));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(ur(this,It).contains(`no${a.toLowerCase()}`)||a===" "&&ur(this,It).contains("nospace"))&&r.preventDefault(),this.addEventListener("keyup",dr(this,cr,Kr),{once:!0})};var Cn={default(r,t){return r.getAttribute(t)},[K.MEDIA_CAPTIONS_LIST](r){return ut(xi(r))||void 0},[K.MEDIA_SUBTITLES_LIST](r){return ut(Fr(r))||void 0},[K.MEDIA_SUBTITLES_LIST](r){return ut(Fr(r))||void 0},[K.MEDIA_CAPTIONS_SHOWING](r){return ut(kn(r))||void 0},[K.MEDIA_PAUSED](r){return gs(r)},[K.MEDIA_MUTED](r){return ps(r)},[K.MEDIA_VOLUME](r){return Es(r)},[K.MEDIA_VOLUME_LEVEL](r){return ys(r)},[K.MEDIA_CURRENT_TIME](r){return Ts(r)},[K.MEDIA_DURATION](r){return bs(r)},[K.MEDIA_SEEKABLE](r){var t;return(t=As(r))==null?void 0:t.join(":")},[K.MEDIA_PLAYBACK_RATE](r){return _s(r)}},gs=r=>r.media?r.media.paused:!0,ps=r=>!!(r.media&&r.media.muted),Es=r=>{let t=r.media;return t?t.volume:1},ys=r=>{let t="high";if(!r.media)return t;let{muted:e,volume:a}=r.media;return a===0||e?t="off":a<.5?t="low":a<.75&&(t="medium"),t},Ts=r=>{let t=r.media;return t?t.currentTime:0},bs=r=>{let t=r==null?void 0:r.media;return Number.isFinite(t==null?void 0:t.duration)?t.duration:NaN},As=r=>{var t;let e=r==null?void 0:r.media;if(!((t=e==null?void 0:e.seekable)!=null&&t.length))return;let a=e.seekable.start(0),n=e.seekable.end(e.seekable.length-1);if(!(!a&&!n))return[Number(a.toFixed(3)),Number(n.toFixed(3))]},_s=r=>{let t=r.media;return t?t.playbackRate:1},Fr=r=>lr(r.media,{kind:nr.SUBTITLES}),xi=r=>lr(r.media,{kind:nr.CAPTIONS}),fs=r=>lr(r.media,{kind:nr.SUBTITLES,mode:Nt.SHOWING}),kn=r=>lr(r.media,{kind:nr.CAPTIONS,mode:Nt.SHOWING}),Au=Object.values(K),Ss=r=>{var t,e,a,n;let{observedAttributes:u}=r.constructor;!u&&((t=r.nodeName)==null?void 0:t.includes("-"))&&(ee.customElements.upgrade(r),{observedAttributes:u}=r.constructor);let M=(n=(a=(e=r==null?void 0:r.getAttribute)==null?void 0:e.call(r,K.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:n.call(a,/\s+/);return Array.isArray(u||M)?(u||M).filter(y=>Au.includes(y)):[]},wn=r=>!!Ss(r).length,_u=async(r,t,e)=>(r.isConnected||await xs(0),e==null?r.removeAttribute(t):typeof e=="boolean"?e?r.setAttribute(t,""):r.removeAttribute(t):Number.isNaN(e)?r.removeAttribute(t):r.setAttribute(t,e)),Su=r=>{var t;return!!((t=r.closest)!=null&&t.call(r,'*[slot="media"]'))},Nr=(r,t)=>{if(Su(r))return;let e=(n,u)=>{var M,y;wn(n)&&u(n);let{children:I=[]}=n!=null?n:{},x=(y=(M=n==null?void 0:n.shadowRoot)==null?void 0:M.children)!=null?y:[];[...I,...x].forEach(D=>Nr(D,u))},a=r==null?void 0:r.nodeName.toLowerCase();if(a.includes("-")&&!wn(r)){ee.customElements.whenDefined(a).then(()=>{e(r,t)});return}e(r,t)},Kt=(r,t,e)=>{r.forEach(a=>{!Ss(a).includes(t)||_u(a,t,e)})},xu=(r,t,e)=>{Nr(r,t);let a=I=>{var x;let A=(x=I==null?void 0:I.composedPath()[0])!=null?x:I.target;t(A)},n=I=>{var x;let A=(x=I==null?void 0:I.composedPath()[0])!=null?x:I.target;e(A)};r.addEventListener(oe.REGISTER_MEDIA_STATE_RECEIVER,a),r.addEventListener(oe.UNREGISTER_MEDIA_STATE_RECEIVER,n);let u=I=>{I.forEach(x=>{let{addedNodes:A=[],removedNodes:D=[],type:R,target:L,attributeName:T}=x;R==="childList"?(Array.prototype.forEach.call(A,S=>Nr(S,t)),Array.prototype.forEach.call(D,S=>Nr(S,e))):R==="attributes"&&T===K.MEDIA_CHROME_ATTRIBUTES&&(wn(L)?t(L):e(L))})},M=new MutationObserver(u);return M.observe(r,{childList:!0,attributes:!0,subtree:!0}),()=>{Nr(r,e),M.disconnect(),r.removeEventListener(oe.REGISTER_MEDIA_STATE_RECEIVER,a),r.removeEventListener(oe.UNREGISTER_MEDIA_STATE_RECEIVER,n)}},_i,Un=()=>{var r,t;return _i||(_i=(t=(r=X)==null?void 0:r.createElement)==null?void 0:t.call(r,"video"),_i)},Lu=async(r=Un())=>{if(!r)return!1;let t=r.volume;return r.volume=t/2+.1,await xs(0),r.volume!==t},xs=r=>new Promise(t=>setTimeout(t,r)),Du=(r=Un())=>typeof(r==null?void 0:r.requestPictureInPicture)=="function",Iu=Du(),Br,Mu=Lu().then(r=>(Br=r,Br)),Ru=!!ee.WebKitPlaybackTargetAvailabilityEvent,Ou=!!ee.chrome,Cu=(r=Un())=>{let t=X[Ge.enabled];return!t&&r&&(t="webkitSupportsFullscreen"in r),t},hs=Cu();function Pu(r=[]){return Array.from(r).map((t,e)=>[Number(r.start(e).toFixed(3)),Number(r.end(e).toFixed(3))].join(":")).join(" ")}le("media-controller",Li);var Wr=Li;var Ds=X.createElement("template"),Ls=`
|
|
221
221
|
height: var(--thumb-height);
|
|
222
222
|
width: var(--media-range-thumb-width, 10px);
|
|
223
223
|
border: var(--media-range-thumb-border, none);
|
|
@@ -239,7 +239,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
239
239
|
transition: var(--media-range-track-transition, none);
|
|
240
240
|
transform: translate(var(--media-range-track-translate-x, 0), var(--media-range-track-translate-y, 0));
|
|
241
241
|
cursor: pointer;
|
|
242
|
-
`;
|
|
242
|
+
`;Ds.innerHTML=`
|
|
243
243
|
<style>
|
|
244
244
|
:host {
|
|
245
245
|
--thumb-height: var(--media-range-thumb-height, 10px);
|
|
@@ -285,14 +285,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
285
285
|
|
|
286
286
|
input[type=range]::-webkit-slider-thumb {
|
|
287
287
|
-webkit-appearance: none;
|
|
288
|
-
${
|
|
288
|
+
${Ls}
|
|
289
289
|
|
|
290
290
|
margin-top: calc(calc(0px - var(--thumb-height) + var(--track-height)) / 2);
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
|
|
294
294
|
input[type=range]::-moz-range-thumb {
|
|
295
|
-
${
|
|
295
|
+
${Ls}
|
|
296
296
|
translate: var(--media-range-track-translate-x, 0) var(--media-range-track-translate-y, 0);
|
|
297
297
|
}
|
|
298
298
|
|
|
@@ -386,7 +386,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
386
386
|
<div id="pointer"></div>
|
|
387
387
|
<div id="hoverzone"></div>
|
|
388
388
|
<input id="range" type="range" min="0" max="1000" step="any" value="0">
|
|
389
|
-
`;var Ii=class extends ee.HTMLElement{static get observedAttributes(){return["disabled","aria-disabled",K.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(
|
|
389
|
+
`;var Ii=class extends ee.HTMLElement{static get observedAttributes(){return["disabled","aria-disabled",K.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ds.content.cloneNode(!0)),this.range=this.shadowRoot.querySelector("#range"),this.range.addEventListener("input",this.updateBar.bind(this))}attributeChangedCallback(t,e,a){var n,u;if(t===K.MEDIA_CONTROLLER){if(e){let M=X.getElementById(e);(n=M==null?void 0:M.unassociateElement)==null||n.call(M,this)}if(a){let M=X.getElementById(a);(u=M==null?void 0:M.associateElement)==null||u.call(M,this)}}else(t==="disabled"||t==="aria-disabled"&&e!==a)&&(a==null?this.range.removeAttribute(t):this.range.setAttribute(t,a))}connectedCallback(){var t;let e=this.getAttribute(K.MEDIA_CONTROLLER);if(e){let a=X.getElementById(e);(t=a==null?void 0:a.associateElement)==null||t.call(a,this)}this.updateBar()}disconnectedCallback(){var t;let e=this.getAttribute(K.MEDIA_CONTROLLER);if(e){let a=X.getElementById(e);(t=a==null?void 0:a.unassociateElement)==null||t.call(a,this)}}updatePointerBar(t){let e=this.range.getBoundingClientRect(),a=(t.clientX-e.left)/e.width;a=Math.max(0,Math.min(1,a));let{style:n}=Tt(this.shadowRoot,"#pointer");n.setProperty("width",`${a*e.width}px`)}updateBar(){let t=this.getBarColors(),e="linear-gradient(to right, ",a=0;t.forEach(u=>{u[1]<a||(e=e+`${u[0]} ${a}%, ${u[0]} ${u[1]}%,`,a=u[1])}),e=e.slice(0,e.length-1)+")";let{style:n}=Tt(this.shadowRoot,":host");n.setProperty("--media-range-track-progress-internal",e)}getBarColors(){let t=this.range,e=t.value-t.min,a=t.max-t.min,n=e/a*100,u=0;if(t.value>t.min&&t.value<t.max){let y=getComputedStyle(this).getPropertyValue("--media-range-thumb-width")||"10px";u=parseInt(y)*(.5-n/100)/t.offsetWidth*100}return[["var(--media-range-bar-color, #fff)",n+u],["transparent",100]]}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};le("media-chrome-range",Ii);var Hr=Ii;var Is=X.createElement("template");Is.innerHTML=`
|
|
390
390
|
<style>
|
|
391
391
|
:host {
|
|
392
392
|
|
|
@@ -405,7 +405,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
405
405
|
</style>
|
|
406
406
|
|
|
407
407
|
<slot></slot>
|
|
408
|
-
`;var
|
|
408
|
+
`;var Nn=class extends ee.HTMLElement{static get observedAttributes(){return[K.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Is.content.cloneNode(!0))}attributeChangedCallback(t,e,a){var n,u;if(t===K.MEDIA_CONTROLLER){if(e){let M=X.getElementById(e);(n=M==null?void 0:M.unassociateElement)==null||n.call(M,this)}if(a){let M=X.getElementById(a);(u=M==null?void 0:M.associateElement)==null||u.call(M,this)}}}connectedCallback(){var t;let e=this.getAttribute(K.MEDIA_CONTROLLER);if(e){let a=X.getElementById(e);(t=a==null?void 0:a.associateElement)==null||t.call(a,this)}}disconnectedCallback(){var t;let e=this.getAttribute(K.MEDIA_CONTROLLER);if(e){let a=X.getElementById(e);(t=a==null?void 0:a.unassociateElement)==null||t.call(a,this)}}};le("media-control-bar",Nn);var Ms=X.createElement("template");Ms.innerHTML=`
|
|
409
409
|
<style>
|
|
410
410
|
:host {
|
|
411
411
|
display: inline-flex;
|
|
@@ -440,11 +440,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
440
440
|
<span id="container">
|
|
441
441
|
<slot></slot>
|
|
442
442
|
</span>
|
|
443
|
-
`;var Mi=class extends ee.HTMLElement{static get observedAttributes(){return[K.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(
|
|
443
|
+
`;var Mi=class extends ee.HTMLElement{static get observedAttributes(){return[K.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ms.content.cloneNode(!0)),this.container=this.shadowRoot.querySelector("#container")}attributeChangedCallback(t,e,a){var n,u;if(t===K.MEDIA_CONTROLLER){if(e){let M=X.getElementById(e);(n=M==null?void 0:M.unassociateElement)==null||n.call(M,this)}if(a){let M=X.getElementById(a);(u=M==null?void 0:M.associateElement)==null||u.call(M,this)}}}connectedCallback(){var t;let e=this.getAttribute(K.MEDIA_CONTROLLER);if(e){let a=X.getElementById(e);(t=a==null?void 0:a.associateElement)==null||t.call(a,this)}}disconnectedCallback(){var t;let e=this.getAttribute(K.MEDIA_CONTROLLER);if(e){let a=X.getElementById(e);(t=a==null?void 0:a.unassociateElement)==null||t.call(a,this)}}};le("media-text-display",Mi);var Mt=Mi;var Fn=class extends Mt{static get observedAttributes(){return[...super.observedAttributes,K.MEDIA_CURRENT_TIME]}attributeChangedCallback(t,e,a){t===K.MEDIA_CURRENT_TIME&&(this.container.innerHTML=ct(a)),super.attributeChangedCallback(t,e,a)}};le("media-current-time-display",Fn);var Bn=class extends Mt{static get observedAttributes(){return[...super.observedAttributes,K.MEDIA_DURATION]}attributeChangedCallback(t,e,a){t===K.MEDIA_DURATION&&(this.container.innerHTML=ct(a)),super.attributeChangedCallback(t,e,a)}};le("media-duration-display",Bn);var ku=" / ",wu=(r,{timesSep:t=ku}={})=>{var e,a,n;let u=r.getAttribute("remaining")!=null,M=r.getAttribute("show-duration")!=null,y=(e=r.mediaCurrentTime)!=null?e:0,I=(n=(a=r.mediaDuration)!=null?a:r.mediaSeekableEnd)!=null?n:0,x=u?ct(0-(I-y)):ct(y);return M?`${x}${t}${ct(I)}`:x},Uu="video not loaded, unknown time.",Nu=r=>{let t=r.mediaCurrentTime,e=r.mediaDuration||r.mediaSeekableEnd;if(t==null||e==null){r.setAttribute("aria-valuetext",Uu);return}let a=r.hasAttribute("remaining"),n=r.hasAttribute("show-duration"),u=a?Ft(0-(e-t)):Ft(t);if(!n){r.setAttribute("aria-valuetext",u);return}let M=Ft(e),y=`${u} of ${M}`;r.setAttribute("aria-valuetext",y)},Kn=class extends Mt{static get observedAttributes(){return[...super.observedAttributes,K.MEDIA_CURRENT_TIME,K.MEDIA_DURATION,K.MEDIA_SEEKABLE,"remaining","show-duration","disabled"]}constructor(){super(),this.enable()}connectedCallback(){this.setAttribute("role","progressbar"),this.setAttribute("aria-label",Ze.PLAYBACK_TIME()),super.connectedCallback()}attributeChangedCallback(t,e,a){if([K.MEDIA_CURRENT_TIME,K.MEDIA_DURATION,K.MEDIA_SEEKABLE,"remaining","show-duration"].includes(t)){let n=wu(this);Nu(this),this.container.innerHTML=n}else t==="disabled"&&a!==e&&(a==null?this.enable():this.disable());super.attributeChangedCallback(t,e,a)}enable(){this.setAttribute("tabindex",0)}disable(){this.removeAttribute("tabindex")}get mediaDuration(){let t=this.getAttribute(K.MEDIA_DURATION);return t!=null?+t:void 0}get mediaCurrentTime(){let t=this.getAttribute(K.MEDIA_CURRENT_TIME);return t!=null?+t:void 0}get mediaSeekable(){let t=this.getAttribute(K.MEDIA_SEEKABLE);if(!!t)return t.split(":").map(e=>+e)}get mediaSeekableEnd(){var t;let[,e]=(t=this.mediaSeekable)!=null?t:[];return e}get mediaSeekableStart(){var t;let[e]=(t=this.mediaSeekable)!=null?t:[];return e}};le("media-time-display",Kn);var Fu=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
444
444
|
<path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>
|
|
445
|
-
</svg>`,
|
|
445
|
+
</svg>`,Bu=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
446
446
|
<path d="M17.73 14.09a1.4 1.4 0 0 1-1 .37 1.579 1.579 0 0 1-1.27-.58A3 3 0 0 1 15 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34A2.89 2.89 0 0 0 19 9.07a3 3 0 0 0-2.14-.78 3.14 3.14 0 0 0-2.42 1 3.91 3.91 0 0 0-.93 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.17 3.17 0 0 0 1.07-1.74l-1.4-.45c-.083.43-.3.822-.62 1.12Zm-7.22 0a1.43 1.43 0 0 1-1 .37 1.58 1.58 0 0 1-1.27-.58A3 3 0 0 1 7.76 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34a2.81 2.81 0 0 0-.74-1.32 2.94 2.94 0 0 0-2.13-.78 3.18 3.18 0 0 0-2.43 1 4 4 0 0 0-.92 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.23 3.23 0 0 0 1.07-1.74l-1.4-.45a2.06 2.06 0 0 1-.6 1.07Zm12.32-8.41a2.59 2.59 0 0 0-2.3-2.51C18.72 3.05 15.86 3 13 3c-2.86 0-5.72.05-7.53.17a2.59 2.59 0 0 0-2.3 2.51c-.23 4.207-.23 8.423 0 12.63a2.57 2.57 0 0 0 2.3 2.5c1.81.13 4.67.19 7.53.19 2.86 0 5.72-.06 7.53-.19a2.57 2.57 0 0 0 2.3-2.5c.23-4.207.23-8.423 0-12.63Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.14-.21-8.29 0-12.43a1.11 1.11 0 0 1 .91-1.11C7.24 4.56 10 4.49 13 4.49s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.14.21 8.29 0 12.43Z"/>
|
|
447
|
-
</svg>`,
|
|
447
|
+
</svg>`,Os=X.createElement("template");Os.innerHTML=`
|
|
448
448
|
<style>
|
|
449
449
|
:host([aria-checked="true"]) slot:not([name=on]) > *,
|
|
450
450
|
:host([aria-checked="true"]) ::slotted(:not([slot=on])) {
|
|
@@ -458,15 +458,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
458
458
|
}
|
|
459
459
|
</style>
|
|
460
460
|
|
|
461
|
-
<slot name="on">${
|
|
462
|
-
<slot name="off">${
|
|
463
|
-
`;var
|
|
464
|
-
<slot name="forward">${
|
|
465
|
-
`;var
|
|
461
|
+
<slot name="on">${Fu}</slot>
|
|
462
|
+
<slot name="off">${Bu}</slot>
|
|
463
|
+
`;var Rs=r=>{r.setAttribute("aria-checked",Rn(r))},Wn=class extends He{static get observedAttributes(){return[...super.observedAttributes,"no-subtitles-fallback","default-showing",K.MEDIA_CAPTIONS_LIST,K.MEDIA_CAPTIONS_SHOWING,K.MEDIA_SUBTITLES_LIST,K.MEDIA_SUBTITLES_SHOWING]}constructor(t={}){super({slotTemplate:Os,...t}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",Ze.CLOSED_CAPTIONS()),Rs(this)}attributeChangedCallback(t,e,a){if([K.MEDIA_CAPTIONS_SHOWING,K.MEDIA_SUBTITLES_SHOWING].includes(t)&&Rs(this),this.hasAttribute("default-showing")&&this.getAttribute("aria-checked")!=="true"){let n=!this.hasAttribute("no-subtitles-fallback");if((n?[K.MEDIA_CAPTIONS_LIST,K.MEDIA_SUBTITLES_LIST]:[K.MEDIA_CAPTIONS_LIST]).includes(t)){let M=!!this.getAttribute(K.MEDIA_CAPTIONS_LIST)||!!(n&&this.getAttribute(K.MEDIA_SUBTITLES_LIST));this._captionsReady!==M&&(this._captionsReady=M,this._captionsReady&&this.handleClick())}}super.attributeChangedCallback(t,e,a)}handleClick(t){Ai(this)}};le("media-captions-button",Wn);var Hn=30,Ku=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(8.9 19.87)">${Hn}</text><path d="M10 6V3l5.61 4L10 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 10 6Z"/></svg>`,ks=X.createElement("template");ks.innerHTML=`
|
|
464
|
+
<slot name="forward">${Ku}</slot>
|
|
465
|
+
`;var Wu=0,Cs=r=>{let t=Math.abs(+r.getAttribute("seek-offset")),e=Be.SEEK_FORWARD_N_SECS({seekOffset:t});r.setAttribute("aria-label",e)},Ps=r=>{let t=Ei(r,"forward"),e=r.getAttribute("seek-offset");pi(t,e)},jn=class extends He{static get observedAttributes(){return[...super.observedAttributes,K.MEDIA_CURRENT_TIME,"seek-offset"]}constructor(t={}){super({slotTemplate:ks,...t})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",Hn),Cs(this),Ps(this),super.connectedCallback()}attributeChangedCallback(t,e,a){t==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",Hn),Ps(this),Cs(this)),super.attributeChangedCallback(t,e,a)}handleClick(){let t=this.getAttribute(K.MEDIA_CURRENT_TIME),e=+this.getAttribute("seek-offset"),n=(t&&!Number.isNaN(+t)?+t:Wu)+e,u=new ee.CustomEvent(oe.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:n});this.dispatchEvent(u)}};le("media-seek-forward-button",jn);var Hu=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
466
466
|
<path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
|
|
467
|
-
</svg>`,
|
|
467
|
+
</svg>`,ju=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
468
468
|
<path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
|
|
469
|
-
</svg>`,
|
|
469
|
+
</svg>`,Us=X.createElement("template");Us.innerHTML=`
|
|
470
470
|
<style>
|
|
471
471
|
:host([${K.MEDIA_IS_FULLSCREEN}]) slot:not([name=exit]) > *,
|
|
472
472
|
:host([${K.MEDIA_IS_FULLSCREEN}]) ::slotted(:not([slot=exit])) {
|
|
@@ -480,15 +480,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
480
480
|
}
|
|
481
481
|
</style>
|
|
482
482
|
|
|
483
|
-
<slot name="enter">${
|
|
484
|
-
<slot name="exit">${
|
|
485
|
-
`;var
|
|
483
|
+
<slot name="enter">${Hu}</slot>
|
|
484
|
+
<slot name="exit">${ju}</slot>
|
|
485
|
+
`;var ws=r=>{let e=r.getAttribute(K.MEDIA_IS_FULLSCREEN)!=null?Be.EXIT_FULLSCREEN():Be.ENTER_FULLSCREEN();r.setAttribute("aria-label",e)},Gn=class extends He{static get observedAttributes(){return[...super.observedAttributes,K.MEDIA_IS_FULLSCREEN,K.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(t={}){super({slotTemplate:Us,...t})}connectedCallback(){ws(this),super.connectedCallback()}attributeChangedCallback(t,e,a){t===K.MEDIA_IS_FULLSCREEN&&ws(this),super.attributeChangedCallback(t,e,a)}handleClick(t){let e=this.getAttribute(K.MEDIA_IS_FULLSCREEN)!=null?oe.MEDIA_EXIT_FULLSCREEN_REQUEST:oe.MEDIA_ENTER_FULLSCREEN_REQUEST;this.dispatchEvent(new ee.CustomEvent(e,{composed:!0,bubbles:!0}))}};le("media-fullscreen-button",Gn);var Gu=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
486
486
|
<path d="M16.5 12A4.5 4.5 0 0 0 14 8v2.18l2.45 2.45a4.22 4.22 0 0 0 .05-.63Zm2.5 0a6.84 6.84 0 0 1-.54 2.64L20 16.15A8.8 8.8 0 0 0 21 12a9 9 0 0 0-7-8.77v2.06A7 7 0 0 1 19 12ZM4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25A6.92 6.92 0 0 1 14 18.7v2.06A9 9 0 0 0 17.69 19l2 2.05L21 19.73l-9-9L4.27 3ZM12 4 9.91 6.09 12 8.18V4Z"/>
|
|
487
|
-
</svg>`,
|
|
487
|
+
</svg>`,Ns=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
488
488
|
<path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4Z"/>
|
|
489
|
-
</svg>`,
|
|
489
|
+
</svg>`,Vu=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
490
490
|
<path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4ZM14 3.23v2.06a7 7 0 0 1 0 13.42v2.06a9 9 0 0 0 0-17.54Z"/>
|
|
491
|
-
</svg>`,
|
|
491
|
+
</svg>`,Bs=X.createElement("template");Bs.innerHTML=`
|
|
492
492
|
<style>
|
|
493
493
|
|
|
494
494
|
:host(:not([${K.MEDIA_VOLUME_LEVEL}])) slot:not([name=high]) > *,
|
|
@@ -514,13 +514,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
514
514
|
}
|
|
515
515
|
</style>
|
|
516
516
|
|
|
517
|
-
<slot name="off">${
|
|
518
|
-
<slot name="low">${
|
|
519
|
-
<slot name="medium">${
|
|
520
|
-
<slot name="high">${
|
|
521
|
-
`;var
|
|
517
|
+
<slot name="off">${Gu}</slot>
|
|
518
|
+
<slot name="low">${Ns}</slot>
|
|
519
|
+
<slot name="medium">${Ns}</slot>
|
|
520
|
+
<slot name="high">${Vu}</slot>
|
|
521
|
+
`;var Fs=r=>{let e=r.getAttribute(K.MEDIA_VOLUME_LEVEL)==="off"?Be.UNMUTE():Be.MUTE();r.setAttribute("aria-label",e)},Vn=class extends He{static get observedAttributes(){return[...super.observedAttributes,K.MEDIA_VOLUME_LEVEL]}constructor(t={}){super({slotTemplate:Bs,...t})}connectedCallback(){Fs(this),super.connectedCallback()}attributeChangedCallback(t,e,a){t===K.MEDIA_VOLUME_LEVEL&&Fs(this),super.attributeChangedCallback(t,e,a)}handleClick(t){let e=this.getAttribute(K.MEDIA_VOLUME_LEVEL)==="off"?oe.MEDIA_UNMUTE_REQUEST:oe.MEDIA_MUTE_REQUEST;this.dispatchEvent(new ee.CustomEvent(e,{composed:!0,bubbles:!0}))}};le("media-mute-button",Vn);var Ks=`<svg aria-hidden="true" viewBox="0 0 28 24">
|
|
522
522
|
<path d="M24 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h20a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Zm-1 16H5V5h18v14Zm-3-8h-7v5h7v-5Z"/>
|
|
523
|
-
</svg>`,
|
|
523
|
+
</svg>`,Hs=X.createElement("template");Hs.innerHTML=`
|
|
524
524
|
<style>
|
|
525
525
|
:host([${K.MEDIA_IS_PIP}]) slot:not([name=exit]) > *,
|
|
526
526
|
:host([${K.MEDIA_IS_PIP}]) ::slotted(:not([slot=exit])) {
|
|
@@ -534,13 +534,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
534
534
|
}
|
|
535
535
|
</style>
|
|
536
536
|
|
|
537
|
-
<slot name="enter">${
|
|
538
|
-
<slot name="exit">${
|
|
539
|
-
`;var
|
|
537
|
+
<slot name="enter">${Ks}</slot>
|
|
538
|
+
<slot name="exit">${Ks}</slot>
|
|
539
|
+
`;var Ws=r=>{let e=r.getAttribute(K.MEDIA_IS_PIP)!=null?Be.EXIT_PIP():Be.ENTER_PIP();r.setAttribute("aria-label",e)},$n=class extends He{static get observedAttributes(){return[...super.observedAttributes,K.MEDIA_IS_PIP,K.MEDIA_PIP_UNAVAILABLE]}constructor(t={}){super({slotTemplate:Hs,...t})}connectedCallback(){Ws(this),super.connectedCallback()}attributeChangedCallback(t,e,a){t===K.MEDIA_IS_PIP&&Ws(this),super.attributeChangedCallback(t,e,a)}handleClick(t){let e=this.getAttribute(K.MEDIA_IS_PIP)!=null?oe.MEDIA_EXIT_PIP_REQUEST:oe.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new ee.CustomEvent(e,{composed:!0,bubbles:!0}))}};le("media-pip-button",$n);var $u=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
540
540
|
<path d="m6 21 15-9L6 3v18Z"/>
|
|
541
|
-
</svg>`,
|
|
541
|
+
</svg>`,Yu=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
542
542
|
<path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
|
|
543
|
-
</svg>`,
|
|
543
|
+
</svg>`,Gs=X.createElement("template");Gs.innerHTML=`
|
|
544
544
|
<style>
|
|
545
545
|
:host([${K.MEDIA_PAUSED}]) slot[name=pause] > *,
|
|
546
546
|
:host([${K.MEDIA_PAUSED}]) ::slotted([slot=pause]) {
|
|
@@ -553,11 +553,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
553
553
|
}
|
|
554
554
|
</style>
|
|
555
555
|
|
|
556
|
-
<slot name="play">${
|
|
557
|
-
<slot name="pause">${
|
|
558
|
-
`;var
|
|
556
|
+
<slot name="play">${$u}</slot>
|
|
557
|
+
<slot name="pause">${Yu}</slot>
|
|
558
|
+
`;var js=r=>{let e=r.getAttribute(K.MEDIA_PAUSED)!=null?Be.PLAY():Be.PAUSE();r.setAttribute("aria-label",e)},Yn=class extends He{static get observedAttributes(){return[...super.observedAttributes,K.MEDIA_PAUSED]}constructor(t={}){super({slotTemplate:Gs,...t})}connectedCallback(){js(this),super.connectedCallback()}attributeChangedCallback(t,e,a){t===K.MEDIA_PAUSED&&js(this),super.attributeChangedCallback(t,e,a)}handleClick(t){let e=this.getAttribute(K.MEDIA_PAUSED)!=null?oe.MEDIA_PLAY_REQUEST:oe.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new ee.CustomEvent(e,{composed:!0,bubbles:!0}))}};le("media-play-button",Yn);var Vs=[1,1.25,1.5,1.75,2],Ri=1,$s=X.createElement("template");$s.innerHTML=`
|
|
559
559
|
<span id="container"></span>
|
|
560
|
-
`;var
|
|
560
|
+
`;var zn=class extends He{static get observedAttributes(){return[...super.observedAttributes,K.MEDIA_PLAYBACK_RATE,"rates"]}constructor(t={}){super({slotTemplate:$s,...t}),this._rates=Vs,this.container=this.shadowRoot.querySelector("#container"),this.container.innerHTML=`${Ri}x`}attributeChangedCallback(t,e,a){if(t==="rates"){let n=(a!=null?a:"").trim().split(/\s*,?\s+/).map(u=>Number(u)).filter(u=>!Number.isNaN(u)).sort((u,M)=>u-M);this._rates=n.length?n:Vs;return}if(t===K.MEDIA_PLAYBACK_RATE){let n=a?+a:Number.NaN,u=Number.isNaN(n)?Ri:n;this.container.innerHTML=`${u}x`,this.setAttribute("aria-label",Ze.PLAYBACK_RATE({playbackRate:u}));return}super.attributeChangedCallback(t,e,a)}handleClick(t){var e,a;let n=+this.getAttribute(K.MEDIA_PLAYBACK_RATE)||Ri,u=(a=(e=this._rates.find(y=>y>n))!=null?e:this._rates[0])!=null?a:Ri,M=new ee.CustomEvent(oe.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:u});this.dispatchEvent(M)}};le("media-playback-rate-button",zn);var Ys=X.createElement("template");Ys.innerHTML=`
|
|
561
561
|
<style>
|
|
562
562
|
:host {
|
|
563
563
|
pointer-events: none;
|
|
@@ -583,7 +583,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
583
583
|
</style>
|
|
584
584
|
|
|
585
585
|
<img aria-hidden="true" id="image"/>
|
|
586
|
-
`;var
|
|
586
|
+
`;var zu=r=>{r.style.removeProperty("background-image")},Xu=(r,t)=>{r.style["background-image"]=`url('${t}')`},Xn=class extends ee.HTMLElement{static get observedAttributes(){return[K.MEDIA_HAS_PLAYED,"placeholder-src","src"]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ys.content.cloneNode(!0)),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(t,e,a){t==="src"&&(a==null?this.image.removeAttribute("src"):this.image.setAttribute("src",a)),t==="placeholder-src"&&(a==null?zu(this.image):Xu(this.image,a))}};le("media-poster-image",Xn);var ta=(r,t,e)=>{if(!t.has(r))throw TypeError("Cannot "+e)},nt=(r,t,e)=>(ta(r,t,"read from private field"),e?e.call(r):t.get(r)),ft=(r,t,e)=>{if(t.has(r))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(r):t.set(r,e)},jr=(r,t,e,a)=>(ta(r,t,"write to private field"),a?a.call(r,e):t.set(r,e),e),Qn=(r,t,e)=>(ta(r,t,"access private method"),e),Gr,Oi,Ci,fr,Vr,Jn,ki,Ui,Pi,qn,ea,Xs,Qu="video not loaded, unknown time.",Zn=r=>{let t=r.range,e=Ft(+t.value),a=Ft(+t.max),n=e&&a?`${e} of ${a}`:Qu;t.setAttribute("aria-valuetext",n)},Qs=X.createElement("template");Qs.innerHTML=`
|
|
587
587
|
<style>
|
|
588
588
|
:host {
|
|
589
589
|
--media-preview-background-color: rgba(20,20,30, .5);
|
|
@@ -676,9 +676,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
676
676
|
|
|
677
677
|
</slot>
|
|
678
678
|
</span>
|
|
679
|
-
`;var wi=class extends Hr{constructor(){super(),ft(this,Pi),ft(this,
|
|
680
|
-
<slot name="backward">${
|
|
681
|
-
`;var
|
|
679
|
+
`;var wi=class extends Hr{constructor(){super(),ft(this,Pi),ft(this,ea),ft(this,Gr,void 0),ft(this,Oi,void 0),ft(this,Ci,t=>{if([...nt(this,Gr)].some(x=>t.composedPath().includes(x)))return;this.updatePointerBar(t);let e=+this.getAttribute(K.MEDIA_DURATION);if(!e)return;let a=this.range.getBoundingClientRect(),n=(t.clientX-a.left)/a.width;n=Math.max(0,Math.min(1,n));let u=zs(this,nt(this,Oi),n),{style:M}=Tt(this.shadowRoot,'[part~="preview-box"]');M.transform=`translateX(${u}px)`;let y=n*e,I=new ee.CustomEvent(oe.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:y});this.dispatchEvent(I)}),ft(this,fr,!1),ft(this,Vr,t=>{(!t.composedPath().includes(this)||[...nt(this,Gr)].some(e=>t.composedPath().includes(e)))&&(ee.removeEventListener("pointermove",nt(this,Vr)),jr(this,fr,!1),nt(this,ki).call(this))}),ft(this,Jn,()=>{ee.addEventListener("pointermove",nt(this,Ci),!1)}),ft(this,ki,()=>{ee.removeEventListener("pointermove",nt(this,Ci));let t=new ee.CustomEvent(oe.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:null});this.dispatchEvent(t)}),ft(this,Ui,()=>{let t=this.getAttribute(K.MEDIA_DURATION);!nt(this,fr)&&t&&(jr(this,fr,!0),nt(this,Jn).call(this),ee.addEventListener("pointermove",nt(this,Vr),!1))}),this.shadowRoot.appendChild(Qs.content.cloneNode(!0)),this.range.addEventListener("input",()=>{cancelAnimationFrame(this._refreshId);let e=this.range.value,a=new ee.CustomEvent(oe.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(a)}),this._refreshBar=()=>{let t=(performance.now()-this._updateTimestamp)/1e3;this.range.value=this.mediaCurrentTime+t*this.mediaPlaybackRate,this.updateBar(),this.updateCurrentBox(),this._refreshId=requestAnimationFrame(this._refreshBar)},jr(this,Gr,this.shadowRoot.querySelectorAll('[part~="box"]')),jr(this,Oi,this.shadowRoot.querySelector('[part~="preview-box"]')),Qn(this,Pi,qn).call(this)}static get observedAttributes(){return[...super.observedAttributes,"thumbnails","disabled",K.MEDIA_PAUSED,K.MEDIA_DURATION,K.MEDIA_SEEKABLE,K.MEDIA_CURRENT_TIME,K.MEDIA_PREVIEW_IMAGE,K.MEDIA_PREVIEW_TIME,K.MEDIA_BUFFERED,K.MEDIA_PLAYBACK_RATE,K.MEDIA_LOADING]}connectedCallback(){this.range.setAttribute("aria-label",Ze.SEEK()),super.connectedCallback()}disconnectedCallback(){cancelAnimationFrame(this._refreshId),super.disconnectedCallback()}attributeChangedCallback(t,e,a){var n,u,M,y,I;(t===K.MEDIA_CURRENT_TIME||t===K.MEDIA_PAUSED||t===K.MEDIA_LOADING)&&(this._updateTimestamp=performance.now(),this.range.value=this.mediaCurrentTime,Zn(this),this.updateBar(),this.updateCurrentBox(),cancelAnimationFrame(this._refreshId),!this.mediaPaused&&!this.mediaLoading&&(this._refreshId=requestAnimationFrame(this._refreshBar))),t===K.MEDIA_DURATION&&(this.range.max=Math.floor((u=(n=this.mediaSeekableEnd)!=null?n:this.mediaDuration)!=null?u:1e3),Zn(this),this.updateBar(),this.updateCurrentBox()),t===K.MEDIA_SEEKABLE&&(this.range.min=(M=this.mediaSeekableStart)!=null?M:0,this.range.max=Math.floor((I=(y=this.mediaSeekableEnd)!=null?y:this.mediaDuration)!=null?I:1e3),Zn(this),this.updateBar()),t===K.MEDIA_BUFFERED&&this.updateBar(),t==="disabled"&&(a==null?Qn(this,Pi,qn).call(this):Qn(this,ea,Xs).call(this)),super.attributeChangedCallback(t,e,a)}get mediaPaused(){return this.hasAttribute(K.MEDIA_PAUSED)}get mediaLoading(){return this.hasAttribute(K.MEDIA_LOADING)}get mediaDuration(){let t=this.getAttribute(K.MEDIA_DURATION);return t!=null?+t:void 0}get mediaCurrentTime(){let t=this.getAttribute(K.MEDIA_CURRENT_TIME);return t!=null?+t:void 0}get mediaPlaybackRate(){let t=this.getAttribute(K.MEDIA_PLAYBACK_RATE);return t!=null?+t:1}get mediaBuffered(){let t=this.getAttribute(K.MEDIA_BUFFERED);return t?t.split(" ").map(e=>e.split(":").map(a=>+a)):[]}get mediaSeekable(){let t=this.getAttribute(K.MEDIA_SEEKABLE);if(!!t)return t.split(":").map(e=>+e)}get mediaSeekableEnd(){var t;let[,e]=(t=this.mediaSeekable)!=null?t:[];return e}get mediaSeekableStart(){var t;let[e]=(t=this.mediaSeekable)!=null?t:[];return e}getBarColors(){var t;let e=super.getBarColors(),{range:a}=this,n=a.max-a.min,u=this.mediaBuffered;if(!u.length||!Number.isFinite(n)||n<=0)return e;let M=this.mediaCurrentTime,[,y=a.min]=(t=u.find(([A,D])=>A<=M&&M<=D))!=null?t:[],x=(y-a.min)/n*100;return e.splice(1,0,["var(--media-time-buffered-color, rgba(255,255,255, .4))",x]),e}updateCurrentBox(){let t=this.shadowRoot.querySelector('[part~="current-box"]'),e=this.range.value/(this.range.max-this.range.min),a=zs(this,t,e),{style:n}=Tt(this.shadowRoot,'[part~="current-box"]');n.transform=`translateX(${a}px)`}};Gr=new WeakMap;Oi=new WeakMap;Ci=new WeakMap;fr=new WeakMap;Vr=new WeakMap;Jn=new WeakMap;ki=new WeakMap;Ui=new WeakMap;Pi=new WeakSet;qn=function(){this.addEventListener("pointermove",nt(this,Ui),!1)};ea=new WeakSet;Xs=function(){ee.removeEventListener("pointermove",nt(this,Vr)),this.removeEventListener("pointermove",nt(this,Ui)),jr(this,fr,!1),nt(this,ki).call(this)};function zs(r,t,e){var a;let n=r.getBoundingClientRect(),u=r.range.getBoundingClientRect(),M=parseInt(getComputedStyle(r).getPropertyValue("--media-box-padding-left")),y=parseInt(getComputedStyle(r).getPropertyValue("--media-box-padding-right")),I=M+e*u.width,x=t.offsetWidth,A=I-x/2,R=((a=r.getAttribute("media-bounds")?X.getElementById(r.getAttribute("media-bounds")):r.parentElement)!=null?a:r).getBoundingClientRect(),L=n.left-R.left,T=R.right-n.left-x-y,S=M-L;return Math.max(S,Math.min(A,T))}le("media-time-range",wi);var ra=wi;var ia=class extends ra{constructor(){super(),console.warn("MediaChrome: <media-progress-range> is deprecated. Use <media-time-range> instead.")}};le("media-progress-range",ia);var na=30,Zu=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(2.18 19.87)">${na}</text><path d="M10 6V3L4.37 7 10 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 10 6Z"/></svg>`,qs=X.createElement("template");qs.innerHTML=`
|
|
680
|
+
<slot name="backward">${Zu}</slot>
|
|
681
|
+
`;var Ju=0,Zs=r=>{let t=Math.abs(+r.getAttribute("seek-offset")),e=Be.SEEK_BACK_N_SECS({seekOffset:t});r.setAttribute("aria-label",e)},Js=r=>{let t=Ei(r,"backward"),e=r.getAttribute("seek-offset");pi(t,e)},aa=class extends He{static get observedAttributes(){return[...super.observedAttributes,K.MEDIA_CURRENT_TIME]}constructor(t={}){super({slotTemplate:qs,...t})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",na),Zs(this),Js(this),super.connectedCallback()}attributeChangedCallback(t,e,a){t==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",na),Js(this),Zs(this)),super.attributeChangedCallback(t,e,a)}handleClick(){let t=this.getAttribute(K.MEDIA_CURRENT_TIME),e=+this.getAttribute("seek-offset"),a=t&&!Number.isNaN(+t)?+t:Ju,n=Math.max(a-e,0),u=new ee.CustomEvent(oe.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:n});this.dispatchEvent(u)}};le("media-seek-backward-button",aa);var sa=class extends Mt{static get observedAttributes(){return[...super.observedAttributes,K.MEDIA_PREVIEW_TIME]}attributeChangedCallback(t,e,a){t===K.MEDIA_PREVIEW_TIME&&a!=null&&(this.container.textContent=ct(a)),super.attributeChangedCallback(t,e,a)}};le("media-preview-time-display",sa);var eo=X.createElement("template");eo.innerHTML=`
|
|
682
682
|
<style>
|
|
683
683
|
:host {
|
|
684
684
|
box-sizing: border-box;
|
|
@@ -692,7 +692,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
692
692
|
}
|
|
693
693
|
</style>
|
|
694
694
|
<img crossorigin loading="eager" decoding="async" />
|
|
695
|
-
`;var
|
|
695
|
+
`;var oa=class extends ee.HTMLElement{static get observedAttributes(){return[K.MEDIA_CONTROLLER,"time",K.MEDIA_PREVIEW_IMAGE,K.MEDIA_PREVIEW_COORDS]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(eo.content.cloneNode(!0))}connectedCallback(){var t;let e=this.getAttribute(K.MEDIA_CONTROLLER);if(e){let a=X.getElementById(e);(t=a==null?void 0:a.associateElement)==null||t.call(a,this)}}disconnectedCallback(){var t;let e=this.getAttribute(K.MEDIA_CONTROLLER);if(e){let a=X.getElementById(e);(t=a==null?void 0:a.unassociateElement)==null||t.call(a,this)}}attributeChangedCallback(t,e,a){var n,u;if(["time",K.MEDIA_PREVIEW_IMAGE,K.MEDIA_PREVIEW_COORDS].includes(t)&&this.update(),t===K.MEDIA_CONTROLLER){if(e){let M=X.getElementById(e);(n=M==null?void 0:M.unassociateElement)==null||n.call(M,this)}if(a){let M=X.getElementById(a);(u=M==null?void 0:M.associateElement)==null||u.call(M,this)}}}update(){let t=this.getAttribute(K.MEDIA_PREVIEW_COORDS),e=this.getAttribute(K.MEDIA_PREVIEW_IMAGE);if(!(t&&e))return;let[a,n,u,M]=t.split(/\s+/).map(s=>+s),y=e.split("#")[0],I=getComputedStyle(this),{maxWidth:x,maxHeight:A,minWidth:D,minHeight:R}=I,L=Math.min(parseInt(x)/u,parseInt(A)/M),T=Math.max(parseInt(D)/u,parseInt(R)/M),S=L<1,c=S?L:T>1?T:1,{style:i}=Tt(this.shadowRoot,":host"),f=Tt(this.shadowRoot,"img").style,m=this.shadowRoot.querySelector("img"),d=S?"min":"max";i.setProperty(`${d}-width`,"initial","important"),i.setProperty(`${d}-height`,"initial","important"),i.width=`${u*c}px`,i.height=`${M*c}px`;let l=()=>{f.width=`${this.imgWidth*c}px`,f.height=`${this.imgHeight*c}px`,f.display="block"};m.src!==y&&(m.onload=()=>{this.imgWidth=m.naturalWidth,this.imgHeight=m.naturalHeight,l()},m.src=y,l()),l(),f.transform=`translate(-${a*c}px, -${n*c}px)`}};le("media-preview-thumbnail",oa);var to=X.createElement("template"),qu=`
|
|
696
696
|
<svg aria-hidden="true" viewBox="0 0 100 100">
|
|
697
697
|
<path d="M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50">
|
|
698
698
|
<animateTransform
|
|
@@ -705,7 +705,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
705
705
|
repeatCount="indefinite" />
|
|
706
706
|
</path>
|
|
707
707
|
</svg>
|
|
708
|
-
`;
|
|
708
|
+
`;to.innerHTML=`
|
|
709
709
|
<style>
|
|
710
710
|
:host {
|
|
711
711
|
display: inline-block;
|
|
@@ -742,15 +742,15 @@ svg, img, ::slotted(svg), ::slotted(img) {
|
|
|
742
742
|
}
|
|
743
743
|
</style>
|
|
744
744
|
|
|
745
|
-
<slot name="loading">${
|
|
745
|
+
<slot name="loading">${qu}</slot>
|
|
746
746
|
<div id="status" role="status" aria-live="polite">${Ze.MEDIA_LOADING()}</div>
|
|
747
|
-
`;var
|
|
747
|
+
`;var ed=500,la=class extends ee.HTMLElement{static get observedAttributes(){return[K.MEDIA_CONTROLLER,K.MEDIA_PAUSED,K.MEDIA_LOADING,"loading-delay"]}constructor(){super();let t=this.attachShadow({mode:"open"}),e=to.content.cloneNode(!0);t.appendChild(e)}attributeChangedCallback(t,e,a){var n,u,M;if(t===K.MEDIA_LOADING||t===K.MEDIA_PAUSED){let y=this.getAttribute(K.MEDIA_PAUSED)!=null,I=this.getAttribute(K.MEDIA_LOADING)!=null,x=!y&&I;if(!x)this.loadingDelayHandle&&(clearTimeout(this.loadingDelayHandle),this.loadingDelayHandle=void 0),this.removeAttribute("is-loading");else if(!this.loadingDelayHandle&&x){let A=+((n=this.getAttribute("loading-delay"))!=null?n:ed);this.loadingDelayHandle=setTimeout(()=>{this.setAttribute("is-loading",""),this.loadingDelayHandle=void 0},A)}}else if(t===K.MEDIA_CONTROLLER){if(e){let y=X.getElementById(e);(u=y==null?void 0:y.unassociateElement)==null||u.call(y,this)}if(a){let y=X.getElementById(a);(M=y==null?void 0:y.associateElement)==null||M.call(y,this)}}}connectedCallback(){var t;let e=this.getAttribute(K.MEDIA_CONTROLLER);if(e){let a=X.getElementById(e);(t=a==null?void 0:a.associateElement)==null||t.call(a,this)}}disconnectedCallback(){var t;this.loadingDelayHandle&&(clearTimeout(this.loadingDelayHandle),this.loadingDelayHandle=void 0);let e=this.getAttribute(K.MEDIA_CONTROLLER);if(e){let a=X.getElementById(e);(t=a==null?void 0:a.unassociateElement)==null||t.call(a,this)}}};le("media-loading-indicator",la);var ro=X.createElement("template");ro.innerHTML=`
|
|
748
748
|
<style>
|
|
749
749
|
:host {
|
|
750
750
|
}
|
|
751
751
|
</style>
|
|
752
752
|
<slot></slot>
|
|
753
|
-
`;var la=class extends ee.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(to.content.cloneNode(!0))}};le("media-title-bar",la);var qu=100,ed=r=>{var t;if(r.getAttribute(K.MEDIA_MUTED)!=null)return 0;let a=+((t=r.getAttribute(K.MEDIA_VOLUME))!=null?t:1);return Math.round(a*r.range.max)},td=({value:r,max:t})=>`${Math.round(r/t*100)}%`,ua=class extends Hr{static get observedAttributes(){return[...super.observedAttributes,K.MEDIA_VOLUME,K.MEDIA_MUTED,K.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.max=qu,this.range.addEventListener("input",()=>{let e=this.range.value/this.range.max,a=new ee.CustomEvent(oe.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(a)})}connectedCallback(){this.range.setAttribute("aria-label",Ze.VOLUME()),super.connectedCallback()}attributeChangedCallback(t,e,a){if(t===K.MEDIA_VOLUME||t===K.MEDIA_MUTED){let n=ed(this);this.range.value=n,this.range.setAttribute("aria-valuetext",td(this.range)),this.updateBar()}super.attributeChangedCallback(t,e,a)}};le("media-volume-range",ua);var rd=Object.defineProperty,id=(r,t,e)=>t in r?rd(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,nd=(r,t,e)=>(id(r,typeof t!="symbol"?t+"":t,e),e),$r=class extends ee.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render()}render(){this.shadowRoot.textContent="";let t=X.createElement("template");t.innerHTML=this.constructor.template,this.shadowRoot.append(t.content.cloneNode(!0))}get mediaController(){return this.shadowRoot.querySelector("media-controller")}};nd($r,"template","");le("media-theme",$r);var da=$r;var ca=class extends Wr{};ee.customElements.get("media-chrome")||ee.customElements.define("media-chrome",ca);var fa=class extends Wr{constructor(){super(),console.warn("MediaChrome: <media-container> is deprecated. Use <media-controller>.")}};ee.customElements.get("media-container")||ee.customElements.define("media-container",fa);var Ta=vi(ro(),1),Kt=vi(Fi(),1),ga=vi(Fi(),1),fr=vi(Fi(),1),zr=class extends Error{constructor(r,t=zr.MEDIA_ERR_CUSTOM,e){var a;super(r),this.name="MediaError",this.code=t,this.fatal=e!=null?e:t>=zr.MEDIA_ERR_NETWORK&&t<=zr.MEDIA_ERR_ENCRYPTED,this.message||(this.message=(a=zr.defaultMessages[this.code])!=null?a:"")}},we=zr;we.MEDIA_ERR_ABORTED=1,we.MEDIA_ERR_NETWORK=2,we.MEDIA_ERR_DECODE=3,we.MEDIA_ERR_SRC_NOT_SUPPORTED=4,we.MEDIA_ERR_ENCRYPTED=5,we.MEDIA_ERR_CUSTOM=100,we.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail.",3:"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.",4:"An unsupported error occurred. The server or network failed, or your browser does not support this format.",5:"The media is encrypted and there are no keys to decrypt it."};var lo=(r,t)=>r in t,pa={ANY:"any",MUTED:"muted"},pe={VOD:"on-demand",ON_DEMAND:"on-demand",LIVE:"live",LL_LIVE:"ll-live",DVR:"live:dvr",LL_DVR:"ll-live:dvr"},at={MSE:"mse",NATIVE:"native"},hr={M3U8:"application/vnd.apple.mpegurl",MP4:"video/mp4"},Ea={HLS:hr.M3U8},ig=Object.keys(Ea),ng=[...Object.values(hr),"hls","HLS"],Xr=(r,t,e,a)=>{r.addEventListener(t,e,a),r.addEventListener("teardown",()=>{r.removeEventListener(t,e)},{once:!0})};function ad(r,t,e){t&&e>t&&(e=t);for(let a=0;a<r.length;a++)if(r.start(a)<=e&&r.end(a)>=e)return!0;return!1}var sd=r=>{let t=r.indexOf("?");if(t<0)return[r];let e=r.slice(0,t),a=r.slice(t);return[e,a]},uo=r=>{let t=r.type;if(t){let a=t.toUpperCase();return lo(a,Ea)?Ea[a]:t}let{src:e}=r;return e?od(e):""},od=r=>{let t="";try{t=new URL(r).pathname}catch{console.error("invalid url")}let e=t.lastIndexOf(".");if(e<0)return"";let a=t.slice(e+1).toUpperCase();return lo(a,hr)?hr[a]:""},ld=Object.values(pa),io=r=>typeof r=="boolean"||typeof r=="string"&&ld.includes(r),ud=({autoplay:r},t,e)=>{if(!t)return()=>{};let a=!1,n=!1,u=io(r)?r:!!r,M=()=>{a||Xr(t,"playing",()=>{a=!0},{once:!0})};if(M(),Xr(t,"loadstart",()=>{a=!1,M(),ma(t,u)},{once:!0}),Xr(t,"loadstart",()=>{e||(n=!Number.isFinite(t.duration)),ma(t,u)},{once:!0}),e&&e.once(ga.default.Events.LEVEL_LOADED,(y,I)=>{var x;n=(x=I.details.live)!=null?x:!1}),!u){let y=()=>{!n||(e!=null&&e.liveSyncPosition?t.currentTime=e.liveSyncPosition:Number.isFinite(t.seekable.end(0))&&(t.currentTime=t.seekable.end(0)))};e&&Xr(t,"play",()=>{t.preload==="metadata"?e.once(ga.default.Events.LEVEL_UPDATED,y):y()},{once:!0})}return y=>{a||(u=io(y)?y:!!y,ma(t,u))}},ma=(r,t)=>{if(!t)return;let e=r.muted,a=()=>r.muted=e;switch(t){case pa.ANY:r.play().catch(()=>{r.muted=!0,r.play().catch(a)});break;case pa.MUTED:r.muted=!0,r.play().catch(a);break;default:r.play().catch(()=>{});break}},dd=({preload:r,src:t},e,a)=>{if(!e)return()=>{};let n=D=>{D!=null&&["","none","metadata","auto"].includes(D)?e.setAttribute("preload",D):e.removeAttribute("preload")};if(!a)return n(r),n;let u=!1,M=!1,y=a.config.maxBufferLength,I=a.config.maxBufferSize,x=D=>{n(D);let R=D!=null?D:e.preload;M||R==="none"||(R==="metadata"?(a.config.maxBufferLength=1,a.config.maxBufferSize=1):(a.config.maxBufferLength=y,a.config.maxBufferSize=I),A())},A=()=>{!u&&t&&(u=!0,a.loadSource(t))};return Xr(e,"play",()=>{M=!0,a.config.maxBufferLength=y,a.config.maxBufferSize=I,A()},{once:!0}),x(r),x};function cd(r,t){t.on(fr.default.Events.NON_NATIVE_TEXT_TRACKS_FOUND,(n,{tracks:u})=>{u.forEach(M=>{var y;let I=(y=M.subtitleTrack)!=null?y:M.closedCaptions,x=t.subtitleTracks.findIndex(({lang:A,name:D,type:R})=>A==(I==null?void 0:I.lang)&&D===M.label&&R.toLowerCase()===M.kind);ba(r,M.kind,M.label,I==null?void 0:I.lang,`${M.kind}${x}`)})});let e=()=>{var n;if(!t.subtitleTracks.length)return;let u=Array.from(r.textTracks).find(y=>y.id&&y.mode==="showing"&&["subtitles","captions"].includes(y.kind)),M=`${(n=t.subtitleTracks[t.subtitleTrack])==null?void 0:n.type.toLowerCase()}${t.subtitleTrack}`;if(u&&(t.subtitleTrack<0||(u==null?void 0:u.id)!==M)){let y=t.subtitleTracks.findIndex(({lang:I,name:x,type:A})=>I==u.language&&x===u.label&&A.toLowerCase()===u.kind);t.subtitleTrack=y}u&&(u==null?void 0:u.id)===M&&u.cues&&Array.from(u.cues).forEach(y=>{u.addCue(y)})};r.textTracks.addEventListener("change",e),t.on(fr.default.Events.CUES_PARSED,(n,{track:u,cues:M})=>{let y=r.textTracks.getTrackById(u);if(!y)return;let I=y.mode==="disabled";I&&(y.mode="hidden"),M.forEach(x=>{var A;(A=y.cues)!=null&&A.getCueById(x.id)||y.addCue(x)}),I&&(y.mode="disabled")}),t.once(fr.default.Events.DESTROYING,()=>{r.textTracks.removeEventListener("change",e),r.querySelectorAll("track[data-removeondestroy]").forEach(n=>{n.remove()})});let a=()=>{Array.from(r.textTracks).forEach(n=>{var u,M;if(!["subtitles","caption"].includes(n.kind)&&n.label==="thumbnails"){if(!((u=n.cues)!=null&&u.length)){let y=r.querySelector('track[label="thumbnails"]'),I=(M=y==null?void 0:y.getAttribute("src"))!=null?M:"";y==null||y.removeAttribute("src"),setTimeout(()=>{y==null||y.setAttribute("src",I)},0)}n.mode!=="hidden"&&(n.mode="hidden")}})};t.once(fr.default.Events.MANIFEST_LOADED,a),t.once(fr.default.Events.MEDIA_ATTACHED,a)}function ba(r,t,e,a,n){let u=document.createElement("track");return u.kind=t,u.label=e,a&&(u.srclang=a),n&&(u.id=n),u.track.mode="disabled",u.setAttribute("data-removeondestroy",""),r.append(u),u.track}function co(r,t){let e=Array.prototype.find.call(r.querySelectorAll("track"),a=>a.track===t);e==null||e.remove()}var no,ao,fd=(ao=(no=globalThis==null?void 0:globalThis.navigator)==null?void 0:no.userAgent)!=null?ao:"",hd=fd.toLowerCase().indexOf("android")!==-1,vr=new WeakMap,fo="mux.com",so,oo,ho=(oo=(so=Kt.default).isSupported)==null?void 0:oo.call(so),vd=hd,vo=()=>Ta.default.utils.now(),mo=(r,{domain:t=fo}={})=>{if(!r)return;let[e,a=""]=sd(r);return`https://stream.${t}/${e}.m3u8${a}`},go=r=>{var t;return(t=vr.get(r))==null?void 0:t.error},po=(r,t,e)=>{Aa(t,e),vr.set(t,{});let a=md(r,t);Ed(r,t,a),yd(r,t,a);let n=ud(r,t,a),u=dd(r,t,a);return{engine:a,setAutoplay:n,setPreload:u}},Aa=(r,t)=>{let e=t==null?void 0:t.engine;e&&(e.detachMedia(),e.destroy()),(r==null?void 0:r.mux)&&!r.mux.deleted&&(r.mux.destroy(),delete r.mux),r&&(r.removeAttribute("src"),r.load(),r.removeEventListener("error",To),r.removeEventListener("error",ya),r.removeEventListener("durationchange",yo),vr.delete(r),r.dispatchEvent(new Event("teardown")))};function Eo(r,t){var e;let a=uo(r);if(a!==hr.M3U8)return!0;let n=!a||((e=t==null?void 0:t.canPlayType(a))!=null?e:!0),{preferPlayback:u}=r,M=u===at.MSE,y=u===at.NATIVE;return n&&(y||!(ho&&(M||vd)))}var md=(r,t)=>{let{debug:e,streamType:a,startTime:n=-1}=r,u=uo(r)===hr.M3U8,M=Eo(r,t);if(u&&!M&&ho){let y={backBufferLength:30,renderTextTracksNatively:!1,liveDurationInfinity:!0},I=gd(a);return new Kt.default({debug:e,startPosition:n,...y,...I})}},gd=r=>[pe.LIVE,pe.DVR].includes(r)?{backBufferLength:8}:[pe.LL_LIVE,pe.LL_DVR].includes(r)?{backBufferLength:4,maxFragLookUpTolerance:.001}:{},pd=({playbackId:r,src:t,customDomain:e})=>{if(r)return!0;if(typeof t!="string")return!1;let a=window==null?void 0:window.location.href,n=new URL(t,a).hostname.toLocaleLowerCase();return n.includes(fo)||!!e&&n.includes(e.toLocaleLowerCase())},Ed=(r,t,e)=>{let{envKey:a}=r,n=pd(r);if((a||n)&&t){let{playerInitTime:u,playerSoftwareName:M,playerSoftwareVersion:y,beaconCollectionDomain:I,metadata:x,debug:A}=r,D=R=>typeof R.player_error_code=="string"?!1:typeof r.errorTranslator=="function"?r.errorTranslator(R):R;Ta.default.monitor(t,{debug:A,beaconCollectionDomain:I,hlsjs:e,Hls:e?Kt.default:void 0,automaticErrorTracking:!1,errorTranslator:D,data:{...a?{env_key:a}:{},player_software_name:M,player_software:M,player_software_version:y,player_init_time:u,...x}})}},yd=(r,t,e)=>{var a;if(!t){console.warn("attempting to load media before mediaEl exists");return}let n=Eo(r,t),{src:u}=r;t&&n?(typeof u=="string"?(t.setAttribute("src",u),r.startTime&&(((a=vr.get(t))!=null?a:{}).startTime=r.startTime,t.addEventListener("durationchange",yo,{once:!0}))):t.removeAttribute("src"),t.addEventListener("error",To),t.addEventListener("error",ya)):e&&u?(e.on(Kt.default.Events.ERROR,(M,y)=>{let I={[Kt.default.ErrorTypes.NETWORK_ERROR]:we.MEDIA_ERR_NETWORK,[Kt.default.ErrorTypes.MEDIA_ERROR]:we.MEDIA_ERR_DECODE},x=new we("",I[y.type]);x.fatal=y.fatal,x.data=y,t.dispatchEvent(new CustomEvent("error",{detail:x}))}),t.addEventListener("error",ya),cd(t,e),e.attachMedia(t)):console.error("It looks like the video you're trying to play will not work on this system! If possible, try upgrading to the newest versions of your browser or software.")};function yo(r){var t;let e=r.target,a=(t=vr.get(e))==null?void 0:t.startTime;if(!!a&&ad(e.seekable,e.duration,a)){let n=e.preload==="auto";n&&(e.preload="none"),e.currentTime=a,n&&(e.preload="auto")}}async function To(r){if(!r.isTrusted)return;r.stopImmediatePropagation();let t=r.target;if(!(t!=null&&t.error))return;let{message:e,code:a}=t.error,n=new we(e,a);if(t.src&&(a!==we.MEDIA_ERR_DECODE||a!==void 0))try{let{status:u}=await fetch(t.src);n.data={response:{code:u}}}catch{}t.dispatchEvent(new CustomEvent("error",{detail:n}))}function ya(r){var t,e;if(!(r instanceof CustomEvent)||!(r.detail instanceof we))return;let a=r.target,n=r.detail;!n||!n.fatal||(((t=vr.get(a))!=null?t:{}).error=n,(e=a.mux)==null||e.emit("error",{player_error_code:n.code,player_error_message:n.message}))}var Td=Object.defineProperty,bd=(r,t,e)=>t in r?Td(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Bi=(r,t,e)=>(bd(r,typeof t!="symbol"?t+"":t,e),e),xa=(r,t,e)=>{if(!t.has(r))throw TypeError("Cannot "+e)},ue=(r,t,e)=>(xa(r,t,"read from private field"),e?e.call(r):t.get(r)),De=(r,t,e)=>{if(t.has(r))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(r):t.set(r,e)},et=(r,t,e,a)=>(xa(r,t,"write to private field"),a?a.call(r,e):t.set(r,e),e),$e=(r,t,e)=>(xa(r,t,"access private method"),e),Gi=class{addEventListener(){}removeEventListener(){}dispatchEvent(r){return!0}};if(typeof DocumentFragment=="undefined"){class r extends Gi{}globalThis.DocumentFragment=r}var La=class extends Gi{},Ad=class extends Gi{},_d={get(r){},define(r,t,e){},upgrade(r){},whenDefined(r){return Promise.resolve(La)}},Ki,Sd=class{constructor(r,t={}){De(this,Ki,void 0),et(this,Ki,t==null?void 0:t.detail)}get detail(){return ue(this,Ki)}initCustomEvent(){}};Ki=new WeakMap;function xd(r,t){return new La}var Ao={document:{createElement:xd},DocumentFragment,customElements:_d,CustomEvent:Sd,EventTarget:Gi,HTMLElement:La,HTMLVideoElement:Ad},_o=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Rt=_o?Ao:globalThis,So=_o?Ao.document:globalThis.document,Ld=()=>{try{return"0.9.1"}catch{}return"UNKNOWN"},Dd=Ld(),Id=()=>Dd,Md=r=>{var t,e,a,n,u,M,y,I,x,A,D,R,L,T,S,c,i,f,m,d,l,s,v,p,o,E,g,h,b,_,O,C,P,w,U,k,N,F,H,W;return t=class extends r{constructor(){super(),De(this,g),De(this,b),De(this,O),De(this,P),De(this,U),De(this,N),De(this,H),Bi(this,"castEnabled",!1),De(this,l,{paused:!1}),De(this,s,void 0),De(this,v,{}),De(this,p,void 0),De(this,o,void 0),De(this,E,void 0),t.instances.add(this),$e(this,U,k).call(this)}static get castElement(){return ue(t,e)}static get castEnabled(){return ue(t,a)}static get castState(){var B;return(B=ue(t,x,A))==null?void 0:B.getCastState()}static async exitCast(){try{await ue(t,x,A).endCurrentSession(!0)}catch(B){console.error(B);return}}get castPlayer(){if(t.castElement===this)return ue(this,s)}attributeChangedCallback(B){if(this.castPlayer)switch(B){case"cast-stream-type":case"cast-src":this.load();break}}async requestCast(B={}){var j;$e(j=t,m,d).call(j,B),et(t,e,this),Object.entries(ue(this,v)).forEach(([V,Y])=>{ue(this,s).controller.addEventListener(V,Y)});try{await ue(t,x,A).requestSession()}catch{et(t,e,void 0);return}ue(this,l).paused=super.paused,super.pause(),this.muted=super.muted;try{await this.load()}catch(V){console.error(V)}}async load(){var B,j;if(!this.castPlayer)return super.load();let V=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType),Y=[...this.querySelectorAll("track")].filter(({kind:te,src:se})=>se&&(te==="subtitles"||te==="captions")),Q=[],J=0;Y.length&&(V.tracks=Y.map(te=>{let se=++J;Q.length===0&&te.track.mode==="showing"&&Q.push(se);let Z=new chrome.cast.media.Track(se,chrome.cast.media.TrackType.TEXT);return Z.trackContentId=te.src,Z.trackContentType="text/vtt",Z.subtype=te.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,Z.name=te.label,Z.language=te.srclang,Z})),this.castStreamType==="live"?V.streamType=chrome.cast.media.StreamType.LIVE:V.streamType=chrome.cast.media.StreamType.BUFFERED,V.metadata=new chrome.cast.media.GenericMediaMetadata,V.metadata.title=this.title,V.metadata.images=[{url:this.poster}];let z=new chrome.cast.media.LoadRequest(V);z.currentTime=(B=super.currentTime)!=null?B:0,z.autoplay=!ue(this,l).paused,z.activeTrackIds=Q,await((j=ue(t,D,R))==null?void 0:j.loadMedia(z)),this.dispatchEvent(new Event("volumechange"))}play(){var B;if(this.castPlayer){this.castPlayer.isPaused&&((B=this.castPlayer.controller)==null||B.playOrPause());return}return super.play()}pause(){var B;if(this.castPlayer){this.castPlayer.isPaused||(B=this.castPlayer.controller)==null||B.playOrPause();return}super.pause()}get castSrc(){var B,j,V;return(V=(j=this.getAttribute("cast-src"))!=null?j:(B=this.querySelector("source"))==null?void 0:B.src)!=null?V:this.currentSrc}set castSrc(B){this.castSrc!=B&&this.setAttribute("cast-src",`${B}`)}get castContentType(){var B;return(B=this.getAttribute("cast-content-type"))!=null?B:void 0}set castContentType(B){this.setAttribute("cast-content-type",`${B}`)}get castStreamType(){var B;return(B=this.getAttribute("cast-stream-type"))!=null?B:void 0}set castStreamType(B){this.setAttribute("cast-stream-type",`${B}`)}get readyState(){if(this.castPlayer)switch(this.castPlayer.playerState){case chrome.cast.media.PlayerState.IDLE:return 0;case chrome.cast.media.PlayerState.BUFFERING:return 2;default:return 3}return super.readyState}get paused(){return this.castPlayer?this.castPlayer.isPaused:super.paused}get muted(){var B;return this.castPlayer?(B=this.castPlayer)==null?void 0:B.isMuted:super.muted}set muted(B){var j;if(this.castPlayer){(B&&!this.castPlayer.isMuted||!B&&this.castPlayer.isMuted)&&((j=this.castPlayer.controller)==null||j.muteOrUnmute());return}super.muted=B}get volume(){var B,j;return this.castPlayer?(j=(B=this.castPlayer)==null?void 0:B.volumeLevel)!=null?j:1:super.volume}set volume(B){var j;if(this.castPlayer){this.castPlayer.volumeLevel=B,(j=this.castPlayer.controller)==null||j.setVolumeLevel();return}super.volume=B}get duration(){var B,j;return this.castPlayer&&ue(this,g,h)?(j=(B=this.castPlayer)==null?void 0:B.duration)!=null?j:NaN:super.duration}get currentTime(){var B,j;return this.castPlayer&&ue(this,g,h)?(j=(B=this.castPlayer)==null?void 0:B.currentTime)!=null?j:0:super.currentTime}set currentTime(B){var j;if(this.castPlayer){this.castPlayer.currentTime=B,(j=this.castPlayer.controller)==null||j.seek();return}super.currentTime=B}get onentercast(){return ue(this,p)}set onentercast(B){ue(this,p)&&(this.removeEventListener("entercast",ue(this,p)),et(this,p,null)),typeof B=="function"&&(et(this,p,B),this.addEventListener("entercast",B))}get onleavecast(){return ue(this,o)}set onleavecast(B){ue(this,o)&&(this.removeEventListener("leavecast",ue(this,o)),et(this,o,null)),typeof B=="function"&&(et(this,o,B),this.addEventListener("leavecast",B))}get oncastchange(){return ue(this,E)}set oncastchange(B){ue(this,E)&&(this.removeEventListener("castchange",ue(this,E)),et(this,E,null)),typeof B=="function"&&(et(this,E,B),this.addEventListener("castchange",B))}},e=new WeakMap,a=new WeakMap,n=new WeakMap,u=new WeakSet,M=function(){return typeof chrome!="undefined"&&chrome.cast&&chrome.cast.isAvailable},y=new WeakSet,I=function(){return typeof cast!="undefined"&&cast.framework},x=new WeakSet,A=function(){if(ue(t,y,I))return cast.framework.CastContext.getInstance()},D=new WeakSet,R=function(){var B;return(B=ue(t,x,A))==null?void 0:B.getCurrentSession()},L=new WeakSet,T=function(){var B;return(B=ue(t,D,R))==null?void 0:B.getSessionObj().media[0]},S=new WeakSet,c=function(B){return new Promise((j,V)=>{ue(t,L,T).editTracksInfo(B,j,V)})},i=new WeakSet,f=function(B){return new Promise((j,V)=>{ue(t,L,T).getStatus(B,j,V)})},m=new WeakSet,d=function(B){return ue(t,x,A).setOptions({receiverApplicationId:chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,autoJoinPolicy:chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0,...B})},l=new WeakMap,s=new WeakMap,v=new WeakMap,p=new WeakMap,o=new WeakMap,E=new WeakMap,g=new WeakSet,h=function(){var B;return(B=this.castPlayer)==null?void 0:B.isMediaLoaded},b=new WeakSet,_=function(){ue(t,e)===this&&(Object.entries(ue(this,v)).forEach(([B,j])=>{ue(this,s).controller.removeEventListener(B,j)}),et(t,e,void 0),this.muted=ue(this,s).isMuted,this.currentTime=ue(this,s).savedPlayerState.currentTime,ue(this,s).savedPlayerState.isPaused===!1&&this.play())},O=new WeakSet,C=function(){this.dispatchEvent(new CustomEvent("castchange",{detail:ue(t,x,A).getCastState()}))},P=new WeakSet,w=async function(){var B,j;let{SESSION_RESUMED:V}=cast.framework.SessionState;if(ue(t,x,A).getSessionState()===V&&this.castSrc===((B=ue(t,L,T))==null?void 0:B.media.contentId)){et(t,e,this),Object.entries(ue(this,v)).forEach(([Y,Q])=>{ue(this,s).controller.addEventListener(Y,Q)});try{await $e(j=t,i,f).call(j,new chrome.cast.media.GetStatusRequest)}catch(Y){console.error(Y)}ue(this,v)[cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED](),ue(this,v)[cast.framework.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},U=new WeakSet,k=function(){var B;!ue(t,y,I)||this.castEnabled||(this.castEnabled=!0,$e(B=t,m,d).call(B),this.textTracks.addEventListener("change",$e(this,H,W).bind(this)),$e(this,O,C).call(this),et(this,s,new cast.framework.RemotePlayer),new cast.framework.RemotePlayerController(ue(this,s)),et(this,v,{[cast.framework.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:j})=>{j===!1&&$e(this,b,_).call(this),this.dispatchEvent(new Event(j?"entercast":"leavecast"))},[cast.framework.RemotePlayerEventType.DURATION_CHANGED]:()=>{this.dispatchEvent(new Event("durationchange"))},[cast.framework.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{this.dispatchEvent(new Event("volumechange"))},[cast.framework.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{this.dispatchEvent(new Event("volumechange"))},[cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{!ue(this,g,h)||this.dispatchEvent(new Event("timeupdate"))},[cast.framework.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{this.dispatchEvent(new Event("resize"))},[cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{this.dispatchEvent(new Event(this.paused?"pause":"play"))},[cast.framework.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var j,V;((j=this.castPlayer)==null?void 0:j.playerState)!==chrome.cast.media.PlayerState.PAUSED&&this.dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(V=this.castPlayer)==null?void 0:V.playerState]))},[cast.framework.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{!ue(this,g,h)||(await Promise.resolve(),$e(this,N,F).call(this))}}))},N=new WeakSet,F=function(){$e(this,H,W).call(this)},H=new WeakSet,W=async function(){var B,j,V,Y,Q,J;if(!this.castPlayer)return;let z=((j=(B=ue(this,s).mediaInfo)==null?void 0:B.tracks)!=null?j:[]).filter(({type:q})=>q===chrome.cast.media.TrackType.TEXT),te=[...this.textTracks].filter(({kind:q})=>q==="subtitles"||q==="captions"),se=z.map(({language:q,name:ie,trackId:ne})=>{var Te;let{mode:Se}=(Te=te.find(he=>he.language===q&&he.label===ie))!=null?Te:{};return Se?{mode:Se,trackId:ne}:!1}).filter(Boolean),Z=se.filter(({mode:q})=>q!=="showing").map(({trackId:q})=>q),Ee=se.find(({mode:q})=>q==="showing"),fe=(Q=(Y=(V=ue(t,D,R))==null?void 0:V.getSessionObj().media[0])==null?void 0:Y.activeTrackIds)!=null?Q:[],re=fe;if(fe.length&&(re=re.filter(q=>!Z.includes(q))),Ee!=null&&Ee.trackId&&(re=[...re,Ee.trackId]),re=[...new Set(re)],!((q,ie)=>q.length===ie.length&&q.every(ne=>ie.includes(ne)))(fe,re))try{let q=new chrome.cast.media.EditTracksInfoRequest(re);await $e(J=t,S,c).call(J,q)}catch(q){console.error(q)}},De(t,u),De(t,y),De(t,x),De(t,D),De(t,L),De(t,S),De(t,i),De(t,m),Bi(t,"observedAttributes",["cast-src","cast-content-type","cast-stream-type"]),Bi(t,"instances",new Set),De(t,e,void 0),De(t,a,!1),Bi(t,"initCast",()=>{var B;ue(t,u,M)?ue(t,y,I)?ue(B=t,n).call(B,chrome.cast.isAvailable):customElements.whenDefined("google-cast-button").then(()=>{var j;return ue(j=t,n).call(j,chrome.cast.isAvailable)}):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(()=>{var j;return ue(j=t,n).call(j,chrome.cast.isAvailable)})}}),De(t,n,B=>{if(B){et(t,a,!0);let{CAST_STATE_CHANGED:j}=cast.framework.CastContextEventType;ue(t,x,A).addEventListener(j,Y=>{t.instances.forEach(Q=>{var J;return $e(J=Q,O,C).call(J,Y)})});let{SESSION_STATE_CHANGED:V}=cast.framework.CastContextEventType;ue(t,x,A).addEventListener(V,Y=>{t.instances.forEach(Q=>{var J;return $e(J=Q,P,w).call(J,Y)})}),t.instances.forEach(Y=>{var Q;return $e(Q=Y,U,k).call(Q)})}}),t};if(globalThis.HTMLVideoElement&&globalThis.customElements){let r=Md(HTMLVideoElement);globalThis.customElements.get("castable-video")||(globalThis.customElements.define("castable-video",r,{extends:"video"}),globalThis.CastableVideoElement=r),r.initCast()}var Da=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","waitingforkey","resize","enterpictureinpicture","leavepictureinpicture","castchange","entercast","leavecast"],xo=So.createElement("template");xo.innerHTML=`
|
|
753
|
+
`;var ua=class extends ee.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(ro.content.cloneNode(!0))}};le("media-title-bar",ua);var td=100,rd=r=>{var t;if(r.getAttribute(K.MEDIA_MUTED)!=null)return 0;let a=+((t=r.getAttribute(K.MEDIA_VOLUME))!=null?t:1);return Math.round(a*r.range.max)},id=({value:r,max:t})=>`${Math.round(r/t*100)}%`,da=class extends Hr{static get observedAttributes(){return[...super.observedAttributes,K.MEDIA_VOLUME,K.MEDIA_MUTED,K.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.max=td,this.range.addEventListener("input",()=>{let e=this.range.value/this.range.max,a=new ee.CustomEvent(oe.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(a)})}connectedCallback(){this.range.setAttribute("aria-label",Ze.VOLUME()),super.connectedCallback()}attributeChangedCallback(t,e,a){if(t===K.MEDIA_VOLUME||t===K.MEDIA_MUTED){let n=rd(this);this.range.value=n,this.range.setAttribute("aria-valuetext",id(this.range)),this.updateBar()}super.attributeChangedCallback(t,e,a)}};le("media-volume-range",da);var nd=Object.defineProperty,ad=(r,t,e)=>t in r?nd(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,sd=(r,t,e)=>(ad(r,typeof t!="symbol"?t+"":t,e),e),$r=class extends ee.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render()}render(){this.shadowRoot.textContent="";let t=X.createElement("template");t.innerHTML=this.constructor.template,this.shadowRoot.append(t.content.cloneNode(!0))}get mediaController(){return this.shadowRoot.querySelector("media-controller")}};sd($r,"template","");le("media-theme",$r);var ca=$r;var fa=class extends Wr{};ee.customElements.get("media-chrome")||ee.customElements.define("media-chrome",fa);var ha=class extends Wr{constructor(){super(),console.warn("MediaChrome: <media-container> is deprecated. Use <media-controller>.")}};ee.customElements.get("media-container")||ee.customElements.define("media-container",ha);var ba=vi(io(),1),Wt=vi(Fi(),1),pa=vi(Fi(),1),hr=vi(Fi(),1),zr=class extends Error{constructor(r,t=zr.MEDIA_ERR_CUSTOM,e){var a;super(r),this.name="MediaError",this.code=t,this.fatal=e!=null?e:t>=zr.MEDIA_ERR_NETWORK&&t<=zr.MEDIA_ERR_ENCRYPTED,this.message||(this.message=(a=zr.defaultMessages[this.code])!=null?a:"")}},we=zr;we.MEDIA_ERR_ABORTED=1,we.MEDIA_ERR_NETWORK=2,we.MEDIA_ERR_DECODE=3,we.MEDIA_ERR_SRC_NOT_SUPPORTED=4,we.MEDIA_ERR_ENCRYPTED=5,we.MEDIA_ERR_CUSTOM=100,we.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail.",3:"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.",4:"An unsupported error occurred. The server or network failed, or your browser does not support this format.",5:"The media is encrypted and there are no keys to decrypt it."};var uo=(r,t)=>r in t,Ea={ANY:"any",MUTED:"muted"},pe={VOD:"on-demand",ON_DEMAND:"on-demand",LIVE:"live",LL_LIVE:"ll-live",DVR:"live:dvr",LL_DVR:"ll-live:dvr"},at={MSE:"mse",NATIVE:"native"},vr={M3U8:"application/vnd.apple.mpegurl",MP4:"video/mp4"},ya={HLS:vr.M3U8},ag=Object.keys(ya),sg=[...Object.values(vr),"hls","HLS"],Xr=(r,t,e,a)=>{r.addEventListener(t,e,a),r.addEventListener("teardown",()=>{r.removeEventListener(t,e)},{once:!0})};function od(r,t,e){t&&e>t&&(e=t);for(let a=0;a<r.length;a++)if(r.start(a)<=e&&r.end(a)>=e)return!0;return!1}var ld=r=>{let t=r.indexOf("?");if(t<0)return[r];let e=r.slice(0,t),a=r.slice(t);return[e,a]},co=r=>{let t=r.type;if(t){let a=t.toUpperCase();return uo(a,ya)?ya[a]:t}let{src:e}=r;return e?ud(e):""},ud=r=>{let t="";try{t=new URL(r).pathname}catch{console.error("invalid url")}let e=t.lastIndexOf(".");if(e<0)return"";let a=t.slice(e+1).toUpperCase();return uo(a,vr)?vr[a]:""},dd=Object.values(Ea),no=r=>typeof r=="boolean"||typeof r=="string"&&dd.includes(r),cd=({autoplay:r},t,e)=>{if(!t)return()=>{};let a=!1,n=!1,u=no(r)?r:!!r,M=()=>{a||Xr(t,"playing",()=>{a=!0},{once:!0})};if(M(),Xr(t,"loadstart",()=>{a=!1,M(),ga(t,u)},{once:!0}),Xr(t,"loadstart",()=>{e||(n=!Number.isFinite(t.duration)),ga(t,u)},{once:!0}),e&&e.once(pa.default.Events.LEVEL_LOADED,(y,I)=>{var x;n=(x=I.details.live)!=null?x:!1}),!u){let y=()=>{!n||(e!=null&&e.liveSyncPosition?t.currentTime=e.liveSyncPosition:Number.isFinite(t.seekable.end(0))&&(t.currentTime=t.seekable.end(0)))};e&&Xr(t,"play",()=>{t.preload==="metadata"?e.once(pa.default.Events.LEVEL_UPDATED,y):y()},{once:!0})}return y=>{a||(u=no(y)?y:!!y,ga(t,u))}},ga=(r,t)=>{if(!t)return;let e=r.muted,a=()=>r.muted=e;switch(t){case Ea.ANY:r.play().catch(()=>{r.muted=!0,r.play().catch(a)});break;case Ea.MUTED:r.muted=!0,r.play().catch(a);break;default:r.play().catch(()=>{});break}},fd=({preload:r,src:t},e,a)=>{if(!e)return()=>{};let n=D=>{D!=null&&["","none","metadata","auto"].includes(D)?e.setAttribute("preload",D):e.removeAttribute("preload")};if(!a)return n(r),n;let u=!1,M=!1,y=a.config.maxBufferLength,I=a.config.maxBufferSize,x=D=>{n(D);let R=D!=null?D:e.preload;M||R==="none"||(R==="metadata"?(a.config.maxBufferLength=1,a.config.maxBufferSize=1):(a.config.maxBufferLength=y,a.config.maxBufferSize=I),A())},A=()=>{!u&&t&&(u=!0,a.loadSource(t))};return Xr(e,"play",()=>{M=!0,a.config.maxBufferLength=y,a.config.maxBufferSize=I,A()},{once:!0}),x(r),x};function hd(r,t){t.on(hr.default.Events.NON_NATIVE_TEXT_TRACKS_FOUND,(n,{tracks:u})=>{u.forEach(M=>{var y;let I=(y=M.subtitleTrack)!=null?y:M.closedCaptions,x=t.subtitleTracks.findIndex(({lang:A,name:D,type:R})=>A==(I==null?void 0:I.lang)&&D===M.label&&R.toLowerCase()===M.kind);Aa(r,M.kind,M.label,I==null?void 0:I.lang,`${M.kind}${x}`)})});let e=()=>{var n;if(!t.subtitleTracks.length)return;let u=Array.from(r.textTracks).find(y=>y.id&&y.mode==="showing"&&["subtitles","captions"].includes(y.kind)),M=`${(n=t.subtitleTracks[t.subtitleTrack])==null?void 0:n.type.toLowerCase()}${t.subtitleTrack}`;if(u&&(t.subtitleTrack<0||(u==null?void 0:u.id)!==M)){let y=t.subtitleTracks.findIndex(({lang:I,name:x,type:A})=>I==u.language&&x===u.label&&A.toLowerCase()===u.kind);t.subtitleTrack=y}u&&(u==null?void 0:u.id)===M&&u.cues&&Array.from(u.cues).forEach(y=>{u.addCue(y)})};r.textTracks.addEventListener("change",e),t.on(hr.default.Events.CUES_PARSED,(n,{track:u,cues:M})=>{let y=r.textTracks.getTrackById(u);if(!y)return;let I=y.mode==="disabled";I&&(y.mode="hidden"),M.forEach(x=>{var A;(A=y.cues)!=null&&A.getCueById(x.id)||y.addCue(x)}),I&&(y.mode="disabled")}),t.once(hr.default.Events.DESTROYING,()=>{r.textTracks.removeEventListener("change",e),r.querySelectorAll("track[data-removeondestroy]").forEach(n=>{n.remove()})});let a=()=>{Array.from(r.textTracks).forEach(n=>{var u,M;if(!["subtitles","caption"].includes(n.kind)&&n.label==="thumbnails"){if(!((u=n.cues)!=null&&u.length)){let y=r.querySelector('track[label="thumbnails"]'),I=(M=y==null?void 0:y.getAttribute("src"))!=null?M:"";y==null||y.removeAttribute("src"),setTimeout(()=>{y==null||y.setAttribute("src",I)},0)}n.mode!=="hidden"&&(n.mode="hidden")}})};t.once(hr.default.Events.MANIFEST_LOADED,a),t.once(hr.default.Events.MEDIA_ATTACHED,a)}function Aa(r,t,e,a,n){let u=document.createElement("track");return u.kind=t,u.label=e,a&&(u.srclang=a),n&&(u.id=n),u.track.mode="disabled",u.setAttribute("data-removeondestroy",""),r.append(u),u.track}function fo(r,t){let e=Array.prototype.find.call(r.querySelectorAll("track"),a=>a.track===t);e==null||e.remove()}var ao,so,vd=(so=(ao=globalThis==null?void 0:globalThis.navigator)==null?void 0:ao.userAgent)!=null?so:"",md=vd.toLowerCase().indexOf("android")!==-1,mr=new WeakMap,ho="mux.com",oo,lo,vo=(lo=(oo=Wt.default).isSupported)==null?void 0:lo.call(oo),gd=md,mo=()=>ba.default.utils.now(),go=(r,{domain:t=ho}={})=>{if(!r)return;let[e,a=""]=ld(r);return`https://stream.${t}/${e}.m3u8${a}`},po=r=>{var t;return(t=mr.get(r))==null?void 0:t.error},Eo=(r,t,e)=>{_a(t,e),mr.set(t,{});let a=pd(r,t);Td(r,t,a),bd(r,t,a);let n=cd(r,t,a),u=fd(r,t,a);return{engine:a,setAutoplay:n,setPreload:u}},_a=(r,t)=>{let e=t==null?void 0:t.engine;e&&(e.detachMedia(),e.destroy()),(r==null?void 0:r.mux)&&!r.mux.deleted&&(r.mux.destroy(),delete r.mux),r&&(r.removeAttribute("src"),r.load(),r.removeEventListener("error",bo),r.removeEventListener("error",Ta),r.removeEventListener("durationchange",To),mr.delete(r),r.dispatchEvent(new Event("teardown")))};function yo(r,t){var e;let a=co(r);if(a!==vr.M3U8)return!0;let n=!a||((e=t==null?void 0:t.canPlayType(a))!=null?e:!0),{preferPlayback:u}=r,M=u===at.MSE,y=u===at.NATIVE;return n&&(y||!(vo&&(M||gd)))}var pd=(r,t)=>{let{debug:e,streamType:a,startTime:n=-1}=r,u=co(r)===vr.M3U8,M=yo(r,t);if(u&&!M&&vo){let y={backBufferLength:30,renderTextTracksNatively:!1,liveDurationInfinity:!0},I=Ed(a);return new Wt.default({debug:e,startPosition:n,...y,...I})}},Ed=r=>[pe.LIVE,pe.DVR].includes(r)?{backBufferLength:8}:[pe.LL_LIVE,pe.LL_DVR].includes(r)?{backBufferLength:4,maxFragLookUpTolerance:.001}:{},yd=({playbackId:r,src:t,customDomain:e})=>{if(r)return!0;if(typeof t!="string")return!1;let a=window==null?void 0:window.location.href,n=new URL(t,a).hostname.toLocaleLowerCase();return n.includes(ho)||!!e&&n.includes(e.toLocaleLowerCase())},Td=(r,t,e)=>{let{envKey:a}=r,n=yd(r);if((a||n)&&t){let{playerInitTime:u,playerSoftwareName:M,playerSoftwareVersion:y,beaconCollectionDomain:I,metadata:x,debug:A}=r,D=R=>typeof R.player_error_code=="string"?!1:typeof r.errorTranslator=="function"?r.errorTranslator(R):R;ba.default.monitor(t,{debug:A,beaconCollectionDomain:I,hlsjs:e,Hls:e?Wt.default:void 0,automaticErrorTracking:!1,errorTranslator:D,data:{...a?{env_key:a}:{},player_software_name:M,player_software:M,player_software_version:y,player_init_time:u,...x}})}},bd=(r,t,e)=>{var a;if(!t){console.warn("attempting to load media before mediaEl exists");return}let n=yo(r,t),{src:u}=r;t&&n?(typeof u=="string"?(t.setAttribute("src",u),r.startTime&&(((a=mr.get(t))!=null?a:{}).startTime=r.startTime,t.addEventListener("durationchange",To,{once:!0}))):t.removeAttribute("src"),t.addEventListener("error",bo),t.addEventListener("error",Ta)):e&&u?(e.on(Wt.default.Events.ERROR,(M,y)=>{let I={[Wt.default.ErrorTypes.NETWORK_ERROR]:we.MEDIA_ERR_NETWORK,[Wt.default.ErrorTypes.MEDIA_ERROR]:we.MEDIA_ERR_DECODE},x=new we("",I[y.type]);x.fatal=y.fatal,x.data=y,t.dispatchEvent(new CustomEvent("error",{detail:x}))}),t.addEventListener("error",Ta),hd(t,e),e.attachMedia(t)):console.error("It looks like the video you're trying to play will not work on this system! If possible, try upgrading to the newest versions of your browser or software.")};function To(r){var t;let e=r.target,a=(t=mr.get(e))==null?void 0:t.startTime;if(!!a&&od(e.seekable,e.duration,a)){let n=e.preload==="auto";n&&(e.preload="none"),e.currentTime=a,n&&(e.preload="auto")}}async function bo(r){if(!r.isTrusted)return;r.stopImmediatePropagation();let t=r.target;if(!(t!=null&&t.error))return;let{message:e,code:a}=t.error,n=new we(e,a);if(t.src&&(a!==we.MEDIA_ERR_DECODE||a!==void 0))try{let{status:u}=await fetch(t.src);n.data={response:{code:u}}}catch{}t.dispatchEvent(new CustomEvent("error",{detail:n}))}function Ta(r){var t,e;if(!(r instanceof CustomEvent)||!(r.detail instanceof we))return;let a=r.target,n=r.detail;!n||!n.fatal||(((t=mr.get(a))!=null?t:{}).error=n,(e=a.mux)==null||e.emit("error",{player_error_code:n.code,player_error_message:n.message}))}var Ad=Object.defineProperty,_d=(r,t,e)=>t in r?Ad(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Bi=(r,t,e)=>(_d(r,typeof t!="symbol"?t+"":t,e),e),La=(r,t,e)=>{if(!t.has(r))throw TypeError("Cannot "+e)},ue=(r,t,e)=>(La(r,t,"read from private field"),e?e.call(r):t.get(r)),De=(r,t,e)=>{if(t.has(r))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(r):t.set(r,e)},et=(r,t,e,a)=>(La(r,t,"write to private field"),a?a.call(r,e):t.set(r,e),e),$e=(r,t,e)=>(La(r,t,"access private method"),e),Gi=class{addEventListener(){}removeEventListener(){}dispatchEvent(r){return!0}};if(typeof DocumentFragment=="undefined"){class r extends Gi{}globalThis.DocumentFragment=r}var Da=class extends Gi{},Sd=class extends Gi{},xd={get(r){},define(r,t,e){},upgrade(r){},whenDefined(r){return Promise.resolve(Da)}},Ki,Ld=class{constructor(r,t={}){De(this,Ki,void 0),et(this,Ki,t==null?void 0:t.detail)}get detail(){return ue(this,Ki)}initCustomEvent(){}};Ki=new WeakMap;function Dd(r,t){return new Da}var _o={document:{createElement:Dd},DocumentFragment,customElements:xd,CustomEvent:Ld,EventTarget:Gi,HTMLElement:Da,HTMLVideoElement:Sd},So=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Rt=So?_o:globalThis,xo=So?_o.document:globalThis.document,Id=()=>{try{return"0.9.1"}catch{}return"UNKNOWN"},Md=Id(),Rd=()=>Md,Od=r=>{var t,e,a,n,u,M,y,I,x,A,D,R,L,T,S,c,i,f,m,d,l,s,v,p,o,E,g,h,b,_,O,C,P,w,U,k,N,F,H,W;return t=class extends r{constructor(){super(),De(this,g),De(this,b),De(this,O),De(this,P),De(this,U),De(this,N),De(this,H),Bi(this,"castEnabled",!1),De(this,l,{paused:!1}),De(this,s,void 0),De(this,v,{}),De(this,p,void 0),De(this,o,void 0),De(this,E,void 0),t.instances.add(this),$e(this,U,k).call(this)}static get castElement(){return ue(t,e)}static get castEnabled(){return ue(t,a)}static get castState(){var B;return(B=ue(t,x,A))==null?void 0:B.getCastState()}static async exitCast(){try{await ue(t,x,A).endCurrentSession(!0)}catch(B){console.error(B);return}}get castPlayer(){if(t.castElement===this)return ue(this,s)}attributeChangedCallback(B){if(this.castPlayer)switch(B){case"cast-stream-type":case"cast-src":this.load();break}}async requestCast(B={}){var j;$e(j=t,m,d).call(j,B),et(t,e,this),Object.entries(ue(this,v)).forEach(([V,Y])=>{ue(this,s).controller.addEventListener(V,Y)});try{await ue(t,x,A).requestSession()}catch{et(t,e,void 0);return}ue(this,l).paused=super.paused,super.pause(),this.muted=super.muted;try{await this.load()}catch(V){console.error(V)}}async load(){var B,j;if(!this.castPlayer)return super.load();let V=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType),Y=[...this.querySelectorAll("track")].filter(({kind:te,src:se})=>se&&(te==="subtitles"||te==="captions")),Q=[],J=0;Y.length&&(V.tracks=Y.map(te=>{let se=++J;Q.length===0&&te.track.mode==="showing"&&Q.push(se);let Z=new chrome.cast.media.Track(se,chrome.cast.media.TrackType.TEXT);return Z.trackContentId=te.src,Z.trackContentType="text/vtt",Z.subtype=te.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,Z.name=te.label,Z.language=te.srclang,Z})),this.castStreamType==="live"?V.streamType=chrome.cast.media.StreamType.LIVE:V.streamType=chrome.cast.media.StreamType.BUFFERED,V.metadata=new chrome.cast.media.GenericMediaMetadata,V.metadata.title=this.title,V.metadata.images=[{url:this.poster}];let z=new chrome.cast.media.LoadRequest(V);z.currentTime=(B=super.currentTime)!=null?B:0,z.autoplay=!ue(this,l).paused,z.activeTrackIds=Q,await((j=ue(t,D,R))==null?void 0:j.loadMedia(z)),this.dispatchEvent(new Event("volumechange"))}play(){var B;if(this.castPlayer){this.castPlayer.isPaused&&((B=this.castPlayer.controller)==null||B.playOrPause());return}return super.play()}pause(){var B;if(this.castPlayer){this.castPlayer.isPaused||(B=this.castPlayer.controller)==null||B.playOrPause();return}super.pause()}get castSrc(){var B,j,V;return(V=(j=this.getAttribute("cast-src"))!=null?j:(B=this.querySelector("source"))==null?void 0:B.src)!=null?V:this.currentSrc}set castSrc(B){this.castSrc!=B&&this.setAttribute("cast-src",`${B}`)}get castContentType(){var B;return(B=this.getAttribute("cast-content-type"))!=null?B:void 0}set castContentType(B){this.setAttribute("cast-content-type",`${B}`)}get castStreamType(){var B;return(B=this.getAttribute("cast-stream-type"))!=null?B:void 0}set castStreamType(B){this.setAttribute("cast-stream-type",`${B}`)}get readyState(){if(this.castPlayer)switch(this.castPlayer.playerState){case chrome.cast.media.PlayerState.IDLE:return 0;case chrome.cast.media.PlayerState.BUFFERING:return 2;default:return 3}return super.readyState}get paused(){return this.castPlayer?this.castPlayer.isPaused:super.paused}get muted(){var B;return this.castPlayer?(B=this.castPlayer)==null?void 0:B.isMuted:super.muted}set muted(B){var j;if(this.castPlayer){(B&&!this.castPlayer.isMuted||!B&&this.castPlayer.isMuted)&&((j=this.castPlayer.controller)==null||j.muteOrUnmute());return}super.muted=B}get volume(){var B,j;return this.castPlayer?(j=(B=this.castPlayer)==null?void 0:B.volumeLevel)!=null?j:1:super.volume}set volume(B){var j;if(this.castPlayer){this.castPlayer.volumeLevel=B,(j=this.castPlayer.controller)==null||j.setVolumeLevel();return}super.volume=B}get duration(){var B,j;return this.castPlayer&&ue(this,g,h)?(j=(B=this.castPlayer)==null?void 0:B.duration)!=null?j:NaN:super.duration}get currentTime(){var B,j;return this.castPlayer&&ue(this,g,h)?(j=(B=this.castPlayer)==null?void 0:B.currentTime)!=null?j:0:super.currentTime}set currentTime(B){var j;if(this.castPlayer){this.castPlayer.currentTime=B,(j=this.castPlayer.controller)==null||j.seek();return}super.currentTime=B}get onentercast(){return ue(this,p)}set onentercast(B){ue(this,p)&&(this.removeEventListener("entercast",ue(this,p)),et(this,p,null)),typeof B=="function"&&(et(this,p,B),this.addEventListener("entercast",B))}get onleavecast(){return ue(this,o)}set onleavecast(B){ue(this,o)&&(this.removeEventListener("leavecast",ue(this,o)),et(this,o,null)),typeof B=="function"&&(et(this,o,B),this.addEventListener("leavecast",B))}get oncastchange(){return ue(this,E)}set oncastchange(B){ue(this,E)&&(this.removeEventListener("castchange",ue(this,E)),et(this,E,null)),typeof B=="function"&&(et(this,E,B),this.addEventListener("castchange",B))}},e=new WeakMap,a=new WeakMap,n=new WeakMap,u=new WeakSet,M=function(){return typeof chrome!="undefined"&&chrome.cast&&chrome.cast.isAvailable},y=new WeakSet,I=function(){return typeof cast!="undefined"&&cast.framework},x=new WeakSet,A=function(){if(ue(t,y,I))return cast.framework.CastContext.getInstance()},D=new WeakSet,R=function(){var B;return(B=ue(t,x,A))==null?void 0:B.getCurrentSession()},L=new WeakSet,T=function(){var B;return(B=ue(t,D,R))==null?void 0:B.getSessionObj().media[0]},S=new WeakSet,c=function(B){return new Promise((j,V)=>{ue(t,L,T).editTracksInfo(B,j,V)})},i=new WeakSet,f=function(B){return new Promise((j,V)=>{ue(t,L,T).getStatus(B,j,V)})},m=new WeakSet,d=function(B){return ue(t,x,A).setOptions({receiverApplicationId:chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,autoJoinPolicy:chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0,...B})},l=new WeakMap,s=new WeakMap,v=new WeakMap,p=new WeakMap,o=new WeakMap,E=new WeakMap,g=new WeakSet,h=function(){var B;return(B=this.castPlayer)==null?void 0:B.isMediaLoaded},b=new WeakSet,_=function(){ue(t,e)===this&&(Object.entries(ue(this,v)).forEach(([B,j])=>{ue(this,s).controller.removeEventListener(B,j)}),et(t,e,void 0),this.muted=ue(this,s).isMuted,this.currentTime=ue(this,s).savedPlayerState.currentTime,ue(this,s).savedPlayerState.isPaused===!1&&this.play())},O=new WeakSet,C=function(){this.dispatchEvent(new CustomEvent("castchange",{detail:ue(t,x,A).getCastState()}))},P=new WeakSet,w=async function(){var B,j;let{SESSION_RESUMED:V}=cast.framework.SessionState;if(ue(t,x,A).getSessionState()===V&&this.castSrc===((B=ue(t,L,T))==null?void 0:B.media.contentId)){et(t,e,this),Object.entries(ue(this,v)).forEach(([Y,Q])=>{ue(this,s).controller.addEventListener(Y,Q)});try{await $e(j=t,i,f).call(j,new chrome.cast.media.GetStatusRequest)}catch(Y){console.error(Y)}ue(this,v)[cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED](),ue(this,v)[cast.framework.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},U=new WeakSet,k=function(){var B;!ue(t,y,I)||this.castEnabled||(this.castEnabled=!0,$e(B=t,m,d).call(B),this.textTracks.addEventListener("change",$e(this,H,W).bind(this)),$e(this,O,C).call(this),et(this,s,new cast.framework.RemotePlayer),new cast.framework.RemotePlayerController(ue(this,s)),et(this,v,{[cast.framework.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:j})=>{j===!1&&$e(this,b,_).call(this),this.dispatchEvent(new Event(j?"entercast":"leavecast"))},[cast.framework.RemotePlayerEventType.DURATION_CHANGED]:()=>{this.dispatchEvent(new Event("durationchange"))},[cast.framework.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{this.dispatchEvent(new Event("volumechange"))},[cast.framework.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{this.dispatchEvent(new Event("volumechange"))},[cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{!ue(this,g,h)||this.dispatchEvent(new Event("timeupdate"))},[cast.framework.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{this.dispatchEvent(new Event("resize"))},[cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{this.dispatchEvent(new Event(this.paused?"pause":"play"))},[cast.framework.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var j,V;((j=this.castPlayer)==null?void 0:j.playerState)!==chrome.cast.media.PlayerState.PAUSED&&this.dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(V=this.castPlayer)==null?void 0:V.playerState]))},[cast.framework.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{!ue(this,g,h)||(await Promise.resolve(),$e(this,N,F).call(this))}}))},N=new WeakSet,F=function(){$e(this,H,W).call(this)},H=new WeakSet,W=async function(){var B,j,V,Y,Q,J;if(!this.castPlayer)return;let z=((j=(B=ue(this,s).mediaInfo)==null?void 0:B.tracks)!=null?j:[]).filter(({type:q})=>q===chrome.cast.media.TrackType.TEXT),te=[...this.textTracks].filter(({kind:q})=>q==="subtitles"||q==="captions"),se=z.map(({language:q,name:ie,trackId:ne})=>{var Te;let{mode:Se}=(Te=te.find(he=>he.language===q&&he.label===ie))!=null?Te:{};return Se?{mode:Se,trackId:ne}:!1}).filter(Boolean),Z=se.filter(({mode:q})=>q!=="showing").map(({trackId:q})=>q),Ee=se.find(({mode:q})=>q==="showing"),fe=(Q=(Y=(V=ue(t,D,R))==null?void 0:V.getSessionObj().media[0])==null?void 0:Y.activeTrackIds)!=null?Q:[],re=fe;if(fe.length&&(re=re.filter(q=>!Z.includes(q))),Ee!=null&&Ee.trackId&&(re=[...re,Ee.trackId]),re=[...new Set(re)],!((q,ie)=>q.length===ie.length&&q.every(ne=>ie.includes(ne)))(fe,re))try{let q=new chrome.cast.media.EditTracksInfoRequest(re);await $e(J=t,S,c).call(J,q)}catch(q){console.error(q)}},De(t,u),De(t,y),De(t,x),De(t,D),De(t,L),De(t,S),De(t,i),De(t,m),Bi(t,"observedAttributes",["cast-src","cast-content-type","cast-stream-type"]),Bi(t,"instances",new Set),De(t,e,void 0),De(t,a,!1),Bi(t,"initCast",()=>{var B;ue(t,u,M)?ue(t,y,I)?ue(B=t,n).call(B,chrome.cast.isAvailable):customElements.whenDefined("google-cast-button").then(()=>{var j;return ue(j=t,n).call(j,chrome.cast.isAvailable)}):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(()=>{var j;return ue(j=t,n).call(j,chrome.cast.isAvailable)})}}),De(t,n,B=>{if(B){et(t,a,!0);let{CAST_STATE_CHANGED:j}=cast.framework.CastContextEventType;ue(t,x,A).addEventListener(j,Y=>{t.instances.forEach(Q=>{var J;return $e(J=Q,O,C).call(J,Y)})});let{SESSION_STATE_CHANGED:V}=cast.framework.CastContextEventType;ue(t,x,A).addEventListener(V,Y=>{t.instances.forEach(Q=>{var J;return $e(J=Q,P,w).call(J,Y)})}),t.instances.forEach(Y=>{var Q;return $e(Q=Y,U,k).call(Q)})}}),t};if(globalThis.HTMLVideoElement&&globalThis.customElements){let r=Od(HTMLVideoElement);globalThis.customElements.get("castable-video")||(globalThis.customElements.define("castable-video",r,{extends:"video"}),globalThis.CastableVideoElement=r),r.initCast()}var Ia=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","waitingforkey","resize","enterpictureinpicture","leavepictureinpicture","castchange","entercast","leavecast"],Lo=xo.createElement("template");Lo.innerHTML=`
|
|
754
754
|
<style>
|
|
755
755
|
:host {
|
|
756
756
|
display: inline-block;
|
|
@@ -770,20 +770,20 @@ svg, img, ::slotted(svg), ::slotted(img) {
|
|
|
770
770
|
</style>
|
|
771
771
|
<video is="castable-video" part="video" crossorigin></video>
|
|
772
772
|
<slot></slot>
|
|
773
|
-
`;var Wi,Qr,Hi,ji,_a,mr=class extends Rt.HTMLElement{constructor(){super(),De(this,Qr),De(this,ji),De(this,Wi,void 0),this.attachShadow({mode:"open"}),this.isConnected&&$e(this,Qr,Hi).call(this)}static get observedAttributes(){let r=[],t=a=>a.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();Object.getOwnPropertyNames(this.prototype).forEach(a=>{let n=!1;try{typeof this.prototype[a]=="function"&&(n=!0)}catch{}!n&&a!==a.toUpperCase()&&r.push(a.toLowerCase(),t(a))});let e=Object.getPrototypeOf(this).observedAttributes;return e&&(r=r.concat(e)),r}attributeChangedCallback(r,t,e){$e(this,Qr,Hi).call(this),$e(this,ji,_a).call(this,r,t,e)}connectedCallback(){$e(this,Qr,Hi).call(this)}};Wi=new WeakMap,Qr=new WeakSet,Hi=function(){if(ue(this,Wi))return;et(this,Wi,!0),this.shadowRoot.append(xo.content.cloneNode(!0)),this.nativeEl=this.shadowRoot.querySelector("video"),Da.forEach(t=>{this.nativeEl.addEventListener(t,e=>{this.dispatchEvent(new CustomEvent(e.type,{detail:e.detail}))})});let r=this.shadowRoot.querySelector("slot");r.addEventListener("slotchange",()=>{r.assignedElements().forEach(t=>{!["track","source"].includes(t.localName)||this.nativeEl.append(t)})}),Array.prototype.forEach.call(this.attributes,t=>{$e(this,ji,_a).call(this,t.name,null,t.value)}),this.nativeEl.defaultMuted&&(this.nativeEl.muted=!0)},ji=new WeakSet,_a=function(r,t,e){let a=Object.getOwnPropertyNames(Object.getPrototypeOf(this)),n=Od(a,r),u=Object.getPrototypeOf(this.constructor).toString().indexOf("function HTMLElement")===0;n&&!u?typeof this[n]=="boolean"?e===null?this[n]=!1:this[n]=!0:this[n]=e:e===null?this.nativeEl.removeAttribute(r):["id","class"].indexOf(r)===-1&&this.nativeEl.setAttribute(r,e)};var Lo=[],Do=So.createElement("video",{is:"castable-video"}),Rd=["webkitDisplayingFullscreen","webkitSupportsFullscreen"];for(let r=Object.getPrototypeOf(Do);r&&r!==Rt.HTMLElement.prototype;r=Object.getPrototypeOf(r))Object.getOwnPropertyNames(r).forEach(t=>{Rd.indexOf(t)===-1&&Lo.push(t)});Lo.forEach(r=>{if(!(r in mr.prototype))if(typeof Do[r]=="function")mr.prototype[r]=function(){return this.nativeEl[r].apply(this.nativeEl,arguments)};else{let t={get(){return this.nativeEl[r]}};r!==r.toUpperCase()&&(t.set=function(e){this.nativeEl[r]=e}),Object.defineProperty(mr.prototype,r,t)}});function Od(r,t){let e=null;return r.forEach(a=>{a.toLowerCase()==t.toLowerCase()&&(e=a)}),e}Rt.customElements.get("custom-video")||(Rt.customElements.define("custom-video",mr),Rt.CustomVideoElement=mr);var bo=mr,ae={ENV_KEY:"env-key",DEBUG:"debug",PLAYBACK_ID:"playback-id",METADATA_URL:"metadata-url",PREFER_PLAYBACK:"prefer-playback",PLAYER_SOFTWARE_VERSION:"player-software-version",PLAYER_SOFTWARE_NAME:"player-software-name",METADATA_VIDEO_ID:"metadata-video-id",METADATA_VIDEO_TITLE:"metadata-video-title",METADATA_VIEWER_USER_ID:"metadata-viewer-user-id",BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",TYPE:"type",STREAM_TYPE:"stream-type",START_TIME:"start-time"},Cd=Object.values(ae),Pd=Id(),kd="mux-video",Sa=class extends bo{constructor(){super(),this.__metadata={},this.__playerInitTime=vo()}static get observedAttributes(){var r;return[...Cd,...(r=bo.observedAttributes)!=null?r:[]]}get playerInitTime(){return this.__playerInitTime}get playerSoftwareName(){var r;return(r=this.__playerSoftwareName)!=null?r:kd}set playerSoftwareName(r){this.__playerSoftwareName=r}get playerSoftwareVersion(){var r;return(r=this.__playerSoftwareVersion)!=null?r:Pd}set playerSoftwareVersion(r){this.__playerSoftwareVersion=r}get _hls(){var r;return(r=this.__core)==null?void 0:r.engine}get mux(){return this.nativeEl.mux}get error(){var r;return(r=go(this.nativeEl))!=null?r:null}get errorTranslator(){return this.__errorTranslator}set errorTranslator(r){this.__errorTranslator=r}get src(){return this.getAttribute("src")}set src(r){r!==this.src&&(r==null?this.removeAttribute("src"):this.setAttribute("src",r))}get type(){var r;return(r=this.getAttribute(ae.TYPE))!=null?r:void 0}set type(r){r!==this.type&&(r?this.setAttribute(ae.TYPE,r):this.removeAttribute(ae.TYPE))}get autoplay(){let r=this.getAttribute("autoplay");return r===null?!1:r===""?!0:r}set autoplay(r){let t=this.autoplay;r!==t&&(r?this.setAttribute("autoplay",typeof r=="string"?r:""):this.removeAttribute("autoplay"))}get preload(){let r=this.getAttribute("preload");return r===""?"auto":["none","metadata","auto"].includes(r)?r:super.preload}set preload(r){r!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(r)?this.setAttribute("preload",r):this.removeAttribute("preload"))}get debug(){return this.getAttribute(ae.DEBUG)!=null}set debug(r){r!==this.debug&&(r?this.setAttribute(ae.DEBUG,""):this.removeAttribute(ae.DEBUG))}get startTime(){let r=this.getAttribute(ae.START_TIME);if(r==null)return;let t=+r;return Number.isNaN(t)?void 0:t}set startTime(r){r!==this.startTime&&(r==null?this.removeAttribute(ae.START_TIME):this.setAttribute(ae.START_TIME,`${r}`))}get playbackId(){var r;return(r=this.getAttribute(ae.PLAYBACK_ID))!=null?r:void 0}set playbackId(r){r!==this.playbackId&&(r?this.setAttribute(ae.PLAYBACK_ID,r):this.removeAttribute(ae.PLAYBACK_ID))}get customDomain(){var r;return(r=this.getAttribute(ae.CUSTOM_DOMAIN))!=null?r:void 0}set customDomain(r){r!==this.customDomain&&(r?this.setAttribute(ae.CUSTOM_DOMAIN,r):this.removeAttribute(ae.CUSTOM_DOMAIN))}get envKey(){var r;return(r=this.getAttribute(ae.ENV_KEY))!=null?r:void 0}set envKey(r){r!==this.envKey&&(r?this.setAttribute(ae.ENV_KEY,r):this.removeAttribute(ae.ENV_KEY))}get beaconCollectionDomain(){var r;return(r=this.getAttribute(ae.BEACON_COLLECTION_DOMAIN))!=null?r:void 0}set beaconCollectionDomain(r){r!==this.beaconCollectionDomain&&(r?this.setAttribute(ae.BEACON_COLLECTION_DOMAIN,r):this.removeAttribute(ae.BEACON_COLLECTION_DOMAIN))}get streamType(){var r;return(r=this.getAttribute(ae.STREAM_TYPE))!=null?r:void 0}set streamType(r){r!==this.streamType&&(r?this.setAttribute(ae.STREAM_TYPE,r):this.removeAttribute(ae.STREAM_TYPE))}get preferPlayback(){let r=this.getAttribute(ae.PREFER_PLAYBACK);if(r===at.MSE||r===at.NATIVE)return r}set preferPlayback(r){r!==this.preferPlayback&&(r===at.MSE||r===at.NATIVE?this.setAttribute(ae.PREFER_PLAYBACK,r):this.removeAttribute(ae.PREFER_PLAYBACK))}get metadata(){let r=this.getAttribute(ae.METADATA_VIDEO_ID),t=this.getAttribute(ae.METADATA_VIDEO_TITLE),e=this.getAttribute(ae.METADATA_VIEWER_USER_ID);return{...this.__metadata,...r!=null?{video_id:r}:{},...t!=null?{video_title:t}:{},...e!=null?{viewer_user_id:e}:{}}}set metadata(r){this.__metadata=r!=null?r:{},this.mux&&this.mux.emit("hb",this.__metadata)}load(){this.__core=po(this,this.nativeEl,this.__core)}unload(){Aa(this.nativeEl,this.__core),this.__core=void 0}attributeChangedCallback(r,t,e){var a,n;switch(super.attributeChangedCallback(r,t,e),r){case ae.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=e!=null?e:void 0;break;case ae.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=e!=null?e:void 0;break;case"src":{let u=!!t,M=!!e;!u&&M?this.load():u&&!M?this.unload():u&&M&&(this.unload(),this.load());break}case"autoplay":if(e===t)break;(a=this.__core)==null||a.setAutoplay(this.autoplay);break;case"preload":if(e===t)break;(n=this.__core)==null||n.setPreload(e);break;case ae.PLAYBACK_ID:this.src=mo(e!=null?e:void 0,{domain:this.customDomain});break;case ae.DEBUG:{let u=this.debug;this.mux&&console.info("Cannot toggle debug mode of mux data after initialization. Make sure you set all metadata to override before setting the src."),this._hls&&(this._hls.config.debug=u);break}case ae.METADATA_URL:e&&fetch(e).then(u=>u.json()).then(u=>this.metadata=u).catch(u=>console.error(`Unable to load or parse metadata JSON from metadata-url ${e}!`));break;default:break}}disconnectedCallback(){this.unload()}};Rt.customElements.get("mux-video")||(Rt.customElements.define("mux-video",Sa),Rt.MuxVideoElement=Sa);var Io=Sa;var wd="en",Wt={code:wd};var Mo="en";function be(r,t=!0){var n,u;let e=t&&(u=(n=Wt)==null?void 0:n[r])!=null?u:r,a=t?Wt.code:Mo;return new Ia(e,a)}var Ia=class{constructor(t,e=(a=>(a=Wt.code)!=null?a:Mo)()){this.message=t,this.locale=e}format(t){return this.message.replace(/\{(\w+)\}/g,(e,a)=>{var n;return(n=t[a])!=null?n:""})}toString(){return this.message}};function Ro(r){let t="";return Object.entries(r).forEach(([e,a])=>{a!=null&&(t+=`${Ud(e)}: ${a}; `)}),t?t.trim():void 0}function Ud(r){return r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Oo(r){return r.replace(/[-_]([a-z])/g,(t,e)=>e.toUpperCase())}function Ht(r){if(r==null)return;let t=+r;return Number.isNaN(t)?void 0:t}function Vi(r){let t=Nd(r).toString();return t?"?"+t:""}function Nd(r){let t={};for(let e in r)r[e]!=null&&(t[e]=r[e]);return new URLSearchParams(t)}function Zr(r){let t=(r!=null?r:"").split(".")[1];if(!t)return{};let e=t.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(e).split("").map(function(n){return"%"+("00"+n.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}var Ma=(r,t)=>!r||!t?!1:r.contains(t)?!0:Ma(r,t.getRootNode().host);var Ra="mux.com",Fd=()=>{try{return"1.1.1"}catch{}return"UNKNOWN"},Bd=Fd(),Yi=()=>Bd,Oa=(r,{token:t,domain:e=Ra}={})=>`https://stream.${e}/${r}.m3u8${Vi(!!t?{token:t}:{redundant_streams:!0})}`,ko=(r,{token:t,thumbnailTime:e,domain:a=Ra}={})=>{let n=t==null?e:void 0;return`https://image.${a}/${r}/thumbnail.jpg${Vi({token:t,time:n})}`},wo=(r,{token:t,domain:e=Ra}={})=>`https://image.${e}/${r}/storyboard.vtt${Vi({token:t})}`;function Ca(r){if(r&&/^media-theme-[\w-]+$/.test(r))return r}var Kd={crossorigin:"crossOrigin",playsinline:"playsInline"};function Uo(r){var t;return(t=Kd[r])!=null?t:Oo(r)}var No=r=>{var e,a;let{media:t}=r;return(a=(e=t==null?void 0:t._hls)==null?void 0:e.liveSyncPosition)!=null?a:t!=null&&t.seekable.length?t==null?void 0:t.seekable.end(t.seekable.length-1):void 0},Pa=r=>{let t=No(r);if(t==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}r.currentTime=t},Wd=1,Hd=5,Co=3,Po=.5,Fo=r=>{var u;let{streamType:t}=r,e=No(r),a=(u=r.media)==null?void 0:u.currentTime;if(e==null||a==null)return!1;let n=e-a;return t===pe.LL_LIVE||t===pe.LL_DVR?n<=Wd*(Co+Po):t===pe.LIVE||t===pe.DVR?n<=Hd*(Co+Po):!1},jt,Gt,tt,$i=class{constructor(t,e){Le(this,jt,void 0);Le(this,Gt,void 0);Le(this,tt,[]);qe(this,jt,t),qe(this,Gt,e)}[Symbol.iterator](){return ge(this,tt).values()}get length(){return ge(this,tt).length}get value(){var t;return(t=ge(this,tt).join(" "))!=null?t:""}set value(t){var e;t!==this.value&&(qe(this,tt,[]),this.add(...(e=t==null?void 0:t.split(" "))!=null?e:[]))}toString(){return this.value}item(t){return ge(this,tt)[t]}values(){return ge(this,tt).values()}keys(){return ge(this,tt).keys()}forEach(t){ge(this,tt).forEach(t)}add(...t){var e,a;t.forEach(n=>{this.contains(n)||ge(this,tt).push(n)}),!(this.value===""&&!((e=ge(this,jt))!=null&&e.hasAttribute(`${ge(this,Gt)}`)))&&((a=ge(this,jt))==null||a.setAttribute(`${ge(this,Gt)}`,`${this.value}`))}remove(...t){var e;t.forEach(a=>{ge(this,tt).splice(ge(this,tt).indexOf(a),1)}),(e=ge(this,jt))==null||e.setAttribute(`${ge(this,Gt)}`,`${this.value}`)}contains(t){return ge(this,tt).includes(t)}toggle(t,e){return typeof e!="undefined"?e?(this.add(t),!0):(this.remove(t),!1):this.contains(t)?(this.remove(t),!1):(this.add(t),!0)}replace(t,e){this.remove(t),this.add(e)}};jt=new WeakMap,Gt=new WeakMap,tt=new WeakMap;var Bo=`[mux-player ${Yi()}]`;function Vt(...r){console.warn(Bo,...r)}function ht(...r){console.error(Bo,...r)}function zi(r){var e;let t=(e=r.message)!=null?e:"";if(r.file){let a="https://github.com/muxinc/elements/blob/main/errors/";t+=` ${be("Read more: ")}
|
|
774
|
-
${a}${r.file}`}Vt(t)}var Je={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},$t={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},jd=Object.freeze({length:0,start(r){let t=r>>>0;if(t>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${t}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(r){let t=r>>>0;if(t>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${t}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),Gd=Da.filter(r=>r!=="error"),Vd=Object.values(Je).filter(r=>![Je.PLAYSINLINE].includes(r)),$d=Object.values($t);function Wo(r){r.querySelectorAll(":scope > track").forEach(t=>{var e;(e=r.media)==null||e.append(t.cloneNode())}),Gd.forEach(t=>{var e;(e=r.media)==null||e.addEventListener(t,a=>{r.dispatchEvent(new Event(a.type))})})}var ka=class extends Pe.HTMLElement{static get observedAttributes(){return[...Vd,...$d]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(a=>{var n;(n=this.media)==null||n.append(a.cloneNode())});let t=a=>{for(let n of a)n.type==="childList"&&(n.removedNodes.forEach(u=>{var y,I;let M=(y=this.media)==null?void 0:y.querySelector(`track[src="${u.src}"]`);M&&((I=this.media)==null||I.removeChild(M))}),n.addedNodes.forEach(u=>{var M;(M=this.media)==null||M.append(u.cloneNode())}))};new MutationObserver(t).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(t,e,a){switch(t){case $t.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case $t.VOLUME:{let n=+a;this.media&&!Number.isNaN(n)&&(this.media.volume=n);return}case $t.PLAYBACKRATE:{let n=+a;this.media&&!Number.isNaN(n)&&(this.media.playbackRate=n,this.media.defaultPlaybackRate=n);return}}}play(){var t,e;return(e=(t=this.media)==null?void 0:t.play())!=null?e:Promise.reject()}pause(){var t;(t=this.media)==null||t.pause()}requestCast(t){var e;return(e=this.media)==null?void 0:e.requestCast(t)}get media(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector("mux-video")}get paused(){var t,e;return(e=(t=this.media)==null?void 0:t.paused)!=null?e:!0}get duration(){var t,e;return(e=(t=this.media)==null?void 0:t.duration)!=null?e:NaN}get ended(){var t,e;return(e=(t=this.media)==null?void 0:t.ended)!=null?e:!1}get buffered(){var t,e;return(e=(t=this.media)==null?void 0:t.buffered)!=null?e:jd}get readyState(){var t,e;return(e=(t=this.media)==null?void 0:t.readyState)!=null?e:0}get videoWidth(){var t,e;return(e=(t=this.media)==null?void 0:t.videoWidth)!=null?e:0}get videoHeight(){var t,e;return(e=(t=this.media)==null?void 0:t.videoHeight)!=null?e:0}get currentTime(){var t,e;return(e=(t=this.media)==null?void 0:t.currentTime)!=null?e:0}set currentTime(t){this.media&&(this.media.currentTime=Number(t))}get volume(){var t,e;return(e=(t=this.media)==null?void 0:t.volume)!=null?e:1}set volume(t){this.media&&(this.media.volume=Number(t))}get playbackRate(){var t,e;return(e=(t=this.media)==null?void 0:t.playbackRate)!=null?e:1}set playbackRate(t){this.media&&(this.media.playbackRate=Number(t))}get defaultPlaybackRate(){var t;return(t=Ht(this.getAttribute($t.PLAYBACKRATE)))!=null?t:1}set defaultPlaybackRate(t){t!=null?this.setAttribute($t.PLAYBACKRATE,`${t}`):this.removeAttribute($t.PLAYBACKRATE)}get crossOrigin(){return Jr(this,Je.CROSSORIGIN)}set crossOrigin(t){this.setAttribute(Je.CROSSORIGIN,`${t}`)}get autoplay(){return Jr(this,Je.AUTOPLAY)!=null}set autoplay(t){t?this.setAttribute(Je.AUTOPLAY,typeof t=="string"?t:""):this.removeAttribute(Je.AUTOPLAY)}get loop(){return Jr(this,Je.LOOP)!=null}set loop(t){t?this.setAttribute(Je.LOOP,""):this.removeAttribute(Je.LOOP)}get muted(){var t,e;return(e=(t=this.media)==null?void 0:t.muted)!=null?e:!1}set muted(t){this.media&&(this.media.muted=Boolean(t))}get defaultMuted(){return Jr(this,Je.MUTED)!=null}set defaultMuted(t){t?this.setAttribute(Je.MUTED,""):this.removeAttribute(Je.MUTED)}get playsInline(){return Jr(this,Je.PLAYSINLINE)!=null}set playsInline(t){ht("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(t){["","none","metadata","auto"].includes(t)?this.setAttribute(Je.PRELOAD,t):this.removeAttribute(Je.PRELOAD)}};function Jr(r,t){return r.media?r.media.getAttribute(t):r.getAttribute(t)}var wa=ka;var Xi=new Map;function Qi(r){if(Xi.has(r))return Xi.get(r);let t=r.length,e=0,a=0,n=0,u=[];for(let M=0;M<t;M+=1){let y=r[M],I=r[M+1],x=r[M-1];y==="{"&&I==="{"&&x!=="\\"?(n+=1,n===1&&(a=M),M+=1):y==="}"&&I==="}"&&x!=="\\"&&n&&(n-=1,n===0&&(a>e&&(u.push(Object.freeze({type:"string",start:e,end:a,value:r.slice(e,a)})),e=a),u.push(Object.freeze({type:"part",start:a,end:M+2,value:r.slice(e+2,M).trim()})),M+=1,e=M+1))}return e<t&&u.push(Object.freeze({type:"string",start:e,end:t,value:r.slice(e,t)})),Xi.set(r,Object.freeze(u)),Xi.get(r)}var Yt=new WeakMap,Ho=new WeakMap,dt=class{constructor(t,e){this.expression=e,Yt.set(this,t),t.updateParent("")}get attributeName(){return Yt.get(this).attr.name}get attributeNamespace(){return Yt.get(this).attr.namespaceURI}get value(){return Ho.get(this)}set value(t){Ho.set(this,t||""),Yt.get(this).updateParent(t)}get element(){return Yt.get(this).element}get booleanValue(){return Yt.get(this).booleanValue}set booleanValue(t){Yt.get(this).booleanValue=t}},qr=class{constructor(t,e){this.element=t,this.attr=e,this.partList=[]}get booleanValue(){return this.element.hasAttributeNS(this.attr.namespaceURI,this.attr.name)}set booleanValue(t){if(this.partList.length!==1)throw new DOMException("Operation not supported","NotSupportedError");this.partList[0].value=t?"":null}append(t){this.partList.push(t)}updateParent(t){if(this.partList.length===1&&t===null)this.element.removeAttributeNS(this.attr.namespaceURI,this.attr.name);else{let e=this.partList.map(a=>typeof a=="string"?a:a.value).join("");this.element.setAttributeNS(this.attr.namespaceURI,this.attr.name,e)}}};var Ot=new WeakMap,vt=class{constructor(t,e){this.expression=e,Ot.set(this,[t]),t.textContent=""}get value(){return Ot.get(this).map(t=>t.textContent).join("")}set value(t){this.replace(t)}get previousSibling(){return Ot.get(this)[0].previousSibling}get nextSibling(){return Ot.get(this)[Ot.get(this).length-1].nextSibling}replace(...t){let e=t.map(a=>typeof a=="string"?new Text(a):a);e.length||e.push(new Text("")),Ot.get(this)[0].before(...e);for(let a of Ot.get(this))a.remove();Ot.set(this,e)}};function ei(r){return{processCallback(t,e,a){var n;if(!(typeof a!="object"||!a)){for(let u of e)if(u.expression in a){let M=(n=a[u.expression])!==null&&n!==void 0?n:"";r(u,M)}}}}}function Ua(r,t){r.value=String(t)}function jo(r,t){return typeof t=="boolean"&&r instanceof dt&&typeof r.element[r.attributeName]=="boolean"?(r.booleanValue=t,!0):!1}var Na=ei(Ua),Yd=ei((r,t)=>{jo(r,t)||Ua(r,t)});function*zd(r){let t=r.ownerDocument.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null,!1),e;for(;e=t.nextNode();)if(e instanceof Element&&e.hasAttributes())for(let a=0;a<e.attributes.length;a+=1){let n=e.attributes.item(a);if(n&&n.value.includes("{{")){let u=new qr(e,n);for(let M of Qi(n.value))if(M.type==="string")u.append(M.value);else{let y=new dt(u,M.value);u.append(y),yield y}}}else if(e instanceof Text&&e.textContent&&e.textContent.includes("{{")){let a=Qi(e.textContent);for(let n=0;n<a.length;n+=1){let u=a[n];u.end<e.textContent.length&&e.splitText(u.end),u.type==="part"&&(yield new vt(e,u.value));break}}}var Zi=new WeakMap,Ji=new WeakMap,bt=class extends DocumentFragment{constructor(t,e,a=Na){var n,u;super(),Object.getPrototypeOf(this)!==bt.prototype&&Object.setPrototypeOf(this,bt.prototype),this.appendChild(t.content.cloneNode(!0)),Ji.set(this,Array.from(zd(this))),Zi.set(this,a),(u=(n=Zi.get(this)).createCallback)===null||u===void 0||u.call(n,this,Ji.get(this),e),Zi.get(this).processCallback(this,Ji.get(this),e)}update(t){Zi.get(this).processCallback(this,Ji.get(this),t)}};var ti=new WeakMap,ri=class{constructor(t,e){this.element=t;this.type=e;this.element.addEventListener(this.type,this);let a=ti.get(this.element);a&&a.set(this.type,this)}set(t){if(typeof t=="function")this.handleEvent=t.bind(this.element);else if(typeof t=="object"&&typeof t.handleEvent=="function")this.handleEvent=t.handleEvent.bind(t);else{this.element.removeEventListener(this.type,this);let e=ti.get(this.element);e&&e.delete(this.type)}}static for(t){ti.has(t.element)||ti.set(t.element,new Map);let e=t.attributeName.slice(2),a=ti.get(t.element);return a&&a.has(e)?a.get(e):new ri(t.element,e)}};function Xd(r,t){return r instanceof dt&&r.attributeName.startsWith("on")?(ri.for(r).set(t),r.element.removeAttributeNS(r.attributeNamespace,r.attributeName),!0):!1}function Qd(r,t){return t instanceof ii&&r instanceof vt?(t.renderInto(r),!0):!1}function Zd(r,t){return t instanceof DocumentFragment&&r instanceof vt?(t.childNodes.length&&r.replace(...t.childNodes),!0):!1}function Jd(r,t){if(r instanceof dt){let e=r.attributeNamespace,a=r.element.getAttributeNS(e,r.attributeName);return String(t)!==a&&(r.value=String(t)),!0}return r.value=String(t),!0}function qd(r,t){if(typeof t=="boolean"&&r instanceof dt){let e=r.attributeNamespace,a=r.element.hasAttributeNS(e,r.attributeName);return t!==a&&(r.booleanValue=t),!0}return!1}function ec(r,t){return t===!1&&r instanceof vt?(r.replace(""),!0):!1}function tc(r,t){qd(r,t)||Xd(r,t)||ec(r,t)||Qd(r,t)||Zd(r,t)||Jd(r,t)}var Fa=new WeakMap,Go=new WeakMap,Vo=new WeakMap,ii=class{constructor(t,e,a){this.strings=t;this.values=e;this.processor=a}get template(){if(Fa.has(this.strings))return Fa.get(this.strings);{let t=document.createElement("template"),e=this.strings.length-1;return t.innerHTML=this.strings.reduce((a,n,u)=>a+n+(u<e?`{{ ${u} }}`:""),""),Fa.set(this.strings,t),t}}renderInto(t){let e=this.template;if(Go.get(t)!==e){Go.set(t,e);let n=new bt(e,this.values,this.processor);Vo.set(t,n),t instanceof vt?t.replace(...n.children):t.appendChild(n);return}let a=Vo.get(t);a&&a.update(this.values)}},$o=new Map,rc=ei(tc);function ce(r,...t){let e=[""],a=[],n,u=!1,M=(y,I=[])=>{e[e.length-1]=e[e.length-1]+y[0],I.forEach((x,A)=>{(n=x==null?void 0:x.$static$)!==void 0?(n.forEach(D=>{M(D.strings,D.values)}),e[e.length-1]=e[e.length-1]+y[A+1],u=!0):(a.push(x),e.push(y[A+1]))})};if(M(r,t),u){let y=e.join("$$html$$");r=$o.get(y),r===void 0&&(e.raw=e,$o.set(y,r=e)),t=a}return new ii(r,t,rc)}function qi(r,t){r.renderInto(t)}function Ye(r,t){let e=document.createElement("template");return e.innerHTML=r,new bt(e,t)}var Ba=(...r)=>({$static$:r.map(t=>t instanceof ii?t:/\w-/.test(t)?{strings:[t]}:{strings:[]})});var zo=`
|
|
773
|
+
`;var Wi,Qr,Hi,ji,Sa,gr=class extends Rt.HTMLElement{constructor(){super(),De(this,Qr),De(this,ji),De(this,Wi,void 0),this.attachShadow({mode:"open"}),this.isConnected&&$e(this,Qr,Hi).call(this)}static get observedAttributes(){let r=[],t=a=>a.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();Object.getOwnPropertyNames(this.prototype).forEach(a=>{let n=!1;try{typeof this.prototype[a]=="function"&&(n=!0)}catch{}!n&&a!==a.toUpperCase()&&r.push(a.toLowerCase(),t(a))});let e=Object.getPrototypeOf(this).observedAttributes;return e&&(r=r.concat(e)),r}attributeChangedCallback(r,t,e){$e(this,Qr,Hi).call(this),$e(this,ji,Sa).call(this,r,t,e)}connectedCallback(){$e(this,Qr,Hi).call(this)}};Wi=new WeakMap,Qr=new WeakSet,Hi=function(){if(ue(this,Wi))return;et(this,Wi,!0),this.shadowRoot.append(Lo.content.cloneNode(!0)),this.nativeEl=this.shadowRoot.querySelector("video"),Ia.forEach(t=>{this.nativeEl.addEventListener(t,e=>{this.dispatchEvent(new CustomEvent(e.type,{detail:e.detail}))})});let r=this.shadowRoot.querySelector("slot");r.addEventListener("slotchange",()=>{r.assignedElements().forEach(t=>{!["track","source"].includes(t.localName)||this.nativeEl.append(t)})}),Array.prototype.forEach.call(this.attributes,t=>{$e(this,ji,Sa).call(this,t.name,null,t.value)}),this.nativeEl.defaultMuted&&(this.nativeEl.muted=!0)},ji=new WeakSet,Sa=function(r,t,e){let a=Object.getOwnPropertyNames(Object.getPrototypeOf(this)),n=Pd(a,r),u=Object.getPrototypeOf(this.constructor).toString().indexOf("function HTMLElement")===0;n&&!u?typeof this[n]=="boolean"?e===null?this[n]=!1:this[n]=!0:this[n]=e:e===null?this.nativeEl.removeAttribute(r):["id","class"].indexOf(r)===-1&&this.nativeEl.setAttribute(r,e)};var Do=[],Io=xo.createElement("video",{is:"castable-video"}),Cd=["webkitDisplayingFullscreen","webkitSupportsFullscreen"];for(let r=Object.getPrototypeOf(Io);r&&r!==Rt.HTMLElement.prototype;r=Object.getPrototypeOf(r))Object.getOwnPropertyNames(r).forEach(t=>{Cd.indexOf(t)===-1&&Do.push(t)});Do.forEach(r=>{if(!(r in gr.prototype))if(typeof Io[r]=="function")gr.prototype[r]=function(){return this.nativeEl[r].apply(this.nativeEl,arguments)};else{let t={get(){return this.nativeEl[r]}};r!==r.toUpperCase()&&(t.set=function(e){this.nativeEl[r]=e}),Object.defineProperty(gr.prototype,r,t)}});function Pd(r,t){let e=null;return r.forEach(a=>{a.toLowerCase()==t.toLowerCase()&&(e=a)}),e}Rt.customElements.get("custom-video")||(Rt.customElements.define("custom-video",gr),Rt.CustomVideoElement=gr);var Ao=gr,ae={ENV_KEY:"env-key",DEBUG:"debug",PLAYBACK_ID:"playback-id",METADATA_URL:"metadata-url",PREFER_PLAYBACK:"prefer-playback",PLAYER_SOFTWARE_VERSION:"player-software-version",PLAYER_SOFTWARE_NAME:"player-software-name",METADATA_VIDEO_ID:"metadata-video-id",METADATA_VIDEO_TITLE:"metadata-video-title",METADATA_VIEWER_USER_ID:"metadata-viewer-user-id",BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",TYPE:"type",STREAM_TYPE:"stream-type",START_TIME:"start-time"},kd=Object.values(ae),wd=Rd(),Ud="mux-video",xa=class extends Ao{constructor(){super(),this.__metadata={},this.__playerInitTime=mo()}static get observedAttributes(){var r;return[...kd,...(r=Ao.observedAttributes)!=null?r:[]]}get playerInitTime(){return this.__playerInitTime}get playerSoftwareName(){var r;return(r=this.__playerSoftwareName)!=null?r:Ud}set playerSoftwareName(r){this.__playerSoftwareName=r}get playerSoftwareVersion(){var r;return(r=this.__playerSoftwareVersion)!=null?r:wd}set playerSoftwareVersion(r){this.__playerSoftwareVersion=r}get _hls(){var r;return(r=this.__core)==null?void 0:r.engine}get mux(){return this.nativeEl.mux}get error(){var r;return(r=po(this.nativeEl))!=null?r:null}get errorTranslator(){return this.__errorTranslator}set errorTranslator(r){this.__errorTranslator=r}get src(){return this.getAttribute("src")}set src(r){r!==this.src&&(r==null?this.removeAttribute("src"):this.setAttribute("src",r))}get type(){var r;return(r=this.getAttribute(ae.TYPE))!=null?r:void 0}set type(r){r!==this.type&&(r?this.setAttribute(ae.TYPE,r):this.removeAttribute(ae.TYPE))}get autoplay(){let r=this.getAttribute("autoplay");return r===null?!1:r===""?!0:r}set autoplay(r){let t=this.autoplay;r!==t&&(r?this.setAttribute("autoplay",typeof r=="string"?r:""):this.removeAttribute("autoplay"))}get preload(){let r=this.getAttribute("preload");return r===""?"auto":["none","metadata","auto"].includes(r)?r:super.preload}set preload(r){r!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(r)?this.setAttribute("preload",r):this.removeAttribute("preload"))}get debug(){return this.getAttribute(ae.DEBUG)!=null}set debug(r){r!==this.debug&&(r?this.setAttribute(ae.DEBUG,""):this.removeAttribute(ae.DEBUG))}get startTime(){let r=this.getAttribute(ae.START_TIME);if(r==null)return;let t=+r;return Number.isNaN(t)?void 0:t}set startTime(r){r!==this.startTime&&(r==null?this.removeAttribute(ae.START_TIME):this.setAttribute(ae.START_TIME,`${r}`))}get playbackId(){var r;return(r=this.getAttribute(ae.PLAYBACK_ID))!=null?r:void 0}set playbackId(r){r!==this.playbackId&&(r?this.setAttribute(ae.PLAYBACK_ID,r):this.removeAttribute(ae.PLAYBACK_ID))}get customDomain(){var r;return(r=this.getAttribute(ae.CUSTOM_DOMAIN))!=null?r:void 0}set customDomain(r){r!==this.customDomain&&(r?this.setAttribute(ae.CUSTOM_DOMAIN,r):this.removeAttribute(ae.CUSTOM_DOMAIN))}get envKey(){var r;return(r=this.getAttribute(ae.ENV_KEY))!=null?r:void 0}set envKey(r){r!==this.envKey&&(r?this.setAttribute(ae.ENV_KEY,r):this.removeAttribute(ae.ENV_KEY))}get beaconCollectionDomain(){var r;return(r=this.getAttribute(ae.BEACON_COLLECTION_DOMAIN))!=null?r:void 0}set beaconCollectionDomain(r){r!==this.beaconCollectionDomain&&(r?this.setAttribute(ae.BEACON_COLLECTION_DOMAIN,r):this.removeAttribute(ae.BEACON_COLLECTION_DOMAIN))}get streamType(){var r;return(r=this.getAttribute(ae.STREAM_TYPE))!=null?r:void 0}set streamType(r){r!==this.streamType&&(r?this.setAttribute(ae.STREAM_TYPE,r):this.removeAttribute(ae.STREAM_TYPE))}get preferPlayback(){let r=this.getAttribute(ae.PREFER_PLAYBACK);if(r===at.MSE||r===at.NATIVE)return r}set preferPlayback(r){r!==this.preferPlayback&&(r===at.MSE||r===at.NATIVE?this.setAttribute(ae.PREFER_PLAYBACK,r):this.removeAttribute(ae.PREFER_PLAYBACK))}get metadata(){let r=this.getAttribute(ae.METADATA_VIDEO_ID),t=this.getAttribute(ae.METADATA_VIDEO_TITLE),e=this.getAttribute(ae.METADATA_VIEWER_USER_ID);return{...this.__metadata,...r!=null?{video_id:r}:{},...t!=null?{video_title:t}:{},...e!=null?{viewer_user_id:e}:{}}}set metadata(r){this.__metadata=r!=null?r:{},this.mux&&this.mux.emit("hb",this.__metadata)}load(){this.__core=Eo(this,this.nativeEl,this.__core)}unload(){_a(this.nativeEl,this.__core),this.__core=void 0}attributeChangedCallback(r,t,e){var a,n;switch(super.attributeChangedCallback(r,t,e),r){case ae.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=e!=null?e:void 0;break;case ae.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=e!=null?e:void 0;break;case"src":{let u=!!t,M=!!e;!u&&M?this.load():u&&!M?this.unload():u&&M&&(this.unload(),this.load());break}case"autoplay":if(e===t)break;(a=this.__core)==null||a.setAutoplay(this.autoplay);break;case"preload":if(e===t)break;(n=this.__core)==null||n.setPreload(e);break;case ae.PLAYBACK_ID:this.src=go(e!=null?e:void 0,{domain:this.customDomain});break;case ae.DEBUG:{let u=this.debug;this.mux&&console.info("Cannot toggle debug mode of mux data after initialization. Make sure you set all metadata to override before setting the src."),this._hls&&(this._hls.config.debug=u);break}case ae.METADATA_URL:e&&fetch(e).then(u=>u.json()).then(u=>this.metadata=u).catch(u=>console.error(`Unable to load or parse metadata JSON from metadata-url ${e}!`));break;default:break}}disconnectedCallback(){this.unload()}};Rt.customElements.get("mux-video")||(Rt.customElements.define("mux-video",xa),Rt.MuxVideoElement=xa);var Mo=xa;var Nd="en",Ht={code:Nd};var Ro="en";function be(r,t=!0){var n,u;let e=t&&(u=(n=Ht)==null?void 0:n[r])!=null?u:r,a=t?Ht.code:Ro;return new Ma(e,a)}var Ma=class{constructor(t,e=(a=>(a=Ht.code)!=null?a:Ro)()){this.message=t,this.locale=e}format(t){return this.message.replace(/\{(\w+)\}/g,(e,a)=>{var n;return(n=t[a])!=null?n:""})}toString(){return this.message}};function Oo(r){let t="";return Object.entries(r).forEach(([e,a])=>{a!=null&&(t+=`${Fd(e)}: ${a}; `)}),t?t.trim():void 0}function Fd(r){return r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Co(r){return r.replace(/[-_]([a-z])/g,(t,e)=>e.toUpperCase())}function jt(r){if(r==null)return;let t=+r;return Number.isNaN(t)?void 0:t}function Vi(r){let t=Bd(r).toString();return t?"?"+t:""}function Bd(r){let t={};for(let e in r)r[e]!=null&&(t[e]=r[e]);return new URLSearchParams(t)}function Zr(r){let t=(r!=null?r:"").split(".")[1];if(!t)return{};let e=t.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(e).split("").map(function(n){return"%"+("00"+n.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}var Ra=(r,t)=>!r||!t?!1:r.contains(t)?!0:Ra(r,t.getRootNode().host);var Oa="mux.com",Kd=()=>{try{return"1.1.2"}catch{}return"UNKNOWN"},Wd=Kd(),Yi=()=>Wd,Ca=(r,{token:t,domain:e=Oa}={})=>`https://stream.${e}/${r}.m3u8${Vi(!!t?{token:t}:{redundant_streams:!0})}`,wo=(r,{token:t,thumbnailTime:e,domain:a=Oa}={})=>{let n=t==null?e:void 0;return`https://image.${a}/${r}/thumbnail.jpg${Vi({token:t,time:n})}`},Uo=(r,{token:t,domain:e=Oa}={})=>`https://image.${e}/${r}/storyboard.vtt${Vi({token:t})}`;function Pa(r){if(r&&/^media-theme-[\w-]+$/.test(r))return r}var Hd={crossorigin:"crossOrigin",playsinline:"playsInline"};function No(r){var t;return(t=Hd[r])!=null?t:Co(r)}var Fo=r=>{var e,a;let{media:t}=r;return(a=(e=t==null?void 0:t._hls)==null?void 0:e.liveSyncPosition)!=null?a:t!=null&&t.seekable.length?t==null?void 0:t.seekable.end(t.seekable.length-1):void 0},ka=r=>{let t=Fo(r);if(t==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}r.currentTime=t},jd=1,Gd=5,Po=3,ko=.5,Bo=r=>{var u;let{streamType:t}=r,e=Fo(r),a=(u=r.media)==null?void 0:u.currentTime;if(e==null||a==null)return!1;let n=e-a;return t===pe.LL_LIVE||t===pe.LL_DVR?n<=jd*(Po+ko):t===pe.LIVE||t===pe.DVR?n<=Gd*(Po+ko):!1},Gt,Vt,tt,$i=class{constructor(t,e){Le(this,Gt,void 0);Le(this,Vt,void 0);Le(this,tt,[]);qe(this,Gt,t),qe(this,Vt,e)}[Symbol.iterator](){return ge(this,tt).values()}get length(){return ge(this,tt).length}get value(){var t;return(t=ge(this,tt).join(" "))!=null?t:""}set value(t){var e;t!==this.value&&(qe(this,tt,[]),this.add(...(e=t==null?void 0:t.split(" "))!=null?e:[]))}toString(){return this.value}item(t){return ge(this,tt)[t]}values(){return ge(this,tt).values()}keys(){return ge(this,tt).keys()}forEach(t){ge(this,tt).forEach(t)}add(...t){var e,a;t.forEach(n=>{this.contains(n)||ge(this,tt).push(n)}),!(this.value===""&&!((e=ge(this,Gt))!=null&&e.hasAttribute(`${ge(this,Vt)}`)))&&((a=ge(this,Gt))==null||a.setAttribute(`${ge(this,Vt)}`,`${this.value}`))}remove(...t){var e;t.forEach(a=>{ge(this,tt).splice(ge(this,tt).indexOf(a),1)}),(e=ge(this,Gt))==null||e.setAttribute(`${ge(this,Vt)}`,`${this.value}`)}contains(t){return ge(this,tt).includes(t)}toggle(t,e){return typeof e!="undefined"?e?(this.add(t),!0):(this.remove(t),!1):this.contains(t)?(this.remove(t),!1):(this.add(t),!0)}replace(t,e){this.remove(t),this.add(e)}};Gt=new WeakMap,Vt=new WeakMap,tt=new WeakMap;var Ko=`[mux-player ${Yi()}]`;function $t(...r){console.warn(Ko,...r)}function ht(...r){console.error(Ko,...r)}function zi(r){var e;let t=(e=r.message)!=null?e:"";if(r.file){let a="https://github.com/muxinc/elements/blob/main/errors/";t+=` ${be("Read more: ")}
|
|
774
|
+
${a}${r.file}`}$t(t)}var Je={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Yt={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Vd=Object.freeze({length:0,start(r){let t=r>>>0;if(t>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${t}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(r){let t=r>>>0;if(t>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${t}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),$d=Ia.filter(r=>r!=="error"),Yd=Object.values(Je).filter(r=>![Je.PLAYSINLINE].includes(r)),zd=Object.values(Yt);function Ho(r){r.querySelectorAll(":scope > track").forEach(t=>{var e;(e=r.media)==null||e.append(t.cloneNode())}),$d.forEach(t=>{var e;(e=r.media)==null||e.addEventListener(t,a=>{r.dispatchEvent(new Event(a.type))})})}var wa=class extends Pe.HTMLElement{static get observedAttributes(){return[...Yd,...zd]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(a=>{var n;(n=this.media)==null||n.append(a.cloneNode())});let t=a=>{for(let n of a)n.type==="childList"&&(n.removedNodes.forEach(u=>{var y,I;let M=(y=this.media)==null?void 0:y.querySelector(`track[src="${u.src}"]`);M&&((I=this.media)==null||I.removeChild(M))}),n.addedNodes.forEach(u=>{var M;(M=this.media)==null||M.append(u.cloneNode())}))};new MutationObserver(t).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(t,e,a){switch(t){case Yt.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Yt.VOLUME:{let n=+a;this.media&&!Number.isNaN(n)&&(this.media.volume=n);return}case Yt.PLAYBACKRATE:{let n=+a;this.media&&!Number.isNaN(n)&&(this.media.playbackRate=n,this.media.defaultPlaybackRate=n);return}}}play(){var t,e;return(e=(t=this.media)==null?void 0:t.play())!=null?e:Promise.reject()}pause(){var t;(t=this.media)==null||t.pause()}requestCast(t){var e;return(e=this.media)==null?void 0:e.requestCast(t)}get media(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector("mux-video")}get paused(){var t,e;return(e=(t=this.media)==null?void 0:t.paused)!=null?e:!0}get duration(){var t,e;return(e=(t=this.media)==null?void 0:t.duration)!=null?e:NaN}get ended(){var t,e;return(e=(t=this.media)==null?void 0:t.ended)!=null?e:!1}get buffered(){var t,e;return(e=(t=this.media)==null?void 0:t.buffered)!=null?e:Vd}get readyState(){var t,e;return(e=(t=this.media)==null?void 0:t.readyState)!=null?e:0}get videoWidth(){var t,e;return(e=(t=this.media)==null?void 0:t.videoWidth)!=null?e:0}get videoHeight(){var t,e;return(e=(t=this.media)==null?void 0:t.videoHeight)!=null?e:0}get currentTime(){var t,e;return(e=(t=this.media)==null?void 0:t.currentTime)!=null?e:0}set currentTime(t){this.media&&(this.media.currentTime=Number(t))}get volume(){var t,e;return(e=(t=this.media)==null?void 0:t.volume)!=null?e:1}set volume(t){this.media&&(this.media.volume=Number(t))}get playbackRate(){var t,e;return(e=(t=this.media)==null?void 0:t.playbackRate)!=null?e:1}set playbackRate(t){this.media&&(this.media.playbackRate=Number(t))}get defaultPlaybackRate(){var t;return(t=jt(this.getAttribute(Yt.PLAYBACKRATE)))!=null?t:1}set defaultPlaybackRate(t){t!=null?this.setAttribute(Yt.PLAYBACKRATE,`${t}`):this.removeAttribute(Yt.PLAYBACKRATE)}get crossOrigin(){return Jr(this,Je.CROSSORIGIN)}set crossOrigin(t){this.setAttribute(Je.CROSSORIGIN,`${t}`)}get autoplay(){return Jr(this,Je.AUTOPLAY)!=null}set autoplay(t){t?this.setAttribute(Je.AUTOPLAY,typeof t=="string"?t:""):this.removeAttribute(Je.AUTOPLAY)}get loop(){return Jr(this,Je.LOOP)!=null}set loop(t){t?this.setAttribute(Je.LOOP,""):this.removeAttribute(Je.LOOP)}get muted(){var t,e;return(e=(t=this.media)==null?void 0:t.muted)!=null?e:!1}set muted(t){this.media&&(this.media.muted=Boolean(t))}get defaultMuted(){return Jr(this,Je.MUTED)!=null}set defaultMuted(t){t?this.setAttribute(Je.MUTED,""):this.removeAttribute(Je.MUTED)}get playsInline(){return Jr(this,Je.PLAYSINLINE)!=null}set playsInline(t){ht("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(t){["","none","metadata","auto"].includes(t)?this.setAttribute(Je.PRELOAD,t):this.removeAttribute(Je.PRELOAD)}};function Jr(r,t){return r.media?r.media.getAttribute(t):r.getAttribute(t)}var Ua=wa;var Xi=new Map;function Qi(r){if(Xi.has(r))return Xi.get(r);let t=r.length,e=0,a=0,n=0,u=[];for(let M=0;M<t;M+=1){let y=r[M],I=r[M+1],x=r[M-1];y==="{"&&I==="{"&&x!=="\\"?(n+=1,n===1&&(a=M),M+=1):y==="}"&&I==="}"&&x!=="\\"&&n&&(n-=1,n===0&&(a>e&&(u.push(Object.freeze({type:"string",start:e,end:a,value:r.slice(e,a)})),e=a),u.push(Object.freeze({type:"part",start:a,end:M+2,value:r.slice(e+2,M).trim()})),M+=1,e=M+1))}return e<t&&u.push(Object.freeze({type:"string",start:e,end:t,value:r.slice(e,t)})),Xi.set(r,Object.freeze(u)),Xi.get(r)}var zt=new WeakMap,jo=new WeakMap,dt=class{constructor(t,e){this.expression=e,zt.set(this,t),t.updateParent("")}get attributeName(){return zt.get(this).attr.name}get attributeNamespace(){return zt.get(this).attr.namespaceURI}get value(){return jo.get(this)}set value(t){jo.set(this,t||""),zt.get(this).updateParent(t)}get element(){return zt.get(this).element}get booleanValue(){return zt.get(this).booleanValue}set booleanValue(t){zt.get(this).booleanValue=t}},qr=class{constructor(t,e){this.element=t,this.attr=e,this.partList=[]}get booleanValue(){return this.element.hasAttributeNS(this.attr.namespaceURI,this.attr.name)}set booleanValue(t){if(this.partList.length!==1)throw new DOMException("Operation not supported","NotSupportedError");this.partList[0].value=t?"":null}append(t){this.partList.push(t)}updateParent(t){if(this.partList.length===1&&t===null)this.element.removeAttributeNS(this.attr.namespaceURI,this.attr.name);else{let e=this.partList.map(a=>typeof a=="string"?a:a.value).join("");this.element.setAttributeNS(this.attr.namespaceURI,this.attr.name,e)}}};var Ot=new WeakMap,vt=class{constructor(t,e){this.expression=e,Ot.set(this,[t]),t.textContent=""}get value(){return Ot.get(this).map(t=>t.textContent).join("")}set value(t){this.replace(t)}get previousSibling(){return Ot.get(this)[0].previousSibling}get nextSibling(){return Ot.get(this)[Ot.get(this).length-1].nextSibling}replace(...t){let e=t.map(a=>typeof a=="string"?new Text(a):a);e.length||e.push(new Text("")),Ot.get(this)[0].before(...e);for(let a of Ot.get(this))a.remove();Ot.set(this,e)}};function ei(r){return{processCallback(t,e,a){var n;if(!(typeof a!="object"||!a)){for(let u of e)if(u.expression in a){let M=(n=a[u.expression])!==null&&n!==void 0?n:"";r(u,M)}}}}}function Na(r,t){r.value=String(t)}function Go(r,t){return typeof t=="boolean"&&r instanceof dt&&typeof r.element[r.attributeName]=="boolean"?(r.booleanValue=t,!0):!1}var Fa=ei(Na),Xd=ei((r,t)=>{Go(r,t)||Na(r,t)});function*Qd(r){let t=r.ownerDocument.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null,!1),e;for(;e=t.nextNode();)if(e instanceof Element&&e.hasAttributes())for(let a=0;a<e.attributes.length;a+=1){let n=e.attributes.item(a);if(n&&n.value.includes("{{")){let u=new qr(e,n);for(let M of Qi(n.value))if(M.type==="string")u.append(M.value);else{let y=new dt(u,M.value);u.append(y),yield y}}}else if(e instanceof Text&&e.textContent&&e.textContent.includes("{{")){let a=Qi(e.textContent);for(let n=0;n<a.length;n+=1){let u=a[n];u.end<e.textContent.length&&e.splitText(u.end),u.type==="part"&&(yield new vt(e,u.value));break}}}var Zi=new WeakMap,Ji=new WeakMap,bt=class extends DocumentFragment{constructor(t,e,a=Fa){var n,u;super(),Object.getPrototypeOf(this)!==bt.prototype&&Object.setPrototypeOf(this,bt.prototype),this.appendChild(t.content.cloneNode(!0)),Ji.set(this,Array.from(Qd(this))),Zi.set(this,a),(u=(n=Zi.get(this)).createCallback)===null||u===void 0||u.call(n,this,Ji.get(this),e),Zi.get(this).processCallback(this,Ji.get(this),e)}update(t){Zi.get(this).processCallback(this,Ji.get(this),t)}};var ti=new WeakMap,ri=class{constructor(t,e){this.element=t;this.type=e;this.element.addEventListener(this.type,this);let a=ti.get(this.element);a&&a.set(this.type,this)}set(t){if(typeof t=="function")this.handleEvent=t.bind(this.element);else if(typeof t=="object"&&typeof t.handleEvent=="function")this.handleEvent=t.handleEvent.bind(t);else{this.element.removeEventListener(this.type,this);let e=ti.get(this.element);e&&e.delete(this.type)}}static for(t){ti.has(t.element)||ti.set(t.element,new Map);let e=t.attributeName.slice(2),a=ti.get(t.element);return a&&a.has(e)?a.get(e):new ri(t.element,e)}};function Zd(r,t){return r instanceof dt&&r.attributeName.startsWith("on")?(ri.for(r).set(t),r.element.removeAttributeNS(r.attributeNamespace,r.attributeName),!0):!1}function Jd(r,t){return t instanceof ii&&r instanceof vt?(t.renderInto(r),!0):!1}function qd(r,t){return t instanceof DocumentFragment&&r instanceof vt?(t.childNodes.length&&r.replace(...t.childNodes),!0):!1}function ec(r,t){if(r instanceof dt){let e=r.attributeNamespace,a=r.element.getAttributeNS(e,r.attributeName);return String(t)!==a&&(r.value=String(t)),!0}return r.value=String(t),!0}function tc(r,t){if(typeof t=="boolean"&&r instanceof dt){let e=r.attributeNamespace,a=r.element.hasAttributeNS(e,r.attributeName);return t!==a&&(r.booleanValue=t),!0}return!1}function rc(r,t){return t===!1&&r instanceof vt?(r.replace(""),!0):!1}function ic(r,t){tc(r,t)||Zd(r,t)||rc(r,t)||Jd(r,t)||qd(r,t)||ec(r,t)}var Ba=new WeakMap,Vo=new WeakMap,$o=new WeakMap,ii=class{constructor(t,e,a){this.strings=t;this.values=e;this.processor=a}get template(){if(Ba.has(this.strings))return Ba.get(this.strings);{let t=document.createElement("template"),e=this.strings.length-1;return t.innerHTML=this.strings.reduce((a,n,u)=>a+n+(u<e?`{{ ${u} }}`:""),""),Ba.set(this.strings,t),t}}renderInto(t){let e=this.template;if(Vo.get(t)!==e){Vo.set(t,e);let n=new bt(e,this.values,this.processor);$o.set(t,n),t instanceof vt?t.replace(...n.children):t.appendChild(n);return}let a=$o.get(t);a&&a.update(this.values)}},Yo=new Map,nc=ei(ic);function ce(r,...t){let e=[""],a=[],n,u=!1,M=(y,I=[])=>{e[e.length-1]=e[e.length-1]+y[0],I.forEach((x,A)=>{(n=x==null?void 0:x.$static$)!==void 0?(n.forEach(D=>{M(D.strings,D.values)}),e[e.length-1]=e[e.length-1]+y[A+1],u=!0):(a.push(x),e.push(y[A+1]))})};if(M(r,t),u){let y=e.join("$$html$$");r=Yo.get(y),r===void 0&&(e.raw=e,Yo.set(y,r=e)),t=a}return new ii(r,t,nc)}function qi(r,t){r.renderInto(t)}function Ye(r,t){let e=document.createElement("template");return e.innerHTML=r,new bt(e,t)}var Ka=(...r)=>({$static$:r.map(t=>t instanceof ii?t:/\w-/.test(t)?{strings:[t]}:{strings:[]})});var Xo=`
|
|
775
775
|
:host {
|
|
776
776
|
cursor: pointer;
|
|
777
777
|
}
|
|
778
778
|
media-time-display {
|
|
779
779
|
color: inherit;
|
|
780
780
|
}
|
|
781
|
-
`,
|
|
781
|
+
`,Qo=ot.createElement("template");Qo.innerHTML=`
|
|
782
782
|
<style>
|
|
783
|
-
${
|
|
783
|
+
${Xo}
|
|
784
784
|
</style>
|
|
785
785
|
<media-time-display show-duration></media-time-display>
|
|
786
|
-
`;var
|
|
786
|
+
`;var zo=["Enter"," "],ni,Er,en,pr=class extends Pe.HTMLElement{constructor(){var e,a;super();Le(this,Er);Le(this,ni,void 0);this.attachShadow({mode:"open"}),(e=this.shadowRoot)==null||e.appendChild(this.constructor.template.content.cloneNode(!0)),this.timeDisplayEl=(a=this.shadowRoot)==null?void 0:a.querySelector("media-time-display")}static get observedAttributes(){return["hide-duration","remaining","disabled","aria-disabled"]}toggleTimeDisplay(){var e,a,n;(e=this.timeDisplayEl)!=null&&e.hasAttribute("remaining")?(a=this.timeDisplayEl)==null||a.removeAttribute("remaining"):(n=this.timeDisplayEl)==null||n.setAttribute("remaining","")}connectedCallback(){let e=a=>{let{key:n}=a;if(!zo.includes(n)){this.removeEventListener("keyup",e);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:n,altKey:u,key:M}=a;if(n||u||!zo.includes(M)){this.removeEventListener("keyup",e);return}this.addEventListener("keyup",e)}),this.addEventListener("click",this.toggleTimeDisplay),qe(this,ni,setInterval(Me(this,Er,en).bind(this),200)),requestAnimationFrame(()=>Me(this,Er,en).call(this))}disconnectedCallback(){clearInterval(ge(this,ni))}attributeChangedCallback(e,a,n){var u,M;e==="hide-duration"&&Me(this,Er,en).call(this),["remaining","disabled","aria-disabled"].includes(e)&&a!==n&&(n==null?(u=this.timeDisplayEl)==null||u.removeAttribute(e):(M=this.timeDisplayEl)==null||M.setAttribute(e,n))}};ni=new WeakMap,Er=new WeakSet,en=function(){var a,n,u,M;getComputedStyle(this).getPropertyValue("--media-duration-display").trim()==="none"||this.getAttribute("hide-duration")!=null?(a=this.timeDisplayEl)!=null&&a.hasAttribute("show-duration")&&((n=this.timeDisplayEl)==null||n.removeAttribute("show-duration")):(u=this.timeDisplayEl)!=null&&u.hasAttribute("show-duration")||(M=this.timeDisplayEl)==null||M.setAttribute("show-duration","")},pr.styles=Xo,pr.template=Qo;Pe.customElements.get("mxp-time-display")||(Pe.customElements.define("mxp-time-display",pr),Pe.MxpTimeDisplay=pr);var Zo=`:host(:not([audio])) {
|
|
787
787
|
--secondary-color: transparent;
|
|
788
788
|
}
|
|
789
789
|
|
|
@@ -1009,46 +1009,46 @@ media-time-display {
|
|
|
1009
1009
|
flex-grow: 1;
|
|
1010
1010
|
font-size: 21px;
|
|
1011
1011
|
}
|
|
1012
|
-
`;var
|
|
1012
|
+
`;var Jo=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="airplay">
|
|
1013
1013
|
<path d="M13.19 14.22a.25.25 0 0 0-.38 0l-5.46 6.37a.25.25 0 0 0 .19.41h10.92a.25.25 0 0 0 .19-.41l-5.46-6.37Z"/>
|
|
1014
1014
|
<path d="M22 3H4a1 1 0 0 0-1 1v13a1 1 0 0 0 1 1h2.94L8 16.75H4.25V4.25h17.5v12.5H18L19.06 18H22a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Z"/>
|
|
1015
1015
|
</svg>
|
|
1016
|
-
`;var
|
|
1016
|
+
`;var qo=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="off">
|
|
1017
1017
|
<path d="M22.832 5.68a2.58 2.58 0 0 0-2.3-2.5c-1.81-.12-4.67-.18-7.53-.18-2.86 0-5.72.06-7.53.18a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c1.81.12 4.67.18 7.53.18 2.86 0 5.72-.06 7.53-.18a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.137-.21-8.283 0-12.42a1.11 1.11 0 0 1 .91-1.11c1.67-.11 4.43-.18 7.43-.18s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.137.21 8.283 0 12.42ZM10.843 14a1.55 1.55 0 0 1-.76.18 1.57 1.57 0 0 1-.71-.18 1.69 1.69 0 0 1-.57-.42 2.099 2.099 0 0 1-.38-.58 2.47 2.47 0 0 1 0-1.64 2 2 0 0 1 .39-.66 1.73 1.73 0 0 1 .58-.42c.23-.103.479-.158.73-.16.241-.004.48.044.7.14.199.088.373.222.51.39l1.08-.89a2.179 2.179 0 0 0-.47-.44 2.81 2.81 0 0 0-.54-.32 2.91 2.91 0 0 0-.58-.15 2.71 2.71 0 0 0-.56 0 4.08 4.08 0 0 0-1.38.15 3.27 3.27 0 0 0-1.09.67 3.14 3.14 0 0 0-.71 1.06 3.62 3.62 0 0 0-.26 1.39 3.57 3.57 0 0 0 .26 1.38 3 3 0 0 0 .71 1.06c.316.293.687.52 1.09.67.443.16.91.238 1.38.23a3.2 3.2 0 0 0 1.28-.27c.401-.183.747-.47 1-.83l-1.17-.88a1.42 1.42 0 0 1-.53.52Zm6.62 0a1.58 1.58 0 0 1-.76.18 1.54 1.54 0 0 1-.7-.18 1.69 1.69 0 0 1-.57-.42 2.12 2.12 0 0 1-.43-.58 2.29 2.29 0 0 1 .39-2.3 1.84 1.84 0 0 1 1.32-.58c.241-.003.48.045.7.14.199.088.373.222.51.39l1.08-.92a2.43 2.43 0 0 0-.47-.44 3.22 3.22 0 0 0-.53-.29 2.999 2.999 0 0 0-.57-.15 2.87 2.87 0 0 0-.57 0 4.06 4.06 0 0 0-1.36.15 3.17 3.17 0 0 0-1.09.67 3 3 0 0 0-.72 1.06 3.62 3.62 0 0 0-.25 1.39 3.57 3.57 0 0 0 .25 1.38c.16.402.405.764.72 1.06a3.17 3.17 0 0 0 1.09.67c.44.16.904.237 1.37.23.441 0 .877-.092 1.28-.27a2.45 2.45 0 0 0 1-.83l-1.15-.85a1.49 1.49 0 0 1-.54.49Z"/>
|
|
1018
1018
|
</svg>
|
|
1019
|
-
`;var
|
|
1019
|
+
`;var el=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="on">
|
|
1020
1020
|
<path d="M22.832 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.41 10.1a3.63 3.63 0 0 1-1.51.32 4.76 4.76 0 0 1-1.63-.27 4 4 0 0 1-1.28-.83 3.67 3.67 0 0 1-.84-1.26 4.23 4.23 0 0 1-.3-1.63 4.28 4.28 0 0 1 .3-1.64 3.53 3.53 0 0 1 .84-1.21 3.89 3.89 0 0 1 1.29-.8 4.76 4.76 0 0 1 1.63-.27 4.06 4.06 0 0 1 1.35.24c.225.091.44.205.64.34a2.7 2.7 0 0 1 .55.52l-1.27 1a1.79 1.79 0 0 0-.6-.46 2 2 0 0 0-.83-.16 2 2 0 0 0-1.56.69 2.35 2.35 0 0 0-.46.77 2.78 2.78 0 0 0-.16 1c-.009.34.046.68.16 1 .104.283.26.545.46.77.188.21.415.38.67.5a2 2 0 0 0 .84.18 1.87 1.87 0 0 0 .9-.21 1.78 1.78 0 0 0 .65-.6l1.38 1a2.88 2.88 0 0 1-1.22 1.01Zm7.52 0a3.63 3.63 0 0 1-1.51.32 4.76 4.76 0 0 1-1.63-.27 3.89 3.89 0 0 1-1.28-.83 3.55 3.55 0 0 1-.85-1.26 4.23 4.23 0 0 1-.3-1.63 4.28 4.28 0 0 1 .3-1.64 3.43 3.43 0 0 1 .85-1.25 3.75 3.75 0 0 1 1.28-.8 4.76 4.76 0 0 1 1.63-.27 4 4 0 0 1 1.35.24c.225.091.44.205.64.34.21.144.395.32.55.52l-1.27 1a1.79 1.79 0 0 0-.6-.46 2 2 0 0 0-.83-.16 2 2 0 0 0-1.56.69 2.352 2.352 0 0 0-.46.77 3.01 3.01 0 0 0-.16 1c-.003.34.05.678.16 1 .108.282.263.542.46.77.188.21.416.38.67.5a2 2 0 0 0 .84.18 1.87 1.87 0 0 0 .9-.21 1.78 1.78 0 0 0 .65-.6l1.38 1a2.82 2.82 0 0 1-1.21 1.05Z"/>
|
|
1021
1021
|
</svg>
|
|
1022
|
-
`;var
|
|
1022
|
+
`;var tl=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
|
|
1023
1023
|
<path d="M3 15.5V17c2.206 0 4 1.794 4 4h1.5A5.5 5.5 0 0 0 3 15.5Zm0 3V21h2.5A2.5 2.5 0 0 0 3 18.5Z"/>
|
|
1024
1024
|
<path d="M3 12.5V14c3.86 0 7 3.14 7 7h1.5A8.5 8.5 0 0 0 3 12.5Z"/>
|
|
1025
1025
|
<path d="M22 3H4a1 1 0 0 0-1 1v6.984c.424 0 .84.035 1.25.086V4.25h17.5v15.5h-8.82c.051.41.086.826.086 1.25H22a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Z"/>
|
|
1026
1026
|
</svg>
|
|
1027
|
-
`;var
|
|
1027
|
+
`;var rl=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
|
|
1028
1028
|
<path d="M3 15.5V17c2.206 0 4 1.794 4 4h1.5A5.5 5.5 0 0 0 3 15.5Zm0 3V21h2.5A2.5 2.5 0 0 0 3 18.5Z"/>
|
|
1029
1029
|
<path d="M3 12.5V14c3.86 0 7 3.14 7 7h1.5A8.5 8.5 0 0 0 3 12.5Z"/>
|
|
1030
1030
|
<path d="M22 3H4a1 1 0 0 0-1 1v6.984c.424 0 .84.035 1.25.086V4.25h17.5v15.5h-8.82c.051.41.086.826.086 1.25H22a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Z"/>
|
|
1031
1031
|
<path d="M20.5 5.5h-15v5.811c3.52.906 6.283 3.67 7.189 7.19H20.5V5.5Z"/>
|
|
1032
1032
|
</svg>
|
|
1033
|
-
`;var
|
|
1033
|
+
`;var il=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="enter">
|
|
1034
1034
|
<path d="M20.25 14.5a.76.76 0 0 0-.75.75v4.25h-4.25a.75.75 0 1 0 0 1.5h5a.76.76 0 0 0 .75-.75v-5a.76.76 0 0 0-.75-.75Zm0-11.5h-5a.76.76 0 0 0-.75.75.76.76 0 0 0 .75.75h4.25v4.25a.75.75 0 1 0 1.5 0v-5a.76.76 0 0 0-.75-.75ZM8.75 19.5H4.5v-4.25a.76.76 0 0 0-.75-.75.76.76 0 0 0-.75.75v5a.76.76 0 0 0 .75.75h5a.75.75 0 1 0 0-1.5Zm0-16.5h-5a.76.76 0 0 0-.75.75v5a.76.76 0 0 0 .75.75.76.76 0 0 0 .75-.75V4.5h4.25a.76.76 0 0 0 .75-.75.76.76 0 0 0-.75-.75Z"/>
|
|
1035
1035
|
</svg>
|
|
1036
|
-
`;var
|
|
1036
|
+
`;var nl=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="exit">
|
|
1037
1037
|
<path d="M20.25 14.5h-5a.76.76 0 0 0-.75.75v5a.75.75 0 1 0 1.5 0V16h4.25a.75.75 0 1 0 0-1.5Zm-5-5h5a.75.75 0 1 0 0-1.5H16V3.75a.75.75 0 1 0-1.5 0v5a.76.76 0 0 0 .75.75Zm-6.5 5h-5a.75.75 0 1 0 0 1.5H8v4.25a.75.75 0 1 0 1.5 0v-5a.76.76 0 0 0-.75-.75Zm0-11.5a.76.76 0 0 0-.75.75V8H3.75a.75.75 0 0 0 0 1.5h5a.76.76 0 0 0 .75-.75v-5A.76.76 0 0 0 8.75 3Z"/>
|
|
1038
1038
|
</svg>
|
|
1039
|
-
`;var
|
|
1039
|
+
`;var al=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="pause">
|
|
1040
1040
|
<path d="M6 19.5a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-15a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5v15ZM14.5 4a.5.5 0 0 0-.5.5v15a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-15a.5.5 0 0 0-.5-.5h-3Z"/>
|
|
1041
1041
|
</svg>
|
|
1042
|
-
`;var
|
|
1042
|
+
`;var sl=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
|
|
1043
1043
|
<path d="M22 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h6.75v-1.25h-6.5V4.25h17.5v6.5H23V4a1 1 0 0 0-1-1Zm0 10h-8a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-6a1 1 0 0 0-1-1Zm-.5 6.5h-7v-5h7v5Z"/>
|
|
1044
1044
|
</svg>
|
|
1045
|
-
`;var
|
|
1045
|
+
`;var ol=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
|
|
1046
1046
|
<path d="M22 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h6.75v-1.25h-6.5V4.25h17.5v6.5H23V4a1 1 0 0 0-1-1Zm0 10h-8a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-6a1 1 0 0 0-1-1Zm-.5 6.5h-7v-5h7v5Z"/>
|
|
1047
1047
|
</svg>
|
|
1048
|
-
`;var
|
|
1048
|
+
`;var ll=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="play">
|
|
1049
1049
|
<path d="m6.73 20.93 14.05-8.54a.46.46 0 0 0 0-.78L6.73 3.07a.48.48 0 0 0-.73.39v17.07a.48.48 0 0 0 .73.4Z"/>
|
|
1050
1050
|
</svg>
|
|
1051
|
-
`;var
|
|
1051
|
+
`;var ul=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="backward">
|
|
1052
1052
|
<path d="M11 6V3L5.37 7 11 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 11 6Z"/>
|
|
1053
1053
|
<text
|
|
1054
1054
|
class="value"
|
|
@@ -1058,7 +1058,7 @@ media-time-display {
|
|
|
1058
1058
|
{{value}}
|
|
1059
1059
|
</text>
|
|
1060
1060
|
</svg>
|
|
1061
|
-
`;var
|
|
1061
|
+
`;var dl=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="forward">
|
|
1062
1062
|
<path d="M11 6V3l5.61 4L11 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 11 6Z"/>
|
|
1063
1063
|
<text
|
|
1064
1064
|
class="value"
|
|
@@ -1068,21 +1068,21 @@ media-time-display {
|
|
|
1068
1068
|
{{value}}
|
|
1069
1069
|
</text>
|
|
1070
1070
|
</svg>
|
|
1071
|
-
`;var
|
|
1071
|
+
`;var cl=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="high">
|
|
1072
1072
|
<path d="m11.14 4.86-4 4a.49.49 0 0 1-.35.14H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.5.5 0 0 0 .85-.36V5.21a.5.5 0 0 0-.86-.35Zm2.74-1.56v1.52A7.52 7.52 0 0 1 19.47 12a7.52 7.52 0 0 1-5.59 7.18v1.52A9 9 0 0 0 21 12a9 9 0 0 0-7.12-8.7Zm3.56 8.7a5.49 5.49 0 0 0-3.56-5.1v1.66a3.93 3.93 0 0 1 0 6.88v1.66a5.49 5.49 0 0 0 3.56-5.1Z"/>
|
|
1073
1073
|
</svg>
|
|
1074
|
-
`;var
|
|
1074
|
+
`;var fl=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="low">
|
|
1075
1075
|
<path d="m11.14 4.853-4 4a.49.49 0 0 1-.35.14H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.5.5 0 0 0 .85-.36V5.203a.5.5 0 0 0-.86-.35Zm6.3 7.14a5.49 5.49 0 0 0-3.56-5.1v1.66a3.93 3.93 0 0 1 0 6.88v1.66a5.49 5.49 0 0 0 3.56-5.1Z"/>
|
|
1076
1076
|
</svg>
|
|
1077
|
-
`;var
|
|
1077
|
+
`;var hl=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="medium">
|
|
1078
1078
|
<path d="m11.14 4.853-4 4a.49.49 0 0 1-.35.14H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.5.5 0 0 0 .85-.36V5.203a.5.5 0 0 0-.86-.35Zm6.3 7.14a5.49 5.49 0 0 0-3.56-5.1v1.66a3.93 3.93 0 0 1 0 6.88v1.66a5.49 5.49 0 0 0 3.56-5.1Z"/>
|
|
1079
1079
|
</svg>
|
|
1080
|
-
`;var
|
|
1080
|
+
`;var vl=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="off">
|
|
1081
1081
|
<path d="m3 4.05 4.48 4.47-.33.33a.49.49 0 0 1-.36.15H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.48.48 0 0 0 .36.15.5.5 0 0 0 .5-.5v-5.75l4.67 4.66a7.71 7.71 0 0 1-2.79 1.47v1.52a9.32 9.32 0 0 0 3.87-1.91L20 21l1-1L4.06 3 3 4.05Zm5.36 5.36 2.39 2.39V17L8 14.26a1.74 1.74 0 0 0-1.24-.51H4.25v-3.5h2.54A1.74 1.74 0 0 0 8 9.74l.36-.33ZM19.47 12a7.19 7.19 0 0 1-.89 3.47l1.11 1.1A8.64 8.64 0 0 0 21 12a9 9 0 0 0-7.12-8.7v1.52A7.52 7.52 0 0 1 19.47 12ZM12 8.88V5.21a.5.5 0 0 0-.5-.5.48.48 0 0 0-.36.15L9.56 6.44 12 8.88ZM15.91 12a4.284 4.284 0 0 1-.07.72l1.22 1.22a5.2 5.2 0 0 0 .38-1.94 5.49 5.49 0 0 0-3.56-5.1v1.66A4 4 0 0 1 15.91 12Z"/>
|
|
1082
1082
|
</svg>
|
|
1083
|
-
`;var
|
|
1083
|
+
`;var ml=()=>Ye(Jo),gl=()=>Ye(qo),pl=()=>Ye(el),El=()=>Ye(tl),yl=()=>Ye(rl),Tl=()=>Ye(il),bl=()=>Ye(nl),Al=()=>Ye(al),_l=()=>Ye(sl),Sl=()=>Ye(ol),xl=()=>Ye(ll),Ll=r=>Ye(ul,r),Dl=r=>Ye(dl,r),Il=()=>Ye(cl),Ml=()=>Ye(fl),Rl=()=>Ye(hl),Ol=()=>Ye(vl);var At={LG:"large",SM:"small",XS:"extra-small"},rn,Cl,tn=class extends ca{constructor(){super();Le(this,rn);Me(this,rn,Cl).call(this)}static get observedAttributes(){return["audio","has-open-dialog","has-src","nohotkeys","hotkeys","stream-type","player-size","default-hidden-captions","forward-seek-offset","backward-seek-offset","playbackrates","default-show-remaining-time","poster","placeholder","title"]}attributeChangedCallback(){this.render()}render(){var a,n,u;let e={hasSrc:this.hasAttribute("has-src"),isDialogOpen:this.hasAttribute("has-open-dialog"),audio:this.hasAttribute("audio"),nohotkeys:this.hasAttribute("nohotkeys"),hotkeys:this.getAttribute("hotkeys"),streamType:this.getAttribute("stream-type"),playerSize:this.getAttribute("player-size"),defaultHiddenCaptions:this.hasAttribute("default-hidden-captions"),forwardSeekOffset:this.getAttribute("forward-seek-offset"),backwardSeekOffset:this.getAttribute("backward-seek-offset"),playbackRates:this.getAttribute("playbackrates"),defaultShowRemainingTime:this.hasAttribute("default-show-remaining-time"),poster:this.getAttribute("poster"),placeholder:this.getAttribute("placeholder"),title:this.getAttribute("title")};e.nohotkeys=e.nohotkeys||!e.hasSrc||e.isDialogOpen,[pe.LIVE,pe.LL_LIVE,pe.DVR,pe.LL_DVR].includes(e.streamType)&&(e.hotkeys=e.hotkeys||"",e.hotkeys+=" noarrowleft noarrowright"),qi(ce`
|
|
1084
1084
|
<style>
|
|
1085
|
-
${
|
|
1085
|
+
${Zo}
|
|
1086
1086
|
</style>
|
|
1087
1087
|
<media-controller
|
|
1088
1088
|
gestures-disabled="${!e.hasSrc||e.isDialogOpen}"
|
|
@@ -1100,83 +1100,83 @@ media-time-display {
|
|
|
1100
1100
|
placeholder-src="${(n=e.placeholder)!=null?n:!1}"
|
|
1101
1101
|
></media-poster-image>
|
|
1102
1102
|
<media-loading-indicator slot="centered-chrome" no-auto-hide></media-loading-indicator>
|
|
1103
|
-
${
|
|
1103
|
+
${Sc(e)}
|
|
1104
1104
|
<slot></slot>
|
|
1105
1105
|
</media-controller>
|
|
1106
|
-
`,this.shadowRoot),(u=this.shadowRoot)==null||u.querySelectorAll("*").forEach(M=>{if(!M.localName.includes("-"))return;let y=M.localName.match(/^([^-]+)-(.*)-(button|range|display)$/);if(!y)return;let[,,I,x]=y;I==="text"&&M.classList.contains("title-display")&&(I="title");let A=M.closest('[slot="top-chrome"]')?"top":M.closest('[slot="centered-chrome"]')?"center":"bottom";M.setAttribute("part",`${A} ${I} ${x}`)})}};rn=new WeakSet,
|
|
1106
|
+
`,this.shadowRoot),(u=this.shadowRoot)==null||u.querySelectorAll("*").forEach(M=>{if(!M.localName.includes("-"))return;let y=M.localName.match(/^([^-]+)-(.*)-(button|range|display)$/);if(!y)return;let[,,I,x]=y;I==="text"&&M.classList.contains("title-display")&&(I="title");let A=M.closest('[slot="top-chrome"]')?"top":M.closest('[slot="centered-chrome"]')?"center":"bottom";M.setAttribute("part",`${A} ${I} ${x}`)})}};rn=new WeakSet,Cl=function(){var e,a,n;try{(e=window==null?void 0:window.CSS)==null||e.registerProperty({name:"--primary-color",syntax:"<color>",inherits:!0,initialValue:"white"}),(a=window==null?void 0:window.CSS)==null||a.registerProperty({name:"--secondary-color",syntax:"<color>",inherits:!0,initialValue:"transparent"}),(n=window==null?void 0:window.CSS)==null||n.registerProperty({name:"--controls-backdrop-color",syntax:"<color>",inherits:!0,initialValue:"rgba(0, 0, 0, 0.6)"})}catch{}};Pe.customElements.get("media-theme-mux")||Pe.customElements.define("media-theme-mux",tn);var Sc=r=>{let{streamType:t,playerSize:e,audio:a}=r;if(a)switch(t){case pe.LIVE:case pe.LL_LIVE:return Dc(r);case pe.DVR:case pe.LL_DVR:return Lc(r);case pe.ON_DEMAND:default:return xc(r)}switch(t){case pe.LIVE:case pe.LL_LIVE:switch(e){case At.LG:return Cc(r);case At.SM:return Oc(r);case At.XS:return Rc(r)}case pe.DVR:case pe.LL_DVR:switch(e){case At.LG:return wc(r);case At.SM:return kc(r);case At.XS:return Pc(r)}case pe.ON_DEMAND:default:switch(e){case At.LG:return Mc(r);case At.SM:return Ic(r);case At.XS:return Wa(r)}}},st=r=>ce`
|
|
1107
1107
|
<media-play-button disabled="${!r.hasSrc||r.isDialogOpen}" aria-disabled="${!r.hasSrc||r.isDialogOpen&&"true"}">
|
|
1108
|
-
${
|
|
1109
|
-
${
|
|
1110
|
-
</media-play-button>`,
|
|
1108
|
+
${xl()}
|
|
1109
|
+
${Al()}
|
|
1110
|
+
</media-play-button>`,yr=({backwardSeekOffset:r,hasSrc:t,isDialogOpen:e})=>ce`
|
|
1111
1111
|
<media-seek-backward-button seek-offset="${r}" disabled="${!t||e}" aria-disabled="${!t||e&&"true"}">
|
|
1112
|
-
${xl({value:r})}
|
|
1113
|
-
</media-seek-backward-button>`,yr=({forwardSeekOffset:r,hasSrc:t,isDialogOpen:e})=>ce`
|
|
1114
|
-
<media-seek-forward-button seek-offset="${r}" disabled="${!t||e}" aria-disabled="${!t||e&&"true"}">
|
|
1115
1112
|
${Ll({value:r})}
|
|
1113
|
+
</media-seek-backward-button>`,Tr=({forwardSeekOffset:r,hasSrc:t,isDialogOpen:e})=>ce`
|
|
1114
|
+
<media-seek-forward-button seek-offset="${r}" disabled="${!t||e}" aria-disabled="${!t||e&&"true"}">
|
|
1115
|
+
${Dl({value:r})}
|
|
1116
1116
|
</media-seek-forward-button>`,mt=({isDialogOpen:r})=>ce`
|
|
1117
1117
|
<media-mute-button disabled="${r}" aria-disabled="${r&&"true"}">
|
|
1118
|
-
${Dl()}
|
|
1119
|
-
${Ml()}
|
|
1120
1118
|
${Il()}
|
|
1121
1119
|
${Rl()}
|
|
1122
|
-
|
|
1120
|
+
${Ml()}
|
|
1121
|
+
${Ol()}
|
|
1122
|
+
</media-mute-button>`,Xt=({defaultHiddenCaptions:r,isDialogOpen:t})=>ce`
|
|
1123
1123
|
<media-captions-button default-showing="${!r}" disabled="${t}" aria-disabled="${t&&"true"}">
|
|
1124
|
-
${ml()}
|
|
1125
1124
|
${gl()}
|
|
1125
|
+
${pl()}
|
|
1126
1126
|
</media-captions-button>`,gt=r=>ce`
|
|
1127
1127
|
<media-airplay-button disabled="${!r.hasSrc||r.isDialogOpen}" aria-disabled="${!r.hasSrc||r.isDialogOpen&&"true"}">
|
|
1128
|
-
${
|
|
1129
|
-
</media-airplay-button>`,
|
|
1128
|
+
${ml()}
|
|
1129
|
+
</media-airplay-button>`,Qt=r=>ce`
|
|
1130
1130
|
<media-pip-button disabled="${!r.hasSrc||r.isDialogOpen}" aria-disabled="${!r.hasSrc||r.isDialogOpen&&"true"}">
|
|
1131
|
-
${Al()}
|
|
1132
1131
|
${_l()}
|
|
1133
|
-
|
|
1132
|
+
${Sl()}
|
|
1133
|
+
</media-pip-button>`,Zt=r=>ce`
|
|
1134
1134
|
<media-fullscreen-button disabled="${!r.hasSrc||r.isDialogOpen}" aria-disabled="${!r.hasSrc||r.isDialogOpen&&"true"}">
|
|
1135
|
-
${yl()}
|
|
1136
1135
|
${Tl()}
|
|
1136
|
+
${bl()}
|
|
1137
1137
|
</media-fullscreen-button>`,pt=r=>ce`
|
|
1138
1138
|
<media-cast-button disabled="${!r.hasSrc||r.isDialogOpen}" aria-disabled="${!r.hasSrc||r.isDialogOpen&&"true"}">
|
|
1139
|
-
${pl()}
|
|
1140
1139
|
${El()}
|
|
1140
|
+
${yl()}
|
|
1141
1141
|
</media-cast-button>`,nn=({playbackRates:r,isDialogOpen:t})=>ce`
|
|
1142
1142
|
<media-playback-rate-button rates="${r!=null?r:!1}" disabled="${t}" aria-disabled="${t&&"true"}">
|
|
1143
1143
|
</media-playback-rate-button>`,_t=({isDialogOpen:r})=>ce`
|
|
1144
1144
|
<media-volume-range disabled="${r}" aria-disabled="${r&&"true"}">
|
|
1145
|
-
</media-volume-range>`,
|
|
1145
|
+
</media-volume-range>`,br=r=>ce`
|
|
1146
1146
|
<media-time-range disabled="${!r.hasSrc||r.isDialogOpen}" aria-disabled="${!r.hasSrc||r.isDialogOpen&&"true"}">
|
|
1147
1147
|
</media-time-range>`,an=({defaultShowRemainingTime:r,hasSrc:t,isDialogOpen:e})=>ce`
|
|
1148
1148
|
<mxp-time-display remaining="${r}" disabled="${!t||e}" aria-disabled="${!t||e&&"true"}">
|
|
1149
1149
|
</mxp-time-display>`,St=({title:r})=>ce`
|
|
1150
|
-
<media-text-display part="title" class="title-display">${r}</media-text-display>`,
|
|
1150
|
+
<media-text-display part="title" class="title-display">${r}</media-text-display>`,xc=r=>ce`
|
|
1151
1151
|
${r.title?`<media-control-bar>${St(r)}</media-control-bar>`:ce``}
|
|
1152
1152
|
<media-control-bar>
|
|
1153
1153
|
${st(r)}
|
|
1154
|
-
${Er(r)}
|
|
1155
1154
|
${yr(r)}
|
|
1156
|
-
${an(r)}
|
|
1157
1155
|
${Tr(r)}
|
|
1156
|
+
${an(r)}
|
|
1157
|
+
${br(r)}
|
|
1158
1158
|
${mt(r)}
|
|
1159
1159
|
${_t(r)}
|
|
1160
1160
|
${nn(r)}
|
|
1161
1161
|
${gt(r)}
|
|
1162
1162
|
${pt(r)}
|
|
1163
1163
|
</media-control-bar>
|
|
1164
|
-
`,
|
|
1164
|
+
`,Lc=r=>ce`
|
|
1165
1165
|
${r.title?`<media-control-bar>${St(r)}</media-control-bar>`:ce``}
|
|
1166
1166
|
<media-control-bar>
|
|
1167
1167
|
${st(r)}
|
|
1168
1168
|
<slot name="seek-live"></slot>
|
|
1169
|
-
${Er(r)}
|
|
1170
1169
|
${yr(r)}
|
|
1171
|
-
${an(r)}
|
|
1172
1170
|
${Tr(r)}
|
|
1171
|
+
${an(r)}
|
|
1172
|
+
${br(r)}
|
|
1173
1173
|
${mt(r)}
|
|
1174
1174
|
${_t(r)}
|
|
1175
1175
|
${nn(r)}
|
|
1176
1176
|
${gt(r)}
|
|
1177
1177
|
${pt(r)}
|
|
1178
1178
|
</media-control-bar>
|
|
1179
|
-
`,
|
|
1179
|
+
`,Dc=r=>ce`
|
|
1180
1180
|
${r.title?`<media-control-bar>${St(r)}</media-control-bar>`:ce``}
|
|
1181
1181
|
<media-control-bar>
|
|
1182
1182
|
${st(r)}
|
|
@@ -1186,13 +1186,13 @@ media-time-display {
|
|
|
1186
1186
|
${gt(r)}
|
|
1187
1187
|
${pt(r)}
|
|
1188
1188
|
</media-control-bar>
|
|
1189
|
-
`,
|
|
1189
|
+
`,Wa=r=>ce`
|
|
1190
1190
|
<media-control-bar slot="top-chrome">
|
|
1191
|
-
${
|
|
1191
|
+
${Xt(r)}
|
|
1192
1192
|
<div class="spacer"></div>
|
|
1193
1193
|
${gt(r)}
|
|
1194
1194
|
${pt(r)}
|
|
1195
|
-
${
|
|
1195
|
+
${Qt(r)}
|
|
1196
1196
|
</media-control-bar>
|
|
1197
1197
|
<div slot="centered-chrome" class="center-controls">
|
|
1198
1198
|
${st(r)}
|
|
@@ -1200,64 +1200,64 @@ media-time-display {
|
|
|
1200
1200
|
<media-control-bar>
|
|
1201
1201
|
${mt(r)}
|
|
1202
1202
|
<div class="spacer"></div>
|
|
1203
|
-
${
|
|
1203
|
+
${Zt(r)}
|
|
1204
1204
|
</media-control-bar>
|
|
1205
|
-
`,
|
|
1205
|
+
`,Ic=r=>ce`
|
|
1206
1206
|
<media-control-bar slot="top-chrome">
|
|
1207
1207
|
${r.title?St(r):ce``}
|
|
1208
1208
|
<div class="spacer"></div>
|
|
1209
|
-
${
|
|
1209
|
+
${Xt(r)}
|
|
1210
1210
|
${gt(r)}
|
|
1211
1211
|
${pt(r)}
|
|
1212
|
-
${
|
|
1212
|
+
${Qt(r)}
|
|
1213
1213
|
</media-control-bar>
|
|
1214
1214
|
<div slot="centered-chrome" class="center-controls">
|
|
1215
|
-
${Er(r)}
|
|
1216
|
-
${st(r)}
|
|
1217
1215
|
${yr(r)}
|
|
1216
|
+
${st(r)}
|
|
1217
|
+
${Tr(r)}
|
|
1218
1218
|
</div>
|
|
1219
|
-
${
|
|
1219
|
+
${br(r)}
|
|
1220
1220
|
<media-control-bar>
|
|
1221
1221
|
${an(r)}
|
|
1222
1222
|
${mt(r)}
|
|
1223
1223
|
${_t(r)}
|
|
1224
1224
|
<div class="spacer"></div>
|
|
1225
1225
|
${nn(r)}
|
|
1226
|
-
${
|
|
1226
|
+
${Zt(r)}
|
|
1227
1227
|
<div class="padding-2"></div>
|
|
1228
1228
|
</media-control-bar>
|
|
1229
|
-
`,
|
|
1229
|
+
`,Mc=r=>ce`
|
|
1230
1230
|
<media-control-bar slot="top-chrome">
|
|
1231
1231
|
${r.title?St(r):ce``}
|
|
1232
1232
|
</media-control-bar>
|
|
1233
1233
|
<div slot="centered-chrome" class="center-controls">
|
|
1234
1234
|
${st(r)}
|
|
1235
1235
|
</div>
|
|
1236
|
-
${
|
|
1236
|
+
${br(r)}
|
|
1237
1237
|
<media-control-bar>
|
|
1238
1238
|
${st(r)}
|
|
1239
|
-
${Er(r)}
|
|
1240
1239
|
${yr(r)}
|
|
1240
|
+
${Tr(r)}
|
|
1241
1241
|
${an(r)}
|
|
1242
1242
|
${mt(r)}
|
|
1243
1243
|
${_t(r)}
|
|
1244
1244
|
<div class="spacer"></div>
|
|
1245
1245
|
${nn(r)}
|
|
1246
|
-
${
|
|
1246
|
+
${Xt(r)}
|
|
1247
1247
|
${gt(r)}
|
|
1248
1248
|
${pt(r)}
|
|
1249
|
-
${Xt(r)}
|
|
1250
1249
|
${Qt(r)}
|
|
1250
|
+
${Zt(r)}
|
|
1251
1251
|
<div class="padding-2"></div>
|
|
1252
1252
|
</media-control-bar>
|
|
1253
|
-
`,
|
|
1253
|
+
`,Rc=Wa,Oc=r=>ce`
|
|
1254
1254
|
<media-control-bar slot="top-chrome">
|
|
1255
1255
|
${r.title?St(r):ce``}
|
|
1256
1256
|
<div class="spacer"></div>
|
|
1257
|
-
${
|
|
1257
|
+
${Xt(r)}
|
|
1258
1258
|
${gt(r)}
|
|
1259
1259
|
${pt(r)}
|
|
1260
|
-
${
|
|
1260
|
+
${Qt(r)}
|
|
1261
1261
|
</media-control-bar>
|
|
1262
1262
|
<div slot="centered-chrome" class="center-controls">
|
|
1263
1263
|
${st(r)}
|
|
@@ -1267,9 +1267,9 @@ media-time-display {
|
|
|
1267
1267
|
${_t(r)}
|
|
1268
1268
|
<slot name="seek-live"></slot>
|
|
1269
1269
|
<div class="spacer"></div>
|
|
1270
|
-
${
|
|
1270
|
+
${Zt(r)}
|
|
1271
1271
|
</media-control-bar>
|
|
1272
|
-
`,
|
|
1272
|
+
`,Cc=r=>ce`
|
|
1273
1273
|
<media-control-bar slot="top-chrome">
|
|
1274
1274
|
${r.title?St(r):ce``}
|
|
1275
1275
|
</media-control-bar>
|
|
@@ -1281,59 +1281,59 @@ media-time-display {
|
|
|
1281
1281
|
${_t(r)}
|
|
1282
1282
|
<slot name="seek-live"></slot>
|
|
1283
1283
|
<div class="spacer"></div>
|
|
1284
|
-
${
|
|
1284
|
+
${Xt(r)}
|
|
1285
1285
|
${gt(r)}
|
|
1286
1286
|
${pt(r)}
|
|
1287
|
-
${Xt(r)}
|
|
1288
1287
|
${Qt(r)}
|
|
1288
|
+
${Zt(r)}
|
|
1289
1289
|
</media-control-bar>
|
|
1290
|
-
`,
|
|
1290
|
+
`,Pc=Wa,kc=r=>ce`
|
|
1291
1291
|
<media-control-bar slot="top-chrome">
|
|
1292
1292
|
${r.title?St(r):ce``}
|
|
1293
1293
|
<div class="spacer"></div>
|
|
1294
|
-
${
|
|
1294
|
+
${Xt(r)}
|
|
1295
1295
|
${gt(r)}
|
|
1296
1296
|
${pt(r)}
|
|
1297
|
-
${
|
|
1297
|
+
${Qt(r)}
|
|
1298
1298
|
</media-control-bar>
|
|
1299
1299
|
<div slot="centered-chrome" class="center-controls">
|
|
1300
|
-
${Er(r)}
|
|
1301
|
-
${st(r)}
|
|
1302
1300
|
${yr(r)}
|
|
1301
|
+
${st(r)}
|
|
1302
|
+
${Tr(r)}
|
|
1303
1303
|
</div>
|
|
1304
|
-
${
|
|
1304
|
+
${br(r)}
|
|
1305
1305
|
<media-control-bar>
|
|
1306
1306
|
${mt(r)}
|
|
1307
1307
|
${_t(r)}
|
|
1308
1308
|
<slot name="seek-live"></slot>
|
|
1309
1309
|
<div class="spacer"></div>
|
|
1310
|
-
${
|
|
1310
|
+
${Zt(r)}
|
|
1311
1311
|
<div class="padding-2"></div>
|
|
1312
1312
|
</media-control-bar>
|
|
1313
|
-
`,
|
|
1313
|
+
`,wc=r=>ce`
|
|
1314
1314
|
<media-control-bar slot="top-chrome">
|
|
1315
1315
|
${r.title?St(r):ce``}
|
|
1316
1316
|
</media-control-bar>
|
|
1317
1317
|
<div slot="centered-chrome" class="center-controls">
|
|
1318
1318
|
${st(r)}
|
|
1319
1319
|
</div>
|
|
1320
|
-
${
|
|
1320
|
+
${br(r)}
|
|
1321
1321
|
<media-control-bar>
|
|
1322
1322
|
${st(r)}
|
|
1323
|
-
${Er(r)}
|
|
1324
1323
|
${yr(r)}
|
|
1324
|
+
${Tr(r)}
|
|
1325
1325
|
${mt(r)}
|
|
1326
1326
|
${_t(r)}
|
|
1327
1327
|
<slot name="seek-live"></slot>
|
|
1328
1328
|
<div class="spacer"></div>
|
|
1329
|
-
${
|
|
1329
|
+
${Xt(r)}
|
|
1330
1330
|
${gt(r)}
|
|
1331
1331
|
${pt(r)}
|
|
1332
|
-
${Xt(r)}
|
|
1333
1332
|
${Qt(r)}
|
|
1333
|
+
${Zt(r)}
|
|
1334
1334
|
<div class="padding-2"></div>
|
|
1335
1335
|
</media-control-bar>
|
|
1336
|
-
`;var
|
|
1336
|
+
`;var kl=`
|
|
1337
1337
|
:host {
|
|
1338
1338
|
z-index: 100;
|
|
1339
1339
|
display: flex;
|
|
@@ -1391,17 +1391,17 @@ media-time-display {
|
|
|
1391
1391
|
text-align: center;
|
|
1392
1392
|
line-height: 1.4;
|
|
1393
1393
|
}
|
|
1394
|
-
`,
|
|
1394
|
+
`,wl=ot.createElement("template");wl.innerHTML=`
|
|
1395
1395
|
<style>
|
|
1396
|
-
${
|
|
1396
|
+
${kl}
|
|
1397
1397
|
</style>
|
|
1398
1398
|
|
|
1399
1399
|
<div class="dialog">
|
|
1400
1400
|
<slot></slot>
|
|
1401
1401
|
</div>
|
|
1402
|
-
`;var Ct=class extends Pe.HTMLElement{constructor(){var e;super();this.attachShadow({mode:"open"}),(e=this.shadowRoot)==null||e.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),
|
|
1402
|
+
`;var Ct=class extends Pe.HTMLElement{constructor(){var e;super();this.attachShadow({mode:"open"}),(e=this.shadowRoot)==null||e.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),Pl(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),Uc(this))}attributeChangedCallback(e,a,n){e==="open"&&a!==n&&(n!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&Pl(this)}};Ct.styles=kl,Ct.template=wl,Ct.observedAttributes=["open"];function Pl(r){let t=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(r.dispatchEvent(t),t.defaultPrevented)return;let e=r.querySelector("[autofocus]:not([disabled])");!e&&r.tabIndex>=0&&(e=r),e||(e=Ul(r.shadowRoot)),r._previouslyFocusedElement=ot.activeElement,ot.activeElement instanceof HTMLElement&&ot.activeElement.blur(),r.addEventListener("transitionend",()=>{e instanceof HTMLElement&&e.focus({preventScroll:!0})},{once:!0})}function Ul(r){let e=["button","input","keygen","select","textarea"].map(function(n){return n+":not([disabled])"});e.push('[tabindex]:not([disabled]):not([tabindex=""])');let a=r==null?void 0:r.querySelector(e.join(", "));if(!a&&"attachShadow"in Element.prototype){let n=(r==null?void 0:r.querySelectorAll("*"))||[];for(let u=0;u<n.length&&!(n[u].tagName&&n[u].shadowRoot&&(a=Ul(n[u].shadowRoot),a));u++);}return a}function Uc(r){r._previouslyFocusedElement instanceof HTMLElement&&r._previouslyFocusedElement.focus()}Pe.customElements.get("media-dialog")||(Pe.customElements.define("media-dialog",Ct),Pe.MediaDialog=Ct);var Ha=Ct;var Nl=ot.createElement("template");Nl.innerHTML=`
|
|
1403
1403
|
<style>
|
|
1404
|
-
${
|
|
1404
|
+
${Ha.styles}
|
|
1405
1405
|
|
|
1406
1406
|
.close {
|
|
1407
1407
|
background: none;
|
|
@@ -1430,7 +1430,7 @@ media-time-display {
|
|
|
1430
1430
|
</svg>
|
|
1431
1431
|
</button>
|
|
1432
1432
|
</slot>
|
|
1433
|
-
`;var ai=class extends
|
|
1433
|
+
`;var ai=class extends Ha{constructor(){var t,e;super(),(e=(t=this.shadowRoot)==null?void 0:t.querySelector(".close"))==null||e.addEventListener("click",()=>{this.close()})}};ai.template=Nl;Pe.customElements.get("mxp-dialog")||(Pe.customElements.define("mxp-dialog",ai),Pe.MxpDialog=ai);var Fl=`:host {
|
|
1434
1434
|
display: inline-block;
|
|
1435
1435
|
width: 100%;
|
|
1436
1436
|
}
|
|
@@ -1581,18 +1581,18 @@ a {
|
|
|
1581
1581
|
::part(title display) {
|
|
1582
1582
|
display: var(--media-controls, var(--media-title-display));
|
|
1583
1583
|
}
|
|
1584
|
-
`;var
|
|
1584
|
+
`;var Wl=r=>ce`
|
|
1585
1585
|
<style>
|
|
1586
|
-
${
|
|
1586
|
+
${Fl}
|
|
1587
1587
|
</style>
|
|
1588
|
-
${
|
|
1589
|
-
`,
|
|
1590
|
-
<${
|
|
1588
|
+
${Fc(r)}
|
|
1589
|
+
`,Bl=r=>[pe.LIVE,pe.LL_LIVE].includes(r.streamType),Kl=r=>[pe.LIVE,pe.LL_LIVE,pe.DVR,pe.LL_DVR].includes(r.streamType),Fc=r=>{var t,e,a,n,u,M,y,I,x,A,D,R,L,T,S,c,i,f,m,d,l,s,v,p,o,E,g,h,b,_,O,C,P,w,U,k,N,F,H,W;return ce`
|
|
1590
|
+
<${Ka((t=Pa(r.theme))!=null?t:"media-theme-mux")}
|
|
1591
1591
|
has-src="${(e=r.hasSrc)!=null?e:!1}"
|
|
1592
1592
|
has-open-dialog="${(a=r.isDialogOpen)!=null?a:!1}"
|
|
1593
1593
|
nohotkeys="${(n=r.noHotKeys)!=null?n:!1}"
|
|
1594
1594
|
audio="${(u=r.audio)!=null?u:!1}"
|
|
1595
|
-
style="${(M=
|
|
1595
|
+
style="${(M=Oo({"--primary-color":r.primaryColor,"--secondary-color":r.secondaryColor}))!=null?M:!1}"
|
|
1596
1596
|
class="size-${r.playerSize}${r.secondaryColor?" two-tone":""}"
|
|
1597
1597
|
stream-type="${(y=r.streamType)!=null?y:!1}"
|
|
1598
1598
|
player-size="${(I=r.playerSize)!=null?I:!1}"
|
|
@@ -1627,21 +1627,21 @@ a {
|
|
|
1627
1627
|
env-key="${(O=r.envKey)!=null?O:!1}"
|
|
1628
1628
|
stream-type="${(C=r.streamType)!=null?C:!1}"
|
|
1629
1629
|
custom-domain="${(P=r.customDomain)!=null?P:!1}"
|
|
1630
|
-
src="${r.src?r.src:r.playbackId?
|
|
1631
|
-
cast-src="${r.src?r.src:r.playbackId?
|
|
1632
|
-
cast-stream-type="${
|
|
1630
|
+
src="${r.src?r.src:r.playbackId?Ca(r.playbackId,{domain:r.customDomain,token:r.tokens.playback}):!1}"
|
|
1631
|
+
cast-src="${r.src?r.src:r.playbackId?Ca(r.playbackId,{domain:r.customDomain,token:r.tokens.playback}):!1}"
|
|
1632
|
+
cast-stream-type="${Bl(r)?"live":!1}"
|
|
1633
1633
|
exportparts="video"
|
|
1634
1634
|
>
|
|
1635
|
-
${r.playbackId&&!r.audio&&!
|
|
1635
|
+
${r.playbackId&&!r.audio&&!Kl(r)?ce`<track
|
|
1636
1636
|
label="thumbnails"
|
|
1637
1637
|
default
|
|
1638
1638
|
kind="metadata"
|
|
1639
|
-
src="${
|
|
1639
|
+
src="${Uo(r.playbackId,{domain:r.customDomain,token:r.tokens.storyboard})}"
|
|
1640
1640
|
/>`:ce``}
|
|
1641
1641
|
</mux-video>
|
|
1642
|
-
${
|
|
1642
|
+
${Kl(r)?ce`<button
|
|
1643
1643
|
slot="seek-live"
|
|
1644
|
-
part="${
|
|
1644
|
+
part="${Bl(r)?"top":"bottom"} seek-live button"
|
|
1645
1645
|
disabled="${r.inLiveWindow||!r.hasSrc||r.isDialogOpen}"
|
|
1646
1646
|
aria-disabled="${(r.inLiveWindow||!r.hasSrc||r.isDialogOpen)&&"true"}"
|
|
1647
1647
|
in-live-window="${r.inLiveWindow}"
|
|
@@ -1667,6 +1667,6 @@ a {
|
|
|
1667
1667
|
>`:ce``}
|
|
1668
1668
|
</p>
|
|
1669
1669
|
</mxp-dialog>
|
|
1670
|
-
</${
|
|
1671
|
-
`};function sn(r,t,e,a,n){var y,I,x;let u={},M={};switch(r.code){case we.MEDIA_ERR_NETWORK:{switch(u.title=be("Network Error",n),u.message=r.message,(y=r.data)==null?void 0:y.response.code){case 412:{u.title=be("Video is not currently available",n),u.message=be("The live stream or video file are not yet ready.",n),M.message=be("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",n),M.file="412-not-playable.md";break}case 404:{u.title=be("Video does not exist",n),u.message="",M.message=be("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",n),M.file="404-not-found.md";break}case 403:{if(u.title=be("Invalid playback URL",n),u.message=be("The video URL or playback-token are formatted with incorrect or incomplete information.",n),M.message=be("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",n),M.file="missing-signed-tokens.md",!a)break;let{exp:A,aud:D,sub:R}=Zr(a),L=Date.now()>A*1e3,T=R!==e,S=D!=="v",c={timeStyle:"medium",dateStyle:"medium"};if(L){u.title=be("Video URL has expired",n),u.message=be("The video\u2019s secured playback-token has expired.",n),M.message=be("This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.",n).format({expiredDate:new Intl.DateTimeFormat(Wt.code,c).format(A*1e3),currentDate:new Intl.DateTimeFormat(Wt.code,c).format(Date.now())}),M.file="403-expired-token.md";break}if(T){u.title=be("Video URL is formatted incorrectly",n),u.message=be("The video\u2019s playback ID does not match the one encoded in the playback-token.",n),M.message=be("The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",n).format({playbackId:e,tokenPlaybackId:R}),M.file="403-playback-id-mismatch.md";break}if(S){u.title=be("Video URL is formatted incorrectly",n),u.message=be("The playback-token is formatted with incorrect information.",n),M.message=be("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",n).format({tokenType:D}),M.file="403-incorrect-aud-value.md";break}M.message=be("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",n),M.file="403-malformatted-token.md";break}}break}case we.MEDIA_ERR_DECODE:{let{message:A}=r;u={title:be("Media Error",n),message:A},M.file="media-decode-error.md";break}case we.MEDIA_ERR_SRC_NOT_SUPPORTED:{let A=(x=(I=r.data)==null?void 0:I.response)==null?void 0:x.code;if(A>=400&&A<500){r.code=we.MEDIA_ERR_NETWORK,r.data={response:{code:A}},{dialog:u,devlog:M}=sn(r,t,e,a);break}u={title:be("Source Not Supported",n),message:r.message},M.file="media-src-not-supported.md";break}default:u={title:be("Error",n),message:r.message};break}return t&&(u={title:be("Your device appears to be offline",n),message:be("Check your internet connection and try reloading this video.",n)}),{dialog:u,devlog:M}}var Nc=Object.values(pe),Fc=700,Bc=300,Ha={LG:"large",SM:"small",XS:"extra-small"};function on(r){let t=r.getBoundingClientRect();return t.width<Bc?Ha.XS:t.width<Fc?Ha.SM:Ha.LG}var xt={SRC:"src",POSTER:"poster"},de={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",TITLE:"title",PLACEHOLDER:"placeholder"};function Kc(r,t){var e,a;return{src:!r.playbackId&&r.src,playbackId:r.playbackId,hasSrc:!!r.playbackId||!!r.src,poster:r.poster,placeholder:r.getAttribute("placeholder"),theme:r.getAttribute("theme"),thumbnailTime:!r.tokens.thumbnail&&r.thumbnailTime,autoplay:r.autoplay,crossOrigin:r.crossOrigin,loop:r.loop,noHotKeys:r.hasAttribute(de.NOHOTKEYS),hotKeys:r.getAttribute(de.HOTKEYS),muted:r.muted,paused:r.paused,preload:r.preload,envKey:r.envKey,debug:r.debug,tokens:r.tokens,beaconCollectionDomain:r.beaconCollectionDomain,metadata:r.metadata,playerSoftwareName:r.playerSoftwareName,playerSoftwareVersion:r.playerSoftwareVersion,startTime:r.startTime,preferPlayback:r.preferPlayback,audio:r.audio,streamType:r.streamType,primaryColor:r.primaryColor,secondaryColor:r.secondaryColor,forwardSeekOffset:r.forwardSeekOffset,backwardSeekOffset:r.backwardSeekOffset,defaultHiddenCaptions:r.defaultHiddenCaptions,defaultShowRemainingTime:r.defaultShowRemainingTime,playbackRates:r.getAttribute(de.PLAYBACK_RATES),customDomain:(e=r.getAttribute(ae.CUSTOM_DOMAIN))!=null?e:void 0,playerSize:on((a=r.mediaController)!=null?a:r),metadataVideoId:r.getAttribute(ae.METADATA_VIDEO_ID),metadataVideoTitle:r.getAttribute(ae.METADATA_VIDEO_TITLE),metadataViewerUserId:r.getAttribute(ae.METADATA_VIEWER_USER_ID),title:r.getAttribute(de.TITLE),...t}}var Wc=Object.values(ae),Hc=Object.values(xt),jc=Object.values(de),Gc=Yi(),Vc="mux-player",Wl={dialog:void 0,isDialogOpen:!1,inLiveWindow:!1},Zt,oi,Lt,li,_r,Et,Sr,ln,Pt,Ar,xr,un,ui,ja,dn,Hl,cn,jl,fn,Gl,hn,Vl,vn,$l,mn,Yl,si=class extends wa{constructor(){super();Le(this,Sr);Le(this,Pt);Le(this,xr);Le(this,ui);Le(this,dn);Le(this,cn);Le(this,fn);Le(this,hn);Le(this,vn);Le(this,mn);Le(this,Zt,!1);Le(this,oi,{});Le(this,Lt,!0);Le(this,li,new $i(this,"hotkeys"));Le(this,_r,void 0);Le(this,Et,{...Wl,onCloseErrorDialog:()=>Me(this,Pt,Ar).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:e=>{Ma(this,ot.activeElement)||e.preventDefault()},onSeekToLive:()=>Pa(this)});this.attachShadow({mode:"open"}),this.isConnected&&Me(this,Sr,ln).call(this)}static get observedAttributes(){var e;return[...(e=wa.observedAttributes)!=null?e:[],...Hc,...Wc,...jc]}get theme(){var e,a;return Array.from((a=(e=this.shadowRoot)==null?void 0:e.children)!=null?a:[]).find(({localName:n})=>n.startsWith("media-theme-"))}get mediaController(){var e,a;return(a=(e=this.theme)==null?void 0:e.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){Me(this,ui,ja).call(this),Me(this,dn,Hl).call(this)}disconnectedCallback(){Me(this,cn,jl).call(this)}attributeChangedCallback(e,a,n){switch(ge(this,Zt)||Me(this,Sr,ln).call(this),super.attributeChangedCallback(e,a,n),e){case de.HOTKEYS:ge(this,li).value=n;break;case de.THUMBNAIL_TIME:{n!=null&&this.tokens.thumbnail&&Vt(be("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case de.THUMBNAIL_TOKEN:{let{aud:M}=Zr(n);n&&M!=="t"&&Vt(be("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:M}));break}case de.STORYBOARD_TOKEN:{let{aud:M}=Zr(n);n&&M!=="s"&&Vt(be("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:M}));break}case ae.PLAYBACK_ID:{n!=null&&n.includes("?token")&&ht(be("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:n})),this.streamType?this.streamType!=null&&!Nc.includes(this.streamType)&&zi({file:"invalid-stream-type.md",message:be("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`").format({streamType:this.streamType})}):zi({file:"invalid-stream-type.md",message:String(be("No stream-type value supplied. Defaulting to `on-demand`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`"))});break}}[ae.PLAYBACK_ID,xt.SRC,de.PLAYBACK_TOKEN].includes(e)&&a!==n&&qe(this,Et,{...ge(this,Et),...Wl}),Me(this,xr,un).call(this,{[Uo(e)]:n})}get hasPlayed(){var e,a;return(a=(e=this.mediaController)==null?void 0:e.hasAttribute("media-has-played"))!=null?a:!1}get inLiveWindow(){return ge(this,Et).inLiveWindow}get _hls(){var e;return(e=this.media)==null?void 0:e._hls}get mux(){var e;return(e=this.media)==null?void 0:e.mux}get playbackId(){var e;return(e=this.getAttribute(ae.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){e?this.setAttribute(ae.PLAYBACK_ID,e):this.removeAttribute(ae.PLAYBACK_ID)}get src(){var e,a;return this.playbackId?(e=br(this,xt.SRC))!=null?e:void 0:(a=this.getAttribute(xt.SRC))!=null?a:void 0}set src(e){e?this.setAttribute(xt.SRC,e):this.removeAttribute(xt.SRC)}get poster(){var a;let e=this.getAttribute(xt.POSTER);if(e!=null)return e;if(this.playbackId&&!this.audio)return ko(this.playbackId,{domain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(e){e||e===""?this.setAttribute(xt.POSTER,e):this.removeAttribute(xt.POSTER)}get audio(){return this.hasAttribute(de.AUDIO)}set audio(e){if(!e){this.removeAttribute(de.AUDIO);return}this.setAttribute(de.AUDIO,"")}get hotkeys(){return ge(this,li)}get nohotkeys(){return this.hasAttribute(de.NOHOTKEYS)}set nohotkeys(e){if(!e){this.removeAttribute(de.NOHOTKEYS);return}this.setAttribute(de.NOHOTKEYS,"")}get thumbnailTime(){return Ht(this.getAttribute(de.THUMBNAIL_TIME))}set thumbnailTime(e){this.setAttribute(de.THUMBNAIL_TIME,`${e}`)}get title(){var e;return(e=this.getAttribute(de.TITLE))!=null?e:""}set title(e){e!==this.title&&(e?this.setAttribute(de.TITLE,e):this.removeAttribute("title"),super.title=e)}get placeholder(){var e;return(e=br(this,de.PLACEHOLDER))!=null?e:""}set placeholder(e){this.setAttribute(de.PLACEHOLDER,`${e}`)}get primaryColor(){var e;return(e=this.getAttribute(de.PRIMARY_COLOR))!=null?e:void 0}set primaryColor(e){this.setAttribute(de.PRIMARY_COLOR,`${e}`)}get secondaryColor(){var e;return(e=this.getAttribute(de.SECONDARY_COLOR))!=null?e:void 0}set secondaryColor(e){this.setAttribute(de.SECONDARY_COLOR,`${e}`)}get defaultShowRemainingTime(){return this.hasAttribute(de.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(e){e?this.setAttribute(de.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(de.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(de.PLAYBACK_RATES))return this.getAttribute(de.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(e=>Number(e)).filter(e=>!Number.isNaN(e)).sort((e,a)=>e-a)}set playbackRates(e){if(!e){this.removeAttribute(de.PLAYBACK_RATES);return}this.setAttribute(de.PLAYBACK_RATES,e.join(" "))}get forwardSeekOffset(){var e;return(e=Ht(this.getAttribute(de.FORWARD_SEEK_OFFSET)))!=null?e:10}set forwardSeekOffset(e){this.setAttribute(de.FORWARD_SEEK_OFFSET,`${e}`)}get backwardSeekOffset(){var e;return(e=Ht(this.getAttribute(de.BACKWARD_SEEK_OFFSET)))!=null?e:10}set backwardSeekOffset(e){this.setAttribute(de.BACKWARD_SEEK_OFFSET,`${e}`)}get defaultHiddenCaptions(){return this.hasAttribute(de.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(e){e?this.setAttribute(de.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(de.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var e;return(e=this.getAttribute(ae.PLAYER_SOFTWARE_NAME))!=null?e:Vc}get playerSoftwareVersion(){var e;return(e=this.getAttribute(ae.PLAYER_SOFTWARE_VERSION))!=null?e:Gc}get beaconCollectionDomain(){var e;return(e=this.getAttribute(ae.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(ae.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(ae.BEACON_COLLECTION_DOMAIN))}get customDomain(){var e;return(e=this.getAttribute(ae.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(ae.CUSTOM_DOMAIN,e):this.removeAttribute(ae.CUSTOM_DOMAIN))}get envKey(){var e;return(e=br(this,ae.ENV_KEY))!=null?e:void 0}set envKey(e){this.setAttribute(ae.ENV_KEY,`${e}`)}get debug(){return br(this,ae.DEBUG)!=null}set debug(e){e?this.setAttribute(ae.DEBUG,""):this.removeAttribute(ae.DEBUG)}get streamType(){return br(this,ae.STREAM_TYPE)}set streamType(e){this.setAttribute(ae.STREAM_TYPE,`${e}`)}get startTime(){return Ht(br(this,ae.START_TIME))}set startTime(e){this.setAttribute(ae.START_TIME,`${e}`)}get preferPlayback(){let e=this.getAttribute(ae.PREFER_PLAYBACK);if(e===at.MSE||e===at.NATIVE)return e}set preferPlayback(e){e!==this.preferPlayback&&(e===at.MSE||e===at.NATIVE?this.setAttribute(ae.PREFER_PLAYBACK,e):this.removeAttribute(ae.PREFER_PLAYBACK))}get metadata(){var e;return(e=this.media)==null?void 0:e.metadata}set metadata(e){if(ge(this,Zt)||Me(this,Sr,ln).call(this),!this.media){ht("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata=e}get tokens(){let e=this.getAttribute(de.PLAYBACK_TOKEN),a=this.getAttribute(de.THUMBNAIL_TOKEN),n=this.getAttribute(de.STORYBOARD_TOKEN);return{...ge(this,oi),...e!=null?{playback:e}:{},...a!=null?{thumbnail:a}:{},...n!=null?{storyboard:n}:{}}}set tokens(e){qe(this,oi,e!=null?e:{})}get playbackToken(){var e;return(e=this.getAttribute(de.PLAYBACK_TOKEN))!=null?e:void 0}set playbackToken(e){this.setAttribute(de.PLAYBACK_TOKEN,`${e}`)}get thumbnailToken(){var e;return(e=this.getAttribute(de.THUMBNAIL_TOKEN))!=null?e:void 0}set thumbnailToken(e){this.setAttribute(de.THUMBNAIL_TOKEN,`${e}`)}get storyboardToken(){var e;return(e=this.getAttribute(de.STORYBOARD_TOKEN))!=null?e:void 0}set storyboardToken(e){this.setAttribute(de.STORYBOARD_TOKEN,`${e}`)}addTextTrack(e,a,n,u){var y;let M=(y=this.media)==null?void 0:y.nativeEl;if(!!M)return ba(M,e,a,n,u)}removeTextTrack(e){var n;let a=(n=this.media)==null?void 0:n.nativeEl;if(!!a)return co(a,e)}get textTracks(){var e;return(e=this.media)==null?void 0:e.textTracks}};Zt=new WeakMap,oi=new WeakMap,Lt=new WeakMap,li=new WeakMap,_r=new WeakMap,Et=new WeakMap,Sr=new WeakSet,ln=function(){var e,a,n;if(!ge(this,Zt)){qe(this,Zt,!0),Me(this,Pt,Ar).call(this,{playerSize:on(this)});try{if(customElements.upgrade(this.theme),!(this.theme instanceof Pe.HTMLElement))throw""}catch{ht(`<${(e=this.theme)==null?void 0:e.localName}> failed to upgrade!`)}try{if(customElements.upgrade(this.media),!(this.media instanceof Io))throw""}catch{ht("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof Wr))throw""}catch{ht("<media-controller> failed to upgrade!")}Wo(this),Me(this,hn,Vl).call(this),Me(this,vn,$l).call(this),Me(this,fn,Gl).call(this),qe(this,Lt,(n=(a=this.mediaController)==null?void 0:a.hasAttribute("user-inactive"))!=null?n:!0),Me(this,mn,Yl).call(this)}},Pt=new WeakSet,Ar=function(e){Object.assign(ge(this,Et),e),Me(this,xr,un).call(this)},xr=new WeakSet,un=function(e={}){qi(Kl(Kc(this,{...ge(this,Et),...e})),this.shadowRoot)},ui=new WeakSet,ja=function(){var e,a;ge(this,Et).playerSize!=on((e=this.mediaController)!=null?e:this)&&Me(this,Pt,Ar).call(this,{playerSize:on((a=this.mediaController)!=null?a:this)})},dn=new WeakSet,Hl=function(){var e;qe(this,_r,new ResizeObserver(()=>Me(this,ui,ja).call(this))),ge(this,_r).observe((e=this.mediaController)!=null?e:this)},cn=new WeakSet,jl=function(){var e;(e=ge(this,_r))==null||e.disconnect()},fn=new WeakSet,Gl=function(){var a,n,u,M,y;(a=this.mediaController)==null||a.addEventListener("mediaplayrequest",I=>{var x;((x=I.target)==null?void 0:x.localName)==="media-play-button"&&this.streamType&&[pe.LIVE,pe.LL_LIVE,pe.DVR,pe.LL_DVR].includes(this.streamType)&&this.hasPlayed&&Pa(this)});let e=()=>{let I=Fo(this),x=ge(this,Et).inLiveWindow;I!==x&&(Me(this,Pt,Ar).call(this,{inLiveWindow:I}),this.dispatchEvent(new CustomEvent("inlivewindowchange",{composed:!0,bubbles:!0,detail:this.inLiveWindow})))};(n=this.media)==null||n.addEventListener("progress",e),(u=this.media)==null||u.addEventListener("waiting",e),(M=this.media)==null||M.addEventListener("timeupdate",e),(y=this.media)==null||y.addEventListener("emptied",e)},hn=new WeakSet,Vl=function(){var a;let e=n=>{let{detail:u}=n;if(u instanceof we||(u=new we(u.message,u.code,u.fatal)),!(u!=null&&u.fatal)){Vt(u),u.data&&Vt(`${u.name} data:`,u.data);return}let{dialog:M,devlog:y}=sn(u,!window.navigator.onLine,this.playbackId,this.playbackToken);y.message&&zi(y),ht(u),u.data&&ht(`${u.name} data:`,u.data),Me(this,Pt,Ar).call(this,{isDialogOpen:!0,dialog:M})};this.addEventListener("error",e),this.media&&(this.media.errorTranslator=(n={})=>{var M,y,I;if(!((M=this.media)!=null&&M.error))return n;let{devlog:u}=sn((y=this.media)==null?void 0:y.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(I=this.media)==null?void 0:I.error.code,player_error_message:u.message?String(u.message):n.player_error_message}}),(a=this.media)==null||a.addEventListener("error",n=>{var M,y;let{detail:u}=n;if(!u){let{message:I,code:x}=(y=(M=this.media)==null?void 0:M.error)!=null?y:{};u=new we(I,x)}!(u!=null&&u.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:u}))})},vn=new WeakSet,$l=function(){var a,n,u,M;let e=()=>Me(this,xr,un).call(this);(n=(a=this.media)==null?void 0:a.textTracks)==null||n.addEventListener("addtrack",e),(M=(u=this.media)==null?void 0:u.textTracks)==null||M.addEventListener("removetrack",e)},mn=new WeakSet,Yl=function(){var A,D,R;let e=this.mediaController,a=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(a)return;let n,u=new WeakMap,M=()=>this.streamType&&[pe.LIVE,pe.LL_LIVE].includes(this.streamType)&&!this.secondaryColor&&this.offsetWidth>=800,y=(L,T,S=!1)=>{if(M())return;Array.from(L&&L.activeCues||[]).forEach(i=>{if(!(!i.snapToLines||i.line<-5||i.line>=0&&i.line<10))if(!T||this.paused){let f=i.text.split(`
|
|
1672
|
-
`).length,m=a?-2:-3;this.streamType&&[pe.LIVE,pe.LL_LIVE].includes(this.streamType)&&(m=a?-1:-2);let d=m-f;if(i.line===d&&!S)return;u.has(i)||u.set(i,i.line),i.line=d-1,i.line=d}else setTimeout(()=>{i.line=u.get(i)||"auto"},500)})},I=()=>{var L;y(n,(L=e==null?void 0:e.hasAttribute("user-inactive"))!=null?L:!1)},x=()=>{var S;let T=Array.from(((S=e==null?void 0:e.media)==null?void 0:S.textTracks)||[]).filter(c=>["subtitles","captions"].includes(c.kind)&&c.mode==="showing")[0];T!==n&&(n==null||n.removeEventListener("cuechange",I)),n=T,n==null||n.addEventListener("cuechange",I),y(n,ge(this,Lt))};if(x(),(A=e==null?void 0:e.media)==null||A.textTracks.addEventListener("change",x),(D=e==null?void 0:e.media)==null||D.textTracks.addEventListener("addtrack",x),navigator.userAgent.includes("Chrome/")){let L=()=>{y(n,ge(this,Lt),!0),this.paused||window.requestAnimationFrame(L)};(R=e==null?void 0:e.media)==null||R.addEventListener("playing",()=>{L()})}e==null||e.addEventListener("userinactivechange",()=>{let L=e==null?void 0:e.hasAttribute("user-inactive");ge(this,Lt)!==L&&(qe(this,Lt,L),y(n,ge(this,Lt)))})};function
|
|
1670
|
+
</${Ka((W=Pa(r.theme))!=null?W:"media-theme-mux")}>
|
|
1671
|
+
`};function sn(r,t,e,a,n){var y,I,x;let u={},M={};switch(r.code){case we.MEDIA_ERR_NETWORK:{switch(u.title=be("Network Error",n),u.message=r.message,(y=r.data)==null?void 0:y.response.code){case 412:{u.title=be("Video is not currently available",n),u.message=be("The live stream or video file are not yet ready.",n),M.message=be("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",n),M.file="412-not-playable.md";break}case 404:{u.title=be("Video does not exist",n),u.message="",M.message=be("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",n),M.file="404-not-found.md";break}case 403:{if(u.title=be("Invalid playback URL",n),u.message=be("The video URL or playback-token are formatted with incorrect or incomplete information.",n),M.message=be("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",n),M.file="missing-signed-tokens.md",!a)break;let{exp:A,aud:D,sub:R}=Zr(a),L=Date.now()>A*1e3,T=R!==e,S=D!=="v",c={timeStyle:"medium",dateStyle:"medium"};if(L){u.title=be("Video URL has expired",n),u.message=be("The video\u2019s secured playback-token has expired.",n),M.message=be("This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.",n).format({expiredDate:new Intl.DateTimeFormat(Ht.code,c).format(A*1e3),currentDate:new Intl.DateTimeFormat(Ht.code,c).format(Date.now())}),M.file="403-expired-token.md";break}if(T){u.title=be("Video URL is formatted incorrectly",n),u.message=be("The video\u2019s playback ID does not match the one encoded in the playback-token.",n),M.message=be("The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",n).format({playbackId:e,tokenPlaybackId:R}),M.file="403-playback-id-mismatch.md";break}if(S){u.title=be("Video URL is formatted incorrectly",n),u.message=be("The playback-token is formatted with incorrect information.",n),M.message=be("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",n).format({tokenType:D}),M.file="403-incorrect-aud-value.md";break}M.message=be("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",n),M.file="403-malformatted-token.md";break}}break}case we.MEDIA_ERR_DECODE:{let{message:A}=r;u={title:be("Media Error",n),message:A},M.file="media-decode-error.md";break}case we.MEDIA_ERR_SRC_NOT_SUPPORTED:{let A=(x=(I=r.data)==null?void 0:I.response)==null?void 0:x.code;if(A>=400&&A<500){r.code=we.MEDIA_ERR_NETWORK,r.data={response:{code:A}},{dialog:u,devlog:M}=sn(r,t,e,a);break}u={title:be("Source Not Supported",n),message:r.message},M.file="media-src-not-supported.md";break}default:u={title:be("Error",n),message:r.message};break}return t&&(u={title:be("Your device appears to be offline",n),message:be("Check your internet connection and try reloading this video.",n)}),{dialog:u,devlog:M}}var Bc=Object.values(pe),Kc=700,Wc=300,ja={LG:"large",SM:"small",XS:"extra-small"};function on(r){let t=r.getBoundingClientRect();return t.width<Wc?ja.XS:t.width<Kc?ja.SM:ja.LG}var xt={SRC:"src",POSTER:"poster"},de={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",TITLE:"title",PLACEHOLDER:"placeholder"};function Hc(r,t){var e,a;return{src:!r.playbackId&&r.src,playbackId:r.playbackId,hasSrc:!!r.playbackId||!!r.src,poster:r.poster,placeholder:r.getAttribute("placeholder"),theme:r.getAttribute("theme"),thumbnailTime:!r.tokens.thumbnail&&r.thumbnailTime,autoplay:r.autoplay,crossOrigin:r.crossOrigin,loop:r.loop,noHotKeys:r.hasAttribute(de.NOHOTKEYS),hotKeys:r.getAttribute(de.HOTKEYS),muted:r.muted,paused:r.paused,preload:r.preload,envKey:r.envKey,debug:r.debug,tokens:r.tokens,beaconCollectionDomain:r.beaconCollectionDomain,metadata:r.metadata,playerSoftwareName:r.playerSoftwareName,playerSoftwareVersion:r.playerSoftwareVersion,startTime:r.startTime,preferPlayback:r.preferPlayback,audio:r.audio,streamType:r.streamType,primaryColor:r.primaryColor,secondaryColor:r.secondaryColor,forwardSeekOffset:r.forwardSeekOffset,backwardSeekOffset:r.backwardSeekOffset,defaultHiddenCaptions:r.defaultHiddenCaptions,defaultShowRemainingTime:r.defaultShowRemainingTime,playbackRates:r.getAttribute(de.PLAYBACK_RATES),customDomain:(e=r.getAttribute(ae.CUSTOM_DOMAIN))!=null?e:void 0,playerSize:on((a=r.mediaController)!=null?a:r),metadataVideoId:r.getAttribute(ae.METADATA_VIDEO_ID),metadataVideoTitle:r.getAttribute(ae.METADATA_VIDEO_TITLE),metadataViewerUserId:r.getAttribute(ae.METADATA_VIEWER_USER_ID),title:r.getAttribute(de.TITLE),...t}}var jc=Object.values(ae),Gc=Object.values(xt),Vc=Object.values(de),$c=Yi(),Yc="mux-player",Hl={dialog:void 0,isDialogOpen:!1,inLiveWindow:!1},Jt,oi,Lt,li,Sr,Et,xr,ln,Pt,_r,Lr,un,ui,Ga,dn,jl,cn,Gl,fn,Vl,hn,$l,vn,Yl,mn,zl,si=class extends Ua{constructor(){super();Le(this,xr);Le(this,Pt);Le(this,Lr);Le(this,ui);Le(this,dn);Le(this,cn);Le(this,fn);Le(this,hn);Le(this,vn);Le(this,mn);Le(this,Jt,!1);Le(this,oi,{});Le(this,Lt,!0);Le(this,li,new $i(this,"hotkeys"));Le(this,Sr,void 0);Le(this,Et,{...Hl,onCloseErrorDialog:()=>Me(this,Pt,_r).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:e=>{Ra(this,ot.activeElement)||e.preventDefault()},onSeekToLive:()=>ka(this)});this.attachShadow({mode:"open"}),this.isConnected&&Me(this,xr,ln).call(this)}static get observedAttributes(){var e;return[...(e=Ua.observedAttributes)!=null?e:[],...Gc,...jc,...Vc]}get theme(){var e,a;return Array.from((a=(e=this.shadowRoot)==null?void 0:e.children)!=null?a:[]).find(({localName:n})=>n.startsWith("media-theme-"))}get mediaController(){var e,a;return(a=(e=this.theme)==null?void 0:e.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){Me(this,ui,Ga).call(this),Me(this,dn,jl).call(this)}disconnectedCallback(){Me(this,cn,Gl).call(this)}attributeChangedCallback(e,a,n){switch(ge(this,Jt)||Me(this,xr,ln).call(this),super.attributeChangedCallback(e,a,n),e){case de.HOTKEYS:ge(this,li).value=n;break;case de.THUMBNAIL_TIME:{n!=null&&this.tokens.thumbnail&&$t(be("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case de.THUMBNAIL_TOKEN:{let{aud:M}=Zr(n);n&&M!=="t"&&$t(be("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:M}));break}case de.STORYBOARD_TOKEN:{let{aud:M}=Zr(n);n&&M!=="s"&&$t(be("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:M}));break}case ae.PLAYBACK_ID:{n!=null&&n.includes("?token")&&ht(be("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:n})),this.streamType?this.streamType!=null&&!Bc.includes(this.streamType)&&zi({file:"invalid-stream-type.md",message:be("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`").format({streamType:this.streamType})}):zi({file:"invalid-stream-type.md",message:String(be("No stream-type value supplied. Defaulting to `on-demand`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`"))});break}}[ae.PLAYBACK_ID,xt.SRC,de.PLAYBACK_TOKEN].includes(e)&&a!==n&&qe(this,Et,{...ge(this,Et),...Hl}),Me(this,Lr,un).call(this,{[No(e)]:n})}get hasPlayed(){var e,a;return(a=(e=this.mediaController)==null?void 0:e.hasAttribute("media-has-played"))!=null?a:!1}get inLiveWindow(){return ge(this,Et).inLiveWindow}get _hls(){var e;return(e=this.media)==null?void 0:e._hls}get mux(){var e;return(e=this.media)==null?void 0:e.mux}get playbackId(){var e;return(e=this.getAttribute(ae.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){e?this.setAttribute(ae.PLAYBACK_ID,e):this.removeAttribute(ae.PLAYBACK_ID)}get src(){var e,a;return this.playbackId?(e=Ar(this,xt.SRC))!=null?e:void 0:(a=this.getAttribute(xt.SRC))!=null?a:void 0}set src(e){e?this.setAttribute(xt.SRC,e):this.removeAttribute(xt.SRC)}get poster(){var a;let e=this.getAttribute(xt.POSTER);if(e!=null)return e;if(this.playbackId&&!this.audio)return wo(this.playbackId,{domain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(e){e||e===""?this.setAttribute(xt.POSTER,e):this.removeAttribute(xt.POSTER)}get audio(){return this.hasAttribute(de.AUDIO)}set audio(e){if(!e){this.removeAttribute(de.AUDIO);return}this.setAttribute(de.AUDIO,"")}get hotkeys(){return ge(this,li)}get nohotkeys(){return this.hasAttribute(de.NOHOTKEYS)}set nohotkeys(e){if(!e){this.removeAttribute(de.NOHOTKEYS);return}this.setAttribute(de.NOHOTKEYS,"")}get thumbnailTime(){return jt(this.getAttribute(de.THUMBNAIL_TIME))}set thumbnailTime(e){this.setAttribute(de.THUMBNAIL_TIME,`${e}`)}get title(){var e;return(e=this.getAttribute(de.TITLE))!=null?e:""}set title(e){e!==this.title&&(e?this.setAttribute(de.TITLE,e):this.removeAttribute("title"),super.title=e)}get placeholder(){var e;return(e=Ar(this,de.PLACEHOLDER))!=null?e:""}set placeholder(e){this.setAttribute(de.PLACEHOLDER,`${e}`)}get primaryColor(){var e;return(e=this.getAttribute(de.PRIMARY_COLOR))!=null?e:void 0}set primaryColor(e){this.setAttribute(de.PRIMARY_COLOR,`${e}`)}get secondaryColor(){var e;return(e=this.getAttribute(de.SECONDARY_COLOR))!=null?e:void 0}set secondaryColor(e){this.setAttribute(de.SECONDARY_COLOR,`${e}`)}get defaultShowRemainingTime(){return this.hasAttribute(de.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(e){e?this.setAttribute(de.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(de.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(de.PLAYBACK_RATES))return this.getAttribute(de.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(e=>Number(e)).filter(e=>!Number.isNaN(e)).sort((e,a)=>e-a)}set playbackRates(e){if(!e){this.removeAttribute(de.PLAYBACK_RATES);return}this.setAttribute(de.PLAYBACK_RATES,e.join(" "))}get forwardSeekOffset(){var e;return(e=jt(this.getAttribute(de.FORWARD_SEEK_OFFSET)))!=null?e:10}set forwardSeekOffset(e){this.setAttribute(de.FORWARD_SEEK_OFFSET,`${e}`)}get backwardSeekOffset(){var e;return(e=jt(this.getAttribute(de.BACKWARD_SEEK_OFFSET)))!=null?e:10}set backwardSeekOffset(e){this.setAttribute(de.BACKWARD_SEEK_OFFSET,`${e}`)}get defaultHiddenCaptions(){return this.hasAttribute(de.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(e){e?this.setAttribute(de.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(de.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var e;return(e=this.getAttribute(ae.PLAYER_SOFTWARE_NAME))!=null?e:Yc}get playerSoftwareVersion(){var e;return(e=this.getAttribute(ae.PLAYER_SOFTWARE_VERSION))!=null?e:$c}get beaconCollectionDomain(){var e;return(e=this.getAttribute(ae.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(ae.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(ae.BEACON_COLLECTION_DOMAIN))}get customDomain(){var e;return(e=this.getAttribute(ae.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(ae.CUSTOM_DOMAIN,e):this.removeAttribute(ae.CUSTOM_DOMAIN))}get envKey(){var e;return(e=Ar(this,ae.ENV_KEY))!=null?e:void 0}set envKey(e){this.setAttribute(ae.ENV_KEY,`${e}`)}get debug(){return Ar(this,ae.DEBUG)!=null}set debug(e){e?this.setAttribute(ae.DEBUG,""):this.removeAttribute(ae.DEBUG)}get streamType(){return Ar(this,ae.STREAM_TYPE)}set streamType(e){this.setAttribute(ae.STREAM_TYPE,`${e}`)}get startTime(){return jt(Ar(this,ae.START_TIME))}set startTime(e){this.setAttribute(ae.START_TIME,`${e}`)}get preferPlayback(){let e=this.getAttribute(ae.PREFER_PLAYBACK);if(e===at.MSE||e===at.NATIVE)return e}set preferPlayback(e){e!==this.preferPlayback&&(e===at.MSE||e===at.NATIVE?this.setAttribute(ae.PREFER_PLAYBACK,e):this.removeAttribute(ae.PREFER_PLAYBACK))}get metadata(){var e;return(e=this.media)==null?void 0:e.metadata}set metadata(e){if(ge(this,Jt)||Me(this,xr,ln).call(this),!this.media){ht("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata=e}get tokens(){let e=this.getAttribute(de.PLAYBACK_TOKEN),a=this.getAttribute(de.THUMBNAIL_TOKEN),n=this.getAttribute(de.STORYBOARD_TOKEN);return{...ge(this,oi),...e!=null?{playback:e}:{},...a!=null?{thumbnail:a}:{},...n!=null?{storyboard:n}:{}}}set tokens(e){qe(this,oi,e!=null?e:{})}get playbackToken(){var e;return(e=this.getAttribute(de.PLAYBACK_TOKEN))!=null?e:void 0}set playbackToken(e){this.setAttribute(de.PLAYBACK_TOKEN,`${e}`)}get thumbnailToken(){var e;return(e=this.getAttribute(de.THUMBNAIL_TOKEN))!=null?e:void 0}set thumbnailToken(e){this.setAttribute(de.THUMBNAIL_TOKEN,`${e}`)}get storyboardToken(){var e;return(e=this.getAttribute(de.STORYBOARD_TOKEN))!=null?e:void 0}set storyboardToken(e){this.setAttribute(de.STORYBOARD_TOKEN,`${e}`)}addTextTrack(e,a,n,u){var y;let M=(y=this.media)==null?void 0:y.nativeEl;if(!!M)return Aa(M,e,a,n,u)}removeTextTrack(e){var n;let a=(n=this.media)==null?void 0:n.nativeEl;if(!!a)return fo(a,e)}get textTracks(){var e;return(e=this.media)==null?void 0:e.textTracks}};Jt=new WeakMap,oi=new WeakMap,Lt=new WeakMap,li=new WeakMap,Sr=new WeakMap,Et=new WeakMap,xr=new WeakSet,ln=function(){var e,a,n;if(!ge(this,Jt)){qe(this,Jt,!0),Me(this,Pt,_r).call(this,{playerSize:on(this)});try{if(customElements.upgrade(this.theme),!(this.theme instanceof Pe.HTMLElement))throw""}catch{ht(`<${(e=this.theme)==null?void 0:e.localName}> failed to upgrade!`)}try{if(customElements.upgrade(this.media),!(this.media instanceof Mo))throw""}catch{ht("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof Wr))throw""}catch{ht("<media-controller> failed to upgrade!")}Ho(this),Me(this,hn,$l).call(this),Me(this,vn,Yl).call(this),Me(this,fn,Vl).call(this),qe(this,Lt,(n=(a=this.mediaController)==null?void 0:a.hasAttribute("user-inactive"))!=null?n:!0),Me(this,mn,zl).call(this)}},Pt=new WeakSet,_r=function(e){Object.assign(ge(this,Et),e),Me(this,Lr,un).call(this)},Lr=new WeakSet,un=function(e={}){qi(Wl(Hc(this,{...ge(this,Et),...e})),this.shadowRoot)},ui=new WeakSet,Ga=function(){var e,a;ge(this,Et).playerSize!=on((e=this.mediaController)!=null?e:this)&&Me(this,Pt,_r).call(this,{playerSize:on((a=this.mediaController)!=null?a:this)})},dn=new WeakSet,jl=function(){var e;qe(this,Sr,new ResizeObserver(()=>Me(this,ui,Ga).call(this))),ge(this,Sr).observe((e=this.mediaController)!=null?e:this)},cn=new WeakSet,Gl=function(){var e;(e=ge(this,Sr))==null||e.disconnect()},fn=new WeakSet,Vl=function(){var a,n,u,M,y;(a=this.mediaController)==null||a.addEventListener("mediaplayrequest",I=>{var x;((x=I.target)==null?void 0:x.localName)==="media-play-button"&&this.streamType&&[pe.LIVE,pe.LL_LIVE,pe.DVR,pe.LL_DVR].includes(this.streamType)&&this.hasPlayed&&ka(this)});let e=()=>{let I=Bo(this),x=ge(this,Et).inLiveWindow;I!==x&&(Me(this,Pt,_r).call(this,{inLiveWindow:I}),this.dispatchEvent(new CustomEvent("inlivewindowchange",{composed:!0,bubbles:!0,detail:this.inLiveWindow})))};(n=this.media)==null||n.addEventListener("progress",e),(u=this.media)==null||u.addEventListener("waiting",e),(M=this.media)==null||M.addEventListener("timeupdate",e),(y=this.media)==null||y.addEventListener("emptied",e)},hn=new WeakSet,$l=function(){var a;let e=n=>{let{detail:u}=n;if(u instanceof we||(u=new we(u.message,u.code,u.fatal)),!(u!=null&&u.fatal)){$t(u),u.data&&$t(`${u.name} data:`,u.data);return}let{dialog:M,devlog:y}=sn(u,!window.navigator.onLine,this.playbackId,this.playbackToken);y.message&&zi(y),ht(u),u.data&&ht(`${u.name} data:`,u.data),Me(this,Pt,_r).call(this,{isDialogOpen:!0,dialog:M})};this.addEventListener("error",e),this.media&&(this.media.errorTranslator=(n={})=>{var M,y,I;if(!((M=this.media)!=null&&M.error))return n;let{devlog:u}=sn((y=this.media)==null?void 0:y.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(I=this.media)==null?void 0:I.error.code,player_error_message:u.message?String(u.message):n.player_error_message}}),(a=this.media)==null||a.addEventListener("error",n=>{var M,y;let{detail:u}=n;if(!u){let{message:I,code:x}=(y=(M=this.media)==null?void 0:M.error)!=null?y:{};u=new we(I,x)}!(u!=null&&u.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:u}))})},vn=new WeakSet,Yl=function(){var a,n,u,M;let e=()=>Me(this,Lr,un).call(this);(n=(a=this.media)==null?void 0:a.textTracks)==null||n.addEventListener("addtrack",e),(M=(u=this.media)==null?void 0:u.textTracks)==null||M.addEventListener("removetrack",e)},mn=new WeakSet,zl=function(){var A,D,R;let e=this.mediaController,a=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(a)return;let n,u=new WeakMap,M=()=>this.streamType&&[pe.LIVE,pe.LL_LIVE].includes(this.streamType)&&!this.secondaryColor&&this.offsetWidth>=800,y=(L,T,S=!1)=>{if(M())return;Array.from(L&&L.activeCues||[]).forEach(i=>{if(!(!i.snapToLines||i.line<-5||i.line>=0&&i.line<10))if(!T||this.paused){let f=i.text.split(`
|
|
1672
|
+
`).length,m=a?-2:-3;this.streamType&&[pe.LIVE,pe.LL_LIVE].includes(this.streamType)&&(m=a?-1:-2);let d=m-f;if(i.line===d&&!S)return;u.has(i)||u.set(i,i.line),i.line=d-1,i.line=d}else setTimeout(()=>{i.line=u.get(i)||"auto"},500)})},I=()=>{var L;y(n,(L=e==null?void 0:e.hasAttribute("user-inactive"))!=null?L:!1)},x=()=>{var S;let T=Array.from(((S=e==null?void 0:e.media)==null?void 0:S.textTracks)||[]).filter(c=>["subtitles","captions"].includes(c.kind)&&c.mode==="showing")[0];T!==n&&(n==null||n.removeEventListener("cuechange",I)),n=T,n==null||n.addEventListener("cuechange",I),y(n,ge(this,Lt))};if(x(),(A=e==null?void 0:e.media)==null||A.textTracks.addEventListener("change",x),(D=e==null?void 0:e.media)==null||D.textTracks.addEventListener("addtrack",x),navigator.userAgent.includes("Chrome/")){let L=()=>{y(n,ge(this,Lt),!0),this.paused||window.requestAnimationFrame(L)};(R=e==null?void 0:e.media)==null||R.addEventListener("playing",()=>{L()})}e==null||e.addEventListener("userinactivechange",()=>{let L=e==null?void 0:e.hasAttribute("user-inactive");ge(this,Lt)!==L&&(qe(this,Lt,L),y(n,ge(this,Lt)))})};function Ar(r,t){return r.media?r.media.getAttribute(t):r.getAttribute(t)}Pe.customElements.get("mux-player")||(Pe.customElements.define("mux-player",si),Pe.MuxPlayerElement=si);var g0=si;export{we as MediaError,g0 as default,Ar as getVideoAttribute};
|