| author | ymh <ymh.work@gmail.com> |
| Fri, 15 Nov 2024 01:29:53 +0100 | |
| changeset 1575 | ce1d5b0d1479 |
| parent 1571 | 4a1e6952afe5 |
| child 1581 | 2d713fdd532f |
| permissions | -rw-r--r-- |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1514
diff
changeset
|
1 |
/*! For license information please see live-polemic.js.LICENSE.txt */ |
| 1575 | 2 |
(()=>{var e={3490:(e,t,n)=>{"use strict";var r=n(8908);e.exports=function(e,t){return void 0===t&&(t=!1),function(n,i,a){if(n)e(n);else if(i.statusCode>=400&&i.statusCode<=599){var s=a;if(t)if(r.TextDecoder){var o=(void 0===(u=i.headers&&i.headers["content-type"])&&(u=""),u.toLowerCase().split(";").reduce((function(e,t){var n=t.split("="),r=n[0],i=n[1];return"charset"===r.trim()?i.trim():e}),"utf-8"));try{s=new TextDecoder(o).decode(a)}catch(e){}}else s=String.fromCharCode.apply(null,new Uint8Array(a));e({cause:s})}else e(null,a);var u}}},9603:(e,t,n)=>{"use strict";var r=n(8908),i=n(434),a=n(7376);u.httpHandler=n(3490);var s=function(e){var t={};return e?(e.trim().split("\n").forEach((function(e){var n=e.indexOf(":"),r=e.slice(0,n).trim().toLowerCase(),i=e.slice(n+1).trim();void 0===t[r]?t[r]=i:Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]})),t):t};function o(e,t,n){var r=e;return a(t)?(n=t,"string"==typeof e&&(r={uri:e})):r=i({},t,{uri:e}),r.callback=n,r}function u(e,t,n){return l(t=o(e,t,n))}function l(e){if(void 0===e.callback)throw new Error("callback argument missing");var t=!1,n=function(n,r,i){t||(t=!0,e.callback(n,r,i))};function r(){var e=void 0;if(e=c.response?c.response:c.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}(c),y)try{e=JSON.parse(e)}catch(e){}return e}function i(e){return clearTimeout(d),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,n(e,v)}function a(){if(!l){var t;clearTimeout(d),t=e.useXDR&&void 0===c.status?200:1223===c.status?204:c.status;var i=v,a=null;return 0!==t?(i={body:r(),statusCode:t,method:h,headers:{},url:f,rawRequest:c},c.getAllResponseHeaders&&(i.headers=s(c.getAllResponseHeaders()))):a=new Error("Internal XMLHttpRequest Error"),n(a,i,i.body)}}var o,l,c=e.xhr||null;c||(c=e.cors||e.useXDR?new u.XDomainRequest:new u.XMLHttpRequest);var d,f=c.url=e.uri||e.url,h=c.method=e.method||"GET",p=e.body||e.data,g=c.headers=e.headers||{},m=!!e.sync,y=!1,v={body:void 0,headers:{},statusCode:0,method:h,url:f,rawRequest:c};if("json"in e&&!1!==e.json&&(y=!0,g.accept||g.Accept||(g.Accept="application/json"),"GET"!==h&&"HEAD"!==h&&(g["content-type"]||g["Content-Type"]||(g["Content-Type"]="application/json"),p=JSON.stringify(!0===e.json?p:e.json))),c.onreadystatechange=function(){4===c.readyState&&setTimeout(a,0)},c.onload=a,c.onerror=i,c.onprogress=function(){},c.onabort=function(){l=!0},c.ontimeout=i,c.open(h,f,!m,e.username,e.password),m||(c.withCredentials=!!e.withCredentials),!m&&e.timeout>0&&(d=setTimeout((function(){if(!l){l=!0,c.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",i(e)}}),e.timeout)),c.setRequestHeader)for(o in g)g.hasOwnProperty(o)&&c.setRequestHeader(o,g[o]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(c.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(c),c.send(p||null),c}e.exports=u,e.exports.default=u,u.XMLHttpRequest=r.XMLHttpRequest||function(){},u.XDomainRequest="withCredentials"in new u.XMLHttpRequest?u.XMLHttpRequest:r.XDomainRequest,function(e,t){for(var n=0;n<e.length;n++)t(e[n])}(["get","put","post","patch","head","delete"],(function(e){u["delete"===e?"del":e]=function(t,n,r){return(n=o(t,n,r)).method=e.toUpperCase(),l(n)}}))},2167:(e,t)=>{"use strict";function n(e,t){return void 0===t&&(t=Object),t&&"function"==typeof t.freeze?t.freeze(e):e}var r=n({HTML:"text/html",isHTML:function(e){return e===r.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),i=n({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===i.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});t.assign=function(e,t){if(null===e||"object"!=typeof e)throw new TypeError("target is not an object");for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},t.find=function(e,t,n){if(void 0===n&&(n=Array.prototype),e&&"function"==typeof n.find)return n.find.call(e,t);for(var r=0;r<e.length;r++)if(Object.prototype.hasOwnProperty.call(e,r)){var i=e[r];if(t.call(void 0,i,r,e))return i}},t.freeze=n,t.MIME_TYPE=r,t.NAMESPACE=i},6129:(e,t,n)=>{var r=n(2167),i=n(1146),a=n(1045),s=n(6925),o=i.DOMImplementation,u=r.NAMESPACE,l=s.ParseError,c=s.XMLReader;function d(e){return e.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function f(e){this.options=e||{locator:{}}}function h(){this.cdata=!1}function p(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function g(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function m(e,t,n){return"string"==typeof e?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+"":e}function y(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}f.prototype.parseFromString=function(e,t){var n=this.options,r=new c,i=n.domBuilder||new h,s=n.errorHandler,o=n.locator,l=n.xmlns||{},f=/\/x?html?$/.test(t),p=f?a.HTML_ENTITIES:a.XML_ENTITIES;o&&i.setDocumentLocator(o),r.errorHandler=function(e,t,n){if(!e){if(t instanceof h)return t;e=t}var r={},i=e instanceof Function;function a(t){var a=e[t];!a&&i&&(a=2==e.length?function(n){e(t,n)}:e),r[t]=a&&function(e){a("[xmldom "+t+"]\t"+e+g(n))}||function(){}}return n=n||{},a("warning"),a("error"),a("fatalError"),r}(s,i,o),r.domBuilder=n.domBuilder||i,f&&(l[""]=u.HTML),l.xml=l.xml||u.XML;var m=n.normalizeLineEndings||d;return e&&"string"==typeof e?r.parse(m(e),l,p):r.errorHandler.error("invalid doc source"),i.doc},h.prototype={startDocument:function(){this.doc=(new o).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,r){var i=this.doc,a=i.createElementNS(e,n||t),s=r.length;y(this,a),this.currentElement=a,this.locator&&p(this.locator,a);for(var o=0;o<s;o++){e=r.getURI(o);var u=r.getValue(o),l=(n=r.getQName(o),i.createAttributeNS(e,n));this.locator&&p(r.getLocator(o),l),l.value=l.nodeValue=u,a.setAttributeNode(l)}},endElement:function(e,t,n){var r=this.currentElement;r.tagName,this.currentElement=r.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var n=this.doc.createProcessingInstruction(e,t);this.locator&&p(this.locator,n),y(this,n)},ignorableWhitespace:function(e,t,n){},characters:function(e,t,n){if(e=m.apply(this,arguments)){if(this.cdata)var r=this.doc.createCDATASection(e);else r=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(e)&&this.doc.appendChild(r),this.locator&&p(this.locator,r)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,n){e=m.apply(this,arguments);var r=this.doc.createComment(e);this.locator&&p(this.locator,r),y(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,n){var r=this.doc.implementation;if(r&&r.createDocumentType){var i=r.createDocumentType(e,t,n);this.locator&&p(this.locator,i),y(this,i),this.doc.doctype=i}},warning:function(e){console.warn("[xmldom warning]\t"+e,g(this.locator))},error:function(e){console.error("[xmldom error]\t"+e,g(this.locator))},fatalError:function(e){throw new l(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(e){h.prototype[e]=function(){return null}})),t.DOMParser=f},1146:(e,t,n)=>{var r=n(2167),i=r.find,a=r.NAMESPACE;function s(e){return""!==e}function o(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function u(e){if(!e)return[];var t=function(e){return e?e.split(/[\t\n\f\r ]+/).filter(s):[]}(e);return Object.keys(t.reduce(o,{}))}function l(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}function c(e,t){var n=e.prototype;if(!(n instanceof t)){function r(){}r.prototype=t.prototype,l(n,r=new r),e.prototype=n=r}n.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),n.constructor=e)}var d={},f=d.ELEMENT_NODE=1,h=d.ATTRIBUTE_NODE=2,p=d.TEXT_NODE=3,g=d.CDATA_SECTION_NODE=4,m=d.ENTITY_REFERENCE_NODE=5,y=d.ENTITY_NODE=6,v=d.PROCESSING_INSTRUCTION_NODE=7,_=d.COMMENT_NODE=8,T=d.DOCUMENT_NODE=9,b=d.DOCUMENT_TYPE_NODE=10,E=d.DOCUMENT_FRAGMENT_NODE=11,S=d.NOTATION_NODE=12,w={},A={},I=(w.INDEX_SIZE_ERR=(A[1]="Index size error",1),w.DOMSTRING_SIZE_ERR=(A[2]="DOMString size error",2),w.HIERARCHY_REQUEST_ERR=(A[3]="Hierarchy request error",3)),C=(w.WRONG_DOCUMENT_ERR=(A[4]="Wrong document",4),w.INVALID_CHARACTER_ERR=(A[5]="Invalid character",5),w.NO_DATA_ALLOWED_ERR=(A[6]="No data allowed",6),w.NO_MODIFICATION_ALLOWED_ERR=(A[7]="No modification allowed",7),w.NOT_FOUND_ERR=(A[8]="Not found",8)),R=(w.NOT_SUPPORTED_ERR=(A[9]="Not supported",9),w.INUSE_ATTRIBUTE_ERR=(A[10]="Attribute in use",10));function D(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,A[e]),this.message=A[e],Error.captureStackTrace&&Error.captureStackTrace(this,D);return n.code=e,t&&(this.message=this.message+": "+t),n}function x(){}function N(e,t){this._node=e,this._refresh=t,O(this)}function O(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var n=e._refresh(e._node);if(ve(e,"length",n.length),!e.$$length||n.length<e.$$length)for(var r=n.length;r in e;r++)Object.prototype.hasOwnProperty.call(e,r)&&delete e[r];l(n,e),e._inc=t}}function P(){}function M(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function k(e,t,n,r){if(r?t[M(t,r)]=n:t[t.length++]=n,e){n.ownerElement=e;var i=e.ownerDocument;i&&(r&&H(i,e,r),function(e,t,n){e&&e._inc++,n.namespaceURI===a.XMLNS&&(t._nsMap[n.prefix?n.localName:""]=n.value)}(i,e,n))}}function L(e,t,n){var r=M(t,n);if(!(r>=0))throw new D(C,new Error(e.tagName+"@"+n));for(var i=t.length-1;r<i;)t[r]=t[++r];if(t.length=i,e){var a=e.ownerDocument;a&&(H(a,e,n),n.ownerElement=null)}}function F(){}function U(){}function B(e){return("<"==e?"<":">"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function j(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(j(e,t))return!0}while(e=e.nextSibling)}function q(){this.ownerDocument=this}function H(e,t,n,r){e&&e._inc++,n.namespaceURI===a.XMLNS&&delete t._nsMap[n.prefix?n.localName:""]}function G(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n)r[r.length++]=n;else{for(var i=t.firstChild,a=0;i;)r[a++]=i,i=i.nextSibling;r.length=a,delete r[r.length]}}}function V(e,t){var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,G(e.ownerDocument,e),t}function Y(e){return e&&e.nodeType===U.DOCUMENT_TYPE_NODE}function z(e){return e&&e.nodeType===U.ELEMENT_NODE}function Z(e){return e&&e.nodeType===U.TEXT_NODE}function K(e,t){var n=e.childNodes||[];if(i(n,z)||Y(t))return!1;var r=i(n,Y);return!(t&&r&&n.indexOf(r)>n.indexOf(t))}function W(e,t){var n=e.childNodes||[];if(i(n,(function(e){return z(e)&&e!==t})))return!1;var r=i(n,Y);return!(t&&r&&n.indexOf(r)>n.indexOf(t))}function X(e,t,n){var r=e.childNodes||[],a=t.childNodes||[];if(t.nodeType===U.DOCUMENT_FRAGMENT_NODE){var s=a.filter(z);if(s.length>1||i(a,Z))throw new D(I,"More than one element or text in fragment");if(1===s.length&&!K(e,n))throw new D(I,"Element in fragment can not be inserted before doctype")}if(z(t)&&!K(e,n))throw new D(I,"Only one element can be added and only after doctype");if(Y(t)){if(i(r,Y))throw new D(I,"Only one doctype is allowed");var o=i(r,z);if(n&&r.indexOf(o)<r.indexOf(n))throw new D(I,"Doctype can only be inserted before an element");if(!n&&o)throw new D(I,"Doctype can not be appended since element is present")}}function $(e,t,n){var r=e.childNodes||[],a=t.childNodes||[];if(t.nodeType===U.DOCUMENT_FRAGMENT_NODE){var s=a.filter(z);if(s.length>1||i(a,Z))throw new D(I,"More than one element or text in fragment");if(1===s.length&&!W(e,n))throw new D(I,"Element in fragment can not be inserted before doctype")}if(z(t)&&!W(e,n))throw new D(I,"Only one element can be added and only after doctype");if(Y(t)){if(i(r,(function(e){return Y(e)&&e!==n})))throw new D(I,"Only one doctype is allowed");var o=i(r,z);if(n&&r.indexOf(o)<r.indexOf(n))throw new D(I,"Doctype can only be inserted before an element")}}function Q(e,t,n,r){(function(e,t,n){if(!function(e){return e&&(e.nodeType===U.DOCUMENT_NODE||e.nodeType===U.DOCUMENT_FRAGMENT_NODE||e.nodeType===U.ELEMENT_NODE)}(e))throw new D(I,"Unexpected parent node type "+e.nodeType);if(n&&n.parentNode!==e)throw new D(C,"child not in parent");if(!function(e){return e&&(z(e)||Z(e)||Y(e)||e.nodeType===U.DOCUMENT_FRAGMENT_NODE||e.nodeType===U.COMMENT_NODE||e.nodeType===U.PROCESSING_INSTRUCTION_NODE)}(t)||Y(t)&&e.nodeType!==U.DOCUMENT_NODE)throw new D(I,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)})(e,t,n),e.nodeType===U.DOCUMENT_NODE&&(r||X)(e,t,n);var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===E){var a=t.firstChild;if(null==a)return t;var s=t.lastChild}else a=s=t;var o=n?n.previousSibling:e.lastChild;a.previousSibling=o,s.nextSibling=n,o?o.nextSibling=a:e.firstChild=a,null==n?e.lastChild=s:n.previousSibling=s;do{a.parentNode=e}while(a!==s&&(a=a.nextSibling));return G(e.ownerDocument||e,e),t.nodeType==E&&(t.firstChild=t.lastChild=null),t}function J(){this._nsMap={}}function ee(){}function te(){}function ne(){}function re(){}function ie(){}function ae(){}function se(){}function oe(){}function ue(){}function le(){}function ce(){}function de(){}function fe(e,t){var n=[],r=9==this.nodeType&&this.documentElement||this,i=r.prefix,a=r.namespaceURI;if(a&&null==i&&null==(i=r.lookupPrefix(a)))var s=[{namespace:a,prefix:null}];return ge(this,n,e,t,s),n.join("")}function he(e,t,n){var r=e.prefix||"",i=e.namespaceURI;if(!i)return!1;if("xml"===r&&i===a.XML||i===a.XMLNS)return!1;for(var s=n.length;s--;){var o=n[s];if(o.prefix===r)return o.namespace!==i}return!0}function pe(e,t,n){e.push(" ",t,'="',n.replace(/[<>&"\t\n\r]/g,B),'"')}function ge(e,t,n,r,i){if(i||(i=[]),r){if(!(e=r(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case f:var s=e.attributes,o=s.length,u=e.firstChild,l=e.tagName,c=l;if(!(n=a.isHTML(e.namespaceURI)||n)&&!e.prefix&&e.namespaceURI){for(var d,y=0;y<s.length;y++)if("xmlns"===s.item(y).name){d=s.item(y).value;break}if(!d)for(var S=i.length-1;S>=0;S--)if(""===(w=i[S]).prefix&&w.namespace===e.namespaceURI){d=w.namespace;break}if(d!==e.namespaceURI)for(S=i.length-1;S>=0;S--){var w;if((w=i[S]).namespace===e.namespaceURI){w.prefix&&(c=w.prefix+":"+l);break}}}t.push("<",c);for(var A=0;A<o;A++)"xmlns"==(I=s.item(A)).prefix?i.push({prefix:I.localName,namespace:I.value}):"xmlns"==I.nodeName&&i.push({prefix:"",namespace:I.value});for(A=0;A<o;A++){var I,C,R;he(I=s.item(A),0,i)&&(pe(t,(C=I.prefix||"")?"xmlns:"+C:"xmlns",R=I.namespaceURI),i.push({prefix:C,namespace:R})),ge(I,t,n,r,i)}if(l===c&&he(e,0,i)&&(pe(t,(C=e.prefix||"")?"xmlns:"+C:"xmlns",R=e.namespaceURI),i.push({prefix:C,namespace:R})),u||n&&!/^(?:meta|link|img|br|hr|input)$/i.test(l)){if(t.push(">"),n&&/^script$/i.test(l))for(;u;)u.data?t.push(u.data):ge(u,t,n,r,i.slice()),u=u.nextSibling;else for(;u;)ge(u,t,n,r,i.slice()),u=u.nextSibling;t.push("</",c,">")}else t.push("/>");return;case T:case E:for(u=e.firstChild;u;)ge(u,t,n,r,i.slice()),u=u.nextSibling;return;case h:return pe(t,e.name,e.value);case p:return t.push(e.data.replace(/[<&>]/g,B));case g:return t.push("<![CDATA[",e.data,"]]>");case _:return t.push("\x3c!--",e.data,"--\x3e");case b:var D=e.publicId,x=e.systemId;if(t.push("<!DOCTYPE ",e.name),D)t.push(" PUBLIC ",D),x&&"."!=x&&t.push(" ",x),t.push(">");else if(x&&"."!=x)t.push(" SYSTEM ",x,">");else{var N=e.internalSubset;N&&t.push(" [",N,"]"),t.push(">")}return;case v:return t.push("<?",e.target," ",e.data,"?>");case m:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function me(e,t,n){var r;switch(t.nodeType){case f:(r=t.cloneNode(!1)).ownerDocument=e;case E:break;case h:n=!0}if(r||(r=t.cloneNode(!1)),r.ownerDocument=e,r.parentNode=null,n)for(var i=t.firstChild;i;)r.appendChild(me(e,i,n)),i=i.nextSibling;return r}function ye(e,t,n){var r=new t.constructor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var a=t[i];"object"!=typeof a&&a!=r[i]&&(r[i]=a)}switch(t.childNodes&&(r.childNodes=new x),r.ownerDocument=e,r.nodeType){case f:var s=t.attributes,o=r.attributes=new P,u=s.length;o._ownerElement=r;for(var l=0;l<u;l++)r.setAttributeNode(ye(e,s.item(l),!0));break;case h:n=!0}if(n)for(var c=t.firstChild;c;)r.appendChild(ye(e,c,n)),c=c.nextSibling;return r}function ve(e,t,n){e[t]=n}w.INVALID_STATE_ERR=(A[11]="Invalid state",11),w.SYNTAX_ERR=(A[12]="Syntax error",12),w.INVALID_MODIFICATION_ERR=(A[13]="Invalid modification",13),w.NAMESPACE_ERR=(A[14]="Invalid namespace",14),w.INVALID_ACCESS_ERR=(A[15]="Invalid access",15),D.prototype=Error.prototype,l(w,D),x.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e,t){for(var n=[],r=0;r<this.length;r++)ge(this[r],n,e,t);return n.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},N.prototype.item=function(e){return O(this),this[e]||null},c(N,x),P.prototype={length:0,item:x.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var n=this[t];if(n.nodeName==e)return n}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new D(R);var n=this.getNamedItem(e.nodeName);return k(this._ownerElement,this,e,n),n},setNamedItemNS:function(e){var t,n=e.ownerElement;if(n&&n!=this._ownerElement)throw new D(R);return t=this.getNamedItemNS(e.namespaceURI,e.localName),k(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return L(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var n=this.getNamedItemNS(e,t);return L(this._ownerElement,this,n),n},getNamedItemNS:function(e,t){for(var n=this.length;n--;){var r=this[n];if(r.localName==t&&r.namespaceURI==e)return r}return null}},F.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,n){var r=new q;if(r.implementation=this,r.childNodes=new x,r.doctype=n||null,n&&r.appendChild(n),t){var i=r.createElementNS(e,t);r.appendChild(i)}return r},createDocumentType:function(e,t,n){var r=new ae;return r.name=e,r.nodeName=e,r.publicId=t||"",r.systemId=n||"",r}},U.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return Q(this,e,t)},replaceChild:function(e,t){Q(this,e,t,$),t&&this.removeChild(t)},removeChild:function(e){return V(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return ye(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==p&&e.nodeType==p?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n)for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)&&n[r]===e)return r;t=t.nodeType==h?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&Object.prototype.hasOwnProperty.call(n,e))return n[e];t=t.nodeType==h?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},l(d,U),l(d,U.prototype),q.prototype={nodeName:"#document",nodeType:T,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==E){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return Q(this,e,t),e.ownerDocument=this,null===this.documentElement&&e.nodeType===f&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),V(this,e)},replaceChild:function(e,t){Q(this,e,t,$),e.ownerDocument=this,t&&this.removeChild(t),z(e)&&(this.documentElement=e)},importNode:function(e,t){return me(this,e,t)},getElementById:function(e){var t=null;return j(this.documentElement,(function(n){if(n.nodeType==f&&n.getAttribute("id")==e)return t=n,!0})),t},getElementsByClassName:function(e){var t=u(e);return new N(this,(function(n){var r=[];return t.length>0&&j(n.documentElement,(function(i){if(i!==n&&i.nodeType===f){var a=i.getAttribute("class");if(a){var s=e===a;if(!s){var o=u(a);s=t.every((l=o,function(e){return l&&-1!==l.indexOf(e)}))}s&&r.push(i)}}var l})),r}))},createElement:function(e){var t=new J;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new x,(t.attributes=new P)._ownerElement=t,t},createDocumentFragment:function(){var e=new le;return e.ownerDocument=this,e.childNodes=new x,e},createTextNode:function(e){var t=new ne;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new re;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new ie;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new ce;return n.ownerDocument=this,n.tagName=n.nodeName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new ee;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new ue;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new J,r=t.split(":"),i=n.attributes=new P;return n.childNodes=new x,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,i._ownerElement=n,n},createAttributeNS:function(e,t){var n=new ee,r=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,n}},c(q,U),J.prototype={nodeType:f,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===E?this.insertBefore(e,null):function(e,t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=e,t.previousSibling=e.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,e.lastChild=t,G(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=""+n,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new N(this,(function(t){var n=[];return j(t,(function(r){r===t||r.nodeType!=f||"*"!==e&&r.tagName!=e||n.push(r)})),n}))},getElementsByTagNameNS:function(e,t){return new N(this,(function(n){var r=[];return j(n,(function(i){i===n||i.nodeType!==f||"*"!==e&&i.namespaceURI!==e||"*"!==t&&i.localName!=t||r.push(i)})),r}))}},q.prototype.getElementsByTagName=J.prototype.getElementsByTagName,q.prototype.getElementsByTagNameNS=J.prototype.getElementsByTagNameNS,c(J,U),ee.prototype.nodeType=h,c(ee,U),te.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(A[I])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){n=this.data.substring(0,e)+n+this.data.substring(e+t),this.nodeValue=this.data=n,this.length=n.length}},c(te,U),ne.prototype={nodeName:"#text",nodeType:p,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},c(ne,te),re.prototype={nodeName:"#comment",nodeType:_},c(re,te),ie.prototype={nodeName:"#cdata-section",nodeType:g},c(ie,te),ae.prototype.nodeType=b,c(ae,U),se.prototype.nodeType=S,c(se,U),oe.prototype.nodeType=y,c(oe,U),ue.prototype.nodeType=m,c(ue,U),le.prototype.nodeName="#document-fragment",le.prototype.nodeType=E,c(le,U),ce.prototype.nodeType=v,c(ce,U),de.prototype.serializeToString=function(e,t,n){return fe.call(e,t,n)},U.prototype.toString=fe;try{if(Object.defineProperty){function _e(e){switch(e.nodeType){case f:case E:var t=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&t.push(_e(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}Object.defineProperty(N.prototype,"length",{get:function(){return O(this),this.$$length}}),Object.defineProperty(U.prototype,"textContent",{get:function(){return _e(this)},set:function(e){switch(this.nodeType){case f:case E:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),ve=function(e,t,n){e["$$"+t]=n}}}catch(Te){}t.DocumentType=ae,t.DOMException=D,t.DOMImplementation=F,t.Element=J,t.Node=U,t.NodeList=x,t.XMLSerializer=de},1045:(e,t,n)=>{"use strict";var r=n(2167).freeze;t.XML_ENTITIES=r({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=r({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"",InvisibleTimes:"",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:" ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"",zwnj:""}),t.entityMap=t.HTML_ENTITIES},3969:(e,t,n)=>{var r=n(1146);r.DOMImplementation,r.XMLSerializer,t.DOMParser=n(6129).DOMParser},6925:(e,t,n)=>{var r=n(2167).NAMESPACE,i=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,a=new RegExp("[\\-\\.0-9"+i.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),s=new RegExp("^"+i.source+a.source+"*(?::"+i.source+a.source+"*)?$");function o(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,o)}function u(){}function l(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function c(e,t,n,i,a,s){function o(e,t,r){n.attributeNames.hasOwnProperty(e)&&s.fatalError("Attribute "+e+" redefined"),n.addValue(e,t.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,a),r)}for(var u,l=++t,c=0;;){var d=e.charAt(l);switch(d){case"=":if(1===c)u=e.slice(t,l),c=3;else{if(2!==c)throw new Error("attribute equal must after attrName");c=3}break;case"'":case'"':if(3===c||1===c){if(1===c&&(s.warning('attribute value must after "="'),u=e.slice(t,l)),t=l+1,!((l=e.indexOf(d,t))>0))throw new Error("attribute value no end '"+d+"' match");o(u,f=e.slice(t,l),t-1),c=5}else{if(4!=c)throw new Error('attribute value must after "="');o(u,f=e.slice(t,l),t),s.warning('attribute "'+u+'" missed start quot('+d+")!!"),t=l+1,c=5}break;case"/":switch(c){case 0:n.setTagName(e.slice(t,l));case 5:case 6:case 7:c=7,n.closed=!0;case 4:case 1:break;case 2:n.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return s.error("unexpected end of input"),0==c&&n.setTagName(e.slice(t,l)),l;case">":switch(c){case 0:n.setTagName(e.slice(t,l));case 5:case 6:case 7:break;case 4:case 1:"/"===(f=e.slice(t,l)).slice(-1)&&(n.closed=!0,f=f.slice(0,-1));case 2:2===c&&(f=u),4==c?(s.warning('attribute "'+f+'" missed quot(")!'),o(u,f,t)):(r.isHTML(i[""])&&f.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+f+'" missed value!! "'+f+'" instead!!'),o(f,f,t));break;case 3:throw new Error("attribute value missed!!")}return l;case"":d=" ";default:if(d<=" ")switch(c){case 0:n.setTagName(e.slice(t,l)),c=6;break;case 1:u=e.slice(t,l),c=2;break;case 4:var f=e.slice(t,l);s.warning('attribute "'+f+'" missed quot(")!!'),o(u,f,t);case 5:c=6}else switch(c){case 2:n.tagName,r.isHTML(i[""])&&u.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+u+'" missed value!! "'+u+'" instead2!!'),o(u,u,t),t=l,c=1;break;case 5:s.warning('attribute space is required"'+u+'"!!');case 6:c=1,t=l;break;case 3:c=4,t=l;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}l++}}function d(e,t,n){for(var i=e.tagName,a=null,s=e.length;s--;){var o=e[s],u=o.qName,l=o.value;if((h=u.indexOf(":"))>0)var c=o.prefix=u.slice(0,h),d=u.slice(h+1),f="xmlns"===c&&d;else d=u,c=null,f="xmlns"===u&&"";o.localName=d,!1!==f&&(null==a&&(a={},p(n,n={})),n[f]=a[f]=l,o.uri=r.XMLNS,t.startPrefixMapping(f,l))}for(s=e.length;s--;)(c=(o=e[s]).prefix)&&("xml"===c&&(o.uri=r.XML),"xmlns"!==c&&(o.uri=n[c||""]));var h;(h=i.indexOf(":"))>0?(c=e.prefix=i.slice(0,h),d=e.localName=i.slice(h+1)):(c=null,d=e.localName=i);var g=e.uri=n[c||""];if(t.startElement(g,d,i,e),!e.closed)return e.currentNSMap=n,e.localNSMap=a,!0;if(t.endElement(g,d,i),a)for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&t.endPrefixMapping(c)}function f(e,t,n,r,i){if(/^(?:script|textarea)$/i.test(n)){var a=e.indexOf("</"+n+">",t),s=e.substring(t+1,a);if(/[&<]/.test(s))return/^script$/i.test(n)?(i.characters(s,0,s.length),a):(s=s.replace(/&#?\w+;/g,r),i.characters(s,0,s.length),a)}return t+1}function h(e,t,n,r){var i=r[n];return null==i&&((i=e.lastIndexOf("</"+n+">"))<t&&(i=e.lastIndexOf("</"+n)),r[n]=i),i<t}function p(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}function g(e,t,n,r){if("-"===e.charAt(t+2))return"-"===e.charAt(t+3)?(i=e.indexOf("--\x3e",t+4))>t?(n.comment(e,t+4,i-t-4),i+3):(r.error("Unclosed comment"),-1):-1;if("CDATA["==e.substr(t+3,6)){var i=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,i-t-9),n.endCDATA(),i+3}var a=function(e,t){var n,r=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=t,i.exec(e);n=i.exec(e);)if(r.push(n),n[1])return r}(e,t),s=a.length;if(s>1&&/!doctype/i.test(a[0][0])){var o=a[1][0],u=!1,l=!1;s>3&&(/^public$/i.test(a[2][0])?(u=a[3][0],l=s>4&&a[4][0]):/^system$/i.test(a[2][0])&&(l=a[3][0]));var c=a[s-1];return n.startDTD(o,u,l),n.endDTD(),c.index+c[0].length}return-1}function m(e,t,n){var r=e.indexOf("?>",t);if(r){var i=e.substring(t,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return i?(i[0].length,n.processingInstruction(i[1],i[2]),r+2):-1}return-1}function y(){this.attributeNames={}}o.prototype=new Error,o.prototype.name=o.name,u.prototype={parse:function(e,t,n){var i=this.domBuilder;i.startDocument(),p(t,t={}),function(e,t,n,i,a){function s(e){var t=e.slice(1,-1);return Object.hasOwnProperty.call(n,t)?n[t]:"#"===t.charAt(0)?function(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}(parseInt(t.substr(1).replace("x","0x"))):(a.error("entity not found:"+e),e)}function u(t){if(t>w){var n=e.substring(w,t).replace(/&#?\w+;/g,s);b&&p(w),i.characters(n,0,t-w),w=t}}function p(t,n){for(;t>=_&&(n=T.exec(e));)v=n.index,_=v+n[0].length,b.lineNumber++;b.columnNumber=t-v+1}for(var v=0,_=0,T=/.*(?:\r\n?|\n)|.*$/g,b=i.locator,E=[{currentNSMap:t}],S={},w=0;;){try{var A=e.indexOf("<",w);if(A<0){if(!e.substr(w).match(/^\s*$/)){var I=i.doc,C=I.createTextNode(e.substr(w));I.appendChild(C),i.currentElement=C}return}switch(A>w&&u(A),e.charAt(A+1)){case"/":var R=e.indexOf(">",A+3),D=e.substring(A+2,R).replace(/[ \t\n\r]+$/g,""),x=E.pop();R<0?(D=e.substring(A+2).replace(/[\s<].*/,""),a.error("end tag name: "+D+" is not complete:"+x.tagName),R=A+1+D.length):D.match(/\s</)&&(D=D.replace(/[\s<].*/,""),a.error("end tag name: "+D+" maybe not complete"),R=A+1+D.length);var N=x.localNSMap,O=x.tagName==D;if(O||x.tagName&&x.tagName.toLowerCase()==D.toLowerCase()){if(i.endElement(x.uri,x.localName,D),N)for(var P in N)Object.prototype.hasOwnProperty.call(N,P)&&i.endPrefixMapping(P);O||a.fatalError("end tag name: "+D+" is not match the current start tagName:"+x.tagName)}else E.push(x);R++;break;case"?":b&&p(A),R=m(e,A,i);break;case"!":b&&p(A),R=g(e,A,i,a);break;default:b&&p(A);var M=new y,k=E[E.length-1].currentNSMap,L=(R=c(e,A,M,k,s,a),M.length);if(!M.closed&&h(e,R,M.tagName,S)&&(M.closed=!0,n.nbsp||a.warning("unclosed xml attribute")),b&&L){for(var F=l(b,{}),U=0;U<L;U++){var B=M[U];p(B.offset),B.locator=l(b,{})}i.locator=F,d(M,i,k)&&E.push(M),i.locator=b}else d(M,i,k)&&E.push(M);r.isHTML(M.uri)&&!M.closed?R=f(e,R,M.tagName,s,i):R++}}catch(e){if(e instanceof o)throw e;a.error("element parse error: "+e),R=-1}R>w?w=R:u(Math.max(A,w)+1)}}(e,t,n,i,this.errorHandler),i.endDocument()}},y.prototype={setTagName:function(e){if(!s.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,n){if(!s.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},t.XMLReader=u,t.ParseError=o},4963:e=>{e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},7722:(e,t,n)=>{var r=n(6314)("unscopables"),i=Array.prototype;null==i[r]&&n(7728)(i,r,{}),e.exports=function(e){i[r][e]=!0}},6793:(e,t,n)=>{"use strict";var r=n(4496)(!0);e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},7007:(e,t,n)=>{var r=n(5286);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},9315:(e,t,n)=>{var r=n(2110),i=n(875),a=n(2337);e.exports=function(e){return function(t,n,s){var o,u=r(t),l=i(u.length),c=a(s,l);if(e&&n!=n){for(;l>c;)if((o=u[c++])!=o)return!0}else for(;l>c;c++)if((e||c in u)&&u[c]===n)return e||c||0;return!e&&-1}}},50:(e,t,n)=>{var r=n(741),i=n(9797),a=n(508),s=n(875),o=n(6886);e.exports=function(e,t){var n=1==e,u=2==e,l=3==e,c=4==e,d=6==e,f=5==e||d,h=t||o;return function(t,o,p){for(var g,m,y=a(t),v=i(y),_=r(o,p,3),T=s(v.length),b=0,E=n?h(t,T):u?h(t,0):void 0;T>b;b++)if((f||b in v)&&(m=_(g=v[b],b,y),e))if(n)E[b]=m;else if(m)switch(e){case 3:return!0;case 5:return g;case 6:return b;case 2:E.push(g)}else if(c)return!1;return d?-1:l||c?c:E}}},7628:(e,t,n)=>{var r=n(4963),i=n(508),a=n(9797),s=n(875);e.exports=function(e,t,n,o,u){r(t);var l=i(e),c=a(l),d=s(l.length),f=u?d-1:0,h=u?-1:1;if(n<2)for(;;){if(f in c){o=c[f],f+=h;break}if(f+=h,u?f<0:d<=f)throw TypeError("Reduce of empty array with no initial value")}for(;u?f>=0:d>f;f+=h)f in c&&(o=t(o,c[f],f,l));return o}},2736:(e,t,n)=>{var r=n(5286),i=n(4302),a=n(6314)("species");e.exports=function(e){var t;return i(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!i(t.prototype)||(t=void 0),r(t)&&null===(t=t[a])&&(t=void 0)),void 0===t?Array:t}},6886:(e,t,n)=>{var r=n(2736);e.exports=function(e,t){return new(r(e))(t)}},1488:(e,t,n)=>{var r=n(2032),i=n(6314)("toStringTag"),a="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?n:a?r(t):"Object"==(s=r(t))&&"function"==typeof t.callee?"Arguments":s}},2032:e=>{var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},5645:e=>{var t=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=t)},2811:(e,t,n)=>{"use strict";var r=n(9275),i=n(681);e.exports=function(e,t,n){t in e?r.f(e,t,i(0,n)):e[t]=n}},741:(e,t,n)=>{var r=n(4963);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},1355:e=>{e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},7057:(e,t,n)=>{e.exports=!n(4253)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},2457:(e,t,n)=>{var r=n(5286),i=n(3816).document,a=r(i)&&r(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},4430:e=>{e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},5541:(e,t,n)=>{var r=n(7184),i=n(4548),a=n(4682);e.exports=function(e){var t=r(e),n=i.f;if(n)for(var s,o=n(e),u=a.f,l=0;o.length>l;)u.call(e,s=o[l++])&&t.push(s);return t}},2985:(e,t,n)=>{var r=n(3816),i=n(5645),a=n(7728),s=n(7234),o=n(741),u="prototype",l=function(e,t,n){var c,d,f,h,p=e&l.F,g=e&l.G,m=e&l.S,y=e&l.P,v=e&l.B,_=g?r:m?r[t]||(r[t]={}):(r[t]||{})[u],T=g?i:i[t]||(i[t]={}),b=T[u]||(T[u]={});for(c in g&&(n=t),n)f=((d=!p&&_&&void 0!==_[c])?_:n)[c],h=v&&d?o(f,r):y&&"function"==typeof f?o(Function.call,f):f,_&&s(_,c,f,e&l.U),T[c]!=f&&a(T,c,h),y&&b[c]!=f&&(b[c]=f)};r.core=i,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},4253:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},8082:(e,t,n)=>{"use strict";n(8269);var r=n(7234),i=n(7728),a=n(4253),s=n(1355),o=n(6314),u=n(1165),l=o("species"),c=!a((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),d=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();e.exports=function(e,t,n){var f=o(e),h=!a((function(){var t={};return t[f]=function(){return 7},7!=""[e](t)})),p=h?!a((function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[l]=function(){return n}),n[f](""),!t})):void 0;if(!h||!p||"replace"===e&&!c||"split"===e&&!d){var g=/./[f],m=n(s,f,""[e],(function(e,t,n,r,i){return t.exec===u?h&&!i?{done:!0,value:g.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}})),y=m[0],v=m[1];r(String.prototype,e,y),i(RegExp.prototype,f,2==t?function(e,t){return v.call(e,this,t)}:function(e){return v.call(e,this)})}}},3218:(e,t,n)=>{"use strict";var r=n(7007);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},18:(e,t,n)=>{e.exports=n(3825)("native-function-to-string",Function.toString)},3816:e=>{var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)},9181:e=>{var t={}.hasOwnProperty;e.exports=function(e,n){return t.call(e,n)}},7728:(e,t,n)=>{var r=n(9275),i=n(681);e.exports=n(7057)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},639:(e,t,n)=>{var r=n(3816).document;e.exports=r&&r.documentElement},1734:(e,t,n)=>{e.exports=!n(7057)&&!n(4253)((function(){return 7!=Object.defineProperty(n(2457)("div"),"a",{get:function(){return 7}}).a}))},266:(e,t,n)=>{var r=n(5286),i=n(7375).set;e.exports=function(e,t,n){var a,s=t.constructor;return s!==n&&"function"==typeof s&&(a=s.prototype)!==n.prototype&&r(a)&&i&&i(e,a),e}},9797:(e,t,n)=>{var r=n(2032);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},6555:(e,t,n)=>{var r=n(2803),i=n(6314)("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||a[i]===e)}},4302:(e,t,n)=>{var r=n(2032);e.exports=Array.isArray||function(e){return"Array"==r(e)}},5286:e=>{e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},5364:(e,t,n)=>{var r=n(5286),i=n(2032),a=n(6314)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[a])?!!t:"RegExp"==i(e))}},8851:(e,t,n)=>{var r=n(7007);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var a=e.return;throw void 0!==a&&r(a.call(e)),t}}},9988:(e,t,n)=>{"use strict";var r=n(2503),i=n(681),a=n(2943),s={};n(7728)(s,n(6314)("iterator"),(function(){return this})),e.exports=function(e,t,n){e.prototype=r(s,{next:i(1,n)}),a(e,t+" Iterator")}},2923:(e,t,n)=>{"use strict";var r=n(4461),i=n(2985),a=n(7234),s=n(7728),o=n(2803),u=n(9988),l=n(2943),c=n(468),d=n(6314)("iterator"),f=!([].keys&&"next"in[].keys()),h="keys",p="values",g=function(){return this};e.exports=function(e,t,n,m,y,v,_){u(n,t,m);var T,b,E,S=function(e){if(!f&&e in C)return C[e];switch(e){case h:case p:return function(){return new n(this,e)}}return function(){return new n(this,e)}},w=t+" Iterator",A=y==p,I=!1,C=e.prototype,R=C[d]||C["@@iterator"]||y&&C[y],D=R||S(y),x=y?A?S("entries"):D:void 0,N="Array"==t&&C.entries||R;if(N&&(E=c(N.call(new e)))!==Object.prototype&&E.next&&(l(E,w,!0),r||"function"==typeof E[d]||s(E,d,g)),A&&R&&R.name!==p&&(I=!0,D=function(){return R.call(this)}),r&&!_||!f&&!I&&C[d]||s(C,d,D),o[t]=D,o[w]=g,y)if(T={values:A?D:S(p),keys:v?D:S(h),entries:x},_)for(b in T)b in C||a(C,b,T[b]);else i(i.P+i.F*(f||I),t,T);return T}},8666:(e,t,n)=>{var r=n(6314)("iterator"),i=!1;try{var a=[7][r]();a.return=function(){i=!0},Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var a=[7],s=a[r]();s.next=function(){return{done:n=!0}},a[r]=function(){return s},e(a)}catch(e){}return n}},5436:e=>{e.exports=function(e,t){return{value:t,done:!!e}}},2803:e=>{e.exports={}},4461:e=>{e.exports=!1},4728:(e,t,n)=>{var r=n(3953)("meta"),i=n(5286),a=n(9181),s=n(9275).f,o=0,u=Object.isExtensible||function(){return!0},l=!n(4253)((function(){return u(Object.preventExtensions({}))})),c=function(e){s(e,r,{value:{i:"O"+ ++o,w:{}}})},d=e.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!a(e,r)){if(!u(e))return"F";if(!t)return"E";c(e)}return e[r].i},getWeak:function(e,t){if(!a(e,r)){if(!u(e))return!0;if(!t)return!1;c(e)}return e[r].w},onFreeze:function(e){return l&&d.NEED&&u(e)&&!a(e,r)&&c(e),e}}},2503:(e,t,n)=>{var r=n(7007),i=n(5588),a=n(4430),s=n(9335)("IE_PROTO"),o=function(){},u="prototype",l=function(){var e,t=n(2457)("iframe"),r=a.length;for(t.style.display="none",n(639).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),l=e.F;r--;)delete l[u][a[r]];return l()};e.exports=Object.create||function(e,t){var n;return null!==e?(o[u]=r(e),n=new o,o[u]=null,n[s]=e):n=l(),void 0===t?n:i(n,t)}},9275:(e,t,n)=>{var r=n(7007),i=n(1734),a=n(1689),s=Object.defineProperty;t.f=n(7057)?Object.defineProperty:function(e,t,n){if(r(e),t=a(t,!0),r(n),i)try{return s(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},5588:(e,t,n)=>{var r=n(9275),i=n(7007),a=n(7184);e.exports=n(7057)?Object.defineProperties:function(e,t){i(e);for(var n,s=a(t),o=s.length,u=0;o>u;)r.f(e,n=s[u++],t[n]);return e}},8693:(e,t,n)=>{var r=n(4682),i=n(681),a=n(2110),s=n(1689),o=n(9181),u=n(1734),l=Object.getOwnPropertyDescriptor;t.f=n(7057)?l:function(e,t){if(e=a(e),t=s(t,!0),u)try{return l(e,t)}catch(e){}if(o(e,t))return i(!r.f.call(e,t),e[t])}},9327:(e,t,n)=>{var r=n(2110),i=n(616).f,a={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"[object Window]"==a.call(e)?function(e){try{return i(e)}catch(e){return s.slice()}}(e):i(r(e))}},616:(e,t,n)=>{var r=n(189),i=n(4430).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},4548:(e,t)=>{t.f=Object.getOwnPropertySymbols},468:(e,t,n)=>{var r=n(9181),i=n(508),a=n(9335)("IE_PROTO"),s=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}},189:(e,t,n)=>{var r=n(9181),i=n(2110),a=n(9315)(!1),s=n(9335)("IE_PROTO");e.exports=function(e,t){var n,o=i(e),u=0,l=[];for(n in o)n!=s&&r(o,n)&&l.push(n);for(;t.length>u;)r(o,n=t[u++])&&(~a(l,n)||l.push(n));return l}},7184:(e,t,n)=>{var r=n(189),i=n(4430);e.exports=Object.keys||function(e){return r(e,i)}},4682:(e,t)=>{t.f={}.propertyIsEnumerable},3160:(e,t,n)=>{var r=n(2985),i=n(5645),a=n(4253);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],s={};s[e]=t(n),r(r.S+r.F*a((function(){n(1)})),"Object",s)}},7643:(e,t,n)=>{var r=n(616),i=n(4548),a=n(7007),s=n(3816).Reflect;e.exports=s&&s.ownKeys||function(e){var t=r.f(a(e)),n=i.f;return n?t.concat(n(e)):t}},681:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},7234:(e,t,n)=>{var r=n(3816),i=n(7728),a=n(9181),s=n(3953)("src"),o=n(18),u="toString",l=(""+o).split(u);n(5645).inspectSource=function(e){return o.call(e)},(e.exports=function(e,t,n,o){var u="function"==typeof n;u&&(a(n,"name")||i(n,"name",t)),e[t]!==n&&(u&&(a(n,s)||i(n,s,e[t]?""+e[t]:l.join(String(t)))),e===r?e[t]=n:o?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,u,(function(){return"function"==typeof this&&this[s]||o.call(this)}))},7787:(e,t,n)=>{"use strict";var r=n(1488),i=RegExp.prototype.exec;e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var a=n.call(e,t);if("object"!=typeof a)throw new TypeError("RegExp exec method returned something other than an Object or null");return a}if("RegExp"!==r(e))throw new TypeError("RegExp#exec called on incompatible receiver");return i.call(e,t)}},1165:(e,t,n)=>{"use strict";var r,i,a=n(3218),s=RegExp.prototype.exec,o=String.prototype.replace,u=s,l="lastIndex",c=(r=/a/,i=/b*/g,s.call(r,"a"),s.call(i,"a"),0!==r[l]||0!==i[l]),d=void 0!==/()??/.exec("")[1];(c||d)&&(u=function(e){var t,n,r,i,u=this;return d&&(n=new RegExp("^"+u.source+"$(?!\\s)",a.call(u))),c&&(t=u[l]),r=s.call(u,e),c&&r&&(u[l]=u.global?r.index+r[0].length:t),d&&r&&r.length>1&&o.call(r[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0)})),r}),e.exports=u},7375:(e,t,n)=>{var r=n(5286),i=n(7007),a=function(e,t){if(i(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(741)(Function.call,n(8693).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return a(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:a}},2974:(e,t,n)=>{"use strict";var r=n(3816),i=n(9275),a=n(7057),s=n(6314)("species");e.exports=function(e){var t=r[e];a&&t&&!t[s]&&i.f(t,s,{configurable:!0,get:function(){return this}})}},2943:(e,t,n)=>{var r=n(9275).f,i=n(9181),a=n(6314)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,a)&&r(e,a,{configurable:!0,value:t})}},9335:(e,t,n)=>{var r=n(3825)("keys"),i=n(3953);e.exports=function(e){return r[e]||(r[e]=i(e))}},3825:(e,t,n)=>{var r=n(5645),i=n(3816),a="__core-js_shared__",s=i[a]||(i[a]={});(e.exports=function(e,t){return s[e]||(s[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(4461)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},8364:(e,t,n)=>{var r=n(7007),i=n(4963),a=n(6314)("species");e.exports=function(e,t){var n,s=r(e).constructor;return void 0===s||null==(n=r(s)[a])?t:i(n)}},7717:(e,t,n)=>{"use strict";var r=n(4253);e.exports=function(e,t){return!!e&&r((function(){t?e.call(null,(function(){}),1):e.call(null)}))}},4496:(e,t,n)=>{var r=n(1467),i=n(1355);e.exports=function(e){return function(t,n){var a,s,o=String(i(t)),u=r(n),l=o.length;return u<0||u>=l?e?"":void 0:(a=o.charCodeAt(u))<55296||a>56319||u+1===l||(s=o.charCodeAt(u+1))<56320||s>57343?e?o.charAt(u):a:e?o.slice(u,u+2):s-56320+(a-55296<<10)+65536}}},2337:(e,t,n)=>{var r=n(1467),i=Math.max,a=Math.min;e.exports=function(e,t){return(e=r(e))<0?i(e+t,0):a(e,t)}},1467:e=>{var t=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:t)(e)}},2110:(e,t,n)=>{var r=n(9797),i=n(1355);e.exports=function(e){return r(i(e))}},875:(e,t,n)=>{var r=n(1467),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},508:(e,t,n)=>{var r=n(1355);e.exports=function(e){return Object(r(e))}},1689:(e,t,n)=>{var r=n(5286);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},3953:e=>{var t=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++t+n).toString(36))}},6074:(e,t,n)=>{var r=n(3816),i=n(5645),a=n(4461),s=n(8787),o=n(9275).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=a?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||o(t,e,{value:s.f(e)})}},8787:(e,t,n)=>{t.f=n(6314)},6314:(e,t,n)=>{var r=n(3825)("wks"),i=n(3953),a=n(3816).Symbol,s="function"==typeof a;(e.exports=function(e){return r[e]||(r[e]=s&&a[e]||(s?a:i)("Symbol."+e))}).store=r},9002:(e,t,n)=>{var r=n(1488),i=n(6314)("iterator"),a=n(2803);e.exports=n(5645).getIteratorMethod=function(e){if(null!=e)return e[i]||e["@@iterator"]||a[r(e)]}},8837:(e,t,n)=>{"use strict";var r=n(2985),i=n(50)(2);r(r.P+r.F*!n(7717)([].filter,!0),"Array",{filter:function(e){return i(this,e,arguments[1])}})},4336:(e,t,n)=>{"use strict";var r=n(2985),i=n(50)(0),a=n(7717)([].forEach,!0);r(r.P+r.F*!a,"Array",{forEach:function(e){return i(this,e,arguments[1])}})},522:(e,t,n)=>{"use strict";var r=n(741),i=n(2985),a=n(508),s=n(8851),o=n(6555),u=n(875),l=n(2811),c=n(9002);i(i.S+i.F*!n(8666)((function(e){Array.from(e)})),"Array",{from:function(e){var t,n,i,d,f=a(e),h="function"==typeof this?this:Array,p=arguments.length,g=p>1?arguments[1]:void 0,m=void 0!==g,y=0,v=c(f);if(m&&(g=r(g,p>2?arguments[2]:void 0,2)),null==v||h==Array&&o(v))for(n=new h(t=u(f.length));t>y;y++)l(n,y,m?g(f[y],y):f[y]);else for(d=v.call(f),n=new h;!(i=d.next()).done;y++)l(n,y,m?s(d,g,[i.value,y],!0):i.value);return n.length=y,n}})},3369:(e,t,n)=>{"use strict";var r=n(2985),i=n(9315)(!1),a=[].indexOf,s=!!a&&1/[1].indexOf(1,-0)<0;r(r.P+r.F*(s||!n(7717)(a)),"Array",{indexOf:function(e){return s?a.apply(this,arguments)||0:i(this,e,arguments[1])}})},774:(e,t,n)=>{var r=n(2985);r(r.S,"Array",{isArray:n(4302)})},6997:(e,t,n)=>{"use strict";var r=n(7722),i=n(5436),a=n(2803),s=n(2110);e.exports=n(2923)(Array,"Array",(function(e,t){this._t=s(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])}),"values"),a.Arguments=a.Array,r("keys"),r("values"),r("entries")},3057:(e,t,n)=>{"use strict";var r=n(2985),i=n(7628);r(r.P+r.F*!n(7717)([].reduce,!0),"Array",{reduce:function(e){return i(this,e,arguments.length,arguments[1],!1)}})},75:(e,t,n)=>{"use strict";var r=n(2985),i=n(4963),a=n(508),s=n(4253),o=[].sort,u=[1,2,3];r(r.P+r.F*(s((function(){u.sort(void 0)}))||!s((function(){u.sort(null)}))||!n(7717)(o)),"Array",{sort:function(e){return void 0===e?o.call(a(this)):o.call(a(this),i(e))}})},6331:(e,t,n)=>{var r=Date.prototype,i="Invalid Date",a="toString",s=r[a],o=r.getTime;new Date(NaN)+""!=i&&n(7234)(r,a,(function(){var e=o.call(this);return e==e?s.call(this):i}))},7470:(e,t,n)=>{var r=n(2985);r(r.S+r.F*!n(7057),"Object",{defineProperties:n(5588)})},8388:(e,t,n)=>{var r=n(2985);r(r.S+r.F*!n(7057),"Object",{defineProperty:n(9275).f})},7476:(e,t,n)=>{var r=n(508),i=n(7184);n(3160)("keys",(function(){return function(e){return i(r(e))}}))},6253:(e,t,n)=>{"use strict";var r=n(1488),i={};i[n(6314)("toStringTag")]="z",i+""!="[object z]"&&n(7234)(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},3946:(e,t,n)=>{var r=n(3816),i=n(266),a=n(9275).f,s=n(616).f,o=n(5364),u=n(3218),l=r.RegExp,c=l,d=l.prototype,f=/a/g,h=/a/g,p=new l(f)!==f;if(n(7057)&&(!p||n(4253)((function(){return h[n(6314)("match")]=!1,l(f)!=f||l(h)==h||"/a/i"!=l(f,"i")})))){l=function(e,t){var n=this instanceof l,r=o(e),a=void 0===t;return!n&&r&&e.constructor===l&&a?e:i(p?new c(r&&!a?e.source:e,t):c((r=e instanceof l)?e.source:e,r&&a?u.call(e):t),n?this:d,l)};for(var g=function(e){e in l||a(l,e,{configurable:!0,get:function(){return c[e]},set:function(t){c[e]=t}})},m=s(c),y=0;m.length>y;)g(m[y++]);d.constructor=l,l.prototype=d,n(7234)(r,"RegExp",l)}n(2974)("RegExp")},8269:(e,t,n)=>{"use strict";var r=n(1165);n(2985)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},6774:(e,t,n)=>{n(7057)&&"g"!=/./g.flags&&n(9275).f(RegExp.prototype,"flags",{configurable:!0,get:n(3218)})},1466:(e,t,n)=>{"use strict";var r=n(7007),i=n(875),a=n(6793),s=n(7787);n(8082)("match",1,(function(e,t,n,o){return[function(n){var r=e(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,r):new RegExp(n)[t](String(r))},function(e){var t=o(n,e,this);if(t.done)return t.value;var u=r(e),l=String(this);if(!u.global)return s(u,l);var c=u.unicode;u.lastIndex=0;for(var d,f=[],h=0;null!==(d=s(u,l));){var p=String(d[0]);f[h]=p,""===p&&(u.lastIndex=a(l,i(u.lastIndex),c)),h++}return 0===h?null:f}]}))},9357:(e,t,n)=>{"use strict";var r=n(7007),i=n(508),a=n(875),s=n(1467),o=n(6793),u=n(7787),l=Math.max,c=Math.min,d=Math.floor,f=/\$([$&`']|\d\d?|<[^>]*>)/g,h=/\$([$&`']|\d\d?)/g;n(8082)("replace",2,(function(e,t,n,p){return[function(r,i){var a=e(this),s=null==r?void 0:r[t];return void 0!==s?s.call(r,a,i):n.call(String(a),r,i)},function(e,t){var i=p(n,e,this,t);if(i.done)return i.value;var d=r(e),f=String(this),h="function"==typeof t;h||(t=String(t));var m=d.global;if(m){var y=d.unicode;d.lastIndex=0}for(var v=[];;){var _=u(d,f);if(null===_)break;if(v.push(_),!m)break;""===String(_[0])&&(d.lastIndex=o(f,a(d.lastIndex),y))}for(var T,b="",E=0,S=0;S<v.length;S++){_=v[S];for(var w=String(_[0]),A=l(c(s(_.index),f.length),0),I=[],C=1;C<_.length;C++)I.push(void 0===(T=_[C])?T:String(T));var R=_.groups;if(h){var D=[w].concat(I,A,f);void 0!==R&&D.push(R);var x=String(t.apply(void 0,D))}else x=g(w,f,A,I,R,t);A>=E&&(b+=f.slice(E,A)+x,E=A+w.length)}return b+f.slice(E)}];function g(e,t,r,a,s,o){var u=r+e.length,l=a.length,c=h;return void 0!==s&&(s=i(s),c=f),n.call(o,c,(function(n,i){var o;switch(i.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,r);case"'":return t.slice(u);case"<":o=s[i.slice(1,-1)];break;default:var c=+i;if(0===c)return n;if(c>l){var f=d(c/10);return 0===f?n:f<=l?void 0===a[f-1]?i.charAt(1):a[f-1]+i.charAt(1):n}o=a[c-1]}return void 0===o?"":o}))}}))},1876:(e,t,n)=>{"use strict";var r=n(5364),i=n(7007),a=n(8364),s=n(6793),o=n(875),u=n(7787),l=n(1165),c=n(4253),d=Math.min,f=[].push,h="split",p="length",g="lastIndex",m=4294967295,y=!c((function(){RegExp(m,"y")}));n(8082)("split",2,(function(e,t,n,c){var v;return v="c"=="abbc"[h](/(b)*/)[1]||4!="test"[h](/(?:)/,-1)[p]||2!="ab"[h](/(?:ab)*/)[p]||4!="."[h](/(.?)(.?)/)[p]||"."[h](/()()/)[p]>1||""[h](/.?/)[p]?function(e,t){var i=String(this);if(void 0===e&&0===t)return[];if(!r(e))return n.call(i,e,t);for(var a,s,o,u=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),d=0,h=void 0===t?m:t>>>0,y=new RegExp(e.source,c+"g");(a=l.call(y,i))&&!((s=y[g])>d&&(u.push(i.slice(d,a.index)),a[p]>1&&a.index<i[p]&&f.apply(u,a.slice(1)),o=a[0][p],d=s,u[p]>=h));)y[g]===a.index&&y[g]++;return d===i[p]?!o&&y.test("")||u.push(""):u.push(i.slice(d)),u[p]>h?u.slice(0,h):u}:"0"[h](void 0,0)[p]?function(e,t){return void 0===e&&0===t?[]:n.call(this,e,t)}:n,[function(n,r){var i=e(this),a=null==n?void 0:n[t];return void 0!==a?a.call(n,i,r):v.call(String(i),n,r)},function(e,t){var r=c(v,e,this,t,v!==n);if(r.done)return r.value;var l=i(e),f=String(this),h=a(l,RegExp),p=l.unicode,g=(l.ignoreCase?"i":"")+(l.multiline?"m":"")+(l.unicode?"u":"")+(y?"y":"g"),_=new h(y?l:"^(?:"+l.source+")",g),T=void 0===t?m:t>>>0;if(0===T)return[];if(0===f.length)return null===u(_,f)?[f]:[];for(var b=0,E=0,S=[];E<f.length;){_.lastIndex=y?E:0;var w,A=u(_,y?f:f.slice(E));if(null===A||(w=d(o(_.lastIndex+(y?0:E)),f.length))===b)E=s(f,E,p);else{if(S.push(f.slice(b,E)),S.length===T)return S;for(var I=1;I<=A.length-1;I++)if(S.push(A[I]),S.length===T)return S;E=b=w}}return S.push(f.slice(b)),S}]}))},6108:(e,t,n)=>{"use strict";n(6774);var r=n(7007),i=n(3218),a=n(7057),s="toString",o=/./[s],u=function(e){n(7234)(RegExp.prototype,s,e,!0)};n(4253)((function(){return"/a/b"!=o.call({source:"a",flags:"b"})}))?u((function(){var e=r(this);return"/".concat(e.source,"/","flags"in e?e.flags:!a&&e instanceof RegExp?i.call(e):void 0)})):o.name!=s&&u((function(){return o.call(this)}))},9115:(e,t,n)=>{"use strict";var r=n(4496)(!0);n(2923)(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})}))},5767:(e,t,n)=>{"use strict";var r=n(3816),i=n(9181),a=n(7057),s=n(2985),o=n(7234),u=n(4728).KEY,l=n(4253),c=n(3825),d=n(2943),f=n(3953),h=n(6314),p=n(8787),g=n(6074),m=n(5541),y=n(4302),v=n(7007),_=n(5286),T=n(508),b=n(2110),E=n(1689),S=n(681),w=n(2503),A=n(9327),I=n(8693),C=n(4548),R=n(9275),D=n(7184),x=I.f,N=R.f,O=A.f,P=r.Symbol,M=r.JSON,k=M&&M.stringify,L="prototype",F=h("_hidden"),U=h("toPrimitive"),B={}.propertyIsEnumerable,j=c("symbol-registry"),q=c("symbols"),H=c("op-symbols"),G=Object[L],V="function"==typeof P&&!!C.f,Y=r.QObject,z=!Y||!Y[L]||!Y[L].findChild,Z=a&&l((function(){return 7!=w(N({},"a",{get:function(){return N(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=x(G,t);r&&delete G[t],N(e,t,n),r&&e!==G&&N(G,t,r)}:N,K=function(e){var t=q[e]=w(P[L]);return t._k=e,t},W=V&&"symbol"==typeof P.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof P},X=function(e,t,n){return e===G&&X(H,t,n),v(e),t=E(t,!0),v(n),i(q,t)?(n.enumerable?(i(e,F)&&e[F][t]&&(e[F][t]=!1),n=w(n,{enumerable:S(0,!1)})):(i(e,F)||N(e,F,S(1,{})),e[F][t]=!0),Z(e,t,n)):N(e,t,n)},$=function(e,t){v(e);for(var n,r=m(t=b(t)),i=0,a=r.length;a>i;)X(e,n=r[i++],t[n]);return e},Q=function(e){var t=B.call(this,e=E(e,!0));return!(this===G&&i(q,e)&&!i(H,e))&&(!(t||!i(this,e)||!i(q,e)||i(this,F)&&this[F][e])||t)},J=function(e,t){if(e=b(e),t=E(t,!0),e!==G||!i(q,t)||i(H,t)){var n=x(e,t);return!n||!i(q,t)||i(e,F)&&e[F][t]||(n.enumerable=!0),n}},ee=function(e){for(var t,n=O(b(e)),r=[],a=0;n.length>a;)i(q,t=n[a++])||t==F||t==u||r.push(t);return r},te=function(e){for(var t,n=e===G,r=O(n?H:b(e)),a=[],s=0;r.length>s;)!i(q,t=r[s++])||n&&!i(G,t)||a.push(q[t]);return a};V||(o((P=function(){if(this instanceof P)throw TypeError("Symbol is not a constructor!");var e=f(arguments.length>0?arguments[0]:void 0),t=function(n){this===G&&t.call(H,n),i(this,F)&&i(this[F],e)&&(this[F][e]=!1),Z(this,e,S(1,n))};return a&&z&&Z(G,e,{configurable:!0,set:t}),K(e)})[L],"toString",(function(){return this._k})),I.f=J,R.f=X,n(616).f=A.f=ee,n(4682).f=Q,C.f=te,a&&!n(4461)&&o(G,"propertyIsEnumerable",Q,!0),p.f=function(e){return K(h(e))}),s(s.G+s.W+s.F*!V,{Symbol:P});for(var ne="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),re=0;ne.length>re;)h(ne[re++]);for(var ie=D(h.store),ae=0;ie.length>ae;)g(ie[ae++]);s(s.S+s.F*!V,"Symbol",{for:function(e){return i(j,e+="")?j[e]:j[e]=P(e)},keyFor:function(e){if(!W(e))throw TypeError(e+" is not a symbol!");for(var t in j)if(j[t]===e)return t},useSetter:function(){z=!0},useSimple:function(){z=!1}}),s(s.S+s.F*!V,"Object",{create:function(e,t){return void 0===t?w(e):$(w(e),t)},defineProperty:X,defineProperties:$,getOwnPropertyDescriptor:J,getOwnPropertyNames:ee,getOwnPropertySymbols:te});var se=l((function(){C.f(1)}));s(s.S+s.F*se,"Object",{getOwnPropertySymbols:function(e){return C.f(T(e))}}),M&&s(s.S+s.F*(!V||l((function(){var e=P();return"[null]"!=k([e])||"{}"!=k({a:e})||"{}"!=k(Object(e))}))),"JSON",{stringify:function(e){for(var t,n,r=[e],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=t=r[1],(_(t)||void 0!==e)&&!W(e))return y(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!W(t))return t}),r[1]=t,k.apply(M,r)}}),P[L][U]||n(7728)(P[L],U,P[L].valueOf),d(P,"Symbol"),d(Math,"Math",!0),d(r.JSON,"JSON",!0)},8351:(e,t,n)=>{var r=n(2985),i=n(7643),a=n(2110),s=n(8693),o=n(2811);r(r.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,n,r=a(e),u=s.f,l=i(r),c={},d=0;l.length>d;)void 0!==(n=u(r,t=l[d++]))&&o(c,t,n);return c}})},1181:(e,t,n)=>{for(var r=n(6997),i=n(7184),a=n(7234),s=n(3816),o=n(7728),u=n(2803),l=n(6314),c=l("iterator"),d=l("toStringTag"),f=u.Array,h={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},p=i(h),g=0;g<p.length;g++){var m,y=p[g],v=h[y],_=s[y],T=_&&_.prototype;if(T&&(T[c]||o(T,c,f),T[d]||o(T,d,y),u[y]=f,v))for(m in r)T[m]||a(T,m,r[m],!0)}},5176:e=>{self,e.exports=function(){var e={4593:function(e,t){var n,r,i,o,u,l={};n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=function(e){for(var t=0,r=[],i=0|e.length/3;0<i--;){var a=(e[t]<<16)+(e[t+1]<<8)+e[t+2];t+=3,r.push(n.charAt(63&a>>18)),r.push(n.charAt(63&a>>12)),r.push(n.charAt(63&a>>6)),r.push(n.charAt(63&a))}return 2==e.length-t?(a=(e[t]<<16)+(e[t+1]<<8),r.push(n.charAt(63&a>>18)),r.push(n.charAt(63&a>>12)),r.push(n.charAt(63&a>>6)),r.push("=")):1==e.length-t&&(a=e[t]<<16,r.push(n.charAt(63&a>>18)),r.push(n.charAt(63&a>>12)),r.push("==")),r.join("")},i=function(){for(var e=[],t=0;t<64;++t)e[n.charCodeAt(t)]=t;return e["=".charCodeAt(0)]=0,e}(),o=function(e){for(var t=0,n=[],r=0|e.length/4;0<r--;){var a=(i[e.charCodeAt(t)]<<18)+(i[e.charCodeAt(t+1)]<<12)+(i[e.charCodeAt(t+2)]<<6)+i[e.charCodeAt(t+3)];n.push(255&a>>16),n.push(255&a>>8),n.push(255&a),t+=4}return n&&("="==e.charAt(t-2)?(n.pop(),n.pop()):"="==e.charAt(t-1)&&n.pop()),n},u={encode:function(e){for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t},decode:function(e){for(var t=0;t<s.length;++t)a[t]=String.fromCharCode(a[t]);return a.join("")}},l.decodeArray=function(e){var t=o(e);return new Uint8Array(t)},l.encodeASCII=function(e){var t=u.encode(e);return r(t)},l.decodeASCII=function(e){var t=o(e);return u.decode(t)},l.encode=function(e){var t=function(e){for(var t=[],n=0;n<e.length;++n){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?(t.push(192|r>>6),t.push(128|63&r)):r<65536?(t.push(224|r>>12),t.push(128|63&r>>6),t.push(128|63&r)):(t.push(240|r>>18),t.push(128|63&r>>12),t.push(128|63&r>>6),t.push(128|63&r))}return t}(e);return r(t)},l.decode=function(e){return function(e){for(var t=[],n=0;n<e.length;){var r=e[n++];r<128||(r<224?(r=(31&r)<<6,r|=63&e[n++]):r<240?(r=(15&r)<<12,r|=(63&e[n++])<<6,r|=63&e[n++]):(r=(7&r)<<18,r|=(63&e[n++])<<12,r|=(63&e[n++])<<6,r|=63&e[n++])),t.push(String.fromCharCode(r))}return t.join("")}(o(e))},t.decode=l.decode,t.decodeArray=l.decodeArray,t.encode=l.encode,t.encodeASCII=l.encodeASCII},452:function(e,t){!function(e){"use strict";var t={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},n=function(e){var n=e;return t.hasOwnProperty(e)&&(n=t[e]),String.fromCharCode(n)},r=15,i=32,a={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},s={17:2,18:4,21:6,22:8,23:10,19:13,20:15},o={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},u={25:2,26:4,29:6,30:8,31:10,27:13,28:15},l=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],c={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(e){this.time=e},log:function(e,t){var n=this.verboseFilter[e];this.verboseLevel>=n&&console.log(this.time+" ["+e+"] "+t)}},d=function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].toString(16));return t},f=function(e,t,n,r,i){this.foreground=e||"white",this.underline=t||!1,this.italics=n||!1,this.background=r||"black",this.flash=i||!1};f.prototype={reset:function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},setStyles:function(e){for(var t=["foreground","underline","italics","background","flash"],n=0;n<t.length;n++){var r=t[n];e.hasOwnProperty(r)&&(this[r]=e[r])}},isDefault:function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},equals:function(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash},copy:function(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash},toString:function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}};var h=function(e,t,n,r,i,a){this.uchar=e||" ",this.penState=new f(t,n,r,i,a)};h.prototype={reset:function(){this.uchar=" ",this.penState.reset()},setChar:function(e,t){this.uchar=e,this.penState.copy(t)},setPenState:function(e){this.penState.copy(e)},equals:function(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)},copy:function(e){this.uchar=e.uchar,this.penState.copy(e.penState)},isEmpty:function(){return" "===this.uchar&&this.penState.isDefault()}};var p=function(){this.chars=[];for(var e=0;e<i;e++)this.chars.push(new h);this.pos=0,this.currPenState=new f};p.prototype={equals:function(e){for(var t=!0,n=0;n<i;n++)if(!this.chars[n].equals(e.chars[n])){t=!1;break}return t},copy:function(e){for(var t=0;t<i;t++)this.chars[t].copy(e.chars[t])},isEmpty:function(){for(var e=!0,t=0;t<i;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e},setCursor:function(e){this.pos!==e&&(this.pos=e),this.pos<0?(c.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>i&&(c.log("ERROR","Too large cursor position "+this.pos),this.pos=i)},moveCursor:function(e){var t=this.pos+e;if(e>1)for(var n=this.pos+1;n<t+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(t)},backSpace:function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},insertChar:function(e){e>=144&&this.backSpace();var t=n(e);this.pos>=i?c.log("ERROR","Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))},clearFromPos:function(e){var t;for(t=e;t<i;t++)this.chars[t].reset()},clear:function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},clearToEndOfRow:function(){this.clearFromPos(this.pos)},getTextString:function(){for(var e=[],t=!0,n=0;n<i;n++){var r=this.chars[n].uchar;" "!==r&&(t=!1),e.push(r)}return t?"":e.join("")},setPenStyles:function(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}};var g=function(){this.rows=[];for(var e=0;e<r;e++)this.rows.push(new p);this.currRow=14,this.nrRollUpRows=null,this.reset()};g.prototype={reset:function(){for(var e=0;e<r;e++)this.rows[e].clear();this.currRow=14},equals:function(e){for(var t=!0,n=0;n<r;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t},copy:function(e){for(var t=0;t<r;t++)this.rows[t].copy(e.rows[t])},isEmpty:function(){for(var e=!0,t=0;t<r;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e},backSpace:function(){this.rows[this.currRow].backSpace()},clearToEndOfRow:function(){this.rows[this.currRow].clearToEndOfRow()},insertChar:function(e){this.rows[this.currRow].insertChar(e)},setPen:function(e){this.rows[this.currRow].setPenStyles(e)},moveCursor:function(e){this.rows[this.currRow].moveCursor(e)},setCursor:function(e){c.log("INFO","setCursor: "+e),this.rows[this.currRow].setCursor(e)},setPAC:function(e){c.log("INFO","pacData = "+JSON.stringify(e));var t=e.row-1;this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.currRow=t;var n=this.rows[this.currRow];if(null!==e.indent){var r=e.indent,i=Math.max(r-1,0);n.setCursor(e.indent),e.color=n.chars[i].penState.foreground}var a={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(a)},setBkgData:function(e){c.log("INFO","bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)},setRollUpRows:function(e){this.nrRollUpRows=e},rollUp:function(){if(null!==this.nrRollUpRows){c.log("TEXT",this.getDisplayText());var e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),c.log("INFO","Rolling up")}else c.log("DEBUG","roll_up but nrRollUpRows not set yet")},getDisplayText:function(e){e=e||!1;for(var t=[],n="",i=-1,a=0;a<r;a++){var s=this.rows[a].getTextString();s&&(i=a+1,e?t.push("Row "+i+': "'+s+'"'):t.push(s.trim()))}return t.length>0&&(n=e?"["+t.join(" | ")+"]":t.join("\n")),n},getTextAndFormat:function(){return this.rows}};var m=function(e,t){this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new g,this.nonDisplayedMemory=new g,this.lastOutputScreen=new g,this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null};m.prototype={modes:["MODE_ROLL-UP","MODE_POP-ON","MODE_PAINT-ON","MODE_TEXT"],reset:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null},getHandler:function(){return this.outputFilter},setHandler:function(e){this.outputFilter=e},setPAC:function(e){this.writeScreen.setPAC(e)},setBkgData:function(e){this.writeScreen.setBkgData(e)},setMode:function(e){e!==this.mode&&(this.mode=e,c.log("INFO","MODE="+e),"MODE_POP-ON"==this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)},insertChars:function(e){for(var t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);var n=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";c.log("INFO",n+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(c.log("TEXT","DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},cc_RCL:function(){c.log("INFO","RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},cc_BS:function(){c.log("INFO","BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},cc_AOF:function(){},cc_AON:function(){},cc_DER:function(){c.log("INFO","DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},cc_RU:function(e){c.log("INFO","RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)},cc_FON:function(){c.log("INFO","FON - Flash On"),this.writeScreen.setPen({flash:!0})},cc_RDC:function(){c.log("INFO","RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},cc_TR:function(){c.log("INFO","TR"),this.setMode("MODE_TEXT")},cc_RTD:function(){c.log("INFO","RTD"),this.setMode("MODE_TEXT")},cc_EDM:function(){c.log("INFO","EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate()},cc_CR:function(){c.log("CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate()},cc_ENM:function(){c.log("INFO","ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},cc_EOC:function(){if(c.log("INFO","EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,c.log("TEXT","DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate()},cc_TO:function(e){c.log("INFO","TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)},cc_MIDROW:function(e){var t={flash:!1};if(t.underline=e%2==1,t.italics=e>=46,t.italics)t.foreground="white";else{var n=Math.floor(e/2)-16;t.foreground=["white","green","blue","cyan","red","yellow","magenta"][n]}c.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},outputDataUpdate:function(){var e=c.time;null!==e&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(e,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},cueSplitAtTime:function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}};var y=function(e,t,n){this.field=e||1,this.outputs=[t,n],this.channels=[new m(1,t),new m(2,n)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}};y.prototype={getHandler:function(e){return this.channels[e].getHandler()},setHandler:function(e,t){this.channels[e].setHandler(t)},addData:function(e,t){var n,r,i,a=!1;this.lastTime=e,c.setTime(e);for(var s=0;s<t.length;s+=2)r=127&t[s],i=127&t[s+1],r>=16&&r<=31&&r===this.lastCmdA&&i===this.lastCmdB?(this.lastCmdA=null,this.lastCmdB=null,c.log("DEBUG","Repeated command ("+d([r,i])+") is dropped")):0!==r||0!==i?(c.log("DATA","["+d([t[s],t[s+1]])+"] -> ("+d([r,i])+")"),(n=this.parseCmd(r,i))||(n=this.parseMidrow(r,i)),n||(n=this.parsePAC(r,i)),n||(n=this.parseBackgroundAttributes(r,i)),n||(a=this.parseChars(r,i))&&(this.currChNr&&this.currChNr>=0?this.channels[this.currChNr-1].insertChars(a):c.log("WARNING","No channel found yet. TEXT-MODE?")),n?this.dataCounters.cmd+=2:a?this.dataCounters.char+=2:(this.dataCounters.other+=2,c.log("WARNING","Couldn't parse cleaned data "+d([r,i])+" orig: "+d([t[s],t[s+1]])))):this.dataCounters.padding+=2},parseCmd:function(e,t){var n;if(!((20===e||21===e||28===e||29===e)&&32<=t&&t<=47||(23===e||31===e)&&33<=t&&t<=35))return!1;n=20===e||21===e||23===e?1:2;var r=this.channels[n-1];return 20===e||21===e||28===e||29===e?32===t?r.cc_RCL():33===t?r.cc_BS():34===t?r.cc_AOF():35===t?r.cc_AON():36===t?r.cc_DER():37===t?r.cc_RU(2):38===t?r.cc_RU(3):39===t?r.cc_RU(4):40===t?r.cc_FON():41===t?r.cc_RDC():42===t?r.cc_TR():43===t?r.cc_RTD():44===t?r.cc_EDM():45===t?r.cc_CR():46===t?r.cc_ENM():47===t&&r.cc_EOC():r.cc_TO(t-32),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},parseMidrow:function(e,t){var n=null;if((17===e||25===e)&&32<=t&&t<=47){if((n=17===e?1:2)!==this.currChNr)return c.log("ERROR","Mismatch channel in midrow parsing"),!1;var r=this.channels[n-1];return r.insertChars([32]),r.cc_MIDROW(t),c.log("DEBUG","MIDROW ("+d([e,t])+")"),this.lastCmdA=e,this.lastCmdB=t,!0}return!1},parsePAC:function(e,t){var n,r;if(!((17<=e&&e<=23||25<=e&&e<=31)&&64<=t&&t<=127||(16===e||24===e)&&64<=t&&t<=95))return!1;n=e<=23?1:2,r=64<=t&&t<=95?1===n?a[e]:o[e]:1===n?s[e]:u[e];var i=this.interpretPAC(r,t);return this.channels[n-1].setPAC(i),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},interpretPAC:function(e,t){var n,r={color:null,italics:!1,indent:null,underline:!1,row:e};return n=t>95?t-96:t-64,r.underline=1==(1&n),n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((n-16)/2),r},parseChars:function(e,t){var r,i=null,a=null,s=null;if(e>=25?(i=2,s=e-8):(i=1,s=e),17<=s&&s<=19?(r=17===s?t+80:18===s?t+112:t+144,c.log("INFO","Special char '"+n(r)+"' in channel "+i),a=[r],this.lastCmdA=e,this.lastCmdB=t):32<=e&&e<=127&&(a=0===t?[e]:[e,t],this.lastCmdA=null,this.lastCmdB=null),a){var o=d(a);c.log("DEBUG","Char codes = "+o.join(","))}return a},parseBackgroundAttributes:function(e,t){var n,r,i;return((16===e||24===e)&&32<=t&&t<=47||(23===e||31===e)&&45<=t&&t<=47)&&(n={},16===e||24===e?(r=Math.floor((t-32)/2),n.background=l[r],t%2==1&&(n.background=n.background+"_semi")):45===t?n.background="transparent":(n.foreground="black",47===t&&(n.underline=!0)),i=e<24?1:2,this.channels[i-1].setBkgData(n),this.lastCmdA=e,this.lastCmdB=t,!0)},reset:function(){for(var e=0;e<this.channels.length;e++)this.channels[e]&&this.channels[e].reset();this.lastCmdA=null,this.lastCmdB=null},cueSplitAtTime:function(e){for(var t=0;t<this.channels.length;t++)this.channels[t]&&this.channels[t].cueSplitAtTime(e)}},e.logger=c,e.PenState=f,e.CaptionScreen=g,e.Cea608Parser=y,e.findCea608Nalus=function(e,t,n){for(var r=0,i=t,a=[],s=function(e,t,n,r){if(4!==e||t<8)return null;var i=n.getUint8(r),a=n.getUint16(r+1),s=n.getUint32(r+3),o=n.getUint8(r+7);return 181==i&&49==a&&1195456820==s&&3==o};i<t+n;){if(r=e.getUint32(i),6==(31&e.getUint8(i+4)))for(var o=i+5,u=-1;o<i+4+r-1;){u=0;for(var l=255;255===l;)u+=l=e.getUint8(o),o++;var c=0;for(l=255;255===l;)c+=l=e.getUint8(o),o++;s(u,c,e,o)&&a.push([o,c]),o+=c}i+=r+4}return a},e.extractCea608DataFromRange=function(e,t){var n=t[0],r=[[],[]];n+=8;var i=31&e.getUint8(n);n+=2;for(var a=0;a<i;a++){var s=e.getUint8(n),o=4&s,u=3&s;n++;var l=e.getUint8(n);n++;var c=e.getUint8(n);n++,o&&(127&l)+(127&c)!=0&&(0===u?(r[0].push(l),r[0].push(c)):1===u&&(r[1].push(l),r[1].push(c)))}return r}}(t)},8416:function(e,t,n){"use strict";var r=n(7688),i=n(5448),a=n(6398),s=n(2032),o=(n(5530),"undefined"!=typeof window&&window||n.g),u=o.dashjs;u||(u=o.dashjs={}),u.MediaPlayer=r.Z,u.FactoryMaker=i.Z,u.Debug=a.Z,u.Version=(0,s.e)()},6398:function(e,t,n){"use strict";var r=n(5595),i=n(8512),a=n(5448),s=1,o=2,u=3,l=4,c=5;function d(e){e=e||{};var t,n,a,d,f=this.context,h=(0,r.Z)(f).getInstance(),p=e.settings,g=[];function m(e){return e&&e.bind?e.bind(window.console):window.console.log.bind(window.console)}function y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];E.apply(void 0,[s,this].concat(t))}function v(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];E.apply(void 0,[o,this].concat(t))}function _(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];E.apply(void 0,[u,this].concat(t))}function T(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];E.apply(void 0,[l,this].concat(t))}function b(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];E.apply(void 0,[c,this].concat(t))}function E(e,t){var r="",s=null;n&&(s=(new Date).getTime(),r+="["+(s-d)+"]"),a&&t&&t.getClassName&&(r+="["+t.getClassName()+"]",t.getType&&(r+="["+t.getType()+"]")),r.length>0&&(r+=" ");for(var o=arguments.length,u=new Array(o>2?o-2:0),l=2;l<o;l++)u[l-2]=arguments[l];Array.apply(null,u).forEach((function(e){r+=e+" "})),g[e]&&p&&p.get().debug.logLevel>=e&&g[e](r),p&&p.get().debug.dispatchEvent&&h.trigger(i.Z.LOG,{message:r,level:e})}return t={getLogger:function(e){return{fatal:y.bind(e),error:v.bind(e),warn:_.bind(e),info:T.bind(e),debug:b.bind(e)}},setLogTimestampVisible:function(e){n=e},setCalleeNameVisible:function(e){a=e}},n=!0,a=!0,d=(new Date).getTime(),"undefined"!=typeof window&&window.console&&(g[s]=m(window.console.error),g[o]=m(window.console.error),g[u]=m(window.console.warn),g[l]=m(window.console.info),g[c]=m(window.console.debug)),t}d.__dashjs_factory_name="Debug";var f=a.Z.getSingletonFactory(d);f.LOG_LEVEL_NONE=0,f.LOG_LEVEL_FATAL=s,f.LOG_LEVEL_ERROR=o,f.LOG_LEVEL_WARNING=u,f.LOG_LEVEL_INFO=l,f.LOG_LEVEL_DEBUG=c,a.Z.updateSingletonFactory(d.__dashjs_factory_name,f),t.Z=f},5595:function(e,t,n){"use strict";var r=n(5448),i=n(8825);function a(){var e={};function t(t,n,r){var i=-1;return e[t]?(e[t].some((function(e,t){if(e&&e.callback===n&&(!r||r===e.scope))return i=t,!0})),i):i}var n={on:function(n,r,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!n)throw new Error("event type cannot be null or undefined");if(!r||"function"!=typeof r)throw new Error("listener must be a function: "+r);var s=a.priority||0;if(!(t(n,r,i)>=0)){e[n]=e[n]||[];var o={callback:r,scope:i,priority:s};i&&i.getStreamId&&(o.streamId=i.getStreamId()),i&&i.getType&&(o.mediaType=i.getType()),a&&a.mode&&(o.mode=a.mode);var u=e[n].some((function(t,r){if(t&&s>t.priority)return e[n].splice(r,0,o),!0}));u||e[n].push(o)}},off:function(n,r,i){if(n&&r&&e[n]){var a=t(n,r,i);a<0||(e[n][a]=null)}},trigger:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t&&e[t]){if((n=n||{}).hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");n.type=t,r.streamId&&(n.streamId=r.streamId),r.mediaType&&(n.mediaType=r.mediaType),e[t].filter((function(e){return!(!e||r.streamId&&e.streamId&&e.streamId!==r.streamId||r.mediaType&&e.mediaType&&e.mediaType!==r.mediaType||r.mode&&e.mode&&e.mode!==r.mode||!e.mode&&r.mode&&r.mode===i.Z.EVENT_MODE_ON_RECEIVE)})).forEach((function(e){return e&&e.callback.call(e.scope,n)}))}},reset:function(){e={}}};return n}a.__dashjs_factory_name="EventBus";var s=r.Z.getSingletonFactory(a);s.EVENT_PRIORITY_LOW=0,s.EVENT_PRIORITY_HIGH=5e3,r.Z.updateSingletonFactory(a.__dashjs_factory_name,s),t.Z=s},5448:function(e,t){"use strict";var n=function(){var e,t=[],n={},r={};function i(e,n){for(var r in t){var i=t[r];if(i.context===e&&i.name===n)return i.instance}return null}function a(e,t){return t[e]}function s(e,t,n){e in n&&(n[e]=t)}function o(t,n,r){var i,a=t.__dashjs_factory_name,s=n[a];if(s){var o=s.instance;if(!s.override)return o.apply({context:n,factory:e},r);for(var u in i=t.apply({context:n},r),o=o.apply({context:n,factory:e,parent:i},r))i.hasOwnProperty(u)&&(i[u]=o[u])}else i=t.apply({context:n},r);return i.getClassName=function(){return a},i}return e={extend:function(e,t,n,r){!r[e]&&t&&(r[e]={instance:t,override:n})},getSingletonInstance:i,setSingletonInstance:function(e,n,r){for(var i in t){var a=t[i];if(a.context===e&&a.name===n)return void(t[i].instance=r)}t.push({name:n,context:e,instance:r})},deleteSingletonInstances:function(e){t=t.filter((function(t){return t.context!==e}))},getSingletonFactory:function(e){var r=a(e.__dashjs_factory_name,n);return r||(r=function(n){var r;return void 0===n&&(n={}),{getInstance:function(){return r||(r=i(n,e.__dashjs_factory_name)),r||(r=o(e,n,arguments),t.push({name:e.__dashjs_factory_name,context:n,instance:r})),r}}},n[e.__dashjs_factory_name]=r),r},getSingletonFactoryByName:function(e){return a(e,n)},updateSingletonFactory:function(e,t){s(e,t,n)},getClassFactory:function(e){var t=a(e.__dashjs_factory_name,r);return t||(t=function(t){return void 0===t&&(t={}),{create:function(){return o(e,t,arguments)}}},r[e.__dashjs_factory_name]=t),t},getClassFactoryByName:function(e){return a(e,r)},updateClassFactory:function(e,t){s(e,t,r)}},e}();t.Z=n},1264:function(e,t,n){"use strict";var r=n(5448),i=n(703),a=n(6398),s=n(3393),o=n(7855),u=n(5595),l=n(8512);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(){var e,t,n=this.context,r=(0,u.Z)(n).getInstance(),f={"streaming.delay.liveDelay":l.Z.SETTING_UPDATED_LIVE_DELAY,"streaming.delay.liveDelayFragmentCount":l.Z.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,"streaming.liveCatchup.enabled":l.Z.SETTING_UPDATED_CATCHUP_ENABLED,"streaming.liveCatchup.playbackRate.min":l.Z.SETTING_UPDATED_PLAYBACK_RATE_MIN,"streaming.liveCatchup.playbackRate.max":l.Z.SETTING_UPDATED_PLAYBACK_RATE_MAX},h={debug:{logLevel:a.Z.LOG_LEVEL_WARNING,dispatchEvent:!1},streaming:{abandonLoadTimeout:1e4,wallclockTimeUpdateInterval:100,manifestUpdateRetryInterval:100,cacheInitSegments:!1,applyServiceDescription:!0,applyProducerReferenceTime:!0,applyContentSteering:!0,eventControllerRefreshDelay:100,enableManifestDurationMismatchFix:!0,parseInbandPrft:!1,enableManifestTimescaleMismatchFix:!1,capabilities:{filterUnsupportedEssentialProperties:!0,useMediaCapabilitiesApi:!1},timeShiftBuffer:{calcFromSegmentTimeline:!1,fallbackToSegmentTimeline:!0},metrics:{maxListDepth:100},delay:{liveDelayFragmentCount:NaN,liveDelay:NaN,useSuggestedPresentationDelay:!0},protection:{keepProtectionMediaKeys:!1,ignoreEmeEncryptedEvent:!1,detectPlayreadyMessageFormat:!0},buffer:{enableSeekDecorrelationFix:!1,fastSwitchEnabled:!0,flushBufferAtTrackSwitch:!1,reuseExistingSourceBuffers:!0,bufferPruningInterval:10,bufferToKeep:20,bufferTimeAtTopQuality:30,bufferTimeAtTopQualityLongForm:60,initialBufferLevel:NaN,stableBufferTime:12,longFormContentDurationThreshold:600,stallThreshold:.3,useAppendWindow:!0,setStallState:!0,avoidCurrentTimeRangePruning:!1,useChangeTypeForTrackSwitch:!0,mediaSourceDurationInfinity:!0,resetSourceBuffersForTrackSwitch:!1},gaps:{jumpGaps:!0,jumpLargeGaps:!0,smallGapLimit:1.5,threshold:.3,enableSeekFix:!0,enableStallFix:!1,stallSeek:.1},utcSynchronization:{enabled:!0,useManifestDateHeaderTimeSource:!0,backgroundAttempts:2,timeBetweenSyncAttempts:30,maximumTimeBetweenSyncAttempts:600,minimumTimeBetweenSyncAttempts:2,timeBetweenSyncAttemptsAdjustmentFactor:2,maximumAllowedDrift:100,enableBackgroundSyncAfterSegmentDownloadError:!0,defaultTimingSource:{scheme:"urn:mpeg:dash:utc:http-xsdate:2014",value:"https://time.akamai.com/?iso&ms"}},scheduling:{defaultTimeout:500,lowLatencyTimeout:0,scheduleWhilePaused:!0},text:{defaultEnabled:!0,extendSegmentedCues:!0,webvtt:{customRenderingEnabled:!1}},liveCatchup:{maxDrift:NaN,playbackRate:{min:NaN,max:NaN},playbackBufferMin:.5,enabled:null,mode:s.Z.LIVE_CATCHUP_MODE_DEFAULT},lastBitrateCachingInfo:{enabled:!0,ttl:36e4},lastMediaSettingsCachingInfo:{enabled:!0,ttl:36e4},saveLastMediaSettingsForCurrentStreamingSession:!0,cacheLoadThresholds:{video:50,audio:5},trackSwitchMode:{audio:s.Z.TRACK_SWITCH_MODE_ALWAYS_REPLACE,video:s.Z.TRACK_SWITCH_MODE_NEVER_REPLACE},selectionModeForInitialTrack:s.Z.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY,fragmentRequestTimeout:2e4,fragmentRequestProgressTimeout:-1,manifestRequestTimeout:1e4,retryIntervals:(e={},d(e,o.w.MPD_TYPE,500),d(e,o.w.XLINK_EXPANSION_TYPE,500),d(e,o.w.MEDIA_SEGMENT_TYPE,1e3),d(e,o.w.INIT_SEGMENT_TYPE,1e3),d(e,o.w.BITSTREAM_SWITCHING_SEGMENT_TYPE,1e3),d(e,o.w.INDEX_SEGMENT_TYPE,1e3),d(e,o.w.MSS_FRAGMENT_INFO_SEGMENT_TYPE,1e3),d(e,o.w.LICENSE,1e3),d(e,o.w.OTHER_TYPE,1e3),d(e,"lowLatencyReductionFactor",10),e),retryAttempts:(t={},d(t,o.w.MPD_TYPE,3),d(t,o.w.XLINK_EXPANSION_TYPE,1),d(t,o.w.MEDIA_SEGMENT_TYPE,3),d(t,o.w.INIT_SEGMENT_TYPE,3),d(t,o.w.BITSTREAM_SWITCHING_SEGMENT_TYPE,3),d(t,o.w.INDEX_SEGMENT_TYPE,3),d(t,o.w.MSS_FRAGMENT_INFO_SEGMENT_TYPE,3),d(t,o.w.LICENSE,3),d(t,o.w.OTHER_TYPE,3),d(t,"lowLatencyMultiplyFactor",5),t),abr:{movingAverageMethod:s.Z.MOVING_AVERAGE_SLIDING_WINDOW,ABRStrategy:s.Z.ABR_STRATEGY_DYNAMIC,additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0,abandonRequestsRule:!0},abrRulesParameters:{abandonRequestsRule:{graceTimeThreshold:500,abandonMultiplier:1.8,minLengthToAverage:5}},bandwidthSafetyFactor:.9,useDefaultABRRules:!0,useDeadTimeLatency:!0,limitBitrateByPortal:!1,usePixelRatioInLimitBitrateByPortal:!1,maxBitrate:{audio:-1,video:-1},minBitrate:{audio:-1,video:-1},maxRepresentationRatio:{audio:1,video:1},initialBitrate:{audio:-1,video:-1},initialRepresentationRatio:{audio:-1,video:-1},autoSwitchBitrate:{audio:!0,video:!0},fetchThroughputCalculationMode:s.Z.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING},cmcd:{enabled:!1,sid:null,cid:null,rtp:null,rtpSafetyFactor:5,mode:s.Z.CMCD_MODE_QUERY,enabledKeys:["br","d","ot","tb","bl","dl","mtp","nor","nrr","su","bs","rtp","cid","pr","sf","sid","st","v"]},cmsd:{enabled:!1,abr:{applyMb:!1,etpWeightRatio:0}}},errors:{recoverAttempts:{mediaErrorDecode:5}}},p=i.Z.clone(h);function g(e,t,n){for(var a in e)e.hasOwnProperty(a)&&(t.hasOwnProperty(a)?"object"!==c(e[a])||e[a]instanceof Array||null===e[a]?(t[a]=i.Z.clone(e[a]),f[n+a]&&r.trigger(f[n+a])):g(e[a],t[a],n.slice()+a+"."):console.error("Settings parameter "+n+a+" is not supported"))}return{get:function(){return p},update:function(e){"object"===c(e)&&g(e,p,"")},reset:function(){p=i.Z.clone(h)}}}f.__dashjs_factory_name="Settings";var h=r.Z.getSingletonFactory(f);t.Z=h},703:function(e,t,n){"use strict";var r=n(3875),i=n.n(r),a=n(1067);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t;return t=[{key:"mixin",value:function(t,n,r){var i,a={};if(t)for(var o in n)n.hasOwnProperty(o)&&(i=n[o],o in t&&(t[o]===i||o in a&&a[o]===i)||("object"===s(t[o])&&null!==t[o]?t[o]=e.mixin(t[o],i,r):t[o]=r(i)));return t}},{key:"clone",value:function(t){if(!t||"object"!==s(t))return t;var n;if(t instanceof Array){n=[];for(var r=0,i=t.length;r<i;++r)r in t&&n.push(e.clone(t[r]))}else n={};return e.mixin(n,t,e.clone)}},{key:"addAditionalQueryParameterToUrl",value:function(e,t){try{if(!t||0===t.length)return e;var n=new URL(e);return t.forEach((function(e){e.key&&e.value&&n.searchParams.set(e.key,e.value)})),n.href}catch(t){return e}}},{key:"parseHttpHeaders",value:function(e){var t={};if(!e)return t;for(var n=e.trim().split("\r\n"),r=0,i=n.length;r<i;r++){var a=n[r],s=a.indexOf(": ");s>0&&(t[a.substring(0,s)]=a.substring(s+2))}return t}},{key:"generateUuid",value:function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)}))}},{key:"generateHashCode",value:function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}},{key:"getRelativeUrl",value:function(e,t){try{var n=new URL(e),r=new URL(t);if(n.protocol=r.protocol,n.origin!==r.origin)return t;var a=i().relative(n.pathname.substr(0,n.pathname.lastIndexOf("/")),r.pathname.substr(0,r.pathname.lastIndexOf("/"))),s=0===a.length?1:0;return a+=r.pathname.substr(r.pathname.lastIndexOf("/")+s,r.pathname.length-1),r.pathname.length<a.length?r.pathname:a}catch(e){return t}}},{key:"parseUserAgent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{var t=null===e&&"undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"";return(0,a.UAParser)(t)}catch(e){return{}}}},{key:"stringHasProtocol",value:function(e){return/(http(s?)):\/\//i.test(e)}}],t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e,t),e}();t.Z=o},2032:function(e,t,n){"use strict";function r(){return"4.7.3"}n.d(t,{e:function(){return r}})},2230:function(e,t){"use strict";var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t;return(t=[{key:"extend",value:function(e,t){if(e){var n=!!t&&t.override,r=!!t&&t.publicOnly;for(var i in e)!e.hasOwnProperty(i)||this[i]&&!n||r&&-1===e[i].indexOf("public_")||(this[i]=e[i])}}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();t.Z=n},4351:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}var o=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=s(t);if(n){var i=s(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return a(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this)).ATTEMPT_BACKGROUND_SYNC="attemptBackgroundSync",e.BUFFERING_COMPLETED="bufferingCompleted",e.BUFFER_CLEARED="bufferCleared",e.BYTES_APPENDED_END_FRAGMENT="bytesAppendedEndFragment",e.BUFFER_REPLACEMENT_STARTED="bufferReplacementStarted",e.CHECK_FOR_EXISTENCE_COMPLETED="checkForExistenceCompleted",e.CMSD_STATIC_HEADER="cmsdStaticHeader",e.CURRENT_TRACK_CHANGED="currentTrackChanged",e.DATA_UPDATE_COMPLETED="dataUpdateCompleted",e.INBAND_EVENTS="inbandEvents",e.INITIAL_STREAM_SWITCH="initialStreamSwitch",e.INIT_FRAGMENT_LOADED="initFragmentLoaded",e.INIT_FRAGMENT_NEEDED="initFragmentNeeded",e.INTERNAL_MANIFEST_LOADED="internalManifestLoaded",e.ORIGINAL_MANIFEST_LOADED="originalManifestLoaded",e.LOADING_COMPLETED="loadingCompleted",e.LOADING_PROGRESS="loadingProgress",e.LOADING_DATA_PROGRESS="loadingDataProgress",e.LOADING_ABANDONED="loadingAborted",e.MANIFEST_UPDATED="manifestUpdated",e.MEDIA_FRAGMENT_LOADED="mediaFragmentLoaded",e.MEDIA_FRAGMENT_NEEDED="mediaFragmentNeeded",e.QUOTA_EXCEEDED="quotaExceeded",e.SEGMENT_LOCATION_BLACKLIST_ADD="segmentLocationBlacklistAdd",e.SEGMENT_LOCATION_BLACKLIST_CHANGED="segmentLocationBlacklistChanged",e.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD="serviceLocationBlacklistAdd",e.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED="serviceLocationBlacklistChanged",e.SERVICE_LOCATION_LOCATION_BLACKLIST_ADD="serviceLocationLocationBlacklistAdd",e.SERVICE_LOCATION_LOCATION_BLACKLIST_CHANGED="serviceLocationLocationBlacklistChanged",e.SET_FRAGMENTED_TEXT_AFTER_DISABLED="setFragmentedTextAfterDisabled",e.SET_NON_FRAGMENTED_TEXT="setNonFragmentedText",e.SOURCE_BUFFER_ERROR="sourceBufferError",e.STREAMS_COMPOSED="streamsComposed",e.STREAM_BUFFERING_COMPLETED="streamBufferingCompleted",e.STREAM_REQUESTING_COMPLETED="streamRequestingCompleted",e.TEXT_TRACKS_QUEUE_INITIALIZED="textTracksQueueInitialized",e.TIME_SYNCHRONIZATION_COMPLETED="timeSynchronizationComplete",e.UPDATE_TIME_SYNC_OFFSET="updateTimeSyncOffset",e.URL_RESOLUTION_FAILED="urlResolutionFailed",e.VIDEO_CHUNK_RECEIVED="videoChunkReceived",e.WALLCLOCK_TIME_UPDATED="wallclockTimeUpdated",e.XLINK_ELEMENT_LOADED="xlinkElementLoaded",e.XLINK_READY="xlinkReady",e.SEEK_TARGET="seekTarget",e.SETTING_UPDATED_LIVE_DELAY="settingUpdatedLiveDelay",e.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT="settingUpdatedLiveDelayFragmentCount",e.SETTING_UPDATED_CATCHUP_ENABLED="settingUpdatedCatchupEnabled",e.SETTING_UPDATED_PLAYBACK_RATE_MIN="settingUpdatedPlaybackRateMin",e.SETTING_UPDATED_PLAYBACK_RATE_MAX="settingUpdatedPlaybackRateMax",e}return o}(n(8342).Z);t.Z=o},8512:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}var o=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=s(t);if(n){var i=s(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return a(this,e)});function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),r.apply(this,arguments)}return o}(n(4351).Z),u=new o;t.Z=u},8342:function(e,t){"use strict";var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t;return(t=[{key:"extend",value:function(e,t){if(e){var n=!!t&&t.override,r=!!t&&t.publicOnly;for(var i in e)!e.hasOwnProperty(i)||this[i]&&!n||r&&-1===e[i].indexOf("public_")||(this[i]=e[i])}}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();t.Z=n},9326:function(e,t,n){"use strict";var r=n(3186),i=n(7855),a=n(5448),s=n(8825),o=n(7387),u=n(1553);function l(e){var t,n,a,l,c,d=(e=e||{}).eventBus,f=e.debug,h=e.urlUtils,p=e.type,g=e.streamInfo,m=e.segmentsController,y=e.timelineConverter,v=e.baseURLController;function _(){return p}function T(){a=null}function b(e,t,n){var r,i,a=v.resolve(n.path),s={};return a&&t!==a.url&&h.isRelative(t)?(r=a.url,i=a.serviceLocation,s=a.queryParams,t&&(r=h.resolve(t,r))):r=t,!h.isRelative(r)&&(e.url=r,e.serviceLocation=i,e.queryParams=s,!0)}function E(e,t){if(null==t)return null;var n=new r.Z,a=t.representation,s=a.adaptation.period.mpd.manifest.Period_asArray[a.adaptation.period.index].AdaptationSet_asArray[a.adaptation.index].Representation_asArray[a.index].bandwidth,u=t.media;return u=(0,o.vi)(u,"Number",t.replacementNumber),u=(0,o.vi)(u,"Time",t.replacementTime),u=(0,o.vi)(u,"Bandwidth",s),u=(0,o.Aj)(u,a.id),u=(0,o.eR)(u),n.mediaType=_(),n.type=i.w.MEDIA_SEGMENT_TYPE,n.range=t.mediaRange,n.startTime=t.presentationStartTime,n.mediaStartTime=t.mediaStartTime,n.duration=t.duration,n.timescale=a.timescale,n.availabilityStartTime=t.availabilityStartTime,n.availabilityEndTime=t.availabilityEndTime,n.availabilityTimeComplete=a.availabilityTimeComplete,n.wallStartTime=t.wallStartTime,n.quality=a.index,n.index=t.index,n.mediaInfo=e,n.adaptationIndex=a.adaptation.index,n.representationId=a.id,b(n,u,a)?n:void 0}function S(e,t,r){var i=null;if(!t||!t.segmentInfoType)return i;var s=m.getSegmentByTime(t,r);return s&&(a=s,n.debug("Index for time "+r+" is "+s.index),i=E(e,s)),i}function w(e,t,r){var i=null,s=m.getSegmentByIndex(t,r,a?a.mediaStartTime:-1);if(s)i=E(e,s),a=s;else{if(l&&!c)return n.debug(_()+" No segment found at index: "+r+". Wait for next loop"),null;c=!0}return i}function A(){n.debug("Dynamic stream complete"),c=!0}return t={getCurrentIndex:function(){return a?a.index:-1},getInitRequest:function(e,t){return t?function(e,t,n){var a=new r.Z,s=t.adaptation.period,u=s.start;if(a.mediaType=n,a.type=i.w.INIT_SEGMENT_TYPE,a.range=t.range,a.availabilityStartTime=y.calcAvailabilityStartTimeFromPresentationTime(u,t,l),a.availabilityEndTime=y.calcAvailabilityEndTimeFromPresentationTime(u+s.duration,t,l),a.quality=t.index,a.mediaInfo=e,a.representationId=t.id,b(a,t.initialization,t))return a.url=(0,o.vi)(a.url,"Bandwidth",t.bandwidth),a}(e,t,_()):null},getNextSegmentRequest:function(e,t){return t&&t.segmentInfoType?w(e,t,a?a.index+1:0):null},getNextSegmentRequestIdempotent:function(e,t){var n=a?a.index+1:0,r=m.getSegmentByIndex(t,n,a?a.mediaStartTime:-1);return r?E(e,r):null},getSegmentRequestForTime:S,getStreamId:function(){return g.id},getStreamInfo:function(){return g},getType:_,getValidTimeAheadOfTargetTime:function(e,t,n,r){try{if(isNaN(e)||!t||!n)return NaN;if(e<0&&(e=0),isNaN(r)&&(r=.5),S(t,n,e))return e;if(n.adaptation.period.start+n.adaptation.period.duration<e)return NaN;for(var i=isFinite(n.adaptation.period.duration)?n.adaptation.period.start+n.adaptation.period.duration:e+30,a=Math.min(e+r,i),s=NaN,o=null;a<=i;){var u=null;if(a<=i&&(u=S(t,n,a)),u){s=a,o=u;break}a+=r}if(o){var l=o.startTime+o.duration;return e>o.startTime&&l-e>r?e:!isNaN(o.startTime)&&e<o.startTime&&s>o.startTime?o.startTime+.001:Math.min(l-r,s)}return s}catch(e){return NaN}},initialize:function(e){l=e,c=!1,m.initialize(e)},isLastSegmentRequested:function(e,t){if(!e||!a)return!1;if(c)return!0;if(!isFinite(e.adaptation.period.duration))return!1;if(a.presentationStartTime+a.duration>t)return!1;if(e.mediaFinishedInformation&&!isNaN(e.mediaFinishedInformation.numberOfSegments)&&!isNaN(a.index)&&a.index>=e.mediaFinishedInformation.numberOfSegments-1){if(!l||e.segmentInfoType===u.Z.SEGMENT_TEMPLATE)return!0;if(l&&e.segmentInfoType===u.Z.SEGMENT_LIST&&e.adaptation.period.nextPeriodId)return!0}return!!(l&&e.adaptation.period.nextPeriodId&&e.segmentInfoType===u.Z.SEGMENT_TIMELINE&&e.mediaFinishedInformation&&!isNaN(e.mediaFinishedInformation.mediaTimeOfLastSignaledSegment)&&a&&!isNaN(a.mediaStartTime)&&!isNaN(a.duration)&&a.mediaStartTime+a.duration>=e.mediaFinishedInformation.mediaTimeOfLastSignaledSegment-.05)},repeatSegmentRequest:function(e,t){return t&&t.segmentInfoType?w(e,t,a?a.index:0):null},reset:function(){T(),d.off(s.Z.DYNAMIC_TO_STATIC,A,t)}},n=f.getLogger(t),T(),d.on(s.Z.DYNAMIC_TO_STATIC,A,t),t}l.__dashjs_factory_name="DashHandler",t.Z=a.Z.getClassFactory(l)},1553:function(e,t){"use strict";var n=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t;return(t=[{key:"init",value:function(){this.BASE_URL="BaseURL",this.SEGMENT_BASE="SegmentBase",this.SEGMENT_TEMPLATE="SegmentTemplate",this.SEGMENT_LIST="SegmentList",this.SEGMENT_URL="SegmentURL",this.SEGMENT_TIMELINE="SegmentTimeline",this.SEGMENT_PROFILES="segmentProfiles",this.ADAPTATION_SET="AdaptationSet",this.REPRESENTATION="Representation",this.REPRESENTATION_INDEX="RepresentationIndex",this.SUB_REPRESENTATION="SubRepresentation",this.INITIALIZATION="Initialization",this.INITIALIZATION_MINUS="initialization",this.MPD="MPD",this.PERIOD="Period",this.ASSET_IDENTIFIER="AssetIdentifier",this.EVENT_STREAM="EventStream",this.ID="id",this.PROFILES="profiles",this.SERVICE_LOCATION="serviceLocation",this.RANGE="range",this.INDEX="index",this.MEDIA="media",this.BYTE_RANGE="byteRange",this.INDEX_RANGE="indexRange",this.MEDIA_RANGE="mediaRange",this.VALUE="value",this.CONTENT_TYPE="contentType",this.MIME_TYPE="mimeType",this.BITSTREAM_SWITCHING="BitstreamSwitching",this.BITSTREAM_SWITCHING_MINUS="bitstreamSwitching",this.CODECS="codecs",this.DEPENDENCY_ID="dependencyId",this.MEDIA_STREAM_STRUCTURE_ID="mediaStreamStructureId",this.METRICS="Metrics",this.METRICS_MINUS="metrics",this.REPORTING="Reporting",this.WIDTH="width",this.HEIGHT="height",this.SAR="sar",this.FRAMERATE="frameRate",this.AUDIO_SAMPLING_RATE="audioSamplingRate",this.MAXIMUM_SAP_PERIOD="maximumSAPPeriod",this.START_WITH_SAP="startWithSAP",this.MAX_PLAYOUT_RATE="maxPlayoutRate",this.CODING_DEPENDENCY="codingDependency",this.SCAN_TYPE="scanType",this.FRAME_PACKING="FramePacking",this.AUDIO_CHANNEL_CONFIGURATION="AudioChannelConfiguration",this.CONTENT_PROTECTION="ContentProtection",this.ESSENTIAL_PROPERTY="EssentialProperty",this.SUPPLEMENTAL_PROPERTY="SupplementalProperty",this.SUPPLEMENTAL_PROPERTY_ASARRAY="SupplementalProperty_asArray",this.INBAND_EVENT_STREAM="InbandEventStream",this.PRODUCER_REFERENCE_TIME="ProducerReferenceTime",this.INBAND="inband",this.TYPE="type",this.ACCESSIBILITY="Accessibility",this.ROLE="Role",this.RATING="Rating",this.CONTENT_COMPONENT="ContentComponent",this.SUBSET="Subset",this.LANG="lang",this.VIEWPOINT="Viewpoint",this.VIEWPOINT_ASARRAY="Viewpoint_asArray",this.ROLE_ASARRAY="Role_asArray",this.REPRESENTATION_ASARRAY="Representation_asArray",this.PRODUCERREFERENCETIME_ASARRAY="ProducerReferenceTime_asArray",this.ACCESSIBILITY_ASARRAY="Accessibility_asArray",this.AUDIOCHANNELCONFIGURATION_ASARRAY="AudioChannelConfiguration_asArray",this.CONTENTPROTECTION_ASARRAY="ContentProtection_asArray",this.MAIN="main",this.DYNAMIC="dynamic",this.STATIC="static",this.MEDIA_PRESENTATION_DURATION="mediaPresentationDuration",this.MINIMUM_UPDATE_PERIOD="minimumUpdatePeriod",this.CODEC_PRIVATE_DATA="codecPrivateData",this.BANDWITH="bandwidth",this.SOURCE_URL="sourceURL",this.TIMESCALE="timescale",this.DURATION="duration",this.START_NUMBER="startNumber",this.PRESENTATION_TIME_OFFSET="presentationTimeOffset",this.AVAILABILITY_START_TIME="availabilityStartTime",this.AVAILABILITY_END_TIME="availabilityEndTime",this.TIMESHIFT_BUFFER_DEPTH="timeShiftBufferDepth",this.MAX_SEGMENT_DURATION="maxSegmentDuration",this.PRESENTATION_TIME="presentationTime",this.MIN_BUFFER_TIME="minBufferTime",this.MAX_SUBSEGMENT_DURATION="maxSubsegmentDuration",this.START="start",this.AVAILABILITY_TIME_OFFSET="availabilityTimeOffset",this.AVAILABILITY_TIME_COMPLETE="availabilityTimeComplete",this.CENC_DEFAULT_KID="cenc:default_KID",this.DVB_PRIORITY="dvb:priority",this.DVB_WEIGHT="dvb:weight",this.SUGGESTED_PRESENTATION_DELAY="suggestedPresentationDelay",this.SERVICE_DESCRIPTION="ServiceDescription",this.SERVICE_DESCRIPTION_SCOPE="Scope",this.SERVICE_DESCRIPTION_LATENCY="Latency",this.SERVICE_DESCRIPTION_PLAYBACK_RATE="PlaybackRate",this.SERVICE_DESCRIPTION_OPERATING_QUALITY="OperatingQuality",this.SERVICE_DESCRIPTION_OPERATING_BANDWIDTH="OperatingBandwidth",this.PATCH_LOCATION="PatchLocation",this.PATCH_LOCATION_AS_ARRAY="PatchLocation_asArray",this.LOCATION="Location",this.LOCATION_AS_ARRAY="Location_asArray",this.PUBLISH_TIME="publishTime",this.ORIGINAL_PUBLISH_TIME="originalPublishTime",this.ORIGINAL_MPD_ID="mpdId",this.WALL_CLOCK_TIME="wallClockTime",this.PRESENTATION_TIME="presentationTime",this.LABEL="Label",this.GROUP_LABEL="GroupLabel",this.CONTENT_STEERING="ContentSteering",this.CONTENT_STEERING_AS_ARRAY="ContentSteering_asArray",this.DEFAULT_SERVICE_LOCATION="defaultServiceLocation",this.QUERY_BEFORE_START="queryBeforeStart",this.CLIENT_REQUIREMENT="clientRequirement",this.TTL="ttl",this.CONTENT_STEERING_RESPONSE={VERSION:"VERSION",TTL:"TTL",RELOAD_URI:"RELOAD-URI",PATHWAY_PRIORITY:"PATHWAY-PRIORITY",PATHWAY_CLONES:"PATHWAY-CLONES",BASE_ID:"BASE-ID",ID:"ID",URI_REPLACEMENT:"URI-REPLACEMENT",HOST:"HOST",PARAMS:"PARAMS"},this.PRODUCER_REFERENCE_TIME_TYPE={ENCODER:"encoder",CAPTURED:"captured",APPLICATION:"application"},this.SEGMENT_ALIGNMENT="segmentAlignment",this.SUB_SEGMENT_ALIGNMENT="subsegmentAlignment"}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}());t.Z=n},7802:function(e,t,n){"use strict";var r=n(5448),i=n(1724),a=n(3636),s=n(1736),o=n(5246);function u(e){e=e||{};var t,n,r=this.context,u=e.dashConstants,l=e.type,c=e.segmentBaseController;function d(e){return e?e.segments?n[u.SEGMENT_BASE]:n[e.segmentInfoType]:null}return t={initialize:function(t){n[u.SEGMENT_TIMELINE]=(0,i.Z)(r).create(e,t),n[u.SEGMENT_TEMPLATE]=(0,a.Z)(r).create(e,t),n[u.SEGMENT_LIST]=(0,s.Z)(r).create(e,t),n[u.SEGMENT_BASE]=(0,o.Z)(r).create(e,t)},updateInitData:function(e,t){return t?Promise.resolve():c.getSegmentBaseInitSegment({representation:e,mediaType:l})},updateSegmentData:function(e,t){return t?Promise.resolve():c.getSegmentList({mimeType:e.mimeType,representation:e,mediaType:l})},getSegmentByIndex:function(e,t,n){var r=d(e);return r?r.getSegmentByIndex(e,t,n):null},getSegmentByTime:function(e,t){var n=d(e);return n?n.getSegmentByTime(e,t):null},getMediaFinishedInformation:function(e){var t=d(e);return t?t.getMediaFinishedInformation(e):{numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN}}},n={},t}u.__dashjs_factory_name="SegmentsController";var l=r.Z.getClassFactory(u);t.Z=l},1736:function(e,t,n){"use strict";var r=n(5448),i=n(3393),a=n(7387);function s(e,t){var n=(e=e||{}).timelineConverter;function r(){if(!n||!n.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(i.Z.MISSING_CONFIG_ERROR)}function s(e,i){if(r(),!e)return null;var s=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,o=s.SegmentURL_asArray.length,u=e&&!isNaN(e.startNumber)?e.startNumber:1,l=Math.max(u-1,0),c=Math.max(i-l,0),d=null;if(c<o){var f=s.SegmentURL_asArray[c];(d=(0,a.NF)(n,t,e,i))&&(d.replacementTime=(u+i-1)*e.segmentDuration,d.media=f.media?f.media:"",d.mediaRange=f.mediaRange,d.indexRange=f.indexRange)}return d}return{getSegmentByIndex:s,getSegmentByTime:function(e,t){if(r(),!e)return null;var i=e.segmentDuration;if(isNaN(i))return null;var a=n.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return s(e,Math.floor(a/i))},getMediaFinishedInformation:function(e){var t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!e)return t;var n=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,r=e&&!isNaN(e.startNumber)?e.startNumber:1,i=Math.max(r-1,0);return t.numberOfSegments=i+n.SegmentURL_asArray.length,t}}}s.__dashjs_factory_name="ListSegmentsGetter";var o=r.Z.getClassFactory(s);t.Z=o},5246:function(e,t,n){"use strict";var r=n(5448),i=n(3393);function a(e){var t=(e=e||{}).timelineConverter;function n(){if(!t||!t.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(i.Z.MISSING_CONFIG_ERROR)}function r(e,t){if(n(),!e)return null;var r,i=e.segments?e.segments.length:-1;if(t<i&&(r=e.segments[t])&&r.index===t)return r;for(var a=0;a<i;a++)if((r=e.segments[a])&&r.index===t)return r;return null}return{getSegmentByIndex:r,getSegmentByTime:function(e,t){n();var i=function(e,t){if(!e)return-1;var n,r,i,a,s,o=e.segments,u=o?o.length:null,l=-1;if(o&&u>0)for(s=0;s<u;s++)if(i=(r=o[s]).presentationStartTime,t+(n=(a=r.duration)/2)>=i&&t-n<i+a){l=r.index;break}return l}(e,t);return r(e,i)},getMediaFinishedInformation:function(e){var t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};return e&&e.segments?(t.numberOfSegments=e.segments.length,t):t}}}a.__dashjs_factory_name="SegmentBaseGetter";var s=r.Z.getClassFactory(a);t.Z=s},7387:function(e,t,n){"use strict";n.d(t,{Aj:function(){return s},NF:function(){return c},TJ:function(){return d},eR:function(){return a},vi:function(){return o}});var r=n(2011);function i(e,t){for(;e.length<t;)e="0"+e;return e}function a(e){return e?e.split("$$").join("$"):e}function s(e,t){if(!t||!e||-1===e.indexOf("$RepresentationID$"))return e;var n=t.toString();return e.split("$RepresentationID$").join(n)}function o(e,t,n){var r,a,s,o,u,l,c=t.length;if(!e)return e;for(;;){if((r=e.indexOf("$"+t))<0)return e;if((a=e.indexOf("$",r+c))<0)return e;if((s=e.indexOf("%0",r+c))>r&&s<a)switch(o=e.charAt(a-1),u=parseInt(e.substring(s+2,a-1),10),o){case"d":case"i":case"u":l=i(n.toString(),u);break;case"x":l=i(n.toString(16),u);break;case"X":l=i(n.toString(16),u).toUpperCase();break;case"o":l=i(n.toString(8),u);break;default:return e}else l=n;e=e.substring(0,r)+l+e.substring(a+1)}}function u(e,t,n,i,a,s,o,u){var l,c=new r.Z;return c.representation=e,c.duration=t,c.presentationStartTime=n,c.mediaStartTime=i,c.availabilityStartTime=a.calcAvailabilityStartTimeFromPresentationTime(s,e,o),c.availabilityEndTime=a.calcAvailabilityEndTimeFromPresentationTime(s+t,e,o),c.wallStartTime=a.calcWallTimeForSegment(c,o),c.replacementNumber=(l=u,c.representation.startNumber+l),c.index=u,c}function l(e,t,n,r){var i=t.adaptation.period;if(isFinite(i.duration)&&i.start+i.duration<=n.presentationStartTime)return!1;if(r){if("INF"===t.availabilityTimeOffset)return!0;var a=e.getClientReferenceTime();return n.availabilityStartTime.getTime()<=a&&(!isFinite(n.availabilityEndTime)||n.availabilityEndTime.getTime()>=a)}return!0}function c(e,t,n,r){var i,a,s;i=n.segmentDuration,isNaN(i)&&(i=n.adaptation.period.duration),a=parseFloat((n.adaptation.period.start+r*i).toFixed(5)),s=parseFloat((a+i).toFixed(5));var o=u(n,i,a,e.calcMediaTimeFromPresentationTime(a,n),e,s,t,r);return l(e,n,o,t)?o:null}function d(e,t,n,r,i,a,s,c,d,f){var h,p,g=r/a,m=i/a;return h=e.calcPresentationTimeFromMediaTime(g,n),l(e,n,p=u(n,m,h,g,e,h+m,t,d),t)?(p.replacementTime=f||r,s=o(s,"Number",p.replacementNumber),s=o(s,"Time",p.replacementTime),p.media=s,p.mediaRange=c,p):null}},3636:function(e,t,n){"use strict";var r=n(5448),i=n(3393),a=n(7387);function s(e,t){var n=(e=e||{}).timelineConverter;function r(){if(!n||!n.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(i.Z.MISSING_CONFIG_ERROR)}function s(e,i){if(r(),!e)return null;var s=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate;i=Math.max(i,0);var o=(0,a.NF)(n,t,e,i);if(o){o.replacementTime=Math.round((i-1)*e.segmentDuration*e.timescale,10);var u=s.media;u=(0,a.vi)(u,"Number",o.replacementNumber),u=(0,a.vi)(u,"Time",o.replacementTime),o.media=u}return o}return{getSegmentByIndex:s,getSegmentByTime:function(e,t){if(r(),!e)return null;var i=e.segmentDuration;if(isNaN(i))return null;var a=n.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return s(e,Math.floor(a/i))},getMediaFinishedInformation:function(e){var t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!e)return t;var n=e.segmentDuration;return isNaN(n)?t.numberOfSegments=1:t.numberOfSegments=Math.ceil(e.adaptation.period.duration/n),t}}}s.__dashjs_factory_name="TemplateSegmentsGetter";var o=r.Z.getClassFactory(s);t.Z=o},1724:function(e,t,n){"use strict";var r=n(5448),i=n(3393),a=n(7387);function s(e,t){var n=(e=e||{}).timelineConverter,r=e.dashMetrics;function s(){if(!n)throw new Error(i.Z.MISSING_CONFIG_ERROR)}function o(e,t){var n,r,i,a,s,o,l,c=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate||e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,d=c.SegmentTimeline,f=c.SegmentURL_asArray,h=0,p=-1;l=e.timescale;var g=!1;for(i=0,a=(n=d.S_asArray).length;i<a&&!g;i++)for(o=0,(r=n[i]).hasOwnProperty("r")&&(o=r.r),r.hasOwnProperty("t")&&(h=r.t),o<0&&(o=u(e,n[i+1],r,l,h/l)),s=0;s<=o&&!g;s++)(g=t(h,c,f,r,l,++p,i))&&(e.segmentDuration=r.d/l),h+=r.d}function u(e,t,i,a,s){var o;if(t&&t.hasOwnProperty("t"))o=t.t/a;else try{var u=0;if(isNaN(e.adaptation.period.start)||isNaN(e.adaptation.period.duration)||!isFinite(e.adaptation.period.duration)){var l=r.getCurrentDVRInfo();u=isNaN(l.end)?0:l.end}else u=e.adaptation.period.start+e.adaptation.period.duration;o=n.calcMediaTimeFromPresentationTime(u,e),e.segmentDuration=i.d/a}catch(e){o=0}return Math.max(Math.ceil((o-s)/(i.d/a))-1,0)}return{getSegmentByIndex:function(e,r,i){if(s(),!e)return null;var u=null,l=!1;return o(e,(function(r,s,o,c,d,f,h){if(l||i<0){var p=s.media,g=c.mediaRange;return o&&(p=o[h].media||"",g=o[h].mediaRange),u=(0,a.TJ)(n,t,e,r,c.d,d,p,g,f,c.tManifest),!0}return r>=i*d-.5*c.d&&(l=!0),!1})),u},getSegmentByTime:function(e,r){if(s(),!e)return null;void 0===r&&(r=null);var i=null,u=n.calcMediaTimeFromPresentationTime(r,e);return o(e,(function(r,s,o,l,c,d,f){var h=parseFloat((u*c).toPrecision(15));if(h<r+l.d&&h>=r){var p=s.media,g=l.mediaRange;return o&&(p=o[f].media||"",g=o[f].mediaRange),i=(0,a.TJ)(n,t,e,r,l.d,c,p,g,d,l.tManifest),!0}return!1})),i},getMediaFinishedInformation:function(e){if(!e)return 0;var t,n,r,i,a,s,o,l=(e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate||e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList).SegmentTimeline,c=0,d=0,f=0;for(o=e.timescale,i=(t=l.S_asArray).length,r=0;r<i;r++)for(s=0,(n=t[r]).hasOwnProperty("r")&&(s=n.r),n.hasOwnProperty("t")&&(d=(c=n.t)/o),s<0&&(s=u(e,t[r+1],n,o,d)),a=0;a<=s;a++)f++,d=(c+=n.d)/o;return{numberOfSegments:f,mediaTimeOfLastSignaledSegment:d}}}}s.__dashjs_factory_name="TimelineSegmentsGetter";var o=r.Z.getClassFactory(s);t.Z=o},2011:function(e,t){"use strict";t.Z=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.indexRange=null,this.index=null,this.mediaRange=null,this.media=null,this.duration=NaN,this.replacementTime=null,this.replacementNumber=NaN,this.mediaStartTime=NaN,this.presentationStartTime=NaN,this.availabilityStartTime=NaN,this.availabilityEndTime=NaN,this.wallStartTime=NaN,this.representation=null}},2610:function(e,t){"use strict";t.Z=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schemeIdUri="",this.value=""}},7688:function(e,t,n){"use strict";n.d(t,{Z:function(){return Sa}});var r=n(452),i=n.n(r),a=n(3393),s=n(1553),o=n(3860),u=n(5595),l=n(8512),c=n(5448),d=n(6398),f=n(8825);function h(){var e,t,n,r,i,s,c,h,p,g,m,y,v,_,T,b,E,S,w,A,I,C,R,D,x=this.context,N=(0,u.Z)(x).getInstance();function O(){L(),_=!1,g=0,m=0,b=0,C=!1,E=!0,S=!1,R=!1,w=NaN,c&&(N.off(l.Z.DATA_UPDATE_COMPLETED,$,e),N.off(l.Z.LOADING_PROGRESS,ye,e),N.off(l.Z.MANIFEST_UPDATED,be,e),N.off(l.Z.STREAMS_COMPOSED,Ee,e),N.off(f.Z.PLAYBACK_ENDED,pe,e),N.off(f.Z.STREAM_INITIALIZING,_e,e),N.off(f.Z.REPRESENTATION_SWITCH,Te,e),N.off(f.Z.BUFFER_LEVEL_STATE_CHANGED,ee,e),X(),c.removeEventListener("canplay",Q),c.removeEventListener("canplaythrough",J),c.removeEventListener("play",te),c.removeEventListener("waiting",ne),c.removeEventListener("playing",re),c.removeEventListener("pause",ie),c.removeEventListener("error",ge),c.removeEventListener("seeking",ae),c.removeEventListener("seeked",se),c.removeEventListener("timeupdate",oe),c.removeEventListener("progress",ue),c.removeEventListener("ratechange",le),c.removeEventListener("loadedmetadata",ce),c.removeEventListener("loadeddata",de),c.removeEventListener("stalled",ve),c.removeEventListener("ended",fe),c.removeEventListener("volumechange",he)),p=null,c=null,y=null,v=null}function P(){return parseFloat((M(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)-j()).toFixed(5))}function M(e){var t=e||y;return t.start+t.duration}function k(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];y&&c&&c.getElement()?(e&&v&&B(j()),c.play()):_=!0}function L(){y&&c&&c.pause()}function F(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];y&&c&&c.getElement()&&e!==(isNaN(w)?c.getTime():w)&&((A=!0===r)||(w=e),t.info("Requesting seek to time: "+e+(A?" (internal)":"")),v&&i&&B(e),c.setCurrentTime(e,n))}function U(){if(y&&c&&v){var e=n&&n.hasVideoTrack()?a.Z.VIDEO:a.Z.AUDIO,t=i.getCurrentDVRInfo(e);return t&&t.range?t.range.end:0}}function B(e){var t=new Date(h.getClientReferenceTime()),n=s.getRegularPeriods()[0],r=h.calcPresentationTimeFromWallTime(t,n);g=r-e}function j(){return y&&c?c.getTime():null}function q(){return y&&c?c.isPaused():null}function H(){return y&&c?c.isSeeking():null}function G(){return y&&c?c.isStalled():null}function V(){return y&&c?c.getPlaybackRate():null}function Y(){return y&&c?c.getEnded():null}function z(){return v}function Z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!q()&&v&&0!==c.getReadyState()&&!H()&&!C){e||(e=n.hasVideoTrack()?a.Z.VIDEO:a.Z.AUDIO);var r=j(),i=K(r,e);!isNaN(i)&&i!==r&&!H()&&(G()||I||1===c.getReadyState())&&(t.debug("UpdateCurrentTime: Seek to actual time: ".concat(i," from currentTime: ").concat(r)),F(i,!1,!1))}}function K(e,t){var n=i.getCurrentDVRInfo(t),r=n?n.range:null;return r?e>r.end?Math.max(r.end-g,r.start):e>0&&e+.25<r.start&&Math.abs(e-r.start)<31536e4?S?Math.max(r.end-g,r.start):r.start:e:NaN}function W(){null===p&&(p=setInterval((function(){var e;N.trigger(l.Z.WALLCLOCK_TIME_UPDATED,{isDynamic:v,time:new Date}),z()&&(n.addDVRMetric(),q()?(e=Date.now(),(!T||e>T+500)&&(T=e,oe())):Z())}),D.get().streaming.wallclockTimeUpdateInterval))}function X(){clearInterval(p),p=null}function $(e){var t=s.convertRepresentationToRepresentationInfo(e.currentRepresentation),n=t?t.mediaInfo.streamInfo:null;null!==n&&y.id===n.id&&(y=n)}function Q(){N.trigger(l.Z.CAN_PLAY)}function J(){N.trigger(l.Z.CAN_PLAY_THROUGH)}function ee(e){e.streamId===n.getActiveStreamInfo().id&&(I=e.state===o.Z.BUFFER_EMPTY,D.get().streaming.buffer.setStallState&&c.setStallState(e.mediaType,e.state===o.Z.BUFFER_EMPTY))}function te(){t.info("Native video element event: play"),Z(),W(),N.trigger(l.Z.PLAYBACK_STARTED,{startTime:j()})}function ne(){t.info("Native video element event: waiting"),N.trigger(l.Z.PLAYBACK_WAITING,{playingTime:j()})}function re(){t.info("Native video element event: playing"),A=!1,N.trigger(l.Z.PLAYBACK_PLAYING,{playingTime:j()})}function ie(){t.info("Native video element event: pause"),N.trigger(l.Z.PLAYBACK_PAUSED,{ended:Y()})}function ae(){if(!A){var e=j();isNaN(w)||w===e||(e=w),w=NaN,t.info("Seeking to: "+e),W(),N.trigger(l.Z.PLAYBACK_SEEKING,{seekTime:e,streamId:y.id})}}function se(){t.info("Native video element event: seeked"),A=!1,N.trigger(l.Z.PLAYBACK_SEEKED)}function oe(){y&&N.trigger(l.Z.PLAYBACK_TIME_UPDATED,{timeToEnd:P(),time:j(),streamId:y.id})}function ue(){N.trigger(l.Z.PLAYBACK_PROGRESS,{streamId:y.id})}function le(){var e=V();t.info("Native video element event: ratechange: ",e),N.trigger(l.Z.PLAYBACK_RATE_CHANGED,{playbackRate:e})}function ce(){t.info("Native video element event: loadedmetadata"),N.trigger(l.Z.PLAYBACK_METADATA_LOADED),W()}function de(){t.info("Native video element event: loadeddata"),N.trigger(l.Z.PLAYBACK_LOADED_DATA)}function fe(){t.info("Native video element event: ended"),L(),X();var e=n?n.getActiveStreamInfo():null;e&&N.trigger(l.Z.PLAYBACK_ENDED,{isLast:e.isLast})}function he(){N.trigger(l.Z.PLAYBACK_VOLUME_CHANGED)}function pe(e){if(p&&e.isLast){t.info("onPlaybackEnded -- PLAYBACK_ENDED but native video element didn't fire ended");var n=e.seekTime?e.seekTime:M();c.setCurrentTime(n),L(),X()}}function ge(e){var t=e.target||e.srcElement;N.trigger(l.Z.PLAYBACK_ERROR,{error:t.error})}function me(){v=!1}function ye(e){if(!1===e.stream&&S&&!isNaN(e.request.duration)){var n=1.2*e.request.duration;n>g&&(t.warn("Browser does not support fetch API with StreamReader. Increasing live delay to be 20% higher than segment duration:",n.toFixed(2)),g=n,m=n)}}function ve(e){N.trigger(l.Z.PLAYBACK_STALLED,{e})}function _e(e){var n;(n=e.mediaInfo)&&n.supplementalProperties&&"true"===n.supplementalProperties[a.Z.SUPPLEMENTAL_PROPERTY_DVB_LL_SCHEME]&&(t.debug("Low Latency critical SupplementalProperty set: Enabling low Latency"),S=!0)}function Te(e){var t=n.getActiveStreamInfo();e&&t&&e.currentRepresentation&&e.streamId&&e.streamId===t.id&&e.mediaType&&(e.mediaType===a.Z.VIDEO||e.mediaType===a.Z.AUDIO)&&(E=e.currentRepresentation.availabilityTimeComplete,(S=!E)&&!R&&(R=!0))}function be(){C=!0}function Ee(){C=!1}return e={initialize:function(t,n){y=t,!0!==n&&(c.addEventListener("canplay",Q),c.addEventListener("canplaythrough",J),c.addEventListener("play",te),c.addEventListener("waiting",ne),c.addEventListener("playing",re),c.addEventListener("pause",ie),c.addEventListener("error",ge),c.addEventListener("seeking",ae),c.addEventListener("seeked",se),c.addEventListener("timeupdate",oe),c.addEventListener("progress",ue),c.addEventListener("ratechange",le),c.addEventListener("loadedmetadata",ce),c.addEventListener("loadeddata",de),c.addEventListener("stalled",ve),c.addEventListener("ended",fe),c.addEventListener("volumechange",he),v=y.manifestInfo.isDynamic,I=!1,A=!1,N.on(l.Z.DATA_UPDATE_COMPLETED,$,e),N.on(l.Z.LOADING_PROGRESS,ye,e),N.on(l.Z.MANIFEST_UPDATED,be,e),N.on(l.Z.STREAMS_COMPOSED,Ee,e),N.on(f.Z.PLAYBACK_ENDED,pe,e,{priority:u.Z.EVENT_PRIORITY_HIGH}),N.on(f.Z.STREAM_INITIALIZING,_e,e),N.on(f.Z.REPRESENTATION_SWITCH,Te,e),N.on(f.Z.BUFFER_LEVEL_STATE_CHANGED,ee,e),N.on(f.Z.DYNAMIC_TO_STATIC,me,e),_&&(_=!1,k()))},setConfig:function(e){e&&(e.streamController&&(n=e.streamController),e.serviceDescriptionController&&(r=e.serviceDescriptionController),e.dashMetrics&&(i=e.dashMetrics),e.adapter&&(s=e.adapter),e.videoModel&&(c=e.videoModel),e.timelineConverter&&(h=e.timelineConverter),e.settings&&(D=e.settings))},getTimeToStreamEnd:P,getBufferLevel:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=null;return n.getActiveStreamProcessors().forEach((function(n){if(!e||0===e.length||-1===e.indexOf(n.getType())){var r=n.getBufferLevel();t=null===t?r:Math.min(t,r)}})),t},getPlaybackStalled:function(){return I},getTime:j,getLowLatencyModeEnabled:function(){return S},getInitialCatchupModeActivated:function(){return R},getIsManifestUpdateInProgress:function(){return C},getPlaybackRate:V,getPlayedRanges:function(){return y&&c?c.getPlayedRanges():null},getEnded:Y,getIsDynamic:z,getStreamController:function(){return n},computeAndSetLiveDelay:function(e,t){var n,i,a,o=!isNaN(e)&&isFinite(e)?e:NaN,u=s.getSuggestedPresentationDelay(),l=r.getServiceDescriptionSettings();return n=isNaN(D.get().streaming.delay.liveDelay)?null===D.get().streaming.delay.liveDelayFragmentCount||isNaN(D.get().streaming.delay.liveDelayFragmentCount)||isNaN(o)?l&&!isNaN(l.liveDelay)&&l.liveDelay>0?l.liveDelay:!0===D.get().streaming.delay.useSuggestedPresentationDelay&&null!==u&&!isNaN(u)&&u>0?u:isNaN(o)?t&&!isNaN(t.minBufferTime)?4*t.minBufferTime:4*y.manifestInfo.minBufferTime:4*o:o*D.get().streaming.delay.liveDelayFragmentCount:D.get().streaming.delay.liveDelay,null!==(a=s.getAvailabilityStartTime())&&(b=a),i=t&&t.dvrWindowSize>0?Math.min(n,t.dvrWindowSize):n,g=i,m=i,i},getLiveDelay:function(){return g},getOriginalLiveDelay:function(){return m},getCurrentLiveLatency:function(){if(!v||isNaN(b))return NaN;var e=j();if(isNaN(e)||0===e)return 0;var t=(new Date).getTime()+1e3*h.getClientTimeOffset();return Math.max(((t-b-1e3*e)/1e3).toFixed(3),0)},play:k,isPaused:q,isStalled:G,pause:L,isSeeking:H,getStreamEndTime:M,seek:F,seekToOriginalLive:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=U();0!==r&&F(r-(g=m),e,t,n)},seekToCurrentLive:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=U();0!==r&&F(r-g,e,t,n)},reset:O,updateCurrentTime:Z,getAvailabilityStartTime:function(){return b}},t=(0,d.Z)(x).getInstance().getLogger(e),O(),e}h.__dashjs_factory_name="PlaybackController";var p=c.Z.getSingletonFactory(h),g=n(3186),m="loading",y="executed",v="failed";function _(e){var t,n,r,i,a=(e=e||{}).eventBus,s=e.events,o=e.dashMetrics,u=e.fragmentLoader,l=e.debug,c=e.streamInfo,d=e.type;function f(e){var t;return!!e&&(t=!1,r.some((function(n){if(r=e,i=n,!isNaN(r.index)&&r.startTime===i.startTime&&r.adaptationIndex===i.adaptationIndex&&r.type===i.type||function(e,t){return isNaN(e.index)&&isNaN(t.index)&&e.quality===t.quality}(e,n)||function(e,t){return e.action===g.Z.ACTION_COMPLETE&&e.action===t.action}(e,n))return t=!0;var r,i})),t)}function h(e){return isNaN(e.duration)?.25:Math.min(e.duration/8,.5)}function p(e){r=r.filter((function(t){var n=h(t);return isNaN(t.startTime)||void 0!==e&&t.startTime>=e-n}))}function _(e,t){t<=e+.5||(r=r.filter((function(n){var r=h(n);return isNaN(n.startTime)||n.startTime>=t-r||isNaN(n.duration)||n.startTime+n.duration<=e+r})))}function T(e,t,n){for(var r=e.length-1;r>=0;r--){var i=e[r],a=i.startTime,s=a+i.duration;if(n=isNaN(n)?h(i):n,!isNaN(a)&&!isNaN(s)&&t+n>=a&&t-n<s||isNaN(a)&&isNaN(t))return i}return null}function b(e,t){o.addSchedulingInfo(e,t),o.addRequestsQueue(e.mediaType,i,r)}function E(e){e.sender===u&&(i.splice(i.indexOf(e.request),1),e.response&&!e.error&&r.push(e.request),b(e.request,e.error?v:y),a.trigger(s.FRAGMENT_LOADING_COMPLETED,{request:e.request,response:e.response,error:e.error,sender:this},{streamId:c.id,mediaType:d}))}function S(e){e.sender===u&&a.trigger(s.FRAGMENT_LOADING_PROGRESS,{request:e.request,response:e.response,error:e.error,sender:this},{streamId:c.id,mediaType:d})}function w(e){e.sender===u&&a.trigger(s.FRAGMENT_LOADING_ABANDONED,{request:e.request},{streamId:c.id,mediaType:d})}function A(){r=[],i=[]}return t={getStreamId:function(){return c.id},getType:function(){return d},getRequests:function(e){var t=e?e.state instanceof Array?e.state:[e.state]:[],n=[];return t.forEach((function(t){var a=function(e){var t;switch(e){case m:t=i;break;case y:t=r;break;default:t=[]}return t}(t);n=n.concat(function(e,t){return t.hasOwnProperty("time")?[T(e,t.time,t.threshold)]:e.filter((function(e){for(var n in t)if("state"!==n&&t.hasOwnProperty(n)&&e[n]!=t[n])return!1;return!0}))}(a,e))})),n},isFragmentLoaded:f,isFragmentLoadedOrPending:function(e){var t,n=!1,r=0;if(!(n=f(e)))for(r=0;r<i.length;r++)t=i[r],e.url===t.url&&e.startTime===t.startTime&&(n=!0);return n},removeExecutedRequestsBeforeTime:p,removeExecutedRequestsAfterTime:function(e){r=r.filter((function(t){return isNaN(t.startTime)||void 0!==e&&t.startTime<e}))},syncExecutedRequestsWithBufferedRange:function(e,t){if(e&&0!==e.length){for(var n=0,r=0,i=e.length;r<i;r++)_(n,e.start(r)),n=e.end(r);t>0&&_(n,t)}else p()},abortRequests:function(){n.debug("abort requests"),u.abort(),i=[]},executeRequest:function(e){e.action===g.Z.ACTION_DOWNLOAD?(b(e,m),i.push(e),function(e){a.trigger(s.FRAGMENT_LOADING_STARTED,{request:e},{streamId:c.id,mediaType:d}),u.load(e)}(e)):n.warn("Unknown request action.")},reset:function(){a.off(s.LOADING_COMPLETED,E,this),a.off(s.LOADING_DATA_PROGRESS,S,this),a.off(s.LOADING_ABANDONED,w,this),u&&u.reset(),A()},resetInitialSettings:A,addExecutedRequest:function(e){r.push(e)}},n=l.getLogger(t),A(),a.on(s.LOADING_COMPLETED,E,t),a.on(s.LOADING_DATA_PROGRESS,S,t),a.on(s.LOADING_ABANDONED,w,t),t}_.__dashjs_factory_name="FragmentModel";var T=c.Z.getClassFactory(_);T.FRAGMENT_MODEL_LOADING=m,T.FRAGMENT_MODEL_EXECUTED=y,T.FRAGMENT_MODEL_CANCELED="canceled",T.FRAGMENT_MODEL_FAILED=v,c.Z.updateClassFactory(_.__dashjs_factory_name,T);var b=T,E=n(5459);function S(e){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S(e)}function w(e,t){return w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},w(e,t)}function A(e){return A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},A(e)}var I=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&w(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=A(t);if(n){var i=A(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==S(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(e=r.call(this)).MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE=10,e.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE=11,e.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE=12,e.SEGMENT_BASE_LOADER_ERROR_CODE=15,e.TIME_SYNC_FAILED_ERROR_CODE=16,e.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE=17,e.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE=18,e.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE=19,e.APPEND_ERROR_CODE=20,e.REMOVE_ERROR_CODE=21,e.DATA_UPDATE_FAILED_ERROR_CODE=22,e.CAPABILITY_MEDIASOURCE_ERROR_CODE=23,e.CAPABILITY_MEDIAKEYS_ERROR_CODE=24,e.DOWNLOAD_ERROR_ID_MANIFEST_CODE=25,e.DOWNLOAD_ERROR_ID_SIDX_CODE=26,e.DOWNLOAD_ERROR_ID_CONTENT_CODE=27,e.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE=28,e.DOWNLOAD_ERROR_ID_XLINK_CODE=29,e.MANIFEST_ERROR_ID_PARSE_CODE=31,e.MANIFEST_ERROR_ID_NOSTREAMS_CODE=32,e.TIMED_TEXT_ERROR_ID_PARSE_CODE=33,e.MANIFEST_ERROR_ID_MULTIPLEXED_CODE=34,e.MEDIASOURCE_TYPE_UNSUPPORTED_CODE=35,e.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE="parsing failed for ",e.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading manifest: ",e.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading Xlink element: ",e.SEGMENTS_UPDATE_FAILED_ERROR_MESSAGE="Segments update failed",e.SEGMENTS_UNAVAILABLE_ERROR_MESSAGE="no segments are available yet",e.SEGMENT_BASE_LOADER_ERROR_MESSAGE="error loading segment ranges from sidx",e.TIME_SYNC_FAILED_ERROR_MESSAGE="Failed to synchronize client and server time",e.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE="request is null",e.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE="Failed to resolve a valid URL",e.APPEND_ERROR_MESSAGE="chunk is not defined",e.REMOVE_ERROR_MESSAGE="Removing data from the SourceBuffer",e.DATA_UPDATE_FAILED_ERROR_MESSAGE="Data update failed",e.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE="mediasource is not supported",e.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE="mediakeys is not supported",e.TIMED_TEXT_ERROR_MESSAGE_PARSE="parsing error :",e.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE="Error creating source buffer of type : ",e}return i}(n(2230).Z)),C=n(1264),R=n(7855);function D(e){var t,n,r,i,s,o,u=this.context,c=(0,C.Z)(u).getInstance(),f=e.textController,h=e.eventBus,p=[],g=[],m=!1,y=e.mediaSource,v=null;function _(e){return new Promise((function(t){O((function(){i.changeType&&i.changeType(e),t()}))}))}function T(e){return i=f.getTextSourceBuffer(e),Promise.resolve()}function b(){if("function"==typeof i.addEventListener)try{i.addEventListener("updateend",x,!1),i.addEventListener("error",N,!1),i.addEventListener("abort",N,!1)}catch(e){o=setInterval(x,50)}else o=setInterval(x,50)}function S(e){return new Promise((function(t){i&&c.get().streaming.buffer.useAppendWindow?O((function(){try{if(!i)return void t();var n=y.duration,a=0;e&&!isNaN(e.start)&&!isNaN(e.duration)&&isFinite(e.duration)&&(n=e.start+e.duration),e&&!isNaN(e.start)&&(a=e.start),i.appendWindowEnd===n&&i.appendWindowStart===a||(i.appendWindowStart=0,i.appendWindowEnd=n+.01,i.appendWindowStart=Math.max(a-.1,0),r.debug("Updated append window for ".concat(s.type,". Set start to ").concat(i.appendWindowStart," and end to ").concat(i.appendWindowEnd))),t()}catch(e){r.warn("Failed to set append window"),t()}})):t()}))}function w(e){return new Promise((function(t){i?O((function(){try{i.timestampOffset===e||isNaN(e)||(i.timestampOffset=e,r.debug("Set MSE timestamp offset to ".concat(e))),t()}catch(e){t()}})):t()}))}function A(){if(!m&&g.length>0){m=!0;var e=g[0];g.splice(0,1);var t=function(){m=!1,g.length>0&&A.call(this),e&&e.data&&e.data.segmentType&&e.data.segmentType!==R.w.INIT_SEGMENT_TYPE&&delete e.data.bytes,e.promise.resolve({chunk:e.data})};try{v=e.request,0===e.data.bytes.byteLength?t.call(this):(i.appendBuffer?i.appendBuffer(e.data.bytes):i.append(e.data.bytes,e.data),O(t.bind(this)))}catch(t){r.fatal('SourceBuffer append failed "'+t+'"'),g.length>0?A():m=!1,delete e.data.bytes,e.promise.reject({chunk:e.data,error:new E.Z(t.code,t.message)})}}}function D(){p.length>0&&(i.updating||(p.shift()(),D()))}function x(){i.updating||D()}function N(e){var t,r,i=e.target||{};t=l.Z.SOURCE_BUFFER_ERROR,r={error:i,lastRequestAppended:v}||{},h.trigger(t,r,{streamId:s.streamInfo.id,mediaType:n})}function O(e){p.push(e),i.updating||D()}return t={getType:function(){return n},getAllBufferRanges:function(){try{return i.buffered}catch(e){return r.error("getAllBufferRanges exception: "+e.message),null}},getBuffer:function(){return i},append:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new Promise((function(r,i){e?(g.push({data:e,promise:{resolve:r,reject:i},request:n}),O(A.bind(t))):i({chunk:e,error:new E.Z(I.APPEND_ERROR_CODE,I.APPEND_ERROR_MESSAGE)})}))},remove:function(e){return new Promise((function(t,n){var r=e.start,a=e.end;r>=0&&a>r?O((function(){try{i.remove(r,a),O((function(){t({from:r,to:a,unintended:!1}),e.resolve&&e.resolve()}))}catch(t){n({from:r,to:a,unintended:!1,error:new E.Z(I.REMOVE_ERROR_CODE,I.REMOVE_ERROR_MESSAGE)}),e.reject&&e.reject(t)}})):t()}))},abort:function(){return new Promise((function(e){try{g=[],"open"===y.readyState?O((function(){try{i&&i.abort(),e()}catch(t){e()}})):i&&i.setTextTrack&&"ended"===y.readyState?(i.abort(),e()):e()}catch(t){e()}}))},reset:function(){if(i){try{p=[],function(){try{"function"==typeof i.removeEventListener&&(i.removeEventListener("updateend",x,!1),i.removeEventListener("error",N,!1),i.removeEventListener("abort",N,!1)),clearInterval(o)}catch(e){r.error(e)}}(),m=!1,g=[],i.getClassName&&"TextSourceBuffer"===i.getClassName()||(r.debug("Removing sourcebuffer from media source"),y.removeSourceBuffer(i))}catch(e){}i=null}v=null},updateTimestampOffset:w,initializeForStreamSwitch:function(e,t,r){n=(s=e).type;var a=s.codec;!function(e){i=e.getBuffer()}(r),b();var o=[];return o.push(new Promise((function(e){O((function(){var t=i.appendWindowStart,n=i.appendWindowEnd;i&&(i.abort(),i.appendWindowStart=t,i.appendWindowEnd=n),e()}))}))),o.push(S(s.streamInfo)),c.get().streaming.buffer.useChangeTypeForTrackSwitch&&o.push(_(a)),t&&void 0!==t.MSETimeOffset&&o.push(w(t.MSETimeOffset)),Promise.all(o)},initializeForFirstUse:function(e,t,r){n=(s=t).type;var o=s.codec;try{if(o.match(/application\/mp4;\s*codecs="(stpp|wvtt).*"/i))return T(e);i=y.addSourceBuffer(o),b();var u=[];return u.push(S(s.streamInfo)),r&&void 0!==r.MSETimeOffset&&u.push(w(r.MSETimeOffset)),Promise.all(u)}catch(t){return s.type==a.Z.TEXT&&!s.isFragmented||-1!==o.indexOf('codecs="stpp')||-1!==o.indexOf('codecs="vtt')||-1!==o.indexOf("text/vtt")?T(e):Promise.reject(t)}},updateAppendWindow:S,changeType:_},r=(0,d.Z)(u).getInstance().getLogger(t),t}D.__dashjs_factory_name="SourceBufferSink";var x=c.Z.getClassFactory(D);function N(e){var t,n,r,i=this.context,a=[],s=e;function o(e,t){return a=a.filter((function(n){return!((isNaN(t)||n.start<t)&&(isNaN(e)||n.end>e))})),Promise.resolve()}return t={getAllBufferRanges:function(){for(var e=[],t=0;t<a.length;t++){var n=a[t];0===e.length||n.start>e[e.length-1].end?e.push({start:n.start,end:n.end}):e[e.length-1].end=n.end}var r={start:function(t){return e[t].start},end:function(t){return e[t].end}};return Object.defineProperty(r,"length",{get:function(){return e.length}}),r},append:function(e){return"InitializationSegment"!==e.segmentType?(a.push(e),a.sort((function(e,t){return e.start-t.start})),r=null):r=e,n.debug("PreBufferSink appended chunk s: "+e.start+"; e: "+e.end),s&&s({chunk:e}),Promise.resolve()},remove:o,abort:function(){return Promise.resolve()},discharge:function(e,t){var n=function(e,t){return a.filter((function(n){return(isNaN(t)||n.start<t)&&(isNaN(e)||n.end>e)}))}(e,t);return r&&(n.push(r),r=null),o(e,t),n},reset:function(){a=[],r=null,s=null},updateTimestampOffset:function(){return Promise.resolve()},waitForUpdateEnd:function(e){e()},getBuffer:function(){return this}},n=(0,d.Z)(i).getInstance().getLogger(t),t}N.__dashjs_factory_name="PreBufferSink";var O=c.Z.getClassFactory(N);function P(){var e={};return{save:function(t){var n=t.streamId,r=t.representationId;e[n]=e[n]||{},e[n][r]=t},extract:function(t,n){return e&&e[t]&&e[t][n]?e[t][n]:null},reset:function(){e={}}}}P.__dashjs_factory_name="InitCache";var M=c.Z.getSingletonFactory(P),k=.01,L="BufferController";function F(e){e=e||{};var t,n,r,i,s,c,h,p,g,m,y,v,_,T,S,w,A,C,D,N,P,F=this.context,U=(0,u.Z)(F).getInstance(),B=e.errHandler,j=e.fragmentModel,q=e.representationController,H=e.adapter,G=e.textController,V=e.abrController,Y=e.playbackController,z=e.streamInfo,Z=e.type,K=e.settings;function W(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new Promise((function(n,r){c=e,g&&t&&"function"==typeof g.discharge?(m=g,$(t).then((function(){n()})).catch((function(e){r(e)}))):n()}))}function X(e){return H.convertRepresentationToRepresentationInfo(q.getRepresentationForQuality(e))}function $(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return new Promise((function(n,r){C&&e?c?(y=!1,Q(e,t).then((function(e){n(e)})).catch((function(e){r(e)}))):(y=!0,function(){var e=this;return new Promise((function(t,n){var r=V.getQualityFor(Z,z.id);g=O(F).create(re.bind(e)),_e(X(r)).then((function(){t(g)})).catch((function(){n()}))}))}().then((function(e){n(e)})).catch((function(e){r(e)}))):n(null)}))}function Q(e,t){return new Promise((function(r,i){var s=V.getQualityFor(Z,z.id);g=x(F).create({mediaSource:c,textController:G,eventBus:U}),function(e,t,n){var r=X(n);return t&&t[Z]&&(Z===a.Z.VIDEO||Z===a.Z.AUDIO)?g.initializeForStreamSwitch(e,r,t[Z]):g.initializeForFirstUse(z,e,r)}(e,t,s).then((function(){return _e(X(s))})).then((function(){r(g)})).catch((function(e){n.fatal("Caught error on create SourceBuffer: "+e),B.error(new E.Z(I.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,I.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+Z)),i(e)}))}))}function J(e){K.get().streaming.cacheInitSegments&&(n.info("Init fragment finished loading saving to",Z+"'s init cache"),C.save(e.chunk)),n.debug("Append Init fragment",Z," with representationId:",e.chunk.representationId," and quality:",e.chunk.quality,", data size:",e.chunk.bytes.byteLength),te(e.chunk)}function ee(e){te(e.chunk,e.request)}function te(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;g&&(g.append(e,t).then((function(e){re(e)})).catch((function(e){re(e)})),e.mediaInfo.type===a.Z.VIDEO&&Ce(l.Z.VIDEO_CHUNK_RECEIVED,{chunk:e}))}function ne(e){if(e&&e.length>0)for(var t=0,r=e.length;t<r;t++)n.debug("Buffered range: "+e.start(t)+" - "+e.end(t)+", currentTime = ",Y.getTime())}function re(e){if(e.error)return 22===e.error.code&&function(){if(A=!0,s=.8*we(),n.warn("Quota exceeded, Critical Buffer: "+s),s>0){var e=Math.max(.2*s,1),t=s-e,r=Math.min(K.get().streaming.buffer.bufferTimeAtTopQuality,.9*t),i=Math.min(K.get().streaming.buffer.bufferTimeAtTopQualityLongForm,.9*t),a={streaming:{buffer:{bufferToKeep:parseFloat(e.toFixed(5)),bufferTimeAtTopQuality:parseFloat(r.toFixed(5)),bufferTimeAtTopQualityLongForm:parseFloat(i.toFixed(5))}}};K.update(a)}}(),void(22!==e.error.code&&Ie()||(n.warn("Clearing playback buffer to overcome quota exceed situation"),Ce(l.Z.QUOTA_EXCEEDED,{criticalBufferLevel:s,quotaExceededTime:e.chunk.start}),me(ge())));if(g&&(ce(),A=!1,(T=e.chunk)&&T.endFragment)){T&&!isNaN(T.index)&&(h=Math.max(T.index,h),de());var t=g.getAllBufferRanges();T.segmentType===R.w.MEDIA_SEGMENT_TYPE&&(ne(t),se(),function(){if(!isNaN(P)&&!y)if(Z===a.Z.AUDIO||Z===a.Z.VIDEO){var e=Y.getTime(),t=le(e,0),n=le(P,0);if(t&&n&&t.start===n.start)P=NaN;else{var r=q.getCurrentRepresentation().segmentDuration,i=le(P,r);i&&(K.get().streaming.buffer.enableSeekDecorrelationFix&&Math.abs(e-P)>r?P<=i.end&&Y.seek(Math.max(P,i.start),!1,!0):e<i.start&&Y.seek(i.start,!1,!0))}}else P=NaN}());var r=!1;v&&(v.indexOf(T)>0&&(r=!0),v=null),T&&!r&&Ce(l.Z.BYTES_APPENDED_END_FRAGMENT,{quality:T.quality,startTime:T.start,index:T.index,bufferedRanges:t,segmentType:T.segmentType,mediaType:Z})}}function ie(){return new Promise((function(e,t){var n=ae();if(!n||0===n.length)return se(),void e();me(n).then((function(){e()})).catch((function(e){t(e)}))}))}function ae(e){var t=[],r=g.getAllBufferRanges();if(!r||0===r.length)return t;if(!e&&0!==e||isNaN(e))t.push({start:r.start(0),end:r.end(r.length-1)+.5});else{var i=function(e,t){var n=K.get().streaming.buffer.bufferToKeep,r=t.start(0);if(e-r>n){var i=Math.max(0,e-n),a=j.getRequests({state:b.FRAGMENT_MODEL_EXECUTED,time:e,threshold:k})[0];if(a&&(i=Math.min(a.startTime,i)),i>0)return{start:r,end:i}}return null}(e,r),a=function(e,t){var r=t.end(t.length-1)+.5,i=Ae(e),a=z.manifestInfo.duration>=K.get().streaming.buffer.longFormContentDurationThreshold?K.get().streaming.buffer.bufferTimeAtTopQualityLongForm:K.get().streaming.buffer.bufferTimeAtTopQuality,s=isNaN(i)?e:Math.min(i,e+a);if(s>=t.end(t.length-1))return null;var o=j.getRequests({state:b.FRAGMENT_MODEL_EXECUTED,time:e,threshold:k})[0];if(o&&(s=Math.max(o.startTime+o.duration,s)),K.get().streaming.buffer.avoidCurrentTimeRangePruning)for(var u=0;u<t.length;u++)if(t.start(u)<=e&&e<=t.end(u)&&t.start(u)<=s&&s<=t.end(u)){var l=s;s=u+1<t.length?t.start(u+1):t.end(u)+1,n.debug("Buffered range ["+t.start(u)+", "+t.end(u)+"] overlaps with targetTime "+e+" and range to be pruned ["+l+", "+r+"], using ["+s+", "+r+"] instead"+(s<r?"":" (no actual pruning)"));break}return s<t.end(t.length-1)?{start:s,end:r}:null}(e,r);i&&t.push(i),a&&t.push(a)}return t}function se(){(!N||Z===a.Z.TEXT&&G.isTextEnabled())&&ce()}function oe(){fe()}function ue(){fe(),P=NaN}function le(e,t){if(!g)return null;var n,r,i=g.getAllBufferRanges(),a=0,s=0,o=null,u=null,l=0,c=isNaN(t)?.15:t;if(null!=i){for(r=0,n=i.length;r<n;r++)if(a=i.start(r),s=i.end(r),null===o)l=Math.abs(a-e),(e>=a&&e<s||l<=c)&&(o=a,u=s);else{if(!((l=a-u)<=c))break;u=s}if(null!==o)return{start:o,end:u}}return null}function ce(){if(Y){var e=Y.getTime()||0;y&&(e=isNaN(P)?0:P);var t=K.get().streaming.gaps.jumpGaps&&!isNaN(K.get().streaming.gaps.smallGapLimit)?K.get().streaming.gaps.smallGapLimit:NaN;i=Math.max(function(e,t){var n;return K.get().streaming.gaps.jumpGaps&&(t=K.get().streaming.gaps.smallGapLimit),null===(n=le(e,t))?0:n.end-e}(e,t),0),Ce(l.Z.BUFFER_LEVEL_UPDATED,{mediaType:Z,bufferLevel:i}),fe()}}function de(){var e=h>=p-1,t=Y.getTimeToStreamEnd(z)-i<1e-5;!e&&!t||r||(Se(!0),n.debug("checkIfBufferingCompleted trigger BUFFERING_COMPLETED for stream id ".concat(z.id," and type ").concat(Z)))}function fe(){Z!==a.Z.AUDIO&&Z!==a.Z.VIDEO||((!Y.getLowLatencyModeEnabled()&&i<K.get().streaming.buffer.stallThreshold||0===i)&&!r?he(o.Z.BUFFER_EMPTY):(r||i>=K.get().streaming.buffer.stallThreshold||Y.getLowLatencyModeEnabled()&&i>0)&&he(o.Z.BUFFER_LOADED))}function he(e){_===e||e===o.Z.BUFFER_EMPTY&&0===Y.getTime()||Z===a.Z.TEXT&&!G.isTextEnabled()||(_=e,Ce(l.Z.BUFFER_LEVEL_STATE_CHANGED,{state:e}),Ce(e===o.Z.BUFFER_LOADED?l.Z.BUFFER_LOADED:l.Z.BUFFER_EMPTY),n.debug(e===o.Z.BUFFER_LOADED?"Got enough buffer to start":"Waiting for more buffer before starting playback"))}function pe(){g&&Z!==a.Z.TEXT&&(r||me(ge()))}function ge(){var e=[],t=g.getAllBufferRanges();if(!t||0===t.length)return e;var n=Y.getTime(),r=Math.max(0,n-K.get().streaming.buffer.bufferToKeep),i=j.getRequests({state:b.FRAGMENT_MODEL_EXECUTED,time:n,threshold:k})[0];if(i)r=Math.min(i.startTime,r);else if(0===n&&Y.getIsDynamic())return[];if(t.start(0)<=r){for(var a={start:0,end:r},s=0;s<t.length&&t.end(s)<=r;s++)a.end=t.end(s);a.start<a.end&&e.push(a)}return e}function me(e){return new Promise((function(t,n){if(e&&g&&0!==e.length){var r=[];e.forEach((function(e){r.push(function(e){return new Promise((function(t,n){e.resolve=t,e.reject=n,D.push(e)}))}(e))})),w||ye(),Promise.all(r).then((function(){t()})).catch((function(e){n(e)}))}else t()}))}function ye(){try{if(0===D.length||!g)return n.debug("Nothing to prune, halt pruning"),D=[],void(w=!1);var e=g.getBuffer();if(!e||!e.buffered||0===e.buffered.length)return n.debug("SourceBuffer is empty (or does not exist), halt pruning"),D=[],void(w=!1);var t=D.shift();n.debug("".concat(Z,": Removing buffer from: ").concat(t.start," to ").concat(t.end)),w=!0,Y.getTime()<t.end&&Se(!1),g.remove(t).then((function(e){ve(e)})).catch((function(e){ve(e)}))}catch(e){w=!1}}function ve(e){n.debug("onRemoved buffer from:",e.from,"to",e.to),g&&(ne(g.getAllBufferRanges()),0===D.length&&(w=!1,ce()),e.unintended&&(n.warn("Detected unintended removal from:",e.from,"to",e.to,"setting streamprocessor time to",e.from),Ce(l.Z.SEEK_TARGET,{time:e.from})),w?ye():(N?N=!1:ce(),Ce(l.Z.BUFFER_CLEARED,{from:e.from,to:e.to,unintended:e.unintended,hasEnoughSpaceToAppend:Ie(),quotaExceeded:A})))}function _e(e){return new Promise((function(t){e&&void 0!==e.MSETimeOffset&&g&&g.updateTimestampOffset?g.updateTimestampOffset(e.MSETimeOffset).then((function(){t()})).catch((function(){t()})):t()}))}function Te(){return g&&!r?g.updateAppendWindow(z):Promise.resolve()}function be(){++S*(K.get().streaming.wallclockTimeUpdateInterval/1e3)>=K.get().streaming.buffer.bufferPruningInterval&&(S=0,pe())}function Ee(){fe()}function Se(e){(r=e)?Ce(l.Z.BUFFERING_COMPLETED):p=Number.POSITIVE_INFINITY}function we(){try{var e,t,n=g.getAllBufferRanges(),r=0;if(!n)return r;for(t=0,e=n.length;t<e;t++)r+=n.end(t)-n.start(t);return r}catch(e){return 0}}function Ae(e){try{var t=e,n=g.getAllBufferRanges();if(!n||0===n.length)return NaN;for(var r=0;t===e&&r<n.length;){var i=n.start(r),a=n.end(r);t>=i&&t<=a&&(t=a),r+=1}return t===e?NaN:t}catch(e){}}function Ie(){var e=we();return isNaN(e)||e<s}function Ce(e,t){var n=t||{};U.trigger(e,n,{streamId:z.id,mediaType:Z})}function Re(e,t){if(s=Number.POSITIVE_INFINITY,_=void 0,p=Number.POSITIVE_INFINITY,h=0,T=null,r=!1,w=!1,A=!1,i=0,S=0,D=[],P=NaN,y=!1,g){var n=g;g=null,e||t||n.abort().then((function(){n.reset(t),n=null}))}N=!1}return t={initialize:function(e){W(e),U.on(l.Z.INIT_FRAGMENT_LOADED,J,t),U.on(l.Z.MEDIA_FRAGMENT_LOADED,ee,t),U.on(l.Z.WALLCLOCK_TIME_UPDATED,be,t),U.on(f.Z.PLAYBACK_PLAYING,ue,t),U.on(f.Z.PLAYBACK_PROGRESS,se,t),U.on(f.Z.PLAYBACK_TIME_UPDATED,se,t),U.on(f.Z.PLAYBACK_RATE_CHANGED,Ee,t),U.on(f.Z.PLAYBACK_STALLED,oe,t)},getStreamId:function(){return z.id},getType:function(){return Z},getBufferControllerType:function(){return L},createBufferSink:$,dischargePreBuffer:function(){if(g&&m&&"function"==typeof m.discharge){var e=m.getAllBufferRanges();if(e.length>0){for(var t="Beginning "+Z+"PreBuffer discharge, adding buffer for:",r=0;r<e.length;r++)t+=" start: "+e.start(r)+", end: "+e.end(r)+";";n.debug(t)}else n.debug("PreBuffer discharge requested, but there were no media segments in the PreBuffer.");v=[];for(var i=m.discharge(),a=null,s=0;s<i.length;s++){var o=i[s];if(o.segmentType!==R.w.INIT_SEGMENT_TYPE){var u=C.extract(o.streamId,o.representationId);u&&a!==u&&(v.push(u),g.append(u),a=u)}v.push(o),g.append(o)}m.reset(),m=null}},getBuffer:function(){return g},getBufferLevel:function(){return i},getRangeAt:le,hasBufferAtTime:function(e){try{var t=g.getAllBufferRanges();if(!t||0===t.length)return!1;for(var r=0;r<t.length;){var i=t.start(r),a=t.end(r);if(e>=i&&e<=a)return!0;r+=1}return!1}catch(e){return n.error(e),!1}},pruneBuffer:pe,setMediaSource:W,getMediaSource:function(){return c},appendInitSegmentFromCache:function(e){var t=C.extract(z.id,e);return!!t&&(n.info("Append Init fragment",Z," with representationId:",t.representationId," and quality:",t.quality,", data size:",t.bytes.byteLength),te(t),!0)},getIsBufferingCompleted:function(){return r},setIsBufferingCompleted:Se,getIsPruningInProgress:function(){return w},reset:function(e,t){U.off(l.Z.INIT_FRAGMENT_LOADED,J,this),U.off(l.Z.MEDIA_FRAGMENT_LOADED,ee,this),U.off(l.Z.WALLCLOCK_TIME_UPDATED,be,this),U.off(f.Z.PLAYBACK_PLAYING,ue,this),U.off(f.Z.PLAYBACK_PROGRESS,se,this),U.off(f.Z.PLAYBACK_TIME_UPDATED,se,this),U.off(f.Z.PLAYBACK_RATE_CHANGED,Ee,this),U.off(f.Z.PLAYBACK_STALLED,oe,this),Re(e,t)},prepareForPlaybackSeek:function(){return r&&Se(!1),g.abort()},prepareForReplacementTrackSwitch:function(e){return new Promise((function(t,n){g.abort().then((function(){return Te()})).then((function(){return K.get().streaming.buffer.useChangeTypeForTrackSwitch?g.changeType(e):Promise.resolve()})).then((function(){return ie()})).then((function(){Se(!1),t()})).catch((function(e){n(e)}))}))},prepareForNonReplacementTrackSwitch:function(e){return new Promise((function(t,n){Te().then((function(){return K.get().streaming.buffer.useChangeTypeForTrackSwitch?g.changeType(e):Promise.resolve()})).then((function(){t()})).catch((function(e){n(e)}))}))},prepareForForceReplacementQualitySwitch:function(e){return new Promise((function(t,n){g.abort().then((function(){return Te()})).then((function(){return ie()})).then((function(){return _e(e)})).then((function(){Se(!1),t()})).catch((function(e){n(e)}))}))},updateAppendWindow:Te,getAllRangesWithSafetyFactor:ae,getContinuousBufferTimeForTargetTime:Ae,clearBuffers:me,pruneAllSafely:ie,updateBufferTimestampOffset:_e,setSeekTarget:function(e){P=e},segmentRequestingCompleted:function(e){isNaN(e)||(p=e,de())}},n=(0,d.Z)(F).getInstance().getLogger(t),C=M(F).getInstance(),Re(),t}F.__dashjs_factory_name=L;var U=c.Z.getClassFactory(F),B="NotFragmentedTextBufferController";function j(e){e=e||{};var t,n,r,i,a,s,o=this.context,c=(0,u.Z)(o).getInstance(),d=e.textController,f=e.errHandler,h=e.streamInfo,p=e.type;function g(e){i=e}function m(e){var t,r;n!==e&&(n=e)&&(t=l.Z.BUFFERING_COMPLETED,r={},c.trigger(t,r,{streamId:h.id,mediaType:p}))}function y(e){e.chunk.bytes&&!n&&(s.save(e.chunk),a.append(e.chunk),m(!0))}return t={initialize:function(e){g(e)},getStreamId:function(){return h.id},getType:function(){return p},getBufferControllerType:function(){return B},createBufferSink:function(e){return new Promise((function(t,n){try{(a=x(o).create({mediaSource:i,textController:d,eventBus:c})).initializeForFirstUse(h,e),r||(a.getBuffer()&&"function"==typeof a.getBuffer().initialize&&a.getBuffer().initialize(),r=!0),t(a)}catch(e){f.error(new E.Z(I.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,I.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+p)),n(e)}}))},dischargePreBuffer:function(){},getBuffer:function(){return a},getBufferLevel:function(){return 0},getRangeAt:function(){return null},pruneBuffer:function(){},hasBufferAtTime:function(){return!0},getAllRangesWithSafetyFactor:function(){return[]},getContinuousBufferTimeForTargetTime:function(){return Number.POSITIVE_INFINITY},setMediaSource:g,getMediaSource:function(){return i},appendInitSegmentFromCache:function(e){return null!==s.extract(h.id,e)},getIsBufferingCompleted:function(){return n},setIsBufferingCompleted:m,getIsPruningInProgress:function(){return!1},reset:function(e){c.off(l.Z.INIT_FRAGMENT_LOADED,y,t),!e&&a&&(a.abort(),a.reset(),a=null)},clearBuffers:function(){return Promise.resolve()},prepareForPlaybackSeek:function(){return Promise.resolve()},prepareForReplacementTrackSwitch:function(){return n=!1,Promise.resolve()},setSeekTarget:function(){},updateAppendWindow:function(){return Promise.resolve()},pruneAllSafely:function(){return Promise.resolve()},updateBufferTimestampOffset:function(){return Promise.resolve()},segmentRequestingCompleted:function(){}},r=!1,i=null,n=!1,s=M(o).getInstance(),c.on(l.Z.INIT_FRAGMENT_LOADED,y,t),t}j.__dashjs_factory_name=B;var q=c.Z.getClassFactory(j);function H(e){e=e||{};var t,n,r,i,s,c,h,p,g,m,y,v,_,T=this.context,E=(0,u.Z)(T).getInstance(),S=e.dashMetrics,w=e.mediaPlayerModel,A=e.fragmentModel,I=e.abrController,C=e.playbackController,R=e.textController,D=e.type,x=e.bufferController,N=e.representationController,O=e.settings;function P(){v=!0}function M(){v=!1}function k(e){if(!x.getIsBufferingCompleted()){L();var t=isNaN(e)?0:e;s=setTimeout(F,t)}}function L(){s&&(clearTimeout(s),s=null)}function F(){try{if(function(){try{return D===a.Z.TEXT&&!R.isTextEnabled()||C.isPaused()&&(!C.getStreamController().getInitialPlayback()||!C.getStreamController().getAutoPlay())&&!O.get().streaming.scheduling.scheduleWhilePaused}catch(e){return!1}}())return void L();if(function(){try{return!!v&&N.getCurrentRepresentationInfo()&&(isNaN(g)||m||(e=n.id,t=I.getMaxAllowedIndexFor(D,e),!(!isNaN(p)&&p==t||(r.info("Top quality "+D+" index has changed from "+p+" to "+t),p=t,0)))||function(){var e=N.getCurrentRepresentationInfo();return!D||!e||S.getCurrentBufferLevel(D)<U()}())}catch(e){return!1}var e,t}()){var e=!1;_&&(e=I.checkPlaybackQuality(D,n.id)),e||(i=N.getCurrentRepresentationInfo(),y||i.quality!==g||m?(m?(r.debug("Switch track for "+D+", representation id = "+i.id),m=!1):r.debug("Quality has changed, get init request for representationid = "+i.id),E.trigger(l.Z.INIT_FRAGMENT_NEEDED,{representationId:i.id,sender:t},{streamId:n.id,mediaType:D}),_=!1,y=!1):(r.debug("Media segment needed for ".concat(D," and stream id ").concat(n.id)),E.trigger(l.Z.MEDIA_FRAGMENT_NEEDED,{},{streamId:n.id,mediaType:D}),_=!0))}else k(C.getLowLatencyModeEnabled()?O.get().streaming.scheduling.lowLatencyTimeout:O.get().streaming.scheduling.defaultTimeout)}catch(e){k(C.getLowLatencyModeEnabled()?O.get().streaming.scheduling.lowLatencyTimeout:O.get().streaming.scheduling.defaultTimeout)}var i}function U(){var e=NaN,t=N.getCurrentRepresentationInfo();return D&&t?(e=D===a.Z.TEXT?function(){try{if(R.isTextEnabled()){var e=N.getCurrentRepresentationInfo();if(isNaN(e.fragmentDuration)){var t=S.getCurrentSchedulingInfo(o.Z.SCHEDULING_INFO);return t?t.duration:0}return e.fragmentDuration}return 0}catch(e){return 0}}():D===a.Z.AUDIO&&c?function(){try{var e=S.getCurrentBufferLevel(a.Z.VIDEO),t=N.getCurrentRepresentationInfo();return isNaN(t.fragmentDuration)?e+1:Math.max(e+1,t.fragmentDuration)}catch(e){return 0}}():function(){try{var e=N.getCurrentRepresentationInfo().mediaInfo.streamInfo;return I.isPlayingAtTopQuality(e)?e.manifestInfo.duration>=O.get().streaming.buffer.longFormContentDurationThreshold?O.get().streaming.buffer.bufferTimeAtTopQualityLongForm:O.get().streaming.buffer.bufferTimeAtTopQuality:w.getStableBufferTime()}catch(e){return w.getStableBufferTime()}}(),e):e}function B(){j(!0)}function j(e){if(C&&A){var t=A.getRequests({state:b.FRAGMENT_MODEL_EXECUTED,time:C.getTime(),threshold:0})[0];t&&C.getTime()>=t.startTime&&((!h.mediaInfo||t.mediaInfo.type===h.mediaInfo.type&&t.mediaInfo.index!==h.mediaInfo.index)&&e&&E.trigger(l.Z.TRACK_CHANGE_RENDERED,{mediaType:D,oldMediaInfo:h.mediaInfo,newMediaInfo:t.mediaInfo,streamId:n.id}),t.quality===h.quality&&t.adaptationIndex===h.adaptationIndex||!e||(r.debug("Quality change rendered for streamId ".concat(n.id," and type ").concat(D)),E.trigger(l.Z.QUALITY_CHANGE_RENDERED,{mediaType:D,oldQuality:h.quality,newQuality:t.quality,streamId:n.id})),h={mediaInfo:t.mediaInfo,quality:t.quality,adaptationIndex:t.adaptationIndex})}}function q(){A.abortRequests(),L()}function H(){O.get().streaming.scheduling.scheduleWhilePaused||k()}function G(e){S.updatePlayListTraceMetrics({playbackspeed:e.playbackRate.toString()})}function V(){_=!0,i=0,g=NaN,h={mediaInfo:void 0,quality:NaN,adaptationIndex:NaN},p=NaN,m=!1,y=!1,v=!0}return t={initialize:function(e){c=e,E.on(l.Z.URL_RESOLUTION_FAILED,q,t),E.on(f.Z.PLAYBACK_STARTED,H,t),E.on(f.Z.PLAYBACK_RATE_CHANGED,G,t),E.on(f.Z.PLAYBACK_TIME_UPDATED,B,t),E.on(f.Z.MANAGED_MEDIA_SOURCE_START_STREAMING,P,t),E.on(f.Z.MANAGED_MEDIA_SOURCE_END_STREAMING,M,t)},getType:function(){return D},getStreamId:function(){return n.id},setTimeToLoadDelay:function(e){i=e},getTimeToLoadDelay:function(){return i},setSwitchTrack:function(e){m=e},getSwitchTrack:function(){return m},startScheduleTimer:k,clearScheduleTimer:L,reset:function(){E.off(l.Z.URL_RESOLUTION_FAILED,q,t),E.off(f.Z.PLAYBACK_STARTED,H,t),E.off(f.Z.PLAYBACK_RATE_CHANGED,G,t),E.off(f.Z.PLAYBACK_TIME_UPDATED,B,t),E.off(f.Z.MANAGED_MEDIA_SOURCE_START_STREAMING,P,t),E.off(f.Z.MANAGED_MEDIA_SOURCE_END_STREAMING,M,t),L(),j(!1),V(),n=null},getBufferTarget:U,getPlaybackController:function(){return C},setCheckPlaybackQuality:function(e){_=e},setInitSegmentRequired:function(e){y=e},setLastInitializedQuality:function(e){g=e}},r=(0,d.Z)(T).getInstance().getLogger(t),V(),n=e.streamInfo,t}H.__dashjs_factory_name="ScheduleController";var G=c.Z.getClassFactory(H),V=n(7387);function Y(e){var t,n,r,i,s,o,u=(e=e||{}).eventBus,l=e.events,c=e.abrController,d=e.dashMetrics,h=e.playbackController,p=e.timelineConverter,g=e.type,m=e.streamInfo,y=e.dashConstants,v=e.segmentsController,_=e.isDynamic,T=e.adapter;function b(){return g}function E(){return r}function S(){return o}function w(){n=null,r=!0,i=[],s=null}function A(e){return new Promise((function(t,n){var r=e.hasInitialization(),a=e.hasSegments(),s=[];s.push(v.updateInitData(e,r)),s.push(v.updateSegmentData(e,a)),Promise.all(s).then((function(n){var r;n[0]&&!n[0].error&&(e=function(e,t){return t&&!t.error&&t.representation?t.representation:e}(e,n[0])),n[1]&&!n[1].error&&(e=function(e,t){if(t&&!t.error){var n,r,i,a,s=t.segments,o=[],u=0;for(n=0,r=s?s.length:0;n<r;n++)i=s[n],(a=(0,V.TJ)(p,_,e,i.startTime,i.duration,i.timescale,i.media,i.mediaRange,u))&&(o.push(a),a=null,u++);return o.length>0&&(e.segments=o),e}}(e,n[1])),(r=e).mediaFinishedInformation=v.getMediaFinishedInformation(r),function(e){if(E()){var t,n,r=d.getCurrentManifestUpdate(),a=!1;if(r){for(var s=0;s<r.representationInfo.length;s++)if((t=r.representationInfo[s]).index===e.index&&t.mediaType===b()){a=!0;break}a||d.addManifestUpdateRepresentationInfo(e,b())}if(function(){for(var e=0,t=i.length;e<t;e++){var n=i[e].segmentInfoType;if(!i[e].hasInitialization()||(n===y.SEGMENT_BASE||n===y.BASE_URL)&&!i[e].segments)return!1}return!0}()){c.setPlaybackQuality(g,m,(n=o,i.indexOf(n)));var u=d.getCurrentDVRInfo(g);u&&d.updateManifestUpdateInfo({latency:u.range.end-h.getTime()}),d.getCurrentRepresentationSwitch(S().adaptation.type)||I(),R()}}}(e),t()})).catch((function(e){n(e)}))}))}function I(){!function(){if(!(c&&d&&h&&p))throw new Error(a.Z.MISSING_CONFIG_ERROR)}();var e=new Date,t=S(),n=1e3*h.getTime();t&&d.addRepresentationSwitch(t.adaptation.type,e,n,t.id),u.trigger(f.Z.REPRESENTATION_SWITCH,{mediaType:g,streamId:m.id,currentRepresentation:t,numberOfRepresentations:i.length},{streamId:m.id,mediaType:g})}function C(e){return null==e||e>=i.length?null:i[e]}function R(e){r=!1,u.trigger(l.DATA_UPDATE_COMPLETED,{data:n,currentRepresentation:o,error:e},{streamId:m.id,mediaType:g})}function D(e){o=e,s=T.convertRepresentationToRepresentationInfo(o)}function x(e){if(e.newDuration){var t=S();t&&t.adaptation.period&&(t.adaptation.period.duration=e.newDuration)}}return t={getStreamId:function(){return m.id},getType:b,getData:function(){return n},isUpdating:E,updateData:function(e,t,s,o,u){return new Promise((function(l,c){if(r=!0,i=t,n=e,D(C(u)),s!==a.Z.VIDEO&&s!==a.Z.AUDIO&&(s!==a.Z.TEXT||!o))return R(),void l();for(var d=[],f=0,h=i.length;f<h;f++){var p=i[f];d.push(A(p))}Promise.all(d).then((function(){D(C(u)),l()})).catch((function(e){c(e)}))}))},getCurrentRepresentation:S,getCurrentRepresentationInfo:function(){return s},getRepresentationForQuality:C,prepareQualityChange:function(e){D(C(e)),I()},reset:function(){u.off(f.Z.MANIFEST_VALIDITY_CHANGED,x,t),w()}},w(),u.on(f.Z.MANIFEST_VALIDITY_CHANGED,x,t),t}Y.__dashjs_factory_name="RepresentationController";var z=c.Z.getClassFactory(Y),Z=n(3106),K=n(9326),W=n(7473),X=n(2594);function $(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Q=function e(){$(this,e),this.start=null,this.mstart=null,this.starttype=null,this.trace=[]};Q.INITIAL_PLAYOUT_START_REASON="initial_playout",Q.SEEK_START_REASON="seek",Q.RESUME_FROM_PAUSE_START_REASON="resume",Q.METRICS_COLLECTION_START_REASON="metrics_collection_start";var J=function e(){$(this,e),this.representationid=null,this.subreplevel=null,this.start=null,this.mstart=null,this.duration=null,this.playbackspeed=null,this.stopreason=null};J.REPRESENTATION_SWITCH_STOP_REASON="representation_switch",J.REBUFFERING_REASON="rebuffering",J.USER_REQUEST_STOP_REASON="user_request",J.END_OF_PERIOD_STOP_REASON="end_of_period",J.END_OF_CONTENT_STOP_REASON="end_of_content",J.METRICS_COLLECTION_STOP_REASON="metrics_collection_end",J.FAILURE_STOP_REASON="failure";var ee=n(7802);function te(){return{ntpToUTC:function(e){var t=new Date(Date.UTC(1900,0,1,0,0,0));return new Date(t.getTime()+e).getTime()}}}te.__dashjs_factory_name="TimeUtils";var ne=c.Z.getSingletonFactory(te);function re(e){e=e||{};var t,n,r,i,c,h,p,g,m,y,v,_,T,S,w,A=this.context,C=(0,u.Z)(A).getInstance(),D=e.streamInfo,x=e.type,N=e.errHandler,O=e.mimeType,P=e.timelineConverter,M=e.adapter,k=e.manifestModel,L=e.mediaPlayerModel,F=e.fragmentModel,B=e.abrController,j=e.playbackController,H=e.mediaController,V=e.textController,Y=e.dashMetrics,$=e.settings,Q=e.boxParser,te=e.segmentBlacklistController;function re(){return D.id}function ie(){return x}function ae(){return M.getIsTextTrack(g.getData())}function se(){c=[],i=null,S=0,m=!1,y=!1,v=!1,w=null}function oe(e){return!isNaN(e)&&!isNaN(D.duration)&&isFinite(D.duration)&&e>=D.start+D.duration}function ue(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.sender)if(j.getIsManifestUpdateInProgress())fe();else if((!ae()||V.isTextEnabled())&&h&&e.representationId&&!h.appendInitSegmentFromCache(e.representationId)){var n=g.getCurrentRepresentation();if(0===n.range)return void le();var r=_?_.getInitRequest(i,n):null;r?F.executeRequest(r):t&&(p.setInitSegmentRequired(!0),fe())}}function le(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(j.getIsManifestUpdateInProgress()||h.getIsPruningInProgress())fe();else{var n=function(){var e,t=Ce();if(isNaN(S)||ie()===a.Z.TEXT&&!V.isTextEnabled())return null;if(_){var n=g&&t?g.getRepresentationForQuality(t.quality):null;e=m?_.getSegmentRequestForTime(i,n,S):y?_.repeatSegmentRequest(i,n):_.getNextSegmentRequest(i,n)}return e}();n?(m=!1,y=!1,ce(n)):de(t)}}function ce(e){isNaN(e.startTime+e.duration)||(S=e.startTime+e.duration),e.delayLoadingTime=(new Date).getTime()+p.getTimeToLoadDelay(),p.setTimeToLoadDelay(0),function(e){var t=e.url;return e.range&&(t=t.concat("_",e.range)),te.contains(t)}(e)?(n.warn("Fragment request url ".concat(e.url," for stream id ").concat(D.id," and media type ").concat(x," is on the ignore list and will be skipped")),fe()):(n.debug("Next fragment request url for stream id ".concat(D.id," and media type ").concat(x," is ").concat(e.url)),F.executeRequest(e))}function de(e){var t,a=g.getCurrentRepresentation();if(!$.get().streaming.gaps.enableSeekFix||!m&&0!==j.getTime()||(r?r&&a.segmentInfoType===s.Z.SEGMENT_TIMELINE&&(t=_.getValidTimeAheadOfTargetTime(S,i,a,$.get().streaming.gaps.threshold)):t=_.getValidTimeAheadOfTargetTime(S,i,a,$.get().streaming.gaps.threshold),isNaN(t)||t===S)){if(_.isLastSegmentRequested(a,S)){var o=_.getCurrentIndex();return n.debug("Segment requesting for stream ".concat(D.id," has finished")),C.trigger(l.Z.STREAM_REQUESTING_COMPLETED,{segmentIndex:o},{streamId:D.id,mediaType:x}),h.segmentRequestingCompleted(o),void p.clearScheduleTimer()}e&&fe()}else j.isSeeking()||0===j.getTime()?(n.warn("Adjusting playback time ".concat(t," because of gap in the manifest. Seeking by ").concat(t-S)),j.seek(t,!1,!1)):(n.warn("Adjusting buffering time ".concat(t," because of gap in the manifest. Adjusting time by ").concat(t-S)),Me(t),e&&fe())}function fe(){p.startScheduleTimer(j.getLowLatencyModeEnabled()?$.get().streaming.scheduling.lowLatencyTimeout:$.get().streaming.scheduling.defaultTimeout)}function he(e){e.error||h.getIsBufferingCompleted()||h.updateBufferTimestampOffset(e.currentRepresentation)}function pe(e){Y.addBufferState(x,e.state,p.getBufferTarget()),e.state!==o.Z.BUFFER_EMPTY||j.isSeeking()||(n.info("Buffer is empty! Stalling!"),Y.pushPlayListTraceMetrics(new Date,J.REBUFFERING_REASON))}function ge(e){F.syncExecutedRequestsWithBufferedRange(h.getBuffer().getAllBufferRanges(),D.duration),e.quotaExceeded&&e.from>j.getTime()&&Me(e.from),e.hasEnoughSpaceToAppend&&e.quotaExceeded&&p.startScheduleTimer()}function me(e){if(e&&e.lastRequestAppended&&e.lastRequestAppended.url){var t=e.lastRequestAppended.url;e.lastRequestAppended.range&&(t=t.concat("_",e.lastRequestAppended.range)),n.warn("Blacklisting segment with url ".concat(t)),te.add(t)}}function ye(e){if(n.debug("Appended bytes for ".concat(e.mediaType," and stream id ").concat(e.streamId)),e.segmentType===R.w.INIT_SEGMENT_TYPE){var t=e.quality;p.setLastInitializedQuality(t),n.info("["+x+"] lastInitializedRepresentationInfo changed to "+e.quality)}w?ve(w):p.startScheduleTimer(0)}function ve(e){var t=F.getRequests({state:b.FRAGMENT_MODEL_LOADING});if(t&&t.length>0)return n.debug("Preparing for default quality switch: Waiting for ongoing segment request to be finished before applying switch."),void(w=e);h.updateBufferTimestampOffset(e).then((function(){p.setCheckPlaybackQuality(!1),i.segmentAlignment||i.subSegmentAlignment?p.startScheduleTimer():Oe(),w=null,v=!1})).catch((function(){w=null,v=!1}))}function _e(e){n.info("onFragmentLoadingAbandoned request: "+e.request.url+" has been aborted"),j.isSeeking()||p.getSwitchTrack()||v||(n.info("onFragmentLoadingAbandoned request: "+e.request.url+" has to be downloaded again, origin is not seeking process or switch track call"),e.request&&e.request.isInitializationRequest()?p.setInitSegmentRequired(!0):Me(e.request.startTime+e.request.duration/2),p.startScheduleTimer(0))}function Te(e){n.info("OnFragmentLoadingCompleted for stream id "+D.id+" and media type "+x+" - Url:",e.request?e.request.url:"undefined",e.request.range?", Range:"+e.request.range:""),ae()&&p.startScheduleTimer(0),e.error&&e.request.serviceLocation&&function(e){n.info("Fragment loading completed with an error"),e&&e.request&&e.request.type&&(e.request.type===R.w.INIT_SEGMENT_TYPE?ue({representationId:e.request.representationId,sender:{}},!1):e.request.type===R.w.MEDIA_SEGMENT_TYPE&&(Me(e.request.startTime+e.request.duration/2),le({},!1)))}(e)}function be(){Me(j.getTime()),Ie().startScheduleTimer()}function Ee(e){var t=e.currentTrackInfo;if(t){var n=c.find((function(e){return e.index===t.index&&e.lang===t.lang}));n&&Ae(n).then((function(){h.setIsBufferingCompleted(!1),Me(j.getTime()),p.setInitSegmentRequired(!0),p.startScheduleTimer()}))}}function Se(e){Me(e.quotaExceededTime),p.clearScheduleTimer()}function we(){return h?h.getBuffer():null}function Ae(e){e===i||e&&i&&e.type!==i.type||(i=e);var t=M.getRealAdaptation(D,i),n=M.getVoRepresentations(i);if(g){var s,o=g.getData(),u=B.getMaxAllowedIndexFor(x,D.id),l=B.getMinAllowedIndexFor(x,D.id),c=null;return null!==o&&o.id===t.id||x===a.Z.TEXT?s=B.getQualityFor(x,D.id):(c=B.getThroughputHistory().getAverageThroughput(x,r)||B.getInitialBitrateFor(x,D.id),s=B.getQualityForBitrate(i,c,D.id)),void 0!==l&&s<l&&(s=l),s>u&&(s=u),g.updateData(t,n,x,i.isFragmented,s)}return Promise.resolve()}function Ie(){return p}function Ce(e){var t;return void 0!==e?((0,Z.SE)(e),t=g?g.getRepresentationForQuality(e):null):t=g?g.getCurrentRepresentation():null,M.convertRepresentationToRepresentationInfo(t)}function Re(){return!!h&&h.getIsBufferingCompleted()}function De(e){if($.get().streaming.enableManifestTimescaleMismatchFix){var t=e.chunk,n=t.bytes,r=Ce(t.quality),i=g&&r?g.getRepresentationForQuality(r.quality):null;r&&i&&(i.timescale=Q.getMediaTimescaleFromMoov(n))}}function xe(e){var t=e.chunk,n=t.bytes,r=t.quality,i=Ce(r),a=g&&i?g.getRepresentationForQuality(i.quality):null;if(i&&a){var o;if($.get().streaming.parseInbandPrft&&e.request.type===R.w.MEDIA_SEGMENT_TYPE){var u=function(e,t){var n=e.getBoxes("prft"),r=[];return n.forEach((function(e){r.push(function(e,t){var n="unknown";switch(e.flags){case 0:n=s.Z.PRODUCER_REFERENCE_TIME_TYPE.ENCODER;break;case 16:n=s.Z.PRODUCER_REFERENCE_TIME_TYPE.APPLICATION;break;case 24:n=s.Z.PRODUCER_REFERENCE_TIME_TYPE.CAPTURED}var r=1e3*e.ntp_timestamp_sec+e.ntp_timestamp_frac/Math.pow(2,32)*1e3;return{type:n,ntpTimestamp:r=ne(A).getInstance().ntpToUTC(r),mediaTime:e.media_time/t}}(e,t))})),r}(o=o||Q.parse(n),a.timescale);u&&u.length&&C.trigger(f.Z.INBAND_PRFT,{data:u},{streamId:D.id,mediaType:x})}var c=M.getEventsFor(i.mediaInfo,null,D),d=M.getEventsFor(i,a,D);if(c&&c.length>0||d&&d.length>0){var h=F.getRequests({state:b.FRAGMENT_MODEL_EXECUTED,quality:r,index:t.index})[0],p=function(e,t,n,r){try{for(var i={},a=[],s=n.concat(r),o=0,u=s.length;o<u;o++)i[s[o].schemeIdUri+"/"+s[o].value]=s[o];var l=e.getBoxes("emsg");if(!l||0===l.length)return a;for(var c=e.getBox("sidx"),d=!c||isNaN(c.earliest_presentation_time)||isNaN(c.timescale)?t&&!isNaN(t.mediaStartTime)?t.mediaStartTime:0:c.earliest_presentation_time/c.timescale,f=Math.max(d,0),h=g.getCurrentRepresentation(),p=0,m=l.length;p<m;p++){var y=M.getEvent(l[p],i,f,h);y&&a.push(y)}return a}catch(e){return[]}}(o=o||Q.parse(n),h,c,d);C.trigger(l.Z.INBAND_EVENTS,{events:p},{streamId:D.id})}}}function Ne(){var e=j.getTime();$.get().streaming.buffer.flushBufferAtTrackSwitch&&j.seek(e+.001,!1,!0),Me(e),h.setSeekTarget(e),p.startScheduleTimer()}function Oe(){var e=j.getTime(),t=h.getContinuousBufferTimeForTargetTime(e);Me(isNaN(t)?e:t),p.startScheduleTimer()}function Pe(e){e&&!isNaN(e.time)&&(Me(e.time),h.setSeekTarget(e.time))}function Me(e){S=e,m=!0}return t={initialize:function(n,i,o){T=(0,ee.Z)(A).create({events:l.Z,eventBus:C,streamInfo:D,timelineConverter:P,dashConstants:s.Z,segmentBaseController:e.segmentBaseController,type:x}),_=(0,K.Z)(A).create({streamInfo:D,type:x,timelineConverter:P,dashMetrics:Y,mediaPlayerModel:L,baseURLController:e.baseURLController,errHandler:N,segmentsController:T,settings:$,boxParser:Q,events:l.Z,eventBus:C,errors:I,debug:(0,d.Z)(A).getInstance(),requestModifier:(0,W.Z)(A).getInstance(),dashConstants:s.Z,constants:a.Z,urlUtils:(0,X.Z)(A).getInstance()}),r=D.manifestInfo.isDynamic,_.initialize(r),B.registerStreamType(x,t),g=z(A).create({streamInfo:D,type:x,abrController:B,dashMetrics:Y,playbackController:j,timelineConverter:P,dashConstants:s.Z,events:l.Z,eventBus:C,errors:I,isDynamic:r,adapter:M,segmentsController:T}),h=function(e,t){return e?e!==a.Z.TEXT||t?U(A).create({streamInfo:D,type:e,mediaPlayerModel:L,manifestModel:k,fragmentModel:F,errHandler:N,mediaController:H,representationController:g,adapter:M,textController:V,abrController:B,playbackController:j,settings:$}):q(A).create({streamInfo:D,type:e,mimeType:O,fragmentModel:F,textController:V,errHandler:N,settings:$}):(N.error(new E.Z(I.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,I.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+"not properly defined")),null)}(x,o),h&&h.initialize(n),(p=G(A).create({streamInfo:D,type:x,mimeType:O,adapter:M,dashMetrics:Y,mediaPlayerModel:L,fragmentModel:F,abrController:B,playbackController:j,textController:V,mediaController:H,bufferController:h,representationController:g,settings:$})).initialize(i),S=0,m=!1,y=!1},getStreamId:re,getType:ie,isUpdating:function(){return!!g&&g.isUpdating()},getBufferController:function(){return h},dischargePreBuffer:function(){h.dischargePreBuffer()},getFragmentModel:function(){return F},getScheduleController:Ie,getRepresentationController:function(){return g},getRepresentationInfo:Ce,getBufferLevel:function(){return h?h.getBufferLevel():0},isBufferingCompleted:Re,createBufferSinks:function(e){var t=we();return t?Promise.resolve(t):h?h.createBufferSink(i,e):Promise.resolve(null)},updateStreamInfo:function(e){return D=e,Re()?Promise.resolve():h.updateAppendWindow()},getStreamInfo:function(){return D},selectMediaInfo:Ae,clearMediaInfoArray:function(){c=[]},addMediaInfo:function(e){-1===c.indexOf(e)&&c.push(e)},prepareTrackSwitch:function(){return new Promise((function(e){n.debug("Preparing track switch for type ".concat(x));var t=x===a.Z.TEXT||$.get().streaming.trackSwitchMode[x]===a.Z.TRACK_SWITCH_MODE_ALWAYS_REPLACE&&j.getTimeToStreamEnd(D)>$.get().streaming.buffer.stallThreshold;if(h.getIsBufferingCompleted()&&!t)return h.prepareForNonReplacementTrackSwitch(i.codec).then((function(){C.trigger(l.Z.BUFFERING_COMPLETED,{},{streamId:D.id,mediaType:x})})).catch((function(){C.trigger(l.Z.BUFFERING_COMPLETED,{},{streamId:D.id,mediaType:x})})),void e();p.clearScheduleTimer(),p.setSwitchTrack(!0),t?(C.trigger(l.Z.BUFFER_REPLACEMENT_STARTED,{mediaType:x,streamId:D.id},{mediaType:x,streamId:D.id}),F.abortRequests(),h.prepareForReplacementTrackSwitch(i.codec).then((function(){var e=Ce();return h.updateBufferTimestampOffset(e)})).then((function(){Ne(),e()})).catch((function(){Ne(),e()}))):h.prepareForNonReplacementTrackSwitch(i.codec).then((function(){Oe(),e()})).catch((function(){Oe(),e()}))}))},prepareQualityChange:function(e){w&&n.warning("Canceling queued representation switch to ".concat(w.quality," for ").concat(x)),n.debug("Preparing quality switch for type ".concat(x));var t=e.newQuality;v=!0,p.clearScheduleTimer(),g.prepareQualityChange(t);var r=Ce(t);e.reason&&e.reason.forceReplace?function(e){F.abortRequests(),C.trigger(l.Z.BUFFER_REPLACEMENT_STARTED,{mediaType:x,streamId:D.id},{mediaType:x,streamId:D.id}),p.setCheckPlaybackQuality(!1),h.prepareForForceReplacementQualitySwitch(e).then((function(){Ne(),w=null,v=!1})).catch((function(){Ne(),w=null,v=!1}))}(r):e&&e.reason&&e.reason.forceAbandon?function(e){h.updateBufferTimestampOffset(e).then((function(){F.abortRequests(),y=!0,p.setCheckPlaybackQuality(!1),p.startScheduleTimer(),v=!1,w=null})).catch((function(){w=null,v=!1}))}(r):$.get().streaming.buffer.fastSwitchEnabled?function(e){var t=j.getTime(),n=1.5*(isNaN(e.fragmentDuration)?1:e.fragmentDuration),r=F.getRequests({state:b.FRAGMENT_MODEL_EXECUTED,time:t+n,threshold:0})[0];if(r&&!ae()){var i=h.getBufferLevel(),a=B.getAbandonmentStateFor(D.id,x);r.quality<e.quality&&i>=n&&a!==o.Z.ABANDON_LOAD?h.updateBufferTimestampOffset(e).then((function(){F.abortRequests(),Me(t+n),p.setCheckPlaybackQuality(!1),p.startScheduleTimer(),v=!1})).catch((function(){v=!1})):ve(e)}else ve(e)}(r):ve(r),Y.pushPlayListTraceMetrics(new Date,J.REPRESENTATION_SWITCH_STOP_REASON),Y.createPlaylistTraceMetrics(r.id,1e3*j.getTime(),j.getPlaybackRate())},getMediaInfo:function(){return i},getMediaSource:function(){return h.getMediaSource()},setMediaSource:function(e){return h.setMediaSource(e,i)},getBuffer:we,setExplicitBufferingTime:Me,finalisePlayList:function(e,t){Y.pushPlayListTraceMetrics(e,t)},probeNextRequest:function(){var e=Ce(),t=g&&e?g.getRepresentationForQuality(e.quality):null;return _.getNextSegmentRequestIdempotent(i,t)},prepareInnerPeriodPlaybackSeeking:function(e){return new Promise((function(t){if(h.hasBufferAtTime(e.seekTime))return h.pruneBuffer(),oe(h.getContinuousBufferTimeForTargetTime(e.seekTime))&&h.setIsBufferingCompleted(!0),void t();p.clearScheduleTimer(),F.abortRequests(),h.prepareForPlaybackSeek().then((function(){var t=h.getAllRangesWithSafetyFactor(e.seekTime);return h.clearBuffers(t)})).then((function(){var n=h.getContinuousBufferTimeForTargetTime(e.seekTime);if(oe(n))h.setIsBufferingCompleted(!0),t();else{var r=isNaN(n)?e.seekTime:n;Me(r),h.setSeekTarget(r);var i=[];i.push(h.updateAppendWindow());var a=Ce();i.push(h.updateBufferTimestampOffset(a)),Promise.all(i).then((function(){p.setInitSegmentRequired(!0),p.setCheckPlaybackQuality(!1),p.startScheduleTimer(),t()}))}})).catch((function(e){n.error(e)}))}))},prepareOuterPeriodPlaybackSeeking:function(){return new Promise((function(e,t){try{p.clearScheduleTimer(),F.abortRequests(),h.prepareForPlaybackSeek().then((function(){return h.pruneAllSafely()})).then((function(){e()}))}catch(e){t(e)}}))},reset:function(e,n){_&&_.reset(),h&&(h.reset(e,n),h=null),p&&(p.reset(),p=null),g&&(g.reset(),g=null),T&&(T=null),B&&B.unRegisterStreamType(re(),x),C.off(l.Z.DATA_UPDATE_COMPLETED,he,t),C.off(l.Z.INIT_FRAGMENT_NEEDED,ue,t),C.off(l.Z.MEDIA_FRAGMENT_NEEDED,le,t),C.off(l.Z.INIT_FRAGMENT_LOADED,De,t),C.off(l.Z.MEDIA_FRAGMENT_LOADED,xe,t),C.off(l.Z.BUFFER_LEVEL_STATE_CHANGED,pe,t),C.off(l.Z.BUFFER_CLEARED,ge,t),C.off(l.Z.SEEK_TARGET,Pe,t),C.off(l.Z.FRAGMENT_LOADING_ABANDONED,_e,t),C.off(l.Z.FRAGMENT_LOADING_COMPLETED,Te,t),C.off(l.Z.SET_FRAGMENTED_TEXT_AFTER_DISABLED,be,t),C.off(l.Z.SET_NON_FRAGMENTED_TEXT,Ee,t),C.off(l.Z.QUOTA_EXCEEDED,Se,t),C.off(l.Z.SOURCE_BUFFER_ERROR,me,t),C.off(l.Z.BYTES_APPENDED_END_FRAGMENT,ye,t),se(),x=null,D=null}},n=(0,d.Z)(A).getInstance().getLogger(t),se(),C.on(l.Z.DATA_UPDATE_COMPLETED,he,t,{priority:u.Z.EVENT_PRIORITY_HIGH}),C.on(l.Z.INIT_FRAGMENT_NEEDED,ue,t),C.on(l.Z.MEDIA_FRAGMENT_NEEDED,le,t),C.on(l.Z.INIT_FRAGMENT_LOADED,De,t),C.on(l.Z.MEDIA_FRAGMENT_LOADED,xe,t),C.on(l.Z.BUFFER_LEVEL_STATE_CHANGED,pe,t),C.on(l.Z.BUFFER_CLEARED,ge,t),C.on(l.Z.SEEK_TARGET,Pe,t),C.on(l.Z.FRAGMENT_LOADING_ABANDONED,_e,t),C.on(l.Z.FRAGMENT_LOADING_COMPLETED,Te,t),C.on(l.Z.QUOTA_EXCEEDED,Se,t),C.on(l.Z.SET_FRAGMENTED_TEXT_AFTER_DISABLED,be,t),C.on(l.Z.SET_NON_FRAGMENTED_TEXT,Ee,t),C.on(l.Z.SOURCE_BUFFER_ERROR,me,t),C.on(l.Z.BYTES_APPENDED_END_FRAGMENT,ye,t),t}re.__dashjs_factory_name="StreamProcessor";var ie=c.Z.getClassFactory(re),ae=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.streamId=null,this.mediaInfo=null,this.segmentType=null,this.quality=NaN,this.index=NaN,this.bytes=null,this.start=NaN,this.end=NaN,this.duration=NaN,this.representationId=null,this.endFragment=null},se=n(9032);function oe(e,t){if(e){if("string"==typeof e)return ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ue(e,t):void 0}}function ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function le(e){e=e||{};var t,n,r=this.context,i=e.requestModifier,s=e.lowLatencyThroughputModel,o=e.boxParser,u=(0,C.Z)(r).getInstance();function l(e){var t,r=new Date,l=e.request,f=new Headers;if(l.range&&f.append("Range","bytes="+l.range),e.headers)for(var h in e.headers){var p=e.headers[h];p&&f.append(h,p)}l.requestStartDate||(l.requestStartDate=r),i&&i.modifyRequestHeader&&i.modifyRequestHeader({setRequestHeader:function(e,t){f.append(e,t)}},{url:e.url}),"function"==typeof window.AbortController&&(t=new AbortController,e.abortController=t,t.signal.onabort=e.onabort);var g={method:e.method,headers:f,credentials:e.withCredentials?"include":void 0,signal:t?t.signal:void 0},m=u.get().streaming.abr.fetchThroughputCalculationMode,y=Date.now(),v=0;new Promise((function(e){if(m===a.Z.ABR_FETCH_THROUGHPUT_CALCULATION_AAST&&s&&(v=s.getThroughputCapacityDelayMS(l,1e3*n.getCurrentBufferLevel(l.mediaType))))return setTimeout(e,v);e()})).then((function(){var t=Date.now();fetch(e.url,g).then((function(r){e.response||(e.response={}),e.response.status=r.status,e.response.statusText=r.statusText,e.response.responseURL=r.url,r.ok||e.onerror();var i,u="",f=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=oe(e))){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}(r.headers.keys());try{for(f.s();!(i=f.n()).done;){var h=i.value;u+=h+": "+r.headers.get(h)+"\r\n"}}catch(e){f.e(e)}finally{f.f()}if(e.response.responseHeaders=u,!r.body)return r.arrayBuffer().then((function(t){e.response.response=t;var n={loaded:t.byteLength,total:t.byteLength,stream:!1};e.progress(n),e.onload(),e.onend()}));var p,g,_,T=parseInt(r.headers.get("Content-Length"),10),b=0,E=!1,S=new Uint8Array,w=0;if(m===a.Z.ABR_FETCH_THROUGHPUT_CALCULATION_AAST&&s){var A=t,I=0,C=(2,function(e){if(Array.isArray(e))return e}(_=r.body.tee())||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(n.push(s.value),2!==n.length);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==o.return||o.return()}finally{if(i)throw a}}return n}}(_)||oe(_,2)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),R=C[0],D=C[1];p=R.getReader(),g=[],p.read().then((function r(i){var a=i.value,o=i.done;if(I=Date.now(),a&&a.length){var c=I-A,d=a.length;g.push({chunkDownloadTimeRelativeMS:I-t,chunkDownloadDurationMS:c,chunkBytes:d,kbps:Math.round(8*d/(c/1e3)),bufferLevel:n.getCurrentBufferLevel(l.mediaType)})}if(o){var f=I-t,h=g.reduce((function(e,t){return e+t.chunkBytes}),0);return s.addMeasurement(l,f,g,y,v,u),void e.progress({loaded:h,total:h,lengthComputable:!0,time:s.getEstimatedDownloadDurationMS(l),stream:!0})}return A=Date.now(),p.read().then(r)})),e.reader=D.getReader()}else e.reader=r.body.getReader();var x=[],N=[],O=[],P=!0;c(e,(function t(n){var r=n.value;if(n.done){if(S){if(m!==a.Z.ABR_FETCH_THROUGHPUT_CALCULATION_AAST){var i=null,s=null;m===a.Z.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING?(i=function(e,t){try{var n,r;n=e.filter((function(t,n){return n<e.length-1})),r=t.filter((function(e,n){return n<t.length-1}));var i=[];if(n.length>1){for(var a=0,s=0,o=0;o<n.length;o++)if(n[o]&&r[o]){var u=r[o].ts-n[o].ts;if(u>1)i.push(8*r[o].bytes/u),s=0;else{0===s&&(s=n[o].ts,a=0);var l=r[o].ts-s;l>1?(a+=r[o].bytes,i.push(8*a/l),s=0):a+=r[o].bytes}}if(i.length>0)return i.reduce((function(e,t){return e+t}),0)/i.length}return null}catch(e){return null}}(N,O),i&&(s=8*b/i)):m===a.Z.ABR_FETCH_THROUGHPUT_CALCULATION_DOWNLOADED_DATA&&(s=d(x,b)),e.progress({loaded:b,total:isNaN(T)?b:T,lengthComputable:!0,time:s,stream:!0})}e.response.response=S.buffer}return e.onload(),void e.onend()}if(r&&r.length>0){S=function(e,t){if(0===e.length)return t;var n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}(S,r),b+=r.length,x.push({ts:Date.now(),bytes:r.length}),m===a.Z.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING&&P&&o.findLastTopIsoBoxCompleted(["moof"],S,w).found&&(P=!1,N.push({ts:performance.now(),bytes:r.length}));var u=o.findLastTopIsoBoxCompleted(["moov","mdat"],S,w);if(u.found){var l,f=u.lastCompletedOffset+u.size;m!==a.Z.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING||P||(P=!0,O.push({ts:performance.now(),bytes:S.length})),f===S.length?(l=S,S=new Uint8Array):(l=new Uint8Array(S.subarray(0,f)),S=S.subarray(f)),e.progress({data:l.buffer,lengthComputable:!1,noTrace:!0}),w=0}else w=u.lastCompletedOffset,E||(e.progress({lengthComputable:!1,noTrace:!0}),E=!0)}c(e,t)}))})).catch((function(t){e.onerror&&e.onerror(t)}))}))}function c(e,t){e.reader.read().then(t).catch((function(t){e.onerror&&200===e.response.status&&e.onerror(t)}))}function d(e,t){try{if((e=e.filter((function(n){return n.bytes>t/4/e.length}))).length>1){var n=0,r=(e[e.length-1].ts-e[0].ts)/e.length;return e.forEach((function(t,i){var a=e[i+1];if(a){var s=a.ts-t.ts;n+=s<r?s:0}})),n}return null}catch(e){return null}}return t={load:function(e){i&&i.modifyRequest?(0,W.k)(e,i).then((function(){return l(e)})):l(e)},abort:function(e){if(e.abortController)e.abortController.abort();else if(e.reader)try{e.reader.cancel(),e.onabort()}catch(e){}},calculateDownloadedTime:d,setup:function(e){n=e.dashMetrics}},t}le.__dashjs_factory_name="FetchLoader";var ce=c.Z.getClassFactory(le),de=n(1180);var fe=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=-1,this.adaptation=null,this.segmentInfoType=null,this.initialization=null,this.codecs=null,this.mimeType=null,this.codecPrivateData=null,this.segmentDuration=NaN,this.timescale=1,this.startNumber=1,this.indexRange=null,this.range=null,this.presentationTimeOffset=0,this.MSETimeOffset=NaN,this.mediaFinishedInformation={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN},this.bandwidth=NaN,this.width=NaN,this.height=NaN,this.scanType=null,this.maxPlayoutRate=NaN,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0,this.frameRate=null}var t;return(t=[{key:"hasInitialization",value:function(){return null!==this.initialization||null!==this.range}},{key:"hasSegments",value:function(){return this.segmentInfoType!==s.Z.BASE_URL&&this.segmentInfoType!==s.Z.SEGMENT_BASE&&!this.indexRange}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}(),he=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.period=null,this.index=-1,this.type=null},pe=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=-1,this.duration=NaN,this.start=NaN,this.mpd=null,this.nextPeriodId=null};pe.DEFAULT_ID="defaultId";var ge=pe,me=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.manifest=null,this.suggestedPresentationDelay=0,this.availabilityStartTime=null,this.availabilityEndTime=Number.POSITIVE_INFINITY,this.timeShiftBufferDepth=Number.POSITIVE_INFINITY,this.maxSegmentDuration=Number.POSITIVE_INFINITY,this.publishTime=null,this.minimumUpdatePeriod=NaN,this.mediaPresentationDuration=NaN},ye=n(2610),ve=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type="",this.duration=NaN,this.presentationTime=NaN,this.id=NaN,this.messageData="",this.eventStream=null,this.presentationTimeDelta=NaN},_e=function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t||"",this.serviceLocation=n||t||"",this.dvb_priority=r||1,this.dvb_weight=i||1,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0,this.queryParams={}};_e.DEFAULT_DVB_PRIORITY=1,_e.DEFAULT_DVB_WEIGHT=1;var Te=_e,be=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.adaptionSet=null,this.representation=null,this.period=null,this.timescale=1,this.value="",this.schemeIdUri="",this.presentationTimeOffset=0},Ee=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.inband=!1,this.type="encoder",this.applicationScheme=null,this.wallClockTime=null,this.presentationTime=NaN,this.UTCTiming=null},Se=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.defaultServiceLocation=null,this.defaultServiceLocationArray=[],this.queryBeforeStart=!1,this.serverUrl=null,this.clientRequirement=!0};var we=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schemeIdUri=null,this.value=null,this.id=null}var t;return(t=[{key:"init",value:function(e){return e&&(this.schemeIdUri=e.schemeIdUri?e.schemeIdUri:null,this.value=e.value?e.value:null,this.id=e.id?e.id:null),this}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}(),Ae=n(3101),Ie=n.n(Ae);function Ce(){return{areEqual:function(e,t){return Ie()(e,t)}}}Ce.__dashjs_factory_name="ObjectUtils";var Re=c.Z.getSingletonFactory(Ce),De=n(7803),xe=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t||"",this.serviceLocation=n||null,this.queryParams={}},Ne=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t||"",this.serviceLocation=n||null,this.ttl=r||NaN,this.queryParams={}};function Oe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=Pe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function Pe(e,t){if(e){if("string"==typeof e)return Me(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Me(e,t):void 0}}function Me(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ke(){var e,t,n,r,i=this.context,o=(0,X.Z)(i).getInstance(),u=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function l(e,t){if(!e)throw new Error("adaptation is not defined");if(!t)throw new Error("type is not defined");if(e.Representation_asArray&&e.Representation_asArray.length){var n=_(e.Representation_asArray[0]);if(n&&n.length>0&&De.Y.indexOf(n[0].schemeIdUri)>=0)return t===a.Z.IMAGE}if(e.ContentComponent_asArray&&e.ContentComponent_asArray.length>0){if(e.ContentComponent_asArray.length>1)return t===a.Z.MUXED;if(e.ContentComponent_asArray[0].contentType===t)return!0}var r=t===a.Z.TEXT?new RegExp("(ttml|vtt|wvtt|stpp)"):new RegExp(t);if(e.Representation_asArray&&e.Representation_asArray.length){var i=e.Representation_asArray[0].codecs;if(r.test(i))return!0}if(e.hasOwnProperty(s.Z.MIME_TYPE))return r.test(e.mimeType);if(e.Representation_asArray)for(var o,u=0;u<e.Representation_asArray.length;u++)if((o=e.Representation_asArray[u]).hasOwnProperty(s.Z.MIME_TYPE))return r.test(o.mimeType);return!1}function c(e){if(!e)throw new Error("adaptation is not defined");if(e.hasOwnProperty(s.Z.SEGMENT_TEMPLATE)||e.hasOwnProperty(s.Z.SEGMENT_TIMELINE)||e.hasOwnProperty(s.Z.SEGMENT_LIST)||e.hasOwnProperty(s.Z.SEGMENT_BASE))return!0;if(e.Representation_asArray&&e.Representation_asArray.length>0){var t=e.Representation_asArray[0];if(t.hasOwnProperty(s.Z.SEGMENT_TEMPLATE)||t.hasOwnProperty(s.Z.SEGMENT_TIMELINE)||t.hasOwnProperty(s.Z.SEGMENT_LIST)||t.hasOwnProperty(s.Z.SEGMENT_BASE))return!0}return!1}function f(e){return l(e,a.Z.VIDEO)}function h(e){return l(e,a.Z.TEXT)}function p(e){return l(e,a.Z.IMAGE)}function g(e){return e&&Array.isArray(e.Representation_asArray)&&e.Representation_asArray.sort((function(e,t){return e.bandwidth-t.bandwidth})),e}function m(e,t){return e&&e.Period_asArray&&u(t)&&e.Period_asArray[t]?e.Period_asArray[t].AdaptationSet_asArray:[]}function y(e){return e&&e.Period_asArray?e.Period_asArray:[]}function v(e){var t=!1;return e&&e.hasOwnProperty("type")&&(t=e.type===s.Z.DYNAMIC),t}function _(e){return e&&e.EssentialProperty_asArray&&e.EssentialProperty_asArray.length?e.EssentialProperty_asArray.map((function(e){return{schemeIdUri:e.schemeIdUri,value:e.value}})):null}function T(e){if(!e||!e.S_asArray)return NaN;var t=e.S_asArray[0],n=e.S_asArray[1];return t.hasOwnProperty("d")?t.d:n.t-t.t}function b(e,t){if(!e)throw new Error("Period cannot be null or undefined");var n=ge.DEFAULT_ID+"_"+t;return e.hasOwnProperty(s.Z.ID)&&e.id.length>0&&"__proto__"!==e.id&&(n=e.id),n}function S(e,t,n){var r,i=[];if(!e)return i;for(r=0;r<e.length;r++){var o=new be;if(o.timescale=1,o.representation=t,!e[r].hasOwnProperty(a.Z.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");o.schemeIdUri=e[r].schemeIdUri,e[r].hasOwnProperty(s.Z.TIMESCALE)&&(o.timescale=e[r].timescale),e[r].hasOwnProperty(s.Z.VALUE)&&(o.value=e[r].value),i.push(o),o.period=n}return i}function w(e){var t=[],n=e.BaseURL_asArray||[e.baseUri],r=!1;return n.some((function(n){if(n){var i=new Te,a=n.__text||n;return o.isRelative(a)&&(r=!0,e.baseUri&&(a=o.resolve(a,e.baseUri))),i.url=a,n.hasOwnProperty(s.Z.SERVICE_LOCATION)&&n.serviceLocation.length?i.serviceLocation=n.serviceLocation:i.serviceLocation=a,n.hasOwnProperty(s.Z.DVB_PRIORITY)&&(i.dvb_priority=n[s.Z.DVB_PRIORITY]),n.hasOwnProperty(s.Z.DVB_WEIGHT)&&(i.dvb_weight=n[s.Z.DVB_WEIGHT]),n.hasOwnProperty(s.Z.AVAILABILITY_TIME_OFFSET)&&(i.availabilityTimeOffset=n[s.Z.AVAILABILITY_TIME_OFFSET]),n.hasOwnProperty(s.Z.AVAILABILITY_TIME_COMPLETE)&&(i.availabilityTimeComplete="false"!==n[s.Z.AVAILABILITY_TIME_COMPLETE]),t.push(i),r}})),t}function A(e){var t=new Se;return t.serverUrl=e.__text,e.hasOwnProperty(s.Z.DEFAULT_SERVICE_LOCATION)&&(t.defaultServiceLocation=e[s.Z.DEFAULT_SERVICE_LOCATION],t.defaultServiceLocationArray=t.defaultServiceLocation.split(" ")),e.hasOwnProperty(s.Z.QUERY_BEFORE_START)&&(t.queryBeforeStart="true"===e[s.Z.QUERY_BEFORE_START].toLowerCase()),e.hasOwnProperty(s.Z.CLIENT_REQUIREMENT)&&(t.clientRequirement="false"!==e[s.Z.CLIENT_REQUIREMENT].toLowerCase()),t}return e={getIsTypeOf:l,getIsText:h,getIsFragmented:c,getProducerReferenceTimesForAdaptation:function(e){var t=e&&e.hasOwnProperty(s.Z.PRODUCERREFERENCETIME_ASARRAY)?e[s.Z.PRODUCERREFERENCETIME_ASARRAY]:[];(e&&e.hasOwnProperty(s.Z.REPRESENTATION_ASARRAY)?e[s.Z.REPRESENTATION_ASARRAY]:[]).forEach((function(e){var n;e.hasOwnProperty(s.Z.PRODUCERREFERENCETIME_ASARRAY)&&t.push.apply(t,function(e){if(Array.isArray(e))return Me(e)}(n=e[s.Z.PRODUCERREFERENCETIME_ASARRAY])||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(n)||Pe(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}));var n=[];return t.forEach((function(e){var t=new Ee;e.hasOwnProperty(s.Z.ID)&&(t[s.Z.ID]=e[s.Z.ID],e.hasOwnProperty(s.Z.WALL_CLOCK_TIME)&&(t[s.Z.WALL_CLOCK_TIME]=e[s.Z.WALL_CLOCK_TIME],e.hasOwnProperty(s.Z.PRESENTATION_TIME)&&(t[s.Z.PRESENTATION_TIME]=e[s.Z.PRESENTATION_TIME],e.hasOwnProperty(s.Z.INBAND)&&(t[s.Z.INBAND]="false"!==e[s.Z.INBAND]),e.hasOwnProperty(s.Z.TYPE)&&(t[s.Z.TYPE]=e[s.Z.TYPE]),n.push(t))))})),n},getLanguageForAdaptation:function(e){var t="";return e&&e.hasOwnProperty(s.Z.LANG)&&(t=e.lang),t},getViewpointForAdaptation:function(e){return e&&e.hasOwnProperty(s.Z.VIEWPOINT_ASARRAY)&&e[s.Z.VIEWPOINT_ASARRAY].length?e[s.Z.VIEWPOINT_ASARRAY].map((function(e){return(new we).init(e)})):[]},getRolesForAdaptation:function(e){return e&&e.hasOwnProperty(s.Z.ROLE_ASARRAY)&&e[s.Z.ROLE_ASARRAY].length?e[s.Z.ROLE_ASARRAY].map((function(e){return(new we).init(e)})):[]},getAccessibilityForAdaptation:function(e){return e&&e.hasOwnProperty(s.Z.ACCESSIBILITY_ASARRAY)&&e[s.Z.ACCESSIBILITY_ASARRAY].length?e[s.Z.ACCESSIBILITY_ASARRAY].map((function(e){return(new we).init(e)})):[]},getAudioChannelConfigurationForAdaptation:function(e){return e&&e.hasOwnProperty(s.Z.AUDIOCHANNELCONFIGURATION_ASARRAY)&&e[s.Z.AUDIOCHANNELCONFIGURATION_ASARRAY].length?e[s.Z.AUDIOCHANNELCONFIGURATION_ASARRAY].map((function(e){return(new we).init(e)})):[]},getAudioChannelConfigurationForRepresentation:function(e){return e&&e.hasOwnProperty(s.Z.AUDIOCHANNELCONFIGURATION_ASARRAY)&&e[s.Z.AUDIOCHANNELCONFIGURATION_ASARRAY].length?e[s.Z.AUDIOCHANNELCONFIGURATION_ASARRAY].map((function(e){return(new we).init(e)})):[]},getAdaptationForIndex:function(e,t,n){var r=m(t,n);return r.length>0&&u(e)?r[e]:null},getIndexForAdaptation:function(e,t,n){if(!e)return-1;for(var r=m(t,n),a=0;a<r.length;a++)if(Re(i).getInstance().areEqual(r[a],e))return a;return-1},getAdaptationForId:function(e,t,n){var r,i,a=m(t,n);for(r=0,i=a.length;r<i;r++)if(a[r].hasOwnProperty(s.Z.ID)&&a[r].id===e)return a[r];return null},getAdaptationsForType:function(e,t,n){var r,i,a=m(e,t),s=[];for(r=0,i=a.length;r<i;r++)l(a[r],n)&&s.push(g(a[r]));return s},getRealPeriods:y,getRealPeriodForIndex:function(e,t){var n=y(t);return n.length>0&&u(e)?n[e]:null},getCodec:function(e,t,n){var r=null;if(e&&e.Representation_asArray&&e.Representation_asArray.length>0){var i=u(t)&&t>=0&&t<e.Representation_asArray.length?e.Representation_asArray[t]:e.Representation_asArray[0];i&&(r=i.mimeType+';codecs="'+i.codecs+'"',n&&void 0!==i.width&&(r+=';width="'+i.width+'";height="'+i.height+'"'))}return r&&(r=r.replace(/\sprofiles=[^;]*/g,"")),r},getSelectionPriority:function(e){try{var t=e&&void 0!==e.selectionPriority?parseInt(e.selectionPriority):1;return isNaN(t)?1:t}catch(e){return 1}},getMimeType:function(e){return e&&e.Representation_asArray&&e.Representation_asArray.length>0?e.Representation_asArray[0].mimeType:null},getKID:function(e){return e&&e.hasOwnProperty(s.Z.CENC_DEFAULT_KID)?e[s.Z.CENC_DEFAULT_KID]:null},getLabelsForAdaptation:function(e){if(!e||!Array.isArray(e.Label_asArray))return[];for(var t=[],n=0;n<e.Label_asArray.length;n++)t.push({lang:e.Label_asArray[n].lang,text:e.Label_asArray[n].__text||e.Label_asArray[n]});return t},getContentProtectionData:function(e){return e&&e.hasOwnProperty(s.Z.CONTENTPROTECTION_ASARRAY)&&0!==e.ContentProtection_asArray.length?e.ContentProtection_asArray:null},getIsDynamic:v,getId:function(e){return e&&e[s.Z.ID]||null},hasProfile:function(e,t){var n=!1;return e&&e.profiles&&e.profiles.length>0&&(n=-1!==e.profiles.indexOf(t)),n},getDuration:function(e){return e&&e.hasOwnProperty(s.Z.MEDIA_PRESENTATION_DURATION)?e.mediaPresentationDuration:e&&"dynamic"==e.type?Number.POSITIVE_INFINITY:Number.MAX_SAFE_INTEGER||Number.MAX_VALUE},getBandwidth:function(e){return e&&e.bandwidth?e.bandwidth:NaN},getManifestUpdatePeriod:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=NaN;return e&&e.hasOwnProperty(s.Z.MINIMUM_UPDATE_PERIOD)&&(n=e.minimumUpdatePeriod),isNaN(n)?n:Math.max(n-t,1)},getPublishTime:function(e){return e&&e.hasOwnProperty(s.Z.PUBLISH_TIME)?new Date(e[s.Z.PUBLISH_TIME]):null},getRepresentationCount:function(e){return e&&Array.isArray(e.Representation_asArray)?e.Representation_asArray.length:0},getBitrateListForAdaptation:function(e){var t=g(e);return(t&&Array.isArray(t.Representation_asArray)?t.Representation_asArray:[]).map((function(e){return{bandwidth:e.bandwidth,width:e.width||0,height:e.height||0,scanType:e.scanType||null,id:e.id||null}}))},getRepresentationFor:function(e,t){return t&&t.Representation_asArray&&t.Representation_asArray.length>0&&u(e)?t.Representation_asArray[e]:null},getRepresentationsForAdaptation:function(e){var t,n,r,i,a=[],o=function(e){if(e&&e.period&&u(e.period.index)){var t=e.period.mpd.manifest.Period_asArray[e.period.index];if(t&&t.AdaptationSet_asArray&&u(e.index))return g(t.AdaptationSet_asArray[e.index])}}(e);if(o&&o.Representation_asArray){if(e&&e.period&&u(e.period.index)){var l=w(e.period.mpd.manifest);l&&(n=l[0])}for(var d=0,f=o.Representation_asArray.length;d<f;++d){var p=o.Representation_asArray[d],m=new fe;if(m.index=d,m.adaptation=e,p.hasOwnProperty(s.Z.ID)&&(m.id=p.id),p.hasOwnProperty(s.Z.CODECS)&&(m.codecs=p.codecs),p.hasOwnProperty(s.Z.MIME_TYPE)&&(m.mimeType=p[s.Z.MIME_TYPE]),p.hasOwnProperty(s.Z.CODEC_PRIVATE_DATA)&&(m.codecPrivateData=p.codecPrivateData),p.hasOwnProperty(s.Z.BANDWITH)&&(m.bandwidth=p.bandwidth),p.hasOwnProperty(s.Z.WIDTH)&&(m.width=p.width),p.hasOwnProperty(s.Z.HEIGHT)&&(m.height=p.height),p.hasOwnProperty(s.Z.SCAN_TYPE)&&(m.scanType=p.scanType),p.hasOwnProperty(s.Z.MAX_PLAYOUT_RATE)&&(m.maxPlayoutRate=p.maxPlayoutRate),p.hasOwnProperty(s.Z.SEGMENT_BASE)?(t=p.SegmentBase,m.segmentInfoType=s.Z.SEGMENT_BASE):p.hasOwnProperty(s.Z.SEGMENT_LIST)?(t=p.SegmentList).hasOwnProperty(s.Z.SEGMENT_TIMELINE)?m.segmentInfoType=s.Z.SEGMENT_TIMELINE:m.segmentInfoType=s.Z.SEGMENT_LIST:p.hasOwnProperty(s.Z.SEGMENT_TEMPLATE)?((t=p.SegmentTemplate).hasOwnProperty(s.Z.SEGMENT_TIMELINE)?m.segmentInfoType=s.Z.SEGMENT_TIMELINE:m.segmentInfoType=s.Z.SEGMENT_TEMPLATE,t.hasOwnProperty(s.Z.INITIALIZATION_MINUS)&&(m.initialization=t.initialization.split("$Bandwidth$").join(p.bandwidth).split("$RepresentationID$").join(p.id))):m.segmentInfoType=s.Z.BASE_URL,m.essentialProperties=_(p),t){if(t.hasOwnProperty(s.Z.INITIALIZATION)){var y=t.Initialization;y.hasOwnProperty(s.Z.SOURCE_URL)&&(m.initialization=y.sourceURL),y.hasOwnProperty(s.Z.RANGE)&&(m.range=y.range)}else h(o)&&c(o)&&o.mimeType&&-1===o.mimeType.indexOf("application/mp4")&&(m.range=0);t.hasOwnProperty(s.Z.TIMESCALE)&&(m.timescale=t.timescale),t.hasOwnProperty(s.Z.DURATION)?m.segmentDuration=t.duration/m.timescale:p.hasOwnProperty(s.Z.SEGMENT_TEMPLATE)&&(t=p.SegmentTemplate).hasOwnProperty(s.Z.SEGMENT_TIMELINE)&&(m.segmentDuration=T(t.SegmentTimeline)/m.timescale),t.hasOwnProperty(s.Z.MEDIA)&&(m.media=t.media),t.hasOwnProperty(s.Z.START_NUMBER)&&(m.startNumber=t.startNumber),t.hasOwnProperty(s.Z.INDEX_RANGE)&&(m.indexRange=t.indexRange),t.hasOwnProperty(s.Z.PRESENTATION_TIME_OFFSET)&&(m.presentationTimeOffset=t.presentationTimeOffset/m.timescale),t.hasOwnProperty(s.Z.AVAILABILITY_TIME_OFFSET)?m.availabilityTimeOffset=t.availabilityTimeOffset:n&&void 0!==n.availabilityTimeOffset&&(m.availabilityTimeOffset=n.availabilityTimeOffset),t.hasOwnProperty(s.Z.AVAILABILITY_TIME_COMPLETE)?m.availabilityTimeComplete="false"!==t.availabilityTimeComplete:n&&void 0!==n.availabilityTimeComplete&&(m.availabilityTimeComplete=n.availabilityTimeComplete)}m.MSETimeOffset=(i=(r=m).presentationTimeOffset,r.adaptation.period.start-i),m.path=[e.period.index,e.index,d],a.push(m)}}return a},getAdaptationsForPeriod:function(e){var n,r,i,o=e&&u(e.index)?e.mpd.manifest.Period_asArray[e.index]:null,c=[];if(o&&o.AdaptationSet_asArray)for(i=0;i<o.AdaptationSet_asArray.length;i++)r=o.AdaptationSet_asArray[i],n=new he,r.hasOwnProperty(s.Z.ID)&&(n.id=r.id),n.index=i,n.period=e,l(r,a.Z.MUXED)?n.type=a.Z.MUXED:l(r,a.Z.AUDIO)?n.type=a.Z.AUDIO:f(r)?n.type=a.Z.VIDEO:h(r)?n.type=a.Z.TEXT:p(r)?n.type=a.Z.IMAGE:t.warn("Unknown Adaptation stream type"),c.push(n);return c},getRegularPeriods:function(e){var r,i,o=!!e&&v(e.manifest),u=[],l=null,c=null,d=null,f=null;for(i=0,r=e&&e.manifest&&e.manifest.Period_asArray?e.manifest.Period_asArray.length:0;i<r;i++)(c=e.manifest.Period_asArray[i]).hasOwnProperty(s.Z.START)?(f=new ge).start=c.start:null!==l&&l.hasOwnProperty(s.Z.DURATION)&&null!==d?(f=new ge).start=parseFloat((d.start+d.duration).toFixed(5)):0!==i||o||((f=new ge).start=0),null!==d&&isNaN(d.duration)&&(null!==f?d.duration=parseFloat((f.start-d.start).toFixed(5)):t.warn("First period duration could not be calculated because lack of start and duration period properties. This will cause timing issues during playback")),null!==f&&(f.id=b(c,i),f.index=i,f.mpd=e,c.hasOwnProperty(s.Z.DURATION)&&(f.duration=c.duration),d&&(d.nextPeriodId=f.id),u.push(f),l=c,d=f),c=null,f=null;return 0===u.length||null!==d&&isNaN(d.duration)&&(d.duration=parseFloat((function(e){!function(){if(!n||!n.hasOwnProperty("error"))throw new Error(a.Z.MISSING_CONFIG_ERROR)}();var t,r=v(e.mpd.manifest);return e.mpd.manifest.mediaPresentationDuration?t=e.mpd.manifest.mediaPresentationDuration:e.duration?t=e.duration:r?t=Number.POSITIVE_INFINITY:n.error(new E.Z(I.MANIFEST_ERROR_ID_PARSE_CODE,"Must have @mediaPresentationDuration on MPD or an explicit @duration on the last period.",e)),t}(d)-d.start).toFixed(5))),u},getMpd:function(e){var t=new me;return e&&(t.manifest=e,e.hasOwnProperty(s.Z.AVAILABILITY_START_TIME)?t.availabilityStartTime=new Date(e.availabilityStartTime.getTime()):e.loadedTime&&(t.availabilityStartTime=new Date(e.loadedTime.getTime())),e.hasOwnProperty(s.Z.AVAILABILITY_END_TIME)&&(t.availabilityEndTime=new Date(e.availabilityEndTime.getTime())),e.hasOwnProperty(s.Z.MINIMUM_UPDATE_PERIOD)&&(t.minimumUpdatePeriod=e.minimumUpdatePeriod),e.hasOwnProperty(s.Z.MEDIA_PRESENTATION_DURATION)&&(t.mediaPresentationDuration=e.mediaPresentationDuration),e.hasOwnProperty(s.Z.SUGGESTED_PRESENTATION_DELAY)&&(t.suggestedPresentationDelay=e.suggestedPresentationDelay),e.hasOwnProperty(s.Z.TIMESHIFT_BUFFER_DEPTH)&&(t.timeShiftBufferDepth=e.timeShiftBufferDepth),e.hasOwnProperty(s.Z.MAX_SEGMENT_DURATION)&&(t.maxSegmentDuration=e.maxSegmentDuration),e.hasOwnProperty(s.Z.PUBLISH_TIME)&&(t.publishTime=new Date(e.publishTime))),t},getEventsForPeriod:function(e){var t,n,i=e&&e.mpd&&e.mpd.manifest?e.mpd.manifest:null,o=i?i.Period_asArray:null,l=o&&e&&u(e.index)?o[e.index].EventStream_asArray:null,c=[];if(l)for(t=0;t<l.length;t++){var d=new be;if(d.period=e,d.timescale=1,!l[t].hasOwnProperty(a.Z.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");for(d.schemeIdUri=l[t][a.Z.SCHEME_ID_URI],l[t].hasOwnProperty(s.Z.TIMESCALE)&&(d.timescale=l[t][s.Z.TIMESCALE]),l[t].hasOwnProperty(s.Z.VALUE)&&(d.value=l[t][s.Z.VALUE]),l[t].hasOwnProperty(s.Z.PRESENTATION_TIME_OFFSET)&&(d.presentationTimeOffset=l[t][s.Z.PRESENTATION_TIME_OFFSET]),n=0;l[t].Event_asArray&&n<l[t].Event_asArray.length;n++){var f=l[t].Event_asArray[n],h=new ve;h.presentationTime=0,h.eventStream=d,f.hasOwnProperty(s.Z.PRESENTATION_TIME)&&(h.presentationTime=f.presentationTime);var p=d.presentationTimeOffset?d.presentationTimeOffset/d.timescale:0;h.calculatedPresentationTime=h.presentationTime/d.timescale+e.start-p,f.hasOwnProperty(s.Z.DURATION)&&(h.duration=f.duration/d.timescale),f.hasOwnProperty(s.Z.ID)?h.id=f.id:h.id=null,f.Signal&&f.Signal.Binary?h.messageData=r.decodeArray(f.Signal.Binary.toString()):h.messageData=f.messageData||f.__cdata||f.__text,c.push(h)}}return c},getEssentialPropertiesForRepresentation:_,getEventStreamForAdaptationSet:function(e,t,n){var r,i,a;return e&&e.Period_asArray&&t&&t.period&&u(t.period.index)&&(i=e.Period_asArray[t.period.index])&&i.AdaptationSet_asArray&&u(t.index)&&(a=i.AdaptationSet_asArray[t.index])&&(r=a.InbandEventStream_asArray),S(r,null,n)},getEventStreamForRepresentation:function(e,t,n){var r,i,a,s;return e&&e.Period_asArray&&t&&t.adaptation&&t.adaptation.period&&u(t.adaptation.period.index)&&(i=e.Period_asArray[t.adaptation.period.index])&&i.AdaptationSet_asArray&&u(t.adaptation.index)&&(a=i.AdaptationSet_asArray[t.adaptation.index])&&a.Representation_asArray&&u(t.index)&&(s=a.Representation_asArray[t.index])&&(r=s.InbandEventStream_asArray),S(r,t,n)},getUTCTimingSources:function(e){var t=v(e),n=!!e&&e.hasOwnProperty(s.Z.AVAILABILITY_START_TIME),r=e?e.UTCTiming_asArray:null,i=[];return(t||n)&&r&&r.forEach((function(e){var t=new ye.Z;e.hasOwnProperty(a.Z.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty(s.Z.VALUE)&&(t.value=e.value.toString(),i.push(t)))})),i},getBaseURLsFromElement:w,getRepresentationSortFunction:function(){return function(e,t){return e.bandwidth-t.bandwidth}},getContentSteering:function(e){if(e&&e.hasOwnProperty(s.Z.CONTENT_STEERING_AS_ARRAY))return A(e[s.Z.CONTENT_STEERING_AS_ARRAY][0])},getLocation:function(e){return e&&e.hasOwnProperty(s.Z.LOCATION_AS_ARRAY)?e[s.Z.LOCATION_AS_ARRAY].map((function(e){var t=e.__text||e,n=e.hasOwnProperty(s.Z.SERVICE_LOCATION)?e[s.Z.SERVICE_LOCATION]:null;return new xe(t,n)})):[]},getPatchLocation:function(e){return e&&e.hasOwnProperty(s.Z.PATCH_LOCATION_AS_ARRAY)?e[s.Z.PATCH_LOCATION_AS_ARRAY].map((function(e){var t=e.__text||e,n=e.hasOwnProperty(s.Z.SERVICE_LOCATION)?e[s.Z.SERVICE_LOCATION]:null,r=e.hasOwnProperty(s.Z.TTL)?1e3*parseFloat(e[s.Z.TTL]):NaN;return new Ne(t,n,r)})):[]},getSuggestedPresentationDelay:function(e){return e&&e.hasOwnProperty(s.Z.SUGGESTED_PRESENTATION_DELAY)?e.suggestedPresentationDelay:null},getAvailabilityStartTime:function(e){return e&&e.hasOwnProperty(s.Z.AVAILABILITY_START_TIME)&&null!==e.availabilityStartTime?e.availabilityStartTime.getTime():null},getServiceDescriptions:function(e){var t=[];if(e&&e.hasOwnProperty(s.Z.SERVICE_DESCRIPTION)){var n,r=Oe(e.ServiceDescription_asArray);try{for(r.s();!(n=r.n()).done;){var i=n.value,a=null,o=null,u=null,l=null,c=null,d=null,f=null;for(var h in i)i.hasOwnProperty(h)&&(h===s.Z.ID?a=i[h]:h===s.Z.SERVICE_DESCRIPTION_SCOPE?o=i[h].schemeIdUri:h===s.Z.SERVICE_DESCRIPTION_LATENCY?u={target:parseInt(i[h].target),max:parseInt(i[h].max),min:parseInt(i[h].min),referenceId:parseInt(i[h].referenceId)}:h===s.Z.SERVICE_DESCRIPTION_PLAYBACK_RATE?l={max:parseFloat(i[h].max),min:parseFloat(i[h].min)}:h===s.Z.SERVICE_DESCRIPTION_OPERATING_QUALITY?c={mediaType:i[h].mediaType,max:parseInt(i[h].max),min:parseInt(i[h].min),target:parseInt(i[h].target),type:i[h].type,maxQualityDifference:parseInt(i[h].maxQualityDifference)}:h===s.Z.SERVICE_DESCRIPTION_OPERATING_BANDWIDTH?d={mediaType:i[h].mediaType,max:parseInt(i[h].max),min:parseInt(i[h].min),target:parseInt(i[h].target)}:h===s.Z.CONTENT_STEERING&&(f=A(i[h])));t.push({id:a,schemeIdUri:o,latency:u,playbackRate:l,operatingQuality:c,operatingBandwidth:d,contentSteering:f})}}catch(e){r.e(e)}finally{r.f()}}return t},getSegmentAlignment:function(e){return!(!e||!e.hasOwnProperty(s.Z.SEGMENT_ALIGNMENT))&&"true"===e[s.Z.SEGMENT_ALIGNMENT]},getSubSegmentAlignment:function(e){return!(!e||!e.hasOwnProperty(s.Z.SUB_SEGMENT_ALIGNMENT))&&"true"===e[s.Z.SUB_SEGMENT_ALIGNMENT]},getSupplementalPropertiesForAdaptation:function(e){var t={};if(e&&e.hasOwnProperty(s.Z.SUPPLEMENTAL_PROPERTY_ASARRAY)){var n,r=Oe(e.SupplementalProperty_asArray);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.hasOwnProperty(a.Z.SCHEME_ID_URI)&&i.hasOwnProperty(s.Z.VALUE)&&(t[i[a.Z.SCHEME_ID_URI]]=i[s.Z.VALUE])}}catch(e){r.e(e)}finally{r.f()}}return t},getSupplementalPropertiesAsArrayForAdaptation:function(e){return e&&e.hasOwnProperty(s.Z.SUPPLEMENTAL_PROPERTY_ASARRAY)&&e.SupplementalProperty_asArray.length?e.SupplementalProperty_asArray.map((function(e){return(new we).init(e)})):[]},getSupplementalPropertiesForRepresentation:function(e){var t={};if(e&&e.hasOwnProperty(s.Z.SUPPLEMENTAL_PROPERTY_ASARRAY)){var n,r=Oe(e.SupplementalProperty_asArray);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.hasOwnProperty(a.Z.SCHEME_ID_URI)&&i.hasOwnProperty(s.Z.VALUE)&&(t[i[a.Z.SCHEME_ID_URI]]=i[s.Z.VALUE])}}catch(e){r.e(e)}finally{r.f()}}return t},getSupplementalPropertiesAsArrayForRepresentation:function(e){return e&&e.hasOwnProperty(s.Z.SUPPLEMENTAL_PROPERTY_ASARRAY)&&e.SupplementalProperty_asArray.length?e.SupplementalProperty_asArray.map((function(e){return(new we).init(e)})):[]},setConfig:function(e){e&&(e.errHandler&&(n=e.errHandler),e.BASE64&&(r=e.BASE64))}},t=(0,d.Z)(i).getInstance().getLogger(e),e}ke.__dashjs_factory_name="DashManifestModel";var Le=c.Z.getSingletonFactory(ke),Fe=n(703);function Ue(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Be(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Be(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function Be(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function je(){var e,t,n,r,i,s,o,l,c,d,h=this.context,p=(0,u.Z)(h).getInstance(),g=(0,C.Z)(h).getInstance();function m(){n={pr:1,nor:null,st:null,sf:null,sid:"".concat(Fe.Z.generateUuid()),cid:null},c={},l={},d={},v()}function y(){v()}function v(){if(s){var e=s.getStreamController();if(e&&"function"==typeof e.getActiveStream){var t=e.getActiveStream();t&&(o=t.getProcessors())}}}function _(e,t){var n,r={},i=Ue(t);try{for(i.s();!(n=i.n()).done;){var a=n.value;e[a]&&(r[a]=e[a])}}catch(e){i.e(e)}finally{i.f()}return r}function T(e){var t=g.get().streaming.cmcd.enabledKeys;return e.filter((function(e){return t.includes(e)}))}function b(e){try{return e.type===R.w.MPD_TYPE?((u=E()).ot="m",u):e.type===R.w.MEDIA_SEGMENT_TYPE?(t=e.mediaType,d.hasOwnProperty(t)||(d[t]=!1),l.hasOwnProperty(t)||(l[t]=!1),c.hasOwnProperty(t)||(c[t]=!1),function(e){var t,u=E(),f=function(e){try{var t=e.quality,n=e.mediaInfo.bitrateList;return parseInt(n[t].bandwidth/1e3)}catch(e){return null}}(e),h=function(e){try{return isNaN(e.duration)?NaN:Math.round(1e3*e.duration)}catch(e){return null}}(e),p=function(e){try{return 100*parseInt(r.getThroughputHistory().getSafeAverageThroughput(e)/100)}catch(e){return null}}(e.mediaType),m=function(e){try{var t=n.pr,r=i.getCurrentBufferLevel(e);return isNaN(t)||isNaN(r)?null:100*parseInt(r/t*10)}catch(e){return null}}(e.mediaType),y=S(e.mediaType),v=function(e){try{var t=r.getTopBitrateInfoFor(e);return Math.round(t.bitrate/1e3)}catch(e){return null}}(e.mediaType),_=n.pr,T=function(e){if(o&&0!==o.length){var t,n=Ue(o);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.getType()===e)return r.probeNextRequest()}}catch(e){n.e(e)}finally{n.f()}}}(e.mediaType);e.mediaType===a.Z.VIDEO&&(t="v"),e.mediaType===a.Z.AUDIO&&(t="a"),e.mediaType===a.Z.TEXT&&(t="application/mp4"===e.mediaInfo.mimeType?"tt":"c");var b=g.get().streaming.cmcd.rtp;return b||(b=function(e){try{var t=s.getPlaybackRate();t||(t=1);var n=e.quality,r=e.mediaType,i=e.mediaInfo,a=e.duration;if(!i)return NaN;var o=S(r);0===o&&(o=500);var u=i.bitrateList[n].bandwidth*a/1e3/(o/t/1e3),l=g.get().streaming.cmcd.rtpSafetyFactor&&!isNaN(g.get().streaming.cmcd.rtpSafetyFactor)?g.get().streaming.cmcd.rtpSafetyFactor:5;return 100*(parseInt(u*l/100)+1)}catch(e){return NaN}}(e)),isNaN(b)||(u.rtp=b),T&&(e.url!==T.url?u.nor=encodeURIComponent(Fe.Z.getRelativeUrl(e.url,T.url)):T.range&&(u.nrr=T.range)),f&&(u.br=f),t&&(u.ot=t),isNaN(h)||(u.d=h),isNaN(p)||(u.mtp=p),isNaN(m)||(u.dl=m),isNaN(y)||(u.bl=y),isNaN(v)||(u.tb=v),isNaN(_)||1===_||(u.pr=_),c[e.mediaType]&&(u.bs=!0,c[e.mediaType]=!1),!l[e.mediaType]&&d[e.mediaType]||(u.su=!0,l[e.mediaType]=!1,d[e.mediaType]=!0),u}(e)):e.type===R.w.INIT_SEGMENT_TYPE?function(){var e=E();return e.ot="i",e.su=!0,e}():e.type===R.w.OTHER_TYPE||e.type===R.w.XLINK_EXPANSION_TYPE?function(){var e=E();return e.ot="o",e}():e.type===R.w.LICENSE?function(e){var t=E();return t.ot="k",t}():null}catch(e){return null}var t,u}function E(){var e={},t=g.get().streaming.cmcd.cid?g.get().streaming.cmcd.cid:n.cid;return e.v=1,e.sid=g.get().streaming.cmcd.sid?g.get().streaming.cmcd.sid:n.sid,e.sid="".concat(e.sid),t&&(e.cid="".concat(t)),isNaN(n.pr)||1===n.pr||null===n.pr||(e.pr=n.pr),n.st&&(e.st=n.st),n.sf&&(e.sf=n.sf),e}function S(e){try{var t=i.getCurrentBufferLevel(e);return isNaN(t)?null:100*parseInt(10*t)}catch(e){return null}}function w(e){try{n.pr=e.playbackRate}catch(e){}}function A(t){try{var r=e.getIsDynamic(t.data)?"l":"v",i=t.protocol&&"MSS"===t.protocol?"s":"d";n.st="".concat(r),n.sf="".concat(i)}catch(e){}}function I(e){try{e.state&&e.mediaType&&e.state===f.Z.BUFFER_EMPTY&&(c[e.mediaType]||(c[e.mediaType]=!0),l[e.mediaType]||(l[e.mediaType]=!0))}catch(e){}}function D(){for(var e in c)c.hasOwnProperty(e)&&(c[e]=!0);for(var t in l)l.hasOwnProperty(t)&&(l[t]=!0)}function x(e){try{if(!e)return null;var t=Object.keys(e).sort((function(e,t){return e.localeCompare(t)})),n=t.length,r=t.reduce((function(t,r,i){return"v"===r&&1===e[r]||("string"==typeof e[r]&&"ot"!==r&&"sf"!==r&&"st"!==r?t+="".concat(r,"=").concat(JSON.stringify(e[r])):t+="".concat(r,"=").concat(e[r]),i<n-1&&(t+=",")),t}),"");return(r=r.replace(/=true/g,"")).replace(/,\s*$/,"")}catch(e){return null}}return t={getQueryParameter:function(e){try{if(g.get().streaming.cmcd&&g.get().streaming.cmcd.enabled){var t=b(e),n=function(e){try{var t=g.get().streaming.cmcd.enabledKeys;return Object.keys(e).filter((function(e){return t.includes(e)})).reduce((function(t,n){return t[n]=e[n],t}),{})}catch(t){return e}}(t),r=x(n);return p.trigger(de.Z.CMCD_DATA_GENERATED,{url:e.url,mediaType:e.mediaType,cmcdData:t,cmcdString:r}),{key:"CMCD",value:r}}return null}catch(e){return null}},getHeaderParameters:function(e){try{if(g.get().streaming.cmcd&&g.get().streaming.cmcd.enabled){var t=b(e),n=_(t,T(["br","d","ot","tb"])),r=_(t,T(["bl","dl","mtp","nor","nrr","su"])),i=_(t,T(["bs","rtp"])),a=_(t,T(["cid","pr","sf","sid","st","v"])),s={"CMCD-Object":x(n),"CMCD-Request":x(r),"CMCD-Status":x(i),"CMCD-Session":x(a)};return p.trigger(de.Z.CMCD_DATA_GENERATED,{url:e.url,mediaType:e.mediaType,cmcdData:t,headers:s}),s}return null}catch(e){return null}},setConfig:function(e){e&&(e.abrController&&(r=e.abrController),e.dashMetrics&&(i=e.dashMetrics),e.playbackController&&(s=e.playbackController))},reset:function(){p.off(f.Z.PLAYBACK_RATE_CHANGED,w,this),p.off(f.Z.MANIFEST_LOADED,A,this),p.off(f.Z.BUFFER_LEVEL_STATE_CHANGED,I,t),p.off(f.Z.PLAYBACK_SEEKED,D,t),m()},initialize:function(){p.on(f.Z.PLAYBACK_RATE_CHANGED,w,t),p.on(f.Z.MANIFEST_LOADED,A,t),p.on(f.Z.BUFFER_LEVEL_STATE_CHANGED,I,t),p.on(f.Z.PLAYBACK_SEEKED,D,t),p.on(f.Z.PERIOD_SWITCH_COMPLETED,y,t)}},e=Le(h).getInstance(),m(),t}je.__dashjs_factory_name="CmcdModel";var qe=c.Z.getSingletonFactory(je);function He(e){return He="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},He(e)}function Ge(e,t){Ge=function(e,t){return new a(e,void 0,t)};var n=Ve(RegExp),r=RegExp.prototype,i=new WeakMap;function a(e,t,r){var a=n.call(this,e,t);return i.set(a,r||i.get(e)),a}function s(e,t){var n=i.get(t);return Object.keys(n).reduce((function(t,r){return t[r]=e[n[r]],t}),Object.create(null))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ze(e,t)}(a,n),a.prototype.exec=function(e){var t=r.exec.call(this,e);return t&&(t.groups=s(t,this)),t},a.prototype[Symbol.replace]=function(e,t){if("string"==typeof t){var n=i.get(this);return r[Symbol.replace].call(this,e,t.replace(/\$<([^>]+)>/g,(function(e,t){return"$"+n[t]})))}if("function"==typeof t){var a=this;return r[Symbol.replace].call(this,e,(function(){var e=[];return e.push.apply(e,arguments),"object"!==He(e[e.length-1])&&e.push(s(e,a)),t.apply(this,e)}))}return r[Symbol.replace].call(this,e,t)},Ge.apply(this,arguments)}function Ve(e){var t="function"==typeof Map?new Map:void 0;return Ve=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return Ye(e,arguments,Ze(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),ze(r,e)},Ve(e)}function Ye(e,t,n){return Ye=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&ze(i,n.prototype),i},Ye.apply(null,arguments)}function ze(e,t){return ze=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ze(e,t)}function Ze(e){return Ze=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ze(e)}var Ke="static",We="dynamic",Xe="cmsd-",$e=Xe+Ke,Qe=Xe+We,Je="stream",et=["mb","st","sf","v"],tt={video:"v",audio:"a",text:"tt",stream:Je},nt=/^[-0-9]/;function rt(){var e,t,n,r,i=this.context,a=(0,u.Z)(i).getInstance();function s(){n={},r={}}function o(e){e&&Object.keys(e).forEach((function(t){et.includes(t)||delete e[t]}))}function c(e){return!e||"false"!==e.toLowerCase()&&(nt.test(e)?parseInt(e,10):e.replace(/["]+/g,""))}function f(e){try{for(var n={},r=e.split(","),i=0;i<r.length;i++){var a=r[i].split("="),s=a[0],o=c(a[1]);n[s]=o}return n}catch(e){t.error("Failed to parse CMSD-Static response header value:",e)}}function h(e){try{for(var n={},r=e.split(","),i=r[r.length-1].split(";"),a=1;a<i.length;a++){var s=i[a].split("="),o=s[0],u=c(s[1]);n[o]=u}return n}catch(e){return t.error("Failed to parse CMSD-Dynamic response header value:",e),[]}}function p(e){return tt[e]||"o"}function g(e,t,i){var a=e===Ke?n:r,s=a[t]||{},o=a[Je]||{};return s[i]||o[i]}return e={setConfig:function(){},initialize:function(){},reset:function(){s()},parseResponseHeaders:function(e,t){for(var i=null,s=null,u=e.split("\r\n"),c=u.length-1;c>=0;c--){var d=u[c].match(Ge(/^((?:(?!:)[\s\S])*):[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(.*)$/,{key:1,value:2}));if(d&&d.groups){var g=d.groups.key.toLowerCase(),m=d.groups.value;switch(g){case $e:i=f(m),a.trigger(l.Z.CMSD_STATIC_HEADER,i);break;case Qe:s||(s=h(m))}}}var y=Je;return i&&i.ot?y=i.ot:t&&(y=p(t)),o(n[y]),o(r[y]),i&&(n[y]=Object.assign(n[y]||{},i)),s&&(r[y]=Object.assign(r[y]||{},s)),{static:i,dynamic:s}},getMaxBitrate:function(e){var t=p(e);return g(We,t,"mb")||-1},getEstimatedThroughput:function(e){var t=p(e);return g(We,t,"etp")||null},getResponseDelay:function(e){var t=p(e);return g(We,t,"rd")||null},getRoundTripTime:function(e){var t=p(e);return g(We,t,"rtt")||null}},t=(0,d.Z)(i).getInstance().getLogger(e),s(),e}rt.__dashjs_factory_name="CmsdModel";var it=c.Z.getSingletonFactory(rt);function at(){var e,t,n=this.context,r={};function i(){t=(0,d.Z)(n).getInstance().getLogger(e)}function a(e){for(var t={},n=0,r=0,i=0,a=0,s=e.length,o=0;o<s;++o)n+=e[o].chunkDownloadTimeRelativeMS,r+=e[o].bufferLevel,i+=e[o].chunkDownloadTimeRelativeMS*e[o].bufferLevel,a+=e[o].chunkDownloadTimeRelativeMS*e[o].chunkDownloadTimeRelativeMS;return t.m=(i-n*r/s)/(a-n*n/s),t.b=r/s-t.m*n/s,function(e){return t.m*e+t.b}}function s(e){var t,n=!0,r=e.reduce((function(e,t){return e+t.bufferLevelAtSegmentEnd}),0)/e.length;return e.forEach((function(e){Math.abs(e.bufferLevelAtSegmentEnd/e.bufferLevelAtSegmentStart)<.95&&(n=!1),e.bufferLevelAtSegmentEnd/r<.8&&(n=!1),t?t>e.bitrate&&(n=!1):t=e.bitrate})),n}return e={setup:i,addMeasurement:function(e,t,n,i,s){e&&e.mediaType&&!r[e.mediaType]&&(r[e.mediaType]=[]);var o=e.mediaInfo.bitrateList.find((function(t){return t.id===e.representationId}));r[e.mediaType].push({index:e.index,repId:e.representationId,mediaType:e.mediaType,requestTimeMS:i,adjustedAvailabilityStartTimeMS:e.availabilityStartTime.getTime(),segDurationMS:1e3*e.duration,chunksDurationMS:n.reduce((function(e,t){return e+t.chunkDownloadDurationMS}),0),segmentBytes:n.reduce((function(e,t){return e+t.chunkBytes}),0),bitrate:o&&o.bandwidth,bitrateList:e.mediaInfo.bitrateList,chunkMeasurements:n,fetchDownloadDurationMS:t,throughputCapacityDelayMS:s,getEstimatedBufferLevel:a(n.slice(1))}),r[e.mediaType].length>10&&r[e.mediaType].shift()},getThroughputCapacityDelayMS:function(e,t){var n=r[e.mediaType]&&r[e.mediaType].slice(-3);return!n||n.length<3?0:s(n)?t/4>250?250:t/4:0},getEstimatedDownloadDurationMS:function(e){var n=r[e.mediaType].slice(-1).pop(),i=r[e.mediaType].slice(-3),a=n.chunkMeasurements.slice(-1).pop().chunkDownloadTimeRelativeMS;n.bufferLevelAtSegmentStart=n.getEstimatedBufferLevel(a/2),n.bufferLevelAtSegmentEnd=n.getEstimatedBufferLevel(a);var o=s(i),u=o?.6:.8;if(n.isBufferStable&&1.05*n.segDurationMS<n.fetchDownloadDurationMS)return n.fetchDownloadDurationMS;if(!o||n.segDurationMS<n.fetchDownloadDurationMS)return.8*n.fetchDownloadDurationMS;if(n.adjustedAvailabilityStartTimeMS<=n.requestTimeMS+n.throughputCapacityDelayMS-n.segDurationMS)return.8*n.fetchDownloadDurationMS;for(var l=n.requestTimeMS+n.throughputCapacityDelayMS-n.adjustedAvailabilityStartTimeMS,c=0,d=0,f=0,h=0;h<n.chunkMeasurements.length;h++){var p=n.chunkMeasurements[h];if(l<d+p.chunkDownloadDurationMS)break;d+=p.chunkDownloadDurationMS,c+=p.chunkBytes,f++}if(l<0&&t.warn("request time was before adjusted availibitly start time"),c&&d&&f>.2*n.chunkMeasurements.length){var g=c/d,m=n.segmentBytes/g;return n.fetchDownloadDurationMS<m?n.fetchDownloadDurationMS*u:m*u}var y=n.bitrate;return n.bitrateList.some((function(e){if(e.bandwidth>n.bitrate)return y=e.bandwidth,!0})),y===n.bitrate?n.fetchDownloadDurationMS*u:u*n.segmentBytes*8*1e3/y}},i(),e}at.__dashjs_factory_name="LowLatencyThroughputModel";var st=c.Z.getSingletonFactory(at),ot=n(5717);function ut(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lt(e){e=e||{};var t,n,r,i,s,o,c,f,h,p,g,m=this.context,y=e.errHandler,v=e.dashMetrics,_=e.mediaPlayerModel,T=e.requestModifier,b=e.boxParser,S=e.errors,w=e.requestTimeout||0,A=(0,u.Z)(m).getInstance(),I=(0,C.Z)(m).getInstance();function D(e,t){var u,d=e.request,g=[],S=!0,C=!0,x=new Date,N=x,O=0,P=null,M=null;if(!T||!v||!y)throw new Error("config object is not correct or missing");var k,L=function(e){d.requestStartDate=x,d.requestEndDate=new Date,d.firstByteDate=d.firstByteDate||x,d.fileLoaderType=M;var t=u.response?u.response.responseURL:null,n=u.response?u.response.status:null,r=u.response&&u.response.getAllResponseHeaders?u.response.getAllResponseHeaders():u.response?u.response.responseHeaders:null,i=r&&I.get().streaming.cmsd&&I.get().streaming.cmsd.enabled?c.parseResponseHeaders(r,d.mediaType):null;v.addHttpRequest(d,t,n,r,e?g:null,i)},F=function(e){C=!1,L(e),d.type===R.w.MPD_TYPE&&(v.addManifestUpdate(d),A.trigger(l.Z.MANIFEST_LOADING_FINISHED,{request:d}))},U=function(){if(P&&(clearTimeout(P),P=null),-1!==n.indexOf(u)&&(n.splice(n.indexOf(u),1),C))if(F(!1),t>0){try{I.get().streaming.utcSynchronization.enableBackgroundSyncAfterSegmentDownloadError&&d.type===R.w.MEDIA_SEGMENT_TYPE&&_.getRetryAttemptsForType(R.w.MEDIA_SEGMENT_TYPE)===t&&A.trigger(l.Z.ATTEMPT_BACKGROUND_SYNC)}catch(e){}t--;var r={config:e};i.push(r),r.timeout=setTimeout((function(){-1!==i.indexOf(r)&&(i.splice(i.indexOf(r),1),D(e,t))}),_.getRetryIntervalsForType(d.type))}else{if(d.type===R.w.MSS_FRAGMENT_INFO_SEGMENT_TYPE)return;y.error(new E.Z(s[d.type],d.url+" is not available",{request:d,response:u.response})),e.error&&e.error(d,"error",u.response.statusText,u.response),e.complete&&e.complete(d,u.response.statusText)}};d.hasOwnProperty("availabilityTimeComplete")&&!1===d.availabilityTimeComplete&&window.fetch&&"arraybuffer"===d.responseType&&d.type===R.w.MEDIA_SEGMENT_TYPE?((k=ce(m).create({requestModifier:T,lowLatencyThroughputModel:h,boxParser:b})).setup({dashMetrics:v}),M=a.Z.FILE_LOADER_TYPES.FETCH):(k=(0,se.Z)(m).create({requestModifier:T}),M=a.Z.FILE_LOADER_TYPES.XHR);var B=null,j=T.modifyRequestURL?T.modifyRequestURL(d.url):d.url;if(I.get().streaming.cmcd&&I.get().streaming.cmcd.enabled){var q=I.get().streaming.cmcd.mode;if(q===a.Z.CMCD_MODE_QUERY){var H=function(e){try{var t=[],n=o.getQueryParameter(e);return n&&t.push(n),t}catch(e){return[]}}(d);j=Fe.Z.addAditionalQueryParameterToUrl(j,H)}else q===a.Z.CMCD_MODE_HEADER&&(B=o.getHeaderParameters(d))}var G=f.getXHRWithCredentialsForType(d.type);if(d.queryParams){var V=Object.keys(d.queryParams).map((function(e){return{key:e,value:d.queryParams[e]}}));j=Fe.Z.addAditionalQueryParameterToUrl(j,V)}d.url=j,u={url:j,method:R.w.GET,withCredentials:G,request:d,onload:function(){u.response.status>=200&&u.response.status<=299&&(F(!0),e.success&&e.success(u.response.response,u.response.statusText,u.response.responseURL),e.complete&&e.complete(d,u.response.statusText))},onend:U,onerror:U,progress:function(t){var n=new Date;S&&(S=!1,(!t.lengthComputable||t.lengthComputable&&t.total!==t.loaded)&&(d.firstByteDate=n)),t.lengthComputable&&(d.bytesLoaded=t.loaded,d.bytesTotal=t.total),t.noTrace||(g.push({s:N,d:t.time?t.time:n.getTime()-N.getTime(),b:[t.loaded?t.loaded-O:0]}),N=n,O=t.loaded),P&&(clearTimeout(P),P=null),I.get().streaming.fragmentRequestProgressTimeout>0&&(P=setTimeout((function(){p.warn("Abort request "+u.url+" due to progress timeout"),u.response.onabort=null,u.loader.abort(u),U()}),I.get().streaming.fragmentRequestProgressTimeout)),e.progress&&t&&e.progress(t)},onabort:function(){L(!0),P&&(clearTimeout(P),P=null),e.abort&&e.abort(d)},ontimeout:function(e){var t;if(e.lengthComputable){var n=e.loaded/e.total*100;t="Request timeout: loaded: "+e.loaded+", out of: "+e.total+" : "+n.toFixed(3)+"% Completed"}else t="Request timeout: non-computable download size";p.warn(t)},loader:k,timeout:w,headers:B};var Y=(new Date).getTime();if(isNaN(d.delayLoadingTime)||Y>=d.delayLoadingTime)n.push(u),k.load(u);else{var z={httpRequest:u};r.push(z),z.delayTimeout=setTimeout((function(){if(-1!==r.indexOf(z)){r.splice(r.indexOf(z),1);try{x=new Date,N=x,n.push(z.httpRequest),k.load(z.httpRequest)}catch(e){z.httpRequest.onerror()}}}),d.delayLoadingTime-Y)}}return t={load:function(e){e.request?D(e,_.getRetryAttemptsForType(e.request.type)):e.error&&e.error(e.request,"error")},abort:function(){i.forEach((function(e){clearTimeout(e.timeout),e.config.request&&e.config.abort&&e.config.abort(e.config.request)})),i=[],r.forEach((function(e){return clearTimeout(e.delayTimeout)})),r=[],n.forEach((function(e){e.request.type!==R.w.MSS_FRAGMENT_INFO_SEGMENT_TYPE&&(e.onloadend=e.onerror=e.onprogress=void 0,e.loader.abort(e))})),n=[]}},p=(0,d.Z)(m).getInstance().getLogger(t),n=[],r=[],i=[],o=qe(m).getInstance(),c=it(m).getInstance(),h=st(m).getInstance(),f=(0,ot.Z)(m).getInstance(),ut(g={},R.w.MPD_TYPE,S.DOWNLOAD_ERROR_ID_MANIFEST_CODE),ut(g,R.w.XLINK_EXPANSION_TYPE,S.DOWNLOAD_ERROR_ID_XLINK_CODE),ut(g,R.w.INIT_SEGMENT_TYPE,S.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE),ut(g,R.w.MEDIA_SEGMENT_TYPE,S.DOWNLOAD_ERROR_ID_CONTENT_CODE),ut(g,R.w.INDEX_SEGMENT_TYPE,S.DOWNLOAD_ERROR_ID_CONTENT_CODE),ut(g,R.w.BITSTREAM_SWITCHING_SEGMENT_TYPE,S.DOWNLOAD_ERROR_ID_CONTENT_CODE),ut(g,R.w.OTHER_TYPE,S.DOWNLOAD_ERROR_ID_CONTENT_CODE),s=g,t}lt.__dashjs_factory_name="HTTPLoader";var ct=c.Z.getClassFactory(lt);function dt(){var e;function t(){e={}}function n(){t()}return n(),{getLoader:function(t){for(var n in e)if(e.hasOwnProperty(n)&&t.startsWith(n))return e[n];return ct},registerLoader:function(t,n){e[t]=n},unregisterLoader:function(t){e[t]&&delete e[t]},unregisterAllLoader:t,reset:n}}dt.__dashjs_factory_name="SchemeLoaderFactory";var ft=c.Z.getSingletonFactory(dt);function ht(e){e=e||{};var t,n,r=this.context;return t=ft(r).getInstance(),{load:function(i){if(!n){var a=t.getLoader(i&&i.request?i.request.url:null);n=a(r).create({errHandler:e.errHandler,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,dashMetrics:e.dashMetrics,boxParser:e.boxParser?e.boxParser:null,constants:e.constants?e.constants:null,dashConstants:e.dashConstants?e.dashConstants:null,urlUtils:e.urlUtils?e.urlUtils:null,requestTimeout:isNaN(e.requestTimeout)?0:e.requestTimeout,errors:e.errors})}n.load(i)},abort:function(){n&&n.abort()}}}ht.__dashjs_factory_name="URLLoader";var pt=c.Z.getClassFactory(ht);function gt(e){return gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gt(e)}function mt(e,t){return mt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},mt(e,t)}function yt(e){return yt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},yt(e)}var vt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&mt(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=yt(t);if(n){var i=yt(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==gt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=r.call(this,e)).checkForExistenceOnly=!0,t}return i}(g.Z);function _t(e){e=e||{};var t,n,r=this.context,i=e.eventBus,s=e.events,o=e.urlUtils,u=e.errors,l=e.streamId;return t={checkForExistence:function(e){var t=function(t){i.trigger(s.CHECK_FOR_EXISTENCE_COMPLETED,{request:e,exists:t})};if(e){var r=new vt(e.url);n.load({request:r,success:function(){t(!0)},error:function(){t(!1)}})}else t(!1)},load:function(e){var r=function(n,r){i.trigger(s.LOADING_COMPLETED,{request:e,response:n||null,error:r||null,sender:t})};e?n.load({request:e,progress:function(n){i.trigger(s.LOADING_PROGRESS,{request:e,stream:n.stream,streamId:l}),n.data&&i.trigger(s.LOADING_DATA_PROGRESS,{request:e,response:n.data||null,error:null,sender:t})},success:function(e){r(e)},error:function(e,t,n){r(void 0,new E.Z(u.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE,n,t))},abort:function(e){e&&i.trigger(s.LOADING_ABANDONED,{mediaType:e.mediaType,request:e,sender:t})}}):r(void 0,new E.Z(u.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE,u.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE))},abort:function(){n&&n.abort()},reset:function(){n&&(n.abort(),n=null)}},n=pt(r).create({errHandler:e.errHandler,errors:u,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,urlUtils:o,constants:a.Z,boxParser:e.boxParser,dashConstants:e.dashConstants,requestTimeout:e.settings.get().streaming.fragmentRequestTimeout}),t}_t.__dashjs_factory_name="FragmentLoader";var Tt=c.Z.getClassFactory(_t);function bt(){return{modifyResponseAsync:function(e){return Promise.resolve(e)}}}bt.__dashjs_factory_name="SegmentResponseModifier";var Et=c.Z.getSingletonFactory(bt);function St(e){e=e||{};var t,n,r,i=this.context,s=(0,u.Z)(i).getInstance(),o=e.errHandler,c=e.mediaPlayerModel,h=e.dashMetrics,p=(0,d.Z)(i).getInstance(),g=Et(i).getInstance(),m=e.streamInfo;function y(){return m.id}function v(){for(var e in r)r[e].reset();r={}}function _(e){if(e.sender){var t=e.request,r=e.response,i=t.isInitializationRequest(),o=t.mediaInfo.streamInfo;if(e.error&&(t.mediaType===a.Z.AUDIO||t.mediaType===a.Z.VIDEO||t.mediaType===a.Z.TEXT&&t.mediaInfo.isFragmented)&&s.trigger(l.Z.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD,{entry:e.request.serviceLocation}),r&&o){var u=function(e,t,n,r){var i=new ae;return i.streamId=n,i.mediaInfo=t.mediaInfo,i.segmentType=t.type,i.start=t.startTime,i.duration=t.duration,i.end=i.start+i.duration,i.bytes=e,i.index=t.index,i.quality=t.quality,i.representationId=t.representationId,i.endFragment=r,i}(r,t,m.id,e.type!==l.Z.FRAGMENT_LOADING_PROGRESS);g.modifyResponseAsync(u).then((function(e){s.trigger(i?l.Z.INIT_FRAGMENT_LOADED:l.Z.MEDIA_FRAGMENT_LOADED,{chunk:e,request:t},{streamId:o.id,mediaType:t.mediaType})})).catch((function(e){n.error(e),s.trigger(i?l.Z.INIT_FRAGMENT_LOADED:l.Z.MEDIA_FRAGMENT_LOADED,{chunk:u,request:t},{streamId:o.id,mediaType:t.mediaType})}))}else n.warn("No "+t.mediaType+" bytes to push or stream is inactive.")}}return t={getStreamId:y,getModel:function(t){var n=r[t];return n||(n=b(i).create({streamInfo:m,type:t,dashMetrics:h,fragmentLoader:Tt(i).create({dashMetrics:h,mediaPlayerModel:c,errHandler:o,requestModifier:(0,W.Z)(i).getInstance(),settings:e.settings,boxParser:e.boxParser,eventBus:s,events:l.Z,errors:I,dashConstants:e.dashConstants,urlUtils:e.urlUtils,streamId:y()}),debug:p,eventBus:s,events:l.Z}),r[t]=n),n},reset:function(){s.off(f.Z.FRAGMENT_LOADING_COMPLETED,_,this),s.off(f.Z.FRAGMENT_LOADING_PROGRESS,_,this),v()}},n=p.getLogger(t),v(),s.on(f.Z.FRAGMENT_LOADING_COMPLETED,_,t),s.on(f.Z.FRAGMENT_LOADING_PROGRESS,_,t),t}St.__dashjs_factory_name="FragmentController";var wt=c.Z.getClassFactory(St),At=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=null,this.width=null,this.height=null,this.x=null,this.y=null},It=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mediaType=null,this.bitrate=null,this.width=null,this.height=null,this.scanType=null,this.qualityIndex=NaN};function Ct(e){var t,n,r=this.context,i=e.streamInfo;function s(e){n.setTrackByIndex(e)}function o(){n&&n.reset()}return t={getStreamId:function(){return i.id},initialize:function(){n.addTracks();var e=n.getTracks();e&&e.length>0&&s(0)},provide:function(e,t){if("function"==typeof t){var r,i,a=n.getCurrentTrack();if(!a||a.segmentDuration<=0||null==e)t(null);else{(i=n.getThumbnailRequestForTime(e))&&(a.segmentDuration=i.duration),r=e%a.segmentDuration;var s=Math.floor(r*a.tilesHor*a.tilesVert/a.segmentDuration),o=new At;if(o.width=Math.floor(a.widthPerTile),o.height=Math.floor(a.heightPerTile),o.x=Math.floor(s%a.tilesHor)*a.widthPerTile,o.y=Math.floor(s/a.tilesHor)*a.heightPerTile,"readThumbnail"in a)return a.readThumbnail(e,(function(e){o.url=e,t(o)}));if(i)o.url=i.url,a.segmentDuration=NaN;else{var u=Math.floor(e/a.segmentDuration);o.url=function(e,t){var n=t+e.startNumber,r=(0,V.vi)(e.templateUrl,"Number",n);return r=(0,V.vi)(r,"Time",(n-1)*e.segmentDuration*e.timescale),r=(0,V.vi)(r,"Bandwidth",e.bandwidth),(0,V.eR)(r)}(a,u)}t(o)}}},setTrackByIndex:s,getCurrentTrackIndex:function(){return n.getCurrentTrackIndex()},getBitrateList:function(){var e=n.getTracks(),t=0;return e.map((function(e){var n=new It;return n.mediaType=a.Z.IMAGE,n.qualityIndex=t++,n.bitrate=e.bitrate,n.width=e.width,n.height=e.height,n}))},reset:o},o(),n=(0,De.Z)(r).create({streamInfo:i,adapter:e.adapter,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:e.debug,eventBus:e.eventBus,events:e.events,dashConstants:e.dashConstants,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController}),t}Ct.__dashjs_factory_name="ThumbnailController";var Rt=c.Z.getClassFactory(Ct),Dt=n(7417);function xt(e){var t;e=e||{};var n=[],r=(0,u.Z)(this.context).getInstance(),i=e.updateEventName,a=e.addBlacklistEventName;function s(e){-1===n.indexOf(e)&&(n.push(e),r.trigger(i,{entry:e}))}return t={add:s,contains:function(e){return!!(n.length&&e&&e.length)&&-1!==n.indexOf(e)},reset:function(){n=[]}},a&&r.on(a,(function(e){s(e.entry)}),t),t}xt.__dashjs_factory_name="BlackListController";var Nt=c.Z.getClassFactory(xt),Ot=[a.Z.VIDEO,a.Z.AUDIO,a.Z.TEXT,a.Z.MUXED,a.Z.IMAGE];function Pt(e){e=e||{};var t,n,r,i,o,c,f,h,p,g,m,y,v,_,T,b,S,w,A=this.context,C=(0,u.Z)(A).getInstance(),R=(0,X.Z)(A).getInstance(),D=e.manifestModel,x=e.mediaPlayerModel,N=e.dashMetrics,O=e.manifestUpdater,P=e.adapter,M=e.timelineConverter,k=e.capabilities,L=e.errHandler,F=e.abrController,U=e.playbackController,B=e.eventController,j=e.mediaController,q=e.protectionController,H=e.textController,G=e.videoModel,V=e.streamInfo,Y=e.settings;function z(e,t){return new Promise((function(i,s){ne(),g=!0,ae();var o=G.getElement(),u=[];Ot.forEach((function(t){(t!==a.Z.TEXT||e)&&(t!==a.Z.VIDEO||!o||o&&/^VIDEO$/i.test(o.nodeName))&&u.push(Z(t,e))})),Promise.all(u).then((function(){return e=t,new Promise((function(t){var n={},i=r.map((function(t){return t.createBufferSinks(e)}));Promise.all(i).then((function(e){e.forEach((function(e){e&&(n[e.getType()]=e)})),t(n)})).catch((function(){t(n)}))}));var e})).then((function(t){if(g=!1,0===r.length){var a="No streams to play.";L.error(new E.Z(I.MANIFEST_ERROR_ID_NOSTREAMS_CODE,a,D.getValue())),n.fatal(a)}else se();e&&H.createTracks(V),i(t)})).catch((function(e){s(e)}))}))}function Z(t,i){var o,u=P.getAllMediaInfoForType(V,t),c=[],d=null;if(!u||0===u.length)return n.info("No "+t+" data."),Promise.resolve();t===a.Z.VIDEO&&(f=!0),t===a.Z.AUDIO&&(h=!0);for(var p=0,g=u.length;p<g;p++)d=u[p],t===a.Z.TEXT&&d.isEmbedded&&(H.addEmbeddedTrack(V,d),c.push(d)),K(d)&&j.addTrack(d);if(c.length>0&&(j.setInitialMediaSettingsForType(t,V),H.addMediaInfosToBuffer(V,t,c)),u=u.filter((function(e){return!e.isEmbedded})),0===u.length)return Promise.resolve();if(t===a.Z.IMAGE)return(y=Rt(A).create({streamInfo:V,adapter:P,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:b,eventBus:C,events:l.Z,dashConstants:s.Z,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController})).initialize(),Promise.resolve();C.trigger(l.Z.STREAM_INITIALIZING,{streamInfo:V,mediaInfo:d}),j.setInitialMediaSettingsForType(t,V);var _=function(t,n){var i=t&&t.length>0?t[0]:null,s=m.getModel(i?i.type:null),o=i?i.type:null,u=i?i.mimeType:null,l=i?i.isFragmented:null,c=ie(A).create({streamInfo:V,type:o,mimeType:u,timelineConverter:M,adapter:P,manifestModel:D,mediaPlayerModel:x,fragmentModel:s,dashMetrics:e.dashMetrics,baseURLController:e.baseURLController,segmentBaseController:e.segmentBaseController,abrController:F,playbackController:U,mediaController:j,textController:H,errHandler:L,settings:Y,boxParser:T,segmentBlacklistController:v});c.initialize(n,f,l),r.push(c);for(var d=0;d<t.length;d++)c.addMediaInfo(t[d]);return o===a.Z.TEXT&&H.addMediaInfosToBuffer(V,o,t,s),c}(u,i);return(o=j.getCurrentTrackFor(t,V.id))?(F.updateTopQualityIndex(o),_.selectMediaInfo(t===a.Z.TEXT&&o.isEmbedded?u[0]:o)):Promise.resolve()}function K(e){var t,r=e?e.type:null;return r===a.Z.MUXED?(t="Multiplexed representations are intentionally not supported, as they are not compliant with the DASH-AVC/264 guidelines",n.fatal(t),L.error(new E.Z(I.MANIFEST_ERROR_ID_MULTIPLEXED_CODE,t,D.getValue())),!1):!(r!==a.Z.TEXT&&r!==a.Z.IMAGE&&e.contentProtection&&!k.supportsEncryptedMedia()&&(L.error(new E.Z(I.CAPABILITY_MEDIAKEYS_ERROR_CODE,I.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE)),1))}function W(e){for(var t=r?r.length:0,n=0;n<t;n++){var i=r[n].getFragmentModel();i.abortRequests(),i.resetInitialSettings(),r[n].reset(!1,e)}H&&H.deactivateStream(V),r=[],o=!1,c=!1,me(!1),Q(!1),C.trigger(l.Z.STREAM_DEACTIVATED,{streamInfo:V})}function $(e){W(e),i=!1,f=!1,h=!1,p={},g=!1,S=!1,w=[]}function Q(e){S=e}function J(){return V?V.start:NaN}function ee(){return V?V.id:null}function te(){return V}function ne(){if(!G||!F)throw new Error(a.Z.MISSING_CONFIG_ERROR)}function re(e){e.error&&(L.error(e.error),n.fatal(e.error.message))}function ae(){if(B){var e=P.getEventsFor(V);e&&e.length>0&&B.addInlineEvents(e,V.id)}}function se(){for(var e=r.length,t=p.audio||p.video?new E.Z(I.DATA_UPDATE_FAILED_ERROR_CODE,I.DATA_UPDATE_FAILED_ERROR_MESSAGE):null,n=0;n<e;n++)if(r[n].isUpdating()||g)return;if(q){q.clearMediaInfoArray();for(var s=0;s<e&&r[s];s++){var o=r[s].getType(),u=r[s].getMediaInfo();if(o===a.Z.AUDIO||o===a.Z.VIDEO||o===a.Z.TEXT&&u.isFragmented){var c=r[s].getMediaInfo();c&&q.initializeForMedia(c)}}q.handleKeySystemFromManifest()}t?L.error(t):i||(i=!0,G.waitForReadyState(a.Z.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,(function(){C.trigger(l.Z.STREAM_INITIALIZED,{streamInfo:V})})))}function oe(){var e=fe(),t=e.length;if(0!==t){for(var r=0;r<t;r++)if(!e[r].isBufferingCompleted()&&(e[r].getType()===a.Z.AUDIO||e[r].getType()===a.Z.VIDEO))return void n.debug("onBufferingCompleted - One streamProcessor has finished but",e[r].getType(),"one is not buffering completed");n.debug("onBufferingCompleted - trigger STREAM_BUFFERING_COMPLETED"),c=!0,C.trigger(l.Z.STREAM_BUFFERING_COMPLETED,{streamInfo:V},{streamInfo:V})}else n.warn("onBufferingCompleted - can't trigger STREAM_BUFFERING_COMPLETED because no streamProcessor is defined")}function ue(e){p[e.mediaType]=e.error,se()}function le(e){B&&B.addInbandEvents(e.events,V.id)}function ce(e){return e&&e.type?de(e.type):null}function de(e){return e?fe().filter((function(t){return t.getType()===e}))[0]:null}function fe(){for(var e,t,n=[],i=0;i<r.length;i++)(e=(t=r[i]).getType())!==a.Z.AUDIO&&e!==a.Z.VIDEO&&e!==a.Z.TEXT||n.push(t);return n}function he(e,t){var n=te(),r=t.getStreamInfo();if(!r||!n)return!0;var i=P.getAdaptationForType(r.index,e,r),a=P.getAdaptationForType(n.index,e,n);return i&&a?!(!pe(a)&&pe(i)):!i&&!a}function pe(e){return!!e&&!!(e.ContentProtection||e.Representation_asArray&&e.Representation_asArray.length>0&&e.Representation_asArray[0].ContentProtection)}function ge(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e||!e.hasOwnProperty("getStreamInfo"))return!1;var r=e.getStreamInfo(),i=n?n.getStreamInfo():te();if(!r||!i)return!1;var a=P.getAdaptationForType(r.index,t,r),s=P.getAdaptationForType(i.index,t,i);if(!a||!s)return!a&&!s;var o=a&&s&&a.mimeType===s.mimeType,u=s.Representation_asArray.map((function(e){return e.codecs})),l=a.Representation_asArray.map((function(e){return e.codecs})),c=l.some((function(e){return u.indexOf(e)>-1})),d=l.some((function(e){return u.some((function(t){return k.codecRootCompatibleWithCodec(t,e)}))}));return c||d&&o}function me(e){_=e}function ye(){return _}return t={initialize:function(){C.on(l.Z.BUFFERING_COMPLETED,oe,t),C.on(l.Z.DATA_UPDATE_COMPLETED,ue,t),C.on(l.Z.INBAND_EVENTS,le,t),q&&(C.on(l.Z.KEY_ERROR,re,t),C.on(l.Z.SERVER_CERTIFICATE_UPDATED,re,t),C.on(l.Z.LICENSE_REQUEST_COMPLETE,re,t),C.on(l.Z.KEY_SYSTEM_SELECTED,re,t),C.on(l.Z.KEY_SESSION_CREATED,re,t),C.on(l.Z.KEY_STATUSES_CHANGED,re,t)),H.initializeForStream(V),C.trigger(l.Z.STREAM_UPDATED,{streamInfo:V})},getStreamId:function(){return V?V.id:null},activate:function(e,t){return new Promise((function(n,r){if(!o)return ye()?(o=!0,C.trigger(l.Z.STREAM_ACTIVATED,{streamInfo:V}),void n(t)):void function(e,t){return z(e,t)}(e,t).then((function(e){o=!0,C.trigger(l.Z.STREAM_ACTIVATED,{streamInfo:V}),n(e)})).catch((function(e){r(e)}));n(t)}))},deactivate:W,getIsActive:function(){return o},getDuration:function(){return V?V.duration:NaN},getStartTime:J,getId:ee,getStreamInfo:te,getHasAudioTrack:function(){return h},getHasVideoTrack:function(){return f},startPreloading:function(e,t){return new Promise((function(i,a){ye()?a():(n.info("[startPreloading] Preloading next stream with id ".concat(ee())),me(!0),z(e,t).then((function(){for(var e=0;e<r.length&&r[e];e++)r[e].setExplicitBufferingTime(J()),r[e].getScheduleController().startScheduleTimer();i()})).catch((function(){me(!1),a()})))}))},initializeForTextWithMediaSource:function(e){return new Promise((function(t,n){Z(a.Z.TEXT,e).then((function(){return(e=de(a.Z.TEXT))?e.createBufferSinks():Promise.resolve();var e})).then((function(){H.createTracks(V),t()})).catch((function(e){n(e)}))}))},getThumbnailController:function(){return y},getBitrateListFor:function(e){if(ne(),e===a.Z.IMAGE)return y?y.getBitrateList():[];var t=function(e){for(var t=null,n=0;n<r.length;n++)if((t=r[n]).getType()===e)return t.getMediaInfo();return null}(e);return F.getBitrateList(t)},updateData:function(e){return new Promise((function(t){g=!0,V=e,B&&ae();for(var n=[],i=0,a=r.length;i<a;i++){var s=r[i],o=s.getMediaInfo();n.push(s.updateStreamInfo(V));var u=P.getAllMediaInfoForType(V,s.getType());if(u=u.filter((function(e){return!e.isEmbedded}))){s.clearMediaInfoArray();for(var c=0;c<u.length;c++){var d=u[c];s.addMediaInfo(u[c]),P.areMediaInfosEqual(o,d)&&(F.updateTopQualityIndex(d),n.push(s.selectMediaInfo(d)))}}}Promise.all(n).then((function(){for(n=[];w.length>0;){var e=w.pop(),t=e.newMediaInfo,r=ce(e.oldMediaInfo);if(!r)return;n.push(r.prepareTrackSwitch()),n.push(r.selectMediaInfo(t))}return Promise.all(n)})).then((function(){g=!1,se(),C.trigger(l.Z.STREAM_UPDATED,{streamInfo:V}),t()}))}))},reset:function(e){m&&(m.reset(),m=null),F&&V&&F.clearDataForStream(V.id),v&&(v.reset(),v=null),$(e),V=null,C.off(l.Z.DATA_UPDATE_COMPLETED,ue,t),C.off(l.Z.BUFFERING_COMPLETED,oe,t),C.off(l.Z.INBAND_EVENTS,le,t),q&&(C.off(l.Z.KEY_ERROR,re,t),C.off(l.Z.SERVER_CERTIFICATE_UPDATED,re,t),C.off(l.Z.LICENSE_REQUEST_COMPLETE,re,t),C.off(l.Z.KEY_SYSTEM_SELECTED,re,t),C.off(l.Z.KEY_SESSION_CREATED,re,t),C.off(l.Z.KEY_STATUSES_CHANGED,re,t))},getProcessors:fe,setMediaSource:function(e){return new Promise((function(t,i){for(var a=[],s=0;s<r.length;)K(r[s].getMediaInfo())?(a.push(r[s].setMediaSource(e)),s++):(r[s].reset(),r.splice(s,1));Promise.all(a).then((function(){for(var e=0;e<r.length;e++)r[e].dischargePreBuffer();if(0===r.length){var i="No streams to play.";L.error(new E.Z(I.MANIFEST_ERROR_ID_NOSTREAMS_CODE,i+"nostreams",D.getValue())),n.fatal(i)}t()})).catch((function(e){n.error(e),i(e)}))}))},isMediaCodecCompatible:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return ge(e,a.Z.VIDEO,t)&&ge(e,a.Z.AUDIO,t)},isProtectionCompatible:function(e){return!e||he(a.Z.VIDEO,e)&&he(a.Z.AUDIO,e)},getPreloaded:ye,getIsEndedEventSignaled:function(){return S},setIsEndedEventSignaled:Q,getAdapter:function(){return P},getHasFinishedBuffering:function(){return c},setPreloaded:me,startScheduleControllers:function(){for(var e=r.length,t=0;t<e&&r[t];t++)r[t].getScheduleController().startScheduleTimer()},prepareTrackChange:function(e){if(o&&V){c=!1;var t=e.newMediaInfo,r=D.getValue();P.setCurrentMediaInfo(V.id,t.type,t);var i=ce(t);if(i){var s=U.getTime();n.info("Stream - Process track changed at current time "+s),r.refreshManifestOnSwitchTrack?(w.push(e),O.getIsUpdating()||(n.debug("Stream - Refreshing manifest for switch track"),O.refreshManifest())):i.selectMediaInfo(t).then((function(){t.type!==a.Z.VIDEO&&t.type!==a.Z.AUDIO||F.updateTopQualityIndex(t),i.prepareTrackSwitch()}))}}},prepareQualityChange:function(e){var t=de(e.mediaType);t&&t.prepareQualityChange(e)}},function(){try{b=(0,d.Z)(A).getInstance(),n=b.getLogger(t),$(),T=(0,Dt.Z)(A).getInstance(),v=Nt(A).create({updateEventName:l.Z.SEGMENT_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:l.Z.SEGMENT_LOCATION_BLACKLIST_ADD}),m=wt(A).create({streamInfo:V,mediaPlayerModel:x,dashMetrics:N,errHandler:L,settings:Y,boxParser:T,dashConstants:s.Z,urlUtils:R})}catch(e){throw e}}(),t}Pt.__dashjs_factory_name="Stream";var Mt=c.Z.getClassFactory(Pt),kt=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t||null,this.type=R.w.CONTENT_STEERING_TYPE,this.responseType="json"},Lt=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.version=null,this.ttl=300,this.reloadUri=null,this.pathwayPriority=[],this.pathwayClones=[]};function Ft(){var e,t,n,r,i,a,o,u,l,c,h,p,g,m,y,v=this.context,_=(0,X.Z)(v).getInstance();function T(e){A(e,"baseUrl")}function b(e){A(e,"location")}function E(e){if(e&&e.request&&e.request.serviceLocation&&e.request.requestStartDate&&e.request.requestEndDate&&!isNaN(e.request.bytesTotal)){var t=e.request.serviceLocation,n=e.request.requestEndDate.getTime()-e.request.requestStartDate.getTime();w(t,parseInt(8*e.request.bytesTotal/n*1e3))}}function S(e){e&&e.httpRequest&&e.httpRequest._serviceLocation&&!isNaN(e.throughput)&&w(e.httpRequest._serviceLocation,1e3*e.throughput)}function w(e,t){i[e]||(i[e]=[]),i[e].push(t),i[e].length>4&&i[e].shift()}function A(e,t){if(e&&e.request&&e.request.serviceLocation){var n=e.request.serviceLocation;-1===r[t].all.indexOf(n)&&r[t].all.push(n),r[t].current=n}}function C(){var e=h.getValue(),t=y.getContentSteering(e);return t||(t=g.getServiceDescriptionSettings().contentSteering),t}function R(){return new Promise((function(e){try{var a=C();if(!a||!a.serverUrl)return void e();var u=function(e){var t=e.serverUrl;n&&n.reloadUri&&(t=_.isRelative(n.reloadUri)?_.resolve(n.reloadUri,e.serverUrl):n.reloadUri);var a=[],s=r.baseUrl.all.concat(r.location.all);if(s.length>0){var o=s.map((function(e){var t=function(e){if(!e||!i[e]||0===i[e].length)return-1;var t=i[e].reduce((function(e,t){return e+t}))/i[e].length;return parseInt(t)}(e);return{serviceLocation:e,throughput:t}}));o.sort((function(e,t){return t.throughput-e.throughput}));var u="",l="";o.forEach((function(e,t){0!==t&&(u="".concat(u,","),e.throughput>-1&&(l="".concat(l,","))),u="".concat(u).concat(e.serviceLocation),e.throughput>-1&&(l="".concat(l).concat(e.throughput))})),a.push({key:"_DASH_pathway",value:'"'.concat(u,'"')}),a.push({key:"_DASH_throughput",value:l})}return Fe.Z.addAditionalQueryParameterToUrl(t,a)}(a),l=new kt(u);o.load({request:l,success:function(t){!function(e){e&&e[s.Z.CONTENT_STEERING_RESPONSE.VERSION]&&1===parseInt(e[s.Z.CONTENT_STEERING_RESPONSE.VERSION])&&((n=new Lt).version=e[s.Z.CONTENT_STEERING_RESPONSE.VERSION],e[s.Z.CONTENT_STEERING_RESPONSE.TTL]&&!isNaN(e[s.Z.CONTENT_STEERING_RESPONSE.TTL])&&(n.ttl=e[s.Z.CONTENT_STEERING_RESPONSE.TTL]),e[s.Z.CONTENT_STEERING_RESPONSE.RELOAD_URI]&&(n.reloadUri=e[s.Z.CONTENT_STEERING_RESPONSE.RELOAD_URI]),e[s.Z.CONTENT_STEERING_RESPONSE.PATHWAY_PRIORITY]&&(n.pathwayPriority=e[s.Z.CONTENT_STEERING_RESPONSE.PATHWAY_PRIORITY]),e[s.Z.CONTENT_STEERING_RESPONSE.PATHWAY_CLONES]&&(n.pathwayClones=e[s.Z.CONTENT_STEERING_RESPONSE.PATHWAY_CLONES],n.pathwayClones=n.pathwayClones.filter((function(e){return function(e){return e[s.Z.CONTENT_STEERING_RESPONSE.BASE_ID]&&e[s.Z.CONTENT_STEERING_RESPONSE.ID]&&e[s.Z.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT]&&e[s.Z.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][s.Z.CONTENT_STEERING_RESPONSE.HOST]}(e)}))),N())}(t),m.trigger(f.Z.CONTENT_STEERING_REQUEST_COMPLETED,{currentSteeringResponseData:n,url:u}),e()},error:function(r,i,a,s){!function(e,r){try{switch(t.warn("Error fetching data from content steering server",e),r.status){case 410:break;case 429:var i=r&&r.getResponseHeader?r.getResponseHeader("retry-after"):null;null!==i&&(n||(n={}),n.ttl=parseInt(i)),N();break;default:N()}}catch(e){t.error(e)}}(r,s),e(r)},complete:function(){r.baseUrl.all=D(r.baseUrl),r.location.all=D(r.location)}})}catch(t){e(t)}}))}function D(e){return e.all&&0!==e.all.length&&e.current?e.all.filter((function(t){return t===e.current})):[]}function x(e){try{var r=[];return e&&0!==e.length&&n&&n.pathwayClones&&0!==n.pathwayClones.length?(n.pathwayClones.forEach((function(t){var n=e.filter((function(e){return t[s.Z.CONTENT_STEERING_RESPONSE.BASE_ID]===e.serviceLocation})),i=null;if(n&&n.length>0&&(i=n[0]),i){var a=new URL(i.url),o=t[s.Z.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][s.Z.CONTENT_STEERING_RESPONSE.HOST];o=Fe.Z.stringHasProtocol(o)?o:"".concat(a.protocol,"//").concat(o);var u={synthesizedUrl:"".concat(o).concat(a.pathname),serviceLocation:t[s.Z.CONTENT_STEERING_RESPONSE.ID],queryParams:t[s.Z.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][s.Z.CONTENT_STEERING_RESPONSE.PARAMS],reference:i};r.push(u)}})),r):r}catch(e){return t.error(e),[]}}function N(){n&&n.ttl&&!isNaN(n.ttl)&&(a&&clearTimeout(a),a=setTimeout((function(){R()}),1e3*n.ttl))}function O(){a&&clearTimeout(a),a=null}function P(){n=null,i={},r={baseUrl:{current:null,all:[]},location:{current:null,all:[]}},O()}return e={reset:function(){P(),m.off(f.Z.FRAGMENT_LOADING_STARTED,T,e),m.off(f.Z.MANIFEST_LOADING_STARTED,b,e),m.off(f.Z.MANIFEST_LOADING_FINISHED,E,e),m.off(f.Z.THROUGHPUT_MEASUREMENT_STORED,S,e)},setConfig:function(e){e&&(e.adapter&&(y=e.adapter),e.errHandler&&(u=e.errHandler),e.dashMetrics&&(l=e.dashMetrics),e.mediaPlayerModel&&(c=e.mediaPlayerModel),e.requestModifier&&(p=e.requestModifier),e.manifestModel&&(h=e.manifestModel),e.serviceDescriptionController&&(g=e.serviceDescriptionController),e.eventBus&&(m=e.eventBus))},loadSteeringData:R,getCurrentSteeringResponseData:function(){return n},shouldQueryBeforeStart:function(){var e=C();return!!e&&e.queryBeforeStart},getSteeringDataFromManifest:C,stopSteeringRequestTimer:O,getSynthesizedBaseUrlElements:function(e){try{return x(e).map((function(e){var t=new Te(e.synthesizedUrl,e.serviceLocation);return t.queryParams=e.queryParams,t.dvb_priority=e.reference.dvb_priority,t.dvb_weight=e.reference.dvb_weight,t.availabilityTimeOffset=e.reference.availabilityTimeOffset,t.availabilityTimeComplete=e.reference.availabilityTimeComplete,t}))}catch(e){return t.error(e),[]}},getSynthesizedLocationElements:function(e){try{return x(e).map((function(e){var t=new xe(e.synthesizedUrl,e.serviceLocation);return t.queryParams=e.queryParams,t}))}catch(e){return t.error(e),[]}},initialize:function(){o=pt(v).create({errHandler:u,dashMetrics:l,mediaPlayerModel:c,requestModifier:p,errors:I}),m.on(f.Z.FRAGMENT_LOADING_STARTED,T,e),m.on(f.Z.MANIFEST_LOADING_STARTED,b,e),m.on(f.Z.MANIFEST_LOADING_FINISHED,E,e),m.on(f.Z.THROUGHPUT_MEASUREMENT_STORED,S,e)}},t=(0,d.Z)(v).getInstance().getLogger(e),P(),e}Ft.__dashjs_factory_name="ContentSteeringController";var Ut=c.Z.getSingletonFactory(Ft);function Bt(){var e,t,n,r=this.context,i=(0,C.Z)(r).getInstance();return e={select:function(e){if(!e||0===e.length)return null;var r=null;return i.get().streaming.applyContentSteering&&(r=function(e){var r=n.getCurrentSteeringResponseData();return r&&r.pathwayPriority&&r.pathwayPriority.length>0?function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=0,i=null,a=function(){var a=e[r],s=n.findIndex((function(e){return e.serviceLocation&&e.serviceLocation===a}));if(-1!==s&&!t.contains(n[s].serviceLocation))return i=n[s],"break";r+=1};r<e.length&&"break"!==a(););return i}(r.pathwayPriority,e):null}(e)),r||(r=function(e){return e[0]}(e)),r},setConfig:function(e){e.blacklistController&&(t=e.blacklistController),e.contentSteeringController&&(n=e.contentSteeringController)},reset:function(){t.reset()}},t=Nt(r).create({updateEventName:l.Z.SERVICE_LOCATION_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:l.Z.SERVICE_LOCATION_LOCATION_BLACKLIST_ADD}),n=Ut(r).getInstance(),e}Bt.__dashjs_factory_name="LocationSelector";var jt=c.Z.getClassFactory(Bt);function qt(){var e,t,n,r,i,a,o,c,h,p,g,m,y,v,_=this.context,T=(0,u.Z)(_).getInstance(),b=(0,X.Z)(_).getInstance();function E(){n=NaN,o=!1,i=!0,a=!1,S()}function S(){null!==r&&(clearTimeout(r),r=null)}function w(e){S(),a||(isNaN(e)&&!isNaN(n)&&(e=1e3*n),isNaN(e)||(t.debug("Refresh manifest in "+e+" milliseconds."),r=setTimeout(R,e)))}function A(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];o=!0;var t=h.getValue(),n=t.url,r=null,i=g.getPatchLocation(t),a=p.select(i),s=null;if(a&&!e)n=a.url,r=a.serviceLocation,s=a.queryParams;else{var u=function(e){var t=g.getLocation(e),n=y.getSynthesizedLocationElements(t);return t.concat(n)}(t),l=p.select(u);l&&(n=l.url,r=l.serviceLocation,s=l.queryParams)}b.isRelative(n)&&(n=b.resolve(n,t.url)),c.load(n,r,s)}function C(e){if(e){if(g.getIsPatch(e)){var r=e;e=h.getValue();var u=g.isPatchValid(e,r),c=u;if(u){var d=g.getPublishTime(e);c=g.applyPatchToManifest(e,r);var f=g.getPublishTime(e);c=d.getTime()!=f.getTime()}if(!c)return t.debug("Patch provided is invalid, performing full manifest refresh"),void A(!0);e.loadedTime=new Date}}else(e=h.getValue()).loadedTime=new Date;if(h.getValue()&&h.getValue().type===s.Z.DYNAMIC&&e.type===s.Z.STATIC)return T.trigger(l.Z.DYNAMIC_TO_STATIC),o=!1,void(a=!0);h.setValue(e);var p=new Date,m=(p.getTime()-e.loadedTime.getTime())/1e3;1e3*(n=g.getManifestUpdatePeriod(e,m))>2147483647&&(n=2147483.647),T.trigger(l.Z.MANIFEST_UPDATED,{manifest:e}),t.info("Manifest has been refreshed at "+p+"["+p.getTime()/1e3+"] "),i||w()}function R(){i||(o?w(v.get().streaming.manifestUpdateRetryInterval):A())}function D(e){e.error?e.error.code===I.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE&&m.error(e.error):C(e.manifest)}function x(){i=!1,w()}function N(){(i=!v.get().streaming.scheduling.scheduleWhilePaused)&&S()}function O(){o=!1}return e={initialize:function(){E(),T.on(l.Z.STREAMS_COMPOSED,O,this),T.on(f.Z.PLAYBACK_STARTED,x,this),T.on(f.Z.PLAYBACK_PAUSED,N,this),T.on(l.Z.INTERNAL_MANIFEST_LOADED,D,this)},setManifest:function(e){C(e)},refreshManifest:A,getIsUpdating:function(){return o},setConfig:function(e){e&&(e.manifestModel&&(h=e.manifestModel),e.adapter&&(g=e.adapter),e.manifestLoader&&(c=e.manifestLoader),e.errHandler&&(m=e.errHandler),e.locationSelector&&(p=e.locationSelector),e.settings&&(v=e.settings),e.contentSteeringController&&(y=e.contentSteeringController))},reset:function(){T.off(f.Z.PLAYBACK_STARTED,x,this),T.off(f.Z.PLAYBACK_PAUSED,N,this),T.off(l.Z.STREAMS_COMPOSED,O,this),T.off(l.Z.INTERNAL_MANIFEST_LOADED,D,this),E()}},t=(0,d.Z)(_).getInstance().getLogger(e),p=jt(_).create(),e}qt.__dashjs_factory_name="ManifestUpdater";var Ht=c.Z.getClassFactory(qt);function Gt(){var e,t,n,r,i,a,s,o,c,f,h,p,g,m,y,v,_=this.context,T=(0,u.Z)(_).getInstance(),b=(0,X.Z)(_).getInstance();function S(){o=[],c=[],f=null,h=null,g=null,p=NaN,n=!1,r=!1,m=i.get().streaming.utcSynchronization.timeBetweenSyncAttempts}function w(){i.get().streaming.utcSynchronization.enabled&&!n&&!r&&g&&g.value&&g.schemeIdUri&&!isNaN(p)&&!isNaN(i.get().streaming.utcSynchronization.backgroundAttempts)&&(h&&(Date.now()-h)/1e3<30||(o=[],r=!0,A(isNaN(i.get().streaming.utcSynchronization.backgroundAttempts)?2:i.get().streaming.utcSynchronization.backgroundAttempts)))}function A(e){try{if(e<=0)return void B();var t=Date.now();a[g.schemeIdUri](g.value,(function(n){var r=Date.now(),i=D(t,r,n);o.push(i),A(e-1)}),(function(){B()}))}catch(e){B()}}function C(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||0;if(!c||0===c.length||e>=c.length)x();else{var t=c[e];if(t)if(a.hasOwnProperty(t.schemeIdUri)){var n=(new Date).getTime();a[t.schemeIdUri](t.value,(function(e){var r=(new Date).getTime(),i=D(n,r,e);g=t,x(i)}),(function(){C(e+1)}))}else C(e+1);else x()}}function D(e,t,n){return n-(t-(t-e)/2)}function x(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:NaN,t=isNaN(e);t&&i.get().streaming.utcSynchronization.useManifestDateHeaderTimeSource?function(){var e=s.getLatestMPDRequestHeaderValueByID("Date"),t=null!==e?new Date(e).getTime():Number.NaN;isNaN(t)?U(!0):U(!1,t-Date.now())}():U(t,e)}function N(e){var t=Date.parse(e);return isNaN(t)&&(t=function(e){var t,n,r=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+\-])([0-9]{2})([0-9]{2}))?/.exec(e);return t=Date.UTC(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10),parseInt(r[4],10),parseInt(r[5],10),r[6]&&(parseInt(r[6],10)||0),r[7]&&1e3*parseFloat(r[7])||0),r[9]&&r[10]&&(n=60*parseInt(r[9],10)+parseInt(r[10],10),t+=("+"===r[8]?-1:1)*n*60*1e3),new Date(t).getTime()}(e)),t}function O(e){return Date.parse(e)}function P(e){return Date.parse(e)}function M(e,t,n){n()}function k(e,t,n){var r=N(e);isNaN(r)?n():t(r)}function L(e,t,n,r,i){var a,s,o=!1,u=new XMLHttpRequest,l=i?R.w.HEAD:R.w.GET,c=t.match(/\S+/g);if(t=c.shift(),a=function(){o||(o=!0,c.length?L(e,c.join(" "),n,r,i):r())},s=function(){var t,r;200===u.status&&(t=i?u.getResponseHeader("Date"):u.response,r=e(t),isNaN(r)||(n(r),o=!0))},b.isRelative(t)){var d=v.resolve();d&&(t=b.resolve(t,d.url))}u.open(l,t),u.timeout=5e3,u.onload=s,u.onloadend=a,u.send()}function F(e,t,n){L(P,e,t,n,!0)}function U(e,r){if(isNaN(p)||isNaN(r)||e||function(e){try{var n,r=j(e),a=isNaN(m)?30:m,s=isNaN(i.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor)?2:i.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor,o=isNaN(i.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts)?600:i.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts,u=isNaN(i.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts)?2:i.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts;r?(n=Math.min(a*s,o),t.debug("Increasing timeBetweenSyncAttempts to ".concat(n))):(n=Math.max(a/s,u),t.debug("Decreasing timeBetweenSyncAttempts to ".concat(n))),m=n}catch(e){}}(r),!e&&!isNaN(r)){f=Date.now(),n=!1;var a=isNaN(p);p=r,a&&w(),t.debug("Completed UTC sync. Setting client - server offset to ".concat(r))}e&&(g=null,n=!1,y.error(new E.Z(I.TIME_SYNC_FAILED_ERROR_CODE,I.TIME_SYNC_FAILED_ERROR_MESSAGE))),T.trigger(l.Z.UPDATE_TIME_SYNC_OFFSET,{offset:r}),T.trigger(l.Z.TIME_SYNCHRONIZATION_COMPLETED)}function B(){if(o&&0!==o.length){var e=o.reduce((function(e,t){return e+t}),0)/o.length;j(e)?t.debug("Completed background UTC sync. Offset is within allowed threshold and is not adjusted."):(t.debug("Completed background UTC sync. Setting client - server offset to ".concat(e)),p=e,T.trigger(l.Z.UPDATE_TIME_SYNC_OFFSET,{offset:p})),r=!1,h=Date.now()}}function j(e){try{if(isNaN(p))return!0;var t=i.get().streaming.utcSynchronization.maximumAllowedDrift&&!isNaN(i.get().streaming.utcSynchronization.maximumAllowedDrift)?i.get().streaming.utcSynchronization.maximumAllowedDrift:100;return e>=p-t&&e<=p+t}catch(e){return!0}}return e={initialize:function(){S(),a={"urn:mpeg:dash:utc:http-head:2014":F,"urn:mpeg:dash:utc:http-xsdate:2014":L.bind(null,N),"urn:mpeg:dash:utc:http-iso:2014":L.bind(null,O),"urn:mpeg:dash:utc:direct:2014":k,"urn:mpeg:dash:utc:http-head:2012":F,"urn:mpeg:dash:utc:http-xsdate:2012":L.bind(null,N),"urn:mpeg:dash:utc:http-iso:2012":L.bind(null,O),"urn:mpeg:dash:utc:direct:2012":k,"urn:mpeg:dash:utc:http-ntp:2014":M,"urn:mpeg:dash:utc:ntp:2014":M,"urn:mpeg:dash:utc:sntp:2014":M}},attemptSync:function(e,t){c=e,n||(function(e){try{if(!e||!i.get().streaming.utcSynchronization.enabled)return!1;var t=isNaN(m)?30:m;return!(f&&t&&!isNaN(t))||(Date.now()-f)/1e3>=t}catch(e){return!0}}(t)?(n=!0,C()):T.trigger(l.Z.TIME_SYNCHRONIZATION_COMPLETED))},setConfig:function(e){e&&(e.dashMetrics&&(s=e.dashMetrics),e.baseURLController&&(v=e.baseURLController),e.errHandler&&(y=e.errHandler),e.settings&&(i=e.settings))},reset:function(){S(),T.off(l.Z.ATTEMPT_BACKGROUND_SYNC,w,e)}},t=(0,d.Z)(_).getInstance().getLogger(e),T.on(l.Z.ATTEMPT_BACKGROUND_SYNC,w,e),e}Gt.__dashjs_factory_name="TimeSyncController";var Vt=c.Z.getSingletonFactory(Gt);Vt.HTTP_TIMEOUT_MS=5e3,c.Z.updateSingletonFactory(Gt.__dashjs_factory_name,Vt);var Yt=Vt;function zt(){var e,t,n,r,i,a=this.context,s=(0,u.Z)(a).getInstance();return e={attachMediaSource:function(e){var n=window.URL.createObjectURL(t);return e.setSource(n),"managedMediaSource"===r&&(e.setDisableRemotePlayback(!0),t.addEventListener("startstreaming",(function(){s.trigger(f.Z.MANAGED_MEDIA_SOURCE_START_STREAMING)})),t.addEventListener("endstreaming",(function(){s.trigger(f.Z.MANAGED_MEDIA_SOURCE_END_STREAMING)}))),n},createMediaSource:function(){var e="WebKitMediaSource"in window,n="MediaSource"in window;return"ManagedMediaSource"in window?(t=new ManagedMediaSource,r="managedMediaSource",i.info("Created ManagedMediaSource")):n?(t=new MediaSource,r="mediaSource",i.info("Created MediaSource")):e&&(t=new WebKitMediaSource,i.info("Created WebkitMediaSource")),t},detachMediaSource:function(e){e.setSource(null)},setConfig:function(e){e&&e.settings&&(n=e.settings)},setDuration:function e(r){t&&"open"===t.readyState&&(null===r&&isNaN(r)||t.duration!==r&&(r!==1/0||n.get().streaming.buffer.mediaSourceDurationInfinity||(r=Math.pow(2,32)),function(e){for(var t=e.sourceBuffers,n=0;n<t.length;n++)if(t[n].updating)return!0;return!1}(t)?setTimeout(e.bind(null,r),50):(i.info("Set MediaSource duration:"+r),t.duration=r)))},setSeekable:function(e,n){t&&"function"==typeof t.setLiveSeekableRange&&"function"==typeof t.clearLiveSeekableRange&&"open"===t.readyState&&e>=0&&e<n&&(t.clearLiveSeekableRange(),t.setLiveSeekableRange(e,n))},signalEndOfStream:function(e){if(e&&"open"===e.readyState){for(var t=e.sourceBuffers,n=0;n<t.length;n++){if(t[n].updating)return;if(0===t[n].buffered.length)return}i.info("call to mediaSource endOfStream"),e.endOfStream()}}},i=(0,d.Z)(a).getInstance().getLogger(e),e}zt.__dashjs_factory_name="MediaSourceController";var Zt=c.Z.getSingletonFactory(zt);function Kt(){var e,t,n,r,i,a,s,o,l,c,h,p="urn:mpeg:dash:event:2012",g="updated",m="added",y=this.context,v=(0,u.Z)(y).getInstance();function _(){if(!s||!o)throw new Error("setConfig function has to be called previously")}function T(){h=!1,n={},r={},i=null,c=!1,a=Date.now()/1e3}function b(){try{if(!c){c=!0;var e=o.getTime(),i=e-a;i=a>0?Math.max(0,i):0,E(r,i,e),E(n,i,e),S(r),S(n),a=e,c=!1}}catch(e){c=!1,t.error(e)}}function E(e,n,r){try{C(e,(function(i){if(void 0!==i){var a=isNaN(i.duration)?0:i.duration;i.calculatedPresentationTime<=r&&i.calculatedPresentationTime+n+a>=r?D(i,f.Z.EVENT_MODE_ON_START):(R(r,a+n,i.calculatedPresentationTime)||function(e){try{var n=e.eventStream.period.start+e.eventStream.period.duration;return e.calculatedPresentationTime>n}catch(e){return t.error(e),!1}}(i))&&(t.debug("Removing event ".concat(i.id," from period ").concat(i.eventStream.period.id," as it is expired or invalid")),function(e,n){try{var r=n.eventStream.schemeIdUri,i=n.eventStream.period.id,a=n.eventStream.value,s=n.id;e[i][r]=e[i][r].filter((function(e){return a&&e.eventStream.value&&e.eventStream.value!==a||e.id!==s})),0===e[i][r].length&&delete e[i][r]}catch(e){t.error(e)}}(e,i))}}))}catch(e){t.error(e)}}function S(e){try{for(var n in e)e.hasOwnProperty(n)&&0===Object.keys(e[n]).length&&delete e[n]}catch(e){t.error(e)}}function w(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.eventStream.schemeIdUri,i=e.eventStream.value,a=e.id,s="discarded";t[r]||(t[r]=[]);var o=t[r].findIndex((function(e){return(!i||e.eventStream.value&&e.eventStream.value===i)&&e.id===a}));if(-1===o)t[r].push(e),e.triggeredReceivedEvent=!1,e.triggeredStartEvent=!1,s=m;else if(n){var u=t[r][o];e.triggeredReceivedEvent=u.triggeredReceivedEvent,e.triggeredStartEvent=u.triggeredStartEvent,t[r][o]=e,s=g}return s}function A(e){try{if(1==e.eventStream.value){var n,r=e.calculatedPresentationTime;n=4294967295==e.calculatedPresentationTime?NaN:e.calculatedPresentationTime+e.duration,v.trigger(f.Z.MANIFEST_VALIDITY_CHANGED,{id:e.id,validUntil:r,newDuration:n,newManifestValidAfter:NaN},{mode:f.Z.EVENT_MODE_ON_START})}}catch(e){t.error(e)}}function I(e){try{var n=o.getTime();C(e,(function(e){var t=e.eventStream&&e.eventStream.period&&!isNaN(e.eventStream.period.duration)?e.eventStream.period.duration:NaN,r=e.eventStream&&e.eventStream.period&&!isNaN(e.eventStream.period.start)?e.eventStream.period.start:NaN;if(!isNaN(t)&&!isNaN(r)){var i=e.calculatedPresentationTime;Math.abs(i-n)<300&&D(e,f.Z.EVENT_MODE_ON_START)}}))}catch(e){t.error(e)}}function C(e,n){try{if(e)for(var r=Object.keys(e),i=0;i<r.length;i++)for(var a=e[r[i]],s=Object.keys(a),o=0;o<s.length;o++)a[s[o]].forEach((function(e){void 0!==e&&n(e)}))}catch(e){t.error(e)}}function R(e,n,r){try{return e-n>r}catch(e){return t.error(e),!1}}function D(e,n){try{var r=o.getTime(),i=e.id;if(n===f.Z.EVENT_MODE_ON_RECEIVE&&!e.triggeredReceivedEvent)return t.debug("Received event ".concat(i)),e.triggeredReceivedEvent=!0,void v.trigger(e.eventStream.schemeIdUri,{event:e},{mode:n});e.triggeredStartEvent||(e.eventStream.schemeIdUri===p&&1==e.eventStream.value?0===e.duration&&0===e.presentationTimeDelta||(t.debug("Starting manifest refresh event ".concat(i," at ").concat(r)),function(){try{_(),s.refreshManifest()}catch(e){t.error(e)}}()):"urn:mpeg:dash:event:callback:2015"===e.eventStream.schemeIdUri&&1==e.eventStream.value?(t.debug("Starting callback event ".concat(i," at ").concat(r)),function(e){try{(0,se.Z)(y).create({}).load({method:"get",url:e,request:{responseType:"arraybuffer"}})}catch(e){t.error(e)}}(e.messageData)):(t.debug("Starting event ".concat(i," from period ").concat(e.eventStream.period.id," at ").concat(r)),v.trigger(e.eventStream.schemeIdUri,{event:e},{mode:n})),e.triggeredStartEvent=!0)}catch(e){t.error(e)}}return e={addInlineEvents:function(e,r){try{if(_(),n[r]||(n[r]={}),e)for(var i=0;i<e.length;i++){var a=e[i];if(!R(o.getTime(),isNaN(a.duration)?0:a.duration,a.calculatedPresentationTime)){var s=w(a,n[r],!0);s===m?(t.debug("Added inline event with id ".concat(a.id," from period ").concat(r)),D(a,f.Z.EVENT_MODE_ON_RECEIVE)):s===g&&t.debug("Updated inline event with id ".concat(a.id," from period ").concat(r))}}}catch(e){throw e}},addInbandEvents:function(e,n){try{_(),r[n]||(r[n]={});for(var i=0;i<e.length;i++){var a=e[i];R(o.getTime(),isNaN(a.duration)?0:a.duration,a.calculatedPresentationTime)||(w(a,r[n],!1)===m?(a.eventStream.schemeIdUri===p&&A(a),t.debug("Added inband event with id ".concat(a.id," from period ").concat(n)),D(a,f.Z.EVENT_MODE_ON_RECEIVE)):t.debug("Inband event with scheme_id_uri ".concat(a.eventStream.schemeIdUri,", value ").concat(a.eventStream.value,", period id ").concat(n," and event id ").concat(a.id," was ignored because it has been added before.")))}b()}catch(e){throw e}},getInbandEvents:function(){return r},getInlineEvents:function(){return n},start:function(){try{_(),t.debug("Start Event Controller");var e=l.get().streaming.eventControllerRefreshDelay;h||isNaN(e)||(h=!0,i=setInterval(b,e))}catch(e){throw e}},setConfig:function(e){try{if(!e)return;e.manifestUpdater&&(s=e.manifestUpdater),e.playbackController&&(o=e.playbackController),e.settings&&(l=e.settings)}catch(e){throw e}},reset:function(){(function(){try{null!==i&&h&&(clearInterval(i),i=null,h=!1,function(){try{I(r),I(n)}catch(e){t.error(e)}}())}catch(e){throw e}})(),T()}},t=(0,d.Z)(y).getInstance().getLogger(e),T(),e}Kt.__dashjs_factory_name="EventController";var Wt=c.Z.getSingletonFactory(Kt),Xt={LEVELS:{SUGGESTION:"Suggestion",WARNING:"Warning",ERROR:"Error"},EVENTS:{NO_UTC_TIMING_ELEMENT:{key:"NO_UTC_TIMING_ELEMENT",message:"No UTCTiming element is present in the manifest. You may experience playback failures. For a detailed validation use https://conformance.dashif.org/"},NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE:{key:"NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE",message:'SMPTE 2052-1:2013 defines the attribute name as "imageType" and does not define "imagetype"'},INVALID_DVR_WINDOW:{key:"INVALID_DVR_WINDOW",message:"No valid segment found when applying a specification compliant DVR window calculation. Using SegmentTimeline entries as a fallback."}}};function $t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Qt(){var e,t,n,r,i,s,c,h,p,g,m,y,v,_,T,b,S,w,A,C,R,D,x,N,O,P,k,L,F,U,B,j,q,H,G,V,Y,z,Z,K,W,X,$,ee,te,ne,re,ie,ae=this.context,se=(0,u.Z)(ae).getInstance();function oe(){if(!(s&&s.hasOwnProperty("load")&&R&&R.hasOwnProperty("initialize")&&R.hasOwnProperty("reset")&&R.hasOwnProperty("getClientTimeOffset")&&c&&C&&p&&q))throw new Error(a.Z.MISSING_CONFIG_ERROR)}function ue(){!function(){try{var e=h.getStreamsInfo();if(!x&&0===e.length)throw new Error("There are no periods in the MPD");x&&e.length>0&&p.updateManifestUpdateInfo({currentTime:q.getTime(),buffered:j.getBufferRange(),presentationStartTime:e[0].start,clientTimeOffset:R.getClientTimeOffset()}),D.length>0&&function(e){0!==e.length?D=D.filter((function(n){var r=e.filter((function(e){return e.id===n.getId()})).length>0||n.getId()===x.getId();return r||(t.debug("Removing stream ".concat(n.getId())),n.reset(!0)),r})):t.warn("No periods included in the current manifest. Skipping the filtering of outdated stream objects.")}(e);for(var n=[],r=0,i=e.length;r<i;r++){var a=e[r];n.push(ce(a)),p.addManifestUpdateStreamInfo(a)}Promise.all(n).then((function(){return new Promise((function(t,n){x?t():de(e,t,n)}))})).then((function(){se.trigger(l.Z.STREAMS_COMPOSED),Ne()})).catch((function(e){throw e}))}catch(e){C.error(new E.Z(I.MANIFEST_ERROR_ID_NOSTREAMS_CODE,e.message+" nostreamscomposed",c.getValue())),U=!0,Xe()}}()}function le(){te=!0}function ce(e){var t=Ze(e.id);return t?t.updateData(e):(t=Mt(ae).create({manifestModel:c,mediaPlayerModel:G,dashMetrics:p,manifestUpdater:i,adapter:h,timelineConverter:R,capabilities:n,capabilitiesFilter:r,errHandler:C,baseURLController:v,segmentBaseController:_,textController:O,abrController:b,playbackController:q,eventController:w,mediaController:S,protectionController:N,videoModel:j,streamInfo:e,settings:ee}),D.push(t),t.initialize(),Promise.resolve())}function de(e,n,r){try{Se();var i=p.getCurrentDVRInfo().range;if(i.end<i.start){ne&&clearTimeout(ne);var a=Math.min(1e3*(-1*(i.end-i.start)+2),2147483647);return t.debug("Waiting for ".concat(a," ms before playback can start")),se.trigger(l.Z.AST_IN_FUTURE,{delay:a}),void(ne=setTimeout((function(){de(e,n,r)}),a))}ee.get().streaming.applyProducerReferenceTime&&H.calculateProducerReferenceTimeOffsets(e);var s=e[0].manifestInfo;if(ee.get().streaming.applyServiceDescription&&H.applyServiceDescription(s),h.getIsDynamic()){var o=Be(e,s);q.computeAndSetLiveDelay(o,s)}(ee.get().streaming.applyContentSteering&&y.shouldQueryBeforeStart()?y.loadSteeringData():Promise.resolve()).then((function(){var e=c.getValue();e&&v.update(e),fe(),n()})).catch((function(e){t.error(e),fe(),n()}))}catch(e){r(e)}}function fe(){var e=function(){var e;if(h.getIsDynamic()){var n=p.getCurrentDVRInfo();e=(n&&n.range?n.range.end:0)-q.getOriginalLiveDelay();var r=n?n.range:null;if(r){if(isNaN(re)&&-1===re.toString().indexOf("posix:")){var i=Le(!0);isNaN(i)||(t.info("Start time from URI parameters: ".concat(i)),e=Math.min(e,i))}else{t.info("Start time provided by the app: ".concat(re));var a=Fe(!0,re);isNaN(a)||(e=Math.min(e,a))}var s=ee.get().streaming.timeShiftBuffer.calcFromSegmentTimeline?.1:0;e=Math.max(e,r.start+s)}}else if(e=Qe()[0].getStreamInfo().start,isNaN(re)){var o=Le(!1);isNaN(o)||(t.info("Start time from URI parameters: ".concat(o)),e=Math.max(e,o))}else{t.info("Start time provided by the app: ".concat(re));var u=Fe(!1,re);isNaN(u)||(e=Math.max(e,u))}return e}(),n=Ee(e),r=null!==n?n:D[0];se.trigger(l.Z.INITIAL_STREAM_SWITCH,{startTime:e}),he(r,null,e),K||(K=setInterval((function(){!L&&q.getTimeToStreamEnd()<=0&&!q.isSeeking()&&se.trigger(l.Z.PLAYBACK_ENDED,{isLast:ze().isLast})}),200))}function he(e,n,r){try{if(L||!e||n===e&&e.getIsActive())return;L=!0,se.trigger(l.Z.PERIOD_SWITCH_STARTED,{fromStreamInfo:n?n.getStreamInfo():null,toStreamInfo:e.getStreamInfo()});var i=!1;x=e,n&&(i=Te(e,n),n.deactivate(i)),r=isNaN(r)?!i&&n?e.getStreamInfo().start:NaN:r,t.info("Switch to stream ".concat(e.getId(),". Seektime is ").concat(r,", current playback time is ").concat(q.getTime(),". Seamless period switch is set to ").concat(i)),X=X.filter((function(e){return e.getId()!==x.getId()})),q.initialize(ze(),!!n),j.getElement()?pe(r,i,!1):ge(r,i)}catch(e){L=!1}}function pe(e,n){var r,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];function a(){if(B&&"open"===B.readyState){t.debug("MediaSource is open!"),window.URL.revokeObjectURL(r),B.removeEventListener("sourceopen",a),B.removeEventListener("webkitsourceopen",a),ke();var s=p.getCurrentDVRInfo();g.setSeekable(s.range.start,s.range.end),i?(isNaN(e)||q.seek(e,!0,!0),x.setMediaSource(B).then((function(){x.initializeForTextWithMediaSource(B)}))):ge(e,n)}}function s(){B.addEventListener("sourceopen",a,!1),B.addEventListener("webkitsourceopen",a,!1),r=g.attachMediaSource(j),t.debug("MediaSource attached to element. Waiting on open...")}B?n?ge(e,n):(g.detachMediaSource(j),s()):(B=g.createMediaSource(),s())}function ge(e,t){x.activate(B,t?W:void 0,e).then((function(t){if(t){var n=Object.keys(t);n.length>0&&t[n[0]].getBuffer().changeType&&($=!0),W=t}isNaN(e)||(se.trigger(l.Z.SEEK_TARGET,{time:e},{streamId:x.getId()}),q.seek(e,!1,!0),x.startScheduleControllers()),L=!1,se.trigger(l.Z.PERIOD_SWITCH_COMPLETED,{toStreamInfo:ze()})}))}function me(e){var t=Ee(e.seekTime);t&&t!==x?t&&t!==x&&(ye(),function(e,t){var n=e&&!isNaN(e.seekTime)?e.seekTime:NaN,r=x.getProcessors().map((function(t){return t.prepareOuterPeriodPlaybackSeeking(e)}));Promise.all(r).then((function(){he(t,x,n)})).catch((function(e){C.error(e)}))}(e,t)):(ye(),function(e){x.getProcessors().forEach((function(t){return t.prepareInnerPeriodPlaybackSeeking(e)})),Ge(J.USER_REQUEST_STOP_REASON)}(e)),Ve(Q.SEEK_START_REASON)}function ye(){ve()}function ve(){X&&X.length>0&&(X.forEach((function(e){e.deactivate(!0)})),X=[])}function _e(e){if(e.newMediaInfo.streamInfo.id===x.getId()){if(ve(),ee.get().streaming.buffer.resetSourceBuffersForTrackSwitch&&e.oldMediaInfo&&e.oldMediaInfo.codec!==e.newMediaInfo.codec){var t=q.getTime();return x.deactivate(!1),void pe(t,!1,!1)}x.prepareTrackChange(e)}}function Te(e,t){try{return ee.get().streaming.buffer.reuseExistingSourceBuffers&&(t.isProtectionCompatible(e)||te)&&($&&ee.get().streaming.buffer.useChangeTypeForTrackSwitch||t.isMediaCodecCompatible(e,t))}catch(e){return!1}}function be(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;B&&!e.getPreloaded()&&Te(e,t)&&e.startPreloading(B,W).then((function(){X.push(e)}))}function Ee(e){if(isNaN(e))return null;for(var t=D.length,n=0;n<t;n++){var r=D[n];if(e<parseFloat((r.getStartTime()+r.getDuration()).toFixed(5)))return r}return null}function Se(){try{var e=h.getIsDynamic(),t=h.getStreamsInfo()[0].manifestInfo,n=q.getTime(),r=R.calcTimeShiftBufferWindow(D,e),i=Pe();if(void 0===r.start||void 0===r.end)return;i&&0!==i.length?i.forEach((function(e){p.addDVRInfo(e.getType(),n,t,r)})):p.addDVRInfo(a.Z.VIDEO,n,t,r)}catch(e){}}function we(e){if(z&&k){var t=G.getInitialBufferLevel(),n=[a.Z.TEXT];(isNaN(t)||t<=q.getBufferLevel(n)||h.getIsDynamic()&&t>q.getLiveDelay())&&(z=!1,Ve(Q.INITIAL_PLAYOUT_START_REASON),q.play())}e&&e.mediaType&&p.addBufferLevel(e.mediaType,new Date,1e3*e.bufferLevel)}function Ae(e){e.streamInfo.id===x.getId()&&e.reason&&e.reason.forceReplace&&ve(),Ze(e.streamInfo.id).prepareQualityChange(e)}function Ie(){if(h.getIsDynamic()&&0!==q.getOriginalLiveDelay()&&x){var e=h.getStreamsInfo();if(e.length>0){var t=e[0].manifestInfo,n=Be(e,t);q.computeAndSetLiveDelay(n,t)}}}function Ce(){if(qe()){var e=j.getPlaybackQuality();e&&p.addDroppedFrames(e)}}function Re(){t.debug("[onPlaybackStarted]"),!z&&Y&&Ve(Q.RESUME_FROM_PAUSE_START_REASON),z&&(z=!1),Z&&(Z=!1,ee.get().streaming.applyContentSteering&&!y.shouldQueryBeforeStart()&&y.loadSteeringData()),Y=!1}function De(e){t.debug("[onPlaybackPaused]"),e.ended||(Y=!0,Ge(J.USER_REQUEST_STOP_REASON))}function xe(e){t.debug("Stream with id ".concat(e.streamInfo.id," finished buffering"));var n=e.streamInfo.isLast;B&&n?(t.info("[onStreamBufferingCompleted] calls signalEndOfStream of mediaSourceController."),g.signalEndOfStream(B)):Ne()}function Ne(){if(x&&x.getHasFinishedBuffering())for(var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{var t=e||x||null;if(t){var n=t.getStreamInfo();return D.filter((function(e){var t=e.getStreamInfo();return t.start>n.start&&n.id!==t.id}))}}catch(e){return[]}}(x),t=0;t<e.length;){var n=e[t],r=0===t?x:e[t-1];!n.getPreloaded()&&r.getHasFinishedBuffering()&&B&&be(n,r),t+=1}}function Oe(){K&&(clearInterval(K),K=null)}function Pe(){return x?x.getProcessors():[]}function Me(e){if(x&&!x.getIsEndedEventSignaled()){x.setIsEndedEventSignaled(!0);var n=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||x||null;if(!e)return null;for(var t=e.getStreamInfo(),n=t.start,r=0,i=-1,a=NaN;r<D.length;){var s=D[r].getStreamInfo(),o=s.start-n;o>0&&(isNaN(a)||o<a)&&t.id!==s.id&&(a=o,i=r),r+=1}return i>=0?D[i]:null}();n?(t.debug("StreamController onEnded, found next stream with id ".concat(n.getStreamInfo().id,". Switching from ").concat(x.getStreamInfo().id," to ").concat(n.getStreamInfo().id)),he(n,x,NaN)):(t.debug("StreamController no next stream found"),x.setIsEndedEventSignaled(!1)),Ge(n?J.END_OF_PERIOD_STOP_REASON:J.END_OF_CONTENT_STOP_REASON)}e&&e.isLast&&(Oe(),y.stopSteeringRequestTimer())}function ke(e){var t=e||ze().manifestInfo.duration;g.setDuration(t)}function Le(e){var t=T.getURIFragmentData();if(!t||!t.t)return NaN;var n=Qe()[0].getStreamInfo().start;return t.t=t.t.split(",")[0],Ue(e,t.t,n)}function Fe(e,t){var n=0;return e||(n=Qe()[0].getStreamInfo().start),Ue(e,t,n)}function Ue(e,t,n){var r=h.getRegularPeriods()[0],i=t.toString(),a=-1!==i.indexOf("posix:")?"now"===i.substring(6)?Date.now()/1e3:parseFloat(i.substring(6)):NaN;return e&&!isNaN(a)?R.calcPresentationTimeFromWallTime(new Date(1e3*a),r):parseFloat(i)+n}function Be(e,t){try{var n=NaN;if(t&&!isNaN(t.maxFragmentDuration)&&isFinite(t.maxFragmentDuration))return t.maxFragmentDuration;if(e&&1===e.length){var r=e[0],i=[a.Z.VIDEO,a.Z.AUDIO,a.Z.TEXT].reduce((function(e,t){var n=h.getMediaInfoForType(r,t);return n&&!1!==n.isFragmented&&e.push(n),e}),[]).reduce((function(e,t){var n=h.getVoRepresentations(t);return n&&n.length>0&&n.forEach((function(t){t&&e.push(t)})),e}),[]).reduce((function(e,t){var n=h.convertRepresentationToRepresentationInfo(t);return n&&n.fragmentDuration&&!isNaN(n.fragmentDuration)&&e.push(n.fragmentDuration),e}),[]);n=Math.max.apply(Math,function(e){if(Array.isArray(e))return $t(e)}(s=i)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(s)||function(e,t){if(e){if("string"==typeof e)return $t(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$t(e,t):void 0}}(s)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}return isFinite(n)?n:NaN}catch(e){return NaN}var s}function je(e){if(e.error)U=!0,Xe();else{t.info("Manifest updated... updating data system wide.");var n=e.manifest;h.updatePeriods(n);var i=h.getUTCTimingSources();!h.getIsDynamic()||i&&0!==i.length||se.trigger(f.Z.CONFORMANCE_VIOLATION,{level:Xt.LEVELS.WARNING,event:Xt.EVENTS.NO_UTC_TIMING_ELEMENT});var a=h.getIsDynamic()?i.concat(V.getUTCTimingSources()):i;r.filterUnsupportedFeatures(n).then((function(){v.initialize(n),m.attemptSync(a,h.getIsDynamic())}))}}function qe(){return!!x&&x.getHasVideoTrack()}function He(){return!!x&&x.getHasAudioTrack()}function Ge(e,t){t=t||new Date,Pe().forEach((function(n){n.finalisePlayList(t,e)})),p.addPlayList()}function Ve(e){p.createPlaylistMetrics(1e3*q.getTime(),e)}function Ye(e){if(e.error){var n="";switch(e.error.code){case 1:n="MEDIA_ERR_ABORTED";break;case 2:n="MEDIA_ERR_NETWORK";break;case 3:n="MEDIA_ERR_DECODE",ie.counts.mediaErrorDecode+=1;break;case 4:n="MEDIA_ERR_SRC_NOT_SUPPORTED";break;case 5:n="MEDIA_ERR_ENCRYPTED";break;default:n="UNKNOWN"}"MEDIA_ERR_DECODE"===n&&ee.get().errors.recoverAttempts.mediaErrorDecode>=ie.counts.mediaErrorDecode?function(){t.warn("A MEDIA_ERR_DECODE occured: Resetting the MediaSource");var e=q.getTime();x.deactivate(!1),t.warn("MediaSource has been resetted. Resuming playback from time ".concat(e)),pe(e,!1,!1)}():(F=!0,e.error.message&&(n+=" ("+e.error.message+")"),e.error.msExtendedCode&&(n+=" (0x"+(e.error.msExtendedCode>>>0).toString(16).toUpperCase()+")"),t.fatal("Video Element Error: "+n),e.error&&t.fatal(e.error),C.error(new E.Z(e.error.code,n)),Xe())}}function ze(){return x?x.getStreamInfo():null}function Ze(e){for(var t=0,n=D.length;t<n;t++)if(D[t].getId()===e)return D[t];return null}function Ke(e){isNaN(e.newDuration)||ke(e.newDuration)}function We(){D=[],re=NaN,N=null,L=!1,x=null,F=!1,U=!1,z=!0,Z=!0,Y=!1,k=!0,K=null,te=!1,$=!1,X=[],ne=null,ie={counts:{mediaErrorDecode:0}}}function Xe(){oe(),m.reset(),Ge(F||U?J.FAILURE_STOP_REASON:J.USER_REQUEST_STOP_REASON);for(var t=0,n=D?D.length:0;t<n;t++)D[t].reset(F);se.off(f.Z.PLAYBACK_TIME_UPDATED,Ce,e),se.off(f.Z.PLAYBACK_SEEKING,me,e),se.off(f.Z.PLAYBACK_ERROR,Ye,e),se.off(f.Z.PLAYBACK_STARTED,Re,e),se.off(f.Z.PLAYBACK_PAUSED,De,e),se.off(f.Z.PLAYBACK_ENDED,Me,e),se.off(f.Z.METRIC_ADDED,$e,e),se.off(f.Z.MANIFEST_VALIDITY_CHANGED,Ke,e),se.off(f.Z.BUFFER_LEVEL_UPDATED,we,e),se.off(f.Z.QUALITY_CHANGE_REQUESTED,Ae,e),l.Z.KEY_SESSION_UPDATED&&se.off(l.Z.KEY_SESSION_UPDATED,le,e),se.off(l.Z.MANIFEST_UPDATED,je,e),se.off(l.Z.STREAM_BUFFERING_COMPLETED,xe,e),se.off(l.Z.TIME_SYNCHRONIZATION_COMPLETED,ue,e),se.off(l.Z.CURRENT_TRACK_CHANGED,_e,e),se.off(l.Z.SETTING_UPDATED_LIVE_DELAY,Ie,e),se.off(l.Z.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,Ie,e),v.reset(),i.reset(),w.reset(),p.clearAllCurrentMetrics(),c.setValue(null),s.reset(),R.reset(),A.reset(),B&&(g.detachMediaSource(j),B=null),j=null,N&&(N=null,P=null,c.getValue()&&se.trigger(l.Z.PROTECTION_DESTROYED,{data:c.getValue().url})),Oe(),se.trigger(l.Z.STREAM_TEARDOWN_COMPLETE),We()}function $e(e){if(e.metric===o.Z.DVR_INFO){var t=He()?a.Z.AUDIO:a.Z.VIDEO;e.mediaType===t&&g.setSeekable(e.value.range.start,e.value.range.end)}}function Qe(){return D}return e={initialize:function(t,n){oe(),k=t,P=n,R.initialize(),(i=Ht(ae).create()).setConfig({manifestModel:c,adapter:h,manifestLoader:s,errHandler:C,settings:ee,contentSteeringController:y}),i.initialize(),(w=Wt(ae).getInstance()).setConfig({manifestUpdater:i,playbackController:q,settings:ee}),w.start(),m.setConfig({dashMetrics:p,baseURLController:v,errHandler:C,settings:ee}),m.initialize(),g.setConfig({settings:ee}),N&&(se.trigger(l.Z.PROTECTION_CREATED,{controller:N}),N.setMediaElement(j.getElement()),P&&N.setProtectionData(P)),se.on(f.Z.PLAYBACK_TIME_UPDATED,Ce,e),se.on(f.Z.PLAYBACK_SEEKING,me,e),se.on(f.Z.PLAYBACK_ERROR,Ye,e),se.on(f.Z.PLAYBACK_STARTED,Re,e),se.on(f.Z.PLAYBACK_PAUSED,De,e),se.on(f.Z.PLAYBACK_ENDED,Me,e),se.on(f.Z.METRIC_ADDED,$e,e),se.on(f.Z.MANIFEST_VALIDITY_CHANGED,Ke,e),se.on(f.Z.BUFFER_LEVEL_UPDATED,we,e),se.on(f.Z.QUALITY_CHANGE_REQUESTED,Ae,e),l.Z.KEY_SESSION_UPDATED&&se.on(l.Z.KEY_SESSION_UPDATED,le,e),se.on(l.Z.MANIFEST_UPDATED,je,e),se.on(l.Z.STREAM_BUFFERING_COMPLETED,xe,e),se.on(l.Z.TIME_SYNCHRONIZATION_COMPLETED,ue,e),se.on(l.Z.CURRENT_TRACK_CHANGED,_e,e),se.on(l.Z.SETTING_UPDATED_LIVE_DELAY,Ie,e),se.on(l.Z.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,Ie,e)},getActiveStreamInfo:ze,addDVRMetric:Se,hasVideoTrack:qe,hasAudioTrack:He,getStreamById:Ze,getStreamForTime:Ee,getTimeRelativeToStreamId:function(e,t){for(var n=null,r=0,i=0,a=null,s=0;s<D.length;s++){if(i=(n=D[s]).getStartTime(),a=n.getDuration(),Number.isFinite(i)&&(r=i),n.getId()===t)return e-r;Number.isFinite(a)&&(r+=a)}return null},load:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NaN;oe(),re=t,s.load(e)},loadWithManifest:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NaN;(function(){if(!i||!i.hasOwnProperty("setManifest"))throw new Error("initialize function has to be called previously")})(),re=t,i.setManifest(e)},getActiveStreamProcessors:Pe,setConfig:function(e){e&&(e.capabilities&&(n=e.capabilities),e.capabilitiesFilter&&(r=e.capabilitiesFilter),e.manifestLoader&&(s=e.manifestLoader),e.manifestModel&&(c=e.manifestModel),e.mediaPlayerModel&&(G=e.mediaPlayerModel),e.customParametersModel&&(V=e.customParametersModel),e.protectionController&&(N=e.protectionController),e.adapter&&(h=e.adapter),e.dashMetrics&&(p=e.dashMetrics),e.errHandler&&(C=e.errHandler),e.timelineConverter&&(R=e.timelineConverter),e.videoModel&&(j=e.videoModel),e.playbackController&&(q=e.playbackController),e.serviceDescriptionController&&(H=e.serviceDescriptionController),e.contentSteeringController&&(y=e.contentSteeringController),e.textController&&(O=e.textController),e.abrController&&(b=e.abrController),e.mediaController&&(S=e.mediaController),e.settings&&(ee=e.settings),e.baseURLController&&(v=e.baseURLController),e.uriFragmentModel&&(T=e.uriFragmentModel),e.segmentBaseController&&(_=e.segmentBaseController))},setProtectionData:function(e){P=e,N&&N.setProtectionData(P)},getIsStreamSwitchInProgress:function(){return L},switchToVideoElement:function(e){x&&(q.initialize(ze()),pe(e,!1,!0))},getHasMediaOrInitialisationError:function(){return F||U},getStreams:Qe,getActiveStream:function(){return x},getInitialPlayback:function(){return z},getAutoPlay:function(){return k},reset:Xe},t=(0,d.Z)(ae).getInstance().getLogger(e),m=Yt(ae).getInstance(),g=Zt(ae).getInstance(),A=M(ae).getInstance(),We(),e}Qt.__dashjs_factory_name="StreamController";var Jt=c.Z.getSingletonFactory(Qt);function en(){var e,t,n,r,i,s,o,c,f,h,p,g,m=this.context,y=(0,u.Z)(m).getInstance();function v(){g.debug("Stopping the gap controller"),i&&(clearInterval(i),i=null),function(){y.off(l.Z.WALLCLOCK_TIME_UPDATED,S,this),y.off(l.Z.INITIAL_STREAM_SWITCH,E,this),y.off(l.Z.PLAYBACK_SEEKING,_,this),y.off(l.Z.BUFFER_REPLACEMENT_STARTED,T,e),y.off(l.Z.TRACK_CHANGE_RENDERED,b,e)}(),i=null,s=NaN,r=0,h=null,p={}}function _(){h&&(clearTimeout(h),h=null)}function T(e){try{if(e.streamId!==c.getActiveStreamInfo().id||e.mediaType!==a.Z.VIDEO&&e.mediaType!==a.Z.AUDIO)return;e.streamId===c.getActiveStreamInfo().id&&(p[e.mediaType]=!0)}catch(e){g.error(e)}}function b(e){e&&e.mediaType&&(p[e.mediaType]=!1)}function E(){i||function(){try{i||(g.debug("Starting the gap controller"),i=setInterval((function(){w()&&A(o.getTime())}),100))}catch(e){}}()}function S(){if(w(n.get().streaming.gaps.enableSeekFix)&&++r>=10){var e=o.getTime();t===e?A(e,!0):(t=e,s=NaN),r=0}}function w(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!c.getActiveStream())return!1;var t=Object.keys(p).some((function(e){return p[e]})),r=!!e&&function(){var e=c.getActiveStream(),t=parseFloat((e.getStartTime()+e.getDuration()).toFixed(5));return o.getTime()+n.get().streaming.gaps.threshold>=t}();return!t&&n.get().streaming.gaps.jumpGaps&&c.getActiveStreamProcessors().length>0&&(!o.isSeeking()||r)&&!o.isPaused()&&!c.getIsStreamSwitchInProgress()&&!c.getHasMediaOrInitialisationError()}function A(e){var t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=n.get().streaming.gaps.enableStallFix,a=n.get().streaming.gaps.stallSeek,u=n.get().streaming.gaps.smallGapLimit,l=n.get().streaming.gaps.jumpLargeGaps,d=f.getBufferRange(),p=NaN,m=!1;if(t=function(e,t){try{if(!e||e.length<=1&&t>0)return NaN;for(var r=NaN,i=0;isNaN(r)&&i<e.length;){var a=i>0?e.end(i-1):0;t<e.start(i)&&a-t<n.get().streaming.gaps.threshold&&(r=i),i+=1}return r}catch(e){return null}}(d,e),!isNaN(t)){var y=d.start(t),v=y-e;v>0&&(v<=u||l)&&(p=y)}var _=o.getTimeToStreamEnd();if(isNaN(p)&&r&&isFinite(_)&&!isNaN(_)&&_<u&&(p=parseFloat(o.getStreamEndTime().toFixed(5)),m=!0),i&&isNaN(p)&&r&&isNaN(t)&&function(e,t){for(var n=0,r=e.length;n<r;n++)if(t>=e.start(n)&&t<=e.end(n))return!0;return!1}(d,e)&&(0===a?(g.warn("Toggle play pause to break stall"),f.pause(),f.play()):(g.warn("Jumping ".concat(a,"s to break stall")),p=e+a)),p>0&&s!==p&&p>e&&!h){var T=p-e;if(m){var b=c.getStreamForTime(p),E=b&&!!b.getPreloaded();g.warn("Jumping to end of stream because of gap from ".concat(e," to ").concat(p,". Gap duration: ").concat(T)),o.seek(p,!0,E)}else{var S=o.getIsDynamic(),w=t>0?d.end(t-1):e,A=S?1e3*Math.max(0,T-.1):0;h=window.setTimeout((function(){o.seek(p,!0,!0),g.warn("Jumping gap occuring in period ".concat(c.getActiveStream().getStreamId()," starting at ").concat(w," and ending at ").concat(p,". Jumping by: ").concat(p-w)),h=null}),A)}s=p}}return e={reset:v,setConfig:function(e){e&&(e.settings&&(n=e.settings),e.playbackController&&(o=e.playbackController),e.streamController&&(c=e.streamController),e.videoModel&&(f=e.videoModel))},initialize:function(){!function(){y.on(l.Z.WALLCLOCK_TIME_UPDATED,S,this),y.on(l.Z.INITIAL_STREAM_SWITCH,E,this),y.on(l.Z.PLAYBACK_SEEKING,_,this),y.on(l.Z.BUFFER_REPLACEMENT_STARTED,T,e),y.on(l.Z.TRACK_CHANGE_RENDERED,b,e)}()}},g=(0,d.Z)(m).getInstance().getLogger(e),v(),e}en.__dashjs_factory_name="GapController";var tn=c.Z.getSingletonFactory(en);function nn(){var e,t,n,r,i,s,c,h,p,g,m=this.context,y=(0,u.Z)(m).getInstance();function v(){t=!1;var e=Fe.Z.parseUserAgent();n=e&&e.browser&&e.browser.name&&"safari"===e.browser.name.toLowerCase()}function _(){t=!1}function T(e){if(e.streamId===s.getActiveStreamInfo().id&&p){var t=c.getLiveDelay();c.getBufferLevel()>t/2&&(p=!1)}}function b(e){e.streamId===s.getActiveStreamInfo().id&&(p=e.state===o.Z.BUFFER_EMPTY)}function E(){h.getCatchupModeEnabled()||r.setPlaybackRate(1)}function S(){c.getIsDynamic()&&h.getCatchupModeEnabled()&&(h.getCatchupPlaybackRates().max>0||h.getCatchupPlaybackRates().min<0)&&!c.isPaused()&&!c.isSeeking()&&function(){try{return!(!c.getTime()>0||t)&&(A()===a.Z.LIVE_CATCHUP_MODE_LOLP?function(e,t){try{return Math.abs(w())>0||e<t}catch(e){return!1}}(c.getBufferLevel(),i.get().streaming.liveCatchup.playbackBufferMin):function(){try{return Math.abs(w())>0}catch(e){return!1}}())}catch(e){return!1}}()&&function(){if(!t&&r){var e,s=r.getPlaybackRate(),o=h.getCatchupPlaybackRates(),u=c.getBufferLevel(),l=w(),d=h.getCatchupMaxDrift();if(!isNaN(d)&&d>0&&l>d)g.info("[CatchupController]: Low Latency catchup mechanism. Latency too high, doing a seek to live point"),t=!0,c.seekToCurrentLive(!0,!1);else{var f=c.getCurrentLiveLatency(),m=c.getLiveDelay();e=A()===a.Z.LIVE_CATCHUP_MODE_LOLP?function(e,t,n,r,i){var a;if(i<r){var s=Math.abs(e.min),o=5*(i-r);a=1-s+2*s/(1+Math.pow(Math.E,-o)),g.debug("[LoL+ playback control_buffer-based] bufferLevel: "+i+", newRate: "+a)}else{if(Math.abs(t-n)<=.02*n)a=1;else{var u=t-n,l=u<0?Math.abs(e.min):e.max,c=5*u;a=1-l+2*l/(1+Math.pow(Math.E,-c))}g.debug("[LoL+ playback control_latency-based] latency: "+t+", newRate: "+a)}return a}(o,f,m,i.get().streaming.liveCatchup.playbackBufferMin,u):function(e,t,n,r){if(p)return 1;var i=t-n,a=i<0?Math.abs(e.min):e.max,s=5*i,o=1-a+2*a/(1+Math.pow(Math.E,-s));return c.getPlaybackStalled()&&r<=n/2&&i>0&&(o=1),o}(o,f,m,u);var y=n?.25:.02/(.5/o.max);e&&Math.abs(s-e)>=y&&(g.debug("[CatchupController]: Setting playback rate to ".concat(e)),r.setPlaybackRate(e))}}}()}function w(){return c.getCurrentLiveLatency()-c.getLiveDelay()}function A(){var e=i.get().streaming.liveCatchup.playbackBufferMin;return i.get().streaming.liveCatchup.mode!==a.Z.LIVE_CATCHUP_MODE_LOLP||null===e||isNaN(e)?a.Z.LIVE_CATCHUP_MODE_DEFAULT:a.Z.LIVE_CATCHUP_MODE_LOLP}function I(){h.getCatchupPlaybackRates(!0)}return e={reset:function(){y.off(f.Z.BUFFER_LEVEL_UPDATED,T,e),y.off(f.Z.BUFFER_LEVEL_STATE_CHANGED,b,e),y.off(f.Z.PLAYBACK_PROGRESS,S,e),y.off(f.Z.PLAYBACK_TIME_UPDATED,S,e),y.off(f.Z.PLAYBACK_SEEKED,_,e),y.off(l.Z.SETTING_UPDATED_CATCHUP_ENABLED,E,e),y.off(l.Z.SETTING_UPDATED_PLAYBACK_RATE_MIN,I,e),y.off(l.Z.SETTING_UPDATED_PLAYBACK_RATE_MAX,I,e),y.off(f.Z.STREAM_INITIALIZED,I,e),v(),r.setPlaybackRate(1,!0)},setConfig:function(e){e&&(e.settings&&(i=e.settings),e.videoModel&&(r=e.videoModel),e.streamController&&(s=e.streamController),e.playbackController&&(c=e.playbackController),e.mediaPlayerModel&&(h=e.mediaPlayerModel))},initialize:function(){y.on(f.Z.BUFFER_LEVEL_UPDATED,T,e),y.on(f.Z.BUFFER_LEVEL_STATE_CHANGED,b,e),y.on(f.Z.PLAYBACK_PROGRESS,S,e),y.on(f.Z.PLAYBACK_TIME_UPDATED,S,e),y.on(f.Z.PLAYBACK_SEEKED,_,e),y.on(l.Z.SETTING_UPDATED_CATCHUP_ENABLED,E,e),y.on(l.Z.SETTING_UPDATED_PLAYBACK_RATE_MIN,I,e),y.on(l.Z.SETTING_UPDATED_PLAYBACK_RATE_MAX,I,e),y.on(f.Z.STREAM_INITIALIZED,I,e),I()}},g=(0,d.Z)(m).getInstance().getLogger(e),v(),e}nn.__dashjs_factory_name="CatchupController";var rn=c.Z.getSingletonFactory(nn),an=[a.Z.SERVICE_DESCRIPTION_DVB_LL_SCHEME],sn="video",on="audio";function un(){var e,t,n,r,i,o=this.context;function u(){t={liveDelay:NaN,liveCatchup:{maxDrift:NaN,playbackRate:{min:NaN,max:NaN}},minBitrate:{},maxBitrate:{},initialBitrate:{},contentSteering:null},n=[]}function l(e,n,i){try{t[e][n]=i/1e3}catch(e){r.error(e)}}return e={getServiceDescriptionSettings:function(){return t},getProducerReferenceTimeOffsets:function(){return n},calculateProducerReferenceTimeOffsets:function(e){try{var t=[];if(e&&e.length>0){var o=[a.Z.VIDEO,a.Z.AUDIO,a.Z.TEXT],u=i.getAvailabilityStartTime()/1e3;e.forEach((function(e){var n=o.reduce((function(t,n){return t.concat(i.getAllMediaInfoForType(e,n))}),[]).reduce((function(t,n){return i.getProducerReferenceTimes(e,n).forEach((function(r){var a=i.getVoRepresentations(n);if(a&&a.length>0&&a[0].adaptation&&a[0].segmentInfoType===s.Z.SEGMENT_TEMPLATE){var o=a[0],l=new Date(r[s.Z.WALL_CLOCK_TIME]).getTime()/1e3-(r[s.Z.PRESENTATION_TIME]/o[s.Z.TIMESCALE]-o[s.Z.PRESENTATION_TIME_OFFSET]+e.start),c=u-l;t.push({id:r[s.Z.ID],to:c})}})),t}),[]);t=t.concat(n)}))}n=t}catch(e){r.error(e),n=[]}},applyServiceDescription:function(e){if(e&&e.serviceDescriptions){var i=e.serviceDescriptions.filter((function(e){return an.includes(e.schemeIdUri)})),s=e.serviceDescriptions.filter((function(e){return null==e.schemeIdUri})),o=i.length>0?i[i.length-1]:s[s.length-1];o&&(o.latency&&o.latency.target>0&&function(e){var i;if(e.schemeIdUri,a.Z.SERVICE_DESCRIPTION_DVB_LL_SCHEME,i=function(e){return{liveDelay:e.latency.target/1e3,maxDrift:!isNaN(e.latency.max)&&e.latency.max>e.latency.target?(e.latency.max-e.latency.target+500)/1e3:NaN,referenceId:e.latency.referenceId||NaN}}(e),n.length>0){var s=function(e){var t,r=0,i=n.filter((function(t){return t.id===e.referenceId}));return 0===i.length?(r=n.length>0?n[0].to:0,t=n[0].id||NaN):(r=i[0].to||0,t=i[0].id||NaN),{to:r,id:t}}(i),o=s.to,u=s.id;t.liveDelay=i.liveDelay-o,t.liveCatchup.maxDrift=i.maxDrift,r.debug("\n Found latency properties coming from service description. Applied time offset of ".concat(o," from ProducerReferenceTime element with id ").concat(u,".\n Live Delay: ").concat(i.liveDelay-o,", Live catchup max drift: ").concat(i.maxDrift,"\n "))}else t.liveDelay=i.liveDelay,t.liveCatchup.maxDrift=i.maxDrift,r.debug("Found latency properties coming from service description: Live Delay: ".concat(i.liveDelay,", Live catchup max drift: ").concat(i.maxDrift))}(o),o.playbackRate&&function(e){var n=e.playbackRate.min?Math.round(1e3*(e.playbackRate.min-1))/1e3:NaN,i=e.playbackRate.max?Math.round(1e3*(e.playbackRate.max-1))/1e3:NaN;t.liveCatchup.playbackRate.min=n,t.liveCatchup.playbackRate.max=i,r.debug("Found latency properties coming from service description: Live catchup min playback rate: ".concat(n)),r.debug("Found latency properties coming from service description: Live catchup max playback rate: ".concat(i))}(o),o.operatingQuality,o.operatingBandwidth&&function(e){if(e&&e.operatingBandwidth&&e.operatingBandwidth.mediaType&&"all"!==e.operatingBandwidth.mediaType){var t={};t.minBandwidth=e.operatingBandwidth.min,t.maxBandwidth=e.operatingBandwidth.max,t.targetBandwidth=e.operatingBandwidth.target;var n=[];e.operatingBandwidth.mediaType===sn||e.operatingBandwidth.mediaType===on?n.push(e.operatingBandwidth.mediaType):"any"===e.operatingBandwidth.mediaType&&(n.push(on),n.push(sn)),n.forEach((function(e){isNaN(t.minBandwidth)||l("minBitrate",e,t.minBandwidth),isNaN(t.maxBandwidth)||l("maxBitrate",e,t.maxBandwidth),isNaN(t.targetBandwidth)||l("initialBitrate",e,t.targetBandwidth)}))}}(o),o.contentSteering&&function(e){t.contentSteering=e.contentSteering}(o))}},reset:function(){u()},setConfig:function(e){e&&e.adapter&&(i=e.adapter)}},r=(0,d.Z)(o).getInstance().getLogger(e),u(),e}un.__dashjs_factory_name="ServiceDescriptionController";var ln=c.Z.getSingletonFactory(un),cn=n(3973),dn=n.n(cn),fn=n(3039);function hn(){var e,t,n,r,i,s,o,c,f=this.context,h=(0,u.Z)(f).getInstance();function p(e,t){return e&&n[t]&&n[t][e]?n[t][e].list:[]}function g(e,t){return e&&n[t]&&n[t][e]?n[t][e].current:null}function m(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e&&e.streamInfo){var i=e.type,o=e.streamInfo.id,u=g(i,o);if(n[o]&&n[o][i]&&(n[o][i].current=e,n[o][i].current&&(i!==a.Z.TEXT&&!_(e,u)||i===a.Z.TEXT&&e.isFragmented)&&h.trigger(l.Z.CURRENT_TRACK_CHANGED,{oldMediaInfo:u,newMediaInfo:e,switchMode:r.get().streaming.trackSwitchMode[i]},{streamId:o}),!t)){var d=function(e){var t={lang:e.lang,viewpoint:e.viewpoint,roles:e.roles,accessibility:e.accessibility,audioChannelConfiguration:e.audioChannelConfiguration,codec:e.codec};return t.lang||t.viewpoint||t.role&&t.role.length>0||t.accessibility&&t.accessibility.length>0||t.audioChannelConfiguration&&t.audioChannelConfiguration.length>0?t:null}(e);if(!d||!n[o][i].storeLastSettings)return;d.roles&&(d.role=d.roles[0],delete d.roles),d.accessibility&&(d.accessibility=d.accessibility[0]),d.audioChannelConfiguration&&(d.audioChannelConfiguration=d.audioChannelConfiguration[0]),s[i]=d,c.setSavedMediaSettings(i,d)}}}function y(e,t){e&&t&&(i[e]=t)}function v(e){return e?i[e]:null}function _(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;var n=e.id===t.id,r=e.viewpoint===t.viewpoint,i=JSON.stringify(e.viewpointsWithSchemeIdUri)===JSON.stringify(t.viewpointsWithSchemeIdUri),a=e.lang===t.lang,s=e.codec===t.codec,o=e.roles.toString()===t.roles.toString(),u=JSON.stringify(e.rolesWithSchemeIdUri)===JSON.stringify(t.rolesWithSchemeIdUri),l=e.accessibility.toString()===t.accessibility.toString(),c=JSON.stringify(e.accessibilitiesWithSchemeIdUri)===JSON.stringify(t.accessibilitiesWithSchemeIdUri),d=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString(),f=JSON.stringify(e.audioChannelConfigurationsWithSchemeIdUri)===JSON.stringify(t.audioChannelConfigurationsWithSchemeIdUri);return n&&s&&r&&i&&a&&o&&u&&l&&c&&d&&f}function T(){n={},s={},i={audio:null,video:null,text:null}}function b(e,t,n){var r=[];return e.forEach((function(e){t(n,e)&&r.push(e)})),0!==r.length?r:e}function E(e,t){return!e.lang||e.lang instanceof RegExp?t.lang.match(e.lang):""!==t.lang&&(0,fn.extendedFilter)(t.lang,dn()(e.lang)).length>0}function S(e,t){return void 0===e.index||null===e.index||t.index===e.index}function w(e,t){return!e.viewpoint||e.viewpoint===t.viewpoint}function A(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return!e.role||!!t.roles.filter((function(t){return t===e.role}))[0]||t.type===a.Z.AUDIO&&n}function I(e,t){return e.accessibility?!!t.accessibility.filter((function(t){return t===e.accessibility}))[0]:!t.accessibility.length}function C(e,t){return!e.audioChannelConfiguration||!!t.audioChannelConfiguration.filter((function(t){return t===e.audioChannelConfiguration}))[0]}function R(e,t){return!e.codec||e.codec===t.codec}function D(e){var t,n=0,r=[];return e.forEach((function(e){(t=Math.max.apply(Math,e.bitrateList.map((function(e){return e.bandwidth}))))>n?(n=t,r=[e]):t===n&&r.push(e)})),r}function x(e){var t,n=1/0,r=[];return e.forEach((function(e){var i=e.bitrateList.reduce((function(e,t){var n=Math.max(1,t.width*t.height);return e+t.bandwidth/n}),0);(t=i/e.bitrateList.length)<n?(n=t,r=[e]):t===n&&r.push(e)})),r}function N(e){var t,n=0,r=[];return e.forEach((function(e){(t=e.representationCount)>n?(n=t,r=[e]):t===n&&r.push(e)})),r}function O(e,n){if(e===a.Z.TEXT)return n[0];var i,s=r.get().streaming.selectionModeForInitialTrack,u=o.getCustomInitialTrackSelectionFunction();if(u&&"function"==typeof u)i=u(n);else switch(s){case a.Z.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY:i=function(e){var t,n,r=(t=0,n=[],e.forEach((function(e){isNaN(e.selectionPriority)||(e.selectionPriority>t?(t=e.selectionPriority,n=[e]):e.selectionPriority===t&&n.push(e))})),n);return r.length>1&&(r=D(r)),r.length>1&&(r=N(r)),r}(n);break;case a.Z.TRACK_SELECTION_MODE_HIGHEST_BITRATE:i=function(e){var t=D(e);return t.length>1&&(t=N(t)),t}(n);break;case a.Z.TRACK_SELECTION_MODE_FIRST_TRACK:i=P(n);break;case a.Z.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:i=function(e){var t=x(e);return t.length>1&&(t=D(t)),t}(n);break;case a.Z.TRACK_SELECTION_MODE_WIDEST_RANGE:i=function(e){var t=N(e);return t.length>1&&(t=D(e)),t}(n);break;default:t.warn("Track selection mode ".concat(s," is not supported. Falling back to TRACK_SELECTION_MODE_FIRST_TRACK")),i=P(n)}return i.length>0?i[0]:n[0]}function P(e){return e[0]}return e={setInitialMediaSettingsForType:function(e,t){var n=s[e]||v(e),r=p(e,t.id),i=[];n||((n=c.getSavedMediaSettings(e))&&delete n.codec,y(e,n)),r&&0!==r.length&&(n&&(i=b(i=Array.from(r),E,n),i=b(i,S,n),i=b(i,w,n),e===a.Z.AUDIO&&s[e]||(i=b(i,A,n)),i=b(i,I,n),i=b(i,C,n),i=b(i,R,n)),0===i.length?m(O(e,r),!0):i.length>1?m(O(e,i)):m(i[0]))},addTrack:function(e){if(e){var t=e.type;if((i=t)===a.Z.AUDIO||i===a.Z.VIDEO||i===a.Z.TEXT||i===a.Z.IMAGE){var i,s,o=e.streamInfo.id;n[o]||(n[o]={audio:{list:[],storeLastSettings:s=r.get().streaming.saveLastMediaSettingsForCurrentStreamingSession,current:null},video:{list:[],storeLastSettings:s,current:null},text:{list:[],storeLastSettings:s,current:null},image:{list:[],storeLastSettings:s,current:null}});for(var u=n[o][t].list,l=0,c=u.length;l<c;++l)if(_(u[l],e))return;u.push(e)}}},getTracksFor:p,getCurrentTrackFor:g,isCurrentTrack:function(e){if(!e)return!1;var t=e.type,r=e.streamInfo.id;return n[r]&&n[r][t]&&_(n[r][t].current,e)},setTrack:m,selectInitialTrack:O,setInitialSettings:y,getInitialSettings:v,getTracksWithHighestBitrate:D,getTracksWithHighestEfficiency:x,getTracksWithWidestRange:N,isTracksEqual:_,matchSettings:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{var r=!1;if(e.lang){if(e.lang instanceof RegExp)r=t.lang.match(e.lang);else if(""!==t.lang){var i=dn()(e.lang);i&&(r=(0,fn.extendedFilter)(t.lang,i).length>0)}}else r=!0;var s=void 0===e.index||null===e.index||t.index===e.index,o=!e.viewpoint||e.viewpoint===t.viewpoint,u=!e.role||!!t.roles.filter((function(t){return t===e.role}))[0],l=!e.accessibility||!!t.accessibility.filter((function(t){return t===e.accessibility}))[0],c=!e.audioChannelConfiguration||!!t.audioChannelConfiguration.filter((function(t){return t===e.audioChannelConfiguration}))[0];return r&&s&&o&&(u||t.type===a.Z.AUDIO&&n)&&l&&c}catch(e){return!1}},matchSettingsLang:E,matchSettingsIndex:S,matchSettingsViewPoint:w,matchSettingsRole:A,matchSettingsAccessibility:I,matchSettingsAudioChannelConfig:C,saveTextSettingsDisabled:function(){c.setSavedMediaSettings(a.Z.TEXT,null)},setConfig:function(e){e&&(e.domStorage&&(c=e.domStorage),e.settings&&(r=e.settings),e.customParametersModel&&(o=e.customParametersModel))},reset:T},t=(0,d.Z)(f).getInstance().getLogger(e),T(),e}hn.__dashjs_factory_name="MediaController";var pn=c.Z.getSingletonFactory(hn);c.Z.updateSingletonFactory(hn.__dashjs_factory_name,pn);var gn=pn,mn=NaN,yn=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.data={baseUrls:t||null,selectedIdx:n||mn},this.children=[]};function vn(){var e,t,n,r,i=this.context,a=Re(i).getInstance();function s(e,t,n){var r=o(n);e[t]?a.areEqual(r,e[t].data.baseUrls)||(e[t].data.baseUrls=r,e[t].data.selectedIdx=mn):e[t]=new yn(r)}function o(e){var t=n.getBaseURLsFromElement(e),i=r.getSynthesizedBaseUrlElements(t);return i&&i.length>0&&(t=t.concat(i)),t}function u(e,n){var r=n||t;e(r.data),r.children&&r.children.forEach((function(t){return u(e,t)}))}function l(){t=new yn}return e={reset:l,update:function(e){!function(e){!function(){if(!n||!n.hasOwnProperty("getBaseURLsFromElement")||!n.hasOwnProperty("getRepresentationSortFunction"))throw new Error("setConfig function has to be called previously")}();var r=o(e);a.areEqual(r,t.data.baseUrls)||(t.data.baseUrls=r,t.data.selectedIdx=mn),e&&e.Period_asArray&&e.Period_asArray.forEach((function(e,r){s(t.children,r,e),e.AdaptationSet_asArray&&e.AdaptationSet_asArray.forEach((function(e,i){s(t.children[r].children,i,e),e.Representation_asArray&&e.Representation_asArray.sort(n.getRepresentationSortFunction()).forEach((function(e,n){s(t.children[r].children[i].children,n,e)}))}))}))}(e)},getForPath:function(e){var n=t,r=[n.data];return e&&e.forEach((function(e){(n=n.children[e])&&r.push(n.data)})),r.filter((function(e){return e.baseUrls.length}))},invalidateSelectedIndexes:function(e){u((function(t){isNaN(t.selectedIdx)||e===t.baseUrls[t.selectedIdx].serviceLocation&&(t.selectedIdx=mn)}))},setConfig:function(e){e.adapter&&(n=e.adapter),e.contentSteeringController&&(r=e.contentSteeringController)},getBaseUrls:function(e){return o(e)}},l(),e}vn.__dashjs_factory_name="BaseURLTreeModel";var _n=c.Z.getClassFactory(vn);function Tn(e){var t=(e=e||{}).blacklistController;return{select:function(e){return e&&function(e){var t,n,r=0,i=[],a=0;if((n=e.sort((function(e,t){var n=e.dvb_priority-t.dvb_priority;return isNaN(n)?0:n})).filter((function(e,t,n){return!t||n[0].dvb_priority&&e.dvb_priority&&n[0].dvb_priority===e.dvb_priority}))).length)return n.length>1&&(n.forEach((function(e){r+=e.dvb_weight,i.push(r)})),t=Math.floor(Math.random()*(r-1)),i.every((function(e,n){return a=n,!(t<e)}))),n[a]}((n=[],e.filter((function(e){return!t.contains(e.serviceLocation)||(e.dvb_priority&&n.push(e.dvb_priority),!1)})).filter((function(e){return!n.length||!e.dvb_priority||-1===n.indexOf(e.dvb_priority)}))));var n}}}Tn.__dashjs_factory_name="DVBSelector";var bn=c.Z.getClassFactory(Tn);function En(e){var t=(e=e||{}).blacklistController;return{select:function(e){var n,r=0;return e&&e.some((function(e,n){return r=n,!t.contains(e.serviceLocation)}))&&(n=e[r]),n}}}En.__dashjs_factory_name="BasicSelector";var Sn=c.Z.getClassFactory(En);function wn(){var e,t,n,r=this.context;function i(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=0,i=NaN,a=function(){var a=e[r],s=t.findIndex((function(e){return e.serviceLocation&&e.serviceLocation===a}));if(-1!==s&&!n.contains(t[s].serviceLocation))return i=s,"break";r+=1};r<e.length&&"break"!==a(););return i}return e={selectBaseUrlIndex:function(e){var n=NaN;if(isNaN(e.selectedIdx)){var r=t.getSteeringDataFromManifest();r&&r.defaultServiceLocationArray.length>0&&(n=i(r.defaultServiceLocationArray,e.baseUrls))}var a=t.getCurrentSteeringResponseData();return e.baseUrls&&e.baseUrls.length&&a&&a.pathwayPriority&&a.pathwayPriority.length&&(n=i(a.pathwayPriority,e.baseUrls)),n},setConfig:function(e){e.blacklistController&&(n=e.blacklistController),e.contentSteeringController&&(t=e.contentSteeringController)}},t=Ut(r).getInstance(),e}wn.__dashjs_factory_name="ContentSteeringSelector";var An=c.Z.getClassFactory(wn);function In(){var e,t,n,r,i,a,s=this.context,o=(0,u.Z)(s).getInstance(),c=(0,C.Z)(s).getInstance();function d(){t.reset()}return e={chooseSelector:function(e){(0,Z.PS)(e,"boolean"),a=e?r:n},select:function(e){if(e){if(c.get().streaming.applyContentSteering){var t=i.selectBaseUrlIndex(e);isNaN(t)||-1===t||(e.selectedIdx=t)}if(!isNaN(e.selectedIdx))return e.baseUrls[e.selectedIdx];var r=a.select(e.baseUrls);return r?(e.selectedIdx=e.baseUrls.indexOf(r),r):(o.trigger(l.Z.URL_RESOLUTION_FAILED,{error:new E.Z(I.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE,I.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE)}),void(a===n&&d()))}},reset:d,setConfig:function(e){e.selector&&(a=e.selector),e.contentSteeringSelector&&(i=e.contentSteeringSelector)}},t=Nt(s).create({updateEventName:l.Z.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,addBlacklistEventName:l.Z.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD}),n=Sn(s).create({blacklistController:t}),r=bn(s).create({blacklistController:t}),(i=An(s).create()).setConfig({blacklistController:t}),a=n,e}In.__dashjs_factory_name="BaseURLSelector";var Cn=c.Z.getClassFactory(In);function Rn(){var e,t,n,r,i,a=this.context,s=(0,u.Z)(a).getInstance(),o=(0,X.Z)(a).getInstance();function c(e){n.update(e),r.chooseSelector(t.getIsDVB(e)),s.trigger(f.Z.BASE_URLS_UPDATED,{baseUrls:d(e)})}function d(e){return n.getBaseUrls(e)}return e={reset:function(){n.reset(),r.reset()},initialize:function(e){n.setConfig({adapter:t,contentSteeringController:i}),c(e)},resolve:function(e){var t=n.getForPath(e).reduce((function(e,t){var n=r.select(t);return n?(o.isRelative(n.url)?e.url=o.resolve(n.url,e.url):(e.url=n.url,e.serviceLocation=n.serviceLocation),e.availabilityTimeOffset=n.availabilityTimeOffset,e.availabilityTimeComplete=n.availabilityTimeComplete,e.queryParams=n.queryParams,e):new Te}),new Te);if(!o.isRelative(t.url))return t},setConfig:function(e){e.baseURLTreeModel&&(n=e.baseURLTreeModel),e.baseURLSelector&&(r=e.baseURLSelector),e.adapter&&(t=e.adapter),e.contentSteeringController&&(i=e.contentSteeringController)},getBaseUrls:d,update:c},n=_n(a).create(),r=Cn(a).create(),s.on(l.Z.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,(function(e){n.invalidateSelectedIndexes(e.entry)}),e),e}Rn.__dashjs_factory_name="BaseURLController";var Dn=c.Z.getClassFactory(Rn);function xn(e){return xn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xn(e)}function Nn(e,t){return Nn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Nn(e,t)}function On(e){return On=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},On(e)}var Pn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Nn(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=On(t);if(n){var i=On(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==xn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(n=r.call(this)).url=e||null,n.type=t||null,n.mediaType=a.Z.STREAM,n.responseType="",n}return i}(g.Z);function Mn(e){e=e||{};var t=this.context,n=(0,u.Z)(t).getInstance(),r=pt(t).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,errors:I});return{load:function(e,t,i){var a=function(r,a){t.resolved=!0,t.resolvedContent=r||null,n.trigger(l.Z.XLINK_ELEMENT_LOADED,{element:t,resolveObject:i,error:r||a?null:new E.Z(I.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE,I.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE+e)})};if("urn:mpeg:dash:resolve-to-zero:2013"===e)a(null,!0);else{var s=new Pn(e,R.w.XLINK_EXPANSION_TYPE);r.load({request:s,success:function(e){a(e)},error:function(){a(null)}})}},reset:function(){r&&(r.abort(),r=null)}}}Mn.__dashjs_factory_name="XlinkLoader";var kn=c.Z.getClassFactory(Mn),Ln=function(e){function t(e){var t=e.localName;return null==t&&(t=e.baseName),null!=t&&""!=t||(t=e.nodeName),t}function n(e){return"string"==typeof e?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):e}function r(e,t,n,r){for(var i=0;i<e.length;i++){var a=e[i];if("string"==typeof a){if(a==r)break}else if(a instanceof RegExp){if(a.test(r))break}else if("function"==typeof a&&a(t,n,r))break}return i!=e.length}function i(t,n,i){"property"===e.arrayAccessForm&&(t[n]instanceof Array?t[n+"_asArray"]=t[n]:t[n+"_asArray"]=[t[n]]),!(t[n]instanceof Array)&&e.arrayAccessFormPaths.length>0&&r(e.arrayAccessFormPaths,t,n,i)&&(t[n]=[t[n]])}function a(e){var t=e.split(/[-T:+Z]/g),n=new Date(t[0],t[1]-1,t[2]),r=t[5].split(".");if(n.setHours(t[3],t[4],r[0]),r.length>1&&n.setMilliseconds(r[1]),t[6]&&t[7]){var i=60*t[6]+Number(t[7]);i=0+("-"==(/\d\d-\d\d:\d\d$/.test(e)?"-":"+")?-1*i:i),n.setMinutes(n.getMinutes()-i-n.getTimezoneOffset())}else-1!==e.indexOf("Z",e.length-1)&&(n=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())));return n}function s(t,n,i,a){return!(1==n&&e.xmlElementsFilter.length>0)||r(e.xmlElementsFilter,t,i,a)}function o(n,u){if(9==n.nodeType){for(var l=new Object,c=n.childNodes,d=0;d<c.length;d++)1==(h=c[d]).nodeType&&(e.ignoreRoot?l=o(h):(l={})[p=t(h)]=o(h));return l}if(1==n.nodeType){(l=new Object).__cnt=0;var f=[];for(c=n.childNodes,d=0;d<c.length;d++){var h,p=t(h=c[d]);if(8!=h.nodeType){var g=u+"."+p;if(s(l,h.nodeType,p,g))if(l.__cnt++,null==l[p]){var m=o(h,g);("#text"!=p||/[^\s]/.test(m))&&((y={})[p]=m,f.push(y)),l[p]=m,i(l,p,g)}else{var y;null!=l[p]&&(l[p]instanceof Array||(l[p]=[l[p]],i(l,p,g))),m=o(h,g),("#text"!=p||/[^\s]/.test(m))&&((y={})[p]=m,f.push(y)),l[p][l[p].length]=m}}}l.__children=f;for(var v=t(n),_=0;_<n.attributes.length;_++){var T=n.attributes[_];l.__cnt++;for(var b=T.value,E=0,S=e.matchers.length;E<S;E++){var w=e.matchers[E];w.test(T,v)&&(b=w.converter(T.value))}l[e.attributePrefix+T.name]=b}var A=function(e){return e.prefix}(n);return null!=A&&""!=A&&(l.__cnt++,l.__prefix=A),null!=l["#text"]&&(l.__text=l["#text"],l.__text instanceof Array&&(l.__text=l.__text.join("\n")),e.stripWhitespaces&&(l.__text=l.__text.trim()),delete l["#text"],"property"==e.arrayAccessForm&&delete l["#text_asArray"],l.__text=function(t,n,i){if(e.datetimeAccessFormPaths.length>0){var s=i.split(".#")[0];return r(e.datetimeAccessFormPaths,t,n,s)?a(t):t}return t}(l.__text,p,u+"."+p)),null!=l["#cdata-section"]&&(l.__cdata=l["#cdata-section"],delete l["#cdata-section"],"property"==e.arrayAccessForm&&delete l["#cdata-section_asArray"]),0==l.__cnt&&"text"==e.emptyNodeForm?l="":1==l.__cnt&&null!=l.__text?l=l.__text:1!=l.__cnt||null==l.__cdata||e.keepCData?l.__cnt>1&&null!=l.__text&&e.skipEmptyTextNodesForObj&&(e.stripWhitespaces&&""==l.__text||""==l.__text.trim())&&delete l.__text:l=l.__cdata,delete l.__cnt,!e.enableToStringFunc||null==l.__text&&null==l.__cdata||(l.toString=function(){return(null!=this.__text?this.__text:"")+(null!=this.__cdata?this.__cdata:"")}),l}if(3==n.nodeType||4==n.nodeType)return n.nodeValue}function u(t,r,i,a){var s="<"+(null!=t&&null!=t.__prefix?t.__prefix+":":"")+r;if(null!=i)for(var o=0;o<i.length;o++){var u=i[o],l=t[u];e.escapeMode&&(l=n(l)),s+=" "+u.substr(e.attributePrefix.length)+"=",e.useDoubleQuotes?s+='"'+l+'"':s+="'"+l+"'"}return s+(a?"/>":">")}function l(e,t){return"</"+(null!=e.__prefix?e.__prefix+":":"")+t+">"}function c(t,n){return"property"==e.arrayAccessForm&&(i="_asArray",-1!==(r=n.toString()).indexOf(i,r.length-8))||0==n.toString().indexOf(e.attributePrefix)||0==n.toString().indexOf("__")||t[n]instanceof Function;var r,i}function d(e){var t=0;if(e instanceof Object)for(var n in e)c(e,n)||t++;return t}function f(t,n,i){return 0==e.jsonPropertiesFilter.length||""==i||r(e.jsonPropertiesFilter,t,n,i)}function h(t){var n=[];if(t instanceof Object)for(var r in t)-1==r.toString().indexOf("__")&&0==r.toString().indexOf(e.attributePrefix)&&n.push(r);return n}function p(t){var r="";return t instanceof Object?r+=function(t){var r="";return null!=t.__cdata&&(r+="<![CDATA["+t.__cdata+"]]>"),null!=t.__text&&(e.escapeMode?r+=n(t.__text):r+=t.__text),r}(t):null!=t&&(e.escapeMode?r+=n(t):r+=t),r}function g(e,t){return""===e?t:e+"."+t}function m(e,t,n,r){var i="";if(0==e.length)i+=u(e,t,n,!0);else for(var a=0;a<e.length;a++)i+=u(e[a],t,h(e[a]),!1),i+=y(e[a],g(r,t)),i+=l(e[a],t);return i}function y(e,t){var n="";if(d(e)>0)for(var r in e)if(!c(e,r)&&(""==t||f(e,r,g(t,r)))){var i=e[r],a=h(i);null==i||null==i?n+=u(i,r,a,!0):i instanceof Object?i instanceof Array?n+=m(i,r,a,t):i instanceof Date?(n+=u(i,r,a,!1),n+=i.toISOString(),n+=l(i,r)):d(i)>0||null!=i.__text||null!=i.__cdata?(n+=u(i,r,a,!1),n+=y(i,g(t,r)),n+=l(i,r)):n+=u(i,r,a,!0):(n+=u(i,r,a,!1),n+=p(i),n+=l(i,r))}return n+p(e)}void 0===(e=e||{}).escapeMode&&(e.escapeMode=!0),void 0===e.attributePrefix&&(e.attributePrefix="_"),e.arrayAccessForm=e.arrayAccessForm||"none",e.emptyNodeForm=e.emptyNodeForm||"text",void 0===e.enableToStringFunc&&(e.enableToStringFunc=!0),e.arrayAccessFormPaths=e.arrayAccessFormPaths||[],void 0===e.skipEmptyTextNodesForObj&&(e.skipEmptyTextNodesForObj=!0),void 0===e.stripWhitespaces&&(e.stripWhitespaces=!0),e.datetimeAccessFormPaths=e.datetimeAccessFormPaths||[],void 0===e.useDoubleQuotes&&(e.useDoubleQuotes=!1),e.xmlElementsFilter=e.xmlElementsFilter||[],e.jsonPropertiesFilter=e.jsonPropertiesFilter||[],void 0===e.keepCData&&(e.keepCData=!1),void 0===e.ignoreRoot&&(e.ignoreRoot=!1),this.parseXmlString=function(e){var t;if(window.ActiveXObject||window,void 0===e)return null;if(window.DOMParser){var n=new window.DOMParser;try{(t=n.parseFromString(e,"text/xml")).getElementsByTagNameNS("*","parsererror").length>0&&(t=null)}catch(e){t=null}}else 0==e.indexOf("<?")&&(e=e.substr(e.indexOf("?>")+2)),(t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e);return t},this.asArray=function(e){return void 0===e||null==e?[]:e instanceof Array?e:[e]},this.toXmlDateTime=function(e){return e instanceof Date?e.toISOString():"number"==typeof e?new Date(e).toISOString():null},this.asDateTime=function(e){return"string"==typeof e?a(e):e},this.xml2json=function(e){return o(e)},this.xml_str2json=function(e){var t=this.parseXmlString(e);return null!=t?this.xml2json(t):null},this.json2xml_str=function(e){return y(e,"")},this.json2xml=function(e){var t=this.json2xml_str(e);return this.parseXmlString(t)},this.getVersion=function(){return"1.2.0"}},Fn="onLoad";function Un(e){e=e||{};var t,n,r,i,a,o,c=this.context,d=(0,u.Z)(c).getInstance(),f=(0,X.Z)(c).getInstance();function h(e,t,n){var r,i,a={};a.elements=e,a.type=t,a.resolveType=n,0===a.elements.length&&g(a);for(var s=0;s<a.elements.length;s++)r=a.elements[s],i=f.isHTTPURL(r.url)?r.url:r.originalContent.BaseURL+r.url,o.load(i,r,a)}function p(e){var t,n,r="";if(t=e.element,n=e.resolveObject,t.resolvedContent){var i=0;0===t.resolvedContent.indexOf("<?xml")&&(i=t.resolvedContent.indexOf("?>")+2),r=t.resolvedContent.substr(0,i)+"<response>"+t.resolvedContent.substr(i)+"</response>",t.resolvedContent=a.xml_str2json(r)}(function(e){var t;for(t=0;t<e.elements.length;t++)if(!1===e.elements[t].resolved)return!1;return!0})(n)&&g(n)}function g(e){var t,n,a=[];if(function(e){var t,n,a,s,o,u,l=[];for(s=e.elements.length-1;s>=0;s--){if(n=(t=e.elements[s]).type+"_asArray",t.resolvedContent){if(t.resolvedContent)for(o=0;o<t.resolvedContent[n].length;o++)a=t.resolvedContent[n][o],l.push(a)}else delete t.originalContent["xlink:actuate"],delete t.originalContent["xlink:href"],l.push(t.originalContent);for(t.parentElement[n].splice(t.index,1),u=0;u<l.length;u++)t.parentElement[n].splice(t.index+u,0,l[u]);l=[]}e.elements.length>0&&r.run(i)}(e),"onActuate"===e.resolveType&&d.trigger(l.Z.XLINK_READY,{manifest:i}),e.resolveType===Fn)switch(e.type){case s.Z.PERIOD:for(t=0;t<i[s.Z.PERIOD+"_asArray"].length;t++)(n=i[s.Z.PERIOD+"_asArray"][t]).hasOwnProperty(s.Z.ADAPTATION_SET+"_asArray")&&(a=a.concat(m(n[s.Z.ADAPTATION_SET+"_asArray"],n,s.Z.ADAPTATION_SET,Fn))),n.hasOwnProperty(s.Z.EVENT_STREAM+"_asArray")&&(a=a.concat(m(n[s.Z.EVENT_STREAM+"_asArray"],n,s.Z.EVENT_STREAM,Fn)));h(a,s.Z.ADAPTATION_SET,Fn);break;case s.Z.ADAPTATION_SET:d.trigger(l.Z.XLINK_READY,{manifest:i})}}function m(e,t,n,r){var i,a,s,o=[];for(a=e.length-1;a>=0;a--)(i=e[a]).hasOwnProperty("xlink:href")&&"urn:mpeg:dash:resolve-to-zero:2013"===i["xlink:href"]&&e.splice(a,1);for(a=0;a<e.length;a++)(i=e[a]).hasOwnProperty("xlink:href")&&i.hasOwnProperty("xlink:actuate")&&i["xlink:actuate"]===r&&(s=y(i["xlink:href"],t,n,a,r,i),o.push(s));return o}function y(e,t,n,r,i,a){return{url:e,parentElement:t,type:n,index:r,resolveType:i,originalContent:a,resolvedContent:null,resolved:!1}}return t={resolveManifestOnLoad:function(e){a=new Ln({escapeMode:!1,attributePrefix:"",arrayAccessForm:"property",emptyNodeForm:"object",stripWhitespaces:!1,enableToStringFunc:!1,ignoreRoot:!0,matchers:n}),(i=e).Period_asArray?h(m(i.Period_asArray,i,s.Z.PERIOD,Fn),s.Z.PERIOD,Fn):d.trigger(l.Z.XLINK_READY,{manifest:i})},setMatchers:function(e){e&&(n=e)},setIron:function(e){e&&(r=e)},reset:function(){d.off(l.Z.XLINK_ELEMENT_LOADED,p,t),o&&(o.reset(),o=null)}},d.on(l.Z.XLINK_ELEMENT_LOADED,p,t),o=kn(c).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),t}Un.__dashjs_factory_name="XlinkController";var Bn=c.Z.getClassFactory(Un);function jn(e){return jn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jn(e)}function qn(e){function t(e,t){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}function n(e,n,r){for(var i=0,a=e.length;i<a;++i){var s=e[i];if(n[s.name])if(r[s.name]){if(s.merge){var o=n[s.name],u=r[s.name];"object"===jn(o)&&"object"===jn(u)?t(o,u):r[s.name]=o+u}}else r[s.name]=n[s.name]}}function r(e,t){for(var i=0,a=e.children.length;i<a;++i){var s=e.children[i],o=t[s.name+"_asArray"];if(o)for(var u=0,l=o.length;u<l;++u){var c=o[u];n(e.properties,t,c),r(s,c)}}}return{run:function(t){if(null===t||"object"!==jn(t))return t;if(t.Period_asArray&&"period"in e)for(var n=e.period,i=t.Period_asArray,a=0,s=i.length;a<s;++a){var o=i[a];if(r(n,o),"adaptationset"in e){var u=o.AdaptationSet_asArray;if(u)for(var l=e.adaptationset,c=0,d=u.length;c<d;++c)r(l,u[c])}}return t}}}qn.__dashjs_factory_name="ObjectIron";var Hn=c.Z.getClassFactory(qn);var Gn=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._test=t,this._converter=n}var t;return(t=[{key:"test",get:function(){return this._test}},{key:"converter",get:function(){return this._converter}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function Vn(e){return Vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vn(e)}function Yn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zn(e,t){return zn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},zn(e,t)}function Zn(e){return Zn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Zn(e)}var Kn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&zn(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Zn(t);if(n){var i=Zn(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==Vn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.call(this,(function(e,t){var n,r=(Yn(n={},s.Z.MPD,[s.Z.ID,s.Z.PROFILES]),Yn(n,s.Z.PERIOD,[s.Z.ID]),Yn(n,s.Z.BASE_URL,[s.Z.SERVICE_LOCATION,s.Z.BYTE_RANGE]),Yn(n,s.Z.SEGMENT_BASE,[s.Z.INDEX_RANGE]),Yn(n,s.Z.INITIALIZATION,[s.Z.RANGE]),Yn(n,s.Z.REPRESENTATION_INDEX,[s.Z.RANGE]),Yn(n,s.Z.SEGMENT_LIST,[s.Z.INDEX_RANGE]),Yn(n,s.Z.BITSTREAM_SWITCHING,[s.Z.RANGE]),Yn(n,s.Z.SEGMENT_URL,[s.Z.MEDIA_RANGE,s.Z.INDEX_RANGE]),Yn(n,s.Z.SEGMENT_TEMPLATE,[s.Z.INDEX_RANGE,s.Z.MEDIA,s.Z.INDEX,s.Z.INITIALIZATION_MINUS,s.Z.BITSTREAM_SWITCHING_MINUS]),Yn(n,s.Z.ASSET_IDENTIFIER,[s.Z.VALUE,s.Z.ID]),Yn(n,s.Z.EVENT_STREAM,[s.Z.VALUE]),Yn(n,s.Z.ADAPTATION_SET,[s.Z.PROFILES,s.Z.MIME_TYPE,s.Z.SEGMENT_PROFILES,s.Z.CODECS,s.Z.CONTENT_TYPE]),Yn(n,s.Z.FRAME_PACKING,[s.Z.VALUE,s.Z.ID]),Yn(n,s.Z.AUDIO_CHANNEL_CONFIGURATION,[s.Z.VALUE,s.Z.ID]),Yn(n,s.Z.CONTENT_PROTECTION,[s.Z.VALUE,s.Z.ID]),Yn(n,s.Z.ESSENTIAL_PROPERTY,[s.Z.VALUE,s.Z.ID]),Yn(n,s.Z.SUPPLEMENTAL_PROPERTY,[s.Z.VALUE,s.Z.ID]),Yn(n,s.Z.INBAND_EVENT_STREAM,[s.Z.VALUE,s.Z.ID]),Yn(n,s.Z.ACCESSIBILITY,[s.Z.VALUE,s.Z.ID]),Yn(n,s.Z.ROLE,[s.Z.VALUE,s.Z.ID]),Yn(n,s.Z.RATING,[s.Z.VALUE,s.Z.ID]),Yn(n,s.Z.VIEWPOINT,[s.Z.VALUE,s.Z.ID]),Yn(n,s.Z.CONTENT_COMPONENT,[s.Z.CONTENT_TYPE]),Yn(n,s.Z.REPRESENTATION,[s.Z.ID,s.Z.DEPENDENCY_ID,s.Z.MEDIA_STREAM_STRUCTURE_ID]),Yn(n,s.Z.SUBSET,[s.Z.ID]),Yn(n,s.Z.METRICS,[s.Z.METRICS_MINUS]),Yn(n,s.Z.REPORTING,[s.Z.VALUE,s.Z.ID]),n);if(r.hasOwnProperty(t)){var i=r[t];return void 0!==i&&i.indexOf(e.name)>=0}return!1}),(function(e){return String(e)}))}return i}(Gn);function Wn(e){return Wn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wn(e)}function Xn(e,t){return Xn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Xn(e,t)}function $n(e){return $n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},$n(e)}var Qn=/^([-])?P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,Jn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Xn(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=$n(t);if(n){var i=$n(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==Wn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.call(this,(function(e){for(var t=[s.Z.MIN_BUFFER_TIME,s.Z.MEDIA_PRESENTATION_DURATION,s.Z.MINIMUM_UPDATE_PERIOD,s.Z.TIMESHIFT_BUFFER_DEPTH,s.Z.MAX_SEGMENT_DURATION,s.Z.MAX_SUBSEGMENT_DURATION,s.Z.SUGGESTED_PRESENTATION_DELAY,s.Z.START,a.Z.START_TIME,s.Z.DURATION],n=t.length,r=0;r<n;r++)if(e.nodeName===t[r])return Qn.test(e.value);return!1}),(function(e){var t=Qn.exec(e),n=31536e3*parseFloat(t[3]||0)+2592e3*parseFloat(t[5]||0)+86400*parseFloat(t[7]||0)+3600*parseFloat(t[9]||0)+60*parseFloat(t[11]||0)+parseFloat(t[13]||0);return void 0!==t[1]&&(n=-n),n}))}return i}(Gn);function er(e){return er="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},er(e)}function tr(e,t){return tr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},tr(e,t)}function nr(e){return nr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},nr(e)}var rr=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+-])([0-9]{2})(?::?)([0-9]{2}))?/,ir=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&tr(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=nr(t);if(n){var i=nr(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==er(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.call(this,(function(e){return rr.test(e.value)}),(function(e){var t,n=rr.exec(e);if(t=Date.UTC(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10),parseInt(n[4],10),parseInt(n[5],10),n[6]&&parseInt(n[6],10)||0,n[7]&&1e3*parseFloat(n[7])||0),n[9]&&n[10]){var r=60*parseInt(n[9],10)+parseInt(n[10],10);t+=("+"===n[8]?-1:1)*r*60*1e3}return new Date(t)}))}return i}(Gn);function ar(e){return ar="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ar(e)}function sr(e,t){return sr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},sr(e,t)}function or(e){return or=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},or(e)}var ur=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/,lr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&sr(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=or(t);if(n){var i=or(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==ar(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.call(this,(function(e){return ur.test(e.value)}),(function(e){return parseFloat(e)}))}return i}(Gn);function cr(e){return cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cr(e)}function dr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fr(e,t){return fr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},fr(e,t)}function hr(e){return hr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},hr(e)}var pr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&fr(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=hr(t);if(n){var i=hr(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==cr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.call(this,(function(e,t){var n,r=(dr(n={},s.Z.ADAPTATION_SET,[s.Z.LANG]),dr(n,s.Z.REPRESENTATION,[s.Z.LANG]),dr(n,s.Z.CONTENT_COMPONENT,[s.Z.LANG]),dr(n,s.Z.LABEL,[s.Z.LANG]),dr(n,s.Z.GROUP_LABEL,[s.Z.LANG]),n);if(r.hasOwnProperty(t)){var i=r[t];return void 0!==i&&i.indexOf(e.name)>=0}return!1}),(function(e){return dn()(e)||String(e)}))}return i}(Gn);var gr=function(){function e(t){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=t,this._merge=(n=t)&&n.length&&n.charAt(0)===n.charAt(0).toUpperCase()}var t;return(t=[{key:"name",get:function(){return this._name}},{key:"merge",get:function(){return this._merge}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();var mr=function(){function e(t,n,r){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=t||"",this._properties=[],this._children=r||[],Array.isArray(n)&&n.forEach((function(e){i._properties.push(new gr(e))}))}var t;return(t=[{key:"name",get:function(){return this._name}},{key:"children",get:function(){return this._children}},{key:"properties",get:function(){return this._properties}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function yr(e){return yr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yr(e)}function vr(e,t){return vr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},vr(e,t)}function _r(e){return _r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_r(e)}var Tr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&vr(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=_r(t);if(n){var i=_r(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==yr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);var e=[s.Z.PROFILES,s.Z.WIDTH,s.Z.HEIGHT,s.Z.SAR,s.Z.FRAMERATE,s.Z.AUDIO_SAMPLING_RATE,s.Z.MIME_TYPE,s.Z.SEGMENT_PROFILES,s.Z.CODECS,s.Z.MAXIMUM_SAP_PERIOD,s.Z.START_WITH_SAP,s.Z.MAX_PLAYOUT_RATE,s.Z.CODING_DEPENDENCY,s.Z.SCAN_TYPE,s.Z.FRAME_PACKING,s.Z.AUDIO_CHANNEL_CONFIGURATION,s.Z.CONTENT_PROTECTION,s.Z.ESSENTIAL_PROPERTY,s.Z.ESSENTIAL_PROPERTY+"_asArray",s.Z.SUPPLEMENTAL_PROPERTY,s.Z.INBAND_EVENT_STREAM];return r.call(this,s.Z.ADAPTATION_SET,e,[new mr(s.Z.REPRESENTATION,e,[new mr(s.Z.SUB_REPRESENTATION,e)])])}return i}(mr);function br(e){return br="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},br(e)}function Er(e,t){return Er=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Er(e,t)}function Sr(e){return Sr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Sr(e)}var wr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Er(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Sr(t);if(n){var i=Sr(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==br(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);var e=[s.Z.SEGMENT_BASE,s.Z.SEGMENT_TEMPLATE,s.Z.SEGMENT_LIST];return r.call(this,s.Z.PERIOD,e,[new mr(s.Z.ADAPTATION_SET,e,[new mr(s.Z.REPRESENTATION,e)])])}return i}(mr);function Ar(e){e=e||{};var t,n,r,i,a,s=this.context,o=e.debug;return t={parse:function(e){var t,r=window.performance.now();if(!(t=i.xml_str2json(e)))throw new Error("parsing the manifest failed");var s=window.performance.now();t.Patch?((t=t.Patch).add_asArray&&t.add_asArray.forEach((function(e){return a.run(e)})),t.replace_asArray&&t.replace_asArray.forEach((function(e){return a.run(e)}))):(t=t.MPD,a.run(t));var o=window.performance.now();return n.info("Parsing complete: ( xml2json: "+(s-r).toPrecision(3)+"ms, objectiron: "+(o-s).toPrecision(3)+"ms, total: "+((o-r)/1e3).toPrecision(3)+"s)"),t.protocol="DASH",t},getMatchers:function(){return r},getIron:function(){return a}},n=o.getLogger(t),r=[new Jn,new ir,new lr,new pr,new Kn],i=new Ln({escapeMode:!1,attributePrefix:"",arrayAccessForm:"property",emptyNodeForm:"object",stripWhitespaces:!1,enableToStringFunc:!0,ignoreRoot:!1,matchers:r}),a=Hn(s).create({adaptationset:new Tr,period:new wr}),t}Ar.__dashjs_factory_name="DashParser";var Ir=c.Z.getClassFactory(Ar);function Cr(e){e=e||{};var t,n,r,i,o,c=this.context,d=e.debug,f=e.settings,h=(0,u.Z)(c).getInstance(),p=(0,X.Z)(c).getInstance(),g=e.mssHandler,m=e.errHandler;function y(e){h.trigger(l.Z.INTERNAL_MANIFEST_LOADED,{manifest:e.manifest})}function v(e){var t=null;return e.indexOf("SmoothStreamingMedia")>-1?(g&&(t=g.createMssParser(),g.createMssFragmentProcessor(),g.registerEvents()),t):e.indexOf("MPD")>-1||e.indexOf("Patch")>-1?Ir(c).create({debug:d}):t}return t={load:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=new Date,u=new Pn(e,R.w.MPD_TYPE);t&&(u.serviceLocation=t),a&&(u.queryParams=a),u.requestStartDate||(u.requestStartDate=s),h.trigger(l.Z.MANIFEST_LOADING_STARTED,{request:u}),r.load({request:u,success:function(t,r,a){var s,u,c;if(i)if(a&&a!==e?(u=p.parseBaseUrl(a),s=a):(p.isRelative(e)&&(e=p.resolve(e,window.location.href)),u=p.parseBaseUrl(e)),"No Content"!=r)if(null===o&&(o=v(t)),null!==o){i.setMatchers(o.getMatchers()),i.setIron(o.getIron());try{c=o.parse(t)}catch(t){return void h.trigger(l.Z.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new E.Z(I.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,I.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))})}if(c){if(c.url=s||e,c.originalUrl||(c.originalUrl=c.url),f&&f.get().streaming.enableManifestDurationMismatchFix&&c.mediaPresentationDuration&&c.Period_asArray.length>1){var d=c.Period_asArray.reduce((function(e,t){return e+t.duration}),0);!isNaN(d)&&c.mediaPresentationDuration>d&&(n.warn("Media presentation duration greater than duration of all periods. Setting duration to total period duration"),c.mediaPresentationDuration=d)}c.baseUri=u,c.loadedTime=new Date,i.resolveManifestOnLoad(c),h.trigger(l.Z.ORIGINAL_MANIFEST_LOADED,{originalManifest:t})}else h.trigger(l.Z.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new E.Z(I.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,I.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))})}else h.trigger(l.Z.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new E.Z(I.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,I.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))});else h.trigger(l.Z.INTERNAL_MANIFEST_LOADED,{manifest:null})},error:function(t,n,r){h.trigger(l.Z.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new E.Z(I.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE,I.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE+"".concat(e,", ").concat(r))})}})},reset:function(){h.off(l.Z.XLINK_READY,y,t),g&&g.reset(),i&&(i.reset(),i=null),r&&(r.abort(),r=null)}},n=d.getLogger(t),h.on(l.Z.XLINK_READY,y,t),r=pt(c).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,urlUtils:p,constants:a.Z,dashConstants:s.Z,errors:I,requestTimeout:e.settings.get().streaming.manifestRequestTimeout}),i=Bn(c).create({errHandler:m,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),o=null,t}Cr.__dashjs_factory_name="ManifestLoader";var Rr=c.Z.getClassFactory(Cr);function Dr(){var e=this.context,t=(0,u.Z)(e).getInstance();return{error:function(e){t.trigger(l.Z.ERROR,{error:e})}}}Dr.__dashjs_factory_name="ErrorHandler";var xr=c.Z.getSingletonFactory(Dr),Nr=n(1715);function Or(){var e,t,n,r,i,s,o=this.context,c=(0,u.Z)(o).getInstance();function f(e,r){if(!r||!r.Period_asArray||0===r.Period_asArray.length)return Promise.resolve();var i=[];return r.Period_asArray.forEach((function(r){i.push(function(e,r){return new Promise((function(i){if(e&&e.AdaptationSet_asArray&&0!==e.AdaptationSet_asArray.length){var o=[];e.AdaptationSet_asArray.forEach((function(e){t.getIsTypeOf(e,r)&&o.push(function(e,r){return new Promise((function(i){if(e.Representation_asArray&&0!==e.Representation_asArray.length){var o=[],u=[];e.Representation_asArray.forEach((function(i,s){var l=t.getCodec(e,s,!1),c=function(e,t,n){switch(e){case a.Z.VIDEO:return function(e,t){return{codec:t,width:e.width||null,height:e.height||null,framerate:e.frameRate||null,bitrate:e.bandwidth||null}}(t,n);case a.Z.AUDIO:return function(e,t){var n=e.audioSamplingRate||null;return{codec:t,bitrate:e.bandwidth||null,samplerate:n}}(t,n);default:return null}}(r,i,l);u.push(c),o.push(n.supportsCodec(c,r))})),Promise.all(o).then((function(t){e.Representation_asArray=e.Representation_asArray.filter((function(e,n){return t[n]||s.debug("[Stream] Codec ".concat(u[n].codec," not supported ")),t[n]})),i()})).catch((function(){i()}))}else i()}))}(e,r))})),Promise.all(o).then((function(){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter((function(e){var t=e.Representation_asArray&&e.Representation_asArray.length>0;return t||(c.trigger(l.Z.ADAPTATION_SET_REMOVED_NO_CAPABILITIES,{adaptationSet:e}),s.warn("AdaptationSet has been removed because of no supported Representation")),t})),i()})).catch((function(){i()}))}else i()}))}(r,e))})),Promise.all(i)}return e={setConfig:function(e){e&&(e.adapter&&(t=e.adapter),e.capabilities&&(n=e.capabilities),e.settings&&(r=e.settings),e.customParametersModel&&(i=e.customParametersModel))},filterUnsupportedFeatures:function(e){return new Promise((function(o){var u=[];u.push(f(a.Z.VIDEO,e)),u.push(f(a.Z.AUDIO,e)),Promise.all(u).then((function(){r.get().streaming.capabilities.filterUnsupportedEssentialProperties&&function(e){e&&e.Period_asArray&&0!==e.Period_asArray.length&&e.Period_asArray.forEach((function(e){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter((function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter((function(e){var r=t.getEssentialPropertiesForRepresentation(e);if(r&&r.length>0)for(var i=0;i<r.length;){if(!n.supportsEssentialProperty(r[i]))return s.debug("[Stream] EssentialProperty not supported: "+r[i].schemeIdUri),!1;i+=1}return!0})),e.Representation_asArray&&e.Representation_asArray.length>0)}))}))}(e),function(e){var t=i.getCustomCapabilitiesFilters();t&&0!==t.length&&e&&e.Period_asArray&&0!==e.Period_asArray.length&&e.Period_asArray.forEach((function(e){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter((function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter((function(e){return!t.some((function(t){return!t(e)}))})),e.Representation_asArray&&e.Representation_asArray.length>0)}))}))}(e),o()})).catch((function(){o()}))}))}},s=(0,d.Z)(o).getInstance().getLogger(e),e}Or.__dashjs_factory_name="CapabilitiesFilter";var Pr=c.Z.getSingletonFactory(Or),Mr=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.xywh=null,this.track=null,this.id=null,this.s=null,this.r=null};function kr(){var e;return{initialize:function(t){if(e=new Mr,!t)return null;var n=t.indexOf("#");if(-1!==n)for(var r=t.substr(n+1).split("&"),i=0,a=r.length;i<a;++i){var s=r[i],o=s.indexOf("=");if(-1!==o){var u=s.substring(0,o);e.hasOwnProperty(u)&&(e[u]=s.substr(o+1))}}},getURIFragmentData:function(){return e}}}kr.__dashjs_factory_name="URIFragmentModel";var Lr=c.Z.getSingletonFactory(kr);function Fr(){var e,t=this.context,n=(0,u.Z)(t).getInstance();return{getValue:function(){return e},setValue:function(t){e=t,t&&n.trigger(l.Z.MANIFEST_LOADED,{data:t})}}}Fr.__dashjs_factory_name="ManifestModel";var Ur=c.Z.getSingletonFactory(Fr),Br=-.5;function jr(){var e,t,n,r,i=this.context,a=(0,C.Z)(i).getInstance();function s(e,n){return isNaN(e)?0:e>0?(n&&t.warn("Supplied minimum playback rate is a positive value when it should be negative or 0. The supplied rate will not be applied and set to 0: 100% playback speed."),0):e<Br?(n&&t.warn("Supplied minimum playback rate is out of range and will be limited to ".concat(Br,": ").concat(-50,"% playback speed.")),Br):e}function o(e,n){return isNaN(e)?0:e<0?(n&&t.warn("Supplied maximum playback rate is a negative value when it should be negative or 0. The supplied rate will not be applied and set to 0: 100% playback speed."),0):e>1?(n&&t.warn("Supplied maximum playback rate is out of range and will be limited to ".concat(1,": ").concat(200,"% playback speed.")),1):e}function u(){var e=a.get().streaming.buffer.stableBufferTime>0?a.get().streaming.buffer.stableBufferTime:a.get().streaming.buffer.fastSwitchEnabled?20:12,t=n.getLiveDelay();return!isNaN(t)&&t>0?Math.min(e,t):e}return e={getCatchupMaxDrift:function(){if(!isNaN(a.get().streaming.liveCatchup.maxDrift)&&a.get().streaming.liveCatchup.maxDrift>0)return a.get().streaming.liveCatchup.maxDrift;var e=r.getServiceDescriptionSettings();return e&&e.liveCatchup&&!isNaN(e.liveCatchup.maxDrift)&&e.liveCatchup.maxDrift>0?e.liveCatchup.maxDrift:12},getCatchupModeEnabled:function(){return null!==a.get().streaming.liveCatchup.enabled?a.get().streaming.liveCatchup.enabled:n.getInitialCatchupModeActivated()},getStableBufferTime:u,getInitialBufferLevel:function(){var e=a.get().streaming.buffer.initialBufferLevel;return isNaN(e)||e<0?0:Math.min(u(),e)},getRetryAttemptsForType:function(e){var t=isNaN(a.get().streaming.retryAttempts.lowLatencyMultiplyFactor)?5:a.get().streaming.retryAttempts.lowLatencyMultiplyFactor;return n.getLowLatencyModeEnabled()?a.get().streaming.retryAttempts[e]*t:a.get().streaming.retryAttempts[e]},getRetryIntervalsForType:function(e){var t=isNaN(a.get().streaming.retryIntervals.lowLatencyReductionFactor)?10:a.get().streaming.retryIntervals.lowLatencyReductionFactor;return n.getLowLatencyModeEnabled()?a.get().streaming.retryIntervals[e]/t:a.get().streaming.retryIntervals[e]},getCatchupPlaybackRates:function(e){var t=a.get().streaming.liveCatchup.playbackRate;if(!isNaN(t.min)||!isNaN(t.max))return{min:s(t.min,e),max:o(t.max,e)};var n=r.getServiceDescriptionSettings();if(n&&n.liveCatchup&&(!isNaN(n.liveCatchup.playbackRate.min)||!isNaN(n.liveCatchup.playbackRate.max))){var i=n.liveCatchup.playbackRate;return{min:s(i.min,e),max:o(i.max,e)}}return{min:-.5,max:.5}},getAbrBitrateParameter:function(e,t){try{var n=a.get().streaming.abr[e][t];if(!isNaN(n)&&-1!==n)return n;var i=r.getServiceDescriptionSettings();return i&&i[e]&&!isNaN(i[e][t])?i[e][t]:-1}catch(e){return-1}},setConfig:function(e){e.playbackController&&(n=e.playbackController),e.serviceDescriptionController&&(r=e.serviceDescriptionController)},reset:function(){}},t=(0,d.Z)(i).getInstance().getLogger(e),e}jr.__dashjs_factory_name="MediaPlayerModel";var qr=c.Z.getSingletonFactory(jr),Hr=n(1767);function Gr(e){var t=(e=e||{}).abrController,n=e.switchHistory,r=e.droppedFramesHistory,i=e.currentRequest,a=e.useBufferOccupancyABR,s=e.useL2AABR,o=e.useLoLPABR,u=e.streamProcessor?e.streamProcessor.getScheduleController():null,l=e.streamProcessor?e.streamProcessor.getRepresentationInfo():null,c=e.videoModel?e.videoModel:null;function d(){return l?l.mediaInfo:null}return{getMediaType:function(){var e=d();return e?e.type:null},getMediaInfo:d,getDroppedFramesHistory:function(){return r},getCurrentRequest:function(){return i},getSwitchHistory:function(){return n},getStreamInfo:function(){var e=d();return e?e.streamInfo:null},getScheduleController:function(){return u},getAbrController:function(){return t},getRepresentationInfo:function(){return l},useBufferOccupancyABR:function(){return a},useL2AABR:function(){return s},useLoLPABR:function(){return o},getVideoModel:function(){return c}}}Gr.__dashjs_factory_name="RulesContext";var Vr=c.Z.getClassFactory(Gr),Yr=n(2068);function zr(){var e=[],t=[];return{push:function(n){n.newValue===Yr.Z.NO_CHANGE&&(n.newValue=n.oldValue),e[n.oldValue]||(e[n.oldValue]={noDrops:0,drops:0,dropSize:0});var r=n.newValue-n.oldValue,i=r<0?1:0,a=i?-r:0,s=i?0:1;if(e[n.oldValue].drops+=i,e[n.oldValue].dropSize+=a,e[n.oldValue].noDrops+=s,t.push({idx:n.oldValue,noDrop:s,drop:i,dropSize:a}),t.length>8){var o=t.shift();e[o.idx].drops-=o.drop,e[o.idx].dropSize-=o.dropSize,e[o.idx].noDrops-=o.noDrop}},getSwitchRequests:function(){return e},reset:function(){e=[],t=[]}}}zr.__dashjs_factory_name="SwitchRequestHistory";var Zr=c.Z.getClassFactory(zr);function Kr(){var e={},t={},n={};return{push:function(r,i,a){if(i){e[r]||(e[r]=[],t[r]=0,n[r]=0);var s=a&&a.droppedVideoFrames?a.droppedVideoFrames:0,o=a&&a.totalVideoFrames?a.totalVideoFrames:0,u=s-t[r];t[r]=s;var l=o-n[r];n[r]=o;var c=e[r];isNaN(i)||(c[i]?(c[i].droppedVideoFrames+=u,c[i].totalVideoFrames+=l):c[i]={droppedVideoFrames:u,totalVideoFrames:l})}},getFrameHistory:function(t){return e[t]},clearForStream:function(r){try{delete e[r],delete t[r],delete n[r]}catch(e){}},reset:function(){e={},t={},n={}}}}Kr.__dashjs_factory_name="DroppedFramesHistory";var Wr=c.Z.getClassFactory(Kr);function Xr(e){var t,n,r,i,s,o=this.context,l=(e=e||{}).settings,c=(0,u.Z)(o).getInstance();function d(e,t,n,r){var i=Math.pow(.5,n/r.fast);e.fastEstimate=(1-i)*t+i*e.fastEstimate;var a=Math.pow(.5,n/r.slow);e.slowEstimate=(1-a)*t+a*e.slowEstimate,e.totalWeight+=n}function h(e,o,u){return l.get().streaming.abr.movingAverageMethod!==a.Z.MOVING_AVERAGE_SLIDING_WINDOW?function(e,t){var n=e?s.throughputHalfLife:s.latencyHalfLife,a=e?r[t]:i[t];if(!a||a.totalWeight<=0)return NaN;var o=a.fastEstimate/(1-Math.pow(.5,a.totalWeight/n.fast)),u=a.slowEstimate/(1-Math.pow(.5,a.totalWeight/n.slow));return e?Math.min(o,u):Math.max(o,u)}(e,o):function(e,r,i){var a=function(e,r,i){var a,s;if(e?(a=t[r],s=i?3:4):(a=n[r],s=4),a){if(s>=a.length)s=a.length;else if(e)for(var o=1;o<s;++o){var u=a[a.length-o]/a[a.length-o-1];if((u>=1.3||u<=1/1.3)&&(s+=1)===a.length)break}}else s=0;return s}(e,r,i),s=(e?t:n)[r];return 0!==a&&s&&0!==s.length?(s=s.slice(-a)).reduce((function(e,t){return e+t}))/s.length:NaN}(e,o,u)}function p(e,t){return h(!0,e,t)}function g(e){t[e]=t[e]||[],n[e]=n[e]||[],r[e]=r[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0},i[e]=i[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0}}function m(){t={},n={},r={},i={}}var y={push:function(e,o,u){if(o.trace&&o.trace.length){var h,p=o.tresponse.getTime()-o.trequest.getTime()||1,m=o._tfinish.getTime()-o.tresponse.getTime()||1,y=o.trace.reduce((function(e,t){return e+t.b[0]}),0),v=0;if(0!==(h=o._fileLoaderType&&o._fileLoaderType===a.Z.FILE_LOADER_TYPES.FETCH?o.trace.reduce((function(e,t){return e+t.d}),0):u?m:p+m)&&(v=Math.round(8*y/h)),o.cmsd){var _=o.cmsd.dynamic&&o.cmsd.dynamic.etp?o.cmsd.dynamic.etp:null;if(_){var T=l.get().streaming.cmsd.abr.etpWeightRatio;T>0&&T<=1&&(v=v*(1-T)+_*T)}}if(g(e),function(e,t,n){return e===a.Z.VIDEO?n<l.get().streaming.cacheLoadThresholds[a.Z.VIDEO]:e===a.Z.AUDIO?n<l.get().streaming.cacheLoadThresholds[a.Z.AUDIO]:void 0}(e,0,m)){if(t[e].length>0&&!t[e].hasCachedEntries)return;t[e].hasCachedEntries=!0}else t[e]&&t[e].hasCachedEntries&&function(e){delete t[e],delete n[e],delete r[e],delete i[e],g(e)}(e);t[e].push(v),c.trigger(f.Z.THROUGHPUT_MEASUREMENT_STORED,{throughput:v,mediaType:e,httpRequest:o}),t[e].length>20&&t[e].shift(),n[e].push(p),n[e].length>20&&n[e].shift(),d(r[e],v,.001*m,s.throughputHalfLife),d(i[e],p,1,s.latencyHalfLife)}},getAverageThroughput:p,getSafeAverageThroughput:function(e,t){var n=p(e,t);return isNaN(n)||(n*=l.get().streaming.abr.bandwidthSafetyFactor),n},getAverageLatency:function(e){return h(!1,e)},reset:m};return s={throughputHalfLife:{fast:3,slow:8},latencyHalfLife:{fast:1,slow:2}},m(),y}Xr.__dashjs_factory_name="ThroughputHistory";var $r=c.Z.getClassFactory(Xr);function Qr(){var e,t,n,r,i,s,c,h,p,g,m,y,v,_,T,E,S,w,A,I,C,D,x,N,O,P,M,k=this.context,L=(0,d.Z)(k).getInstance(),F=(0,u.Z)(k).getInstance();function U(){i={},s={},h={},c={},I={},x={},N={},O={},void 0===g&&(g=!1),C&&C.reset(),A=void 0,C=void 0,D=void 0,clearTimeout(p),p=null}function B(t){var i=t.request.mediaType,a=t.streamId;if(i&&a&&c[a]&&M.get().streaming.abr.autoSwitchBitrate[i]){var s=c[a][i];if(s){var u=Vr(k).create({abrController:e,streamProcessor:s,currentRequest:t.request,useBufferOccupancyABR:x[i],useL2AABR:N[i],useLoLPABR:O[i],videoModel:_}),l=n.shouldAbandonFragment(u,a);l.quality>Yr.Z.NO_CHANGE&&s.getFragmentModel().getRequests({state:b.FRAGMENT_MODEL_LOADING,index:t.request.index})[0]&&(h[a][i].state=o.Z.ABANDON_LOAD,I[a][i].reset(),I[a][i].push({oldValue:V(i,a),newValue:l.quality,confidence:1,reason:l.reason}),Y(i,r.getActiveStreamInfo(),l.quality,l.reason),clearTimeout(p),p=setTimeout((function(){h[a][i].state=o.Z.ALLOW_LOAD,p=null}),M.get().streaming.abandonLoadTimeout))}}}function j(e){e.mediaType===a.Z.VIDEO&&(void 0!==A&&C.push(e.streamId,A,_.getPlaybackQuality()),A=e.newQuality)}function q(e){var n,r;e.metric!==o.Z.HTTP_REQUEST||!e.value||e.value.type!==R.w.MEDIA_SEGMENT_TYPE||e.mediaType!==a.Z.AUDIO&&e.mediaType!==a.Z.VIDEO||D.push(e.mediaType,e.value,M.get().streaming.abr.useDeadTimeLatency),e.metric!==o.Z.BUFFER_LEVEL||e.mediaType!==a.Z.AUDIO&&e.mediaType!==a.Z.VIDEO||(n=e.mediaType,r=.001*e.value.level,M.get().streaming.abr.ABRStrategy===a.Z.ABR_STRATEGY_DYNAMIC&&function(e,n){try{var r=T.getStableBufferTime(),i=r,a=.5*r,s=x[e],o=n>(s?a:i);x[e]=o,o!==s&&(o?t.info("["+e+"] switching from throughput to buffer occupancy ABR rule (buffer: "+n.toFixed(3)+")."):t.info("["+e+"] switching from buffer occupancy to throughput ABR rule (buffer: "+n.toFixed(3)+")."))}catch(e){t.error(e)}}(n,r))}function H(e,n){try{var r;return i[n]=i[n]||{},i[n].hasOwnProperty(e)||(i[n][e]=0),r=function(e,t){var n=i[t][e],r=n;if(!c[t]||!c[t][e])return r;var a=G(e,t);void 0!==a&&(r=Math.max(n,a));var s=function(e,t){try{var n=T.getAbrBitrateParameter("maxBitrate",e);return n>-1?W(c[t][e].getMediaInfo(),n,t):void 0}catch(e){return}}(e,t);return void 0!==s&&(r=Math.min(r,s)),r}(e,n),r=function(e,t,n){var r=i[n][t],a=M.get().streaming.abr.maxRepresentationRatio[t];return isNaN(a)||a>=1||a<0?e:Math.min(e,Math.round(r*a))}(r,e,n),r=function(e,t,n){if(t!==a.Z.VIDEO||!M.get().streaming.abr.limitBitrateByPortal||!c[n]||!c[n][t])return e;g||$();var r=c[n][t].getStreamInfo(),i=v.getAdaptationForType(r.index,t,r).Representation_asArray,s=e;if(m>0&&y>0){for(;s>0&&i[s]&&m<i[s].width&&m-i[s-1].width<i[s].width-m;)s-=1;for(;s<i.length-1&&i[s].width===i[s+1].width;)s+=1}return s}(r,e,n),M.get().streaming.cmsd.enabled&&M.get().streaming.cmsd.abr.applyMb&&(r=function(e,n,r){if("video"!==n)return e;var i=S.getMaxBitrate(n);if(i<0)return e;var a=K(r,"audio",V("audio",r));i-=a?a.bitrate/1e3:0;var s=W(c[r][n].getMediaInfo(),i,r);return t.debug("Stream ID: "+r+" ["+n+"] Apply max bit rate from CMSD: "+i),Math.min(e,s)}(r,e,n)),r}catch(e){return}}function G(e,t){try{return function(e,t){try{var n=T.getAbrBitrateParameter("minBitrate",e);if(n>-1){var r=c[t][e].getMediaInfo(),i=X(r),a=W(r,n,t);return i[a]&&a<i.length-1&&i[a].bitrate<1e3*n&&a++,a}return}catch(e){return}}(e,t)}catch(e){return}}function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{return t||(t=r.getActiveStreamInfo().id),e&&c[t]&&c[t][e]&&t?(s[t]=s[t]||{},s[t].hasOwnProperty(e)||(s[t][e]=0),s[t][e]):0}catch(e){return 0}}function Y(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(t&&t.id&&e){var i=t.id,a=V(e,i);(0,Z.SE)(n);var s=H(e,i);n!==a&&n>=0&&n<=s&&z(e,a,n,s,r,i)}}function z(e,n,r,i,a,o){if(e&&c[o]&&c[o][e]){var u=c[o][e].getStreamInfo(),d=u&&u.manifestInfo&&u.manifestInfo.isDynamic,f=P.getCurrentBufferLevel(e);t.info("Stream ID: "+o+" ["+e+"] switch from "+n+" to "+r+"/"+i+" (buffer: "+f+") "+(a?JSON.stringify(a):".")),s[o]=s[o]||{},s[o][e]=r;var h=K(o,e,r);F.trigger(l.Z.QUALITY_CHANGE_REQUESTED,{oldQuality:n,newQuality:r,reason:a,streamInfo:u,bitrateInfo:h,maxIdx:i,mediaType:e},{streamId:u.id,mediaType:e});var p=D.getAverageThroughput(e,d);isNaN(p)||w.setSavedBitrateSettings(e,p)}}function K(e,t,n){if(t&&c&&c[e]&&c[e][t]){var r=X(c[e][t].getMediaInfo());return r[n]?r[n]:null}return null}function W(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=e&&e.type?c[n][e.type].getRepresentationInfo():null;if(M.get().streaming.abr.useDeadTimeLatency&&r&&i&&i.fragmentDuration){r/=1e3;var a=i.fragmentDuration;if(r>a)return 0;t*=1-r/a}for(var s=X(e),o=s.length-1;o>=0;o--)if(1e3*t>=s[o].bitrate)return o;return 0}function X(e){var t=[];if(!e||!e.bitrateList)return t;for(var n,r=e.bitrateList,i=e.type,a=0,s=r.length;a<s;a++)(n=new It).mediaType=i,n.qualityIndex=a,n.bitrate=r[a].bandwidth,n.width=r[a].width,n.height=r[a].height,n.scanType=r[a].scanType,t.push(n);return t}function $(){if(_){var e=M.get().streaming.abr.usePixelRatioInLimitBitrateByPortal&&window.hasOwnProperty("devicePixelRatio")?window.devicePixelRatio:1;m=_.getClientWidth()*e,y=_.getClientHeight()*e}}return e={initialize:function(){C=Wr(k).create(),D=$r(k).create({settings:M}),(n=(0,Hr.Z)(k).create({dashMetrics:P,customParametersModel:E,mediaPlayerModel:T,settings:M})).initialize(),F.on(f.Z.QUALITY_CHANGE_RENDERED,j,e),F.on(f.Z.METRIC_ADDED,q,e),F.on(l.Z.LOADING_PROGRESS,B,e)},isPlayingAtTopQuality:function(e){var t=e?e.id:null,n=V(a.Z.AUDIO,t),r=V(a.Z.VIDEO,t);return n===H(a.Z.AUDIO,t)&&r===H(a.Z.VIDEO,t)},updateTopQualityIndex:function(e){var t=e.type,n=e.streamInfo.id,r=e.representationCount-1;return i[n]=i[n]||{},i[n][t]=r,r},clearDataForStream:function(e){C&&C.clearForStream(e),c[e]&&delete c[e],I[e]&&delete I[e],h[e]&&delete h[e]},getThroughputHistory:function(){return D},getBitrateList:X,getQualityForBitrate:W,getTopBitrateInfoFor:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t||(t=r.getActiveStreamInfo().id),e&&c&&c[t]&&c[t][e]){var n=H(e,t),i=X(c[t][e].getMediaInfo());return i[n]?i[n]:null}return null},getMinAllowedIndexFor:G,getMaxAllowedIndexFor:H,getInitialBitrateFor:function(e,t){if(function(){if(!w||!w.hasOwnProperty("getSavedBitrateSettings"))throw new Error(a.Z.MISSING_CONFIG_ERROR)}(),e===a.Z.TEXT)return NaN;var n=w.getSavedBitrateSettings(e),r=T.getAbrBitrateParameter("initialBitrate",e),i=M.get().streaming.abr.initialRepresentationRatio[e];if(-1===r)if(i>-1){var s=c[t][e].getStreamInfo(),o=v.getAdaptationForType(s.index,e,s).Representation_asArray;r=Array.isArray(o)?o[Math.max(Math.round(o.length*i)-1,0)].bandwidth/1e3:0}else r=isNaN(n)?e===a.Z.VIDEO?1e3:100:n;return r},getQualityFor:V,getAbandonmentStateFor:function(e,t){return h[e]&&h[e][t]?h[e][t].state:null},setPlaybackQuality:Y,checkPlaybackQuality:function(t,r){try{if(!(t&&c&&c[r]&&c[r][t]))return!1;if(C){var i=_.getPlaybackQuality();i&&C.push(r,A,i)}if(!M.get().streaming.abr.autoSwitchBitrate[t])return!1;var a=V(t,r),s=Vr(k).create({abrController:e,switchHistory:I[r][t],droppedFramesHistory:C,streamProcessor:c[r][t],currentValue:a,useBufferOccupancyABR:x[t],useL2AABR:N[t],useLoLPABR:O[t],videoModel:_}),u=G(t,r),l=H(t,r),d=n.getMaxQuality(s),f=d.quality;return void 0!==u&&(f>Yr.Z.NO_CHANGE?f:a)<u&&(f=u),f>l&&(f=l),I[r][t].push({oldValue:a,newValue:f}),f>Yr.Z.NO_CHANGE&&f!==a&&(h[r][t].state===o.Z.ALLOW_LOAD||f<a)&&(z(t,a,f,l,d.reason,r),!0)}catch(e){return!1}},setElementSize:$,setWindowResizeEventCalled:function(e){g=e},registerStreamType:function(e,t){var n=t.getStreamInfo().id;c[n]||(c[n]={}),I[n]||(I[n]={}),h[n]||(h[n]={}),I[n][e]=Zr(k).create(),c[n][e]=t,h[n][e]={},h[n][e].state=o.Z.ALLOW_LOAD,function(e){var t=M.get().streaming.abr.ABRStrategy;t===a.Z.ABR_STRATEGY_L2A?(x[e]=!1,O[e]=!1,N[e]=!0):t===a.Z.ABR_STRATEGY_LoLP?(x[e]=!1,O[e]=!0,N[e]=!1):t===a.Z.ABR_STRATEGY_BOLA?(x[e]=!0,O[e]=!1,N[e]=!1):t===a.Z.ABR_STRATEGY_THROUGHPUT?(x[e]=!1,O[e]=!1,N[e]=!1):t===a.Z.ABR_STRATEGY_DYNAMIC&&(x[e]=!(!x||!x[e])&&x[e],O[e]=!1,N[e]=!1)}(e),e===a.Z.VIDEO&&$()},unRegisterStreamType:function(e,t){try{c[e]&&c[e][t]&&delete c[e][t],I[e]&&I[e][t]&&delete I[e][t],h[e]&&h[e][t]&&delete h[e][t]}catch(e){}},setConfig:function(e){e&&(e.streamController&&(r=e.streamController),e.domStorage&&(w=e.domStorage),e.mediaPlayerModel&&(T=e.mediaPlayerModel),e.customParametersModel&&(E=e.customParametersModel),e.cmsdModel&&(S=e.cmsdModel),e.dashMetrics&&(P=e.dashMetrics),e.adapter&&(v=e.adapter),e.videoModel&&(_=e.videoModel),e.settings&&(M=e.settings))},reset:function(){U(),F.off(l.Z.LOADING_PROGRESS,B,e),F.off(f.Z.QUALITY_CHANGE_RENDERED,j,e),F.off(f.Z.METRIC_ADDED,q,e),n&&n.reset()}},t=L.getLogger(e),U(),e}Qr.__dashjs_factory_name="AbrController";var Jr=c.Z.getSingletonFactory(Qr);Jr.QUALITY_DEFAULT=0,c.Z.updateSingletonFactory(Qr.__dashjs_factory_name,Jr);var ei=Jr,ti=new Map([[a.Z.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,"loadedmetadata"],[a.Z.VIDEO_ELEMENT_READY_STATES.HAVE_CURRENT_DATA,"loadeddata"],[a.Z.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,"canplay"],[a.Z.VIDEO_ELEMENT_READY_STATES.HAVE_ENOUGH_DATA,"canplaythrough"]]);function ni(){var e,t,n,r,i,s,o,c,f=this.context,h=(0,u.Z)(f).getInstance(),p=[];function g(){n&&(n.playbackRate=1,n.removeEventListener("canplay",g))}function m(){return p.length>0}function y(){if(n&&m()&&0===n.playbackRate){var e=document.createEvent("Event");e.initEvent("waiting",!0,!1),n.dispatchEvent(e)}}function v(e,t){n&&n.addEventListener(e,t)}function _(e,t){n&&n.removeEventListener(e,t)}function T(){return n?n.readyState:NaN}function b(){return n?n.buffered:null}function E(e,t,r,i,a){if(n)for(var s=0;s<n.textTracks.length;s++)if(n.textTracks[s].kind===e&&(!t||n.textTracks[s].label==t)&&n.textTracks[s].language===r&&n.textTracks[s].isTTML===i&&n.textTracks[s].isEmbedded===a)return n.textTracks[s];return null}function S(e,t){return e===a.Z.VIDEO_ELEMENT_READY_STATES.HAVE_NOTHING||T()>=e?(t(),null):function(e,t){var n=function n(){_(e,n),t(e)};return v(e,n),{func:n,event:e}}(ti.get(e),t)}return e={addEventListener:v,addTextTrack:function(e,t,r,i,a){if(!n)return null;var s=E(e,t,r,i,a);return s||((s=n.addTextTrack(e,t,r)).isEmbedded=a,s.isTTML=i),s},appendChild:function(e){n&&(n.appendChild(e),void 0!==e.isTTML&&(n.textTracks[n.textTracks.length-1].isTTML=e.isTTML,n.textTracks[n.textTracks.length-1].isEmbedded=e.isEmbedded))},getBufferRange:b,getClientHeight:function(){return n?n.clientHeight:NaN},getClientWidth:function(){return n?n.clientWidth:NaN},getElement:function(){return n},getEnded:function(){return n?n.ended:null},getPlaybackQuality:function(){if(!n)return null;var e="webkitDroppedFrameCount"in n&&"webkitDecodedFrameCount"in n,t=null;return"getVideoPlaybackQuality"in n?t=n.getVideoPlaybackQuality():e&&(t={droppedVideoFrames:n.webkitDroppedFrameCount,totalVideoFrames:n.webkitDroppedFrameCount+n.webkitDecodedFrameCount,creationTime:new Date}),t},getPlaybackRate:function(){return n?n.playbackRate:null},getPlayedRanges:function(){return n?n.played:null},getReadyState:T,getSource:function(){return n?n.src:null},getTTMLRenderingDiv:function(){return s},getTextTrack:E,getTextTracks:function(){return n?n.textTracks:[]},getTime:function(){return n?isNaN(r)?n.currentTime:r:null},getVideoHeight:function(){return n?n.videoHeight:NaN},getVideoRelativeOffsetLeft:function(){if(n){var e=n.parentNode.host||n.parentNode;return e?n.getBoundingClientRect().left-e.getBoundingClientRect().left:NaN}return NaN},getVideoRelativeOffsetTop:function(){if(n){var e=n.parentNode.host||n.parentNode;return e?n.getBoundingClientRect().top-e.getBoundingClientRect().top:NaN}return NaN},getVideoWidth:function(){return n?n.videoWidth:NaN},getVttRenderingDiv:function(){return o},initialize:function(){h.on(l.Z.PLAYBACK_PLAYING,y,this)},isPaused:function(){return n?n.paused:null},isSeeking:function(){return n?n.seeking||!isNaN(r):null},isStalled:m,pause:function(){n&&(n.pause(),n.autoplay=!1)},play:function(){if(n){n.autoplay=!0;var e=n.play();e&&e.catch&&"undefined"!=typeof Promise&&e.catch((function(e){"NotAllowedError"===e.name&&h.trigger(l.Z.PLAYBACK_NOT_ALLOWED),t.warn("Caught pending play exception - continuing (".concat(e,")"))}))}},removeChild:function(e){n&&n.removeChild(e)},removeEventListener:_,reset:function(){clearTimeout(c),h.off(l.Z.PLAYBACK_PLAYING,y,this)},setCurrentTime:function(e,t){n&&(i&&i.func&&i.event&&_(i.event,i.func),r=e,i=S(a.Z.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,(function(){if(n)if(n.currentTime!==r)try{r=t?function(e){var t=b(),n=e,r=9999999999;if(t)for(var i=0;i<t.length;i++){var a=t.start(i),s=t.end(i),o=Math.abs(a-e),u=Math.abs(s-e);if(e>=a&&e<=s)return e;o<r&&(r=o,n=a),u<r&&(r=u,n=s)}return n}(r):r,isNaN(r)||(n.currentTime=r),r=NaN}catch(e){0===n.readyState&&e.code===e.INVALID_STATE_ERR&&(c=setTimeout((function(){n.currentTime=r,r=NaN}),400))}else r=NaN})))},setElement:function(e){if(!(null==e||e&&/^(VIDEO|AUDIO)$/i.test(e.nodeName)))throw"element is not video or audio DOM type!";(n=e)&&(n.preload="auto")},setPlaybackRate:function(e){n&&(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&n.readyState<=2&&e>0?n.addEventListener("canplay",g):n.playbackRate=e)},setSource:function(e){n&&(e?n.src=e:(n.removeAttribute("src"),n.load()))},setStallState:function(e,t){!function(e,t){t?function(e){null!==e&&n&&!n.seeking&&-1===p.indexOf(e)&&p.push(e)}(e):function(e){var t=p.indexOf(e);null!==e&&-1!==t&&p.splice(t,1)}(e)}(e,t)},setTTMLRenderingDiv:function(e){(s=e).style.position="absolute",s.style.display="flex",s.style.overflow="hidden",s.style.pointerEvents="none",s.style.top=0,s.style.left=0},setVttRenderingDiv:function(e){o=e},waitForReadyState:S,setDisableRemotePlayback:function(e){n&&(n.disableRemotePlayback=e)}},t=(0,d.Z)(f).getInstance().getLogger(e),r=NaN,e}ni.__dashjs_factory_name="VideoModel";var ri=c.Z.getSingletonFactory(ni),ii=[{oldKey:"dashjs_vbitrate",newKey:"dashjs_video_bitrate"},{oldKey:"dashjs_abitrate",newKey:"dashjs_audio_bitrate"},{oldKey:"dashjs_vsettings",newKey:"dashjs_video_settings"},{oldKey:"dashjs_asettings",newKey:"dashjs_audio_settings"}],ai="dashjs_?_bitrate",si="dashjs_?_settings",oi="localStorage",ui="lastBitrate",li="lastMediaSettings";function ci(e){e=e||{};var t,n,r,i=this.context,s=e.settings;function o(e){if(void 0!==r)return r;var t;r=!1;try{"undefined"!=typeof window&&(t=window[e])}catch(e){return n.warn("DOMStorage access denied: "+e.message),r}if(!t||e!==oi&&"sessionStorage"!==e)return r;try{t.setItem("1","1"),t.removeItem("1"),r=!0}catch(e){n.warn("DOMStorage is supported, but cannot be used: "+e.message)}return r}function u(){var e=6e5;return Math.round((new Date).getTime()/e)*e}function l(e,t){return o(e)&&s.get().streaming[t+"CachingInfo"].enabled}function c(){if(!s)throw new Error(a.Z.MISSING_CONFIG_ERROR)}return t={getSavedBitrateSettings:function(e){if(c(),!s.get().streaming.lastBitrateCachingInfo.enabled)return NaN;var t=NaN;if(l(oi,ui)){var r=ai.replace(/\?/,e);try{var i=JSON.parse(localStorage.getItem(r))||{},a=(new Date).getTime()-parseInt(i.timestamp,10)>=s.get().streaming.lastBitrateCachingInfo.ttl||!1,o=parseFloat(i.bitrate);isNaN(o)||a?a&&localStorage.removeItem(r):(t=o,n.debug("Last saved bitrate for "+e+" was "+o))}catch(e){return null}}return t},setSavedBitrateSettings:function(e,t){if(l(oi,ui)&&t){var r=ai.replace(/\?/,e);try{localStorage.setItem(r,JSON.stringify({bitrate:t.toFixed(3),timestamp:u()}))}catch(e){n.error(e.message)}}},getSavedMediaSettings:function(e){if(c(),!s.get().streaming.lastMediaSettingsCachingInfo.enabled)return null;var t=null;if(l(oi,li)){var n=si.replace(/\?/,e);try{var r=JSON.parse(localStorage.getItem(n))||{},i=(new Date).getTime()-parseInt(r.timestamp,10)>=s.get().streaming.lastMediaSettingsCachingInfo.ttl||!1;t=r.settings,i&&(localStorage.removeItem(n),t=null)}catch(e){return null}}return t},setSavedMediaSettings:function(e,t){if(l(oi,li)){var r=si.replace(/\?/,e);try{localStorage.setItem(r,JSON.stringify({settings:t,timestamp:u()}))}catch(e){n.error(e.message)}}}},n=(0,d.Z)(i).getInstance().getLogger(t),o(oi)&&ii.forEach((function(e){var t=localStorage.getItem(e.oldKey);if(t){localStorage.removeItem(e.oldKey);try{localStorage.setItem(e.newKey,t)}catch(e){n.error(e.message)}}})),t}ci.__dashjs_factory_name="DOMStorage";var di=c.Z.getSingletonFactory(ci),fi=n(2032),hi=n(2011);function pi(){var e,t,n,r,i,a,s,o,u,l,c,d,f,h=this.context;function p(e,n,i,a){var s=null,u=e?f.resolve(e.path):null,l=a||{init:!0,url:u?u.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500,mediaType:n};t.debug("Start searching for initialization.");var c=v(l);o.load({request:c,success:function(t){if(l.bytesLoaded=l.range.end,!(s=r.findInitRange(t)))return l.range.end=l.bytesLoaded+l.bytesToLoad,p(e,n,i,l);e.range=s,i(e)},error:function(){i(e)}}),t.debug("Perform init search: "+l.url)}function m(e,n,i,a,s,u){if(i&&(void 0===i.start||void 0===i.end)){var l=i?i.toString().split("-"):null;i=l?{start:parseFloat(l[0]),end:parseFloat(l[1])}:null}s=s||y;var c=null,d=null,h=!!i,p=e?f.resolve(e.path):null,g={init:!1,url:p?p.url:void 0,range:h?i:{start:0,end:1500},searching:!h,bytesLoaded:u?u.bytesLoaded:0,bytesToLoad:1500,mediaType:n},_=v(g);o.load({request:_,success:function(i){var o=g.bytesToLoad,u=i.byteLength;if(g.bytesLoaded=g.range.end-g.range.start,c=r.parse(i),(d=c.getBox("sidx"))&&d.isComplete){var l,f,h=d.references;if(null!=h&&h.length>0&&(l=1===h[0].reference_type),l){var p,y,v,_;t.debug("Initiate multiple SIDX load."),g.range.end=g.range.start+d.size;var T=[],b=0,E=(d.offset||g.range.start)+d.size,S=function(t){t?(T=T.concat(t),++b>=y&&(T.sort((function(e,t){return e.startTime-t.startTime<0?-1:0})),s(T,e,a))):s(null,e,a)};for(p=0,y=h.length;p<y;p++)v=E,_=E+h[p].referenced_size-1,E+=h[p].referenced_size,m(e,n,{start:v,end:_},a,S,g)}else t.debug("Parsing segments from SIDX. representation "+n+" - id: "+e.id+" for range : "+g.range.start+" - "+g.range.end),f=function(e,t){for(var n,r,i,a,s=e.references,o=s.length,u=e.timescale,l=e.earliest_presentation_time,c=t.range.start+e.offset+e.first_offset+e.size,d=[],f=0;f<o;f++)i=s[f].subsegment_duration,a=s[f].referenced_size,(n=new hi.Z).duration=i,n.startTime=l,n.timescale=u,r=c+a-1,n.mediaRange=c+"-"+r,d.push(n),l+=i,c+=a;return d}(d,g),s(f,e,a)}else{if(d)g.range.start=d.offset||g.range.start,g.range.end=g.range.start+(d.size||o);else{if(u<g.bytesLoaded)return void s(null,e,a);var w=c.getLastBox();w&&w.size?(g.range.start=w.offset+w.size,g.range.end=g.range.start+o):g.range.end+=o}m(e,n,g.range,a,null,g)}},error:function(){s(null,e,a)}}),t.debug("Perform SIDX load for type ".concat(n," : ").concat(g.url," with range ").concat(g.range.start," - ").concat(g.range.end))}function y(e,t,n){n({segments:e,representation:t,error:e?void 0:new E.Z(u.SEGMENT_BASE_LOADER_ERROR_CODE,u.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}function v(e){if(e.url){var t=new g.Z;return t.setInfo(e),t}}return e={setConfig:function(o){o.baseURLController&&(f=o.baseURLController),o.dashMetrics&&(a=o.dashMetrics),o.mediaPlayerModel&&(s=o.mediaPlayerModel),o.errHandler&&(n=o.errHandler),o.boxParser&&(r=o.boxParser),o.debug&&(t=o.debug.getLogger(e)),o.requestModifier&&(i=o.requestModifier),o.errors&&(u=o.errors),o.urlUtils&&(d=o.urlUtils),o.constants&&(l=o.constants),o.dashConstants&&(c=o.dashConstants)},initialize:function(){o=pt(h).create({errHandler:n,dashMetrics:a,mediaPlayerModel:s,requestModifier:i,boxParser:r,errors:u,urlUtils:d,constants:l,dashConstants:c})},loadInitialization:function(e,t){return new Promise((function(n){p(e,t,n)}))},loadSegments:function(e,t,n){return new Promise((function(r){m(e,t,n,r)}))},reset:function(){o&&(o.abort(),o=null)}}}pi.__dashjs_factory_name="SegmentBaseLoader";var gi=c.Z.getSingletonFactory(pi);function mi(e){var t;e=e||{};var n=new DataView(e.data),r=0;function i(e,t){var i=!0,a=0;if(void 0===t&&(t=!1),e.tag>16777215?(n.getUint32(r)!==e.tag&&(i=!1),a=4):e.tag>65535?(256*n.getUint16(r)+n.getUint8(r+2)!==e.tag&&(i=!1),a=3):e.tag>255?(n.getUint16(r)!==e.tag&&(i=!1),a=2):(n.getUint8(r)!==e.tag&&(i=!1),a=1),!i&&e.required&&!t)throw new Error("required tag not found");return i&&(r+=a),i}function a(e){var t=1,i=128,a=-1,s=0,o=n.getUint8(r),u=0;for(u=0;u<8;u+=1){if((o&i)===i){s=void 0===e?o&~i:o,a=u;break}i>>=1}for(u=0;u<a;u+=1,t+=1)s=s<<8|255&n.getUint8(r+t);return r+=t,s}return t={getPos:function(){return r},setPos:function(e){r=e},consumeTag:i,consumeTagAndSize:function(e,t){var n=i(e,t);return n&&a(),n},parseTag:function(e){var n;return i(e),n=a(),t[e.parse](n)},skipOverElement:function(e,t){var n,s=i(e,t);return s&&(n=a(),r+=n),s},getMatroskaCodedNum:a,getMatroskaFloat:function(e){var t;switch(e){case 4:t=n.getFloat32(r),r+=4;break;case 8:t=n.getFloat64(r),r+=8}return t},getMatroskaUint:function(e){if(e>4)return function(e){for(var t=Math.floor(Number.MAX_SAFE_INTEGER/256),i=0,a=0;a<e;a+=1){if(i>t)throw new Error("Value exceeds safe integer limit");i*=256;var s=n.getUint8(r+a);if(i>Number.MAX_SAFE_INTEGER-s)throw new Error("Value exceeds safe integer limit");i+=s}return r+=e,i}(e);for(var t=0,i=0;i<e;i+=1)t<<=8,t|=255&n.getUint8(r+i);return r+=e,t>>>0},moreData:function(){return r<n.byteLength}}}mi.__dashjs_factory_name="EBMLParser";var yi=c.Z.getClassFactory(mi);function vi(){var e,t,n,r,i,s,o,u,l,c,d=this.context;function f(e){var t=new g.Z;return t.setInfo(e),t}return e={setConfig:function(n){if(!(n.baseURLController&&n.dashMetrics&&n.mediaPlayerModel&&n.errHandler))throw new Error(a.Z.MISSING_CONFIG_ERROR);c=n.baseURLController,s=n.dashMetrics,o=n.mediaPlayerModel,r=n.errHandler,l=n.errors,t=n.debug.getLogger(e),i=n.requestModifier},initialize:function(){u=pt(d).create({errHandler:r,dashMetrics:s,mediaPlayerModel:o,requestModifier:i,errors:l})},loadInitialization:function(e,n){return new Promise((function(r){var i=null,a=e?c.resolve(e.path):null,s=e?e.range.split("-"):null,o={range:{start:s?parseFloat(s[0]):null,end:s?parseFloat(s[1]):null},request:i,url:a?a.url:void 0,init:!0,mediaType:n};t.info("Start loading initialization."),i=f(o),u.load({request:i,success:function(){r(e)},error:function(){r(e)}}),t.debug("Perform init load: "+o.url)}))},loadSegments:function(e,r,i){return new Promise((function(a){var s=null,o=e?c.resolve(e.path):null,h=o?o.url:void 0;s=f({bytesLoaded:0,bytesToLoad:8192,range:{start:0,end:8192},request:s,url:h,init:!1,mediaType:r}),t.debug("Parsing ebml header"),u.load({request:s,success:function(r){!function(e,r,i,a){if(e&&0!==e.byteLength){var s,o,l,c,h=yi(d).create({data:e}),p=i?i.split("-"):null,g=null,m={url:r,range:{start:p?parseFloat(p[0]):null,end:p?parseFloat(p[1]):null},request:g};for(t.debug("Parse EBML header: "+m.url),h.skipOverElement(n.EBML),h.consumeTag(n.Segment),l=h.getMatroskaCodedNum(),l+=h.getPos(),c=h.getPos();h.moreData()&&!h.consumeTagAndSize(n.Segment.Info,!0);)if(!(h.skipOverElement(n.Segment.SeekHead,!0)||h.skipOverElement(n.Segment.Tracks,!0)||h.skipOverElement(n.Segment.Cues,!0)||h.skipOverElement(n.Void,!0)))throw new Error("no valid top level element found");for(;void 0===s;){var y=h.getMatroskaCodedNum(!0),v=h.getMatroskaCodedNum();y===n.Segment.Info.Duration.tag?s=h[n.Segment.Info.Duration.parse](v):h.setPos(h.getPos()+v)}g=f(m),u.load({request:g,success:function(e){o=function(e,r,i,a){var s,o,u,l,c,f,h,p;for(u=[],c=0,f=(o=function(e){var t,r,i=[],a=yi(d).create({data:e});for(a.consumeTagAndSize(n.Segment.Cues);a.moreData()&&a.consumeTagAndSize(n.Segment.Cues.CuePoint,!0);){for((t={}).CueTime=a.parseTag(n.Segment.Cues.CuePoint.CueTime),t.CueTracks=[];a.moreData()&&a.consumeTag(n.Segment.Cues.CuePoint.CueTrackPositions,!0);){var s=a.getMatroskaCodedNum(),o=a.getPos();if((r={}).Track=a.parseTag(n.Segment.Cues.CuePoint.CueTrackPositions.CueTrack),0===r.Track)throw new Error("Cue track cannot be 0");r.ClusterPosition=a.parseTag(n.Segment.Cues.CuePoint.CueTrackPositions.CueClusterPosition),t.CueTracks.push(r),a.setPos(o+s)}if(0===t.CueTracks.length)throw new Error("Mandatory cuetrack not found");i.push(t)}if(0===i.length)throw new Error("mandatory cuepoint not found");return i}(e)).length;c<f;c+=1)l=new hi.Z,s=c<o.length-1?o[c+1].CueTime-o[c].CueTime:a-o[c].CueTime,l.duration=s,l.startTime=o[c].CueTime,l.timescale=1e3,h=o[c].CueTracks[0].ClusterPosition+r,p=c<o.length-1?o[c+1].CueTracks[0].ClusterPosition+r-1:i-1,l.mediaRange=h+"-"+p,u.push(l);return t.debug("Parsed cues: "+u.length+" cues."),u}(e,c,l,s),a(o)},error:function(){t.error("Download Error: Cues "+m.url),a(null)}}),t.debug("Perform cues load: "+m.url+" bytes="+m.range.start+"-"+m.range.end)}else a(null)}(r,h,i,(function(t){a({segments:t,representation:e,error:t?void 0:new E.Z(l.SEGMENT_BASE_LOADER_ERROR_CODE,l.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}))},error:function(){a({representation:e,error:new E.Z(l.SEGMENT_BASE_LOADER_ERROR_CODE,l.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}})}))},reset:function(){u&&(u.abort(),u=null)}},n={EBML:{tag:440786851,required:!0},Segment:{tag:408125543,required:!0,SeekHead:{tag:290298740,required:!0},Info:{tag:357149030,required:!0,TimecodeScale:{tag:2807729,required:!0,parse:"getMatroskaUint"},Duration:{tag:17545,required:!0,parse:"getMatroskaFloat"}},Tracks:{tag:374648427,required:!0},Cues:{tag:475249515,required:!0,CuePoint:{tag:187,required:!0,CueTime:{tag:179,required:!0,parse:"getMatroskaUint"},CueTrackPositions:{tag:183,required:!0,CueTrack:{tag:247,required:!0,parse:"getMatroskaUint"},CueClusterPosition:{tag:241,required:!0,parse:"getMatroskaUint"}}}}},Void:{tag:236,required:!0}},e}vi.__dashjs_factory_name="WebmSegmentBaseLoader";var _i=c.Z.getSingletonFactory(vi);function Ti(e){e=e||{};var t,n,r,i=this.context,a=e.eventBus,s=e.events,o=e.dashMetrics,u=e.mediaPlayerModel,l=e.errHandler,c=e.baseURLController,d=e.debug,f=e.boxParser,h=e.requestModifier,p=e.errors;function g(e){return"webm"===(e?e.split("/")[1]:"").toLowerCase()}return t={initialize:function(){n.initialize(),r.initialize()},getSegmentBaseInitSegment:function(e){return g(e.representation.mimeType)?r.loadInitialization(e.representation,e.mediaType):n.loadInitialization(e.representation,e.mediaType)},getSegmentList:function(e){return g(e.mimeType)?r.loadSegments(e.representation,e.mediaType,e.representation?e.representation.indexRange:null):n.loadSegments(e.representation,e.mediaType,e.representation?e.representation.indexRange:null)},reset:function(){n.reset(),r.reset()}},n=gi(i).getInstance(),r=_i(i).getInstance(),n.setConfig({baseURLController:c,dashMetrics:o,mediaPlayerModel:u,errHandler:l,eventBus:a,events:s,errors:p,debug:d,boxParser:f,requestModifier:h}),r.setConfig({baseURLController:c,dashMetrics:o,mediaPlayerModel:u,errHandler:l,eventBus:a,events:s,errors:p,debug:d,requestModifier:h}),t}Ti.__dashjs_factory_name="SegmentBaseController";var bi=c.Z.getSingletonFactory(Ti),Ei=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.quality=null,this.fragmentDuration=null,this.mediaInfo=null,this.MSETimeOffset=null},Si=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=null,this.type=null,this.streamInfo=null,this.representationCount=0,this.labels=null,this.lang=null,this.viewpoint=null,this.viewpointsWithSchemeIdUri=null,this.accessibility=null,this.accessibilitiesWithSchemeIdUri=null,this.audioChannelConfiguration=null,this.audioChannelConfigurationsWithSchemeIdUri=null,this.roles=null,this.rolesWithSchemeIdUri=null,this.codec=null,this.mimeType=null,this.contentProtection=null,this.isText=!1,this.KID=null,this.bitrateList=null,this.isFragmented=null,this.isEmbedded=null,this.selectionPriority=1,this.supplementalProperties={},this.supplementalPropertiesAsArray=[],this.segmentAlignment=!1,this.subSegmentAlignment=!1},wi=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=null,this.start=NaN,this.duration=NaN,this.manifestInfo=null,this.isLast=!0},Ai=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.dvrWindowSize=NaN,this.loadedTime=null,this.availableFrom=null,this.minBufferTime=NaN,this.duration=NaN,this.isDynamic=!1,this.maxFragmentDuration=null,this.serviceDescriptions=[],this.protocol=null};var Ii=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.valid="/"==t[0],this.path=t.split("/").filter((function(e){return 0!==e.length})).map((function(e){var t={name:e},r=e.indexOf("[");if(-1!=r){t.name=e.substring(0,r);var i=e.substring(r+1,e.length-1);n.valid=n.valid&&-1==i.indexOf("[");var a=i.indexOf("=");-1!=a?(t.attribute={name:i.substring(1,a),value:i.substring(a+1)},-1!=["'",'"'].indexOf(t.attribute.value[0])&&(t.attribute.value=t.attribute.value.substring(1,t.attribute.value.length-1))):t.position=parseInt(i,10)-1}return t}))}var t;return(t=[{key:"isValid",value:function(){return this.valid}},{key:"findsElement",value:function(){return!this.findsAttribute()}},{key:"findsAttribute",value:function(){return this.path[this.path.length-1].name.startsWith("@")}},{key:"findsTextReplace",value:function(){return"text()"===this.path[this.path.length-1].name}},{key:"getMpdTarget",value:function(e,t){for(var n=null,r=e,i=1,a="MPD";i<this.path.length&&null!==r;){n=r;var s=this.path[i];if(a=s.name,i!==this.path.length-1||!a.startsWith("@")&&"text()"!==a){var o=n[a+"_asArray"]||[];0===o.length&&n[a]&&o.push(n[a]),s.position?r=o[s.position]||null:s.attribute?function(){var e=s.attribute;r=o.filter((function(t){return t[e.name]==e.value}))[0]||null}():r=o[0]||null}i++}return null===r?null:a.startsWith("@")?{name:a.substring(1),leaf:r,target:r}:"text()"===a?{name:"__text",leaf:r,target:r}:{name:a,leaf:r,target:t?n:r}}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();var Ci=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.action=t,this.xpath=n,this.value=r,this.position=null}var t;return(t=[{key:"getMpdTarget",value:function(e){var t="remove"===this.action||"replace"===this.action||"before"===this.position||"after"===this.position;return this.xpath.getMpdTarget(e,t)}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function Ri(){var e,t,n=this.context;return e={getIsPatch:function(e){return e&&e.hasOwnProperty(s.Z.ORIGINAL_MPD_ID)||!1},getPublishTime:function(e){return e&&e.hasOwnProperty(s.Z.PUBLISH_TIME)?new Date(e[s.Z.PUBLISH_TIME]):null},getOriginalPublishTime:function(e){return e&&e.hasOwnProperty(s.Z.ORIGINAL_PUBLISH_TIME)?new Date(e[s.Z.ORIGINAL_PUBLISH_TIME]):null},getMpdId:function(e){return e&&e[s.Z.ORIGINAL_MPD_ID]||null},getPatchOperations:function(e){return e?(e.__children||[]).map((function(e){var n=Object.keys(e)[0];if("add"!==n&&"remove"!==n&&"replace"!==n)return t.warn("Ignoring node of invalid action: ".concat(n)),null;var r=e[n],i=r.sel;if("add"===n&&r.type){if(!r.type.startsWith("@"))return t.warn("Ignoring add action for prefixed namespace declaration: ".concat(r.type,"=").concat(r.__text)),null;i="".concat(i,"/").concat(r.type)}var a=new Ii(i);if(!a.isValid())return t.warn("Ignoring action with invalid selector: ".concat(n," - ").concat(i)),null;var s=null;a.findsAttribute()||a.findsTextReplace()?s=r.__text||"":"remove"!==n&&(s=r.__children.reduce((function(e,t){var n=Object.keys(t)[0];return"#text"!==n&&(e[n]=e[n]||[],e[n].push(t[n])),e}),{}));var o=new Ci(n,a,s);return"add"===n&&(o.position=r.pos),o})).filter((function(e){return!!e})):[]}},t=(0,d.Z)(n).getInstance().getLogger(e),e}Ri.__dashjs_factory_name="PatchManifestModel";var Di=c.Z.getSingletonFactory(Ri);function xi(){var e,t,n,r,i,a,o,u=this.context;function l(e,n,a){var o,u=t.getAdaptationsForType(r[0].mpd.manifest,e,n);if(!u||0===u.length)return null;if(u.length>1&&a){var l=f(a,n);if(i[a.id]&&i[a.id][n])for(var d=0,h=u.length;d<h;d++)if(c(i[a.id][n],l[d]))return u[d];for(var p=0,g=u.length;p<g;p++)if(o=u[p],t.getRolesForAdaptation(o).filter((function(e){return e.value===s.Z.MAIN}))[0])return u[p]}return u[0]}function c(e,t){if(!e||!t)return!1;var n=e.id===t.id,r=e.codec===t.codec,i=e.viewpoint===t.viewpoint,a=JSON.stringify(e.viewpointsWithSchemeIdUri)===JSON.stringify(t.viewpointsWithSchemeIdUri),s=e.lang===t.lang,o=e.roles.toString()===t.roles.toString(),u=JSON.stringify(e.rolesWithSchemeIdUri)===JSON.stringify(t.rolesWithSchemeIdUri),l=e.accessibility.toString()===t.accessibility.toString(),c=JSON.stringify(e.accessibilitiesWithSchemeIdUri)===JSON.stringify(t.accessibilitiesWithSchemeIdUri),d=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString(),f=JSON.stringify(e.audioChannelConfigurationsWithSchemeIdUri)===JSON.stringify(t.audioChannelConfigurationsWithSchemeIdUri);return n&&r&&i&&a&&s&&o&&u&&l&&c&&d&&f}function d(e,n,r,i,s,o){var u,l,c,d,f,h,p=[];if(!i||0===i.length)return[];var g=t.getAdaptationsForPeriod(n);for(d=0,h=i.length;d<h;d++)if(u=i[d],l=_(g[c=t.getIndexForAdaptation(u,e,r.index)]),o){var m=l.accessibility.length;for(f=0;f<m;f++)if(l){var y=l.accessibility[f];if(0===y.indexOf("cea-608:")){var v=y.substring(8).split(";");if("CC"===v[0].substring(0,2))for(f=0;f<v.length;f++)l||(l=_.call(this,g[c])),T(l,v[f].substring(0,3),v[f].substring(4)),p.push(l),l=null;else for(f=0;f<v.length;f++)l||(l=_.call(this,g[c])),T(l,"CC"+(f+1),v[f]),p.push(l),l=null}else 0===y.indexOf("cea-608")&&(T(l,a.CC1,"eng"),p.push(l),l=null)}}else s===a.IMAGE?(l.type=a.IMAGE,p.push(l),l=null):l&&p.push(l);return p}function f(e,n,i){var s=r,o=i,u=[];if(o)E(),s=h(o);else{if(!(r.length>0))return u;o=r[0].mpd.manifest}var l=v(e,s),c=t.getAdaptationsForType(o,e?e.index:null,n);return u=d(o,l,e,c,n),n===a.TEXT&&(c=t.getAdaptationsForType(o,e?e.index:null,a.VIDEO),u=u.concat(d(o,l,e,c,n,!0))),u}function h(e){var n=p(e);return t.getRegularPeriods(n)}function p(e){var n=m(e);return t.getMpd(n)}function g(){r=[],i={}}function m(e){return e||(r.length>0?r[0].mpd.manifest:null)}function y(e){try{var n=v(e.streamInfo,r),i=t.getAdaptationsForPeriod(n);return e&&e.streamInfo&&void 0!==e.streamInfo.id&&i?i[e.index]:null}catch(e){return null}}function v(e,t){for(var n=t.length,r=0;r<n;r++){var i=t[r];if(e&&e.id===i.id)return i}return null}function _(e){if(!e)return null;var n,r,i,a,s,u=new Si,l=e.period.mpd.manifest.Period_asArray[e.period.index].AdaptationSet_asArray[e.index];if(u.id=e.id,u.index=e.index,u.type=e.type,u.streamInfo=b(e.period),u.representationCount=t.getRepresentationCount(l),u.labels=t.getLabelsForAdaptation(l),u.lang=t.getLanguageForAdaptation(l),u.segmentAlignment=t.getSegmentAlignment(l),u.subSegmentAlignment=t.getSubSegmentAlignment(l),n=t.getViewpointForAdaptation(l),u.viewpoint=n.length?n[0].value:void 0,u.viewpointsWithSchemeIdUri=n,s=t.getAccessibilityForAdaptation(l),u.accessibility=s.map((function(e){var t=e.value,n=t;return e.schemeIdUri&&e.schemeIdUri.search("cea-608")>=0&&void 0!==o&&(n=t?"cea-608:"+t:"cea-608",u.embeddedCaptions=!0),n})),u.accessibilitiesWithSchemeIdUri=s,r=t.getAudioChannelConfigurationForAdaptation(l),u.audioChannelConfiguration=r.map((function(e){return e.value})),u.audioChannelConfigurationsWithSchemeIdUri=r,0===u.audioChannelConfiguration.length&&Array.isArray(l.Representation_asArray)&&l.Representation_asArray.length>0&&(i=t.getAudioChannelConfigurationForRepresentation(l.Representation_asArray[0]),u.audioChannelConfiguration=i.map((function(e){return e.value})),u.audioChannelConfigurationsWithSchemeIdUri=i),a=t.getRolesForAdaptation(l),u.roles=a.map((function(e){return e.value})),u.rolesWithSchemeIdUri=a,u.codec=t.getCodec(l),u.mimeType=t.getMimeType(l),u.contentProtection=t.getContentProtectionData(l),u.bitrateList=t.getBitrateListForAdaptation(l),u.selectionPriority=t.getSelectionPriority(l),u.contentProtection){var c=u.contentProtection.map((function(e){return t.getKID(e)})).filter((function(e){return null!==e}));if(c.length){var d=c[0];u.contentProtection.forEach((function(e){e.keyId=d}))}}if(u.isText=t.getIsText(l),u.supplementalProperties=t.getSupplementalPropertiesForAdaptation(l),(!u.supplementalProperties||0===Object.keys(u.supplementalProperties).length)&&Array.isArray(l.Representation_asArray)&&l.Representation_asArray.length>0){var f=l.Representation_asArray.map((function(e){return t.getSupplementalPropertiesForRepresentation(e)}));f.every((function(e){return JSON.stringify(e)===JSON.stringify(f[0])}))&&(u.supplementalProperties=f[0])}if(u.supplementalPropertiesAsArray=t.getSupplementalPropertiesAsArrayForAdaptation(l),(!u.supplementalPropertiesAsArray||0===u.supplementalPropertiesAsArray.length)&&Array.isArray(l.Representation_asArray)&&l.Representation_asArray.length>0){var h=l.Representation_asArray.map((function(e){return t.getSupplementalPropertiesAsArrayForRepresentation(e)}));h.every((function(e){return JSON.stringify(e)===JSON.stringify(h[0])}))&&(u.supplementalPropertiesAsArray=h[0])}return u.isFragmented=t.getIsFragmented(l),u.isEmbedded=!1,u}function T(e,t,n){e.id=t,e.index=100+parseInt(t.substring(2,3)),e.type=a.TEXT,e.codec="cea-608-in-SEI",e.isEmbedded=!0,e.isFragmented=!1;var r=dn()(n);e.lang=r||n,e.roles=["caption"],e.rolesWithSchemeIdUri=[{schemeIdUri:"urn:mpeg:dash:role:2011",value:"caption"}]}function b(e){var n,r,i=new wi;return i.id=e.id,i.index=e.index,i.start=e.start,i.duration=e.duration,i.manifestInfo=(n=e.mpd,(r=new Ai).dvrWindowSize=n.timeShiftBufferDepth,r.loadedTime=n.manifest.loadedTime,r.availableFrom=n.availabilityStartTime,r.minBufferTime=n.manifest.minBufferTime,r.maxFragmentDuration=n.maxSegmentDuration,r.duration=t.getDuration(n.manifest),r.isDynamic=t.getIsDynamic(n.manifest),r.serviceDescriptions=t.getServiceDescriptions(n.manifest),r.protocol=n.manifest.protocol,r),i.isLast=1===e.mpd.manifest.Period_asArray.length||Math.abs(i.start+i.duration-i.manifestInfo.duration)<1,i}function E(){if(!a)throw new Error("setConfig function has to be called previously")}function S(e){return r.length>0?r[0].mpd.manifest.Period_asArray[e]:null}function w(e,t,n){var r,i,a,s,o;if(e)for(r=e.AdaptationSet_asArray,s=0;s<r.length;s+=1)for(a=r[s].Representation_asArray,o=0;o<a.length;o+=1)if(t===(i=a[o]).id)return n?o:i;return null}return e={getBandwidthForRepresentation:function(e,t){var n;return(n=w(S(t),e))?n.bandwidth:null},getIndexForRepresentation:function(e,t){return function(e,t){var n=w(e,t,!0);return null!==n?n:-1}(S(t),e)},getMaxIndexForBufferType:function(e,n){return function(e,n){var r,i,a,s;if(!e||!n)return-1;for(i=e.AdaptationSet_asArray,s=0;s<i.length;s+=1)if(a=(r=i[s]).Representation_asArray,t.getIsTypeOf(r,n))return a.length;return-1}(S(n),e)},convertRepresentationToRepresentationInfo:function(e){if(e){var n=new Ei,r=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],i=t.getRepresentationFor(e.index,r);return n.id=e.id,n.quality=e.index,n.bandwidth=t.getBandwidth(i),n.fragmentDuration=e.segmentDuration||(e.segments&&e.segments.length>0?e.segments[0].duration:NaN),n.MSETimeOffset=e.MSETimeOffset,n.mediaInfo=_(e.adaptation),n}return null},getStreamsInfo:function(e,t){var n=[],i=r;if(e&&(E(),i=h(e)),i.length>0){(!t||t>i.length)&&(t=i.length);for(var a=0;a<t;a++)n.push(b(i[a]))}return n},getMediaInfoForType:function(e,n){if(0===r.length||!e)return null;var i=v(e,r);if(!i)return null;var a=t.getAdaptationsForPeriod(i),s=l(e.index,n,e);return s?_(a[t.getIndexForAdaptation(s,r[0].mpd.manifest,e.index)]):null},getAllMediaInfoForType:f,getAdaptationForType:l,getRealAdaptation:function(e,n){var i,a,s=v(e,r);return i=n?n.id:null,r.length>0&&s&&(a=i?t.getAdaptationForId(i,r[0].mpd.manifest,s.index):t.getAdaptationForIndex(n?n.index:null,r[0].mpd.manifest,s.index)),a},getProducerReferenceTimes:function(e,n){var i,a,s=v(e,r);return i=n?n.id:null,r.length>0&&s&&(a=i?t.getAdaptationForId(i,r[0].mpd.manifest,s.index):t.getAdaptationForIndex(n?n.index:null,r[0].mpd.manifest,s.index)),a?t.getProducerReferenceTimesForAdaptation(a):[]},getRealPeriodByIndex:function(e){return t.getRealPeriodForIndex(e,r[0].mpd.manifest)},getEssentialPropertiesForRepresentation:function(e){try{return t.getEssentialPropertiesForRepresentation(e)}catch(e){return[]}},getVoRepresentations:function(e){var n=y(e);return t.getRepresentationsForAdaptation(n)},getEventsFor:function(e,n,i){var a=[];if(r.length>0){var s=r[0].mpd.manifest;if(e instanceof wi){var o=v(e,r);a=t.getEventsForPeriod(o)}else if(e instanceof Si){var u=v(i,r);a=t.getEventStreamForAdaptationSet(s,y(e),u)}else if(e instanceof Ei){var l=v(i,r);a=t.getEventStreamForRepresentation(s,n,l)}}return a},getEvent:function(e,t,n,r){try{if(!e||!t||isNaN(n)||!r)return null;var i=e.scheme_id_uri,a=e.value;if(!t[i+"/"+a])return null;var s,o=new ve,u=e.timescale||1,l=r.adaptation.period.start,c=t[i+"/"+a],d=isNaN(r.presentationTimeOffset)?isNaN(c.presentationTimeOffset)?0:c.presentationTimeOffset:r.presentationTimeOffset,f=e.presentation_time_delta/u;s=0===e.version?l+n-d+f:l-d+f;var h=e.event_duration/u,p=e.id,g=e.message_data;return o.eventStream=c,o.eventStream.value=a,o.eventStream.timescale=u,o.duration=h,o.id=p,o.calculatedPresentationTime=s,o.messageData=g,o.presentationTimeDelta=f,o}catch(e){return null}},getMpd:p,setConfig:function(e){e&&(e.constants&&(a=e.constants),e.cea608parser&&(o=e.cea608parser),e.errHandler&&t.setConfig({errHandler:e.errHandler}),e.BASE64&&t.setConfig({BASE64:e.BASE64}))},updatePeriods:function(e){if(!e)return null;E(),r=h(e)},getIsTextTrack:function(e){return t.getIsText(e)},getUTCTimingSources:function(){var e=m();return t.getUTCTimingSources(e)},getSuggestedPresentationDelay:function(){var e=r.length>0?r[0].mpd:null;return t.getSuggestedPresentationDelay(e)},getAvailabilityStartTime:function(e){var n=p(e);return t.getAvailabilityStartTime(n)},getIsTypeOf:function(e,n){return t.getIsTypeOf(e,n)},getIsDynamic:function(e){var n=m(e);return t.getIsDynamic(n)},getDuration:function(e){var n=m(e);return t.getDuration(n)},getRegularPeriods:h,getContentSteering:function(e){return t.getContentSteering(e)},getLocation:function(e){return t.getLocation(e)},getPatchLocation:function(e){var n=t.getPatchLocation(e),r=t.getPublishTime(e);return n&&0!==n.length&&r?n.filter((function(e){return isNaN(e.ttl)||r.getTime()+e.ttl>(new Date).getTime()})):[]},getManifestUpdatePeriod:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.getManifestUpdatePeriod(e,n)},getPublishTime:function(e){return t.getPublishTime(e)},getIsDVB:function(e){return t.hasProfile(e,"urn:dvb:dash:profile:dvb-dash:2014")},getIsPatch:function(e){return n.getIsPatch(e)},getBaseURLsFromElement:function(e){return t.getBaseURLsFromElement(e)},getRepresentationSortFunction:function(){return t.getRepresentationSortFunction()},getCodec:function(e,n,r){return t.getCodec(e,n,r)},getPeriodById:function(e){if(!e||0===r.length)return null;var t=r.filter((function(t){return t.id===e}));return t&&t.length>0?t[0]:null},setCurrentMediaInfo:function(e,t,n){i[e]=i[e]||{},i[e][t]=i[e][t]||{},i[e][t]=n},isPatchValid:function(e,r){var i=t.getId(e),a=n.getMpdId(r),s=t.getPublishTime(e),o=n.getPublishTime(r),u=n.getOriginalPublishTime(r);return!!(i&&a&&i==a&&s&&u&&s.getTime()==u.getTime()&&o&&s.getTime()<o.getTime())},applyPatchToManifest:function(e,t){n.getPatchOperations(t).forEach((function(t){var n=t.getMpdTarget(e);if(null!==n){var r=n.name,i=n.target,a=n.leaf;if(t.xpath.findsAttribute()||"__text"===r)switch(t.action){case"add":case"replace":i[r]=t.value;break;case"remove":delete i[r]}else{var s=(i[r+"_asArray"]||[]).indexOf(a),o="prepend"===t.position||"before"===t.position;if(("remove"===t.action||"replace"===t.action)&&(delete i[r],-1!=s)){var u=i[r+"_asArray"];u.splice(s,1),u.length>1?i[r]=u:1==u.length?i[r]=u[0]:delete i[r+"_asArray"]}"add"!==t.action&&"replace"!==t.action||Object.keys(t.value).forEach((function(e){var n=t.value[e],a=i[e+"_asArray"]||[];if(0===a.length&&i[e]&&a.push(i[e]),0===a.length)a=n;else{var u=a.length;u=e==r&&-1!=s?s+(o?0:1)+("replace"==t.action?-1:0):o?0:a.length,a.splice.apply(a,[u,0].concat(n))}i[e+"_asArray"]=a,i[e]=1==a.length?a[0]:a}))}}}))},areMediaInfosEqual:c,reset:g},t=Le(u).getInstance(),n=Di(u).getInstance(),g(),e}xi.__dashjs_factory_name="DashAdapter";var Ni=c.Z.getSingletonFactory(xi);var Oi=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t;return t=[{key:"round10",value:function(e,t){return function(e,t,n){return void 0===n||0==+n?Math[e](t):(n=+n,null===(t=+t)||isNaN(t)||"number"!=typeof n||n%1!=0?NaN:(t=t.toString().split("e"),+((t=(t=Math[e](+(t[0]+"e"+(t[1]?+t[1]-n:-n)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]+n:n))))}("round",e,t)}}],t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e,t),e}(),Pi=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TcpList=[],this.HttpList=[],this.RepSwitchList=[],this.BufferLevel=[],this.BufferState=[],this.PlayList=[],this.DroppedFrames=[],this.SchedulingInfo=[],this.DVRInfo=[],this.ManifestUpdate=[],this.RequestsQueue=null,this.DVBErrors=[]},Mi=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.mt=null,this.to=null,this.lto=null},ki=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.level=null},Li=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.target=null,this.state=o.Z.BUFFER_EMPTY},Fi=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=null,this.range=null,this.manifestInfo=null},Ui=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=null,this.droppedFrames=null};function Bi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var ji=function e(){Bi(this,e),this.mediaType=null,this.type=null,this.requestTime=null,this.fetchTime=null,this.availabilityStartTime=null,this.presentationStartTime=0,this.clientTimeOffset=0,this.currentTime=null,this.buffered=null,this.latency=0,this.streamInfo=[],this.representationInfo=[]},qi=function e(){Bi(this,e),this.id=null,this.index=null,this.start=null,this.duration=null},Hi=function e(){Bi(this,e),this.id=null,this.index=null,this.mediaType=null,this.streamIndex=null,this.presentationTimeOffset=null,this.startNumber=null,this.fragmentInfoType=null},Gi=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mediaType=null,this.t=null,this.type=null,this.startTime=null,this.availabilityStartTime=null,this.duration=null,this.quality=null,this.range=null,this.state=null},Vi=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.loadingRequests=[],this.executedRequests=[]};function Yi(e){var t,n,r=(e=e||{}).settings,i=this.context,s=(0,u.Z)(i).getInstance();function c(){s.trigger(l.Z.METRICS_CHANGED)}function d(e){s.trigger(l.Z.METRIC_CHANGED,{mediaType:e}),c()}function f(e,t,n){s.trigger(l.Z.METRIC_UPDATED,{mediaType:e,metric:t,value:n}),d(e)}function h(e,t,n){s.trigger(l.Z.METRIC_ADDED,{mediaType:e,metric:t,value:n}),d(e)}function p(e,t){var r=null;return e?(n.hasOwnProperty(e)?r=n[e]:t||(r=new Pi,n[e]=r),r):r}function g(e,t,n){var i=p(e);null!==i&&(i[t].push(n),i[t].length>r.get().streaming.metrics.maxListDepth&&i[t].shift())}function m(e,t,n){g(e,t,n),h(e,t,n)}return t={clearCurrentMetricsForType:function(e){delete n[e],d(e)},clearAllCurrentMetrics:function(){n={},c()},getMetricsFor:p,addHttpRequest:function e(t,n,r,i,a,s,u,l,c,d,f,h,p,g,y,v,_){var T=new R.w;s&&s!==i&&(e(t,null,r,i,a,null,null,l,c,null,null,null,p,null,null,v,_),T.actualurl=s),T.tcpid=n,T.type=r,T.url=i,T.range=l,T.trequest=c,T.tresponse=d,T.responsecode=h,T.cmsd=_,T._tfinish=f,T._stream=t,T._mediaduration=p,T._quality=a,T._responseHeaders=g,T._serviceLocation=u,T._fileLoaderType=v,y?y.forEach((function(e){!function(e,t,n,r){var i=new R.O;i.s=t,i.d=n,i.b=r,e.trace.push(i),e.interval||(e.interval=0),e.interval+=n}(T,e.s,e.d,e.b)})):(delete T.interval,delete T.trace),m(t,o.Z.HTTP_REQUEST,T)},addRepresentationSwitch:function(e,t,n,r,i){var a=new Mi;a.t=t,a.mt=n,a.to=r,i?a.lto=i:delete a.lto,m(e,o.Z.TRACK_SWITCH,a)},addBufferLevel:function(e,t,n){var r=new ki;r.t=t,r.level=n,m(e,o.Z.BUFFER_LEVEL,r)},addBufferState:function(e,t,n){var r=new Li;r.target=n,r.state=t,m(e,o.Z.BUFFER_STATE,r)},addDVRInfo:function(e,t,n,r){var i=new Fi;i.time=t,i.range=r,i.manifestInfo=n,m(e,o.Z.DVR_INFO,i)},addDroppedFrames:function(e,t){var n=new Ui,r=p(e).DroppedFrames;t&&(n.time=t.creationTime,n.droppedFrames=t.droppedVideoFrames,r.length>0&&r[r.length-1]==n||m(e,o.Z.DROPPED_FRAMES,n))},addSchedulingInfo:function(e,t,n,r,i,a,s,u,l){var c=new Gi;c.mediaType=e,c.t=t,c.type=n,c.startTime=r,c.availabilityStartTime=i,c.duration=a,c.quality=s,c.range=u,c.state=l,m(e,o.Z.SCHEDULING_INFO,c)},addRequestsQueue:function(e,t,n){var r=new Vi;r.loadingRequests=t,r.executedRequests=n,p(e).RequestsQueue=r,h(e,o.Z.REQUESTS_QUEUE,r)},addManifestUpdate:function(e,t,n,r,i,s,u,l,c,d){var f=new ji;f.mediaType=e,f.type=t,f.requestTime=n,f.fetchTime=r,f.availabilityStartTime=i,f.presentationStartTime=s,f.clientTimeOffset=u,f.currentTime=l,f.buffered=c,f.latency=d,g(a.Z.STREAM,o.Z.MANIFEST_UPDATE,f),h(e,o.Z.MANIFEST_UPDATE,f)},updateManifestUpdateInfo:function(e,t){if(e){for(var n in t)e[n]=t[n];f(e.mediaType,o.Z.MANIFEST_UPDATE,e)}},addManifestUpdateStreamInfo:function(e,t,n,r,i){if(e){var a=new qi;a.id=t,a.index=n,a.start=r,a.duration=i,e.streamInfo.push(a),f(e.mediaType,o.Z.MANIFEST_UPDATE_STREAM_INFO,e)}},addManifestUpdateRepresentationInfo:function(e,t,n,r,i,a,s,u){if(e&&e.representationInfo){var l=new Hi;l.id=t,l.index=n,l.streamIndex=r,l.mediaType=i,l.startNumber=s,l.fragmentInfoType=u,l.presentationTimeOffset=a,e.representationInfo.push(l),f(e.mediaType,o.Z.MANIFEST_UPDATE_TRACK_INFO,e)}},addPlayList:function(e){e.trace&&Array.isArray(e.trace)?e.trace.forEach((function(e){e.hasOwnProperty("subreplevel")&&!e.subreplevel&&delete e.subreplevel})):delete e.trace,m(a.Z.STREAM,o.Z.PLAY_LIST,e)},addDVBErrors:function(e){m(a.Z.STREAM,o.Z.DVB_ERRORS,e)}},n={},t}Yi.__dashjs_factory_name="MetricsModel";var zi=c.Z.getSingletonFactory(Yi);function Zi(e){e=e||{};var t,n,r,i,s=this.context,u=e.metricsModel;function l(e){var t=u.getMetricsFor(e,!0);if(!t)return null;var n,r=t.HttpList,i=null;if(!r||r.length<=0)return null;for(n=r.length-1;n>=0;){if(r[n].responsecode){i=r[n];break}n--}return i}function c(e){var t=u.getMetricsFor(e,!0);return t&&t.HttpList?t.HttpList:[]}function d(e,t){if(!e)return null;var n=e[t];return n&&0!==n.length?n[n.length-1]:null}return t={getCurrentRepresentationSwitch:function(e){return d(u.getMetricsFor(e,!0),o.Z.TRACK_SWITCH)},getCurrentBufferState:function(e){return d(u.getMetricsFor(e,!0),o.Z.BUFFER_STATE)},getCurrentBufferLevel:function(e){var t=d(u.getMetricsFor(e,!0),o.Z.BUFFER_LEVEL);return t?Oi.round10(t.level/1e3,-3):0},getCurrentHttpRequest:l,getHttpRequests:c,getCurrentDroppedFrames:function(){return d(u.getMetricsFor(a.Z.VIDEO,!0),o.Z.DROPPED_FRAMES)},getCurrentSchedulingInfo:function(e){return d(u.getMetricsFor(e,!0),o.Z.SCHEDULING_INFO)},getCurrentDVRInfo:function(e){return d(e?u.getMetricsFor(e,!0):u.getMetricsFor(a.Z.VIDEO,!0)||u.getMetricsFor(a.Z.AUDIO,!0),o.Z.DVR_INFO)},getCurrentManifestUpdate:function(){return d(u.getMetricsFor(a.Z.STREAM),o.Z.MANIFEST_UPDATE)},getLatestFragmentRequestHeaderValueByID:function(e,t){if(!t)return null;var n={},r=l(e);r&&(n=Fe.Z.parseHttpHeaders(r._responseHeaders));var i=n[t.toLowerCase()];return void 0===i?null:i},getLatestMPDRequestHeaderValueByID:function(e){if(!e)return null;var t,n,r,i={};for(r=(t=c(a.Z.STREAM)).length-1;r>=0;r--)if((n=t[r]).type===R.w.MPD_TYPE){i=Fe.Z.parseHttpHeaders(n._responseHeaders);break}var s=i[e.toLowerCase()];return void 0===s?null:s},addRepresentationSwitch:function(e,t,n,r,i){u.addRepresentationSwitch(e,t,n,r,i)},addDVRInfo:function(e,t,n,r){u.addDVRInfo(e,t,n,r)},updateManifestUpdateInfo:function(e){var t=this.getCurrentManifestUpdate();u.updateManifestUpdateInfo(t,e)},addManifestUpdateStreamInfo:function(e){if(e){var t=this.getCurrentManifestUpdate();u.addManifestUpdateStreamInfo(t,e.id,e.index,e.start,e.duration)}},addManifestUpdateRepresentationInfo:function(e,t){if(e){var n=this.getCurrentManifestUpdate();u.addManifestUpdateRepresentationInfo(n,e.id,e.index,e.streamIndex,t,e.presentationTimeOffset,e.startNumber,e.fragmentInfoType)}},addManifestUpdate:function(e){u.addManifestUpdate(a.Z.STREAM,e.type,e.requestStartDate,e.requestEndDate)},addHttpRequest:function(e,t,n,r,i,a){u.addHttpRequest(e.mediaType,null,e.type,e.url,e.quality,t,e.serviceLocation||null,e.range||null,e.requestStartDate,e.firstByteDate,e.requestEndDate,n,e.duration,r,i,e.fileLoaderType,a)},addSchedulingInfo:function(e,t){u.addSchedulingInfo(e.mediaType,new Date,e.type,e.startTime,e.availabilityStartTime,e.duration,e.quality,e.range,t)},addRequestsQueue:function(e,t,n){u.addRequestsQueue(e,t,n)},addBufferLevel:function(e,t,n){u.addBufferLevel(e,t,n)},addBufferState:function(e,t,n){u.addBufferState(e,t,n)},addDroppedFrames:function(e){u.addDroppedFrames(a.Z.VIDEO,e)},addPlayList:function(){i&&(u.addPlayList(i),i=null)},addDVBErrors:function(e){u.addDVBErrors(e)},createPlaylistMetrics:function(e,t){(i=new Q).start=new Date,i.mstart=e,i.starttype=t},createPlaylistTraceMetrics:function(e,t,i){!0===n&&(n=!1,(r=new J).representationid=e,r.start=new Date,r.mstart=t,r.playbackspeed=null!==i?i.toString():null)},updatePlayListTraceMetrics:function(e){if(r)for(var t in r)r[t]=e[t]},pushPlayListTraceMetrics:function(e,t){if(!1===n&&i&&r&&r.start){var a=r.start,s=e.getTime()-a.getTime();r.duration=s,r.stopreason=t,i.trace.push(r),n=!0}},clearAllCurrentMetrics:function(){u.clearAllCurrentMetrics()}},u=u||zi(s).getInstance({settings:e.settings}),n=!0,r=null,i=null,t}Zi.__dashjs_factory_name="DashMetrics";var Ki=c.Z.getSingletonFactory(Zi);function Wi(){var e,t,n,r,i=this.context,o=(0,u.Z)(i).getInstance(),c=(0,C.Z)(i).getInstance();function d(e){r=e}function h(e,t,n,r){var i,a=t.adaptation.period.mpd,s=a.availabilityStartTime;if(r)i=n&&a.timeShiftBufferDepth!==Number.POSITIVE_INFINITY?new Date(s.getTime()+1e3*(e+a.timeShiftBufferDepth)):a.availabilityEndTime;else if(n){var o=t.availabilityTimeOffset;i=new Date(s.getTime()+1e3*(e-o))}else i=s;return i}function p(e,t){return(e.getTime()-t.mpd.availabilityStartTime.getTime()+1e3*r)/1e3}function g(e,t){return e+(t.adaptation.period.start-t.presentationTimeOffset)}function m(e){var n={start:NaN,end:NaN},r=e[0].getAdapter().getRegularPeriods()[0],i=p(new Date,r);if(!e||0===e.length)return{range:n,now:i};e.forEach((function(e){var r=e.getAdapter(),o=r.getMediaInfoForType(e.getStreamInfo(),a.Z.VIDEO)||r.getMediaInfoForType(e.getStreamInfo(),a.Z.AUDIO),u=r.getVoRepresentations(o)[0],l={start:NaN,end:NaN};if(u)if(u.segmentInfoType===s.Z.SEGMENT_TIMELINE)l=function(e){var n,r,i,a,s=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],o=t.getRepresentationFor(e.index,s),u=o.SegmentTemplate||o.SegmentList,l=u.SegmentTimeline,c=u.timescale,d=l.S_asArray,f={start:0,end:0},h=d[0].t,p=!isNaN(h),m=p?h:0,y=0;for(p&&(f.start=g(m/c,e)),i=0,a=d.length;i<a;i++)r=0,(n=d[i]).hasOwnProperty("r")&&(r=n.r),y+=n.d*(1+r);return f.end=g((m+y)/c,e),f}(u);else{var c=u.adaptation.period;l.start=c.start,l.end=Math.max(i,c.start+c.duration)}!isNaN(l.start)&&(isNaN(n.start)||n.start>l.start)&&(n.start=l.start),!isNaN(l.end)&&(isNaN(n.end)||n.end<l.end)&&(n.end=l.end)})),n.end=Math.min(i,n.end);var o=v(e,n.end,!0);return n.end=isNaN(o)?n.end:o,n.start=r&&r.mpd&&r.mpd.timeShiftBufferDepth&&!isNaN(r.mpd.timeShiftBufferDepth)&&!isNaN(n.end)?Math.max(n.end-r.mpd.timeShiftBufferDepth,n.start):n.start,n.start=v(e,n.start),{range:n,now:i}}function y(e,t){n=e-t.end}function v(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{for(var r=0,i=!1,a=NaN;!i&&r<e.length;){var s=e[r].getStreamInfo();s.start<=t&&(!isFinite(s.duration)||s.start+s.duration>=t)?(a=t,i=!0):!n&&s.start>t&&(isNaN(a)||s.start<a)?a=s.start:n&&s.start+s.duration<t&&(isNaN(a)||s.start+s.duration>a)&&(a=s.start+s.duration),r+=1}return a}catch(e){return t}}function _(e){void 0===e.offset||isNaN(e.offset)||d(e.offset/1e3)}function T(){r=0,n=0}function b(){o.off(l.Z.UPDATE_TIME_SYNC_OFFSET,_,this),T()}return e={initialize:function(){T(),o.on(l.Z.UPDATE_TIME_SYNC_OFFSET,_,this)},getClientTimeOffset:function(){return r},setClientTimeOffset:d,getClientReferenceTime:function(){return Date.now()-1e3*n+1e3*r},calcAvailabilityStartTimeFromPresentationTime:function(e,t,n){return h(e,t,n)},calcAvailabilityEndTimeFromPresentationTime:function(e,t,n){return h(e,t,n,!0)},calcPresentationTimeFromWallTime:p,calcPresentationTimeFromMediaTime:g,calcPeriodRelativeTimeFromMpdRelativeTime:function(e,t){return t-e.adaptation.period.start},calcMediaTimeFromPresentationTime:function(e,t){return e-t.adaptation.period.start+t.presentationTimeOffset},calcWallTimeForSegment:function(e,t){var n,r,i;return t&&(n=e.representation.adaptation.period.mpd.suggestedPresentationDelay,r=e.presentationStartTime+n,i=new Date(e.availabilityStartTime.getTime()+1e3*r)),i},calcTimeShiftBufferWindow:function(e,t){if(!t)return function(e){var t={start:NaN,end:NaN},n=0,r=NaN;return e.forEach((function(e){var t=e.getStreamInfo();n+=t.duration,(isNaN(r)||t.start<r)&&(r=t.start)})),t.start=r,t.end=r+n,t}(e);if(c.get().streaming.timeShiftBuffer.calcFromSegmentTimeline){var n=m(e);return y(n.now,n.range),n.range}return function(e){var t={start:NaN,end:NaN};if(!e||0===e.length)return t;var n=e[0].getAdapter().getRegularPeriods()[0],r=p(new Date,n),i=n.mpd.timeShiftBufferDepth,a=isNaN(i)?0:r-i;if(t.start=v(e,a),t.end=!isNaN(t.start)&&r<t.start?r:v(e,r,!0),!isNaN(i)&&t.end<r-i&&(t.end=NaN),c.get().streaming.timeShiftBuffer.fallbackToSegmentTimeline){var s=m(e);if(s.range.end<t.start)return o.trigger(f.Z.CONFORMANCE_VIOLATION,{level:Xt.LEVELS.WARNING,event:Xt.EVENTS.INVALID_DVR_WINDOW}),y(s.now,s.range),s.range}return t}(e)},reset:b},t=Le(i).getInstance(),b(),e}Wi.__dashjs_factory_name="TimelineConverter";var Xi=c.Z.getSingletonFactory(Wi),$i=n(4593),Qi=n(6934);function Ji(e){return Ji="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ji(e)}function ea(e,t){return ea=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ea(e,t)}function ta(e){return ta=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ta(e)}var na=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ea(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=ta(t);if(n){var i=ta(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==Ji(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(e=r.call(this)).captionData=null,e.label=null,e.defaultTrack=!1,e.kind=null,e.isFragmented=!1,e.isEmbedded=!1,e.isTTML=null,e}return i}(Si),ra=n(2295);function ia(){var e=0;function t(e){for(var t="",n=0;n<e.length;++n)t+=e[n].uchar;return t.length-t.replace(/^\s+/,"").length}function n(e){return"left: "+3.125*e.x+"%; top: "+6.66*e.y1+"%; width: "+(100-3.125*e.x)+"%; height: "+6.66*Math.max(e.y2-1-e.y1,1)+"%; align-items: flex-start; overflow: visible; -webkit-writing-mode: horizontal-tb;"}function r(e){return"red"===e?"rgb(255, 0, 0)":"green"===e?"rgb(0, 255, 0)":"blue"===e?"rgb(0, 0, 255)":"cyan"===e?"rgb(0, 255, 255)":"magenta"===e?"rgb(255, 0, 255)":"yellow"===e?"rgb(255, 255, 0)":"white"===e?"rgb(255, 255, 255)":"black"===e?"rgb(0, 0, 0)":e}function i(e,t){var n=e.videoHeight/15;return t?"font-size: "+n+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; color: "+(t.foreground?r(t.foreground):"rgb(255, 255, 255)")+"; font-style: "+(t.italics?"italic":"normal")+"; text-decoration: "+(t.underline?"underline":"none")+"; white-space: pre; background-color: "+(t.background?r(t.background):"transparent")+";":"font-size: "+n+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; justify-content: flex-start; text-align: left; color: rgb(255, 255, 255); font-style: normal; white-space: pre; line-height: normal; font-weight: normal; text-decoration: none; width: 100%; display: flex;"}function a(e){return e.replace(/^\s+/g,"")}function s(e){return e.replace(/\s+$/g,"")}return{createHTMLCaptionsFromScreen:function(r,o,u,l){var c,d,f=null,h=!1,p=-1,g={start:o,end:u,spans:[]},m="style_cea608_white_black",y={},v={},_=[];for(c=0;c<15;++c){var T=l.rows[c],b="",E=null;if(!1===T.isEmpty()){var S=t(T.chars);null===f&&(f={x:S,y1:c,y2:c+1,p:[]}),S!==p&&h&&(f.p.push(g),g={start:o,end:u,spans:[]},f.y2=c,f.name="region_"+f.x+"_"+f.y1+"_"+f.y2,!1===y.hasOwnProperty(f.name)?(_.push(f),y[f.name]=f):y[f.name].p.contat(f.p),f={x:S,y1:c,y2:c+1,p:[]});for(var w=0;w<T.chars.length;++w){var A=T.chars[w],I=A.penState;if(null===E||!I.equals(E)){b.trim().length>0&&(g.spans.push({name:m,line:b,row:c}),b="");var C="style_cea608_"+I.foreground+"_"+I.background;I.underline&&(C+="_underline"),I.italics&&(C+="_italics"),v.hasOwnProperty(C)||(v[C]=JSON.parse(JSON.stringify(I))),E=I,m=C}b+=A.uchar}b.trim().length>0&&g.spans.push({name:m,line:b,row:c}),h=!0,p=S}else h=!1,p=-1,f&&(f.p.push(g),g={start:o,end:u,spans:[]},f.y2=c,f.name="region_"+f.x+"_"+f.y1+"_"+f.y2,!1===y.hasOwnProperty(f.name)?(_.push(f),y[f.name]=f):y[f.name].p.contat(f.p),f=null)}f&&(f.p.push(g),f.y2=c+1,f.name="region_"+f.x+"_"+f.y1+"_"+f.y2,!1===y.hasOwnProperty(f.name)?(_.push(f),y[f.name]=f):y[f.name].p.contat(f.p),f=null);var R=[];for(c=0;c<_.length;++c){var D=_[c],x="sub_cea608_"+e++,N=document.createElement("div");N.id=x;var O=n(D);N.style.cssText="position: absolute; margin: 0; display: flex; box-sizing: border-box; pointer-events: none;"+O;var P=document.createElement("div");P.className="paragraph bodyStyle",P.style.cssText=i(r);var M=document.createElement("div");M.className="cueUniWrapper",M.style.cssText="unicode-bidi: normal; direction: ltr;";for(var k=0;k<D.p.length;++k){var L=D.p[k],F=0;for(d=0;d<L.spans.length;++d){var U=L.spans[d];if(U.line.length>0){if(0!==d&&F!=U.row){var B=document.createElement("br");B.className="lineBreak",M.appendChild(B)}var j=!1;F===U.row&&(j=!0),F=U.row;var q=v[U.name],H=document.createElement("span");H.className="spanPadding "+U.name+" customSpanColor",H.style.cssText=i(r,q),0!==d&&j?d===L.spans.length-1?H.textContent=s(U.line):H.textContent=U.line:L.spans.length>1&&d<L.spans.length-1&&U.row===L.spans[d+1].row?H.textContent=a(U.line):H.textContent=U.line.trim(),M.appendChild(H)}}}P.appendChild(M),N.appendChild(P);var G={bodyStyle:["%",90]};for(var V in v)v.hasOwnProperty(V)&&(G[V]=["%",90]);R.push({type:"html",start:o,end:u,cueHTMLElement:N,cueID:x,cellResolution:[32,15],isFromCEA608:!0,fontSize:G,lineHeight:{},linePadding:{}})}return R}}}ia.__dashjs_factory_name="EmbeddedTextHtmlRender";var aa=c.Z.getSingletonFactory(ia);function sa(e){var t,n,r,s,o,c,f,h,p,g,m,y,v,_,T,b,S,w=e.errHandler,A=e.manifestModel,C=e.mediaController,D=e.videoModel,x=e.textTracks,N=e.vttParser,O=e.vttCustomRenderingParser,P=e.ttmlParser,M=e.streamInfo,k=e.settings,L=this.context,F=(0,u.Z)(L).getInstance(),U=!1;function B(){c=null,h=NaN,p=[],g=null,f=!1,o=[],s=null}function j(e){var t=new na;for(var n in e)t[n]=e[n];t.labels=e.labels,t.defaultTrack=function(e){var t=!1;return y.length>1&&e.isEmbedded?t=e.id&&e.id===a.Z.CC1:1===y.length?e.id&&"string"==typeof e.id&&"CC"===e.id.substring(0,2)&&(t=!0):0===y.length&&(t=e.index===o[0].index),t}(e),t.isFragmented=e.isFragmented,t.isEmbedded=!!e.isEmbedded,t.isTTML=function(e){return e.codec&&e.codec.search(a.Z.STPP)>=0||e.mimeType&&e.mimeType.search(a.Z.TTML)>=0}(e),t.kind=function(e,t){var n=e.roles&&e.roles.length>0?t[e.roles[0]]:t.caption;return n===t.caption||n===t.subtitle?n:t.caption}(e,{subtitle:"subtitles",caption:"captions"}),x.addTextTrack(t)}function q(e){var t=e.chunk;t.mediaInfo.embeddedCaptions&&G(t.bytes,t)}function H(e){m=e}function G(e,o){var u=o.mediaInfo,l=u.type,d=u.mimeType,p=u.codec||d;p?-1!==u.codec.indexOf("application/mp4")?function(e,i,o){var u;if("InitializationSegment"===i.segmentType)f=!0,h=r.getMediaTimescaleFromMoov(e);else{if(!f)return;(u=r.getSamplesInfo(e).sampleList).length>0&&(g=u[0].cts-i.start*h),o.search(a.Z.STPP)>=0?function(e,r,i){var o,u;for(s=null!==s?s:z(i),o=0;o<r.length;o++){var l=r[o],d=l.cts,f=Y(),p=f+d/h,g=p+l.duration/h;t.buffered.add(p,g);var y=new DataView(e,l.offset,l.subSizes[0]),v=Qi.Utils.dataViewToString(y,a.Z.UTF8),_=[],T=l.offset+l.subSizes[0];for(u=1;u<l.subSizes.length;u++){var b=new Uint8Array(e,T,l.subSizes[u]),E=String.fromCharCode.apply(null,b);_.push(E),T+=l.subSizes[u]}try{var S=A.getValue().ttmlTimeIsRelative?d/h:0,w=s.parse(v,S,d/h,(d+l.duration)/h,_);x.addCaptions(m,f,w)}catch(e){c.removeExecutedRequestsBeforeTime(),this.remove(),n.error("TTML parser error: "+e.message)}}}(e,u,o):function(e,r){var i,a,s,o=[];for(i=0;i<r.length;i++){var u=r[i];u.cts-=g;var l=Y()+u.cts/h,c=l+u.duration/h;t.buffered.add(l,c);var d=e.slice(u.offset,u.offset+u.size),f=Qi.parseBuffer(d);for(a=0;a<f.boxes.length;a++){var p=f.boxes[a];if(n.debug("VTT box1: "+p.type),"vtte"!==p.type&&"vttc"===p.type){n.debug("VTT vttc boxes.length = "+p.boxes.length);var y={styles:{}};for(s=0;s<p.boxes.length;s++){var v=p.boxes[s];if(n.debug("VTT box2: "+v.type),"payl"===v.type)y.start=u.cts/h,y.end=(u.cts+u.duration)/h,y.data=v.cue_text;else if("sttg"===v.type&&v.settings&&""!==v.settings)try{var _=v.settings.split(" ");y.styles=N.getCaptionStyles(_)}catch(e){}}y&&y.data&&(o.push(y),n.debug("VTT ".concat(y.start," - ").concat(y.end," : ").concat(y.data)))}}}o.length>0&&x.addCaptions(m,0,o)}(e,u)}}(e,o,p):l===a.Z.VIDEO?function(e,t){var a,s;if(t.segmentType===R.w.INIT_SEGMENT_TYPE)0===v&&(v=r.getMediaTimescaleFromMoov(e));else if(t.segmentType===R.w.MEDIA_SEGMENT_TYPE){if(0===v)return void n.warn("CEA-608: No timescale for embeddedTextTrack yet");var o=(s=r.getSamplesInfo(e)).lastSequenceNumber,u=Math.trunc(t.start),l=Math.trunc(t.end);if(b[0]||b[1]||function(){for(var e,t=0;t<y.length;t++){if(-1===(e=x.getTrackIdxForId(y[t].id)))return void n.warn("CEA-608: data before track is ready.");var r=V(e);b[t]=new(i().Cea608Parser)(t+1,{newCue:r},null)}}(),v){if(function(e,t,n,r,i){return null!==e&&null!==t&&null!==r&&null!==i&&(t===e?r!==i:t!==e+n)}(_,o,s.numSequences,T,u))for(a=0;a<b.length;a++)b[a]&&b[a].reset();for(var c=function(e,t){if(0===t.length)return null;for(var n={splits:[],fields:[[],[]]},r=new DataView(e),a=0;a<t.length;a++)for(var s=t[a],o=i().findCea608Nalus(r,s.offset,s.size),u=null,l=0,c=0;c<o.length;c++)for(var d=i().extractCea608DataFromRange(r,o[c]),f=0;f<2;f++)if(d[f].length>0){s.cts!==u?l=0:l+=1;var h=Y();n.fields[f].push([s.cts+h*v,d[f],l]),u=s.cts}return n.fields.forEach((function(e){e.sort((function(e,t){return e[0]===t[0]?e[2]-t[2]:e[0]-t[0]}))})),n}(e,s.sampleList),d=0;d<b.length;d++){var f=c.fields[d],h=b[d];if(h)for(a=0;a<f.length;a++)h.addData(f[a][0]/v,f[a][1])}_=o,T=l}}}(e,o):function(e,n,r){var i,s,o=new DataView(e,0,e.byteLength);s=Qi.Utils.dataViewToString(o,a.Z.UTF8);try{i=z(r).parse(s,0),x.addCaptions(x.getCurrentTrackIdx(),0,i),t.buffered&&t.buffered.add(n.start,n.end)}catch(e){w.error(new E.Z(I.TIMED_TEXT_ERROR_ID_PARSE_CODE,I.TIMED_TEXT_ERROR_MESSAGE_PARSE+e.message,s))}}(e,o,p):n.error("No text type defined")}function V(e){return function(t,n,r){var i;(i=D.getTTMLRenderingDiv()?S.createHTMLCaptionsFromScreen(D.getElement(),t,n,r):[{start:t,end:n,data:r.getDisplayText(),styles:{}}])&&x.addCaptions(e,0,i)}}function Y(){return isNaN(t.timestampOffset)?0:t.timestampOffset}function z(e){var t;return e.search(a.Z.VTT)>=0?t=k.get().streaming.text.webvtt.customRenderingEnabled&&O?O:N:(e.search(a.Z.TTML)>=0||e.search(a.Z.STPP)>=0)&&(t=P),t}function Z(e){y.forEach((function(t){var n=x.getTrackIdxForId(t.id);n>=0&&x.deleteCuesFromTrackIdx(n,e.from,e.to)}))}return t={initialize:function(){U||(y=[],m=null,v=0,b=[],_=null,T=null,U=!0,S=aa(L).getInstance(),F.on(l.Z.VIDEO_CHUNK_RECEIVED,q,t),F.on(l.Z.BUFFER_CLEARED,Z,t))},addMediaInfos:function(e,n,r){if(o=o.concat(n),e===a.Z.TEXT&&n[0].isFragmented&&!n[0].isEmbedded){c=r,t.buffered=(0,ra.Z)(L).create(),p=C.getTracksFor(a.Z.TEXT,M.id).filter((function(e){return e.isFragmented}));for(var i=C.getCurrentTrackFor(a.Z.TEXT,M.id),s=0;s<p.length;s++)if(p[s]===i){H(s);break}}for(var u=0;u<n.length;u++)j(n[u])},resetMediaInfos:function(){o=[]},getStreamId:function(){return M.id},append:G,abort:function(){},addEmbeddedTrack:function(e){if(U&&e)if(e.id===a.Z.CC1||e.id===a.Z.CC3){for(var t=0;t<y.length;t++)if(y[t].id===e.id)return;y.push(e)}else n.warn("Embedded track "+e.id+" not supported!")},resetEmbedded:function(){F.off(l.Z.VIDEO_CHUNK_RECEIVED,q,t),F.off(l.Z.BUFFER_CLEARED,Z,t),x&&x.deleteAllTextTracks(),U=!1,y=[],b=[null,null],_=null,T=null},getConfig:function(){return{fragmentModel:c,fragmentedTracks:p,videoModel:D}},setCurrentFragmentedTrackIdx:H,remove:function(e,n){void 0===e&&e===n&&(e=t.buffered.start(0),n=t.buffered.end(t.buffered.length-1)),t.buffered.remove(e,n),x.deleteCuesFromTrackIdx(m,e,n)},reset:function(){B(),o=[],r=null}},n=(0,d.Z)(L).getInstance().getLogger(t),r=(0,Dt.Z)(L).getInstance(),B(),t}sa.__dashjs_factory_name="TextSourceBuffer";var oa=c.Z.getClassFactory(sa),ua=n(4403);function la(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ca=["text","align","fontSize","id","isd","line","lineAlign","lineHeight","linePadding","position","positionAlign","region","size","snapToLines","vertical"];function da(e){var t,n,r,i,s,o,c,h,p,g,m,y,v,_,T,b,E,S,w=this.context,A=(0,u.Z)(w).getInstance(),I=e.videoModel,C=e.streamInfo,R=e.settings;function D(e,t,n,r,i,a){var s=0,o=0;e/t>n/r?s=(o=t)/r*n:o=(s=e)/n*r;var u,l,c=0,d=0;return s/o>i?(d=o,c=o*i):(c=s,d=s/i),u=(e-c)/2,l=(t-d)/2,a?{x:u+.1*c,y:l+.1*d,w:.8*c,h:.8*d}:{x:u,y:l,w:c,h:d}}function x(e,t){var n=I.getClientWidth(),r=I.getClientHeight(),i=I.getVideoWidth(),a=I.getVideoHeight(),s=I.getVideoRelativeOffsetTop(),o=I.getVideoRelativeOffsetLeft();if(0!==i&&0!==a){var u=i/a,l=!1;e.isFromCEA608&&(u=3.5/3,l=!0);var d=D.call(this,n,r,i,a,u,l),y=d.w,v=d.h,b=d.x,S=d.y;if(y!=p||v!=g||b!=c||S!=h||t){if(c=b+o,h=S+s,p=y,g=v,m){var w=m.style;w&&(w.left=c+"px",w.top=h+"px",w.width=p+"px",w.height=g+"px",w.zIndex=_&&document[_]||T?E:null,A.trigger(f.Z.CAPTION_CONTAINER_RESIZE))}var C=e.activeCues;if(C)for(var R=C.length,x=0;x<R;++x){var N=C[x];N.scaleCue(N)}}}}function N(e){var t,n,r,i,a,s=p,o=g;if(e.cellResolution){var u=[s/e.cellResolution[0],o/e.cellResolution[1]];if(e.linePadding)for(t in e.linePadding)if(e.linePadding.hasOwnProperty(t)){n=(e.linePadding[t]*u[0]).toString();for(var l=document.getElementsByClassName("spanPadding"),c=0;c<l.length;c++)l[c].style.cssText=l[c].style.cssText.replace(/(padding-left\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+n),l[c].style.cssText=l[c].style.cssText.replace(/(padding-right\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+n)}if(e.fontSize){for(t in e.fontSize)if(e.fontSize.hasOwnProperty(t)){"%"===e.fontSize[t][0]?r=e.fontSize[t][1]/100:"c"===e.fontSize[t][0]&&(r=e.fontSize[t][1]),n=(r*u[1]).toString(),a="defaultFontSize"!==t?document.getElementsByClassName(t):document.getElementsByClassName("paragraph");for(var d=0;d<a.length;d++)a[d].style.cssText=a[d].style.cssText.replace(/(font-size\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+n)}if(e.lineHeight)for(t in e.lineHeight)if(e.lineHeight.hasOwnProperty(t)){"%"===e.lineHeight[t][0]?i=e.lineHeight[t][1]/100:"c"===e.fontSize[t][0]&&(i=e.lineHeight[t][1]),n=(i*u[1]).toString(),a=document.getElementsByClassName(t);for(var f=0;f<a.length;f++)a[f].style.cssText=a[f].style.cssText.replace(/(line-height\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+n)}}}if(e.isd){var h=document.getElementById(e.cueID);h&&m.removeChild(h),P(e)}}function O(e,t){var n=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/,r=/^#(.*)$/;if(n.test(t)){var i=n.exec(t),a=parseInt(i[4],10)-1;return"data:image/png;base64,"+btoa(e.images[a])}if(r.test(t)){var s=r.exec(t)[1];return"data:image/png;base64,"+e.embeddedImages[s]}return t}function P(e){if(m){var t=document.createElement("div");m.appendChild(t),b=(0,ua.renderHTML)(e.isd,t,(function(t){return O(e,t)}),m.clientHeight,m.clientWidth,!1,(function(e){n.info("renderCaption :",e)}),b,!0),t.id=e.cueID,A.trigger(f.Z.CAPTION_RENDERED,{captionDiv:t,currentTrackIdx:o})}}function M(e,t){if(!R.get().streaming.text.extendSegmentedCues)return!1;if(!t.cues||0===t.cues.length)return!1;var n=t.cues[t.cues.length-1];return!(n.endTime<e.startTime||!function(e,t,n){for(var r=0;r<n.length;r++){var i=n[r];if(JSON.stringify(e[i])!==JSON.stringify(t[i]))return!1}return!0}(n,e,ca)||(n.endTime=Math.max(n.endTime,e.endTime),0))}function k(e,t){t&&t.forEach((function(t){t.kind&&"image"===t.kind&&(t.src=O(e,t.src)),k(e,t.contents)}))}function L(e,t,r){var i=q(e);if(i&&Array.isArray(r)&&0!==r.length)for(var a=0;a<r.length;a++){var s=void 0,o=r[a];i.cellResolution=o.cellResolution,i.isFromCEA608=o.isFromCEA608,isNaN(o.start)||isNaN(o.end)||(s="html"===o.type&&m?F(o,t,i):o.data?U(o,t,i):null);try{if(s){V(i,s)||(R.get().streaming.text.webvtt.customRenderingEnabled?(i.manualCueList||(i.manualCueList=[]),i.manualCueList.push(s)):M(s,i)||i.addCue(s));var u=R.get().streaming.buffer.bufferToKeep;z(i,0,I.getTime()-u)}else n.error("Impossible to display subtitles. You might have missed setting a TTML rendering div via player.attachTTMLRenderingDiv(TTMLRenderingDiv)")}catch(e){throw Z(i),i.addCue(s),e}}}function F(e,t,i){var s=this,u=new r(e.start+t,e.end+t,"");return u.cueHTMLElement=e.cueHTMLElement,u.isd=e.isd,u.images=e.images,u.embeddedImages=e.embeddedImages,u.cueID=e.cueID,u.scaleCue=N.bind(s),u.cellResolution=e.cellResolution,u.lineHeight=e.lineHeight,u.linePadding=e.linePadding,u.fontSize=e.fontSize,m.style.left=c+"px",m.style.top=h+"px",m.style.width=p+"px",m.style.height=g+"px",u.isd&&k(u,u.isd.contents),u.onenter=function(){i.mode===a.Z.TEXT_SHOWING&&(this.isd?(P(this),n.debug("Cue enter id:"+this.cueID)):(m.appendChild(this.cueHTMLElement),N.call(s,this),A.trigger(f.Z.CAPTION_RENDERED,{captionDiv:this.cueHTMLElement,currentTrackIdx:o})))},u.onexit=function(){if(m)for(var e=m.childNodes,t=0;t<e.length;++t)e[t].id===this.cueID&&(n.debug("Cue exit id:"+e[t].id),m.removeChild(e[t]),--t)},u}function U(e,t,i){var s=new r(e.start-t,e.end-t,e.data);if(s.cueID="".concat(s.startTime,"_").concat(s.endTime),s.isActive=!1,e.styles)try{void 0!==e.styles.align&&"align"in s&&(s.align=e.styles.align),void 0!==e.styles.line&&"line"in s&&(s.line=e.styles.line),void 0!==e.styles.snapToLines&&"snapToLines"in s&&(s.snapToLines=e.styles.snapToLines),void 0!==e.styles.position&&"position"in s&&(s.position=e.styles.position),void 0!==e.styles.size&&"size"in s&&(s.size=e.styles.size)}catch(e){n.error(e)}return s.onenter=function(){i.mode===a.Z.TEXT_SHOWING&&A.trigger(f.Z.CAPTION_RENDERED,{currentTrackIdx:o})},s}function B(e){if(y)for(var t=y.childNodes,n=0;n<t.length;++n)t[n].id===e.cueID&&(y.removeChild(t[n]),--n)}function j(){var e,t=[],n=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return la(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?la(e,t):void 0}}(e))){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}(I.getTextTracks());try{for(n.s();!(e=n.n()).done;){var r=e.value;r.manualMode===a.Z.TEXT_SHOWING&&t.push(r)}}catch(e){n.e(e)}finally{n.f()}return t}function q(e){return e>=0&&i[e]?I.getTextTrack(i[e].kind,i[e].id,i[e].lang,i[e].isTTML,i[e].isEmbedded):null}function H(e){var t=this;if(e!==o){var n=q(o=e);G.call(this,n),v&&(clearInterval(v),v=null),n&&"html"===n.renderingType&&(x.call(this,n,!0),window.ResizeObserver?(S=new window.ResizeObserver((function(){x.call(t,n,!0)}))).observe(I.getElement()):v=setInterval(x.bind(this,n),500))}}function G(e){X.call(this),e&&"html"===e.renderingType?K.call(this):W.call(this)}function V(e,t){if(!e.cues)return!1;for(var n=0;n<e.cues.length;n++)if(e.cues[n].startTime===t.startTime&&e.cues[n].endTime===t.endTime)return!0;return!1}function Y(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return!!e&&(isNaN(t)||(r?e.startTime:e.endTime)>=t)&&(isNaN(n)||(r?e.endTime:e.startTime)<=n)}function z(e,t,n){var r,i;if(!(n<t)&&e&&(e.cues||e.manualCueList)){var a=e.cues&&e.cues.length>0?"native":"custom",s="native"===a?e.cues:e.manualCueList;if(!s||0===s.length)return;for(var o=s.length-1;o>=0;o--)!Y(s[o],t,n,!0)||(r=s[o],i=I.getTime(),r.startTime>=i&&r.endTime<=i)||("native"===a?e.removeCue(s[o]):(B(s[o]),delete e.manualCueList[o]))}}function Z(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e&&(e.cues||e.manualCueList)){var i=e.cues&&e.cues.length>0?"native":"custom",a="native"===i?e.cues:e.manualCueList;if(!a||0===a.length)return;for(var s=a.length-1;s>=0;s--)Y(a[s],t,n,r)&&("native"===i?(a[s].onexit&&a[s].onexit(),e.removeCue(a[s])):(B(a[s]),delete e.manualCueList[s]))}}function K(){var e=document.getElementById("native-cue-style");if(!e){(e=document.createElement("style")).id="native-cue-style",document.head.appendChild(e);var t=e.sheet,r=I.getElement();try{r&&(r.id?t.insertRule("#"+r.id+"::cue {background: transparent}",0):0!==r.classList.length?t.insertRule("."+r.className+"::cue {background: transparent}",0):t.insertRule("video::cue {background: transparent}",0))}catch(e){n.info(""+e.message)}}}function W(){var e=document.getElementById("native-cue-style");e&&document.head.removeChild(e)}function X(){if(m)for(;m.firstChild;)m.removeChild(m.firstChild)}return t={initialize:function(){"undefined"!=typeof window&&"undefined"!=typeof navigator&&(r=window.VTTCue||window.TextTrackCue,i=[],s=[],o=-1,c=0,h=0,p=0,g=0,m=null,y=null,v=null,T=!1,E=2147483647,b=null,void 0!==document.fullscreenElement?_="fullscreenElement":void 0!==document.webkitIsFullScreen?_="webkitIsFullScreen":document.msFullscreenElement?_="msFullscreenElement":document.mozFullScreen&&(_="mozFullScreen"))},getStreamId:function(){return C.id},addTextTrack:function(e){i.push(e)},addCaptions:L,createTracks:function(){i.sort((function(e,t){return e.index-t.index})),m=I.getTTMLRenderingDiv(),y=I.getVttRenderingDiv();for(var e,t,n,r,u,c,d=-1,h=0;h<i.length;h++){var p=(t=(e=i[h]).kind,n=void 0!==e.id?e.id:e.lang,r=e.lang,u=e.isTTML,c=e.isEmbedded,I.addTextTrack(t,n,r,u,c));s.push(p),i[h].defaultTrack&&(p.default=!0,d=h);var g=q(h);g&&(g.mode=a.Z.TEXT_SHOWING,m&&(i[h].isTTML||i[h].isEmbedded)?g.renderingType="html":g.renderingType="default"),L(h,0,i[h].captionData),A.trigger(f.Z.TEXT_TRACK_ADDED)}if(H.call(this,d),d>=0){A.on(f.Z.PLAYBACK_METADATA_LOADED,(function e(){var t=q(d);t&&"html"===t.renderingType&&x.call(this,t,!0),A.off(f.Z.PLAYBACK_METADATA_LOADED,e,this)}),this);for(var v=0;v<i.length;v++){var _=q(v);_&&(_.mode=v===d?a.Z.TEXT_SHOWING:a.Z.TEXT_HIDDEN,_.manualMode=v===d?a.Z.TEXT_SHOWING:a.Z.TEXT_HIDDEN)}}A.trigger(l.Z.TEXT_TRACKS_QUEUE_INITIALIZED,{index:o,tracks:i,streamId:C.id})},getCurrentTrackIdx:function(){return o},setCurrentTrackIdx:H,getTrackIdxForId:function(e){for(var t=-1,n=0;n<i.length;n++)if(i[n].id===e){t=n;break}return t},getCurrentTrackInfo:function(){return i[o]},setModeForTrackIdx:function(e,t){var n=q(e);n&&n.mode!==t&&(n.mode=t),n&&n.manualMode!==t&&(n.manualMode=t)},deleteCuesFromTrackIdx:function(e,t,n){var r=q(e);r&&Z(r,t,n)},deleteAllTextTracks:function(){for(var e=s?s.length:0,t=0;t<e;t++){var n=q(t);n&&Z.call(this,n,C.start,C.start+C.duration,!1)}s=[],i=[],v&&(clearInterval(v),v=null),S&&I&&(S.unobserve(I.getElement()),S=null),o=-1,X.call(this)},deleteTextTrack:function(e){I.removeChild(s[e]),s.splice(e,1)},manualCueProcessing:function(e){var t=j();if(t&&t.length>0){var n=t[0].manualCueList;n&&n.length>0&&n.forEach((function(t){t.startTime<=e&&t.endTime>=e&&!t.isActive?(t.isActive=!0,WebVTT.processCues(window,[t],y,t.cueID)):t.isActive&&(t.startTime>e||t.endTime<e)&&(t.isActive=!1,B(t))}))}},disableManualTracks:function(){var e=j();if(e&&e.length>0){var t=e[0].manualCueList;t&&t.length>0&&t.forEach((function(e){if(e.isActive&&(e.isActive=!1,y))for(var t=y.childNodes,n=0;n<t.length;++n)t[n].id===e.cueID&&(y.removeChild(t[n]),--n)}))}}},n=(0,d.Z)(w).getInstance().getLogger(t),t}da.__dashjs_factory_name="TextTracks";var fa=c.Z.getClassFactory(da);function ha(){var e,t,n,r,i,a,s=this.context;function o(e){var t=e.split(":"),n=t.length-1;return e=60*parseInt(t[n-1],10)+parseFloat(t[n]),2===n&&(e+=3600*parseInt(t[0],10)),e}function u(e){var t=e.split(r),n=t[1].split(a);return n.shift(),t[1]=n[0],n.shift(),{cuePoints:t,styles:l(n)}}function l(e){var t={};return e.forEach((function(e){if(e.split(/:/).length>1){var n=e.split(/:/)[1],r=!1;n&&-1!=n.search(/%/)&&(r=!0,n=parseInt(n.replace(/%/,""),10)),(e.match(/align/)||e.match(/A/))&&(t.align=n),(e.match(/line/)||e.match(/L/))&&(t.line="auto"===n?n:parseInt(n,10),r&&(t.snapToLines=!1)),(e.match(/position/)||e.match(/P/))&&(t.position=n),(e.match(/size/)||e.match(/S/))&&(t.size=n)}})),t}function c(e,t){for(var n,i=t,a="",s="";""!==e[i]&&i<e.length;)i++;if((n=i-t)>1)for(var o=0;o<n;o++){if((s=e[t+o]).match(r)){a="";break}a+=s,o!==n-1&&(a+="\n")}else(s=e[t]).match(r)||(a=s);return a}return e={parse:function(e){var a,s,l=[];if(!e)return l;a=(e=e.split(n)).length,s=-1;for(var d=0;d<a;d++){var f=e[d];if(f.length>0&&"WEBVTT"!==f&&f.match(r)){var h=u(f),p=h.cuePoints,g=h.styles,m=c(e,d+1),y=o(p[0].replace(i,"")),v=o(p[1].replace(i,""));!isNaN(y)&&!isNaN(v)&&y>=s&&v>y?""!==m?(s=y,l.push({start:y,end:v,data:m,styles:g})):t.error("Skipping cue due to empty/malformed cue text"):t.error("Skipping cue due to incorrect cue timing")}}return l},getCaptionStyles:l},t=(0,d.Z)(s).getInstance().getLogger(e),n=/(?:\r\n|\r|\n)/gm,r=/-->/,i=/(^[\s]+|[\s]+$)/g,a=/\s\b/g,e}ha.__dashjs_factory_name="VTTParser";var pa=c.Z.getSingletonFactory(ha);function ga(){var e,t;return e={parse:function(e){var n=[];return t.oncue=function(e){e.start=e.startTime,e.end=e.endTime,e.data=e.text,e.styles={align:e.align,line:e.line,position:e.position,size:e.size},n.push(e)},t.parse(e),n}},function(){try{window&&window.WebVTT&&window.WebVTT.Parser&&(t=new window.WebVTT.Parser(window,window.vttjs,window.WebVTT.StringDecoder()))}catch(e){}}(),e}ga.__dashjs_factory_name="VttCustomRenderingParser";var ma=c.Z.getSingletonFactory(ga);function ya(){var e,t,n=this.context,r=(0,u.Z)(n).getInstance(),i=0;return e={parse:function(e,n,a,s,o){var u,c,d,h="",p=[],g={},m={},y="",v="",_={onOpenTag:function(e,n,i){if(i[" imagetype"]&&!i[" imageType"]&&(r.trigger(f.Z.CONFORMANCE_VIOLATION,{level:Xt.LEVELS.ERROR,event:Xt.EVENTS.NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE}),i[" imageType"]=i[" imagetype"]),"image"===n&&("http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt"===e||"http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"===e)){if(!i[" imageType"]||"PNG"!==i[" imageType"].value)return void t.warn("smpte-tt imageType != PNG. Discarded");y=i["http://www.w3.org/XML/1998/namespace id"].value}},onCloseTag:function(){y&&(m[y]=v.trim()),v="",y=""},onText:function(e){y&&(v+=e)}};if(!e)throw h="no ttml data to parse",new Error(h);g.data=e,r.trigger(l.Z.TTML_TO_PARSE,g);var T=(0,ua.fromXML)(g.data,(function(e){h=e}),_);r.trigger(l.Z.TTML_PARSED,{ttmlString:g.data,ttmlDoc:T});var b,E=T.getMediaTimeEvents();for(d=0;d<E.length;d++){var S=(0,ua.generateISD)(T,E[d],(function(e){h=e}));S.contents.some((function(e){return e.contents.length}))&&(u=E[d]+n)<(c=E[d+1]+n)&&p.push({start:u,end:c,type:"html",cueID:(b="cue_TTML_"+i,i++,b),isd:S,images:o,embeddedImages:m})}if(""!==h)throw t.error(h),new Error(h);return p}},t=(0,d.Z)(n).getInstance().getLogger(e),e}ya.__dashjs_factory_name="TTMLParser";var va=c.Z.getSingletonFactory(ya);function _a(e){var t,n,r,i,s,o,c,d,h,p,g,m,y=this.context,v=e.adapter,_=e.errHandler,T=e.manifestModel,b=e.mediaController,E=e.videoModel,S=e.settings;function w(e){var t=e.tracks,r=e.index,i=e.streamId;if(!1===S.get().streaming.text.defaultEnabled&&!C()||m)R(i,-1);else{var s=b.getCurrentTrackFor(a.Z.TEXT,i);if(s){var o={lang:s.lang,role:s.roles[0],index:s.index,codec:s.codec,accessibility:s.accessibility[0]};t.some((function(e,t){if(b.matchSettings(o,e))return R(i,t),r=t,!0}))}h=!1}n[i].lastEnabledIndex=r,d.trigger(f.Z.TEXT_TRACKS_ADDED,{enabled:C(),index:r,tracks:t,streamId:i}),g=!0}function A(e){try{var t=e.streamId;if(!i[t]||isNaN(e.time))return;i[t].manualCueProcessing(e.time)}catch(e){}}function I(e){try{var t=e.streamId;if(!i[t])return;i[t].disableManualTracks()}catch(e){}}function C(){var e=!0;return h&&!p&&(e=!1),e}function R(e,t){(h=-1===t)&&b&&b.saveTextSettingsDisabled();var n=D(e);if(n!==t&&i[e]){i[e].disableManualTracks(),i[e].setModeForTrackIdx(n,a.Z.TEXT_HIDDEN),i[e].setCurrentTrackIdx(t),i[e].setModeForTrackIdx(t,a.Z.TEXT_SHOWING);var s=i[e].getCurrentTrackInfo();s&&s.isFragmented&&!s.isEmbedded?function(e,t,n){if(r[e])for(var s=r[e].getConfig().fragmentedTracks,o=0;o<s.length;o++){var u=s[o];if(t.lang===u.lang&&(u.id?t.id===u.id:t.index===u.index)){var c=b.getCurrentTrackFor(a.Z.TEXT,e);(u.id?c.id!==u.id:c.index!==u.index)?(i[e].deleteCuesFromTrackIdx(n),r[e].setCurrentFragmentedTrackIdx(o)):-1===n&&d.trigger(l.Z.SET_FRAGMENTED_TEXT_AFTER_DISABLED,{},{streamId:e,mediaType:a.Z.TEXT})}}}(e,s,n):s&&!s.isFragmented&&function(e,t){d.trigger(l.Z.SET_NON_FRAGMENTED_TEXT,{currentTrackInfo:t},{streamId:e,mediaType:a.Z.TEXT})}(e,s),b.setTrack(s)}}function D(e){return i[e].getCurrentTrackIdx()}function x(){r={},i={},n={},h=!0,g=!1,m=!1}return t={deactivateStream:function(e){if(e){var t=e.id;r[t]&&r[t].resetMediaInfos(),i[t]&&i[t].deleteAllTextTracks()}},initialize:function(){d.on(l.Z.TEXT_TRACKS_QUEUE_INITIALIZED,w,t),S.get().streaming.text.webvtt.customRenderingEnabled&&(d.on(l.Z.PLAYBACK_TIME_UPDATED,A,t),d.on(l.Z.PLAYBACK_SEEKING,I,t))},initializeForStream:function(e){var t=e.id,a=fa(y).create({videoModel:E,settings:S,streamInfo:e});a.initialize(),i[t]=a;var u=oa(y).create({errHandler:_,adapter:v,manifestModel:T,mediaController:b,videoModel:E,textTracks:a,vttParser:s,vttCustomRenderingParser:o,ttmlParser:c,streamInfo:e,settings:S});u.initialize(),r[t]=u,n[t]={},n[t].lastEnabledIndex=-1},createTracks:function(e){var t=e.id;i[t]&&i[t].createTracks()},getTextSourceBuffer:function(e){var t=e.id;if(r&&r[t])return r[t]},getAllTracksAreDisabled:function(){return h},addEmbeddedTrack:function(e,t){var n=e.id;r[n]&&r[n].addEmbeddedTrack(t)},enableText:function(e,t){return(0,Z.PS)(t,"boolean"),C()!==t&&(t&&R(e,n[e].lastEnabledIndex),t||(n[e].lastEnabledIndex=D(e),g?R(e,-1):m=!0)),!0},isTextEnabled:C,setTextTrack:R,getCurrentTrackIdx:D,enableForcedTextStreaming:function(e){return(0,Z.PS)(e,"boolean"),p=e,!0},addMediaInfosToBuffer:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=e.id;r[a]&&r[a].addMediaInfos(t,n,i)},reset:function(){x(),d.off(l.Z.TEXT_TRACKS_QUEUE_INITIALIZED,w,t),S.get().streaming.text.webvtt.customRenderingEnabled&&(d.off(l.Z.PLAYBACK_TIME_UPDATED,A,t),d.off(l.Z.PLAYBACK_SEEKING,I,t)),Object.keys(r).forEach((function(e){r[e].resetEmbedded(),r[e].reset()}))}},p=!1,g=!1,m=!1,s=pa(y).getInstance(),o=ma(y).getInstance(),c=va(y).getInstance(),d=(0,u.Z)(y).getInstance(),x(),t}_a.__dashjs_factory_name="TextController";var Ta=c.Z.getClassFactory(_a);function ba(){var e,t,n,r,h,g,m,y,v,_,T,b,S,w,A,D,x,N,O,P,M,k,L,F,U,B,j,q,H,G,V,Y,z,K,$,Q,J,ee,te,ne="You must first call initialize() and set a source before calling this method",re="You must first call initialize() and set a valid source and view before calling this method",ie="You must first call attachView() to set the video element before calling this method",ae="You must first call attachSource() with a valid source before calling this method",se="MediaPlayer not initialized!",oe=this.context,ue=(0,u.Z)(oe).getInstance(),le=(0,C.Z)(oe).getInstance(),ce=(0,d.Z)(oe).getInstance({settings:le});function de(){Ae(null),Se(null),r=null,w&&(w.reset(),w=null),A&&(A.reset(),A=null),P&&P.reset(),le.reset(),x&&(x.reset(),x=null)}function fe(){return!!n&&!!Q.getElement()}function he(){return(0,fi.e)()}function pe(){if(!m)throw re;return q.isPaused()}function ge(){if(!m)throw re;return q.getIsDynamic()}function me(e){var t=U&&U.hasVideoTrack()?a.Z.VIDEO:a.Z.AUDIO,n=Y.getCurrentDVRInfo(t);if(!n)return 0;var r=q.getOriginalLiveDelay(),i=n.range.start+e;return i>n.range.end-r&&(i=n.range.end-r),i}function ye(e){if(!m)throw re;var t=Ee().currentTime;if(void 0!==e)t=U.getTimeRelativeToStreamId(t,e);else if(q.getIsDynamic()){var n=U&&U.hasVideoTrack()?a.Z.VIDEO:a.Z.AUDIO,r=Y.getCurrentDVRInfo(n);t=null===r||0===t?0:Math.max(0,t-r.range.start)}return t}function ve(){if(!m)throw re;var e=Ee().duration;if(q.getIsDynamic()){var t=U&&U.hasVideoTrack()?a.Z.VIDEO:a.Z.AUDIO,n=Y.getCurrentDVRInfo(t);e=n?n.range.end-n.range.start:0}return e}function _e(e){(0,Z.PS)(e,"boolean"),y=e}function Te(){P.restoreDefaultUTCTimingSources()}function be(){return Y}function Ee(){if(!Q.getElement())throw ie;return Q.getElement()}function Se(e){if(!h)throw se;Q.setElement(e),e&&(De(),function(){if(!A){var e=dashjs.MetricsReporting;if("function"==typeof e){var t=e(oe).create();A=t.createMetricsReporting({debug:ce,eventBus:ue,mediaElement:Ee(),adapter:N,dashMetrics:Y,mediaPlayerModel:O,events:l.Z,constants:a.Z,metricsConstants:o.Z})}}}(),function(){if(!D){var e=dashjs.MssHandler;"function"==typeof e&&(I.extend(e.errors),D=e(oe).create({eventBus:ue,mediaPlayerModel:O,dashMetrics:Y,manifestModel:z,playbackController:q,streamController:U,protectionController:w,baseURLController:k,errHandler:M,events:l.Z,constants:a.Z,debug:ce,initSegmentType:R.w.INIT_SEGMENT_TYPE,BASE64:$i,ISOBoxer:Qi,settings:le}))}}(),U&&U.switchToVideoElement(v)),m&&Ce(),Oe(v)}function we(e){if(!g)throw ne;var t=U.getActiveStreamInfo();return t?S.getTracksFor(e,t.id):[]}function Ae(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NaN;if(!h)throw se;"string"==typeof e&&J.initialize(e),null==t&&(t=NaN),isNaN(t)||(t=Math.max(0,t)),v=t,n=e,(g||m)&&Ce(),fe()&&Oe(v)}function Ie(){if(!g)throw ne;var e=U.getActiveStreamInfo();return e?U.getStreamById(e.id):null}function Ce(){m=!1,g=!1,N.reset(),U.reset(),j.reset(),V.reset(),q.reset(),H.reset(),G.reset(),_.reset(),S.reset(),te.reset(),w&&(le.get().streaming.protection.keepProtectionMediaKeys?w.stop():(w.reset(),w=null,De())),B.reset(),K.reset(),$.reset()}function Re(){return Rr(oe).create({debug:ce,errHandler:M,dashMetrics:Y,mediaPlayerModel:O,requestModifier:(0,W.Z)(oe).getInstance(),mssHandler:D,settings:le})}function De(){if(w)return w;var e=dashjs.Protection;if("function"==typeof e){var t=e(oe).create();return l.Z.extend(e.events),f.Z.extend(e.events,{publicOnly:!0}),I.extend(e.errors),L||(L=(0,Nr.Z)(oe).getInstance()),w=t.createProtectionSystem({debug:ce,errHandler:M,videoModel:Q,customParametersModel:P,capabilities:L,eventBus:ue,events:l.Z,BASE64:$i,constants:a.Z,cmcdModel:K,settings:le})}return null}function xe(){if(!h)throw se;if(x)return x;var e=dashjs.OfflineController;if("function"==typeof e){l.Z.extend(e.events),f.Z.extend(e.events,{publicOnly:!0}),I.extend(e.errors);var t=Re(),n=Ht(oe).create();return n.setConfig({manifestModel:z,adapter:N,manifestLoader:t,errHandler:M,contentSteeringController:G}),x=e(oe).create({debug:ce,manifestUpdater:n,baseURLController:k,manifestLoader:t,manifestModel:z,mediaPlayerModel:O,abrController:_,playbackController:q,adapter:N,errHandler:M,dashMetrics:Y,timelineConverter:b,segmentBaseController:te,schemeLoaderFactory:T,eventBus:ue,events:l.Z,errors:I,constants:a.Z,settings:le,dashConstants:s.Z,urlUtils:(0,X.Z)(oe).getInstance()})}return null}function Ne(e){var t=U&&U.hasVideoTrack()?a.Z.VIDEO:a.Z.AUDIO,n=Y.getCurrentDVRInfo(t);return n?e+(n.manifestInfo.availableFrom.getTime()/1e3+n.range.start):0}function Oe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:NaN;x&&x.resetRecords(),!g&&n&&(g=!0,t.info("Streaming Initialized"),function(){var e=Re();U||(U=Jt(oe).getInstance()),B||(B=Ta(oe).create({errHandler:M,manifestModel:z,adapter:N,mediaController:S,videoModel:Q,settings:le})),F.setConfig({capabilities:L,customParametersModel:P,adapter:N,settings:le,manifestModel:z,errHandler:M}),U.setConfig({capabilities:L,capabilitiesFilter:F,manifestLoader:e,manifestModel:z,mediaPlayerModel:O,customParametersModel:P,protectionController:w,textController:B,adapter:N,dashMetrics:Y,errHandler:M,timelineConverter:b,videoModel:Q,playbackController:q,serviceDescriptionController:H,contentSteeringController:G,abrController:_,mediaController:S,settings:le,baseURLController:k,uriFragmentModel:J,segmentBaseController:te}),j.setConfig({settings:le,playbackController:q,streamController:U,videoModel:Q,timelineConverter:b,adapter:N}),q.setConfig({streamController:U,serviceDescriptionController:H,dashMetrics:Y,adapter:N,videoModel:Q,timelineConverter:b,settings:le}),V.setConfig({streamController:U,playbackController:q,mediaPlayerModel:O,videoModel:Q,settings:le}),_.setConfig({streamController:U,domStorage:ee,mediaPlayerModel:O,customParametersModel:P,cmsdModel:$,dashMetrics:Y,adapter:N,videoModel:Q,settings:le}),K.setConfig({abrController:_,dashMetrics:Y,playbackController:q}),$.setConfig({}),_.initialize(),U.initialize(y,r),B.initialize(),j.initialize(),V.initialize(),K.initialize(),$.initialize(),G.initialize(),te.initialize()}(),"string"==typeof n?U.load(n,e):U.loadWithManifest(n,e)),!m&&fe()&&(m=!0,t.info("Playback Initialized"))}return e={initialize:function(e,n,r){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:NaN;L||(L=(0,Nr.Z)(oe).getInstance()).setConfig({settings:le}),M||(M=xr(oe).getInstance()),L.supportsMediaSource()?(h||(h=!0,b=Xi(oe).getInstance(),_||(_=ei(oe).getInstance()).setConfig({settings:le}),T||(T=ft(oe).getInstance()),q||(q=p(oe).getInstance()),S||(S=gn(oe).getInstance()),U||(U=Jt(oe).getInstance()),j||(j=tn(oe).getInstance()),V||(V=rn(oe).getInstance()),H||(H=ln(oe).getInstance()),G||(G=Ut(oe).getInstance()),F||(F=Pr(oe).getInstance()),N=Ni(oe).getInstance(),z=Ur(oe).getInstance(),K=qe(oe).getInstance(),$=it(oe).getInstance(),Y=Ki(oe).getInstance({settings:le}),ee=di(oe).getInstance({settings:le}),N.setConfig({constants:a.Z,cea608parser:i(),errHandler:M,BASE64:$i}),k||(k=Dn(oe).create()),k.setConfig({adapter:N,contentSteeringController:G}),H.setConfig({adapter:N}),te||(te=bi(oe).getInstance({dashMetrics:Y,mediaPlayerModel:O,errHandler:M,baseURLController:k,events:l.Z,eventBus:ue,debug:ce,boxParser:(0,Dt.Z)(oe).getInstance(),requestModifier:(0,W.Z)(oe).getInstance(),errors:I})),S.setConfig({domStorage:ee,settings:le,customParametersModel:P}),O.setConfig({playbackController:q,serviceDescriptionController:H}),G.setConfig({adapter:N,errHandler:M,dashMetrics:Y,mediaPlayerModel:O,manifestModel:z,serviceDescriptionController:H,eventBus:ue,requestModifier:(0,W.Z)(oe).getInstance()}),Te(),_e(void 0===r||r),xe()),e&&Se(e),n&&Ae(n,s),t.info("[dash.js "+he()+"] MediaPlayer has been initialized")):M.error(new E.Z(I.CAPABILITY_MEDIASOURCE_ERROR_CODE,I.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE))},setConfig:function(e){e&&(e.capabilities&&(L=e.capabilities),e.capabilitiesFilter&&(F=e.capabilitiesFilter),e.streamController&&(U=e.streamController),e.textController&&(B=e.textController),e.gapController&&(j=e.gapController),e.playbackController&&(q=e.playbackController),e.serviceDescriptionController&&(H=e.serviceDescriptionController),e.contentSteeringController&&(G=e.contentSteeringController),e.catchupController&&(V=e.catchupController),e.mediaPlayerModel&&(O=e.mediaPlayerModel),e.customParametersModel&&(P=e.customParametersModel),e.abrController&&(_=e.abrController),e.schemeLoaderFactory&&(T=e.schemeLoaderFactory),e.mediaController&&(S=e.mediaController),e.settings&&(le=e.settings))},on:function(e,t,n,r){ue.on(e,t,n,r)},off:function(e,t,n){ue.off(e,t,n)},extend:function(e,t,n){c.Z.extend(e,t,n,oe)},attachView:Se,attachSource:Ae,isReady:fe,preload:function(){if(!Q.getElement()&&!g){if(!n)throw ae;Oe(v)}},play:function(){if(!m)throw re;(!y||pe()&&m)&&q.play(!0)},isPaused:pe,pause:function(){if(!m)throw re;q.pause()},isSeeking:function(){if(!m)throw re;return q.isSeeking()},isDynamic:ge,getLowLatencyModeEnabled:function(){if(!m)throw re;return q.getLowLatencyModeEnabled()},seek:function(e){if(!m)throw re;if((0,Z.PS)(e,"number"),isNaN(e))throw a.Z.BAD_ARGUMENT_ERROR;e<0&&(e=0);var t=q.getIsDynamic()?me(e):e,n=Ee();!q.getIsDynamic()&&n.duration&&(t=Math.min(n.duration,t)),q.seek(t,!1,!1,!0)},seekToOriginalLive:function(){m&&ge()&&q.seekToOriginalLive()},setPlaybackRate:function(e){Ee().playbackRate=e},getPlaybackRate:function(){return Ee().playbackRate},setMute:function(e){(0,Z.PS)(e,"boolean"),Ee().muted=e},isMuted:function(){return Ee().muted},setVolume:function(e){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw a.Z.BAD_ARGUMENT_ERROR;Ee().volume=e},getVolume:function(){return Ee().volume},time:ye,duration:ve,timeAsUTC:function(){if(!m)throw re;return ye()<0?NaN:Ne(ye())},durationAsUTC:function(){if(!m)throw re;return Ne(ve())},getActiveStream:Ie,getDVRWindowSize:function(){var e=U&&U.hasVideoTrack()?a.Z.VIDEO:a.Z.AUDIO,t=Y.getCurrentDVRInfo(e);return t?t.manifestInfo.dvrWindowSize:0},getDVRSeekOffset:me,getAvailableBaseUrls:function(){var e=z.getValue();return e?k.getBaseUrls(e):[]},getAvailableLocations:function(){var e=z.getValue();if(!e)return[];var t=N.getLocation(e),n=G.getSynthesizedLocationElements(t);return t.concat(n)},getTargetLiveDelay:function(){if(!m)throw re;return q.getOriginalLiveDelay()},convertToTimeCode:function(e){e=Math.max(e,0);var t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%3600%60);return(0===t?"":t<10?"0"+t.toString()+":":t.toString()+":")+(n<10?"0"+n.toString():n.toString())+":"+(r<10?"0"+r.toString():r.toString())},formatUTC:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=new Date(1e3*e),a=i.toLocaleDateString(t),s=i.toLocaleTimeString(t,{hour12:n});return r?s+" "+a:s},getVersion:he,getDebug:function(){return ce},getBufferLength:function(e){var n=[a.Z.VIDEO,a.Z.AUDIO,a.Z.TEXT];if(e)return-1!==n.indexOf(e)?be().getCurrentBufferLevel(e)||NaN:(t.warn("getBufferLength requested for invalid type"),NaN);var r=n.map((function(e){return we(e).length>0?be().getCurrentBufferLevel(e):Number.MAX_VALUE})).reduce((function(e,t){return Math.min(e,t)}));return r===Number.MAX_VALUE?NaN:r},getTTMLRenderingDiv:function(){return Q?Q.getTTMLRenderingDiv():null},getVideoElement:Ee,getSource:function(){if(!n)throw ae;return n},updateSource:function(e){n=e,U.load(n)},getCurrentLiveLatency:function(){if(!h)throw se;return m?q.getCurrentLiveLatency():NaN},getTopBitrateInfoFor:function(e){if(!g)throw ne;return _.getTopBitrateInfoFor(e)},setAutoPlay:_e,getAutoPlay:function(){return y},getDashMetrics:be,getQualityFor:function(e){if(!g)throw ne;if(e===a.Z.IMAGE){var t=Ie();if(!t)return-1;var n=t.getThumbnailController();return n?n.getCurrentTrackIndex():-1}return _.getQualityFor(e)},setQualityFor:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!g)throw ne;if(e===a.Z.IMAGE){var r=Ie();if(!r)return;var i=r.getThumbnailController();i&&i.setTrackByIndex(t)}_.setPlaybackQuality(e,U.getActiveStreamInfo(),t,{forceReplace:n})},updatePortalSize:function(){_.setElementSize(),_.setWindowResizeEventCalled(!0)},enableText:function(e){var t=U.getActiveStreamInfo();return!(!t||!B)&&B.enableText(t.id,e)},enableForcedTextStreaming:function(e){return!(!U.getActiveStreamInfo()||!B)&&B.enableForcedTextStreaming(e)},isTextEnabled:function(){var e=U.getActiveStreamInfo();return!(!e||!B)&&B.isTextEnabled(e)},setTextTrack:function(e){if(!m)throw re;var t=U.getActiveStreamInfo();t&&B&&B.setTextTrack(t.id,e)},getBitrateInfoListFor:function(e){if(!g)throw ne;var t=Ie();return t?t.getBitrateListFor(e):[]},getStreamsFromManifest:function(e){if(!g)throw ne;return N.getStreamsInfo(e)},getTracksFor:we,getTracksForTypeFromManifest:function(e,t,n){if(!g)throw ne;return(n=n||N.getStreamsInfo(t,1)[0])?N.getAllMediaInfoForType(n,e,t):[]},getCurrentTrackFor:function(e){if(!g)throw ne;var t=U.getActiveStreamInfo();return S.getCurrentTrackFor(e,t.id)},setInitialMediaSettingsFor:function(e,t){if(!h)throw se;S.setInitialSettings(e,t)},getInitialMediaSettingsFor:function(e){if(!h)throw se;return S.getInitialSettings(e)},setCurrentTrack:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!g)throw ne;S.setTrack(e,t)},addABRCustomRule:function(e,t,n){P.addAbrCustomRule(e,t,n)},removeABRCustomRule:function(e){P.removeAbrCustomRule(e)},removeAllABRCustomRule:function(){P.removeAllAbrCustomRule()},getABRCustomRules:function(){return P.getAbrCustomRules()},getAverageThroughput:function(e){var t=_.getThroughputHistory(),n=q.getIsDynamic();return t?t.getAverageThroughput(e,n):0},retrieveManifest:function(e,t){var n=Re(),r=this;ue.on(l.Z.INTERNAL_MANIFEST_LOADED,(function e(i){i.error?t(null,i.error):t(i.manifest),ue.off(l.Z.INTERNAL_MANIFEST_LOADED,e,r),n.reset()}),r),J.initialize(e),n.load(e)},addUTCTimingSource:function(e,t){P.addUTCTimingSource(e,t)},removeUTCTimingSource:function(e,t){P.removeUTCTimingSource(e,t)},clearDefaultUTCTimingSources:function(){P.clearDefaultUTCTimingSources()},restoreDefaultUTCTimingSources:Te,setXHRWithCredentialsForType:function(e,t){P.setXHRWithCredentialsForType(e,t)},getXHRWithCredentialsForType:function(e){return P.getXHRWithCredentialsForType(e)},getProtectionController:function(){return De()},attachProtectionController:function(e){w=e},setProtectionData:function(e){r=e,U&&U.setProtectionData(r)},registerLicenseRequestFilter:function(e){P.registerLicenseRequestFilter(e)},registerLicenseResponseFilter:function(e){P.registerLicenseResponseFilter(e)},unregisterLicenseRequestFilter:function(e){P.unregisterLicenseRequestFilter(e)},unregisterLicenseResponseFilter:function(e){P.unregisterLicenseResponseFilter(e)},registerCustomCapabilitiesFilter:function(e){P.registerCustomCapabilitiesFilter(e)},unregisterCustomCapabilitiesFilter:function(e){P.unregisterCustomCapabilitiesFilter(e)},setCustomInitialTrackSelectionFunction:function(e){P.setCustomInitialTrackSelectionFunction(e)},resetCustomInitialTrackSelectionFunction:function(){P.resetCustomInitialTrackSelectionFunction(null)},attachTTMLRenderingDiv:function(e){if(!Q.getElement())throw ie;Q.setTTMLRenderingDiv(e)},attachVttRenderingDiv:function(e){if(!Q.getElement())throw ie;Q.setVttRenderingDiv(e)},getCurrentTextTrackIndex:function(){var e=U.getActiveStreamInfo();if(e&&B)return B.getCurrentTrackIdx(e.id)},provideThumbnail:function(e,t){if("function"==typeof t)if(e<0)t(null);else{var n=q.getIsDynamic()?me(e):e,r=U.getStreamForTime(n);if(null!==r){var i=r.getThumbnailController();if(i)return i.provide(n,t);t(null)}else t(null)}},getDashAdapter:function(){return N},getOfflineController:function(){return xe()},triggerSteeringRequest:function(){if(G)return G.loadSteeringData()},getCurrentSteeringResponseData:function(){if(G)return G.getCurrentSteeringResponseData()},getSettings:function(){return le.get()},updateSettings:function(e){le.update(e)},resetSettings:function(){le.reset()},reset:de,destroy:function(){de(),c.Z.deleteSingletonInstances(oe)}},t=ce.getLogger(e),h=!1,m=!1,g=!1,y=!0,v=NaN,w=null,x=null,r=null,N=null,te=null,l.Z.extend(f.Z),O=qr(oe).getInstance(),P=(0,ot.Z)(oe).getInstance(),Q=ri(oe).getInstance(),J=Lr(oe).getInstance(),e}ba.__dashjs_factory_name="MediaPlayer";var Ea=c.Z.getClassFactory(ba);Ea.events=f.Z,Ea.errors=I,c.Z.updateClassFactory(ba.__dashjs_factory_name,Ea);var Sa=Ea},8825:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}var o=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=s(t);if(n){var i=s(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return a(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this)).AST_IN_FUTURE="astInFuture",e.BASE_URLS_UPDATED="baseUrlsUpdated",e.BUFFER_EMPTY="bufferStalled",e.BUFFER_LOADED="bufferLoaded",e.BUFFER_LEVEL_STATE_CHANGED="bufferStateChanged",e.BUFFER_LEVEL_UPDATED="bufferLevelUpdated",e.DYNAMIC_TO_STATIC="dynamicToStatic",e.ERROR="error",e.FRAGMENT_LOADING_COMPLETED="fragmentLoadingCompleted",e.FRAGMENT_LOADING_PROGRESS="fragmentLoadingProgress",e.FRAGMENT_LOADING_STARTED="fragmentLoadingStarted",e.FRAGMENT_LOADING_ABANDONED="fragmentLoadingAbandoned",e.LOG="log",e.MANIFEST_LOADING_STARTED="manifestLoadingStarted",e.MANIFEST_LOADING_FINISHED="manifestLoadingFinished",e.MANIFEST_LOADED="manifestLoaded",e.METRICS_CHANGED="metricsChanged",e.METRIC_CHANGED="metricChanged",e.METRIC_ADDED="metricAdded",e.METRIC_UPDATED="metricUpdated",e.PERIOD_SWITCH_STARTED="periodSwitchStarted",e.PERIOD_SWITCH_COMPLETED="periodSwitchCompleted",e.QUALITY_CHANGE_REQUESTED="qualityChangeRequested",e.QUALITY_CHANGE_RENDERED="qualityChangeRendered",e.TRACK_CHANGE_RENDERED="trackChangeRendered",e.STREAM_INITIALIZING="streamInitializing",e.STREAM_UPDATED="streamUpdated",e.STREAM_ACTIVATED="streamActivated",e.STREAM_DEACTIVATED="streamDeactivated",e.STREAM_INITIALIZED="streamInitialized",e.STREAM_TEARDOWN_COMPLETE="streamTeardownComplete",e.TEXT_TRACKS_ADDED="allTextTracksAdded",e.TEXT_TRACK_ADDED="textTrackAdded",e.THROUGHPUT_MEASUREMENT_STORED="throughputMeasurementStored",e.TTML_PARSED="ttmlParsed",e.TTML_TO_PARSE="ttmlToParse",e.CAPTION_RENDERED="captionRendered",e.CAPTION_CONTAINER_RESIZE="captionContainerResize",e.CAN_PLAY="canPlay",e.CAN_PLAY_THROUGH="canPlayThrough",e.PLAYBACK_ENDED="playbackEnded",e.PLAYBACK_ERROR="playbackError",e.PLAYBACK_NOT_ALLOWED="playbackNotAllowed",e.PLAYBACK_METADATA_LOADED="playbackMetaDataLoaded",e.PLAYBACK_LOADED_DATA="playbackLoadedData",e.PLAYBACK_PAUSED="playbackPaused",e.PLAYBACK_PLAYING="playbackPlaying",e.PLAYBACK_PROGRESS="playbackProgress",e.PLAYBACK_RATE_CHANGED="playbackRateChanged",e.PLAYBACK_SEEKED="playbackSeeked",e.PLAYBACK_SEEKING="playbackSeeking",e.PLAYBACK_STALLED="playbackStalled",e.PLAYBACK_STARTED="playbackStarted",e.PLAYBACK_TIME_UPDATED="playbackTimeUpdated",e.PLAYBACK_VOLUME_CHANGED="playbackVolumeChanged",e.PLAYBACK_WAITING="playbackWaiting",e.MANIFEST_VALIDITY_CHANGED="manifestValidityChanged",e.EVENT_MODE_ON_START="eventModeOnStart",e.EVENT_MODE_ON_RECEIVE="eventModeOnReceive",e.CONFORMANCE_VIOLATION="conformanceViolation",e.REPRESENTATION_SWITCH="representationSwitch",e.ADAPTATION_SET_REMOVED_NO_CAPABILITIES="adaptationSetRemovedNoCapabilities",e.CONTENT_STEERING_REQUEST_COMPLETED="contentSteeringRequestCompleted",e.INBAND_PRFT="inbandPrft",e.MANAGED_MEDIA_SOURCE_START_STREAMING="managedMediaSourceStartStreaming",e.MANAGED_MEDIA_SOURCE_END_STREAMING="managedMediaSourceEndStreaming",e}return o}(n(8342).Z));t.Z=o},3393:function(e,t){"use strict";var n=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t;return(t=[{key:"init",value:function(){this.STREAM="stream",this.VIDEO="video",this.AUDIO="audio",this.TEXT="text",this.MUXED="muxed",this.IMAGE="image",this.STPP="stpp",this.TTML="ttml",this.VTT="vtt",this.WVTT="wvtt",this.CONTENT_STEERING="contentSteering",this.ABR_STRATEGY_DYNAMIC="abrDynamic",this.ABR_STRATEGY_BOLA="abrBola",this.ABR_STRATEGY_L2A="abrL2A",this.ABR_STRATEGY_LoLP="abrLoLP",this.ABR_STRATEGY_THROUGHPUT="abrThroughput",this.ABR_FETCH_THROUGHPUT_CALCULATION_DOWNLOADED_DATA="abrFetchThroughputCalculationDownloadedData",this.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING="abrFetchThroughputCalculationMoofParsing",this.ABR_FETCH_THROUGHPUT_CALCULATION_AAST="abrFetchThroughputCalculationAAST",this.LIVE_CATCHUP_MODE_DEFAULT="liveCatchupModeDefault",this.LIVE_CATCHUP_MODE_LOLP="liveCatchupModeLoLP",this.MOVING_AVERAGE_SLIDING_WINDOW="slidingWindow",this.MOVING_AVERAGE_EWMA="ewma",this.BAD_ARGUMENT_ERROR="Invalid Arguments",this.MISSING_CONFIG_ERROR="Missing config parameter(s)",this.TRACK_SWITCH_MODE_ALWAYS_REPLACE="alwaysReplace",this.TRACK_SWITCH_MODE_NEVER_REPLACE="neverReplace",this.TRACK_SELECTION_MODE_FIRST_TRACK="firstTrack",this.TRACK_SELECTION_MODE_HIGHEST_BITRATE="highestBitrate",this.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY="highestEfficiency",this.TRACK_SELECTION_MODE_WIDEST_RANGE="widestRange",this.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY="highestSelectionPriority",this.CMCD_MODE_QUERY="query",this.CMCD_MODE_HEADER="header",this.INITIALIZE="initialize",this.TEXT_SHOWING="showing",this.TEXT_HIDDEN="hidden",this.CC1="CC1",this.CC3="CC3",this.UTF8="utf-8",this.SCHEME_ID_URI="schemeIdUri",this.START_TIME="starttime",this.SERVICE_DESCRIPTION_DVB_LL_SCHEME="urn:dvb:dash:lowlatency:scope:2019",this.SUPPLEMENTAL_PROPERTY_DVB_LL_SCHEME="urn:dvb:dash:lowlatency:critical:2019",this.XML="XML",this.ARRAY_BUFFER="ArrayBuffer",this.DVB_REPORTING_URL="dvb:reportingUrl",this.DVB_PROBABILITY="dvb:probability",this.VIDEO_ELEMENT_READY_STATES={HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_DATA:4},this.FILE_LOADER_TYPES={FETCH:"fetch_loader",XHR:"xhr_loader"}}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}());t.Z=n},3860:function(e,t){"use strict";var n=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t;return(t=[{key:"init",value:function(){this.TCP_CONNECTION="TcpList",this.HTTP_REQUEST="HttpList",this.TRACK_SWITCH="RepSwitchList",this.BUFFER_LEVEL="BufferLevel",this.BUFFER_LOADED="bufferLoaded",this.ABANDON_LOAD="abandonload",this.ALLOW_LOAD="allowload",this.BUFFER_EMPTY="bufferStalled",this.BUFFER_STATE="BufferState",this.DVR_INFO="DVRInfo",this.DROPPED_FRAMES="DroppedFrames",this.SCHEDULING_INFO="SchedulingInfo",this.REQUESTS_QUEUE="RequestsQueue",this.MANIFEST_UPDATE="ManifestUpdate",this.MANIFEST_UPDATE_STREAM_INFO="ManifestUpdatePeriodInfo",this.MANIFEST_UPDATE_TRACK_INFO="ManifestUpdateRepresentationInfo",this.PLAY_LIST="PlayList",this.DVB_ERRORS="DVBErrors",this.HTTP_REQUEST_DVB_REPORTING_TYPE="DVBReporting"}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}());t.Z=n},8080:function(e,t,n){"use strict";n.d(t,{default:function(){return z}});var r=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mpdurl=null,this.errorcode=null,this.terror=null,this.url=null,this.ipaddress=null,this.servicelocation=null};r.SSL_CONNECTION_FAILED_PREFIX="SSL",r.DNS_RESOLUTION_FAILED="C00",r.HOST_UNREACHABLE="C01",r.CONNECTION_REFUSED="C02",r.CONNECTION_ERROR="C03",r.CORRUPT_MEDIA_ISOBMFF="M00",r.CORRUPT_MEDIA_OTHER="M01",r.BASE_URL_CHANGED="F00",r.BECAME_REPORTER="S00";var i=r,a=n(1180);function s(e){var t,n,r=(e=e||{}).eventBus,s=e.dashMetrics,o=e.metricsConstants,u=e.events;function l(e){var t=new i;if(n){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.mpdurl||(t.mpdurl=n.originalUrl||n.url),t.terror||(t.terror=new Date),s.addDVBErrors(t)}}function c(e){e.error||(n=e.manifest)}function d(e){l({errorcode:i.BASE_URL_CHANGED,servicelocation:e.entry})}function f(){l({errorcode:i.BECAME_REPORTER})}function h(e){var t;e.metric===o.HTTP_REQUEST&&(0===(t=e.value).responsecode||null==t.responsecode||t.responsecode>=400||t.responsecode<100||t.responsecode>=600)&&l({errorcode:t.responsecode||i.CONNECTION_ERROR,url:t.url,terror:t.tresponse,servicelocation:t._serviceLocation})}function p(e){var t;switch(e.error?e.error.code:0){case MediaError.MEDIA_ERR_NETWORK:t=i.CONNECTION_ERROR;break;case MediaError.MEDIA_ERR_DECODE:t=i.CORRUPT_MEDIA_OTHER;break;default:return}l({errorcode:t})}return t={initialize:function(){r.on(u.MANIFEST_UPDATED,c,t),r.on(u.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,d,t),r.on(u.METRIC_ADDED,h,t),r.on(u.METRIC_UPDATED,h,t),r.on(u.PLAYBACK_ERROR,p,t),r.on(a.Z.BECAME_REPORTING_PLAYER,f,t)},reset:function(){r.off(u.MANIFEST_UPDATED,c,t),r.off(u.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,d,t),r.off(u.METRIC_ADDED,h,t),r.off(u.METRIC_UPDATED,h,t),r.off(u.PLAYBACK_ERROR,p,t),r.off(a.Z.BECAME_REPORTING_PLAYER,f,t)}}}s.__dashjs_factory_name="DVBErrorsTranslator";var o=dashjs.FactoryMaker.getSingletonFactory(s),u=n(2295);function l(e){e=e||{};var t,n,r=!1,i=this.context,a=e.mediaElement;return t={initialize:function(e){e&&e.length&&(e.forEach((function(e){var t=e.starttime,r=t+e.duration;n.add(t,r)})),r=!!e[0]._useWallClockTime)},reset:function(){n.clear()},isEnabled:function(){var e,t=n.length;if(!t)return!0;e=r?(new Date).getTime()/1e3:a.currentTime;for(var i=0;i<t;i+=1){var s=n.start(i),o=n.end(i);if(s<=e&&e<o)return!0}return!1}},n=(0,u.Z)(i).create(),t}l.__dashjs_factory_name="RangeController";var c=dashjs.FactoryMaker.getClassFactory(l);function d(){return{serialise:function e(t){var n,r,i=[],a=[];for(n in t)if(t.hasOwnProperty(n)&&0!==n.indexOf("_")){if(null==(r=t[n])&&(r=""),Array.isArray(r)){if(!r.length)continue;a=[],r.forEach((function(t){var n="Object"!==Object.prototype.toString.call(t).slice(8,-1);a.push(n?t:e(t))})),r=a.map(encodeURIComponent).join(",")}else"string"==typeof r?r=encodeURIComponent(r):r instanceof Date?r=r.toISOString():"number"==typeof r&&(r=Math.round(r));i.push(n+"="+r)}return i.join("&")}}}d.__dashjs_factory_name="MetricSerialiser";var f=dashjs.FactoryMaker.getSingletonFactory(d);function h(){var e,t,n,r=window.crypto||window.msCrypto,i=Uint32Array,a=Math.pow(2,8*i.BYTES_PER_ELEMENT)-1;function s(){r&&(e||(e=new i(10)),r.getRandomValues(e),t=0)}return n={random:function(n,i){var o;return n||(n=0),i||(i=1),r?(t===e.length&&s(),o=e[t]/a,t+=1):o=Math.random(),o*(i-n)+n}},s(),n}h.__dashjs_factory_name="RNG";var p=dashjs.FactoryMaker.getSingletonFactory(h),g=n(5717);function m(e){var t;e=e||{};var n,r,i,a,s,o,u,l=this.context,c=[],d=e.metricsConstants;function h(){a=!1,s=!1,o=null,u=null}return t={report:function(e,t){Array.isArray(t)||(t=[t]),s&&u.isEnabled()&&t.forEach((function(t){var i=n.serialise(t);e!==d.DVB_ERRORS&&(i="metricname=".concat(e,"&").concat(i)),function(e,t,n){var i=new XMLHttpRequest;i.withCredentials=r.getXHRWithCredentialsForType(d.HTTP_REQUEST_DVB_REPORTING_TYPE);var a=function(){var e=c.indexOf(i);-1!==e&&(c.splice(e,1),!(i.status>=200&&i.status<300)&&n&&n())};c.push(i);try{i.open("GET",e),i.onloadend=a,i.onerror=a,i.send()}catch(e){i.onerror()}}(i="".concat(o,"?").concat(i),0,(function(){s=!1}))}))},initialize:function(e,t){var n;if(u=t,!(o=e.dvb_reportingUrl))throw new Error("required parameter missing (dvb:reportingUrl)");a||((n=e.dvb_probability)&&(1e3===n||n/1e3>=i.random())&&(s=!0),a=!0)},reset:function(){h()}},n=f(l).getInstance(),i=p(l).getInstance(),r=(0,g.Z)(l).getInstance(),h(),t}m.__dashjs_factory_name="DVBReporting";var y=dashjs.FactoryMaker.getClassFactory(m);function v(e){e=e||{};var t={"urn:dvb:dash:reporting:2014":y},n=this.context,r=e.debug?e.debug.getLogger(undefined):{},i=e.metricsConstants,a=e.mediaPlayerModel||{};return{create:function(e,s){var o;try{(o=t[e.schemeIdUri](n).create({metricsConstants:i,mediaPlayerModel:a})).initialize(e,s)}catch(s){o=null,r.error("ReportingFactory: could not create Reporting with schemeIdUri ".concat(e.schemeIdUri," (").concat(s.message,")"))}return o},register:function(e,n){t[e]=n},unregister:function(e){delete t[e]}}}v.__dashjs_factory_name="ReportingFactory";var _=dashjs.FactoryMaker.getSingletonFactory(v);function T(e){var t=[],n=_(this.context).getInstance(e);return{initialize:function(e,r){e.some((function(e){var i=n.create(e,r);if(i)return t.push(i),!0}))},reset:function(){t.forEach((function(e){return e.reset()})),t=[]},report:function(e,n){t.forEach((function(t){return t.report(e,n)}))}}}T.__dashjs_factory_name="ReportingController";var b=dashjs.FactoryMaker.getClassFactory(T);function E(){return{reconstructFullMetricName:function(e,t,n){var r=e;return t&&(r+="("+t,n&&n.length&&(r+=","+n),r+=")"),r},validateN:function(e){if(!e)throw new Error("missing n");if(isNaN(e))throw new Error("n is NaN");if(e<0)throw new Error("n must be positive");return e}}}E.__dashjs_factory_name="HandlerHelpers";var S=dashjs.FactoryMaker.getSingletonFactory(E);function w(e){var t,n,r,i,a;e=e||{};var s=this.context,o=S(s).getInstance(),u=[],l=e.metricsConstants;function c(){var e=function(){try{return Object.keys(u).map((function(e){return u[e]})).reduce((function(e,t){return e.level<t.level?e:t}))}catch(e){return}}();e&&a!==e.t&&(a=e.t,t.report(r,e))}return{initialize:function(e,a,s){a&&(n=o.validateN(s),t=a,r=o.reconstructFullMetricName(e,s),i=setInterval(c,n))},reset:function(){clearInterval(i),i=null,n=0,t=null,a=null},handleNewMetric:function(e,t,n){e===l.BUFFER_LEVEL&&(u[n]=t)}}}w.__dashjs_factory_name="BufferLevelHandler";var A=dashjs.FactoryMaker.getClassFactory(w),I=dashjs.FactoryMaker.getClassFactory((function(e){var t,n=(e=e||{}).eventBus,r=e.metricsConstants;function i(){n.off(a.Z.METRICS_INITIALISATION_COMPLETE,i,this),n.trigger(a.Z.BECAME_REPORTING_PLAYER)}return{initialize:function(e,r){r&&(t=r,n.on(a.Z.METRICS_INITIALISATION_COMPLETE,i,this))},reset:function(){t=null},handleNewMetric:function(e,n){e===r.DVB_ERRORS&&t&&t.report(e,n)}}}));function C(e){var t,n,r,i,a;e=e||{};var s=[],o=S(this.context).getInstance(),u=e.metricsConstants;function l(){var e=s;e.length&&t&&t.report(i,e),s=[]}return{initialize:function(e,s,u,c){s&&(n=o.validateN(u),t=s,c&&c.length&&(r=c),i=o.reconstructFullMetricName(e,u,c),a=setInterval(l,n))},reset:function(){clearInterval(a),a=null,n=null,r=null,s=[],t=null},handleNewMetric:function(e,t){e===u.HTTP_REQUEST&&(r&&r!==t.type||s.push(t))}}}C.__dashjs_factory_name="HttpListHandler";var R=dashjs.FactoryMaker.getClassFactory(C);function D(){var e,t;return{initialize:function(n,r){e=n,t=r},reset:function(){t=null,e=void 0},handleNewMetric:function(n,r){n===e&&t&&t.report(e,r)}}}D.__dashjs_factory_name="GenericMetricHandler";var x=dashjs.FactoryMaker.getClassFactory(D);function N(e){var t=(e=e||{}).debug?e.debug.getLogger(undefined):{},n=/([a-zA-Z]*)(\(([0-9]*)(\,\s*([a-zA-Z]*))?\))?/,r=this.context,i={BufferLevel:A,DVBErrors:I,HttpList:R,PlayList:x,RepSwitchList:x,TcpList:x};return{create:function(a,s){var o,u=a.match(n);if(u){try{(o=i[u[1]](r).create({eventBus:e.eventBus,metricsConstants:e.metricsConstants})).initialize(u[1],s,u[3],u[5])}catch(e){o=null,t.error("MetricsHandlerFactory: Could not create handler for type ".concat(u[1]," with args ").concat(u[3],", ").concat(u[5]," (").concat(e.message,")"))}return o}},register:function(e,t){i[e]=t},unregister:function(e){delete i[e]}}}N.__dashjs_factory_name="MetricsHandlerFactory";var O=dashjs.FactoryMaker.getSingletonFactory(N);function P(e){e=e||{};var t,n=[],r=this.context,i=e.eventBus,a=e.events,s=O(r).getInstance({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants});function o(e){n.forEach((function(t){t.handleNewMetric(e.metric,e.value,e.mediaType)}))}return t={initialize:function(e,r){e.split(",").forEach((function(e,t,i){var a;if(-1!==e.indexOf("(")&&-1===e.indexOf(")")){var o=i[t+1];o&&-1===o.indexOf("(")&&-1!==o.indexOf(")")&&(e+=","+o,delete i[t+1])}(a=s.create(e,r))&&n.push(a)})),i.on(a.METRIC_ADDED,o,t),i.on(a.METRIC_UPDATED,o,t)},reset:function(){i.off(a.METRIC_ADDED,o,t),i.off(a.METRIC_UPDATED,o,t),n.forEach((function(e){return e.reset()})),n=[]}}}P.__dashjs_factory_name="MetricsHandlersController";var M=dashjs.FactoryMaker.getClassFactory(P);function k(e){var t,n,r;e=e||{};var i=this.context;function a(){t&&t.reset(),n&&n.reset(),r&&r.reset()}return{initialize:function(s){try{(r=c(i).create({mediaElement:e.mediaElement})).initialize(s.Range),(n=b(i).create({debug:e.debug,metricsConstants:e.metricsConstants,mediaPlayerModel:e.mediaPlayerModel})).initialize(s.Reporting,r),(t=M(i).create({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants,events:e.events})).initialize(s.metrics,n)}catch(e){throw a(),e}},reset:a}}k.__dashjs_factory_name="MetricsController";var L=dashjs.FactoryMaker.getClassFactory(k),F=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metrics="",this.Range=[],this.Reporting=[]},U=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.starttime=0,this.duration=1/0,this._useWallClockTime=!1},B=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schemeIdUri="",this.value="",this.dvb_reportingUrl="",this.dvb_probability=1e3};function j(e){var t=(e=e||{}).adapter,n=e.constants;return{getMetrics:function(e){var r=[];return e&&e.Metrics_asArray&&e.Metrics_asArray.forEach((function(i){var a=new F,s=t.getIsDynamic(e);i.hasOwnProperty("metrics")&&(a.metrics=i.metrics,i.Range_asArray&&i.Range_asArray.forEach((function(r){var i=new U;i.starttime=function(e,r,i){var a,s,o=0;return r?o=t.getAvailabilityStartTime(e)/1e3:(a=t.getRegularPeriods(e)).length&&(o=a[0].start),s=o,i&&i.hasOwnProperty(n.START_TIME)&&(s+=i.starttime),s}(e,s,r),r.hasOwnProperty("duration")?i.duration=r.duration:i.duration=t.getDuration(e),i._useWallClockTime=s,a.Range.push(i)})),i.Reporting_asArray&&(i.Reporting_asArray.forEach((function(e){var t=new B;e.hasOwnProperty(n.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty("value")&&(t.value=e.value),e.hasOwnProperty(n.DVB_REPORTING_URL)&&(t.dvb_reportingUrl=e[n.DVB_REPORTING_URL]),e.hasOwnProperty(n.DVB_PROBABILITY)&&(t.dvb_probability=e[n.DVB_PROBABILITY]),a.Reporting.push(t))})),r.push(a)))})),r}}}j.__dashjs_factory_name="ManifestParsing";var q=dashjs.FactoryMaker.getSingletonFactory(j);function H(e){var t;e=e||{};var n={},r=this.context,i=e.eventBus,s=e.events;function o(t){if(!t.error){var s=Object.keys(n);q(r).getInstance({adapter:e.adapter,constants:e.constants}).getMetrics(t.manifest).forEach((function(t){var i=JSON.stringify(t);if(n.hasOwnProperty(i))s.splice(i,1);else try{var a=L(r).create(e);a.initialize(t),n[i]=a}catch(e){}})),s.forEach((function(e){n[e].reset(),delete n[e]})),i.trigger(a.Z.METRICS_INITIALISATION_COMPLETE)}}function u(){Object.keys(n).forEach((function(e){n[e].reset()})),n={}}return t={reset:function(){i.off(s.MANIFEST_UPDATED,o,t),i.off(s.STREAM_TEARDOWN_COMPLETE,u,t)}},i.on(s.MANIFEST_UPDATED,o,t),i.on(s.STREAM_TEARDOWN_COMPLETE,u,t),t}H.__dashjs_factory_name="MetricsCollectionController";var G=dashjs.FactoryMaker.getClassFactory(H);function V(){var e=this.context;return{createMetricsReporting:function(t){return o(e).getInstance({eventBus:t.eventBus,dashMetrics:t.dashMetrics,metricsConstants:t.metricsConstants,events:t.events}).initialize(),G(e).create(t)},getReportingFactory:function(){return _(e).getInstance()},getMetricsHandlerFactory:function(){return O(e).getInstance()}}}V.__dashjs_factory_name="MetricsReporting";var Y=dashjs.FactoryMaker.getClassFactory(V);Y.events=a.Z,dashjs.FactoryMaker.updateClassFactory(V.__dashjs_factory_name,Y);var z=Y},1180:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}var o=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=s(t);if(n){var i=s(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return a(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this)).METRICS_INITIALISATION_COMPLETE="internal_metricsReportingInitialized",e.BECAME_REPORTING_PLAYER="internal_becameReportingPlayer",e.CMCD_DATA_GENERATED="cmcdDataGenerated",e}return o}(n(8342).Z));t.Z=o},5717:function(e,t,n){"use strict";var r=n(2610),i=n(5448),a=n(1264),s=n(3106),o=n(1767),u=n(3393);function l(){var e,t,n,i,l,c,d,f,h=this.context,p=(0,a.Z)(h).getInstance();function g(){i=[],l=[],c=[],f=[],d=null,t=[]}function m(e,t){var n=-1;e.some((function(e,r){if(e===t)return n=r,!0})),n<0||e.splice(n,1)}function y(e){var t;for(t=0;t<f.length;t++)if(f[t].rulename===e)return t;return-1}function v(e,n){_(e,n);var i=new r.Z;i.schemeIdUri=e,i.value=n,t.push(i)}function _(e,n){(0,s.PS)(e,"string"),(0,s.PS)(n,"string"),t.forEach((function(r,i){r.schemeIdUri===e&&r.value===n&&t.splice(i,1)}))}return e={getCustomInitialTrackSelectionFunction:function(){return d},setCustomInitialTrackSelectionFunction:function(e){d=e},resetCustomInitialTrackSelectionFunction:function(){d=null},getLicenseResponseFilters:function(){return l},getLicenseRequestFilters:function(){return i},getCustomCapabilitiesFilters:function(){return c},registerCustomCapabilitiesFilter:function(e){c.push(e)},registerLicenseResponseFilter:function(e){l.push(e)},registerLicenseRequestFilter:function(e){i.push(e)},unregisterCustomCapabilitiesFilter:function(e){m(c,e)},unregisterLicenseResponseFilter:function(e){m(l,e)},unregisterLicenseRequestFilter:function(e){m(i,e)},addAbrCustomRule:function(e,t,n){if("string"!=typeof e||e!==o.Z.ABANDON_FRAGMENT_RULES&&e!==o.Z.QUALITY_SWITCH_RULES||"string"!=typeof t)throw u.Z.BAD_ARGUMENT_ERROR;var r=y(t);-1===r?f.push({type:e,rulename:t,rule:n}):(f[r].type=e,f[r].rule=n)},removeAllAbrCustomRule:function(){f=[]},removeAbrCustomRule:function(e){if(e){var t=y(e);-1!==t&&f.splice(t,1)}else f=[]},getAbrCustomRules:function(){return f},addUTCTimingSource:v,removeUTCTimingSource:_,getUTCTimingSources:function(){return t},clearDefaultUTCTimingSources:function(){t=[]},restoreDefaultUTCTimingSources:function(){var e=p.get().streaming.utcSynchronization.defaultTimingSource;v(e.scheme,e.value)},setXHRWithCredentialsForType:function e(t,r){t?n[t]=!!r:Object.keys(n).forEach((function(t){e(t,r)}))},getXHRWithCredentialsForType:function(e){var t=n[e];return void 0===t?n.default:t},setConfig:function(){},reset:function(){g()}},n={default:!1},g(),e}l.__dashjs_factory_name="CustomParametersModel",t.Z=i.Z.getSingletonFactory(l)},9032:function(e,t,n){"use strict";var r=n(5448),i=n(7473);function a(e){var t=(e=e||{}).requestModifier;function n(e){var n=new Date,r=e.request,i=new XMLHttpRequest;if(i.open(e.method,e.url,!0),r.responseType&&(i.responseType=r.responseType),r.range&&i.setRequestHeader("Range","bytes="+r.range),r.requestStartDate||(r.requestStartDate=n),t&&t.modifyRequestHeader&&(i=t.modifyRequestHeader(i,{url:e.url})),e.headers)for(var a in e.headers){var s=e.headers[a];s&&i.setRequestHeader(a,s)}i.withCredentials=e.withCredentials,i.onload=e.onload,i.onloadend=e.onend,i.onerror=e.onerror,i.onprogress=e.progress,i.onabort=e.onabort,i.ontimeout=e.ontimeout,i.timeout=e.timeout,i.send(),e.response=i}return{load:function(e){t&&t.modifyRequest?(0,i.k)(e,t).then((function(){return n(e)})):n(e)},abort:function(e){var t=e.response;t.onloadend=t.onerror=t.onprogress=void 0,t.abort()}}}a.__dashjs_factory_name="XHRLoader";var s=r.Z.getClassFactory(a);t.Z=s},1737:function(e,t,n){"use strict";n.d(t,{default:function(){return ve}});var r={attributes:["Laurl","laurl"],prefixes:["clearkey","dashif"]},i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t;return t=[{key:"findCencContentProtection",value:function(e){for(var t=null,n=0;n<e.length;++n){var r=e[n];"urn:mpeg:dash:mp4protection:2011"!==r.schemeIdUri.toLowerCase()||"cenc"!==r.value.toLowerCase()&&"cbcs"!==r.value.toLowerCase()||(t=r)}return t}},{key:"getPSSHData",value:function(e){var t=8,n=new DataView(e),r=n.getUint8(t);return t+=20,r>0&&(t+=4+16*n.getUint32(t)),t+=4,e.slice(t)}},{key:"getPSSHForKeySystem",value:function(t,n){var r=e.parsePSSHList(n);return t&&r.hasOwnProperty(t.uuid.toLowerCase())?r[t.uuid.toLowerCase()]:null}},{key:"parseInitDataFromContentProtection",value:function(e,t){return"pssh"in e?(e.pssh.__text=e.pssh.__text.replace(/\r?\n|\r/g,"").replace(/\s+/g,""),t.decodeArray(e.pssh.__text).buffer):null}},{key:"parsePSSHList",value:function(e){if(null==e)return[];for(var t=new DataView(e.buffer||e),n={},r=0;;){var i,a,s=void 0,o=r;if(r>=t.buffer.byteLength)break;if(i=r+t.getUint32(r),r+=4,1886614376===t.getUint32(r))if(r+=4,0===(a=t.getUint8(r))||1===a){r++,r+=3,s="";var u=void 0,l=void 0;for(u=0;u<4;u++)s+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=4,s+="-",u=0;u<2;u++)s+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=2,s+="-",u=0;u<2;u++)s+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=2,s+="-",u=0;u<2;u++)s+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=2,s+="-",u=0;u<6;u++)s+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;r+=6,r+=4,n[s=s.toLowerCase()]=t.buffer.slice(o,i),r=i}else r=i;else r=i}return n}},{key:"getLicenseServerUrlFromMediaInfo",value:function(e,t){try{if(!e||0===e.length)return null;for(var n=0,i=null;n<e.length&&!i;){var a=e[n];if(a&&a.contentProtection&&a.contentProtection.length>0){var s=a.contentProtection.filter((function(e){return e.schemeIdUri&&e.schemeIdUri===t}));if(s&&s.length>0)for(var o=0;o<s.length&&!i;){for(var u=s[o],l=0;l<r.attributes.length&&!i;){for(var c=0,d=r.attributes[l];c<r.prefixes.length&&!i;){var f=r.prefixes[c];u[d]&&u[d].__prefix&&u[d].__prefix===f&&u[d].__text&&(i=u[d].__text),c+=1}l+=1}o+=1}}n+=1}return i}catch(e){return null}}}],t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e,t),e}(),a=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.contentType=t,this.robustness=n},s=function e(t,n,r,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initDataTypes=["cenc"],t&&t.length&&(this.audioCapabilities=t),n&&n.length&&(this.videoCapabilities=n),this.distinctiveIdentifier=r,this.persistentState=i,this.sessionTypes=a};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}var c=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=l(t);if(n){var i=l(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(e=r.call(this)).MEDIA_KEYERR_CODE=100,e.MEDIA_KEYERR_UNKNOWN_CODE=101,e.MEDIA_KEYERR_CLIENT_CODE=102,e.MEDIA_KEYERR_SERVICE_CODE=103,e.MEDIA_KEYERR_OUTPUT_CODE=104,e.MEDIA_KEYERR_HARDWARECHANGE_CODE=105,e.MEDIA_KEYERR_DOMAIN_CODE=106,e.MEDIA_KEY_MESSAGE_ERROR_CODE=107,e.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE=108,e.SERVER_CERTIFICATE_UPDATED_ERROR_CODE=109,e.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE=110,e.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE=111,e.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE=112,e.KEY_SESSION_CREATED_ERROR_CODE=113,e.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE=114,e.MEDIA_KEYERR_UNKNOWN_MESSAGE="An unspecified error occurred. This value is used for errors that don't match any of the other codes.",e.MEDIA_KEYERR_CLIENT_MESSAGE="The Key System could not be installed or updated.",e.MEDIA_KEYERR_SERVICE_MESSAGE="The message passed into update indicated an error from the license service.",e.MEDIA_KEYERR_OUTPUT_MESSAGE="There is no available output device with the required characteristics for the content protection system.",e.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE="A hardware configuration change caused a content protection error.",e.MEDIA_KEYERR_DOMAIN_MESSAGE="An error occurred in a multi-device domain licensing configuration. The most common error is a failure to join the domain.",e.MEDIA_KEY_MESSAGE_ERROR_MESSAGE="Multiple key sessions were creates with a user-agent that does not support sessionIDs!! Unpredictable behavior ahead!",e.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE="DRM: Empty key message from CDM",e.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE="Error updating server certificate -- ",e.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE="DRM: KeyStatusChange error! -- License has expired",e.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE="DRM: No license server URL specified!",e.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE="DRM: KeySystem Access Denied! -- ",e.KEY_SESSION_CREATED_ERROR_MESSAGE="DRM: unable to create session! --",e.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE="DRM: licenser error! --",e}return i}(n(2230).Z)),d=n(5459),f=function e(t,n,r,i,a,s,o,u){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t,this.method=n,this.responseType=r,this.headers=i,this.withCredentials=a,this.messageType=s,this.sessionId=o,this.data=u},h=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t,this.headers=n,this.data=r},p=n(7855),g=n(703),m=n(3393),y=n(5448);function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function _(e){var t,n,r,o,u,l,y,_,T,b,E,S=(e=e||{}).protectionKeyController,w=e.protectionModel,A=e.eventBus,I=e.events,C=e.debug,R=e.BASE64,D=e.constants,x=[],N=e.cmcdModel,O=e.settings,P=e.customParametersModel;function M(){if(!(A&&A.hasOwnProperty("on")&&S&&S.hasOwnProperty("getSupportedKeySystemsFromContentProtection")))throw new Error("Missing config parameter(s)")}function k(e,t){_||T?_&&L():function(e,t){if(!T){T=!0;var r,i=[];e=e.sort((function(t,n){return(u&&u[t.ks.systemString]&&u[t.ks.systemString].priority>=0?u[t.ks.systemString].priority:e.length)-(u&&u[n.ks.systemString]&&u[n.ks.systemString].priority>=0?u[n.ks.systemString].priority:e.length)}));for(var a=0;a<e.length;a++){var s=G(e[a]);i.push({ks:e[a].ks,configs:[s],protData:e[a].protData})}w.requestKeySystemAccess(i).then((function(e){var t=(r=e.data).mksa&&r.mksa.selectedSystemString?r.mksa.selectedSystemString:r.keySystem.systemString;return n.info("DRM: KeySystem Access Granted for system string ("+t+")! Selecting key system..."),w.selectKeySystem(r)})).then((function(e){if(_=e,T=!1,w){A.trigger(I.KEY_SYSTEM_SELECTED,{data:r});var t=j(_);t&&t.serverCertificate&&t.serverCertificate.length>0&&w.setServerCertificate(R.decodeArray(t.serverCertificate).buffer),L()}})).catch((function(e){_=null,T=!1,t||A.trigger(I.KEY_SYSTEM_SELECTED,{data:null,error:new d.Z(c.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,c.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+"Error selecting key system! -- "+e.error)})}))}}(e,t)}function L(){for(var e,t=0;t<r.length;t++)for(e=0;e<r[t].length;e++)if(_===r[t][e].ks){F(r[t][e]);break}r=[]}function F(e){if(S.isClearKey(_)&&e.protData&&e.protData.hasOwnProperty("clearkeys")&&0!==Object.keys(e.protData.clearkeys).length){var t={kids:Object.keys(e.protData.clearkeys)};e.initData=(new TextEncoder).encode(JSON.stringify(t))}e.sessionId?U(e):null!==e.initData&&B(e)}function U(e){M(),w.loadKeySession(e)}function B(e){var t=i.getPSSHForKeySystem(_,e?e.initData:null);if(t){if(function(e){if(!e)return!1;try{for(var t=w.getSessions(),n=0;n<t.length;n++)if(t[n].getKeyId()===e)return!0;return!1}catch(e){return!1}}(e.keyId))return;if(q(t))return;try{e.initData=t,w.createKeySession(e)}catch(e){A.trigger(I.KEY_SESSION_CREATED,{data:null,error:new d.Z(c.KEY_SESSION_CREATED_ERROR_CODE,c.KEY_SESSION_CREATED_ERROR_MESSAGE+e.message)})}}else e&&e.initData?w.createKeySession(e):A.trigger(I.KEY_SESSION_CREATED,{data:null,error:new d.Z(c.KEY_SESSION_CREATED_ERROR_CODE,c.KEY_SESSION_CREATED_ERROR_MESSAGE+"Selected key system is "+(_?_.systemString:null)+". needkey/encrypted event contains no initData corresponding to that key system!")})}function j(e){if(e){var t=e.systemString;if(u)return t in u?u[t]:null}return null}function q(e){if(!e)return!1;try{for(var t=w.getAllInitData(),r=0;r<t.length;r++)if(S.initDataEquals(e,t[r]))return n.debug("DRM: Ignoring initData because we have already seen it!"),!0;return!1}catch(e){return!1}}function H(e){M(),e?(w.setMediaElement(e),A.on(I.NEED_KEY,Q,t)):null===e&&(w.setMediaElement(e),A.off(I.NEED_KEY,Q,t))}function G(e){var t=e.protData,n=[],r=[],i=t&&t.audioRobustness&&t.audioRobustness.length>0?t.audioRobustness:y,u=t&&t.videoRobustness&&t.videoRobustness.length>0?t.videoRobustness:y,l=e.sessionType,c=t&&t.distinctiveIdentifier?t.distinctiveIdentifier:"optional",d=t&&t.persistentState?t.persistentState:"temporary"===l?"optional":"required";return o.forEach((function(e){e.type===D.AUDIO?n.push(new a(e.codec,i)):e.type===D.VIDEO&&r.push(new a(e.codec,u))})),new s(n,r,c,d,[l])}function V(e){e.error?A.trigger(I.KEY_STATUSES_CHANGED,{data:null,error:e.error}):n.debug("DRM: key status = "+e.status)}function Y(e){n.debug("DRM: onKeyMessage");var t=e.data;A.trigger(I.KEY_MESSAGE,{data:t});var r=t.messageType?t.messageType:"license-request",a=t.message,s=t.sessionToken,u=j(_),l=S.getLicenseServerModelInstance(_,u,r),m={sessionToken:s,messageType:r};if(a&&0!==a.byteLength){if(!l)return n.debug("DRM: License server request not required for this message (type = "+e.data.messageType+"). Session ID = "+s.getSessionId()),void z(m);if(S.isClearKey(_)){var y=S.processClearKeyLicenseRequest(_,u,a);if(y&&y.keyPairs&&y.keyPairs.length>0)return n.debug("DRM: ClearKey license request handled by application!"),z(m),void w.updateKeySession(s,y)}!function(e,t,n){var r=e.sessionToken,a=e.messageType?e.messageType:"license-request",s={sessionToken:r,messageType:a},u=_?_.systemString:null,l=function(e,t,n,r,a){var s=null,u=r.message;if(e&&e.serverURL){var l=e.serverURL;"string"==typeof l&&""!==l?s=l:"object"===v(l)&&l.hasOwnProperty(t)&&(s=l[t])}else if(e&&e.laURL&&""!==e.laURL)s=e.laURL;else if(!(s=i.getLicenseServerUrlFromMediaInfo(o,_.schemeIdURI))&&!S.isClearKey(_)){var c=i.getPSSHData(n.initData);(s=_.getLicenseServerURLFromInitData(c))||(s=r.laURL)}return a.getServerURLFromMessage(s,u,t)}(n,a,r,e,t);if(l){var m={},y=!1;n&&W(m,n.httpRequestHeaders);var T=e.message;W(m,_.getRequestHeadersFromMessage(T)),Object.keys(m).forEach((function(e){"authorization"===e.toLowerCase()&&(y=!0)})),n&&"boolean"==typeof n.withCredentials&&(y=n.withCredentials);var b=function(e){if(w)if(e.status>=200&&e.status<=299){var n=g.Z.parseHttpHeaders(e.getAllResponseHeaders?e.getAllResponseHeaders():null),i=new h(e.responseURL,n,e.response);$(P.getLicenseResponseFilters(),i).then((function(){var n=t.getLicenseMessage(i.data,u,a);null!==n?(z(s),w.updateKeySession(r,n)):X(e,s,u,a,t)}))}else X(e,s,u,a,t)},E=function(e){z(s,new d.Z(c.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,c.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+u+' update, XHR aborted. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},A=function(e){z(s,new d.Z(c.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,c.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+u+' update, XHR error. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},I=_.getLicenseRequestFromMessage(T),C=t.getHTTPMethod(a),R=t.getResponseType(u,a),D=n&&!isNaN(n.httpTimeout)?n.httpTimeout:8e3,x=r.getSessionId()||null,N=new f(l,C,R,m,y,a,x,I),M=isNaN(O.get().streaming.retryAttempts[p.w.LICENSE])?3:O.get().streaming.retryAttempts[p.w.LICENSE];$(P.getLicenseRequestFilters(),N).then((function(){Z(N,M,D,b,E,A)}))}else z(s,new d.Z(c.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE,c.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE))}(t,l,u)}else z(m,new d.Z(c.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE,c.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE))}function z(e,t){A.trigger(I.LICENSE_REQUEST_COMPLETE,{data:e,error:t})}function Z(e,t,r,i,a,s){var o=new XMLHttpRequest;if(O.get().streaming.cmcd&&O.get().streaming.cmcd.enabled&&O.get().streaming.cmcd.mode===m.Z.CMCD_MODE_QUERY){var u=N.getQueryParameter({url:e.url,type:p.w.LICENSE});u&&(e.url=g.Z.addAditionalQueryParameterToUrl(e.url,[u]))}for(var l in o.open(e.method,e.url,!0),o.responseType=e.responseType,o.withCredentials=e.withCredentials,r>0&&(o.timeout=r),e.headers)o.setRequestHeader(l,e.headers[l]);if(O.get().streaming.cmcd&&O.get().streaming.cmcd.enabled&&O.get().streaming.cmcd.mode===m.Z.CMCD_MODE_HEADER){var c=N.getHeaderParameters({url:e.url,type:p.w.LICENSE});if(c)for(var d in c){var f=c[d];f&&o.setRequestHeader(d,f)}}var h=function(){t--;var n=isNaN(O.get().streaming.retryIntervals[p.w.LICENSE])?1e3:O.get().streaming.retryIntervals[p.w.LICENSE];E=setTimeout((function(){Z(e,t,r,i,a,s)}),n)};o.onload=function(){b=null,this.status>=200&&this.status<=299||t<=0?i(this):(n.warn("License request failed ("+this.status+"). Retrying it... Pending retries: "+t),h())},o.ontimeout=o.onerror=function(){b=null,t<=0?s(this):(n.warn("License request network request failed . Retrying it... Pending retries: "+t),h())},o.onabort=function(){a(this)},A.trigger(I.LICENSE_REQUEST_SENDING,{url:e.url,headers:e.headers,payload:e.data,sessionId:e.sessionId}),b=o,o.send(e.data)}function K(){b&&(b.onloadend=b.onerror=b.onprogress=void 0,b.abort(),b=null),E&&(clearTimeout(E),E=null)}function W(e,t){if(t)for(var n in t)e[n]=t[n]}function X(e,t,n,r,i){var a="NONE",s=null;e.response&&(a=i.getErrorResponse(e.response,n,r),s={serverResponse:e.response||null,responseCode:e.status||null,responseText:e.statusText||null}),z(t,new d.Z(c.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,c.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+n+' update, XHR complete. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState+". Response is "+a,s))}function $(e,t){return e?e.reduce((function(e,n){return e.then((function(){return n(t)}))}),Promise.resolve()):Promise.resolve()}function Q(e,t){if(!O.get().streaming.protection.ignoreEmeEncryptedEvent){if(n.debug("DRM: onNeedKey"),"cenc"!==e.key.initDataType)return void n.warn("DRM: Only 'cenc' initData is supported! Ignoring initData of type: "+e.key.initDataType);if(0===o.length&&(n.warn("DRM: onNeedKey called before initializeForMedia, wait until initialized"),(t=void 0===t?1:t+1)<5))return void x.push(setTimeout((function(){Q(e,t)}),500));var a=e.key.initData;if(ArrayBuffer.isView(a)&&(a=a.buffer),_){var s=i.getPSSHForKeySystem(_,a);if(s&&q(s))return}n.debug("DRM: initData:",String.fromCharCode.apply(null,new Uint8Array(a)));var c=S.getSupportedKeySystemsFromSegmentPssh(a,u,l);if(0===c.length)return void n.debug("DRM: Received needkey event with initData, but we don't support any of the key systems!");!function(e){r.push(e),k(e,!1)}(c)}}return t={initializeForMedia:function(e){if(!e)throw new Error("mediaInfo can not be null or undefined");M(),o.push(e)},clearMediaInfoArray:function(){o=[]},handleKeySystemFromManifest:function(){if(o&&0!==o.length){var e=[];o.forEach((function(t){var n=S.getSupportedKeySystemsFromContentProtection(t.contentProtection,u,l);n.length>0&&(0===e.length&&(e=n),r.push(n))})),e&&e.length>0&&k(e,!0)}},createKeySession:B,loadKeySession:U,removeKeySession:function(e){M(),w.removeKeySession(e)},closeKeySession:function(e){M(),w.closeKeySession(e)},setServerCertificate:function(e){M(),w.setServerCertificate(e)},setMediaElement:H,setSessionType:function(e){l=e},setRobustnessLevel:function(e){y=e},setProtectionData:function(e){u=e,S.setProtectionData(e)},getSupportedKeySystemsFromContentProtection:function(e){return M(),S.getSupportedKeySystemsFromContentProtection(e,u,l)},getKeySystems:function(){return S?S.getKeySystems():[]},setKeySystems:function(e){S&&S.setKeySystems(e)},stop:function(){K(),w&&w.stop()},reset:function(){A.off(I.INTERNAL_KEY_MESSAGE,Y,t),A.off(I.INTERNAL_KEY_STATUS_CHANGED,V,t),M(),K(),H(null),_=null,T=!1,w&&(w.reset(),w=null),x.forEach((function(e){return clearTimeout(e)})),x=[],o=[],r=[]}},n=C.getLogger(t),r=[],o=[],l="temporary",y="",b=null,E=null,A.on(I.INTERNAL_KEY_MESSAGE,Y,t),A.on(I.INTERNAL_KEY_STATUS_CHANGED,V,t),t}_.__dashjs_factory_name="ProtectionController";var T=y.Z.getClassFactory(_),b=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keyID=t,this.key=n};var E=function(){function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n&&"persistent"!==n&&"temporary"!==n)throw new Error("Invalid ClearKey key set type! Must be one of 'persistent' or 'temporary'");this.keyPairs=t,this.type=n}var t;return(t=[{key:"toJWK",value:function(){var e,t=this.keyPairs.length,n={keys:[]};for(e=0;e<t;e++){var r={kty:"oct",alg:"A128KW",kid:this.keyPairs[e].keyID,k:this.keyPairs[e].key};n.keys.push(r)}this.type&&(n.type=this.type);var i=JSON.stringify(n),a=i.length,s=new ArrayBuffer(a),o=new Uint8Array(s);for(e=0;e<a;e++)o[e]=i.charCodeAt(e);return s}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();var S=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t;return(t=[{key:"init",value:function(){this.CLEARKEY_KEYSTEM_STRING="org.w3.clearkey",this.WIDEVINE_KEYSTEM_STRING="com.widevine.alpha",this.PLAYREADY_KEYSTEM_STRING="com.microsoft.playready",this.PLAYREADY_RECOMMENDATION_KEYSTEM_STRING="com.microsoft.playready.recommendation",this.INITIALIZATION_DATA_TYPE_CENC="cenc",this.INITIALIZATION_DATA_TYPE_KEYIDS="keyids",this.INITIALIZATION_DATA_TYPE_WEBM="webm"}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}()),w="e2719d58-a985-b3c9-781a-b030af78d30e",A=S.CLEARKEY_KEYSTEM_STRING,I="urn:uuid:"+w;function C(e){var t=(e=e||{}).BASE64;return{uuid:w,schemeIdURI:I,systemString:A,getInitData:function(e,n){try{var r=i.parseInitDataFromContentProtection(e,t);if(!r&&n){var a={kids:[function(e){try{var t=e.replace(/-/g,"");return(t=btoa(t.match(/\w{2}/g).map((function(e){return String.fromCharCode(parseInt(e,16))})).join(""))).replace(/=/g,"").replace(/\//g,"_").replace(/\+/g,"-")}catch(e){return null}}(n["cenc:default_KID"])]};r=(new TextEncoder).encode(JSON.stringify(a))}return r}catch(e){return null}},getRequestHeadersFromMessage:function(){return{"Content-Type":"application/json"}},getLicenseRequestFromMessage:function(e){return JSON.stringify(JSON.parse(String.fromCharCode.apply(null,new Uint8Array(e))))},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(e,t){var n=null;if(e){for(var r=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),i=[],a=0;a<r.kids.length;a++){var s=r.kids[a],o=e.clearkeys&&e.clearkeys.hasOwnProperty(s)?e.clearkeys[s]:null;if(!o)throw new Error("DRM: ClearKey keyID ("+s+") is not known!");i.push(new b(s,o))}n=new E(i)}return n}}}C.__dashjs_factory_name="KeySystemClearKey";var R=dashjs.FactoryMaker.getSingletonFactory(C),D="1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",x=S.CLEARKEY_KEYSTEM_STRING,N="urn:uuid:"+D;function O(e){var t=e.BASE64,n=e.debug.getLogger(undefined);return{uuid:D,schemeIdURI:N,systemString:x,getInitData:function(e){return i.parseInitDataFromContentProtection(e,t)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(e,t){var r=null;if(e){for(var i=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),a=[],s=0;s<i.kids.length;s++){var o=i.kids[s],u=e.clearkeys&&e.clearkeys.hasOwnProperty(o)?e.clearkeys[o]:null;if(!u)throw new Error("DRM: ClearKey keyID ("+o+") is not known!");a.push(new b(o,u))}r=new E(a),n.warn("ClearKey schemeIdURI is using W3C Common PSSH systemID (1077efec-c0b2-4d02-ace3-3c1e52e2fb4b) in Content Protection. See DASH-IF IOP v4.1 section 7.6.2.4")}return r}}}O.__dashjs_factory_name="KeySystemW3CClearKey";var P=dashjs.FactoryMaker.getSingletonFactory(O),M="edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",k=S.WIDEVINE_KEYSTEM_STRING,L="urn:uuid:"+M;function F(e){var t=(e=e||{}).BASE64;return{uuid:M,schemeIdURI:L,systemString:k,getInitData:function(e){return i.parseInitDataFromContentProtection(e,t)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null}}}F.__dashjs_factory_name="KeySystemWidevine";var U=dashjs.FactoryMaker.getSingletonFactory(F),B="9a04f079-9840-4286-ab92-e65be0885f95",j=S.PLAYREADY_KEYSTEM_STRING,q="urn:uuid:"+B;function H(e){var t="utf-16",n=(e=e||{}).BASE64,r=e.settings;function a(){if(!n||!n.hasOwnProperty("decodeArray")||!n.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}return{uuid:B,schemeIdURI:q,systemString:j,getInitData:function(e){var t,r,s,o,u,l=new Uint8Array([112,115,115,104,0,0,0,0]),c=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),d=0,f=null;if(a(),!e)return null;if("pssh"in e)return i.parseInitDataFromContentProtection(e,n);if("pro"in e)f=n.decodeArray(e.pro.__text);else{if(!("prheader"in e))return null;f=n.decodeArray(e.prheader.__text)}return t=f.length,r=4+l.length+c.length+4+t,s=new ArrayBuffer(r),o=new Uint8Array(s),(u=new DataView(s)).setUint32(d,r),d+=4,o.set(l,d),d+=l.length,o.set(c,d),d+=c.length,u.setUint32(d,t),d+=4,o.set(f,d),d+=t,o.buffer},getRequestHeadersFromMessage:function(e){var n,i,a={},s=new DOMParser;if(r&&r.get().streaming.protection.detectPlayreadyMessageFormat&&"utf-16"===t&&e&&e.byteLength%2==1)return a["Content-Type"]="text/xml; charset=utf-8",a;var o="utf-16"===t?new Uint16Array(e):new Uint8Array(e);n=String.fromCharCode.apply(null,o);for(var u=(i=s.parseFromString(n,"application/xml")).getElementsByTagName("name"),l=i.getElementsByTagName("value"),c=0;c<u.length;c++)a[u[c].childNodes[0].nodeValue]=l[c].childNodes[0].nodeValue;return a.hasOwnProperty("Content")&&(a["Content-Type"]=a.Content,delete a.Content),a.hasOwnProperty("Content-Type")||(a["Content-Type"]="text/xml; charset=utf-8"),a},getLicenseRequestFromMessage:function(e){var i=null,s=new DOMParser;if(r&&r.get().streaming.protection.detectPlayreadyMessageFormat&&"utf-16"===t&&e&&e.byteLength%2==1)return e;var o="utf-16"===t?new Uint16Array(e):new Uint8Array(e);a();var u=String.fromCharCode.apply(null,o),l=s.parseFromString(u,"application/xml");if(!l.getElementsByTagName("PlayReadyKeyMessage")[0])return e;var c=l.getElementsByTagName("Challenge")[0].childNodes[0].nodeValue;return c&&(i=n.decode(c)),i},getLicenseServerURLFromInitData:function(e){if(e)for(var t=new DataView(e),n=t.getUint16(4,!0),r=6,i=new DOMParser,a=0;a<n;a++){var s=t.getUint16(r,!0);r+=2;var o=t.getUint16(r,!0);if(r+=2,1===s){var u=e.slice(r,r+o),l=String.fromCharCode.apply(null,new Uint16Array(u)),c=i.parseFromString(l,"application/xml");if(c.getElementsByTagName("LA_URL")[0]){var d=c.getElementsByTagName("LA_URL")[0].childNodes[0].nodeValue;if(d)return d}if(c.getElementsByTagName("LUI_URL")[0]){var f=c.getElementsByTagName("LUI_URL")[0].childNodes[0].nodeValue;if(f)return f}}else r+=o}return null},getCDMData:function(e){var t,r,i,s;if(a(),!e)return null;for(t=[],s=0;s<e.length;++s)t.push(e.charCodeAt(s)),t.push(0);for(t=String.fromCharCode.apply(null,t),t=n.encode(t),r='<PlayReadyCDMData type="LicenseAcquisition"><LicenseAcquisition version="1.0" Proactive="false"><CustomData encoding="base64encoded">%CUSTOMDATA%</CustomData></LicenseAcquisition></PlayReadyCDMData>'.replace("%CUSTOMDATA%",t),i=[],s=0;s<r.length;++s)i.push(r.charCodeAt(s)),i.push(0);return new Uint8Array(i).buffer},setPlayReadyMessageFormat:function(e){if("utf-8"!==e&&"utf-16"!==e)throw new Error('Specified message format is not one of "utf-8" or "utf-16"');t=e}}}H.__dashjs_factory_name="KeySystemPlayReady";var G=dashjs.FactoryMaker.getSingletonFactory(H);function V(e){var t=(e=e||{}).BASE64,n={};return n[S.WIDEVINE_KEYSTEM_STRING]={responseType:"json",getLicenseMessage:function(e){return t.decodeArray(e.license)},getErrorResponse:function(e){return e}},n[S.PLAYREADY_KEYSTEM_STRING]={responseType:"arraybuffer",getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}},{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(e){return n[e].responseType},getLicenseMessage:function(e,r){return function(){if(!t||!t.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}(),n[r].getLicenseMessage(e)},getErrorResponse:function(e,t){return n[t].getErrorResponse(e)}}}V.__dashjs_factory_name="DRMToday";var Y=dashjs.FactoryMaker.getSingletonFactory(V);function z(){var e="http://schemas.xmlsoap.org/soap/envelope/";function t(e){var t=String.fromCharCode.apply(null,new Uint8Array(e));return decodeURIComponent(escape(t))}function n(n){if(window.DOMParser){var r=t(n),i=(new window.DOMParser).parseFromString(r,"text/xml"),a=i?i.getElementsByTagNameNS(e,"Envelope")[0]:null,s=a?a.getElementsByTagNameNS(e,"Body")[0]:null;if(s&&s.getElementsByTagNameNS(e,"Fault")[0])return null}return n}function r(n){var r="",i="",a="",s=-1,o=-1;if(window.DOMParser){var u=t(n),l=(new window.DOMParser).parseFromString(u,"text/xml"),c=l?l.getElementsByTagNameNS(e,"Envelope")[0]:null,d=c?c.getElementsByTagNameNS(e,"Body")[0]:null,f=d?d.getElementsByTagNameNS(e,"Fault")[0]:null,h=f?f.getElementsByTagName("detail")[0]:null,p=h?h.getElementsByTagName("Exception")[0]:null,g=null;if(null===f)return u;r=(g=f.getElementsByTagName("faultstring")[0].firstChild)?g.nodeValue:null,null!==p&&(i=(g=p.getElementsByTagName("StatusCode")[0])?g.firstChild.nodeValue:null,s=(a=(g=p.getElementsByTagName("Message")[0])?g.firstChild.nodeValue:null)?a.lastIndexOf("[")+1:-1,o=a?a.indexOf("]"):-1,a=a?a.substring(s,o):"")}var m="code: ".concat(i,", name: ").concat(r);return a&&(m+=", message: ".concat(a)),m}return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return n.call(this,e)},getErrorResponse:function(e){return r.call(this,e)}}}z.__dashjs_factory_name="PlayReady";var Z=y.Z.getSingletonFactory(z);function K(){return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}}}K.__dashjs_factory_name="Widevine";var W=dashjs.FactoryMaker.getSingletonFactory(K);function X(){return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"json"},getLicenseMessage:function(e){if(!e.hasOwnProperty("keys"))return null;for(var t=[],n=0;n<e.keys.length;n++){var r=e.keys[n],i=r.kid.replace(/=/g,""),a=r.k.replace(/=/g,"");t.push(new b(i,a))}return new E(t)},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}}}X.__dashjs_factory_name="ClearKey";var $=dashjs.FactoryMaker.getSingletonFactory(X);function Q(){var e,t,n,r,a,s,o,u,l=this.context;function c(e,t){return t&&e in t?t[e]:null}function d(e,t){return e&&e.sessionId?e.sessionId:t&&t.sessionId?t.sessionId:null}function f(e,t){return e&&e.sessionType?e.sessionType:t}return e={initialize:function(){var e;r=[],e=G(l).getInstance({BASE64:a,settings:s}),r.push(e),e=U(l).getInstance({BASE64:a}),r.push(e),e=R(l).getInstance({BASE64:a}),r.push(e),o=e,e=P(l).getInstance({BASE64:a,debug:t}),r.push(e),u=e},setProtectionData:function(e){for(var t,n,i=0;i<r.length;i++){var a=r[i];a.hasOwnProperty("init")&&a.init((t=a.systemString,n=void 0,n=null,e&&(n=t in e?e[t]:null),n))}},isClearKey:function(e){return e===o||e===u},initDataEquals:function(e,t){if(e.byteLength===t.byteLength){for(var n=new Uint8Array(e),r=new Uint8Array(t),i=0;i<n.length;i++)if(n[i]!==r[i])return!1;return!0}return!1},getKeySystems:function(){return r},setKeySystems:function(e){r=e},getKeySystemBySystemString:function(e){for(var t=0;t<r.length;t++)if(r[t].systemString===e)return r[t];return null},getSupportedKeySystemsFromContentProtection:function(e,t,n){var a,s,o,u,l=[];if(e){var h=i.findCencContentProtection(e);for(o=0;o<r.length;++o){var p=c((s=r[o]).systemString,t);for(u=0;u<e.length;++u)if((a=e[u]).schemeIdUri.toLowerCase()===s.schemeIdURI){var g=s.getInitData(a,h);l.push({ks:r[o],keyId:a.keyId,initData:g,protData:p,cdmData:s.getCDMData(p?p.cdmData:null),sessionId:d(p,a),sessionType:f(p,n)})}}}return l},getSupportedKeySystemsFromSegmentPssh:function(e,t,n){for(var a,s=[],o=i.parsePSSHList(e),u=0;u<r.length;++u){var l=c((a=r[u]).systemString,t);a.uuid in o&&s.push({ks:a,initData:o[a.uuid],protData:l,cdmData:a.getCDMData(l?l.cdmData:null),sessionId:d(l),sessionType:f(l,n)})}return s},getLicenseServerModelInstance:function(e,t,n){if("license-release"===n||"individualization-request"===n)return null;var r=null;return t&&t.hasOwnProperty("drmtoday")?r=Y(l).getInstance({BASE64:a}):e.systemString===S.WIDEVINE_KEYSTEM_STRING?r=W(l).getInstance():e.systemString===S.PLAYREADY_KEYSTEM_STRING?r=Z(l).getInstance():e.systemString===S.CLEARKEY_KEYSTEM_STRING&&(r=$(l).getInstance()),r},processClearKeyLicenseRequest:function(e,t,r){try{return e.getClearKeysFromProtectionData(t,r)}catch(e){return n.error("Failed to retrieve clearkeys from ProtectionData"),null}},setConfig:function(r){r&&(r.debug&&(t=r.debug,n=t.getLogger(e)),r.BASE64&&(a=r.BASE64),r.settings&&(s=r.settings))}},e}Q.__dashjs_factory_name="ProtectionKeyController";var J=dashjs.FactoryMaker.getSingletonFactory(Q);function ee(e){return ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ee(e)}function te(e,t){return te=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},te(e,t)}function ne(e){return ne=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ne(e)}var re=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&te(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=ne(t);if(n){var i=ne(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==ee(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(e=r.call(this)).INTERNAL_KEY_MESSAGE="internalKeyMessage",e.INTERNAL_KEY_STATUS_CHANGED="internalkeyStatusChanged",e.KEY_ADDED="public_keyAdded",e.KEY_ERROR="public_keyError",e.KEY_MESSAGE="public_keyMessage",e.KEY_SESSION_CLOSED="public_keySessionClosed",e.KEY_SESSION_CREATED="public_keySessionCreated",e.KEY_SESSION_REMOVED="public_keySessionRemoved",e.KEY_STATUSES_CHANGED="public_keyStatusesChanged",e.KEY_SYSTEM_ACCESS_COMPLETE="public_keySystemAccessComplete",e.KEY_SYSTEM_SELECTED="public_keySystemSelected",e.LICENSE_REQUEST_COMPLETE="public_licenseRequestComplete",e.LICENSE_REQUEST_SENDING="public_licenseRequestSending",e.NEED_KEY="needkey",e.PROTECTION_CREATED="public_protectioncreated",e.PROTECTION_DESTROYED="public_protectiondestroyed",e.SERVER_CERTIFICATE_UPDATED="serverCertificateUpdated",e.TEARDOWN_COMPLETE="protectionTeardownComplete",e.VIDEO_ELEMENT_SELECTED="videoElementSelected",e.KEY_SESSION_UPDATED="public_keySessionUpdated",e}return i}(n(8342).Z)),ie=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initData=t,this.initDataType=n},ae=function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sessionToken=t,this.message=n,this.defaultURL=r,this.messageType=i||"license-request"},se=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keySystem=t,this.ksConfiguration=n},oe={};function ue(e){e=e||{};var t,n,r,i,a,s,o,u,l=this.context,f=e.eventBus,h=e.events,p=e.debug;function g(e,t,n,r){if(void 0===navigator.requestMediaKeySystemAccess||"function"!=typeof navigator.requestMediaKeySystemAccess){var i="Insecure origins are not allowed";return f.trigger(h.KEY_SYSTEM_ACCESS_COMPLETE,{error:i}),void r({error:i})}var a=e[t].protData&&e[t].protData.systemStringPriority?e[t].protData.systemStringPriority:null,s=e[t].configs,o=e[t].ks,u=o.systemString;(function(e,t){return new Promise((function(n,r){m(e,t,0,n,r)}))})(a||(oe[u]?oe[u]:[u]),s).then((function(e){var t="function"==typeof e.getConfiguration?e.getConfiguration():null,r=new se(o,t);r.mksa=e,f.trigger(h.KEY_SYSTEM_ACCESS_COMPLETE,{data:r}),n({data:r})})).catch((function(i){if(t+1<e.length)g(e,t+1,n,r);else{var a="Key system access denied! ";f.trigger(h.KEY_SYSTEM_ACCESS_COMPLETE,{error:a+i.message}),r({error:a+i.message})}}))}function m(e,t,r,i,a){var s=e[r];n.debug("Requesting key system access for system string ".concat(s)),navigator.requestMediaKeySystemAccess(s,t).then((function(e){e.selectedSystemString=s,i(e)})).catch((function(n){r+1<e.length?m(e,t,r+1,i,a):a(n)}))}function y(e){if(!e||!e.session)return Promise.resolve;var t=e.session;return t.removeEventListener("keystatuseschange",e),t.removeEventListener("message",e),t.close()}function v(e){for(var t=0;t<s.length;t++)if(s[t]===e){s.splice(t,1);break}}function _(e){var t,n;return e&&e.length>0&&(e[0]&&("string"==typeof e[0]?t=e[0]:n=e[0]),e[1]&&("string"==typeof e[1]?t=e[1]:n=e[1])),{status:t,keyId:n}}function T(e,t){var r={session:e,keyId:t.keyId,initData:t.initData,sessionId:t.sessionId,sessionType:t.sessionType,handleEvent:function(e){switch(e.type){case"keystatuseschange":f.trigger(h.KEY_STATUSES_CHANGED,{data:this}),e.target.keyStatuses.forEach((function(){var e=_(arguments);"expired"===e.status?f.trigger(h.INTERNAL_KEY_STATUS_CHANGED,{error:new d.Z(c.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE,c.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE)}):f.trigger(h.INTERNAL_KEY_STATUS_CHANGED,e)}));break;case"message":var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;f.trigger(h.INTERNAL_KEY_MESSAGE,{data:new ae(this,t,void 0,e.messageType)})}},getKeyId:function(){return this.keyId},getSessionId:function(){return e.sessionId},getSessionType:function(){return this.sessionType},getExpirationTime:function(){return e.expiration},getKeyStatuses:function(){return e.keyStatuses},getUsable:function(){var t=!1;return e.keyStatuses.forEach((function(){"usable"===_(arguments).status&&(t=!0)})),t}};return e.addEventListener("keystatuseschange",r),e.addEventListener("message",r),e.closed.then((function(){v(r),n.debug("DRM: Session closed. SessionID = "+r.getSessionId()),f.trigger(h.KEY_SESSION_CLOSED,{data:r.getSessionId()})})),s.push(r),r}return t={getAllInitData:function(){for(var e=[],t=0;t<s.length;t++)s[t].initData&&e.push(s[t].initData);return e},getSessions:function(){return s},requestKeySystemAccess:function(e){return new Promise((function(t,n){g(e,0,t,n)}))},selectKeySystem:function(e){return new Promise((function(t,n){e.mksa.createMediaKeys().then((function(t){return r=e.keySystem,a=t,i?i.setMediaKeys(a):Promise.resolve()})).then((function(){t(r)})).catch((function(){n({error:"Error selecting keys system ("+e.keySystem.systemString+")! Could not create MediaKeys -- TODO"})}))}))},setMediaElement:function(e){i!==e&&(i&&(i.removeEventListener("encrypted",o),i.setMediaKeys&&i.setMediaKeys(null)),(i=e)&&(i.addEventListener("encrypted",o),i.setMediaKeys&&a&&i.setMediaKeys(a)))},setServerCertificate:function(e){if(!r||!a)throw new Error("Can not set server certificate until you have selected a key system");a.setServerCertificate(e).then((function(){n.info("DRM: License server certificate successfully updated."),f.trigger(h.SERVER_CERTIFICATE_UPDATED)})).catch((function(e){f.trigger(h.SERVER_CERTIFICATE_UPDATED,{error:new d.Z(c.SERVER_CERTIFICATE_UPDATED_ERROR_CODE,c.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE+e.name)})}))},createKeySession:function(e){if(!r||!a)throw new Error("Can not create sessions until you have selected a key system");var t=a.createSession(e.sessionType),i=T(t,e),s=r.systemString===S.CLEARKEY_KEYSTEM_STRING&&(e.initData||e.protData&&e.protData.clearkeys)?S.INITIALIZATION_DATA_TYPE_KEYIDS:S.INITIALIZATION_DATA_TYPE_CENC;t.generateRequest(s,e.initData).then((function(){n.debug("DRM: Session created. SessionID = "+i.getSessionId()),f.trigger(h.KEY_SESSION_CREATED,{data:i})})).catch((function(e){v(i),f.trigger(h.KEY_SESSION_CREATED,{data:null,error:new d.Z(c.KEY_SESSION_CREATED_ERROR_CODE,c.KEY_SESSION_CREATED_ERROR_MESSAGE+"Error generating key request -- "+e.name)})}))},updateKeySession:function(e,t){var n=e.session;u.isClearKey(r)&&(t=t.toJWK()),n.update(t).then((function(){f.trigger(h.KEY_SESSION_UPDATED)})).catch((function(t){f.trigger(h.KEY_ERROR,{error:new d.Z(c.MEDIA_KEYERR_CODE,"Error sending update() message! "+t.name,e)})}))},loadKeySession:function(e){if(!r||!a)throw new Error("Can not load sessions until you have selected a key system");for(var t=e.sessionId,i=0;i<s.length;i++)if(t===s[i].sessionId)return void n.warn("DRM: Ignoring session ID because we have already seen it!");var o=a.createSession(e.sessionType),u=T(o,e);o.load(t).then((function(e){e?(n.debug("DRM: Session loaded. SessionID = "+u.getSessionId()),f.trigger(h.KEY_SESSION_CREATED,{data:u})):(v(u),f.trigger(h.KEY_SESSION_CREATED,{data:null,error:new d.Z(c.KEY_SESSION_CREATED_ERROR_CODE,c.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session! Invalid Session ID ("+t+")")}))})).catch((function(e){v(u),f.trigger(h.KEY_SESSION_CREATED,{data:null,error:new d.Z(c.KEY_SESSION_CREATED_ERROR_CODE,c.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session ("+t+")! "+e.name)})}))},removeKeySession:function(e){e.session.remove().then((function(){n.debug("DRM: Session removed. SessionID = "+e.getSessionId()),f.trigger(h.KEY_SESSION_REMOVED,{data:e.getSessionId()})}),(function(t){f.trigger(h.KEY_SESSION_REMOVED,{data:null,error:"Error removing session ("+e.getSessionId()+"). "+t.name})}))},closeKeySession:function(e){y(e).catch((function(t){v(e),f.trigger(h.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.getSessionId()+") "+t.name})}))},stop:function(){for(var e,t=0;t<s.length;t++)(e=s[t]).getUsable()||(y(e),v(e))},reset:function(){var e,t=s.length;0!==t?function(){for(var n=function(e){v(e),0===s.length&&(i?(i.removeEventListener("encrypted",o),i.setMediaKeys(null).then((function(){f.trigger(h.TEARDOWN_COMPLETE)}))):f.trigger(h.TEARDOWN_COMPLETE))},r=0;r<t;r++)!function(t){y(e),n(t)}(e=s[r])}():f.trigger(h.TEARDOWN_COMPLETE)}},n=p.getLogger(t),r=null,i=null,a=null,s=[],u=J(l).getInstance(),o={handleEvent:function(e){if("encrypted"===e.type&&e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;f.trigger(h.NEED_KEY,{key:new ie(t,e.initDataType)})}}},t}oe[S.PLAYREADY_KEYSTEM_STRING]=[S.PLAYREADY_KEYSTEM_STRING,S.PLAYREADY_RECOMMENDATION_KEYSTEM_STRING],oe[S.WIDEVINE_KEYSTEM_STRING]=[S.WIDEVINE_KEYSTEM_STRING],oe[S.CLEARKEY_KEYSTEM_STRING]=[S.CLEARKEY_KEYSTEM_STRING],ue.__dashjs_factory_name="ProtectionModel_21Jan2015";var le=dashjs.FactoryMaker.getClassFactory(ue);function ce(e){e=e||{};var t,n,r,i,a,o,u,l,f,h=this.context,p=e.eventBus,g=e.events,m=e.debug,y=e.api;function v(){try{for(var e=0;e<u.length;e++)_(u[e]);r&&r.removeEventListener(y.needkey,l),p.trigger(g.TEARDOWN_COMPLETE)}catch(e){p.trigger(g.TEARDOWN_COMPLETE,{error:"Error tearing down key sessions and MediaKeys! -- "+e.message})}}function _(e){var t=e.session;t.removeEventListener(y.error,e),t.removeEventListener(y.message,e),t.removeEventListener(y.ready,e),t.removeEventListener(y.close,e);for(var n=0;n<u.length;n++)if(u[n]===e){u.splice(n,1);break}t[y.release]()}function T(){var e=null,t=function(){r.removeEventListener("loadedmetadata",e),r[y.setMediaKeys](a),p.trigger(g.VIDEO_ELEMENT_SELECTED)};r.readyState>=1?t():(e=t.bind(this),r.addEventListener("loadedmetadata",e))}return t={getAllInitData:function(){for(var e=[],t=0;t<u.length;t++)e.push(u[t].initData);return e},getSessions:function(){return u},requestKeySystemAccess:function(e){return new Promise((function(t,n){for(var r=!1,i=0;i<e.length;i++)for(var a=e[i].ks.systemString,o=e[i].configs,u=null,l=null,c=0;c<o.length;c++){var d=o[c].audioCapabilities,h=o[c].videoCapabilities;if(d&&0!==d.length){u=[];for(var m=0;m<d.length;m++)window[y.MediaKeys].isTypeSupported(a,d[m].contentType)&&u.push(d[m])}if(h&&0!==h.length){l=[];for(var v=0;v<h.length;v++)window[y.MediaKeys].isTypeSupported(a,h[v].contentType)&&l.push(h[v])}if(!(!u&&!l||u&&0===u.length||l&&0===l.length)){r=!0;var _=new s(u,l),T=f.getKeySystemBySystemString(a),b=new se(T,_);p.trigger(g.KEY_SYSTEM_ACCESS_COMPLETE,{data:b}),t({data:b});break}}if(!r){var E="Key system access denied! -- No valid audio/video content configurations detected!";p.trigger(g.KEY_SYSTEM_ACCESS_COMPLETE,{error:E}),n({error:E})}}))},selectKeySystem:function(e){return new Promise((function(t,n){try{a=e.mediaKeys=new window[y.MediaKeys](e.keySystem.systemString),i=e.keySystem,o=e,r&&T(),t(i)}catch(e){n({error:"Error selecting keys system ("+i.systemString+")! Could not create MediaKeys -- TODO"})}}))},setMediaElement:function(e){r!==e&&(r&&r.removeEventListener(y.needkey,l),(r=e)&&(r.addEventListener(y.needkey,l),a&&T()))},createKeySession:function(e){if(!i||!a||!o)throw new Error("Can not create sessions until you have selected a key system");var t=null;if(o.ksConfiguration.videoCapabilities&&o.ksConfiguration.videoCapabilities.length>0&&(t=o.ksConfiguration.videoCapabilities[0]),null===t&&o.ksConfiguration.audioCapabilities&&o.ksConfiguration.audioCapabilities.length>0&&(t=o.ksConfiguration.audioCapabilities[0]),null===t)throw new Error("Can not create sessions for unknown content types.");var r=t.contentType,s=a.createSession(r,new Uint8Array(e.initData),e.cdmData?new Uint8Array(e.cdmData):null),l=function(e,t){return{session:e,keyId:t.keyId,initData:t.initData,getKeyId:function(){return this.keyId},getSessionId:function(){return this.session.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"},handleEvent:function(e){switch(e.type){case y.error:p.trigger(g.KEY_ERROR,{error:new d.Z(c.MEDIA_KEYERR_CODE,"KeyError",this)});break;case y.message:var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;p.trigger(g.INTERNAL_KEY_MESSAGE,{data:new ae(this,t,e.destinationURL)});break;case y.ready:n.debug("DRM: Key added."),p.trigger(g.KEY_ADDED);break;case y.close:n.debug("DRM: Session closed. SessionID = "+this.getSessionId()),p.trigger(g.KEY_SESSION_CLOSED,{data:this.getSessionId()})}}}}(s,e);s.addEventListener(y.error,l),s.addEventListener(y.message,l),s.addEventListener(y.ready,l),s.addEventListener(y.close,l),u.push(l),n.debug("DRM: Session created. SessionID = "+l.getSessionId()),p.trigger(g.KEY_SESSION_CREATED,{data:l})},updateKeySession:function(e,t){var n=e.session;f.isClearKey(i)?n.update(new Uint8Array(t.toJWK())):n.update(new Uint8Array(t)),p.trigger(g.KEY_SESSION_UPDATED)},closeKeySession:_,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:v,reset:v},n=m.getLogger(t),r=null,i=null,a=null,o=null,u=[],f=J(h).getInstance(),l={handleEvent:function(e){if(e.type===y.needkey&&e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;p.trigger(g.NEED_KEY,{key:new ie(t,"cenc")})}}},t}ce.__dashjs_factory_name="ProtectionModel_3Feb2014";var de=dashjs.FactoryMaker.getClassFactory(ce);function fe(e){e=e||{};var t,n,r,i,a,o,u,l,f,h=this.context,p=e.eventBus,g=e.events,m=e.debug,y=e.api,v=e.errHandler;function _(){r&&E();for(var e=0;e<u.length;e++)T(u[e]);p.trigger(g.TEARDOWN_COMPLETE)}function T(e){try{r[y.cancelKeyRequest](i.systemString,e.sessionId)}catch(t){p.trigger(g.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.sessionId+") "+t.message})}}function b(e,t){if(t&&e){for(var n=e.length,r=0;r<n;r++)if(e[r].sessionId==t)return e[r];return null}return null}function E(){r.removeEventListener(y.keyerror,f),r.removeEventListener(y.needkey,f),r.removeEventListener(y.keymessage,f),r.removeEventListener(y.keyadded,f)}return t={getAllInitData:function(){for(var e=[],t=0;t<o.length;t++)e.push(o[t].initData);for(var n=0;n<u.length;n++)e.push(u[n].initData);return e},getSessions:function(){return u.concat(o)},requestKeySystemAccess:function(e){return new Promise((function(t,n){var i=r;i||(i=document.createElement("video"));for(var o=!1,u=0;u<e.length;u++)for(var l=e[u].ks.systemString,c=e[u].configs,d=null,f=0;f<c.length;f++){var h=c[f].videoCapabilities;if(h&&0!==h.length){d=[];for(var m=0;m<h.length;m++)""!==i.canPlayType(h[m].contentType,l)&&d.push(h[m])}if(d&&(!d||0!==d.length)){o=!0;var y=new s(null,d),v=a.getKeySystemBySystemString(l),_=new se(v,y);p.trigger(g.KEY_SYSTEM_ACCESS_COMPLETE,{data:_}),t({data:_});break}}if(!o){var T="Key system access denied! -- No valid audio/video content configurations detected!";p.trigger(g.KEY_SYSTEM_ACCESS_COMPLETE,{error:T}),n({error:T})}}))},selectKeySystem:function(e){return i=e.keySystem,Promise.resolve(i)},setMediaElement:function(e){if(r!==e){if(r){E();for(var t=0;t<u.length;t++)T(u[t]);u=[]}(r=e)&&(r.addEventListener(y.keyerror,f),r.addEventListener(y.needkey,f),r.addEventListener(y.keymessage,f),r.addEventListener(y.keyadded,f),p.trigger(g.VIDEO_ELEMENT_SELECTED))}},createKeySession:function(e){if(!i)throw new Error("Can not create sessions until you have selected a key system");if(l||0===u.length){var t={sessionId:null,keyId:e.keyId,initData:e.initData,getKeyId:function(){return this.keyId},getSessionId:function(){return this.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"}};return o.push(t),r[y.generateKeyRequest](i.systemString,new Uint8Array(e.initData)),t}throw new Error("Multiple sessions not allowed!")},updateKeySession:function(e,t){var n=e.sessionId;if(a.isClearKey(i))for(var s=0;s<t.keyPairs.length;s++)r[y.addKey](i.systemString,t.keyPairs[s].key,t.keyPairs[s].keyID,n);else r[y.addKey](i.systemString,new Uint8Array(t),new Uint8Array(e.initData),n);p.trigger(g.KEY_SESSION_UPDATED)},closeKeySession:T,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:_,reset:_},n=m.getLogger(t),r=null,i=null,o=[],u=[],a=J(h).getInstance(),f={handleEvent:function(e){var t=null;switch(e.type){case y.needkey:var r=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;p.trigger(g.NEED_KEY,{key:new ie(r,"cenc")});break;case y.keyerror:if((t=b(u,e.sessionId))||(t=b(o,e.sessionId)),t){var i=c.MEDIA_KEYERR_CODE,a="";switch(e.errorCode.code){case 1:i=c.MEDIA_KEYERR_UNKNOWN_CODE,a+="MEDIA_KEYERR_UNKNOWN - "+c.MEDIA_KEYERR_UNKNOWN_MESSAGE;break;case 2:i=c.MEDIA_KEYERR_CLIENT_CODE,a+="MEDIA_KEYERR_CLIENT - "+c.MEDIA_KEYERR_CLIENT_MESSAGE;break;case 3:i=c.MEDIA_KEYERR_SERVICE_CODE,a+="MEDIA_KEYERR_SERVICE - "+c.MEDIA_KEYERR_SERVICE_MESSAGE;break;case 4:i=c.MEDIA_KEYERR_OUTPUT_CODE,a+="MEDIA_KEYERR_OUTPUT - "+c.MEDIA_KEYERR_OUTPUT_MESSAGE;break;case 5:i=c.MEDIA_KEYERR_HARDWARECHANGE_CODE,a+="MEDIA_KEYERR_HARDWARECHANGE - "+c.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE;break;case 6:i=c.MEDIA_KEYERR_DOMAIN_CODE,a+="MEDIA_KEYERR_DOMAIN - "+c.MEDIA_KEYERR_DOMAIN_MESSAGE}a+=" System Code = "+e.systemCode,p.trigger(g.KEY_ERROR,{error:new d.Z(i,a,t)})}else n.error("No session token found for key error");break;case y.keyadded:(t=b(u,e.sessionId))||(t=b(o,e.sessionId)),t?(n.debug("DRM: Key added."),p.trigger(g.KEY_ADDED,{data:t})):n.debug("No session token found for key added");break;case y.keymessage:if((l=null!==e.sessionId&&void 0!==e.sessionId)?!(t=b(u,e.sessionId))&&o.length>0&&(t=o.shift(),u.push(t),t.sessionId=e.sessionId,p.trigger(g.KEY_SESSION_CREATED,{data:t})):o.length>0&&(t=o.shift(),u.push(t),0!==o.length&&v.error(new d.Z(c.MEDIA_KEY_MESSAGE_ERROR_CODE,c.MEDIA_KEY_MESSAGE_ERROR_MESSAGE))),t){var s=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;t.keyMessage=s,p.trigger(g.INTERNAL_KEY_MESSAGE,{data:new ae(t,s,e.defaultURL)})}else n.warn("No session token found for key message")}}},t}fe.__dashjs_factory_name="ProtectionModel_01b";var he=dashjs.FactoryMaker.getClassFactory(fe),pe=[{generateKeyRequest:"generateKeyRequest",addKey:"addKey",cancelKeyRequest:"cancelKeyRequest",needkey:"needkey",keyerror:"keyerror",keyadded:"keyadded",keymessage:"keymessage"},{generateKeyRequest:"webkitGenerateKeyRequest",addKey:"webkitAddKey",cancelKeyRequest:"webkitCancelKeyRequest",needkey:"webkitneedkey",keyerror:"webkitkeyerror",keyadded:"webkitkeyadded",keymessage:"webkitkeymessage"}],ge=[{setMediaKeys:"setMediaKeys",MediaKeys:"MediaKeys",release:"close",needkey:"needkey",error:"keyerror",message:"keymessage",ready:"keyadded",close:"keyclose"},{setMediaKeys:"msSetMediaKeys",MediaKeys:"MSMediaKeys",release:"close",needkey:"msneedkey",error:"mskeyerror",message:"mskeymessage",ready:"mskeyadded",close:"mskeyclose"}];function me(){var e,t=this.context;function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];if("function"==typeof e[r[Object.keys(r)[0]]])return r}return null}return e={createProtectionSystem:function(r){var i=null,a=J(t).getInstance();a.setConfig({debug:r.debug,BASE64:r.BASE64,settings:r.settings}),a.initialize();var s=function(r){var i=r.debug,a=i.getLogger(e),s=r.eventBus,o=r.errHandler,u=r.videoModel?r.videoModel.getElement():null;return u&&void 0===u.onencrypted||u&&void 0===u.mediaKeys?n(u,ge)?(a.info("EME detected on this user agent! (ProtectionModel_3Feb2014)"),de(t).create({debug:i,eventBus:s,events:r.events,api:n(u,ge)})):n(u,pe)?(a.info("EME detected on this user agent! (ProtectionModel_01b)"),he(t).create({debug:i,eventBus:s,errHandler:o,events:r.events,api:n(u,pe)})):(a.warn("No supported version of EME detected on this user agent! - Attempts to play encrypted content will fail!"),null):(a.info("EME detected on this user agent! (ProtectionModel_21Jan2015)"),le(t).create({debug:i,eventBus:s,events:r.events}))}(r);return!i&&s&&(i=T(t).create({protectionModel:s,protectionKeyController:a,eventBus:r.eventBus,debug:r.debug,events:r.events,BASE64:r.BASE64,constants:r.constants,cmcdModel:r.cmcdModel,customParametersModel:r.customParametersModel,settings:r.settings}),r.capabilities.setEncryptedMediaSupported(!0)),i}}}me.__dashjs_factory_name="Protection";var ye=dashjs.FactoryMaker.getClassFactory(me);ye.events=re,ye.errors=c,dashjs.FactoryMaker.updateClassFactory(me.__dashjs_factory_name,ye);var ve=ye},2068:function(e,t,n){"use strict";var r=n(5448),i={DEFAULT:.5,STRONG:1,WEAK:0};function a(e,t,n){var r,a;return r=void 0===e?-1:e,a=function(e){var t=i.DEFAULT;return e!==i.DEFAULT&&e!==i.STRONG&&e!==i.WEAK||(t=e),t}(n),{quality:r,reason:void 0===t?null:t,priority:a}}a.__dashjs_factory_name="SwitchRequest";var s=r.Z.getClassFactory(a);s.NO_CHANGE=-1,s.PRIORITY=i,r.Z.updateClassFactory(a.__dashjs_factory_name,s),t.Z=s},1767:function(e,t,n){"use strict";var r=n(5628),i=n(6535),a=n(7423),s=n(895),o=n(6070),u=n(3112),l=n(1914),c=n(5435),d=n(5448),f=n(2068),h=n(3393),p="qualitySwitchRules",g="abandonFragmentRules";function m(e){e=e||{};var t,n,d=this.context,m=e.mediaPlayerModel,y=e.customParametersModel,v=e.dashMetrics,_=e.settings;function T(e){return e.filter((function(e){return e.quality>f.Z.NO_CHANGE}))}function b(e){var t,n,r,i,a,s={},o=null;if(0!==e.length){for(s[f.Z.PRIORITY.STRONG]={quality:f.Z.NO_CHANGE,reason:null},s[f.Z.PRIORITY.WEAK]={quality:f.Z.NO_CHANGE,reason:null},s[f.Z.PRIORITY.DEFAULT]={quality:f.Z.NO_CHANGE,reason:null},t=0,n=e.length;t<n;t+=1)(r=e[t]).quality!==f.Z.NO_CHANGE&&(s[r.priority].quality===f.Z.NO_CHANGE||s[r.priority].quality>r.quality)&&(s[r.priority].quality=r.quality,s[r.priority].reason=r.reason||null);return s[f.Z.PRIORITY.WEAK].quality!==f.Z.NO_CHANGE&&(o=s[f.Z.PRIORITY.WEAK]),s[f.Z.PRIORITY.DEFAULT].quality!==f.Z.NO_CHANGE&&(o=s[f.Z.PRIORITY.DEFAULT]),s[f.Z.PRIORITY.STRONG].quality!==f.Z.NO_CHANGE&&(o=s[f.Z.PRIORITY.STRONG]),o&&(i=o.quality,a=o.reason),(0,f.Z)(d).create(i,a)}}return{initialize:function(){t=[],n=[],_.get().streaming.abr.useDefaultABRRules&&(_.get().streaming.abr.ABRStrategy===h.Z.ABR_STRATEGY_L2A?t.push((0,l.Z)(d).create({dashMetrics:v,settings:_})):_.get().streaming.abr.ABRStrategy===h.Z.ABR_STRATEGY_LoLP?t.push((0,c.Z)(d).create({dashMetrics:v})):(t.push((0,u.Z)(d).create({dashMetrics:v,mediaPlayerModel:m,settings:_})),t.push((0,r.Z)(d).create({dashMetrics:v})),_.get().streaming.abr.additionalAbrRules.insufficientBufferRule&&t.push((0,i.Z)(d).create({dashMetrics:v,settings:_})),_.get().streaming.abr.additionalAbrRules.switchHistoryRule&&t.push((0,o.Z)(d).create()),_.get().streaming.abr.additionalAbrRules.droppedFramesRule&&t.push((0,s.Z)(d).create()),_.get().streaming.abr.additionalAbrRules.abandonRequestsRule&&n.push((0,a.Z)(d).create({dashMetrics:v,mediaPlayerModel:m,settings:_})))),y.getAbrCustomRules().forEach((function(e){e.type===p&&t.push(e.rule(d).create()),e.type===g&&n.push(e.rule(d).create())}))},reset:function(){[t,n].forEach((function(e){e&&e.length&&e.forEach((function(e){return e.reset&&e.reset()}))})),t=[],n=[]},getMaxQuality:function(e){return b(T(t.map((function(t){return t.getMaxIndex(e)}))))||(0,f.Z)(d).create()},getMinSwitchRequest:b,shouldAbandonFragment:function(e,t){var r=b(T(n.map((function(n){return n.shouldAbandon(e,t)}))));return r&&(r.reason.forceAbandon=!0),r||(0,f.Z)(d).create()},getQualitySwitchRules:function(){return t}}}m.__dashjs_factory_name="ABRRulesCollection";var y=d.Z.getClassFactory(m);y.QUALITY_SWITCH_RULES=p,y.ABANDON_FRAGMENT_RULES=g,d.Z.updateSingletonFactory(m.__dashjs_factory_name,y),t.Z=y},7423:function(e,t,n){"use strict";var r=n(2068),i=n(5448),a=n(6398);function s(e){e=e||{};var t,n,i,o,u,l=this.context,c=e.mediaPlayerModel,d=e.dashMetrics,f=e.settings;function h(){i={},o={},u=[]}return t={shouldAbandon:function(e){var t=(0,r.Z)(l).create(r.Z.NO_CHANGE,{name:s.__dashjs_factory_name});if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getCurrentRequest")&&e.hasOwnProperty("getRepresentationInfo")&&e.hasOwnProperty("getAbrController")))return t;var a,h,p=e.getMediaInfo(),g=e.getMediaType(),m=e.getStreamInfo(),y=m?m.id:null,v=e.getCurrentRequest();if(!isNaN(v.index)){a=g,h=v.index,i[a]=i[a]||{},i[a][h]=i[a][h]||{};var _=c.getStableBufferTime();if(d.getCurrentBufferLevel(g)>_)return t;var T=i[g][v.index];if(null===T||null===v.firstByteDate||o.hasOwnProperty(T.id))return t;if(void 0===T.firstByteTime&&(u[g]=[],T.firstByteTime=v.firstByteDate.getTime(),T.segmentDuration=v.duration,T.bytesTotal=v.bytesTotal,T.id=v.index),T.bytesLoaded=v.bytesLoaded,T.elapsedTime=(new Date).getTime()-T.firstByteTime,T.bytesLoaded>0&&T.elapsedTime>0&&function(e,t){u[e]=u[e]||[],u[e].push(t)}(g,Math.round(8*T.bytesLoaded/T.elapsedTime)),u[g].length>=f.get().streaming.abr.abrRulesParameters.abandonRequestsRule.minLengthToAverage&&T.elapsedTime>f.get().streaming.abr.abrRulesParameters.abandonRequestsRule.graceTimeThreshold&&T.bytesLoaded<T.bytesTotal){var b=u[g].reduce((function(e,t){return e+t}),0);if(T.measuredBandwidthInKbps=Math.round(b/u[g].length),T.estimatedTimeOfDownload=+(8*T.bytesTotal/T.measuredBandwidthInKbps/1e3).toFixed(2),T.estimatedTimeOfDownload<T.segmentDuration*f.get().streaming.abr.abrRulesParameters.abandonRequestsRule.abandonMultiplier||0===e.getRepresentationInfo().quality)return t;if(!o.hasOwnProperty(T.id)){var E=e.getAbrController(),S=T.bytesTotal-T.bytesLoaded,w=E.getBitrateList(p),A=E.getQualityForBitrate(p,T.measuredBandwidthInKbps*f.get().streaming.abr.bandwidthSafetyFactor,y),I=E.getMinAllowedIndexFor(g,y),C=void 0!==I?Math.max(I,A):A;S>T.bytesTotal*w[C].bitrate/w[E.getQualityFor(g,y)].bitrate&&(t.quality=C,t.reason.throughput=T.measuredBandwidthInKbps,t.reason.fragmentID=T.id,t.reason.rule=this.getClassName(),o[T.id]=T,n.debug("["+g+"] frag id",T.id," is asking to abandon and switch to quality to ",C," measured bandwidth was",T.measuredBandwidthInKbps),delete i[g][T.id])}}else T.bytesLoaded===T.bytesTotal&&delete i[g][T.id]}return t},reset:h},n=(0,a.Z)(l).getInstance().getLogger(t),h(),t}s.__dashjs_factory_name="AbandonRequestsRule",t.Z=i.Z.getClassFactory(s)},3112:function(e,t,n){"use strict";var r=n(3860),i=n(2068),a=n(5448),s=n(7855),o=n(5595),u=n(8512),l=n(6398),c=n(8825),d=n(3393),f=10;function h(e){e=e||{};var t,n,a,h=this.context,p=e.dashMetrics,g=e.mediaPlayerModel,m=(0,o.Z)(h).getInstance();function y(e,t,n){var r=n.reduce((function(e,t,r){return t>n[e]?r:e}),0);if(0===r)return null;var i=Math.max(e,f+2*t.length),a=(n[r]-1)/(i/f-1);return{gp:a,Vp:f/a}}function v(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function _(e,t){var n=g.getStableBufferTime();if(e.stableBufferTime!==n){var r=y(n,e.bitrates,e.utilities);if(r.Vp!==e.Vp||r.gp!==e.gp){var i=p.getCurrentBufferLevel(t),a=i+e.placeholderBuffer;a-=f,a*=r.Vp/e.Vp,a+=f,e.stableBufferTime=n,e.Vp=r.Vp,e.gp=r.gp,e.placeholderBuffer=Math.max(0,a-i)}}}function T(e,t){return e.Vp*(e.utilities[t]+e.gp)}function b(e,t){for(var n=e.bitrates[t],r=e.utilities[t],i=0,a=t-1;a>=0;--a)if(e.utilities[a]<e.utilities[t]){var s=e.bitrates[a],o=e.utilities[a],u=e.Vp*(e.gp+(n*o-s*r)/(n-s));i=Math.max(i,u)}return i}function E(e){var t=e.mediaType===d.Z.AUDIO?[d.Z.AUDIO]:a;for(var n in t)a.hasOwnProperty(n)&&2===a[n].state&&(a[n].placeholderBuffer=0)}function S(){for(var e in a)if(a.hasOwnProperty(e)){var t=a[e];0!==t.state&&(t.state=1,v(t))}}function w(e){if(e&&e.chunk&&e.chunk.mediaInfo){var t=a[e.chunk.mediaInfo.type];if(t&&0!==t.state){var n=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||n>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=n,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=n,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,I(t,e.chunk.mediaInfo.type)}}}function A(e){if(e&&e.metric===r.Z.HTTP_REQUEST&&e.value&&e.value.type===s.w.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=a[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),I(t,e.mediaType))}}function I(e,t){if(!isNaN(e.lastSegmentStart)&&!isNaN(e.lastSegmentRequestTimeMs)&&!isNaN(e.placeholderBuffer)){if(e.placeholderBuffer*=.99,!isNaN(e.lastSegmentFinishTimeMs)){var n=p.getCurrentBufferLevel(t)+.001*(e.lastSegmentFinishTimeMs-e.lastSegmentRequestTimeMs),r=T(e,e.lastQuality),i=Math.max(0,r-n);e.placeholderBuffer=Math.min(i,e.placeholderBuffer)}e.lastSegmentWasReplacement&&!isNaN(e.lastSegmentDurationS)&&(e.placeholderBuffer+=e.lastSegmentDurationS),e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN}}function C(e){if(e){var t=a[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function R(e){if(e){var t=a[e.mediaType];if(t&&0!==t.state){var n,r=p.getCurrentBufferLevel(e.mediaType);n=t.abrQuality>0?b(t,t.abrQuality):f;var i=Math.max(0,n-r);t.placeholderBuffer=Math.min(t.placeholderBuffer,i)}}}function D(){a={}}return t={getMaxIndex:function(e){var t=(0,i.Z)(h).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getScheduleController")&&e.hasOwnProperty("getStreamInfo")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("useBufferOccupancyABR")))return t;var r=e.getMediaInfo(),s=e.getMediaType(),o=e.getScheduleController(),u=e.getStreamInfo(),l=e.getAbrController(),c=l.getThroughputHistory(),d=u?u.id:null,f=u&&u.manifestInfo&&u.manifestInfo.isDynamic,m=e.useBufferOccupancyABR();if(t.reason=t.reason||{},!m)return t;o.setTimeToLoadDelay(0);var E=function(e){var t=e.getMediaType(),n=a[t];return n?0!==n.state&&_(n,t):(n=function(e){var t={},n=e.getMediaInfo().bitrateList.map((function(e){return e.bandwidth})),r=function(e){return e.map((function(e){return Math.log(e)}))}(n);r=r.map((function(e){return e-r[0]+1}));var i=g.getStableBufferTime(),a=y(i,n,r);return a?(t.state=1,t.bitrates=n,t.utilities=r,t.stableBufferTime=i,t.Vp=a.Vp,t.gp=a.gp,t.lastQuality=0,v(t)):t.state=0,t}(e),a[t]=n),n}(e);if(0===E.state)return t;var S,w=p.getCurrentBufferLevel(s),A=c.getAverageThroughput(s,f),I=c.getSafeAverageThroughput(s,f),C=c.getAverageLatency(s);if(t.reason.state=E.state,t.reason.throughput=A,t.reason.latency=C,isNaN(A))return t;switch(E.state){case 1:S=l.getQualityForBitrate(r,I,d,C),t.quality=S,t.reason.throughput=I,E.placeholderBuffer=Math.max(0,b(E,S)-w),E.lastQuality=S,!isNaN(E.lastSegmentDurationS)&&w>=E.lastSegmentDurationS&&(E.state=2);break;case 2:!function(e,t){var n=Date.now();if(isNaN(e.lastSegmentFinishTimeMs)){if(!isNaN(e.lastCallTimeMs)){var r=.001*(n-e.lastCallTimeMs);e.placeholderBuffer+=Math.max(0,r)}}else{var i=.001*(n-e.lastSegmentFinishTimeMs);e.placeholderBuffer+=Math.max(0,i)}e.lastCallTimeMs=n,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN,_(e,t)}(E,s),S=function(e,t){for(var n=e.bitrates.length,r=NaN,i=NaN,a=0;a<n;++a){var s=(e.Vp*(e.utilities[a]+e.gp)-t)/e.bitrates[a];(isNaN(i)||s>=i)&&(i=s,r=a)}return r}(E,w+E.placeholderBuffer);var R=l.getQualityForBitrate(r,I,d,C);S>E.lastQuality&&S>R&&(S=Math.max(R,E.lastQuality));var D=Math.max(0,w+E.placeholderBuffer-T(E,S));D<=E.placeholderBuffer?(E.placeholderBuffer-=D,D=0):(D-=E.placeholderBuffer,E.placeholderBuffer=0,S<l.getMaxAllowedIndexFor(s,d)?o.setTimeToLoadDelay(1e3*D):D=0),t.quality=S,t.reason.throughput=A,t.reason.latency=C,t.reason.bufferLevel=w,t.reason.placeholderBuffer=E.placeholderBuffer,t.reason.delay=D,E.lastQuality=S;break;default:n.debug("BOLA ABR rule invoked in bad state."),t.quality=l.getQualityForBitrate(r,I,d,C),t.reason.state=E.state,t.reason.throughput=I,t.reason.latency=C,E.state=1,v(E)}return t},reset:function(){D(),m.off(c.Z.BUFFER_EMPTY,E,t),m.off(c.Z.PLAYBACK_SEEKING,S,t),m.off(c.Z.METRIC_ADDED,A,t),m.off(c.Z.QUALITY_CHANGE_REQUESTED,C,t),m.off(c.Z.FRAGMENT_LOADING_ABANDONED,R,t),m.off(u.Z.MEDIA_FRAGMENT_LOADED,w,t)}},n=(0,l.Z)(h).getInstance().getLogger(t),D(),m.on(c.Z.BUFFER_EMPTY,E,t),m.on(c.Z.PLAYBACK_SEEKING,S,t),m.on(c.Z.METRIC_ADDED,A,t),m.on(c.Z.QUALITY_CHANGE_REQUESTED,C,t),m.on(c.Z.FRAGMENT_LOADING_ABANDONED,R,t),m.on(u.Z.MEDIA_FRAGMENT_LOADED,w,t),t}h.__dashjs_factory_name="BolaRule",t.Z=a.Z.getClassFactory(h)},895:function(e,t,n){"use strict";var r=n(5448),i=n(2068),a=n(6398);function s(){var e,t,n=this.context;return e={getMaxIndex:function(e){var r=(0,i.Z)(n).create();if(!e||!e.hasOwnProperty("getDroppedFramesHistory"))return r;var a=e.getDroppedFramesHistory(),s=e.getStreamInfo().id;if(a){var o=a.getFrameHistory(s);if(!o||0===o.length)return r;for(var u=0,l=0,c=i.Z.NO_CHANGE,d=1;d<o.length;d++)if(o[d]&&(u=o[d].droppedVideoFrames,(l=o[d].totalVideoFrames)>375&&u/l>.15)){c=d-1,t.debug("index: "+c+" Dropped Frames: "+u+" Total Frames: "+l);break}return(0,i.Z)(n).create(c,{droppedFrames:u})}return r}},t=(0,a.Z)(n).getInstance().getLogger(e),e}s.__dashjs_factory_name="DroppedFramesRule",t.Z=r.Z.getClassFactory(s)},6535:function(e,t,n){"use strict";var r=n(5595),i=n(8512),a=n(5448),s=n(6398),o=n(2068),u=n(3393),l=n(3860),c=n(8825);function d(e){e=e||{};var t,n,a,d=this.context,f=(0,r.Z)(d).getInstance(),h=e.dashMetrics;function p(){(a={})[u.Z.VIDEO]={ignoreCount:2},a[u.Z.AUDIO]={ignoreCount:2}}function g(){p()}function m(e){isNaN(e.startTime)||e.mediaType!==u.Z.AUDIO&&e.mediaType!==u.Z.VIDEO||a[e.mediaType].ignoreCount>0&&a[e.mediaType].ignoreCount--}return t={getMaxIndex:function(e){var t=(0,o.Z)(d).create();if(!e||!e.hasOwnProperty("getMediaType"))return t;!function(){if(!h||!h.hasOwnProperty("getCurrentBufferLevel")||!h.hasOwnProperty("getCurrentBufferState"))throw new Error(u.Z.MISSING_CONFIG_ERROR)}();var r=e.getMediaType(),i=h.getCurrentBufferState(r),s=e.getRepresentationInfo().fragmentDuration,c=e.getStreamInfo(),f=c?c.id:null,p=e.getScheduleController(),g=c&&c.manifestInfo&&c.manifestInfo.isDynamic;if(function(e,t){return!e&&a[t].ignoreCount>0}(p.getPlaybackController().getLowLatencyModeEnabled(),r)||!s)return t;if(i&&i.state===l.Z.BUFFER_EMPTY)n.debug("["+r+"] Switch to index 0; buffer is empty."),t.quality=0,t.reason="InsufficientBufferRule: Buffer is empty";else{var m=e.getMediaInfo(),y=e.getAbrController(),v=y.getThroughputHistory(),_=h.getCurrentBufferLevel(r),T=v.getAverageThroughput(r,g),b=v.getAverageLatency(r),E=T*(_/s)*.5;t.quality=y.getQualityForBitrate(m,E,f,b),t.reason="InsufficientBufferRule: being conservative to avoid immediate rebuffering"}return t},reset:function(){p(),f.off(c.Z.PLAYBACK_SEEKING,g,t),f.off(i.Z.BYTES_APPENDED_END_FRAGMENT,m,t)}},n=(0,s.Z)(d).getInstance().getLogger(t),p(),f.on(c.Z.PLAYBACK_SEEKING,g,t),f.on(i.Z.BYTES_APPENDED_END_FRAGMENT,m,t),t}d.__dashjs_factory_name="InsufficientBufferRule",t.Z=a.Z.getClassFactory(d)},1914:function(e,t,n){"use strict";var r=n(3860),i=n(2068),a=n(5448),s=n(7855),o=n(5595),u=n(8512),l=n(6398),c=n(3393);function d(e){e=e||{};var t,n,a,d,f=this.context,h=e.dashMetrics,p=(0,o.Z)(f).getInstance();function g(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN,e.lastSegmentUrl=""}function m(){for(var e in n)if(n.hasOwnProperty(e)){var t=n[e];0!==t.state&&(t.state=1,g(t))}}function y(e){if(e&&e.chunk&&e.chunk.mediaInfo){var t=n[e.chunk.mediaInfo.type],r=a[e.chunk.mediaInfo.type];if(t&&0!==t.state){var i=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||i>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=i,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=i,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,_(t,r)}}}function v(e){if(e&&e.metric===r.Z.HTTP_REQUEST&&e.value&&e.value.type===s.w.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=n[e.mediaType],i=a[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),_(t,i))}}function _(e,t){isNaN(e.lastSegmentStart)||isNaN(e.lastSegmentRequestTimeMs)||(t.segment_request_start_s=.001*e.lastSegmentRequestTimeMs,t.segment_download_finish_s=.001*e.lastSegmentFinishTimeMs,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN)}function T(e){if(e&&e.mediaType){var t=n[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function b(e,t){if(e.length!==t.length)return-1;for(var n=0,r=0;r<e.length;r++)n+=e[r]*t[r];return n}function E(){n={},a={}}return t={getMaxIndex:function(e){var t,r=(0,i.Z)(f).create(),o=Math.pow(4,.99),u=Math.max(Math.pow(4,1),o*Math.sqrt(4)),l=e.getMediaInfo(),p=e.getMediaType(),m=l.bitrateList.map((function(e){return e.bandwidth})),y=m.length,v=e.getScheduleController(),_=e.getStreamInfo(),T=e.getAbrController(),E=T.getThroughputHistory(),S=_&&_.manifestInfo&&_.manifestInfo.isDynamic,w=e.useL2AABR(),A=h.getCurrentBufferLevel(p,!0),I=E.getSafeAverageThroughput(p,S),C=E.getAverageThroughput(p,S),R=E.getAverageLatency(p),D=e.getVideoModel().getPlaybackRate();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getScheduleController")&&e.hasOwnProperty("getStreamInfo")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("useL2AABR")))return r;if(r.reason=r.reason||{},!w||p===c.Z.AUDIO)return r;v.setTimeToLoadDelay(0);var x=function(e){var t=e.getMediaType(),r=n[t];return r||(r=function(e){var t={},n=e.getMediaInfo(),r=n.bitrateList.map((function(e){return e.bandwidth/1e3}));return t.state=1,t.bitrates=r,t.lastQuality=0,function(e){e&&e.type&&(a[e.type]={},a[e.type].w=[],a[e.type].prev_w=[],a[e.type].Q=0,a[e.type].segment_request_start_s=0,a[e.type].segment_download_finish_s=0,a[e.type].B_target=1.5)}(n),g(t),t}(e),n[t]=r),r}(e);if(0===x.state)return r;var N=a[p];if(!N)return r;if(r.reason.state=x.state,r.reason.throughput=C,r.reason.latency=R,isNaN(C))return r;switch(x.state){case 1:if(t=T.getQualityForBitrate(l,I,_.id,R),r.quality=t,r.reason.throughput=I,x.lastQuality=t,!isNaN(x.lastSegmentDurationS)&&A>=N.B_target){x.state=2,N.Q=o;for(var O=0;O<y;++O)O===x.lastQuality?N.prev_w[O]=1:N.prev_w[O]=0}break;case 2:var P=[],M=h.getCurrentHttpRequest(p).trace.reduce((function(e,t){return e+t.d}),0),k=h.getCurrentHttpRequest(p).trace.reduce((function(e,t){return e+t.b[0]}),0),L=Math.round(8*k/M),F=h.getCurrentHttpRequest(p);if(L<1&&(L=1),F.url===x.lastSegmentUrl||F.type===s.w.INIT_SEGMENT_TYPE)t=x.lastQuality;else{for(var U=x.lastSegmentDurationS,B=1,j=0;j<y;++j)m[j]=m[j]/1e3,D*m[j]>L&&(B=-1),N.w[j]=N.prev_w[j]+B*(U/(2*u))*((N.Q+o)*(D*m[j]/L));N.w=function(e){for(var t=e.length,n=!1,r=[],i=0;i<t;++i)r[i]=e[i];for(var a=e.sort((function(e,t){return t-e})),s=0,o=0,u=[],l=0;l<t-1;++l)if((o=((s+=a[l])-1)/(l+1))>=a[l+1]){n=!0;break}n||(o=(s+a[t-1]-1)/t);for(var c=0;c<t;++c)u[c]=Math.max(r[c]-o,0);return u}(N.w);for(var q=0;q<y;++q)P[q]=N.w[q]-N.prev_w[q],N.prev_w[q]=N.w[q];N.Q=Math.max(0,N.Q-U+U*D*((b(m,N.prev_w)+b(m,P))/L));for(var H=[],G=0;G<y;++G)H[G]=Math.abs(m[G]-b(N.w,m));(t=H.indexOf(Math.min.apply(Math,H)))>x.lastQuality&&m[x.lastQuality+1]<=L&&(t=x.lastQuality+1),m[t]>=L&&(N.Q=2*Math.max(o,N.Q)),x.lastSegmentUrl=F.url}r.quality=t,r.reason.throughput=C,r.reason.latency=R,r.reason.bufferLevel=A,x.lastQuality=r.quality;break;default:d.debug("L2A ABR rule invoked in bad state."),r.quality=T.getQualityForBitrate(l,I,_.id,R),r.reason.state=x.state,r.reason.throughput=I,r.reason.latency=R,x.state=1,g(x)}return r},reset:function(){E(),p.off(u.Z.PLAYBACK_SEEKING,m,t),p.off(u.Z.MEDIA_FRAGMENT_LOADED,y,t),p.off(u.Z.METRIC_ADDED,v,t),p.off(u.Z.QUALITY_CHANGE_REQUESTED,T,t)}},d=(0,l.Z)(f).getInstance().getLogger(t),E(),p.on(u.Z.PLAYBACK_SEEKING,m,t),p.on(u.Z.MEDIA_FRAGMENT_LOADED,y,t),p.on(u.Z.METRIC_ADDED,v,t),p.on(u.Z.QUALITY_CHANGE_REQUESTED,T,t),t}d.__dashjs_factory_name="L2ARule",t.Z=a.Z.getClassFactory(d)},6070:function(e,t,n){"use strict";var r=n(5448),i=n(6398),a=n(2068);function s(){var e,t,n=this.context;return e={getMaxIndex:function(e){for(var r=e?e.getSwitchHistory():null,i=r?r.getSwitchRequests():[],s=0,o=0,u=0,l=(0,a.Z)(n).create(),c=0;c<i.length;c++)if(void 0!==i[c]&&(s+=i[c].drops,o+=i[c].noDrops,u+=i[c].dropSize,s+o>=6&&s/o>.075)){l.quality=c>0&&i[c].drops>0?c-1:c,l.reason={index:l.quality,drops:s,noDrops:o,dropSize:u},t.debug("Switch history rule index: "+l.quality+" samples: "+(s+o)+" drops: "+s);break}return l}},t=(0,i.Z)(n).getInstance().getLogger(e),e}s.__dashjs_factory_name="SwitchHistoryRule",t.Z=r.Z.getClassFactory(s)},5628:function(e,t,n){"use strict";var r=n(5448),i=n(2068),a=n(3393),s=n(3860);function o(e){e=e||{};var t=this.context,n=e.dashMetrics;return{getMaxIndex:function(e){var r=(0,i.Z)(t).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("useBufferOccupancyABR")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("getScheduleController")))return r;!function(){if(!n||!n.hasOwnProperty("getCurrentBufferState"))throw new Error(a.Z.MISSING_CONFIG_ERROR)}();var o=e.getMediaInfo(),u=e.getMediaType(),l=n.getCurrentBufferState(u),c=e.getScheduleController(),d=e.getAbrController(),f=e.getStreamInfo(),h=f?f.id:null,p=f&&f.manifestInfo?f.manifestInfo.isDynamic:null,g=d.getThroughputHistory(),m=g.getSafeAverageThroughput(u,p),y=g.getAverageLatency(u),v=e.useBufferOccupancyABR();return isNaN(m)||!l||v||d.getAbandonmentStateFor(h,u)!==s.Z.ABANDON_LOAD&&(l.state===s.Z.BUFFER_LOADED||p)&&(r.quality=d.getQualityForBitrate(o,m,h,y),c.setTimeToLoadDelay(0),r.reason={throughput:m,latency:y}),r},reset:function(){}}}o.__dashjs_factory_name="ThroughputRule",t.Z=r.Z.getClassFactory(o)},4722:function(e,t,n){"use strict";var r=n(5448),i=n(6398);function a(){var e,t,n,r,a,s,o,u,l,c=this.context;function d(){n=null,r=1,a=100,s=0,o=null,u=null,l="dynamic_weight_selection"}function f(){var e=0;if(n)for(var t=0;t<n.length;t++){var r=n[t];r.state.throughput>e&&(e=r.state.throughput)}return e}function h(e,t,n){var r=e.map((function(e,r){return n[r]*Math.pow(e-t[r],2)})).reduce((function(e,t){return e+t}));return(r<0?-1:1)*Math.sqrt(Math.abs(r))}function p(e,t){return h([e.state.throughput,e.state.latency,e.state.rebuffer,e.state.switch],[t.state.throughput,t.state.latency,t.state.rebuffer,t.state.switch],[1,1,1,1])}function g(e,t,n){for(var r=0;r<t.length;r++){var i=t[r],a=p(i,e);m(i,n,Math.exp(-1*Math.pow(a,2)/(2*Math.pow(.1,2))))}}function m(e,t,n){var r=e.state,i=[.01,.01,.01,.01];r.throughput=r.throughput+(t[0]-r.throughput)*i[0]*n,r.latency=r.latency+(t[1]-r.latency)*i[1]*n,r.rebuffer=r.rebuffer+(t[2]-r.rebuffer)*i[2]*n,r.switch=r.switch+(t[3]-r.switch)*i[3]*n}return e={getNextQuality:function(e,i,c,d,p,m,y){var v=c,_=d,T=i,b=function(e){if(!n){n=[];var t=e.bitrateList,i=[];s=t[0].bandwidth,t.forEach((function(e){i.push(e.bandwidth),e.bandwidth<s&&(s=e.bandwidth)})),l=i.map((function(e){return Math.pow(e,2)})).reduce((function(e,t){return e+t})),r=Math.sqrt(l);for(var a=0;a<t.length;a++){var o={qualityIndex:a,bitrate:t[a].bandwidth,state:{throughput:t[a].bandwidth/r,latency:0,rebuffer:0,switch:0}};n.push(o)}u=function(e){var t=[],n=function(e){for(var t=[],n=0;n<e;n++){var r=[Math.random()*f(),Math.random(),Math.random(),Math.random()];t.push(r)}return t}(Math.pow(e.length,2));t.push(n[0]);for(var r=[1,1,1,1],i=1;i<e.length;i++){for(var a=null,s=null,o=0;o<n.length;o++){for(var u=n[o],l=null,c=0;c<t.length;c++){var d=h(u,t[c],r);(null===l||d<l)&&(l=d)}(null===s||l>s)&&(a=u,s=l)}t.push(a)}for(var p=null,g=null,m=0;m<t.length;m++){for(var y=0,v=0;v<t.length;v++)m!==v&&(y+=h(t[m],t[v],r));(null===p||y>p)&&(p=y,g=m)}var _=[];for(_.push(t[g]),t.splice(g,1);t.length>0;){for(var T=null,b=null,E=0;E<t.length;E++){var S=h(_[0],t[E],r);(null===T||S<T)&&(T=S,b=E)}_.push(t[b]),t.splice(b,1)}return _}(n)}var l;return n}(e),E=i/r;E>1&&(E=f()),c/=a,t.debug("getNextQuality called throughput:".concat(E," latency:").concat(c," bufferSize:").concat(d," currentQualityIndex:").concat(m," playbackRate:").concat(p));var S=b[m],w=S.bitrate*y.getSegmentDuration()/T,A=Math.max(0,w-_);if(_-w<y.getMinBuffer())return t.debug("Buffer is low for bitrate= ".concat(S.bitrate," downloadTime=").concat(w," currentBuffer=").concat(_," rebuffer=").concat(A)),function(e,t){var r=0,i=e;if(n)for(var a=0;a<n.length;a++){var s=n[a];s.bitrate<e.bitrate&&s.bitrate>r&&t>s.bitrate&&(r=s.bitrate,i=s)}return i}(S,T).qualityIndex;switch(l){case"manual_weight_selection":o=[.4,.4,.4,.4];break;case"random_weight_selection":!function(e){o=function(e,t){for(var n=[],r=Math.sqrt(2/e),i=0;i<4;i++)n.push(Math.random()*r);return o=n}(e.length)}(b);break;default:!function(e,t,n,r,i,a,s){o||(o=u[u.length-1]);var l=e.findWeightVector(t,n,r,i,a,s);null!==l&&-1!==l&&(o=l)}(y,b,v,_,A,T,p)}for(var I=null,C=null,R=null,D=0;D<b.length;D++){var x=b[D],N=x.state,O=[N.throughput,N.latency,N.rebuffer,N.switch],P=o.slice(),M=y.getNextBufferWithBitrate(x.bitrate,_,T),k=M<y.getMinBuffer();k&&t.debug("Buffer is low for bitrate=".concat(x.bitrate," downloadTime=").concat(w," currentBuffer=").concat(_," nextBuffer=").concat(M)),(x.bitrate>i-1e4||k)&&x.bitrate!==s&&(P[0]=100);var L=h(O,[E,0,0,0],P);(null===I||L<I)&&(I=L,C=x.qualityIndex,R=x)}var F=Math.abs(S.bitrate-R.bitrate)/r;return g(S,b,[E,c,A,F]),g(R,b,[E,0,0,F]),C},reset:function(){d()}},t=(0,i.Z)(c).getInstance().getLogger(e),d(),e}a.__dashjs_factory_name="LearningAbrController",t.Z=r.Z.getClassFactory(a)},5317:function(e,t,n){"use strict";var r=n(5448),i=n(2298);function a(){var e,t,n,r,a;function s(){t=null,n=null,r=null,a=null}function o(e,t,n,r){var a=new i.Z;return a.type=e,a.weights.bitrateReward=t||1,a.weights.bitrateSwitchPenalty=1,a.weights.rebufferPenalty=n||1e3,a.weights.latencyPenalty=[],a.weights.latencyPenalty.push({threshold:1.1,penalty:.05*r}),a.weights.latencyPenalty.push({threshold:1e8,penalty:.1*n}),a.weights.playbackSpeedPenalty=r||200,a}function u(e,t,n,r,i){i.bitrateWSum+=i.weights.bitrateReward*e,i.lastBitrate&&(i.bitrateSwitchWSum+=i.weights.bitrateSwitchPenalty*Math.abs(e-i.lastBitrate)),i.lastBitrate=e,i.rebufferWSum+=i.weights.rebufferPenalty*t;for(var a=0;a<i.weights.latencyPenalty.length;a++){var s=i.weights.latencyPenalty[a];if(n<=s.threshold){i.latencyWSum+=s.penalty*n;break}}i.playbackSpeedWSum+=i.weights.playbackSpeedPenalty*Math.abs(1-r),i.totalQoe=i.bitrateWSum-i.bitrateSwitchWSum-i.rebufferWSum-i.latencyWSum-i.playbackSpeedWSum}return e={setupPerSegmentQoe:function(e,i,s){t=o("segment",e,i,s),n=e,r=i,a=s},logSegmentMetrics:function(e,n,r,i){t&&u(e,n,r,i,t)},getPerSegmentQoe:function(){return t},calculateSingleUseQoe:function(e,t,i,s){var l=null;return n&&r&&a&&(l=o("segment",n,r,a)),l?(u(e,t,i,s,l),l.totalQoe):0},reset:function(){s()}},s(),e}a.__dashjs_factory_name="LoLpQoeEvaluator",t.Z=r.Z.getClassFactory(a)},5435:function(e,t,n){"use strict";var r=n(6398),i=n(5448),a=n(4722),s=n(5317),o=n(2068),u=n(3860),l=n(6523),c=n(3393);function d(e){var t,n,i,d,f=(e=e||{}).dashMetrics,h=this.context;return n={getMaxIndex:function(e){try{var n=(0,o.Z)(h).create(),r=e.getMediaInfo().type,a=e.getAbrController(),s=e.getStreamInfo(),p=a.getQualityFor(r,s.id),g=e.getMediaInfo(),m=f.getCurrentBufferState(r),y=e.getScheduleController(),v=f.getCurrentBufferLevel(r,!0),_=s&&s.manifestInfo?s.manifestInfo.isDynamic:null,T=y.getPlaybackController(),b=T.getCurrentLiveLatency();if(!e.useLoLPABR()||r===c.Z.AUDIO)return n;b||(b=0);var E=T.getPlaybackRate(),S=a.getThroughputHistory().getSafeAverageThroughput(r,_);if(t.debug("Throughput ".concat(Math.round(S)," kbps")),isNaN(S)||!m)return n;if(a.getAbandonmentStateFor(s.id,r)===u.Z.ABANDON_LOAD)return n;for(var w=g.bitrateList,A=e.getRepresentationInfo().fragmentDuration,I=w[0].bandwidth/1e3,C=w[w.length-1].bandwidth/1e3,R=0;R<w.length;R++){var D=w[R].bandwidth/1e3;D>C?C=D:D<I&&(I=D)}var x=w[p].bandwidth/1e3,N=f.getCurrentHttpRequest(r,!0),O=(N.tresponse.getTime()-N.trequest.getTime())/1e3,P=O>A?O-A:0;d.setupPerSegmentQoe(A,C,I),d.logSegmentMetrics(x,P,b,E);var M=(0,l.Z)(h).create({targetLatency:1.5,bufferMin:.3,segmentDuration:A,qoeEvaluator:d});return n.quality=i.getNextQuality(g,1e3*S,b,v,E,p,M),n.reason={throughput:S,latency:b},n.priority=o.Z.PRIORITY.STRONG,y.setTimeToLoadDelay(0),n.quality!==p&&t.debug("[TgcLearningRule]["+r+"] requesting switch to index: ",n.quality,"Average throughput",Math.round(S),"kbps"),n}catch(e){throw e}},reset:function(){i.reset(),d.reset()}},t=(0,r.Z)(h).getInstance().getLogger(n),i=(0,a.Z)(h).create(),d=(0,s.Z)(h).create(),n}d.__dashjs_factory_name="LoLPRule",t.Z=i.Z.getClassFactory(d)},6523:function(e,t,n){"use strict";var r=n(5448);function i(e){var t,n,r,i,a=e.targetLatency,s=e.bufferMin,o=e.segmentDuration,u=e.qoeEvaluator;function l(){return o}function c(e,t){var n=l();return t>n?e-n:e+n-t}return t={getMinBuffer:function(){return s},getSegmentDuration:l,getNextBufferWithBitrate:function(e,t,n){return c(t,e*o/n)},getNextBuffer:c,findWeightVector:function(e,t,i,l,d,f){var h=null,p=null,g=null,m=Math.abs(t-r);return e.forEach((function(e){n.forEach((function(n){n[0];var r=n[1],l=n[2],y=(n[3],e.bitrate*o/d),v=c(i,y),_=(0===l?10:1/l)*Math.max(1e-5,y-v),T=(0===r?10:1/r)*e.state.latency,b=u.calculateSingleUseQoe(e.bitrate,_,T,f);(null===h||b>h)&&function(e,t,n){return!(e>a+n)&&t>=s}(t,v,m)&&(h=b,p=n,g=e.bitrate)}))})),null===p&&null===g&&(p=-1),r=t,p}},n=function e(t,n,r){if(r===n)return t;for(var a=t.length,s=0;s<a;s++)for(var o=t.shift(),u=0;u<i.length;u++)t.push(o.concat(i[u]));return e(t,n,r+1)}((i=[.2,.4,.6,.8,1]).map((function(e){return[e]})),4,1),r=0,t}i.__dashjs_factory_name="LoLpWeightSelector",t.Z=r.Z.getClassFactory(i)},2298:function(e,t){"use strict";t.Z=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=null,this.lastBitrate=null,this.weights={},this.weights.bitrateReward=null,this.weights.bitrateSwitchPenalty=null,this.weights.rebufferPenalty=null,this.weights.latencyPenalty=null,this.weights.playbackSpeedPenalty=null,this.bitrateWSum=0,this.bitrateSwitchWSum=0,this.rebufferWSum=0,this.latencyWSum=0,this.playbackSpeedWSum=0,this.totalQoe=0}},7803:function(e,t,n){"use strict";n.d(t,{Y:function(){return h}});var r=n(3393),i=n(1553),a=n(5448),s=n(2128),o=n(2594),u=n(7387),l=n(7417),c=n(9032),d=n(9326),f=n(7802),h=["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"];function p(e){var t,n,a,p,g,m,y,v,_=this.context,T=e.adapter,b=e.baseURLController,E=e.streamInfo,S=e.timelineConverter,w=e.debug,A=e.eventBus,I=e.events,C=e.dashConstants,R=(0,o.Z)(_).getInstance();function D(e,t){var r=new s.Z;r.id=e.id,r.bitrate=e.bandwidth,r.width=e.width,r.height=e.height,r.tilesHor=1,r.tilesVert=1,e.essentialProperties&&e.essentialProperties.forEach((function(e){if(h.indexOf(e.schemeIdUri)>=0&&e.value){var t=e.value.split("x");2!==t.length||isNaN(t[0])||isNaN(t[1])||(r.tilesHor=parseInt(t[0],10),r.tilesVert=parseInt(t[1],10))}})),t?m.updateSegmentData(e).then((function(t){!function(e,t,n){var r=[],i=function(e,t){var n,r,i,a,s=[],o=0;for(n=0,r=e.segments.length;n<r;n++)i=e.segments[n],(a=(0,u.TJ)(S,T.getIsDynamic(),t,i.startTime,i.duration,i.timescale,i.media,i.mediaRange,o))&&(s.push(a),a=null,o++);return s}(n,t);t.segments=i,e.segmentDuration=t.segments[0].duration,e.readThumbnail=function(e,n){var i=null;r.some((function(t){if(t.start<=e&&t.end>e)return i=t.url,!0})),i?n(i):t.segments.some((function(i){if(i.mediaStartTime<=e&&i.mediaStartTime+i.duration>e){var a=b.resolve(t.path);return y.load({method:"get",url:a.url,request:{range:i.mediaRange,responseType:"arraybuffer"},onload:function(e){var t=v.getSamplesInfo(e.target.response),a=new Blob([e.target.response.slice(t.sampleList[0].offset,t.sampleList[0].offset+t.sampleList[0].size)],{type:"image/jpeg"}),s=window.URL.createObjectURL(a);r.push({start:i.mediaStartTime,end:i.mediaStartTime+i.duration,url:s}),n&&n(s)}}),!0}}))}}(r,e,t)})):(r.startNumber=e.startNumber,r.segmentDuration=e.segmentDuration,r.timescale=e.timescale,r.templateUrl=function(e){var t=R.isRelative(e.media)?R.resolve(e.media,b.resolve(e.path).url):e.media;return t?(0,u.Aj)(t,e.id):""}(e)),r.tilesHor>0&&r.tilesVert>0&&(r.widthPerTile=r.width/r.tilesHor,r.heightPerTile=r.height/r.tilesVert,n.push(r))}function x(){n=[],p=-1,g=null}return t={getTracks:function(){return n},addTracks:function(){if(E&&T&&(g=T.getMediaInfoForType(E,r.Z.IMAGE))){var e=T.getVoRepresentations(g);e&&e.length>0&&e.forEach((function(e){(e.segmentInfoType===i.Z.SEGMENT_TEMPLATE&&e.segmentDuration>0&&e.media||e.segmentInfoType===i.Z.SEGMENT_TIMELINE)&&D(e),e.segmentInfoType===i.Z.SEGMENT_BASE&&D(e,!0)})),n.length>0&&n.sort((function(e,t){return e.bitrate-t.bitrate}))}},reset:x,setTrackByIndex:function(e){n&&0!==n.length&&(e>=n.length&&(e=n.length-1),p=e)},getCurrentTrack:function(){return p<0?null:n[p]},getCurrentTrackIndex:function(){return p},getThumbnailRequestForTime:function(e){for(var t,r=T.getVoRepresentations(g),i=0;i<r.length;i++)if(n[p].id===r[i].id){t=r[i];break}return a.getSegmentRequestForTime(g,t,e)}},x(),y=(0,c.Z)(_).create({}),v=(0,l.Z)(_).getInstance(),m=(0,f.Z)(_).create({events:I,eventBus:A,streamInfo:E,timelineConverter:S,dashConstants:C,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController,type:r.Z.IMAGE}),(a=(0,d.Z)(_).create({streamInfo:E,type:r.Z.IMAGE,timelineConverter:S,segmentsController:m,baseURLController:b,debug:w,eventBus:A,events:I,dashConstants:C,urlUtils:R})).initialize(!!T&&T.getIsDynamic()),t}p.__dashjs_factory_name="ThumbnailTracks",t.Z=a.Z.getClassFactory(p)},7417:function(e,t,n){"use strict";var r=n(6398),i=n(8260),a=n(5448),s=n(6934),o=n(9597);function u(){var e,t,n=this.context;function a(e){if(!e)return null;void 0===e.fileStart&&(e.fileStart=0);var t=s.parseBuffer(e),r=(0,i.Z)(n).create();return r.setData(t),r}function u(e,t){return e[t+3]>>>0|e[t+2]<<8>>>0|e[t+1]<<16>>>0|e[t]<<24>>>0}function l(e,t){return String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t])}return t={parse:a,findLastTopIsoBoxCompleted:function(e,t,n){if(void 0===n&&(n=0),!t||n+8>=t.byteLength)return new o.Z(0,!1);for(var r,i=t instanceof ArrayBuffer?new Uint8Array(t):t,a=0;n<i.byteLength;){var s=u(i,n),c=l(i,n+4);if(0===s)break;n+s<=i.byteLength&&(e.indexOf(c)>=0?r=new o.Z(n,!0,s):a=n+s),n+=s}return r||new o.Z(a,!1)},getMediaTimescaleFromMoov:function(e){var t=a(e),n=t?t.getBox("mdhd"):void 0;return n?n.timescale:NaN},getSamplesInfo:function(e){if(!e||0===e.byteLength)return{sampleList:[],lastSequenceNumber:NaN,totalDuration:NaN,numSequences:NaN};var t,n,r,i,s,o,u,l,c,d,f,h,p,g,m,y,v=a(e),_=v.getBoxes("moof"),T=v.getBoxes("mfhd");m=v.getBoxes("moof").length,g=T[T.length-1].sequence_number,n=0,s=[];var b=-1,E=-1;for(d=0;d<_.length;d++){var S=_[d],w=S.getChildBoxes("traf");for(l=0;l<w.length;l++){var A=w[l],I=A.getChildBox("tfhd"),C=A.getChildBox("tfdt");i=C.baseMediaDecodeTime;var R=A.getChildBoxes("trun"),D=A.getChildBoxes("subs");for(c=0;c<R.length;c++){var x=R[c];for(n=x.sample_count,p=(I.base_data_offset||0)+(x.data_offset||0),u=0;u<n;u++){t=void 0!==(o=x.samples[u]).sample_duration?o.sample_duration:I.default_sample_duration,r=void 0!==o.sample_size?o.sample_size:I.default_sample_size;var N={dts:i,cts:i+(void 0!==o.sample_composition_time_offset?o.sample_composition_time_offset:0),duration:t,offset:S.offset+p,size:r,subSizes:[r]};if(D)for(f=0;f<D.length;f++){var O=D[f];if(b<O.entry_count-1&&u>E&&(b++,E+=O.entries[b].sample_delta),u==E){N.subSizes=[];var P=O.entries[b];for(h=0;h<P.subsample_count;h++)N.subSizes.push(P.subsamples[h].subsample_size)}}s.push(N),p+=r,i+=t}}y=i-C.baseMediaDecodeTime}}return{sampleList:s,lastSequenceNumber:g,totalDuration:y,numSequences:m}},findInitRange:function(t){var n=null,r=a(t);if(!r)return n;var i=r.getBox("ftyp"),s=r.getBox("moov");return e.debug("Searching for initialization."),s&&s.isComplete&&(n=(i?i.offset:s.offset)+"-"+(s.offset+s.size-1),e.debug("Found the initialization. Range: "+n)),n},parsePayload:function(e,t,n){if(void 0===n&&(n=0),!t||n+8>=t.byteLength)return new o.Z(0,!1);for(var r,i=t instanceof ArrayBuffer?new Uint8Array(t):t,a=0;n<i.byteLength;){var s=u(i,n),c=l(i,n+4);if(0===s)break;n+s<=i.byteLength&&(e.indexOf(c)>=0?r=new o.Z(n,!0,s,c):a=n+s),n+=s}return r||new o.Z(a,!1)}},e=(0,r.Z)(n).getInstance().getLogger(t),t}u.__dashjs_factory_name="BoxParser",t.Z=a.Z.getSingletonFactory(u)},1715:function(e,t,n){"use strict";n.d(t,{B:function(){return o}});var r=n(5448),i=n(7803),a=n(3393),s=[{codec:"avc1",compatibleCodecs:["avc3"]},{codec:"avc3",compatibleCodecs:["avc1"]}];function o(){var e="ManagedMediaSource"in window,t="WebKitMediaSource"in window,n="MediaSource"in window;return e||t||n}function u(){var e,t,n;return e={setConfig:function(e){e&&e.settings&&(t=e.settings)},supportsMediaSource:o,supportsEncryptedMedia:function(){return n},supportsCodec:function(e,n){return n!==a.Z.AUDIO&&n!==a.Z.VIDEO?Promise.resolve(!0):function(e,n){return t.get().streaming.capabilities.useMediaCapabilitiesApi&&navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo&&(e.codec&&n===a.Z.AUDIO||n===a.Z.VIDEO&&e.codec&&e.width&&e.height&&e.bitrate&&e.framerate)}(e,n)?function(e,t){return new Promise((function(n){if(e&&e.codec){var r={type:"media-source"};r[t]={},r[t].contentType=e.codec,r[t].width=e.width,r[t].height=e.height,r[t].bitrate=parseInt(e.bitrate),r[t].framerate=parseFloat(e.framerate),navigator.mediaCapabilities.decodingInfo(r).then((function(e){n(e.supported)})).catch((function(){n(!1)}))}else n(!1)}))}(e,n):function(e){return new Promise((function(t){if(e&&e.codec){var n=e.codec;e.width&&e.height&&(n+=';width="'+e.width+'";height="'+e.height+'"'),"ManagedMediaSource"in window&&ManagedMediaSource.isTypeSupported(n)||"MediaSource"in window&&MediaSource.isTypeSupported(n)||"WebKitMediaSource"in window&&WebKitMediaSource.isTypeSupported(n)?t(!0):t(!1)}else t(!1)}))}(e)},setEncryptedMediaSupported:function(e){n=e},supportsEssentialProperty:function(e){try{return-1!==i.Y.indexOf(e.schemeIdUri)}catch(e){return!0}},codecRootCompatibleWithCodec:function(e,t){for(var n,r=e.split(".")[0],i=0===t.indexOf(r),a=0;a<s.length;a++)if(s[a].codec===r){n=s[a];break}return n?i||n.compatibleCodecs.some((function(e){return 0===t.indexOf(e)})):i}},n=!1,e}u.__dashjs_factory_name="Capabilities",t.Z=r.Z.getSingletonFactory(u)},2295:function(e,t,n){"use strict";var r=n(5448),i=n(3106);function a(){return{customTimeRangeArray:[],length:0,add:function(e,t){var n;for(n=0;n<this.customTimeRangeArray.length&&e>this.customTimeRangeArray[n].start;n++);for(this.customTimeRangeArray.splice(n,0,{start:e,end:t}),n=0;n<this.customTimeRangeArray.length-1;n++)this.mergeRanges(n,n+1)&&n--;this.length=this.customTimeRangeArray.length},clear:function(){this.customTimeRangeArray=[],this.length=0},remove:function(e,t){for(var n=0;n<this.customTimeRangeArray.length;n++)if(e<=this.customTimeRangeArray[n].start&&t>=this.customTimeRangeArray[n].end)this.customTimeRangeArray.splice(n,1),n--;else{if(e>this.customTimeRangeArray[n].start&&t<this.customTimeRangeArray[n].end){this.customTimeRangeArray.splice(n+1,0,{start:t,end:this.customTimeRangeArray[n].end}),this.customTimeRangeArray[n].end=e;break}e>this.customTimeRangeArray[n].start&&e<this.customTimeRangeArray[n].end?this.customTimeRangeArray[n].end=e:t>this.customTimeRangeArray[n].start&&t<this.customTimeRangeArray[n].end&&(this.customTimeRangeArray[n].start=t)}this.length=this.customTimeRangeArray.length},mergeRanges:function(e,t){var n=this.customTimeRangeArray[e],r=this.customTimeRangeArray[t];return n.start<=r.start&&r.start<=n.end&&n.end<=r.end?(n.end=r.end,this.customTimeRangeArray.splice(t,1),!0):r.start<=n.start&&n.start<=r.end&&r.end<=n.end?(n.start=r.start,this.customTimeRangeArray.splice(t,1),!0):r.start<=n.start&&n.start<=r.end&&n.end<=r.end?(this.customTimeRangeArray.splice(e,1),!0):n.start<=r.start&&r.start<=n.end&&r.end<=n.end&&(this.customTimeRangeArray.splice(t,1),!0)},start:function(e){return(0,i.SE)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].start},end:function(e){return(0,i.SE)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].end}}}a.__dashjs_factory_name="CustomTimeRanges",t.Z=r.Z.getClassFactory(a)},5:function(e,t,n){"use strict";var r=n(5448);function i(){var e,t=/^[a-z][a-z0-9+\-_.]*:/i,n=/^https?:\/\//i,r=/^https:\/\//i,i=/^([a-z][a-z0-9+\-_.]*:\/\/[^\/]+)\/?/i,a=function(e,t){try{return new window.URL(e,t).toString()}catch(t){return e}},s=function(e,t){var n=o;if(!t)return e;if(!c(e))return e;d(e)&&(n=u),f(e)&&(n=l);var r=n(t),i="/"!==r.charAt(r.length-1)&&"/"!==e.charAt(0)?"/":"";return[r,e].join(i)};function o(e){var t=e.indexOf("/"),n=e.lastIndexOf("/");return-1!==t?n===t+1?e:(-1!==e.indexOf("?")&&(e=e.substring(0,e.indexOf("?"))),e.substring(0,n+1)):""}function u(e){var t=e.match(i);return t?t[1]:""}function l(e){var n=e.match(t);return n?n[0]:""}function c(e){return!t.test(e)}function d(e){return c(e)&&"/"===e.charAt(0)}function f(e){return 0===e.indexOf("//")}return function(){try{new window.URL("x","http://y"),e=a}catch(e){}finally{e=e||s}}(),{parseBaseUrl:o,parseOrigin:u,parseScheme:l,isRelative:c,isPathAbsolute:d,isSchemeRelative:f,isHTTPURL:function(e){return n.test(e)},isHTTPS:function(e){return r.test(e)},removeHostname:function(e){return/^(?:\w+\:\/\/)?([^\/]+)(.*)$/.exec(e)[2].substring(1)},resolve:function(t,n){return e(t,n)}}}i.__dashjs_factory_name="DefaultURLUtils",t.Z=r.Z.getSingletonFactory(i)},8260:function(e,t,n){"use strict";var r=n(2839),i=n(5448);function a(){var e;function t(t){var r=[];if(!t||!e||"function"!=typeof e.fetchAll)return r;for(var i,a=e.fetchAll(t),s=0,o=a.length;s<o;s++)(i=n(a[s]))&&r.push(i);return r}function n(e){if(!e)return null;var t=new r.Z(e);return e.hasOwnProperty("_incomplete")&&(t.isComplete=!e._incomplete),t}return{getBox:function(t){return t&&e&&e.boxes&&0!==e.boxes.length&&"function"==typeof e.fetch?n(e.fetch(t)):null},getBoxes:t,setData:function(t){e=t},getLastBox:function(){if(!e||!e.boxes||!e.boxes.length)return null;var n=t(e.boxes[e.boxes.length-1].type);return n.length>0?n[n.length-1]:null}}}a.__dashjs_factory_name="IsoFile",t.Z=i.Z.getClassFactory(a)},7473:function(e,t,n){"use strict";n.d(t,{k:function(){return i}});var r=n(5448);function i(e,t){var n={url:e.url,method:e.method,headers:Object.assign({},e.headers),credentials:e.withCredentials?"include":void 0};return Promise.resolve(t.modifyRequest(n)).then((function(){return Object.assign(e,n,{withCredentials:"include"===n.credentials})}))}function a(){return{modifyRequest:null,modifyRequestURL:function(e){return e},modifyRequestHeader:function(e,t){return t.url,e}}}a.__dashjs_factory_name="RequestModifier",t.Z=r.Z.getSingletonFactory(a)},3106:function(e,t,n){"use strict";n.d(t,{PS:function(){return a},SE:function(){return s}});var r=n(3393);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){if(i(e)!==t)throw r.Z.BAD_ARGUMENT_ERROR}function s(e){if(null===e||isNaN(e)||e%1!=0)throw r.Z.BAD_ARGUMENT_ERROR+" : argument is not an integer"}},2594:function(e,t,n){"use strict";var r=n(5448),i=n(5);function a(){var e,t=[],n=this.context;function r(n,r,i){var a=function(n){var r;for(r=0;r<t.length;r++)if(t[r].regex.test(n))return t[r].utils;return e}(i||r);return a&&"function"==typeof a[n]?a[n](r,i):e[n](r,i)}return e=(0,i.Z)(n).getInstance(),{registerUrlRegex:function(e,n){t.push({regex:e,utils:n})},parseBaseUrl:function(e){return r("parseBaseUrl",e)},parseOrigin:function(e){return r("parseOrigin",e)},parseScheme:function(e){return r("parseScheme",e)},isRelative:function(e){return r("isRelative",e)},isPathAbsolute:function(e){return r("isPathAbsolute",e)},isSchemeRelative:function(e){return r("isSchemeRelative",e)},isHTTPURL:function(e){return r("isHTTPURL",e)},isHTTPS:function(e){return r("isHTTPS",e)},removeHostname:function(e){return r("removeHostname",e)},resolve:function(e,t){return r("resolve",e,t)}}}a.__dashjs_factory_name="URLUtils";var s=r.Z.getSingletonFactory(a);t.Z=s},5459:function(e,t){"use strict";t.Z=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.code=t||null,this.message=n||null,this.data=r||null}},3186:function(e,t,n){"use strict";var r=n(7855);var i=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.action=e.ACTION_DOWNLOAD,this.startTime=NaN,this.mediaStartTime=NaN,this.mediaType=null,this.mediaInfo=null,this.type=null,this.duration=NaN,this.timescale=NaN,this.range=null,this.url=t||null,this.serviceLocation=null,this.requestStartDate=null,this.firstByteDate=null,this.requestEndDate=null,this.quality=NaN,this.index=NaN,this.availabilityStartTime=null,this.availabilityEndTime=null,this.wallStartTime=null,this.bytesLoaded=NaN,this.bytesTotal=NaN,this.delayLoadingTime=NaN,this.responseType="arraybuffer",this.representationId=null}var t;return(t=[{key:"isInitializationRequest",value:function(){return this.type&&this.type===r.w.INIT_SEGMENT_TYPE}},{key:"setInfo",value:function(e){this.type=e&&e.init?r.w.INIT_SEGMENT_TYPE:r.w.MEDIA_SEGMENT_TYPE,this.url=e&&e.url?e.url:null,this.range=e&&e.range?e.range.start+"-"+e.range.end:null,this.mediaType=e&&e.mediaType?e.mediaType:null}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();i.ACTION_DOWNLOAD="download",i.ACTION_COMPLETE="complete",t.Z=i},2839:function(e,t){"use strict";var n=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.offset=t._offset,this.type=t.type,this.size=t.size,this.boxes=[],t.boxes)for(var n=0;n<t.boxes.length;n++)this.boxes.push(new e(t.boxes[n]));switch(this.isComplete=!0,t.type){case"sidx":if(this.timescale=t.timescale,this.earliest_presentation_time=t.earliest_presentation_time,this.first_offset=t.first_offset,this.references=t.references,t.references){this.references=[];for(var r=0;r<t.references.length;r++){var i={reference_type:t.references[r].reference_type,referenced_size:t.references[r].referenced_size,subsegment_duration:t.references[r].subsegment_duration};this.references.push(i)}}break;case"emsg":this.id=t.id,this.version=1===t.version?1:0,this.value=t.value,this.timescale=t.timescale,this.scheme_id_uri=t.scheme_id_uri,this.presentation_time_delta=1===t.version?t.presentation_time:t.presentation_time_delta,this.event_duration=t.event_duration,this.message_data=t.message_data;break;case"mdhd":this.timescale=t.timescale;break;case"mfhd":this.sequence_number=t.sequence_number;break;case"subs":this.entry_count=t.entry_count,this.entries=t.entries;break;case"tfhd":this.base_data_offset=t.base_data_offset,this.sample_description_index=t.sample_description_index,this.default_sample_duration=t.default_sample_duration,this.default_sample_size=t.default_sample_size,this.default_sample_flags=t.default_sample_flags,this.flags=t.flags;break;case"tfdt":this.version=t.version,this.baseMediaDecodeTime=t.baseMediaDecodeTime,this.flags=t.flags;break;case"trun":if(this.sample_count=t.sample_count,this.first_sample_flags=t.first_sample_flags,this.data_offset=t.data_offset,this.flags=t.flags,this.samples=t.samples,t.samples){this.samples=[];for(var a=0,s=t.samples.length;a<s;a++){var o={sample_size:t.samples[a].sample_size,sample_duration:t.samples[a].sample_duration,sample_composition_time_offset:t.samples[a].sample_composition_time_offset};this.samples.push(o)}}break;case"prft":this.version=t.version,this.reference_track_ID=t.reference_track_ID,this.ntp_timestamp_sec=t.ntp_timestamp_sec,this.ntp_timestamp_frac=t.ntp_timestamp_frac,this.media_time=t.media_time,this.flags=t.flags}}var t;return(t=[{key:"getChildBox",value:function(e){for(var t=0;t<this.boxes.length;t++)if(this.boxes[t].type===e)return this.boxes[t]}},{key:"getChildBoxes",value:function(e){for(var t=[],n=0;n<this.boxes.length;n++)this.boxes[n].type===e&&t.push(this.boxes[n]);return t}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();t.Z=n},9597:function(e,t){"use strict";t.Z=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.lastCompletedOffset=t,this.found=n,this.size=r}},2128:function(e,t){"use strict";t.Z=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bitrate=0,this.width=0,this.height=0,this.tilesHor=0,this.tilesVert=0,this.widthPerTile=0,this.heightPerTile=0,this.startNumber=0,this.segmentDuration=0,this.timescale=0,this.templateUrl="",this.id=""}},7855:function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,{O:function(){return a},w:function(){return i}});var i=function e(){r(this,e),this.tcpid=null,this.type=null,this.url=null,this.actualurl=null,this.range=null,this.trequest=null,this.tresponse=null,this.responsecode=null,this.interval=null,this.trace=[],this.cmsd=null,this._stream=null,this._tfinish=null,this._mediaduration=null,this._quality=null,this._responseHeaders=null,this._serviceLocation=null,this._fileLoaderType=null},a=function e(){r(this,e),this.s=null,this.d=null,this.b=[]};i.GET="GET",i.HEAD="HEAD",i.MPD_TYPE="MPD",i.XLINK_EXPANSION_TYPE="XLinkExpansion",i.INIT_SEGMENT_TYPE="InitializationSegment",i.INDEX_SEGMENT_TYPE="IndexSegment",i.MEDIA_SEGMENT_TYPE="MediaSegment",i.BITSTREAM_SWITCHING_SEGMENT_TYPE="BitstreamSwitchingSegment",i.MSS_FRAGMENT_INFO_SEGMENT_TYPE="FragmentInfoSegment",i.DVB_REPORTING_TYPE="DVBReporting",i.LICENSE="license",i.CONTENT_STEERING_TYPE="ContentSteering",i.OTHER_TYPE="other"},3039:function(e,t){"use strict";function n(e,t){return function(n,i){for(var a,s,o,u=r(n,"tag"),l=r(null==i?"*":i,"range"),c=[],d=-1;++d<l.length;)if(a=l[d].toLowerCase(),t||"*"!==a){for(s=-1,o=[];++s<u.length;)if(e(u[s].toLowerCase(),a)){if(!t)return u[s];c.push(u[s])}else o.push(u[s]);u=o}return t?c:void 0}}function r(e,t){var n=e&&"string"==typeof e?[e]:e;if(!n||"object"!=typeof n||!("length"in n))throw new Error("Invalid "+t+" `"+n+"`, expected non-empty string");return n}t.basicFilter=n((function(e,t){return"*"===t||e===t||e.indexOf(t+"-")>-1}),!0),t.extendedFilter=n((function(e,t){var n=e.split("-"),r=t.split("-"),i=0,a=0;if("*"!==r[a]&&n[i]!==r[a])return!1;for(i++,a++;a<r.length;)if("*"!==r[a]){if(!n[i])return!1;if(n[i]!==r[a]){if(1===n[i].length)return!1;i++}else i++,a++}else a++;return!0}),!0),t.lookup=n((function(e,t){for(var n,r=t;;){if("*"===r||e===r)return!0;if((n=r.lastIndexOf("-"))<0)return!1;"-"===r.charAt(n-2)&&(n-=2),r=r.slice(0,n)}}))},3973:function(e,t,n){"use strict";e.exports=n(3854)},3854:function(e,t,n){"use strict";var r=n(2415),i=n(3039),a=n(7778),s=n(5813),o=n(3165),u=n(9460);e.exports=function(e,t){var n,c=t||{},m=r.parse(String(e||"").toLowerCase(),c),y=r.stringify(m),v=-1;if(!y)return y;for(;++v<a.length;)i.extendedFilter(y,a[v].from).length&&(f(m,a[v].from,a[v].to),y=r.stringify(m));for(v=-1;++v<s.length;)h(m,s[v].from.field,s[v].from.value)&&p(m,s[v].to.field,s[v].to.value);for(y=r.stringify(Object.assign({},m,d)),v=-1;++v<o.length;)y===o[v]&&(f(m,o[v],o[v].split("-").slice(0,-1).join("-")),y=r.stringify(Object.assign({},m,d)));if(m.extensions.sort(g),c.warning)for(n in u)l.call(u[n],m[n])&&c.warning("Deprecated "+n+" `"+m[n]+"`, expected one of `"+u[n][m[n]].join("`, `")+"`",null,7);return m.script&&(m.script=m.script.charAt(0).toUpperCase()+m.script.slice(1)),m.region&&(m.region=m.region.toUpperCase()),r.stringify(m)};var l={}.hasOwnProperty,c=new Intl.Collator,d={variants:[],extensions:[],privateuse:[],irregular:null,regular:null};function f(e,t,n){var i,a=r.parse(t),s=r.parse(n),o=[];for(i in a)a[i]&&a[i].length&&h(e,i,a[i])&&o.push(i);for(i in s)s[i]&&s[i].length&&(o.indexOf(i)>-1||!e[i]||!e[i].length)&&p(e,i,s[i])}function h(e,t,n){var r,i,a,s,o=!1;if(n){if(i=r=e[t],r&&"object"==typeof r)for(i=[],a=-1;++a<r.length;)s=r[a],n.indexOf(s)<0?i.push(s):o=!0;else r===n&&(i=null,o=!0);e[t]=i}return o}function p(e,t,n){var r,i,a,s=e[t];if(s&&"object"==typeof s)for(r=[].concat(n),i=-1;++i<r.length;)a=r[i],s.indexOf(a)<0&&s.push(a);else e[t]=n}function g(e,t){return c.compare(e.singleton,t.singleton)}},2415:function(e,t,n){"use strict";t.parse=n(6903),t.stringify=n(6713)},6903:function(e,t,n){"use strict";var r=n(2219),i=n(3516),a=n(395),s=n(858),o=n(8589);e.exports=function e(t,n){var l,c,d,f=n||{},h={language:null,extendedLanguageSubtags:[],script:null,region:null,variants:[],extensions:[],privateuse:[],irregular:null,regular:null},p=String(t),g=p.toLowerCase(),m=0;if(null==t)throw new Error("Expected string, got `"+t+"`");if(u.call(o,g))return(null==f.normalize||f.normalize)&&o[g]?e(o[g]):(h[-1===s.indexOf(g)?"irregular":"regular"]=p,h);for(;i(g.charCodeAt(m))&&m<9;)m++;if(m>1&&m<9){if(h.language=p.slice(0,m),m<4)for(c=0;45===g.charCodeAt(m)&&i(g.charCodeAt(m+1))&&i(g.charCodeAt(m+2))&&i(g.charCodeAt(m+3))&&!i(g.charCodeAt(m+4));){if(c>2)return y(m,3,"Too many extended language subtags, expected at most 3 subtags");h.extendedLanguageSubtags.push(p.slice(m+1,m+4)),m+=4,c++}for(45===g.charCodeAt(m)&&i(g.charCodeAt(m+1))&&i(g.charCodeAt(m+2))&&i(g.charCodeAt(m+3))&&i(g.charCodeAt(m+4))&&!i(g.charCodeAt(m+5))&&(h.script=p.slice(m+1,m+5),m+=5),45===g.charCodeAt(m)&&(i(g.charCodeAt(m+1))&&i(g.charCodeAt(m+2))&&!i(g.charCodeAt(m+3))?(h.region=p.slice(m+1,m+3),m+=3):a(g.charCodeAt(m+1))&&a(g.charCodeAt(m+2))&&a(g.charCodeAt(m+3))&&!a(g.charCodeAt(m+4))&&(h.region=p.slice(m+1,m+4),m+=4));45===g.charCodeAt(m);){for(d=l=m+1;r(g.charCodeAt(d));){if(d-l>7)return y(d,1,"Too long variant, expected at most 8 characters");d++}if(!(d-l>4||d-l>3&&a(g.charCodeAt(l))))break;h.variants.push(p.slice(l,d)),m=d}for(;45===g.charCodeAt(m)&&120!==g.charCodeAt(m+1)&&r(g.charCodeAt(m+1))&&45===g.charCodeAt(m+2)&&r(g.charCodeAt(m+3));){for(d=m+2,c=0;45===g.charCodeAt(d)&&r(g.charCodeAt(d+1))&&r(g.charCodeAt(d+2));)for(d=(l=d+1)+2,c++;r(g.charCodeAt(d));){if(d-l>7)return y(d,2,"Too long extension, expected at most 8 characters");d++}if(!c)return y(d,4,"Empty extension, extensions must have at least 2 characters of content");h.extensions.push({singleton:p.charAt(m+1),extensions:p.slice(m+3,d).split("-")}),m=d}}else m=0;if(0===m&&120===g.charCodeAt(m)||45===g.charCodeAt(m)&&120===g.charCodeAt(m+1))for(d=m=m?m+2:1;45===g.charCodeAt(d)&&r(g.charCodeAt(d+1));){for(d=l=m+1;r(g.charCodeAt(d));){if(d-l>7)return y(d,5,"Too long private-use area, expected at most 8 characters");d++}h.privateuse.push(p.slice(m+1,d)),m=d}return m!==p.length?y(m,6,"Found superfluous content after tag"):h;function y(e,t,n){return f.warning&&f.warning(n,t,e),f.forgiving?h:{language:null,extendedLanguageSubtags:[],script:null,region:null,variants:[],extensions:[],privateuse:[],irregular:null,regular:null}}};var u={}.hasOwnProperty},6713:function(e){"use strict";e.exports=function(e){var t,n,r,i=e||{},a=[];if(i.irregular||i.regular)return i.irregular||i.regular;if(i.language)for(a=a.concat(i.language,i.extendedLanguageSubtags||[],i.script||[],i.region||[],i.variants||[]),t=i.extensions||[],n=-1;++n<t.length;)(r=t[n]).singleton&&r.extensions&&r.extensions.length&&(a=a.concat(r.singleton,r.extensions));return i.privateuse&&i.privateuse.length&&(a=a.concat("x",i.privateuse)),a.join("-")}},1549:function(e,t,n){"use strict";var r=n(6693),i=n(2165),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;var s=2147483647;function o(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return l(e,t,n)}function l(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|g(e,t),r=o(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(q(e,Uint8Array)){var t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(q(e,ArrayBuffer)||e&&q(e.buffer,ArrayBuffer))return h(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(q(e,SharedArrayBuffer)||e&&q(e.buffer,SharedArrayBuffer)))return h(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return u.from(r,t,n);var i=function(e){if(u.isBuffer(e)){var t=0|p(e.length),n=o(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||H(e.length)?o(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return c(e),o(e<0?0:0|p(e))}function f(e){for(var t=e.length<0?0:0|p(e.length),n=o(t),r=0;r<t;r+=1)n[r]=255&e[r];return n}function h(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,u.prototype),r}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function g(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return B(e).length;default:if(i)return r?-1:U(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return x(this,t,n);case"utf8":case"utf-8":return I(this,t,n);case"ascii":return R(this,t,n);case"latin1":case"binary":return D(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),H(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:_(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):_(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function _(e,t,n,r,i){var a,s=1,o=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,o/=2,u/=2,n/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(a=n;a<o;a++)if(l(e,a)===l(t,-1===c?0:a-c)){if(-1===c&&(c=a),a-c+1===u)return c*s}else-1!==c&&(a-=a-c),c=-1}else for(n+u>o&&(n=o-u),a=n;a>=0;a--){for(var d=!0,f=0;f<u;f++)if(l(e,a+f)!==l(t,f)){d=!1;break}if(d)return a}return-1}function T(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var a=t.length;r>a/2&&(r=a/2);for(var s=0;s<r;++s){var o=parseInt(t.substr(2*s,2),16);if(H(o))return s;e[n+s]=o}return s}function b(e,t,n,r){return j(U(t,e.length-n),e,n,r)}function E(e,t,n,r){return j(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function S(e,t,n,r){return j(B(t),e,n,r)}function w(e,t,n,r){return j(function(e,t){for(var n,r,i,a=[],s=0;s<e.length&&!((t-=2)<0);++s)r=(n=e.charCodeAt(s))>>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function A(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function I(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var a,s,o,u,l=e[i],c=null,d=l>239?4:l>223?3:l>191?2:1;if(i+d<=n)switch(d){case 1:l<128&&(c=l);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&l)<<6|63&a)>127&&(c=u);break;case 3:a=e[i+1],s=e[i+2],128==(192&a)&&128==(192&s)&&(u=(15&l)<<12|(63&a)<<6|63&s)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:a=e[i+1],s=e[i+2],o=e[i+3],128==(192&a)&&128==(192&s)&&128==(192&o)&&(u=(15&l)<<18|(63&a)<<12|(63&s)<<6|63&o)>65535&&u<1114112&&(c=u)}null===c?(c=65533,d=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=d}return function(e){var t=e.length;if(t<=C)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=C));return n}(r)}t.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,n){return l(e,t,n)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,n){return function(e,t,n){return c(e),e<=0?o(e):void 0!==t?"string"==typeof n?o(e).fill(t,n):o(e).fill(t):o(e)}(e,t,n)},u.allocUnsafe=function(e){return d(e)},u.allocUnsafeSlow=function(e){return d(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(q(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),q(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(q(a,Uint8Array))i+a.length>r.length?u.from(a).copy(r,i):Uint8Array.prototype.set.call(r,a,i);else{if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i)}i+=a.length}return r},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)y(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},u.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?I(this,0,e):m.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},a&&(u.prototype[a]=u.prototype.inspect),u.prototype.compare=function(e,t,n,r,i){if(q(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),o=Math.min(a,s),l=this.slice(r,i),c=e.slice(t,n),d=0;d<o;++d)if(l[d]!==c[d]){a=l[d],s=c[d];break}return a<s?-1:s<a?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return v(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return v(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return T(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":case"latin1":case"binary":return E(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function R(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function D(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function x(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",a=t;a<n;++a)i+=G[e[a]];return i}function N(e,t,n){for(var r=e.slice(t,n),i="",a=0;a<r.length-1;a+=2)i+=String.fromCharCode(r[a]+256*r[a+1]);return i}function O(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,n,r,i,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function M(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function k(e,t,n,r,a){return t=+t,n>>>=0,a||M(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,a){return t=+t,n>>>=0,a||M(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return Object.setPrototypeOf(r,u.prototype),r},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||O(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||O(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||O(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||O(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},u.prototype.readInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||O(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){e>>>=0,t||O(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return e>>>=0,t||O(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||O(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||O(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||O(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||P(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||P(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);P(this,e,t,n,i-1,-i)}var a=0,s=1,o=0;for(this[t]=255&e;++a<n&&(s*=256);)e<0&&0===o&&0!==this[t+a-1]&&(o=1),this[t+a]=(e/s>>0)-o&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);P(this,e,t,n,i-1,-i)}var a=n-1,s=1,o=0;for(this[t+a]=255&e;--a>=0&&(s*=256);)e<0&&0===o&&0!==this[t+a+1]&&(o=1),this[t+a]=(e/s>>0)-o&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeFloatLE=function(e,t,n){return k(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return k(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){var i=e.charCodeAt(0);("utf8"===r&&i<128||"latin1"===r)&&(e=i)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var a;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a<n;++a)this[a]=e;else{var s=u.isBuffer(e)?e:u.from(e,r),o=s.length;if(0===o)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<n-t;++a)this[a+t]=s[a%o]}return this};var F=/[^+/0-9A-Za-z-_]/g;function U(e,t){var n;t=t||1/0;for(var r=e.length,i=null,a=[],s=0;s<r;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function B(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(F,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function H(e){return e!=e}var G=function(){for(var e="0123456789abcdef",t=new Array(256),n=0;n<16;++n)for(var r=16*n,i=0;i<16;++i)t[r+i]=e[n]+e[i];return t}()},6693:function(e,t){"use strict";t.byteLength=function(e){var t=o(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,a=o(e),s=a[0],u=a[1],l=new i(function(e,t,n){return 3*(t+n)/4-n}(0,s,u)),c=0,d=u>0?s-4:s;for(n=0;n<d;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],l[c++]=t>>16&255,l[c++]=t>>8&255,l[c++]=255&t;return 2===u&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,l[c++]=255&t),1===u&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t),l},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,a=[],s=16383,o=0,l=r-i;o<l;o+=s)a.push(u(e,o,o+s>l?l:o+s));return 1===i?(t=e[r-1],a.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),a.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)n[s]=a[s],r[a.charCodeAt(s)]=s;function o(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,r){for(var i,a,s=[],o=t;o<r;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),s.push(n[(a=i)>>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return s.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},2165:function(e,t){t.read=function(e,t,n,r,i){var a,s,o=8*i-r-1,u=(1<<o)-1,l=u>>1,c=-7,d=n?i-1:0,f=n?-1:1,h=e[t+d];for(d+=f,a=h&(1<<-c)-1,h>>=-c,c+=o;c>0;a=256*a+e[t+d],d+=f,c-=8);for(s=a&(1<<-c)-1,a>>=-c,c+=r;c>0;s=256*s+e[t+d],d+=f,c-=8);if(0===a)a=1-l;else{if(a===u)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,r),a-=l}return(h?-1:1)*s*Math.pow(2,a-r)},t.write=function(e,t,n,r,i,a){var s,o,u,l=8*a-i-1,c=(1<<l)-1,d=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:a-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+d>=1?f/u:f*Math.pow(2,1-d))*u>=2&&(s++,u/=2),s+d>=c?(o=0,s=c):s+d>=1?(o=(t*u-1)*Math.pow(2,i),s+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[n+h]=255&o,h+=p,o/=256,i-=8);for(s=s<<i|o,l+=i;l>0;e[n+h]=255&s,h+=p,s/=256,l-=8);e[n+h-p]|=128*g}},6934:function(e,t){var n={parseBuffer:function(e){return new r(e).parse()},addBoxProcessor:function(e,t){"string"==typeof e&&"function"==typeof t&&(i.prototype._boxProcessors[e]=t)},createFile:function(){return new r},createBox:function(e,t,n){var r=i.create(e);return t&&t.append(r,n),r},createFullBox:function(e,t,r){var i=n.createBox(e,t,r);return i.version=0,i.flags=0,i},Utils:{}};n.Utils.dataViewToString=function(e,t){var n=t||"utf-8";if("undefined"!=typeof TextDecoder)return new TextDecoder(n).decode(e);var r=[],i=0;if("utf-8"===n)for(;i<e.byteLength;){var a=e.getUint8(i++);a<128||(a<224?(a=(31&a)<<6,a|=63&e.getUint8(i++)):a<240?(a=(15&a)<<12,a|=(63&e.getUint8(i++))<<6,a|=63&e.getUint8(i++)):(a=(7&a)<<18,a|=(63&e.getUint8(i++))<<12,a|=(63&e.getUint8(i++))<<6,a|=63&e.getUint8(i++))),r.push(String.fromCharCode(a))}else for(;i<e.byteLength;)r.push(String.fromCharCode(e.getUint8(i++)));return r.join("")},n.Utils.utf8ToByteArray=function(e){var t,n;if("undefined"!=typeof TextEncoder)t=(new TextEncoder).encode(e);else for(t=[],n=0;n<e.length;++n){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?(t.push(192|r>>6),t.push(128|63&r)):r<65536?(t.push(224|r>>12),t.push(128|63&r>>6),t.push(128|63&r)):(t.push(240|r>>18),t.push(128|63&r>>12),t.push(128|63&r>>6),t.push(128|63&r))}return t},n.Utils.appendBox=function(e,t,n){if(t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,-1!==n)if(null!=n){var r,i=-1;if("number"==typeof n)i=n;else{if("string"==typeof n)r=n;else{if("object"!=typeof n||!n.type)return void e.boxes.push(t);r=n.type}for(var a=0;a<e.boxes.length;a++)if(r===e.boxes[a].type){i=a+1;break}}e.boxes.splice(i,0,t)}else e.boxes.push(t)},t.parseBuffer=n.parseBuffer,t.addBoxProcessor=n.addBoxProcessor,t.createFile=n.createFile,t.createBox=n.createBox,t.createFullBox=n.createFullBox,t.Utils=n.Utils,n.Cursor=function(e){this.offset=void 0===e?0:e};var r=function(e){this._cursor=new n.Cursor,this.boxes=[],e&&(this._raw=new DataView(e))};r.prototype.fetch=function(e){var t=this.fetchAll(e,!0);return t.length?t[0]:null},r.prototype.fetchAll=function(e,t){var n=[];return r._sweep.call(this,e,n,t),n},r.prototype.parse=function(){for(this._cursor.offset=0,this.boxes=[];this._cursor.offset<this._raw.byteLength;){var e=i.parse(this);if(void 0===e.type)break;this.boxes.push(e)}return this},r._sweep=function(e,t,n){for(var i in this.type&&this.type==e&&t.push(this),this.boxes){if(t.length&&n)return;r._sweep.call(this.boxes[i],e,t,n)}},r.prototype.write=function(){var e,t=0;for(e=0;e<this.boxes.length;e++)t+=this.boxes[e].getLength(!1);var n=new Uint8Array(t);for(this._rawo=new DataView(n.buffer),this.bytes=n,this._cursor.offset=0,e=0;e<this.boxes.length;e++)this.boxes[e].write();return n.buffer},r.prototype.append=function(e,t){n.Utils.appendBox(this,e,t)};var i=function(){this._cursor=new n.Cursor};i.parse=function(e){var t=new i;return t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,t._parseBox(),e._cursor.offset=t._raw.byteOffset+t._raw.byteLength,t},i.create=function(e){var t=new i;return t.type=e,t.boxes=[],t},i.prototype._boxContainers=["dinf","edts","mdia","meco","mfra","minf","moof","moov","mvex","stbl","strk","traf","trak","tref","udta","vttc","sinf","schi","encv","enca"],i.prototype._boxProcessors={},i.prototype._procField=function(e,t,n){this._parsing?this[e]=this._readField(t,n):this._writeField(t,n,this[e])},i.prototype._procFieldArray=function(e,t,n,r){var i;if(this._parsing)for(this[e]=[],i=0;i<t;i++)this[e][i]=this._readField(n,r);else for(i=0;i<this[e].length;i++)this._writeField(n,r,this[e][i])},i.prototype._procFullBox=function(){this._procField("version","uint",8),this._procField("flags","uint",24)},i.prototype._procEntries=function(e,t,n){var r;if(this._parsing)for(this[e]=[],r=0;r<t;r++)this[e].push({}),n.call(this,this[e][r]);else for(r=0;r<t;r++)n.call(this,this[e][r])},i.prototype._procSubEntries=function(e,t,n,r){var i;if(this._parsing)for(e[t]=[],i=0;i<n;i++)e[t].push({}),r.call(this,e[t][i]);else for(i=0;i<n;i++)r.call(this,e[t][i])},i.prototype._procEntryField=function(e,t,n,r){this._parsing?e[t]=this._readField(n,r):this._writeField(n,r,e[t])},i.prototype._procSubBoxes=function(e,t){var n;if(this._parsing)for(this[e]=[],n=0;n<t;n++)this[e].push(i.parse(this));else for(n=0;n<t;n++)this._rawo?this[e][n].write():this.size+=this[e][n].getLength()},i.prototype._readField=function(e,t){switch(e){case"uint":return this._readUint(t);case"int":return this._readInt(t);case"template":return this._readTemplate(t);case"string":return-1===t?this._readTerminatedString():this._readString(t);case"data":return this._readData(t);case"utf8":return this._readUTF8String();default:return-1}},i.prototype._readInt=function(e){var t=null,n=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:t=this._raw.getInt8(n);break;case 16:t=this._raw.getInt16(n);break;case 32:t=this._raw.getInt32(n);break;case 64:var r=this._raw.getInt32(n),i=this._raw.getInt32(n+4);t=r*Math.pow(2,32)+i}return this._cursor.offset+=e>>3,t},i.prototype._readUint=function(e){var t,n,r=null,i=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:r=this._raw.getUint8(i);break;case 16:r=this._raw.getUint16(i);break;case 24:r=((t=this._raw.getUint16(i))<<8)+(n=this._raw.getUint8(i+2));break;case 32:r=this._raw.getUint32(i);break;case 64:t=this._raw.getUint32(i),n=this._raw.getUint32(i+4),r=t*Math.pow(2,32)+n}return this._cursor.offset+=e>>3,r},i.prototype._readString=function(e){for(var t="",n=0;n<e;n++){var r=this._readUint(8);t+=String.fromCharCode(r)}return t},i.prototype._readTemplate=function(e){return this._readUint(e/2)+this._readUint(e/2)/Math.pow(2,e/2)},i.prototype._readTerminatedString=function(){for(var e="";this._cursor.offset-this._offset<this._raw.byteLength;){var t=this._readUint(8);if(0===t)break;e+=String.fromCharCode(t)}return e},i.prototype._readData=function(e){var t=e>0?e:this._raw.byteLength-(this._cursor.offset-this._offset);if(t>0){var n=new Uint8Array(this._raw.buffer,this._cursor.offset,t);return this._cursor.offset+=t,n}return null},i.prototype._readUTF8String=function(){var e=this._raw.byteLength-(this._cursor.offset-this._offset),t=null;return e>0&&(t=new DataView(this._raw.buffer,this._cursor.offset,e),this._cursor.offset+=e),t?n.Utils.dataViewToString(t):t},i.prototype._parseBox=function(){if(this._parsing=!0,this._cursor.offset=this._offset,this._offset+8>this._raw.buffer.byteLength)this._root._incomplete=!0;else{switch(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset);break;case 1:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.largesize);break;default:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.size)}this._incomplete||(this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type)?this._parseContainerBox():this._data=this._readData())}},i.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},i.prototype._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(i.parse(this))},i.prototype.append=function(e,t){n.Utils.appendBox(this,e,t)},i.prototype.getLength=function(){if(this._parsing=!1,this._rawo=null,this.size=0,this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type))for(var e=0;e<this.boxes.length;e++)this.size+=this.boxes[e].getLength();return this._data&&this._writeData(this._data),this.size},i.prototype.write=function(){switch(this._parsing=!1,this._cursor.offset=this._parent._cursor.offset,this.size){case 0:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.parent._rawo.byteLength-this._cursor.offset);break;case 1:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.largesize);break;default:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.size)}if(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type))for(var e=0;e<this.boxes.length;e++)this.boxes[e].write();return this._data&&this._writeData(this._data),this._parent._cursor.offset+=this.size,this.size},i.prototype._writeInt=function(e,t){if(this._rawo){var n=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setInt8(n,t);break;case 16:this._rawo.setInt16(n,t);break;case 32:this._rawo.setInt32(n,t);break;case 64:var r=Math.floor(t/Math.pow(2,32)),i=t-r*Math.pow(2,32);this._rawo.setUint32(n,r),this._rawo.setUint32(n+4,i)}this._cursor.offset+=e>>3}else this.size+=e>>3},i.prototype._writeUint=function(e,t){if(this._rawo){var n,r,i=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setUint8(i,t);break;case 16:this._rawo.setUint16(i,t);break;case 24:n=(16776960&t)>>8,r=255&t,this._rawo.setUint16(i,n),this._rawo.setUint8(i+2,r);break;case 32:this._rawo.setUint32(i,t);break;case 64:r=t-(n=Math.floor(t/Math.pow(2,32)))*Math.pow(2,32),this._rawo.setUint32(i,n),this._rawo.setUint32(i+4,r)}this._cursor.offset+=e>>3}else this.size+=e>>3},i.prototype._writeString=function(e,t){for(var n=0;n<e;n++)this._writeUint(8,t.charCodeAt(n))},i.prototype._writeTerminatedString=function(e){if(0!==e.length){for(var t=0;t<e.length;t++)this._writeUint(8,e.charCodeAt(t));this._writeUint(8,0)}},i.prototype._writeTemplate=function(e,t){var n=Math.floor(t),r=(t-n)*Math.pow(2,e/2);this._writeUint(e/2,n),this._writeUint(e/2,r)},i.prototype._writeData=function(e){if(e)if(this._rawo){if(e instanceof Array){for(var t=this._cursor.offset-this._rawo.byteOffset,n=0;n<e.length;n++)this._rawo.setInt8(t+n,e[n]);this._cursor.offset+=e.length}e instanceof Uint8Array&&(this._root.bytes.set(e,this._cursor.offset),this._cursor.offset+=e.length)}else this.size+=e.length},i.prototype._writeUTF8String=function(e){var t=n.Utils.utf8ToByteArray(e);if(this._rawo)for(var r=new DataView(this._rawo.buffer,this._cursor.offset,t.length),i=0;i<t.length;i++)r.setUint8(i,t[i]);else this.size+=t.length},i.prototype._writeField=function(e,t,n){switch(e){case"uint":this._writeUint(t,n);break;case"int":this._writeInt(t,n);break;case"template":this._writeTemplate(t,n);break;case"string":-1==t?this._writeTerminatedString(n):this._writeString(t,n);break;case"data":this._writeData(n);break;case"utf8":this._writeUTF8String(n)}},i.prototype._boxProcessors.avc1=i.prototype._boxProcessors.avc2=i.prototype._boxProcessors.avc3=i.prototype._boxProcessors.avc4=i.prototype._boxProcessors.hvc1=i.prototype._boxProcessors.hev1=i.prototype._boxProcessors.encv=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procField("pre_defined1","uint",16),this._procField("reserved2","uint",16),this._procFieldArray("pre_defined2",3,"uint",32),this._procField("width","uint",16),this._procField("height","uint",16),this._procField("horizresolution","template",32),this._procField("vertresolution","template",32),this._procField("reserved3","uint",32),this._procField("frame_count","uint",16),this._procFieldArray("compressorname",32,"uint",8),this._procField("depth","uint",16),this._procField("pre_defined3","int",16),this._procField("config","data",-1)},i.prototype._boxProcessors.ctts=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"sample_count","uint",32),this._procEntryField(e,"sample_offset",1===this.version?"int":"uint",32)}))},i.prototype._boxProcessors.dref=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},i.prototype._boxProcessors.elst=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"segment_duration","uint",1===this.version?64:32),this._procEntryField(e,"media_time","int",1===this.version?64:32),this._procEntryField(e,"media_rate_integer","int",16),this._procEntryField(e,"media_rate_fraction","int",16)}))},i.prototype._boxProcessors.emsg=function(){this._procFullBox(),1==this.version?(this._procField("timescale","uint",32),this._procField("presentation_time","uint",64),this._procField("event_duration","uint",32),this._procField("id","uint",32),this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1)):(this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1),this._procField("timescale","uint",32),this._procField("presentation_time_delta","uint",32),this._procField("event_duration","uint",32),this._procField("id","uint",32)),this._procField("message_data","data",-1)},i.prototype._boxProcessors.free=i.prototype._boxProcessors.skip=function(){this._procField("data","data",-1)},i.prototype._boxProcessors.frma=function(){this._procField("data_format","uint",32)},i.prototype._boxProcessors.ftyp=i.prototype._boxProcessors.styp=function(){this._procField("major_brand","string",4),this._procField("minor_version","uint",32);var e=-1;this._parsing&&(e=(this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset))/4),this._procFieldArray("compatible_brands",e,"string",4)},i.prototype._boxProcessors.hdlr=function(){this._procFullBox(),this._procField("pre_defined","uint",32),this._procField("handler_type","string",4),this._procFieldArray("reserved",3,"uint",32),this._procField("name","string",-1)},i.prototype._boxProcessors.mdat=function(){this._procField("data","data",-1)},i.prototype._boxProcessors.mdhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._parsing||"string"!=typeof this.language||(this.language=this.language.charCodeAt(0)-96<<10|this.language.charCodeAt(1)-96<<5|this.language.charCodeAt(2)-96),this._procField("language","uint",16),this._parsing&&(this.language=String.fromCharCode(96+(this.language>>10&31),96+(this.language>>5&31),96+(31&this.language))),this._procField("pre_defined","uint",16)},i.prototype._boxProcessors.mehd=function(){this._procFullBox(),this._procField("fragment_duration","uint",1==this.version?64:32)},i.prototype._boxProcessors.mfhd=function(){this._procFullBox(),this._procField("sequence_number","uint",32)},i.prototype._boxProcessors.mfro=function(){this._procFullBox(),this._procField("mfra_size","uint",32)},i.prototype._boxProcessors.mp4a=i.prototype._boxProcessors.enca=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procField("channelcount","uint",16),this._procField("samplesize","uint",16),this._procField("pre_defined","uint",16),this._procField("reserved3","uint",16),this._procField("samplerate","template",32),this._procField("esds","data",-1)},i.prototype._boxProcessors.mvhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procField("rate","template",32),this._procField("volume","template",16),this._procField("reserved1","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procFieldArray("matrix",9,"template",32),this._procFieldArray("pre_defined",6,"uint",32),this._procField("next_track_ID","uint",32)},i.prototype._boxProcessors.payl=function(){this._procField("cue_text","utf8")},i.prototype._boxProcessors.prft=function(){this._procFullBox(),this._procField("reference_track_ID","uint",32),this._procField("ntp_timestamp_sec","uint",32),this._procField("ntp_timestamp_frac","uint",32),this._procField("media_time","uint",1==this.version?64:32)},i.prototype._boxProcessors.pssh=function(){this._procFullBox(),this._procFieldArray("SystemID",16,"uint",8),this._procField("DataSize","uint",32),this._procFieldArray("Data",this.DataSize,"uint",8)},i.prototype._boxProcessors.schm=function(){this._procFullBox(),this._procField("scheme_type","uint",32),this._procField("scheme_version","uint",32),1&this.flags&&this._procField("scheme_uri","string",-1)},i.prototype._boxProcessors.sdtp=function(){this._procFullBox();var e=-1;this._parsing&&(e=this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset)),this._procFieldArray("sample_dependency_table",e,"uint",8)},i.prototype._boxProcessors.sidx=function(){this._procFullBox(),this._procField("reference_ID","uint",32),this._procField("timescale","uint",32),this._procField("earliest_presentation_time","uint",1==this.version?64:32),this._procField("first_offset","uint",1==this.version?64:32),this._procField("reserved","uint",16),this._procField("reference_count","uint",16),this._procEntries("references",this.reference_count,(function(e){this._parsing||(e.reference=(1&e.reference_type)<<31,e.reference|=2147483647&e.referenced_size,e.sap=(1&e.starts_with_SAP)<<31,e.sap|=(3&e.SAP_type)<<28,e.sap|=268435455&e.SAP_delta_time),this._procEntryField(e,"reference","uint",32),this._procEntryField(e,"subsegment_duration","uint",32),this._procEntryField(e,"sap","uint",32),this._parsing&&(e.reference_type=e.reference>>31&1,e.referenced_size=2147483647&e.reference,e.starts_with_SAP=e.sap>>31&1,e.SAP_type=e.sap>>28&7,e.SAP_delta_time=268435455&e.sap)}))},i.prototype._boxProcessors.smhd=function(){this._procFullBox(),this._procField("balance","uint",16),this._procField("reserved","uint",16)},i.prototype._boxProcessors.ssix=function(){this._procFullBox(),this._procField("subsegment_count","uint",32),this._procEntries("subsegments",this.subsegment_count,(function(e){this._procEntryField(e,"ranges_count","uint",32),this._procSubEntries(e,"ranges",e.ranges_count,(function(e){this._procEntryField(e,"level","uint",8),this._procEntryField(e,"range_size","uint",24)}))}))},i.prototype._boxProcessors.stsd=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},i.prototype._boxProcessors.sttg=function(){this._procField("settings","utf8")},i.prototype._boxProcessors.stts=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"sample_count","uint",32),this._procEntryField(e,"sample_delta","uint",32)}))},i.prototype._boxProcessors.subs=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"sample_delta","uint",32),this._procEntryField(e,"subsample_count","uint",16),this._procSubEntries(e,"subsamples",e.subsample_count,(function(e){this._procEntryField(e,"subsample_size","uint",1===this.version?32:16),this._procEntryField(e,"subsample_priority","uint",8),this._procEntryField(e,"discardable","uint",8),this._procEntryField(e,"codec_specific_parameters","uint",32)}))}))},i.prototype._boxProcessors.tenc=function(){this._procFullBox(),this._procField("default_IsEncrypted","uint",24),this._procField("default_IV_size","uint",8),this._procFieldArray("default_KID",16,"uint",8)},i.prototype._boxProcessors.tfdt=function(){this._procFullBox(),this._procField("baseMediaDecodeTime","uint",1==this.version?64:32)},i.prototype._boxProcessors.tfhd=function(){this._procFullBox(),this._procField("track_ID","uint",32),1&this.flags&&this._procField("base_data_offset","uint",64),2&this.flags&&this._procField("sample_description_offset","uint",32),8&this.flags&&this._procField("default_sample_duration","uint",32),16&this.flags&&this._procField("default_sample_size","uint",32),32&this.flags&&this._procField("default_sample_flags","uint",32)},i.prototype._boxProcessors.tfra=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._parsing||(this.reserved=0,this.reserved|=(48&this.length_size_of_traf_num)<<4,this.reserved|=(12&this.length_size_of_trun_num)<<2,this.reserved|=3&this.length_size_of_sample_num),this._procField("reserved","uint",32),this._parsing&&(this.length_size_of_traf_num=(48&this.reserved)>>4,this.length_size_of_trun_num=(12&this.reserved)>>2,this.length_size_of_sample_num=3&this.reserved),this._procField("number_of_entry","uint",32),this._procEntries("entries",this.number_of_entry,(function(e){this._procEntryField(e,"time","uint",1===this.version?64:32),this._procEntryField(e,"moof_offset","uint",1===this.version?64:32),this._procEntryField(e,"traf_number","uint",8*(this.length_size_of_traf_num+1)),this._procEntryField(e,"trun_number","uint",8*(this.length_size_of_trun_num+1)),this._procEntryField(e,"sample_number","uint",8*(this.length_size_of_sample_num+1))}))},i.prototype._boxProcessors.tkhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("track_ID","uint",32),this._procField("reserved1","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procFieldArray("reserved2",2,"uint",32),this._procField("layer","uint",16),this._procField("alternate_group","uint",16),this._procField("volume","template",16),this._procField("reserved3","uint",16),this._procFieldArray("matrix",9,"template",32),this._procField("width","template",32),this._procField("height","template",32)},i.prototype._boxProcessors.trex=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._procField("default_sample_description_index","uint",32),this._procField("default_sample_duration","uint",32),this._procField("default_sample_size","uint",32),this._procField("default_sample_flags","uint",32)},i.prototype._boxProcessors.trun=function(){this._procFullBox(),this._procField("sample_count","uint",32),1&this.flags&&this._procField("data_offset","int",32),4&this.flags&&this._procField("first_sample_flags","uint",32),this._procEntries("samples",this.sample_count,(function(e){256&this.flags&&this._procEntryField(e,"sample_duration","uint",32),512&this.flags&&this._procEntryField(e,"sample_size","uint",32),1024&this.flags&&this._procEntryField(e,"sample_flags","uint",32),2048&this.flags&&this._procEntryField(e,"sample_composition_time_offset",1===this.version?"int":"uint",32)}))},i.prototype._boxProcessors["url "]=i.prototype._boxProcessors["urn "]=function(){this._procFullBox(),"urn "===this.type&&this._procField("name","string",-1),this._procField("location","string",-1)},i.prototype._boxProcessors.vlab=function(){this._procField("source_label","utf8")},i.prototype._boxProcessors.vmhd=function(){this._procFullBox(),this._procField("graphicsmode","uint",16),this._procFieldArray("opcolor",3,"uint",16)},i.prototype._boxProcessors.vttC=function(){this._procField("config","utf8")},i.prototype._boxProcessors.vtte=function(){}},5530:function(e,t,n){"use strict";e.exports=n(6146).polyfill()},6146:function(e,t,n){e.exports=function(){"use strict";function e(e){return"function"==typeof e}var t=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},r=0,i=void 0,a=void 0,s=function(e,t){h[r]=e,h[r+1]=t,2===(r+=2)&&(a?a(p):_())},o="undefined"!=typeof window?window:void 0,u=o||{},l=u.MutationObserver||u.WebKitMutationObserver,c="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function f(){var e=setTimeout;return function(){return e(p,1)}}var h=new Array(1e3);function p(){for(var e=0;e<r;e+=2)(0,h[e])(h[e+1]),h[e]=void 0,h[e+1]=void 0;r=0}var g,m,y,v,_=void 0;function T(e,t){var n=this,r=new this.constructor(S);void 0===r[E]&&M(r);var i=n._state;if(i){var a=arguments[i-1];s((function(){return O(i,r,a,n._result)}))}else x(n,r,e,t);return r}function b(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(S);return I(t,e),t}_=c?function(){return process.nextTick(p)}:l?(m=0,y=new l(p),v=document.createTextNode(""),y.observe(v,{characterData:!0}),function(){v.data=m=++m%2}):d?((g=new MessageChannel).port1.onmessage=p,function(){return g.port2.postMessage(0)}):void 0===o?function(){try{var e=Function("return this")().require("vertx");return void 0!==(i=e.runOnLoop||e.runOnContext)?function(){i(p)}:f()}catch(e){return f()}}():f();var E=Math.random().toString(36).substring(2);function S(){}var w=void 0;function A(t,n,r){n.constructor===t.constructor&&r===T&&n.constructor.resolve===b?function(e,t){1===t._state?R(e,t._result):2===t._state?D(e,t._result):x(t,void 0,(function(t){return I(e,t)}),(function(t){return D(e,t)}))}(t,n):void 0===r?R(t,n):e(r)?function(e,t,n){s((function(e){var r=!1,i=function(e,t,n,r){try{e.call(t,n,r)}catch(e){return e}}(n,t,(function(n){r||(r=!0,t!==n?I(e,n):R(e,n))}),(function(t){r||(r=!0,D(e,t))}),e._label);!r&&i&&(r=!0,D(e,i))}),e)}(t,n,r):R(t,n)}function I(e,t){if(e===t)D(e,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(r=t),null===r||"object"!==i&&"function"!==i)R(e,t);else{var n=void 0;try{n=t.then}catch(t){return void D(e,t)}A(e,t,n)}var r,i}function C(e){e._onerror&&e._onerror(e._result),N(e)}function R(e,t){e._state===w&&(e._result=t,e._state=1,0!==e._subscribers.length&&s(N,e))}function D(e,t){e._state===w&&(e._state=2,e._result=t,s(C,e))}function x(e,t,n,r){var i=e._subscribers,a=i.length;e._onerror=null,i[a]=t,i[a+1]=n,i[a+2]=r,0===a&&e._state&&s(N,e)}function N(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r=void 0,i=void 0,a=e._result,s=0;s<t.length;s+=3)r=t[s],i=t[s+n],r?O(n,r,i,a):i(a);e._subscribers.length=0}}function O(t,n,r,i){var a=e(r),s=void 0,o=void 0,u=!0;if(a){try{s=r(i)}catch(e){u=!1,o=e}if(n===s)return void D(n,new TypeError("A promises callback cannot return that same promise."))}else s=i;n._state!==w||(a&&u?I(n,s):!1===u?D(n,o):1===t?R(n,s):2===t&&D(n,s))}var P=0;function M(e){e[E]=P++,e._state=void 0,e._result=void 0,e._subscribers=[]}var k=function(){function e(e,n){this._instanceConstructor=e,this.promise=new e(S),this.promise[E]||M(this.promise),t(n)?(this.length=n.length,this._remaining=n.length,this._result=new Array(this.length),0===this.length?R(this.promise,this._result):(this.length=this.length||0,this._enumerate(n),0===this._remaining&&R(this.promise,this._result))):D(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var t=0;this._state===w&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,r=n.resolve;if(r===b){var i=void 0,a=void 0,s=!1;try{i=e.then}catch(e){s=!0,a=e}if(i===T&&e._state!==w)this._settledAt(e._state,t,e._result);else if("function"!=typeof i)this._remaining--,this._result[t]=e;else if(n===L){var o=new n(S);s?D(o,a):A(o,e,i),this._willSettleAt(o,t)}else this._willSettleAt(new n((function(t){return t(e)})),t)}else this._willSettleAt(r(e),t)},e.prototype._settledAt=function(e,t,n){var r=this.promise;r._state===w&&(this._remaining--,2===e?D(r,n):this._result[t]=n),0===this._remaining&&R(r,this._result)},e.prototype._willSettleAt=function(e,t){var n=this;x(e,void 0,(function(e){return n._settledAt(1,t,e)}),(function(e){return n._settledAt(2,t,e)}))},e}(),L=function(){function t(e){this[E]=P++,this._result=this._state=void 0,this._subscribers=[],S!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof t?function(e,t){try{t((function(t){I(e,t)}),(function(t){D(e,t)}))}catch(t){D(e,t)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return t.prototype.catch=function(e){return this.then(null,e)},t.prototype.finally=function(t){var n=this,r=n.constructor;return e(t)?n.then((function(e){return r.resolve(t()).then((function(){return e}))}),(function(e){return r.resolve(t()).then((function(){throw e}))})):n.then(t,t)},t}();return L.prototype.then=T,L.all=function(e){return new k(this,e).promise},L.race=function(e){var n=this;return t(e)?new n((function(t,r){for(var i=e.length,a=0;a<i;a++)n.resolve(e[a]).then(t,r)})):new n((function(e,t){return t(new TypeError("You must pass an array to race."))}))},L.resolve=b,L.reject=function(e){var t=new this(S);return D(t,e),t},L._setScheduler=function(e){a=e},L._setAsap=function(e){s=e},L._asap=s,L.polyfill=function(){var e=void 0;if(void 0!==n.g)e=n.g;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===r&&!t.cast)return}e.Promise=L},L.Promise=L,L}()},1159:function(e){"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}g(e,t,a,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&g(e,"error",t,{once:!0})}(e,i)}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var s=10;function o(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var i,a,s,l;if(o(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),s=a[t]),void 0===s)s=a[t]=n,++e._eventsCount;else if("function"==typeof s?s=a[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,l=c,console&&console.warn&&console.warn(l)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=c.bind(r);return i.listener=n,r.wrapFn=i,i}function f(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):p(i,i.length)}function h(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function g(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(a){r.once&&e.removeEventListener(t,i),n(a)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return u(this)},a.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,a=this._events;if(void 0!==a)i=i&&void 0===a.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var u=a[e];if(void 0===u)return!1;if("function"==typeof u)r(u,this,t);else{var l=u.length,c=p(u,l);for(n=0;n<l;++n)r(c[n],this,t)}return!0},a.prototype.addListener=function(e,t){return l(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return l(this,e,t,!0)},a.prototype.once=function(e,t){return o(t),this.on(e,d(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return o(t),this.prependListener(e,d(this,e,t)),this},a.prototype.removeListener=function(e,t){var n,r,i,a,s;if(o(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){s=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(i=a[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},a.prototype.listeners=function(e){return f(this,e,!0)},a.prototype.rawListeners=function(e){return f(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},a.prototype.listenerCount=h,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},3101:function(e){"use strict";var t=Array.isArray,n=Object.keys,r=Object.prototype.hasOwnProperty;e.exports=function e(i,a){if(i===a)return!0;if(i&&a&&"object"==typeof i&&"object"==typeof a){var s,o,u,l=t(i),c=t(a);if(l&&c){if((o=i.length)!=a.length)return!1;for(s=o;0!=s--;)if(!e(i[s],a[s]))return!1;return!0}if(l!=c)return!1;var d=i instanceof Date,f=a instanceof Date;if(d!=f)return!1;if(d&&f)return i.getTime()==a.getTime();var h=i instanceof RegExp,p=a instanceof RegExp;if(h!=p)return!1;if(h&&p)return i.toString()==a.toString();var g=n(i);if((o=g.length)!==n(a).length)return!1;for(s=o;0!=s--;)if(!r.call(a,g[s]))return!1;for(s=o;0!=s--;)if(!e(i[u=g[s]],a[u]))return!1;return!0}return i!=i&&a!=a}},3362:function(e,t,n){!function(e,t,n,r,i){function a(e){if("contents"in e)for(var t=("styleAttrs"in e?e.styleAttrs[r.byName.ruby.qname]:null),n="span"===e.kind&&("container"===t||"textContainer"===t||"baseContainer"===t),i=e.contents.length-1;i>=0;i--)!n||"styleAttrs"in e.contents[i]&&r.byName.ruby.qname in e.contents[i].styleAttrs?a(e.contents[i]):delete e.contents[i]}function s(e,t,n,r){var i=r&&"seq"===r.timeContainer,a=0;r&&(a=i&&n?n.end:r.begin),t.begin=t.explicit_begin?t.explicit_begin+a:a;var o=t.begin,u=null;if("sets"in t)for(var l=0;l<t.sets.length;l++)s(e,t.sets[l],u,t),o="seq"===t.timeContainer?t.sets[l].end:Math.max(o,t.sets[l].end),u=t.sets[l];if("contents"in t){if("contents"in t)for(var c=0;c<t.contents.length;c++)s(e,t.contents[c],u,t),o="seq"===t.timeContainer?t.contents[c].end:Math.max(o,t.contents[c].end),u=t.contents[c]}else o=i?t.begin:Number.POSITIVE_INFINITY;null!==t.explicit_end&&null!==t.explicit_dur?t.end=Math.min(t.begin+t.explicit_dur,a+t.explicit_end):null===t.explicit_end&&null!==t.explicit_dur?t.end=t.begin+t.explicit_dur:null!==t.explicit_end&&null===t.explicit_dur?t.end=a+t.explicit_end:t.end=o,delete t.explicit_begin,delete t.explicit_dur,delete t.explicit_end,e._registerEvent(t)}function o(e){this.node=e}function u(){this.events=[],this.head=new l,this.body=null}function l(){this.styling=new c,this.layout=new h}function c(){this.styles={},this.initials={}}function d(){this.id=null,this.styleAttrs=null,this.styleRefs=null}function f(){this.styleAttrs=null}function h(){this.regions={}}function p(e,t){g.call(this,"image"),this.src=e,this.type=t}function g(e){this.kind=e}function m(e){this.id=e}function y(e){this.regionID=e}function v(e){this.styleAttrs=e}function _(e){this.sets=e}function T(e){this.contents=e}function b(e,t,n){this.explicit_begin=e,this.explicit_end=t,this.explicit_dur=n}function E(){g.call(this,"body")}function S(){g.call(this,"div")}function w(){g.call(this,"p")}function A(){g.call(this,"span")}function I(){g.call(this,"span")}function C(){g.call(this,"br")}function R(){}function D(){}function x(e){return e&&"xml:id"in e.attributes&&e.attributes["xml:id"].value||null}function N(e){return e&&"style"in e.attributes?e.attributes.style.value.split(" "):[]}function O(e,t){var n={};if(null!==e)for(var i in e.attributes){var a=e.attributes[i].uri+" "+e.attributes[i].local,s=r.byQName[a];if(void 0!==s){var o=s.parse(e.attributes[i].value);null!==o?(n[a]=o,s===r.byName.zIndex&&U(t,"zIndex attribute present but not used by IMSC1 since regions do not overlap")):B(t,"Cannot parse styling attribute "+a+" --\x3e "+e.attributes[i].value)}}return n}function P(e,t,n){for(var r in e.attributes)if(e.attributes[r].uri===t&&e.attributes[r].local===n)return e.attributes[r].value;return null}function M(e,t,n){var r,i=null;return null!==(r=/^(\d+(?:\.\d+)?)f$/.exec(n))?null!==t&&(i=parseFloat(r[1])/t):null!==(r=/^(\d+(?:\.\d+)?)t$/.exec(n))?null!==e&&(i=parseFloat(r[1])/e):null!==(r=/^(\d+(?:\.\d+)?)ms$/.exec(n))?i=parseFloat(r[1])/1e3:null!==(r=/^(\d+(?:\.\d+)?)s$/.exec(n))?i=parseFloat(r[1]):null!==(r=/^(\d+(?:\.\d+)?)h$/.exec(n))?i=3600*parseFloat(r[1]):null!==(r=/^(\d+(?:\.\d+)?)m$/.exec(n))?i=60*parseFloat(r[1]):null!==(r=/^(\d{2,}):(\d\d):(\d\d(?:\.\d+)?)$/.exec(n))?i=3600*parseInt(r[1])+60*parseInt(r[2])+parseFloat(r[3]):null!==(r=/^(\d{2,}):(\d\d):(\d\d)\:(\d{2,})$/.exec(n))&&null!==t&&(i=3600*parseInt(r[1])+60*parseInt(r[2])+parseInt(r[3])+(null===r[4]?0:parseInt(r[4])/t)),i}function k(e,t,n){for(;t.styleRefs.length>0;){var r=t.styleRefs.pop();r in e.styles?(k(e,e.styles[r],n),F(e.styles[r].styleAttrs,t.styleAttrs)):B(n,"Non-existant style id referenced")}}function L(e,t,n,r){for(var i=t.length-1;i>=0;i--){var a=t[i];a in e.styles?F(e.styles[a].styleAttrs,n):B(r,"Non-existant style id referenced")}}function F(e,t){for(var n in e)e.hasOwnProperty(n)&&(n in t||(t[n]=e[n]))}function U(e,t){if(e&&e.warn&&e.warn(t))throw t}function B(e,t){if(e&&e.error&&e.error(t))throw t}function j(e,t){throw e&&e.fatal&&e.fatal(t),t}function q(e,t){for(var n,r=0,i=e.length-1;r<=i;){var a=e[n=Math.floor((r+i)/2)];if(a<t)r=n+1;else{if(!(a>t))return{found:!0,index:n};i=n-1}}return{found:!1,index:r}}e.fromXML=function(e,i,g){var m=t.parser(!0,{xmlns:!0}),y=[],v=[],_=[],T=0,b=null;m.onclosetag=function(e){if(y[0]instanceof R)null!==b.head&&null!==b.head.styling&&L(b.head.styling,y[0].styleRefs,y[0].styleAttrs,i),delete y[0].styleRefs;else if(y[0]instanceof c)for(var t in y[0].styles)y[0].styles.hasOwnProperty(t)&&k(y[0],y[0].styles[t],i);else if(y[0]instanceof w||y[0]instanceof A){if(y[0].contents.length>1){var r,a=[y[0].contents[0]];for(r=1;r<y[0].contents.length;r++)y[0].contents[r]instanceof I&&a[a.length-1]instanceof I?a[a.length-1].text+=y[0].contents[r].text:a.push(y[0].contents[r]);y[0].contents=a}y[0]instanceof A&&1===y[0].contents.length&&y[0].contents[0]instanceof I&&(y[0].text=y[0].contents[0].text,delete y[0].contents)}else y[0]instanceof o&&(y[0].node.uri===n.ns_tt&&"metadata"===y[0].node.local?T--:T>0&&g&&"onCloseTag"in g&&g.onCloseTag());_.shift(),v.shift(),y.shift()},m.ontext=function(e){if(void 0===y[0]);else if(y[0]instanceof A||y[0]instanceof w){if(y[0]instanceof A){var t=y[0].styleAttrs[r.byName.ruby.qname];if("container"===t||"textContainer"===t||"baseContainer"===t)return}var n=new I;n.initFromText(b,y[0],e,v[0],_[0],i),y[0].contents.push(n)}else y[0]instanceof o&&T>0&&g&&"onText"in g&&g.onText(e)},m.onopentag=function(e){var t=e.attributes["xml:space"];t?_.unshift(t.value):0===_.length?_.unshift("default"):_.unshift(_[0]);var a=e.attributes["xml:lang"];if(a?v.unshift(a.value):0===v.length?v.unshift(""):v.unshift(v[0]),e.uri===n.ns_tt)if("tt"===e.local)null!==b&&j(i,"Two <tt> elements at ("+this.line+","+this.column+")"),(b=new u).initFromNode(e,v[0],i),y.unshift(b);else if("head"===e.local)y[0]instanceof u||j(i,"Parent of <head> element is not <tt> at ("+this.line+","+this.column+")"),y.unshift(b.head);else if("styling"===e.local)y[0]instanceof l||j(i,"Parent of <styling> element is not <head> at ("+this.line+","+this.column+")"),y.unshift(b.head.styling);else if("style"===e.local){var s;y[0]instanceof c?((s=new d).initFromNode(e,i),s.id?b.head.styling.styles[s.id]=s:B(i,"<style> element missing @id attribute"),y.unshift(s)):y[0]instanceof R?((s=new d).initFromNode(e,i),F(s.styleAttrs,y[0].styleAttrs),y.unshift(s)):j(i,"Parent of <style> element is not <styling> or <region> at ("+this.line+","+this.column+")")}else if("initial"===e.local){var m;if(y[0]instanceof c){for(var I in(m=new f).initFromNode(e,i),m.styleAttrs)m.styleAttrs.hasOwnProperty(I)&&(b.head.styling.initials[I]=m.styleAttrs[I]);y.unshift(m)}else j(i,"Parent of <initial> element is not <styling> at ("+this.line+","+this.column+")")}else if("layout"===e.local)y[0]instanceof l||j(i,"Parent of <layout> element is not <head> at "+this.line+","+this.column+")"),y.unshift(b.head.layout);else if("region"===e.local){y[0]instanceof h||j(i,"Parent of <region> element is not <layout> at "+this.line+","+this.column+")");var x=new R;x.initFromNode(b,e,v[0],i),!x.id||x.id in b.head.layout.regions?B(i,"Ignoring <region> with duplicate or missing @id at "+this.line+","+this.column+")"):b.head.layout.regions[x.id]=x,y.unshift(x)}else if("body"===e.local){y[0]instanceof u||j(i,"Parent of <body> element is not <tt> at "+this.line+","+this.column+")"),null!==b.body&&j(i,"Second <body> element at "+this.line+","+this.column+")");var N=new E;N.initFromNode(b,e,v[0],i),b.body=N,y.unshift(N)}else if("div"===e.local){y[0]instanceof S||y[0]instanceof E||j(i,"Parent of <div> element is not <body> or <div> at "+this.line+","+this.column+")");var O=new S;O.initFromNode(b,y[0],e,v[0],i);var P=O.styleAttrs[r.byName.backgroundImage.qname];P&&(O.contents.push(new p(P)),delete O.styleAttrs[r.byName.backgroundImage.qname]),y[0].contents.push(O),y.unshift(O)}else if("image"===e.local){y[0]instanceof S||j(i,"Parent of <image> element is not <div> at "+this.line+","+this.column+")");var M=new p;M.initFromNode(b,y[0],e,v[0],i),y[0].contents.push(M),y.unshift(M)}else if("p"===e.local){y[0]instanceof S||j(i,"Parent of <p> element is not <div> at "+this.line+","+this.column+")");var k=new w;k.initFromNode(b,y[0],e,v[0],i),y[0].contents.push(k),y.unshift(k)}else if("span"===e.local){y[0]instanceof A||y[0]instanceof w||j(i,"Parent of <span> element is not <span> or <p> at "+this.line+","+this.column+")");var L=new A;L.initFromNode(b,y[0],e,v[0],_[0],i),y[0].contents.push(L),y.unshift(L)}else if("br"===e.local){y[0]instanceof A||y[0]instanceof w||j(i,"Parent of <br> element is not <span> or <p> at "+this.line+","+this.column+")");var U=new C;U.initFromNode(b,y[0],e,v[0],i),y[0].contents.push(U),y.unshift(U)}else if("set"===e.local){y[0]instanceof A||y[0]instanceof w||y[0]instanceof S||y[0]instanceof E||y[0]instanceof R||y[0]instanceof C||j(i,"Parent of <set> element is not a content element or a region at "+this.line+","+this.column+")");var q=new D;q.initFromNode(b,y[0],e,i),y[0].sets.push(q),y.unshift(q)}else y.unshift(new o(e));else y.unshift(new o(e));if(y[0]instanceof o)if(e.uri===n.ns_tt&&"metadata"===e.local)T++;else if(T>0&&g&&"onOpenTag"in g){var H=[];for(var G in e.attributes)H[e.attributes[G].uri+" "+e.attributes[G].local]={uri:e.attributes[G].uri,local:e.attributes[G].local,value:e.attributes[G].value};g.onOpenTag(e.uri,e.local,H)}},m.write(e).close(),delete b.head.styling.styles;var x=!1;for(var N in b.head.layout.regions)if(b.head.layout.regions.hasOwnProperty(N)){x=!0;break}if(!x){var O=R.prototype.createDefaultRegion(b.lang);b.head.layout.regions[O.id]=O}for(var P in b.head.layout.regions)b.head.layout.regions.hasOwnProperty(P)&&s(b,b.head.layout.regions[P],null,null);return b.body&&s(b,b.body,null,null),b.body&&a(b.body),b},u.prototype.initFromNode=function(e,t,r){var a=function(e,t){var r=P(e,n.ns_ttp,"cellResolution"),i=15,a=32;if(null!==r){var s=/(\d+) (\d+)/.exec(r);null!==s?(a=parseInt(s[1]),i=parseInt(s[2])):U(t,"Malformed cellResolution value (using initial value instead)")}return{w:a,h:i}}(e,r);this.cellLength={h:new i.ComputedLength(0,1/a.h),w:new i.ComputedLength(1/a.w,0)};var s=function(e,t){var r,i=P(e,n.ns_ttp,"frameRate"),a=30;null!==i&&(null!==(r=/(\d+)/.exec(i))?a=parseInt(r[1]):U(t,"Malformed frame rate attribute (using initial value instead)"));var s=P(e,n.ns_ttp,"frameRateMultiplier"),o=1;null!==s&&(null!==(r=/(\d+) (\d+)/.exec(s))?o=parseInt(r[1])/parseInt(r[2]):U(t,"Malformed frame rate multiplier attribute (using initial value instead)"));var u=o*a,l=1,c=P(e,n.ns_ttp,"tickRate");return null===c?null!==i&&(l=u):null!==(r=/(\d+)/.exec(c))?l=parseInt(r[1]):U(t,"Malformed tick rate attribute (using initial value instead)"),{effectiveFrameRate:u,tickRate:l}}(e,r);this.effectiveFrameRate=s.effectiveFrameRate,this.tickRate=s.tickRate,this.aspectRatio=function(e,t){var r=P(e,n.ns_ittp,"aspectRatio");null===r&&(r=P(e,n.ns_ttp,"displayAspectRatio"));var i=null;if(null!==r){var a=/(\d+)\s+(\d+)/.exec(r);if(null!==a){var s=parseInt(a[1]),o=parseInt(a[2]);0!==s&&0!==o?i=s/o:B(t,"Illegal aspectRatio values (ignoring)")}else B(t,"Malformed aspectRatio attribute (ignoring)")}return i}(e,r);var o=P(e,n.ns_ttp,"timeBase");null!==o&&"media"!==o&&j(r,"Unsupported time base");var u=function(e,t){var r=P(e,n.ns_tts,"extent");if(null===r)return null;var a=r.split(" ");if(2!==a.length)return U(t,"Malformed extent (ignoring)"),null;var s=i.parseLength(a[0]),o=i.parseLength(a[1]);return o&&s?{h:o,w:s}:(U(t,"Malformed extent values (ignoring)"),null)}(e,r);null===u?this.pxLength={h:null,w:null}:("px"===u.h.unit&&"px"===u.w.unit||j(r,"Extent on TT must be in px or absent"),this.pxLength={h:new i.ComputedLength(0,1/u.h.value),w:new i.ComputedLength(1/u.w.value,0)}),this.dimensions={h:new i.ComputedLength(0,1),w:new i.ComputedLength(1,0)},this.lang=t},u.prototype._registerEvent=function(e){if(!(e.end<=e.begin)){var t=q(this.events,e.begin);if(t.found||this.events.splice(t.index,0,e.begin),e.end!==Number.POSITIVE_INFINITY){var n=q(this.events,e.end);n.found||this.events.splice(n.index,0,e.end)}}},u.prototype.getMediaTimeRange=function(){return[this.events[0],this.events[this.events.length-1]]},u.prototype.getMediaTimeEvents=function(){return this.events},d.prototype.initFromNode=function(e,t){this.id=x(e),this.styleAttrs=O(e,t),this.styleRefs=N(e)},f.prototype.initFromNode=function(e,t){for(var r in this.styleAttrs={},e.attributes)if(e.attributes[r].uri===n.ns_itts||e.attributes[r].uri===n.ns_ebutts||e.attributes[r].uri===n.ns_tts){var i=e.attributes[r].uri+" "+e.attributes[r].local;this.styleAttrs[i]=e.attributes[r].value}},p.prototype.initFromNode=function(e,t,n,r,i){this.src="src"in n.attributes?n.attributes.src.value:null,this.src||B(i,"Invalid image@src attribute"),this.type="type"in n.attributes?n.attributes.type.value:null,this.type||B(i,"Invalid image@type attribute"),v.prototype.initFromNode.call(this,e,t,n,i),b.prototype.initFromNode.call(this,e,t,n,i),_.prototype.initFromNode.call(this,e,t,n,i),y.prototype.initFromNode.call(this,e,t,n,i),this.lang=r},m.prototype.initFromNode=function(e,t,n,r){this.id=x(n)},y.prototype.initFromNode=function(e,t,n,r){this.regionID=function(e){return e&&"region"in e.attributes?e.attributes.region.value:""}(n)},v.prototype.initFromNode=function(e,t,n,r){this.styleAttrs=O(n,r),null!==e.head&&null!==e.head.styling&&L(e.head.styling,N(n),this.styleAttrs,r)},_.prototype.initFromNode=function(e,t,n,r){this.sets=[]},T.prototype.initFromNode=function(e,t,n,r){this.contents=[]},b.prototype.initFromNode=function(e,t,n,r){var i=function(e,t,n,r){var i=null;n&&"begin"in n.attributes&&null===(i=M(e.tickRate,e.effectiveFrameRate,n.attributes.begin.value))&&U(r,"Malformed begin value "+n.attributes.begin.value+" (using 0)");var a=null;n&&"dur"in n.attributes&&null===(a=M(e.tickRate,e.effectiveFrameRate,n.attributes.dur.value))&&U(r,"Malformed dur value "+n.attributes.dur.value+" (ignoring)");var s=null;return n&&"end"in n.attributes&&null===(s=M(e.tickRate,e.effectiveFrameRate,n.attributes.end.value))&&U(r,"Malformed end value (ignoring)"),{explicit_begin:i,explicit_end:s,explicit_dur:a}}(e,0,n,r);this.explicit_begin=i.explicit_begin,this.explicit_end=i.explicit_end,this.explicit_dur=i.explicit_dur,this.timeContainer=function(e,t){var n=e&&"timeContainer"in e.attributes?e.attributes.timeContainer.value:null;return n&&"par"!==n?"seq"===n?"seq":(B(t,"Illegal value of timeContainer (assuming 'par')"),"par"):"par"}(n,r)},E.prototype.initFromNode=function(e,t,n,r){v.prototype.initFromNode.call(this,e,null,t,r),b.prototype.initFromNode.call(this,e,null,t,r),_.prototype.initFromNode.call(this,e,null,t,r),y.prototype.initFromNode.call(this,e,null,t,r),T.prototype.initFromNode.call(this,e,null,t,r),this.lang=n},S.prototype.initFromNode=function(e,t,n,r,i){v.prototype.initFromNode.call(this,e,t,n,i),b.prototype.initFromNode.call(this,e,t,n,i),_.prototype.initFromNode.call(this,e,t,n,i),y.prototype.initFromNode.call(this,e,t,n,i),T.prototype.initFromNode.call(this,e,t,n,i),this.lang=r},w.prototype.initFromNode=function(e,t,n,r,i){v.prototype.initFromNode.call(this,e,t,n,i),b.prototype.initFromNode.call(this,e,t,n,i),_.prototype.initFromNode.call(this,e,t,n,i),y.prototype.initFromNode.call(this,e,t,n,i),T.prototype.initFromNode.call(this,e,t,n,i),this.lang=r},A.prototype.initFromNode=function(e,t,n,r,i,a){v.prototype.initFromNode.call(this,e,t,n,a),b.prototype.initFromNode.call(this,e,t,n,a),_.prototype.initFromNode.call(this,e,t,n,a),y.prototype.initFromNode.call(this,e,t,n,a),T.prototype.initFromNode.call(this,e,t,n,a),this.space=i,this.lang=r},I.prototype.initFromText=function(e,t,n,r,i,a){b.prototype.initFromNode.call(this,e,t,null,a),this.text=n,this.space=i,this.lang=r},C.prototype.initFromNode=function(e,t,n,r,i){y.prototype.initFromNode.call(this,e,t,n,i),b.prototype.initFromNode.call(this,e,t,n,i),this.lang=r},R.prototype.createDefaultRegion=function(e){var t=new R;return m.call(t,""),v.call(t,{}),_.call(t,[]),b.call(t,0,Number.POSITIVE_INFINITY,null),this.lang=e,t},R.prototype.initFromNode=function(e,t,n,r){m.prototype.initFromNode.call(this,e,null,t,r),b.prototype.initFromNode.call(this,e,null,t,r),_.prototype.initFromNode.call(this,e,null,t,r),this.styleAttrs=O(t,r),this.styleRefs=N(t),this.lang=n},D.prototype.initFromNode=function(e,t,n,r){b.prototype.initFromNode.call(this,e,t,n,r);var i=O(n,r);for(var a in this.qname=null,this.value=null,i)if(i.hasOwnProperty(a)){if(this.qname){B(r,"More than one style specified on set");break}this.qname=a,this.value=i[a]}}}(t,"undefined"==typeof sax?n(5378):sax,"undefined"==typeof imscNames?n(210):imscNames,"undefined"==typeof imscStyles?n(6811):imscStyles,"undefined"==typeof imscUtils?n(5926):imscUtils)},506:function(e,t,n){var r=/firefox/i.test(navigator.userAgent);!function(e,t,n){function i(e,t,d,h){var p;if("region"===d.kind)(p=document.createElement("div")).style.position="absolute";else if("body"===d.kind)p=document.createElement("div");else if("div"===d.kind)p=document.createElement("div");else if("image"===d.kind){if(p=document.createElement("img"),null!==e.imgResolver&&null!==d.src){var y=e.imgResolver(d.src,p);y&&(p.src=y),p.height=e.regionH,p.width=e.regionW}}else if("p"===d.kind)p=document.createElement("p");else if("span"===d.kind)if("container"===d.styleAttrs[n.byName.ruby.qname])p=document.createElement("ruby"),e.ruby=!0;else if("base"===d.styleAttrs[n.byName.ruby.qname])p=document.createElement("span");else if("text"===d.styleAttrs[n.byName.ruby.qname])p=document.createElement("rt");else if("baseContainer"===d.styleAttrs[n.byName.ruby.qname])p=document.createElement("rbc");else if("textContainer"===d.styleAttrs[n.byName.ruby.qname])p=document.createElement("rtc");else{if("delimiter"===d.styleAttrs[n.byName.ruby.qname])return;p=document.createElement("span")}else"br"===d.kind&&(p=document.createElement("br"));if(p){if(d.lang&&("region"!==d.kind&&d.lang===h.lang||(p.lang=d.lang)),t.appendChild(p),p.style.margin="0","region"===d.kind){var T=d.styleAttrs[n.byName.writingMode.qname];"lrtb"===T||"lr"===T?(e.ipd="lr",e.bpd="tb"):"rltb"===T||"rl"===T?(e.ipd="rl",e.bpd="tb"):"tblr"===T?(e.ipd="tb",e.bpd="lr"):"tbrl"!==T&&"tb"!==T||(e.ipd="tb",e.bpd="rl")}else if("p"===d.kind&&"tb"===e.bpd){var b=d.styleAttrs[n.byName.direction.qname];e.ipd="ltr"===b?"lr":"rl"}for(var E=0;E<f.length;E++){var S=f[E],w=d.styleAttrs[S.qname];void 0!==w&&null!==S.map&&S.map(e,p,d,w)}var A=p,I=d.styleAttrs[n.byName.linePadding.qname];if(I&&!I.isZero()){var C=I.toUsedLength(e.w,e.h);if(C>0){var R=Math.ceil(C)+"px";"tb"===e.bpd?(A.style.paddingLeft=R,A.style.paddingRight=R):(A.style.paddingTop=R,A.style.paddingBottom=R),e.lp=I}}var D=d.styleAttrs[n.byName.multiRowAlign.qname];if(D&&"auto"!==D){var x=document.createElement("span");x.style.display="inline-block",x.style.textAlign=D,p.appendChild(x),A=x,e.mra=D}var N=d.styleAttrs[n.byName.rubyReserve.qname];if(N&&"none"!==N[0]&&(e.rubyReserve=N),d.styleAttrs[n.byName.fillLineGap.qname]&&(e.flg=!0),"span"===d.kind&&d.text){var O=d.styleAttrs[n.byName.textEmphasis.qname];if(O&&"none"!==O.style&&(e.textEmphasis=!0),n.byName.textCombine.qname in d.styleAttrs&&"all"===d.styleAttrs[n.byName.textCombine.qname])p.textContent=d.text,p._isd_element=d,O&&c(e,p,0,O);else for(var P="",M=0;M<d.text.length;M++){P+=d.text.charAt(M);var k=d.text.charCodeAt(M);if(k<55296||k>56319||M===d.text.length-1){var L=document.createElement("span");L.textContent=P,O&&c(e,L,0,O),p.appendChild(L),P="",L._isd_element=d}}}if("contents"in d)for(var F=0;F<d.contents.length;F++)i(e,A,d.contents[F],d);var U=[];if("p"===d.kind&&(l(e,A,U,null),e.rubyReserve&&(function(e,t){for(var n=0;n<e.length;n++){var r,i,a=document.createElement("ruby"),s=document.createElement("span");s.textContent="",a.appendChild(s);var o,u=t.rubyReserve[1].toUsedLength(t.w,t.h)+"px";"both"===t.rubyReserve[0]||"outside"===t.rubyReserve[0]&&1==e.length?((r=document.createElement("rtc")).style[m]=g?"after":"under",r.textContent="",r.style.fontSize=u,(i=document.createElement("rtc")).style[m]=g?"before":"over",i.textContent="",i.style.fontSize=u,a.appendChild(r),a.appendChild(i)):((r=document.createElement("rtc")).textContent="",r.style.fontSize=u,o="after"===t.rubyReserve[0]||"outside"===t.rubyReserve[0]&&n>0?g?"after":"tb"===t.bpd||"rl"===t.bpd?"under":"over":g?"before":"tb"===t.bpd||"rl"===t.bpd?"over":"under",r.style[m]=o,a.appendChild(r));for(var l=null,c=0;c<e[n].rbc.length;c++)if("ruby"===e[n].rbc[c].localName){l=e[n].rbc[c];for(var d=0;d<l.style.length;d++)a.style.setProperty(l.style.item(d),l.style.getPropertyValue(l.style.item(d)));break}(l=l||e[n].elements[0].node).parentElement.insertBefore(a,l)}}(U,e),e.rubyReserve=null),(e.ruby||e.rubyReserve)&&(function(e,t){for(var n=0;n<e.length;n++)for(var r=0;r<e[n].rbc.length;r++){var i;e[n].rbc[r].style[m]||(i=g?0===n?"before":"after":"tb"===t.bpd||"rl"===t.bpd?0===n?"over":"under":0===n?"under":"over",e[n].rbc[r].style[m]=i)}}(U,e),e.ruby=null),e.textEmphasis&&(function(e,t){for(var n=0;n<e.length;n++)for(var r=0;r<e[n].te.length;r++){var i;e[n].te[r].style[v]&&"none"!==e[n].te[r].style[v]||(i="tb"===t.bpd?0===n?"left over":"left under":"rl"===t.bpd?0===n?"right under":"left under":0===n?"left under":"right under",e[n].te[r].style[v]=i)}}(U,e),e.textEmphasis=null),e.mra&&(function(e){for(var t=0;t<e.length-1;t++){var n=e[t].elements.length;if(0!==n&&!1===e[t].br){var r=document.createElement("br"),i=e[t].elements[n-1].node;i.parentElement.insertBefore(r,i.nextSibling)}}}(U),e.mra=null),e.lp&&(function(e,t,n){if(null!==e)for(var i=0;i<e.length;i++){var a=e[i].elements.length,s=Math.ceil(t)+"px",o="-"+Math.ceil(t)+"px";if(0!==a){var u=e[i].elements[e[i].start_elem],l=e[i].elements[e[i].end_elem];if(u===l){var c=u.node.getBoundingClientRect();if(0==c.width||0==c.height)continue}"lr"===n.ipd?(u.node.style.marginLeft=o,u.node.style.paddingLeft=s):"rl"===n.ipd?(u.node.style.paddingRight=s,u.node.style.marginRight=o):"tb"===n.ipd&&(u.node.style.paddingTop=s,u.node.style.marginTop=o),"lr"===n.ipd?(r||(l.node.style.marginRight=o),l.node.style.paddingRight=s):"rl"===n.ipd?(l.node.style.paddingLeft=s,r||(l.node.style.marginLeft=o)):"tb"===n.ipd&&(l.node.style.paddingBottom=s,l.node.style.marginBottom=o)}}}(U,e.lp.toUsedLength(e.w,e.h),e),e.lp=null),function(e,t){for(var n=0;n<e.length;n++)for(var r=e[n],i=1;i<r.elements.length;){var o=r.elements[i-1],u=r.elements[i];s(o.node,u.node,t)?r.elements.splice(i,1):i++}for(var l,c,d=[],f=0;f<e.length;f++)for(var h=0;h<e[f].elements.length;h++)(c=a(l=e[f].elements[h].node,d,!1))&&(l.style.backgroundColor=c);for(var p=0;p<d.length;p++)d[p].style.backgroundColor=""}(U,e),e.flg)){var B=u(A.getBoundingClientRect(),e);!function(e,t,n,r,i){for(var a=Math.sign(n-t),s=0;s<=e.length;s++){var o,u,l,c;if(o=0===s?Math.round(t):s===e.length?Math.round(n):Math.round((e[s-1].after+e[s].before)/2),s>0&&e[s-1])for(l=0;l<e[s-1].elements.length;l++)u=a*(o-(c=e[s-1].elements[l]).after)+"px","lr"===r.bpd?c.node.style.paddingRight=u:"rl"===r.bpd?c.node.style.paddingLeft=u:"tb"===r.bpd&&(c.node.style.paddingBottom=u);if(s<e.length)for(l=0;l<e[s].elements.length;l++)u=a*((c=e[s].elements[l]).before-o)+"px","lr"===r.bpd?c.node.style.paddingLeft=u:"rl"===r.bpd?c.node.style.paddingRight=u:"tb"===r.bpd&&(c.node.style.paddingTop=u)}}(U,B.before,B.after,e),e.flg=null}if("region"===d.kind&&"tb"===e.bpd&&e.enableRollUp&&d.contents.length>0&&"after"===d.styleAttrs[n.byName.displayAlign.qname]){l(e,A,U,null);var j=new o(""===d.id?"_":d.id,U);if(e.currentISDState[j.id]=j,e.previousISDState&&j.id in e.previousISDState&&e.previousISDState[j.id].plist.length>0&&j.plist.length>1&&j.plist[j.plist.length-2].text===e.previousISDState[j.id].plist[e.previousISDState[j.id].plist.length-1].text){var q=p.firstElementChild,H=j.plist[j.plist.length-1].after-j.plist[j.plist.length-1].before;q.style.bottom="-"+H+"px",q.style.transition="transform 0.4s",q.style.position="relative",q.style.transform="translateY(-"+H+"px)"}}}else _(e.errorHandler,"Error processing ISD element kind: "+d.kind)}function a(e,t,n){return e.style.backgroundColor?(n&&!t.includes(e)&&t.push(e),e.style.backgroundColor):"SPAN"===e.parentElement.nodeName||"RUBY"===e.parentElement.nodeName||"RBC"===e.parentElement.nodeName||"RTC"===e.parentElement.nodeName||"RT"===e.parentElement.nodeName?a(e.parentElement,t,!0):void 0}function s(e,t,n){if("SPAN"===e.tagName&&"SPAN"===t.tagName&&e._isd_element===t._isd_element){if(!e._isd_element)return _(n.errorHandler,"Internal error: HTML span is not linked to a source element; cannot merge spans."),!1;e.textContent+=t.textContent;for(var r=0;r<t.style.length;r++){var i=t.style[r];(i.indexOf("border")>=0||i.indexOf("padding")>=0||i.indexOf("margin")>=0)&&(e.style[i]=t.style[i])}return t.parentElement.removeChild(t),!0}return!1}function o(e,t){this.id=e,this.plist=t}function u(e,t){var n={before:null,after:null,start:null,end:null};return"tb"===t.bpd?(n.before=e.top,n.after=e.bottom,"lr"===t.ipd?(n.start=e.left,n.end=e.right):(n.start=e.right,n.end=e.left)):"lr"===t.bpd?(n.before=e.left,n.after=e.right,n.start=e.top,n.end=e.bottom):"rl"===t.bpd&&(n.before=e.right,n.after=e.left,n.start=e.top,n.end=e.bottom),n}function l(e,t,n,r){if("rt"!==t.localName&&"rtc"!==t.localName){var i,a,s,o,c=t.style.backgroundColor||r;if(0===t.childElementCount)if("span"===t.localName||"rb"===t.localName){var d=u(t.getBoundingClientRect(),e);if(0!==n.length&&(i=d.before,a=d.after,s=n[n.length-1].before,a<(o=n[n.length-1].after)&&i>s||o<=a&&s>=i)){var f=Math.sign(d.after-d.before),h=Math.sign(d.end-d.start);f*(d.before-n[n.length-1].before)<0&&(n[n.length-1].before=d.before),f*(d.after-n[n.length-1].after)>0&&(n[n.length-1].after=d.after),h*(d.start-n[n.length-1].start)<0&&(n[n.length-1].start=d.start,n[n.length-1].start_elem=n[n.length-1].elements.length),h*(d.end-n[n.length-1].end)>0&&(n[n.length-1].end=d.end,n[n.length-1].end_elem=n[n.length-1].elements.length)}else n.push({before:d.before,after:d.after,start:d.start,end:d.end,start_elem:0,end_elem:0,elements:[],rbc:[],te:[],text:"",br:!1});n[n.length-1].text+=t.textContent,n[n.length-1].elements.push({node:t,bgcolor:c,before:d.before,after:d.after})}else"br"===t.localName&&0!==n.length&&(n[n.length-1].br=!0);else for(var p=t.firstChild;p;)p.nodeType===Node.ELEMENT_NODE&&(l(e,p,n,c),"ruby"===p.localName||"rtc"===p.localName?n.length>0&&n[n.length-1].rbc.push(p):"span"===p.localName&&p.style[y]&&"none"!==p.style[y]&&n.length>0&&n[n.length-1].te.push(p)),p=p.nextSibling}}function c(e,t,n,r){var i;"none"!==r.style&&("auto"===r.style?t.style[y]="filled":t.style[y]=r.style+" "+r.symbol,("before"===r.position||"after"===r.position)&&(i="tb"===e.bpd?"before"===r.position?"left over":"left under":"rl"===e.bpd?"before"===r.position?"right under":"left under":"before"===r.position?"left under":"right under",t.style[v]=i))}function d(e,t){this.qname=e,this.map=t}e.render=function(e,t,n,r,a,s,o,u,l){var c=r||t.clientHeight,d=a||t.clientWidth;if(null!==e.aspectRatio){var f=c*e.aspectRatio;f>d?c=Math.round(d/e.aspectRatio):d=f}var h=document.createElement("div");h.style.position="relative",h.style.width=d+"px",h.style.height=c+"px",h.style.margin="auto",h.style.top=0,h.style.bottom=0,h.style.left=0,h.style.right=0,h.style.zIndex=0;var p={h:c,w:d,regionH:null,regionW:null,imgResolver:n,displayForcedOnlyMode:s||!1,isd:e,errorHandler:o,previousISDState:u,enableRollUp:l||!1,currentISDState:{},flg:null,lp:null,mra:null,ipd:null,bpd:null,ruby:null,textEmphasis:null,rubyReserve:null};if(t.appendChild(h),"contents"in e)for(var g=0;g<e.contents.length;g++)i(p,h,e.contents[g],e);return p.currentISDState};for(var f=[new d("http://www.w3.org/ns/ttml#styling backgroundColor",(function(e,t,n,r){0!==r[3]&&(t.style.backgroundColor="rgba("+r[0].toString()+","+r[1].toString()+","+r[2].toString()+","+(r[3]/255).toString()+")")})),new d("http://www.w3.org/ns/ttml#styling color",(function(e,t,n,r){t.style.color="rgba("+r[0].toString()+","+r[1].toString()+","+r[2].toString()+","+(r[3]/255).toString()+")"})),new d("http://www.w3.org/ns/ttml#styling direction",(function(e,t,n,r){t.style.direction=r})),new d("http://www.w3.org/ns/ttml#styling display",(function(e,t,n,r){})),new d("http://www.w3.org/ns/ttml#styling displayAlign",(function(e,t,n,r){t.style.display="flex",t.style.flexDirection="column","before"===r?t.style.justifyContent="flex-start":"center"===r?t.style.justifyContent="center":"after"===r&&(t.style.justifyContent="flex-end")})),new d("http://www.w3.org/ns/ttml#styling extent",(function(e,t,n,r){e.regionH=r.h.toUsedLength(e.w,e.h),e.regionW=r.w.toUsedLength(e.w,e.h);var i=0,a=0,s=n.styleAttrs["http://www.w3.org/ns/ttml#styling padding"];s&&(i=s[0].toUsedLength(e.w,e.h)+s[2].toUsedLength(e.w,e.h),a=s[1].toUsedLength(e.w,e.h)+s[3].toUsedLength(e.w,e.h)),t.style.height=e.regionH-i+"px",t.style.width=e.regionW-a+"px"})),new d("http://www.w3.org/ns/ttml#styling fontFamily",(function(e,t,n,r){for(var i=[],a=0;a<r.length;a++)r[a]=r[a].trim(),"monospaceSerif"===r[a]?(i.push("Courier New"),i.push('"Liberation Mono"'),i.push("Courier"),i.push("monospace")):"proportionalSansSerif"===r[a]?(i.push("Arial"),i.push("Helvetica"),i.push('"Liberation Sans"'),i.push("sans-serif")):"monospace"===r[a]?i.push("monospace"):"sansSerif"===r[a]?i.push("sans-serif"):"serif"===r[a]?i.push("serif"):"monospaceSansSerif"===r[a]?(i.push("Consolas"),i.push("monospace")):"proportionalSerif"===r[a]?i.push("serif"):i.push(r[a]);if(i.length>0){for(var s=[i[0]],o=1;o<i.length;o++)-1==s.indexOf(i[o])&&s.push(i[o]);i=s}t.style.fontFamily=i.join(",")})),new d("http://www.w3.org/ns/ttml#styling shear",(function(e,t,n,r){if(0!==r){var i=-.9*r;"tb"===e.bpd?t.style.transform="skewX("+i+"deg)":t.style.transform="skewY("+i+"deg)"}})),new d("http://www.w3.org/ns/ttml#styling fontSize",(function(e,t,n,r){t.style.fontSize=r.toUsedLength(e.w,e.h)+"px"})),new d("http://www.w3.org/ns/ttml#styling fontStyle",(function(e,t,n,r){t.style.fontStyle=r})),new d("http://www.w3.org/ns/ttml#styling fontWeight",(function(e,t,n,r){t.style.fontWeight=r})),new d("http://www.w3.org/ns/ttml#styling lineHeight",(function(e,t,n,r){t.style.lineHeight="normal"===r?"normal":r.toUsedLength(e.w,e.h)+"px"})),new d("http://www.w3.org/ns/ttml#styling opacity",(function(e,t,n,r){t.style.opacity=r})),new d("http://www.w3.org/ns/ttml#styling origin",(function(e,t,n,r){t.style.top=r.h.toUsedLength(e.w,e.h)+"px",t.style.left=r.w.toUsedLength(e.w,e.h)+"px"})),new d("http://www.w3.org/ns/ttml#styling overflow",(function(e,t,n,r){t.style.overflow=r})),new d("http://www.w3.org/ns/ttml#styling padding",(function(e,t,n,r){var i=[];i[0]=r[0].toUsedLength(e.w,e.h)+"px",i[1]=r[3].toUsedLength(e.w,e.h)+"px",i[2]=r[2].toUsedLength(e.w,e.h)+"px",i[3]=r[1].toUsedLength(e.w,e.h)+"px",t.style.padding=i.join(" ")})),new d("http://www.w3.org/ns/ttml#styling position",(function(e,t,n,r){t.style.top=r.h.toUsedLength(e.w,e.h)+"px",t.style.left=r.w.toUsedLength(e.w,e.h)+"px"})),new d("http://www.w3.org/ns/ttml#styling rubyAlign",(function(e,t,n,r){t.style.rubyAlign="spaceAround"===r?"space-around":"center"})),new d("http://www.w3.org/ns/ttml#styling rubyPosition",(function(e,t,n,r){var i;"before"!==r&&"after"!==r||(i=g?r:"tb"===e.bpd||"rl"===e.bpd?"before"===r?"over":"under":"before"===r?"under":"over",t.parentElement.style[m]=i)})),new d("http://www.w3.org/ns/ttml#styling showBackground",null),new d("http://www.w3.org/ns/ttml#styling textAlign",(function(e,t,n,r){var i;i="start"===r?"rl"===e.ipd?"right":"left":"end"===r?"rl"===e.ipd?"left":"right":r,t.style.textAlign=i})),new d("http://www.w3.org/ns/ttml#styling textDecoration",(function(e,t,n,r){t.style.textDecoration=r.join(" ").replace("lineThrough","line-through")})),new d("http://www.w3.org/ns/ttml#styling textOutline",(function(e,t,n,r){})),new d("http://www.w3.org/ns/ttml#styling textShadow",(function(e,t,r,i){var a=r.styleAttrs[n.byName.textOutline.qname];if("none"===i&&"none"===a)t.style.textShadow="";else{var s=[];if("none"!==a){var o="rgba("+a.color[0].toString()+","+a.color[1].toString()+","+a.color[2].toString()+","+(a.color[3]/255).toString()+")";s.push("1px 1px 1px "+o),s.push("-1px 1px 1px "+o),s.push("1px -1px 1px "+o),s.push("-1px -1px 1px "+o)}if("none"!==i)for(var u=0;u<i.length;u++)s.push(i[u].x_off.toUsedLength(e.w,e.h)+"px "+i[u].y_off.toUsedLength(e.w,e.h)+"px "+i[u].b_radius.toUsedLength(e.w,e.h)+"px rgba("+i[u].color[0].toString()+","+i[u].color[1].toString()+","+i[u].color[2].toString()+","+(i[u].color[3]/255).toString()+")");t.style.textShadow=s.join(",")}})),new d("http://www.w3.org/ns/ttml#styling textCombine",(function(e,t,n,r){t.style.textCombineUpright=r})),new d("http://www.w3.org/ns/ttml#styling textEmphasis",(function(e,t,n,r){})),new d("http://www.w3.org/ns/ttml#styling unicodeBidi",(function(e,t,n,r){var i;i="bidiOverride"===r?"bidi-override":r,t.style.unicodeBidi=i})),new d("http://www.w3.org/ns/ttml#styling visibility",(function(e,t,n,r){t.style.visibility=r})),new d("http://www.w3.org/ns/ttml#styling wrapOption",(function(e,t,n,r){"wrap"===r?"preserve"===n.space?t.style.whiteSpace="pre-wrap":t.style.whiteSpace="normal":"preserve"===n.space?t.style.whiteSpace="pre":t.style.whiteSpace="noWrap"})),new d("http://www.w3.org/ns/ttml#styling writingMode",(function(e,t,n,r){"lrtb"===r||"lr"===r||"rltb"===r||"rl"===r?t.style.writingMode="horizontal-tb":"tblr"===r?t.style.writingMode="vertical-lr":"tbrl"!==r&&"tb"!==r||(t.style.writingMode="vertical-rl")})),new d("http://www.w3.org/ns/ttml#styling zIndex",(function(e,t,n,r){t.style.zIndex=r})),new d("http://www.w3.org/ns/ttml/profile/imsc1#styling forcedDisplay",(function(e,t,n,r){e.displayForcedOnlyMode&&!1===r&&(t.style.visibility="hidden")}))],h={},p=0;p<f.length;p++)h[f[p].qname]=f[p];var g="webkitRubyPosition"in window.getComputedStyle(document.documentElement),m=g?"webkitRubyPosition":"rubyPosition",y="webkitTextEmphasisStyle"in window.getComputedStyle(document.documentElement)?"webkitTextEmphasisStyle":"textEmphasisStyle",v="webkitTextEmphasisPosition"in window.getComputedStyle(document.documentElement)?"webkitTextEmphasisPosition":"textEmphasisPosition";function _(e,t){if(e&&e.error&&e.error(t))throw t}}(t,"undefined"==typeof imscNames?n(210):imscNames,"undefined"==typeof imscStyles?n(6811):imscStyles,"undefined"==typeof imscUtils?n(5926):imscUtils)},4080:function(e,t,n){!function(e,t,n,r){e.generateISD=function(e,t,r){var i,s=new u(e),o={},l={},c=e.head.styling.initials[n.byName.showBackground.qname],d=e.head.styling.initials[n.byName.backgroundColor.qname];for(var f in e.head.layout.regions)if(e.head.layout.regions.hasOwnProperty(f)){var h=e.head.layout.regions[f],p=h.styleAttrs[n.byName.showBackground.qname]||c,g=h.styleAttrs[n.byName.backgroundColor.qname]||d;l[h.id]=("always"===p||void 0===p)&&void 0!==g&&!(t<h.begin||t>=h.end)}for(var m in e.body&&e.body.regionID&&(l[e.body.regionID]=!0),i=null!==e.body?function e(t,n){if(n.contents){var r={};for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i]);return r.contents=[],n.contents.filter((function(e){return!(t<e.begin||t>=e.end)})).forEach((function(n){var i=e(t,n);i.regionID&&(l[i.regionID]=!0),null!==i&&r.contents.push(i)})),r}return n}(t,e.body):null,void 0!==l[""]&&(l[""]=!0),l)if(l[m]){var y=a(e,t,e.head.layout.regions[m],i,null,"",e.head.layout.regions[m],r,o);null!==y&&s.contents.push(y.element)}return s};var i=[n.byName.color.qname,n.byName.textCombine.qname,n.byName.textDecoration.qname,n.byName.textEmphasis.qname,n.byName.textOutline.qname,n.byName.textShadow.qname];function a(e,t,u,d,f,h,p,g,m){if(t<p.begin||t>=p.end)return null;var y="regionID"in p&&""!==p.regionID?p.regionID:h;if(null!==f&&y!==u.id&&(!("contents"in p)||"contents"in p&&0===p.contents.length||""!==y))return null;var v=new l(p);if("sets"in p)for(var _=0;_<p.sets.length;_++)t<p.sets[_].begin||t>=p.sets[_].end||(v.styleAttrs[p.sets[_].qname]=p.sets[_].value);var T={};for(var b in v.styleAttrs)if(v.styleAttrs.hasOwnProperty(b)&&(T[b]=!0,"region"===v.kind&&b===n.byName.writingMode.qname&&!(n.byName.direction.qname in v.styleAttrs))){var E=v.styleAttrs[b];"lrtb"===E||"lr"===E?v.styleAttrs[n.byName.direction.qname]="ltr":"rltb"!==E&&"rl"!==E||(v.styleAttrs[n.byName.direction.qname]="rtl")}if(null!==f)for(var S=0;S<n.all.length;S++){var w=n.all[S];if(w.qname===n.byName.textDecoration.qname){var A=f.styleAttrs[w.qname],I=v.styleAttrs[w.qname],C=[];void 0===I?C=A:-1===I.indexOf("none")?((-1===I.indexOf("noUnderline")&&-1!==A.indexOf("underline")||-1!==I.indexOf("underline"))&&C.push("underline"),(-1===I.indexOf("noLineThrough")&&-1!==A.indexOf("lineThrough")||-1!==I.indexOf("lineThrough"))&&C.push("lineThrough"),(-1===I.indexOf("noOverline")&&-1!==A.indexOf("overline")||-1!==I.indexOf("overline"))&&C.push("overline")):C.push("none"),v.styleAttrs[w.qname]=C}else if(w.qname!==n.byName.fontSize.qname||w.qname in v.styleAttrs||"span"!==v.kind||"textContainer"!==v.styleAttrs[n.byName.ruby.qname])if(w.qname!==n.byName.fontSize.qname||w.qname in v.styleAttrs||"span"!==v.kind||"text"!==v.styleAttrs[n.byName.ruby.qname])w.inherit&&w.qname in f.styleAttrs&&!(w.qname in v.styleAttrs)&&(v.styleAttrs[w.qname]=f.styleAttrs[w.qname]);else{var R=f.styleAttrs[n.byName.fontSize.qname];"textContainer"===f.styleAttrs[n.byName.ruby.qname]?v.styleAttrs[w.qname]=R:v.styleAttrs[w.qname]=new r.ComputedLength(.5*R.rw,.5*R.rh)}else{var D=f.styleAttrs[n.byName.fontSize.qname];v.styleAttrs[w.qname]=new r.ComputedLength(.5*D.rw,.5*D.rh)}}for(var x=0;x<n.all.length;x++){var N=n.all[x];if(!(N.qname in v.styleAttrs)&&!(N.qname===n.byName.position.qname&&n.byName.origin.qname in v.styleAttrs||N.qname===n.byName.origin.qname&&n.byName.position.qname in v.styleAttrs)){var O=e.head.styling.initials[N.qname]||N.initial;if(null!==O&&("region"===v.kind||!1===N.inherit&&null!==O)){var P=N.parse(O);null!==P?(v.styleAttrs[N.qname]=P,T[N.qname]=!0):c(g,"Invalid initial value for '"+N.qname+"' on element '"+v.kind)}}}for(var M=0;M<n.all.length;M++){var k=n.all[M];if(k.qname in T&&null!==k.compute){var L=k.compute(e,f,v,v.styleAttrs[k.qname],m);null!==L?v.styleAttrs[k.qname]=L:(v.styleAttrs[k.qname]=k.compute(e,f,v,k.parse(k.initial),m),c(g,"Style '"+k.qname+"' on element '"+v.kind+"' cannot be computed"))}}if("none"===v.styleAttrs[n.byName.display.qname])return null;var F=null;null===f?F=null===d?[]:[d]:"contents"in p&&(F=p.contents);for(var U=0;null!==F&&U<F.length;U++){var B=a(e,t,u,d,v,y,F[U],g,m);null!==B&&v.contents.push(B.element)}for(var j in v.styleAttrs)if(v.styleAttrs.hasOwnProperty(j)){var q=!1;if("span"===v.kind){var H=v.styleAttrs[n.byName.ruby.qname];(q=("container"===H||"textContainer"===H||"baseContainer"===H)&&-1!==i.indexOf(j))||(q="container"!==H&&j===n.byName.rubyAlign.qname),q||(q=!("textContainer"===H||"text"===H)&&j===n.byName.rubyPosition.qname)}if(!q){var G=n.byQName[j];"applies"in G&&(q=-1===G.applies.indexOf(v.kind))}q&&delete v.styleAttrs[j]}var V=v.styleAttrs[n.byName.ruby.qname];if("p"===v.kind||"span"===v.kind&&("textContainer"===V||"text"===V)){var Y=[];s(v,Y),function(e){for(var t,n=0;n<e.length;)if("br"!==(t=e[n]).kind&&"preserve"!==t.space){var r=t.text.replace(/[\t\r\n ]+/g," ");/^[ ]/.test(r)&&(0===n||"br"===(i=e[n-1]).kind||/[\r\n\t ]$/.test(i.text))&&(r=r.substring(1)),t.text=r,0===r.length?e.splice(n,1):n++}else n++;var i,a;for(n=0;n<e.length;n++)"br"!==(t=e[n]).kind&&"preserve"!==t.space?/[ ]$/.test(t.text)&&(n===e.length-1||"br"===(a=e[n+1]).kind||"preserve"===a.space&&/^[\r\n]/.test(a.text))&&(t.text=t.text.slice(0,-1)):n++}(Y),o(v)}return"div"===v.kind&&n.byName.backgroundImage.qname in v.styleAttrs||"br"===v.kind||"image"===v.kind||"contents"in v&&v.contents.length>0||"span"===v.kind&&null!==v.text||"region"===v.kind&&"always"===v.styleAttrs[n.byName.showBackground.qname]?{region_id:y,element:v}:null}function s(e,t){if("contents"in e)for(var r=0;r<e.contents.length;r++){var i=e.contents[r],a=i.styleAttrs[n.byName.ruby.qname];("span"!==i.kind||"textContainer"!==a&&"text"!==a)&&("contents"in i?s(i,t):("span"===i.kind&&0!==i.text.length||"br"===i.kind)&&t.push(i))}}function o(e){if("br"===e.kind)return!1;if("text"in e)return 0===e.text.length;if("contents"in e){for(var t=e.contents.length;t--;)o(e.contents[t])&&e.contents.splice(t,1);return 0===e.contents.length}}function u(e){this.contents=[],this.aspectRatio=e.aspectRatio,this.lang=e.lang}function l(e){for(var t in this.kind=e.kind||"region",this.lang=e.lang,e.id&&(this.id=e.id),this.styleAttrs={},e.styleAttrs)e.styleAttrs.hasOwnProperty(t)&&(this.styleAttrs[t]=e.styleAttrs[t]);"src"in e&&(this.src=e.src),"type"in e&&(this.type=e.type),"text"in e?this.text=e.text:("region"===this.kind||"contents"in e)&&(this.contents=[]),"space"in e&&(this.space=e.space)}function c(e,t){if(e&&e.error&&e.error(t))throw t}}(t,"undefined"==typeof imscNames?n(210):imscNames,"undefined"==typeof imscStyles?n(6811):imscStyles,"undefined"==typeof imscUtils?n(5926):imscUtils)},4403:function(e,t,n){t.generateISD=n(4080).generateISD,t.fromXML=n(3362).fromXML,t.renderHTML=n(506).render},210:function(e,t){!function(e){e.ns_tt="http://www.w3.org/ns/ttml",e.ns_tts="http://www.w3.org/ns/ttml#styling",e.ns_ttp="http://www.w3.org/ns/ttml#parameter",e.ns_xml="http://www.w3.org/XML/1998/namespace",e.ns_itts="http://www.w3.org/ns/ttml/profile/imsc1#styling",e.ns_ittp="http://www.w3.org/ns/ttml/profile/imsc1#parameter",e.ns_smpte="http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt",e.ns_ebutts="urn:ebu:tt:style"}(t)},6811:function(e,t,n){!function(e,t,n){function r(e,t,n,r,i,a,s,o){this.name=t,this.ns=e,this.qname=e+" "+t,this.inherit=i,this.animatable=a,this.initial=n,this.applies=r,this.parse=s,this.compute=o}for(var i in e.all=[new r(t.ns_tts,"backgroundColor","transparent",["body","div","p","region","span"],!1,!0,n.parseColor,null),new r(t.ns_tts,"color","white",["span"],!0,!0,n.parseColor,null),new r(t.ns_tts,"direction","ltr",["p","span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"display","auto",["body","div","p","region","span"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"displayAlign","before",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"extent","auto",["tt","region"],!1,!0,(function(e){if("auto"===e)return e;var t=e.split(" ");if(2!==t.length)return null;var r=n.parseLength(t[0]),i=n.parseLength(t[1]);return i&&r?{h:i,w:r}:null}),(function(e,t,r,i,a){var s,o;if("auto"===i)s=new n.ComputedLength(0,1);else if(null===(s=n.toComputedLength(i.h.value,i.h.unit,null,e.dimensions.h,null,e.pxLength.h)))return null;if("auto"===i)o=new n.ComputedLength(1,0);else if(null===(o=n.toComputedLength(i.w.value,i.w.unit,null,e.dimensions.w,null,e.pxLength.w)))return null;return{h:s,w:o}})),new r(t.ns_tts,"fontFamily","default",["span","p"],!0,!0,(function(e){for(var t=e.split(","),n=[],r=0;r<t.length;r++)"'"!==t[r].charAt(0)&&'"'!==t[r].charAt(0)&&"default"===t[r]?n.push("monospaceSerif"):n.push(t[r]);return n}),null),new r(t.ns_tts,"shear","0%",["p"],!0,!0,n.parseLength,(function(e,t,n,r){return"%"!==r.unit?null:Math.abs(r.value)>100?100*Math.sign(r.value):r.value})),new r(t.ns_tts,"fontSize","1c",["span","p"],!0,!0,n.parseLength,(function(t,r,i,a,s){return n.toComputedLength(a.value,a.unit,null!==r?r.styleAttrs[e.byName.fontSize.qname]:t.cellLength.h,null!==r?r.styleAttrs[e.byName.fontSize.qname]:t.cellLength.h,t.cellLength.h,t.pxLength.h)})),new r(t.ns_tts,"fontStyle","normal",["span","p"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"fontWeight","normal",["span","p"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"lineHeight","normal",["p"],!0,!0,(function(e){return"normal"===e?e:n.parseLength(e)}),(function(t,r,i,a,s){var o;if("normal"===a)o=a;else if(null===(o=n.toComputedLength(a.value,a.unit,i.styleAttrs[e.byName.fontSize.qname],i.styleAttrs[e.byName.fontSize.qname],t.cellLength.h,t.pxLength.h)))return null;return o})),new r(t.ns_tts,"opacity",1,["region"],!1,!0,parseFloat,null),new r(t.ns_tts,"origin","auto",["region"],!1,!0,(function(e){if("auto"===e)return e;var t=e.split(" ");if(2!==t.length)return null;var r=n.parseLength(t[0]),i=n.parseLength(t[1]);return i&&r?{h:i,w:r}:null}),(function(e,t,r,i,a){var s,o;if("auto"===i)s=new n.ComputedLength(0,0);else if(null===(s=n.toComputedLength(i.h.value,i.h.unit,null,e.dimensions.h,null,e.pxLength.h)))return null;if("auto"===i)o=new n.ComputedLength(0,0);else if(null===(o=n.toComputedLength(i.w.value,i.w.unit,null,e.dimensions.w,null,e.pxLength.w)))return null;return{h:s,w:o}})),new r(t.ns_tts,"overflow","hidden",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"padding","0px",["region"],!1,!0,(function(e){var t=e.split(" ");if(t.length>4)return null;for(var r=[],i=0;i<t.length;i++){var a=n.parseLength(t[i]);if(!a)return null;r.push(a)}return r}),(function(t,r,i,a,s){var o;if(1===a.length)o=[a[0],a[0],a[0],a[0]];else if(2===a.length)o=[a[0],a[1],a[0],a[1]];else if(3===a.length)o=[a[0],a[1],a[2],a[1]];else{if(4!==a.length)return null;o=[a[0],a[1],a[2],a[3]]}var u=i.styleAttrs[e.byName.writingMode.qname];if("lrtb"===u||"lr"===u)o=[o[0],o[3],o[2],o[1]];else if("rltb"===u||"rl"===u)o=[o[0],o[1],o[2],o[3]];else if("tblr"===u)o=[o[3],o[0],o[1],o[2]];else{if("tbrl"!==u&&"tb"!==u)return null;o=[o[3],o[2],o[1],o[0]]}for(var l=[],c=0;c<o.length;c++)if(0===o[c].value)l[c]=new n.ComputedLength(0,0);else if(l[c]=n.toComputedLength(o[c].value,o[c].unit,i.styleAttrs[e.byName.fontSize.qname],0===c||2===c?i.styleAttrs[e.byName.extent.qname].h:i.styleAttrs[e.byName.extent.qname].w,0===c||2===c?t.cellLength.h:t.cellLength.w,0===c||2===c?t.pxLength.h:t.pxLength.w),null===l[c])return null;return l})),new r(t.ns_tts,"position","top left",["region"],!1,!0,(function(e){return n.parsePosition(e)}),(function(t,r,i,a){var s,o;return null===(s=n.toComputedLength(a.v.offset.value,a.v.offset.unit,null,new n.ComputedLength(-i.styleAttrs[e.byName.extent.qname].h.rw,t.dimensions.h.rh-i.styleAttrs[e.byName.extent.qname].h.rh),null,t.pxLength.h))?null:("bottom"===a.v.edge&&(s=new n.ComputedLength(-s.rw-i.styleAttrs[e.byName.extent.qname].h.rw,t.dimensions.h.rh-s.rh-i.styleAttrs[e.byName.extent.qname].h.rh)),o=n.toComputedLength(a.h.offset.value,a.h.offset.unit,null,new n.ComputedLength(t.dimensions.w.rw-i.styleAttrs[e.byName.extent.qname].w.rw,-i.styleAttrs[e.byName.extent.qname].w.rh),null,t.pxLength.w),null===s?null:("right"===a.h.edge&&(o=new n.ComputedLength(t.dimensions.w.rw-o.rw-i.styleAttrs[e.byName.extent.qname].w.rw,-o.rh-i.styleAttrs[e.byName.extent.qname].w.rh)),{h:s,w:o}))})),new r(t.ns_tts,"ruby","none",["span"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"rubyAlign","center",["span"],!0,!0,(function(e){return"center"!==e&&"spaceAround"!==e?null:e}),null),new r(t.ns_tts,"rubyPosition","outside",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"rubyReserve","none",["p"],!0,!0,(function(e){var t=e.split(" "),r=[null,null];if(0===t.length||t.length>2)return null;if("none"!==t[0]&&"both"!==t[0]&&"after"!==t[0]&&"before"!==t[0]&&"outside"!==t[0])return null;if(r[0]=t[0],2===t.length&&"none"!==t[0]){var i=n.parseLength(t[1]);if(!i)return null;r[1]=i}return r}),(function(t,r,i,a,s){return"none"===a[0]?a:null===(o=null===a[1]?new n.ComputedLength(.5*i.styleAttrs[e.byName.fontSize.qname].rw,.5*i.styleAttrs[e.byName.fontSize.qname].rh):n.toComputedLength(a[1].value,a[1].unit,i.styleAttrs[e.byName.fontSize.qname],i.styleAttrs[e.byName.fontSize.qname],t.cellLength.h,t.pxLength.h))?null:[a[0],o];var o})),new r(t.ns_tts,"showBackground","always",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"textAlign","start",["p"],!0,!0,(function(e){return e}),(function(e,t,n,r,i){return"left"===r?"start":"right"===r?"end":r})),new r(t.ns_tts,"textCombine","none",["span"],!0,!0,(function(e){return"none"===e||"all"===e?e:null}),null),new r(t.ns_tts,"textDecoration","none",["span"],!0,!0,(function(e){return e.split(" ")}),null),new r(t.ns_tts,"textEmphasis","none",["span"],!0,!0,(function(e){for(var t=e.split(" "),r={style:null,symbol:null,color:null,position:null},i=0;i<t.length;i++)if("none"===t[i]||"auto"===t[i])r.style=t[i];else if("filled"===t[i]||"open"===t[i])r.style=t[i];else if("circle"===t[i]||"dot"===t[i]||"sesame"===t[i])r.symbol=t[i];else if("current"===t[i])r.color=t[i];else if("outside"===t[i]||"before"===t[i]||"after"===t[i])r.position=t[i];else if(r.color=n.parseColor(t[i]),null===r.color)return null;return null==r.style&&null==r.symbol?r.style="auto":(r.symbol=r.symbol||"circle",r.style=r.style||"filled"),r.position=r.position||"outside",r.color=r.color||"current",r}),null),new r(t.ns_tts,"textOutline","none",["span"],!0,!0,(function(e){if("none"===e)return e;var t={},r=e.split(" ");if(0===r.length||r.length>2)return null;var i=n.parseColor(r[0]);if(t.color=i,null!==i&&r.shift(),1!==r.length)return null;var a=n.parseLength(r[0]);return a?(t.thickness=a,t):null}),(function(t,r,i,a,s){if("none"===a)return a;var o={};return null===a.color?o.color=i.styleAttrs[e.byName.color.qname]:o.color=a.color,o.thickness=n.toComputedLength(a.thickness.value,a.thickness.unit,i.styleAttrs[e.byName.fontSize.qname],i.styleAttrs[e.byName.fontSize.qname],t.cellLength.h,t.pxLength.h),null===o.thickness?null:o})),new r(t.ns_tts,"textShadow","none",["span"],!0,!0,n.parseTextShadow,(function(t,r,i,a){if("none"===a)return a;for(var s=[],o=0;o<a.length;o++){var u={};if(u.x_off=n.toComputedLength(a[o][0].value,a[o][0].unit,null,i.styleAttrs[e.byName.fontSize.qname],null,t.pxLength.w),null===u.x_off)return null;if(u.y_off=n.toComputedLength(a[o][1].value,a[o][1].unit,null,i.styleAttrs[e.byName.fontSize.qname],null,t.pxLength.h),null===u.y_off)return null;if(null===a[o][2])u.b_radius=0;else if(u.b_radius=n.toComputedLength(a[o][2].value,a[o][2].unit,null,i.styleAttrs[e.byName.fontSize.qname],null,t.pxLength.h),null===u.b_radius)return null;null===a[o][3]?u.color=i.styleAttrs[e.byName.color.qname]:u.color=a[o][3],s.push(u)}return s})),new r(t.ns_tts,"unicodeBidi","normal",["span","p"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"visibility","visible",["body","div","p","region","span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"wrapOption","wrap",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"writingMode","lrtb",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"zIndex","auto",["region"],!1,!0,(function(e){var t;return"auto"===e?t=e:(t=parseInt(e),isNaN(t)&&(t=null)),t}),null),new r(t.ns_ebutts,"linePadding","0c",["p"],!0,!1,n.parseLength,(function(e,t,r,i,a){return n.toComputedLength(i.value,i.unit,null,null,e.cellLength.w,null)})),new r(t.ns_ebutts,"multiRowAlign","auto",["p"],!0,!1,(function(e){return e}),null),new r(t.ns_smpte,"backgroundImage",null,["div"],!1,!1,(function(e){return e}),null),new r(t.ns_itts,"forcedDisplay","false",["body","div","p","region","span"],!0,!0,(function(e){return"true"===e}),null),new r(t.ns_itts,"fillLineGap","false",["p"],!0,!0,(function(e){return"true"===e}),null)],e.byQName={},e.all)e.byQName[e.all[i].qname]=e.all[i];for(var a in e.byName={},e.all)e.byName[e.all[a].name]=e.all[a]}(t,"undefined"==typeof imscNames?n(210):imscNames,"undefined"==typeof imscUtils?n(5926):imscUtils)},5926:function(e,t){!function(e){var t=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?/,n=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,r=/rgba\(\s*(\d+),\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,i={transparent:[0,0,0,0],black:[0,0,0,255],silver:[192,192,192,255],gray:[128,128,128,255],white:[255,255,255,255],maroon:[128,0,0,255],red:[255,0,0,255],purple:[128,0,128,255],fuchsia:[255,0,255,255],magenta:[255,0,255,255],green:[0,128,0,255],lime:[0,255,0,255],olive:[128,128,0,255],yellow:[255,255,0,255],navy:[0,0,128,255],blue:[0,0,255,255],teal:[0,128,128,255],aqua:[0,255,255,255],cyan:[0,255,255,255]};e.parseColor=function(e){var a,s=null,o=i[e.toLowerCase()];return void 0!==o?s=o:null!==(a=t.exec(e))?s=[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16),void 0!==a[4]?parseInt(a[4],16):255]:null!==(a=n.exec(e))?s=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),255]:null!==(a=r.exec(e))&&(s=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),parseInt(a[4])]),s};var a=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/;e.parseLength=function(e){var t,n=null;return null!==(t=a.exec(e))&&(n={value:parseFloat(t[1]),unit:t[2]}),n},e.parseTextShadow=function(t){for(var n=t.match(/([^\(,\)]|\([^\)]+\))+/g),r=[],i=0;i<n.length;i++){var a=n[i].split(" ");if(1===a.length&&"none"===a[0])return"none";if(a.length>1&&a.length<5){var s=[null,null,null,null],o=e.parseLength(a.shift());if(null===o)return null;if(s[0]=o,null===(o=e.parseLength(a.shift())))return null;if(s[1]=o,0===a.length){r.push(s);continue}if(null!==(o=e.parseLength(a[0]))&&(s[2]=o,a.shift()),0===a.length){r.push(s);continue}var u=e.parseColor(a[0]);if(null===u)return null;s[3]=u,r.push(s)}}return r},e.parsePosition=function(t){var n=t.split(" "),r=function(e){return"center"===e||"left"===e||"top"===e||"bottom"===e||"right"===e};if(n.length>4)return null;for(var i=0;i<n.length;i++)if(!r(n[i])){var a=e.parseLength(n[i]);if(null===a)return null;n[i]=a}for(var s={h:{edge:"left",offset:{value:50,unit:"%"}},v:{edge:"top",offset:{value:50,unit:"%"}}},o=0;o<n.length;){var u=n[o++];if(r(u)){var l={value:0,unit:"%"};2!==n.length&&o<n.length&&!r(n[o])&&(l=n[o++]),"right"===u?(s.h.edge=u,s.h.offset=l):"bottom"===u?(s.v.edge=u,s.v.offset=l):"left"===u?s.h.offset=l:"top"===u&&(s.v.offset=l)}else{if(1!==n.length&&2!==n.length)return null;1===o?s.h.offset=u:s.v.offset=u}}return s},e.ComputedLength=function(e,t){this.rw=e,this.rh=t},e.ComputedLength.prototype.toUsedLength=function(e,t){return e*this.rw+t*this.rh},e.ComputedLength.prototype.isZero=function(){return 0===this.rw&&0===this.rh},e.toComputedLength=function(t,n,r,i,a,s){return"%"===n&&i?new e.ComputedLength(i.rw*t/100,i.rh*t/100):"em"===n&&r?new e.ComputedLength(r.rw*t,r.rh*t):"c"===n&&a?new e.ComputedLength(t*a.rw,t*a.rh):"px"===n&&s?new e.ComputedLength(t*s.rw,t*s.rh):"rh"===n?new e.ComputedLength(0,t/100):"rw"===n?new e.ComputedLength(t/100,0):null}}(t)},3516:function(e){"use strict";e.exports=function(e){var t="string"==typeof e?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}},2219:function(e,t,n){"use strict";var r=n(3516),i=n(395);e.exports=function(e){return r(e)||i(e)}},395:function(e){"use strict";e.exports=function(e){var t="string"==typeof e?e.charCodeAt(0):e;return t>=48&&t<=57}},3875:function(e){"use strict";function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",i=0,a=-1,s=0,o=0;o<=e.length;++o){if(o<e.length)n=e.charCodeAt(o);else{if(47===n)break;n=47}if(47===n){if(a===o-1||1===s);else if(a!==o-1&&2===s){if(r.length<2||2!==i||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){var u=r.lastIndexOf("/");if(u!==r.length-1){-1===u?(r="",i=0):i=(r=r.slice(0,u)).length-1-r.lastIndexOf("/"),a=o,s=0;continue}}else if(2===r.length||1===r.length){r="",i=0,a=o,s=0;continue}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(a+1,o):r=e.slice(a+1,o),i=o-a-1;a=o,s=0}else 46===n&&-1!==s?++s:s=-1}return r}var r={resolve:function(){for(var e,r="",i=!1,a=arguments.length-1;a>=-1&&!i;a--){var s;a>=0?s=arguments[a]:(void 0===e&&(e=process.cwd()),s=e),t(s),0!==s.length&&(r=s+"/"+r,i=47===s.charCodeAt(0))}return r=n(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n<arguments.length;++n){var i=arguments[n];t(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var a=e.length,s=a-i,o=1;o<n.length&&47===n.charCodeAt(o);++o);for(var u=n.length-o,l=s<u?s:u,c=-1,d=0;d<=l;++d){if(d===l){if(u>l){if(47===n.charCodeAt(o+d))return n.slice(o+d+1);if(0===d)return n.slice(o+d)}else s>l&&(47===e.charCodeAt(i+d)?c=d:0===d&&(c=0));break}var f=e.charCodeAt(i+d);if(f!==n.charCodeAt(o+d))break;47===f&&(c=d)}var h="";for(d=i+c+1;d<=a;++d)d!==a&&47!==e.charCodeAt(d)||(0===h.length?h+="..":h+="/..");return h.length>0?h+n.slice(o+c):(o+=c,47===n.charCodeAt(o)&&++o,n.slice(o))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,i=-1,a=!0,s=e.length-1;s>=1;--s)if(47===(n=e.charCodeAt(s))){if(!a){i=s;break}}else a=!1;return-1===i?r?"/":".":r&&1===i?"//":e.slice(0,i)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,i=0,a=-1,s=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var o=n.length-1,u=-1;for(r=e.length-1;r>=0;--r){var l=e.charCodeAt(r);if(47===l){if(!s){i=r+1;break}}else-1===u&&(s=!1,u=r+1),o>=0&&(l===n.charCodeAt(o)?-1==--o&&(a=r):(o=-1,a=u))}return i===a?a=u:-1===a&&(a=e.length),e.slice(i,a)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!s){i=r+1;break}}else-1===a&&(s=!1,a=r+1);return-1===a?"":e.slice(i,a)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,a=!0,s=0,o=e.length-1;o>=0;--o){var u=e.charCodeAt(o);if(47!==u)-1===i&&(a=!1,i=o+1),46===u?-1===n?n=o:1!==s&&(s=1):-1!==n&&(s=-1);else if(!a){r=o+1;break}}return-1===n||-1===i||0===s||1===s&&n===i-1&&n===r+1?"":e.slice(n,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,i=e.charCodeAt(0),a=47===i;a?(n.root="/",r=1):r=0;for(var s=-1,o=0,u=-1,l=!0,c=e.length-1,d=0;c>=r;--c)if(47!==(i=e.charCodeAt(c)))-1===u&&(l=!1,u=c+1),46===i?-1===s?s=c:1!==d&&(d=1):-1!==s&&(d=-1);else if(!l){o=c+1;break}return-1===s||-1===u||0===d||1===d&&s===u-1&&s===o+1?-1!==u&&(n.base=n.name=0===o&&a?e.slice(1,u):e.slice(o,u)):(0===o&&a?(n.name=e.slice(1,s),n.base=e.slice(1,u)):(n.name=e.slice(o,s),n.base=e.slice(o,u)),n.ext=e.slice(s,u)),o>0?n.dir=e.slice(0,o-1):a&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r},8387:function(e,t,n){var r=n(1549),i=r.Buffer;function a(e,t){for(var n in e)t[n]=e[n]}function s(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(a(r,t),t.Buffer=s),a(i,s),s.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},s.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},5378:function(e,t,n){!function(e){e.parser=function(e,t){return new i(e,t)},e.SAXParser=i,e.SAXStream=s,e.createStream=function(e,t){return new s(e,t)},e.MAX_BUFFER_LENGTH=65536;var t,r=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function i(t,n){if(!(this instanceof i))return new i(t,n);var a=this;!function(e){for(var t=0,n=r.length;t<n;t++)e[r[t]]=""}(a),a.q=a.c="",a.bufferCheckPosition=e.MAX_BUFFER_LENGTH,a.opt=n||{},a.opt.lowercase=a.opt.lowercase||a.opt.lowercasetags,a.looseCase=a.opt.lowercase?"toLowerCase":"toUpperCase",a.tags=[],a.closed=a.closedRoot=a.sawRoot=!1,a.tag=a.error=null,a.strict=!!t,a.noscript=!(!t&&!a.opt.noscript),a.state=A.BEGIN,a.strictEntities=a.opt.strictEntities,a.ENTITIES=a.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES),a.attribList=[],a.opt.xmlns&&(a.ns=Object.create(p)),a.trackPosition=!1!==a.opt.position,a.trackPosition&&(a.position=a.line=a.column=0),C(a,"onready")}e.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(e){function t(){}return t.prototype=e,new t}),Object.keys||(Object.keys=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}),i.prototype={end:function(){O(this)},write:function(t){var n=this;if(this.error)throw this.error;if(n.closed)return N(n,"Cannot write after close. Assign an onready handler.");if(null===t)return O(n);"object"==typeof t&&(t=t.toString());for(var i=0,a="";a=q(t,i++),n.c=a,a;)switch(n.trackPosition&&(n.position++,"\n"===a?(n.line++,n.column=0):n.column++),n.state){case A.BEGIN:if(n.state=A.BEGIN_WHITESPACE,"\ufeff"===a)continue;j(n,a);continue;case A.BEGIN_WHITESPACE:j(n,a);continue;case A.TEXT:if(n.sawRoot&&!n.closedRoot){for(var s=i-1;a&&"<"!==a&&"&"!==a;)(a=q(t,i++))&&n.trackPosition&&(n.position++,"\n"===a?(n.line++,n.column=0):n.column++);n.textNode+=t.substring(s,i-1)}"<"!==a||n.sawRoot&&n.closedRoot&&!n.strict?(!b(o,a)||n.sawRoot&&!n.closedRoot||P(n,"Text data outside of root node."),"&"===a?n.state=A.TEXT_ENTITY:n.textNode+=a):(n.state=A.OPEN_WAKA,n.startTagPosition=n.position);continue;case A.SCRIPT:"<"===a?n.state=A.SCRIPT_ENDING:n.script+=a;continue;case A.SCRIPT_ENDING:"/"===a?n.state=A.CLOSE_TAG:(n.script+="<"+a,n.state=A.SCRIPT);continue;case A.OPEN_WAKA:if("!"===a)n.state=A.SGML_DECL,n.sgmlDecl="";else if(T(o,a));else if(T(g,a))n.state=A.OPEN_TAG,n.tagName=a;else if("/"===a)n.state=A.CLOSE_TAG,n.tagName="";else if("?"===a)n.state=A.PROC_INST,n.procInstName=n.procInstBody="";else{if(P(n,"Unencoded <"),n.startTagPosition+1<n.position){var u=n.position-n.startTagPosition;a=new Array(u).join(" ")+a}n.textNode+="<"+a,n.state=A.TEXT}continue;case A.SGML_DECL:"[CDATA["===(n.sgmlDecl+a).toUpperCase()?(R(n,"onopencdata"),n.state=A.CDATA,n.sgmlDecl="",n.cdata=""):n.sgmlDecl+a==="--"?(n.state=A.COMMENT,n.comment="",n.sgmlDecl=""):"DOCTYPE"===(n.sgmlDecl+a).toUpperCase()?(n.state=A.DOCTYPE,(n.doctype||n.sawRoot)&&P(n,"Inappropriately located doctype declaration"),n.doctype="",n.sgmlDecl=""):">"===a?(R(n,"onsgmldeclaration",n.sgmlDecl),n.sgmlDecl="",n.state=A.TEXT):T(c,a)?(n.state=A.SGML_DECL_QUOTED,n.sgmlDecl+=a):n.sgmlDecl+=a;continue;case A.SGML_DECL_QUOTED:a===n.q&&(n.state=A.SGML_DECL,n.q=""),n.sgmlDecl+=a;continue;case A.DOCTYPE:">"===a?(n.state=A.TEXT,R(n,"ondoctype",n.doctype),n.doctype=!0):(n.doctype+=a,"["===a?n.state=A.DOCTYPE_DTD:T(c,a)&&(n.state=A.DOCTYPE_QUOTED,n.q=a));continue;case A.DOCTYPE_QUOTED:n.doctype+=a,a===n.q&&(n.q="",n.state=A.DOCTYPE);continue;case A.DOCTYPE_DTD:n.doctype+=a,"]"===a?n.state=A.DOCTYPE:T(c,a)&&(n.state=A.DOCTYPE_DTD_QUOTED,n.q=a);continue;case A.DOCTYPE_DTD_QUOTED:n.doctype+=a,a===n.q&&(n.state=A.DOCTYPE_DTD,n.q="");continue;case A.COMMENT:"-"===a?n.state=A.COMMENT_ENDING:n.comment+=a;continue;case A.COMMENT_ENDING:"-"===a?(n.state=A.COMMENT_ENDED,n.comment=x(n.opt,n.comment),n.comment&&R(n,"oncomment",n.comment),n.comment=""):(n.comment+="-"+a,n.state=A.COMMENT);continue;case A.COMMENT_ENDED:">"!==a?(P(n,"Malformed comment"),n.comment+="--"+a,n.state=A.COMMENT):n.state=A.TEXT;continue;case A.CDATA:"]"===a?n.state=A.CDATA_ENDING:n.cdata+=a;continue;case A.CDATA_ENDING:"]"===a?n.state=A.CDATA_ENDING_2:(n.cdata+="]"+a,n.state=A.CDATA);continue;case A.CDATA_ENDING_2:">"===a?(n.cdata&&R(n,"oncdata",n.cdata),R(n,"onclosecdata"),n.cdata="",n.state=A.TEXT):"]"===a?n.cdata+="]":(n.cdata+="]]"+a,n.state=A.CDATA);continue;case A.PROC_INST:"?"===a?n.state=A.PROC_INST_ENDING:T(o,a)?n.state=A.PROC_INST_BODY:n.procInstName+=a;continue;case A.PROC_INST_BODY:if(!n.procInstBody&&T(o,a))continue;"?"===a?n.state=A.PROC_INST_ENDING:n.procInstBody+=a;continue;case A.PROC_INST_ENDING:">"===a?(R(n,"onprocessinginstruction",{name:n.procInstName,body:n.procInstBody}),n.procInstName=n.procInstBody="",n.state=A.TEXT):(n.procInstBody+="?"+a,n.state=A.PROC_INST_BODY);continue;case A.OPEN_TAG:T(m,a)?n.tagName+=a:(M(n),">"===a?F(n):"/"===a?n.state=A.OPEN_TAG_SLASH:(b(o,a)&&P(n,"Invalid character in tag name"),n.state=A.ATTRIB));continue;case A.OPEN_TAG_SLASH:">"===a?(F(n,!0),U(n)):(P(n,"Forward-slash in opening tag not followed by >"),n.state=A.ATTRIB);continue;case A.ATTRIB:if(T(o,a))continue;">"===a?F(n):"/"===a?n.state=A.OPEN_TAG_SLASH:T(g,a)?(n.attribName=a,n.attribValue="",n.state=A.ATTRIB_NAME):P(n,"Invalid attribute name");continue;case A.ATTRIB_NAME:"="===a?n.state=A.ATTRIB_VALUE:">"===a?(P(n,"Attribute without value"),n.attribValue=n.attribName,L(n),F(n)):T(o,a)?n.state=A.ATTRIB_NAME_SAW_WHITE:T(m,a)?n.attribName+=a:P(n,"Invalid attribute name");continue;case A.ATTRIB_NAME_SAW_WHITE:if("="===a)n.state=A.ATTRIB_VALUE;else{if(T(o,a))continue;P(n,"Attribute without value"),n.tag.attributes[n.attribName]="",n.attribValue="",R(n,"onattribute",{name:n.attribName,value:""}),n.attribName="",">"===a?F(n):T(g,a)?(n.attribName=a,n.state=A.ATTRIB_NAME):(P(n,"Invalid attribute name"),n.state=A.ATTRIB)}continue;case A.ATTRIB_VALUE:if(T(o,a))continue;T(c,a)?(n.q=a,n.state=A.ATTRIB_VALUE_QUOTED):(P(n,"Unquoted attribute value"),n.state=A.ATTRIB_VALUE_UNQUOTED,n.attribValue=a);continue;case A.ATTRIB_VALUE_QUOTED:if(a!==n.q){"&"===a?n.state=A.ATTRIB_VALUE_ENTITY_Q:n.attribValue+=a;continue}L(n),n.q="",n.state=A.ATTRIB_VALUE_CLOSED;continue;case A.ATTRIB_VALUE_CLOSED:T(o,a)?n.state=A.ATTRIB:">"===a?F(n):"/"===a?n.state=A.OPEN_TAG_SLASH:T(g,a)?(P(n,"No whitespace between attributes"),n.attribName=a,n.attribValue="",n.state=A.ATTRIB_NAME):P(n,"Invalid attribute name");continue;case A.ATTRIB_VALUE_UNQUOTED:if(b(d,a)){"&"===a?n.state=A.ATTRIB_VALUE_ENTITY_U:n.attribValue+=a;continue}L(n),">"===a?F(n):n.state=A.ATTRIB;continue;case A.CLOSE_TAG:if(n.tagName)">"===a?U(n):T(m,a)?n.tagName+=a:n.script?(n.script+="</"+n.tagName,n.tagName="",n.state=A.SCRIPT):(b(o,a)&&P(n,"Invalid tagname in closing tag"),n.state=A.CLOSE_TAG_SAW_WHITE);else{if(T(o,a))continue;b(g,a)?n.script?(n.script+="</"+a,n.state=A.SCRIPT):P(n,"Invalid tagname in closing tag."):n.tagName=a}continue;case A.CLOSE_TAG_SAW_WHITE:if(T(o,a))continue;">"===a?U(n):P(n,"Invalid characters in closing tag");continue;case A.TEXT_ENTITY:case A.ATTRIB_VALUE_ENTITY_Q:case A.ATTRIB_VALUE_ENTITY_U:var l,f;switch(n.state){case A.TEXT_ENTITY:l=A.TEXT,f="textNode";break;case A.ATTRIB_VALUE_ENTITY_Q:l=A.ATTRIB_VALUE_QUOTED,f="attribValue";break;case A.ATTRIB_VALUE_ENTITY_U:l=A.ATTRIB_VALUE_UNQUOTED,f="attribValue"}";"===a?(n[f]+=B(n),n.entity="",n.state=l):T(n.entity.length?v:y,a)?n.entity+=a:(P(n,"Invalid character in entity name"),n[f]+="&"+n.entity+a,n.entity="",n.state=l);continue;default:throw new Error(n,"Unknown state: "+n.state)}return n.position>=n.bufferCheckPosition&&function(t){for(var n=Math.max(e.MAX_BUFFER_LENGTH,10),i=0,a=0,s=r.length;a<s;a++){var o=t[r[a]].length;if(o>n)switch(r[a]){case"textNode":D(t);break;case"cdata":R(t,"oncdata",t.cdata),t.cdata="";break;case"script":R(t,"onscript",t.script),t.script="";break;default:N(t,"Max buffer length exceeded: "+r[a])}i=Math.max(i,o)}var u=e.MAX_BUFFER_LENGTH-i;t.bufferCheckPosition=u+t.position}(n),n},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var e;D(e=this),""!==e.cdata&&(R(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(R(e,"onscript",e.script),e.script="")}};try{t=n(182).Stream}catch(e){t=function(){}}var a=e.EVENTS.filter((function(e){return"error"!==e&&"end"!==e}));function s(e,n){if(!(this instanceof s))return new s(e,n);t.apply(this),this._parser=new i(e,n),this.writable=!0,this.readable=!0;var r=this;this._parser.onend=function(){r.emit("end")},this._parser.onerror=function(e){r.emit("error",e),r._parser.error=null},this._decoder=null,a.forEach((function(e){Object.defineProperty(r,"on"+e,{get:function(){return r._parser["on"+e]},set:function(t){if(!t)return r.removeAllListeners(e),r._parser["on"+e]=t,t;r.on(e,t)},enumerable:!0,configurable:!1})}))}s.prototype=Object.create(t.prototype,{constructor:{value:s}}),s.prototype.write=function(e){if("function"==typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(e)){if(!this._decoder){var t=n(7503).s;this._decoder=new t("utf8")}e=this._decoder.write(e)}return this._parser.write(e.toString()),this.emit("data",e),!0},s.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},s.prototype.on=function(e,n){var r=this;return r._parser["on"+e]||-1===a.indexOf(e)||(r._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),r.emit.apply(r,t)}),t.prototype.on.call(r,e,n)};var o="\r\n\t ",u="0124356789",l="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",c="'\"",d=o+">",f="http://www.w3.org/XML/1998/namespace",h="http://www.w3.org/2000/xmlns/",p={xml:f,xmlns:h};o=_(o),u=_(u),l=_(l);var g=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,m=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/,y=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,v=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;function _(e){return e.split("").reduce((function(e,t){return e[t]=!0,e}),{})}function T(e,t){return function(e){return"[object RegExp]"===Object.prototype.toString.call(e)}(e)?!!t.match(e):e[t]}function b(e,t){return!T(e,t)}c=_(c),d=_(d);var E,S,w,A=0;for(var I in e.STATE={BEGIN:A++,BEGIN_WHITESPACE:A++,TEXT:A++,TEXT_ENTITY:A++,OPEN_WAKA:A++,SGML_DECL:A++,SGML_DECL_QUOTED:A++,DOCTYPE:A++,DOCTYPE_QUOTED:A++,DOCTYPE_DTD:A++,DOCTYPE_DTD_QUOTED:A++,COMMENT_STARTING:A++,COMMENT:A++,COMMENT_ENDING:A++,COMMENT_ENDED:A++,CDATA:A++,CDATA_ENDING:A++,CDATA_ENDING_2:A++,PROC_INST:A++,PROC_INST_BODY:A++,PROC_INST_ENDING:A++,OPEN_TAG:A++,OPEN_TAG_SLASH:A++,ATTRIB:A++,ATTRIB_NAME:A++,ATTRIB_NAME_SAW_WHITE:A++,ATTRIB_VALUE:A++,ATTRIB_VALUE_QUOTED:A++,ATTRIB_VALUE_CLOSED:A++,ATTRIB_VALUE_UNQUOTED:A++,ATTRIB_VALUE_ENTITY_Q:A++,ATTRIB_VALUE_ENTITY_U:A++,CLOSE_TAG:A++,CLOSE_TAG_SAW_WHITE:A++,SCRIPT:A++,SCRIPT_ENDING:A++},e.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},e.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(e.ENTITIES).forEach((function(t){var n=e.ENTITIES[t],r="number"==typeof n?String.fromCharCode(n):n;e.ENTITIES[t]=r})),e.STATE)e.STATE[e.STATE[I]]=I;function C(e,t,n){e[t]&&e[t](n)}function R(e,t,n){e.textNode&&D(e),C(e,t,n)}function D(e){e.textNode=x(e.opt,e.textNode),e.textNode&&C(e,"ontext",e.textNode),e.textNode=""}function x(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function N(e,t){return D(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,C(e,"onerror",t),e}function O(e){return e.sawRoot&&!e.closedRoot&&P(e,"Unclosed root tag"),e.state!==A.BEGIN&&e.state!==A.BEGIN_WHITESPACE&&e.state!==A.TEXT&&N(e,"Unexpected end"),D(e),e.c="",e.closed=!0,C(e,"onend"),i.call(e,e.strict,e.opt),e}function P(e,t){if("object"!=typeof e||!(e instanceof i))throw new Error("bad call to strictFail");e.strict&&N(e,t)}function M(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0,R(e,"onopentagstart",n)}function k(e,t){var n=e.indexOf(":")<0?["",e]:e.split(":"),r=n[0],i=n[1];return t&&"xmlns"===e&&(r="xmlns",i=""),{prefix:r,local:i}}function L(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=k(e.attribName,!0),n=t.prefix,r=t.local;if("xmlns"===n)if("xml"===r&&e.attribValue!==f)P(e,"xml: prefix must be bound to "+f+"\nActual: "+e.attribValue);else if("xmlns"===r&&e.attribValue!==h)P(e,"xmlns: prefix must be bound to "+h+"\nActual: "+e.attribValue);else{var i=e.tag,a=e.tags[e.tags.length-1]||e;i.ns===a.ns&&(i.ns=Object.create(a.ns)),i.ns[r]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,R(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function F(e,t){if(e.opt.xmlns){var n=e.tag,r=k(e.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(P(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),n.uri=r.prefix);var i=e.tags[e.tags.length-1]||e;n.ns&&i.ns!==n.ns&&Object.keys(n.ns).forEach((function(t){R(e,"onopennamespace",{prefix:t,uri:n.ns[t]})}));for(var a=0,s=e.attribList.length;a<s;a++){var o=e.attribList[a],u=o[0],l=o[1],c=k(u,!0),d=c.prefix,f=c.local,h=""===d?"":n.ns[d]||"",p={name:u,value:l,prefix:d,local:f,uri:h};d&&"xmlns"!==d&&!h&&(P(e,"Unbound namespace prefix: "+JSON.stringify(d)),p.uri=d),e.tag.attributes[u]=p,R(e,"onattribute",p)}e.attribList.length=0}e.tag.isSelfClosing=!!t,e.sawRoot=!0,e.tags.push(e.tag),R(e,"onopentag",e.tag),t||(e.noscript||"script"!==e.tagName.toLowerCase()?e.state=A.TEXT:e.state=A.SCRIPT,e.tag=null,e.tagName=""),e.attribName=e.attribValue="",e.attribList.length=0}function U(e){if(!e.tagName)return P(e,"Weird empty close tag."),e.textNode+="</>",void(e.state=A.TEXT);if(e.script){if("script"!==e.tagName)return e.script+="</"+e.tagName+">",e.tagName="",void(e.state=A.SCRIPT);R(e,"onscript",e.script),e.script=""}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var r=n;t--&&e.tags[t].name!==r;)P(e,"Unexpected close tag");if(t<0)return P(e,"Unmatched closing tag: "+e.tagName),e.textNode+="</"+e.tagName+">",void(e.state=A.TEXT);e.tagName=n;for(var i=e.tags.length;i-- >t;){var a=e.tag=e.tags.pop();e.tagName=e.tag.name,R(e,"onclosetag",e.tagName);var s={};for(var o in a.ns)s[o]=a.ns[o];var u=e.tags[e.tags.length-1]||e;e.opt.xmlns&&a.ns!==u.ns&&Object.keys(a.ns).forEach((function(t){var n=a.ns[t];R(e,"onclosenamespace",{prefix:t,uri:n})}))}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=A.TEXT}function B(e){var t,n=e.entity,r=n.toLowerCase(),i="";return e.ENTITIES[n]?e.ENTITIES[n]:e.ENTITIES[r]?e.ENTITIES[r]:("#"===(n=r).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),i=(t=parseInt(n,16)).toString(16)):(n=n.slice(1),i=(t=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),i.toLowerCase()!==n?(P(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function j(e,t){"<"===t?(e.state=A.OPEN_WAKA,e.startTagPosition=e.position):b(o,t)&&(P(e,"Non-whitespace before first tag."),e.textNode=t,e.state=A.TEXT)}function q(e,t){var n="";return t<e.length&&(n=e.charAt(t)),n}A=e.STATE,String.fromCodePoint||(E=String.fromCharCode,S=Math.floor,w=function(){var e,t,n=[],r=-1,i=arguments.length;if(!i)return"";for(var a="";++r<i;){var s=Number(arguments[r]);if(!isFinite(s)||s<0||s>1114111||S(s)!==s)throw RangeError("Invalid code point: "+s);s<=65535?n.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,n.push(e,t)),(r+1===i||n.length>16384)&&(a+=E.apply(null,n),n.length=0)}return a},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:w,configurable:!0,writable:!0}):String.fromCodePoint=w)}(t)},182:function(e,t,n){e.exports=i;var r=n(1159).EventEmitter;function i(){r.call(this)}n(1765)(i,r),i.Readable=n(2846),i.Writable=n(8318),i.Duplex=n(6138),i.Transform=n(9798),i.PassThrough=n(5472),i.finished=n(8800),i.pipeline=n(7295),i.Stream=i,i.prototype.pipe=function(e,t){var n=this;function i(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function a(){n.readable&&n.resume&&n.resume()}n.on("data",i),e.on("drain",a),e._isStdio||t&&!1===t.end||(n.on("end",o),n.on("close",u));var s=!1;function o(){s||(s=!0,e.end())}function u(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(c(),0===r.listenerCount(this,"error"))throw e}function c(){n.removeListener("data",i),e.removeListener("drain",a),n.removeListener("end",o),n.removeListener("close",u),n.removeListener("error",l),e.removeListener("error",l),n.removeListener("end",c),n.removeListener("close",c),e.removeListener("close",c)}return n.on("error",l),e.on("error",l),n.on("end",c),n.on("close",c),e.on("close",c),e.emit("pipe",n),e}},1765:function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},3690:function(e){"use strict";var t={};function n(e,n,r){r||(r=Error);var i=function(e){var t,r;function i(t,r,i){return e.call(this,function(e,t,r){return"string"==typeof n?n:n(e,t,r)}(t,r,i))||this}return r=e,(t=i).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,i}(r);i.prototype.name=r.name,i.prototype.code=e,t[e]=i}function r(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map((function(e){return String(e)})),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}n("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(e,t,n){var i,a,s,o,u;if("string"==typeof t&&(a="not ",t.substr(0,4)===a)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-9,n)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(r(t,"type"));else{var l=("number"!=typeof u&&(u=0),u+1>(o=e).length||-1===o.indexOf(".",u)?"argument":"property");s='The "'.concat(e,'" ').concat(l," ").concat(i," ").concat(r(t,"type"))}return s+". Received type ".concat(typeof n)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},6138:function(e,t,n){"use strict";var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=l;var i=n(2846),a=n(8318);n(1765)(l,i);for(var s=r(a.prototype),o=0;o<s.length;o++){var u=s[o];l.prototype[u]||(l.prototype[u]=a.prototype[u])}function l(e){if(!(this instanceof l))return new l(e);i.call(this,e),a.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||process.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},5472:function(e,t,n){"use strict";e.exports=i;var r=n(9798);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}n(1765)(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},2846:function(e,t,n){"use strict";var r;e.exports=w,w.ReadableState=S,n(1159).EventEmitter;var i,a=function(e,t){return e.listeners(t).length},s=n(9299),o=n(1549).Buffer,u=n.g.Uint8Array||function(){},l=n(964);i=l&&l.debuglog?l.debuglog("stream"):function(){};var c,d,f,h=n(8393),p=n(6163),g=n(7269).getHighWaterMark,m=n(3690).q,y=m.ERR_INVALID_ARG_TYPE,v=m.ERR_STREAM_PUSH_AFTER_EOF,_=m.ERR_METHOD_NOT_IMPLEMENTED,T=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(1765)(w,s);var b=p.errorOrDestroy,E=["error","close","destroy","pause","resume"];function S(e,t,i){r=r||n(6138),e=e||{},"boolean"!=typeof i&&(i=t instanceof r),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",i),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(c||(c=n(7503).s),this.decoder=new c(e.encoding),this.encoding=e.encoding)}function w(e){if(r=r||n(6138),!(this instanceof w))return new w(e);var t=this instanceof r;this._readableState=new S(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function A(e,t,n,r,a){i("readableAddChunk",t);var s,l=e._readableState;if(null===t)l.reading=!1,function(e,t){if(i("onEofChunk"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?D(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,x(e)))}}(e,l);else if(a||(s=function(e,t){var n,r;return r=t,o.isBuffer(r)||r instanceof u||"string"==typeof t||void 0===t||e.objectMode||(n=new y("chunk",["string","Buffer","Uint8Array"],t)),n}(l,t)),s)b(e,s);else if(l.objectMode||t&&t.length>0)if("string"==typeof t||l.objectMode||Object.getPrototypeOf(t)===o.prototype||(t=function(e){return o.from(e)}(t)),r)l.endEmitted?b(e,new T):I(e,l,t,!0);else if(l.ended)b(e,new v);else{if(l.destroyed)return!1;l.reading=!1,l.decoder&&!n?(t=l.decoder.write(t),l.objectMode||0!==t.length?I(e,l,t,!1):N(e,l)):I(e,l,t,!1)}else r||(l.reading=!1,N(e,l));return!l.ended&&(l.length<l.highWaterMark||0===l.length)}function I(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&D(e)),N(e,t)}Object.defineProperty(w.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),w.prototype.destroy=p.destroy,w.prototype._undestroy=p.undestroy,w.prototype._destroy=function(e,t){t(e)},w.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=o.from(e,t),t=""),n=!0),A(this,e,t,!1,n)},w.prototype.unshift=function(e){return A(this,e,null,!0,!1)},w.prototype.isPaused=function(){return!1===this._readableState.flowing},w.prototype.setEncoding=function(e){c||(c=n(7503).s);var t=new c(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var C=1073741824;function R(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=C?e=C:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function D(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(x,e))}function x(e){var t=e._readableState;i("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,L(e)}function N(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(O,e,t))}function O(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var n=t.length;if(i("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function P(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function M(e){i("readable nexttick read 0"),e.read(0)}function k(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L(e),t.flowing&&!t.reading&&e.read(0)}function L(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function F(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function U(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(B,t,e))}function B(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function j(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}w.prototype.read=function(e){i("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return i("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):D(this),null;if(0===(e=R(e,t))&&t.ended)return 0===t.length&&U(this),null;var r,a=t.needReadable;return i("need readable",a),(0===t.length||t.length-e<t.highWaterMark)&&i("length less than watermark",a=!0),t.ended||t.reading?i("reading or ended",a=!1):a&&(i("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=R(n,t))),null===(r=e>0?F(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&U(this)),null!==r&&this.emit("data",r),r},w.prototype._read=function(e){b(this,new _("_read()"))},w.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,i("pipe count=%d opts=%j",r.pipesCount,t);var s=t&&!1===t.end||e===process.stdout||e===process.stderr?p:o;function o(){i("onend"),e.end()}r.endEmitted?process.nextTick(s):n.once("end",s),e.on("unpipe",(function t(a,s){i("onunpipe"),a===n&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,i("cleanup"),e.removeListener("close",f),e.removeListener("finish",h),e.removeListener("drain",u),e.removeListener("error",d),e.removeListener("unpipe",t),n.removeListener("end",o),n.removeListener("end",p),n.removeListener("data",c),l=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}));var u=function(e){return function(){var t=e._readableState;i("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,L(e))}}(n);e.on("drain",u);var l=!1;function c(t){i("ondata");var a=e.write(t);i("dest.write",a),!1===a&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==j(r.pipes,e))&&!l&&(i("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function d(t){i("onerror",t),p(),e.removeListener("error",d),0===a(e,"error")&&b(e,t)}function f(){e.removeListener("finish",h),p()}function h(){i("onfinish"),e.removeListener("close",f),p()}function p(){i("unpipe"),n.unpipe(e)}return n.on("data",c),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",d),e.once("close",f),e.once("finish",h),e.emit("pipe",n),r.flowing||(i("pipe resume"),n.resume()),e},w.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)r[a].emit("unpipe",this,{hasUnpiped:!1});return this}var s=j(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},w.prototype.on=function(e,t){var n=s.prototype.on.call(this,e,t),r=this._readableState;return"data"===e?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,i("on readable",r.length,r.reading),r.length?D(this):r.reading||process.nextTick(M,this))),n},w.prototype.addListener=w.prototype.on,w.prototype.removeListener=function(e,t){var n=s.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(P,this),n},w.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(P,this),t},w.prototype.resume=function(){var e=this._readableState;return e.flowing||(i("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(k,e,t))}(this,e)),e.paused=!1,this},w.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},w.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var a in e.on("end",(function(){if(i("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(a){i("wrapped data"),n.decoder&&(a=n.decoder.write(a)),n.objectMode&&null==a||(n.objectMode||a&&a.length)&&(t.push(a)||(r=!0,e.pause()))})),e)void 0===this[a]&&"function"==typeof e[a]&&(this[a]=function(t){return function(){return e[t].apply(e,arguments)}}(a));for(var s=0;s<E.length;s++)e.on(E[s],this.emit.bind(this,E[s]));return this._read=function(t){i("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(w.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=n(7299)),d(this)}),Object.defineProperty(w.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(w.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(w.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),w._fromList=F,Object.defineProperty(w.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(w.from=function(e,t){return void 0===f&&(f=n(6233)),f(w,e,t)})},9798:function(e,t,n){"use strict";e.exports=c;var r=n(3690).q,i=r.ERR_METHOD_NOT_IMPLEMENTED,a=r.ERR_MULTIPLE_CALLBACK,s=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=r.ERR_TRANSFORM_WITH_LENGTH_0,u=n(6138);function l(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new a);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function c(e){if(!(this instanceof c))return new c(e);u.call(this,e),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",d)}function d(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush((function(t,n){f(e,t,n)}))}function f(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new o;if(e._transformState.transforming)throw new s;return e.push(null)}n(1765)(c,u),c.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},c.prototype._transform=function(e,t,n){n(new i("_transform()"))},c.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},c.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},c.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},8318:function(e,t,n){"use strict";function r(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(void 0),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}var i;e.exports=w,w.WritableState=S;var a,s={deprecate:n(7839)},o=n(9299),u=n(1549).Buffer,l=n.g.Uint8Array||function(){},c=n(6163),d=n(7269).getHighWaterMark,f=n(3690).q,h=f.ERR_INVALID_ARG_TYPE,p=f.ERR_METHOD_NOT_IMPLEMENTED,g=f.ERR_MULTIPLE_CALLBACK,m=f.ERR_STREAM_CANNOT_PIPE,y=f.ERR_STREAM_DESTROYED,v=f.ERR_STREAM_NULL_VALUES,_=f.ERR_STREAM_WRITE_AFTER_END,T=f.ERR_UNKNOWN_ENCODING,b=c.errorOrDestroy;function E(){}function S(e,t,a){i=i||n(6138),e=e||{},"boolean"!=typeof a&&(a=t instanceof i),this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if("function"!=typeof i)throw new g;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(process.nextTick(i,r),process.nextTick(x,e,t),e._writableState.errorEmitted=!0,b(e,r)):(i(r),e._writableState.errorEmitted=!0,b(e,r),x(e,t))}(e,n,r,t,i);else{var a=R(n)||e.destroyed;a||n.corked||n.bufferProcessing||!n.bufferedRequest||C(e,n),r?process.nextTick(I,e,n,a,i):I(e,n,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function w(e){var t=this instanceof(i=i||n(6138));if(!t&&!a.call(w,this))return new w(e);this._writableState=new S(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),o.call(this)}function A(e,t,n,r,i,a,s){t.writelen=r,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y("write")):n?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function I(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),x(e,t)}function C(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var i=t.bufferedRequestCount,a=new Array(i),s=t.corkedRequestsFree;s.entry=n;for(var o=0,u=!0;n;)a[o]=n,n.isBuf||(u=!1),n=n.next,o+=1;a.allBuffers=u,A(e,t,!0,t.length,a,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new r(t),t.bufferedRequestCount=0}else{for(;n;){var l=n.chunk,c=n.encoding,d=n.callback;if(A(e,t,!1,t.objectMode?1:l.length,l,c,d),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function R(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function D(e,t){e._final((function(n){t.pendingcb--,n&&b(e,n),t.prefinished=!0,e.emit("prefinish"),x(e,t)}))}function x(e,t){var n=R(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(D,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}n(1765)(w,o),S.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(S.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(w,Symbol.hasInstance,{value:function(e){return!!a.call(this,e)||this===w&&e&&e._writableState instanceof S}})):a=function(e){return e instanceof this},w.prototype.pipe=function(){b(this,new m)},w.prototype.write=function(e,t,n){var r,i=this._writableState,a=!1,s=!i.objectMode&&(r=e,u.isBuffer(r)||r instanceof l);return s&&!u.isBuffer(e)&&(e=function(e){return u.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=E),i.ending?function(e,t){var n=new _;b(e,n),process.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var i;return null===n?i=new v:"string"==typeof n||t.objectMode||(i=new h("chunk",["string","Buffer"],n)),!i||(b(e,i),process.nextTick(r,i),!1)}(this,i,e,n))&&(i.pendingcb++,a=function(e,t,n,r,i,a){if(!n){var s=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=u.from(t,n)),t}(t,r,i);r!==s&&(n=!0,i="buffer",r=s)}var o=t.objectMode?1:r.length;t.length+=o;var l=t.length<t.highWaterMark;if(l||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:a,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else A(e,t,!1,o,r,i,a);return l}(this,i,s,e,t,n)),a},w.prototype.cork=function(){this._writableState.corked++},w.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||C(this,e))},w.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new T(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(w.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(w.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),w.prototype._write=function(e,t,n){n(new p("_write()"))},w.prototype._writev=null,w.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,x(e,t),n&&(t.finished?process.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(w.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(w.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),w.prototype.destroy=c.destroy,w.prototype._undestroy=c.undestroy,w.prototype._destroy=function(e,t){t(e)}},7299:function(e,t,n){"use strict";var r;function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=n(8800),s=Symbol("lastResolve"),o=Symbol("lastReject"),u=Symbol("error"),l=Symbol("ended"),c=Symbol("lastPromise"),d=Symbol("handlePromise"),f=Symbol("stream");function h(e,t){return{value:e,done:t}}function p(e){var t=e[s];if(null!==t){var n=e[f].read();null!==n&&(e[c]=null,e[s]=null,e[o]=null,t(h(n,!1)))}}function g(e){process.nextTick(p,e)}var m=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((i(r={get stream(){return this[f]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[l])return Promise.resolve(h(void 0,!0));if(this[f].destroyed)return new Promise((function(t,n){process.nextTick((function(){e[u]?n(e[u]):t(h(void 0,!0))}))}));var n,r=this[c];if(r)n=new Promise(function(e,t){return function(n,r){e.then((function(){t[l]?n(h(void 0,!0)):t[d](n,r)}),r)}}(r,this));else{var i=this[f].read();if(null!==i)return Promise.resolve(h(i,!1));n=new Promise(this[d])}return this[c]=n,n}},Symbol.asyncIterator,(function(){return this})),i(r,"return",(function(){var e=this;return new Promise((function(t,n){e[f].destroy(null,(function(e){e?n(e):t(h(void 0,!0))}))}))})),r),m);e.exports=function(e){var t,n=Object.create(y,(i(t={},f,{value:e,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,o,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,l,{value:e._readableState.endEmitted,writable:!0}),i(t,d,{value:function(e,t){var r=n[f].read();r?(n[c]=null,n[s]=null,n[o]=null,e(h(r,!1))):(n[s]=e,n[o]=t)},writable:!0}),t));return n[c]=null,a(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[o];return null!==t&&(n[c]=null,n[s]=null,n[o]=null,t(e)),void(n[u]=e)}var r=n[s];null!==r&&(n[c]=null,n[s]=null,n[o]=null,r(h(void 0,!0))),n[l]=!0})),e.on("readable",g.bind(null,n)),n}},8393:function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=n(1549).Buffer,s=n(9862).inspect,o=s&&s.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t;return t=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t,n,r,i=a.allocUnsafe(e>>>0),s=this.head,o=0;s;)t=s.data,n=i,r=o,a.prototype.copy.call(t,n,r),o+=s.data.length,s=s.next;return i}},{key:"consume",value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var i=t.data,a=e>i.length?i.length:e;if(a===i.length?r+=i:r+=i.slice(0,e),0==(e-=a)){a===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(a));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,s=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,s),0==(e-=s)){s===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(s));break}++r}return this.length-=r,t}},{key:o,value:function(e,t){return s(this,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}],t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}()},6163:function(e){"use strict";function t(e,t){r(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function r(e,t){e.emit("error",t)}e.exports={destroy:function(e,i){var a=this,s=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return s||o?(i?i(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(r,this,e)):process.nextTick(r,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!i&&e?a._writableState?a._writableState.errorEmitted?process.nextTick(n,a):(a._writableState.errorEmitted=!0,process.nextTick(t,a,e)):process.nextTick(t,a,e):i?(process.nextTick(n,a),i(e)):process.nextTick(n,a)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}}},8800:function(e,t,n){"use strict";var r=n(3690).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,n,a){if("function"==typeof n)return e(t,null,n);n||(n={}),a=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];e.apply(this,r)}}}(a||i);var s=n.readable||!1!==n.readable&&t.readable,o=n.writable||!1!==n.writable&&t.writable,u=function(){t.writable||c()},l=t._writableState&&t._writableState.finished,c=function(){o=!1,l=!0,s||a.call(t)},d=t._readableState&&t._readableState.endEmitted,f=function(){s=!1,d=!0,o||a.call(t)},h=function(e){a.call(t,e)},p=function(){var e;return s&&!d?(t._readableState&&t._readableState.ended||(e=new r),a.call(t,e)):o&&!l?(t._writableState&&t._writableState.ended||(e=new r),a.call(t,e)):void 0},g=function(){t.req.on("finish",c)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",c),t.on("abort",p),t.req?g():t.on("request",g)):o&&!t._writableState&&(t.on("end",u),t.on("close",u)),t.on("end",f),t.on("finish",c),!1!==n.error&&t.on("error",h),t.on("close",p),function(){t.removeListener("complete",c),t.removeListener("abort",p),t.removeListener("request",g),t.req&&t.req.removeListener("finish",c),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",c),t.removeListener("end",f),t.removeListener("error",h),t.removeListener("close",p)}}},6233:function(e){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},7295:function(e,t,n){"use strict";var r,i=n(3690).q,a=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function o(e){if(e)throw e}function u(e,t,i,a){a=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(a);var o=!1;e.on("close",(function(){o=!0})),void 0===r&&(r=n(8800)),r(e,{readable:t,writable:i},(function(e){if(e)return a(e);o=!0,a()}));var u=!1;return function(t){if(!o&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void a(t||new s("pipe"))}}function l(e){e()}function c(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=function(e){return e.length?"function"!=typeof e[e.length-1]?o:e.pop():o}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new a("streams");var s=t.map((function(e,n){var a=n<t.length-1;return u(e,a,n>0,(function(e){r||(r=e),e&&s.forEach(l),a||(s.forEach(l),i(r))}))}));return t.reduce(c)}},7269:function(e,t,n){"use strict";var r=n(3690).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,n,i){var a=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,i,n);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new r(i?n:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}},9299:function(e,t,n){e.exports=n(1159).EventEmitter},7503:function(e,t,n){"use strict";var r=n(8387).Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=l,t=4;break;case"utf8":this.fillLast=o,t=4;break;case"base64":this.text=c,this.end=d,t=3;break;default:return this.write=f,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function c(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.s=a,a.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},a.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},a.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=s(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||-2===i?0:(i=s(t[r]))>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||-2===i?0:(i=s(t[r]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},1067:function(e,t,n){var r;!function(i,a){"use strict";var s="function",o="undefined",u="object",l="string",c="model",d="name",f="type",h="vendor",p="version",g="architecture",m="console",y="mobile",v="tablet",_="smarttv",T="wearable",b="embedded",E="Amazon",S="Apple",w="ASUS",A="BlackBerry",I="Browser",C="Chrome",R="Firefox",D="Google",x="Huawei",N="LG",O="Microsoft",P="Motorola",M="Opera",k="Samsung",L="Sony",F="Xiaomi",U="Zebra",B="Facebook",j=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},q=function(e,t){return typeof e===l&&-1!==H(t).indexOf(H(e))},H=function(e){return e.toLowerCase()},G=function(e,t){if(typeof e===l)return e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,""),typeof t===o?e:e.substring(0,255)},V=function(e,t){for(var n,r,i,o,l,c,d=0;d<t.length&&!l;){var f=t[d],h=t[d+1];for(n=r=0;n<f.length&&!l;)if(l=f[n++].exec(e))for(i=0;i<h.length;i++)c=l[++r],typeof(o=h[i])===u&&o.length>0?2===o.length?typeof o[1]==s?this[o[0]]=o[1].call(this,c):this[o[0]]=o[1]:3===o.length?typeof o[1]!==s||o[1].exec&&o[1].test?this[o[0]]=c?c.replace(o[1],o[2]):a:this[o[0]]=c?o[1].call(this,c,o[2]):a:4===o.length&&(this[o[0]]=c?o[3].call(this,c.replace(o[1],o[2])):a):this[o]=c||a;d+=2}},Y=function(e,t){for(var n in t)if(typeof t[n]===u&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(q(t[n][r],e))return"?"===n?a:n}else if(q(t[n],e))return"?"===n?a:n;return e},z={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Z={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[d,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[d,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[d,p],[/opios[\/ ]+([\w\.]+)/i],[p,[d,M+" Mini"]],[/\bopr\/([\w\.]+)/i],[p,[d,M]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[d,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[d,"UC"+I]],[/\bqbcore\/([\w\.]+)/i],[p,[d,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[p,[d,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[d,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[d,"IE"]],[/yabrowser\/([\w\.]+)/i],[p,[d,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[d,/(.+)/,"$1 Secure "+I],p],[/\bfocus\/([\w\.]+)/i],[p,[d,R+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[d,M+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[d,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[d,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[d,M+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[d,"MIUI "+I]],[/fxios\/([-\w\.]+)/i],[p,[d,R]],[/\bqihu|(qi?ho?o?|360)browser/i],[[d,"360 "+I]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[d,/(.+)/,"$1 "+I],p],[/(comodo_dragon)\/([\w\.]+)/i],[[d,/_/g," "],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[d,p],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[d],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[d,B],p],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[d,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[d,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[d,C+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[d,C+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[d,"Android "+I]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[d,p],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[p,[d,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[p,d],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[d,[p,Y,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[d,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[d,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[d,R+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[d,p]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[g,"amd64"]],[/(ia32(?=;))/i],[[g,H]],[/((?:i[346]|x)86)[;\)]/i],[[g,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[g,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[g,"armhf"]],[/windows (ce|mobile); ppc;/i],[[g,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[g,/ower/,"",H]],[/(sun4\w)[;\)]/i],[[g,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[g,H]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[c,[h,k],[f,v]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[c,[h,k],[f,y]],[/\((ip(?:hone|od)[\w ]*);/i],[c,[h,S],[f,y]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[c,[h,S],[f,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[c,[h,x],[f,v]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[c,[h,x],[f,y]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[c,/_/g," "],[h,F],[f,y]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[c,/_/g," "],[h,F],[f,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[c,[h,"OPPO"],[f,y]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[c,[h,"Vivo"],[f,y]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[c,[h,"Realme"],[f,y]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[c,[h,P],[f,y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[c,[h,P],[f,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[c,[h,N],[f,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[c,[h,N],[f,y]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[c,[h,"Lenovo"],[f,v]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[c,/_/g," "],[h,"Nokia"],[f,y]],[/(pixel c)\b/i],[c,[h,D],[f,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[c,[h,D],[f,y]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[c,[h,L],[f,y]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[c,"Xperia Tablet"],[h,L],[f,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[c,[h,"OnePlus"],[f,y]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[c,[h,E],[f,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[c,/(.+)/g,"Fire Phone $1"],[h,E],[f,y]],[/(playbook);[-\w\),; ]+(rim)/i],[c,h,[f,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[c,[h,A],[f,y]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[c,[h,w],[f,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[c,[h,w],[f,y]],[/(nexus 9)/i],[c,[h,"HTC"],[f,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[h,[c,/_/g," "],[f,y]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[c,[h,"Acer"],[f,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[c,[h,"Meizu"],[f,y]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[c,[h,"Sharp"],[f,y]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,c,[f,y]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,c,[f,v]],[/(surface duo)/i],[c,[h,O],[f,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[c,[h,"Fairphone"],[f,y]],[/(u304aa)/i],[c,[h,"AT&T"],[f,y]],[/\bsie-(\w*)/i],[c,[h,"Siemens"],[f,y]],[/\b(rct\w+) b/i],[c,[h,"RCA"],[f,v]],[/\b(venue[\d ]{2,7}) b/i],[c,[h,"Dell"],[f,v]],[/\b(q(?:mv|ta)\w+) b/i],[c,[h,"Verizon"],[f,v]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[c,[h,"Barnes & Noble"],[f,v]],[/\b(tm\d{3}\w+) b/i],[c,[h,"NuVision"],[f,v]],[/\b(k88) b/i],[c,[h,"ZTE"],[f,v]],[/\b(nx\d{3}j) b/i],[c,[h,"ZTE"],[f,y]],[/\b(gen\d{3}) b.+49h/i],[c,[h,"Swiss"],[f,y]],[/\b(zur\d{3}) b/i],[c,[h,"Swiss"],[f,v]],[/\b((zeki)?tb.*\b) b/i],[c,[h,"Zeki"],[f,v]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],c,[f,v]],[/\b(ns-?\w{0,9}) b/i],[c,[h,"Insignia"],[f,v]],[/\b((nxa|next)-?\w{0,9}) b/i],[c,[h,"NextBook"],[f,v]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],c,[f,y]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],c,[f,y]],[/\b(ph-1) /i],[c,[h,"Essential"],[f,y]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[c,[h,"Envizen"],[f,v]],[/\b(trio[-\w\. ]+) b/i],[c,[h,"MachSpeed"],[f,v]],[/\btu_(1491) b/i],[c,[h,"Rotor"],[f,v]],[/(shield[\w ]+) b/i],[c,[h,"Nvidia"],[f,v]],[/(sprint) (\w+)/i],[h,c,[f,y]],[/(kin\.[onetw]{3})/i],[[c,/\./g," "],[h,O],[f,y]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[c,[h,U],[f,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[c,[h,U],[f,y]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,c,[f,m]],[/droid.+; (shield) bui/i],[c,[h,"Nvidia"],[f,m]],[/(playstation [345portablevi]+)/i],[c,[h,L],[f,m]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[c,[h,O],[f,m]],[/smart-tv.+(samsung)/i],[h,[f,_]],[/hbbtv.+maple;(\d+)/i],[[c,/^/,"SmartTV"],[h,k],[f,_]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,N],[f,_]],[/(apple) ?tv/i],[h,[c,S+" TV"],[f,_]],[/crkey/i],[[c,C+"cast"],[h,D],[f,_]],[/droid.+aft(\w)( bui|\))/i],[c,[h,E],[f,_]],[/\(dtv[\);].+(aquos)/i],[c,[h,"Sharp"],[f,_]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[h,G],[c,G],[f,_]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[f,_]],[/((pebble))app/i],[h,c,[f,T]],[/droid.+; (glass) \d/i],[c,[h,D],[f,T]],[/droid.+; (wt63?0{2,3})\)/i],[c,[h,U],[f,T]],[/(quest( 2)?)/i],[c,[h,B],[f,T]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[f,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[c,[f,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[c,[f,v]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[f,v]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[f,y]],[/(android[-\w\. ]{0,9});.+buil/i],[c,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[d,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[d,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[d,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,d]],os:[[/microsoft (windows) (vista|xp)/i],[d,p],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[d,[p,Y,z]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[d,"Windows"],[p,Y,z]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[d,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[d,"Mac OS"],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[p,d],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[d,p],[/\(bb(10);/i],[p,[d,A]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[d,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[d,R+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[d,"webOS"]],[/crkey\/([\d\.]+)/i],[p,[d,C+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[d,"Chromium OS"],p],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[d,p],[/(sunos) ?([\w\.\d]*)/i],[[d,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[d,p]]},K=function(e,t){if(typeof e===u&&(t=e,e=a),!(this instanceof K))return new K(e,t).getResult();var n=e||(typeof i!==o&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),r=t?function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n}(Z,t):Z;return this.getBrowser=function(){var e,t={};return t[d]=a,t[p]=a,V.call(t,n,r.browser),t.major=typeof(e=t.version)===l?e.replace(/[^\d\.]/g,"").split(".")[0]:a,t},this.getCPU=function(){var e={};return e[g]=a,V.call(e,n,r.cpu),e},this.getDevice=function(){var e={};return e[h]=a,e[c]=a,e[f]=a,V.call(e,n,r.device),e},this.getEngine=function(){var e={};return e[d]=a,e[p]=a,V.call(e,n,r.engine),e},this.getOS=function(){var e={};return e[d]=a,e[p]=a,V.call(e,n,r.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=typeof e===l&&e.length>255?G(e,255):e,this},this.setUA(n),this};K.VERSION="1.0.2",K.BROWSER=j([d,p,"major"]),K.CPU=j([g]),K.DEVICE=j([c,h,f,m,y,_,v,T,b]),K.ENGINE=K.OS=j([d,p]),typeof t!==o?(e.exports&&(t=e.exports=K),t.UAParser=K):n.amdO?(r=function(){return K}.call(t,n,t,e))===a||(e.exports=r):typeof i!==o&&(i.UAParser=K);var W=typeof i!==o&&(i.jQuery||i.Zepto);if(W&&!W.ua){var X=new K;W.ua=X.getResult(),W.ua.get=function(){return X.getUA()},W.ua.set=function(e){X.setUA(e);var t=X.getResult();for(var n in t)W.ua[n]=t[n]}}}("object"==typeof window?window:this)},7839:function(e,t,n){function r(e){try{if(!n.g.localStorage)return!1}catch(e){return!1}var t=n.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}},9862:function(){},964:function(){},3165:function(e){"use strict";e.exports=JSON.parse('["mni-beng-in","mni-mtei-in","sat-deva-in","sat-olck-in","shi-latn-ma","shi-tfng-ma","vai-latn-lr","vai-vaii-lr","yue-hans-cn","yue-hant-hk","az-arab-ir","az-cyrl-az","az-latn-az","bm-nkoo-ml","bs-cyrl-ba","bs-latn-ba","en-dsrt-us","ff-adlm-gn","ff-latn-sn","ha-arab-ng","hi-latn-in","iu-latn-ca","ks-arab-in","ks-deva-in","mn-mong-cn","ms-arab-my","pa-arab-pk","pa-guru-in","sd-arab-pk","sd-deva-in","sr-cyrl-rs","sr-latn-rs","su-latn-id","uz-arab-af","uz-cyrl-uz","uz-latn-uz","zh-hans-cn","zh-hant-tw","mni-beng","sat-olck","shi-tfng","vai-vaii","yue-hant","az-latn","bs-latn","ff-latn","jbo-001","ks-arab","pa-guru","prg-001","sd-arab","sr-cyrl","su-latn","uz-latn","zh-hans","agq-cm","ar-001","arn-cl","asa-tz","ast-es","bas-cm","bem-zm","bez-tz","bgn-pk","blt-vn","brx-in","bss-cm","byn-er","cad-us","cch-ng","ccp-bd","ceb-ph","cgg-ug","chr-us","cic-us","ckb-iq","dav-ke","dje-ne","doi-in","dsb-de","dua-cm","dyo-sn","ebu-ke","eo-001","ewo-cm","fil-ph","fur-it","gaa-gh","gez-et","gsw-ch","guz-ke","haw-us","hsb-de","ia-001","ife-tg","io-001","jgo-cm","jmc-tz","kab-dz","kaj-ng","kam-ke","kcg-ng","kde-tz","kea-cv","ken-cm","khq-ml","kkj-cm","kln-ke","kok-in","kpe-lr","ksb-tz","ksf-cm","ksh-de","lag-tz","lkt-us","lrc-ir","luo-ke","luy-ke","mai-in","mas-ke","mer-ke","mfe-mu","mgh-mz","mgo-cm","moh-ca","mua-cm","mus-us","myv-ru","mzn-ir","naq-na","nds-de","nmg-cm","nnh-cm","nqo-gn","nso-za","nus-ss","nyn-ug","osa-us","pcm-ng","quc-gt","rof-tz","rwk-tz","sah-ru","saq-ke","sbp-tz","scn-it","sdh-ir","seh-mz","ses-ml","sid-et","sma-se","smj-se","smn-fi","sms-fi","ssy-er","syr-iq","szl-pl","teo-ug","tig-er","trv-tw","trw-pk","twq-ne","tzm-ma","vo-001","vun-tz","wae-ch","wal-et","wbp-au","xog-ug","yav-cm","yi-001","zgh-ma","aa-et","af-za","ak-gh","am-et","an-es","as-in","ba-ru","be-by","bg-bg","bm-ml","bn-bd","bo-cn","br-fr","ca-es","ce-ru","co-fr","cs-cz","cu-ru","cv-ru","cy-gb","da-dk","de-de","dv-mv","dz-bt","ee-gh","el-gr","en-us","es-es","et-ee","eu-es","fa-ir","fi-fi","fo-fo","fr-fr","fy-nl","ga-ie","gd-gb","gl-es","gn-py","gu-in","gv-im","ha-ng","he-il","hi-in","hr-hr","hu-hu","hy-am","id-id","ig-ng","ii-cn","is-is","it-it","iu-ca","ja-jp","jv-id","ka-ge","ki-ke","kk-kz","kl-gl","km-kh","kn-in","ko-kr","ku-tr","kw-gb","ky-kg","lb-lu","lg-ug","ln-cd","lo-la","lt-lt","lu-cd","lv-lv","mg-mg","mi-nz","mk-mk","ml-in","mn-mn","mr-in","ms-my","mt-mt","my-mm","nb-no","nd-zw","ne-np","nl-nl","nn-no","nr-za","nv-us","ny-mw","oc-fr","om-et","or-in","os-ge","pl-pl","ps-af","pt-br","qu-pe","rm-ch","rn-bi","ro-ro","ru-ru","rw-rw","sa-in","sc-it","se-no","sg-cf","si-lk","sk-sk","sl-si","sn-zw","so-so","sq-al","ss-za","st-za","sv-se","sw-tz","ta-in","te-in","tg-tj","th-th","ti-et","tk-tm","tn-za","to-to","tr-tr","ts-za","tt-ru","ug-cn","uk-ua","ur-pk","ve-za","vi-vn","wa-be","wo-sn","xh-za","yo-ng","zu-za"]')},5813:function(e){"use strict";e.exports=JSON.parse('[{"from":{"field":"script","value":"qaai"},"to":{"field":"script","value":"zinh"}},{"from":{"field":"region","value":"bu"},"to":{"field":"region","value":"mm"}},{"from":{"field":"region","value":"ct"},"to":{"field":"region","value":"ki"}},{"from":{"field":"region","value":"dd"},"to":{"field":"region","value":"de"}},{"from":{"field":"region","value":"dy"},"to":{"field":"region","value":"bj"}},{"from":{"field":"region","value":"fx"},"to":{"field":"region","value":"fr"}},{"from":{"field":"region","value":"hv"},"to":{"field":"region","value":"bf"}},{"from":{"field":"region","value":"jt"},"to":{"field":"region","value":"um"}},{"from":{"field":"region","value":"mi"},"to":{"field":"region","value":"um"}},{"from":{"field":"region","value":"nh"},"to":{"field":"region","value":"vu"}},{"from":{"field":"region","value":"nq"},"to":{"field":"region","value":"aq"}},{"from":{"field":"region","value":"pu"},"to":{"field":"region","value":"um"}},{"from":{"field":"region","value":"pz"},"to":{"field":"region","value":"pa"}},{"from":{"field":"region","value":"qu"},"to":{"field":"region","value":"eu"}},{"from":{"field":"region","value":"rh"},"to":{"field":"region","value":"zw"}},{"from":{"field":"region","value":"tp"},"to":{"field":"region","value":"tl"}},{"from":{"field":"region","value":"uk"},"to":{"field":"region","value":"gb"}},{"from":{"field":"region","value":"vd"},"to":{"field":"region","value":"vn"}},{"from":{"field":"region","value":"wk"},"to":{"field":"region","value":"um"}},{"from":{"field":"region","value":"yd"},"to":{"field":"region","value":"ye"}},{"from":{"field":"region","value":"zr"},"to":{"field":"region","value":"cd"}},{"from":{"field":"region","value":"230"},"to":{"field":"region","value":"et"}},{"from":{"field":"region","value":"280"},"to":{"field":"region","value":"de"}},{"from":{"field":"region","value":"736"},"to":{"field":"region","value":"sd"}},{"from":{"field":"region","value":"886"},"to":{"field":"region","value":"ye"}},{"from":{"field":"region","value":"958"},"to":{"field":"region","value":"aa"}},{"from":{"field":"region","value":"020"},"to":{"field":"region","value":"ad"}},{"from":{"field":"region","value":"784"},"to":{"field":"region","value":"ae"}},{"from":{"field":"region","value":"004"},"to":{"field":"region","value":"af"}},{"from":{"field":"region","value":"028"},"to":{"field":"region","value":"ag"}},{"from":{"field":"region","value":"660"},"to":{"field":"region","value":"ai"}},{"from":{"field":"region","value":"008"},"to":{"field":"region","value":"al"}},{"from":{"field":"region","value":"051"},"to":{"field":"region","value":"am"}},{"from":{"field":"region","value":"024"},"to":{"field":"region","value":"ao"}},{"from":{"field":"region","value":"010"},"to":{"field":"region","value":"aq"}},{"from":{"field":"region","value":"032"},"to":{"field":"region","value":"ar"}},{"from":{"field":"region","value":"016"},"to":{"field":"region","value":"as"}},{"from":{"field":"region","value":"040"},"to":{"field":"region","value":"at"}},{"from":{"field":"region","value":"036"},"to":{"field":"region","value":"au"}},{"from":{"field":"region","value":"533"},"to":{"field":"region","value":"aw"}},{"from":{"field":"region","value":"248"},"to":{"field":"region","value":"ax"}},{"from":{"field":"region","value":"031"},"to":{"field":"region","value":"az"}},{"from":{"field":"region","value":"070"},"to":{"field":"region","value":"ba"}},{"from":{"field":"region","value":"052"},"to":{"field":"region","value":"bb"}},{"from":{"field":"region","value":"050"},"to":{"field":"region","value":"bd"}},{"from":{"field":"region","value":"056"},"to":{"field":"region","value":"be"}},{"from":{"field":"region","value":"854"},"to":{"field":"region","value":"bf"}},{"from":{"field":"region","value":"100"},"to":{"field":"region","value":"bg"}},{"from":{"field":"region","value":"048"},"to":{"field":"region","value":"bh"}},{"from":{"field":"region","value":"108"},"to":{"field":"region","value":"bi"}},{"from":{"field":"region","value":"204"},"to":{"field":"region","value":"bj"}},{"from":{"field":"region","value":"652"},"to":{"field":"region","value":"bl"}},{"from":{"field":"region","value":"060"},"to":{"field":"region","value":"bm"}},{"from":{"field":"region","value":"096"},"to":{"field":"region","value":"bn"}},{"from":{"field":"region","value":"068"},"to":{"field":"region","value":"bo"}},{"from":{"field":"region","value":"535"},"to":{"field":"region","value":"bq"}},{"from":{"field":"region","value":"076"},"to":{"field":"region","value":"br"}},{"from":{"field":"region","value":"044"},"to":{"field":"region","value":"bs"}},{"from":{"field":"region","value":"064"},"to":{"field":"region","value":"bt"}},{"from":{"field":"region","value":"104"},"to":{"field":"region","value":"mm"}},{"from":{"field":"region","value":"074"},"to":{"field":"region","value":"bv"}},{"from":{"field":"region","value":"072"},"to":{"field":"region","value":"bw"}},{"from":{"field":"region","value":"112"},"to":{"field":"region","value":"by"}},{"from":{"field":"region","value":"084"},"to":{"field":"region","value":"bz"}},{"from":{"field":"region","value":"124"},"to":{"field":"region","value":"ca"}},{"from":{"field":"region","value":"166"},"to":{"field":"region","value":"cc"}},{"from":{"field":"region","value":"180"},"to":{"field":"region","value":"cd"}},{"from":{"field":"region","value":"140"},"to":{"field":"region","value":"cf"}},{"from":{"field":"region","value":"178"},"to":{"field":"region","value":"cg"}},{"from":{"field":"region","value":"756"},"to":{"field":"region","value":"ch"}},{"from":{"field":"region","value":"384"},"to":{"field":"region","value":"ci"}},{"from":{"field":"region","value":"184"},"to":{"field":"region","value":"ck"}},{"from":{"field":"region","value":"152"},"to":{"field":"region","value":"cl"}},{"from":{"field":"region","value":"120"},"to":{"field":"region","value":"cm"}},{"from":{"field":"region","value":"156"},"to":{"field":"region","value":"cn"}},{"from":{"field":"region","value":"170"},"to":{"field":"region","value":"co"}},{"from":{"field":"region","value":"188"},"to":{"field":"region","value":"cr"}},{"from":{"field":"region","value":"192"},"to":{"field":"region","value":"cu"}},{"from":{"field":"region","value":"132"},"to":{"field":"region","value":"cv"}},{"from":{"field":"region","value":"531"},"to":{"field":"region","value":"cw"}},{"from":{"field":"region","value":"162"},"to":{"field":"region","value":"cx"}},{"from":{"field":"region","value":"196"},"to":{"field":"region","value":"cy"}},{"from":{"field":"region","value":"203"},"to":{"field":"region","value":"cz"}},{"from":{"field":"region","value":"278"},"to":{"field":"region","value":"de"}},{"from":{"field":"region","value":"276"},"to":{"field":"region","value":"de"}},{"from":{"field":"region","value":"262"},"to":{"field":"region","value":"dj"}},{"from":{"field":"region","value":"208"},"to":{"field":"region","value":"dk"}},{"from":{"field":"region","value":"212"},"to":{"field":"region","value":"dm"}},{"from":{"field":"region","value":"214"},"to":{"field":"region","value":"do"}},{"from":{"field":"region","value":"012"},"to":{"field":"region","value":"dz"}},{"from":{"field":"region","value":"218"},"to":{"field":"region","value":"ec"}},{"from":{"field":"region","value":"233"},"to":{"field":"region","value":"ee"}},{"from":{"field":"region","value":"818"},"to":{"field":"region","value":"eg"}},{"from":{"field":"region","value":"732"},"to":{"field":"region","value":"eh"}},{"from":{"field":"region","value":"232"},"to":{"field":"region","value":"er"}},{"from":{"field":"region","value":"724"},"to":{"field":"region","value":"es"}},{"from":{"field":"region","value":"231"},"to":{"field":"region","value":"et"}},{"from":{"field":"region","value":"246"},"to":{"field":"region","value":"fi"}},{"from":{"field":"region","value":"242"},"to":{"field":"region","value":"fj"}},{"from":{"field":"region","value":"238"},"to":{"field":"region","value":"fk"}},{"from":{"field":"region","value":"583"},"to":{"field":"region","value":"fm"}},{"from":{"field":"region","value":"234"},"to":{"field":"region","value":"fo"}},{"from":{"field":"region","value":"250"},"to":{"field":"region","value":"fr"}},{"from":{"field":"region","value":"249"},"to":{"field":"region","value":"fr"}},{"from":{"field":"region","value":"266"},"to":{"field":"region","value":"ga"}},{"from":{"field":"region","value":"826"},"to":{"field":"region","value":"gb"}},{"from":{"field":"region","value":"308"},"to":{"field":"region","value":"gd"}},{"from":{"field":"region","value":"268"},"to":{"field":"region","value":"ge"}},{"from":{"field":"region","value":"254"},"to":{"field":"region","value":"gf"}},{"from":{"field":"region","value":"831"},"to":{"field":"region","value":"gg"}},{"from":{"field":"region","value":"288"},"to":{"field":"region","value":"gh"}},{"from":{"field":"region","value":"292"},"to":{"field":"region","value":"gi"}},{"from":{"field":"region","value":"304"},"to":{"field":"region","value":"gl"}},{"from":{"field":"region","value":"270"},"to":{"field":"region","value":"gm"}},{"from":{"field":"region","value":"324"},"to":{"field":"region","value":"gn"}},{"from":{"field":"region","value":"312"},"to":{"field":"region","value":"gp"}},{"from":{"field":"region","value":"226"},"to":{"field":"region","value":"gq"}},{"from":{"field":"region","value":"300"},"to":{"field":"region","value":"gr"}},{"from":{"field":"region","value":"239"},"to":{"field":"region","value":"gs"}},{"from":{"field":"region","value":"320"},"to":{"field":"region","value":"gt"}},{"from":{"field":"region","value":"316"},"to":{"field":"region","value":"gu"}},{"from":{"field":"region","value":"624"},"to":{"field":"region","value":"gw"}},{"from":{"field":"region","value":"328"},"to":{"field":"region","value":"gy"}},{"from":{"field":"region","value":"344"},"to":{"field":"region","value":"hk"}},{"from":{"field":"region","value":"334"},"to":{"field":"region","value":"hm"}},{"from":{"field":"region","value":"340"},"to":{"field":"region","value":"hn"}},{"from":{"field":"region","value":"191"},"to":{"field":"region","value":"hr"}},{"from":{"field":"region","value":"332"},"to":{"field":"region","value":"ht"}},{"from":{"field":"region","value":"348"},"to":{"field":"region","value":"hu"}},{"from":{"field":"region","value":"360"},"to":{"field":"region","value":"id"}},{"from":{"field":"region","value":"372"},"to":{"field":"region","value":"ie"}},{"from":{"field":"region","value":"376"},"to":{"field":"region","value":"il"}},{"from":{"field":"region","value":"833"},"to":{"field":"region","value":"im"}},{"from":{"field":"region","value":"356"},"to":{"field":"region","value":"in"}},{"from":{"field":"region","value":"086"},"to":{"field":"region","value":"io"}},{"from":{"field":"region","value":"368"},"to":{"field":"region","value":"iq"}},{"from":{"field":"region","value":"364"},"to":{"field":"region","value":"ir"}},{"from":{"field":"region","value":"352"},"to":{"field":"region","value":"is"}},{"from":{"field":"region","value":"380"},"to":{"field":"region","value":"it"}},{"from":{"field":"region","value":"832"},"to":{"field":"region","value":"je"}},{"from":{"field":"region","value":"388"},"to":{"field":"region","value":"jm"}},{"from":{"field":"region","value":"400"},"to":{"field":"region","value":"jo"}},{"from":{"field":"region","value":"392"},"to":{"field":"region","value":"jp"}},{"from":{"field":"region","value":"404"},"to":{"field":"region","value":"ke"}},{"from":{"field":"region","value":"417"},"to":{"field":"region","value":"kg"}},{"from":{"field":"region","value":"116"},"to":{"field":"region","value":"kh"}},{"from":{"field":"region","value":"296"},"to":{"field":"region","value":"ki"}},{"from":{"field":"region","value":"174"},"to":{"field":"region","value":"km"}},{"from":{"field":"region","value":"659"},"to":{"field":"region","value":"kn"}},{"from":{"field":"region","value":"408"},"to":{"field":"region","value":"kp"}},{"from":{"field":"region","value":"410"},"to":{"field":"region","value":"kr"}},{"from":{"field":"region","value":"414"},"to":{"field":"region","value":"kw"}},{"from":{"field":"region","value":"136"},"to":{"field":"region","value":"ky"}},{"from":{"field":"region","value":"398"},"to":{"field":"region","value":"kz"}},{"from":{"field":"region","value":"418"},"to":{"field":"region","value":"la"}},{"from":{"field":"region","value":"422"},"to":{"field":"region","value":"lb"}},{"from":{"field":"region","value":"662"},"to":{"field":"region","value":"lc"}},{"from":{"field":"region","value":"438"},"to":{"field":"region","value":"li"}},{"from":{"field":"region","value":"144"},"to":{"field":"region","value":"lk"}},{"from":{"field":"region","value":"430"},"to":{"field":"region","value":"lr"}},{"from":{"field":"region","value":"426"},"to":{"field":"region","value":"ls"}},{"from":{"field":"region","value":"440"},"to":{"field":"region","value":"lt"}},{"from":{"field":"region","value":"442"},"to":{"field":"region","value":"lu"}},{"from":{"field":"region","value":"428"},"to":{"field":"region","value":"lv"}},{"from":{"field":"region","value":"434"},"to":{"field":"region","value":"ly"}},{"from":{"field":"region","value":"504"},"to":{"field":"region","value":"ma"}},{"from":{"field":"region","value":"492"},"to":{"field":"region","value":"mc"}},{"from":{"field":"region","value":"498"},"to":{"field":"region","value":"md"}},{"from":{"field":"region","value":"499"},"to":{"field":"region","value":"me"}},{"from":{"field":"region","value":"663"},"to":{"field":"region","value":"mf"}},{"from":{"field":"region","value":"450"},"to":{"field":"region","value":"mg"}},{"from":{"field":"region","value":"584"},"to":{"field":"region","value":"mh"}},{"from":{"field":"region","value":"807"},"to":{"field":"region","value":"mk"}},{"from":{"field":"region","value":"466"},"to":{"field":"region","value":"ml"}},{"from":{"field":"region","value":"496"},"to":{"field":"region","value":"mn"}},{"from":{"field":"region","value":"446"},"to":{"field":"region","value":"mo"}},{"from":{"field":"region","value":"580"},"to":{"field":"region","value":"mp"}},{"from":{"field":"region","value":"474"},"to":{"field":"region","value":"mq"}},{"from":{"field":"region","value":"478"},"to":{"field":"region","value":"mr"}},{"from":{"field":"region","value":"500"},"to":{"field":"region","value":"ms"}},{"from":{"field":"region","value":"470"},"to":{"field":"region","value":"mt"}},{"from":{"field":"region","value":"480"},"to":{"field":"region","value":"mu"}},{"from":{"field":"region","value":"462"},"to":{"field":"region","value":"mv"}},{"from":{"field":"region","value":"454"},"to":{"field":"region","value":"mw"}},{"from":{"field":"region","value":"484"},"to":{"field":"region","value":"mx"}},{"from":{"field":"region","value":"458"},"to":{"field":"region","value":"my"}},{"from":{"field":"region","value":"508"},"to":{"field":"region","value":"mz"}},{"from":{"field":"region","value":"516"},"to":{"field":"region","value":"na"}},{"from":{"field":"region","value":"540"},"to":{"field":"region","value":"nc"}},{"from":{"field":"region","value":"562"},"to":{"field":"region","value":"ne"}},{"from":{"field":"region","value":"574"},"to":{"field":"region","value":"nf"}},{"from":{"field":"region","value":"566"},"to":{"field":"region","value":"ng"}},{"from":{"field":"region","value":"558"},"to":{"field":"region","value":"ni"}},{"from":{"field":"region","value":"528"},"to":{"field":"region","value":"nl"}},{"from":{"field":"region","value":"578"},"to":{"field":"region","value":"no"}},{"from":{"field":"region","value":"524"},"to":{"field":"region","value":"np"}},{"from":{"field":"region","value":"520"},"to":{"field":"region","value":"nr"}},{"from":{"field":"region","value":"570"},"to":{"field":"region","value":"nu"}},{"from":{"field":"region","value":"554"},"to":{"field":"region","value":"nz"}},{"from":{"field":"region","value":"512"},"to":{"field":"region","value":"om"}},{"from":{"field":"region","value":"591"},"to":{"field":"region","value":"pa"}},{"from":{"field":"region","value":"604"},"to":{"field":"region","value":"pe"}},{"from":{"field":"region","value":"258"},"to":{"field":"region","value":"pf"}},{"from":{"field":"region","value":"598"},"to":{"field":"region","value":"pg"}},{"from":{"field":"region","value":"608"},"to":{"field":"region","value":"ph"}},{"from":{"field":"region","value":"586"},"to":{"field":"region","value":"pk"}},{"from":{"field":"region","value":"616"},"to":{"field":"region","value":"pl"}},{"from":{"field":"region","value":"666"},"to":{"field":"region","value":"pm"}},{"from":{"field":"region","value":"612"},"to":{"field":"region","value":"pn"}},{"from":{"field":"region","value":"630"},"to":{"field":"region","value":"pr"}},{"from":{"field":"region","value":"275"},"to":{"field":"region","value":"ps"}},{"from":{"field":"region","value":"620"},"to":{"field":"region","value":"pt"}},{"from":{"field":"region","value":"585"},"to":{"field":"region","value":"pw"}},{"from":{"field":"region","value":"600"},"to":{"field":"region","value":"py"}},{"from":{"field":"region","value":"634"},"to":{"field":"region","value":"qa"}},{"from":{"field":"region","value":"959"},"to":{"field":"region","value":"qm"}},{"from":{"field":"region","value":"960"},"to":{"field":"region","value":"qn"}},{"from":{"field":"region","value":"962"},"to":{"field":"region","value":"qp"}},{"from":{"field":"region","value":"963"},"to":{"field":"region","value":"qq"}},{"from":{"field":"region","value":"964"},"to":{"field":"region","value":"qr"}},{"from":{"field":"region","value":"965"},"to":{"field":"region","value":"qs"}},{"from":{"field":"region","value":"966"},"to":{"field":"region","value":"qt"}},{"from":{"field":"region","value":"967"},"to":{"field":"region","value":"eu"}},{"from":{"field":"region","value":"968"},"to":{"field":"region","value":"qv"}},{"from":{"field":"region","value":"969"},"to":{"field":"region","value":"qw"}},{"from":{"field":"region","value":"970"},"to":{"field":"region","value":"qx"}},{"from":{"field":"region","value":"971"},"to":{"field":"region","value":"qy"}},{"from":{"field":"region","value":"972"},"to":{"field":"region","value":"qz"}},{"from":{"field":"region","value":"638"},"to":{"field":"region","value":"re"}},{"from":{"field":"region","value":"642"},"to":{"field":"region","value":"ro"}},{"from":{"field":"region","value":"688"},"to":{"field":"region","value":"rs"}},{"from":{"field":"region","value":"643"},"to":{"field":"region","value":"ru"}},{"from":{"field":"region","value":"646"},"to":{"field":"region","value":"rw"}},{"from":{"field":"region","value":"682"},"to":{"field":"region","value":"sa"}},{"from":{"field":"region","value":"090"},"to":{"field":"region","value":"sb"}},{"from":{"field":"region","value":"690"},"to":{"field":"region","value":"sc"}},{"from":{"field":"region","value":"729"},"to":{"field":"region","value":"sd"}},{"from":{"field":"region","value":"752"},"to":{"field":"region","value":"se"}},{"from":{"field":"region","value":"702"},"to":{"field":"region","value":"sg"}},{"from":{"field":"region","value":"654"},"to":{"field":"region","value":"sh"}},{"from":{"field":"region","value":"705"},"to":{"field":"region","value":"si"}},{"from":{"field":"region","value":"744"},"to":{"field":"region","value":"sj"}},{"from":{"field":"region","value":"703"},"to":{"field":"region","value":"sk"}},{"from":{"field":"region","value":"694"},"to":{"field":"region","value":"sl"}},{"from":{"field":"region","value":"674"},"to":{"field":"region","value":"sm"}},{"from":{"field":"region","value":"686"},"to":{"field":"region","value":"sn"}},{"from":{"field":"region","value":"706"},"to":{"field":"region","value":"so"}},{"from":{"field":"region","value":"740"},"to":{"field":"region","value":"sr"}},{"from":{"field":"region","value":"728"},"to":{"field":"region","value":"ss"}},{"from":{"field":"region","value":"678"},"to":{"field":"region","value":"st"}},{"from":{"field":"region","value":"222"},"to":{"field":"region","value":"sv"}},{"from":{"field":"region","value":"534"},"to":{"field":"region","value":"sx"}},{"from":{"field":"region","value":"760"},"to":{"field":"region","value":"sy"}},{"from":{"field":"region","value":"748"},"to":{"field":"region","value":"sz"}},{"from":{"field":"region","value":"796"},"to":{"field":"region","value":"tc"}},{"from":{"field":"region","value":"148"},"to":{"field":"region","value":"td"}},{"from":{"field":"region","value":"260"},"to":{"field":"region","value":"tf"}},{"from":{"field":"region","value":"768"},"to":{"field":"region","value":"tg"}},{"from":{"field":"region","value":"764"},"to":{"field":"region","value":"th"}},{"from":{"field":"region","value":"762"},"to":{"field":"region","value":"tj"}},{"from":{"field":"region","value":"772"},"to":{"field":"region","value":"tk"}},{"from":{"field":"region","value":"626"},"to":{"field":"region","value":"tl"}},{"from":{"field":"region","value":"795"},"to":{"field":"region","value":"tm"}},{"from":{"field":"region","value":"788"},"to":{"field":"region","value":"tn"}},{"from":{"field":"region","value":"776"},"to":{"field":"region","value":"to"}},{"from":{"field":"region","value":"792"},"to":{"field":"region","value":"tr"}},{"from":{"field":"region","value":"780"},"to":{"field":"region","value":"tt"}},{"from":{"field":"region","value":"798"},"to":{"field":"region","value":"tv"}},{"from":{"field":"region","value":"158"},"to":{"field":"region","value":"tw"}},{"from":{"field":"region","value":"834"},"to":{"field":"region","value":"tz"}},{"from":{"field":"region","value":"804"},"to":{"field":"region","value":"ua"}},{"from":{"field":"region","value":"800"},"to":{"field":"region","value":"ug"}},{"from":{"field":"region","value":"581"},"to":{"field":"region","value":"um"}},{"from":{"field":"region","value":"840"},"to":{"field":"region","value":"us"}},{"from":{"field":"region","value":"858"},"to":{"field":"region","value":"uy"}},{"from":{"field":"region","value":"860"},"to":{"field":"region","value":"uz"}},{"from":{"field":"region","value":"336"},"to":{"field":"region","value":"va"}},{"from":{"field":"region","value":"670"},"to":{"field":"region","value":"vc"}},{"from":{"field":"region","value":"862"},"to":{"field":"region","value":"ve"}},{"from":{"field":"region","value":"092"},"to":{"field":"region","value":"vg"}},{"from":{"field":"region","value":"850"},"to":{"field":"region","value":"vi"}},{"from":{"field":"region","value":"704"},"to":{"field":"region","value":"vn"}},{"from":{"field":"region","value":"548"},"to":{"field":"region","value":"vu"}},{"from":{"field":"region","value":"876"},"to":{"field":"region","value":"wf"}},{"from":{"field":"region","value":"882"},"to":{"field":"region","value":"ws"}},{"from":{"field":"region","value":"973"},"to":{"field":"region","value":"xa"}},{"from":{"field":"region","value":"974"},"to":{"field":"region","value":"xb"}},{"from":{"field":"region","value":"975"},"to":{"field":"region","value":"xc"}},{"from":{"field":"region","value":"976"},"to":{"field":"region","value":"xd"}},{"from":{"field":"region","value":"977"},"to":{"field":"region","value":"xe"}},{"from":{"field":"region","value":"978"},"to":{"field":"region","value":"xf"}},{"from":{"field":"region","value":"979"},"to":{"field":"region","value":"xg"}},{"from":{"field":"region","value":"980"},"to":{"field":"region","value":"xh"}},{"from":{"field":"region","value":"981"},"to":{"field":"region","value":"xi"}},{"from":{"field":"region","value":"982"},"to":{"field":"region","value":"xj"}},{"from":{"field":"region","value":"983"},"to":{"field":"region","value":"xk"}},{"from":{"field":"region","value":"984"},"to":{"field":"region","value":"xl"}},{"from":{"field":"region","value":"985"},"to":{"field":"region","value":"xm"}},{"from":{"field":"region","value":"986"},"to":{"field":"region","value":"xn"}},{"from":{"field":"region","value":"987"},"to":{"field":"region","value":"xo"}},{"from":{"field":"region","value":"988"},"to":{"field":"region","value":"xp"}},{"from":{"field":"region","value":"989"},"to":{"field":"region","value":"xq"}},{"from":{"field":"region","value":"990"},"to":{"field":"region","value":"xr"}},{"from":{"field":"region","value":"991"},"to":{"field":"region","value":"xs"}},{"from":{"field":"region","value":"992"},"to":{"field":"region","value":"xt"}},{"from":{"field":"region","value":"993"},"to":{"field":"region","value":"xu"}},{"from":{"field":"region","value":"994"},"to":{"field":"region","value":"xv"}},{"from":{"field":"region","value":"995"},"to":{"field":"region","value":"xw"}},{"from":{"field":"region","value":"996"},"to":{"field":"region","value":"xx"}},{"from":{"field":"region","value":"997"},"to":{"field":"region","value":"xy"}},{"from":{"field":"region","value":"998"},"to":{"field":"region","value":"xz"}},{"from":{"field":"region","value":"720"},"to":{"field":"region","value":"ye"}},{"from":{"field":"region","value":"887"},"to":{"field":"region","value":"ye"}},{"from":{"field":"region","value":"175"},"to":{"field":"region","value":"yt"}},{"from":{"field":"region","value":"710"},"to":{"field":"region","value":"za"}},{"from":{"field":"region","value":"894"},"to":{"field":"region","value":"zm"}},{"from":{"field":"region","value":"716"},"to":{"field":"region","value":"zw"}},{"from":{"field":"region","value":"999"},"to":{"field":"region","value":"zz"}},{"from":{"field":"variants","value":"aaland"},"to":{"field":"region","value":"ax"}},{"from":{"field":"variants","value":"polytoni"},"to":{"field":"variants","value":"polyton"}},{"from":{"field":"variants","value":"heploc"},"to":{"field":"variants","value":"alalc97"}},{"from":{"field":"variants","value":"arevela"},"to":{"field":"language","value":"hy"}},{"from":{"field":"variants","value":"arevmda"},"to":{"field":"language","value":"hyw"}}]')},9460:function(e){"use strict";e.exports=JSON.parse('{"region":{"172":["ru","am","az","by","ge","kg","kz","md","tj","tm","ua","uz"],"200":["cz","sk"],"530":["cw","sx","bq"],"532":["cw","sx","bq"],"536":["sa","iq"],"582":["fm","mh","mp","pw"],"810":["ru","am","az","by","ee","ge","kz","kg","lv","lt","md","tj","tm","ua","uz"],"830":["je","gg"],"890":["rs","me","si","hr","mk","ba"],"891":["rs","me"],"an":["cw","sx","bq"],"cs":["rs","me"],"fq":["aq","tf"],"nt":["sa","iq"],"pc":["fm","mh","mp","pw"],"su":["ru","am","az","by","ee","ge","kz","kg","lv","lt","md","tj","tm","ua","uz"],"yu":["rs","me"],"062":["034","143"],"ant":["cw","sx","bq"],"scg":["rs","me"],"ntz":["sa","iq"],"sun":["ru","am","az","by","ee","ge","kz","kg","lv","lt","md","tj","tm","ua","uz"],"yug":["rs","me"]}}')},7778:function(e){"use strict";e.exports=JSON.parse('[{"from":"in","to":"id"},{"from":"iw","to":"he"},{"from":"ji","to":"yi"},{"from":"jw","to":"jv"},{"from":"mo","to":"ro"},{"from":"scc","to":"sr"},{"from":"scr","to":"hr"},{"from":"aam","to":"aas"},{"from":"adp","to":"dz"},{"from":"aue","to":"ktz"},{"from":"ayx","to":"nun"},{"from":"bgm","to":"bcg"},{"from":"bjd","to":"drl"},{"from":"ccq","to":"rki"},{"from":"cjr","to":"mom"},{"from":"cka","to":"cmr"},{"from":"cmk","to":"xch"},{"from":"coy","to":"pij"},{"from":"cqu","to":"quh"},{"from":"drh","to":"mn"},{"from":"drw","to":"fa-af"},{"from":"gav","to":"dev"},{"from":"gfx","to":"vaj"},{"from":"ggn","to":"gvr"},{"from":"gti","to":"nyc"},{"from":"guv","to":"duz"},{"from":"hrr","to":"jal"},{"from":"ibi","to":"opa"},{"from":"ilw","to":"gal"},{"from":"jeg","to":"oyb"},{"from":"kgc","to":"tdf"},{"from":"kgh","to":"kml"},{"from":"koj","to":"kwv"},{"from":"krm","to":"bmf"},{"from":"ktr","to":"dtp"},{"from":"kvs","to":"gdj"},{"from":"kwq","to":"yam"},{"from":"kxe","to":"tvd"},{"from":"kzj","to":"dtp"},{"from":"kzt","to":"dtp"},{"from":"lii","to":"raq"},{"from":"lmm","to":"rmx"},{"from":"meg","to":"cir"},{"from":"mst","to":"mry"},{"from":"mwj","to":"vaj"},{"from":"myt","to":"mry"},{"from":"nad","to":"xny"},{"from":"ncp","to":"kdz"},{"from":"nnx","to":"ngv"},{"from":"nts","to":"pij"},{"from":"oun","to":"vaj"},{"from":"pcr","to":"adx"},{"from":"pmc","to":"huw"},{"from":"pmu","to":"phr"},{"from":"ppa","to":"bfy"},{"from":"ppr","to":"lcq"},{"from":"pry","to":"prt"},{"from":"puz","to":"pub"},{"from":"sca","to":"hle"},{"from":"skk","to":"oyb"},{"from":"tdu","to":"dtp"},{"from":"thc","to":"tpo"},{"from":"thx","to":"oyb"},{"from":"tie","to":"ras"},{"from":"tkk","to":"twm"},{"from":"tlw","to":"weo"},{"from":"tmp","to":"tyj"},{"from":"tne","to":"kak"},{"from":"tnf","to":"fa-af"},{"from":"tsf","to":"taj"},{"from":"uok","to":"ema"},{"from":"xba","to":"cax"},{"from":"xia","to":"acn"},{"from":"xkh","to":"waw"},{"from":"xsj","to":"suj"},{"from":"ybd","to":"rki"},{"from":"yma","to":"lrr"},{"from":"ymt","to":"mtm"},{"from":"yos","to":"zom"},{"from":"yuu","to":"yug"},{"from":"asd","to":"snz"},{"from":"dit","to":"dif"},{"from":"llo","to":"ngt"},{"from":"myd","to":"aog"},{"from":"nns","to":"nbr"},{"from":"sgn-br","to":"bzs"},{"from":"sgn-co","to":"csn"},{"from":"sgn-de","to":"gsg"},{"from":"sgn-dk","to":"dsl"},{"from":"sgn-fr","to":"fsl"},{"from":"sgn-gb","to":"bfi"},{"from":"sgn-gr","to":"gss"},{"from":"sgn-ie","to":"isg"},{"from":"sgn-it","to":"ise"},{"from":"sgn-jp","to":"jsl"},{"from":"sgn-mx","to":"mfs"},{"from":"sgn-ni","to":"ncs"},{"from":"sgn-nl","to":"dse"},{"from":"sgn-no","to":"nsi"},{"from":"sgn-pt","to":"psr"},{"from":"sgn-se","to":"swl"},{"from":"sgn-us","to":"ase"},{"from":"sgn-za","to":"sfs"},{"from":"no-bokmal","to":"nb"},{"from":"no-nynorsk","to":"nn"},{"from":"aa-saaho","to":"ssy"},{"from":"sh","to":"sr-latn"},{"from":"cnr","to":"sr-me"},{"from":"no","to":"nb"},{"from":"tl","to":"fil"},{"from":"az-az","to":"az-latn-az"},{"from":"bs-ba","to":"bs-latn-ba"},{"from":"ha-latn-gh","to":"ha-gh"},{"from":"ha-latn-ne","to":"ha-ne"},{"from":"ha-latn-ng","to":"ha-ng"},{"from":"kk-cyrl-kz","to":"kk-kz"},{"from":"ky-cyrl-kg","to":"ky-kg"},{"from":"ks-arab-in","to":"ks-in"},{"from":"mn-cyrl-mn","to":"mn-mn"},{"from":"ms-latn-bn","to":"ms-bn"},{"from":"ms-latn-my","to":"ms-my"},{"from":"ms-latn-sg","to":"ms-sg"},{"from":"pa-in","to":"pa-guru-in"},{"from":"pa-pk","to":"pa-arab-pk"},{"from":"shi-ma","to":"shi-tfng-ma"},{"from":"sr-ba","to":"sr-cyrl-ba"},{"from":"sr-me","to":"sr-latn-me"},{"from":"sr-rs","to":"sr-cyrl-rs"},{"from":"sr-xk","to":"sr-cyrl-xk"},{"from":"tzm-latn-ma","to":"tzm-ma"},{"from":"ug-arab-cn","to":"ug-cn"},{"from":"uz-af","to":"uz-arab-af"},{"from":"uz-uz","to":"uz-latn-uz"},{"from":"vai-lr","to":"vai-vaii-lr"},{"from":"yue-cn","to":"yue-hans-cn"},{"from":"yue-hk","to":"yue-hant-hk"},{"from":"zh-cn","to":"zh-hans-cn"},{"from":"zh-hk","to":"zh-hant-hk"},{"from":"zh-mo","to":"zh-hant-mo"},{"from":"zh-sg","to":"zh-hans-sg"},{"from":"zh-tw","to":"zh-hant-tw"},{"from":"aju","to":"jrb"},{"from":"als","to":"sq"},{"from":"arb","to":"ar"},{"from":"ayr","to":"ay"},{"from":"azj","to":"az"},{"from":"bcc","to":"bal"},{"from":"bcl","to":"bik"},{"from":"bxk","to":"luy"},{"from":"bxr","to":"bua"},{"from":"cld","to":"syr"},{"from":"cmn","to":"zh"},{"from":"cwd","to":"cr"},{"from":"dgo","to":"doi"},{"from":"dhd","to":"mwr"},{"from":"dik","to":"din"},{"from":"diq","to":"zza"},{"from":"lbk","to":"bnc"},{"from":"ekk","to":"et"},{"from":"emk","to":"man"},{"from":"esk","to":"ik"},{"from":"fat","to":"ak"},{"from":"fuc","to":"ff"},{"from":"gaz","to":"om"},{"from":"gbo","to":"grb"},{"from":"gno","to":"gon"},{"from":"gug","to":"gn"},{"from":"gya","to":"gba"},{"from":"hdn","to":"hai"},{"from":"hea","to":"hmn"},{"from":"ike","to":"iu"},{"from":"kmr","to":"ku"},{"from":"knc","to":"kr"},{"from":"kng","to":"kg"},{"from":"knn","to":"kok"},{"from":"kpv","to":"kv"},{"from":"lvs","to":"lv"},{"from":"mhr","to":"chm"},{"from":"mup","to":"raj"},{"from":"khk","to":"mn"},{"from":"npi","to":"ne"},{"from":"ojg","to":"oj"},{"from":"ory","to":"or"},{"from":"pbu","to":"ps"},{"from":"pes","to":"fa"},{"from":"plt","to":"mg"},{"from":"pnb","to":"lah"},{"from":"quz","to":"qu"},{"from":"rmy","to":"rom"},{"from":"spy","to":"kln"},{"from":"src","to":"sc"},{"from":"swh","to":"sw"},{"from":"ttq","to":"tmh"},{"from":"tw","to":"ak"},{"from":"umu","to":"del"},{"from":"uzn","to":"uz"},{"from":"xpe","to":"kpe"},{"from":"xsl","to":"den"},{"from":"ydd","to":"yi"},{"from":"zai","to":"zap"},{"from":"zsm","to":"ms"},{"from":"zyb","to":"za"},{"from":"him","to":"srx"},{"from":"mnk","to":"man"},{"from":"bh","to":"bho"},{"from":"prs","to":"fa-af"},{"from":"swc","to":"sw-cd"},{"from":"aar","to":"aa"},{"from":"abk","to":"ab"},{"from":"ave","to":"ae"},{"from":"afr","to":"af"},{"from":"aka","to":"ak"},{"from":"amh","to":"am"},{"from":"arg","to":"an"},{"from":"ara","to":"ar"},{"from":"asm","to":"as"},{"from":"ava","to":"av"},{"from":"aym","to":"ay"},{"from":"aze","to":"az"},{"from":"bak","to":"ba"},{"from":"bel","to":"be"},{"from":"bul","to":"bg"},{"from":"bih","to":"bho"},{"from":"bis","to":"bi"},{"from":"bam","to":"bm"},{"from":"ben","to":"bn"},{"from":"bod","to":"bo"},{"from":"bre","to":"br"},{"from":"bos","to":"bs"},{"from":"cat","to":"ca"},{"from":"che","to":"ce"},{"from":"cha","to":"ch"},{"from":"cos","to":"co"},{"from":"cre","to":"cr"},{"from":"ces","to":"cs"},{"from":"chu","to":"cu"},{"from":"chv","to":"cv"},{"from":"cym","to":"cy"},{"from":"dan","to":"da"},{"from":"deu","to":"de"},{"from":"div","to":"dv"},{"from":"dzo","to":"dz"},{"from":"ewe","to":"ee"},{"from":"ell","to":"el"},{"from":"eng","to":"en"},{"from":"epo","to":"eo"},{"from":"spa","to":"es"},{"from":"est","to":"et"},{"from":"eus","to":"eu"},{"from":"fas","to":"fa"},{"from":"ful","to":"ff"},{"from":"fin","to":"fi"},{"from":"fij","to":"fj"},{"from":"fao","to":"fo"},{"from":"fra","to":"fr"},{"from":"fry","to":"fy"},{"from":"gle","to":"ga"},{"from":"gla","to":"gd"},{"from":"glg","to":"gl"},{"from":"grn","to":"gn"},{"from":"guj","to":"gu"},{"from":"glv","to":"gv"},{"from":"hau","to":"ha"},{"from":"heb","to":"he"},{"from":"hin","to":"hi"},{"from":"hmo","to":"ho"},{"from":"hrv","to":"hr"},{"from":"hat","to":"ht"},{"from":"hun","to":"hu"},{"from":"hye","to":"hy"},{"from":"her","to":"hz"},{"from":"ina","to":"ia"},{"from":"ind","to":"id"},{"from":"ile","to":"ie"},{"from":"ibo","to":"ig"},{"from":"iii","to":"ii"},{"from":"ipk","to":"ik"},{"from":"ido","to":"io"},{"from":"isl","to":"is"},{"from":"ita","to":"it"},{"from":"iku","to":"iu"},{"from":"jpn","to":"ja"},{"from":"jav","to":"jv"},{"from":"kat","to":"ka"},{"from":"kon","to":"kg"},{"from":"kik","to":"ki"},{"from":"kua","to":"kj"},{"from":"kaz","to":"kk"},{"from":"kal","to":"kl"},{"from":"khm","to":"km"},{"from":"kan","to":"kn"},{"from":"kor","to":"ko"},{"from":"kau","to":"kr"},{"from":"kas","to":"ks"},{"from":"kur","to":"ku"},{"from":"kom","to":"kv"},{"from":"cor","to":"kw"},{"from":"kir","to":"ky"},{"from":"lat","to":"la"},{"from":"ltz","to":"lb"},{"from":"lug","to":"lg"},{"from":"lim","to":"li"},{"from":"lin","to":"ln"},{"from":"lao","to":"lo"},{"from":"lit","to":"lt"},{"from":"lub","to":"lu"},{"from":"lav","to":"lv"},{"from":"mlg","to":"mg"},{"from":"mah","to":"mh"},{"from":"mri","to":"mi"},{"from":"mkd","to":"mk"},{"from":"mal","to":"ml"},{"from":"mon","to":"mn"},{"from":"mol","to":"ro"},{"from":"mar","to":"mr"},{"from":"msa","to":"ms"},{"from":"mlt","to":"mt"},{"from":"mya","to":"my"},{"from":"nau","to":"na"},{"from":"nob","to":"nb"},{"from":"nde","to":"nd"},{"from":"nep","to":"ne"},{"from":"ndo","to":"ng"},{"from":"nld","to":"nl"},{"from":"nno","to":"nn"},{"from":"nor","to":"nb"},{"from":"nbl","to":"nr"},{"from":"nav","to":"nv"},{"from":"nya","to":"ny"},{"from":"oci","to":"oc"},{"from":"oji","to":"oj"},{"from":"orm","to":"om"},{"from":"ori","to":"or"},{"from":"oss","to":"os"},{"from":"pan","to":"pa"},{"from":"pli","to":"pi"},{"from":"pol","to":"pl"},{"from":"pus","to":"ps"},{"from":"por","to":"pt"},{"from":"que","to":"qu"},{"from":"roh","to":"rm"},{"from":"run","to":"rn"},{"from":"ron","to":"ro"},{"from":"rus","to":"ru"},{"from":"kin","to":"rw"},{"from":"san","to":"sa"},{"from":"srd","to":"sc"},{"from":"snd","to":"sd"},{"from":"sme","to":"se"},{"from":"sag","to":"sg"},{"from":"hbs","to":"sr-latn"},{"from":"sin","to":"si"},{"from":"slk","to":"sk"},{"from":"slv","to":"sl"},{"from":"smo","to":"sm"},{"from":"sna","to":"sn"},{"from":"som","to":"so"},{"from":"sqi","to":"sq"},{"from":"srp","to":"sr"},{"from":"ssw","to":"ss"},{"from":"sot","to":"st"},{"from":"sun","to":"su"},{"from":"swe","to":"sv"},{"from":"swa","to":"sw"},{"from":"tam","to":"ta"},{"from":"tel","to":"te"},{"from":"tgk","to":"tg"},{"from":"tha","to":"th"},{"from":"tir","to":"ti"},{"from":"tuk","to":"tk"},{"from":"tgl","to":"fil"},{"from":"tsn","to":"tn"},{"from":"ton","to":"to"},{"from":"tur","to":"tr"},{"from":"tso","to":"ts"},{"from":"tat","to":"tt"},{"from":"twi","to":"ak"},{"from":"tah","to":"ty"},{"from":"uig","to":"ug"},{"from":"ukr","to":"uk"},{"from":"urd","to":"ur"},{"from":"uzb","to":"uz"},{"from":"ven","to":"ve"},{"from":"vie","to":"vi"},{"from":"vol","to":"vo"},{"from":"wln","to":"wa"},{"from":"wol","to":"wo"},{"from":"xho","to":"xh"},{"from":"yid","to":"yi"},{"from":"yor","to":"yo"},{"from":"zha","to":"za"},{"from":"zho","to":"zh"},{"from":"zul","to":"zu"},{"from":"alb","to":"sq"},{"from":"arm","to":"hy"},{"from":"baq","to":"eu"},{"from":"bur","to":"my"},{"from":"chi","to":"zh"},{"from":"cze","to":"cs"},{"from":"dut","to":"nl"},{"from":"fre","to":"fr"},{"from":"geo","to":"ka"},{"from":"ger","to":"de"},{"from":"gre","to":"el"},{"from":"ice","to":"is"},{"from":"mac","to":"mk"},{"from":"mao","to":"mi"},{"from":"may","to":"ms"},{"from":"per","to":"fa"},{"from":"rum","to":"ro"},{"from":"slo","to":"sk"},{"from":"tib","to":"bo"},{"from":"wel","to":"cy"}]')},8589:function(e){"use strict";e.exports=JSON.parse('{"en-gb-oed":"en-GB-oxendict","i-ami":"ami","i-bnn":"bnn","i-default":null,"i-enochian":null,"i-hak":"hak","i-klingon":"tlh","i-lux":"lb","i-mingo":null,"i-navajo":"nv","i-pwn":"pwn","i-tao":"tao","i-tay":"tay","i-tsu":"tsu","sgn-be-fr":"sfb","sgn-be-nl":"vgt","sgn-ch-de":"sgg","art-lojban":"jbo","cel-gaulish":null,"no-bok":"nb","no-nyn":"nn","zh-guoyu":"cmn","zh-hakka":"hak","zh-min":null,"zh-min-nan":"nan","zh-xiang":"hsn"}')},858:function(e){"use strict";e.exports=JSON.parse('["art-lojban","cel-gaulish","no-bok","no-nyn","zh-guoyu","zh-hakka","zh-min","zh-min-nan","zh-xiang"]')}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,n),a.exports}n.amdO={},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var r={};return function(){"use strict";n.d(r,{default:function(){return c}}),n(8416);var e,t=n(1715),i=n(8080),a=n(1737),s=n(7688),o=function(){var e,t="application/dash+xml";function n(n,r,i){if(!n||!/^VIDEO$/i.test(n.nodeName))return null;if(n._dashjs_player)return n._dashjs_player;var a,o=n.id||n.name||"video element";if(!(r=r||[].slice.call(n.querySelectorAll("source")).filter((function(e){return e.type==t}))[0])&&n.src)(r=document.createElement("source")).src=n.src;else if(!r&&!n.src)return null;return i=i||{},(a=(0,s.Z)(i).create()).initialize(n,r.src,n.autoplay),e||(e=a.getDebug().getLogger()),e.debug("Converted "+o+" to dash.js player and added content: "+r.src),n._dashjs_player=a,a}function r(e){return/^VIDEO$/i.test(e.nodeName)?e:r(e.parentNode)}return{create:n,createAll:function(e,i){var a=[];e=e||"[data-dashjs-player]";for(var s=(i=i||document).querySelectorAll(e),o=0;o<s.length;o++){var u=n(s[o],null);a.push(u)}for(var l=i.querySelectorAll('source[type="'+t+'"]'),c=0;c<l.length;c++){var d=n(r(l[c]),null);a.push(d)}return a}}}();!("undefined"!=typeof window&&window&&window.dashjs&&window.dashjs.skipAutoCreate)&&"undefined"!=typeof window&&window&&window.addEventListener&&("complete"===window.document.readyState?window.dashjs?o.createAll():e=window.setInterval((function(){window.dashjs&&(window.clearInterval(e),o.createAll())}),500):window.addEventListener("load",(function e(){window.removeEventListener("load",e),o.createAll()})));var u=o,l=n(6398);dashjs.Protection=a.default,dashjs.MetricsReporting=i.default,dashjs.MediaPlayerFactory=u,dashjs.Debug=l.Z,dashjs.supportsMediaSource=t.B;var c=dashjs}(),r.default}()},7484:function(e){e.exports=function(){"use strict";var e=6e4,t=36e5,n="millisecond",r="second",i="minute",a="hour",s="day",o="week",u="month",l="quarter",c="year",d="date",f="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},m=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},y={s:m,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,u),a=n-i<0,s=t.clone().add(r+(a?-1:1),u);return+(-(r+(n-i)/(a?i-s:s-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:u,y:c,w:o,d:s,D:d,h:a,m:i,s:r,ms:n,Q:l}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},v="en",_={};_[v]=g;var T="$isDayjsObject",b=function(e){return e instanceof A||!(!e||!e[T])},E=function e(t,n,r){var i;if(!t)return v;if("string"==typeof t){var a=t.toLowerCase();_[a]&&(i=a),n&&(_[a]=n,i=a);var s=t.split("-");if(!i&&s.length>1)return e(s[0])}else{var o=t.name;_[o]=t,i=o}return!r&&i&&(v=i),i||!r&&v},S=function(e,t){if(b(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new A(n)},w=y;w.l=E,w.i=b,w.w=function(e,t){return S(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var A=function(){function g(e){this.$L=E(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[T]=!0}var m=g.prototype;return m.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(w.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(h);if(r){var i=r[2]-1||0,a=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},m.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},m.$utils=function(){return w},m.isValid=function(){return!(this.$d.toString()===f)},m.isSame=function(e,t){var n=S(e);return this.startOf(t)<=n&&n<=this.endOf(t)},m.isAfter=function(e,t){return S(e)<this.startOf(t)},m.isBefore=function(e,t){return this.endOf(t)<S(e)},m.$g=function(e,t,n){return w.u(e)?this[t]:this.set(n,e)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(e,t){var n=this,l=!!w.u(t)||t,f=w.p(e),h=function(e,t){var r=w.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return l?r:r.endOf(s)},p=function(e,t){return w.w(n.toDate()[e].apply(n.toDate("s"),(l?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},g=this.$W,m=this.$M,y=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case c:return l?h(1,0):h(31,11);case u:return l?h(1,m):h(0,m+1);case o:var _=this.$locale().weekStart||0,T=(g<_?g+7:g)-_;return h(l?y-T:y+(6-T),m);case s:case d:return p(v+"Hours",0);case a:return p(v+"Minutes",1);case i:return p(v+"Seconds",2);case r:return p(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(e){return this.startOf(e,!1)},m.$set=function(e,t){var o,l=w.p(e),f="set"+(this.$u?"UTC":""),h=(o={},o[s]=f+"Date",o[d]=f+"Date",o[u]=f+"Month",o[c]=f+"FullYear",o[a]=f+"Hours",o[i]=f+"Minutes",o[r]=f+"Seconds",o[n]=f+"Milliseconds",o)[l],p=l===s?this.$D+(t-this.$W):t;if(l===u||l===c){var g=this.clone().set(d,1);g.$d[h](p),g.init(),this.$d=g.set(d,Math.min(this.$D,g.daysInMonth())).$d}else h&&this.$d[h](p);return this.init(),this},m.set=function(e,t){return this.clone().$set(e,t)},m.get=function(e){return this[w.p(e)]()},m.add=function(n,l){var d,f=this;n=Number(n);var h=w.p(l),p=function(e){var t=S(f);return w.w(t.date(t.date()+Math.round(e*n)),f)};if(h===u)return this.set(u,this.$M+n);if(h===c)return this.set(c,this.$y+n);if(h===s)return p(1);if(h===o)return p(7);var g=(d={},d[i]=e,d[a]=t,d[r]=1e3,d)[h]||1,m=this.$d.getTime()+n*g;return w.w(m,this)},m.subtract=function(e,t){return this.add(-1*e,t)},m.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||f;var r=e||"YYYY-MM-DDTHH:mm:ssZ",i=w.z(this),a=this.$H,s=this.$m,o=this.$M,u=n.weekdays,l=n.months,c=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},h=function(e){return w.s(a%12||12,e,"0")},g=c||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(p,(function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return w.s(t.$y,4,"0");case"M":return o+1;case"MM":return w.s(o+1,2,"0");case"MMM":return d(n.monthsShort,o,l,3);case"MMMM":return d(l,o);case"D":return t.$D;case"DD":return w.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(n.weekdaysMin,t.$W,u,2);case"ddd":return d(n.weekdaysShort,t.$W,u,3);case"dddd":return u[t.$W];case"H":return String(a);case"HH":return w.s(a,2,"0");case"h":return h(1);case"hh":return h(2);case"a":return g(a,s,!0);case"A":return g(a,s,!1);case"m":return String(s);case"mm":return w.s(s,2,"0");case"s":return String(t.$s);case"ss":return w.s(t.$s,2,"0");case"SSS":return w.s(t.$ms,3,"0");case"Z":return i}return null}(e)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(n,d,f){var h,p=this,g=w.p(d),m=S(n),y=(m.utcOffset()-this.utcOffset())*e,v=this-m,_=function(){return w.m(p,m)};switch(g){case c:h=_()/12;break;case u:h=_();break;case l:h=_()/3;break;case o:h=(v-y)/6048e5;break;case s:h=(v-y)/864e5;break;case a:h=v/t;break;case i:h=v/e;break;case r:h=v/1e3;break;default:h=v}return f?h:w.a(h)},m.daysInMonth=function(){return this.endOf(u).$D},m.$locale=function(){return _[this.$L]},m.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=E(e,t,!0);return r&&(n.$L=r),n},m.clone=function(){return w.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},g}(),I=A.prototype;return S.prototype=I,[["$ms",n],["$s",r],["$m",i],["$H",a],["$W",s],["$M",u],["$y",c],["$D",d]].forEach((function(e){I[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),S.extend=function(e,t){return e.$i||(e(t,A,S),e.$i=!0),S},S.locale=E,S.isDayjs=b,S.unix=function(e){return S(1e3*e)},S.en=_[v],S.Ls=_,S.p={},S}()},9144:(e,t,n)=>{var r,i=void 0!==n.g?n.g:"undefined"!=typeof window?window:{},a=n(5893);"undefined"!=typeof document?r=document:(r=i["__GLOBAL_DOCUMENT_CACHE@4"])||(r=i["__GLOBAL_DOCUMENT_CACHE@4"]=a),e.exports=r},8908:(e,t,n)=>{var r;r="undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},e.exports=r},7376:e=>{e.exports=function(e){if(!e)return!1;var n=t.call(e);return"[object Function]"===n||"function"==typeof e&&"[object RegExp]"!==n||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var t=Object.prototype.toString},5592:(e,t,n)=>{var r,i,a;!function(s){"use strict";i=[n(9755)],void 0===(a="function"==typeof(r=function(e){return e.ui=e.ui||{},e.ui.version="1.13.2"})?r.apply(t,i):r)||(e.exports=a)}()},6891:(e,t,n)=>{var r,i,a;!function(s){"use strict";i=[n(9755),n(5592)],r=function(e){var t,n=0,r=Array.prototype.hasOwnProperty,i=Array.prototype.slice;return e.cleanData=(t=e.cleanData,function(n){var r,i,a;for(a=0;null!=(i=n[a]);a++)(r=e._data(i,"events"))&&r.remove&&e(i).triggerHandler("remove");t(n)}),e.widget=function(t,n,r){var i,a,s,o={},u=t.split(".")[0],l=u+"-"+(t=t.split(".")[1]);return r||(r=n,n=e.Widget),Array.isArray(r)&&(r=e.extend.apply(null,[{}].concat(r))),e.expr.pseudos[l.toLowerCase()]=function(t){return!!e.data(t,l)},e[u]=e[u]||{},i=e[u][t],a=e[u][t]=function(e,t){if(!this||!this._createWidget)return new a(e,t);arguments.length&&this._createWidget(e,t)},e.extend(a,i,{version:r.version,_proto:e.extend({},r),_childConstructors:[]}),(s=new n).options=e.widget.extend({},s.options),e.each(r,(function(e,t){o[e]="function"==typeof t?function(){function r(){return n.prototype[e].apply(this,arguments)}function i(t){return n.prototype[e].apply(this,t)}return function(){var e,n=this._super,a=this._superApply;return this._super=r,this._superApply=i,e=t.apply(this,arguments),this._super=n,this._superApply=a,e}}():t})),a.prototype=e.widget.extend(s,{widgetEventPrefix:i&&s.widgetEventPrefix||t},o,{constructor:a,namespace:u,widgetName:t,widgetFullName:l}),i?(e.each(i._childConstructors,(function(t,n){var r=n.prototype;e.widget(r.namespace+"."+r.widgetName,a,n._proto)})),delete i._childConstructors):n._childConstructors.push(a),e.widget.bridge(t,a),a},e.widget.extend=function(t){for(var n,a,s=i.call(arguments,1),o=0,u=s.length;o<u;o++)for(n in s[o])a=s[o][n],r.call(s[o],n)&&void 0!==a&&(e.isPlainObject(a)?t[n]=e.isPlainObject(t[n])?e.widget.extend({},t[n],a):e.widget.extend({},a):t[n]=a);return t},e.widget.bridge=function(t,n){var r=n.prototype.widgetFullName||t;e.fn[t]=function(a){var s="string"==typeof a,o=i.call(arguments,1),u=this;return s?this.length||"instance"!==a?this.each((function(){var n,i=e.data(this,r);return"instance"===a?(u=i,!1):i?"function"!=typeof i[a]||"_"===a.charAt(0)?e.error("no such method '"+a+"' for "+t+" widget instance"):(n=i[a].apply(i,o))!==i&&void 0!==n?(u=n&&n.jquery?u.pushStack(n.get()):n,!1):void 0:e.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+a+"'")})):u=void 0:(o.length&&(a=e.widget.extend.apply(null,[a].concat(o))),this.each((function(){var t=e.data(this,r);t?(t.option(a||{}),t._init&&t._init()):e.data(this,r,new n(a,this))}))),u}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,r){r=e(r||this.defaultElement||this)[0],this.element=e(r),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),this.classesElementLookup={},r!==this&&(e.data(r,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===r&&this.destroy()}}),this.document=e(r.style?r.ownerDocument:r.document||r),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){var t=this;this._destroy(),e.each(this.classesElementLookup,(function(e,n){t._removeClass(n,e)})),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:e.noop,widget:function(){return this.element},option:function(t,n){var r,i,a,s=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(s={},r=t.split("."),t=r.shift(),r.length){for(i=s[t]=e.widget.extend({},this.options[t]),a=0;a<r.length-1;a++)i[r[a]]=i[r[a]]||{},i=i[r[a]];if(t=r.pop(),1===arguments.length)return void 0===i[t]?null:i[t];i[t]=n}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];s[t]=n}return this._setOptions(s),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return"classes"===e&&this._setOptionClasses(t),this.options[e]=t,"disabled"===e&&this._setOptionDisabled(t),this},_setOptionClasses:function(t){var n,r,i;for(n in t)i=this.classesElementLookup[n],t[n]!==this.options.classes[n]&&i&&i.length&&(r=e(i.get()),this._removeClass(i,n),r.addClass(this._classes({element:r,keys:n,classes:t,add:!0})))},_setOptionDisabled:function(e){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!e),e&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(t){var n=[],r=this;function i(){var n=[];t.element.each((function(t,i){e.map(r.classesElementLookup,(function(e){return e})).some((function(e){return e.is(i)}))||n.push(i)})),r._on(e(n),{remove:"_untrackClassesElement"})}function a(a,s){var o,u;for(u=0;u<a.length;u++)o=r.classesElementLookup[a[u]]||e(),t.add?(i(),o=e(e.uniqueSort(o.get().concat(t.element.get())))):o=e(o.not(t.element).get()),r.classesElementLookup[a[u]]=o,n.push(a[u]),s&&t.classes[a[u]]&&n.push(t.classes[a[u]])}return(t=e.extend({element:this.element,classes:this.options.classes||{}},t)).keys&&a(t.keys.match(/\S+/g)||[],!0),t.extra&&a(t.extra.match(/\S+/g)||[]),n.join(" ")},_untrackClassesElement:function(t){var n=this;e.each(n.classesElementLookup,(function(r,i){-1!==e.inArray(t.target,i)&&(n.classesElementLookup[r]=e(i.not(t.target).get()))})),this._off(e(t.target))},_removeClass:function(e,t,n){return this._toggleClass(e,t,n,!1)},_addClass:function(e,t,n){return this._toggleClass(e,t,n,!0)},_toggleClass:function(e,t,n,r){r="boolean"==typeof r?r:n;var i="string"==typeof e||null===e,a={extra:i?t:n,keys:i?e:t,element:i?this.element:e,add:r};return a.element.toggleClass(this._classes(a),r),this},_on:function(t,n,r){var i,a=this;"boolean"!=typeof t&&(r=n,n=t,t=!1),r?(n=i=e(n),this.bindings=this.bindings.add(n)):(r=n,n=this.element,i=this.widget()),e.each(r,(function(r,s){function o(){if(t||!0!==a.options.disabled&&!e(this).hasClass("ui-state-disabled"))return("string"==typeof s?a[s]:s).apply(a,arguments)}"string"!=typeof s&&(o.guid=s.guid=s.guid||o.guid||e.guid++);var u=r.match(/^([\w:-]*)\s*(.*)$/),l=u[1]+a.eventNamespace,c=u[2];c?i.on(l,c,o):n.on(l,o)}))},_off:function(t,n){n=(n||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(n),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){var n=this;return setTimeout((function(){return("string"==typeof e?n[e]:e).apply(n,arguments)}),t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(e(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(e(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,n,r){var i,a,s=this.options[t];if(r=r||{},(n=e.Event(n)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],a=n.originalEvent)for(i in a)i in n||(n[i]=a[i]);return this.element.trigger(n,r),!("function"==typeof s&&!1===s.apply(this.element[0],[n].concat(r))||n.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},(function(t,n){e.Widget.prototype["_"+t]=function(r,i,a){var s;"string"==typeof i&&(i={effect:i});var o=i?!0===i||"number"==typeof i?n:i.effect||n:t;"number"==typeof(i=i||{})?i={duration:i}:!0===i&&(i={}),s=!e.isEmptyObject(i),i.complete=a,i.delay&&r.delay(i.delay),s&&e.effects&&e.effects.effect[o]?r[t](i):o!==t&&r[o]?r[o](i.duration,i.easing,a):r.queue((function(n){e(this)[t](),a&&a.call(r[0]),n()}))}})),e.widget},void 0===(a=r.apply(t,i))||(e.exports=a)}()},9459:(e,t,n)=>{var r=n(9755);!function(e,t,n,r){var i=n("html"),a=n(e),s=n(t),o=n.fancybox=function(){o.open.apply(this,arguments)},u=navigator.userAgent.match(/msie/i),l=null,c=t.createTouch!==r,d=function(e){return e&&e.hasOwnProperty&&e instanceof n},f=function(e){return e&&"string"===n.type(e)},h=function(e){return f(e)&&0<e.indexOf("%")},p=function(e,t){var n=parseInt(e,10)||0;return t&&h(e)&&(n*=o.getViewport()[t]/100),Math.ceil(n)},g=function(e,t){return p(e,t)+"px"};n.extend(o,{version:"2.1.5",defaults:{padding:15,margin:20,width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,pixelRatio:1,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!c,fitToView:!0,aspectRatio:!1,topRatio:.5,leftRatio:.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3e3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+(u?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:n.noop,beforeLoad:n.noop,afterLoad:n.noop,beforeShow:n.noop,afterShow:n.noop,beforeChange:n.noop,beforeClose:n.noop,afterClose:n.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(e,t){if(e&&(n.isPlainObject(t)||(t={}),!1!==o.close(!0)))return n.isArray(e)||(e=d(e)?n(e).get():[e]),n.each(e,(function(i,a){var s,u,l,c,h,p={};"object"===n.type(a)&&(a.nodeType&&(a=n(a)),d(a)?(p={href:a.data("fancybox-href")||a.attr("href"),title:n("<div/>").text(a.data("fancybox-title")||a.attr("title")).html(),isDom:!0,element:a},n.metadata&&n.extend(!0,p,a.metadata())):p=a),s=t.href||p.href||(f(a)?a:null),u=t.title!==r?t.title:p.title||"",!(c=(l=t.content||p.content)?"html":t.type||p.type)&&p.isDom&&((c=a.data("fancybox-type"))||(c=(c=a.prop("class").match(/fancybox\.(\w+)/))?c[1]:null)),f(s)&&(c||(o.isImage(s)?c="image":o.isSWF(s)?c="swf":"#"===s.charAt(0)?c="inline":f(a)&&(c="html",l=a)),"ajax"===c&&(h=s.split(/\s+/,2),s=h.shift(),h=h.shift())),l||("inline"===c?s?l=n(f(s)?s.replace(/.*(?=#[^\s]+$)/,""):s):p.isDom&&(l=a):"html"===c?l=s:c||s||!p.isDom||(c="inline",l=a)),n.extend(p,{href:s,type:c,content:l,title:u,selector:h}),e[i]=p})),o.opts=n.extend(!0,{},o.defaults,t),t.keys!==r&&(o.opts.keys=!!t.keys&&n.extend({},o.defaults.keys,t.keys)),o.group=e,o._start(o.opts.index)},cancel:function(){var e=o.coming;e&&!1===o.trigger("onCancel")||(o.hideLoading(),e&&(o.ajaxLoad&&o.ajaxLoad.abort(),o.ajaxLoad=null,o.imgPreload&&(o.imgPreload.onload=o.imgPreload.onerror=null),e.wrap&&e.wrap.stop(!0,!0).trigger("onReset").remove(),o.coming=null,o.current||o._afterZoomOut(e)))},close:function(e){o.cancel(),!1!==o.trigger("beforeClose")&&(o.unbindEvents(),o.isActive&&(o.isOpen&&!0!==e?(o.isOpen=o.isOpened=!1,o.isClosing=!0,n(".fancybox-item, .fancybox-nav").remove(),o.wrap.stop(!0,!0).removeClass("fancybox-opened"),o.transitions[o.current.closeMethod]()):(n(".fancybox-wrap").stop(!0).trigger("onReset").remove(),o._afterZoomOut())))},play:function(e){var t=function(){clearTimeout(o.player.timer)},n=function(){t(),o.current&&o.player.isActive&&(o.player.timer=setTimeout(o.next,o.current.playSpeed))},r=function(){t(),s.unbind(".player"),o.player.isActive=!1,o.trigger("onPlayEnd")};!0===e||!o.player.isActive&&!1!==e?o.current&&(o.current.loop||o.current.index<o.group.length-1)&&(o.player.isActive=!0,s.bind({"onCancel.player beforeClose.player":r,"onUpdate.player":n,"beforeLoad.player":t}),n(),o.trigger("onPlayStart")):r()},next:function(e){var t=o.current;t&&(f(e)||(e=t.direction.next),o.jumpto(t.index+1,e,"next"))},prev:function(e){var t=o.current;t&&(f(e)||(e=t.direction.prev),o.jumpto(t.index-1,e,"prev"))},jumpto:function(e,t,n){var i=o.current;i&&(e=p(e),o.direction=t||i.direction[e>=i.index?"next":"prev"],o.router=n||"jumpto",i.loop&&(0>e&&(e=i.group.length+e%i.group.length),e%=i.group.length),i.group[e]!==r&&(o.cancel(),o._start(e)))},reposition:function(e,t){var r,i=o.current,a=i?i.wrap:null;a&&(r=o._getPosition(t),e&&"scroll"===e.type?(delete r.position,a.stop(!0,!0).animate(r,200)):(a.css(r),i.pos=n.extend({},i.dim,r)))},update:function(e){var t=e&&e.originalEvent&&e.originalEvent.type,n=!t||"orientationchange"===t;n&&(clearTimeout(l),l=null),o.isOpen&&!l&&(l=setTimeout((function(){var r=o.current;r&&!o.isClosing&&(o.wrap.removeClass("fancybox-tmp"),(n||"load"===t||"resize"===t&&r.autoResize)&&o._setDimension(),"scroll"===t&&r.canShrink||o.reposition(e),o.trigger("onUpdate"),l=null)}),n&&!c?0:300))},toggle:function(e){o.isOpen&&(o.current.fitToView="boolean"===n.type(e)?e:!o.current.fitToView,c&&(o.wrap.removeAttr("style").addClass("fancybox-tmp"),o.trigger("onUpdate")),o.update())},hideLoading:function(){s.unbind(".loading"),n("#fancybox-loading").remove()},showLoading:function(){var e,t;o.hideLoading(),e=n('<div id="fancybox-loading"><div></div></div>').click(o.cancel).appendTo("body"),s.bind("keydown.loading",(function(e){27===(e.which||e.keyCode)&&(e.preventDefault(),o.cancel())})),o.defaults.fixed||(t=o.getViewport(),e.css({position:"absolute",top:.5*t.h+t.y,left:.5*t.w+t.x})),o.trigger("onLoading")},getViewport:function(){var t=o.current&&o.current.locked||!1,n={x:a.scrollLeft(),y:a.scrollTop()};return t&&t.length?(n.w=t[0].clientWidth,n.h=t[0].clientHeight):(n.w=c&&e.innerWidth?e.innerWidth:a.width(),n.h=c&&e.innerHeight?e.innerHeight:a.height()),n},unbindEvents:function(){o.wrap&&d(o.wrap)&&o.wrap.unbind(".fb"),s.unbind(".fb"),a.unbind(".fb")},bindEvents:function(){var e,t=o.current;t&&(a.bind("orientationchange.fb"+(c?"":" resize.fb")+(t.autoCenter&&!t.locked?" scroll.fb":""),o.update),(e=t.keys)&&s.bind("keydown.fb",(function(i){var a=i.which||i.keyCode,s=i.target||i.srcElement;if(27===a&&o.coming)return!1;i.ctrlKey||i.altKey||i.shiftKey||i.metaKey||s&&(s.type||n(s).is("[contenteditable]"))||n.each(e,(function(e,s){return 1<t.group.length&&s[a]!==r?(o[e](s[a]),i.preventDefault(),!1):-1<n.inArray(a,s)?(o[e](),i.preventDefault(),!1):void 0}))})),n.fn.mousewheel&&t.mouseWheel&&o.wrap.bind("mousewheel.fb",(function(e,r,i,a){for(var s=n(e.target||null),u=!1;s.length&&!(u||s.is(".fancybox-skin")||s.is(".fancybox-wrap"));)u=s[0]&&!(s[0].style.overflow&&"hidden"===s[0].style.overflow)&&(s[0].clientWidth&&s[0].scrollWidth>s[0].clientWidth||s[0].clientHeight&&s[0].scrollHeight>s[0].clientHeight),s=n(s).parent();0!==r&&!u&&1<o.group.length&&!t.canShrink&&(0<a||0<i?o.prev(0<a?"down":"left"):(0>a||0>i)&&o.next(0>a?"up":"right"),e.preventDefault())})))},trigger:function(e,t){var r,i=t||o.coming||o.current;if(i){if(n.isFunction(i[e])&&(r=i[e].apply(i,Array.prototype.slice.call(arguments,1))),!1===r)return!1;i.helpers&&n.each(i.helpers,(function(t,r){r&&o.helpers[t]&&n.isFunction(o.helpers[t][e])&&o.helpers[t][e](n.extend(!0,{},o.helpers[t].defaults,r),i)}))}s.trigger(e)},isImage:function(e){return f(e)&&e.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(e){return f(e)&&e.match(/\.(swf)((\?|#).*)?$/i)},_start:function(e){var t,r,i={};if(e=p(e),!(t=o.group[e]||null))return!1;if(t=(i=n.extend(!0,{},o.opts,t)).margin,r=i.padding,"number"===n.type(t)&&(i.margin=[t,t,t,t]),"number"===n.type(r)&&(i.padding=[r,r,r,r]),i.modal&&n.extend(!0,i,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}}),i.autoSize&&(i.autoWidth=i.autoHeight=!0),"auto"===i.width&&(i.autoWidth=!0),"auto"===i.height&&(i.autoHeight=!0),i.group=o.group,i.index=e,o.coming=i,!1===o.trigger("beforeLoad"))o.coming=null;else{if(r=i.type,t=i.href,!r)return o.coming=null,!(!o.current||!o.router||"jumpto"===o.router)&&(o.current.index=e,o[o.router](o.direction));if(o.isActive=!0,"image"!==r&&"swf"!==r||(i.autoHeight=i.autoWidth=!1,i.scrolling="visible"),"image"===r&&(i.aspectRatio=!0),"iframe"===r&&c&&(i.scrolling="scroll"),i.wrap=n(i.tpl.wrap).addClass("fancybox-"+(c?"mobile":"desktop")+" fancybox-type-"+r+" fancybox-tmp "+i.wrapCSS).appendTo(i.parent||"body"),n.extend(i,{skin:n(".fancybox-skin",i.wrap),outer:n(".fancybox-outer",i.wrap),inner:n(".fancybox-inner",i.wrap)}),n.each(["Top","Right","Bottom","Left"],(function(e,t){i.skin.css("padding"+t,g(i.padding[e]))})),o.trigger("onReady"),"inline"===r||"html"===r){if(!i.content||!i.content.length)return o._error("content")}else if(!t)return o._error("href");"image"===r?o._loadImage():"ajax"===r?o._loadAjax():"iframe"===r?o._loadIframe():o._afterLoad()}},_error:function(e){n.extend(o.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:e,content:o.coming.tpl.error}),o._afterLoad()},_loadImage:function(){var e=o.imgPreload=new Image;e.onload=function(){this.onload=this.onerror=null,o.coming.width=this.width/o.opts.pixelRatio,o.coming.height=this.height/o.opts.pixelRatio,o._afterLoad()},e.onerror=function(){this.onload=this.onerror=null,o._error("image")},e.src=o.coming.href,!0!==e.complete&&o.showLoading()},_loadAjax:function(){var e=o.coming;o.showLoading(),o.ajaxLoad=n.ajax(n.extend({},e.ajax,{url:e.href,error:function(e,t){o.coming&&"abort"!==t?o._error("ajax",e):o.hideLoading()},success:function(t,n){"success"===n&&(e.content=t,o._afterLoad())}}))},_loadIframe:function(){var e=o.coming,t=n(e.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",c?"auto":e.iframe.scrolling).attr("src",e.href);n(e.wrap).bind("onReset",(function(){try{n(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(e){}})),e.iframe.preload&&(o.showLoading(),t.one("load",(function(){n(this).data("ready",1),c||n(this).bind("load.fb",o.update),n(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show(),o._afterLoad()}))),e.content=t.appendTo(e.inner),e.iframe.preload||o._afterLoad()},_preloadImages:function(){var e,t,n=o.group,r=o.current,i=n.length,a=r.preload?Math.min(r.preload,i-1):0;for(t=1;t<=a;t+=1)"image"===(e=n[(r.index+t)%i]).type&&e.href&&((new Image).src=e.href)},_afterLoad:function(){var e,t,r,i,a,s=o.coming,u=o.current;if(o.hideLoading(),s&&!1!==o.isActive)if(!1===o.trigger("afterLoad",s,u))s.wrap.stop(!0).trigger("onReset").remove(),o.coming=null;else{switch(u&&(o.trigger("beforeChange",u),u.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove()),o.unbindEvents(),e=s.content,t=s.type,r=s.scrolling,n.extend(o,{wrap:s.wrap,skin:s.skin,outer:s.outer,inner:s.inner,current:s,previous:u}),i=s.href,t){case"inline":case"ajax":case"html":s.selector?e=n("<div>").html(e).find(s.selector):d(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",n('<div class="fancybox-placeholder"></div>').insertAfter(e).hide()),e=e.show().detach(),s.wrap.bind("onReset",(function(){n(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",!1)})));break;case"image":e=s.tpl.image.replace(/\{href\}/g,i);break;case"swf":e='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+i+'"></param>',a="",n.each(s.swf,(function(t,n){e+='<param name="'+t+'" value="'+n+'"></param>',a+=" "+t+'="'+n+'"'})),e+='<embed src="'+i+'" type="application/x-shockwave-flash" width="100%" height="100%"'+a+"></embed></object>"}d(e)&&e.parent().is(s.inner)||s.inner.append(e),o.trigger("beforeShow"),s.inner.css("overflow","yes"===r?"scroll":"no"===r?"hidden":r),o._setDimension(),o.reposition(),o.isOpen=!1,o.coming=null,o.bindEvents(),o.isOpened?u.prevMethod&&o.transitions[u.prevMethod]():n(".fancybox-wrap").not(s.wrap).stop(!0).trigger("onReset").remove(),o.transitions[o.isOpened?s.nextMethod:s.openMethod](),o._preloadImages()}},_setDimension:function(){var e,t,r,i,a,s,u,l,c,d=o.getViewport(),f=0,m=!1,y=!1,v=(m=o.wrap,o.skin),_=o.inner,T=o.current,b=(y=T.width,T.height),E=T.minWidth,S=T.minHeight,w=T.maxWidth,A=T.maxHeight,I=T.scrolling,C=T.scrollOutside?T.scrollbarWidth:0,R=T.margin,D=p(R[1]+R[3]),x=p(R[0]+R[2]);if(m.add(v).add(_).width("auto").height("auto").removeClass("fancybox-tmp"),t=D+(R=p(v.outerWidth(!0)-v.width())),r=x+(e=p(v.outerHeight(!0)-v.height())),i=h(y)?(d.w-t)*p(y)/100:y,a=h(b)?(d.h-r)*p(b)/100:b,"iframe"===T.type){if(c=T.content,T.autoHeight&&1===c.data("ready"))try{c[0].contentWindow.document.location&&(_.width(i).height(9999),s=c.contents().find("body"),C&&s.css("overflow-x","hidden"),a=s.outerHeight(!0))}catch(e){}}else(T.autoWidth||T.autoHeight)&&(_.addClass("fancybox-tmp"),T.autoWidth||_.width(i),T.autoHeight||_.height(a),T.autoWidth&&(i=_.width()),T.autoHeight&&(a=_.height()),_.removeClass("fancybox-tmp"));if(y=p(i),b=p(a),l=i/a,E=p(h(E)?p(E,"w")-t:E),w=p(h(w)?p(w,"w")-t:w),S=p(h(S)?p(S,"h")-r:S),s=w,u=A=p(h(A)?p(A,"h")-r:A),T.fitToView&&(w=Math.min(d.w-t,w),A=Math.min(d.h-r,A)),t=d.w-D,x=d.h-x,T.aspectRatio?(y>w&&(b=p((y=w)/l)),b>A&&(y=p((b=A)*l)),y<E&&(b=p((y=E)/l)),b<S&&(y=p((b=S)*l))):(y=Math.max(E,Math.min(y,w)),T.autoHeight&&"iframe"!==T.type&&(_.width(y),b=_.height()),b=Math.max(S,Math.min(b,A))),T.fitToView)if(_.width(y).height(b),m.width(y+R),d=m.width(),D=m.height(),T.aspectRatio)for(;(d>t||D>x)&&y>E&&b>S&&!(19<f++);)b=Math.max(S,Math.min(A,b-10)),(y=p(b*l))<E&&(b=p((y=E)/l)),y>w&&(b=p((y=w)/l)),_.width(y).height(b),m.width(y+R),d=m.width(),D=m.height();else y=Math.max(E,Math.min(y,y-(d-t))),b=Math.max(S,Math.min(b,b-(D-x)));C&&"auto"===I&&b<a&&y+R+C<t&&(y+=C),_.width(y).height(b),m.width(y+R),d=m.width(),D=m.height(),m=(d>t||D>x)&&y>E&&b>S,y=T.aspectRatio?y<s&&b<u&&y<i&&b<a:(y<s||b<u)&&(y<i||b<a),n.extend(T,{dim:{width:g(d),height:g(D)},origWidth:i,origHeight:a,canShrink:m,canExpand:y,wPadding:R,hPadding:e,wrapSpace:D-v.outerHeight(!0),skinSpace:v.height()-b}),!c&&T.autoHeight&&b>S&&b<A&&!y&&_.height("auto")},_getPosition:function(e){var t=o.current,n=o.getViewport(),r=t.margin,i=o.wrap.width()+r[1]+r[3],a=o.wrap.height()+r[0]+r[2];return r={position:"absolute",top:r[0],left:r[3]},t.autoCenter&&t.fixed&&!e&&a<=n.h&&i<=n.w?r.position="fixed":t.locked||(r.top+=n.y,r.left+=n.x),r.top=g(Math.max(r.top,r.top+(n.h-a)*t.topRatio)),r.left=g(Math.max(r.left,r.left+(n.w-i)*t.leftRatio)),r},_afterZoomIn:function(){var e=o.current;e&&(o.isOpen=o.isOpened=!0,o.wrap.css("overflow","visible").addClass("fancybox-opened"),o.update(),(e.closeClick||e.nextClick&&1<o.group.length)&&o.inner.css("cursor","pointer").bind("click.fb",(function(t){n(t.target).is("a")||n(t.target).parent().is("a")||(t.preventDefault(),o[e.closeClick?"close":"next"]())})),e.closeBtn&&n(e.tpl.closeBtn).appendTo(o.skin).bind("click.fb",(function(e){e.preventDefault(),o.close()})),e.arrows&&1<o.group.length&&((e.loop||0<e.index)&&n(e.tpl.prev).appendTo(o.outer).bind("click.fb",o.prev),(e.loop||e.index<o.group.length-1)&&n(e.tpl.next).appendTo(o.outer).bind("click.fb",o.next)),o.trigger("afterShow"),e.loop||e.index!==e.group.length-1?o.opts.autoPlay&&!o.player.isActive&&(o.opts.autoPlay=!1,o.play(!0)):o.play(!1))},_afterZoomOut:function(e){e=e||o.current,n(".fancybox-wrap").trigger("onReset").remove(),n.extend(o,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null}),o.trigger("afterClose",e)}}),o.transitions={getOrigPosition:function(){var e=o.current,t=e.element,n=e.orig,r={},i=50,a=50,s=e.hPadding,u=e.wPadding,l=o.getViewport();return!n&&e.isDom&&t.is(":visible")&&((n=t.find("img:first")).length||(n=t)),d(n)?(r=n.offset(),n.is("img")&&(i=n.outerWidth(),a=n.outerHeight())):(r.top=l.y+(l.h-a)*e.topRatio,r.left=l.x+(l.w-i)*e.leftRatio),("fixed"===o.wrap.css("position")||e.locked)&&(r.top-=l.y,r.left-=l.x),{top:g(r.top-s*e.topRatio),left:g(r.left-u*e.leftRatio),width:g(i+u),height:g(a+s)}},step:function(e,t){var n,r,i=t.prop,a=(r=o.current).wrapSpace,s=r.skinSpace;"width"!==i&&"height"!==i||(n=t.end===t.start?1:(e-t.start)/(t.end-t.start),o.isClosing&&(n=1-n),r=e-(r="width"===i?r.wPadding:r.hPadding),o.skin[i](p("width"===i?r:r-a*n)),o.inner[i](p("width"===i?r:r-a*n-s*n)))},zoomIn:function(){var e=o.current,t=e.pos,r=e.openEffect,i="elastic"===r,a=n.extend({opacity:1},t);delete a.position,i?(t=this.getOrigPosition(),e.openOpacity&&(t.opacity=.1)):"fade"===r&&(t.opacity=.1),o.wrap.css(t).animate(a,{duration:"none"===r?0:e.openSpeed,easing:e.openEasing,step:i?this.step:null,complete:o._afterZoomIn})},zoomOut:function(){var e=o.current,t=e.closeEffect,n="elastic"===t,r={opacity:.1};n&&(r=this.getOrigPosition(),e.closeOpacity&&(r.opacity=.1)),o.wrap.animate(r,{duration:"none"===t?0:e.closeSpeed,easing:e.closeEasing,step:n?this.step:null,complete:o._afterZoomOut})},changeIn:function(){var e,t=o.current,n=t.nextEffect,r=t.pos,i={opacity:1},a=o.direction;r.opacity=.1,"elastic"===n&&(e="down"===a||"up"===a?"top":"left","down"===a||"right"===a?(r[e]=g(p(r[e])-200),i[e]="+=200px"):(r[e]=g(p(r[e])+200),i[e]="-=200px")),"none"===n?o._afterZoomIn():o.wrap.css(r).animate(i,{duration:t.nextSpeed,easing:t.nextEasing,complete:o._afterZoomIn})},changeOut:function(){var e=o.previous,t=e.prevEffect,r={opacity:.1},i=o.direction;"elastic"===t&&(r["down"===i||"up"===i?"top":"left"]=("up"===i||"left"===i?"-":"+")+"=200px"),e.wrap.animate(r,{duration:"none"===t?0:e.prevSpeed,easing:e.prevEasing,complete:function(){n(this).trigger("onReset").remove()}})}},o.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!c,fixed:!0},overlay:null,fixed:!1,el:n("html"),create:function(e){var t;e=n.extend({},this.defaults,e),this.overlay&&this.close(),t=o.coming?o.coming.parent:e.parent,this.overlay=n('<div class="fancybox-overlay"></div>').appendTo(t&&t.lenth?t:"body"),this.fixed=!1,e.fixed&&o.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(e){var t=this;e=n.extend({},this.defaults,e),this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(e),this.fixed||(a.bind("resize.overlay",n.proxy(this.update,this)),this.update()),e.closeClick&&this.overlay.bind("click.overlay",(function(e){if(n(e.target).hasClass("fancybox-overlay"))return o.isActive?o.close():t.close(),!1})),this.overlay.css(e.css).show()},close:function(){a.unbind("resize.overlay"),this.el.hasClass("fancybox-lock")&&(n(".fancybox-margin").removeClass("fancybox-margin"),this.el.removeClass("fancybox-lock"),a.scrollTop(this.scrollV).scrollLeft(this.scrollH)),n(".fancybox-overlay").remove().hide(),n.extend(this,{overlay:null,fixed:!1})},update:function(){var e,n="100%";this.overlay.width(n).height("100%"),u?(e=Math.max(t.documentElement.offsetWidth,t.body.offsetWidth),s.width()>e&&(n=s.width())):s.width()>a.width()&&(n=s.width()),this.overlay.width(n).height(s.height())},onReady:function(e,t){var r=this.overlay;n(".fancybox-overlay").stop(!0,!0),r||this.create(e),e.locked&&this.fixed&&t.fixed&&(t.locked=this.overlay.append(t.wrap),t.fixed=!1),!0===e.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(e,t){t.locked&&!this.el.hasClass("fancybox-lock")&&(!1!==this.fixPosition&&n("*").filter((function(){return"fixed"===n(this).css("position")&&!n(this).hasClass("fancybox-overlay")&&!n(this).hasClass("fancybox-wrap")})).addClass("fancybox-margin"),this.el.addClass("fancybox-margin"),this.scrollV=a.scrollTop(),this.scrollH=a.scrollLeft(),this.el.addClass("fancybox-lock"),a.scrollTop(this.scrollV).scrollLeft(this.scrollH)),this.open(e)},onUpdate:function(){this.fixed||this.update()},afterClose:function(e){this.overlay&&!o.coming&&this.overlay.fadeOut(e.speedOut,n.proxy(this.close,this))}},o.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(e){var t=o.current,r=t.title,i=e.type;if(n.isFunction(r)&&(r=r.call(t.element,t)),f(r)&&""!==n.trim(r)){switch(t=n('<div class="fancybox-title fancybox-title-'+i+'-wrap">'+r+"</div>"),i){case"inside":i=o.skin;break;case"outside":i=o.wrap;break;case"over":i=o.inner;break;default:i=o.skin,t.appendTo("body"),u&&t.width(t.width()),t.wrapInner('<span class="child"></span>'),o.current.margin[2]+=Math.abs(p(t.css("margin-bottom")))}t["top"===e.position?"prependTo":"appendTo"](i)}}},n.fn.fancybox=function(e){var t,r=n(this),i=this.selector||"",a=function(a){var s,u,l=n(this).blur(),c=t;a.ctrlKey||a.altKey||a.shiftKey||a.metaKey||l.is(".fancybox-wrap")||(s=e.groupAttr||"data-fancybox-group",(u=l.attr(s))||(s="rel",u=l.get(0)[s]),u&&""!==u&&"nofollow"!==u&&(c=(l=(l=i.length?n(i):r).filter("["+s+'="'+u+'"]')).index(this)),e.index=c,!1!==o.open(l,e)&&a.preventDefault())};return t=(e=e||{}).index||0,i&&!1!==e.live?s.undelegate(i,"click.fb-start").delegate(i+":not('.fancybox-item, .fancybox-nav')","click.fb-start",a):r.unbind("click.fb-start").bind("click.fb-start",a),this.filter("[data-fancybox-start=1]").trigger("click"),this},s.ready((function(){var t,a;n.scrollbarWidth===r&&(n.scrollbarWidth=function(){var e=n('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),t=(t=e.children()).innerWidth()-t.height(99).innerWidth();return e.remove(),t}),n.support.fixedPosition===r&&(n.support.fixedPosition=function(){var e=n('<div style="position:fixed;top:20px;"></div>').appendTo("body"),t=20===e[0].offsetTop||15===e[0].offsetTop;return e.remove(),t}()),n.extend(o.defaults,{scrollbarWidth:n.scrollbarWidth(),fixed:n.support.fixedPosition,parent:n("body")}),t=n(e).width(),i.addClass("fancybox-lock-test"),a=n(e).width(),i.removeClass("fancybox-lock-test"),n("<style type='text/css'>.fancybox-margin{margin-right:"+(a-t)+"px;}</style>").appendTo("head")}))}(window,document,r)},3430:(e,t,n)=>{var r,i,a;i=[n(9755)],void 0===(a="function"==typeof(r=function(e){var t,n,r=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],i="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],a=Array.prototype.slice;if(e.event.fixHooks)for(var s=r.length;s;)e.event.fixHooks[r[--s]]=e.event.mouseHooks;var o=e.event.special.mousewheel={version:"3.1.9",setup:function(){if(this.addEventListener)for(var t=i.length;t;)this.addEventListener(i[--t],u,!1);else this.onmousewheel=u;e.data(this,"mousewheel-line-height",o.getLineHeight(this)),e.data(this,"mousewheel-page-height",o.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var e=i.length;e;)this.removeEventListener(i[--e],u,!1);else this.onmousewheel=null},getLineHeight:function(t){return parseInt(e(t)["offsetParent"in e.fn?"offsetParent":"parent"]().css("fontSize"),10)},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0}};function u(r){var i=r||window.event,s=a.call(arguments,1),o=0,u=0,d=0,f=0;if((r=e.event.fix(i)).type="mousewheel","detail"in i&&(d=-1*i.detail),"wheelDelta"in i&&(d=i.wheelDelta),"wheelDeltaY"in i&&(d=i.wheelDeltaY),"wheelDeltaX"in i&&(u=-1*i.wheelDeltaX),"axis"in i&&i.axis===i.HORIZONTAL_AXIS&&(u=-1*d,d=0),o=0===d?u:d,"deltaY"in i&&(o=d=-1*i.deltaY),"deltaX"in i&&(u=i.deltaX,0===d&&(o=-1*u)),0!==d||0!==u){if(1===i.deltaMode){var h=e.data(this,"mousewheel-line-height");o*=h,d*=h,u*=h}else if(2===i.deltaMode){var p=e.data(this,"mousewheel-page-height");o*=p,d*=p,u*=p}return f=Math.max(Math.abs(d),Math.abs(u)),(!n||f<n)&&(n=f,c(i,f)&&(n/=40)),c(i,f)&&(o/=40,u/=40,d/=40),o=Math[o>=1?"floor":"ceil"](o/n),u=Math[u>=1?"floor":"ceil"](u/n),d=Math[d>=1?"floor":"ceil"](d/n),r.deltaX=u,r.deltaY=d,r.deltaFactor=n,r.deltaMode=0,s.unshift(r,o,u,d),t&&clearTimeout(t),t=setTimeout(l,200),(e.event.dispatch||e.event.handle).apply(this,s)}}function l(){n=null}function c(e,t){return o.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120==0}e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})})?r.apply(t,i):r)||(e.exports=a)},7440:(e,t,n)=>{var r,i,a;!function(s){"use strict";i=[n(9755)],void 0===(a="function"==typeof(r=function(e){var t=e.scrollTo=function(t,n,r){return e(window).scrollTo(t,n,r)};function n(t){return!t.nodeName||-1!==e.inArray(t.nodeName.toLowerCase(),["iframe","#document","html","body"])}function r(e){return"function"==typeof e}function i(t){return r(t)||e.isPlainObject(t)?t:{top:t,left:t}}return t.defaults={axis:"xy",duration:0,limit:!0},e.fn.scrollTo=function(a,s,o){"object"==typeof s&&(o=s,s=0),"function"==typeof o&&(o={onAfter:o}),"max"===a&&(a=9e9),o=e.extend({},t.defaults,o),s=s||o.duration;var u=o.queue&&o.axis.length>1;return u&&(s/=2),o.offset=i(o.offset),o.over=i(o.over),this.each((function(){if(null!==a){var l,c=n(this),d=c?this.contentWindow||window:this,f=e(d),h=a,p={};switch(typeof h){case"number":case"string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(h)){h=i(h);break}h=c?e(h):e(h,d);case"object":if(0===h.length)return;(h.is||h.style)&&(l=(h=e(h)).offset())}var g=r(o.offset)&&o.offset(d,h)||o.offset;e.each(o.axis.split(""),(function(e,n){var r="x"===n?"Left":"Top",i=r.toLowerCase(),a="scroll"+r,s=f[a](),y=t.max(d,n);if(l)p[a]=l[i]+(c?0:s-f.offset()[i]),o.margin&&(p[a]-=parseInt(h.css("margin"+r),10)||0,p[a]-=parseInt(h.css("border"+r+"Width"),10)||0),p[a]+=g[i]||0,o.over[i]&&(p[a]+=h["x"===n?"width":"height"]()*o.over[i]);else{var v=h[i];p[a]=v.slice&&"%"===v.slice(-1)?parseFloat(v)/100*y:v}o.limit&&/^\d+$/.test(p[a])&&(p[a]=p[a]<=0?0:Math.min(p[a],y)),!e&&o.axis.length>1&&(s===p[a]?p={}:u&&(m(o.onAfterFirst),p={}))})),m(o.onAfter)}function m(t){var n=e.extend({},o,{queue:!0,duration:s,complete:t&&function(){t.call(d,h,o)}});f.animate(p,n)}}))},t.max=function(t,r){var i="x"===r?"Width":"Height",a="scroll"+i;if(!n(t))return t[a]-e(t)[i.toLowerCase()]();var s="client"+i,o=t.ownerDocument||t.document,u=o.documentElement,l=o.body;return Math.max(u[a],l[a])-Math.min(u[s],l[s])},e.Tween.propHooks.scrollLeft=e.Tween.propHooks.scrollTop={get:function(t){return e(t.elem)[t.prop]()},set:function(t){var n=this.get(t);if(t.options.interrupt&&t._last&&t._last!==n)return e(t.elem).stop();var r=Math.round(t.now);n!==r&&(e(t.elem)[t.prop](r),t._last=this.get(t))}},t})?r.apply(t,i):r)||(e.exports=a)}()},9755:function(e,t){var n;!function(t,n){"use strict";"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,(function(r,i){"use strict";var a=[],s=Object.getPrototypeOf,o=a.slice,u=a.flat?function(e){return a.flat.call(e)}:function(e){return a.concat.apply([],e)},l=a.push,c=a.indexOf,d={},f=d.toString,h=d.hasOwnProperty,p=h.toString,g=p.call(Object),m={},y=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},v=function(e){return null!=e&&e===e.window},_=r.document,T={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,a=(n=n||_).createElement("script");if(a.text=e,t)for(r in T)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&a.setAttribute(r,i);n.head.appendChild(a).parentNode.removeChild(a)}function E(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?d[f.call(e)]||"object":typeof e}var S="3.7.1",w=/HTML$/i,A=function(e,t){return new A.fn.init(e,t)};function I(e){var t=!!e&&"length"in e&&e.length,n=E(e);return!y(e)&&!v(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function C(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}A.fn=A.prototype={jquery:S,constructor:A,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=A.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return A.each(this,e)},map:function(e){return this.pushStack(A.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(A.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(A.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:l,sort:a.sort,splice:a.splice},A.extend=A.fn.extend=function(){var e,t,n,r,i,a,s=arguments[0]||{},o=1,u=arguments.length,l=!1;for("boolean"==typeof s&&(l=s,s=arguments[o]||{},o++),"object"==typeof s||y(s)||(s={}),o===u&&(s=this,o--);o<u;o++)if(null!=(e=arguments[o]))for(t in e)r=e[t],"__proto__"!==t&&s!==r&&(l&&r&&(A.isPlainObject(r)||(i=Array.isArray(r)))?(n=s[t],a=i&&!Array.isArray(n)?[]:i||A.isPlainObject(n)?n:{},i=!1,s[t]=A.extend(l,a,r)):void 0!==r&&(s[t]=r));return s},A.extend({expando:"jQuery"+(S+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==f.call(e)||(t=s(e))&&("function"!=typeof(n=h.call(t,"constructor")&&t.constructor)||p.call(n)!==g))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(I(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},text:function(e){var t,n="",r=0,i=e.nodeType;if(!i)for(;t=e[r++];)n+=A.text(t);return 1===i||11===i?e.textContent:9===i?e.documentElement.textContent:3===i||4===i?e.nodeValue:n},makeArray:function(e,t){var n=t||[];return null!=e&&(I(Object(e))?A.merge(n,"string"==typeof e?[e]:e):l.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:c.call(t,e,n)},isXMLDoc:function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!w.test(t||n&&n.nodeName||"HTML")},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,a=e.length,s=!n;i<a;i++)!t(e[i],i)!==s&&r.push(e[i]);return r},map:function(e,t,n){var r,i,a=0,s=[];if(I(e))for(r=e.length;a<r;a++)null!=(i=t(e[a],a,n))&&s.push(i);else for(a in e)null!=(i=t(e[a],a,n))&&s.push(i);return u(s)},guid:1,support:m}),"function"==typeof Symbol&&(A.fn[Symbol.iterator]=a[Symbol.iterator]),A.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){d["[object "+t+"]"]=t.toLowerCase()}));var R=a.pop,D=a.sort,x=a.splice,N="[\\x20\\t\\r\\n\\f]",O=new RegExp("^"+N+"+|((?:^|[^\\\\])(?:\\\\.)*)"+N+"+$","g");A.contains=function(e,t){var n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(e.contains?e.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))};var P=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function M(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}A.escapeSelector=function(e){return(e+"").replace(P,M)};var k=_,L=l;!function(){var e,t,n,i,s,u,l,d,f,p,g=L,y=A.expando,v=0,_=0,T=ee(),b=ee(),E=ee(),S=ee(),w=function(e,t){return e===t&&(s=!0),0},I="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="(?:\\\\[\\da-fA-F]{1,6}"+N+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",M="\\["+N+"*("+P+")(?:"+N+"*([*^$|!~]?=)"+N+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+P+"))|)"+N+"*\\]",F=":("+P+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+M+")*)|.*)\\)|)",U=new RegExp(N+"+","g"),B=new RegExp("^"+N+"*,"+N+"*"),j=new RegExp("^"+N+"*([>+~]|"+N+")"+N+"*"),q=new RegExp(N+"|>"),H=new RegExp(F),G=new RegExp("^"+P+"$"),V={ID:new RegExp("^#("+P+")"),CLASS:new RegExp("^\\.("+P+")"),TAG:new RegExp("^("+P+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+N+"*(even|odd|(([+-]|)(\\d*)n|)"+N+"*(?:([+-]|)"+N+"*(\\d+)|))"+N+"*\\)|)","i"),bool:new RegExp("^(?:"+I+")$","i"),needsContext:new RegExp("^"+N+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+N+"*((?:-\\d)?\\d*)"+N+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,z=/^h\d$/i,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,W=new RegExp("\\\\[\\da-fA-F]{1,6}"+N+"?|\\\\([^\\r\\n\\f])","g"),X=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},$=function(){ue()},Q=fe((function(e){return!0===e.disabled&&C(e,"fieldset")}),{dir:"parentNode",next:"legend"});try{g.apply(a=o.call(k.childNodes),k.childNodes),a[k.childNodes.length].nodeType}catch(e){g={apply:function(e,t){L.apply(e,o.call(t))},call:function(e){L.apply(e,o.call(arguments,1))}}}function J(e,t,n,r){var i,a,s,o,l,c,h,p=t&&t.ownerDocument,v=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==v&&9!==v&&11!==v)return n;if(!r&&(ue(t),t=t||u,d)){if(11!==v&&(l=Z.exec(e)))if(i=l[1]){if(9===v){if(!(s=t.getElementById(i)))return n;if(s.id===i)return g.call(n,s),n}else if(p&&(s=p.getElementById(i))&&J.contains(t,s)&&s.id===i)return g.call(n,s),n}else{if(l[2])return g.apply(n,t.getElementsByTagName(e)),n;if((i=l[3])&&t.getElementsByClassName)return g.apply(n,t.getElementsByClassName(i)),n}if(!(S[e+" "]||f&&f.test(e))){if(h=e,p=t,1===v&&(q.test(e)||j.test(e))){for((p=K.test(e)&&oe(t.parentNode)||t)==t&&m.scope||((o=t.getAttribute("id"))?o=A.escapeSelector(o):t.setAttribute("id",o=y)),a=(c=ce(e)).length;a--;)c[a]=(o?"#"+o:":scope")+" "+de(c[a]);h=c.join(",")}try{return g.apply(n,p.querySelectorAll(h)),n}catch(t){S(e,!0)}finally{o===y&&t.removeAttribute("id")}}}return ve(e.replace(O,"$1"),t,n,r)}function ee(){var e=[];return function n(r,i){return e.push(r+" ")>t.cacheLength&&delete n[e.shift()],n[r+" "]=i}}function te(e){return e[y]=!0,e}function ne(e){var t=u.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function re(e){return function(t){return C(t,"input")&&t.type===e}}function ie(e){return function(t){return(C(t,"input")||C(t,"button"))&&t.type===e}}function ae(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&Q(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function se(e){return te((function(t){return t=+t,te((function(n,r){for(var i,a=e([],n.length,t),s=a.length;s--;)n[i=a[s]]&&(n[i]=!(r[i]=n[i]))}))}))}function oe(e){return e&&void 0!==e.getElementsByTagName&&e}function ue(e){var n,r=e?e.ownerDocument||e:k;return r!=u&&9===r.nodeType&&r.documentElement?(l=(u=r).documentElement,d=!A.isXMLDoc(u),p=l.matches||l.webkitMatchesSelector||l.msMatchesSelector,l.msMatchesSelector&&k!=u&&(n=u.defaultView)&&n.top!==n&&n.addEventListener("unload",$),m.getById=ne((function(e){return l.appendChild(e).id=A.expando,!u.getElementsByName||!u.getElementsByName(A.expando).length})),m.disconnectedMatch=ne((function(e){return p.call(e,"*")})),m.scope=ne((function(){return u.querySelectorAll(":scope")})),m.cssHas=ne((function(){try{return u.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}})),m.getById?(t.filter.ID=function(e){var t=e.replace(W,X);return function(e){return e.getAttribute("id")===t}},t.find.ID=function(e,t){if(void 0!==t.getElementById&&d){var n=t.getElementById(e);return n?[n]:[]}}):(t.filter.ID=function(e){var t=e.replace(W,X);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},t.find.ID=function(e,t){if(void 0!==t.getElementById&&d){var n,r,i,a=t.getElementById(e);if(a){if((n=a.getAttributeNode("id"))&&n.value===e)return[a];for(i=t.getElementsByName(e),r=0;a=i[r++];)if((n=a.getAttributeNode("id"))&&n.value===e)return[a]}return[]}}),t.find.TAG=function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},t.find.CLASS=function(e,t){if(void 0!==t.getElementsByClassName&&d)return t.getElementsByClassName(e)},f=[],ne((function(e){var t;l.appendChild(e).innerHTML="<a id='"+y+"' href='' disabled='disabled'></a><select id='"+y+"-\r\\' disabled='disabled'><option selected=''></option></select>",e.querySelectorAll("[selected]").length||f.push("\\["+N+"*(?:value|"+I+")"),e.querySelectorAll("[id~="+y+"-]").length||f.push("~="),e.querySelectorAll("a#"+y+"+*").length||f.push(".#.+[+~]"),e.querySelectorAll(":checked").length||f.push(":checked"),(t=u.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),l.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&f.push(":enabled",":disabled"),(t=u.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||f.push("\\["+N+"*name"+N+"*="+N+"*(?:''|\"\")")})),m.cssHas||f.push(":has"),f=f.length&&new RegExp(f.join("|")),w=function(e,t){if(e===t)return s=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!m.sortDetached&&t.compareDocumentPosition(e)===n?e===u||e.ownerDocument==k&&J.contains(k,e)?-1:t===u||t.ownerDocument==k&&J.contains(k,t)?1:i?c.call(i,e)-c.call(i,t):0:4&n?-1:1)},u):u}for(e in J.matches=function(e,t){return J(e,null,null,t)},J.matchesSelector=function(e,t){if(ue(e),d&&!S[t+" "]&&(!f||!f.test(t)))try{var n=p.call(e,t);if(n||m.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){S(t,!0)}return J(t,u,null,[e]).length>0},J.contains=function(e,t){return(e.ownerDocument||e)!=u&&ue(e),A.contains(e,t)},J.attr=function(e,n){(e.ownerDocument||e)!=u&&ue(e);var r=t.attrHandle[n.toLowerCase()],i=r&&h.call(t.attrHandle,n.toLowerCase())?r(e,n,!d):void 0;return void 0!==i?i:e.getAttribute(n)},J.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},A.uniqueSort=function(e){var t,n=[],r=0,a=0;if(s=!m.sortStable,i=!m.sortStable&&o.call(e,0),D.call(e,w),s){for(;t=e[a++];)t===e[a]&&(r=n.push(a));for(;r--;)x.call(e,n[r],1)}return i=null,e},A.fn.uniqueSort=function(){return this.pushStack(A.uniqueSort(o.apply(this)))},t=A.expr={cacheLength:50,createPseudo:te,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(W,X),e[3]=(e[3]||e[4]||e[5]||"").replace(W,X),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||J.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&J.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&H.test(n)&&(t=ce(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(W,X).toLowerCase();return"*"===e?function(){return!0}:function(e){return C(e,t)}},CLASS:function(e){var t=T[e+" "];return t||(t=new RegExp("(^|"+N+")"+e+"("+N+"|$)"))&&T(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var i=J.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(U," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var a="nth"!==e.slice(0,3),s="last"!==e.slice(-4),o="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,d,f,h,p=a!==s?"nextSibling":"previousSibling",g=t.parentNode,m=o&&t.nodeName.toLowerCase(),_=!u&&!o,T=!1;if(g){if(a){for(;p;){for(d=t;d=d[p];)if(o?C(d,m):1===d.nodeType)return!1;h=p="only"===e&&!h&&"nextSibling"}return!0}if(h=[s?g.firstChild:g.lastChild],s&&_){for(T=(f=(l=(c=g[y]||(g[y]={}))[e]||[])[0]===v&&l[1])&&l[2],d=f&&g.childNodes[f];d=++f&&d&&d[p]||(T=f=0)||h.pop();)if(1===d.nodeType&&++T&&d===t){c[e]=[v,f,T];break}}else if(_&&(T=f=(l=(c=t[y]||(t[y]={}))[e]||[])[0]===v&&l[1]),!1===T)for(;(d=++f&&d&&d[p]||(T=f=0)||h.pop())&&(!(o?C(d,m):1===d.nodeType)||!++T||(_&&((c=d[y]||(d[y]={}))[e]=[v,T]),d!==t)););return(T-=i)===r||T%r==0&&T/r>=0}}},PSEUDO:function(e,n){var r,i=t.pseudos[e]||t.setFilters[e.toLowerCase()]||J.error("unsupported pseudo: "+e);return i[y]?i(n):i.length>1?(r=[e,e,"",n],t.setFilters.hasOwnProperty(e.toLowerCase())?te((function(e,t){for(var r,a=i(e,n),s=a.length;s--;)e[r=c.call(e,a[s])]=!(t[r]=a[s])})):function(e){return i(e,0,r)}):i}},pseudos:{not:te((function(e){var t=[],n=[],r=ye(e.replace(O,"$1"));return r[y]?te((function(e,t,n,i){for(var a,s=r(e,null,i,[]),o=e.length;o--;)(a=s[o])&&(e[o]=!(t[o]=a))})):function(e,i,a){return t[0]=e,r(t,null,a,n),t[0]=null,!n.pop()}})),has:te((function(e){return function(t){return J(e,t).length>0}})),contains:te((function(e){return e=e.replace(W,X),function(t){return(t.textContent||A.text(t)).indexOf(e)>-1}})),lang:te((function(e){return G.test(e||"")||J.error("unsupported lang: "+e),e=e.replace(W,X).toLowerCase(),function(t){var n;do{if(n=d?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(e){var t=r.location&&r.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===l},focus:function(e){return e===function(){try{return u.activeElement}catch(e){}}()&&u.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:ae(!1),disabled:ae(!0),checked:function(e){return C(e,"input")&&!!e.checked||C(e,"option")&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!t.pseudos.empty(e)},header:function(e){return z.test(e.nodeName)},input:function(e){return Y.test(e.nodeName)},button:function(e){return C(e,"input")&&"button"===e.type||C(e,"button")},text:function(e){var t;return C(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:se((function(){return[0]})),last:se((function(e,t){return[t-1]})),eq:se((function(e,t,n){return[n<0?n+t:n]})),even:se((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:se((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:se((function(e,t,n){var r;for(r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e})),gt:se((function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e}))}},t.pseudos.nth=t.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})t.pseudos[e]=re(e);for(e in{submit:!0,reset:!0})t.pseudos[e]=ie(e);function le(){}function ce(e,n){var r,i,a,s,o,u,l,c=b[e+" "];if(c)return n?0:c.slice(0);for(o=e,u=[],l=t.preFilter;o;){for(s in r&&!(i=B.exec(o))||(i&&(o=o.slice(i[0].length)||o),u.push(a=[])),r=!1,(i=j.exec(o))&&(r=i.shift(),a.push({value:r,type:i[0].replace(O," ")}),o=o.slice(r.length)),t.filter)!(i=V[s].exec(o))||l[s]&&!(i=l[s](i))||(r=i.shift(),a.push({value:r,type:s,matches:i}),o=o.slice(r.length));if(!r)break}return n?o.length:o?J.error(e):b(e,u).slice(0)}function de(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function fe(e,t,n){var r=t.dir,i=t.next,a=i||r,s=n&&"parentNode"===a,o=_++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||s)return e(t,n,i);return!1}:function(t,n,u){var l,c,d=[v,o];if(u){for(;t=t[r];)if((1===t.nodeType||s)&&e(t,n,u))return!0}else for(;t=t[r];)if(1===t.nodeType||s)if(c=t[y]||(t[y]={}),i&&C(t,i))t=t[r]||t;else{if((l=c[a])&&l[0]===v&&l[1]===o)return d[2]=l[2];if(c[a]=d,d[2]=e(t,n,u))return!0}return!1}}function he(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function pe(e,t,n,r,i){for(var a,s=[],o=0,u=e.length,l=null!=t;o<u;o++)(a=e[o])&&(n&&!n(a,r,i)||(s.push(a),l&&t.push(o)));return s}function ge(e,t,n,r,i,a){return r&&!r[y]&&(r=ge(r)),i&&!i[y]&&(i=ge(i,a)),te((function(a,s,o,u){var l,d,f,h,p=[],m=[],y=s.length,v=a||function(e,t,n){for(var r=0,i=t.length;r<i;r++)J(e,t[r],n);return n}(t||"*",o.nodeType?[o]:o,[]),_=!e||!a&&t?v:pe(v,p,e,o,u);if(n?n(_,h=i||(a?e:y||r)?[]:s,o,u):h=_,r)for(l=pe(h,m),r(l,[],o,u),d=l.length;d--;)(f=l[d])&&(h[m[d]]=!(_[m[d]]=f));if(a){if(i||e){if(i){for(l=[],d=h.length;d--;)(f=h[d])&&l.push(_[d]=f);i(null,h=[],l,u)}for(d=h.length;d--;)(f=h[d])&&(l=i?c.call(a,f):p[d])>-1&&(a[l]=!(s[l]=f))}}else h=pe(h===s?h.splice(y,h.length):h),i?i(null,s,h,u):g.apply(s,h)}))}function me(e){for(var r,i,a,s=e.length,o=t.relative[e[0].type],u=o||t.relative[" "],l=o?1:0,d=fe((function(e){return e===r}),u,!0),f=fe((function(e){return c.call(r,e)>-1}),u,!0),h=[function(e,t,i){var a=!o&&(i||t!=n)||((r=t).nodeType?d(e,t,i):f(e,t,i));return r=null,a}];l<s;l++)if(i=t.relative[e[l].type])h=[fe(he(h),i)];else{if((i=t.filter[e[l].type].apply(null,e[l].matches))[y]){for(a=++l;a<s&&!t.relative[e[a].type];a++);return ge(l>1&&he(h),l>1&&de(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(O,"$1"),i,l<a&&me(e.slice(l,a)),a<s&&me(e=e.slice(a)),a<s&&de(e))}h.push(i)}return he(h)}function ye(e,r){var i,a=[],s=[],o=E[e+" "];if(!o){for(r||(r=ce(e)),i=r.length;i--;)(o=me(r[i]))[y]?a.push(o):s.push(o);o=E(e,function(e,r){var i=r.length>0,a=e.length>0,s=function(s,o,l,c,f){var h,p,m,y=0,_="0",T=s&&[],b=[],E=n,S=s||a&&t.find.TAG("*",f),w=v+=null==E?1:Math.random()||.1,I=S.length;for(f&&(n=o==u||o||f);_!==I&&null!=(h=S[_]);_++){if(a&&h){for(p=0,o||h.ownerDocument==u||(ue(h),l=!d);m=e[p++];)if(m(h,o||u,l)){g.call(c,h);break}f&&(v=w)}i&&((h=!m&&h)&&y--,s&&T.push(h))}if(y+=_,i&&_!==y){for(p=0;m=r[p++];)m(T,b,o,l);if(s){if(y>0)for(;_--;)T[_]||b[_]||(b[_]=R.call(c));b=pe(b)}g.apply(c,b),f&&!s&&b.length>0&&y+r.length>1&&A.uniqueSort(c)}return f&&(v=w,n=E),T};return i?te(s):s}(s,a)),o.selector=e}return o}function ve(e,n,r,i){var a,s,o,u,l,c="function"==typeof e&&e,f=!i&&ce(e=c.selector||e);if(r=r||[],1===f.length){if((s=f[0]=f[0].slice(0)).length>2&&"ID"===(o=s[0]).type&&9===n.nodeType&&d&&t.relative[s[1].type]){if(!(n=(t.find.ID(o.matches[0].replace(W,X),n)||[])[0]))return r;c&&(n=n.parentNode),e=e.slice(s.shift().value.length)}for(a=V.needsContext.test(e)?0:s.length;a--&&(o=s[a],!t.relative[u=o.type]);)if((l=t.find[u])&&(i=l(o.matches[0].replace(W,X),K.test(s[0].type)&&oe(n.parentNode)||n))){if(s.splice(a,1),!(e=i.length&&de(s)))return g.apply(r,i),r;break}}return(c||ye(e,f))(i,n,!d,r,!n||K.test(e)&&oe(n.parentNode)||n),r}le.prototype=t.filters=t.pseudos,t.setFilters=new le,m.sortStable=y.split("").sort(w).join("")===y,ue(),m.sortDetached=ne((function(e){return 1&e.compareDocumentPosition(u.createElement("fieldset"))})),A.find=J,A.expr[":"]=A.expr.pseudos,A.unique=A.uniqueSort,J.compile=ye,J.select=ve,J.setDocument=ue,J.tokenize=ce,J.escape=A.escapeSelector,J.getText=A.text,J.isXML=A.isXMLDoc,J.selectors=A.expr,J.support=A.support,J.uniqueSort=A.uniqueSort}();var F=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&A(e).is(n))break;r.push(e)}return r},U=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},B=A.expr.match.needsContext,j=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function q(e,t,n){return y(t)?A.grep(e,(function(e,r){return!!t.call(e,r,e)!==n})):t.nodeType?A.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?A.grep(e,(function(e){return c.call(t,e)>-1!==n})):A.filter(t,e,n)}A.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?A.find.matchesSelector(r,e)?[r]:[]:A.find.matches(e,A.grep(t,(function(e){return 1===e.nodeType})))},A.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(A(e).filter((function(){for(t=0;t<r;t++)if(A.contains(i[t],this))return!0})));for(n=this.pushStack([]),t=0;t<r;t++)A.find(e,i[t],n);return r>1?A.uniqueSort(n):n},filter:function(e){return this.pushStack(q(this,e||[],!1))},not:function(e){return this.pushStack(q(this,e||[],!0))},is:function(e){return!!q(this,"string"==typeof e&&B.test(e)?A(e):e||[],!1).length}});var H,G=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(A.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||H,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:G.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof A?t[0]:t,A.merge(this,A.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:_,!0)),j.test(r[1])&&A.isPlainObject(t))for(r in t)y(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=_.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):y(e)?void 0!==n.ready?n.ready(e):e(A):A.makeArray(e,this)}).prototype=A.fn,H=A(_);var V=/^(?:parents|prev(?:Until|All))/,Y={children:!0,contents:!0,next:!0,prev:!0};function z(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}A.fn.extend({has:function(e){var t=A(e,this),n=t.length;return this.filter((function(){for(var e=0;e<n;e++)if(A.contains(this,t[e]))return!0}))},closest:function(e,t){var n,r=0,i=this.length,a=[],s="string"!=typeof e&&A(e);if(!B.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&A.find.matchesSelector(n,e))){a.push(n);break}return this.pushStack(a.length>1?A.uniqueSort(a):a)},index:function(e){return e?"string"==typeof e?c.call(A(e),this[0]):c.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(A.uniqueSort(A.merge(this.get(),A(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),A.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return F(e,"parentNode")},parentsUntil:function(e,t,n){return F(e,"parentNode",n)},next:function(e){return z(e,"nextSibling")},prev:function(e){return z(e,"previousSibling")},nextAll:function(e){return F(e,"nextSibling")},prevAll:function(e){return F(e,"previousSibling")},nextUntil:function(e,t,n){return F(e,"nextSibling",n)},prevUntil:function(e,t,n){return F(e,"previousSibling",n)},siblings:function(e){return U((e.parentNode||{}).firstChild,e)},children:function(e){return U(e.firstChild)},contents:function(e){return null!=e.contentDocument&&s(e.contentDocument)?e.contentDocument:(C(e,"template")&&(e=e.content||e),A.merge([],e.childNodes))}},(function(e,t){A.fn[e]=function(n,r){var i=A.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=A.filter(r,i)),this.length>1&&(Y[e]||A.uniqueSort(i),V.test(e)&&i.reverse()),this.pushStack(i)}}));var Z=/[^\x20\t\r\n\f]+/g;function K(e){return e}function W(e){throw e}function X(e,t,n,r){var i;try{e&&y(i=e.promise)?i.call(e).done(t).fail(n):e&&y(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}A.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return A.each(e.match(Z)||[],(function(e,n){t[n]=!0})),t}(e):A.extend({},e);var t,n,r,i,a=[],s=[],o=-1,u=function(){for(i=i||e.once,r=t=!0;s.length;o=-1)for(n=s.shift();++o<a.length;)!1===a[o].apply(n[0],n[1])&&e.stopOnFalse&&(o=a.length,n=!1);e.memory||(n=!1),t=!1,i&&(a=n?[]:"")},l={add:function(){return a&&(n&&!t&&(o=a.length-1,s.push(n)),function t(n){A.each(n,(function(n,r){y(r)?e.unique&&l.has(r)||a.push(r):r&&r.length&&"string"!==E(r)&&t(r)}))}(arguments),n&&!t&&u()),this},remove:function(){return A.each(arguments,(function(e,t){for(var n;(n=A.inArray(t,a,n))>-1;)a.splice(n,1),n<=o&&o--})),this},has:function(e){return e?A.inArray(e,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return i=s=[],a=n="",this},disabled:function(){return!a},lock:function(){return i=s=[],n||t||(a=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],s.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l},A.extend({Deferred:function(e){var t=[["notify","progress",A.Callbacks("memory"),A.Callbacks("memory"),2],["resolve","done",A.Callbacks("once memory"),A.Callbacks("once memory"),0,"resolved"],["reject","fail",A.Callbacks("once memory"),A.Callbacks("once memory"),1,"rejected"]],n="pending",i={state:function(){return n},always:function(){return a.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return A.Deferred((function(n){A.each(t,(function(t,r){var i=y(e[r[4]])&&e[r[4]];a[r[1]]((function(){var e=i&&i.apply(this,arguments);e&&y(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[e]:arguments)}))})),e=null})).promise()},then:function(e,n,i){var a=0;function s(e,t,n,i){return function(){var o=this,u=arguments,l=function(){var r,l;if(!(e<a)){if((r=n.apply(o,u))===t.promise())throw new TypeError("Thenable self-resolution");l=r&&("object"==typeof r||"function"==typeof r)&&r.then,y(l)?i?l.call(r,s(a,t,K,i),s(a,t,W,i)):(a++,l.call(r,s(a,t,K,i),s(a,t,W,i),s(a,t,K,t.notifyWith))):(n!==K&&(o=void 0,u=[r]),(i||t.resolveWith)(o,u))}},c=i?l:function(){try{l()}catch(r){A.Deferred.exceptionHook&&A.Deferred.exceptionHook(r,c.error),e+1>=a&&(n!==W&&(o=void 0,u=[r]),t.rejectWith(o,u))}};e?c():(A.Deferred.getErrorHook?c.error=A.Deferred.getErrorHook():A.Deferred.getStackHook&&(c.error=A.Deferred.getStackHook()),r.setTimeout(c))}}return A.Deferred((function(r){t[0][3].add(s(0,r,y(i)?i:K,r.notifyWith)),t[1][3].add(s(0,r,y(e)?e:K)),t[2][3].add(s(0,r,y(n)?n:W))})).promise()},promise:function(e){return null!=e?A.extend(e,i):i}},a={};return A.each(t,(function(e,r){var s=r[2],o=r[5];i[r[1]]=s.add,o&&s.add((function(){n=o}),t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),s.add(r[3].fire),a[r[0]]=function(){return a[r[0]+"With"](this===a?void 0:this,arguments),this},a[r[0]+"With"]=s.fireWith})),i.promise(a),e&&e.call(a,a),a},when:function(e){var t=arguments.length,n=t,r=Array(n),i=o.call(arguments),a=A.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?o.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&(X(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||y(i[n]&&i[n].then)))return a.then();for(;n--;)X(i[n],s(n),a.reject);return a.promise()}});var $=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;A.Deferred.exceptionHook=function(e,t){r.console&&r.console.warn&&e&&$.test(e.name)&&r.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},A.readyException=function(e){r.setTimeout((function(){throw e}))};var Q=A.Deferred();function J(){_.removeEventListener("DOMContentLoaded",J),r.removeEventListener("load",J),A.ready()}A.fn.ready=function(e){return Q.then(e).catch((function(e){A.readyException(e)})),this},A.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--A.readyWait:A.isReady)||(A.isReady=!0,!0!==e&&--A.readyWait>0||Q.resolveWith(_,[A]))}}),A.ready.then=Q.then,"complete"===_.readyState||"loading"!==_.readyState&&!_.documentElement.doScroll?r.setTimeout(A.ready):(_.addEventListener("DOMContentLoaded",J),r.addEventListener("load",J));var ee=function(e,t,n,r,i,a,s){var o=0,u=e.length,l=null==n;if("object"===E(n))for(o in i=!0,n)ee(e,t,o,n[o],!0,a,s);else if(void 0!==r&&(i=!0,y(r)||(s=!0),l&&(s?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(A(e),n)})),t))for(;o<u;o++)t(e[o],n,s?r:r.call(e[o],o,t(e[o],n)));return i?e:l?t.call(e):u?t(e[0],n):a},te=/^-ms-/,ne=/-([a-z])/g;function re(e,t){return t.toUpperCase()}function ie(e){return e.replace(te,"ms-").replace(ne,re)}var ae=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function se(){this.expando=A.expando+se.uid++}se.uid=1,se.prototype={cache:function(e){var t=e[this.expando];return t||(t={},ae(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[ie(t)]=n;else for(r in t)i[ie(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][ie(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(ie):(t=ie(t))in r?[t]:t.match(Z)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||A.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!A.isEmptyObject(t)}};var oe=new se,ue=new se,le=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ce=/[A-Z]/g;function de(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(ce,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:le.test(e)?JSON.parse(e):e)}(n)}catch(e){}ue.set(e,t,n)}else n=void 0;return n}A.extend({hasData:function(e){return ue.hasData(e)||oe.hasData(e)},data:function(e,t,n){return ue.access(e,t,n)},removeData:function(e,t){ue.remove(e,t)},_data:function(e,t,n){return oe.access(e,t,n)},_removeData:function(e,t){oe.remove(e,t)}}),A.fn.extend({data:function(e,t){var n,r,i,a=this[0],s=a&&a.attributes;if(void 0===e){if(this.length&&(i=ue.get(a),1===a.nodeType&&!oe.get(a,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&0===(r=s[n].name).indexOf("data-")&&(r=ie(r.slice(5)),de(a,r,i[r]));oe.set(a,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each((function(){ue.set(this,e)})):ee(this,(function(t){var n;if(a&&void 0===t)return void 0!==(n=ue.get(a,e))||void 0!==(n=de(a,e))?n:void 0;this.each((function(){ue.set(this,e,t)}))}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){ue.remove(this,e)}))}}),A.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=oe.get(e,t),n&&(!r||Array.isArray(n)?r=oe.access(e,t,A.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=A.queue(e,t),r=n.length,i=n.shift(),a=A._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete a.stop,i.call(e,(function(){A.dequeue(e,t)}),a)),!r&&a&&a.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return oe.get(e,n)||oe.access(e,n,{empty:A.Callbacks("once memory").add((function(){oe.remove(e,[t+"queue",n])}))})}}),A.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?A.queue(this[0],e):void 0===t?this:this.each((function(){var n=A.queue(this,e,t);A._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&A.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){A.dequeue(this,e)}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=A.Deferred(),a=this,s=this.length,o=function(){--r||i.resolveWith(a,[a])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";s--;)(n=oe.get(a[s],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(o));return o(),i.promise(t)}});var fe=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,he=new RegExp("^(?:([+-])=|)("+fe+")([a-z%]*)$","i"),pe=["Top","Right","Bottom","Left"],ge=_.documentElement,me=function(e){return A.contains(e.ownerDocument,e)},ye={composed:!0};ge.getRootNode&&(me=function(e){return A.contains(e.ownerDocument,e)||e.getRootNode(ye)===e.ownerDocument});var ve=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&me(e)&&"none"===A.css(e,"display")};function _e(e,t,n,r){var i,a,s=20,o=r?function(){return r.cur()}:function(){return A.css(e,t,"")},u=o(),l=n&&n[3]||(A.cssNumber[t]?"":"px"),c=e.nodeType&&(A.cssNumber[t]||"px"!==l&&+u)&&he.exec(A.css(e,t));if(c&&c[3]!==l){for(u/=2,l=l||c[3],c=+u||1;s--;)A.style(e,t,c+l),(1-a)*(1-(a=o()/u||.5))<=0&&(s=0),c/=a;c*=2,A.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var Te={};function be(e){var t,n=e.ownerDocument,r=e.nodeName,i=Te[r];return i||(t=n.body.appendChild(n.createElement(r)),i=A.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),Te[r]=i,i)}function Ee(e,t){for(var n,r,i=[],a=0,s=e.length;a<s;a++)(r=e[a]).style&&(n=r.style.display,t?("none"===n&&(i[a]=oe.get(r,"display")||null,i[a]||(r.style.display="")),""===r.style.display&&ve(r)&&(i[a]=be(r))):"none"!==n&&(i[a]="none",oe.set(r,"display",n)));for(a=0;a<s;a++)null!=i[a]&&(e[a].style.display=i[a]);return e}A.fn.extend({show:function(){return Ee(this,!0)},hide:function(){return Ee(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){ve(this)?A(this).show():A(this).hide()}))}});var Se,we,Ae=/^(?:checkbox|radio)$/i,Ie=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;Se=_.createDocumentFragment().appendChild(_.createElement("div")),(we=_.createElement("input")).setAttribute("type","radio"),we.setAttribute("checked","checked"),we.setAttribute("name","t"),Se.appendChild(we),m.checkClone=Se.cloneNode(!0).cloneNode(!0).lastChild.checked,Se.innerHTML="<textarea>x</textarea>",m.noCloneChecked=!!Se.cloneNode(!0).lastChild.defaultValue,Se.innerHTML="<option></option>",m.option=!!Se.lastChild;var Re={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function De(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&C(e,t)?A.merge([e],n):n}function xe(e,t){for(var n=0,r=e.length;n<r;n++)oe.set(e[n],"globalEval",!t||oe.get(t[n],"globalEval"))}Re.tbody=Re.tfoot=Re.colgroup=Re.caption=Re.thead,Re.th=Re.td,m.option||(Re.optgroup=Re.option=[1,"<select multiple='multiple'>","</select>"]);var Ne=/<|&#?\w+;/;function Oe(e,t,n,r,i){for(var a,s,o,u,l,c,d=t.createDocumentFragment(),f=[],h=0,p=e.length;h<p;h++)if((a=e[h])||0===a)if("object"===E(a))A.merge(f,a.nodeType?[a]:a);else if(Ne.test(a)){for(s=s||d.appendChild(t.createElement("div")),o=(Ie.exec(a)||["",""])[1].toLowerCase(),u=Re[o]||Re._default,s.innerHTML=u[1]+A.htmlPrefilter(a)+u[2],c=u[0];c--;)s=s.lastChild;A.merge(f,s.childNodes),(s=d.firstChild).textContent=""}else f.push(t.createTextNode(a));for(d.textContent="",h=0;a=f[h++];)if(r&&A.inArray(a,r)>-1)i&&i.push(a);else if(l=me(a),s=De(d.appendChild(a),"script"),l&&xe(s),n)for(c=0;a=s[c++];)Ce.test(a.type||"")&&n.push(a);return d}var Pe=/^([^.]*)(?:\.(.+)|)/;function Me(){return!0}function ke(){return!1}function Le(e,t,n,r,i,a){var s,o;if("object"==typeof t){for(o in"string"!=typeof n&&(r=r||n,n=void 0),t)Le(e,o,n,r,t[o],a);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=ke;else if(!i)return e;return 1===a&&(s=i,i=function(e){return A().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=A.guid++)),e.each((function(){A.event.add(this,t,i,r,n)}))}function Fe(e,t,n){n?(oe.set(e,t,!1),A.event.add(e,t,{namespace:!1,handler:function(e){var n,r=oe.get(this,t);if(1&e.isTrigger&&this[t]){if(r)(A.event.special[t]||{}).delegateType&&e.stopPropagation();else if(r=o.call(arguments),oe.set(this,t,r),this[t](),n=oe.get(this,t),oe.set(this,t,!1),r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n}else r&&(oe.set(this,t,A.event.trigger(r[0],r.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=Me)}})):void 0===oe.get(e,t)&&A.event.add(e,t,Me)}A.event={global:{},add:function(e,t,n,r,i){var a,s,o,u,l,c,d,f,h,p,g,m=oe.get(e);if(ae(e))for(n.handler&&(n=(a=n).handler,i=a.selector),i&&A.find.matchesSelector(ge,i),n.guid||(n.guid=A.guid++),(u=m.events)||(u=m.events=Object.create(null)),(s=m.handle)||(s=m.handle=function(t){return void 0!==A&&A.event.triggered!==t.type?A.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(Z)||[""]).length;l--;)h=g=(o=Pe.exec(t[l])||[])[1],p=(o[2]||"").split(".").sort(),h&&(d=A.event.special[h]||{},h=(i?d.delegateType:d.bindType)||h,d=A.event.special[h]||{},c=A.extend({type:h,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&A.expr.match.needsContext.test(i),namespace:p.join(".")},a),(f=u[h])||((f=u[h]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,r,p,s)||e.addEventListener&&e.addEventListener(h,s)),d.add&&(d.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?f.splice(f.delegateCount++,0,c):f.push(c),A.event.global[h]=!0)},remove:function(e,t,n,r,i){var a,s,o,u,l,c,d,f,h,p,g,m=oe.hasData(e)&&oe.get(e);if(m&&(u=m.events)){for(l=(t=(t||"").match(Z)||[""]).length;l--;)if(h=g=(o=Pe.exec(t[l])||[])[1],p=(o[2]||"").split(".").sort(),h){for(d=A.event.special[h]||{},f=u[h=(r?d.delegateType:d.bindType)||h]||[],o=o[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=a=f.length;a--;)c=f[a],!i&&g!==c.origType||n&&n.guid!==c.guid||o&&!o.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(f.splice(a,1),c.selector&&f.delegateCount--,d.remove&&d.remove.call(e,c));s&&!f.length&&(d.teardown&&!1!==d.teardown.call(e,p,m.handle)||A.removeEvent(e,h,m.handle),delete u[h])}else for(h in u)A.event.remove(e,h+t[l],n,r,!0);A.isEmptyObject(u)&&oe.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,a,s,o=new Array(arguments.length),u=A.event.fix(e),l=(oe.get(this,"events")||Object.create(null))[u.type]||[],c=A.event.special[u.type]||{};for(o[0]=u,t=1;t<arguments.length;t++)o[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){for(s=A.event.handlers.call(this,u,l),t=0;(i=s[t++])&&!u.isPropagationStopped();)for(u.currentTarget=i.elem,n=0;(a=i.handlers[n++])&&!u.isImmediatePropagationStopped();)u.rnamespace&&!1!==a.namespace&&!u.rnamespace.test(a.namespace)||(u.handleObj=a,u.data=a.data,void 0!==(r=((A.event.special[a.origType]||{}).handle||a.handler).apply(i.elem,o))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,a,s,o=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&e.button>=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(a=[],s={},n=0;n<u;n++)void 0===s[i=(r=t[n]).selector+" "]&&(s[i]=r.needsContext?A(i,this).index(l)>-1:A.find(i,this,null,[l]).length),s[i]&&a.push(r);a.length&&o.push({elem:l,handlers:a})}return l=this,u<t.length&&o.push({elem:l,handlers:t.slice(u)}),o},addProp:function(e,t){Object.defineProperty(A.Event.prototype,e,{enumerable:!0,configurable:!0,get:y(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[A.expando]?e:new A.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return Ae.test(t.type)&&t.click&&C(t,"input")&&Fe(t,"click",!0),!1},trigger:function(e){var t=this||e;return Ae.test(t.type)&&t.click&&C(t,"input")&&Fe(t,"click"),!0},_default:function(e){var t=e.target;return Ae.test(t.type)&&t.click&&C(t,"input")&&oe.get(t,"click")||C(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},A.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},A.Event=function(e,t){if(!(this instanceof A.Event))return new A.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Me:ke,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&A.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[A.expando]=!0},A.Event.prototype={constructor:A.Event,isDefaultPrevented:ke,isPropagationStopped:ke,isImmediatePropagationStopped:ke,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Me,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Me,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Me,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},A.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},A.event.addProp),A.each({focus:"focusin",blur:"focusout"},(function(e,t){function n(e){if(_.documentMode){var n=oe.get(this,"handle"),r=A.event.fix(e);r.type="focusin"===e.type?"focus":"blur",r.isSimulated=!0,n(e),r.target===r.currentTarget&&n(r)}else A.event.simulate(t,e.target,A.event.fix(e))}A.event.special[e]={setup:function(){var r;if(Fe(this,e,!0),!_.documentMode)return!1;(r=oe.get(this,t))||this.addEventListener(t,n),oe.set(this,t,(r||0)+1)},trigger:function(){return Fe(this,e),!0},teardown:function(){var e;if(!_.documentMode)return!1;(e=oe.get(this,t)-1)?oe.set(this,t,e):(this.removeEventListener(t,n),oe.remove(this,t))},_default:function(t){return oe.get(t.target,e)},delegateType:t},A.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,i=_.documentMode?this:r,a=oe.get(i,t);a||(_.documentMode?this.addEventListener(t,n):r.addEventListener(e,n,!0)),oe.set(i,t,(a||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=_.documentMode?this:r,a=oe.get(i,t)-1;a?oe.set(i,t,a):(_.documentMode?this.removeEventListener(t,n):r.removeEventListener(e,n,!0),oe.remove(i,t))}}})),A.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(e,t){A.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=e.relatedTarget,i=e.handleObj;return r&&(r===this||A.contains(this,r))||(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}})),A.fn.extend({on:function(e,t,n,r){return Le(this,e,t,n,r)},one:function(e,t,n,r){return Le(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,A(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=ke),this.each((function(){A.event.remove(this,e,n,t)}))}});var Ue=/<script|<style|<link/i,Be=/checked\s*(?:[^=]|=\s*.checked.)/i,je=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function qe(e,t){return C(e,"table")&&C(11!==t.nodeType?t:t.firstChild,"tr")&&A(e).children("tbody")[0]||e}function He(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Ge(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Ve(e,t){var n,r,i,a,s,o;if(1===t.nodeType){if(oe.hasData(e)&&(o=oe.get(e).events))for(i in oe.remove(t,"handle events"),o)for(n=0,r=o[i].length;n<r;n++)A.event.add(t,i,o[i][n]);ue.hasData(e)&&(a=ue.access(e),s=A.extend({},a),ue.set(t,s))}}function Ye(e,t){var n=t.nodeName.toLowerCase();"input"===n&&Ae.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function ze(e,t,n,r){t=u(t);var i,a,s,o,l,c,d=0,f=e.length,h=f-1,p=t[0],g=y(p);if(g||f>1&&"string"==typeof p&&!m.checkClone&&Be.test(p))return e.each((function(i){var a=e.eq(i);g&&(t[0]=p.call(this,i,a.html())),ze(a,t,n,r)}));if(f&&(a=(i=Oe(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=a),a||r)){for(o=(s=A.map(De(i,"script"),He)).length;d<f;d++)l=i,d!==h&&(l=A.clone(l,!0,!0),o&&A.merge(s,De(l,"script"))),n.call(e[d],l,d);if(o)for(c=s[s.length-1].ownerDocument,A.map(s,Ge),d=0;d<o;d++)l=s[d],Ce.test(l.type||"")&&!oe.access(l,"globalEval")&&A.contains(c,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?A._evalUrl&&!l.noModule&&A._evalUrl(l.src,{nonce:l.nonce||l.getAttribute("nonce")},c):b(l.textContent.replace(je,""),l,c))}return e}function Ze(e,t,n){for(var r,i=t?A.filter(t,e):e,a=0;null!=(r=i[a]);a++)n||1!==r.nodeType||A.cleanData(De(r)),r.parentNode&&(n&&me(r)&&xe(De(r,"script")),r.parentNode.removeChild(r));return e}A.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,a,s,o=e.cloneNode(!0),u=me(e);if(!(m.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||A.isXMLDoc(e)))for(s=De(o),r=0,i=(a=De(e)).length;r<i;r++)Ye(a[r],s[r]);if(t)if(n)for(a=a||De(e),s=s||De(o),r=0,i=a.length;r<i;r++)Ve(a[r],s[r]);else Ve(e,o);return(s=De(o,"script")).length>0&&xe(s,!u&&De(e,"script")),o},cleanData:function(e){for(var t,n,r,i=A.event.special,a=0;void 0!==(n=e[a]);a++)if(ae(n)){if(t=n[oe.expando]){if(t.events)for(r in t.events)i[r]?A.event.remove(n,r):A.removeEvent(n,r,t.handle);n[oe.expando]=void 0}n[ue.expando]&&(n[ue.expando]=void 0)}}}),A.fn.extend({detach:function(e){return Ze(this,e,!0)},remove:function(e){return Ze(this,e)},text:function(e){return ee(this,(function(e){return void 0===e?A.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return ze(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||qe(this,e).appendChild(e)}))},prepend:function(){return ze(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=qe(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return ze(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return ze(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(A.cleanData(De(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return A.clone(this,e,t)}))},html:function(e){return ee(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ue.test(e)&&!Re[(Ie.exec(e)||["",""])[1].toLowerCase()]){e=A.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(A.cleanData(De(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(){var e=[];return ze(this,arguments,(function(t){var n=this.parentNode;A.inArray(this,e)<0&&(A.cleanData(De(this)),n&&n.replaceChild(t,this))}),e)}}),A.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){A.fn[e]=function(e){for(var n,r=[],i=A(e),a=i.length-1,s=0;s<=a;s++)n=s===a?this:this.clone(!0),A(i[s])[t](n),l.apply(r,n.get());return this.pushStack(r)}}));var Ke=new RegExp("^("+fe+")(?!px)[a-z%]+$","i"),We=/^--/,Xe=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=r),t.getComputedStyle(e)},$e=function(e,t,n){var r,i,a={};for(i in t)a[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=a[i];return r},Qe=new RegExp(pe.join("|"),"i");function Je(e,t,n){var r,i,a,s,o=We.test(t),u=e.style;return(n=n||Xe(e))&&(s=n.getPropertyValue(t)||n[t],o&&s&&(s=s.replace(O,"$1")||void 0),""!==s||me(e)||(s=A.style(e,t)),!m.pixelBoxStyles()&&Ke.test(s)&&Qe.test(t)&&(r=u.width,i=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=s,s=n.width,u.width=r,u.minWidth=i,u.maxWidth=a)),void 0!==s?s+"":s}function et(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(c){l.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ge.appendChild(l).appendChild(c);var e=r.getComputedStyle(c);n="1%"!==e.top,u=12===t(e.marginLeft),c.style.right="60%",s=36===t(e.right),i=36===t(e.width),c.style.position="absolute",a=12===t(c.offsetWidth/3),ge.removeChild(l),c=null}}function t(e){return Math.round(parseFloat(e))}var n,i,a,s,o,u,l=_.createElement("div"),c=_.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",m.clearCloneStyle="content-box"===c.style.backgroundClip,A.extend(m,{boxSizingReliable:function(){return e(),i},pixelBoxStyles:function(){return e(),s},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),u},scrollboxSize:function(){return e(),a},reliableTrDimensions:function(){var e,t,n,i;return null==o&&(e=_.createElement("table"),t=_.createElement("tr"),n=_.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="box-sizing:content-box;border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",ge.appendChild(e).appendChild(t).appendChild(n),i=r.getComputedStyle(t),o=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===t.offsetHeight,ge.removeChild(e)),o}}))}();var tt=["Webkit","Moz","ms"],nt=_.createElement("div").style,rt={};function it(e){return A.cssProps[e]||rt[e]||(e in nt?e:rt[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=tt.length;n--;)if((e=tt[n]+t)in nt)return e}(e)||e)}var at=/^(none|table(?!-c[ea]).+)/,st={position:"absolute",visibility:"hidden",display:"block"},ot={letterSpacing:"0",fontWeight:"400"};function ut(e,t,n){var r=he.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function lt(e,t,n,r,i,a){var s="width"===t?1:0,o=0,u=0,l=0;if(n===(r?"border":"content"))return 0;for(;s<4;s+=2)"margin"===n&&(l+=A.css(e,n+pe[s],!0,i)),r?("content"===n&&(u-=A.css(e,"padding"+pe[s],!0,i)),"margin"!==n&&(u-=A.css(e,"border"+pe[s]+"Width",!0,i))):(u+=A.css(e,"padding"+pe[s],!0,i),"padding"!==n?u+=A.css(e,"border"+pe[s]+"Width",!0,i):o+=A.css(e,"border"+pe[s]+"Width",!0,i));return!r&&a>=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-a-u-o-.5))||0),u+l}function ct(e,t,n){var r=Xe(e),i=(!m.boxSizingReliable()||n)&&"border-box"===A.css(e,"boxSizing",!1,r),a=i,s=Je(e,t,r),o="offset"+t[0].toUpperCase()+t.slice(1);if(Ke.test(s)){if(!n)return s;s="auto"}return(!m.boxSizingReliable()&&i||!m.reliableTrDimensions()&&C(e,"tr")||"auto"===s||!parseFloat(s)&&"inline"===A.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===A.css(e,"boxSizing",!1,r),(a=o in e)&&(s=e[o])),(s=parseFloat(s)||0)+lt(e,t,n||(i?"border":"content"),a,r,s)+"px"}function dt(e,t,n,r,i){return new dt.prototype.init(e,t,n,r,i)}A.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Je(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,a,s,o=ie(t),u=We.test(t),l=e.style;if(u||(t=it(o)),s=A.cssHooks[t]||A.cssHooks[o],void 0===n)return s&&"get"in s&&void 0!==(i=s.get(e,!1,r))?i:l[t];"string"==(a=typeof n)&&(i=he.exec(n))&&i[1]&&(n=_e(e,t,i),a="number"),null!=n&&n==n&&("number"!==a||u||(n+=i&&i[3]||(A.cssNumber[o]?"":"px")),m.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),s&&"set"in s&&void 0===(n=s.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,a,s,o=ie(t);return We.test(t)||(t=it(o)),(s=A.cssHooks[t]||A.cssHooks[o])&&"get"in s&&(i=s.get(e,!0,n)),void 0===i&&(i=Je(e,t,r)),"normal"===i&&t in ot&&(i=ot[t]),""===n||n?(a=parseFloat(i),!0===n||isFinite(a)?a||0:i):i}}),A.each(["height","width"],(function(e,t){A.cssHooks[t]={get:function(e,n,r){if(n)return!at.test(A.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?ct(e,t,r):$e(e,st,(function(){return ct(e,t,r)}))},set:function(e,n,r){var i,a=Xe(e),s=!m.scrollboxSize()&&"absolute"===a.position,o=(s||r)&&"border-box"===A.css(e,"boxSizing",!1,a),u=r?lt(e,t,r,o,a):0;return o&&s&&(u-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(a[t])-lt(e,t,"border",!1,a)-.5)),u&&(i=he.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=A.css(e,t)),ut(0,n,u)}}})),A.cssHooks.marginLeft=et(m.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Je(e,"marginLeft"))||e.getBoundingClientRect().left-$e(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),A.each({margin:"",padding:"",border:"Width"},(function(e,t){A.cssHooks[e+t]={expand:function(n){for(var r=0,i={},a="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+pe[r]+t]=a[r]||a[r-2]||a[0];return i}},"margin"!==e&&(A.cssHooks[e+t].set=ut)})),A.fn.extend({css:function(e,t){return ee(this,(function(e,t,n){var r,i,a={},s=0;if(Array.isArray(t)){for(r=Xe(e),i=t.length;s<i;s++)a[t[s]]=A.css(e,t[s],!1,r);return a}return void 0!==n?A.style(e,t,n):A.css(e,t)}),e,t,arguments.length>1)}}),A.Tween=dt,dt.prototype={constructor:dt,init:function(e,t,n,r,i,a){this.elem=e,this.prop=n,this.easing=i||A.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=a||(A.cssNumber[n]?"":"px")},cur:function(){var e=dt.propHooks[this.prop];return e&&e.get?e.get(this):dt.propHooks._default.get(this)},run:function(e){var t,n=dt.propHooks[this.prop];return this.options.duration?this.pos=t=A.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):dt.propHooks._default.set(this),this}},dt.prototype.init.prototype=dt.prototype,dt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=A.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){A.fx.step[e.prop]?A.fx.step[e.prop](e):1!==e.elem.nodeType||!A.cssHooks[e.prop]&&null==e.elem.style[it(e.prop)]?e.elem[e.prop]=e.now:A.style(e.elem,e.prop,e.now+e.unit)}}},dt.propHooks.scrollTop=dt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},A.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},A.fx=dt.prototype.init,A.fx.step={};var ft,ht,pt=/^(?:toggle|show|hide)$/,gt=/queueHooks$/;function mt(){ht&&(!1===_.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(mt):r.setTimeout(mt,A.fx.interval),A.fx.tick())}function yt(){return r.setTimeout((function(){ft=void 0})),ft=Date.now()}function vt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=pe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function _t(e,t,n){for(var r,i=(Tt.tweeners[t]||[]).concat(Tt.tweeners["*"]),a=0,s=i.length;a<s;a++)if(r=i[a].call(n,t,e))return r}function Tt(e,t,n){var r,i,a=0,s=Tt.prefilters.length,o=A.Deferred().always((function(){delete u.elem})),u=function(){if(i)return!1;for(var t=ft||yt(),n=Math.max(0,l.startTime+l.duration-t),r=1-(n/l.duration||0),a=0,s=l.tweens.length;a<s;a++)l.tweens[a].run(r);return o.notifyWith(e,[l,r,n]),r<1&&s?n:(s||o.notifyWith(e,[l,1,0]),o.resolveWith(e,[l]),!1)},l=o.promise({elem:e,props:A.extend({},t),opts:A.extend(!0,{specialEasing:{},easing:A.easing._default},n),originalProperties:t,originalOptions:n,startTime:ft||yt(),duration:n.duration,tweens:[],createTween:function(t,n){var r=A.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)l.tweens[n].run(1);return t?(o.notifyWith(e,[l,1,0]),o.resolveWith(e,[l,t])):o.rejectWith(e,[l,t]),this}}),c=l.props;for(function(e,t){var n,r,i,a,s;for(n in e)if(i=t[r=ie(n)],a=e[n],Array.isArray(a)&&(i=a[1],a=e[n]=a[0]),n!==r&&(e[r]=a,delete e[n]),(s=A.cssHooks[r])&&"expand"in s)for(n in a=s.expand(a),delete e[r],a)n in e||(e[n]=a[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);a<s;a++)if(r=Tt.prefilters[a].call(l,e,c,l.opts))return y(r.stop)&&(A._queueHooks(l.elem,l.opts.queue).stop=r.stop.bind(r)),r;return A.map(c,_t,l),y(l.opts.start)&&l.opts.start.call(e,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),A.fx.timer(A.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l}A.Animation=A.extend(Tt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return _e(n.elem,e,he.exec(t),n),n}]},tweener:function(e,t){y(e)?(t=e,e=["*"]):e=e.match(Z);for(var n,r=0,i=e.length;r<i;r++)n=e[r],Tt.tweeners[n]=Tt.tweeners[n]||[],Tt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,a,s,o,u,l,c,d="width"in t||"height"in t,f=this,h={},p=e.style,g=e.nodeType&&ve(e),m=oe.get(e,"fxshow");for(r in n.queue||(null==(s=A._queueHooks(e,"fx")).unqueued&&(s.unqueued=0,o=s.empty.fire,s.empty.fire=function(){s.unqueued||o()}),s.unqueued++,f.always((function(){f.always((function(){s.unqueued--,A.queue(e,"fx").length||s.empty.fire()}))}))),t)if(i=t[r],pt.test(i)){if(delete t[r],a=a||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!m||void 0===m[r])continue;g=!0}h[r]=m&&m[r]||A.style(e,r)}if((u=!A.isEmptyObject(t))||!A.isEmptyObject(h))for(r in d&&1===e.nodeType&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],null==(l=m&&m.display)&&(l=oe.get(e,"display")),"none"===(c=A.css(e,"display"))&&(l?c=l:(Ee([e],!0),l=e.style.display||l,c=A.css(e,"display"),Ee([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===A.css(e,"float")&&(u||(f.done((function(){p.display=l})),null==l&&(c=p.display,l="none"===c?"":c)),p.display="inline-block")),n.overflow&&(p.overflow="hidden",f.always((function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}))),u=!1,h)u||(m?"hidden"in m&&(g=m.hidden):m=oe.access(e,"fxshow",{display:l}),a&&(m.hidden=!g),g&&Ee([e],!0),f.done((function(){for(r in g||Ee([e]),oe.remove(e,"fxshow"),h)A.style(e,r,h[r])}))),u=_t(g?m[r]:0,r,f),r in m||(m[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?Tt.prefilters.unshift(e):Tt.prefilters.push(e)}}),A.speed=function(e,t,n){var r=e&&"object"==typeof e?A.extend({},e):{complete:n||!n&&t||y(e)&&e,duration:e,easing:n&&t||t&&!y(t)&&t};return A.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in A.fx.speeds?r.duration=A.fx.speeds[r.duration]:r.duration=A.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){y(r.old)&&r.old.call(this),r.queue&&A.dequeue(this,r.queue)},r},A.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ve).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=A.isEmptyObject(e),a=A.speed(t,n,r),s=function(){var t=Tt(this,A.extend({},e),a);(i||oe.get(this,"finish"))&&t.stop(!0)};return s.finish=s,i||!1===a.queue?this.each(s):this.queue(a.queue,s)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each((function(){var t=!0,i=null!=e&&e+"queueHooks",a=A.timers,s=oe.get(this);if(i)s[i]&&s[i].stop&&r(s[i]);else for(i in s)s[i]&&s[i].stop&>.test(i)&&r(s[i]);for(i=a.length;i--;)a[i].elem!==this||null!=e&&a[i].queue!==e||(a[i].anim.stop(n),t=!1,a.splice(i,1));!t&&n||A.dequeue(this,e)}))},finish:function(e){return!1!==e&&(e=e||"fx"),this.each((function(){var t,n=oe.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],a=A.timers,s=r?r.length:0;for(n.finish=!0,A.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=a.length;t--;)a[t].elem===this&&a[t].queue===e&&(a[t].anim.stop(!0),a.splice(t,1));for(t=0;t<s;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish}))}}),A.each(["toggle","show","hide"],(function(e,t){var n=A.fn[t];A.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(vt(t,!0),e,r,i)}})),A.each({slideDown:vt("show"),slideUp:vt("hide"),slideToggle:vt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(e,t){A.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}})),A.timers=[],A.fx.tick=function(){var e,t=0,n=A.timers;for(ft=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||A.fx.stop(),ft=void 0},A.fx.timer=function(e){A.timers.push(e),A.fx.start()},A.fx.interval=13,A.fx.start=function(){ht||(ht=!0,mt())},A.fx.stop=function(){ht=null},A.fx.speeds={slow:600,fast:200,_default:400},A.fn.delay=function(e,t){return e=A.fx&&A.fx.speeds[e]||e,t=t||"fx",this.queue(t,(function(t,n){var i=r.setTimeout(t,e);n.stop=function(){r.clearTimeout(i)}}))},function(){var e=_.createElement("input"),t=_.createElement("select").appendChild(_.createElement("option"));e.type="checkbox",m.checkOn=""!==e.value,m.optSelected=t.selected,(e=_.createElement("input")).value="t",e.type="radio",m.radioValue="t"===e.value}();var bt,Et=A.expr.attrHandle;A.fn.extend({attr:function(e,t){return ee(this,A.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){A.removeAttr(this,e)}))}}),A.extend({attr:function(e,t,n){var r,i,a=e.nodeType;if(3!==a&&8!==a&&2!==a)return void 0===e.getAttribute?A.prop(e,t,n):(1===a&&A.isXMLDoc(e)||(i=A.attrHooks[t.toLowerCase()]||(A.expr.match.bool.test(t)?bt:void 0)),void 0!==n?null===n?void A.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=A.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!m.radioValue&&"radio"===t&&C(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(Z);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),bt={set:function(e,t,n){return!1===t?A.removeAttr(e,n):e.setAttribute(n,n),n}},A.each(A.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=Et[t]||A.find.attr;Et[t]=function(e,t,r){var i,a,s=t.toLowerCase();return r||(a=Et[s],Et[s]=i,i=null!=n(e,t,r)?s:null,Et[s]=a),i}}));var St=/^(?:input|select|textarea|button)$/i,wt=/^(?:a|area)$/i;function At(e){return(e.match(Z)||[]).join(" ")}function It(e){return e.getAttribute&&e.getAttribute("class")||""}function Ct(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(Z)||[]}A.fn.extend({prop:function(e,t){return ee(this,A.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[A.propFix[e]||e]}))}}),A.extend({prop:function(e,t,n){var r,i,a=e.nodeType;if(3!==a&&8!==a&&2!==a)return 1===a&&A.isXMLDoc(e)||(t=A.propFix[t]||t,i=A.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=A.find.attr(e,"tabindex");return t?parseInt(t,10):St.test(e.nodeName)||wt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),m.optSelected||(A.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),A.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){A.propFix[this.toLowerCase()]=this})),A.fn.extend({addClass:function(e){var t,n,r,i,a,s;return y(e)?this.each((function(t){A(this).addClass(e.call(this,t,It(this)))})):(t=Ct(e)).length?this.each((function(){if(r=It(this),n=1===this.nodeType&&" "+At(r)+" "){for(a=0;a<t.length;a++)i=t[a],n.indexOf(" "+i+" ")<0&&(n+=i+" ");s=At(n),r!==s&&this.setAttribute("class",s)}})):this},removeClass:function(e){var t,n,r,i,a,s;return y(e)?this.each((function(t){A(this).removeClass(e.call(this,t,It(this)))})):arguments.length?(t=Ct(e)).length?this.each((function(){if(r=It(this),n=1===this.nodeType&&" "+At(r)+" "){for(a=0;a<t.length;a++)for(i=t[a];n.indexOf(" "+i+" ")>-1;)n=n.replace(" "+i+" "," ");s=At(n),r!==s&&this.setAttribute("class",s)}})):this:this.attr("class","")},toggleClass:function(e,t){var n,r,i,a,s=typeof e,o="string"===s||Array.isArray(e);return y(e)?this.each((function(n){A(this).toggleClass(e.call(this,n,It(this),t),t)})):"boolean"==typeof t&&o?t?this.addClass(e):this.removeClass(e):(n=Ct(e),this.each((function(){if(o)for(a=A(this),i=0;i<n.length;i++)r=n[i],a.hasClass(r)?a.removeClass(r):a.addClass(r);else void 0!==e&&"boolean"!==s||((r=It(this))&&oe.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===e?"":oe.get(this,"__className__")||""))})))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+At(It(n))+" ").indexOf(t)>-1)return!0;return!1}});var Rt=/\r/g;A.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=y(e),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,A(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=A.map(i,(function(e){return null==e?"":e+""}))),(t=A.valHooks[this.type]||A.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=A.valHooks[i.type]||A.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(Rt,""):null==n?"":n:void 0}}),A.extend({valHooks:{option:{get:function(e){var t=A.find.attr(e,"value");return null!=t?t:At(A.text(e))}},select:{get:function(e){var t,n,r,i=e.options,a=e.selectedIndex,s="select-one"===e.type,o=s?null:[],u=s?a+1:i.length;for(r=a<0?u:s?a:0;r<u;r++)if(((n=i[r]).selected||r===a)&&!n.disabled&&(!n.parentNode.disabled||!C(n.parentNode,"optgroup"))){if(t=A(n).val(),s)return t;o.push(t)}return o},set:function(e,t){for(var n,r,i=e.options,a=A.makeArray(t),s=i.length;s--;)((r=i[s]).selected=A.inArray(A.valHooks.option.get(r),a)>-1)&&(n=!0);return n||(e.selectedIndex=-1),a}}}}),A.each(["radio","checkbox"],(function(){A.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=A.inArray(A(e).val(),t)>-1}},m.checkOn||(A.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}));var Dt=r.location,xt={guid:Date.now()},Nt=/\?/;A.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new r.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||A.error("Invalid XML: "+(n?A.map(n.childNodes,(function(e){return e.textContent})).join("\n"):e)),t};var Ot=/^(?:focusinfocus|focusoutblur)$/,Pt=function(e){e.stopPropagation()};A.extend(A.event,{trigger:function(e,t,n,i){var a,s,o,u,l,c,d,f,p=[n||_],g=h.call(e,"type")?e.type:e,m=h.call(e,"namespace")?e.namespace.split("."):[];if(s=f=o=n=n||_,3!==n.nodeType&&8!==n.nodeType&&!Ot.test(g+A.event.triggered)&&(g.indexOf(".")>-1&&(m=g.split("."),g=m.shift(),m.sort()),l=g.indexOf(":")<0&&"on"+g,(e=e[A.expando]?e:new A.Event(g,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=m.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:A.makeArray(t,[e]),d=A.event.special[g]||{},i||!d.trigger||!1!==d.trigger.apply(n,t))){if(!i&&!d.noBubble&&!v(n)){for(u=d.delegateType||g,Ot.test(u+g)||(s=s.parentNode);s;s=s.parentNode)p.push(s),o=s;o===(n.ownerDocument||_)&&p.push(o.defaultView||o.parentWindow||r)}for(a=0;(s=p[a++])&&!e.isPropagationStopped();)f=s,e.type=a>1?u:d.bindType||g,(c=(oe.get(s,"events")||Object.create(null))[e.type]&&oe.get(s,"handle"))&&c.apply(s,t),(c=l&&s[l])&&c.apply&&ae(s)&&(e.result=c.apply(s,t),!1===e.result&&e.preventDefault());return e.type=g,i||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(p.pop(),t)||!ae(n)||l&&y(n[g])&&!v(n)&&((o=n[l])&&(n[l]=null),A.event.triggered=g,e.isPropagationStopped()&&f.addEventListener(g,Pt),n[g](),e.isPropagationStopped()&&f.removeEventListener(g,Pt),A.event.triggered=void 0,o&&(n[l]=o)),e.result}},simulate:function(e,t,n){var r=A.extend(new A.Event,n,{type:e,isSimulated:!0});A.event.trigger(r,null,t)}}),A.fn.extend({trigger:function(e,t){return this.each((function(){A.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return A.event.trigger(e,t,n,!0)}});var Mt=/\[\]$/,kt=/\r?\n/g,Lt=/^(?:submit|button|image|reset|file)$/i,Ft=/^(?:input|select|textarea|keygen)/i;function Ut(e,t,n,r){var i;if(Array.isArray(t))A.each(t,(function(t,i){n||Mt.test(e)?r(e,i):Ut(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)}));else if(n||"object"!==E(t))r(e,t);else for(i in t)Ut(e+"["+i+"]",t[i],n,r)}A.param=function(e,t){var n,r=[],i=function(e,t){var n=y(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!A.isPlainObject(e))A.each(e,(function(){i(this.name,this.value)}));else for(n in e)Ut(n,e[n],t,i);return r.join("&")},A.fn.extend({serialize:function(){return A.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=A.prop(this,"elements");return e?A.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!A(this).is(":disabled")&&Ft.test(this.nodeName)&&!Lt.test(e)&&(this.checked||!Ae.test(e))})).map((function(e,t){var n=A(this).val();return null==n?null:Array.isArray(n)?A.map(n,(function(e){return{name:t.name,value:e.replace(kt,"\r\n")}})):{name:t.name,value:n.replace(kt,"\r\n")}})).get()}});var Bt=/%20/g,jt=/#.*$/,qt=/([?&])_=[^&]*/,Ht=/^(.*?):[ \t]*([^\r\n]*)$/gm,Gt=/^(?:GET|HEAD)$/,Vt=/^\/\//,Yt={},zt={},Zt="*/".concat("*"),Kt=_.createElement("a");function Wt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,a=t.toLowerCase().match(Z)||[];if(y(n))for(;r=a[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Xt(e,t,n,r){var i={},a=e===zt;function s(o){var u;return i[o]=!0,A.each(e[o]||[],(function(e,o){var l=o(t,n,r);return"string"!=typeof l||a||i[l]?a?!(u=l):void 0:(t.dataTypes.unshift(l),s(l),!1)})),u}return s(t.dataTypes[0])||!i["*"]&&s("*")}function $t(e,t){var n,r,i=A.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&A.extend(!0,e,r),e}Kt.href=Dt.href,A.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Dt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Dt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":A.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?$t($t(e,A.ajaxSettings),t):$t(A.ajaxSettings,e)},ajaxPrefilter:Wt(Yt),ajaxTransport:Wt(zt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,i,a,s,o,u,l,c,d,f,h=A.ajaxSetup({},t),p=h.context||h,g=h.context&&(p.nodeType||p.jquery)?A(p):A.event,m=A.Deferred(),y=A.Callbacks("once memory"),v=h.statusCode||{},T={},b={},E="canceled",S={readyState:0,getResponseHeader:function(e){var t;if(l){if(!s)for(s={};t=Ht.exec(a);)s[t[1].toLowerCase()+" "]=(s[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=s[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return l?a:null},setRequestHeader:function(e,t){return null==l&&(e=b[e.toLowerCase()]=b[e.toLowerCase()]||e,T[e]=t),this},overrideMimeType:function(e){return null==l&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(l)S.always(e[S.status]);else for(t in e)v[t]=[v[t],e[t]];return this},abort:function(e){var t=e||E;return n&&n.abort(t),w(0,t),this}};if(m.promise(S),h.url=((e||h.url||Dt.href)+"").replace(Vt,Dt.protocol+"//"),h.type=t.method||t.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(Z)||[""],null==h.crossDomain){u=_.createElement("a");try{u.href=h.url,u.href=u.href,h.crossDomain=Kt.protocol+"//"+Kt.host!=u.protocol+"//"+u.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=A.param(h.data,h.traditional)),Xt(Yt,h,t,S),l)return S;for(d in(c=A.event&&h.global)&&0==A.active++&&A.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Gt.test(h.type),i=h.url.replace(jt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(Bt,"+")):(f=h.url.slice(i.length),h.data&&(h.processData||"string"==typeof h.data)&&(i+=(Nt.test(i)?"&":"?")+h.data,delete h.data),!1===h.cache&&(i=i.replace(qt,"$1"),f=(Nt.test(i)?"&":"?")+"_="+xt.guid+++f),h.url=i+f),h.ifModified&&(A.lastModified[i]&&S.setRequestHeader("If-Modified-Since",A.lastModified[i]),A.etag[i]&&S.setRequestHeader("If-None-Match",A.etag[i])),(h.data&&h.hasContent&&!1!==h.contentType||t.contentType)&&S.setRequestHeader("Content-Type",h.contentType),S.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Zt+"; q=0.01":""):h.accepts["*"]),h.headers)S.setRequestHeader(d,h.headers[d]);if(h.beforeSend&&(!1===h.beforeSend.call(p,S,h)||l))return S.abort();if(E="abort",y.add(h.complete),S.done(h.success),S.fail(h.error),n=Xt(zt,h,t,S)){if(S.readyState=1,c&&g.trigger("ajaxSend",[S,h]),l)return S;h.async&&h.timeout>0&&(o=r.setTimeout((function(){S.abort("timeout")}),h.timeout));try{l=!1,n.send(T,w)}catch(e){if(l)throw e;w(-1,e)}}else w(-1,"No Transport");function w(e,t,s,u){var d,f,_,T,b,E=t;l||(l=!0,o&&r.clearTimeout(o),n=void 0,a=u||"",S.readyState=e>0?4:0,d=e>=200&&e<300||304===e,s&&(T=function(e,t,n){for(var r,i,a,s,o=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in o)if(o[i]&&o[i].test(r)){u.unshift(i);break}if(u[0]in n)a=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){a=i;break}s||(s=i)}a=a||s}if(a)return a!==u[0]&&u.unshift(a),n[a]}(h,S,s)),!d&&A.inArray("script",h.dataTypes)>-1&&A.inArray("json",h.dataTypes)<0&&(h.converters["text script"]=function(){}),T=function(e,t,n,r){var i,a,s,o,u,l={},c=e.dataTypes.slice();if(c[1])for(s in e.converters)l[s.toLowerCase()]=e.converters[s];for(a=c.shift();a;)if(e.responseFields[a]&&(n[e.responseFields[a]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=a,a=c.shift())if("*"===a)a=u;else if("*"!==u&&u!==a){if(!(s=l[u+" "+a]||l["* "+a]))for(i in l)if((o=i.split(" "))[1]===a&&(s=l[u+" "+o[0]]||l["* "+o[0]])){!0===s?s=l[i]:!0!==l[i]&&(a=o[0],c.unshift(o[1]));break}if(!0!==s)if(s&&e.throws)t=s(t);else try{t=s(t)}catch(e){return{state:"parsererror",error:s?e:"No conversion from "+u+" to "+a}}}return{state:"success",data:t}}(h,T,S,d),d?(h.ifModified&&((b=S.getResponseHeader("Last-Modified"))&&(A.lastModified[i]=b),(b=S.getResponseHeader("etag"))&&(A.etag[i]=b)),204===e||"HEAD"===h.type?E="nocontent":304===e?E="notmodified":(E=T.state,f=T.data,d=!(_=T.error))):(_=E,!e&&E||(E="error",e<0&&(e=0))),S.status=e,S.statusText=(t||E)+"",d?m.resolveWith(p,[f,E,S]):m.rejectWith(p,[S,E,_]),S.statusCode(v),v=void 0,c&&g.trigger(d?"ajaxSuccess":"ajaxError",[S,h,d?f:_]),y.fireWith(p,[S,E]),c&&(g.trigger("ajaxComplete",[S,h]),--A.active||A.event.trigger("ajaxStop")))}return S},getJSON:function(e,t,n){return A.get(e,t,n,"json")},getScript:function(e,t){return A.get(e,void 0,t,"script")}}),A.each(["get","post"],(function(e,t){A[t]=function(e,n,r,i){return y(n)&&(i=i||r,r=n,n=void 0),A.ajax(A.extend({url:e,type:t,dataType:i,data:n,success:r},A.isPlainObject(e)&&e))}})),A.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),A._evalUrl=function(e,t,n){return A.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){A.globalEval(e,t,n)}})},A.fn.extend({wrapAll:function(e){var t;return this[0]&&(y(e)&&(e=e.call(this[0])),t=A(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return y(e)?this.each((function(t){A(this).wrapInner(e.call(this,t))})):this.each((function(){var t=A(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=y(e);return this.each((function(n){A(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){A(this).replaceWith(this.childNodes)})),this}}),A.expr.pseudos.hidden=function(e){return!A.expr.pseudos.visible(e)},A.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},A.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(e){}};var Qt={0:200,1223:204},Jt=A.ajaxSettings.xhr();m.cors=!!Jt&&"withCredentials"in Jt,m.ajax=Jt=!!Jt,A.ajaxTransport((function(e){var t,n;if(m.cors||Jt&&!e.crossDomain)return{send:function(i,a){var s,o=e.xhr();if(o.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(s in e.xhrFields)o[s]=e.xhrFields[s];for(s in e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)o.setRequestHeader(s,i[s]);t=function(e){return function(){t&&(t=n=o.onload=o.onerror=o.onabort=o.ontimeout=o.onreadystatechange=null,"abort"===e?o.abort():"error"===e?"number"!=typeof o.status?a(0,"error"):a(o.status,o.statusText):a(Qt[o.status]||o.status,o.statusText,"text"!==(o.responseType||"text")||"string"!=typeof o.responseText?{binary:o.response}:{text:o.responseText},o.getAllResponseHeaders()))}},o.onload=t(),n=o.onerror=o.ontimeout=t("error"),void 0!==o.onabort?o.onabort=n:o.onreadystatechange=function(){4===o.readyState&&r.setTimeout((function(){t&&n()}))},t=t("abort");try{o.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}})),A.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),A.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return A.globalEval(e),e}}}),A.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),A.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=A("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),_.head.appendChild(t[0])},abort:function(){n&&n()}}}));var en,tn=[],nn=/(=)\?(?=&|$)|\?\?/;A.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=tn.pop()||A.expando+"_"+xt.guid++;return this[e]=!0,e}}),A.ajaxPrefilter("json jsonp",(function(e,t,n){var i,a,s,o=!1!==e.jsonp&&(nn.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&nn.test(e.data)&&"data");if(o||"jsonp"===e.dataTypes[0])return i=e.jsonpCallback=y(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,o?e[o]=e[o].replace(nn,"$1"+i):!1!==e.jsonp&&(e.url+=(Nt.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return s||A.error(i+" was not called"),s[0]},e.dataTypes[0]="json",a=r[i],r[i]=function(){s=arguments},n.always((function(){void 0===a?A(r).removeProp(i):r[i]=a,e[i]&&(e.jsonpCallback=t.jsonpCallback,tn.push(i)),s&&y(a)&&a(s[0]),s=a=void 0})),"script"})),m.createHTMLDocument=((en=_.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===en.childNodes.length),A.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(m.createHTMLDocument?((r=(t=_.implementation.createHTMLDocument("")).createElement("base")).href=_.location.href,t.head.appendChild(r)):t=_),a=!n&&[],(i=j.exec(e))?[t.createElement(i[1])]:(i=Oe([e],t,a),a&&a.length&&A(a).remove(),A.merge([],i.childNodes)));var r,i,a},A.fn.load=function(e,t,n){var r,i,a,s=this,o=e.indexOf(" ");return o>-1&&(r=At(e.slice(o)),e=e.slice(0,o)),y(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),s.length>0&&A.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done((function(e){a=arguments,s.html(r?A("<div>").append(A.parseHTML(e)).find(r):e)})).always(n&&function(e,t){s.each((function(){n.apply(this,a||[e.responseText,t,e])}))}),this},A.expr.pseudos.animated=function(e){return A.grep(A.timers,(function(t){return e===t.elem})).length},A.offset={setOffset:function(e,t,n){var r,i,a,s,o,u,l=A.css(e,"position"),c=A(e),d={};"static"===l&&(e.style.position="relative"),o=c.offset(),a=A.css(e,"top"),u=A.css(e,"left"),("absolute"===l||"fixed"===l)&&(a+u).indexOf("auto")>-1?(s=(r=c.position()).top,i=r.left):(s=parseFloat(a)||0,i=parseFloat(u)||0),y(t)&&(t=t.call(e,n,A.extend({},o))),null!=t.top&&(d.top=t.top-o.top+s),null!=t.left&&(d.left=t.left-o.left+i),"using"in t?t.using.call(e,d):c.css(d)}},A.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){A.offset.setOffset(this,e,t)}));var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===A.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===A.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=A(e).offset()).top+=A.css(e,"borderTopWidth",!0),i.left+=A.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-A.css(r,"marginTop",!0),left:t.left-i.left-A.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===A.css(e,"position");)e=e.offsetParent;return e||ge}))}}),A.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n="pageYOffset"===t;A.fn[e]=function(r){return ee(this,(function(e,r,i){var a;if(v(e)?a=e:9===e.nodeType&&(a=e.defaultView),void 0===i)return a?a[t]:e[r];a?a.scrollTo(n?a.pageXOffset:i,n?i:a.pageYOffset):e[r]=i}),e,r,arguments.length)}})),A.each(["top","left"],(function(e,t){A.cssHooks[t]=et(m.pixelPosition,(function(e,n){if(n)return n=Je(e,t),Ke.test(n)?A(e).position()[t]+"px":n}))})),A.each({Height:"height",Width:"width"},(function(e,t){A.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,r){A.fn[r]=function(i,a){var s=arguments.length&&(n||"boolean"!=typeof i),o=n||(!0===i||!0===a?"margin":"border");return ee(this,(function(t,n,i){var a;return v(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(a=t.documentElement,Math.max(t.body["scroll"+e],a["scroll"+e],t.body["offset"+e],a["offset"+e],a["client"+e])):void 0===i?A.css(t,n,o):A.style(t,n,i,o)}),t,s?i:void 0,s)}}))})),A.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){A.fn[t]=function(e){return this.on(t,e)}})),A.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),A.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(e,t){A.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}));var rn=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;A.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),y(e))return r=o.call(arguments,2),i=function(){return e.apply(t||this,r.concat(o.call(arguments)))},i.guid=e.guid=e.guid||A.guid++,i},A.holdReady=function(e){e?A.readyWait++:A.ready(!0)},A.isArray=Array.isArray,A.parseJSON=JSON.parse,A.nodeName=C,A.isFunction=y,A.isWindow=v,A.camelCase=ie,A.type=E,A.now=Date.now,A.isNumeric=function(e){var t=A.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},A.trim=function(e){return null==e?"":(e+"").replace(rn,"$1")},void 0===(n=function(){return A}.apply(t,[]))||(e.exports=n);var an=r.jQuery,sn=r.$;return A.noConflict=function(e){return r.$===A&&(r.$=sn),e&&r.jQuery===A&&(r.jQuery=an),A},void 0===i&&(r.jQuery=r.$=A),A}))},7537:(e,t)=>{function n(e){if(e&&"object"==typeof e){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if("number"==typeof e)return s[e];var n,a=String(e);return(n=r[a.toLowerCase()])?n:(n=i[a.toLowerCase()])||(1===a.length?a.charCodeAt(0):void 0)}n.isEventKey=function(e,t){if(e&&"object"==typeof e){var n=e.which||e.keyCode||e.charCode;if(null==n)return!1;if("string"==typeof t){var a;if(a=r[t.toLowerCase()])return a===n;if(a=i[t.toLowerCase()])return a===n}else if("number"==typeof t)return t===n;return!1}};var r=(t=e.exports=n).code=t.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},i=t.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(a=97;a<123;a++)r[String.fromCharCode(a)]=a-32;for(var a=48;a<58;a++)r[a-48]=a;for(a=1;a<13;a++)r["f"+a]=a+111;for(a=0;a<10;a++)r["numpad "+a]=a+96;var s=t.names=t.title={};for(a in r)s[r[a]]=a;for(var o in i)r[o]=i[o]},4221:(e,t,n)=>{var r=n(6894).getUint64;e.exports=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},i=12;0===n.version?(n.earliestPresentationTime=t.getUint32(i),n.firstOffset=t.getUint32(i+4),i+=8):(n.earliestPresentationTime=r(e.subarray(i)),n.firstOffset=r(e.subarray(i+8)),i+=16),i+=2;var a=t.getUint16(i);for(i+=2;a>0;i+=12,a--)n.references.push({referenceType:(128&e[i])>>>7,referencedSize:2147483647&t.getUint32(i),subsegmentDuration:t.getUint32(i+4),startsWithSap:!!(128&e[i+8]),sapType:(112&e[i+8])>>>4,sapDeltaTime:268435455&t.getUint32(i+8)});return n}},1489:e=>{var t,n,r,i,a,s,o,u=9e4;t=function(e){return e*u},n=function(e,t){return e*t},r=function(e){return e/u},i=function(e,t){return e/t},a=function(e,n){return t(i(e,n))},s=function(e,t){return n(r(e),t)},o=function(e,t,n){return r(n?e:e-t)},e.exports={ONE_SECOND_IN_TS:u,secondsToVideoTs:t,secondsToAudioTs:n,videoTsToSeconds:r,audioTsToSeconds:i,audioTsToVideoTs:a,videoTsToAudioTs:s,metadataTsToSeconds:o}},6894:e=>{var t=Math.pow(2,32);e.exports={getUint64:function(e){var n,r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getBigUint64?(n=r.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(n):n:r.getUint32(0)*t+r.getUint32(4)},MAX_UINT32:t}},7079:e=>{window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){var r,i;r=[n(2)],void 0===(i=function(e){function t(r){if(t.is(r,"function"))return n?r():e.on("raphael.DOMload",r);if(t.is(r,x))return t._engine.create[h](t,r.splice(0,3+t.is(r[0],D))).add(r);var i=Array.prototype.slice.call(arguments,0);if(t.is(i[i.length-1],"function")){var a=i.pop();return n?a.call(t._engine.create[h](t,i)):e.on("raphael.DOMload",(function(){a.call(t._engine.create[h](t,i))}))}return t._engine.create[h](t,arguments)}t.version="2.3.0",t.eve=e;var n,r,i,a,s=/[, ]+/,o={circle:1,rect:1,path:1,ellipse:1,text:1,image:1},u=/\{(\d+)\}/g,l="hasOwnProperty",c={doc:document,win:window},d={was:Object.prototype[l].call(c.win,"Raphael"),is:c.win.Raphael},f=function(){this.ca=this.customAttributes={}},h="apply",p="concat",g="ontouchstart"in window||window.TouchEvent||window.DocumentTouch&&document instanceof DocumentTouch,m="",y=" ",v=String,_="split",T="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel"[_](y),b={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},E=v.prototype.toLowerCase,S=Math,w=S.max,A=S.min,I=S.abs,C=S.pow,R=S.PI,D="number",x="array",N=Object.prototype.toString,O=(t._ISURL=/^url\(['"]?(.+?)['"]?\)$/i,/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i),P={NaN:1,Infinity:1,"-Infinity":1},M=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,k=S.round,L=parseFloat,F=parseInt,U=v.prototype.toUpperCase,B=t._availableAttrs={"arrow-end":"none","arrow-start":"none",blur:0,"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/","letter-spacing":0,opacity:1,path:"M0,0",r:0,rx:0,ry:0,src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",transform:"",width:0,x:0,y:0,class:""},j=t._availableAnimAttrs={blur:D,"clip-rect":"csv",cx:D,cy:D,fill:"colour","fill-opacity":D,"font-size":D,height:D,opacity:D,path:"path",r:D,rx:D,ry:D,stroke:"colour","stroke-opacity":D,"stroke-width":D,transform:"transform",width:D,x:D,y:D},q=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/,H={hs:1,rg:1},G=/,?([achlmqrstvxz]),?/gi,V=/([achlmrqstvz])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,Y=/([rstm])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,z=/(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/gi,Z=(t._radial_gradient=/^r(?:\(([^,]+?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*([^\)]+?)\))?/,{}),K=function(e,t){return L(e)-L(t)},W=function(e){return e},X=t._rectPath=function(e,t,n,r,i){return i?[["M",e+i,t],["l",n-2*i,0],["a",i,i,0,0,1,i,i],["l",0,r-2*i],["a",i,i,0,0,1,-i,i],["l",2*i-n,0],["a",i,i,0,0,1,-i,-i],["l",0,2*i-r],["a",i,i,0,0,1,i,-i],["z"]]:[["M",e,t],["l",n,0],["l",0,r],["l",-n,0],["z"]]},$=function(e,t,n,r){return null==r&&(r=n),[["M",e,t],["m",0,-r],["a",n,r,0,1,1,0,2*r],["a",n,r,0,1,1,0,-2*r],["z"]]},Q=t._getPath={path:function(e){return e.attr("path")},circle:function(e){var t=e.attrs;return $(t.cx,t.cy,t.r)},ellipse:function(e){var t=e.attrs;return $(t.cx,t.cy,t.rx,t.ry)},rect:function(e){var t=e.attrs;return X(t.x,t.y,t.width,t.height,t.r)},image:function(e){var t=e.attrs;return X(t.x,t.y,t.width,t.height)},text:function(e){var t=e._getBBox();return X(t.x,t.y,t.width,t.height)},set:function(e){var t=e._getBBox();return X(t.x,t.y,t.width,t.height)}},J=t.mapPath=function(e,t){if(!t)return e;var n,r,i,a,s,o,u;for(i=0,s=(e=Ce(e)).length;i<s;i++)for(a=1,o=(u=e[i]).length;a<o;a+=2)n=t.x(u[a],u[a+1]),r=t.y(u[a],u[a+1]),u[a]=n,u[a+1]=r;return e};if(t._g=c,t.type=c.win.SVGAngle||c.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML","VML"==t.type){var ee,te=c.doc.createElement("div");if(te.innerHTML='<v:shape adj="1"/>',(ee=te.firstChild).style.behavior="url(#default#VML)",!ee||"object"!=typeof ee.adj)return t.type=m;te=null}function ne(e){if("function"==typeof e||Object(e)!==e)return e;var t=new e.constructor;for(var n in e)e[l](n)&&(t[n]=ne(e[n]));return t}t.svg=!(t.vml="VML"==t.type),t._Paper=f,t.fn=r=f.prototype=t.prototype,t._id=0,t.is=function(e,t){return"finite"==(t=E.call(t))?!P[l](+e):"array"==t?e instanceof Array:"null"==t&&null===e||t==typeof e&&null!==e||"object"==t&&e===Object(e)||"array"==t&&Array.isArray&&Array.isArray(e)||N.call(e).slice(8,-1).toLowerCase()==t},t.angle=function(e,n,r,i,a,s){if(null==a){var o=e-r,u=n-i;return o||u?(180+180*S.atan2(-u,-o)/R+360)%360:0}return t.angle(e,n,a,s)-t.angle(r,i,a,s)},t.rad=function(e){return e%360*R/180},t.deg=function(e){return Math.round(180*e/R%360*1e3)/1e3},t.snapTo=function(e,n,r){if(r=t.is(r,"finite")?r:10,t.is(e,x)){for(var i=e.length;i--;)if(I(e[i]-n)<=r)return e[i]}else{var a=n%(e=+e);if(a<r)return n-a;if(a>e-r)return n-a+e}return n},t.createUUID=(i=/[xy]/g,a=function(e){var t=16*S.random()|0;return("x"==e?t:3&t|8).toString(16)},function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(i,a).toUpperCase()}),t.setWindow=function(n){e("raphael.setWindow",t,c.win,n),c.win=n,c.doc=c.win.document,t._engine.initWin&&t._engine.initWin(c.win)};var re=function(e){if(t.vml){var n,r=/^\s+|\s+$/g;try{var i=new ActiveXObject("htmlfile");i.write("<body>"),i.close(),n=i.body}catch(e){n=createPopup().document.body}var a=n.createTextRange();re=le((function(e){try{n.style.color=v(e).replace(r,m);var t=a.queryCommandValue("ForeColor");return"#"+("000000"+(t=(255&t)<<16|65280&t|(16711680&t)>>>16).toString(16)).slice(-6)}catch(e){return"none"}}))}else{var s=c.doc.createElement("i");s.title="Raphaël Colour Picker",s.style.display="none",c.doc.body.appendChild(s),re=le((function(e){return s.style.color=e,c.doc.defaultView.getComputedStyle(s,m).getPropertyValue("color")}))}return re(e)},ie=function(){return"hsb("+[this.h,this.s,this.b]+")"},ae=function(){return"hsl("+[this.h,this.s,this.l]+")"},se=function(){return this.hex},oe=function(e,n,r){if(null==n&&t.is(e,"object")&&"r"in e&&"g"in e&&"b"in e&&(r=e.b,n=e.g,e=e.r),null==n&&t.is(e,"string")){var i=t.getRGB(e);e=i.r,n=i.g,r=i.b}return(e>1||n>1||r>1)&&(e/=255,n/=255,r/=255),[e,n,r]},ue=function(e,n,r,i){var a={r:e*=255,g:n*=255,b:r*=255,hex:t.rgb(e,n,r),toString:se};return t.is(i,"finite")&&(a.opacity=i),a};function le(e,t,n){return function r(){var i=Array.prototype.slice.call(arguments,0),a=i.join("␀"),s=r.cache=r.cache||{},o=r.count=r.count||[];return s[l](a)?(function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return e.push(e.splice(n,1)[0])}(o,a),n?n(s[a]):s[a]):(o.length>=1e3&&delete s[o.shift()],o.push(a),s[a]=e[h](t,i),n?n(s[a]):s[a])}}function ce(){return this.hex}function de(e,t){for(var n=[],r=0,i=e.length;i-2*!t>r;r+=2){var a=[{x:+e[r-2],y:+e[r-1]},{x:+e[r],y:+e[r+1]},{x:+e[r+2],y:+e[r+3]},{x:+e[r+4],y:+e[r+5]}];t?r?i-4==r?a[3]={x:+e[0],y:+e[1]}:i-2==r&&(a[2]={x:+e[0],y:+e[1]},a[3]={x:+e[2],y:+e[3]}):a[0]={x:+e[i-2],y:+e[i-1]}:i-4==r?a[3]=a[2]:r||(a[0]={x:+e[r],y:+e[r+1]}),n.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return n}t.color=function(e){var n;return t.is(e,"object")&&"h"in e&&"s"in e&&"b"in e?(n=t.hsb2rgb(e),e.r=n.r,e.g=n.g,e.b=n.b,e.hex=n.hex):t.is(e,"object")&&"h"in e&&"s"in e&&"l"in e?(n=t.hsl2rgb(e),e.r=n.r,e.g=n.g,e.b=n.b,e.hex=n.hex):(t.is(e,"string")&&(e=t.getRGB(e)),t.is(e,"object")&&"r"in e&&"g"in e&&"b"in e?(n=t.rgb2hsl(e),e.h=n.h,e.s=n.s,e.l=n.l,n=t.rgb2hsb(e),e.v=n.b):(e={hex:"none"}).r=e.g=e.b=e.h=e.s=e.v=e.l=-1),e.toString=se,e},t.hsb2rgb=function(e,t,n,r){var i,a,s,o,u;return this.is(e,"object")&&"h"in e&&"s"in e&&"b"in e&&(n=e.b,t=e.s,r=e.o,e=e.h),o=(u=n*t)*(1-I((e=(e*=360)%360/60)%2-1)),i=a=s=n-u,ue(i+=[u,o,0,0,o,u][e=~~e],a+=[o,u,u,o,0,0][e],s+=[0,0,o,u,u,o][e],r)},t.hsl2rgb=function(e,t,n,r){var i,a,s,o,u;return this.is(e,"object")&&"h"in e&&"s"in e&&"l"in e&&(n=e.l,t=e.s,e=e.h),(e>1||t>1||n>1)&&(e/=360,t/=100,n/=100),o=(u=2*t*(n<.5?n:1-n))*(1-I((e=(e*=360)%360/60)%2-1)),i=a=s=n-u/2,ue(i+=[u,o,0,0,o,u][e=~~e],a+=[o,u,u,o,0,0][e],s+=[0,0,o,u,u,o][e],r)},t.rgb2hsb=function(e,t,n){var r,i;return e=(n=oe(e,t,n))[0],t=n[1],n=n[2],{h:((0==(i=(r=w(e,t,n))-A(e,t,n))?null:r==e?(t-n)/i:r==t?(n-e)/i+2:(e-t)/i+4)+360)%6*60/360,s:0==i?0:i/r,b:r,toString:ie}},t.rgb2hsl=function(e,t,n){var r,i,a,s;return e=(n=oe(e,t,n))[0],t=n[1],n=n[2],r=((i=w(e,t,n))+(a=A(e,t,n)))/2,{h:((0==(s=i-a)?null:i==e?(t-n)/s:i==t?(n-e)/s+2:(e-t)/s+4)+360)%6*60/360,s:0==s?0:r<.5?s/(2*r):s/(2-2*r),l:r,toString:ae}},t._path2string=function(){return this.join(",").replace(G,"$1")},t._preload=function(e,t){var n=c.doc.createElement("img");n.style.cssText="position:absolute;left:-9999em;top:-9999em",n.onload=function(){t.call(this),this.onload=null,c.doc.body.removeChild(this)},n.onerror=function(){c.doc.body.removeChild(this)},c.doc.body.appendChild(n),n.src=e},t.getRGB=le((function(e){if(!e||(e=v(e)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:ce};if("none"==e)return{r:-1,g:-1,b:-1,hex:"none",toString:ce};!H[l](e.toLowerCase().substring(0,2))&&"#"!=e.charAt()&&(e=re(e));var n,r,i,a,s,o,u=e.match(O);return u?(u[2]&&(i=F(u[2].substring(5),16),r=F(u[2].substring(3,5),16),n=F(u[2].substring(1,3),16)),u[3]&&(i=F((s=u[3].charAt(3))+s,16),r=F((s=u[3].charAt(2))+s,16),n=F((s=u[3].charAt(1))+s,16)),u[4]&&(o=u[4][_](q),n=L(o[0]),"%"==o[0].slice(-1)&&(n*=2.55),r=L(o[1]),"%"==o[1].slice(-1)&&(r*=2.55),i=L(o[2]),"%"==o[2].slice(-1)&&(i*=2.55),"rgba"==u[1].toLowerCase().slice(0,4)&&(a=L(o[3])),o[3]&&"%"==o[3].slice(-1)&&(a/=100)),u[5]?(o=u[5][_](q),n=L(o[0]),"%"==o[0].slice(-1)&&(n*=2.55),r=L(o[1]),"%"==o[1].slice(-1)&&(r*=2.55),i=L(o[2]),"%"==o[2].slice(-1)&&(i*=2.55),("deg"==o[0].slice(-3)||"°"==o[0].slice(-1))&&(n/=360),"hsba"==u[1].toLowerCase().slice(0,4)&&(a=L(o[3])),o[3]&&"%"==o[3].slice(-1)&&(a/=100),t.hsb2rgb(n,r,i,a)):u[6]?(o=u[6][_](q),n=L(o[0]),"%"==o[0].slice(-1)&&(n*=2.55),r=L(o[1]),"%"==o[1].slice(-1)&&(r*=2.55),i=L(o[2]),"%"==o[2].slice(-1)&&(i*=2.55),("deg"==o[0].slice(-3)||"°"==o[0].slice(-1))&&(n/=360),"hsla"==u[1].toLowerCase().slice(0,4)&&(a=L(o[3])),o[3]&&"%"==o[3].slice(-1)&&(a/=100),t.hsl2rgb(n,r,i,a)):((u={r:n,g:r,b:i,toString:ce}).hex="#"+(16777216|i|r<<8|n<<16).toString(16).slice(1),t.is(a,"finite")&&(u.opacity=a),u)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:ce}}),t),t.hsb=le((function(e,n,r){return t.hsb2rgb(e,n,r).hex})),t.hsl=le((function(e,n,r){return t.hsl2rgb(e,n,r).hex})),t.rgb=le((function(e,t,n){function r(e){return e+.5|0}return"#"+(16777216|r(n)|r(t)<<8|r(e)<<16).toString(16).slice(1)})),t.getColor=function(e){var t=this.getColor.start=this.getColor.start||{h:0,s:1,b:e||.75},n=this.hsb2rgb(t.h,t.s,t.b);return t.h+=.075,t.h>1&&(t.h=0,t.s-=.2,t.s<=0&&(this.getColor.start={h:0,s:1,b:t.b})),n.hex},t.getColor.reset=function(){delete this.start},t.parsePathString=function(e){if(!e)return null;var n=fe(e);if(n.arr)return _e(n.arr);var r={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},i=[];return t.is(e,x)&&t.is(e[0],x)&&(i=_e(e)),i.length||v(e).replace(V,(function(e,t,n){var a=[],s=t.toLowerCase();if(n.replace(z,(function(e,t){t&&a.push(+t)})),"m"==s&&a.length>2&&(i.push([t][p](a.splice(0,2))),s="l",t="m"==t?"l":"L"),"r"==s)i.push([t][p](a));else for(;a.length>=r[s]&&(i.push([t][p](a.splice(0,r[s]))),r[s]););})),i.toString=t._path2string,n.arr=_e(i),i},t.parseTransformString=le((function(e){if(!e)return null;var n=[];return t.is(e,x)&&t.is(e[0],x)&&(n=_e(e)),n.length||v(e).replace(Y,(function(e,t,r){var i=[];E.call(t),r.replace(z,(function(e,t){t&&i.push(+t)})),n.push([t][p](i))})),n.toString=t._path2string,n}),this,(function(e){if(!e)return e;for(var t=[],n=0;n<e.length;n++){for(var r=[],i=0;i<e[n].length;i++)r.push(e[n][i]);t.push(r)}return t}));var fe=function(e){var t=fe.ps=fe.ps||{};return t[e]?t[e].sleep=100:t[e]={sleep:100},setTimeout((function(){for(var n in t)t[l](n)&&n!=e&&(t[n].sleep--,!t[n].sleep&&delete t[n])})),t[e]};function he(e,t,n,r,i){return e*(e*(-3*t+9*n-9*r+3*i)+6*t-12*n+6*r)-3*t+3*n}function pe(e,t,n,r,i,a,s,o,u){null==u&&(u=1);for(var l=(u=u>1?1:u<0?0:u)/2,c=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],f=0,h=0;h<12;h++){var p=l*c[h]+l,g=he(p,e,n,i,s),m=he(p,t,r,a,o),y=g*g+m*m;f+=d[h]*S.sqrt(y)}return l*f}function ge(e,t,n,r,i,a,s,o){if(!(w(e,n)<A(i,s)||A(e,n)>w(i,s)||w(t,r)<A(a,o)||A(t,r)>w(a,o))){var u=(e-n)*(a-o)-(t-r)*(i-s);if(u){var l=((e*r-t*n)*(i-s)-(e-n)*(i*o-a*s))/u,c=((e*r-t*n)*(a-o)-(t-r)*(i*o-a*s))/u,d=+l.toFixed(2),f=+c.toFixed(2);if(!(d<+A(e,n).toFixed(2)||d>+w(e,n).toFixed(2)||d<+A(i,s).toFixed(2)||d>+w(i,s).toFixed(2)||f<+A(t,r).toFixed(2)||f>+w(t,r).toFixed(2)||f<+A(a,o).toFixed(2)||f>+w(a,o).toFixed(2)))return{x:l,y:c}}}}function me(e,n,r){var i=t.bezierBBox(e),a=t.bezierBBox(n);if(!t.isBBoxIntersect(i,a))return r?0:[];for(var s=pe.apply(0,e),o=pe.apply(0,n),u=w(~~(s/5),1),l=w(~~(o/5),1),c=[],d=[],f={},h=r?0:[],p=0;p<u+1;p++){var g=t.findDotsAtSegment.apply(t,e.concat(p/u));c.push({x:g.x,y:g.y,t:p/u})}for(p=0;p<l+1;p++)g=t.findDotsAtSegment.apply(t,n.concat(p/l)),d.push({x:g.x,y:g.y,t:p/l});for(p=0;p<u;p++)for(var m=0;m<l;m++){var y=c[p],v=c[p+1],_=d[m],T=d[m+1],b=I(v.x-y.x)<.001?"y":"x",E=I(T.x-_.x)<.001?"y":"x",S=ge(y.x,y.y,v.x,v.y,_.x,_.y,T.x,T.y);if(S){if(f[S.x.toFixed(4)]==S.y.toFixed(4))continue;f[S.x.toFixed(4)]=S.y.toFixed(4);var C=y.t+I((S[b]-y[b])/(v[b]-y[b]))*(v.t-y.t),R=_.t+I((S[E]-_[E])/(T[E]-_[E]))*(T.t-_.t);C>=0&&C<=1.001&&R>=0&&R<=1.001&&(r?h++:h.push({x:S.x,y:S.y,t1:A(C,1),t2:A(R,1)}))}}return h}function ye(e,n,r){e=t._path2curve(e),n=t._path2curve(n);for(var i,a,s,o,u,l,c,d,f,h,p=r?0:[],g=0,m=e.length;g<m;g++){var y=e[g];if("M"==y[0])i=u=y[1],a=l=y[2];else{"C"==y[0]?(f=[i,a].concat(y.slice(1)),i=f[6],a=f[7]):(f=[i,a,i,a,u,l,u,l],i=u,a=l);for(var v=0,_=n.length;v<_;v++){var T=n[v];if("M"==T[0])s=c=T[1],o=d=T[2];else{"C"==T[0]?(h=[s,o].concat(T.slice(1)),s=h[6],o=h[7]):(h=[s,o,s,o,c,d,c,d],s=c,o=d);var b=me(f,h,r);if(r)p+=b;else{for(var E=0,S=b.length;E<S;E++)b[E].segment1=g,b[E].segment2=v,b[E].bez1=f,b[E].bez2=h;p=p.concat(b)}}}}}return p}t.findDotsAtSegment=function(e,t,n,r,i,a,s,o,u){var l=1-u,c=C(l,3),d=C(l,2),f=u*u,h=f*u,p=c*e+3*d*u*n+3*l*u*u*i+h*s,g=c*t+3*d*u*r+3*l*u*u*a+h*o,m=e+2*u*(n-e)+f*(i-2*n+e),y=t+2*u*(r-t)+f*(a-2*r+t),v=n+2*u*(i-n)+f*(s-2*i+n),_=r+2*u*(a-r)+f*(o-2*a+r),T=l*e+u*n,b=l*t+u*r,E=l*i+u*s,w=l*a+u*o,A=90-180*S.atan2(m-v,y-_)/R;return(m>v||y<_)&&(A+=180),{x:p,y:g,m:{x:m,y},n:{x:v,y:_},start:{x:T,y:b},end:{x:E,y:w},alpha:A}},t.bezierBBox=function(e,n,r,i,a,s,o,u){t.is(e,"array")||(e=[e,n,r,i,a,s,o,u]);var l=Ie.apply(null,e);return{x:l.min.x,y:l.min.y,x2:l.max.x,y2:l.max.y,width:l.max.x-l.min.x,height:l.max.y-l.min.y}},t.isPointInsideBBox=function(e,t,n){return t>=e.x&&t<=e.x2&&n>=e.y&&n<=e.y2},t.isBBoxIntersect=function(e,n){var r=t.isPointInsideBBox;return r(n,e.x,e.y)||r(n,e.x2,e.y)||r(n,e.x,e.y2)||r(n,e.x2,e.y2)||r(e,n.x,n.y)||r(e,n.x2,n.y)||r(e,n.x,n.y2)||r(e,n.x2,n.y2)||(e.x<n.x2&&e.x>n.x||n.x<e.x2&&n.x>e.x)&&(e.y<n.y2&&e.y>n.y||n.y<e.y2&&n.y>e.y)},t.pathIntersection=function(e,t){return ye(e,t)},t.pathIntersectionNumber=function(e,t){return ye(e,t,1)},t.isPointInsidePath=function(e,n,r){var i=t.pathBBox(e);return t.isPointInsideBBox(i,n,r)&&ye(e,[["M",n,r],["H",i.x2+10]],1)%2==1},t._removedFactory=function(t){return function(){e("raphael.log",null,"Raphaël: you are calling to method “"+t+"” of removed object",t)}};var ve=t.pathBBox=function(e){var t=fe(e);if(t.bbox)return ne(t.bbox);if(!e)return{x:0,y:0,width:0,height:0,x2:0,y2:0};for(var n,r=0,i=0,a=[],s=[],o=0,u=(e=Ce(e)).length;o<u;o++)if("M"==(n=e[o])[0])r=n[1],i=n[2],a.push(r),s.push(i);else{var l=Ie(r,i,n[1],n[2],n[3],n[4],n[5],n[6]);a=a[p](l.min.x,l.max.x),s=s[p](l.min.y,l.max.y),r=n[5],i=n[6]}var c=A[h](0,a),d=A[h](0,s),f=w[h](0,a),g=w[h](0,s),m=f-c,y=g-d,v={x:c,y:d,x2:f,y2:g,width:m,height:y,cx:c+m/2,cy:d+y/2};return t.bbox=ne(v),v},_e=function(e){var n=ne(e);return n.toString=t._path2string,n},Te=t._pathToRelative=function(e){var n=fe(e);if(n.rel)return _e(n.rel);t.is(e,x)&&t.is(e&&e[0],x)||(e=t.parsePathString(e));var r=[],i=0,a=0,s=0,o=0,u=0;"M"==e[0][0]&&(s=i=e[0][1],o=a=e[0][2],u++,r.push(["M",i,a]));for(var l=u,c=e.length;l<c;l++){var d=r[l]=[],f=e[l];if(f[0]!=E.call(f[0]))switch(d[0]=E.call(f[0]),d[0]){case"a":d[1]=f[1],d[2]=f[2],d[3]=f[3],d[4]=f[4],d[5]=f[5],d[6]=+(f[6]-i).toFixed(3),d[7]=+(f[7]-a).toFixed(3);break;case"v":d[1]=+(f[1]-a).toFixed(3);break;case"m":s=f[1],o=f[2];default:for(var h=1,p=f.length;h<p;h++)d[h]=+(f[h]-(h%2?i:a)).toFixed(3)}else{d=r[l]=[],"m"==f[0]&&(s=f[1]+i,o=f[2]+a);for(var g=0,m=f.length;g<m;g++)r[l][g]=f[g]}var y=r[l].length;switch(r[l][0]){case"z":i=s,a=o;break;case"h":i+=+r[l][y-1];break;case"v":a+=+r[l][y-1];break;default:i+=+r[l][y-2],a+=+r[l][y-1]}}return r.toString=t._path2string,n.rel=_e(r),r},be=t._pathToAbsolute=function(e){var n=fe(e);if(n.abs)return _e(n.abs);if(t.is(e,x)&&t.is(e&&e[0],x)||(e=t.parsePathString(e)),!e||!e.length)return[["M",0,0]];var r=[],i=0,a=0,s=0,o=0,u=0;"M"==e[0][0]&&(s=i=+e[0][1],o=a=+e[0][2],u++,r[0]=["M",i,a]);for(var l,c,d=3==e.length&&"M"==e[0][0]&&"R"==e[1][0].toUpperCase()&&"Z"==e[2][0].toUpperCase(),f=u,h=e.length;f<h;f++){if(r.push(l=[]),(c=e[f])[0]!=U.call(c[0]))switch(l[0]=U.call(c[0]),l[0]){case"A":l[1]=c[1],l[2]=c[2],l[3]=c[3],l[4]=c[4],l[5]=c[5],l[6]=+(c[6]+i),l[7]=+(c[7]+a);break;case"V":l[1]=+c[1]+a;break;case"H":l[1]=+c[1]+i;break;case"R":for(var g=[i,a][p](c.slice(1)),m=2,y=g.length;m<y;m++)g[m]=+g[m]+i,g[++m]=+g[m]+a;r.pop(),r=r[p](de(g,d));break;case"M":s=+c[1]+i,o=+c[2]+a;default:for(m=1,y=c.length;m<y;m++)l[m]=+c[m]+(m%2?i:a)}else if("R"==c[0])g=[i,a][p](c.slice(1)),r.pop(),r=r[p](de(g,d)),l=["R"][p](c.slice(-2));else for(var v=0,_=c.length;v<_;v++)l[v]=c[v];switch(l[0]){case"Z":i=s,a=o;break;case"H":i=l[1];break;case"V":a=l[1];break;case"M":s=l[l.length-2],o=l[l.length-1];default:i=l[l.length-2],a=l[l.length-1]}}return r.toString=t._path2string,n.abs=_e(r),r},Ee=function(e,t,n,r){return[e,t,n,r,n,r]},Se=function(e,t,n,r,i,a){return[1/3*e+2/3*n,1/3*t+2/3*r,1/3*i+2/3*n,1/3*a+2/3*r,i,a]},we=function(e,t,n,r,i,a,s,o,u,l){var c,d=120*R/180,f=R/180*(+i||0),h=[],g=le((function(e,t,n){return{x:e*S.cos(n)-t*S.sin(n),y:e*S.sin(n)+t*S.cos(n)}}));if(l)C=l[0],D=l[1],w=l[2],A=l[3];else{e=(c=g(e,t,-f)).x,t=c.y,o=(c=g(o,u,-f)).x,u=c.y,S.cos(R/180*i),S.sin(R/180*i);var m=(e-o)/2,y=(t-u)/2,v=m*m/(n*n)+y*y/(r*r);v>1&&(n*=v=S.sqrt(v),r*=v);var T=n*n,b=r*r,E=(a==s?-1:1)*S.sqrt(I((T*b-T*y*y-b*m*m)/(T*y*y+b*m*m))),w=E*n*y/r+(e+o)/2,A=E*-r*m/n+(t+u)/2,C=S.asin(((t-A)/r).toFixed(9)),D=S.asin(((u-A)/r).toFixed(9));(C=e<w?R-C:C)<0&&(C=2*R+C),(D=o<w?R-D:D)<0&&(D=2*R+D),s&&C>D&&(C-=2*R),!s&&D>C&&(D-=2*R)}var x=D-C;if(I(x)>d){var N=D,O=o,P=u;D=C+d*(s&&D>C?1:-1),o=w+n*S.cos(D),u=A+r*S.sin(D),h=we(o,u,n,r,i,0,s,O,P,[D,N,w,A])}x=D-C;var M=S.cos(C),k=S.sin(C),L=S.cos(D),F=S.sin(D),U=S.tan(x/4),B=4/3*n*U,j=4/3*r*U,q=[e,t],H=[e+B*k,t-j*M],G=[o+B*F,u-j*L],V=[o,u];if(H[0]=2*q[0]-H[0],H[1]=2*q[1]-H[1],l)return[H,G,V][p](h);for(var Y=[],z=0,Z=(h=[H,G,V][p](h).join()[_](",")).length;z<Z;z++)Y[z]=z%2?g(h[z-1],h[z],f).y:g(h[z],h[z+1],f).x;return Y},Ae=function(e,t,n,r,i,a,s,o,u){var l=1-u;return{x:C(l,3)*e+3*C(l,2)*u*n+3*l*u*u*i+C(u,3)*s,y:C(l,3)*t+3*C(l,2)*u*r+3*l*u*u*a+C(u,3)*o}},Ie=le((function(e,t,n,r,i,a,s,o){var u,l=i-2*n+e-(s-2*i+n),c=2*(n-e)-2*(i-n),d=e-n,f=(-c+S.sqrt(c*c-4*l*d))/2/l,p=(-c-S.sqrt(c*c-4*l*d))/2/l,g=[t,o],m=[e,s];return I(f)>"1e12"&&(f=.5),I(p)>"1e12"&&(p=.5),f>0&&f<1&&(u=Ae(e,t,n,r,i,a,s,o,f),m.push(u.x),g.push(u.y)),p>0&&p<1&&(u=Ae(e,t,n,r,i,a,s,o,p),m.push(u.x),g.push(u.y)),l=a-2*r+t-(o-2*a+r),d=t-r,f=(-(c=2*(r-t)-2*(a-r))+S.sqrt(c*c-4*l*d))/2/l,p=(-c-S.sqrt(c*c-4*l*d))/2/l,I(f)>"1e12"&&(f=.5),I(p)>"1e12"&&(p=.5),f>0&&f<1&&(u=Ae(e,t,n,r,i,a,s,o,f),m.push(u.x),g.push(u.y)),p>0&&p<1&&(u=Ae(e,t,n,r,i,a,s,o,p),m.push(u.x),g.push(u.y)),{min:{x:A[h](0,m),y:A[h](0,g)},max:{x:w[h](0,m),y:w[h](0,g)}}})),Ce=t._path2curve=le((function(e,t){var n=!t&&fe(e);if(!t&&n.curve)return _e(n.curve);for(var r=be(e),i=t&&be(t),a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},s={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},o=function(e,t,n){var r,i;if(!e)return["C",t.x,t.y,t.x,t.y,t.x,t.y];switch(!(e[0]in{T:1,Q:1})&&(t.qx=t.qy=null),e[0]){case"M":t.X=e[1],t.Y=e[2];break;case"A":e=["C"][p](we[h](0,[t.x,t.y][p](e.slice(1))));break;case"S":"C"==n||"S"==n?(r=2*t.x-t.bx,i=2*t.y-t.by):(r=t.x,i=t.y),e=["C",r,i][p](e.slice(1));break;case"T":"Q"==n||"T"==n?(t.qx=2*t.x-t.qx,t.qy=2*t.y-t.qy):(t.qx=t.x,t.qy=t.y),e=["C"][p](Se(t.x,t.y,t.qx,t.qy,e[1],e[2]));break;case"Q":t.qx=e[1],t.qy=e[2],e=["C"][p](Se(t.x,t.y,e[1],e[2],e[3],e[4]));break;case"L":e=["C"][p](Ee(t.x,t.y,e[1],e[2]));break;case"H":e=["C"][p](Ee(t.x,t.y,e[1],t.y));break;case"V":e=["C"][p](Ee(t.x,t.y,t.x,e[1]));break;case"Z":e=["C"][p](Ee(t.x,t.y,t.X,t.Y))}return e},u=function(e,t){if(e[t].length>7){e[t].shift();for(var n=e[t];n.length;)c[t]="A",i&&(d[t]="A"),e.splice(t++,0,["C"][p](n.splice(0,6)));e.splice(t,1),y=w(r.length,i&&i.length||0)}},l=function(e,t,n,a,s){e&&t&&"M"==e[s][0]&&"M"!=t[s][0]&&(t.splice(s,0,["M",a.x,a.y]),n.bx=0,n.by=0,n.x=e[s][1],n.y=e[s][2],y=w(r.length,i&&i.length||0))},c=[],d=[],f="",g="",m=0,y=w(r.length,i&&i.length||0);m<y;m++){r[m]&&(f=r[m][0]),"C"!=f&&(c[m]=f,m&&(g=c[m-1])),r[m]=o(r[m],a,g),"A"!=c[m]&&"C"==f&&(c[m]="C"),u(r,m),i&&(i[m]&&(f=i[m][0]),"C"!=f&&(d[m]=f,m&&(g=d[m-1])),i[m]=o(i[m],s,g),"A"!=d[m]&&"C"==f&&(d[m]="C"),u(i,m)),l(r,i,a,s,m),l(i,r,s,a,m);var v=r[m],_=i&&i[m],T=v.length,b=i&&_.length;a.x=v[T-2],a.y=v[T-1],a.bx=L(v[T-4])||a.x,a.by=L(v[T-3])||a.y,s.bx=i&&(L(_[b-4])||s.x),s.by=i&&(L(_[b-3])||s.y),s.x=i&&_[b-2],s.y=i&&_[b-1]}return i||(n.curve=_e(r)),i?[r,i]:r}),null,_e),Re=(t._parseDots=le((function(e){for(var n=[],r=0,i=e.length;r<i;r++){var a={},s=e[r].match(/^([^:]*):?([\d\.]*)/);if(a.color=t.getRGB(s[1]),a.color.error)return null;a.opacity=a.color.opacity,a.color=a.color.hex,s[2]&&(a.offset=s[2]+"%"),n.push(a)}for(r=1,i=n.length-1;r<i;r++)if(!n[r].offset){for(var o=L(n[r-1].offset||0),u=0,l=r+1;l<i;l++)if(n[l].offset){u=n[l].offset;break}u||(u=100,l=i);for(var c=((u=L(u))-o)/(l-r+1);r<l;r++)o+=c,n[r].offset=o+"%"}return n})),t._tear=function(e,t){e==t.top&&(t.top=e.prev),e==t.bottom&&(t.bottom=e.next),e.next&&(e.next.prev=e.prev),e.prev&&(e.prev.next=e.next)}),De=(t._tofront=function(e,t){t.top!==e&&(Re(e,t),e.next=null,e.prev=t.top,t.top.next=e,t.top=e)},t._toback=function(e,t){t.bottom!==e&&(Re(e,t),e.next=t.bottom,e.prev=null,t.bottom.prev=e,t.bottom=e)},t._insertafter=function(e,t,n){Re(e,n),t==n.top&&(n.top=e),t.next&&(t.next.prev=e),e.next=t.next,e.prev=t,t.next=e},t._insertbefore=function(e,t,n){Re(e,n),t==n.bottom&&(n.bottom=e),t.prev&&(t.prev.next=e),e.prev=t.prev,t.prev=e,e.next=t},t.toMatrix=function(e,t){var n=ve(e),r={_:{transform:m},getBBox:function(){return n}};return xe(r,t),r.matrix}),xe=(t.transformPath=function(e,t){return J(e,De(e,t))},t._extractTransform=function(e,n){if(null==n)return e._.transform;n=v(n).replace(/\.{3}|\u2026/g,e._.transform||m);var r,i,a=t.parseTransformString(n),s=0,o=1,u=1,l=e._,c=new Pe;if(l.transform=a||[],a)for(var d=0,f=a.length;d<f;d++){var h,p,g,y,_,T=a[d],b=T.length,E=v(T[0]).toLowerCase(),S=T[0]!=E,w=S?c.invert():0;"t"==E&&3==b?S?(h=w.x(0,0),p=w.y(0,0),g=w.x(T[1],T[2]),y=w.y(T[1],T[2]),c.translate(g-h,y-p)):c.translate(T[1],T[2]):"r"==E?2==b?(_=_||e.getBBox(1),c.rotate(T[1],_.x+_.width/2,_.y+_.height/2),s+=T[1]):4==b&&(S?(g=w.x(T[2],T[3]),y=w.y(T[2],T[3]),c.rotate(T[1],g,y)):c.rotate(T[1],T[2],T[3]),s+=T[1]):"s"==E?2==b||3==b?(_=_||e.getBBox(1),c.scale(T[1],T[b-1],_.x+_.width/2,_.y+_.height/2),o*=T[1],u*=T[b-1]):5==b&&(S?(g=w.x(T[3],T[4]),y=w.y(T[3],T[4]),c.scale(T[1],T[2],g,y)):c.scale(T[1],T[2],T[3],T[4]),o*=T[1],u*=T[2]):"m"==E&&7==b&&c.add(T[1],T[2],T[3],T[4],T[5],T[6]),l.dirtyT=1,e.matrix=c}e.matrix=c,l.sx=o,l.sy=u,l.deg=s,l.dx=r=c.e,l.dy=i=c.f,1==o&&1==u&&!s&&l.bbox?(l.bbox.x+=+r,l.bbox.y+=+i):l.dirtyT=1}),Ne=function(e){var t=e[0];switch(t.toLowerCase()){case"t":return[t,0,0];case"m":return[t,1,0,0,1,0,0];case"r":return 4==e.length?[t,0,e[2],e[3]]:[t,0];case"s":return 5==e.length?[t,1,1,e[3],e[4]]:3==e.length?[t,1,1]:[t,1]}},Oe=t._equaliseTransform=function(e,n){n=v(n).replace(/\.{3}|\u2026/g,e),e=t.parseTransformString(e)||[],n=t.parseTransformString(n)||[];for(var r,i,a,s,o=w(e.length,n.length),u=[],l=[],c=0;c<o;c++){if(a=e[c]||Ne(n[c]),s=n[c]||Ne(a),a[0]!=s[0]||"r"==a[0].toLowerCase()&&(a[2]!=s[2]||a[3]!=s[3])||"s"==a[0].toLowerCase()&&(a[3]!=s[3]||a[4]!=s[4]))return;for(u[c]=[],l[c]=[],r=0,i=w(a.length,s.length);r<i;r++)r in a&&(u[c][r]=a[r]),r in s&&(l[c][r]=s[r])}return{from:u,to:l}};function Pe(e,t,n,r,i,a){null!=e?(this.a=+e,this.b=+t,this.c=+n,this.d=+r,this.e=+i,this.f=+a):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}t._getContainer=function(e,n,r,i){var a;if(null!=(a=null!=i||t.is(e,"object")?e:c.doc.getElementById(e)))return a.tagName?null==n?{container:a,width:a.style.pixelWidth||a.offsetWidth,height:a.style.pixelHeight||a.offsetHeight}:{container:a,width:n,height:r}:{container:1,x:e,y:n,width:r,height:i}},t.pathToRelative=Te,t._engine={},t.path2curve=Ce,t.matrix=function(e,t,n,r,i,a){return new Pe(e,t,n,r,i,a)},function(e){function n(e){return e[0]*e[0]+e[1]*e[1]}function r(e){var t=S.sqrt(n(e));e[0]&&(e[0]/=t),e[1]&&(e[1]/=t)}e.add=function(e,t,n,r,i,a){var s,o,u,l,c=[[],[],[]],d=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],f=[[e,n,i],[t,r,a],[0,0,1]];for(e&&e instanceof Pe&&(f=[[e.a,e.c,e.e],[e.b,e.d,e.f],[0,0,1]]),s=0;s<3;s++)for(o=0;o<3;o++){for(l=0,u=0;u<3;u++)l+=d[s][u]*f[u][o];c[s][o]=l}this.a=c[0][0],this.b=c[1][0],this.c=c[0][1],this.d=c[1][1],this.e=c[0][2],this.f=c[1][2]},e.invert=function(){var e=this,t=e.a*e.d-e.b*e.c;return new Pe(e.d/t,-e.b/t,-e.c/t,e.a/t,(e.c*e.f-e.d*e.e)/t,(e.b*e.e-e.a*e.f)/t)},e.clone=function(){return new Pe(this.a,this.b,this.c,this.d,this.e,this.f)},e.translate=function(e,t){this.add(1,0,0,1,e,t)},e.scale=function(e,t,n,r){null==t&&(t=e),(n||r)&&this.add(1,0,0,1,n,r),this.add(e,0,0,t,0,0),(n||r)&&this.add(1,0,0,1,-n,-r)},e.rotate=function(e,n,r){e=t.rad(e),n=n||0,r=r||0;var i=+S.cos(e).toFixed(9),a=+S.sin(e).toFixed(9);this.add(i,a,-a,i,n,r),this.add(1,0,0,1,-n,-r)},e.x=function(e,t){return e*this.a+t*this.c+this.e},e.y=function(e,t){return e*this.b+t*this.d+this.f},e.get=function(e){return+this[v.fromCharCode(97+e)].toFixed(4)},e.toString=function(){return t.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},e.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.get(0)+", M12="+this.get(2)+", M21="+this.get(1)+", M22="+this.get(3)+", Dx="+this.get(4)+", Dy="+this.get(5)+", sizingmethod='auto expand')"},e.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},e.split=function(){var e={};e.dx=this.e,e.dy=this.f;var i=[[this.a,this.c],[this.b,this.d]];e.scalex=S.sqrt(n(i[0])),r(i[0]),e.shear=i[0][0]*i[1][0]+i[0][1]*i[1][1],i[1]=[i[1][0]-i[0][0]*e.shear,i[1][1]-i[0][1]*e.shear],e.scaley=S.sqrt(n(i[1])),r(i[1]),e.shear/=e.scaley;var a=-i[0][1],s=i[1][1];return s<0?(e.rotate=t.deg(S.acos(s)),a<0&&(e.rotate=360-e.rotate)):e.rotate=t.deg(S.asin(a)),e.isSimple=!(+e.shear.toFixed(9)||e.scalex.toFixed(9)!=e.scaley.toFixed(9)&&e.rotate),e.isSuperSimple=!+e.shear.toFixed(9)&&e.scalex.toFixed(9)==e.scaley.toFixed(9)&&!e.rotate,e.noRotation=!+e.shear.toFixed(9)&&!e.rotate,e},e.toTransformString=function(e){var t=e||this[_]();return t.isSimple?(t.scalex=+t.scalex.toFixed(4),t.scaley=+t.scaley.toFixed(4),t.rotate=+t.rotate.toFixed(4),(t.dx||t.dy?"t"+[t.dx,t.dy]:m)+(1!=t.scalex||1!=t.scaley?"s"+[t.scalex,t.scaley,0,0]:m)+(t.rotate?"r"+[t.rotate,0,0]:m)):"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]}}(Pe.prototype);for(var Me=function(){this.returnValue=!1},ke=function(){return this.originalEvent.preventDefault()},Le=function(){this.cancelBubble=!0},Fe=function(){return this.originalEvent.stopPropagation()},Ue=function(e){var t=c.doc.documentElement.scrollTop||c.doc.body.scrollTop,n=c.doc.documentElement.scrollLeft||c.doc.body.scrollLeft;return{x:e.clientX+n,y:e.clientY+t}},Be=c.doc.addEventListener?function(e,t,n,r){var i=function(e){var t=Ue(e);return n.call(r,e,t.x,t.y)};if(e.addEventListener(t,i,!1),g&&b[t]){var a=function(t){for(var i=Ue(t),a=t,s=0,o=t.targetTouches&&t.targetTouches.length;s<o;s++)if(t.targetTouches[s].target==e){(t=t.targetTouches[s]).originalEvent=a,t.preventDefault=ke,t.stopPropagation=Fe;break}return n.call(r,t,i.x,i.y)};e.addEventListener(b[t],a,!1)}return function(){return e.removeEventListener(t,i,!1),g&&b[t]&&e.removeEventListener(b[t],a,!1),!0}}:c.doc.attachEvent?function(e,t,n,r){var i=function(e){e=e||c.win.event;var t=c.doc.documentElement.scrollTop||c.doc.body.scrollTop,i=c.doc.documentElement.scrollLeft||c.doc.body.scrollLeft,a=e.clientX+i,s=e.clientY+t;return e.preventDefault=e.preventDefault||Me,e.stopPropagation=e.stopPropagation||Le,n.call(r,e,a,s)};return e.attachEvent("on"+t,i),function(){return e.detachEvent("on"+t,i),!0}}:void 0,je=[],qe=function(t){for(var n,r=t.clientX,i=t.clientY,a=c.doc.documentElement.scrollTop||c.doc.body.scrollTop,s=c.doc.documentElement.scrollLeft||c.doc.body.scrollLeft,o=je.length;o--;){if(n=je[o],g&&t.touches){for(var u,l=t.touches.length;l--;)if((u=t.touches[l]).identifier==n.el._drag.id){r=u.clientX,i=u.clientY,(t.originalEvent?t.originalEvent:t).preventDefault();break}}else t.preventDefault();var d,f=n.el.node,h=f.nextSibling,p=f.parentNode,m=f.style.display;c.win.opera&&p.removeChild(f),f.style.display="none",d=n.el.paper.getElementByPoint(r,i),f.style.display=m,c.win.opera&&(h?p.insertBefore(f,h):p.appendChild(f)),d&&e("raphael.drag.over."+n.el.id,n.el,d),r+=s,i+=a,e("raphael.drag.move."+n.el.id,n.move_scope||n.el,r-n.el._drag.x,i-n.el._drag.y,r,i,t)}},He=function(n){t.unmousemove(qe).unmouseup(He);for(var r,i=je.length;i--;)(r=je[i]).el._drag={},e("raphael.drag.end."+r.el.id,r.end_scope||r.start_scope||r.move_scope||r.el,n);je=[]},Ge=t.el={},Ve=T.length;Ve--;)!function(e){t[e]=Ge[e]=function(n,r){return t.is(n,"function")&&(this.events=this.events||[],this.events.push({name:e,f:n,unbind:Be(this.shape||this.node||c.doc,e,n,r||this)})),this},t["un"+e]=Ge["un"+e]=function(n){for(var r=this.events||[],i=r.length;i--;)r[i].name!=e||!t.is(n,"undefined")&&r[i].f!=n||(r[i].unbind(),r.splice(i,1),!r.length&&delete this.events);return this}}(T[Ve]);Ge.data=function(n,r){var i=Z[this.id]=Z[this.id]||{};if(0==arguments.length)return i;if(1==arguments.length){if(t.is(n,"object")){for(var a in n)n[l](a)&&this.data(a,n[a]);return this}return e("raphael.data.get."+this.id,this,i[n],n),i[n]}return i[n]=r,e("raphael.data.set."+this.id,this,r,n),this},Ge.removeData=function(e){return null==e?delete Z[this.id]:Z[this.id]&&delete Z[this.id][e],this},Ge.getData=function(){return ne(Z[this.id]||{})},Ge.hover=function(e,t,n,r){return this.mouseover(e,n).mouseout(t,r||n)},Ge.unhover=function(e,t){return this.unmouseover(e).unmouseout(t)};var Ye=[];function ze(){return this.x+y+this.y+y+this.width+" × "+this.height}Ge.drag=function(n,r,i,a,s,o){function u(u){(u.originalEvent||u).preventDefault();var l=u.clientX,d=u.clientY,f=c.doc.documentElement.scrollTop||c.doc.body.scrollTop,h=c.doc.documentElement.scrollLeft||c.doc.body.scrollLeft;if(this._drag.id=u.identifier,g&&u.touches)for(var p,m=u.touches.length;m--;)if(p=u.touches[m],this._drag.id=p.identifier,p.identifier==this._drag.id){l=p.clientX,d=p.clientY;break}this._drag.x=l+h,this._drag.y=d+f,!je.length&&t.mousemove(qe).mouseup(He),je.push({el:this,move_scope:a,start_scope:s,end_scope:o}),r&&e.on("raphael.drag.start."+this.id,r),n&&e.on("raphael.drag.move."+this.id,n),i&&e.on("raphael.drag.end."+this.id,i),e("raphael.drag.start."+this.id,s||a||this,this._drag.x,this._drag.y,u)}return this._drag={},Ye.push({el:this,start:u}),this.mousedown(u),this},Ge.onDragOver=function(t){t?e.on("raphael.drag.over."+this.id,t):e.unbind("raphael.drag.over."+this.id)},Ge.undrag=function(){for(var n=Ye.length;n--;)Ye[n].el==this&&(this.unmousedown(Ye[n].start),Ye.splice(n,1),e.unbind("raphael.drag.*."+this.id));!Ye.length&&t.unmousemove(qe).unmouseup(He),je=[]},r.circle=function(e,n,r){var i=t._engine.circle(this,e||0,n||0,r||0);return this.__set__&&this.__set__.push(i),i},r.rect=function(e,n,r,i,a){var s=t._engine.rect(this,e||0,n||0,r||0,i||0,a||0);return this.__set__&&this.__set__.push(s),s},r.ellipse=function(e,n,r,i){var a=t._engine.ellipse(this,e||0,n||0,r||0,i||0);return this.__set__&&this.__set__.push(a),a},r.path=function(e){e&&!t.is(e,"string")&&!t.is(e[0],x)&&(e+=m);var n=t._engine.path(t.format[h](t,arguments),this);return this.__set__&&this.__set__.push(n),n},r.image=function(e,n,r,i,a){var s=t._engine.image(this,e||"about:blank",n||0,r||0,i||0,a||0);return this.__set__&&this.__set__.push(s),s},r.text=function(e,n,r){var i=t._engine.text(this,e||0,n||0,v(r));return this.__set__&&this.__set__.push(i),i},r.set=function(e){!t.is(e,"array")&&(e=Array.prototype.splice.call(arguments,0,arguments.length));var n=new dt(e);return this.__set__&&this.__set__.push(n),n.paper=this,n.type="set",n},r.setStart=function(e){this.__set__=e||this.set()},r.setFinish=function(e){var t=this.__set__;return delete this.__set__,t},r.getSize=function(){var e=this.canvas.parentNode;return{width:e.offsetWidth,height:e.offsetHeight}},r.setSize=function(e,n){return t._engine.setSize.call(this,e,n)},r.setViewBox=function(e,n,r,i,a){return t._engine.setViewBox.call(this,e,n,r,i,a)},r.top=r.bottom=null,r.raphael=t,r.getElementByPoint=function(e,t){var n,r,i,a,s,o,u,l=this.canvas,d=c.doc.elementFromPoint(e,t);if(c.win.opera&&"svg"==d.tagName){var f=(r=(n=l).getBoundingClientRect(),a=(i=n.ownerDocument).body,o=(s=i.documentElement).clientTop||a.clientTop||0,u=s.clientLeft||a.clientLeft||0,{y:r.top+(c.win.pageYOffset||s.scrollTop||a.scrollTop)-o,x:r.left+(c.win.pageXOffset||s.scrollLeft||a.scrollLeft)-u}),h=l.createSVGRect();h.x=e-f.x,h.y=t-f.y,h.width=h.height=1;var p=l.getIntersectionList(h,null);p.length&&(d=p[p.length-1])}if(!d)return null;for(;d.parentNode&&d!=l.parentNode&&!d.raphael;)d=d.parentNode;return d==this.canvas.parentNode&&(d=l),d&&d.raphael?this.getById(d.raphaelid):null},r.getElementsByBBox=function(e){var n=this.set();return this.forEach((function(r){t.isBBoxIntersect(r.getBBox(),e)&&n.push(r)})),n},r.getById=function(e){for(var t=this.bottom;t;){if(t.id==e)return t;t=t.next}return null},r.forEach=function(e,t){for(var n=this.bottom;n;){if(!1===e.call(t,n))return this;n=n.next}return this},r.getElementsByPoint=function(e,t){var n=this.set();return this.forEach((function(r){r.isPointInside(e,t)&&n.push(r)})),n},Ge.isPointInside=function(e,n){var r=this.realPath=Q[this.type](this);return this.attr("transform")&&this.attr("transform").length&&(r=t.transformPath(r,this.attr("transform"))),t.isPointInsidePath(r,e,n)},Ge.getBBox=function(e){if(this.removed)return{};var t=this._;return e?(!t.dirty&&t.bboxwt||(this.realPath=Q[this.type](this),t.bboxwt=ve(this.realPath),t.bboxwt.toString=ze,t.dirty=0),t.bboxwt):((t.dirty||t.dirtyT||!t.bbox)&&(!t.dirty&&this.realPath||(t.bboxwt=0,this.realPath=Q[this.type](this)),t.bbox=ve(J(this.realPath,this.matrix)),t.bbox.toString=ze,t.dirty=t.dirtyT=0),t.bbox)},Ge.clone=function(){if(this.removed)return null;var e=this.paper[this.type]().attr(this.attr());return this.__set__&&this.__set__.push(e),e},Ge.glow=function(e){if("text"==this.type)return null;var t={width:((e=e||{}).width||10)+(+this.attr("stroke-width")||1),fill:e.fill||!1,opacity:null==e.opacity?.5:e.opacity,offsetx:e.offsetx||0,offsety:e.offsety||0,color:e.color||"#000"},n=t.width/2,r=this.paper,i=r.set(),a=this.realPath||Q[this.type](this);a=this.matrix?J(a,this.matrix):a;for(var s=1;s<n+1;s++)i.push(r.path(a).attr({stroke:t.color,fill:t.fill?t.color:"none","stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(t.width/n*s).toFixed(3),opacity:+(t.opacity/n).toFixed(3)}));return i.insertBefore(this).translate(t.offsetx,t.offsety)};var Ze=function(e,n,r,i,a,s,o,u,l){return null==l?pe(e,n,r,i,a,s,o,u):t.findDotsAtSegment(e,n,r,i,a,s,o,u,function(e,t,n,r,i,a,s,o,u){if(!(u<0||pe(e,t,n,r,i,a,s,o)<u)){var l,c=.5,d=1-c;for(l=pe(e,t,n,r,i,a,s,o,d);I(l-u)>.01;)l=pe(e,t,n,r,i,a,s,o,d+=(l<u?1:-1)*(c/=2));return d}}(e,n,r,i,a,s,o,u,l))},Ke=function(e,n){return function(r,i,a){for(var s,o,u,l,c,d="",f={},h=0,p=0,g=(r=Ce(r)).length;p<g;p++){if("M"==(u=r[p])[0])s=+u[1],o=+u[2];else{if(h+(l=Ze(s,o,u[1],u[2],u[3],u[4],u[5],u[6]))>i){if(n&&!f.start){if(d+=["C"+(c=Ze(s,o,u[1],u[2],u[3],u[4],u[5],u[6],i-h)).start.x,c.start.y,c.m.x,c.m.y,c.x,c.y],a)return d;f.start=d,d=["M"+c.x,c.y+"C"+c.n.x,c.n.y,c.end.x,c.end.y,u[5],u[6]].join(),h+=l,s=+u[5],o=+u[6];continue}if(!e&&!n)return{x:(c=Ze(s,o,u[1],u[2],u[3],u[4],u[5],u[6],i-h)).x,y:c.y,alpha:c.alpha}}h+=l,s=+u[5],o=+u[6]}d+=u.shift()+u}return f.end=d,(c=e?h:n?f:t.findDotsAtSegment(s,o,u[0],u[1],u[2],u[3],u[4],u[5],1)).alpha&&(c={x:c.x,y:c.y,alpha:c.alpha}),c}},We=Ke(1),Xe=Ke(),$e=Ke(0,1);t.getTotalLength=We,t.getPointAtLength=Xe,t.getSubpath=function(e,t,n){if(this.getTotalLength(e)-n<1e-6)return $e(e,t).end;var r=$e(e,n,1);return t?$e(r,t).end:r},Ge.getTotalLength=function(){var e=this.getPath();if(e)return this.node.getTotalLength?this.node.getTotalLength():We(e)},Ge.getPointAtLength=function(e){var t=this.getPath();if(t)return Xe(t,e)},Ge.getPath=function(){var e,n=t._getPath[this.type];if("text"!=this.type&&"set"!=this.type)return n&&(e=n(this)),e},Ge.getSubpath=function(e,n){var r=this.getPath();if(r)return t.getSubpath(r,e,n)};var Qe=t.easing_formulas={linear:function(e){return e},"<":function(e){return C(e,1.7)},">":function(e){return C(e,.48)},"<>":function(e){var t=.48-e/1.04,n=S.sqrt(.1734+t*t),r=n-t,i=-n-t,a=C(I(r),1/3)*(r<0?-1:1)+C(I(i),1/3)*(i<0?-1:1)+.5;return 3*(1-a)*a*a+a*a*a},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},elastic:function(e){return e==!!e?e:C(2,-10*e)*S.sin(2*R*(e-.075)/.3)+1},bounce:function(e){var t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375}};Qe.easeIn=Qe["ease-in"]=Qe["<"],Qe.easeOut=Qe["ease-out"]=Qe[">"],Qe.easeInOut=Qe["ease-in-out"]=Qe["<>"],Qe["back-in"]=Qe.backIn,Qe["back-out"]=Qe.backOut;var Je=[],et=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,16)},tt=function(){for(var n=+new Date,r=0;r<Je.length;r++){var i=Je[r];if(!i.el.removed&&!i.paused){var a,s,o=n-i.start,u=i.ms,c=i.easing,d=i.from,f=i.diff,h=i.to,g=(i.t,i.el),m={},v={};if(i.initstatus?(o=(i.initstatus*i.anim.top-i.prev)/(i.percent-i.prev)*u,i.status=i.initstatus,delete i.initstatus,i.stop&&Je.splice(r--,1)):i.status=(i.prev+(i.percent-i.prev)*(o/u))/i.anim.top,!(o<0))if(o<u){var _=c(o/u);for(var T in d)if(d[l](T)){switch(j[T]){case D:a=+d[T]+_*u*f[T];break;case"colour":a="rgb("+[nt(k(d[T].r+_*u*f[T].r)),nt(k(d[T].g+_*u*f[T].g)),nt(k(d[T].b+_*u*f[T].b))].join(",")+")";break;case"path":a=[];for(var b=0,E=d[T].length;b<E;b++){a[b]=[d[T][b][0]];for(var S=1,w=d[T][b].length;S<w;S++)a[b][S]=+d[T][b][S]+_*u*f[T][b][S];a[b]=a[b].join(y)}a=a.join(y);break;case"transform":if(f[T].real)for(a=[],b=0,E=d[T].length;b<E;b++)for(a[b]=[d[T][b][0]],S=1,w=d[T][b].length;S<w;S++)a[b][S]=d[T][b][S]+_*u*f[T][b][S];else{var A=function(e){return+d[T][e]+_*u*f[T][e]};a=[["m",A(0),A(1),A(2),A(3),A(4),A(5)]]}break;case"csv":if("clip-rect"==T)for(a=[],b=4;b--;)a[b]=+d[T][b]+_*u*f[T][b];break;default:var I=[][p](d[T]);for(a=[],b=g.paper.customAttributes[T].length;b--;)a[b]=+I[b]+_*u*f[T][b]}m[T]=a}g.attr(m),function(t,n,r){setTimeout((function(){e("raphael.anim.frame."+t,n,r)}))}(g.id,g,i.anim)}else{if(function(n,r,i){setTimeout((function(){e("raphael.anim.frame."+r.id,r,i),e("raphael.anim.finish."+r.id,r,i),t.is(n,"function")&&n.call(r)}))}(i.callback,g,i.anim),g.attr(h),Je.splice(r--,1),i.repeat>1&&!i.next){for(s in h)h[l](s)&&(v[s]=i.totalOrigin[s]);i.el.attr(v),at(i.anim,i.el,i.anim.percents[0],null,i.totalOrigin,i.repeat-1)}i.next&&!i.stop&&at(i.anim,i.el,i.next,null,i.totalOrigin,i.repeat)}}}Je.length&&et(tt)},nt=function(e){return e>255?255:e<0?0:e};function rt(e,t,n,r,i,a){var s=3*t,o=3*(r-t)-s,u=1-s-o,l=3*n,c=3*(i-n)-l,d=1-l-c;function f(e){return((u*e+o)*e+s)*e}return function(e,t){var n=function(e,t){var n,r,i,a,l,c;for(i=e,c=0;c<8;c++){if(a=f(i)-e,I(a)<t)return i;if(I(l=(3*u*i+2*o)*i+s)<1e-6)break;i-=a/l}if((i=e)<(n=0))return n;if(i>(r=1))return r;for(;n<r;){if(a=f(i),I(a-e)<t)return i;e>a?n=i:r=i,i=(r-n)/2+n}return i}(e,t);return((d*n+c)*n+l)*n}(e,1/(200*a))}function it(e,t){var n=[],r={};if(this.ms=t,this.times=1,e){for(var i in e)e[l](i)&&(r[L(i)]=e[i],n.push(L(i)));n.sort(K)}this.anim=r,this.top=n[n.length-1],this.percents=n}function at(n,r,i,a,o,u){i=L(i);var c,d,f,h,g,m,y=n.ms,T={},b={},E={};if(a)for(w=0,A=Je.length;w<A;w++){var S=Je[w];if(S.el.id==r.id&&S.anim==n){S.percent!=i?(Je.splice(w,1),f=1):d=S,r.attr(S.totalOrigin);break}}else a=+b;for(var w=0,A=n.percents.length;w<A;w++){if(n.percents[w]==i||n.percents[w]>a*n.top){i=n.percents[w],g=n.percents[w-1]||0,y=y/n.top*(i-g),h=n.percents[w+1],c=n.anim[i];break}a&&r.attr(n.anim[n.percents[w]])}if(c){if(d)d.initstatus=a,d.start=new Date-d.ms*a;else{for(var I in c)if(c[l](I)&&(j[l](I)||r.paper.customAttributes[l](I)))switch(T[I]=r.attr(I),null==T[I]&&(T[I]=B[I]),b[I]=c[I],j[I]){case D:E[I]=(b[I]-T[I])/y;break;case"colour":T[I]=t.getRGB(T[I]);var C=t.getRGB(b[I]);E[I]={r:(C.r-T[I].r)/y,g:(C.g-T[I].g)/y,b:(C.b-T[I].b)/y};break;case"path":var R=Ce(T[I],b[I]),x=R[1];for(T[I]=R[0],E[I]=[],w=0,A=T[I].length;w<A;w++){E[I][w]=[0];for(var N=1,O=T[I][w].length;N<O;N++)E[I][w][N]=(x[w][N]-T[I][w][N])/y}break;case"transform":var P=r._,k=Oe(P[I],b[I]);if(k)for(T[I]=k.from,b[I]=k.to,E[I]=[],E[I].real=!0,w=0,A=T[I].length;w<A;w++)for(E[I][w]=[T[I][w][0]],N=1,O=T[I][w].length;N<O;N++)E[I][w][N]=(b[I][w][N]-T[I][w][N])/y;else{var F=r.matrix||new Pe,U={_:{transform:P.transform},getBBox:function(){return r.getBBox(1)}};T[I]=[F.a,F.b,F.c,F.d,F.e,F.f],xe(U,b[I]),b[I]=U._.transform,E[I]=[(U.matrix.a-F.a)/y,(U.matrix.b-F.b)/y,(U.matrix.c-F.c)/y,(U.matrix.d-F.d)/y,(U.matrix.e-F.e)/y,(U.matrix.f-F.f)/y]}break;case"csv":var q=v(c[I])[_](s),H=v(T[I])[_](s);if("clip-rect"==I)for(T[I]=H,E[I]=[],w=H.length;w--;)E[I][w]=(q[w]-T[I][w])/y;b[I]=q;break;default:for(q=[][p](c[I]),H=[][p](T[I]),E[I]=[],w=r.paper.customAttributes[I].length;w--;)E[I][w]=((q[w]||0)-(H[w]||0))/y}var G=c.easing,V=t.easing_formulas[G];if(!V)if((V=v(G).match(M))&&5==V.length){var Y=V;V=function(e){return rt(e,+Y[1],+Y[2],+Y[3],+Y[4],y)}}else V=W;if(S={anim:n,percent:i,timestamp:m=c.start||n.start||+new Date,start:m+(n.del||0),status:0,initstatus:a||0,stop:!1,ms:y,easing:V,from:T,diff:E,to:b,el:r,callback:c.callback,prev:g,next:h,repeat:u||n.times,origin:r.attr(),totalOrigin:o},Je.push(S),a&&!d&&!f&&(S.stop=!0,S.start=new Date-y*a,1==Je.length))return tt();f&&(S.start=new Date-S.ms*a),1==Je.length&&et(tt)}e("raphael.anim.start."+r.id,r,n)}}function st(e){for(var t=0;t<Je.length;t++)Je[t].el.paper==e&&Je.splice(t--,1)}Ge.animateWith=function(e,n,r,i,a,s){if(this.removed)return s&&s.call(this),this;var o=r instanceof it?r:t.animation(r,i,a,s);at(o,this,o.percents[0],null,this.attr());for(var u=0,l=Je.length;u<l;u++)if(Je[u].anim==n&&Je[u].el==e){Je[l-1].start=Je[u].start;break}return this},Ge.onAnimation=function(t){return t?e.on("raphael.anim.frame."+this.id,t):e.unbind("raphael.anim.frame."+this.id),this},it.prototype.delay=function(e){var t=new it(this.anim,this.ms);return t.times=this.times,t.del=+e||0,t},it.prototype.repeat=function(e){var t=new it(this.anim,this.ms);return t.del=this.del,t.times=S.floor(w(e,0))||1,t},t.animation=function(e,n,r,i){if(e instanceof it)return e;!t.is(r,"function")&&r||(i=i||r||null,r=null),e=Object(e),n=+n||0;var a,s,o={};for(s in e)e[l](s)&&L(s)!=s&&L(s)+"%"!=s&&(a=!0,o[s]=e[s]);if(a)return r&&(o.easing=r),i&&(o.callback=i),new it({100:o},n);if(i){var u=0;for(var c in e){var d=F(c);e[l](c)&&d>u&&(u=d)}!e[u+="%"].callback&&(e[u].callback=i)}return new it(e,n)},Ge.animate=function(e,n,r,i){if(this.removed)return i&&i.call(this),this;var a=e instanceof it?e:t.animation(e,n,r,i);return at(a,this,a.percents[0],null,this.attr()),this},Ge.setTime=function(e,t){return e&&null!=t&&this.status(e,A(t,e.ms)/e.ms),this},Ge.status=function(e,t){var n,r,i=[],a=0;if(null!=t)return at(e,this,-1,A(t,1)),this;for(n=Je.length;a<n;a++)if((r=Je[a]).el.id==this.id&&(!e||r.anim==e)){if(e)return r.status;i.push({anim:r.anim,status:r.status})}return e?0:i},Ge.pause=function(t){for(var n=0;n<Je.length;n++)Je[n].el.id!=this.id||t&&Je[n].anim!=t||!1!==e("raphael.anim.pause."+this.id,this,Je[n].anim)&&(Je[n].paused=!0);return this},Ge.resume=function(t){for(var n=0;n<Je.length;n++)if(Je[n].el.id==this.id&&(!t||Je[n].anim==t)){var r=Je[n];!1!==e("raphael.anim.resume."+this.id,this,r.anim)&&(delete r.paused,this.status(r.anim,r.status))}return this},Ge.stop=function(t){for(var n=0;n<Je.length;n++)Je[n].el.id!=this.id||t&&Je[n].anim!=t||!1!==e("raphael.anim.stop."+this.id,this,Je[n].anim)&&Je.splice(n--,1);return this},e.on("raphael.remove",st),e.on("raphael.clear",st),Ge.toString=function(){return"Raphaël’s object"};var ot,ut,lt,ct,dt=function(e){if(this.items=[],this.length=0,this.type="set",e)for(var t=0,n=e.length;t<n;t++)!e[t]||e[t].constructor!=Ge.constructor&&e[t].constructor!=dt||(this[this.items.length]=this.items[this.items.length]=e[t],this.length++)},ft=dt.prototype;for(var ht in ft.push=function(){for(var e,t,n=0,r=arguments.length;n<r;n++)!(e=arguments[n])||e.constructor!=Ge.constructor&&e.constructor!=dt||(this[t=this.items.length]=this.items[t]=e,this.length++);return this},ft.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},ft.forEach=function(e,t){for(var n=0,r=this.items.length;n<r;n++)if(!1===e.call(t,this.items[n],n))return this;return this},Ge)Ge[l](ht)&&(ft[ht]=function(e){return function(){var t=arguments;return this.forEach((function(n){n[e][h](n,t)}))}}(ht));return ft.attr=function(e,n){if(e&&t.is(e,x)&&t.is(e[0],"object"))for(var r=0,i=e.length;r<i;r++)this.items[r].attr(e[r]);else for(var a=0,s=this.items.length;a<s;a++)this.items[a].attr(e,n);return this},ft.clear=function(){for(;this.length;)this.pop()},ft.splice=function(e,t,n){e=e<0?w(this.length+e,0):e,t=w(0,A(this.length-e,t));var r,i=[],a=[],s=[];for(r=2;r<arguments.length;r++)s.push(arguments[r]);for(r=0;r<t;r++)a.push(this[e+r]);for(;r<this.length-e;r++)i.push(this[e+r]);var o=s.length;for(r=0;r<o+i.length;r++)this.items[e+r]=this[e+r]=r<o?s[r]:i[r-o];for(r=this.items.length=this.length-=t-o;this[r];)delete this[r++];return new dt(a)},ft.exclude=function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]==e)return this.splice(t,1),!0},ft.animate=function(e,n,r,i){(t.is(r,"function")||!r)&&(i=r||null);var a,s,o=this.items.length,u=o,l=this;if(!o)return this;i&&(s=function(){! --o&&i.call(l)}),r=t.is(r,"string")?r:s;var c=t.animation(e,n,r,s);for(a=this.items[--u].animate(c);u--;)this.items[u]&&!this.items[u].removed&&this.items[u].animateWith(a,c,c),this.items[u]&&!this.items[u].removed||o--;return this},ft.insertAfter=function(e){for(var t=this.items.length;t--;)this.items[t].insertAfter(e);return this},ft.getBBox=function(){for(var e=[],t=[],n=[],r=[],i=this.items.length;i--;)if(!this.items[i].removed){var a=this.items[i].getBBox();e.push(a.x),t.push(a.y),n.push(a.x+a.width),r.push(a.y+a.height)}return{x:e=A[h](0,e),y:t=A[h](0,t),x2:n=w[h](0,n),y2:r=w[h](0,r),width:n-e,height:r-t}},ft.clone=function(e){e=this.paper.set();for(var t=0,n=this.items.length;t<n;t++)e.push(this.items[t].clone());return e},ft.toString=function(){return"Raphaël‘s set"},ft.glow=function(e){var t=this.paper.set();return this.forEach((function(n,r){var i=n.glow(e);null!=i&&i.forEach((function(e,n){t.push(e)}))})),t},ft.isPointInside=function(e,t){var n=!1;return this.forEach((function(r){if(r.isPointInside(e,t))return n=!0,!1})),n},t.registerFont=function(e){if(!e.face)return e;this.fonts=this.fonts||{};var t={w:e.w,face:{},glyphs:{}},n=e.face["font-family"];for(var r in e.face)e.face[l](r)&&(t.face[r]=e.face[r]);if(this.fonts[n]?this.fonts[n].push(t):this.fonts[n]=[t],!e.svg)for(var i in t.face["units-per-em"]=F(e.face["units-per-em"],10),e.glyphs)if(e.glyphs[l](i)){var a=e.glyphs[i];if(t.glyphs[i]={w:a.w,k:{},d:a.d&&"M"+a.d.replace(/[mlcxtrv]/g,(function(e){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[e]||"M"}))+"z"},a.k)for(var s in a.k)a[l](s)&&(t.glyphs[i].k[s]=a.k[s])}return e},r.getFont=function(e,n,r,i){if(i=i||"normal",r=r||"normal",n=+n||{normal:400,bold:700,lighter:300,bolder:800}[n]||400,t.fonts){var a,s=t.fonts[e];if(!s){var o=new RegExp("(^|\\s)"+e.replace(/[^\w\d\s+!~.:_-]/g,m)+"(\\s|$)","i");for(var u in t.fonts)if(t.fonts[l](u)&&o.test(u)){s=t.fonts[u];break}}if(s)for(var c=0,d=s.length;c<d&&((a=s[c]).face["font-weight"]!=n||a.face["font-style"]!=r&&a.face["font-style"]||a.face["font-stretch"]!=i);c++);return a}},r.print=function(e,n,r,i,a,o,u,l){o=o||"middle",u=w(A(u||0,1),-1),l=w(A(l||1,3),1);var c,d=v(r)[_](m),f=0,h=0,p=m;if(t.is(i,"string")&&(i=this.getFont(i)),i){c=(a||16)/i.face["units-per-em"];for(var g=i.face.bbox[_](s),y=+g[0],T=g[3]-g[1],b=0,E=+g[1]+("baseline"==o?T+ +i.face.descent:T/2),S=0,I=d.length;S<I;S++){if("\n"==d[S])f=0,R=0,h=0,b+=T*l;else{var C=h&&i.glyphs[d[S-1]]||{},R=i.glyphs[d[S]];f+=h?(C.w||i.w)+(C.k&&C.k[d[S]]||0)+i.w*u:0,h=1}R&&R.d&&(p+=t.transformPath(R.d,["t",f*c,b*c,"s",c,c,y,E,"t",(e-y)/c,(n-E)/c]))}}return this.path(p).attr({fill:"#000",stroke:"none"})},r.add=function(e){if(t.is(e,"array"))for(var n,r=this.set(),i=0,a=e.length;i<a;i++)n=e[i]||{},o[l](n.type)&&r.push(this[n.type]().attr(n));return r},t.format=function(e,n){var r=t.is(n,x)?[0][p](n):arguments;return e&&t.is(e,"string")&&r.length-1&&(e=e.replace(u,(function(e,t){return null==r[++t]?m:r[t]}))),e||m},t.fullfill=(ot=/\{([^\}]+)\}/g,ut=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,function(e,t){return String(e).replace(ot,(function(e,n){return function(e,t,n){var r=n;return t.replace(ut,(function(e,t,n,i,a){t=t||i,r&&(t in r&&(r=r[t]),"function"==typeof r&&a&&(r=r()))})),r=(null==r||r==n?e:r)+""}(e,n,t)}))}),t.ninja=function(){if(d.was)c.win.Raphael=d.is;else{window.Raphael=void 0;try{delete window.Raphael}catch(e){}}return t},t.st=ft,e.on("raphael.DOMload",(function(){n=!0})),null==(lt=document).readyState&<.addEventListener&&(lt.addEventListener("DOMContentLoaded",ct=function(){lt.removeEventListener("DOMContentLoaded",ct,!1),lt.readyState="complete"},!1),lt.readyState="loading"),function e(){/in/.test(lt.readyState)?setTimeout(e,9):t.eve("raphael.DOMload")}(),t}.apply(t,r))||(e.exports=i)},function(e,t,n){var r,i;r=[n(0),n(3),n(4)],void 0===(i=function(e){return e}.apply(t,r))||(e.exports=i)},function(e,t,n){var r,i,a,s,o,u,l,c,d,f,h,p,g,m;s="hasOwnProperty",o=/[\.\/]/,u=/\s*,\s*/,l=function(e,t){return e-t},c={n:{}},d=function(){for(var e=0,t=this.length;e<t;e++)if(void 0!==this[e])return this[e]},f=function(){for(var e=this.length;--e;)if(void 0!==this[e])return this[e]},h=Object.prototype.toString,p=String,g=Array.isArray||function(e){return e instanceof Array||"[object Array]"==h.call(e)},(m=function(e,t){var n,r=a,s=Array.prototype.slice.call(arguments,2),o=m.listeners(e),u=0,c=[],h={},p=[],g=i;p.firstDefined=d,p.lastDefined=f,i=e,a=0;for(var y=0,v=o.length;y<v;y++)"zIndex"in o[y]&&(c.push(o[y].zIndex),o[y].zIndex<0&&(h[o[y].zIndex]=o[y]));for(c.sort(l);c[u]<0;)if(n=h[c[u++]],p.push(n.apply(t,s)),a)return a=r,p;for(y=0;y<v;y++)if("zIndex"in(n=o[y]))if(n.zIndex==c[u]){if(p.push(n.apply(t,s)),a)break;do{if((n=h[c[++u]])&&p.push(n.apply(t,s)),a)break}while(n)}else h[n.zIndex]=n;else if(p.push(n.apply(t,s)),a)break;return a=r,i=g,p})._events=c,m.listeners=function(e){var t,n,r,i,a,s,u,l,d=g(e)?e:e.split(o),f=c,h=[f],p=[];for(i=0,a=d.length;i<a;i++){for(l=[],s=0,u=h.length;s<u;s++)for(n=[(f=h[s].n)[d[i]],f["*"]],r=2;r--;)(t=n[r])&&(l.push(t),p=p.concat(t.f||[]));h=l}return p},m.separator=function(e){e?(e="["+(e=p(e).replace(/(?=[\.\^\]\[\-])/g,"\\"))+"]",o=new RegExp(e)):o=/[\.\/]/},m.on=function(e,t){if("function"!=typeof t)return function(){};for(var n=g(e)?g(e[0])?e:[e]:p(e).split(u),r=0,i=n.length;r<i;r++)!function(e){for(var n,r=g(e)?e:p(e).split(o),i=c,a=0,s=r.length;a<s;a++)i=(i=i.n).hasOwnProperty(r[a])&&i[r[a]]||(i[r[a]]={n:{}});for(i.f=i.f||[],a=0,s=i.f.length;a<s;a++)if(i.f[a]==t){n=!0;break}!n&&i.f.push(t)}(n[r]);return function(e){+e==+e&&(t.zIndex=+e)}},m.f=function(e){var t=[].slice.call(arguments,1);return function(){m.apply(null,[e,null].concat(t).concat([].slice.call(arguments,0)))}},m.stop=function(){a=1},m.nt=function(e){var t=g(i)?i.join("."):i;return e?new RegExp("(?:\\.|\\/|^)"+e+"(?:\\.|\\/|$)").test(t):t},m.nts=function(){return g(i)?i:i.split(o)},m.off=m.unbind=function(e,t){if(e){var n=g(e)?g(e[0])?e:[e]:p(e).split(u);if(n.length>1)for(var r=0,i=n.length;r<i;r++)m.off(n[r],t);else{n=g(e)?e:p(e).split(o);var a,l,d,f,h,y=[c];for(r=0,i=n.length;r<i;r++)for(f=0;f<y.length;f+=d.length-2){if(d=[f,1],a=y[f].n,"*"!=n[r])a[n[r]]&&d.push(a[n[r]]);else for(l in a)a[s](l)&&d.push(a[l]);y.splice.apply(y,d)}for(r=0,i=y.length;r<i;r++)for(a=y[r];a.n;){if(t){if(a.f){for(f=0,h=a.f.length;f<h;f++)if(a.f[f]==t){a.f.splice(f,1);break}!a.f.length&&delete a.f}for(l in a.n)if(a.n[s](l)&&a.n[l].f){var v=a.n[l].f;for(f=0,h=v.length;f<h;f++)if(v[f]==t){v.splice(f,1);break}!v.length&&delete a.n[l].f}}else for(l in delete a.f,a.n)a.n[s](l)&&a.n[l].f&&delete a.n[l].f;a=a.n}}}else m._events=c={n:{}}},m.once=function(e,t){var n=function(){return m.off(e,n),t.apply(this,arguments)};return m.on(e,n)},m.version="0.5.0",m.toString=function(){return"You are running Eve 0.5.0"},e.exports?e.exports=m:void 0===(r=function(){return m}.apply(t,[]))||(e.exports=r)},function(e,t,n){var r,i;r=[n(0)],void 0===(i=function(e){if(!e||e.svg){var t="hasOwnProperty",n=String,r=parseFloat,i=parseInt,a=Math,s=a.max,o=a.abs,u=a.pow,l=/[, ]+/,c=e.eve,d="",f=" ",h="http://www.w3.org/1999/xlink",p={block:"M5,0 0,2.5 5,5z",classic:"M5,0 0,2.5 5,5 3.5,3 3.5,2z",diamond:"M2.5,0 5,2.5 2.5,5 0,2.5z",open:"M6,1 1,3.5 6,6",oval:"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},g={};e.toString=function(){return"Your browser supports SVG.\nYou are running Raphaël "+this.version};var m=function(r,i){if(i)for(var a in"string"==typeof r&&(r=m(r)),i)i[t](a)&&("xlink:"==a.substring(0,6)?r.setAttributeNS(h,a.substring(6),n(i[a])):r.setAttribute(a,n(i[a])));else(r=e._g.doc.createElementNS("http://www.w3.org/2000/svg",r)).style&&(r.style.webkitTapHighlightColor="rgba(0,0,0,0)");return r},y=function(t,i){var l="linear",c=t.id+i,f=.5,h=.5,p=t.node,g=t.paper,y=p.style,_=e._g.doc.getElementById(c);if(!_){if(i=(i=n(i).replace(e._radial_gradient,(function(e,t,n){if(l="radial",t&&n){f=r(t);var i=2*((h=r(n))>.5)-1;u(f-.5,2)+u(h-.5,2)>.25&&(h=a.sqrt(.25-u(f-.5,2))*i+.5)&&.5!=h&&(h=h.toFixed(5)-1e-5*i)}return d}))).split(/\s*\-\s*/),"linear"==l){var T=i.shift();if(T=-r(T),isNaN(T))return null;var b=[0,0,a.cos(e.rad(T)),a.sin(e.rad(T))],E=1/(s(o(b[2]),o(b[3]))||1);b[2]*=E,b[3]*=E,b[2]<0&&(b[0]=-b[2],b[2]=0),b[3]<0&&(b[1]=-b[3],b[3]=0)}var S=e._parseDots(i);if(!S)return null;if(c=c.replace(/[\(\)\s,\xb0#]/g,"_"),t.gradient&&c!=t.gradient.id&&(g.defs.removeChild(t.gradient),delete t.gradient),!t.gradient){_=m(l+"Gradient",{id:c}),t.gradient=_,m(_,"radial"==l?{fx:f,fy:h}:{x1:b[0],y1:b[1],x2:b[2],y2:b[3],gradientTransform:t.matrix.invert()}),g.defs.appendChild(_);for(var w=0,A=S.length;w<A;w++)_.appendChild(m("stop",{offset:S[w].offset?S[w].offset:w?"100%":"0%","stop-color":S[w].color||"#fff","stop-opacity":isFinite(S[w].opacity)?S[w].opacity:1}))}}return m(p,{fill:v(c),opacity:1,"fill-opacity":1}),y.fill=d,y.opacity=1,y.fillOpacity=1,1},v=function(e){if((t=document.documentMode)&&(9===t||10===t))return"url('#"+e+"')";var t,n=document.location;return"url('"+n.protocol+"//"+n.host+n.pathname+n.search+"#"+e+"')"},_=function(e){var t=e.getBBox(1);m(e.pattern,{patternTransform:e.matrix.invert()+" translate("+t.x+","+t.y+")"})},T=function(r,i,a){if("path"==r.type){for(var s,o,u,l,c,f=n(i).toLowerCase().split("-"),h=r.paper,y=a?"end":"start",v=r.node,_=r.attrs,T=_["stroke-width"],b=f.length,E="classic",S=3,w=3,A=5;b--;)switch(f[b]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":E=f[b];break;case"wide":w=5;break;case"narrow":w=2;break;case"long":S=5;break;case"short":S=2}if("open"==E?(S+=2,w+=2,A+=2,u=1,l=a?4:1,c={fill:"none",stroke:_.stroke}):(l=u=S/2,c={fill:_.stroke,stroke:"none"}),r._.arrows?a?(r._.arrows.endPath&&g[r._.arrows.endPath]--,r._.arrows.endMarker&&g[r._.arrows.endMarker]--):(r._.arrows.startPath&&g[r._.arrows.startPath]--,r._.arrows.startMarker&&g[r._.arrows.startMarker]--):r._.arrows={},"none"!=E){var I="raphael-marker-"+E,C="raphael-marker-"+y+E+S+w+"-obj"+r.id;e._g.doc.getElementById(I)?g[I]++:(h.defs.appendChild(m(m("path"),{"stroke-linecap":"round",d:p[E],id:I})),g[I]=1);var R,D=e._g.doc.getElementById(C);D?(g[C]++,R=D.getElementsByTagName("use")[0]):(D=m(m("marker"),{id:C,markerHeight:w,markerWidth:S,orient:"auto",refX:l,refY:w/2}),R=m(m("use"),{"xlink:href":"#"+I,transform:(a?"rotate(180 "+S/2+" "+w/2+") ":d)+"scale("+S/A+","+w/A+")","stroke-width":(1/((S/A+w/A)/2)).toFixed(4)}),D.appendChild(R),h.defs.appendChild(D),g[C]=1),m(R,c);var x=u*("diamond"!=E&&"oval"!=E);a?(s=r._.arrows.startdx*T||0,o=e.getTotalLength(_.path)-x*T):(s=x*T,o=e.getTotalLength(_.path)-(r._.arrows.enddx*T||0)),(c={})["marker-"+y]="url(#"+C+")",(o||s)&&(c.d=e.getSubpath(_.path,s,o)),m(v,c),r._.arrows[y+"Path"]=I,r._.arrows[y+"Marker"]=C,r._.arrows[y+"dx"]=x,r._.arrows[y+"Type"]=E,r._.arrows[y+"String"]=i}else a?(s=r._.arrows.startdx*T||0,o=e.getTotalLength(_.path)-s):(s=0,o=e.getTotalLength(_.path)-(r._.arrows.enddx*T||0)),r._.arrows[y+"Path"]&&m(v,{d:e.getSubpath(_.path,s,o)}),delete r._.arrows[y+"Path"],delete r._.arrows[y+"Marker"],delete r._.arrows[y+"dx"],delete r._.arrows[y+"Type"],delete r._.arrows[y+"String"];for(c in g)if(g[t](c)&&!g[c]){var N=e._g.doc.getElementById(c);N&&N.parentNode.removeChild(N)}}},b={"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},E=function(e,t,r){if(t=b[n(t).toLowerCase()]){for(var i=e.attrs["stroke-width"]||"1",a={round:i,square:i,butt:0}[e.attrs["stroke-linecap"]||r["stroke-linecap"]]||0,s=[],o=t.length;o--;)s[o]=t[o]*i+(o%2?1:-1)*a;m(e.node,{"stroke-dasharray":s.join(",")})}else m(e.node,{"stroke-dasharray":"none"})},S=function(r,a){var u=r.node,c=r.attrs,f=u.style.visibility;for(var p in u.style.visibility="hidden",a)if(a[t](p)){if(!e._availableAttrs[t](p))continue;var g=a[p];switch(c[p]=g,p){case"blur":r.blur(g);break;case"title":var v=u.getElementsByTagName("title");if(v.length&&(v=v[0]))v.firstChild.nodeValue=g;else{v=m("title");var b=e._g.doc.createTextNode(g);v.appendChild(b),u.appendChild(v)}break;case"href":case"target":var S=u.parentNode;if("a"!=S.tagName.toLowerCase()){var A=m("a");S.insertBefore(A,u),A.appendChild(u),S=A}"target"==p?S.setAttributeNS(h,"show","blank"==g?"new":g):S.setAttributeNS(h,p,g);break;case"cursor":u.style.cursor=g;break;case"transform":r.transform(g);break;case"arrow-start":T(r,g);break;case"arrow-end":T(r,g,1);break;case"clip-rect":var I=n(g).split(l);if(4==I.length){r.clip&&r.clip.parentNode.parentNode.removeChild(r.clip.parentNode);var C=m("clipPath"),R=m("rect");C.id=e.createUUID(),m(R,{x:I[0],y:I[1],width:I[2],height:I[3]}),C.appendChild(R),r.paper.defs.appendChild(C),m(u,{"clip-path":"url(#"+C.id+")"}),r.clip=R}if(!g){var D=u.getAttribute("clip-path");if(D){var x=e._g.doc.getElementById(D.replace(/(^url\(#|\)$)/g,d));x&&x.parentNode.removeChild(x),m(u,{"clip-path":d}),delete r.clip}}break;case"path":"path"==r.type&&(m(u,{d:g?c.path=e._pathToAbsolute(g):"M0,0"}),r._.dirty=1,r._.arrows&&("startString"in r._.arrows&&T(r,r._.arrows.startString),"endString"in r._.arrows&&T(r,r._.arrows.endString,1)));break;case"width":if(u.setAttribute(p,g),r._.dirty=1,!c.fx)break;p="x",g=c.x;case"x":c.fx&&(g=-c.x-(c.width||0));case"rx":if("rx"==p&&"rect"==r.type)break;case"cx":u.setAttribute(p,g),r.pattern&&_(r),r._.dirty=1;break;case"height":if(u.setAttribute(p,g),r._.dirty=1,!c.fy)break;p="y",g=c.y;case"y":c.fy&&(g=-c.y-(c.height||0));case"ry":if("ry"==p&&"rect"==r.type)break;case"cy":u.setAttribute(p,g),r.pattern&&_(r),r._.dirty=1;break;case"r":"rect"==r.type?m(u,{rx:g,ry:g}):u.setAttribute(p,g),r._.dirty=1;break;case"src":"image"==r.type&&u.setAttributeNS(h,"href",g);break;case"stroke-width":1==r._.sx&&1==r._.sy||(g/=s(o(r._.sx),o(r._.sy))||1),u.setAttribute(p,g),c["stroke-dasharray"]&&E(r,c["stroke-dasharray"],a),r._.arrows&&("startString"in r._.arrows&&T(r,r._.arrows.startString),"endString"in r._.arrows&&T(r,r._.arrows.endString,1));break;case"stroke-dasharray":E(r,g,a);break;case"fill":var N=n(g).match(e._ISURL);if(N){C=m("pattern");var O=m("image");C.id=e.createUUID(),m(C,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),m(O,{x:0,y:0,"xlink:href":N[1]}),C.appendChild(O),function(t){e._preload(N[1],(function(){var e=this.offsetWidth,n=this.offsetHeight;m(t,{width:e,height:n}),m(O,{width:e,height:n})}))}(C),r.paper.defs.appendChild(C),m(u,{fill:"url(#"+C.id+")"}),r.pattern=C,r.pattern&&_(r);break}var P=e.getRGB(g);if(P.error){if(("circle"==r.type||"ellipse"==r.type||"r"!=n(g).charAt())&&y(r,g)){if("opacity"in c||"fill-opacity"in c){var M=e._g.doc.getElementById(u.getAttribute("fill").replace(/^url\(#|\)$/g,d));if(M){var k=M.getElementsByTagName("stop");m(k[k.length-1],{"stop-opacity":("opacity"in c?c.opacity:1)*("fill-opacity"in c?c["fill-opacity"]:1)})}}c.gradient=g,c.fill="none";break}}else delete a.gradient,delete c.gradient,!e.is(c.opacity,"undefined")&&e.is(a.opacity,"undefined")&&m(u,{opacity:c.opacity}),!e.is(c["fill-opacity"],"undefined")&&e.is(a["fill-opacity"],"undefined")&&m(u,{"fill-opacity":c["fill-opacity"]});P[t]("opacity")&&m(u,{"fill-opacity":P.opacity>1?P.opacity/100:P.opacity});case"stroke":P=e.getRGB(g),u.setAttribute(p,P.hex),"stroke"==p&&P[t]("opacity")&&m(u,{"stroke-opacity":P.opacity>1?P.opacity/100:P.opacity}),"stroke"==p&&r._.arrows&&("startString"in r._.arrows&&T(r,r._.arrows.startString),"endString"in r._.arrows&&T(r,r._.arrows.endString,1));break;case"gradient":("circle"==r.type||"ellipse"==r.type||"r"!=n(g).charAt())&&y(r,g);break;case"opacity":c.gradient&&!c[t]("stroke-opacity")&&m(u,{"stroke-opacity":g>1?g/100:g});case"fill-opacity":if(c.gradient){(M=e._g.doc.getElementById(u.getAttribute("fill").replace(/^url\(#|\)$/g,d)))&&(k=M.getElementsByTagName("stop"),m(k[k.length-1],{"stop-opacity":g}));break}default:"font-size"==p&&(g=i(g,10)+"px");var L=p.replace(/(\-.)/g,(function(e){return e.substring(1).toUpperCase()}));u.style[L]=g,r._.dirty=1,u.setAttribute(p,g)}}w(r,a),u.style.visibility=f},w=function(r,a){if("text"==r.type&&(a[t]("text")||a[t]("font")||a[t]("font-size")||a[t]("x")||a[t]("y"))){var s=r.attrs,o=r.node,u=o.firstChild?i(e._g.doc.defaultView.getComputedStyle(o.firstChild,d).getPropertyValue("font-size"),10):10;if(a[t]("text")){for(s.text=a.text;o.firstChild;)o.removeChild(o.firstChild);for(var l,c=n(a.text).split("\n"),f=[],h=0,p=c.length;h<p;h++)l=m("tspan"),h&&m(l,{dy:1.2*u,x:s.x}),l.appendChild(e._g.doc.createTextNode(c[h])),o.appendChild(l),f[h]=l}else for(h=0,p=(f=o.getElementsByTagName("tspan")).length;h<p;h++)h?m(f[h],{dy:1.2*u,x:s.x}):m(f[0],{dy:0});m(o,{x:s.x,y:s.y}),r._.dirty=1;var g=r._getBBox(),y=s.y-(g.y+g.height/2);y&&e.is(y,"finite")&&m(f[0],{dy:y})}},A=function(e){return e.parentNode&&"a"===e.parentNode.tagName.toLowerCase()?e.parentNode:e},I=function(t,n){this[0]=this.node=t,t.raphael=!0,this.id=("0000"+(Math.random()*Math.pow(36,5)<<0).toString(36)).slice(-5),t.raphaelid=this.id,this.matrix=e.matrix(),this.realPath=null,this.paper=n,this.attrs=this.attrs||{},this._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1},!n.bottom&&(n.bottom=this),this.prev=n.top,n.top&&(n.top.next=this),n.top=this,this.next=null},C=e.el;I.prototype=C,C.constructor=I,e._engine.path=function(e,t){var n=m("path");t.canvas&&t.canvas.appendChild(n);var r=new I(n,t);return r.type="path",S(r,{fill:"none",stroke:"#000",path:e}),r},C.rotate=function(e,t,i){if(this.removed)return this;if((e=n(e).split(l)).length-1&&(t=r(e[1]),i=r(e[2])),e=r(e[0]),null==i&&(t=i),null==t||null==i){var a=this.getBBox(1);t=a.x+a.width/2,i=a.y+a.height/2}return this.transform(this._.transform.concat([["r",e,t,i]])),this},C.scale=function(e,t,i,a){if(this.removed)return this;if((e=n(e).split(l)).length-1&&(t=r(e[1]),i=r(e[2]),a=r(e[3])),e=r(e[0]),null==t&&(t=e),null==a&&(i=a),null==i||null==a)var s=this.getBBox(1);return i=null==i?s.x+s.width/2:i,a=null==a?s.y+s.height/2:a,this.transform(this._.transform.concat([["s",e,t,i,a]])),this},C.translate=function(e,t){return this.removed||((e=n(e).split(l)).length-1&&(t=r(e[1])),e=r(e[0])||0,t=+t||0,this.transform(this._.transform.concat([["t",e,t]]))),this},C.transform=function(n){var r=this._;if(null==n)return r.transform;if(e._extractTransform(this,n),this.clip&&m(this.clip,{transform:this.matrix.invert()}),this.pattern&&_(this),this.node&&m(this.node,{transform:this.matrix}),1!=r.sx||1!=r.sy){var i=this.attrs[t]("stroke-width")?this.attrs["stroke-width"]:1;this.attr({"stroke-width":i})}return this},C.hide=function(){return this.removed||(this.node.style.display="none"),this},C.show=function(){return this.removed||(this.node.style.display=""),this},C.remove=function(){var t=A(this.node);if(!this.removed&&t.parentNode){var n=this.paper;for(var r in n.__set__&&n.__set__.exclude(this),c.unbind("raphael.*.*."+this.id),this.gradient&&n.defs.removeChild(this.gradient),e._tear(this,n),t.parentNode.removeChild(t),this.removeData(),this)this[r]="function"==typeof this[r]?e._removedFactory(r):null;this.removed=!0}},C._getBBox=function(){if("none"==this.node.style.display){this.show();var e=!0}var t,n=!1;this.paper.canvas.parentElement?t=this.paper.canvas.parentElement.style:this.paper.canvas.parentNode&&(t=this.paper.canvas.parentNode.style),t&&"none"==t.display&&(n=!0,t.display="");var r={};try{r=this.node.getBBox()}catch(e){r={x:this.node.clientLeft,y:this.node.clientTop,width:this.node.clientWidth,height:this.node.clientHeight}}finally{r=r||{},n&&(t.display="none")}return e&&this.hide(),r},C.attr=function(n,r){if(this.removed)return this;if(null==n){var i={};for(var a in this.attrs)this.attrs[t](a)&&(i[a]=this.attrs[a]);return i.gradient&&"none"==i.fill&&(i.fill=i.gradient)&&delete i.gradient,i.transform=this._.transform,i}if(null==r&&e.is(n,"string")){if("fill"==n&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;if("transform"==n)return this._.transform;for(var s=n.split(l),o={},u=0,d=s.length;u<d;u++)(n=s[u])in this.attrs?o[n]=this.attrs[n]:e.is(this.paper.customAttributes[n],"function")?o[n]=this.paper.customAttributes[n].def:o[n]=e._availableAttrs[n];return d-1?o:o[s[0]]}if(null==r&&e.is(n,"array")){for(o={},u=0,d=n.length;u<d;u++)o[n[u]]=this.attr(n[u]);return o}if(null!=r){var f={};f[n]=r}else null!=n&&e.is(n,"object")&&(f=n);for(var h in f)c("raphael.attr."+h+"."+this.id,this,f[h]);for(h in this.paper.customAttributes)if(this.paper.customAttributes[t](h)&&f[t](h)&&e.is(this.paper.customAttributes[h],"function")){var p=this.paper.customAttributes[h].apply(this,[].concat(f[h]));for(var g in this.attrs[h]=f[h],p)p[t](g)&&(f[g]=p[g])}return S(this,f),this},C.toFront=function(){if(this.removed)return this;var t=A(this.node);t.parentNode.appendChild(t);var n=this.paper;return n.top!=this&&e._tofront(this,n),this},C.toBack=function(){if(this.removed)return this;var t=A(this.node),n=t.parentNode;return n.insertBefore(t,n.firstChild),e._toback(this,this.paper),this.paper,this},C.insertAfter=function(t){if(this.removed||!t)return this;var n=A(this.node),r=A(t.node||t[t.length-1].node);return r.nextSibling?r.parentNode.insertBefore(n,r.nextSibling):r.parentNode.appendChild(n),e._insertafter(this,t,this.paper),this},C.insertBefore=function(t){if(this.removed||!t)return this;var n=A(this.node),r=A(t.node||t[0].node);return r.parentNode.insertBefore(n,r),e._insertbefore(this,t,this.paper),this},C.blur=function(t){var n=this;if(0!=+t){var r=m("filter"),i=m("feGaussianBlur");n.attrs.blur=t,r.id=e.createUUID(),m(i,{stdDeviation:+t||1.5}),r.appendChild(i),n.paper.defs.appendChild(r),n._blur=r,m(n.node,{filter:"url(#"+r.id+")"})}else n._blur&&(n._blur.parentNode.removeChild(n._blur),delete n._blur,delete n.attrs.blur),n.node.removeAttribute("filter");return n},e._engine.circle=function(e,t,n,r){var i=m("circle");e.canvas&&e.canvas.appendChild(i);var a=new I(i,e);return a.attrs={cx:t,cy:n,r,fill:"none",stroke:"#000"},a.type="circle",m(i,a.attrs),a},e._engine.rect=function(e,t,n,r,i,a){var s=m("rect");e.canvas&&e.canvas.appendChild(s);var o=new I(s,e);return o.attrs={x:t,y:n,width:r,height:i,rx:a||0,ry:a||0,fill:"none",stroke:"#000"},o.type="rect",m(s,o.attrs),o},e._engine.ellipse=function(e,t,n,r,i){var a=m("ellipse");e.canvas&&e.canvas.appendChild(a);var s=new I(a,e);return s.attrs={cx:t,cy:n,rx:r,ry:i,fill:"none",stroke:"#000"},s.type="ellipse",m(a,s.attrs),s},e._engine.image=function(e,t,n,r,i,a){var s=m("image");m(s,{x:n,y:r,width:i,height:a,preserveAspectRatio:"none"}),s.setAttributeNS(h,"href",t),e.canvas&&e.canvas.appendChild(s);var o=new I(s,e);return o.attrs={x:n,y:r,width:i,height:a,src:t},o.type="image",o},e._engine.text=function(t,n,r,i){var a=m("text");t.canvas&&t.canvas.appendChild(a);var s=new I(a,t);return s.attrs={x:n,y:r,"text-anchor":"middle",text:i,"font-family":e._availableAttrs["font-family"],"font-size":e._availableAttrs["font-size"],stroke:"none",fill:"#000"},s.type="text",S(s,s.attrs),s},e._engine.setSize=function(e,t){return this.width=e||this.width,this.height=t||this.height,this.canvas.setAttribute("width",this.width),this.canvas.setAttribute("height",this.height),this._viewBox&&this.setViewBox.apply(this,this._viewBox),this},e._engine.create=function(){var t=e._getContainer.apply(0,arguments),n=t&&t.container;if(!n)throw new Error("SVG container not found.");var r,i=t.x,a=t.y,s=t.width,o=t.height,u=m("svg"),l="overflow:hidden;";return i=i||0,a=a||0,m(u,{height:o=o||342,version:1.1,width:s=s||512,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}),1==n?(u.style.cssText=l+"position:absolute;left:"+i+"px;top:"+a+"px",e._g.doc.body.appendChild(u),r=1):(u.style.cssText=l+"position:relative",n.firstChild?n.insertBefore(u,n.firstChild):n.appendChild(u)),(n=new e._Paper).width=s,n.height=o,n.canvas=u,n.clear(),n._left=n._top=0,r&&(n.renderfix=function(){}),n.renderfix(),n},e._engine.setViewBox=function(e,t,n,r,i){c("raphael.setViewBox",this,this._viewBox,[e,t,n,r,i]);var a,o,u=this.getSize(),l=s(n/u.width,r/u.height),d=this.top,h=i?"xMidYMid meet":"xMinYMin";for(null==e?(this._vbSize&&(l=1),delete this._vbSize,a="0 0 "+this.width+f+this.height):(this._vbSize=l,a=e+f+t+f+n+f+r),m(this.canvas,{viewBox:a,preserveAspectRatio:h});l&&d;)o="stroke-width"in d.attrs?d.attrs["stroke-width"]:1,d.attr({"stroke-width":o}),d._.dirty=1,d._.dirtyT=1,d=d.prev;return this._viewBox=[e,t,n,r,!!i],this},e.prototype.renderfix=function(){var e,t=this.canvas,n=t.style;try{e=t.getScreenCTM()||t.createSVGMatrix()}catch(n){e=t.createSVGMatrix()}var r=-e.e%1,i=-e.f%1;(r||i)&&(r&&(this._left=(this._left+r)%1,n.left=this._left+"px"),i&&(this._top=(this._top+i)%1,n.top=this._top+"px"))},e.prototype.clear=function(){e.eve("raphael.clear",this);for(var t=this.canvas;t.firstChild;)t.removeChild(t.firstChild);this.bottom=this.top=null,(this.desc=m("desc")).appendChild(e._g.doc.createTextNode("Created with Raphaël "+e.version)),t.appendChild(this.desc),t.appendChild(this.defs=m("defs"))},e.prototype.remove=function(){for(var t in c("raphael.remove",this),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this)this[t]="function"==typeof this[t]?e._removedFactory(t):null};var R=e.st;for(var D in C)C[t](D)&&!R[t](D)&&(R[D]=function(e){return function(){var t=arguments;return this.forEach((function(n){n[e].apply(n,t)}))}}(D))}}.apply(t,r))||(e.exports=i)},function(e,t,n){var r,i;r=[n(0)],void 0===(i=function(e){if(!e||e.vml){var t="hasOwnProperty",n=String,r=parseFloat,i=Math,a=i.round,s=i.max,o=i.min,u=i.abs,l=/[, ]+/,c=e.eve,d=" ",f="",h={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},p=/([clmz]),?([^clmz]*)/gi,g=/ progid:\S+Blur\([^\)]+\)/g,m=/-?[^,\s-]+/g,y="position:absolute;left:0;top:0;width:1px;height:1px;behavior:url(#default#VML)",v=21600,_={path:1,rect:1,image:1},T={circle:1,ellipse:1},b=function(t,n,r){var i=e.matrix();return i.rotate(-t,.5,.5),{dx:i.x(n,r),dy:i.y(n,r)}},E=function(e,t,n,r,i,a){var s=e._,o=e.matrix,l=s.fillpos,c=e.node,f=c.style,h=1,p="",g=v/t,m=v/n;if(f.visibility="hidden",t&&n){if(c.coordsize=u(g)+d+u(m),f.rotation=a*(t*n<0?-1:1),a){var y=b(a,r,i);r=y.dx,i=y.dy}if(t<0&&(p+="x"),n<0&&(p+=" y")&&(h=-1),f.flip=p,c.coordorigin=r*-g+d+i*-m,l||s.fillsize){var _=c.getElementsByTagName("fill");_=_&&_[0],c.removeChild(_),l&&(y=b(a,o.x(l[0],l[1]),o.y(l[0],l[1])),_.position=y.dx*h+d+y.dy*h),s.fillsize&&(_.size=s.fillsize[0]*u(t)+d+s.fillsize[1]*u(n)),c.appendChild(_)}f.visibility="visible"}};e.toString=function(){return"Your browser doesn’t support SVG. Falling down to VML.\nYou are running Raphaël "+this.version};var S,w=function(e,t,r){for(var i=n(t).toLowerCase().split("-"),a=r?"end":"start",s=i.length,o="classic",u="medium",l="medium";s--;)switch(i[s]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":o=i[s];break;case"wide":case"narrow":l=i[s];break;case"long":case"short":u=i[s]}var c=e.node.getElementsByTagName("stroke")[0];c[a+"arrow"]=o,c[a+"arrowlength"]=u,c[a+"arrowwidth"]=l},A=function(i,u){i.attrs=i.attrs||{};var c=i.node,g=i.attrs,y=c.style,b=_[i.type]&&(u.x!=g.x||u.y!=g.y||u.width!=g.width||u.height!=g.height||u.cx!=g.cx||u.cy!=g.cy||u.rx!=g.rx||u.ry!=g.ry||u.r!=g.r),A=T[i.type]&&(g.cx!=u.cx||g.cy!=u.cy||g.r!=u.r||g.rx!=u.rx||g.ry!=u.ry),C=i;for(var R in u)u[t](R)&&(g[R]=u[R]);if(b&&(g.path=e._getPath[i.type](i),i._.dirty=1),u.href&&(c.href=u.href),u.title&&(c.title=u.title),u.target&&(c.target=u.target),u.cursor&&(y.cursor=u.cursor),"blur"in u&&i.blur(u.blur),(u.path&&"path"==i.type||b)&&(c.path=function(t){var r=/[ahqstv]/gi,i=e._pathToAbsolute;if(n(t).match(r)&&(i=e._path2curve),r=/[clmz]/g,i==e._pathToAbsolute&&!n(t).match(r)){var s=n(t).replace(p,(function(e,t,n){var r=[],i="m"==t.toLowerCase(),s=h[t];return n.replace(m,(function(e){i&&2==r.length&&(s+=r+h["m"==t?"l":"L"],r=[]),r.push(a(e*v))})),s+r}));return s}var o,u,l=i(t);s=[];for(var c=0,g=l.length;c<g;c++){o=l[c],"z"==(u=l[c][0].toLowerCase())&&(u="x");for(var y=1,_=o.length;y<_;y++)u+=a(o[y]*v)+(y!=_-1?",":f);s.push(u)}return s.join(d)}(~n(g.path).toLowerCase().indexOf("r")?e._pathToAbsolute(g.path):g.path),i._.dirty=1,"image"==i.type&&(i._.fillpos=[g.x,g.y],i._.fillsize=[g.width,g.height],E(i,1,1,0,0,0))),"transform"in u&&i.transform(u.transform),A){var D=+g.cx,x=+g.cy,N=+g.rx||+g.r||0,O=+g.ry||+g.r||0;c.path=e.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x",a((D-N)*v),a((x-O)*v),a((D+N)*v),a((x+O)*v),a(D*v)),i._.dirty=1}if("clip-rect"in u){var P=n(u["clip-rect"]).split(l);if(4==P.length){P[2]=+P[2]+ +P[0],P[3]=+P[3]+ +P[1];var M=c.clipRect||e._g.doc.createElement("div"),k=M.style;k.clip=e.format("rect({1}px {2}px {3}px {0}px)",P),c.clipRect||(k.position="absolute",k.top=0,k.left=0,k.width=i.paper.width+"px",k.height=i.paper.height+"px",c.parentNode.insertBefore(M,c),M.appendChild(c),c.clipRect=M)}u["clip-rect"]||c.clipRect&&(c.clipRect.style.clip="auto")}if(i.textpath){var L=i.textpath.style;u.font&&(L.font=u.font),u["font-family"]&&(L.fontFamily='"'+u["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g,f)+'"'),u["font-size"]&&(L.fontSize=u["font-size"]),u["font-weight"]&&(L.fontWeight=u["font-weight"]),u["font-style"]&&(L.fontStyle=u["font-style"])}if("arrow-start"in u&&w(C,u["arrow-start"]),"arrow-end"in u&&w(C,u["arrow-end"],1),null!=u.opacity||null!=u.fill||null!=u.src||null!=u.stroke||null!=u["stroke-width"]||null!=u["stroke-opacity"]||null!=u["fill-opacity"]||null!=u["stroke-dasharray"]||null!=u["stroke-miterlimit"]||null!=u["stroke-linejoin"]||null!=u["stroke-linecap"]){var F=c.getElementsByTagName("fill");if(!(F=F&&F[0])&&(F=S("fill")),"image"==i.type&&u.src&&(F.src=u.src),u.fill&&(F.on=!0),null!=F.on&&"none"!=u.fill&&null!==u.fill||(F.on=!1),F.on&&u.fill){var U=n(u.fill).match(e._ISURL);if(U){F.parentNode==c&&c.removeChild(F),F.rotate=!0,F.src=U[1],F.type="tile";var B=i.getBBox(1);F.position=B.x+d+B.y,i._.fillpos=[B.x,B.y],e._preload(U[1],(function(){i._.fillsize=[this.offsetWidth,this.offsetHeight]}))}else F.color=e.getRGB(u.fill).hex,F.src=f,F.type="solid",e.getRGB(u.fill).error&&(C.type in{circle:1,ellipse:1}||"r"!=n(u.fill).charAt())&&I(C,u.fill,F)&&(g.fill="none",g.gradient=u.fill,F.rotate=!1)}if("fill-opacity"in u||"opacity"in u){var j=((+g["fill-opacity"]+1||2)-1)*((+g.opacity+1||2)-1)*((+e.getRGB(u.fill).o+1||2)-1);j=o(s(j,0),1),F.opacity=j,F.src&&(F.color="none")}c.appendChild(F);var q=c.getElementsByTagName("stroke")&&c.getElementsByTagName("stroke")[0],H=!1;!q&&(H=q=S("stroke")),(u.stroke&&"none"!=u.stroke||u["stroke-width"]||null!=u["stroke-opacity"]||u["stroke-dasharray"]||u["stroke-miterlimit"]||u["stroke-linejoin"]||u["stroke-linecap"])&&(q.on=!0),("none"==u.stroke||null===u.stroke||null==q.on||0==u.stroke||0==u["stroke-width"])&&(q.on=!1);var G=e.getRGB(u.stroke);q.on&&u.stroke&&(q.color=G.hex),j=((+g["stroke-opacity"]+1||2)-1)*((+g.opacity+1||2)-1)*((+G.o+1||2)-1);var V=.75*(r(u["stroke-width"])||1);if(j=o(s(j,0),1),null==u["stroke-width"]&&(V=g["stroke-width"]),u["stroke-width"]&&(q.weight=V),V&&V<1&&(j*=V)&&(q.weight=1),q.opacity=j,u["stroke-linejoin"]&&(q.joinstyle=u["stroke-linejoin"]||"miter"),q.miterlimit=u["stroke-miterlimit"]||8,u["stroke-linecap"]&&(q.endcap="butt"==u["stroke-linecap"]?"flat":"square"==u["stroke-linecap"]?"square":"round"),"stroke-dasharray"in u){var Y={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};q.dashstyle=Y[t](u["stroke-dasharray"])?Y[u["stroke-dasharray"]]:f}H&&c.appendChild(q)}if("text"==C.type){C.paper.canvas.style.display=f;var z=C.paper.span,Z=g.font&&g.font.match(/\d+(?:\.\d*)?(?=px)/);y=z.style,g.font&&(y.font=g.font),g["font-family"]&&(y.fontFamily=g["font-family"]),g["font-weight"]&&(y.fontWeight=g["font-weight"]),g["font-style"]&&(y.fontStyle=g["font-style"]),Z=r(g["font-size"]||Z&&Z[0])||10,y.fontSize=100*Z+"px",C.textpath.string&&(z.innerHTML=n(C.textpath.string).replace(/</g,"<").replace(/&/g,"&").replace(/\n/g,"<br>"));var K=z.getBoundingClientRect();C.W=g.w=(K.right-K.left)/100,C.H=g.h=(K.bottom-K.top)/100,C.X=g.x,C.Y=g.y+C.H/2,("x"in u||"y"in u)&&(C.path.v=e.format("m{0},{1}l{2},{1}",a(g.x*v),a(g.y*v),a(g.x*v)+1));for(var W=["x","y","text","font","font-family","font-weight","font-style","font-size"],X=0,$=W.length;X<$;X++)if(W[X]in u){C._.dirty=1;break}switch(g["text-anchor"]){case"start":C.textpath.style["v-text-align"]="left",C.bbx=C.W/2;break;case"end":C.textpath.style["v-text-align"]="right",C.bbx=-C.W/2;break;default:C.textpath.style["v-text-align"]="center",C.bbx=0}C.textpath.style["v-text-kern"]=!0}},I=function(t,a,s){t.attrs=t.attrs||{},t.attrs;var o=Math.pow,u="linear",l=".5 .5";if(t.attrs.gradient=a,a=(a=n(a).replace(e._radial_gradient,(function(e,t,n){return u="radial",t&&n&&(t=r(t),n=r(n),o(t-.5,2)+o(n-.5,2)>.25&&(n=i.sqrt(.25-o(t-.5,2))*(2*(n>.5)-1)+.5),l=t+d+n),f}))).split(/\s*\-\s*/),"linear"==u){var c=a.shift();if(c=-r(c),isNaN(c))return null}var h=e._parseDots(a);if(!h)return null;if(t=t.shape||t.node,h.length){t.removeChild(s),s.on=!0,s.method="none",s.color=h[0].color,s.color2=h[h.length-1].color;for(var p=[],g=0,m=h.length;g<m;g++)h[g].offset&&p.push(h[g].offset+d+h[g].color);s.colors=p.length?p.join():"0% "+s.color,"radial"==u?(s.type="gradientTitle",s.focus="100%",s.focussize="0 0",s.focusposition=l,s.angle=0):(s.type="gradient",s.angle=(270-c)%360),t.appendChild(s)}return 1},C=function(t,n){this[0]=this.node=t,t.raphael=!0,this.id=e._oid++,t.raphaelid=this.id,this.X=0,this.Y=0,this.attrs={},this.paper=n,this.matrix=e.matrix(),this._={transform:[],sx:1,sy:1,dx:0,dy:0,deg:0,dirty:1,dirtyT:1},!n.bottom&&(n.bottom=this),this.prev=n.top,n.top&&(n.top.next=this),n.top=this,this.next=null},R=e.el;C.prototype=R,R.constructor=C,R.transform=function(t){if(null==t)return this._.transform;var r,i=this.paper._viewBoxShift,a=i?"s"+[i.scale,i.scale]+"-1-1t"+[i.dx,i.dy]:f;i&&(r=t=n(t).replace(/\.{3}|\u2026/g,this._.transform||f)),e._extractTransform(this,a+t);var s,o=this.matrix.clone(),u=this.skew,l=this.node,c=~n(this.attrs.fill).indexOf("-"),h=!n(this.attrs.fill).indexOf("url(");if(o.translate(1,1),h||c||"image"==this.type)if(u.matrix="1 0 0 1",u.offset="0 0",s=o.split(),c&&s.noRotation||!s.isSimple){l.style.filter=o.toFilter();var p=this.getBBox(),g=this.getBBox(1),m=p.x-g.x,y=p.y-g.y;l.coordorigin=m*-v+d+y*-v,E(this,1,1,m,y,0)}else l.style.filter=f,E(this,s.scalex,s.scaley,s.dx,s.dy,s.rotate);else l.style.filter=f,u.matrix=n(o),u.offset=o.offset();return null!==r&&(this._.transform=r,e._extractTransform(this,r)),this},R.rotate=function(e,t,i){if(this.removed)return this;if(null!=e){if((e=n(e).split(l)).length-1&&(t=r(e[1]),i=r(e[2])),e=r(e[0]),null==i&&(t=i),null==t||null==i){var a=this.getBBox(1);t=a.x+a.width/2,i=a.y+a.height/2}return this._.dirtyT=1,this.transform(this._.transform.concat([["r",e,t,i]])),this}},R.translate=function(e,t){return this.removed||((e=n(e).split(l)).length-1&&(t=r(e[1])),e=r(e[0])||0,t=+t||0,this._.bbox&&(this._.bbox.x+=e,this._.bbox.y+=t),this.transform(this._.transform.concat([["t",e,t]]))),this},R.scale=function(e,t,i,a){if(this.removed)return this;if((e=n(e).split(l)).length-1&&(t=r(e[1]),i=r(e[2]),a=r(e[3]),isNaN(i)&&(i=null),isNaN(a)&&(a=null)),e=r(e[0]),null==t&&(t=e),null==a&&(i=a),null==i||null==a)var s=this.getBBox(1);return i=null==i?s.x+s.width/2:i,a=null==a?s.y+s.height/2:a,this.transform(this._.transform.concat([["s",e,t,i,a]])),this._.dirtyT=1,this},R.hide=function(){return!this.removed&&(this.node.style.display="none"),this},R.show=function(){return!this.removed&&(this.node.style.display=f),this},R.auxGetBBox=e.el.getBBox,R.getBBox=function(){var e=this.auxGetBBox();if(this.paper&&this.paper._viewBoxShift){var t={},n=1/this.paper._viewBoxShift.scale;return t.x=e.x-this.paper._viewBoxShift.dx,t.x*=n,t.y=e.y-this.paper._viewBoxShift.dy,t.y*=n,t.width=e.width*n,t.height=e.height*n,t.x2=t.x+t.width,t.y2=t.y+t.height,t}return e},R._getBBox=function(){return this.removed?{}:{x:this.X+(this.bbx||0)-this.W/2,y:this.Y-this.H,width:this.W,height:this.H}},R.remove=function(){if(!this.removed&&this.node.parentNode){for(var t in this.paper.__set__&&this.paper.__set__.exclude(this),e.eve.unbind("raphael.*.*."+this.id),e._tear(this,this.paper),this.node.parentNode.removeChild(this.node),this.shape&&this.shape.parentNode.removeChild(this.shape),this)this[t]="function"==typeof this[t]?e._removedFactory(t):null;this.removed=!0}},R.attr=function(n,r){if(this.removed)return this;if(null==n){var i={};for(var a in this.attrs)this.attrs[t](a)&&(i[a]=this.attrs[a]);return i.gradient&&"none"==i.fill&&(i.fill=i.gradient)&&delete i.gradient,i.transform=this._.transform,i}if(null==r&&e.is(n,"string")){if("fill"==n&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;for(var s=n.split(l),o={},u=0,d=s.length;u<d;u++)(n=s[u])in this.attrs?o[n]=this.attrs[n]:e.is(this.paper.customAttributes[n],"function")?o[n]=this.paper.customAttributes[n].def:o[n]=e._availableAttrs[n];return d-1?o:o[s[0]]}if(this.attrs&&null==r&&e.is(n,"array")){for(o={},u=0,d=n.length;u<d;u++)o[n[u]]=this.attr(n[u]);return o}var f;for(var h in null!=r&&((f={})[n]=r),null==r&&e.is(n,"object")&&(f=n),f)c("raphael.attr."+h+"."+this.id,this,f[h]);if(f){for(h in this.paper.customAttributes)if(this.paper.customAttributes[t](h)&&f[t](h)&&e.is(this.paper.customAttributes[h],"function")){var p=this.paper.customAttributes[h].apply(this,[].concat(f[h]));for(var g in this.attrs[h]=f[h],p)p[t](g)&&(f[g]=p[g])}f.text&&"text"==this.type&&(this.textpath.string=f.text),A(this,f)}return this},R.toFront=function(){return!this.removed&&this.node.parentNode.appendChild(this.node),this.paper&&this.paper.top!=this&&e._tofront(this,this.paper),this},R.toBack=function(){return this.removed||this.node.parentNode.firstChild!=this.node&&(this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild),e._toback(this,this.paper)),this},R.insertAfter=function(t){return this.removed||(t.constructor==e.st.constructor&&(t=t[t.length-1]),t.node.nextSibling?t.node.parentNode.insertBefore(this.node,t.node.nextSibling):t.node.parentNode.appendChild(this.node),e._insertafter(this,t,this.paper)),this},R.insertBefore=function(t){return this.removed||(t.constructor==e.st.constructor&&(t=t[0]),t.node.parentNode.insertBefore(this.node,t.node),e._insertbefore(this,t,this.paper)),this},R.blur=function(t){var n=this.node.runtimeStyle,r=n.filter;return r=r.replace(g,f),0!=+t?(this.attrs.blur=t,n.filter=r+d+" progid:DXImageTransform.Microsoft.Blur(pixelradius="+(+t||1.5)+")",n.margin=e.format("-{0}px 0 0 -{0}px",a(+t||1.5))):(n.filter=r,n.margin=0,delete this.attrs.blur),this},e._engine.path=function(e,t){var n=S("shape");n.style.cssText=y,n.coordsize=v+d+v,n.coordorigin=t.coordorigin;var r=new C(n,t),i={fill:"none",stroke:"#000"};e&&(i.path=e),r.type="path",r.path=[],r.Path=f,A(r,i),t.canvas&&t.canvas.appendChild(n);var a=S("skew");return a.on=!0,n.appendChild(a),r.skew=a,r.transform(f),r},e._engine.rect=function(t,n,r,i,a,s){var o=e._rectPath(n,r,i,a,s),u=t.path(o),l=u.attrs;return u.X=l.x=n,u.Y=l.y=r,u.W=l.width=i,u.H=l.height=a,l.r=s,l.path=o,u.type="rect",u},e._engine.ellipse=function(e,t,n,r,i){var a=e.path();return a.attrs,a.X=t-r,a.Y=n-i,a.W=2*r,a.H=2*i,a.type="ellipse",A(a,{cx:t,cy:n,rx:r,ry:i}),a},e._engine.circle=function(e,t,n,r){var i=e.path();return i.attrs,i.X=t-r,i.Y=n-r,i.W=i.H=2*r,i.type="circle",A(i,{cx:t,cy:n,r}),i},e._engine.image=function(t,n,r,i,a,s){var o=e._rectPath(r,i,a,s),u=t.path(o).attr({stroke:"none"}),l=u.attrs,c=u.node,d=c.getElementsByTagName("fill")[0];return l.src=n,u.X=l.x=r,u.Y=l.y=i,u.W=l.width=a,u.H=l.height=s,l.path=o,u.type="image",d.parentNode==c&&c.removeChild(d),d.rotate=!0,d.src=n,d.type="tile",u._.fillpos=[r,i],u._.fillsize=[a,s],c.appendChild(d),E(u,1,1,0,0,0),u},e._engine.text=function(t,r,i,s){var o=S("shape"),u=S("path"),l=S("textpath");r=r||0,i=i||0,s=s||"",u.v=e.format("m{0},{1}l{2},{1}",a(r*v),a(i*v),a(r*v)+1),u.textpathok=!0,l.string=n(s),l.on=!0,o.style.cssText=y,o.coordsize=v+d+v,o.coordorigin="0 0";var c=new C(o,t),h={fill:"#000",stroke:"none",font:e._availableAttrs.font,text:s};c.shape=o,c.path=u,c.textpath=l,c.type="text",c.attrs.text=n(s),c.attrs.x=r,c.attrs.y=i,c.attrs.w=1,c.attrs.h=1,A(c,h),o.appendChild(l),o.appendChild(u),t.canvas.appendChild(o);var p=S("skew");return p.on=!0,o.appendChild(p),c.skew=p,c.transform(f),c},e._engine.setSize=function(t,n){var r=this.canvas.style;return this.width=t,this.height=n,t==+t&&(t+="px"),n==+n&&(n+="px"),r.width=t,r.height=n,r.clip="rect(0 "+t+" "+n+" 0)",this._viewBox&&e._engine.setViewBox.apply(this,this._viewBox),this},e._engine.setViewBox=function(t,n,r,i,a){e.eve("raphael.setViewBox",this,this._viewBox,[t,n,r,i,a]);var s,o,u=this.getSize(),l=u.width,c=u.height;return a&&(r*(s=c/i)<l&&(t-=(l-r*s)/2/s),i*(o=l/r)<c&&(n-=(c-i*o)/2/o)),this._viewBox=[t,n,r,i,!!a],this._viewBoxShift={dx:-t,dy:-n,scale:u},this.forEach((function(e){e.transform("...")})),this},e._engine.initWin=function(e){var t=e.document;t.styleSheets.length<31?t.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)"):t.styleSheets[0].addRule(".rvml","behavior:url(#default#VML)");try{!t.namespaces.rvml&&t.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),S=function(e){return t.createElement("<rvml:"+e+' class="rvml">')}}catch(e){S=function(e){return t.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},e._engine.initWin(e._g.win),e._engine.create=function(){var t=e._getContainer.apply(0,arguments),n=t.container,r=t.height,i=t.width,a=t.x,s=t.y;if(!n)throw new Error("VML container not found.");var o=new e._Paper,u=o.canvas=e._g.doc.createElement("div"),l=u.style;return a=a||0,s=s||0,i=i||512,r=r||342,o.width=i,o.height=r,i==+i&&(i+="px"),r==+r&&(r+="px"),o.coordsize="21600000 21600000",o.coordorigin="0 0",o.span=e._g.doc.createElement("span"),o.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",u.appendChild(o.span),l.cssText=e.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",i,r),1==n?(e._g.doc.body.appendChild(u),l.left=a+"px",l.top=s+"px",l.position="absolute"):n.firstChild?n.insertBefore(u,n.firstChild):n.appendChild(u),o.renderfix=function(){},o},e.prototype.clear=function(){e.eve("raphael.clear",this),this.canvas.innerHTML=f,this.span=e._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},e.prototype.remove=function(){for(var t in e.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas),this)this[t]="function"==typeof this[t]?e._removedFactory(t):null;return!0};var D=e.st;for(var x in R)R[t](x)&&!D[t](x)&&(D[x]=function(e){return function(){var t=arguments;return this.forEach((function(n){n[e].apply(n,t)}))}}(x))}}.apply(t,r))||(e.exports=i)}])},5974:e=>{e.exports=function(e,t){var n,r=null;try{n=JSON.parse(e,t)}catch(e){r=e}return[r,n]}},4875:(e,t,n)=>{"use strict";t.Qc=function(e,t){var n=t&&t.assetType?t.assetType:"svg",r=t&&t.buildUrl?t.buildUrl:function(e,t){return"png"===t?"https://twemoji.maxcdn.com/2/72x72/"+e+".png":"https://twemoji.maxcdn.com/2/svg/"+e+".svg"},s=[];for(i.default.lastIndex=0;;){var o=i.default.exec(e);if(!o)break;var c=o[0],d=l(u(c)).join("-");s.push({url:d?r(d,n):"",indices:[o.index,i.default.lastIndex],text:c,type:a})}return s};var r,i=(r=n(2924))&&r.__esModule?r:{default:r},a="emoji",s=/\uFE0F/g,o=String.fromCharCode(8205),u=function(e){return e.indexOf(o)<0?e.replace(s,""):e};function l(e){for(var t=[],n=0,r=0,i=0;i<e.length;)n=e.charCodeAt(i++),r?(t.push((65536+(r-55296<<10)+(n-56320)).toString(16)),r=0):n>55296&&n<=56319?r=n:t.push(n.toString(16));return t}},2924:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=/(?:\ud83d[\udc68\udc69])(?:\ud83c[\udffb-\udfff])?\u200d(?:\u2695\ufe0f|\u2696\ufe0f|\u2708\ufe0f|\ud83c[\udf3e\udf73\udf93\udfa4\udfa8\udfeb\udfed]|\ud83d[\udcbb\udcbc\udd27\udd2c\ude80\ude92]|\ud83e[\uddb0-\uddb3])|(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75]|\u26f9)((?:\ud83c[\udffb-\udfff]|\ufe0f)\u200d[\u2640\u2642]\ufe0f)|(?:\ud83c[\udfc3\udfc4\udfca]|\ud83d[\udc6e\udc71\udc73\udc77\udc81\udc82\udc86\udc87\ude45-\ude47\ude4b\ude4d\ude4e\udea3\udeb4-\udeb6]|\ud83e[\udd26\udd35\udd37-\udd39\udd3d\udd3e\uddb8\uddb9\uddd6-\udddd])(?:\ud83c[\udffb-\udfff])?\u200d[\u2640\u2642]\ufe0f|(?:\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d[\udc68\udc69]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68|\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d[\udc68\udc69]|\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83c\udff3\ufe0f\u200d\ud83c\udf08|\ud83c\udff4\u200d\u2620\ufe0f|\ud83d\udc41\u200d\ud83d\udde8|\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc6f\u200d\u2640\ufe0f|\ud83d\udc6f\u200d\u2642\ufe0f|\ud83e\udd3c\u200d\u2640\ufe0f|\ud83e\udd3c\u200d\u2642\ufe0f|\ud83e\uddde\u200d\u2640\ufe0f|\ud83e\uddde\u200d\u2642\ufe0f|\ud83e\udddf\u200d\u2640\ufe0f|\ud83e\udddf\u200d\u2642\ufe0f)|[#*0-9]\ufe0f?\u20e3|(?:[©®\u2122\u265f]\ufe0f)|(?:\ud83c[\udc04\udd70\udd71\udd7e\udd7f\ude02\ude1a\ude2f\ude37\udf21\udf24-\udf2c\udf36\udf7d\udf96\udf97\udf99-\udf9b\udf9e\udf9f\udfcd\udfce\udfd4-\udfdf\udff3\udff5\udff7]|\ud83d[\udc3f\udc41\udcfd\udd49\udd4a\udd6f\udd70\udd73\udd76-\udd79\udd87\udd8a-\udd8d\udda5\udda8\uddb1\uddb2\uddbc\uddc2-\uddc4\uddd1-\uddd3\udddc-\uddde\udde1\udde3\udde8\uddef\uddf3\uddfa\udecb\udecd-\udecf\udee0-\udee5\udee9\udef0\udef3]|[\u203c\u2049\u2139\u2194-\u2199\u21a9\u21aa\u231a\u231b\u2328\u23cf\u23ed-\u23ef\u23f1\u23f2\u23f8-\u23fa\u24c2\u25aa\u25ab\u25b6\u25c0\u25fb-\u25fe\u2600-\u2604\u260e\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262a\u262e\u262f\u2638-\u263a\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267b\u267f\u2692-\u2697\u2699\u269b\u269c\u26a0\u26a1\u26aa\u26ab\u26b0\u26b1\u26bd\u26be\u26c4\u26c5\u26c8\u26cf\u26d1\u26d3\u26d4\u26e9\u26ea\u26f0-\u26f5\u26f8\u26fa\u26fd\u2702\u2708\u2709\u270f\u2712\u2714\u2716\u271d\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u2764\u27a1\u2934\u2935\u2b05-\u2b07\u2b1b\u2b1c\u2b50\u2b55\u3030\u303d\u3297\u3299])(?:\ufe0f|(?!\ufe0e))|(?:(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75\udd90]|[\u261d\u26f7\u26f9\u270c\u270d])(?:\ufe0f|(?!\ufe0e))|(?:\ud83c[\udf85\udfc2-\udfc4\udfc7\udfca]|\ud83d[\udc42\udc43\udc46-\udc50\udc66-\udc69\udc6e\udc70-\udc78\udc7c\udc81-\udc83\udc85-\udc87\udcaa\udd7a\udd95\udd96\ude45-\ude47\ude4b-\ude4f\udea3\udeb4-\udeb6\udec0\udecc]|\ud83e[\udd18-\udd1c\udd1e\udd1f\udd26\udd30-\udd39\udd3d\udd3e\uddb5\uddb6\uddb8\uddb9\uddd1-\udddd]|[\u270a\u270b]))(?:\ud83c[\udffb-\udfff])?|(?:\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc73\udb40\udc63\udb40\udc74\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc77\udb40\udc6c\udb40\udc73\udb40\udc7f|\ud83c\udde6\ud83c[\udde8-\uddec\uddee\uddf1\uddf2\uddf4\uddf6-\uddfa\uddfc\uddfd\uddff]|\ud83c\udde7\ud83c[\udde6\udde7\udde9-\uddef\uddf1-\uddf4\uddf6-\uddf9\uddfb\uddfc\uddfe\uddff]|\ud83c\udde8\ud83c[\udde6\udde8\udde9\uddeb-\uddee\uddf0-\uddf5\uddf7\uddfa-\uddff]|\ud83c\udde9\ud83c[\uddea\uddec\uddef\uddf0\uddf2\uddf4\uddff]|\ud83c\uddea\ud83c[\udde6\udde8\uddea\uddec\udded\uddf7-\uddfa]|\ud83c\uddeb\ud83c[\uddee-\uddf0\uddf2\uddf4\uddf7]|\ud83c\uddec\ud83c[\udde6\udde7\udde9-\uddee\uddf1-\uddf3\uddf5-\uddfa\uddfc\uddfe]|\ud83c\udded\ud83c[\uddf0\uddf2\uddf3\uddf7\uddf9\uddfa]|\ud83c\uddee\ud83c[\udde8-\uddea\uddf1-\uddf4\uddf6-\uddf9]|\ud83c\uddef\ud83c[\uddea\uddf2\uddf4\uddf5]|\ud83c\uddf0\ud83c[\uddea\uddec-\uddee\uddf2\uddf3\uddf5\uddf7\uddfc\uddfe\uddff]|\ud83c\uddf1\ud83c[\udde6-\udde8\uddee\uddf0\uddf7-\uddfb\uddfe]|\ud83c\uddf2\ud83c[\udde6\udde8-\udded\uddf0-\uddff]|\ud83c\uddf3\ud83c[\udde6\udde8\uddea-\uddec\uddee\uddf1\uddf4\uddf5\uddf7\uddfa\uddff]|\ud83c\uddf4\ud83c\uddf2|\ud83c\uddf5\ud83c[\udde6\uddea-\udded\uddf0-\uddf3\uddf7-\uddf9\uddfc\uddfe]|\ud83c\uddf6\ud83c\udde6|\ud83c\uddf7\ud83c[\uddea\uddf4\uddf8\uddfa\uddfc]|\ud83c\uddf8\ud83c[\udde6-\uddea\uddec-\uddf4\uddf7-\uddf9\uddfb\uddfd-\uddff]|\ud83c\uddf9\ud83c[\udde6\udde8\udde9\uddeb-\udded\uddef-\uddf4\uddf7\uddf9\uddfb\uddfc\uddff]|\ud83c\uddfa\ud83c[\udde6\uddec\uddf2\uddf3\uddf8\uddfe\uddff]|\ud83c\uddfb\ud83c[\udde6\udde8\uddea\uddec\uddee\uddf3\uddfa]|\ud83c\uddfc\ud83c[\uddeb\uddf8]|\ud83c\uddfd\ud83c\uddf0|\ud83c\uddfe\ud83c[\uddea\uddf9]|\ud83c\uddff\ud83c[\udde6\uddf2\uddfc]|\ud83c[\udccf\udd8e\udd91-\udd9a\udde6-\uddff\ude01\ude32-\ude36\ude38-\ude3a\ude50\ude51\udf00-\udf20\udf2d-\udf35\udf37-\udf7c\udf7e-\udf84\udf86-\udf93\udfa0-\udfc1\udfc5\udfc6\udfc8\udfc9\udfcf-\udfd3\udfe0-\udff0\udff4\udff8-\udfff]|\ud83d[\udc00-\udc3e\udc40\udc44\udc45\udc51-\udc65\udc6a-\udc6d\udc6f\udc79-\udc7b\udc7d-\udc80\udc84\udc88-\udca9\udcab-\udcfc\udcff-\udd3d\udd4b-\udd4e\udd50-\udd67\udda4\uddfb-\ude44\ude48-\ude4a\ude80-\udea2\udea4-\udeb3\udeb7-\udebf\udec1-\udec5\uded0-\uded2\udeeb\udeec\udef4-\udef9]|\ud83e[\udd10-\udd17\udd1d\udd20-\udd25\udd27-\udd2f\udd3a\udd3c\udd40-\udd45\udd47-\udd70\udd73-\udd76\udd7a\udd7c-\udda2\uddb4\uddb7\uddc0-\uddc2\uddd0\uddde-\uddff]|[\u23e9-\u23ec\u23f0\u23f3\u267e\u26ce\u2705\u2728\u274c\u274e\u2753-\u2755\u2795-\u2797\u27b0\u27bf\ue50a])|\ufe0f/g},1454:function(e,t,n){var r;e=n.nmd(e),function(i){t&&t.nodeType,e&&e.nodeType;var a="object"==typeof n.g&&n.g;a.global!==a&&a.window!==a&&a.self;var s,o=2147483647,u=36,l=26,c=38,d=700,f=/^xn--/,h=/[^\x20-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,g={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=u-1,y=Math.floor,v=String.fromCharCode;function _(e){throw new RangeError(g[e])}function T(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function b(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+T((e=e.replace(p,".")).split("."),t).join(".")}function E(e){for(var t,n,r=[],i=0,a=e.length;i<a;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<a?56320==(64512&(n=e.charCodeAt(i++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--):r.push(t);return r}function S(e){return T(e,(function(e){var t="";return e>65535&&(t+=v((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+v(e)})).join("")}function w(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function A(e,t,n){var r=0;for(e=n?y(e/d):e>>1,e+=y(e/t);e>m*l>>1;r+=u)e=y(e/m);return y(r+(m+1)*e/(e+c))}function I(e){var t,n,r,i,a,s,c,d,f,h,p,g=[],m=e.length,v=0,T=128,b=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&_("not-basic"),g.push(e.charCodeAt(r));for(i=n>0?n+1:0;i<m;){for(a=v,s=1,c=u;i>=m&&_("invalid-input"),((d=(p=e.charCodeAt(i++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:u)>=u||d>y((o-v)/s))&&_("overflow"),v+=d*s,!(d<(f=c<=b?1:c>=b+l?l:c-b));c+=u)s>y(o/(h=u-f))&&_("overflow"),s*=h;b=A(v-a,t=g.length+1,0==a),y(v/t)>o-T&&_("overflow"),T+=y(v/t),v%=t,g.splice(v++,0,T)}return S(g)}function C(e){var t,n,r,i,a,s,c,d,f,h,p,g,m,T,b,S=[];for(g=(e=E(e)).length,t=128,n=0,a=72,s=0;s<g;++s)(p=e[s])<128&&S.push(v(p));for(r=i=S.length,i&&S.push("-");r<g;){for(c=o,s=0;s<g;++s)(p=e[s])>=t&&p<c&&(c=p);for(c-t>y((o-n)/(m=r+1))&&_("overflow"),n+=(c-t)*m,t=c,s=0;s<g;++s)if((p=e[s])<t&&++n>o&&_("overflow"),p==t){for(d=n,f=u;!(d<(h=f<=a?1:f>=a+l?l:f-a));f+=u)b=d-h,T=u-h,S.push(v(w(h+b%T,0))),d=y(b/T);S.push(v(w(d,0))),a=A(n,m,r==i),n=0,++r}++n,++t}return S.join("")}s={version:"1.4.1",ucs2:{decode:E,encode:S},decode:I,encode:C,toASCII:function(e){return b(e,(function(e){return h.test(e)?"xn--"+C(e):e}))},toUnicode:function(e){return b(e,(function(e){return f.test(e)?I(e.slice(4).toLowerCase()):e}))}},void 0===(r=function(){return s}.call(t,n,t,e))||(e.exports=r)}()},9945:function(e){var t,n,r,i,a;t=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,n=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,i=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(e,t,r){if(r=r||{},e=e.trim(),!(t=t.trim())){if(!r.alwaysNormalize)return e;var i=a.parseURL(e);if(!i)throw new Error("Error trying to parse base URL.");return i.path=a.normalizePath(i.path),a.buildURLFromParts(i)}var s=a.parseURL(t);if(!s)throw new Error("Error trying to parse relative URL.");if(s.scheme)return r.alwaysNormalize?(s.path=a.normalizePath(s.path),a.buildURLFromParts(s)):t;var o=a.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var u=n.exec(o.path);o.netLoc=u[1],o.path=u[2]}o.netLoc&&!o.path&&(o.path="/");var l={scheme:o.scheme,netLoc:s.netLoc,path:null,params:s.params,query:s.query,fragment:s.fragment};if(!s.netLoc&&(l.netLoc=o.netLoc,"/"!==s.path[0]))if(s.path){var c=o.path,d=c.substring(0,c.lastIndexOf("/")+1)+s.path;l.path=a.normalizePath(d)}else l.path=o.path,s.params||(l.params=o.params,s.query||(l.query=o.query));return null===l.path&&(l.path=r.alwaysNormalize?a.normalizePath(s.path):s.path),a.buildURLFromParts(l)},parseURL:function(e){var n=t.exec(e);return n?{scheme:n[1]||"",netLoc:n[2]||"",path:n[3]||"",params:n[4]||"",query:n[5]||"",fragment:n[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(r,"");e.length!==(e=e.replace(i,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=a},3033:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>hs});var r=n(8908),i=n.n(r),a=n(9144),s=n.n(a),o=n(7537),u=n.n(o),l=n(5974),c=n.n(l),d=n(9603),f=n.n(d),h=n(3407),p=n.n(h),g=n(7462),m=n(9945),y=n.n(m);const v=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=i().location&&i().location.href||"");var n="function"==typeof i().URL,r=/^\/\//.test(e),a=!i().location&&!/\/\//i.test(e);if(n?e=new(i().URL)(e,i().location||"http://example.com"):/\/\//i.test(e)||(e=y().buildAbsoluteURL(i().location&&i().location.href||"",e)),n){var s=new URL(t,e);return a?s.href.slice(18):r?s.href.slice(s.protocol.length):s.href}return y().buildAbsoluteURL(e,t)};var _=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(n,1),n>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var n=t.length,r=0;r<n;++r)t[r].call(this,arguments[1]);else for(var i=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,i)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}();function T(e){for(var t=function(e){return i().atob?i().atob(e):Buffer.from(e,"base64").toString("binary")}(e),n=new Uint8Array(t.length),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}class b extends _{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const E=String.fromCharCode(9),S=function(e){const t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),n={};return t[1]&&(n.length=parseInt(t[1],10)),t[2]&&(n.offset=parseInt(t[2],10)),n},w=function(e){const t={};if(!e)return t;const n=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))'));let r,i=n.length;for(;i--;)""!==n[i]&&(r=/([^=]*)=(.*)/.exec(n[i]).slice(1),r[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),t[r[0]]=r[1]);return t};class A extends _{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,n;0!==(e=e.trim()).length&&("#"===e[0]?this.tagMappers.reduce(((t,n)=>{const r=n(e);return r===e?t:t.concat([r])}),[e]).forEach((e=>{for(let t=0;t<this.customParsers.length;t++)if(this.customParsers[t].call(this,e))return;if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e),t)this.trigger("data",{type:"tag",tagType:"m3u"});else{if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(e),t)return n={type:"tag",tagType:"inf"},t[1]&&(n.duration=parseFloat(t[1])),t[2]&&(n.title=t[2]),void this.trigger("data",n);if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(e),t)return n={type:"tag",tagType:"targetduration"},t[1]&&(n.duration=parseInt(t[1],10)),void this.trigger("data",n);if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(e),t)return n={type:"tag",tagType:"version"},t[1]&&(n.version=parseInt(t[1],10)),void this.trigger("data",n);if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(e),t)return n={type:"tag",tagType:"media-sequence"},t[1]&&(n.number=parseInt(t[1],10)),void this.trigger("data",n);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(e),t)return n={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(n.number=parseInt(t[1],10)),void this.trigger("data",n);if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(e),t)return n={type:"tag",tagType:"playlist-type"},t[1]&&(n.playlistType=t[1]),void this.trigger("data",n);if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(e),t)return n=(0,g.Z)(S(t[1]),{type:"tag",tagType:"byterange"}),void this.trigger("data",n);if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(e),t)return n={type:"tag",tagType:"allow-cache"},t[1]&&(n.allowed=!/NO/.test(t[1])),void this.trigger("data",n);if(t=/^#EXT-X-MAP:(.*)$/.exec(e),t){if(n={type:"tag",tagType:"map"},t[1]){const e=w(t[1]);e.URI&&(n.uri=e.URI),e.BYTERANGE&&(n.byterange=S(e.BYTERANGE))}this.trigger("data",n)}else if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(e),t){if(n={type:"tag",tagType:"stream-inf"},t[1]){if(n.attributes=w(t[1]),n.attributes.RESOLUTION){const e=n.attributes.RESOLUTION.split("x"),t={};e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),n.attributes.RESOLUTION=t}n.attributes.BANDWIDTH&&(n.attributes.BANDWIDTH=parseInt(n.attributes.BANDWIDTH,10)),n.attributes["FRAME-RATE"]&&(n.attributes["FRAME-RATE"]=parseFloat(n.attributes["FRAME-RATE"])),n.attributes["PROGRAM-ID"]&&(n.attributes["PROGRAM-ID"]=parseInt(n.attributes["PROGRAM-ID"],10))}this.trigger("data",n)}else{if(t=/^#EXT-X-MEDIA:(.*)$/.exec(e),t)return n={type:"tag",tagType:"media"},t[1]&&(n.attributes=w(t[1])),void this.trigger("data",n);if(t=/^#EXT-X-ENDLIST/.exec(e),t)this.trigger("data",{type:"tag",tagType:"endlist"});else if(t=/^#EXT-X-DISCONTINUITY/.exec(e),t)this.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(e),t)return n={type:"tag",tagType:"program-date-time"},t[1]&&(n.dateTimeString=t[1],n.dateTimeObject=new Date(t[1])),void this.trigger("data",n);if(t=/^#EXT-X-KEY:(.*)$/.exec(e),t)return n={type:"tag",tagType:"key"},t[1]&&(n.attributes=w(t[1]),n.attributes.IV&&("0x"===n.attributes.IV.substring(0,2).toLowerCase()&&(n.attributes.IV=n.attributes.IV.substring(2)),n.attributes.IV=n.attributes.IV.match(/.{8}/g),n.attributes.IV[0]=parseInt(n.attributes.IV[0],16),n.attributes.IV[1]=parseInt(n.attributes.IV[1],16),n.attributes.IV[2]=parseInt(n.attributes.IV[2],16),n.attributes.IV[3]=parseInt(n.attributes.IV[3],16),n.attributes.IV=new Uint32Array(n.attributes.IV))),void this.trigger("data",n);if(t=/^#EXT-X-START:(.*)$/.exec(e),t)return n={type:"tag",tagType:"start"},t[1]&&(n.attributes=w(t[1]),n.attributes["TIME-OFFSET"]=parseFloat(n.attributes["TIME-OFFSET"]),n.attributes.PRECISE=/YES/.test(n.attributes.PRECISE)),void this.trigger("data",n);if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(e),t)return n={type:"tag",tagType:"cue-out-cont"},t[1]?n.data=t[1]:n.data="",void this.trigger("data",n);if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(e),t)return n={type:"tag",tagType:"cue-out"},t[1]?n.data=t[1]:n.data="",void this.trigger("data",n);if(t=/^#EXT-X-CUE-IN:(.*)?$/.exec(e),t)return n={type:"tag",tagType:"cue-in"},t[1]?n.data=t[1]:n.data="",void this.trigger("data",n);if(t=/^#EXT-X-SKIP:(.*)$/.exec(e),t&&t[1])return n={type:"tag",tagType:"skip"},n.attributes=w(t[1]),n.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(n.attributes["SKIPPED-SEGMENTS"]=parseInt(n.attributes["SKIPPED-SEGMENTS"],10)),n.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(n.attributes["RECENTLY-REMOVED-DATERANGES"]=n.attributes["RECENTLY-REMOVED-DATERANGES"].split(E)),void this.trigger("data",n);if(t=/^#EXT-X-PART:(.*)$/.exec(e),t&&t[1])return n={type:"tag",tagType:"part"},n.attributes=w(t[1]),["DURATION"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))})),["INDEPENDENT","GAP"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=/YES/.test(n.attributes[e]))})),n.attributes.hasOwnProperty("BYTERANGE")&&(n.attributes.byterange=S(n.attributes.BYTERANGE)),void this.trigger("data",n);if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e),t&&t[1])return n={type:"tag",tagType:"server-control"},n.attributes=w(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))})),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=/YES/.test(n.attributes[e]))})),void this.trigger("data",n);if(t=/^#EXT-X-PART-INF:(.*)$/.exec(e),t&&t[1])return n={type:"tag",tagType:"part-inf"},n.attributes=w(t[1]),["PART-TARGET"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))})),void this.trigger("data",n);if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e),t&&t[1])return n={type:"tag",tagType:"preload-hint"},n.attributes=w(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach((function(e){if(n.attributes.hasOwnProperty(e)){n.attributes[e]=parseInt(n.attributes[e],10);const t="BYTERANGE-LENGTH"===e?"length":"offset";n.attributes.byterange=n.attributes.byterange||{},n.attributes.byterange[t]=n.attributes[e],delete n.attributes[e]}})),void this.trigger("data",n);if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e),t&&t[1])return n={type:"tag",tagType:"rendition-report"},n.attributes=w(t[1]),["LAST-MSN","LAST-PART"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseInt(n.attributes[e],10))})),void this.trigger("data",n);if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(e),t&&t[1]){n={type:"tag",tagType:"daterange"},n.attributes=w(t[1]),["ID","CLASS"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=String(n.attributes[e]))})),["START-DATE","END-DATE"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=new Date(n.attributes[e]))})),["DURATION","PLANNED-DURATION"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))})),["END-ON-NEXT"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=/YES/i.test(n.attributes[e]))})),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=n.attributes[e].toString(16))}));const e=/^X-([A-Z]+-)+[A-Z]+$/;for(const t in n.attributes){if(!e.test(t))continue;const r=/[0-9A-Fa-f]{6}/g.test(n.attributes[t]),i=/^\d+(\.\d+)?$/.test(n.attributes[t]);n.attributes[t]=r?n.attributes[t].toString(16):i?parseFloat(n.attributes[t]):String(n.attributes[t])}this.trigger("data",n)}else if(t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(e),t)this.trigger("data",{type:"tag",tagType:"independent-segments"});else{if(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(e),t)return n={type:"tag",tagType:"content-steering"},n.attributes=w(t[1]),void this.trigger("data",n);this.trigger("data",{type:"tag",data:e.slice(4)})}}}}else this.trigger("data",{type:"comment",text:e.slice(1)})})):this.trigger("data",{type:"uri",uri:e}))}addParser({expression:e,customType:t,dataParser:n,segment:r}){"function"!=typeof n&&(n=e=>e),this.customParsers.push((i=>{if(e.exec(i))return this.trigger("data",{type:"custom",data:n(i),customType:t,segment:r}),!0}))}addTagMapper({expression:e,map:t}){this.tagMappers.push((n=>e.test(n)?t(n):n))}}const I=function(e){const t={};return Object.keys(e).forEach((function(n){var r;t[(r=n,r.toLowerCase().replace(/-(\w)/g,(e=>e[1].toUpperCase())))]=e[n]})),t},C=function(e){const{serverControl:t,targetDuration:n,partTargetDuration:r}=e;if(!t)return;const i="#EXT-X-SERVER-CONTROL",a="holdBack",s="partHoldBack",o=n&&3*n,u=r&&2*r;n&&!t.hasOwnProperty(a)&&(t[a]=o,this.trigger("info",{message:`${i} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&t[a]<o&&(this.trigger("warn",{message:`${i} clamping HOLD-BACK (${t[a]}) to targetDuration * 3 (${o})`}),t[a]=o),r&&!t.hasOwnProperty(s)&&(t[s]=3*r,this.trigger("info",{message:`${i} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${t[s]}).`})),r&&t[s]<u&&(this.trigger("warn",{message:`${i} clamping PART-HOLD-BACK (${t[s]}) to partTargetDuration * 2 (${u}).`}),t[s]=u)};class R extends _{constructor(){super(),this.lineStream=new b,this.parseStream=new A,this.lineStream.pipe(this.parseStream),this.lastProgramDateTime=null;const e=this,t=[];let n,r,i={},a=!1;const s=function(){},o={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}};let u=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],segments:[]};let l=0,c=0;const d={};this.on("end",(()=>{i.uri||!i.parts&&!i.preloadHints||(!i.map&&n&&(i.map=n),!i.key&&r&&(i.key=r),i.timeline||"number"!=typeof u||(i.timeline=u),this.manifest.preloadSegment=i)})),this.parseStream.on("data",(function(f){let h,p;({tag(){({version(){f.version&&(this.manifest.version=f.version)},"allow-cache"(){this.manifest.allowCache=f.allowed,"allowed"in f||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const e={};"length"in f&&(i.byterange=e,e.length=f.length,"offset"in f||(f.offset=l)),"offset"in f&&(i.byterange=e,e.offset=f.offset),l=e.offset+e.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),f.title&&(i.title=f.title),f.duration>0&&(i.duration=f.duration),0===f.duration&&(i.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=t},key(){if(f.attributes)if("NONE"!==f.attributes.METHOD)if(f.attributes.URI){if("com.apple.streamingkeydelivery"===f.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:f.attributes});if("com.microsoft.playready"===f.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:f.attributes.URI});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===f.attributes.KEYFORMAT)return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(f.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===f.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==f.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):f.attributes.KEYID&&"0x"===f.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:f.attributes.KEYFORMAT,keyId:f.attributes.KEYID.substring(2)},pssh:T(f.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));f.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),r={method:f.attributes.METHOD||"AES-128",uri:f.attributes.URI},void 0!==f.attributes.IV&&(r.iv=f.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else r=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence"(){isFinite(f.number)?this.manifest.mediaSequence=f.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+f.number})},"discontinuity-sequence"(){isFinite(f.number)?(this.manifest.discontinuitySequence=f.number,u=f.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+f.number})},"playlist-type"(){/VOD|EVENT/.test(f.playlistType)?this.manifest.playlistType=f.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+f.playlist})},map(){n={},f.uri&&(n.uri=f.uri),f.byterange&&(n.byterange=f.byterange),r&&(n.key=r)},"stream-inf"(){this.manifest.playlists=t,this.manifest.mediaGroups=this.manifest.mediaGroups||o,f.attributes?(i.attributes||(i.attributes={}),(0,g.Z)(i.attributes,f.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||o,!(f.attributes&&f.attributes.TYPE&&f.attributes["GROUP-ID"]&&f.attributes.NAME))return void this.trigger("warn",{message:"ignoring incomplete or missing media group"});const e=this.manifest.mediaGroups[f.attributes.TYPE];e[f.attributes["GROUP-ID"]]=e[f.attributes["GROUP-ID"]]||{},h=e[f.attributes["GROUP-ID"]],p={default:/yes/i.test(f.attributes.DEFAULT)},p.default?p.autoselect=!0:p.autoselect=/yes/i.test(f.attributes.AUTOSELECT),f.attributes.LANGUAGE&&(p.language=f.attributes.LANGUAGE),f.attributes.URI&&(p.uri=f.attributes.URI),f.attributes["INSTREAM-ID"]&&(p.instreamId=f.attributes["INSTREAM-ID"]),f.attributes.CHARACTERISTICS&&(p.characteristics=f.attributes.CHARACTERISTICS),f.attributes.FORCED&&(p.forced=/yes/i.test(f.attributes.FORCED)),h[f.attributes.NAME]=p},discontinuity(){u+=1,i.discontinuity=!0,this.manifest.discontinuityStarts.push(t.length)},"program-date-time"(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=f.dateTimeString,this.manifest.dateTimeObject=f.dateTimeObject),i.dateTimeString=f.dateTimeString,i.dateTimeObject=f.dateTimeObject;const{lastProgramDateTime:e}=this;this.lastProgramDateTime=new Date(f.dateTimeString).getTime(),null===e&&this.manifest.segments.reduceRight(((e,t)=>(t.programDateTime=e-1e3*t.duration,t.programDateTime)),this.lastProgramDateTime)},targetduration(){!isFinite(f.duration)||f.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+f.duration}):(this.manifest.targetDuration=f.duration,C.call(this,this.manifest))},start(){f.attributes&&!isNaN(f.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:f.attributes["TIME-OFFSET"],precise:f.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out"(){i.cueOut=f.data},"cue-out-cont"(){i.cueOutCont=f.data},"cue-in"(){i.cueIn=f.data},skip(){this.manifest.skip=I(f.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",f.attributes,["SKIPPED-SEGMENTS"])},part(){a=!0;const e=this.manifest.segments.length,t=I(f.attributes);i.parts=i.parts||[],i.parts.push(t),t.byterange&&(t.byterange.hasOwnProperty("offset")||(t.byterange.offset=c),c=t.byterange.offset+t.byterange.length);const n=i.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${n} for segment #${e}`,f.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(((e,t)=>{e.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART`})}))},"server-control"(){const e=this.manifest.serverControl=I(f.attributes);e.hasOwnProperty("canBlockReload")||(e.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),C.call(this,this.manifest),e.canSkipDateranges&&!e.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const e=this.manifest.segments.length,t=I(f.attributes),n=t.type&&"PART"===t.type;i.preloadHints=i.preloadHints||[],i.preloadHints.push(t),t.byterange&&(t.byterange.hasOwnProperty("offset")||(t.byterange.offset=n?c:0,n&&(c=t.byterange.offset+t.byterange.length)));const r=i.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${r} for segment #${e}`,f.attributes,["TYPE","URI"]),t.type)for(let n=0;n<i.preloadHints.length-1;n++){const a=i.preloadHints[n];a.type&&a.type===t.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${r} for segment #${e} has the same TYPE ${t.type} as preload hint #${n}`})}},"rendition-report"(){const e=I(f.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(e);const t=this.manifest.renditionReports.length-1,n=["LAST-MSN","URI"];a&&n.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${t}`,f.attributes,n)},"part-inf"(){this.manifest.partInf=I(f.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",f.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),C.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(I(f.attributes));const e=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${e}`,f.attributes,["ID","START-DATE"]);const t=this.manifest.dateRanges[e];t.endDate&&t.startDate&&new Date(t.endDate)<new Date(t.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),t.duration&&t.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),t.plannedDuration&&t.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const n=!!t.endOnNext;if(n&&!t.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"}),n&&(t.duration||t.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),t.duration&&t.endDate){const n=t.startDate.getTime()+1e3*t.duration;this.manifest.dateRanges[e].endDate=new Date(n)}if(d[t.id]){for(const e in d[t.id])if(t[e]&&JSON.stringify(d[t.id][e])!==JSON.stringify(t[e])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}const e=this.manifest.dateRanges.findIndex((e=>e.id===t.id));this.manifest.dateRanges[e]=(0,g.Z)(this.manifest.dateRanges[e],t),d[t.id]=(0,g.Z)(d[t.id],t),this.manifest.dateRanges.pop()}else d[t.id]=t},"independent-segments"(){this.manifest.independentSegments=!0},"content-steering"(){this.manifest.contentSteering=I(f.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",f.attributes,["SERVER-URI"])}}[f.tagType]||s).call(e)},uri(){i.uri=f.uri,t.push(i),this.manifest.targetDuration&&!("duration"in i)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),i.duration=this.manifest.targetDuration),r&&(i.key=r),i.timeline=u,n&&(i.map=n),c=0,null!==this.lastProgramDateTime&&(i.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=1e3*i.duration),i={}},comment(){},custom(){f.segment?(i.custom=i.custom||{},i.custom[f.customType]=f.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[f.customType]=f.data)}})[f.type].call(e)}))}warnOnMissingAttributes_(e,t,n){const r=[];n.forEach((function(e){t.hasOwnProperty(e)||r.push(e)})),r.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${r.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push("\n"),this.manifest.dateRanges.length&&null===this.lastProgramDateTime&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}),this.lastProgramDateTime=null,this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var D={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},x=["video","audio","text"],N=["Video","Audio","Text"],O=function(e){return e?e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,n){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(n).toString(16)).slice(-2)})):e},P=function(e){void 0===e&&(e="");var t=e.split(","),n=[];return t.forEach((function(e){var t;e=e.trim(),x.forEach((function(r){var i=D[r].exec(e.toLowerCase());if(i&&!(i.length<=1)){t=r;var a=e.substring(0,i[1].length),s=e.replace(a,"");n.push({type:a,details:s,mediaType:r})}})),t||n.push({type:e,details:"",mediaType:"unknown"})})),n},M=function(e){return void 0===e&&(e=""),D.audio.test(e.trim().toLowerCase())},k=function(e){if(e&&"string"==typeof e){var t,n=e.toLowerCase().split(",").map((function(e){return O(e.trim())})),r="video";1===n.length&&M(n[0])?r="audio":1===n.length&&(void 0===(t=n[0])&&(t=""),D.text.test(t.trim().toLowerCase()))&&(r="application");var i="mp4";return n.every((function(e){return D.mp4.test(e)}))?i="mp4":n.every((function(e){return D.webm.test(e)}))?i="webm":n.every((function(e){return D.ogg.test(e)}))&&(i="ogg"),r+"/"+i+';codecs="'+e+'"'}},L=function(e){return void 0===e&&(e=""),i().MediaSource&&i().MediaSource.isTypeSupported&&i().MediaSource.isTypeSupported(k(e))||!1},F=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every((function(e){e=e.trim();for(var t=0;t<N.length;t++)if(D["muxer"+N[t]].test(e))return!0;return!1}))},U="mp4a.40.2",B=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,j=/^application\/dash\+xml/i,q=function(e){return B.test(e)?"hls":j.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null},H=function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},G=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||H(e)||e instanceof ArrayBuffer||(e="number"!=typeof e||"number"==typeof e&&e!=e?0:[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},V=i().BigInt||Number,Y=[V("0x1"),V("0x100"),V("0x10000"),V("0x1000000"),V("0x100000000"),V("0x10000000000"),V("0x1000000000000"),V("0x100000000000000"),V("0x10000000000000000")],z=(function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);255===t[0]||t[0]}(),function(e,t){var n=void 0===t?{}:t,r=n.signed,i=void 0!==r&&r,a=n.le,s=void 0!==a&&a;e=G(e);var o=s?"reduce":"reduceRight",u=(e[o]?e[o]:Array.prototype[o]).call(e,(function(t,n,r){var i=s?r:Math.abs(r+1-e.length);return t+V(n)*Y[i]}),V(0));if(i){var l=Y[e.length]/V(2)-V(1);(u=V(u))>l&&(u-=l,u-=l,u-=V(2))}return Number(u)}),Z=function(e,t){if("string"!=typeof e&&e&&"function"==typeof e.toString&&(e=e.toString()),"string"!=typeof e)return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var n=new Uint8Array(e.length),r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return n},K=function(e,t,n){var r=void 0===n?{}:n,i=r.offset,a=void 0===i?0:i,s=r.mask,o=void 0===s?[]:s;e=G(e);var u=(t=G(t)).every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&u.call(t,(function(t,n){return t===(o[n]?o[n]&e[a+n]:e[a+n])}))};var W=n(3969);const X=e=>!!e&&"object"==typeof e,$=(...e)=>e.reduce(((e,t)=>("object"!=typeof t||Object.keys(t).forEach((n=>{Array.isArray(e[n])&&Array.isArray(t[n])?e[n]=e[n].concat(t[n]):X(e[n])&&X(t[n])?e[n]=$(e[n],t[n]):e[n]=t[n]})),e)),{}),Q=e=>Object.keys(e).map((t=>e[t])),J=e=>e.reduce(((e,t)=>e.concat(t)),[]),ee=e=>{if(!e.length)return[];const t=[];for(let n=0;n<e.length;n++)t.push(e[n]);return t};const te=({baseUrl:e="",source:t="",range:n="",indexRange:r=""})=>{const a={uri:t,resolvedUri:v(e||"",t)};if(n||r){const e=(n||r).split("-");let t,s=i().BigInt?i().BigInt(e[0]):parseInt(e[0],10),o=i().BigInt?i().BigInt(e[1]):parseInt(e[1],10);s<Number.MAX_SAFE_INTEGER&&"bigint"==typeof s&&(s=Number(s)),o<Number.MAX_SAFE_INTEGER&&"bigint"==typeof o&&(o=Number(o)),t="bigint"==typeof o||"bigint"==typeof s?i().BigInt(o)-i().BigInt(s)+i().BigInt(1):o-s+1,"bigint"==typeof t&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),a.byterange={length:t,offset:s}}return a},ne=e=>(e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e),re={static(e){const{duration:t,timescale:n=1,sourceDuration:r,periodDuration:i}=e,a=ne(e.endNumber),s=t/n;return"number"==typeof a?{start:0,end:a}:"number"==typeof i?{start:0,end:i/s}:{start:0,end:r/s}},dynamic(e){const{NOW:t,clientOffset:n,availabilityStartTime:r,timescale:i=1,duration:a,periodStart:s=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:u=1/0}=e,l=ne(e.endNumber),c=(t+n)/1e3,d=r+s,f=c+o-d,h=Math.ceil(f*i/a),p=Math.floor((c-d-u)*i/a),g=Math.floor((c-d)*i/a);return{start:Math.max(0,p),end:"number"==typeof l?l:Math.min(h,g)}}},ie=e=>{const{type:t,duration:n,timescale:r=1,periodDuration:i,sourceDuration:a}=e,{start:s,end:o}=re[t](e),u=((e,t)=>{const n=[];for(let r=e;r<t;r++)n.push(r);return n})(s,o).map((e=>t=>{const{duration:n,timescale:r=1,periodStart:i,startNumber:a=1}=e;return{number:a+t,duration:n/r,timeline:i,time:t*n}})(e));if("static"===t){const e=u.length-1,t="number"==typeof i?i:a;u[e].duration=t-n/r*e}return u},ae=e=>{const{baseUrl:t,initialization:n={},sourceDuration:r,indexRange:i="",periodStart:a,presentationTime:s,number:o=0,duration:u}=e;if(!t)throw new Error("NO_BASE_URL");const l=te({baseUrl:t,source:n.sourceURL,range:n.range}),c=te({baseUrl:t,source:t,indexRange:i});if(c.map=l,u){const t=ie(e);t.length&&(c.duration=t[0].duration,c.timeline=t[0].timeline)}else r&&(c.duration=r,c.timeline=a);return c.presentationTime=s||a,c.number=o,[c]},se=(e,t,n)=>{const r=e.sidx.map?e.sidx.map:null,a=e.sidx.duration,s=e.timeline||0,o=e.sidx.byterange,u=o.offset+o.length,l=t.timescale,c=t.references.filter((e=>1!==e.referenceType)),d=[],f=e.endList?"static":"dynamic",h=e.sidx.timeline;let p,g=h,m=e.mediaSequence||0;p="bigint"==typeof t.firstOffset?i().BigInt(u)+t.firstOffset:u+t.firstOffset;for(let e=0;e<c.length;e++){const o=t.references[e],u=o.referencedSize,c=o.subsegmentDuration;let y;y="bigint"==typeof p?p+i().BigInt(u)-i().BigInt(1):p+u-1;const v=ae({baseUrl:n,timescale:l,timeline:s,periodStart:h,presentationTime:g,number:m,duration:c,sourceDuration:a,indexRange:`${p}-${y}`,type:f})[0];r&&(v.map=r),d.push(v),p+="bigint"==typeof p?i().BigInt(u):u,g+=c/l,m++}return e.segments=d,e},oe=["AUDIO","SUBTITLES"],ue=e=>{return(t=e,n=({timeline:e})=>e,Q(t.reduce(((e,t)=>(t.forEach((t=>{e[n(t)]=t})),e)),{}))).sort(((e,t)=>e.timeline>t.timeline?1:-1));var t,n},le=e=>{let t=[];var n,r;return n=e,r=(e,n,r,i)=>{t=t.concat(e.playlists||[])},oe.forEach((function(e){for(var t in n.mediaGroups[e])for(var i in n.mediaGroups[e][t]){var a=n.mediaGroups[e][t][i];r(a)}})),t},ce=({playlist:e,mediaSequence:t})=>{e.mediaSequence=t,e.segments.forEach(((t,n)=>{t.number=e.mediaSequence+n}))},de=e=>e&&e.uri+"-"+(e=>{let t;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?i().BigInt(e.offset)+i().BigInt(e.length)-i().BigInt(1):e.offset+e.length-1,`${e.offset}-${t}`})(e.byterange),fe=e=>{const t=e.reduce((function(e,t){return e[t.attributes.baseUrl]||(e[t.attributes.baseUrl]=[]),e[t.attributes.baseUrl].push(t),e}),{});let n=[];return Object.values(t).forEach((e=>{const t=Q(e.reduce(((e,t)=>{const n=t.attributes.id+(t.attributes.lang||"");return e[n]?(t.segments&&(t.segments[0]&&(t.segments[0].discontinuity=!0),e[n].segments.push(...t.segments)),t.attributes.contentProtection&&(e[n].attributes.contentProtection=t.attributes.contentProtection)):(e[n]=t,e[n].attributes.timelineStarts=[]),e[n].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e}),{}));n=n.concat(t)})),n.map((e=>{var t;return e.discontinuityStarts=(t=e.segments||[],"discontinuity",t.reduce(((e,t,n)=>(t.discontinuity&&e.push(n),e)),[])),e}))},he=(e,t)=>{const n=de(e.sidx),r=n&&t[n]&&t[n].sidx;return r&&se(e,r,e.sidx.resolvedUri),e},pe=(e,t={})=>{if(!Object.keys(t).length)return e;for(const n in e)e[n]=he(e[n],t);return e},ge=({attributes:e,segments:t,sidx:n,discontinuityStarts:r})=>{const i={attributes:{NAME:e.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:e.width,height:e.height},CODECS:e.codecs,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuityStarts:r,timelineStarts:e.timelineStarts,segments:t};return e.frameRate&&(i.attributes["FRAME-RATE"]=e.frameRate),e.contentProtection&&(i.contentProtection=e.contentProtection),e.serviceLocation&&(i.attributes.serviceLocation=e.serviceLocation),n&&(i.sidx=n),i},me=({attributes:e})=>"video/mp4"===e.mimeType||"video/webm"===e.mimeType||"video"===e.contentType,ye=({attributes:e})=>"audio/mp4"===e.mimeType||"audio/webm"===e.mimeType||"audio"===e.contentType,ve=({attributes:e})=>"text/vtt"===e.mimeType||"text"===e.contentType,_e=e=>e?Object.keys(e).reduce(((t,n)=>{const r=e[n];return t.concat(r.playlists)}),[]):[],Te=({dashPlaylists:e,locations:t,contentSteering:n,sidxMapping:r={},previousManifest:i,eventStream:a})=>{if(!e.length)return{};const{sourceDuration:s,type:o,suggestedPresentationDelay:u,minimumUpdatePeriod:l}=e[0].attributes,c=fe(e.filter(me)).map(ge),d=fe(e.filter(ye)),f=fe(e.filter(ve)),h=e.map((e=>e.attributes.captionServices)).filter(Boolean),p={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:s,playlists:pe(c,r)};l>=0&&(p.minimumUpdatePeriod=1e3*l),t&&(p.locations=t),n&&(p.contentSteering=n),"dynamic"===o&&(p.suggestedPresentationDelay=u),a&&a.length>0&&(p.eventStream=a);const g=0===p.playlists.length,m=d.length?((e,t={},n=!1)=>{let r;const i=e.reduce(((e,i)=>{const a=i.attributes.role&&i.attributes.role.value||"",s=i.attributes.lang||"";let o=i.attributes.label||"main";if(s&&!i.attributes.label){const e=a?` (${a})`:"";o=`${i.attributes.lang}${e}`}e[o]||(e[o]={language:s,autoselect:!0,default:"main"===a,playlists:[],uri:""});const u=he((({attributes:e,segments:t,sidx:n,mediaSequence:r,discontinuitySequence:i,discontinuityStarts:a},s)=>{const o={attributes:{NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuitySequence:i,discontinuityStarts:a,timelineStarts:e.timelineStarts,mediaSequence:r,segments:t};return e.contentProtection&&(o.contentProtection=e.contentProtection),e.serviceLocation&&(o.attributes.serviceLocation=e.serviceLocation),n&&(o.sidx=n),s&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o})(i,n),t);return e[o].playlists.push(u),void 0===r&&"main"===a&&(r=i,r.default=!0),e}),{});return r||(i[Object.keys(i)[0]].default=!0),i})(d,r,g):null,y=f.length?((e,t={})=>e.reduce(((e,n)=>{const r=n.attributes.label||n.attributes.lang||"text";return e[r]||(e[r]={language:r,default:!1,autoselect:!1,playlists:[],uri:""}),e[r].playlists.push(he((({attributes:e,segments:t,mediaSequence:n,discontinuityStarts:r,discontinuitySequence:i})=>{void 0===t&&(t=[{uri:e.baseUrl,timeline:e.periodStart,resolvedUri:e.baseUrl||"",duration:e.sourceDuration,number:0}],e.duration=e.sourceDuration);const a={NAME:e.id,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1};e.codecs&&(a.CODECS=e.codecs);const s={attributes:a,uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,timelineStarts:e.timelineStarts,discontinuityStarts:r,discontinuitySequence:i,mediaSequence:n,segments:t};return e.serviceLocation&&(s.attributes.serviceLocation=e.serviceLocation),s})(n),t)),e}),{}))(f,r):null,v=c.concat(_e(m),_e(y)),_=v.map((({timelineStarts:e})=>e));var T,b;return p.timelineStarts=ue(_),T=v,b=p.timelineStarts,T.forEach((e=>{e.mediaSequence=0,e.discontinuitySequence=b.findIndex((function({timeline:t}){return t===e.timeline})),e.segments&&e.segments.forEach(((e,t)=>{e.number=t}))})),m&&(p.mediaGroups.AUDIO.audio=m),y&&(p.mediaGroups.SUBTITLES.subs=y),h.length&&(p.mediaGroups["CLOSED-CAPTIONS"].cc=h.reduce(((e,t)=>t?(t.forEach((t=>{const{channel:n,language:r}=t;e[r]={autoselect:!1,default:!1,instreamId:n,language:r},t.hasOwnProperty("aspectRatio")&&(e[r].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[r].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[r]["3D"]=t["3D"])})),e):e),{})),i?(({oldManifest:e,newManifest:t})=>{const n=e.playlists.concat(le(e)),r=t.playlists.concat(le(t));return t.timelineStarts=ue([e.timelineStarts,t.timelineStarts]),(({oldPlaylists:e,newPlaylists:t,timelineStarts:n})=>{t.forEach((t=>{t.discontinuitySequence=n.findIndex((function({timeline:e}){return e===t.timeline}));const r=((e,t)=>{for(let n=0;n<e.length;n++)if(e[n].attributes.NAME===t)return e[n];return null})(e,t.attributes.NAME);if(!r)return;if(t.sidx)return;const i=t.segments[0],a=r.segments.findIndex((function(e){return Math.abs(e.presentationTime-i.presentationTime)<.016666666666666666}));if(-1===a)return ce({playlist:t,mediaSequence:r.mediaSequence+r.segments.length}),t.segments[0].discontinuity=!0,t.discontinuityStarts.unshift(0),void((!r.segments.length&&t.timeline>r.timeline||r.segments.length&&t.timeline>r.segments[r.segments.length-1].timeline)&&t.discontinuitySequence--);r.segments[a].discontinuity&&!i.discontinuity&&(i.discontinuity=!0,t.discontinuityStarts.unshift(0),t.discontinuitySequence--),ce({playlist:t,mediaSequence:r.segments[a].number})}))})({oldPlaylists:n,newPlaylists:r,timelineStarts:t.timelineStarts}),t})({oldManifest:i,newManifest:p}):p},be=(e,t,n)=>{const{NOW:r,clientOffset:i,availabilityStartTime:a,timescale:s=1,periodStart:o=0,minimumUpdatePeriod:u=0}=e,l=(r+i)/1e3+u-(a+o);return Math.ceil((l*s-t)/n)},Ee=(e,t)=>{const{type:n,minimumUpdatePeriod:r=0,media:i="",sourceDuration:a,timescale:s=1,startNumber:o=1,periodStart:u}=e,l=[];let c=-1;for(let d=0;d<t.length;d++){const f=t[d],h=f.d,p=f.r||0,g=f.t||0;let m;if(c<0&&(c=g),g&&g>c&&(c=g),p<0){const o=d+1;m=o===t.length?"dynamic"===n&&r>0&&i.indexOf("$Number$")>0?be(e,c,h):(a*s-c)/h:(t[o].t-c)/h}else m=p+1;const y=o+l.length+m;let v=o+l.length;for(;v<y;)l.push({number:v,duration:h/s,time:c,timeline:u}),c+=h,v++}return l},Se=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,we=(e,t)=>e.replace(Se,(e=>(t,n,r,i)=>{if("$$"===t)return"$";if(void 0===e[n])return t;const a=""+e[n];return"RepresentationID"===n?a:(i=r?parseInt(i,10):1,a.length>=i?a:`${new Array(i-a.length+1).join("0")}${a}`)})(t)),Ae=(e,t)=>{const n={RepresentationID:e.id,Bandwidth:e.bandwidth||0},{initialization:r={sourceURL:"",range:""}}=e,i=te({baseUrl:e.baseUrl,source:we(r.sourceURL,n),range:r.range}),a=((e,t)=>e.duration||t?e.duration?ie(e):Ee(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}])(e,t);return a.map((t=>{n.Number=t.number,n.Time=t.time;const r=we(e.media||"",n),a=e.timescale||1,s=e.presentationTimeOffset||0,o=e.periodStart+(t.time-s)/a;return{uri:r,timeline:t.timeline,duration:t.duration,resolvedUri:v(e.baseUrl||"",r),map:i,number:t.number,presentationTime:o}}))},Ie=(e,t)=>{const{duration:n,segmentUrls:r=[],periodStart:i}=e;if(!n&&!t||n&&t)throw new Error("SEGMENT_TIME_UNSPECIFIED");const a=r.map((t=>((e,t)=>{const{baseUrl:n,initialization:r={}}=e,i=te({baseUrl:n,source:r.sourceURL,range:r.range}),a=te({baseUrl:n,source:t.media,range:t.mediaRange});return a.map=i,a})(e,t)));let s;return n&&(s=ie(e)),t&&(s=Ee(e,t)),s.map(((t,n)=>{if(a[n]){const r=a[n],s=e.timescale||1,o=e.presentationTimeOffset||0;return r.timeline=t.timeline,r.duration=t.duration,r.number=t.number,r.presentationTime=i+(t.time-o)/s,r}})).filter((e=>e))},Ce=({attributes:e,segmentInfo:t})=>{let n,r;t.template?(r=Ae,n=$(e,t.template)):t.base?(r=ae,n=$(e,t.base)):t.list&&(r=Ie,n=$(e,t.list));const i={attributes:e};if(!r)return i;const a=r(n,t.segmentTimeline);if(n.duration){const{duration:e,timescale:t=1}=n;n.duration=e/t}else a.length?n.duration=a.reduce(((e,t)=>Math.max(e,Math.ceil(t.duration))),0):n.duration=0;return i.attributes=n,i.segments=a,t.base&&n.indexRange&&(i.sidx=a[0],i.segments=[]),i},Re=(e,t)=>ee(e.childNodes).filter((({tagName:e})=>e===t)),De=e=>e.textContent.trim(),xe=e=>{const t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;const[n,r,i,a,s,o]=t.slice(1);return 31536e3*parseFloat(n||0)+2592e3*parseFloat(r||0)+86400*parseFloat(i||0)+3600*parseFloat(a||0)+60*parseFloat(s||0)+parseFloat(o||0)},Ne={mediaPresentationDuration:e=>xe(e),availabilityStartTime(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t=e)&&(t+="Z"),Date.parse(t)/1e3;var t},minimumUpdatePeriod:e=>xe(e),suggestedPresentationDelay:e=>xe(e),type:e=>e,timeShiftBufferDepth:e=>xe(e),start:e=>xe(e),width:e=>parseInt(e,10),height:e=>parseInt(e,10),bandwidth:e=>parseInt(e,10),frameRate:e=>(e=>parseFloat(e.split("/").reduce(((e,t)=>e/t))))(e),startNumber:e=>parseInt(e,10),timescale:e=>parseInt(e,10),presentationTimeOffset:e=>parseInt(e,10),duration(e){const t=parseInt(e,10);return isNaN(t)?xe(e):t},d:e=>parseInt(e,10),t:e=>parseInt(e,10),r:e=>parseInt(e,10),presentationTime:e=>parseInt(e,10),DEFAULT:e=>e},Oe=e=>e&&e.attributes?ee(e.attributes).reduce(((e,t)=>{const n=Ne[t.name]||Ne.DEFAULT;return e[t.name]=n(t.value),e}),{}):{},Pe={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},Me=(e,t)=>t.length?J(e.map((function(e){return t.map((function(t){const n=De(t),r=v(e.baseUrl,n),i=$(Oe(t),{baseUrl:r});return r!==n&&!i.serviceLocation&&e.serviceLocation&&(i.serviceLocation=e.serviceLocation),i}))}))):e,ke=e=>{const t=Re(e,"SegmentTemplate")[0],n=Re(e,"SegmentList")[0],r=n&&Re(n,"SegmentURL").map((e=>$({tag:"SegmentURL"},Oe(e)))),i=Re(e,"SegmentBase")[0],a=n||t,s=a&&Re(a,"SegmentTimeline")[0],o=n||i||t,u=o&&Re(o,"Initialization")[0],l=t&&Oe(t);l&&u?l.initialization=u&&Oe(u):l&&l.initialization&&(l.initialization={sourceURL:l.initialization});const c={template:l,segmentTimeline:s&&Re(s,"S").map((e=>Oe(e))),list:n&&$(Oe(n),{segmentUrls:r,initialization:Oe(u)}),base:i&&$(Oe(i),{initialization:Oe(u)})};return Object.keys(c).forEach((e=>{c[e]||delete c[e]})),c},Le=e=>J(Re(e.node,"EventStream").map((t=>{const n=Oe(t),r=n.schemeIdUri;return Re(t,"Event").map((t=>{const i=Oe(t),a=i.presentationTime||0,s=n.timescale||1,o=i.duration||0,u=a/s+e.attributes.start;return{schemeIdUri:r,value:n.value,id:i.id,start:u,end:u+o/s,messageData:De(t)||i.messageData,contentEncoding:n.contentEncoding,presentationTimeOffset:n.presentationTimeOffset||0}}))}))),Fe=(e,t,n)=>r=>{const a=Oe(r),s=Me(t,Re(r,"BaseURL")),o=Re(r,"Role")[0],u={role:Oe(o)};let l=$(e,a,u);const c=Re(r,"Accessibility")[0],d="urn:scte:dash:cc:cea-608:2015"===(f=Oe(c)).schemeIdUri?("string"!=typeof f.value?[]:f.value.split(";")).map((e=>{let t,n;return n=e,/^CC\d=/.test(e)?[t,n]=e.split("="):/^CC\d$/.test(e)&&(t=e),{channel:t,language:n}})):"urn:scte:dash:cc:cea-708:2015"===f.schemeIdUri?("string"!=typeof f.value?[]:f.value.split(";")).map((e=>{const t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){const[n,r=""]=e.split("=");t.channel=n,t.language=e,r.split(",").forEach((e=>{const[n,r]=e.split(":");"lang"===n?t.language=r:"er"===n?t.easyReader=Number(r):"war"===n?t.aspectRatio=Number(r):"3D"===n&&(t["3D"]=Number(r))}))}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t})):void 0;var f;d&&(l=$(l,{captionServices:d}));const h=Re(r,"Label")[0];if(h&&h.childNodes.length){const e=h.childNodes[0].nodeValue.trim();l=$(l,{label:e})}const p=Re(r,"ContentProtection").reduce(((e,t)=>{const n=Oe(t);n.schemeIdUri&&(n.schemeIdUri=n.schemeIdUri.toLowerCase());const r=Pe[n.schemeIdUri];if(r){e[r]={attributes:n};const a=Re(t,"cenc:pssh")[0];if(a){const t=De(a);e[r].pssh=t&&function(e){for(var t=function(e){return i().atob?i().atob(e):Buffer.from(e,"base64").toString("binary")}(e),n=new Uint8Array(t.length),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}(t)}}return e}),{});Object.keys(p).length&&(l=$(l,{contentProtection:p}));const g=ke(r),m=Re(r,"Representation"),y=$(n,g);return J(m.map(((e,t,n)=>r=>{const i=Re(r,"BaseURL"),a=Me(t,i),s=$(e,Oe(r)),o=ke(r);return a.map((e=>({segmentInfo:$(n,o),attributes:$(s,e)})))})(l,s,y)))},Ue=(e,t)=>(n,r)=>{const i=Me(t,Re(n.node,"BaseURL")),a=$(e,{periodStart:n.attributes.start});"number"==typeof n.attributes.duration&&(a.periodDuration=n.attributes.duration);const s=Re(n.node,"AdaptationSet"),o=ke(n.node);return J(s.map(Fe(a,i,o)))},Be=(e,t)=>{if(e.length>1&&t({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!e.length)return null;const n=$({serverURL:De(e[0])},Oe(e[0]));return n.queryBeforeStart="true"===n.queryBeforeStart,n},je=e=>{if(""===e)throw new Error("DASH_EMPTY_MANIFEST");const t=new W.DOMParser;let n,r;try{n=t.parseFromString(e,"application/xml"),r=n&&"MPD"===n.documentElement.tagName?n.documentElement:null}catch(e){}if(!r||r&&r.getElementsByTagName("parsererror").length>0)throw new Error("DASH_INVALID_XML");return r};var qe,He=n(4221),Ge=n.n(He),Ve=G([73,68,51]),Ye=function e(t,n){return void 0===n&&(n=0),(t=G(t)).length-n<10||!K(t,Ve,{offset:n})?n:(n+=function(e,t){void 0===t&&(t=0);var n=(e=G(e))[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&n)>>4?r+20:r+10}(t,n),e(t,n))},ze=(new Uint8Array([79,112,117,115,72,101,97,100]),function(e){return"string"==typeof e?Z(e):e}),Ze=function(e){e=G(e);for(var t=[],n=0;e.length>n;){var r=e[n],i=0,a=0,s=e[++a];for(a++;128&s;)i=(127&s)<<7,s=e[a],a++;i+=127&s;for(var o=0;o<qe.length;o++){var u=qe[o],l=u.id,c=u.parser;if(r===l){t.push(c(e.subarray(a,a+i)));break}}n+=i+a}return t};qe=[{id:3,parser:function(e){var t={tag:3,id:e[0]<<8|e[1],flags:e[2],size:3,dependsOnEsId:0,ocrEsId:0,descriptors:[],url:""};if(128&t.flags&&(t.dependsOnEsId=e[t.size]<<8|e[t.size+1],t.size+=2),64&t.flags){var n=e[t.size];t.url=function(e){if(!e)return"";e=Array.prototype.slice.call(e);var t=String.fromCharCode.apply(null,G(e));try{return decodeURIComponent(escape(t))}catch(e){}return t}(e.subarray(t.size+1,t.size+1+n)),t.size+=n}return 32&t.flags&&(t.ocrEsId=e[t.size]<<8|e[t.size+1],t.size+=2),t.descriptors=Ze(e.subarray(t.size))||[],t}},{id:4,parser:function(e){return{tag:4,oti:e[0],streamType:e[1],bufferSize:e[2]<<16|e[3]<<8|e[4],maxBitrate:e[5]<<24|e[6]<<16|e[7]<<8|e[8],avgBitrate:e[9]<<24|e[10]<<16|e[11]<<8|e[12],descriptors:Ze(e.subarray(13))}}},{id:5,parser:function(e){return{tag:5,bytes:e}}},{id:6,parser:function(e){return{tag:6,bytes:e}}}];var Ke=function e(t,n,r){void 0===r&&(r=!1),n=function(e){return Array.isArray(e)?e.map((function(e){return ze(e)})):[ze(e)]}(n),t=G(t);var i=[];if(!n.length)return i;for(var a=0;a<t.length;){var s=(t[a]<<24|t[a+1]<<16|t[a+2]<<8|t[a+3])>>>0,o=t.subarray(a+4,a+8);if(0===s)break;var u=a+s;if(u>t.length){if(r)break;u=t.length}var l=t.subarray(a+8,u);K(o,n[0])&&(1===n.length?i.push(l):i.push.apply(i,e(l,n.slice(1),r))),a=u}return i},We={EBML:G([26,69,223,163]),DocType:G([66,130]),Segment:G([24,83,128,103]),SegmentInfo:G([21,73,169,102]),Tracks:G([22,84,174,107]),Track:G([174]),TrackNumber:G([215]),DefaultDuration:G([35,227,131]),TrackEntry:G([174]),TrackType:G([131]),FlagDefault:G([136]),CodecID:G([134]),CodecPrivate:G([99,162]),VideoTrack:G([224]),AudioTrack:G([225]),Cluster:G([31,67,182,117]),Timestamp:G([231]),TimestampScale:G([42,215,177]),BlockGroup:G([160]),BlockDuration:G([155]),Block:G([161]),SimpleBlock:G([163])},Xe=[128,64,32,16,8,4,2,1],$e=function(e,t,n,r){void 0===n&&(n=!0),void 0===r&&(r=!1);var i=function(e){for(var t=1,n=0;n<Xe.length&&!(e&Xe[n]);n++)t++;return t}(e[t]),a=e.subarray(t,t+i);return n&&((a=Array.prototype.slice.call(e,t,t+i))[0]^=Xe[i-1]),{length:i,value:z(a,{signed:r}),bytes:a}},Qe=function e(t){return"string"==typeof t?t.match(/.{1,2}/g).map((function(t){return e(t)})):"number"==typeof t?function(e,t){var n=(void 0===t?{}:t).le,r=void 0!==n&&n;("bigint"!=typeof e&&"number"!=typeof e||"number"==typeof e&&e!=e)&&(e=0);for(var i,a=(i=e=V(e),Math.ceil(function(e){return e.toString(2).length}(i)/8)),s=new Uint8Array(new ArrayBuffer(a)),o=0;o<a;o++){var u=r?o:Math.abs(o+1-s.length);s[u]=Number(e/Y[o]&V(255)),e<0&&(s[u]=Math.abs(~s[u]),s[u]-=0===o?1:2)}return s}(t):t},Je=function e(t,n,r){if(r>=n.length)return n.length;var i=$e(n,r,!1);if(K(t.bytes,i.bytes))return r;var a=$e(n,r+i.length);return e(t,n,r+a.length+a.value+i.length)},et=function e(t,n){n=function(e){return Array.isArray(e)?e.map((function(e){return Qe(e)})):[Qe(e)]}(n),t=G(t);var r=[];if(!n.length)return r;for(var i=0;i<t.length;){var a=$e(t,i,!1),s=$e(t,i+a.length),o=i+a.length+s.length;127===s.value&&(s.value=Je(a,t,o),s.value!==t.length&&(s.value-=o));var u=o+s.value>t.length?t.length:o+s.value,l=t.subarray(o,u);K(n[0],a.bytes)&&(1===n.length?r.push(l):r=r.concat(e(l,n.slice(1)))),i+=a.length+s.length+l.length}return r},tt=G([0,0,0,1]),nt=G([0,0,1]),rt=G([0,0,3]),it=function(e){for(var t=[],n=1;n<e.length-2;)K(e.subarray(n,n+3),rt)&&(t.push(n+2),n++),n++;if(0===t.length)return e;var r=e.length-t.length,i=new Uint8Array(r),a=0;for(n=0;n<r;a++,n++)a===t[0]&&(a++,t.shift()),i[n]=e[a];return i},at=function(e,t,n,r){void 0===r&&(r=1/0),e=G(e),n=[].concat(n);for(var i,a=0,s=0;a<e.length&&(s<r||i);){var o=void 0;if(K(e.subarray(a),tt)?o=4:K(e.subarray(a),nt)&&(o=3),o){if(s++,i)return it(e.subarray(i,a));var u=void 0;"h264"===t?u=31&e[a+o]:"h265"===t&&(u=e[a+o]>>1&63),-1!==n.indexOf(u)&&(i=a+o),a+=o+("h264"===t?1:2)}else a++}return e.subarray(0,0)},st={webm:G([119,101,98,109]),matroska:G([109,97,116,114,111,115,107,97]),flac:G([102,76,97,67]),ogg:G([79,103,103,83]),ac3:G([11,119]),riff:G([82,73,70,70]),avi:G([65,86,73]),wav:G([87,65,86,69]),"3gp":G([102,116,121,112,51,103]),mp4:G([102,116,121,112]),fmp4:G([115,116,121,112]),mov:G([102,116,121,112,113,116]),moov:G([109,111,111,118]),moof:G([109,111,111,102])},ot={aac:function(e){var t=Ye(e);return K(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Ye(e);return K(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=et(e,[We.EBML,We.DocType])[0];return K(t,st.webm)},mkv:function(e){var t=et(e,[We.EBML,We.DocType])[0];return K(t,st.matroska)},mp4:function(e){return!ot["3gp"](e)&&!ot.mov(e)&&(!(!K(e,st.mp4,{offset:4})&&!K(e,st.fmp4,{offset:4}))||!(!K(e,st.moof,{offset:4})&&!K(e,st.moov,{offset:4}))||void 0)},mov:function(e){return K(e,st.mov,{offset:4})},"3gp":function(e){return K(e,st["3gp"],{offset:4})},ac3:function(e){var t=Ye(e);return K(e,st.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];for(var t=0;t+188<e.length&&t<188;){if(71===e[t]&&71===e[t+188])return!0;t+=1}return!1},flac:function(e){var t=Ye(e);return K(e,st.flac,{offset:t})},ogg:function(e){return K(e,st.ogg)},avi:function(e){return K(e,st.riff)&&K(e,st.avi,{offset:8})},wav:function(e){return K(e,st.riff)&&K(e,st.wav,{offset:8})},h264:function(e){return function(e,t,n){return at(e,"h264",7,3)}(e).length},h265:function(e){return function(e,t,n){return at(e,"h265",[32,33],3)}(e).length}},ut=Object.keys(ot).filter((function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e})).concat(["ts","h264","h265"]);ut.forEach((function(e){var t=ot[e];ot[e]=function(e){return t(G(e))}}));var lt=ot,ct=function(e){e=G(e);for(var t=0;t<ut.length;t++){var n=ut[t];if(lt[n](e))return n}return""},dt=n(1489),ft="8.9.0";const ht={},pt=function(e,t){return ht[e]=ht[e]||[],t&&(ht[e]=ht[e].concat(t)),ht[e]},gt=function(e,t){const n=pt(e).indexOf(t);return!(n<=-1||(ht[e]=ht[e].slice(),ht[e].splice(n,1),0))},mt={prefixed:!0},yt=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],vt=yt[0];let _t;for(let e=0;e<yt.length;e++)if(yt[e][1]in s()){_t=yt[e];break}if(_t){for(let e=0;e<_t.length;e++)mt[vt[e]]=_t[e];mt.prefixed=_t[0]!==vt[0]}let Tt=[];const bt=function e(t,n=":",r=""){let a,s="info";const o=function(...e){a("log",s,e)};return a=((e,t,n)=>(r,a,s)=>{const o=t.levels[a],u=new RegExp(`^(${o})$`);let l=e;if("log"!==r&&s.unshift(r.toUpperCase()+":"),n&&(l=`%c${e}`,s.unshift(n)),s.unshift(l+":"),Tt){Tt.push([].concat(s));const e=Tt.length-1e3;Tt.splice(0,e>0?e:0)}if(!i().console)return;let c=i().console[r];c||"debug"!==r||(c=i().console.info||i().console.log),c&&o&&u.test(r)&&c[Array.isArray(s)?"apply":"call"](i().console,s)})(t,o,r),o.createLogger=(i,a,s)=>{const o=void 0!==a?a:n;return e(`${t} ${o} ${i}`,o,void 0!==s?s:r)},o.createNewLogger=(t,n,r)=>e(t,n,r),o.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:s},o.level=e=>{if("string"==typeof e){if(!o.levels.hasOwnProperty(e))throw new Error(`"${e}" in not a valid log level`);s=e}return s},(o.history=()=>Tt?[].concat(Tt):[]).filter=e=>(Tt||[]).filter((t=>new RegExp(`.*${e}.*`).test(t[0]))),o.history.clear=()=>{Tt&&(Tt.length=0)},o.history.disable=()=>{null!==Tt&&(Tt.length=0,Tt=null)},o.history.enable=()=>{null===Tt&&(Tt=[])},o.error=(...e)=>a("error",s,e),o.warn=(...e)=>a("warn",s,e),o.debug=(...e)=>a("debug",s,e),o}("VIDEOJS"),Et=bt.createLogger,St=Object.prototype.toString,wt=function(e){return Ct(e)?Object.keys(e):[]};function At(e,t){wt(e).forEach((n=>t(e[n],n)))}function It(e,t,n=0){return wt(e).reduce(((n,r)=>t(n,e[r],r)),n)}function Ct(e){return!!e&&"object"==typeof e}function Rt(e){return Ct(e)&&"[object Object]"===St.call(e)&&e.constructor===Object}function Dt(...e){const t={};return e.forEach((e=>{e&&At(e,((e,n)=>{Rt(e)?(Rt(t[n])||(t[n]={}),t[n]=Dt(t[n],e)):t[n]=e}))})),t}function xt(e={}){const t=[];for(const n in e)if(e.hasOwnProperty(n)){const r=e[n];t.push(r)}return t}function Nt(e,t,n,r=!0){const i=n=>Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0}),a={configurable:!0,enumerable:!0,get(){const e=n();return i(e),e}};return r&&(a.set=i),Object.defineProperty(e,t,a)}var Ot=Object.freeze({__proto__:null,each:At,reduce:It,isObject:Ct,isPlain:Rt,merge:Dt,values:xt,defineLazyProperty:Nt});let Pt,Mt=!1,kt=null,Lt=!1,Ft=!1,Ut=!1,Bt=!1,jt=!1,qt=null,Ht=null,Gt=null,Vt=!1,Yt=!1,zt=!1,Zt=!1;const Kt=Boolean(en()&&("ontouchstart"in i()||i().navigator.maxTouchPoints||i().DocumentTouch&&i().document instanceof i().DocumentTouch)),Wt=i().navigator&&i().navigator.userAgentData;if(Wt&&Wt.platform&&Wt.brands&&(Lt="Android"===Wt.platform,Ut=Boolean(Wt.brands.find((e=>"Microsoft Edge"===e.brand))),Bt=Boolean(Wt.brands.find((e=>"Chromium"===e.brand))),jt=!Ut&&Bt,qt=Ht=(Wt.brands.find((e=>"Chromium"===e.brand))||{}).version||null,Yt="Windows"===Wt.platform),!Bt){const e=i().navigator&&i().navigator.userAgent||"";Mt=/iPod/i.test(e),kt=function(){const t=e.match(/OS (\d+)_/i);return t&&t[1]?t[1]:null}(),Lt=/Android/i.test(e),Pt=function(){const t=e.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;const n=t[1]&&parseFloat(t[1]),r=t[2]&&parseFloat(t[2]);return n&&r?parseFloat(t[1]+"."+t[2]):n||null}(),Ft=/Firefox/i.test(e),Ut=/Edg/i.test(e),Bt=/Chrome/i.test(e)||/CriOS/i.test(e),jt=!Ut&&Bt,qt=Ht=function(){const t=e.match(/(Chrome|CriOS)\/(\d+)/);return t&&t[2]?parseFloat(t[2]):null}(),Gt=function(){const t=/MSIE\s(\d+)\.\d/.exec(e);let n=t&&parseFloat(t[1]);return!n&&/Trident\/7.0/i.test(e)&&/rv:11.0/.test(e)&&(n=11),n}(),Vt=/Safari/i.test(e)&&!jt&&!Lt&&!Ut,Yt=/Windows/i.test(e),zt=/iPad/i.test(e)||Vt&&Kt&&!/iPhone/i.test(e),Zt=/iPhone/i.test(e)&&!zt}const Xt=Zt||zt||Mt,$t=(Vt||Xt)&&!jt;var Qt=Object.freeze({__proto__:null,get IS_IPOD(){return Mt},get IOS_VERSION(){return kt},get IS_ANDROID(){return Lt},get ANDROID_VERSION(){return Pt},get IS_FIREFOX(){return Ft},get IS_EDGE(){return Ut},get IS_CHROMIUM(){return Bt},get IS_CHROME(){return jt},get CHROMIUM_VERSION(){return qt},get CHROME_VERSION(){return Ht},get IE_VERSION(){return Gt},get IS_SAFARI(){return Vt},get IS_WINDOWS(){return Yt},get IS_IPAD(){return zt},get IS_IPHONE(){return Zt},TOUCH_ENABLED:Kt,IS_IOS:Xt,IS_ANY_SAFARI:$t});function Jt(e){return"string"==typeof e&&Boolean(e.trim())}function en(){return s()===i().document}function tn(e){return Ct(e)&&1===e.nodeType}function nn(){try{return i().parent!==i().self}catch(e){return!0}}function rn(e){return function(t,n){if(!Jt(t))return s()[e](null);Jt(n)&&(n=s().querySelector(n));const r=tn(n)?n:s();return r[e]&&r[e](t)}}function an(e="div",t={},n={},r){const i=s().createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){const n=t[e];"textContent"===e?sn(i,n):i[e]===n&&"tabIndex"!==e||(i[e]=n)})),Object.getOwnPropertyNames(n).forEach((function(e){i.setAttribute(e,n[e])})),r&&An(i,r),i}function sn(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function on(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function un(e,t){return function(e){if(e.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}(t),e.classList.contains(t)}function ln(e,...t){return e.classList.add(...t.reduce(((e,t)=>e.concat(t.split(/\s+/))),[])),e}function cn(e,...t){return e?(e.classList.remove(...t.reduce(((e,t)=>e.concat(t.split(/\s+/))),[])),e):(bt.warn("removeClass was called with an element that doesn't exist"),null)}function dn(e,t,n){return"function"==typeof n&&(n=n(e,t)),"boolean"!=typeof n&&(n=void 0),t.split(/\s+/).forEach((t=>e.classList.toggle(t,n))),e}function fn(e,t){Object.getOwnPropertyNames(t).forEach((function(n){const r=t[n];null==r||!1===r?e.removeAttribute(n):e.setAttribute(n,!0===r?"":r)}))}function hn(e){const t={},n=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(e&&e.attributes&&e.attributes.length>0){const r=e.attributes;for(let e=r.length-1;e>=0;e--){const i=r[e].name;let a=r[e].value;n.includes(i)&&(a=null!==a),t[i]=a}}return t}function pn(e,t){return e.getAttribute(t)}function gn(e,t,n){e.setAttribute(t,n)}function mn(e,t){e.removeAttribute(t)}function yn(){s().body.focus(),s().onselectstart=function(){return!1}}function vn(){s().onselectstart=function(){return!0}}function _n(e){if(e&&e.getBoundingClientRect&&e.parentNode){const t=e.getBoundingClientRect(),n={};return["bottom","height","left","right","top","width"].forEach((e=>{void 0!==t[e]&&(n[e]=t[e])})),n.height||(n.height=parseFloat(xn(e,"height"))),n.width||(n.width=parseFloat(xn(e,"width"))),n}}function Tn(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};const t=e.offsetWidth,n=e.offsetHeight;let r=0,i=0;for(;e.offsetParent&&e!==s()[mt.fullscreenElement];)r+=e.offsetLeft,i+=e.offsetTop,e=e.offsetParent;return{left:r,top:i,width:t,height:n}}function bn(e,t){const n={x:0,y:0};if(Xt){let t=e;for(;t&&"html"!==t.nodeName.toLowerCase();){const e=xn(t,"transform");if(/^matrix/.test(e)){const t=e.slice(7,-1).split(/,\s/).map(Number);n.x+=t[4],n.y+=t[5]}else if(/^matrix3d/.test(e)){const t=e.slice(9,-1).split(/,\s/).map(Number);n.x+=t[12],n.y+=t[13]}t=t.parentNode}}const r={},i=Tn(t.target),a=Tn(e),s=a.width,o=a.height;let u=t.offsetY-(a.top-i.top),l=t.offsetX-(a.left-i.left);return t.changedTouches&&(l=t.changedTouches[0].pageX-a.left,u=t.changedTouches[0].pageY+a.top,Xt&&(l-=n.x,u-=n.y)),r.y=1-Math.max(0,Math.min(1,u/o)),r.x=Math.max(0,Math.min(1,l/s)),r}function En(e){return Ct(e)&&3===e.nodeType}function Sn(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function wn(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((e=>("function"==typeof e&&(e=e()),tn(e)||En(e)?e:"string"==typeof e&&/\S/.test(e)?s().createTextNode(e):void 0))).filter((e=>e))}function An(e,t){return wn(t).forEach((t=>e.appendChild(t))),e}function In(e,t){return An(Sn(e),t)}function Cn(e){return void 0===e.button&&void 0===e.buttons||0===e.button&&void 0===e.buttons||"mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons}const Rn=rn("querySelector"),Dn=rn("querySelectorAll");function xn(e,t){if(!e||!t)return"";if("function"==typeof i().getComputedStyle){let n;try{n=i().getComputedStyle(e)}catch(e){return""}return n?n.getPropertyValue(t)||n[t]:""}return""}function Nn(e){[...s().styleSheets].forEach((t=>{try{const n=[...t.cssRules].map((e=>e.cssText)).join(""),r=s().createElement("style");r.textContent=n,e.document.head.appendChild(r)}catch(n){const r=s().createElement("link");r.rel="stylesheet",r.type=t.type,r.media=t.media.mediaText,r.href=t.href,e.document.head.appendChild(r)}}))}var On=Object.freeze({__proto__:null,isReal:en,isEl:tn,isInFrame:nn,createEl:an,textContent:sn,prependTo:on,hasClass:un,addClass:ln,removeClass:cn,toggleClass:dn,setAttributes:fn,getAttributes:hn,getAttribute:pn,setAttribute:gn,removeAttribute:mn,blockTextSelection:yn,unblockTextSelection:vn,getBoundingClientRect:_n,findPosition:Tn,getPointerPosition:bn,isTextNode:En,emptyEl:Sn,normalizeContent:wn,appendContent:An,insertContent:In,isSingleLeftClick:Cn,$:Rn,$$:Dn,computedStyle:xn,copyStyleSheetsToWindow:Nn});let Pn,Mn=!1;const kn=function(){if(!1===Pn.options.autoSetup)return;const e=Array.prototype.slice.call(s().getElementsByTagName("video")),t=Array.prototype.slice.call(s().getElementsByTagName("audio")),n=Array.prototype.slice.call(s().getElementsByTagName("video-js")),r=e.concat(t,n);if(r&&r.length>0)for(let e=0,t=r.length;e<t;e++){const t=r[e];if(!t||!t.getAttribute){Ln(1);break}void 0===t.player&&null!==t.getAttribute("data-setup")&&Pn(t)}else Mn||Ln(1)};function Ln(e,t){en()&&(t&&(Pn=t),i().setTimeout(kn,e))}function Fn(){Mn=!0,i().removeEventListener("load",Fn)}en()&&("complete"===s().readyState?Fn():i().addEventListener("load",Fn));const Un=function(e){const t=s().createElement("style");return t.className=e,t},Bn=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t};var jn=new WeakMap;let qn,Hn=3;function Gn(){return Hn++}function Vn(e,t){if(!jn.has(e))return;const n=jn.get(e);0===n.handlers[t].length&&(delete n.handlers[t],e.removeEventListener?e.removeEventListener(t,n.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,n.dispatcher)),Object.getOwnPropertyNames(n.handlers).length<=0&&(delete n.handlers,delete n.dispatcher,delete n.disabled),0===Object.getOwnPropertyNames(n).length&&jn.delete(e)}function Yn(e,t,n,r){n.forEach((function(n){e(t,n,r)}))}function zn(e){if(e.fixed_)return e;function t(){return!0}function n(){return!1}if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){const r=e||i().event;e={};for(const t in r)"layerX"!==t&&"layerY"!==t&&"keyLocation"!==t&&"webkitMovementX"!==t&&"webkitMovementY"!==t&&"path"!==t&&("returnValue"===t&&r.preventDefault||(e[t]=r[t]));if(e.target||(e.target=e.srcElement||s()),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){r.preventDefault&&r.preventDefault(),e.returnValue=!1,r.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){r.stopPropagation&&r.stopPropagation(),e.cancelBubble=!0,r.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=n,e.stopImmediatePropagation=function(){r.stopImmediatePropagation&&r.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=n,null!==e.clientX&&void 0!==e.clientX){const t=s().documentElement,n=s().body;e.pageX=e.clientX+(t&&t.scrollLeft||n&&n.scrollLeft||0)-(t&&t.clientLeft||n&&n.clientLeft||0),e.pageY=e.clientY+(t&&t.scrollTop||n&&n.scrollTop||0)-(t&&t.clientTop||n&&n.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e.fixed_=!0,e}const Zn=function(){if("boolean"!=typeof qn){qn=!1;try{const e=Object.defineProperty({},"passive",{get(){qn=!0}});i().addEventListener("test",null,e),i().removeEventListener("test",null,e)}catch(e){}}return qn},Kn=["touchstart","touchmove"];function Wn(e,t,n){if(Array.isArray(t))return Yn(Wn,e,t,n);jn.has(e)||jn.set(e,{});const r=jn.get(e);if(r.handlers||(r.handlers={}),r.handlers[t]||(r.handlers[t]=[]),n.guid||(n.guid=Gn()),r.handlers[t].push(n),r.dispatcher||(r.disabled=!1,r.dispatcher=function(t,n){if(r.disabled)return;t=zn(t);const i=r.handlers[t.type];if(i){const r=i.slice(0);for(let i=0,a=r.length;i<a&&!t.isImmediatePropagationStopped();i++)try{r[i].call(e,t,n)}catch(e){bt.error(e)}}}),1===r.handlers[t].length)if(e.addEventListener){let n=!1;Zn()&&Kn.indexOf(t)>-1&&(n={passive:!0}),e.addEventListener(t,r.dispatcher,n)}else e.attachEvent&&e.attachEvent("on"+t,r.dispatcher)}function Xn(e,t,n){if(!jn.has(e))return;const r=jn.get(e);if(!r.handlers)return;if(Array.isArray(t))return Yn(Xn,e,t,n);const i=function(e,t){r.handlers[t]=[],Vn(e,t)};if(void 0===t){for(const t in r.handlers)Object.prototype.hasOwnProperty.call(r.handlers||{},t)&&i(e,t);return}const a=r.handlers[t];if(a)if(n){if(n.guid)for(let e=0;e<a.length;e++)a[e].guid===n.guid&&a.splice(e--,1);Vn(e,t)}else i(e,t)}function $n(e,t,n){const r=jn.has(e)?jn.get(e):{},i=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=zn(t),r.dispatcher&&r.dispatcher.call(e,t,n),i&&!t.isPropagationStopped()&&!0===t.bubbles)$n.call(null,i,t,n);else if(!i&&!t.defaultPrevented&&t.target&&t.target[t.type]){jn.has(t.target)||jn.set(t.target,{});const e=jn.get(t.target);t.target[t.type]&&(e.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),e.disabled=!1)}return!t.defaultPrevented}function Qn(e,t,n){if(Array.isArray(t))return Yn(Qn,e,t,n);const r=function(){Xn(e,t,r),n.apply(this,arguments)};r.guid=n.guid=n.guid||Gn(),Wn(e,t,r)}function Jn(e,t,n){const r=function(){Xn(e,t,r),n.apply(this,arguments)};r.guid=n.guid=n.guid||Gn(),Wn(e,t,r)}var er=Object.freeze({__proto__:null,fixEvent:zn,on:Wn,off:Xn,trigger:$n,one:Qn,any:Jn});const tr=30,nr=function(e,t,n){t.guid||(t.guid=Gn());const r=t.bind(e);return r.guid=n?n+"_"+t.guid:t.guid,r},rr=function(e,t){let n=i().performance.now();return function(...r){const a=i().performance.now();a-n>=t&&(e(...r),n=a)}},ir=function(e,t,n,r=i()){let a;const s=function(){const i=this,s=arguments;let o=function(){a=null,o=null,n||e.apply(i,s)};!a&&n&&e.apply(i,s),r.clearTimeout(a),a=r.setTimeout(o,t)};return s.cancel=()=>{r.clearTimeout(a),a=null},s};var ar=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:tr,bind_:nr,throttle:rr,debounce:ir});let sr;class or{on(e,t){const n=this.addEventListener;this.addEventListener=()=>{},Wn(this,e,t),this.addEventListener=n}off(e,t){Xn(this,e,t)}one(e,t){const n=this.addEventListener;this.addEventListener=()=>{},Qn(this,e,t),this.addEventListener=n}any(e,t){const n=this.addEventListener;this.addEventListener=()=>{},Jn(this,e,t),this.addEventListener=n}trigger(e){const t=e.type||e;"string"==typeof e&&(e={type:t}),e=zn(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),$n(this,e)}queueTrigger(e){sr||(sr=new Map);const t=e.type||e;let n=sr.get(this);n||(n=new Map,sr.set(this,n));const r=n.get(t);n.delete(t),i().clearTimeout(r);const a=i().setTimeout((()=>{n.delete(t),0===n.size&&(n=null,sr.delete(this)),this.trigger(e)}),0);n.set(t,a)}}or.prototype.allowedEvents_={},or.prototype.addEventListener=or.prototype.on,or.prototype.removeEventListener=or.prototype.off,or.prototype.dispatchEvent=or.prototype.trigger;const ur=e=>"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e,lr=e=>e instanceof or||!!e.eventBusEl_&&["on","one","off","trigger"].every((t=>"function"==typeof e[t])),cr=e=>"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length,dr=(e,t,n)=>{if(!e||!e.nodeName&&!lr(e))throw new Error(`Invalid target for ${ur(t)}#${n}; must be a DOM node or evented object.`)},fr=(e,t,n)=>{if(!cr(e))throw new Error(`Invalid event type for ${ur(t)}#${n}; must be a non-empty string or array.`)},hr=(e,t,n)=>{if("function"!=typeof e)throw new Error(`Invalid listener for ${ur(t)}#${n}; must be a function.`)},pr=(e,t,n)=>{const r=t.length<3||t[0]===e||t[0]===e.eventBusEl_;let i,a,s;return r?(i=e.eventBusEl_,t.length>=3&&t.shift(),[a,s]=t):[i,a,s]=t,dr(i,e,n),fr(a,e,n),hr(s,e,n),s=nr(e,s),{isTargetingSelf:r,target:i,type:a,listener:s}},gr=(e,t,n,r)=>{dr(e,e,t),e.nodeName?er[t](e,n,r):e[t](n,r)},mr={on(...e){const{isTargetingSelf:t,target:n,type:r,listener:i}=pr(this,e,"on");if(gr(n,"on",r,i),!t){const e=()=>this.off(n,r,i);e.guid=i.guid;const t=()=>this.off("dispose",e);t.guid=i.guid,gr(this,"on","dispose",e),gr(n,"on","dispose",t)}},one(...e){const{isTargetingSelf:t,target:n,type:r,listener:i}=pr(this,e,"one");if(t)gr(n,"one",r,i);else{const e=(...t)=>{this.off(n,r,e),i.apply(null,t)};e.guid=i.guid,gr(n,"one",r,e)}},any(...e){const{isTargetingSelf:t,target:n,type:r,listener:i}=pr(this,e,"any");if(t)gr(n,"any",r,i);else{const e=(...t)=>{this.off(n,r,e),i.apply(null,t)};e.guid=i.guid,gr(n,"any",r,e)}},off(e,t,n){if(!e||cr(e))Xn(this.eventBusEl_,e,t);else{const r=e,i=t;dr(r,this,"off"),fr(i,this,"off"),hr(n,this,"off"),n=nr(this,n),this.off("dispose",n),r.nodeName?(Xn(r,i,n),Xn(r,"dispose",n)):lr(r)&&(r.off(i,n),r.off("dispose",n))}},trigger(e,t){dr(this.eventBusEl_,this,"trigger");const n=e&&"string"!=typeof e?e.type:e;if(!cr(n))throw new Error(`Invalid event type for ${ur(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return $n(this.eventBusEl_,e,t)}};function yr(e,t={}){const{eventBusKey:n}=t;if(n){if(!e[n].nodeName)throw new Error(`The eventBusKey "${n}" does not refer to an element.`);e.eventBusEl_=e[n]}else e.eventBusEl_=an("span",{className:"vjs-event-bus"});return Object.assign(e,mr),e.eventedCallbacks&&e.eventedCallbacks.forEach((e=>{e()})),e.on("dispose",(()=>{e.off(),[e,e.el_,e.eventBusEl_].forEach((function(e){e&&jn.has(e)&&jn.delete(e)})),i().setTimeout((()=>{e.eventBusEl_=null}),0)})),e}const vr={state:{},setState(e){let t;return"function"==typeof e&&(e=e()),At(e,((e,n)=>{this.state[n]!==e&&(t=t||{},t[n]={from:this.state[n],to:e}),this.state[n]=e})),t&&lr(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function _r(e,t){return Object.assign(e,vr),e.state=Object.assign({},e.state,t),"function"==typeof e.handleStateChanged&&lr(e)&&e.on("statechanged",e.handleStateChanged),e}const Tr=function(e){return"string"!=typeof e?e:e.replace(/./,(e=>e.toLowerCase()))},br=function(e){return"string"!=typeof e?e:e.replace(/./,(e=>e.toUpperCase()))},Er=function(e,t){return br(e)===br(t)};var Sr=Object.freeze({__proto__:null,toLowerCase:Tr,toTitleCase:br,titleCaseEquals:Er});class wr{constructor(e,t,n){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Dt({},this.options_),t=this.options_=Dt(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const t=e&&e.id&&e.id()||"no_player";this.id_=`${t}_component_${Gn()}`}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach((e=>this.addClass(e))),["on","off","one","any","trigger"].forEach((e=>{this[e]=void 0})),!1!==t.evented&&(yr(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),_r(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,!1!==t.initChildren&&this.initChildren(),this.ready(n),!1!==t.reportTouchActivity&&this.enableTouchActivity()}on(e,t){}off(e,t){}one(e,t){}any(e,t){}trigger(e,t){}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return Boolean(this.isDisposed_)}player(){return this.player_}options(e){return e?(this.options_=Dt(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,n){return an(e,t,n)}localize(e,t,n=e){const r=this.player_.language&&this.player_.language(),i=this.player_.languages&&this.player_.languages(),a=i&&i[r],s=r&&r.split("-")[0],o=i&&i[s];let u=n;return a&&a[e]?u=a[e]:o&&o[e]&&(u=o[e]),t&&(u=u.replace(/\{(\d+)\}/g,(function(e,n){const r=t[n-1];let i=r;return void 0===r&&(i=e),i}))),u}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce(((e,t)=>e.concat(t)),[]);let t=this;for(let n=0;n<e.length;n++)if(t=t.getChild(e[n]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;const n="http://www.w3.org/2000/svg",r=an("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),i=s().createElementNS(n,"svg");i.setAttributeNS(null,"viewBox","0 0 512 512");const a=s().createElementNS(n,"use");return i.appendChild(a),a.setAttributeNS(null,"href",`#vjs-icon-${e}`),r.appendChild(i),this.iconIsSet_?t.replaceChild(r,t.querySelector(".vjs-icon-placeholder")):t.appendChild(r),this.iconIsSet_=!0,r}addChild(e,t={},n=this.children_.length){let r,i;if("string"==typeof e){i=br(e);const n=t.componentClass||i;t.name=i;const a=wr.getComponent(n);if(!a)throw new Error(`Component ${n} does not exist`);if("function"!=typeof a)return null;r=new a(this.player_||this,t)}else r=e;if(r.parentComponent_&&r.parentComponent_.removeChild(r),this.children_.splice(n,0,r),r.parentComponent_=this,"function"==typeof r.id&&(this.childIndex_[r.id()]=r),i=i||r.name&&br(r.name()),i&&(this.childNameIndex_[i]=r,this.childNameIndex_[Tr(i)]=r),"function"==typeof r.el&&r.el()){let e=null;this.children_[n+1]&&(this.children_[n+1].el_?e=this.children_[n+1].el_:tn(this.children_[n+1])&&(e=this.children_[n+1])),this.contentEl().insertBefore(r.el(),e)}return r}removeChild(e){if("string"==typeof e&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let n=this.children_.length-1;n>=0;n--)if(this.children_[n]===e){t=!0,this.children_.splice(n,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[br(e.name())]=null,this.childNameIndex_[Tr(e.name())]=null;const n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,n=e=>{const n=e.name;let r=e.opts;if(void 0!==t[n]&&(r=t[n]),!1===r)return;!0===r&&(r={}),r.playerOptions=this.options_.playerOptions;const i=this.addChild(n,r);i&&(this[n]=i)};let r;const i=wr.getComponent("Tech");r=Array.isArray(e)?e:Object.keys(e),r.concat(Object.keys(this.options_).filter((function(e){return!r.some((function(t){return"string"==typeof t?e===t:e===t.name}))}))).map((t=>{let n,r;return"string"==typeof t?(n=t,r=e[n]||this.options_[n]||{}):(n=t.name,r=t),{name:n,opts:r}})).filter((e=>{const t=wr.getComponent(e.opts.componentClass||br(e.name));return t&&!i.isTech(t)})).forEach(n)}}buildCSSClass(){return""}ready(e,t=!1){if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))}triggerReady(){this.isReady_=!0,this.setTimeout((function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)}$(e,t){return Rn(e,t||this.contentEl())}$$(e,t){return Dn(e,t||this.contentEl())}hasClass(e){return un(this.el_,e)}addClass(...e){ln(this.el_,...e)}removeClass(...e){cn(this.el_,...e)}toggleClass(e,t){dn(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return pn(this.el_,e)}setAttribute(e,t){gn(this.el_,e,t)}removeAttribute(e){mn(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,n){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(n||this.trigger("componentresize"));if(!this.el_)return 0;const r=this.el_.style[e],i=r.indexOf("px");return-1!==i?parseInt(r.slice(0,i),10):parseInt(this.el_["offset"+br(e)],10)}currentDimension(e){let t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=xn(this.el_,e),t=parseFloat(t),0===t||isNaN(t)){const n=`offset${br(e)}`;t=this.el_[n]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(u().isEventKey(e,"Tab")||e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e,t=0,n=null;this.on("touchstart",(function(r){1===r.touches.length&&(n={pageX:r.touches[0].pageX,pageY:r.touches[0].pageY},t=i().performance.now(),e=!0)})),this.on("touchmove",(function(t){if(t.touches.length>1)e=!1;else if(n){const r=t.touches[0].pageX-n.pageX,i=t.touches[0].pageY-n.pageY;Math.sqrt(r*r+i*i)>10&&(e=!1)}}));const r=function(){e=!1};this.on("touchleave",r),this.on("touchcancel",r),this.on("touchend",(function(r){n=null,!0===e&&i().performance.now()-t<200&&(r.preventDefault(),this.trigger("tap"))}))}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=nr(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",(function(){e(),this.clearInterval(t),t=this.setInterval(e,250)}));const n=function(n){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",n),this.on("touchcancel",n)}setTimeout(e,t){var n;return e=nr(this,e),this.clearTimersOnDispose_(),n=i().setTimeout((()=>{this.setTimeoutIds_.has(n)&&this.setTimeoutIds_.delete(n),e()}),t),this.setTimeoutIds_.add(n),n}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),i().clearTimeout(e)),e}setInterval(e,t){e=nr(this,e),this.clearTimersOnDispose_();const n=i().setInterval(e,t);return this.setIntervalIds_.add(n),n}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),i().clearInterval(e)),e}requestAnimationFrame(e){var t;return this.clearTimersOnDispose_(),e=nr(this,e),t=i().requestAnimationFrame((()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()})),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){if(this.namedRafs_.has(e))return;this.clearTimersOnDispose_(),t=nr(this,t);const n=this.requestAnimationFrame((()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)}));return this.namedRafs_.set(e,n),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),i().cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",(()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach((([e,t])=>{this[e].forEach(((e,n)=>this[t](n)))})),this.clearingTimersOnDispose_=!1})))}static registerComponent(e,t){if("string"!=typeof e||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const n=wr.getComponent("Tech"),r=n&&n.isTech(t),i=wr===t||wr.prototype.isPrototypeOf(t.prototype);if(r||!i){let t;throw t=r?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error(`Illegal component, "${e}"; ${t}.`)}e=br(e),wr.components_||(wr.components_={});const a=wr.getComponent("Player");if("Player"===e&&a&&a.players){const e=a.players,t=Object.keys(e);if(e&&t.length>0&&t.map((t=>e[t])).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return wr.components_[e]=t,wr.components_[Tr(e)]=t,t}static getComponent(e){if(e&&wr.components_)return wr.components_[e]}}function Ar(e,t,n,r){return function(e,t,n){if("number"!=typeof t||t<0||t>n)throw new Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${t}) is non-numeric or out of bounds (0-${n}).`)}(e,r,n.length-1),n[r][t]}function Ir(e){let t;return t=void 0===e||0===e.length?{length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:Ar.bind(null,"start",0,e),end:Ar.bind(null,"end",1,e)},i().Symbol&&i().Symbol.iterator&&(t[i().Symbol.iterator]=()=>(e||[]).values()),t}function Cr(e,t){return Array.isArray(e)?Ir(e):void 0===e||void 0===t?Ir():Ir([[e,t]])}wr.registerComponent("Component",wr);const Rr=function(e,t){e=e<0?0:e;let n=Math.floor(e%60),r=Math.floor(e/60%60),i=Math.floor(e/3600);const a=Math.floor(t/60%60),s=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(i=r=n="-"),i=i>0||s>0?i+":":"",r=((i||a>=10)&&r<10?"0"+r:r)+":",n=n<10?"0"+n:n,i+r+n};let Dr=Rr;function xr(e){Dr=e}function Nr(){Dr=Rr}function Or(e,t=e){return Dr(e,t)}var Pr=Object.freeze({__proto__:null,createTimeRanges:Cr,createTimeRange:Cr,setFormatTime:xr,resetFormatTime:Nr,formatTime:Or});function Mr(e,t){let n,r,i=0;if(!t)return 0;e&&e.length||(e=Cr(0,0));for(let a=0;a<e.length;a++)n=e.start(a),r=e.end(a),r>t&&(r=t),i+=r-n;return i/t}function kr(e){if(e instanceof kr)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:Ct(e)&&("number"==typeof e.code&&(this.code=e.code),Object.assign(this,e)),this.message||(this.message=kr.defaultMessages[this.code]||"")}kr.prototype.code=0,kr.prototype.message="",kr.prototype.status=null,kr.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],kr.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(let e=0;e<kr.errorTypes.length;e++)kr[kr.errorTypes[e]]=e,kr.prototype[kr.errorTypes[e]]=e;function Lr(e){return null!=e&&"function"==typeof e.then}function Fr(e){Lr(e)&&e.then(null,(e=>{}))}const Ur=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(((t,n,r)=>(e[n]&&(t[n]=e[n]),t)),{cues:e.cues&&Array.prototype.map.call(e.cues,(function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}}))})};const Br="vjs-modal-dialog";class jr extends wr{constructor(e,t){super(e,t),this.handleKeyDown_=e=>this.handleKeyDown(e),this.close_=e=>this.close(e),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=an("div",{className:`${Br}-content`},{role:"document"}),this.descEl_=an("p",{className:`${Br}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),sn(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Br} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(!this.opened_){const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}}opened(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if("boolean"==typeof e){const t=this.closeable_=!!e;let n=this.getChild("closeButton");if(t&&!n){const e=this.contentEl_;this.contentEl_=this.el_,n=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=e,this.on(n,"close",this.close_)}!t&&n&&(this.off(n,"close",this.close_),this.removeChild(n),n.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),n=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,n.removeChild(t),this.empty(),In(t,e),this.trigger("modalfill"),r?n.insertBefore(t,r):n.appendChild(t);const i=this.getChild("closeButton");i&&n.appendChild(i.el_)}empty(){this.trigger("beforemodalempty"),Sn(this.contentEl()),this.trigger("modalempty")}content(e){return void 0!==e&&(this.content_=e),this.content_}conditionalFocus_(){const e=s().activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(e.stopPropagation(),u().isEventKey(e,"Escape")&&this.closeable())return e.preventDefault(),void this.close();if(!u().isEventKey(e,"Tab"))return;const t=this.focusableEls_(),n=this.el_.querySelector(":focus");let r;for(let e=0;e<t.length;e++)if(n===t[e]){r=e;break}s().activeElement===this.el_&&(r=0),e.shiftKey&&0===r?(t[t.length-1].focus(),e.preventDefault()):e.shiftKey||r!==t.length-1||(t[0].focus(),e.preventDefault())}focusableEls_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,(e=>(e instanceof i().HTMLAnchorElement||e instanceof i().HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof i().HTMLInputElement||e instanceof i().HTMLSelectElement||e instanceof i().HTMLTextAreaElement||e instanceof i().HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof i().HTMLIFrameElement||e instanceof i().HTMLObjectElement||e instanceof i().HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")))}}jr.prototype.options_={pauseOnOpen:!0,temporary:!0},wr.registerComponent("ModalDialog",jr);class qr extends or{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t<e.length;t++)this.addTrack(e[t])}addTrack(e){const t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},lr(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let n=0,r=this.length;n<r;n++)if(this[n]===e){t=this[n],t.off&&t.off(),this.tracks_.splice(n,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let n=0,r=this.length;n<r;n++){const r=this[n];if(r.id===e){t=r;break}}return t}}qr.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const e in qr.prototype.allowedEvents_)qr.prototype["on"+e]=null;const Hr=function(e,t){for(let n=0;n<e.length;n++)Object.keys(e[n]).length&&t.id!==e[n].id&&(e[n].enabled=!1)},Gr=function(e,t){for(let n=0;n<e.length;n++)Object.keys(e[n]).length&&t.id!==e[n].id&&(e[n].selected=!1)};class Vr extends qr{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),-1===["metadata","chapters"].indexOf(e.kind)&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}}class Yr{constructor(e){Yr.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let n=0;const r=e.length;this.cues_=e,this.length_=e.length;const i=function(e){""+e in this||Object.defineProperty(this,""+e,{get(){return this.cues_[e]}})};if(t<r)for(n=t;n<r;n++)i.call(this,n)}getCueById(e){let t=null;for(let n=0,r=this.length;n<r;n++){const r=this[n];if(r.id===e){t=r;break}}return t}}const zr={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Zr={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Kr={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Wr={disabled:"disabled",hidden:"hidden",showing:"showing"};class Xr extends or{constructor(e={}){super();const t={id:e.id||"vjs_track_"+Gn(),kind:e.kind||"",language:e.language||""};let n=e.label||"";for(const e in t)Object.defineProperty(this,e,{get:()=>t[e],set(){}});Object.defineProperty(this,"label",{get:()=>n,set(e){e!==n&&(n=e,this.trigger("labelchange"))}})}}const $r=function(e){const t=["protocol","hostname","port","pathname","search","hash","host"],n=s().createElement("a");n.href=e;const r={};for(let e=0;e<t.length;e++)r[t[e]]=n[t[e]];return"http:"===r.protocol&&(r.host=r.host.replace(/:80$/,"")),"https:"===r.protocol&&(r.host=r.host.replace(/:443$/,"")),r.protocol||(r.protocol=i().location.protocol),r.host||(r.host=i().location.host),r},Qr=function(e){if(!e.match(/^https?:\/\//)){const t=s().createElement("a");t.href=e,e=t.href}return e},Jr=function(e){if("string"==typeof e){const t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(t)return t.pop().toLowerCase()}return""},ei=function(e,t=i().location){const n=$r(e);return(":"===n.protocol?t.protocol:n.protocol)+n.host!==t.protocol+t.host};var ti=Object.freeze({__proto__:null,parseUrl:$r,getAbsoluteURL:Qr,getFileExtension:Jr,isCrossOrigin:ei});const ni=function(e,t){const n=new(i().WebVTT.Parser)(i(),i().vttjs,i().WebVTT.StringDecoder()),r=[];n.oncue=function(e){t.addCue(e)},n.onparsingerror=function(e){r.push(e)},n.onflush=function(){t.trigger({type:"loadeddata",target:t})},n.parse(e),r.length>0&&(i().console&&i().console.groupCollapsed&&i().console.groupCollapsed(`Text Track parsing errors for ${t.src}`),r.forEach((e=>bt.error(e))),i().console&&i().console.groupEnd&&i().console.groupEnd()),n.flush()},ri=function(e,t){const n={uri:e},r=ei(e);r&&(n.cors=r);const a="use-credentials"===t.tech_.crossOrigin();a&&(n.withCredentials=a),f()(n,nr(this,(function(e,n,r){if(e)return bt.error(e,n);t.loaded_=!0,"function"!=typeof i().WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],(e=>{if("vttjserror"!==e.type)return ni(r,t);bt.error(`vttjs failed to load, stopping trying to process ${t.src}`)})):ni(r,t)})))};class ii extends Xr{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=Dt(e,{kind:Kr[e.kind]||"subtitles",language:e.language||e.srclang||""});let n=Wr[t.mode]||"disabled";const r=t.default;"metadata"!==t.kind&&"chapters"!==t.kind||(n="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=!1!==this.tech_.preloadTextTracks;const i=new Yr(this.cues_),a=new Yr(this.activeCues_);let s=!1;this.timeupdateHandler=nr(this,(function(e={}){this.tech_.isDisposed()||(this.tech_.isReady_?(this.activeCues=this.activeCues,s&&(this.trigger("cuechange"),s=!1),"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))):"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))})),this.tech_.one("dispose",(()=>{this.stopTracking()})),"disabled"!==n&&this.startTracking(),Object.defineProperties(this,{default:{get:()=>r,set(){}},mode:{get:()=>n,set(e){Wr[e]&&n!==e&&(n=e,this.preload_||"disabled"===n||0!==this.cues.length||ri(this.src,this),this.stopTracking(),"disabled"!==n&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?i:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(0===this.cues.length)return a;const e=this.tech_.currentTime(),t=[];for(let n=0,r=this.cues.length;n<r;n++){const r=this.cues[n];r.startTime<=e&&r.endTime>=e&&t.push(r)}if(s=!1,t.length!==this.activeCues_.length)s=!0;else for(let e=0;e<t.length;e++)-1===this.activeCues_.indexOf(t[e])&&(s=!0);return this.activeCues_=t,a.setCues_(this.activeCues_),a},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||"subtitles"!==t.kind&&"captions"!==t.kind)&&ri(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(e){let t=e;if(!("getCueAsHTML"in t)){t=new(i().vttjs.VTTCue)(e.startTime,e.endTime,e.text);for(const n in e)n in t||(t[n]=e[n]);t.id=e.id,t.originalCue_=e}const n=this.tech_.textTracks();for(let e=0;e<n.length;e++)n[e]!==this&&n[e].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}removeCue(e){let t=this.cues_.length;for(;t--;){const n=this.cues_[t];if(n===e||n.originalCue_&&n.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}ii.prototype.allowedEvents_={cuechange:"cuechange"};class ai extends Xr{constructor(e={}){const t=Dt(e,{kind:Zr[e.kind]||""});super(t);let n=!1;Object.defineProperty(this,"enabled",{get:()=>n,set(e){"boolean"==typeof e&&e!==n&&(n=e,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class si extends Xr{constructor(e={}){const t=Dt(e,{kind:zr[e.kind]||""});super(t);let n=!1;Object.defineProperty(this,"selected",{get:()=>n,set(e){"boolean"==typeof e&&e!==n&&(n=e,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class oi extends or{constructor(e={}){let t;super();const n=new ii(e);this.kind=n.kind,this.src=n.src,this.srclang=n.language,this.label=n.label,this.default=n.default,Object.defineProperties(this,{readyState:{get:()=>t},track:{get:()=>n}}),t=oi.NONE,n.addEventListener("loadeddata",(()=>{t=oi.LOADED,this.trigger({type:"load",target:this})}))}}oi.prototype.allowedEvents_={load:"load"},oi.NONE=0,oi.LOADING=1,oi.LOADED=2,oi.ERROR=3;const ui={audio:{ListClass:class extends qr{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){Hr(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&Hr(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,Hr(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}},TrackClass:ai,capitalName:"Audio"},video:{ListClass:class extends qr{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){Gr(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set(){}})}addTrack(e){e.selected&&Gr(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,Gr(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}},TrackClass:si,capitalName:"Video"},text:{ListClass:Vr,TrackClass:ii,capitalName:"Text"}};Object.keys(ui).forEach((function(e){ui[e].getterName=`${e}Tracks`,ui[e].privateName=`${e}Tracks_`}));const li={remoteText:{ListClass:Vr,TrackClass:ii,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:class{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,n=e.length;t<n;t++)this.addTrackElement_(e[t])}addTrackElement_(e){const t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let n=0,r=this.trackElements_.length;n<r;n++)if(e===this.trackElements_[n].track){t=this.trackElements_[n];break}return t}removeTrackElement_(e){for(let t=0,n=this.trackElements_.length;t<n;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&"function"==typeof this.trackElements_[t].track.off&&this.trackElements_[t].track.off(),"function"==typeof this.trackElements_[t].off&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}},TrackClass:oi,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},ci=Object.assign({},ui,li);li.names=Object.keys(li),ui.names=Object.keys(ui),ci.names=[].concat(li.names).concat(ui.names);class di extends wr{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=e=>this.onDurationChange(e),this.trackProgress_=e=>this.trackProgress(e),this.trackCurrentTime_=e=>this.trackCurrentTime(e),this.stopTrackingCurrentTime_=e=>this.stopTrackingCurrentTime(e),this.disposeSourceHandler_=e=>this.disposeSourceHandler(e),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",(function(){this.hasStarted_=!0})),this.on("loadstart",(function(){this.hasStarted_=!1})),ci.names.forEach((t=>{const n=ci[t];e&&e[n.getterName]&&(this[n.privateName]=e[n.getterName])})),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach((t=>{!1===e[`native${t}Tracks`]&&(this[`featuresNative${t}Tracks`]=!1)})),!1===e.nativeCaptions||!1===e.nativeTextTracks?this.featuresNativeTextTracks=!1:!0!==e.nativeCaptions&&!0!==e.nativeTextTracks||(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=!1!==e.preloadTextTracks,this.autoRemoteTextTracks_=new ci.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",(()=>this.setTimeout((()=>this.triggerSourceset(e)),1))),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(nr(this,(function(){const e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()})),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Cr(0,0)}bufferedPercent(){return Mr(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval((function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}),250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(ui.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){(e=[].concat(e)).forEach((e=>{const t=this[`${e}Tracks`]()||[];let n=t.length;for(;n--;){const r=t[n];"text"===e&&this.removeRemoteTextTrack(r),t.removeTrack(r)}}))}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const n=e[t];this.removeRemoteTextTrack(n)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return void 0!==e&&(this.error_=new kr(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Cr(0,0):Cr()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){ui.names.forEach((e=>{const t=ui[e],n=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener("removetrack",n),r.addEventListener("addtrack",n),this.on("dispose",(()=>{r.removeEventListener("removetrack",n),r.removeEventListener("addtrack",n)}))}))}addWebVttScript_(){if(!i().WebVTT)if(s().body.contains(this.el())){if(!this.options_["vtt.js"]&&Rt(p())&&Object.keys(p()).length>0)return void this.trigger("vttjsloaded");const e=s().createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",(()=>{e.onload=null,e.onerror=null})),i().WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),n=t=>e.addTrack(t.track),r=t=>e.removeTrack(t.track);t.on("addtrack",n),t.on("removetrack",r),this.addWebVttScript_();const i=()=>this.trigger("texttrackchange"),a=()=>{i();for(let t=0;t<e.length;t++){const n=e[t];n.removeEventListener("cuechange",i),"showing"===n.mode&&n.addEventListener("cuechange",i)}};a(),e.addEventListener("change",a),e.addEventListener("addtrack",a),e.addEventListener("removetrack",a),this.on("dispose",(function(){t.off("addtrack",n),t.off("removetrack",r),e.removeEventListener("change",a),e.removeEventListener("addtrack",a),e.removeEventListener("removetrack",a);for(let t=0;t<e.length;t++)e[t].removeEventListener("cuechange",i)}))}addTextTrack(e,t,n){if(!e)throw new Error("TextTrack kind is required but was not provided");return function(e,t,n,r,i={}){const a=e.textTracks();i.kind=t,n&&(i.label=n),r&&(i.language=r),i.tech=e;const s=new ci.text.TrackClass(i);return a.addTrack(s),s}(this,e,t,n)}createRemoteTextTrack(e){const t=Dt(e,{tech:this});return new li.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const n=this.createRemoteTextTrack(e);return"boolean"!=typeof t&&(t=!1),this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),!1===t&&this.ready((()=>this.autoRemoteTextTracks_.addTrack(n.track))),n}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=Gn();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",(()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())}))):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return di.canPlayType(e.type)}static isTech(e){return e.prototype instanceof di||e instanceof di||e===di}static registerTech(e,t){if(di.techs_||(di.techs_={}),!di.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!di.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!di.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=br(e),di.techs_[e]=t,di.techs_[Tr(e)]=t,"Tech"!==e&&di.defaultTechOrder_.push(e),t}static getTech(e){if(e)return di.techs_&&di.techs_[e]?di.techs_[e]:(e=br(e),i()&&i().videojs&&i().videojs[e]?(bt.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),i().videojs[e]):void 0)}}ci.names.forEach((function(e){const t=ci[e];di.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}})),di.prototype.featuresVolumeControl=!0,di.prototype.featuresMuteControl=!0,di.prototype.featuresFullscreenResize=!1,di.prototype.featuresPlaybackRate=!1,di.prototype.featuresProgressEvents=!1,di.prototype.featuresSourceset=!1,di.prototype.featuresTimeupdateEvents=!1,di.prototype.featuresNativeTextTracks=!1,di.prototype.featuresVideoFrameCallback=!1,di.withSourceHandlers=function(e){e.registerSourceHandler=function(t,n){let r=e.sourceHandlers;r||(r=e.sourceHandlers=[]),void 0===n&&(n=r.length),r.splice(n,0,t)},e.canPlayType=function(t){const n=e.sourceHandlers||[];let r;for(let e=0;e<n.length;e++)if(r=n[e].canPlayType(t),r)return r;return""},e.selectSourceHandler=function(t,n){const r=e.sourceHandlers||[];let i;for(let e=0;e<r.length;e++)if(i=r[e].canHandleSource(t,n),i)return r[e];return null},e.canPlaySource=function(t,n){const r=e.selectSourceHandler(t,n);return r?r.canHandleSource(t,n):""},["seekable","seeking","duration"].forEach((function(e){const t=this[e];"function"==typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})}),e.prototype),e.prototype.setSource=function(t){let n=e.selectSourceHandler(t,this.options_);n||(e.nativeSourceHandler?n=e.nativeSourceHandler:bt.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),n!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=n.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},e.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},wr.registerComponent("Tech",di),di.registerTech("Tech",di),di.defaultTechOrder_=[];const fi={},hi={},pi={};function gi(e,t,n){e.setTimeout((()=>bi(t,fi[t.type],n,e)),1)}function mi(e,t,n,r=null){const i="call"+br(n),a=e.reduce(Ti(i),r),s=a===pi,o=s?null:t[n](a);return function(e,t,n,r){for(let i=e.length-1;i>=0;i--){const a=e[i];a[t]&&a[t](r,n)}}(e,n,o,s),o}const yi={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},vi={setCurrentTime:1,setMuted:1,setVolume:1},_i={play:1,pause:1};function Ti(e){return(t,n)=>t===pi?pi:n[e]?n[e](t):t}function bi(e={},t=[],n,r,i=[],a=!1){const[s,...o]=t;if("string"==typeof s)bi(e,fi[s],n,r,i,a);else if(s){const t=function(e,t){const n=hi[e.id()];let r=null;if(null==n)return r=t(e),hi[e.id()]=[[t,r]],r;for(let e=0;e<n.length;e++){const[i,a]=n[e];i===t&&(r=a)}return null===r&&(r=t(e),n.push([t,r])),r}(r,s);if(!t.setSource)return i.push(t),bi(e,o,n,r,i,a);t.setSource(Object.assign({},e),(function(s,u){if(s)return bi(e,o,n,r,i,a);i.push(t),bi(u,e.type===u.type?o:fi[u.type],n,r,i,a)}))}else o.length?bi(e,o,n,r,i,a):a?n(e,i):bi(e,fi["*"],n,r,i,!0)}const Ei={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},Si=function(e=""){const t=Jr(e);return Ei[t.toLowerCase()]||""},wi=function(e){if(Array.isArray(e)){let t=[];e.forEach((function(e){e=wi(e),Array.isArray(e)?t=t.concat(e):Ct(e)&&t.push(e)})),e=t}else e="string"==typeof e&&e.trim()?[Ai({src:e})]:Ct(e)&&"string"==typeof e.src&&e.src&&e.src.trim()?[Ai(e)]:[];return e};function Ai(e){if(!e.type){const t=Si(e.src);t&&(e.type=t)}return e}wr.registerComponent("MediaLoader",class extends wr{constructor(e,t,n){if(super(e,Dt({createEl:!1},t),n),t.playerOptions.sources&&0!==t.playerOptions.sources.length)e.src(t.playerOptions.sources);else for(let n=0,r=t.playerOptions.techOrder;n<r.length;n++){const t=br(r[n]);let i=di.getTech(t);if(t||(i=wr.getComponent(t)),i&&i.isSupported()){e.loadTech_(t);break}}}});class Ii extends wr{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=e=>this.handleMouseOver(e),this.handleMouseOut_=e=>this.handleMouseOut(e),this.handleClick_=e=>this.handleClick(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.emitTapEvents(),this.enable()}createEl(e="div",t={},n={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),"button"===e&&bt.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),n=Object.assign({role:"button"},n),this.tabIndex_=t.tabIndex;const r=an(e,t,n);return this.player_.options_.experimentalSvgIcons||r.appendChild(an("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=an("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(void 0===e)return this.controlText_||"Need Text";const n=this.localize(e);this.controlText_=e,sn(this.controlTextEl_,n),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",n)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){u().isEventKey(e,"Space")||u().isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}wr.registerComponent("ClickableComponent",Ii);class Ci extends Ii{constructor(e,t){super(e,t),this.update(),this.update_=e=>this.update(e),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return an("div",{className:"vjs-poster"})}crossOrigin(e){if(void 0===e)return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;null===e||"anonymous"===e||"use-credentials"===e?this.$("img")&&(this.$("img").crossOrigin=e):this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){e?(this.$("img")||this.el_.appendChild(an("picture",{className:"vjs-poster",tabIndex:-1},{},an("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e):this.el_.textContent=""}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?Fr(this.player_.play()):this.player_.pause())}}Ci.prototype.crossorigin=Ci.prototype.crossOrigin,wr.registerComponent("PosterImage",Ci);const Ri="#222",Di="#ccc",xi={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Ni(e,t){let n;if(4===e.length)n=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");n=e.slice(1)}return"rgba("+parseInt(n.slice(0,2),16)+","+parseInt(n.slice(2,4),16)+","+parseInt(n.slice(4,6),16)+","+t+")"}function Oi(e,t,n){try{e.style[t]=n}catch(e){return}}function Pi(e){return e?`${e}px`:""}wr.registerComponent("TextTrackDisplay",class extends wr{constructor(e,t,n){super(e,t,n);const r=e=>{this.updateDisplayOverlay(),this.updateDisplay(e)};e.on("loadstart",(e=>this.toggleDisplay(e))),e.on("texttrackchange",(e=>this.updateDisplay(e))),e.on("loadedmetadata",(e=>{this.updateDisplayOverlay(),this.preselectTrack(e)})),e.ready(nr(this,(function(){if(e.tech_&&e.tech_.featuresNativeTextTracks)return void this.hide();e.on("fullscreenchange",r),e.on("playerresize",r);const t=i().screen.orientation||i(),n=i().screen.orientation?"change":"orientationchange";t.addEventListener(n,r),e.on("dispose",(()=>t.removeEventListener(n,r)));const a=this.options_.playerOptions.tracks||[];for(let e=0;e<a.length;e++)this.player_.addRemoteTextTrack(a[e],!0);this.preselectTrack()})))}preselectTrack(){const e={captions:1,subtitles:1},t=this.player_.textTracks(),n=this.player_.cache_.selectedLanguage;let r,i,a;for(let s=0;s<t.length;s++){const o=t[s];n&&n.enabled&&n.language&&n.language===o.language&&o.kind in e?o.kind===n.kind?a=o:a||(a=o):n&&!n.enabled?(a=null,r=null,i=null):o.default&&("descriptions"!==o.kind||r?o.kind in e&&!i&&(i=o):r=o)}a?a.mode="showing":i?i.mode="showing":r&&(r.mode="showing")}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){"function"==typeof i().WebVTT&&i().WebVTT.processCues(i(),[],this.el_)}updateDisplay(){const e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){const t=[];for(let n=0;n<e.length;++n){const r=e[n];"showing"===r.mode&&t.push(r)}return void this.updateForTrack(t)}let n=null,r=null,i=e.length;for(;i--;){const t=e[i];"showing"===t.mode&&("descriptions"===t.kind?n=t:r=t)}r?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(r)):n&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(n))}updateDisplayOverlay(){if(!this.player_.videoHeight()||!i().CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),n=e/t,r=this.player_.videoWidth()/this.player_.videoHeight();let a=0,s=0;Math.abs(n-r)>.1&&(n>r?a=Math.round((e-t*r)/2):s=Math.round((t-e/r)/2)),Oi(this.el_,"insetInline",Pi(a)),Oi(this.el_,"insetBlock",Pi(s))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),n=e.activeCues;let r=n.length;for(;r--;){const e=n[r];if(!e)continue;const a=e.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&Oi(a.firstChild,"color",Ni(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&Oi(a.firstChild,"backgroundColor",Ni(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?Oi(a,"backgroundColor",Ni(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&("dropshadow"===t.edgeStyle?a.firstChild.style.textShadow=`2px 2px 3px ${Ri}, 2px 2px 4px ${Ri}, 2px 2px 5px ${Ri}`:"raised"===t.edgeStyle?a.firstChild.style.textShadow=`1px 1px ${Ri}, 2px 2px ${Ri}, 3px 3px ${Ri}`:"depressed"===t.edgeStyle?a.firstChild.style.textShadow=`1px 1px ${Di}, 0 1px ${Di}, -1px -1px ${Ri}, 0 -1px ${Ri}`:"uniform"===t.edgeStyle&&(a.firstChild.style.textShadow=`0 0 4px ${Ri}, 0 0 4px ${Ri}, 0 0 4px ${Ri}, 0 0 4px ${Ri}`)),t.fontPercent&&1!==t.fontPercent){const e=i().parseFloat(a.style.fontSize);a.style.fontSize=e*t.fontPercent+"px",a.style.height="auto",a.style.top="auto"}t.fontFamily&&"default"!==t.fontFamily&&("small-caps"===t.fontFamily?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=xi[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),"function"!=typeof i().WebVTT||e.every((e=>!e.activeCues)))return;const t=[];for(let n=0;n<e.length;++n){const r=e[n];for(let e=0;e<r.activeCues.length;++e)t.push(r.activeCues[e])}i().WebVTT.processCues(i(),t,this.el_);for(let t=0;t<e.length;++t){const n=e[t];for(let e=0;e<n.activeCues.length;++e){const r=n.activeCues[e].displayState;ln(r,"vjs-text-track-cue","vjs-text-track-cue-"+(n.language?n.language:t)),n.language&&gn(r,"lang",n.language)}this.player_.textTrackSettings&&this.updateDisplayState(n)}}}),wr.registerComponent("LoadingSpinner",class extends wr{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),n=an("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),r=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return r.appendChild(n),r}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}});class Mi extends Ii{createEl(e,t={},n={}){const r=an("button",t=Object.assign({className:this.buildCSSClass()},t),n=Object.assign({type:"button"},n));return this.player_.options_.experimentalSvgIcons||r.appendChild(an("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}addChild(e,t={}){const n=this.constructor.name;return bt.warn(`Adding an actionable (user controllable) child to a Button (${n}) is not supported; use a ClickableComponent instead.`),wr.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){u().isEventKey(e,"Space")||u().isEventKey(e,"Enter")?e.stopPropagation():super.handleKeyDown(e)}}wr.registerComponent("Button",Mi);class ki extends Mi{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",(e=>this.handleMouseDown(e)))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e)return Fr(t),void(this.player_.tech(!0)&&this.player_.tech(!0).focus());const n=this.player_.getChild("controlBar"),r=n&&n.getChild("playToggle");if(!r)return void this.player_.tech(!0).focus();const i=()=>r.focus();Lr(t)?t.then(i,(()=>{})):this.setTimeout(i,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}ki.prototype.controlText_="Play Video",wr.registerComponent("BigPlayButton",ki),wr.registerComponent("CloseButton",class extends Mi{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){u().isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}});class Li extends Mi{constructor(e,t={}){super(e,t),t.replay=void 0===t.replay||t.replay,this.setIcon("play"),this.on(e,"play",(e=>this.handlePlay(e))),this.on(e,"pause",(e=>this.handlePause(e))),t.replay&&this.on(e,"ended",(e=>this.handleEnded(e)))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?Fr(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",(e=>this.handleSeeked(e)))}}Li.prototype.controlText_="Play",wr.registerComponent("PlayToggle",Li);class Fi extends wr{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],(e=>this.update(e))),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),n=an("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(n),this.contentEl_=an("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){(this.player_.options_.enableSmoothSeeking||"seeking"!==e.type)&&this.updateContent(e)}updateTextNode_(e=0){e=Or(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",(()=>{if(!this.contentEl_)return;let e=this.textNode_;e&&this.contentEl_.firstChild!==e&&(e=null,bt.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=s().createTextNode(this.formattedTime_),this.textNode_&&(e?this.contentEl_.replaceChild(this.textNode_,e):this.contentEl_.appendChild(this.textNode_))})))}updateContent(e){}}Fi.prototype.labelText_="Time",Fi.prototype.controlText_="Time",wr.registerComponent("TimeDisplay",Fi);class Ui extends Fi{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}Ui.prototype.labelText_="Current Time",Ui.prototype.controlText_="Current Time",wr.registerComponent("CurrentTimeDisplay",Ui);class Bi extends Fi{constructor(e,t){super(e,t);const n=e=>this.updateContent(e);this.on(e,"durationchange",n),this.on(e,"loadstart",n),this.on(e,"loadedmetadata",n)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}Bi.prototype.labelText_="Duration",Bi.prototype.controlText_="Duration",wr.registerComponent("DurationDisplay",Bi),wr.registerComponent("TimeDivider",class extends wr{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),n=super.createEl("span",{textContent:"/"});return t.appendChild(n),e.appendChild(t),e}});class ji extends Fi{constructor(e,t){super(e,t),this.on(e,"durationchange",(e=>this.updateContent(e)))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return!1!==this.options_.displayNegative&&e.insertBefore(an("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if("number"!=typeof this.player_.duration())return;let t;t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t)}}ji.prototype.labelText_="Remaining Time",ji.prototype.controlText_="Remaining Time",wr.registerComponent("RemainingTimeDisplay",ji),wr.registerComponent("LiveDisplay",class extends wr{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",(e=>this.updateShowing(e)))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=an("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(an("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(s().createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}});class qi extends Mi{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=e=>this.updateLiveEdgeStatus(e),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=an("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}function Hi(e,t,n){return e=Number(e),Math.min(n,Math.max(t,isNaN(e)?t:e))}qi.prototype.controlText_="Seek to live, currently playing live",wr.registerComponent("SeekToLive",qi);var Gi=Object.freeze({__proto__:null,clamp:Hi});class Vi extends wr{constructor(e,t){super(e,t),this.handleMouseDown_=e=>this.handleMouseDown(e),this.handleMouseUp_=e=>this.handleMouseUp(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.handleClick_=e=>this.handleClick(e),this.handleMouseMove_=e=>this.handleMouseMove(e),this.update_=e=>this.update(e),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},n={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),n=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},n),super.createEl(e,t,n)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||jt||e.preventDefault(),yn(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;vn(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",(()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(100*e).toFixed(2)+"%"}))),e}getProgress(){return Number(Hi(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=bn(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){u().isEventKey(e,"Left")||u().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):u().isEventKey(e,"Right")||u().isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}wr.registerComponent("Slider",Vi);const Yi=(e,t)=>Hi(e/t*100,0,100).toFixed(2)+"%";wr.registerComponent("LoadProgressBar",class extends wr{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",(e=>this.update(e)))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=an("span",{className:"vjs-control-text"}),n=an("span",{textContent:this.localize("Loaded")}),r=s().createTextNode(": ");return this.percentageEl_=an("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(n),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",(()=>{const e=this.player_.liveTracker,t=this.player_.buffered(),n=e&&e.isLive()?e.seekableEnd():this.player_.duration(),r=this.player_.bufferedEnd(),i=this.partEls_,a=Yi(r,n);this.percent_!==a&&(this.el_.style.width=a,sn(this.percentageEl_,a),this.percent_=a);for(let e=0;e<t.length;e++){const n=t.start(e),a=t.end(e);let s=i[e];s||(s=this.el_.appendChild(an()),i[e]=s),s.dataset.start===n&&s.dataset.end===a||(s.dataset.start=n,s.dataset.end=a,s.style.left=Yi(n,r),s.style.width=Yi(a-n,r))}for(let e=i.length;e>t.length;e--)this.el_.removeChild(i[e-1]);i.length=t.length}))}}),wr.registerComponent("TimeTooltip",class extends wr{constructor(e,t){super(e,t),this.update=rr(nr(this,this.update),tr)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,n){const r=Tn(this.el_),i=_n(this.player_.el()),a=e.width*t;if(!i||!r)return;const s=e.left-i.left+a,o=e.width-a+(i.right-e.right);let u=r.width/2;s<u?u+=u-s:o<u&&(u=o),u<0?u=0:u>r.width&&(u=r.width),u=Math.round(u),this.el_.style.right=`-${u}px`,this.write(n)}write(e){sn(this.el_,e)}updateTime(e,t,n,r){this.requestNamedAnimationFrame("TimeTooltip#updateTime",(()=>{let i;const a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const e=this.player_.liveTracker.liveWindow(),n=e-t*e;i=(n<1?"":"-")+Or(n,e)}else i=Or(n,a);this.update(e,t,i),r&&r()}))}});class zi extends wr{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=rr(nr(this,this.update),tr)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const n=this.getChild("timeTooltip");if(!n)return;const r=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();n.updateTime(e,t,r)}}zi.prototype.options_={children:[]},Xt||Lt||zi.prototype.options_.children.push("timeTooltip"),wr.registerComponent("PlayProgressBar",zi);class Zi extends wr{constructor(e,t){super(e,t),this.update=rr(nr(this,this.update),tr)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const n=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,n,(()=>{this.el_.style.left=e.width*t+"px"}))}}Zi.prototype.options_={children:["timeTooltip"]},wr.registerComponent("MouseTimeDisplay",Zi);class Ki extends Vi{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=nr(this,this.update),this.update=rr(this.update_,tr),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in s()&&"visibilityState"in s()&&this.on(s(),"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){"hidden"===s().visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,tr))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if("hidden"===s().visibilityState)return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",(()=>{const e=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),n=this.player_.liveTracker;let r=this.player_.duration();n&&n.isLive()&&(r=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.percent_=t),this.currentTime_===e&&this.duration_===r||(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[Or(e,r),Or(r,r)],"{1} of {2}")),this.currentTime_=e,this.duration_=r),this.bar&&this.bar.update(_n(this.el()),this.getProgress())})),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){const e=this.getCurrentTime_();let t;const n=this.player_.liveTracker;return n&&n.isLive()?(t=(e-n.seekableStart())/n.liveWindow(),n.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){Cn(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!Cn(e)||isNaN(this.player_.duration()))return;let n;t||this.player_.scrubbing()||this.player_.scrubbing(!0);const r=this.calculateDistance(e),i=this.player_.liveTracker;if(i&&i.isLive()){if(r>=.99)return void i.seekToLiveEdge();const e=i.seekableStart(),t=i.liveCurrentTime();if(n=e+r*i.liveWindow(),n>=t&&(n=t),n<=e&&(n=e+.1),n===1/0)return}else n=r*this.player_.duration(),n===this.player_.duration()&&(n-=.1);this.userSeek_(n),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Fr(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+5)}stepBack(){this.userSeek_(this.player_.currentTime()-5)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(u().isEventKey(e,"Space")||u().isEventKey(e,"Enter"))e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(u().isEventKey(e,"Home"))e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(u().isEventKey(e,"End"))e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(u()(e))){e.preventDefault(),e.stopPropagation();const n=10*(u().codes[u()(e)]-u().codes[0])/100;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*n):this.userSeek_(this.player_.duration()*n)}else u().isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):u().isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in s()&&"visibilityState"in s()&&this.off(s(),"visibilitychange",this.toggleVisibility_),super.dispose()}}Ki.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},Xt||Lt||Ki.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),wr.registerComponent("SeekBar",Ki);class Wi extends wr{constructor(e,t){super(e,t),this.handleMouseMove=rr(nr(this,this.handleMouseMove),tr),this.throttledHandleMouseSeek=rr(nr(this,this.handleMouseSeek),tr),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.handleMouseDownHandler_=e=>this.handleMouseDown(e),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const n=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(!n&&!r)return;const i=t.el(),a=Tn(i);let s=bn(i,e).x;s=Hi(s,0,1),r&&r.update(a,s),n&&n.update(a,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach((e=>e.disable&&e.disable())),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&Fr(this.player_.play())}}enable(){this.children().forEach((e=>e.enable&&e.enable())),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,n=this.getChild("seekBar");n&&n.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}Wi.prototype.options_={children:["seekBar"]},wr.registerComponent("ProgressControl",Wi);class Xi extends Mi{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],(e=>this.handlePictureInPictureChange(e))),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],(e=>this.handlePictureInPictureEnabledChange(e))),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],(()=>this.handlePictureInPictureAudioModeChange())),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){"audio"===this.player_.currentType().substring(0,5)||this.player_.audioPosterMode()||this.player_.audioOnlyMode()?(this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()):this.show()}handlePictureInPictureEnabledChange(){s().pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in i()?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){"function"==typeof s().exitPictureInPicture&&super.show()}}Xi.prototype.controlText_="Picture-in-Picture",wr.registerComponent("PictureInPictureToggle",Xi);class $i extends Mi{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",(e=>this.handleFullscreenChange(e))),!1===s()[e.fsApi_.fullscreenEnabled]&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}$i.prototype.controlText_="Fullscreen",wr.registerComponent("FullscreenToggle",$i),wr.registerComponent("VolumeLevel",class extends wr{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}),wr.registerComponent("VolumeLevelTooltip",class extends wr{constructor(e,t){super(e,t),this.update=rr(nr(this,this.update),tr)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,n,r){if(!n){const n=_n(this.el_),r=_n(this.player_.el()),i=e.width*t;if(!r||!n)return;const a=e.left-r.left+i,s=e.width-i+(r.right-e.right);let o=n.width/2;a<o?o+=o-a:s<o&&(o=s),o<0?o=0:o>n.width&&(o=n.width),this.el_.style.right=`-${o}px`}this.write(`${r}%`)}write(e){sn(this.el_,e)}updateVolume(e,t,n,r,i){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",(()=>{this.update(e,t,n,r.toFixed(0)),i&&i()}))}});class Qi extends wr{constructor(e,t){super(e,t),this.update=rr(nr(this,this.update),tr)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,n){const r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,n,r,(()=>{n?this.el_.style.bottom=e.height*t+"px":this.el_.style.left=e.width*t+"px"}))}}Qi.prototype.options_={children:["volumeLevelTooltip"]},wr.registerComponent("MouseVolumeLevelDisplay",Qi);class Ji extends Vi{constructor(e,t){super(e,t),this.on("slideractive",(e=>this.updateLastVolume_(e))),this.on(e,"volumechange",(e=>this.updateARIAAttributes(e))),e.ready((()=>this.updateARIAAttributes()))}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){Cn(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const n=this.el(),r=_n(n),i=this.vertical();let a=bn(n,e);a=i?a.y:a.x,a=Hi(a,0,1),t.update(r,a,i)}Cn(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(100*this.player_.volume())}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",(()=>{0===this.player_.volume()&&this.player_.lastVolume_(e)}))}}Ji.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},Xt||Lt||Ji.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),Ji.prototype.playerEvent="volumechange",wr.registerComponent("VolumeBar",Ji);class ea extends wr{constructor(e,t={}){t.vertical=t.vertical||!1,(void 0===t.volumeBar||Rt(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(this,e),this.throttledHandleMouseMove=rr(nr(this,this.handleMouseMove),tr),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.on("mousedown",(e=>this.handleMouseDown(e))),this.on("touchstart",(e=>this.handleMouseDown(e))),this.on("mousemove",(e=>this.handleMouseMove(e))),this.on(this.volumeBar,["focus","slideractive"],(()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")})),this.on(this.volumeBar,["blur","sliderinactive"],(()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")}))}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}ea.prototype.options_={children:["volumeBar"]},wr.registerComponent("VolumeControl",ea);class ta extends Mi{constructor(e,t){super(e,t),function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(this,e),this.on(e,["loadstart","volumechange"],(e=>this.update(e)))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),n=this.player_.lastVolume_();if(0===t){const e=n<.1?.1:n;this.player_.volume(e),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),Xt&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),cn(this.el_,[0,1,2,3].reduce(((e,t)=>e+`${t?" ":""}vjs-vol-${t}`),"")),ln(this.el_,`vjs-vol-${t}`)}updateControlText_(){const e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)}}ta.prototype.controlText_="Mute",wr.registerComponent("MuteToggle",ta);class na extends wr{constructor(e,t={}){void 0!==t.inline?t.inline=t.inline:t.inline=!0,(void 0===t.volumeControl||Rt(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=e=>this.handleKeyPress(e),this.on(e,["loadstart"],(e=>this.volumePanelState_(e))),this.on(this.muteToggle,"keyup",(e=>this.handleKeyPress(e))),this.on(this.volumeControl,"keyup",(e=>this.handleVolumeControlKeyUp(e))),this.on("keydown",(e=>this.handleKeyPress(e))),this.on("mouseover",(e=>this.handleMouseOver(e))),this.on("mouseout",(e=>this.handleMouseOut(e))),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){u().isEventKey(e,"Esc")&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),Wn(s(),"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),Xn(s(),"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){u().isEventKey(e,"Esc")&&this.handleMouseOut()}}na.prototype.options_={children:["muteToggle","volumeControl"]},wr.registerComponent("VolumePanel",na);class ra extends Mi{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),n=this.player_.liveTracker,r=n&&n.isLive()?n.seekableEnd():this.player_.duration();let i;i=t+this.skipTime<=r?t+this.skipTime:r,this.player_.currentTime(i)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}ra.prototype.controlText_="Skip Forward",wr.registerComponent("SkipForward",ra);class ia extends Mi{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),n=this.player_.liveTracker,r=n&&n.isLive()&&n.seekableStart();let i;i=r&&t-this.skipTime<=r?r:t>=this.skipTime?t-this.skipTime:0,this.player_.currentTime(i)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}ia.prototype.controlText_="Skip Backward",wr.registerComponent("SkipBackward",ia);class aa extends wr{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",(e=>this.handleKeyDown(e))),this.boundHandleBlur_=e=>this.handleBlur(e),this.boundHandleTapClick_=e=>this.handleTapClick(e)}addEventListenerForItem(e){e instanceof wr&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof wr&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){"string"==typeof e&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=an(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),Wn(t,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||s().activeElement;if(!this.children().some((e=>e.el()===t))){const e=this.menuButton_;e&&e.buttonPressed_&&t!==e.el().firstChild&&e.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const n=t.filter((t=>t.el()===e.target))[0];if(!n)return;"CaptionSettingsMenuItem"!==n.name()&&this.menuButton_.focus()}}handleKeyDown(e){u().isEventKey(e,"Left")||u().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(u().isEventKey(e,"Right")||u().isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}wr.registerComponent("Menu",aa);class sa extends wr{constructor(e,t={}){super(e,t),this.menuButton_=new Mi(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const n=Mi.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+n,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const r=e=>this.handleClick(e);this.handleMenuKeyUp_=e=>this.handleMenuKeyUp(e),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",(e=>this.handleKeyDown(e))),this.on(this.menuButton_,"mouseenter",(()=>{this.addClass("vjs-hover"),this.menu.show(),Wn(s(),"keyup",this.handleMenuKeyUp_)})),this.on("mouseleave",(e=>this.handleMouseLeave(e))),this.on("keydown",(e=>this.handleSubmenuKeyDown(e)))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new aa(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=an("li",{className:"vjs-menu-title",textContent:br(this.options_.title),tabIndex:-1}),n=new wr(this.player_,{el:t});e.addItem(n)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(e){super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${Mi.prototype.buildCSSClass()} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(e,t=this.menuButton_.el()){return this.menuButton_.controlText(e,t)}dispose(){this.handleMouseLeave(),super.dispose()}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(e){this.removeClass("vjs-hover"),Xn(s(),"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){u().isEventKey(e,"Esc")||u().isEventKey(e,"Tab")?(this.buttonPressed_&&this.unpressButton(),u().isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus())):(u().isEventKey(e,"Up")||u().isEventKey(e,"Down"))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))}handleMenuKeyUp(e){(u().isEventKey(e,"Esc")||u().isEventKey(e,"Tab"))&&this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){(u().isEventKey(e,"Esc")||u().isEventKey(e,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),u().isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus()))}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Xt&&nn())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}}wr.registerComponent("MenuButton",sa);class oa extends sa{constructor(e,t){const n=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!n)return;const r=nr(this,this.update);n.addEventListener("removetrack",r),n.addEventListener("addtrack",r),n.addEventListener("labelchange",r),this.player_.on("ready",r),this.player_.on("dispose",(function(){n.removeEventListener("removetrack",r),n.removeEventListener("addtrack",r),n.removeEventListener("labelchange",r)}))}}wr.registerComponent("TrackButton",oa);const ua=["Tab","Esc","Up","Down","Right","Left"];class la extends Ii{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem")}createEl(e,t,n){this.nonIconControl=!0;const r=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),n),i=an("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?r.appendChild(i):r.replaceChild(i,r.querySelector(".vjs-icon-placeholder")),r}handleKeyDown(e){ua.some((t=>u().isEventKey(e,t)))||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}}wr.registerComponent("MenuItem",la);class ca extends la{constructor(e,t){const n=t.track,r=e.textTracks();t.label=n.label||n.language||"Unknown",t.selected="showing"===n.mode,super(e,t),this.track=n,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const a=(...e)=>{this.handleTracksChange.apply(this,e)},o=(...e)=>{this.handleSelectedLanguageChange.apply(this,e)};if(e.on(["loadstart","texttrackchange"],a),r.addEventListener("change",a),r.addEventListener("selectedlanguagechange",o),this.on("dispose",(function(){e.off(["loadstart","texttrackchange"],a),r.removeEventListener("change",a),r.removeEventListener("selectedlanguagechange",o)})),void 0===r.onchange){let e;this.on(["tap","click"],(function(){if("object"!=typeof i().Event)try{e=new(i().Event)("change")}catch(e){}e||(e=s().createEvent("Event"),e.initEvent("change",!0,!0)),r.dispatchEvent(e)}))}this.handleTracksChange()}handleClick(e){const t=this.track,n=this.player_.textTracks();if(super.handleClick(e),n)for(let e=0;e<n.length;e++){const r=n[e];-1!==this.kinds.indexOf(r.kind)&&(r===t?"showing"!==r.mode&&(r.mode="showing"):"disabled"!==r.mode&&(r.mode="disabled"))}}handleTracksChange(e){const t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if("showing"===this.track.mode){const e=this.player_.cache_.selectedLanguage;if(e&&e.enabled&&e.language===this.track.language&&e.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null,super.dispose()}}wr.registerComponent("TextTrackMenuItem",ca);class da extends ca{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleTracksChange(e){const t=this.player().textTracks();let n=!0;for(let e=0,r=t.length;e<r;e++){const r=t[e];if(this.options_.kinds.indexOf(r.kind)>-1&&"showing"===r.mode){n=!1;break}}n!==this.isSelected_&&this.selected(n)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let n=!0;for(let e=0,r=t.length;e<r;e++){const r=t[e];if(["captions","descriptions","subtitles"].indexOf(r.kind)>-1&&"showing"===r.mode){n=!1;break}}n&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}wr.registerComponent("OffTextTrackMenuItem",da);class fa extends oa{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=ca){let n;this.label_&&(n=`${this.label_} off`),e.push(new da(this.player_,{kinds:this.kinds_,kind:this.kind_,label:n})),this.hideThreshold_+=1;const r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n<r.length;n++){const i=r[n];if(this.kinds_.indexOf(i.kind)>-1){const n=new t(this.player_,{track:i,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});n.addClass(`vjs-${i.kind}-menu-item`),e.push(n)}}return e}}wr.registerComponent("TextTrackButton",fa);class ha extends la{constructor(e,t){const n=t.track,r=t.cue,i=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=i&&i<r.endTime,super(e,t),this.track=n,this.cue=r}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}wr.registerComponent("ChaptersTrackMenuItem",ha);class pa extends fa{constructor(e,t,n){super(e,t,n),this.setIcon("chapters"),this.selectCurrentItem_=()=>{this.items.forEach((e=>{e.selected(this.track_.activeCues[0]===e.cue)}))}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&"chapters"!==e.track.kind)return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.kind===this.kind_)return n}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(br(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let n=0,r=t.length;n<r;n++){const r=t[n],i=new ha(this.player_,{track:this.track_,cue:r});e.push(i)}return e}}pa.prototype.kind_="chapters",pa.prototype.controlText_="Chapters",wr.registerComponent("ChaptersButton",pa);class ga extends fa{constructor(e,t,n){super(e,t,n),this.setIcon("audio-description");const r=e.textTracks(),i=nr(this,this.handleTracksChange);r.addEventListener("change",i),this.on("dispose",(function(){r.removeEventListener("change",i)}))}handleTracksChange(e){const t=this.player().textTracks();let n=!1;for(let e=0,r=t.length;e<r;e++){const r=t[e];if(r.kind!==this.kind_&&"showing"===r.mode){n=!0;break}}n?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}ga.prototype.kind_="descriptions",ga.prototype.controlText_="Descriptions",wr.registerComponent("DescriptionsButton",ga);class ma extends fa{constructor(e,t,n){super(e,t,n),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}ma.prototype.kind_="subtitles",ma.prototype.controlText_="Subtitles",wr.registerComponent("SubtitlesButton",ma);class ya extends ca{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+t.kind+" settings dialog")}handleClick(e){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings"),super.handleLanguagechange()}}wr.registerComponent("CaptionSettingsMenuItem",ya);class va extends fa{constructor(e,t,n){super(e,t,n),this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new ya(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}va.prototype.kind_="captions",va.prototype.controlText_="Captions",wr.registerComponent("CaptionsButton",va);class _a extends ca{createEl(e,t,n){const r=super.createEl(e,t,n),i=r.querySelector(".vjs-menu-item-text");return"captions"===this.options_.track.kind&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",r):i.appendChild(an("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),i.appendChild(an("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),r}}wr.registerComponent("SubsCapsMenuItem",_a);class Ta extends fa{constructor(e,t={}){super(e,t),this.label_="subtitles",this.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(br(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new ya(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,_a),e}}Ta.prototype.kinds_=["captions","subtitles"],Ta.prototype.controlText_="Subtitles",wr.registerComponent("SubsCapsButton",Ta);class ba extends la{constructor(e,t){const n=t.track,r=e.audioTracks();t.label=n.label||n.language||"Unknown",t.selected=n.enabled,super(e,t),this.track=n,this.addClass(`vjs-${n.kind}-menu-item`);const i=(...e)=>{this.handleTracksChange.apply(this,e)};r.addEventListener("change",i),this.on("dispose",(()=>{r.removeEventListener("change",i)}))}createEl(e,t,n){const r=super.createEl(e,t,n),i=r.querySelector(".vjs-menu-item-text");return["main-desc","description"].indexOf(this.options_.track.kind)>=0&&(i.appendChild(an("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),i.appendChild(an("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const e=this.player_.audioTracks();for(let t=0;t<e.length;t++){const n=e[t];n!==this.track&&(n.enabled=n===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}wr.registerComponent("AudioTrackMenuItem",ba);class Ea extends oa{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t),this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(e=[]){this.hideThreshold_=1;const t=this.player_.audioTracks();for(let n=0;n<t.length;n++){const r=t[n];e.push(new ba(this.player_,{track:r,selectable:!0,multiSelectable:!1}))}return e}}Ea.prototype.controlText_="Audio Track",wr.registerComponent("AudioTrackButton",Ea);class Sa extends la{constructor(e,t){const n=t.rate,r=parseFloat(n,10);t.label=n,t.selected=r===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=n,this.rate=r,this.on(e,"ratechange",(e=>this.update(e)))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}Sa.prototype.contentElType="button",wr.registerComponent("PlaybackRateMenuItem",Sa);class wa extends sa{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",(e=>this.updateVisibility(e))),this.on(e,"ratechange",(e=>this.updateLabel(e))),this.on(e,"playbackrateschange",(e=>this.handlePlaybackRateschange(e)))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=an("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let n=e.length-1;n>=0;n--)t.push(new Sa(this.player(),{rate:e[n]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}wa.prototype.controlText_="Playback Rate",wr.registerComponent("PlaybackRateMenuButton",wa);class Aa extends wr{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},n={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,n)}}wr.registerComponent("Spacer",Aa),wr.registerComponent("CustomControlSpacer",class extends Aa{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}});class Ia extends wr{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Ia.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]},wr.registerComponent("ControlBar",Ia);class Ca extends jr{constructor(e,t){super(e,t),this.on(e,"error",(e=>{this.close(),this.open(e)}))}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}Ca.prototype.options_=Object.assign({},jr.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),wr.registerComponent("ErrorDisplay",Ca);const Ra="vjs-text-track-settings",Da=["#000","Black"],xa=["#00F","Blue"],Na=["#0FF","Cyan"],Oa=["#0F0","Green"],Pa=["#F0F","Magenta"],Ma=["#F00","Red"],ka=["#FFF","White"],La=["#FF0","Yellow"],Fa=["1","Opaque"],Ua=["0.5","Semi-Transparent"],Ba=["0","Transparent"],ja={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Da,ka,Ma,Oa,xa,La,Pa,Na]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Fa,Ua,Ba]},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[ka,Da,Ma,Oa,xa,La,Pa,Na]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:e=>"1.00"===e?null:Number(e)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[Fa,Ua]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[Ba,Ua,Fa]}};function qa(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}ja.windowColor.options=ja.backgroundColor.options,wr.registerComponent("TextTrackSettings",class extends jr{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.endDialog=an("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),void 0===t.persistTextTrackSettings&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.on(this.$(".vjs-done-button"),"click",(()=>{this.saveSettings(),this.close()})),this.on(this.$(".vjs-default-button"),"click",(()=>{this.setDefaults(),this.updateDisplay()})),At(ja,(e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})),this.options_.persistTextTrackSettings&&this.restoreSettings()}dispose(){this.endDialog=null,super.dispose()}createElSelect_(e,t="",n="label"){const r=ja[e],i=r.id.replace("%s",this.id_),a=[t,i].join(" ").trim();return[`<${n} id="${i}" class="${"label"===n?"vjs-label":""}">`,this.localize(r.label),`</${n}>`,`<select aria-labelledby="${a}">`].concat(r.options.map((e=>{const t=i+"-"+e[1].replace(/\W+/g,"");return[`<option id="${t}" value="${e[0]}" `,`aria-labelledby="${a} ${t}">`,this.localize(e[1]),"</option>"].join("")}))).concat("</select>").join("")}createElFgColor_(){const e=`captions-text-legend-${this.id_}`;return['<fieldset class="vjs-fg vjs-track-setting">',`<legend id="${e}">`,this.localize("Text"),"</legend>",'<span class="vjs-text-color">',this.createElSelect_("color",e),"</span>",'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")}createElBgColor_(){const e=`captions-background-${this.id_}`;return['<fieldset class="vjs-bg vjs-track-setting">',`<legend id="${e}">`,this.localize("Text Background"),"</legend>",'<span class="vjs-bg-color">',this.createElSelect_("backgroundColor",e),"</span>",'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")}createElWinColor_(){const e=`captions-window-${this.id_}`;return['<fieldset class="vjs-window vjs-track-setting">',`<legend id="${e}">`,this.localize("Caption Area Background"),"</legend>",'<span class="vjs-window-color">',this.createElSelect_("windowColor",e),"</span>",'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")}createElColors_(){return an("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})}createElFont_(){return an("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})}createElControls_(){const e=this.localize("restore all settings to the default values");return an("div",{className:"vjs-track-settings-controls",innerHTML:[`<button type="button" class="vjs-default-button" title="${e}">`,this.localize("Reset"),`<span class="vjs-control-text"> ${e}</span>`,"</button>",`<button type="button" class="vjs-done-button">${this.localize("Done")}</button>`].join("")})}content(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return It(ja,((e,t,n)=>{const r=(i=this.$(t.selector),a=t.parser,qa(i.options[i.options.selectedIndex].value,a));var i,a;return void 0!==r&&(e[n]=r),e}),{})}setValues(e){At(ja,((t,n)=>{!function(e,t,n){if(t)for(let r=0;r<e.options.length;r++)if(qa(e.options[r].value,n)===t){e.selectedIndex=r;break}}(this.$(t.selector),e[n],t.parser)}))}setDefaults(){At(ja,(e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t}))}restoreSettings(){let e;try{e=JSON.parse(i().localStorage.getItem(Ra))}catch(e){bt.warn(e)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?i().localStorage.setItem(Ra,JSON.stringify(e)):i().localStorage.removeItem(Ra)}catch(e){bt.warn(e)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}conditionalBlur_(){this.previouslyActiveEl_=null;const e=this.player_.controlBar,t=e&&e.subsCapsButton,n=e&&e.captionsButton;t?t.focus():n&&n.focus()}handleLanguagechange(){this.fill()}}),wr.registerComponent("ResizeManager",class extends wr{constructor(e,t){let n=t.ResizeObserver||i().ResizeObserver;null===t.ResizeObserver&&(n=!1),super(e,Dt({createEl:!n,reportTouchActivity:!1},t)),this.ResizeObserver=t.ResizeObserver||i().ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=ir((()=>{this.resizeHandler()}),100,!1,this),n?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const e=this.debouncedHandler_;let t=this.unloadListener_=function(){Xn(this,"resize",e),Xn(this,"unload",t),t=null};Wn(this.el_.contentWindow,"unload",t),Wn(this.el_.contentWindow,"resize",e)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}});const Ha={trackingThreshold:20,liveTolerance:15};wr.registerComponent("LiveTracker",class extends wr{constructor(e,t){super(e,Dt(Ha,t,{createEl:!1})),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=e=>this.handlePlay(e),this.handleFirstTimeupdate_=e=>this.handleFirstTimeupdate(e),this.handleSeeked_=e=>this.handleSeeked(e),this.seekToLiveEdge_=e=>this.seekToLiveEdge(e),this.reset_(),this.on(this.player_,"durationchange",(e=>this.handleDurationchange(e))),this.on(this.player_,"canplay",(()=>this.toggleTracking()))}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(i().performance.now().toFixed(4)),n=-1===this.lastTime_?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+n;const r=this.liveCurrentTime(),a=this.player_.currentTime();let s=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-a)>this.options_.liveTolerance;this.timeupdateSeen_&&r!==1/0||(s=!1),s!==this.behindLiveEdge_&&(this.behindLiveEdge_=s,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,tr),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let n=e?e.length:0;for(;n--;)t.push(e.end(n));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let n=e?e.length:0;for(;n--;)t.push(e.start(n));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return"number"==typeof this.trackingInterval_}seekToLiveEdge(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}),wr.registerComponent("TitleBar",class extends wr{constructor(e,t){super(e,t),this.on("statechanged",(e=>this.updateDom_())),this.updateDom_()}createEl(){return this.els={title:an("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${Gn()}`}),description:an("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${Gn()}`})},an("div",{className:"vjs-title-bar"},{},xt(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,n={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach((e=>{const r=this.state[e],i=this.els[e],a=n[e];Sn(i),r&&sn(i,r),t&&(t.removeAttribute(a),r&&t.setAttribute(a,i.id))})),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}});const Ga=e=>{const t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;const n=e.$$("source"),r=[];let i="";if(!n.length)return!1;for(let e=0;e<n.length;e++){const t=n[e].src;t&&-1===r.indexOf(t)&&r.push(t)}return!!r.length&&(1===r.length&&(i=r[0]),e.triggerSourceset(i),!0)},Va=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(e){const t=s().createElement(this.nodeName.toLowerCase());t.innerHTML=e;const n=s().createDocumentFragment();for(;t.childNodes.length;)n.appendChild(t.childNodes[0]);return this.innerText="",i().Element.prototype.appendChild.call(this,n),this.innerHTML}}),Ya=(e,t)=>{let n={};for(let r=0;r<e.length&&(n=Object.getOwnPropertyDescriptor(e[r],t),!(n&&n.set&&n.get));r++);return n.enumerable=!0,n.configurable=!0,n},za=function(e){const t=e.el();if(t.resetSourceWatch_)return;const n={},r=(e=>Ya([e.el(),i().HTMLMediaElement.prototype,i().Element.prototype,Va],"innerHTML"))(e),a=n=>(...r)=>{const i=n.apply(t,r);return Ga(e),i};["append","appendChild","insertAdjacentHTML"].forEach((e=>{t[e]&&(n[e]=t[e],t[e]=a(n[e]))})),Object.defineProperty(t,"innerHTML",Dt(r,{set:a(r.set)})),t.resetSourceWatch_=()=>{t.resetSourceWatch_=null,Object.keys(n).forEach((e=>{t[e]=n[e]})),Object.defineProperty(t,"innerHTML",r)},e.one("sourceset",t.resetSourceWatch_)},Za=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?Qr(i().Element.prototype.getAttribute.call(this,"src")):""},set(e){return i().Element.prototype.setAttribute.call(this,"src",e),e}});class Ka extends di{constructor(e,t){super(e,t);const n=e.source;let r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&"VIDEO"===this.el_.tagName,n&&(this.el_.currentSrc!==n.src||e.tag&&3===e.tag.initNetworkState_)?this.setSource(n):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const e=this.el_.childNodes;let t=e.length;const n=[];for(;t--;){const i=e[t];"track"===i.nodeName.toLowerCase()&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),this.textTracks().addTrack(i.track),r||this.el_.hasAttribute("crossorigin")||!ei(i.src)||(r=!0)):n.push(i))}for(let e=0;e<n.length;e++)this.el_.removeChild(n[e])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&r&&bt.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),this.restoreMetadataTracksInIOSNativePlayer_(),(Kt||Zt)&&!0===e.nativeControlsForTouch&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),Ka.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){!function(e){if(!e.featuresSourceset)return;const t=e.el();if(t.resetSourceset_)return;const n=(e=>Ya([e.el(),i().HTMLMediaElement.prototype,Za],"src"))(e),r=t.setAttribute,a=t.load;Object.defineProperty(t,"src",Dt(n,{set:r=>{const i=n.set.call(t,r);return e.triggerSourceset(t.src),i}})),t.setAttribute=(n,i)=>{const a=r.call(t,n,i);return/src/i.test(n)&&e.triggerSourceset(t.src),a},t.load=()=>{const n=a.call(t);return Ga(e)||(e.triggerSourceset(""),za(e)),n},t.currentSrc?e.triggerSourceset(t.currentSrc):Ga(e)||za(e),t.resetSourceset_=()=>{t.resetSourceset_=null,t.load=a,t.setAttribute=r,Object.defineProperty(t,"src",n),t.resetSourceWatch_&&t.resetSourceWatch_()}}(this)}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const n=()=>{t=[];for(let n=0;n<e.length;n++){const r=e[n];"metadata"===r.kind&&t.push({track:r,storedMode:r.mode})}};n(),e.addEventListener("change",n),this.on("dispose",(()=>e.removeEventListener("change",n)));const r=()=>{for(let e=0;e<t.length;e++){const n=t[e];"disabled"===n.track.mode&&n.track.mode!==n.storedMode&&(n.track.mode=n.storedMode)}e.removeEventListener("change",r)};this.on("webkitbeginfullscreen",(()=>{e.removeEventListener("change",n),e.removeEventListener("change",r),e.addEventListener("change",r)})),this.on("webkitendfullscreen",(()=>{e.removeEventListener("change",n),e.addEventListener("change",n),e.removeEventListener("change",r)}))}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const n=e.toLowerCase();this[`${n}TracksListeners_`]&&Object.keys(this[`${n}TracksListeners_`]).forEach((e=>{this.el()[`${n}Tracks`].removeEventListener(e,this[`${n}TracksListeners_`][e])})),this[`featuresNative${e}Tracks`]=!t,this[`${n}TracksListeners_`]=null,this.proxyNativeTracksForType_(n)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=ui[e],n=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!n||!n.addEventListener)return;const i={change:t=>{const n={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(n),"text"===e&&this[li.remoteText.getterName]().trigger(n)},addtrack(e){r.addTrack(e.track)},removetrack(e){r.removeTrack(e.track)}},a=function(){const e=[];for(let t=0;t<r.length;t++){let i=!1;for(let e=0;e<n.length;e++)if(n[e]===r[t]){i=!0;break}i||e.push(r[t])}for(;e.length;)r.removeTrack(e.shift())};this[t.getterName+"Listeners_"]=i,Object.keys(i).forEach((e=>{const t=i[e];n.addEventListener(e,t),this.on("dispose",(r=>n.removeEventListener(e,t)))})),this.on("loadstart",a),this.on("dispose",(e=>this.off("loadstart",a)))}proxyNativeTracks_(){ui.names.forEach((e=>{this.proxyNativeTracksForType_(e)}))}createEl(){let e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){const t=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(t,e),Ka.disposeMediaElement(e),e=t}else{e=s().createElement("video");const t=Dt({},this.options_.tag&&hn(this.options_.tag));Kt&&!0===this.options_.nativeControlsForTouch||delete t.controls,fn(e,Object.assign(t,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}void 0!==this.options_.preload&&gn(e,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let n=0;n<t.length;n++){const r=t[n],i=this.options_[r];void 0!==i&&(i?gn(e,r,r):mn(e,r),e[r]=i)}return e}handleLateInit_(e){if(0===e.networkState||3===e.networkState)return;if(0===e.readyState){let e=!1;const t=function(){e=!0};this.on("loadstart",t);const n=function(){e||this.trigger("loadstart")};return this.on("loadedmetadata",n),void this.ready((function(){this.off("loadstart",t),this.off("loadedmetadata",n),e||this.trigger("loadstart")}))}const t=["loadstart"];t.push("loadedmetadata"),e.readyState>=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready((function(){t.forEach((function(e){this.trigger(e)}),this)}))}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&$t?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){bt(e,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&Lt&&jt&&0===this.el_.currentTime){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",(()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)}))}supportsFullScreen(){return"function"==typeof this.el_.webkitEnterFullScreen}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)Fr(this.el_.play()),this.setTimeout((function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}),0);else try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}exitFullScreen(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(void 0===e)return this.el_.src;this.setSrc(e)}reset(){Ka.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,n):super.addTextTrack(e,t,n)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=s().createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const n=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(n),n}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let n=t.length;for(;n--;)e!==t[n]&&e!==t[n].track||this.el().removeChild(t[n])}}getVideoPlaybackQuality(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();const e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),i().performance&&(e.creationTime=i().performance.now()),e}}Nt(Ka,"TEST_VID",(function(){if(!en())return;const e=s().createElement("video"),t=s().createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e})),Ka.isSupported=function(){try{Ka.TEST_VID.volume=.5}catch(e){return!1}return!(!Ka.TEST_VID||!Ka.TEST_VID.canPlayType)},Ka.canPlayType=function(e){return Ka.TEST_VID.canPlayType(e)},Ka.canPlaySource=function(e,t){return Ka.canPlayType(e.type)},Ka.canControlVolume=function(){try{const e=Ka.TEST_VID.volume;Ka.TEST_VID.volume=e/2+.1;const t=e!==Ka.TEST_VID.volume;return t&&Xt?(i().setTimeout((()=>{Ka&&Ka.prototype&&(Ka.prototype.featuresVolumeControl=e!==Ka.TEST_VID.volume)})),!1):t}catch(e){return!1}},Ka.canMuteVolume=function(){try{const e=Ka.TEST_VID.muted;return Ka.TEST_VID.muted=!e,Ka.TEST_VID.muted?gn(Ka.TEST_VID,"muted","muted"):mn(Ka.TEST_VID,"muted"),e!==Ka.TEST_VID.muted}catch(e){return!1}},Ka.canControlPlaybackRate=function(){if(Lt&&jt&&Ht<58)return!1;try{const e=Ka.TEST_VID.playbackRate;return Ka.TEST_VID.playbackRate=e/2+.1,e!==Ka.TEST_VID.playbackRate}catch(e){return!1}},Ka.canOverrideAttributes=function(){try{const e=()=>{};Object.defineProperty(s().createElement("video"),"src",{get:e,set:e}),Object.defineProperty(s().createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(s().createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(s().createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},Ka.supportsNativeTextTracks=function(){return $t||Xt&&jt},Ka.supportsNativeVideoTracks=function(){return!(!Ka.TEST_VID||!Ka.TEST_VID.videoTracks)},Ka.supportsNativeAudioTracks=function(){return!(!Ka.TEST_VID||!Ka.TEST_VID.audioTracks)},Ka.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach((function([e,t]){Nt(Ka.prototype,e,(()=>Ka[t]()),!0)})),Ka.prototype.featuresVolumeControl=Ka.canControlVolume(),Ka.prototype.movingMediaElementInDOM=!Xt,Ka.prototype.featuresFullscreenResize=!0,Ka.prototype.featuresProgressEvents=!0,Ka.prototype.featuresTimeupdateEvents=!0,Ka.prototype.featuresVideoFrameCallback=!(!Ka.TEST_VID||!Ka.TEST_VID.requestVideoFrameCallback),Ka.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},Ka.resetMediaElement=function(e){if(!e)return;const t=e.querySelectorAll("source");let n=t.length;for(;n--;)e.removeChild(t[n]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(e){Ka.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){Ka.prototype["set"+br(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}})),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach((function(e){Ka.prototype[e]=function(){return this.el_[e]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach((function(e){Ka.prototype["set"+br(e)]=function(t){this.el_[e]=t}})),["pause","load","play"].forEach((function(e){Ka.prototype[e]=function(){return this.el_[e]()}})),di.withSourceHandlers(Ka),Ka.nativeSourceHandler={},Ka.nativeSourceHandler.canPlayType=function(e){try{return Ka.TEST_VID.canPlayType(e)}catch(e){return""}},Ka.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return Ka.nativeSourceHandler.canPlayType(e.type);if(e.src){const t=Jr(e.src);return Ka.nativeSourceHandler.canPlayType(`video/${t}`)}return""},Ka.nativeSourceHandler.handleSource=function(e,t,n){t.setSrc(e.src)},Ka.nativeSourceHandler.dispose=function(){},Ka.registerSourceHandler(Ka.nativeSourceHandler),di.registerTech("Html5",Ka);const Wa=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Xa={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},$a=["tiny","xsmall","small","medium","large","xlarge","huge"],Qa={};$a.forEach((e=>{const t="x"===e.charAt(0)?`x-${e.substring(1)}`:e;Qa[e]=`vjs-layout-${t}`}));const Ja={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class es extends wr{constructor(e,t,n){if(e.id=e.id||t.id||`vjs_video_${Gn()}`,(t=Object.assign(es.getTagSettings(e),t)).initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const n=e.closest("[lang]");n&&(t.language=n.getAttribute("lang"))}if(super(null,t,n),this.boundDocumentFullscreenChange_=e=>this.documentFullscreenChange_(e),this.boundFullWindowOnEscKey_=e=>this.fullWindowOnEscKey(e),this.boundUpdateStyleEl_=e=>this.updateStyleEl_(e),this.boundApplyInitTime_=e=>this.applyInitTime_(e),this.boundUpdateCurrentBreakpoint_=e=>this.updateCurrentBreakpoint_(e),this.boundHandleTechClick_=e=>this.handleTechClick_(e),this.boundHandleTechDoubleClick_=e=>this.handleTechDoubleClick_(e),this.boundHandleTechTouchStart_=e=>this.handleTechTouchStart_(e),this.boundHandleTechTouchMove_=e=>this.handleTechTouchMove_(e),this.boundHandleTechTouchEnd_=e=>this.handleTechTouchEnd_(e),this.boundHandleTechTap_=e=>this.handleTechTap_(e),this.isFullscreen_=!1,this.log=Et(this.id_),this.fsApi_=mt,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&hn(e),this.language(this.options_.language),t.languages){const e={};Object.getOwnPropertyNames(t.languages).forEach((function(n){e[n.toLowerCase()]=t.languages[n]})),this.languages_=e}else this.languages_=es.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach((e=>{if("function"!=typeof this[e])throw new Error(`plugin "${e}" does not exist`)})),this.scrubbing_=!1,this.el_=this.createEl(),yr(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(Wn(s(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=Dt(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach((e=>{this[e](t.plugins[e])})),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const e=(new(i().DOMParser)).parseFromString('<svg xmlns="http://www.w3.org/2000/svg">\n <defs>\n <symbol viewBox="0 0 48 48" id="vjs-icon-play">\n <path d="M16 10v28l22-14z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-pause">\n <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-audio">\n <path d="M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-captions">\n <path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">\n <path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">\n <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">\n <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">\n <path d="M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">\n <path d="M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">\n <path d="M14 18v12h8l10 10V8L22 18h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">\n <path d="M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">\n <path d="M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-spinner">\n <path d="M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"></path>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-hd">\n <path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-chapters">\n <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>\n </symbol>\n <symbol viewBox="0 0 40 40" id="vjs-icon-downloading">\n <path d="M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download">\n <path d="M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">\n <path d="M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">\n <path d="M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-share">\n <path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cog">\n <path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-square">\n <path d="M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle">\n <circle cx="24" cy="24" r="20"></circle>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">\n <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">\n <path d="M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cancel">\n <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-replay">\n <path d="M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-7.16 16-16-7.16-16-16-16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-repeat">\n <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">\n <path d="M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">\n <path d="M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">\n <path d="M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">\n <path d="M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">\n <path d="M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">\n <path d="M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"></path>\n </symbol>\n <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">\n <g fill-rule="evenodd"><path d="M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"></path><path d="M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"></path></g>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-next-item">\n <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">\n <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">\n <path d="M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cast">\n <path d="M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">\n <path d="M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"></path>\n </symbol>\n <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">\n <path d="M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"></path>\n <path fill="none" d="M-1-3h24v24H-1z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">\n <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">\n <path d="M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-twitter">\n <path d="M1684 408q-67 98-162 167 1 14 1 42 0 130-38 259.5T1369.5 1125 1185 1335.5t-258 146-323 54.5q-271 0-496-145 35 4 78 4 225 0 401-138-105-2-188-64.5T285 1033q33 5 61 5 43 0 85-11-112-23-185.5-111.5T172 710v-4q68 38 146 41-66-44-105-115t-39-154q0-88 44-163 121 149 294.5 238.5T884 653q-8-38-8-74 0-134 94.5-228.5T1199 256q140 0 236 102 109-21 205-78-37 115-142 178 93-10 186-50z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">\n <path d="M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">\n <path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path>\n </symbol>\n </defs>\n</svg>',"image/svg+xml");if(e.querySelector("parsererror"))bt.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const t=e.documentElement;t.style.display="none",this.el_.appendChild(t),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio("audio"===e.nodeName.toLowerCase()),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),Kt&&this.addClass("vjs-touch-enabled"),Xt||this.addClass("vjs-workinghover"),es.players[this.id_]=this;const a=ft.split(".")[0];this.addClass(`vjs-v${a}`),this.userActive(!0),this.reportUserActivity(),this.one("play",(e=>this.listenForUserActivity_(e))),this.on("keydown",(e=>this.handleKeyDown(e))),this.on("languagechange",(e=>this.handleLanguagechange(e))),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",(()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)}))}dispose(){this.trigger("dispose"),this.off("dispose"),Xn(s(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Xn(s(),"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),es.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),hi[this.id()]=null,ci.names.forEach((e=>{const t=this[ci[e].getterName]();t&&t.off&&t.off()})),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e,t=this.tag,n=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player");const r="video-js"===this.tag.tagName.toLowerCase();n?e=this.el_=t.parentNode:r||(e=this.el_=super.createEl("div"));const a=hn(t);if(r){for(e=this.el_=t,t=this.tag=s().createElement("video");e.children.length;)t.appendChild(e.firstChild);un(e,"video-js")||ln(e,"video-js"),e.appendChild(t),n=this.playerElIngest_=e,Object.keys(e).forEach((n=>{try{t[n]=e[n]}catch(e){}}))}if(t.setAttribute("tabindex","-1"),a.tabindex="-1",jt&&Yt&&(t.setAttribute("role","application"),a.role="application"),t.removeAttribute("width"),t.removeAttribute("height"),"width"in a&&delete a.width,"height"in a&&delete a.height,Object.getOwnPropertyNames(a).forEach((function(n){r&&"class"===n||e.setAttribute(n,a[n]),r&&t.setAttribute(n,a[n])})),t.playerId=t.id,t.id+="_html5_api",t.className="vjs-tech",t.player=e.player=this,this.addClass("vjs-paused"),!0!==i().VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=Un("vjs-styles-dimensions");const e=Rn(".vjs-styles-defaults"),t=Rn("head");t.insertBefore(this.styleEl_,e?e.nextSibling:t.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const o=t.getElementsByTagName("a");for(let e=0;e<o.length;e++){const t=o.item(e);ln(t,"vjs-hidden"),t.setAttribute("hidden","hidden")}return t.initNetworkState_=t.networkState,t.parentNode&&!n&&t.parentNode.insertBefore(e,t),on(t,e),this.children_.unshift(t),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=e,e}crossOrigin(e){if(void 0===e)return this.techGet_("crossOrigin");null===e||"anonymous"===e||"use-credentials"===e?(this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)):bt.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const n=e+"_";if(void 0===t)return this[n]||0;if(""===t||"auto"===t)return this[n]=void 0,void this.updateStyleEl_();const r=parseFloat(t);isNaN(r)?bt.error(`Improper value "${t}" supplied for for ${e}`):(this[n]=r,this.updateStyleEl_())}fluid(e){if(void 0===e)return!!this.fluid_;var t,n;this.fluid_=!!e,lr(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),n=()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)},lr(t=this)?n():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(n))):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(!0===i().VIDEOJS_NO_DYNAMIC_STYLE){const e="number"==typeof this.width_?this.width_:this.options_.width,t="number"==typeof this.height_?this.height_:this.options_.height,n=this.tech_&&this.tech_.el();return void(n&&(e>=0&&(n.width=e),t>=0&&(n.height=t)))}let e,t,n,r;n=void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9";const a=n.split(":"),s=a[1]/a[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/s:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*s,r=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(r),Bn(this.styleEl_,`\n .${r} {\n width: ${e}px;\n height: ${t}px;\n }\n\n .${r}.vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: ${100*s}%;\n }\n `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const n=br(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==n&&this.tag&&(di.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;let i=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(i=!1);const a={source:t,autoplay:i,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};ci.names.forEach((e=>{const t=ci[e];a[t.getterName]=this[t.privateName]})),Object.assign(a,this.options_[n]),Object.assign(a,this.options_[r]),Object.assign(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);const s=di.getTech(e);if(!s)throw new Error(`No Tech named '${n}' exists! '${n}' should be registered using videojs.registerTech()'`);var o,u;this.tech_=new s(a),this.tech_.ready(nr(this,this.handleTechReady_),!0),o=this.textTracksJson_||[],u=this.tech_,o.forEach((function(e){const t=u.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach((e=>t.addCue(e)))})),u.textTracks(),Wa.forEach((e=>{this.on(this.tech_,e,(t=>this[`handleTech${br(e)}_`](t)))})),Object.keys(Xa).forEach((e=>{this.on(this.tech_,e,(t=>{0===this.tech_.playbackRate()&&this.tech_.seeking()?this.queuedCallbacks_.push({callback:this[`handleTech${Xa[e]}_`].bind(this),event:t}):this[`handleTech${Xa[e]}_`](t)}))})),this.on(this.tech_,"loadstart",(e=>this.handleTechLoadStart_(e))),this.on(this.tech_,"sourceset",(e=>this.handleTechSourceset_(e))),this.on(this.tech_,"waiting",(e=>this.handleTechWaiting_(e))),this.on(this.tech_,"ended",(e=>this.handleTechEnded_(e))),this.on(this.tech_,"seeking",(e=>this.handleTechSeeking_(e))),this.on(this.tech_,"play",(e=>this.handleTechPlay_(e))),this.on(this.tech_,"pause",(e=>this.handleTechPause_(e))),this.on(this.tech_,"durationchange",(e=>this.handleTechDurationChange_(e))),this.on(this.tech_,"fullscreenchange",((e,t)=>this.handleTechFullscreenChange_(e,t))),this.on(this.tech_,"fullscreenerror",((e,t)=>this.handleTechFullscreenError_(e,t))),this.on(this.tech_,"enterpictureinpicture",(e=>this.handleTechEnterPictureInPicture_(e))),this.on(this.tech_,"leavepictureinpicture",(e=>this.handleTechLeavePictureInPicture_(e))),this.on(this.tech_,"error",(e=>this.handleTechError_(e))),this.on(this.tech_,"posterchange",(e=>this.handleTechPosterChange_(e))),this.on(this.tech_,"textdata",(e=>this.handleTechTextData_(e))),this.on(this.tech_,"ratechange",(e=>this.handleTechRateChange_(e))),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===n&&this.tag||on(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){ci.names.forEach((e=>{const t=ci[e];this[t.privateName]=this[t.getterName]()})),this.textTracksJson_=function(e){const t=e.$$("track"),n=Array.prototype.map.call(t,(e=>e.track));return Array.prototype.map.call(t,(function(e){const t=Ur(e.track);return e.src&&(t.src=e.src),t})).concat(Array.prototype.filter.call(e.textTracks(),(function(e){return-1===n.indexOf(e)})).map(Ur))}(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return void 0===e&&bt.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||"string"!=typeof e)return;const t=()=>{const e=this.muted();this.muted(!0);const t=()=>{this.muted(e)};this.playTerminatedQueue_.push(t);const n=this.play();if(Lr(n))return n.catch((e=>{throw t(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${e||""}`)}))};let n;return"any"!==e||this.muted()?n="muted"!==e||this.muted()?this.play():t():(n=this.play(),Lr(n)&&(n=n.catch(t))),Lr(n)?n.then((()=>{this.trigger({type:"autoplay-success",autoplay:e})})).catch((()=>{this.trigger({type:"autoplay-failure",autoplay:e})})):void 0}updateSourceCaches_(e=""){let t=e,n="";"string"!=typeof t&&(t=e.src,n=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!n&&(n=((e,t)=>{if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;const n=e.cache_.sources.filter((e=>e.src===t));if(n.length)return n[0].type;const r=e.$$("source");for(let e=0;e<r.length;e++){const n=r[e];if(n.type&&n.src&&n.src===t)return n.type}return Si(t)})(this,t)),this.cache_.source=Dt({},e,{src:t,type:n});const r=this.cache_.sources.filter((e=>e.src&&e.src===t)),i=[],a=this.$$("source"),s=[];for(let e=0;e<a.length;e++){const n=hn(a[e]);i.push(n),n.src&&n.src===t&&s.push(n.src)}s.length&&!r.length?this.cache_.sources=i:r.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=e=>this.updateSourceCaches_(e);const n=this.currentSource().src,r=e.src;n&&!/^blob:/.test(n)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==n)&&(t=()=>{}),t(r),e.src||this.tech_.any(["sourceset","loadstart"],(e=>{if("sourceset"===e.type)return;const t=this.techGet_("currentSrc");this.lastSource_.tech=t,this.updateSourceCaches_(t)}))}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach((e=>e.callback(e.event))),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.click&&!1===this.options_.userActions.click||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?Fr(this.play()):this.pause()))}handleTechDoubleClick_(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),(t=>t.contains(e.target)))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const n=this.el();let r=s()[this.fsApi_.fullscreenElement]===n;!r&&n.matches&&(r=n.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",(()=>{this.removeClass("vjs-ios-native-fs")}))),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready((function(){if(e in vi)return function(e,t,n,r){return t[n](e.reduce(Ti(n),r))}(this.middleware_,this.tech_,e,t);if(e in _i)return mi(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw bt(e),e}}),!0)}techGet_(e){if(this.tech_&&this.tech_.isReady_){if(e in yi)return function(e,t,n){return e.reduceRight(Ti(n),t[n]())}(this.middleware_,this.tech_,e);if(e in _i)return mi(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw bt(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t;if("TypeError"===t.name)throw bt(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t;throw bt(t),t}}}play(){return new Promise((e=>{this.play_(e)}))}play_(e=Fr){this.playCallbacks_.push(e);const t=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc())),n=Boolean($t||Xt);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t)return this.waitToPlay_=e=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!t&&n&&this.load());const r=this.techGet_("play");n&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),null===r?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach((function(e){e()}))}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach((function(t){t(e)}))}pause(){this.techCall_("pause")}paused(){return!1!==this.techGet_("paused")}played(){return this.techGet_("played")||Cr(0,0)}scrubbing(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){return void 0===e?(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime):(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),this.cache_.initTime=0,void(isFinite(e)&&(this.cache_.currentTime=Number(e)))):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_)))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return e&&e.length||(e=Cr(0,0)),e}seekable(){let e=this.techGet_("seekable");return e&&e.length||(e=Cr(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return Mr(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let n=e.end(e.length-1);return n>t&&(n=t),n}volume(e){let t;return void 0!==e?(t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)}muted(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)}defaultMuted(e){return void 0!==e&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(void 0!==e){const t=this.isFullscreen_;return this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise(((n,r)=>{function i(){t.off("fullscreenerror",s),t.off("fullscreenchange",a)}function a(){i(),n()}function s(e,t){i(),r(t)}t.one("fullscreenchange",a),t.one("fullscreenerror",s);const o=t.requestFullscreenHelper_(e);o&&(o.then(i,i),o.then(n,r))}))}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen){const e=this.el_[this.fsApi_.requestFullscreen](t);return e&&e.then((()=>this.isFullscreen(!0)),(()=>this.isFullscreen(!1))),e}this.tech_.supportsFullScreen()&&1==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise(((t,n)=>{function r(){e.off("fullscreenerror",a),e.off("fullscreenchange",i)}function i(){r(),t()}function a(e,t){r(),n(t)}e.one("fullscreenchange",i),e.one("fullscreenerror",a);const s=e.exitFullscreenHelper_();s&&(s.then(r,r),s.then(t,n))}))}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=s()[this.fsApi_.exitFullscreen]();return e&&Fr(e.then((()=>this.isFullscreen(!1)))),e}this.tech_.supportsFullScreen()&&1==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=s().documentElement.style.overflow,Wn(s(),"keydown",this.boundFullWindowOnEscKey_),s().documentElement.style.overflow="hidden",ln(s().body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){u().isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,Xn(s(),"keydown",this.boundFullWindowOnEscKey_),s().documentElement.style.overflow=this.docOrigOverflow,cn(s().body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&i().documentPictureInPicture){const e=s().createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(an("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),i().documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then((t=>(Nn(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger("enterpictureinpicture"),t.addEventListener("pagehide",(t=>{const n=t.target.querySelector(".video-js");e.parentNode.replaceChild(n,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")})),t)))}return"pictureInPictureEnabled"in s()&&!1===this.disablePictureInPicture()?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){return i().documentPictureInPicture&&i().documentPictureInPicture.window?(i().documentPictureInPicture.window.close(),Promise.resolve()):"pictureInPictureEnabled"in s()?s().exitPictureInPicture():void 0}handleKeyDown(e){const{userActions:t}=this.options_;t&&t.hotkeys&&((e=>{const t=e.tagName.toLowerCase();return!!e.isContentEditable||("input"===t?-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type):-1!==["textarea"].indexOf(t))})(this.el_.ownerDocument.activeElement)||("function"==typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e)))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:n=(e=>u().isEventKey(e,"f")),muteKey:r=(e=>u().isEventKey(e,"m")),playPauseKey:i=(e=>u().isEventKey(e,"k")||u().isEventKey(e,"Space"))}=t;if(n.call(this,e)){e.preventDefault(),e.stopPropagation();const t=wr.getComponent("FullscreenToggle");!1!==s()[this.fsApi_.fullscreenEnabled]&&t.prototype.handleClick.call(this,e)}else r.call(this,e)?(e.preventDefault(),e.stopPropagation(),wr.getComponent("MuteToggle").prototype.handleClick.call(this,e)):i.call(this,e)&&(e.preventDefault(),e.stopPropagation(),wr.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let n=0,r=this.options_.techOrder;n<r.length;n++){const i=r[n];let a=di.getTech(i);if(a||(a=wr.getComponent(i)),a){if(a.isSupported()&&(t=a.canPlayType(e),t))return t}else bt.error(`The "${i}" tech is undefined. Skipped browser support check for that tech.`)}return""}selectSource(e){const t=this.options_.techOrder.map((e=>[e,di.getTech(e)])).filter((([e,t])=>t?t.isSupported():(bt.error(`The "${e}" tech is undefined. Skipped browser support check for that tech.`),!1))),n=function(e,t,n){let r;return e.some((e=>t.some((t=>{if(r=n(e,t),r)return!0})))),r};let r;const i=([e,t],n)=>{if(t.canPlaySource(n,this.options_[e.toLowerCase()]))return{source:n,tech:e}};var a;return r=this.options_.sourceOrder?n(e,t,(a=i,(e,t)=>a(t,e))):n(t,e,i),r||!1}handleSrc_(e,t){if(void 0===e)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const n=wi(e);if(n.length){if(this.changingSrc_=!0,t||(this.cache_.sources=n),this.updateSourceCaches_(n[0]),gi(this,n[0],((e,r)=>{if(this.middleware_=r,t||(this.cache_.sources=n),this.updateSourceCaches_(e),this.src_(e))return n.length>1?this.handleSrc_(n.slice(1)):(this.changingSrc_=!1,this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0),void this.triggerReady());var i,a;i=r,a=this.tech_,i.forEach((e=>e.setTech&&e.setTech(a)))})),n.length>1){const e=()=>{this.error(null),this.handleSrc_(n.slice(1),!0)},t=()=>{this.off("error",e)};this.one("error",e),this.one("playing",t),this.resetRetryOnError_=()=>{this.off("error",e),this.off("playing",t)}}}else this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0)}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return!t||(Er(t.tech,this.techName_)?(this.ready((function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1}),!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready((()=>{this.changingSrc_=!1})),!1))}load(){this.tech_&&this.tech_.vhs?this.src(this.currentSource()):this.techCall_("load")}reset(){this.paused()?this.doReset_():Fr(this.play().then((()=>this.doReset_())))}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),lr(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:n,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:i}=n||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),i&&(i.update(),i.loadProgressBar&&i.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")}autoplay(e){if(void 0===e)return this.options_.autoplay||!1;let t;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return void 0!==e&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")}poster(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(void 0===e)return this.error_||null;if(pt("beforeerror").forEach((t=>{const n=t(this,e);Ct(n)&&!Array.isArray(n)||"string"==typeof n||"number"==typeof n||null===n?e=n:this.log.error("please return a value that MediaError expects in beforeerror hooks")})),this.options_.suppressNotSupportedError&&e&&4===e.code){const t=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),void this.one("loadstart",(function(){this.off(["click","touchstart"],t)}))}if(null===e)return this.error_=null,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new kr(e),this.addClass("vjs-error"),bt.error(`(CODE:${this.error_.code} ${kr.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),pt("error").forEach((e=>e(this,this.error_)))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",(function(e){e.stopPropagation(),e.preventDefault()})),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,n;const r=nr(this,this.reportUserActivity),i=function(t){r(),this.clearInterval(e)};this.on("mousedown",(function(){r(),this.clearInterval(e),e=this.setInterval(r,250)})),this.on("mousemove",(function(e){e.screenX===t&&e.screenY===n||(t=e.screenX,n=e.screenY,r())})),this.on("mouseup",i),this.on("mouseleave",i);const a=this.getChild("controlBar");let s;!a||Xt||Lt||(a.on("mouseenter",(function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0})),a.on("mouseleave",(function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout}))),this.on("keydown",r),this.on("keyup",r),this.setInterval((function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(s);const e=this.options_.inactivityTimeout;e<=0||(s=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),e))}),250)}playbackRate(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)}defaultPlaybackRate(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),n=t&&t.currentHeight();e.forEach((e=>{e!==t&&e.el_&&!e.hasClass("vjs-hidden")&&(e.hide(),this.audioOnlyCache_.hiddenChildren.push(e))})),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(n),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach((e=>e.show())),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if("boolean"!=typeof e||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const e=[];return this.isInPictureInPicture()&&e.push(this.exitPictureInPicture()),this.isFullscreen()&&e.push(this.exitFullscreen()),this.audioPosterMode()&&e.push(this.audioPosterMode(!1)),Promise.all(e).then((()=>this.enableAudioOnlyUI_()))}return Promise.resolve().then((()=>this.disableAudioOnlyUI_()))}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return"boolean"!=typeof e||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then((()=>{this.enablePosterModeUI_()})):Promise.resolve().then((()=>{this.enablePosterModeUI_()})):Promise.resolve().then((()=>{this.disablePosterModeUI_()})))}addTextTrack(e,t,n){if(this.tech_)return this.tech_.addTextTrack(e,t,n)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),lr(this)&&this.trigger("languagechange"))}languages(){return Dt(es.prototype.options_.languages,this.languages_)}toJSON(){const e=Dt(this.options_),t=e.tracks;e.tracks=[];for(let n=0;n<t.length;n++){let r=t[n];r=Dt(r),r.player=void 0,e.tracks[n]=r}return e}createModal(e,t){(t=t||{}).content=e||"";const n=new jr(this,t);return this.addChild(n),n.on("dispose",(()=>{this.removeChild(n)})),n.open(),n}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let n=0;n<$a.length;n++){const r=$a[n];if(t<=this.breakpoints_[r]){if(e===r)return;e&&this.removeClass(Qa[e]),this.addClass(Qa[r]),this.breakpoint_=r;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=Object.assign({},Ja,e),this.updateCurrentBreakpoint_()),Object.assign(this.breakpoints_)}responsive(e){return void 0===e?this.responsive_:(e=Boolean(e))!==this.responsive_?(this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return Qa[this.breakpoint_]||""}loadMedia(e,t){if(!e||"object"!=typeof e)return;const n=this.crossOrigin();this.reset(),this.cache_.media=Dt(e);const{artist:r,artwork:i,description:a,poster:s,src:o,textTracks:u,title:l}=this.cache_.media;!i&&s&&(this.cache_.media.artwork=[{src:s,type:Si(s)}]),n&&this.crossOrigin(n),o&&this.src(o),s&&this.poster(s),Array.isArray(u)&&u.forEach((e=>this.addRemoteTextTrack(e,!1))),this.titleBar&&this.titleBar.update({title:l,description:a||r||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),(e=>({kind:e.kind,label:e.label,language:e.language,src:e.src})))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:Si(t.poster)}]),t}return Dt(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},n=hn(e),r=n["data-setup"];if(un(e,"vjs-fill")&&(n.fill=!0),un(e,"vjs-fluid")&&(n.fluid=!0),null!==r){const[e,t]=c()(r||"{}");e&&bt.error(e),Object.assign(n,t)}if(Object.assign(t,n),e.hasChildNodes()){const n=e.childNodes;for(let e=0,r=n.length;e<r;e++){const r=n[e],i=r.nodeName.toLowerCase();"source"===i?t.sources.push(hn(r)):"track"===i&&t.tracks.push(hn(r))}}return t}debug(e){if(void 0===e)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(e){if(void 0===e)return this.cache_.playbackRates;Array.isArray(e)&&e.every((e=>"number"==typeof e))&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}ci.names.forEach((function(e){const t=ci[e];es.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}})),es.prototype.crossorigin=es.prototype.crossOrigin,es.players={};const ts=i().navigator;es.prototype.options_={techOrder:di.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:ts&&(ts.languages&&ts.languages[0]||ts.userLanguage||ts.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,enableSmoothSeeking:!1},Wa.forEach((function(e){es.prototype[`handleTech${br(e)}_`]=function(){return this.trigger(e)}})),wr.registerComponent("Player",es);const ns="plugin",rs="activePlugins_",is={},as=e=>is.hasOwnProperty(e),ss=e=>as(e)?is[e]:void 0,os=(e,t)=>{e[rs]=e[rs]||{},e[rs][t]=!0},us=(e,t,n)=>{const r=(n?"before":"")+"pluginsetup";e.trigger(r,t),e.trigger(r+":"+t.name,t)},ls=(e,t)=>(t.prototype.name=e,function(...n){us(this,{name:e,plugin:t,instance:null},!0);const r=new t(...[this,...n]);return this[e]=()=>r,us(this,r.getEventHash()),r});class cs{constructor(e){if(this.constructor===cs)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),yr(this),delete this.trigger,_r(this,this.constructor.defaultState),os(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return $n(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[rs][e]=!1,this.player=this.state=null,t[e]=ls(e,is[e])}static isBasic(e){const t="string"==typeof e?ss(e):e;return"function"==typeof t&&!cs.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if("string"!=typeof e)throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(as(e))bt.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(es.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if("function"!=typeof t)throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return is[e]=t,e!==ns&&(cs.isBasic(t)?es.prototype[e]=function(e,t){const n=function(){us(this,{name:e,plugin:t,instance:null},!0);const n=t.apply(this,arguments);return os(this,e),us(this,{name:e,plugin:t,instance:n}),n};return Object.keys(t).forEach((function(e){n[e]=t[e]})),n}(e,t):es.prototype[e]=ls(e,t)),t}static deregisterPlugin(e){if(e===ns)throw new Error("Cannot de-register base plugin.");as(e)&&(delete is[e],delete es.prototype[e])}static getPlugins(e=Object.keys(is)){let t;return e.forEach((e=>{const n=ss(e);n&&(t=t||{},t[e]=n)})),t}static getPluginVersion(e){const t=ss(e);return t&&t.VERSION||""}}function ds(e,t,n,r){return function(e,t){let n=!1;return function(...r){return n||bt.warn(e),n=!0,t.apply(this,r)}}(`${t} is deprecated and will be removed in ${e}.0; please use ${n} instead.`,r)}cs.getPlugin=ss,cs.BASE_PLUGIN_NAME=ns,cs.registerPlugin(ns,cs),es.prototype.usingPlugin=function(e){return!!this[rs]&&!0===this[rs][e]},es.prototype.hasPlugin=function(e){return!!as(e)};const fs=e=>0===e.indexOf("#")?e.slice(1):e;function hs(e,t,n){let r=hs.getPlayer(e);if(r)return t&&bt.warn(`Player "${e}" is already initialised. Options will not be applied.`),n&&r.ready(n),r;const a="string"==typeof e?Rn("#"+fs(e)):e;if(!tn(a))throw new TypeError("The element or ID supplied is not valid. (videojs)");const s="getRootNode"in a&&a.getRootNode()instanceof i().ShadowRoot?a.getRootNode():a.ownerDocument.body;a.ownerDocument.defaultView&&s.contains(a)||bt.warn("The element supplied is not included in the DOM"),!0===(t=t||{}).restoreEl&&(t.restoreEl=(a.parentNode&&a.parentNode.hasAttribute("data-vjs-player")?a.parentNode:a).cloneNode(!0)),pt("beforesetup").forEach((e=>{const n=e(a,Dt(t));Ct(n)&&!Array.isArray(n)?t=Dt(t,n):bt.error("please return an object in beforesetup hooks")}));const o=wr.getComponent("Player");return r=new o(a,t,n),pt("setup").forEach((e=>e(r))),r}if(hs.hooks_=ht,hs.hooks=pt,hs.hook=function(e,t){pt(e,t)},hs.hookOnce=function(e,t){pt(e,[].concat(t).map((t=>{const n=(...r)=>(gt(e,n),t(...r));return n})))},hs.removeHook=gt,!0!==i().VIDEOJS_NO_DYNAMIC_STYLE&&en()){let e=Rn(".vjs-styles-defaults");if(!e){e=Un("vjs-styles-defaults");const t=Rn("head");t&&t.insertBefore(e,t.firstChild),Bn(e,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: 56.25%\n }\n ")}}Ln(1,hs),hs.VERSION=ft,hs.options=es.prototype.options_,hs.getPlayers=()=>es.players,hs.getPlayer=e=>{const t=es.players;let n;if("string"==typeof e){const r=fs(e),i=t[r];if(i)return i;n=Rn("#"+r)}else n=e;if(tn(n)){const{player:e,playerId:r}=n;if(e||t[r])return e||t[r]}},hs.getAllPlayers=()=>Object.keys(es.players).map((e=>es.players[e])).filter(Boolean),hs.players=es.players,hs.getComponent=wr.getComponent,hs.registerComponent=(e,t)=>(di.isTech(t)&&bt.warn(`The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),wr.registerComponent.call(wr,e,t)),hs.getTech=di.getTech,hs.registerTech=di.registerTech,hs.use=function(e,t){fi[e]=fi[e]||[],fi[e].push(t)},Object.defineProperty(hs,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(hs.middleware,"TERMINATOR",{value:pi,writeable:!1,enumerable:!0}),hs.browser=Qt,hs.obj=Ot,hs.mergeOptions=ds(9,"videojs.mergeOptions","videojs.obj.merge",Dt),hs.defineLazyProperty=ds(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Nt),hs.bind=ds(9,"videojs.bind","native Function.prototype.bind",nr),hs.registerPlugin=cs.registerPlugin,hs.deregisterPlugin=cs.deregisterPlugin,hs.plugin=(e,t)=>(bt.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),cs.registerPlugin(e,t)),hs.getPlugins=cs.getPlugins,hs.getPlugin=cs.getPlugin,hs.getPluginVersion=cs.getPluginVersion,hs.addLanguage=function(e,t){return e=(""+e).toLowerCase(),hs.options.languages=Dt(hs.options.languages,{[e]:t}),hs.options.languages[e]},hs.log=bt,hs.createLogger=Et,hs.time=Pr,hs.createTimeRange=ds(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Cr),hs.createTimeRanges=ds(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Cr),hs.formatTime=ds(9,"videojs.formatTime","videojs.time.formatTime",Or),hs.setFormatTime=ds(9,"videojs.setFormatTime","videojs.time.setFormatTime",xr),hs.resetFormatTime=ds(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",Nr),hs.parseUrl=ds(9,"videojs.parseUrl","videojs.url.parseUrl",$r),hs.isCrossOrigin=ds(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",ei),hs.EventTarget=or,hs.any=Jn,hs.on=Wn,hs.one=Qn,hs.off=Xn,hs.trigger=$n,hs.xhr=f(),hs.TextTrack=ii,hs.AudioTrack=ai,hs.VideoTrack=si,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((e=>{hs[e]=function(){return bt.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`),On[e].apply(null,arguments)}})),hs.computedStyle=ds(9,"videojs.computedStyle","videojs.dom.computedStyle",xn),hs.dom=On,hs.fn=ar,hs.num=Gi,hs.str=Sr,hs.url=ti;class ps{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get:()=>t.enabled_(),set(e){t.enabled_(e)}}),t}}class gs extends hs.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get:()=>e.selectedIndex_}),Object.defineProperty(e,"length",{get:()=>e.levels_.length}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const n=this.levels_.length;return t=new ps(e),""+n in this||Object.defineProperty(this,n,{get(){return this.levels_[n]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let n=0,r=this.length;n<r;n++)if(this[n]===e){t=this.levels_.splice(n,1)[0],this.selectedIndex_===n?this.selectedIndex_=-1:this.selectedIndex_>n&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,n=this.length;t<n;t++){const n=this[t];if(n.id===e)return n}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}gs.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const e in gs.prototype.allowedEvents_)gs.prototype["on"+e]=null;var ms="4.0.0";const ys=function(e){return function(e,t){const n=e.qualityLevels,r=new gs,i=function(){r.dispose(),e.qualityLevels=n,e.off("dispose",i)};return e.on("dispose",i),e.qualityLevels=()=>r,e.qualityLevels.VERSION=ms,r}(this,hs.obj.merge({},e))};hs.registerPlugin("qualityLevels",ys),ys.VERSION=ms;const vs=v,_s=(e,t)=>t&&t.responseURL&&e!==t.responseURL?t.responseURL:e,Ts=e=>hs.log.debug?hs.log.debug.bind(hs,"VHS:",`${e} >`):function(){};function bs(...e){const t=hs.obj||hs;return(t.merge||t.mergeOptions).apply(t,e)}function Es(...e){const t=hs.time||hs;return(t.createTimeRanges||t.createTimeRanges).apply(t,e)}const Ss=1/30,ws=.1,As=function(e,t){const n=[];let r;if(e&&e.length)for(r=0;r<e.length;r++)t(e.start(r),e.end(r))&&n.push([e.start(r),e.end(r)]);return Es(n)},Is=function(e,t){return As(e,(function(e,n){return e-ws<=t&&n+ws>=t}))},Cs=function(e,t){return As(e,(function(e){return e-Ss>=t}))},Rs=e=>{const t=[];if(!e||!e.length)return"";for(let n=0;n<e.length;n++)t.push(e.start(n)+" => "+e.end(n));return t.join(", ")},Ds=e=>{const t=[];for(let n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t},xs=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},Ns=function(e,t){let n=0;if(!e||!e.length)return n;for(let r=0;r<e.length;r++){const i=e.start(r),a=e.end(r);t>a||(n+=t>i&&t<=a?a-t:a-i)}return n},Os=(e,t)=>{if(!t.preload)return t.duration;let n=0;return(t.parts||[]).forEach((function(e){n+=e.duration})),(t.preloadHints||[]).forEach((function(t){"PART"===t.type&&(n+=e.partTargetDuration)})),n},Ps=e=>(e.segments||[]).reduce(((e,t,n)=>(t.parts?t.parts.forEach((function(r,i){e.push({duration:r.duration,segmentIndex:n,partIndex:i,part:r,segment:t})})):e.push({duration:t.duration,segmentIndex:n,partIndex:null,segment:t,part:null}),e)),[]),Ms=e=>{const t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},ks=({preloadSegment:e})=>{if(!e)return;const{parts:t,preloadHints:n}=e;let r=(n||[]).reduce(((e,t)=>e+("PART"===t.type?1:0)),0);return r+=t&&t.length?t.length:0,r},Ls=(e,t)=>{if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;const n=Ms(t).length>0;return n&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:n&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},Fs=function(e,t,n){if(void 0===t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;const r=function(e,t){let n=0,r=t-e.mediaSequence,i=e.segments[r];if(i){if(void 0!==i.start)return{result:i.start,precise:!0};if(void 0!==i.end)return{result:i.end-i.duration,precise:!0}}for(;r--;){if(i=e.segments[r],void 0!==i.end)return{result:n+i.end,precise:!0};if(n+=Os(e,i),void 0!==i.start)return{result:n+i.start,precise:!0}}return{result:n,precise:!1}}(e,t);if(r.precise)return r.result;const i=function(e,t){let n,r=0,i=t-e.mediaSequence;for(;i<e.segments.length;i++){if(n=e.segments[i],void 0!==n.start)return{result:n.start-r,precise:!0};if(r+=Os(e,n),void 0!==n.end)return{result:n.end-r,precise:!0}}return{result:-1,precise:!1}}(e,t);return i.precise?i.result:r.result+n},Us=function(e,t,n){if(!e)return 0;if("number"!=typeof n&&(n=0),void 0===t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return i()[1/0]}return Fs(e,t,n)},Bs=function({defaultDuration:e,durationList:t,startIndex:n,endIndex:r}){let i=0;if(n>r&&([n,r]=[r,n]),n<0){for(let t=n;t<Math.min(0,r);t++)i+=e;n=0}for(let e=n;e<r;e++)i+=t[e].duration;return i},js=function(e,t,n,r){if(!e||!e.segments)return null;if(e.endList)return Us(e);if(null===t)return null;t=t||0;let i=Fs(e,e.mediaSequence+e.segments.length,t);return n&&(i-=r="number"==typeof r?r:Ls(null,e)),Math.max(0,i)},qs=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},Hs=function(e){return e.excludeUntil&&e.excludeUntil===1/0},Gs=function(e){const t=qs(e);return!e.disabled&&!t},Vs=function(e,t){return t.attributes&&t.attributes[e]},Ys=(e,t)=>{if(1===e.playlists.length)return!0;const n=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((e=>!!Gs(e)&&(e.attributes.BANDWIDTH||0)<n)).length},zs=(e,t)=>!(!e&&!t||!e&&t||e&&!t||e!==t&&(!e.id||!t.id||e.id!==t.id)&&(!e.resolvedUri||!t.resolvedUri||e.resolvedUri!==t.resolvedUri)&&(!e.uri||!t.uri||e.uri!==t.uri)),Zs=function(e,t){const n=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{};let r=!1;for(const e in n){for(const i in n[e])if(r=t(n[e][i]),r)break;if(r)break}return!!r},Ks=e=>{if(!e||!e.playlists||!e.playlists.length)return Zs(e,(e=>e.playlists&&e.playlists.length||e.uri));for(let t=0;t<e.playlists.length;t++){const n=e.playlists[t],r=n.attributes&&n.attributes.CODECS;if((!r||!r.split(",").every((e=>M(e))))&&!Zs(e,(e=>zs(n,e))))return!1}return!0};var Ws={liveEdgeDelay:Ls,duration:Us,seekable:function(e,t,n){const r=t||0;let i=js(e,t,!0,n);return null===i?Es():(i<r&&(i=r),Es(r,i))},getMediaInfoForTime:function({playlist:e,currentTime:t,startingSegmentIndex:n,startingPartIndex:r,startTime:i,exactManifestTimings:a}){let s=t-i;const o=Ps(e);let u=0;for(let e=0;e<o.length;e++){const t=o[e];if(n===t.segmentIndex&&("number"!=typeof r||"number"!=typeof t.partIndex||r===t.partIndex)){u=e;break}}if(s<0){if(u>0)for(let t=u-1;t>=0;t--){const n=o[t];if(s+=n.duration,a){if(s<0)continue}else if(s+Ss<=0)continue;return{partIndex:n.partIndex,segmentIndex:n.segmentIndex,startTime:i-Bs({defaultDuration:e.targetDuration,durationList:o,startIndex:u,endIndex:t})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t}}if(u<0){for(let n=u;n<0;n++)if(s-=e.targetDuration,s<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t};u=0}for(let t=u;t<o.length;t++){const n=o[t];s-=n.duration;const r=n.duration>Ss;if(0!==s&&!(r&&s+Ss>=0)||t===o.length-1){if(a){if(s>0)continue}else if(s-Ss>=0)continue;return{partIndex:n.partIndex,segmentIndex:n.segmentIndex,startTime:i+Bs({defaultDuration:e.targetDuration,durationList:o,startIndex:u,endIndex:t})}}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:t}},isEnabled:Gs,isDisabled:function(e){return e.disabled},isExcluded:qs,isIncompatible:Hs,playlistEnd:js,isAes:function(e){for(let t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},hasAttribute:Vs,estimateSegmentRequestTime:function(e,t,n,r=0){return Vs("BANDWIDTH",n)?(e*n.attributes.BANDWIDTH-8*r)/t:NaN},isLowestEnabledRendition:Ys,isAudioOnly:Ks,playlistMatch:zs,segmentDurationWithParts:Os};const{log:Xs}=hs,$s=(e,t)=>`${e}-${t}`,Qs=(e,t,n)=>`placeholder-uri-${e}-${t}-${n}`,Js=(e,t)=>{e.mediaGroups&&["AUDIO","SUBTITLES"].forEach((n=>{if(e.mediaGroups[n])for(const r in e.mediaGroups[n])for(const i in e.mediaGroups[n][r]){const a=e.mediaGroups[n][r][i];t(a,n,r,i)}}))},eo=({playlist:e,uri:t,id:n})=>{e.id=n,e.playlistErrors_=0,t&&(e.uri=t),e.attributes=e.attributes||{}},to=(e,t,n=Qs)=>{e.uri=t;for(let t=0;t<e.playlists.length;t++)if(!e.playlists[t].uri){const n=`placeholder-uri-${t}`;e.playlists[t].uri=n}const r=Ks(e);Js(e,((t,i,a,s)=>{if(!t.playlists||!t.playlists.length){if(r&&"AUDIO"===i&&!t.uri)for(let t=0;t<e.playlists.length;t++){const n=e.playlists[t];if(n.attributes&&n.attributes.AUDIO&&n.attributes.AUDIO===a)return}t.playlists=[(0,g.Z)({},t)]}t.playlists.forEach((function(t,r){const o=n(i,a,s,t),u=$s(r,o);t.uri?t.resolvedUri=t.resolvedUri||vs(e.uri,t.uri):(t.uri=0===r?o:u,t.resolvedUri=t.uri),t.id=t.id||u,t.attributes=t.attributes||{},e.playlists[t.id]=t,e.playlists[t.uri]=t}))})),(e=>{let t=e.playlists.length;for(;t--;){const n=e.playlists[t];eo({playlist:n,id:$s(t,n.uri)}),n.resolvedUri=vs(e.uri,n.uri),e.playlists[n.id]=n,e.playlists[n.uri]=n,n.attributes.BANDWIDTH||Xs.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}})(e),(e=>{Js(e,(t=>{t.uri&&(t.resolvedUri=vs(e.uri,t.uri))}))})(e)};class no{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(null!==this.offset_)return;if(!e.length)return;const[t]=e;void 0!==t.programDateTime&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;const[t]=e,n=t.startDate.getTime();this.trimProcessedDateRanges_(n),this.pendingDateRanges_=e.reduce(((e,t)=>(e.set(t.id,t),e)),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(null===this.offset_)return[];const e={},t=[];this.pendingDateRanges_.forEach(((n,r)=>{if(!this.processedDateRanges_.has(r)&&(n.startTime=n.startDate.getTime()/1e3-this.offset_,n.processDateRange=()=>this.processDateRange(n),t.push(n),n.class))if(e[n.class]){const t=e[n.class].push(n);n.classListIndex=t-1}else e[n.class]=[n],n.classListIndex=0}));for(const n of t){const t=e[n.class]||[];n.endDate?n.endTime=n.endDate.getTime()/1e3-this.offset_:n.endOnNext&&t[n.classListIndex+1]?n.endTime=t[n.classListIndex+1].startTime:n.duration?n.endTime=n.startTime+n.duration:n.plannedDuration?n.endTime=n.startTime+n.plannedDuration:n.endTime=n.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach(((t,n)=>{t.startDate.getTime()<e&&this.processedDateRanges_.delete(n)}))}}const{EventTarget:ro}=hs,io=(e,t)=>{if(!e)return t;const n=bs(e,t);if(e.preloadHints&&!t.preloadHints&&delete n.preloadHints,e.parts&&!t.parts)delete n.parts;else if(e.parts&&t.parts)for(let r=0;r<t.parts.length;r++)e.parts&&e.parts[r]&&(n.parts[r]=bs(e.parts[r],t.parts[r]));return!e.skipped&&t.skipped&&(n.skipped=!1),e.preload&&!t.preload&&(n.preload=!1),n},ao=(e,t)=>{!e.resolvedUri&&e.uri&&(e.resolvedUri=vs(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=vs(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=vs(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=vs(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach((e=>{e.resolvedUri||(e.resolvedUri=vs(t,e.uri))})),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach((e=>{e.resolvedUri||(e.resolvedUri=vs(t,e.uri))}))},so=function(e){const t=e.segments||[],n=e.preloadSegment;if(n&&n.parts&&n.parts.length){if(n.preloadHints)for(let e=0;e<n.preloadHints.length;e++)if("MAP"===n.preloadHints[e].type)return t;n.duration=e.targetDuration,n.preload=!0,t.push(n)}return t},oo=(e,t)=>e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment,uo=(e,t,n=oo)=>{const r=bs(e,{}),i=r.playlists[t.id];if(!i)return null;if(n(i,t))return null;t.segments=so(t);const a=bs(i,t);if(a.preloadSegment&&!t.preloadSegment&&delete a.preloadSegment,i.segments){if(t.skip){t.segments=t.segments||[];for(let e=0;e<t.skip.skippedSegments;e++)t.segments.unshift({skipped:!0})}a.segments=((e,t,n)=>{const r=e.slice(),i=t.slice();n=n||0;const a=[];let s;for(let e=0;e<i.length;e++){const t=r[e+n],o=i[e];t?(s=t.map||s,a.push(io(t,o))):(s&&!o.map&&(o.map=s),a.push(o))}return a})(i.segments,t.segments,t.mediaSequence-i.mediaSequence)}a.segments.forEach((e=>{ao(e,a.resolvedUri)}));for(let e=0;e<r.playlists.length;e++)r.playlists[e].id===t.id&&(r.playlists[e]=a);return r.playlists[t.id]=a,r.playlists[t.uri]=a,Js(e,((e,n,r,i)=>{if(e.playlists)for(let n=0;n<e.playlists.length;n++)t.id===e.playlists[n].id&&(e.playlists[n]=a)})),r},lo=(e,t)=>{const n=e.segments||[],r=n[n.length-1],i=r&&r.parts&&r.parts[r.parts.length-1],a=i&&i.duration||r&&r.duration;return t&&a?1e3*a:500*(e.partTargetDuration||e.targetDuration||10)};class co extends ro{constructor(e,t,n={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=Ts("PlaylistLoader");const{withCredentials:r=!1}=n;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=n.addDateRangesToTextTrack;const i=t.options_;this.customTagParsers=i&&i.customTagParsers||[],this.customTagMappers=i&&i.customTagMappers||[],this.llhls=i&&i.llhls,this.dateRangesStorage_=new no,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();t.length&&this.addDateRangesToTextTrack_&&this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if("HAVE_METADATA"!==this.state)return;const e=this.media();let t=vs(this.main.uri,e.uri);this.llhls&&(t=((e,t)=>{if(t.endList||!t.serverControl)return e;const n={};if(t.serverControl.canBlockReload){const{preloadSegment:e}=t;let r=t.mediaSequence+t.segments.length;if(e){const i=e.parts||[],a=ks(t)-1;a>-1&&a!==i.length-1&&(n._HLS_part=a),(a>-1||i.length)&&r--}n._HLS_msn=r}if(t.serverControl&&t.serverControl.canSkipUntil&&(n._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(n).length){const t=new(i().URL)(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach((function(e){n.hasOwnProperty(e)&&t.searchParams.set(e,n[e])})),e=t.toString()}return e})(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials},((e,t)=>{if(this.request)return e?this.playlistRequestError(this.request,this.media(),"HAVE_METADATA"):void this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}))}playlistRequestError(e,t,n){const{uri:r,id:i}=t;this.request=null,n&&(this.state=n),this.error={playlist:this.main.playlists[i],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")}parseManifest_({url:e,manifestString:t}){return(({onwarn:e,oninfo:t,manifestString:n,customTagParsers:r=[],customTagMappers:i=[],llhls:a})=>{const s=new R;e&&s.on("warn",e),t&&s.on("info",t),r.forEach((e=>s.addParser(e))),i.forEach((e=>s.addTagMapper(e))),s.push(n),s.end();const o=s.manifest;if(a||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach((function(e){o.hasOwnProperty(e)&&delete o[e]})),o.segments&&o.segments.forEach((function(e){["parts","preloadHints"].forEach((function(t){e.hasOwnProperty(t)&&delete e[t]}))}))),!o.targetDuration){let t=10;o.segments&&o.segments.length&&(t=o.segments.reduce(((e,t)=>Math.max(e,t.duration)),0)),e&&e({message:`manifest has no targetDuration defaulting to ${t}`}),o.targetDuration=t}const u=Ms(o);if(u.length&&!o.partTargetDuration){const t=u.reduce(((e,t)=>Math.max(e,t.duration)),0);e&&(e({message:`manifest has no partTargetDuration defaulting to ${t}`}),Xs.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),o.partTargetDuration=t}return o})({onwarn:({message:t})=>this.logger_(`m3u8-parser warn for ${e}: ${t}`),oninfo:({message:t})=>this.logger_(`m3u8-parser info for ${e}: ${t}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}haveMetadata({playlistString:e,playlistObject:t,url:n,id:r}){this.request=null,this.state="HAVE_METADATA";const i=t||this.parseManifest_({url:n,manifestString:e});i.lastRequest=Date.now(),eo({playlist:i,uri:n,id:r});const a=uo(this.main,i);this.targetDuration=i.partTargetDuration||i.targetDuration,this.pendingMedia_=null,a?(this.main=a,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(lo(this.media(),!!a)),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),i().clearTimeout(this.mediaUpdateTimeout),i().clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new no,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(i().clearTimeout(this.finalRenditionTimeout),t){const t=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;return void(this.finalRenditionTimeout=i().setTimeout(this.media.bind(this,e,!1),t))}const n=this.state,r=!this.media_||e.id!==this.media_.id,a=this.main.playlists[e.id];if(a&&a.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(r&&(this.trigger("mediachanging"),"HAVE_MAIN_MANIFEST"===n?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(lo(e,!0)),r){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},((t,r)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=_s(e.resolvedUri,r),t)return this.playlistRequestError(this.request,e,n);this.haveMetadata({playlistString:r.responseText,url:e.uri,id:e.id}),"HAVE_MAIN_MANIFEST"===n?this.trigger("loadedmetadata"):this.trigger("mediachange")}}))}}pause(){this.mediaUpdateTimeout&&(i().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(i().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const e=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=i().setTimeout((()=>{this.mediaUpdateTimeout=null,this.load()}),e)}else this.started?t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(i().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=i().setTimeout((()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)}),e))}start(){if(this.started=!0,"object"==typeof this.src)return this.src.uri||(this.src.uri=i().location.href),this.src.resolvedUri=this.src.uri,void setTimeout((()=>{this.setupInitialPlaylist(this.src)}),0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},((e,t)=>{if(!this.request)return;if(this.request=null,e)return this.error={status:t.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:t.responseText,code:2},"HAVE_NOTHING"===this.state&&(this.started=!1),this.trigger("error");this.src=_s(this.src,t);const n=this.parseManifest_({manifestString:t.responseText,url:this.src});this.setupInitialPlaylist(n)}))}srcUri(){return"string"==typeof this.src?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists)return this.main=e,to(this.main,this.srcUri()),e.playlists.forEach((e=>{e.segments=so(e),e.segments.forEach((t=>{ao(t,e.resolvedUri)}))})),this.trigger("loadedplaylist"),void(this.request||this.media(this.main.playlists[0]));const t=this.srcUri()||i().location.href;this.main=((e,t)=>{const n=$s(0,t),r={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:i().location.href,resolvedUri:i().location.href,playlists:[{uri:t,id:n,resolvedUri:t,attributes:{}}]};return r.playlists[n]=r.playlists[0],r.playlists[t]=r.playlists[0],r})(0,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const n=this.main,r=e.ID;let i=n.playlists.length;for(;i--;){const a=n.playlists[i];if(a.attributes["PATHWAY-ID"]===r){const s=a.resolvedUri,o=a.id;if(t){const t=this.createCloneURI_(a.resolvedUri,e),s=$s(r,t),o=this.createCloneAttributes_(r,a.attributes),u=this.createClonePlaylist_(a,s,e,o);n.playlists[i]=u,n.playlists[s]=u,n.playlists[t]=u}else n.playlists.splice(i,1);delete n.playlists[o],delete n.playlists[s]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const n=this.main,r=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((e=>{if(n.mediaGroups[e]&&n.mediaGroups[e][r])for(const t in n.mediaGroups[e])if(t===r){for(const r in n.mediaGroups[e][t])n.mediaGroups[e][t][r].playlists.forEach(((e,t)=>{const r=n.playlists[e.id],i=r.id,a=r.resolvedUri;delete n.playlists[i],delete n.playlists[a]}));delete n.mediaGroups[e][t]}})),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const n=this.main,r=n.playlists.length,i=this.createCloneURI_(t.resolvedUri,e),a=$s(e.ID,i),s=this.createCloneAttributes_(e.ID,t.attributes),o=this.createClonePlaylist_(t,a,e,s);n.playlists[r]=o,n.playlists[a]=o,n.playlists[i]=o,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,n=e["BASE-ID"],r=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((i=>{if(r.mediaGroups[i]&&!r.mediaGroups[i][t])for(const a in r.mediaGroups[i])if(a===n){r.mediaGroups[i][t]={};for(const n in r.mediaGroups[i][a]){const s=r.mediaGroups[i][a][n];r.mediaGroups[i][t][n]=(0,g.Z)({},s);const o=r.mediaGroups[i][t][n],u=this.createCloneURI_(s.resolvedUri,e);o.resolvedUri=u,o.uri=u,o.playlists=[],s.playlists.forEach(((a,s)=>{const u=r.playlists[a.id],l=Qs(i,t,n),c=$s(t,l);if(u&&!r.playlists[c]){const t=this.createClonePlaylist_(u,c,e),n=t.resolvedUri;r.playlists[c]=t,r.playlists[n]=t}o.playlists[s]=this.createClonePlaylist_(a,c,e)}))}}}))}createClonePlaylist_(e,t,n,r){const i=this.createCloneURI_(e.resolvedUri,n),a={resolvedUri:i,uri:i,id:t};return e.segments&&(a.segments=[]),r&&(a.attributes=r),bs(e,a)}createCloneURI_(e,t){const n=new URL(e);n.hostname=t["URI-REPLACEMENT"].HOST;const r=t["URI-REPLACEMENT"].PARAMS;for(const e of Object.keys(r))n.searchParams.set(e,r[e]);return n.href}createCloneAttributes_(e,t){const n={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((r=>{t[r]&&(n[r]=e)})),n}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const n in e.contentProtection){const r=e.contentProtection[n].attributes.keyId;r&&t.add(r.toLowerCase())}return t}}}const{xhr:fo}=hs,ho=function(e,t,n,r){const i="arraybuffer"===e.responseType?e.response:e.responseText;!t&&i&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=i.byteLength||i.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),n.headers&&(e.responseHeaders=n.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===n.statusCode||206===n.statusCode||0===n.statusCode||(t=new Error("XHR Failed with a response of: "+(e&&(i||e.responseText)))),r(t,e)},po=function(){const e=function e(t,n){t=bs({timeout:45e3},t);const r=e.beforeRequest||hs.Vhs.xhr.beforeRequest,i=e._requestCallbackSet||hs.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||hs.Vhs.xhr._responseCallbackSet;r&&"function"==typeof r&&(hs.log.warn("beforeRequest is deprecated, use onRequest instead."),i.add(r));const s=!0===hs.Vhs.xhr.original?fo:hs.Vhs.xhr,o=((e,t)=>{if(!e||!e.size)return;let n=t;return e.forEach((e=>{n=e(n)})),n})(i,t);i.delete(r);const u=s(o||t,(function(e,t){return((e,t,n,r)=>{e&&e.size&&e.forEach((e=>{e(t,n,r)}))})(a,u,e,t),ho(u,e,t,n)})),l=u.abort;return u.abort=function(){return u.aborted=!0,l.apply(u,arguments)},u.uri=t.uri,u.requestTime=Date.now(),u};return e.original=!0,e},go=function(e){const t={};return e.byterange&&(t.Range=function(e){let t;const n=e.offset;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?i().BigInt(e.offset)+i().BigInt(e.length)-i().BigInt(1):e.offset+e.length-1,"bytes="+n+"-"+t}(e.byterange)),t},mo=function(e,t){return e.start(t)+"-"+e.end(t)},yo=function(e,t){const n=e.toString(16);return"00".substring(0,2-n.length)+n+(t%2?" ":"")},vo=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},_o=function(e){const t={};return Object.keys(e).forEach((n=>{const r=e[n];H(r)?t[n]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[n]=r})),t},To=function(e){const t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},bo=function(e){return e.resolvedUri},Eo=e=>{const t=Array.prototype.slice.call(e),n=16;let r,i,a="";for(let e=0;e<t.length/n;e++)r=t.slice(e*n,e*n+n).map(yo).join(""),i=t.slice(e*n,e*n+n).map(vo).join(""),a+=r+" "+i+"\n";return a};var So=Object.freeze({__proto__:null,createTransferableMessage:_o,initSegmentId:To,segmentKeyId:bo,hexDump:Eo,tagDump:({bytes:e})=>Eo(e),textRanges:e=>{let t,n="";for(t=0;t<e.length;t++)n+=mo(e,t)+" ";return n}});const wo=({programTime:e,playlist:t,retryCount:n=2,seekTo:r,pauseAfterSeek:i=!0,tech:a,callback:s})=>{if(!s)throw new Error("seekToProgramTime: callback must be provided");if(void 0===e||!t||!r)return s({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!t.endList&&!a.hasStarted_)return s({message:"player must be playing a live stream to start buffering"});if(!(e=>{if(!e.segments||0===e.segments.length)return!1;for(let t=0;t<e.segments.length;t++)if(!e.segments[t].dateTimeObject)return!1;return!0})(t))return s({message:"programDateTime tags must be provided in the manifest "+t.resolvedUri});const o=((e,t)=>{let n;try{n=new Date(e)}catch(e){return null}if(!t||!t.segments||0===t.segments.length)return null;let r=t.segments[0];if(n<new Date(r.dateTimeObject))return null;for(let e=0;e<t.segments.length-1&&(r=t.segments[e],!(n<new Date(t.segments[e+1].dateTimeObject)));e++);const i=t.segments[t.segments.length-1],a=i.dateTimeObject,s=i.videoTimingInfo?(o=i.videoTimingInfo).transmuxedPresentationEnd-o.transmuxedPresentationStart-o.transmuxerPrependedSeconds:i.duration+.25*i.duration;var o;return n>new Date(a.getTime()+1e3*s)?null:(n>new Date(a)&&(r=i),{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:Ws.duration(t,t.mediaSequence+t.segments.indexOf(r)),type:r.videoTimingInfo?"accurate":"estimate"})})(e,t);if(!o)return s({message:`${e} was not found in the stream`});const u=o.segment,l=((e,t)=>{let n,r;try{n=new Date(e),r=new Date(t)}catch(e){}const i=n.getTime();return(r.getTime()-i)/1e3})(u.dateTimeObject,e);if("estimate"===o.type)return 0===n?s({message:`${e} is not buffered yet. Try again`}):(r(o.estimatedStart+l),void a.one("seeked",(()=>{wo({programTime:e,playlist:t,retryCount:n-1,seekTo:r,pauseAfterSeek:i,tech:a,callback:s})})));const c=u.start+l;a.one("seeked",(()=>s(null,a.currentTime()))),i&&a.pause(),r(c)},Ao=(e,t)=>{if(4===e.readyState)return t()},{EventTarget:Io}=hs,Co=function(e,t){if(!oo(e,t))return!1;if(e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length))return!1;if(!e.sidx&&t.sidx||e.sidx&&!t.sidx)return!1;if(e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(let n=0;n<e.segments.length;n++){const r=e.segments[n],i=t.segments[n];if(r.uri!==i.uri)return!1;if(!r.byterange&&!i.byterange)continue;const a=r.byterange,s=i.byterange;if(a&&!s||!a&&s)return!1;if(a.offset!==s.offset||a.length!==s.length)return!1}return!0},Ro=(e,t,n,r)=>`placeholder-uri-${e}-${t}-${r.attributes.NAME||n}`,Do=(e,t)=>(Boolean(!e.map&&!t.map)||Boolean(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length))&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length,xo=(e,t)=>{const n={};for(const r in e){const i=e[r].sidx;if(i){const e=de(i);if(!t[e])break;const r=t[e].sidxInfo;Do(r,i)&&(n[e]=t[e])}}return n};class No extends Io{constructor(e,t,n={},r){super(),this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);const{withCredentials:i=!1}=n;if(this.vhs_=t,this.withCredentials=i,this.addMetadataToTextTrack=n.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",(()=>{this.refreshXml_()})),this.on("mediaupdatetimeout",(()=>{this.refreshMedia_(this.media().id)})),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=Ts("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}requestErrored_(e,t,n){return!this.request||(this.request=null,e?(this.error="object"!=typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2}:e,n&&(this.state=n),this.trigger("error"),!0):void 0)}addSidxSegments_(e,t,n){const r=e.sidx&&de(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r])return void(this.mediaRequest_=i().setTimeout((()=>n(!1)),0));const a=_s(e.sidx.resolvedUri),s=(i,a)=>{if(this.requestErrored_(i,a,t))return;const s=this.mainPlaylistLoader_.sidxMapping_;let o;try{o=Ge()(G(a.response).subarray(8))}catch(e){return void this.requestErrored_(e,a,t)}return s[r]={sidxInfo:e.sidx,sidx:o},se(e,o,e.sidx.resolvedUri),n(!0)};this.request=((e,t,n)=>{let r,i=[],a=!1;const s=function(e,t,r,i){return t.abort(),a=!0,n(e,t,r,i)},o=function(e,t){if(a)return;if(e)return s(e,t,"",i);const n=t.responseText.substring(i&&i.byteLength||0,t.responseText.length);if(i=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if((t=t.filter((function(e){return e&&(e.byteLength||e.length)&&"string"!=typeof e}))).length<=1)return G(t[0]);var r=t.reduce((function(e,t,n){return e+(t.byteLength||t.length)}),0),i=new Uint8Array(r),a=0;return t.forEach((function(e){e=G(e),i.set(e,a),a+=e.byteLength})),i}(i,Z(n,!0)),r=r||Ye(i),i.length<10||r&&i.length<r+2)return Ao(t,(()=>s(e,t,"",i)));const o=ct(i);return"ts"===o&&i.length<188||!o&&i.length<376?Ao(t,(()=>s(e,t,"",i))):s(null,t,o,i)},u={uri:e,beforeSend(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",(function({total:t,loaded:n}){return ho(e,null,{statusCode:e.status},o)}))}},l=t(u,(function(e,t){return ho(l,e,t,o)}));return l})(a,this.vhs_.xhr,((t,n,r,i)=>{if(t)return s(t,n);if(!r||"mp4"!==r)return s({status:n.status,message:`Unsupported ${r||"unknown"} container type for sidx segment at URL: ${a}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},n);const{offset:o,length:u}=e.sidx.byterange;if(i.length>=u+o)return s(t,{response:i.subarray(o,o+u),status:n.status,uri:n.uri});this.request=this.vhs_.xhr({uri:a,responseType:"arraybuffer",headers:go({byterange:e.sidx.byterange})},s)}))}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},i().clearTimeout(this.minimumUpdatePeriodTimeout_),i().clearTimeout(this.mediaRequest_),i().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if("string"==typeof e){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const n=!this.media_||e.id!==this.media_.id;if(n&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(n&&(this.trigger("mediachanging"),this.trigger("mediachange")));n&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,(n=>{this.haveMetadata({startingState:t,playlist:e})})))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,this.mediaRequest_=null,this.refreshMedia_(t.id),"HAVE_MAIN_MANIFEST"===e?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),i().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(i().clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)}load(e){i().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const e=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=i().setTimeout((()=>this.load()),e)}else this.started?t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()}start(){this.started=!0,this.isMain_?this.requestMain_(((e,t)=>{this.haveMain_(),this.hasPendingRequest()||this.media_||this.media(this.mainPlaylistLoader_.main.playlists[0])})):this.mediaRequest_=i().setTimeout((()=>this.haveMain_()),0)}requestMain_(e){this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},((t,n)=>{if(this.requestErrored_(t,n))return void("HAVE_NOTHING"===this.state&&(this.started=!1));const r=n.responseText!==this.mainPlaylistLoader_.mainXml_;return this.mainPlaylistLoader_.mainXml_=n.responseText,n.responseHeaders&&n.responseHeaders.date?this.mainLoaded_=Date.parse(n.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=_s(this.mainPlaylistLoader_.srcUrl,n),r?(this.handleMain_(),void this.syncClientServerClock_((()=>e(n,r)))):e(n,r)}))}syncClientServerClock_(e){const t=(n=this.mainPlaylistLoader_.mainXml_,(e=>{const t=Re(e,"UTCTiming")[0];if(!t)return null;const n=Oe(t);switch(n.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":n.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":n.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":n.method="DIRECT",n.value=Date.parse(n.value);break;default:throw new Error("UNSUPPORTED_UTC_TIMING_SCHEME")}return n})(je(n)));var n;return null===t?(this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()):"DIRECT"===t.method?(this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:vs(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials},((n,r)=>{if(!this.request)return;if(n)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();let i;i="HEAD"===t.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):this.mainLoaded_:Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=i-Date.now(),e()})))}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main;let t=(({mainXml:e,srcUrl:t,clientOffset:n,sidxMapping:r,previousManifest:i})=>{const a=((e,t={})=>{const n=((e,t={})=>{const{manifestUri:n="",NOW:r=Date.now(),clientOffset:i=0,eventHandler:a=function(){}}=t,s=Re(e,"Period");if(!s.length)throw new Error("INVALID_NUMBER_OF_PERIOD");const o=Re(e,"Location"),u=Oe(e),l=Me([{baseUrl:n}],Re(e,"BaseURL")),c=Re(e,"ContentSteering");u.type=u.type||"static",u.sourceDuration=u.mediaPresentationDuration||0,u.NOW=r,u.clientOffset=i,o.length&&(u.locations=o.map(De));const d=[];return s.forEach(((e,t)=>{const n=Oe(e),r=d[t-1];n.start=(({attributes:e,priorPeriodAttributes:t,mpdType:n})=>"number"==typeof e.start?e.start:t&&"number"==typeof t.start&&"number"==typeof t.duration?t.start+t.duration:t||"static"!==n?null:0)({attributes:n,priorPeriodAttributes:r?r.attributes:null,mpdType:u.type}),d.push({node:e,attributes:n})})),{locations:u.locations,contentSteeringInfo:Be(c,a),representationInfo:J(d.map(Ue(u,l))),eventStream:J(d.map(Le))}})(je(e),t),r=n.representationInfo.map(Ce);return Te({dashPlaylists:r,locations:n.locations,contentSteering:n.contentSteeringInfo,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest,eventStream:n.eventStream})})(e,{manifestUri:t,clientOffset:n,sidxMapping:r,previousManifest:i});return to(a,t,Ro),a})({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(t=((e,t,n)=>{let r=!0,i=bs(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts});for(let e=0;e<t.playlists.length;e++){const a=t.playlists[e];if(a.sidx){const e=de(a.sidx);n&&n[e]&&n[e].sidx&&se(a,n[e].sidx,a.sidx.resolvedUri)}const s=uo(i,a,Co);s&&(i=s,r=!1)}return Js(t,((e,t,n,a)=>{if(e.playlists&&e.playlists.length){const s=e.playlists[0].id,o=uo(i,e.playlists[0],Co);o&&(i=o,a in i.mediaGroups[t][n]||(i.mediaGroups[t][n][a]=e),i.mediaGroups[t][n][a].playlists[0]=i.playlists[s],r=!1)}})),((e,t)=>{Js(e,((n,r,i,a)=>{a in t.mediaGroups[r][i]||delete e.mediaGroups[r][i][a]}))})(i,t),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(r=!1),r?null:i})(e,t,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=t||e;const n=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];return n&&n!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=n),(!e||t&&t.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(t),Boolean(t)}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(i().clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!=typeof t||t<=0?t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`):this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=i().setTimeout((()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)}),e)}refreshXml_(){this.requestMain_(((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=((e,t)=>{let n=xo(e.playlists,t);return Js(e,((e,r,i,a)=>{if(e.playlists&&e.playlists.length){const r=e.playlists;n=bs(n,xo(r,t))}})),n})(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,(e=>{this.refreshMedia_(this.media().id)})))}))}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,n=!this.media_||this.media_!==t[e];if(n?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const e=()=>{this.media().endList||(this.mediaUpdateTimeout=i().setTimeout((()=>{this.trigger("mediaupdatetimeout"),e()}),lo(this.media(),Boolean(n))))};e()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const e=this.mainPlaylistLoader_.main.eventStream.map((e=>({cueTime:e.start,frames:[{data:e.messageData}]})));this.addMetadataToTextTrack("EventStream",e,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const n in e.contentProtection){const r=e.contentProtection[n].attributes["cenc:default_KID"];r&&t.add(r.replace(/-/g,"").toLowerCase())}return t}}}var Oo={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const Po=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},Mo=function(e){return function(){const t=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(t){const n=new BlobBuilder;return n.append(e),URL.createObjectURL(n.getBlob())}}(e),n=Po(new Worker(t));n.objURL=t;const r=n.terminate;return n.on=n.addEventListener,n.off=n.removeEventListener,n.terminate=function(){return URL.revokeObjectURL(t),r.call(this)},n}},ko=function(e){return`var browserWorkerPolyFill = ${Po.toString()};\nbrowserWorkerPolyFill(self);\n`+e},Lo=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},Fo=ko(Lo((function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},t=function(){this.init=function(){var e={};this.on=function(t,n){e[t]||(e[t]=[]),e[t]=e[t].concat(n)},this.off=function(t,n){var r;return!!e[t]&&(r=e[t].indexOf(n),e[t]=e[t].slice(),e[t].splice(r,1),r>-1)},this.trigger=function(t){var n,r,i,a;if(n=e[t])if(2===arguments.length)for(i=n.length,r=0;r<i;++r)n[r].call(this,arguments[1]);else{for(a=[],r=arguments.length,r=1;r<arguments.length;++r)a.push(arguments[r]);for(i=n.length,r=0;r<i;++r)n[r].apply(this,a)}},this.dispose=function(){e={}}}};t.prototype.pipe=function(e){return this.on("data",(function(t){e.push(t)})),this.on("done",(function(t){e.flush(t)})),this.on("partialdone",(function(t){e.partialFlush(t)})),this.on("endedtimeline",(function(t){e.endTimeline(t)})),this.on("reset",(function(t){e.reset(t)})),e},t.prototype.push=function(e){this.trigger("data",e)},t.prototype.flush=function(e){this.trigger("done",e)},t.prototype.partialFlush=function(e){this.trigger("partialdone",e)},t.prototype.endTimeline=function(e){this.trigger("endedtimeline",e)},t.prototype.reset=function(e){this.trigger("reset",e)};var r,i,a,s,o,u,l,c,d,f,h,p,g,m,y,v,_,T,b,E,S,w,A,I,C,R,D,x,N,O,P,M,k,L,F,U,B,j,q,H,G=t,V=Math.pow(2,32),Y={getUint64:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getBigUint64?(t=n.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(t):t:n.getUint32(0)*V+n.getUint32(4)},MAX_UINT32:V},z=Y.MAX_UINT32;!function(){var e;if(w={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(e in w)w.hasOwnProperty(e)&&(w[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);A=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),C=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),I=new Uint8Array([0,0,0,1]),R=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]),D=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]),x={video:R,audio:D},P=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),O=new Uint8Array([0,0,0,0,0,0,0,0]),M=new Uint8Array([0,0,0,0,0,0,0,0]),k=M,L=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),F=M,N=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),r=function(e){var t,n,r=[],i=0;for(t=1;t<arguments.length;t++)r.push(arguments[t]);for(t=r.length;t--;)i+=r[t].byteLength;for(n=new Uint8Array(i+8),new DataView(n.buffer,n.byteOffset,n.byteLength).setUint32(0,n.byteLength),n.set(e,4),t=0,i=8;t<r.length;t++)n.set(r[t],i),i+=r[t].byteLength;return n},i=function(){return r(w.dinf,r(w.dref,P))},a=function(e){return r(w.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},y=function(e){return r(w.hdlr,x[e])},m=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(t[12]=e.samplerate>>>24&255,t[13]=e.samplerate>>>16&255,t[14]=e.samplerate>>>8&255,t[15]=255&e.samplerate),r(w.mdhd,t)},g=function(e){return r(w.mdia,m(e),y(e.type),u(e))},o=function(e){return r(w.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},u=function(e){return r(w.minf,"video"===e.type?r(w.vmhd,N):r(w.smhd,O),i(),_(e))},l=function(e,t){for(var n=[],i=t.length;i--;)n[i]=b(t[i]);return r.apply(null,[w.moof,o(e)].concat(n))},c=function(e){for(var t=e.length,n=[];t--;)n[t]=h(e[t]);return r.apply(null,[w.moov,f(4294967295)].concat(n).concat(d(e)))},d=function(e){for(var t=e.length,n=[];t--;)n[t]=E(e[t]);return r.apply(null,[w.mvex].concat(n))},f=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,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 r(w.mvhd,t)},v=function(e){var t,n,i=e.samples||[],a=new Uint8Array(4+i.length);for(n=0;n<i.length;n++)t=i[n].flags,a[n+4]=t.dependsOn<<4|t.isDependedOn<<2|t.hasRedundancy;return r(w.sdtp,a)},_=function(e){return r(w.stbl,T(e),r(w.stts,F),r(w.stsc,k),r(w.stsz,L),r(w.stco,M))},T=function(e){return r(w.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===e.type?U(e):B(e))},U=function(e){var t,n,i=e.sps||[],a=e.pps||[],s=[],o=[];for(t=0;t<i.length;t++)s.push((65280&i[t].byteLength)>>>8),s.push(255&i[t].byteLength),s=s.concat(Array.prototype.slice.call(i[t]));for(t=0;t<a.length;t++)o.push((65280&a[t].byteLength)>>>8),o.push(255&a[t].byteLength),o=o.concat(Array.prototype.slice.call(a[t]));if(n=[w.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,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),r(w.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([i.length],s,[a.length],o))),r(w.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var u=e.sarRatio[0],l=e.sarRatio[1];n.push(r(w.pasp,new Uint8Array([(4278190080&u)>>24,(16711680&u)>>16,(65280&u)>>8,255&u,(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l])))}return r.apply(null,n)},B=function(e){return r(w.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),a(e))},p=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return r(w.tkhd,t)},b=function(e){var t,n,i,a,s,o;return t=r(w.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),s=Math.floor(e.baseMediaDecodeTime/z),o=Math.floor(e.baseMediaDecodeTime%z),n=r(w.tfdt,new Uint8Array([1,0,0,0,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),"audio"===e.type?(i=S(e,92),r(w.traf,t,n,i)):(a=v(e),i=S(e,a.length+92),r(w.traf,t,n,i,a))},h=function(e){return e.duration=e.duration||4294967295,r(w.trak,p(e),g(e))},E=function(e){var t=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(t[t.length-1]=0),r(w.trex,t)},H=function(e,t){var n=0,r=0,i=0,a=0;return e.length&&(void 0!==e[0].duration&&(n=1),void 0!==e[0].size&&(r=2),void 0!==e[0].flags&&(i=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,n|r|i|a,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},q=function(e,t){var n,i,a,s,o,u;for(t+=20+16*(s=e.samples||[]).length,a=H(s,t),(i=new Uint8Array(a.length+16*s.length)).set(a),n=a.length,u=0;u<s.length;u++)o=s[u],i[n++]=(4278190080&o.duration)>>>24,i[n++]=(16711680&o.duration)>>>16,i[n++]=(65280&o.duration)>>>8,i[n++]=255&o.duration,i[n++]=(4278190080&o.size)>>>24,i[n++]=(16711680&o.size)>>>16,i[n++]=(65280&o.size)>>>8,i[n++]=255&o.size,i[n++]=o.flags.isLeading<<2|o.flags.dependsOn,i[n++]=o.flags.isDependedOn<<6|o.flags.hasRedundancy<<4|o.flags.paddingValue<<1|o.flags.isNonSyncSample,i[n++]=61440&o.flags.degradationPriority,i[n++]=15&o.flags.degradationPriority,i[n++]=(4278190080&o.compositionTimeOffset)>>>24,i[n++]=(16711680&o.compositionTimeOffset)>>>16,i[n++]=(65280&o.compositionTimeOffset)>>>8,i[n++]=255&o.compositionTimeOffset;return r(w.trun,i)},j=function(e,t){var n,i,a,s,o,u;for(t+=20+8*(s=e.samples||[]).length,a=H(s,t),(n=new Uint8Array(a.length+8*s.length)).set(a),i=a.length,u=0;u<s.length;u++)o=s[u],n[i++]=(4278190080&o.duration)>>>24,n[i++]=(16711680&o.duration)>>>16,n[i++]=(65280&o.duration)>>>8,n[i++]=255&o.duration,n[i++]=(4278190080&o.size)>>>24,n[i++]=(16711680&o.size)>>>16,n[i++]=(65280&o.size)>>>8,n[i++]=255&o.size;return r(w.trun,n)},S=function(e,t){return"audio"===e.type?j(e,t):q(e,t)};var Z,K,W,X,$,Q,J,ee,te={ftyp:s=function(){return r(w.ftyp,A,I,A,C)},mdat:function(e){return r(w.mdat,e)},moof:l,moov:c,initSegment:function(e){var t,n=s(),r=c(e);return(t=new Uint8Array(n.byteLength+r.byteLength)).set(n),t.set(r,n.byteLength),t}},ne=function(e,t){var n={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return n.dataOffset=t,n.compositionTimeOffset=e.pts-e.dts,n.duration=e.duration,n.size=4*e.length,n.size+=e.byteLength,e.keyFrame&&(n.flags.dependsOn=2,n.flags.isNonSyncSample=0),n},re={groupNalsIntoFrames:function(e){var t,n,r=[],i=[];for(i.byteLength=0,i.nalCount=0,i.duration=0,r.byteLength=0,t=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(n=e[t]).nalUnitType?(r.length&&(r.duration=n.dts-r.dts,i.byteLength+=r.byteLength,i.nalCount+=r.length,i.duration+=r.duration,i.push(r)),(r=[n]).byteLength=n.data.byteLength,r.pts=n.pts,r.dts=n.dts):("slice_layer_without_partitioning_rbsp_idr"===n.nalUnitType&&(r.keyFrame=!0),r.duration=n.dts-r.dts,r.byteLength+=n.data.byteLength,r.push(n));return i.length&&(!r.duration||r.duration<=0)&&(r.duration=i[i.length-1].duration),i.byteLength+=r.byteLength,i.nalCount+=r.length,i.duration+=r.duration,i.push(r),i},groupFramesIntoGops:function(e){var t,n,r=[],i=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,i.byteLength=0,i.nalCount=0,i.duration=0,i.pts=e[0].pts,i.dts=e[0].dts,t=0;t<e.length;t++)(n=e[t]).keyFrame?(r.length&&(i.push(r),i.byteLength+=r.byteLength,i.nalCount+=r.nalCount,i.duration+=r.duration),(r=[n]).nalCount=n.length,r.byteLength=n.byteLength,r.pts=n.pts,r.dts=n.dts,r.duration=n.duration):(r.duration+=n.duration,r.nalCount+=n.length,r.byteLength+=n.byteLength,r.push(n));return i.length&&r.duration<=0&&(r.duration=i[i.length-1].duration),i.byteLength+=r.byteLength,i.nalCount+=r.nalCount,i.duration+=r.duration,i.push(r),i},extendFirstKeyFrame:function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},generateSampleTable:function(e,t){var n,r,i,a,s,o=t||0,u=[];for(n=0;n<e.length;n++)for(a=e[n],r=0;r<a.length;r++)s=a[r],o+=(i=ne(s,o)).size,u.push(i);return u},concatenateNalData:function(e){var t,n,r,i,a,s,o=0,u=e.byteLength,l=e.nalCount,c=new Uint8Array(u+4*l),d=new DataView(c.buffer);for(t=0;t<e.length;t++)for(i=e[t],n=0;n<i.length;n++)for(a=i[n],r=0;r<a.length;r++)s=a[r],d.setUint32(o,s.data.byteLength),o+=4,c.set(s.data,o),o+=s.data.byteLength;return c},generateSampleTableForFrame:function(e,t){var n,r=[];return n=ne(e,t||0),r.push(n),r},concatenateNalDataForFrame:function(e){var t,n,r=0,i=e.byteLength,a=e.length,s=new Uint8Array(i+4*a),o=new DataView(s.buffer);for(t=0;t<e.length;t++)n=e[t],o.setUint32(r,n.data.byteLength),r+=4,s.set(n.data,r),r+=n.data.byteLength;return s}},ie=[33,16,5,32,164,27],ae=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],se=function(e){for(var t=[];e--;)t.push(0);return t},oe=9e4;Q=function(e,t){return K($(e,t))},J=function(e,t){return W(X(e),t)},ee=function(e,t,n){return X(n?e:e-t)};var ue={ONE_SECOND_IN_TS:oe,secondsToVideoTs:K=function(e){return e*oe},secondsToAudioTs:W=function(e,t){return e*t},videoTsToSeconds:X=function(e){return e/oe},audioTsToSeconds:$=function(e,t){return e/t},audioTsToVideoTs:Q,videoTsToAudioTs:J,metadataTsToSeconds:ee},le=ue,ce={prefixWithSilence:function(e,t,n,r){var i,a,s,o,u,l=0,c=0,d=0;if(t.length&&(i=le.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),a=Math.ceil(le.ONE_SECOND_IN_TS/(e.samplerate/1024)),n&&r&&(l=i-Math.max(n,r),d=(c=Math.floor(l/a))*a),!(c<1||d>le.ONE_SECOND_IN_TS/2))){for((s=function(){if(!Z){var e={96e3:[ie,[227,64],se(154),[56]],88200:[ie,[231],se(170),[56]],64e3:[ie,[248,192],se(240),[56]],48e3:[ie,[255,192],se(268),[55,148,128],se(54),[112]],44100:[ie,[255,192],se(268),[55,163,128],se(84),[112]],32e3:[ie,[255,192],se(268),[55,234],se(226),[112]],24e3:[ie,[255,192],se(268),[55,255,128],se(268),[111,112],se(126),[224]],16e3:[ie,[255,192],se(268),[55,255,128],se(268),[111,255],se(269),[223,108],se(195),[1,192]],12e3:[ae,se(268),[3,127,248],se(268),[6,255,240],se(268),[13,255,224],se(268),[27,253,128],se(259),[56]],11025:[ae,se(268),[3,127,248],se(268),[6,255,240],se(268),[13,255,224],se(268),[27,255,192],se(268),[55,175,128],se(108),[112]],8e3:[ae,se(268),[3,121,16],se(47),[7]]};t=e,Z=Object.keys(t).reduce((function(e,n){return e[n]=new Uint8Array(t[n].reduce((function(e,t){return e.concat(t)}),[])),e}),{})}var t;return Z}()[e.samplerate])||(s=t[0].data),o=0;o<c;o++)u=t[0],t.splice(0,0,{data:s,dts:u.dts-a,pts:u.pts-a});return e.baseMediaDecodeTime-=Math.floor(le.videoTsToAudioTs(d,e.samplerate)),d}},trimAdtsFramesByEarliestDts:function(e,t,n){return t.minSegmentDts>=n?e:(t.minSegmentDts=1/0,e.filter((function(e){return e.dts>=n&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)})))},generateSampleTable:function(e){var t,n,r=[];for(t=0;t<e.length;t++)n=e[t],r.push({size:n.data.byteLength,duration:1024});return r},concatenateFrameData:function(e){var t,n,r=0,i=new Uint8Array(function(e){var t,n=0;for(t=0;t<e.length;t++)n+=e[t].data.byteLength;return n}(e));for(t=0;t<e.length;t++)n=e[t],i.set(n.data,r),r+=n.data.byteLength;return i}},de=ue.ONE_SECOND_IN_TS,fe={clearDtsInfo:function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},calculateTrackBaseMediaDecodeTime:function(e,t){var n,r=e.minSegmentDts;return t||(r-=e.timelineStartInfo.dts),n=e.timelineStartInfo.baseMediaDecodeTime,n+=r,n=Math.max(0,n),"audio"===e.type&&(n*=e.samplerate/de,n=Math.floor(n)),n},collectDtsInfo:function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))}},he={parseSei:function(e){for(var t=0,n={payloadType:-1,payloadSize:0},r=0,i=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)r+=255,t++;for(r+=e[t++];255===e[t];)i+=255,t++;if(i+=e[t++],!n.payload&&4===r){if("GA94"===String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])){n.payloadType=r,n.payloadSize=i,n.payload=e.subarray(t,t+i);break}n.payload=void 0}t+=i,r=0,i=0}return n},parseUserData:function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},parseCaptionPackets:function(e,t){var n,r,i,a,s=[];if(!(64&t[0]))return s;for(r=31&t[0],n=0;n<r;n++)a={type:3&t[2+(i=3*n)],pts:e},4&t[i+2]&&(a.ccData=t[i+3]<<8|t[i+4],s.push(a));return s},discardEmulationPreventionBytes:function(e){for(var t,n,r=e.byteLength,i=[],a=1;a<r-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(i.push(a+2),a+=2):a++;if(0===i.length)return e;t=r-i.length,n=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===i[0]&&(s++,i.shift()),n[a]=e[s];return n},USER_DATA_REGISTERED_ITU_T_T35:4},pe=G,ge=he,me=function(e){e=e||{},me.prototype.init.call(this),this.parse708captions_="boolean"!=typeof e.parse708captions||e.parse708captions,this.captionPackets_=[],this.ccStreams_=[new Ie(0,0),new Ie(0,1),new Ie(1,0),new Ie(1,1)],this.parse708captions_&&(this.cc708Stream_=new be({captionServices:e.captionServices})),this.reset(),this.ccStreams_.forEach((function(e){e.on("data",this.trigger.bind(this,"data")),e.on("partialdone",this.trigger.bind(this,"partialdone")),e.on("done",this.trigger.bind(this,"done"))}),this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};me.prototype=new pe,me.prototype.push=function(e){var t,n,r;if("sei_rbsp"===e.nalUnitType&&(t=ge.parseSei(e.escapedRBSP)).payload&&t.payloadType===ge.USER_DATA_REGISTERED_ITU_T_T35&&(n=ge.parseUserData(t)))if(e.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));r=ge.parseCaptionPackets(e.pts,n),this.captionPackets_=this.captionPackets_.concat(r),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},me.prototype.flushCCStreams=function(e){this.ccStreams_.forEach((function(t){return"flush"===e?t.flush():t.partialFlush()}),this)},me.prototype.flushStream=function(e){this.captionPackets_.length?(this.captionPackets_.forEach((function(e,t){e.presortIndex=t})),this.captionPackets_.sort((function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts})),this.captionPackets_.forEach((function(e){e.type<2?this.dispatchCea608Packet(e):this.dispatchCea708Packet(e)}),this),this.captionPackets_.length=0,this.flushCCStreams(e)):this.flushCCStreams(e)},me.prototype.flush=function(){return this.flushStream("flush")},me.prototype.partialFlush=function(){return this.flushStream("partialFlush")},me.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset()}))},me.prototype.dispatchCea608Packet=function(e){this.setsTextOrXDSActive(e)?this.activeCea608Channel_[e.type]=null:this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},me.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},me.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)},me.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)},me.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)};var ye={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},ve=function(e){return 32<=e&&e<=127||160<=e&&e<=255},_e=function(e){this.windowNum=e,this.reset()};_e.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},_e.prototype.getText=function(){return this.rows.join("\n")},_e.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},_e.prototype.newLine=function(e){for(this.rows.length>=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},_e.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},_e.prototype.addText=function(e){this.rows[this.rowIdx]+=e},_e.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var Te=function(e,t,n){this.serviceNum=e,this.text="",this.currentWindow=new _e(-1),this.windows=[],this.stream=n,"string"==typeof t&&this.createTextDecoder(t)};Te.prototype.init=function(e,t){this.startPts=e;for(var n=0;n<8;n++)this.windows[n]=new _e(n),"function"==typeof t&&(this.windows[n].beforeRowOverflow=t)},Te.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},Te.prototype.createTextDecoder=function(e){if("undefined"==typeof TextDecoder)this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(e)}catch(t){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+e+" encoding. "+t})}};var be=function(e){e=e||{},be.prototype.init.call(this);var t,n=this,r=e.captionServices||{},i={};Object.keys(r).forEach((e=>{t=r[e],/^SERVICE/.test(e)&&(i[e]=t.encoding)})),this.serviceEncodings=i,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(n.new708Packet(),n.add708Bytes(e)):(null===n.current708Packet&&n.new708Packet(),n.add708Bytes(e))}};be.prototype=new pe,be.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},be.prototype.add708Bytes=function(e){var t=e.ccData,n=t>>>8,r=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(n),this.current708Packet.data.push(r)},be.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,n=null,r=null,i=0,a=t[i++];for(e.seq=a>>6,e.sizeCode=63&a;i<t.length;i++)r=31&(a=t[i++]),7==(n=a>>5)&&r>0&&(n=a=t[i++]),this.pushServiceBlock(n,i,r),r>0&&(i+=r-1)},be.prototype.pushServiceBlock=function(e,t,n){var r,i=t,a=this.current708Packet.data,s=this.services[e];for(s||(s=this.initService(e,i));i<t+n&&i<a.length;i++)r=a[i],ve(r)?i=this.handleText(i,s):24===r?i=this.multiByteCharacter(i,s):16===r?i=this.extendedCommands(i,s):128<=r&&r<=135?i=this.setCurrentWindow(i,s):152<=r&&r<=159?i=this.defineWindow(i,s):136===r?i=this.clearWindows(i,s):140===r?i=this.deleteWindows(i,s):137===r?i=this.displayWindows(i,s):138===r?i=this.hideWindows(i,s):139===r?i=this.toggleWindows(i,s):151===r?i=this.setWindowAttributes(i,s):144===r?i=this.setPenAttributes(i,s):145===r?i=this.setPenColor(i,s):146===r?i=this.setPenLocation(i,s):143===r?s=this.reset(i,s):8===r?s.currentWindow.backspace():12===r?s.currentWindow.clearText():13===r?s.currentWindow.pendingNewLine=!0:14===r?s.currentWindow.clearText():141===r&&i++},be.prototype.extendedCommands=function(e,t){var n=this.current708Packet.data[++e];return ve(n)&&(e=this.handleText(e,t,{isExtended:!0})),e},be.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},be.prototype.initService=function(e,t){var n,r,i=this;return(n="SERVICE"+e)in this.serviceEncodings&&(r=this.serviceEncodings[n]),this.services[e]=new Te(e,r,i),this.services[e].init(this.getPts(t),(function(t){i.flushDisplayed(t,i.services[e])})),this.services[e]},be.prototype.handleText=function(e,t,n){var r,i,a,s,o=n&&n.isExtended,u=n&&n.isMultiByte,l=this.current708Packet.data,c=o?4096:0,d=l[e],f=l[e+1],h=t.currentWindow;if(u?(i=[d,f],e++):i=[d],t.textDecoder_&&!o)r=t.textDecoder_.decode(new Uint8Array(i));else if(u){const e=i.map((e=>("0"+(255&e).toString(16)).slice(-2))).join("");r=String.fromCharCode(parseInt(e,16))}else s=ye[a=c|d]||a,r=4096&a&&a===s?"":String.fromCharCode(s);return h.pendingNewLine&&!h.isEmpty()&&h.newLine(this.getPts(e)),h.pendingNewLine=!1,h.addText(r),e},be.prototype.multiByteCharacter=function(e,t){var n=this.current708Packet.data,r=n[e+1],i=n[e+2];return ve(r)&&ve(i)&&(e=this.handleText(++e,t,{isMultiByte:!0})),e},be.prototype.setCurrentWindow=function(e,t){var n=7&this.current708Packet.data[e];return t.setCurrentWindow(n),e},be.prototype.defineWindow=function(e,t){var n=this.current708Packet.data,r=n[e],i=7&r;t.setCurrentWindow(i);var a=t.currentWindow;return r=n[++e],a.visible=(32&r)>>5,a.rowLock=(16&r)>>4,a.columnLock=(8&r)>>3,a.priority=7&r,r=n[++e],a.relativePositioning=(128&r)>>7,a.anchorVertical=127&r,r=n[++e],a.anchorHorizontal=r,r=n[++e],a.anchorPoint=(240&r)>>4,a.rowCount=15&r,r=n[++e],a.columnCount=63&r,r=n[++e],a.windowStyle=(56&r)>>3,a.penStyle=7&r,a.virtualRowCount=a.rowCount+1,e},be.prototype.setWindowAttributes=function(e,t){var n=this.current708Packet.data,r=n[e],i=t.currentWindow.winAttr;return r=n[++e],i.fillOpacity=(192&r)>>6,i.fillRed=(48&r)>>4,i.fillGreen=(12&r)>>2,i.fillBlue=3&r,r=n[++e],i.borderType=(192&r)>>6,i.borderRed=(48&r)>>4,i.borderGreen=(12&r)>>2,i.borderBlue=3&r,r=n[++e],i.borderType+=(128&r)>>5,i.wordWrap=(64&r)>>6,i.printDirection=(48&r)>>4,i.scrollDirection=(12&r)>>2,i.justify=3&r,r=n[++e],i.effectSpeed=(240&r)>>4,i.effectDirection=(12&r)>>2,i.displayEffect=3&r,e},be.prototype.flushDisplayed=function(e,t){for(var n=[],r=0;r<8;r++)t.windows[r].visible&&!t.windows[r].isEmpty()&&n.push(t.windows[r].getText());t.endPts=e,t.text=n.join("\n\n"),this.pushCaption(t),t.startPts=e},be.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},be.prototype.displayWindows=function(e,t){var n=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var i=0;i<8;i++)n&1<<i&&(t.windows[i].visible=1);return e},be.prototype.hideWindows=function(e,t){var n=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var i=0;i<8;i++)n&1<<i&&(t.windows[i].visible=0);return e},be.prototype.toggleWindows=function(e,t){var n=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var i=0;i<8;i++)n&1<<i&&(t.windows[i].visible^=1);return e},be.prototype.clearWindows=function(e,t){var n=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var i=0;i<8;i++)n&1<<i&&t.windows[i].clearText();return e},be.prototype.deleteWindows=function(e,t){var n=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var i=0;i<8;i++)n&1<<i&&t.windows[i].reset();return e},be.prototype.setPenAttributes=function(e,t){var n=this.current708Packet.data,r=n[e],i=t.currentWindow.penAttr;return r=n[++e],i.textTag=(240&r)>>4,i.offset=(12&r)>>2,i.penSize=3&r,r=n[++e],i.italics=(128&r)>>7,i.underline=(64&r)>>6,i.edgeType=(56&r)>>3,i.fontStyle=7&r,e},be.prototype.setPenColor=function(e,t){var n=this.current708Packet.data,r=n[e],i=t.currentWindow.penColor;return r=n[++e],i.fgOpacity=(192&r)>>6,i.fgRed=(48&r)>>4,i.fgGreen=(12&r)>>2,i.fgBlue=3&r,r=n[++e],i.bgOpacity=(192&r)>>6,i.bgRed=(48&r)>>4,i.bgGreen=(12&r)>>2,i.bgBlue=3&r,r=n[++e],i.edgeRed=(48&r)>>4,i.edgeGreen=(12&r)>>2,i.edgeBlue=3&r,e},be.prototype.setPenLocation=function(e,t){var n=this.current708Packet.data,r=n[e],i=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,r=n[++e],i.row=15&r,r=n[++e],i.column=63&r,e},be.prototype.reset=function(e,t){var n=this.getPts(e);return this.flushDisplayed(n,t),this.initService(t.serviceNum,e)};var Ee={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Se=function(e){return null===e?"":(e=Ee[e]||e,String.fromCharCode(e))},we=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Ae=function(){for(var e=[],t=15;t--;)e.push({text:"",indent:0,offset:0});return e},Ie=function(e,t){Ie.prototype.init.call(this),this.field_=e||0,this.dataChannel_=t||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,n,r,i,a;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),r=t>>>8,i=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),n=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=n,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=Ae();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Ae();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Ae()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(r,i))a=Se((r=(3&r)<<8)|i),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(r,i))"popOn"===this.mode_?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),a=Se((r=(3&r)<<8)|i),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(r,i))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&i)&&this.addFormatting(e.pts,["i"]),1==(1&i)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(r,i)){const e=3&i;this.nonDisplayed_[this.row_].offset=e,this.column_+=e}else if(this.isPAC(r,i)){var s=we.indexOf(7968&t);if("rollUp"===this.mode_&&(s-this.rollUpRows_+1<0&&(s=this.rollUpRows_-1),this.setRollUp(e.pts,s)),s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&i&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&t)){const e=(14&t)>>1;this.column_=4*e,this.nonDisplayed_[this.row_].indent+=e}this.isColorPAC(i)&&14==(14&i)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(r)&&(0===i&&(i=null),a=Se(r),a+=Se(i),this[this.mode_](e.pts,a),this.column_+=a.length)}else this.lastControlCode_=null}};Ie.prototype=new pe,Ie.prototype.flushDisplayed=function(e){const t=e=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+e+"."})},n=[];this.displayed_.forEach(((e,r)=>{if(e&&e.text&&e.text.length){try{e.text=e.text.trim()}catch(e){t(r)}e.text.length&&n.push({text:e.text,line:r+1,position:10+Math.min(70,10*e.indent)+2.5*e.offset})}else null==e&&t(r)})),n.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,content:n,stream:this.name_})},Ie.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Ae(),this.nonDisplayed_=Ae(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},Ie.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},Ie.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},Ie.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},Ie.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},Ie.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},Ie.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},Ie.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},Ie.prototype.isNormalChar=function(e){return e>=32&&e<=127},Ie.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Ae(),this.displayed_=Ae()),void 0!==t&&t!==this.row_)for(var n=0;n<this.rollUpRows_;n++)this.displayed_[t-n]=this.displayed_[this.row_-n],this.displayed_[this.row_-n]={text:"",indent:0,offset:0};void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},Ie.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var n=t.reduce((function(e,t){return e+"<"+t+">"}),"");this[this.mode_](e,n)},Ie.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce((function(e,t){return e+"</"+t+">"}),"");this.formatting_=[],this[this.mode_](e,t)}},Ie.prototype.popOn=function(e,t){var n=this.nonDisplayed_[this.row_].text;n+=t,this.nonDisplayed_[this.row_].text=n},Ie.prototype.rollUp=function(e,t){var n=this.displayed_[this.row_].text;n+=t,this.displayed_[this.row_].text=n},Ie.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]={text:"",indent:0,offset:0};for(e=this.row_+1;e<15;e++)this.displayed_[e]={text:"",indent:0,offset:0};for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},Ie.prototype.paintOn=function(e,t){var n=this.displayed_[this.row_].text;n+=t,this.displayed_[this.row_].text=n};var Ce={CaptionStream:me,Cea608Stream:Ie,Cea708Stream:be},Re={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},De=G,xe="shared",Ne=function(e,t){var n=1;for(e>t&&(n=-1);Math.abs(t-e)>4294967296;)e+=8589934592*n;return e},Oe=function(e){var t,n;Oe.prototype.init.call(this),this.type_=e||xe,this.push=function(e){"metadata"!==e.type?this.type_!==xe&&e.type!==this.type_||(void 0===n&&(n=e.dts),e.dts=Ne(e.dts,n),e.pts=Ne(e.pts,n),t=e.dts,this.trigger("data",e)):this.trigger("data",e)},this.flush=function(){n=t,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){n=void 0,t=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Oe.prototype=new De;var Pe,Me={TimestampRolloverStream:Oe,handleRollover:Ne},ke=(e,t,n)=>{if(!e)return-1;for(var r=n;r<e.length;r++)if(e[r]===t)return r;return-1},Le=function(e,t,n){var r,i="";for(r=t;r<n;r++)i+="%"+("00"+e[r].toString(16)).slice(-2);return i},Fe=function(e,t,n){return decodeURIComponent(Le(e,t,n))},Ue=function(e,t,n){return unescape(Le(e,t,n))},Be=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},je={APIC:function(e){var t,n,r=1;3===e.data[0]&&((t=ke(e.data,0,r))<0||(e.mimeType=Ue(e.data,r,t),r=t+1,e.pictureType=e.data[r],r++,(n=ke(e.data,0,r))<0||(e.description=Fe(e.data,r,n),r=n+1,"--\x3e"===e.mimeType?e.url=Ue(e.data,r,e.data.length):e.pictureData=e.data.subarray(r,e.data.length))))},"T*":function(e){3===e.data[0]&&(e.value=Fe(e.data,1,e.data.length).replace(/\0*$/,""),e.values=e.value.split("\0"))},TXXX:function(e){var t;3===e.data[0]&&-1!==(t=ke(e.data,0,1))&&(e.description=Fe(e.data,1,t),e.value=Fe(e.data,t+1,e.data.length).replace(/\0*$/,""),e.data=e.value)},"W*":function(e){e.url=Ue(e.data,0,e.data.length).replace(/\0.*$/,"")},WXXX:function(e){var t;3===e.data[0]&&-1!==(t=ke(e.data,0,1))&&(e.description=Fe(e.data,1,t),e.url=Ue(e.data,t+1,e.data.length).replace(/\0.*$/,""))},PRIV:function(e){var t;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=Ue(e.data,0,t);break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}},qe={parseId3Frames:function(e){var t,n=10,r=0,i=[];if(!(e.length<10||e[0]!=="I".charCodeAt(0)||e[1]!=="D".charCodeAt(0)||e[2]!=="3".charCodeAt(0))){r=Be(e.subarray(6,10)),r+=10,64&e[5]&&(n+=4,n+=Be(e.subarray(10,14)),r-=Be(e.subarray(16,20)));do{if((t=Be(e.subarray(n+4,n+8)))<1)break;var a={id:String.fromCharCode(e[n],e[n+1],e[n+2],e[n+3]),data:e.subarray(n+10,n+t+10)};a.key=a.id,je[a.id]?je[a.id](a):"T"===a.id[0]?je["T*"](a):"W"===a.id[0]&&je["W*"](a),i.push(a),n+=10,n+=t}while(n<r);return i}},parseSyncSafeInteger:Be,frameParsers:je},He=Re,Ge=qe;(Pe=function(e){var t,n={descriptor:e&&e.descriptor},r=0,i=[],a=0;if(Pe.prototype.init.call(this),this.dispatchType=He.METADATA_STREAM_TYPE.toString(16),n.descriptor)for(t=0;t<n.descriptor.length;t++)this.dispatchType+=("00"+n.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,n,s,o,u;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(a=0,i.length=0),0===i.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});else if(i.push(e),a+=e.data.byteLength,1===i.length&&(r=Ge.parseSyncSafeInteger(e.data.subarray(6,10)),r+=10),!(a<r)){for(t={data:new Uint8Array(r),frames:[],pts:i[0].pts,dts:i[0].dts},u=0;u<r;)t.data.set(i[0].data.subarray(0,r-u),u),u+=i[0].data.byteLength,a-=i[0].data.byteLength,i.shift();n=10,64&t.data[5]&&(n+=4,n+=Ge.parseSyncSafeInteger(t.data.subarray(10,14)),r-=Ge.parseSyncSafeInteger(t.data.subarray(16,20)));do{if((s=Ge.parseSyncSafeInteger(t.data.subarray(n+4,n+8)))<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if((o={id:String.fromCharCode(t.data[n],t.data[n+1],t.data[n+2],t.data[n+3]),data:t.data.subarray(n+10,n+s+10)}).key=o.id,Ge.frameParsers[o.id]?Ge.frameParsers[o.id](o):"T"===o.id[0]?Ge.frameParsers["T*"](o):"W"===o.id[0]&&Ge.frameParsers["W*"](o),"com.apple.streaming.transportStreamTimestamp"===o.owner){var l=o.data,c=(1&l[3])<<30|l[4]<<22|l[5]<<14|l[6]<<6|l[7]>>>2;c*=4,c+=3&l[7],o.timeStamp=c,void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o)}t.frames.push(o),n+=10,n+=s}while(n<r);this.trigger("data",t)}}}).prototype=new G;var Ve,Ye,ze,Ze=Pe,Ke=G,We=Ce,Xe=Re,$e=Me.TimestampRolloverStream,Qe=188;(Ve=function(){var e=new Uint8Array(Qe),t=0;Ve.prototype.init.call(this),this.push=function(n){var r,i=0,a=Qe;for(t?((r=new Uint8Array(n.byteLength+t)).set(e.subarray(0,t)),r.set(n,t),t=0):r=n;a<r.byteLength;)71!==r[i]||71!==r[a]?(i++,a++):(this.trigger("data",r.subarray(i,a)),i+=Qe,a+=Qe);i<r.byteLength&&(e.set(r.subarray(i),0),t=r.byteLength-i)},this.flush=function(){t===Qe&&71===e[0]&&(this.trigger("data",e),t=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){t=0,this.trigger("reset")}}).prototype=new Ke,(Ye=function(){var e,t,n,r;Ye.prototype.init.call(this),r=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,r){var i=0;r.payloadUnitStartIndicator&&(i+=e[i]+1),"pat"===r.type?t(e.subarray(i),r):n(e.subarray(i),r)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],r.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=r.pmtPid},n=function(e,t){var n,i;if(1&e[5]){for(r.programMapTable={video:null,audio:null,"timed-metadata":{}},n=3+((15&e[1])<<8|e[2])-4,i=12+((15&e[10])<<8|e[11]);i<n;){var a=e[i],s=(31&e[i+1])<<8|e[i+2];a===Xe.H264_STREAM_TYPE&&null===r.programMapTable.video?r.programMapTable.video=s:a===Xe.ADTS_STREAM_TYPE&&null===r.programMapTable.audio?r.programMapTable.audio=s:a===Xe.METADATA_STREAM_TYPE&&(r.programMapTable["timed-metadata"][s]=a),i+=5+((15&e[i+3])<<8|e[i+4])}t.programMapTable=r.programMapTable}},this.push=function(t){var n={},r=4;if(n.payloadUnitStartIndicator=!!(64&t[1]),n.pid=31&t[1],n.pid<<=8,n.pid|=t[2],(48&t[3])>>>4>1&&(r+=t[r]+1),0===n.pid)n.type="pat",e(t.subarray(r),n),this.trigger("data",n);else if(n.pid===this.pmtPid)for(n.type="pmt",e(t.subarray(r),n),this.trigger("data",n);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,r,n]):this.processPes_(t,r,n)},this.processPes_=function(e,t,n){n.pid===this.programMapTable.video?n.streamType=Xe.H264_STREAM_TYPE:n.pid===this.programMapTable.audio?n.streamType=Xe.ADTS_STREAM_TYPE:n.streamType=this.programMapTable["timed-metadata"][n.pid],n.type="pes",n.data=e.subarray(t),this.trigger("data",n)}}).prototype=new Ke,Ye.STREAM_TYPES={h264:27,adts:15},ze=function(){var e,t=this,n=!1,r={data:[],size:0},i={data:[],size:0},a={data:[],size:0},s=function(e,n,r){var i,a,s=new Uint8Array(e.size),o={type:n},u=0,l=0;if(e.data.length&&!(e.size<9)){for(o.trackId=e.data[0].pid,u=0;u<e.data.length;u++)a=e.data[u],s.set(a.data,l),l+=a.data.byteLength;!function(e,t){var n;const r=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array,1===r&&(t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=0!=(4&e[6]),192&(n=e[7])&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&n&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8]))}(s,o),i="video"===n||o.packetLength<=e.size,(r||i)&&(e.size=0,e.data.length=0),i&&t.trigger("data",o)}};ze.prototype.init.call(this),this.push=function(o){({pat:function(){},pes:function(){var e,t;switch(o.streamType){case Xe.H264_STREAM_TYPE:e=r,t="video";break;case Xe.ADTS_STREAM_TYPE:e=i,t="audio";break;case Xe.METADATA_STREAM_TYPE:e=a,t="timed-metadata";break;default:return}o.payloadUnitStartIndicator&&s(e,t,!0),e.data.push(o),e.size+=o.data.byteLength},pmt:function(){var r={type:"metadata",tracks:[]};null!==(e=o.programMapTable).video&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),n=!0,t.trigger("data",r)}})[o.type]()},this.reset=function(){r.size=0,r.data.length=0,i.size=0,i.data.length=0,this.trigger("reset")},this.flushStreams_=function(){s(r,"video"),s(i,"audio"),s(a,"timed-metadata")},this.flush=function(){if(!n&&e){var r={type:"metadata",tracks:[]};null!==e.video&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",r)}n=!1,this.flushStreams_(),this.trigger("done")}},ze.prototype=new Ke;var Je={PAT_PID:0,MP2T_PACKET_LENGTH:Qe,TransportPacketStream:Ve,TransportParseStream:Ye,ElementaryStream:ze,TimestampRolloverStream:$e,CaptionStream:We.CaptionStream,Cea608Stream:We.Cea608Stream,Cea708Stream:We.Cea708Stream,MetadataStream:Ze};for(var et in Xe)Xe.hasOwnProperty(et)&&(Je[et]=Xe[et]);var tt,nt=Je,rt=ue.ONE_SECOND_IN_TS,it=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(tt=function(e){var t,n=0;tt.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:`adts skiping bytes ${e} to ${t} in frame ${n} outside syncword`})},this.push=function(r){var i,a,s,o,u,l=0;if(e||(n=0),"audio"===r.type){var c;for(t&&t.length?(s=t,(t=new Uint8Array(s.byteLength+r.data.byteLength)).set(s),t.set(r.data,s.byteLength)):t=r.data;l+7<t.length;)if(255===t[l]&&240==(246&t[l+1])){if("number"==typeof c&&(this.skipWarn_(c,l),c=null),a=2*(1&~t[l+1]),i=(3&t[l+3])<<11|t[l+4]<<3|(224&t[l+5])>>5,u=(o=1024*(1+(3&t[l+6])))*rt/it[(60&t[l+2])>>>2],t.byteLength-l<i)break;this.trigger("data",{pts:r.pts+n*u,dts:r.dts+n*u,sampleCount:o,audioobjecttype:1+(t[l+2]>>>6&3),channelcount:(1&t[l+2])<<2|(192&t[l+3])>>>6,samplerate:it[(60&t[l+2])>>>2],samplingfrequencyindex:(60&t[l+2])>>>2,samplesize:16,data:t.subarray(l+7+a,l+i)}),n++,l+=i}else"number"!=typeof c&&(c=l),l++;"number"==typeof c&&(this.skipWarn_(c,l),c=null),t=t.subarray(l)}},this.flush=function(){n=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}}).prototype=new G;var at,st,ot,ut=tt,lt=G,ct=function(e){var t=e.byteLength,n=0,r=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+r},this.loadWord=function(){var i=e.byteLength-t,a=new Uint8Array(4),s=Math.min(4,t);if(0===s)throw new Error("no bytes available");a.set(e.subarray(i,i+s)),n=new DataView(a.buffer).getUint32(0),r=8*s,t-=s},this.skipBits=function(e){var i;r>e?(n<<=e,r-=e):(e-=r,e-=8*(i=Math.floor(e/8)),t-=i,this.loadWord(),n<<=e,r-=e)},this.readBits=function(e){var i=Math.min(r,e),a=n>>>32-i;return(r-=i)>0?n<<=i:t>0&&this.loadWord(),(i=e-i)>0?a<<i|this.readBits(i):a},this.skipLeadingZeros=function(){var e;for(e=0;e<r;++e)if(0!=(n&2147483648>>>e))return n<<=e,r-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};(st=function(){var e,t,n=0;st.prototype.init.call(this),this.push=function(r){var i;t?((i=new Uint8Array(t.byteLength+r.data.byteLength)).set(t),i.set(r.data,t.byteLength),t=i):t=r.data;for(var a=t.byteLength;n<a-3;n++)if(1===t[n+2]){e=n+5;break}for(;e<a;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}n+3!==e-2&&this.trigger("data",t.subarray(n+3,e-2));do{e++}while(1!==t[e]&&e<a);n=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(n+3,e-2)),n=e-2,e+=3;break;default:e+=3}t=t.subarray(n),e-=n,n=0},this.reset=function(){t=null,n=0,this.trigger("reset")},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(n+3)),t=null,n=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}}).prototype=new lt,ot={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},at=function(){var e,t,n,r,i,a,s,o=new st;at.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,n=e.pts,r=e.dts,o.push(e))},o.on("data",(function(s){var o={trackId:t,pts:n,dts:r,data:s,nalUnitTypeCode:31&s[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=i(s.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=i(s.subarray(1)),o.config=a(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",o)})),o.on("done",(function(){e.trigger("done")})),o.on("partialdone",(function(){e.trigger("partialdone")})),o.on("reset",(function(){e.trigger("reset")})),o.on("endedtimeline",(function(){e.trigger("endedtimeline")})),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},s=function(e,t){var n,r=8,i=8;for(n=0;n<e;n++)0!==i&&(i=(r+t.readExpGolomb()+256)%256),r=0===i?r:i},i=function(e){for(var t,n,r=e.byteLength,i=[],a=1;a<r-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(i.push(a+2),a+=2):a++;if(0===i.length)return e;t=r-i.length,n=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===i[0]&&(s++,i.shift()),n[a]=e[s];return n},a=function(e){var t,n,r,i,a,o,u,l,c,d,f,h,p=0,g=0,m=0,y=0,v=[1,1];if(n=(t=new ct(e)).readUnsignedByte(),i=t.readUnsignedByte(),r=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),ot[n]&&(3===(a=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(f=3!==a?8:12,h=0;h<f;h++)t.readBoolean()&&s(h<6?16:64,t);if(t.skipUnsignedExpGolomb(),0===(o=t.readUnsignedExpGolomb()))t.readUnsignedExpGolomb();else if(1===o)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),u=t.readUnsignedExpGolomb(),h=0;h<u;h++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),l=t.readUnsignedExpGolomb(),c=t.readUnsignedExpGolomb(),0===(d=t.readBits(1))&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(p=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),m=t.readUnsignedExpGolomb(),y=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:v=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}v&&(v[0],v[1])}return{profileIdc:n,levelIdc:r,profileCompatibility:i,width:16*(l+1)-2*p-2*g,height:(2-d)*(c+1)*16-2*m-2*y,sarRatio:v}}},at.prototype=new lt;var dt,ft={H264Stream:at,NalByteStream:st},ht=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],pt=function(e,t){var n=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return n=n>=0?n:0,(16&e[t+5])>>4?n+20:n+10},gt=function(e,t){return e.length-t<10||e[t]!=="I".charCodeAt(0)||e[t+1]!=="D".charCodeAt(0)||e[t+2]!=="3".charCodeAt(0)?t:(t+=pt(e,t),gt(e,t))},mt=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},yt={isLikelyAacData:function(e){var t=gt(e,0);return e.length>=t+2&&255==(255&e[t])&&240==(240&e[t+1])&&16==(22&e[t+1])},parseId3TagSize:pt,parseAdtsSize:function(e,t){var n=(224&e[t+5])>>5,r=e[t+4]<<3;return 6144&e[t+3]|r|n},parseType:function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240==(240&e[t+1])?"audio":null},parseSampleRate:function(e){for(var t=0;t+5<e.length;){if(255===e[t]&&240==(246&e[t+1]))return ht[(60&e[t+2])>>>2];t++}return null},parseAacTimestamp:function(e){var t,n,r;t=10,64&e[5]&&(t+=4,t+=mt(e.subarray(10,14)));do{if((n=mt(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){r=e.subarray(t+10,t+n+10);for(var i=0;i<r.byteLength;i++)if(0===r[i]){var a=unescape(function(e,t,n){var r,i="";for(r=0;r<n;r++)i+="%"+("00"+e[r].toString(16)).slice(-2);return i}(r,0,i));if("com.apple.streaming.transportStreamTimestamp"===a){var s=r.subarray(i+1),o=(1&s[3])<<30|s[4]<<22|s[5]<<14|s[6]<<6|s[7]>>>2;return(o*=4)+(3&s[7])}break}}t+=10,t+=n}while(t<e.byteLength);return null}},vt=yt;(dt=function(){var e=new Uint8Array,t=0;dt.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(n){var r,i,a,s,o=0,u=0;for(e.length?(s=e.length,(e=new Uint8Array(n.byteLength+s)).set(e.subarray(0,s)),e.set(n,s)):e=n;e.length-u>=3;)if(e[u]!=="I".charCodeAt(0)||e[u+1]!=="D".charCodeAt(0)||e[u+2]!=="3".charCodeAt(0))if(255!=(255&e[u])||240!=(240&e[u+1]))u++;else{if(e.length-u<7)break;if(u+(o=vt.parseAdtsSize(e,u))>e.length)break;a={type:"audio",data:e.subarray(u,u+o),pts:t,dts:t},this.trigger("data",a),u+=o}else{if(e.length-u<10)break;if(u+(o=vt.parseId3TagSize(e,u))>e.length)break;i={type:"timed-metadata",data:e.subarray(u,u+o)},this.trigger("data",i),u+=o}r=e.length-u,e=r>0?e.subarray(u):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new G;var _t,Tt,bt,Et,St=G,wt=te,At=re,It=ce,Ct=fe,Rt=nt,Dt=ue,xt=ut,Nt=ft.H264Stream,Ot=dt,Pt=yt.isLikelyAacData,Mt=ue.ONE_SECOND_IN_TS,kt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Lt=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Ft=function(e,t){t.stream=e,this.trigger("log",t)},Ut=function(e,t){for(var n=Object.keys(t),r=0;r<n.length;r++){var i=n[r];"headOfPipeline"!==i&&t[i].on&&t[i].on("log",Ft.bind(e,i))}},Bt=function(e,t){var n;if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0},jt=function(e,t,n,r,i,a){return{start:{dts:e,pts:e+(n-t)},end:{dts:e+(r-t),pts:e+(i-n)},prependedContentDuration:a,baseMediaDecodeTime:e}};Tt=function(e,t){var n,r=[],i=0,a=0,s=1/0;n=(t=t||{}).firstSequenceNumber||0,Tt.prototype.init.call(this),this.push=function(t){Ct.collectDtsInfo(e,t),e&&kt.forEach((function(n){e[n]=t[n]})),r.push(t)},this.setEarliestDts=function(e){i=e},this.setVideoBaseMediaDecodeTime=function(e){s=e},this.setAudioAppendStart=function(e){a=e},this.flush=function(){var o,u,l,c,d,f,h;0!==r.length?(o=It.trimAdtsFramesByEarliestDts(r,e,i),e.baseMediaDecodeTime=Ct.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),h=It.prefixWithSilence(e,o,a,s),e.samples=It.generateSampleTable(o),l=wt.mdat(It.concatenateFrameData(o)),r=[],u=wt.moof(n,[e]),c=new Uint8Array(u.byteLength+l.byteLength),n++,c.set(u),c.set(l,u.byteLength),Ct.clearDtsInfo(e),d=Math.ceil(1024*Mt/e.samplerate),o.length&&(f=o.length*d,this.trigger("segmentTimingInfo",jt(Dt.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+f,o[0].pts+f,h||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+f})),this.trigger("data",{track:e,boxes:c}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.reset=function(){Ct.clearDtsInfo(e),r=[],this.trigger("reset")}},Tt.prototype=new St,_t=function(e,t){var n,r,i,a=[],s=[];n=(t=t||{}).firstSequenceNumber||0,_t.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){Ct.collectDtsInfo(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||r||(r=t.config,e.sps=[t.data],Lt.forEach((function(t){e[t]=r[t]}),this)),"pic_parameter_set_rbsp"!==t.nalUnitType||i||(i=t.data,e.pps=[t.data]),a.push(t)},this.flush=function(){for(var r,i,o,u,l,c,d,f,h=0;a.length&&"access_unit_delimiter_rbsp"!==a[0].nalUnitType;)a.shift();if(0===a.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(r=At.groupNalsIntoFrames(a),(o=At.groupFramesIntoGops(r))[0][0].keyFrame||((i=this.getGopForFusion_(a[0],e))?(h=i.duration,o.unshift(i),o.byteLength+=i.byteLength,o.nalCount+=i.nalCount,o.pts=i.pts,o.dts=i.dts,o.duration+=i.duration):o=At.extendFirstKeyFrame(o)),s.length){var p;if(!(p=t.alignGopsAtEnd?this.alignGopsAtEnd_(o):this.alignGopsAtStart_(o)))return this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");Ct.clearDtsInfo(e),o=p}Ct.collectDtsInfo(e,o),e.samples=At.generateSampleTable(o),l=wt.mdat(At.concatenateNalData(o)),e.baseMediaDecodeTime=Ct.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),d=o[0],f=o[o.length-1],this.trigger("segmentTimingInfo",jt(e.baseMediaDecodeTime,d.dts,d.pts,f.dts+f.duration,f.pts+f.duration,h)),this.trigger("timingInfo",{start:o[0].pts,end:o[o.length-1].pts+o[o.length-1].duration}),this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),u=wt.moof(n,[e]),c=new Uint8Array(u.byteLength+l.byteLength),n++,c.set(u),c.set(l,u.byteLength),this.trigger("data",{track:e,boxes:c}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),a=[],this.gopCache_.length=0,s.length=0,this.trigger("reset")},this.resetStream_=function(){Ct.clearDtsInfo(e),r=void 0,i=void 0},this.getGopForFusion_=function(t){var n,r,i,a,s,o=1/0;for(s=0;s<this.gopCache_.length;s++)i=(a=this.gopCache_[s]).gop,e.pps&&Bt(e.pps[0],a.pps[0])&&e.sps&&Bt(e.sps[0],a.sps[0])&&(i.dts<e.timelineStartInfo.dts||(n=t.dts-i.dts-i.duration)>=-1e4&&n<=45e3&&(!r||o>n)&&(r=a,o=n));return r?r.gop:null},this.alignGopsAtStart_=function(e){var t,n,r,i,a,o,u,l;for(a=e.byteLength,o=e.nalCount,u=e.duration,t=n=0;t<s.length&&n<e.length&&(r=s[t],i=e[n],r.pts!==i.pts);)i.pts>r.pts?t++:(n++,a-=i.byteLength,o-=i.nalCount,u-=i.duration);return 0===n?e:n===e.length?null:((l=e.slice(n)).byteLength=a,l.duration=u,l.nalCount=o,l.pts=l[0].pts,l.dts=l[0].dts,l)},this.alignGopsAtEnd_=function(e){var t,n,r,i,a,o,u;for(t=s.length-1,n=e.length-1,a=null,o=!1;t>=0&&n>=0;){if(r=s[t],i=e[n],r.pts===i.pts){o=!0;break}r.pts>i.pts?t--:(t===s.length-1&&(a=n),n--)}if(!o&&null===a)return null;if(0===(u=o?n:a))return e;var l=e.slice(u),c=l.reduce((function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e}),{byteLength:0,duration:0,nalCount:0});return l.byteLength=c.byteLength,l.duration=c.duration,l.nalCount=c.nalCount,l.pts=l[0].pts,l.dts=l[0].dts,l},this.alignGopsWith=function(e){s=e}},_t.prototype=new St,Et=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,Et.prototype.init.call(this),this.push=function(e){return e.content||e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))))}},Et.prototype=new St,Et.prototype.flush=function(e){var t,n,r,i,a=0,s={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,Lt.forEach((function(e){s.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,kt.forEach((function(e){s.info[e]=this.audioTrack[e]}),this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,r=wt.initSegment(this.pendingTracks),s.initSegment=new Uint8Array(r.byteLength),s.initSegment.set(r),s.data=new Uint8Array(this.pendingBytes),i=0;i<this.pendingBoxes.length;i++)s.data.set(this.pendingBoxes[i],a),a+=this.pendingBoxes[i].byteLength;for(i=0;i<this.pendingCaptions.length;i++)(t=this.pendingCaptions[i]).startTime=Dt.metadataTsToSeconds(t.startPts,o,this.keepOriginalTimestamps),t.endTime=Dt.metadataTsToSeconds(t.endPts,o,this.keepOriginalTimestamps),s.captionStreams[t.stream]=!0,s.captions.push(t);for(i=0;i<this.pendingMetadata.length;i++)(n=this.pendingMetadata[i]).cueTime=Dt.metadataTsToSeconds(n.pts,o,this.keepOriginalTimestamps),s.metadata.push(n);for(s.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",s),i=0;i<s.captions.length;i++)t=s.captions[i],this.trigger("caption",t);for(i=0;i<s.metadata.length;i++)n=s.metadata[i],this.trigger("id3Frame",n)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},Et.prototype.setRemux=function(e){this.remuxTracks=e},(bt=function(e){var t,n,r=this,i=!0;bt.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var i={};this.transmuxPipeline_=i,i.type="aac",i.metadataStream=new Rt.MetadataStream,i.aacStream=new Ot,i.audioTimestampRolloverStream=new Rt.TimestampRolloverStream("audio"),i.timedMetadataTimestampRolloverStream=new Rt.TimestampRolloverStream("timed-metadata"),i.adtsStream=new xt,i.coalesceStream=new Et(e,i.metadataStream),i.headOfPipeline=i.aacStream,i.aacStream.pipe(i.audioTimestampRolloverStream).pipe(i.adtsStream),i.aacStream.pipe(i.timedMetadataTimestampRolloverStream).pipe(i.metadataStream).pipe(i.coalesceStream),i.metadataStream.on("timestamp",(function(e){i.aacStream.setTimestamp(e.timeStamp)})),i.aacStream.on("data",(function(a){"timed-metadata"!==a.type&&"audio"!==a.type||i.audioSegmentStream||(n=n||{timelineStartInfo:{baseMediaDecodeTime:r.baseMediaDecodeTime},codec:"adts",type:"audio"},i.coalesceStream.numberOfTracks++,i.audioSegmentStream=new Tt(n,e),i.audioSegmentStream.on("log",r.getLogTrigger_("audioSegmentStream")),i.audioSegmentStream.on("timingInfo",r.trigger.bind(r,"audioTimingInfo")),i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream),r.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!t}))})),i.coalesceStream.on("data",this.trigger.bind(this,"data")),i.coalesceStream.on("done",this.trigger.bind(this,"done")),Ut(this,i)},this.setupTsPipeline=function(){var i={};this.transmuxPipeline_=i,i.type="ts",i.metadataStream=new Rt.MetadataStream,i.packetStream=new Rt.TransportPacketStream,i.parseStream=new Rt.TransportParseStream,i.elementaryStream=new Rt.ElementaryStream,i.timestampRolloverStream=new Rt.TimestampRolloverStream,i.adtsStream=new xt,i.h264Stream=new Nt,i.captionStream=new Rt.CaptionStream(e),i.coalesceStream=new Et(e,i.metadataStream),i.headOfPipeline=i.packetStream,i.packetStream.pipe(i.parseStream).pipe(i.elementaryStream).pipe(i.timestampRolloverStream),i.timestampRolloverStream.pipe(i.h264Stream),i.timestampRolloverStream.pipe(i.adtsStream),i.timestampRolloverStream.pipe(i.metadataStream).pipe(i.coalesceStream),i.h264Stream.pipe(i.captionStream).pipe(i.coalesceStream),i.elementaryStream.on("data",(function(a){var s;if("metadata"===a.type){for(s=a.tracks.length;s--;)t||"video"!==a.tracks[s].type?n||"audio"!==a.tracks[s].type||((n=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=r.baseMediaDecodeTime):(t=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=r.baseMediaDecodeTime;t&&!i.videoSegmentStream&&(i.coalesceStream.numberOfTracks++,i.videoSegmentStream=new _t(t,e),i.videoSegmentStream.on("log",r.getLogTrigger_("videoSegmentStream")),i.videoSegmentStream.on("timelineStartInfo",(function(t){n&&!e.keepOriginalTimestamps&&(n.timelineStartInfo=t,i.audioSegmentStream.setEarliestDts(t.dts-r.baseMediaDecodeTime))})),i.videoSegmentStream.on("processedGopsInfo",r.trigger.bind(r,"gopInfo")),i.videoSegmentStream.on("segmentTimingInfo",r.trigger.bind(r,"videoSegmentTimingInfo")),i.videoSegmentStream.on("baseMediaDecodeTime",(function(e){n&&i.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),i.videoSegmentStream.on("timingInfo",r.trigger.bind(r,"videoTimingInfo")),i.h264Stream.pipe(i.videoSegmentStream).pipe(i.coalesceStream)),n&&!i.audioSegmentStream&&(i.coalesceStream.numberOfTracks++,i.audioSegmentStream=new Tt(n,e),i.audioSegmentStream.on("log",r.getLogTrigger_("audioSegmentStream")),i.audioSegmentStream.on("timingInfo",r.trigger.bind(r,"audioTimingInfo")),i.audioSegmentStream.on("segmentTimingInfo",r.trigger.bind(r,"audioSegmentTimingInfo")),i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream)),r.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!t})}})),i.coalesceStream.on("data",this.trigger.bind(this,"data")),i.coalesceStream.on("id3Frame",(function(e){e.dispatchType=i.metadataStream.dispatchType,r.trigger("id3Frame",e)})),i.coalesceStream.on("caption",this.trigger.bind(this,"caption")),i.coalesceStream.on("done",this.trigger.bind(this,"done")),Ut(this,i)},this.setBaseMediaDecodeTime=function(r){var i=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=r),n&&(n.timelineStartInfo.dts=void 0,n.timelineStartInfo.pts=void 0,Ct.clearDtsInfo(n),i.audioTimestampRolloverStream&&i.audioTimestampRolloverStream.discontinuity()),t&&(i.videoSegmentStream&&(i.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,Ct.clearDtsInfo(t),i.captionStream.reset()),i.timestampRolloverStream&&i.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){n&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var n=this.transmuxPipeline_;e.remux=t,n&&n.coalesceStream&&n.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.getLogTrigger_=function(e){var t=this;return function(n){n.stream=e,t.trigger("log",n)}},this.push=function(e){if(i){var t=Pt(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),i=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){i=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new St;var qt,Ht,Gt,Vt,Yt={Transmuxer:bt,VideoSegmentStream:_t,AudioSegmentStream:Tt,AUDIO_PROPERTIES:kt,VIDEO_PROPERTIES:Lt,generateSegmentTimingInfo:jt},zt=function(e){return e>>>0},Zt=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),(t+=String.fromCharCode(e[2]))+String.fromCharCode(e[3])},Kt=zt,Wt=Zt,Xt=function(e,t){var n,r,i,a,s,o=[];if(!t.length)return null;for(n=0;n<e.byteLength;)r=Kt(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3]),i=Wt(e.subarray(n+4,n+8)),a=r>1?n+r:e.byteLength,i===t[0]&&(1===t.length?o.push(e.subarray(n+8,a)):(s=Xt(e.subarray(n+8,a),t.slice(1))).length&&(o=o.concat(s))),n=a;return o},$t=zt,Qt=Y.getUint64,Jt=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return 1===t.version?t.baseMediaDecodeTime=Qt(e.subarray(4)):t.baseMediaDecodeTime=$t(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t},en=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},tn=function(e){var t,n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},r=new DataView(e.buffer,e.byteOffset,e.byteLength),i=1&n.flags[2],a=4&n.flags[2],s=1&n.flags[1],o=2&n.flags[1],u=4&n.flags[1],l=8&n.flags[1],c=r.getUint32(4),d=8;for(i&&(n.dataOffset=r.getInt32(d),d+=4),a&&c&&(t={flags:en(e.subarray(d,d+4))},d+=4,s&&(t.duration=r.getUint32(d),d+=4),o&&(t.size=r.getUint32(d),d+=4),l&&(1===n.version?t.compositionTimeOffset=r.getInt32(d):t.compositionTimeOffset=r.getUint32(d),d+=4),n.samples.push(t),c--);c--;)t={},s&&(t.duration=r.getUint32(d),d+=4),o&&(t.size=r.getUint32(d),d+=4),u&&(t.flags=en(e.subarray(d,d+4)),d+=4),l&&(1===n.version?t.compositionTimeOffset=r.getInt32(d):t.compositionTimeOffset=r.getUint32(d),d+=4),n.samples.push(t);return n},nn=function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:n.getUint32(4)},i=1&r.flags[2],a=2&r.flags[2],s=8&r.flags[2],o=16&r.flags[2],u=32&r.flags[2],l=65536&r.flags[0],c=131072&r.flags[0];return t=8,i&&(t+=4,r.baseDataOffset=n.getUint32(12),t+=4),a&&(r.sampleDescriptionIndex=n.getUint32(t),t+=4),s&&(r.defaultSampleDuration=n.getUint32(t),t+=4),o&&(r.defaultSampleSize=n.getUint32(t),t+=4),u&&(r.defaultSampleFlags=n.getUint32(t)),l&&(r.durationIsEmpty=!0),!i&&c&&(r.baseDataOffsetIsMoof=!0),r},rn=(qt="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},he.discardEmulationPreventionBytes),an=Ce.CaptionStream,sn=Xt,on=Jt,un=tn,ln=nn,cn=qt,dn=function(e,t){for(var n=e,r=0;r<t.length;r++){var i=t[r];if(n<i.size)return i;n-=i.size}return null},fn=function(){var e,t,n,r,i,a,s=!1;this.isInitialized=function(){return s},this.init=function(t){e=new an,s=!0,a=!!t&&t.isPartial,e.on("data",(function(e){e.startTime=e.startPts/r,e.endTime=e.endPts/r,i.captions.push(e),i.captionStreams[e.stream]=!0})),e.on("log",(function(e){i.logs.push(e)}))},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length||n===e[0]&&r===t[n])},this.parse=function(e,a,s){var o;if(!this.isInitialized())return null;if(!a||!s)return null;if(this.isNewInit(a,s))n=a[0],r=s[n];else if(null===n||!r)return t.push(e),null;for(;t.length>0;){var u=t.shift();this.parse(u,a,s)}return o=function(e,t,n){if(null===t)return null;var r=function(e,t){var n=sn(e,["moof","traf"]),r=sn(e,["mdat"]),i={},a=[];return r.forEach((function(e,t){var r=n[t];a.push({mdat:e,traf:r})})),a.forEach((function(e){var n,r,a=e.mdat,s=e.traf,o=sn(s,["tfhd"]),u=ln(o[0]),l=u.trackId,c=sn(s,["tfdt"]),d=c.length>0?on(c[0]).baseMediaDecodeTime:0,f=sn(s,["trun"]);t===l&&f.length>0&&(n=function(e,t,n){var r=t,i=n.defaultSampleDuration||0,a=n.defaultSampleSize||0,s=n.trackId,o=[];return e.forEach((function(e){var t=un(e).samples;t.forEach((function(e){void 0===e.duration&&(e.duration=i),void 0===e.size&&(e.size=a),e.trackId=s,e.dts=r,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),"bigint"==typeof r?(e.pts=r+cn.BigInt(e.compositionTimeOffset),r+=cn.BigInt(e.duration)):(e.pts=r+e.compositionTimeOffset,r+=e.duration)})),o=o.concat(t)})),o}(f,d,u),r=function(e,t,n){var r,i,a,s,o=new DataView(e.buffer,e.byteOffset,e.byteLength),u={logs:[],seiNals:[]};for(i=0;i+4<e.length;i+=a)if(a=o.getUint32(i),i+=4,!(a<=0))switch(31&e[i]){case 6:var l=e.subarray(i+1,i+1+a),c=dn(i,t);if(r={nalUnitType:"sei_rbsp",size:a,data:l,escapedRBSP:rn(l),trackId:n},c)r.pts=c.pts,r.dts=c.dts,s=c;else{if(!s){u.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+i+" for trackId "+n+". See mux.js#223."});break}r.pts=s.pts,r.dts=s.dts}u.seiNals.push(r)}return u}(a,n,l),i[l]||(i[l]={seiNals:[],logs:[]}),i[l].seiNals=i[l].seiNals.concat(r.seiNals),i[l].logs=i[l].logs.concat(r.logs))})),i}(e,t)[t]||{};return{seiNals:r.seiNals,logs:r.logs,timescale:n}}(e,n,r),o&&o.logs&&(i.logs=i.logs.concat(o.logs)),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),i):i.logs.length?{logs:i.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach((function(t){e.push(t)}))},this.flushStream=function(){if(!this.isInitialized())return null;a?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){i.captions=[],i.captionStreams={},i.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],n=null,r=null,i?this.clearParsedCaptions():i={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},hn=function(e){for(var t=0,n=String.fromCharCode(e[t]),r="";"\0"!==n;)r+=n,t++,n=String.fromCharCode(e[t]);return r+n},pn=Y.getUint64,gn=function(e){return void 0!==e||null!==e},mn={parseEmsgBox:function(e){var t,n,r,i,a,s,o,u=4,l=e[0];if(0===l)u+=(t=hn(e.subarray(u))).length,u+=(n=hn(e.subarray(u))).length,r=(c=new DataView(e.buffer)).getUint32(u),u+=4,a=c.getUint32(u),u+=4,s=c.getUint32(u),u+=4,o=c.getUint32(u),u+=4;else if(1===l){var c;r=(c=new DataView(e.buffer)).getUint32(u),u+=4,i=pn(e.subarray(u)),u+=8,s=c.getUint32(u),u+=4,o=c.getUint32(u),u+=4,u+=(t=hn(e.subarray(u))).length,u+=(n=hn(e.subarray(u))).length}var d={scheme_id_uri:t,value:n,timescale:r||1,presentation_time:i,presentation_time_delta:a,event_duration:s,id:o,message_data:new Uint8Array(e.subarray(u,e.byteLength))};return function(e,t){var n="\0"!==t.scheme_id_uri,r=0===e&&gn(t.presentation_time_delta)&&n,i=1===e&&gn(t.presentation_time)&&n;return!(e>1)&&r||i}(l,d)?d:void 0},scaleTime:function(e,t,n,r){return e||0===e?e/t:r+n/t}},yn=zt,vn=function(e){return("00"+e.toString(16)).slice(-2)},_n=Xt,Tn=Zt,bn=mn,En=Y.getUint64,Sn=qt,wn=qe.parseId3Frames;Ht=function(e,t){var n=_n(t,["moof","traf"]).reduce((function(t,n){var r,i=_n(n,["tfhd"])[0],a=yn(i[4]<<24|i[5]<<16|i[6]<<8|i[7]),s=e[a]||9e4,o=_n(n,["tfdt"])[0],u=new DataView(o.buffer,o.byteOffset,o.byteLength);let l;return"bigint"==typeof(r=1===o[0]?En(o.subarray(4,12)):u.getUint32(4))?l=r/Sn.BigInt(s):"number"!=typeof r||isNaN(r)||(l=r/s),l<Number.MAX_SAFE_INTEGER&&(l=Number(l)),l<t&&(t=l),t}),1/0);return"bigint"==typeof n||isFinite(n)?n:0},Vt=function(e){var t=0===e[0]?12:20;return yn(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},Gt=function(e){var t=_n(e,["moov","trak"]),n=[];return t.forEach((function(e){var t,r,i={},a=_n(e,["tkhd"])[0];a&&(r=(t=new DataView(a.buffer,a.byteOffset,a.byteLength)).getUint8(0),i.id=0===r?t.getUint32(12):t.getUint32(20));var s=_n(e,["mdia","hdlr"])[0];if(s){var o=Tn(s.subarray(8,12));i.type="vide"===o?"video":"soun"===o?"audio":o}var u=_n(e,["mdia","minf","stbl","stsd"])[0];if(u){var l=u.subarray(8);i.codec=Tn(l.subarray(4,8));var c,d=_n(l,[i.codec])[0];d&&(/^[asm]vc[1-9]$/i.test(i.codec)?(c=d.subarray(78),"avcC"===Tn(c.subarray(4,8))&&c.length>11?(i.codec+=".",i.codec+=vn(c[9]),i.codec+=vn(c[10]),i.codec+=vn(c[11])):i.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(i.codec)?(c=d.subarray(28),"esds"===Tn(c.subarray(4,8))&&c.length>20&&0!==c[19]?(i.codec+="."+vn(c[19]),i.codec+="."+vn(c[20]>>>2&63).replace(/^0/,"")):i.codec="mp4a.40.2"):i.codec=i.codec.toLowerCase())}var f=_n(e,["mdia","mdhd"])[0];f&&(i.timescale=Vt(f)),n.push(i)})),n};var An=Ht,In=Gt,Cn=function(e,t=0){return _n(e,["emsg"]).map((e=>{var n=bn.parseEmsgBox(new Uint8Array(e)),r=wn(n.message_data);return{cueTime:bn.scaleTime(n.presentation_time,n.timescale,n.presentation_time_delta,t),duration:bn.scaleTime(n.event_duration,n.timescale),frames:r}}))},Rn=Re,Dn=function(e){var t=31&e[1];return(t<<=8)|e[2]},xn=function(e){return!!(64&e[1])},Nn=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},On=function(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Pn={parseType:function(e,t){var n=Dn(e);return 0===n?"pat":n===t?"pmt":t?"pes":null},parsePat:function(e){var t=xn(e),n=4+Nn(e);return t&&(n+=e[n]+1),(31&e[n+10])<<8|e[n+11]},parsePmt:function(e){var t={},n=xn(e),r=4+Nn(e);if(n&&(r+=e[r]+1),1&e[r+5]){var i;i=3+((15&e[r+1])<<8|e[r+2])-4;for(var a=12+((15&e[r+10])<<8|e[r+11]);a<i;){var s=r+a;t[(31&e[s+1])<<8|e[s+2]]=e[s],a+=5+((15&e[s+3])<<8|e[s+4])}return t}},parsePayloadUnitStartIndicator:xn,parsePesType:function(e,t){switch(t[Dn(e)]){case Rn.H264_STREAM_TYPE:return"video";case Rn.ADTS_STREAM_TYPE:return"audio";case Rn.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){if(!xn(e))return null;var t=4+Nn(e);if(t>=e.byteLength)return null;var n,r=null;return 192&(n=e[t+7])&&((r={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,r.pts*=4,r.pts+=(6&e[t+13])>>>1,r.dts=r.pts,64&n&&(r.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,r.dts*=4,r.dts+=(6&e[t+18])>>>1)),r},videoPacketContainsKeyFrame:function(e){for(var t=4+Nn(e),n=e.subarray(t),r=0,i=0,a=!1;i<n.byteLength-3;i++)if(1===n[i+2]){r=i+5;break}for(;r<n.byteLength;)switch(n[r]){case 0:if(0!==n[r-1]){r+=2;break}if(0!==n[r-2]){r++;break}i+3!==r-2&&"slice_layer_without_partitioning_rbsp_idr"===On(31&n[i+3])&&(a=!0);do{r++}while(1!==n[r]&&r<n.length);i=r-2,r+=3;break;case 1:if(0!==n[r-1]||0!==n[r-2]){r+=3;break}"slice_layer_without_partitioning_rbsp_idr"===On(31&n[i+3])&&(a=!0),i=r-2,r+=3;break;default:r+=3}return n=n.subarray(i),r-=i,i=0,n&&n.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===On(31&n[i+3])&&(a=!0),a}},Mn=Re,kn=Me.handleRollover,Ln={};Ln.ts=Pn,Ln.aac=yt;var Fn=ue.ONE_SECOND_IN_TS,Un=188,Bn=71,jn=function(e,t,n){for(var r,i,a,s,o=0,u=Un,l=!1;u<=e.byteLength;)if(e[o]!==Bn||e[u]!==Bn&&u!==e.byteLength)o++,u++;else{if(r=e.subarray(o,u),"pes"===Ln.ts.parseType(r,t.pid)&&(i=Ln.ts.parsePesType(r,t.table),a=Ln.ts.parsePayloadUnitStartIndicator(r),"audio"===i&&a&&(s=Ln.ts.parsePesTime(r))&&(s.type="audio",n.audio.push(s),l=!0)),l)break;o+=Un,u+=Un}for(o=(u=e.byteLength)-Un,l=!1;o>=0;)if(e[o]!==Bn||e[u]!==Bn&&u!==e.byteLength)o--,u--;else{if(r=e.subarray(o,u),"pes"===Ln.ts.parseType(r,t.pid)&&(i=Ln.ts.parsePesType(r,t.table),a=Ln.ts.parsePayloadUnitStartIndicator(r),"audio"===i&&a&&(s=Ln.ts.parsePesTime(r))&&(s.type="audio",n.audio.push(s),l=!0)),l)break;o-=Un,u-=Un}},qn=function(e,t,n){for(var r,i,a,s,o,u,l,c=0,d=Un,f=!1,h={data:[],size:0};d<e.byteLength;)if(e[c]!==Bn||e[d]!==Bn)c++,d++;else{if(r=e.subarray(c,d),"pes"===Ln.ts.parseType(r,t.pid)&&(i=Ln.ts.parsePesType(r,t.table),a=Ln.ts.parsePayloadUnitStartIndicator(r),"video"===i&&(a&&!f&&(s=Ln.ts.parsePesTime(r))&&(s.type="video",n.video.push(s),f=!0),!n.firstKeyFrame))){if(a&&0!==h.size){for(o=new Uint8Array(h.size),u=0;h.data.length;)l=h.data.shift(),o.set(l,u),u+=l.byteLength;if(Ln.ts.videoPacketContainsKeyFrame(o)){var p=Ln.ts.parsePesTime(o);p?(n.firstKeyFrame=p,n.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}h.size=0}h.data.push(r),h.size+=r.byteLength}if(f&&n.firstKeyFrame)break;c+=Un,d+=Un}for(c=(d=e.byteLength)-Un,f=!1;c>=0;)if(e[c]!==Bn||e[d]!==Bn)c--,d--;else{if(r=e.subarray(c,d),"pes"===Ln.ts.parseType(r,t.pid)&&(i=Ln.ts.parsePesType(r,t.table),a=Ln.ts.parsePayloadUnitStartIndicator(r),"video"===i&&a&&(s=Ln.ts.parsePesTime(r))&&(s.type="video",n.video.push(s),f=!0)),f)break;c-=Un,d-=Un}},Hn=function(e,t){var n;return n=Ln.aac.isLikelyAacData(e)?function(e){for(var t,n=!1,r=0,i=null,a=null,s=0,o=0;e.length-o>=3;){switch(Ln.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){n=!0;break}if((s=Ln.aac.parseId3TagSize(e,o))>e.length){n=!0;break}null===a&&(t=e.subarray(o,o+s),a=Ln.aac.parseAacTimestamp(t)),o+=s;break;case"audio":if(e.length-o<7){n=!0;break}if((s=Ln.aac.parseAdtsSize(e,o))>e.length){n=!0;break}null===i&&(t=e.subarray(o,o+s),i=Ln.aac.parseSampleRate(t)),r++,o+=s;break;default:o++}if(n)return null}if(null===i||null===a)return null;var u=Fn/i;return{audio:[{type:"audio",dts:a,pts:a},{type:"audio",dts:a+1024*r*u,pts:a+1024*r*u}]}}(e):function(e){var t={pid:null,table:null},n={};for(var r in function(e,t){for(var n,r=0,i=Un;i<e.byteLength;)if(e[r]!==Bn||e[i]!==Bn)r++,i++;else{switch(n=e.subarray(r,i),Ln.ts.parseType(n,t.pid)){case"pat":t.pid=Ln.ts.parsePat(n);break;case"pmt":var a=Ln.ts.parsePmt(n);t.table=t.table||{},Object.keys(a).forEach((function(e){t.table[e]=a[e]}))}r+=Un,i+=Un}}(e,t),t.table)if(t.table.hasOwnProperty(r))switch(t.table[r]){case Mn.H264_STREAM_TYPE:n.video=[],qn(e,t,n),0===n.video.length&&delete n.video;break;case Mn.ADTS_STREAM_TYPE:n.audio=[],jn(e,t,n),0===n.audio.length&&delete n.audio}return n}(e),n&&(n.audio||n.video)?(function(e,t){if(e.audio&&e.audio.length){var n=t;(void 0===n||isNaN(n))&&(n=e.audio[0].dts),e.audio.forEach((function(e){e.dts=kn(e.dts,n),e.pts=kn(e.pts,n),e.dtsTime=e.dts/Fn,e.ptsTime=e.pts/Fn}))}if(e.video&&e.video.length){var r=t;if((void 0===r||isNaN(r))&&(r=e.video[0].dts),e.video.forEach((function(e){e.dts=kn(e.dts,r),e.pts=kn(e.pts,r),e.dtsTime=e.dts/Fn,e.ptsTime=e.pts/Fn})),e.firstKeyFrame){var i=e.firstKeyFrame;i.dts=kn(i.dts,r),i.pts=kn(i.pts,r),i.dtsTime=i.dts/Fn,i.ptsTime=i.pts/Fn}}}(n,t),n):null};class Gn{constructor(e,t){this.options=t||{},this.self=e,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Yt.Transmuxer(this.options),function(e,t){t.on("data",(function(t){const n=t.initSegment;t.initSegment={data:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength};const r=t.data;t.data=r.buffer,e.postMessage({action:"data",segment:t,byteOffset:r.byteOffset,byteLength:r.byteLength},[t.data])})),t.on("done",(function(t){e.postMessage({action:"done"})})),t.on("gopInfo",(function(t){e.postMessage({action:"gopInfo",gopInfo:t})})),t.on("videoSegmentTimingInfo",(function(t){const n={start:{decode:ue.videoTsToSeconds(t.start.dts),presentation:ue.videoTsToSeconds(t.start.pts)},end:{decode:ue.videoTsToSeconds(t.end.dts),presentation:ue.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:ue.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(n.prependedContentDuration=ue.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:n})})),t.on("audioSegmentTimingInfo",(function(t){const n={start:{decode:ue.videoTsToSeconds(t.start.dts),presentation:ue.videoTsToSeconds(t.start.pts)},end:{decode:ue.videoTsToSeconds(t.end.dts),presentation:ue.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:ue.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(n.prependedContentDuration=ue.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:n})})),t.on("id3Frame",(function(t){e.postMessage({action:"id3Frame",id3Frame:t})})),t.on("caption",(function(t){e.postMessage({action:"caption",caption:t})})),t.on("trackinfo",(function(t){e.postMessage({action:"trackinfo",trackInfo:t})})),t.on("audioTimingInfo",(function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:ue.videoTsToSeconds(t.start),end:ue.videoTsToSeconds(t.end)}})})),t.on("videoTimingInfo",(function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:ue.videoTsToSeconds(t.start),end:ue.videoTsToSeconds(t.end)}})})),t.on("log",(function(t){e.postMessage({action:"log",log:t})}))}(this.self,this.transmuxer)}pushMp4Captions(e){this.captionParser||(this.captionParser=new fn,this.captionParser.init());const t=new Uint8Array(e.data,e.byteOffset,e.byteLength),n=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:n&&n.captions||[],logs:n&&n.logs||[],data:t.buffer},[t.buffer])}probeMp4StartTime({timescales:e,data:t}){const n=An(e,t);this.self.postMessage({action:"probeMp4StartTime",startTime:n,data:t},[t.buffer])}probeMp4Tracks({data:e}){const t=In(e);this.self.postMessage({action:"probeMp4Tracks",tracks:t,data:e},[e.buffer])}probeEmsgID3({data:e,offset:t}){const n=Cn(e,t);this.self.postMessage({action:"probeEmsgID3",id3Frames:n,emsgData:e},[e.buffer])}probeTs({data:e,baseStartTime:t}){const n="number"!=typeof t||isNaN(t)?void 0:t*ue.ONE_SECOND_IN_TS,r=Hn(e,n);let i=null;r&&(i={hasVideo:r.video&&2===r.video.length||!1,hasAudio:r.audio&&2===r.audio.length||!1},i.hasVideo&&(i.videoStart=r.video[0].ptsTime),i.hasAudio&&(i.audioStart=r.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:i,data:e},[e.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(e){const t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}reset(){this.transmuxer.reset()}setTimestampOffset(e){const t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(ue.secondsToVideoTs(t)))}setAudioAppendStart(e){this.transmuxer.setAudioAppendStart(Math.ceil(ue.secondsToVideoTs(e.appendStart)))}setRemux(e){this.transmuxer.setRemux(e.remux)}flush(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new Gn(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new Gn(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}})));var Uo=Mo(Fo);const Bo=e=>{const{transmuxer:t,bytes:n,audioAppendStart:r,gopsToAlignWith:i,remux:a,onData:s,onTrackInfo:o,onAudioTimingInfo:u,onVideoTimingInfo:l,onVideoSegmentTimingInfo:c,onAudioSegmentTimingInfo:d,onId3:f,onCaptions:h,onDone:p,onEndedTimeline:g,onTransmuxerLog:m,isEndOfTimeline:y}=e,v={buffer:[]};let _=y;if(t.onmessage=n=>{t.currentTransmux===e&&("data"===n.data.action&&((e,t,n)=>{const{type:r,initSegment:i,captions:a,captionStreams:s,metadata:o,videoFrameDtsTime:u,videoFramePtsTime:l}=e.data.segment;t.buffer.push({captions:a,captionStreams:s,metadata:o});const c=e.data.segment.boxes||{data:e.data.segment.data},d={type:r,data:new Uint8Array(c.data,c.data.byteOffset,c.data.byteLength),initSegment:new Uint8Array(i.data,i.byteOffset,i.byteLength)};void 0!==u&&(d.videoFrameDtsTime=u),void 0!==l&&(d.videoFramePtsTime=l),n(d)})(n,v,s),"trackinfo"===n.data.action&&o(n.data.trackInfo),"gopInfo"===n.data.action&&((e,t)=>{t.gopInfo=e.data.gopInfo})(n,v),"audioTimingInfo"===n.data.action&&u(n.data.audioTimingInfo),"videoTimingInfo"===n.data.action&&l(n.data.videoTimingInfo),"videoSegmentTimingInfo"===n.data.action&&c(n.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===n.data.action&&d(n.data.audioSegmentTimingInfo),"id3Frame"===n.data.action&&f([n.data.id3Frame],n.data.id3Frame.dispatchType),"caption"===n.data.action&&h(n.data.caption),"endedtimeline"===n.data.action&&(_=!1,g()),"log"===n.data.action&&m(n.data.log),"transmuxed"===n.data.type&&(_||(t.onmessage=null,(({transmuxedData:e,callback:t})=>{e.buffer=[],t(e)})({transmuxedData:v,callback:p}),jo(t))))},r&&t.postMessage({action:"setAudioAppendStart",appendStart:r}),Array.isArray(i)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:i}),void 0!==a&&t.postMessage({action:"setRemux",remux:a}),n.byteLength){const e=n instanceof ArrayBuffer?n:n.buffer,r=n instanceof ArrayBuffer?0:n.byteOffset;t.postMessage({action:"push",data:e,byteOffset:r,byteLength:n.byteLength},[e])}y&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},jo=e=>{e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():Bo(e.currentTransmux))},qo=(e,t)=>{e.postMessage({action:t}),jo(e)};var Ho=e=>{((e,t)=>{if(!t.currentTransmux)return t.currentTransmux=e,void qo(t,e);t.transmuxQueue.push(qo.bind(null,t,e))})("reset",e)};const Go=function(e){const t=e.transmuxer,n=e.endAction||e.action,r=e.callback,i=(0,g.Z)({},e,{endAction:null,transmuxer:null,callback:null}),a=i=>{i.data.action===n&&(t.removeEventListener("message",a),i.data.data&&(i.data.data=new Uint8Array(i.data.data,e.byteOffset||0,e.byteLength||i.data.data.byteLength),e.data&&(e.data=i.data.data)),r(i.data))};if(t.addEventListener("message",a),e.data){const n=e.data instanceof ArrayBuffer;i.byteOffset=n?0:e.data.byteOffset,i.byteLength=e.data.byteLength;const r=[n?e.data:e.data.buffer];t.postMessage(i,r)}else t.postMessage(i)},Vo=-101,Yo=-102,zo=e=>{e.forEach((e=>{e.abort()}))},Zo=(e,t)=>t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:Vo,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:Yo,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:2,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:2,xhr:t}:null,Ko=(e,t,n)=>(r,i)=>{const a=i.response,s=Zo(r,i);if(s)return n(s,e);if(16!==a.byteLength)return n({status:i.status,message:"Invalid HLS key at URL: "+i.uri,code:2,xhr:i},e);const o=new DataView(a),u=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]);for(let e=0;e<t.length;e++)t[e].bytes=u;return n(null,e)},Wo=(e,t)=>{const n=ct(e.map.bytes);if("mp4"!==n){const r=e.map.resolvedUri||e.map.uri;return t({internal:!0,message:`Found unsupported ${n||"unknown"} container for initialization segment at URL: ${r}`,code:2})}Go({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:({tracks:n,data:r})=>(e.map.bytes=r,n.forEach((function(t){e.map.tracks=e.map.tracks||{},e.map.tracks[t.type]||(e.map.tracks[t.type]=t,"number"==typeof t.id&&t.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[t.id]=t.timescale))})),t(null))})},Xo=({segment:e,bytes:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:s,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:l,dataFn:c,doneFn:d,onTransmuxerLog:f})=>{const h=e.map&&e.map.tracks||{},p=Boolean(h.audio&&h.video);let g=r.bind(null,e,"audio","start");const m=r.bind(null,e,"audio","end");let y=r.bind(null,e,"video","start");const v=r.bind(null,e,"video","end");Go({action:"probeTs",transmuxer:e.transmuxer,data:t,baseStartTime:e.baseStartTime,callback:r=>{e.bytes=t=r.data;const h=r.result;h&&(n(e,{hasAudio:h.hasAudio,hasVideo:h.hasVideo,isMuxed:p}),n=null),(e=>{if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void Bo(e);e.transmuxer.transmuxQueue.push(e)})({bytes:t,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,remux:p,onData:t=>{t.type="combined"===t.type?"video":t.type,c(e,t)},onTrackInfo:t=>{n&&(p&&(t.isMuxed=!0),n(e,t))},onAudioTimingInfo:e=>{g&&void 0!==e.start&&(g(e.start),g=null),m&&void 0!==e.end&&m(e.end)},onVideoTimingInfo:e=>{y&&void 0!==e.start&&(y(e.start),y=null),v&&void 0!==e.end&&v(e.end)},onVideoSegmentTimingInfo:e=>{i(e)},onAudioSegmentTimingInfo:e=>{a(e)},onId3:(t,n)=>{s(e,t,n)},onCaptions:t=>{o(e,[t])},isEndOfTimeline:u,onEndedTimeline:()=>{l()},onTransmuxerLog:f,onDone:t=>{d&&(t.type="combined"===t.type?"video":t.type,d(null,e,t))}})}})},$o=({segment:e,bytes:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:s,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:l,dataFn:c,doneFn:d,onTransmuxerLog:f})=>{let h=new Uint8Array(t);if(function(e){return Ke(e,["moof"]).length>0}(h)){e.isFmp4=!0;const{tracks:i}=e.map,a={isFmp4:!0,hasVideo:!!i.video,hasAudio:!!i.audio};i.audio&&i.audio.codec&&"enca"!==i.audio.codec&&(a.audioCodec=i.audio.codec),i.video&&i.video.codec&&"encv"!==i.video.codec&&(a.videoCodec=i.video.codec),i.video&&i.audio&&(a.isMuxed=!0),n(e,a);const u=(t,n)=>{c(e,{data:h,type:a.hasAudio&&!a.isMuxed?"audio":"video"}),n&&n.length&&s(e,n),t&&t.length&&o(e,t),d(null,e,{})};Go({action:"probeMp4StartTime",timescales:e.map.timescales,data:h,transmuxer:e.transmuxer,callback:({data:n,startTime:s})=>{t=n.buffer,e.bytes=h=n,a.hasAudio&&!a.isMuxed&&r(e,"audio","start",s),a.hasVideo&&r(e,"video","start",s),Go({action:"probeEmsgID3",data:h,transmuxer:e.transmuxer,offset:s,callback:({emsgData:n,id3Frames:r})=>{t=n.buffer,e.bytes=h=n,i.video&&n.byteLength&&e.transmuxer?Go({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:e.transmuxer,data:h,timescales:e.map.timescales,trackIds:[i.video.id],callback:n=>{t=n.data.buffer,e.bytes=h=n.data,n.logs.forEach((function(e){f(bs(e,{stream:"mp4CaptionParser"}))})),u(n.captions,r)}}):u(void 0,r)}})}})}else if(e.transmuxer){if(void 0===e.container&&(e.container=ct(h)),"ts"!==e.container&&"aac"!==e.container)return n(e,{hasAudio:!1,hasVideo:!1}),void d(null,e,{});Xo({segment:e,bytes:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:s,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:l,dataFn:c,doneFn:d,onTransmuxerLog:f})}else d(null,e,{})},Qo=function({id:e,key:t,encryptedBytes:n,decryptionWorker:r},i){const a=t=>{if(t.data.source===e){r.removeEventListener("message",a);const e=t.data.decrypted;i(new Uint8Array(e.bytes,e.byteOffset,e.byteLength))}};let s;r.addEventListener("message",a),s=t.bytes.slice?t.bytes.slice():new Uint32Array(Array.prototype.slice.call(t.bytes)),r.postMessage(_o({source:e,encrypted:n,key:s,iv:t.iv}),[n.buffer,s.buffer])},Jo=({xhr:e,xhrOptions:t,decryptionWorker:n,segment:r,abortFn:i,progressFn:a,trackInfoFn:s,timingInfoFn:o,videoSegmentTimingInfoFn:u,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:h,dataFn:p,doneFn:g,onTransmuxerLog:m})=>{const y=[],v=(({activeXhrs:e,decryptionWorker:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:s,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:l,dataFn:c,doneFn:d,onTransmuxerLog:f})=>{let h=0,p=!1;return(g,m)=>{if(!p){if(g)return p=!0,zo(e),d(g,m);if(h+=1,h===e.length){const h=function(){if(m.encryptedBytes)return(({decryptionWorker:e,segment:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:s,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:l,dataFn:c,doneFn:d,onTransmuxerLog:f})=>{Qo({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e},(e=>{t.bytes=e,$o({segment:t,bytes:t.bytes,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:s,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:l,dataFn:c,doneFn:d,onTransmuxerLog:f})}))})({decryptionWorker:t,segment:m,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:s,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:l,dataFn:c,doneFn:d,onTransmuxerLog:f});$o({segment:m,bytes:m.bytes,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:s,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:l,dataFn:c,doneFn:d,onTransmuxerLog:f})};if(m.endOfAllRequests=Date.now(),m.map&&m.map.encryptedBytes&&!m.map.bytes)return Qo({decryptionWorker:t,id:m.requestId+"-init",encryptedBytes:m.map.encryptedBytes,key:m.map.key},(t=>{m.map.bytes=t,Wo(m,(t=>{if(t)return zo(e),d(t,m);h()}))}));h()}}}})({activeXhrs:y,decryptionWorker:n,trackInfoFn:s,timingInfoFn:o,videoSegmentTimingInfoFn:u,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:h,dataFn:p,doneFn:g,onTransmuxerLog:m});if(r.key&&!r.key.bytes){const n=[r.key];r.map&&!r.map.bytes&&r.map.key&&r.map.key.resolvedUri===r.key.resolvedUri&&n.push(r.map.key);const i=e(bs(t,{uri:r.key.resolvedUri,responseType:"arraybuffer"}),Ko(r,n,v));y.push(i)}if(r.map&&!r.map.bytes){if(r.map.key&&(!r.key||r.key.resolvedUri!==r.map.key.resolvedUri)){const n=e(bs(t,{uri:r.map.key.resolvedUri,responseType:"arraybuffer"}),Ko(r,[r.map.key],v));y.push(n)}const n=bs(t,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:go(r.map)}),i=(({segment:e,finishProcessingFn:t})=>(n,r)=>{const i=Zo(n,r);if(i)return t(i,e);const a=new Uint8Array(r.response);if(e.map.key)return e.map.encryptedBytes=a,t(null,e);e.map.bytes=a,Wo(e,(function(n){if(n)return n.xhr=r,n.status=r.status,t(n,e);t(null,e)}))})({segment:r,finishProcessingFn:v}),a=e(n,i);y.push(a)}const _=bs(t,{uri:r.part&&r.part.resolvedUri||r.resolvedUri,responseType:"arraybuffer",headers:go(r)}),T=e(_,(({segment:e,finishProcessingFn:t,responseType:n})=>(r,i)=>{const a=Zo(r,i);if(a)return t(a,e);const s="arraybuffer"!==n&&i.responseText?(e=>{const t=new Uint8Array(new ArrayBuffer(e.length));for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t.buffer})(i.responseText.substring(e.lastReachedChar||0)):i.response;return e.stats=(e=>({bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}))(i),e.key?e.encryptedBytes=new Uint8Array(s):e.bytes=new Uint8Array(s),t(null,e)})({segment:r,finishProcessingFn:v,responseType:_.responseType}));T.addEventListener("progress",(({segment:e,progressFn:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:s,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:l,dataFn:c})=>n=>{if(!n.target.aborted)return e.stats=bs(e.stats,(e=>{const t=e.target,n={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0};return n.bytesReceived=e.loaded,n.bandwidth=Math.floor(n.bytesReceived/n.roundTripTime*8*1e3),n})(n)),!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived&&(e.stats.firstBytesReceivedAt=Date.now()),t(n,e)})({segment:r,progressFn:a,trackInfoFn:s,timingInfoFn:o,videoSegmentTimingInfoFn:u,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:h,dataFn:p})),y.push(T);const b={};return y.forEach((e=>{e.addEventListener("loadend",(({loadendState:e,abortFn:t})=>n=>{n.target.aborted&&t&&!e.calledAbortFn&&(t(),e.calledAbortFn=!0)})({loadendState:b,abortFn:i}))})),()=>zo(y)},eu=Ts("CodecUtils"),tu=(e,t)=>{const n=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&n.AUDIO&&e.mediaGroups.AUDIO[n.AUDIO]},nu=function(e){const t={};return e.forEach((({mediaType:e,type:n,details:r})=>{t[e]=t[e]||[],t[e].push(O(`${n}${r}`))})),Object.keys(t).forEach((function(e){if(t[e].length>1)return eu(`multiple ${e} codecs found as attributes: ${t[e].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),void(t[e]=null);t[e]=t[e][0]})),t},ru=function(e){let t=0;return e.audio&&t++,e.video&&t++,t},iu=function(e,t){const n=t.attributes||{},r=nu(function(e){const t=e.attributes||{};if(t.CODECS)return P(t.CODECS)}(t)||[]);if(tu(e,t)&&!r.audio&&!((e,t)=>{if(!tu(e,t))return!0;const n=t.attributes||{},r=e.mediaGroups.AUDIO[n.AUDIO];for(const e in r)if(!r[e].uri&&!r[e].playlists)return!0;return!1})(e,t)){const t=nu(function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var n=e.mediaGroups.AUDIO[t];if(!n)return null;for(var r in n){var i=n[r];if(i.default&&i.playlists)return P(i.playlists[0].attributes.CODECS)}return null}(e,n.AUDIO)||[]);t.audio&&(r.audio=t.audio)}return r},au=Ts("PlaylistSelector"),su=function(e){if(!e||!e.playlist)return;const t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})},ou=function(e,t){if(!e)return"";const n=i().getComputedStyle(e);return n?n[t]:""},uu=function(e,t){const n=e.slice();e.sort((function(e,r){const i=t(e,r);return 0===i?n.indexOf(e)-n.indexOf(r):i}))},lu=function(e,t){let n,r;return e.attributes.BANDWIDTH&&(n=e.attributes.BANDWIDTH),n=n||i().Number.MAX_VALUE,t.attributes.BANDWIDTH&&(r=t.attributes.BANDWIDTH),r=r||i().Number.MAX_VALUE,n-r};let cu=function(e,t,n,r,a,s){if(!e)return;const o={bandwidth:t,width:n,height:r,limitRenditionByPlayerDimensions:a};let u=e.playlists;Ws.isAudioOnly(e)&&(u=s.getAudioTrackPlaylists_(),o.audioOnly=!0);let l=u.map((e=>{let t;const n=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,r=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return t=e.attributes&&e.attributes.BANDWIDTH,t=t||i().Number.MAX_VALUE,{bandwidth:t,width:n,height:r,playlist:e}}));uu(l,((e,t)=>e.bandwidth-t.bandwidth)),l=l.filter((e=>!Ws.isIncompatible(e.playlist)));let c=l.filter((e=>Ws.isEnabled(e.playlist)));c.length||(c=l.filter((e=>!Ws.isDisabled(e.playlist))));const d=c.filter((e=>e.bandwidth*Oo.BANDWIDTH_VARIANCE<t));let f=d[d.length-1];const h=d.filter((e=>e.bandwidth===f.bandwidth))[0];if(!1===a){const e=h||c[0]||l[0];if(e&&e.playlist){let t="sortedPlaylistReps";return h&&(t="bandwidthBestRep"),c[0]&&(t="enabledPlaylistReps"),au(`choosing ${su(e)} using ${t} with options`,o),e.playlist}return au("could not choose a playlist with options",o),null}const p=d.filter((e=>e.width&&e.height));uu(p,((e,t)=>e.width-t.width));const g=p.filter((e=>e.width===n&&e.height===r));f=g[g.length-1];const m=g.filter((e=>e.bandwidth===f.bandwidth))[0];let y,v,_,T;if(m||(y=p.filter((e=>e.width>n||e.height>r)),v=y.filter((e=>e.width===y[0].width&&e.height===y[0].height)),f=v[v.length-1],_=v.filter((e=>e.bandwidth===f.bandwidth))[0]),s.leastPixelDiffSelector){const e=p.map((e=>(e.pixelDiff=Math.abs(e.width-n)+Math.abs(e.height-r),e)));uu(e,((e,t)=>e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff)),T=e[0]}const b=T||_||m||h||c[0]||l[0];if(b&&b.playlist){let e="sortedPlaylistReps";return T?e="leastPixelDiffRep":_?e="resolutionPlusOneRep":m?e="resolutionBestRep":h?e="bandwidthBestRep":c[0]&&(e="enabledPlaylistReps"),au(`choosing ${su(b)} using ${e} with options`,o),b.playlist}return au("could not choose a playlist with options",o),null};const du=function(){const e=this.useDevicePixelRatio&&i().devicePixelRatio||1;return cu(this.playlists.main,this.systemBandwidth,parseInt(ou(this.tech_.el(),"width"),10)*e,parseInt(ou(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.playlistController_)},fu={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},hu=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),pu=(e,t,n)=>{e.metadataTrack_||(e.metadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,hs.browser.IS_ANY_SAFARI||(e.metadataTrack_.inBandMetadataTrackDispatchType=t))},gu=function(e,t,n){let r,i;if(n&&n.cues)for(r=n.cues.length;r--;)i=n.cues[r],i.startTime>=e&&i.endTime<=t&&n.removeCue(i)},mu=e=>"number"==typeof e&&isFinite(e),yu=1/60,vu=e=>{const{startOfSegment:t,duration:n,segment:r,part:i,playlist:{mediaSequence:a,id:s,segments:o=[]},mediaIndex:u,partIndex:l,timeline:c}=e,d=o.length-1;let f="mediaIndex/partIndex increment";e.getMediaInfoForTime?f=`getMediaInfoForTime (${e.getMediaInfoForTime})`:e.isSyncRequest&&(f="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(f+=` with independent ${e.independent}`);const h="number"==typeof l,p=e.segment.uri?"segment":"pre-segment",g=h?ks({preloadSegment:r})-1:0;return`${p} [${a+u}/${a+d}]`+(h?` part [${l}/${g}]`:"")+` segment start/end [${r.start} => ${r.end}]`+(h?` part start/end [${i.start} => ${i.end}]`:"")+` startOfSegment [${t}]`+` duration [${n}]`+` timeline [${c}]`+` selected by [${f}]`+` playlist [${s}]`},_u=e=>`${e}TimingInfo`,Tu=({timelineChangeController:e,currentTimeline:t,segmentTimeline:n,loaderType:r,audioDisabled:i})=>{if(t===n)return!1;if("audio"===r){const t=e.lastTimelineChange({type:"main"});return!t||t.to!==n}if("main"===r&&i){const t=e.pendingTimelineChange({type:"audio"});return!t||t.to!==n}return!1},bu=({segmentDuration:e,maxDuration:t})=>!!e&&Math.round(e)>t+Ss;class Eu extends hs.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if("function"!=typeof e.currentTime)throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",(()=>{this.isEndOfStream_()||(this.ended_=!1)})),this.fetchAtBuffer_=!1,this.logger_=Ts(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(e){e!==this.state_&&(this.logger_(`${this.state_} -> ${e}`),this.state_=e,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",(()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()})),"main"===this.loaderType_&&this.timelineChangeController_.on("pendingtimelinechange",(()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()})),"audio"===this.loaderType_&&this.timelineChangeController_.on("timelinechange",(()=>{this.hasEnoughInfoToLoad_()&&this.processLoadQueue_(),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}))}createTransmuxer_(){return(e=>{const t=new Uo;t.currentTransmux=null,t.transmuxQueue=[];const n=t.terminate;return t.terminate=()=>(t.currentTransmux=null,t.transmuxQueue.length=0,n.call(t)),t.postMessage({action:"init",options:e}),t})({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&i().clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,i().clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)}error(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&Ho(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Es();if("main"===this.loaderType_){const{hasAudio:t,hasVideo:n,isMuxed:r}=e;if(n&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(n)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const n=To(e);let r=this.initSegments_[n];return t&&!r&&e.bytes&&(this.initSegments_[n]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,t=!1){if(!e)return null;const n=bo(e);let r=this.keyCache_[n];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[n]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});const i={resolvedUri:(r||e).resolvedUri};return r&&(i.bytes=r.bytes),i}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"))}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;const n=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));let i=null;if(n&&(n.id?i=n.id:n.uri&&(i=n.uri)),this.logger_(`playlist update [${i} => ${e.id||e.uri}]`),this.syncController_.updateMediaSequenceMap(e,this.currentTime_(),this.loaderType_),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!n||n.uri!==e.uri)return null!==this.mediaIndex&&(e.endList||"number"!=typeof e.partTargetDuration?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");const a=e.mediaSequence-n.mediaSequence;if(this.logger_(`live window shift [${a}]`),null!==this.mediaIndex)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const e=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!e.parts||!e.parts.length||!e.parts[this.partIndex])){const e=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=e}}r&&(r.mediaIndex-=a,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(n,e)}pause(){this.checkBufferTimeout_&&(i().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return null===this.checkBufferTimeout_}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.resyncLoader()}resyncLoader(){this.transmuxer_&&Ho(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.shouldForceTimestampOffsetAfterResync_=!0,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,n=(()=>{}),r=!1){if(t===1/0&&(t=this.duration_()),t<=e)return void this.logger_("skipping remove because end ${end} is <= start ${start}");if(!this.sourceUpdater_||!this.getMediaInfo_())return void this.logger_("skipping remove because no source updater or starting media info");let i=1;const a=()=>{i--,0===i&&n()};!r&&this.audioDisabled_||(i++,this.sourceUpdater_.removeAudio(e,t,a)),(r||"main"===this.loaderType_)&&(this.gopBuffer_=((e,t,n,r)=>{const i=Math.ceil((t-r)*dt.ONE_SECOND_IN_TS),a=Math.ceil((n-r)*dt.ONE_SECOND_IN_TS),s=e.slice();let o=e.length;for(;o--&&!(e[o].pts<=a););if(-1===o)return s;let u=o+1;for(;u--&&!(e[u].pts<=i););return u=Math.max(u,0),s.splice(u,o-u+1),s})(this.gopBuffer_,e,t,this.timeMapping_),i++,this.sourceUpdater_.removeVideo(e,t,a));for(const n in this.inbandTextTracks_)gu(e,t,this.inbandTextTracks_[n]);gu(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&i().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=i().setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&i().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=i().setTimeout(this.monitorBufferTick_.bind(this),500)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();e&&("number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,n=this.partIndex){if(!t||!this.mediaSource_)return!1;const r="number"==typeof e&&t.segments[e],i=e+1===t.segments.length,a=!r||!r.parts||n+1===r.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&i&&a}chooseNextRequest_(){const e=this.buffered_(),t=xs(e)||0,n=Ns(e,this.currentTime_()),r=!this.hasPlayed_()&&n>=1,i=n>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||r||i)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const s={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(s.isSyncRequest)s.mediaIndex=function(e,t,n){t=t||[];const r=[];let i=0;for(let a=0;a<t.length;a++){const s=t[a];if(e===s.timeline&&(r.push(a),i+=s.duration,i>n))return a}return 0===r.length?0:r[r.length-1]}(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${s.mediaIndex}`);else if(null!==this.mediaIndex){const e=a[this.mediaIndex],n="number"==typeof this.partIndex?this.partIndex:-1;s.startOfSegment=e.end?e.end:t,e.parts&&e.parts[n+1]?(s.mediaIndex=this.mediaIndex,s.partIndex=n+1):s.mediaIndex=this.mediaIndex+1}else{const{segmentIndex:e,startTime:n,partIndex:r}=Ws.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?t:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});s.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${t}`:`currentTime ${this.currentTime_()}`,s.mediaIndex=e,s.startOfSegment=n,s.partIndex=r,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${s.mediaIndex} `)}const o=a[s.mediaIndex];let u=o&&"number"==typeof s.partIndex&&o.parts&&o.parts[s.partIndex];if(!o||"number"==typeof s.partIndex&&!u)return null;"number"!=typeof s.partIndex&&o.parts&&(s.partIndex=0,u=o.parts[0]);const l=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!n&&u&&!l&&!u.independent)if(0===s.partIndex){const e=a[s.mediaIndex-1],t=e.parts&&e.parts.length&&e.parts[e.parts.length-1];t&&t.independent&&(s.mediaIndex-=1,s.partIndex=e.parts.length-1,s.independent="previous segment")}else o.parts[s.partIndex-1].independent&&(s.partIndex-=1,s.independent="previous part");const c=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return s.mediaIndex>=a.length-1&&c&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,s.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(s))}generateSegmentInfo_(e){const{independent:t,playlist:n,mediaIndex:r,startOfSegment:i,isSyncRequest:a,partIndex:s,forceTimestampOffset:o,getMediaInfoForTime:u}=e,l=n.segments[r],c="number"==typeof s&&l.parts[s],d={requestId:"segment-loader-"+Math.random(),uri:c&&c.resolvedUri||l.resolvedUri,mediaIndex:r,partIndex:c?s:null,isSyncRequest:a,startOfSegment:i,playlist:n,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:l.timeline,duration:c&&c.duration||l.duration,segment:l,part:c,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:u,independent:t},f=void 0!==o?o:this.isPendingTimestampOffset_;d.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:l.timeline,currentTimeline:this.currentTimeline_,startOfSegment:i,buffered:this.buffered_(),overrideCheck:f});const h=xs(this.sourceUpdater_.audioBuffered());return"number"==typeof h&&(d.audioAppendStart=h-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(d.gopsToAlignWith=((e,t,n)=>{if(null==t||!e.length)return[];const r=Math.ceil((t-n+3)*dt.ONE_SECOND_IN_TS);let i;for(i=0;i<e.length&&!(e[i].pts>r);i++);return e.slice(i)})(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),d}timestampOffsetForSegment_(e){return(({segmentTimeline:e,currentTimeline:t,startOfSegment:n,buffered:r,overrideCheck:i})=>i||e!==t?e<t?n:r.length?r.end(r.length-1):n:null)(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)return;if(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),n=e.bandwidth,r=this.pendingSegment_.duration,i=Ws.estimateSegmentRequestTime(r,n,this.playlist_,e.bytesReceived),a=function(e,t,n=1){return((e.length?e.end(e.length-1):0)-t)/n}(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(i<=a)return;const s=function(e){const{main:t,currentTime:n,bandwidth:r,duration:i,segmentDuration:a,timeUntilRebuffer:s,currentTimeline:o,syncController:u}=e,l=t.playlists.filter((e=>!Ws.isIncompatible(e)));let c=l.filter(Ws.isEnabled);c.length||(c=l.filter((e=>!Ws.isDisabled(e))));const d=c.filter(Ws.hasAttribute.bind(null,"BANDWIDTH")).map((e=>{const t=u.getSyncPoint(e,i,o,n)?1:2;return{playlist:e,rebufferingImpact:Ws.estimateSegmentRequestTime(a,r,e)*t-s}})),f=d.filter((e=>e.rebufferingImpact<=0));return uu(f,((e,t)=>lu(t.playlist,e.playlist))),f.length?f[0]:(uu(d,((e,t)=>e.rebufferingImpact-t.rebufferingImpact)),d[0]||null)}({main:this.vhs_.playlists.main,currentTime:t,bandwidth:n,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!s)return;const o=i-a-s.rebufferingImpact;let u=.5;a<=Ss&&(u=1),!s.playlist||s.playlist.uri===this.playlist_.uri||o<u||(this.bandwidth=s.playlist.attributes.BANDWIDTH*Oo.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${vu(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.trigger("progress")}handleTrackInfo_(e,t){this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||this.checkForIllegalMediaSwitch(t)||(t=t||{},function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;const n=Object.keys(e).sort(),r=Object.keys(t).sort();if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++){const a=n[i];if(a!==r[i])return!1;if(e[a]!==t[a])return!1}return!0}(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),this.checkForAbort_(e.requestId)||(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()&&this.processCallQueue_()))}handleTimingInfo_(e,t,n,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const i=this.pendingSegment_,a=_u(t);i[a]=i[a]||{},i[a][n]=r,this.logger_(`timinginfo: ${t} - ${n} - ${r}`),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(0===t.length)return void this.logger_("SegmentLoader received no captions from a caption event");if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));const n=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),r={};t.forEach((e=>{r[e.stream]=r[e.stream]||{startTime:1/0,captions:[],endTime:0};const t=r[e.stream];t.startTime=Math.min(t.startTime,e.startTime+n),t.endTime=Math.max(t.endTime,e.endTime+n),t.captions.push(e)})),Object.keys(r).forEach((e=>{const{startTime:t,endTime:a,captions:s}=r[e],o=this.inbandTextTracks_;this.logger_(`adding cues from ${t} -> ${a} for ${e}`),function(e,t,n){if(!e[n]){t.trigger({type:"usage",name:"vhs-608"});let r=n;/^cc708_/.test(n)&&(r="SERVICE"+n.split("_")[1]);const i=t.textTracks().getTrackById(r);if(i)e[n]=i;else{let i=n,a=n,s=!1;const o=(t.options_.vhs&&t.options_.vhs.captionServices||{})[r];o&&(i=o.label,a=o.language,s=o.default),e[n]=t.addRemoteTextTrack({kind:"captions",id:r,default:s,label:i,language:a},!1).track}}}(o,this.vhs_.tech_,e),gu(t,a,o[e]),function({inbandTextTracks:e,captionArray:t,timestampOffset:n}){if(!t)return;const r=i().WebKitDataCue||i().VTTCue;t.forEach((t=>{const i=t.stream;t.content?t.content.forEach((a=>{const s=new r(t.startTime+n,t.endTime+n,a.text);s.line=a.line,s.align="left",s.position=a.position,s.positionAlign="line-left",e[i].addCue(s)})):e[i].addCue(new r(t.startTime+n,t.endTime+n,t.text))}))}({captionArray:s,inbandTextTracks:o,timestampOffset:n})})),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,n){this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||(this.pendingSegment_.hasAppendedData_?this.addMetadataToTextTrack(n,t,this.duration_()):this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,n)))}processMetadataQueue_(){this.metadataQueue_.id3.forEach((e=>e())),this.metadataQueue_.caption.forEach((e=>e())),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach((e=>e()))}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach((e=>e()))}hasEnoughInfoToLoad_(){if("audio"!==this.loaderType_)return!0;const e=this.pendingSegment_;return!(!e||this.getCurrentMediaInfo_()&&Tu({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:n,hasVideo:r,isMuxed:i}=t;return!(r&&!e.videoTimingInfo||n&&!this.audioDisabled_&&!i&&!e.audioTimingInfo||Tu({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_())return void this.callQueue_.push(this.handleData_.bind(this,e,t));const n=this.pendingSegment_;if(this.setTimeMapping_(n.timeline),this.updateMediaSecondsLoaded_(n.part||n.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),n.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),n.isFmp4=e.isFmp4,n.timingInfo=n.timingInfo||{},n.isFmp4)this.trigger("fmp4"),n.timingInfo.start=n[_u(t.type)].start;else{const e=this.getCurrentMediaInfo_(),t="main"===this.loaderType_&&e&&e.hasVideo;let r;t&&(r=n.videoTimingInfo.start),n.timingInfo.start=this.trueSegmentStart_({currentStart:n.timingInfo.start,playlist:n.playlist,mediaIndex:n.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:t,firstVideoFrameTimeForData:r,videoTimingInfo:n.videoTimingInfo,audioTimingInfo:n.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(n,t.type),this.updateSourceBufferTimestampOffset_(n),n.isSyncRequest){this.updateTimingInfoEnd_(n),this.syncController_.saveSegmentTimingInfo({segmentInfo:n,shouldSaveTimelineMapping:"main"===this.loaderType_});const e=this.chooseNextRequest_();if(e.mediaIndex!==n.mediaIndex||e.partIndex!==n.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}n.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(n,t)}}updateAppendInitSegmentStatus(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:n,playlist:r}){if(n){const e=To(n);if(this.activeInitSegmentId_===e)return null;t=this.initSegmentForMap(n,!0).bytes,this.activeInitSegmentId_=e}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:n},r){const a=this.sourceUpdater_.audioBuffered(),s=this.sourceUpdater_.videoBuffered();a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Ds(a).join(", ")),s.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Ds(s).join(", "));const o=a.length?a.start(0):0,u=a.length?a.end(a.length-1):0,l=s.length?s.start(0):0,c=s.length?s.end(s.length-1):0;if(u-o<=1&&c-l<=1)return this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${n.byteLength}, audio buffer: ${Ds(a).join(", ")}, video buffer: ${Ds(s).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:n}));const d=this.currentTime_()-1;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${d}`),this.remove(0,d,(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=i().setTimeout((()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()}),1e3)}),!0)}handleAppendError_({segmentInfo:e,type:t,bytes:n},r){r&&(22!==r.code?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error(`${t} append of ${n.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:n}))}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:n,data:r,bytes:i}){if(!i){const e=[r];let t=r.byteLength;n&&(e.unshift(n),t+=n.byteLength),i=(e=>{let t,n=0;return e.bytes&&(t=new Uint8Array(e.bytes),e.segments.forEach((e=>{t.set(e,n),n+=e.byteLength}))),t})({bytes:t,segments:e})}this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:i},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:i}))}handleSegmentTimingInfo_(e,t,n){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,i=`${e}TimingInfo`;r[i]||(r[i]={}),r[i].transmuxerPrependedSeconds=n.prependedContentDuration||0,r[i].transmuxedPresentationStart=n.start.presentation,r[i].transmuxedDecodeStart=n.start.decode,r[i].transmuxedPresentationEnd=n.end.presentation,r[i].transmuxedDecodeEnd=n.end.decode,r[i].baseMediaDecodeTime=n.baseMediaDecodeTime}appendData_(e,t){const{type:n,data:r}=t;if(!r||!r.byteLength)return;if("audio"===n&&this.audioDisabled_)return;const i=this.getInitSegmentAndUpdateState_({type:n,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:n,initSegment:i,data:r})}loadSegment_(e){this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push((()=>{const t=(0,g.Z)({},e,{forceTimestampOffset:!0});(0,g.Z)(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)}))}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),n=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=null!==this.mediaIndex,i=e.timeline!==this.currentTimeline_&&e.timeline>0,a=n||r&&i;this.logger_(`Requesting ${vu(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=Jo({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:t,level:n,stream:r})=>{this.logger_(`${vu(e)} logged from transmuxer stream ${r} as a ${n}: ${t}`)}})}trimBackBuffer_(e){const t=((e,t,n)=>{let r=t-Oo.BACK_BUFFER_LENGTH;e.length&&(r=Math.max(r,e.start(0)));const i=t-n;return Math.min(i,r)})(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,n=e.part,r={resolvedUri:n?n.resolvedUri:t.resolvedUri,byterange:n?n.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},i=e.playlist.segments[e.mediaIndex-1];if(i&&i.timeline===t.timeline&&(i.videoTimingInfo?r.baseStartTime=i.videoTimingInfo.transmuxedDecodeEnd:i.audioTimingInfo&&(r.baseStartTime=i.audioTimingInfo.transmuxedDecodeEnd)),t.key){const n=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);r.key=this.segmentKey(t.key),r.key.iv=n}return t.map&&(r.map=this.initSegmentForMap(t.map)),r}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){this.pendingSegment_.byteLength=t.bytesReceived,e<yu?this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record 0.016666666666666666`):(this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime)}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,n){if(this.callQueue_.length)return void this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,n));if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return;if(t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state="READY",e.code===Yo)return;return this.pause(),e.code===Vo?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"))}const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),r.endOfAllRequests=t.endOfAllRequests,n.gopInfo&&(this.gopBuffer_=((e,t,n)=>{if(!t.length)return e;if(n)return t.slice();const r=t[0].pts;let i=0;for(;i<e.length&&!(e[i].pts>=r);i++);return e.slice(0,i).concat(t)})(this.gopBuffer_,n.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(r)}setTimeMapping_(e){const t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:n,firstVideoFrameTimeForData:r,currentVideoTimestampOffset:i,useVideoTimingInfo:a,videoTimingInfo:s,audioTimingInfo:o}){if(void 0!==e)return e;if(!a)return o.start;const u=t.segments[n-1];return 0!==n&&u&&void 0!==u.start&&u.end===r+i?s.start:r}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t)return this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),void this.trigger("error");const{hasAudio:n,hasVideo:r,isMuxed:i}=t,a="main"===this.loaderType_&&r,s=!this.audioDisabled_&&n&&!i;if(e.waitingOnAppends=0,!e.hasAppendedData_)return e.timingInfo||"number"!=typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);a&&e.waitingOnAppends++,s&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),s&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=((e,t,n)=>"main"===e&&t&&n?n.hasAudio||n.hasVideo?t.hasVideo&&!n.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&n.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null)(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!t&&(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger("error"),!0)}updateSourceBufferTimestampOffset_(e){if(null===e.timestampOffset||"number"!=typeof e.timingInfo.start||e.changedTimestampOffset||"main"!==this.loaderType_)return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:n}){return this.useDtsForTimestampOffset_?e&&"number"==typeof e.transmuxedDecodeStart?e.transmuxedDecodeStart:t&&"number"==typeof t.transmuxedDecodeStart?t.transmuxedDecodeStart:n.start:n.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),n="main"===this.loaderType_&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;n&&(e.timingInfo.end="number"==typeof n.end?n.end:n.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());const e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});const t=((e,t)=>{if("hls"!==t)return null;const n=(e=>{let t=0;return["video","audio"].forEach((function(n){const r=e[`${n}TimingInfo`];if(!r)return;const{start:a,end:s}=r;let o;"bigint"==typeof a||"bigint"==typeof s?o=i().BigInt(s)-i().BigInt(a):"number"==typeof a&&"number"==typeof s&&(o=s-a),void 0!==o&&o>t&&(t=o)})),"bigint"==typeof t&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),t})({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!n)return null;const r=e.playlist.targetDuration,a=bu({segmentDuration:n,maxDuration:2*r}),s=bu({segmentDuration:n,maxDuration:r}),o=`Segment with index ${e.mediaIndex} from playlist ${e.playlist.id} has a duration of ${n} when the reported duration is ${e.duration} and the target duration is ${r}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return a||s?{severity:a?"warn":"info",message:o}:null})(e,this.sourceType_);if(t&&("warn"===t.severity?hs.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_))return void this.logger_(`Throwing away un-appended sync request ${vu(e)}`);this.logger_(`Appended ${vu(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const n=e.segment,r=e.part,a=n.end&&this.currentTime_()-n.end>3*e.playlist.targetDuration,s=r&&r.end&&this.currentTime_()-r.end>3*e.playlist.partTargetDuration;if(a||s)return this.logger_(`bad ${a?"segment":"part"} ${vu(e)}`),void this.resetEverything();null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duration<yu)return void this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record 0.016666666666666666`);const t=this.throughput.rate,n=Date.now()-e.endOfAllRequests+1,r=Math.floor(e.byteLength/n*8*1e3);this.throughput.rate+=(r-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,n=t.start,r=t.end;if(!mu(n)||!mu(r))return;gu(n,r,this.segmentMetadataTrack_);const a=i().WebKitDataCue||i().VTTCue,s={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:n,end:r},o=new a(n,r,JSON.stringify(s));o.value=s,this.segmentMetadataTrack_.addCue(o)}}function Su(){}const wu=function(e){return"string"!=typeof e?e:e.replace(/./,(e=>e.toUpperCase()))},Au=["video","audio"],Iu=(e,t)=>{const n=t[`${e}Buffer`];return n&&n.updating||t.queuePending[e]},Cu=(e,t)=>{if(0===t.queue.length)return;let n=0,r=t.queue[n];if("mediaSource"!==r.type){if("mediaSource"!==e&&t.ready()&&"closed"!==t.mediaSource.readyState&&!Iu(e,t)){if(r.type!==e){if(n=((e,t)=>{for(let n=0;n<t.length;n++){const r=t[n];if("mediaSource"===r.type)return null;if(r.type===e)return n}return null})(e,t.queue),null===n)return;r=t.queue[n]}return t.queue.splice(n,1),t.queuePending[e]=r,r.action(e,t),r.doneFn?void 0:(t.queuePending[e]=null,void Cu(e,t))}}else t.updating()||"closed"===t.mediaSource.readyState||(t.queue.shift(),r.action(t),r.doneFn&&r.doneFn(),Cu("audio",t),Cu("video",t))},Ru=(e,t)=>{const n=t[`${e}Buffer`],r=wu(e);n&&(n.removeEventListener("updateend",t[`on${r}UpdateEnd_`]),n.removeEventListener("error",t[`on${r}Error_`]),t.codecs[e]=null,t[`${e}Buffer`]=null)},Du=(e,t)=>e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t),xu=(e,t,n)=>(r,i)=>{const a=i[`${r}Buffer`];if(Du(i.mediaSource,a)){i.logger_(`Appending segment ${t.mediaIndex}'s ${e.length} bytes to ${r}Buffer`);try{a.appendBuffer(e)}catch(e){i.logger_(`Error with code ${e.code} `+(22===e.code?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${t.mediaIndex} to ${r}Buffer`),i.queuePending[r]=null,n(e)}}},Nu=(e,t)=>(n,r)=>{const i=r[`${n}Buffer`];if(Du(r.mediaSource,i)){r.logger_(`Removing ${e} to ${t} from ${n}Buffer`);try{i.remove(e,t)}catch(i){r.logger_(`Remove ${e} to ${t} from ${n}Buffer failed`)}}},Ou=e=>(t,n)=>{const r=n[`${t}Buffer`];Du(n.mediaSource,r)&&(n.logger_(`Setting ${t}timestampOffset to ${e}`),r.timestampOffset=e)},Pu=e=>(t,n)=>{e()},Mu=e=>t=>{if("open"===t.mediaSource.readyState){t.logger_(`Calling mediaSource endOfStream(${e||""})`);try{t.mediaSource.endOfStream(e)}catch(e){hs.log.warn("Failed to call media source endOfStream",e)}}},ku=e=>t=>{t.logger_(`Setting mediaSource duration to ${e}`);try{t.mediaSource.duration=e}catch(e){hs.log.warn("Failed to set media source duration",e)}},Lu=(e,t)=>n=>{const r=wu(e),i=k(t);n.logger_(`Adding ${e}Buffer with codec ${t} to mediaSource`);const a=n.mediaSource.addSourceBuffer(i);a.addEventListener("updateend",n[`on${r}UpdateEnd_`]),a.addEventListener("error",n[`on${r}Error_`]),n.codecs[e]=t,n[`${e}Buffer`]=a},Fu=e=>t=>{const n=t[`${e}Buffer`];if(Ru(e,t),Du(t.mediaSource,n)){t.logger_(`Removing ${e}Buffer with codec ${t.codecs[e]} from mediaSource`);try{t.mediaSource.removeSourceBuffer(n)}catch(t){hs.log.warn(`Failed to removeSourceBuffer ${e}Buffer`,t)}}},Uu=e=>(t,n)=>{const r=n[`${t}Buffer`],i=k(e);Du(n.mediaSource,r)&&n.codecs[t]!==e&&(n.logger_(`changing ${t}Buffer codec from ${n.codecs[t]} to ${e}`),r.changeType(i),n.codecs[t]=e)},Bu=({type:e,sourceUpdater:t,action:n,doneFn:r,name:i})=>{t.queue.push({type:e,action:n,doneFn:r,name:i}),Cu(e,t)},ju=(e,t)=>n=>{if(t.queuePending[e]){const n=t.queuePending[e].doneFn;t.queuePending[e]=null,n&&n(t[`${e}Error_`])}Cu(e,t)};class qu extends hs.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Cu("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=Ts("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=ju("video",this),this.onAudioUpdateEnd_=ju("audio",this),this.onVideoError_=e=>{this.videoError_=e},this.onAudioError_=e=>{this.audioError_=e},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){Bu({type:"mediaSource",sourceUpdater:this,action:Lu(e,t),name:"addSourceBuffer"})}abort(e){Bu({type:e,sourceUpdater:this,action:(e,t)=>{if("open"!==t.mediaSource.readyState)return;const n=t[`${e}Buffer`];if(Du(t.mediaSource,n)){t.logger_(`calling abort on ${e}Buffer`);try{n.abort()}catch(t){hs.log.warn(`Failed to abort on ${e}Buffer`,t)}}},name:"abort"})}removeSourceBuffer(e){this.canRemoveSourceBuffer()?Bu({type:"mediaSource",sourceUpdater:this,action:Fu(e),name:"removeSourceBuffer"}):hs.log.error("removeSourceBuffer is not supported!")}canRemoveSourceBuffer(){return!hs.browser.IS_FIREFOX&&i().MediaSource&&i().MediaSource.prototype&&"function"==typeof i().MediaSource.prototype.removeSourceBuffer}static canChangeType(){return i().SourceBuffer&&i().SourceBuffer.prototype&&"function"==typeof i().SourceBuffer.prototype.changeType}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){this.canChangeType()?Bu({type:e,sourceUpdater:this,action:Uu(t),name:"changeType"}):hs.log.error("changeType is not supported!")}addOrChangeSourceBuffers(e){if(!e||"object"!=typeof e||0===Object.keys(e).length)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach((t=>{const n=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,n);this.canChangeType()&&this.changeType(t,n)}))}appendBuffer(e,t){const{segmentInfo:n,type:r,bytes:i}=e;if(this.processedAppend_=!0,"audio"===r&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_(`delayed audio append of ${i.length} until video append`);if(Bu({type:r,sourceUpdater:this,action:xu(i,n||{mediaIndex:-1},t),doneFn:t,name:"appendBuffer"}),"video"===r){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const e=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${e.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,e.forEach((e=>{this.appendBuffer.apply(this,e)}))}}audioBuffered(){return Du(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Es()}videoBuffered(){return Du(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Es()}buffered(){const e=Du(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Du(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():function(e,t){let n=null,r=null,i=0;const a=[],s=[];if(!(e&&e.length&&t&&t.length))return Es();let o=e.length;for(;o--;)a.push({time:e.start(o),type:"start"}),a.push({time:e.end(o),type:"end"});for(o=t.length;o--;)a.push({time:t.start(o),type:"start"}),a.push({time:t.end(o),type:"end"});for(a.sort((function(e,t){return e.time-t.time})),o=0;o<a.length;o++)"start"===a[o].type?(i++,2===i&&(n=a[o].time)):"end"===a[o].type&&(i--,1===i&&(r=a[o].time)),null!==n&&null!==r&&(s.push([n,r]),n=null,r=null);return Es(s)}(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=Su){Bu({type:"mediaSource",sourceUpdater:this,action:ku(e),name:"duration",doneFn:t})}endOfStream(e=null,t=Su){"string"!=typeof e&&(e=void 0),Bu({type:"mediaSource",sourceUpdater:this,action:Mu(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,n=Su){this.audioBuffered().length&&0!==this.audioBuffered().end(0)?Bu({type:"audio",sourceUpdater:this,action:Nu(e,t),doneFn:n,name:"remove"}):n()}removeVideo(e,t,n=Su){this.videoBuffered().length&&0!==this.videoBuffered().end(0)?Bu({type:"video",sourceUpdater:this,action:Nu(e,t),doneFn:n,name:"remove"}):n()}updating(){return!(!Iu("audio",this)&&!Iu("video",this))}audioTimestampOffset(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Bu({type:"audio",sourceUpdater:this,action:Ou(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset!==e&&(Bu({type:"video",sourceUpdater:this,action:Ou(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&Bu({type:"audio",sourceUpdater:this,action:Pu(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&Bu({type:"video",sourceUpdater:this,action:Pu(e),name:"callback"})}dispose(){this.trigger("dispose"),Au.forEach((e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`]((()=>Ru(e,this)))})),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const Hu=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e))),Gu=new Uint8Array("\n\n".split("").map((e=>e.charCodeAt(0))));class Vu extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class Yu extends Eu{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.loaderType_="subtitle",this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Es();const e=this.subtitlesTrack_.cues;return Es([[e[0].startTime,e[e.length-1].startTime]])}initSegmentForMap(e,t=!1){if(!e)return null;const n=To(e);let r=this.initSegments_[n];if(t&&!r&&e.bytes){const t=Gu.byteLength+e.bytes.byteLength,i=new Uint8Array(t);i.set(e.bytes),i.set(Gu,e.bytes.byteLength),this.initSegments_[n]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:i}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return void 0===e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}remove(e,t){gu(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(null===this.syncController_.timestampOffsetForTimeline(e.timeline)){const e=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};return this.syncController_.one("timestampoffset",e),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,n){if(!this.subtitlesTrack_)return void(this.state="READY");if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===Vo&&this.handleTimeout_(),e.code===Yo?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const a=r.segment;if(a.map&&(a.map.bytes=t.map.bytes),r.bytes=t.bytes,"function"!=typeof i().WebVTT&&"function"==typeof this.loadVttJs)return this.state="WAITING_ON_VTTJS",void this.loadVttJs().then((()=>this.segmentRequestFinished_(e,t,n)),(()=>this.stopForError({message:"Error loading vtt.js"})));a.requested=!0;try{this.parseVTTCues_(r)}catch(e){return void this.stopForError({message:e.message})}if(this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,r.cues.forEach((e=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new(i().VTTCue)(e.startTime,e.endTime,e.text):e)})),function(e){const t=e.cues;if(!t)return;const n={};for(let r=t.length-1;r>=0;r--){const i=t[r],a=`${i.startTime}-${i.endTime}-${i.text}`;n[a]?e.removeCue(i):n[a]=i}}(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let t,n=!1;if("function"!=typeof i().WebVTT)throw new Vu;"function"==typeof i().TextDecoder?t=new(i().TextDecoder)("utf8"):(t=i().WebVTT.StringDecoder(),n=!0);const r=new(i().WebVTT.Parser)(i(),i().vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=t=>{e.timestampmap=t},r.onparsingerror=e=>{hs.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){let t=e.segment.map.bytes;n&&(t=Hu(t)),r.parse(t)}let a=e.bytes;n&&(a=Hu(a)),r.parse(a),r.flush()}updateTimeMapping_(e,t,n){const r=e.segment;if(!t)return;if(!e.cues.length)return void(r.empty=!0);const i=e.timestampmap,a=i.MPEGTS/dt.ONE_SECOND_IN_TS-i.LOCAL+t.mapping;if(e.cues.forEach((e=>{e.startTime+=a,e.endTime+=a})),!n.syncInfo){const t=e.cues[0].startTime,i=e.cues[e.cues.length-1].startTime;n.syncInfo={mediaSequence:n.mediaSequence+e.mediaIndex,time:Math.min(t,i-r.duration)}}}}const zu=function(e,t){const n=e.cues;for(let e=0;e<n.length;e++){const r=n[e];if(t>=r.adStartTime&&t<=r.adEndTime)return r}return null},Zu=[{name:"VOD",run:(e,t,n,r,i)=>n!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(e,t,n,r,i,a)=>{if(!a)return null;const s=e.getMediaSequenceMap(a);if(!s||0===s.size)return null;if(void 0===t.mediaSequence||!Array.isArray(t.segments)||!t.segments.length)return null;let o=t.mediaSequence,u=0;for(const e of t.segments){const t=s.get(o);if(!t)break;if(i>=t.start&&i<t.end){if(Array.isArray(e.parts)&&e.parts.length){let n=t.start,r=0;for(const a of e.parts){const e=n,s=e+a.duration;if(i>=e&&i<s)return{time:t.start,segmentIndex:u,partIndex:r};r++,n=s}}return{time:t.start,segmentIndex:u,partIndex:null}}u++,o++}return null}},{name:"ProgramDateTime",run:(e,t,n,r,i)=>{if(!Object.keys(e.timelineToDatetimeMappings).length)return null;let a=null,s=null;const o=Ps(t);i=i||0;for(let n=0;n<o.length;n++){const r=o[t.endList||0===i?n:o.length-(n+1)],u=r.segment,l=e.timelineToDatetimeMappings[u.timeline];if(!l||!u.dateTimeObject)continue;let c=u.dateTimeObject.getTime()/1e3+l;if(u.parts&&"number"==typeof r.partIndex)for(let e=0;e<r.partIndex;e++)c+=u.parts[e].duration;const d=Math.abs(i-c);if(null!==s&&(0===d||s<d))break;s=d,a={time:c,segmentIndex:r.segmentIndex,partIndex:r.partIndex}}return a}},{name:"Segment",run:(e,t,n,r,i)=>{let a=null,s=null;i=i||0;const o=Ps(t);for(let e=0;e<o.length;e++){const n=o[t.endList||0===i?e:o.length-(e+1)],u=n.segment,l=n.part&&n.part.start||u&&u.start;if(u.timeline===r&&void 0!==l){const e=Math.abs(i-l);if(null!==s&&s<e)break;(!a||null===s||s>=e)&&(s=e,a={time:l,segmentIndex:n.segmentIndex,partIndex:n.partIndex})}}return a}},{name:"Discontinuity",run:(e,t,n,r,i)=>{let a=null;if(i=i||0,t.discontinuityStarts&&t.discontinuityStarts.length){let n=null;for(let r=0;r<t.discontinuityStarts.length;r++){const s=t.discontinuityStarts[r],o=t.discontinuitySequence+r+1,u=e.discontinuities[o];if(u){const e=Math.abs(i-u.time);if(null!==n&&n<e)break;(!a||null===n||n>=e)&&(n=e,a={time:u.time,segmentIndex:s,partIndex:null})}}}return a}},{name:"Playlist",run:(e,t,n,r,i)=>t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}];class Ku extends hs.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={},this.mediaSequenceStorage_=new Map,this.logger_=Ts("SyncController")}getMediaSequenceMap(e){return this.mediaSequenceStorage_.get(e)}updateMediaSequenceMap(e,t,n){if(void 0===e.mediaSequence||!Array.isArray(e.segments)||!e.segments.length)return;const r=this.getMediaSequenceMap(n),i=new Map;let a,s=e.mediaSequence;r?r.has(e.mediaSequence)?a=r.get(e.mediaSequence).start:(this.logger_(`MediaSequence sync for ${n} segment loader - received a gap between playlists.\nFallback base time to: ${t}.\nReceived media sequence: ${s}.\nCurrent map: `,r),a=t):a=0,this.logger_(`MediaSequence sync for ${n} segment loader.\nReceived media sequence: ${s}.\nbase time is ${a}\nCurrent map: `,r),e.segments.forEach((e=>{const t=a,n=t+e.duration,r={start:t,end:n};i.set(s,r),s++,a=n})),this.mediaSequenceStorage_.set(n,i)}getSyncPoint(e,t,n,r,i){if(t!==1/0)return Zu.find((({name:e})=>"VOD"===e)).run(this,e,t);const a=this.runStrategies_(e,t,n,r,i);if(!a.length)return null;for(const t of a){const{syncPoint:n,strategy:i}=t,{segmentIndex:a,time:s}=n;if(a<0)continue;const o=s,u=o+e.segments[a].duration;if(this.logger_(`Strategy: ${i}. Current time: ${r}. selected segment: ${a}. Time: [${o} -> ${u}]}`),r>=o&&r<u)return this.logger_("Found sync point with exact match: ",n),n}return this.selectSyncPoint_(a,{key:"time",value:r})}getExpiredTime(e,t){if(!e||!e.segments)return null;const n=this.runStrategies_(e,t,e.discontinuitySequence,0,"main");if(!n.length)return null;const r=this.selectSyncPoint_(n,{key:"segmentIndex",value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+Bs({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,n,r,i){const a=[];for(let s=0;s<Zu.length;s++){const o=Zu[s],u=o.run(this,e,t,n,r,i);u&&(u.strategy=o.name,a.push({strategy:o.name,syncPoint:u}))}return a}selectSyncPoint_(e,t){let n=e[0].syncPoint,r=Math.abs(e[0].syncPoint[t.key]-t.value),i=e[0].strategy;for(let a=1;a<e.length;a++){const s=Math.abs(e[a].syncPoint[t.key]-t.value);s<r&&(r=s,n=e[a].syncPoint,i=e[a].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${i}]: [time:${n.time}, segmentIndex:${n.segmentIndex}`+("number"==typeof n.partIndex?`,partIndex:${n.partIndex}`:"")+"]"),n}saveExpiredSegmentInfo(e,t){const n=t.mediaSequence-e.mediaSequence;if(n>86400)hs.log.warn(`Not saving expired segment info. Media sequence gap ${n} is too large.`);else for(let r=n-1;r>=0;r--){const n=e.segments[r];if(n&&void 0!==n.start){t.syncInfo={mediaSequence:e.mediaSequence+r,time:n.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],n=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-n}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const n=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;n&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const i=r.dateTimeObject;r.discontinuity&&t&&i&&(this.timelineToDatetimeMappings[r.timeline]=-i.getTime()/1e3)}timestampOffsetForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].time}mappingForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,n){const r=e.segment,i=e.part;let a,s,o=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},n&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${o.time}] [mapping: ${o.mapping}]`)),a=e.startOfSegment,s=t.end+o.mapping;else{if(!o)return!1;a=t.start+o.mapping,s=t.end+o.mapping}return i&&(i.start=a,i.end=s),(!r.start||a<r.start)&&(r.start=a),r.end=s,!0}saveDiscontinuitySyncInfo_(e){const t=e.playlist,n=e.segment;if(n.discontinuity)this.discontinuities[n.timeline]={time:n.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let r=0;r<t.discontinuityStarts.length;r++){const i=t.discontinuityStarts[r],a=t.discontinuitySequence+r+1,s=i-e.mediaIndex,o=Math.abs(s);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>o){let r;r=s<0?n.start-Bs({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:i}):n.end+Bs({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:i}),this.discontinuities[a]={time:r,accuracy:o}}}}dispose(){this.trigger("dispose"),this.off()}}class Wu extends hs.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:n}){return"number"==typeof t&&"number"==typeof n&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:n},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:n}){return"number"==typeof t&&"number"==typeof n&&(this.lastTimelineChanges_[e]={type:e,from:t,to:n},delete this.pendingTimelineChanges_[e],this.trigger("timelinechange")),this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const Xu=ko(Lo((function(){var e=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(n,1),n>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var n=t.length,r=0;r<n;++r)t[r].call(this,arguments[1]);else for(var i=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,i)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}();let t=null;class r{constructor(e){let n,r,i;t||(t=function(){const e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],n=e[1],r=t[4],i=n[4];let a,s,o;const u=[],l=[];let c,d,f,h,p,g;for(a=0;a<256;a++)l[(u[a]=a<<1^283*(a>>7))^a]=a;for(s=o=0;!r[s];s^=c||1,o=l[o]||1)for(h=o^o<<1^o<<2^o<<3^o<<4,h=h>>8^255&h^99,r[s]=h,i[h]=s,f=u[d=u[c=u[s]]],g=16843009*f^65537*d^257*c^16843008*s,p=257*u[h]^16843008*h,a=0;a<4;a++)t[a][s]=p=p<<24^p>>>8,n[a][h]=g=g<<24^g>>>8;for(a=0;a<5;a++)t[a]=t[a].slice(0),n[a]=n[a].slice(0);return e}()),this._tables=[[t[0][0].slice(),t[0][1].slice(),t[0][2].slice(),t[0][3].slice(),t[0][4].slice()],[t[1][0].slice(),t[1][1].slice(),t[1][2].slice(),t[1][3].slice(),t[1][4].slice()]];const a=this._tables[0][4],s=this._tables[1],o=e.length;let u=1;if(4!==o&&6!==o&&8!==o)throw new Error("Invalid aes key size");const l=e.slice(0),c=[];for(this._key=[l,c],n=o;n<4*o+28;n++)i=l[n-1],(n%o==0||8===o&&n%o==4)&&(i=a[i>>>24]<<24^a[i>>16&255]<<16^a[i>>8&255]<<8^a[255&i],n%o==0&&(i=i<<8^i>>>24^u<<24,u=u<<1^283*(u>>7))),l[n]=l[n-o]^i;for(r=0;n;r++,n--)i=l[3&r?n:n-4],c[r]=n<=4||r<4?i:s[0][a[i>>>24]]^s[1][a[i>>16&255]]^s[2][a[i>>8&255]]^s[3][a[255&i]]}decrypt(e,t,n,r,i,a){const s=this._key[1];let o,u,l,c=e^s[0],d=r^s[1],f=n^s[2],h=t^s[3];const p=s.length/4-2;let g,m=4;const y=this._tables[1],v=y[0],_=y[1],T=y[2],b=y[3],E=y[4];for(g=0;g<p;g++)o=v[c>>>24]^_[d>>16&255]^T[f>>8&255]^b[255&h]^s[m],u=v[d>>>24]^_[f>>16&255]^T[h>>8&255]^b[255&c]^s[m+1],l=v[f>>>24]^_[h>>16&255]^T[c>>8&255]^b[255&d]^s[m+2],h=v[h>>>24]^_[c>>16&255]^T[d>>8&255]^b[255&f]^s[m+3],m+=4,c=o,d=u,f=l;for(g=0;g<4;g++)i[(3&-g)+a]=E[c>>>24]<<24^E[d>>16&255]<<16^E[f>>8&255]<<8^E[255&h]^s[m++],o=c,c=d,d=f,f=h,h=o}}class i extends e{constructor(){super(e),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24};class s{constructor(e,t,n,r){const o=s.STEP,u=new Int32Array(e.buffer),l=new Uint8Array(e.byteLength);let c=0;for(this.asyncStream_=new i,this.asyncStream_.push(this.decryptChunk_(u.subarray(c,c+o),t,n,l)),c=o;c<u.length;c+=o)n=new Uint32Array([a(u[c-4]),a(u[c-3]),a(u[c-2]),a(u[c-1])]),this.asyncStream_.push(this.decryptChunk_(u.subarray(c,c+o),t,n,l));this.asyncStream_.push((function(){var e;r(null,(e=l).subarray(0,e.byteLength-e[e.byteLength-1]))}))}static get STEP(){return 32e3}decryptChunk_(e,t,n,i){return function(){const s=function(e,t,n){const i=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),s=new r(Array.prototype.slice.call(t)),o=new Uint8Array(e.byteLength),u=new Int32Array(o.buffer);let l,c,d,f,h,p,g,m,y;for(l=n[0],c=n[1],d=n[2],f=n[3],y=0;y<i.length;y+=4)h=a(i[y]),p=a(i[y+1]),g=a(i[y+2]),m=a(i[y+3]),s.decrypt(h,p,g,m,u,y),u[y]=a(u[y]^l),u[y+1]=a(u[y+1]^c),u[y+2]=a(u[y+2]^d),u[y+3]=a(u[y+3]^f),l=h,c=p,d=g,f=m;return o}(e,t,n);i.set(s,e.byteOffset)}}}var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},u=("undefined"!=typeof window?window:void 0!==o?o:"undefined"!=typeof self?self:{}).BigInt||Number;u("0x1"),u("0x100"),u("0x10000"),u("0x1000000"),u("0x100000000"),u("0x10000000000"),u("0x1000000000000"),u("0x100000000000000"),u("0x10000000000000000"),function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);255===t[0]||t[0]}();self.onmessage=function(e){const t=e.data,n=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),r=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),i=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new s(n,r,i,(function(e,n){self.postMessage(function(e){const t={};return Object.keys(e).forEach((n=>{const r=e[n];var i;i=r,("function"===ArrayBuffer.isView?ArrayBuffer.isView(i):i&&i.buffer instanceof ArrayBuffer)?t[n]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[n]=r})),t}({source:t.source,decrypted:n}),[n.buffer])}))}})));var $u=Mo(Xu);const Qu=e=>{let t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},Ju=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},el=(e,t)=>{t.activePlaylistLoader=e,e.load()},tl={AUDIO:(e,t)=>()=>{const{mediaTypes:{[e]:n},excludePlaylist:r}=t,i=n.activeTrack(),a=n.activeGroup(),s=(a.filter((e=>e.default))[0]||a[0]).id,o=n.tracks[s];if(i!==o){hs.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const e in n.tracks)n.tracks[e].enabled=n.tracks[e]===o;n.onTrackChanged()}else r({error:{message:"Problem encountered loading the default audio track."}})},SUBTITLES:(e,t)=>()=>{const{mediaTypes:{[e]:n}}=t;hs.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged()}},nl={AUDIO:(e,t,n)=>{if(!t)return;const{tech:r,requestOptions:i,segmentLoaders:{[e]:a}}=n;t.on("loadedmetadata",(()=>{const e=t.media();a.playlist(e,i),(!r.paused()||e.endList&&"none"!==r.preload())&&a.load()})),t.on("loadedplaylist",(()=>{a.playlist(t.media(),i),r.paused()||a.load()})),t.on("error",tl[e](e,n))},SUBTITLES:(e,t,n)=>{const{tech:r,requestOptions:i,segmentLoaders:{[e]:a},mediaTypes:{[e]:s}}=n;t.on("loadedmetadata",(()=>{const e=t.media();a.playlist(e,i),a.track(s.activeTrack()),(!r.paused()||e.endList&&"none"!==r.preload())&&a.load()})),t.on("loadedplaylist",(()=>{a.playlist(t.media(),i),r.paused()||a.load()})),t.on("error",tl[e](e,n))}},rl={AUDIO:(e,t)=>{const{vhs:n,sourceType:r,segmentLoaders:{[e]:i},requestOptions:a,main:{mediaGroups:s},mediaTypes:{[e]:{groups:o,tracks:u,logger_:l}},mainPlaylistLoader:c}=t,d=Ks(c.main);s[e]&&0!==Object.keys(s[e]).length||(s[e]={main:{default:{default:!0}}},d&&(s[e].main.default.playlists=c.main.playlists));for(const i in s[e]){o[i]||(o[i]=[]);for(const f in s[e][i]){let h,p=s[e][i][f];if(d?(l(`AUDIO group '${i}' label '${f}' is a main playlist`),p.isMainPlaylist=!0,h=null):h="vhs-json"===r&&p.playlists?new co(p.playlists[0],n,a):p.resolvedUri?new co(p.resolvedUri,n,a):p.playlists&&"dash"===r?new No(p.playlists[0],n,a,c):null,p=bs({id:f,playlistLoader:h},p),nl[e](e,p.playlistLoader,t),o[i].push(p),void 0===u[f]){const e=new hs.AudioTrack({id:f,kind:Qu(p),enabled:!1,language:p.language,default:p.default,label:f});u[f]=e}}}i.on("error",tl[e](e,t))},SUBTITLES:(e,t)=>{const{tech:n,vhs:r,sourceType:i,segmentLoaders:{[e]:a},requestOptions:s,main:{mediaGroups:o},mediaTypes:{[e]:{groups:u,tracks:l}},mainPlaylistLoader:c}=t;for(const a in o[e]){u[a]||(u[a]=[]);for(const d in o[e][a]){if(!r.options_.useForcedSubtitles&&o[e][a][d].forced)continue;let f,h=o[e][a][d];if("hls"===i)f=new co(h.resolvedUri,r,s);else if("dash"===i){if(!h.playlists.filter((e=>e.excludeUntil!==1/0)).length)return;f=new No(h.playlists[0],r,s,c)}else"vhs-json"===i&&(f=new co(h.playlists?h.playlists[0]:h.resolvedUri,r,s));if(h=bs({id:d,playlistLoader:f},h),nl[e](e,h.playlistLoader,t),u[a].push(h),void 0===l[d]){const e=n.addRemoteTextTrack({id:d,kind:"subtitles",default:h.default&&h.autoselect,language:h.language,label:d},!1).track;l[d]=e}}}a.on("error",tl[e](e,t))},"CLOSED-CAPTIONS":(e,t)=>{const{tech:n,main:{mediaGroups:r},mediaTypes:{[e]:{groups:i,tracks:a}}}=t;for(const t in r[e]){i[t]||(i[t]=[]);for(const s in r[e][t]){const o=r[e][t][s];if(!/^(?:CC|SERVICE)/.test(o.instreamId))continue;const u=n.options_.vhs&&n.options_.vhs.captionServices||{};let l={label:s,language:o.language,instreamId:o.instreamId,default:o.default&&o.autoselect};if(u[l.instreamId]&&(l=bs(l,u[l.instreamId])),void 0===l.default&&delete l.default,i[t].push(bs({id:s},o)),void 0===a[s]){const e=n.addRemoteTextTrack({id:l.instreamId,kind:"captions",default:l.default,language:l.language,label:l.label},!1).track;a[s]=e}}}}},il=(e,t)=>{for(let n=0;n<e.length;n++){if(zs(t,e[n]))return!0;if(e[n].playlists&&il(e[n].playlists,t))return!0}return!1},al={AUDIO:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:n}}}=t;for(const e in n)if(n[e].enabled)return n[e];return null},SUBTITLES:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:n}}}=t;for(const e in n)if("showing"===n[e].mode||"hidden"===n[e].mode)return n[e];return null}};class sl{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){1===e&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=vs(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map((e=>[e.ID,e]))))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class ol extends hs.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new sl,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=Ts("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const n=t.serverUri||t.serverURL;if(!n)return this.logger_(`steering manifest URL is ${n}, cannot request steering manifest.`),void this.trigger("error");n.startsWith("data:")?this.decodeDataUriManifest_(n.substring(n.indexOf(",")+1)):(this.steeringManifest.reloadUri=vs(e,n),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering"))}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const n=e?t:this.getRequestURI(t);if(!n)return this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),void this.dispose();this.request_=this.xhr_({uri:n},((e,t)=>{if(e){if(410===t.status)return this.logger_(`manifest request 410 ${e}.`),this.logger_(`There will be no more content steering requests to ${n} this session.`),void this.excludedSteeringManifestURLs.add(n);if(429===t.status){const n=t.responseHeaders["retry-after"];return this.logger_(`manifest request 429 ${e}.`),this.logger_(`content steering will retry in ${n} seconds.`),void this.startTTLTimeout_(parseInt(n,10))}return this.logger_(`manifest failed to load ${e}.`),void this.startTTLTimeout_()}const r=JSON.parse(this.request_.responseText);this.assignSteeringProperties_(r),this.startTTLTimeout_()}))}setProxyServerUrl_(e){const t=new(i().URL)(e),n=new(i().URL)(this.proxyServerUrl_);return n.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(n.toString())}decodeDataUriManifest_(e){const t=JSON.parse(i().atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new(i().URL)(e),n=this.getPathway(),r=this.getBandwidth_();if(n){const e=`_${this.manifestType_}_pathway`;t.searchParams.set(e,n)}if(r){const e=`_${this.manifestType_}_throughput`;t.searchParams.set(e,r)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version)return this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),void this.trigger("error");this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const t=(e=>{for(const t of e)if(this.availablePathways_.has(t))return t;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==t&&(this.currentPathway=t,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=e=>this.excludedSteeringManifestURLs.has(e);if(this.proxyServerUrl_){const n=this.setProxyServerUrl_(e);if(!t(n))return n}const n=this.setSteeringParams_(e);return t(n)?null:n}startTTLTimeout_(e=this.steeringManifest.ttl){const t=1e3*e;this.ttlTimeout_=i().setTimeout((()=>{this.requestSteeringManifest()}),t)}clearTTLTimeout_(){i().clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new sl}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(vs(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}let ul;const ll=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],cl=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]};class dl extends hs.EventTarget{constructor(e){super();const{src:t,withCredentials:n,tech:r,bandwidth:a,externVhs:s,useCueTags:o,playlistExclusionDuration:u,enableLowInitialPlaylist:l,sourceType:c,cacheEncryptionKeys:d,bufferBasedABR:f,leastPixelDiffSelector:h,captionServices:p}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:g}=e;null==g&&(g=1/0),ul=s,this.bufferBasedABR=Boolean(f),this.leastPixelDiffSelector=Boolean(h),this.withCredentials=n,this.tech_=r,this.vhs_=r.vhs,this.sourceType_=c,this.useCueTags_=o,this.playlistExclusionDuration=u,this.maxPlaylistRetries=g,this.enableLowInitialPlaylist=l,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:n,maxPlaylistRetries:g,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=(()=>{const e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((t=>{e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Su,activeTrack:Su,getActiveGroup:Su,onGroupChanged:Su,onTrackChanged:Su,lastTrack_:null,logger_:Ts(`MediaGroups[${t}]`)}})),e})(),this.mediaSource=new(i().MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.seekable_=Es(),this.hasPlayed_=!1,this.syncController_=new Ku(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new $u,this.sourceUpdater_=new qu(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new Wu,this.keyStatusMap_=new Map;const m={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:p,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:a,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:d,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_="dash"===this.sourceType_?new No(t,this.vhs_,bs(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new co(t,this.vhs_,bs(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Eu(bs(m,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new Eu(bs(m,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new Yu(bs(m,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise(((e,t)=>{function n(){r.off("vttjserror",i),e()}function i(){r.off("vttjsloaded",n),t()}r.one("vttjsloaded",n),r.one("vttjserror",i),r.addWebVttScript_()}))}),e),this.contentSteeringController_=new ol(this.vhs_.xhr,(()=>this.mainSegmentLoader_.bandwidth)),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",(()=>this.startABRTimer_())),this.tech_.on("pause",(()=>this.stopABRTimer_())),this.tech_.on("play",(()=>this.startABRTimer_()))),ll.forEach((e=>{this[e+"_"]=cl.bind(this,e)})),this.logger_=Ts("pc"),this.triggeredFmp4Usage=!1,"none"===this.tech_.preload()?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const y="none"===this.tech_.preload()?"play":"loadstart";this.tech_.one(y,(()=>{const e=Date.now();this.tech_.one("loadeddata",(()=>{this.timeToLoadedData__=Date.now()-e,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends}))}))}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return-1===e||-1===t?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,n){const r=this.media(),i=r&&(r.id||r.uri),a=e&&(e.id||e.uri);i&&i!==a&&(this.logger_(`switch media ${i} -> ${a} from ${t}`),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})),this.mainPlaylistLoader_.media(e,n)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((e=>{const t=this.mediaTypes_[e],n=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(n&&r){const t=(n.length?n[0].playlists:n.playlists).filter((e=>e.attributes.serviceLocation===r));t.length&&this.mediaTypes_[e].activePlaylistLoader.media(t[0])}}))}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=i().setInterval((()=>this.checkABR_()),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(i().clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const n=e.mediaGroups.AUDIO,r=Object.keys(n);let i;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)i=this.mediaTypes_.AUDIO.activeTrack();else{const e=n.main||r.length&&n[r[0]];for(const t in e)if(e[t].default){i={label:t};break}}if(!i)return t;const a=[];for(const t in n)if(n[t][i.label]){const r=n[t][i.label];if(r.playlists&&r.playlists.length)a.push.apply(a,r.playlists);else if(r.uri)a.push(r);else if(e.playlists.length)for(let n=0;n<e.playlists.length;n++){const r=e.playlists[n];r.attributes&&r.attributes.AUDIO&&r.attributes.AUDIO===t&&a.push(r)}}return a.length?a:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",(()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;Ys(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&"none"!==this.tech_.preload()&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),(e=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((t=>{rl[t](t,e)}));const{mediaTypes:t,mainPlaylistLoader:n,tech:r,vhs:i,segmentLoaders:{AUDIO:a,main:s}}=e;["AUDIO","SUBTITLES"].forEach((n=>{t[n].activeGroup=((e,t)=>n=>{const{mainPlaylistLoader:r,mediaTypes:{[e]:{groups:i}}}=t,a=r.media();if(!a)return null;let s=null;a.attributes[e]&&(s=i[a.attributes[e]]);const o=Object.keys(i);if(!s)if("AUDIO"===e&&o.length>1&&Ks(t.main))for(let e=0;e<o.length;e++){const t=i[o[e]];if(il(t,a)){s=t;break}}else i.main?s=i.main:1===o.length&&(s=i[o[0]]);return void 0===n?s:null!==n&&s&&s.filter((e=>e.id===n.id))[0]||null})(n,e),t[n].activeTrack=al[n](n,e),t[n].onGroupChanged=((e,t)=>()=>{const{segmentLoaders:{[e]:n,main:r},mediaTypes:{[e]:i}}=t,a=i.activeTrack(),s=i.getActiveGroup(),o=i.activePlaylistLoader,u=i.lastGroup_;s&&u&&s.id===u.id||(i.lastGroup_=s,i.lastTrack_=a,Ju(n,i),s&&!s.isMainPlaylist&&(s.playlistLoader?(n.resyncLoader(),el(s.playlistLoader,i)):o&&r.resetEverything()))})(n,e),t[n].onGroupChanging=((e,t)=>()=>{const{segmentLoaders:{[e]:n},mediaTypes:{[e]:r}}=t;r.lastGroup_=null,n.abort(),n.pause()})(n,e),t[n].onTrackChanged=((e,t)=>()=>{const{mainPlaylistLoader:n,segmentLoaders:{[e]:r,main:i},mediaTypes:{[e]:a}}=t,s=a.activeTrack(),o=a.getActiveGroup(),u=a.activePlaylistLoader,l=a.lastTrack_;if((!l||!s||l.id!==s.id)&&(a.lastGroup_=o,a.lastTrack_=s,Ju(r,a),o)){if(o.isMainPlaylist){if(!s||!l||s.id===l.id)return;const e=t.vhs.playlistController_,r=e.selectPlaylist();if(e.media()===r)return;return a.logger_(`track change. Switching main audio from ${l.id} to ${s.id}`),n.pause(),i.resetEverything(),void e.fastQualityChange_(r)}if("AUDIO"===e){if(!o.playlistLoader)return i.setAudio(!0),void i.resetEverything();r.setAudio(!0),i.setAudio(!1)}u!==o.playlistLoader?(r.track&&r.track(s),r.resetEverything(),el(o.playlistLoader,a)):el(o.playlistLoader,a)}})(n,e),t[n].getActiveGroup=((e,{mediaTypes:t})=>()=>{const n=t[e].activeTrack();return n?t[e].activeGroup(n):null})(n,e)}));const o=t.AUDIO.activeGroup();if(o){const e=(o.filter((e=>e.default))[0]||o[0]).id;t.AUDIO.tracks[e].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged(),t.AUDIO.getActiveGroup().playlistLoader?(s.setAudio(!1),a.setAudio(!0)):s.setAudio(!0)}n.on("mediachange",(()=>{["AUDIO","SUBTITLES"].forEach((e=>t[e].onGroupChanged()))})),n.on("mediachanging",(()=>{["AUDIO","SUBTITLES"].forEach((e=>t[e].onGroupChanging()))}));const u=()=>{t.AUDIO.onTrackChanged(),r.trigger({type:"usage",name:"vhs-audio-change"})};r.audioTracks().addEventListener("change",u),r.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),i.on("dispose",(()=>{r.audioTracks().removeEventListener("change",u),r.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)})),r.clearTracks("audio");for(const e in t.AUDIO.tracks)r.audioTracks().addTrack(t.AUDIO.tracks[e])})({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",(()=>{this.trigger("selectedinitialmedia")}))})),this.mainPlaylistLoader_.on("loadedplaylist",(()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){let t;if(this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_(),this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||(t=this.selectPlaylist()),!t||!this.shouldSwitchToMedia_(t))return;if(this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial"),"vhs-json"!==this.sourceType_||!this.initialMedia_.segments)return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)})),this.mainPlaylistLoader_.on("error",(()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})})),this.mainPlaylistLoader_.on("mediachanging",(()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()})),this.mainPlaylistLoader_.on("mediachange",(()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;Ys(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,"dash"===this.sourceType_&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})})),this.mainPlaylistLoader_.on("playlistunchanged",(()=>{const e=this.mainPlaylistLoader_.media();"playlist-unchanged"!==e.lastExcludeReason_&&this.stuckAtPlaylistEnd_(e)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))})),this.mainPlaylistLoader_.on("renditiondisabled",(()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})})),this.mainPlaylistLoader_.on("renditionenabled",(()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}))}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const n=e.mediaGroups||{};let r=!0;const i=Object.keys(n.AUDIO);for(const e in n.AUDIO)for(const t in n.AUDIO[e])n.AUDIO[e][t].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(n.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),ul.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),i.length&&Object.keys(n.AUDIO[i[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,n=this.tech_.currentTime(),r=this.bufferLowWaterLine(),i=this.bufferHighWaterLine();return function({currentPlaylist:e,buffered:t,currentTime:n,nextPlaylist:r,bufferLowWaterLine:i,bufferHighWaterLine:a,duration:s,bufferBasedABR:o,log:u}){if(!r)return hs.log.warn("We received no playlist to switch to. Please check your stream."),!1;const l=`allowing switch ${e&&e.id||"null"} -> ${r.id}`;if(!e)return u(`${l} as current playlist is not set`),!0;if(r.id===e.id)return!1;const c=Boolean(Is(t,n).length);if(!e.endList)return c||"number"!=typeof e.partTargetDuration?(u(`${l} as current playlist is live`),!0):(u(`not ${l} as current playlist is live llhls, but currentTime isn't in buffered.`),!1);const d=Ns(t,n),f=o?Oo.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Oo.MAX_BUFFER_LOW_WATER_LINE;if(s<f)return u(`${l} as duration < max low water line (${s} < ${f})`),!0;const h=r.attributes.BANDWIDTH,p=e.attributes.BANDWIDTH;if(h<p&&(!o||d<a)){let e=`${l} as next bandwidth < current bandwidth (${h} < ${p})`;return o&&(e+=` and forwardBuffer < bufferHighWaterLine (${d} < ${a})`),u(e),!0}if((!o||h>p)&&d>=i){let e=`${l} as forwardBuffer >= bufferLowWaterLine (${d} >= ${i})`;return o&&(e+=` and next bandwidth > current bandwidth (${h} > ${p})`),u(e),!0}return u(`not ${l} as no switching criteria met`),!1}({buffered:this.tech_.buffered(),currentTime:n,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:i,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",(()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("timeout",(()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()})),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",(()=>{this.trigger("progress")})),this.mainSegmentLoader_.on("error",(()=>{const e=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:e.playlist,error:e})})),this.mainSegmentLoader_.on("appenderror",(()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")})),this.mainSegmentLoader_.on("syncinfoupdate",(()=>{this.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(()=>{this.onSyncInfoUpdate_()})),this.audioSegmentLoader_.on("appenderror",(()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")})),this.mainSegmentLoader_.on("ended",(()=>{this.logger_("main segment loader ended"),this.onEndOfStream()})),this.mainSegmentLoader_.on("earlyabort",(e=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:10}))}));const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const e=this.getCodecsOrExclude_();e&&this.sourceUpdater_.addOrChangeSourceBuffers(e)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",(()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("fmp4",(()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("ended",(()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}))}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}fastQualityChange_(e=this.selectPlaylist()){e&&e===this.mainPlaylistLoader_.media()?this.logger_("skipping fastQualityChange because new media is same as old"):(this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0)}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything((()=>{this.tech_.setCurrentTime(this.tech_.currentTime())}))}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0}setupFirstPlay(){const e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){const t=this.seekable();if(!t.length)return!1;const n=t.end(0);let r=n;if(e.start){const i=e.start.timeOffset;r=i<0?Math.max(n+i,t.start(0)):Math.min(n,i)}this.trigger("firstplay"),this.tech_.setCurrentTime(r)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();void 0!==e&&"function"==typeof e.then&&e.then(null,(e=>{}))}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();e=!t||t.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const t=this.syncController_.getExpiredTime(e,this.duration());if(null===t)return!1;const n=ul.Playlist.playlistEnd(e,t),r=this.tech_.currentTime(),i=this.tech_.buffered();if(!i.length)return n-r<=ws;const a=i.end(i.length-1);return a-r<=ws&&n-a<=ws}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:n}){if(e=e||this.mainPlaylistLoader_.media(),n=n||t.playlistExclusionDuration||this.playlistExclusionDuration,!e)return this.error=t,void("open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,i=r.filter(Gs),a=1===i.length&&i[0]===e;if(1===r.length&&n!==1/0)return hs.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){const t=this.pathwayAttribute_(e),n=1e3*this.contentSteeringController_.steeringManifest.ttl;return this.contentSteeringController_.excludePathway(t),this.excludeThenChangePathway_(),void setTimeout((()=>{this.contentSteeringController_.addAvailablePathway(t)}),n)}let t=!1;r.forEach((n=>{if(n===e)return;const r=n.excludeUntil;void 0!==r&&r!==1/0&&(t=!0,delete n.excludeUntil)})),t&&(hs.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let s;s=e.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*n,e.excludeUntil=s,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const o=this.selectPlaylist();if(!o)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");const u=t.internal?this.logger_:hs.log.warn,l=t.message?" "+t.message:"";u(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${l} Switching to playlist ${o.id}.`),o.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),o.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const c=o.targetDuration/2*1e3||5e3,d="number"==typeof o.lastRequest&&Date.now()-o.lastRequest<=c;return this.switchMedia_(o,"exclude",a||d)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const n=[],r="all"===e;(r||"main"===e)&&n.push(this.mainPlaylistLoader_);const i=[];(r||"audio"===e)&&i.push("AUDIO"),(r||"subtitle"===e)&&(i.push("CLOSED-CAPTIONS"),i.push("SUBTITLES")),i.forEach((e=>{const t=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader;t&&n.push(t)})),["main","audio","subtitle"].forEach((t=>{const r=this[`${t}SegmentLoader_`];!r||e!==t&&"all"!==e||n.push(r)})),n.forEach((e=>t.forEach((t=>{"function"==typeof e[t]&&e[t]()}))))}setCurrentTime(e){const t=Is(this.tech_.buffered(),e);return this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()&&this.mainPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),void this.load()):0}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:ul.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_)return;let t=this.mainPlaylistLoader_.media();if(!t)return;let n=this.syncController_.getExpiredTime(t,this.duration());if(null===n)return;const r=this.mainPlaylistLoader_.main,i=ul.Playlist.seekable(t,n,ul.Playlist.liveEdgeDelay(r,t));if(0===i.length)return;if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),n=this.syncController_.getExpiredTime(t,this.duration()),null===n)return;if(e=ul.Playlist.seekable(t,n,ul.Playlist.liveEdgeDelay(r,t)),0===e.length)return}let a,s;this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),s=this.seekable_.start(0)),e?e.start(0)>i.end(0)||i.start(0)>e.end(0)?this.seekable_=i:this.seekable_=Es([[e.start(0)>i.start(0)?e.start(0):i.start(0),e.end(0)<i.end(0)?e.end(0):i.end(0)]]):this.seekable_=i,this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===a&&this.seekable_.start(0)===s||(this.logger_(`seekable updated [${Rs(this.seekable_)}]`),this.tech_.trigger("seekablechanged"))}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),"open"!==this.mediaSource.readyState)return this.updateDuration_=this.updateDuration.bind(this,e),void this.mediaSource.addEventListener("sourceopen",this.updateDuration_);if(e){const e=this.seekable();if(!e.length)return;return void((isNaN(this.mediaSource.duration)||this.mediaSource.duration<e.end(e.length-1))&&this.sourceUpdater_.setDuration(e.end(e.length-1)))}const t=this.tech_.buffered();let n=ul.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(n=Math.max(n,t.end(t.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach((e=>{const t=this.mediaTypes_[e].groups;for(const e in t)t[e].forEach((e=>{e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),n=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!n)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const n=iu(this.main(),t),r={},i=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=n.video||e.main.videoCodec||"avc1.4d400d"),e.main.isMuxed&&(r.video+=`,${n.audio||e.main.audioCodec||U}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||i)&&(r.audio=n.audio||e.main.audioCodec||e.audio.audioCodec||U,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video)return void this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});const a={};let s;if(["video","audio"].forEach((function(t){if(r.hasOwnProperty(t)&&(n=e[t].isFmp4,i=r[t],!(n?L(i):F(i)))){const n=e[t].isFmp4?"browser":"muxer";a[n]=a[n]||[],a[n].push(r[t]),"audio"===t&&(s=n)}var n,i})),i&&s&&t.attributes.AUDIO){const e=t.attributes.AUDIO;this.main().playlists.forEach((n=>{(n.attributes&&n.attributes.AUDIO)===e&&n!==t&&(n.excludeUntil=1/0)})),this.logger_(`excluding audio group ${e} as ${s} does not support codec(s): "${r.audio}"`)}if(!Object.keys(a).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const e=[];if(["video","audio"].forEach((t=>{const n=(P(this.sourceUpdater_.codecs[t]||"")[0]||{}).type,i=(P(r[t]||"")[0]||{}).type;n&&i&&n.toLowerCase()!==i.toLowerCase()&&e.push(`"${this.sourceUpdater_.codecs[t]}" -> "${r[t]}"`)})),e.length)return void this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${e.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0})}return r}{const e=Object.keys(a).reduce(((e,t)=>(e&&(e+=", "),e+`${t} does not support codec(s): "${a[t].join(",")}"`)),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:e},playlistExclusionDuration:1/0})}}tryToCreateSourceBuffers_(){if("open"!==this.mediaSource.readyState||this.sourceUpdater_.hasCreatedSourceBuffers())return;if(!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach((n=>{const r=e[n];if(-1!==t.indexOf(r.id))return;t.push(r.id);const i=iu(this.main,r),a=[];!i.audio||F(i.audio)||L(i.audio)||a.push(`audio codec ${i.audio}`),!i.video||F(i.video)||L(i.video)||a.push(`video codec ${i.video}`),i.text&&"stpp.ttml.im1t"===i.text&&a.push(`text codec ${i.text}`),a.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${a.join(", ")}`))}))}excludeIncompatibleVariants_(e){const t=[],n=this.main().playlists,r=nu(P(e)),i=ru(r),a=r.video&&P(r.video)[0]||null,s=r.audio&&P(r.audio)[0]||null;Object.keys(n).forEach((e=>{const r=n[e];if(-1!==t.indexOf(r.id)||r.excludeUntil===1/0)return;t.push(r.id);const o=[],u=iu(this.mainPlaylistLoader_.main,r),l=ru(u);if(u.audio||u.video){if(l!==i&&o.push(`codec count "${l}" !== "${i}"`),!this.sourceUpdater_.canChangeType()){const e=u.video&&P(u.video)[0]||null,t=u.audio&&P(u.audio)[0]||null;e&&a&&e.type.toLowerCase()!==a.type.toLowerCase()&&o.push(`video codec "${e.type}" !== "${a.type}"`),t&&s&&t.type.toLowerCase()!==s.type.toLowerCase()&&o.push(`audio codec "${t.type}" !== "${s.type}"`)}o.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id}: ${o.join(" && ")}`))}}))}updateAdCues_(e){let t=0;const n=this.seekable();n.length&&(t=n.start(0)),function(e,t,n=0){if(!e.segments)return;let r,a=n;for(let n=0;n<e.segments.length;n++){const s=e.segments[n];if(r||(r=zu(t,a+s.duration/2)),r){if("cueIn"in s){r.endTime=a,r.adEndTime=a,a+=s.duration,r=null;continue}if(a<r.endTime){a+=s.duration;continue}r.endTime+=s.duration}else if("cueOut"in s&&(r=new(i().VTTCue)(a,a+s.duration,s.cueOut),r.adStartTime=a,r.adEndTime=a+parseFloat(s.cueOut),t.addCue(r)),"cueOutCont"in s){const[e,n]=s.cueOutCont.split("/").map(parseFloat);r=new(i().VTTCue)(a,a+s.duration,""),r.adStartTime=a-e,r.adEndTime=r.adStartTime+n,t.addCue(r)}a+=s.duration}}(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=Oo.GOAL_BUFFER_LENGTH,n=Oo.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,Oo.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*n,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=Oo.BUFFER_LOW_WATER_LINE,n=Oo.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,Oo.MAX_BUFFER_LOW_WATER_LINE),i=Math.max(t,Oo.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*n,this.bufferBasedABR?i:r)}bufferHighWaterLine(){return Oo.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){pu(this.inbandTextTracks_,"com.apple.streaming",this.tech_),(({inbandTextTracks:e,dateRanges:t})=>{const n=e.metadataTrack_;if(!n)return;const r=i().WebKitDataCue||i().VTTCue;t.forEach((e=>{for(const t of Object.keys(e)){if(hu.has(t))continue;const i=new r(e.startTime,e.endTime,"");i.id=e.id,i.type="com.apple.quicktime.HLS",i.value={key:fu[t],data:e[t]},"scte35Out"!==t&&"scte35In"!==t||(i.value.data=new Uint8Array(i.value.data.match(/[\da-f]{2}/gi)).buffer),n.addCue(i)}e.processDateRange()}))})({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,n){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();pu(this.inbandTextTracks_,e,this.tech_),(({inbandTextTracks:e,metadataArray:t,timestampOffset:n,videoDuration:r})=>{if(!t)return;const a=i().WebKitDataCue||i().VTTCue,s=e.metadataTrack_;if(!s)return;if(t.forEach((e=>{const t=e.cueTime+n;!("number"!=typeof t||i().isNaN(t)||t<0)&&t<1/0&&e.frames&&e.frames.length&&e.frames.forEach((e=>{const n=new a(t,t,e.value||e.url||e.data||"");n.frame=e,n.value=e,function(e){Object.defineProperties(e.frame,{id:{get:()=>(hs.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key)},value:{get:()=>(hs.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data)},privateData:{get:()=>(hs.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data)}})}(n),s.addCue(n)}))})),!s.cues||!s.cues.length)return;const o=s.cues,u=[];for(let e=0;e<o.length;e++)o[e]&&u.push(o[e]);const l=u.reduce(((e,t)=>{const n=e[t.startTime]||[];return n.push(t),e[t.startTime]=n,e}),{}),c=Object.keys(l).sort(((e,t)=>Number(e)-Number(t)));c.forEach(((e,t)=>{const n=l[e],i=isFinite(r)?r:e,a=Number(c[t+1])||i;n.forEach((e=>{e.endTime=a}))}))})({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:n})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart?this.contentSteeringController_.requestSteeringManifest(!0):this.tech_.one("canplay",(()=>{this.contentSteeringController_.requestSteeringManifest()}))}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),"dash"===this.sourceType_&&this.mainPlaylistLoader_.on("loadedplaylist",(()=>{const e=this.main();(this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering)||(()=>{const t=this.contentSteeringController_.getAvailablePathways(),n=[];for(const r of e.playlists){const e=r.attributes.serviceLocation;if(e&&(n.push(e),!t.has(e)))return!0}return!(n.length||!t.size)})())&&this.resetContentSteeringController_()}))}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const t=this.main().playlists,n=new Set;let r=!1;Object.keys(t).forEach((i=>{const a=t[i],s=this.pathwayAttribute_(a),o=s&&e!==s;a.excludeUntil===1/0&&"content-steering"===a.lastExcludeReason_&&!o&&(delete a.excludeUntil,delete a.lastExcludeReason_,r=!0);const u=!a.excludeUntil&&a.excludeUntil!==1/0;!n.has(a.id)&&o&&u&&(n.add(a.id),a.excludeUntil=1/0,a.lastExcludeReason_="content-steering",this.logger_(`excluding ${a.id} for ${a.lastExcludeReason_}`))})),"DASH"===this.contentSteeringController_.manifestType_&&Object.keys(this.mediaTypes_).forEach((t=>{const n=this.mediaTypes_[t];if(n.activePlaylistLoader){const t=n.activePlaylistLoader.media_;t&&t.attributes.serviceLocation!==e&&(r=!0)}})),r&&this.changeSegmentPathway_()}handlePathwayClones_(){const e=this.main().playlists,t=this.contentSteeringController_.currentPathwayClones,n=this.contentSteeringController_.nextPathwayClones;if(t&&t.size||n&&n.size){for(const[e,r]of t.entries())n.get(e)||(this.mainPlaylistLoader_.updateOrDeleteClone(r),this.contentSteeringController_.excludePathway(e));for(const[r,i]of n.entries()){const n=t.get(r);n?this.equalPathwayClones_(n,i)||(this.mainPlaylistLoader_.updateOrDeleteClone(i,!0),this.contentSteeringController_.addAvailablePathway(r)):(e.filter((e=>e.attributes["PATHWAY-ID"]===i["BASE-ID"])).forEach((e=>{this.mainPlaylistLoader_.addClonePathway(i,e)})),this.contentSteeringController_.addAvailablePathway(r))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...n])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const n=e["URI-REPLACEMENT"].PARAMS,r=t["URI-REPLACEMENT"].PARAMS;for(const e in n)if(n[e]!==r[e])return!1;for(const e in r)if(n[e]!==r[e])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),"DASH"===this.contentSteeringController_.manifestType_&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach((n=>{const r=this.mainPlaylistLoader_.getKeyIdSet(n);r&&r.size&&r.forEach((r=>{const i="usable",a=this.keyStatusMap_.has(r)&&this.keyStatusMap_.get(r)===i,s=n.lastExcludeReason_===t&&n.excludeUntil===1/0;a?a&&s&&(delete n.excludeUntil,delete n.lastExcludeReason_,this.logger_(`enabling playlist ${n.id} because key ID ${r} is ${i}`)):(n.excludeUntil!==1/0&&n.lastExcludeReason_!==t&&(n.excludeUntil=1/0,n.lastExcludeReason_=t,this.logger_(`excluding playlist ${n.id} because the key ID ${r} doesn't exist in the keyStatusMap or is not ${i}`)),e++)}))})),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach((e=>{const n=e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height<720,r=e.excludeUntil===1/0&&e.lastExcludeReason_===t;n&&r&&(delete e.excludeUntil,hs.log.warn(`enabling non-HD playlist ${e.id} because all playlists were excluded due to ${t} key IDs`))}))}addKeyStatus_(e,t){const n=("string"==typeof e?e:(e=>{const t=new Uint8Array(e);return Array.from(t).map((e=>e.toString(16).padStart(2,"0"))).join("")})(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${n} added to the keyStatusMap`),this.keyStatusMap_.set(n,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}class fl{constructor(e,t,n){const{playlistController_:r}=e,i=r.fastQualityChange_.bind(r);if(t.attributes){const e=t.attributes.RESOLUTION;this.width=e&&e.width,this.height=e&&e.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}var a,s,o;this.codecs=iu(r.main(),t),this.playlist=t,this.id=n,this.enabled=(a=e.playlists,s=t.id,o=i,e=>{const t=a.main.playlists[s],n=Hs(t),r=Gs(t);return void 0===e?r:(e?delete t.disabled:t.disabled=!0,e===r||n||(o(),e?a.trigger("renditionenabled"):a.trigger("renditiondisabled")),e)})}}const hl=["seeking","seeked","pause","playing","error"];class pl{constructor(e){this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=Ts("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),n=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),a=()=>this.resetTimeUpdate_(),s=this.playlistController_,o=["main","subtitle","audio"],u={};o.forEach((e=>{u[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)},s[`${e}SegmentLoader_`].on("appendsdone",u[e].updateend),s[`${e}SegmentLoader_`].on("playlistupdate",u[e].reset),this.tech_.on(["seeked","seeking"],u[e].reset)}));const l=e=>{["main","audio"].forEach((t=>{s[`${t}SegmentLoader_`][e]("appended",this.seekingAppendCheck_)}))};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),l("off"))},this.clearSeekingAppendCheck_=()=>l("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),l("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(hl,a),this.tech_.on("canplay",n),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(hl,a),this.tech_.off("canplay",n),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),o.forEach((e=>{s[`${e}SegmentLoader_`].off("appendsdone",u[e].updateend),s[`${e}SegmentLoader_`].off("playlistupdate",u[e].reset),this.tech_.off(["seeked","seeking"],u[e].reset)})),this.checkCurrentTimeTimeout_&&i().clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&i().clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=i().setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,n=t[`${e}SegmentLoader_`],r=n.buffered_(),i=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++)if(e.start(n)!==t.start(n)||e.end(n)!==t.end(n))return!0;return!1}(this[`${e}Buffered_`],r);this[`${e}Buffered_`]=r,i?this.resetSegmentDownloads_(e):(this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:n.playlist_&&n.playlist_.id,buffered:Ds(r)}),this[`${e}StalledDownloads_`]<10||(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),"subtitle"!==e&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0})))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+ws>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const e=this.seekable(),t=this.tech_.currentTime();let n;if(this.afterSeekableWindow_(e,t,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(n=e.end(e.length-1)),this.beforeSeekableWindow_(e,t)){const t=e.start(0);n=t+(t===e.end(0)?0:ws)}if(void 0!==n)return this.logger_(`Trying to seek outside of seekable at time ${t} with seekable range ${Rs(e)}. Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0;const r=this.playlistController_.sourceUpdater_,i=this.tech_.buffered(),a=r.audioBuffer?r.audioBuffered():null,s=r.videoBuffer?r.videoBuffered():null,o=this.media(),u=o.partTargetDuration?o.partTargetDuration:2*(o.targetDuration-Ss),l=[a,s];for(let e=0;e<l.length;e++)if(l[e]&&Ns(l[e],t)<u)return!1;const c=Cs(i,t);return 0!==c.length&&(n=c.start(0)+ws,this.logger_(`Buffered region starts (${c.start(0)}) just beyond seek point (${t}). Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),n=Is(t,e);return n.length&&e+3<=n.end(0)?(this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${n.start(0)} -> ${n.end(0)}]. Attempting to resume playback by seeking to the current time.`),void this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"})):void 0}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const n=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${n}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(n),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const n=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const i=Cs(r,t);return i.length>0&&(this.logger_(`Stopped at ${t} and seeking to ${i.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0)}afterSeekableWindow_(e,t,n,r=!1){if(!e.length)return!1;let i=e.end(e.length-1)+ws;const a=!n.endList,s="number"==typeof n.partTargetDuration;return a&&(s||r)&&(i=e.end(e.length-1)+3*n.targetDuration),t>i}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:n}){if(!e)return;let r;if(e.length&&t.length){const i=Is(e,n-3),a=Is(e,n),s=Is(t,n);s.length&&!a.length&&i.length&&(r={start:i.end(0),end:s.end(0)})}else Cs(e,n).length||(r=this.gapFromVideoUnderflow_(e,n));return!!r&&(this.logger_(`Encountered a gap in video from ${r.start} to ${r.end}. Seeking to current time ${n}`),!0)}skipTheGap_(e){const t=this.tech_.buffered(),n=this.tech_.currentTime(),r=Cs(t,n);this.resetTimeUpdate_(),0!==r.length&&n===e&&(this.logger_("skipTheGap_:","currentTime:",n,"scheduled currentTime:",e,"nextRange start:",r.start(0)),this.tech_.setCurrentTime(r.start(0)+Ss),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}))}gapFromVideoUnderflow_(e,t){const n=function(e){if(e.length<2)return Es();const t=[];for(let n=1;n<e.length;n++){const r=e.end(n-1),i=e.start(n);t.push([r,i])}return Es(t)}(e);for(let e=0;e<n.length;e++){const r=n.start(e),i=n.end(e);if(t-r<4&&t-r>2)return{start:r,end:i}}return null}}const gl={errorInterval:30,getSource(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},ml=function(e,t){let n=0,r=0;const i=bs(gl,t);e.ready((()=>{e.trigger({type:"usage",name:"vhs-error-reload-initialized"})}));const a=function(){r&&e.currentTime(r)},s=function(t){null!=t&&(r=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",a),e.src(t),e.trigger({type:"usage",name:"vhs-error-reload"}),e.play())},o=function(){if(Date.now()-n<1e3*i.errorInterval)e.trigger({type:"usage",name:"vhs-error-reload-canceled"});else{if(i.getSource&&"function"==typeof i.getSource)return n=Date.now(),i.getSource.call(e,s);hs.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},u=function(){e.off("loadedmetadata",a),e.off("error",o),e.off("dispose",u)};e.on("error",o),e.on("dispose",u),e.reloadSourceOnError=function(t){u(),ml(e,t)}};var yl="3.9.1";const vl={PlaylistLoader:co,Playlist:Ws,utils:So,STANDARD_PLAYLIST_SELECTOR:du,INITIAL_PLAYLIST_SELECTOR:function(){const e=this.playlists.main.playlists.filter(Ws.isEnabled);return uu(e,((e,t)=>lu(e,t))),e.filter((e=>!!iu(this.playlists.main,e).video))[0]||null},lastBandwidthSelector:du,movingAverageBandwidthSelector:function(e){let t=-1,n=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){const r=this.useDevicePixelRatio&&i().devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,n=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==n&&(t=e*this.systemBandwidth+(1-e)*t,n=this.systemBandwidth),cu(this.playlists.main,t,parseInt(ou(this.tech_.el(),"width"),10)*r,parseInt(ou(this.tech_.el(),"height"),10)*r,this.limitRenditionByPlayerDimensions,this.playlistController_)}},comparePlaylistBandwidth:lu,comparePlaylistResolution:function(e,t){let n,r;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(n=e.attributes.RESOLUTION.width),n=n||i().Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(r=t.attributes.RESOLUTION.width),r=r||i().Number.MAX_VALUE,n===r&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:n-r},xhr:po()};Object.keys(Oo).forEach((e=>{Object.defineProperty(vl,e,{get:()=>(hs.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),Oo[e]),set(t){hs.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),"number"!=typeof t||t<0?hs.log.warn(`value of Vhs.${e} must be greater than or equal to 0`):Oo[e]=t}})}));const _l="videojs-vhs",Tl=function(e,t){const n=t.media();let r=-1;for(let t=0;t<e.length;t++)if(e[t].id===n.id){r=t;break}e.selectedIndex_=r,e.trigger({selectedIndex:r,type:"change"})};vl.canPlaySource=function(){return hs.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const bl=()=>{if(!i().localStorage)return null;const e=i().localStorage.getItem(_l);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}},El=(e,t)=>{e._requestCallbackSet||(e._requestCallbackSet=new Set),e._requestCallbackSet.add(t)},Sl=(e,t)=>{e._responseCallbackSet||(e._responseCallbackSet=new Set),e._responseCallbackSet.add(t)},wl=(e,t)=>{e._requestCallbackSet&&(e._requestCallbackSet.delete(t),e._requestCallbackSet.size||delete e._requestCallbackSet)},Al=(e,t)=>{e._responseCallbackSet&&(e._responseCallbackSet.delete(t),e._responseCallbackSet.size||delete e._responseCallbackSet)};vl.supportsNativeHls=function(){if(!s()||!s().createElement)return!1;const e=s().createElement("video");return!!hs.getTech("Html5").isSupported()&&["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some((function(t){return/maybe|probably/i.test(e.canPlayType(t))}))}(),vl.supportsNativeDash=!!(s()&&s().createElement&&hs.getTech("Html5").isSupported())&&/maybe|probably/i.test(s().createElement("video").canPlayType("application/dash+xml")),vl.supportsTypeNatively=e=>"hls"===e?vl.supportsNativeHls:"dash"===e&&vl.supportsNativeDash,vl.isSupported=function(){return hs.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},vl.xhr.onRequest=function(e){El(vl.xhr,e)},vl.xhr.onResponse=function(e){Sl(vl.xhr,e)},vl.xhr.offRequest=function(e){wl(vl.xhr,e)},vl.xhr.offResponse=function(e){Al(vl.xhr,e)};const Il=hs.getComponent("Component");class Cl extends Il{constructor(e,t,n){if(super(t,n.vhs),"number"==typeof n.initialBandwidth&&(this.options_.bandwidth=n.initialBandwidth),this.logger_=Ts("VhsHandler"),t.options_&&t.options_.playerId){const e=hs.getPlayer(t.options_.playerId);this.player_=e}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(s(),["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(e=>{const t=s().fullscreenElement||s().webkitFullscreenElement||s().mozFullScreenElement||s().msFullscreenElement;t&&t.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()})),this.on(this.tech_,"seeking",(function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())})),this.on(this.tech_,"error",(function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()})),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=bs(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=!1!==this.options_.llhls,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,"number"!=typeof this.options_.playlistExclusionDuration&&(this.options_.playlistExclusionDuration=60),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){const e=bl();e&&e.bandwidth&&(this.options_.bandwidth=e.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),e&&e.throughput&&(this.options_.throughput=e.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=Oo.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Oo.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach((e=>{void 0!==this.source_[e]&&(this.options_[e]=this.source_[e])})),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;var n;this.setOptions_(),this.options_.src=0===(n=this.source_.src).toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(n.substring(n.indexOf(",")+1)):n,this.options_.tech=this.tech_,this.options_.externVhs=vl,this.options_.sourceType=q(t),this.options_.seekTo=e=>{this.tech_.setCurrentTime(e)},this.playlistController_=new dl(this.options_);const r=bs({liveRangeSafeTimeDelta:ws},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new pl(r),this.playlistController_.on("error",(()=>{const e=hs.players[this.tech_.options_.playerId];let t=this.playlistController_.error;"object"!=typeof t||t.code?"string"==typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)}));const a=this.options_.bufferBasedABR?vl.movingAverageBandwidthSelector(.55):vl.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):a.bind(this),this.playlistController_.selectInitialPlaylist=vl.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(e){this.playlistController_.selectPlaylist=e.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(e){this.playlistController_.mainSegmentLoader_.throughput.rate=e,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let e=this.playlistController_.mainSegmentLoader_.bandwidth;const t=i().navigator.connection||i().navigator.mozConnection||i().navigator.webkitConnection,n=1e7;if(this.options_.useNetworkInformationApi&&t){const r=1e3*t.downlink*1e3;e=r>=n&&e>=n?Math.max(e,r):r}return e},set(e){this.playlistController_.mainSegmentLoader_.bandwidth=e,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const e=1/(this.bandwidth||1);let t;return t=this.throughput>0?1/this.throughput:0,Math.floor(1/(e+t))},set(){hs.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Ds(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>Ds(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",(()=>{this.options_.useBandwidthFromLocalStorage&&(e=>{if(!i().localStorage)return!1;let t=bl();t=t?bs(t,e):e;try{i().localStorage.setItem(_l,JSON.stringify(t))}catch(e){return!1}})({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})})),this.playlistController_.on("selectedinitialmedia",(()=>{var e;(e=this).representations=()=>{const t=e.playlistController_.main(),n=Ks(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists;return n?n.filter((e=>!Hs(e))).map(((t,n)=>new fl(e,t,t.id))):[]}})),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",(()=>{this.setupEme_()})),this.on(this.playlistController_,"progress",(function(){this.tech_.trigger("progress")})),this.on(this.playlistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=!0})),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=i().URL.createObjectURL(this.playlistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),(({player:e,sourceKeySystems:t,audioMedia:n,mainPlaylists:r})=>{if(!e.eme.initializeMediaKeys)return Promise.resolve();const i=(o=n?r.concat([n]):r,u=Object.keys(t),o.reduce(((e,t)=>{if(!t.contentProtection)return e;const n=u.reduce(((e,n)=>{const r=t.contentProtection[n];return r&&r.pssh&&(e[n]={pssh:r.pssh}),e}),{});return Object.keys(n).length&&e.push(n),e}),[])),a=[],s=[];var o,u;return i.forEach((t=>{s.push(new Promise(((t,n)=>{e.tech_.one("keysessioncreated",t)}))),a.push(new Promise(((n,r)=>{e.eme.initializeMediaKeys({keySystems:t},(e=>{e?r(e):n()}))})))})),Promise.race([Promise.all(a),Promise.race(s)])})({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then((()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()})).catch((e=>{this.logger_("error while creating EME key session",e),this.player_.error({message:"Failed to initialize media keys for EME",code:3})}))}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=(({player:e,sourceKeySystems:t,media:n,audioMedia:r})=>{const i=((e,t,n)=>{if(!e)return e;let r={};t&&t.attributes&&t.attributes.CODECS&&(r=nu(P(t.attributes.CODECS))),n&&n.attributes&&n.attributes.CODECS&&(r.audio=n.attributes.CODECS);const i=k(r.video),a=k(r.audio),s={};for(const n in e)s[n]={},a&&(s[n].audioContentType=a),i&&(s[n].videoContentType=i),t.contentProtection&&t.contentProtection[n]&&t.contentProtection[n].pssh&&(s[n].pssh=t.contentProtection[n].pssh),"string"==typeof e[n]&&(s[n].url=e[n]);return bs(e,s)})(t,n,r);return!(!i||(e.currentSource().keySystems=i,i&&!e.eme&&(hs.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),1)))})({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on("keystatuschange",(e=>{this.playlistController_.updatePlaylistByKeyStatus(e.keyId,e.status)})),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),t?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme()}setupQualityLevels_(){const e=hs.players[this.tech_.options_.playerId];e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",(()=>{!function(e,t){t.representations().forEach((t=>{e.addQualityLevel(t)})),Tl(e,t.playlists)}(this.qualityLevels_,this)})),this.playlists.on("mediachange",(()=>{Tl(this.qualityLevels_,this.playlists)})))}static version(){return{"@videojs/http-streaming":yl,"mux.js":"7.0.2","mpd-parser":"1.3.0","m3u8-parser":"7.1.0","aes-decrypter":"4.0.1"}}version(){return this.constructor.version()}canChangeType(){return qu.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&i().URL.revokeObjectURL&&(i().URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return(({playlist:e,time:t,callback:n})=>{if(!n)throw new Error("getProgramTime: callback must be provided");if(!e||void 0===t)return n({message:"getProgramTime: playlist and time must be provided"});const r=((e,t)=>{if(!t||!t.segments||0===t.segments.length)return null;let n,r=0;for(let i=0;i<t.segments.length&&(n=t.segments[i],r=n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationEnd:r+n.duration,!(e<=r));i++);const i=t.segments[t.segments.length-1];if(i.videoTimingInfo&&i.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>r){if(e>r+.25*i.duration)return null;n=i}return{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:r-n.duration,type:n.videoTimingInfo?"accurate":"estimate"}})(t,e);if(!r)return n({message:"valid programTime was not found"});if("estimate"===r.type)return n({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:r.estimatedStart});const i={mediaSeconds:t},a=((e,t)=>{if(!t.dateTimeObject)return null;const n=t.videoTimingInfo.transmuxerPrependedSeconds,r=e-(t.videoTimingInfo.transmuxedPresentationStart+n);return new Date(t.dateTimeObject.getTime()+1e3*r)})(t,r.segment);return a&&(i.programDateTime=a.toISOString()),n(null,i)})({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,n=!0,r=2){return wo({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:n,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{El(this.xhr,e)},this.xhr.onResponse=e=>{Sl(this.xhr,e)},this.xhr.offRequest=e=>{wl(this.xhr,e)},this.xhr.offResponse=e=>{Al(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}}const Rl={name:"videojs-http-streaming",VERSION:yl,canHandleSource(e,t={}){const n=bs(hs.options,t);return Rl.canPlayType(e.type,n)},handleSource(e,t,n={}){const r=bs(hs.options,n);return t.vhs=new Cl(e,t,r),t.vhs.xhr=po(),t.vhs.setupXhrHooks_(),t.vhs.src(e.src,e.type),t.vhs},canPlayType(e,t){const n=q(e);if(!n)return"";const r=Rl.getOverrideNative(t);return!vl.supportsTypeNatively(n)||r?"maybe":""},getOverrideNative(e={}){const{vhs:t={}}=e,n=!(hs.browser.IS_ANY_SAFARI||hs.browser.IS_IOS),{overrideNative:r=n}=t;return r}};L("avc1.4d400d,mp4a.40.2")&&hs.getTech("Html5").registerSourceHandler(Rl,0),hs.VhsHandler=Cl,hs.VhsSourceHandler=Rl,hs.Vhs=vl,hs.use||hs.registerComponent("Vhs",vl),hs.options.vhs=hs.options.vhs||{},hs.getPlugin&&hs.getPlugin("reloadSourceOnError")||hs.registerPlugin("reloadSourceOnError",(function(e){ml(this,e)}))},825:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>ac});var r=n(8908),i=n.n(r),o=n(9144),u=n.n(o),l=n(7462),c=n(7537),d=n.n(c);function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function p(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,h(e,t)}var g=n(5974),m=n.n(g),y=n(9603),v=n.n(y),_=n(3407),T=n.n(_);function b(e,t,n){return b=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&h(i,n.prototype),i},b.apply(null,arguments)}var E=n(9945),S=n.n(E);const w=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=i().location&&i().location.href||"");var n="function"==typeof i().URL,r=/^\/\//.test(e),a=!i().location&&!/\/\//i.test(e);if(n?e=new(i().URL)(e,i().location||"http://example.com"):/\/\//i.test(e)||(e=S().buildAbsoluteURL(i().location&&i().location.href||"",e)),n){var s=new URL(t,e);return a?s.href.slice(18):r?s.href.slice(s.protocol.length):s.href}return S().buildAbsoluteURL(e,t)};var A=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(n,1),n>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var n=t.length,r=0;r<n;++r)t[r].call(this,arguments[1]);else for(var i=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,i)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}();function I(e){for(var t=function(e){return i().atob?i().atob(e):Buffer.from(e,"base64").toString("binary")}(e),n=new Uint8Array(t.length),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}var C,R=function(e){function t(){var t;return(t=e.call(this)||this).buffer="",t}return p(t,e),t.prototype.push=function(e){var t;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(A),D=String.fromCharCode(9),x=function(e){var t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),n={};return t[1]&&(n.length=parseInt(t[1],10)),t[2]&&(n.offset=parseInt(t[2],10)),n},N=function(e){for(var t,n=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),r={},i=n.length;i--;)""!==n[i]&&((t=/([^=]*)=(.*)/.exec(n[i]).slice(1))[0]=t[0].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^['"](.*)['"]$/g,"$1"),r[t[0]]=t[1]);return r},O=function(e){function t(){var t;return(t=e.call(this)||this).customParsers=[],t.tagMappers=[],t}p(t,e);var n=t.prototype;return n.push=function(e){var t,n,r=this;0!==(e=e.trim()).length&&("#"===e[0]?this.tagMappers.reduce((function(t,n){var r=n(e);return r===e?t:t.concat([r])}),[e]).forEach((function(e){for(var i=0;i<r.customParsers.length;i++)if(r.customParsers[i].call(r,e))return;if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e))r.trigger("data",{type:"tag",tagType:"m3u"});else{if(t=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e))return n={type:"tag",tagType:"inf"},t[1]&&(n.duration=parseFloat(t[1])),t[2]&&(n.title=t[2]),void r.trigger("data",n);if(t=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e))return n={type:"tag",tagType:"targetduration"},t[1]&&(n.duration=parseInt(t[1],10)),void r.trigger("data",n);if(t=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(e))return n={type:"tag",tagType:"version"},t[1]&&(n.version=parseInt(t[1],10)),void r.trigger("data",n);if(t=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return n={type:"tag",tagType:"media-sequence"},t[1]&&(n.number=parseInt(t[1],10)),void r.trigger("data",n);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return n={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(n.number=parseInt(t[1],10)),void r.trigger("data",n);if(t=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e))return n={type:"tag",tagType:"playlist-type"},t[1]&&(n.playlistType=t[1]),void r.trigger("data",n);if(t=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(e))return n=(0,l.Z)(x(t[1]),{type:"tag",tagType:"byterange"}),void r.trigger("data",n);if(t=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e))return n={type:"tag",tagType:"allow-cache"},t[1]&&(n.allowed=!/NO/.test(t[1])),void r.trigger("data",n);if(t=/^#EXT-X-MAP:?(.*)$/.exec(e)){if(n={type:"tag",tagType:"map"},t[1]){var a=N(t[1]);a.URI&&(n.uri=a.URI),a.BYTERANGE&&(n.byterange=x(a.BYTERANGE))}r.trigger("data",n)}else if(t=/^#EXT-X-STREAM-INF:?(.*)$/.exec(e)){if(n={type:"tag",tagType:"stream-inf"},t[1]){if(n.attributes=N(t[1]),n.attributes.RESOLUTION){var s=n.attributes.RESOLUTION.split("x"),o={};s[0]&&(o.width=parseInt(s[0],10)),s[1]&&(o.height=parseInt(s[1],10)),n.attributes.RESOLUTION=o}n.attributes.BANDWIDTH&&(n.attributes.BANDWIDTH=parseInt(n.attributes.BANDWIDTH,10)),n.attributes["FRAME-RATE"]&&(n.attributes["FRAME-RATE"]=parseFloat(n.attributes["FRAME-RATE"])),n.attributes["PROGRAM-ID"]&&(n.attributes["PROGRAM-ID"]=parseInt(n.attributes["PROGRAM-ID"],10))}r.trigger("data",n)}else{if(t=/^#EXT-X-MEDIA:?(.*)$/.exec(e))return n={type:"tag",tagType:"media"},t[1]&&(n.attributes=N(t[1])),void r.trigger("data",n);if(t=/^#EXT-X-ENDLIST/.exec(e))r.trigger("data",{type:"tag",tagType:"endlist"});else if(t=/^#EXT-X-DISCONTINUITY/.exec(e))r.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(t=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e))return n={type:"tag",tagType:"program-date-time"},t[1]&&(n.dateTimeString=t[1],n.dateTimeObject=new Date(t[1])),void r.trigger("data",n);if(t=/^#EXT-X-KEY:?(.*)$/.exec(e))return n={type:"tag",tagType:"key"},t[1]&&(n.attributes=N(t[1]),n.attributes.IV&&("0x"===n.attributes.IV.substring(0,2).toLowerCase()&&(n.attributes.IV=n.attributes.IV.substring(2)),n.attributes.IV=n.attributes.IV.match(/.{8}/g),n.attributes.IV[0]=parseInt(n.attributes.IV[0],16),n.attributes.IV[1]=parseInt(n.attributes.IV[1],16),n.attributes.IV[2]=parseInt(n.attributes.IV[2],16),n.attributes.IV[3]=parseInt(n.attributes.IV[3],16),n.attributes.IV=new Uint32Array(n.attributes.IV))),void r.trigger("data",n);if(t=/^#EXT-X-START:?(.*)$/.exec(e))return n={type:"tag",tagType:"start"},t[1]&&(n.attributes=N(t[1]),n.attributes["TIME-OFFSET"]=parseFloat(n.attributes["TIME-OFFSET"]),n.attributes.PRECISE=/YES/.test(n.attributes.PRECISE)),void r.trigger("data",n);if(t=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(e))return n={type:"tag",tagType:"cue-out-cont"},t[1]?n.data=t[1]:n.data="",void r.trigger("data",n);if(t=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(e))return n={type:"tag",tagType:"cue-out"},t[1]?n.data=t[1]:n.data="",void r.trigger("data",n);if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e))return n={type:"tag",tagType:"cue-in"},t[1]?n.data=t[1]:n.data="",void r.trigger("data",n);if((t=/^#EXT-X-SKIP:(.*)$/.exec(e))&&t[1])return(n={type:"tag",tagType:"skip"}).attributes=N(t[1]),n.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(n.attributes["SKIPPED-SEGMENTS"]=parseInt(n.attributes["SKIPPED-SEGMENTS"],10)),n.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(n.attributes["RECENTLY-REMOVED-DATERANGES"]=n.attributes["RECENTLY-REMOVED-DATERANGES"].split(D)),void r.trigger("data",n);if((t=/^#EXT-X-PART:(.*)$/.exec(e))&&t[1])return(n={type:"tag",tagType:"part"}).attributes=N(t[1]),["DURATION"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))})),["INDEPENDENT","GAP"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=/YES/.test(n.attributes[e]))})),n.attributes.hasOwnProperty("BYTERANGE")&&(n.attributes.byterange=x(n.attributes.BYTERANGE)),void r.trigger("data",n);if((t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e))&&t[1])return(n={type:"tag",tagType:"server-control"}).attributes=N(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))})),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=/YES/.test(n.attributes[e]))})),void r.trigger("data",n);if((t=/^#EXT-X-PART-INF:(.*)$/.exec(e))&&t[1])return(n={type:"tag",tagType:"part-inf"}).attributes=N(t[1]),["PART-TARGET"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))})),void r.trigger("data",n);if((t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e))&&t[1])return(n={type:"tag",tagType:"preload-hint"}).attributes=N(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach((function(e){if(n.attributes.hasOwnProperty(e)){n.attributes[e]=parseInt(n.attributes[e],10);var t="BYTERANGE-LENGTH"===e?"length":"offset";n.attributes.byterange=n.attributes.byterange||{},n.attributes.byterange[t]=n.attributes[e],delete n.attributes[e]}})),void r.trigger("data",n);if((t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e))&&t[1])return(n={type:"tag",tagType:"rendition-report"}).attributes=N(t[1]),["LAST-MSN","LAST-PART"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseInt(n.attributes[e],10))})),void r.trigger("data",n);r.trigger("data",{type:"tag",data:e.slice(4)})}}}else r.trigger("data",{type:"comment",text:e.slice(1)})})):this.trigger("data",{type:"uri",uri:e}))},n.addParser=function(e){var t=this,n=e.expression,r=e.customType,i=e.dataParser,a=e.segment;"function"!=typeof i&&(i=function(e){return e}),this.customParsers.push((function(e){if(n.exec(e))return t.trigger("data",{type:"custom",data:i(e),customType:r,segment:a}),!0}))},n.addTagMapper=function(e){var t=e.expression,n=e.map;this.tagMappers.push((function(e){return t.test(e)?n(e):e}))},t}(A),P=function(e){var t={};return Object.keys(e).forEach((function(n){var r;t[(r=n,r.toLowerCase().replace(/-(\w)/g,(function(e){return e[1].toUpperCase()})))]=e[n]})),t},M=function(e){var t=e.serverControl,n=e.targetDuration,r=e.partTargetDuration;if(t){var i="#EXT-X-SERVER-CONTROL",a="holdBack",s="partHoldBack",o=n&&3*n,u=r&&2*r;n&&!t.hasOwnProperty(a)&&(t[a]=o,this.trigger("info",{message:i+" defaulting HOLD-BACK to targetDuration * 3 ("+o+")."})),o&&t[a]<o&&(this.trigger("warn",{message:i+" clamping HOLD-BACK ("+t[a]+") to targetDuration * 3 ("+o+")"}),t[a]=o),r&&!t.hasOwnProperty(s)&&(t[s]=3*r,this.trigger("info",{message:i+" defaulting PART-HOLD-BACK to partTargetDuration * 3 ("+t[s]+")."})),r&&t[s]<u&&(this.trigger("warn",{message:i+" clamping PART-HOLD-BACK ("+t[s]+") to partTargetDuration * 2 ("+u+")."}),t[s]=u)}},k=function(e){function t(){var t;(t=e.call(this)||this).lineStream=new R,t.parseStream=new O,t.lineStream.pipe(t.parseStream);var n,r,i=f(t),a=[],s={},o=!1,u=function(){},c={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},d=0;t.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};var h=0,p=0;return t.on("end",(function(){s.uri||!s.parts&&!s.preloadHints||(!s.map&&n&&(s.map=n),!s.key&&r&&(s.key=r),s.timeline||"number"!=typeof d||(s.timeline=d),t.manifest.preloadSegment=s)})),t.parseStream.on("data",(function(e){var t,f;({tag:function(){({version:function(){e.version&&(this.manifest.version=e.version)},"allow-cache":function(){this.manifest.allowCache=e.allowed,"allowed"in e||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var t={};"length"in e&&(s.byterange=t,t.length=e.length,"offset"in e||(e.offset=h)),"offset"in e&&(s.byterange=t,t.offset=e.offset),h=t.offset+t.length},endlist:function(){this.manifest.endList=!0},inf:function(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),e.duration>0&&(s.duration=e.duration),0===e.duration&&(s.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=a},key:function(){if(e.attributes)if("NONE"!==e.attributes.METHOD)if(e.attributes.URI){if("com.apple.streamingkeydelivery"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:e.attributes});if("com.microsoft.playready"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:e.attributes.URI});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===e.attributes.KEYFORMAT)return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(e.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===e.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==e.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):e.attributes.KEYID&&"0x"===e.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:I(e.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),r={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void 0!==e.attributes.IV&&(r.iv=e.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else r=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(e.number)?this.manifest.mediaSequence=e.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number})},"discontinuity-sequence":function(){isFinite(e.number)?(this.manifest.discontinuitySequence=e.number,d=e.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number})},"playlist-type":function(){/VOD|EVENT/.test(e.playlistType)?this.manifest.playlistType=e.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist})},map:function(){n={},e.uri&&(n.uri=e.uri),e.byterange&&(n.byterange=e.byterange),r&&(n.key=r)},"stream-inf":function(){this.manifest.playlists=a,this.manifest.mediaGroups=this.manifest.mediaGroups||c,e.attributes?(s.attributes||(s.attributes={}),(0,l.Z)(s.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||c,e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME){var n=this.manifest.mediaGroups[e.attributes.TYPE];n[e.attributes["GROUP-ID"]]=n[e.attributes["GROUP-ID"]]||{},t=n[e.attributes["GROUP-ID"]],(f={default:/yes/i.test(e.attributes.DEFAULT)}).default?f.autoselect=!0:f.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(f.language=e.attributes.LANGUAGE),e.attributes.URI&&(f.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(f.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(f.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(f.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=f}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){d+=1,s.discontinuity=!0,this.manifest.discontinuityStarts.push(a.length)},"program-date-time":function(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),s.dateTimeString=e.dateTimeString,s.dateTimeObject=e.dateTimeObject},targetduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration}):(this.manifest.targetDuration=e.duration,M.call(this,this.manifest))},start:function(){e.attributes&&!isNaN(e.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){s.cueOut=e.data},"cue-out-cont":function(){s.cueOutCont=e.data},"cue-in":function(){s.cueIn=e.data},skip:function(){this.manifest.skip=P(e.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",e.attributes,["SKIPPED-SEGMENTS"])},part:function(){var t=this;o=!0;var n=this.manifest.segments.length,r=P(e.attributes);s.parts=s.parts||[],s.parts.push(r),r.byterange&&(r.byterange.hasOwnProperty("offset")||(r.byterange.offset=p),p=r.byterange.offset+r.byterange.length);var i=s.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+i+" for segment #"+n,e.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((function(e,n){e.hasOwnProperty("lastPart")||t.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+n+" lacks required attribute(s): LAST-PART"})}))},"server-control":function(){var t=this.manifest.serverControl=P(e.attributes);t.hasOwnProperty("canBlockReload")||(t.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),M.call(this,this.manifest),t.canSkipDateranges&&!t.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint":function(){var t=this.manifest.segments.length,n=P(e.attributes),r=n.type&&"PART"===n.type;s.preloadHints=s.preloadHints||[],s.preloadHints.push(n),n.byterange&&(n.byterange.hasOwnProperty("offset")||(n.byterange.offset=r?p:0,r&&(p=n.byterange.offset+n.byterange.length)));var i=s.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+i+" for segment #"+t,e.attributes,["TYPE","URI"]),n.type)for(var a=0;a<s.preloadHints.length-1;a++){var o=s.preloadHints[a];o.type&&o.type===n.type&&this.trigger("warn",{message:"#EXT-X-PRELOAD-HINT #"+i+" for segment #"+t+" has the same TYPE "+n.type+" as preload hint #"+a})}},"rendition-report":function(){var t=P(e.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(t);var n=this.manifest.renditionReports.length-1,r=["LAST-MSN","URI"];o&&r.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+n,e.attributes,r)},"part-inf":function(){this.manifest.partInf=P(e.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",e.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),M.call(this,this.manifest)}}[e.tagType]||u).call(i)},uri:function(){s.uri=e.uri,a.push(s),this.manifest.targetDuration&&!("duration"in s)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),s.duration=this.manifest.targetDuration),r&&(s.key=r),s.timeline=d,n&&(s.map=n),p=0,s={}},comment:function(){},custom:function(){e.segment?(s.custom=s.custom||{},s.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(i)})),t}p(t,e);var n=t.prototype;return n.warnOnMissingAttributes_=function(e,t,n){var r=[];n.forEach((function(e){t.hasOwnProperty(e)||r.push(e)})),r.length&&this.trigger("warn",{message:e+" lacks required attribute(s): "+r.join(", ")})},n.push=function(e){this.lineStream.push(e)},n.end=function(){this.lineStream.push("\n"),this.trigger("end")},n.addParser=function(e){this.parseStream.addParser(e)},n.addTagMapper=function(e){this.parseStream.addTagMapper(e)},t}(A),L={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},F=["video","audio","text"],U=["Video","Audio","Text"],B=function(e){return e?e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,n){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(n).toString(16)).slice(-2)})):e},j=function(e){void 0===e&&(e="");var t=e.split(","),n=[];return t.forEach((function(e){var t;e=e.trim(),F.forEach((function(r){var i=L[r].exec(e.toLowerCase());if(i&&!(i.length<=1)){t=r;var a=e.substring(0,i[1].length),s=e.replace(a,"");n.push({type:a,details:s,mediaType:r})}})),t||n.push({type:e,details:"",mediaType:"unknown"})})),n},q=function(e){return void 0===e&&(e=""),L.audio.test(e.trim().toLowerCase())},H=function(e){if(e&&"string"==typeof e){var t,n=e.toLowerCase().split(",").map((function(e){return B(e.trim())})),r="video";1===n.length&&q(n[0])?r="audio":1===n.length&&(void 0===(t=n[0])&&(t=""),L.text.test(t.trim().toLowerCase()))&&(r="application");var i="mp4";return n.every((function(e){return L.mp4.test(e)}))?i="mp4":n.every((function(e){return L.webm.test(e)}))?i="webm":n.every((function(e){return L.ogg.test(e)}))&&(i="ogg"),r+"/"+i+';codecs="'+e+'"'}},G=function(e){return void 0===e&&(e=""),i().MediaSource&&i().MediaSource.isTypeSupported&&i().MediaSource.isTypeSupported(H(e))||!1},V=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every((function(e){e=e.trim();for(var t=0;t<U.length;t++)if(L["muxer"+U[t]].test(e))return!0;return!1}))},Y="mp4a.40.2",z=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,Z=/^application\/dash\+xml/i,K=function(e){return z.test(e)?"hls":Z.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null},W=function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},X=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||W(e)||e instanceof ArrayBuffer||(e="number"!=typeof e||"number"==typeof e&&e!=e?0:[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},$=i().BigInt||Number,Q=[$("0x1"),$("0x100"),$("0x10000"),$("0x1000000"),$("0x100000000"),$("0x10000000000"),$("0x1000000000000"),$("0x100000000000000"),$("0x10000000000000000")],J=(function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);255===t[0]||t[0]}(),function(e,t){var n=void 0===t?{}:t,r=n.signed,i=void 0!==r&&r,a=n.le,s=void 0!==a&&a;e=X(e);var o=s?"reduce":"reduceRight",u=(e[o]?e[o]:Array.prototype[o]).call(e,(function(t,n,r){var i=s?r:Math.abs(r+1-e.length);return t+$(n)*Q[i]}),$(0));if(i){var l=Q[e.length]/$(2)-$(1);(u=$(u))>l&&(u-=l,u-=l,u-=$(2))}return Number(u)}),ee=function(e,t){if("string"!=typeof e&&e&&"function"==typeof e.toString&&(e=e.toString()),"string"!=typeof e)return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var n=new Uint8Array(e.length),r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return n},te=function(e,t,n){var r=void 0===n?{}:n,i=r.offset,a=void 0===i?0:i,s=r.mask,o=void 0===s?[]:s;e=X(e);var u=(t=X(t)).every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&u.call(t,(function(t,n){return t===(o[n]?o[n]&e[a+n]:e[a+n])}))},ne=n(3969),re=function(e){return!!e&&"object"==typeof e},ie=function e(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.reduce((function(t,n){return"object"!=typeof n||Object.keys(n).forEach((function(r){Array.isArray(t[r])&&Array.isArray(n[r])?t[r]=t[r].concat(n[r]):re(t[r])&&re(n[r])?t[r]=e(t[r],n[r]):t[r]=n[r]})),t}),{})},ae=function(e){return Object.keys(e).map((function(t){return e[t]}))},se=function(e){return e.reduce((function(e,t){return e.concat(t)}),[])},oe=function(e){if(!e.length)return[];for(var t=[],n=0;n<e.length;n++)t.push(e[n]);return t},ue=function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1},le=function(e){var t=e.baseUrl,n=void 0===t?"":t,r=e.source,a=void 0===r?"":r,s=e.range,o=void 0===s?"":s,u=e.indexRange,l=void 0===u?"":u,c={uri:a,resolvedUri:w(n||"",a)};if(o||l){var d,f=(o||l).split("-"),h=i().BigInt?i().BigInt(f[0]):parseInt(f[0],10),p=i().BigInt?i().BigInt(f[1]):parseInt(f[1],10);h<Number.MAX_SAFE_INTEGER&&"bigint"==typeof h&&(h=Number(h)),p<Number.MAX_SAFE_INTEGER&&"bigint"==typeof p&&(p=Number(p)),"bigint"==typeof(d="bigint"==typeof p||"bigint"==typeof h?i().BigInt(p)-i().BigInt(h)+i().BigInt(1):p-h+1)&&d<Number.MAX_SAFE_INTEGER&&(d=Number(d)),c.byterange={length:d,offset:h}}return c},ce=function(e){return e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e},de={static:function(e){var t=e.duration,n=e.timescale,r=void 0===n?1:n,i=e.sourceDuration,a=e.periodDuration,s=ce(e.endNumber),o=t/r;return"number"==typeof s?{start:0,end:s}:"number"==typeof a?{start:0,end:a/o}:{start:0,end:i/o}},dynamic:function(e){var t=e.NOW,n=e.clientOffset,r=e.availabilityStartTime,i=e.timescale,a=void 0===i?1:i,s=e.duration,o=e.periodStart,u=void 0===o?0:o,l=e.minimumUpdatePeriod,c=void 0===l?0:l,d=e.timeShiftBufferDepth,f=void 0===d?1/0:d,h=ce(e.endNumber),p=(t+n)/1e3,g=r+u,m=p+c-g,y=Math.ceil(m*a/s),v=Math.floor((p-g-f)*a/s),_=Math.floor((p-g)*a/s);return{start:Math.max(0,v),end:"number"==typeof h?h:Math.min(y,_)}}},fe=function(e){var t=e.type,n=e.duration,r=e.timescale,i=void 0===r?1:r,a=e.periodDuration,s=e.sourceDuration,o=de[t](e),u=function(e,t){for(var n=[],r=e;r<t;r++)n.push(r);return n}(o.start,o.end).map(function(e){return function(t){var n=e.duration,r=e.timescale,i=void 0===r?1:r,a=e.periodStart,s=e.startNumber;return{number:(void 0===s?1:s)+t,duration:n/i,timeline:a,time:t*n}}}(e));if("static"===t){var l=u.length-1,c="number"==typeof a?a:s;u[l].duration=c-n/i*l}return u},he=function(e){var t=e.baseUrl,n=e.initialization,r=void 0===n?{}:n,i=e.sourceDuration,a=e.indexRange,s=void 0===a?"":a,o=e.periodStart,u=e.presentationTime,l=e.number,c=void 0===l?0:l,d=e.duration;if(!t)throw new Error("NO_BASE_URL");var f=le({baseUrl:t,source:r.sourceURL,range:r.range}),h=le({baseUrl:t,source:t,indexRange:s});if(h.map=f,d){var p=fe(e);p.length&&(h.duration=p[0].duration,h.timeline=p[0].timeline)}else i&&(h.duration=i,h.timeline=o);return h.presentationTime=u||o,h.number=c,[h]},pe=function(e,t,n){var r,a=e.sidx.map?e.sidx.map:null,s=e.sidx.duration,o=e.timeline||0,u=e.sidx.byterange,l=u.offset+u.length,c=t.timescale,d=t.references.filter((function(e){return 1!==e.referenceType})),f=[],h=e.endList?"static":"dynamic",p=e.sidx.timeline,g=p,m=e.mediaSequence||0;r="bigint"==typeof t.firstOffset?i().BigInt(l)+t.firstOffset:l+t.firstOffset;for(var y=0;y<d.length;y++){var v,_=t.references[y],T=_.referencedSize,b=_.subsegmentDuration;v="bigint"==typeof r?r+i().BigInt(T)-i().BigInt(1):r+T-1;var E=he({baseUrl:n,timescale:c,timeline:o,periodStart:p,presentationTime:g,number:m,duration:b,sourceDuration:s,indexRange:r+"-"+v,type:h})[0];a&&(E.map=a),f.push(E),r+="bigint"==typeof r?i().BigInt(T):T,g+=b/c,m++}return e.segments=f,e},ge=["AUDIO","SUBTITLES"],me=function(e){return(t=e,n=function(e){return e.timeline},ae(t.reduce((function(e,t){return t.forEach((function(t){e[n(t)]=t})),e}),{}))).sort((function(e,t){return e.timeline>t.timeline?1:-1}));var t,n},ye=function(e){var t,n,r=[];return t=e,n=function(e,t,n,i){r=r.concat(e.playlists||[])},ge.forEach((function(e){for(var r in t.mediaGroups[e])for(var i in t.mediaGroups[e][r]){var a=t.mediaGroups[e][r][i];n(a)}})),r},ve=function(e){var t=e.playlist,n=e.mediaSequence;t.mediaSequence=n,t.segments.forEach((function(e,n){e.number=t.mediaSequence+n}))},_e=function(e){return e&&e.uri+"-"+(n="bigint"==typeof(t=e.byterange).offset||"bigint"==typeof t.length?i().BigInt(t.offset)+i().BigInt(t.length)-i().BigInt(1):t.offset+t.length-1,t.offset+"-"+n);var t,n},Te=function(e){return ae(e.reduce((function(e,t){var n,r=t.attributes.id+(t.attributes.lang||"");e[r]?(t.segments&&(t.segments[0]&&(t.segments[0].discontinuity=!0),(n=e[r].segments).push.apply(n,t.segments)),t.attributes.contentProtection&&(e[r].attributes.contentProtection=t.attributes.contentProtection)):(e[r]=t,e[r].attributes.timelineStarts=[]);return e[r].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e}),{})).map((function(e){var t;return e.discontinuityStarts=(t=e.segments||[],"discontinuity",t.reduce((function(e,t,n){return t.discontinuity&&e.push(n),e}),[])),e}))},be=function(e,t){var n=_e(e.sidx),r=n&&t[n]&&t[n].sidx;return r&&pe(e,r,e.sidx.resolvedUri),e},Ee=function(e,t){if(void 0===t&&(t={}),!Object.keys(t).length)return e;for(var n in e)e[n]=be(e[n],t);return e},Se=function(e){var t,n=e.attributes,r=e.segments,i=e.sidx,a=e.discontinuityStarts,s={attributes:(t={NAME:n.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:n.width,height:n.height},CODECS:n.codecs,BANDWIDTH:n.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===n.type,timeline:n.periodStart,resolvedUri:"",targetDuration:n.duration,discontinuityStarts:a,timelineStarts:n.timelineStarts,segments:r};return n.frameRate&&(s.attributes["FRAME-RATE"]=n.frameRate),n.contentProtection&&(s.contentProtection=n.contentProtection),i&&(s.sidx=i),s},we=function(e){var t=e.attributes;return"video/mp4"===t.mimeType||"video/webm"===t.mimeType||"video"===t.contentType},Ae=function(e){var t=e.attributes;return"audio/mp4"===t.mimeType||"audio/webm"===t.mimeType||"audio"===t.contentType},Ie=function(e){var t=e.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType},Ce=function(e){return e?Object.keys(e).reduce((function(t,n){var r=e[n];return t.concat(r.playlists)}),[]):[]},Re=function(e){var t,n=e.dashPlaylists,r=e.locations,i=e.sidxMapping,a=void 0===i?{}:i,s=e.previousManifest;if(!n.length)return{};var o=n[0].attributes,u=o.sourceDuration,l=o.type,c=o.suggestedPresentationDelay,d=o.minimumUpdatePeriod,f=Te(n.filter(we)).map(Se),h=Te(n.filter(Ae)),p=Te(n.filter(Ie)),g=n.map((function(e){return e.attributes.captionServices})).filter(Boolean),m={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(t={AUDIO:{},VIDEO:{}},t["CLOSED-CAPTIONS"]={},t.SUBTITLES={},t),uri:"",duration:u,playlists:Ee(f,a)};d>=0&&(m.minimumUpdatePeriod=1e3*d),r&&(m.locations=r),"dynamic"===l&&(m.suggestedPresentationDelay=c);var y,v,_,T,b,E,S,w=0===m.playlists.length,A=h.length?function(e,t,n){var r;void 0===t&&(t={}),void 0===n&&(n=!1);var i=e.reduce((function(e,i){var a=i.attributes.role&&i.attributes.role.value||"",s=i.attributes.lang||"",o=i.attributes.label||"main";if(s&&!i.attributes.label){var u=a?" ("+a+")":"";o=""+i.attributes.lang+u}e[o]||(e[o]={language:s,autoselect:!0,default:"main"===a,playlists:[],uri:""});var l=be(function(e,t){var n,r=e.attributes,i=e.segments,a=e.sidx,s=e.mediaSequence,o=e.discontinuitySequence,u=e.discontinuityStarts,l={attributes:(n={NAME:r.id,BANDWIDTH:r.bandwidth,CODECS:r.codecs},n["PROGRAM-ID"]=1,n),uri:"",endList:"static"===r.type,timeline:r.periodStart,resolvedUri:"",targetDuration:r.duration,discontinuitySequence:o,discontinuityStarts:u,timelineStarts:r.timelineStarts,mediaSequence:s,segments:i};return r.contentProtection&&(l.contentProtection=r.contentProtection),a&&(l.sidx=a),t&&(l.attributes.AUDIO="audio",l.attributes.SUBTITLES="subs"),l}(i,n),t);return e[o].playlists.push(l),void 0===r&&"main"===a&&((r=i).default=!0),e}),{});return r||(i[Object.keys(i)[0]].default=!0),i}(h,a,w):null,I=p.length?function(e,t){return void 0===t&&(t={}),e.reduce((function(e,n){var r=n.attributes.lang||"text";return e[r]||(e[r]={language:r,default:!1,autoselect:!1,playlists:[],uri:""}),e[r].playlists.push(be(function(e){var t,n=e.attributes,r=e.segments,i=e.mediaSequence,a=e.discontinuityStarts,s=e.discontinuitySequence;void 0===r&&(r=[{uri:n.baseUrl,timeline:n.periodStart,resolvedUri:n.baseUrl||"",duration:n.sourceDuration,number:0}],n.duration=n.sourceDuration);var o=((t={NAME:n.id,BANDWIDTH:n.bandwidth})["PROGRAM-ID"]=1,t);return n.codecs&&(o.CODECS=n.codecs),{attributes:o,uri:"",endList:"static"===n.type,timeline:n.periodStart,resolvedUri:n.baseUrl||"",targetDuration:n.duration,timelineStarts:n.timelineStarts,discontinuityStarts:a,discontinuitySequence:s,mediaSequence:i,segments:r}}(n),t)),e}),{})}(p,a):null,C=f.concat(Ce(A),Ce(I)),R=C.map((function(e){return e.timelineStarts}));return m.timelineStarts=me(R),y=C,v=m.timelineStarts,y.forEach((function(e){e.mediaSequence=0,e.discontinuitySequence=ue(v,(function(t){return t.timeline===e.timeline})),e.segments&&e.segments.forEach((function(e,t){e.number=t}))})),A&&(m.mediaGroups.AUDIO.audio=A),I&&(m.mediaGroups.SUBTITLES.subs=I),g.length&&(m.mediaGroups["CLOSED-CAPTIONS"].cc=g.reduce((function(e,t){return t?(t.forEach((function(t){var n=t.channel,r=t.language;e[r]={autoselect:!1,default:!1,instreamId:n,language:r},t.hasOwnProperty("aspectRatio")&&(e[r].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[r].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[r]["3D"]=t["3D"])})),e):e}),{})),s?(T=(_={oldManifest:s,newManifest:m}).oldManifest,b=_.newManifest,E=T.playlists.concat(ye(T)),S=b.playlists.concat(ye(b)),b.timelineStarts=me([T.timelineStarts,b.timelineStarts]),function(e){var t=e.oldPlaylists,n=e.timelineStarts;e.newPlaylists.forEach((function(e){e.discontinuitySequence=ue(n,(function(t){return t.timeline===e.timeline}));var r=function(e,t){for(var n=0;n<e.length;n++)if(e[n].attributes.NAME===t)return e[n];return null}(t,e.attributes.NAME);if(r&&!e.sidx){var i=e.segments[0],a=ue(r.segments,(function(e){return Math.abs(e.presentationTime-i.presentationTime)<.016666666666666666}));if(-1===a)return ve({playlist:e,mediaSequence:r.mediaSequence+r.segments.length}),e.segments[0].discontinuity=!0,e.discontinuityStarts.unshift(0),void((!r.segments.length&&e.timeline>r.timeline||r.segments.length&&e.timeline>r.segments[r.segments.length-1].timeline)&&e.discontinuitySequence--);r.segments[a].discontinuity&&!i.discontinuity&&(i.discontinuity=!0,e.discontinuityStarts.unshift(0),e.discontinuitySequence--),ve({playlist:e,mediaSequence:r.segments[a].number})}}))}({oldPlaylists:E,newPlaylists:S,timelineStarts:b.timelineStarts}),b):m},De=function(e,t,n){var r=e.NOW,i=e.clientOffset,a=e.availabilityStartTime,s=e.timescale,o=void 0===s?1:s,u=e.periodStart,l=void 0===u?0:u,c=e.minimumUpdatePeriod,d=(r+i)/1e3+(void 0===c?0:c)-(a+l);return Math.ceil((d*o-t)/n)},xe=function(e,t){for(var n=e.type,r=e.minimumUpdatePeriod,i=void 0===r?0:r,a=e.media,s=void 0===a?"":a,o=e.sourceDuration,u=e.timescale,l=void 0===u?1:u,c=e.startNumber,d=void 0===c?1:c,f=e.periodStart,h=[],p=-1,g=0;g<t.length;g++){var m=t[g],y=m.d,v=m.r||0,_=m.t||0;p<0&&(p=_),_&&_>p&&(p=_);var T=void 0;if(v<0){var b=g+1;T=b===t.length?"dynamic"===n&&i>0&&s.indexOf("$Number$")>0?De(e,p,y):(o*l-p)/y:(t[b].t-p)/y}else T=v+1;for(var E=d+h.length+T,S=d+h.length;S<E;)h.push({number:S,duration:y/l,time:p,timeline:f}),p+=y,S++}return h},Ne=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,Oe=function(e,t){return e.replace(Ne,function(e){return function(t,n,r,i){if("$$"===t)return"$";if(void 0===e[n])return t;var a=""+e[n];return"RepresentationID"===n?a:(i=r?parseInt(i,10):1,a.length>=i?a:""+new Array(i-a.length+1).join("0")+a)}}(t))},Pe=function(e,t){var n={RepresentationID:e.id,Bandwidth:e.bandwidth||0},r=e.initialization,i=void 0===r?{sourceURL:"",range:""}:r,a=le({baseUrl:e.baseUrl,source:Oe(i.sourceURL,n),range:i.range}),s=function(e,t){return e.duration||t?e.duration?fe(e):xe(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}]}(e,t);return s.map((function(t){n.Number=t.number,n.Time=t.time;var r=Oe(e.media||"",n),i=e.timescale||1,s=e.presentationTimeOffset||0,o=e.periodStart+(t.time-s)/i;return{uri:r,timeline:t.timeline,duration:t.duration,resolvedUri:w(e.baseUrl||"",r),map:a,number:t.number,presentationTime:o}}))},Me=function(e,t){var n=e.duration,r=e.segmentUrls,i=void 0===r?[]:r,a=e.periodStart;if(!n&&!t||n&&t)throw new Error("SEGMENT_TIME_UNSPECIFIED");var s,o=i.map((function(t){return function(e,t){var n=e.baseUrl,r=e.initialization,i=void 0===r?{}:r,a=le({baseUrl:n,source:i.sourceURL,range:i.range}),s=le({baseUrl:n,source:t.media,range:t.mediaRange});return s.map=a,s}(e,t)}));return n&&(s=fe(e)),t&&(s=xe(e,t)),s.map((function(t,n){if(o[n]){var r=o[n],i=e.timescale||1,s=e.presentationTimeOffset||0;return r.timeline=t.timeline,r.duration=t.duration,r.number=t.number,r.presentationTime=a+(t.time-s)/i,r}})).filter((function(e){return e}))},ke=function(e){var t,n,r=e.attributes,i=e.segmentInfo;i.template?(n=Pe,t=ie(r,i.template)):i.base?(n=he,t=ie(r,i.base)):i.list&&(n=Me,t=ie(r,i.list));var a={attributes:r};if(!n)return a;var s=n(t,i.segmentTimeline);if(t.duration){var o=t,u=o.duration,l=o.timescale,c=void 0===l?1:l;t.duration=u/c}else s.length?t.duration=s.reduce((function(e,t){return Math.max(e,Math.ceil(t.duration))}),0):t.duration=0;return a.attributes=t,a.segments=s,i.base&&t.indexRange&&(a.sidx=s[0],a.segments=[]),a},Le=function(e,t){return oe(e.childNodes).filter((function(e){return e.tagName===t}))},Fe=function(e){return e.textContent.trim()},Ue=function(e){var t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;var n=t.slice(1),r=n[0],i=n[1],a=n[2],s=n[3],o=n[4],u=n[5];return 31536e3*parseFloat(r||0)+2592e3*parseFloat(i||0)+86400*parseFloat(a||0)+3600*parseFloat(s||0)+60*parseFloat(o||0)+parseFloat(u||0)},Be={mediaPresentationDuration:function(e){return Ue(e)},availabilityStartTime:function(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t=e)&&(t+="Z"),Date.parse(t)/1e3;var t},minimumUpdatePeriod:function(e){return Ue(e)},suggestedPresentationDelay:function(e){return Ue(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return Ue(e)},start:function(e){return Ue(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},frameRate:function(e){return function(e){return parseFloat(e.split("/").reduce((function(e,t){return e/t})))}(e)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},presentationTimeOffset:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);return isNaN(t)?Ue(e):t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},je=function(e){return e&&e.attributes?oe(e.attributes).reduce((function(e,t){var n=Be[t.name]||Be.DEFAULT;return e[t.name]=n(t.value),e}),{}):{}},qe={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},He=function(e,t){return t.length?se(e.map((function(e){return t.map((function(t){return w(e,Fe(t))}))}))):e},Ge=function(e){var t=Le(e,"SegmentTemplate")[0],n=Le(e,"SegmentList")[0],r=n&&Le(n,"SegmentURL").map((function(e){return ie({tag:"SegmentURL"},je(e))})),i=Le(e,"SegmentBase")[0],a=n||t,s=a&&Le(a,"SegmentTimeline")[0],o=n||i||t,u=o&&Le(o,"Initialization")[0],l=t&&je(t);l&&u?l.initialization=u&&je(u):l&&l.initialization&&(l.initialization={sourceURL:l.initialization});var c={template:l,segmentTimeline:s&&Le(s,"S").map((function(e){return je(e)})),list:n&&ie(je(n),{segmentUrls:r,initialization:je(u)}),base:i&&ie(je(i),{initialization:je(u)})};return Object.keys(c).forEach((function(e){c[e]||delete c[e]})),c},Ve=function(e,t){return function(n,r){var i=He(t,Le(n.node,"BaseURL")),a=ie(e,{periodStart:n.attributes.start});"number"==typeof n.attributes.duration&&(a.periodDuration=n.attributes.duration);var s=Le(n.node,"AdaptationSet"),o=Ge(n.node);return se(s.map(function(e,t,n){return function(r){var i,a=je(r),s=He(t,Le(r,"BaseURL")),o=Le(r,"Role")[0],u={role:je(o)},l=ie(e,a,u),c=Le(r,"Accessibility")[0],d="urn:scte:dash:cc:cea-608:2015"===(i=je(c)).schemeIdUri?("string"!=typeof i.value?[]:i.value.split(";")).map((function(e){var t,n;if(n=e,/^CC\d=/.test(e)){var r=e.split("=");t=r[0],n=r[1]}else/^CC\d$/.test(e)&&(t=e);return{channel:t,language:n}})):"urn:scte:dash:cc:cea-708:2015"===i.schemeIdUri?("string"!=typeof i.value?[]:i.value.split(";")).map((function(e){var t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){var n=e.split("="),r=n[0],i=n[1],a=void 0===i?"":i;t.channel=r,t.language=e,a.split(",").forEach((function(e){var n=e.split(":"),r=n[0],i=n[1];"lang"===r?t.language=i:"er"===r?t.easyReader=Number(i):"war"===r?t.aspectRatio=Number(i):"3D"===r&&(t["3D"]=Number(i))}))}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t})):void 0;d&&(l=ie(l,{captionServices:d}));var f=Le(r,"Label")[0];if(f&&f.childNodes.length){var h=f.childNodes[0].nodeValue.trim();l=ie(l,{label:h})}var p=Le(r,"ContentProtection").reduce((function(e,t){var n=je(t);n.schemeIdUri&&(n.schemeIdUri=n.schemeIdUri.toLowerCase());var r=qe[n.schemeIdUri];if(r){e[r]={attributes:n};var i=Le(t,"cenc:pssh")[0];if(i){var a=Fe(i);e[r].pssh=a&&I(a)}}return e}),{});Object.keys(p).length&&(l=ie(l,{contentProtection:p}));var g=Ge(r),m=Le(r,"Representation"),y=ie(n,g);return se(m.map(function(e,t,n){return function(r){var i=Le(r,"BaseURL"),a=He(t,i),s=ie(e,je(r)),o=Ge(r);return a.map((function(e){return{segmentInfo:ie(n,o),attributes:ie(s,{baseUrl:e})}}))}}(l,s,y)))}}(a,i,o)))}},Ye=function(e){if(""===e)throw new Error("DASH_EMPTY_MANIFEST");var t,n,r=new ne.DOMParser;try{n=(t=r.parseFromString(e,"application/xml"))&&"MPD"===t.documentElement.tagName?t.documentElement:null}catch(e){}if(!n||n&&n.getElementsByTagName("parsererror").length>0)throw new Error("DASH_INVALID_XML");return n},ze=n(1215),Ze=n.n(ze),Ke=X([73,68,51]),We=function e(t,n){return void 0===n&&(n=0),(t=X(t)).length-n<10||!te(t,Ke,{offset:n})?n:(n+=function(e,t){void 0===t&&(t=0);var n=(e=X(e))[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&n)>>4?r+20:r+10}(t,n),e(t,n))},Xe=(new Uint8Array([79,112,117,115,72,101,97,100]),function(e){return"string"==typeof e?ee(e):e}),$e=function(e){e=X(e);for(var t=[],n=0;e.length>n;){var r=e[n],i=0,a=0,s=e[++a];for(a++;128&s;)i=(127&s)<<7,s=e[a],a++;i+=127&s;for(var o=0;o<C.length;o++){var u=C[o],l=u.id,c=u.parser;if(r===l){t.push(c(e.subarray(a,a+i)));break}}n+=i+a}return t};C=[{id:3,parser:function(e){var t={tag:3,id:e[0]<<8|e[1],flags:e[2],size:3,dependsOnEsId:0,ocrEsId:0,descriptors:[],url:""};if(128&t.flags&&(t.dependsOnEsId=e[t.size]<<8|e[t.size+1],t.size+=2),64&t.flags){var n=e[t.size];t.url=function(e){if(!e)return"";e=Array.prototype.slice.call(e);var t=String.fromCharCode.apply(null,X(e));try{return decodeURIComponent(escape(t))}catch(e){}return t}(e.subarray(t.size+1,t.size+1+n)),t.size+=n}return 32&t.flags&&(t.ocrEsId=e[t.size]<<8|e[t.size+1],t.size+=2),t.descriptors=$e(e.subarray(t.size))||[],t}},{id:4,parser:function(e){return{tag:4,oti:e[0],streamType:e[1],bufferSize:e[2]<<16|e[3]<<8|e[4],maxBitrate:e[5]<<24|e[6]<<16|e[7]<<8|e[8],avgBitrate:e[9]<<24|e[10]<<16|e[11]<<8|e[12],descriptors:$e(e.subarray(13))}}},{id:5,parser:function(e){return{tag:5,bytes:e}}},{id:6,parser:function(e){return{tag:6,bytes:e}}}];var Qe=function e(t,n,r){void 0===r&&(r=!1),n=function(e){return Array.isArray(e)?e.map((function(e){return Xe(e)})):[Xe(e)]}(n),t=X(t);var i=[];if(!n.length)return i;for(var a=0;a<t.length;){var s=(t[a]<<24|t[a+1]<<16|t[a+2]<<8|t[a+3])>>>0,o=t.subarray(a+4,a+8);if(0===s)break;var u=a+s;if(u>t.length){if(r)break;u=t.length}var l=t.subarray(a+8,u);te(o,n[0])&&(1===n.length?i.push(l):i.push.apply(i,e(l,n.slice(1),r))),a=u}return i},Je={EBML:X([26,69,223,163]),DocType:X([66,130]),Segment:X([24,83,128,103]),SegmentInfo:X([21,73,169,102]),Tracks:X([22,84,174,107]),Track:X([174]),TrackNumber:X([215]),DefaultDuration:X([35,227,131]),TrackEntry:X([174]),TrackType:X([131]),FlagDefault:X([136]),CodecID:X([134]),CodecPrivate:X([99,162]),VideoTrack:X([224]),AudioTrack:X([225]),Cluster:X([31,67,182,117]),Timestamp:X([231]),TimestampScale:X([42,215,177]),BlockGroup:X([160]),BlockDuration:X([155]),Block:X([161]),SimpleBlock:X([163])},et=[128,64,32,16,8,4,2,1],tt=function(e,t,n,r){void 0===n&&(n=!0),void 0===r&&(r=!1);var i=function(e){for(var t=1,n=0;n<et.length&&!(e&et[n]);n++)t++;return t}(e[t]),a=e.subarray(t,t+i);return n&&((a=Array.prototype.slice.call(e,t,t+i))[0]^=et[i-1]),{length:i,value:J(a,{signed:r}),bytes:a}},nt=function e(t){return"string"==typeof t?t.match(/.{1,2}/g).map((function(t){return e(t)})):"number"==typeof t?function(e,t){var n=(void 0===t?{}:t).le,r=void 0!==n&&n;("bigint"!=typeof e&&"number"!=typeof e||"number"==typeof e&&e!=e)&&(e=0);for(var i,a=(i=e=$(e),Math.ceil(function(e){return e.toString(2).length}(i)/8)),s=new Uint8Array(new ArrayBuffer(a)),o=0;o<a;o++){var u=r?o:Math.abs(o+1-s.length);s[u]=Number(e/Q[o]&$(255)),e<0&&(s[u]=Math.abs(~s[u]),s[u]-=0===o?1:2)}return s}(t):t},rt=function e(t,n,r){if(r>=n.length)return n.length;var i=tt(n,r,!1);if(te(t.bytes,i.bytes))return r;var a=tt(n,r+i.length);return e(t,n,r+a.length+a.value+i.length)},it=function e(t,n){n=function(e){return Array.isArray(e)?e.map((function(e){return nt(e)})):[nt(e)]}(n),t=X(t);var r=[];if(!n.length)return r;for(var i=0;i<t.length;){var a=tt(t,i,!1),s=tt(t,i+a.length),o=i+a.length+s.length;127===s.value&&(s.value=rt(a,t,o),s.value!==t.length&&(s.value-=o));var u=o+s.value>t.length?t.length:o+s.value,l=t.subarray(o,u);te(n[0],a.bytes)&&(1===n.length?r.push(l):r=r.concat(e(l,n.slice(1)))),i+=a.length+s.length+l.length}return r},at=X([0,0,0,1]),st=X([0,0,1]),ot=X([0,0,3]),ut=function(e){for(var t=[],n=1;n<e.length-2;)te(e.subarray(n,n+3),ot)&&(t.push(n+2),n++),n++;if(0===t.length)return e;var r=e.length-t.length,i=new Uint8Array(r),a=0;for(n=0;n<r;a++,n++)a===t[0]&&(a++,t.shift()),i[n]=e[a];return i},lt=function(e,t,n,r){void 0===r&&(r=1/0),e=X(e),n=[].concat(n);for(var i,a=0,s=0;a<e.length&&(s<r||i);){var o=void 0;if(te(e.subarray(a),at)?o=4:te(e.subarray(a),st)&&(o=3),o){if(s++,i)return ut(e.subarray(i,a));var u=void 0;"h264"===t?u=31&e[a+o]:"h265"===t&&(u=e[a+o]>>1&63),-1!==n.indexOf(u)&&(i=a+o),a+=o+("h264"===t?1:2)}else a++}return e.subarray(0,0)},ct={webm:X([119,101,98,109]),matroska:X([109,97,116,114,111,115,107,97]),flac:X([102,76,97,67]),ogg:X([79,103,103,83]),ac3:X([11,119]),riff:X([82,73,70,70]),avi:X([65,86,73]),wav:X([87,65,86,69]),"3gp":X([102,116,121,112,51,103]),mp4:X([102,116,121,112]),fmp4:X([115,116,121,112]),mov:X([102,116,121,112,113,116]),moov:X([109,111,111,118]),moof:X([109,111,111,102])},dt={aac:function(e){var t=We(e);return te(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=We(e);return te(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=it(e,[Je.EBML,Je.DocType])[0];return te(t,ct.webm)},mkv:function(e){var t=it(e,[Je.EBML,Je.DocType])[0];return te(t,ct.matroska)},mp4:function(e){return!dt["3gp"](e)&&!dt.mov(e)&&(!(!te(e,ct.mp4,{offset:4})&&!te(e,ct.fmp4,{offset:4}))||!(!te(e,ct.moof,{offset:4})&&!te(e,ct.moov,{offset:4}))||void 0)},mov:function(e){return te(e,ct.mov,{offset:4})},"3gp":function(e){return te(e,ct["3gp"],{offset:4})},ac3:function(e){var t=We(e);return te(e,ct.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];for(var t=0;t+188<e.length&&t<188;){if(71===e[t]&&71===e[t+188])return!0;t+=1}return!1},flac:function(e){var t=We(e);return te(e,ct.flac,{offset:t})},ogg:function(e){return te(e,ct.ogg)},avi:function(e){return te(e,ct.riff)&&te(e,ct.avi,{offset:8})},wav:function(e){return te(e,ct.riff)&&te(e,ct.wav,{offset:8})},h264:function(e){return function(e,t,n){return lt(e,"h264",7,3)}(e).length},h265:function(e){return function(e,t,n){return lt(e,"h265",[32,33],3)}(e).length}},ft=Object.keys(dt).filter((function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e})).concat(["ts","h264","h265"]);ft.forEach((function(e){var t=dt[e];dt[e]=function(e){return t(X(e))}}));var ht=dt,pt=function(e){e=X(e);for(var t=0;t<ft.length;t++){var n=ft[t];if(ht[n](e))return n}return""},gt=n(9458);function mt(e){return mt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},mt(e)}function yt(e){var t="function"==typeof Map?new Map:void 0;return yt=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return b(e,arguments,mt(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,e)},yt(e)}for(var vt,_t="7.21.5",Tt={},bt=function(e,t){return Tt[e]=Tt[e]||[],t&&(Tt[e]=Tt[e].concat(t)),Tt[e]},Et=function(e,t){var n=bt(e).indexOf(t);return!(n<=-1||(Tt[e]=Tt[e].slice(),Tt[e].splice(n,1),0))},St={prefixed:!0},wt=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],At=wt[0],It=0;It<wt.length;It++)if(wt[It][1]in u()){vt=wt[It];break}if(vt){for(var Ct=0;Ct<vt.length;Ct++)St[At[Ct]]=vt[Ct];St.prefixed=vt[0]!==At[0]}var Rt=[],Dt=function e(t){var n,r="info",a=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n("log",r,t)};return n=function(e,t){return function(n,r,a){var s=t.levels[r],o=new RegExp("^("+s+")$");if("log"!==n&&a.unshift(n.toUpperCase()+":"),a.unshift(e+":"),Rt){Rt.push([].concat(a));var u=Rt.length-1e3;Rt.splice(0,u>0?u:0)}if(i().console){var l=i().console[n];l||"debug"!==n||(l=i().console.info||i().console.log),l&&s&&o.test(n)&&l[Array.isArray(a)?"apply":"call"](i().console,a)}}}(t,a),a.createLogger=function(n){return e(t+": "+n)},a.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:r},a.level=function(e){if("string"==typeof e){if(!a.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');r=e}return r},(a.history=function(){return Rt?[].concat(Rt):[]}).filter=function(e){return(Rt||[]).filter((function(t){return new RegExp(".*"+e+".*").test(t[0])}))},a.history.clear=function(){Rt&&(Rt.length=0)},a.history.disable=function(){null!==Rt&&(Rt.length=0,Rt=null)},a.history.enable=function(){null===Rt&&(Rt=[])},a.error=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return n("error",r,t)},a.warn=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return n("warn",r,t)},a.debug=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return n("debug",r,t)},a}("VIDEOJS"),xt=Dt.createLogger,Nt=Object.prototype.toString,Ot=function(e){return kt(e)?Object.keys(e):[]};function Pt(e,t){Ot(e).forEach((function(n){return t(e[n],n)}))}function Mt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Object.assign?l.Z.apply(void 0,[e].concat(n)):(n.forEach((function(t){t&&Pt(t,(function(t,n){e[n]=t}))})),e)}function kt(e){return!!e&&"object"==typeof e}function Lt(e){return kt(e)&&"[object Object]"===Nt.call(e)&&e.constructor===Object}function Ft(e,t){if(!e||!t)return"";if("function"==typeof i().getComputedStyle){var n;try{n=i().getComputedStyle(e)}catch(e){return""}return n?n.getPropertyValue(t)||n[t]:""}return""}var Ut,Bt,jt,qt=i().navigator&&i().navigator.userAgent||"",Ht=/AppleWebKit\/([\d.]+)/i.exec(qt),Gt=Ht?parseFloat(Ht.pop()):null,Vt=/iPod/i.test(qt),Yt=(Ut=qt.match(/OS (\d+)_/i))&&Ut[1]?Ut[1]:null,zt=/Android/i.test(qt),Zt=function(){var e=qt.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),n=e[2]&&parseFloat(e[2]);return t&&n?parseFloat(e[1]+"."+e[2]):t||null}(),Kt=zt&&Zt<5&&Gt<537,Wt=/Firefox/i.test(qt),Xt=/Edg/i.test(qt),$t=!Xt&&(/Chrome/i.test(qt)||/CriOS/i.test(qt)),Qt=function(){var e=qt.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Jt=(Bt=/MSIE\s(\d+)\.\d/.exec(qt),!(jt=Bt&&parseFloat(Bt[1]))&&/Trident\/7.0/i.test(qt)&&/rv:11.0/.test(qt)&&(jt=11),jt),en=/Safari/i.test(qt)&&!$t&&!zt&&!Xt,tn=/Windows/i.test(qt),nn=Boolean(dn()&&("ontouchstart"in i()||i().navigator.maxTouchPoints||i().DocumentTouch&&i().document instanceof i().DocumentTouch)),rn=/iPad/i.test(qt)||en&&nn&&!/iPhone/i.test(qt),an=/iPhone/i.test(qt)&&!rn,sn=an||rn||Vt,on=(en||sn)&&!$t,un=Object.freeze({__proto__:null,IS_IPOD:Vt,IOS_VERSION:Yt,IS_ANDROID:zt,ANDROID_VERSION:Zt,IS_NATIVE_ANDROID:Kt,IS_FIREFOX:Wt,IS_EDGE:Xt,IS_CHROME:$t,CHROME_VERSION:Qt,IE_VERSION:Jt,IS_SAFARI:en,IS_WINDOWS:tn,TOUCH_ENABLED:nn,IS_IPAD:rn,IS_IPHONE:an,IS_IOS:sn,IS_ANY_SAFARI:on});function ln(e){return"string"==typeof e&&Boolean(e.trim())}function cn(e){if(e.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function dn(){return u()===i().document}function fn(e){return kt(e)&&1===e.nodeType}function hn(){try{return i().parent!==i().self}catch(e){return!0}}function pn(e){return function(t,n){if(!ln(t))return u()[e](null);ln(n)&&(n=u().querySelector(n));var r=fn(n)?n:u();return r[e]&&r[e](t)}}function gn(e,t,n,r){void 0===e&&(e="div"),void 0===t&&(t={}),void 0===n&&(n={});var i=u().createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){var n=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(Dt.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+e+" to "+n+"."),i.setAttribute(e,n)):"textContent"===e?mn(i,n):i[e]===n&&"tabIndex"!==e||(i[e]=n)})),Object.getOwnPropertyNames(n).forEach((function(e){i.setAttribute(e,n[e])})),r&&kn(i,r),i}function mn(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function yn(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function vn(e,t){return cn(t),e.classList?e.classList.contains(t):(n=t,new RegExp("(^|\\s)"+n+"($|\\s)")).test(e.className);var n}function _n(e,t){return e.classList?e.classList.add(t):vn(e,t)||(e.className=(e.className+" "+t).trim()),e}function Tn(e,t){return e?(e.classList?e.classList.remove(t):(cn(t),e.className=e.className.split(/\s+/).filter((function(e){return e!==t})).join(" ")),e):(Dt.warn("removeClass was called with an element that doesn't exist"),null)}function bn(e,t,n){var r=vn(e,t);if("function"==typeof n&&(n=n(e,t)),"boolean"!=typeof n&&(n=!r),n!==r)return n?_n(e,t):Tn(e,t),e}function En(e,t){Object.getOwnPropertyNames(t).forEach((function(n){var r=t[n];null==r||!1===r?e.removeAttribute(n):e.setAttribute(n,!0===r?"":r)}))}function Sn(e){var t={};if(e&&e.attributes&&e.attributes.length>0)for(var n=e.attributes,r=n.length-1;r>=0;r--){var i=n[r].name,a=n[r].value;"boolean"!=typeof e[i]&&-1===",autoplay,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+i+",")||(a=null!==a),t[i]=a}return t}function wn(e,t){return e.getAttribute(t)}function An(e,t,n){e.setAttribute(t,n)}function In(e,t){e.removeAttribute(t)}function Cn(){u().body.focus(),u().onselectstart=function(){return!1}}function Rn(){u().onselectstart=function(){return!0}}function Dn(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),n={};return["bottom","height","left","right","top","width"].forEach((function(e){void 0!==t[e]&&(n[e]=t[e])})),n.height||(n.height=parseFloat(Ft(e,"height"))),n.width||(n.width=parseFloat(Ft(e,"width"))),n}}function xn(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};for(var t=e.offsetWidth,n=e.offsetHeight,r=0,i=0;e.offsetParent&&e!==u()[St.fullscreenElement];)r+=e.offsetLeft,i+=e.offsetTop,e=e.offsetParent;return{left:r,top:i,width:t,height:n}}function Nn(e,t){var n={x:0,y:0};if(sn)for(var r=e;r&&"html"!==r.nodeName.toLowerCase();){var i=Ft(r,"transform");if(/^matrix/.test(i)){var a=i.slice(7,-1).split(/,\s/).map(Number);n.x+=a[4],n.y+=a[5]}else if(/^matrix3d/.test(i)){var s=i.slice(9,-1).split(/,\s/).map(Number);n.x+=s[12],n.y+=s[13]}r=r.parentNode}var o={},u=xn(t.target),l=xn(e),c=l.width,d=l.height,f=t.offsetY-(l.top-u.top),h=t.offsetX-(l.left-u.left);return t.changedTouches&&(h=t.changedTouches[0].pageX-l.left,f=t.changedTouches[0].pageY+l.top,sn&&(h-=n.x,f-=n.y)),o.y=1-Math.max(0,Math.min(1,f/d)),o.x=Math.max(0,Math.min(1,h/c)),o}function On(e){return kt(e)&&3===e.nodeType}function Pn(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function Mn(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((function(e){return"function"==typeof e&&(e=e()),fn(e)||On(e)?e:"string"==typeof e&&/\S/.test(e)?u().createTextNode(e):void 0})).filter((function(e){return e}))}function kn(e,t){return Mn(t).forEach((function(t){return e.appendChild(t)})),e}function Ln(e,t){return kn(Pn(e),t)}function Fn(e){return void 0===e.button&&void 0===e.buttons||0===e.button&&void 0===e.buttons||"mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons}var Un,Bn=pn("querySelector"),jn=pn("querySelectorAll"),qn=Object.freeze({__proto__:null,isReal:dn,isEl:fn,isInFrame:hn,createEl:gn,textContent:mn,prependTo:yn,hasClass:vn,addClass:_n,removeClass:Tn,toggleClass:bn,setAttributes:En,getAttributes:Sn,getAttribute:wn,setAttribute:An,removeAttribute:In,blockTextSelection:Cn,unblockTextSelection:Rn,getBoundingClientRect:Dn,findPosition:xn,getPointerPosition:Nn,isTextNode:On,emptyEl:Pn,normalizeContent:Mn,appendContent:kn,insertContent:Ln,isSingleLeftClick:Fn,$:Bn,$$:jn}),Hn=!1,Gn=function(){if(!1!==Un.options.autoSetup){var e=Array.prototype.slice.call(u().getElementsByTagName("video")),t=Array.prototype.slice.call(u().getElementsByTagName("audio")),n=Array.prototype.slice.call(u().getElementsByTagName("video-js")),r=e.concat(t,n);if(r&&r.length>0)for(var i=0,a=r.length;i<a;i++){var s=r[i];if(!s||!s.getAttribute){Vn(1);break}void 0===s.player&&null!==s.getAttribute("data-setup")&&Un(s)}else Hn||Vn(1)}};function Vn(e,t){dn()&&(t&&(Un=t),i().setTimeout(Gn,e))}function Yn(){Hn=!0,i().removeEventListener("load",Yn)}dn()&&("complete"===u().readyState?Yn():i().addEventListener("load",Yn));var zn,Zn=function(e){var t=u().createElement("style");return t.className=e,t},Kn=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t},Wn=3;function Xn(){return Wn++}i().WeakMap||(zn=function(){function e(){this.vdata="vdata"+Math.floor(i().performance&&i().performance.now()||Date.now()),this.data={}}var t=e.prototype;return t.set=function(e,t){var n=e[this.vdata]||Xn();return e[this.vdata]||(e[this.vdata]=n),this.data[n]=t,this},t.get=function(e){var t=e[this.vdata];if(t)return this.data[t];Dt("We have no data for this element",e)},t.has=function(e){return e[this.vdata]in this.data},t.delete=function(e){var t=e[this.vdata];t&&(delete this.data[t],delete e[this.vdata])},e}());var $n,Qn=i().WeakMap?new WeakMap:new zn;function Jn(e,t){if(Qn.has(e)){var n=Qn.get(e);0===n.handlers[t].length&&(delete n.handlers[t],e.removeEventListener?e.removeEventListener(t,n.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,n.dispatcher)),Object.getOwnPropertyNames(n.handlers).length<=0&&(delete n.handlers,delete n.dispatcher,delete n.disabled),0===Object.getOwnPropertyNames(n).length&&Qn.delete(e)}}function er(e,t,n,r){n.forEach((function(n){e(t,n,r)}))}function tr(e){if(e.fixed_)return e;function t(){return!0}function n(){return!1}if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){var r=e||i().event;for(var a in e={},r)"layerX"!==a&&"layerY"!==a&&"keyLocation"!==a&&"webkitMovementX"!==a&&"webkitMovementY"!==a&&"path"!==a&&("returnValue"===a&&r.preventDefault||(e[a]=r[a]));if(e.target||(e.target=e.srcElement||u()),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){r.preventDefault&&r.preventDefault(),e.returnValue=!1,r.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){r.stopPropagation&&r.stopPropagation(),e.cancelBubble=!0,r.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=n,e.stopImmediatePropagation=function(){r.stopImmediatePropagation&&r.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=n,null!==e.clientX&&void 0!==e.clientX){var s=u().documentElement,o=u().body;e.pageX=e.clientX+(s&&s.scrollLeft||o&&o.scrollLeft||0)-(s&&s.clientLeft||o&&o.clientLeft||0),e.pageY=e.clientY+(s&&s.scrollTop||o&&o.scrollTop||0)-(s&&s.clientTop||o&&o.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e.fixed_=!0,e}var nr=function(){if("boolean"!=typeof $n){$n=!1;try{var e=Object.defineProperty({},"passive",{get:function(){$n=!0}});i().addEventListener("test",null,e),i().removeEventListener("test",null,e)}catch(e){}}return $n},rr=["touchstart","touchmove"];function ir(e,t,n){if(Array.isArray(t))return er(ir,e,t,n);Qn.has(e)||Qn.set(e,{});var r=Qn.get(e);if(r.handlers||(r.handlers={}),r.handlers[t]||(r.handlers[t]=[]),n.guid||(n.guid=Xn()),r.handlers[t].push(n),r.dispatcher||(r.disabled=!1,r.dispatcher=function(t,n){if(!r.disabled){t=tr(t);var i=r.handlers[t.type];if(i)for(var a=i.slice(0),s=0,o=a.length;s<o&&!t.isImmediatePropagationStopped();s++)try{a[s].call(e,t,n)}catch(e){Dt.error(e)}}}),1===r.handlers[t].length)if(e.addEventListener){var i=!1;nr()&&rr.indexOf(t)>-1&&(i={passive:!0}),e.addEventListener(t,r.dispatcher,i)}else e.attachEvent&&e.attachEvent("on"+t,r.dispatcher)}function ar(e,t,n){if(Qn.has(e)){var r=Qn.get(e);if(r.handlers){if(Array.isArray(t))return er(ar,e,t,n);var i=function(e,t){r.handlers[t]=[],Jn(e,t)};if(void 0!==t){var a=r.handlers[t];if(a)if(n){if(n.guid)for(var s=0;s<a.length;s++)a[s].guid===n.guid&&a.splice(s--,1);Jn(e,t)}else i(e,t)}else for(var o in r.handlers)Object.prototype.hasOwnProperty.call(r.handlers||{},o)&&i(e,o)}}}function sr(e,t,n){var r=Qn.has(e)?Qn.get(e):{},i=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=tr(t),r.dispatcher&&r.dispatcher.call(e,t,n),i&&!t.isPropagationStopped()&&!0===t.bubbles)sr.call(null,i,t,n);else if(!i&&!t.defaultPrevented&&t.target&&t.target[t.type]){Qn.has(t.target)||Qn.set(t.target,{});var a=Qn.get(t.target);t.target[t.type]&&(a.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),a.disabled=!1)}return!t.defaultPrevented}function or(e,t,n){if(Array.isArray(t))return er(or,e,t,n);var r=function r(){ar(e,t,r),n.apply(this,arguments)};r.guid=n.guid=n.guid||Xn(),ir(e,t,r)}function ur(e,t,n){var r=function r(){ar(e,t,r),n.apply(this,arguments)};r.guid=n.guid=n.guid||Xn(),ir(e,t,r)}var lr,cr=Object.freeze({__proto__:null,fixEvent:tr,on:ir,off:ar,trigger:sr,one:or,any:ur}),dr=30,fr=function(e,t,n){t.guid||(t.guid=Xn());var r=t.bind(e);return r.guid=n?n+"_"+t.guid:t.guid,r},hr=function(e,t){var n=i().performance.now();return function(){var r=i().performance.now();r-n>=t&&(e.apply(void 0,arguments),n=r)}},pr=function(){};pr.prototype.allowedEvents_={},pr.prototype.on=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},ir(this,e,t),this.addEventListener=n},pr.prototype.addEventListener=pr.prototype.on,pr.prototype.off=function(e,t){ar(this,e,t)},pr.prototype.removeEventListener=pr.prototype.off,pr.prototype.one=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},or(this,e,t),this.addEventListener=n},pr.prototype.any=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},ur(this,e,t),this.addEventListener=n},pr.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=tr(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),sr(this,e)},pr.prototype.dispatchEvent=pr.prototype.trigger,pr.prototype.queueTrigger=function(e){var t=this;lr||(lr=new Map);var n=e.type||e,r=lr.get(this);r||(r=new Map,lr.set(this,r));var a=r.get(n);r.delete(n),i().clearTimeout(a);var s=i().setTimeout((function(){r.delete(n),0===r.size&&(r=null,lr.delete(t)),t.trigger(e)}),0);r.set(n,s)};var gr=function(e){return"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e},mr=function(e){return e instanceof pr||!!e.eventBusEl_&&["on","one","off","trigger"].every((function(t){return"function"==typeof e[t]}))},yr=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},vr=function(e,t,n){if(!e||!e.nodeName&&!mr(e))throw new Error("Invalid target for "+gr(t)+"#"+n+"; must be a DOM node or evented object.")},_r=function(e,t,n){if(!yr(e))throw new Error("Invalid event type for "+gr(t)+"#"+n+"; must be a non-empty string or array.")},Tr=function(e,t,n){if("function"!=typeof e)throw new Error("Invalid listener for "+gr(t)+"#"+n+"; must be a function.")},br=function(e,t,n){var r,i,a,s=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return s?(r=e.eventBusEl_,t.length>=3&&t.shift(),i=t[0],a=t[1]):(r=t[0],i=t[1],a=t[2]),vr(r,e,n),_r(i,e,n),Tr(a,e,n),{isTargetingSelf:s,target:r,type:i,listener:a=fr(e,a)}},Er=function(e,t,n,r){vr(e,e,t),e.nodeName?cr[t](e,n,r):e[t](n,r)},Sr={on:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=br(this,n,"on"),a=i.isTargetingSelf,s=i.target,o=i.type,u=i.listener;if(Er(s,"on",o,u),!a){var l=function(){return e.off(s,o,u)};l.guid=u.guid;var c=function(){return e.off("dispose",l)};c.guid=u.guid,Er(this,"on","dispose",l),Er(s,"on","dispose",c)}},one:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=br(this,n,"one"),a=i.isTargetingSelf,s=i.target,o=i.type,u=i.listener;if(a)Er(s,"one",o,u);else{var l=function t(){e.off(s,o,t);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];u.apply(null,r)};l.guid=u.guid,Er(s,"one",o,l)}},any:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=br(this,n,"any"),a=i.isTargetingSelf,s=i.target,o=i.type,u=i.listener;if(a)Er(s,"any",o,u);else{var l=function t(){e.off(s,o,t);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];u.apply(null,r)};l.guid=u.guid,Er(s,"any",o,l)}},off:function(e,t,n){if(!e||yr(e))ar(this.eventBusEl_,e,t);else{var r=e,i=t;vr(r,this,"off"),_r(i,this,"off"),Tr(n,this,"off"),n=fr(this,n),this.off("dispose",n),r.nodeName?(ar(r,i,n),ar(r,"dispose",n)):mr(r)&&(r.off(i,n),r.off("dispose",n))}},trigger:function(e,t){vr(this.eventBusEl_,this,"trigger");var n=e&&"string"!=typeof e?e.type:e;if(!yr(n)){var r="Invalid event type for "+gr(this)+"#trigger; must be a non-empty string or object with a type key that has a non-empty value.";if(!e)throw new Error(r);(this.log||Dt).error(r)}return sr(this.eventBusEl_,e,t)}};function wr(e,t){void 0===t&&(t={});var n=t.eventBusKey;if(n){if(!e[n].nodeName)throw new Error('The eventBusKey "'+n+'" does not refer to an element.');e.eventBusEl_=e[n]}else e.eventBusEl_=gn("span",{className:"vjs-event-bus"});return Mt(e,Sr),e.eventedCallbacks&&e.eventedCallbacks.forEach((function(e){e()})),e.on("dispose",(function(){e.off(),[e,e.el_,e.eventBusEl_].forEach((function(e){e&&Qn.has(e)&&Qn.delete(e)})),i().setTimeout((function(){e.eventBusEl_=null}),0)})),e}var Ar={state:{},setState:function(e){var t,n=this;return"function"==typeof e&&(e=e()),Pt(e,(function(e,r){n.state[r]!==e&&((t=t||{})[r]={from:n.state[r],to:e}),n.state[r]=e})),t&&mr(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function Ir(e,t){return Mt(e,Ar),e.state=Mt({},e.state,t),"function"==typeof e.handleStateChanged&&mr(e)&&e.on("statechanged",e.handleStateChanged),e}var Cr=function(e){return"string"!=typeof e?e:e.replace(/./,(function(e){return e.toLowerCase()}))},Rr=function(e){return"string"!=typeof e?e:e.replace(/./,(function(e){return e.toUpperCase()}))};function Dr(){for(var e={},t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.forEach((function(t){t&&Pt(t,(function(t,n){Lt(t)?(Lt(e[n])||(e[n]={}),e[n]=Dr(e[n],t)):e[n]=t}))})),e}var xr=function(){function e(){this.map_={}}var t=e.prototype;return t.has=function(e){return e in this.map_},t.delete=function(e){var t=this.has(e);return delete this.map_[e],t},t.set=function(e,t){return this.map_[e]=t,this},t.forEach=function(e,t){for(var n in this.map_)e.call(t,this.map_[n],n,this)},e}(),Nr=i().Map?i().Map:xr,Or=function(){function e(){this.set_={}}var t=e.prototype;return t.has=function(e){return e in this.set_},t.delete=function(e){var t=this.has(e);return delete this.set_[e],t},t.add=function(e){return this.set_[e]=1,this},t.forEach=function(e,t){for(var n in this.set_)e.call(t,n,n,this)},e}(),Pr=i().Set?i().Set:Or,Mr=function(){function e(e,t,n){var r=this;if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Dr({},this.options_),t=this.options_=Dr(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){var i=e&&e.id&&e.id()||"no_player";this.id_=i+"_component_"+Xn()}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach((function(e){return r.addClass(e)})),!1!==t.evented&&(wr(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),Ir(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Pr,this.setIntervalIds_=new Pr,this.rafIds_=new Pr,this.namedRafs_=new Nr,this.clearingTimersOnDispose_=!1,!1!==t.initChildren&&this.initChildren(),this.ready(n),!1!==t.reportTouchActivity&&this.enableTouchActivity()}var t=e.prototype;return t.dispose=function(e){if(void 0===e&&(e={}),!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(var t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}},t.isDisposed=function(){return Boolean(this.isDisposed_)},t.player=function(){return this.player_},t.options=function(e){return e?(this.options_=Dr(this.options_,e),this.options_):this.options_},t.el=function(){return this.el_},t.createEl=function(e,t,n){return gn(e,t,n)},t.localize=function(e,t,n){void 0===n&&(n=e);var r=this.player_.language&&this.player_.language(),i=this.player_.languages&&this.player_.languages(),a=i&&i[r],s=r&&r.split("-")[0],o=i&&i[s],u=n;return a&&a[e]?u=a[e]:o&&o[e]&&(u=o[e]),t&&(u=u.replace(/\{(\d+)\}/g,(function(e,n){var r=t[n-1],i=r;return void 0===r&&(i=e),i}))),u},t.handleLanguagechange=function(){},t.contentEl=function(){return this.contentEl_||this.el_},t.id=function(){return this.id_},t.name=function(){return this.name_},t.children=function(){return this.children_},t.getChildById=function(e){return this.childIndex_[e]},t.getChild=function(e){if(e)return this.childNameIndex_[e]},t.getDescendant=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t=t.reduce((function(e,t){return e.concat(t)}),[]);for(var r=this,i=0;i<t.length;i++)if(!(r=r.getChild(t[i]))||!r.getChild)return;return r},t.addChild=function(t,n,r){var i,a;if(void 0===n&&(n={}),void 0===r&&(r=this.children_.length),"string"==typeof t){a=Rr(t);var s=n.componentClass||a;n.name=a;var o=e.getComponent(s);if(!o)throw new Error("Component "+s+" does not exist");if("function"!=typeof o)return null;i=new o(this.player_||this,n)}else i=t;if(i.parentComponent_&&i.parentComponent_.removeChild(i),this.children_.splice(r,0,i),i.parentComponent_=this,"function"==typeof i.id&&(this.childIndex_[i.id()]=i),(a=a||i.name&&Rr(i.name()))&&(this.childNameIndex_[a]=i,this.childNameIndex_[Cr(a)]=i),"function"==typeof i.el&&i.el()){var u=null;this.children_[r+1]&&(this.children_[r+1].el_?u=this.children_[r+1].el_:fn(this.children_[r+1])&&(u=this.children_[r+1])),this.contentEl().insertBefore(i.el(),u)}return i},t.removeChild=function(e){if("string"==typeof e&&(e=this.getChild(e)),e&&this.children_){for(var t=!1,n=this.children_.length-1;n>=0;n--)if(this.children_[n]===e){t=!0,this.children_.splice(n,1);break}if(t){e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[Rr(e.name())]=null,this.childNameIndex_[Cr(e.name())]=null;var r=e.el();r&&r.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},t.initChildren=function(){var t=this,n=this.options_.children;if(n){var r,i=this.options_,a=e.getComponent("Tech");(r=Array.isArray(n)?n:Object.keys(n)).concat(Object.keys(this.options_).filter((function(e){return!r.some((function(t){return"string"==typeof t?e===t:e===t.name}))}))).map((function(e){var r,i;return"string"==typeof e?i=n[r=e]||t.options_[r]||{}:(r=e.name,i=e),{name:r,opts:i}})).filter((function(t){var n=e.getComponent(t.opts.componentClass||Rr(t.name));return n&&!a.isTech(n)})).forEach((function(e){var n=e.name,r=e.opts;if(void 0!==i[n]&&(r=i[n]),!1!==r){!0===r&&(r={}),r.playerOptions=t.options_.playerOptions;var a=t.addChild(n,r);a&&(t[n]=a)}}))}},t.buildCSSClass=function(){return""},t.ready=function(e,t){if(void 0===t&&(t=!1),e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},t.triggerReady=function(){this.isReady_=!0,this.setTimeout((function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)},t.$=function(e,t){return Bn(e,t||this.contentEl())},t.$$=function(e,t){return jn(e,t||this.contentEl())},t.hasClass=function(e){return vn(this.el_,e)},t.addClass=function(e){_n(this.el_,e)},t.removeClass=function(e){Tn(this.el_,e)},t.toggleClass=function(e,t){bn(this.el_,e,t)},t.show=function(){this.removeClass("vjs-hidden")},t.hide=function(){this.addClass("vjs-hidden")},t.lockShowing=function(){this.addClass("vjs-lock-showing")},t.unlockShowing=function(){this.removeClass("vjs-lock-showing")},t.getAttribute=function(e){return wn(this.el_,e)},t.setAttribute=function(e,t){An(this.el_,e,t)},t.removeAttribute=function(e){In(this.el_,e)},t.width=function(e,t){return this.dimension("width",e,t)},t.height=function(e,t){return this.dimension("height",e,t)},t.dimensions=function(e,t){this.width(e,!0),this.height(t)},t.dimension=function(e,t,n){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(n||this.trigger("componentresize"));if(!this.el_)return 0;var r=this.el_.style[e],i=r.indexOf("px");return-1!==i?parseInt(r.slice(0,i),10):parseInt(this.el_["offset"+Rr(e)],10)},t.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=Ft(this.el_,e),0===(t=parseFloat(t))||isNaN(t)){var n="offset"+Rr(e);t=this.el_[n]}return t},t.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},t.currentWidth=function(){return this.currentDimension("width")},t.currentHeight=function(){return this.currentDimension("height")},t.focus=function(){this.el_.focus()},t.blur=function(){this.el_.blur()},t.handleKeyDown=function(e){this.player_&&(d().isEventKey(e,"Tab")||e.stopPropagation(),this.player_.handleKeyDown(e))},t.handleKeyPress=function(e){this.handleKeyDown(e)},t.emitTapEvents=function(){var e,t=0,n=null;this.on("touchstart",(function(r){1===r.touches.length&&(n={pageX:r.touches[0].pageX,pageY:r.touches[0].pageY},t=i().performance.now(),e=!0)})),this.on("touchmove",(function(t){if(t.touches.length>1)e=!1;else if(n){var r=t.touches[0].pageX-n.pageX,i=t.touches[0].pageY-n.pageY;Math.sqrt(r*r+i*i)>10&&(e=!1)}}));var r=function(){e=!1};this.on("touchleave",r),this.on("touchcancel",r),this.on("touchend",(function(r){n=null,!0===e&&i().performance.now()-t<200&&(r.preventDefault(),this.trigger("tap"))}))},t.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,t=fr(this.player(),this.player().reportUserActivity);this.on("touchstart",(function(){t(),this.clearInterval(e),e=this.setInterval(t,250)}));var n=function(n){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",n),this.on("touchcancel",n)}},t.setTimeout=function(e,t){var n,r=this;return e=fr(this,e),this.clearTimersOnDispose_(),n=i().setTimeout((function(){r.setTimeoutIds_.has(n)&&r.setTimeoutIds_.delete(n),e()}),t),this.setTimeoutIds_.add(n),n},t.clearTimeout=function(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),i().clearTimeout(e)),e},t.setInterval=function(e,t){e=fr(this,e),this.clearTimersOnDispose_();var n=i().setInterval(e,t);return this.setIntervalIds_.add(n),n},t.clearInterval=function(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),i().clearInterval(e)),e},t.requestAnimationFrame=function(e){var t,n=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),e=fr(this,e),t=i().requestAnimationFrame((function(){n.rafIds_.has(t)&&n.rafIds_.delete(t),e()})),this.rafIds_.add(t),t):this.setTimeout(e,1e3/60)},t.requestNamedAnimationFrame=function(e,t){var n=this;if(!this.namedRafs_.has(e)){this.clearTimersOnDispose_(),t=fr(this,t);var r=this.requestAnimationFrame((function(){t(),n.namedRafs_.has(e)&&n.namedRafs_.delete(e)}));return this.namedRafs_.set(e,r),e}},t.cancelNamedAnimationFrame=function(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))},t.cancelAnimationFrame=function(e){return this.supportsRaf_?(this.rafIds_.has(e)&&(this.rafIds_.delete(e),i().cancelAnimationFrame(e)),e):this.clearTimeout(e)},t.clearTimersOnDispose_=function(){var e=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",(function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach((function(t){var n=t[0],r=t[1];e[n].forEach((function(t,n){return e[r](n)}))})),e.clearingTimersOnDispose_=!1})))},e.registerComponent=function(t,n){if("string"!=typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var r=e.getComponent("Tech"),i=r&&r.isTech(n),a=e===n||e.prototype.isPrototypeOf(n.prototype);if(i||!a)throw new Error('Illegal component, "'+t+'"; '+(i?"techs must be registered using Tech.registerTech()":"must be a Component subclass")+".");t=Rr(t),e.components_||(e.components_={});var s=e.getComponent("Player");if("Player"===t&&s&&s.players){var o=s.players,u=Object.keys(o);if(o&&u.length>0&&u.map((function(e){return o[e]})).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=n,e.components_[Cr(t)]=n,n},e.getComponent=function(t){if(t&&e.components_)return e.components_[t]},e}();function kr(e,t,n,r){return function(e,t,n){if("number"!=typeof t||t<0||t>n)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+n+").")}(e,r,n.length-1),n[r][t]}function Lr(e){var t;return t=void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:kr.bind(null,"start",0,e),end:kr.bind(null,"end",1,e)},i().Symbol&&i().Symbol.iterator&&(t[i().Symbol.iterator]=function(){return(e||[]).values()}),t}function Fr(e,t){return Array.isArray(e)?Lr(e):void 0===e||void 0===t?Lr():Lr([[e,t]])}function Ur(e,t){var n,r,i=0;if(!t)return 0;e&&e.length||(e=Fr(0,0));for(var a=0;a<e.length;a++)n=e.start(a),(r=e.end(a))>t&&(r=t),i+=r-n;return i/t}function Br(e){if(e instanceof Br)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:kt(e)&&("number"==typeof e.code&&(this.code=e.code),Mt(this,e)),this.message||(this.message=Br.defaultMessages[this.code]||"")}Mr.prototype.supportsRaf_="function"==typeof i().requestAnimationFrame&&"function"==typeof i().cancelAnimationFrame,Mr.registerComponent("Component",Mr),Br.prototype.code=0,Br.prototype.message="",Br.prototype.status=null,Br.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Br.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var jr=0;jr<Br.errorTypes.length;jr++)Br[Br.errorTypes[jr]]=jr,Br.prototype[Br.errorTypes[jr]]=jr;function qr(e){return null!=e&&"function"==typeof e.then}function Hr(e){qr(e)&&e.then(null,(function(e){}))}var Gr=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((function(t,n,r){return e[n]&&(t[n]=e[n]),t}),{cues:e.cues&&Array.prototype.map.call(e.cues,(function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}}))})},Vr="vjs-modal-dialog",Yr=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).handleKeyDown_=function(e){return r.handleKeyDown(e)},r.close_=function(e){return r.close(e)},r.opened_=r.hasBeenOpened_=r.hasBeenFilled_=!1,r.closeable(!r.options_.uncloseable),r.content(r.options_.content),r.contentEl_=gn("div",{className:Vr+"-content"},{role:"document"}),r.descEl_=gn("p",{className:Vr+"-description vjs-control-text",id:r.el().getAttribute("aria-describedby")}),mn(r.descEl_,r.description()),r.el_.appendChild(r.descEl_),r.el_.appendChild(r.contentEl_),r}p(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},n.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,e.prototype.dispose.call(this)},n.buildCSSClass=function(){return Vr+" vjs-hidden "+e.prototype.buildCSSClass.call(this)},n.label=function(){return this.localize(this.options_.label||"Modal Window")},n.description=function(){var e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e},n.open=function(){if(!this.opened_){var e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},n.opened=function(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_},n.close=function(){if(this.opened_){var e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},n.closeable=function(e){if("boolean"==typeof e){var t=this.closeable_=!!e,n=this.getChild("closeButton");if(t&&!n){var r=this.contentEl_;this.contentEl_=this.el_,n=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=r,this.on(n,"close",this.close_)}!t&&n&&(this.off(n,"close",this.close_),this.removeChild(n),n.dispose())}return this.closeable_},n.fill=function(){this.fillWith(this.content())},n.fillWith=function(e){var t=this.contentEl(),n=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,n.removeChild(t),this.empty(),Ln(t,e),this.trigger("modalfill"),r?n.insertBefore(t,r):n.appendChild(t);var i=this.getChild("closeButton");i&&n.appendChild(i.el_)},n.empty=function(){this.trigger("beforemodalempty"),Pn(this.contentEl()),this.trigger("modalempty")},n.content=function(e){return void 0!==e&&(this.content_=e),this.content_},n.conditionalFocus_=function(){var e=u().activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())},n.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)},n.handleKeyDown=function(e){if(e.stopPropagation(),d().isEventKey(e,"Escape")&&this.closeable())return e.preventDefault(),void this.close();if(d().isEventKey(e,"Tab")){for(var t,n=this.focusableEls_(),r=this.el_.querySelector(":focus"),i=0;i<n.length;i++)if(r===n[i]){t=i;break}u().activeElement===this.el_&&(t=0),e.shiftKey&&0===t?(n[n.length-1].focus(),e.preventDefault()):e.shiftKey||t!==n.length-1||(n[0].focus(),e.preventDefault())}},n.focusableEls_=function(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,(function(e){return(e instanceof i().HTMLAnchorElement||e instanceof i().HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof i().HTMLInputElement||e instanceof i().HTMLSelectElement||e instanceof i().HTMLTextAreaElement||e instanceof i().HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof i().HTMLIFrameElement||e instanceof i().HTMLObjectElement||e instanceof i().HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")}))},t}(Mr);Yr.prototype.options_={pauseOnOpen:!0,temporary:!0},Mr.registerComponent("ModalDialog",Yr);var zr=function(e){function t(t){var n;void 0===t&&(t=[]),(n=e.call(this)||this).tracks_=[],Object.defineProperty(f(n),"length",{get:function(){return this.tracks_.length}});for(var r=0;r<t.length;r++)n.addTrack(t[r]);return n}p(t,e);var n=t.prototype;return n.addTrack=function(e){var t=this,n=this.tracks_.length;""+n in this||Object.defineProperty(this,n,{get:function(){return this.tracks_[n]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=function(){t.trigger({track:e,type:"labelchange",target:t})},mr(e)&&e.addEventListener("labelchange",e.labelchange_)},n.removeTrack=function(e){for(var t,n=0,r=this.length;n<r;n++)if(this[n]===e){(t=this[n]).off&&t.off(),this.tracks_.splice(n,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})},n.getTrackById=function(e){for(var t=null,n=0,r=this.length;n<r;n++){var i=this[n];if(i.id===e){t=i;break}}return t},t}(pr);for(var Zr in zr.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"},zr.prototype.allowedEvents_)zr.prototype["on"+Zr]=null;var Kr=function(e,t){for(var n=0;n<e.length;n++)Object.keys(e[n]).length&&t.id!==e[n].id&&(e[n].enabled=!1)},Wr=function(e){function t(t){var n;void 0===t&&(t=[]);for(var r=t.length-1;r>=0;r--)if(t[r].enabled){Kr(t,t[r]);break}return(n=e.call(this,t)||this).changing_=!1,n}p(t,e);var n=t.prototype;return n.addTrack=function(t){var n=this;t.enabled&&Kr(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.enabledChange_=function(){n.changing_||(n.changing_=!0,Kr(n,t),n.changing_=!1,n.trigger("change"))},t.addEventListener("enabledchange",t.enabledChange_))},n.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.enabledChange_&&(t.removeEventListener("enabledchange",t.enabledChange_),t.enabledChange_=null)},t}(zr),Xr=function(e,t){for(var n=0;n<e.length;n++)Object.keys(e[n]).length&&t.id!==e[n].id&&(e[n].selected=!1)},$r=function(e){function t(t){var n;void 0===t&&(t=[]);for(var r=t.length-1;r>=0;r--)if(t[r].selected){Xr(t,t[r]);break}return(n=e.call(this,t)||this).changing_=!1,Object.defineProperty(f(n),"selectedIndex",{get:function(){for(var e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set:function(){}}),n}p(t,e);var n=t.prototype;return n.addTrack=function(t){var n=this;t.selected&&Xr(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.selectedChange_=function(){n.changing_||(n.changing_=!0,Xr(n,t),n.changing_=!1,n.trigger("change"))},t.addEventListener("selectedchange",t.selectedChange_))},n.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.selectedChange_&&(t.removeEventListener("selectedchange",t.selectedChange_),t.selectedChange_=null)},t}(zr),Qr=function(e){function t(){return e.apply(this,arguments)||this}p(t,e);var n=t.prototype;return n.addTrack=function(t){var n=this;e.prototype.addTrack.call(this,t),this.queueChange_||(this.queueChange_=function(){return n.queueTrigger("change")}),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=function(){return n.trigger("selectedlanguagechange")}),t.addEventListener("modechange",this.queueChange_),-1===["metadata","chapters"].indexOf(t.kind)&&t.addEventListener("modechange",this.triggerSelectedlanguagechange_)},n.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&(this.queueChange_&&t.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&t.removeEventListener("modechange",this.triggerSelectedlanguagechange_))},t}(zr),Jr=function(){function e(e){void 0===e&&(e=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var t=0,n=e.length;t<n;t++)this.addTrackElement_(e[t])}var t=e.prototype;return t.addTrackElement_=function(e){var t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)},t.getTrackElementByTrack_=function(e){for(var t,n=0,r=this.trackElements_.length;n<r;n++)if(e===this.trackElements_[n].track){t=this.trackElements_[n];break}return t},t.removeTrackElement_=function(e){for(var t=0,n=this.trackElements_.length;t<n;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&"function"==typeof this.trackElements_[t].track.off&&this.trackElements_[t].track.off(),"function"==typeof this.trackElements_[t].off&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}},e}(),ei=function(){function e(t){e.prototype.setCues_.call(this,t),Object.defineProperty(this,"length",{get:function(){return this.length_}})}var t=e.prototype;return t.setCues_=function(e){var t=this.length||0,n=0,r=e.length;this.cues_=e,this.length_=e.length;var i=function(e){""+e in this||Object.defineProperty(this,""+e,{get:function(){return this.cues_[e]}})};if(t<r)for(n=t;n<r;n++)i.call(this,n)},t.getCueById=function(e){for(var t=null,n=0,r=this.length;n<r;n++){var i=this[n];if(i.id===e){t=i;break}}return t},e}(),ti={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},ni={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},ri={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},ii={disabled:"disabled",hidden:"hidden",showing:"showing"},ai=function(e){function t(t){var n;void 0===t&&(t={}),n=e.call(this)||this;var r={id:t.id||"vjs_track_"+Xn(),kind:t.kind||"",language:t.language||""},i=t.label||"",a=function(e){Object.defineProperty(f(n),e,{get:function(){return r[e]},set:function(){}})};for(var s in r)a(s);return Object.defineProperty(f(n),"label",{get:function(){return i},set:function(e){e!==i&&(i=e,this.trigger("labelchange"))}}),n}return p(t,e),t}(pr),si=function(e){var t=["protocol","hostname","port","pathname","search","hash","host"],n=u().createElement("a");n.href=e;for(var r={},a=0;a<t.length;a++)r[t[a]]=n[t[a]];return"http:"===r.protocol&&(r.host=r.host.replace(/:80$/,"")),"https:"===r.protocol&&(r.host=r.host.replace(/:443$/,"")),r.protocol||(r.protocol=i().location.protocol),r.host||(r.host=i().location.host),r},oi=function(e){if(!e.match(/^https?:\/\//)){var t=u().createElement("a");t.href=e,e=t.href}return e},ui=function(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(t)return t.pop().toLowerCase()}return""},li=function(e,t){void 0===t&&(t=i().location);var n=si(e);return(":"===n.protocol?t.protocol:n.protocol)+n.host!==t.protocol+t.host},ci=Object.freeze({__proto__:null,parseUrl:si,getAbsoluteURL:oi,getFileExtension:ui,isCrossOrigin:li}),di=function(e,t){var n=new(i().WebVTT.Parser)(i(),i().vttjs,i().WebVTT.StringDecoder()),r=[];n.oncue=function(e){t.addCue(e)},n.onparsingerror=function(e){r.push(e)},n.onflush=function(){t.trigger({type:"loadeddata",target:t})},n.parse(e),r.length>0&&(i().console&&i().console.groupCollapsed&&i().console.groupCollapsed("Text Track parsing errors for "+t.src),r.forEach((function(e){return Dt.error(e)})),i().console&&i().console.groupEnd&&i().console.groupEnd()),n.flush()},fi=function(e,t){var n={uri:e},r=li(e);r&&(n.cors=r);var a="use-credentials"===t.tech_.crossOrigin();a&&(n.withCredentials=a),v()(n,fr(this,(function(e,n,r){if(e)return Dt.error(e,n);t.loaded_=!0,"function"!=typeof i().WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],(function(e){if("vttjserror"!==e.type)return di(r,t);Dt.error("vttjs failed to load, stopping trying to process "+t.src)})):di(r,t)})))},hi=function(e){function t(t){var n;if(void 0===t&&(t={}),!t.tech)throw new Error("A tech was not provided.");var r=Dr(t,{kind:ri[t.kind]||"subtitles",language:t.language||t.srclang||""}),i=ii[r.mode]||"disabled",a=r.default;"metadata"!==r.kind&&"chapters"!==r.kind||(i="hidden"),(n=e.call(this,r)||this).tech_=r.tech,n.cues_=[],n.activeCues_=[],n.preload_=!1!==n.tech_.preloadTextTracks;var s=new ei(n.cues_),o=new ei(n.activeCues_),u=!1;return n.timeupdateHandler=fr(f(n),(function(e){void 0===e&&(e={}),this.tech_.isDisposed()||(this.tech_.isReady_?(this.activeCues=this.activeCues,u&&(this.trigger("cuechange"),u=!1),"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))):"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))})),n.tech_.one("dispose",(function(){n.stopTracking()})),"disabled"!==i&&n.startTracking(),Object.defineProperties(f(n),{default:{get:function(){return a},set:function(){}},mode:{get:function(){return i},set:function(e){ii[e]&&i!==e&&(i=e,this.preload_||"disabled"===i||0!==this.cues.length||fi(this.src,this),this.stopTracking(),"disabled"!==i&&this.startTracking(),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?s:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return o;for(var e=this.tech_.currentTime(),t=[],n=0,r=this.cues.length;n<r;n++){var i=this.cues[n];(i.startTime<=e&&i.endTime>=e||i.startTime===i.endTime&&i.startTime<=e&&i.startTime+.5>=e)&&t.push(i)}if(u=!1,t.length!==this.activeCues_.length)u=!0;else for(var a=0;a<t.length;a++)-1===this.activeCues_.indexOf(t[a])&&(u=!0);return this.activeCues_=t,o.setCues_(this.activeCues_),o},set:function(){}}}),r.src?(n.src=r.src,n.preload_||(n.loaded_=!0),(n.preload_||"subtitles"!==r.kind&&"captions"!==r.kind)&&fi(n.src,f(n))):n.loaded_=!0,n}p(t,e);var n=t.prototype;return n.startTracking=function(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)},n.stopTracking=function(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)},n.addCue=function(e){var t=e;if(t.constructor&&"VTTCue"!==t.constructor.name){for(var n in t=new(i().vttjs.VTTCue)(e.startTime,e.endTime,e.text),e)n in t||(t[n]=e[n]);t.id=e.id,t.originalCue_=e}for(var r=this.tech_.textTracks(),a=0;a<r.length;a++)r[a]!==this&&r[a].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)},n.removeCue=function(e){for(var t=this.cues_.length;t--;){var n=this.cues_[t];if(n===e||n.originalCue_&&n.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}},t}(ai);hi.prototype.allowedEvents_={cuechange:"cuechange"};var pi=function(e){function t(t){var n;void 0===t&&(t={});var r=Dr(t,{kind:ni[t.kind]||""});n=e.call(this,r)||this;var i=!1;return Object.defineProperty(f(n),"enabled",{get:function(){return i},set:function(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("enabledchange"))}}),r.enabled&&(n.enabled=r.enabled),n.loaded_=!0,n}return p(t,e),t}(ai),gi=function(e){function t(t){var n;void 0===t&&(t={});var r=Dr(t,{kind:ti[t.kind]||""});n=e.call(this,r)||this;var i=!1;return Object.defineProperty(f(n),"selected",{get:function(){return i},set:function(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("selectedchange"))}}),r.selected&&(n.selected=r.selected),n}return p(t,e),t}(ai),mi=function(e){function t(t){var n,r;void 0===t&&(t={}),n=e.call(this)||this;var i=new hi(t);return n.kind=i.kind,n.src=i.src,n.srclang=i.language,n.label=i.label,n.default=i.default,Object.defineProperties(f(n),{readyState:{get:function(){return r}},track:{get:function(){return i}}}),r=0,i.addEventListener("loadeddata",(function(){r=2,n.trigger({type:"load",target:f(n)})})),n}return p(t,e),t}(pr);mi.prototype.allowedEvents_={load:"load"},mi.NONE=0,mi.LOADING=1,mi.LOADED=2,mi.ERROR=3;var yi={audio:{ListClass:Wr,TrackClass:pi,capitalName:"Audio"},video:{ListClass:$r,TrackClass:gi,capitalName:"Video"},text:{ListClass:Qr,TrackClass:hi,capitalName:"Text"}};Object.keys(yi).forEach((function(e){yi[e].getterName=e+"Tracks",yi[e].privateName=e+"Tracks_"}));var vi={remoteText:{ListClass:Qr,TrackClass:hi,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Jr,TrackClass:mi,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},_i=(0,l.Z)({},yi,vi);vi.names=Object.keys(vi),yi.names=Object.keys(yi),_i.names=[].concat(vi.names).concat(yi.names);var Ti=function(e){function t(t,n){var r;return void 0===t&&(t={}),void 0===n&&(n=function(){}),t.reportTouchActivity=!1,(r=e.call(this,null,t,n)||this).onDurationChange_=function(e){return r.onDurationChange(e)},r.trackProgress_=function(e){return r.trackProgress(e)},r.trackCurrentTime_=function(e){return r.trackCurrentTime(e)},r.stopTrackingCurrentTime_=function(e){return r.stopTrackingCurrentTime(e)},r.disposeSourceHandler_=function(e){return r.disposeSourceHandler(e)},r.queuedHanders_=new Set,r.hasStarted_=!1,r.on("playing",(function(){this.hasStarted_=!0})),r.on("loadstart",(function(){this.hasStarted_=!1})),_i.names.forEach((function(e){var n=_i[e];t&&t[n.getterName]&&(r[n.privateName]=t[n.getterName])})),r.featuresProgressEvents||r.manualProgressOn(),r.featuresTimeupdateEvents||r.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach((function(e){!1===t["native"+e+"Tracks"]&&(r["featuresNative"+e+"Tracks"]=!1)})),!1===t.nativeCaptions||!1===t.nativeTextTracks?r.featuresNativeTextTracks=!1:!0!==t.nativeCaptions&&!0!==t.nativeTextTracks||(r.featuresNativeTextTracks=!0),r.featuresNativeTextTracks||r.emulateTextTracks(),r.preloadTextTracks=!1!==t.preloadTextTracks,r.autoRemoteTextTracks_=new _i.text.ListClass,r.initTrackListeners(),t.nativeControlsForTouch||r.emitTapEvents(),r.constructor&&(r.name_=r.constructor.name||"Unknown Tech"),r}p(t,e);var n=t.prototype;return n.triggerSourceset=function(e){var t=this;this.isReady_||this.one("ready",(function(){return t.setTimeout((function(){return t.triggerSourceset(e)}),1)})),this.trigger({src:e,type:"sourceset"})},n.manualProgressOn=function(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)},n.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)},n.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(fr(this,(function(){var e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()})),500)},n.onDurationChange=function(e){this.duration_=this.duration()},n.buffered=function(){return Fr(0,0)},n.bufferedPercent=function(){return Ur(this.buffered(),this.duration_)},n.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},n.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)},n.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)},n.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval((function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}),250)},n.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},n.dispose=function(){this.clearTracks(yi.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),e.prototype.dispose.call(this)},n.clearTracks=function(e){var t=this;(e=[].concat(e)).forEach((function(e){for(var n=t[e+"Tracks"]()||[],r=n.length;r--;){var i=n[r];"text"===e&&t.removeRemoteTextTrack(i),n.removeTrack(i)}}))},n.cleanupAutoTextTracks=function(){for(var e=this.autoRemoteTextTracks_||[],t=e.length;t--;){var n=e[t];this.removeRemoteTextTrack(n)}},n.reset=function(){},n.crossOrigin=function(){},n.setCrossOrigin=function(){},n.error=function(e){return void 0!==e&&(this.error_=new Br(e),this.trigger("error")),this.error_},n.played=function(){return this.hasStarted_?Fr(0,0):Fr()},n.play=function(){},n.setScrubbing=function(){},n.scrubbing=function(){},n.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},n.initTrackListeners=function(){var e=this;yi.names.forEach((function(t){var n=yi[t],r=function(){e.trigger(t+"trackchange")},i=e[n.getterName]();i.addEventListener("removetrack",r),i.addEventListener("addtrack",r),e.on("dispose",(function(){i.removeEventListener("removetrack",r),i.removeEventListener("addtrack",r)}))}))},n.addWebVttScript_=function(){var e=this;if(!i().WebVTT)if(u().body.contains(this.el())){if(!this.options_["vtt.js"]&&Lt(T())&&Object.keys(T()).length>0)return void this.trigger("vttjsloaded");var t=u().createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",t.onload=function(){e.trigger("vttjsloaded")},t.onerror=function(){e.trigger("vttjserror")},this.on("dispose",(function(){t.onload=null,t.onerror=null})),i().WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)},n.emulateTextTracks=function(){var e=this,t=this.textTracks(),n=this.remoteTextTracks(),r=function(e){return t.addTrack(e.track)},i=function(e){return t.removeTrack(e.track)};n.on("addtrack",r),n.on("removetrack",i),this.addWebVttScript_();var a=function(){return e.trigger("texttrackchange")},s=function(){a();for(var e=0;e<t.length;e++){var n=t[e];n.removeEventListener("cuechange",a),"showing"===n.mode&&n.addEventListener("cuechange",a)}};s(),t.addEventListener("change",s),t.addEventListener("addtrack",s),t.addEventListener("removetrack",s),this.on("dispose",(function(){n.off("addtrack",r),n.off("removetrack",i),t.removeEventListener("change",s),t.removeEventListener("addtrack",s),t.removeEventListener("removetrack",s);for(var e=0;e<t.length;e++)t[e].removeEventListener("cuechange",a)}))},n.addTextTrack=function(e,t,n){if(!e)throw new Error("TextTrack kind is required but was not provided");return function(e,t,n,r,i){void 0===i&&(i={});var a=e.textTracks();i.kind=t,n&&(i.label=n),r&&(i.language=r),i.tech=e;var s=new _i.text.TrackClass(i);return a.addTrack(s),s}(this,e,t,n)},n.createRemoteTextTrack=function(e){var t=Dr(e,{tech:this});return new vi.remoteTextEl.TrackClass(t)},n.addRemoteTextTrack=function(e,t){var n=this;void 0===e&&(e={});var r=this.createRemoteTextTrack(e);return!0!==t&&!1!==t&&(Dt.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),t=!0),this.remoteTextTrackEls().addTrackElement_(r),this.remoteTextTracks().addTrack(r.track),!0!==t&&this.ready((function(){return n.autoRemoteTextTracks_.addTrack(r.track)})),r},n.removeRemoteTextTrack=function(e){var t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)},n.getVideoPlaybackQuality=function(){return{}},n.requestPictureInPicture=function(){var e=this.options_.Promise||i().Promise;if(e)return e.reject()},n.disablePictureInPicture=function(){return!0},n.setDisablePictureInPicture=function(){},n.requestVideoFrameCallback=function(e){var t=this,n=Xn();return!this.isReady_||this.paused()?(this.queuedHanders_.add(n),this.one("playing",(function(){t.queuedHanders_.has(n)&&(t.queuedHanders_.delete(n),e())}))):this.requestNamedAnimationFrame(n,e),n},n.cancelVideoFrameCallback=function(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)},n.setPoster=function(){},n.playsinline=function(){},n.setPlaysinline=function(){},n.overrideNativeAudioTracks=function(){},n.overrideNativeVideoTracks=function(){},n.canPlayType=function(){return""},t.canPlayType=function(){return""},t.canPlaySource=function(e,n){return t.canPlayType(e.type)},t.isTech=function(e){return e.prototype instanceof t||e instanceof t||e===t},t.registerTech=function(e,n){if(t.techs_||(t.techs_={}),!t.isTech(n))throw new Error("Tech "+e+" must be a Tech");if(!t.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!t.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=Rr(e),t.techs_[e]=n,t.techs_[Cr(e)]=n,"Tech"!==e&&t.defaultTechOrder_.push(e),n},t.getTech=function(e){if(e)return t.techs_&&t.techs_[e]?t.techs_[e]:(e=Rr(e),i()&&i().videojs&&i().videojs[e]?(Dt.warn("The "+e+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),i().videojs[e]):void 0)},t}(Mr);_i.names.forEach((function(e){var t=_i[e];Ti.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}})),Ti.prototype.featuresVolumeControl=!0,Ti.prototype.featuresMuteControl=!0,Ti.prototype.featuresFullscreenResize=!1,Ti.prototype.featuresPlaybackRate=!1,Ti.prototype.featuresProgressEvents=!1,Ti.prototype.featuresSourceset=!1,Ti.prototype.featuresTimeupdateEvents=!1,Ti.prototype.featuresNativeTextTracks=!1,Ti.prototype.featuresVideoFrameCallback=!1,Ti.withSourceHandlers=function(e){e.registerSourceHandler=function(t,n){var r=e.sourceHandlers;r||(r=e.sourceHandlers=[]),void 0===n&&(n=r.length),r.splice(n,0,t)},e.canPlayType=function(t){for(var n,r=e.sourceHandlers||[],i=0;i<r.length;i++)if(n=r[i].canPlayType(t))return n;return""},e.selectSourceHandler=function(t,n){for(var r=e.sourceHandlers||[],i=0;i<r.length;i++)if(r[i].canHandleSource(t,n))return r[i];return null},e.canPlaySource=function(t,n){var r=e.selectSourceHandler(t,n);return r?r.canHandleSource(t,n):""},["seekable","seeking","duration"].forEach((function(e){var t=this[e];"function"==typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})}),e.prototype),e.prototype.setSource=function(t){var n=e.selectSourceHandler(t,this.options_);n||(e.nativeSourceHandler?n=e.nativeSourceHandler:Dt.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),n!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=n.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},e.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},Mr.registerComponent("Tech",Ti),Ti.registerTech("Tech",Ti),Ti.defaultTechOrder_=[];var bi={},Ei={},Si={};function wi(e,t,n){e.setTimeout((function(){return xi(t,bi[t.type],n,e)}),1)}function Ai(e,t,n,r){void 0===r&&(r=null);var i="call"+Rr(n),a=e.reduce(Di(i),r),s=a===Si,o=s?null:t[n](a);return function(e,t,n,r){for(var i=e.length-1;i>=0;i--){var a=e[i];a[t]&&a[t](r,n)}}(e,n,o,s),o}var Ii={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},Ci={setCurrentTime:1,setMuted:1,setVolume:1},Ri={play:1,pause:1};function Di(e){return function(t,n){return t===Si?Si:n[e]?n[e](t):t}}function xi(e,t,n,r,i,a){void 0===e&&(e={}),void 0===t&&(t=[]),void 0===i&&(i=[]),void 0===a&&(a=!1);var s=t,o=s[0],u=s.slice(1);if("string"==typeof o)xi(e,bi[o],n,r,i,a);else if(o){var l=function(e,t){var n=Ei[e.id()],r=null;if(null==n)return r=t(e),Ei[e.id()]=[[t,r]],r;for(var i=0;i<n.length;i++){var a=n[i],s=a[0],o=a[1];s===t&&(r=o)}return null===r&&(r=t(e),n.push([t,r])),r}(r,o);if(!l.setSource)return i.push(l),xi(e,u,n,r,i,a);l.setSource(Mt({},e),(function(t,s){if(t)return xi(e,u,n,r,i,a);i.push(l),xi(s,e.type===s.type?u:bi[s.type],n,r,i,a)}))}else u.length?xi(e,u,n,r,i,a):a?n(e,i):xi(e,bi["*"],n,r,i,!0)}var Ni={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},Oi=function(e){void 0===e&&(e="");var t=ui(e);return Ni[t.toLowerCase()]||""},Pi=function e(t){if(Array.isArray(t)){var n=[];t.forEach((function(t){t=e(t),Array.isArray(t)?n=n.concat(t):kt(t)&&n.push(t)})),t=n}else t="string"==typeof t&&t.trim()?[Mi({src:t})]:kt(t)&&"string"==typeof t.src&&t.src&&t.src.trim()?[Mi(t)]:[];return t};function Mi(e){if(!e.type){var t=Oi(e.src);t&&(e.type=t)}return e}var ki=function(e){function t(t,n,r){var i,a=Dr({createEl:!1},n);if(i=e.call(this,t,a,r)||this,n.playerOptions.sources&&0!==n.playerOptions.sources.length)t.src(n.playerOptions.sources);else for(var s=0,o=n.playerOptions.techOrder;s<o.length;s++){var u=Rr(o[s]),l=Ti.getTech(u);if(u||(l=Mr.getComponent(u)),l&&l.isSupported()){t.loadTech_(u);break}}return i}return p(t,e),t}(Mr);Mr.registerComponent("MediaLoader",ki);var Li=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).options_.controlText&&r.controlText(r.options_.controlText),r.handleMouseOver_=function(e){return r.handleMouseOver(e)},r.handleMouseOut_=function(e){return r.handleMouseOut(e)},r.handleClick_=function(e){return r.handleClick(e)},r.handleKeyDown_=function(e){return r.handleKeyDown(e)},r.emitTapEvents(),r.enable(),r}p(t,e);var n=t.prototype;return n.createEl=function(e,t,n){void 0===e&&(e="div"),void 0===t&&(t={}),void 0===n&&(n={}),t=Mt({className:this.buildCSSClass(),tabIndex:0},t),"button"===e&&Dt.error("Creating a ClickableComponent with an HTML element of "+e+" is not supported; use a Button instead."),n=Mt({role:"button"},n),this.tabIndex_=t.tabIndex;var r=gn(e,t,n);return r.appendChild(gn("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r},n.dispose=function(){this.controlTextEl_=null,e.prototype.dispose.call(this)},n.createControlTextEl=function(e){return this.controlTextEl_=gn("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},n.controlText=function(e,t){if(void 0===t&&(t=this.el()),void 0===e)return this.controlText_||"Need Text";var n=this.localize(e);this.controlText_=e,mn(this.controlTextEl_,n),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",n)},n.buildCSSClass=function(){return"vjs-control vjs-button "+e.prototype.buildCSSClass.call(this)},n.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))},n.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)},n.handleLanguagechange=function(){this.controlText(this.controlText_)},n.handleClick=function(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)},n.handleKeyDown=function(t){d().isEventKey(t,"Space")||d().isEventKey(t,"Enter")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},t}(Mr);Mr.registerComponent("ClickableComponent",Li);var Fi=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).update(),r.update_=function(e){return r.update(e)},t.on("posterchange",r.update_),r}p(t,e);var n=t.prototype;return n.dispose=function(){this.player().off("posterchange",this.update_),e.prototype.dispose.call(this)},n.createEl=function(){return gn("div",{className:"vjs-poster",tabIndex:-1})},n.update=function(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide()},n.setSrc=function(e){var t="";e&&(t='url("'+e+'")'),this.el_.style.backgroundImage=t},n.handleClick=function(e){if(this.player_.controls()){var t=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;!this.player_.tech(!0)||(Jt||Xt)&&t||this.player_.tech(!0).focus(),this.player_.paused()?Hr(this.player_.play()):this.player_.pause()}},t}(Li);Mr.registerComponent("PosterImage",Fi);var Ui="#222",Bi={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function ji(e,t){var n;if(4===e.length)n=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");n=e.slice(1)}return"rgba("+parseInt(n.slice(0,2),16)+","+parseInt(n.slice(2,4),16)+","+parseInt(n.slice(4,6),16)+","+t+")"}function qi(e,t,n){try{e.style[t]=n}catch(e){return}}var Hi=function(e){function t(t,n,r){var a;a=e.call(this,t,n,r)||this;var s=function(e){return a.updateDisplay(e)};return t.on("loadstart",(function(e){return a.toggleDisplay(e)})),t.on("texttrackchange",s),t.on("loadedmetadata",(function(e){return a.preselectTrack(e)})),t.ready(fr(f(a),(function(){if(t.tech_&&t.tech_.featuresNativeTextTracks)this.hide();else{t.on("fullscreenchange",s),t.on("playerresize",s),i().addEventListener("orientationchange",s),t.on("dispose",(function(){return i().removeEventListener("orientationchange",s)}));for(var e=this.options_.playerOptions.tracks||[],n=0;n<e.length;n++)this.player_.addRemoteTextTrack(e[n],!0);this.preselectTrack()}}))),a}p(t,e);var n=t.prototype;return n.preselectTrack=function(){for(var e,t,n,r={captions:1,subtitles:1},i=this.player_.textTracks(),a=this.player_.cache_.selectedLanguage,s=0;s<i.length;s++){var o=i[s];a&&a.enabled&&a.language&&a.language===o.language&&o.kind in r?o.kind===a.kind?n=o:n||(n=o):a&&!a.enabled?(n=null,e=null,t=null):o.default&&("descriptions"!==o.kind||e?o.kind in r&&!t&&(t=o):e=o)}n?n.mode="showing":t?t.mode="showing":e&&(e.mode="showing")},n.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})},n.clearDisplay=function(){"function"==typeof i().WebVTT&&i().WebVTT.processCues(i(),[],this.el_)},n.updateDisplay=function(){var e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){for(var n=[],r=0;r<e.length;++r){var i=e[r];"showing"===i.mode&&n.push(i)}this.updateForTrack(n)}else{for(var a=null,s=null,o=e.length;o--;){var u=e[o];"showing"===u.mode&&("descriptions"===u.kind?a=u:s=u)}s?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(s)):a&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(a))}},n.updateDisplayState=function(e){for(var t=this.player_.textTrackSettings.getValues(),n=e.activeCues,r=n.length;r--;){var a=n[r];if(a){var s=a.displayState;if(t.color&&(s.firstChild.style.color=t.color),t.textOpacity&&qi(s.firstChild,"color",ji(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(s.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&qi(s.firstChild,"backgroundColor",ji(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?qi(s,"backgroundColor",ji(t.windowColor,t.windowOpacity)):s.style.backgroundColor=t.windowColor),t.edgeStyle&&("dropshadow"===t.edgeStyle?s.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px "+Ui:"raised"===t.edgeStyle?s.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px "+Ui:"depressed"===t.edgeStyle?s.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px "+Ui:"uniform"===t.edgeStyle&&(s.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px "+Ui)),t.fontPercent&&1!==t.fontPercent){var o=i().parseFloat(s.style.fontSize);s.style.fontSize=o*t.fontPercent+"px",s.style.height="auto",s.style.top="auto"}t.fontFamily&&"default"!==t.fontFamily&&("small-caps"===t.fontFamily?s.firstChild.style.fontVariant="small-caps":s.firstChild.style.fontFamily=Bi[t.fontFamily])}}},n.updateForTrack=function(e){if(Array.isArray(e)||(e=[e]),"function"==typeof i().WebVTT&&!e.every((function(e){return!e.activeCues}))){for(var t=[],n=0;n<e.length;++n)for(var r=e[n],a=0;a<r.activeCues.length;++a)t.push(r.activeCues[a]);i().WebVTT.processCues(i(),t,this.el_);for(var s=0;s<e.length;++s){for(var o=e[s],u=0;u<o.activeCues.length;++u){var l=o.activeCues[u].displayState;_n(l,"vjs-text-track-cue"),_n(l,"vjs-text-track-cue-"+(o.language?o.language:s)),o.language&&An(l,"lang",o.language)}this.player_.textTrackSettings&&this.updateDisplayState(o)}}},t}(Mr);Mr.registerComponent("TextTrackDisplay",Hi);var Gi=function(e){function t(){return e.apply(this,arguments)||this}return p(t,e),t.prototype.createEl=function(){var t=this.player_.isAudio(),n=this.localize(t?"Audio Player":"Video Player"),r=gn("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[n])}),i=e.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return i.appendChild(r),i},t}(Mr);Mr.registerComponent("LoadingSpinner",Gi);var Vi=function(e){function t(){return e.apply(this,arguments)||this}p(t,e);var n=t.prototype;return n.createEl=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n={});var r=gn("button",t=Mt({className:this.buildCSSClass()},t),n=Mt({type:"button"},n));return r.appendChild(gn("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r},n.addChild=function(e,t){void 0===t&&(t={});var n=this.constructor.name;return Dt.warn("Adding an actionable (user controllable) child to a Button ("+n+") is not supported; use a ClickableComponent instead."),Mr.prototype.addChild.call(this,e,t)},n.enable=function(){e.prototype.enable.call(this),this.el_.removeAttribute("disabled")},n.disable=function(){e.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},n.handleKeyDown=function(t){d().isEventKey(t,"Space")||d().isEventKey(t,"Enter")?t.stopPropagation():e.prototype.handleKeyDown.call(this,t)},t}(Li);Mr.registerComponent("Button",Vi);var Yi=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).mouseused_=!1,r.on("mousedown",(function(e){return r.handleMouseDown(e)})),r}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-big-play-button"},n.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY){var n=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;return Hr(t),void(!this.player_.tech(!0)||(Jt||Xt)&&n||this.player_.tech(!0).focus())}var r=this.player_.getChild("controlBar"),i=r&&r.getChild("playToggle");if(i){var a=function(){return i.focus()};qr(t)?t.then(a,(function(){})):this.setTimeout(a,1)}else this.player_.tech(!0).focus()},n.handleKeyDown=function(t){this.mouseused_=!1,e.prototype.handleKeyDown.call(this,t)},n.handleMouseDown=function(e){this.mouseused_=!0},t}(Vi);Yi.prototype.controlText_="Play Video",Mr.registerComponent("BigPlayButton",Yi);var zi=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).controlText(n&&n.controlText||r.localize("Close")),r}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},n.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},n.handleKeyDown=function(t){d().isEventKey(t,"Esc")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},t}(Vi);Mr.registerComponent("CloseButton",zi);var Zi=function(e){function t(t,n){var r;return void 0===n&&(n={}),r=e.call(this,t,n)||this,n.replay=void 0===n.replay||n.replay,r.on(t,"play",(function(e){return r.handlePlay(e)})),r.on(t,"pause",(function(e){return r.handlePause(e)})),n.replay&&r.on(t,"ended",(function(e){return r.handleEnded(e)})),r}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},n.handleClick=function(e){this.player_.paused()?Hr(this.player_.play()):this.player_.pause()},n.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},n.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},n.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},n.handleEnded=function(e){var t=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",(function(e){return t.handleSeeked(e)}))},t}(Vi);Zi.prototype.controlText_="Play",Mr.registerComponent("PlayToggle",Zi);var Ki=function(e,t){e=e<0?0:e;var n=Math.floor(e%60),r=Math.floor(e/60%60),i=Math.floor(e/3600),a=Math.floor(t/60%60),s=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(i=r=n="-"),(i=i>0||s>0?i+":":"")+(r=((i||a>=10)&&r<10?"0"+r:r)+":")+(n<10?"0"+n:n)},Wi=Ki;function Xi(e,t){return void 0===t&&(t=e),Wi(e,t)}var $i=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).on(t,["timeupdate","ended"],(function(e){return r.updateContent(e)})),r.updateTextNode_(),r}p(t,e);var n=t.prototype;return n.createEl=function(){var t=this.buildCSSClass(),n=e.prototype.createEl.call(this,"div",{className:t+" vjs-time-control vjs-control"}),r=gn("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+" "},{role:"presentation"});return n.appendChild(r),this.contentEl_=gn("span",{className:t+"-display"},{"aria-live":"off",role:"presentation"}),n.appendChild(this.contentEl_),n},n.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},n.updateTextNode_=function(e){var t=this;void 0===e&&(e=0),e=Xi(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",(function(){if(t.contentEl_){var e=t.textNode_;e&&t.contentEl_.firstChild!==e&&(e=null,Dt.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),t.textNode_=u().createTextNode(t.formattedTime_),t.textNode_&&(e?t.contentEl_.replaceChild(t.textNode_,e):t.contentEl_.appendChild(t.textNode_))}})))},n.updateContent=function(e){},t}(Mr);$i.prototype.labelText_="Time",$i.prototype.controlText_="Time",Mr.registerComponent("TimeDisplay",$i);var Qi=function(e){function t(){return e.apply(this,arguments)||this}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-current-time"},n.updateContent=function(e){var t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)},t}($i);Qi.prototype.labelText_="Current Time",Qi.prototype.controlText_="Current Time",Mr.registerComponent("CurrentTimeDisplay",Qi);var Ji=function(e){function t(t,n){var r,i=function(e){return r.updateContent(e)};return(r=e.call(this,t,n)||this).on(t,"durationchange",i),r.on(t,"loadstart",i),r.on(t,"loadedmetadata",i),r}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-duration"},n.updateContent=function(e){var t=this.player_.duration();this.updateTextNode_(t)},t}($i);Ji.prototype.labelText_="Duration",Ji.prototype.controlText_="Duration",Mr.registerComponent("DurationDisplay",Ji);var ea=function(e){function t(){return e.apply(this,arguments)||this}return p(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),n=e.prototype.createEl.call(this,"div"),r=e.prototype.createEl.call(this,"span",{textContent:"/"});return n.appendChild(r),t.appendChild(n),t},t}(Mr);Mr.registerComponent("TimeDivider",ea);var ta=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).on(t,"durationchange",(function(e){return r.updateContent(e)})),r}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-remaining-time"},n.createEl=function(){var t=e.prototype.createEl.call(this);return!1!==this.options_.displayNegative&&t.insertBefore(gn("span",{},{"aria-hidden":!0},"-"),this.contentEl_),t},n.updateContent=function(e){var t;"number"==typeof this.player_.duration()&&(t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t))},t}($i);ta.prototype.labelText_="Remaining Time",ta.prototype.controlText_="Remaining Time",Mr.registerComponent("RemainingTimeDisplay",ta);var na=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).updateShowing(),r.on(r.player(),"durationchange",(function(e){return r.updateShowing(e)})),r}p(t,e);var n=t.prototype;return n.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=gn("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(gn("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+" "})),this.contentEl_.appendChild(u().createTextNode(this.localize("LIVE"))),t.appendChild(this.contentEl_),t},n.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},n.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(Mr);Mr.registerComponent("LiveDisplay",na);var ra=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).updateLiveEdgeStatus(),r.player_.liveTracker&&(r.updateLiveEdgeStatusHandler_=function(e){return r.updateLiveEdgeStatus(e)},r.on(r.player_.liveTracker,"liveedgechange",r.updateLiveEdgeStatusHandler_)),r}p(t,e);var n=t.prototype;return n.createEl=function(){var t=e.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=gn("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),t.appendChild(this.textEl_),t},n.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},n.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},n.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,e.prototype.dispose.call(this)},t}(Vi);ra.prototype.controlText_="Seek to live, currently playing live",Mr.registerComponent("SeekToLive",ra);var ia=function(e,t,n){return e=Number(e),Math.min(n,Math.max(t,isNaN(e)?t:e))},aa=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).handleMouseDown_=function(e){return r.handleMouseDown(e)},r.handleMouseUp_=function(e){return r.handleMouseUp(e)},r.handleKeyDown_=function(e){return r.handleKeyDown(e)},r.handleClick_=function(e){return r.handleClick(e)},r.handleMouseMove_=function(e){return r.handleMouseMove(e)},r.update_=function(e){return r.update(e)},r.bar=r.getChild(r.options_.barName),r.vertical(!!r.options_.vertical),r.enable(),r}p(t,e);var n=t.prototype;return n.enabled=function(){return this.enabled_},n.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},n.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},n.createEl=function(t,n,r){return void 0===n&&(n={}),void 0===r&&(r={}),n.className=n.className+" vjs-slider",n=Mt({tabIndex:0},n),r=Mt({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},r),e.prototype.createEl.call(this,t,n,r)},n.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||$t||e.preventDefault(),Cn(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)},n.handleMouseMove=function(e){},n.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;Rn(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.update()},n.update=function(){var e=this;if(this.el_&&this.bar){var t=this.getProgress();return t===this.progress_||(this.progress_=t,this.requestNamedAnimationFrame("Slider#update",(function(){var n=e.vertical()?"height":"width";e.bar.el().style[n]=(100*t).toFixed(2)+"%"}))),t}},n.getProgress=function(){return Number(ia(this.getPercent(),0,1).toFixed(4))},n.calculateDistance=function(e){var t=Nn(this.el_,e);return this.vertical()?t.y:t.x},n.handleKeyDown=function(t){d().isEventKey(t,"Left")||d().isEventKey(t,"Down")?(t.preventDefault(),t.stopPropagation(),this.stepBack()):d().isEventKey(t,"Right")||d().isEventKey(t,"Up")?(t.preventDefault(),t.stopPropagation(),this.stepForward()):e.prototype.handleKeyDown.call(this,t)},n.handleClick=function(e){e.stopPropagation(),e.preventDefault()},n.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(Mr);Mr.registerComponent("Slider",aa);var sa=function(e,t){return ia(e/t*100,0,100).toFixed(2)+"%"},oa=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).partEls_=[],r.on(t,"progress",(function(e){return r.update(e)})),r}p(t,e);var n=t.prototype;return n.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),n=gn("span",{className:"vjs-control-text"}),r=gn("span",{textContent:this.localize("Loaded")}),i=u().createTextNode(": ");return this.percentageEl_=gn("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),t.appendChild(n),n.appendChild(r),n.appendChild(i),n.appendChild(this.percentageEl_),t},n.dispose=function(){this.partEls_=null,this.percentageEl_=null,e.prototype.dispose.call(this)},n.update=function(e){var t=this;this.requestNamedAnimationFrame("LoadProgressBar#update",(function(){var e=t.player_.liveTracker,n=t.player_.buffered(),r=e&&e.isLive()?e.seekableEnd():t.player_.duration(),i=t.player_.bufferedEnd(),a=t.partEls_,s=sa(i,r);t.percent_!==s&&(t.el_.style.width=s,mn(t.percentageEl_,s),t.percent_=s);for(var o=0;o<n.length;o++){var u=n.start(o),l=n.end(o),c=a[o];c||(c=t.el_.appendChild(gn()),a[o]=c),c.dataset.start===u&&c.dataset.end===l||(c.dataset.start=u,c.dataset.end=l,c.style.left=sa(u,i),c.style.width=sa(l-u,i))}for(var d=a.length;d>n.length;d--)t.el_.removeChild(a[d-1]);a.length=n.length}))},t}(Mr);Mr.registerComponent("LoadProgressBar",oa);var ua=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).update=hr(fr(f(r),r.update),dr),r}p(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},n.update=function(e,t,n){var r=xn(this.el_),i=Dn(this.player_.el()),a=e.width*t;if(i&&r){var s=e.left-i.left+a,o=e.width-a+(i.right-e.right),u=r.width/2;s<u?u+=u-s:o<u&&(u=o),u<0?u=0:u>r.width&&(u=r.width),u=Math.round(u),this.el_.style.right="-"+u+"px",this.write(n)}},n.write=function(e){mn(this.el_,e)},n.updateTime=function(e,t,n,r){var i=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",(function(){var a,s=i.player_.duration();if(i.player_.liveTracker&&i.player_.liveTracker.isLive()){var o=i.player_.liveTracker.liveWindow(),u=o-t*o;a=(u<1?"":"-")+Xi(u,o)}else a=Xi(n,s);i.update(e,t,a),r&&r()}))},t}(Mr);Mr.registerComponent("TimeTooltip",ua);var la=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).update=hr(fr(f(r),r.update),dr),r}p(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},n.update=function(e,t){var n=this.getChild("timeTooltip");if(n){var r=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();n.updateTime(e,t,r)}},t}(Mr);la.prototype.options_={children:[]},sn||zt||la.prototype.options_.children.push("timeTooltip"),Mr.registerComponent("PlayProgressBar",la);var ca=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).update=hr(fr(f(r),r.update),dr),r}p(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},n.update=function(e,t){var n=this,r=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,r,(function(){n.el_.style.left=e.width*t+"px"}))},t}(Mr);ca.prototype.options_={children:["timeTooltip"]},Mr.registerComponent("MouseTimeDisplay",ca);var da=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).setEventHandlers_(),r}p(t,e);var n=t.prototype;return n.setEventHandlers_=function(){var e=this;this.update_=fr(this,this.update),this.update=hr(this.update_,dr),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(t){return e.enableInterval_(t)},this.disableIntervalHandler_=function(t){return e.disableInterval_(t)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in u()&&"visibilityState"in u()&&this.on(u(),"visibilitychange",this.toggleVisibility_)},n.toggleVisibility_=function(e){"hidden"===u().visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())},n.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,dr))},n.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},n.update=function(t){var n=this;if("hidden"!==u().visibilityState){var r=e.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",(function(){var e=n.player_.ended()?n.player_.duration():n.getCurrentTime_(),t=n.player_.liveTracker,i=n.player_.duration();t&&t.isLive()&&(i=n.player_.liveTracker.liveCurrentTime()),n.percent_!==r&&(n.el_.setAttribute("aria-valuenow",(100*r).toFixed(2)),n.percent_=r),n.currentTime_===e&&n.duration_===i||(n.el_.setAttribute("aria-valuetext",n.localize("progress bar timing: currentTime={1} duration={2}",[Xi(e,i),Xi(i,i)],"{1} of {2}")),n.currentTime_=e,n.duration_=i),n.bar&&n.bar.update(Dn(n.el()),n.getProgress())})),r}},n.userSeek_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)},n.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},n.getPercent=function(){var e,t=this.getCurrentTime_(),n=this.player_.liveTracker;return n&&n.isLive()?(e=(t-n.seekableStart())/n.liveWindow(),n.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e},n.handleMouseDown=function(t){Fn(t)&&(t.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},n.handleMouseMove=function(e,t){if(void 0===t&&(t=!1),Fn(e)){var n;t||this.player_.scrubbing()||this.player_.scrubbing(!0);var r=this.calculateDistance(e),i=this.player_.liveTracker;if(i&&i.isLive()){if(r>=.99)return void i.seekToLiveEdge();var a=i.seekableStart(),s=i.liveCurrentTime();if((n=a+r*i.liveWindow())>=s&&(n=s),n<=a&&(n=a+.1),n===1/0)return}else(n=r*this.player_.duration())===this.player_.duration()&&(n-=.1);this.userSeek_(n)}},n.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},n.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},n.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Hr(this.player_.play()):this.update_()},n.stepForward=function(){this.userSeek_(this.player_.currentTime()+5)},n.stepBack=function(){this.userSeek_(this.player_.currentTime()-5)},n.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},n.handleKeyDown=function(t){var n=this.player_.liveTracker;if(d().isEventKey(t,"Space")||d().isEventKey(t,"Enter"))t.preventDefault(),t.stopPropagation(),this.handleAction(t);else if(d().isEventKey(t,"Home"))t.preventDefault(),t.stopPropagation(),this.userSeek_(0);else if(d().isEventKey(t,"End"))t.preventDefault(),t.stopPropagation(),n&&n.isLive()?this.userSeek_(n.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(d()(t))){t.preventDefault(),t.stopPropagation();var r=10*(d().codes[d()(t)]-d().codes[0])/100;n&&n.isLive()?this.userSeek_(n.seekableStart()+n.liveWindow()*r):this.userSeek_(this.player_.duration()*r)}else d().isEventKey(t,"PgDn")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):d().isEventKey(t,"PgUp")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):e.prototype.handleKeyDown.call(this,t)},n.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in u()&&"visibilityState"in u()&&this.off(u(),"visibilitychange",this.toggleVisibility_),e.prototype.dispose.call(this)},t}(aa);da.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},sn||zt||da.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),Mr.registerComponent("SeekBar",da);var fa=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).handleMouseMove=hr(fr(f(r),r.handleMouseMove),dr),r.throttledHandleMouseSeek=hr(fr(f(r),r.handleMouseSeek),dr),r.handleMouseUpHandler_=function(e){return r.handleMouseUp(e)},r.handleMouseDownHandler_=function(e){return r.handleMouseDown(e)},r.enable(),r}p(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},n.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var n=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(n||r){var i=t.el(),a=xn(i),s=Nn(i,e).x;s=ia(s,0,1),r&&r.update(a,s),n&&n.update(a,t.getProgress())}}},n.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},n.enabled=function(){return this.enabled_},n.disable=function(){if(this.children().forEach((function(e){return e.disable&&e.disable()})),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&Hr(this.player_.play())}},n.enable=function(){this.children().forEach((function(e){return e.enable&&e.enable()})),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},n.removeListenersAddedOnMousedownAndTouchstart=function(){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)},n.handleMouseDown=function(e){var t=this.el_.ownerDocument,n=this.getChild("seekBar");n&&n.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)},n.handleMouseUp=function(e){var t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()},t}(Mr);fa.prototype.options_={children:["seekBar"]},Mr.registerComponent("ProgressControl",fa);var ha=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).on(t,["enterpictureinpicture","leavepictureinpicture"],(function(e){return r.handlePictureInPictureChange(e)})),r.on(t,["disablepictureinpicturechanged","loadedmetadata"],(function(e){return r.handlePictureInPictureEnabledChange(e)})),r.on(t,["loadedmetadata","audioonlymodechange","audiopostermodechange"],(function(){"audio"===t.currentType().substring(0,5)||t.audioPosterMode()||t.audioOnlyMode()?(t.isInPictureInPicture()&&t.exitPictureInPicture(),r.hide()):r.show()})),r.disable(),r}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-picture-in-picture-control "+e.prototype.buildCSSClass.call(this)},n.handlePictureInPictureEnabledChange=function(){u().pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()?this.enable():this.disable()},n.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},n.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},t}(Vi);ha.prototype.controlText_="Picture-in-Picture",Mr.registerComponent("PictureInPictureToggle",ha);var pa=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).on(t,"fullscreenchange",(function(e){return r.handleFullscreenChange(e)})),!1===u()[t.fsApi_.fullscreenEnabled]&&r.disable(),r}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},n.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},n.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(Vi);pa.prototype.controlText_="Fullscreen",Mr.registerComponent("FullscreenToggle",pa);var ga=function(e){function t(){return e.apply(this,arguments)||this}return p(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return t.appendChild(e.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),t},t}(Mr);Mr.registerComponent("VolumeLevel",ga);var ma=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).update=hr(fr(f(r),r.update),dr),r}p(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},n.update=function(e,t,n,r){if(!n){var i=Dn(this.el_),a=Dn(this.player_.el()),s=e.width*t;if(!a||!i)return;var o=e.left-a.left+s,u=e.width-s+(a.right-e.right),l=i.width/2;o<l?l+=l-o:u<l&&(l=u),l<0?l=0:l>i.width&&(l=i.width),this.el_.style.right="-"+l+"px"}this.write(r+"%")},n.write=function(e){mn(this.el_,e)},n.updateVolume=function(e,t,n,r,i){var a=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",(function(){a.update(e,t,n,r.toFixed(0)),i&&i()}))},t}(Mr);Mr.registerComponent("VolumeLevelTooltip",ma);var ya=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).update=hr(fr(f(r),r.update),dr),r}p(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},n.update=function(e,t,n){var r=this,i=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,n,i,(function(){n?r.el_.style.bottom=e.height*t+"px":r.el_.style.left=e.width*t+"px"}))},t}(Mr);ya.prototype.options_={children:["volumeLevelTooltip"]},Mr.registerComponent("MouseVolumeLevelDisplay",ya);var va=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).on("slideractive",(function(e){return r.updateLastVolume_(e)})),r.on(t,"volumechange",(function(e){return r.updateARIAAttributes(e)})),t.ready((function(){return r.updateARIAAttributes()})),r}p(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},n.handleMouseDown=function(t){Fn(t)&&e.prototype.handleMouseDown.call(this,t)},n.handleMouseMove=function(e){var t=this.getChild("mouseVolumeLevelDisplay");if(t){var n=this.el(),r=Dn(n),i=this.vertical(),a=Nn(n,e);a=i?a.y:a.x,a=ia(a,0,1),t.update(r,a,i)}Fn(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},n.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},n.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},n.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},n.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},n.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},n.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},n.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",(function(){0===e.player_.volume()&&e.player_.lastVolume_(t)}))},t}(aa);va.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},sn||zt||va.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),va.prototype.playerEvent="volumechange",Mr.registerComponent("VolumeBar",va);var _a=function(e){function t(t,n){var r;return void 0===n&&(n={}),n.vertical=n.vertical||!1,(void 0===n.volumeBar||Lt(n.volumeBar))&&(n.volumeBar=n.volumeBar||{},n.volumeBar.vertical=n.vertical),function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(f(r=e.call(this,t,n)||this),t),r.throttledHandleMouseMove=hr(fr(f(r),r.handleMouseMove),dr),r.handleMouseUpHandler_=function(e){return r.handleMouseUp(e)},r.on("mousedown",(function(e){return r.handleMouseDown(e)})),r.on("touchstart",(function(e){return r.handleMouseDown(e)})),r.on("mousemove",(function(e){return r.handleMouseMove(e)})),r.on(r.volumeBar,["focus","slideractive"],(function(){r.volumeBar.addClass("vjs-slider-active"),r.addClass("vjs-slider-active"),r.trigger("slideractive")})),r.on(r.volumeBar,["blur","sliderinactive"],(function(){r.volumeBar.removeClass("vjs-slider-active"),r.removeClass("vjs-slider-active"),r.trigger("sliderinactive")})),r}p(t,e);var n=t.prototype;return n.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})},n.handleMouseDown=function(e){var t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)},n.handleMouseUp=function(e){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)},n.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(Mr);_a.prototype.options_={children:["volumeBar"]},Mr.registerComponent("VolumeControl",_a);var Ta=function(e){function t(t,n){var r;return function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(f(r=e.call(this,t,n)||this),t),r.on(t,["loadstart","volumechange"],(function(e){return r.update(e)})),r}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},n.handleClick=function(e){var t=this.player_.volume(),n=this.player_.lastVolume_();if(0===t){var r=n<.1?.1:n;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},n.update=function(e){this.updateIcon_(),this.updateControlText_()},n.updateIcon_=function(){var e=this.player_.volume(),t=3;sn&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var n=0;n<4;n++)Tn(this.el_,"vjs-vol-"+n);_n(this.el_,"vjs-vol-"+t)},n.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},t}(Vi);Ta.prototype.controlText_="Mute",Mr.registerComponent("MuteToggle",Ta);var ba=function(e){function t(t,n){var r;return void 0===n&&(n={}),void 0!==n.inline?n.inline=n.inline:n.inline=!0,(void 0===n.volumeControl||Lt(n.volumeControl))&&(n.volumeControl=n.volumeControl||{},n.volumeControl.vertical=!n.inline),(r=e.call(this,t,n)||this).handleKeyPressHandler_=function(e){return r.handleKeyPress(e)},r.on(t,["loadstart"],(function(e){return r.volumePanelState_(e)})),r.on(r.muteToggle,"keyup",(function(e){return r.handleKeyPress(e)})),r.on(r.volumeControl,"keyup",(function(e){return r.handleVolumeControlKeyUp(e)})),r.on("keydown",(function(e){return r.handleKeyPress(e)})),r.on("mouseover",(function(e){return r.handleMouseOver(e)})),r.on("mouseout",(function(e){return r.handleMouseOut(e)})),r.on(r.volumeControl,["slideractive"],r.sliderActive_),r.on(r.volumeControl,["sliderinactive"],r.sliderInactive_),r}p(t,e);var n=t.prototype;return n.sliderActive_=function(){this.addClass("vjs-slider-active")},n.sliderInactive_=function(){this.removeClass("vjs-slider-active")},n.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},n.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},n.dispose=function(){this.handleMouseOut(),e.prototype.dispose.call(this)},n.handleVolumeControlKeyUp=function(e){d().isEventKey(e,"Esc")&&this.muteToggle.focus()},n.handleMouseOver=function(e){this.addClass("vjs-hover"),ir(u(),"keyup",this.handleKeyPressHandler_)},n.handleMouseOut=function(e){this.removeClass("vjs-hover"),ar(u(),"keyup",this.handleKeyPressHandler_)},n.handleKeyPress=function(e){d().isEventKey(e,"Esc")&&this.handleMouseOut()},t}(Mr);ba.prototype.options_={children:["muteToggle","volumeControl"]},Mr.registerComponent("VolumePanel",ba);var Ea=function(e){function t(t,n){var r;return r=e.call(this,t,n)||this,n&&(r.menuButton_=n.menuButton),r.focusedChild_=-1,r.on("keydown",(function(e){return r.handleKeyDown(e)})),r.boundHandleBlur_=function(e){return r.handleBlur(e)},r.boundHandleTapClick_=function(e){return r.handleTapClick(e)},r}p(t,e);var n=t.prototype;return n.addEventListenerForItem=function(e){e instanceof Mr&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},n.removeEventListenerForItem=function(e){e instanceof Mr&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},n.removeChild=function(t){"string"==typeof t&&(t=this.getChild(t)),this.removeEventListenerForItem(t),e.prototype.removeChild.call(this,t)},n.addItem=function(e){var t=this.addChild(e);t&&this.addEventListenerForItem(t)},n.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=gn(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var n=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return n.appendChild(this.contentEl_),ir(n,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),n},n.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,e.prototype.dispose.call(this)},n.handleBlur=function(e){var t=e.relatedTarget||u().activeElement;if(!this.children().some((function(e){return e.el()===t}))){var n=this.menuButton_;n&&n.buttonPressed_&&t!==n.el().firstChild&&n.unpressButton()}},n.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var t=this.children();if(!Array.isArray(t))return;var n=t.filter((function(t){return t.el()===e.target}))[0];if(!n)return;"CaptionSettingsMenuItem"!==n.name()&&this.menuButton_.focus()}},n.handleKeyDown=function(e){d().isEventKey(e,"Left")||d().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(d().isEventKey(e,"Right")||d().isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},n.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},n.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},n.focus=function(e){void 0===e&&(e=0);var t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())},t}(Mr);Mr.registerComponent("Menu",Ea);var Sa=function(e){function t(t,n){var r;void 0===n&&(n={}),(r=e.call(this,t,n)||this).menuButton_=new Vi(t,n),r.menuButton_.controlText(r.controlText_),r.menuButton_.el_.setAttribute("aria-haspopup","true");var i=Vi.prototype.buildCSSClass();r.menuButton_.el_.className=r.buildCSSClass()+" "+i,r.menuButton_.removeClass("vjs-control"),r.addChild(r.menuButton_),r.update(),r.enabled_=!0;var a=function(e){return r.handleClick(e)};return r.handleMenuKeyUp_=function(e){return r.handleMenuKeyUp(e)},r.on(r.menuButton_,"tap",a),r.on(r.menuButton_,"click",a),r.on(r.menuButton_,"keydown",(function(e){return r.handleKeyDown(e)})),r.on(r.menuButton_,"mouseenter",(function(){r.addClass("vjs-hover"),r.menu.show(),ir(u(),"keyup",r.handleMenuKeyUp_)})),r.on("mouseleave",(function(e){return r.handleMouseLeave(e)})),r.on("keydown",(function(e){return r.handleSubmenuKeyDown(e)})),r}p(t,e);var n=t.prototype;return n.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))},n.createMenu=function(){var e=new Ea(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=gn("li",{className:"vjs-menu-title",textContent:Rr(this.options_.title),tabIndex:-1}),n=new Mr(this.player_,{el:t});e.addItem(n)}if(this.items=this.createItems(),this.items)for(var r=0;r<this.items.length;r++)e.addItem(this.items[r]);return e},n.createItems=function(){},n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},n.buildWrapperCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+Vi.prototype.buildCSSClass()+" "+e.prototype.buildCSSClass.call(this)},n.buildCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+e.prototype.buildCSSClass.call(this)},n.controlText=function(e,t){return void 0===t&&(t=this.menuButton_.el()),this.menuButton_.controlText(e,t)},n.dispose=function(){this.handleMouseLeave(),e.prototype.dispose.call(this)},n.handleClick=function(e){this.buttonPressed_?this.unpressButton():this.pressButton()},n.handleMouseLeave=function(e){this.removeClass("vjs-hover"),ar(u(),"keyup",this.handleMenuKeyUp_)},n.focus=function(){this.menuButton_.focus()},n.blur=function(){this.menuButton_.blur()},n.handleKeyDown=function(e){d().isEventKey(e,"Esc")||d().isEventKey(e,"Tab")?(this.buttonPressed_&&this.unpressButton(),d().isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus())):(d().isEventKey(e,"Up")||d().isEventKey(e,"Down"))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))},n.handleMenuKeyUp=function(e){(d().isEventKey(e,"Esc")||d().isEventKey(e,"Tab"))&&this.removeClass("vjs-hover")},n.handleSubmenuKeyPress=function(e){this.handleSubmenuKeyDown(e)},n.handleSubmenuKeyDown=function(e){(d().isEventKey(e,"Esc")||d().isEventKey(e,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),d().isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus()))},n.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),sn&&hn())return;this.menu.focus()}},n.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},n.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},n.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},t}(Mr);Mr.registerComponent("MenuButton",Sa);var wa=function(e){function t(t,n){var r,i=n.tracks;if((r=e.call(this,t,n)||this).items.length<=1&&r.hide(),!i)return f(r);var a=fr(f(r),r.update);return i.addEventListener("removetrack",a),i.addEventListener("addtrack",a),i.addEventListener("labelchange",a),r.player_.on("ready",a),r.player_.on("dispose",(function(){i.removeEventListener("removetrack",a),i.removeEventListener("addtrack",a),i.removeEventListener("labelchange",a)})),r}return p(t,e),t}(Sa);Mr.registerComponent("TrackButton",wa);var Aa=["Tab","Esc","Up","Down","Right","Left"],Ia=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).selectable=n.selectable,r.isSelected_=n.selected||!1,r.multiSelectable=n.multiSelectable,r.selected(r.isSelected_),r.selectable?r.multiSelectable?r.el_.setAttribute("role","menuitemcheckbox"):r.el_.setAttribute("role","menuitemradio"):r.el_.setAttribute("role","menuitem"),r}p(t,e);var n=t.prototype;return n.createEl=function(t,n,r){this.nonIconControl=!0;var i=e.prototype.createEl.call(this,"li",Mt({className:"vjs-menu-item",tabIndex:-1},n),r);return i.replaceChild(gn("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)}),i.querySelector(".vjs-icon-placeholder")),i},n.handleKeyDown=function(t){Aa.some((function(e){return d().isEventKey(t,e)}))||e.prototype.handleKeyDown.call(this,t)},n.handleClick=function(e){this.selected(!0)},n.selected=function(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))},t}(Li);Mr.registerComponent("MenuItem",Ia);var Ca=function(e){function t(t,n){var r,a=n.track,s=t.textTracks();n.label=a.label||a.language||"Unknown",n.selected="showing"===a.mode,(r=e.call(this,t,n)||this).track=a,r.kinds=(n.kinds||[n.kind||r.track.kind]).filter(Boolean);var o,l=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];r.handleTracksChange.apply(f(r),t)},c=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];r.handleSelectedLanguageChange.apply(f(r),t)};return t.on(["loadstart","texttrackchange"],l),s.addEventListener("change",l),s.addEventListener("selectedlanguagechange",c),r.on("dispose",(function(){t.off(["loadstart","texttrackchange"],l),s.removeEventListener("change",l),s.removeEventListener("selectedlanguagechange",c)})),void 0===s.onchange&&r.on(["tap","click"],(function(){if("object"!=typeof i().Event)try{o=new(i().Event)("change")}catch(e){}o||(o=u().createEvent("Event")).initEvent("change",!0,!0),s.dispatchEvent(o)})),r.handleTracksChange(),r}p(t,e);var n=t.prototype;return n.handleClick=function(t){var n=this.track,r=this.player_.textTracks();if(e.prototype.handleClick.call(this,t),r)for(var i=0;i<r.length;i++){var a=r[i];-1!==this.kinds.indexOf(a.kind)&&(a===n?"showing"!==a.mode&&(a.mode="showing"):"disabled"!==a.mode&&(a.mode="disabled"))}},n.handleTracksChange=function(e){var t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)},n.handleSelectedLanguageChange=function(e){if("showing"===this.track.mode){var t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},n.dispose=function(){this.track=null,e.prototype.dispose.call(this)},t}(Ia);Mr.registerComponent("TextTrackMenuItem",Ca);var Ra=function(e){function t(t,n){return n.track={player:t,kind:n.kind,kinds:n.kinds,default:!1,mode:"disabled"},n.kinds||(n.kinds=[n.kind]),n.label?n.track.label=n.label:n.track.label=n.kinds.join(" and ")+" off",n.selectable=!0,n.multiSelectable=!1,e.call(this,t,n)||this}p(t,e);var n=t.prototype;return n.handleTracksChange=function(e){for(var t=this.player().textTracks(),n=!0,r=0,i=t.length;r<i;r++){var a=t[r];if(this.options_.kinds.indexOf(a.kind)>-1&&"showing"===a.mode){n=!1;break}}n!==this.isSelected_&&this.selected(n)},n.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),n=!0,r=0,i=t.length;r<i;r++){var a=t[r];if(["captions","descriptions","subtitles"].indexOf(a.kind)>-1&&"showing"===a.mode){n=!1;break}}n&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(Ca);Mr.registerComponent("OffTextTrackMenuItem",Ra);var Da=function(e){function t(t,n){return void 0===n&&(n={}),n.tracks=t.textTracks(),e.call(this,t,n)||this}return p(t,e),t.prototype.createItems=function(e,t){var n;void 0===e&&(e=[]),void 0===t&&(t=Ca),this.label_&&(n=this.label_+" off"),e.push(new Ra(this.player_,{kinds:this.kinds_,kind:this.kind_,label:n})),this.hideThreshold_+=1;var r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var i=0;i<r.length;i++){var a=r[i];if(this.kinds_.indexOf(a.kind)>-1){var s=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});s.addClass("vjs-"+a.kind+"-menu-item"),e.push(s)}}return e},t}(wa);Mr.registerComponent("TextTrackButton",Da);var xa=function(e){function t(t,n){var r,i=n.track,a=n.cue,s=t.currentTime();return n.selectable=!0,n.multiSelectable=!1,n.label=a.text,n.selected=a.startTime<=s&&s<a.endTime,(r=e.call(this,t,n)||this).track=i,r.cue=a,r}return p(t,e),t.prototype.handleClick=function(t){e.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime)},t}(Ia);Mr.registerComponent("ChaptersTrackMenuItem",xa);var Na=function(e){function t(t,n,r){var i;return(i=e.call(this,t,n,r)||this).selectCurrentItem_=function(){i.items.forEach((function(e){e.selected(i.track_.activeCues[0]===e.cue)}))},i}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildWrapperCSSClass.call(this)},n.update=function(t){if(!t||!t.track||"chapters"===t.track.kind){var n=this.findChaptersTrack();n!==this.track_?(this.setTrack(n),e.prototype.update.call(this)):(!this.items||n&&n.cues&&n.cues.length!==this.items.length)&&e.prototype.update.call(this)}},n.setTrack=function(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";var n=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);n&&n.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}},n.findChaptersTrack=function(){for(var e=this.player_.textTracks()||[],t=e.length-1;t>=0;t--){var n=e[t];if(n.kind===this.kind_)return n}},n.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(Rr(this.kind_))},n.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},n.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var n=0,r=t.length;n<r;n++){var i=t[n],a=new xa(this.player_,{track:this.track_,cue:i});e.push(a)}return e},t}(Da);Na.prototype.kind_="chapters",Na.prototype.controlText_="Chapters",Mr.registerComponent("ChaptersButton",Na);var Oa=function(e){function t(t,n,r){var i;i=e.call(this,t,n,r)||this;var a=t.textTracks(),s=fr(f(i),i.handleTracksChange);return a.addEventListener("change",s),i.on("dispose",(function(){a.removeEventListener("change",s)})),i}p(t,e);var n=t.prototype;return n.handleTracksChange=function(e){for(var t=this.player().textTracks(),n=!1,r=0,i=t.length;r<i;r++){var a=t[r];if(a.kind!==this.kind_&&"showing"===a.mode){n=!0;break}}n?this.disable():this.enable()},n.buildCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(Da);Oa.prototype.kind_="descriptions",Oa.prototype.controlText_="Descriptions",Mr.registerComponent("DescriptionsButton",Oa);var Pa=function(e){function t(t,n,r){return e.call(this,t,n,r)||this}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(Da);Pa.prototype.kind_="subtitles",Pa.prototype.controlText_="Subtitles",Mr.registerComponent("SubtitlesButton",Pa);var Ma=function(e){function t(t,n){var r;return n.track={player:t,kind:n.kind,label:n.kind+" settings",selectable:!1,default:!1,mode:"disabled"},n.selectable=!1,n.name="CaptionSettingsMenuItem",(r=e.call(this,t,n)||this).addClass("vjs-texttrack-settings"),r.controlText(", opens "+n.kind+" settings dialog"),r}return p(t,e),t.prototype.handleClick=function(e){this.player().getChild("textTrackSettings").open()},t}(Ca);Mr.registerComponent("CaptionSettingsMenuItem",Ma);var ka=function(e){function t(t,n,r){return e.call(this,t,n,r)||this}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-captions-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-captions-button "+e.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new Ma(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),e.prototype.createItems.call(this,t)},t}(Da);ka.prototype.kind_="captions",ka.prototype.controlText_="Captions",Mr.registerComponent("CaptionsButton",ka);var La=function(e){function t(){return e.apply(this,arguments)||this}return p(t,e),t.prototype.createEl=function(t,n,r){var i=e.prototype.createEl.call(this,t,n,r),a=i.querySelector(".vjs-menu-item-text");return"captions"===this.options_.track.kind&&(a.appendChild(gn("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),a.appendChild(gn("span",{className:"vjs-control-text",textContent:" "+this.localize("Captions")}))),i},t}(Ca);Mr.registerComponent("SubsCapsMenuItem",La);var Fa=function(e){function t(t,n){var r;return void 0===n&&(n={}),(r=e.call(this,t,n)||this).label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(r.player_.language_)>-1&&(r.label_="captions"),r.menuButton_.controlText(Rr(r.label_)),r}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new Ma(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e.prototype.createItems.call(this,t,La)},t}(Da);Fa.prototype.kinds_=["captions","subtitles"],Fa.prototype.controlText_="Subtitles",Mr.registerComponent("SubsCapsButton",Fa);var Ua=function(e){function t(t,n){var r,i=n.track,a=t.audioTracks();n.label=i.label||i.language||"Unknown",n.selected=i.enabled,(r=e.call(this,t,n)||this).track=i,r.addClass("vjs-"+i.kind+"-menu-item");var s=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];r.handleTracksChange.apply(f(r),t)};return a.addEventListener("change",s),r.on("dispose",(function(){a.removeEventListener("change",s)})),r}p(t,e);var n=t.prototype;return n.createEl=function(t,n,r){var i=e.prototype.createEl.call(this,t,n,r),a=i.querySelector(".vjs-menu-item-text");return"main-desc"===this.options_.track.kind&&(a.appendChild(gn("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),a.appendChild(gn("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),i},n.handleClick=function(t){if(e.prototype.handleClick.call(this,t),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks)for(var n=this.player_.audioTracks(),r=0;r<n.length;r++){var i=n[r];i!==this.track&&(i.enabled=i===this.track)}},n.handleTracksChange=function(e){this.selected(this.track.enabled)},t}(Ia);Mr.registerComponent("AudioTrackMenuItem",Ua);var Ba=function(e){function t(t,n){return void 0===n&&(n={}),n.tracks=t.audioTracks(),e.call(this,t,n)||this}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-audio-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-audio-button "+e.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(e){void 0===e&&(e=[]),this.hideThreshold_=1;for(var t=this.player_.audioTracks(),n=0;n<t.length;n++){var r=t[n];e.push(new Ua(this.player_,{track:r,selectable:!0,multiSelectable:!1}))}return e},t}(wa);Ba.prototype.controlText_="Audio Track",Mr.registerComponent("AudioTrackButton",Ba);var ja=function(e){function t(t,n){var r,i=n.rate,a=parseFloat(i,10);return n.label=i,n.selected=a===t.playbackRate(),n.selectable=!0,n.multiSelectable=!1,(r=e.call(this,t,n)||this).label=i,r.rate=a,r.on(t,"ratechange",(function(e){return r.update(e)})),r}p(t,e);var n=t.prototype;return n.handleClick=function(t){e.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},n.update=function(e){this.selected(this.player().playbackRate()===this.rate)},t}(Ia);ja.prototype.contentElType="button",Mr.registerComponent("PlaybackRateMenuItem",ja);var qa=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).menuButton_.el_.setAttribute("aria-describedby",r.labelElId_),r.updateVisibility(),r.updateLabel(),r.on(t,"loadstart",(function(e){return r.updateVisibility(e)})),r.on(t,"ratechange",(function(e){return r.updateLabel(e)})),r.on(t,"playbackrateschange",(function(e){return r.handlePlaybackRateschange(e)})),r}p(t,e);var n=t.prototype;return n.createEl=function(){var t=e.prototype.createEl.call(this);return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=gn("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),t.appendChild(this.labelEl_),t},n.dispose=function(){this.labelEl_=null,e.prototype.dispose.call(this)},n.buildCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(){for(var e=this.playbackRates(),t=[],n=e.length-1;n>=0;n--)t.push(new ja(this.player(),{rate:e[n]+"x"}));return t},n.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},n.handleClick=function(e){var t=this.player().playbackRate(),n=this.playbackRates(),r=(n.indexOf(t)+1)%n.length;this.player().playbackRate(n[r])},n.handlePlaybackRateschange=function(e){this.update()},n.playbackRates=function(){var e=this.player();return e.playbackRates&&e.playbackRates()||[]},n.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},n.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},n.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},t}(Sa);qa.prototype.controlText_="Playback Rate",Mr.registerComponent("PlaybackRateMenuButton",qa);var Ha=function(e){function t(){return e.apply(this,arguments)||this}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},n.createEl=function(t,n,r){return void 0===t&&(t="div"),void 0===n&&(n={}),void 0===r&&(r={}),n.className||(n.className=this.buildCSSClass()),e.prototype.createEl.call(this,t,n,r)},t}(Mr);Mr.registerComponent("Spacer",Ha);var Ga=function(e){function t(){return e.apply(this,arguments)||this}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)},n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:" "})},t}(Ha);Mr.registerComponent("CustomControlSpacer",Ga);var Va=function(e){function t(){return e.apply(this,arguments)||this}return p(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(Mr);Va.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in u()&&Va.prototype.options_.children.splice(Va.prototype.options_.children.length-1,0,"pictureInPictureToggle"),Mr.registerComponent("ControlBar",Va);var Ya=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).on(t,"error",(function(e){return r.open(e)})),r}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)},n.content=function(){var e=this.player().error();return e?this.localize(e.message):""},t}(Yr);Ya.prototype.options_=(0,l.Z)({},Yr.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Mr.registerComponent("ErrorDisplay",Ya);var za="vjs-text-track-settings",Za=["#000","Black"],Ka=["#00F","Blue"],Wa=["#0FF","Cyan"],Xa=["#0F0","Green"],$a=["#F0F","Magenta"],Qa=["#F00","Red"],Ja=["#FFF","White"],es=["#FF0","Yellow"],ts=["1","Opaque"],ns=["0.5","Semi-Transparent"],rs=["0","Transparent"],is={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Za,Ja,Qa,Xa,Ka,es,$a,Wa]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[ts,ns,rs]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Ja,Za,Qa,Xa,Ka,es,$a,Wa]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(e){return"1.00"===e?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[ts,ns]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[rs,ns,ts]}};function as(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}is.windowColor.options=is.backgroundColor.options;var ss=function(e){function t(t,n){var r;return n.temporary=!1,(r=e.call(this,t,n)||this).updateDisplay=r.updateDisplay.bind(f(r)),r.fill(),r.hasBeenOpened_=r.hasBeenFilled_=!0,r.endDialog=gn("p",{className:"vjs-control-text",textContent:r.localize("End of dialog window.")}),r.el().appendChild(r.endDialog),r.setDefaults(),void 0===n.persistTextTrackSettings&&(r.options_.persistTextTrackSettings=r.options_.playerOptions.persistTextTrackSettings),r.on(r.$(".vjs-done-button"),"click",(function(){r.saveSettings(),r.close()})),r.on(r.$(".vjs-default-button"),"click",(function(){r.setDefaults(),r.updateDisplay()})),Pt(is,(function(e){r.on(r.$(e.selector),"change",r.updateDisplay)})),r.options_.persistTextTrackSettings&&r.restoreSettings(),r}p(t,e);var n=t.prototype;return n.dispose=function(){this.endDialog=null,e.prototype.dispose.call(this)},n.createElSelect_=function(e,t,n){var r=this;void 0===t&&(t=""),void 0===n&&(n="label");var i=is[e],a=i.id.replace("%s",this.id_),s=[t,a].join(" ").trim();return["<"+n+' id="'+a+'" class="'+("label"===n?"vjs-label":"")+'">',this.localize(i.label),"</"+n+">",'<select aria-labelledby="'+s+'">'].concat(i.options.map((function(e){var t=a+"-"+e[1].replace(/\W+/g,"");return['<option id="'+t+'" value="'+e[0]+'" ','aria-labelledby="'+s+" "+t+'">',r.localize(e[1]),"</option>"].join("")}))).concat("</select>").join("")},n.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",e),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")},n.createElBgColor_=function(){var e="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",e),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")},n.createElWinColor_=function(){var e="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",e),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")},n.createElColors_=function(){return gn("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},n.createElFont_=function(){return gn("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})},n.createElControls_=function(){var e=this.localize("restore all settings to the default values");return gn("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+e+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+e+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},n.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},n.label=function(){return this.localize("Caption Settings Dialog")},n.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},n.buildCSSClass=function(){return e.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},n.getValues=function(){var e,t,n,r=this;return t=function(e,t,n){var i,a,s=(i=r.$(t.selector),a=t.parser,as(i.options[i.options.selectedIndex].value,a));return void 0!==s&&(e[n]=s),e},void 0===(n={})&&(n=0),Ot(e=is).reduce((function(n,r){return t(n,e[r],r)}),n)},n.setValues=function(e){var t=this;Pt(is,(function(n,r){!function(e,t,n){if(t)for(var r=0;r<e.options.length;r++)if(as(e.options[r].value,n)===t){e.selectedIndex=r;break}}(t.$(n.selector),e[r],n.parser)}))},n.setDefaults=function(){var e=this;Pt(is,(function(t){var n=t.hasOwnProperty("default")?t.default:0;e.$(t.selector).selectedIndex=n}))},n.restoreSettings=function(){var e;try{e=JSON.parse(i().localStorage.getItem(za))}catch(e){Dt.warn(e)}e&&this.setValues(e)},n.saveSettings=function(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?i().localStorage.setItem(za,JSON.stringify(e)):i().localStorage.removeItem(za)}catch(e){Dt.warn(e)}}},n.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()},n.conditionalBlur_=function(){this.previouslyActiveEl_=null;var e=this.player_.controlBar,t=e&&e.subsCapsButton,n=e&&e.captionsButton;t?t.focus():n&&n.focus()},t}(Yr);Mr.registerComponent("TextTrackSettings",ss);var os=function(e){function t(t,n){var r,a=n.ResizeObserver||i().ResizeObserver;null===n.ResizeObserver&&(a=!1);var s=Dr({createEl:!a,reportTouchActivity:!1},n);return(r=e.call(this,t,s)||this).ResizeObserver=n.ResizeObserver||i().ResizeObserver,r.loadListener_=null,r.resizeObserver_=null,r.debouncedHandler_=function(e,t,n,r){var a;void 0===r&&(r=i());var s=function(){var t=this,n=arguments,i=function(){a=null,i=null,e.apply(t,n)};r.clearTimeout(a),a=r.setTimeout(i,100)};return s.cancel=function(){r.clearTimeout(a),a=null},s}((function(){r.resizeHandler()}),0,0,f(r)),a?(r.resizeObserver_=new r.ResizeObserver(r.debouncedHandler_),r.resizeObserver_.observe(t.el())):(r.loadListener_=function(){if(r.el_&&r.el_.contentWindow){var e=r.debouncedHandler_,t=r.unloadListener_=function(){ar(this,"resize",e),ar(this,"unload",t),t=null};ir(r.el_.contentWindow,"unload",t),ir(r.el_.contentWindow,"resize",e)}},r.one("load",r.loadListener_)),r}p(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})},n.resizeHandler=function(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")},n.dispose=function(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,e.prototype.dispose.call(this)},t}(Mr);Mr.registerComponent("ResizeManager",os);var us={trackingThreshold:20,liveTolerance:15},ls=function(e){function t(t,n){var r,i=Dr(us,n,{createEl:!1});return(r=e.call(this,t,i)||this).handleVisibilityChange_=function(e){return r.handleVisibilityChange(e)},r.trackLiveHandler_=function(){return r.trackLive_()},r.handlePlay_=function(e){return r.handlePlay(e)},r.handleFirstTimeupdate_=function(e){return r.handleFirstTimeupdate(e)},r.handleSeeked_=function(e){return r.handleSeeked(e)},r.seekToLiveEdge_=function(e){return r.seekToLiveEdge(e)},r.reset_(),r.on(r.player_,"durationchange",(function(e){return r.handleDurationchange(e)})),r.on(r.player_,"canplay",(function(){return r.toggleTracking()})),Jt&&"hidden"in u()&&"visibilityState"in u()&&r.on(u(),"visibilitychange",r.handleVisibilityChange_),r}p(t,e);var n=t.prototype;return n.handleVisibilityChange=function(){this.player_.duration()===1/0&&(u().hidden?this.stopTracking():this.startTracking())},n.trackLive_=function(){var e=this.player_.seekable();if(e&&e.length){var t=Number(i().performance.now().toFixed(4)),n=-1===this.lastTime_?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+n;var r=this.liveCurrentTime(),a=this.player_.currentTime(),s=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-a)>this.options_.liveTolerance;this.timeupdateSeen_&&r!==1/0||(s=!1),s!==this.behindLiveEdge_&&(this.behindLiveEdge_=s,this.trigger("liveedgechange"))}},n.handleDurationchange=function(){this.toggleTracking()},n.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},n.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,dr),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))},n.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},n.handleSeeked=function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()},n.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},n.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},n.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},n.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},n.seekableEnd=function(){for(var e=this.player_.seekable(),t=[],n=e?e.length:0;n--;)t.push(e.end(n));return t.length?t.sort()[t.length-1]:1/0},n.seekableStart=function(){for(var e=this.player_.seekable(),t=[],n=e?e.length:0;n--;)t.push(e.start(n));return t.length?t.sort()[0]:0},n.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()},n.isLive=function(){return this.isTracking()},n.atLiveEdge=function(){return!this.behindLiveEdge()},n.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},n.pastSeekEnd=function(){var e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_},n.behindLiveEdge=function(){return this.behindLiveEdge_},n.isTracking=function(){return"number"==typeof this.trackingInterval_},n.seekToLiveEdge=function(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},n.dispose=function(){this.off(u(),"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),e.prototype.dispose.call(this)},t}(Mr);Mr.registerComponent("LiveTracker",ls);var cs,ds=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var n=e.$$("source"),r=[],i="";if(!n.length)return!1;for(var a=0;a<n.length;a++){var s=n[a].src;s&&-1===r.indexOf(s)&&r.push(s)}return!!r.length&&(1===r.length&&(i=r[0]),e.triggerSourceset(i),!0)},fs=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(e){var t=u().createElement(this.nodeName.toLowerCase());t.innerHTML=e;for(var n=u().createDocumentFragment();t.childNodes.length;)n.appendChild(t.childNodes[0]);return this.innerText="",i().Element.prototype.appendChild.call(this,n),this.innerHTML}}),hs=function(e,t){for(var n={},r=0;r<e.length&&!((n=Object.getOwnPropertyDescriptor(e[r],t))&&n.set&&n.get);r++);return n.enumerable=!0,n.configurable=!0,n},ps=function(e){var t=e.el();if(!t.resetSourceWatch_){var n={},r=function(e){return hs([e.el(),i().HTMLMediaElement.prototype,i().Element.prototype,fs],"innerHTML")}(e),a=function(n){return function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var s=n.apply(t,i);return ds(e),s}};["append","appendChild","insertAdjacentHTML"].forEach((function(e){t[e]&&(n[e]=t[e],t[e]=a(n[e]))})),Object.defineProperty(t,"innerHTML",Dr(r,{set:a(r.set)})),t.resetSourceWatch_=function(){t.resetSourceWatch_=null,Object.keys(n).forEach((function(e){t[e]=n[e]})),Object.defineProperty(t,"innerHTML",r)},e.one("sourceset",t.resetSourceWatch_)}},gs=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?oi(i().Element.prototype.getAttribute.call(this,"src")):""},set:function(e){return i().Element.prototype.setAttribute.call(this,"src",e),e}}),ms=function(e,t,n,r){void 0===r&&(r=!0);var i=function(n){return Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0})},a={configurable:!0,enumerable:!0,get:function(){var e=n();return i(e),e}};return r&&(a.set=i),Object.defineProperty(e,t,a)},ys=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var i=t.source,a=!1;if(r.featuresVideoFrameCallback=r.featuresVideoFrameCallback&&"VIDEO"===r.el_.tagName,i&&(r.el_.currentSrc!==i.src||t.tag&&3===t.tag.initNetworkState_)?r.setSource(i):r.handleLateInit_(r.el_),t.enableSourceset&&r.setupSourcesetHandling_(),r.isScrubbing_=!1,r.el_.hasChildNodes()){for(var s=r.el_.childNodes,o=s.length,u=[];o--;){var l=s[o];"track"===l.nodeName.toLowerCase()&&(r.featuresNativeTextTracks?(r.remoteTextTrackEls().addTrackElement_(l),r.remoteTextTracks().addTrack(l.track),r.textTracks().addTrack(l.track),a||r.el_.hasAttribute("crossorigin")||!li(l.src)||(a=!0)):u.push(l))}for(var c=0;c<u.length;c++)r.el_.removeChild(u[c])}return r.proxyNativeTracks_(),r.featuresNativeTextTracks&&a&&Dt.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),r.restoreMetadataTracksInIOSNativePlayer_(),(nn||an||Kt)&&!0===t.nativeControlsForTouch&&r.setControls(!0),r.proxyWebkitFullscreen_(),r.triggerReady(),r}p(t,e);var n=t.prototype;return n.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),t.disposeMediaElement(this.el_),this.options_=null,e.prototype.dispose.call(this)},n.setupSourcesetHandling_=function(){!function(e){if(e.featuresSourceset){var t=e.el();if(!t.resetSourceset_){var n=function(e){return hs([e.el(),i().HTMLMediaElement.prototype,gs],"src")}(e),r=t.setAttribute,a=t.load;Object.defineProperty(t,"src",Dr(n,{set:function(r){var i=n.set.call(t,r);return e.triggerSourceset(t.src),i}})),t.setAttribute=function(n,i){var a=r.call(t,n,i);return/src/i.test(n)&&e.triggerSourceset(t.src),a},t.load=function(){var n=a.call(t);return ds(e)||(e.triggerSourceset(""),ps(e)),n},t.currentSrc?e.triggerSourceset(t.currentSrc):ds(e)||ps(e),t.resetSourceset_=function(){t.resetSourceset_=null,t.load=a,t.setAttribute=r,Object.defineProperty(t,"src",n),t.resetSourceWatch_&&t.resetSourceWatch_()}}}}(this)},n.restoreMetadataTracksInIOSNativePlayer_=function(){var e,t=this.textTracks(),n=function(){e=[];for(var n=0;n<t.length;n++){var r=t[n];"metadata"===r.kind&&e.push({track:r,storedMode:r.mode})}};n(),t.addEventListener("change",n),this.on("dispose",(function(){return t.removeEventListener("change",n)}));var r=function n(){for(var r=0;r<e.length;r++){var i=e[r];"disabled"===i.track.mode&&i.track.mode!==i.storedMode&&(i.track.mode=i.storedMode)}t.removeEventListener("change",n)};this.on("webkitbeginfullscreen",(function(){t.removeEventListener("change",n),t.removeEventListener("change",r),t.addEventListener("change",r)})),this.on("webkitendfullscreen",(function(){t.removeEventListener("change",n),t.addEventListener("change",n),t.removeEventListener("change",r)}))},n.overrideNative_=function(e,t){var n=this;if(t===this["featuresNative"+e+"Tracks"]){var r=e.toLowerCase();this[r+"TracksListeners_"]&&Object.keys(this[r+"TracksListeners_"]).forEach((function(e){n.el()[r+"Tracks"].removeEventListener(e,n[r+"TracksListeners_"][e])})),this["featuresNative"+e+"Tracks"]=!t,this[r+"TracksListeners_"]=null,this.proxyNativeTracksForType_(r)}},n.overrideNativeAudioTracks=function(e){this.overrideNative_("Audio",e)},n.overrideNativeVideoTracks=function(e){this.overrideNative_("Video",e)},n.proxyNativeTracksForType_=function(e){var t=this,n=yi[e],r=this.el()[n.getterName],i=this[n.getterName]();if(this["featuresNative"+n.capitalName+"Tracks"]&&r&&r.addEventListener){var a={change:function(n){var r={type:"change",target:i,currentTarget:i,srcElement:i};i.trigger(r),"text"===e&&t[vi.remoteText.getterName]().trigger(r)},addtrack:function(e){i.addTrack(e.track)},removetrack:function(e){i.removeTrack(e.track)}},s=function(){for(var e=[],t=0;t<i.length;t++){for(var n=!1,a=0;a<r.length;a++)if(r[a]===i[t]){n=!0;break}n||e.push(i[t])}for(;e.length;)i.removeTrack(e.shift())};this[n.getterName+"Listeners_"]=a,Object.keys(a).forEach((function(e){var n=a[e];r.addEventListener(e,n),t.on("dispose",(function(t){return r.removeEventListener(e,n)}))})),this.on("loadstart",s),this.on("dispose",(function(e){return t.off("loadstart",s)}))}},n.proxyNativeTracks_=function(){var e=this;yi.names.forEach((function(t){e.proxyNativeTracksForType_(t)}))},n.createEl=function(){var e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){var n=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(n,e),t.disposeMediaElement(e),e=n}else{e=u().createElement("video");var r=Dr({},this.options_.tag&&Sn(this.options_.tag));nn&&!0===this.options_.nativeControlsForTouch||delete r.controls,En(e,Mt(r,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}void 0!==this.options_.preload&&An(e,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);for(var i=["loop","muted","playsinline","autoplay"],a=0;a<i.length;a++){var s=i[a],o=this.options_[s];void 0!==o&&(o?An(e,s,s):In(e,s),e[s]=o)}return e},n.handleLateInit_=function(e){if(0!==e.networkState&&3!==e.networkState){if(0===e.readyState){var t=!1,n=function(){t=!0};this.on("loadstart",n);var r=function(){t||this.trigger("loadstart")};return this.on("loadedmetadata",r),void this.ready((function(){this.off("loadstart",n),this.off("loadedmetadata",r),t||this.trigger("loadstart")}))}var i=["loadstart"];i.push("loadedmetadata"),e.readyState>=2&&i.push("loadeddata"),e.readyState>=3&&i.push("canplay"),e.readyState>=4&&i.push("canplaythrough"),this.ready((function(){i.forEach((function(e){this.trigger(e)}),this)}))}},n.setScrubbing=function(e){this.isScrubbing_=e},n.scrubbing=function(){return this.isScrubbing_},n.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&on?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){Dt(e,"Video is not ready. (Video.js)")}},n.duration=function(){var e=this;return this.el_.duration===1/0&&zt&&$t&&0===this.el_.currentTime?(this.on("timeupdate",(function t(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",t))})),NaN):this.el_.duration||NaN},n.width=function(){return this.el_.offsetWidth},n.height=function(){return this.el_.offsetHeight},n.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var t=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},n=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",t),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",n),this.on("dispose",(function(){e.off("webkitbeginfullscreen",n),e.off("webkitendfullscreen",t)}))}},n.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var e=i().navigator&&i().navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},n.enterFullScreen=function(){var e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)Hr(this.el_.play()),this.setTimeout((function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}),0);else try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}},n.exitFullScreen=function(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))},n.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},n.requestVideoFrameCallback=function(t){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(t):e.prototype.requestVideoFrameCallback.call(this,t)},n.cancelVideoFrameCallback=function(t){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(t):e.prototype.cancelVideoFrameCallback.call(this,t)},n.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},n.reset=function(){t.resetMediaElement(this.el_)},n.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},n.setControls=function(e){this.el_.controls=!!e},n.addTextTrack=function(t,n,r){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,n,r):e.prototype.addTextTrack.call(this,t,n,r)},n.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t);var n=u().createElement("track");return t.kind&&(n.kind=t.kind),t.label&&(n.label=t.label),(t.language||t.srclang)&&(n.srclang=t.language||t.srclang),t.default&&(n.default=t.default),t.id&&(n.id=t.id),t.src&&(n.src=t.src),n},n.addRemoteTextTrack=function(t,n){var r=e.prototype.addRemoteTextTrack.call(this,t,n);return this.featuresNativeTextTracks&&this.el().appendChild(r),r},n.removeRemoteTextTrack=function(t){if(e.prototype.removeRemoteTextTrack.call(this,t),this.featuresNativeTextTracks)for(var n=this.$$("track"),r=n.length;r--;)t!==n[r]&&t!==n[r].track||this.el().removeChild(n[r])},n.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),i().performance&&"function"==typeof i().performance.now?e.creationTime=i().performance.now():i().performance&&i().performance.timing&&"number"==typeof i().performance.timing.navigationStart&&(e.creationTime=i().Date.now()-i().performance.timing.navigationStart),e},t}(Ti);ms(ys,"TEST_VID",(function(){if(dn()){var e=u().createElement("video"),t=u().createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e}})),ys.isSupported=function(){try{ys.TEST_VID.volume=.5}catch(e){return!1}return!(!ys.TEST_VID||!ys.TEST_VID.canPlayType)},ys.canPlayType=function(e){return ys.TEST_VID.canPlayType(e)},ys.canPlaySource=function(e,t){return ys.canPlayType(e.type)},ys.canControlVolume=function(){try{var e=ys.TEST_VID.volume;ys.TEST_VID.volume=e/2+.1;var t=e!==ys.TEST_VID.volume;return t&&sn?(i().setTimeout((function(){ys&&ys.prototype&&(ys.prototype.featuresVolumeControl=e!==ys.TEST_VID.volume)})),!1):t}catch(e){return!1}},ys.canMuteVolume=function(){try{var e=ys.TEST_VID.muted;return ys.TEST_VID.muted=!e,ys.TEST_VID.muted?An(ys.TEST_VID,"muted","muted"):In(ys.TEST_VID,"muted"),e!==ys.TEST_VID.muted}catch(e){return!1}},ys.canControlPlaybackRate=function(){if(zt&&$t&&Qt<58)return!1;try{var e=ys.TEST_VID.playbackRate;return ys.TEST_VID.playbackRate=e/2+.1,e!==ys.TEST_VID.playbackRate}catch(e){return!1}},ys.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(u().createElement("video"),"src",{get:e,set:e}),Object.defineProperty(u().createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(u().createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(u().createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},ys.supportsNativeTextTracks=function(){return on||sn&&$t},ys.supportsNativeVideoTracks=function(){return!(!ys.TEST_VID||!ys.TEST_VID.videoTracks)},ys.supportsNativeAudioTracks=function(){return!(!ys.TEST_VID||!ys.TEST_VID.audioTracks)},ys.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach((function(e){var t=e[0],n=e[1];ms(ys.prototype,t,(function(){return ys[n]()}),!0)})),ys.prototype.featuresVolumeControl=ys.canControlVolume(),ys.prototype.movingMediaElementInDOM=!sn,ys.prototype.featuresFullscreenResize=!0,ys.prototype.featuresProgressEvents=!0,ys.prototype.featuresTimeupdateEvents=!0,ys.prototype.featuresVideoFrameCallback=!(!ys.TEST_VID||!ys.TEST_VID.requestVideoFrameCallback),ys.patchCanPlayType=function(){Zt>=4&&!Wt&&!$t&&(cs=ys.TEST_VID&&ys.TEST_VID.constructor.prototype.canPlayType,ys.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(e)?"maybe":cs.call(this,e)})},ys.unpatchCanPlayType=function(){var e=ys.TEST_VID.constructor.prototype.canPlayType;return cs&&(ys.TEST_VID.constructor.prototype.canPlayType=cs),e},ys.patchCanPlayType(),ys.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},ys.resetMediaElement=function(e){if(e){for(var t=e.querySelectorAll("source"),n=t.length;n--;)e.removeChild(t[n]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(e){ys.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){ys.prototype["set"+Rr(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}})),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach((function(e){ys.prototype[e]=function(){return this.el_[e]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach((function(e){ys.prototype["set"+Rr(e)]=function(t){this.el_[e]=t}})),["pause","load","play"].forEach((function(e){ys.prototype[e]=function(){return this.el_[e]()}})),Ti.withSourceHandlers(ys),ys.nativeSourceHandler={},ys.nativeSourceHandler.canPlayType=function(e){try{return ys.TEST_VID.canPlayType(e)}catch(e){return""}},ys.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return ys.nativeSourceHandler.canPlayType(e.type);if(e.src){var n=ui(e.src);return ys.nativeSourceHandler.canPlayType("video/"+n)}return""},ys.nativeSourceHandler.handleSource=function(e,t,n){t.setSrc(e.src)},ys.nativeSourceHandler.dispose=function(){},ys.registerSourceHandler(ys.nativeSourceHandler),Ti.registerTech("Html5",ys);var vs=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],_s={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Ts=["tiny","xsmall","small","medium","large","xlarge","huge"],bs={};Ts.forEach((function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;bs[e]="vjs-layout-"+t}));var Es={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Ss=function(e){function t(n,r,i){var a;if(n.id=n.id||r.id||"vjs_video_"+Xn(),(r=Mt(t.getTagSettings(n),r)).initChildren=!1,r.createEl=!1,r.evented=!1,r.reportTouchActivity=!1,!r.language)if("function"==typeof n.closest){var s=n.closest("[lang]");s&&s.getAttribute&&(r.language=s.getAttribute("lang"))}else for(var o=n;o&&1===o.nodeType;){if(Sn(o).hasOwnProperty("lang")){r.language=o.getAttribute("lang");break}o=o.parentNode}if((a=e.call(this,null,r,i)||this).boundDocumentFullscreenChange_=function(e){return a.documentFullscreenChange_(e)},a.boundFullWindowOnEscKey_=function(e){return a.fullWindowOnEscKey(e)},a.boundUpdateStyleEl_=function(e){return a.updateStyleEl_(e)},a.boundApplyInitTime_=function(e){return a.applyInitTime_(e)},a.boundUpdateCurrentBreakpoint_=function(e){return a.updateCurrentBreakpoint_(e)},a.boundHandleTechClick_=function(e){return a.handleTechClick_(e)},a.boundHandleTechDoubleClick_=function(e){return a.handleTechDoubleClick_(e)},a.boundHandleTechTouchStart_=function(e){return a.handleTechTouchStart_(e)},a.boundHandleTechTouchMove_=function(e){return a.handleTechTouchMove_(e)},a.boundHandleTechTouchEnd_=function(e){return a.handleTechTouchEnd_(e)},a.boundHandleTechTap_=function(e){return a.handleTechTap_(e)},a.isFullscreen_=!1,a.log=xt(a.id_),a.fsApi_=St,a.isPosterFromTech_=!1,a.queuedCallbacks_=[],a.isReady_=!1,a.hasStarted_=!1,a.userActive_=!1,a.debugEnabled_=!1,a.audioOnlyMode_=!1,a.audioPosterMode_=!1,a.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!a.options_||!a.options_.techOrder||!a.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(a.tag=n,a.tagAttributes=n&&Sn(n),a.language(a.options_.language),r.languages){var l={};Object.getOwnPropertyNames(r.languages).forEach((function(e){l[e.toLowerCase()]=r.languages[e]})),a.languages_=l}else a.languages_=t.prototype.options_.languages;a.resetCache_(),a.poster_=r.poster||"",a.controls_=!!r.controls,n.controls=!1,n.removeAttribute("controls"),a.changingSrc_=!1,a.playCallbacks_=[],a.playTerminatedQueue_=[],n.hasAttribute("autoplay")?a.autoplay(!0):a.autoplay(a.options_.autoplay),r.plugins&&Object.keys(r.plugins).forEach((function(e){if("function"!=typeof a[e])throw new Error('plugin "'+e+'" does not exist')})),a.scrubbing_=!1,a.el_=a.createEl(),wr(f(a),{eventBusKey:"el_"}),a.fsApi_.requestFullscreen&&(ir(u(),a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_),a.on(a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_)),a.fluid_&&a.on(["playerreset","resize"],a.boundUpdateStyleEl_);var c=Dr(a.options_);r.plugins&&Object.keys(r.plugins).forEach((function(e){a[e](r.plugins[e])})),r.debug&&a.debug(!0),a.options_.playerOptions=c,a.middleware_=[],a.playbackRates(r.playbackRates),a.initChildren(),a.isAudio("audio"===n.nodeName.toLowerCase()),a.controls()?a.addClass("vjs-controls-enabled"):a.addClass("vjs-controls-disabled"),a.el_.setAttribute("role","region"),a.isAudio()?a.el_.setAttribute("aria-label",a.localize("Audio Player")):a.el_.setAttribute("aria-label",a.localize("Video Player")),a.isAudio()&&a.addClass("vjs-audio"),a.flexNotSupported_()&&a.addClass("vjs-no-flex"),nn&&a.addClass("vjs-touch-enabled"),sn||a.addClass("vjs-workinghover"),t.players[a.id_]=f(a);var d=_t.split(".")[0];return a.addClass("vjs-v"+d),a.userActive(!0),a.reportUserActivity(),a.one("play",(function(e){return a.listenForUserActivity_(e)})),a.on("stageclick",(function(e){return a.handleStageClick_(e)})),a.on("keydown",(function(e){return a.handleKeyDown(e)})),a.on("languagechange",(function(e){return a.handleLanguagechange(e)})),a.breakpoints(a.options_.breakpoints),a.responsive(a.options_.responsive),a.on("ready",(function(){a.audioPosterMode(a.options_.audioPosterMode),a.audioOnlyMode(a.options_.audioOnlyMode)})),a}p(t,e);var n=t.prototype;return n.dispose=function(){var n=this;this.trigger("dispose"),this.off("dispose"),ar(u(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),ar(u(),"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),t.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),Ei[this.id()]=null,_i.names.forEach((function(e){var t=_i[e],r=n[t.getterName]();r&&r.off&&r.off()})),e.prototype.dispose.call(this,{restoreEl:this.options_.restoreEl})},n.createEl=function(){var t,n=this.tag,r=this.playerElIngest_=n.parentNode&&n.parentNode.hasAttribute&&n.parentNode.hasAttribute("data-vjs-player"),a="video-js"===this.tag.tagName.toLowerCase();r?t=this.el_=n.parentNode:a||(t=this.el_=e.prototype.createEl.call(this,"div"));var s=Sn(n);if(a){for(t=this.el_=n,n=this.tag=u().createElement("video");t.children.length;)n.appendChild(t.firstChild);vn(t,"video-js")||_n(t,"video-js"),t.appendChild(n),r=this.playerElIngest_=t,Object.keys(t).forEach((function(e){try{n[e]=t[e]}catch(e){}}))}if(n.setAttribute("tabindex","-1"),s.tabindex="-1",(Jt||$t&&tn)&&(n.setAttribute("role","application"),s.role="application"),n.removeAttribute("width"),n.removeAttribute("height"),"width"in s&&delete s.width,"height"in s&&delete s.height,Object.getOwnPropertyNames(s).forEach((function(e){a&&"class"===e||t.setAttribute(e,s[e]),a&&n.setAttribute(e,s[e])})),n.playerId=n.id,n.id+="_html5_api",n.className="vjs-tech",n.player=t.player=this,this.addClass("vjs-paused"),!0!==i().VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=Zn("vjs-styles-dimensions");var o=Bn(".vjs-styles-defaults"),l=Bn("head");l.insertBefore(this.styleEl_,o?o.nextSibling:l.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var c=n.getElementsByTagName("a"),d=0;d<c.length;d++){var f=c.item(d);_n(f,"vjs-hidden"),f.setAttribute("hidden","hidden")}return n.initNetworkState_=n.networkState,n.parentNode&&!r&&n.parentNode.insertBefore(t,n),yn(n,t),this.children_.unshift(n),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=t,t},n.crossOrigin=function(e){if(!e)return this.techGet_("crossOrigin");"anonymous"===e||"use-credentials"===e?this.techCall_("setCrossOrigin",e):Dt.warn('crossOrigin must be "anonymous" or "use-credentials", given "'+e+'"')},n.width=function(e){return this.dimension("width",e)},n.height=function(e){return this.dimension("height",e)},n.dimension=function(e,t){var n=e+"_";if(void 0===t)return this[n]||0;if(""===t||"auto"===t)return this[n]=void 0,void this.updateStyleEl_();var r=parseFloat(t);isNaN(r)?Dt.error('Improper value "'+t+'" supplied for for '+e):(this[n]=r,this.updateStyleEl_())},n.fluid=function(e){var t,n,r=this;if(void 0===e)return!!this.fluid_;this.fluid_=!!e,mr(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),n=function(){r.on(["playerreset","resize"],r.boundUpdateStyleEl_)},mr(t=this)?n():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(n))):this.removeClass("vjs-fluid"),this.updateStyleEl_()},n.fill=function(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},n.aspectRatio=function(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()},n.updateStyleEl_=function(){if(!0!==i().VIDEOJS_NO_DYNAMIC_STYLE){var e,t,n,r=(void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),a=r[1]/r[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/a:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*a,n=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(n),Kn(this.styleEl_,"\n ."+n+" {\n width: "+e+"px;\n height: "+t+"px;\n }\n\n ."+n+".vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: "+100*a+"%;\n }\n ")}else{var s="number"==typeof this.width_?this.width_:this.options_.width,o="number"==typeof this.height_?this.height_:this.options_.height,u=this.tech_&&this.tech_.el();u&&(s>=0&&(u.width=s),o>=0&&(u.height=o))}},n.loadTech_=function(e,t){var n=this;this.tech_&&this.unloadTech_();var r=Rr(e),i=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==r&&this.tag&&(Ti.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=r,this.isReady_=!1;var a=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(a=!1);var s={source:t,autoplay:a,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+i+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};_i.names.forEach((function(e){var t=_i[e];s[t.getterName]=n[t.privateName]})),Mt(s,this.options_[r]),Mt(s,this.options_[i]),Mt(s,this.options_[e.toLowerCase()]),this.tag&&(s.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(s.startTime=this.cache_.currentTime);var o,u,l=Ti.getTech(e);if(!l)throw new Error("No Tech named '"+r+"' exists! '"+r+"' should be registered using videojs.registerTech()'");this.tech_=new l(s),this.tech_.ready(fr(this,this.handleTechReady_),!0),o=this.textTracksJson_||[],u=this.tech_,o.forEach((function(e){var t=u.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach((function(e){return t.addCue(e)}))})),u.textTracks(),vs.forEach((function(e){n.on(n.tech_,e,(function(t){return n["handleTech"+Rr(e)+"_"](t)}))})),Object.keys(_s).forEach((function(e){n.on(n.tech_,e,(function(t){0===n.tech_.playbackRate()&&n.tech_.seeking()?n.queuedCallbacks_.push({callback:n["handleTech"+_s[e]+"_"].bind(n),event:t}):n["handleTech"+_s[e]+"_"](t)}))})),this.on(this.tech_,"loadstart",(function(e){return n.handleTechLoadStart_(e)})),this.on(this.tech_,"sourceset",(function(e){return n.handleTechSourceset_(e)})),this.on(this.tech_,"waiting",(function(e){return n.handleTechWaiting_(e)})),this.on(this.tech_,"ended",(function(e){return n.handleTechEnded_(e)})),this.on(this.tech_,"seeking",(function(e){return n.handleTechSeeking_(e)})),this.on(this.tech_,"play",(function(e){return n.handleTechPlay_(e)})),this.on(this.tech_,"firstplay",(function(e){return n.handleTechFirstPlay_(e)})),this.on(this.tech_,"pause",(function(e){return n.handleTechPause_(e)})),this.on(this.tech_,"durationchange",(function(e){return n.handleTechDurationChange_(e)})),this.on(this.tech_,"fullscreenchange",(function(e,t){return n.handleTechFullscreenChange_(e,t)})),this.on(this.tech_,"fullscreenerror",(function(e,t){return n.handleTechFullscreenError_(e,t)})),this.on(this.tech_,"enterpictureinpicture",(function(e){return n.handleTechEnterPictureInPicture_(e)})),this.on(this.tech_,"leavepictureinpicture",(function(e){return n.handleTechLeavePictureInPicture_(e)})),this.on(this.tech_,"error",(function(e){return n.handleTechError_(e)})),this.on(this.tech_,"posterchange",(function(e){return n.handleTechPosterChange_(e)})),this.on(this.tech_,"textdata",(function(e){return n.handleTechTextData_(e)})),this.on(this.tech_,"ratechange",(function(e){return n.handleTechRateChange_(e)})),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===r&&this.tag||yn(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},n.unloadTech_=function(){var e,t,n,r=this;_i.names.forEach((function(e){var t=_i[e];r[t.privateName]=r[t.getterName]()})),this.textTracksJson_=(e=this.tech_,t=e.$$("track"),n=Array.prototype.map.call(t,(function(e){return e.track})),Array.prototype.map.call(t,(function(e){var t=Gr(e.track);return e.src&&(t.src=e.src),t})).concat(Array.prototype.filter.call(e.textTracks(),(function(e){return-1===n.indexOf(e)})).map(Gr))),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},n.tech=function(e){return void 0===e&&Dt.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_},n.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},n.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},n.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},n.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())},n.manualAutoplay_=function(e){var t=this;if(this.tech_&&"string"==typeof e){var n,r=function(){var e=t.muted();t.muted(!0);var n=function(){t.muted(e)};t.playTerminatedQueue_.push(n);var r=t.play();if(qr(r))return r.catch((function(e){throw n(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(e||""))}))};if("any"!==e||this.muted()?n="muted"!==e||this.muted()?this.play():r():qr(n=this.play())&&(n=n.catch(r)),qr(n))return n.then((function(){t.trigger({type:"autoplay-success",autoplay:e})})).catch((function(){t.trigger({type:"autoplay-failure",autoplay:e})}))}},n.updateSourceCaches_=function(e){void 0===e&&(e="");var t=e,n="";"string"!=typeof t&&(t=e.src,n=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!n&&(n=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var n=e.cache_.sources.filter((function(e){return e.src===t}));if(n.length)return n[0].type;for(var r=e.$$("source"),i=0;i<r.length;i++){var a=r[i];if(a.type&&a.src&&a.src===t)return a.type}return Oi(t)}(this,t)),this.cache_.source=Dr({},e,{src:t,type:n});for(var r=this.cache_.sources.filter((function(e){return e.src&&e.src===t})),i=[],a=this.$$("source"),s=[],o=0;o<a.length;o++){var u=Sn(a[o]);i.push(u),u.src&&u.src===t&&s.push(u.src)}s.length&&!r.length?this.cache_.sources=i:r.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t},n.handleTechSourceset_=function(e){var t=this;if(!this.changingSrc_){var n=function(e){return t.updateSourceCaches_(e)},r=this.currentSource().src,i=e.src;r&&!/^blob:/.test(r)&&/^blob:/.test(i)&&(!this.lastSource_||this.lastSource_.tech!==i&&this.lastSource_.player!==r)&&(n=function(){}),n(i),e.src||this.tech_.any(["sourceset","loadstart"],(function(e){if("sourceset"!==e.type){var n=t.techGet("currentSrc");t.lastSource_.tech=n,t.updateSourceCaches_(n)}}))}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})},n.hasStarted=function(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},n.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},n.handleTechRateChange_=function(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach((function(e){return e.callback(e.event)})),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},n.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var t=this.currentTime();this.on("timeupdate",(function n(){t!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",n))}))},n.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},n.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},n.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},n.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},n.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},n.handleTechFirstPlay_=function(){this.options_.starttime&&(Dt.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},n.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},n.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},n.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},n.handleTechClick_=function(e){this.controls_&&(void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.click&&!1===this.options_.userActions.click||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?Hr(this.play()):this.pause()))},n.handleTechDoubleClick_=function(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),(function(t){return t.contains(e.target)}))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},n.handleTechTap_=function(){this.userActive(!this.userActive())},n.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},n.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},n.handleTechTouchEnd_=function(e){e.cancelable&&e.preventDefault()},n.handleStageClick_=function(){this.reportUserActivity()},n.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},n.documentFullscreenChange_=function(e){var t=e.target.player;if(!t||t===this){var n=this.el(),r=u()[this.fsApi_.fullscreenElement]===n;!r&&n.matches?r=n.matches(":"+this.fsApi_.fullscreen):!r&&n.msMatchesSelector&&(r=n.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}},n.handleTechFullscreenChange_=function(e,t){var n=this;t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",(function(){n.removeClass("vjs-ios-native-fs")}))),this.isFullscreen(t.isFullscreen))},n.handleTechFullscreenError_=function(e,t){this.trigger("fullscreenerror",t)},n.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},n.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)},n.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)},n.handleTechError_=function(){var e=this.tech_.error();this.error(e)},n.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},n.getCache=function(){return this.cache_},n.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},n.techCall_=function(e,t){this.ready((function(){if(e in Ci)return function(e,t,n,r){return t[n](e.reduce(Di(n),r))}(this.middleware_,this.tech_,e,t);if(e in Ri)return Ai(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw Dt(e),e}}),!0)},n.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in Ii)return function(e,t,n){return e.reduceRight(Di(n),t[n]())}(this.middleware_,this.tech_,e);if(e in Ri)return Ai(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw Dt("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",t),t;if("TypeError"===t.name)throw Dt("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",t),this.tech_.isReady_=!1,t;throw Dt(t),t}}},n.play=function(){var e=this,t=this.options_.Promise||i().Promise;return t?new t((function(t){e.play_(t)})):this.play_()},n.play_=function(e){var t=this;void 0===e&&(e=Hr),this.playCallbacks_.push(e);var n=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc())),r=Boolean(on||sn);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!n)return this.waitToPlay_=function(e){t.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!n&&r&&this.load());var i=this.techGet_("play");r&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),null===i?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(i)},n.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach((function(e){e()}))},n.runPlayCallbacks_=function(e){var t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach((function(t){t(e)}))},n.pause=function(){this.techCall_("pause")},n.paused=function(){return!1!==this.techGet_("paused")},n.played=function(){return this.techGet_("played")||Fr(0,0)},n.scrubbing=function(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},n.currentTime=function(e){return void 0!==e?(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),void(this.cache_.initTime=0)):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},n.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},n.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))},n.remainingTime=function(){return this.duration()-this.currentTime()},n.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},n.buffered=function(){var e=this.techGet_("buffered");return e&&e.length||(e=Fr(0,0)),e},n.bufferedPercent=function(){return Ur(this.buffered(),this.duration())},n.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),n=e.end(e.length-1);return n>t&&(n=t),n},n.volume=function(e){var t;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)},n.muted=function(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)},n.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},n.lastVolume_=function(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e},n.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},n.isFullscreen=function(e){if(void 0!==e){var t=this.isFullscreen_;return this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_},n.requestFullscreen=function(e){var t=this.options_.Promise||i().Promise;if(t){var n=this;return new t((function(t,r){function i(){n.off("fullscreenerror",s),n.off("fullscreenchange",a)}function a(){i(),t()}function s(e,t){i(),r(t)}n.one("fullscreenchange",a),n.one("fullscreenerror",s);var o=n.requestFullscreenHelper_(e);o&&(o.then(i,i),o.then(t,r))}))}return this.requestFullscreenHelper_()},n.requestFullscreenHelper_=function(e){var t,n=this;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen){var r=this.el_[this.fsApi_.requestFullscreen](t);return r&&r.then((function(){return n.isFullscreen(!0)}),(function(){return n.isFullscreen(!1)})),r}this.tech_.supportsFullScreen()&&1==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},n.exitFullscreen=function(){var e=this.options_.Promise||i().Promise;if(e){var t=this;return new e((function(e,n){function r(){t.off("fullscreenerror",a),t.off("fullscreenchange",i)}function i(){r(),e()}function a(e,t){r(),n(t)}t.one("fullscreenchange",i),t.one("fullscreenerror",a);var s=t.exitFullscreenHelper_();s&&(s.then(r,r),s.then(e,n))}))}return this.exitFullscreenHelper_()},n.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var t=u()[this.fsApi_.exitFullscreen]();return t&&Hr(t.then((function(){return e.isFullscreen(!1)}))),t}this.tech_.supportsFullScreen()&&1==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},n.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=u().documentElement.style.overflow,ir(u(),"keydown",this.boundFullWindowOnEscKey_),u().documentElement.style.overflow="hidden",_n(u().body,"vjs-full-window"),this.trigger("enterFullWindow")},n.fullWindowOnEscKey=function(e){d().isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},n.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,ar(u(),"keydown",this.boundFullWindowOnEscKey_),u().documentElement.style.overflow=this.docOrigOverflow,Tn(u().body,"vjs-full-window"),this.trigger("exitFullWindow")},n.disablePictureInPicture=function(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")},n.isInPictureInPicture=function(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_},n.requestPictureInPicture=function(){if("pictureInPictureEnabled"in u()&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture")},n.exitPictureInPicture=function(){if("pictureInPictureEnabled"in u())return u().exitPictureInPicture()},n.handleKeyDown=function(e){var t,n,r=this.options_.userActions;r&&r.hotkeys&&(t=this.el_.ownerDocument.activeElement,n=t.tagName.toLowerCase(),t.isContentEditable||("input"===n?-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(t.type):-1!==["textarea"].indexOf(n))||("function"==typeof r.hotkeys?r.hotkeys.call(this,e):this.handleHotkeys(e)))},n.handleHotkeys=function(e){var t=this.options_.userActions?this.options_.userActions.hotkeys:{},n=t.fullscreenKey,r=void 0===n?function(e){return d().isEventKey(e,"f")}:n,i=t.muteKey,a=void 0===i?function(e){return d().isEventKey(e,"m")}:i,s=t.playPauseKey,o=void 0===s?function(e){return d().isEventKey(e,"k")||d().isEventKey(e,"Space")}:s;if(r.call(this,e)){e.preventDefault(),e.stopPropagation();var l=Mr.getComponent("FullscreenToggle");!1!==u()[this.fsApi_.fullscreenEnabled]&&l.prototype.handleClick.call(this,e)}else a.call(this,e)?(e.preventDefault(),e.stopPropagation(),Mr.getComponent("MuteToggle").prototype.handleClick.call(this,e)):o.call(this,e)&&(e.preventDefault(),e.stopPropagation(),Mr.getComponent("PlayToggle").prototype.handleClick.call(this,e))},n.canPlayType=function(e){for(var t,n=0,r=this.options_.techOrder;n<r.length;n++){var i=r[n],a=Ti.getTech(i);if(a||(a=Mr.getComponent(i)),a){if(a.isSupported()&&(t=a.canPlayType(e)))return t}else Dt.error('The "'+i+'" tech is undefined. Skipped browser support check for that tech.')}return""},n.selectSource=function(e){var t,n=this,r=this.options_.techOrder.map((function(e){return[e,Ti.getTech(e)]})).filter((function(e){var t=e[0],n=e[1];return n?n.isSupported():(Dt.error('The "'+t+'" tech is undefined. Skipped browser support check for that tech.'),!1)})),i=function(e,t,n){var r;return e.some((function(e){return t.some((function(t){if(r=n(e,t))return!0}))})),r},a=function(e,t){var r=e[0];if(e[1].canPlaySource(t,n.options_[r.toLowerCase()]))return{source:t,tech:r}};return(this.options_.sourceOrder?i(e,r,(t=a,function(e,n){return t(n,e)})):i(r,e,a))||!1},n.handleSrc_=function(e,t){var n=this;if(void 0===e)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();var r=Pi(e);if(r.length){if(this.changingSrc_=!0,t||(this.cache_.sources=r),this.updateSourceCaches_(r[0]),wi(this,r[0],(function(e,i){var a,s;if(n.middleware_=i,t||(n.cache_.sources=r),n.updateSourceCaches_(e),n.src_(e))return r.length>1?n.handleSrc_(r.slice(1)):(n.changingSrc_=!1,n.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0),void n.triggerReady());a=i,s=n.tech_,a.forEach((function(e){return e.setTech&&e.setTech(s)}))})),this.options_.retryOnError&&r.length>1){var i=function(){n.error(null),n.handleSrc_(r.slice(1),!0)},a=function(){n.off("error",i)};this.one("error",i),this.one("playing",a),this.resetRetryOnError_=function(){n.off("error",i),n.off("playing",a)}}}else this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0)},n.src=function(e){return this.handleSrc_(e,!1)},n.src_=function(e){var t,n,r=this,i=this.selectSource([e]);return!i||(t=i.tech,n=this.techName_,Rr(t)!==Rr(n)?(this.changingSrc_=!0,this.loadTech_(i.tech,i.source),this.tech_.ready((function(){r.changingSrc_=!1})),!1):(this.ready((function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1}),!0),!1))},n.load=function(){this.techCall_("load")},n.reset=function(){var e=this,t=this.options_.Promise||i().Promise;this.paused()||!t?this.doReset_():Hr(this.play().then((function(){return e.doReset_()})))},n.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),mr(this)&&this.trigger("playerreset")},n.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},n.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar||{},t=e.durationDisplay,n=e.remainingTimeDisplay;t&&t.updateContent(),n&&n.updateContent()},n.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},n.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},n.currentSources=function(){var e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t},n.currentSource=function(){return this.cache_.source||{}},n.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},n.currentType=function(){return this.currentSource()&&this.currentSource().type||""},n.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},n.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var t;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)},n.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},n.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},n.poster=function(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},n.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},n.controls=function(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},n.usingNativeControls=function(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},n.error=function(e){var t=this;if(void 0===e)return this.error_||null;if(bt("beforeerror").forEach((function(n){var r=n(t,e);kt(r)&&!Array.isArray(r)||"string"==typeof r||"number"==typeof r||null===r?e=r:t.log.error("please return a value that MediaError expects in beforeerror hooks")})),this.options_.suppressNotSupportedError&&e&&4===e.code){var n=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],n),void this.one("loadstart",(function(){this.off(["click","touchstart"],n)}))}if(null===e)return this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new Br(e),this.addClass("vjs-error"),Dt.error("(CODE:"+this.error_.code+" "+Br.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),bt("error").forEach((function(e){return e(t,t.error_)}))},n.reportUserActivity=function(e){this.userActivity_=!0},n.userActive=function(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",(function(e){e.stopPropagation(),e.preventDefault()})),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},n.listenForUserActivity_=function(){var e,t,n,r=fr(this,this.reportUserActivity),i=function(t){r(),this.clearInterval(e)};this.on("mousedown",(function(){r(),this.clearInterval(e),e=this.setInterval(r,250)})),this.on("mousemove",(function(e){e.screenX===t&&e.screenY===n||(t=e.screenX,n=e.screenY,r())})),this.on("mouseup",i),this.on("mouseleave",i);var a,s=this.getChild("controlBar");!s||sn||zt||(s.on("mouseenter",(function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0})),s.on("mouseleave",(function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout}))),this.on("keydown",r),this.on("keyup",r),this.setInterval((function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(a);var e=this.options_.inactivityTimeout;e<=0||(a=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),e))}}),250)},n.playbackRate=function(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)},n.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},n.isAudio=function(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e},n.enableAudioOnlyUI_=function(){var e=this;this.addClass("vjs-audio-only-mode");var t=this.children(),n=this.getChild("ControlBar"),r=n&&n.currentHeight();t.forEach((function(t){t!==n&&t.el_&&!t.hasClass("vjs-hidden")&&(t.hide(),e.audioOnlyCache_.hiddenChildren.push(t))})),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(r),this.trigger("audioonlymodechange")},n.disableAudioOnlyUI_=function(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach((function(e){return e.show()})),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")},n.audioOnlyMode=function(e){var t=this;if("boolean"!=typeof e||e===this.audioOnlyMode_)return this.audioOnlyMode_;this.audioOnlyMode_=e;var n=this.options_.Promise||i().Promise;if(n){if(e){var r=[];return this.isInPictureInPicture()&&r.push(this.exitPictureInPicture()),this.isFullscreen()&&r.push(this.exitFullscreen()),this.audioPosterMode()&&r.push(this.audioPosterMode(!1)),n.all(r).then((function(){return t.enableAudioOnlyUI_()}))}return n.resolve().then((function(){return t.disableAudioOnlyUI_()}))}e?(this.isInPictureInPicture()&&this.exitPictureInPicture(),this.isFullscreen()&&this.exitFullscreen(),this.enableAudioOnlyUI_()):this.disableAudioOnlyUI_()},n.enablePosterModeUI_=function(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},n.disablePosterModeUI_=function(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},n.audioPosterMode=function(e){var t=this;if("boolean"!=typeof e||e===this.audioPosterMode_)return this.audioPosterMode_;this.audioPosterMode_=e;var n=this.options_.Promise||i().Promise;return n?e?this.audioOnlyMode()?this.audioOnlyMode(!1).then((function(){t.enablePosterModeUI_()})):n.resolve().then((function(){t.enablePosterModeUI_()})):n.resolve().then((function(){t.disablePosterModeUI_()})):e?(this.audioOnlyMode()&&this.audioOnlyMode(!1),void this.enablePosterModeUI_()):void this.disablePosterModeUI_()},n.addTextTrack=function(e,t,n){if(this.tech_)return this.tech_.addTextTrack(e,t,n)},n.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)},n.removeRemoteTextTrack=function(e){void 0===e&&(e={});var t=e.track;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)},n.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},n.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},n.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},n.language=function(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),mr(this)&&this.trigger("languagechange"))},n.languages=function(){return Dr(t.prototype.options_.languages,this.languages_)},n.toJSON=function(){var e=Dr(this.options_),t=e.tracks;e.tracks=[];for(var n=0;n<t.length;n++){var r=t[n];(r=Dr(r)).player=void 0,e.tracks[n]=r}return e},n.createModal=function(e,t){var n=this;(t=t||{}).content=e||"";var r=new Yr(this,t);return this.addChild(r),r.on("dispose",(function(){n.removeChild(r)})),r.open(),r},n.updateCurrentBreakpoint_=function(){if(this.responsive())for(var e=this.currentBreakpoint(),t=this.currentWidth(),n=0;n<Ts.length;n++){var r=Ts[n];if(t<=this.breakpoints_[r]){if(e===r)return;e&&this.removeClass(bs[e]),this.addClass(bs[r]),this.breakpoint_=r;break}}},n.removeCurrentBreakpoint_=function(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)},n.breakpoints=function(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=Mt({},Es,e),this.updateCurrentBreakpoint_()),Mt(this.breakpoints_)},n.responsive=function(e){return void 0===e?this.responsive_:(e=Boolean(e))!==this.responsive_?(this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0},n.currentBreakpoint=function(){return this.breakpoint_},n.currentBreakpointClass=function(){return bs[this.breakpoint_]||""},n.loadMedia=function(e,t){var n=this;if(e&&"object"==typeof e){this.reset(),this.cache_.media=Dr(e);var r=this.cache_.media,i=r.artwork,a=r.poster,s=r.src,o=r.textTracks;!i&&a&&(this.cache_.media.artwork=[{src:a,type:Oi(a)}]),s&&this.src(s),a&&this.poster(a),Array.isArray(o)&&o.forEach((function(e){return n.addRemoteTextTrack(e,!1)})),this.ready(t)}},n.getMedia=function(){if(!this.cache_.media){var e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),(function(e){return{kind:e.kind,label:e.label,language:e.language,src:e.src}}))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:Oi(t.poster)}]),t}return Dr(this.cache_.media)},t.getTagSettings=function(e){var t={sources:[],tracks:[]},n=Sn(e),r=n["data-setup"];if(vn(e,"vjs-fill")&&(n.fill=!0),vn(e,"vjs-fluid")&&(n.fluid=!0),null!==r){var i=m()(r||"{}"),a=i[0],s=i[1];a&&Dt.error(a),Mt(n,s)}if(Mt(t,n),e.hasChildNodes())for(var o=e.childNodes,u=0,l=o.length;u<l;u++){var c=o[u],d=c.nodeName.toLowerCase();"source"===d?t.sources.push(Sn(c)):"track"===d&&t.tracks.push(Sn(c))}return t},n.flexNotSupported_=function(){var e=u().createElement("i");return!("flexBasis"in e.style||"webkitFlexBasis"in e.style||"mozFlexBasis"in e.style||"msFlexBasis"in e.style||"msFlexOrder"in e.style)},n.debug=function(e){if(void 0===e)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)},n.playbackRates=function(e){if(void 0===e)return this.cache_.playbackRates;Array.isArray(e)&&e.every((function(e){return"number"==typeof e}))&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))},t}(Mr);_i.names.forEach((function(e){var t=_i[e];Ss.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}})),Ss.prototype.crossorigin=Ss.prototype.crossOrigin,Ss.players={};var ws=i().navigator;Ss.prototype.options_={techOrder:Ti.defaultTechOrder_,html5:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:ws&&(ws.languages&&ws.languages[0]||ws.userLanguage||ws.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1},["ended","seeking","seekable","networkState","readyState"].forEach((function(e){Ss.prototype[e]=function(){return this.techGet_(e)}})),vs.forEach((function(e){Ss.prototype["handleTech"+Rr(e)+"_"]=function(){return this.trigger(e)}})),Mr.registerComponent("Player",Ss);var As="plugin",Is="activePlugins_",Cs={},Rs=function(e){return Cs.hasOwnProperty(e)},Ds=function(e){return Rs(e)?Cs[e]:void 0},xs=function(e,t){e[Is]=e[Is]||{},e[Is][t]=!0},Ns=function(e,t,n){var r=(n?"before":"")+"pluginsetup";e.trigger(r,t),e.trigger(r+":"+t.name,t)},Os=function(e,t){return t.prototype.name=e,function(){Ns(this,{name:e,plugin:t,instance:null},!0);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var a=b(t,[this].concat(r));return this[e]=function(){return a},Ns(this,a.getEventHash()),a}},Ps=function(){function e(t){if(this.constructor===e)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=t,this.log||(this.log=this.player.log.createLogger(this.name)),wr(this),delete this.trigger,Ir(this,this.constructor.defaultState),xs(t,this.name),this.dispose=this.dispose.bind(this),t.on("dispose",this.dispose)}var t=e.prototype;return t.version=function(){return this.constructor.VERSION},t.getEventHash=function(e){return void 0===e&&(e={}),e.name=this.name,e.plugin=this.constructor,e.instance=this,e},t.trigger=function(e,t){return void 0===t&&(t={}),sr(this.eventBusEl_,e,this.getEventHash(t))},t.handleStateChanged=function(e){},t.dispose=function(){var e=this.name,t=this.player;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[Is][e]=!1,this.player=this.state=null,t[e]=Os(e,Cs[e])},e.isBasic=function(t){var n="string"==typeof t?Ds(t):t;return"function"==typeof n&&!e.prototype.isPrototypeOf(n.prototype)},e.registerPlugin=function(t,n){if("string"!=typeof t)throw new Error('Illegal plugin name, "'+t+'", must be a string, was '+typeof t+".");if(Rs(t))Dt.warn('A plugin named "'+t+'" already exists. You may want to avoid re-registering plugins!');else if(Ss.prototype.hasOwnProperty(t))throw new Error('Illegal plugin name, "'+t+'", cannot share a name with an existing player method!');if("function"!=typeof n)throw new Error('Illegal plugin for "'+t+'", must be a function, was '+typeof n+".");return Cs[t]=n,t!==As&&(e.isBasic(n)?Ss.prototype[t]=function(e,t){var n=function(){Ns(this,{name:e,plugin:t,instance:null},!0);var n=t.apply(this,arguments);return xs(this,e),Ns(this,{name:e,plugin:t,instance:n}),n};return Object.keys(t).forEach((function(e){n[e]=t[e]})),n}(t,n):Ss.prototype[t]=Os(t,n)),n},e.deregisterPlugin=function(e){if(e===As)throw new Error("Cannot de-register base plugin.");Rs(e)&&(delete Cs[e],delete Ss.prototype[e])},e.getPlugins=function(e){var t;return void 0===e&&(e=Object.keys(Cs)),e.forEach((function(e){var n=Ds(e);n&&((t=t||{})[e]=n)})),t},e.getPluginVersion=function(e){var t=Ds(e);return t&&t.VERSION||""},e}();Ps.getPlugin=Ds,Ps.BASE_PLUGIN_NAME=As,Ps.registerPlugin(As,Ps),Ss.prototype.usingPlugin=function(e){return!!this[Is]&&!0===this[Is][e]},Ss.prototype.hasPlugin=function(e){return!!Rs(e)};var Ms=!1,ks=function(e){return 0===e.indexOf("#")?e.slice(1):e};function Ls(e,t,n){var r=Ls.getPlayer(e);if(r)return t&&Dt.warn('Player "'+e+'" is already initialised. Options will not be applied.'),n&&r.ready(n),r;var i="string"==typeof e?Bn("#"+ks(e)):e;if(!fn(i))throw new TypeError("The element or ID supplied is not valid. (videojs)");i.ownerDocument.defaultView&&i.ownerDocument.body.contains(i)||Dt.warn("The element supplied is not included in the DOM"),!0===(t=t||{}).restoreEl&&(t.restoreEl=(i.parentNode&&i.parentNode.hasAttribute("data-vjs-player")?i.parentNode:i).cloneNode(!0)),bt("beforesetup").forEach((function(e){var n=e(i,Dr(t));kt(n)&&!Array.isArray(n)?t=Dr(t,n):Dt.error("please return an object in beforesetup hooks")}));var a=Mr.getComponent("Player");return r=new a(i,t,n),bt("setup").forEach((function(e){return e(r)})),r}if(Ls.hooks_=Tt,Ls.hooks=bt,Ls.hook=function(e,t){bt(e,t)},Ls.hookOnce=function(e,t){bt(e,[].concat(t).map((function(t){return function n(){return Et(e,n),t.apply(void 0,arguments)}})))},Ls.removeHook=Et,!0!==i().VIDEOJS_NO_DYNAMIC_STYLE&&dn()){var Fs=Bn(".vjs-styles-defaults");if(!Fs){Fs=Zn("vjs-styles-defaults");var Us=Bn("head");Us&&Us.insertBefore(Fs,Us.firstChild),Kn(Fs,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: 56.25%\n }\n ")}}Vn(1,Ls),Ls.VERSION=_t,Ls.options=Ss.prototype.options_,Ls.getPlayers=function(){return Ss.players},Ls.getPlayer=function(e){var t,n=Ss.players;if("string"==typeof e){var r=ks(e),i=n[r];if(i)return i;t=Bn("#"+r)}else t=e;if(fn(t)){var a=t,s=a.player,o=a.playerId;if(s||n[o])return s||n[o]}},Ls.getAllPlayers=function(){return Object.keys(Ss.players).map((function(e){return Ss.players[e]})).filter(Boolean)},Ls.players=Ss.players,Ls.getComponent=Mr.getComponent,Ls.registerComponent=function(e,t){Ti.isTech(t)&&Dt.warn("The "+e+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),Mr.registerComponent.call(Mr,e,t)},Ls.getTech=Ti.getTech,Ls.registerTech=Ti.registerTech,Ls.use=function(e,t){bi[e]=bi[e]||[],bi[e].push(t)},Object.defineProperty(Ls,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(Ls.middleware,"TERMINATOR",{value:Si,writeable:!1,enumerable:!0}),Ls.browser=un,Ls.TOUCH_ENABLED=nn,Ls.extend=function(e,t){void 0===t&&(t={}),Ms||(Dt.warn("videojs.extend is deprecated as of Video.js 7.22.0 and will be removed in Video.js 8.0.0"),Ms=!0);var n=function(){e.apply(this,arguments)},r={};for(var i in"object"==typeof t?(t.constructor!==Object.prototype.constructor&&(n=t.constructor),r=t):"function"==typeof t&&(n=t),function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(n,e),e&&(n.super_=e),r)r.hasOwnProperty(i)&&(n.prototype[i]=r[i]);return n},Ls.mergeOptions=Dr,Ls.bind=fr,Ls.registerPlugin=Ps.registerPlugin,Ls.deregisterPlugin=Ps.deregisterPlugin,Ls.plugin=function(e,t){return Dt.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Ps.registerPlugin(e,t)},Ls.getPlugins=Ps.getPlugins,Ls.getPlugin=Ps.getPlugin,Ls.getPluginVersion=Ps.getPluginVersion,Ls.addLanguage=function(e,t){var n;return e=(""+e).toLowerCase(),Ls.options.languages=Dr(Ls.options.languages,((n={})[e]=t,n)),Ls.options.languages[e]},Ls.log=Dt,Ls.createLogger=xt,Ls.createTimeRange=Ls.createTimeRanges=Fr,Ls.formatTime=Xi,Ls.setFormatTime=function(e){Wi=e},Ls.resetFormatTime=function(){Wi=Ki},Ls.parseUrl=si,Ls.isCrossOrigin=li,Ls.EventTarget=pr,Ls.on=ir,Ls.one=or,Ls.off=ar,Ls.trigger=sr,Ls.xhr=v(),Ls.TextTrack=hi,Ls.AudioTrack=pi,Ls.VideoTrack=gi,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((function(e){Ls[e]=function(){return Dt.warn("videojs."+e+"() is deprecated; use videojs.dom."+e+"() instead"),qn[e].apply(null,arguments)}})),Ls.computedStyle=Ft,Ls.dom=qn,Ls.url=ci,Ls.defineLazyProperty=ms,Ls.addLanguage("en",{"Non-Fullscreen":"Exit Fullscreen"});var Bs=w,js=function(e,t,n){return e&&n&&n.responseURL&&t!==n.responseURL?n.responseURL:t},qs=function(e){return Ls.log.debug?Ls.log.debug.bind(Ls,"VHS:",e+" >"):function(){}},Hs=1/30,Gs=.1,Vs=function(e,t){var n,r=[];if(e&&e.length)for(n=0;n<e.length;n++)t(e.start(n),e.end(n))&&r.push([e.start(n),e.end(n)]);return Ls.createTimeRanges(r)},Ys=function(e,t){return Vs(e,(function(e,n){return e-Gs<=t&&n+Gs>=t}))},zs=function(e,t){return Vs(e,(function(e){return e-Hs>=t}))},Zs=function(e){var t=[];if(!e||!e.length)return"";for(var n=0;n<e.length;n++)t.push(e.start(n)+" => "+e.end(n));return t.join(", ")},Ks=function(e){for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t},Ws=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},Xs=function(e,t){var n=0;if(!e||!e.length)return n;for(var r=0;r<e.length;r++){var i=e.start(r),a=e.end(r);t>a||(n+=t>i&&t<=a?a-t:a-i)}return n},$s=Ls.createTimeRange,Qs=function(e,t){if(!t.preload)return t.duration;var n=0;return(t.parts||[]).forEach((function(e){n+=e.duration})),(t.preloadHints||[]).forEach((function(t){"PART"===t.type&&(n+=e.partTargetDuration)})),n},Js=function(e){return(e.segments||[]).reduce((function(e,t,n){return t.parts?t.parts.forEach((function(r,i){e.push({duration:r.duration,segmentIndex:n,partIndex:i,part:r,segment:t})})):e.push({duration:t.duration,segmentIndex:n,partIndex:null,segment:t,part:null}),e}),[])},eo=function(e){var t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},to=function(e){var t=e.preloadSegment;if(t){var n=t.parts;return(t.preloadHints||[]).reduce((function(e,t){return e+("PART"===t.type?1:0)}),0)+(n&&n.length?n.length:0)}},no=function(e,t){if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;var n=eo(t).length>0;return n&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:n&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},ro=function(e,t,n){if(void 0===t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;var r=function(e,t){var n=0,r=t-e.mediaSequence,i=e.segments[r];if(i){if(void 0!==i.start)return{result:i.start,precise:!0};if(void 0!==i.end)return{result:i.end-i.duration,precise:!0}}for(;r--;){if(void 0!==(i=e.segments[r]).end)return{result:n+i.end,precise:!0};if(n+=Qs(e,i),void 0!==i.start)return{result:n+i.start,precise:!0}}return{result:n,precise:!1}}(e,t);if(r.precise)return r.result;var i=function(e,t){for(var n,r=0,i=t-e.mediaSequence;i<e.segments.length;i++){if(void 0!==(n=e.segments[i]).start)return{result:n.start-r,precise:!0};if(r+=Qs(e,n),void 0!==n.end)return{result:n.end-r,precise:!0}}return{result:-1,precise:!1}}(e,t);return i.precise?i.result:r.result+n},io=function(e,t,n){if(!e)return 0;if("number"!=typeof n&&(n=0),void 0===t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return i()[1/0]}return ro(e,t,n)},ao=function(e){var t=e.defaultDuration,n=e.durationList,r=e.startIndex,i=e.endIndex,a=0;if(r>i){var s=[i,r];r=s[0],i=s[1]}if(r<0){for(var o=r;o<Math.min(0,i);o++)a+=t;r=0}for(var u=r;u<i;u++)a+=n[u].duration;return a},so=function(e,t,n,r){if(!e||!e.segments)return null;if(e.endList)return io(e);if(null===t)return null;t=t||0;var i=ro(e,e.mediaSequence+e.segments.length,t);return n&&(i-=r="number"==typeof r?r:no(null,e)),Math.max(0,i)},oo=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},uo=function(e){return e.excludeUntil&&e.excludeUntil===1/0},lo=function(e){var t=oo(e);return!e.disabled&&!t},co=function(e,t){return t.attributes&&t.attributes[e]},fo=function(e,t){if(1===e.playlists.length)return!0;var n=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((function(e){return!!lo(e)&&(e.attributes.BANDWIDTH||0)<n})).length},ho=function(e,t){return!(!e&&!t||!e&&t||e&&!t||e!==t&&(!e.id||!t.id||e.id!==t.id)&&(!e.resolvedUri||!t.resolvedUri||e.resolvedUri!==t.resolvedUri)&&(!e.uri||!t.uri||e.uri!==t.uri))},po=function(e,t){var n=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{},r=!1;for(var i in n){for(var a in n[i])if(r=t(n[i][a]))break;if(r)break}return!!r},go=function(e){if(!e||!e.playlists||!e.playlists.length)return po(e,(function(e){return e.playlists&&e.playlists.length||e.uri}));for(var t=function(t){var n=e.playlists[t],r=n.attributes&&n.attributes.CODECS;return r&&r.split(",").every((function(e){return q(e)}))||po(e,(function(e){return ho(n,e)}))?"continue":{v:!1}},n=0;n<e.playlists.length;n++){var r=t(n);if("continue"!==r&&"object"==typeof r)return r.v}return!0},mo={liveEdgeDelay:no,duration:io,seekable:function(e,t,n){var r=t||0,i=so(e,t,!0,n);return null===i?$s():$s(r,i)},getMediaInfoForTime:function(e){for(var t=e.playlist,n=e.currentTime,r=e.startingSegmentIndex,i=e.startingPartIndex,a=e.startTime,s=e.experimentalExactManifestTimings,o=n-a,u=Js(t),l=0,c=0;c<u.length;c++){var d=u[c];if(r===d.segmentIndex&&("number"!=typeof i||"number"!=typeof d.partIndex||i===d.partIndex)){l=c;break}}if(o<0){if(l>0)for(var f=l-1;f>=0;f--){var h=u[f];if(o+=h.duration,s){if(o<0)continue}else if(o+Hs<=0)continue;return{partIndex:h.partIndex,segmentIndex:h.segmentIndex,startTime:a-ao({defaultDuration:t.targetDuration,durationList:u,startIndex:l,endIndex:f})}}return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:n}}if(l<0){for(var p=l;p<0;p++)if((o-=t.targetDuration)<0)return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:n};l=0}for(var g=l;g<u.length;g++){var m=u[g];if(o-=m.duration,s){if(o>0)continue}else if(o-Hs>=0)continue;return{partIndex:m.partIndex,segmentIndex:m.segmentIndex,startTime:a+ao({defaultDuration:t.targetDuration,durationList:u,startIndex:l,endIndex:g})}}return{segmentIndex:u[u.length-1].segmentIndex,partIndex:u[u.length-1].partIndex,startTime:n}},isEnabled:lo,isDisabled:function(e){return e.disabled},isBlacklisted:oo,isIncompatible:uo,playlistEnd:so,isAes:function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},hasAttribute:co,estimateSegmentRequestTime:function(e,t,n,r){return void 0===r&&(r=0),co("BANDWIDTH",n)?(e*n.attributes.BANDWIDTH-8*r)/t:NaN},isLowestEnabledRendition:fo,isAudioOnly:go,playlistMatch:ho,segmentDurationWithParts:Qs},yo=Ls.log,vo=function(e,t){return e+"-"+t},_o=function(e,t,n){return"placeholder-uri-"+e+"-"+t+"-"+n},To=function(e,t){e.mediaGroups&&["AUDIO","SUBTITLES"].forEach((function(n){if(e.mediaGroups[n])for(var r in e.mediaGroups[n])for(var i in e.mediaGroups[n][r]){var a=e.mediaGroups[n][r][i];t(a,n,r,i)}}))},bo=function(e){var t=e.playlist,n=e.uri,r=e.id;t.id=r,t.playlistErrors_=0,n&&(t.uri=n),t.attributes=t.attributes||{}},Eo=function(e,t,n){void 0===n&&(n=_o),e.uri=t;for(var r=0;r<e.playlists.length;r++)if(!e.playlists[r].uri){var i="placeholder-uri-"+r;e.playlists[r].uri=i}var a=go(e);To(e,(function(t,r,i,s){if(!t.playlists||!t.playlists.length){if(a&&"AUDIO"===r&&!t.uri)for(var o=0;o<e.playlists.length;o++){var u=e.playlists[o];if(u.attributes&&u.attributes.AUDIO&&u.attributes.AUDIO===i)return}t.playlists=[(0,l.Z)({},t)]}t.playlists.forEach((function(t,a){var o=n(r,i,s,t),u=vo(a,o);t.uri?t.resolvedUri=t.resolvedUri||Bs(e.uri,t.uri):(t.uri=0===a?o:u,t.resolvedUri=t.uri),t.id=t.id||u,t.attributes=t.attributes||{},e.playlists[t.id]=t,e.playlists[t.uri]=t}))})),function(e){for(var t=e.playlists.length;t--;){var n=e.playlists[t];bo({playlist:n,id:vo(t,n.uri)}),n.resolvedUri=Bs(e.uri,n.uri),e.playlists[n.id]=n,e.playlists[n.uri]=n,n.attributes.BANDWIDTH||yo.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}}(e),function(e){To(e,(function(t){t.uri&&(t.resolvedUri=Bs(e.uri,t.uri))}))}(e)},So=Ls.mergeOptions,wo=Ls.EventTarget,Ao=function(e,t){if(!e)return t;var n=So(e,t);if(e.preloadHints&&!t.preloadHints&&delete n.preloadHints,e.parts&&!t.parts)delete n.parts;else if(e.parts&&t.parts)for(var r=0;r<t.parts.length;r++)e.parts&&e.parts[r]&&(n.parts[r]=So(e.parts[r],t.parts[r]));return!e.skipped&&t.skipped&&(n.skipped=!1),e.preload&&!t.preload&&(n.preload=!1),n},Io=function(e,t){!e.resolvedUri&&e.uri&&(e.resolvedUri=Bs(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=Bs(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=Bs(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=Bs(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach((function(e){e.resolvedUri||(e.resolvedUri=Bs(t,e.uri))})),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach((function(e){e.resolvedUri||(e.resolvedUri=Bs(t,e.uri))}))},Co=function(e){var t=e.segments||[],n=e.preloadSegment;if(n&&n.parts&&n.parts.length){if(n.preloadHints)for(var r=0;r<n.preloadHints.length;r++)if("MAP"===n.preloadHints[r].type)return t;n.duration=e.targetDuration,n.preload=!0,t.push(n)}return t},Ro=function(e,t){return e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment},Do=function(e,t,n){void 0===n&&(n=Ro);var r=So(e,{}),i=r.playlists[t.id];if(!i)return null;if(n(i,t))return null;t.segments=Co(t);var a=So(i,t);if(a.preloadSegment&&!t.preloadSegment&&delete a.preloadSegment,i.segments){if(t.skip){t.segments=t.segments||[];for(var s=0;s<t.skip.skippedSegments;s++)t.segments.unshift({skipped:!0})}a.segments=function(e,t,n){var r=e.slice(),i=t.slice();n=n||0;for(var a,s=[],o=0;o<i.length;o++){var u=r[o+n],l=i[o];u?(a=u.map||a,s.push(Ao(u,l))):(a&&!l.map&&(l.map=a),s.push(l))}return s}(i.segments,t.segments,t.mediaSequence-i.mediaSequence)}a.segments.forEach((function(e){Io(e,a.resolvedUri)}));for(var o=0;o<r.playlists.length;o++)r.playlists[o].id===t.id&&(r.playlists[o]=a);return r.playlists[t.id]=a,r.playlists[t.uri]=a,To(e,(function(e,n,r,i){if(e.playlists)for(var s=0;s<e.playlists.length;s++)t.id===e.playlists[s].id&&(e.playlists[s]=a)})),r},xo=function(e,t){var n=e.segments||[],r=n[n.length-1],i=r&&r.parts&&r.parts[r.parts.length-1],a=i&&i.duration||r&&r.duration;return t&&a?1e3*a:500*(e.partTargetDuration||e.targetDuration||10)},No=function(e){function t(t,n,r){var i;if(void 0===r&&(r={}),i=e.call(this)||this,!t)throw new Error("A non-empty playlist URL or object is required");i.logger_=qs("PlaylistLoader");var a=r,s=a.withCredentials,o=void 0!==s&&s,u=a.handleManifestRedirects,l=void 0!==u&&u;i.src=t,i.vhs_=n,i.withCredentials=o,i.handleManifestRedirects=l;var c=n.options_;return i.customTagParsers=c&&c.customTagParsers||[],i.customTagMappers=c&&c.customTagMappers||[],i.experimentalLLHLS=c&&c.experimentalLLHLS||!1,Ls.browser.IE_VERSION&&(i.experimentalLLHLS=!1),i.state="HAVE_NOTHING",i.handleMediaupdatetimeout_=i.handleMediaupdatetimeout_.bind(f(i)),i.on("mediaupdatetimeout",i.handleMediaupdatetimeout_),i}p(t,e);var n=t.prototype;return n.handleMediaupdatetimeout_=function(){var e=this;if("HAVE_METADATA"===this.state){var t=this.media(),n=Bs(this.master.uri,t.uri);this.experimentalLLHLS&&(n=function(e,t){if(t.endList||!t.serverControl)return e;var n={};if(t.serverControl.canBlockReload){var r=t.preloadSegment,a=t.mediaSequence+t.segments.length;if(r){var s=r.parts||[],o=to(t)-1;o>-1&&o!==s.length-1&&(n._HLS_part=o),(o>-1||s.length)&&a--}n._HLS_msn=a}if(t.serverControl&&t.serverControl.canSkipUntil&&(n._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(n).length){var u=new(i().URL)(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach((function(e){n.hasOwnProperty(e)&&u.searchParams.set(e,n[e])})),e=u.toString()}return e}(n,t)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:n,withCredentials:this.withCredentials},(function(t,n){if(e.request)return t?e.playlistRequestError(e.request,e.media(),"HAVE_METADATA"):void e.haveMetadata({playlistString:e.request.responseText,url:e.media().uri,id:e.media().id})}))}},n.playlistRequestError=function(e,t,n){var r=t.uri,i=t.id;this.request=null,n&&(this.state=n),this.error={playlist:this.master.playlists[i],status:e.status,message:"HLS playlist request error at URL: "+r+".",responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")},n.parseManifest_=function(e){var t=this,n=e.url;return function(e){var t=e.onwarn,n=e.oninfo,r=e.manifestString,i=e.customTagParsers,a=void 0===i?[]:i,s=e.customTagMappers,o=void 0===s?[]:s,u=e.experimentalLLHLS,l=new k;t&&l.on("warn",t),n&&l.on("info",n),a.forEach((function(e){return l.addParser(e)})),o.forEach((function(e){return l.addTagMapper(e)})),l.push(r),l.end();var c=l.manifest;if(u||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach((function(e){c.hasOwnProperty(e)&&delete c[e]})),c.segments&&c.segments.forEach((function(e){["parts","preloadHints"].forEach((function(t){e.hasOwnProperty(t)&&delete e[t]}))}))),!c.targetDuration){var d=10;c.segments&&c.segments.length&&(d=c.segments.reduce((function(e,t){return Math.max(e,t.duration)}),0)),t&&t("manifest has no targetDuration defaulting to "+d),c.targetDuration=d}var f=eo(c);if(f.length&&!c.partTargetDuration){var h=f.reduce((function(e,t){return Math.max(e,t.duration)}),0);t&&(t("manifest has no partTargetDuration defaulting to "+h),yo.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),c.partTargetDuration=h}return c}({onwarn:function(e){var r=e.message;return t.logger_("m3u8-parser warn for "+n+": "+r)},oninfo:function(e){var r=e.message;return t.logger_("m3u8-parser info for "+n+": "+r)},manifestString:e.manifestString,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},n.haveMetadata=function(e){var t=e.playlistString,n=e.playlistObject,r=e.url,i=e.id;this.request=null,this.state="HAVE_METADATA";var a=n||this.parseManifest_({url:r,manifestString:t});a.lastRequest=Date.now(),bo({playlist:a,uri:r,id:i});var s=Do(this.master,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,s?(this.master=s,this.media_=this.master.playlists[i]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(xo(this.media(),!!s)),this.trigger("loadedplaylist")},n.dispose=function(){this.trigger("dispose"),this.stopRequest(),i().clearTimeout(this.mediaUpdateTimeout),i().clearTimeout(this.finalRenditionTimeout),this.off()},n.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},n.media=function(e,t){var n=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}if(i().clearTimeout(this.finalRenditionTimeout),t){var r=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=i().setTimeout(this.media.bind(this,e,!1),r)}else{var a=this.state,s=!this.media_||e.id!==this.media_.id,o=this.master.playlists[e.id];if(o&&o.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(s&&(this.trigger("mediachanging"),"HAVE_MASTER"===a?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(xo(e,!0)),s){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},(function(t,r){if(n.request){if(e.lastRequest=Date.now(),e.resolvedUri=js(n.handleManifestRedirects,e.resolvedUri,r),t)return n.playlistRequestError(n.request,e,a);n.haveMetadata({playlistString:r.responseText,url:e.uri,id:e.id}),"HAVE_MASTER"===a?n.trigger("loadedmetadata"):n.trigger("mediachange")}}))}}},n.pause=function(){this.mediaUpdateTimeout&&(i().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")},n.load=function(e){var t=this;this.mediaUpdateTimeout&&(i().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var n=this.media();if(e){var r=n?(n.partTargetDuration||n.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=i().setTimeout((function(){t.mediaUpdateTimeout=null,t.load()}),r)}else this.started?n&&!n.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()},n.updateMediaUpdateTimeout_=function(e){var t=this;this.mediaUpdateTimeout&&(i().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=i().setTimeout((function(){t.mediaUpdateTimeout=null,t.trigger("mediaupdatetimeout"),t.updateMediaUpdateTimeout_(e)}),e))},n.start=function(){var e=this;if(this.started=!0,"object"==typeof this.src)return this.src.uri||(this.src.uri=i().location.href),this.src.resolvedUri=this.src.uri,void setTimeout((function(){e.setupInitialPlaylist(e.src)}),0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},(function(t,n){if(e.request){if(e.request=null,t)return e.error={status:n.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:n.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.src=js(e.handleManifestRedirects,e.src,n);var r=e.parseManifest_({manifestString:n.responseText,url:e.src});e.setupInitialPlaylist(r)}}))},n.srcUri=function(){return"string"==typeof this.src?this.src:this.src.uri},n.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists)return this.master=e,Eo(this.master,this.srcUri()),e.playlists.forEach((function(e){e.segments=Co(e),e.segments.forEach((function(t){Io(t,e.resolvedUri)}))})),this.trigger("loadedplaylist"),void(this.request||this.media(this.master.playlists[0]));var t=this.srcUri()||i().location.href;this.master=function(e,t){var n=vo(0,t),r={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:i().location.href,resolvedUri:i().location.href,playlists:[{uri:t,id:n,resolvedUri:t,attributes:{}}]};return r.playlists[n]=r.playlists[0],r.playlists[t]=r.playlists[0],r}(0,t),this.haveMetadata({playlistObject:e,url:t,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},t}(wo),Oo=Ls.xhr,Po=Ls.mergeOptions,Mo=function(e,t,n,r){var i="arraybuffer"===e.responseType?e.response:e.responseText;!t&&i&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=i.byteLength||i.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),n.headers&&(e.responseHeaders=n.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===n.statusCode||206===n.statusCode||0===n.statusCode||(t=new Error("XHR Failed with a response of: "+(e&&(i||e.responseText)))),r(t,e)},ko=function(){var e=function e(t,n){t=Po({timeout:45e3},t);var r=e.beforeRequest||Ls.Vhs.xhr.beforeRequest;if(r&&"function"==typeof r){var i=r(t);i&&(t=i)}var a=(!0===Ls.Vhs.xhr.original?Oo:Ls.Vhs.xhr)(t,(function(e,t){return Mo(a,e,t,n)})),s=a.abort;return a.abort=function(){return a.aborted=!0,s.apply(a,arguments)},a.uri=t.uri,a.requestTime=Date.now(),a};return e.original=!0,e},Lo=function(e){var t,n={};return e.byterange&&(n.Range="bytes="+(t=e.byterange).offset+"-"+("bigint"==typeof t.offset||"bigint"==typeof t.length?i().BigInt(t.offset)+i().BigInt(t.length)-i().BigInt(1):t.offset+t.length-1)),n},Fo=function(e,t){return e.start(t)+"-"+e.end(t)},Uo=function(e,t){var n=e.toString(16);return"00".substring(0,2-n.length)+n+(t%2?" ":"")},Bo=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},jo=function(e){var t={};return Object.keys(e).forEach((function(n){var r=e[n];W(r)?t[n]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[n]=r})),t},qo=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},Ho=function(e){return e.resolvedUri},Go=function(e){for(var t=Array.prototype.slice.call(e),n=16,r="",i=0;i<t.length/n;i++)r+=t.slice(i*n,i*n+n).map(Uo).join("")+" "+t.slice(i*n,i*n+n).map(Bo).join("")+"\n";return r},Vo=Object.freeze({__proto__:null,createTransferableMessage:jo,initSegmentId:qo,segmentKeyId:Ho,hexDump:Go,tagDump:function(e){var t=e.bytes;return Go(t)},textRanges:function(e){var t,n="";for(t=0;t<e.length;t++)n+=Fo(e,t)+" ";return n}}),Yo=function e(t){var n=t.programTime,r=t.playlist,i=t.retryCount,a=void 0===i?2:i,s=t.seekTo,o=t.pauseAfterSeek,u=void 0===o||o,l=t.tech,c=t.callback;if(!c)throw new Error("seekToProgramTime: callback must be provided");if(void 0===n||!r||!s)return c({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!r.endList&&!l.hasStarted_)return c({message:"player must be playing a live stream to start buffering"});if(!function(e){if(!e.segments||0===e.segments.length)return!1;for(var t=0;t<e.segments.length;t++)if(!e.segments[t].dateTimeObject)return!1;return!0}(r))return c({message:"programDateTime tags must be provided in the manifest "+r.resolvedUri});var d=function(e,t){var n;try{n=new Date(e)}catch(e){return null}if(!t||!t.segments||0===t.segments.length)return null;var r=t.segments[0];if(n<r.dateTimeObject)return null;for(var i=0;i<t.segments.length-1&&(r=t.segments[i],!(n<t.segments[i+1].dateTimeObject));i++);var a,s=t.segments[t.segments.length-1],o=s.dateTimeObject,u=s.videoTimingInfo?(a=s.videoTimingInfo).transmuxedPresentationEnd-a.transmuxedPresentationStart-a.transmuxerPrependedSeconds:s.duration+.25*s.duration;return n>new Date(o.getTime()+1e3*u)?null:(n>o&&(r=s),{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:mo.duration(t,t.mediaSequence+t.segments.indexOf(r)),type:r.videoTimingInfo?"accurate":"estimate"})}(n,r);if(!d)return c({message:n+" was not found in the stream"});var f=d.segment,h=function(e,t){var n,r;try{n=new Date(e),r=new Date(t)}catch(e){}var i=n.getTime();return(r.getTime()-i)/1e3}(f.dateTimeObject,n);if("estimate"===d.type)return 0===a?c({message:n+" is not buffered yet. Try again"}):(s(d.estimatedStart+h),void l.one("seeked",(function(){e({programTime:n,playlist:r,retryCount:a-1,seekTo:s,pauseAfterSeek:u,tech:l,callback:c})})));var p=f.start+h;l.one("seeked",(function(){return c(null,l.currentTime())})),u&&l.pause(),s(p)},zo=function(e,t){if(4===e.readyState)return t()},Zo=Ls.EventTarget,Ko=Ls.mergeOptions,Wo=function(e,t){if(!Ro(e,t))return!1;if(e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length))return!1;if(!e.sidx&&t.sidx||e.sidx&&!t.sidx)return!1;if(e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(var n=0;n<e.segments.length;n++){var r=e.segments[n],i=t.segments[n];if(r.uri!==i.uri)return!1;if(r.byterange||i.byterange){var a=r.byterange,s=i.byterange;if(a&&!s||!a&&s)return!1;if(a.offset!==s.offset||a.length!==s.length)return!1}}return!0},Xo=function(e,t,n,r){return"placeholder-uri-"+e+"-"+t+"-"+(r.attributes.NAME||n)},$o=function(e,t){return(Boolean(!e.map&&!t.map)||Boolean(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length))&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length},Qo=function(e,t){var n={};for(var r in e){var i=e[r].sidx;if(i){var a=_e(i);if(!t[a])break;var s=t[a].sidxInfo;$o(s,i)&&(n[a]=t[a])}}return n},Jo=function(e){function t(t,n,r,i){var a;void 0===r&&(r={}),(a=e.call(this)||this).masterPlaylistLoader_=i||f(a),i||(a.isMaster_=!0);var s=r,o=s.withCredentials,u=void 0!==o&&o,l=s.handleManifestRedirects,c=void 0!==l&&l;if(a.vhs_=n,a.withCredentials=u,a.handleManifestRedirects=c,!t)throw new Error("A non-empty playlist URL or object is required");return a.on("minimumUpdatePeriod",(function(){a.refreshXml_()})),a.on("mediaupdatetimeout",(function(){a.refreshMedia_(a.media().id)})),a.state="HAVE_NOTHING",a.loadedPlaylists_={},a.logger_=qs("DashPlaylistLoader"),a.isMaster_?(a.masterPlaylistLoader_.srcUrl=t,a.masterPlaylistLoader_.sidxMapping_={}):a.childPlaylist_=t,a}p(t,e);var n=t.prototype;return n.requestErrored_=function(e,t,n){return!this.request||(this.request=null,e?(this.error="object"!=typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2}:e,n&&(this.state=n),this.trigger("error"),!0):void 0)},n.addSidxSegments_=function(e,t,n){var r=this,a=e.sidx&&_e(e.sidx);if(e.sidx&&a&&!this.masterPlaylistLoader_.sidxMapping_[a]){var s=js(this.handleManifestRedirects,e.sidx.resolvedUri),o=function(i,s){if(!r.requestErrored_(i,s,t)){var o,u=r.masterPlaylistLoader_.sidxMapping_;try{o=Ze()(X(s.response).subarray(8))}catch(e){return void r.requestErrored_(e,s,t)}return u[a]={sidxInfo:e.sidx,sidx:o},pe(e,o,e.sidx.resolvedUri),n(!0)}};this.request=function(e,t,n){var r,i=[],a=!1,s=function(e,t,r,i){return t.abort(),a=!0,n(e,t,r,i)},o=function(e,t){if(!a){if(e)return s(e,t,"",i);var n=t.responseText.substring(i&&i.byteLength||0,t.responseText.length);if(i=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if((t=t.filter((function(e){return e&&(e.byteLength||e.length)&&"string"!=typeof e}))).length<=1)return X(t[0]);var r=t.reduce((function(e,t,n){return e+(t.byteLength||t.length)}),0),i=new Uint8Array(r),a=0;return t.forEach((function(e){e=X(e),i.set(e,a),a+=e.byteLength})),i}(i,ee(n,!0)),r=r||We(i),i.length<10||r&&i.length<r+2)return zo(t,(function(){return s(e,t,"",i)}));var o=pt(i);return"ts"===o&&i.length<188||!o&&i.length<376?zo(t,(function(){return s(e,t,"",i)})):s(null,t,o,i)}},u={uri:e,beforeSend:function(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",(function(t){return t.total,t.loaded,Mo(e,null,{statusCode:e.status},o)}))}},l=t(u,(function(e,t){return Mo(l,e,t,o)}));return l}(s,this.vhs_.xhr,(function(t,n,i,a){if(t)return o(t,n);if(!i||"mp4"!==i)return o({status:n.status,message:"Unsupported "+(i||"unknown")+" container type for sidx segment at URL: "+s,response:"",playlist:e,internal:!0,blacklistDuration:1/0,code:2},n);var u=e.sidx.byterange,l=u.offset,c=u.length;if(a.length>=c+l)return o(t,{response:a.subarray(l,l+c),status:n.status,uri:n.uri});r.request=r.vhs_.xhr({uri:s,responseType:"arraybuffer",headers:Lo({byterange:e.sidx.byterange})},o)}))}else this.mediaRequest_=i().setTimeout((function(){return n(!1)}),0)},n.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},i().clearTimeout(this.minimumUpdatePeriodTimeout_),i().clearTimeout(this.mediaRequest_),i().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},n.hasPendingRequest=function(){return this.request||this.mediaRequest_},n.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},n.media=function(e){var t=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var n=this.state;if("string"==typeof e){if(!this.masterPlaylistLoader_.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.masterPlaylistLoader_.master.playlists[e]}var r=!this.media_||e.id!==this.media_.id;if(r&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(r&&(this.trigger("mediachanging"),this.trigger("mediachange")));r&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,n,(function(r){t.haveMetadata({startingState:n,playlist:e})})))},n.haveMetadata=function(e){var t=e.startingState,n=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[n.id]=n,this.mediaRequest_=null,this.refreshMedia_(n.id),"HAVE_MASTER"===t?this.trigger("loadedmetadata"):this.trigger("mediachange")},n.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),i().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(i().clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)},n.load=function(e){var t=this;i().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var n=this.media();if(e){var r=n?n.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=i().setTimeout((function(){return t.load()}),r)}else this.started?n&&!n.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()},n.start=function(){var e=this;this.started=!0,this.isMaster_?this.requestMaster_((function(t,n){e.haveMaster_(),e.hasPendingRequest()||e.media_||e.media(e.masterPlaylistLoader_.master.playlists[0])})):this.mediaRequest_=i().setTimeout((function(){return e.haveMaster_()}),0)},n.requestMaster_=function(e){var t=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},(function(n,r){if(!t.requestErrored_(n,r)){var i=r.responseText!==t.masterPlaylistLoader_.masterXml_;return t.masterPlaylistLoader_.masterXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?t.masterLoaded_=Date.parse(r.responseHeaders.date):t.masterLoaded_=Date.now(),t.masterPlaylistLoader_.srcUrl=js(t.handleManifestRedirects,t.masterPlaylistLoader_.srcUrl,r),i?(t.handleMaster_(),void t.syncClientServerClock_((function(){return e(r,i)}))):e(r,i)}"HAVE_NOTHING"===t.state&&(t.started=!1)}))},n.syncClientServerClock_=function(e){var t,n=this,r=(t=this.masterPlaylistLoader_.masterXml_,function(e){var t=Le(e,"UTCTiming")[0];if(!t)return null;var n=je(t);switch(n.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":n.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":n.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":n.method="DIRECT",n.value=Date.parse(n.value);break;default:throw new Error("UNSUPPORTED_UTC_TIMING_SCHEME")}return n}(Ye(t)));return null===r?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),e()):"DIRECT"===r.method?(this.masterPlaylistLoader_.clientOffset_=r.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:Bs(this.masterPlaylistLoader_.srcUrl,r.value),method:r.method,withCredentials:this.withCredentials},(function(t,i){if(n.request){if(t)return n.masterPlaylistLoader_.clientOffset_=n.masterLoaded_-Date.now(),e();var a;a="HEAD"===r.method?i.responseHeaders&&i.responseHeaders.date?Date.parse(i.responseHeaders.date):n.masterLoaded_:Date.parse(i.responseText),n.masterPlaylistLoader_.clientOffset_=a-Date.now(),e()}})))},n.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},n.handleMaster_=function(){this.mediaRequest_=null;var e,t,n,r=this.masterPlaylistLoader_.master,i=(n=function(e,t){void 0===t&&(t={});var n=function(e,t){void 0===t&&(t={});var n=t,r=n.manifestUri,i=void 0===r?"":r,a=n.NOW,s=void 0===a?Date.now():a,o=n.clientOffset,u=void 0===o?0:o,l=Le(e,"Period");if(!l.length)throw new Error("INVALID_NUMBER_OF_PERIOD");var c=Le(e,"Location"),d=je(e),f=He([i],Le(e,"BaseURL"));d.type=d.type||"static",d.sourceDuration=d.mediaPresentationDuration||0,d.NOW=s,d.clientOffset=u,c.length&&(d.locations=c.map(Fe));var h=[];return l.forEach((function(e,t){var n=je(e),r=h[t-1];n.start=function(e){var t=e.attributes,n=e.priorPeriodAttributes,r=e.mpdType;return"number"==typeof t.start?t.start:n&&"number"==typeof n.start&&"number"==typeof n.duration?n.start+n.duration:n||"static"!==r?null:0}({attributes:n,priorPeriodAttributes:r?r.attributes:null,mpdType:d.type}),h.push({node:e,attributes:n})})),{locations:d.locations,representationInfo:se(h.map(Ve(d,f)))}}(Ye(e),t),r=n.representationInfo.map(ke);return Re({dashPlaylists:r,locations:n.locations,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest})}((e={masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:r}).masterXml,{manifestUri:t=e.srcUrl,clientOffset:e.clientOffset,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest}),Eo(n,t,Xo),n);r&&(i=function(e,t,n){for(var r=!0,i=Ko(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts}),a=0;a<t.playlists.length;a++){var s=t.playlists[a];if(s.sidx){var o=_e(s.sidx);n&&n[o]&&n[o].sidx&&pe(s,n[o].sidx,s.sidx.resolvedUri)}var u=Do(i,s,Wo);u&&(i=u,r=!1)}return To(t,(function(e,t,n,a){if(e.playlists&&e.playlists.length){var s=e.playlists[0].id,o=Do(i,e.playlists[0],Wo);o&&(a in(i=o).mediaGroups[t][n]||(i.mediaGroups[t][n][a]=e),i.mediaGroups[t][n][a].playlists[0]=i.playlists[s],r=!1)}})),function(e,t){To(e,(function(n,r,i,a){a in t.mediaGroups[r][i]||delete e.mediaGroups[r][i][a]}))}(i,t),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(r=!1),r?null:i}(r,i,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=i||r;var a=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return a&&a!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=a),(!r||i&&i.minimumUpdatePeriod!==r.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),Boolean(i)},n.updateMinimumUpdatePeriodTimeout_=function(){var e=this.masterPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(i().clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);var t=e.master&&e.master.minimumUpdatePeriod;0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!=typeof t||t<=0?t<0&&this.logger_("found invalid minimumUpdatePeriod of "+t+", not setting a timeout"):this.createMUPTimeout_(t)},n.createMUPTimeout_=function(e){var t=this.masterPlaylistLoader_;t.minimumUpdatePeriodTimeout_=i().setTimeout((function(){t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)}),e)},n.refreshXml_=function(){var e=this;this.requestMaster_((function(t,n){var r,i,a;n&&(e.media_&&(e.media_=e.masterPlaylistLoader_.master.playlists[e.media_.id]),e.masterPlaylistLoader_.sidxMapping_=(r=e.masterPlaylistLoader_.master,i=e.masterPlaylistLoader_.sidxMapping_,a=Qo(r.playlists,i),To(r,(function(e,t,n,r){if(e.playlists&&e.playlists.length){var s=e.playlists;a=Ko(a,Qo(s,i))}})),a),e.addSidxSegments_(e.media(),e.state,(function(t){e.refreshMedia_(e.media().id)})))}))},n.refreshMedia_=function(e){var t=this;if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMaster_&&this.handleMaster_();var n=this.masterPlaylistLoader_.master.playlists,r=!this.media_||this.media_!==n[e];r?this.media_=n[e]:this.trigger("playlistunchanged"),this.mediaUpdateTimeout||function e(){t.media().endList||(t.mediaUpdateTimeout=i().setTimeout((function(){t.trigger("mediaupdatetimeout"),e()}),xo(t.media(),Boolean(r))))}(),this.trigger("loadedplaylist")},t}(Zo),eu={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30},tu=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},nu=function(e){return function(){var t=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(n){var t=new BlobBuilder;return t.append(e),URL.createObjectURL(t.getBlob())}}(e),n=tu(new Worker(t));n.objURL=t;var r=n.terminate;return n.on=n.addEventListener,n.off=n.removeEventListener,n.terminate=function(){return URL.revokeObjectURL(t),r.call(this)},n}},ru=function(e){return"var browserWorkerPolyFill = "+tu.toString()+";\nbrowserWorkerPolyFill(self);\n"+e},iu=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},au=ru(iu((function(){var e=function(){this.init=function(){var e={};this.on=function(t,n){e[t]||(e[t]=[]),e[t]=e[t].concat(n)},this.off=function(t,n){var r;return!!e[t]&&(r=e[t].indexOf(n),e[t]=e[t].slice(),e[t].splice(r,1),r>-1)},this.trigger=function(t){var n,r,i,a;if(n=e[t])if(2===arguments.length)for(i=n.length,r=0;r<i;++r)n[r].call(this,arguments[1]);else{for(a=[],r=arguments.length,r=1;r<arguments.length;++r)a.push(arguments[r]);for(i=n.length,r=0;r<i;++r)n[r].apply(this,a)}},this.dispose=function(){e={}}}};e.prototype.pipe=function(e){return this.on("data",(function(t){e.push(t)})),this.on("done",(function(t){e.flush(t)})),this.on("partialdone",(function(t){e.partialFlush(t)})),this.on("endedtimeline",(function(t){e.endTimeline(t)})),this.on("reset",(function(t){e.reset(t)})),e},e.prototype.push=function(e){this.trigger("data",e)},e.prototype.flush=function(e){this.trigger("done",e)},e.prototype.partialFlush=function(e){this.trigger("partialdone",e)},e.prototype.endTimeline=function(e){this.trigger("endedtimeline",e)},e.prototype.reset=function(e){this.trigger("reset",e)};var t,r,i,a,s,o,u,l,c,d,f,h,p,g,m,y,v,_,T,b,E,S,w,A,I,C,R,D,x,N,O,P,M,k,L,F,U,B,j,q,H=e,G=Math.pow(2,32),V={getUint64:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getBigUint64?(t=n.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(t):t:n.getUint32(0)*G+n.getUint32(4)},MAX_UINT32:G},Y=V.MAX_UINT32;!function(){var e;if(S={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(e in S)S.hasOwnProperty(e)&&(S[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);w=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),I=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),A=new Uint8Array([0,0,0,1]),C=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]),R=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]),D={video:C,audio:R},O=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),N=new Uint8Array([0,0,0,0,0,0,0,0]),P=new Uint8Array([0,0,0,0,0,0,0,0]),M=P,k=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),L=P,x=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),t=function(e){var t,n,r=[],i=0;for(t=1;t<arguments.length;t++)r.push(arguments[t]);for(t=r.length;t--;)i+=r[t].byteLength;for(n=new Uint8Array(i+8),new DataView(n.buffer,n.byteOffset,n.byteLength).setUint32(0,n.byteLength),n.set(e,4),t=0,i=8;t<r.length;t++)n.set(r[t],i),i+=r[t].byteLength;return n},r=function(){return t(S.dinf,t(S.dref,O))},i=function(e){return t(S.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},m=function(e){return t(S.hdlr,D[e])},g=function(e){var n=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(n[12]=e.samplerate>>>24&255,n[13]=e.samplerate>>>16&255,n[14]=e.samplerate>>>8&255,n[15]=255&e.samplerate),t(S.mdhd,n)},p=function(e){return t(S.mdia,g(e),m(e.type),o(e))},s=function(e){return t(S.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},o=function(e){return t(S.minf,"video"===e.type?t(S.vmhd,x):t(S.smhd,N),r(),v(e))},u=function(e,n){for(var r=[],i=n.length;i--;)r[i]=T(n[i]);return t.apply(null,[S.moof,s(e)].concat(r))},l=function(e){for(var n=e.length,r=[];n--;)r[n]=f(e[n]);return t.apply(null,[S.moov,d(4294967295)].concat(r).concat(c(e)))},c=function(e){for(var n=e.length,r=[];n--;)r[n]=b(e[n]);return t.apply(null,[S.mvex].concat(r))},d=function(e){var n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,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 t(S.mvhd,n)},y=function(e){var n,r,i=e.samples||[],a=new Uint8Array(4+i.length);for(r=0;r<i.length;r++)n=i[r].flags,a[r+4]=n.dependsOn<<4|n.isDependedOn<<2|n.hasRedundancy;return t(S.sdtp,a)},v=function(e){return t(S.stbl,_(e),t(S.stts,L),t(S.stsc,M),t(S.stsz,k),t(S.stco,P))},_=function(e){return t(S.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===e.type?F(e):U(e))},F=function(e){var n,r,i=e.sps||[],a=e.pps||[],s=[],o=[];for(n=0;n<i.length;n++)s.push((65280&i[n].byteLength)>>>8),s.push(255&i[n].byteLength),s=s.concat(Array.prototype.slice.call(i[n]));for(n=0;n<a.length;n++)o.push((65280&a[n].byteLength)>>>8),o.push(255&a[n].byteLength),o=o.concat(Array.prototype.slice.call(a[n]));if(r=[S.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,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),t(S.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([i.length],s,[a.length],o))),t(S.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var u=e.sarRatio[0],l=e.sarRatio[1];r.push(t(S.pasp,new Uint8Array([(4278190080&u)>>24,(16711680&u)>>16,(65280&u)>>8,255&u,(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l])))}return t.apply(null,r)},U=function(e){return t(S.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),i(e))},h=function(e){var n=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return t(S.tkhd,n)},T=function(e){var n,r,i,a,s,o;return n=t(S.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),s=Math.floor(e.baseMediaDecodeTime/Y),o=Math.floor(e.baseMediaDecodeTime%Y),r=t(S.tfdt,new Uint8Array([1,0,0,0,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),"audio"===e.type?(i=E(e,92),t(S.traf,n,r,i)):(a=y(e),i=E(e,a.length+92),t(S.traf,n,r,i,a))},f=function(e){return e.duration=e.duration||4294967295,t(S.trak,h(e),p(e))},b=function(e){var n=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(n[n.length-1]=0),t(S.trex,n)},q=function(e,t){var n=0,r=0,i=0,a=0;return e.length&&(void 0!==e[0].duration&&(n=1),void 0!==e[0].size&&(r=2),void 0!==e[0].flags&&(i=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,n|r|i|a,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},j=function(e,n){var r,i,a,s,o,u;for(n+=20+16*(s=e.samples||[]).length,a=q(s,n),(i=new Uint8Array(a.length+16*s.length)).set(a),r=a.length,u=0;u<s.length;u++)o=s[u],i[r++]=(4278190080&o.duration)>>>24,i[r++]=(16711680&o.duration)>>>16,i[r++]=(65280&o.duration)>>>8,i[r++]=255&o.duration,i[r++]=(4278190080&o.size)>>>24,i[r++]=(16711680&o.size)>>>16,i[r++]=(65280&o.size)>>>8,i[r++]=255&o.size,i[r++]=o.flags.isLeading<<2|o.flags.dependsOn,i[r++]=o.flags.isDependedOn<<6|o.flags.hasRedundancy<<4|o.flags.paddingValue<<1|o.flags.isNonSyncSample,i[r++]=61440&o.flags.degradationPriority,i[r++]=15&o.flags.degradationPriority,i[r++]=(4278190080&o.compositionTimeOffset)>>>24,i[r++]=(16711680&o.compositionTimeOffset)>>>16,i[r++]=(65280&o.compositionTimeOffset)>>>8,i[r++]=255&o.compositionTimeOffset;return t(S.trun,i)},B=function(e,n){var r,i,a,s,o,u;for(n+=20+8*(s=e.samples||[]).length,a=q(s,n),(r=new Uint8Array(a.length+8*s.length)).set(a),i=a.length,u=0;u<s.length;u++)o=s[u],r[i++]=(4278190080&o.duration)>>>24,r[i++]=(16711680&o.duration)>>>16,r[i++]=(65280&o.duration)>>>8,r[i++]=255&o.duration,r[i++]=(4278190080&o.size)>>>24,r[i++]=(16711680&o.size)>>>16,r[i++]=(65280&o.size)>>>8,r[i++]=255&o.size;return t(S.trun,r)},E=function(e,t){return"audio"===e.type?B(e,t):j(e,t)},a=function(){return t(S.ftyp,w,A,w,I)};var z,Z,K,W,X,$,Q,J,ee=function(e){return t(S.mdat,e)},te=u,ne=function(e,t){var n={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return n.dataOffset=t,n.compositionTimeOffset=e.pts-e.dts,n.duration=e.duration,n.size=4*e.length,n.size+=e.byteLength,e.keyFrame&&(n.flags.dependsOn=2,n.flags.isNonSyncSample=0),n},re=[33,16,5,32,164,27],ie=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],ae=function(e){for(var t=[];e--;)t.push(0);return t},se=9e4;$=function(e,t){return Z(X(e,t))},Q=function(e,t){return K(W(e),t)},J=function(e,t,n){return W(n?e:e-t)};var oe=se,ue=Z=function(e){return e*se},le=(K=function(e,t){return e*t},W=function(e){return e/se}),ce=(X=function(e,t){return e/t},$),de=Q,fe=J,he=function(e,t,n,r){var i,a,s,o,u,l=0,c=0,d=0;if(t.length&&(i=ce(e.baseMediaDecodeTime,e.samplerate),a=Math.ceil(oe/(e.samplerate/1024)),n&&r&&(l=i-Math.max(n,r),d=(c=Math.floor(l/a))*a),!(c<1||d>45e3))){for((s=function(){if(!z){var e={96e3:[re,[227,64],ae(154),[56]],88200:[re,[231],ae(170),[56]],64e3:[re,[248,192],ae(240),[56]],48e3:[re,[255,192],ae(268),[55,148,128],ae(54),[112]],44100:[re,[255,192],ae(268),[55,163,128],ae(84),[112]],32e3:[re,[255,192],ae(268),[55,234],ae(226),[112]],24e3:[re,[255,192],ae(268),[55,255,128],ae(268),[111,112],ae(126),[224]],16e3:[re,[255,192],ae(268),[55,255,128],ae(268),[111,255],ae(269),[223,108],ae(195),[1,192]],12e3:[ie,ae(268),[3,127,248],ae(268),[6,255,240],ae(268),[13,255,224],ae(268),[27,253,128],ae(259),[56]],11025:[ie,ae(268),[3,127,248],ae(268),[6,255,240],ae(268),[13,255,224],ae(268),[27,255,192],ae(268),[55,175,128],ae(108),[112]],8e3:[ie,ae(268),[3,121,16],ae(47),[7]]};t=e,z=Object.keys(t).reduce((function(e,n){return e[n]=new Uint8Array(t[n].reduce((function(e,t){return e.concat(t)}),[])),e}),{})}var t;return z}()[e.samplerate])||(s=t[0].data),o=0;o<c;o++)u=t[0],t.splice(0,0,{data:s,dts:u.dts-a,pts:u.pts-a});return e.baseMediaDecodeTime-=Math.floor(de(d,e.samplerate)),d}},pe=function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},ge=function(e,t){var n,r=e.minSegmentDts;return t||(r-=e.timelineStartInfo.dts),n=e.timelineStartInfo.baseMediaDecodeTime,n+=r,n=Math.max(0,n),"audio"===e.type&&(n*=e.samplerate/9e4,n=Math.floor(n)),n},me=function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))},ye=function e(t){t=t||{},e.prototype.init.call(this),this.parse708captions_="boolean"!=typeof t.parse708captions||t.parse708captions,this.captionPackets_=[],this.ccStreams_=[new Ce(0,0),new Ce(0,1),new Ce(1,0),new Ce(1,1)],this.parse708captions_&&(this.cc708Stream_=new Ee({captionServices:t.captionServices})),this.reset(),this.ccStreams_.forEach((function(e){e.on("data",this.trigger.bind(this,"data")),e.on("partialdone",this.trigger.bind(this,"partialdone")),e.on("done",this.trigger.bind(this,"done"))}),this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};(ye.prototype=new H).push=function(e){var t,n,r;if("sei_rbsp"===e.nalUnitType&&(t=function(e){for(var t=0,n={payloadType:-1,payloadSize:0},r=0,i=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)r+=255,t++;for(r+=e[t++];255===e[t];)i+=255,t++;if(i+=e[t++],!n.payload&&4===r){if("GA94"===String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])){n.payloadType=r,n.payloadSize=i,n.payload=e.subarray(t,t+i);break}n.payload=void 0}t+=i,r=0,i=0}return n}(e.escapedRBSP)).payload&&4===t.payloadType&&(n=function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)}(t)))if(e.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));r=function(e,t){var n,r,i,a,s=[];if(!(64&t[0]))return s;for(r=31&t[0],n=0;n<r;n++)a={type:3&t[2+(i=3*n)],pts:e},4&t[i+2]&&(a.ccData=t[i+3]<<8|t[i+4],s.push(a));return s}(e.pts,n),this.captionPackets_=this.captionPackets_.concat(r),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},ye.prototype.flushCCStreams=function(e){this.ccStreams_.forEach((function(t){return"flush"===e?t.flush():t.partialFlush()}),this)},ye.prototype.flushStream=function(e){this.captionPackets_.length?(this.captionPackets_.forEach((function(e,t){e.presortIndex=t})),this.captionPackets_.sort((function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts})),this.captionPackets_.forEach((function(e){e.type<2?this.dispatchCea608Packet(e):this.dispatchCea708Packet(e)}),this),this.captionPackets_.length=0,this.flushCCStreams(e)):this.flushCCStreams(e)},ye.prototype.flush=function(){return this.flushStream("flush")},ye.prototype.partialFlush=function(){return this.flushStream("partialFlush")},ye.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset()}))},ye.prototype.dispatchCea608Packet=function(e){this.setsTextOrXDSActive(e)?this.activeCea608Channel_[e.type]=null:this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},ye.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},ye.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)},ye.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)},ye.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)};var ve={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},_e=function(e){return 32<=e&&e<=127||160<=e&&e<=255},Te=function(e){this.windowNum=e,this.reset()};Te.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},Te.prototype.getText=function(){return this.rows.join("\n")},Te.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},Te.prototype.newLine=function(e){for(this.rows.length>=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},Te.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},Te.prototype.addText=function(e){this.rows[this.rowIdx]+=e},Te.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var be=function(e,t,n){this.serviceNum=e,this.text="",this.currentWindow=new Te(-1),this.windows=[],this.stream=n,"string"==typeof t&&this.createTextDecoder(t)};be.prototype.init=function(e,t){this.startPts=e;for(var n=0;n<8;n++)this.windows[n]=new Te(n),"function"==typeof t&&(this.windows[n].beforeRowOverflow=t)},be.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},be.prototype.createTextDecoder=function(e){if("undefined"==typeof TextDecoder)this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(e)}catch(t){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+e+" encoding. "+t})}};var Ee=function e(t){t=t||{},e.prototype.init.call(this);var n,r=this,i=t.captionServices||{},a={};Object.keys(i).forEach((function(e){n=i[e],/^SERVICE/.test(e)&&(a[e]=n.encoding)})),this.serviceEncodings=a,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(r.new708Packet(),r.add708Bytes(e)):(null===r.current708Packet&&r.new708Packet(),r.add708Bytes(e))}};Ee.prototype=new H,Ee.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},Ee.prototype.add708Bytes=function(e){var t=e.ccData,n=t>>>8,r=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(n),this.current708Packet.data.push(r)},Ee.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,n=null,r=null,i=0,a=t[i++];for(e.seq=a>>6,e.sizeCode=63&a;i<t.length;i++)r=31&(a=t[i++]),7==(n=a>>5)&&r>0&&(n=a=t[i++]),this.pushServiceBlock(n,i,r),r>0&&(i+=r-1)},Ee.prototype.pushServiceBlock=function(e,t,n){var r,i=t,a=this.current708Packet.data,s=this.services[e];for(s||(s=this.initService(e,i));i<t+n&&i<a.length;i++)r=a[i],_e(r)?i=this.handleText(i,s):24===r?i=this.multiByteCharacter(i,s):16===r?i=this.extendedCommands(i,s):128<=r&&r<=135?i=this.setCurrentWindow(i,s):152<=r&&r<=159?i=this.defineWindow(i,s):136===r?i=this.clearWindows(i,s):140===r?i=this.deleteWindows(i,s):137===r?i=this.displayWindows(i,s):138===r?i=this.hideWindows(i,s):139===r?i=this.toggleWindows(i,s):151===r?i=this.setWindowAttributes(i,s):144===r?i=this.setPenAttributes(i,s):145===r?i=this.setPenColor(i,s):146===r?i=this.setPenLocation(i,s):143===r?s=this.reset(i,s):8===r?s.currentWindow.backspace():12===r?s.currentWindow.clearText():13===r?s.currentWindow.pendingNewLine=!0:14===r?s.currentWindow.clearText():141===r&&i++},Ee.prototype.extendedCommands=function(e,t){var n=this.current708Packet.data[++e];return _e(n)&&(e=this.handleText(e,t,{isExtended:!0})),e},Ee.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},Ee.prototype.initService=function(e,t){var n,r,i=this;return(n="SERVICE"+e)in this.serviceEncodings&&(r=this.serviceEncodings[n]),this.services[e]=new be(e,r,i),this.services[e].init(this.getPts(t),(function(t){i.flushDisplayed(t,i.services[e])})),this.services[e]},Ee.prototype.handleText=function(e,t,n){var r,i,a,s,o=n&&n.isExtended,u=n&&n.isMultiByte,l=this.current708Packet.data,c=o?4096:0,d=l[e],f=l[e+1],h=t.currentWindow;return t.textDecoder_&&!o?(u?(i=[d,f],e++):i=[d],r=t.textDecoder_.decode(new Uint8Array(i))):(s=ve[a=c|d]||a,r=4096&a&&a===s?"":String.fromCharCode(s)),h.pendingNewLine&&!h.isEmpty()&&h.newLine(this.getPts(e)),h.pendingNewLine=!1,h.addText(r),e},Ee.prototype.multiByteCharacter=function(e,t){var n=this.current708Packet.data,r=n[e+1],i=n[e+2];return _e(r)&&_e(i)&&(e=this.handleText(++e,t,{isMultiByte:!0})),e},Ee.prototype.setCurrentWindow=function(e,t){var n=7&this.current708Packet.data[e];return t.setCurrentWindow(n),e},Ee.prototype.defineWindow=function(e,t){var n=this.current708Packet.data,r=n[e],i=7&r;t.setCurrentWindow(i);var a=t.currentWindow;return r=n[++e],a.visible=(32&r)>>5,a.rowLock=(16&r)>>4,a.columnLock=(8&r)>>3,a.priority=7&r,r=n[++e],a.relativePositioning=(128&r)>>7,a.anchorVertical=127&r,r=n[++e],a.anchorHorizontal=r,r=n[++e],a.anchorPoint=(240&r)>>4,a.rowCount=15&r,r=n[++e],a.columnCount=63&r,r=n[++e],a.windowStyle=(56&r)>>3,a.penStyle=7&r,a.virtualRowCount=a.rowCount+1,e},Ee.prototype.setWindowAttributes=function(e,t){var n=this.current708Packet.data,r=n[e],i=t.currentWindow.winAttr;return r=n[++e],i.fillOpacity=(192&r)>>6,i.fillRed=(48&r)>>4,i.fillGreen=(12&r)>>2,i.fillBlue=3&r,r=n[++e],i.borderType=(192&r)>>6,i.borderRed=(48&r)>>4,i.borderGreen=(12&r)>>2,i.borderBlue=3&r,r=n[++e],i.borderType+=(128&r)>>5,i.wordWrap=(64&r)>>6,i.printDirection=(48&r)>>4,i.scrollDirection=(12&r)>>2,i.justify=3&r,r=n[++e],i.effectSpeed=(240&r)>>4,i.effectDirection=(12&r)>>2,i.displayEffect=3&r,e},Ee.prototype.flushDisplayed=function(e,t){for(var n=[],r=0;r<8;r++)t.windows[r].visible&&!t.windows[r].isEmpty()&&n.push(t.windows[r].getText());t.endPts=e,t.text=n.join("\n\n"),this.pushCaption(t),t.startPts=e},Ee.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},Ee.prototype.displayWindows=function(e,t){var n=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var i=0;i<8;i++)n&1<<i&&(t.windows[i].visible=1);return e},Ee.prototype.hideWindows=function(e,t){var n=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var i=0;i<8;i++)n&1<<i&&(t.windows[i].visible=0);return e},Ee.prototype.toggleWindows=function(e,t){var n=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var i=0;i<8;i++)n&1<<i&&(t.windows[i].visible^=1);return e},Ee.prototype.clearWindows=function(e,t){var n=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var i=0;i<8;i++)n&1<<i&&t.windows[i].clearText();return e},Ee.prototype.deleteWindows=function(e,t){var n=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var i=0;i<8;i++)n&1<<i&&t.windows[i].reset();return e},Ee.prototype.setPenAttributes=function(e,t){var n=this.current708Packet.data,r=n[e],i=t.currentWindow.penAttr;return r=n[++e],i.textTag=(240&r)>>4,i.offset=(12&r)>>2,i.penSize=3&r,r=n[++e],i.italics=(128&r)>>7,i.underline=(64&r)>>6,i.edgeType=(56&r)>>3,i.fontStyle=7&r,e},Ee.prototype.setPenColor=function(e,t){var n=this.current708Packet.data,r=n[e],i=t.currentWindow.penColor;return r=n[++e],i.fgOpacity=(192&r)>>6,i.fgRed=(48&r)>>4,i.fgGreen=(12&r)>>2,i.fgBlue=3&r,r=n[++e],i.bgOpacity=(192&r)>>6,i.bgRed=(48&r)>>4,i.bgGreen=(12&r)>>2,i.bgBlue=3&r,r=n[++e],i.edgeRed=(48&r)>>4,i.edgeGreen=(12&r)>>2,i.edgeBlue=3&r,e},Ee.prototype.setPenLocation=function(e,t){var n=this.current708Packet.data,r=n[e],i=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,r=n[++e],i.row=15&r,r=n[++e],i.column=63&r,e},Ee.prototype.reset=function(e,t){var n=this.getPts(e);return this.flushDisplayed(n,t),this.initService(t.serviceNum,e)};var Se={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},we=function(e){return null===e?"":(e=Se[e]||e,String.fromCharCode(e))},Ae=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Ie=function(){for(var e=[],t=15;t--;)e.push("");return e},Ce=function e(t,n){e.prototype.init.call(this),this.field_=t||0,this.dataChannel_=n||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,n,r,i,a;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),r=t>>>8,i=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),n=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=n,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=Ie();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Ie();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Ie()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(r,i))a=we((r=(3&r)<<8)|i),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(r,i))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),a=we((r=(3&r)<<8)|i),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(r,i))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&i)&&this.addFormatting(e.pts,["i"]),1==(1&i)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(r,i))this.column_+=3&i;else if(this.isPAC(r,i)){var s=Ae.indexOf(7968&t);"rollUp"===this.mode_&&(s-this.rollUpRows_+1<0&&(s=this.rollUpRows_-1),this.setRollUp(e.pts,s)),s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&i&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(i)&&14==(14&i)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(r)&&(0===i&&(i=null),a=we(r),a+=we(i),this[this.mode_](e.pts,a),this.column_+=a.length)}else this.lastControlCode_=null}};Ce.prototype=new H,Ce.prototype.flushDisplayed=function(e){var t=this.displayed_.map((function(e,t){try{return e.trim()}catch(e){return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+t+"."}),""}}),this).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},Ce.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Ie(),this.nonDisplayed_=Ie(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},Ce.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},Ce.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},Ce.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},Ce.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},Ce.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},Ce.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},Ce.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},Ce.prototype.isNormalChar=function(e){return e>=32&&e<=127},Ce.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Ie(),this.displayed_=Ie()),void 0!==t&&t!==this.row_)for(var n=0;n<this.rollUpRows_;n++)this.displayed_[t-n]=this.displayed_[this.row_-n],this.displayed_[this.row_-n]="";void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},Ce.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var n=t.reduce((function(e,t){return e+"<"+t+">"}),"");this[this.mode_](e,n)},Ce.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce((function(e,t){return e+"</"+t+">"}),"");this.formatting_=[],this[this.mode_](e,t)}},Ce.prototype.popOn=function(e,t){var n=this.nonDisplayed_[this.row_];n+=t,this.nonDisplayed_[this.row_]=n},Ce.prototype.rollUp=function(e,t){var n=this.displayed_[this.row_];n+=t,this.displayed_[this.row_]=n},Ce.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.row_+1;e<15;e++)this.displayed_[e]="";for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]=""},Ce.prototype.paintOn=function(e,t){var n=this.displayed_[this.row_];n+=t,this.displayed_[this.row_]=n};var Re={CaptionStream:ye,Cea608Stream:Ce,Cea708Stream:Ee},De={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},xe="shared",Ne=function(e,t){var n=1;for(e>t&&(n=-1);Math.abs(t-e)>4294967296;)e+=8589934592*n;return e},Oe=function e(t){var n,r;e.prototype.init.call(this),this.type_=t||xe,this.push=function(e){this.type_!==xe&&e.type!==this.type_||(void 0===r&&(r=e.dts),e.dts=Ne(e.dts,r),e.pts=Ne(e.pts,r),n=e.dts,this.trigger("data",e))},this.flush=function(){r=n,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){r=void 0,n=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Oe.prototype=new H;var Pe,Me=Oe,ke=Ne,Le=function(e,t,n){var r,i="";for(r=t;r<n;r++)i+="%"+("00"+e[r].toString(16)).slice(-2);return i},Fe=function(e,t,n){return decodeURIComponent(Le(e,t,n))},Ue=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Be={TXXX:function(e){var t;if(3===e.data[0]){for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=Fe(e.data,1,t),e.value=Fe(e.data,t+1,e.data.length).replace(/\0*$/,"");break}e.data=e.value}},WXXX:function(e){var t;if(3===e.data[0])for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=Fe(e.data,1,t),e.url=Fe(e.data,t+1,e.data.length);break}},PRIV:function(e){var t,n;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=(n=e.data,unescape(Le(n,0,t)));break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}};Pe=function(e){var t,n={descriptor:e&&e.descriptor},r=0,i=[],a=0;if(Pe.prototype.init.call(this),this.dispatchType=De.METADATA_STREAM_TYPE.toString(16),n.descriptor)for(t=0;t<n.descriptor.length;t++)this.dispatchType+=("00"+n.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,n,s,o,u;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(a=0,i.length=0),0===i.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});else if(i.push(e),a+=e.data.byteLength,1===i.length&&(r=Ue(e.data.subarray(6,10)),r+=10),!(a<r)){for(t={data:new Uint8Array(r),frames:[],pts:i[0].pts,dts:i[0].dts},u=0;u<r;)t.data.set(i[0].data.subarray(0,r-u),u),u+=i[0].data.byteLength,a-=i[0].data.byteLength,i.shift();n=10,64&t.data[5]&&(n+=4,n+=Ue(t.data.subarray(10,14)),r-=Ue(t.data.subarray(16,20)));do{if((s=Ue(t.data.subarray(n+4,n+8)))<1)return void this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping metadata parsing."});if((o={id:String.fromCharCode(t.data[n],t.data[n+1],t.data[n+2],t.data[n+3]),data:t.data.subarray(n+10,n+s+10)}).key=o.id,Be[o.id]&&(Be[o.id](o),"com.apple.streaming.transportStreamTimestamp"===o.owner)){var l=o.data,c=(1&l[3])<<30|l[4]<<22|l[5]<<14|l[6]<<6|l[7]>>>2;c*=4,c+=3&l[7],o.timeStamp=c,void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o)}t.frames.push(o),n+=10,n+=s}while(n<r);this.trigger("data",t)}}},Pe.prototype=new H;var je,qe,He,Ge=Pe,Ve=Me,Ye=188;(je=function(){var e=new Uint8Array(Ye),t=0;je.prototype.init.call(this),this.push=function(n){var r,i=0,a=Ye;for(t?((r=new Uint8Array(n.byteLength+t)).set(e.subarray(0,t)),r.set(n,t),t=0):r=n;a<r.byteLength;)71!==r[i]||71!==r[a]?(i++,a++):(this.trigger("data",r.subarray(i,a)),i+=Ye,a+=Ye);i<r.byteLength&&(e.set(r.subarray(i),0),t=r.byteLength-i)},this.flush=function(){t===Ye&&71===e[0]&&(this.trigger("data",e),t=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){t=0,this.trigger("reset")}}).prototype=new H,qe=function(){var e,t,n,r;qe.prototype.init.call(this),r=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,r){var i=0;r.payloadUnitStartIndicator&&(i+=e[i]+1),"pat"===r.type?t(e.subarray(i),r):n(e.subarray(i),r)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],r.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=r.pmtPid},n=function(e,t){var n,i;if(1&e[5]){for(r.programMapTable={video:null,audio:null,"timed-metadata":{}},n=3+((15&e[1])<<8|e[2])-4,i=12+((15&e[10])<<8|e[11]);i<n;){var a=e[i],s=(31&e[i+1])<<8|e[i+2];a===De.H264_STREAM_TYPE&&null===r.programMapTable.video?r.programMapTable.video=s:a===De.ADTS_STREAM_TYPE&&null===r.programMapTable.audio?r.programMapTable.audio=s:a===De.METADATA_STREAM_TYPE&&(r.programMapTable["timed-metadata"][s]=a),i+=5+((15&e[i+3])<<8|e[i+4])}t.programMapTable=r.programMapTable}},this.push=function(t){var n={},r=4;if(n.payloadUnitStartIndicator=!!(64&t[1]),n.pid=31&t[1],n.pid<<=8,n.pid|=t[2],(48&t[3])>>>4>1&&(r+=t[r]+1),0===n.pid)n.type="pat",e(t.subarray(r),n),this.trigger("data",n);else if(n.pid===this.pmtPid)for(n.type="pmt",e(t.subarray(r),n),this.trigger("data",n);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,r,n]):this.processPes_(t,r,n)},this.processPes_=function(e,t,n){n.pid===this.programMapTable.video?n.streamType=De.H264_STREAM_TYPE:n.pid===this.programMapTable.audio?n.streamType=De.ADTS_STREAM_TYPE:n.streamType=this.programMapTable["timed-metadata"][n.pid],n.type="pes",n.data=e.subarray(t),this.trigger("data",n)}},qe.prototype=new H,qe.STREAM_TYPES={h264:27,adts:15},He=function(){var e,t=this,n=!1,r={data:[],size:0},i={data:[],size:0},a={data:[],size:0},s=function(e,n,r){var i,a,s=new Uint8Array(e.size),o={type:n},u=0,l=0;if(e.data.length&&!(e.size<9)){for(o.trackId=e.data[0].pid,u=0;u<e.data.length;u++)a=e.data[u],s.set(a.data,l),l+=a.data.byteLength;var c,d,f,h;d=o,h=(c=s)[0]<<16|c[1]<<8|c[2],d.data=new Uint8Array,1===h&&(d.packetLength=6+(c[4]<<8|c[5]),d.dataAlignmentIndicator=0!=(4&c[6]),192&(f=c[7])&&(d.pts=(14&c[9])<<27|(255&c[10])<<20|(254&c[11])<<12|(255&c[12])<<5|(254&c[13])>>>3,d.pts*=4,d.pts+=(6&c[13])>>>1,d.dts=d.pts,64&f&&(d.dts=(14&c[14])<<27|(255&c[15])<<20|(254&c[16])<<12|(255&c[17])<<5|(254&c[18])>>>3,d.dts*=4,d.dts+=(6&c[18])>>>1)),d.data=c.subarray(9+c[8])),i="video"===n||o.packetLength<=e.size,(r||i)&&(e.size=0,e.data.length=0),i&&t.trigger("data",o)}};He.prototype.init.call(this),this.push=function(o){({pat:function(){},pes:function(){var e,t;switch(o.streamType){case De.H264_STREAM_TYPE:e=r,t="video";break;case De.ADTS_STREAM_TYPE:e=i,t="audio";break;case De.METADATA_STREAM_TYPE:e=a,t="timed-metadata";break;default:return}o.payloadUnitStartIndicator&&s(e,t,!0),e.data.push(o),e.size+=o.data.byteLength},pmt:function(){var r={type:"metadata",tracks:[]};null!==(e=o.programMapTable).video&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),n=!0,t.trigger("data",r)}})[o.type]()},this.reset=function(){r.size=0,r.data.length=0,i.size=0,i.data.length=0,this.trigger("reset")},this.flushStreams_=function(){s(r,"video"),s(i,"audio"),s(a,"timed-metadata")},this.flush=function(){if(!n&&e){var r={type:"metadata",tracks:[]};null!==e.video&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",r)}n=!1,this.flushStreams_(),this.trigger("done")}},He.prototype=new H;var ze={PAT_PID:0,MP2T_PACKET_LENGTH:Ye,TransportPacketStream:je,TransportParseStream:qe,ElementaryStream:He,TimestampRolloverStream:Ve,CaptionStream:Re.CaptionStream,Cea608Stream:Re.Cea608Stream,Cea708Stream:Re.Cea708Stream,MetadataStream:Ge};for(var Ze in De)De.hasOwnProperty(Ze)&&(ze[Ze]=De[Ze]);var Ke,We=ze,Xe=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];Ke=function(e){var t,n=0;Ke.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:"adts skiping bytes "+e+" to "+t+" in frame "+n+" outside syncword"})},this.push=function(r){var i,a,s,o,u,l=0;if(e||(n=0),"audio"===r.type){var c;for(t&&t.length?(s=t,(t=new Uint8Array(s.byteLength+r.data.byteLength)).set(s),t.set(r.data,s.byteLength)):t=r.data;l+7<t.length;)if(255===t[l]&&240==(246&t[l+1])){if("number"==typeof c&&(this.skipWarn_(c,l),c=null),a=2*(1&~t[l+1]),i=(3&t[l+3])<<11|t[l+4]<<3|(224&t[l+5])>>5,u=9e4*(o=1024*(1+(3&t[l+6])))/Xe[(60&t[l+2])>>>2],t.byteLength-l<i)break;this.trigger("data",{pts:r.pts+n*u,dts:r.dts+n*u,sampleCount:o,audioobjecttype:1+(t[l+2]>>>6&3),channelcount:(1&t[l+2])<<2|(192&t[l+3])>>>6,samplerate:Xe[(60&t[l+2])>>>2],samplingfrequencyindex:(60&t[l+2])>>>2,samplesize:16,data:t.subarray(l+7+a,l+i)}),n++,l+=i}else"number"!=typeof c&&(c=l),l++;"number"==typeof c&&(this.skipWarn_(c,l),c=null),t=t.subarray(l)}},this.flush=function(){n=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}},Ke.prototype=new H;var $e,Qe,Je,et=Ke,tt=function(e){var t=e.byteLength,n=0,r=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+r},this.loadWord=function(){var i=e.byteLength-t,a=new Uint8Array(4),s=Math.min(4,t);if(0===s)throw new Error("no bytes available");a.set(e.subarray(i,i+s)),n=new DataView(a.buffer).getUint32(0),r=8*s,t-=s},this.skipBits=function(e){var i;r>e?(n<<=e,r-=e):(e-=r,e-=8*(i=Math.floor(e/8)),t-=i,this.loadWord(),n<<=e,r-=e)},this.readBits=function(e){var i=Math.min(r,e),a=n>>>32-i;return(r-=i)>0?n<<=i:t>0&&this.loadWord(),(i=e-i)>0?a<<i|this.readBits(i):a},this.skipLeadingZeros=function(){var e;for(e=0;e<r;++e)if(0!=(n&2147483648>>>e))return n<<=e,r-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};Qe=function(){var e,t,n=0;Qe.prototype.init.call(this),this.push=function(r){var i;t?((i=new Uint8Array(t.byteLength+r.data.byteLength)).set(t),i.set(r.data,t.byteLength),t=i):t=r.data;for(var a=t.byteLength;n<a-3;n++)if(1===t[n+2]){e=n+5;break}for(;e<a;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}n+3!==e-2&&this.trigger("data",t.subarray(n+3,e-2));do{e++}while(1!==t[e]&&e<a);n=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(n+3,e-2)),n=e-2,e+=3;break;default:e+=3}t=t.subarray(n),e-=n,n=0},this.reset=function(){t=null,n=0,this.trigger("reset")},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(n+3)),t=null,n=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Qe.prototype=new H,Je={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},$e=function(){var e,t,n,r,i,a,s,o=new Qe;$e.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,n=e.pts,r=e.dts,o.push(e))},o.on("data",(function(s){var o={trackId:t,pts:n,dts:r,data:s,nalUnitTypeCode:31&s[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=i(s.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=i(s.subarray(1)),o.config=a(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",o)})),o.on("done",(function(){e.trigger("done")})),o.on("partialdone",(function(){e.trigger("partialdone")})),o.on("reset",(function(){e.trigger("reset")})),o.on("endedtimeline",(function(){e.trigger("endedtimeline")})),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},s=function(e,t){var n,r=8,i=8;for(n=0;n<e;n++)0!==i&&(i=(r+t.readExpGolomb()+256)%256),r=0===i?r:i},i=function(e){for(var t,n,r=e.byteLength,i=[],a=1;a<r-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(i.push(a+2),a+=2):a++;if(0===i.length)return e;t=r-i.length,n=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===i[0]&&(s++,i.shift()),n[a]=e[s];return n},a=function(e){var t,n,r,i,a,o,u,l,c,d,f,h,p=0,g=0,m=0,y=0,v=[1,1];if(n=(t=new tt(e)).readUnsignedByte(),i=t.readUnsignedByte(),r=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),Je[n]&&(3===(a=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(f=3!==a?8:12,h=0;h<f;h++)t.readBoolean()&&s(h<6?16:64,t);if(t.skipUnsignedExpGolomb(),0===(o=t.readUnsignedExpGolomb()))t.readUnsignedExpGolomb();else if(1===o)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),u=t.readUnsignedExpGolomb(),h=0;h<u;h++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),l=t.readUnsignedExpGolomb(),c=t.readUnsignedExpGolomb(),0===(d=t.readBits(1))&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(p=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),m=t.readUnsignedExpGolomb(),y=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:v=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}v&&(v[0],v[1])}return{profileIdc:n,levelIdc:r,profileCompatibility:i,width:16*(l+1)-2*p-2*g,height:(2-d)*(c+1)*16-2*m-2*y,sarRatio:v}}},$e.prototype=new H;var nt,rt={H264Stream:$e,NalByteStream:Qe},it=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],at=function(e,t){var n=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return n=n>=0?n:0,(16&e[t+5])>>4?n+20:n+10},st=function e(t,n){return t.length-n<10||t[n]!=="I".charCodeAt(0)||t[n+1]!=="D".charCodeAt(0)||t[n+2]!=="3".charCodeAt(0)?n:e(t,n+=at(t,n))},ot=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},ut={isLikelyAacData:function(e){var t=st(e,0);return e.length>=t+2&&255==(255&e[t])&&240==(240&e[t+1])&&16==(22&e[t+1])},parseId3TagSize:at,parseAdtsSize:function(e,t){var n=(224&e[t+5])>>5,r=e[t+4]<<3;return 6144&e[t+3]|r|n},parseType:function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240==(240&e[t+1])?"audio":null},parseSampleRate:function(e){for(var t=0;t+5<e.length;){if(255===e[t]&&240==(246&e[t+1]))return it[(60&e[t+2])>>>2];t++}return null},parseAacTimestamp:function(e){var t,n,r;t=10,64&e[5]&&(t+=4,t+=ot(e.subarray(10,14)));do{if((n=ot(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){r=e.subarray(t+10,t+n+10);for(var i=0;i<r.byteLength;i++)if(0===r[i]){var a=unescape(function(e,t,n){var r,i="";for(r=0;r<n;r++)i+="%"+("00"+e[r].toString(16)).slice(-2);return i}(r,0,i));if("com.apple.streaming.transportStreamTimestamp"===a){var s=r.subarray(i+1),o=(1&s[3])<<30|s[4]<<22|s[5]<<14|s[6]<<6|s[7]>>>2;return(o*=4)+(3&s[7])}break}}t+=10,t+=n}while(t<e.byteLength);return null}};(nt=function(){var e=new Uint8Array,t=0;nt.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(n){var r,i,a,s,o=0,u=0;for(e.length?(s=e.length,(e=new Uint8Array(n.byteLength+s)).set(e.subarray(0,s)),e.set(n,s)):e=n;e.length-u>=3;)if(e[u]!=="I".charCodeAt(0)||e[u+1]!=="D".charCodeAt(0)||e[u+2]!=="3".charCodeAt(0))if(255!=(255&e[u])||240!=(240&e[u+1]))u++;else{if(e.length-u<7)break;if(u+(o=ut.parseAdtsSize(e,u))>e.length)break;a={type:"audio",data:e.subarray(u,u+o),pts:t,dts:t},this.trigger("data",a),u+=o}else{if(e.length-u<10)break;if(u+(o=ut.parseId3TagSize(e,u))>e.length)break;i={type:"timed-metadata",data:e.subarray(u,u+o)},this.trigger("data",i),u+=o}r=e.length-u,e=r>0?e.subarray(u):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new H;var lt,ct,dt,ft,ht=nt,pt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],gt=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],mt=rt.H264Stream,yt=ut.isLikelyAacData,vt=function(e,t){t.stream=e,this.trigger("log",t)},_t=function(e,t){for(var n=Object.keys(t),r=0;r<n.length;r++){var i=n[r];"headOfPipeline"!==i&&t[i].on&&t[i].on("log",vt.bind(e,i))}},Tt=function(e,t){var n;if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0},bt=function(e,t,n,r,i,a){return{start:{dts:e,pts:e+(n-t)},end:{dts:e+(r-t),pts:e+(i-n)},prependedContentDuration:a,baseMediaDecodeTime:e}};ct=function(e,t){var n,r=[],i=0,a=0,s=1/0;n=(t=t||{}).firstSequenceNumber||0,ct.prototype.init.call(this),this.push=function(t){me(e,t),e&&pt.forEach((function(n){e[n]=t[n]})),r.push(t)},this.setEarliestDts=function(e){i=e},this.setVideoBaseMediaDecodeTime=function(e){s=e},this.setAudioAppendStart=function(e){a=e},this.flush=function(){var o,u,l,c,d,f,h;0!==r.length?(o=function(e,t,n){return t.minSegmentDts>=n?e:(t.minSegmentDts=1/0,e.filter((function(e){return e.dts>=n&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)})))}(r,e,i),e.baseMediaDecodeTime=ge(e,t.keepOriginalTimestamps),h=he(e,o,a,s),e.samples=function(e){var t,n,r=[];for(t=0;t<e.length;t++)n=e[t],r.push({size:n.data.byteLength,duration:1024});return r}(o),l=ee(function(e){var t,n,r=0,i=new Uint8Array(function(e){var t,n=0;for(t=0;t<e.length;t++)n+=e[t].data.byteLength;return n}(e));for(t=0;t<e.length;t++)n=e[t],i.set(n.data,r),r+=n.data.byteLength;return i}(o)),r=[],u=te(n,[e]),c=new Uint8Array(u.byteLength+l.byteLength),n++,c.set(u),c.set(l,u.byteLength),pe(e),d=Math.ceil(9216e4/e.samplerate),o.length&&(f=o.length*d,this.trigger("segmentTimingInfo",bt(ce(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+f,o[0].pts+f,h||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+f})),this.trigger("data",{track:e,boxes:c}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.reset=function(){pe(e),r=[],this.trigger("reset")}},ct.prototype=new H,lt=function(e,t){var n,r,i,a=[],s=[];n=(t=t||{}).firstSequenceNumber||0,lt.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){me(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||r||(r=t.config,e.sps=[t.data],gt.forEach((function(t){e[t]=r[t]}),this)),"pic_parameter_set_rbsp"!==t.nalUnitType||i||(i=t.data,e.pps=[t.data]),a.push(t)},this.flush=function(){for(var r,i,o,u,l,c,d,f,h=0;a.length&&"access_unit_delimiter_rbsp"!==a[0].nalUnitType;)a.shift();if(0===a.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(r=function(e){var t,n,r=[],i=[];for(i.byteLength=0,i.nalCount=0,i.duration=0,r.byteLength=0,t=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(n=e[t]).nalUnitType?(r.length&&(r.duration=n.dts-r.dts,i.byteLength+=r.byteLength,i.nalCount+=r.length,i.duration+=r.duration,i.push(r)),(r=[n]).byteLength=n.data.byteLength,r.pts=n.pts,r.dts=n.dts):("slice_layer_without_partitioning_rbsp_idr"===n.nalUnitType&&(r.keyFrame=!0),r.duration=n.dts-r.dts,r.byteLength+=n.data.byteLength,r.push(n));return i.length&&(!r.duration||r.duration<=0)&&(r.duration=i[i.length-1].duration),i.byteLength+=r.byteLength,i.nalCount+=r.length,i.duration+=r.duration,i.push(r),i}(a),(o=function(e){var t,n,r=[],i=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,i.byteLength=0,i.nalCount=0,i.duration=0,i.pts=e[0].pts,i.dts=e[0].dts,t=0;t<e.length;t++)(n=e[t]).keyFrame?(r.length&&(i.push(r),i.byteLength+=r.byteLength,i.nalCount+=r.nalCount,i.duration+=r.duration),(r=[n]).nalCount=n.length,r.byteLength=n.byteLength,r.pts=n.pts,r.dts=n.dts,r.duration=n.duration):(r.duration+=n.duration,r.nalCount+=n.length,r.byteLength+=n.byteLength,r.push(n));return i.length&&r.duration<=0&&(r.duration=i[i.length-1].duration),i.byteLength+=r.byteLength,i.nalCount+=r.nalCount,i.duration+=r.duration,i.push(r),i}(r))[0][0].keyFrame||((i=this.getGopForFusion_(a[0],e))?(h=i.duration,o.unshift(i),o.byteLength+=i.byteLength,o.nalCount+=i.nalCount,o.pts=i.pts,o.dts=i.dts,o.duration+=i.duration):o=function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e}(o)),s.length){var p;if(!(p=t.alignGopsAtEnd?this.alignGopsAtEnd_(o):this.alignGopsAtStart_(o)))return this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");pe(e),o=p}me(e,o),e.samples=function(e,t){var n,r,i,a,s,o=t||0,u=[];for(n=0;n<e.length;n++)for(a=e[n],r=0;r<a.length;r++)s=a[r],o+=(i=ne(s,o)).size,u.push(i);return u}(o),l=ee(function(e){var t,n,r,i,a,s,o=0,u=e.byteLength,l=e.nalCount,c=new Uint8Array(u+4*l),d=new DataView(c.buffer);for(t=0;t<e.length;t++)for(i=e[t],n=0;n<i.length;n++)for(a=i[n],r=0;r<a.length;r++)s=a[r],d.setUint32(o,s.data.byteLength),o+=4,c.set(s.data,o),o+=s.data.byteLength;return c}(o)),e.baseMediaDecodeTime=ge(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),d=o[0],f=o[o.length-1],this.trigger("segmentTimingInfo",bt(e.baseMediaDecodeTime,d.dts,d.pts,f.dts+f.duration,f.pts+f.duration,h)),this.trigger("timingInfo",{start:o[0].pts,end:o[o.length-1].pts+o[o.length-1].duration}),this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),u=te(n,[e]),c=new Uint8Array(u.byteLength+l.byteLength),n++,c.set(u),c.set(l,u.byteLength),this.trigger("data",{track:e,boxes:c}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),a=[],this.gopCache_.length=0,s.length=0,this.trigger("reset")},this.resetStream_=function(){pe(e),r=void 0,i=void 0},this.getGopForFusion_=function(t){var n,r,i,a,s,o=1/0;for(s=0;s<this.gopCache_.length;s++)i=(a=this.gopCache_[s]).gop,e.pps&&Tt(e.pps[0],a.pps[0])&&e.sps&&Tt(e.sps[0],a.sps[0])&&(i.dts<e.timelineStartInfo.dts||(n=t.dts-i.dts-i.duration)>=-1e4&&n<=45e3&&(!r||o>n)&&(r=a,o=n));return r?r.gop:null},this.alignGopsAtStart_=function(e){var t,n,r,i,a,o,u,l;for(a=e.byteLength,o=e.nalCount,u=e.duration,t=n=0;t<s.length&&n<e.length&&(r=s[t],i=e[n],r.pts!==i.pts);)i.pts>r.pts?t++:(n++,a-=i.byteLength,o-=i.nalCount,u-=i.duration);return 0===n?e:n===e.length?null:((l=e.slice(n)).byteLength=a,l.duration=u,l.nalCount=o,l.pts=l[0].pts,l.dts=l[0].dts,l)},this.alignGopsAtEnd_=function(e){var t,n,r,i,a,o,u;for(t=s.length-1,n=e.length-1,a=null,o=!1;t>=0&&n>=0;){if(r=s[t],i=e[n],r.pts===i.pts){o=!0;break}r.pts>i.pts?t--:(t===s.length-1&&(a=n),n--)}if(!o&&null===a)return null;if(0===(u=o?n:a))return e;var l=e.slice(u),c=l.reduce((function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e}),{byteLength:0,duration:0,nalCount:0});return l.byteLength=c.byteLength,l.duration=c.duration,l.nalCount=c.nalCount,l.pts=l[0].pts,l.dts=l[0].dts,l},this.alignGopsWith=function(e){s=e}},lt.prototype=new H,ft=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,ft.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))))}},ft.prototype=new H,ft.prototype.flush=function(e){var t,n,r,i,s=0,o={captions:[],captionStreams:{},metadata:[],info:{}},u=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(u=this.videoTrack.timelineStartInfo.pts,gt.forEach((function(e){o.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(u=this.audioTrack.timelineStartInfo.pts,pt.forEach((function(e){o.info[e]=this.audioTrack[e]}),this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?o.type=this.pendingTracks[0].type:o.type="combined",this.emittedTracks+=this.pendingTracks.length,r=function(e){var t,n=a(),r=l(e);return(t=new Uint8Array(n.byteLength+r.byteLength)).set(n),t.set(r,n.byteLength),t}(this.pendingTracks),o.initSegment=new Uint8Array(r.byteLength),o.initSegment.set(r),o.data=new Uint8Array(this.pendingBytes),i=0;i<this.pendingBoxes.length;i++)o.data.set(this.pendingBoxes[i],s),s+=this.pendingBoxes[i].byteLength;for(i=0;i<this.pendingCaptions.length;i++)(t=this.pendingCaptions[i]).startTime=fe(t.startPts,u,this.keepOriginalTimestamps),t.endTime=fe(t.endPts,u,this.keepOriginalTimestamps),o.captionStreams[t.stream]=!0,o.captions.push(t);for(i=0;i<this.pendingMetadata.length;i++)(n=this.pendingMetadata[i]).cueTime=fe(n.pts,u,this.keepOriginalTimestamps),o.metadata.push(n);for(o.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",o),i=0;i<o.captions.length;i++)t=o.captions[i],this.trigger("caption",t);for(i=0;i<o.metadata.length;i++)n=o.metadata[i],this.trigger("id3Frame",n)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},ft.prototype.setRemux=function(e){this.remuxTracks=e},dt=function(e){var t,n,r=this,i=!0;dt.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var i={};this.transmuxPipeline_=i,i.type="aac",i.metadataStream=new We.MetadataStream,i.aacStream=new ht,i.audioTimestampRolloverStream=new We.TimestampRolloverStream("audio"),i.timedMetadataTimestampRolloverStream=new We.TimestampRolloverStream("timed-metadata"),i.adtsStream=new et,i.coalesceStream=new ft(e,i.metadataStream),i.headOfPipeline=i.aacStream,i.aacStream.pipe(i.audioTimestampRolloverStream).pipe(i.adtsStream),i.aacStream.pipe(i.timedMetadataTimestampRolloverStream).pipe(i.metadataStream).pipe(i.coalesceStream),i.metadataStream.on("timestamp",(function(e){i.aacStream.setTimestamp(e.timeStamp)})),i.aacStream.on("data",(function(a){"timed-metadata"!==a.type&&"audio"!==a.type||i.audioSegmentStream||(n=n||{timelineStartInfo:{baseMediaDecodeTime:r.baseMediaDecodeTime},codec:"adts",type:"audio"},i.coalesceStream.numberOfTracks++,i.audioSegmentStream=new ct(n,e),i.audioSegmentStream.on("log",r.getLogTrigger_("audioSegmentStream")),i.audioSegmentStream.on("timingInfo",r.trigger.bind(r,"audioTimingInfo")),i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream),r.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!t}))})),i.coalesceStream.on("data",this.trigger.bind(this,"data")),i.coalesceStream.on("done",this.trigger.bind(this,"done")),_t(this,i)},this.setupTsPipeline=function(){var i={};this.transmuxPipeline_=i,i.type="ts",i.metadataStream=new We.MetadataStream,i.packetStream=new We.TransportPacketStream,i.parseStream=new We.TransportParseStream,i.elementaryStream=new We.ElementaryStream,i.timestampRolloverStream=new We.TimestampRolloverStream,i.adtsStream=new et,i.h264Stream=new mt,i.captionStream=new We.CaptionStream(e),i.coalesceStream=new ft(e,i.metadataStream),i.headOfPipeline=i.packetStream,i.packetStream.pipe(i.parseStream).pipe(i.elementaryStream).pipe(i.timestampRolloverStream),i.timestampRolloverStream.pipe(i.h264Stream),i.timestampRolloverStream.pipe(i.adtsStream),i.timestampRolloverStream.pipe(i.metadataStream).pipe(i.coalesceStream),i.h264Stream.pipe(i.captionStream).pipe(i.coalesceStream),i.elementaryStream.on("data",(function(a){var s;if("metadata"===a.type){for(s=a.tracks.length;s--;)t||"video"!==a.tracks[s].type?n||"audio"!==a.tracks[s].type||((n=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=r.baseMediaDecodeTime):(t=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=r.baseMediaDecodeTime;t&&!i.videoSegmentStream&&(i.coalesceStream.numberOfTracks++,i.videoSegmentStream=new lt(t,e),i.videoSegmentStream.on("log",r.getLogTrigger_("videoSegmentStream")),i.videoSegmentStream.on("timelineStartInfo",(function(t){n&&!e.keepOriginalTimestamps&&(n.timelineStartInfo=t,i.audioSegmentStream.setEarliestDts(t.dts-r.baseMediaDecodeTime))})),i.videoSegmentStream.on("processedGopsInfo",r.trigger.bind(r,"gopInfo")),i.videoSegmentStream.on("segmentTimingInfo",r.trigger.bind(r,"videoSegmentTimingInfo")),i.videoSegmentStream.on("baseMediaDecodeTime",(function(e){n&&i.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),i.videoSegmentStream.on("timingInfo",r.trigger.bind(r,"videoTimingInfo")),i.h264Stream.pipe(i.videoSegmentStream).pipe(i.coalesceStream)),n&&!i.audioSegmentStream&&(i.coalesceStream.numberOfTracks++,i.audioSegmentStream=new ct(n,e),i.audioSegmentStream.on("log",r.getLogTrigger_("audioSegmentStream")),i.audioSegmentStream.on("timingInfo",r.trigger.bind(r,"audioTimingInfo")),i.audioSegmentStream.on("segmentTimingInfo",r.trigger.bind(r,"audioSegmentTimingInfo")),i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream)),r.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!t})}})),i.coalesceStream.on("data",this.trigger.bind(this,"data")),i.coalesceStream.on("id3Frame",(function(e){e.dispatchType=i.metadataStream.dispatchType,r.trigger("id3Frame",e)})),i.coalesceStream.on("caption",this.trigger.bind(this,"caption")),i.coalesceStream.on("done",this.trigger.bind(this,"done")),_t(this,i)},this.setBaseMediaDecodeTime=function(r){var i=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=r),n&&(n.timelineStartInfo.dts=void 0,n.timelineStartInfo.pts=void 0,pe(n),i.audioTimestampRolloverStream&&i.audioTimestampRolloverStream.discontinuity()),t&&(i.videoSegmentStream&&(i.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,pe(t),i.captionStream.reset()),i.timestampRolloverStream&&i.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){n&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var n=this.transmuxPipeline_;e.remux=t,n&&n.coalesceStream&&n.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.getLogTrigger_=function(e){var t=this;return function(n){n.stream=e,t.trigger("log",n)}},this.push=function(e){if(i){var t=yt(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),i=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){i=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},dt.prototype=new H;var Et,St,wt,At={Transmuxer:dt,VideoSegmentStream:lt,AudioSegmentStream:ct,AUDIO_PROPERTIES:pt,VIDEO_PROPERTIES:gt,generateSegmentTimingInfo:bt},It=function(e){return e>>>0},Ct=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),(t+=String.fromCharCode(e[2]))+String.fromCharCode(e[3])},Rt=It,Dt=function e(t,n){var r,i,a,s,o,u=[];if(!n.length)return null;for(r=0;r<t.byteLength;)i=Rt(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3]),a=Ct(t.subarray(r+4,r+8)),s=i>1?r+i:t.byteLength,a===n[0]&&(1===n.length?u.push(t.subarray(r+8,s)):(o=e(t.subarray(r+8,s),n.slice(1))).length&&(u=u.concat(o))),r=s;return u},xt=It,Nt=V.getUint64,Ot=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},Pt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},Mt="undefined"!=typeof window?window:void 0!==Pt?Pt:"undefined"!=typeof self?self:{},kt=function(e){for(var t,n,r=e.byteLength,i=[],a=1;a<r-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(i.push(a+2),a+=2):a++;if(0===i.length)return e;t=r-i.length,n=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===i[0]&&(s++,i.shift()),n[a]=e[s];return n},Lt=Re.CaptionStream,Ft=function(e,t){for(var n=e,r=0;r<t.length;r++){var i=t[r];if(n<i.size)return i;n-=i.size}return null},Ut=function(e,t){var n=Dt(e,["moof","traf"]),r=Dt(e,["mdat"]),i={},a=[];return r.forEach((function(e,t){var r=n[t];a.push({mdat:e,traf:r})})),a.forEach((function(e){var n,r,a=e.mdat,s=e.traf,o=function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:n.getUint32(4)},i=1&r.flags[2],a=2&r.flags[2],s=8&r.flags[2],o=16&r.flags[2],u=32&r.flags[2],l=65536&r.flags[0],c=131072&r.flags[0];return t=8,i&&(t+=4,r.baseDataOffset=n.getUint32(12),t+=4),a&&(r.sampleDescriptionIndex=n.getUint32(t),t+=4),s&&(r.defaultSampleDuration=n.getUint32(t),t+=4),o&&(r.defaultSampleSize=n.getUint32(t),t+=4),u&&(r.defaultSampleFlags=n.getUint32(t)),l&&(r.durationIsEmpty=!0),!i&&c&&(r.baseDataOffsetIsMoof=!0),r}(Dt(s,["tfhd"])[0]),u=o.trackId,l=Dt(s,["tfdt"]),c=l.length>0?function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return 1===t.version?t.baseMediaDecodeTime=Nt(e.subarray(4)):t.baseMediaDecodeTime=xt(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t}(l[0]).baseMediaDecodeTime:0,d=Dt(s,["trun"]);t===u&&d.length>0&&(n=function(e,t,n){var r=t,i=n.defaultSampleDuration||0,a=n.defaultSampleSize||0,s=n.trackId,o=[];return e.forEach((function(e){var t=function(e){var t,n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},r=new DataView(e.buffer,e.byteOffset,e.byteLength),i=1&n.flags[2],a=4&n.flags[2],s=1&n.flags[1],o=2&n.flags[1],u=4&n.flags[1],l=8&n.flags[1],c=r.getUint32(4),d=8;for(i&&(n.dataOffset=r.getInt32(d),d+=4),a&&c&&(t={flags:Ot(e.subarray(d,d+4))},d+=4,s&&(t.duration=r.getUint32(d),d+=4),o&&(t.size=r.getUint32(d),d+=4),l&&(1===n.version?t.compositionTimeOffset=r.getInt32(d):t.compositionTimeOffset=r.getUint32(d),d+=4),n.samples.push(t),c--);c--;)t={},s&&(t.duration=r.getUint32(d),d+=4),o&&(t.size=r.getUint32(d),d+=4),u&&(t.flags=Ot(e.subarray(d,d+4)),d+=4),l&&(1===n.version?t.compositionTimeOffset=r.getInt32(d):t.compositionTimeOffset=r.getUint32(d),d+=4),n.samples.push(t);return n}(e).samples;t.forEach((function(e){void 0===e.duration&&(e.duration=i),void 0===e.size&&(e.size=a),e.trackId=s,e.dts=r,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),"bigint"==typeof r?(e.pts=r+Mt.BigInt(e.compositionTimeOffset),r+=Mt.BigInt(e.duration)):(e.pts=r+e.compositionTimeOffset,r+=e.duration)})),o=o.concat(t)})),o}(d,c,o),r=function(e,t,n){var r,i,a,s,o=new DataView(e.buffer,e.byteOffset,e.byteLength),u={logs:[],seiNals:[]};for(i=0;i+4<e.length;i+=a)if(a=o.getUint32(i),i+=4,!(a<=0))switch(31&e[i]){case 6:var l=e.subarray(i+1,i+1+a),c=Ft(i,t);if(r={nalUnitType:"sei_rbsp",size:a,data:l,escapedRBSP:kt(l),trackId:n},c)r.pts=c.pts,r.dts=c.dts,s=c;else{if(!s){u.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+i+" for trackId "+n+". See mux.js#223."});break}r.pts=s.pts,r.dts=s.dts}u.seiNals.push(r)}return u}(a,n,u),i[u]||(i[u]={seiNals:[],logs:[]}),i[u].seiNals=i[u].seiNals.concat(r.seiNals),i[u].logs=i[u].logs.concat(r.logs))})),i},Bt=function(){var e,t,n,r,i,a,s=!1;this.isInitialized=function(){return s},this.init=function(t){e=new Lt,s=!0,a=!!t&&t.isPartial,e.on("data",(function(e){e.startTime=e.startPts/r,e.endTime=e.endPts/r,i.captions.push(e),i.captionStreams[e.stream]=!0})),e.on("log",(function(e){i.logs.push(e)}))},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length||n===e[0]&&r===t[n])},this.parse=function(e,a,s){var o;if(!this.isInitialized())return null;if(!a||!s)return null;if(this.isNewInit(a,s))n=a[0],r=s[n];else if(null===n||!r)return t.push(e),null;for(;t.length>0;){var u=t.shift();this.parse(u,a,s)}return o=function(e,t,n){if(null===t)return null;var r=Ut(e,t)[t]||{};return{seiNals:r.seiNals,logs:r.logs,timescale:n}}(e,n,r),o&&o.logs&&(i.logs=i.logs.concat(o.logs)),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),i):i.logs.length?{logs:i.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach((function(t){e.push(t)}))},this.flushStream=function(){if(!this.isInitialized())return null;a?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){i.captions=[],i.captionStreams={},i.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],n=null,r=null,i?this.clearParsedCaptions():i={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},jt=It,qt=function(e){return("00"+e.toString(16)).slice(-2)},Ht=V.getUint64;Et=function(e,t){var n=Dt(t,["moof","traf"]).reduce((function(t,n){var r,i,a=Dt(n,["tfhd"])[0],s=jt(a[4]<<24|a[5]<<16|a[6]<<8|a[7]),o=e[s]||9e4,u=Dt(n,["tfdt"])[0],l=new DataView(u.buffer,u.byteOffset,u.byteLength);return"bigint"==typeof(r=1===u[0]?Ht(u.subarray(4,12)):l.getUint32(4))?i=r/Mt.BigInt(o):"number"!=typeof r||isNaN(r)||(i=r/o),i<Number.MAX_SAFE_INTEGER&&(i=Number(i)),i<t&&(t=i),t}),1/0);return"bigint"==typeof n||isFinite(n)?n:0},wt=function(e){var t=0===e[0]?12:20;return jt(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},St=function(e){var t=Dt(e,["moov","trak"]),n=[];return t.forEach((function(e){var t,r,i={},a=Dt(e,["tkhd"])[0];a&&(r=(t=new DataView(a.buffer,a.byteOffset,a.byteLength)).getUint8(0),i.id=0===r?t.getUint32(12):t.getUint32(20));var s=Dt(e,["mdia","hdlr"])[0];if(s){var o=Ct(s.subarray(8,12));i.type="vide"===o?"video":"soun"===o?"audio":o}var u=Dt(e,["mdia","minf","stbl","stsd"])[0];if(u){var l=u.subarray(8);i.codec=Ct(l.subarray(4,8));var c,d=Dt(l,[i.codec])[0];d&&(/^[asm]vc[1-9]$/i.test(i.codec)?(c=d.subarray(78),"avcC"===Ct(c.subarray(4,8))&&c.length>11?(i.codec+=".",i.codec+=qt(c[9]),i.codec+=qt(c[10]),i.codec+=qt(c[11])):i.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(i.codec)?(c=d.subarray(28),"esds"===Ct(c.subarray(4,8))&&c.length>20&&0!==c[19]?(i.codec+="."+qt(c[19]),i.codec+="."+qt(c[20]>>>2&63).replace(/^0/,"")):i.codec="mp4a.40.2"):i.codec=i.codec.toLowerCase())}var f=Dt(e,["mdia","mdhd"])[0];f&&(i.timescale=wt(f)),n.push(i)})),n};var Gt=Et,Vt=St,Yt=function(e){var t=31&e[1];return(t<<=8)|e[2]},zt=function(e){return!!(64&e[1])},Zt=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},Kt=function(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Wt={parseType:function(e,t){var n=Yt(e);return 0===n?"pat":n===t?"pmt":t?"pes":null},parsePat:function(e){var t=zt(e),n=4+Zt(e);return t&&(n+=e[n]+1),(31&e[n+10])<<8|e[n+11]},parsePmt:function(e){var t={},n=zt(e),r=4+Zt(e);if(n&&(r+=e[r]+1),1&e[r+5]){var i;i=3+((15&e[r+1])<<8|e[r+2])-4;for(var a=12+((15&e[r+10])<<8|e[r+11]);a<i;){var s=r+a;t[(31&e[s+1])<<8|e[s+2]]=e[s],a+=5+((15&e[s+3])<<8|e[s+4])}return t}},parsePayloadUnitStartIndicator:zt,parsePesType:function(e,t){switch(t[Yt(e)]){case De.H264_STREAM_TYPE:return"video";case De.ADTS_STREAM_TYPE:return"audio";case De.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){if(!zt(e))return null;var t=4+Zt(e);if(t>=e.byteLength)return null;var n,r=null;return 192&(n=e[t+7])&&((r={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,r.pts*=4,r.pts+=(6&e[t+13])>>>1,r.dts=r.pts,64&n&&(r.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,r.dts*=4,r.dts+=(6&e[t+18])>>>1)),r},videoPacketContainsKeyFrame:function(e){for(var t=4+Zt(e),n=e.subarray(t),r=0,i=0,a=!1;i<n.byteLength-3;i++)if(1===n[i+2]){r=i+5;break}for(;r<n.byteLength;)switch(n[r]){case 0:if(0!==n[r-1]){r+=2;break}if(0!==n[r-2]){r++;break}i+3!==r-2&&"slice_layer_without_partitioning_rbsp_idr"===Kt(31&n[i+3])&&(a=!0);do{r++}while(1!==n[r]&&r<n.length);i=r-2,r+=3;break;case 1:if(0!==n[r-1]||0!==n[r-2]){r+=3;break}"slice_layer_without_partitioning_rbsp_idr"===Kt(31&n[i+3])&&(a=!0),i=r-2,r+=3;break;default:r+=3}return n=n.subarray(i),r-=i,i=0,n&&n.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===Kt(31&n[i+3])&&(a=!0),a}},Xt=ke,$t={};$t.ts=Wt,$t.aac=ut;var Qt=oe,Jt=188,en=71,tn=function(e,t,n){for(var r,i,a,s,o=0,u=Jt,l=!1;u<=e.byteLength;)if(e[o]!==en||e[u]!==en&&u!==e.byteLength)o++,u++;else{if(r=e.subarray(o,u),"pes"===$t.ts.parseType(r,t.pid)&&(i=$t.ts.parsePesType(r,t.table),a=$t.ts.parsePayloadUnitStartIndicator(r),"audio"===i&&a&&(s=$t.ts.parsePesTime(r))&&(s.type="audio",n.audio.push(s),l=!0)),l)break;o+=Jt,u+=Jt}for(o=(u=e.byteLength)-Jt,l=!1;o>=0;)if(e[o]!==en||e[u]!==en&&u!==e.byteLength)o--,u--;else{if(r=e.subarray(o,u),"pes"===$t.ts.parseType(r,t.pid)&&(i=$t.ts.parsePesType(r,t.table),a=$t.ts.parsePayloadUnitStartIndicator(r),"audio"===i&&a&&(s=$t.ts.parsePesTime(r))&&(s.type="audio",n.audio.push(s),l=!0)),l)break;o-=Jt,u-=Jt}},nn=function(e,t,n){for(var r,i,a,s,o,u,l,c=0,d=Jt,f=!1,h={data:[],size:0};d<e.byteLength;)if(e[c]!==en||e[d]!==en)c++,d++;else{if(r=e.subarray(c,d),"pes"===$t.ts.parseType(r,t.pid)&&(i=$t.ts.parsePesType(r,t.table),a=$t.ts.parsePayloadUnitStartIndicator(r),"video"===i&&(a&&!f&&(s=$t.ts.parsePesTime(r))&&(s.type="video",n.video.push(s),f=!0),!n.firstKeyFrame))){if(a&&0!==h.size){for(o=new Uint8Array(h.size),u=0;h.data.length;)l=h.data.shift(),o.set(l,u),u+=l.byteLength;if($t.ts.videoPacketContainsKeyFrame(o)){var p=$t.ts.parsePesTime(o);p?(n.firstKeyFrame=p,n.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}h.size=0}h.data.push(r),h.size+=r.byteLength}if(f&&n.firstKeyFrame)break;c+=Jt,d+=Jt}for(c=(d=e.byteLength)-Jt,f=!1;c>=0;)if(e[c]!==en||e[d]!==en)c--,d--;else{if(r=e.subarray(c,d),"pes"===$t.ts.parseType(r,t.pid)&&(i=$t.ts.parsePesType(r,t.table),a=$t.ts.parsePayloadUnitStartIndicator(r),"video"===i&&a&&(s=$t.ts.parsePesTime(r))&&(s.type="video",n.video.push(s),f=!0)),f)break;c-=Jt,d-=Jt}},rn=function(e,t){var n;return n=$t.aac.isLikelyAacData(e)?function(e){for(var t,n=!1,r=0,i=null,a=null,s=0,o=0;e.length-o>=3;){switch($t.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){n=!0;break}if((s=$t.aac.parseId3TagSize(e,o))>e.length){n=!0;break}null===a&&(t=e.subarray(o,o+s),a=$t.aac.parseAacTimestamp(t)),o+=s;break;case"audio":if(e.length-o<7){n=!0;break}if((s=$t.aac.parseAdtsSize(e,o))>e.length){n=!0;break}null===i&&(t=e.subarray(o,o+s),i=$t.aac.parseSampleRate(t)),r++,o+=s;break;default:o++}if(n)return null}if(null===i||null===a)return null;var u=Qt/i;return{audio:[{type:"audio",dts:a,pts:a},{type:"audio",dts:a+1024*r*u,pts:a+1024*r*u}]}}(e):function(e){var t={pid:null,table:null},n={};for(var r in function(e,t){for(var n,r=0,i=Jt;i<e.byteLength;)if(e[r]!==en||e[i]!==en)r++,i++;else{switch(n=e.subarray(r,i),$t.ts.parseType(n,t.pid)){case"pat":t.pid=$t.ts.parsePat(n);break;case"pmt":var a=$t.ts.parsePmt(n);t.table=t.table||{},Object.keys(a).forEach((function(e){t.table[e]=a[e]}))}r+=Jt,i+=Jt}}(e,t),t.table)if(t.table.hasOwnProperty(r))switch(t.table[r]){case De.H264_STREAM_TYPE:n.video=[],nn(e,t,n),0===n.video.length&&delete n.video;break;case De.ADTS_STREAM_TYPE:n.audio=[],tn(e,t,n),0===n.audio.length&&delete n.audio}return n}(e),n&&(n.audio||n.video)?(function(e,t){if(e.audio&&e.audio.length){var n=t;(void 0===n||isNaN(n))&&(n=e.audio[0].dts),e.audio.forEach((function(e){e.dts=Xt(e.dts,n),e.pts=Xt(e.pts,n),e.dtsTime=e.dts/Qt,e.ptsTime=e.pts/Qt}))}if(e.video&&e.video.length){var r=t;if((void 0===r||isNaN(r))&&(r=e.video[0].dts),e.video.forEach((function(e){e.dts=Xt(e.dts,r),e.pts=Xt(e.pts,r),e.dtsTime=e.dts/Qt,e.ptsTime=e.pts/Qt})),e.firstKeyFrame){var i=e.firstKeyFrame;i.dts=Xt(i.dts,r),i.pts=Xt(i.pts,r),i.dtsTime=i.dts/Qt,i.ptsTime=i.pts/Qt}}}(n,t),n):null},an=function(){function e(e,t){this.options=t||{},this.self=e,this.init()}var t=e.prototype;return t.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new At.Transmuxer(this.options),function(e,t){t.on("data",(function(t){var n=t.initSegment;t.initSegment={data:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength};var r=t.data;t.data=r.buffer,e.postMessage({action:"data",segment:t,byteOffset:r.byteOffset,byteLength:r.byteLength},[t.data])})),t.on("done",(function(t){e.postMessage({action:"done"})})),t.on("gopInfo",(function(t){e.postMessage({action:"gopInfo",gopInfo:t})})),t.on("videoSegmentTimingInfo",(function(t){var n={start:{decode:le(t.start.dts),presentation:le(t.start.pts)},end:{decode:le(t.end.dts),presentation:le(t.end.pts)},baseMediaDecodeTime:le(t.baseMediaDecodeTime)};t.prependedContentDuration&&(n.prependedContentDuration=le(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:n})})),t.on("audioSegmentTimingInfo",(function(t){var n={start:{decode:le(t.start.dts),presentation:le(t.start.pts)},end:{decode:le(t.end.dts),presentation:le(t.end.pts)},baseMediaDecodeTime:le(t.baseMediaDecodeTime)};t.prependedContentDuration&&(n.prependedContentDuration=le(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:n})})),t.on("id3Frame",(function(t){e.postMessage({action:"id3Frame",id3Frame:t})})),t.on("caption",(function(t){e.postMessage({action:"caption",caption:t})})),t.on("trackinfo",(function(t){e.postMessage({action:"trackinfo",trackInfo:t})})),t.on("audioTimingInfo",(function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:le(t.start),end:le(t.end)}})})),t.on("videoTimingInfo",(function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:le(t.start),end:le(t.end)}})})),t.on("log",(function(t){e.postMessage({action:"log",log:t})}))}(this.self,this.transmuxer)},t.pushMp4Captions=function(e){this.captionParser||(this.captionParser=new Bt,this.captionParser.init());var t=new Uint8Array(e.data,e.byteOffset,e.byteLength),n=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:n&&n.captions||[],logs:n&&n.logs||[],data:t.buffer},[t.buffer])},t.probeMp4StartTime=function(e){var t=e.timescales,n=e.data,r=Gt(t,n);this.self.postMessage({action:"probeMp4StartTime",startTime:r,data:n},[n.buffer])},t.probeMp4Tracks=function(e){var t=e.data,n=Vt(t);this.self.postMessage({action:"probeMp4Tracks",tracks:n,data:t},[t.buffer])},t.probeTs=function(e){var t=e.data,n=e.baseStartTime,r="number"!=typeof n||isNaN(n)?void 0:n*oe,i=rn(t,r),a=null;i&&((a={hasVideo:i.video&&2===i.video.length||!1,hasAudio:i.audio&&2===i.audio.length||!1}).hasVideo&&(a.videoStart=i.video[0].ptsTime),a.hasAudio&&(a.audioStart=i.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:a,data:t},[t.buffer])},t.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},t.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},t.push=function(e){var t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)},t.reset=function(){this.transmuxer.reset()},t.setTimestampOffset=function(e){var t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(ue(t)))},t.setAudioAppendStart=function(e){this.transmuxer.setAudioAppendStart(Math.ceil(ue(e.appendStart)))},t.setRemux=function(e){this.transmuxer.setRemux(e.remux)},t.flush=function(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},t.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},t.alignGopsWith=function(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())},e}();self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new an(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new an(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}}))),su=nu(au),ou=function(e){var t=e.transmuxer,n=e.bytes,r=e.audioAppendStart,i=e.gopsToAlignWith,a=e.remux,s=e.onData,o=e.onTrackInfo,u=e.onAudioTimingInfo,l=e.onVideoTimingInfo,c=e.onVideoSegmentTimingInfo,d=e.onAudioSegmentTimingInfo,f=e.onId3,h=e.onCaptions,p=e.onDone,g=e.onEndedTimeline,m=e.onTransmuxerLog,y=e.isEndOfTimeline,v={buffer:[]},_=y;if(t.onmessage=function(n){t.currentTransmux===e&&("data"===n.data.action&&function(e,t,n){var r=e.data.segment,i=r.type,a=r.initSegment,s=r.captions,o=r.captionStreams,u=r.metadata,l=r.videoFrameDtsTime,c=r.videoFramePtsTime;t.buffer.push({captions:s,captionStreams:o,metadata:u});var d=e.data.segment.boxes||{data:e.data.segment.data},f={type:i,data:new Uint8Array(d.data,d.data.byteOffset,d.data.byteLength),initSegment:new Uint8Array(a.data,a.byteOffset,a.byteLength)};void 0!==l&&(f.videoFrameDtsTime=l),void 0!==c&&(f.videoFramePtsTime=c),n(f)}(n,v,s),"trackinfo"===n.data.action&&o(n.data.trackInfo),"gopInfo"===n.data.action&&function(e,t){t.gopInfo=e.data.gopInfo}(n,v),"audioTimingInfo"===n.data.action&&u(n.data.audioTimingInfo),"videoTimingInfo"===n.data.action&&l(n.data.videoTimingInfo),"videoSegmentTimingInfo"===n.data.action&&c(n.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===n.data.action&&d(n.data.audioSegmentTimingInfo),"id3Frame"===n.data.action&&f([n.data.id3Frame],n.data.id3Frame.dispatchType),"caption"===n.data.action&&h(n.data.caption),"endedtimeline"===n.data.action&&(_=!1,g()),"log"===n.data.action&&m(n.data.log),"transmuxed"===n.data.type&&(_||(t.onmessage=null,function(e){var t=e.transmuxedData,n=e.callback;t.buffer=[],n(t)}({transmuxedData:v,callback:p}),uu(t))))},r&&t.postMessage({action:"setAudioAppendStart",appendStart:r}),Array.isArray(i)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:i}),void 0!==a&&t.postMessage({action:"setRemux",remux:a}),n.byteLength){var T=n instanceof ArrayBuffer?n:n.buffer,b=n instanceof ArrayBuffer?0:n.byteOffset;t.postMessage({action:"push",data:T,byteOffset:b,byteLength:n.byteLength},[T])}y&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},uu=function(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():ou(e.currentTransmux))},lu=function(e,t){e.postMessage({action:t}),uu(e)},cu=function(e){!function(e,t){if(!t.currentTransmux)return t.currentTransmux=e,void lu(t,e);t.transmuxQueue.push(lu.bind(null,t,e))}("reset",e)},du=function(e){var t=e.transmuxer,n=e.endAction||e.action,r=e.callback,i=(0,l.Z)({},e,{endAction:null,transmuxer:null,callback:null});if(t.addEventListener("message",(function i(a){a.data.action===n&&(t.removeEventListener("message",i),a.data.data&&(a.data.data=new Uint8Array(a.data.data,e.byteOffset||0,e.byteLength||a.data.data.byteLength),e.data&&(e.data=a.data.data)),r(a.data))})),e.data){var a=e.data instanceof ArrayBuffer;i.byteOffset=a?0:e.data.byteOffset,i.byteLength=e.data.byteLength;var s=[a?e.data:e.data.buffer];t.postMessage(i,s)}else t.postMessage(i)},fu=-101,hu=-102,pu=function(e){e.forEach((function(e){e.abort()}))},gu=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:fu,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:hu,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:2,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:2,xhr:t}:null},mu=function(e,t,n){return function(r,i){var a=i.response,s=gu(r,i);if(s)return n(s,e);if(16!==a.byteLength)return n({status:i.status,message:"Invalid HLS key at URL: "+i.uri,code:2,xhr:i},e);for(var o=new DataView(a),u=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]),l=0;l<t.length;l++)t[l].bytes=u;return n(null,e)}},yu=function(e,t){var n=pt(e.map.bytes);if("mp4"!==n){var r=e.map.resolvedUri||e.map.uri;return t({internal:!0,message:"Found unsupported "+(n||"unknown")+" container for initialization segment at URL: "+r,code:2})}du({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:function(n){var r=n.tracks,i=n.data;return e.map.bytes=i,r.forEach((function(t){e.map.tracks=e.map.tracks||{},e.map.tracks[t.type]||(e.map.tracks[t.type]=t,"number"==typeof t.id&&t.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[t.id]=t.timescale))})),t(null)}})},vu=function(e){var t=e.segment,n=e.bytes,r=e.trackInfoFn,i=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,f=e.doneFn,h=e.onTransmuxerLog,p=t.map&&t.map.tracks||{},g=Boolean(p.audio&&p.video),m=i.bind(null,t,"audio","start"),y=i.bind(null,t,"audio","end"),v=i.bind(null,t,"video","start"),_=i.bind(null,t,"video","end");du({action:"probeTs",transmuxer:t.transmuxer,data:n,baseStartTime:t.baseStartTime,callback:function(e){t.bytes=n=e.data;var i=e.result;i&&(r(t,{hasAudio:i.hasAudio,hasVideo:i.hasVideo,isMuxed:g}),r=null,i.hasAudio&&!g&&m(i.audioStart),i.hasVideo&&v(i.videoStart),m=null,v=null),function(e){if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void ou(e);e.transmuxer.transmuxQueue.push(e)}({bytes:n,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,remux:g,onData:function(e){e.type="combined"===e.type?"video":e.type,d(t,e)},onTrackInfo:function(e){r&&(g&&(e.isMuxed=!0),r(t,e))},onAudioTimingInfo:function(e){m&&void 0!==e.start&&(m(e.start),m=null),y&&void 0!==e.end&&y(e.end)},onVideoTimingInfo:function(e){v&&void 0!==e.start&&(v(e.start),v=null),_&&void 0!==e.end&&_(e.end)},onVideoSegmentTimingInfo:function(e){a(e)},onAudioSegmentTimingInfo:function(e){s(e)},onId3:function(e,n){o(t,e,n)},onCaptions:function(e){u(t,[e])},isEndOfTimeline:l,onEndedTimeline:function(){c()},onTransmuxerLog:h,onDone:function(e){f&&(e.type="combined"===e.type?"video":e.type,f(null,t,e))}})}})},_u=function(e){var t=e.segment,n=e.bytes,r=e.trackInfoFn,i=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,f=e.doneFn,h=e.onTransmuxerLog,p=new Uint8Array(n);if(function(e){return Qe(e,["moof"]).length>0}(p)){t.isFmp4=!0;var g=t.map.tracks,m={isFmp4:!0,hasVideo:!!g.video,hasAudio:!!g.audio};g.audio&&g.audio.codec&&"enca"!==g.audio.codec&&(m.audioCodec=g.audio.codec),g.video&&g.video.codec&&"encv"!==g.video.codec&&(m.videoCodec=g.video.codec),g.video&&g.audio&&(m.isMuxed=!0),r(t,m);var y=function(e){d(t,{data:p,type:m.hasAudio&&!m.isMuxed?"audio":"video"}),e&&e.length&&u(t,e),f(null,t,{})};du({action:"probeMp4StartTime",timescales:t.map.timescales,data:p,transmuxer:t.transmuxer,callback:function(e){var r=e.data,a=e.startTime;n=r.buffer,t.bytes=p=r,m.hasAudio&&!m.isMuxed&&i(t,"audio","start",a),m.hasVideo&&i(t,"video","start",a),g.video&&r.byteLength&&t.transmuxer?du({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:p,timescales:t.map.timescales,trackIds:[g.video.id],callback:function(e){n=e.data.buffer,t.bytes=p=e.data,e.logs.forEach((function(e){h(Ls.mergeOptions(e,{stream:"mp4CaptionParser"}))})),y(e.captions)}}):y()}})}else if(t.transmuxer){if(void 0===t.container&&(t.container=pt(p)),"ts"!==t.container&&"aac"!==t.container)return r(t,{hasAudio:!1,hasVideo:!1}),void f(null,t,{});vu({segment:t,bytes:n,trackInfoFn:r,timingInfoFn:i,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:f,onTransmuxerLog:h})}else f(null,t,{})},Tu=function(e,t){var n,r=e.id,i=e.key,a=e.encryptedBytes,s=e.decryptionWorker;s.addEventListener("message",(function e(n){if(n.data.source===r){s.removeEventListener("message",e);var i=n.data.decrypted;t(new Uint8Array(i.bytes,i.byteOffset,i.byteLength))}})),n=i.bytes.slice?i.bytes.slice():new Uint32Array(Array.prototype.slice.call(i.bytes)),s.postMessage(jo({source:r,encrypted:a,key:n,iv:i.iv}),[a.buffer,n.buffer])},bu=function(e){var t=e.xhr,n=e.xhrOptions,r=e.decryptionWorker,i=e.segment,a=e.abortFn,s=e.progressFn,o=e.trackInfoFn,u=e.timingInfoFn,l=e.videoSegmentTimingInfoFn,c=e.audioSegmentTimingInfoFn,d=e.id3Fn,f=e.captionsFn,h=e.isEndOfTimeline,p=e.endedTimelineFn,g=e.dataFn,m=e.doneFn,y=e.onTransmuxerLog,v=[],_=function(e){var t=e.activeXhrs,n=e.decryptionWorker,r=e.trackInfoFn,i=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,f=e.doneFn,h=e.onTransmuxerLog,p=0,g=!1;return function(e,m){if(!g){if(e)return g=!0,pu(t),f(e,m);if((p+=1)===t.length){var y=function(){if(m.encryptedBytes)return function(e){var t=e.decryptionWorker,n=e.segment,r=e.trackInfoFn,i=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,f=e.doneFn,h=e.onTransmuxerLog;Tu({id:n.requestId,key:n.key,encryptedBytes:n.encryptedBytes,decryptionWorker:t},(function(e){n.bytes=e,_u({segment:n,bytes:n.bytes,trackInfoFn:r,timingInfoFn:i,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:f,onTransmuxerLog:h})}))}({decryptionWorker:n,segment:m,trackInfoFn:r,timingInfoFn:i,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:f,onTransmuxerLog:h});_u({segment:m,bytes:m.bytes,trackInfoFn:r,timingInfoFn:i,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:f,onTransmuxerLog:h})};if(m.endOfAllRequests=Date.now(),m.map&&m.map.encryptedBytes&&!m.map.bytes)return Tu({decryptionWorker:n,id:m.requestId+"-init",encryptedBytes:m.map.encryptedBytes,key:m.map.key},(function(e){m.map.bytes=e,yu(m,(function(e){if(e)return pu(t),f(e,m);y()}))}));y()}}}}({activeXhrs:v,decryptionWorker:r,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:d,captionsFn:f,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:m,onTransmuxerLog:y});if(i.key&&!i.key.bytes){var T=[i.key];i.map&&!i.map.bytes&&i.map.key&&i.map.key.resolvedUri===i.key.resolvedUri&&T.push(i.map.key);var b=t(Ls.mergeOptions(n,{uri:i.key.resolvedUri,responseType:"arraybuffer"}),mu(i,T,_));v.push(b)}if(i.map&&!i.map.bytes){if(i.map.key&&(!i.key||i.key.resolvedUri!==i.map.key.resolvedUri)){var E=t(Ls.mergeOptions(n,{uri:i.map.key.resolvedUri,responseType:"arraybuffer"}),mu(i,[i.map.key],_));v.push(E)}var S=Ls.mergeOptions(n,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:Lo(i.map)}),w=function(e){var t=e.segment,n=e.finishProcessingFn;return function(e,r){var i=gu(e,r);if(i)return n(i,t);var a=new Uint8Array(r.response);if(t.map.key)return t.map.encryptedBytes=a,n(null,t);t.map.bytes=a,yu(t,(function(e){if(e)return e.xhr=r,e.status=r.status,n(e,t);n(null,t)}))}}({segment:i,finishProcessingFn:_}),A=t(S,w);v.push(A)}var I=Ls.mergeOptions(n,{uri:i.part&&i.part.resolvedUri||i.resolvedUri,responseType:"arraybuffer",headers:Lo(i)}),C=t(I,function(e){var t=e.segment,n=e.finishProcessingFn,r=e.responseType;return function(e,i){var a=gu(e,i);if(a)return n(a,t);var s="arraybuffer"!==r&&i.responseText?function(e){for(var t=new Uint8Array(new ArrayBuffer(e.length)),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t.buffer}(i.responseText.substring(t.lastReachedChar||0)):i.response;return t.stats=function(e){return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}}(i),t.key?t.encryptedBytes=new Uint8Array(s):t.bytes=new Uint8Array(s),n(null,t)}}({segment:i,finishProcessingFn:_,responseType:I.responseType}));C.addEventListener("progress",function(e){var t=e.segment,n=e.progressFn;return e.trackInfoFn,e.timingInfoFn,e.videoSegmentTimingInfoFn,e.audioSegmentTimingInfoFn,e.id3Fn,e.captionsFn,e.isEndOfTimeline,e.endedTimelineFn,e.dataFn,function(e){if(!e.target.aborted)return t.stats=Ls.mergeOptions(t.stats,(i=(r=e).target,(a={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-i.requestTime||0}).bytesReceived=r.loaded,a.bandwidth=Math.floor(a.bytesReceived/a.roundTripTime*8*1e3),a)),!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived&&(t.stats.firstBytesReceivedAt=Date.now()),n(e,t);var r,i,a}}({segment:i,progressFn:s,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:d,captionsFn:f,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g})),v.push(C);var R={};return v.forEach((function(e){e.addEventListener("loadend",function(e){var t=e.loadendState,n=e.abortFn;return function(e){e.target.aborted&&n&&!t.calledAbortFn&&(n(),t.calledAbortFn=!0)}}({loadendState:R,abortFn:a}))})),function(){return pu(v)}},Eu=qs("CodecUtils"),Su=function(e,t){var n=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&n.AUDIO&&e.mediaGroups.AUDIO[n.AUDIO]},wu=function(e){var t={};return e.forEach((function(e){var n=e.mediaType,r=e.type,i=e.details;t[n]=t[n]||[],t[n].push(B(""+r+i))})),Object.keys(t).forEach((function(e){if(t[e].length>1)return Eu("multiple "+e+" codecs found as attributes: "+t[e].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),void(t[e]=null);t[e]=t[e][0]})),t},Au=function(e){var t=0;return e.audio&&t++,e.video&&t++,t},Iu=function(e,t){var n=t.attributes||{},r=wu(function(e){var t=e.attributes||{};if(t.CODECS)return j(t.CODECS)}(t)||[]);if(Su(e,t)&&!r.audio&&!function(e,t){if(!Su(e,t))return!0;var n=t.attributes||{},r=e.mediaGroups.AUDIO[n.AUDIO];for(var i in r)if(!r[i].uri&&!r[i].playlists)return!0;return!1}(e,t)){var i=wu(function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var n=e.mediaGroups.AUDIO[t];if(!n)return null;for(var r in n){var i=n[r];if(i.default&&i.playlists)return j(i.playlists[0].attributes.CODECS)}return null}(e,n.AUDIO)||[]);i.audio&&(r.audio=i.audio)}return r},Cu=qs("PlaylistSelector"),Ru=function(e){if(e&&e.playlist){var t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})}},Du=function(e,t){if(!e)return"";var n=i().getComputedStyle(e);return n?n[t]:""},xu=function(e,t){var n=e.slice();e.sort((function(e,r){var i=t(e,r);return 0===i?n.indexOf(e)-n.indexOf(r):i}))},Nu=function(e,t){var n,r;return e.attributes.BANDWIDTH&&(n=e.attributes.BANDWIDTH),n=n||i().Number.MAX_VALUE,t.attributes.BANDWIDTH&&(r=t.attributes.BANDWIDTH),n-(r||i().Number.MAX_VALUE)},Ou=function(e,t,n,r,a,s){if(e){var o={bandwidth:t,width:n,height:r,limitRenditionByPlayerDimensions:a},u=e.playlists;mo.isAudioOnly(e)&&(u=s.getAudioTrackPlaylists_(),o.audioOnly=!0);var l=u.map((function(e){var t=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,n=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return{bandwidth:e.attributes&&e.attributes.BANDWIDTH||i().Number.MAX_VALUE,width:t,height:n,playlist:e}}));xu(l,(function(e,t){return e.bandwidth-t.bandwidth}));var c=(l=l.filter((function(e){return!mo.isIncompatible(e.playlist)}))).filter((function(e){return mo.isEnabled(e.playlist)}));c.length||(c=l.filter((function(e){return!mo.isDisabled(e.playlist)})));var d=c.filter((function(e){return e.bandwidth*eu.BANDWIDTH_VARIANCE<t})),f=d[d.length-1],h=d.filter((function(e){return e.bandwidth===f.bandwidth}))[0];if(!1===a){var p=h||c[0]||l[0];if(p&&p.playlist){var g="sortedPlaylistReps";return h&&(g="bandwidthBestRep"),c[0]&&(g="enabledPlaylistReps"),Cu("choosing "+Ru(p)+" using "+g+" with options",o),p.playlist}return Cu("could not choose a playlist with options",o),null}var m=d.filter((function(e){return e.width&&e.height}));xu(m,(function(e,t){return e.width-t.width}));var y=m.filter((function(e){return e.width===n&&e.height===r}));f=y[y.length-1];var v,_,T,b,E=y.filter((function(e){return e.bandwidth===f.bandwidth}))[0];if(E||(_=(v=m.filter((function(e){return e.width>n||e.height>r}))).filter((function(e){return e.width===v[0].width&&e.height===v[0].height})),f=_[_.length-1],T=_.filter((function(e){return e.bandwidth===f.bandwidth}))[0]),s.experimentalLeastPixelDiffSelector){var S=m.map((function(e){return e.pixelDiff=Math.abs(e.width-n)+Math.abs(e.height-r),e}));xu(S,(function(e,t){return e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff})),b=S[0]}var w=b||T||E||h||c[0]||l[0];if(w&&w.playlist){var A="sortedPlaylistReps";return b?A="leastPixelDiffRep":T?A="resolutionPlusOneRep":E?A="resolutionBestRep":h?A="bandwidthBestRep":c[0]&&(A="enabledPlaylistReps"),Cu("choosing "+Ru(w)+" using "+A+" with options",o),w.playlist}return Cu("could not choose a playlist with options",o),null}},Pu=function(){var e=this.useDevicePixelRatio&&i().devicePixelRatio||1;return Ou(this.playlists.master,this.systemBandwidth,parseInt(Du(this.tech_.el(),"width"),10)*e,parseInt(Du(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},Mu=function(e,t,n){var r,i;if(n&&n.cues)for(r=n.cues.length;r--;)(i=n.cues[r]).startTime>=e&&i.endTime<=t&&n.removeCue(i)},ku=function(e){return"number"==typeof e&&isFinite(e)},Lu=1/60,Fu=function(e){var t=e.startOfSegment,n=e.duration,r=e.segment,i=e.part,a=e.playlist,s=a.mediaSequence,o=a.id,u=a.segments,l=void 0===u?[]:u,c=e.mediaIndex,d=e.partIndex,f=e.timeline,h=l.length-1,p="mediaIndex/partIndex increment";e.getMediaInfoForTime?p="getMediaInfoForTime ("+e.getMediaInfoForTime+")":e.isSyncRequest&&(p="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(p+=" with independent "+e.independent);var g="number"==typeof d,m=e.segment.uri?"segment":"pre-segment",y=g?to({preloadSegment:r})-1:0;return m+" ["+(s+c)+"/"+(s+h)+"]"+(g?" part ["+d+"/"+y+"]":"")+" segment start/end ["+r.start+" => "+r.end+"]"+(g?" part start/end ["+i.start+" => "+i.end+"]":"")+" startOfSegment ["+t+"] duration ["+n+"] timeline ["+f+"] selected by ["+p+"] playlist ["+o+"]"},Uu=function(e){return e+"TimingInfo"},Bu=function(e){var t=e.timelineChangeController,n=e.currentTimeline,r=e.segmentTimeline,i=e.loaderType,a=e.audioDisabled;if(n===r)return!1;if("audio"===i){var s=t.lastTimelineChange({type:"main"});return!s||s.to!==r}if("main"===i&&a){var o=t.pendingTimelineChange({type:"audio"});return!o||o.to!==r}return!1},ju=function(e){var t=e.segmentDuration,n=e.maxDuration;return!!t&&Math.round(t)>n+Hs},qu=function(e){function t(t,n){var r;if(r=e.call(this)||this,!t)throw new TypeError("Initialization settings are required");if("function"!=typeof t.currentTime)throw new TypeError("No currentTime getter specified");if(!t.mediaSource)throw new TypeError("No MediaSource specified");return r.bandwidth=t.bandwidth,r.throughput={rate:0,count:0},r.roundTrip=NaN,r.resetStats_(),r.mediaIndex=null,r.partIndex=null,r.hasPlayed_=t.hasPlayed,r.currentTime_=t.currentTime,r.seekable_=t.seekable,r.seeking_=t.seeking,r.duration_=t.duration,r.mediaSource_=t.mediaSource,r.vhs_=t.vhs,r.loaderType_=t.loaderType,r.currentMediaInfo_=void 0,r.startingMediaInfo_=void 0,r.segmentMetadataTrack_=t.segmentMetadataTrack,r.goalBufferLength_=t.goalBufferLength,r.sourceType_=t.sourceType,r.sourceUpdater_=t.sourceUpdater,r.inbandTextTracks_=t.inbandTextTracks,r.state_="INIT",r.timelineChangeController_=t.timelineChangeController,r.shouldSaveSegmentTimingInfo_=!0,r.parse708captions_=t.parse708captions,r.useDtsForTimestampOffset_=t.useDtsForTimestampOffset,r.captionServices_=t.captionServices,r.experimentalExactManifestTimings=t.experimentalExactManifestTimings,r.checkBufferTimeout_=null,r.error_=void 0,r.currentTimeline_=-1,r.pendingSegment_=null,r.xhrOptions_=null,r.pendingSegments_=[],r.audioDisabled_=!1,r.isPendingTimestampOffset_=!1,r.gopBuffer_=[],r.timeMapping_=0,r.safeAppend_=Ls.browser.IE_VERSION>=11,r.appendInitSegment_={audio:!0,video:!0},r.playlistOfLastInitSegment_={audio:null,video:null},r.callQueue_=[],r.loadQueue_=[],r.metadataQueue_={id3:[],caption:[]},r.waitingOnRemove_=!1,r.quotaExceededErrorRetryTimeout_=null,r.activeInitSegmentId_=null,r.initSegments_={},r.cacheEncryptionKeys_=t.cacheEncryptionKeys,r.keyCache_={},r.decrypter_=t.decrypter,r.syncController_=t.syncController,r.syncPoint_={segmentIndex:0,time:0},r.transmuxer_=r.createTransmuxer_(),r.triggerSyncInfoUpdate_=function(){return r.trigger("syncinfoupdate")},r.syncController_.on("syncinfoupdate",r.triggerSyncInfoUpdate_),r.mediaSource_.addEventListener("sourceopen",(function(){r.isEndOfStream_()||(r.ended_=!1)})),r.fetchAtBuffer_=!1,r.logger_=qs("SegmentLoader["+r.loaderType_+"]"),Object.defineProperty(f(r),"state",{get:function(){return this.state_},set:function(e){e!==this.state_&&(this.logger_(this.state_+" -> "+e),this.state_=e,this.trigger("statechange"))}}),r.sourceUpdater_.on("ready",(function(){r.hasEnoughInfoToAppend_()&&r.processCallQueue_()})),"main"===r.loaderType_&&r.timelineChangeController_.on("pendingtimelinechange",(function(){r.hasEnoughInfoToAppend_()&&r.processCallQueue_()})),"audio"===r.loaderType_&&r.timelineChangeController_.on("timelinechange",(function(){r.hasEnoughInfoToLoad_()&&r.processLoadQueue_(),r.hasEnoughInfoToAppend_()&&r.processCallQueue_()})),r}p(t,e);var n=t.prototype;return n.createTransmuxer_=function(){return function(e){var t=new su;t.currentTransmux=null,t.transmuxQueue=[];var n=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,n.call(t)},t.postMessage({action:"init",options:e}),t}({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},n.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},n.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&i().clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},n.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},n.abort=function(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)},n.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,i().clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},n.checkForAbort_=function(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)},n.error=function(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_},n.endOfStream=function(){this.ended_=!0,this.transmuxer_&&cu(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},n.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Ls.createTimeRanges();if("main"===this.loaderType_){var t=e.hasAudio,n=e.hasVideo,r=e.isMuxed;if(n&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(n)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},n.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var n=qo(e),r=this.initSegments_[n];return t&&!r&&e.bytes&&(this.initSegments_[n]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e},n.segmentKey=function(e,t){if(void 0===t&&(t=!1),!e)return null;var n=Ho(e),r=this.keyCache_[n];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[n]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});var i={resolvedUri:(r||e).resolvedUri};return r&&(i.bytes=r.bytes),i},n.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},n.load=function(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"))},n.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},n.playlist=function(e,t){if(void 0===t&&(t={}),e){var n=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));var i=null;if(n&&(n.id?i=n.id:n.uri&&(i=n.uri)),this.logger_("playlist update ["+i+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!n||n.uri!==e.uri)return null!==this.mediaIndex&&(e.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");var a=e.mediaSequence-n.mediaSequence;if(this.logger_("live window shift ["+a+"]"),null!==this.mediaIndex)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var s=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!s.parts||!s.parts.length||!s.parts[this.partIndex])){var o=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=o}}r&&(r.mediaIndex-=a,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(n,e)}},n.pause=function(){this.checkBufferTimeout_&&(i().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},n.paused=function(){return null===this.checkBufferTimeout_},n.resetEverything=function(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))},n.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},n.resyncLoader=function(){this.transmuxer_&&cu(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},n.remove=function(e,t,n,r){if(void 0===n&&(n=function(){}),void 0===r&&(r=!1),t===1/0&&(t=this.duration_()),t<=e)this.logger_("skipping remove because end ${end} is <= start ${start}");else if(this.sourceUpdater_&&this.getMediaInfo_()){var i=1,a=function(){0==--i&&n()};for(var s in!r&&this.audioDisabled_||(i++,this.sourceUpdater_.removeAudio(e,t,a)),(r||"main"===this.loaderType_)&&(this.gopBuffer_=function(e,t,n,r){for(var i=Math.ceil((t-r)*gt.ONE_SECOND_IN_TS),a=Math.ceil((n-r)*gt.ONE_SECOND_IN_TS),s=e.slice(),o=e.length;o--&&!(e[o].pts<=a););if(-1===o)return s;for(var u=o+1;u--&&!(e[u].pts<=i););return u=Math.max(u,0),s.splice(u,o-u+1),s}(this.gopBuffer_,e,t,this.timeMapping_),i++,this.sourceUpdater_.removeVideo(e,t,a)),this.inbandTextTracks_)Mu(e,t,this.inbandTextTracks_[s]);Mu(e,t,this.segmentMetadataTrack_),a()}else this.logger_("skipping remove because no source updater or starting media info")},n.monitorBuffer_=function(){this.checkBufferTimeout_&&i().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=i().setTimeout(this.monitorBufferTick_.bind(this),1)},n.monitorBufferTick_=function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&i().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=i().setTimeout(this.monitorBufferTick_.bind(this),500)},n.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var e=this.chooseNextRequest_();e&&("number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}},n.isEndOfStream_=function(e,t,n){if(void 0===e&&(e=this.mediaIndex),void 0===t&&(t=this.playlist_),void 0===n&&(n=this.partIndex),!t||!this.mediaSource_)return!1;var r="number"==typeof e&&t.segments[e],i=e+1===t.segments.length,a=!r||!r.parts||n+1===r.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&i&&a},n.chooseNextRequest_=function(){var e=this.buffered_(),t=Ws(e)||0,n=Xs(e,this.currentTime_()),r=!this.hasPlayed_()&&n>=1,i=n>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||r||i)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var s={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(s.isSyncRequest)s.mediaIndex=function(e,t,n){t=t||[];for(var r=[],i=0,a=0;a<t.length;a++){var s=t[a];if(e===s.timeline&&(r.push(a),(i+=s.duration)>n))return a}return 0===r.length?0:r[r.length-1]}(this.currentTimeline_,a,t);else if(null!==this.mediaIndex){var o=a[this.mediaIndex],u="number"==typeof this.partIndex?this.partIndex:-1;s.startOfSegment=o.end?o.end:t,o.parts&&o.parts[u+1]?(s.mediaIndex=this.mediaIndex,s.partIndex=u+1):s.mediaIndex=this.mediaIndex+1}else{var l=mo.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?t:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),c=l.segmentIndex,d=l.startTime,f=l.partIndex;s.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+t:"currentTime "+this.currentTime_(),s.mediaIndex=c,s.startOfSegment=d,s.partIndex=f}var h=a[s.mediaIndex],p=h&&"number"==typeof s.partIndex&&h.parts&&h.parts[s.partIndex];if(!h||"number"==typeof s.partIndex&&!p)return null;if("number"!=typeof s.partIndex&&h.parts&&(s.partIndex=0,p=h.parts[0]),!n&&p&&!p.independent)if(0===s.partIndex){var g=a[s.mediaIndex-1],m=g.parts&&g.parts.length&&g.parts[g.parts.length-1];m&&m.independent&&(s.mediaIndex-=1,s.partIndex=g.parts.length-1,s.independent="previous segment")}else h.parts[s.partIndex-1].independent&&(s.partIndex-=1,s.independent="previous part");var y=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return s.mediaIndex>=a.length-1&&y&&!this.seeking_()?null:this.generateSegmentInfo_(s)},n.generateSegmentInfo_=function(e){var t=e.independent,n=e.playlist,r=e.mediaIndex,i=e.startOfSegment,a=e.isSyncRequest,s=e.partIndex,o=e.forceTimestampOffset,u=e.getMediaInfoForTime,l=n.segments[r],c="number"==typeof s&&l.parts[s],d={requestId:"segment-loader-"+Math.random(),uri:c&&c.resolvedUri||l.resolvedUri,mediaIndex:r,partIndex:c?s:null,isSyncRequest:a,startOfSegment:i,playlist:n,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:l.timeline,duration:c&&c.duration||l.duration,segment:l,part:c,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:u,independent:t},f=void 0!==o?o:this.isPendingTimestampOffset_;d.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:l.timeline,currentTimeline:this.currentTimeline_,startOfSegment:i,buffered:this.buffered_(),overrideCheck:f});var h=Ws(this.sourceUpdater_.audioBuffered());return"number"==typeof h&&(d.audioAppendStart=h-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(d.gopsToAlignWith=function(e,t,n){if(null==t||!e.length)return[];var r,i=Math.ceil((t-n+3)*gt.ONE_SECOND_IN_TS);for(r=0;r<e.length&&!(e[r].pts>i);r++);return e.slice(r)}(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),d},n.timestampOffsetForSegment_=function(e){return n=(t=e).segmentTimeline,r=t.currentTimeline,i=t.startOfSegment,a=t.buffered,t.overrideCheck||n!==r?n<r?i:a.length?a.end(a.length-1):i:null;var t,n,r,i,a},n.earlyAbortWhenNeeded_=function(e){if(!this.vhs_.tech_.paused()&&this.xhrOptions_.timeout&&this.playlist_.attributes.BANDWIDTH&&!(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)){var t=this.currentTime_(),n=e.bandwidth,r=this.pendingSegment_.duration,i=mo.estimateSegmentRequestTime(r,n,this.playlist_,e.bytesReceived),a=function(e,t,n){return void 0===n&&(n=1),((e.length?e.end(e.length-1):0)-t)/n}(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(!(i<=a)){var s=function(e){var t=e.currentTime,n=e.bandwidth,r=e.duration,i=e.segmentDuration,a=e.timeUntilRebuffer,s=e.currentTimeline,o=e.syncController,u=e.master.playlists.filter((function(e){return!mo.isIncompatible(e)})),l=u.filter(mo.isEnabled);l.length||(l=u.filter((function(e){return!mo.isDisabled(e)})));var c=l.filter(mo.hasAttribute.bind(null,"BANDWIDTH")).map((function(e){var u=o.getSyncPoint(e,r,s,t)?1:2;return{playlist:e,rebufferingImpact:mo.estimateSegmentRequestTime(i,n,e)*u-a}})),d=c.filter((function(e){return e.rebufferingImpact<=0}));return xu(d,(function(e,t){return Nu(t.playlist,e.playlist)})),d.length?d[0]:(xu(c,(function(e,t){return e.rebufferingImpact-t.rebufferingImpact})),c[0]||null)}({master:this.vhs_.playlists.master,currentTime:t,bandwidth:n,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(s){var o=i-a-s.rebufferingImpact,u=.5;a<=Hs&&(u=1),!s.playlist||s.playlist.uri===this.playlist_.uri||o<u||(this.bandwidth=s.playlist.attributes.BANDWIDTH*eu.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}}}},n.handleAbort_=function(e){this.logger_("Aborting "+Fu(e)),this.mediaRequestsAborted+=1},n.handleProgress_=function(e,t){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.trigger("progress")},n.handleTrackInfo_=function(e,t){this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||this.checkForIllegalMediaSwitch(t)||(t=t||{},function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;var n=Object.keys(e).sort(),r=Object.keys(t).sort();if(n.length!==r.length)return!1;for(var i=0;i<n.length;i++){var a=n[i];if(a!==r[i])return!1;if(e[a]!==t[a])return!1}return!0}(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),this.checkForAbort_(e.requestId)||(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()&&this.processCallQueue_()))},n.handleTimingInfo_=function(e,t,n,r){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){var i=this.pendingSegment_,a=Uu(t);i[a]=i[a]||{},i[a][n]=r,this.logger_("timinginfo: "+t+" - "+n+" - "+r),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}},n.handleCaptions_=function(e,t){var n=this;if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(0!==t.length)if(this.pendingSegment_.hasAppendedData_){var r=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),a={};t.forEach((function(e){a[e.stream]=a[e.stream]||{startTime:1/0,captions:[],endTime:0};var t=a[e.stream];t.startTime=Math.min(t.startTime,e.startTime+r),t.endTime=Math.max(t.endTime,e.endTime+r),t.captions.push(e)})),Object.keys(a).forEach((function(e){var t=a[e],s=t.startTime,o=t.endTime,u=t.captions,l=n.inbandTextTracks_;n.logger_("adding cues from "+s+" -> "+o+" for "+e),function(e,t,n){if(!e[n]){t.trigger({type:"usage",name:"vhs-608"}),t.trigger({type:"usage",name:"hls-608"});var r=n;/^cc708_/.test(n)&&(r="SERVICE"+n.split("_")[1]);var i=t.textTracks().getTrackById(r);if(i)e[n]=i;else{var a=n,s=n,o=!1,u=(t.options_.vhs&&t.options_.vhs.captionServices||{})[r];u&&(a=u.label,s=u.language,o=u.default),e[n]=t.addRemoteTextTrack({kind:"captions",id:r,default:o,label:a,language:s},!1).track}}}(l,n.vhs_.tech_,e),Mu(s,o,l[e]),function(e){var t=e.inbandTextTracks,n=e.captionArray,r=e.timestampOffset;if(n){var a=i().WebKitDataCue||i().VTTCue;n.forEach((function(e){var n=e.stream;t[n].addCue(new a(e.startTime+r,e.endTime+r,e.text))}))}}({captionArray:u,inbandTextTracks:l,timestampOffset:r})})),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}else this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));else this.logger_("SegmentLoader received no captions from a caption event")},n.handleId3_=function(e,t,n){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(this.pendingSegment_.hasAppendedData_){var r=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();!function(e,t,n){e.metadataTrack_||(e.metadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=t)}(this.inbandTextTracks_,n,this.vhs_.tech_),function(e){var t=e.inbandTextTracks,n=e.metadataArray,r=e.timestampOffset,a=e.videoDuration;if(n){var s=i().WebKitDataCue||i().VTTCue,o=t.metadataTrack_;if(o&&(n.forEach((function(e){var t=e.cueTime+r;!("number"!=typeof t||i().isNaN(t)||t<0)&&t<1/0&&e.frames.forEach((function(e){var n=new s(t,t,e.value||e.url||e.data||"");n.frame=e,n.value=e,function(e){Object.defineProperties(e.frame,{id:{get:function(){return Ls.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return Ls.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return Ls.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})}(n),o.addCue(n)}))})),o.cues&&o.cues.length)){for(var u=o.cues,l=[],c=0;c<u.length;c++)u[c]&&l.push(u[c]);var d=l.reduce((function(e,t){var n=e[t.startTime]||[];return n.push(t),e[t.startTime]=n,e}),{}),f=Object.keys(d).sort((function(e,t){return Number(e)-Number(t)}));f.forEach((function(e,t){var n=d[e],r=Number(f[t+1])||a;n.forEach((function(e){e.endTime=r}))}))}}}({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:this.duration_()})}else this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,n))},n.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach((function(e){return e()})),this.metadataQueue_.caption.forEach((function(e){return e()})),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},n.processCallQueue_=function(){var e=this.callQueue_;this.callQueue_=[],e.forEach((function(e){return e()}))},n.processLoadQueue_=function(){var e=this.loadQueue_;this.loadQueue_=[],e.forEach((function(e){return e()}))},n.hasEnoughInfoToLoad_=function(){if("audio"!==this.loaderType_)return!0;var e=this.pendingSegment_;return!(!e||this.getCurrentMediaInfo_()&&Bu({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},n.getCurrentMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),e&&e.trackInfo||this.currentMediaInfo_},n.getMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),this.getCurrentMediaInfo_(e)||this.startingMediaInfo_},n.getPendingSegmentPlaylist=function(){return this.pendingSegment_?this.pendingSegment_.playlist:null},n.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;var n=t.hasAudio,r=t.hasVideo,i=t.isMuxed;return!(r&&!e.videoTimingInfo||n&&!this.audioDisabled_&&!i&&!e.audioTimingInfo||Bu({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},n.handleData_=function(e,t){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(!this.callQueue_.length&&this.hasEnoughInfoToAppend_()){var n=this.pendingSegment_;if(this.setTimeMapping_(n.timeline),this.updateMediaSecondsLoaded_(n.part||n.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),n.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),n.isFmp4=e.isFmp4,n.timingInfo=n.timingInfo||{},n.isFmp4)this.trigger("fmp4"),n.timingInfo.start=n[Uu(t.type)].start;else{var r,i=this.getCurrentMediaInfo_(),a="main"===this.loaderType_&&i&&i.hasVideo;a&&(r=n.videoTimingInfo.start),n.timingInfo.start=this.trueSegmentStart_({currentStart:n.timingInfo.start,playlist:n.playlist,mediaIndex:n.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:a,firstVideoFrameTimeForData:r,videoTimingInfo:n.videoTimingInfo,audioTimingInfo:n.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(n,t.type),this.updateSourceBufferTimestampOffset_(n),n.isSyncRequest){this.updateTimingInfoEnd_(n),this.syncController_.saveSegmentTimingInfo({segmentInfo:n,shouldSaveTimelineMapping:"main"===this.loaderType_});var s=this.chooseNextRequest_();if(s.mediaIndex!==n.mediaIndex||s.partIndex!==n.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}n.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(n,t)}}else this.callQueue_.push(this.handleData_.bind(this,e,t))},n.updateAppendInitSegmentStatus=function(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)},n.getInitSegmentAndUpdateState_=function(e){var t=e.type,n=e.initSegment,r=e.map,i=e.playlist;if(r){var a=qo(r);if(this.activeInitSegmentId_===a)return null;n=this.initSegmentForMap(r,!0).bytes,this.activeInitSegmentId_=a}return n&&this.appendInitSegment_[t]?(this.playlistOfLastInitSegment_[t]=i,this.appendInitSegment_[t]=!1,this.activeInitSegmentId_=null,n):null},n.handleQuotaExceededError_=function(e,t){var n=this,r=e.segmentInfo,a=e.type,s=e.bytes,o=this.sourceUpdater_.audioBuffered(),u=this.sourceUpdater_.videoBuffered();o.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Ks(o).join(", ")),u.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Ks(u).join(", "));var l=o.length?o.start(0):0,c=o.length?o.end(o.length-1):0,d=u.length?u.start(0):0,f=u.length?u.end(u.length-1):0;if(c-l<=1&&f-d<=1)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+s.byteLength+", audio buffer: "+Ks(o).join(", ")+", video buffer: "+Ks(u).join(", ")+", "),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:r,type:a,bytes:s}));var h=this.currentTime_()-1;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+h),this.remove(0,h,(function(){n.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),n.waitingOnRemove_=!1,n.quotaExceededErrorRetryTimeout_=i().setTimeout((function(){n.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),n.quotaExceededErrorRetryTimeout_=null,n.processCallQueue_()}),1e3)}),!0)},n.handleAppendError_=function(e,t){var n=e.segmentInfo,r=e.type,i=e.bytes;t&&(22!==t.code?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",t),this.error(r+" append of "+i.length+"b failed for segment #"+n.mediaIndex+" in playlist "+n.playlist.id),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:n,type:r,bytes:i}))},n.appendToSourceBuffer_=function(e){var t,n,r,i=e.segmentInfo,a=e.type,s=e.initSegment,o=e.data,u=e.bytes;if(!u){var l=[o],c=o.byteLength;s&&(l.unshift(s),c+=s.byteLength),r=0,(t={bytes:c,segments:l}).bytes&&(n=new Uint8Array(t.bytes),t.segments.forEach((function(e){n.set(e,r),r+=e.byteLength}))),u=n}this.sourceUpdater_.appendBuffer({segmentInfo:i,type:a,bytes:u},this.handleAppendError_.bind(this,{segmentInfo:i,type:a,bytes:u}))},n.handleSegmentTimingInfo_=function(e,t,n){if(this.pendingSegment_&&t===this.pendingSegment_.requestId){var r=this.pendingSegment_.segment,i=e+"TimingInfo";r[i]||(r[i]={}),r[i].transmuxerPrependedSeconds=n.prependedContentDuration||0,r[i].transmuxedPresentationStart=n.start.presentation,r[i].transmuxedDecodeStart=n.start.decode,r[i].transmuxedPresentationEnd=n.end.presentation,r[i].transmuxedDecodeEnd=n.end.decode,r[i].baseMediaDecodeTime=n.baseMediaDecodeTime}},n.appendData_=function(e,t){var n=t.type,r=t.data;if(r&&r.byteLength&&("audio"!==n||!this.audioDisabled_)){var i=this.getInitSegmentAndUpdateState_({type:n,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:n,initSegment:i,data:r})}},n.loadSegment_=function(e){var t=this;this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push((function(){var n=(0,l.Z)({},e,{forceTimestampOffset:!0});(0,l.Z)(e,t.generateSegmentInfo_(n)),t.isPendingTimestampOffset_=!1,t.updateTransmuxerAndRequestSegment_(e)}))},n.updateTransmuxerAndRequestSegment_=function(e){var t=this;this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));var n=this.createSimplifiedSegmentObj_(e),r=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),i=null!==this.mediaIndex,a=e.timeline!==this.currentTimeline_&&e.timeline>0,s=r||i&&a;this.logger_("Requesting "+Fu(e)),n.map&&!n.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=bu({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:n,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:s,endedTimelineFn:function(){t.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(n){var r=n.message,i=n.level,a=n.stream;t.logger_(Fu(e)+" logged from transmuxer stream "+a+" as a "+i+": "+r)}})},n.trimBackBuffer_=function(e){var t=function(e,t,n){var r=t-eu.BACK_BUFFER_LENGTH;e.length&&(r=Math.max(r,e.start(0)));var i=t-n;return Math.min(i,r)}(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)},n.createSimplifiedSegmentObj_=function(e){var t=e.segment,n=e.part,r={resolvedUri:n?n.resolvedUri:t.resolvedUri,byterange:n?n.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},i=e.playlist.segments[e.mediaIndex-1];if(i&&i.timeline===t.timeline&&(i.videoTimingInfo?r.baseStartTime=i.videoTimingInfo.transmuxedDecodeEnd:i.audioTimingInfo&&(r.baseStartTime=i.audioTimingInfo.transmuxedDecodeEnd)),t.key){var a=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);r.key=this.segmentKey(t.key),r.key.iv=a}return t.map&&(r.map=this.initSegmentForMap(t.map)),r},n.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)},n.saveBandwidthRelatedStats_=function(e,t){this.pendingSegment_.byteLength=t.bytesReceived,e<Lu?this.logger_("Ignoring segment's bandwidth because its duration of "+e+" is less than the min to record "+Lu):(this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime)},n.handleTimeout_=function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")},n.segmentRequestFinished_=function(e,t,n){if(this.callQueue_.length)this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,n));else if(this.saveTransferStats_(t.stats),this.pendingSegment_&&t.requestId===this.pendingSegment_.requestId){if(e){if(this.pendingSegment_=null,this.state="READY",e.code===hu)return;return this.pause(),e.code===fu?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"))}var r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),r.endOfAllRequests=t.endOfAllRequests,n.gopInfo&&(this.gopBuffer_=function(e,t,n){if(!t.length)return e;if(n)return t.slice();for(var r=t[0].pts,i=0;i<e.length&&!(e[i].pts>=r);i++);return e.slice(0,i).concat(t)}(this.gopBuffer_,n.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(r)}},n.setTimeMapping_=function(e){var t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t)},n.updateMediaSecondsLoaded_=function(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration},n.shouldUpdateTransmuxerTimestampOffset_=function(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())},n.trueSegmentStart_=function(e){var t=e.currentStart,n=e.playlist,r=e.mediaIndex,i=e.firstVideoFrameTimeForData,a=e.currentVideoTimestampOffset,s=e.useVideoTimingInfo,o=e.videoTimingInfo,u=e.audioTimingInfo;if(void 0!==t)return t;if(!s)return u.start;var l=n.segments[r-1];return 0!==r&&l&&void 0!==l.start&&l.end===i+a?o.start:i},n.waitForAppendsToComplete_=function(e){var t=this.getCurrentMediaInfo_(e);if(!t)return this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),void this.trigger("error");var n=t.hasAudio,r=t.hasVideo,i=t.isMuxed,a="main"===this.loaderType_&&r,s=!this.audioDisabled_&&n&&!i;if(e.waitingOnAppends=0,!e.hasAppendedData_)return e.timingInfo||"number"!=typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);a&&e.waitingOnAppends++,s&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),s&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))},n.checkAppendsDone_=function(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())},n.checkForIllegalMediaSwitch=function(e){var t=function(e,t,n){return"main"===e&&t&&n?n.hasAudio||n.hasVideo?t.hasVideo&&!n.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&n.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null}(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!t&&(this.error({message:t,blacklistDuration:1/0}),this.trigger("error"),!0)},n.updateSourceBufferTimestampOffset_=function(e){if(null!==e.timestampOffset&&"number"==typeof e.timingInfo.start&&!e.changedTimestampOffset&&"main"===this.loaderType_){var t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}},n.getSegmentStartTimeForTimestampOffsetCalculation_=function(e){var t=e.videoTimingInfo,n=e.audioTimingInfo,r=e.timingInfo;return this.useDtsForTimestampOffset_?t&&"number"==typeof t.transmuxedDecodeStart?t.transmuxedDecodeStart:n&&"number"==typeof n.transmuxedDecodeStart?n.transmuxedDecodeStart:r.start:r.start},n.updateTimingInfoEnd_=function(e){e.timingInfo=e.timingInfo||{};var t=this.getMediaInfo_(),n="main"===this.loaderType_&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;n&&(e.timingInfo.end="number"==typeof n.end?n.end:n.start+e.duration)},n.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});var t=function(e,t){if("hls"!==t)return null;var n,r,a=(n={audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo},r=0,["video","audio"].forEach((function(e){var t=n[e+"TimingInfo"];if(t){var a,s=t.start,o=t.end;"bigint"==typeof s||"bigint"==typeof o?a=i().BigInt(o)-i().BigInt(s):"number"==typeof s&&"number"==typeof o&&(a=o-s),void 0!==a&&a>r&&(r=a)}})),"bigint"==typeof r&&r<Number.MAX_SAFE_INTEGER&&(r=Number(r)),r);if(!a)return null;var s=e.playlist.targetDuration,o=ju({segmentDuration:a,maxDuration:2*s}),u=ju({segmentDuration:a,maxDuration:s}),l="Segment with index "+e.mediaIndex+" from playlist "+e.playlist.id+" has a duration of "+a+" when the reported duration is "+e.duration+" and the target duration is "+s+". For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";return o||u?{severity:o?"warn":"info",message:l}:null}(e,this.sourceType_);if(t&&("warn"===t.severity?Ls.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",!e.isSyncRequest||(this.trigger("syncinfoupdate"),e.hasAppendedData_)){this.logger_("Appended "+Fu(e)),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");var n=e.segment,r=e.part,a=n.end&&this.currentTime_()-n.end>3*e.playlist.targetDuration,s=r&&r.end&&this.currentTime_()-r.end>3*e.playlist.partTargetDuration;if(a||s)return this.logger_("bad "+(a?"segment":"part")+" "+Fu(e)),void this.resetEverything();null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}else this.logger_("Throwing away un-appended sync request "+Fu(e))},n.recordThroughput_=function(e){if(e.duration<Lu)this.logger_("Ignoring segment's throughput because its duration of "+e.duration+" is less than the min to record "+Lu);else{var t=this.throughput.rate,n=Date.now()-e.endOfAllRequests+1,r=Math.floor(e.byteLength/n*8*1e3);this.throughput.rate+=(r-t)/++this.throughput.count}},n.addSegmentMetadataCue_=function(e){if(this.segmentMetadataTrack_){var t=e.segment,n=t.start,r=t.end;if(ku(n)&&ku(r)){Mu(n,r,this.segmentMetadataTrack_);var a=i().WebKitDataCue||i().VTTCue,s={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:n,end:r},o=new a(n,r,JSON.stringify(s));o.value=s,this.segmentMetadataTrack_.addCue(o)}}},t}(Ls.EventTarget);function Hu(){}var Gu,Vu=function(e){return"string"!=typeof e?e:e.replace(/./,(function(e){return e.toUpperCase()}))},Yu=["video","audio"],zu=function(e,t){var n=t[e+"Buffer"];return n&&n.updating||t.queuePending[e]},Zu=function e(t,n){if(0!==n.queue.length){var r=0,i=n.queue[r];if("mediaSource"!==i.type){if("mediaSource"!==t&&n.ready()&&"closed"!==n.mediaSource.readyState&&!zu(t,n)){if(i.type!==t){if(r=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];if("mediaSource"===r.type)return null;if(r.type===e)return n}return null}(t,n.queue),null===r)return;i=n.queue[r]}return n.queue.splice(r,1),n.queuePending[t]=i,i.action(t,n),i.doneFn?void 0:(n.queuePending[t]=null,void e(t,n))}}else n.updating()||"closed"===n.mediaSource.readyState||(n.queue.shift(),i.action(n),i.doneFn&&i.doneFn(),e("audio",n),e("video",n))}},Ku=function(e,t){var n=t[e+"Buffer"],r=Vu(e);n&&(n.removeEventListener("updateend",t["on"+r+"UpdateEnd_"]),n.removeEventListener("error",t["on"+r+"Error_"]),t.codecs[e]=null,t[e+"Buffer"]=null)},Wu=function(e,t){return e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t)},Xu=function(e,t,n){return function(r,i){var a=i[r+"Buffer"];if(Wu(i.mediaSource,a)){i.logger_("Appending segment "+t.mediaIndex+"'s "+e.length+" bytes to "+r+"Buffer");try{a.appendBuffer(e)}catch(e){i.logger_("Error with code "+e.code+" "+(22===e.code?"(QUOTA_EXCEEDED_ERR) ":"")+"when appending segment "+t.mediaIndex+" to "+r+"Buffer"),i.queuePending[r]=null,n(e)}}}},$u=function(e,t){return function(n,r){var i=r[n+"Buffer"];if(Wu(r.mediaSource,i)){r.logger_("Removing "+e+" to "+t+" from "+n+"Buffer");try{i.remove(e,t)}catch(i){r.logger_("Remove "+e+" to "+t+" from "+n+"Buffer failed")}}}},Qu=function(e){return function(t,n){var r=n[t+"Buffer"];Wu(n.mediaSource,r)&&(n.logger_("Setting "+t+"timestampOffset to "+e),r.timestampOffset=e)}},Ju=function(e){return function(t,n){e()}},el=function(e){return function(t){if("open"===t.mediaSource.readyState){t.logger_("Calling mediaSource endOfStream("+(e||"")+")");try{t.mediaSource.endOfStream(e)}catch(e){Ls.log.warn("Failed to call media source endOfStream",e)}}}},tl=function(e,t){return function(n){var r=Vu(e),i=H(t);n.logger_("Adding "+e+"Buffer with codec "+t+" to mediaSource");var a=n.mediaSource.addSourceBuffer(i);a.addEventListener("updateend",n["on"+r+"UpdateEnd_"]),a.addEventListener("error",n["on"+r+"Error_"]),n.codecs[e]=t,n[e+"Buffer"]=a}},nl=function(e){return function(t){var n=t[e+"Buffer"];if(Ku(e,t),Wu(t.mediaSource,n)){t.logger_("Removing "+e+"Buffer with codec "+t.codecs[e]+" from mediaSource");try{t.mediaSource.removeSourceBuffer(n)}catch(t){Ls.log.warn("Failed to removeSourceBuffer "+e+"Buffer",t)}}}},rl=function(e){return function(t,n){var r=n[t+"Buffer"],i=H(e);Wu(n.mediaSource,r)&&n.codecs[t]!==e&&(n.logger_("changing "+t+"Buffer codec from "+n.codecs[t]+" to "+e),r.changeType(i),n.codecs[t]=e)}},il=function(e){var t=e.type,n=e.sourceUpdater,r=e.action,i=e.doneFn,a=e.name;n.queue.push({type:t,action:r,doneFn:i,name:a}),Zu(t,n)},al=function(e,t){return function(n){if(t.queuePending[e]){var r=t.queuePending[e].doneFn;t.queuePending[e]=null,r&&r(t[e+"Error_"])}Zu(e,t)}},sl=function(e){function t(t){var n;return(n=e.call(this)||this).mediaSource=t,n.sourceopenListener_=function(){return Zu("mediaSource",f(n))},n.mediaSource.addEventListener("sourceopen",n.sourceopenListener_),n.logger_=qs("SourceUpdater"),n.audioTimestampOffset_=0,n.videoTimestampOffset_=0,n.queue=[],n.queuePending={audio:null,video:null},n.delayedAudioAppendQueue_=[],n.videoAppendQueued_=!1,n.codecs={},n.onVideoUpdateEnd_=al("video",f(n)),n.onAudioUpdateEnd_=al("audio",f(n)),n.onVideoError_=function(e){n.videoError_=e},n.onAudioError_=function(e){n.audioError_=e},n.createdSourceBuffers_=!1,n.initializedEme_=!1,n.triggeredReady_=!1,n}p(t,e);var n=t.prototype;return n.initializedEme=function(){this.initializedEme_=!0,this.triggerReady()},n.hasCreatedSourceBuffers=function(){return this.createdSourceBuffers_},n.hasInitializedAnyEme=function(){return this.initializedEme_},n.ready=function(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()},n.createSourceBuffers=function(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())},n.triggerReady=function(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))},n.addSourceBuffer=function(e,t){il({type:"mediaSource",sourceUpdater:this,action:tl(e,t),name:"addSourceBuffer"})},n.abort=function(e){il({type:e,sourceUpdater:this,action:function(e,t){if("open"===t.mediaSource.readyState){var n=t[e+"Buffer"];if(Wu(t.mediaSource,n)){t.logger_("calling abort on "+e+"Buffer");try{n.abort()}catch(t){Ls.log.warn("Failed to abort on "+e+"Buffer",t)}}}},name:"abort"})},n.removeSourceBuffer=function(e){this.canRemoveSourceBuffer()?il({type:"mediaSource",sourceUpdater:this,action:nl(e),name:"removeSourceBuffer"}):Ls.log.error("removeSourceBuffer is not supported!")},n.canRemoveSourceBuffer=function(){return!Ls.browser.IE_VERSION&&!Ls.browser.IS_FIREFOX&&i().MediaSource&&i().MediaSource.prototype&&"function"==typeof i().MediaSource.prototype.removeSourceBuffer},t.canChangeType=function(){return i().SourceBuffer&&i().SourceBuffer.prototype&&"function"==typeof i().SourceBuffer.prototype.changeType},n.canChangeType=function(){return this.constructor.canChangeType()},n.changeType=function(e,t){this.canChangeType()?il({type:e,sourceUpdater:this,action:rl(t),name:"changeType"}):Ls.log.error("changeType is not supported!")},n.addOrChangeSourceBuffers=function(e){var t=this;if(!e||"object"!=typeof e||0===Object.keys(e).length)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach((function(n){var r=e[n];if(!t.hasCreatedSourceBuffers())return t.addSourceBuffer(n,r);t.canChangeType()&&t.changeType(n,r)}))},n.appendBuffer=function(e,t){var n=this,r=e.segmentInfo,i=e.type,a=e.bytes;if(this.processedAppend_=!0,"audio"===i&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_("delayed audio append of "+a.length+" until video append");if(il({type:i,sourceUpdater:this,action:Xu(a,r||{mediaIndex:-1},t),doneFn:t,name:"appendBuffer"}),"video"===i){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;var s=this.delayedAudioAppendQueue_.slice();this.logger_("queuing delayed audio "+s.length+" appendBuffers"),this.delayedAudioAppendQueue_.length=0,s.forEach((function(e){n.appendBuffer.apply(n,e)}))}},n.audioBuffered=function(){return Wu(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Ls.createTimeRange()},n.videoBuffered=function(){return Wu(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Ls.createTimeRange()},n.buffered=function(){var e=Wu(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Wu(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():function(e,t){var n=null,r=null,i=0,a=[],s=[];if(!(e&&e.length&&t&&t.length))return Ls.createTimeRange();for(var o=e.length;o--;)a.push({time:e.start(o),type:"start"}),a.push({time:e.end(o),type:"end"});for(o=t.length;o--;)a.push({time:t.start(o),type:"start"}),a.push({time:t.end(o),type:"end"});for(a.sort((function(e,t){return e.time-t.time})),o=0;o<a.length;o++)"start"===a[o].type?2==++i&&(n=a[o].time):"end"===a[o].type&&1==--i&&(r=a[o].time),null!==n&&null!==r&&(s.push([n,r]),n=null,r=null);return Ls.createTimeRanges(s)}(this.audioBuffered(),this.videoBuffered())},n.setDuration=function(e,t){var n;void 0===t&&(t=Hu),il({type:"mediaSource",sourceUpdater:this,action:(n=e,function(e){e.logger_("Setting mediaSource duration to "+n);try{e.mediaSource.duration=n}catch(e){Ls.log.warn("Failed to set media source duration",e)}}),name:"duration",doneFn:t})},n.endOfStream=function(e,t){void 0===e&&(e=null),void 0===t&&(t=Hu),"string"!=typeof e&&(e=void 0),il({type:"mediaSource",sourceUpdater:this,action:el(e),name:"endOfStream",doneFn:t})},n.removeAudio=function(e,t,n){void 0===n&&(n=Hu),this.audioBuffered().length&&0!==this.audioBuffered().end(0)?il({type:"audio",sourceUpdater:this,action:$u(e,t),doneFn:n,name:"remove"}):n()},n.removeVideo=function(e,t,n){void 0===n&&(n=Hu),this.videoBuffered().length&&0!==this.videoBuffered().end(0)?il({type:"video",sourceUpdater:this,action:$u(e,t),doneFn:n,name:"remove"}):n()},n.updating=function(){return!(!zu("audio",this)&&!zu("video",this))},n.audioTimestampOffset=function(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(il({type:"audio",sourceUpdater:this,action:Qu(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_},n.videoTimestampOffset=function(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset!==e&&(il({type:"video",sourceUpdater:this,action:Qu(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_},n.audioQueueCallback=function(e){this.audioBuffer&&il({type:"audio",sourceUpdater:this,action:Ju(e),name:"callback"})},n.videoQueueCallback=function(e){this.videoBuffer&&il({type:"video",sourceUpdater:this,action:Ju(e),name:"callback"})},n.dispose=function(){var e=this;this.trigger("dispose"),Yu.forEach((function(t){e.abort(t),e.canRemoveSourceBuffer()?e.removeSourceBuffer(t):e[t+"QueueCallback"]((function(){return Ku(t,e)}))})),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()},t}(Ls.EventTarget),ol=function(e){return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))},ul=new Uint8Array("\n\n".split("").map((function(e){return e.charCodeAt(0)}))),ll=function(e){function t(){return e.call(this,"Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")||this}return p(t,e),t}(yt(Error)),cl=function(e){function t(t,n){var r;return void 0===n&&(n={}),(r=e.call(this,t,n)||this).mediaSource_=null,r.subtitlesTrack_=null,r.loaderType_="subtitle",r.featuresNativeTextTracks_=t.featuresNativeTextTracks,r.loadVttJs=t.loadVttJs,r.shouldSaveSegmentTimingInfo_=!1,r}p(t,e);var n=t.prototype;return n.createTransmuxer_=function(){return null},n.buffered_=function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Ls.createTimeRanges();var e=this.subtitlesTrack_.cues,t=e[0].startTime,n=e[e.length-1].startTime;return Ls.createTimeRanges([[t,n]])},n.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var n=qo(e),r=this.initSegments_[n];if(t&&!r&&e.bytes){var i=ul.byteLength+e.bytes.byteLength,a=new Uint8Array(i);a.set(e.bytes),a.set(ul,e.bytes.byteLength),this.initSegments_[n]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return r||e},n.couldBeginLoading_=function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()},n.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},n.track=function(e){return void 0===e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_},n.remove=function(e,t){Mu(e,t,this.subtitlesTrack_)},n.fillBuffer_=function(){var e=this,t=this.chooseNextRequest_();if(t){if(null===this.syncController_.timestampOffsetForTimeline(t.timeline))return this.syncController_.one("timestampoffset",(function(){e.state="READY",e.paused()||e.monitorBuffer_()})),void(this.state="WAITING_ON_TIMELINE");this.loadSegment_(t)}},n.timestampOffsetForSegment_=function(){return null},n.chooseNextRequest_=function(){return this.skipEmptySegments_(e.prototype.chooseNextRequest_.call(this))},n.skipEmptySegments_=function(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e},n.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")},n.segmentRequestFinished_=function(e,t,n){var r=this;if(this.subtitlesTrack_){if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===fu&&this.handleTimeout_(),e.code===hu?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);var a=this.pendingSegment_;this.saveBandwidthRelatedStats_(a.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");var s=a.segment;if(s.map&&(s.map.bytes=t.map.bytes),a.bytes=t.bytes,"function"!=typeof i().WebVTT&&"function"==typeof this.loadVttJs)return this.state="WAITING_ON_VTTJS",void this.loadVttJs().then((function(){return r.segmentRequestFinished_(e,t,n)}),(function(){return r.stopForError({message:"Error loading vtt.js"})}));s.requested=!0;try{this.parseVTTCues_(a)}catch(e){return void this.stopForError({message:e.message})}if(this.updateTimeMapping_(a,this.syncController_.timelines[a.timeline],this.playlist_),a.cues.length?a.timingInfo={start:a.cues[0].startTime,end:a.cues[a.cues.length-1].endTime}:a.timingInfo={start:a.startOfSegment,end:a.startOfSegment+a.duration},a.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");a.byteLength=a.bytes.byteLength,this.mediaSecondsLoaded+=s.duration,a.cues.forEach((function(e){r.subtitlesTrack_.addCue(r.featuresNativeTextTracks_?new(i().VTTCue)(e.startTime,e.endTime,e.text):e)})),function(e){var t=e.cues;if(t)for(var n=0;n<t.length;n++){for(var r=[],i=0,a=0;a<t.length;a++)t[n].startTime===t[a].startTime&&t[n].endTime===t[a].endTime&&t[n].text===t[a].text&&++i>1&&r.push(t[a]);r.length&&r.forEach((function(t){return e.removeCue(t)}))}}(this.subtitlesTrack_),this.handleAppendsDone_()}else this.state="READY"},n.handleData_=function(){},n.updateTimingInfoEnd_=function(){},n.parseVTTCues_=function(e){var t,n=!1;if("function"!=typeof i().WebVTT)throw new ll;"function"==typeof i().TextDecoder?t=new(i().TextDecoder)("utf8"):(t=i().WebVTT.StringDecoder(),n=!0);var r=new(i().WebVTT.Parser)(i(),i().vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=function(t){e.timestampmap=t},r.onparsingerror=function(e){Ls.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){var a=e.segment.map.bytes;n&&(a=ol(a)),r.parse(a)}var s=e.bytes;n&&(s=ol(s)),r.parse(s),r.flush()},n.updateTimeMapping_=function(e,t,n){var r=e.segment;if(t)if(e.cues.length){var i=e.timestampmap,a=i.MPEGTS/gt.ONE_SECOND_IN_TS-i.LOCAL+t.mapping;if(e.cues.forEach((function(e){e.startTime+=a,e.endTime+=a})),!n.syncInfo){var s=e.cues[0].startTime,o=e.cues[e.cues.length-1].startTime;n.syncInfo={mediaSequence:n.mediaSequence+e.mediaIndex,time:Math.min(s,o-r.duration)}}}else r.empty=!0},t}(qu),dl=function(e,t){for(var n=e.cues,r=0;r<n.length;r++){var i=n[r];if(t>=i.adStartTime&&t<=i.adEndTime)return i}return null},fl=[{name:"VOD",run:function(e,t,n,r,i){return n!==1/0?{time:0,segmentIndex:0,partIndex:null}:null}},{name:"ProgramDateTime",run:function(e,t,n,r,i){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;var a=null,s=null,o=Js(t);i=i||0;for(var u=0;u<o.length;u++){var l=o[t.endList||0===i?u:o.length-(u+1)],c=l.segment,d=e.timelineToDatetimeMappings[c.timeline];if(d&&c.dateTimeObject){var f=c.dateTimeObject.getTime()/1e3+d;if(c.parts&&"number"==typeof l.partIndex)for(var h=0;h<l.partIndex;h++)f+=c.parts[h].duration;var p=Math.abs(i-f);if(null!==s&&(0===p||s<p))break;s=p,a={time:f,segmentIndex:l.segmentIndex,partIndex:l.partIndex}}}return a}},{name:"Segment",run:function(e,t,n,r,i){var a=null,s=null;i=i||0;for(var o=Js(t),u=0;u<o.length;u++){var l=o[t.endList||0===i?u:o.length-(u+1)],c=l.segment,d=l.part&&l.part.start||c&&c.start;if(c.timeline===r&&void 0!==d){var f=Math.abs(i-d);if(null!==s&&s<f)break;(!a||null===s||s>=f)&&(s=f,a={time:d,segmentIndex:l.segmentIndex,partIndex:l.partIndex})}}return a}},{name:"Discontinuity",run:function(e,t,n,r,i){var a=null;if(i=i||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var s=null,o=0;o<t.discontinuityStarts.length;o++){var u=t.discontinuityStarts[o],l=t.discontinuitySequence+o+1,c=e.discontinuities[l];if(c){var d=Math.abs(i-c.time);if(null!==s&&s<d)break;(!a||null===s||s>=d)&&(s=d,a={time:c.time,segmentIndex:u,partIndex:null})}}return a}},{name:"Playlist",run:function(e,t,n,r,i){return t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}}],hl=function(e){function t(t){var n;return(n=e.call(this)||this).timelines=[],n.discontinuities=[],n.timelineToDatetimeMappings={},n.logger_=qs("SyncController"),n}p(t,e);var n=t.prototype;return n.getSyncPoint=function(e,t,n,r){var i=this.runStrategies_(e,t,n,r);return i.length?this.selectSyncPoint_(i,{key:"time",value:r}):null},n.getExpiredTime=function(e,t){if(!e||!e.segments)return null;var n=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!n.length)return null;var r=this.selectSyncPoint_(n,{key:"segmentIndex",value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+ao({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))},n.runStrategies_=function(e,t,n,r){for(var i=[],a=0;a<fl.length;a++){var s=fl[a],o=s.run(this,e,t,n,r);o&&(o.strategy=s.name,i.push({strategy:s.name,syncPoint:o}))}return i},n.selectSyncPoint_=function(e,t){for(var n=e[0].syncPoint,r=Math.abs(e[0].syncPoint[t.key]-t.value),i=e[0].strategy,a=1;a<e.length;a++){var s=Math.abs(e[a].syncPoint[t.key]-t.value);s<r&&(r=s,n=e[a].syncPoint,i=e[a].strategy)}return this.logger_("syncPoint for ["+t.key+": "+t.value+"] chosen with strategy ["+i+"]: [time:"+n.time+", segmentIndex:"+n.segmentIndex+("number"==typeof n.partIndex?",partIndex:"+n.partIndex:"")+"]"),n},n.saveExpiredSegmentInfo=function(e,t){var n=t.mediaSequence-e.mediaSequence;if(n>86400)Ls.log.warn("Not saving expired segment info. Media sequence gap "+n+" is too large.");else for(var r=n-1;r>=0;r--){var i=e.segments[r];if(i&&void 0!==i.start){t.syncInfo={mediaSequence:e.mediaSequence+r,time:i.start},this.logger_("playlist refresh sync: [time:"+t.syncInfo.time+", mediaSequence: "+t.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}},n.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var t=e.segments[0],n=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-n}},n.saveSegmentTimingInfo=function(e){var t=e.segmentInfo,n=e.shouldSaveTimelineMapping,r=this.calculateSegmentTimeMapping_(t,t.timingInfo,n),i=t.segment;r&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:i.start}));var a=i.dateTimeObject;i.discontinuity&&n&&a&&(this.timelineToDatetimeMappings[i.timeline]=-a.getTime()/1e3)},n.timestampOffsetForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].time},n.mappingForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping},n.calculateSegmentTimeMapping_=function(e,t,n){var r,i,a=e.segment,s=e.part,o=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},n&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+o.time+"] [mapping: "+o.mapping+"]")),r=e.startOfSegment,i=t.end+o.mapping;else{if(!o)return!1;r=t.start+o.mapping,i=t.end+o.mapping}return s&&(s.start=r,s.end=i),(!a.start||r<a.start)&&(a.start=r),a.end=i,!0},n.saveDiscontinuitySyncInfo_=function(e){var t=e.playlist,n=e.segment;if(n.discontinuity)this.discontinuities[n.timeline]={time:n.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(var r=0;r<t.discontinuityStarts.length;r++){var i=t.discontinuityStarts[r],a=t.discontinuitySequence+r+1,s=i-e.mediaIndex,o=Math.abs(s);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>o){var u;u=s<0?n.start-ao({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:i}):n.end+ao({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:i}),this.discontinuities[a]={time:u,accuracy:o}}}},n.dispose=function(){this.trigger("dispose"),this.off()},t}(Ls.EventTarget),pl=function(e){function t(){var t;return(t=e.call(this)||this).pendingTimelineChanges_={},t.lastTimelineChanges_={},t}p(t,e);var n=t.prototype;return n.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},n.pendingTimelineChange=function(e){var t=e.type,n=e.from,r=e.to;return"number"==typeof n&&"number"==typeof r&&(this.pendingTimelineChanges_[t]={type:t,from:n,to:r},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t]},n.lastTimelineChange=function(e){var t=e.type,n=e.from,r=e.to;return"number"==typeof n&&"number"==typeof r&&(this.lastTimelineChanges_[t]={type:t,from:n,to:r},delete this.pendingTimelineChanges_[t],this.trigger("timelinechange")),this.lastTimelineChanges_[t]},n.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},t}(Ls.EventTarget),gl=ru(iu((function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};function t(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var r=t((function(e){function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0})),i=t((function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,t(n,r)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0})),a=t((function(e){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,i(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0})),s=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(n,1),n>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var n=t.length,r=0;r<n;++r)t[r].call(this,arguments[1]);else for(var i=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,i)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}(),o=null,u=function(){function e(e){var t,n,r;o||(o=function(){var e,t,n,r,i,a,s,o,u=[[[],[],[],[],[]],[[],[],[],[],[]]],l=u[0],c=u[1],d=l[4],f=c[4],h=[],p=[];for(e=0;e<256;e++)p[(h[e]=e<<1^283*(e>>7))^e]=e;for(t=n=0;!d[t];t^=r||1,n=p[n]||1)for(a=(a=n^n<<1^n<<2^n<<3^n<<4)>>8^255&a^99,d[t]=a,f[a]=t,o=16843009*h[i=h[r=h[t]]]^65537*i^257*r^16843008*t,s=257*h[a]^16843008*a,e=0;e<4;e++)l[e][t]=s=s<<24^s>>>8,c[e][a]=o=o<<24^o>>>8;for(e=0;e<5;e++)l[e]=l[e].slice(0),c[e]=c[e].slice(0);return u}()),this._tables=[[o[0][0].slice(),o[0][1].slice(),o[0][2].slice(),o[0][3].slice(),o[0][4].slice()],[o[1][0].slice(),o[1][1].slice(),o[1][2].slice(),o[1][3].slice(),o[1][4].slice()]];var i=this._tables[0][4],a=this._tables[1],s=e.length,u=1;if(4!==s&&6!==s&&8!==s)throw new Error("Invalid aes key size");var l=e.slice(0),c=[];for(this._key=[l,c],t=s;t<4*s+28;t++)r=l[t-1],(t%s==0||8===s&&t%s==4)&&(r=i[r>>>24]<<24^i[r>>16&255]<<16^i[r>>8&255]<<8^i[255&r],t%s==0&&(r=r<<8^r>>>24^u<<24,u=u<<1^283*(u>>7))),l[t]=l[t-s]^r;for(n=0;t;n++,t--)r=l[3&n?t:t-4],c[n]=t<=4||n<4?r:a[0][i[r>>>24]]^a[1][i[r>>16&255]]^a[2][i[r>>8&255]]^a[3][i[255&r]]}return e.prototype.decrypt=function(e,t,n,r,i,a){var s,o,u,l,c=this._key[1],d=e^c[0],f=r^c[1],h=n^c[2],p=t^c[3],g=c.length/4-2,m=4,y=this._tables[1],v=y[0],_=y[1],T=y[2],b=y[3],E=y[4];for(l=0;l<g;l++)s=v[d>>>24]^_[f>>16&255]^T[h>>8&255]^b[255&p]^c[m],o=v[f>>>24]^_[h>>16&255]^T[p>>8&255]^b[255&d]^c[m+1],u=v[h>>>24]^_[p>>16&255]^T[d>>8&255]^b[255&f]^c[m+2],p=v[p>>>24]^_[d>>16&255]^T[f>>8&255]^b[255&h]^c[m+3],m+=4,d=s,f=o,h=u;for(l=0;l<4;l++)i[(3&-l)+a]=E[d>>>24]<<24^E[f>>16&255]<<16^E[h>>8&255]<<8^E[255&p]^c[m++],s=d,d=f,f=h,h=p,p=s},e}(),l=function(e){function t(){var t;return(t=e.call(this,s)||this).jobs=[],t.delay=1,t.timeout_=null,t}a(t,e);var n=t.prototype;return n.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},n.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},t}(s),c=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},d=function(){function e(t,n,r,i){var a=e.STEP,s=new Int32Array(t.buffer),o=new Uint8Array(t.byteLength),u=0;for(this.asyncStream_=new l,this.asyncStream_.push(this.decryptChunk_(s.subarray(u,u+a),n,r,o)),u=a;u<s.length;u+=a)r=new Uint32Array([c(s[u-4]),c(s[u-3]),c(s[u-2]),c(s[u-1])]),this.asyncStream_.push(this.decryptChunk_(s.subarray(u,u+a),n,r,o));this.asyncStream_.push((function(){var e;i(null,(e=o).subarray(0,e.byteLength-e[e.byteLength-1]))}))}return e.prototype.decryptChunk_=function(e,t,n,r){return function(){var i=function(e,t,n){var r,i,a,s,o,l,d,f,h,p=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),g=new u(Array.prototype.slice.call(t)),m=new Uint8Array(e.byteLength),y=new Int32Array(m.buffer);for(r=n[0],i=n[1],a=n[2],s=n[3],h=0;h<p.length;h+=4)o=c(p[h]),l=c(p[h+1]),d=c(p[h+2]),f=c(p[h+3]),g.decrypt(o,l,d,f,y,h),y[h]=c(y[h]^r),y[h+1]=c(y[h+1]^i),y[h+2]=c(y[h+2]^a),y[h+3]=c(y[h+3]^s),r=o,i=l,a=d,s=f;return m}(e,t,n);r.set(i,e.byteOffset)}},r(e,null,[{key:"STEP",get:function(){return 32e3}}]),e}(),f=("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{}).BigInt||Number;f("0x1"),f("0x100"),f("0x10000"),f("0x1000000"),f("0x100000000"),f("0x10000000000"),f("0x1000000000000"),f("0x100000000000000"),f("0x10000000000000000");self.onmessage=function(e){var t=e.data,n=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),r=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),i=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new d(n,r,i,(function(e,n){var r,i;self.postMessage((r={source:t.source,decrypted:n},i={},Object.keys(r).forEach((function(e){var t,n=r[e];t=n,("function"===ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer)?i[e]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:i[e]=n})),i),[n.buffer])}))}}))),ml=nu(gl),yl=function(e){var t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},vl=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},_l=function(e,t){t.activePlaylistLoader=e,e.load()},Tl={AUDIO:function(e,t){return function(){var n=t.segmentLoaders[e],r=t.mediaTypes[e],i=t.blacklistCurrentPlaylist;vl(n,r);var a=r.activeTrack(),s=r.activeGroup(),o=(s.filter((function(e){return e.default}))[0]||s[0]).id,u=r.tracks[o];if(a!==u){for(var l in Ls.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),r.tracks)r.tracks[l].enabled=r.tracks[l]===u;r.onTrackChanged()}else i({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,t){return function(){var n=t.segmentLoaders[e],r=t.mediaTypes[e];Ls.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),vl(n,r);var i=r.activeTrack();i&&(i.mode="disabled"),r.onTrackChanged()}}},bl={AUDIO:function(e,t,n){if(t){var r=n.tech,i=n.requestOptions,a=n.segmentLoaders[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,i),(!r.paused()||e.endList&&"none"!==r.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),i),r.paused()||a.load()})),t.on("error",Tl[e](e,n))}},SUBTITLES:function(e,t,n){var r=n.tech,i=n.requestOptions,a=n.segmentLoaders[e],s=n.mediaTypes[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,i),a.track(s.activeTrack()),(!r.paused()||e.endList&&"none"!==r.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),i),r.paused()||a.load()})),t.on("error",Tl[e](e,n))}},El={AUDIO:function(e,t){var n=t.vhs,r=t.sourceType,i=t.segmentLoaders[e],a=t.requestOptions,s=t.master.mediaGroups,o=t.mediaTypes[e],u=o.groups,l=o.tracks,c=o.logger_,d=t.masterPlaylistLoader,f=go(d.master);for(var h in s[e]&&0!==Object.keys(s[e]).length||(s[e]={main:{default:{default:!0}}},f&&(s[e].main.default.playlists=d.master.playlists)),s[e])for(var p in u[h]||(u[h]=[]),s[e][h]){var g=s[e][h][p],m=void 0;if(f?(c("AUDIO group '"+h+"' label '"+p+"' is a master playlist"),g.isMasterPlaylist=!0,m=null):m="vhs-json"===r&&g.playlists?new No(g.playlists[0],n,a):g.resolvedUri?new No(g.resolvedUri,n,a):g.playlists&&"dash"===r?new Jo(g.playlists[0],n,a,d):null,g=Ls.mergeOptions({id:p,playlistLoader:m},g),bl[e](e,g.playlistLoader,t),u[h].push(g),void 0===l[p]){var y=new Ls.AudioTrack({id:p,kind:yl(g),enabled:!1,language:g.language,default:g.default,label:p});l[p]=y}}i.on("error",Tl[e](e,t))},SUBTITLES:function(e,t){var n=t.tech,r=t.vhs,i=t.sourceType,a=t.segmentLoaders[e],s=t.requestOptions,o=t.master.mediaGroups,u=t.mediaTypes[e],l=u.groups,c=u.tracks,d=t.masterPlaylistLoader;for(var f in o[e])for(var h in l[f]||(l[f]=[]),o[e][f])if(!o[e][f][h].forced){var p=o[e][f][h],g=void 0;if("hls"===i)g=new No(p.resolvedUri,r,s);else if("dash"===i){if(!p.playlists.filter((function(e){return e.excludeUntil!==1/0})).length)return;g=new Jo(p.playlists[0],r,s,d)}else"vhs-json"===i&&(g=new No(p.playlists?p.playlists[0]:p.resolvedUri,r,s));if(p=Ls.mergeOptions({id:h,playlistLoader:g},p),bl[e](e,p.playlistLoader,t),l[f].push(p),void 0===c[h]){var m=n.addRemoteTextTrack({id:h,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:h},!1).track;c[h]=m}}a.on("error",Tl[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var n=t.tech,r=t.master.mediaGroups,i=t.mediaTypes[e],a=i.groups,s=i.tracks;for(var o in r[e])for(var u in a[o]||(a[o]=[]),r[e][o]){var l=r[e][o][u];if(/^(?:CC|SERVICE)/.test(l.instreamId)){var c=n.options_.vhs&&n.options_.vhs.captionServices||{},d={label:u,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(c[d.instreamId]&&(d=Ls.mergeOptions(d,c[d.instreamId])),void 0===d.default&&delete d.default,a[o].push(Ls.mergeOptions({id:u},l)),void 0===s[u]){var f=n.addRemoteTextTrack({id:d.instreamId,kind:"captions",default:d.default,language:d.language,label:d.label},!1).track;s[u]=f}}}}},Sl=function e(t,n){for(var r=0;r<t.length;r++){if(ho(n,t[r]))return!0;if(t[r].playlists&&e(t[r].playlists,n))return!0}return!1},wl={AUDIO:function(e,t){return function(){var n=t.mediaTypes[e].tracks;for(var r in n)if(n[r].enabled)return n[r];return null}},SUBTITLES:function(e,t){return function(){var n=t.mediaTypes[e].tracks;for(var r in n)if("showing"===n[r].mode||"hidden"===n[r].mode)return n[r];return null}}},Al=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],Il=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},Cl=function(e){function t(t){var n;n=e.call(this)||this;var r=t.src,a=t.handleManifestRedirects,s=t.withCredentials,o=t.tech,u=t.bandwidth,l=t.externVhs,c=t.useCueTags,d=t.blacklistDuration,h=t.enableLowInitialPlaylist,p=t.sourceType,g=t.cacheEncryptionKeys,m=t.experimentalBufferBasedABR,y=t.experimentalLeastPixelDiffSelector,v=t.captionServices;if(!r)throw new Error("A non-empty playlist URL or JSON manifest string is required");var _=t.maxPlaylistRetries;null==_&&(_=1/0),Gu=l,n.experimentalBufferBasedABR=Boolean(m),n.experimentalLeastPixelDiffSelector=Boolean(y),n.withCredentials=s,n.tech_=o,n.vhs_=o.vhs,n.sourceType_=p,n.useCueTags_=c,n.blacklistDuration=d,n.maxPlaylistRetries=_,n.enableLowInitialPlaylist=h,n.useCueTags_&&(n.cueTagsTrack_=n.tech_.addTextTrack("metadata","ad-cues"),n.cueTagsTrack_.inBandMetadataTrackDispatchType=""),n.requestOptions_={withCredentials:s,handleManifestRedirects:a,maxPlaylistRetries:_,timeout:null},n.on("error",n.pauseLoading),n.mediaTypes_=function(){var e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(t){e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Hu,activeTrack:Hu,getActiveGroup:Hu,onGroupChanged:Hu,onTrackChanged:Hu,lastTrack_:null,logger_:qs("MediaGroups["+t+"]")}})),e}(),n.mediaSource=new(i().MediaSource),n.handleDurationChange_=n.handleDurationChange_.bind(f(n)),n.handleSourceOpen_=n.handleSourceOpen_.bind(f(n)),n.handleSourceEnded_=n.handleSourceEnded_.bind(f(n)),n.mediaSource.addEventListener("durationchange",n.handleDurationChange_),n.mediaSource.addEventListener("sourceopen",n.handleSourceOpen_),n.mediaSource.addEventListener("sourceended",n.handleSourceEnded_),n.seekable_=Ls.createTimeRanges(),n.hasPlayed_=!1,n.syncController_=new hl(t),n.segmentMetadataTrack_=o.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,n.decrypter_=new ml,n.sourceUpdater_=new sl(n.mediaSource),n.inbandTextTracks_={},n.timelineChangeController_=new pl;var T={vhs:n.vhs_,parse708captions:t.parse708captions,useDtsForTimestampOffset:t.useDtsForTimestampOffset,captionServices:v,mediaSource:n.mediaSource,currentTime:n.tech_.currentTime.bind(n.tech_),seekable:function(){return n.seekable()},seeking:function(){return n.tech_.seeking()},duration:function(){return n.duration()},hasPlayed:function(){return n.hasPlayed_},goalBufferLength:function(){return n.goalBufferLength()},bandwidth:u,syncController:n.syncController_,decrypter:n.decrypter_,sourceType:n.sourceType_,inbandTextTracks:n.inbandTextTracks_,cacheEncryptionKeys:g,sourceUpdater:n.sourceUpdater_,timelineChangeController:n.timelineChangeController_,experimentalExactManifestTimings:t.experimentalExactManifestTimings};n.masterPlaylistLoader_="dash"===n.sourceType_?new Jo(r,n.vhs_,n.requestOptions_):new No(r,n.vhs_,n.requestOptions_),n.setupMasterPlaylistLoaderListeners_(),n.mainSegmentLoader_=new qu(Ls.mergeOptions(T,{segmentMetadataTrack:n.segmentMetadataTrack_,loaderType:"main"}),t),n.audioSegmentLoader_=new qu(Ls.mergeOptions(T,{loaderType:"audio"}),t),n.subtitleSegmentLoader_=new cl(Ls.mergeOptions(T,{loaderType:"vtt",featuresNativeTextTracks:n.tech_.featuresNativeTextTracks,loadVttJs:function(){return new Promise((function(e,t){function n(){o.off("vttjserror",r),e()}function r(){o.off("vttjsloaded",n),t()}o.one("vttjsloaded",n),o.one("vttjserror",r),o.addWebVttScript_()}))}}),t),n.setupSegmentLoaderListeners_(),n.experimentalBufferBasedABR&&(n.masterPlaylistLoader_.one("loadedplaylist",(function(){return n.startABRTimer_()})),n.tech_.on("pause",(function(){return n.stopABRTimer_()})),n.tech_.on("play",(function(){return n.startABRTimer_()}))),Al.forEach((function(e){n[e+"_"]=Il.bind(f(n),e)})),n.logger_=qs("MPC"),n.triggeredFmp4Usage=!1,"none"===n.tech_.preload()?(n.loadOnPlay_=function(){n.loadOnPlay_=null,n.masterPlaylistLoader_.load()},n.tech_.one("play",n.loadOnPlay_)):n.masterPlaylistLoader_.load(),n.timeToLoadedData__=-1,n.mainAppendsToLoadedData__=-1,n.audioAppendsToLoadedData__=-1;var b="none"===n.tech_.preload()?"play":"loadstart";return n.tech_.one(b,(function(){var e=Date.now();n.tech_.one("loadeddata",(function(){n.timeToLoadedData__=Date.now()-e,n.mainAppendsToLoadedData__=n.mainSegmentLoader_.mediaAppends,n.audioAppendsToLoadedData__=n.audioSegmentLoader_.mediaAppends}))})),n}p(t,e);var n=t.prototype;return n.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},n.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},n.appendsToLoadedData_=function(){var e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return-1===e||-1===t?-1:e+t},n.timeToLoadedData_=function(){return this.timeToLoadedData__},n.checkABR_=function(e){void 0===e&&(e="abr");var t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)},n.switchMedia_=function(e,t,n){var r=this.media(),i=r&&(r.id||r.uri),a=e.id||e.uri;i&&i!==a&&(this.logger_("switch media "+i+" -> "+a+" from "+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.masterPlaylistLoader_.media(e,n)},n.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=i().setInterval((function(){return e.checkABR_()}),250)},n.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(i().clearInterval(this.abrTimer_),this.abrTimer_=null)},n.getAudioTrackPlaylists_=function(){var e=this.master(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;var n,r=e.mediaGroups.AUDIO,i=Object.keys(r);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{var a=r.main||i.length&&r[i[0]];for(var s in a)if(a[s].default){n={label:s};break}}if(!n)return t;var o=[];for(var u in r)if(r[u][n.label]){var l=r[u][n.label];if(l.playlists&&l.playlists.length)o.push.apply(o,l.playlists);else if(l.uri)o.push(l);else if(e.playlists.length)for(var c=0;c<e.playlists.length;c++){var d=e.playlists[c];d.attributes&&d.attributes.AUDIO&&d.attributes.AUDIO===u&&o.push(d)}}return o.length?o:t},n.setupMasterPlaylistLoaderListeners_=function(){var e=this;this.masterPlaylistLoader_.on("loadedmetadata",(function(){var t=e.masterPlaylistLoader_.media(),n=1.5*t.targetDuration*1e3;fo(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=n,t.endList&&"none"!==e.tech_.preload()&&(e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load()),function(e){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(t){El[t](t,e)}));var t=e.mediaTypes,n=e.masterPlaylistLoader,r=e.tech,i=e.vhs,a=e.segmentLoaders,s=a.AUDIO,o=a.main;["AUDIO","SUBTITLES"].forEach((function(n){t[n].activeGroup=function(e,t){return function(n){var r=t.masterPlaylistLoader,i=t.mediaTypes[e].groups,a=r.media();if(!a)return null;var s=null;a.attributes[e]&&(s=i[a.attributes[e]]);var o=Object.keys(i);if(!s)if("AUDIO"===e&&o.length>1&&go(t.master))for(var u=0;u<o.length;u++){var l=i[o[u]];if(Sl(l,a)){s=l;break}}else i.main?s=i.main:1===o.length&&(s=i[o[0]]);return void 0===n?s:null!==n&&s&&s.filter((function(e){return e.id===n.id}))[0]||null}}(n,e),t[n].activeTrack=wl[n](n,e),t[n].onGroupChanged=function(e,t){return function(){var n=t.segmentLoaders,r=n[e],i=n.main,a=t.mediaTypes[e],s=a.activeTrack(),o=a.getActiveGroup(),u=a.activePlaylistLoader,l=a.lastGroup_;o&&l&&o.id===l.id||(a.lastGroup_=o,a.lastTrack_=s,vl(r,a),o&&!o.isMasterPlaylist&&(o.playlistLoader?(r.resyncLoader(),_l(o.playlistLoader,a)):u&&i.resetEverything()))}}(n,e),t[n].onGroupChanging=function(e,t){return function(){var n=t.segmentLoaders[e];t.mediaTypes[e].lastGroup_=null,n.abort(),n.pause()}}(n,e),t[n].onTrackChanged=function(e,t){return function(){var n=t.masterPlaylistLoader,r=t.segmentLoaders,i=r[e],a=r.main,s=t.mediaTypes[e],o=s.activeTrack(),u=s.getActiveGroup(),l=s.activePlaylistLoader,c=s.lastTrack_;if((!c||!o||c.id!==o.id)&&(s.lastGroup_=u,s.lastTrack_=o,vl(i,s),u)){if(u.isMasterPlaylist){if(!o||!c||o.id===c.id)return;var d=t.vhs.masterPlaylistController_,f=d.selectPlaylist();if(d.media()===f)return;return s.logger_("track change. Switching master audio from "+c.id+" to "+o.id),n.pause(),a.resetEverything(),void d.fastQualityChange_(f)}if("AUDIO"===e){if(!u.playlistLoader)return a.setAudio(!0),void a.resetEverything();i.setAudio(!0),a.setAudio(!1)}l!==u.playlistLoader?(i.track&&i.track(o),i.resetEverything(),_l(u.playlistLoader,s)):_l(u.playlistLoader,s)}}}(n,e),t[n].getActiveGroup=function(e,t){var n=t.mediaTypes;return function(){var t=n[e].activeTrack();return t?n[e].activeGroup(t):null}}(n,e)}));var u=t.AUDIO.activeGroup();if(u){var l=(u.filter((function(e){return e.default}))[0]||u[0]).id;t.AUDIO.tracks[l].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged(),t.AUDIO.getActiveGroup().playlistLoader?(o.setAudio(!1),s.setAudio(!0)):o.setAudio(!0)}n.on("mediachange",(function(){["AUDIO","SUBTITLES"].forEach((function(e){return t[e].onGroupChanged()}))})),n.on("mediachanging",(function(){["AUDIO","SUBTITLES"].forEach((function(e){return t[e].onGroupChanging()}))}));var c=function(){t.AUDIO.onTrackChanged(),r.trigger({type:"usage",name:"vhs-audio-change"}),r.trigger({type:"usage",name:"hls-audio-change"})};for(var d in r.audioTracks().addEventListener("change",c),r.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),i.on("dispose",(function(){r.audioTracks().removeEventListener("change",c),r.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)})),r.clearTracks("audio"),t.AUDIO.tracks)r.audioTracks().addTrack(t.AUDIO.tracks[d])}({sourceType:e.sourceType_,segmentLoaders:{AUDIO:e.audioSegmentLoader_,SUBTITLES:e.subtitleSegmentLoader_,main:e.mainSegmentLoader_},tech:e.tech_,requestOptions:e.requestOptions_,masterPlaylistLoader:e.masterPlaylistLoader_,vhs:e.vhs_,master:e.master(),mediaTypes:e.mediaTypes_,blacklistCurrentPlaylist:e.blacklistCurrentPlaylist.bind(e)}),e.triggerPresenceUsage_(e.master(),t),e.setupFirstPlay(),!e.mediaTypes_.AUDIO.activePlaylistLoader||e.mediaTypes_.AUDIO.activePlaylistLoader.media()?e.trigger("selectedinitialmedia"):e.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",(function(){e.trigger("selectedinitialmedia")}))})),this.masterPlaylistLoader_.on("loadedplaylist",(function(){e.loadOnPlay_&&e.tech_.off("play",e.loadOnPlay_);var t=e.masterPlaylistLoader_.media();if(!t){var n;if(e.excludeUnsupportedVariants_(),e.enableLowInitialPlaylist&&(n=e.selectInitialPlaylist()),n||(n=e.selectPlaylist()),!n||!e.shouldSwitchToMedia_(n))return;if(e.initialMedia_=n,e.switchMedia_(e.initialMedia_,"initial"),"vhs-json"!==e.sourceType_||!e.initialMedia_.segments)return;t=e.initialMedia_}e.handleUpdatedMediaPlaylist(t)})),this.masterPlaylistLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.masterPlaylistLoader_.error)})),this.masterPlaylistLoader_.on("mediachanging",(function(){e.mainSegmentLoader_.abort(),e.mainSegmentLoader_.pause()})),this.masterPlaylistLoader_.on("mediachange",(function(){var t=e.masterPlaylistLoader_.media(),n=1.5*t.targetDuration*1e3;fo(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=n,e.masterPlaylistLoader_.load(),e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load(),e.tech_.trigger({type:"mediachange",bubbles:!0})})),this.masterPlaylistLoader_.on("playlistunchanged",(function(){var t=e.masterPlaylistLoader_.media();"playlist-unchanged"!==t.lastExcludeReason_&&e.stuckAtPlaylistEnd_(t)&&(e.blacklistCurrentPlaylist({message:"Playlist no longer updating.",reason:"playlist-unchanged"}),e.tech_.trigger("playliststuck"))})),this.masterPlaylistLoader_.on("renditiondisabled",(function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})})),this.masterPlaylistLoader_.on("renditionenabled",(function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})}))},n.handleUpdatedMediaPlaylist=function(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())},n.triggerPresenceUsage_=function(e,t){var n=e.mediaGroups||{},r=!0,i=Object.keys(n.AUDIO);for(var a in n.AUDIO)for(var s in n.AUDIO[a])n.AUDIO[a][s].uri||(r=!1);r&&(this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),this.tech_.trigger({type:"usage",name:"hls-demuxed"})),Object.keys(n.SUBTITLES).length&&(this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),this.tech_.trigger({type:"usage",name:"hls-webvtt"})),Gu.Playlist.isAes(t)&&(this.tech_.trigger({type:"usage",name:"vhs-aes"}),this.tech_.trigger({type:"usage",name:"hls-aes"})),i.length&&Object.keys(n.AUDIO[i[0]]).length>1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},n.shouldSwitchToMedia_=function(e){var t=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,n=this.tech_.currentTime(),r=this.bufferLowWaterLine(),i=this.bufferHighWaterLine();return function(e){var t=e.currentPlaylist,n=e.buffered,r=e.currentTime,i=e.nextPlaylist,a=e.bufferLowWaterLine,s=e.bufferHighWaterLine,o=e.duration,u=e.experimentalBufferBasedABR,l=e.log;if(!i)return Ls.log.warn("We received no playlist to switch to. Please check your stream."),!1;var c="allowing switch "+(t&&t.id||"null")+" -> "+i.id;if(!t)return l(c+" as current playlist is not set"),!0;if(i.id===t.id)return!1;var d=Boolean(Ys(n,r).length);if(!t.endList)return d||"number"!=typeof t.partTargetDuration?(l(c+" as current playlist is live"),!0):(l("not "+c+" as current playlist is live llhls, but currentTime isn't in buffered."),!1);var f=Xs(n,r),h=u?eu.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:eu.MAX_BUFFER_LOW_WATER_LINE;if(o<h)return l(c+" as duration < max low water line ("+o+" < "+h+")"),!0;var p=i.attributes.BANDWIDTH,g=t.attributes.BANDWIDTH;if(p<g&&(!u||f<s)){var m=c+" as next bandwidth < current bandwidth ("+p+" < "+g+")";return u&&(m+=" and forwardBuffer < bufferHighWaterLine ("+f+" < "+s+")"),l(m),!0}if((!u||p>g)&&f>=a){var y=c+" as forwardBuffer >= bufferLowWaterLine ("+f+" >= "+a+")";return u&&(y+=" and next bandwidth > current bandwidth ("+p+" > "+g+")"),l(y),!0}return l("not "+c+" as no switching criteria met"),!1}({buffered:this.tech_.buffered(),currentTime:n,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:i,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},n.setupSegmentLoaderListeners_=function(){var e=this;this.mainSegmentLoader_.on("bandwidthupdate",(function(){e.checkABR_("bandwidthupdate"),e.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("timeout",(function(){e.experimentalBufferBasedABR&&e.mainSegmentLoader_.load()})),this.experimentalBufferBasedABR||this.mainSegmentLoader_.on("progress",(function(){e.trigger("progress")})),this.mainSegmentLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())})),this.mainSegmentLoader_.on("appenderror",(function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.audioSegmentLoader_.on("appenderror",(function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("ended",(function(){e.logger_("main segment loader ended"),e.onEndOfStream()})),this.mainSegmentLoader_.on("earlyabort",(function(t){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120))}));var t=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var t=e.getCodecsOrExclude_();t&&e.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),this.mainSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("ended",(function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()}))},n.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},n.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},n.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},n.fastQualityChange_=function(e){var t=this;void 0===e&&(e=this.selectPlaylist()),e!==this.masterPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything((function(){Ls.browser.IE_VERSION||Ls.browser.IS_EDGE?t.tech_.setCurrentTime(t.tech_.currentTime()+.04):t.tech_.setCurrentTime(t.tech_.currentTime())}))):this.logger_("skipping fastQualityChange because new media is same as old")},n.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0}},n.setupFirstPlay=function(){var e=this,t=this.masterPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_)return!1;if(!t.endList){var n=this.seekable();if(!n.length)return!1;if(Ls.browser.IE_VERSION&&0===this.tech_.readyState())return this.tech_.one("loadedmetadata",(function(){e.trigger("firstplay"),e.tech_.setCurrentTime(n.end(0)),e.hasPlayed_=!0})),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(n.end(0))}return this.hasPlayed_=!0,this.load(),!0},n.handleSourceOpen_=function(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){var e=this.tech_.play();void 0!==e&&"function"==typeof e.then&&e.then(null,(function(e){}))}this.trigger("sourceopen")},n.handleSourceEnded_=function(){if(this.inbandTextTracks_.metadataTrack_){var e=this.inbandTextTracks_.metadataTrack_.cues;if(e&&e.length){var t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}}},n.handleDurationChange_=function(){this.tech_.trigger("durationchange")},n.onEndOfStream=function(){var e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){var t=this.mainSegmentLoader_.getCurrentMediaInfo_();e=!t||t.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())},n.stuckAtPlaylistEnd_=function(e){if(!this.seekable().length)return!1;var t=this.syncController_.getExpiredTime(e,this.duration());if(null===t)return!1;var n=Gu.Playlist.playlistEnd(e,t),r=this.tech_.currentTime(),i=this.tech_.buffered();if(!i.length)return n-r<=Gs;var a=i.end(i.length-1);return a-r<=Gs&&n-a<=Gs},n.blacklistCurrentPlaylist=function(e,t){void 0===e&&(e={});var n=e.playlist||this.masterPlaylistLoader_.media();if(t=t||e.blacklistDuration||this.blacklistDuration,!n)return this.error=e,void("open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));n.playlistErrors_++;var r,i=this.masterPlaylistLoader_.master.playlists,a=i.filter(lo),s=1===a.length&&a[0]===n;if(1===i.length&&t!==1/0)return Ls.log.warn("Problem encountered with playlist "+n.id+". Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(s);if(s){var o=!1;i.forEach((function(e){if(e!==n){var t=e.excludeUntil;void 0!==t&&t!==1/0&&(o=!0,delete e.excludeUntil)}})),o&&(Ls.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}r=n.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*t,n.excludeUntil=r,e.reason&&(n.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var u=this.selectPlaylist();if(!u)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");var l=e.internal?this.logger_:Ls.log.warn,c=e.message?" "+e.message:"";l((e.internal?"Internal problem":"Problem")+" encountered with playlist "+n.id+"."+c+" Switching to playlist "+u.id+"."),u.attributes.AUDIO!==n.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),u.attributes.SUBTITLES!==n.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var d=u.targetDuration/2*1e3||5e3,f="number"==typeof u.lastRequest&&Date.now()-u.lastRequest<=d;return this.switchMedia_(u,"exclude",s||f)},n.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},n.delegateLoaders_=function(e,t){var n=this,r=[],i="all"===e;(i||"main"===e)&&r.push(this.masterPlaylistLoader_);var a=[];(i||"audio"===e)&&a.push("AUDIO"),(i||"subtitle"===e)&&(a.push("CLOSED-CAPTIONS"),a.push("SUBTITLES")),a.forEach((function(e){var t=n.mediaTypes_[e]&&n.mediaTypes_[e].activePlaylistLoader;t&&r.push(t)})),["main","audio","subtitle"].forEach((function(t){var i=n[t+"SegmentLoader_"];!i||e!==t&&"all"!==e||r.push(i)})),r.forEach((function(e){return t.forEach((function(t){"function"==typeof e[t]&&e[t]()}))}))},n.setCurrentTime=function(e){var t=Ys(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},n.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Gu.Playlist.duration(e):1/0:0},n.seekable=function(){return this.seekable_},n.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var t=this.masterPlaylistLoader_.media();if(t){var n=this.syncController_.getExpiredTime(t,this.duration());if(null!==n){var r=this.masterPlaylistLoader_.master,i=Gu.Playlist.seekable(t,n,Gu.Playlist.liveEdgeDelay(r,t));if(0!==i.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(n=this.syncController_.getExpiredTime(t,this.duration())))return;if(0===(e=Gu.Playlist.seekable(t,n,Gu.Playlist.liveEdgeDelay(r,t))).length)return}var a,s;this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),s=this.seekable_.start(0)),e?e.start(0)>i.end(0)||i.start(0)>e.end(0)?this.seekable_=i:this.seekable_=Ls.createTimeRanges([[e.start(0)>i.start(0)?e.start(0):i.start(0),e.end(0)<i.end(0)?e.end(0):i.end(0)]]):this.seekable_=i,this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===a&&this.seekable_.start(0)===s||(this.logger_("seekable updated ["+Zs(this.seekable_)+"]"),this.tech_.trigger("seekablechanged"))}}}}},n.updateDuration=function(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),"open"!==this.mediaSource.readyState)return this.updateDuration_=this.updateDuration.bind(this,e),void this.mediaSource.addEventListener("sourceopen",this.updateDuration_);if(e){var t=this.seekable();if(!t.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<t.end(t.length-1))&&this.sourceUpdater_.setDuration(t.end(t.length-1))}else{var n=this.tech_.buffered(),r=Gu.Playlist.duration(this.masterPlaylistLoader_.media());n.length>0&&(r=Math.max(r,n.end(n.length-1))),this.mediaSource.duration!==r&&this.sourceUpdater_.setDuration(r)}},n.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach((function(t){var n=e.mediaTypes_[t].groups;for(var r in n)n[r].forEach((function(e){e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},n.master=function(){return this.masterPlaylistLoader_.master},n.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},n.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),n=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!n)},n.getCodecsOrExclude_=function(){var e=this,t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},n=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();t.video=t.main;var r=Iu(this.master(),n),i={},a=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(i.video=r.video||t.main.videoCodec||"avc1.4d400d"),t.main.isMuxed&&(i.video+=","+(r.audio||t.main.audioCodec||Y)),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||a)&&(i.audio=r.audio||t.main.audioCodec||t.audio.audioCodec||Y,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),i.audio||i.video){var s,o={};if(["video","audio"].forEach((function(e){if(i.hasOwnProperty(e)&&(r=t[e].isFmp4,a=i[e],!(r?G(a):V(a)))){var n=t[e].isFmp4?"browser":"muxer";o[n]=o[n]||[],o[n].push(i[e]),"audio"===e&&(s=n)}var r,a})),a&&s&&n.attributes.AUDIO){var u=n.attributes.AUDIO;this.master().playlists.forEach((function(e){(e.attributes&&e.attributes.AUDIO)===u&&e!==n&&(e.excludeUntil=1/0)})),this.logger_("excluding audio group "+u+" as "+s+' does not support codec(s): "'+i.audio+'"')}if(!Object.keys(o).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var l=[];if(["video","audio"].forEach((function(t){var n=(j(e.sourceUpdater_.codecs[t]||"")[0]||{}).type,r=(j(i[t]||"")[0]||{}).type;n&&r&&n.toLowerCase()!==r.toLowerCase()&&l.push('"'+e.sourceUpdater_.codecs[t]+'" -> "'+i[t]+'"')})),l.length)return void this.blacklistCurrentPlaylist({playlist:n,message:"Codec switching not supported: "+l.join(", ")+".",blacklistDuration:1/0,internal:!0})}return i}var c=Object.keys(o).reduce((function(e,t){return e&&(e+=", "),e+(t+' does not support codec(s): "')+o[t].join(",")+'"'}),"")+".";this.blacklistCurrentPlaylist({playlist:n,internal:!0,message:c,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:n,message:"Could not determine codecs for playlist.",blacklistDuration:1/0})},n.tryToCreateSourceBuffers_=function(){if("open"===this.mediaSource.readyState&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}}},n.excludeUnsupportedVariants_=function(){var e=this,t=this.master().playlists,n=[];Object.keys(t).forEach((function(r){var i=t[r];if(-1===n.indexOf(i.id)){n.push(i.id);var a=Iu(e.master,i),s=[];!a.audio||V(a.audio)||G(a.audio)||s.push("audio codec "+a.audio),!a.video||V(a.video)||G(a.video)||s.push("video codec "+a.video),a.text&&"stpp.ttml.im1t"===a.text&&s.push("text codec "+a.text),s.length&&(i.excludeUntil=1/0,e.logger_("excluding "+i.id+" for unsupported: "+s.join(", ")))}}))},n.excludeIncompatibleVariants_=function(e){var t=this,n=[],r=this.master().playlists,i=wu(j(e)),a=Au(i),s=i.video&&j(i.video)[0]||null,o=i.audio&&j(i.audio)[0]||null;Object.keys(r).forEach((function(e){var i=r[e];if(-1===n.indexOf(i.id)&&i.excludeUntil!==1/0){n.push(i.id);var u=[],l=Iu(t.masterPlaylistLoader_.master,i),c=Au(l);if(l.audio||l.video){if(c!==a&&u.push('codec count "'+c+'" !== "'+a+'"'),!t.sourceUpdater_.canChangeType()){var d=l.video&&j(l.video)[0]||null,f=l.audio&&j(l.audio)[0]||null;d&&s&&d.type.toLowerCase()!==s.type.toLowerCase()&&u.push('video codec "'+d.type+'" !== "'+s.type+'"'),f&&o&&f.type.toLowerCase()!==o.type.toLowerCase()&&u.push('audio codec "'+f.type+'" !== "'+o.type+'"')}u.length&&(i.excludeUntil=1/0,t.logger_("blacklisting "+i.id+": "+u.join(" && ")))}}}))},n.updateAdCues_=function(e){var t=0,n=this.seekable();n.length&&(t=n.start(0)),function(e,t,n){if(void 0===n&&(n=0),e.segments)for(var r,a=n,s=0;s<e.segments.length;s++){var o=e.segments[s];if(r||(r=dl(t,a+o.duration/2)),r){if("cueIn"in o){r.endTime=a,r.adEndTime=a,a+=o.duration,r=null;continue}if(a<r.endTime){a+=o.duration;continue}r.endTime+=o.duration}else if("cueOut"in o&&((r=new(i().VTTCue)(a,a+o.duration,o.cueOut)).adStartTime=a,r.adEndTime=a+parseFloat(o.cueOut),t.addCue(r)),"cueOutCont"in o){var u=o.cueOutCont.split("/").map(parseFloat),l=u[0],c=u[1];(r=new(i().VTTCue)(a,a+o.duration,"")).adStartTime=a-l,r.adEndTime=r.adStartTime+c,t.addCue(r)}a+=o.duration}}(e,this.cueTagsTrack_,t)},n.goalBufferLength=function(){var e=this.tech_.currentTime(),t=eu.GOAL_BUFFER_LENGTH,n=eu.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,eu.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*n,r)},n.bufferLowWaterLine=function(){var e=this.tech_.currentTime(),t=eu.BUFFER_LOW_WATER_LINE,n=eu.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,eu.MAX_BUFFER_LOW_WATER_LINE),i=Math.max(t,eu.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*n,this.experimentalBufferBasedABR?i:r)},n.bufferHighWaterLine=function(){return eu.BUFFER_HIGH_WATER_LINE},t}(Ls.EventTarget),Rl=function(e,t,n){var r,i,a,s=e.masterPlaylistController_,o=s[(e.options_.smoothQualityChange?"smooth":"fast")+"QualityChange_"].bind(s);if(t.attributes){var u=t.attributes.RESOLUTION;this.width=u&&u.width,this.height=u&&u.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=Iu(s.master(),t),this.playlist=t,this.id=n,this.enabled=(r=e.playlists,i=t.id,a=o,function(e){var t=r.master.playlists[i],n=uo(t),s=lo(t);return void 0===e?s:(e?delete t.disabled:t.disabled=!0,e===s||n||(a(),e?r.trigger("renditionenabled"):r.trigger("renditiondisabled")),e)})},Dl=["seeking","seeked","pause","playing","error"],xl=function(){function e(e){var t=this;this.masterPlaylistController_=e.masterPlaylistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=qs("PlaybackWatcher"),this.logger_("initialize");var n=function(){return t.monitorCurrentTime_()},r=function(){return t.monitorCurrentTime_()},a=function(){return t.techWaiting_()},s=function(){return t.cancelTimer_()},o=this.masterPlaylistController_,u=["main","subtitle","audio"],l={};u.forEach((function(e){l[e]={reset:function(){return t.resetSegmentDownloads_(e)},updateend:function(){return t.checkSegmentDownloads_(e)}},o[e+"SegmentLoader_"].on("appendsdone",l[e].updateend),o[e+"SegmentLoader_"].on("playlistupdate",l[e].reset),t.tech_.on(["seeked","seeking"],l[e].reset)}));var c=function(e){["main","audio"].forEach((function(n){o[n+"SegmentLoader_"][e]("appended",t.seekingAppendCheck_)}))};this.seekingAppendCheck_=function(){t.fixesBadSeeks_()&&(t.consecutiveUpdates=0,t.lastRecordedTime=t.tech_.currentTime(),c("off"))},this.clearSeekingAppendCheck_=function(){return c("off")},this.watchForBadSeeking_=function(){t.clearSeekingAppendCheck_(),c("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",a),this.tech_.on(Dl,s),this.tech_.on("canplay",r),this.tech_.one("play",n),this.dispose=function(){t.clearSeekingAppendCheck_(),t.logger_("dispose"),t.tech_.off("waiting",a),t.tech_.off(Dl,s),t.tech_.off("canplay",r),t.tech_.off("play",n),t.tech_.off("seeking",t.watchForBadSeeking_),t.tech_.off("seeked",t.clearSeekingAppendCheck_),u.forEach((function(e){o[e+"SegmentLoader_"].off("appendsdone",l[e].updateend),o[e+"SegmentLoader_"].off("playlistupdate",l[e].reset),t.tech_.off(["seeked","seeking"],l[e].reset)})),t.checkCurrentTimeTimeout_&&i().clearTimeout(t.checkCurrentTimeTimeout_),t.cancelTimer_()}}var t=e.prototype;return t.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&i().clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=i().setTimeout(this.monitorCurrentTime_.bind(this),250)},t.resetSegmentDownloads_=function(e){var t=this.masterPlaylistController_[e+"SegmentLoader_"];this[e+"StalledDownloads_"]>0&&this.logger_("resetting possible stalled download count for "+e+" loader"),this[e+"StalledDownloads_"]=0,this[e+"Buffered_"]=t.buffered_()},t.checkSegmentDownloads_=function(e){var t=this.masterPlaylistController_,n=t[e+"SegmentLoader_"],r=n.buffered_(),i=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(var n=0;n<e.length;n++)if(e.start(n)!==t.start(n)||e.end(n)!==t.end(n))return!0;return!1}(this[e+"Buffered_"],r);this[e+"Buffered_"]=r,i?this.resetSegmentDownloads_(e):(this[e+"StalledDownloads_"]++,this.logger_("found #"+this[e+"StalledDownloads_"]+" "+e+" appends that did not increase buffer (possible stalled download)",{playlistId:n.playlist_&&n.playlist_.id,buffered:Ks(r)}),this[e+"StalledDownloads_"]<10||(this.logger_(e+" loader stalled download exclusion"),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:"vhs-"+e+"-download-exclusion"}),"subtitle"!==e&&t.blacklistCurrentPlaylist({message:"Excessive "+e+" segment downloading detected."},1/0)))},t.checkCurrentTime_=function(){if(!this.tech_.paused()&&!this.tech_.seeking()){var e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Gs>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},t.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var e,t=this.seekable(),n=this.tech_.currentTime();if(this.afterSeekableWindow_(t,n,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(e=t.end(t.length-1)),this.beforeSeekableWindow_(t,n)){var r=t.start(0);e=r+(r===t.end(0)?0:Gs)}if(void 0!==e)return this.logger_("Trying to seek outside of seekable at time "+n+" with seekable range "+Zs(t)+". Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0;for(var i=this.masterPlaylistController_.sourceUpdater_,a=this.tech_.buffered(),s=i.audioBuffer?i.audioBuffered():null,o=i.videoBuffer?i.videoBuffered():null,u=this.media(),l=u.partTargetDuration?u.partTargetDuration:2*(u.targetDuration-Hs),c=[s,o],d=0;d<c.length;d++)if(c[d]&&Xs(c[d],n)<l)return!1;var f=zs(a,n);return 0!==f.length&&(e=f.start(0)+Gs,this.logger_("Buffered region starts ("+f.start(0)+") just beyond seek point ("+n+"). Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0)},t.waiting_=function(){if(!this.techWaiting_()){var e=this.tech_.currentTime(),t=this.tech_.buffered(),n=Ys(t,e);return n.length&&e+3<=n.end(0)?(this.cancelTimer_(),this.tech_.setCurrentTime(e),this.logger_("Stopped at "+e+" while inside a buffered region ["+n.start(0)+" -> "+n.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}},t.techWaiting_=function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var n=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+n),this.cancelTimer_(),this.tech_.setCurrentTime(n),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var r=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,i=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:r.audioBuffered(),videoBuffered:r.videoBuffered(),currentTime:t}))return this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var a=zs(i,t);if(a.length>0){var s=a.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+s+", seeking to "+a.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*s,t),!0}return!1},t.afterSeekableWindow_=function(e,t,n,r){if(void 0===r&&(r=!1),!e.length)return!1;var i=e.end(e.length-1)+Gs;return!n.endList&&r&&(i=e.end(e.length-1)+3*n.targetDuration),t>i},t.beforeSeekableWindow_=function(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)},t.videoUnderflow_=function(e){var t=e.videoBuffered,n=e.audioBuffered,r=e.currentTime;if(t){var i;if(t.length&&n.length){var a=Ys(t,r-3),s=Ys(t,r),o=Ys(n,r);o.length&&!s.length&&a.length&&(i={start:a.end(0),end:o.end(0)})}else zs(t,r).length||(i=this.gapFromVideoUnderflow_(t,r));return!!i&&(this.logger_("Encountered a gap in video from "+i.start+" to "+i.end+". Seeking to current time "+r),!0)}},t.skipTheGap_=function(e){var t=this.tech_.buffered(),n=this.tech_.currentTime(),r=zs(t,n);this.cancelTimer_(),0!==r.length&&n===e&&(this.logger_("skipTheGap_:","currentTime:",n,"scheduled currentTime:",e,"nextRange start:",r.start(0)),this.tech_.setCurrentTime(r.start(0)+Hs),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))},t.gapFromVideoUnderflow_=function(e,t){for(var n=function(e){if(e.length<2)return Ls.createTimeRanges();for(var t=[],n=1;n<e.length;n++){var r=e.end(n-1),i=e.start(n);t.push([r,i])}return Ls.createTimeRanges(t)}(e),r=0;r<n.length;r++){var i=n.start(r),a=n.end(r);if(t-i<4&&t-i>2)return{start:i,end:a}}return null},e}(),Nl={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},Ol=function e(t,n){var r=0,i=0,a=Ls.mergeOptions(Nl,n);t.ready((function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"})}));var s=function(){i&&t.currentTime(i)},o=function(e){null!=e&&(i=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(e),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},u=function(){return Date.now()-r<1e3*a.errorInterval?(t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void t.trigger({type:"usage",name:"hls-error-reload-canceled"})):a.getSource&&"function"==typeof a.getSource?(r=Date.now(),a.getSource.call(t,o)):void Ls.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},l=function e(){t.off("loadedmetadata",s),t.off("error",u),t.off("dispose",e)};t.on("error",u),t.on("dispose",l),t.reloadSourceOnError=function(n){l(),e(t,n)}},Pl="2.16.2",Ml={PlaylistLoader:No,Playlist:mo,utils:Vo,STANDARD_PLAYLIST_SELECTOR:Pu,INITIAL_PLAYLIST_SELECTOR:function(){var e=this,t=this.playlists.master.playlists.filter(mo.isEnabled);return xu(t,(function(e,t){return Nu(e,t)})),t.filter((function(t){return!!Iu(e.playlists.master,t).video}))[0]||null},lastBandwidthSelector:Pu,movingAverageBandwidthSelector:function(e){var t=-1,n=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var r=this.useDevicePixelRatio&&i().devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,n=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==n&&(t=e*this.systemBandwidth+(1-e)*t,n=this.systemBandwidth),Ou(this.playlists.master,t,parseInt(Du(this.tech_.el(),"width"),10)*r,parseInt(Du(this.tech_.el(),"height"),10)*r,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:Nu,comparePlaylistResolution:function(e,t){var n,r;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(n=e.attributes.RESOLUTION.width),n=n||i().Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(r=t.attributes.RESOLUTION.width),n===(r=r||i().Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:n-r},xhr:ko()};Object.keys(eu).forEach((function(e){Object.defineProperty(Ml,e,{get:function(){return Ls.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),eu[e]},set:function(t){Ls.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?Ls.log.warn("value of Vhs."+e+" must be greater than or equal to 0"):eu[e]=t}})}));var kl="videojs-vhs",Ll=function(e,t){for(var n=t.media(),r=-1,i=0;i<e.length;i++)if(e[i].id===n.id){r=i;break}e.selectedIndex_=r,e.trigger({selectedIndex:r,type:"change"})};Ml.canPlaySource=function(){return Ls.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var Fl=function(){if(!i().localStorage)return null;var e=i().localStorage.getItem(kl);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}};Ml.supportsNativeHls=function(){if(!u()||!u().createElement)return!1;var e=u().createElement("video");return!!Ls.getTech("Html5").isSupported()&&["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some((function(t){return/maybe|probably/i.test(e.canPlayType(t))}))}(),Ml.supportsNativeDash=!!(u()&&u().createElement&&Ls.getTech("Html5").isSupported())&&/maybe|probably/i.test(u().createElement("video").canPlayType("application/dash+xml")),Ml.supportsTypeNatively=function(e){return"hls"===e?Ml.supportsNativeHls:"dash"===e&&Ml.supportsNativeDash},Ml.isSupported=function(){return Ls.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var Ul=function(e){function t(t,n,r){var i;if(i=e.call(this,n,Ls.mergeOptions(r.hls,r.vhs))||this,r.hls&&Object.keys(r.hls).length&&Ls.log.warn("Using hls options is deprecated. Please rename `hls` to `vhs` in your options object."),"number"==typeof r.initialBandwidth&&(i.options_.bandwidth=r.initialBandwidth),i.logger_=qs("VhsHandler"),n.options_&&n.options_.playerId){var a=Ls(n.options_.playerId);a.hasOwnProperty("hls")||Object.defineProperty(a,"hls",{get:function(){return Ls.log.warn("player.hls is deprecated. Use player.tech().vhs instead."),n.trigger({type:"usage",name:"hls-player-access"}),f(i)},configurable:!0}),a.hasOwnProperty("vhs")||Object.defineProperty(a,"vhs",{get:function(){return Ls.log.warn("player.vhs is deprecated. Use player.tech().vhs instead."),n.trigger({type:"usage",name:"vhs-player-access"}),f(i)},configurable:!0}),a.hasOwnProperty("dash")||Object.defineProperty(a,"dash",{get:function(){return Ls.log.warn("player.dash is deprecated. Use player.tech().vhs instead."),f(i)},configurable:!0}),i.player_=a}if(i.tech_=n,i.source_=t,i.stats={},i.ignoreNextSeekingEvent_=!1,i.setOptions_(),i.options_.overrideNative&&n.overrideNativeAudioTracks&&n.overrideNativeVideoTracks)n.overrideNativeAudioTracks(!0),n.overrideNativeVideoTracks(!0);else if(i.options_.overrideNative&&(n.featuresNativeVideoTracks||n.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return i.on(u(),["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(function(e){var t=u().fullscreenElement||u().webkitFullscreenElement||u().mozFullScreenElement||u().msFullscreenElement;t&&t.contains(i.tech_.el())?i.masterPlaylistController_.fastQualityChange_():i.masterPlaylistController_.checkABR_()})),i.on(i.tech_,"seeking",(function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())})),i.on(i.tech_,"error",(function(){this.tech_.error()&&this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()})),i.on(i.tech_,"play",i.play),i}p(t,e);var n=t.prototype;return n.setOptions_=function(){var e=this;if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.handleManifestRedirects=!1!==this.options_.handleManifestRedirects,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,"number"!=typeof this.options_.blacklistDuration&&(this.options_.blacklistDuration=300),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){var t=Fl();t&&t.bandwidth&&(this.options_.bandwidth=t.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),t&&t.throughput&&(this.options_.throughput=t.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))}"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=eu.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===eu.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","experimentalBufferBasedABR","liveRangeSafeTimeDelta","experimentalLLHLS","useNetworkInformationApi","useDtsForTimestampOffset","experimentalExactManifestTimings","experimentalLeastPixelDiffSelector"].forEach((function(t){void 0!==e.source_[t]&&(e.options_[t]=e.source_[t])})),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio},n.src=function(e,t){var n=this;if(e){var r;this.setOptions_(),this.options_.src=0===(r=this.source_.src).toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(r.substring(r.indexOf(",")+1)):r,this.options_.tech=this.tech_,this.options_.externVhs=Ml,this.options_.sourceType=K(t),this.options_.seekTo=function(e){n.tech_.setCurrentTime(e)},this.options_.smoothQualityChange&&Ls.log.warn("smoothQualityChange is deprecated and will be removed in the next major version"),this.masterPlaylistController_=new Cl(this.options_);var a=Ls.mergeOptions({liveRangeSafeTimeDelta:Gs},this.options_,{seekable:function(){return n.seekable()},media:function(){return n.masterPlaylistController_.media()},masterPlaylistController:this.masterPlaylistController_});this.playbackWatcher_=new xl(a),this.masterPlaylistController_.on("error",(function(){var e=Ls.players[n.tech_.options_.playerId],t=n.masterPlaylistController_.error;"object"!=typeof t||t.code?"string"==typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)}));var s=this.options_.experimentalBufferBasedABR?Ml.movingAverageBandwidthSelector(.55):Ml.STANDARD_PLAYLIST_SELECTOR;this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):s.bind(this),this.masterPlaylistController_.selectInitialPlaylist=Ml.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(e){this.masterPlaylistController_.selectPlaylist=e.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=e,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){var e=this.masterPlaylistController_.mainSegmentLoader_.bandwidth,t=i().navigator.connection||i().navigator.mozConnection||i().navigator.webkitConnection,n=1e7;if(this.options_.useNetworkInformationApi&&t){var r=1e3*t.downlink*1e3;e=r>=n&&e>=n?Math.max(e,r):r}return e},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=e,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var e,t=1/(this.bandwidth||1);return e=this.throughput>0?1/this.throughput:0,Math.floor(1/(t+e))},set:function(){Ls.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return n.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return n.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return n.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return n.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return n.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return n.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return n.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return n.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return n.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return n.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return n.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return n.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return n.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return Ks(n.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return n.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return n.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return n.tech_.name_},enumerable:!0},duration:{get:function(){return n.tech_.duration()},enumerable:!0},master:{get:function(){return n.playlists.master},enumerable:!0},playerDimensions:{get:function(){return n.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return Ks(n.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return n.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",(function(){n.options_.useBandwidthFromLocalStorage&&function(e){if(!i().localStorage)return!1;var t=Fl();t=t?Ls.mergeOptions(t,e):e;try{i().localStorage.setItem(kl,JSON.stringify(t))}catch(e){return!1}}({bandwidth:n.bandwidth,throughput:Math.round(n.throughput)})})),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var e;(e=n).representations=function(){var t=e.masterPlaylistController_.master(),n=go(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return n?n.filter((function(e){return!uo(e)})).map((function(t,n){return new Rl(e,t,t.id)})):[]}})),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",(function(){n.setupEme_()})),this.on(this.masterPlaylistController_,"progress",(function(){this.tech_.trigger("progress")})),this.on(this.masterPlaylistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=!0})),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=i().URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},n.createKeySessions_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),function(e){var t=e.player,n=e.sourceKeySystems,r=e.audioMedia,i=e.mainPlaylists;if(!t.eme.initializeMediaKeys)return Promise.resolve();var a,s,o=(a=r?i.concat([r]):i,s=Object.keys(n),a.reduce((function(e,t){if(!t.contentProtection)return e;var n=s.reduce((function(e,n){var r=t.contentProtection[n];return r&&r.pssh&&(e[n]={pssh:r.pssh}),e}),{});return Object.keys(n).length&&e.push(n),e}),[])),u=[],l=[];return o.forEach((function(e){l.push(new Promise((function(e,n){t.tech_.one("keysessioncreated",e)}))),u.push(new Promise((function(n,r){t.eme.initializeMediaKeys({keySystems:e},(function(e){e?r(e):n()}))})))})),Promise.race([Promise.all(u),Promise.race(l)])}({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.master.playlists}).then((function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()})).catch((function(t){e.logger_("error while creating EME key session",t),e.player_.error({message:"Failed to initialize media keys for EME",code:3})}))},n.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},n.setupEme_=function(){var e,t,n,r=this,i=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,a=(e={player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:i&&i.media()},t=e.player,!(!(n=function(e,t,n){if(!e)return e;var r={};t&&t.attributes&&t.attributes.CODECS&&(r=wu(j(t.attributes.CODECS))),n&&n.attributes&&n.attributes.CODECS&&(r.audio=n.attributes.CODECS);var i=H(r.video),a=H(r.audio),s={};for(var o in e)s[o]={},a&&(s[o].audioContentType=a),i&&(s[o].videoContentType=i),t.contentProtection&&t.contentProtection[o]&&t.contentProtection[o].pssh&&(s[o].pssh=t.contentProtection[o].pssh),"string"==typeof e[o]&&(s[o].url=e[o]);return Ls.mergeOptions(e,s)}(e.sourceKeySystems,e.media,e.audioMedia))||(t.currentSource().keySystems=n,n&&!t.eme&&(Ls.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),1))));this.player_.tech_.on("keystatuschange",(function(e){if("output-restricted"===e.status){var t=r.masterPlaylistController_.master();if(t&&t.playlists){var n,i=[];t.playlists.forEach((function(e){e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height>=720&&(!e.excludeUntil||e.excludeUntil<1/0)&&(e.excludeUntil=1/0,i.push(e))})),i.length&&((n=Ls.log).warn.apply(n,['DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.'].concat(i)),r.masterPlaylistController_.fastQualityChange_())}}})),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),11!==Ls.browser.IE_VERSION&&a?this.createKeySessions_():this.masterPlaylistController_.sourceUpdater_.initializedEme()},n.setupQualityLevels_=function(){var e=this,t=Ls.players[this.tech_.options_.playerId];t&&t.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var t,n;t=e.qualityLevels_,(n=e).representations().forEach((function(e){t.addQualityLevel(e)})),Ll(t,n.playlists)})),this.playlists.on("mediachange",(function(){Ll(e.qualityLevels_,e.playlists)})))},t.version=function(){return{"@videojs/http-streaming":Pl,"mux.js":"6.0.1","mpd-parser":"0.22.1","m3u8-parser":"4.8.0","aes-decrypter":"3.1.3"}},n.version=function(){return this.constructor.version()},n.canChangeType=function(){return sl.canChangeType()},n.play=function(){this.masterPlaylistController_.play()},n.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},n.duration=function(){return this.masterPlaylistController_.duration()},n.seekable=function(){return this.masterPlaylistController_.seekable()},n.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&i().URL.revokeObjectURL&&(i().URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),e.prototype.dispose.call(this)},n.convertToProgramTime=function(e,t){return function(e){var t=e.playlist,n=e.time,r=void 0===n?void 0:n,i=e.callback;if(!i)throw new Error("getProgramTime: callback must be provided");if(!t||void 0===r)return i({message:"getProgramTime: playlist and time must be provided"});var a=function(e,t){if(!t||!t.segments||0===t.segments.length)return null;for(var n,r=0,i=0;i<t.segments.length&&!(e<=(r=(n=t.segments[i]).videoTimingInfo?n.videoTimingInfo.transmuxedPresentationEnd:r+n.duration));i++);var a=t.segments[t.segments.length-1];if(a.videoTimingInfo&&a.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>r){if(e>r+.25*a.duration)return null;n=a}return{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:r-n.duration,type:n.videoTimingInfo?"accurate":"estimate"}}(r,t);if(!a)return i({message:"valid programTime was not found"});if("estimate"===a.type)return i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var s={mediaSeconds:r},o=function(e,t){if(!t.dateTimeObject)return null;var n=t.videoTimingInfo.transmuxerPrependedSeconds,r=e-(t.videoTimingInfo.transmuxedPresentationStart+n);return new Date(t.dateTimeObject.getTime()+1e3*r)}(r,a.segment);return o&&(s.programDateTime=o.toISOString()),i(null,s)}({playlist:this.masterPlaylistController_.media(),time:e,callback:t})},n.seekToProgramTime=function(e,t,n,r){return void 0===n&&(n=!0),void 0===r&&(r=2),Yo({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:r,pauseAfterSeek:n,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})},t}(Ls.getComponent("Component")),Bl={name:"videojs-http-streaming",VERSION:Pl,canHandleSource:function(e,t){void 0===t&&(t={});var n=Ls.mergeOptions(Ls.options,t);return Bl.canPlayType(e.type,n)},handleSource:function(e,t,n){void 0===n&&(n={});var r=Ls.mergeOptions(Ls.options,n);return t.vhs=new Ul(e,t,r),Ls.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return Ls.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=ko(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){var n=K(e);if(!n)return"";var r=Bl.getOverrideNative(t);return!Ml.supportsTypeNatively(n)||r?"maybe":""},getOverrideNative:function(e){void 0===e&&(e={});var t=e,n=t.vhs,r=void 0===n?{}:n,i=t.hls,a=void 0===i?{}:i,s=!(Ls.browser.IS_ANY_SAFARI||Ls.browser.IS_IOS),o=r.overrideNative,u=void 0===o?s:o,l=a.overrideNative;return void 0!==l&&l||u}};G("avc1.4d400d,mp4a.40.2")&&Ls.getTech("Html5").registerSourceHandler(Bl,0),Ls.VhsHandler=Ul,Object.defineProperty(Ls,"HlsHandler",{get:function(){return Ls.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),Ul},configurable:!0}),Ls.VhsSourceHandler=Bl,Object.defineProperty(Ls,"HlsSourceHandler",{get:function(){return Ls.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),Bl},configurable:!0}),Ls.Vhs=Ml,Object.defineProperty(Ls,"Hls",{get:function(){return Ls.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Ml},configurable:!0}),Ls.use||(Ls.registerComponent("Hls",Ml),Ls.registerComponent("Vhs",Ml)),Ls.options.vhs=Ls.options.vhs||{},Ls.options.hls=Ls.options.hls||{},Ls.getPlugin&&Ls.getPlugin("reloadSourceOnError")||(Ls.registerPlugin||Ls.plugin)("reloadSourceOnError",(function(e){Ol(this,e)}));const jl=Ls;var ql,Hl,Gl,Vl=(ql=function(e,t){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s="./index.js")}({"./externals/base64.js":function(e,t,n){var r,i,o,u,l,c={encode:function(e){for(var t=[],n=0;n<e.length;++n){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?(t.push(192|r>>6),t.push(128|63&r)):r<65536?(t.push(224|r>>12),t.push(128|63&r>>6),t.push(128|63&r)):(t.push(240|r>>18),t.push(128|63&r>>12),t.push(128|63&r>>6),t.push(128|63&r))}return t},decode:function(e){for(var t=[],n=0;n<e.length;){var r=e[n++];r<128||(r<224?(r=(31&r)<<6,r|=63&e[n++]):r<240?(r=(15&r)<<12,r|=(63&e[n++])<<6,r|=63&e[n++]):(r=(7&r)<<18,r|=(63&e[n++])<<12,r|=(63&e[n++])<<6,r|=63&e[n++])),t.push(String.fromCharCode(r))}return t.join("")}},d={};r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=function(e){for(var t=0,n=[],i=0|e.length/3;0<i--;){var a=(e[t]<<16)+(e[t+1]<<8)+e[t+2];t+=3,n.push(r.charAt(63&a>>18)),n.push(r.charAt(63&a>>12)),n.push(r.charAt(63&a>>6)),n.push(r.charAt(63&a))}return 2==e.length-t?(a=(e[t]<<16)+(e[t+1]<<8),n.push(r.charAt(63&a>>18)),n.push(r.charAt(63&a>>12)),n.push(r.charAt(63&a>>6)),n.push("=")):1==e.length-t&&(a=e[t]<<16,n.push(r.charAt(63&a>>18)),n.push(r.charAt(63&a>>12)),n.push("==")),n.join("")},o=function(){for(var e=[],t=0;t<64;++t)e[r.charCodeAt(t)]=t;return e["=".charCodeAt(0)]=0,e}(),u=function(e){for(var t=0,n=[],r=0|e.length/4;0<r--;){var i=(o[e.charCodeAt(t)]<<18)+(o[e.charCodeAt(t+1)]<<12)+(o[e.charCodeAt(t+2)]<<6)+o[e.charCodeAt(t+3)];n.push(255&i>>16),n.push(255&i>>8),n.push(255&i),t+=4}return n&&("="==e.charAt(t-2)?(n.pop(),n.pop()):"="==e.charAt(t-1)&&n.pop()),n},l={encode:function(e){for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t},decode:function(e){for(var t=0;t<s.length;++t)a[t]=String.fromCharCode(a[t]);return a.join("")}},d.decodeArray=function(e){var t=u(e);return new Uint8Array(t)},d.encodeASCII=function(e){var t=l.encode(e);return i(t)},d.decodeASCII=function(e){var t=u(e);return l.decode(t)},d.encode=function(e){var t=c.encode(e);return i(t)},d.decode=function(e){var t=u(e);return c.decode(t)},t.decode=d.decode,t.decodeArray=d.decodeArray,t.encode=d.encode,t.encodeASCII=d.encodeASCII},"./externals/cea608-parser.js":function(e,t,n){!function(e){var t={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},n=function(e){var n=e;return t.hasOwnProperty(e)&&(n=t[e]),String.fromCharCode(n)},r=15,i=32,a={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},s={17:2,18:4,21:6,22:8,23:10,19:13,20:15},o={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},u={25:2,26:4,29:6,30:8,31:10,27:13,28:15},l=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],c={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(e){this.time=e},log:function(e,t){var n=this.verboseFilter[e];this.verboseLevel>=n&&console.log(this.time+" ["+e+"] "+t)}},d=function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].toString(16));return t},f=function(e,t,n,r,i){this.foreground=e||"white",this.underline=t||!1,this.italics=n||!1,this.background=r||"black",this.flash=i||!1};f.prototype={reset:function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},setStyles:function(e){for(var t=["foreground","underline","italics","background","flash"],n=0;n<t.length;n++){var r=t[n];e.hasOwnProperty(r)&&(this[r]=e[r])}},isDefault:function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},equals:function(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash},copy:function(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash},toString:function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}};var h=function(e,t,n,r,i,a){this.uchar=e||" ",this.penState=new f(t,n,r,i,a)};h.prototype={reset:function(){this.uchar=" ",this.penState.reset()},setChar:function(e,t){this.uchar=e,this.penState.copy(t)},setPenState:function(e){this.penState.copy(e)},equals:function(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)},copy:function(e){this.uchar=e.uchar,this.penState.copy(e.penState)},isEmpty:function(){return" "===this.uchar&&this.penState.isDefault()}};var p=function(){this.chars=[];for(var e=0;e<i;e++)this.chars.push(new h);this.pos=0,this.currPenState=new f};p.prototype={equals:function(e){for(var t=!0,n=0;n<i;n++)if(!this.chars[n].equals(e.chars[n])){t=!1;break}return t},copy:function(e){for(var t=0;t<i;t++)this.chars[t].copy(e.chars[t])},isEmpty:function(){for(var e=!0,t=0;t<i;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e},setCursor:function(e){this.pos!==e&&(this.pos=e),this.pos<0?(c.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>i&&(c.log("ERROR","Too large cursor position "+this.pos),this.pos=i)},moveCursor:function(e){var t=this.pos+e;if(e>1)for(var n=this.pos+1;n<t+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(t)},backSpace:function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},insertChar:function(e){e>=144&&this.backSpace();var t=n(e);this.pos>=i?c.log("ERROR","Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))},clearFromPos:function(e){var t;for(t=e;t<i;t++)this.chars[t].reset()},clear:function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},clearToEndOfRow:function(){this.clearFromPos(this.pos)},getTextString:function(){for(var e=[],t=!0,n=0;n<i;n++){var r=this.chars[n].uchar;" "!==r&&(t=!1),e.push(r)}return t?"":e.join("")},setPenStyles:function(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}};var g=function(){this.rows=[];for(var e=0;e<r;e++)this.rows.push(new p);this.currRow=14,this.nrRollUpRows=null,this.reset()};g.prototype={reset:function(){for(var e=0;e<r;e++)this.rows[e].clear();this.currRow=14},equals:function(e){for(var t=!0,n=0;n<r;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t},copy:function(e){for(var t=0;t<r;t++)this.rows[t].copy(e.rows[t])},isEmpty:function(){for(var e=!0,t=0;t<r;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e},backSpace:function(){this.rows[this.currRow].backSpace()},clearToEndOfRow:function(){this.rows[this.currRow].clearToEndOfRow()},insertChar:function(e){this.rows[this.currRow].insertChar(e)},setPen:function(e){this.rows[this.currRow].setPenStyles(e)},moveCursor:function(e){this.rows[this.currRow].moveCursor(e)},setCursor:function(e){c.log("INFO","setCursor: "+e),this.rows[this.currRow].setCursor(e)},setPAC:function(e){c.log("INFO","pacData = "+JSON.stringify(e));var t=e.row-1;this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.currRow=t;var n=this.rows[this.currRow];if(null!==e.indent){var r=e.indent,i=Math.max(r-1,0);n.setCursor(e.indent),e.color=n.chars[i].penState.foreground}var a={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(a)},setBkgData:function(e){c.log("INFO","bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)},setRollUpRows:function(e){this.nrRollUpRows=e},rollUp:function(){if(null!==this.nrRollUpRows){c.log("TEXT",this.getDisplayText());var e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),c.log("INFO","Rolling up")}else c.log("DEBUG","roll_up but nrRollUpRows not set yet")},getDisplayText:function(e){e=e||!1;for(var t=[],n="",i=-1,a=0;a<r;a++){var s=this.rows[a].getTextString();s&&(i=a+1,e?t.push("Row "+i+': "'+s+'"'):t.push(s.trim()))}return t.length>0&&(n=e?"["+t.join(" | ")+"]":t.join("\n")),n},getTextAndFormat:function(){return this.rows}};var m=function(e,t){this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new g,this.nonDisplayedMemory=new g,this.lastOutputScreen=new g,this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null};m.prototype={modes:["MODE_ROLL-UP","MODE_POP-ON","MODE_PAINT-ON","MODE_TEXT"],reset:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null},getHandler:function(){return this.outputFilter},setHandler:function(e){this.outputFilter=e},setPAC:function(e){this.writeScreen.setPAC(e)},setBkgData:function(e){this.writeScreen.setBkgData(e)},setMode:function(e){e!==this.mode&&(this.mode=e,c.log("INFO","MODE="+e),"MODE_POP-ON"==this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)},insertChars:function(e){for(var t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);var n=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";c.log("INFO",n+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(c.log("TEXT","DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},cc_RCL:function(){c.log("INFO","RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},cc_BS:function(){c.log("INFO","BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},cc_AOF:function(){},cc_AON:function(){},cc_DER:function(){c.log("INFO","DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},cc_RU:function(e){c.log("INFO","RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)},cc_FON:function(){c.log("INFO","FON - Flash On"),this.writeScreen.setPen({flash:!0})},cc_RDC:function(){c.log("INFO","RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},cc_TR:function(){c.log("INFO","TR"),this.setMode("MODE_TEXT")},cc_RTD:function(){c.log("INFO","RTD"),this.setMode("MODE_TEXT")},cc_EDM:function(){c.log("INFO","EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate()},cc_CR:function(){c.log("CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate()},cc_ENM:function(){c.log("INFO","ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},cc_EOC:function(){if(c.log("INFO","EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,c.log("TEXT","DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate()},cc_TO:function(e){c.log("INFO","TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)},cc_MIDROW:function(e){var t={flash:!1};if(t.underline=e%2==1,t.italics=e>=46,t.italics)t.foreground="white";else{var n=Math.floor(e/2)-16;t.foreground=["white","green","blue","cyan","red","yellow","magenta"][n]}c.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},outputDataUpdate:function(){var e=c.time;null!==e&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(e,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},cueSplitAtTime:function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}};var y=function(e,t,n){this.field=e||1,this.outputs=[t,n],this.channels=[new m(1,t),new m(2,n)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}};y.prototype={getHandler:function(e){return this.channels[e].getHandler()},setHandler:function(e,t){this.channels[e].setHandler(t)},addData:function(e,t){var n,r,i,a=!1;this.lastTime=e,c.setTime(e);for(var s=0;s<t.length;s+=2)r=127&t[s],i=127&t[s+1],r>=16&&r<=31&&r===this.lastCmdA&&i===this.lastCmdB?(this.lastCmdA=null,this.lastCmdB=null,c.log("DEBUG","Repeated command ("+d([r,i])+") is dropped")):0!==r||0!==i?(c.log("DATA","["+d([t[s],t[s+1]])+"] -> ("+d([r,i])+")"),(n=this.parseCmd(r,i))||(n=this.parseMidrow(r,i)),n||(n=this.parsePAC(r,i)),n||(n=this.parseBackgroundAttributes(r,i)),n||(a=this.parseChars(r,i))&&(this.currChNr&&this.currChNr>=0?this.channels[this.currChNr-1].insertChars(a):c.log("WARNING","No channel found yet. TEXT-MODE?")),n?this.dataCounters.cmd+=2:a?this.dataCounters.char+=2:(this.dataCounters.other+=2,c.log("WARNING","Couldn't parse cleaned data "+d([r,i])+" orig: "+d([t[s],t[s+1]])))):this.dataCounters.padding+=2},parseCmd:function(e,t){var n=null;if(!((20===e||21===e||28===e||29===e)&&32<=t&&t<=47||(23===e||31===e)&&33<=t&&t<=35))return!1;n=20===e||21===e||23===e?1:2;var r=this.channels[n-1];return 20===e||21===e||28===e||29===e?32===t?r.cc_RCL():33===t?r.cc_BS():34===t?r.cc_AOF():35===t?r.cc_AON():36===t?r.cc_DER():37===t?r.cc_RU(2):38===t?r.cc_RU(3):39===t?r.cc_RU(4):40===t?r.cc_FON():41===t?r.cc_RDC():42===t?r.cc_TR():43===t?r.cc_RTD():44===t?r.cc_EDM():45===t?r.cc_CR():46===t?r.cc_ENM():47===t&&r.cc_EOC():r.cc_TO(t-32),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},parseMidrow:function(e,t){var n=null;if((17===e||25===e)&&32<=t&&t<=47){if((n=17===e?1:2)!==this.currChNr)return c.log("ERROR","Mismatch channel in midrow parsing"),!1;var r=this.channels[n-1];return r.insertChars([32]),r.cc_MIDROW(t),c.log("DEBUG","MIDROW ("+d([e,t])+")"),this.lastCmdA=e,this.lastCmdB=t,!0}return!1},parsePAC:function(e,t){var n,r=null;if(!((17<=e&&e<=23||25<=e&&e<=31)&&64<=t&&t<=127||(16===e||24===e)&&64<=t&&t<=95))return!1;n=e<=23?1:2,r=64<=t&&t<=95?1===n?a[e]:o[e]:1===n?s[e]:u[e];var i=this.interpretPAC(r,t);return this.channels[n-1].setPAC(i),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},interpretPAC:function(e,t){var n=t,r={color:null,italics:!1,indent:null,underline:!1,row:e};return n=t>95?t-96:t-64,r.underline=1==(1&n),n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((n-16)/2),r},parseChars:function(e,t){var r=null,i=null,a=null;if(e>=25?(r=2,a=e-8):(r=1,a=e),17<=a&&a<=19){var s=t;s=17===a?t+80:18===a?t+112:t+144,c.log("INFO","Special char '"+n(s)+"' in channel "+r),i=[s],this.lastCmdA=e,this.lastCmdB=t}else 32<=e&&e<=127&&(i=0===t?[e]:[e,t],this.lastCmdA=null,this.lastCmdB=null);if(i){var o=d(i);c.log("DEBUG","Char codes = "+o.join(","))}return i},parseBackgroundAttributes:function(e,t){var n,r,i;return((16===e||24===e)&&32<=t&&t<=47||(23===e||31===e)&&45<=t&&t<=47)&&(n={},16===e||24===e?(r=Math.floor((t-32)/2),n.background=l[r],t%2==1&&(n.background=n.background+"_semi")):45===t?n.background="transparent":(n.foreground="black",47===t&&(n.underline=!0)),i=e<24?1:2,this.channels[i-1].setBkgData(n),this.lastCmdA=e,this.lastCmdB=t,!0)},reset:function(){for(var e=0;e<this.channels.length;e++)this.channels[e]&&this.channels[e].reset();this.lastCmdA=null,this.lastCmdB=null},cueSplitAtTime:function(e){for(var t=0;t<this.channels.length;t++)this.channels[t]&&this.channels[t].cueSplitAtTime(e)}},e.logger=c,e.PenState=f,e.CaptionScreen=g,e.Cea608Parser=y,e.findCea608Nalus=function(e,t,n){for(var r=0,i=t,a=[],s=function(e,t,n,r){if(4!==e||t<8)return null;var i=n.getUint8(r),a=n.getUint16(r+1),s=n.getUint32(r+3),o=n.getUint8(r+7);return 181==i&&49==a&&1195456820==s&&3==o};i<t+n;){if(r=e.getUint32(i),6==(31&e.getUint8(i+4)))for(var o=i+5,u=-1;o<i+4+r-1;){u=0;for(var l=255;255===l;)u+=l=e.getUint8(o),o++;var c=0;for(l=255;255===l;)c+=l=e.getUint8(o),o++;s(u,c,e,o)&&a.push([o,c]),o+=c}i+=r+4}return a},e.extractCea608DataFromRange=function(e,t){var n=t[0],r=[[],[]];n+=8;var i=31&e.getUint8(n);n+=2;for(var a=0;a<i;a++){var s=e.getUint8(n),o=4&s,u=3&s;n++;var l=e.getUint8(n);n++;var c=e.getUint8(n);n++,o&&(127&l)+(127&c)!=0&&(0===u?(r[0].push(l),r[0].push(c)):1===u&&(r[1].push(l),r[1].push(c)))}return r}}(t)},"./externals/xml2json.js":function(e,t,n){n.r(t),t.default=function(e){void 0===(e=e||{}).escapeMode&&(e.escapeMode=!0),void 0===e.attributePrefix&&(e.attributePrefix="_"),e.arrayAccessForm=e.arrayAccessForm||"none",e.emptyNodeForm=e.emptyNodeForm||"text",void 0===e.enableToStringFunc&&(e.enableToStringFunc=!0),e.arrayAccessFormPaths=e.arrayAccessFormPaths||[],void 0===e.skipEmptyTextNodesForObj&&(e.skipEmptyTextNodesForObj=!0),void 0===e.stripWhitespaces&&(e.stripWhitespaces=!0),e.datetimeAccessFormPaths=e.datetimeAccessFormPaths||[],void 0===e.useDoubleQuotes&&(e.useDoubleQuotes=!1),e.xmlElementsFilter=e.xmlElementsFilter||[],e.jsonPropertiesFilter=e.jsonPropertiesFilter||[],void 0===e.keepCData&&(e.keepCData=!1),void 0===e.ignoreRoot&&(e.ignoreRoot=!1);var t={ELEMENT_NODE:1,TEXT_NODE:3,CDATA_SECTION_NODE:4,COMMENT_NODE:8,DOCUMENT_NODE:9};function n(e){var t=e.localName;return null==t&&(t=e.baseName),null!=t&&""!=t||(t=e.nodeName),t}function r(e){return"string"==typeof e?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):e}function i(e,t,n,r){for(var i=0;i<e.length;i++){var a=e[i];if("string"==typeof a){if(a==r)break}else if(a instanceof RegExp){if(a.test(r))break}else if("function"==typeof a&&a(t,n,r))break}return i!=e.length}function a(t,n,r){"property"===e.arrayAccessForm&&(t[n]instanceof Array?t[n+"_asArray"]=t[n]:t[n+"_asArray"]=[t[n]]),!(t[n]instanceof Array)&&e.arrayAccessFormPaths.length>0&&i(e.arrayAccessFormPaths,t,n,r)&&(t[n]=[t[n]])}function s(e){var t=e.split(/[-T:+Z]/g),n=new Date(t[0],t[1]-1,t[2]),r=t[5].split(".");if(n.setHours(t[3],t[4],r[0]),r.length>1&&n.setMilliseconds(r[1]),t[6]&&t[7]){var i=60*t[6]+Number(t[7]);i=0+("-"==(/\d\d-\d\d:\d\d$/.test(e)?"-":"+")?-1*i:i),n.setMinutes(n.getMinutes()-i-n.getTimezoneOffset())}else-1!==e.indexOf("Z",e.length-1)&&(n=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())));return n}function o(n,r,a,s){return!(r==t.ELEMENT_NODE&&e.xmlElementsFilter.length>0)||i(e.xmlElementsFilter,n,a,s)}function u(r,l){if(r.nodeType==t.DOCUMENT_NODE){for(var c=new Object,d=r.childNodes,f=0;f<d.length;f++)(p=d[f]).nodeType==t.ELEMENT_NODE&&(e.ignoreRoot?c=u(p):(c={})[g=n(p)]=u(p));return c}if(r.nodeType==t.ELEMENT_NODE){(c=new Object).__cnt=0;var h=[];for(d=r.childNodes,f=0;f<d.length;f++){var p,g=n(p=d[f]);if(p.nodeType!=t.COMMENT_NODE){var m=l+"."+g;if(o(c,p.nodeType,g,m))if(c.__cnt++,null==c[g]){var y=u(p,m);("#text"!=g||/[^\s]/.test(y))&&((v={})[g]=y,h.push(v)),c[g]=y,a(c,g,m)}else{var v;null!=c[g]&&(c[g]instanceof Array||(c[g]=[c[g]],a(c,g,m))),y=u(p,m),("#text"!=g||/[^\s]/.test(y))&&((v={})[g]=y,h.push(v)),c[g][c[g].length]=y}}}c.__children=h;for(var _=n(r),T=0;T<r.attributes.length;T++){var b=r.attributes[T];c.__cnt++;for(var E=b.value,S=0,w=e.matchers.length;S<w;S++){var A=e.matchers[S];A.test(b,_)&&(E=A.converter(b.value))}c[e.attributePrefix+b.name]=E}var I=function(e){return e.prefix}(r);return null!=I&&""!=I&&(c.__cnt++,c.__prefix=I),null!=c["#text"]&&(c.__text=c["#text"],c.__text instanceof Array&&(c.__text=c.__text.join("\n")),e.stripWhitespaces&&(c.__text=c.__text.trim()),delete c["#text"],"property"==e.arrayAccessForm&&delete c["#text_asArray"],c.__text=function(t,n,r){if(e.datetimeAccessFormPaths.length>0){var a=r.split(".#")[0];return i(e.datetimeAccessFormPaths,t,n,a)?s(t):t}return t}(c.__text,g,l+"."+g)),null!=c["#cdata-section"]&&(c.__cdata=c["#cdata-section"],delete c["#cdata-section"],"property"==e.arrayAccessForm&&delete c["#cdata-section_asArray"]),0==c.__cnt&&"text"==e.emptyNodeForm?c="":1==c.__cnt&&null!=c.__text?c=c.__text:1!=c.__cnt||null==c.__cdata||e.keepCData?c.__cnt>1&&null!=c.__text&&e.skipEmptyTextNodesForObj&&(e.stripWhitespaces&&""==c.__text||""==c.__text.trim())&&delete c.__text:c=c.__cdata,delete c.__cnt,!e.enableToStringFunc||null==c.__text&&null==c.__cdata||(c.toString=function(){return(null!=this.__text?this.__text:"")+(null!=this.__cdata?this.__cdata:"")}),c}if(r.nodeType==t.TEXT_NODE||r.nodeType==t.CDATA_SECTION_NODE)return r.nodeValue}function l(t,n,i,a){var s="<"+(null!=t&&null!=t.__prefix?t.__prefix+":":"")+n;if(null!=i)for(var o=0;o<i.length;o++){var u=i[o],l=t[u];e.escapeMode&&(l=r(l)),s+=" "+u.substr(e.attributePrefix.length)+"=",e.useDoubleQuotes?s+='"'+l+'"':s+="'"+l+"'"}return s+(a?"/>":">")}function c(e,t){return"</"+(null!=e.__prefix?e.__prefix+":":"")+t+">"}function d(t,n){return"property"==e.arrayAccessForm&&(i="_asArray",-1!==(r=n.toString()).indexOf(i,r.length-i.length))||0==n.toString().indexOf(e.attributePrefix)||0==n.toString().indexOf("__")||t[n]instanceof Function;var r,i}function f(e){var t=0;if(e instanceof Object)for(var n in e)d(e,n)||t++;return t}function h(t,n,r){return 0==e.jsonPropertiesFilter.length||""==r||i(e.jsonPropertiesFilter,t,n,r)}function p(t){var n=[];if(t instanceof Object)for(var r in t)-1==r.toString().indexOf("__")&&0==r.toString().indexOf(e.attributePrefix)&&n.push(r);return n}function g(t){var n="";return t instanceof Object?n+=function(t){var n="";return null!=t.__cdata&&(n+="<![CDATA["+t.__cdata+"]]>"),null!=t.__text&&(e.escapeMode?n+=r(t.__text):n+=t.__text),n}(t):null!=t&&(e.escapeMode?n+=r(t):n+=t),n}function m(e,t){return""===e?t:e+"."+t}function y(e,t,n,r){var i="";if(0==e.length)i+=l(e,t,n,!0);else for(var a=0;a<e.length;a++)i+=l(e[a],t,p(e[a]),!1),i+=v(e[a],m(r,t)),i+=c(e[a],t);return i}function v(e,t){var n="";if(f(e)>0)for(var r in e)if(!d(e,r)&&(""==t||h(e,r,m(t,r)))){var i=e[r],a=p(i);null==i||null==i?n+=l(i,r,a,!0):i instanceof Object?i instanceof Array?n+=y(i,r,a,t):i instanceof Date?(n+=l(i,r,a,!1),n+=i.toISOString(),n+=c(i,r)):f(i)>0||null!=i.__text||null!=i.__cdata?(n+=l(i,r,a,!1),n+=v(i,m(t,r)),n+=c(i,r)):n+=l(i,r,a,!0):(n+=l(i,r,a,!1),n+=g(i),n+=c(i,r))}return n+g(e)}this.parseXmlString=function(e){var t;if(window.ActiveXObject||window,void 0===e)return null;if(window.DOMParser){var n=new window.DOMParser;try{(t=n.parseFromString(e,"text/xml")).getElementsByTagNameNS("*","parsererror").length>0&&(t=null)}catch(e){t=null}}else 0==e.indexOf("<?")&&(e=e.substr(e.indexOf("?>")+2)),(t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e);return t},this.asArray=function(e){return void 0===e||null==e?[]:e instanceof Array?e:[e]},this.toXmlDateTime=function(e){return e instanceof Date?e.toISOString():"number"==typeof e?new Date(e).toISOString():null},this.asDateTime=function(e){return"string"==typeof e?s(e):e},this.xml2json=function(e){return u(e)},this.xml_str2json=function(e){var t=this.parseXmlString(e);return null!=t?this.xml2json(t):null},this.json2xml_str=function(e){return v(e,"")},this.json2xml=function(e){var t=this.json2xml_str(e);return this.parseXmlString(t)},this.getVersion=function(){return"1.2.0"}}},"./index.js":function(e,t,n){n.r(t);var r=n("./index_mediaplayerOnly.js");n.d(t,"MediaPlayer",(function(){return r.MediaPlayer}));var i=n("./src/streaming/utils/Capabilities.js");n.d(t,"supportsMediaSource",(function(){return i.supportsMediaSource}));var a=n("./src/streaming/metrics/MetricsReporting.js");n.d(t,"MetricsReporting",(function(){return a.default}));var s=n("./src/streaming/protection/Protection.js");n.d(t,"Protection",(function(){return s.default}));var o=n("./src/streaming/MediaPlayerFactory.js");n.d(t,"MediaPlayerFactory",(function(){return o.default}));var u=n("./src/core/Debug.js");n.d(t,"Debug",(function(){return u.default})),dashjs.Protection=s.default,dashjs.MetricsReporting=a.default,dashjs.MediaPlayerFactory=o.default,dashjs.Debug=u.default,dashjs.supportsMediaSource=i.supportsMediaSource,t.default=dashjs},"./index_mediaplayerOnly.js":function(e,t,n){n.r(t),function(e){var r=n("./src/streaming/MediaPlayer.js");n.d(t,"MediaPlayer",(function(){return r.default}));var i=n("./src/core/FactoryMaker.js");n.d(t,"FactoryMaker",(function(){return i.default}));var a=n("./src/core/Debug.js");n.d(t,"Debug",(function(){return a.default}));var s=n("./src/core/Version.js"),o=(n("./node_modules/es6-promise/auto.js"),"undefined"!=typeof window&&window||e),u=o.dashjs;u||(u=o.dashjs={}),u.MediaPlayer=r.default,u.FactoryMaker=i.default,u.Debug=a.default,u.Version=Object(s.getVersionString)(),t.default=u}.call(this,n("./node_modules/webpack/buildin/global.js"))},"./node_modules/base64-js/index.js":function(e,t,n){t.byteLength=function(e){var t=u(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){for(var t,n=u(e),r=n[0],s=n[1],o=new a(function(e,t,n){return 3*(t+n)/4-n}(0,r,s)),l=0,c=s>0?r-4:r,d=0;d<c;d+=4)t=i[e.charCodeAt(d)]<<18|i[e.charCodeAt(d+1)]<<12|i[e.charCodeAt(d+2)]<<6|i[e.charCodeAt(d+3)],o[l++]=t>>16&255,o[l++]=t>>8&255,o[l++]=255&t;return 2===s&&(t=i[e.charCodeAt(d)]<<2|i[e.charCodeAt(d+1)]>>4,o[l++]=255&t),1===s&&(t=i[e.charCodeAt(d)]<<10|i[e.charCodeAt(d+1)]<<4|i[e.charCodeAt(d+2)]>>2,o[l++]=t>>8&255,o[l++]=255&t),o},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],s=16383,o=0,u=n-i;o<u;o+=s)a.push(l(e,o,o+s>u?u:o+s));return 1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};for(var r=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=s[o],i[s.charCodeAt(o)]=o;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var i,a,s=[],o=t;o<n;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),s.push(r[(a=i)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},"./node_modules/codem-isoboxer/dist/iso_boxer.js":function(e,t,n){var r={parseBuffer:function(e){return new i(e).parse()},addBoxProcessor:function(e,t){"string"==typeof e&&"function"==typeof t&&(a.prototype._boxProcessors[e]=t)},createFile:function(){return new i},createBox:function(e,t,n){var r=a.create(e);return t&&t.append(r,n),r},createFullBox:function(e,t,n){var i=r.createBox(e,t,n);return i.version=0,i.flags=0,i},Utils:{}};r.Utils.dataViewToString=function(e,t){var n=t||"utf-8";if("undefined"!=typeof TextDecoder)return new TextDecoder(n).decode(e);var r=[],i=0;if("utf-8"===n)for(;i<e.byteLength;){var a=e.getUint8(i++);a<128||(a<224?(a=(31&a)<<6,a|=63&e.getUint8(i++)):a<240?(a=(15&a)<<12,a|=(63&e.getUint8(i++))<<6,a|=63&e.getUint8(i++)):(a=(7&a)<<18,a|=(63&e.getUint8(i++))<<12,a|=(63&e.getUint8(i++))<<6,a|=63&e.getUint8(i++))),r.push(String.fromCharCode(a))}else for(;i<e.byteLength;)r.push(String.fromCharCode(e.getUint8(i++)));return r.join("")},r.Utils.utf8ToByteArray=function(e){var t,n;if("undefined"!=typeof TextEncoder)t=(new TextEncoder).encode(e);else for(t=[],n=0;n<e.length;++n){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?(t.push(192|r>>6),t.push(128|63&r)):r<65536?(t.push(224|r>>12),t.push(128|63&r>>6),t.push(128|63&r)):(t.push(240|r>>18),t.push(128|63&r>>12),t.push(128|63&r>>6),t.push(128|63&r))}return t},r.Utils.appendBox=function(e,t,n){if(t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,-1!==n)if(null!=n){var r,i=-1;if("number"==typeof n)i=n;else{if("string"==typeof n)r=n;else{if("object"!=typeof n||!n.type)return void e.boxes.push(t);r=n.type}for(var a=0;a<e.boxes.length;a++)if(r===e.boxes[a].type){i=a+1;break}}e.boxes.splice(i,0,t)}else e.boxes.push(t)},t.parseBuffer=r.parseBuffer,t.addBoxProcessor=r.addBoxProcessor,t.createFile=r.createFile,t.createBox=r.createBox,t.createFullBox=r.createFullBox,t.Utils=r.Utils,r.Cursor=function(e){this.offset=void 0===e?0:e};var i=function(e){this._cursor=new r.Cursor,this.boxes=[],e&&(this._raw=new DataView(e))};i.prototype.fetch=function(e){var t=this.fetchAll(e,!0);return t.length?t[0]:null},i.prototype.fetchAll=function(e,t){var n=[];return i._sweep.call(this,e,n,t),n},i.prototype.parse=function(){for(this._cursor.offset=0,this.boxes=[];this._cursor.offset<this._raw.byteLength;){var e=a.parse(this);if(void 0===e.type)break;this.boxes.push(e)}return this},i._sweep=function(e,t,n){for(var r in this.type&&this.type==e&&t.push(this),this.boxes){if(t.length&&n)return;i._sweep.call(this.boxes[r],e,t,n)}},i.prototype.write=function(){var e,t=0;for(e=0;e<this.boxes.length;e++)t+=this.boxes[e].getLength(!1);var n=new Uint8Array(t);for(this._rawo=new DataView(n.buffer),this.bytes=n,this._cursor.offset=0,e=0;e<this.boxes.length;e++)this.boxes[e].write();return n.buffer},i.prototype.append=function(e,t){r.Utils.appendBox(this,e,t)};var a=function(){this._cursor=new r.Cursor};a.parse=function(e){var t=new a;return t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,t._parseBox(),e._cursor.offset=t._raw.byteOffset+t._raw.byteLength,t},a.create=function(e){var t=new a;return t.type=e,t.boxes=[],t},a.prototype._boxContainers=["dinf","edts","mdia","meco","mfra","minf","moof","moov","mvex","stbl","strk","traf","trak","tref","udta","vttc","sinf","schi","encv","enca"],a.prototype._boxProcessors={},a.prototype._procField=function(e,t,n){this._parsing?this[e]=this._readField(t,n):this._writeField(t,n,this[e])},a.prototype._procFieldArray=function(e,t,n,r){var i;if(this._parsing)for(this[e]=[],i=0;i<t;i++)this[e][i]=this._readField(n,r);else for(i=0;i<this[e].length;i++)this._writeField(n,r,this[e][i])},a.prototype._procFullBox=function(){this._procField("version","uint",8),this._procField("flags","uint",24)},a.prototype._procEntries=function(e,t,n){var r;if(this._parsing)for(this[e]=[],r=0;r<t;r++)this[e].push({}),n.call(this,this[e][r]);else for(r=0;r<t;r++)n.call(this,this[e][r])},a.prototype._procSubEntries=function(e,t,n,r){var i;if(this._parsing)for(e[t]=[],i=0;i<n;i++)e[t].push({}),r.call(this,e[t][i]);else for(i=0;i<n;i++)r.call(this,e[t][i])},a.prototype._procEntryField=function(e,t,n,r){this._parsing?e[t]=this._readField(n,r):this._writeField(n,r,e[t])},a.prototype._procSubBoxes=function(e,t){var n;if(this._parsing)for(this[e]=[],n=0;n<t;n++)this[e].push(a.parse(this));else for(n=0;n<t;n++)this._rawo?this[e][n].write():this.size+=this[e][n].getLength()},a.prototype._readField=function(e,t){switch(e){case"uint":return this._readUint(t);case"int":return this._readInt(t);case"template":return this._readTemplate(t);case"string":return-1===t?this._readTerminatedString():this._readString(t);case"data":return this._readData(t);case"utf8":return this._readUTF8String();default:return-1}},a.prototype._readInt=function(e){var t=null,n=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:t=this._raw.getInt8(n);break;case 16:t=this._raw.getInt16(n);break;case 32:t=this._raw.getInt32(n);break;case 64:var r=this._raw.getInt32(n),i=this._raw.getInt32(n+4);t=r*Math.pow(2,32)+i}return this._cursor.offset+=e>>3,t},a.prototype._readUint=function(e){var t,n,r=null,i=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:r=this._raw.getUint8(i);break;case 16:r=this._raw.getUint16(i);break;case 24:r=((t=this._raw.getUint16(i))<<8)+(n=this._raw.getUint8(i+2));break;case 32:r=this._raw.getUint32(i);break;case 64:t=this._raw.getUint32(i),n=this._raw.getUint32(i+4),r=t*Math.pow(2,32)+n}return this._cursor.offset+=e>>3,r},a.prototype._readString=function(e){for(var t="",n=0;n<e;n++){var r=this._readUint(8);t+=String.fromCharCode(r)}return t},a.prototype._readTemplate=function(e){return this._readUint(e/2)+this._readUint(e/2)/Math.pow(2,e/2)},a.prototype._readTerminatedString=function(){for(var e="";this._cursor.offset-this._offset<this._raw.byteLength;){var t=this._readUint(8);if(0===t)break;e+=String.fromCharCode(t)}return e},a.prototype._readData=function(e){var t=e>0?e:this._raw.byteLength-(this._cursor.offset-this._offset);if(t>0){var n=new Uint8Array(this._raw.buffer,this._cursor.offset,t);return this._cursor.offset+=t,n}return null},a.prototype._readUTF8String=function(){var e=this._raw.byteLength-(this._cursor.offset-this._offset),t=null;return e>0&&(t=new DataView(this._raw.buffer,this._cursor.offset,e),this._cursor.offset+=e),t?r.Utils.dataViewToString(t):t},a.prototype._parseBox=function(){if(this._parsing=!0,this._cursor.offset=this._offset,this._offset+8>this._raw.buffer.byteLength)this._root._incomplete=!0;else{switch(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset,this._raw.byteLength-this._cursor.offset+8);break;case 1:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.largesize);break;default:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.size)}this._incomplete||(this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type)?this._parseContainerBox():this._data=this._readData())}},a.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},a.prototype._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(a.parse(this))},a.prototype.append=function(e,t){r.Utils.appendBox(this,e,t)},a.prototype.getLength=function(){if(this._parsing=!1,this._rawo=null,this.size=0,this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type))for(var e=0;e<this.boxes.length;e++)this.size+=this.boxes[e].getLength();return this._data&&this._writeData(this._data),this.size},a.prototype.write=function(){switch(this._parsing=!1,this._cursor.offset=this._parent._cursor.offset,this.size){case 0:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.parent._rawo.byteLength-this._cursor.offset);break;case 1:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.largesize);break;default:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.size)}if(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type))for(var e=0;e<this.boxes.length;e++)this.boxes[e].write();return this._data&&this._writeData(this._data),this._parent._cursor.offset+=this.size,this.size},a.prototype._writeInt=function(e,t){if(this._rawo){var n=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setInt8(n,t);break;case 16:this._rawo.setInt16(n,t);break;case 32:this._rawo.setInt32(n,t);break;case 64:var r=Math.floor(t/Math.pow(2,32)),i=t-r*Math.pow(2,32);this._rawo.setUint32(n,r),this._rawo.setUint32(n+4,i)}this._cursor.offset+=e>>3}else this.size+=e>>3},a.prototype._writeUint=function(e,t){if(this._rawo){var n,r,i=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setUint8(i,t);break;case 16:this._rawo.setUint16(i,t);break;case 24:n=(16776960&t)>>8,r=255&t,this._rawo.setUint16(i,n),this._rawo.setUint8(i+2,r);break;case 32:this._rawo.setUint32(i,t);break;case 64:r=t-(n=Math.floor(t/Math.pow(2,32)))*Math.pow(2,32),this._rawo.setUint32(i,n),this._rawo.setUint32(i+4,r)}this._cursor.offset+=e>>3}else this.size+=e>>3},a.prototype._writeString=function(e,t){for(var n=0;n<e;n++)this._writeUint(8,t.charCodeAt(n))},a.prototype._writeTerminatedString=function(e){if(0!==e.length){for(var t=0;t<e.length;t++)this._writeUint(8,e.charCodeAt(t));this._writeUint(8,0)}},a.prototype._writeTemplate=function(e,t){var n=Math.floor(t),r=(t-n)*Math.pow(2,e/2);this._writeUint(e/2,n),this._writeUint(e/2,r)},a.prototype._writeData=function(e){if(e)if(this._rawo){if(e instanceof Array){for(var t=this._cursor.offset-this._rawo.byteOffset,n=0;n<e.length;n++)this._rawo.setInt8(t+n,e[n]);this._cursor.offset+=e.length}e instanceof Uint8Array&&(this._root.bytes.set(e,this._cursor.offset),this._cursor.offset+=e.length)}else this.size+=e.length},a.prototype._writeUTF8String=function(e){var t=r.Utils.utf8ToByteArray(e);if(this._rawo)for(var n=new DataView(this._rawo.buffer,this._cursor.offset,t.length),i=0;i<t.length;i++)n.setUint8(i,t[i]);else this.size+=t.length},a.prototype._writeField=function(e,t,n){switch(e){case"uint":this._writeUint(t,n);break;case"int":this._writeInt(t,n);break;case"template":this._writeTemplate(t,n);break;case"string":-1==t?this._writeTerminatedString(n):this._writeString(t,n);break;case"data":this._writeData(n);break;case"utf8":this._writeUTF8String(n)}},a.prototype._boxProcessors.avc1=a.prototype._boxProcessors.encv=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procField("pre_defined1","uint",16),this._procField("reserved2","uint",16),this._procFieldArray("pre_defined2",3,"uint",32),this._procField("width","uint",16),this._procField("height","uint",16),this._procField("horizresolution","template",32),this._procField("vertresolution","template",32),this._procField("reserved3","uint",32),this._procField("frame_count","uint",16),this._procFieldArray("compressorname",32,"uint",8),this._procField("depth","uint",16),this._procField("pre_defined3","int",16),this._procField("config","data",-1)},a.prototype._boxProcessors.dref=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},a.prototype._boxProcessors.elst=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"segment_duration","uint",1===this.version?64:32),this._procEntryField(e,"media_time","int",1===this.version?64:32),this._procEntryField(e,"media_rate_integer","int",16),this._procEntryField(e,"media_rate_fraction","int",16)}))},a.prototype._boxProcessors.emsg=function(){this._procFullBox(),1==this.version?(this._procField("timescale","uint",32),this._procField("presentation_time","uint",64),this._procField("event_duration","uint",32),this._procField("id","uint",32),this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1)):(this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1),this._procField("timescale","uint",32),this._procField("presentation_time_delta","uint",32),this._procField("event_duration","uint",32),this._procField("id","uint",32)),this._procField("message_data","data",-1)},a.prototype._boxProcessors.free=a.prototype._boxProcessors.skip=function(){this._procField("data","data",-1)},a.prototype._boxProcessors.frma=function(){this._procField("data_format","uint",32)},a.prototype._boxProcessors.ftyp=a.prototype._boxProcessors.styp=function(){this._procField("major_brand","string",4),this._procField("minor_version","uint",32);var e=-1;this._parsing&&(e=(this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset))/4),this._procFieldArray("compatible_brands",e,"string",4)},a.prototype._boxProcessors.hdlr=function(){this._procFullBox(),this._procField("pre_defined","uint",32),this._procField("handler_type","string",4),this._procFieldArray("reserved",3,"uint",32),this._procField("name","string",-1)},a.prototype._boxProcessors.mdat=function(){this._procField("data","data",-1)},a.prototype._boxProcessors.mdhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._parsing||"string"!=typeof this.language||(this.language=this.language.charCodeAt(0)-96<<10|this.language.charCodeAt(1)-96<<5|this.language.charCodeAt(2)-96),this._procField("language","uint",16),this._parsing&&(this.language=String.fromCharCode(96+(this.language>>10&31),96+(this.language>>5&31),96+(31&this.language))),this._procField("pre_defined","uint",16)},a.prototype._boxProcessors.mehd=function(){this._procFullBox(),this._procField("fragment_duration","uint",1==this.version?64:32)},a.prototype._boxProcessors.mfhd=function(){this._procFullBox(),this._procField("sequence_number","uint",32)},a.prototype._boxProcessors.mfro=function(){this._procFullBox(),this._procField("mfra_size","uint",32)},a.prototype._boxProcessors.mp4a=a.prototype._boxProcessors.enca=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procField("channelcount","uint",16),this._procField("samplesize","uint",16),this._procField("pre_defined","uint",16),this._procField("reserved3","uint",16),this._procField("samplerate","template",32),this._procField("esds","data",-1)},a.prototype._boxProcessors.mvhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procField("rate","template",32),this._procField("volume","template",16),this._procField("reserved1","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procFieldArray("matrix",9,"template",32),this._procFieldArray("pre_defined",6,"uint",32),this._procField("next_track_ID","uint",32)},a.prototype._boxProcessors.payl=function(){this._procField("cue_text","utf8")},a.prototype._boxProcessors.pssh=function(){this._procFullBox(),this._procFieldArray("SystemID",16,"uint",8),this._procField("DataSize","uint",32),this._procFieldArray("Data",this.DataSize,"uint",8)},a.prototype._boxProcessors.schm=function(){this._procFullBox(),this._procField("scheme_type","uint",32),this._procField("scheme_version","uint",32),1&this.flags&&this._procField("scheme_uri","string",-1)},a.prototype._boxProcessors.sdtp=function(){this._procFullBox();var e=-1;this._parsing&&(e=this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset)),this._procFieldArray("sample_dependency_table",e,"uint",8)},a.prototype._boxProcessors.sidx=function(){this._procFullBox(),this._procField("reference_ID","uint",32),this._procField("timescale","uint",32),this._procField("earliest_presentation_time","uint",1==this.version?64:32),this._procField("first_offset","uint",1==this.version?64:32),this._procField("reserved","uint",16),this._procField("reference_count","uint",16),this._procEntries("references",this.reference_count,(function(e){this._parsing||(e.reference=(1&e.reference_type)<<31,e.reference|=2147483647&e.referenced_size,e.sap=(1&e.starts_with_SAP)<<31,e.sap|=(3&e.SAP_type)<<28,e.sap|=268435455&e.SAP_delta_time),this._procEntryField(e,"reference","uint",32),this._procEntryField(e,"subsegment_duration","uint",32),this._procEntryField(e,"sap","uint",32),this._parsing&&(e.reference_type=e.reference>>31&1,e.referenced_size=2147483647&e.reference,e.starts_with_SAP=e.sap>>31&1,e.SAP_type=e.sap>>28&7,e.SAP_delta_time=268435455&e.sap)}))},a.prototype._boxProcessors.smhd=function(){this._procFullBox(),this._procField("balance","uint",16),this._procField("reserved","uint",16)},a.prototype._boxProcessors.ssix=function(){this._procFullBox(),this._procField("subsegment_count","uint",32),this._procEntries("subsegments",this.subsegment_count,(function(e){this._procEntryField(e,"ranges_count","uint",32),this._procSubEntries(e,"ranges",e.ranges_count,(function(e){this._procEntryField(e,"level","uint",8),this._procEntryField(e,"range_size","uint",24)}))}))},a.prototype._boxProcessors.stsd=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},a.prototype._boxProcessors.subs=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"sample_delta","uint",32),this._procEntryField(e,"subsample_count","uint",16),this._procSubEntries(e,"subsamples",e.subsample_count,(function(e){this._procEntryField(e,"subsample_size","uint",1===this.version?32:16),this._procEntryField(e,"subsample_priority","uint",8),this._procEntryField(e,"discardable","uint",8),this._procEntryField(e,"codec_specific_parameters","uint",32)}))}))},a.prototype._boxProcessors.tenc=function(){this._procFullBox(),this._procField("default_IsEncrypted","uint",24),this._procField("default_IV_size","uint",8),this._procFieldArray("default_KID",16,"uint",8)},a.prototype._boxProcessors.tfdt=function(){this._procFullBox(),this._procField("baseMediaDecodeTime","uint",1==this.version?64:32)},a.prototype._boxProcessors.tfhd=function(){this._procFullBox(),this._procField("track_ID","uint",32),1&this.flags&&this._procField("base_data_offset","uint",64),2&this.flags&&this._procField("sample_description_offset","uint",32),8&this.flags&&this._procField("default_sample_duration","uint",32),16&this.flags&&this._procField("default_sample_size","uint",32),32&this.flags&&this._procField("default_sample_flags","uint",32)},a.prototype._boxProcessors.tfra=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._parsing||(this.reserved=0,this.reserved|=(48&this.length_size_of_traf_num)<<4,this.reserved|=(12&this.length_size_of_trun_num)<<2,this.reserved|=3&this.length_size_of_sample_num),this._procField("reserved","uint",32),this._parsing&&(this.length_size_of_traf_num=(48&this.reserved)>>4,this.length_size_of_trun_num=(12&this.reserved)>>2,this.length_size_of_sample_num=3&this.reserved),this._procField("number_of_entry","uint",32),this._procEntries("entries",this.number_of_entry,(function(e){this._procEntryField(e,"time","uint",1===this.version?64:32),this._procEntryField(e,"moof_offset","uint",1===this.version?64:32),this._procEntryField(e,"traf_number","uint",8*(this.length_size_of_traf_num+1)),this._procEntryField(e,"trun_number","uint",8*(this.length_size_of_trun_num+1)),this._procEntryField(e,"sample_number","uint",8*(this.length_size_of_sample_num+1))}))},a.prototype._boxProcessors.tkhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("track_ID","uint",32),this._procField("reserved1","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procFieldArray("reserved2",2,"uint",32),this._procField("layer","uint",16),this._procField("alternate_group","uint",16),this._procField("volume","template",16),this._procField("reserved3","uint",16),this._procFieldArray("matrix",9,"template",32),this._procField("width","template",32),this._procField("height","template",32)},a.prototype._boxProcessors.trex=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._procField("default_sample_description_index","uint",32),this._procField("default_sample_duration","uint",32),this._procField("default_sample_size","uint",32),this._procField("default_sample_flags","uint",32)},a.prototype._boxProcessors.trun=function(){this._procFullBox(),this._procField("sample_count","uint",32),1&this.flags&&this._procField("data_offset","int",32),4&this.flags&&this._procField("first_sample_flags","uint",32),this._procEntries("samples",this.sample_count,(function(e){256&this.flags&&this._procEntryField(e,"sample_duration","uint",32),512&this.flags&&this._procEntryField(e,"sample_size","uint",32),1024&this.flags&&this._procEntryField(e,"sample_flags","uint",32),2048&this.flags&&this._procEntryField(e,"sample_composition_time_offset",1===this.version?"int":"uint",32)}))},a.prototype._boxProcessors["url "]=a.prototype._boxProcessors["urn "]=function(){this._procFullBox(),"urn "===this.type&&this._procField("name","string",-1),this._procField("location","string",-1)},a.prototype._boxProcessors.vlab=function(){this._procField("source_label","utf8")},a.prototype._boxProcessors.vmhd=function(){this._procFullBox(),this._procField("graphicsmode","uint",16),this._procFieldArray("opcolor",3,"uint",16)},a.prototype._boxProcessors.vttC=function(){this._procField("config","utf8")},a.prototype._boxProcessors.vtte=function(){}},"./node_modules/core-util-is/lib/util.js":function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,n("./node_modules/node-libs-browser/node_modules/buffer/index.js").Buffer)},"./node_modules/es6-promise/auto.js":function(e,t,n){e.exports=n("./node_modules/es6-promise/dist/es6-promise.js").polyfill()},"./node_modules/es6-promise/dist/es6-promise.js":function(e,t,n){(function(t,n){!function(t,n){e.exports=n()}(0,(function(){function e(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,a=void 0,s=void 0,o=function(e,t){p[i]=e,p[i+1]=t,2===(i+=2)&&(s?s(g):T())},u="undefined"!=typeof window?window:void 0,l=u||{},c=l.MutationObserver||l.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==t&&"[object process]"==={}.toString.call(t),f="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var e=setTimeout;return function(){return e(g,1)}}var p=new Array(1e3);function g(){for(var e=0;e<i;e+=2)(0,p[e])(p[e+1]),p[e]=void 0,p[e+1]=void 0;i=0}var m,y,v,_,T=void 0;function b(e,t){var n=this,r=new this.constructor(w);void 0===r[S]&&F(r);var i=n._state;if(i){var a=arguments[i-1];o((function(){return k(i,r,a,n._result)}))}else P(n,r,e,t);return r}function E(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(w);return D(t,e),t}d?T=function(){return t.nextTick(g)}:c?(y=0,v=new c(g),_=document.createTextNode(""),v.observe(_,{characterData:!0}),T=function(){_.data=y=++y%2}):f?((m=new MessageChannel).port1.onmessage=g,T=function(){return m.port2.postMessage(0)}):T=void 0===u?function(){try{var e=Function("return this")().require("vertx");return void 0!==(a=e.runOnLoop||e.runOnContext)?function(){a(g)}:h()}catch(e){return h()}}():h();var S=Math.random().toString(36).substring(2);function w(){}var A=void 0,I=1,C=2;function R(t,n,r){n.constructor===t.constructor&&r===b&&n.constructor.resolve===E?function(e,t){t._state===I?N(e,t._result):t._state===C?O(e,t._result):P(t,void 0,(function(t){return D(e,t)}),(function(t){return O(e,t)}))}(t,n):void 0===r?N(t,n):e(r)?function(e,t,n){o((function(e){var r=!1,i=function(e,t,n,r){try{e.call(t,n,r)}catch(e){return e}}(n,t,(function(n){r||(r=!0,t!==n?D(e,n):N(e,n))}),(function(t){r||(r=!0,O(e,t))}),e._label);!r&&i&&(r=!0,O(e,i))}),e)}(t,n,r):N(t,n)}function D(e,t){if(e===t)O(e,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(r=t),null===r||"object"!==i&&"function"!==i)N(e,t);else{var n=void 0;try{n=t.then}catch(t){return void O(e,t)}R(e,t,n)}var r,i}function x(e){e._onerror&&e._onerror(e._result),M(e)}function N(e,t){e._state===A&&(e._result=t,e._state=I,0!==e._subscribers.length&&o(M,e))}function O(e,t){e._state===A&&(e._state=C,e._result=t,o(x,e))}function P(e,t,n,r){var i=e._subscribers,a=i.length;e._onerror=null,i[a]=t,i[a+I]=n,i[a+C]=r,0===a&&e._state&&o(M,e)}function M(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r=void 0,i=void 0,a=e._result,s=0;s<t.length;s+=3)r=t[s],i=t[s+n],r?k(n,r,i,a):i(a);e._subscribers.length=0}}function k(t,n,r,i){var a=e(r),s=void 0,o=void 0,u=!0;if(a){try{s=r(i)}catch(e){u=!1,o=e}if(n===s)return void O(n,new TypeError("A promises callback cannot return that same promise."))}else s=i;n._state!==A||(a&&u?D(n,s):!1===u?O(n,o):t===I?N(n,s):t===C&&O(n,s))}var L=0;function F(e){e[S]=L++,e._state=void 0,e._result=void 0,e._subscribers=[]}var U=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(w),this.promise[S]||F(this.promise),r(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?N(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&N(this.promise,this._result))):O(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var t=0;this._state===A&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,r=n.resolve;if(r===E){var i=void 0,a=void 0,s=!1;try{i=e.then}catch(e){s=!0,a=e}if(i===b&&e._state!==A)this._settledAt(e._state,t,e._result);else if("function"!=typeof i)this._remaining--,this._result[t]=e;else if(n===B){var o=new n(w);s?O(o,a):R(o,e,i),this._willSettleAt(o,t)}else this._willSettleAt(new n((function(t){return t(e)})),t)}else this._willSettleAt(r(e),t)},e.prototype._settledAt=function(e,t,n){var r=this.promise;r._state===A&&(this._remaining--,e===C?O(r,n):this._result[t]=n),0===this._remaining&&N(r,this._result)},e.prototype._willSettleAt=function(e,t){var n=this;P(e,void 0,(function(e){return n._settledAt(I,t,e)}),(function(e){return n._settledAt(C,t,e)}))},e}(),B=function(){function t(e){this[S]=L++,this._result=this._state=void 0,this._subscribers=[],w!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof t?function(e,t){try{t((function(t){D(e,t)}),(function(t){O(e,t)}))}catch(t){O(e,t)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return t.prototype.catch=function(e){return this.then(null,e)},t.prototype.finally=function(t){var n=this,r=n.constructor;return e(t)?n.then((function(e){return r.resolve(t()).then((function(){return e}))}),(function(e){return r.resolve(t()).then((function(){throw e}))})):n.then(t,t)},t}();return B.prototype.then=b,B.all=function(e){return new U(this,e).promise},B.race=function(e){var t=this;return r(e)?new t((function(n,r){for(var i=e.length,a=0;a<i;a++)t.resolve(e[a]).then(n,r)})):new t((function(e,t){return t(new TypeError("You must pass an array to race."))}))},B.resolve=E,B.reject=function(e){var t=new this(w);return O(t,e),t},B._setScheduler=function(e){s=e},B._setAsap=function(e){o=e},B._asap=o,B.polyfill=function(){var e=void 0;if(void 0!==n)e=n;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===r&&!t.cast)return}e.Promise=B},B.Promise=B,B}))}).call(this,n("./node_modules/process/browser.js"),n("./node_modules/webpack/buildin/global.js"))},"./node_modules/fast-deep-equal/index.js":function(e,t,n){var r=Array.isArray,i=Object.keys,a=Object.prototype.hasOwnProperty;e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){var s,o,u,l=r(t),c=r(n);if(l&&c){if((o=t.length)!=n.length)return!1;for(s=o;0!=s--;)if(!e(t[s],n[s]))return!1;return!0}if(l!=c)return!1;var d=t instanceof Date,f=n instanceof Date;if(d!=f)return!1;if(d&&f)return t.getTime()==n.getTime();var h=t instanceof RegExp,p=n instanceof RegExp;if(h!=p)return!1;if(h&&p)return t.toString()==n.toString();var g=i(t);if((o=g.length)!==i(n).length)return!1;for(s=o;0!=s--;)if(!a.call(n,g[s]))return!1;for(s=o;0!=s--;)if(!e(t[u=g[s]],n[u]))return!1;return!0}return t!=t&&n!=n}},"./node_modules/ieee754/index.js":function(e,t){t.read=function(e,t,n,r,i){var a,s,o=8*i-r-1,u=(1<<o)-1,l=u>>1,c=-7,d=n?i-1:0,f=n?-1:1,h=e[t+d];for(d+=f,a=h&(1<<-c)-1,h>>=-c,c+=o;c>0;a=256*a+e[t+d],d+=f,c-=8);for(s=a&(1<<-c)-1,a>>=-c,c+=r;c>0;s=256*s+e[t+d],d+=f,c-=8);if(0===a)a=1-l;else{if(a===u)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,r),a-=l}return(h?-1:1)*s*Math.pow(2,a-r)},t.write=function(e,t,n,r,i,a){var s,o,u,l=8*a-i-1,c=(1<<l)-1,d=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:a-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+d>=1?f/u:f*Math.pow(2,1-d))*u>=2&&(s++,u/=2),s+d>=c?(o=0,s=c):s+d>=1?(o=(t*u-1)*Math.pow(2,i),s+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[n+h]=255&o,h+=p,o/=256,i-=8);for(s=s<<i|o,l+=i;l>0;e[n+h]=255&s,h+=p,s/=256,l-=8);e[n+h-p]|=128*g}},"./node_modules/imsc/src/main/js/doc.js":function(e,t,n){!function(e,t,n,r,i){function a(e,t,n,r){var i=r&&"seq"===r.timeContainer,s=0;r&&(s=i&&n?n.end:r.begin),t.begin=t.explicit_begin?t.explicit_begin+s:s;var o=t.begin,u=null;for(var l in t.sets)a(e,t.sets[l],u,t),o="seq"===t.timeContainer?t.sets[l].end:Math.max(o,t.sets[l].end),u=t.sets[l];if("contents"in t)for(var c in t.contents)a(e,t.contents[c],u,t),o="seq"===t.timeContainer?t.contents[c].end:Math.max(o,t.contents[c].end),u=t.contents[c];else o=i?t.begin:Number.POSITIVE_INFINITY;null!==t.explicit_end&&null!==t.explicit_dur?t.end=Math.min(t.begin+t.explicit_dur,s+t.explicit_end):null===t.explicit_end&&null!==t.explicit_dur?t.end=t.begin+t.explicit_dur:null!==t.explicit_end&&null===t.explicit_dur?t.end=s+t.explicit_end:t.end=o,delete t.explicit_begin,delete t.explicit_dur,delete t.explicit_end,e._registerEvent(t)}function s(e){this.node=e}function o(){this.events=[],this.head=null,this.body=null}function u(){this.styling=null,this.layout=null}function l(){this.styles={}}function c(){this.id=null,this.styleAttrs=null,this.styleRefs=null}function d(){this.regions={}}function f(e){this.kind=e}function h(e){this.id=e}function p(e){this.regionID=e}function g(e){this.styleAttrs=e}function m(e){this.sets=e}function y(e){this.contents=e}function v(e,t,n){this.explicit_begin=e,this.explicit_end=t,this.explicit_dur=n}function _(){f.call(this,"body")}function T(){f.call(this,"div")}function b(){f.call(this,"p")}function E(){f.call(this,"span")}function S(){f.call(this,"span")}function w(){f.call(this,"br")}function A(){}function I(){}function C(e){return e&&"xml:id"in e.attributes&&e.attributes["xml:id"].value||null}function R(e){return e&&"style"in e.attributes?e.attributes.style.value.split(" "):[]}function D(e,t){var n={};if(null!==e)for(var i in e.attributes){var a=e.attributes[i].uri+" "+e.attributes[i].local,s=r.byQName[a];if(void 0!==s){var o=s.parse(e.attributes[i].value);null!==o?(n[a]=o,s===r.byName.zIndex&&k(t,"zIndex attribute present but not used by IMSC1 since regions do not overlap")):L(t,"Cannot parse styling attribute "+a+" --\x3e "+e.attributes[i].value)}}return n}function x(e,t,n){for(var r in e.attributes)if(e.attributes[r].uri===t&&e.attributes[r].local===n)return e.attributes[r].value;return null}function N(e,t,n){var r,i=null;return null!==(r=/^(\d+(?:\.\d+)?)f$/.exec(n))?null!==t&&(i=parseFloat(r[1])/t):null!==(r=/^(\d+(?:\.\d+)?)t$/.exec(n))?null!==e&&(i=parseFloat(r[1])/e):null!==(r=/^(\d+(?:\.\d+)?)ms$/.exec(n))?i=parseFloat(r[1])/1e3:null!==(r=/^(\d+(?:\.\d+)?)s$/.exec(n))?i=parseFloat(r[1]):null!==(r=/^(\d+(?:\.\d+)?)h$/.exec(n))?i=3600*parseFloat(r[1]):null!==(r=/^(\d+(?:\.\d+)?)m$/.exec(n))?i=60*parseFloat(r[1]):null!==(r=/^(\d{2,}):(\d\d):(\d\d(?:\.\d+)?)$/.exec(n))?i=3600*parseInt(r[1])+60*parseInt(r[2])+parseFloat(r[3]):null!==(r=/^(\d{2,}):(\d\d):(\d\d)\:(\d{2,})$/.exec(n))&&null!==t&&(i=3600*parseInt(r[1])+60*parseInt(r[2])+parseInt(r[3])+(null===r[4]?0:parseInt(r[4])/t)),i}function O(e,t,n){for(;t.styleRefs.length>0;){var r=t.styleRefs.pop();r in e.styles?(O(e,e.styles[r],n),M(e.styles[r].styleAttrs,t.styleAttrs)):L(n,"Non-existant style id referenced")}}function P(e,t,n,r){for(var i=t.length-1;i>=0;i--){var a=t[i];a in e.styles?M(e.styles[a].styleAttrs,n):L(r,"Non-existant style id referenced")}}function M(e,t){for(var n in e)n in t||(t[n]=e[n])}function k(e,t){if(e&&e.warn&&e.warn(t))throw t}function L(e,t){if(e&&e.error&&e.error(t))throw t}function F(e,t){throw e&&e.fatal&&e.fatal(t),t}function U(e,t){for(var n,r=0,i=e.length-1;r<=i;){var a=e[n=Math.floor((r+i)/2)];if(a<t)r=n+1;else{if(!(a>t))return{found:!0,index:n};i=n-1}}return{found:!1,index:r}}e.fromXML=function(e,r,i){var f=t.parser(!0,{xmlns:!0}),h=[],p=[],g=[],m=0,y=null;f.onclosetag=function(e){if(h[0]instanceof l)for(var t in h[0].styles)O(h[0],h[0].styles[t],r);else if(h[0]instanceof b||h[0]instanceof E){if(h[0].contents.length>1){var a,o=[h[0].contents[0]];for(a=1;a<h[0].contents.length;a++)h[0].contents[a]instanceof S&&o[o.length-1]instanceof S?o[o.length-1].text+=h[0].contents[a].text:o.push(h[0].contents[a]);h[0].contents=o}h[0]instanceof E&&1===h[0].contents.length&&h[0].contents[0]instanceof S&&(h[0].text=h[0].contents[0].text,delete h[0].contents)}else h[0]instanceof s&&(h[0].node.uri===n.ns_tt&&"metadata"===h[0].node.local?m--:m>0&&i&&"onCloseTag"in i&&i.onCloseTag());g.shift(),p.shift(),h.shift()},f.ontext=function(e){if(void 0===h[0]);else if(h[0]instanceof E||h[0]instanceof b){var t=new S;t.initFromText(y,h[0],e,g[0],r),h[0].contents.push(t)}else h[0]instanceof s&&m>0&&i&&"onText"in i&&i.onText(e)},f.onopentag=function(e){var t=e.attributes["xml:space"];t?g.unshift(t.value):0===g.length?g.unshift("default"):g.unshift(g[0]);var a=e.attributes["xml:lang"];if(a?p.unshift(a.value):0===p.length?p.unshift(""):p.unshift(p[0]),e.uri===n.ns_tt)if("tt"===e.local)null!==y&&F(r,"Two <tt> elements at ("+this.line+","+this.column+")"),(y=new o).initFromNode(e,r),h.unshift(y);else if("head"===e.local)h[0]instanceof o||F(r,"Parent of <head> element is not <tt> at ("+this.line+","+this.column+")"),null!==y.head&&F("Second <head> element at ("+this.line+","+this.column+")"),y.head=new u,h.unshift(y.head);else if("styling"===e.local)h[0]instanceof u||F(r,"Parent of <styling> element is not <head> at ("+this.line+","+this.column+")"),null!==y.head.styling&&F("Second <styling> element at ("+this.line+","+this.column+")"),y.head.styling=new l,h.unshift(y.head.styling);else if("style"===e.local){var f;h[0]instanceof l?((f=new c).initFromNode(e,r),f.id?y.head.styling.styles[f.id]=f:L(r,"<style> element missing @id attribute"),h.unshift(f)):h[0]instanceof A?((f=new c).initFromNode(e,r),M(f.styleAttrs,h[0].styleAttrs),h.unshift(f)):F(r,"Parent of <style> element is not <styling> or <region> at ("+this.line+","+this.column+")")}else if("layout"===e.local)h[0]instanceof u||F(r,"Parent of <layout> element is not <head> at "+this.line+","+this.column+")"),null!==y.head.layout&&F(r,"Second <layout> element at "+this.line+","+this.column+")"),y.head.layout=new d,h.unshift(y.head.layout);else if("region"===e.local){h[0]instanceof d||F(r,"Parent of <region> element is not <layout> at "+this.line+","+this.column+")");var v=new A;v.initFromNode(y,e,r),!v.id||v.id in y.head.layout.regions?L(r,"Ignoring <region> with duplicate or missing @id at "+this.line+","+this.column+")"):y.head.layout.regions[v.id]=v,h.unshift(v)}else if("body"===e.local){h[0]instanceof o||F(r,"Parent of <body> element is not <tt> at "+this.line+","+this.column+")"),null!==y.body&&F(r,"Second <body> element at "+this.line+","+this.column+")");var S=new _;S.initFromNode(y,e,r),y.body=S,h.unshift(S)}else if("div"===e.local){h[0]instanceof T||h[0]instanceof _||F(r,"Parent of <div> element is not <body> or <div> at "+this.line+","+this.column+")");var C=new T;C.initFromNode(y,h[0],e,r),h[0].contents.push(C),h.unshift(C)}else if("p"===e.local){h[0]instanceof T||F(r,"Parent of <p> element is not <div> at "+this.line+","+this.column+")");var R=new b;R.initFromNode(y,h[0],e,r),h[0].contents.push(R),h.unshift(R)}else if("span"===e.local){h[0]instanceof E||h[0]instanceof b||F(r,"Parent of <span> element is not <span> or <p> at "+this.line+","+this.column+")");var D=new E;D.initFromNode(y,h[0],e,g[0],r),h[0].contents.push(D),h.unshift(D)}else if("br"===e.local){h[0]instanceof E||h[0]instanceof b||F(r,"Parent of <br> element is not <span> or <p> at "+this.line+","+this.column+")");var x=new w;x.initFromNode(y,h[0],e,r),h[0].contents.push(x),h.unshift(x)}else if("set"===e.local){h[0]instanceof E||h[0]instanceof b||h[0]instanceof T||h[0]instanceof _||h[0]instanceof A||h[0]instanceof w||F(r,"Parent of <set> element is not a content element or a region at "+this.line+","+this.column+")");var N=new I;N.initFromNode(y,h[0],e,r),h[0].sets.push(N),h.unshift(N)}else h.unshift(new s(e));else h.unshift(new s(e));if(h[0]instanceof s)if(e.uri===n.ns_tt&&"metadata"===e.local)m++;else if(m>0&&i&&"onOpenTag"in i){var O=[];for(var P in e.attributes)O[e.attributes[P].uri+" "+e.attributes[P].local]={uri:e.attributes[P].uri,local:e.attributes[P].local,value:e.attributes[P].value};i.onOpenTag(e.uri,e.local,O)}},f.write(e).close(),null!==y.head?delete y.head.styling:y.head=new u,null===y.head.layout&&(y.head.layout=new d);var v=!1;for(var C in y.head.layout.regions){v=!0;break}if(!v){var R=A.prototype.createDefaultRegion();y.head.layout.regions[R.id]=R}for(var D in y.head.layout.regions)a(y,y.head.layout.regions[D],null,null);return y.body&&a(y,y.body,null,null),y},o.prototype.initFromNode=function(e,t){this.cellResolution=function(e,t){var r=x(e,n.ns_ttp,"cellResolution"),i=15,a=32;if(null!==r){var s=/(\d+) (\d+)/.exec(r);null!==s?(a=parseInt(s[1]),i=parseInt(s[2])):k(t,"Malformed cellResolution value (using initial value instead)")}return{w:a,h:i}}(e,t);var r=function(e,t){var r,i=x(e,n.ns_ttp,"frameRate"),a=30;null!==i&&(null!==(r=/(\d+)/.exec(i))?a=parseInt(r[1]):k(t,"Malformed frame rate attribute (using initial value instead)"));var s=x(e,n.ns_ttp,"frameRateMultiplier"),o=1;null!==s&&(null!==(r=/(\d+) (\d+)/.exec(s))?o=parseInt(r[1])/parseInt(r[2]):k(t,"Malformed frame rate multiplier attribute (using initial value instead)"));var u=o*a,l=1,c=x(e,n.ns_ttp,"tickRate");return null===c?null!==i&&(l=u):null!==(r=/(\d+)/.exec(c))?l=parseInt(r[1]):k(t,"Malformed tick rate attribute (using initial value instead)"),{effectiveFrameRate:u,tickRate:l}}(e,t);this.effectiveFrameRate=r.effectiveFrameRate,this.tickRate=r.tickRate,this.aspectRatio=function(e,t){var r=x(e,n.ns_ittp,"aspectRatio"),i=null;if(null!==r){var a=/(\d+) (\d+)/.exec(r);if(null!==a){var s=parseInt(a[1]),o=parseInt(a[2]);0!==s&&0!==o?i=s/o:L(t,"Illegal aspectRatio values (ignoring)")}else L(t,"Malformed aspectRatio attribute (ignoring)")}return i}(e,t);var a=x(e,n.ns_ttp,"timeBase");null!==a&&"media"!==a&&F(t,"Unsupported time base");var s=function(e,t){var r=x(e,n.ns_tts,"extent");if(null===r)return null;var a=r.split(" ");if(2!==a.length)return k(t,"Malformed extent (ignoring)"),null;var s=i.parseLength(a[0]),o=i.parseLength(a[1]);return o&&s?{h:o,w:s}:(k(t,"Malformed extent values (ignoring)"),null)}(e,t);null===s?this.pxDimensions={h:480,w:640}:("px"===s.h.unit&&"px"===s.w.unit||F(t,"Extent on TT must be in px or absent"),this.pxDimensions={h:s.h.value,w:s.w.value})},o.prototype._registerEvent=function(e){if(!(e.end<=e.begin)){var t=U(this.events,e.begin);if(t.found||this.events.splice(t.index,0,e.begin),e.end!==Number.POSITIVE_INFINITY){var n=U(this.events,e.end);n.found||this.events.splice(n.index,0,e.end)}}},o.prototype.getMediaTimeRange=function(){return[this.events[0],this.events[this.events.length-1]]},o.prototype.getMediaTimeEvents=function(){return this.events},c.prototype.initFromNode=function(e,t){this.id=C(e),this.styleAttrs=D(e,t),this.styleRefs=R(e)},h.prototype.initFromNode=function(e,t,n,r){this.id=C(n)},p.prototype.initFromNode=function(e,t,n,r){this.regionID=function(e){return e&&"region"in e.attributes?e.attributes.region.value:""}(n)},g.prototype.initFromNode=function(e,t,n,r){this.styleAttrs=D(n,r),null!==e.head&&null!==e.head.styling&&P(e.head.styling,R(n),this.styleAttrs,r)},m.prototype.initFromNode=function(e,t,n,r){this.sets=[]},y.prototype.initFromNode=function(e,t,n,r){this.contents=[]},v.prototype.initFromNode=function(e,t,n,r){var i=function(e,t,n,r){var i=null;n&&"begin"in n.attributes&&null===(i=N(e.tickRate,e.effectiveFrameRate,n.attributes.begin.value))&&k(r,"Malformed begin value "+n.attributes.begin.value+" (using 0)");var a=null;n&&"dur"in n.attributes&&null===(a=N(e.tickRate,e.effectiveFrameRate,n.attributes.dur.value))&&k(r,"Malformed dur value "+n.attributes.dur.value+" (ignoring)");var s=null;return n&&"end"in n.attributes&&null===(s=N(e.tickRate,e.effectiveFrameRate,n.attributes.end.value))&&k(r,"Malformed end value (ignoring)"),{explicit_begin:i,explicit_end:s,explicit_dur:a}}(e,0,n,r);this.explicit_begin=i.explicit_begin,this.explicit_end=i.explicit_end,this.explicit_dur=i.explicit_dur,this.timeContainer=function(e,t){var n=e&&"timeContainer"in e.attributes?e.attributes.timeContainer.value:null;return n&&"par"!==n?"seq"===n?"seq":(L(t,"Illegal value of timeContainer (assuming 'par')"),"par"):"par"}(n,r)},_.prototype.initFromNode=function(e,t,n){g.prototype.initFromNode.call(this,e,null,t,n),v.prototype.initFromNode.call(this,e,null,t,n),m.prototype.initFromNode.call(this,e,null,t,n),p.prototype.initFromNode.call(this,e,null,t,n),y.prototype.initFromNode.call(this,e,null,t,n)},T.prototype.initFromNode=function(e,t,n,r){g.prototype.initFromNode.call(this,e,t,n,r),v.prototype.initFromNode.call(this,e,t,n,r),m.prototype.initFromNode.call(this,e,t,n,r),p.prototype.initFromNode.call(this,e,t,n,r),y.prototype.initFromNode.call(this,e,t,n,r)},b.prototype.initFromNode=function(e,t,n,r){g.prototype.initFromNode.call(this,e,t,n,r),v.prototype.initFromNode.call(this,e,t,n,r),m.prototype.initFromNode.call(this,e,t,n,r),p.prototype.initFromNode.call(this,e,t,n,r),y.prototype.initFromNode.call(this,e,t,n,r)},E.prototype.initFromNode=function(e,t,n,r,i){g.prototype.initFromNode.call(this,e,t,n,i),v.prototype.initFromNode.call(this,e,t,n,i),m.prototype.initFromNode.call(this,e,t,n,i),p.prototype.initFromNode.call(this,e,t,n,i),y.prototype.initFromNode.call(this,e,t,n,i),this.space=r},S.prototype.initFromText=function(e,t,n,r,i){v.prototype.initFromNode.call(this,e,t,null,i),this.text=n,this.space=r},w.prototype.initFromNode=function(e,t,n,r){p.prototype.initFromNode.call(this,e,t,n,r),v.prototype.initFromNode.call(this,e,t,n,r)},A.prototype.createDefaultRegion=function(){var e=new A;return h.call(e,""),g.call(e,{}),m.call(e,[]),v.call(e,0,Number.POSITIVE_INFINITY,null),e},A.prototype.initFromNode=function(e,t,n){h.prototype.initFromNode.call(this,e,null,t,n),g.prototype.initFromNode.call(this,e,null,t,n),v.prototype.initFromNode.call(this,e,null,t,n),m.prototype.initFromNode.call(this,e,null,t,n),null!==e.head&&null!==e.head.styling&&P(e.head.styling,R(t),this.styleAttrs,n)},I.prototype.initFromNode=function(e,t,n,r){v.prototype.initFromNode.call(this,e,t,n,r);var i=D(n,r);for(var a in this.qname=null,this.value=null,i){if(this.qname){L(r,"More than one style specified on set");break}this.qname=a,this.value=i[a]}}}(t,"undefined"==typeof sax?n("./node_modules/sax/lib/sax.js"):sax,"undefined"==typeof imscNames?n("./node_modules/imsc/src/main/js/names.js"):imscNames,"undefined"==typeof imscStyles?n("./node_modules/imsc/src/main/js/styles.js"):imscStyles,"undefined"==typeof imscUtils?n("./node_modules/imsc/src/main/js/utils.js"):imscUtils)},"./node_modules/imsc/src/main/js/html.js":function(e,t,n){!function(e,t,n){function r(e,t,o){var l;if("region"===o.kind?(l=document.createElement("div")).style.position="absolute":"body"===o.kind||"div"===o.kind?l=document.createElement("div"):"p"===o.kind?l=document.createElement("p"):"span"===o.kind?l=document.createElement("span"):"br"===o.kind&&(l=document.createElement("br")),l){for(var c in l.style.margin="0",u){var d=u[c],f=o.styleAttrs[d.qname];void 0!==f&&null!==d.map&&d.map(e,l,o,f)}var h=l;if("region"===o.kind){var p=o.styleAttrs[n.byName.writingMode.qname];"lrtb"===p||"lr"===p?(e.ipd="lr",e.bpd="tb"):"rltb"===p||"rl"===p?(e.ipd="rl",e.bpd="tb"):"tblr"===p?(e.ipd="tb",e.bpd="lr"):"tbrl"!==p&&"tb"!==p||(e.ipd="tb",e.bpd="rl")}var g=o.styleAttrs[n.byName.linePadding.qname];if(g&&g>0){var m=Math.ceil(g*e.h)+"px";"tb"===e.bpd?(h.style.paddingLeft=m,h.style.paddingRight=m):(h.style.paddingTop=m,h.style.paddingBottom=m),e.lp=g}var y=o.styleAttrs[n.byName.multiRowAlign.qname];if(y&&"auto"!==y){var v=document.createElement("span");v.style.display="inline-block",v.style.textAlign=y,l.appendChild(v),h=v,e.mra=y}if(o.styleAttrs[n.byName.fillLineGap.qname]&&(e.flg=!0),"span"===o.kind&&o.text)if(e.lp||e.mra||e.flg)for(var _="",T=0;T<o.text.length;T++){_+=o.text.charAt(T);var b=o.text.charCodeAt(T);if(b<55296||b>56319||T===o.text.length){var E=document.createElement("span");E.textContent=_,l.appendChild(E),_=""}}else l.textContent=o.text;for(var S in t.appendChild(l),o.contents)r(e,h,o.contents[S]);var w=[];if((e.lp||e.mra||e.flg)&&"p"===o.kind&&(s(e,h,w,null),e.mra&&(function(e){for(var t=0;t<e.length-1;t++){var n=e[t].elements.length;if(0!==n&&!1===e[t].br){var r=document.createElement("br"),i=e[t].elements[n-1].node;i.parentElement.insertBefore(r,i.nextSibling)}}}(w),e.mra=null),e.lp&&(function(e,t,n){for(var r in e){var i=e[r].elements.length,a=e[r].elements[e[r].start_elem],s=e[r].elements[e[r].end_elem],o=Math.ceil(t)+"px",u="-"+Math.ceil(t)+"px";0!==i&&("lr"===n.ipd?(a.node.style.borderLeftColor=a.bgcolor||"#00000000",a.node.style.borderLeftStyle="solid",a.node.style.borderLeftWidth=o,a.node.style.marginLeft=u):"rl"===n.ipd?(a.node.style.borderRightColor=a.bgcolor||"#00000000",a.node.style.borderRightStyle="solid",a.node.style.borderRightWidth=o,a.node.style.marginRight=u):"tb"===n.ipd&&(a.node.style.borderTopColor=a.bgcolor||"#00000000",a.node.style.borderTopStyle="solid",a.node.style.borderTopWidth=o,a.node.style.marginTop=u),"lr"===n.ipd?(s.node.style.borderRightColor=s.bgcolor||"#00000000",s.node.style.borderRightStyle="solid",s.node.style.borderRightWidth=o,s.node.style.marginRight=u):"rl"===n.ipd?(s.node.style.borderLeftColor=s.bgcolor||"#00000000",s.node.style.borderLeftStyle="solid",s.node.style.borderLeftWidth=o,s.node.style.marginLeft=u):"tb"===n.ipd&&(s.node.style.borderBottomColor=s.bgcolor||"#00000000",s.node.style.borderBottomStyle="solid",s.node.style.borderBottomWidth=o,s.node.style.marginBottom=u))}}(w,e.lp*e.h,e),e.lp=null),e.flg)){var A=a(h.getBoundingClientRect(),e);!function(e,t,n,r){for(var i=Math.sign(n-t),a=0;a<=e.length;a++){var s,o,u;if(s=0===a?t:a===e.length?n:(e[a].before+e[a-1].after)/2,a>0)for(var l=0;l<e[a-1].elements.length;l++)null!==e[a-1].elements[l].bgcolor&&i*((u=e[a-1].elements[l]).after-s)<0&&(o=Math.ceil(Math.abs(s-u.after))+"px",u.node.style.backgroundColor=u.bgcolor,"lr"===r.bpd?u.node.style.paddingRight=o:"rl"===r.bpd?u.node.style.paddingLeft=o:"tb"===r.bpd&&(u.node.style.paddingBottom=o));if(a<e.length)for(var c=0;c<e[a].elements.length;c++)null!==(u=e[a].elements[c]).bgcolor&&i*(u.before-s)>0&&(o=Math.ceil(Math.abs(u.before-s))+"px",u.node.style.backgroundColor=u.bgcolor,"lr"===r.bpd?u.node.style.paddingLeft=o:"rl"===r.bpd?u.node.style.paddingRight=o:"tb"===r.bpd&&(u.node.style.paddingTop=o))}}(w,A.before,A.after,e),e.flg=null}if("region"===o.kind&&(s(e,h,w),"tb"===e.bpd&&e.enableRollUp&&o.contents.length>0&&"after"===o.styleAttrs[n.byName.displayAlign.qname])){var I=new i(""===o.id?"_":o.id,w);if(e.currentISDState[I.id]=I,e.previousISDState&&I.id in e.previousISDState&&e.previousISDState[I.id].plist.length>0&&I.plist.length>1&&I.plist[I.plist.length-2].text===e.previousISDState[I.id].plist[e.previousISDState[I.id].plist.length-1].text){var C=l.firstElementChild,R=I.plist[I.plist.length-1].after-I.plist[I.plist.length-1].before;C.style.bottom="-"+R+"px",C.style.transition="transform 0.4s",C.style.position="relative",C.style.transform="translateY(-"+R+"px)"}}}else!function(e,t){if(e&&e.error&&e.error(t))throw t}(e.errorHandler,"Error processing ISD element kind: "+o.kind)}function i(e,t){this.id=e,this.plist=t}function a(e,t){var n={before:null,after:null,start:null,end:null};return"tb"===t.bpd?(n.before=e.top,n.after=e.bottom,"lr"===t.ipd?(n.start=e.left,n.end=e.right):(n.start=e.right,n.end=e.left)):"lr"===t.bpd?(n.before=e.left,n.after=e.right,n.start=e.top,n.end=e.bottom):"rl"===t.bpd&&(n.before=e.right,n.after=e.left,n.start=e.top,n.end=e.bottom),n}function s(e,t,n,r){var i,o,u,l,c=t.style.backgroundColor||r;if(0===t.childElementCount)if("span"===t.localName){var d=t.getBoundingClientRect();if(0===d.height||0===d.width)return;var f=a(d,e);if(0!==n.length&&(i=f.before,o=f.after,u=n[n.length-1].before,o<(l=n[n.length-1].after)&&i>u||l<=o&&u>=i)){var h=Math.sign(f.after-f.before),p=Math.sign(f.end-f.start);h*(f.before-n[n.length-1].before)<0&&(n[n.length-1].before=f.before),h*(f.after-n[n.length-1].after)>0&&(n[n.length-1].after=f.after),p*(f.start-n[n.length-1].start)<0&&(n[n.length-1].start=f.start,n[n.length-1].start_elem=n[n.length-1].elements.length),p*(f.end-n[n.length-1].end)>0&&(n[n.length-1].end=f.end,n[n.length-1].end_elem=n[n.length-1].elements.length)}else n.push({before:f.before,after:f.after,start:f.start,end:f.end,start_elem:0,end_elem:0,elements:[],text:"",br:!1});n[n.length-1].text+=t.textContent,n[n.length-1].elements.push({node:t,bgcolor:c,before:f.before,after:f.after})}else"br"===t.localName&&0!==n.length&&(n[n.length-1].br=!0);else for(var g=t.firstChild;g;)g.nodeType===Node.ELEMENT_NODE&&s(e,g,n,c),g=g.nextSibling}function o(e,t){this.qname=e,this.map=t}e.render=function(e,t,n,i,a,s,o,u,l){var c=i||t.clientHeight,d=a||t.clientWidth;if(null!==e.aspectRatio){var f=c*e.aspectRatio;f>d?c=Math.round(d/e.aspectRatio):d=f}var h=document.createElement("div");h.style.position="relative",h.style.width=d+"px",h.style.height=c+"px",h.style.margin="auto",h.style.top=0,h.style.bottom=0,h.style.left=0,h.style.right=0,h.style.zIndex=0;var p={h:c,w:d,regionH:null,regionW:null,imgResolver:n,displayForcedOnlyMode:s||!1,isd:e,errorHandler:o,previousISDState:u,enableRollUp:l||!1,currentISDState:{},flg:null,lp:null,mra:null,ipd:null,bpd:null};for(var g in t.appendChild(h),e.contents)r(p,h,e.contents[g]);return p.currentISDState};var u=[new o("http://www.w3.org/ns/ttml#styling backgroundColor",(function(e,t,n,r){0!==r[3]&&(t.style.backgroundColor="rgba("+r[0].toString()+","+r[1].toString()+","+r[2].toString()+","+(r[3]/255).toString()+")")})),new o("http://www.w3.org/ns/ttml#styling color",(function(e,t,n,r){t.style.color="rgba("+r[0].toString()+","+r[1].toString()+","+r[2].toString()+","+(r[3]/255).toString()+")"})),new o("http://www.w3.org/ns/ttml#styling direction",(function(e,t,n,r){t.style.direction=r})),new o("http://www.w3.org/ns/ttml#styling display",(function(e,t,n,r){})),new o("http://www.w3.org/ns/ttml#styling displayAlign",(function(e,t,n,r){t.style.display="flex",t.style.flexDirection="column","before"===r?t.style.justifyContent="flex-start":"center"===r?t.style.justifyContent="center":"after"===r&&(t.style.justifyContent="flex-end")})),new o("http://www.w3.org/ns/ttml#styling extent",(function(e,t,n,r){e.regionH=r.h*e.h,e.regionW=r.w*e.w;var i=0,a=0,s=n.styleAttrs["http://www.w3.org/ns/ttml#styling padding"];s&&(i=(s[0]+s[2])*e.h,a=(s[1]+s[3])*e.w),t.style.height=e.regionH-i+"px",t.style.width=e.regionW-a+"px"})),new o("http://www.w3.org/ns/ttml#styling fontFamily",(function(e,t,n,r){var i=[];for(var a in r)"monospaceSerif"===r[a]?(i.push("Courier New"),i.push('"Liberation Mono"'),i.push("Courier"),i.push("monospace")):"proportionalSansSerif"===r[a]?(i.push("Arial"),i.push("Helvetica"),i.push('"Liberation Sans"'),i.push("sans-serif")):"monospace"===r[a]?i.push("monospace"):"sansSerif"===r[a]?i.push("sans-serif"):"serif"===r[a]?i.push("serif"):"monospaceSansSerif"===r[a]?(i.push("Consolas"),i.push("monospace")):"proportionalSerif"===r[a]?i.push("serif"):i.push(r[a]);t.style.fontFamily=i.join(",")})),new o("http://www.w3.org/ns/ttml#styling fontSize",(function(e,t,n,r){t.style.fontSize=r*e.h+"px"})),new o("http://www.w3.org/ns/ttml#styling fontStyle",(function(e,t,n,r){t.style.fontStyle=r})),new o("http://www.w3.org/ns/ttml#styling fontWeight",(function(e,t,n,r){t.style.fontWeight=r})),new o("http://www.w3.org/ns/ttml#styling lineHeight",(function(e,t,n,r){t.style.lineHeight="normal"===r?"normal":r*e.h+"px"})),new o("http://www.w3.org/ns/ttml#styling opacity",(function(e,t,n,r){t.style.opacity=r})),new o("http://www.w3.org/ns/ttml#styling origin",(function(e,t,n,r){t.style.top=r.h*e.h+"px",t.style.left=r.w*e.w+"px"})),new o("http://www.w3.org/ns/ttml#styling overflow",(function(e,t,n,r){t.style.overflow=r})),new o("http://www.w3.org/ns/ttml#styling padding",(function(e,t,n,r){var i=[];i[0]=r[0]*e.h+"px",i[1]=r[3]*e.w+"px",i[2]=r[2]*e.h+"px",i[3]=r[1]*e.w+"px",t.style.padding=i.join(" ")})),new o("http://www.w3.org/ns/ttml#styling showBackground",null),new o("http://www.w3.org/ns/ttml#styling textAlign",(function(e,t,r,i){var a,s=r.styleAttrs[n.byName.direction.qname];a="start"===i?"rtl"===s?"right":"left":"end"===i?"rtl"===s?"left":"right":i,t.style.textAlign=a})),new o("http://www.w3.org/ns/ttml#styling textDecoration",(function(e,t,n,r){t.style.textDecoration=r.join(" ").replace("lineThrough","line-through")})),new o("http://www.w3.org/ns/ttml#styling textOutline",(function(e,t,n,r){t.style.textShadow="none"===r?"":"rgba("+r.color[0].toString()+","+r.color[1].toString()+","+r.color[2].toString()+","+(r.color[3]/255).toString()+") 0px 0px "+r.thickness*e.h+"px"})),new o("http://www.w3.org/ns/ttml#styling unicodeBidi",(function(e,t,n,r){var i;i="bidiOverride"===r?"bidi-override":r,t.style.unicodeBidi=i})),new o("http://www.w3.org/ns/ttml#styling visibility",(function(e,t,n,r){t.style.visibility=r})),new o("http://www.w3.org/ns/ttml#styling wrapOption",(function(e,t,n,r){"wrap"===r?"preserve"===n.space?t.style.whiteSpace="pre-wrap":t.style.whiteSpace="normal":"preserve"===n.space?t.style.whiteSpace="pre":t.style.whiteSpace="noWrap"})),new o("http://www.w3.org/ns/ttml#styling writingMode",(function(e,t,n,r){"lrtb"===r||"lr"===r||"rltb"===r||"rl"===r?t.style.writingMode="horizontal-tb":"tblr"===r?t.style.writingMode="vertical-lr":"tbrl"!==r&&"tb"!==r||(t.style.writingMode="vertical-rl")})),new o("http://www.w3.org/ns/ttml#styling zIndex",(function(e,t,n,r){t.style.zIndex=r})),new o("http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt backgroundImage",(function(e,t,n,r){if(null!==e.imgResolver&&null!==r){var i=document.createElement("img"),a=e.imgResolver(r,i);a&&(i.src=a),i.height=e.regionH,i.width=e.regionW,t.appendChild(i)}})),new o("http://www.w3.org/ns/ttml/profile/imsc1#styling forcedDisplay",(function(e,t,n,r){e.displayForcedOnlyMode&&!1===r&&(t.style.visibility="hidden")}))],l={};for(var c in u)l[u[c].qname]=u[c]}(t,"undefined"==typeof imscNames?n("./node_modules/imsc/src/main/js/names.js"):imscNames,"undefined"==typeof imscStyles?n("./node_modules/imsc/src/main/js/styles.js"):imscStyles)},"./node_modules/imsc/src/main/js/isd.js":function(e,t,n){!function(e,t,n){function r(e,t,s,l,c,d,f,h,p){if(t<f.begin||t>=f.end)return null;var g="regionID"in f&&""!==f.regionID?f.regionID:d;if(null!==c&&g!==s.id&&(!("contents"in f)||"contents"in f&&0===f.contents.length||""!==g))return null;var m=new o(f);for(var y in f.sets)t<f.sets[y].begin||t>=f.sets[y].end||(m.styleAttrs[f.sets[y].qname]=f.sets[y].value);var v,_={};for(var T in m.styleAttrs)if(_[T]=!0,T===n.byName.writingMode.qname&&!(n.byName.direction.qname in m.styleAttrs)){var b=m.styleAttrs[T];"lrtb"===b||"lr"===b?m.styleAttrs[n.byName.direction.qname]="ltr":"rltb"!==b&&"rl"!==b||(m.styleAttrs[n.byName.direction.qname]="rtl")}if(null!==c)for(var E in n.all){var S=n.all[E];if(S.qname===n.byName.textDecoration.qname){var w=c.styleAttrs[S.qname],A=m.styleAttrs[S.qname],I=[];void 0===A?I=w:-1===A.indexOf("none")?((-1===A.indexOf("noUnderline")&&-1!==w.indexOf("underline")||-1!==A.indexOf("underline"))&&I.push("underline"),(-1===A.indexOf("noLineThrough")&&-1!==w.indexOf("lineThrough")||-1!==A.indexOf("lineThrough"))&&I.push("lineThrough"),(-1===A.indexOf("noOverline")&&-1!==w.indexOf("overline")||-1!==A.indexOf("overline"))&&I.push("overline")):I.push("none"),m.styleAttrs[S.qname]=I}else S.inherit&&S.qname in c.styleAttrs&&!(S.qname in m.styleAttrs)&&(m.styleAttrs[S.qname]=c.styleAttrs[S.qname])}for(var C in n.all){var R=n.all[C];R.qname in m.styleAttrs||("region"===m.kind||!1===R.inherit&&null!==R.initial)&&(m.styleAttrs[R.qname]=R.parse(R.initial),_[R.qname]=!0)}for(var D in n.all){var x=n.all[D];if(x.qname in _&&null!==x.compute){var N=x.compute(e,c,m,m.styleAttrs[x.qname],p);null!==N?m.styleAttrs[x.qname]=N:u(h,"Style '"+x.qname+"' on element '"+m.kind+"' cannot be computed")}}if("none"===m.styleAttrs[n.byName.display.qname])return null;for(var O in null===c?v=null===l?[]:[l]:"contents"in f&&(v=f.contents),v){var P=r(e,t,s,l,m,g,v[O],h,p);null!==P&&m.contents.push(P.element)}for(var M in m.styleAttrs)-1===n.byQName[M].applies.indexOf(m.kind)&&delete m.styleAttrs[M];if("span"===m.kind&&m.text&&"default"===m.space){var k=m.text.replace(/\s+/g," ");m.text=k}if("p"===m.kind){var L=[];i(m,L);for(var F=0,U="after_br",B=0;;)if("after_br"===U)F>=L.length||"br"===L[F].kind?(U="before_br",B=F,F--):("preserve"!==L[F].space&&(L[F].text=L[F].text.replace(/^\s+/g,"")),L[F].text.length>0?(U="looking_br",F++):L.splice(F,1));else if("before_br"===U)if(F<0||"br"===L[F].kind){if(U="after_br",(F=B+1)>=L.length)break}else if("preserve"!==L[F].space&&(L[F].text=L[F].text.replace(/\s+$/g,"")),L[F].text.length>0){if(U="after_br",(F=B+1)>=L.length)break}else L.splice(F,1),F--;else F>=L.length||"br"===L[F].kind?(U="before_br",B=F,F--):F++;a(m)}return"div"===m.kind&&n.byName.backgroundImage.qname in m.styleAttrs||"br"===m.kind||"contents"in m&&m.contents.length>0||"span"===m.kind&&null!==m.text||"region"===m.kind&&"always"===m.styleAttrs[n.byName.showBackground.qname]?{region_id:g,element:m}:null}function i(e,t){if("contents"in e)for(var n in e.contents)i(e.contents[n],t);else t.push(e)}function a(e){if("br"===e.kind)return!1;if("text"in e)return 0===e.text.length;if("contents"in e){for(var t=e.contents.length;t--;)a(e.contents[t])&&e.contents.splice(t,1);return 0===e.contents.length}}function s(e){this.contents=[],this.aspectRatio=e.aspectRatio}function o(e){for(var t in this.kind=e.kind||"region",e.id&&(this.id=e.id),this.styleAttrs={},e.styleAttrs)this.styleAttrs[t]=e.styleAttrs[t];"text"in e?this.text=e.text:"br"!==e.kind&&(this.contents=[]),"space"in e&&(this.space=e.space)}function u(e,t){if(e&&e.error&&e.error(t))throw t}e.generateISD=function(e,t,n){var i=new s(e),a={};for(var o in e.head.layout.regions){var u=r(e,t,e.head.layout.regions[o],e.body,null,"",e.head.layout.regions[o],n,a);null!==u&&i.contents.push(u.element)}return i}}(t,"undefined"==typeof imscNames?n("./node_modules/imsc/src/main/js/names.js"):imscNames,"undefined"==typeof imscStyles?n("./node_modules/imsc/src/main/js/styles.js"):imscStyles)},"./node_modules/imsc/src/main/js/main.js":function(e,t,n){t.generateISD=n("./node_modules/imsc/src/main/js/isd.js").generateISD,t.fromXML=n("./node_modules/imsc/src/main/js/doc.js").fromXML,t.renderHTML=n("./node_modules/imsc/src/main/js/html.js").render},"./node_modules/imsc/src/main/js/names.js":function(e,t,n){!function(e){e.ns_tt="http://www.w3.org/ns/ttml",e.ns_tts="http://www.w3.org/ns/ttml#styling",e.ns_ttp="http://www.w3.org/ns/ttml#parameter",e.ns_xml="http://www.w3.org/XML/1998/namespace",e.ns_itts="http://www.w3.org/ns/ttml/profile/imsc1#styling",e.ns_ittp="http://www.w3.org/ns/ttml/profile/imsc1#parameter",e.ns_smpte="http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt",e.ns_ebutts="urn:ebu:tt:style"}(t)},"./node_modules/imsc/src/main/js/styles.js":function(e,t,n){!function(e,t,n){function r(e,t,n,r,i,a,s,o){this.name=t,this.ns=e,this.qname=e+" "+t,this.inherit=i,this.animatable=a,this.initial=n,this.applies=r,this.parse=s,this.compute=o}for(var i in e.all=[new r(t.ns_tts,"backgroundColor","transparent",["body","div","p","region","span"],!1,!0,n.parseColor,null),new r(t.ns_tts,"color","white",["span"],!0,!0,n.parseColor,null),new r(t.ns_tts,"direction","ltr",["p","span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"display","auto",["body","div","p","region","span"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"displayAlign","before",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"extent","auto",["tt","region"],!1,!0,(function(e){if("auto"===e)return e;var t=e.split(" ");if(2!==t.length)return null;var r=n.parseLength(t[0]),i=n.parseLength(t[1]);return i&&r?{h:i,w:r}:null}),(function(e,t,n,r,i){var a,s;if("auto"===r)a=1;else if("%"===r.h.unit)a=r.h.value/100;else{if("px"!==r.h.unit)return null;a=r.h.value/e.pxDimensions.h}if("auto"===r)s=1;else if("%"===r.w.unit)s=r.w.value/100;else{if("px"!==r.w.unit)return null;s=r.w.value/e.pxDimensions.w}return{h:a,w:s}})),new r(t.ns_tts,"fontFamily","default",["span"],!0,!0,(function(e){var t=e.split(","),n=[];for(var r in t)"'"!==t[r].charAt(0)&&'"'!==t[r].charAt(0)&&"default"===t[r]?n.push("monospaceSerif"):n.push(t[r]);return n}),null),new r(t.ns_tts,"fontSize","1c",["span"],!0,!0,n.parseLength,(function(t,n,r,i,a){var s;if("%"===i.unit)s=null!==n?n.styleAttrs[e.byName.fontSize.qname]*i.value/100:i.value/100/t.cellResolution.h;else if("em"===i.unit)s=null!==n?n.styleAttrs[e.byName.fontSize.qname]*i.value:i.value/t.cellResolution.h;else if("c"===i.unit)s=i.value/t.cellResolution.h;else{if("px"!==i.unit)return null;s=i.value/t.pxDimensions.h}return s})),new r(t.ns_tts,"fontStyle","normal",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"fontWeight","normal",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"lineHeight","normal",["p"],!0,!0,(function(e){return"normal"===e?e:n.parseLength(e)}),(function(t,n,r,i,a){var s;if("normal"===i)s=i;else if("%"===i.unit)s=r.styleAttrs[e.byName.fontSize.qname]*i.value/100;else if("em"===i.unit)s=r.styleAttrs[e.byName.fontSize.qname]*i.value;else if("c"===i.unit)s=i.value/t.cellResolution.h;else{if("px"!==i.unit)return null;s=i.value/t.pxDimensions.h}return s})),new r(t.ns_tts,"opacity",1,["region"],!1,!0,parseFloat,null),new r(t.ns_tts,"origin","auto",["region"],!1,!0,(function(e){if("auto"===e)return e;var t=e.split(" ");if(2!==t.length)return null;var r=n.parseLength(t[0]),i=n.parseLength(t[1]);return i&&r?{h:i,w:r}:null}),(function(e,t,n,r,i){var a,s;if("auto"===r)a=0;else if("%"===r.h.unit)a=r.h.value/100;else{if("px"!==r.h.unit)return null;a=r.h.value/e.pxDimensions.h}if("auto"===r)s=0;else if("%"===r.w.unit)s=r.w.value/100;else{if("px"!==r.w.unit)return null;s=r.w.value/e.pxDimensions.w}return{h:a,w:s}})),new r(t.ns_tts,"overflow","hidden",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"padding","0px",["region"],!1,!0,(function(e){var t=e.split(" ");if(t.length>4)return null;var r=[];for(var i in t){var a=n.parseLength(t[i]);if(!a)return null;r.push(a)}return r}),(function(t,n,r,i,a){var s;if(1===i.length)s=[i[0],i[0],i[0],i[0]];else if(2===i.length)s=[i[0],i[1],i[0],i[1]];else if(3===i.length)s=[i[0],i[1],i[2],i[1]];else{if(4!==i.length)return null;s=[i[0],i[1],i[2],i[3]]}var o=r.styleAttrs[e.byName.writingMode.qname];if("lrtb"===o||"lr"===o)s=[s[0],s[3],s[2],s[1]];else if("rltb"===o||"rl"===o)s=[s[0],s[1],s[2],s[3]];else if("tblr"===o)s=[s[3],s[0],s[1],s[2]];else{if("tbrl"!==o&&"tb"!==o)return null;s=[s[3],s[2],s[1],s[0]]}var u=[];for(var l in s)if(0===s[l].value)u[l]=0;else if("%"===s[l].unit)u[l]="0"===l||"2"===l?r.styleAttrs[e.byName.extent.qname].h*s[l].value/100:r.styleAttrs[e.byName.extent.qname].w*s[l].value/100;else if("em"===s[l].unit)u[l]=r.styleAttrs[e.byName.fontSize.qname]*s[l].value;else if("c"===s[l].unit)u[l]=s[l].value/t.cellResolution.h;else{if("px"!==s[l].unit)return null;u[l]="0"===l||"2"===l?s[l].value/t.pxDimensions.h:s[l].value/t.pxDimensions.w}return u})),new r(t.ns_tts,"showBackground","always",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"textAlign","start",["p"],!0,!0,(function(e){return e}),(function(e,t,n,r,i){return"left"===r?"start":"right"===r?"end":r})),new r(t.ns_tts,"textDecoration","none",["span"],!0,!0,(function(e){return e.split(" ")}),null),new r(t.ns_tts,"textOutline","none",["span"],!0,!0,(function(e){if("none"===e)return e;var t={},r=e.split(" ");if(0===r.length||r.length>2)return null;var i=n.parseColor(r[0]);if(t.color=i,null!==i&&r.shift(),1!==r.length)return null;var a=n.parseLength(r[0]);return a?(t.thickness=a,t):null}),(function(t,n,r,i,a){if("none"===i)return i;var s={};if(null===i.color?s.color=r.styleAttrs[e.byName.color.qname]:s.color=i.color,"%"===i.thickness.unit)s.thickness=r.styleAttrs[e.byName.fontSize.qname]*i.thickness.value/100;else if("em"===i.thickness.unit)s.thickness=r.styleAttrs[e.byName.fontSize.qname]*i.thickness.value;else if("c"===i.thickness.unit)s.thickness=i.thickness.value/t.cellResolution.h;else{if("px"!==i.thickness.unit)return null;s.thickness=i.thickness.value/t.pxDimensions.h}return s})),new r(t.ns_tts,"unicodeBidi","normal",["span","p"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"visibility","visible",["body","div","p","region","span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"wrapOption","wrap",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"writingMode","lrtb",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"zIndex","auto",["region"],!1,!0,(function(e){var t;return"auto"===e?t=e:(t=parseInt(e),isNaN(t)&&(t=null)),t}),null),new r(t.ns_ebutts,"linePadding","0c",["p"],!0,!1,n.parseLength,(function(e,t,n,r,i){return"c"===r.unit?r.value/e.cellResolution.h:null})),new r(t.ns_ebutts,"multiRowAlign","auto",["p"],!0,!1,(function(e){return e}),null),new r(t.ns_smpte,"backgroundImage",null,["div"],!1,!1,(function(e){return e}),null),new r(t.ns_itts,"forcedDisplay","false",["body","div","p","region","span"],!0,!0,(function(e){return"true"===e}),null),new r(t.ns_itts,"fillLineGap","false",["p"],!0,!0,(function(e){return"true"===e}),null)],e.byQName={},e.all)e.byQName[e.all[i].qname]=e.all[i];for(var a in e.byName={},e.all)e.byName[e.all[a].name]=e.all[a]}(t,"undefined"==typeof imscNames?n("./node_modules/imsc/src/main/js/names.js"):imscNames,"undefined"==typeof imscUtils?n("./node_modules/imsc/src/main/js/utils.js"):imscUtils)},"./node_modules/imsc/src/main/js/utils.js":function(e,t,n){!function(e){var t=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?/,n=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,r=/rgba\(\s*(\d+),\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,i={transparent:[0,0,0,0],black:[0,0,0,255],silver:[192,192,192,255],gray:[128,128,128,255],white:[255,255,255,255],maroon:[128,0,0,255],red:[255,0,0,255],purple:[128,0,128,255],fuchsia:[255,0,255,255],magenta:[255,0,255,255],green:[0,128,0,255],lime:[0,255,0,255],olive:[128,128,0,255],yellow:[255,255,0,255],navy:[0,0,128,255],blue:[0,0,255,255],teal:[0,128,128,255],aqua:[0,255,255,255],cyan:[0,255,255,255]};e.parseColor=function(e){var a,s=null,o=i[e.toLowerCase()];return void 0!==o?s=o:null!==(a=t.exec(e))?s=[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16),void 0!==a[4]?parseInt(a[4],16):255]:null!==(a=n.exec(e))?s=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),255]:null!==(a=r.exec(e))&&(s=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),parseInt(a[4])]),s};var a=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%)$/;e.parseLength=function(e){var t,n=null;return null!==(t=a.exec(e))&&(n={value:parseFloat(t[1]),unit:t[2]}),n}}(t)},"./node_modules/inherits/inherits_browser.js":function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},"./node_modules/isarray/index.js":function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},"./node_modules/node-libs-browser/node_modules/buffer/index.js":function(e,t,n){(function(e){var r=n("./node_modules/base64-js/index.js"),i=n("./node_modules/ieee754/index.js"),a=n("./node_modules/isarray/index.js");function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}return l(this,e,t,n)}function l(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r),u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=f(e,t),e}(e,t,n,r):"string"==typeof t?function(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|p(t,n),i=(e=o(e,r)).write(t,n);return i!==r&&(e=e.slice(0,i)),e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|h(t.length);return 0===(e=o(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?o(e,0):f(e,t);if("Buffer"===t.type&&a(t.data))return f(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function d(e,t){if(c(t),e=o(e,t<0?0:0|h(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function f(e,t){var n=t.length<0?0:0|h(t.length);e=o(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function h(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(e).length;default:if(r)return j(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return x(this,t,n);case"utf8":case"utf-8":return I(this,t,n);case"ascii":return R(this,t,n);case"latin1":case"binary":return D(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,i){var a,s=1,o=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,o/=2,u/=2,n/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(a=n;a<o;a++)if(l(e,a)===l(t,-1===c?0:a-c)){if(-1===c&&(c=a),a-c+1===u)return c*s}else-1!==c&&(a-=a-c),c=-1}else for(n+u>o&&(n=o-u),a=n;a>=0;a--){for(var d=!0,f=0;f<u;f++)if(l(e,a+f)!==l(t,f)){d=!1;break}if(d)return a}return-1}function _(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var s=0;s<r;++s){var o=parseInt(t.substr(2*s,2),16);if(isNaN(o))return s;e[n+s]=o}return s}function T(e,t,n,r){return H(j(t,e.length-n),e,n,r)}function b(e,t,n,r){return H(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function E(e,t,n,r){return b(e,t,n,r)}function S(e,t,n,r){return H(q(t),e,n,r)}function w(e,t,n,r){return H(function(e,t){for(var n,r,i,a=[],s=0;s<e.length&&!((t-=2)<0);++s)r=(n=e.charCodeAt(s))>>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function A(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function I(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var a,s,o,u,l=e[i],c=null,d=l>239?4:l>223?3:l>191?2:1;if(i+d<=n)switch(d){case 1:l<128&&(c=l);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&l)<<6|63&a)>127&&(c=u);break;case 3:a=e[i+1],s=e[i+2],128==(192&a)&&128==(192&s)&&(u=(15&l)<<12|(63&a)<<6|63&s)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:a=e[i+1],s=e[i+2],o=e[i+3],128==(192&a)&&128==(192&s)&&128==(192&o)&&(u=(15&l)<<18|(63&a)<<12|(63&s)<<6|63&o)>65535&&u<1114112&&(c=u)}null===c?(c=65533,d=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=d}return function(e){var t=e.length;if(t<=C)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=C));return n}(r)}t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=s(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return l(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return c(t),t<=0?o(e,t):void 0!==n?"string"==typeof r?o(e,t).fill(n,r):o(e,t).fill(n):o(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return d(null,e)},u.allocUnsafeSlow=function(e){return d(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!a(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var s=e[n];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,i),i+=s.length}return r},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?I(this,0,e):g.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),o=Math.min(a,s),l=this.slice(r,i),c=e.slice(t,n),d=0;d<o;++d)if(l[d]!==c[d]){a=l[d],s=c[d];break}return a<s?-1:s<a?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return y(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return y(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return _(this,e,t,n);case"utf8":case"utf-8":return T(this,e,t,n);case"ascii":return b(this,e,t,n);case"latin1":case"binary":return E(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function R(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function D(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function x(e,t,n){var r,i=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>i)&&(n=i);for(var a="",s=t;s<n;++s)a+=(r=e[s])<16?"0"+r.toString(16):r.toString(16);return a}function N(e,t,n){for(var r=e.slice(t,n),i="",a=0;a<r.length;a+=2)i+=String.fromCharCode(r[a]+256*r[a+1]);return i}function O(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,n,r,i,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function M(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-n,2);i<a;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function k(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-n,4);i<a;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function L(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function F(e,t,n,r,a){return a||L(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function U(e,t,n,r,a){return a||L(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=u.prototype;else{var i=t-e;n=new u(i,void 0);for(var a=0;a<i;++a)n[a]=this[a+e]}return n},u.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},u.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||O(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||O(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||O(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},u.prototype.readInt8=function(e,t){return t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||O(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||O(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||O(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||O(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||O(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||O(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){e=+e,t|=0,n|=0,r||P(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,r){e=+e,t|=0,n|=0,r||P(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):k(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):k(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);P(this,e,t,n,i-1,-i)}var a=0,s=1,o=0;for(this[t]=255&e;++a<n&&(s*=256);)e<0&&0===o&&0!==this[t+a-1]&&(o=1),this[t+a]=(e/s>>0)-o&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);P(this,e,t,n,i-1,-i)}var a=n-1,s=1,o=0;for(this[t+a]=255&e;--a>=0&&(s*=256);)e<0&&0===o&&0!==this[t+a+1]&&(o=1),this[t+a]=(e/s>>0)-o&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):k(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):k(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return F(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return F(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return U(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return U(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,a=r-n;if(this===e&&n<t&&t<r)for(i=a-1;i>=0;--i)e[i+t]=this[i+n];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var a;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a<n;++a)this[a]=e;else{var s=u.isBuffer(e)?e:j(new u(e,r).toString()),o=s.length;for(a=0;a<n-t;++a)this[a+t]=s[a%o]}return this};var B=/[^+\/0-9A-Za-z-_]/g;function j(e,t){var n;t=t||1/0;for(var r=e.length,i=null,a=[],s=0;s<r;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function q(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n("./node_modules/webpack/buildin/global.js"))},"./node_modules/node-libs-browser/node_modules/events/events.js":function(e,t,n){var r,i="object"==typeof Reflect?Reflect:null,a=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}y(e,t,a,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&y(e,"error",t,n)}(e,i,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var u=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function d(e,t,n,r){var i,a,s,o;if(l(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),s=a[t]),void 0===s)s=a[t]=n,++e._eventsCount;else if("function"==typeof s?s=a[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=c(e))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,o=u,console&&console.warn&&console.warn(o)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function p(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):m(i,i.length)}function g(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function m(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function y(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(a){r.once&&e.removeEventListener(t,i),n(a)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)a(u,this,t);else{var l=u.length,c=m(u,l);for(n=0;n<l;++n)a(c[n],this,t)}return!0},o.prototype.addListener=function(e,t){return d(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return d(this,e,t,!0)},o.prototype.once=function(e,t){return l(t),this.on(e,h(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,h(this,e,t)),this},o.prototype.removeListener=function(e,t){var n,r,i,a,s;if(l(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){s=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(i=a[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return p(this,e,!0)},o.prototype.rawListeners=function(e){return p(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},o.prototype.listenerCount=g,o.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},"./node_modules/node-libs-browser/node_modules/timers-browserify/main.js":function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(i.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new a(i.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n("./node_modules/setimmediate/setImmediate.js"),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n("./node_modules/webpack/buildin/global.js"))},"./node_modules/path-browserify/index.js":function(e,t,n){(function(e){function n(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}t.resolve=function(){for(var t="",i=!1,a=arguments.length-1;a>=-1&&!i;a--){var s=a>=0?arguments[a]:e.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(t=s+"/"+t,i="/"===s.charAt(0))}return(i?"/":"")+(t=n(r(t.split("/"),(function(e){return!!e})),!i).join("/"))||"."},t.normalize=function(e){var a=t.isAbsolute(e),s="/"===i(e,-1);return(e=n(r(e.split("/"),(function(e){return!!e})),!a).join("/"))||a||(e="."),e&&s&&(e+="/"),(a?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var i=r(e.split("/")),a=r(n.split("/")),s=Math.min(i.length,a.length),o=s,u=0;u<s;u++)if(i[u]!==a[u]){o=u;break}var l=[];for(u=o;u<i.length;u++)l.push("..");return(l=l.concat(a.slice(o))).join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){if("string"!=typeof e&&(e+=""),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,r=-1,i=!0,a=e.length-1;a>=1;--a)if(47===(t=e.charCodeAt(a))){if(!i){r=a;break}}else i=!1;return-1===r?n?"/":".":n&&1===r?"/":e.slice(0,r)},t.basename=function(e,t){var n=function(e){"string"!=typeof e&&(e+="");var t,n=0,r=-1,i=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!i){n=t+1;break}}else-1===r&&(i=!1,r=t+1);return-1===r?"":e.slice(n,r)}(e);return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,n=0,r=-1,i=!0,a=0,s=e.length-1;s>=0;--s){var o=e.charCodeAt(s);if(47!==o)-1===r&&(i=!1,r=s+1),46===o?-1===t?t=s:1!==a&&(a=1):-1!==t&&(a=-1);else if(!i){n=s+1;break}}return-1===t||-1===r||0===a||1===a&&t===r-1&&t===n+1?"":e.slice(t,r)};var i=function(e,t,n){return e.substr(t,n)}}).call(this,n("./node_modules/process/browser.js"))},"./node_modules/process-nextick-args/index.js":function(e,t,n){(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,n,r,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var a,s,o=arguments.length;switch(o){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,n)}));case 3:return t.nextTick((function(){e.call(null,n,r)}));case 4:return t.nextTick((function(){e.call(null,n,r,i)}));default:for(a=new Array(o-1),s=0;s<a.length;)a[s++]=arguments[s];return t.nextTick((function(){e.apply(null,a)}))}}}:e.exports=t}).call(this,n("./node_modules/process/browser.js"))},"./node_modules/process/browser.js":function(e,t){var n,r,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var u,l=[],c=!1,d=-1;function f(){c&&u&&(c=!1,u.length?l=u.concat(l):d=-1,l.length&&h())}function h(){if(!c){var e=o(f);c=!0;for(var t=l.length;t;){for(u=l,l=[];++d<t;)u&&u[d].run();d=-1,t=l.length}u=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function g(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new p(e,t)),1!==l.length||c||o(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},"./node_modules/readable-stream/duplex-browser.js":function(e,t,n){e.exports=n("./node_modules/readable-stream/lib/_stream_duplex.js")},"./node_modules/readable-stream/lib/_stream_duplex.js":function(e,t,n){var r=n("./node_modules/process-nextick-args/index.js"),i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=d;var a=n("./node_modules/core-util-is/lib/util.js");a.inherits=n("./node_modules/inherits/inherits_browser.js");var s=n("./node_modules/readable-stream/lib/_stream_readable.js"),o=n("./node_modules/readable-stream/lib/_stream_writable.js");a.inherits(d,s);for(var u=i(o.prototype),l=0;l<u.length;l++){var c=u[l];d.prototype[c]||(d.prototype[c]=o.prototype[c])}function d(e){if(!(this instanceof d))return new d(e);s.call(this,e),o.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",f)}function f(){this.allowHalfOpen||this._writableState.ended||r.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(d.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),d.prototype._destroy=function(e,t){this.push(null),this.end(),r.nextTick(t,e)}},"./node_modules/readable-stream/lib/_stream_passthrough.js":function(e,t,n){e.exports=a;var r=n("./node_modules/readable-stream/lib/_stream_transform.js"),i=n("./node_modules/core-util-is/lib/util.js");function a(e){if(!(this instanceof a))return new a(e);r.call(this,e)}i.inherits=n("./node_modules/inherits/inherits_browser.js"),i.inherits(a,r),a.prototype._transform=function(e,t,n){n(null,e)}},"./node_modules/readable-stream/lib/_stream_readable.js":function(e,t,n){(function(t,r){var i=n("./node_modules/process-nextick-args/index.js");e.exports=_;var a,s=n("./node_modules/isarray/index.js");_.ReadableState=v,n("./node_modules/node-libs-browser/node_modules/events/events.js").EventEmitter;var o=function(e,t){return e.listeners(t).length},u=n("./node_modules/readable-stream/lib/internal/streams/stream-browser.js"),l=n("./node_modules/safe-buffer/index.js").Buffer,c=t.Uint8Array||function(){},d=n("./node_modules/core-util-is/lib/util.js");d.inherits=n("./node_modules/inherits/inherits_browser.js");var f=n(0),h=void 0;h=f&&f.debuglog?f.debuglog("stream"):function(){};var p,g=n("./node_modules/readable-stream/lib/internal/streams/BufferList.js"),m=n("./node_modules/readable-stream/lib/internal/streams/destroy.js");d.inherits(_,u);var y=["error","close","destroy","pause","resume"];function v(e,t){e=e||{};var r=t instanceof(a=a||n("./node_modules/readable-stream/lib/_stream_duplex.js"));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,s=e.readableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(s||0===s)?s:o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=n("./node_modules/string_decoder/lib/string_decoder.js").StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function _(e){if(a=a||n("./node_modules/readable-stream/lib/_stream_duplex.js"),!(this instanceof _))return new _(e);this._readableState=new v(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function T(e,t,n,r,i){var a,s=e._readableState;return null===t?(s.reading=!1,function(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,w(e)}}(e,s)):(i||(a=function(e,t){var n,r;return r=t,l.isBuffer(r)||r instanceof c||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}(s,t)),a?e.emit("error",a):s.objectMode||t&&t.length>0?("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),r?s.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):b(e,s,t,!0):s.ended?e.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!n?(t=s.decoder.write(t),s.objectMode||0!==t.length?b(e,s,t,!1):I(e,s)):b(e,s,t,!1))):r||(s.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(s)}function b(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&w(e)),I(e,t)}Object.defineProperty(_.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),_.prototype.destroy=m.destroy,_.prototype._undestroy=m.undestroy,_.prototype._destroy=function(e,t){this.push(null),t(e)},_.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=l.from(e,t),t=""),n=!0),T(this,e,t,!1,n)},_.prototype.unshift=function(e){return T(this,e,null,!0,!1)},_.prototype.isPaused=function(){return!1===this._readableState.flowing},_.prototype.setEncoding=function(e){return p||(p=n("./node_modules/string_decoder/lib/string_decoder.js").StringDecoder),this._readableState.decoder=new p(e),this._readableState.encoding=e,this};var E=8388608;function S(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=E?e=E:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function w(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(A,e):A(e))}function A(e){h("emit readable"),e.emit("readable"),x(e)}function I(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(C,e,t))}function C(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(h("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function R(e){h("readable nexttick read 0"),e.read(0)}function D(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),x(e),t.flowing&&!t.reading&&e.read(0)}function x(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&null!==e.read(););}function N(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;return e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?function(e,t){var n=t.head,r=1,i=n.data;for(e-=i.length;n=n.next;){var a=n.data,s=e>a.length?a.length:e;if(s===a.length?i+=a:i+=a.slice(0,e),0==(e-=s)){s===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(s));break}++r}return t.length-=r,i}(e,t):function(e,t){var n=l.allocUnsafe(e),r=t.head,i=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var a=r.data,s=e>a.length?a.length:e;if(a.copy(n,n.length-e,0,s),0==(e-=s)){s===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(s));break}++i}return t.length-=i,n}(e,t),r}(e,t.buffer,t.decoder),n);var n}function O(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(P,t,e))}function P(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function M(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}_.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):w(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&O(this),null;var r,i=t.needReadable;return h("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",i=!0),t.ended||t.reading?h("reading or ended",i=!1):i&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=S(n,t))),null===(r=e>0?N(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&O(this)),null!==r&&this.emit("data",r),r},_.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},_.prototype.pipe=function(e,t){var n=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,h("pipe count=%d opts=%j",a.pipesCount,t);var u=t&&!1===t.end||e===r.stdout||e===r.stderr?_:c;function l(t,r){h("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,h("cleanup"),e.removeListener("close",y),e.removeListener("finish",v),e.removeListener("drain",d),e.removeListener("error",m),e.removeListener("unpipe",l),n.removeListener("end",c),n.removeListener("end",_),n.removeListener("data",g),f=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||d())}function c(){h("onend"),e.end()}a.endEmitted?i.nextTick(u):n.once("end",u),e.on("unpipe",l);var d=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,x(e))}}(n);e.on("drain",d);var f=!1,p=!1;function g(t){h("ondata"),p=!1,!1!==e.write(t)||p||((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==M(a.pipes,e))&&!f&&(h("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,p=!0),n.pause())}function m(t){h("onerror",t),_(),e.removeListener("error",m),0===o(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",v),_()}function v(){h("onfinish"),e.removeListener("close",y),_()}function _(){h("unpipe"),n.unpipe(e)}return n.on("data",g),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?s(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",m),e.once("close",y),e.once("finish",v),e.emit("pipe",n),a.flowing||(h("pipe resume"),n.resume()),e},_.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)r[a].emit("unpipe",this,n);return this}var s=M(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},_.prototype.on=function(e,t){var n=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&w(this):i.nextTick(R,this))}return n},_.prototype.addListener=_.prototype.on,_.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(D,e,t))}(this,e)),this},_.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this},_.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",(function(){if(h("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){h("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i||(n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a<y.length;a++)e.on(y[a],this.emit.bind(this,y[a]));return this._read=function(t){h("wrapped _read",t),r&&(r=!1,e.resume())},this},Object.defineProperty(_.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),_._fromList=N}).call(this,n("./node_modules/webpack/buildin/global.js"),n("./node_modules/process/browser.js"))},"./node_modules/readable-stream/lib/_stream_transform.js":function(e,t,n){e.exports=s;var r=n("./node_modules/readable-stream/lib/_stream_duplex.js"),i=n("./node_modules/core-util-is/lib/util.js");function a(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function s(e){if(!(this instanceof s))return new s(e);r.call(this,e),this._transformState={afterTransform:a.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",o)}function o(){var e=this;"function"==typeof this._flush?this._flush((function(t,n){u(e,t,n)})):u(this,null,null)}function u(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=n("./node_modules/inherits/inherits_browser.js"),i.inherits(s,r),s.prototype.push=function(e,t){return this._transformState.needTransform=!1,r.prototype.push.call(this,e,t)},s.prototype._transform=function(e,t,n){throw new Error("_transform() is not implemented")},s.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},s.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},s.prototype._destroy=function(e,t){var n=this;r.prototype._destroy.call(this,e,(function(e){t(e),n.emit("close")}))}},"./node_modules/readable-stream/lib/_stream_writable.js":function(e,t,n){(function(t,r,i){var a=n("./node_modules/process-nextick-args/index.js");function s(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=v;var o,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:a.nextTick;v.WritableState=y;var l=n("./node_modules/core-util-is/lib/util.js");l.inherits=n("./node_modules/inherits/inherits_browser.js");var c,d={deprecate:n("./node_modules/util-deprecate/browser.js")},f=n("./node_modules/readable-stream/lib/internal/streams/stream-browser.js"),h=n("./node_modules/safe-buffer/index.js").Buffer,p=i.Uint8Array||function(){},g=n("./node_modules/readable-stream/lib/internal/streams/destroy.js");function m(){}function y(e,t){o=o||n("./node_modules/readable-stream/lib/_stream_duplex.js"),e=e||{};var r=t instanceof o;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,l=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(l||0===l)?l:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var d=!1===e.decodeStrings;this.decodeStrings=!d,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(a.nextTick(i,r),a.nextTick(w,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(i(r),e._writableState.errorEmitted=!0,e.emit("error",r),w(e,t))}(e,n,r,t,i);else{var s=E(n);s||n.corked||n.bufferProcessing||!n.bufferedRequest||b(e,n),r?u(T,e,n,s,i):T(e,n,s,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function v(e){if(o=o||n("./node_modules/readable-stream/lib/_stream_duplex.js"),!(c.call(v,this)||this instanceof o))return new v(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),f.call(this)}function _(e,t,n,r,i,a,s){t.writelen=r,t.writecb=s,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function T(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),w(e,t)}function b(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),a=t.corkedRequestsFree;a.entry=n;for(var o=0,u=!0;n;)i[o]=n,n.isBuf||(u=!1),n=n.next,o+=1;i.allBuffers=u,_(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new s(t),t.bufferedRequestCount=0}else{for(;n;){var l=n.chunk,c=n.encoding,d=n.callback;if(_(e,t,!1,t.objectMode?1:l.length,l,c,d),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function S(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),w(e,t)}))}function w(e,t){var n=E(t);return n&&(function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,a.nextTick(S,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}l.inherits(v,f),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:d.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(c=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(e){return!!c.call(this,e)||this===v&&e&&e._writableState instanceof y}})):c=function(e){return e instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(e,t,n){var r,i=this._writableState,s=!1,o=!i.objectMode&&(r=e,h.isBuffer(r)||r instanceof p);return o&&!h.isBuffer(e)&&(e=function(e){return h.from(e)}(e)),"function"==typeof t&&(n=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=m),i.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),a.nextTick(t,n)}(this,n):(o||function(e,t,n,r){var i=!0,s=!1;return null===n?s=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(e.emit("error",s),a.nextTick(r,s),i=!1),i}(this,i,e,n))&&(i.pendingcb++,s=function(e,t,n,r,i,a){if(!n){var s=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=h.from(t,n)),t}(t,r,i);r!==s&&(n=!0,i="buffer",r=s)}var o=t.objectMode?1:r.length;t.length+=o;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:a,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else _(e,t,!1,o,r,i,a);return u}(this,i,o,e,t,n)),s},v.prototype.cork=function(){this._writableState.corked++},v.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||b(this,e))},v.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,w(e,t),n&&(t.finished?a.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),v.prototype.destroy=g.destroy,v.prototype._undestroy=g.undestroy,v.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n("./node_modules/process/browser.js"),n("./node_modules/node-libs-browser/node_modules/timers-browserify/main.js").setImmediate,n("./node_modules/webpack/buildin/global.js"))},"./node_modules/readable-stream/lib/internal/streams/BufferList.js":function(e,t,n){var r=n("./node_modules/safe-buffer/index.js").Buffer,i=n(1);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,i=r.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=i,n=s,a.data.copy(t,n),s+=a.data.length,a=a.next;return i},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},"./node_modules/readable-stream/lib/internal/streams/destroy.js":function(e,t,n){var r=n("./node_modules/process-nextick-args/index.js");function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this,a=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return a||s?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(r.nextTick(i,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},"./node_modules/readable-stream/lib/internal/streams/stream-browser.js":function(e,t,n){e.exports=n("./node_modules/node-libs-browser/node_modules/events/events.js").EventEmitter},"./node_modules/readable-stream/passthrough.js":function(e,t,n){e.exports=n("./node_modules/readable-stream/readable-browser.js").PassThrough},"./node_modules/readable-stream/readable-browser.js":function(e,t,n){(t=e.exports=n("./node_modules/readable-stream/lib/_stream_readable.js")).Stream=t,t.Readable=t,t.Writable=n("./node_modules/readable-stream/lib/_stream_writable.js"),t.Duplex=n("./node_modules/readable-stream/lib/_stream_duplex.js"),t.Transform=n("./node_modules/readable-stream/lib/_stream_transform.js"),t.PassThrough=n("./node_modules/readable-stream/lib/_stream_passthrough.js")},"./node_modules/readable-stream/transform.js":function(e,t,n){e.exports=n("./node_modules/readable-stream/readable-browser.js").Transform},"./node_modules/readable-stream/writable-browser.js":function(e,t,n){e.exports=n("./node_modules/readable-stream/lib/_stream_writable.js")},"./node_modules/safe-buffer/index.js":function(e,t,n){var r=n("./node_modules/node-libs-browser/node_modules/buffer/index.js"),i=r.Buffer;function a(e,t){for(var n in e)t[n]=e[n]}function s(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(a(r,t),t.Buffer=s),a(i,s),s.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},s.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},"./node_modules/sax/lib/sax.js":function(e,t,n){(function(e){!function(t){t.parser=function(e,t){return new a(e,t)},t.SAXParser=a,t.SAXStream=o,t.createStream=function(e,t){return new o(e,t)},t.MAX_BUFFER_LENGTH=65536;var r,i=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function a(e,n){if(!(this instanceof a))return new a(e,n);var r=this;!function(e){for(var t=0,n=i.length;t<n;t++)e[i[t]]=""}(r),r.q=r.c="",r.bufferCheckPosition=t.MAX_BUFFER_LENGTH,r.opt=n||{},r.opt.lowercase=r.opt.lowercase||r.opt.lowercasetags,r.looseCase=r.opt.lowercase?"toLowerCase":"toUpperCase",r.tags=[],r.closed=r.closedRoot=r.sawRoot=!1,r.tag=r.error=null,r.strict=!!e,r.noscript=!(!e&&!r.opt.noscript),r.state=R.BEGIN,r.strictEntities=r.opt.strictEntities,r.ENTITIES=r.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),r.attribList=[],r.opt.xmlns&&(r.ns=Object.create(y)),r.trackPosition=!1!==r.opt.position,r.trackPosition&&(r.position=r.line=r.column=0),x(r,"onready")}t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(e){function t(){}return t.prototype=e,new t}),Object.keys||(Object.keys=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}),a.prototype={end:function(){k(this)},write:function(e){var n=this;if(this.error)throw this.error;if(n.closed)return M(n,"Cannot write after close. Assign an onready handler.");if(null===e)return k(n);"object"==typeof e&&(e=e.toString());for(var r=0,a="";a=V(e,r++),n.c=a,a;)switch(n.trackPosition&&(n.position++,"\n"===a?(n.line++,n.column=0):n.column++),n.state){case R.BEGIN:if(n.state=R.BEGIN_WHITESPACE,"\ufeff"===a)continue;G(n,a);continue;case R.BEGIN_WHITESPACE:G(n,a);continue;case R.TEXT:if(n.sawRoot&&!n.closedRoot){for(var s=r-1;a&&"<"!==a&&"&"!==a;)(a=V(e,r++))&&n.trackPosition&&(n.position++,"\n"===a?(n.line++,n.column=0):n.column++);n.textNode+=e.substring(s,r-1)}"<"!==a||n.sawRoot&&n.closedRoot&&!n.strict?(!w(u,a)||n.sawRoot&&!n.closedRoot||L(n,"Text data outside of root node."),"&"===a?n.state=R.TEXT_ENTITY:n.textNode+=a):(n.state=R.OPEN_WAKA,n.startTagPosition=n.position);continue;case R.SCRIPT:"<"===a?n.state=R.SCRIPT_ENDING:n.script+=a;continue;case R.SCRIPT_ENDING:"/"===a?n.state=R.CLOSE_TAG:(n.script+="<"+a,n.state=R.SCRIPT);continue;case R.OPEN_WAKA:if("!"===a)n.state=R.SGML_DECL,n.sgmlDecl="";else if(S(u,a));else if(S(v,a))n.state=R.OPEN_TAG,n.tagName=a;else if("/"===a)n.state=R.CLOSE_TAG,n.tagName="";else if("?"===a)n.state=R.PROC_INST,n.procInstName=n.procInstBody="";else{if(L(n,"Unencoded <"),n.startTagPosition+1<n.position){var o=n.position-n.startTagPosition;a=new Array(o).join(" ")+a}n.textNode+="<"+a,n.state=R.TEXT}continue;case R.SGML_DECL:(n.sgmlDecl+a).toUpperCase()===h?(N(n,"onopencdata"),n.state=R.CDATA,n.sgmlDecl="",n.cdata=""):n.sgmlDecl+a==="--"?(n.state=R.COMMENT,n.comment="",n.sgmlDecl=""):(n.sgmlDecl+a).toUpperCase()===p?(n.state=R.DOCTYPE,(n.doctype||n.sawRoot)&&L(n,"Inappropriately located doctype declaration"),n.doctype="",n.sgmlDecl=""):">"===a?(N(n,"onsgmldeclaration",n.sgmlDecl),n.sgmlDecl="",n.state=R.TEXT):S(d,a)?(n.state=R.SGML_DECL_QUOTED,n.sgmlDecl+=a):n.sgmlDecl+=a;continue;case R.SGML_DECL_QUOTED:a===n.q&&(n.state=R.SGML_DECL,n.q=""),n.sgmlDecl+=a;continue;case R.DOCTYPE:">"===a?(n.state=R.TEXT,N(n,"ondoctype",n.doctype),n.doctype=!0):(n.doctype+=a,"["===a?n.state=R.DOCTYPE_DTD:S(d,a)&&(n.state=R.DOCTYPE_QUOTED,n.q=a));continue;case R.DOCTYPE_QUOTED:n.doctype+=a,a===n.q&&(n.q="",n.state=R.DOCTYPE);continue;case R.DOCTYPE_DTD:n.doctype+=a,"]"===a?n.state=R.DOCTYPE:S(d,a)&&(n.state=R.DOCTYPE_DTD_QUOTED,n.q=a);continue;case R.DOCTYPE_DTD_QUOTED:n.doctype+=a,a===n.q&&(n.state=R.DOCTYPE_DTD,n.q="");continue;case R.COMMENT:"-"===a?n.state=R.COMMENT_ENDING:n.comment+=a;continue;case R.COMMENT_ENDING:"-"===a?(n.state=R.COMMENT_ENDED,n.comment=P(n.opt,n.comment),n.comment&&N(n,"oncomment",n.comment),n.comment=""):(n.comment+="-"+a,n.state=R.COMMENT);continue;case R.COMMENT_ENDED:">"!==a?(L(n,"Malformed comment"),n.comment+="--"+a,n.state=R.COMMENT):n.state=R.TEXT;continue;case R.CDATA:"]"===a?n.state=R.CDATA_ENDING:n.cdata+=a;continue;case R.CDATA_ENDING:"]"===a?n.state=R.CDATA_ENDING_2:(n.cdata+="]"+a,n.state=R.CDATA);continue;case R.CDATA_ENDING_2:">"===a?(n.cdata&&N(n,"oncdata",n.cdata),N(n,"onclosecdata"),n.cdata="",n.state=R.TEXT):"]"===a?n.cdata+="]":(n.cdata+="]]"+a,n.state=R.CDATA);continue;case R.PROC_INST:"?"===a?n.state=R.PROC_INST_ENDING:S(u,a)?n.state=R.PROC_INST_BODY:n.procInstName+=a;continue;case R.PROC_INST_BODY:if(!n.procInstBody&&S(u,a))continue;"?"===a?n.state=R.PROC_INST_ENDING:n.procInstBody+=a;continue;case R.PROC_INST_ENDING:">"===a?(N(n,"onprocessinginstruction",{name:n.procInstName,body:n.procInstBody}),n.procInstName=n.procInstBody="",n.state=R.TEXT):(n.procInstBody+="?"+a,n.state=R.PROC_INST_BODY);continue;case R.OPEN_TAG:S(_,a)?n.tagName+=a:(F(n),">"===a?j(n):"/"===a?n.state=R.OPEN_TAG_SLASH:(w(u,a)&&L(n,"Invalid character in tag name"),n.state=R.ATTRIB));continue;case R.OPEN_TAG_SLASH:">"===a?(j(n,!0),q(n)):(L(n,"Forward-slash in opening tag not followed by >"),n.state=R.ATTRIB);continue;case R.ATTRIB:if(S(u,a))continue;">"===a?j(n):"/"===a?n.state=R.OPEN_TAG_SLASH:S(v,a)?(n.attribName=a,n.attribValue="",n.state=R.ATTRIB_NAME):L(n,"Invalid attribute name");continue;case R.ATTRIB_NAME:"="===a?n.state=R.ATTRIB_VALUE:">"===a?(L(n,"Attribute without value"),n.attribValue=n.attribName,B(n),j(n)):S(u,a)?n.state=R.ATTRIB_NAME_SAW_WHITE:S(_,a)?n.attribName+=a:L(n,"Invalid attribute name");continue;case R.ATTRIB_NAME_SAW_WHITE:if("="===a)n.state=R.ATTRIB_VALUE;else{if(S(u,a))continue;L(n,"Attribute without value"),n.tag.attributes[n.attribName]="",n.attribValue="",N(n,"onattribute",{name:n.attribName,value:""}),n.attribName="",">"===a?j(n):S(v,a)?(n.attribName=a,n.state=R.ATTRIB_NAME):(L(n,"Invalid attribute name"),n.state=R.ATTRIB)}continue;case R.ATTRIB_VALUE:if(S(u,a))continue;S(d,a)?(n.q=a,n.state=R.ATTRIB_VALUE_QUOTED):(L(n,"Unquoted attribute value"),n.state=R.ATTRIB_VALUE_UNQUOTED,n.attribValue=a);continue;case R.ATTRIB_VALUE_QUOTED:if(a!==n.q){"&"===a?n.state=R.ATTRIB_VALUE_ENTITY_Q:n.attribValue+=a;continue}B(n),n.q="",n.state=R.ATTRIB_VALUE_CLOSED;continue;case R.ATTRIB_VALUE_CLOSED:S(u,a)?n.state=R.ATTRIB:">"===a?j(n):"/"===a?n.state=R.OPEN_TAG_SLASH:S(v,a)?(L(n,"No whitespace between attributes"),n.attribName=a,n.attribValue="",n.state=R.ATTRIB_NAME):L(n,"Invalid attribute name");continue;case R.ATTRIB_VALUE_UNQUOTED:if(w(f,a)){"&"===a?n.state=R.ATTRIB_VALUE_ENTITY_U:n.attribValue+=a;continue}B(n),">"===a?j(n):n.state=R.ATTRIB;continue;case R.CLOSE_TAG:if(n.tagName)">"===a?q(n):S(_,a)?n.tagName+=a:n.script?(n.script+="</"+n.tagName,n.tagName="",n.state=R.SCRIPT):(w(u,a)&&L(n,"Invalid tagname in closing tag"),n.state=R.CLOSE_TAG_SAW_WHITE);else{if(S(u,a))continue;w(v,a)?n.script?(n.script+="</"+a,n.state=R.SCRIPT):L(n,"Invalid tagname in closing tag."):n.tagName=a}continue;case R.CLOSE_TAG_SAW_WHITE:if(S(u,a))continue;">"===a?q(n):L(n,"Invalid characters in closing tag");continue;case R.TEXT_ENTITY:case R.ATTRIB_VALUE_ENTITY_Q:case R.ATTRIB_VALUE_ENTITY_U:var l,c;switch(n.state){case R.TEXT_ENTITY:l=R.TEXT,c="textNode";break;case R.ATTRIB_VALUE_ENTITY_Q:l=R.ATTRIB_VALUE_QUOTED,c="attribValue";break;case R.ATTRIB_VALUE_ENTITY_U:l=R.ATTRIB_VALUE_UNQUOTED,c="attribValue"}";"===a?(n[c]+=H(n),n.entity="",n.state=l):S(n.entity.length?b:T,a)?n.entity+=a:(L(n,"Invalid character in entity name"),n[c]+="&"+n.entity+a,n.entity="",n.state=l);continue;default:throw new Error(n,"Unknown state: "+n.state)}return n.position>=n.bufferCheckPosition&&function(e){for(var n=Math.max(t.MAX_BUFFER_LENGTH,10),r=0,a=0,s=i.length;a<s;a++){var o=e[i[a]].length;if(o>n)switch(i[a]){case"textNode":O(e);break;case"cdata":N(e,"oncdata",e.cdata),e.cdata="";break;case"script":N(e,"onscript",e.script),e.script="";break;default:M(e,"Max buffer length exceeded: "+i[a])}r=Math.max(r,o)}var u=t.MAX_BUFFER_LENGTH-r;e.bufferCheckPosition=u+e.position}(n),n},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var e;O(e=this),""!==e.cdata&&(N(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(N(e,"onscript",e.script),e.script="")}};try{r=n("./node_modules/stream-browserify/index.js").Stream}catch(e){r=function(){}}var s=t.EVENTS.filter((function(e){return"error"!==e&&"end"!==e}));function o(e,t){if(!(this instanceof o))return new o(e,t);r.apply(this),this._parser=new a(e,t),this.writable=!0,this.readable=!0;var n=this;this._parser.onend=function(){n.emit("end")},this._parser.onerror=function(e){n.emit("error",e),n._parser.error=null},this._decoder=null,s.forEach((function(e){Object.defineProperty(n,"on"+e,{get:function(){return n._parser["on"+e]},set:function(t){if(!t)return n.removeAllListeners(e),n._parser["on"+e]=t,t;n.on(e,t)},enumerable:!0,configurable:!1})}))}o.prototype=Object.create(r.prototype,{constructor:{value:o}}),o.prototype.write=function(t){if("function"==typeof e&&"function"==typeof e.isBuffer&&e.isBuffer(t)){if(!this._decoder){var r=n("./node_modules/string_decoder/lib/string_decoder.js").StringDecoder;this._decoder=new r("utf8")}t=this._decoder.write(t)}return this._parser.write(t.toString()),this.emit("data",t),!0},o.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},o.prototype.on=function(e,t){var n=this;return n._parser["on"+e]||-1===s.indexOf(e)||(n._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),n.emit.apply(n,t)}),r.prototype.on.call(n,e,t)};var u="\r\n\t ",l="0124356789",c="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",d="'\"",f=u+">",h="[CDATA[",p="DOCTYPE",g="http://www.w3.org/XML/1998/namespace",m="http://www.w3.org/2000/xmlns/",y={xml:g,xmlns:m};u=E(u),l=E(l),c=E(c);var v=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,_=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/,T=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,b=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;function E(e){return e.split("").reduce((function(e,t){return e[t]=!0,e}),{})}function S(e,t){return function(e){return"[object RegExp]"===Object.prototype.toString.call(e)}(e)?!!t.match(e):e[t]}function w(e,t){return!S(e,t)}d=E(d),f=E(f);var A,I,C,R=0;for(var D in t.STATE={BEGIN:R++,BEGIN_WHITESPACE:R++,TEXT:R++,TEXT_ENTITY:R++,OPEN_WAKA:R++,SGML_DECL:R++,SGML_DECL_QUOTED:R++,DOCTYPE:R++,DOCTYPE_QUOTED:R++,DOCTYPE_DTD:R++,DOCTYPE_DTD_QUOTED:R++,COMMENT_STARTING:R++,COMMENT:R++,COMMENT_ENDING:R++,COMMENT_ENDED:R++,CDATA:R++,CDATA_ENDING:R++,CDATA_ENDING_2:R++,PROC_INST:R++,PROC_INST_BODY:R++,PROC_INST_ENDING:R++,OPEN_TAG:R++,OPEN_TAG_SLASH:R++,ATTRIB:R++,ATTRIB_NAME:R++,ATTRIB_NAME_SAW_WHITE:R++,ATTRIB_VALUE:R++,ATTRIB_VALUE_QUOTED:R++,ATTRIB_VALUE_CLOSED:R++,ATTRIB_VALUE_UNQUOTED:R++,ATTRIB_VALUE_ENTITY_Q:R++,ATTRIB_VALUE_ENTITY_U:R++,CLOSE_TAG:R++,CLOSE_TAG_SAW_WHITE:R++,SCRIPT:R++,SCRIPT_ENDING:R++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach((function(e){var n=t.ENTITIES[e],r="number"==typeof n?String.fromCharCode(n):n;t.ENTITIES[e]=r})),t.STATE)t.STATE[t.STATE[D]]=D;function x(e,t,n){e[t]&&e[t](n)}function N(e,t,n){e.textNode&&O(e),x(e,t,n)}function O(e){e.textNode=P(e.opt,e.textNode),e.textNode&&x(e,"ontext",e.textNode),e.textNode=""}function P(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function M(e,t){return O(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,x(e,"onerror",t),e}function k(e){return e.sawRoot&&!e.closedRoot&&L(e,"Unclosed root tag"),e.state!==R.BEGIN&&e.state!==R.BEGIN_WHITESPACE&&e.state!==R.TEXT&&M(e,"Unexpected end"),O(e),e.c="",e.closed=!0,x(e,"onend"),a.call(e,e.strict,e.opt),e}function L(e,t){if("object"!=typeof e||!(e instanceof a))throw new Error("bad call to strictFail");e.strict&&M(e,t)}function F(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0,N(e,"onopentagstart",n)}function U(e,t){var n=e.indexOf(":")<0?["",e]:e.split(":"),r=n[0],i=n[1];return t&&"xmlns"===e&&(r="xmlns",i=""),{prefix:r,local:i}}function B(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=U(e.attribName,!0),n=t.prefix,r=t.local;if("xmlns"===n)if("xml"===r&&e.attribValue!==g)L(e,"xml: prefix must be bound to "+g+"\nActual: "+e.attribValue);else if("xmlns"===r&&e.attribValue!==m)L(e,"xmlns: prefix must be bound to "+m+"\nActual: "+e.attribValue);else{var i=e.tag,a=e.tags[e.tags.length-1]||e;i.ns===a.ns&&(i.ns=Object.create(a.ns)),i.ns[r]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,N(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function j(e,t){if(e.opt.xmlns){var n=e.tag,r=U(e.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(L(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),n.uri=r.prefix);var i=e.tags[e.tags.length-1]||e;n.ns&&i.ns!==n.ns&&Object.keys(n.ns).forEach((function(t){N(e,"onopennamespace",{prefix:t,uri:n.ns[t]})}));for(var a=0,s=e.attribList.length;a<s;a++){var o=e.attribList[a],u=o[0],l=o[1],c=U(u,!0),d=c.prefix,f=c.local,h=""===d?"":n.ns[d]||"",p={name:u,value:l,prefix:d,local:f,uri:h};d&&"xmlns"!==d&&!h&&(L(e,"Unbound namespace prefix: "+JSON.stringify(d)),p.uri=d),e.tag.attributes[u]=p,N(e,"onattribute",p)}e.attribList.length=0}e.tag.isSelfClosing=!!t,e.sawRoot=!0,e.tags.push(e.tag),N(e,"onopentag",e.tag),t||(e.noscript||"script"!==e.tagName.toLowerCase()?e.state=R.TEXT:e.state=R.SCRIPT,e.tag=null,e.tagName=""),e.attribName=e.attribValue="",e.attribList.length=0}function q(e){if(!e.tagName)return L(e,"Weird empty close tag."),e.textNode+="</>",void(e.state=R.TEXT);if(e.script){if("script"!==e.tagName)return e.script+="</"+e.tagName+">",e.tagName="",void(e.state=R.SCRIPT);N(e,"onscript",e.script),e.script=""}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var r=n;t--&&e.tags[t].name!==r;)L(e,"Unexpected close tag");if(t<0)return L(e,"Unmatched closing tag: "+e.tagName),e.textNode+="</"+e.tagName+">",void(e.state=R.TEXT);e.tagName=n;for(var i=e.tags.length;i-- >t;){var a=e.tag=e.tags.pop();e.tagName=e.tag.name,N(e,"onclosetag",e.tagName);var s={};for(var o in a.ns)s[o]=a.ns[o];var u=e.tags[e.tags.length-1]||e;e.opt.xmlns&&a.ns!==u.ns&&Object.keys(a.ns).forEach((function(t){var n=a.ns[t];N(e,"onclosenamespace",{prefix:t,uri:n})}))}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=R.TEXT}function H(e){var t,n=e.entity,r=n.toLowerCase(),i="";return e.ENTITIES[n]?e.ENTITIES[n]:e.ENTITIES[r]?e.ENTITIES[r]:("#"===(n=r).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),i=(t=parseInt(n,16)).toString(16)):(n=n.slice(1),i=(t=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),i.toLowerCase()!==n?(L(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function G(e,t){"<"===t?(e.state=R.OPEN_WAKA,e.startTagPosition=e.position):w(u,t)&&(L(e,"Non-whitespace before first tag."),e.textNode=t,e.state=R.TEXT)}function V(e,t){var n="";return t<e.length&&(n=e.charAt(t)),n}R=t.STATE,String.fromCodePoint||(A=String.fromCharCode,I=Math.floor,C=function(){var e,t,n=[],r=-1,i=arguments.length;if(!i)return"";for(var a="";++r<i;){var s=Number(arguments[r]);if(!isFinite(s)||s<0||s>1114111||I(s)!==s)throw RangeError("Invalid code point: "+s);s<=65535?n.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,n.push(e,t)),(r+1===i||n.length>16384)&&(a+=A.apply(null,n),n.length=0)}return a},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:C,configurable:!0,writable:!0}):String.fromCodePoint=C)}(t)}).call(this,n("./node_modules/node-libs-browser/node_modules/buffer/index.js").Buffer)},"./node_modules/setimmediate/setImmediate.js":function(e,t,n){(function(e,t){!function(e,n){if(!e.setImmediate){var r,i,a,s,o,u=1,l={},c=!1,d=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){p(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(s="setImmediate$"+Math.random()+"$",o=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&p(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",o,!1):e.attachEvent("onmessage",o),r=function(t){e.postMessage(s+t,"*")}):e.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){p(e.data)},r=function(e){a.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(i=d.documentElement,r=function(e){var t=d.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(p,0,e)},f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return l[u]=i,r(u),u++},f.clearImmediate=h}function h(e){delete l[e]}function p(e){if(c)setTimeout(p,0,e);else{var t=l[e];if(t){c=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}(t)}finally{h(e),c=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n("./node_modules/webpack/buildin/global.js"),n("./node_modules/process/browser.js"))},"./node_modules/stream-browserify/index.js":function(e,t,n){e.exports=i;var r=n("./node_modules/node-libs-browser/node_modules/events/events.js").EventEmitter;function i(){r.call(this)}n("./node_modules/inherits/inherits_browser.js")(i,r),i.Readable=n("./node_modules/readable-stream/readable-browser.js"),i.Writable=n("./node_modules/readable-stream/writable-browser.js"),i.Duplex=n("./node_modules/readable-stream/duplex-browser.js"),i.Transform=n("./node_modules/readable-stream/transform.js"),i.PassThrough=n("./node_modules/readable-stream/passthrough.js"),i.Stream=i,i.prototype.pipe=function(e,t){var n=this;function i(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function a(){n.readable&&n.resume&&n.resume()}n.on("data",i),e.on("drain",a),e._isStdio||t&&!1===t.end||(n.on("end",o),n.on("close",u));var s=!1;function o(){s||(s=!0,e.end())}function u(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(c(),0===r.listenerCount(this,"error"))throw e}function c(){n.removeListener("data",i),e.removeListener("drain",a),n.removeListener("end",o),n.removeListener("close",u),n.removeListener("error",l),e.removeListener("error",l),n.removeListener("end",c),n.removeListener("close",c),e.removeListener("close",c)}return n.on("error",l),e.on("error",l),n.on("end",c),n.on("close",c),e.on("close",c),e.emit("pipe",n),e}},"./node_modules/string_decoder/lib/string_decoder.js":function(e,t,n){var r=n("./node_modules/safe-buffer/index.js").Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=l,t=4;break;case"utf8":this.fillLast=o,t=4;break;case"base64":this.text=c,this.end=d,t=3;break;default:return this.write=f,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function c(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},a.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},a.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=s(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||-2===i?0:(i=s(t[r]))>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||-2===i?0:(i=s(t[r]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},"./node_modules/util-deprecate/browser.js":function(e,t,n){(function(t){function n(e){try{if(!t.localStorage)return!1}catch(e){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,n("./node_modules/webpack/buildin/global.js"))},"./node_modules/webpack/buildin/global.js":function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},"./src/core/Debug.js":function(e,t,n){n.r(t);var r=n("./src/core/EventBus.js"),i=n("./src/core/events/Events.js"),a=n("./src/core/FactoryMaker.js"),s=1,o=2,u=3,l=4,c=5;function d(e){e=e||{};var t,n,a,d,f=this.context,h=Object(r.default)(f).getInstance(),p=e.settings,g=[];function m(e){return e&&e.bind?e.bind(window.console):window.console.log.bind(window.console)}function y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];E.apply(void 0,[s,this].concat(t))}function v(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];E.apply(void 0,[o,this].concat(t))}function _(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];E.apply(void 0,[u,this].concat(t))}function T(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];E.apply(void 0,[l,this].concat(t))}function b(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];E.apply(void 0,[c,this].concat(t))}function E(e,t){var r="",s=null;n&&(s=(new Date).getTime(),r+="["+(s-d)+"]"),a&&t&&t.getClassName&&(r+="["+t.getClassName()+"]",t.getType&&(r+="["+t.getType()+"]")),r.length>0&&(r+=" ");for(var o=arguments.length,u=new Array(o>2?o-2:0),l=2;l<o;l++)u[l-2]=arguments[l];Array.apply(null,u).forEach((function(e){r+=e+" "})),g[e]&&p.get().debug.logLevel>=e&&g[e](r),p&&p.get().debug.dispatchEvent&&h.trigger(i.default.LOG,{message:r,level:e})}return t={getLogger:function(e){return{fatal:y.bind(e),error:v.bind(e),warn:_.bind(e),info:T.bind(e),debug:b.bind(e)}},setLogTimestampVisible:function(e){n=e},setCalleeNameVisible:function(e){a=e}},n=!0,a=!0,d=(new Date).getTime(),"undefined"!=typeof window&&window.console&&(g[s]=m(window.console.error),g[o]=m(window.console.error),g[u]=m(window.console.warn),g[l]=m(window.console.info),g[c]=m(window.console.debug)),t}d.__dashjs_factory_name="Debug";var f=a.default.getSingletonFactory(d);f.LOG_LEVEL_NONE=0,f.LOG_LEVEL_FATAL=s,f.LOG_LEVEL_ERROR=o,f.LOG_LEVEL_WARNING=u,f.LOG_LEVEL_INFO=l,f.LOG_LEVEL_DEBUG=c,a.default.updateSingletonFactory(d.__dashjs_factory_name,f),t.default=f},"./src/core/EventBus.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/MediaPlayerEvents.js");function a(){var e={};function t(t,n,r){var i=-1;return e[t]?(e[t].some((function(e,t){if(e&&e.callback===n&&(!r||r===e.scope))return i=t,!0})),i):i}var n={on:function(n,r,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!n)throw new Error("event type cannot be null or undefined");if(!r||"function"!=typeof r)throw new Error("listener must be a function: "+r);var s=a.priority||0;if(!(t(n,r,i)>=0)){e[n]=e[n]||[];var o={callback:r,scope:i,priority:s};i&&i.getStreamId&&(o.streamId=i.getStreamId()),i&&i.getType&&(o.mediaType=i.getType()),a&&a.mode&&(o.mode=a.mode),e[n].some((function(t,r){if(t&&s>t.priority)return e[n].splice(r,0,o),!0}))||e[n].push(o)}},off:function(n,r,i){if(n&&r&&e[n]){var a=t(n,r,i);a<0||(e[n][a]=null)}},trigger:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t&&e[t]){if((n=n||{}).hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");n.type=t,r.streamId&&(n.streamId=r.streamId),r.mediaType&&(n.mediaType=r.mediaType),e[t].filter((function(e){return!(!e||r.streamId&&e.streamId&&e.streamId!==r.streamId||r.mediaType&&e.mediaType&&e.mediaType!==r.mediaType||r.mode&&e.mode&&e.mode!==r.mode||!e.mode&&r.mode&&r.mode===i.default.EVENT_MODE_ON_RECEIVE)})).forEach((function(e){return e&&e.callback.call(e.scope,n)}))}},reset:function(){e={}}};return n}a.__dashjs_factory_name="EventBus";var s=r.default.getSingletonFactory(a);s.EVENT_PRIORITY_LOW=0,s.EVENT_PRIORITY_HIGH=5e3,r.default.updateSingletonFactory(a.__dashjs_factory_name,s),t.default=s},"./src/core/FactoryMaker.js":function(e,t,n){n.r(t);var r=function(){var e,t=[],n={},r={};function i(e,n){for(var r in t){var i=t[r];if(i.context===e&&i.name===n)return i.instance}return null}function a(e,t){return t[e]}function s(e,t,n){e in n&&(n[e]=t)}function o(t,n,r){var i,a=t.__dashjs_factory_name,s=n[a];if(s){var o=s.instance;if(!s.override)return o.apply({context:n,factory:e},r);for(var u in i=t.apply({context:n},r),o=o.apply({context:n,factory:e,parent:i},r))i.hasOwnProperty(u)&&(i[u]=o[u])}else i=t.apply({context:n},r);return i.getClassName=function(){return a},i}return e={extend:function(e,t,n,r){!r[e]&&t&&(r[e]={instance:t,override:n})},getSingletonInstance:i,setSingletonInstance:function(e,n,r){for(var i in t){var a=t[i];if(a.context===e&&a.name===n)return void(t[i].instance=r)}t.push({name:n,context:e,instance:r})},deleteSingletonInstances:function(e){t=t.filter((function(t){return t.context!==e}))},getSingletonFactory:function(e){var r=a(e.__dashjs_factory_name,n);return r||(r=function(n){var r;return void 0===n&&(n={}),{getInstance:function(){return r||(r=i(n,e.__dashjs_factory_name)),r||(r=o(e,n,arguments),t.push({name:e.__dashjs_factory_name,context:n,instance:r})),r}}},n[e.__dashjs_factory_name]=r),r},getSingletonFactoryByName:function(e){return a(e,n)},updateSingletonFactory:function(e,t){s(e,t,n)},getClassFactory:function(e){var t=a(e.__dashjs_factory_name,r);return t||(t=function(t){return void 0===t&&(t={}),{create:function(){return o(e,t,arguments)}}},r[e.__dashjs_factory_name]=t),t},getClassFactoryByName:function(e){return a(e,r)},updateClassFactory:function(e,t){s(e,t,r)}},e}();t.default=r},"./src/core/Settings.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/core/Utils.js"),a=n("./src/core/Debug.js"),s=n("./src/streaming/constants/Constants.js"),o=n("./src/streaming/vo/metrics/HTTPRequest.js");function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(){var e,t,n={debug:{logLevel:a.default.LOG_LEVEL_WARNING,dispatchEvent:!1},streaming:{abandonLoadTimeout:1e4,wallclockTimeUpdateInterval:100,lowLatencyEnabled:!1,lowLatencyEnabledByManifest:!0,manifestUpdateRetryInterval:100,cacheInitSegments:!1,eventControllerRefreshDelay:150,capabilities:{filterUnsupportedEssentialProperties:!0,useMediaCapabilitiesApi:!1},timeShiftBuffer:{calcFromSegmentTimeline:!1,fallbackToSegmentTimeline:!0},metrics:{maxListDepth:100},delay:{liveDelayFragmentCount:NaN,liveDelay:NaN,useSuggestedPresentationDelay:!0,applyServiceDescription:!0},protection:{keepProtectionMediaKeys:!1,ignoreEmeEncryptedEvent:!1},buffer:{enableSeekDecorrelationFix:!1,fastSwitchEnabled:!0,flushBufferAtTrackSwitch:!1,reuseExistingSourceBuffers:!0,bufferPruningInterval:10,bufferToKeep:20,bufferTimeAtTopQuality:30,bufferTimeAtTopQualityLongForm:60,initialBufferLevel:NaN,stableBufferTime:12,longFormContentDurationThreshold:600,stallThreshold:.3,useAppendWindow:!0,setStallState:!0},gaps:{jumpGaps:!0,jumpLargeGaps:!0,smallGapLimit:1.5,threshold:.3,enableSeekFix:!1},utcSynchronization:{enabled:!0,useManifestDateHeaderTimeSource:!0,backgroundAttempts:2,timeBetweenSyncAttempts:30,maximumTimeBetweenSyncAttempts:600,minimumTimeBetweenSyncAttempts:2,timeBetweenSyncAttemptsAdjustmentFactor:2,maximumAllowedDrift:100,enableBackgroundSyncAfterSegmentDownloadError:!0,defaultTimingSource:{scheme:"urn:mpeg:dash:utc:http-xsdate:2014",value:"https://time.akamai.com/?iso&ms"}},scheduling:{defaultTimeout:500,lowLatencyTimeout:0,scheduleWhilePaused:!0},text:{defaultEnabled:!0},liveCatchup:{minDrift:.02,maxDrift:12,playbackRate:.5,latencyThreshold:60,playbackBufferMin:.5,enabled:!1,mode:s.default.LIVE_CATCHUP_MODE_DEFAULT},lastBitrateCachingInfo:{enabled:!0,ttl:36e4},lastMediaSettingsCachingInfo:{enabled:!0,ttl:36e4},cacheLoadThresholds:{video:50,audio:5},trackSwitchMode:{audio:s.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE,video:s.default.TRACK_SWITCH_MODE_NEVER_REPLACE},selectionModeForInitialTrack:s.default.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY,fragmentRequestTimeout:0,retryIntervals:(e={},l(e,o.HTTPRequest.MPD_TYPE,500),l(e,o.HTTPRequest.XLINK_EXPANSION_TYPE,500),l(e,o.HTTPRequest.MEDIA_SEGMENT_TYPE,1e3),l(e,o.HTTPRequest.INIT_SEGMENT_TYPE,1e3),l(e,o.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,1e3),l(e,o.HTTPRequest.INDEX_SEGMENT_TYPE,1e3),l(e,o.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE,1e3),l(e,o.HTTPRequest.LICENSE,1e3),l(e,o.HTTPRequest.OTHER_TYPE,1e3),l(e,"lowLatencyReductionFactor",10),e),retryAttempts:(t={},l(t,o.HTTPRequest.MPD_TYPE,3),l(t,o.HTTPRequest.XLINK_EXPANSION_TYPE,1),l(t,o.HTTPRequest.MEDIA_SEGMENT_TYPE,3),l(t,o.HTTPRequest.INIT_SEGMENT_TYPE,3),l(t,o.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,3),l(t,o.HTTPRequest.INDEX_SEGMENT_TYPE,3),l(t,o.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE,3),l(t,o.HTTPRequest.LICENSE,3),l(t,o.HTTPRequest.OTHER_TYPE,3),l(t,"lowLatencyMultiplyFactor",5),t),abr:{movingAverageMethod:s.default.MOVING_AVERAGE_SLIDING_WINDOW,ABRStrategy:s.default.ABR_STRATEGY_DYNAMIC,additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0,abandonRequestsRule:!1},bandwidthSafetyFactor:.9,useDefaultABRRules:!0,useDeadTimeLatency:!0,limitBitrateByPortal:!1,usePixelRatioInLimitBitrateByPortal:!1,maxBitrate:{audio:-1,video:-1},minBitrate:{audio:-1,video:-1},maxRepresentationRatio:{audio:1,video:1},initialBitrate:{audio:-1,video:-1},initialRepresentationRatio:{audio:-1,video:-1},autoSwitchBitrate:{audio:!0,video:!0},fetchThroughputCalculationMode:s.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING},cmcd:{enabled:!1,sid:null,cid:null,rtp:null,rtpSafetyFactor:5,mode:s.default.CMCD_MODE_QUERY}},errors:{recoverAttempts:{mediaErrorDecode:5}}},r=i.default.clone(n);function c(e,t,n){for(var r in e)e.hasOwnProperty(r)&&t.hasOwnProperty(r)&&("object"===u(e[r])&&null!==e[r]?c(e[r],t[r],n.slice()+r+"."):t[r]=i.default.clone(e[r]))}return{get:function(){return r},update:function(e){"object"===u(e)&&c(e,r,"")},reset:function(){r=i.default.clone(n)}}}c.__dashjs_factory_name="Settings";var d=r.default.getSingletonFactory(c);t.default=d},"./src/core/Utils.js":function(e,t,n){n.r(t);var r=n("./node_modules/path-browserify/index.js"),i=n.n(r);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r;return t=e,r=[{key:"mixin",value:function(t,n,r){var i,s={};if(t)for(var o in n)n.hasOwnProperty(o)&&(i=n[o],o in t&&(t[o]===i||o in s&&s[o]===i)||("object"===a(t[o])&&null!==t[o]?t[o]=e.mixin(t[o],i,r):t[o]=r(i)));return t}},{key:"clone",value:function(t){if(!t||"object"!==a(t))return t;var n;if(t instanceof Array){n=[];for(var r=0,i=t.length;r<i;++r)r in t&&n.push(e.clone(t[r]))}else n={};return e.mixin(n,t,e.clone)}},{key:"addAditionalQueryParameterToUrl",value:function(e,t){try{if(!t||0===t.length)return e;var n=new URL(e);return t.forEach((function(e){e.key&&e.value&&n.searchParams.set(e.key,e.value)})),n.href}catch(t){return e}}},{key:"parseHttpHeaders",value:function(e){var t={};if(!e)return t;for(var n=e.trim().split("\r\n"),r=0,i=n.length;r<i;r++){var a=n[r],s=a.indexOf(": ");s>0&&(t[a.substring(0,s)]=a.substring(s+2))}return t}},{key:"generateUuid",value:function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)}))}},{key:"generateHashCode",value:function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}},{key:"getRelativeUrl",value:function(e,t){try{var n=new URL(e),r=new URL(t);if(n.protocol=r.protocol,n.origin!==r.origin)return t;var a=i.a.relative(n.pathname.substr(0,n.pathname.lastIndexOf("/")),r.pathname.substr(0,r.pathname.lastIndexOf("/"))),s=0===a.length?1:0;return a+=r.pathname.substr(r.pathname.lastIndexOf("/")+s,r.pathname.length-1),r.pathname.length<a.length?r.pathname:a}catch(e){return t}}}],(n=null)&&s(t.prototype,n),r&&s(t,r),e}();t.default=o},"./src/core/Version.js":function(e,t,n){n.r(t),n.d(t,"getVersionString",(function(){return i}));var r="4.2.0";function i(){return r}},"./src/core/errors/Errors.js":function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=s(e);if(t){var a=s(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}n.r(t);var o=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,e);var t=a(n);function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=t.call(this)).MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE=10,e.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE=11,e.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE=12,e.SEGMENT_BASE_LOADER_ERROR_CODE=15,e.TIME_SYNC_FAILED_ERROR_CODE=16,e.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE=17,e.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE=18,e.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE=19,e.APPEND_ERROR_CODE=20,e.REMOVE_ERROR_CODE=21,e.DATA_UPDATE_FAILED_ERROR_CODE=22,e.CAPABILITY_MEDIASOURCE_ERROR_CODE=23,e.CAPABILITY_MEDIAKEYS_ERROR_CODE=24,e.DOWNLOAD_ERROR_ID_MANIFEST_CODE=25,e.DOWNLOAD_ERROR_ID_SIDX_CODE=26,e.DOWNLOAD_ERROR_ID_CONTENT_CODE=27,e.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE=28,e.DOWNLOAD_ERROR_ID_XLINK_CODE=29,e.MANIFEST_ERROR_ID_PARSE_CODE=31,e.MANIFEST_ERROR_ID_NOSTREAMS_CODE=32,e.TIMED_TEXT_ERROR_ID_PARSE_CODE=33,e.MANIFEST_ERROR_ID_MULTIPLEXED_CODE=34,e.MEDIASOURCE_TYPE_UNSUPPORTED_CODE=35,e.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE="parsing failed for ",e.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading manifest: ",e.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading Xlink element: ",e.SEGMENTS_UPDATE_FAILED_ERROR_MESSAGE="Segments update failed",e.SEGMENTS_UNAVAILABLE_ERROR_MESSAGE="no segments are available yet",e.SEGMENT_BASE_LOADER_ERROR_MESSAGE="error loading segment ranges from sidx",e.TIME_SYNC_FAILED_ERROR_MESSAGE="Failed to synchronize client and server time",e.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE="request is null",e.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE="Failed to resolve a valid URL",e.APPEND_ERROR_MESSAGE="chunk is not defined",e.REMOVE_ERROR_MESSAGE="Removing data from the SourceBuffer",e.DATA_UPDATE_FAILED_ERROR_MESSAGE="Data update failed",e.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE="mediasource is not supported",e.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE="mediakeys is not supported",e.TIMED_TEXT_ERROR_MESSAGE_PARSE="parsing error :",e.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE="Error creating source buffer of type : ",e}return n}(n("./src/core/errors/ErrorsBase.js").default));t.default=o},"./src/core/errors/ErrorsBase.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,(n=[{key:"extend",value:function(e,t){if(e){var n=!!t&&t.override,r=!!t&&t.publicOnly;for(var i in e)!e.hasOwnProperty(i)||this[i]&&!n||r&&-1===e[i].indexOf("public_")||(this[i]=e[i])}}}])&&r(t.prototype,n),i&&r(t,i),e}();t.default=i},"./src/core/events/CoreEvents.js":function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=s(e);if(t){var a=s(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}n.r(t);var o=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,e);var t=a(n);function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=t.call(this)).ATTEMPT_BACKGROUND_SYNC="attemptBackgroundSync",e.BUFFERING_COMPLETED="bufferingCompleted",e.BUFFER_CLEARED="bufferCleared",e.BYTES_APPENDED_END_FRAGMENT="bytesAppendedEndFragment",e.BUFFER_REPLACEMENT_STARTED="bufferReplacementStarted",e.CHECK_FOR_EXISTENCE_COMPLETED="checkForExistenceCompleted",e.CURRENT_TRACK_CHANGED="currentTrackChanged",e.DATA_UPDATE_COMPLETED="dataUpdateCompleted",e.INBAND_EVENTS="inbandEvents",e.INITIAL_STREAM_SWITCH="initialStreamSwitch",e.INIT_FRAGMENT_LOADED="initFragmentLoaded",e.INIT_FRAGMENT_NEEDED="initFragmentNeeded",e.INTERNAL_MANIFEST_LOADED="internalManifestLoaded",e.ORIGINAL_MANIFEST_LOADED="originalManifestLoaded",e.LOADING_COMPLETED="loadingCompleted",e.LOADING_PROGRESS="loadingProgress",e.LOADING_DATA_PROGRESS="loadingDataProgress",e.LOADING_ABANDONED="loadingAborted",e.MANIFEST_UPDATED="manifestUpdated",e.MEDIA_FRAGMENT_LOADED="mediaFragmentLoaded",e.MEDIA_FRAGMENT_NEEDED="mediaFragmentNeeded",e.QUOTA_EXCEEDED="quotaExceeded",e.SEGMENT_LOCATION_BLACKLIST_ADD="segmentLocationBlacklistAdd",e.SEGMENT_LOCATION_BLACKLIST_CHANGED="segmentLocationBlacklistChanged",e.SERVICE_LOCATION_BLACKLIST_ADD="serviceLocationBlacklistAdd",e.SERVICE_LOCATION_BLACKLIST_CHANGED="serviceLocationBlacklistChanged",e.SET_FRAGMENTED_TEXT_AFTER_DISABLED="setFragmentedTextAfterDisabled",e.SET_NON_FRAGMENTED_TEXT="setNonFragmentedText",e.SOURCE_BUFFER_ERROR="sourceBufferError",e.STREAMS_COMPOSED="streamsComposed",e.STREAM_BUFFERING_COMPLETED="streamBufferingCompleted",e.STREAM_REQUESTING_COMPLETED="streamRequestingCompleted",e.TEXT_TRACKS_QUEUE_INITIALIZED="textTracksQueueInitialized",e.TIME_SYNCHRONIZATION_COMPLETED="timeSynchronizationComplete",e.UPDATE_TIME_SYNC_OFFSET="updateTimeSyncOffset",e.URL_RESOLUTION_FAILED="urlResolutionFailed",e.VIDEO_CHUNK_RECEIVED="videoChunkReceived",e.WALLCLOCK_TIME_UPDATED="wallclockTimeUpdated",e.XLINK_ELEMENT_LOADED="xlinkElementLoaded",e.XLINK_READY="xlinkReady",e.SEEK_TARGET="seekTarget",e}return n}(n("./src/core/events/EventsBase.js").default);t.default=o},"./src/core/events/Events.js":function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=s(e);if(t){var a=s(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}n.r(t);var o=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,e);var t=a(n);function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),t.apply(this,arguments)}return n}(n("./src/core/events/CoreEvents.js").default),u=new o;t.default=u},"./src/core/events/EventsBase.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,(n=[{key:"extend",value:function(e,t){if(e){var n=!!t&&t.override,r=!!t&&t.publicOnly;for(var i in e)!e.hasOwnProperty(i)||this[i]&&!n||r&&-1===e[i].indexOf("public_")||(this[i]=e[i])}}}])&&r(t.prototype,n),i&&r(t,i),e}();t.default=i},"./src/dash/DashAdapter.js":function(e,t,n){n.r(t);var r=n("./src/dash/constants/DashConstants.js"),i=n("./src/dash/vo/RepresentationInfo.js"),a=n("./src/dash/vo/MediaInfo.js"),s=n("./src/dash/vo/StreamInfo.js"),o=n("./src/dash/vo/ManifestInfo.js"),u=n("./src/dash/vo/Event.js"),l=n("./src/core/FactoryMaker.js"),c=n("./src/dash/models/DashManifestModel.js"),d=n("./src/dash/models/PatchManifestModel.js");function f(){var e,t,n,l,f,h,p,g=this.context;function m(e,n,i){var a,s=t.getAdaptationsForType(l[0].mpd.manifest,e,n);if(!s||0===s.length)return null;if(s.length>1&&i){var o=_(i,n);if(f[i.id]&&f[i.id][n])for(var u=0,c=s.length;u<c;u++)if(y(f[i.id][n],o[u]))return s[u];for(var d=0,h=s.length;d<h;d++)if(a=s[d],t.getRolesForAdaptation(a).filter((function(e){return e.value===r.default.MAIN}))[0])return s[d]}return s[0]}function y(e,t){if(!e||!t)return!1;var n=e.id===t.id,r=e.codec===t.codec,i=e.viewpoint===t.viewpoint,a=e.lang===t.lang,s=e.roles.toString()===t.roles.toString(),o=e.accessibility.toString()===t.accessibility.toString(),u=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString();return n&&r&&i&&a&&s&&o&&u}function v(e,n,r,i,a,s){var o,u,l,c,d,f,p=[];if(!i||0===i.length)return[];var g=t.getAdaptationsForPeriod(n);for(c=0,f=i.length;c<f;c++)if(o=i[c],u=I(g[l=t.getIndexForAdaptation(o,e,r.index)]),s){var m=u.accessibility.length;for(d=0;d<m;d++)if(u){var y=u.accessibility[d];if(0===y.indexOf("cea-608:")){var v=y.substring(8).split(";");if("CC"===v[0].substring(0,2))for(d=0;d<v.length;d++)u||(u=I.call(this,g[l])),C(u,v[d].substring(0,3),v[d].substring(4)),p.push(u),u=null;else for(d=0;d<v.length;d++)u||(u=I.call(this,g[l])),C(u,"CC"+(d+1),v[d]),p.push(u),u=null}else 0===y.indexOf("cea-608")&&(C(u,h.CC1,"eng"),p.push(u),u=null)}}else a===h.IMAGE?(u.type=h.IMAGE,p.push(u),u=null):u&&p.push(u);return p}function _(e,n,r){var i=l,a=r,s=[];if(a)D(),i=T(a);else{if(!(l.length>0))return s;a=l[0].mpd.manifest}var o=A(e,i),u=t.getAdaptationsForType(a,e?e.index:null,n);return s=v(a,o,e,u,n),n===h.TEXT&&(u=t.getAdaptationsForType(a,e?e.index:null,h.VIDEO),s=s.concat(v(a,o,e,u,n,!0))),s}function T(e){var n=b(e);return t.getRegularPeriods(n)}function b(e){var n=S(e);return t.getMpd(n)}function E(){l=[],f={}}function S(e){return e||(l.length>0?l[0].mpd.manifest:null)}function w(e){try{var n=A(e.streamInfo,l),r=t.getAdaptationsForPeriod(n);return e&&e.streamInfo&&void 0!==e.streamInfo.id&&r?r[e.index]:null}catch(e){return null}}function A(e,t){for(var n=t.length,r=0;r<n;r++){var i=t[r];if(e&&e.id===i.id)return i}return null}function I(e){if(!e)return null;var n,r=new a.default,i=e.period.mpd.manifest.Period_asArray[e.period.index].AdaptationSet_asArray[e.index];if(r.id=e.id,r.index=e.index,r.type=e.type,r.streamInfo=R(e.period),r.representationCount=t.getRepresentationCount(i),r.labels=t.getLabelsForAdaptation(i),r.lang=t.getLanguageForAdaptation(i),n=t.getViewpointForAdaptation(i),r.viewpoint=n?n.value:void 0,r.accessibility=t.getAccessibilityForAdaptation(i).map((function(e){var t=e.value,n=t;return e.schemeIdUri&&e.schemeIdUri.search("cea-608")>=0&&void 0!==p&&(n=t?"cea-608:"+t:"cea-608",r.embeddedCaptions=!0),n})),r.audioChannelConfiguration=t.getAudioChannelConfigurationForAdaptation(i).map((function(e){return e.value})),0===r.audioChannelConfiguration.length&&Array.isArray(i.Representation_asArray)&&i.Representation_asArray.length>0&&(r.audioChannelConfiguration=t.getAudioChannelConfigurationForRepresentation(i.Representation_asArray[0]).map((function(e){return e.value}))),r.roles=t.getRolesForAdaptation(i).map((function(e){return e.value})),r.codec=t.getCodec(i),r.mimeType=t.getMimeType(i),r.contentProtection=t.getContentProtectionData(i),r.bitrateList=t.getBitrateListForAdaptation(i),r.selectionPriority=t.getSelectionPriority(i),r.contentProtection){var s=r.contentProtection.map((function(e){return t.getKID(e)})).filter((function(e){return null!==e}));if(s.length){var o=s[0];r.contentProtection.forEach((function(e){e.keyId=o}))}}return r.isText=t.getIsText(i),r.supplementalProperties=t.getSupplementalProperties(i),r.isFragmented=t.getIsFragmented(i),r.isEmbedded=!1,r}function C(e,t,n){e.id=t,e.index=100+parseInt(t.substring(2,3)),e.type=h.TEXT,e.codec="cea-608-in-SEI",e.isEmbedded=!0,e.isFragmented=!1,e.lang=n,e.roles=["caption"]}function R(e){var n,r,i=new s.default;return i.id=e.id,i.index=e.index,i.start=e.start,i.duration=e.duration,i.manifestInfo=(n=e.mpd,(r=new o.default).dvrWindowSize=n.timeShiftBufferDepth,r.loadedTime=n.manifest.loadedTime,r.availableFrom=n.availabilityStartTime,r.minBufferTime=n.manifest.minBufferTime,r.maxFragmentDuration=n.maxSegmentDuration,r.duration=t.getDuration(n.manifest),r.isDynamic=t.getIsDynamic(n.manifest),r.serviceDescriptions=t.getServiceDescriptions(n.manifest),r.protocol=n.manifest.protocol,r),i.isLast=1===e.mpd.manifest.Period_asArray.length||Math.abs(i.start+i.duration-i.manifestInfo.duration)<1,i}function D(){if(!h)throw new Error("setConfig function has to be called previously")}function x(e){return l.length>0?l[0].mpd.manifest.Period_asArray[e]:null}function N(e,t,n){var r,i,a,s,o;if(e)for(r=e.AdaptationSet_asArray,s=0;s<r.length;s+=1)for(a=r[s].Representation_asArray,o=0;o<a.length;o+=1)if(t===(i=a[o]).id)return n?o:i;return null}return e={getBandwidthForRepresentation:function(e,t){var n;return(n=N(x(t),e))?n.bandwidth:null},getIndexForRepresentation:function(e,t){return function(e,t){var n=N(e,t,!0);return null!==n?n:-1}(x(t),e)},getMaxIndexForBufferType:function(e,n){return function(e,n){var r,i,a,s;if(!e||!n)return-1;for(i=e.AdaptationSet_asArray,s=0;s<i.length;s+=1)if(a=(r=i[s]).Representation_asArray,t.getIsTypeOf(r,n))return a.length;return-1}(x(n),e)},convertRepresentationToRepresentationInfo:function(e){if(e){var n=new i.default,r=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],a=t.getRepresentationFor(e.index,r);return n.id=e.id,n.quality=e.index,n.bandwidth=t.getBandwidth(a),n.fragmentDuration=e.segmentDuration||(e.segments&&e.segments.length>0?e.segments[0].duration:NaN),n.MSETimeOffset=e.MSETimeOffset,n.mediaInfo=I(e.adaptation),n}return null},getStreamsInfo:function(e,t){var n=[],r=l;if(e&&(D(),r=T(e)),r.length>0){(!t||t>r.length)&&(t=r.length);for(var i=0;i<t;i++)n.push(R(r[i]))}return n},getMediaInfoForType:function(e,n){if(0===l.length||!e)return null;var r=A(e,l);if(!r)return null;var i=t.getAdaptationsForPeriod(r),a=m(e.index,n,e);return a?I(i[t.getIndexForAdaptation(a,l[0].mpd.manifest,e.index)]):null},getAllMediaInfoForType:_,getAdaptationForType:m,getRealAdaptation:function(e,n){var r,i,a=A(e,l);return r=n?n.id:null,l.length>0&&a&&(i=r?t.getAdaptationForId(r,l[0].mpd.manifest,a.index):t.getAdaptationForIndex(n?n.index:null,l[0].mpd.manifest,a.index)),i},getRealPeriodByIndex:function(e){return t.getRealPeriodForIndex(e,l[0].mpd.manifest)},getEssentialPropertiesForRepresentation:function(e){try{return t.getEssentialPropertiesForRepresentation(e)}catch(e){return[]}},getVoRepresentations:function(e){var n=w(e);return t.getRepresentationsForAdaptation(n)},getEventsFor:function(e,n){var r=[];if(l.length>0){var o=l[0].mpd.manifest;e instanceof s.default?r=t.getEventsForPeriod(A(e,l)):e instanceof a.default?r=t.getEventStreamForAdaptationSet(o,w(e)):e instanceof i.default&&(r=t.getEventStreamForRepresentation(o,n))}return r},getEvent:function(e,t,n,r){try{if(!e||!t||isNaN(n)||!r)return null;var i=e.scheme_id_uri,a=e.value;if(!t[i+"/"+a])return null;var s,o=new u.default,l=e.timescale||1,c=r.adaptation.period.start,d=t[i+"/"+a],f=isNaN(r.presentationTimeOffset)?isNaN(d.presentationTimeOffset)?0:d.presentationTimeOffset:r.presentationTimeOffset,h=e.presentation_time_delta/l;s=0===e.version?c+n-f+h:c-f+h;var p=e.event_duration,g=e.id,m=e.message_data;return o.eventStream=d,o.eventStream.value=a,o.eventStream.timescale=l,o.duration=p,o.id=g,o.calculatedPresentationTime=s,o.messageData=m,o.presentationTimeDelta=h,o}catch(e){return null}},getMpd:b,setConfig:function(e){e&&(e.constants&&(h=e.constants),e.cea608parser&&(p=e.cea608parser),e.errHandler&&t.setConfig({errHandler:e.errHandler}),e.BASE64&&t.setConfig({BASE64:e.BASE64}))},updatePeriods:function(e){if(!e)return null;D(),l=T(e)},getIsTextTrack:function(e){return t.getIsText(e)},getUTCTimingSources:function(){var e=S();return t.getUTCTimingSources(e)},getSuggestedPresentationDelay:function(){var e=l.length>0?l[0].mpd:null;return t.getSuggestedPresentationDelay(e)},getAvailabilityStartTime:function(e){var n=b(e);return t.getAvailabilityStartTime(n)},getIsTypeOf:function(e,n){return t.getIsTypeOf(e,n)},getIsDynamic:function(e){var n=S(e);return t.getIsDynamic(n)},getDuration:function(e){var n=S(e);return t.getDuration(n)},getRegularPeriods:T,getLocation:function(e){return t.getLocation(e)},getPatchLocation:function(e){var n=t.getPatchLocation(e),r=t.getPublishTime(e);if(!n||!r)return null;if(n.hasOwnProperty("ttl")&&r){var i=1e3*parseFloat(n.ttl);if(r.getTime()+i<=(new Date).getTime())return null}return n.__text},getManifestUpdatePeriod:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.getManifestUpdatePeriod(e,n)},getPublishTime:function(e){return t.getPublishTime(e)},getIsDVB:function(e){return t.hasProfile(e,"urn:dvb:dash:profile:dvb-dash:2014")},getIsPatch:function(e){return n.getIsPatch(e)},getBaseURLsFromElement:function(e){return t.getBaseURLsFromElement(e)},getRepresentationSortFunction:function(){return t.getRepresentationSortFunction()},getCodec:function(e,n,r){return t.getCodec(e,n,r)},getPeriodById:function(e){if(!e||0===l.length)return null;var t=l.filter((function(t){return t.id===e}));return t&&t.length>0?t[0]:null},setCurrentMediaInfo:function(e,t,n){f[e]=f[e]||{},f[e][t]=f[e][t]||{},f[e][t]=n},isPatchValid:function(e,r){var i=t.getId(e),a=n.getMpdId(r),s=t.getPublishTime(e),o=n.getPublishTime(r),u=n.getOriginalPublishTime(r);return!!(i&&a&&i==a&&s&&u&&s.getTime()==u.getTime()&&o&&s.getTime()<o.getTime())},applyPatchToManifest:function(e,t){n.getPatchOperations(t).forEach((function(t){var n=t.getMpdTarget(e);if(null!==n){var r=n.name,i=n.target,a=n.leaf;if(t.xpath.findsAttribute())switch(t.action){case"add":case"replace":i[r]=t.value;break;case"remove":delete i[r]}else{var s=(i[r+"_asArray"]||[]).indexOf(a),o="prepend"===t.position||"before"===t.position;if(("remove"===t.action||"replace"===t.action)&&(delete i[r],-1!=s)){var u=i[r+"_asArray"];u.splice(s,1),u.length>1?i[r]=u:1==u.length?i[r]=u[0]:delete i[r+"_asArray"]}"add"!==t.action&&"replace"!==t.action||Object.keys(t.value).forEach((function(e){var n=t.value[e],a=i[e+"_asArray"]||[];if(0===a.length&&i[e]&&a.push(i[e]),0===a.length)a=n;else{var u=a.length;u=e==r&&-1!=s?s+(o?0:1)+("replace"==t.action?-1:0):o?0:a.length,a.splice.apply(a,[u,0].concat(n))}i[e+"_asArray"]=a,i[e]=1==a.length?a[0]:a}))}}}))},areMediaInfosEqual:y,reset:E},t=Object(c.default)(g).getInstance(),n=Object(d.default)(g).getInstance(),E(),e}f.__dashjs_factory_name="DashAdapter",t.default=l.default.getSingletonFactory(f)},"./src/dash/DashHandler.js":function(e,t,n){n.r(t);var r=n("./src/streaming/vo/FragmentRequest.js"),i=n("./src/streaming/vo/metrics/HTTPRequest.js"),a=n("./src/core/FactoryMaker.js"),s=n("./src/streaming/MediaPlayerEvents.js"),o=n("./src/dash/utils/SegmentsUtils.js"),u=n("./src/dash/constants/DashConstants.js");function l(e){var t,n,a,l,c,d=(e=e||{}).eventBus,f=e.debug,h=e.urlUtils,p=e.type,g=e.streamInfo,m=e.segmentsController,y=e.timelineConverter,v=e.baseURLController;function _(){return p}function T(){a=null}function b(e,t,n){var r,i,a=v.resolve(n.path);return a&&t!==a.url&&h.isRelative(t)?(r=a.url,i=a.serviceLocation,t&&(r=h.resolve(t,r))):r=t,!h.isRelative(r)&&(e.url=r,e.serviceLocation=i,!0)}function E(e,t){if(null==t)return null;var n=new r.default,a=t.representation,s=a.adaptation.period.mpd.manifest.Period_asArray[a.adaptation.period.index].AdaptationSet_asArray[a.adaptation.index].Representation_asArray[a.index].bandwidth,u=t.media;return u=Object(o.replaceTokenForTemplate)(u,"Number",t.replacementNumber),u=Object(o.replaceTokenForTemplate)(u,"Time",t.replacementTime),u=Object(o.replaceTokenForTemplate)(u,"Bandwidth",s),u=Object(o.replaceIDForTemplate)(u,a.id),u=Object(o.unescapeDollarsInTemplate)(u),n.mediaType=_(),n.type=i.HTTPRequest.MEDIA_SEGMENT_TYPE,n.range=t.mediaRange,n.startTime=t.presentationStartTime,n.mediaStartTime=t.mediaStartTime,n.duration=t.duration,n.timescale=a.timescale,n.availabilityStartTime=t.availabilityStartTime,n.availabilityEndTime=t.availabilityEndTime,n.wallStartTime=t.wallStartTime,n.quality=a.index,n.index=t.index,n.mediaInfo=e,n.adaptationIndex=a.adaptation.index,n.representationId=a.id,b(n,u,a)?n:void 0}function S(e,t,r){var i=null;if(!t||!t.segmentInfoType)return i;var s=m.getSegmentByTime(t,r);return s&&(a=s,n.debug("Index for time "+r+" is "+s.index),i=E(e,s)),i}function w(){n.debug("Dynamic stream complete"),c=!0}return t={initialize:function(e){l=e,c=!1,m.initialize(e)},getStreamId:function(){return g.id},getType:_,getStreamInfo:function(){return g},getInitRequest:function(e,t){return t?function(e,t,n){var a=new r.default,s=t.adaptation.period,u=s.start;if(a.mediaType=n,a.type=i.HTTPRequest.INIT_SEGMENT_TYPE,a.range=t.range,a.availabilityStartTime=y.calcAvailabilityStartTimeFromPresentationTime(u,t,l),a.availabilityEndTime=y.calcAvailabilityEndTimeFromPresentationTime(u+s.duration,t,l),a.quality=t.index,a.mediaInfo=e,a.representationId=t.id,b(a,t.initialization,t))return a.url=Object(o.replaceTokenForTemplate)(a.url,"Bandwidth",t.bandwidth),a}(e,t,_()):null},getSegmentRequestForTime:S,getCurrentIndex:function(){return a?a.index:-1},getNextSegmentRequest:function(e,t){var r=null;if(!t||!t.segmentInfoType)return null;var i=a?a.index+1:0,s=m.getSegmentByIndex(t,i,a?a.mediaStartTime:-1);if(s)r=E(e,s),a=s;else{if(l&&!c)return n.debug(_()+" No segment found at index: "+i+". Wait for next loop"),null;c=!0}return r},isLastSegmentRequested:function(e,t){if(!e||!a)return!1;if(c)return!0;if(!isFinite(e.adaptation.period.duration))return!1;if(a.presentationStartTime+a.duration>t)return!1;if(e.mediaFinishedInformation&&!isNaN(e.mediaFinishedInformation.numberOfSegments)&&!isNaN(a.index)&&a.index>=e.mediaFinishedInformation.numberOfSegments-1){if(!l||e.segmentInfoType===u.default.SEGMENT_TEMPLATE)return!0;if(l&&e.segmentInfoType===u.default.SEGMENT_LIST&&e.adaptation.period.nextPeriodId)return!0}return!!(l&&e.adaptation.period.nextPeriodId&&e.segmentInfoType===u.default.SEGMENT_TIMELINE&&e.mediaFinishedInformation&&!isNaN(e.mediaFinishedInformation.mediaTimeOfLastSignaledSegment)&&a&&!isNaN(a.mediaStartTime)&&!isNaN(a.duration)&&a.mediaStartTime+a.duration>=e.mediaFinishedInformation.mediaTimeOfLastSignaledSegment-.05)},reset:function(){T(),d.off(s.default.DYNAMIC_TO_STATIC,w,t)},getNextSegmentRequestIdempotent:function(e,t){var n=a?a.index+1:0,r=m.getSegmentByIndex(t,n,a?a.mediaStartTime:-1);return r?E(e,r):null},getValidSeekTimeCloseToTargetTime:function(e,t,n,r){try{if(isNaN(e)||!t||!n)return NaN;if(e<0&&(e=0),isNaN(r)&&(r=.5),S(t,n,e))return e;for(var i=n.adaptation.period.start,a=n.adaptation.period.start+n.adaptation.period.duration,s=Math.min(e+r,a),o=Math.max(e-r,i),u=NaN,l=null;s<=a||o>=i;){var c=null,d=null;if(s<=a&&(c=S(t,n,s)),o>=i&&(d=S(t,n,o)),d){u=o,l=d;break}if(c){u=s,l=c;break}s+=r,o-=r}if(l){var f=l.startTime+l.duration;return e>=l.startTime&&f-e>r?e:e<l.startTime?l.startTime:Math.min(f-r,u)}return u}catch(e){return NaN}}},n=f.getLogger(t),T(),d.on(s.default.DYNAMIC_TO_STATIC,w,t),t}l.__dashjs_factory_name="DashHandler",t.default=a.default.getClassFactory(l)},"./src/dash/DashMetrics.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/streaming/vo/metrics/HTTPRequest.js"),a=n("./src/core/FactoryMaker.js"),s=n("./src/streaming/constants/MetricsConstants.js"),o=n("./src/dash/utils/Round10.js"),u=n("./src/streaming/models/MetricsModel.js"),l=n("./src/core/Utils.js"),c=n("./src/streaming/vo/metrics/PlayList.js");function d(e){e=e||{};var t,n,a,d,f=this.context,h=e.metricsModel;function p(e){var t=h.getMetricsFor(e,!0);if(!t)return null;var n,r=t.HttpList,i=null;if(!r||r.length<=0)return null;for(n=r.length-1;n>=0;){if(r[n].responsecode){i=r[n];break}n--}return i}function g(e){var t=h.getMetricsFor(e,!0);return t&&t.HttpList?t.HttpList:[]}function m(e,t){if(!e)return null;var n=e[t];return n&&0!==n.length?n[n.length-1]:null}return t={getCurrentRepresentationSwitch:function(e){return m(h.getMetricsFor(e,!0),s.default.TRACK_SWITCH)},getCurrentBufferState:function(e){return m(h.getMetricsFor(e,!0),s.default.BUFFER_STATE)},getCurrentBufferLevel:function(e){var t=m(h.getMetricsFor(e,!0),s.default.BUFFER_LEVEL);return t?o.default.round10(t.level/1e3,-3):0},getCurrentHttpRequest:p,getHttpRequests:g,getCurrentDroppedFrames:function(){return m(h.getMetricsFor(r.default.VIDEO,!0),s.default.DROPPED_FRAMES)},getCurrentSchedulingInfo:function(e){return m(h.getMetricsFor(e,!0),s.default.SCHEDULING_INFO)},getCurrentDVRInfo:function(e){return m(e?h.getMetricsFor(e,!0):h.getMetricsFor(r.default.VIDEO,!0)||h.getMetricsFor(r.default.AUDIO,!0),s.default.DVR_INFO)},getCurrentManifestUpdate:function(){return m(h.getMetricsFor(r.default.STREAM),s.default.MANIFEST_UPDATE)},getLatestFragmentRequestHeaderValueByID:function(e,t){if(!t)return null;var n={},r=p(e);r&&(n=l.default.parseHttpHeaders(r._responseHeaders));var i=n[t.toLowerCase()];return void 0===i?null:i},getLatestMPDRequestHeaderValueByID:function(e){if(!e)return null;var t,n,a,s={};for(a=(t=g(r.default.STREAM)).length-1;a>=0;a--)if((n=t[a]).type===i.HTTPRequest.MPD_TYPE){s=l.default.parseHttpHeaders(n._responseHeaders);break}var o=s[e.toLowerCase()];return void 0===o?null:o},addRepresentationSwitch:function(e,t,n,r,i){h.addRepresentationSwitch(e,t,n,r,i)},addDVRInfo:function(e,t,n,r){h.addDVRInfo(e,t,n,r)},updateManifestUpdateInfo:function(e){var t=this.getCurrentManifestUpdate();h.updateManifestUpdateInfo(t,e)},addManifestUpdateStreamInfo:function(e){if(e){var t=this.getCurrentManifestUpdate();h.addManifestUpdateStreamInfo(t,e.id,e.index,e.start,e.duration)}},addManifestUpdateRepresentationInfo:function(e,t){if(e){var n=this.getCurrentManifestUpdate();h.addManifestUpdateRepresentationInfo(n,e.id,e.index,e.streamIndex,t,e.presentationTimeOffset,e.startNumber,e.fragmentInfoType)}},addManifestUpdate:function(e){h.addManifestUpdate(r.default.STREAM,e.type,e.requestStartDate,e.requestEndDate)},addHttpRequest:function(e,t,n,r,i){h.addHttpRequest(e.mediaType,null,e.type,e.url,e.quality,t,e.serviceLocation||null,e.range||null,e.requestStartDate,e.firstByteDate,e.requestEndDate,n,e.duration,r,i)},addSchedulingInfo:function(e,t){h.addSchedulingInfo(e.mediaType,new Date,e.type,e.startTime,e.availabilityStartTime,e.duration,e.quality,e.range,t)},addRequestsQueue:function(e,t,n){h.addRequestsQueue(e,t,n)},addBufferLevel:function(e,t,n){h.addBufferLevel(e,t,n)},addBufferState:function(e,t,n){h.addBufferState(e,t,n)},addDroppedFrames:function(e){h.addDroppedFrames(r.default.VIDEO,e)},addPlayList:function(){d&&(h.addPlayList(d),d=null)},addDVBErrors:function(e){h.addDVBErrors(e)},createPlaylistMetrics:function(e,t){(d=new c.PlayList).start=new Date,d.mstart=e,d.starttype=t},createPlaylistTraceMetrics:function(e,t,r){!0===n&&(n=!1,(a=new c.PlayListTrace).representationid=e,a.start=new Date,a.mstart=t,a.playbackspeed=null!==r?r.toString():null)},updatePlayListTraceMetrics:function(e){if(a)for(var t in a)a[t]=e[t]},pushPlayListTraceMetrics:function(e,t){if(!1===n&&d&&a&&a.start){var r=a.start,i=e.getTime()-r.getTime();a.duration=i,a.stopreason=t,d.trace.push(a),n=!0}},clearAllCurrentMetrics:function(){h.clearAllCurrentMetrics()}},h=h||Object(u.default)(f).getInstance({settings:e.settings}),n=!0,a=null,d=null,t}d.__dashjs_factory_name="DashMetrics",t.default=a.default.getSingletonFactory(d)},"./src/dash/SegmentBaseLoader.js":function(e,t,n){n.r(t);var r=n("./src/dash/vo/Segment.js"),i=n("./src/streaming/vo/DashJSError.js"),a=n("./src/core/FactoryMaker.js"),s=n("./src/streaming/vo/FragmentRequest.js"),o=n("./src/streaming/net/URLLoader.js");function u(){var e,t,n,a,u,l,c,d,f,h,p,g,m,y=this.context;function v(e,n,r,i){var s=null,o=e?m.resolve(e.path):null,u=i||{init:!0,url:o?o.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500,mediaType:n};t.debug("Start searching for initialization.");var l=b(u);d.load({request:l,success:function(t){if(u.bytesLoaded=u.range.end,!(s=a.findInitRange(t)))return u.range.end=u.bytesLoaded+u.bytesToLoad,v(e,n,r,u);e.range=s,r(e)},error:function(){r(e)}}),t.debug("Perform init search: "+u.url)}function _(e,n,i,s,o,u){if(i&&(void 0===i.start||void 0===i.end)){var l=i?i.toString().split("-"):null;i=l?{start:parseFloat(l[0]),end:parseFloat(l[1])}:null}o=o||T;var c=null,f=null,h=!!i,p=e?m.resolve(e.path):null,g={init:!1,url:p?p.url:void 0,range:h?i:{start:0,end:1500},searching:!h,bytesLoaded:u?u.bytesLoaded:0,bytesToLoad:1500,mediaType:n},y=b(g);d.load({request:y,success:function(i){var u=g.bytesToLoad,l=i.byteLength;if(g.bytesLoaded=g.range.end-g.range.start,c=a.parse(i),(f=c.getBox("sidx"))&&f.isComplete){var d,h,p=f.references;if(null!=p&&p.length>0&&(d=1===p[0].reference_type),d){var m,y,v,T;t.debug("Initiate multiple SIDX load."),g.range.end=g.range.start+f.size;var b=[],E=0,S=(f.offset||g.range.start)+f.size,w=function(t){t?(b=b.concat(t),++E>=y&&(b.sort((function(e,t){return e.startTime-t.startTime<0?-1:0})),o(b,e,s))):o(null,e,s)};for(m=0,y=p.length;m<y;m++)v=S,T=S+p[m].referenced_size-1,S+=p[m].referenced_size,_(e,n,{start:v,end:T},s,w,g)}else t.debug("Parsing segments from SIDX. representation "+n+" - id: "+e.id+" for range : "+g.range.start+" - "+g.range.end),h=function(e,t){for(var n,i,a,s,o=e.references,u=o.length,l=e.timescale,c=e.earliest_presentation_time,d=t.range.start+e.offset+e.first_offset+e.size,f=[],h=0;h<u;h++)a=o[h].subsegment_duration,s=o[h].referenced_size,(n=new r.default).duration=a,n.startTime=c,n.timescale=l,i=d+s-1,n.mediaRange=d+"-"+i,f.push(n),c+=a,d+=s;return f}(f,g),o(h,e,s)}else{if(f)g.range.start=f.offset||g.range.start,g.range.end=g.range.start+(f.size||u);else{if(l<g.bytesLoaded)return void o(null,e,s);var A=c.getLastBox();A&&A.size?(g.range.start=A.offset+A.size,g.range.end=g.range.start+u):g.range.end+=u}_(e,n,g.range,s,null,g)}},error:function(){o(null,e,s)}}),t.debug("Perform SIDX load for type ".concat(n," : ").concat(g.url," with range ").concat(g.range.start," - ").concat(g.range.end))}function T(e,t,n){n({segments:e,representation:t,error:e?void 0:new i.default(f.SEGMENT_BASE_LOADER_ERROR_CODE,f.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}function b(e){if(e.url){var t=new s.default;return t.setInfo(e),t}}return e={setConfig:function(r){r.baseURLController&&(m=r.baseURLController),r.dashMetrics&&(l=r.dashMetrics),r.mediaPlayerModel&&(c=r.mediaPlayerModel),r.errHandler&&(n=r.errHandler),r.boxParser&&(a=r.boxParser),r.debug&&(t=r.debug.getLogger(e)),r.requestModifier&&(u=r.requestModifier),r.errors&&(f=r.errors),r.urlUtils&&(g=r.urlUtils),r.constants&&(h=r.constants),r.dashConstants&&(p=r.dashConstants)},initialize:function(){d=Object(o.default)(y).create({errHandler:n,dashMetrics:l,mediaPlayerModel:c,requestModifier:u,boxParser:a,errors:f,urlUtils:g,constants:h,dashConstants:p})},loadInitialization:function(e,t){return new Promise((function(n){v(e,t,n)}))},loadSegments:function(e,t,n){return new Promise((function(r){_(e,t,n,r)}))},reset:function(){d&&(d.abort(),d=null)}}}u.__dashjs_factory_name="SegmentBaseLoader",t.default=a.default.getSingletonFactory(u)},"./src/dash/WebmSegmentBaseLoader.js":function(e,t,n){n.r(t);var r=n("./src/streaming/utils/EBMLParser.js"),i=n("./src/streaming/constants/Constants.js"),a=n("./src/core/FactoryMaker.js"),s=n("./src/dash/vo/Segment.js"),o=n("./src/streaming/vo/FragmentRequest.js"),u=n("./src/streaming/net/URLLoader.js"),l=n("./src/streaming/vo/DashJSError.js");function c(){var e,t,n,a,c,d,f,h,p,g,m=this.context;function y(e,i,a,o){var u,l,c,d,f,h,p,g;for(c=[],f=0,h=(l=function(e){var t,i,a=[],s=Object(r.default)(m).create({data:e});for(s.consumeTagAndSize(n.Segment.Cues);s.moreData()&&s.consumeTagAndSize(n.Segment.Cues.CuePoint,!0);){for((t={}).CueTime=s.parseTag(n.Segment.Cues.CuePoint.CueTime),t.CueTracks=[];s.moreData()&&s.consumeTag(n.Segment.Cues.CuePoint.CueTrackPositions,!0);){var o=s.getMatroskaCodedNum(),u=s.getPos();if((i={}).Track=s.parseTag(n.Segment.Cues.CuePoint.CueTrackPositions.CueTrack),0===i.Track)throw new Error("Cue track cannot be 0");i.ClusterPosition=s.parseTag(n.Segment.Cues.CuePoint.CueTrackPositions.CueClusterPosition),t.CueTracks.push(i),s.setPos(u+o)}if(0===t.CueTracks.length)throw new Error("Mandatory cuetrack not found");a.push(t)}if(0===a.length)throw new Error("mandatory cuepoint not found");return a}(e)).length;f<h;f+=1)d=new s.default,u=0,u=f<l.length-1?l[f+1].CueTime-l[f].CueTime:o-l[f].CueTime,d.duration=u,d.startTime=l[f].CueTime,d.timescale=1e3,p=l[f].CueTracks[0].ClusterPosition+i,g=f<l.length-1?l[f+1].CueTracks[0].ClusterPosition+i-1:a-1,d.mediaRange=p+"-"+g,c.push(d);return t.debug("Parsed cues: "+c.length+" cues."),c}function v(e){var t=new o.default;return t.setInfo(e),t}return e={setConfig:function(n){if(!(n.baseURLController&&n.dashMetrics&&n.mediaPlayerModel&&n.errHandler))throw new Error(i.default.MISSING_CONFIG_ERROR);g=n.baseURLController,d=n.dashMetrics,f=n.mediaPlayerModel,a=n.errHandler,p=n.errors,t=n.debug.getLogger(e),c=n.requestModifier},initialize:function(){h=Object(u.default)(m).create({errHandler:a,dashMetrics:d,mediaPlayerModel:f,requestModifier:c,errors:p})},loadInitialization:function(e,n){return new Promise((function(r){var i=null,a=e?g.resolve(e.path):null,s=e?e.range.split("-"):null,o={range:{start:s?parseFloat(s[0]):null,end:s?parseFloat(s[1]):null},request:i,url:a?a.url:void 0,init:!0,mediaType:n};t.info("Start loading initialization."),i=v(o),h.load({request:i,success:function(){r(e)},error:function(){r(e)}}),t.debug("Perform init load: "+o.url)}))},loadSegments:function(e,i,a){return new Promise((function(s){var o=null,u=e?g.resolve(e.path):null,c=u?u.url:void 0;o=v({bytesLoaded:0,bytesToLoad:8192,range:{start:0,end:8192},request:o,url:c,init:!1,mediaType:i}),t.debug("Parsing ebml header"),h.load({request:o,success:function(i){!function(e,i,a,s){if(e&&0!==e.byteLength){var o,u,l,c,d=Object(r.default)(m).create({data:e}),f=a?a.split("-"):null,p=null,g={url:i,range:{start:f?parseFloat(f[0]):null,end:f?parseFloat(f[1]):null},request:p};for(t.debug("Parse EBML header: "+g.url),d.skipOverElement(n.EBML),d.consumeTag(n.Segment),l=d.getMatroskaCodedNum(),l+=d.getPos(),c=d.getPos();d.moreData()&&!d.consumeTagAndSize(n.Segment.Info,!0);)if(!(d.skipOverElement(n.Segment.SeekHead,!0)||d.skipOverElement(n.Segment.Tracks,!0)||d.skipOverElement(n.Segment.Cues,!0)||d.skipOverElement(n.Void,!0)))throw new Error("no valid top level element found");for(;void 0===o;){var _=d.getMatroskaCodedNum(!0),T=d.getMatroskaCodedNum();_===n.Segment.Info.Duration.tag?o=d[n.Segment.Info.Duration.parse](T):d.setPos(d.getPos()+T)}p=v(g),h.load({request:p,success:function(e){u=y(e,c,l,o),s(u)},error:function(){t.error("Download Error: Cues "+g.url),s(null)}}),t.debug("Perform cues load: "+g.url+" bytes="+g.range.start+"-"+g.range.end)}else s(null)}(i,c,a,(function(t){s({segments:t,representation:e,error:t?void 0:new l.default(p.SEGMENT_BASE_LOADER_ERROR_CODE,p.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}))},error:function(){s({representation:e,error:new l.default(p.SEGMENT_BASE_LOADER_ERROR_CODE,p.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}})}))},reset:function(){h&&(h.abort(),h=null)}},n={EBML:{tag:440786851,required:!0},Segment:{tag:408125543,required:!0,SeekHead:{tag:290298740,required:!0},Info:{tag:357149030,required:!0,TimecodeScale:{tag:2807729,required:!0,parse:"getMatroskaUint"},Duration:{tag:17545,required:!0,parse:"getMatroskaFloat"}},Tracks:{tag:374648427,required:!0},Cues:{tag:475249515,required:!0,CuePoint:{tag:187,required:!0,CueTime:{tag:179,required:!0,parse:"getMatroskaUint"},CueTrackPositions:{tag:183,required:!0,CueTrack:{tag:247,required:!0,parse:"getMatroskaUint"},CueClusterPosition:{tag:241,required:!0,parse:"getMatroskaUint"}}}}},Void:{tag:236,required:!0}},e}c.__dashjs_factory_name="WebmSegmentBaseLoader",t.default=a.default.getSingletonFactory(c)},"./src/dash/constants/DashConstants.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t,n,i;return t=e,(n=[{key:"init",value:function(){this.BASE_URL="BaseURL",this.SEGMENT_BASE="SegmentBase",this.SEGMENT_TEMPLATE="SegmentTemplate",this.SEGMENT_LIST="SegmentList",this.SEGMENT_URL="SegmentURL",this.SEGMENT_TIMELINE="SegmentTimeline",this.SEGMENT_PROFILES="segmentProfiles",this.ADAPTATION_SET="AdaptationSet",this.REPRESENTATION="Representation",this.REPRESENTATION_INDEX="RepresentationIndex",this.SUB_REPRESENTATION="SubRepresentation",this.INITIALIZATION="Initialization",this.INITIALIZATION_MINUS="initialization",this.MPD="MPD",this.PERIOD="Period",this.ASSET_IDENTIFIER="AssetIdentifier",this.EVENT_STREAM="EventStream",this.ID="id",this.PROFILES="profiles",this.SERVICE_LOCATION="serviceLocation",this.RANGE="range",this.INDEX="index",this.MEDIA="media",this.BYTE_RANGE="byteRange",this.INDEX_RANGE="indexRange",this.MEDIA_RANGE="mediaRange",this.VALUE="value",this.CONTENT_TYPE="contentType",this.MIME_TYPE="mimeType",this.BITSTREAM_SWITCHING="BitstreamSwitching",this.BITSTREAM_SWITCHING_MINUS="bitstreamSwitching",this.CODECS="codecs",this.DEPENDENCY_ID="dependencyId",this.MEDIA_STREAM_STRUCTURE_ID="mediaStreamStructureId",this.METRICS="Metrics",this.METRICS_MINUS="metrics",this.REPORTING="Reporting",this.WIDTH="width",this.HEIGHT="height",this.SAR="sar",this.FRAMERATE="frameRate",this.AUDIO_SAMPLING_RATE="audioSamplingRate",this.MAXIMUM_SAP_PERIOD="maximumSAPPeriod",this.START_WITH_SAP="startWithSAP",this.MAX_PLAYOUT_RATE="maxPlayoutRate",this.CODING_DEPENDENCY="codingDependency",this.SCAN_TYPE="scanType",this.FRAME_PACKING="FramePacking",this.AUDIO_CHANNEL_CONFIGURATION="AudioChannelConfiguration",this.CONTENT_PROTECTION="ContentProtection",this.ESSENTIAL_PROPERTY="EssentialProperty",this.SUPPLEMENTAL_PROPERTY="SupplementalProperty",this.INBAND_EVENT_STREAM="InbandEventStream",this.ACCESSIBILITY="Accessibility",this.ROLE="Role",this.RATING="Rating",this.CONTENT_COMPONENT="ContentComponent",this.SUBSET="Subset",this.LANG="lang",this.VIEWPOINT="Viewpoint",this.ROLE_ASARRAY="Role_asArray",this.ACCESSIBILITY_ASARRAY="Accessibility_asArray",this.AUDIOCHANNELCONFIGURATION_ASARRAY="AudioChannelConfiguration_asArray",this.CONTENTPROTECTION_ASARRAY="ContentProtection_asArray",this.MAIN="main",this.DYNAMIC="dynamic",this.STATIC="static",this.MEDIA_PRESENTATION_DURATION="mediaPresentationDuration",this.MINIMUM_UPDATE_PERIOD="minimumUpdatePeriod",this.CODEC_PRIVATE_DATA="codecPrivateData",this.BANDWITH="bandwidth",this.SOURCE_URL="sourceURL",this.TIMESCALE="timescale",this.DURATION="duration",this.START_NUMBER="startNumber",this.PRESENTATION_TIME_OFFSET="presentationTimeOffset",this.AVAILABILITY_START_TIME="availabilityStartTime",this.AVAILABILITY_END_TIME="availabilityEndTime",this.TIMESHIFT_BUFFER_DEPTH="timeShiftBufferDepth",this.MAX_SEGMENT_DURATION="maxSegmentDuration",this.PRESENTATION_TIME="presentationTime",this.MIN_BUFFER_TIME="minBufferTime",this.MAX_SUBSEGMENT_DURATION="maxSubsegmentDuration",this.START="start",this.AVAILABILITY_TIME_OFFSET="availabilityTimeOffset",this.AVAILABILITY_TIME_COMPLETE="availabilityTimeComplete",this.CENC_DEFAULT_KID="cenc:default_KID",this.DVB_PRIORITY="dvb:priority",this.DVB_WEIGHT="dvb:weight",this.SUGGESTED_PRESENTATION_DELAY="suggestedPresentationDelay",this.SERVICE_DESCRIPTION="ServiceDescription",this.SERVICE_DESCRIPTION_SCOPE="Scope",this.SERVICE_DESCRIPTION_LATENCY="Latency",this.SERVICE_DESCRIPTION_PLAYBACK_RATE="PlaybackRate",this.PATCH_LOCATION="PatchLocation",this.PUBLISH_TIME="publishTime",this.ORIGINAL_PUBLISH_TIME="originalPublishTime",this.ORIGINAL_MPD_ID="mpdId"}}])&&r(t.prototype,n),i&&r(t,i),e}());t.default=i},"./src/dash/controllers/RepresentationController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/core/FactoryMaker.js"),a=n("./src/streaming/MediaPlayerEvents.js"),s=n("./src/dash/utils/SegmentsUtils.js");function o(e){var t,n,i,o,u,l=(e=e||{}).eventBus,c=e.events,d=e.abrController,f=e.dashMetrics,h=e.playbackController,p=e.timelineConverter,g=e.type,m=e.streamInfo,y=e.dashConstants,v=e.segmentsController,_=e.isDynamic;function T(){return g}function b(){if(!(d&&f&&h&&p))throw new Error(r.default.MISSING_CONFIG_ERROR)}function E(){return i}function S(){return u}function w(){n=null,i=!0,o=[]}function A(e){return new Promise((function(t,n){var r=e.hasInitialization(),i=e.hasSegments(),a=[];a.push(v.updateInitData(e,r)),a.push(v.updateSegmentData(e,i)),Promise.all(a).then((function(n){var r;n[0]&&!n[0].error&&(e=function(e,t){return t&&!t.error&&t.representation?t.representation:e}(e,n[0])),n[1]&&!n[1].error&&(e=function(e,t){if(t&&!t.error){var n,r,i,a,o=t.segments,u=[],l=0;for(n=0,r=o?o.length:0;n<r;n++)i=o[n],(a=Object(s.getTimeBasedSegment)(p,_,e,i.startTime,i.duration,i.timescale,i.media,i.mediaRange,l))&&(u.push(a),a=null,l++);return u.length>0&&(e.segments=u),e}}(e,n[1])),(r=e).mediaFinishedInformation=v.getMediaFinishedInformation(r),function(e){if(E()){var t,n,r=f.getCurrentManifestUpdate(),i=!1;if(r){for(var a=0;a<r.representationInfo.length;a++)if((t=r.representationInfo[a]).index===e.index&&t.mediaType===T()){i=!0;break}i||f.addManifestUpdateRepresentationInfo(e,T())}if(function(){for(var e=0,t=o.length;e<t;e++){var n=o[e].segmentInfoType;if(!o[e].hasInitialization()||(n===y.SEGMENT_BASE||n===y.BASE_URL)&&!o[e].segments)return!1}return!0}()){d.setPlaybackQuality(g,m,(n=u,o.indexOf(n)));var s=f.getCurrentDVRInfo(g);s&&f.updateManifestUpdateInfo({latency:s.range.end-h.getTime()}),f.getCurrentRepresentationSwitch(S().adaptation.type)||I(),R()}}}(e),t()})).catch((function(e){n(e)}))}))}function I(){b();var e=new Date,t=S(),n=1e3*h.getTime();t&&f.addRepresentationSwitch(t.adaptation.type,e,n,t.id),l.trigger(a.default.REPRESENTATION_SWITCH,{mediaType:g,streamId:m.id,currentRepresentation:t,numberOfRepresentations:o.length},{streamId:m.id,mediaType:g})}function C(e){return null==e||e>=o.length?null:o[e]}function R(e){i=!1,l.trigger(c.DATA_UPDATE_COMPLETED,{data:n,currentRepresentation:u,error:e},{streamId:m.id,mediaType:g})}function D(e){u=e}function x(e){if(e.newDuration){var t=S();t&&t.adaptation.period&&(t.adaptation.period.duration=e.newDuration)}}return t={getStreamId:function(){return m.id},getType:T,getData:function(){return n},isUpdating:E,updateData:function(e,t,a,s,u){if(b(),i=!0,o=t,D(C(u)),n=e,a!==r.default.VIDEO&&a!==r.default.AUDIO&&(a!==r.default.TEXT||!s))return R(),Promise.resolve();for(var l=[],c=0,d=o.length;c<d;c++){var f=o[c];l.push(A(f))}return Promise.all(l)},getCurrentRepresentation:S,getRepresentationForQuality:C,prepareQualityChange:function(e){D(C(e)),I()},reset:function(){l.off(a.default.MANIFEST_VALIDITY_CHANGED,x,t),w()}},w(),l.on(a.default.MANIFEST_VALIDITY_CHANGED,x,t),t}o.__dashjs_factory_name="RepresentationController",t.default=i.default.getClassFactory(o)},"./src/dash/controllers/SegmentBaseController.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/dash/SegmentBaseLoader.js"),a=n("./src/dash/WebmSegmentBaseLoader.js");function s(e){e=e||{};var t,n,r,s=this.context,o=e.eventBus,u=e.events,l=e.dashMetrics,c=e.mediaPlayerModel,d=e.errHandler,f=e.baseURLController,h=e.debug,p=e.boxParser,g=e.requestModifier,m=e.errors;function y(e){return"webm"===(e?e.split("/")[1]:"").toLowerCase()}return t={initialize:function(){n.initialize(),r.initialize()},getSegmentBaseInitSegment:function(e){return y(e.representation.mimeType)?r.loadInitialization(e.representation,e.mediaType):n.loadInitialization(e.representation,e.mediaType)},getSegmentList:function(e){return y(e.mimeType)?r.loadSegments(e.representation,e.mediaType,e.representation?e.representation.indexRange:null):n.loadSegments(e.representation,e.mediaType,e.representation?e.representation.indexRange:null)},reset:function(){n.reset(),r.reset()}},n=Object(i.default)(s).getInstance(),r=Object(a.default)(s).getInstance(),n.setConfig({baseURLController:f,dashMetrics:l,mediaPlayerModel:c,errHandler:d,eventBus:o,events:u,errors:m,debug:h,boxParser:p,requestModifier:g}),r.setConfig({baseURLController:f,dashMetrics:l,mediaPlayerModel:c,errHandler:d,eventBus:o,events:u,errors:m,debug:h,requestModifier:g}),t}s.__dashjs_factory_name="SegmentBaseController";var o=r.default.getSingletonFactory(s);t.default=o},"./src/dash/controllers/SegmentsController.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/dash/utils/TimelineSegmentsGetter.js"),a=n("./src/dash/utils/TemplateSegmentsGetter.js"),s=n("./src/dash/utils/ListSegmentsGetter.js"),o=n("./src/dash/utils/SegmentBaseGetter.js");function u(e){e=e||{};var t,n,r=this.context,u=e.dashConstants,l=e.type,c=e.segmentBaseController;function d(e){return e?e.segments?n[u.SEGMENT_BASE]:n[e.segmentInfoType]:null}return t={initialize:function(t){n[u.SEGMENT_TIMELINE]=Object(i.default)(r).create(e,t),n[u.SEGMENT_TEMPLATE]=Object(a.default)(r).create(e,t),n[u.SEGMENT_LIST]=Object(s.default)(r).create(e,t),n[u.SEGMENT_BASE]=Object(o.default)(r).create(e,t)},updateInitData:function(e,t){return t?Promise.resolve():c.getSegmentBaseInitSegment({representation:e,mediaType:l})},updateSegmentData:function(e,t){return t?Promise.resolve():c.getSegmentList({mimeType:e.mimeType,representation:e,mediaType:l})},getSegmentByIndex:function(e,t,n){var r=d(e);return r?r.getSegmentByIndex(e,t,n):null},getSegmentByTime:function(e,t){var n=d(e);return n?n.getSegmentByTime(e,t):null},getMediaFinishedInformation:function(e){var t=d(e);return t?t.getMediaFinishedInformation(e):{numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN}}},n={},t}u.__dashjs_factory_name="SegmentsController";var l=r.default.getClassFactory(u);t.default=l},"./src/dash/models/DashManifestModel.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/dash/constants/DashConstants.js"),a=n("./src/dash/vo/Representation.js"),s=n("./src/dash/vo/AdaptationSet.js"),o=n("./src/dash/vo/Period.js"),u=n("./src/dash/vo/Mpd.js"),l=n("./src/dash/vo/UTCTiming.js"),c=n("./src/dash/vo/Event.js"),d=n("./src/dash/vo/BaseURL.js"),f=n("./src/dash/vo/EventStream.js"),h=n("./src/streaming/utils/ObjectUtils.js"),p=n("./src/streaming/utils/URLUtils.js"),g=n("./src/core/FactoryMaker.js"),m=n("./src/core/Debug.js"),y=n("./src/streaming/vo/DashJSError.js"),v=n("./src/core/errors/Errors.js"),_=n("./src/streaming/thumbnail/ThumbnailTracks.js");function T(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function E(){var e,t,n,g,b=this.context,E=Object(p.default)(b).getInstance(),S=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function w(e,t){if(!e)throw new Error("adaptation is not defined");if(!t)throw new Error("type is not defined");if(e.Representation_asArray&&e.Representation_asArray.length){var n=k(e.Representation_asArray[0]);if(n&&n.length>0&&_.THUMBNAILS_SCHEME_ID_URIS.indexOf(n[0].schemeIdUri)>=0)return t===r.default.IMAGE}if(e.ContentComponent_asArray&&e.ContentComponent_asArray.length>0){if(e.ContentComponent_asArray.length>1)return t===r.default.MUXED;if(e.ContentComponent_asArray[0].contentType===t)return!0}var a=t===r.default.TEXT?new RegExp("(ttml|vtt|wvtt|stpp)"):new RegExp(t);if(e.Representation_asArray&&e.Representation_asArray.length){var s=e.Representation_asArray[0].codecs;if(a.test(s))return!0}if(e.hasOwnProperty(i.default.MIME_TYPE))return a.test(e.mimeType);if(e.Representation_asArray)for(var o,u=0;u<e.Representation_asArray.length;u++)if((o=e.Representation_asArray[u]).hasOwnProperty(i.default.MIME_TYPE))return a.test(o.mimeType);return!1}function A(e){if(!e)throw new Error("adaptation is not defined");if(e.hasOwnProperty(i.default.SEGMENT_TEMPLATE)||e.hasOwnProperty(i.default.SEGMENT_TIMELINE)||e.hasOwnProperty(i.default.SEGMENT_LIST)||e.hasOwnProperty(i.default.SEGMENT_BASE))return!0;if(e.Representation_asArray&&e.Representation_asArray.length>0){var t=e.Representation_asArray[0];if(t.hasOwnProperty(i.default.SEGMENT_TEMPLATE)||t.hasOwnProperty(i.default.SEGMENT_TIMELINE)||t.hasOwnProperty(i.default.SEGMENT_LIST)||t.hasOwnProperty(i.default.SEGMENT_BASE))return!0}return!1}function I(e){return w(e,r.default.AUDIO)}function C(e){return w(e,r.default.VIDEO)}function R(e){return w(e,r.default.TEXT)}function D(e){return w(e,r.default.IMAGE)}function x(){return function(e,t){return e.bandwidth-t.bandwidth}}function N(e){return e&&Array.isArray(e.Representation_asArray)&&e.Representation_asArray.sort((function(e,t){return e.bandwidth-t.bandwidth})),e}function O(e,t){return e&&e.Period_asArray&&S(t)&&e.Period_asArray[t]?e.Period_asArray[t].AdaptationSet_asArray:[]}function P(e){return e&&e.Period_asArray?e.Period_asArray:[]}function M(e){var t=!1;return e&&e.hasOwnProperty("type")&&(t=e.type===i.default.DYNAMIC),t}function k(e){return e&&e.EssentialProperty_asArray&&e.EssentialProperty_asArray.length?e.EssentialProperty_asArray.map((function(e){return{schemeIdUri:e.schemeIdUri,value:e.value}})):null}function L(e){if(!e||!e.S_asArray)return NaN;var t=e.S_asArray[0],n=e.S_asArray[1];return t.hasOwnProperty("d")?t.d:n.t-t.t}function F(e,t){if(!e)throw new Error("Period cannot be null or undefined");var n=o.default.DEFAULT_ID+"_"+t;return e.hasOwnProperty(i.default.ID)&&e.id.length>0&&"__proto__"!==e.id&&(n=e.id),n}function U(e,t){var n,a=[];if(!e)return a;for(n=0;n<e.length;n++){var s=new f.default;if(s.timescale=1,s.representation=t,!e[n].hasOwnProperty(r.default.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");s.schemeIdUri=e[n].schemeIdUri,e[n].hasOwnProperty(i.default.TIMESCALE)&&(s.timescale=e[n].timescale),e[n].hasOwnProperty(i.default.VALUE)&&(s.value=e[n].value),a.push(s)}return a}function B(e){var t=[],n=e.BaseURL_asArray||[e.baseUri],r=!1;return n.some((function(n){if(n){var a=new d.default,s=n.__text||n;return E.isRelative(s)&&(r=!0,e.baseUri&&(s=E.resolve(s,e.baseUri))),a.url=s,n.hasOwnProperty(i.default.SERVICE_LOCATION)&&n.serviceLocation.length?a.serviceLocation=n.serviceLocation:a.serviceLocation=s,n.hasOwnProperty(i.default.DVB_PRIORITY)&&(a.dvb_priority=n[i.default.DVB_PRIORITY]),n.hasOwnProperty(i.default.DVB_WEIGHT)&&(a.dvb_weight=n[i.default.DVB_WEIGHT]),n.hasOwnProperty(i.default.AVAILABILITY_TIME_OFFSET)&&(a.availabilityTimeOffset=n[i.default.AVAILABILITY_TIME_OFFSET]),n.hasOwnProperty(i.default.AVAILABILITY_TIME_COMPLETE)&&(a.availabilityTimeComplete="false"!==n[i.default.AVAILABILITY_TIME_COMPLETE]),t.push(a),r}})),t}return e={getIsTypeOf:w,getIsText:R,getIsFragmented:A,getLanguageForAdaptation:function(e){var t="";return e&&e.hasOwnProperty(i.default.LANG)&&(t=e.lang.replace(/[^A-Za-z0-9-]/g,"")),t},getViewpointForAdaptation:function(e){return e&&e.hasOwnProperty(i.default.VIEWPOINT)?e.Viewpoint:null},getRolesForAdaptation:function(e){return e&&e.hasOwnProperty(i.default.ROLE_ASARRAY)?e.Role_asArray:[]},getAccessibilityForAdaptation:function(e){return e&&e.hasOwnProperty(i.default.ACCESSIBILITY_ASARRAY)?e.Accessibility_asArray:[]},getAudioChannelConfigurationForAdaptation:function(e){return e&&e.hasOwnProperty(i.default.AUDIOCHANNELCONFIGURATION_ASARRAY)?e.AudioChannelConfiguration_asArray:[]},getAudioChannelConfigurationForRepresentation:function(e){return e&&e.hasOwnProperty(i.default.AUDIOCHANNELCONFIGURATION_ASARRAY)?e.AudioChannelConfiguration_asArray:[]},getAdaptationForIndex:function(e,t,n){var r=O(t,n);return r.length>0&&S(e)?r[e]:null},getIndexForAdaptation:function(e,t,n){if(!e)return-1;for(var r=O(t,n),i=0;i<r.length;i++)if(Object(h.default)(b).getInstance().areEqual(r[i],e))return i;return-1},getAdaptationForId:function(e,t,n){var r,a,s=O(t,n);for(r=0,a=s.length;r<a;r++)if(s[r].hasOwnProperty(i.default.ID)&&s[r].id===e)return s[r];return null},getAdaptationsForType:function(e,t,n){var r,i,a=O(e,t),s=[];for(r=0,i=a.length;r<i;r++)w(a[r],n)&&s.push(N(a[r]));return s},getRealPeriods:P,getRealPeriodForIndex:function(e,t){var n=P(t);return n.length>0&&S(e)?n[e]:null},getCodec:function(e,t,n){var r=null;if(e&&e.Representation_asArray&&e.Representation_asArray.length>0){var i=S(t)&&t>=0&&t<e.Representation_asArray.length?e.Representation_asArray[t]:e.Representation_asArray[0];i&&(r=i.mimeType+';codecs="'+i.codecs+'"',n&&void 0!==i.width&&(r+=';width="'+i.width+'";height="'+i.height+'"'))}return r&&(r=r.replace(/\sprofiles=[^;]*/g,"")),r},getSelectionPriority:function(e){try{var t=e&&void 0!==e.selectionPriority?parseInt(e.selectionPriority):1;return isNaN(t)?1:t}catch(e){return 1}},getMimeType:function(e){return e&&e.Representation_asArray&&e.Representation_asArray.length>0?e.Representation_asArray[0].mimeType:null},getKID:function(e){return e&&e.hasOwnProperty(i.default.CENC_DEFAULT_KID)?e[i.default.CENC_DEFAULT_KID]:null},getLabelsForAdaptation:function(e){if(!e||!Array.isArray(e.Label_asArray))return[];for(var t=[],n=0;n<e.Label_asArray.length;n++)t.push({lang:e.Label_asArray[n].lang,text:e.Label_asArray[n].__text||e.Label_asArray[n]});return t},getContentProtectionData:function(e){return e&&e.hasOwnProperty(i.default.CONTENTPROTECTION_ASARRAY)&&0!==e.ContentProtection_asArray.length?e.ContentProtection_asArray:null},getIsDynamic:M,getId:function(e){return e&&e[i.default.ID]||null},hasProfile:function(e,t){var n=!1;return e&&e.profiles&&e.profiles.length>0&&(n=-1!==e.profiles.indexOf(t)),n},getDuration:function(e){return e&&e.hasOwnProperty(i.default.MEDIA_PRESENTATION_DURATION)?e.mediaPresentationDuration:e&&"dynamic"==e.type?Number.POSITIVE_INFINITY:Number.MAX_SAFE_INTEGER||Number.MAX_VALUE},getBandwidth:function(e){return e&&e.bandwidth?e.bandwidth:NaN},getManifestUpdatePeriod:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=NaN;return e&&e.hasOwnProperty(i.default.MINIMUM_UPDATE_PERIOD)&&(n=e.minimumUpdatePeriod),isNaN(n)?n:Math.max(n-t,1)},getPublishTime:function(e){return e&&e.hasOwnProperty(i.default.PUBLISH_TIME)?new Date(e[i.default.PUBLISH_TIME]):null},getRepresentationCount:function(e){return e&&Array.isArray(e.Representation_asArray)?e.Representation_asArray.length:0},getBitrateListForAdaptation:function(e){var t=N(e);return(t&&Array.isArray(t.Representation_asArray)?t.Representation_asArray:[]).map((function(e){return{bandwidth:e.bandwidth,width:e.width||0,height:e.height||0,scanType:e.scanType||null,id:e.id||null}}))},getRepresentationFor:function(e,t){return t&&t.Representation_asArray&&t.Representation_asArray.length>0&&S(e)?t.Representation_asArray[e]:null},getRepresentationsForAdaptation:function(e){var t,n,r,s,o=[],u=function(e){if(e&&e.period&&S(e.period.index)){var t=e.period.mpd.manifest.Period_asArray[e.period.index];if(t&&t.AdaptationSet_asArray&&S(e.index))return N(t.AdaptationSet_asArray[e.index])}}(e);if(u&&u.Representation_asArray){if(e&&e.period&&S(e.period.index)){var l=B(e.period.mpd.manifest);l&&(n=l[0])}for(var c=0,d=u.Representation_asArray.length;c<d;++c){var f=u.Representation_asArray[c],h=new a.default;if(h.index=c,h.adaptation=e,f.hasOwnProperty(i.default.ID)&&(h.id=f.id),f.hasOwnProperty(i.default.CODECS)&&(h.codecs=f.codecs),f.hasOwnProperty(i.default.MIME_TYPE)&&(h.mimeType=f[i.default.MIME_TYPE]),f.hasOwnProperty(i.default.CODEC_PRIVATE_DATA)&&(h.codecPrivateData=f.codecPrivateData),f.hasOwnProperty(i.default.BANDWITH)&&(h.bandwidth=f.bandwidth),f.hasOwnProperty(i.default.WIDTH)&&(h.width=f.width),f.hasOwnProperty(i.default.HEIGHT)&&(h.height=f.height),f.hasOwnProperty(i.default.SCAN_TYPE)&&(h.scanType=f.scanType),f.hasOwnProperty(i.default.MAX_PLAYOUT_RATE)&&(h.maxPlayoutRate=f.maxPlayoutRate),f.hasOwnProperty(i.default.SEGMENT_BASE)?(t=f.SegmentBase,h.segmentInfoType=i.default.SEGMENT_BASE):f.hasOwnProperty(i.default.SEGMENT_LIST)?(t=f.SegmentList).hasOwnProperty(i.default.SEGMENT_TIMELINE)?h.segmentInfoType=i.default.SEGMENT_TIMELINE:h.segmentInfoType=i.default.SEGMENT_LIST:f.hasOwnProperty(i.default.SEGMENT_TEMPLATE)?((t=f.SegmentTemplate).hasOwnProperty(i.default.SEGMENT_TIMELINE)?h.segmentInfoType=i.default.SEGMENT_TIMELINE:h.segmentInfoType=i.default.SEGMENT_TEMPLATE,t.hasOwnProperty(i.default.INITIALIZATION_MINUS)&&(h.initialization=t.initialization.split("$Bandwidth$").join(f.bandwidth).split("$RepresentationID$").join(f.id))):h.segmentInfoType=i.default.BASE_URL,h.essentialProperties=k(f),t){if(t.hasOwnProperty(i.default.INITIALIZATION)){var p=t.Initialization;p.hasOwnProperty(i.default.SOURCE_URL)&&(h.initialization=p.sourceURL),p.hasOwnProperty(i.default.RANGE)&&(h.range=p.range)}else R(u)&&A(u)&&u.mimeType&&-1===u.mimeType.indexOf("application/mp4")&&(h.range=0);t.hasOwnProperty(i.default.TIMESCALE)&&(h.timescale=t.timescale),t.hasOwnProperty(i.default.DURATION)?h.segmentDuration=t.duration/h.timescale:f.hasOwnProperty(i.default.SEGMENT_TEMPLATE)&&(t=f.SegmentTemplate).hasOwnProperty(i.default.SEGMENT_TIMELINE)&&(h.segmentDuration=L(t.SegmentTimeline)/h.timescale),t.hasOwnProperty(i.default.MEDIA)&&(h.media=t.media),t.hasOwnProperty(i.default.START_NUMBER)&&(h.startNumber=t.startNumber),t.hasOwnProperty(i.default.INDEX_RANGE)&&(h.indexRange=t.indexRange),t.hasOwnProperty(i.default.PRESENTATION_TIME_OFFSET)&&(h.presentationTimeOffset=t.presentationTimeOffset/h.timescale),t.hasOwnProperty(i.default.AVAILABILITY_TIME_OFFSET)?h.availabilityTimeOffset=t.availabilityTimeOffset:n&&void 0!==n.availabilityTimeOffset&&(h.availabilityTimeOffset=n.availabilityTimeOffset),t.hasOwnProperty(i.default.AVAILABILITY_TIME_COMPLETE)?h.availabilityTimeComplete="false"!==t.availabilityTimeComplete:n&&void 0!==n.availabilityTimeComplete&&(h.availabilityTimeComplete=n.availabilityTimeComplete)}h.MSETimeOffset=(s=void 0,s=(r=h).presentationTimeOffset,r.adaptation.period.start-s),h.path=[e.period.index,e.index,c],o.push(h)}}return o},getAdaptationsForPeriod:function(e){var n,a,o,u=e&&S(e.index)?e.mpd.manifest.Period_asArray[e.index]:null,l=[];if(u&&u.AdaptationSet_asArray)for(o=0;o<u.AdaptationSet_asArray.length;o++)a=u.AdaptationSet_asArray[o],n=new s.default,a.hasOwnProperty(i.default.ID)&&(n.id=a.id),n.index=o,n.period=e,w(a,r.default.MUXED)?n.type=r.default.MUXED:I(a)?n.type=r.default.AUDIO:C(a)?n.type=r.default.VIDEO:R(a)?n.type=r.default.TEXT:D(a)?n.type=r.default.IMAGE:t.warn("Unknown Adaptation stream type"),l.push(n);return l},getRegularPeriods:function(e){var a,s,u=!!e&&M(e.manifest),l=[],c=null,d=null,f=null,h=null;for(s=0,a=e&&e.manifest&&e.manifest.Period_asArray?e.manifest.Period_asArray.length:0;s<a;s++)(d=e.manifest.Period_asArray[s]).hasOwnProperty(i.default.START)?(h=new o.default).start=d.start:null!==c&&c.hasOwnProperty(i.default.DURATION)&&null!==f?(h=new o.default).start=parseFloat((f.start+f.duration).toFixed(5)):0!==s||u||((h=new o.default).start=0),null!==f&&isNaN(f.duration)&&(null!==h?f.duration=parseFloat((h.start-f.start).toFixed(5)):t.warn("First period duration could not be calculated because lack of start and duration period properties. This will cause timing issues during playback")),null!==h&&(h.id=F(d,s),h.index=s,h.mpd=e,d.hasOwnProperty(i.default.DURATION)&&(h.duration=d.duration),f&&(f.nextPeriodId=h.id),l.push(h),c=d,f=h),d=null,h=null;return 0===l.length||null!==f&&isNaN(f.duration)&&(f.duration=parseFloat((function(e){!function(){if(!n||!n.hasOwnProperty("error"))throw new Error(r.default.MISSING_CONFIG_ERROR)}();var t,i=M(e.mpd.manifest);return e.mpd.manifest.mediaPresentationDuration?t=e.mpd.manifest.mediaPresentationDuration:e.duration?t=e.duration:i?t=Number.POSITIVE_INFINITY:n.error(new y.default(v.default.MANIFEST_ERROR_ID_PARSE_CODE,"Must have @mediaPresentationDuration on MPD or an explicit @duration on the last period.",e)),t}(f)-f.start).toFixed(5))),l},getMpd:function(e){var t=new u.default;return e&&(t.manifest=e,e.hasOwnProperty(i.default.AVAILABILITY_START_TIME)?t.availabilityStartTime=new Date(e.availabilityStartTime.getTime()):e.loadedTime&&(t.availabilityStartTime=new Date(e.loadedTime.getTime())),e.hasOwnProperty(i.default.AVAILABILITY_END_TIME)&&(t.availabilityEndTime=new Date(e.availabilityEndTime.getTime())),e.hasOwnProperty(i.default.MINIMUM_UPDATE_PERIOD)&&(t.minimumUpdatePeriod=e.minimumUpdatePeriod),e.hasOwnProperty(i.default.MEDIA_PRESENTATION_DURATION)&&(t.mediaPresentationDuration=e.mediaPresentationDuration),e.hasOwnProperty(i.default.SUGGESTED_PRESENTATION_DELAY)&&(t.suggestedPresentationDelay=e.suggestedPresentationDelay),e.hasOwnProperty(i.default.TIMESHIFT_BUFFER_DEPTH)&&(t.timeShiftBufferDepth=e.timeShiftBufferDepth),e.hasOwnProperty(i.default.MAX_SEGMENT_DURATION)&&(t.maxSegmentDuration=e.maxSegmentDuration),e.hasOwnProperty(i.default.PUBLISH_TIME)&&(t.publishTime=new Date(e.publishTime))),t},getEventsForPeriod:function(e){var t,n,a=e&&e.mpd&&e.mpd.manifest?e.mpd.manifest:null,s=a?a.Period_asArray:null,o=s&&e&&S(e.index)?s[e.index].EventStream_asArray:null,u=[];if(o)for(t=0;t<o.length;t++){var l=new f.default;if(l.period=e,l.timescale=1,!o[t].hasOwnProperty(r.default.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");for(l.schemeIdUri=o[t][r.default.SCHEME_ID_URI],o[t].hasOwnProperty(i.default.TIMESCALE)&&(l.timescale=o[t][i.default.TIMESCALE]),o[t].hasOwnProperty(i.default.VALUE)&&(l.value=o[t][i.default.VALUE]),o[t].hasOwnProperty(i.default.PRESENTATION_TIME_OFFSET)&&(l.presentationTimeOffset=o[t][i.default.PRESENTATION_TIME_OFFSET]),n=0;o[t].Event_asArray&&n<o[t].Event_asArray.length;n++){var d=o[t].Event_asArray[n],h=new c.default;if(h.presentationTime=0,h.eventStream=l,d.hasOwnProperty(i.default.PRESENTATION_TIME)){h.presentationTime=d.presentationTime;var p=l.presentationTimeOffset?l.presentationTimeOffset/l.timescale:0;h.calculatedPresentationTime=h.presentationTime/l.timescale+e.start-p}d.hasOwnProperty(i.default.DURATION)&&(h.duration=d.duration/l.timescale),d.hasOwnProperty(i.default.ID)&&(h.id=d.id),d.Signal&&d.Signal.Binary?h.messageData=g.decodeArray(d.Signal.Binary.toString()):h.messageData=d.messageData||d.__text,u.push(h)}}return u},getEssentialPropertiesForRepresentation:k,getEventStreamForAdaptationSet:function(e,t){var n,r,i;return e&&e.Period_asArray&&t&&t.period&&S(t.period.index)&&(r=e.Period_asArray[t.period.index])&&r.AdaptationSet_asArray&&S(t.index)&&(i=r.AdaptationSet_asArray[t.index])&&(n=i.InbandEventStream_asArray),U(n,null)},getEventStreamForRepresentation:function(e,t){var n,r,i,a;return e&&e.Period_asArray&&t&&t.adaptation&&t.adaptation.period&&S(t.adaptation.period.index)&&(r=e.Period_asArray[t.adaptation.period.index])&&r.AdaptationSet_asArray&&S(t.adaptation.index)&&(i=r.AdaptationSet_asArray[t.adaptation.index])&&i.Representation_asArray&&S(t.index)&&(a=i.Representation_asArray[t.index])&&(n=a.InbandEventStream_asArray),U(n,t)},getUTCTimingSources:function(e){var t=M(e),n=!!e&&e.hasOwnProperty(i.default.AVAILABILITY_START_TIME),a=e?e.UTCTiming_asArray:null,s=[];return(t||n)&&a&&a.forEach((function(e){var t=new l.default;e.hasOwnProperty(r.default.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty(i.default.VALUE)&&(t.value=e.value.toString(),s.push(t)))})),s},getBaseURLsFromElement:B,getRepresentationSortFunction:x,getLocation:function(e){if(e&&e.hasOwnProperty(r.default.LOCATION))return e.Location=e.Location_asArray[0],e.Location},getPatchLocation:function(e){if(e&&e.hasOwnProperty(i.default.PATCH_LOCATION))return e.PatchLocation=e.PatchLocation_asArray[0],e.PatchLocation},getSuggestedPresentationDelay:function(e){return e&&e.hasOwnProperty(i.default.SUGGESTED_PRESENTATION_DELAY)?e.suggestedPresentationDelay:null},getAvailabilityStartTime:function(e){return e&&e.hasOwnProperty(i.default.AVAILABILITY_START_TIME)&&null!==e.availabilityStartTime?e.availabilityStartTime.getTime():null},getServiceDescriptions:function(e){var t=[];if(e&&e.hasOwnProperty(i.default.SERVICE_DESCRIPTION)){var n,a=T(e.ServiceDescription_asArray);try{for(a.s();!(n=a.n()).done;){var s=n.value,o=void 0,u=void 0,l=void 0,c=void 0;for(var d in s)s.hasOwnProperty(d)&&(d===i.default.ID?o=s[d]:d===i.default.SERVICE_DESCRIPTION_SCOPE?u=s[d].schemeIdUri:d===i.default.SERVICE_DESCRIPTION_LATENCY?l={target:s[d].target,max:s[d].max,min:s[d].min}:d===i.default.SERVICE_DESCRIPTION_PLAYBACK_RATE&&(c={max:s[d].max,min:s[d].min}));u===r.default.SERVICE_DESCRIPTION_LL_SCHEME&&(l||c)&&t.push({id:o,schemeIdUri:u,latency:l,playbackRate:c})}}catch(e){a.e(e)}finally{a.f()}}return t},getSupplementalProperties:function(e){var t={};if(e&&e.hasOwnProperty(i.default.SUPPLEMENTAL_PROPERTY)){var n,a=T(e.SupplementalProperty_asArray);try{for(a.s();!(n=a.n()).done;){var s=n.value;s.hasOwnProperty(r.default.SCHEME_ID_URI)&&s.hasOwnProperty(i.default.VALUE)&&(t[s[r.default.SCHEME_ID_URI]]=s[i.default.VALUE])}}catch(e){a.e(e)}finally{a.f()}}return t},setConfig:function(e){e&&(e.errHandler&&(n=e.errHandler),e.BASE64&&(g=e.BASE64))}},t=Object(m.default)(b).getInstance().getLogger(e),e}E.__dashjs_factory_name="DashManifestModel",t.default=g.default.getSingletonFactory(E)},"./src/dash/models/PatchManifestModel.js":function(e,t,n){n.r(t);var r=n("./src/dash/constants/DashConstants.js"),i=n("./src/core/FactoryMaker.js"),a=n("./src/core/Debug.js"),s=n("./src/dash/vo/SimpleXPath.js"),o=n("./src/dash/vo/PatchOperation.js");function u(){var e,t,n=this.context;return e={getIsPatch:function(e){return e&&e.hasOwnProperty(r.default.ORIGINAL_MPD_ID)||!1},getPublishTime:function(e){return e&&e.hasOwnProperty(r.default.PUBLISH_TIME)?new Date(e[r.default.PUBLISH_TIME]):null},getOriginalPublishTime:function(e){return e&&e.hasOwnProperty(r.default.ORIGINAL_PUBLISH_TIME)?new Date(e[r.default.ORIGINAL_PUBLISH_TIME]):null},getMpdId:function(e){return e&&e[r.default.ORIGINAL_MPD_ID]||null},getPatchOperations:function(e){return e?(e.__children||[]).map((function(e){var n=Object.keys(e)[0];if("add"!==n&&"remove"!==n&&"replace"!==n)return t.warn("Ignoring node of invalid action: ".concat(n)),null;var r=e[n],i=r.sel;if("add"===n&&r.type){if(!r.type.startsWith("@"))return t.warn("Ignoring add action for prefixed namespace declaration: ".concat(r.type,"=").concat(r.__text)),null;i="".concat(i,"/").concat(r.type)}var a=new s.default(i);if(!a.isValid())return t.warn("Ignoring action with invalid selector: ".concat(n," - ").concat(i)),null;var u=null;a.findsAttribute()?u=r.__text||"":"remove"!==n&&(u=r.__children.reduce((function(e,t){var n=Object.keys(t)[0];return"#text"!==n&&(e[n]=e[n]||[],e[n].push(t[n])),e}),{}));var l=new o.default(n,a,u);return"add"===n&&(l.position=r.pos),l})).filter((function(e){return!!e})):[]}},t=Object(a.default)(n).getInstance().getLogger(e),e}u.__dashjs_factory_name="PatchManifestModel",t.default=i.default.getSingletonFactory(u)},"./src/dash/parser/DashParser.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/dash/parser/objectiron.js"),a=n("./externals/xml2json.js"),s=n("./src/dash/parser/matchers/StringMatcher.js"),o=n("./src/dash/parser/matchers/DurationMatcher.js"),u=n("./src/dash/parser/matchers/DateTimeMatcher.js"),l=n("./src/dash/parser/matchers/NumericMatcher.js"),c=n("./src/dash/parser/maps/RepresentationBaseValuesMap.js"),d=n("./src/dash/parser/maps/SegmentValuesMap.js");function f(e){e=e||{};var t,n,r,f,h,p=this.context,g=e.debug;return t={parse:function(e){var t,r=window.performance.now();if(!(t=f.xml_str2json(e)))throw new Error("parsing the manifest failed");var i=window.performance.now();t.Patch?((t=t.Patch).add_asArray&&t.add_asArray.forEach((function(e){return h.run(e)})),t.replace_asArray&&t.replace_asArray.forEach((function(e){return h.run(e)}))):(t=t.MPD,h.run(t));var a=window.performance.now();return n.info("Parsing complete: ( xml2json: "+(i-r).toPrecision(3)+"ms, objectiron: "+(a-i).toPrecision(3)+"ms, total: "+((a-r)/1e3).toPrecision(3)+"s)"),t.protocol="DASH",t},getMatchers:function(){return r},getIron:function(){return h}},n=g.getLogger(t),r=[new o.default,new u.default,new l.default,new s.default],f=new a.default({escapeMode:!1,attributePrefix:"",arrayAccessForm:"property",emptyNodeForm:"object",stripWhitespaces:!1,enableToStringFunc:!0,ignoreRoot:!1,matchers:r}),h=Object(i.default)(p).create({adaptationset:new c.default,period:new d.default}),t}f.__dashjs_factory_name="DashParser",t.default=r.default.getClassFactory(f)},"./src/dash/parser/maps/CommonProperty.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i=function(){function e(t){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=t,this._merge=(n=t)&&n.length&&n.charAt(0)===n.charAt(0).toUpperCase()}var t,n,i;return t=e,(n=[{key:"name",get:function(){return this._name}},{key:"merge",get:function(){return this._merge}}])&&r(t.prototype,n),i&&r(t,i),e}();t.default=i},"./src/dash/parser/maps/MapNode.js":function(e,t,n){n.r(t);var r=n("./src/dash/parser/maps/CommonProperty.js");function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=function(){function e(t,n,i){var a=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=t||"",this._properties=[],this._children=i||[],Array.isArray(n)&&n.forEach((function(e){a._properties.push(new r.default(e))}))}var t,n,a;return t=e,(n=[{key:"name",get:function(){return this._name}},{key:"children",get:function(){return this._children}},{key:"properties",get:function(){return this._properties}}])&&i(t.prototype,n),a&&i(t,a),e}();t.default=a},"./src/dash/parser/maps/RepresentationBaseValuesMap.js":function(e,t,n){n.r(t);var r=n("./src/dash/parser/maps/MapNode.js"),i=n("./src/dash/constants/DashConstants.js");function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}function o(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u(e);if(t){var i=u(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}var l=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(n,e);var t=o(n);function n(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var e=[i.default.PROFILES,i.default.WIDTH,i.default.HEIGHT,i.default.SAR,i.default.FRAMERATE,i.default.AUDIO_SAMPLING_RATE,i.default.MIME_TYPE,i.default.SEGMENT_PROFILES,i.default.CODECS,i.default.MAXIMUM_SAP_PERIOD,i.default.START_WITH_SAP,i.default.MAX_PLAYOUT_RATE,i.default.CODING_DEPENDENCY,i.default.SCAN_TYPE,i.default.FRAME_PACKING,i.default.AUDIO_CHANNEL_CONFIGURATION,i.default.CONTENT_PROTECTION,i.default.ESSENTIAL_PROPERTY,i.default.SUPPLEMENTAL_PROPERTY,i.default.INBAND_EVENT_STREAM];return t.call(this,i.default.ADAPTATION_SET,e,[new r.default(i.default.REPRESENTATION,e,[new r.default(i.default.SUB_REPRESENTATION,e)])])}return n}(r.default);t.default=l},"./src/dash/parser/maps/SegmentValuesMap.js":function(e,t,n){n.r(t);var r=n("./src/dash/parser/maps/MapNode.js"),i=n("./src/dash/constants/DashConstants.js");function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}function o(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u(e);if(t){var i=u(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}var l=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(n,e);var t=o(n);function n(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var e=[i.default.SEGMENT_BASE,i.default.SEGMENT_TEMPLATE,i.default.SEGMENT_LIST];return t.call(this,i.default.PERIOD,e,[new r.default(i.default.ADAPTATION_SET,e,[new r.default(i.default.REPRESENTATION,e)])])}return n}(r.default);t.default=l},"./src/dash/parser/matchers/BaseMatcher.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._test=t,this._converter=n}var t,n,i;return t=e,(n=[{key:"test",get:function(){return this._test}},{key:"converter",get:function(){return this._converter}}])&&r(t.prototype,n),i&&r(t,i),e}();t.default=i},"./src/dash/parser/matchers/DateTimeMatcher.js":function(e,t,n){n.r(t);var r=n("./src/dash/parser/matchers/BaseMatcher.js");function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=o(e);if(t){var a=o(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}var u=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+-])([0-9]{2})(?::?)([0-9]{2}))?/,l=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(n,e);var t=s(n);function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),t.call(this,(function(e){return u.test(e.value)}),(function(e){var t,n=u.exec(e);if(t=Date.UTC(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10),parseInt(n[4],10),parseInt(n[5],10),n[6]&&parseInt(n[6],10)||0,n[7]&&1e3*parseFloat(n[7])||0),n[9]&&n[10]){var r=60*parseInt(n[9],10)+parseInt(n[10],10);t+=("+"===n[8]?-1:1)*r*60*1e3}return new Date(t)}))}return n}(r.default);t.default=l},"./src/dash/parser/matchers/DurationMatcher.js":function(e,t,n){n.r(t);var r=n("./src/dash/parser/matchers/BaseMatcher.js"),i=n("./src/streaming/constants/Constants.js"),a=n("./src/dash/constants/DashConstants.js");function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=l(e);if(t){var i=l(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}var c=/^([-])?P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,d=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(n,e);var t=u(n);function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),t.call(this,(function(e){for(var t=[a.default.MIN_BUFFER_TIME,a.default.MEDIA_PRESENTATION_DURATION,a.default.MINIMUM_UPDATE_PERIOD,a.default.TIMESHIFT_BUFFER_DEPTH,a.default.MAX_SEGMENT_DURATION,a.default.MAX_SUBSEGMENT_DURATION,a.default.SUGGESTED_PRESENTATION_DELAY,a.default.START,i.default.START_TIME,a.default.DURATION],n=t.length,r=0;r<n;r++)if(e.nodeName===t[r])return c.test(e.value);return!1}),(function(e){var t=c.exec(e),n=31536e3*parseFloat(t[3]||0)+2592e3*parseFloat(t[5]||0)+86400*parseFloat(t[7]||0)+3600*parseFloat(t[9]||0)+60*parseFloat(t[11]||0)+parseFloat(t[13]||0);return void 0!==t[1]&&(n=-n),n}))}return n}(r.default);t.default=d},"./src/dash/parser/matchers/NumericMatcher.js":function(e,t,n){n.r(t);var r=n("./src/dash/parser/matchers/BaseMatcher.js");function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=o(e);if(t){var a=o(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}var u=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/,l=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(n,e);var t=s(n);function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),t.call(this,(function(e){return u.test(e.value)}),(function(e){return parseFloat(e)}))}return n}(r.default);t.default=l},"./src/dash/parser/matchers/StringMatcher.js":function(e,t,n){n.r(t);var r=n("./src/dash/parser/matchers/BaseMatcher.js"),i=n("./src/dash/constants/DashConstants.js");function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=l(e);if(t){var i=l(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(n,e);var t=u(n);function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),t.call(this,(function(e,t){var n,r=(s(n={},i.default.MPD,[i.default.ID,i.default.PROFILES]),s(n,i.default.PERIOD,[i.default.ID]),s(n,i.default.BASE_URL,[i.default.SERVICE_LOCATION,i.default.BYTE_RANGE]),s(n,i.default.SEGMENT_BASE,[i.default.INDEX_RANGE]),s(n,i.default.INITIALIZATION,[i.default.RANGE]),s(n,i.default.REPRESENTATION_INDEX,[i.default.RANGE]),s(n,i.default.SEGMENT_LIST,[i.default.INDEX_RANGE]),s(n,i.default.BITSTREAM_SWITCHING,[i.default.RANGE]),s(n,i.default.SEGMENT_URL,[i.default.MEDIA_RANGE,i.default.INDEX_RANGE]),s(n,i.default.SEGMENT_TEMPLATE,[i.default.INDEX_RANGE,i.default.MEDIA,i.default.INDEX,i.default.INITIALIZATION_MINUS,i.default.BITSTREAM_SWITCHING_MINUS]),s(n,i.default.ASSET_IDENTIFIER,[i.default.VALUE,i.default.ID]),s(n,i.default.EVENT_STREAM,[i.default.VALUE]),s(n,i.default.ADAPTATION_SET,[i.default.PROFILES,i.default.MIME_TYPE,i.default.SEGMENT_PROFILES,i.default.CODECS,i.default.CONTENT_TYPE]),s(n,i.default.FRAME_PACKING,[i.default.VALUE,i.default.ID]),s(n,i.default.AUDIO_CHANNEL_CONFIGURATION,[i.default.VALUE,i.default.ID]),s(n,i.default.CONTENT_PROTECTION,[i.default.VALUE,i.default.ID]),s(n,i.default.ESSENTIAL_PROPERTY,[i.default.VALUE,i.default.ID]),s(n,i.default.SUPPLEMENTAL_PROPERTY,[i.default.VALUE,i.default.ID]),s(n,i.default.INBAND_EVENT_STREAM,[i.default.VALUE,i.default.ID]),s(n,i.default.ACCESSIBILITY,[i.default.VALUE,i.default.ID]),s(n,i.default.ROLE,[i.default.VALUE,i.default.ID]),s(n,i.default.RATING,[i.default.VALUE,i.default.ID]),s(n,i.default.VIEWPOINT,[i.default.VALUE,i.default.ID]),s(n,i.default.CONTENT_COMPONENT,[i.default.CONTENT_TYPE]),s(n,i.default.REPRESENTATION,[i.default.ID,i.default.DEPENDENCY_ID,i.default.MEDIA_STREAM_STRUCTURE_ID]),s(n,i.default.SUBSET,[i.default.ID]),s(n,i.default.METRICS,[i.default.METRICS_MINUS]),s(n,i.default.REPORTING,[i.default.VALUE,i.default.ID]),n);if(r.hasOwnProperty(t)){var a=r[t];return void 0!==a&&a.indexOf(e.name)>=0}return!1}),(function(e){return String(e)}))}return n}(r.default);t.default=c},"./src/dash/parser/objectiron.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js");function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e){function t(e,t){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}function n(e,n,r){for(var a=0,s=e.length;a<s;++a){var o=e[a];if(n[o.name])if(r[o.name]){if(o.merge){var u=n[o.name],l=r[o.name];"object"===i(u)&&"object"===i(l)?t(u,l):r[o.name]=u+l}}else r[o.name]=n[o.name]}}function r(e,t){for(var i=0,a=e.children.length;i<a;++i){var s=e.children[i],o=t[s.name+"_asArray"];if(o)for(var u=0,l=o.length;u<l;++u){var c=o[u];n(e.properties,t,c),r(s,c)}}}return{run:function(t){if(null===t||"object"!==i(t))return t;if(t.Period_asArray&&"period"in e)for(var n=e.period,a=t.Period_asArray,s=0,o=a.length;s<o;++s){var u=a[s];if(r(n,u),"adaptationset"in e){var l=u.AdaptationSet_asArray;if(l)for(var c=e.adaptationset,d=0,f=l.length;d<f;++d)r(c,l[d])}}return t}}}a.__dashjs_factory_name="ObjectIron";var s=r.default.getClassFactory(a);t.default=s},"./src/dash/utils/ListSegmentsGetter.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/constants/Constants.js"),a=n("./src/dash/utils/SegmentsUtils.js");function s(e,t){var n,r=(e=e||{}).timelineConverter;function s(){if(!r||!r.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(i.default.MISSING_CONFIG_ERROR)}function o(e,n){if(s(),!e)return null;var i=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,o=i.SegmentURL_asArray.length,u=e&&!isNaN(e.startNumber)?e.startNumber:1,l=Math.max(u-1,0),c=Math.max(n-l,0),d=null;if(c<o){var f=i.SegmentURL_asArray[c];(d=Object(a.getIndexBasedSegment)(r,t,e,n))&&(d.replacementTime=(u+n-1)*e.segmentDuration,d.media=f.media?f.media:"",d.mediaRange=f.mediaRange,d.indexRange=f.indexRange)}return d}return n={getSegmentByIndex:o,getSegmentByTime:function(e,t){if(s(),!e)return null;var n=e.segmentDuration;if(isNaN(n))return null;var i=r.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return o(e,Math.floor(i/n))},getMediaFinishedInformation:function(e){var t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!e)return t;var n=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,r=e&&!isNaN(e.startNumber)?e.startNumber:1,i=Math.max(r-1,0);return t.numberOfSegments=i+n.SegmentURL_asArray.length,t}},n}s.__dashjs_factory_name="ListSegmentsGetter";var o=r.default.getClassFactory(s);t.default=o},"./src/dash/utils/Round10.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t),n.d(t,"default",(function(){return i}));var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,i=[{key:"round10",value:function(e,t){return function(e,t,n){return void 0===n||0==+n?Math[e](t):(n=+n,null===(t=+t)||isNaN(t)||"number"!=typeof n||n%1!=0?NaN:(t=t.toString().split("e"),+((t=(t=Math[e](+(t[0]+"e"+(t[1]?+t[1]-n:-n)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]+n:n))))}("round",e,t)}}],(n=null)&&r(t.prototype,n),i&&r(t,i),e}()},"./src/dash/utils/SegmentBaseGetter.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/constants/Constants.js");function a(e){var t,n=(e=e||{}).timelineConverter;function r(){if(!n||!n.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(i.default.MISSING_CONFIG_ERROR)}function a(e,t){if(r(),!e)return null;var n,i=e.segments?e.segments.length:-1;if(t<i&&(n=e.segments[t])&&n.index===t)return n;for(var a=0;a<i;a++)if((n=e.segments[a])&&n.index===t)return n;return null}return t={getSegmentByIndex:a,getSegmentByTime:function(e,t){r();var n=function(e,t){if(!e)return-1;var n,r,i,a,s,o=e.segments,u=o?o.length:null,l=-1;if(o&&u>0)for(s=0;s<u;s++)if(i=(r=o[s]).presentationStartTime,t+(n=(a=r.duration)/2)>=i&&t-n<i+a){l=r.index;break}return l}(e,t);return a(e,n)},getMediaFinishedInformation:function(e){var t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};return e&&e.segments?(t.numberOfSegments=e.segments.length,t):t}},t}a.__dashjs_factory_name="SegmentBaseGetter";var s=r.default.getClassFactory(a);t.default=s},"./src/dash/utils/SegmentsUtils.js":function(e,t,n){n.r(t),n.d(t,"unescapeDollarsInTemplate",(function(){return a})),n.d(t,"replaceIDForTemplate",(function(){return s})),n.d(t,"replaceTokenForTemplate",(function(){return o})),n.d(t,"getIndexBasedSegment",(function(){return c})),n.d(t,"getTimeBasedSegment",(function(){return d}));var r=n("./src/dash/vo/Segment.js");function i(e,t){for(;e.length<t;)e="0"+e;return e}function a(e){return e?e.split("$$").join("$"):e}function s(e,t){if(!t||!e||-1===e.indexOf("$RepresentationID$"))return e;var n=t.toString();return e.split("$RepresentationID$").join(n)}function o(e,t,n){var r,a,s,o,u,l,c=t.length;if(!e)return e;for(;;){if((r=e.indexOf("$"+t))<0)return e;if((a=e.indexOf("$",r+c))<0)return e;if((s=e.indexOf("%0",r+c))>r&&s<a)switch(o=e.charAt(a-1),u=parseInt(e.substring(s+2,a-1),10),o){case"d":case"i":case"u":l=i(n.toString(),u);break;case"x":l=i(n.toString(16),u);break;case"X":l=i(n.toString(16),u).toUpperCase();break;case"o":l=i(n.toString(8),u);break;default:return e}else l=n;e=e.substring(0,r)+l+e.substring(a+1)}}function u(e,t,n,i,a,s,o,u){var l,c=new r.default;return c.representation=e,c.duration=t,c.presentationStartTime=n,c.mediaStartTime=i,c.availabilityStartTime=a.calcAvailabilityStartTimeFromPresentationTime(s,e,o),c.availabilityEndTime=a.calcAvailabilityEndTimeFromPresentationTime(s+t,e,o),c.wallStartTime=a.calcWallTimeForSegment(c,o),c.replacementNumber=(l=u,c.representation.startNumber+l),c.index=u,c}function l(e,t,n,r){var i=t.adaptation.period;if(isFinite(i.duration)&&i.start+i.duration<=n.presentationStartTime)return!1;if(r){if("INF"===t.availabilityTimeOffset)return!0;var a=e.getClientReferenceTime();return n.availabilityStartTime.getTime()<=a&&(!isFinite(n.availabilityEndTime)||n.availabilityEndTime.getTime()>=a)}return!0}function c(e,t,n,r){var i,a,s;i=n.segmentDuration,isNaN(i)&&(i=n.adaptation.period.duration),a=parseFloat((n.adaptation.period.start+r*i).toFixed(5)),s=parseFloat((a+i).toFixed(5));var o=u(n,i,a,e.calcMediaTimeFromPresentationTime(a,n),e,s,t,r);return l(e,n,o,t)?o:null}function d(e,t,n,r,i,a,s,c,d,f){var h,p,g=r/a,m=i/a;return h=e.calcPresentationTimeFromMediaTime(g,n),l(e,n,p=u(n,m,h,g,e,h+m,t,d),t)?(p.replacementTime=f||r,s=o(s,"Number",p.replacementNumber),s=o(s,"Time",p.replacementTime),p.media=s,p.mediaRange=c,p):null}},"./src/dash/utils/TemplateSegmentsGetter.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/constants/Constants.js"),a=n("./src/dash/utils/SegmentsUtils.js");function s(e,t){var n,r=(e=e||{}).timelineConverter;function s(){if(!r||!r.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(i.default.MISSING_CONFIG_ERROR)}function o(e,n){if(s(),!e)return null;var i=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate;n=Math.max(n,0);var o=Object(a.getIndexBasedSegment)(r,t,e,n);if(o){o.replacementTime=Math.round((n-1)*e.segmentDuration*e.timescale,10);var u=i.media;u=Object(a.replaceTokenForTemplate)(u,"Number",o.replacementNumber),u=Object(a.replaceTokenForTemplate)(u,"Time",o.replacementTime),o.media=u}return o}return n={getSegmentByIndex:o,getSegmentByTime:function(e,t){if(s(),!e)return null;var n=e.segmentDuration;if(isNaN(n))return null;var i=r.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return o(e,Math.floor(i/n))},getMediaFinishedInformation:function(e){var t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!e)return t;var n=e.segmentDuration;return isNaN(n)?t.numberOfSegments=1:t.numberOfSegments=Math.ceil(e.adaptation.period.duration/n),t}},n}s.__dashjs_factory_name="TemplateSegmentsGetter";var o=r.default.getClassFactory(s);t.default=o},"./src/dash/utils/TimelineConverter.js":function(e,t,n){n.r(t);var r=n("./src/core/EventBus.js"),i=n("./src/core/events/Events.js"),a=n("./src/core/FactoryMaker.js"),s=n("./src/dash/constants/DashConstants.js"),o=n("./src/dash/models/DashManifestModel.js"),u=n("./src/core/Settings.js"),l=n("./src/streaming/constants/Constants.js"),c=n("./src/streaming/MediaPlayerEvents.js"),d=n("./src/streaming/constants/ConformanceViolationConstants.js");function f(){var e,t,n,a,f=this.context,h=Object(r.default)(f).getInstance(),p=Object(u.default)(f).getInstance();function g(e){a=e}function m(e,t,n,r){var i,a=t.adaptation.period.mpd,s=a.availabilityStartTime;if(r)i=n&&a.timeShiftBufferDepth!==Number.POSITIVE_INFINITY?new Date(s.getTime()+1e3*(e+a.timeShiftBufferDepth)):a.availabilityEndTime;else if(n){var o=t.availabilityTimeOffset;i=new Date(s.getTime()+1e3*(e-o))}else i=s;return i}function y(e,t){return(e.getTime()-t.mpd.availabilityStartTime.getTime()+1e3*a)/1e3}function v(e,t){return e+(t.adaptation.period.start-t.presentationTimeOffset)}function _(e){var n={start:NaN,end:NaN},r=e[0].getAdapter().getRegularPeriods()[0],i=y(new Date,r);if(!e||0===e.length)return{range:n,now:i};e.forEach((function(e){var r=e.getAdapter(),a=r.getMediaInfoForType(e.getStreamInfo(),l.default.VIDEO)||r.getMediaInfoForType(e.getStreamInfo(),l.default.AUDIO),o=r.getVoRepresentations(a)[0],u={start:NaN,end:NaN};if(o)if(o.segmentInfoType===s.default.SEGMENT_TIMELINE)u=function(e){var n,r,i,a,s=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],o=t.getRepresentationFor(e.index,s),u=o.SegmentTemplate.SegmentTimeline,l=o.SegmentTemplate.timescale,c=u.S_asArray,d={start:0,end:0},f=0;for(d.start=v(c[0].t/l,e),i=0,a=c.length;i<a;i++)r=0,(n=c[i]).hasOwnProperty("r")&&(r=n.r),f+=n.d/l*(1+r);return d.end=d.start+f,d}(o);else{var c=o.adaptation.period;u.start=c.start,u.end=Math.max(i,c.start+c.duration)}!isNaN(u.start)&&(isNaN(n.start)||n.start>u.start)&&(n.start=u.start),!isNaN(u.end)&&(isNaN(n.end)||n.end<u.end)&&(n.end=u.end)})),n.end=Math.min(i,n.end);var a=b(e,n.end,!0);return n.end=isNaN(a)?n.end:a,n.start=r&&r.mpd&&r.mpd.timeShiftBufferDepth&&!isNaN(r.mpd.timeShiftBufferDepth)&&!isNaN(n.end)?Math.max(n.end-r.mpd.timeShiftBufferDepth,n.start):n.start,n.start=b(e,n.start),{range:n,now:i}}function T(e,t){n=e-t.end}function b(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{for(var r=0,i=!1,a=NaN;!i&&r<e.length;){var s=e[r].getStreamInfo();s.start<=t&&(!isFinite(s.duration)||s.start+s.duration>=t)?(a=t,i=!0):!n&&s.start>t&&(isNaN(a)||s.start<a)?a=s.start:n&&s.start+s.duration<t&&(isNaN(a)||s.start+s.duration>a)&&(a=s.start+s.duration),r+=1}return a}catch(e){return t}}function E(e){void 0===e.offset||isNaN(e.offset)||g(e.offset/1e3)}function S(){a=0,n=0}function w(){h.off(i.default.UPDATE_TIME_SYNC_OFFSET,E,this),S()}return e={initialize:function(){S(),h.on(i.default.UPDATE_TIME_SYNC_OFFSET,E,this)},getClientTimeOffset:function(){return a},setClientTimeOffset:g,getClientReferenceTime:function(){return Date.now()-1e3*n+1e3*a},calcAvailabilityStartTimeFromPresentationTime:function(e,t,n){return m(e,t,n)},calcAvailabilityEndTimeFromPresentationTime:function(e,t,n){return m(e,t,n,!0)},calcPresentationTimeFromWallTime:y,calcPresentationTimeFromMediaTime:v,calcPeriodRelativeTimeFromMpdRelativeTime:function(e,t){return t-e.adaptation.period.start},calcMediaTimeFromPresentationTime:function(e,t){return e-t.adaptation.period.start+t.presentationTimeOffset},calcWallTimeForSegment:function(e,t){var n,r,i;return t&&(n=e.representation.adaptation.period.mpd.suggestedPresentationDelay,r=e.presentationStartTime+n,i=new Date(e.availabilityStartTime.getTime()+1e3*r)),i},calcTimeShiftBufferWindow:function(e,t){if(!t)return function(e){var t={start:NaN,end:NaN},n=0,r=NaN;return e.forEach((function(e){var t=e.getStreamInfo();n+=t.duration,(isNaN(r)||t.start<r)&&(r=t.start)})),t.start=r,t.end=r+n,t}(e);if(p.get().streaming.timeShiftBuffer.calcFromSegmentTimeline){var n=_(e);return T(n.now,n.range),n.range}return function(e){var t={start:NaN,end:NaN};if(!e||0===e.length)return t;var n=e[0].getAdapter().getRegularPeriods()[0],r=y(new Date,n),i=n.mpd.timeShiftBufferDepth,a=isNaN(i)?0:r-i;if(t.start=b(e,a),t.end=!isNaN(t.start)&&r<t.start?r:b(e,r,!0),!isNaN(i)&&t.end<r-i&&(t.end=NaN),p.get().streaming.timeShiftBuffer.fallbackToSegmentTimeline){var s=_(e);if(s.range.end<t.start)return h.trigger(c.default.CONFORMANCE_VIOLATION,{level:d.default.LEVELS.WARNING,event:d.default.EVENTS.INVALID_DVR_WINDOW}),T(s.now,s.range),s.range}return t}(e)},reset:w},t=Object(o.default)(f).getInstance(),w(),e}f.__dashjs_factory_name="TimelineConverter",t.default=a.default.getSingletonFactory(f)},"./src/dash/utils/TimelineSegmentsGetter.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/constants/Constants.js"),a=n("./src/dash/utils/SegmentsUtils.js");function s(e,t){var n,r=(e=e||{}).timelineConverter,s=e.dashMetrics;function o(){if(!r)throw new Error(i.default.MISSING_CONFIG_ERROR)}function u(e,t){var n,r,i,a,s,o,u,c=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate||e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,d=c.SegmentTimeline,f=c.SegmentURL_asArray,h=0,p=0,g=-1;u=e.timescale;var m=!1;for(i=0,a=(n=d.S_asArray).length;i<a&&!m;i++)for(o=0,(r=n[i]).hasOwnProperty("r")&&(o=r.r),r.hasOwnProperty("t")&&(p=(h=r.t)/u),o<0&&(o=l(e,n[i+1],r,u,p)),s=0;s<=o&&!m;s++)(m=t(h,p,c,f,r,u,++g,i))&&(e.segmentDuration=r.d/u),p=(h+=r.d)/u}function l(e,t,n,i,a){var o;if(t&&t.hasOwnProperty("t"))o=t.t/i;else try{var u=0;if(isNaN(e.adaptation.period.start)||isNaN(e.adaptation.period.duration)||!isFinite(e.adaptation.period.duration)){var l=s.getCurrentDVRInfo();u=isNaN(l.end)?0:l.end}else u=e.adaptation.period.start+e.adaptation.period.duration;o=r.calcMediaTimeFromPresentationTime(u,e),e.segmentDuration=n.d/i}catch(e){o=0}return Math.max(Math.ceil((o-a)/(n.d/i))-1,0)}return n={getSegmentByIndex:function(e,n,i){if(o(),!e)return null;var s=null,l=!1;return u(e,(function(n,o,u,c,d,f,h,p){if(l||i<0){var g=u.media,m=d.mediaRange;return c&&(g=c[p].media||"",m=c[p].mediaRange),s=Object(a.getTimeBasedSegment)(r,t,e,n,d.d,f,g,m,h,d.tManifest),!0}return o>=i-.5*d.d/f&&(l=!0),!1})),s},getSegmentByTime:function(e,n){if(o(),!e)return null;void 0===n&&(n=null);var i=null,s=r.calcMediaTimeFromPresentationTime(n,e);return u(e,(function(n,o,u,l,c,d,f,h){if(s<o+c.d/d){var p=u.media,g=c.mediaRange;return l&&(p=l[h].media||"",g=l[h].mediaRange),i=Object(a.getTimeBasedSegment)(r,t,e,n,c.d,d,p,g,f,c.tManifest),!0}return!1})),i},getMediaFinishedInformation:function(e){if(!e)return 0;var t,n,r,i,a,s,o,u=(e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate||e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList).SegmentTimeline,c=0,d=0,f=0;for(o=e.timescale,i=(t=u.S_asArray).length,r=0;r<i;r++)for(s=0,(n=t[r]).hasOwnProperty("r")&&(s=n.r),n.hasOwnProperty("t")&&(d=(c=n.t)/o),s<0&&(s=l(e,t[r+1],n,o,d)),a=0;a<=s;a++)f++,d=(c+=n.d)/o;return{numberOfSegments:f,mediaTimeOfLastSignaledSegment:d}}},n}s.__dashjs_factory_name="TimelineSegmentsGetter";var o=r.default.getClassFactory(s);t.default=o},"./src/dash/vo/AdaptationSet.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.period=null,this.index=-1,this.type=null}},"./src/dash/vo/BaseURL.js":function(e,t,n){n.r(t);var r=function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t||"",this.serviceLocation=n||t||"",this.dvb_priority=r||1,this.dvb_weight=i||1,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0};r.DEFAULT_DVB_PRIORITY=1,r.DEFAULT_DVB_WEIGHT=1,t.default=r},"./src/dash/vo/Event.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.duration=NaN,this.presentationTime=NaN,this.id=NaN,this.messageData="",this.eventStream=null,this.presentationTimeDelta=NaN}},"./src/dash/vo/EventStream.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.adaptionSet=null,this.representation=null,this.period=null,this.timescale=1,this.value="",this.schemeIdUri="",this.presentationTimeOffset=0}},"./src/dash/vo/ManifestInfo.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.dvrWindowSize=NaN,this.loadedTime=null,this.availableFrom=null,this.minBufferTime=NaN,this.duration=NaN,this.isDynamic=!1,this.maxFragmentDuration=null}},"./src/dash/vo/MediaInfo.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=null,this.type=null,this.streamInfo=null,this.representationCount=0,this.labels=null,this.lang=null,this.viewpoint=null,this.accessibility=null,this.audioChannelConfiguration=null,this.roles=null,this.codec=null,this.mimeType=null,this.contentProtection=null,this.KID=null,this.bitrateList=null,this.isFragmented=null,this.isEmbedded=null,this.selectionPriority=1}},"./src/dash/vo/Mpd.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.manifest=null,this.suggestedPresentationDelay=0,this.availabilityStartTime=null,this.availabilityEndTime=Number.POSITIVE_INFINITY,this.timeShiftBufferDepth=Number.POSITIVE_INFINITY,this.maxSegmentDuration=Number.POSITIVE_INFINITY,this.publishTime=null,this.minimumUpdatePeriod=NaN,this.mediaPresentationDuration=NaN}},"./src/dash/vo/PatchOperation.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.action=t,this.xpath=n,this.value=r,this.position=null}var t,n,i;return t=e,(n=[{key:"getMpdTarget",value:function(e){var t="remove"===this.action||"replace"===this.action||"before"===this.position||"after"===this.position;return this.xpath.getMpdTarget(e,t)}}])&&r(t.prototype,n),i&&r(t,i),e}();t.default=i},"./src/dash/vo/Period.js":function(e,t,n){n.r(t);var r=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=-1,this.duration=NaN,this.start=NaN,this.mpd=null,this.nextPeriodId=null};r.DEFAULT_ID="defaultId",t.default=r},"./src/dash/vo/Representation.js":function(e,t,n){n.r(t);var r=n("./src/dash/constants/DashConstants.js");function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=-1,this.adaptation=null,this.segmentInfoType=null,this.initialization=null,this.codecs=null,this.mimeType=null,this.codecPrivateData=null,this.segmentDuration=NaN,this.timescale=1,this.startNumber=1,this.indexRange=null,this.range=null,this.presentationTimeOffset=0,this.MSETimeOffset=NaN,this.mediaFinishedInformation={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN},this.bandwidth=NaN,this.width=NaN,this.height=NaN,this.scanType=null,this.maxPlayoutRate=NaN,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0}var t,n,a;return t=e,(n=[{key:"hasInitialization",value:function(){return null!==this.initialization||null!==this.range}},{key:"hasSegments",value:function(){return this.segmentInfoType!==r.default.BASE_URL&&this.segmentInfoType!==r.default.SEGMENT_BASE&&!this.indexRange}}])&&i(t.prototype,n),a&&i(t,a),e}();t.default=a},"./src/dash/vo/RepresentationInfo.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.quality=null,this.fragmentDuration=null,this.mediaInfo=null,this.MSETimeOffset=null}},"./src/dash/vo/Segment.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.indexRange=null,this.index=null,this.mediaRange=null,this.media=null,this.duration=NaN,this.replacementTime=null,this.replacementNumber=NaN,this.mediaStartTime=NaN,this.presentationStartTime=NaN,this.availabilityStartTime=NaN,this.availabilityEndTime=NaN,this.wallStartTime=NaN,this.representation=null}},"./src/dash/vo/SimpleXPath.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.valid="/"==t[0],this.path=t.split("/").filter((function(e){return 0!==e.length})).map((function(e){var t={name:e},r=e.indexOf("[");if(-1!=r){t.name=e.substring(0,r);var i=e.substring(r+1,e.length-1);n.valid=n.valid&&-1==i.indexOf("[");var a=i.indexOf("=");-1!=a?(t.attribute={name:i.substring(1,a),value:i.substring(a+1)},-1!=["'",'"'].indexOf(t.attribute.value[0])&&(t.attribute.value=t.attribute.value.substring(1,t.attribute.value.length-1))):t.position=parseInt(i,10)-1}return t}))}var t,n,i;return t=e,(n=[{key:"isValid",value:function(){return this.valid}},{key:"findsElement",value:function(){return!this.findsAttribute()}},{key:"findsAttribute",value:function(){return this.path[this.path.length-1].name.startsWith("@")}},{key:"getMpdTarget",value:function(e,t){for(var n=null,r=e,i=1,a="MPD";i<this.path.length&&null!==r;){n=r;var s=this.path[i];if(a=s.name,i!==this.path.length-1||!a.startsWith("@")){var o=n[a+"_asArray"]||[];0===o.length&&n[a]&&o.push(n[a]),s.position?r=o[s.position]||null:s.attribute?function(){var e=s.attribute;r=o.filter((function(t){return t[e.name]==e.value}))[0]||null}():r=o[0]||null}i++}return null===r?null:a.startsWith("@")?{name:a.substring(1),leaf:r,target:r}:{name:a,leaf:r,target:t?n:r}}}])&&r(t.prototype,n),i&&r(t,i),e}();t.default=i},"./src/dash/vo/StreamInfo.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=null,this.start=NaN,this.duration=NaN,this.manifestInfo=null,this.isLast=!0}},"./src/dash/vo/UTCTiming.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schemeIdUri="",this.value=""}},"./src/streaming/FragmentLoader.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/streaming/net/URLLoader.js"),a=n("./src/streaming/vo/HeadRequest.js"),s=n("./src/streaming/vo/DashJSError.js"),o=n("./src/core/FactoryMaker.js");function u(e){e=e||{};var t,n,o=this.context,u=e.eventBus,l=e.events,c=e.urlUtils,d=e.errors,f=e.streamId;return t={checkForExistence:function(e){var t=function(t){u.trigger(l.CHECK_FOR_EXISTENCE_COMPLETED,{request:e,exists:t})};if(e){var r=new a.default(e.url);n.load({request:r,success:function(){t(!0)},error:function(){t(!1)}})}else t(!1)},load:function(e){var r=function(n,r){u.trigger(l.LOADING_COMPLETED,{request:e,response:n||null,error:r||null,sender:t})};e?n.load({request:e,progress:function(n){u.trigger(l.LOADING_PROGRESS,{request:e,stream:n.stream,streamId:f}),n.data&&u.trigger(l.LOADING_DATA_PROGRESS,{request:e,response:n.data||null,error:null,sender:t})},success:function(e){r(e)},error:function(e,t,n){r(void 0,new s.default(d.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE,n,t))},abort:function(e){e&&u.trigger(l.LOADING_ABANDONED,{mediaType:e.mediaType,request:e,sender:t})}}):r(void 0,new s.default(d.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE,d.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE))},abort:function(){n&&n.abort()},reset:function(){n&&(n.abort(),n=null)}},n=Object(i.default)(o).create({errHandler:e.errHandler,errors:d,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,urlUtils:c,constants:r.default,boxParser:e.boxParser,dashConstants:e.dashConstants,requestTimeout:e.settings.get().streaming.fragmentRequestTimeout}),t}u.__dashjs_factory_name="FragmentLoader",t.default=o.default.getClassFactory(u)},"./src/streaming/ManifestLoader.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/dash/constants/DashConstants.js"),a=n("./src/streaming/controllers/XlinkController.js"),s=n("./src/streaming/net/URLLoader.js"),o=n("./src/streaming/utils/URLUtils.js"),u=n("./src/streaming/vo/TextRequest.js"),l=n("./src/streaming/vo/DashJSError.js"),c=n("./src/streaming/vo/metrics/HTTPRequest.js"),d=n("./src/core/EventBus.js"),f=n("./src/core/events/Events.js"),h=n("./src/core/errors/Errors.js"),p=n("./src/core/FactoryMaker.js"),g=n("./src/dash/parser/DashParser.js");function m(e){e=e||{};var t,n,p,m,y,v=this.context,_=e.debug,T=Object(d.default)(v).getInstance(),b=Object(o.default)(v).getInstance(),E=e.mssHandler,S=e.errHandler;function w(e){T.trigger(f.default.INTERNAL_MANIFEST_LOADED,{manifest:e.manifest})}return t={load:function(e){var t=new u.default(e,c.HTTPRequest.MPD_TYPE);p.load({request:t,success:function(t,i,a){var s,o,u;if(m)if(a&&a!==e?(o=b.parseBaseUrl(a),s=a):(b.isRelative(e)&&(e=b.resolve(e,window.location.href)),o=b.parseBaseUrl(e)),"No Content"!=i)if(null===y&&(y=function(e){var t=null;return e.indexOf("SmoothStreamingMedia")>-1?(E&&(t=E.createMssParser(),E.registerEvents()),t):e.indexOf("MPD")>-1||e.indexOf("Patch")>-1?Object(g.default)(v).create({debug:_}):t}(t)),null!==y){m.setMatchers(y.getMatchers()),m.setIron(y.getIron());try{u=y.parse(t)}catch(t){return void T.trigger(f.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new l.default(h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))})}u?(u.url=s||e,u.originalUrl||(u.originalUrl=u.url),u.hasOwnProperty(r.default.LOCATION)&&(o=b.parseBaseUrl(u.Location_asArray[0]),n.debug("BaseURI set by Location to: "+o)),u.baseUri=o,u.loadedTime=new Date,m.resolveManifestOnLoad(u),T.trigger(f.default.ORIGINAL_MANIFEST_LOADED,{originalManifest:t})):T.trigger(f.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new l.default(h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))})}else T.trigger(f.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new l.default(h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))});else T.trigger(f.default.INTERNAL_MANIFEST_LOADED,{manifest:null})},error:function(t,n,r){T.trigger(f.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new l.default(h.default.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE,h.default.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE+"".concat(e,", ").concat(r))})}})},reset:function(){T.off(f.default.XLINK_READY,w,t),E&&E.reset(),m&&(m.reset(),m=null),p&&(p.abort(),p=null)}},n=_.getLogger(t),T.on(f.default.XLINK_READY,w,t),p=Object(s.default)(v).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,urlUtils:b,constants:r.default,dashConstants:i.default,errors:h.default}),m=Object(a.default)(v).create({errHandler:S,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),y=null,t}m.__dashjs_factory_name="ManifestLoader";var y=p.default.getClassFactory(m);t.default=y},"./src/streaming/ManifestUpdater.js":function(e,t,n){n.r(t);var r=n("./src/core/EventBus.js"),i=n("./src/core/events/Events.js"),a=n("./src/streaming/MediaPlayerEvents.js"),s=n("./src/core/FactoryMaker.js"),o=n("./src/core/Debug.js"),u=n("./src/core/errors/Errors.js"),l=n("./src/dash/constants/DashConstants.js"),c=n("./src/streaming/utils/URLUtils.js");function d(){var e,t,n,s,d,f,h,p,g,m,y,v,_=this.context,T=Object(r.default)(_).getInstance(),b=Object(c.default)(_).getInstance();function E(){n=NaN,h=!1,d=!0,f=!1,S()}function S(){null!==s&&(clearTimeout(s),s=null)}function w(e){S(),f||(isNaN(e)&&!isNaN(n)&&(e=1e3*n),isNaN(e)||(t.debug("Refresh manifest in "+e+" milliseconds."),s=setTimeout(C,e)))}function A(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];h=!0;var t=g.getValue(),n=t.url,r=m.getPatchLocation(t),i=m.getLocation(t);r&&!e?n=r:i&&(n=i),b.isRelative(n)&&(n=b.resolve(n,t.url)),p.load(n)}function I(e){if(e){if(m.getIsPatch(e)){var r=e;e=g.getValue();var a=m.isPatchValid(e,r),s=a;if(a){var o=m.getPublishTime(e);s=m.applyPatchToManifest(e,r);var u=m.getPublishTime(e);s=o.getTime()!=u.getTime()}if(!s)return t.debug("Patch provided is invalid, performing full manifest refresh"),void A(!0);e.loadedTime=new Date}}else(e=g.getValue()).loadedTime=new Date;if(g.getValue()&&g.getValue().type===l.default.DYNAMIC&&e.type===l.default.STATIC)return T.trigger(i.default.DYNAMIC_TO_STATIC),h=!1,void(f=!0);g.setValue(e);var c=new Date,p=(c.getTime()-e.loadedTime.getTime())/1e3;1e3*(n=m.getManifestUpdatePeriod(e,p))>2147483647&&(n=2147483.647),T.trigger(i.default.MANIFEST_UPDATED,{manifest:e}),t.info("Manifest has been refreshed at "+c+"["+c.getTime()/1e3+"] "),d||w()}function C(){d||(h?w(v.get().streaming.manifestUpdateRetryInterval):A())}function R(e){e.error?e.error.code===u.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE&&y.error(e.error):I(e.manifest)}function D(){d=!1,w()}function x(){(d=!v.get().streaming.scheduling.scheduleWhilePaused)&&S()}function N(){h=!1}return e={initialize:function(){E(),T.on(i.default.STREAMS_COMPOSED,N,this),T.on(a.default.PLAYBACK_STARTED,D,this),T.on(a.default.PLAYBACK_PAUSED,x,this),T.on(i.default.INTERNAL_MANIFEST_LOADED,R,this)},setManifest:function(e){I(e)},refreshManifest:A,getIsUpdating:function(){return h},setConfig:function(e){e&&(e.manifestModel&&(g=e.manifestModel),e.adapter&&(m=e.adapter),e.manifestLoader&&(p=e.manifestLoader),e.errHandler&&(y=e.errHandler),e.settings&&(v=e.settings))},reset:function(){T.off(a.default.PLAYBACK_STARTED,D,this),T.off(a.default.PLAYBACK_PAUSED,x,this),T.off(i.default.STREAMS_COMPOSED,N,this),T.off(i.default.INTERNAL_MANIFEST_LOADED,R,this),E()}},t=Object(o.default)(_).getInstance().getLogger(e),e}d.__dashjs_factory_name="ManifestUpdater",t.default=s.default.getClassFactory(d)},"./src/streaming/MediaPlayer.js":function(e,t,n){n.r(t);var r=n("./externals/cea608-parser.js"),i=n.n(r),a=n("./src/streaming/constants/Constants.js"),s=n("./src/dash/constants/DashConstants.js"),o=n("./src/streaming/constants/MetricsConstants.js"),u=n("./src/streaming/controllers/PlaybackController.js"),l=n("./src/streaming/controllers/StreamController.js"),c=n("./src/streaming/controllers/GapController.js"),d=n("./src/streaming/controllers/MediaController.js"),f=n("./src/streaming/controllers/BaseURLController.js"),h=n("./src/streaming/ManifestLoader.js"),p=n("./src/streaming/utils/ErrorHandler.js"),g=n("./src/streaming/utils/Capabilities.js"),m=n("./src/streaming/utils/CapabilitiesFilter.js"),y=n("./src/streaming/utils/RequestModifier.js"),v=n("./src/streaming/models/URIFragmentModel.js"),_=n("./src/streaming/models/ManifestModel.js"),T=n("./src/streaming/models/MediaPlayerModel.js"),b=n("./src/streaming/controllers/AbrController.js"),E=n("./src/streaming/net/SchemeLoaderFactory.js"),S=n("./src/streaming/models/VideoModel.js"),w=n("./src/streaming/models/CmcdModel.js"),A=n("./src/streaming/utils/DOMStorage.js"),I=n("./src/core/Debug.js"),C=n("./src/core/errors/Errors.js"),R=n("./src/core/EventBus.js"),D=n("./src/core/events/Events.js"),x=n("./src/streaming/MediaPlayerEvents.js"),N=n("./src/core/FactoryMaker.js"),O=n("./src/core/Settings.js"),P=n("./src/core/Version.js"),M=n("./src/dash/controllers/SegmentBaseController.js"),k=n("./src/dash/DashAdapter.js"),L=n("./src/dash/DashMetrics.js"),F=n("./src/dash/utils/TimelineConverter.js"),U=n("./src/streaming/vo/metrics/HTTPRequest.js"),B=n("./externals/base64.js"),j=n.n(B),q=n("./node_modules/codem-isoboxer/dist/iso_boxer.js"),H=n.n(q),G=n("./src/streaming/vo/DashJSError.js"),V=n("./src/streaming/utils/SupervisorTools.js"),Y=n("./src/streaming/ManifestUpdater.js"),z=n("./src/streaming/utils/URLUtils.js"),Z=n("./src/streaming/utils/BoxParser.js"),K=n("./src/streaming/text/TextController.js");function W(){var e,t,n,r,B,q,W,X,$,Q,J,ee,te,ne,re,ie,ae,se,oe,ue,le,ce,de,fe,he,pe,ge,me,ye,ve,_e,Te,be,Ee,Se,we,Ae="You must first call initialize() and set a source before calling this method",Ie="You must first call initialize() and set a valid source and view before calling this method",Ce="You must first call attachView() to set the video element before calling this method",Re="MediaPlayer not initialized!",De=this.context,xe=Object(R.default)(De).getInstance(),Ne=Object(O.default)(De).getInstance(),Oe=Object(I.default)(De).getInstance({settings:Ne});function Pe(){Ze(null),Ve(null),r=null,te&&(te.reset(),te=null),ne&&(ne.reset(),ne=null),Ne.reset(),ie&&(ie.reset(),ie=null)}function Me(){return!!n&&!!ve.getElement()}function ke(){return Object(P.getVersionString)()}function Le(){if(!W)throw Ie;return pe.isPaused()}function Fe(e){var t=de&&de.hasVideoTrack()?a.default.VIDEO:a.default.AUDIO,n=ge.getCurrentDVRInfo(t);if(!n)return 0;var r=pe.getLiveDelay(),i=n.range.start+e;return i>n.range.end-r&&(i=n.range.end-r),i}function Ue(e){if(!W)throw Ie;var t=Ge().currentTime;if(void 0!==e)t=de.getTimeRelativeToStreamId(t,e);else if(pe.getIsDynamic()){var n=de&&de.hasVideoTrack()?a.default.VIDEO:a.default.AUDIO,r=ge.getCurrentDVRInfo(n);t=null===r||0===t?0:Math.max(0,t-r.range.start)}return t}function Be(){if(!W)throw Ie;var e=Ge().duration;if(pe.getIsDynamic()){var t=de&&de.hasVideoTrack()?a.default.VIDEO:a.default.AUDIO,n=ge.getCurrentDVRInfo(t);e=n?n.range.end-n.range.start:0}return e}function je(e){Object(V.checkParameterType)(e,"boolean"),X=e}function qe(){se.restoreDefaultUTCTimingSources()}function He(){return ge}function Ge(){if(!ve.getElement())throw Ce;return ve.getElement()}function Ve(e){if(!B)throw Re;ve.setElement(e),e&&($e(),function(){if(!ne){var e=dashjs.MetricsReporting;if("function"==typeof e){var t=e(De).create();ne=t.createMetricsReporting({debug:Oe,eventBus:xe,mediaElement:Ge(),adapter:ae,dashMetrics:ge,events:D.default,constants:a.default,metricsConstants:o.default})}}}(),function(){if(!re){var e=dashjs.MssHandler;"function"==typeof e&&(C.default.extend(e.errors),re=e(De).create({eventBus:xe,mediaPlayerModel:se,dashMetrics:ge,manifestModel:me,playbackController:pe,streamController:de,protectionController:te,baseURLController:ue,errHandler:oe,events:D.default,constants:a.default,debug:Oe,initSegmentType:U.HTTPRequest.INIT_SEGMENT_TYPE,BASE64:j.a,ISOBoxer:H.a,settings:Ne}))}}(),de&&de.switchToVideoElement()),W&&We(),et()}function Ye(e){if(!q)throw Ae;var t=de.getActiveStreamInfo();return t?ee.getTracksFor(e,t.id):[]}function ze(e,t){var n=-1;e.some((function(e,r){if(e===t)return n=r,!0})),n<0||e.splice(n,1)}function Ze(e){if(!B)throw Re;"string"==typeof e&&_e.initialize(e),n=e,(q||W)&&We(),Me()&&et()}function Ke(){if(!q)throw Ae;var e=de.getActiveStreamInfo();return e?de.getStreamById(e.id):null}function We(){W=!1,q=!1,ae.reset(),de.reset(),he.reset(),pe.reset(),$.reset(),ee.reset(),be.reset(),te&&(Ne.get().streaming.protection.keepProtectionMediaKeys?te.stop():(te.reset(),te=null,$e())),fe.reset(),ye.reset()}function Xe(){return Object(h.default)(De).create({debug:Oe,errHandler:oe,dashMetrics:ge,mediaPlayerModel:se,requestModifier:Object(y.default)(De).getInstance(),mssHandler:re,settings:Ne})}function $e(){if(te)return te;var e=dashjs.Protection;if("function"==typeof e){var t=e(De).create();return D.default.extend(e.events),x.default.extend(e.events,{publicOnly:!0}),C.default.extend(e.errors),le||(le=Object(g.default)(De).getInstance()),(te=t.createProtectionSystem({debug:Oe,errHandler:oe,videoModel:ve,capabilities:le,eventBus:xe,events:D.default,BASE64:j.a,constants:a.default,cmcdModel:ye,settings:Ne}))&&(te.setLicenseRequestFilters(Ee),te.setLicenseResponseFilters(Se)),te}return null}function Qe(){if(!B)throw Re;if(ie)return ie;var e=dashjs.OfflineController;if("function"==typeof e){D.default.extend(e.events),x.default.extend(e.events,{publicOnly:!0}),C.default.extend(e.errors);var t=Xe(),n=Object(Y.default)(De).create();return n.setConfig({manifestModel:me,adapter:ae,manifestLoader:t,errHandler:oe}),ie=e(De).create({debug:Oe,manifestUpdater:n,baseURLController:ue,manifestLoader:t,manifestModel:me,mediaPlayerModel:se,abrController:$,playbackController:pe,adapter:ae,errHandler:oe,dashMetrics:ge,timelineConverter:J,segmentBaseController:be,schemeLoaderFactory:Q,eventBus:xe,events:D.default,errors:C.default,constants:a.default,settings:Ne,dashConstants:s.default,urlUtils:Object(z.default)(De).getInstance()})}return null}function Je(e){var t=de&&de.hasVideoTrack()?a.default.VIDEO:a.default.AUDIO,n=ge.getCurrentDVRInfo(t);return n?e+(n.manifestInfo.availableFrom.getTime()/1e3+n.range.start):0}function et(){var e;ie&&ie.resetRecords(),!q&&n&&(q=!0,t.info("Streaming Initialized"),e=Xe(),de||(de=Object(l.default)(De).getInstance()),fe||(fe=Object(K.default)(De).create({errHandler:oe,manifestModel:me,adapter:ae,mediaController:ee,videoModel:ve,settings:Ne})),ce.setConfig({capabilities:le,adapter:ae,settings:Ne,manifestModel:me,errHandler:oe}),ce.setCustomCapabilitiesFilters(we),de.setConfig({capabilities:le,capabilitiesFilter:ce,manifestLoader:e,manifestModel:me,mediaPlayerModel:se,protectionController:te,textController:fe,adapter:ae,dashMetrics:ge,errHandler:oe,timelineConverter:J,videoModel:ve,playbackController:pe,abrController:$,mediaController:ee,settings:Ne,baseURLController:ue,uriFragmentModel:_e,segmentBaseController:be}),he.setConfig({settings:Ne,playbackController:pe,streamController:de,videoModel:ve,timelineConverter:J,adapter:ae}),pe.setConfig({streamController:de,dashMetrics:ge,mediaPlayerModel:se,adapter:ae,videoModel:ve,timelineConverter:J,settings:Ne}),$.setConfig({streamController:de,domStorage:Te,mediaPlayerModel:se,dashMetrics:ge,adapter:ae,videoModel:ve,settings:Ne}),ye.setConfig({abrController:$,dashMetrics:ge,playbackController:pe}),$.initialize(),de.initialize(X,r),fe.initialize(),he.initialize(),ye.initialize(),be.initialize(),"string"==typeof n?de.load(n):de.loadWithManifest(n)),!W&&Me()&&(W=!0,t.info("Playback Initialized"))}return e={initialize:function(e,n,r){le||(le=Object(g.default)(De).getInstance()).setConfig({settings:Ne}),oe||(oe=Object(p.default)(De).getInstance()),le.supportsMediaSource()?(B||(B=!0,J=Object(F.default)(De).getInstance(),$||($=Object(b.default)(De).getInstance()).setConfig({settings:Ne}),Q||(Q=Object(E.default)(De).getInstance()),pe||(pe=Object(u.default)(De).getInstance()),ee||(ee=Object(d.default)(De).getInstance()),de||(de=Object(l.default)(De).getInstance()),he||(he=Object(c.default)(De).getInstance()),ce||(ce=Object(m.default)(De).getInstance()),ae=Object(k.default)(De).getInstance(),me=Object(_.default)(De).getInstance(),ye=Object(w.default)(De).getInstance(),ge=Object(L.default)(De).getInstance({settings:Ne}),Te=Object(A.default)(De).getInstance({settings:Ne}),ae.setConfig({constants:a.default,cea608parser:i.a,errHandler:oe,BASE64:j.a}),ue||(ue=Object(f.default)(De).create()),ue.setConfig({adapter:ae}),be||(be=Object(M.default)(De).getInstance({dashMetrics:ge,mediaPlayerModel:se,errHandler:oe,baseURLController:ue,events:D.default,eventBus:xe,debug:Oe,boxParser:Object(Z.default)(De).getInstance(),requestModifier:Object(y.default)(De).getInstance(),errors:C.default})),ee.setConfig({domStorage:Te,settings:Ne}),qe(),je(void 0===r||r),Qe()),e&&Ve(e),n&&Ze(n),t.info("[dash.js "+ke()+"] MediaPlayer has been initialized")):oe.error(new G.default(C.default.CAPABILITY_MEDIASOURCE_ERROR_CODE,C.default.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE))},setConfig:function(e){e&&(e.capabilities&&(le=e.capabilities),e.capabilitiesFilter&&(ce=e.capabilitiesFilter),e.streamController&&(de=e.streamController),e.textController&&(fe=e.textController),e.gapController&&(he=e.gapController),e.playbackController&&(pe=e.playbackController),e.mediaPlayerModel&&(se=e.mediaPlayerModel),e.abrController&&($=e.abrController),e.schemeLoaderFactory&&(Q=e.schemeLoaderFactory),e.mediaController&&(ee=e.mediaController),e.settings&&(Ne=e.settings))},on:function(e,t,n,r){xe.on(e,t,n,r)},off:function(e,t,n){xe.off(e,t,n)},extend:function(e,t,n){N.default.extend(e,t,n,De)},attachView:Ve,attachSource:Ze,isReady:Me,play:function(){if(!W)throw Ie;(!X||Le()&&W)&&pe.play()},isPaused:Le,pause:function(){if(!W)throw Ie;pe.pause()},isSeeking:function(){if(!W)throw Ie;return pe.isSeeking()},isDynamic:function(){if(!W)throw Ie;return pe.getIsDynamic()},seek:function(e){if(!W)throw Ie;if(Object(V.checkParameterType)(e,"number"),isNaN(e))throw a.default.BAD_ARGUMENT_ERROR;var t=pe.getIsDynamic()?Fe(e):e;pe.seek(t)},setPlaybackRate:function(e){Ge().playbackRate=e},getPlaybackRate:function(){return Ge().playbackRate},setMute:function(e){Object(V.checkParameterType)(e,"boolean"),Ge().muted=e},isMuted:function(){return Ge().muted},setVolume:function(e){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw a.default.BAD_ARGUMENT_ERROR;Ge().volume=e},getVolume:function(){return Ge().volume},time:Ue,duration:Be,timeAsUTC:function(){if(!W)throw Ie;return Ue()<0?NaN:Je(Ue())},durationAsUTC:function(){if(!W)throw Ie;return Je(Be())},getActiveStream:Ke,getDVRWindowSize:function(){var e=de&&de.hasVideoTrack()?a.default.VIDEO:a.default.AUDIO,t=ge.getCurrentDVRInfo(e);return t?t.manifestInfo.dvrWindowSize:0},getDVRSeekOffset:Fe,convertToTimeCode:function(e){e=Math.max(e,0);var t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%3600%60);return(0===t?"":t<10?"0"+t.toString()+":":t.toString()+":")+(n<10?"0"+n.toString():n.toString())+":"+(r<10?"0"+r.toString():r.toString())},formatUTC:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=new Date(1e3*e),a=i.toLocaleDateString(t),s=i.toLocaleTimeString(t,{hour12:n});return r?s+" "+a:s},getVersion:ke,getDebug:function(){return Oe},getBufferLength:function(e){var n=[a.default.VIDEO,a.default.AUDIO,a.default.TEXT];if(e)return-1!==n.indexOf(e)?He().getCurrentBufferLevel(e)||NaN:(t.warn("getBufferLength requested for invalid type"),NaN);var r=n.map((function(e){return Ye(e).length>0?He().getCurrentBufferLevel(e):Number.MAX_VALUE})).reduce((function(e,t){return Math.min(e,t)}));return r===Number.MAX_VALUE?NaN:r},getTTMLRenderingDiv:function(){return ve?ve.getTTMLRenderingDiv():null},getVideoElement:Ge,getSource:function(){if(!n)throw"You must first call attachSource() with a valid source before calling this method";return n},getCurrentLiveLatency:function(){if(!B)throw Re;return W?pe.getCurrentLiveLatency():NaN},getTopBitrateInfoFor:function(e){if(!q)throw Ae;return $.getTopBitrateInfoFor(e)},setAutoPlay:je,getAutoPlay:function(){return X},getDashMetrics:He,getQualityFor:function(e){if(!q)throw Ae;if(e===a.default.IMAGE){var t=Ke();if(!t)return-1;var n=t.getThumbnailController();return n?n.getCurrentTrackIndex():-1}return $.getQualityFor(e)},setQualityFor:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!q)throw Ae;if(e===a.default.IMAGE){var r=Ke();if(!r)return;var i=r.getThumbnailController();i&&i.setTrackByIndex(t)}$.setPlaybackQuality(e,de.getActiveStreamInfo(),t,{forceReplace:n})},updatePortalSize:function(){$.setElementSize(),$.setWindowResizeEventCalled(!0)},enableText:function(e){var t=de.getActiveStreamInfo();return!(!t||!fe)&&fe.enableText(t.id,e)},enableForcedTextStreaming:function(e){return!(!de.getActiveStreamInfo()||!fe)&&fe.enableForcedTextStreaming(e)},isTextEnabled:function(){var e=de.getActiveStreamInfo();return!(!e||!fe)&&fe.isTextEnabled(e)},setTextTrack:function(e){if(!W)throw Ie;var t=de.getActiveStreamInfo();t&&fe&&fe.setTextTrack(t.id,e)},getBitrateInfoListFor:function(e){if(!q)throw Ae;var t=Ke();return t?t.getBitrateListFor(e):[]},getStreamsFromManifest:function(e){if(!q)throw Ae;return ae.getStreamsInfo(e)},getTracksFor:Ye,getTracksForTypeFromManifest:function(e,t,n){if(!q)throw Ae;return(n=n||ae.getStreamsInfo(t,1)[0])?ae.getAllMediaInfoForType(n,e,t):[]},getCurrentTrackFor:function(e){if(!q)throw Ae;var t=de.getActiveStreamInfo();return ee.getCurrentTrackFor(e,t.id)},setInitialMediaSettingsFor:function(e,t){if(!B)throw Re;ee.setInitialSettings(e,t)},getInitialMediaSettingsFor:function(e){if(!B)throw Re;return ee.getInitialSettings(e)},setCurrentTrack:function(e){if(!q)throw Ae;ee.setTrack(e)},addABRCustomRule:function(e,t,n){se.addABRCustomRule(e,t,n)},removeABRCustomRule:function(e){se.removeABRCustomRule(e)},removeAllABRCustomRule:function(){se.removeABRCustomRule()},getAverageThroughput:function(e){var t=$.getThroughputHistory(),n=pe.getIsDynamic();return t?t.getAverageThroughput(e,n):0},retrieveManifest:function(e,t){var n=Xe(),r=this;xe.on(D.default.INTERNAL_MANIFEST_LOADED,(function e(i){i.error?t(null,i.error):t(i.manifest),xe.off(D.default.INTERNAL_MANIFEST_LOADED,e,r),n.reset()}),r),_e.initialize(e),n.load(e)},addUTCTimingSource:function(e,t){se.addUTCTimingSource(e,t)},removeUTCTimingSource:function(e,t){se.removeUTCTimingSource(e,t)},clearDefaultUTCTimingSources:function(){se.clearDefaultUTCTimingSources()},restoreDefaultUTCTimingSources:qe,setXHRWithCredentialsForType:function(e,t){se.setXHRWithCredentialsForType(e,t)},getXHRWithCredentialsForType:function(e){return se.getXHRWithCredentialsForType(e)},getProtectionController:function(){return $e()},attachProtectionController:function(e){te=e},setProtectionData:function(e){r=e,de&&de.setProtectionData(r)},registerLicenseRequestFilter:function(e){Ee.push(e),te&&te.setLicenseRequestFilters(Ee)},registerLicenseResponseFilter:function(e){Se.push(e),te&&te.setLicenseResponseFilters(Se)},unregisterLicenseRequestFilter:function(e){ze(Ee,e),te&&te.setLicenseRequestFilters(Ee)},unregisterLicenseResponseFilter:function(e){ze(Se,e),te&&te.setLicenseResponseFilters(Se)},registerCustomCapabilitiesFilter:function(e){we.push(e),ce&&ce.setCustomCapabilitiesFilters(we)},unregisterCustomCapabilitiesFilter:function(e){ze(we,e),ce&&ce.setCustomCapabilitiesFilters(we)},setCustomInitialTrackSelectionFunction:function(e){ee&&ee.setCustomInitialTrackSelectionFunction(e)},resetCustomInitialTrackSelectionFunction:function(){ee&&ee.setCustomInitialTrackSelectionFunction(null)},attachTTMLRenderingDiv:function(e){if(!ve.getElement())throw Ce;ve.setTTMLRenderingDiv(e)},getCurrentTextTrackIndex:function(){var e=de.getActiveStreamInfo();if(e&&fe)return fe.getCurrentTrackIdx(e.id)},provideThumbnail:function(e,t){if("function"==typeof t)if(e<0)t(null);else{var n=pe.getIsDynamic()?Fe(e):e,r=de.getStreamForTime(n);if(null!==r){var i=r.getThumbnailController();if(i){var a=de.getTimeRelativeToStreamId(n,r.getId());return i.provide(a,t)}t(null)}else t(null)}},getDashAdapter:function(){return ae},getOfflineController:function(){return Qe()},getSettings:function(){return Ne.get()},updateSettings:function(e){Ne.update(e)},resetSettings:function(){Ne.reset()},reset:Pe,destroy:function(){Pe(),Ee=[],Se=[],we=[],N.default.deleteSingletonInstances(De)}},t=Oe.getLogger(e),B=!1,W=!1,q=!1,X=!0,te=null,ie=null,r=null,ae=null,be=null,D.default.extend(x.default),se=Object(T.default)(De).getInstance(),ve=Object(S.default)(De).getInstance(),_e=Object(v.default)(De).getInstance(),Ee=[],Se=[],we=[],e}W.__dashjs_factory_name="MediaPlayer";var X=N.default.getClassFactory(W);X.events=x.default,X.errors=C.default,N.default.updateClassFactory(W.__dashjs_factory_name,X),t.default=X},"./src/streaming/MediaPlayerEvents.js":function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=s(e);if(t){var a=s(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}n.r(t);var o=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,e);var t=a(n);function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=t.call(this)).AST_IN_FUTURE="astInFuture",e.BUFFER_EMPTY="bufferStalled",e.BUFFER_LOADED="bufferLoaded",e.BUFFER_LEVEL_STATE_CHANGED="bufferStateChanged",e.BUFFER_LEVEL_UPDATED="bufferLevelUpdated",e.DYNAMIC_TO_STATIC="dynamicToStatic",e.ERROR="error",e.FRAGMENT_LOADING_COMPLETED="fragmentLoadingCompleted",e.FRAGMENT_LOADING_PROGRESS="fragmentLoadingProgress",e.FRAGMENT_LOADING_STARTED="fragmentLoadingStarted",e.FRAGMENT_LOADING_ABANDONED="fragmentLoadingAbandoned",e.LOG="log",e.MANIFEST_LOADED="manifestLoaded",e.METRICS_CHANGED="metricsChanged",e.METRIC_CHANGED="metricChanged",e.METRIC_ADDED="metricAdded",e.METRIC_UPDATED="metricUpdated",e.PERIOD_SWITCH_STARTED="periodSwitchStarted",e.PERIOD_SWITCH_COMPLETED="periodSwitchCompleted",e.QUALITY_CHANGE_REQUESTED="qualityChangeRequested",e.QUALITY_CHANGE_RENDERED="qualityChangeRendered",e.TRACK_CHANGE_RENDERED="trackChangeRendered",e.STREAM_INITIALIZING="streamInitializing",e.STREAM_UPDATED="streamUpdated",e.STREAM_ACTIVATED="streamActivated",e.STREAM_DEACTIVATED="streamDeactivated",e.STREAM_INITIALIZED="streamInitialized",e.STREAM_TEARDOWN_COMPLETE="streamTeardownComplete",e.TEXT_TRACKS_ADDED="allTextTracksAdded",e.TEXT_TRACK_ADDED="textTrackAdded",e.TTML_PARSED="ttmlParsed",e.TTML_TO_PARSE="ttmlToParse",e.CAPTION_RENDERED="captionRendered",e.CAPTION_CONTAINER_RESIZE="captionContainerResize",e.CAN_PLAY="canPlay",e.CAN_PLAY_THROUGH="canPlayThrough",e.PLAYBACK_ENDED="playbackEnded",e.PLAYBACK_ERROR="playbackError",e.PLAYBACK_NOT_ALLOWED="playbackNotAllowed",e.PLAYBACK_METADATA_LOADED="playbackMetaDataLoaded",e.PLAYBACK_LOADED_DATA="playbackLoadedData",e.PLAYBACK_PAUSED="playbackPaused",e.PLAYBACK_PLAYING="playbackPlaying",e.PLAYBACK_PROGRESS="playbackProgress",e.PLAYBACK_RATE_CHANGED="playbackRateChanged",e.PLAYBACK_SEEKED="playbackSeeked",e.PLAYBACK_SEEKING="playbackSeeking",e.PLAYBACK_SEEK_ASKED="playbackSeekAsked",e.PLAYBACK_STALLED="playbackStalled",e.PLAYBACK_STARTED="playbackStarted",e.PLAYBACK_TIME_UPDATED="playbackTimeUpdated",e.PLAYBACK_WAITING="playbackWaiting",e.MANIFEST_VALIDITY_CHANGED="manifestValidityChanged",e.EVENT_MODE_ON_START="eventModeOnStart",e.EVENT_MODE_ON_RECEIVE="eventModeOnReceive",e.CONFORMANCE_VIOLATION="conformanceViolation",e.REPRESENTATION_SWITCH="representationSwitch",e}return n}(n("./src/core/events/EventsBase.js").default));t.default=o},"./src/streaming/MediaPlayerFactory.js":function(e,t,n){n.r(t);var r,i=n("./src/streaming/MediaPlayer.js"),a=function(){var e,t="application/dash+xml";function n(n,r,a){if(!n||!/^VIDEO$/i.test(n.nodeName))return null;if(n._dashjs_player)return n._dashjs_player;var s,o=n.id||n.name||"video element";if(!(r=r||[].slice.call(n.querySelectorAll("source")).filter((function(e){return e.type==t}))[0])&&n.src)(r=document.createElement("source")).src=n.src;else if(!r&&!n.src)return null;return a=a||{},(s=Object(i.default)(a).create()).initialize(n,r.src,n.autoplay),e||(e=s.getDebug().getLogger()),e.debug("Converted "+o+" to dash.js player and added content: "+r.src),n._dashjs_player=s,s}function r(e){return/^VIDEO$/i.test(e.nodeName)?e:r(e.parentNode)}return{create:n,createAll:function(e,i){var a=[];e=e||"[data-dashjs-player]";for(var s=(i=i||document).querySelectorAll(e),o=0;o<s.length;o++){var u=n(s[o],null);a.push(u)}for(var l=i.querySelectorAll('source[type="'+t+'"]'),c=0;c<l.length;c++){var d=n(r(l[c]),null);a.push(d)}return a}}}();!("undefined"!=typeof window&&window&&window.dashjs&&window.dashjs.skipAutoCreate)&&"undefined"!=typeof window&&window&&window.addEventListener&&("complete"===window.document.readyState?window.dashjs?a.createAll():r=window.setInterval((function(){window.dashjs&&(window.clearInterval(r),a.createAll())}),500):window.addEventListener("load",(function e(){window.removeEventListener("load",e),a.createAll()}))),t.default=a},"./src/streaming/SourceBufferSink.js":function(e,t,n){n.r(t);var r=n("./src/core/Debug.js"),i=n("./src/streaming/vo/DashJSError.js"),a=n("./src/core/FactoryMaker.js"),s=n("./src/core/errors/Errors.js"),o=n("./src/core/Settings.js"),u=n("./src/streaming/constants/Constants.js"),l=n("./src/streaming/vo/metrics/HTTPRequest.js"),c=n("./src/core/events/Events.js");function d(e){var t,n,a,d,f,h,p=this.context,g=Object(o.default)(p).getInstance(),m=e.textController,y=e.eventBus,v=[],_=[],T=!1,b=e.mediaSource,E=null;function S(e){return new Promise((function(t){P((function(){d.changeType&&d.changeType(e),t()}))}))}function w(e){return d=m.getTextSourceBuffer(e),Promise.resolve()}function A(){if("function"==typeof d.addEventListener)try{d.addEventListener("updateend",N,!1),d.addEventListener("error",O,!1),d.addEventListener("abort",O,!1)}catch(e){h=setInterval(N,50)}else h=setInterval(N,50)}function I(e){return new Promise((function(t){d&&g.get().streaming.buffer.useAppendWindow?P((function(){try{if(!d)return void t();var n=b.duration,r=0;e&&!isNaN(e.start)&&!isNaN(e.duration)&&isFinite(e.duration)&&(n=e.start+e.duration),e&&!isNaN(e.start)&&(r=e.start),d.appendWindowEnd===n&&d.appendWindowStart===r||(d.appendWindowStart=0,d.appendWindowEnd=n+.01,d.appendWindowStart=Math.max(r-.1,0),a.debug("Updated append window for ".concat(f.type,". Set start to ").concat(d.appendWindowStart," and end to ").concat(d.appendWindowEnd))),t()}catch(e){a.warn("Failed to set append window"),t()}})):t()}))}function C(e){return new Promise((function(t){d?P((function(){try{d.timestampOffset===e||isNaN(e)||(d.timestampOffset=e,a.debug("Set MSE timestamp offset to ".concat(e))),t()}catch(e){t()}})):t()}))}function R(){return new Promise((function(e){P((function(){var t=d.appendWindowStart,n=d.appendWindowEnd;d&&(d.abort(),d.appendWindowStart=t,d.appendWindowEnd=n),e()}))}))}function D(){if(!T&&_.length>0){T=!0;var e=_[0];_.splice(0,1);var t=function(){T=!1,_.length>0&&D.call(this),e&&e.data&&e.data.segmentType&&e.data.segmentType!==l.HTTPRequest.INIT_SEGMENT_TYPE&&delete e.data.bytes,e.promise.resolve({chunk:e.data})};try{E=e.request,0===e.data.bytes.byteLength?t.call(this):(d.appendBuffer?d.appendBuffer(e.data.bytes):d.append(e.data.bytes,e.data),P(t.bind(this)))}catch(t){a.fatal('SourceBuffer append failed "'+t+'"'),_.length>0?D():T=!1,delete e.data.bytes,e.promise.reject({chunk:e.data,error:new i.default(t.code,t.message)})}}}function x(){v.length>0&&(d.updating||(v.shift()(),x()))}function N(){d.updating||x()}function O(e){var t,r,i=e.target||{};t=c.default.SOURCE_BUFFER_ERROR,r={error:i,lastRequestAppended:E}||{},y.trigger(t,r,{streamId:f.streamInfo.id,mediaType:n})}function P(e){v.push(e),d.updating||x()}return t={getType:function(){return n},getAllBufferRanges:function(){try{return d.buffered}catch(e){return a.error("getAllBufferRanges exception: "+e.message),null}},getBuffer:function(){return d},append:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new Promise((function(r,a){e?(_.push({data:e,promise:{resolve:r,reject:a},request:n}),P(D.bind(t))):a({chunk:e,error:new i.default(s.default.APPEND_ERROR_CODE,s.default.APPEND_ERROR_MESSAGE)})}))},remove:function(e){return new Promise((function(t,n){var r=e.start,a=e.end;r>=0&&a>r?P((function(){try{d.remove(r,a),P((function(){t({from:r,to:a,unintended:!1}),e.resolve&&e.resolve()}))}catch(t){n({from:r,to:a,unintended:!1,error:new i.default(s.default.REMOVE_ERROR_CODE,s.default.REMOVE_ERROR_MESSAGE)}),e.reject&&e.reject(t)}})):t()}))},abort:function(){return new Promise((function(e){try{_=[],"open"===b.readyState?P((function(){try{d&&d.abort(),e()}catch(t){e()}})):d&&d.setTextTrack&&"ended"===b.readyState?(d.abort(),e()):e()}catch(t){e()}}))},reset:function(){if(d){try{v=[],function(){try{"function"==typeof d.removeEventListener&&(d.removeEventListener("updateend",N,!1),d.removeEventListener("error",O,!1),d.removeEventListener("abort",O,!1)),clearInterval(h)}catch(e){a.error(e)}}(),T=!1,_=[],d.getClassName&&"TextSourceBuffer"===d.getClassName()||(a.debug("Removing sourcebuffer from media source"),b.removeSourceBuffer(d))}catch(e){}d=null}E=null},updateTimestampOffset:C,initializeForStreamSwitch:function(e,t,r){n=(f=e).type;var i=f.codec;!function(e){d=e.getBuffer()}(r),A();var a=[];return a.push(R),a.push(I(f.streamInfo)),a.push(S(i)),t&&void 0!==t.MSETimeOffset&&a.push(C(t.MSETimeOffset)),Promise.all(a)},initializeForFirstUse:function(e,t,r){n=(f=t).type;var i=f.codec;try{if(i.match(/application\/mp4;\s*codecs="(stpp|wvtt).*"/i))return w(e);d=b.addSourceBuffer(i),A();var a=[];return a.push(I(f.streamInfo)),r&&void 0!==r.MSETimeOffset&&a.push(C(r.MSETimeOffset)),Promise.all(a)}catch(t){return f.type==u.default.TEXT&&!f.isFragmented||-1!==i.indexOf('codecs="stpp')||-1!==i.indexOf('codecs="vtt')?w(e):Promise.reject(t)}},updateAppendWindow:I,changeType:S},a=Object(r.default)(p).getInstance().getLogger(t),t}d.__dashjs_factory_name="SourceBufferSink";var f=a.default.getClassFactory(d);t.default=f},"./src/streaming/Stream.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/dash/constants/DashConstants.js"),a=n("./src/streaming/StreamProcessor.js"),s=n("./src/streaming/controllers/FragmentController.js"),o=n("./src/streaming/thumbnail/ThumbnailController.js"),u=n("./src/core/EventBus.js"),l=n("./src/core/events/Events.js"),c=n("./src/core/Debug.js"),d=n("./src/core/errors/Errors.js"),f=n("./src/core/FactoryMaker.js"),h=n("./src/streaming/vo/DashJSError.js"),p=n("./src/streaming/utils/BoxParser.js"),g=n("./src/streaming/utils/URLUtils.js"),m=n("./src/streaming/controllers/BlacklistController.js"),y=[r.default.VIDEO,r.default.AUDIO,r.default.TEXT,r.default.MUXED,r.default.IMAGE];function v(e){e=e||{};var t,n,f,v,_,T,b,E,S,w,A,I,C,R,D,x,N,O,P=this.context,M=Object(u.default)(P).getInstance(),k=Object(g.default)(P).getInstance(),L=e.manifestModel,F=e.mediaPlayerModel,U=e.dashMetrics,B=e.manifestUpdater,j=e.adapter,q=e.timelineConverter,H=e.capabilities,G=e.errHandler,V=e.abrController,Y=e.playbackController,z=e.eventController,Z=e.mediaController,K=e.protectionController,W=e.textController,X=e.videoModel,$=e.streamInfo,Q=e.settings;function J(t,s){return new Promise((function(u,c){oe(),w=!0,le();var p,g=X.getElement();y.forEach((function(s){(s!==r.default.VIDEO||!g||g&&/^VIDEO$/i.test(g.nodeName))&&function(t,s){var u,c=j.getAllMediaInfoForType($,t),d=[],h=null;if(c&&0!==c.length){t===r.default.VIDEO&&(b=!0),t===r.default.AUDIO&&(E=!0);for(var p=0,g=c.length;p<g;p++)h=c[p],t===r.default.TEXT&&h.isEmbedded&&(W.addEmbeddedTrack($,h),d.push(h)),ee(h)&&Z.addTrack(h);if(d.length>0&&(Z.setInitialMediaSettingsForType(t,$),W.setInitialSettings(Z.getInitialSettings(t)),W.addMediaInfosToBuffer($,t,d)),0!==(c=c.filter((function(e){return!e.isEmbedded}))).length)if(t!==r.default.IMAGE){M.trigger(l.default.STREAM_INITIALIZING,{streamInfo:$,mediaInfo:h}),Z.setInitialMediaSettingsForType(t,$);var m=function(t,n){var i=t&&t.length>0?t[0]:null,s=A.getModel(i?i.type:null),o=i?i.type:null,u=i?i.mimeType:null,l=i?i.isFragmented:null,c=Object(a.default)(P).create({streamInfo:$,type:o,mimeType:u,timelineConverter:q,adapter:j,manifestModel:L,mediaPlayerModel:F,fragmentModel:s,dashMetrics:e.dashMetrics,baseURLController:e.baseURLController,segmentBaseController:e.segmentBaseController,abrController:V,playbackController:Y,mediaController:Z,textController:W,errHandler:G,settings:Q,boxParser:D,segmentBlacklistController:C});c.initialize(n,b,l),f.push(c);for(var d=0;d<t.length;d++)c.addMediaInfo(t[d]);return o===r.default.TEXT&&W.addMediaInfosToBuffer($,o,t,s),c}(c,s);(u=Z.getCurrentTrackFor(t,$.id))&&(V.updateTopQualityIndex(u),m.selectMediaInfo(t===r.default.TEXT&&u.isEmbedded?c[0]:u))}else(I=Object(o.default)(P).create({streamInfo:$,adapter:j,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:x,eventBus:M,events:l.default,dashConstants:i.default,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController})).initialize()}else n.info("No "+t+" data.")}(s,t)})),(p=s,new Promise((function(e){var t={},n=f.map((function(e){return e.createBufferSinks(p)}));Promise.all(n).then((function(n){n.forEach((function(e){e&&(t[e.getType()]=e)})),e(t)})).catch((function(){e(t)}))}))).then((function(e){if(w=!1,0===f.length){var t="No streams to play.";G.error(new h.default(d.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,t,L.getValue())),n.fatal(t)}else ce();W.createTracks($),u(e)})).catch((function(e){c(e)}))}))}function ee(e){var t,i=e?e.type:null;return i===r.default.MUXED?(t="Multiplexed representations are intentionally not supported, as they are not compliant with the DASH-AVC/264 guidelines",n.fatal(t),G.error(new h.default(d.default.MANIFEST_ERROR_ID_MULTIPLEXED_CODE,t,L.getValue())),!1):!(i!==r.default.TEXT&&i!==r.default.IMAGE&&e.contentProtection&&!H.supportsEncryptedMedia()&&(G.error(new h.default(d.default.CAPABILITY_MEDIAKEYS_ERROR_CODE,d.default.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE)),1))}function te(e){for(var t=f?f.length:0,n=0;n<t;n++){var r=f[n].getFragmentModel();r.abortRequests(),r.resetInitialSettings(),f[n].reset(!1,e)}W&&W.deactivateStream($),f=[],_=!1,T=!1,Te(!1),re(!1),M.trigger(l.default.STREAM_DEACTIVATED,{streamInfo:$})}function ne(e){te(e),v=!1,b=!1,E=!1,S={},w=!1,N=!1,O=[]}function re(e){N=e}function ie(){return $?$.start:NaN}function ae(){return $?$.id:null}function se(){return $}function oe(){if(!X||!V)throw new Error(r.default.MISSING_CONFIG_ERROR)}function ue(e){e.error&&(G.error(e.error),n.fatal(e.error.message))}function le(){if(z){var e=j.getEventsFor($);z.addInlineEvents(e)}}function ce(){for(var e=f.length,t=S.audio||S.video?new h.default(d.default.DATA_UPDATE_FAILED_ERROR_CODE,d.default.DATA_UPDATE_FAILED_ERROR_MESSAGE):null,n=0;n<e;n++)if(f[n].isUpdating()||w)return;if(K){K.clearMediaInfoArray();for(var i=0;i<e&&f[i];i++){var a=f[i].getType(),s=f[i].getMediaInfo();if(a===r.default.AUDIO||a===r.default.VIDEO||a===r.default.TEXT&&s.isFragmented){var o=f[i].getMediaInfo();o&&K.initializeForMedia(o)}}}t?G.error(t):v||(v=!0,M.trigger(l.default.STREAM_INITIALIZED,{streamInfo:$}))}function de(){var e=me(),t=e.length;if(0!==t){for(var i=0;i<t;i++)if(!e[i].isBufferingCompleted()&&(e[i].getType()===r.default.AUDIO||e[i].getType()===r.default.VIDEO))return void n.debug("onBufferingCompleted - One streamProcessor has finished but",e[i].getType(),"one is not buffering completed");n.debug("onBufferingCompleted - trigger STREAM_BUFFERING_COMPLETED"),T=!0,M.trigger(l.default.STREAM_BUFFERING_COMPLETED,{streamInfo:$},{streamInfo:$})}else n.warn("onBufferingCompleted - can't trigger STREAM_BUFFERING_COMPLETED because no streamProcessor is defined")}function fe(e){S[e.mediaType]=e.error,ce()}function he(e){z&&z.addInbandEvents(e.events)}function pe(e){return e&&e.type?ge(e.type):null}function ge(e){return e?me().filter((function(t){return t.getType()===e}))[0]:null}function me(){for(var e,t,n=[],i=0;i<f.length;i++)(e=(t=f[i]).getType())!==r.default.AUDIO&&e!==r.default.VIDEO&&e!==r.default.TEXT||n.push(t);return n}function ye(e,t){var n=se(),r=t.getStreamInfo();if(!r||!n)return!0;var i=j.getAdaptationForType(r.index,e,r),a=j.getAdaptationForType(n.index,e,n);return i&&a?!(!ve(a)&&ve(i)):!i&&!a}function ve(e){return!!e&&!!(e.ContentProtection||e.Representation&&e.Representation.length>0&&e.Representation[0].ContentProtection)}function _e(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e||!e.hasOwnProperty("getStreamInfo"))return!1;var r=e.getStreamInfo(),i=n?n.getStreamInfo():se();if(!r||!i)return!1;var a=j.getAdaptationForType(r.index,t,r),s=j.getAdaptationForType(i.index,t,i);if(!a||!s)return!a&&!s;var o=a&&s&&a.mimeType===s.mimeType,u=s.Representation_asArray.map((function(e){return e.codecs})),l=a.Representation_asArray.map((function(e){return e.codecs})),c=l.some((function(e){return u.indexOf(e)>-1})),d=l.some((function(e){return u.some((function(t){return H.codecRootCompatibleWithCodec(t,e)}))}));return c||d&&o}function Te(e){R=e}function be(){return R}return t={initialize:function(){M.on(l.default.BUFFERING_COMPLETED,de,t),M.on(l.default.DATA_UPDATE_COMPLETED,fe,t),M.on(l.default.INBAND_EVENTS,he,t),K&&(M.on(l.default.KEY_ERROR,ue,t),M.on(l.default.SERVER_CERTIFICATE_UPDATED,ue,t),M.on(l.default.LICENSE_REQUEST_COMPLETE,ue,t),M.on(l.default.KEY_SYSTEM_SELECTED,ue,t),M.on(l.default.KEY_SESSION_CREATED,ue,t),M.on(l.default.KEY_STATUSES_CHANGED,ue,t)),W.initializeForStream($),M.trigger(l.default.STREAM_UPDATED,{streamInfo:$})},getStreamId:function(){return $?$.id:null},activate:function(e,t){return new Promise((function(n,r){if(!_)return be()?(_=!0,M.trigger(l.default.STREAM_ACTIVATED,{streamInfo:$}),void n(t)):void function(e,t){return J(e,t)}(e,t).then((function(e){_=!0,M.trigger(l.default.STREAM_ACTIVATED,{streamInfo:$}),n(e)})).catch((function(e){r(e)}));n(t)}))},deactivate:te,getIsActive:function(){return _},getDuration:function(){return $?$.duration:NaN},getStartTime:ie,getId:ae,getStreamInfo:se,getHasAudioTrack:function(){return E},getHasVideoTrack:function(){return b},startPreloading:function(e,t){return new Promise((function(r,i){be()?i():(n.info("[startPreloading] Preloading next stream with id ".concat(ae())),Te(!0),J(e,t).then((function(){for(var e=0;e<f.length&&f[e];e++)f[e].setExplicitBufferingTime(ie()),f[e].getScheduleController().startScheduleTimer();r()})).catch((function(){Te(!1),i()})))}))},getThumbnailController:function(){return I},getBitrateListFor:function(e){if(oe(),e===r.default.IMAGE)return I?I.getBitrateList():[];var t=function(e){for(var t=null,n=0;n<f.length;n++)if((t=f[n]).getType()===e)return t.getMediaInfo();return null}(e);return V.getBitrateList(t)},updateData:function(e){return new Promise((function(t){w=!0,$=e,z&&le();for(var n=[],r=0,i=f.length;r<i;r++){var a=f[r],s=a.getMediaInfo();n.push(a.updateStreamInfo($));var o=j.getAllMediaInfoForType($,a.getType());if(o){a.clearMediaInfoArray();for(var u=0;u<o.length;u++){var c=o[u];a.addMediaInfo(o[u]),j.areMediaInfosEqual(s,c)&&(V.updateTopQualityIndex(c),n.push(a.selectMediaInfo(c)))}}}Promise.all(n).then((function(){for(n=[];O.length>0;){var e=O.pop(),t=e.newMediaInfo,r=pe(e.oldMediaInfo);if(!r)return;n.push(r.prepareTrackSwitch()),r.selectMediaInfo(t)}return Promise.all(n)})).then((function(){w=!1,ce(),M.trigger(l.default.STREAM_UPDATED,{streamInfo:$}),t()}))}))},reset:function(e){A&&(A.reset(),A=null),V&&$&&V.clearDataForStream($.id),C&&(C.reset(),C=null),ne(e),$=null,M.off(l.default.DATA_UPDATE_COMPLETED,fe,t),M.off(l.default.BUFFERING_COMPLETED,de,t),M.off(l.default.INBAND_EVENTS,he,t),K&&(M.off(l.default.KEY_ERROR,ue,t),M.off(l.default.SERVER_CERTIFICATE_UPDATED,ue,t),M.off(l.default.LICENSE_REQUEST_COMPLETE,ue,t),M.off(l.default.KEY_SYSTEM_SELECTED,ue,t),M.off(l.default.KEY_SESSION_CREATED,ue,t),M.off(l.default.KEY_STATUSES_CHANGED,ue,t))},getProcessors:me,setMediaSource:function(e){for(var t=0;t<f.length;)ee(f[t].getMediaInfo())?(f[t].setMediaSource(e),t++):(f[t].reset(),f.splice(t,1));if(0===f.length){var r="No streams to play.";G.error(new h.default(d.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,r+"nostreams",L.getValue())),n.fatal(r)}},isMediaCodecCompatible:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return _e(e,r.default.VIDEO,t)&&_e(e,r.default.AUDIO,t)},isProtectionCompatible:function(e){return!e||ye(r.default.VIDEO,e)&&ye(r.default.AUDIO,e)},getPreloaded:be,getIsEndedEventSignaled:function(){return N},setIsEndedEventSignaled:re,getAdapter:function(){return j},getHasFinishedBuffering:function(){return T},setPreloaded:Te,startScheduleControllers:function(){for(var e=f.length,t=0;t<e&&f[t];t++)f[t].getScheduleController().startScheduleTimer()},prepareTrackChange:function(e){if(_&&$){T=!1;var t=e.newMediaInfo,i=L.getValue();j.setCurrentMediaInfo($.id,t.type,t);var a=pe(t);if(a){var s=Y.getTime();n.info("Stream - Process track changed at current time "+s),i.refreshManifestOnSwitchTrack?(O.push(e),B.getIsUpdating()||(n.debug("Stream - Refreshing manifest for switch track"),B.refreshManifest())):a.selectMediaInfo(t).then((function(){t.type!==r.default.VIDEO&&t.type!==r.default.AUDIO||V.updateTopQualityIndex(t),a.prepareTrackSwitch()}))}}},prepareQualityChange:function(e){var t=ge(e.mediaType);t&&t.prepareQualityChange(e)}},function(){try{x=Object(c.default)(P).getInstance(),n=x.getLogger(t),ne(),D=Object(p.default)(P).getInstance(),C=Object(m.default)(P).create({updateEventName:l.default.SEGMENT_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:l.default.SEGMENT_LOCATION_BLACKLIST_ADD}),A=Object(s.default)(P).create({streamInfo:$,mediaPlayerModel:F,dashMetrics:U,errHandler:G,settings:Q,boxParser:D,dashConstants:i.default,urlUtils:k})}catch(e){throw e}}(),t}v.__dashjs_factory_name="Stream",t.default=f.default.getClassFactory(v)},"./src/streaming/StreamProcessor.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/dash/constants/DashConstants.js"),a=n("./src/streaming/constants/MetricsConstants.js"),s=n("./src/streaming/models/FragmentModel.js"),o=n("./src/streaming/controllers/BufferController.js"),u=n("./src/streaming/text/NotFragmentedTextBufferController.js"),l=n("./src/streaming/controllers/ScheduleController.js"),c=n("./src/dash/controllers/RepresentationController.js"),d=n("./src/core/FactoryMaker.js"),f=n("./src/streaming/utils/SupervisorTools.js"),h=n("./src/core/EventBus.js"),p=n("./src/core/events/Events.js"),g=n("./src/dash/DashHandler.js"),m=n("./src/core/errors/Errors.js"),y=n("./src/streaming/vo/DashJSError.js"),v=n("./src/core/Debug.js"),_=n("./src/streaming/utils/RequestModifier.js"),T=n("./src/streaming/utils/URLUtils.js"),b=n("./src/streaming/utils/BoxParser.js"),E=n("./src/streaming/vo/metrics/PlayList.js"),S=n("./src/dash/controllers/SegmentsController.js"),w=n("./src/streaming/vo/metrics/HTTPRequest.js");function A(e){e=e||{};var t,n,d,A,I,C,R,D,x,N,O,P,M,k=this.context,L=Object(h.default)(k).getInstance(),F=e.streamInfo,U=e.type,B=e.errHandler,j=e.mimeType,q=e.timelineConverter,H=e.adapter,G=e.manifestModel,V=e.mediaPlayerModel,Y=e.fragmentModel,z=e.abrController,Z=e.playbackController,K=e.mediaController,W=e.textController,X=e.dashMetrics,$=e.settings,Q=e.boxParser,J=e.segmentBlacklistController;function ee(){return F.id}function te(){return U}function ne(){return H.getIsTextTrack(D.getData())}function re(){I=[],A=null,M=0,x=!1,N=!1}function ie(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.sender)if(Z.getIsManifestUpdateInProgress())se();else if((!ne()||W.isTextEnabled())&&C&&e.representationId&&!C.appendInitSegmentFromCache(e.representationId)){var n=D.getCurrentRepresentation();if(0===n.range)return void ae();var r=O?O.getInitRequest(A,n):null;r?Y.executeRequest(r):t&&(R.setInitSegmentRequired(!0),se())}}function ae(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Z.getIsManifestUpdateInProgress()||C.getIsPruningInProgress())se();else{var i=function(){var e,t=Te();if(isNaN(M)||te()===r.default.TEXT&&!W.isTextEnabled())return null;var n=x;if(O){var i=D&&t?D.getRepresentationForQuality(t.quality):null;e=n?O.getSegmentRequestForTime(A,i,M):O.getNextSegmentRequest(A,i)}return e}();i?(x=!1,function(e){isNaN(e.startTime+e.duration)||(M=e.startTime+e.duration),e.delayLoadingTime=(new Date).getTime()+R.getTimeToLoadDelay(),R.setTimeToLoadDelay(0),function(e){var t=e.url;return e.range&&(t=t.concat("_",e.range)),J.contains(t)}(e)?(n.warn("Fragment request url ".concat(e.url," for stream id ").concat(F.id," and media type ").concat(U," is on the ignore list and will be skipped")),se()):(n.debug("Next fragment request url for stream id ".concat(F.id," and media type ").concat(U," is ").concat(e.url)),Y.executeRequest(e))}(i)):function(e){var t=D.getCurrentRepresentation();if($.get().streaming.gaps.enableSeekFix&&!d&&x&&Z.isSeeking()){var r=O.getValidSeekTimeCloseToTargetTime(M,A,t,$.get().streaming.gaps.threshold);if(!isNaN(r))return void Z.seek(r,!1,!1)}if(O.isLastSegmentRequested(t,M)){var i=O.getCurrentIndex();return n.debug("Segment requesting for stream ".concat(F.id," has finished")),L.trigger(p.default.STREAM_REQUESTING_COMPLETED,{segmentIndex:i},{streamId:F.id,mediaType:U}),C.segmentRequestingCompleted(i),void R.clearScheduleTimer()}e&&se()}(t)}}function se(){R.startScheduleTimer($.get().streaming.lowLatencyEnabled?$.get().streaming.scheduling.lowLatencyTimeout:$.get().streaming.scheduling.defaultTimeout)}function oe(e){e.error||(R.setCurrentRepresentation(H.convertRepresentationToRepresentationInfo(e.currentRepresentation)),C.getIsBufferingCompleted()||C.updateBufferTimestampOffset(e.currentRepresentation))}function ue(e){X.addBufferState(U,e.state,R.getBufferTarget()),e.state!==a.default.BUFFER_EMPTY||Z.isSeeking()||(n.info("Buffer is empty! Stalling!"),X.pushPlayListTraceMetrics(new Date,E.PlayListTrace.REBUFFERING_REASON))}function le(e){Y.syncExecutedRequestsWithBufferedRange(C.getBuffer().getAllBufferRanges(),F.duration),e.quotaExceeded&&e.from>Z.getTime()&&Ie(e.from),e.hasEnoughSpaceToAppend&&e.quotaExceeded&&R.startScheduleTimer()}function ce(e){if(e&&e.lastRequestAppended&&e.lastRequestAppended.url){var t=e.lastRequestAppended.url;e.lastRequestAppended.range&&(t=t.concat("_",e.lastRequestAppended.range)),n.warn("Blacklisting segment with url ".concat(t)),J.add(t)}}function de(){we(),N=!1}function fe(e){n.info("onFragmentLoadingAbandoned request: "+e.request.url+" has been aborted"),Z.isSeeking()||R.getSwitchStrack()||N||(n.info("onFragmentLoadingAbandoned request: "+e.request.url+" has to be downloaded again, origin is not seeking process or switch track call"),e.request&&e.request.isInitializationRequest()?R.setInitSegmentRequired(!0):Ie(e.request.startTime+e.request.duration/2),R.startScheduleTimer(0))}function he(e){n.info("OnFragmentLoadingCompleted for stream id "+F.id+" and media type "+U+" - Url:",e.request?e.request.url:"undefined",e.request.range?", Range:"+e.request.range:""),ne()&&R.startScheduleTimer(0),e.error&&e.request.serviceLocation&&function(e){n.info("Fragment loading completed with an error"),e&&e.request&&e.request.type&&(e.request.type===w.HTTPRequest.INIT_SEGMENT_TYPE?ie({representationId:e.request.representationId,sender:{}},!1):e.request.type===w.HTTPRequest.MEDIA_SEGMENT_TYPE&&(Ie(e.request.startTime+e.request.duration/2),ae({},!1)))}(e)}function pe(){Ie(Z.getTime()),_e().startScheduleTimer()}function ge(e){var t=e.currentTrackInfo;if(t){var n=I.find((function(e){return e.index===t.index&&e.lang===t.lang}));n&&ve(n).then((function(){C.setIsBufferingCompleted(!1),Ie(Z.getTime()),R.setInitSegmentRequired(!0),R.startScheduleTimer()}))}}function me(e){Ie(e.quotaExceededTime),R.clearScheduleTimer()}function ye(){return C?C.getBuffer():null}function ve(e){e===A||e&&A&&e.type!==A.type||(A=e);var t=H.getRealAdaptation(F,A),n=H.getVoRepresentations(A);if(D){var i,a=D.getData(),s=z.getMaxAllowedIndexFor(U,F.id),o=z.getMinAllowedIndexFor(U,F.id),u=null;return null!==a&&a.id===t.id||U===r.default.TEXT?i=z.getQualityFor(U,F.id):(u=z.getThroughputHistory().getAverageThroughput(U,d)||z.getInitialBitrateFor(U,F.id),i=z.getQualityForBitrate(A,u,F.id)),void 0!==o&&i<o&&(i=o),i>s&&(i=s),D.updateData(t,n,U,A.isFragmented,i)}return Promise.resolve()}function _e(){return R}function Te(e){var t;return void 0!==e?(Object(f.checkInteger)(e),t=D?D.getRepresentationForQuality(e):null):t=D?D.getCurrentRepresentation():null,H.convertRepresentationToRepresentationInfo(t)}function be(){return!!C&&C.getIsBufferingCompleted()}function Ee(e){var t=e.chunk,n=t.bytes,r=t.quality,i=Te(r),a=D&&i?D.getRepresentationForQuality(i.quality):null;if(i&&a){var o=H.getEventsFor(i.mediaInfo),u=H.getEventsFor(i,a);if(o&&o.length>0||u&&u.length>0){var l=function(e,t,n,r){try{for(var i={},a=[],s=n.concat(r),o=0,u=s.length;o<u;o++)i[s[o].schemeIdUri+"/"+s[o].value]=s[o];var l=Object(b.default)(k).getInstance().parse(e),c=l.getBoxes("emsg");if(!c||0===c.length)return a;for(var d=l.getBox("sidx"),f=!d||isNaN(d.earliest_presentation_time)||isNaN(d.timescale)?t&&!isNaN(t.mediaStartTime)?t.mediaStartTime:0:d.earliest_presentation_time/d.timescale,h=Math.max(f,0),p=D.getCurrentRepresentation(),g=0,m=c.length;g<m;g++){var y=H.getEvent(c[g],i,h,p);y&&a.push(y)}return a}catch(e){return[]}}(n,Y.getRequests({state:s.default.FRAGMENT_MODEL_EXECUTED,quality:r,index:t.index})[0],o,u);L.trigger(p.default.INBAND_EVENTS,{events:l},{streamId:F.id})}}}function Se(){var e=Z.getTime();$.get().streaming.buffer.flushBufferAtTrackSwitch&&Z.seek(e+.001,!1,!0),Ie(e),C.setSeekTarget(e),R.startScheduleTimer()}function we(){var e=Z.getTime();Ie(C.getContinuousBufferTimeForTargetTime(e)),R.startScheduleTimer()}function Ae(e){e&&!isNaN(e.time)&&(Ie(e.time),C.setSeekTarget(e.time))}function Ie(e){M=e,x=!0}return t={initialize:function(n,a,s){P=Object(S.default)(k).create({events:p.default,eventBus:L,streamInfo:F,timelineConverter:q,dashConstants:i.default,segmentBaseController:e.segmentBaseController,type:U}),O=Object(g.default)(k).create({streamInfo:F,type:U,timelineConverter:q,dashMetrics:X,mediaPlayerModel:V,baseURLController:e.baseURLController,errHandler:B,segmentsController:P,settings:$,boxParser:Q,events:p.default,eventBus:L,errors:m.default,debug:Object(v.default)(k).getInstance(),requestModifier:Object(_.default)(k).getInstance(),dashConstants:i.default,constants:r.default,urlUtils:Object(T.default)(k).getInstance()}),d=F.manifestInfo.isDynamic,O.initialize(d),z.registerStreamType(U,t),D=Object(c.default)(k).create({streamInfo:F,type:U,abrController:z,dashMetrics:X,playbackController:Z,timelineConverter:q,dashConstants:i.default,events:p.default,eventBus:L,errors:m.default,isDynamic:d,segmentsController:P}),C=function(e,t){return e?e!==r.default.TEXT||t?Object(o.default)(k).create({streamInfo:F,type:e,mediaPlayerModel:V,manifestModel:G,fragmentModel:Y,errHandler:B,mediaController:K,representationController:D,adapter:H,textController:W,abrController:z,playbackController:Z,settings:$}):Object(u.default)(k).create({streamInfo:F,type:e,mimeType:j,fragmentModel:Y,textController:W,errHandler:B,settings:$}):(B.error(new y.default(m.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,m.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+"not properly defined")),null)}(U,s),C&&C.initialize(n),(R=Object(l.default)(k).create({streamInfo:F,type:U,mimeType:j,adapter:H,dashMetrics:X,mediaPlayerModel:V,fragmentModel:Y,abrController:z,playbackController:Z,textController:W,mediaController:K,bufferController:C,settings:$})).initialize(a),M=0,x=!1},getStreamId:ee,getType:te,isUpdating:function(){return!!D&&D.isUpdating()},getBufferController:function(){return C},getFragmentModel:function(){return Y},getScheduleController:_e,getRepresentationController:function(){return D},getRepresentationInfo:Te,getBufferLevel:function(){return C?C.getBufferLevel():0},isBufferingCompleted:be,createBufferSinks:function(e){var t=ye();return t?Promise.resolve(t):C?C.createBufferSink(A,e):Promise.resolve(null)},updateStreamInfo:function(e){return F=e,be()?Promise.resolve():C.updateAppendWindow()},getStreamInfo:function(){return F},selectMediaInfo:ve,clearMediaInfoArray:function(){I=[]},addMediaInfo:function(e){-1===I.indexOf(e)&&I.push(e)},prepareTrackSwitch:function(){return new Promise((function(e){n.debug("Preparing track switch for type ".concat(U));var t=U===r.default.TEXT||$.get().streaming.trackSwitchMode[U]===r.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE&&Z.getTimeToStreamEnd(F)>$.get().streaming.buffer.stallThreshold;if(C.getIsBufferingCompleted()&&!t)return C.prepareForNonReplacementTrackSwitch(A.codec).then((function(){L.trigger(p.default.BUFFERING_COMPLETED,{},{streamId:F.id,mediaType:U})})).catch((function(){L.trigger(p.default.BUFFERING_COMPLETED,{},{streamId:F.id,mediaType:U})})),void e();R.clearScheduleTimer(),R.setSwitchTrack(!0),t?(L.trigger(p.default.BUFFER_REPLACEMENT_STARTED,{mediaType:U,streamId:F.id},{mediaType:U,streamId:F.id}),Y.abortRequests(),C.prepareForReplacementTrackSwitch(A.codec).then((function(){var e=Te();return C.updateBufferTimestampOffset(e)})).then((function(){Se(),e()})).catch((function(){Se(),e()}))):C.prepareForNonReplacementTrackSwitch(A.codec).then((function(){we(),e()})).catch((function(){we(),e()}))}))},prepareQualityChange:function(e){n.debug("Preparing quality switch for type ".concat(U));var t=e.newQuality;N=!0,R.clearScheduleTimer();var r=Te(t);R.setCurrentRepresentation(r),D.prepareQualityChange(t),Y.abortRequests(),C.updateBufferTimestampOffset(r).then((function(){e.reason&&e.reason.forceReplace?(L.trigger(p.default.BUFFER_REPLACEMENT_STARTED,{mediaType:U,streamId:F.id},{mediaType:U,streamId:F.id}),C.prepareForReplacementQualitySwitch().then((function(){Se(),N=!1})).catch((function(){Se(),N=!1}))):$.get().streaming.buffer.fastSwitchEnabled?function(e){var t=Z.getTime(),n=1.5,r=Y.getRequests({state:s.default.FRAGMENT_MODEL_EXECUTED,time:t+n,threshold:0})[0];if(r&&!ne()){var i=C.getBufferLevel(),o=z.getAbandonmentStateFor(F.id,U);r.quality<e.quality&&i>=n&&o!==a.default.ABANDON_LOAD?(Ie(t+n),R.setCheckPlaybackQuality(!1),R.startScheduleTimer()):de()}else R.startScheduleTimer();N=!1}(r):de(),X.pushPlayListTraceMetrics(new Date,E.PlayListTrace.REPRESENTATION_SWITCH_STOP_REASON),X.createPlaylistTraceMetrics(r.id,1e3*Z.getTime(),Z.getPlaybackRate())}))},getMediaInfo:function(){return A},getMediaSource:function(){return C.getMediaSource()},setMediaSource:function(e){C.setMediaSource(e)},getBuffer:ye,setExplicitBufferingTime:Ie,finalisePlayList:function(e,t){X.pushPlayListTraceMetrics(e,t)},probeNextRequest:function(){var e=Te(),t=D&&e?D.getRepresentationForQuality(e.quality):null;return O.getNextSegmentRequestIdempotent(A,t)},prepareInnerPeriodPlaybackSeeking:function(e){return new Promise((function(t){R.clearScheduleTimer(),Y.abortRequests(),C.prepareForPlaybackSeek().then((function(){var t=C.getAllRangesWithSafetyFactor(e.seekTime);return C.clearBuffers(t)})).then((function(){var n=C.getContinuousBufferTimeForTargetTime(e.seekTime);if(!isNaN(F.duration)&&isFinite(F.duration)&&n>=F.start+F.duration)C.setIsBufferingCompleted(!0),t();else{Ie(n),C.setSeekTarget(n);var r=[];r.push(C.updateAppendWindow());var i=Te();r.push(C.updateBufferTimestampOffset(i)),Promise.all(r).then((function(){R.setInitSegmentRequired(!0),R.setCheckPlaybackQuality(!1),R.startScheduleTimer(),t()}))}})).catch((function(e){n.error(e)}))}))},prepareOuterPeriodPlaybackSeeking:function(){return new Promise((function(e,t){try{R.clearScheduleTimer(),Y.abortRequests(),C.prepareForPlaybackSeek().then((function(){return C.pruneAllSafely()})).then((function(){e()}))}catch(e){t(e)}}))},reset:function(e,n){O&&O.reset(),C&&(C.reset(e,n),C=null),R&&(R.reset(),R=null),D&&(D.reset(),D=null),P&&(P=null),z&&z.unRegisterStreamType(ee(),U),L.off(p.default.DATA_UPDATE_COMPLETED,oe,t),L.off(p.default.INIT_FRAGMENT_NEEDED,ie,t),L.off(p.default.MEDIA_FRAGMENT_NEEDED,ae,t),L.off(p.default.MEDIA_FRAGMENT_LOADED,Ee,t),L.off(p.default.BUFFER_LEVEL_STATE_CHANGED,ue,t),L.off(p.default.BUFFER_CLEARED,le,t),L.off(p.default.SEEK_TARGET,Ae,t),L.off(p.default.FRAGMENT_LOADING_ABANDONED,fe,t),L.off(p.default.FRAGMENT_LOADING_COMPLETED,he,t),L.off(p.default.SET_FRAGMENTED_TEXT_AFTER_DISABLED,pe,t),L.off(p.default.SET_NON_FRAGMENTED_TEXT,ge,t),L.off(p.default.QUOTA_EXCEEDED,me,t),L.off(p.default.SOURCE_BUFFER_ERROR,ce,t),re(),U=null,F=null}},n=Object(v.default)(k).getInstance().getLogger(t),re(),L.on(p.default.DATA_UPDATE_COMPLETED,oe,t,{priority:h.default.EVENT_PRIORITY_HIGH}),L.on(p.default.INIT_FRAGMENT_NEEDED,ie,t),L.on(p.default.MEDIA_FRAGMENT_NEEDED,ae,t),L.on(p.default.MEDIA_FRAGMENT_LOADED,Ee,t),L.on(p.default.BUFFER_LEVEL_STATE_CHANGED,ue,t),L.on(p.default.BUFFER_CLEARED,le,t),L.on(p.default.SEEK_TARGET,Ae,t),L.on(p.default.FRAGMENT_LOADING_ABANDONED,fe,t),L.on(p.default.FRAGMENT_LOADING_COMPLETED,he,t),L.on(p.default.QUOTA_EXCEEDED,me,t),L.on(p.default.SET_FRAGMENTED_TEXT_AFTER_DISABLED,pe,t),L.on(p.default.SET_NON_FRAGMENTED_TEXT,ge,t),L.on(p.default.SOURCE_BUFFER_ERROR,ce,t),t}A.__dashjs_factory_name="StreamProcessor",t.default=d.default.getClassFactory(A)},"./src/streaming/XlinkLoader.js":function(e,t,n){n.r(t);var r=n("./src/streaming/vo/DashJSError.js"),i=n("./src/streaming/net/URLLoader.js"),a=n("./src/streaming/vo/metrics/HTTPRequest.js"),s=n("./src/streaming/vo/TextRequest.js"),o=n("./src/core/EventBus.js"),u=n("./src/core/events/Events.js"),l=n("./src/core/FactoryMaker.js"),c=n("./src/core/errors/Errors.js");function d(e){e=e||{};var t=this.context,n=Object(o.default)(t).getInstance(),l=Object(i.default)(t).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,errors:c.default});return{load:function(e,t,i){var o=function(a,s){t.resolved=!0,t.resolvedContent=a||null,n.trigger(u.default.XLINK_ELEMENT_LOADED,{element:t,resolveObject:i,error:a||s?null:new r.default(c.default.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE,c.default.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE+e)})};if("urn:mpeg:dash:resolve-to-zero:2013"===e)o(null,!0);else{var d=new s.default(e,a.HTTPRequest.XLINK_EXPANSION_TYPE);l.load({request:d,success:function(e){o(e)},error:function(){o(null)}})}},reset:function(){l&&(l.abort(),l=null)}}}d.__dashjs_factory_name="XlinkLoader",t.default=l.default.getClassFactory(d)},"./src/streaming/constants/ConformanceViolationConstants.js":function(e,t,n){n.r(t),t.default={LEVELS:{SUGGESTION:"Suggestion",WARNING:"Warning",ERROR:"Error"},EVENTS:{NO_UTC_TIMING_ELEMENT:{key:"NO_UTC_TIMING_ELEMENT",message:"No UTCTiming element is present in the manifest. You may experience playback failures. For a detailed validation use https://conformance.dashif.org/"},NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE:{key:"NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE",message:'SMPTE 2052-1:2013 defines the attribute name as "imageType" and does not define "imagetype"'},INVALID_DVR_WINDOW:{key:"INVALID_DVR_WINDOW",message:"No valid segment found when applying a specification compliant DVR window calculation. Using SegmentTimeline entries as a fallback."}}}},"./src/streaming/constants/Constants.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t,n,i;return t=e,(n=[{key:"init",value:function(){this.STREAM="stream",this.VIDEO="video",this.AUDIO="audio",this.TEXT="text",this.MUXED="muxed",this.IMAGE="image",this.STPP="stpp",this.TTML="ttml",this.VTT="vtt",this.WVTT="wvtt",this.ABR_STRATEGY_DYNAMIC="abrDynamic",this.ABR_STRATEGY_BOLA="abrBola",this.ABR_STRATEGY_L2A="abrL2A",this.ABR_STRATEGY_LoLP="abrLoLP",this.ABR_STRATEGY_THROUGHPUT="abrThroughput",this.ABR_FETCH_THROUGHPUT_CALCULATION_DOWNLOADED_DATA="abrFetchThroughputCalculationDownloadedData",this.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING="abrFetchThroughputCalculationMoofParsing",this.ABR_FETCH_THROUGHPUT_CALCULATION_AAST="abrFetchThroughputCalculationAAST",this.LIVE_CATCHUP_MODE_DEFAULT="liveCatchupModeDefault",this.LIVE_CATCHUP_MODE_LOLP="liveCatchupModeLoLP",this.MOVING_AVERAGE_SLIDING_WINDOW="slidingWindow",this.MOVING_AVERAGE_EWMA="ewma",this.BAD_ARGUMENT_ERROR="Invalid Arguments",this.MISSING_CONFIG_ERROR="Missing config parameter(s)",this.TRACK_SWITCH_MODE_ALWAYS_REPLACE="alwaysReplace",this.TRACK_SWITCH_MODE_NEVER_REPLACE="neverReplace",this.TRACK_SELECTION_MODE_FIRST_TRACK="firstTrack",this.TRACK_SELECTION_MODE_HIGHEST_BITRATE="highestBitrate",this.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY="highestEfficiency",this.TRACK_SELECTION_MODE_WIDEST_RANGE="widestRange",this.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY="highestSelectionPriority",this.CMCD_MODE_QUERY="query",this.CMCD_MODE_HEADER="header",this.LOCATION="Location",this.INITIALIZE="initialize",this.TEXT_SHOWING="showing",this.TEXT_HIDDEN="hidden",this.CC1="CC1",this.CC3="CC3",this.UTF8="utf-8",this.SCHEME_ID_URI="schemeIdUri",this.START_TIME="starttime",this.SERVICE_DESCRIPTION_LL_SCHEME="urn:dvb:dash:lowlatency:scope:2019",this.SUPPLEMENTAL_PROPERTY_LL_SCHEME="urn:dvb:dash:lowlatency:critical:2019",this.XML="XML",this.ARRAY_BUFFER="ArrayBuffer",this.DVB_REPORTING_URL="dvb:reportingUrl",this.DVB_PROBABILITY="dvb:probability",this.VIDEO_ELEMENT_READY_STATES={HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_DATA:4}}}])&&r(t.prototype,n),i&&r(t,i),e}());t.default=i},"./src/streaming/constants/MetricsConstants.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t,n,i;return t=e,(n=[{key:"init",value:function(){this.TCP_CONNECTION="TcpList",this.HTTP_REQUEST="HttpList",this.TRACK_SWITCH="RepSwitchList",this.BUFFER_LEVEL="BufferLevel",this.BUFFER_LOADED="bufferLoaded",this.ABANDON_LOAD="abandonload",this.ALLOW_LOAD="allowload",this.BUFFER_EMPTY="bufferStalled",this.BUFFER_STATE="BufferState",this.DVR_INFO="DVRInfo",this.DROPPED_FRAMES="DroppedFrames",this.SCHEDULING_INFO="SchedulingInfo",this.REQUESTS_QUEUE="RequestsQueue",this.MANIFEST_UPDATE="ManifestUpdate",this.MANIFEST_UPDATE_STREAM_INFO="ManifestUpdatePeriodInfo",this.MANIFEST_UPDATE_TRACK_INFO="ManifestUpdateRepresentationInfo",this.PLAY_LIST="PlayList",this.DVB_ERRORS="DVBErrors"}}])&&r(t.prototype,n),i&&r(t,i),e}());t.default=i},"./src/streaming/constants/ProtectionConstants.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t,n,i;return t=e,(n=[{key:"init",value:function(){this.CLEARKEY_KEYSTEM_STRING="org.w3.clearkey",this.WIDEVINE_KEYSTEM_STRING="com.widevine.alpha",this.PLAYREADY_KEYSTEM_STRING="com.microsoft.playready",this.INITIALIZATION_DATA_TYPE_CENC="cenc",this.INITIALIZATION_DATA_TYPE_KEYIDS="keyids",this.INITIALIZATION_DATA_TYPE_WEBM="webm"}}])&&r(t.prototype,n),i&&r(t,i),e}());t.default=i},"./src/streaming/controllers/AbrController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/rules/abr/ABRRulesCollection.js"),i=n("./src/streaming/constants/Constants.js"),a=n("./src/streaming/constants/MetricsConstants.js"),s=n("./src/streaming/vo/BitrateInfo.js"),o=n("./src/streaming/models/FragmentModel.js"),u=n("./src/core/EventBus.js"),l=n("./src/core/events/Events.js"),c=n("./src/core/FactoryMaker.js"),d=n("./src/streaming/rules/RulesContext.js"),f=n("./src/streaming/rules/SwitchRequest.js"),h=n("./src/streaming/rules/SwitchRequestHistory.js"),p=n("./src/streaming/rules/DroppedFramesHistory.js"),g=n("./src/streaming/rules/ThroughputHistory.js"),m=n("./src/core/Debug.js"),y=n("./src/streaming/vo/metrics/HTTPRequest.js"),v=n("./src/streaming/utils/SupervisorTools.js"),_=n("./src/streaming/MediaPlayerEvents.js");function T(){var e,t,n,c,T,b,E,S,w,A,I,C,R,D,x,N,O,P,M,k,L,F,U,B,j,q=this.context,H=Object(m.default)(q).getInstance(),G=Object(u.default)(q).getInstance();function V(){T={},b={},S={},E={},P={},L={},F={},U={},void 0===A&&(A=!1),M&&M.reset(),O=void 0,M=void 0,k=void 0,clearTimeout(w),w=null}function Y(t){var r=t.request.mediaType,i=t.streamId;if(r&&i&&E[i]&&j.get().streaming.abr.autoSwitchBitrate[r]){var s=E[i][r];if(s){var u=Object(d.default)(q).create({abrController:e,streamProcessor:s,currentRequest:t.request,useBufferOccupancyABR:L[r],useL2AABR:F[r],useLoLPABR:U[r],videoModel:D}),l=n.shouldAbandonFragment(u,i);if(l.quality>f.default.NO_CHANGE){var h=s.getFragmentModel();h.getRequests({state:o.default.FRAGMENT_MODEL_LOADING,index:t.request.index})[0]&&(h.abortRequests(),S[i][r].state=a.default.ABANDON_LOAD,P[i][r].reset(),P[i][r].push({oldValue:X(r,i),newValue:l.quality,confidence:1,reason:l.reason}),$(r,c.getActiveStreamInfo(),l.quality,l.reason),clearTimeout(w),w=setTimeout((function(){S[i][r].state=a.default.ALLOW_LOAD,w=null}),j.get().streaming.abandonLoadTimeout))}}}}function z(e){e.mediaType===i.default.VIDEO&&(void 0!==O&&M.push(e.streamId,O,D.getPlaybackQuality()),O=e.newQuality)}function Z(e){var n,r;e.metric!==a.default.HTTP_REQUEST||!e.value||e.value.type!==y.HTTPRequest.MEDIA_SEGMENT_TYPE||e.mediaType!==i.default.AUDIO&&e.mediaType!==i.default.VIDEO||k.push(e.mediaType,e.value,j.get().streaming.abr.useDeadTimeLatency),e.metric!==a.default.BUFFER_LEVEL||e.mediaType!==i.default.AUDIO&&e.mediaType!==i.default.VIDEO||(n=e.mediaType,r=.001*e.value.level,j.get().streaming.abr.ABRStrategy===i.default.ABR_STRATEGY_DYNAMIC&&function(e,n){var r=x.getStableBufferTime(),i=r,a=.5*r,s=L[e],o=n>(s?a:i);L[e]=o,o!==s&&(o?t.info("["+e+"] switching from throughput to buffer occupancy ABR rule (buffer: "+n.toFixed(3)+")."):t.info("["+e+"] switching from buffer occupancy to throughput ABR rule (buffer: "+n.toFixed(3)+")."))}(n,r))}function K(e,t){try{var n;return T[t]=T[t]||{},T[t].hasOwnProperty(e)||(T[t][e]=0),n=function(e,t){var n=T[t][e],r=n;if(!E[t]||!E[t][e])return r;var i=W(e,t);void 0!==i&&(r=Math.max(n,i));var a=function(e,t){try{var n=j.get().streaming.abr.maxBitrate[e];return n>-1?J(E[t][e].getMediaInfo(),n,t):void 0}catch(e){return}}(e,t);return void 0!==a&&(r=Math.min(r,a)),r}(e,t),n=function(e,t,n){var r=T[n][t],i=j.get().streaming.abr.maxRepresentationRatio[t];return isNaN(i)||i>=1||i<0?e:Math.min(e,Math.round(r*i))}(n,e,t),n=function(e,t,n){if(t!==i.default.VIDEO||!j.get().streaming.abr.limitBitrateByPortal||!E[n]||!E[n][t])return e;A||te();var r=E[n][t].getStreamInfo(),a=R.getAdaptationForType(r.index,t,r).Representation,s=e;if(I>0&&C>0){for(;s>0&&a[s]&&I<a[s].width&&I-a[s-1].width<a[s].width-I;)s-=1;for(;s<a.length-1&&a[s].width===a[s+1].width;)s+=1}return s}(n,e,t),n}catch(e){return}}function W(e,t){try{return function(e,t){try{var n=j.get().streaming.abr.minBitrate[e];if(n>-1){var r=E[t][e].getMediaInfo(),i=ee(r),a=J(r,n,t);return i[a]&&a<i.length-1&&i[a].bitrate<1e3*n&&a++,a}return}catch(e){return}}(e,t)}catch(e){return}}function X(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{return t||(t=c.getActiveStreamInfo().id),e&&E[t]&&E[t][e]&&t?(b[t]=b[t]||{},b[t].hasOwnProperty(e)||(b[t][e]=0),b[t][e]):0}catch(e){return 0}}function $(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(t&&t.id&&e){var i=t.id,a=X(e,i);Object(v.checkInteger)(n);var s=K(e,i);n!==a&&n>=0&&n<=s&&Q(e,a,n,s,r,i)}}function Q(e,n,r,i,a,s){if(e&&E[s]&&E[s][e]){var o=E[s][e].getStreamInfo(),u=o&&o.manifestInfo&&o.manifestInfo.isDynamic,c=B.getCurrentBufferLevel(e);t.info("Stream ID: "+s+" ["+e+"] switch from "+n+" to "+r+"/"+i+" (buffer: "+c+") "+(a?JSON.stringify(a):".")),b[s]=b[s]||{},b[s][e]=r;var d=function(e,t,n){if(t&&E&&E[e]&&E[e][t]){var r=ee(E[e][t].getMediaInfo());return r[n]?r[n]:null}return null}(s,e,r);G.trigger(l.default.QUALITY_CHANGE_REQUESTED,{oldQuality:n,newQuality:r,reason:a,streamInfo:o,bitrateInfo:d,maxIdx:i,mediaType:e},{streamId:o.id,mediaType:e});var f=k.getAverageThroughput(e,u);isNaN(f)||N.setSavedBitrateSettings(e,f)}}function J(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=e&&e.type?E[n][e.type].getRepresentationInfo():null;if(j.get().streaming.abr.useDeadTimeLatency&&r&&i&&i.fragmentDuration){r/=1e3;var a=i.fragmentDuration;if(r>a)return 0;t*=1-r/a}for(var s=ee(e),o=s.length-1;o>=0;o--)if(1e3*t>=s[o].bitrate)return o;return 0}function ee(e){var t=[];if(!e||!e.bitrateList)return t;for(var n,r=e.bitrateList,i=e.type,a=0,o=r.length;a<o;a++)(n=new s.default).mediaType=i,n.qualityIndex=a,n.bitrate=r[a].bandwidth,n.width=r[a].width,n.height=r[a].height,n.scanType=r[a].scanType,t.push(n);return t}function te(){if(D){var e=j.get().streaming.abr.usePixelRatioInLimitBitrateByPortal&&window.hasOwnProperty("devicePixelRatio")?window.devicePixelRatio:1;I=D.getClientWidth()*e,C=D.getClientHeight()*e}}return e={initialize:function(){M=Object(p.default)(q).create(),k=Object(g.default)(q).create({settings:j}),(n=Object(r.default)(q).create({dashMetrics:B,mediaPlayerModel:x,settings:j})).initialize(),G.on(_.default.QUALITY_CHANGE_RENDERED,z,e),G.on(_.default.METRIC_ADDED,Z,e),G.on(l.default.LOADING_PROGRESS,Y,e)},isPlayingAtTopQuality:function(e){var t=e?e.id:null,n=X(i.default.AUDIO,t),r=X(i.default.VIDEO,t);return n===K(i.default.AUDIO,t)&&r===K(i.default.VIDEO,t)},updateTopQualityIndex:function(e){var t=e.type,n=e.streamInfo.id,r=e.representationCount-1;return T[n]=T[n]||{},T[n][t]=r,r},clearDataForStream:function(e){M&&M.clearForStream(e),E[e]&&delete E[e],P[e]&&delete P[e],S[e]&&delete S[e]},getThroughputHistory:function(){return k},getBitrateList:ee,getQualityForBitrate:J,getTopBitrateInfoFor:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t||(t=c.getActiveStreamInfo().id),e&&E&&E[t]&&E[t][e]){var n=K(e,t),r=ee(E[t][e].getMediaInfo());return r[n]?r[n]:null}return null},getMinAllowedIndexFor:W,getMaxAllowedIndexFor:K,getInitialBitrateFor:function(e,t){if(function(){if(!N||!N.hasOwnProperty("getSavedBitrateSettings"))throw new Error(i.default.MISSING_CONFIG_ERROR)}(),e===i.default.TEXT)return NaN;var n=N.getSavedBitrateSettings(e),r=j.get().streaming.abr.initialBitrate[e],a=j.get().streaming.abr.initialRepresentationRatio[e];if(-1===r)if(a>-1){var s=E[t][e].getStreamInfo(),o=R.getAdaptationForType(s.index,e,s).Representation;r=Array.isArray(o)?o[Math.max(Math.round(o.length*a)-1,0)].bandwidth/1e3:0}else r=isNaN(n)?e===i.default.VIDEO?1e3:100:n;return r},getQualityFor:X,getAbandonmentStateFor:function(e,t){return S[e]&&S[e][t]?S[e][t].state:null},setPlaybackQuality:$,checkPlaybackQuality:function(t,r){try{if(!(t&&E&&E[r]&&E[r][t]))return!1;if(M){var i=D.getPlaybackQuality();i&&M.push(r,O,i)}if(!j.get().streaming.abr.autoSwitchBitrate[t])return!1;var s=X(t,r),o=Object(d.default)(q).create({abrController:e,switchHistory:P[r][t],droppedFramesHistory:M,streamProcessor:E[r][t],currentValue:s,useBufferOccupancyABR:L[t],useL2AABR:F[t],useLoLPABR:U[t],videoModel:D}),u=W(t,r),l=K(t,r),c=n.getMaxQuality(o),h=c.quality;return void 0!==u&&(h>f.default.NO_CHANGE?h:s)<u&&(h=u),h>l&&(h=l),P[r][t].push({oldValue:s,newValue:h}),h>f.default.NO_CHANGE&&h!==s&&(S[r][t].state===a.default.ALLOW_LOAD||h>s)&&(Q(t,s,h,l,c.reason,r),!0)}catch(e){return!1}},setElementSize:te,setWindowResizeEventCalled:function(e){A=e},registerStreamType:function(e,t){var n=t.getStreamInfo().id;E[n]||(E[n]={}),P[n]||(P[n]={}),S[n]||(S[n]={}),P[n][e]=Object(h.default)(q).create(),E[n][e]=t,S[n][e]={},S[n][e].state=a.default.ALLOW_LOAD,function(e){var t=j.get().streaming.abr.ABRStrategy;t===i.default.ABR_STRATEGY_L2A?(L[e]=!1,U[e]=!1,F[e]=!0):t===i.default.ABR_STRATEGY_LoLP?(L[e]=!1,U[e]=!0,F[e]=!1):t===i.default.ABR_STRATEGY_BOLA?(L[e]=!0,U[e]=!1,F[e]=!1):t===i.default.ABR_STRATEGY_THROUGHPUT?(L[e]=!1,U[e]=!1,F[e]=!1):t===i.default.ABR_STRATEGY_DYNAMIC&&(L[e]=!(!L||!L[e])&&L[e],U[e]=!1,F[e]=!1)}(e),e===i.default.VIDEO&&te()},unRegisterStreamType:function(e,t){try{E[e]&&E[e][t]&&delete E[e][t],P[e]&&P[e][t]&&delete P[e][t],S[e]&&S[e][t]&&delete S[e][t]}catch(e){}},setConfig:function(e){e&&(e.streamController&&(c=e.streamController),e.domStorage&&(N=e.domStorage),e.mediaPlayerModel&&(x=e.mediaPlayerModel),e.dashMetrics&&(B=e.dashMetrics),e.adapter&&(R=e.adapter),e.videoModel&&(D=e.videoModel),e.settings&&(j=e.settings))},reset:function(){V(),G.off(l.default.LOADING_PROGRESS,Y,e),G.off(_.default.QUALITY_CHANGE_RENDERED,z,e),G.off(_.default.METRIC_ADDED,Z,e),n&&n.reset()}},t=H.getLogger(e),V(),e}T.__dashjs_factory_name="AbrController";var b=c.default.getSingletonFactory(T);b.QUALITY_DEFAULT=0,c.default.updateSingletonFactory(T.__dashjs_factory_name,b),t.default=b},"./src/streaming/controllers/BaseURLController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/models/BaseURLTreeModel.js"),i=n("./src/streaming/utils/BaseURLSelector.js"),a=n("./src/streaming/utils/URLUtils.js"),s=n("./src/dash/vo/BaseURL.js"),o=n("./src/core/FactoryMaker.js"),u=n("./src/core/EventBus.js"),l=n("./src/core/events/Events.js");function c(){var e,t,n,o,c=this.context,d=Object(u.default)(c).getInstance(),f=Object(a.default)(c).getInstance();function h(e){n.invalidateSelectedIndexes(e.entry)}return e={reset:function(){n.reset(),o.reset()},initialize:function(e){var r;n.setConfig({adapter:t}),r=e,n.update(r),o.chooseSelector(t.getIsDVB(r))},resolve:function(e){var t=n.getForPath(e).reduce((function(e,t){var n=o.select(t);return n?(f.isRelative(n.url)?e.url=f.resolve(n.url,e.url):(e.url=n.url,e.serviceLocation=n.serviceLocation),e.availabilityTimeOffset=n.availabilityTimeOffset,e.availabilityTimeComplete=n.availabilityTimeComplete,e):new s.default}),new s.default);if(!f.isRelative(t.url))return t},setConfig:function(e){e.baseURLTreeModel&&(n=e.baseURLTreeModel),e.baseURLSelector&&(o=e.baseURLSelector),e.adapter&&(t=e.adapter)}},n=Object(r.default)(c).create(),o=Object(i.default)(c).create(),d.on(l.default.SERVICE_LOCATION_BLACKLIST_CHANGED,h,e),e}c.__dashjs_factory_name="BaseURLController",t.default=o.default.getClassFactory(c)},"./src/streaming/controllers/BlacklistController.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/core/EventBus.js");function a(e){var t;e=e||{};var n=[],r=Object(i.default)(this.context).getInstance(),a=e.updateEventName,s=e.addBlacklistEventName;function o(e){-1===n.indexOf(e)&&(n.push(e),r.trigger(a,{entry:e}))}function u(e){o(e.entry)}return t={add:o,contains:function(e){return!!(n.length&&e&&e.length)&&-1!==n.indexOf(e)},reset:function(){n=[]}},s&&r.on(s,u,t),t}a.__dashjs_factory_name="BlackListController",t.default=r.default.getClassFactory(a)},"./src/streaming/controllers/BufferController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/streaming/constants/MetricsConstants.js"),a=n("./src/streaming/models/FragmentModel.js"),s=n("./src/streaming/SourceBufferSink.js"),o=n("./src/core/EventBus.js"),u=n("./src/core/events/Events.js"),l=n("./src/core/FactoryMaker.js"),c=n("./src/core/Debug.js"),d=n("./src/streaming/utils/InitCache.js"),f=n("./src/streaming/vo/DashJSError.js"),h=n("./src/core/errors/Errors.js"),p=n("./src/streaming/vo/metrics/HTTPRequest.js"),g=n("./src/streaming/MediaPlayerEvents.js"),m=.01,y="BufferController";function v(e){e=e||{};var t,n,l,v,_,T,b,E,S,w,A,I,C,R,D,x,N,O,P=this.context,M=Object(o.default)(P).getInstance(),k=e.errHandler,L=e.fragmentModel,F=e.representationController,U=e.adapter,B=e.textController,j=e.abrController,q=e.playbackController,H=e.streamInfo,G=e.type,V=e.settings;function Y(e){T=e}function z(e){return U.convertRepresentationToRepresentationInfo(F.getRepresentationForQuality(e))}function Z(e){V.get().streaming.cacheInitSegments&&(n.info("Init fragment finished loading saving to",G+"'s init cache"),D.save(e.chunk)),n.debug("Append Init fragment",G," with representationId:",e.chunk.representationId," and quality:",e.chunk.quality,", data size:",e.chunk.bytes.byteLength),W(e.chunk)}function K(e){W(e.chunk,e.request)}function W(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;S.append(e,t).then((function(e){$(e)})).catch((function(e){$(e)})),e.mediaInfo.type===r.default.VIDEO&&_e(u.default.VIDEO_CHUNK_RECEIVED,{chunk:e})}function X(e){if(e&&e.length>0)for(var t=0,r=e.length;t<r;t++)n.debug("Buffered range: "+e.start(t)+" - "+e.end(t)+", currentTime = ",q.getTime())}function $(e){if(e.error)return 22===e.error.code&&function(){if(R=!0,_=.8*ye(),n.warn("Quota exceeded, Critical Buffer: "+_),_>0){var e=Math.max(.2*_,1),t=_-e,r=Math.min(V.get().streaming.buffer.bufferTimeAtTopQuality,.9*t),i=Math.min(V.get().streaming.buffer.bufferTimeAtTopQualityLongForm,.9*t),a={streaming:{buffer:{bufferToKeep:parseFloat(e.toFixed(5)),bufferTimeAtTopQuality:parseFloat(r.toFixed(5)),bufferTimeAtTopQualityLongForm:parseFloat(i.toFixed(5))}}};V.update(a)}}(),void(22!==e.error.code&&ve()||(n.warn("Clearing playback buffer to overcome quota exceed situation"),_e(u.default.QUOTA_EXCEEDED,{criticalBufferLevel:_,quotaExceededTime:e.chunk.start}),le(ue())));if(S&&(ie(),R=!1,(A=e.chunk)&&A.endFragment)){A&&!isNaN(A.index)&&(b=Math.max(A.index,b),ae());var t=S.getAllBufferRanges();A.segmentType===p.HTTPRequest.MEDIA_SEGMENT_TYPE&&(X(t),ee(),function(){if(!isNaN(O))if(G===r.default.AUDIO||G===r.default.VIDEO){var e=q.getTime(),t=re(O,0);if(e===O&&t)O=NaN;else{var n=F.getCurrentRepresentation().segmentDuration;(t=re(O,n))&&(V.get().streaming.buffer.enableSeekDecorrelationFix&&Math.abs(e-O)>n?O<=t.end&&(q.seek(Math.max(O,t.start),!1,!0),O=NaN):e<t.start&&(q.seek(t.start,!1,!0),O=NaN))}}else O=NaN}()),A&&_e(u.default.BYTES_APPENDED_END_FRAGMENT,{quality:A.quality,startTime:A.start,index:A.index,bufferedRanges:t,segmentType:A.segmentType,mediaType:G})}}function Q(){return new Promise((function(e,t){var n=J();if(!n||0===n.length)return ee(),void e();le(n).then((function(){e()})).catch((function(e){t(e)}))}))}function J(e){var t=[],n=S.getAllBufferRanges();if(!n||0===n.length)return t;if(!e&&0!==e||isNaN(e))t.push({start:n.start(0),end:n.end(n.length-1)+.5});else{var r=function(e,t){var n=V.get().streaming.buffer.bufferToKeep,r=t.start(0);if(e-r>n){var i=Math.max(0,e-n),s=L.getRequests({state:a.default.FRAGMENT_MODEL_EXECUTED,time:e,threshold:m})[0];if(s&&(i=Math.min(s.startTime,i)),i>0)return{start:r,end:i}}return null}(e,n),i=function(e,t){var n=t.end(t.length-1)+.5,r=H.manifestInfo.duration>=V.get().streaming.buffer.longFormContentDurationThreshold?V.get().streaming.buffer.bufferTimeAtTopQualityLongForm:V.get().streaming.buffer.bufferTimeAtTopQuality;if(n-e>r){var i=e+r,s=L.getRequests({state:a.default.FRAGMENT_MODEL_EXECUTED,time:e,threshold:m})[0];if(s&&(i=Math.max(s.startTime+s.duration,i)),i<n)return{start:i,end:n}}return null}(e,n);r&&t.push(r),i&&t.push(i)}return t}function ee(){(!N||G===r.default.TEXT&&B.isTextEnabled())&&ie()}function te(){se()}function ne(){se(),O=NaN}function re(e,t){var n,r,i=S.getAllBufferRanges(),a=0,s=0,o=null,u=null,l=0,c=isNaN(t)?.15:t;if(null!=i){for(r=0,n=i.length;r<n;r++)if(a=i.start(r),s=i.end(r),null===o)l=Math.abs(a-e),(e>=a&&e<s||l<=c)&&(o=a,u=s);else{if(!((l=a-u)<=c))break;u=s}if(null!==o)return{start:o,end:u}}return null}function ie(){if(q){var e=V.get().streaming.gaps.jumpGaps&&!isNaN(V.get().streaming.gaps.smallGapLimit)?V.get().streaming.gaps.smallGapLimit:NaN;v=Math.max(function(e,t){var n;return V.get().streaming.gaps.jumpGaps&&(t=V.get().streaming.gaps.smallGapLimit),null===(n=re(e,t))?0:n.end-e}(q.getTime()||0,e),0),_e(u.default.BUFFER_LEVEL_UPDATED,{mediaType:G,bufferLevel:v}),se()}}function ae(){var e=b>=E-1,t=q.getTimeToStreamEnd(H)-v<=0;!e&&!t||l||(me(!0),n.debug("checkIfBufferingCompleted trigger BUFFERING_COMPLETED for stream id ".concat(H.id," and type ").concat(G)))}function se(){G!==r.default.AUDIO&&G!==r.default.VIDEO||((!V.get().streaming.lowLatencyEnabled&&v<V.get().streaming.buffer.stallThreshold||0===v)&&!l?oe(i.default.BUFFER_EMPTY):(l||v>=V.get().streaming.buffer.stallThreshold||V.get().streaming.lowLatencyEnabled&&v>0)&&oe(i.default.BUFFER_LOADED))}function oe(e){w===e||e===i.default.BUFFER_EMPTY&&0===q.getTime()||G===r.default.TEXT&&!B.isTextEnabled()||(w=e,_e(u.default.BUFFER_LEVEL_STATE_CHANGED,{state:e}),_e(e===i.default.BUFFER_LOADED?u.default.BUFFER_LOADED:u.default.BUFFER_EMPTY),n.debug(e===i.default.BUFFER_LOADED?"Got enough buffer to start":"Waiting for more buffer before starting playback"))}function ue(){var e=[],t=S.getAllBufferRanges();if(!t||0===t.length)return e;var n=q.getTime(),r=Math.max(0,n-V.get().streaming.buffer.bufferToKeep),i=L.getRequests({state:a.default.FRAGMENT_MODEL_EXECUTED,time:n,threshold:m})[0];if(i)r=Math.min(i.startTime,r);else if(0===n&&q.getIsDynamic())return[];if(t.start(0)<=r){for(var s={start:0,end:r},o=0;o<t.length&&t.end(o)<=r;o++)s.end=t.end(o);s.start<s.end&&e.push(s)}return e}function le(e){return new Promise((function(t,n){if(e&&S&&0!==e.length){var r=[];e.forEach((function(e){r.push(function(e){return new Promise((function(t,n){e.resolve=t,e.reject=n,x.push(e)}))}(e))})),C||ce(),Promise.all(r).then((function(){t()})).catch((function(e){n(e)}))}else t()}))}function ce(){try{if(0===x.length||!S)return n.debug("Nothing to prune, halt pruning"),x=[],void(C=!1);var e=S.getBuffer();if(!e||!e.buffered||0===e.buffered.length)return n.debug("SourceBuffer is empty (or does not exist), halt pruning"),x=[],void(C=!1);var t=x.shift();n.debug("".concat(G,": Removing buffer from: ").concat(t.start," to ").concat(t.end)),C=!0,q.getTime()<t.end&&me(!1),S.remove(t).then((function(e){de(e)})).catch((function(e){de(e)}))}catch(e){C=!1}}function de(e){n.debug("onRemoved buffer from:",e.from,"to",e.to),X(S.getAllBufferRanges()),0===x.length&&(C=!1,ie()),e.unintended&&(n.warn("Detected unintended removal from:",e.from,"to",e.to,"setting streamprocessor time to",e.from),_e(u.default.SEEK_TARGET,{time:e.from})),C?ce():(N?N=!1:ie(),_e(u.default.BUFFER_CLEARED,{from:e.from,to:e.to,unintended:e.unintended,hasEnoughSpaceToAppend:ve(),quotaExceeded:R}))}function fe(e){return new Promise((function(t){e&&void 0!==e.MSETimeOffset&&S&&S.updateTimestampOffset?S.updateTimestampOffset(e.MSETimeOffset).then((function(){t()})).catch((function(){t()})):t()}))}function he(){return S&&!l?S.updateAppendWindow(H):Promise.resolve()}function pe(){++I*(V.get().streaming.wallclockTimeUpdateInterval/1e3)>=V.get().streaming.buffer.bufferPruningInterval&&(I=0,S&&G!==r.default.TEXT&&(l||le(ue())))}function ge(){se()}function me(e){l!==e&&((l=e)?_e(u.default.BUFFERING_COMPLETED):E=Number.POSITIVE_INFINITY)}function ye(){try{var e,t,n=S.getAllBufferRanges(),r=0;if(!n)return r;for(t=0,e=n.length;t<e;t++)r+=n.end(t)-n.start(t);return r}catch(e){return 0}}function ve(){var e=ye();return isNaN(e)||e<_}function _e(e,t){var n=t||{};M.trigger(e,n,{streamId:H.id,mediaType:G})}function Te(e,t){_=Number.POSITIVE_INFINITY,w=void 0,E=Number.POSITIVE_INFINITY,b=0,A=null,l=!1,C=!1,R=!1,v=0,I=0,x=[],O=NaN,S&&(e||t?S=null:S.abort().then((function(){S.reset(t),S=null}))),N=!1}return t={initialize:function(e){Y(e),M.on(u.default.INIT_FRAGMENT_LOADED,Z,t),M.on(u.default.MEDIA_FRAGMENT_LOADED,K,t),M.on(u.default.WALLCLOCK_TIME_UPDATED,pe,t),M.on(g.default.PLAYBACK_PLAYING,ne,t),M.on(g.default.PLAYBACK_PROGRESS,ee,t),M.on(g.default.PLAYBACK_TIME_UPDATED,ee,t),M.on(g.default.PLAYBACK_RATE_CHANGED,ge,t),M.on(g.default.PLAYBACK_STALLED,te,t)},getStreamId:function(){return H.id},getType:function(){return G},getBufferControllerType:function(){return y},createBufferSink:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return new Promise((function(i,a){if(D&&e&&T){var o=j.getQualityFor(G,H.id);S=Object(s.default)(P).create({mediaSource:T,textController:B,eventBus:M}),function(e,t,n){var i=z(n);return t&&t[G]&&(G===r.default.VIDEO||G===r.default.AUDIO)?S.initializeForStreamSwitch(e,i,t[G]):S.initializeForFirstUse(H,e,i)}(e,t,o).then((function(){return fe(z(o))})).then((function(){i(S)})).catch((function(e){n.fatal("Caught error on create SourceBuffer: "+e),k.error(new f.default(h.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,h.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+G)),a(e)}))}else i(null)}))},getBuffer:function(){return S},getBufferLevel:function(){return v},getRangeAt:re,setMediaSource:Y,getMediaSource:function(){return T},appendInitSegmentFromCache:function(e){var t=D.extract(H.id,e);return!!t&&(n.info("Append Init fragment",G," with representationId:",t.representationId," and quality:",t.quality,", data size:",t.bytes.byteLength),W(t),!0)},getIsBufferingCompleted:function(){return l},setIsBufferingCompleted:me,getIsPruningInProgress:function(){return C},reset:function(e,t){M.off(u.default.INIT_FRAGMENT_LOADED,Z,this),M.off(u.default.MEDIA_FRAGMENT_LOADED,K,this),M.off(u.default.WALLCLOCK_TIME_UPDATED,pe,this),M.off(g.default.PLAYBACK_PLAYING,ne,this),M.off(g.default.PLAYBACK_PROGRESS,ee,this),M.off(g.default.PLAYBACK_TIME_UPDATED,ee,this),M.off(g.default.PLAYBACK_RATE_CHANGED,ge,this),M.off(g.default.PLAYBACK_STALLED,te,this),Te(e,t)},prepareForPlaybackSeek:function(){return l&&me(!1),S.abort()},prepareForReplacementTrackSwitch:function(e){return new Promise((function(t,n){S.abort().then((function(){return he()})).then((function(){return S.changeType(e)})).then((function(){return Q()})).then((function(){me(!1),t()})).catch((function(e){n(e)}))}))},prepareForNonReplacementTrackSwitch:function(e){return new Promise((function(t,n){he().then((function(){return S.changeType(e)})).then((function(){t()})).catch((function(e){n(e)}))}))},prepareForReplacementQualitySwitch:function(){return new Promise((function(e,t){S.abort().then((function(){return he()})).then((function(){return Q()})).then((function(){me(!1),e()})).catch((function(e){t(e)}))}))},updateAppendWindow:he,getAllRangesWithSafetyFactor:J,getContinuousBufferTimeForTargetTime:function(e){try{var t=e,n=S.getAllBufferRanges();if(!n||0===n.length)return e;for(var r=0;t===e&&r<n.length;){var i=n.start(r),a=n.end(r);t>=i&&t<=a&&(t=a),r+=1}return t}catch(e){}},clearBuffers:le,pruneAllSafely:Q,updateBufferTimestampOffset:fe,setSeekTarget:function(e){O=e},segmentRequestingCompleted:function(e){isNaN(e)||(E=e,ae())}},n=Object(c.default)(P).getInstance().getLogger(t),D=Object(d.default)(P).getInstance(),Te(),t}v.__dashjs_factory_name=y,t.default=l.default.getClassFactory(v)},"./src/streaming/controllers/EventController.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/core/Debug.js"),a=n("./src/core/EventBus.js"),s=n("./src/streaming/MediaPlayerEvents.js"),o=n("./src/streaming/net/XHRLoader.js");function u(){var e,t,n,r,u,l,c,d,f,h,p,g="urn:mpeg:dash:event:2012",m=1,y="urn:mpeg:dash:event:callback:2015",v=1,_=300,T={DISCARDED:"discarded",UPDATED:"updated",ADDED:"added"},b=this.context,E=Object(a.default)(b).getInstance();function S(){if(!c||!d)throw new Error("setConfig function has to be called previously")}function w(){p=!1,n={},r={},u=null,h=!1,l=Date.now()/1e3}function A(){try{null!==u&&p&&(clearInterval(u),u=null,p=!1,function(){try{x(r),x(n)}catch(e){}}())}catch(e){throw e}}function I(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.eventStream.schemeIdUri,i=e.eventStream.value,a=e.id,s=T.DISCARDED;t[r]||(t[r]=[]);var o=t[r].findIndex((function(e){return(!i||e.eventStream.value&&e.eventStream.value===i)&&e.id===a}));return-1===o?(t[r].push(e),s=T.ADDED):n&&(t[r][o]=e,s=T.UPDATED),s}function C(e){try{if(e.eventStream.value==m){var t,n=e.calculatedPresentationTime;t=4294967295==e.calculatedPresentationTime?NaN:e.calculatedPresentationTime+e.duration,E.trigger(s.default.MANIFEST_VALIDITY_CHANGED,{id:e.id,validUntil:n,newDuration:t,newManifestValidAfter:NaN},{mode:s.default.EVENT_MODE_ON_START})}}catch(e){}}function R(){try{if(!h){h=!0;var e=d.getTime(),t=e-l;t=l>0?Math.max(0,t):0,D(r,t,e),D(n,t,e),l=e,h=!1}}catch(e){h=!1}}function D(e,n,r){try{N(e,(function(i){if(void 0!==i){var a=isNaN(i.duration)?0:i.duration;i.calculatedPresentationTime<=r&&i.calculatedPresentationTime+n+a>=r?O(i,e,s.default.EVENT_MODE_ON_START):(function(e,t,n){try{return e-t>n}catch(e){return!1}}(r,a+n,i.calculatedPresentationTime)||function(e){try{var t=e.eventStream.period.start+e.eventStream.period.duration;return e.calculatedPresentationTime>t}catch(e){return!1}}(i))&&(t.debug("Deleting event ".concat(i.id," as it is expired or invalid")),P(e,i))}}))}catch(e){}}function x(e){try{var t=d.getTime();N(e,(function(n){var r=n.eventStream&&n.eventStream.period&&!isNaN(n.eventStream.period.duration)?n.eventStream.period.duration:NaN,i=n.eventStream&&n.eventStream.period&&!isNaN(n.eventStream.period.start)?n.eventStream.period.start:NaN;if(!isNaN(r)&&!isNaN(i)){var a=n.calculatedPresentationTime;Math.abs(a-t)<_&&O(n,e,s.default.EVENT_MODE_ON_START)}}))}catch(e){}}function N(e,t){try{if(e)for(var n=Object.keys(e),r=0;r<n.length;r++)e[n[r]].forEach((function(e){void 0!==e&&t(e)}))}catch(e){}}function O(e,n,r){try{var i=d.getTime(),a=e.id;if(r===s.default.EVENT_MODE_ON_RECEIVE)return t.debug("Received event ".concat(a)),void E.trigger(e.eventStream.schemeIdUri,{event:e},{mode:r});e.eventStream.schemeIdUri===g&&e.eventStream.value==m?0===e.duration&&0===e.presentationTimeDelta||(t.debug("Starting manifest refresh event ".concat(a," at ").concat(i)),P(n,e),function(){try{S(),c.refreshManifest()}catch(e){}}()):e.eventStream.schemeIdUri===y&&e.eventStream.value==v?(t.debug("Starting callback event ".concat(a," at ").concat(i)),P(n,e),function(e){try{Object(o.default)(b).create({}).load({method:"get",url:e,request:{responseType:"arraybuffer"}})}catch(e){throw e}}(e.messageData)):(t.debug("Starting event ".concat(a," at ").concat(i)),P(n,e),E.trigger(e.eventStream.schemeIdUri,{event:e},{mode:r}))}catch(e){}}function P(e,t){var n=t.eventStream.schemeIdUri,r=t.eventStream.value,i=t.id;e[n]=e[n].filter((function(e){return r&&e.eventStream.value&&e.eventStream.value!==r||e.id!==i})),0===e[n].length&&delete e[n]}return e={addInlineEvents:function(e){try{if(S(),e)for(var r=0;r<e.length;r++){var i=e[r],a=I(i,n,!0);a===T.ADDED?(t.debug("Added inline event with id ".concat(i.id)),O(i,e,s.default.EVENT_MODE_ON_RECEIVE)):a===T.UPDATED&&t.debug("Updated inline event with id ".concat(i.id))}}catch(e){throw e}},addInbandEvents:function(e){try{S();for(var n=0;n<e.length;n++){var i=e[n];I(i,r,!1)===T.ADDED?(i.eventStream.schemeIdUri===g&&void 0===r[i.id]&&C(i),t.debug("Added inband event with id "+i.id),O(i,e,s.default.EVENT_MODE_ON_RECEIVE)):t.debug("Inband event with scheme_id_uri ".concat(i.eventStream.schemeIdUri,", value ").concat(i.eventStream.value," and id ").concat(i.id," was ignored because it has been added before."))}R()}catch(e){throw e}},getInbandEvents:function(){return r},getInlineEvents:function(){return n},start:function(){try{S(),t.debug("Start Event Controller");var e=f.get().streaming.eventControllerRefreshDelay;p||isNaN(e)||(p=!0,u=setInterval(R,e))}catch(e){throw e}},setConfig:function(e){try{if(!e)return;e.manifestUpdater&&(c=e.manifestUpdater),e.playbackController&&(d=e.playbackController),e.settings&&(f=e.settings)}catch(e){throw e}},reset:function(){A(),w()}},t=Object(i.default)(b).getInstance().getLogger(e),w(),e}u.__dashjs_factory_name="EventController",t.default=r.default.getSingletonFactory(u)},"./src/streaming/controllers/FragmentController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/streaming/vo/DataChunk.js"),a=n("./src/streaming/models/FragmentModel.js"),s=n("./src/streaming/FragmentLoader.js"),o=n("./src/streaming/utils/RequestModifier.js"),u=n("./src/core/EventBus.js"),l=n("./src/core/events/Events.js"),c=n("./src/streaming/MediaPlayerEvents.js"),d=n("./src/core/errors/Errors.js"),f=n("./src/core/FactoryMaker.js"),h=n("./src/core/Debug.js");function p(e){e=e||{};var t,n,f,p=this.context,g=Object(u.default)(p).getInstance(),m=e.errHandler,y=e.mediaPlayerModel,v=e.dashMetrics,_=Object(h.default)(p).getInstance(),T=e.streamInfo;function b(){return T.id}function E(){for(var e in f)f[e].reset();f={}}function S(e){if(e.sender){var t=e.request,a=e.response,s=t.isInitializationRequest(),o=t.mediaInfo.streamInfo;if(e.error&&(t.mediaType===r.default.AUDIO||t.mediaType===r.default.VIDEO||t.mediaType===r.default.TEXT&&t.mediaInfo.isFragmented)&&g.trigger(l.default.SERVICE_LOCATION_BLACKLIST_ADD,{entry:e.request.serviceLocation}),a&&o){var u=function(e,t,n,r){var a=new i.default;return a.streamId=n,a.mediaInfo=t.mediaInfo,a.segmentType=t.type,a.start=t.startTime,a.duration=t.duration,a.end=a.start+a.duration,a.bytes=e,a.index=t.index,a.quality=t.quality,a.representationId=t.representationId,a.endFragment=r,a}(a,t,T.id,e.type!==l.default.FRAGMENT_LOADING_PROGRESS);g.trigger(s?l.default.INIT_FRAGMENT_LOADED:l.default.MEDIA_FRAGMENT_LOADED,{chunk:u,request:t},{streamId:o.id,mediaType:t.mediaType})}else n.warn("No "+t.mediaType+" bytes to push or stream is inactive.")}}return t={getStreamId:b,getModel:function(t){var n=f[t];return n||(n=Object(a.default)(p).create({streamInfo:T,type:t,dashMetrics:v,fragmentLoader:Object(s.default)(p).create({dashMetrics:v,mediaPlayerModel:y,errHandler:m,requestModifier:Object(o.default)(p).getInstance(),settings:e.settings,boxParser:e.boxParser,eventBus:g,events:l.default,errors:d.default,dashConstants:e.dashConstants,urlUtils:e.urlUtils,streamId:b()}),debug:_,eventBus:g,events:l.default}),f[t]=n),n},reset:function(){g.off(c.default.FRAGMENT_LOADING_COMPLETED,S,this),g.off(c.default.FRAGMENT_LOADING_PROGRESS,S,this),E()}},n=_.getLogger(t),E(),g.on(c.default.FRAGMENT_LOADING_COMPLETED,S,t),g.on(c.default.FRAGMENT_LOADING_PROGRESS,S,t),t}p.__dashjs_factory_name="FragmentController",t.default=f.default.getClassFactory(p)},"./src/streaming/controllers/GapController.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/core/Debug.js"),a=n("./src/core/events/Events.js"),s=n("./src/core/EventBus.js");function o(){var e,t,n,r,o,u,l,c,d,f,h,p,g=this.context,m=Object(s.default)(g).getInstance();function y(){p.debug("Stopping the gap controller"),o&&(clearInterval(o),o=null),function(){m.off(a.default.WALLCLOCK_TIME_UPDATED,E,this),m.off(a.default.INITIAL_STREAM_SWITCH,b,this),m.off(a.default.PLAYBACK_SEEKING,v,this),m.off(a.default.BUFFER_REPLACEMENT_STARTED,_,e),m.off(a.default.TRACK_CHANGE_RENDERED,T,e)}(),o=null,u=NaN,r=0,f=null,h={}}function v(){f&&(clearTimeout(f),f=null)}function _(e){try{if(e.streamId!==c.getActiveStreamInfo().id||!e.mediaType)return;e.streamId===c.getActiveStreamInfo().id&&(h[e.mediaType]=!0)}catch(e){p.error(e)}}function T(e){e&&e.mediaType&&(h[e.mediaType]=!1)}function b(){o||function(){try{o||(p.debug("Starting the gap controller"),o=setInterval((function(){S()&&w(l.getTime())}),100))}catch(e){}}()}function E(){if(S(n.get().streaming.gaps.enableSeekFix)&&++r>=10){var e=l.getTime();t===e?w(e,!0):(t=e,u=NaN),r=0}}function S(){var e,t,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=Object.keys(h).some((function(e){return h[e]})),a=!!r&&(e=c.getActiveStream(),t=parseFloat((e.getStartTime()+e.getDuration()).toFixed(5)),l.getTime()+n.get().streaming.gaps.threshold>=t);return!i&&n.get().streaming.gaps.jumpGaps&&c.getActiveStreamProcessors().length>0&&(!l.isSeeking()||a)&&!l.isPaused()&&!c.getIsStreamSwitchInProgress()&&!c.getHasMediaOrInitialisationError()}function w(e){var t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=n.get().streaming.gaps.smallGapLimit,a=n.get().streaming.gaps.jumpLargeGaps,s=d.getBufferRange(),o=NaN,h=!1;if(t=function(e,t){try{if(!e||e.length<=1&&t>0)return NaN;for(var r=NaN,i=0;isNaN(r)&&i<e.length;){var a=i>0?e.end(i-1):0;t<e.start(i)&&a-t<n.get().streaming.gaps.threshold&&(r=i),i+=1}return r}catch(e){return null}}(s,e),!isNaN(t)){var g=s.start(t),m=g-e;m>0&&(m<=i||a)&&(o=g)}var y=l.getTimeToStreamEnd();if(isNaN(o)&&r&&isFinite(y)&&!isNaN(y)&&y<i&&(o=parseFloat(l.getStreamEndTime().toFixed(5)),h=!0),o>0&&u!==o&&o>e&&!f){var v=o-e;if(h){var _=c.getStreamForTime(o),T=_&&!!_.getPreloaded();p.warn("Jumping to end of stream because of gap from ".concat(e," to ").concat(o,". Gap duration: ").concat(v)),l.seek(o,!0,T)}else{var b=l.getIsDynamic(),E=t>0?s.end(t-1):e,S=b?1e3*Math.max(0,v-.1):0;f=window.setTimeout((function(){l.seek(o,!0,!0),p.warn("Jumping gap occuring in period ".concat(c.getActiveStream().getStreamId()," starting at ").concat(E," and ending at ").concat(o,". Jumping by: ").concat(v-S/1e3)),f=null}),S)}u=o}}return e={reset:y,setConfig:function(e){e&&(e.settings&&(n=e.settings),e.playbackController&&(l=e.playbackController),e.streamController&&(c=e.streamController),e.videoModel&&(d=e.videoModel))},initialize:function(){!function(){m.on(a.default.WALLCLOCK_TIME_UPDATED,E,this),m.on(a.default.INITIAL_STREAM_SWITCH,b,this),m.on(a.default.PLAYBACK_SEEKING,v,this),m.on(a.default.BUFFER_REPLACEMENT_STARTED,_,e),m.on(a.default.TRACK_CHANGE_RENDERED,T,e)}()}},p=Object(i.default)(g).getInstance().getLogger(e),y(),e}o.__dashjs_factory_name="GapController",t.default=r.default.getSingletonFactory(o)},"./src/streaming/controllers/MediaController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/core/events/Events.js"),a=n("./src/core/EventBus.js"),s=n("./src/core/FactoryMaker.js"),o=n("./src/core/Debug.js");function u(){var e,t,n,s,u,l,c,d,f=this.context,h=Object(a.default)(f).getInstance();function p(e,t){return e&&n[t]&&n[t][e]?n[t][e].list:[]}function g(e,t){return e&&n[t]&&n[t][e]?n[t][e].current:null}function m(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e&&e.streamInfo){var a=e.type,o=e.streamInfo.id,u=g(a,o);if(n[o]&&n[o][a]&&!_(e,u)&&(n[o][a].current=e,n[o][a].current&&(a!==r.default.TEXT||a===r.default.TEXT&&e.isFragmented)&&h.trigger(i.default.CURRENT_TRACK_CHANGED,{oldMediaInfo:u,newMediaInfo:e,switchMode:s.get().streaming.trackSwitchMode[a]},{streamId:o}),!t)){var d=function(e){var t={lang:e.lang,viewpoint:e.viewpoint,roles:e.roles,accessibility:e.accessibility,audioChannelConfiguration:e.audioChannelConfiguration};return t.lang||t.viewpoint||t.role&&t.role.length>0||t.accessibility&&t.accessibility.length>0||t.audioChannelConfiguration&&t.audioChannelConfiguration.length>0?t:null}(e);if(!d||!n[o][a].storeLastSettings)return;d.roles&&(d.role=d.roles[0],delete d.roles),d.accessibility&&(d.accessibility=d.accessibility[0]),d.audioChannelConfiguration&&(d.audioChannelConfiguration=d.audioChannelConfiguration[0]),l[a]=d,c.setSavedMediaSettings(a,d)}}}function y(e,t){e&&t&&(u[e]=t)}function v(e){return e?u[e]:null}function _(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;var n=e.id===t.id,r=e.viewpoint===t.viewpoint,i=e.lang===t.lang,a=e.codec===t.codec,s=e.roles.toString()===t.roles.toString(),o=e.accessibility.toString()===t.accessibility.toString(),u=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString();return n&&a&&r&&i&&s&&o&&u}function T(){n={},l={},d=null,u={audio:null,video:null,text:null}}function b(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=!e.lang||t.lang.match(e.lang),a=void 0===e.index||null===e.index||t.index===e.index,s=!e.viewpoint||e.viewpoint===t.viewpoint,o=!e.role||!!t.roles.filter((function(t){return t===e.role}))[0],u=!e.accessibility||!!t.accessibility.filter((function(t){return t===e.accessibility}))[0],l=!e.audioChannelConfiguration||!!t.audioChannelConfiguration.filter((function(t){return t===e.audioChannelConfiguration}))[0];return i&&a&&s&&(o||t.type===r.default.AUDIO&&n)&&u&&l}function E(e){var t,n=0,r=[];return e.forEach((function(e){(t=Math.max.apply(Math,e.bitrateList.map((function(e){return e.bandwidth}))))>n?(n=t,r=[e]):t===n&&r.push(e)})),r}function S(e){var t,n=1/0,r=[];return e.forEach((function(e){var i=e.bitrateList.reduce((function(e,t){var n=Math.max(1,t.width*t.height);return e+t.bandwidth/n}),0);(t=i/e.bitrateList.length)<n?(n=t,r=[e]):t===n&&r.push(e)})),r}function w(e){var t,n=0,r=[];return e.forEach((function(e){(t=e.representationCount)>n?(n=t,r=[e]):t===n&&r.push(e)})),r}function A(e,n){if(e===r.default.TEXT)return n[0];var i,a=s.get().streaming.selectionModeForInitialTrack;if(d&&"function"==typeof d)i=d(n);else switch(a){case r.default.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY:i=function(e){var t,n,r=(t=0,n=[],e.forEach((function(e){isNaN(e.selectionPriority)||(e.selectionPriority>t?(t=e.selectionPriority,n=[e]):e.selectionPriority===t&&n.push(e))})),n);return r.length>1&&(r=E(r)),r.length>1&&(r=w(r)),r}(n);break;case r.default.TRACK_SELECTION_MODE_HIGHEST_BITRATE:i=function(e){var t=E(e);return t.length>1&&(t=w(t)),t}(n);break;case r.default.TRACK_SELECTION_MODE_FIRST_TRACK:i=I(n);break;case r.default.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:i=function(e){var t=S(e);return t.length>1&&(t=E(t)),t}(n);break;case r.default.TRACK_SELECTION_MODE_WIDEST_RANGE:i=function(e){var t=w(e);return t.length>1&&(t=E(e)),t}(n);break;default:t.warn("Track selection mode ".concat(a," is not supported. Falling back to TRACK_SELECTION_MODE_FIRST_TRACK")),i=I(n)}return i.length>0?i[0]:n[0]}function I(e){return e[0]}return e={setInitialMediaSettingsForType:function(e,t){var n=l[e]||v(e),r=p(e,t.id),i=[];n||(n=c.getSavedMediaSettings(e),y(e,n)),r&&0!==r.length&&(n&&r.forEach((function(t){b(n,t,!!l[e])&&i.push(t)})),0===i.length?m(A(e,r),!0):i.length>1?m(A(e,i,l[e])):m(i[0]))},addTrack:function(e){if(e){var t=e.type;if((i=t)===r.default.AUDIO||i===r.default.VIDEO||i===r.default.TEXT||i===r.default.IMAGE){var i,a=e.streamInfo.id;n[a]||(n[a]={audio:{list:[],storeLastSettings:!0,current:null},video:{list:[],storeLastSettings:!0,current:null},text:{list:[],storeLastSettings:!0,current:null},image:{list:[],storeLastSettings:!0,current:null}});for(var s=n[a][t].list,o=0,u=s.length;o<u;++o)if(_(s[o],e))return;s.push(e)}}},getTracksFor:p,getCurrentTrackFor:g,isCurrentTrack:function(e){if(!e)return!1;var t=e.type,r=e.streamInfo.id;return n[r]&&n[r][t]&&_(n[r][t].current,e)},setTrack:m,selectInitialTrack:A,setCustomInitialTrackSelectionFunction:function(e){d=e},setInitialSettings:y,getInitialSettings:v,getTracksWithHighestBitrate:E,getTracksWithHighestEfficiency:S,getTracksWithWidestRange:w,isTracksEqual:_,matchSettings:b,saveTextSettingsDisabled:function(){c.setSavedMediaSettings(r.default.TEXT,null)},setConfig:function(e){e&&(e.domStorage&&(c=e.domStorage),e.settings&&(s=e.settings))},reset:T},t=Object(o.default)(f).getInstance().getLogger(e),T(),e}u.__dashjs_factory_name="MediaController";var l=s.default.getSingletonFactory(u);s.default.updateSingletonFactory(u.__dashjs_factory_name,l),t.default=l},"./src/streaming/controllers/MediaSourceController.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/core/Debug.js");function a(){var e,t,n,r=this.context;return e={createMediaSource:function(){var e="WebKitMediaSource"in window;return"MediaSource"in window?t=new MediaSource:e&&(t=new WebKitMediaSource),t},attachMediaSource:function(e){var n=window.URL.createObjectURL(t);return e.setSource(n),n},detachMediaSource:function(e){e.setSource(null)},setDuration:function e(r){t&&"open"===t.readyState&&(null===r&&isNaN(r)||t.duration!==r&&(function(e){for(var t=e.sourceBuffers,n=0;n<t.length;n++)if(t[n].updating)return!0;return!1}(t)?setTimeout(e.bind(null,r),50):(n.info("Set MediaSource duration:"+r),t.duration=r)))},setSeekable:function(e,n){t&&"function"==typeof t.setLiveSeekableRange&&"function"==typeof t.clearLiveSeekableRange&&"open"===t.readyState&&e>=0&&e<n&&(t.clearLiveSeekableRange(),t.setLiveSeekableRange(e,n))},signalEndOfStream:function(e){if(e&&"open"===e.readyState){for(var t=e.sourceBuffers,r=0;r<t.length;r++){if(t[r].updating)return;if(0===t[r].buffered.length)return}n.info("call to mediaSource endOfStream"),e.endOfStream()}}},n=Object(i.default)(r).getInstance().getLogger(e),e}a.__dashjs_factory_name="MediaSourceController",t.default=r.default.getSingletonFactory(a)},"./src/streaming/controllers/PlaybackController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/streaming/constants/MetricsConstants.js"),a=n("./src/core/EventBus.js"),s=n("./src/core/events/Events.js"),o=n("./src/core/FactoryMaker.js"),u=n("./src/core/Debug.js"),l=n("./src/streaming/MediaPlayerEvents.js");function c(){var e,t,n,o,c,d,f,h,p,g,m,y,v,_,T,b,E,S,w,A,I,C,R=this.context,D=Object(a.default)(R).getInstance();function x(){return parseFloat((N(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)-F()).toFixed(5))}function N(e){var t=e||g;return t.start+t.duration}function O(){g&&d&&d.getElement()?d.play():v=!0}function P(){return g&&d?d.isPaused():null}function M(){g&&d&&d.pause()}function k(){return g&&d?d.isSeeking():null}function L(e,n,r){g&&d&&e!==(isNaN(b)?d.getTime():b)&&((E=!0===r)||(b=e,D.trigger(s.default.PLAYBACK_SEEK_ASKED)),t.info("Requesting seek to time: "+e+(E?" (internal)":"")),d.setCurrentTime(e,n))}function F(){return g&&d?d.getTime():null}function U(){var e=F();if(m&&!isNaN(T)){var t=T/1e3;e>t&&(e-=t)}return e}function B(){return g&&d?d.getPlaybackRate():null}function j(){return g&&d?d.getEnded():null}function q(){return m}function H(){if(!m||isNaN(T))return NaN;var e=U();if(isNaN(e)||0===e)return 0;var t=(new Date).getTime()+1e3*f.getClientTimeOffset();return Math.max(((t-T-1e3*e)/1e3).toFixed(3),0)}function G(){M(),v=!1,p=0,T=0,I=!1,b=NaN,d&&(D.off(s.default.DATA_UPDATE_COMPLETED,Z,e),D.off(s.default.LOADING_PROGRESS,ge,e),D.off(s.default.MANIFEST_UPDATED,Te,e),D.off(s.default.STREAMS_COMPOSED,be,e),D.off(l.default.BUFFER_LEVEL_STATE_CHANGED,me,e),D.off(l.default.PLAYBACK_PROGRESS,ce,e),D.off(l.default.PLAYBACK_TIME_UPDATED,ce,e),D.off(l.default.PLAYBACK_ENDED,ue,e),D.off(l.default.STREAM_INITIALIZING,ve,e),D.off(l.default.REPRESENTATION_SWITCH,_e,e),d.setPlaybackRate(1,!0),Y(),d.removeEventListener("canplay",K),d.removeEventListener("canplaythrough",W),d.removeEventListener("play",X),d.removeEventListener("waiting",$),d.removeEventListener("playing",Q),d.removeEventListener("pause",J),d.removeEventListener("error",le),d.removeEventListener("seeking",ee),d.removeEventListener("seeked",te),d.removeEventListener("timeupdate",ne),d.removeEventListener("progress",re),d.removeEventListener("ratechange",ie),d.removeEventListener("loadedmetadata",ae),d.removeEventListener("loadeddata",se),d.removeEventListener("stalled",ye),d.removeEventListener("ended",oe)),h=null,d=null,g=null,m=null}function V(){null===h&&(h=setInterval((function(){var e;D.trigger(s.default.WALLCLOCK_TIME_UPDATED,{isDynamic:m,time:new Date}),q()&&(n.addDVRMetric(),P()?(e=Date.now(),(!_||e>_+500)&&(_=e,ne())):z())}),C.get().streaming.wallclockTimeUpdateInterval))}function Y(){clearInterval(h),h=null}function z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!P()&&m&&0!==d.getReadyState()&&!k()&&!I){e||(e=n.hasVideoTrack()?r.default.VIDEO:r.default.AUDIO);var i=U(),a=function(e,t){var n=o.getCurrentDVRInfo(t),r=n?n.range:null;return r?e>r.end?Math.max(r.end-p,r.start):e>0&&e+.25<r.start&&Math.abs(e-r.start)<31536e4?C.get().streaming.lowLatencyEnabled?Math.max(r.end-p,r.start):r.start:e:NaN}(i,e);!isNaN(a)&&a!==i&&!k()&&(g&&d&&d.isStalled()||w||1===d.getReadyState())&&(t.debug("UpdateCurrentTime: Seek to actual time: ".concat(a," from currentTime: ").concat(i)),L(a))}}function Z(e){var t=c.convertRepresentationToRepresentationInfo(e.currentRepresentation),n=t?t.mediaInfo.streamInfo:null;null!==n&&g.id===n.id&&(g=n)}function K(){D.trigger(s.default.CAN_PLAY)}function W(){D.trigger(s.default.CAN_PLAY_THROUGH)}function X(){t.info("Native video element event: play"),z(),V(),D.trigger(s.default.PLAYBACK_STARTED,{startTime:F()})}function $(){t.info("Native video element event: waiting"),D.trigger(s.default.PLAYBACK_WAITING,{playingTime:F()})}function Q(){t.info("Native video element event: playing"),D.trigger(s.default.PLAYBACK_PLAYING,{playingTime:F()})}function J(){t.info("Native video element event: pause"),D.trigger(s.default.PLAYBACK_PAUSED,{ended:j()})}function ee(){if(E)E=!1;else{var e=F();isNaN(b)||b===e||(e=b),b=NaN,t.info("Seeking to: "+e),V(),D.trigger(s.default.PLAYBACK_SEEKING,{seekTime:e,streamId:g.id})}}function te(){t.info("Native video element event: seeked"),D.trigger(s.default.PLAYBACK_SEEKED)}function ne(){g&&D.trigger(s.default.PLAYBACK_TIME_UPDATED,{timeToEnd:x(),time:F(),streamId:g.id})}function re(){D.trigger(s.default.PLAYBACK_PROGRESS,{streamId:g.id})}function ie(){var e=B();t.info("Native video element event: ratechange: ",e),D.trigger(s.default.PLAYBACK_RATE_CHANGED,{playbackRate:e})}function ae(){t.info("Native video element event: loadedmetadata"),D.trigger(s.default.PLAYBACK_METADATA_LOADED),V()}function se(){t.info("Native video element event: loadeddata"),D.trigger(s.default.PLAYBACK_LOADED_DATA)}function oe(){t.info("Native video element event: ended"),M(),Y();var e=n?n.getActiveStreamInfo():null;e&&D.trigger(s.default.PLAYBACK_ENDED,{isLast:e.isLast})}function ue(e){if(h&&e.isLast){t.info("onPlaybackEnded -- PLAYBACK_ENDED but native video element didn't fire ended");var n=e.seekTime?e.seekTime:N();d.setCurrentTime(n),M(),Y()}}function le(e){var t=e.target||e.srcElement;D.trigger(s.default.PLAYBACK_ERROR,{error:t.error})}function ce(){m&&de()&&C.get().streaming.liveCatchup.playbackRate>0&&!P()&&!k()&&(function(){try{if(de()&&C.get().streaming.liveCatchup.playbackRate>0&&F()>0){var e=he(),t=H(),n=y.getLiveDelay(),i=y.getLiveCatchupLatencyThreshold(),a=C.get().streaming.liveCatchup.minDrift;return e===r.default.LIVE_CATCHUP_MODE_LOLP?function(e,t,n,r,i,a){try{var s=Math.abs(e-t);return(isNaN(a)||e<=a)&&(s>n||r<i)}catch(e){return!1}}(t,n,a,fe(),C.get().streaming.liveCatchup.playbackBufferMin,i):function(e,t,n,r){try{return Math.abs(e-t)>r&&(isNaN(n)||e<=n)}catch(e){return!1}}(t,n,i,a)}}catch(e){return!1}}()?function(){if(d){var e,i=d.getPlaybackRate(),a=C.get().streaming.liveCatchup.playbackRate,s=H(),u=y.getLiveDelay(),l=fe();he()===r.default.LIVE_CATCHUP_MODE_LOLP?(C.get().streaming.liveCatchup.minDrift,e=function(e,n,r,i,a,s,o){var u,l=e;if(s<a){var c=5*(s-a);u=1-l+2*l/(1+Math.pow(Math.E,-c)),t.debug("[LoL+ playback control_buffer-based] bufferLevel: "+s+", newRate: "+u)}else{var d=.02;if(Math.abs(n-r)<=d*r)u=1;else{var f=5*(n-r);u=1-l+2*l/(1+Math.pow(Math.E,-f))}t.debug("[LoL+ playback control_latency-based] latency: "+n+", newRate: "+u)}return w&&s>r/2&&(w=!1),Math.abs(o-u)<=A&&(u=null),{newRate:u}}(a,s,u,0,C.get().streaming.liveCatchup.playbackBufferMin,l,i)):e=function(e,t,n,r,i){var a=t-n,s=5*a,o=1-e+2*e/(1+Math.pow(Math.E,-s));return w&&(r>n/2?w=!1:a>0&&(o=1)),Math.abs(i-o)<=A&&(o=null),{newRate:o}}(a,s,u,l,i);var c=e.newRate;c&&d.setPlaybackRate(c);var f=s-u;C.get().streaming.liveCatchup.maxDrift>0&&!S&&f>C.get().streaming.liveCatchup.maxDrift?(t.info("Low Latency catchup mechanism. Latency too high, doing a seek to live point"),S=!0,h=n&&n.hasVideoTrack()?r.default.VIDEO:r.default.AUDIO,(g=(p=o.getCurrentDVRInfo(h))?p.range:null)&&!isNaN(g.end)&&L(g.end-y.getLiveDelay(),!0,!1)):S=!1}var h,p,g}():pe())}function de(){return C.get().streaming.liveCatchup.enabled||C.get().streaming.lowLatencyEnabled}function fe(){var e=null;return n.getActiveStreamProcessors().forEach((function(t){var n=t.getBufferLevel();e=null===e?n:Math.min(e,n)})),e}function he(){var e=C.get().streaming.liveCatchup.playbackBufferMin;return C.get().streaming.liveCatchup.mode!==r.default.LIVE_CATCHUP_MODE_LOLP||null===e||isNaN(e)?r.default.LIVE_CATCHUP_MODE_DEFAULT:r.default.LIVE_CATCHUP_MODE_LOLP}function pe(){d&&d.setPlaybackRate(1)}function ge(e){if(!1===e.stream&&C.get().streaming.lowLatencyEnabled&&!isNaN(e.request.duration)){var n=1.2*e.request.duration;n>y.getLiveDelay()&&(t.warn("Browser does not support fetch API with StreamReader. Increasing live delay to be 20% higher than segment duration:",n.toFixed(2)),C.update({streaming:{delay:{liveDelay:n}}}))}}function me(e){e.streamId===g.id&&(de()?e.state!==i.default.BUFFER_EMPTY||k()||w||(w=!0,pe()):C.get().streaming.buffer.setStallState&&d.setStallState(e.mediaType,e.state===i.default.BUFFER_EMPTY))}function ye(e){D.trigger(s.default.PLAYBACK_STALLED,{e})}function ve(e){var n;(n=e.mediaInfo)&&n.supplementalProperties&&"true"===n.supplementalProperties[r.default.SUPPLEMENTAL_PROPERTY_LL_SCHEME]&&(t.debug("Low Latency critical SupplementalProperty set: Enabling low Latency"),C.update({streaming:{lowLatencyEnabled:!0}}))}function _e(e){var t=n.getActiveStreamInfo();if(C.get().streaming.lowLatencyEnabledByManifest&&e&&t&&e.currentRepresentation&&e.streamId&&e.streamId===t.id&&e.mediaType&&(e.mediaType===r.default.VIDEO||e.mediaType===r.default.AUDIO)){var i=!e.currentRepresentation.availabilityTimeComplete;i&&C.update({streaming:{lowLatencyEnabled:i}})}}function Te(){I=!0}function be(){I=!1}return e={initialize:function(t,n){g=t,!0!==n&&function(){d.addEventListener("canplay",K),d.addEventListener("canplaythrough",W),d.addEventListener("play",X),d.addEventListener("waiting",$),d.addEventListener("playing",Q),d.addEventListener("pause",J),d.addEventListener("error",le),d.addEventListener("seeking",ee),d.addEventListener("seeked",te),d.addEventListener("timeupdate",ne),d.addEventListener("progress",re),d.addEventListener("ratechange",ie),d.addEventListener("loadedmetadata",ae),d.addEventListener("loadeddata",se),d.addEventListener("stalled",ye),d.addEventListener("ended",oe),m=g.manifestInfo.isDynamic,S=!1,w=!1,E=!1;var t="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",n=/safari/.test(t)&&!/chrome/.test(t);A=n?.25:.02,D.on(s.default.DATA_UPDATE_COMPLETED,Z,e),D.on(s.default.LOADING_PROGRESS,ge,e),D.on(s.default.MANIFEST_UPDATED,Te,e),D.on(s.default.STREAMS_COMPOSED,be,e),D.on(l.default.BUFFER_LEVEL_STATE_CHANGED,me,e),D.on(l.default.PLAYBACK_PROGRESS,ce,e),D.on(l.default.PLAYBACK_TIME_UPDATED,ce,e),D.on(l.default.PLAYBACK_ENDED,ue,e,{priority:a.default.EVENT_PRIORITY_HIGH}),D.on(l.default.STREAM_INITIALIZING,ve,e),D.on(l.default.REPRESENTATION_SWITCH,_e,e),v&&(v=!1,O())}()},setConfig:function(e){e&&(e.streamController&&(n=e.streamController),e.dashMetrics&&(o=e.dashMetrics),e.mediaPlayerModel&&(y=e.mediaPlayerModel),e.adapter&&(c=e.adapter),e.videoModel&&(d=e.videoModel),e.timelineConverter&&(f=e.timelineConverter),e.settings&&(C=e.settings))},getTimeToStreamEnd:x,getBufferLevel:fe,getTime:F,getNormalizedTime:U,getIsManifestUpdateInProgress:function(){return I},getPlaybackRate:B,getPlayedRanges:function(){return g&&d?d.getPlayedRanges():null},getEnded:j,getIsDynamic:q,getStreamController:function(){return n},computeAndSetLiveDelay:function(e,n){var i,a,s,o=!isNaN(e)&&isFinite(e)?e:NaN,u=c.getSuggestedPresentationDelay();if(C.get().streaming.delay.applyServiceDescription&&isNaN(C.get().streaming.delay.liveDelay)&&isNaN(C.get().streaming.delay.liveDelayFragmentCount)&&function(e){if(e&&e.serviceDescriptions){for(var n=null,i=0;i<e.serviceDescriptions.length;i++){var a=e.serviceDescriptions[i];if(a.schemeIdUri===r.default.SERVICE_DESCRIPTION_LL_SCHEME){n=a;break}}n&&(n.latency&&n.latency.target>0&&(t.debug("Apply LL properties coming from service description. Target Latency (ms):",n.latency.target),C.update({streaming:{delay:{liveDelay:n.latency.target/1e3},liveCatchup:{minDrift:(n.latency.target+500)/1e3,maxDrift:n.latency.max>n.latency.target?(n.latency.max-n.latency.target+500)/1e3:void 0}}})),n.playbackRate&&n.playbackRate.max>1&&(t.debug("Apply LL properties coming from service description. Max PlaybackRate:",n.playbackRate.max),C.update({streaming:{liveCatchup:{playbackRate:n.playbackRate.max-1}}})))}}(n),i=y.getLiveDelay()?y.getLiveDelay():null===C.get().streaming.delay.liveDelayFragmentCount||isNaN(C.get().streaming.delay.liveDelayFragmentCount)||isNaN(o)?!0===C.get().streaming.delay.useSuggestedPresentationDelay&&null!==u&&!isNaN(u)&&u>0?u:isNaN(o)?n&&!isNaN(n.minBufferTime)?4*n.minBufferTime:4*g.manifestInfo.minBufferTime:4*o:o*C.get().streaming.delay.liveDelayFragmentCount,null!==(s=c.getAvailabilityStartTime())&&(T=s),n&&n.dvrWindowSize>0){var l=Math.max(n.dvrWindowSize-10,n.dvrWindowSize/2);a=Math.min(i,l)}else a=i;return p=a,a},getLiveDelay:function(){return p},getCurrentLiveLatency:H,play:O,isPaused:P,pause:M,isSeeking:k,getStreamEndTime:N,seek:L,reset:G,updateCurrentTime:z,getAvailabilityStartTime:function(){return T}},t=Object(u.default)(R).getInstance().getLogger(e),G(),e}c.__dashjs_factory_name="PlaybackController",t.default=o.default.getSingletonFactory(c)},"./src/streaming/controllers/ScheduleController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/streaming/models/FragmentModel.js"),a=n("./src/core/EventBus.js"),s=n("./src/core/events/Events.js"),o=n("./src/core/FactoryMaker.js"),u=n("./src/core/Debug.js"),l=n("./src/streaming/constants/MetricsConstants.js"),c=n("./src/streaming/MediaPlayerEvents.js");function d(e){e=e||{};var t,n,o,d,f,h,p,g,m,y,v,_,T,b=this.context,E=Object(a.default)(b).getInstance(),S=e.dashMetrics,w=e.mediaPlayerModel,A=e.fragmentModel,I=e.abrController,C=e.playbackController,R=e.textController,D=e.type,x=e.bufferController,N=e.settings;function O(e){if(!x.getIsBufferingCompleted()){P();var t=isNaN(e)?0:e;h=setTimeout(M,t)}}function P(){h&&(clearTimeout(h),h=null)}function M(){try{if(function(){try{return D===r.default.TEXT&&!R.isTextEnabled()||C.isPaused()&&(!C.getStreamController().getInitialPlayback()||!C.getStreamController().getAutoPlay())&&!N.get().streaming.scheduling.scheduleWhilePaused}catch(e){return!1}}())return void P();if(function(){try{return d&&(isNaN(y)||v||(e=n.id,t=I.getMaxAllowedIndexFor(D,e),!(!isNaN(m)&&m==t||(o.info("Top quality "+D+" index has changed from "+m+" to "+t),m=t,0)))||!D||!d||S.getCurrentBufferLevel(D)<k())}catch(e){return!1}var e,t}()){var e=!1;T&&(e=I.checkPlaybackQuality(D,n.id)),e||(_||d.quality!==y||v?(v?(o.debug("Switch track for "+D+", representation id = "+d.id),v=!1):o.debug("Quality has changed, get init request for representationid = "+d.id),E.trigger(s.default.INIT_FRAGMENT_NEEDED,{representationId:d.id,sender:t},{streamId:n.id,mediaType:D}),T=!1,_=!1):(o.debug("Media segment needed for ".concat(D," and stream id ").concat(n.id)),E.trigger(s.default.MEDIA_FRAGMENT_NEEDED,{},{streamId:n.id,mediaType:D}),T=!0))}else O(N.get().streaming.lowLatencyEnabled?N.get().streaming.scheduling.lowLatencyTimeout:N.get().streaming.scheduling.defaultTimeout)}catch(e){O(N.get().streaming.lowLatencyEnabled?N.get().streaming.scheduling.lowLatencyTimeout:N.get().streaming.scheduling.defaultTimeout)}}function k(){var e=NaN;return D&&d?e=D===r.default.TEXT?function(){try{if(R.isTextEnabled()){if(isNaN(d.fragmentDuration)){var e=S.getCurrentSchedulingInfo(l.default.SCHEDULING_INFO);return e?e.duration:0}return d.fragmentDuration}return 0}catch(e){return 0}}():D===r.default.AUDIO&&p?function(){try{var e=S.getCurrentBufferLevel(r.default.VIDEO);return isNaN(d.fragmentDuration)?e+1:Math.max(e+1,d.fragmentDuration)}catch(e){return 0}}():function(){try{var e=d.mediaInfo.streamInfo;return I.isPlayingAtTopQuality(e)?e.manifestInfo.duration>=N.get().streaming.buffer.longFormContentDurationThreshold?N.get().streaming.buffer.bufferTimeAtTopQualityLongForm:N.get().streaming.buffer.bufferTimeAtTopQuality:w.getStableBufferTime()}catch(e){return w.getStableBufferTime()}}():e}function L(){F(!0)}function F(e){if(C&&A){var t=A.getRequests({state:i.default.FRAGMENT_MODEL_EXECUTED,time:C.getTime(),threshold:0})[0];t&&C.getTime()>=t.startTime&&((!g.mediaInfo||t.mediaInfo.type===g.mediaInfo.type&&t.mediaInfo.id!==g.mediaInfo.id)&&e&&E.trigger(s.default.TRACK_CHANGE_RENDERED,{mediaType:D,oldMediaInfo:g.mediaInfo,newMediaInfo:t.mediaInfo,streamId:n.id}),t.quality===g.quality&&t.adaptationIndex===g.adaptationIndex||!e||(o.debug("Quality change rendered for streamId ".concat(n.id," and type ").concat(D)),E.trigger(s.default.QUALITY_CHANGE_RENDERED,{mediaType:D,oldQuality:g.quality,newQuality:t.quality,streamId:n.id})),g={mediaInfo:t.mediaInfo,quality:t.quality,adaptationIndex:t.adaptationIndex})}}function U(e){o.debug("Appended bytes for ".concat(e.mediaType," and stream id ").concat(n.id)),(isNaN(e.index)||isNaN(y))&&(y=e.quality,o.info("["+D+"] lastInitializedRepresentationInfo changed to "+e.quality)),O(0)}function B(){A.abortRequests(),P()}function j(){N.get().streaming.scheduling.scheduleWhilePaused||O()}function q(e){S.updatePlayListTraceMetrics({playbackspeed:e.playbackRate.toString()})}function H(){T=!0,f=0,y=NaN,g={mediaInfo:void 0,quality:NaN,adaptationIndex:NaN},m=NaN,v=!1,_=!1}return t={initialize:function(e){p=e,E.on(s.default.BYTES_APPENDED_END_FRAGMENT,U,t),E.on(s.default.URL_RESOLUTION_FAILED,B,t),E.on(c.default.PLAYBACK_STARTED,j,t),E.on(c.default.PLAYBACK_RATE_CHANGED,q,t),E.on(c.default.PLAYBACK_TIME_UPDATED,L,t)},getType:function(){return D},getStreamId:function(){return n.id},setCurrentRepresentation:function(e){d=e},setTimeToLoadDelay:function(e){f=e},getTimeToLoadDelay:function(){return f},setSwitchTrack:function(e){v=e},getSwitchStrack:function(){return v},startScheduleTimer:O,clearScheduleTimer:P,reset:function(){E.off(s.default.BYTES_APPENDED_END_FRAGMENT,U,t),E.off(s.default.URL_RESOLUTION_FAILED,B,t),E.off(c.default.PLAYBACK_STARTED,j,t),E.off(c.default.PLAYBACK_RATE_CHANGED,q,t),E.off(c.default.PLAYBACK_TIME_UPDATED,L,t),P(),F(!1),H(),n=null},getBufferTarget:k,getPlaybackController:function(){return C},setCheckPlaybackQuality:function(e){T=e},setInitSegmentRequired:function(e){_=e}},o=Object(u.default)(b).getInstance().getLogger(t),H(),n=e.streamInfo,t}d.__dashjs_factory_name="ScheduleController",t.default=o.default.getClassFactory(d)},"./src/streaming/controllers/StreamController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/streaming/constants/MetricsConstants.js"),a=n("./src/streaming/Stream.js"),s=n("./src/streaming/ManifestUpdater.js"),o=n("./src/core/EventBus.js"),u=n("./src/core/events/Events.js"),l=n("./src/core/FactoryMaker.js"),c=n("./src/streaming/vo/metrics/PlayList.js"),d=n("./src/core/Debug.js"),f=n("./src/streaming/utils/InitCache.js"),h=n("./src/streaming/utils/URLUtils.js"),p=n("./src/streaming/MediaPlayerEvents.js"),g=n("./src/streaming/controllers/TimeSyncController.js"),m=n("./src/streaming/controllers/MediaSourceController.js"),y=n("./src/streaming/vo/DashJSError.js"),v=n("./src/core/errors/Errors.js"),_=n("./src/streaming/controllers/EventController.js"),T=n("./src/streaming/constants/ConformanceViolationConstants.js");function b(e){return function(e){if(Array.isArray(e))return E(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function S(){var e,t,n,l,E,S,w,A,I,C,R,D,x,N,O,P,M,k,L,F,U,B,j,q,H,G,V,Y,z,Z,K,W,X,$,Q,J,ee,te,ne,re,ie,ae,se,oe,ue=this.context,le=Object(o.default)(ue).getInstance();function ce(){!function(){try{var e=A.getStreamsInfo();if(!j&&0===e.length)throw new Error("There are no streams");j&&I.updateManifestUpdateInfo({currentTime:X.getTime(),buffered:W.getBufferRange(),presentationStartTime:e[0].start,clientTimeOffset:U.getClientTimeOffset()}),B.length>0&&function(e){B=B.filter((function(n){var r=e.filter((function(e){return e.id===n.getId()})).length>0||n.getId()===j.getId();return r||(t.debug("Removing stream ".concat(n.getId())),n.reset(!0)),r}))}(e);for(var n=[],r=0,i=e.length;r<i;r++){var a=e[r];n.push(fe(a)),I.addManifestUpdateStreamInfo(a)}Promise.all(n).then((function(){j||he(e),le.trigger(u.default.STREAMS_COMPOSED),Ne()})).catch((function(e){throw e}))}catch(e){F.error(new y.default(v.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,e.message+"nostreamscomposed",w.getValue())),Z=!0,Ke()}}()}function de(){ae=!0}function fe(e){var t=Ve(e.id);return t?t.updateData(e):(t=Object(a.default)(ue).create({manifestModel:w,mediaPlayerModel:$,dashMetrics:I,manifestUpdater:E,adapter:A,timelineConverter:U,capabilities:n,capabilitiesFilter:l,errHandler:F,baseURLController:D,segmentBaseController:x,textController:H,abrController:O,playbackController:X,eventController:M,mediaController:P,protectionController:q,videoModel:W,streamInfo:e,settings:ie}),B.push(t),t.initialize(),Promise.resolve())}function he(e){we();var n=I.getCurrentDVRInfo().range;if(n.end<n.start){se&&clearTimeout(se);var i=Math.min(1e3*(-1*(n.end-n.start)+2),2147483647);return t.debug("Waiting for ".concat(i," ms before playback can start")),le.trigger(u.default.AST_IN_FUTURE,{delay:i}),void(se=setTimeout((function(){he(e)}),i))}if(A.getIsDynamic()&&B.length){var a=e[0].manifestInfo,s=function(e,t){try{var n=NaN;if(t&&!isNaN(t.maxFragmentDuration)&&isFinite(t.maxFragmentDuration))return t.maxFragmentDuration;if(e&&1===e.length){var i=e[0],a=[r.default.VIDEO,r.default.AUDIO,r.default.TEXT].reduce((function(e,t){var n=A.getMediaInfoForType(i,t);return n&&!1!==n.isFragmented&&e.push(n),e}),[]).reduce((function(e,t){var n=A.getVoRepresentations(t);return n&&n.length>0&&n.forEach((function(t){t&&e.push(t)})),e}),[]).reduce((function(e,t){var n=A.convertRepresentationToRepresentationInfo(t);return n&&n.fragmentDuration&&!isNaN(n.fragmentDuration)&&e.push(n.fragmentDuration),e}),[]);n=Math.max.apply(Math,b(a))}return isFinite(n)?n:NaN}catch(e){return NaN}}(e,a);X.computeAndSetLiveDelay(s,a)}var o=function(){var e;if(A.getIsDynamic()){var n=I.getCurrentDVRInfo();e=(n&&n.range?n.range.end:0)-X.getLiveDelay();var r=n?n.range:null;if(r){var i=Le(!0);isNaN(i)||(t.info("Start time from URI parameters: "+i),e=Math.max(Math.min(e,i),r.start))}}else{e=Xe()[0].getStreamInfo().start;var a=Le(!1);isNaN(a)||(t.info("Start time from URI parameters: "+a),e=Math.max(e,a))}return e}(),l=Se(o),c=null!==l?l:B[0];le.trigger(u.default.INITIAL_STREAM_SWITCH,{startTime:o}),pe(c,null,o),ee||(ee=setInterval((function(){!Y&&X.getTimeToStreamEnd()<=0&&!X.isSeeking()&&le.trigger(u.default.PLAYBACK_ENDED,{isLast:Ge().isLast})}),200))}function pe(e,n,r){try{if(Y||!e||n===e&&e.getIsActive())return;Y=!0,le.trigger(u.default.PERIOD_SWITCH_STARTED,{fromStreamInfo:n?n.getStreamInfo():null,toStreamInfo:e.getStreamInfo()});var i=!1;j=e,n&&(i=be(e,n),n.deactivate(i)),r=isNaN(r)?!i&&n?e.getStreamInfo().start:NaN:r,t.info("Switch to stream ".concat(e.getId(),". Seektime is ").concat(r,", current playback time is ").concat(X.getTime(),". Seamless period switch is set to ").concat(i)),ne=ne.filter((function(e){return e.getId()!==j.getId()})),X.initialize(Ge(),!!n),W.getElement()&&ge(r,i)}catch(e){Y=!1}}function ge(e,n){var r;function i(){if(K&&"open"===K.readyState){t.debug("MediaSource is open!"),window.URL.revokeObjectURL(r),K.removeEventListener("sourceopen",i),K.removeEventListener("webkitsourceopen",i),ke();var a=I.getCurrentDVRInfo();C.setSeekable(a.range.start,a.range.end),me(e,n)}}function a(){K.addEventListener("sourceopen",i,!1),K.addEventListener("webkitsourceopen",i,!1),r=C.attachMediaSource(W),t.debug("MediaSource attached to element. Waiting on open...")}K?n?me(e,n):(C.detachMediaSource(W),a()):(K=C.createMediaSource(),a())}function me(e,t){j.activate(K,t?te:void 0,e).then((function(t){if(t){var n=Object.keys(t);n.length>0&&t[n[0]].getBuffer().changeType&&(re=!0),te=t}isNaN(e)||(le.trigger(u.default.SEEK_TARGET,{time:e},{streamId:j.getId()}),X.seek(e,!1,!0),j.startScheduleControllers()),Y=!1,le.trigger(u.default.PERIOD_SWITCH_COMPLETED,{toStreamInfo:Ge()})}))}function ye(e){var t=X.getTime(),n=e.seekTime,r=Se(n);r&&r!==j?r&&r!==j&&(ve(t,n,r),function(e,t){var n=e&&!isNaN(e.seekTime)?e.seekTime:NaN,r=j.getProcessors().map((function(t){return t.prepareOuterPeriodPlaybackSeeking(e)}));Promise.all(r).then((function(){pe(t,j,n)})).catch((function(e){F.error(e)}))}(e,r)):(ve(t,n),function(e){j.getProcessors().forEach((function(t){return t.prepareInnerPeriodPlaybackSeeking(e)})),je(c.PlayListTrace.USER_REQUEST_STOP_REASON)}(e)),qe(c.PlayList.SEEK_START_REASON)}function ve(e,t){_e()}function _e(){ne&&ne.length>0&&(ne.forEach((function(e){e.deactivate(!0)})),ne=[])}function Te(e){e.newMediaInfo.streamInfo.id===j.getId()&&(_e(),j.prepareTrackChange(e))}function be(e,t){try{return ie.get().streaming.buffer.reuseExistingSourceBuffers&&(t.isProtectionCompatible(e)||ae)&&(re||t.isMediaCodecCompatible(e,t))}catch(e){return!1}}function Ee(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;K&&!e.getPreloaded()&&be(e,t)&&e.startPreloading(K,te).then((function(){ne.push(e)}))}function Se(e){if(isNaN(e))return null;for(var t=B.length,n=0;n<t;n++){var r=B[n];if(e<parseFloat((r.getStartTime()+r.getDuration()).toFixed(5)))return r}return null}function we(){try{var e=A.getIsDynamic(),t=A.getStreamsInfo()[0].manifestInfo,n=X.getTime(),i=U.calcTimeShiftBufferWindow(B,e),a=Pe();if(void 0===i.start||void 0===i.end)return;a&&0!==a.length?a.forEach((function(e){I.addDVRInfo(e.getType(),n,t,i)})):I.addDVRInfo(r.default.VIDEO,n,t,i)}catch(e){}}function Ae(e){if(J&&V){var t=$.getInitialBufferLevel();(isNaN(t)||t<=X.getBufferLevel()||A.getIsDynamic()&&t>X.getLiveDelay())&&(J=!1,qe(c.PlayList.INITIAL_PLAYOUT_START_REASON),X.play())}e&&e.mediaType&&I.addBufferLevel(e.mediaType,new Date,1e3*e.bufferLevel)}function Ie(e){e.streamInfo.id===j.getId()&&e.reason&&e.reason.forceReplace&&_e(),Ve(e.streamInfo.id).prepareQualityChange(e)}function Ce(){if(Ue()){var e=W.getPlaybackQuality();e&&I.addDroppedFrames(e)}}function Re(){t.debug("[onPlaybackStarted]"),!J&&Q&&qe(c.PlayList.RESUME_FROM_PAUSE_START_REASON),J&&(J=!1),Q=!1}function De(e){t.debug("[onPlaybackPaused]"),e.ended||(Q=!0,je(c.PlayListTrace.USER_REQUEST_STOP_REASON))}function xe(e){t.debug("Stream with id ".concat(e.streamInfo.id," finished buffering"));var n=e.streamInfo.isLast;K&&n?(t.info("[onStreamBufferingCompleted] calls signalEndOfStream of mediaSourceController."),C.signalEndOfStream(K)):Ne()}function Ne(){if(j&&j.getHasFinishedBuffering())for(var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{var t=e||j||null;if(t){var n=t.getStreamInfo();return B.filter((function(e){var t=e.getStreamInfo();return t.start>n.start&&n.id!==t.id}))}}catch(e){return[]}}(j),t=0;t<e.length;){var n=e[t],r=0===t?j:e[t-1];!n.getPreloaded()&&r.getHasFinishedBuffering()&&K&&Ee(n,r),t+=1}}function Oe(){ee&&(clearInterval(ee),ee=null)}function Pe(){return j?j.getProcessors():[]}function Me(e){if(j&&!j.getIsEndedEventSignaled()){j.setIsEndedEventSignaled(!0);var n=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||j||null;if(!e)return null;for(var t=e.getStreamInfo(),n=t.start,r=0,i=-1,a=NaN;r<B.length;){var s=B[r].getStreamInfo(),o=s.start-n;o>0&&(isNaN(a)||o<a)&&t.id!==s.id&&(a=o,i=r),r+=1}return i>=0?B[i]:null}();n?(t.debug("StreamController onEnded, found next stream with id ".concat(n.getStreamInfo().id,". Switching from ").concat(j.getStreamInfo().id," to ").concat(n.getStreamInfo().id)),pe(n,j,NaN)):(t.debug("StreamController no next stream found"),j.setIsEndedEventSignaled(!1)),je(n?c.PlayListTrace.END_OF_PERIOD_STOP_REASON:c.PlayListTrace.END_OF_CONTENT_STOP_REASON)}e&&e.isLast&&Oe()}function ke(e){var t=e||Ge().manifestInfo.duration;C.setDuration(t)}function Le(e){var t=N.getURIFragmentData();if(!t||!t.t)return NaN;var n=Xe()[0].getStreamInfo().start;t.t=t.t.split(",")[0];var r=-1!==t.t.indexOf("posix:")?"now"===t.t.substring(6)?Date.now()/1e3:parseInt(t.t.substring(6)):NaN;return e&&!isNaN(r)?r-X.getAvailabilityStartTime()/1e3:parseInt(t.t)+n}function Fe(e){if(e.error)Z=!0,Ke();else{t.info("Manifest updated... updating data system wide.");var n=e.manifest;A.updatePeriods(n);var r=A.getUTCTimingSources();!A.getIsDynamic()||r&&0!==r.length||le.trigger(p.default.CONFORMANCE_VIOLATION,{level:T.default.LEVELS.WARNING,event:T.default.EVENTS.NO_UTC_TIMING_ELEMENT});var i=A.getIsDynamic()?r.concat($.getUTCTimingSources()):r,a=L.isHTTPS(e.manifest.url);i.forEach((function(e){e.value.replace(/.*?:\/\//g,"")===$.getDefaultUtcTimingSource().value.replace(/.*?:\/\//g,"")&&(e.value=e.value.replace(a?new RegExp(/^(http:)?\/\//i):new RegExp(/^(https:)?\/\//i),a?"https://":"http://"),t.debug("Matching default timing source protocol to manifest protocol: ",e.value))})),l.filterUnsupportedFeatures(n).then((function(){D.initialize(n),R.attemptSync(i,A.getIsDynamic())}))}}function Ue(){return!!j&&j.getHasVideoTrack()}function Be(){return!!j&&j.getHasAudioTrack()}function je(e,t){t=t||new Date,Pe().forEach((function(n){n.finalisePlayList(t,e)})),I.addPlayList()}function qe(e){I.createPlaylistMetrics(1e3*X.getTime(),e)}function He(e){if(e.error){var n="";switch(e.error.code){case 1:n="MEDIA_ERR_ABORTED";break;case 2:n="MEDIA_ERR_NETWORK";break;case 3:n="MEDIA_ERR_DECODE",oe.counts.mediaErrorDecode+=1;break;case 4:n="MEDIA_ERR_SRC_NOT_SUPPORTED";break;case 5:n="MEDIA_ERR_ENCRYPTED";break;default:n="UNKNOWN"}"MEDIA_ERR_DECODE"===n&&ie.get().errors.recoverAttempts.mediaErrorDecode>=oe.counts.mediaErrorDecode?function(){t.warn("A MEDIA_ERR_DECODE occured: Resetting the MediaSource");var e=X.getTime();j.deactivate(!1),t.warn("MediaSource has been resetted. Resuming playback from time ".concat(e)),ge(e,!1)}():(z=!0,e.error.message&&(n+=" ("+e.error.message+")"),e.error.msExtendedCode&&(n+=" (0x"+(e.error.msExtendedCode>>>0).toString(16).toUpperCase()+")"),t.fatal("Video Element Error: "+n),e.error&&t.fatal(e.error),F.error(new y.default(e.error.code,n)),Ke())}}function Ge(){return j?j.getStreamInfo():null}function Ve(e){for(var t=0,n=B.length;t<n;t++)if(B[t].getId()===e)return B[t];return null}function Ye(){if(!(S&&S.hasOwnProperty("load")&&U&&U.hasOwnProperty("initialize")&&U.hasOwnProperty("reset")&&U.hasOwnProperty("getClientTimeOffset")&&w&&F&&I&&X))throw new Error(r.default.MISSING_CONFIG_ERROR)}function ze(e){isNaN(e.newDuration)||ke(e.newDuration)}function Ze(){B=[],q=null,Y=!1,j=null,z=!1,Z=!1,J=!0,Q=!1,V=!0,ee=null,ae=!1,re=!1,ne=[],se=null,oe={counts:{mediaErrorDecode:0}}}function Ke(){Ye(),R.reset(),je(z||Z?c.PlayListTrace.FAILURE_STOP_REASON:c.PlayListTrace.USER_REQUEST_STOP_REASON);for(var t=0,n=B?B.length:0;t<n;t++)B[t].reset(z);le.off(p.default.PLAYBACK_TIME_UPDATED,Ce,e),le.off(p.default.PLAYBACK_SEEKING,ye,e),le.off(p.default.PLAYBACK_ERROR,He,e),le.off(p.default.PLAYBACK_STARTED,Re,e),le.off(p.default.PLAYBACK_PAUSED,De,e),le.off(p.default.PLAYBACK_ENDED,Me,e),le.off(p.default.METRIC_ADDED,We,e),le.off(p.default.MANIFEST_VALIDITY_CHANGED,ze,e),le.off(p.default.BUFFER_LEVEL_UPDATED,Ae,e),le.off(p.default.QUALITY_CHANGE_REQUESTED,Ie,e),u.default.KEY_SESSION_UPDATED&&le.off(u.default.KEY_SESSION_UPDATED,de,e),le.off(u.default.MANIFEST_UPDATED,Fe,e),le.off(u.default.STREAM_BUFFERING_COMPLETED,xe,e),le.off(u.default.TIME_SYNCHRONIZATION_COMPLETED,ce,e),le.off(u.default.CURRENT_TRACK_CHANGED,Te,e),D.reset(),E.reset(),M.reset(),I.clearAllCurrentMetrics(),w.setValue(null),S.reset(),U.reset(),k.reset(),K&&(C.detachMediaSource(W),K=null),W=null,q&&(q=null,G=null,w.getValue()&&le.trigger(u.default.PROTECTION_DESTROYED,{data:w.getValue().url})),Oe(),le.trigger(u.default.STREAM_TEARDOWN_COMPLETE),Ze()}function We(e){if(e.metric===i.default.DVR_INFO){var t=Be()?r.default.AUDIO:r.default.VIDEO;e.mediaType===t&&C.setSeekable(e.value.range.start,e.value.range.end)}}function Xe(){return B}return e={initialize:function(t,n){Ye(),V=t,G=n,U.initialize(),(E=Object(s.default)(ue).create()).setConfig({manifestModel:w,adapter:A,manifestLoader:S,errHandler:F,settings:ie}),E.initialize(),(M=Object(_.default)(ue).getInstance()).setConfig({manifestUpdater:E,playbackController:X,settings:ie}),M.start(),R.setConfig({dashMetrics:I,baseURLController:D,errHandler:F,settings:ie}),R.initialize(),q&&(le.trigger(u.default.PROTECTION_CREATED,{controller:q}),q.setMediaElement(W.getElement()),G&&q.setProtectionData(G)),le.on(p.default.PLAYBACK_TIME_UPDATED,Ce,e),le.on(p.default.PLAYBACK_SEEKING,ye,e),le.on(p.default.PLAYBACK_ERROR,He,e),le.on(p.default.PLAYBACK_STARTED,Re,e),le.on(p.default.PLAYBACK_PAUSED,De,e),le.on(p.default.PLAYBACK_ENDED,Me,e),le.on(p.default.METRIC_ADDED,We,e),le.on(p.default.MANIFEST_VALIDITY_CHANGED,ze,e),le.on(p.default.BUFFER_LEVEL_UPDATED,Ae,e),le.on(p.default.QUALITY_CHANGE_REQUESTED,Ie,e),u.default.KEY_SESSION_UPDATED&&le.on(u.default.KEY_SESSION_UPDATED,de,e),le.on(u.default.MANIFEST_UPDATED,Fe,e),le.on(u.default.STREAM_BUFFERING_COMPLETED,xe,e),le.on(u.default.TIME_SYNCHRONIZATION_COMPLETED,ce,e),le.on(u.default.CURRENT_TRACK_CHANGED,Te,e)},getActiveStreamInfo:Ge,addDVRMetric:we,hasVideoTrack:Ue,hasAudioTrack:Be,getStreamById:Ve,getStreamForTime:Se,getTimeRelativeToStreamId:function(e,t){for(var n=null,r=0,i=0,a=null,s=0;s<B.length;s++){if(i=(n=B[s]).getStartTime(),a=n.getDuration(),Number.isFinite(i)&&(r=i),n.getId()===t)return e-r;Number.isFinite(a)&&(r+=a)}return null},load:function(e){Ye(),S.load(e)},loadWithManifest:function(e){!function(){if(!E||!E.hasOwnProperty("setManifest"))throw new Error("initialize function has to be called previously")}(),E.setManifest(e)},getActiveStreamProcessors:Pe,setConfig:function(e){e&&(e.capabilities&&(n=e.capabilities),e.capabilitiesFilter&&(l=e.capabilitiesFilter),e.manifestLoader&&(S=e.manifestLoader),e.manifestModel&&(w=e.manifestModel),e.mediaPlayerModel&&($=e.mediaPlayerModel),e.protectionController&&(q=e.protectionController),e.adapter&&(A=e.adapter),e.dashMetrics&&(I=e.dashMetrics),e.errHandler&&(F=e.errHandler),e.timelineConverter&&(U=e.timelineConverter),e.videoModel&&(W=e.videoModel),e.playbackController&&(X=e.playbackController),e.textController&&(H=e.textController),e.abrController&&(O=e.abrController),e.mediaController&&(P=e.mediaController),e.settings&&(ie=e.settings),e.baseURLController&&(D=e.baseURLController),e.uriFragmentModel&&(N=e.uriFragmentModel),e.segmentBaseController&&(x=e.segmentBaseController))},setProtectionData:function(e){G=e,q&&q.setProtectionData(G)},getIsStreamSwitchInProgress:function(){return Y},switchToVideoElement:function(e){j&&(X.initialize(Ge()),ge(e,!1))},getHasMediaOrInitialisationError:function(){return z||Z},getStreams:Xe,getActiveStream:function(){return j},getInitialPlayback:function(){return J},getAutoPlay:function(){return V},reset:Ke},t=Object(d.default)(ue).getInstance().getLogger(e),R=Object(g.default)(ue).getInstance(),C=Object(m.default)(ue).getInstance(),k=Object(f.default)(ue).getInstance(),L=Object(h.default)(ue).getInstance(),Ze(),e}S.__dashjs_factory_name="StreamController",t.default=l.default.getSingletonFactory(S)},"./src/streaming/controllers/TimeSyncController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/vo/DashJSError.js"),i=n("./src/streaming/vo/metrics/HTTPRequest.js"),a=n("./src/core/EventBus.js"),s=n("./src/core/events/Events.js"),o=n("./src/core/errors/Errors.js"),u=n("./src/core/FactoryMaker.js"),l=n("./src/core/Debug.js"),c=n("./src/streaming/utils/URLUtils.js");function d(){var e,t,n,u,d,f,h,p,g,m,y,v,_,T,b,E,S=this.context,w=Object(a.default)(S).getInstance(),A=Object(c.default)(S).getInstance();function I(){p=[],g=[],m=null,y=null,_=null,v=NaN,n=!1,u=!1,T=d.get().streaming.utcSynchronization.timeBetweenSyncAttempts}function C(){d.get().streaming.utcSynchronization.enabled&&!n&&!u&&_&&_.value&&_.schemeIdUri&&!isNaN(v)&&!isNaN(d.get().streaming.utcSynchronization.backgroundAttempts)&&(y&&(Date.now()-y)/1e3<30||(p=[],u=!0,R(isNaN(d.get().streaming.utcSynchronization.backgroundAttempts)?2:d.get().streaming.utcSynchronization.backgroundAttempts)))}function R(e){try{if(e<=0)return void j();var t=Date.now();f[_.schemeIdUri](_.value,(function(n){var r=Date.now(),i=x(t,r,n);p.push(i),R(e-1)}),(function(){j()}))}catch(e){j()}}function D(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||0;if(!g||0===g.length||e>=g.length)N();else{var t=g[e];if(t)if(f.hasOwnProperty(t.schemeIdUri)){var n=(new Date).getTime();f[t.schemeIdUri](t.value,(function(e){var r=(new Date).getTime(),i=x(n,r,e);_=t,N(i)}),(function(){D(e+1)}))}else D(e+1);else N()}}function x(e,t,n){return n-(t-(t-e)/2)}function N(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:NaN,r=isNaN(n);r&&d.get().streaming.utcSynchronization.useManifestDateHeaderTimeSource?(t=null!==(e=h.getLatestMPDRequestHeaderValueByID("Date"))?new Date(e).getTime():Number.NaN,isNaN(t)?B(!0):B(!1,t-Date.now())):B(r,n)}function O(e){var t=Date.parse(e);return isNaN(t)&&(t=function(e){var t,n,r=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+\-])([0-9]{2})([0-9]{2}))?/.exec(e);return t=Date.UTC(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10),parseInt(r[4],10),parseInt(r[5],10),r[6]&&(parseInt(r[6],10)||0),r[7]&&1e3*parseFloat(r[7])||0),r[9]&&r[10]&&(n=60*parseInt(r[9],10)+parseInt(r[10],10),t+=("+"===r[8]?-1:1)*n*60*1e3),new Date(t).getTime()}(e)),t}function P(e){return Date.parse(e)}function M(e){return Date.parse(e)}function k(e,t,n){n()}function L(e,t,n){var r=O(e);isNaN(r)?n():t(r)}function F(e,t,n,r,a){var s,o,u=!1,l=new XMLHttpRequest,c=a?i.HTTPRequest.HEAD:i.HTTPRequest.GET,d=t.match(/\S+/g);if(t=d.shift(),s=function(){u||(u=!0,d.length?F(e,d.join(" "),n,r,a):r())},o=function(){var t,r;200===l.status&&(t=a?l.getResponseHeader("Date"):l.response,r=e(t),isNaN(r)||(n(r),u=!0))},A.isRelative(t)){var f=E.resolve();f&&(t=A.resolve(t,f.url))}l.open(c,t),l.timeout=5e3,l.onload=o,l.onloadend=s,l.send()}function U(e,t,n){F(M,e,t,n,!0)}function B(e,i){if(isNaN(v)||isNaN(i)||e||function(e){try{var n,r=q(e),i=isNaN(T)?30:T,a=isNaN(d.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor)?2:d.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor,s=isNaN(d.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts)?600:d.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts,o=isNaN(d.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts)?2:d.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts;r?(n=Math.min(i*a,s),t.debug("Increasing timeBetweenSyncAttempts to ".concat(n))):(n=Math.max(i/a,o),t.debug("Decreasing timeBetweenSyncAttempts to ".concat(n))),T=n}catch(e){}}(i),!e&&!isNaN(i)){m=Date.now(),n=!1;var a=isNaN(v);v=i,a&&C(),t.debug("Completed UTC sync. Setting client - server offset to ".concat(i))}e&&(_=null,n=!1,b.error(new r.default(o.default.TIME_SYNC_FAILED_ERROR_CODE,o.default.TIME_SYNC_FAILED_ERROR_MESSAGE))),w.trigger(s.default.UPDATE_TIME_SYNC_OFFSET,{offset:i}),w.trigger(s.default.TIME_SYNCHRONIZATION_COMPLETED)}function j(){if(p&&0!==p.length){var e=p.reduce((function(e,t){return e+t}),0)/p.length;q(e)?t.debug("Completed background UTC sync. Offset is within allowed threshold and is not adjusted."):(t.debug("Completed background UTC sync. Setting client - server offset to ".concat(e)),v=e,w.trigger(s.default.UPDATE_TIME_SYNC_OFFSET,{offset:v})),u=!1,y=Date.now()}}function q(e){try{if(isNaN(v))return!0;var t=d.get().streaming.utcSynchronization.maximumAllowedDrift&&!isNaN(d.get().streaming.utcSynchronization.maximumAllowedDrift)?d.get().streaming.utcSynchronization.maximumAllowedDrift:100;return e>=v-t&&e<=v+t}catch(e){return!0}}return e={initialize:function(){I(),f={"urn:mpeg:dash:utc:http-head:2014":U,"urn:mpeg:dash:utc:http-xsdate:2014":F.bind(null,O),"urn:mpeg:dash:utc:http-iso:2014":F.bind(null,P),"urn:mpeg:dash:utc:direct:2014":L,"urn:mpeg:dash:utc:http-head:2012":U,"urn:mpeg:dash:utc:http-xsdate:2012":F.bind(null,O),"urn:mpeg:dash:utc:http-iso:2012":F.bind(null,P),"urn:mpeg:dash:utc:direct:2012":L,"urn:mpeg:dash:utc:http-ntp:2014":k,"urn:mpeg:dash:utc:ntp:2014":k,"urn:mpeg:dash:utc:sntp:2014":k}},attemptSync:function(e,t){g=e,n||(function(e){try{if(!e||!d.get().streaming.utcSynchronization.enabled)return!1;var t=isNaN(T)?30:T;return!(m&&t&&!isNaN(t))||(Date.now()-m)/1e3>=t}catch(e){return!0}}(t)?(n=!0,D()):w.trigger(s.default.TIME_SYNCHRONIZATION_COMPLETED))},setConfig:function(e){e&&(e.dashMetrics&&(h=e.dashMetrics),e.baseURLController&&(E=e.baseURLController),e.errHandler&&(b=e.errHandler),e.settings&&(d=e.settings))},reset:function(){I(),w.off(s.default.ATTEMPT_BACKGROUND_SYNC,C,e)}},t=Object(l.default)(S).getInstance().getLogger(e),w.on(s.default.ATTEMPT_BACKGROUND_SYNC,C,e),e}d.__dashjs_factory_name="TimeSyncController";var f=u.default.getSingletonFactory(d);f.HTTP_TIMEOUT_MS=5e3,u.default.updateSingletonFactory(d.__dashjs_factory_name,f),t.default=f},"./src/streaming/controllers/XlinkController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/XlinkLoader.js"),i=n("./src/core/EventBus.js"),a=n("./src/core/events/Events.js"),s=n("./src/core/FactoryMaker.js"),o=n("./externals/xml2json.js"),u=n("./src/streaming/utils/URLUtils.js"),l=n("./src/dash/constants/DashConstants.js"),c="onLoad";function d(e){e=e||{};var t,n,s,d,f,h,p=this.context,g=Object(i.default)(p).getInstance(),m=Object(u.default)(p).getInstance();function y(e,t,n){var r,i,a={};a.elements=e,a.type=t,a.resolveType=n,0===a.elements.length&&_(a);for(var s=0;s<a.elements.length;s++)r=a.elements[s],i=m.isHTTPURL(r.url)?r.url:r.originalContent.BaseURL+r.url,h.load(i,r,a)}function v(e){var t,n,r="";if(t=e.element,n=e.resolveObject,t.resolvedContent){var i=0;0===t.resolvedContent.indexOf("<?xml")&&(i=t.resolvedContent.indexOf("?>")+2),r=t.resolvedContent.substr(0,i)+"<response>"+t.resolvedContent.substr(i)+"</response>",t.resolvedContent=f.xml_str2json(r)}(function(e){var t;for(t=0;t<e.elements.length;t++)if(!1===e.elements[t].resolved)return!1;return!0})(n)&&_(n)}function _(e){var t,n,r=[];if(function(e){var t,n,r,i,a,o,u=[];for(i=e.elements.length-1;i>=0;i--){if(n=(t=e.elements[i]).type+"_asArray",t.resolvedContent){if(t.resolvedContent)for(a=0;a<t.resolvedContent[n].length;a++)r=t.resolvedContent[n][a],u.push(r)}else delete t.originalContent["xlink:actuate"],delete t.originalContent["xlink:href"],u.push(t.originalContent);for(t.parentElement[n].splice(t.index,1),o=0;o<u.length;o++)t.parentElement[n].splice(t.index+o,0,u[o]);u=[]}e.elements.length>0&&s.run(d)}(e),"onActuate"===e.resolveType&&g.trigger(a.default.XLINK_READY,{manifest:d}),e.resolveType===c)switch(e.type){case l.default.PERIOD:for(t=0;t<d[l.default.PERIOD+"_asArray"].length;t++)(n=d[l.default.PERIOD+"_asArray"][t]).hasOwnProperty(l.default.ADAPTATION_SET+"_asArray")&&(r=r.concat(T(n[l.default.ADAPTATION_SET+"_asArray"],n,l.default.ADAPTATION_SET,c))),n.hasOwnProperty(l.default.EVENT_STREAM+"_asArray")&&(r=r.concat(T(n[l.default.EVENT_STREAM+"_asArray"],n,l.default.EVENT_STREAM,c)));y(r,l.default.ADAPTATION_SET,c);break;case l.default.ADAPTATION_SET:g.trigger(a.default.XLINK_READY,{manifest:d})}}function T(e,t,n,r){var i,a,s,o=[];for(a=e.length-1;a>=0;a--)(i=e[a]).hasOwnProperty("xlink:href")&&"urn:mpeg:dash:resolve-to-zero:2013"===i["xlink:href"]&&e.splice(a,1);for(a=0;a<e.length;a++)(i=e[a]).hasOwnProperty("xlink:href")&&i.hasOwnProperty("xlink:actuate")&&i["xlink:actuate"]===r&&(s=b(i["xlink:href"],t,n,a,r,i),o.push(s));return o}function b(e,t,n,r,i,a){return{url:e,parentElement:t,type:n,index:r,resolveType:i,originalContent:a,resolvedContent:null,resolved:!1}}return t={resolveManifestOnLoad:function(e){f=new o.default({escapeMode:!1,attributePrefix:"",arrayAccessForm:"property",emptyNodeForm:"object",stripWhitespaces:!1,enableToStringFunc:!1,ignoreRoot:!0,matchers:n}),(d=e).Period_asArray?y(T(d.Period_asArray,d,l.default.PERIOD,c),l.default.PERIOD,c):g.trigger(a.default.XLINK_READY,{manifest:d})},setMatchers:function(e){e&&(n=e)},setIron:function(e){e&&(s=e)},reset:function(){g.off(a.default.XLINK_ELEMENT_LOADED,v,t),h&&(h.reset(),h=null)}},g.on(a.default.XLINK_ELEMENT_LOADED,v,t),h=Object(r.default)(p).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),t}d.__dashjs_factory_name="XlinkController",t.default=s.default.getClassFactory(d)},"./src/streaming/metrics/MetricsReporting.js":function(e,t,n){n.r(t);var r=n("./src/streaming/metrics/utils/DVBErrorsTranslator.js"),i=n("./src/streaming/metrics/MetricsReportingEvents.js"),a=n("./src/streaming/metrics/controllers/MetricsCollectionController.js"),s=n("./src/streaming/metrics/metrics/MetricsHandlerFactory.js"),o=n("./src/streaming/metrics/reporting/ReportingFactory.js");function u(){var e=this.context;return{createMetricsReporting:function(t){return Object(r.default)(e).getInstance({eventBus:t.eventBus,dashMetrics:t.dashMetrics,metricsConstants:t.metricsConstants,events:t.events}).initialise(),Object(a.default)(e).create(t)},getReportingFactory:function(){return Object(o.default)(e).getInstance()},getMetricsHandlerFactory:function(){return Object(s.default)(e).getInstance()}}}u.__dashjs_factory_name="MetricsReporting";var l=dashjs.FactoryMaker.getClassFactory(u);l.events=i.default,dashjs.FactoryMaker.updateClassFactory(u.__dashjs_factory_name,l),t.default=l},"./src/streaming/metrics/MetricsReportingEvents.js":function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=s(e);if(t){var a=s(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}n.r(t);var o=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,e);var t=a(n);function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=t.call(this)).METRICS_INITIALISATION_COMPLETE="internal_metricsReportingInitialized",e.BECAME_REPORTING_PLAYER="internal_becameReportingPlayer",e.CMCD_DATA_GENERATED="cmcdDataGenerated",e}return n}(n("./src/core/events/EventsBase.js").default));t.default=o},"./src/streaming/metrics/controllers/MetricsCollectionController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/metrics/controllers/MetricsController.js"),i=n("./src/streaming/metrics/utils/ManifestParsing.js"),a=n("./src/streaming/metrics/MetricsReportingEvents.js");function s(e){var t;e=e||{};var n={},s=this.context,o=e.eventBus,u=e.events;function l(t){if(!t.error){var u=Object.keys(n);Object(i.default)(s).getInstance({adapter:e.adapter,constants:e.constants}).getMetrics(t.manifest).forEach((function(t){var i=JSON.stringify(t);if(n.hasOwnProperty(i))u.splice(i,1);else try{var a=Object(r.default)(s).create(e);a.initialize(t),n[i]=a}catch(e){}})),u.forEach((function(e){n[e].reset(),delete n[e]})),o.trigger(a.default.METRICS_INITIALISATION_COMPLETE)}}function c(){Object.keys(n).forEach((function(e){n[e].reset()})),n={}}return t={reset:function(){o.off(u.MANIFEST_UPDATED,l,t),o.off(u.STREAM_TEARDOWN_COMPLETE,c,t)}},o.on(u.MANIFEST_UPDATED,l,t),o.on(u.STREAM_TEARDOWN_COMPLETE,c,t),t}s.__dashjs_factory_name="MetricsCollectionController",t.default=dashjs.FactoryMaker.getClassFactory(s)},"./src/streaming/metrics/controllers/MetricsController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/metrics/controllers/RangeController.js"),i=n("./src/streaming/metrics/controllers/ReportingController.js"),a=n("./src/streaming/metrics/controllers/MetricsHandlersController.js");function s(e){var t,n,s;e=e||{};var o=this.context;function u(){t&&t.reset(),n&&n.reset(),s&&s.reset()}return{initialize:function(l){try{(s=Object(r.default)(o).create({mediaElement:e.mediaElement})).initialize(l.Range),(n=Object(i.default)(o).create({debug:e.debug,metricsConstants:e.metricsConstants})).initialize(l.Reporting,s),(t=Object(a.default)(o).create({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants,events:e.events})).initialize(l.metrics,n)}catch(e){throw u(),e}},reset:u}}s.__dashjs_factory_name="MetricsController",t.default=dashjs.FactoryMaker.getClassFactory(s)},"./src/streaming/metrics/controllers/MetricsHandlersController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/metrics/metrics/MetricsHandlerFactory.js");function i(e){e=e||{};var t,n=[],i=this.context,a=e.eventBus,s=e.events,o=Object(r.default)(i).getInstance({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants});function u(e){n.forEach((function(t){t.handleNewMetric(e.metric,e.value,e.mediaType)}))}return t={initialize:function(e,r){e.split(",").forEach((function(e,t,i){var a;if(-1!==e.indexOf("(")&&-1===e.indexOf(")")){var s=i[t+1];s&&-1===s.indexOf("(")&&-1!==s.indexOf(")")&&(e+=","+s,delete i[t+1])}(a=o.create(e,r))&&n.push(a)})),a.on(s.METRIC_ADDED,u,t),a.on(s.METRIC_UPDATED,u,t)},reset:function(){a.off(s.METRIC_ADDED,u,t),a.off(s.METRIC_UPDATED,u,t),n.forEach((function(e){return e.reset()})),n=[]}}}i.__dashjs_factory_name="MetricsHandlersController",t.default=dashjs.FactoryMaker.getClassFactory(i)},"./src/streaming/metrics/controllers/RangeController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/utils/CustomTimeRanges.js");function i(e){e=e||{};var t,n,i=!1,a=this.context,s=e.mediaElement;return t={initialize:function(e){e&&e.length&&(e.forEach((function(e){var t=e.starttime,r=t+e.duration;n.add(t,r)})),i=!!e[0]._useWallClockTime)},reset:function(){n.clear()},isEnabled:function(){var e,t=n.length;if(!t)return!0;e=i?(new Date).getTime()/1e3:s.currentTime;for(var r=0;r<t;r+=1){var a=n.start(r),o=n.end(r);if(a<=e&&e<o)return!0}return!1}},n=Object(r.default)(a).create(),t}i.__dashjs_factory_name="RangeController",t.default=dashjs.FactoryMaker.getClassFactory(i)},"./src/streaming/metrics/controllers/ReportingController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/metrics/reporting/ReportingFactory.js");function i(e){var t=[],n=Object(r.default)(this.context).getInstance(e);return{initialize:function(e,r){e.some((function(e){var i=n.create(e,r);if(i)return t.push(i),!0}))},reset:function(){t.forEach((function(e){return e.reset()})),t=[]},report:function(e,n){t.forEach((function(t){return t.report(e,n)}))}}}i.__dashjs_factory_name="ReportingController",t.default=dashjs.FactoryMaker.getClassFactory(i)},"./src/streaming/metrics/metrics/MetricsHandlerFactory.js":function(e,t,n){n.r(t);var r=n("./src/streaming/metrics/metrics/handlers/BufferLevelHandler.js"),i=n("./src/streaming/metrics/metrics/handlers/DVBErrorsHandler.js"),a=n("./src/streaming/metrics/metrics/handlers/HttpListHandler.js"),s=n("./src/streaming/metrics/metrics/handlers/GenericMetricHandler.js");function o(e){var t,n=(e=e||{}).debug?e.debug.getLogger(t):{},o=/([a-zA-Z]*)(\(([0-9]*)(\,\s*([a-zA-Z]*))?\))?/,u=this.context,l={BufferLevel:r.default,DVBErrors:i.default,HttpList:a.default,PlayList:s.default,RepSwitchList:s.default,TcpList:s.default};return{create:function(t,r){var i,a=t.match(o);if(a){try{(i=l[a[1]](u).create({eventBus:e.eventBus,metricsConstants:e.metricsConstants})).initialize(a[1],r,a[3],a[5])}catch(e){i=null,n.error("MetricsHandlerFactory: Could not create handler for type ".concat(a[1]," with args ").concat(a[3],", ").concat(a[5]," (").concat(e.message,")"))}return i}},register:function(e,t){l[e]=t},unregister:function(e){delete l[e]}}}o.__dashjs_factory_name="MetricsHandlerFactory",t.default=dashjs.FactoryMaker.getSingletonFactory(o)},"./src/streaming/metrics/metrics/handlers/BufferLevelHandler.js":function(e,t,n){n.r(t);var r=n("./src/streaming/metrics/utils/HandlerHelpers.js");function i(e){var t,n,i,a,s;e=e||{};var o=this.context,u=Object(r.default)(o).getInstance(),l=[],c=e.metricsConstants;function d(){var e=function(){try{return Object.keys(l).map((function(e){return l[e]})).reduce((function(e,t){return e.level<t.level?e:t}))}catch(e){return}}();e&&s!==e.t&&(s=e.t,t.report(i,e))}return{initialize:function(e,r,s){r&&(n=u.validateN(s),t=r,i=u.reconstructFullMetricName(e,s),a=setInterval(d,n))},reset:function(){clearInterval(a),a=null,n=0,t=null,s=null},handleNewMetric:function(e,t,n){e===c.BUFFER_LEVEL&&(l[n]=t)}}}i.__dashjs_factory_name="BufferLevelHandler",t.default=dashjs.FactoryMaker.getClassFactory(i)},"./src/streaming/metrics/metrics/handlers/DVBErrorsHandler.js":function(e,t,n){n.r(t);var r=n("./src/streaming/metrics/MetricsReportingEvents.js");t.default=dashjs.FactoryMaker.getClassFactory((function(e){var t,n=(e=e||{}).eventBus,i=e.metricsConstants;function a(){n.off(r.default.METRICS_INITIALISATION_COMPLETE,a,this),n.trigger(r.default.BECAME_REPORTING_PLAYER)}return{initialize:function(e,i){i&&(t=i,n.on(r.default.METRICS_INITIALISATION_COMPLETE,a,this))},reset:function(){t=null},handleNewMetric:function(e,n){e===i.DVB_ERRORS&&t&&t.report(e,n)}}}))},"./src/streaming/metrics/metrics/handlers/GenericMetricHandler.js":function(e,t,n){function r(){var e,t;return{initialize:function(n,r){e=n,t=r},reset:function(){t=null,e=void 0},handleNewMetric:function(n,r){n===e&&t&&t.report(e,r)}}}n.r(t),r.__dashjs_factory_name="GenericMetricHandler",t.default=dashjs.FactoryMaker.getClassFactory(r)},"./src/streaming/metrics/metrics/handlers/HttpListHandler.js":function(e,t,n){n.r(t);var r=n("./src/streaming/metrics/utils/HandlerHelpers.js");function i(e){var t,n,i,a,s;e=e||{};var o=[],u=Object(r.default)(this.context).getInstance(),l=e.metricsConstants;function c(){var e=o;e.length&&t&&t.report(a,e),o=[]}return{initialize:function(e,r,o,l){r&&(n=u.validateN(o),t=r,l&&l.length&&(i=l),a=u.reconstructFullMetricName(e,o,l),s=setInterval(c,n))},reset:function(){clearInterval(s),s=null,n=null,i=null,o=[],t=null},handleNewMetric:function(e,t){e===l.HTTP_REQUEST&&(i&&i!==t.type||o.push(t))}}}i.__dashjs_factory_name="HttpListHandler",t.default=dashjs.FactoryMaker.getClassFactory(i)},"./src/streaming/metrics/reporting/ReportingFactory.js":function(e,t,n){n.r(t);var r=n("./src/streaming/metrics/reporting/reporters/DVBReporting.js");function i(e){e=e||{};var t,n={"urn:dvb:dash:reporting:2014":r.default},i=this.context,a=e.debug?e.debug.getLogger(t):{},s=e.metricsConstants;return{create:function(e,t){var r;try{(r=n[e.schemeIdUri](i).create({metricsConstants:s})).initialize(e,t)}catch(t){r=null,a.error("ReportingFactory: could not create Reporting with schemeIdUri ".concat(e.schemeIdUri," (").concat(t.message,")"))}return r},register:function(e,t){n[e]=t},unregister:function(e){delete n[e]}}}i.__dashjs_factory_name="ReportingFactory",t.default=dashjs.FactoryMaker.getSingletonFactory(i)},"./src/streaming/metrics/reporting/reporters/DVBReporting.js":function(e,t,n){n.r(t);var r=n("./src/streaming/metrics/utils/MetricSerialiser.js"),i=n("./src/streaming/metrics/utils/RNG.js");function a(e){var t;e=e||{};var n,a,s,o,u,l,c=this.context,d=[],f=e.metricsConstants;function h(){s=!1,o=!1,u=null,l=null}return t={report:function(e,t){Array.isArray(t)||(t=[t]),o&&l.isEnabled()&&t.forEach((function(t){var r=n.serialise(t);e!==f.DVB_ERRORS&&(r="metricname=".concat(e,"&").concat(r)),function(e,t,n){var r=new XMLHttpRequest,i=function(){var e=d.indexOf(r);-1!==e&&(d.splice(e,1),r.status>=200&&r.status<300?t&&t():n&&n())};d.push(r);try{r.open("GET",e),r.onloadend=i,r.onerror=i,r.send()}catch(e){r.onerror()}}(r="".concat(u,"?").concat(r),null,(function(){o=!1}))}))},initialize:function(e,t){var n;if(l=t,!(u=e.dvb_reportingUrl))throw new Error("required parameter missing (dvb:reportingUrl)");s||((n=e.dvb_probability)&&(1e3===n||n/1e3>=a.random())&&(o=!0),s=!0)},reset:function(){h()}},n=Object(r.default)(c).getInstance(),a=Object(i.default)(c).getInstance(),h(),t}a.__dashjs_factory_name="DVBReporting",t.default=dashjs.FactoryMaker.getClassFactory(a)},"./src/streaming/metrics/utils/DVBErrorsTranslator.js":function(e,t,n){n.r(t);var r=n("./src/streaming/metrics/vo/DVBErrors.js"),i=n("./src/streaming/metrics/MetricsReportingEvents.js");function a(e){var t,n,a=(e=e||{}).eventBus,s=e.dashMetrics,o=e.metricsConstants,u=e.events;function l(e){var t=new r.default;if(n){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);t.mpdurl||(t.mpdurl=n.originalUrl||n.url),t.terror||(t.terror=new Date),s.addDVBErrors(t)}}function c(e){e.error||(n=e.manifest)}function d(e){l({errorcode:r.default.BASE_URL_CHANGED,servicelocation:e.entry})}function f(){l({errorcode:r.default.BECAME_REPORTER})}function h(e){var t;e.metric===o.HTTP_REQUEST&&(0===(t=e.value).responsecode||null==t.responsecode||t.responsecode>=400||t.responsecode<100||t.responsecode>=600)&&l({errorcode:t.responsecode||r.default.CONNECTION_ERROR,url:t.url,terror:t.tresponse,servicelocation:t._serviceLocation})}function p(e){var t;switch(e.error?e.error.code:0){case MediaError.MEDIA_ERR_NETWORK:t=r.default.CONNECTION_ERROR;break;case MediaError.MEDIA_ERR_DECODE:t=r.default.CORRUPT_MEDIA_OTHER;break;default:return}l({errorcode:t})}return t={initialise:function(){a.on(u.MANIFEST_UPDATED,c,t),a.on(u.SERVICE_LOCATION_BLACKLIST_CHANGED,d,t),a.on(u.METRIC_ADDED,h,t),a.on(u.METRIC_UPDATED,h,t),a.on(u.PLAYBACK_ERROR,p,t),a.on(i.default.BECAME_REPORTING_PLAYER,f,t)},reset:function(){a.off(u.MANIFEST_UPDATED,c,t),a.off(u.SERVICE_LOCATION_BLACKLIST_CHANGED,d,t),a.off(u.METRIC_ADDED,h,t),a.off(u.METRIC_UPDATED,h,t),a.off(u.PLAYBACK_ERROR,p,t),a.off(i.default.BECAME_REPORTING_PLAYER,f,t)}}}a.__dashjs_factory_name="DVBErrorsTranslator",t.default=dashjs.FactoryMaker.getSingletonFactory(a)},"./src/streaming/metrics/utils/HandlerHelpers.js":function(e,t,n){function r(){return{reconstructFullMetricName:function(e,t,n){var r=e;return t&&(r+="("+t,n&&n.length&&(r+=","+n),r+=")"),r},validateN:function(e){if(!e)throw new Error("missing n");if(isNaN(e))throw new Error("n is NaN");if(e<0)throw new Error("n must be positive");return e}}}n.r(t),r.__dashjs_factory_name="HandlerHelpers",t.default=dashjs.FactoryMaker.getSingletonFactory(r)},"./src/streaming/metrics/utils/ManifestParsing.js":function(e,t,n){n.r(t);var r=n("./src/streaming/metrics/vo/Metrics.js"),i=n("./src/streaming/metrics/vo/Range.js"),a=n("./src/streaming/metrics/vo/Reporting.js");function s(e){var t=(e=e||{}).adapter,n=e.constants;return{getMetrics:function(e){var s=[];return e&&e.Metrics_asArray&&e.Metrics_asArray.forEach((function(o){var u=new r.default,l=t.getIsDynamic(e);o.hasOwnProperty("metrics")&&(u.metrics=o.metrics,o.Range_asArray&&o.Range_asArray.forEach((function(r){var a=new i.default;a.starttime=function(e,r,i){var a,s,o=0;return r?o=t.getAvailabilityStartTime(e)/1e3:(a=t.getRegularPeriods(e)).length&&(o=a[0].start),s=o,i&&i.hasOwnProperty(n.START_TIME)&&(s+=i.starttime),s}(e,l,r),r.hasOwnProperty("duration")?a.duration=r.duration:a.duration=t.getDuration(e),a._useWallClockTime=l,u.Range.push(a)})),o.Reporting_asArray&&(o.Reporting_asArray.forEach((function(e){var t=new a.default;e.hasOwnProperty(n.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty("value")&&(t.value=e.value),e.hasOwnProperty(n.DVB_REPORTING_URL)&&(t.dvb_reportingUrl=e[n.DVB_REPORTING_URL]),e.hasOwnProperty(n.DVB_PROBABILITY)&&(t.dvb_probability=e[n.DVB_PROBABILITY]),u.Reporting.push(t))})),s.push(u)))})),s}}}s.__dashjs_factory_name="ManifestParsing",t.default=dashjs.FactoryMaker.getSingletonFactory(s)},"./src/streaming/metrics/utils/MetricSerialiser.js":function(e,t,n){function r(){return{serialise:function e(t){var n,r,i=[],a=[];for(n in t)if(t.hasOwnProperty(n)&&0!==n.indexOf("_")){if(null==(r=t[n])&&(r=""),Array.isArray(r)){if(!r.length)continue;a=[],r.forEach((function(t){var n="Object"!==Object.prototype.toString.call(t).slice(8,-1);a.push(n?t:e(t))})),r=a.map(encodeURIComponent).join(",")}else"string"==typeof r?r=encodeURIComponent(r):r instanceof Date?r=r.toISOString():"number"==typeof r&&(r=Math.round(r));i.push(n+"="+r)}return i.join("&")}}}n.r(t),r.__dashjs_factory_name="MetricSerialiser",t.default=dashjs.FactoryMaker.getSingletonFactory(r)},"./src/streaming/metrics/utils/RNG.js":function(e,t,n){function r(){var e,t,n,r=window.crypto||window.msCrypto,i=Uint32Array,a=Math.pow(2,8*i.BYTES_PER_ELEMENT)-1,s=10;function o(){r&&(e||(e=new i(s)),r.getRandomValues(e),t=0)}return n={random:function(n,i){var s;return n||(n=0),i||(i=1),r?(t===e.length&&o(),s=e[t]/a,t+=1):s=Math.random(),s*(i-n)+n}},o(),n}n.r(t),r.__dashjs_factory_name="RNG",t.default=dashjs.FactoryMaker.getSingletonFactory(r)},"./src/streaming/metrics/vo/DVBErrors.js":function(e,t,n){n.r(t);var r=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mpdurl=null,this.errorcode=null,this.terror=null,this.url=null,this.ipaddress=null,this.servicelocation=null};r.SSL_CONNECTION_FAILED_PREFIX="SSL",r.DNS_RESOLUTION_FAILED="C00",r.HOST_UNREACHABLE="C01",r.CONNECTION_REFUSED="C02",r.CONNECTION_ERROR="C03",r.CORRUPT_MEDIA_ISOBMFF="M00",r.CORRUPT_MEDIA_OTHER="M01",r.BASE_URL_CHANGED="F00",r.BECAME_REPORTER="S00",t.default=r},"./src/streaming/metrics/vo/Metrics.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metrics="",this.Range=[],this.Reporting=[]}},"./src/streaming/metrics/vo/Range.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.starttime=0,this.duration=1/0,this._useWallClockTime=!1}},"./src/streaming/metrics/vo/Reporting.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schemeIdUri="",this.value="",this.dvb_reportingUrl="",this.dvb_probability=1e3}},"./src/streaming/models/BaseURLTreeModel.js":function(e,t,n){n.r(t);var r=n("./src/streaming/utils/ObjectUtils.js"),i=n("./src/core/FactoryMaker.js"),a=NaN,s=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.data={baseUrls:t||null,selectedIdx:n||a},this.children=[]};function o(){var e,t,n,i=this.context,o=Object(r.default)(i).getInstance();function u(e,t,r){var i=n.getBaseURLsFromElement(r);e[t]?o.areEqual(i,e[t].data.baseUrls)||(e[t].data.baseUrls=i,e[t].data.selectedIdx=a):e[t]=new s(i)}function l(e){!function(){if(!n||!n.hasOwnProperty("getBaseURLsFromElement")||!n.hasOwnProperty("getRepresentationSortFunction"))throw new Error("setConfig function has to be called previously")}();var r=n.getBaseURLsFromElement(e);o.areEqual(r,t.data.baseUrls)||(t.data.baseUrls=r,t.data.selectedIdx=a),e&&e.Period_asArray&&e.Period_asArray.forEach((function(e,r){u(t.children,r,e),e.AdaptationSet_asArray&&e.AdaptationSet_asArray.forEach((function(e,i){u(t.children[r].children,i,e),e.Representation_asArray&&e.Representation_asArray.sort(n.getRepresentationSortFunction()).forEach((function(e,n){u(t.children[r].children[i].children,n,e)}))}))}))}function c(e,n){var r=n||t;e(r.data),r.children&&r.children.forEach((function(t){return c(e,t)}))}function d(){t=new s}return e={reset:d,update:function(e){l(e)},getForPath:function(e){var n=t,r=[n.data];return e&&e.forEach((function(e){(n=n.children[e])&&r.push(n.data)})),r.filter((function(e){return e.baseUrls.length}))},invalidateSelectedIndexes:function(e){c((function(t){isNaN(t.selectedIdx)||e===t.baseUrls[t.selectedIdx].serviceLocation&&(t.selectedIdx=a)}))},setConfig:function(e){e.adapter&&(n=e.adapter)}},d(),e}o.__dashjs_factory_name="BaseURLTreeModel",t.default=i.default.getClassFactory(o)},"./src/streaming/models/CmcdModel.js":function(e,t,n){n.r(t);var r=n("./src/core/EventBus.js"),i=n("./src/streaming/MediaPlayerEvents.js"),a=n("./src/streaming/metrics/MetricsReportingEvents.js"),s=n("./src/core/FactoryMaker.js"),o=n("./src/core/Settings.js"),u=n("./src/streaming/constants/Constants.js"),l=n("./src/streaming/vo/metrics/HTTPRequest.js"),c=n("./src/dash/models/DashManifestModel.js"),d=n("./src/core/Utils.js");function f(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var p="m",g="a",m="v",y="i",v="c",_="tt",T="k",b="o",E="d",S="s",w="v",A="l";function I(){var e,t,n,s,h,I,C,R,D,x,N=this.context,O=Object(r.default)(N).getInstance(),P=Object(o.default)(N).getInstance();function M(){n={pr:1,nor:null,st:null,sf:null,sid:"".concat(d.default.generateUuid()),cid:null},D={},R={},x={},L()}function k(){L()}function L(){if(I){var e=I.getStreamController();if(e&&"function"==typeof e.getActiveStream){var t=e.getActiveStream();t&&(C=t.getProcessors())}}}function F(e,t){var n,r={},i=f(t);try{for(i.s();!(n=i.n()).done;){var a=n.value;e[a]&&(r[a]=e[a])}}catch(e){i.e(e)}finally{i.f()}return r}function U(e){try{return e.type===l.HTTPRequest.MPD_TYPE?((r=B()).ot=p,r):e.type===l.HTTPRequest.MEDIA_SEGMENT_TYPE?(t=e.mediaType,x.hasOwnProperty(t)||(x[t]=!1),R.hasOwnProperty(t)||(R[t]=!1),D.hasOwnProperty(t)||(D[t]=!1),function(e){var t,r=B(),i=function(e){try{var t=e.quality,n=e.mediaInfo.bitrateList;return parseInt(n[t].bandwidth/1e3)}catch(e){return null}}(e),a=function(e){try{return isNaN(e.duration)?null:Math.round(1e3*e.duration)}catch(e){return null}}(e),o=function(e){try{return 100*parseInt(s.getThroughputHistory().getSafeAverageThroughput(e)/100)}catch(e){return null}}(e.mediaType),l=function(e){try{var t=n.pr,r=h.getCurrentBufferLevel(e);return isNaN(t)||isNaN(r)?null:100*parseInt(r/t*10)}catch(e){return null}}(e.mediaType),c=j(e.mediaType),p=function(e){try{var t=s.getTopBitrateInfoFor(e);return Math.round(t.bitrate/1e3)}catch(e){return null}}(e.mediaType),y=n.pr,T=function(e){if(C&&0!==C.length){var t,n=f(C);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.getType()===e)return r.probeNextRequest()}}catch(e){n.e(e)}finally{n.f()}}}(e.mediaType);e.mediaType===u.default.VIDEO&&(t=m),e.mediaType===u.default.AUDIO&&(t=g),e.mediaType===u.default.TEXT&&(t="application/mp4"===e.mediaInfo.mimeType?_:v);var b=P.get().streaming.cmcd.rtp;return b||(b=function(e){var t=I.getPlaybackRate();t||(t=1);var n=e.quality,r=e.mediaType,i=e.mediaInfo,a=e.duration,s=j(r);0===s&&(s=500);var o=i.bitrateList[n].bandwidth*a/1e3/(s/t/1e3),u=P.get().streaming.cmcd.rtpSafetyFactor&&!isNaN(P.get().streaming.cmcd.rtpSafetyFactor)?P.get().streaming.cmcd.rtpSafetyFactor:5;return 100*(parseInt(o*u/100)+1)}(e)),r.rtp=b,T&&(e.url!==T.url?r.nor=encodeURIComponent(d.default.getRelativeUrl(e.url,T.url)):T.range&&(r.nrr=T.range)),i&&(r.br=i),t&&(r.ot=t),isNaN(a)||(r.d=a),isNaN(o)||(r.mtp=o),isNaN(l)||(r.dl=l),isNaN(c)||(r.bl=c),isNaN(p)||(r.tb=p),isNaN(y)||1===y||(r.pr=y),D[e.mediaType]&&(r.bs=!0,D[e.mediaType]=!1),!R[e.mediaType]&&x[e.mediaType]||(r.su=!0,R[e.mediaType]=!1,x[e.mediaType]=!0),r}(e)):e.type===l.HTTPRequest.INIT_SEGMENT_TYPE?function(){var e=B();return e.ot=y,e.su=!0,e}():e.type===l.HTTPRequest.OTHER_TYPE||e.type===l.HTTPRequest.XLINK_EXPANSION_TYPE?function(){var e=B();return e.ot=b,e}():e.type===l.HTTPRequest.LICENSE?function(e){var t=B();return t.ot=T,t}():null}catch(e){return null}var t,r}function B(){var e={},t=P.get().streaming.cmcd.cid?P.get().streaming.cmcd.cid:n.cid;return e.v=1,e.sid=P.get().streaming.cmcd.sid?P.get().streaming.cmcd.sid:n.sid,e.sid="".concat(e.sid),t&&(e.cid="".concat(t)),isNaN(n.pr)||1===n.pr||null===n.pr||(e.pr=n.pr),n.st&&(e.st=n.st),n.sf&&(e.sf=n.sf),e}function j(e){try{var t=h.getCurrentBufferLevel(e);return isNaN(t)?null:100*parseInt(10*t)}catch(e){return null}}function q(e){try{n.pr=e.playbackRate}catch(e){}}function H(t){try{var r=e.getIsDynamic(t.data)?A:w,i=t.protocol&&"MSS"===t.protocol?S:E;n.st="".concat(r),n.sf="".concat(i)}catch(e){}}function G(e){try{e.state&&e.mediaType&&e.state===i.default.BUFFER_EMPTY&&(D[e.mediaType]||(D[e.mediaType]=!0),R[e.mediaType]||(R[e.mediaType]=!0))}catch(e){}}function V(){for(var e in D)D.hasOwnProperty(e)&&(D[e]=!0);for(var t in R)R.hasOwnProperty(t)&&(R[t]=!0)}function Y(e){try{if(!e)return null;var t=Object.keys(e).sort((function(e,t){return e.localeCompare(t)})),n=t.length,r=t.reduce((function(t,r,i){if("v"===r&&1===e[r])return t;if("string"==typeof e[r]&&"ot"!==r&&"sf"!==r&&"st"!==r){var a=e[r].replace(/"/g,'"');t+="".concat(r,'="').concat(a,'"')}else t+="".concat(r,"=").concat(e[r]);return i<n-1&&(t+=","),t}),"");return(r=r.replace(/=true/g,"")).replace(/,\s*$/,"")}catch(e){return null}}return t={getQueryParameter:function(e){try{if(P.get().streaming.cmcd&&P.get().streaming.cmcd.enabled){var t=U(e),n=Y(t);return O.trigger(a.default.CMCD_DATA_GENERATED,{url:e.url,mediaType:e.mediaType,cmcdData:t,cmcdString:n}),{key:"CMCD",value:n}}return null}catch(e){return null}},getHeaderParameters:function(e){try{if(P.get().streaming.cmcd&&P.get().streaming.cmcd.enabled){var t=U(e),n=F(t,["br","d","ot","tb"]),r=F(t,["bl","dl","mtp","nor","nrr","su"]),i=F(t,["bs","rtp"]),s=F(t,["cid","pr","sf","sid","st","v"]),o={"CMCD-Object":Y(n),"CMCD-Request":Y(r),"CMCD-Status":Y(i),"CMCD-Session":Y(s)};return O.trigger(a.default.CMCD_DATA_GENERATED,{url:e.url,mediaType:e.mediaType,cmcdData:t,headers:o}),o}return null}catch(e){return null}},setConfig:function(e){e&&(e.abrController&&(s=e.abrController),e.dashMetrics&&(h=e.dashMetrics),e.playbackController&&(I=e.playbackController))},reset:function(){O.off(i.default.PLAYBACK_RATE_CHANGED,q,this),O.off(i.default.MANIFEST_LOADED,H,this),O.off(i.default.BUFFER_LEVEL_STATE_CHANGED,G,t),O.off(i.default.PLAYBACK_SEEKED,V,t),M()},initialize:function(){O.on(i.default.PLAYBACK_RATE_CHANGED,q,t),O.on(i.default.MANIFEST_LOADED,H,t),O.on(i.default.BUFFER_LEVEL_STATE_CHANGED,G,t),O.on(i.default.PLAYBACK_SEEKED,V,t),O.on(i.default.PERIOD_SWITCH_COMPLETED,k,t)}},e=Object(c.default)(N).getInstance(),M(),t}I.__dashjs_factory_name="CmcdModel",t.default=s.default.getSingletonFactory(I)},"./src/streaming/models/FragmentModel.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/vo/FragmentRequest.js"),a="loading",s="executed",o="failed";function u(e){var t,n,r,u,l=(e=e||{}).eventBus,c=e.events,d=e.dashMetrics,f=e.fragmentLoader,h=e.debug,p=e.streamInfo,g=e.type;function m(e){var t;return!!e&&(t=!1,r.some((function(n){if(r=e,a=n,!isNaN(r.index)&&r.startTime===a.startTime&&r.adaptationIndex===a.adaptationIndex&&r.type===a.type||function(e,t){return isNaN(e.index)&&isNaN(t.index)&&e.quality===t.quality}(e,n)||function(e,t){return e.action===i.default.ACTION_COMPLETE&&e.action===t.action}(e,n))return t=!0;var r,a})),t)}function y(e){return isNaN(e.duration)?.25:Math.min(e.duration/8,.5)}function v(e){r=r.filter((function(t){var n=y(t);return isNaN(t.startTime)||void 0!==e&&t.startTime>=e-n}))}function _(e,t){t<=e+.5||(r=r.filter((function(n){var r=y(n);return isNaN(n.startTime)||n.startTime>=t-r||isNaN(n.duration)||n.startTime+n.duration<=e+r})))}function T(e,t,n){for(var r=e.length-1;r>=0;r--){var i=e[r],a=i.startTime,s=a+i.duration;if(n=isNaN(n)?y(i):n,!isNaN(a)&&!isNaN(s)&&t+n>=a&&t-n<s||isNaN(a)&&isNaN(t))return i}return null}function b(e,t){d.addSchedulingInfo(e,t),d.addRequestsQueue(e.mediaType,u,r)}function E(e){e.sender===f&&(u.splice(u.indexOf(e.request),1),e.response&&!e.error&&r.push(e.request),b(e.request,e.error?o:s),l.trigger(c.FRAGMENT_LOADING_COMPLETED,{request:e.request,response:e.response,error:e.error,sender:this},{streamId:p.id,mediaType:g}))}function S(e){e.sender===f&&l.trigger(c.FRAGMENT_LOADING_PROGRESS,{request:e.request,response:e.response,error:e.error,sender:this},{streamId:p.id,mediaType:g})}function w(e){e.sender===f&&l.trigger(c.FRAGMENT_LOADING_ABANDONED,{request:e.request},{streamId:p.id,mediaType:g})}function A(){r=[],u=[]}return t={getStreamId:function(){return p.id},getType:function(){return g},getRequests:function(e){var t=e?e.state instanceof Array?e.state:[e.state]:[],n=[];return t.forEach((function(t){var i=function(e){var t;switch(e){case a:t=u;break;case s:t=r;break;default:t=[]}return t}(t);n=n.concat(function(e,t){return t.hasOwnProperty("time")?[T(e,t.time,t.threshold)]:e.filter((function(e){for(var n in t)if("state"!==n&&t.hasOwnProperty(n)&&e[n]!=t[n])return!1;return!0}))}(i,e))})),n},isFragmentLoaded:m,isFragmentLoadedOrPending:function(e){var t,n=!1,r=0;if(!(n=m(e)))for(r=0;r<u.length;r++)t=u[r],e.url===t.url&&e.startTime===t.startTime&&(n=!0);return n},removeExecutedRequestsBeforeTime:v,removeExecutedRequestsAfterTime:function(e){r=r.filter((function(t){return isNaN(t.startTime)||void 0!==e&&t.startTime<e}))},syncExecutedRequestsWithBufferedRange:function(e,t){if(e&&0!==e.length){for(var n=0,r=0,i=e.length;r<i;r++)_(n,e.start(r)),n=e.end(r);t>0&&_(n,t)}else v()},abortRequests:function(){n.debug("abort requests"),f.abort(),u=[]},executeRequest:function(e){e.action===i.default.ACTION_DOWNLOAD?(b(e,a),u.push(e),function(e){l.trigger(c.FRAGMENT_LOADING_STARTED,{request:e},{streamId:p.id,mediaType:g}),f.load(e)}(e)):n.warn("Unknown request action.")},reset:function(){l.off(c.LOADING_COMPLETED,E,this),l.off(c.LOADING_DATA_PROGRESS,S,this),l.off(c.LOADING_ABANDONED,w,this),f&&f.reset(),A()},resetInitialSettings:A,addExecutedRequest:function(e){r.push(e)}},n=h.getLogger(t),A(),l.on(c.LOADING_COMPLETED,E,t),l.on(c.LOADING_DATA_PROGRESS,S,t),l.on(c.LOADING_ABANDONED,w,t),t}u.__dashjs_factory_name="FragmentModel";var l=r.default.getClassFactory(u);l.FRAGMENT_MODEL_LOADING=a,l.FRAGMENT_MODEL_EXECUTED=s,l.FRAGMENT_MODEL_CANCELED="canceled",l.FRAGMENT_MODEL_FAILED=o,r.default.updateClassFactory(u.__dashjs_factory_name,l),t.default=l},"./src/streaming/models/LowLatencyThroughputModel.js":function(e,t,n){n.r(t);var r=n("./src/core/Debug.js"),i=n("./src/core/FactoryMaker.js");function a(){var e,t,n=this.context,i={};function a(){t=Object(r.default)(n).getInstance().getLogger(e)}function s(e){for(var t={},n=0,r=0,i=0,a=0,s=e.length,o=0;o<s;++o)n+=e[o].chunkDownloadTimeRelativeMS,r+=e[o].bufferLevel,i+=e[o].chunkDownloadTimeRelativeMS*e[o].bufferLevel,a+=e[o].chunkDownloadTimeRelativeMS*e[o].chunkDownloadTimeRelativeMS;return t.m=(i-n*r/s)/(a-n*n/s),t.b=r/s-t.m*n/s,function(e){return t.m*e+t.b}}function o(e){var t,n=!0,r=e.reduce((function(e,t){return e+t.bufferLevelAtSegmentEnd}),0)/e.length;return e.forEach((function(e){Math.abs(e.bufferLevelAtSegmentEnd/e.bufferLevelAtSegmentStart)<.95&&(n=!1),e.bufferLevelAtSegmentEnd/r<.8&&(n=!1),t?t>e.bitrate&&(n=!1):t=e.bitrate})),n}return e={setup:a,addMeasurement:function(e,t,n,r,a){e&&e.mediaType&&!i[e.mediaType]&&(i[e.mediaType]=[]);var o=e.mediaInfo.bitrateList.find((function(t){return t.id===e.representationId}));i[e.mediaType].push({index:e.index,repId:e.representationId,mediaType:e.mediaType,requestTimeMS:r,adjustedAvailabilityStartTimeMS:e.availabilityStartTime.getTime(),segDurationMS:1e3*e.duration,chunksDurationMS:n.reduce((function(e,t){return e+t.chunkDownloadDurationMS}),0),segmentBytes:n.reduce((function(e,t){return e+t.chunkBytes}),0),bitrate:o&&o.bandwidth,bitrateList:e.mediaInfo.bitrateList,chunkMeasurements:n,fetchDownloadDurationMS:t,throughputCapacityDelayMS:a,getEstimatedBufferLevel:s(n.slice(1))}),i[e.mediaType].length>10&&i[e.mediaType].shift()},getThroughputCapacityDelayMS:function(e,t){var n=i[e.mediaType]&&i[e.mediaType].slice(-3);return!n||n.length<3?0:o(n)?t/4>250?250:t/4:0},getEstimatedDownloadDurationMS:function(e){var n=i[e.mediaType].slice(-1).pop(),r=i[e.mediaType].slice(-3),a=n.chunkMeasurements.slice(-1).pop().chunkDownloadTimeRelativeMS;n.bufferLevelAtSegmentStart=n.getEstimatedBufferLevel(a/2),n.bufferLevelAtSegmentEnd=n.getEstimatedBufferLevel(a);var s=o(r),u=s?.6:.8;if(n.isBufferStable&&1.05*n.segDurationMS<n.fetchDownloadDurationMS)return n.fetchDownloadDurationMS;if(!s||n.segDurationMS<n.fetchDownloadDurationMS)return.8*n.fetchDownloadDurationMS;if(n.adjustedAvailabilityStartTimeMS<=n.requestTimeMS+n.throughputCapacityDelayMS-n.segDurationMS)return.8*n.fetchDownloadDurationMS;for(var l=n.requestTimeMS+n.throughputCapacityDelayMS-n.adjustedAvailabilityStartTimeMS,c=0,d=0,f=0,h=0;h<n.chunkMeasurements.length;h++){var p=n.chunkMeasurements[h];if(l<d+p.chunkDownloadDurationMS)break;d+=p.chunkDownloadDurationMS,c+=p.chunkBytes,f++}if(l<0&&t.warn("request time was before adjusted availibitly start time"),c&&d&&f>.2*n.chunkMeasurements.length){var g=c/d,m=n.segmentBytes/g;return n.fetchDownloadDurationMS<m?n.fetchDownloadDurationMS*u:m*u}var y=n.bitrate;return n.bitrateList.some((function(e){if(e.bandwidth>n.bitrate)return y=e.bandwidth,!0})),y===n.bitrate?n.fetchDownloadDurationMS*u:u*n.segmentBytes*8*1e3/y}},a(),e}a.__dashjs_factory_name="LowLatencyThroughputModel",t.default=i.default.getSingletonFactory(a)},"./src/streaming/models/ManifestModel.js":function(e,t,n){n.r(t);var r=n("./src/core/EventBus.js"),i=n("./src/core/events/Events.js"),a=n("./src/core/FactoryMaker.js");function s(){var e,t=this.context,n=Object(r.default)(t).getInstance();return{getValue:function(){return e},setValue:function(t){e=t,t&&n.trigger(i.default.MANIFEST_LOADED,{data:t})}}}s.__dashjs_factory_name="ManifestModel",t.default=a.default.getSingletonFactory(s)},"./src/streaming/models/MediaPlayerModel.js":function(e,t,n){n.r(t);var r=n("./src/dash/vo/UTCTiming.js"),i=n("./src/core/FactoryMaker.js"),a=n("./src/streaming/constants/Constants.js"),s=n("./src/streaming/rules/abr/ABRRulesCollection.js"),o=n("./src/core/Settings.js"),u=n("./src/streaming/utils/SupervisorTools.js");function l(){var e,t,n,i,l=this.context,c=Object(o.default)(l).getInstance();function d(e){var t;for(t=0;t<i.length;t++)if(i[t].rulename===e)return t;return-1}function f(){if(c.get().streaming.lowLatencyEnabled)return h();var e=c.get().streaming.buffer.stableBufferTime;return e>0?e:c.get().streaming.buffer.fastSwitchEnabled?20:12}function h(){return c.get().streaming.lowLatencyEnabled?c.get().streaming.delay.liveDelay||3:c.get().streaming.delay.liveDelay}function p(e,n){g(e,n);var i=new r.default;i.schemeIdUri=e,i.value=n,t.push(i)}function g(e,n){Object(u.checkParameterType)(e,"string"),Object(u.checkParameterType)(n,"string"),t.forEach((function(r,i){r.schemeIdUri===e&&r.value===n&&t.splice(i,1)}))}return e={getABRCustomRules:function(){return i},addABRCustomRule:function(e,t,n){if("string"!=typeof e||e!==s.default.ABANDON_FRAGMENT_RULES&&e!==s.default.QUALITY_SWITCH_RULES||"string"!=typeof t)throw a.default.BAD_ARGUMENT_ERROR;var r=d(t);-1===r?i.push({type:e,rulename:t,rule:n}):(i[r].type=e,i[r].rule=n)},removeABRCustomRule:function(e){if(e){var t=d(e);-1!==t&&i.splice(t,1)}else i=[]},getStableBufferTime:f,getInitialBufferLevel:function(){var e=c.get().streaming.buffer.initialBufferLevel;return isNaN(e)||e<0?0:Math.min(f(),e)},getRetryAttemptsForType:function(e){var t=isNaN(c.get().streaming.retryAttempts.lowLatencyMultiplyFactor)?5:c.get().streaming.retryAttempts.lowLatencyMultiplyFactor;return c.get().streaming.lowLatencyEnabled?c.get().streaming.retryAttempts[e]*t:c.get().streaming.retryAttempts[e]},getRetryIntervalsForType:function(e){var t=isNaN(c.get().streaming.retryIntervals.lowLatencyReductionFactor)?10:c.get().streaming.retryIntervals.lowLatencyReductionFactor;return c.get().streaming.lowLatencyEnabled?c.get().streaming.retryIntervals[e]/t:c.get().streaming.retryIntervals[e]},getLiveDelay:h,getLiveCatchupLatencyThreshold:function(){try{var e=c.get().streaming.liveCatchup.latencyThreshold,t=h();if(null!==e&&!isNaN(e))return Math.max(e,t);var n=c.get().streaming.liveCatchup.minDrift,r=!isNaN(t)&&t?isNaN(n)?h():c.get().streaming.liveCatchup.minDrift+h():NaN;return r&&!isNaN(r)?Math.max(4*r,5):NaN}catch(e){return NaN}},addUTCTimingSource:p,removeUTCTimingSource:g,getUTCTimingSources:function(){return t},clearDefaultUTCTimingSources:function(){t=[]},restoreDefaultUTCTimingSources:function(){var e=c.get().streaming.utcSynchronization.defaultTimingSource;p(e.scheme,e.value)},setXHRWithCredentialsForType:function e(t,r){t?n[t]=!!r:Object.keys(n).forEach((function(t){e(t,r)}))},getXHRWithCredentialsForType:function(e){var t=n[e];return void 0===t?n.default:t},getDefaultUtcTimingSource:function(){return c.get().streaming.utcSynchronization.defaultTimingSource},reset:function(){}},t=[],n={default:!1},i=[],e}l.__dashjs_factory_name="MediaPlayerModel",t.default=i.default.getSingletonFactory(l)},"./src/streaming/models/MetricsModel.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/streaming/constants/MetricsConstants.js"),a=n("./src/streaming/vo/MetricsList.js"),s=n("./src/streaming/vo/metrics/HTTPRequest.js"),o=n("./src/streaming/vo/metrics/RepresentationSwitch.js"),u=n("./src/streaming/vo/metrics/BufferLevel.js"),l=n("./src/streaming/vo/metrics/BufferState.js"),c=n("./src/streaming/vo/metrics/DVRInfo.js"),d=n("./src/streaming/vo/metrics/DroppedFrames.js"),f=n("./src/streaming/vo/metrics/ManifestUpdate.js"),h=n("./src/streaming/vo/metrics/SchedulingInfo.js"),p=n("./src/core/EventBus.js"),g=n("./src/streaming/vo/metrics/RequestsQueue.js"),m=n("./src/core/events/Events.js"),y=n("./src/core/FactoryMaker.js");function v(e){var t,n,y=(e=e||{}).settings,v=this.context,_=Object(p.default)(v).getInstance();function T(){_.trigger(m.default.METRICS_CHANGED)}function b(e){_.trigger(m.default.METRIC_CHANGED,{mediaType:e}),T()}function E(e,t,n){_.trigger(m.default.METRIC_UPDATED,{mediaType:e,metric:t,value:n}),b(e)}function S(e,t,n){_.trigger(m.default.METRIC_ADDED,{mediaType:e,metric:t,value:n}),b(e)}function w(e,t){var r=null;return e?(n.hasOwnProperty(e)?r=n[e]:t||(r=new a.default,n[e]=r),r):r}function A(e,t,n){var r=w(e);null!==r&&(r[t].push(n),r[t].length>y.get().streaming.metrics.maxListDepth&&r[t].shift())}function I(e,t,n){A(e,t,n),S(e,t,n)}return t={clearCurrentMetricsForType:function(e){delete n[e],b(e)},clearAllCurrentMetrics:function(){n={},T()},getMetricsFor:w,addHttpRequest:function e(t,n,r,a,o,u,l,c,d,f,h,p,g,m,y){var v=new s.HTTPRequest;u&&u!==a&&(e(t,null,r,a,o,null,null,c,d,null,null,null,g,null,null),v.actualurl=u),v.tcpid=n,v.type=r,v.url=a,v.range=c,v.trequest=d,v.tresponse=f,v.responsecode=p,v._tfinish=h,v._stream=t,v._mediaduration=g,v._quality=o,v._responseHeaders=m,v._serviceLocation=l,y?y.forEach((function(e){!function(e,t,n,r,i){var a=new s.HTTPRequestTrace;a.s=t,a.d=n,a.b=r,a.t=i,e.trace.push(a),e.interval||(e.interval=0),e.interval+=n}(v,e.s,e.d,e.b,e.t)})):(delete v.interval,delete v.trace),I(t,i.default.HTTP_REQUEST,v)},addRepresentationSwitch:function(e,t,n,r,a){var s=new o.default;s.t=t,s.mt=n,s.to=r,a?s.lto=a:delete s.lto,I(e,i.default.TRACK_SWITCH,s)},addBufferLevel:function(e,t,n){var r=new u.default;r.t=t,r.level=n,I(e,i.default.BUFFER_LEVEL,r)},addBufferState:function(e,t,n){var r=new l.default;r.target=n,r.state=t,I(e,i.default.BUFFER_STATE,r)},addDVRInfo:function(e,t,n,r){var a=new c.default;a.time=t,a.range=r,a.manifestInfo=n,I(e,i.default.DVR_INFO,a)},addDroppedFrames:function(e,t){var n=new d.default,r=w(e).DroppedFrames;t&&(n.time=t.creationTime,n.droppedFrames=t.droppedVideoFrames,r.length>0&&r[r.length-1]==n||I(e,i.default.DROPPED_FRAMES,n))},addSchedulingInfo:function(e,t,n,r,a,s,o,u,l){var c=new h.default;c.mediaType=e,c.t=t,c.type=n,c.startTime=r,c.availabilityStartTime=a,c.duration=s,c.quality=o,c.range=u,c.state=l,I(e,i.default.SCHEDULING_INFO,c)},addRequestsQueue:function(e,t,n){var r=new g.default;r.loadingRequests=t,r.executedRequests=n,w(e).RequestsQueue=r,S(e,i.default.REQUESTS_QUEUE,r)},addManifestUpdate:function(e,t,n,a,s,o,u,l,c,d){var h=new f.ManifestUpdate;h.mediaType=e,h.type=t,h.requestTime=n,h.fetchTime=a,h.availabilityStartTime=s,h.presentationStartTime=o,h.clientTimeOffset=u,h.currentTime=l,h.buffered=c,h.latency=d,A(r.default.STREAM,i.default.MANIFEST_UPDATE,h),S(e,i.default.MANIFEST_UPDATE,h)},updateManifestUpdateInfo:function(e,t){if(e){for(var n in t)e[n]=t[n];E(e.mediaType,i.default.MANIFEST_UPDATE,e)}},addManifestUpdateStreamInfo:function(e,t,n,r,a){if(e){var s=new f.ManifestUpdateStreamInfo;s.id=t,s.index=n,s.start=r,s.duration=a,e.streamInfo.push(s),E(e.mediaType,i.default.MANIFEST_UPDATE_STREAM_INFO,e)}},addManifestUpdateRepresentationInfo:function(e,t,n,r,a,s,o,u){if(e&&e.representationInfo){var l=new f.ManifestUpdateRepresentationInfo;l.id=t,l.index=n,l.streamIndex=r,l.mediaType=a,l.startNumber=o,l.fragmentInfoType=u,l.presentationTimeOffset=s,e.representationInfo.push(l),E(e.mediaType,i.default.MANIFEST_UPDATE_TRACK_INFO,e)}},addPlayList:function(e){e.trace&&Array.isArray(e.trace)?e.trace.forEach((function(e){e.hasOwnProperty("subreplevel")&&!e.subreplevel&&delete e.subreplevel})):delete e.trace,I(r.default.STREAM,i.default.PLAY_LIST,e)},addDVBErrors:function(e){I(r.default.STREAM,i.default.DVB_ERRORS,e)}},n={},t}v.__dashjs_factory_name="MetricsModel",t.default=y.default.getSingletonFactory(v)},"./src/streaming/models/URIFragmentModel.js":function(e,t,n){n.r(t);var r=n("./src/streaming/vo/URIFragmentData.js"),i=n("./src/core/FactoryMaker.js");function a(){var e,t;return e={initialize:function(e){if(t=new r.default,!e)return null;var n=e.indexOf("#");if(-1!==n)for(var i=e.substr(n+1).split("&"),a=0,s=i.length;a<s;++a){var o=i[a],u=o.indexOf("=");if(-1!==u){var l=o.substring(0,u);t.hasOwnProperty(l)&&(t[l]=o.substr(u+1))}}},getURIFragmentData:function(){return t}},e}a.__dashjs_factory_name="URIFragmentModel",t.default=i.default.getSingletonFactory(a)},"./src/streaming/models/VideoModel.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/core/EventBus.js"),a=n("./src/core/events/Events.js"),s=n("./src/core/Debug.js"),o=n("./src/streaming/constants/Constants.js"),u=new Map([[o.default.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,"loadedmetadata"],[o.default.VIDEO_ELEMENT_READY_STATES.HAVE_CURRENT_DATA,"loadeddata"],[o.default.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,"canplay"],[o.default.VIDEO_ELEMENT_READY_STATES.HAVE_ENOUGH_DATA,"canplaythrough"]]);function l(){var e,t,n,r,l=this.context,c=Object(i.default)(l).getInstance(),d=[];function f(){n&&(n.playbackRate=1,n.removeEventListener("canplay",f))}function h(){return d.length>0}function p(){if(n&&h()&&0===n.playbackRate){var e=document.createEvent("Event");e.initEvent("waiting",!0,!1),n.dispatchEvent(e)}}function g(e,t){n&&n.addEventListener(e,t)}function m(e,t){n&&n.removeEventListener(e,t)}function y(){return n?n.readyState:NaN}function v(){return n?n.buffered:null}function _(e,t,r,i,a){if(n)for(var s=0;s<n.textTracks.length;s++)if(n.textTracks[s].kind===e&&(!t||n.textTracks[s].label==t)&&n.textTracks[s].language===r&&n.textTracks[s].isTTML===i&&n.textTracks[s].isEmbedded===a)return n.textTracks[s];return null}return e={initialize:function(){c.on(a.default.PLAYBACK_PLAYING,p,this)},setCurrentTime:function(e,t){var r,i;i=function(){if(n){if(n.currentTime===e)return;try{e=t?function(e){var t=v(),n=e,r=9999999999;if(t)for(var i=0;i<t.length;i++){var a=t.start(i),s=t.end(i),o=Math.abs(a-e),u=Math.abs(s-e);if(e>=a&&e<=s)return e;o<r&&(r=o,n=a),u<r&&(r=u,n=s)}return n}(e):e,n.currentTime=e}catch(t){0===n.readyState&&t.code===t.INVALID_STATE_ERR&&setTimeout((function(){n.currentTime=e}),400)}}},(r=o.default.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA)===o.default.VIDEO_ELEMENT_READY_STATES.HAVE_NOTHING||y()>=r?i():function(e,t){g(e,(function n(){m(e,n),t(e)}))}(u.get(r),i)},play:function(){if(n){n.autoplay=!0;var e=n.play();e&&e.catch&&"undefined"!=typeof Promise&&e.catch((function(e){"NotAllowedError"===e.name&&c.trigger(a.default.PLAYBACK_NOT_ALLOWED),t.warn("Caught pending play exception - continuing (".concat(e,")"))}))}},isPaused:function(){return n?n.paused:null},pause:function(){n&&(n.pause(),n.autoplay=!1)},isStalled:h,isSeeking:function(){return n?n.seeking:null},getTime:function(){return n?n.currentTime:null},getPlaybackRate:function(){return n?n.playbackRate:null},setPlaybackRate:function(e){n&&(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&n.readyState<=2&&e>0?n.addEventListener("canplay",f):n.playbackRate=e)},getPlayedRanges:function(){return n?n.played:null},getEnded:function(){return n?n.ended:null},setStallState:function(e,t){!function(e,t){t?function(e){null!==e&&n&&!n.seeking&&-1===d.indexOf(e)&&d.push(e)}(e):function(e){var t=d.indexOf(e);null!==e&&-1!==t&&d.splice(t,1)}(e)}(e,t)},getElement:function(){return n},setElement:function(e){if(!(null==e||e&&/^(VIDEO|AUDIO)$/i.test(e.nodeName)))throw"element is not video or audio DOM type!";(n=e)&&(n.preload="auto")},setSource:function(e){n&&(e?n.src=e:(n.removeAttribute("src"),n.load()))},getSource:function(){return n?n.src:null},getTTMLRenderingDiv:function(){return r},setTTMLRenderingDiv:function(e){(r=e).style.position="absolute",r.style.display="flex",r.style.overflow="hidden",r.style.pointerEvents="none",r.style.top=0,r.style.left=0},getPlaybackQuality:function(){if(!n)return null;var e="webkitDroppedFrameCount"in n&&"webkitDecodedFrameCount"in n,t=null;return"getVideoPlaybackQuality"in n?t=n.getVideoPlaybackQuality():e&&(t={droppedVideoFrames:n.webkitDroppedFrameCount,totalVideoFrames:n.webkitDroppedFrameCount+n.webkitDecodedFrameCount,creationTime:new Date}),t},addEventListener:g,removeEventListener:m,getReadyState:y,getBufferRange:v,getClientWidth:function(){return n?n.clientWidth:NaN},getClientHeight:function(){return n?n.clientHeight:NaN},getTextTracks:function(){return n?n.textTracks:[]},getTextTrack:_,addTextTrack:function(e,t,r,i,a){if(!n)return null;var s=_(e,t,r,i,a);return s||((s=n.addTextTrack(e,t,r)).isEmbedded=a,s.isTTML=i),s},appendChild:function(e){n&&(n.appendChild(e),void 0!==e.isTTML&&(n.textTracks[n.textTracks.length-1].isTTML=e.isTTML,n.textTracks[n.textTracks.length-1].isEmbedded=e.isEmbedded))},removeChild:function(e){n&&n.removeChild(e)},getVideoWidth:function(){return n?n.videoWidth:NaN},getVideoHeight:function(){return n?n.videoHeight:NaN},getVideoRelativeOffsetTop:function(){var e=n.parentNode.host||n.parentNode;return e?n.getBoundingClientRect().top-e.getBoundingClientRect().top:NaN},getVideoRelativeOffsetLeft:function(){var e=n.parentNode.host||n.parentNode;return e?n.getBoundingClientRect().left-e.getBoundingClientRect().left:NaN},reset:function(){c.off(a.default.PLAYBACK_PLAYING,p,this)}},t=Object(s.default)(l).getInstance().getLogger(e),e}l.__dashjs_factory_name="VideoModel",t.default=r.default.getSingletonFactory(l)},"./src/streaming/net/FetchLoader.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/core/Settings.js"),a=n("./src/streaming/constants/Constants.js");function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==o.return||o.return()}finally{if(i)throw a}}return n}}(e,t)||o(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){e=e||{};var t,n,r=this.context,u=e.requestModifier,l=e.lowLatencyThroughputModel,c=e.boxParser,d=Object(i.default)(r).getInstance();function f(e,t){e.reader.read().then(t).catch((function(t){e.onerror&&200===e.response.status&&e.onerror(t)}))}function h(e,t){try{if((e=e.filter((function(n){return n.bytes>t/4/e.length}))).length>1){var n=0,r=(e[e.length-1].ts-e[0].ts)/e.length;return e.forEach((function(t,i){var a=e[i+1];if(a){var s=a.ts-t.ts;n+=s<r?s:0}})),n}return null}catch(e){return null}}return t={load:function(e){var t,r=new Date,i=e.request,p=new Headers;if(i.range&&p.append("Range","bytes="+i.range),e.headers)for(var g in e.headers){var m=e.headers[g];m&&p.append(g,m)}i.requestStartDate||(i.requestStartDate=r),u&&u.modifyRequestHeader({setRequestHeader:function(e,t){p.append(e,t)}}),"function"==typeof window.AbortController&&(t=new AbortController,e.abortController=t,t.signal.onabort=e.onabort);var y={method:e.method,headers:p,credentials:e.withCredentials?"include":void 0,signal:t?t.signal:void 0},v=d.get().streaming.abr.fetchThroughputCalculationMode,_=Date.now(),T=0;new Promise((function(e){if(v===a.default.ABR_FETCH_THROUGHPUT_CALCULATION_AAST&&l&&(T=l.getThroughputCapacityDelayMS(i,1e3*n.getCurrentBufferLevel(i.mediaType))))return setTimeout(e,T);e()})).then((function(){var t=Date.now();fetch(e.url,y).then((function(r){e.response||(e.response={}),e.response.status=r.status,e.response.statusText=r.statusText,e.response.responseURL=r.url,r.ok||e.onerror();var u,d="",p=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=o(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}(r.headers.keys());try{for(p.s();!(u=p.n()).done;){var g=u.value;d+=g+": "+r.headers.get(g)+"\r\n"}}catch(e){p.e(e)}finally{p.f()}if(e.response.responseHeaders=d,!r.body)return r.arrayBuffer().then((function(t){e.response.response=t;var n={loaded:t.byteLength,total:t.byteLength,stream:!1};e.progress(n),e.onload(),e.onend()}));var m,y,b=parseInt(r.headers.get("Content-Length"),10),E=0,S=!1,w=new Uint8Array,A=0;if(v===a.default.ABR_FETCH_THROUGHPUT_CALCULATION_AAST&&l){var I=t,C=0,R=s(r.body.tee(),2),D=R[0],x=R[1];m=D.getReader(),y=[],m.read().then((function r(a){var s=a.value,o=a.done;if(C=Date.now(),s&&s.length){var u=C-I,c=s.length;y.push({chunkDownloadTimeRelativeMS:C-t,chunkDownloadDurationMS:u,chunkBytes:c,kbps:Math.round(8*c/(u/1e3)),bufferLevel:n.getCurrentBufferLevel(i.mediaType)})}if(o){var f=C-t,h=y.reduce((function(e,t){return e+t.chunkBytes}),0);return l.addMeasurement(i,f,y,_,T,d),void e.progress({loaded:h,total:h,lengthComputable:!0,time:l.getEstimatedDownloadDurationMS(i),stream:!0})}return I=Date.now(),m.read().then(r)})),e.reader=x.getReader()}else e.reader=r.body.getReader();var N=[],O=[],P=[],M=!0;f(e,(function t(n){var r=n.value;if(n.done){if(w){if(v!==a.default.ABR_FETCH_THROUGHPUT_CALCULATION_AAST){var i=null;v===a.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING&&(i=function(e,t){try{var n,r;n=e.filter((function(t,n){return n<e.length-1})),r=t.filter((function(e,n){return n<t.length-1}));var i=[];if(n.length>1){for(var a=0,s=0,o=0;o<n.length;o++)if(n[o]&&r[o]){var u=r[o].ts-n[o].ts;if(u>1)i.push(8*r[o].bytes/u);else{0===s&&(s=n[o].ts);var l=r[o].ts-s;l>1?(i.push(8*a/l),a=0,s=0):a+=r[o].bytes}}if(i.length>0)return i.reduce((function(e,t){return e+t}),0)/i.length}return null}catch(e){return null}}(O,P)),e.progress({loaded:E,total:isNaN(b)?E:b,lengthComputable:!0,time:h(N,E),throughput:i,stream:!0})}e.response.response=w.buffer}return e.onload(),void e.onend()}if(r&&r.length>0){w=function(e,t){if(0===e.length)return t;var n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}(w,r),E+=r.length,N.push({ts:Date.now(),bytes:r.length}),v===a.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING&&M&&c.findLastTopIsoBoxCompleted(["moof"],w,A).found&&(M=!1,O.push({ts:performance.now(),bytes:r.length}));var s=c.findLastTopIsoBoxCompleted(["moov","mdat"],w,A);if(s.found){var o,u=s.lastCompletedOffset+s.size;v!==a.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING||M||(M=!0,P.push({ts:performance.now(),bytes:w.length})),u===w.length?(o=w,w=new Uint8Array):(o=new Uint8Array(w.subarray(0,u)),w=w.subarray(u)),e.progress({data:o.buffer,lengthComputable:!1,noTrace:!0}),A=0}else A=s.lastCompletedOffset,S||(e.progress({lengthComputable:!1,noTrace:!0}),S=!0)}f(e,t)}))})).catch((function(t){e.onerror&&e.onerror(t)}))}))},abort:function(e){if(e.abortController)e.abortController.abort();else if(e.reader)try{e.reader.cancel(),e.onabort()}catch(e){}},calculateDownloadedTime:h,setup:function(e){n=e.dashMetrics}},t}l.__dashjs_factory_name="FetchLoader";var c=r.default.getClassFactory(l);t.default=c},"./src/streaming/net/HTTPLoader.js":function(e,t,n){n.r(t);var r=n("./src/streaming/net/XHRLoader.js"),i=n("./src/streaming/net/FetchLoader.js"),a=n("./src/streaming/vo/metrics/HTTPRequest.js"),s=n("./src/core/FactoryMaker.js"),o=n("./src/streaming/vo/DashJSError.js"),u=n("./src/streaming/models/CmcdModel.js"),l=n("./src/core/Utils.js"),c=n("./src/core/Debug.js"),d=n("./src/core/EventBus.js"),f=n("./src/core/events/Events.js"),h=n("./src/core/Settings.js"),p=n("./src/streaming/constants/Constants.js"),g=n("./src/streaming/models/LowLatencyThroughputModel.js");function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e){e=e||{};var t,n,s,y,v,_,T,b,E,S=this.context,w=e.errHandler,A=e.dashMetrics,I=e.mediaPlayerModel,C=e.requestModifier,R=e.boxParser,D=e.errors,x=e.requestTimeout||0,N=Object(d.default)(S).getInstance(),O=Object(h.default)(S).getInstance();function P(e,t){var u,c=e.request,d=[],h=!0,g=!0,m=new Date,E=m,D=0;if(!C||!A||!w)throw new Error("config object is not correct or missing");var M,k=function(e){if(g=!1,c.requestStartDate=m,c.requestEndDate=new Date,c.firstByteDate=c.firstByteDate||m,!c.checkExistenceOnly){var t=u.response?u.response.responseURL:null,n=u.response?u.response.status:null,r=u.response&&u.response.getAllResponseHeaders?u.response.getAllResponseHeaders():u.response?u.response.responseHeaders:[];A.addHttpRequest(c,t,n,r,e?d:null),c.type===a.HTTPRequest.MPD_TYPE&&A.addManifestUpdate(c)}},L=function(){if(-1!==n.indexOf(u)&&(n.splice(n.indexOf(u),1),g))if(k(!1),t>0){try{O.get().streaming.utcSynchronization.enableBackgroundSyncAfterSegmentDownloadError&&c.type===a.HTTPRequest.MEDIA_SEGMENT_TYPE&&I.getRetryAttemptsForType(a.HTTPRequest.MEDIA_SEGMENT_TYPE)===t&&N.trigger(f.default.ATTEMPT_BACKGROUND_SYNC)}catch(e){}t--;var r={config:e};y.push(r),r.timeout=setTimeout((function(){-1!==y.indexOf(r)&&(y.splice(y.indexOf(r),1),P(e,t))}),I.getRetryIntervalsForType(c.type))}else{if(c.type===a.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE)return;w.error(new o.default(v[c.type],c.url+" is not available",{request:c,response:u.response})),e.error&&e.error(c,"error",u.response.statusText),e.complete&&e.complete(c,u.response.statusText)}};O.get().streaming.lowLatencyEnabled&&window.fetch&&"arraybuffer"===c.responseType&&c.type===a.HTTPRequest.MEDIA_SEGMENT_TYPE?(M=Object(i.default)(S).create({requestModifier:C,lowLatencyThroughputModel:T,boxParser:R})).setup({dashMetrics:A}):M=Object(r.default)(S).create({requestModifier:C});var F=null,U=C.modifyRequestURL(c.url);if(O.get().streaming.cmcd&&O.get().streaming.cmcd.enabled){var B=O.get().streaming.cmcd.mode;if(B===p.default.CMCD_MODE_QUERY){var j=function(e){try{var t=[],n=_.getQueryParameter(e);return n&&t.push(n),t}catch(e){return[]}}(c);U=l.default.addAditionalQueryParameterToUrl(U,j)}else B===p.default.CMCD_MODE_HEADER&&(F=_.getHeaderParameters(c))}c.url=U;var q=c.checkExistenceOnly?a.HTTPRequest.HEAD:a.HTTPRequest.GET,H=I.getXHRWithCredentialsForType(c.type);u={url:U,method:q,withCredentials:H,request:c,onload:function(){u.response.status>=200&&u.response.status<=299&&(k(!0),e.success&&e.success(u.response.response,u.response.statusText,u.response.responseURL),e.complete&&e.complete(c,u.response.statusText))},onend:L,onerror:L,progress:function(t){var n=new Date;h&&(h=!1,(!t.lengthComputable||t.lengthComputable&&t.total!==t.loaded)&&(c.firstByteDate=n)),t.lengthComputable&&(c.bytesLoaded=t.loaded,c.bytesTotal=t.total),t.noTrace||(d.push({s:E,d:t.time?t.time:n.getTime()-E.getTime(),b:[t.loaded?t.loaded-D:0],t:t.throughput}),E=n,D=t.loaded),e.progress&&t&&e.progress(t)},onabort:function(){e.abort&&e.abort(c)},ontimeout:function(e){var t;if(e.lengthComputable){var n=e.loaded/e.total*100;t="Request timeout: loaded: "+e.loaded+", out of: "+e.total+" : "+n.toFixed(3)+"% Completed"}else t="Request timeout: non-computable download size";b.warn(t)},loader:M,timeout:x,headers:F};var G=(new Date).getTime();if(isNaN(c.delayLoadingTime)||G>=c.delayLoadingTime)n.push(u),M.load(u);else{var V={httpRequest:u};s.push(V),V.delayTimeout=setTimeout((function(){if(-1!==s.indexOf(V)){s.splice(s.indexOf(V),1);try{m=new Date,E=m,n.push(V.httpRequest),M.load(V.httpRequest)}catch(e){V.httpRequest.onerror()}}}),c.delayLoadingTime-G)}}return t={load:function(e){e.request?P(e,I.getRetryAttemptsForType(e.request.type)):e.error&&e.error(e.request,"error")},abort:function(){y.forEach((function(e){clearTimeout(e.timeout),e.config.request&&e.config.abort&&e.config.abort(e.config.request)})),y=[],s.forEach((function(e){return clearTimeout(e.delayTimeout)})),s=[],n.forEach((function(e){e.request.type!==a.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE&&(e.onloadend=e.onerror=e.onprogress=void 0,e.loader.abort(e))})),n=[]}},b=Object(c.default)(S).getInstance().getLogger(t),n=[],s=[],y=[],_=Object(u.default)(S).getInstance(),T=Object(g.default)(S).getInstance(),m(E={},a.HTTPRequest.MPD_TYPE,D.DOWNLOAD_ERROR_ID_MANIFEST_CODE),m(E,a.HTTPRequest.XLINK_EXPANSION_TYPE,D.DOWNLOAD_ERROR_ID_XLINK_CODE),m(E,a.HTTPRequest.INIT_SEGMENT_TYPE,D.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE),m(E,a.HTTPRequest.MEDIA_SEGMENT_TYPE,D.DOWNLOAD_ERROR_ID_CONTENT_CODE),m(E,a.HTTPRequest.INDEX_SEGMENT_TYPE,D.DOWNLOAD_ERROR_ID_CONTENT_CODE),m(E,a.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,D.DOWNLOAD_ERROR_ID_CONTENT_CODE),m(E,a.HTTPRequest.OTHER_TYPE,D.DOWNLOAD_ERROR_ID_CONTENT_CODE),v=E,t}y.__dashjs_factory_name="HTTPLoader";var v=s.default.getClassFactory(y);t.default=v},"./src/streaming/net/SchemeLoaderFactory.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/net/HTTPLoader.js");function a(){var e;function t(){e={}}function n(){t()}return n(),{getLoader:function(t){for(var n in e)if(e.hasOwnProperty(n)&&t.startsWith(n))return e[n];return i.default},registerLoader:function(t,n){e[t]=n},unregisterLoader:function(t){e[t]&&delete e[t]},unregisterAllLoader:t,reset:n}}a.__dashjs_factory_name="SchemeLoaderFactory";var s=r.default.getSingletonFactory(a);t.default=s},"./src/streaming/net/URLLoader.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/net/SchemeLoaderFactory.js");function a(e){e=e||{};var t,n,r=this.context;return t=Object(i.default)(r).getInstance(),{load:function(i){if(!n){var a=t.getLoader(i&&i.request?i.request.url:null);n=a(r).create({errHandler:e.errHandler,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,dashMetrics:e.dashMetrics,boxParser:e.boxParser?e.boxParser:null,constants:e.constants?e.constants:null,dashConstants:e.dashConstants?e.dashConstants:null,urlUtils:e.urlUtils?e.urlUtils:null,requestTimeout:isNaN(e.requestTimeout)?0:e.requestTimeout,errors:e.errors})}n.load(i)},abort:function(){n&&n.abort()}}}a.__dashjs_factory_name="URLLoader";var s=r.default.getClassFactory(a);t.default=s},"./src/streaming/net/XHRLoader.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js");function i(e){var t=(e=e||{}).requestModifier;return{load:function(e){var n=new Date,r=e.request,i=new XMLHttpRequest;if(i.open(e.method,e.url,!0),r.responseType&&(i.responseType=r.responseType),r.range&&i.setRequestHeader("Range","bytes="+r.range),r.requestStartDate||(r.requestStartDate=n),t&&(i=t.modifyRequestHeader(i)),e.headers)for(var a in e.headers){var s=e.headers[a];s&&i.setRequestHeader(a,s)}i.withCredentials=e.withCredentials,i.onload=e.onload,i.onloadend=e.onend,i.onerror=e.onerror,i.onprogress=e.progress,i.onabort=e.onabort,i.ontimeout=e.ontimeout,i.timeout=e.timeout,i.send(),e.response=i},abort:function(e){var t=e.response;t.onloadend=t.onerror=t.onprogress=void 0,t.abort()}}}i.__dashjs_factory_name="XHRLoader";var a=r.default.getClassFactory(i);t.default=a},"./src/streaming/protection/CommonEncryption.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i={attributes:["Laurl","laurl"],prefixes:["clearkey","dashif"]},a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,a;return t=e,a=[{key:"findCencContentProtection",value:function(e){for(var t=null,n=0;n<e.length;++n){var r=e[n];"urn:mpeg:dash:mp4protection:2011"!==r.schemeIdUri.toLowerCase()||"cenc"!==r.value.toLowerCase()&&"cbcs"!==r.value.toLowerCase()||(t=r)}return t}},{key:"getPSSHData",value:function(e){var t=8,n=new DataView(e),r=n.getUint8(t);return t+=20,r>0&&(t+=4+16*n.getUint32(t)),t+=4,e.slice(t)}},{key:"getPSSHForKeySystem",value:function(t,n){var r=e.parsePSSHList(n);return t&&r.hasOwnProperty(t.uuid.toLowerCase())?r[t.uuid.toLowerCase()]:null}},{key:"parseInitDataFromContentProtection",value:function(e,t){return"pssh"in e?(e.pssh.__text=e.pssh.__text.replace(/\r?\n|\r/g,"").replace(/\s+/g,""),t.decodeArray(e.pssh.__text).buffer):null}},{key:"parsePSSHList",value:function(e){if(null==e)return[];for(var t=new DataView(e.buffer||e),n={},r=0;;){var i,a,s=void 0,o=r;if(r>=t.buffer.byteLength)break;if(i=r+t.getUint32(r),r+=4,1886614376===t.getUint32(r))if(r+=4,0===(a=t.getUint8(r))||1===a){r++,r+=3,s="";var u=void 0,l=void 0;for(u=0;u<4;u++)s+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=4,s+="-",u=0;u<2;u++)s+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=2,s+="-",u=0;u<2;u++)s+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=2,s+="-",u=0;u<2;u++)s+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=2,s+="-",u=0;u<6;u++)s+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;r+=6,r+=4,n[s=s.toLowerCase()]=t.buffer.slice(o,i),r=i}else r=i;else r=i}return n}},{key:"getLicenseServerUrlFromMediaInfo",value:function(e,t){try{if(!e||0===e.length)return null;for(var n=0,r=null;n<e.length&&!r;){var a=e[n];if(a&&a.contentProtection&&a.contentProtection.length>0){var s=a.contentProtection.filter((function(e){return e.schemeIdUri&&e.schemeIdUri===t}));if(s&&s.length>0)for(var o=0;o<s.length&&!r;){for(var u=s[o],l=0;l<i.attributes.length&&!r;){for(var c=0,d=i.attributes[l];c<i.prefixes.length&&!r;){var f=i.prefixes[c];u[d]&&u[d].__prefix&&u[d].__prefix===f&&u[d].__text&&(r=u[d].__text),c+=1}l+=1}o+=1}}n+=1}return r}catch(e){return null}}}],(n=null)&&r(t.prototype,n),a&&r(t,a),e}();t.default=a},"./src/streaming/protection/Protection.js":function(e,t,n){n.r(t);var r=n("./src/streaming/protection/controllers/ProtectionController.js"),i=n("./src/streaming/protection/controllers/ProtectionKeyController.js"),a=n("./src/streaming/protection/ProtectionEvents.js"),s=n("./src/streaming/protection/errors/ProtectionErrors.js"),o=n("./src/streaming/protection/models/ProtectionModel_21Jan2015.js"),u=n("./src/streaming/protection/models/ProtectionModel_3Feb2014.js"),l=n("./src/streaming/protection/models/ProtectionModel_01b.js"),c=[{generateKeyRequest:"generateKeyRequest",addKey:"addKey",cancelKeyRequest:"cancelKeyRequest",needkey:"needkey",keyerror:"keyerror",keyadded:"keyadded",keymessage:"keymessage"},{generateKeyRequest:"webkitGenerateKeyRequest",addKey:"webkitAddKey",cancelKeyRequest:"webkitCancelKeyRequest",needkey:"webkitneedkey",keyerror:"webkitkeyerror",keyadded:"webkitkeyadded",keymessage:"webkitkeymessage"}],d=[{setMediaKeys:"setMediaKeys",MediaKeys:"MediaKeys",release:"close",needkey:"needkey",error:"keyerror",message:"keymessage",ready:"keyadded",close:"keyclose"},{setMediaKeys:"msSetMediaKeys",MediaKeys:"MSMediaKeys",release:"close",needkey:"msneedkey",error:"mskeyerror",message:"mskeymessage",ready:"mskeyadded",close:"mskeyclose"}];function f(){var e,t=this.context;function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];if("function"==typeof e[r[Object.keys(r)[0]]])return r}return null}return e={createProtectionSystem:function(a){var s=null,f=Object(i.default)(t).getInstance();f.setConfig({debug:a.debug,BASE64:a.BASE64}),f.initialize();var h=function(r){var i=r.debug,a=i.getLogger(e),s=r.eventBus,f=r.errHandler,h=r.videoModel?r.videoModel.getElement():null;return h&&void 0===h.onencrypted||h&&void 0===h.mediaKeys?n(h,d)?(a.info("EME detected on this user agent! (ProtectionModel_3Feb2014)"),Object(u.default)(t).create({debug:i,eventBus:s,events:r.events,api:n(h,d)})):n(h,c)?(a.info("EME detected on this user agent! (ProtectionModel_01b)"),Object(l.default)(t).create({debug:i,eventBus:s,errHandler:f,events:r.events,api:n(h,c)})):(a.warn("No supported version of EME detected on this user agent! - Attempts to play encrypted content will fail!"),null):(a.info("EME detected on this user agent! (ProtectionModel_21Jan2015)"),Object(o.default)(t).create({debug:i,eventBus:s,events:r.events}))}(a);return!s&&h&&(s=Object(r.default)(t).create({protectionModel:h,protectionKeyController:f,eventBus:a.eventBus,debug:a.debug,events:a.events,BASE64:a.BASE64,constants:a.constants,cmcdModel:a.cmcdModel,settings:a.settings}),a.capabilities.setEncryptedMediaSupported(!0)),s}},e}f.__dashjs_factory_name="Protection";var h=dashjs.FactoryMaker.getClassFactory(f);h.events=a.default,h.errors=s.default,dashjs.FactoryMaker.updateClassFactory(f.__dashjs_factory_name,h),t.default=h},"./src/streaming/protection/ProtectionEvents.js":function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=s(e);if(t){var a=s(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}n.r(t);var o=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,e);var t=a(n);function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=t.call(this)).INTERNAL_KEY_MESSAGE="internalKeyMessage",e.INTERNAL_KEY_STATUS_CHANGED="internalkeyStatusChanged",e.KEY_ADDED="public_keyAdded",e.KEY_ERROR="public_keyError",e.KEY_MESSAGE="public_keyMessage",e.KEY_SESSION_CLOSED="public_keySessionClosed",e.KEY_SESSION_CREATED="public_keySessionCreated",e.KEY_SESSION_REMOVED="public_keySessionRemoved",e.KEY_STATUSES_CHANGED="public_keyStatusesChanged",e.KEY_SYSTEM_ACCESS_COMPLETE="public_keySystemAccessComplete",e.KEY_SYSTEM_SELECTED="public_keySystemSelected",e.LICENSE_REQUEST_COMPLETE="public_licenseRequestComplete",e.LICENSE_REQUEST_SENDING="public_licenseRequestSending",e.NEED_KEY="needkey",e.PROTECTION_CREATED="public_protectioncreated",e.PROTECTION_DESTROYED="public_protectiondestroyed",e.SERVER_CERTIFICATE_UPDATED="serverCertificateUpdated",e.TEARDOWN_COMPLETE="protectionTeardownComplete",e.VIDEO_ELEMENT_SELECTED="videoElementSelected",e.KEY_SESSION_UPDATED="public_keySessionUpdated",e}return n}(n("./src/core/events/EventsBase.js").default));t.default=o},"./src/streaming/protection/controllers/ProtectionController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/protection/CommonEncryption.js"),i=n("./src/streaming/protection/vo/MediaCapability.js"),a=n("./src/streaming/protection/vo/KeySystemConfiguration.js"),s=n("./src/streaming/protection/errors/ProtectionErrors.js"),o=n("./src/streaming/vo/DashJSError.js"),u=n("./src/streaming/protection/vo/LicenseRequest.js"),l=n("./src/streaming/protection/vo/LicenseResponse.js"),c=n("./src/streaming/vo/metrics/HTTPRequest.js"),d=n("./src/core/Utils.js"),f=n("./src/streaming/constants/Constants.js"),h=n("./src/core/FactoryMaker.js");function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function g(e){var t,n,h,g,m,y,v,_,T,b,E,S=(e=e||{}).protectionKeyController,w=e.protectionModel,A=e.eventBus,I=e.events,C=e.debug,R=e.BASE64,D=e.constants,x=[],N=e.cmcdModel,O=e.settings;function P(){if(!(A&&A.hasOwnProperty("on")&&S&&S.hasOwnProperty("getSupportedKeySystemsFromContentProtection")))throw new Error("Missing config parameter(s)")}function M(e,t){T?h.push(e):_?_&&function(e){var t=e.findIndex((function(e){return e.ks===_})),n=e[t];-1!==t&&n.initData&&k(n)}(e):function(e,t){T=!0;var r,i=[];h.push(e);for(var a=0;a<e.length;a++){var u=q(e[a]);i.push({ks:e[a].ks,configs:[u]})}w.requestKeySystemAccess(i).then((function(e){return r=e.data,n.info("DRM: KeySystem Access Granted ("+r.keySystem.systemString+")! Selecting key system..."),w.selectKeySystem(r)})).then((function(e){if(_=e,T=!1,w){A.trigger(I.KEY_SYSTEM_SELECTED,{data:r});var t,n=U(_);n&&n.serverCertificate&&n.serverCertificate.length>0&&w.setServerCertificate(R.decodeArray(n.serverCertificate).buffer);for(var i=0;i<h.length;i++)for(t=0;t<h[i].length;t++)if(_===h[i][t].ks){k(h[i][t]);break}}})).catch((function(e){_=null,T=!1,t||A.trigger(I.KEY_SYSTEM_SELECTED,{data:null,error:new o.default(s.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,s.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+"Error selecting key system! -- "+e.error)})}))}(e,t)}function k(e){if(S.isClearKey(_)&&e.protData&&e.protData.hasOwnProperty("clearkeys")){var t={kids:Object.keys(e.protData.clearkeys)};e.initData=(new TextEncoder).encode(JSON.stringify(t))}e.sessionId?L(e):null!==e.initData&&F(e)}function L(e){P(),w.loadKeySession(e)}function F(e){var t=r.default.getPSSHForKeySystem(_,e?e.initData:null);if(t){if(function(e){if(!e)return!1;try{for(var t=w.getSessions(),n=0;n<t.length;n++)if(t[n].getKeyId()===e)return!0;return!1}catch(e){return!1}}(e.keyId))return;if(B(t))return;try{e.initData=t,w.createKeySession(e)}catch(e){A.trigger(I.KEY_SESSION_CREATED,{data:null,error:new o.default(s.default.KEY_SESSION_CREATED_ERROR_CODE,s.default.KEY_SESSION_CREATED_ERROR_MESSAGE+e.message)})}}else e&&e.initData?w.createKeySession(e):A.trigger(I.KEY_SESSION_CREATED,{data:null,error:new o.default(s.default.KEY_SESSION_CREATED_ERROR_CODE,s.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Selected key system is "+(_?_.systemString:null)+". needkey/encrypted event contains no initData corresponding to that key system!")})}function U(e){if(e){var t=e.systemString;if(m)return t in m?m[t]:null}return null}function B(e){if(!e)return!1;try{for(var t=w.getAllInitData(),r=0;r<t.length;r++)if(S.initDataEquals(e,t[r]))return n.debug("DRM: Ignoring initData because we have already seen it!"),!0;return!1}catch(e){return!1}}function j(e){P(),e?(w.setMediaElement(e),A.on(I.NEED_KEY,W,t)):null===e&&(w.setMediaElement(e),A.off(I.NEED_KEY,W,t))}function q(e){var t=e.protData,n=[],r=[],s=t&&t.audioRobustness&&t.audioRobustness.length>0?t.audioRobustness:v,o=t&&t.videoRobustness&&t.videoRobustness.length>0?t.videoRobustness:v,u=e.sessionType,l=t&&t.distinctiveIdentifier?t.distinctiveIdentifier:"optional",c=t&&t.persistentState?t.persistentState:"temporary"===u?"optional":"required";return g.forEach((function(e){e.type===D.AUDIO?n.push(new i.default(e.codec,s)):e.type===D.VIDEO&&r.push(new i.default(e.codec,o))})),new a.default(n,r,l,c,[u])}function H(e){e.error?A.trigger(I.KEY_STATUSES_CHANGED,{data:null,error:e.error}):n.debug("DRM: key status = "+e.status)}function G(e){n.debug("DRM: onKeyMessage");var t=e.data;A.trigger(I.KEY_MESSAGE,{data:t});var i=t.messageType?t.messageType:"license-request",a=t.message,f=t.sessionToken,h=U(_),m=S.getLicenseServerModelInstance(_,h,i),y={sessionToken:f,messageType:i};if(a&&0!==a.byteLength){if(!m)return n.debug("DRM: License server request not required for this message (type = "+e.data.messageType+"). Session ID = "+f.getSessionId()),void V(y);if(S.isClearKey(_)){var v=S.processClearKeyLicenseRequest(_,h,a);if(v)return n.debug("DRM: ClearKey license request handled by application!"),V(y),void w.updateKeySession(f,v)}!function(e,t,n){var i=e.sessionToken,a=e.messageType?e.messageType:"license-request",f={sessionToken:i,messageType:a},h=_?_.systemString:null,m=function(e,t,n,i,a){var s=null,o=i.message;if(e&&e.serverURL){var u=e.serverURL;"string"==typeof u&&""!==u?s=u:"object"===p(u)&&u.hasOwnProperty(t)&&(s=u[t])}else if(e&&e.laURL&&""!==e.laURL)s=e.laURL;else if(!(s=r.default.getLicenseServerUrlFromMediaInfo(g,_.schemeIdURI))&&!S.isClearKey(_)){var l=r.default.getPSSHData(n.initData);(s=_.getLicenseServerURLFromInitData(l))||(s=i.laURL)}return a.getServerURLFromMessage(s,o,t)}(n,a,i,e,t);if(m){var y={},v=!1;n&&z(y,n.httpRequestHeaders);var T=e.message;z(y,_.getRequestHeadersFromMessage(T)),Object.keys(y).forEach((function(e){"authorization"===e.toLowerCase()&&(v=!0)})),n&&"boolean"==typeof n.withCredentials&&(v=n.withCredentials);var A=function(e){if(w)if(e.status>=200&&e.status<=299){var n=d.default.parseHttpHeaders(e.getAllResponseHeaders?e.getAllResponseHeaders():null),r=new l.default(e.responseURL,n,e.response);K(E,r).then((function(){var n=t.getLicenseMessage(r.data,h,a);null!==n?(V(f),w.updateKeySession(i,n)):Z(e,f,h,a,t)}))}else Z(e,f,h,a,t)},I=function(e){V(f,new o.default(s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+h+' update, XHR aborted. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},C=function(e){V(f,new o.default(s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+h+' update, XHR error. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},R=_.getLicenseRequestFromMessage(T),D=t.getHTTPMethod(a),x=t.getResponseType(h,a),N=n&&!isNaN(n.httpTimeout)?n.httpTimeout:8e3,P=i.getSessionId()||null,M=new u.default(m,D,x,y,v,a,P,R),k=isNaN(O.get().streaming.retryAttempts[c.HTTPRequest.LICENSE])?3:O.get().streaming.retryAttempts[c.HTTPRequest.LICENSE];K(b,M).then((function(){Y(M,k,N,A,I,C)}))}else V(f,new o.default(s.default.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE))}(t,m,h)}else V(y,new o.default(s.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE))}function V(e,t){A.trigger(I.LICENSE_REQUEST_COMPLETE,{data:e,error:t})}function Y(e,t,r,i,a,s){var o=new XMLHttpRequest;if(O.get().streaming.cmcd&&O.get().streaming.cmcd.enabled&&O.get().streaming.cmcd.mode===f.default.CMCD_MODE_QUERY){var u=N.getQueryParameter({url:e.url,type:c.HTTPRequest.LICENSE});u&&(e.url=d.default.addAditionalQueryParameterToUrl(e.url,[u]))}for(var l in o.open(e.method,e.url,!0),o.responseType=e.responseType,o.withCredentials=e.withCredentials,r>0&&(o.timeout=r),e.headers)o.setRequestHeader(l,e.headers[l]);if(O.get().streaming.cmcd&&O.get().streaming.cmcd.enabled&&O.get().streaming.cmcd.mode===f.default.CMCD_MODE_HEADER){var h=N.getHeaderParameters({url:e.url,type:c.HTTPRequest.LICENSE});if(h)for(var p in h){var g=h[p];g&&o.setRequestHeader(p,g)}}var m=function(){t--;var n=isNaN(O.get().streaming.retryIntervals[c.HTTPRequest.LICENSE])?1e3:O.get().streaming.retryIntervals[c.HTTPRequest.LICENSE];setTimeout((function(){Y(e,t,r,i,a,s)}),n)};o.onload=function(){this.status>=200&&this.status<=299||t<=0?i(this):(n.warn("License request failed ("+this.status+"). Retrying it... Pending retries: "+t),m())},o.ontimeout=o.onerror=function(){t<=0?s(this):(n.warn("License request network request failed . Retrying it... Pending retries: "+t),m())},o.onabort=function(){a(this)},A.trigger(I.LICENSE_REQUEST_SENDING,{url:e.url,headers:e.headers,payload:e.data,sessionId:e.sessionId}),o.send(e.data)}function z(e,t){if(t)for(var n in t)e[n]=t[n]}function Z(e,t,n,r,i){var a=e.response?i.getErrorResponse(e.response,n,r):"NONE";V(t,new o.default(s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+n+' update, XHR complete. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState+". Response is "+a))}function K(e,t){return e?e.reduce((function(e,n){return e.then((function(){return n(t)}))}),Promise.resolve()):Promise.resolve()}function W(e,t){if(!O.get().streaming.protection.ignoreEmeEncryptedEvent){if(n.debug("DRM: onNeedKey"),"cenc"!==e.key.initDataType)return void n.warn("DRM: Only 'cenc' initData is supported! Ignoring initData of type: "+e.key.initDataType);if(0===g.length&&(n.warn("DRM: onNeedKey called before initializeForMedia, wait until initialized"),(t=void 0===t?1:t+1)<5))return void x.push(setTimeout((function(){W(e,t)}),500));var i=e.key.initData;if(ArrayBuffer.isView(i)&&(i=i.buffer),_){var a=r.default.getPSSHForKeySystem(_,i);if(a&&B(a))return}n.debug("DRM: initData:",String.fromCharCode.apply(null,new Uint8Array(i)));var s=S.getSupportedKeySystemsFromSegmentPssh(i,m,y);if(0===s.length)return void n.debug("DRM: Received needkey event with initData, but we don't support any of the key systems!");M(s,!1)}}return t={initializeForMedia:function(e){if(!e)throw new Error("mediaInfo can not be null or undefined");P(),g.push(e);var t=S.getSupportedKeySystemsFromContentProtection(e.contentProtection,m,y);(t=t.sort((function(e,n){return(m&&m[e.ks.systemString]&&m[e.ks.systemString].priority>=0?m[e.ks.systemString].priority:t.length)-(m&&m[n.ks.systemString]&&m[n.ks.systemString].priority>=0?m[n.ks.systemString].priority:t.length)})))&&t.length>0&&M(t,!0)},clearMediaInfoArray:function(){g=[]},createKeySession:F,loadKeySession:L,removeKeySession:function(e){P(),w.removeKeySession(e)},closeKeySession:function(e){P(),w.closeKeySession(e)},setServerCertificate:function(e){P(),w.setServerCertificate(e)},setMediaElement:j,setSessionType:function(e){y=e},setRobustnessLevel:function(e){v=e},setProtectionData:function(e){m=e,S.setProtectionData(e)},getSupportedKeySystemsFromContentProtection:function(e){return P(),S.getSupportedKeySystemsFromContentProtection(e,m,y)},getKeySystems:function(){return S?S.getKeySystems():[]},setKeySystems:function(e){S&&S.setKeySystems(e)},setLicenseRequestFilters:function(e){b=e},setLicenseResponseFilters:function(e){E=e},stop:function(){w&&w.stop()},reset:function(){A.off(I.INTERNAL_KEY_MESSAGE,G,t),A.off(I.INTERNAL_KEY_STATUS_CHANGED,H,t),P(),b=[],E=[],j(null),_=null,T=!1,w&&(w.reset(),w=null),x.forEach((function(e){return clearTimeout(e)})),x=[],g=[],h=[]}},n=C.getLogger(t),h=[],g=[],y="temporary",v="",b=[],E=[],A.on(I.INTERNAL_KEY_MESSAGE,G,t),A.on(I.INTERNAL_KEY_STATUS_CHANGED,H,t),t}g.__dashjs_factory_name="ProtectionController",t.default=h.default.getClassFactory(g)},"./src/streaming/protection/controllers/ProtectionKeyController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/protection/CommonEncryption.js"),i=n("./src/streaming/protection/drm/KeySystemClearKey.js"),a=n("./src/streaming/protection/drm/KeySystemW3CClearKey.js"),s=n("./src/streaming/protection/drm/KeySystemWidevine.js"),o=n("./src/streaming/protection/drm/KeySystemPlayReady.js"),u=n("./src/streaming/protection/servers/DRMToday.js"),l=n("./src/streaming/protection/servers/PlayReady.js"),c=n("./src/streaming/protection/servers/Widevine.js"),d=n("./src/streaming/protection/servers/ClearKey.js"),f=n("./src/streaming/constants/ProtectionConstants.js");function h(){var e,t,n,h,p,g,m,y=this.context;function v(e,t){return t&&e in t?t[e]:null}function _(e,t){return e&&e.sessionId?e.sessionId:t&&t.sessionId?t.sessionId:null}function T(e,t){return e&&e.sessionType?e.sessionType:t}return e={initialize:function(){var e;h=[],e=Object(o.default)(y).getInstance({BASE64:p}),h.push(e),e=Object(s.default)(y).getInstance({BASE64:p}),h.push(e),e=Object(i.default)(y).getInstance({BASE64:p}),h.push(e),g=e,e=Object(a.default)(y).getInstance({BASE64:p,debug:t}),h.push(e),m=e},setProtectionData:function(e){for(var t,n,r=0;r<h.length;r++){var i=h[r];i.hasOwnProperty("init")&&i.init((t=i.systemString,n=void 0,n=null,e&&(n=t in e?e[t]:null),n))}},isClearKey:function(e){return e===g||e===m},initDataEquals:function(e,t){if(e.byteLength===t.byteLength){for(var n=new Uint8Array(e),r=new Uint8Array(t),i=0;i<n.length;i++)if(n[i]!==r[i])return!1;return!0}return!1},getKeySystems:function(){return h},setKeySystems:function(e){h=e},getKeySystemBySystemString:function(e){for(var t=0;t<h.length;t++)if(h[t].systemString===e)return h[t];return null},getSupportedKeySystemsFromContentProtection:function(e,t,n){var i,a,s,o,u=[];if(e){var l=r.default.findCencContentProtection(e);for(s=0;s<h.length;++s){var c=v((a=h[s]).systemString,t);for(o=0;o<e.length;++o)if((i=e[o]).schemeIdUri.toLowerCase()===a.schemeIdURI){var d=a.getInitData(i,l);u.push({ks:h[s],keyId:i.keyId,initData:d,protData:c,cdmData:a.getCDMData(c?c.cdmData:null),sessionId:_(c,i),sessionType:T(c,n)})}}}return u},getSupportedKeySystemsFromSegmentPssh:function(e,t,n){for(var i,a=[],s=r.default.parsePSSHList(e),o=0;o<h.length;++o){var u=v((i=h[o]).systemString,t);i.uuid in s&&a.push({ks:i,initData:s[i.uuid],protData:u,cdmData:i.getCDMData(u?u.cdmData:null),sessionId:_(u),sessionType:T(u,n)})}return a},getLicenseServerModelInstance:function(e,t,n){if("license-release"===n||"individualization-request"===n)return null;var r=null;return t&&t.hasOwnProperty("drmtoday")?r=Object(u.default)(y).getInstance({BASE64:p}):e.systemString===f.default.WIDEVINE_KEYSTEM_STRING?r=Object(c.default)(y).getInstance():e.systemString===f.default.PLAYREADY_KEYSTEM_STRING?r=Object(l.default)(y).getInstance():e.systemString===f.default.CLEARKEY_KEYSTEM_STRING&&(r=Object(d.default)(y).getInstance()),r},processClearKeyLicenseRequest:function(e,t,r){try{return e.getClearKeysFromProtectionData(t,r)}catch(e){return n.error("Failed to retrieve clearkeys from ProtectionData"),null}},setConfig:function(r){r&&(r.debug&&(t=r.debug,n=t.getLogger(e)),r.BASE64&&(p=r.BASE64))}},e}h.__dashjs_factory_name="ProtectionKeyController",t.default=dashjs.FactoryMaker.getSingletonFactory(h)},"./src/streaming/protection/drm/KeySystemClearKey.js":function(e,t,n){n.r(t);var r=n("./src/streaming/protection/vo/KeyPair.js"),i=n("./src/streaming/protection/vo/ClearKeyKeySet.js"),a=n("./src/streaming/protection/CommonEncryption.js"),s=n("./src/streaming/constants/ProtectionConstants.js"),o="e2719d58-a985-b3c9-781a-b030af78d30e",u=s.default.CLEARKEY_KEYSTEM_STRING,l="urn:uuid:"+o;function c(e){var t,n=(e=e||{}).BASE64;return t={uuid:o,schemeIdURI:l,systemString:u,getInitData:function(e,t){try{var r=a.default.parseInitDataFromContentProtection(e,n);if(!r&&t){var i={kids:[function(e){try{var t=e.replace(/-/g,"");return(t=btoa(t.match(/\w{2}/g).map((function(e){return String.fromCharCode(parseInt(e,16))})).join(""))).replace(/=/g,"")}catch(e){return null}}(t["cenc:default_KID"])]};r=(new TextEncoder).encode(JSON.stringify(i))}return r}catch(e){return null}},getRequestHeadersFromMessage:function(){return{"Content-Type":"application/json"}},getLicenseRequestFromMessage:function(e){return JSON.parse(String.fromCharCode.apply(null,new Uint8Array(e)))},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(e,t){var n=null;if(e){for(var a=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),s=[],o=0;o<a.kids.length;o++){var u=a.kids[o],l=e.clearkeys&&e.clearkeys.hasOwnProperty(u)?e.clearkeys[u]:null;if(!l)throw new Error("DRM: ClearKey keyID ("+u+") is not known!");s.push(new r.default(u,l))}n=new i.default(s)}return n}},t}c.__dashjs_factory_name="KeySystemClearKey",t.default=dashjs.FactoryMaker.getSingletonFactory(c)},"./src/streaming/protection/drm/KeySystemPlayReady.js":function(e,t,n){n.r(t);var r=n("./src/streaming/protection/CommonEncryption.js"),i=n("./src/streaming/constants/ProtectionConstants.js"),a="9a04f079-9840-4286-ab92-e65be0885f95",s=i.default.PLAYREADY_KEYSTEM_STRING,o="urn:uuid:"+a;function u(e){var t,n="utf-16",i=(e=e||{}).BASE64;function u(){if(!i||!i.hasOwnProperty("decodeArray")||!i.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}return t={uuid:a,schemeIdURI:o,systemString:s,getInitData:function(e){var t,n,a,s,o,l=new Uint8Array([112,115,115,104,0,0,0,0]),c=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),d=0,f=null;if(u(),!e)return null;if("pssh"in e)return r.default.parseInitDataFromContentProtection(e,i);if("pro"in e)f=i.decodeArray(e.pro.__text);else{if(!("prheader"in e))return null;f=i.decodeArray(e.prheader.__text)}return t=f.length,n=4+l.length+c.length+4+t,a=new ArrayBuffer(n),s=new Uint8Array(a),(o=new DataView(a)).setUint32(d,n),d+=4,s.set(l,d),d+=l.length,s.set(c,d),d+=c.length,o.setUint32(d,t),d+=4,s.set(f,d),d+=t,s.buffer},getRequestHeadersFromMessage:function(e){var t,r,i={},a=new DOMParser,s="utf-16"===n?new Uint16Array(e):new Uint8Array(e);t=String.fromCharCode.apply(null,s);for(var o=(r=a.parseFromString(t,"application/xml")).getElementsByTagName("name"),u=r.getElementsByTagName("value"),l=0;l<o.length;l++)i[o[l].childNodes[0].nodeValue]=u[l].childNodes[0].nodeValue;return i.hasOwnProperty("Content")&&(i["Content-Type"]=i.Content,delete i.Content),i.hasOwnProperty("Content-Type")||(i["Content-Type"]="text/xml; charset=utf-8"),i},getLicenseRequestFromMessage:function(e){var t=null,r=new DOMParser,a="utf-16"===n?new Uint16Array(e):new Uint8Array(e);u();var s=String.fromCharCode.apply(null,a),o=r.parseFromString(s,"application/xml");if(!o.getElementsByTagName("PlayReadyKeyMessage")[0])return e;var l=o.getElementsByTagName("Challenge")[0].childNodes[0].nodeValue;return l&&(t=i.decode(l)),t},getLicenseServerURLFromInitData:function(e){if(e)for(var t=new DataView(e),n=t.getUint16(4,!0),r=6,i=new DOMParser,a=0;a<n;a++){var s=t.getUint16(r,!0);r+=2;var o=t.getUint16(r,!0);if(r+=2,1===s){var u=e.slice(r,r+o),l=String.fromCharCode.apply(null,new Uint16Array(u)),c=i.parseFromString(l,"application/xml");if(c.getElementsByTagName("LA_URL")[0]){var d=c.getElementsByTagName("LA_URL")[0].childNodes[0].nodeValue;if(d)return d}if(c.getElementsByTagName("LUI_URL")[0]){var f=c.getElementsByTagName("LUI_URL")[0].childNodes[0].nodeValue;if(f)return f}}else r+=o}return null},getCDMData:function(e){var t,n,r,a;if(u(),!e)return null;for(t=[],a=0;a<e.length;++a)t.push(e.charCodeAt(a)),t.push(0);for(t=String.fromCharCode.apply(null,t),t=i.encode(t),n='<PlayReadyCDMData type="LicenseAcquisition"><LicenseAcquisition version="1.0" Proactive="false"><CustomData encoding="base64encoded">%CUSTOMDATA%</CustomData></LicenseAcquisition></PlayReadyCDMData>'.replace("%CUSTOMDATA%",t),r=[],a=0;a<n.length;++a)r.push(n.charCodeAt(a)),r.push(0);return new Uint8Array(r).buffer},setPlayReadyMessageFormat:function(e){if("utf-8"!==e&&"utf-16"!==e)throw new Error('Specified message format is not one of "utf-8" or "utf-16"');n=e}},t}u.__dashjs_factory_name="KeySystemPlayReady",t.default=dashjs.FactoryMaker.getSingletonFactory(u)},"./src/streaming/protection/drm/KeySystemW3CClearKey.js":function(e,t,n){n.r(t);var r=n("./src/streaming/protection/vo/KeyPair.js"),i=n("./src/streaming/protection/vo/ClearKeyKeySet.js"),a=n("./src/streaming/protection/CommonEncryption.js"),s=n("./src/streaming/constants/ProtectionConstants.js"),o="1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",u=s.default.CLEARKEY_KEYSTEM_STRING,l="urn:uuid:"+o;function c(e){var t,n=e.BASE64,s=e.debug.getLogger(t);return t={uuid:o,schemeIdURI:l,systemString:u,getInitData:function(e){return a.default.parseInitDataFromContentProtection(e,n)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(e,t){var n=null;if(e){for(var a=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),o=[],u=0;u<a.kids.length;u++){var l=a.kids[u],c=e.clearkeys&&e.clearkeys.hasOwnProperty(l)?e.clearkeys[l]:null;if(!c)throw new Error("DRM: ClearKey keyID ("+l+") is not known!");o.push(new r.default(l,c))}n=new i.default(o),s.warn("ClearKey schemeIdURI is using W3C Common PSSH systemID (1077efec-c0b2-4d02-ace3-3c1e52e2fb4b) in Content Protection. See DASH-IF IOP v4.1 section 7.6.2.4")}return n}},t}c.__dashjs_factory_name="KeySystemW3CClearKey",t.default=dashjs.FactoryMaker.getSingletonFactory(c)},"./src/streaming/protection/drm/KeySystemWidevine.js":function(e,t,n){n.r(t);var r=n("./src/streaming/protection/CommonEncryption.js"),i=n("./src/streaming/constants/ProtectionConstants.js"),a="edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",s=i.default.WIDEVINE_KEYSTEM_STRING,o="urn:uuid:"+a;function u(e){var t=(e=e||{}).BASE64;return{uuid:a,schemeIdURI:o,systemString:s,getInitData:function(e){return r.default.parseInitDataFromContentProtection(e,t)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null}}}u.__dashjs_factory_name="KeySystemWidevine",t.default=dashjs.FactoryMaker.getSingletonFactory(u)},"./src/streaming/protection/errors/ProtectionErrors.js":function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=s(e);if(t){var a=s(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}n.r(t);var o=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,e);var t=a(n);function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=t.call(this)).MEDIA_KEYERR_CODE=100,e.MEDIA_KEYERR_UNKNOWN_CODE=101,e.MEDIA_KEYERR_CLIENT_CODE=102,e.MEDIA_KEYERR_SERVICE_CODE=103,e.MEDIA_KEYERR_OUTPUT_CODE=104,e.MEDIA_KEYERR_HARDWARECHANGE_CODE=105,e.MEDIA_KEYERR_DOMAIN_CODE=106,e.MEDIA_KEY_MESSAGE_ERROR_CODE=107,e.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE=108,e.SERVER_CERTIFICATE_UPDATED_ERROR_CODE=109,e.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE=110,e.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE=111,e.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE=112,e.KEY_SESSION_CREATED_ERROR_CODE=113,e.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE=114,e.MEDIA_KEYERR_UNKNOWN_MESSAGE="An unspecified error occurred. This value is used for errors that don't match any of the other codes.",e.MEDIA_KEYERR_CLIENT_MESSAGE="The Key System could not be installed or updated.",e.MEDIA_KEYERR_SERVICE_MESSAGE="The message passed into update indicated an error from the license service.",e.MEDIA_KEYERR_OUTPUT_MESSAGE="There is no available output device with the required characteristics for the content protection system.",e.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE="A hardware configuration change caused a content protection error.",e.MEDIA_KEYERR_DOMAIN_MESSAGE="An error occurred in a multi-device domain licensing configuration. The most common error is a failure to join the domain.",e.MEDIA_KEY_MESSAGE_ERROR_MESSAGE="Multiple key sessions were creates with a user-agent that does not support sessionIDs!! Unpredictable behavior ahead!",e.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE="DRM: Empty key message from CDM",e.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE="Error updating server certificate -- ",e.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE="DRM: KeyStatusChange error! -- License has expired",e.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE="DRM: No license server URL specified!",e.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE="DRM: KeySystem Access Denied! -- ",e.KEY_SESSION_CREATED_ERROR_MESSAGE="DRM: unable to create session! --",e.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE="DRM: licenser error! --",e}return n}(n("./src/core/errors/ErrorsBase.js").default));t.default=o},"./src/streaming/protection/models/ProtectionModel_01b.js":function(e,t,n){n.r(t);var r=n("./src/streaming/protection/controllers/ProtectionKeyController.js"),i=n("./src/streaming/protection/vo/NeedKey.js"),a=n("./src/streaming/vo/DashJSError.js"),s=n("./src/streaming/protection/vo/KeyMessage.js"),o=n("./src/streaming/protection/vo/KeySystemConfiguration.js"),u=n("./src/streaming/protection/vo/KeySystemAccess.js"),l=n("./src/streaming/protection/errors/ProtectionErrors.js");function c(e){e=e||{};var t,n,c,d,f,h,p,g,m,y=this.context,v=e.eventBus,_=e.events,T=e.debug,b=e.api,E=e.errHandler;function S(){c&&I();for(var e=0;e<p.length;e++)w(p[e]);v.trigger(_.TEARDOWN_COMPLETE)}function w(e){try{c[b.cancelKeyRequest](d.systemString,e.sessionId)}catch(t){v.trigger(_.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.sessionId+") "+t.message})}}function A(e,t){if(t&&e){for(var n=e.length,r=0;r<n;r++)if(e[r].sessionId==t)return e[r];return null}return null}function I(){c.removeEventListener(b.keyerror,m),c.removeEventListener(b.needkey,m),c.removeEventListener(b.keymessage,m),c.removeEventListener(b.keyadded,m)}return t={getAllInitData:function(){for(var e=[],t=0;t<h.length;t++)e.push(h[t].initData);for(var n=0;n<p.length;n++)e.push(p[n].initData);return e},getSessions:function(){return p.concat(h)},requestKeySystemAccess:function(e){return new Promise((function(t,n){var r=c;r||(r=document.createElement("video"));for(var i=!1,a=0;a<e.length;a++)for(var s=e[a].ks.systemString,l=e[a].configs,d=null,h=null,p=0;p<l.length;p++){var g=l[p].videoCapabilities;if(g&&0!==g.length){h=[];for(var m=0;m<g.length;m++)""!==r.canPlayType(g[m].contentType,s)&&h.push(g[m])}if(h&&(!h||0!==h.length)){i=!0;var y=new o.default(d,h),T=f.getKeySystemBySystemString(s),b=new u.default(T,y);v.trigger(_.KEY_SYSTEM_ACCESS_COMPLETE,{data:b}),t({data:b});break}}if(!i){var E="Key system access denied! -- No valid audio/video content configurations detected!";v.trigger(_.KEY_SYSTEM_ACCESS_COMPLETE,{error:E}),n({error:E})}}))},selectKeySystem:function(e){return d=e.keySystem,Promise.resolve(d)},setMediaElement:function(e){if(c!==e){if(c){I();for(var t=0;t<p.length;t++)w(p[t]);p=[]}(c=e)&&(c.addEventListener(b.keyerror,m),c.addEventListener(b.needkey,m),c.addEventListener(b.keymessage,m),c.addEventListener(b.keyadded,m),v.trigger(_.VIDEO_ELEMENT_SELECTED))}},createKeySession:function(e){if(!d)throw new Error("Can not create sessions until you have selected a key system");if(g||0===p.length){var t={sessionId:null,keyId:e.keyId,initData:e.initData,getKeyId:function(){return this.keyId},getSessionId:function(){return this.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"}};return h.push(t),c[b.generateKeyRequest](d.systemString,new Uint8Array(e.initData)),t}throw new Error("Multiple sessions not allowed!")},updateKeySession:function(e,t){var n=e.sessionId;if(f.isClearKey(d))for(var r=0;r<t.keyPairs.length;r++)c[b.addKey](d.systemString,t.keyPairs[r].key,t.keyPairs[r].keyID,n);else c[b.addKey](d.systemString,new Uint8Array(t),new Uint8Array(e.initData),n);v.trigger(_.KEY_SESSION_UPDATED)},closeKeySession:w,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:S,reset:S},n=T.getLogger(t),c=null,d=null,h=[],p=[],f=Object(r.default)(y).getInstance(),m={handleEvent:function(e){var t=null;switch(e.type){case b.needkey:var r=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;v.trigger(_.NEED_KEY,{key:new i.default(r,"cenc")});break;case b.keyerror:if((t=A(p,e.sessionId))||(t=A(h,e.sessionId)),t){var o=l.default.MEDIA_KEYERR_CODE,u="";switch(e.errorCode.code){case 1:o=l.default.MEDIA_KEYERR_UNKNOWN_CODE,u+="MEDIA_KEYERR_UNKNOWN - "+l.default.MEDIA_KEYERR_UNKNOWN_MESSAGE;break;case 2:o=l.default.MEDIA_KEYERR_CLIENT_CODE,u+="MEDIA_KEYERR_CLIENT - "+l.default.MEDIA_KEYERR_CLIENT_MESSAGE;break;case 3:o=l.default.MEDIA_KEYERR_SERVICE_CODE,u+="MEDIA_KEYERR_SERVICE - "+l.default.MEDIA_KEYERR_SERVICE_MESSAGE;break;case 4:o=l.default.MEDIA_KEYERR_OUTPUT_CODE,u+="MEDIA_KEYERR_OUTPUT - "+l.default.MEDIA_KEYERR_OUTPUT_MESSAGE;break;case 5:o=l.default.MEDIA_KEYERR_HARDWARECHANGE_CODE,u+="MEDIA_KEYERR_HARDWARECHANGE - "+l.default.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE;break;case 6:o=l.default.MEDIA_KEYERR_DOMAIN_CODE,u+="MEDIA_KEYERR_DOMAIN - "+l.default.MEDIA_KEYERR_DOMAIN_MESSAGE}u+=" System Code = "+e.systemCode,v.trigger(_.KEY_ERROR,{error:new a.default(o,u,t)})}else n.error("No session token found for key error");break;case b.keyadded:(t=A(p,e.sessionId))||(t=A(h,e.sessionId)),t?(n.debug("DRM: Key added."),v.trigger(_.KEY_ADDED,{data:t})):n.debug("No session token found for key added");break;case b.keymessage:if((g=null!==e.sessionId&&void 0!==e.sessionId)?!(t=A(p,e.sessionId))&&h.length>0&&(t=h.shift(),p.push(t),t.sessionId=e.sessionId,v.trigger(_.KEY_SESSION_CREATED,{data:t})):h.length>0&&(t=h.shift(),p.push(t),0!==h.length&&E.error(new a.default(l.default.MEDIA_KEY_MESSAGE_ERROR_CODE,l.default.MEDIA_KEY_MESSAGE_ERROR_MESSAGE))),t){var c=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;t.keyMessage=c,v.trigger(_.INTERNAL_KEY_MESSAGE,{data:new s.default(t,c,e.defaultURL)})}else n.warn("No session token found for key message")}}},t}c.__dashjs_factory_name="ProtectionModel_01b",t.default=dashjs.FactoryMaker.getClassFactory(c)},"./src/streaming/protection/models/ProtectionModel_21Jan2015.js":function(e,t,n){n.r(t);var r=n("./src/streaming/protection/controllers/ProtectionKeyController.js"),i=n("./src/streaming/protection/vo/NeedKey.js"),a=n("./src/streaming/protection/errors/ProtectionErrors.js"),s=n("./src/streaming/vo/DashJSError.js"),o=n("./src/streaming/protection/vo/KeyMessage.js"),u=n("./src/streaming/protection/vo/KeySystemAccess.js"),l=n("./src/streaming/constants/ProtectionConstants.js");function c(e){e=e||{};var t,n,c,d,f,h,p,g,m=this.context,y=e.eventBus,v=e.events,_=e.debug;function T(e,t,n,r){if(void 0===navigator.requestMediaKeySystemAccess||"function"!=typeof navigator.requestMediaKeySystemAccess){var i="Insecure origins are not allowed";return y.trigger(v.KEY_SYSTEM_ACCESS_COMPLETE,{error:i}),void r({error:i})}var a=e[t].ks,s=e[t].configs,o=a.systemString;o===l.default.PLAYREADY_KEYSTEM_STRING&&"required"===s[0].persistentState&&(o+=".recommendation"),navigator.requestMediaKeySystemAccess(o,s).then((function(e){var t="function"==typeof e.getConfiguration?e.getConfiguration():null,r=new u.default(a,t);r.mksa=e,y.trigger(v.KEY_SYSTEM_ACCESS_COMPLETE,{data:r}),n({data:r})})).catch((function(i){if(t+1<e.length)T(e,t+1,n,r);else{var a="Key system access denied! ";y.trigger(v.KEY_SYSTEM_ACCESS_COMPLETE,{error:a+i.message}),r({error:a+i.message})}}))}function b(e){var t=e.session;return t.removeEventListener("keystatuseschange",e),t.removeEventListener("message",e),t.close()}function E(e){for(var t=0;t<h.length;t++)if(h[t]===e){h.splice(t,1);break}}function S(e){var t,n;return e&&e.length>0&&(e[0]&&("string"==typeof e[0]?t=e[0]:n=e[0]),e[1]&&("string"==typeof e[1]?t=e[1]:n=e[1])),{status:t,keyId:n}}function w(e,t){var r={session:e,keyId:t.keyId,initData:t.initData,sessionId:t.sessionId,sessionType:t.sessionType,handleEvent:function(e){switch(e.type){case"keystatuseschange":y.trigger(v.KEY_STATUSES_CHANGED,{data:this}),e.target.keyStatuses.forEach((function(){var e=S(arguments);"expired"===e.status?y.trigger(v.INTERNAL_KEY_STATUS_CHANGED,{error:new s.default(a.default.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE,a.default.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE)}):y.trigger(v.INTERNAL_KEY_STATUS_CHANGED,e)}));break;case"message":var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;y.trigger(v.INTERNAL_KEY_MESSAGE,{data:new o.default(this,t,void 0,e.messageType)})}},getKeyId:function(){return this.keyId},getSessionId:function(){return e.sessionId},getSessionType:function(){return this.sessionType},getExpirationTime:function(){return e.expiration},getKeyStatuses:function(){return e.keyStatuses},getUsable:function(){var t=!1;return e.keyStatuses.forEach((function(){"usable"===S(arguments).status&&(t=!0)})),t}};return e.addEventListener("keystatuseschange",r),e.addEventListener("message",r),e.closed.then((function(){E(r),n.debug("DRM: Session closed. SessionID = "+r.getSessionId()),y.trigger(v.KEY_SESSION_CLOSED,{data:r.getSessionId()})})),h.push(r),r}return t={getAllInitData:function(){for(var e=[],t=0;t<h.length;t++)h[t].initData&&e.push(h[t].initData);return e},getSessions:function(){return h},requestKeySystemAccess:function(e){return new Promise((function(t,n){T(e,0,t,n)}))},selectKeySystem:function(e){return new Promise((function(t,n){e.mksa.createMediaKeys().then((function(t){return c=e.keySystem,f=t,d?d.setMediaKeys(f):Promise.resolve()})).then((function(){t(c)})).catch((function(){n({error:"Error selecting keys system ("+e.keySystem.systemString+")! Could not create MediaKeys -- TODO"})}))}))},setMediaElement:function(e){d!==e&&(d&&(d.removeEventListener("encrypted",p),d.setMediaKeys&&d.setMediaKeys(null)),(d=e)&&(d.addEventListener("encrypted",p),d.setMediaKeys&&f&&d.setMediaKeys(f)))},setServerCertificate:function(e){if(!c||!f)throw new Error("Can not set server certificate until you have selected a key system");f.setServerCertificate(e).then((function(){n.info("DRM: License server certificate successfully updated."),y.trigger(v.SERVER_CERTIFICATE_UPDATED)})).catch((function(e){y.trigger(v.SERVER_CERTIFICATE_UPDATED,{error:new s.default(a.default.SERVER_CERTIFICATE_UPDATED_ERROR_CODE,a.default.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE+e.name)})}))},createKeySession:function(e){if(!c||!f)throw new Error("Can not create sessions until you have selected a key system");var t=f.createSession(e.sessionType),r=w(t,e),i=c.systemString===l.default.CLEARKEY_KEYSTEM_STRING&&(e.initData||e.protData&&e.protData.clearkeys)?l.default.INITIALIZATION_DATA_TYPE_KEYIDS:l.default.INITIALIZATION_DATA_TYPE_CENC;t.generateRequest(i,e.initData).then((function(){n.debug("DRM: Session created. SessionID = "+r.getSessionId()),y.trigger(v.KEY_SESSION_CREATED,{data:r})})).catch((function(e){E(r),y.trigger(v.KEY_SESSION_CREATED,{data:null,error:new s.default(a.default.KEY_SESSION_CREATED_ERROR_CODE,a.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Error generating key request -- "+e.name)})}))},updateKeySession:function(e,t){var n=e.session;g.isClearKey(c)&&(t=t.toJWK()),n.update(t).then((function(){y.trigger(v.KEY_SESSION_UPDATED)})).catch((function(t){y.trigger(v.KEY_ERROR,{error:new s.default(a.default.MEDIA_KEYERR_CODE,"Error sending update() message! "+t.name,e)})}))},loadKeySession:function(e){if(!c||!f)throw new Error("Can not load sessions until you have selected a key system");for(var t=e.sessionId,r=0;r<h.length;r++)if(t===h[r].sessionId)return void n.warn("DRM: Ignoring session ID because we have already seen it!");var i=f.createSession(e.sessionType),o=w(i,e);i.load(t).then((function(e){e?(n.debug("DRM: Session loaded. SessionID = "+o.getSessionId()),y.trigger(v.KEY_SESSION_CREATED,{data:o})):(E(o),y.trigger(v.KEY_SESSION_CREATED,{data:null,error:new s.default(a.default.KEY_SESSION_CREATED_ERROR_CODE,a.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session! Invalid Session ID ("+t+")")}))})).catch((function(e){E(o),y.trigger(v.KEY_SESSION_CREATED,{data:null,error:new s.default(a.default.KEY_SESSION_CREATED_ERROR_CODE,a.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session ("+t+")! "+e.name)})}))},removeKeySession:function(e){e.session.remove().then((function(){n.debug("DRM: Session removed. SessionID = "+e.getSessionId()),y.trigger(v.KEY_SESSION_REMOVED,{data:e.getSessionId()})}),(function(t){y.trigger(v.KEY_SESSION_REMOVED,{data:null,error:"Error removing session ("+e.getSessionId()+"). "+t.name})}))},closeKeySession:function(e){b(e).catch((function(t){E(e),y.trigger(v.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.getSessionId()+") "+t.name})}))},stop:function(){for(var e,t=0;t<h.length;t++)(e=h[t]).getUsable()||b(e).catch((function(){E(e)}))},reset:function(){var e,t=h.length;0!==t?function(){for(var n=function(e){E(e),0===h.length&&(d?(d.removeEventListener("encrypted",p),d.setMediaKeys(null).then((function(){y.trigger(v.TEARDOWN_COMPLETE)}))):y.trigger(v.TEARDOWN_COMPLETE))},r=0;r<t;r++)!function(t){e.session.closed.then((function(){n(t)})),b(e).catch((function(){n(t)}))}(e=h[r])}():y.trigger(v.TEARDOWN_COMPLETE)}},n=_.getLogger(t),c=null,d=null,f=null,h=[],g=Object(r.default)(m).getInstance(),p={handleEvent:function(e){if("encrypted"===e.type&&e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;y.trigger(v.NEED_KEY,{key:new i.default(t,e.initDataType)})}}},t}c.__dashjs_factory_name="ProtectionModel_21Jan2015",t.default=dashjs.FactoryMaker.getClassFactory(c)},"./src/streaming/protection/models/ProtectionModel_3Feb2014.js":function(e,t,n){n.r(t);var r=n("./src/streaming/protection/controllers/ProtectionKeyController.js"),i=n("./src/streaming/protection/vo/NeedKey.js"),a=n("./src/streaming/vo/DashJSError.js"),s=n("./src/streaming/protection/errors/ProtectionErrors.js"),o=n("./src/streaming/protection/vo/KeyMessage.js"),u=n("./src/streaming/protection/vo/KeySystemConfiguration.js"),l=n("./src/streaming/protection/vo/KeySystemAccess.js");function c(e){e=e||{};var t,n,c,d,f,h,p,g,m,y=this.context,v=e.eventBus,_=e.events,T=e.debug,b=e.api;function E(){try{for(var e=0;e<p.length;e++)S(p[e]);c&&c.removeEventListener(b.needkey,g),v.trigger(_.TEARDOWN_COMPLETE)}catch(e){v.trigger(_.TEARDOWN_COMPLETE,{error:"Error tearing down key sessions and MediaKeys! -- "+e.message})}}function S(e){var t=e.session;t.removeEventListener(b.error,e),t.removeEventListener(b.message,e),t.removeEventListener(b.ready,e),t.removeEventListener(b.close,e);for(var n=0;n<p.length;n++)if(p[n]===e){p.splice(n,1);break}t[b.release]()}function w(){var e=null,t=function(){c.removeEventListener("loadedmetadata",e),c[b.setMediaKeys](f),v.trigger(_.VIDEO_ELEMENT_SELECTED)};c.readyState>=1?t():(e=t.bind(this),c.addEventListener("loadedmetadata",e))}return t={getAllInitData:function(){for(var e=[],t=0;t<p.length;t++)e.push(p[t].initData);return e},getSessions:function(){return p},requestKeySystemAccess:function(e){return new Promise((function(t,n){for(var r=!1,i=0;i<e.length;i++)for(var a=e[i].ks.systemString,s=e[i].configs,o=null,c=null,d=0;d<s.length;d++){var f=s[d].audioCapabilities,h=s[d].videoCapabilities;if(f&&0!==f.length){o=[];for(var p=0;p<f.length;p++)window[b.MediaKeys].isTypeSupported(a,f[p].contentType)&&o.push(f[p])}if(h&&0!==h.length){c=[];for(var g=0;g<h.length;g++)window[b.MediaKeys].isTypeSupported(a,h[g].contentType)&&c.push(h[g])}if(!(!o&&!c||o&&0===o.length||c&&0===c.length)){r=!0;var y=new u.default(o,c),T=m.getKeySystemBySystemString(a),E=new l.default(T,y);v.trigger(_.KEY_SYSTEM_ACCESS_COMPLETE,{data:E}),t({data:E});break}}if(!r){var S="Key system access denied! -- No valid audio/video content configurations detected!";v.trigger(_.KEY_SYSTEM_ACCESS_COMPLETE,{error:S}),n({error:S})}}))},selectKeySystem:function(e){return new Promise((function(t,n){try{f=e.mediaKeys=new window[b.MediaKeys](e.keySystem.systemString),d=e.keySystem,h=e,c&&w(),t(d)}catch(e){n({error:"Error selecting keys system ("+d.systemString+")! Could not create MediaKeys -- TODO"})}}))},setMediaElement:function(e){c!==e&&(c&&c.removeEventListener(b.needkey,g),(c=e)&&(c.addEventListener(b.needkey,g),f&&w()))},createKeySession:function(e){if(!d||!f||!h)throw new Error("Can not create sessions until you have selected a key system");var t=null;if(h.ksConfiguration.videoCapabilities&&h.ksConfiguration.videoCapabilities.length>0&&(t=h.ksConfiguration.videoCapabilities[0]),null===t&&h.ksConfiguration.audioCapabilities&&h.ksConfiguration.audioCapabilities.length>0&&(t=h.ksConfiguration.audioCapabilities[0]),null===t)throw new Error("Can not create sessions for unknown content types.");var r=t.contentType,i=f.createSession(r,new Uint8Array(e.initData),e.cdmData?new Uint8Array(e.cdmData):null),u=function(e,t){return{session:e,keyId:t.keyId,initData:t.initData,getKeyId:function(){return this.keyId},getSessionId:function(){return this.session.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"},handleEvent:function(e){switch(e.type){case b.error:var t="KeyError";v.trigger(_.KEY_ERROR,{error:new a.default(s.default.MEDIA_KEYERR_CODE,t,this)});break;case b.message:var r=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;v.trigger(_.INTERNAL_KEY_MESSAGE,{data:new o.default(this,r,e.destinationURL)});break;case b.ready:n.debug("DRM: Key added."),v.trigger(_.KEY_ADDED);break;case b.close:n.debug("DRM: Session closed. SessionID = "+this.getSessionId()),v.trigger(_.KEY_SESSION_CLOSED,{data:this.getSessionId()})}}}}(i,e);i.addEventListener(b.error,u),i.addEventListener(b.message,u),i.addEventListener(b.ready,u),i.addEventListener(b.close,u),p.push(u),n.debug("DRM: Session created. SessionID = "+u.getSessionId()),v.trigger(_.KEY_SESSION_CREATED,{data:u})},updateKeySession:function(e,t){var n=e.session;m.isClearKey(d)?n.update(new Uint8Array(t.toJWK())):n.update(new Uint8Array(t)),v.trigger(_.KEY_SESSION_UPDATED)},closeKeySession:S,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:E,reset:E},n=T.getLogger(t),c=null,d=null,f=null,h=null,p=[],m=Object(r.default)(y).getInstance(),g={handleEvent:function(e){if(e.type===b.needkey&&e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;v.trigger(_.NEED_KEY,{key:new i.default(t,"cenc")})}}},t}c.__dashjs_factory_name="ProtectionModel_3Feb2014",t.default=dashjs.FactoryMaker.getClassFactory(c)},"./src/streaming/protection/servers/ClearKey.js":function(e,t,n){n.r(t);var r=n("./src/streaming/protection/vo/KeyPair.js"),i=n("./src/streaming/protection/vo/ClearKeyKeySet.js");function a(){var e;return e={getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"json"},getLicenseMessage:function(e){if(!e.hasOwnProperty("keys"))return null;for(var t=[],n=0;n<e.keys.length;n++){var a=e.keys[n],s=a.kid.replace(/=/g,""),o=a.k.replace(/=/g,"");t.push(new r.default(s,o))}return new i.default(t)},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}},e}a.__dashjs_factory_name="ClearKey",t.default=dashjs.FactoryMaker.getSingletonFactory(a)},"./src/streaming/protection/servers/DRMToday.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/ProtectionConstants.js");function i(e){var t=(e=e||{}).BASE64,n={};return n[r.default.WIDEVINE_KEYSTEM_STRING]={responseType:"json",getLicenseMessage:function(e){return t.decodeArray(e.license)},getErrorResponse:function(e){return e}},n[r.default.PLAYREADY_KEYSTEM_STRING]={responseType:"arraybuffer",getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}},{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(e){return n[e].responseType},getLicenseMessage:function(e,r){return function(){if(!t||!t.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}(),n[r].getLicenseMessage(e)},getErrorResponse:function(e,t){return n[t].getErrorResponse(e)}}}i.__dashjs_factory_name="DRMToday",t.default=dashjs.FactoryMaker.getSingletonFactory(i)},"./src/streaming/protection/servers/PlayReady.js":function(e,t,n){function r(){var e="http://schemas.xmlsoap.org/soap/envelope/";function t(e){var t=String.fromCharCode.apply(null,new Uint8Array(e));return decodeURIComponent(escape(t))}function n(n){if(window.DOMParser){var r=t(n),i=(new window.DOMParser).parseFromString(r,"text/xml"),a=i?i.getElementsByTagNameNS(e,"Envelope")[0]:null,s=a?a.getElementsByTagNameNS(e,"Body")[0]:null;if(s&&s.getElementsByTagNameNS(e,"Fault")[0])return null}return n}function r(n){var r="",i="",a="",s=-1,o=-1;if(window.DOMParser){var u=t(n),l=(new window.DOMParser).parseFromString(u,"text/xml"),c=l?l.getElementsByTagNameNS(e,"Envelope")[0]:null,d=c?c.getElementsByTagNameNS(e,"Body")[0]:null,f=d?d.getElementsByTagNameNS(e,"Fault")[0]:null,h=f?f.getElementsByTagName("detail")[0]:null,p=h?h.getElementsByTagName("Exception")[0]:null,g=null;if(null===f)return u;r=(g=f.getElementsByTagName("faultstring")[0].firstChild)?g.nodeValue:null,null!==p&&(i=(g=p.getElementsByTagName("StatusCode")[0])?g.firstChild.nodeValue:null,s=(a=(g=p.getElementsByTagName("Message")[0])?g.firstChild.nodeValue:null)?a.lastIndexOf("[")+1:-1,o=a?a.indexOf("]"):-1,a=a?a.substring(s,o):"")}var m="code: ".concat(i,", name: ").concat(r);return a&&(m+=", message: ".concat(a)),m}return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return n.call(this,e)},getErrorResponse:function(e){return r.call(this,e)}}}n.r(t),r.__dashjs_factory_name="PlayReady",t.default=dashjs.FactoryMaker.getSingletonFactory(r)},"./src/streaming/protection/servers/Widevine.js":function(e,t,n){function r(){return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}}}n.r(t),r.__dashjs_factory_name="Widevine",t.default=dashjs.FactoryMaker.getSingletonFactory(r)},"./src/streaming/protection/vo/ClearKeyKeySet.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i=function(){function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n&&"persistent"!==n&&"temporary"!==n)throw new Error("Invalid ClearKey key set type! Must be one of 'persistent' or 'temporary'");this.keyPairs=t,this.type=n}var t,n,i;return t=e,n=[{key:"toJWK",value:function(){var e,t=this.keyPairs.length,n={keys:[]};for(e=0;e<t;e++){var r={kty:"oct",alg:"A128KW",kid:this.keyPairs[e].keyID,k:this.keyPairs[e].key};n.keys.push(r)}this.type&&(n.type=this.type);var i=JSON.stringify(n),a=i.length,s=new ArrayBuffer(a),o=new Uint8Array(s);for(e=0;e<a;e++)o[e]=i.charCodeAt(e);return s}}],n&&r(t.prototype,n),i&&r(t,i),e}();t.default=i},"./src/streaming/protection/vo/KeyMessage.js":function(e,t,n){n.r(t),t.default=function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sessionToken=t,this.message=n,this.defaultURL=r,this.messageType=i||"license-request"}},"./src/streaming/protection/vo/KeyPair.js":function(e,t,n){n.r(t),t.default=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keyID=t,this.key=n}},"./src/streaming/protection/vo/KeySystemAccess.js":function(e,t,n){n.r(t),t.default=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keySystem=t,this.ksConfiguration=n}},"./src/streaming/protection/vo/KeySystemConfiguration.js":function(e,t,n){n.r(t),t.default=function e(t,n,r,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initDataTypes=["cenc"],t&&t.length&&(this.audioCapabilities=t),n&&n.length&&(this.videoCapabilities=n),this.distinctiveIdentifier=r,this.persistentState=i,this.sessionTypes=a}},"./src/streaming/protection/vo/LicenseRequest.js":function(e,t,n){n.r(t),t.default=function e(t,n,r,i,a,s,o,u){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t,this.method=n,this.responseType=r,this.headers=i,this.withCredentials=a,this.messageType=s,this.sessionId=o,this.data=u}},"./src/streaming/protection/vo/LicenseResponse.js":function(e,t,n){n.r(t),t.default=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t,this.headers=n,this.data=r}},"./src/streaming/protection/vo/MediaCapability.js":function(e,t,n){n.r(t),t.default=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.contentType=t,this.robustness=n}},"./src/streaming/protection/vo/NeedKey.js":function(e,t,n){n.r(t),t.default=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initData=t,this.initDataType=n}},"./src/streaming/rules/DroppedFramesHistory.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js");function i(){var e={},t={},n={};return{push:function(r,i,a){if(i){e[r]||(e[r]=[],t[r]=0,n[r]=0);var s=a&&a.droppedVideoFrames?a.droppedVideoFrames:0,o=a&&a.totalVideoFrames?a.totalVideoFrames:0,u=s-t;t[r]=s;var l=o-n;n[r]=o;var c=e[r];isNaN(i)||(c[i]?(c[i].droppedVideoFrames+=u,c[i].totalVideoFrames+=l):c[i]={droppedVideoFrames:u,totalVideoFrames:l})}},getFrameHistory:function(t){return e[t]},clearForStream:function(r){try{delete e[r],delete t[r],delete n[r]}catch(e){}},reset:function(){e={},t={},n={}}}}i.__dashjs_factory_name="DroppedFramesHistory";var a=r.default.getClassFactory(i);t.default=a},"./src/streaming/rules/RulesContext.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js");function i(e){var t=(e=e||{}).abrController,n=e.switchHistory,r=e.droppedFramesHistory,i=e.currentRequest,a=e.useBufferOccupancyABR,s=e.useL2AABR,o=e.useLoLPABR,u=e.streamProcessor?e.streamProcessor.getScheduleController():null,l=e.streamProcessor?e.streamProcessor.getRepresentationInfo():null,c=e.videoModel?e.videoModel:null;function d(){return l?l.mediaInfo:null}return{getMediaType:function(){var e=d();return e?e.type:null},getMediaInfo:d,getDroppedFramesHistory:function(){return r},getCurrentRequest:function(){return i},getSwitchHistory:function(){return n},getStreamInfo:function(){var e=d();return e?e.streamInfo:null},getScheduleController:function(){return u},getAbrController:function(){return t},getRepresentationInfo:function(){return l},useBufferOccupancyABR:function(){return a},useL2AABR:function(){return s},useLoLPABR:function(){return o},getVideoModel:function(){return c}}}i.__dashjs_factory_name="RulesContext",t.default=r.default.getClassFactory(i)},"./src/streaming/rules/SwitchRequest.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i={DEFAULT:.5,STRONG:1,WEAK:0};function a(e,t,n){var r,a;return r=void 0===e?-1:e,a=function(e){var t=i.DEFAULT;return e!==i.DEFAULT&&e!==i.STRONG&&e!==i.WEAK||(t=e),t}(n),{quality:r,reason:void 0===t?null:t,priority:a}}a.__dashjs_factory_name="SwitchRequest";var s=r.default.getClassFactory(a);s.NO_CHANGE=-1,s.PRIORITY=i,r.default.updateClassFactory(a.__dashjs_factory_name,s),t.default=s},"./src/streaming/rules/SwitchRequestHistory.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/rules/SwitchRequest.js");function a(){var e=[],t=[];return{push:function(n){n.newValue===i.default.NO_CHANGE&&(n.newValue=n.oldValue),e[n.oldValue]||(e[n.oldValue]={noDrops:0,drops:0,dropSize:0});var r=n.newValue-n.oldValue,a=r<0?1:0,s=a?-r:0,o=a?0:1;if(e[n.oldValue].drops+=a,e[n.oldValue].dropSize+=s,e[n.oldValue].noDrops+=o,t.push({idx:n.oldValue,noDrop:o,drop:a,dropSize:s}),t.length>8){var u=t.shift();e[u.idx].drops-=u.drop,e[u.idx].dropSize-=u.dropSize,e[u.idx].noDrops-=u.noDrop}},getSwitchRequests:function(){return e},reset:function(){e=[],t=[]}}}a.__dashjs_factory_name="SwitchRequestHistory";var s=r.default.getClassFactory(a);t.default=s},"./src/streaming/rules/ThroughputHistory.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/core/FactoryMaker.js");function a(e){var t,n,i,a,s,o=3,u=4,l=4,c=1.3,d=1.3,f=(e=e||{}).settings;function h(e,t,n,r){var i=Math.pow(.5,n/r.fast);e.fastEstimate=(1-i)*t+i*e.fastEstimate;var a=Math.pow(.5,n/r.slow);e.slowEstimate=(1-a)*t+a*e.slowEstimate,e.totalWeight+=n}function p(e,h,p){return f.get().streaming.abr.movingAverageMethod!==r.default.MOVING_AVERAGE_SLIDING_WINDOW?function(e,t){var n=e?s.throughputHalfLife:s.latencyHalfLife,r=e?i[t]:a[t];if(!r||r.totalWeight<=0)return NaN;var o=r.fastEstimate/(1-Math.pow(.5,r.totalWeight/n.fast)),u=r.slowEstimate/(1-Math.pow(.5,r.totalWeight/n.slow));return e?Math.min(o,u):Math.max(o,u)}(e,h):function(e,r,i){var a=function(e,r,i){var a,s;if(e?(a=t[r],s=i?o:u):(a=n[r],s=l),a){if(s>=a.length)s=a.length;else if(e)for(var f=1;f<s;++f){var h=a[a.length-f]/a[a.length-f-1];if((h>=d||h<=1/c)&&(s+=1)===a.length)break}}else s=0;return s}(e,r,i),s=(e?t:n)[r];return 0!==a&&s&&0!==s.length?(s=s.slice(-a)).reduce((function(e,t){return e+t}))/s.length:NaN}(e,h,p)}function g(e,t){return p(!0,e,t)}function m(e){t[e]=t[e]||[],n[e]=n[e]||[],i[e]=i[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0},a[e]=a[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0}}function y(){t={},n={},i={},a={}}var v={push:function(e,o,u){if(o.trace&&o.trace.length){var l=o.tresponse.getTime()-o.trequest.getTime()||1,c=o._tfinish.getTime()-o.tresponse.getTime()||1,d=o.trace.reduce((function(e,t){return e+t.b[0]}),0),p=0,g=0;if(f.get().streaming.lowLatencyEnabled){if(f.get().streaming.abr.fetchThroughputCalculationMode===r.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING){var y=o.trace.reduce((function(e,t){return e+t.t}),0);g=Math.round(y/o.trace.length)}0===g&&(p=o.trace.reduce((function(e,t){return e+t.d}),0))}else p=u?c:l+c;if(0!==p&&(g=Math.round(8*d/p)),m(e),function(e,t,n){return e===r.default.VIDEO?n<f.get().streaming.cacheLoadThresholds[r.default.VIDEO]:e===r.default.AUDIO?n<f.get().streaming.cacheLoadThresholds[r.default.AUDIO]:void 0}(e,0,c)){if(t[e].length>0&&!t[e].hasCachedEntries)return;t[e].hasCachedEntries=!0}else t[e]&&t[e].hasCachedEntries&&function(e){delete t[e],delete n[e],delete i[e],delete a[e],m(e)}(e);t[e].push(g),t[e].length>20&&t[e].shift(),n[e].push(l),n[e].length>20&&n[e].shift(),h(i[e],g,.001*c,s.throughputHalfLife),h(a[e],l,1,s.latencyHalfLife)}},getAverageThroughput:g,getSafeAverageThroughput:function(e,t){var n=g(e,t);return isNaN(n)||(n*=f.get().streaming.abr.bandwidthSafetyFactor),n},getAverageLatency:function(e){return p(!1,e)},reset:y};return s={throughputHalfLife:{fast:3,slow:8},latencyHalfLife:{fast:1,slow:2}},y(),v}a.__dashjs_factory_name="ThroughputHistory",t.default=i.default.getClassFactory(a)},"./src/streaming/rules/abr/ABRRulesCollection.js":function(e,t,n){n.r(t);var r=n("./src/streaming/rules/abr/ThroughputRule.js"),i=n("./src/streaming/rules/abr/InsufficientBufferRule.js"),a=n("./src/streaming/rules/abr/AbandonRequestsRule.js"),s=n("./src/streaming/rules/abr/DroppedFramesRule.js"),o=n("./src/streaming/rules/abr/SwitchHistoryRule.js"),u=n("./src/streaming/rules/abr/BolaRule.js"),l=n("./src/streaming/rules/abr/L2ARule.js"),c=n("./src/streaming/rules/abr/lolp/LoLpRule.js"),d=n("./src/core/FactoryMaker.js"),f=n("./src/streaming/rules/SwitchRequest.js"),h=n("./src/streaming/constants/Constants.js"),p="qualitySwitchRules",g="abandonFragmentRules";function m(e){e=e||{};var t,n,d=this.context,m=e.mediaPlayerModel,y=e.dashMetrics,v=e.settings;function _(e){return e.filter((function(e){return e.quality>f.default.NO_CHANGE}))}function T(e){var t,n,r,i,a,s={},o=null;if(0!==e.length){for(s[f.default.PRIORITY.STRONG]={quality:f.default.NO_CHANGE,reason:null},s[f.default.PRIORITY.WEAK]={quality:f.default.NO_CHANGE,reason:null},s[f.default.PRIORITY.DEFAULT]={quality:f.default.NO_CHANGE,reason:null},t=0,n=e.length;t<n;t+=1)(r=e[t]).quality!==f.default.NO_CHANGE&&(s[r.priority].quality===f.default.NO_CHANGE||s[r.priority].quality>r.quality)&&(s[r.priority].quality=r.quality,s[r.priority].reason=r.reason||null);return s[f.default.PRIORITY.WEAK].quality!==f.default.NO_CHANGE&&(o=s[f.default.PRIORITY.WEAK]),s[f.default.PRIORITY.DEFAULT].quality!==f.default.NO_CHANGE&&(o=s[f.default.PRIORITY.DEFAULT]),s[f.default.PRIORITY.STRONG].quality!==f.default.NO_CHANGE&&(o=s[f.default.PRIORITY.STRONG]),o&&(i=o.quality,a=o.reason),Object(f.default)(d).create(i,a)}}return{initialize:function(){t=[],n=[],v.get().streaming.abr.useDefaultABRRules&&(v.get().streaming.abr.ABRStrategy===h.default.ABR_STRATEGY_L2A?t.push(Object(l.default)(d).create({dashMetrics:y,mediaPlayerModel:m,settings:v})):v.get().streaming.abr.ABRStrategy===h.default.ABR_STRATEGY_LoLP?t.push(Object(c.default)(d).create({dashMetrics:y})):(t.push(Object(u.default)(d).create({dashMetrics:y,mediaPlayerModel:m,settings:v})),t.push(Object(r.default)(d).create({dashMetrics:y})),v.get().streaming.abr.additionalAbrRules.insufficientBufferRule&&t.push(Object(i.default)(d).create({dashMetrics:y,settings:v})),v.get().streaming.abr.additionalAbrRules.switchHistoryRule&&t.push(Object(o.default)(d).create()),v.get().streaming.abr.additionalAbrRules.droppedFramesRule&&t.push(Object(s.default)(d).create()),v.get().streaming.abr.additionalAbrRules.abandonRequestsRule&&n.push(Object(a.default)(d).create({dashMetrics:y,mediaPlayerModel:m,settings:v})))),m.getABRCustomRules().forEach((function(e){e.type===p&&t.push(e.rule(d).create()),e.type===g&&n.push(e.rule(d).create())}))},reset:function(){[t,n].forEach((function(e){e&&e.length&&e.forEach((function(e){return e.reset&&e.reset()}))})),t=[],n=[]},getMaxQuality:function(e){return T(_(t.map((function(t){return t.getMaxIndex(e)}))))||Object(f.default)(d).create()},getMinSwitchRequest:T,shouldAbandonFragment:function(e,t){return T(_(n.map((function(n){return n.shouldAbandon(e,t)}))))||Object(f.default)(d).create()},getQualitySwitchRules:function(){return t}}}m.__dashjs_factory_name="ABRRulesCollection";var y=d.default.getClassFactory(m);y.QUALITY_SWITCH_RULES=p,y.ABANDON_FRAGMENT_RULES=g,d.default.updateSingletonFactory(m.__dashjs_factory_name,y),t.default=y},"./src/streaming/rules/abr/AbandonRequestsRule.js":function(e,t,n){n.r(t);var r=n("./src/streaming/rules/SwitchRequest.js"),i=n("./src/core/FactoryMaker.js"),a=n("./src/core/Debug.js");function s(e){e=e||{};var t,n,i,o,u,l=this.context,c=e.mediaPlayerModel,d=e.dashMetrics,f=e.settings;function h(){i={},o={},u=[]}return t={shouldAbandon:function(e){var t=Object(r.default)(l).create(r.default.NO_CHANGE,{name:s.__dashjs_factory_name});if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getCurrentRequest")&&e.hasOwnProperty("getRepresentationInfo")&&e.hasOwnProperty("getAbrController")))return t;var a,h,p=e.getMediaInfo(),g=e.getMediaType(),m=e.getStreamInfo(),y=m?m.id:null,v=e.getCurrentRequest();if(!isNaN(v.index)){a=g,h=v.index,i[a]=i[a]||{},i[a][h]=i[a][h]||{};var _=c.getStableBufferTime();if(d.getCurrentBufferLevel(g)>_)return t;var T=i[g][v.index];if(null===T||null===v.firstByteDate||o.hasOwnProperty(T.id))return t;if(void 0===T.firstByteTime&&(u[g]=[],T.firstByteTime=v.firstByteDate.getTime(),T.segmentDuration=v.duration,T.bytesTotal=v.bytesTotal,T.id=v.index),T.bytesLoaded=v.bytesLoaded,T.elapsedTime=(new Date).getTime()-T.firstByteTime,T.bytesLoaded>0&&T.elapsedTime>0&&function(e,t){u[e]=u[e]||[],u[e].push(t)}(g,Math.round(8*T.bytesLoaded/T.elapsedTime)),u[g].length>=5&&T.elapsedTime>500&&T.bytesLoaded<T.bytesTotal){var b=u[g].reduce((function(e,t){return e+t}),0);if(T.measuredBandwidthInKbps=Math.round(b/u[g].length),T.estimatedTimeOfDownload=+(8*T.bytesTotal/T.measuredBandwidthInKbps/1e3).toFixed(2),T.estimatedTimeOfDownload<1.8*T.segmentDuration||0===e.getRepresentationInfo().quality)return t;if(!o.hasOwnProperty(T.id)){var E=e.getAbrController(),S=T.bytesTotal-T.bytesLoaded,w=E.getBitrateList(p),A=E.getQualityForBitrate(p,T.measuredBandwidthInKbps*f.get().streaming.abr.bandwidthSafetyFactor,y),I=E.getMinAllowedIndexFor(g,y),C=void 0!==I?Math.max(I,A):A;S>T.bytesTotal*w[C].bitrate/w[E.getQualityFor(g,y)].bitrate&&(t.quality=C,t.reason.throughput=T.measuredBandwidthInKbps,t.reason.fragmentID=T.id,o[T.id]=T,n.debug("["+g+"] frag id",T.id," is asking to abandon and switch to quality to ",C," measured bandwidth was",T.measuredBandwidthInKbps),delete i[g][T.id])}}else T.bytesLoaded===T.bytesTotal&&delete i[g][T.id]}return t},reset:h},n=Object(a.default)(l).getInstance().getLogger(t),h(),t}s.__dashjs_factory_name="AbandonRequestsRule",t.default=i.default.getClassFactory(s)},"./src/streaming/rules/abr/BolaRule.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/MetricsConstants.js"),i=n("./src/streaming/rules/SwitchRequest.js"),a=n("./src/core/FactoryMaker.js"),s=n("./src/streaming/vo/metrics/HTTPRequest.js"),o=n("./src/core/EventBus.js"),u=n("./src/core/events/Events.js"),l=n("./src/core/Debug.js"),c=n("./src/streaming/MediaPlayerEvents.js"),d=10;function f(e){e=e||{};var t,n,a,f=this.context,h=e.dashMetrics,p=e.mediaPlayerModel,g=Object(o.default)(f).getInstance();function m(e,t,n){var r=n.reduce((function(e,t,r){return t>n[e]?r:e}),0);if(0===r)return null;var i=Math.max(e,d+2*t.length),a=(n[r]-1)/(i/d-1);return{gp:a,Vp:d/a}}function y(e){var t={},n=e.getMediaInfo().bitrateList.map((function(e){return e.bandwidth})),r=function(e){return e.map((function(e){return Math.log(e)}))}(n);r=r.map((function(e){return e-r[0]+1}));var i=p.getStableBufferTime(),a=m(i,n,r);return a?(t.state=1,t.bitrates=n,t.utilities=r,t.stableBufferTime=i,t.Vp=a.Vp,t.gp=a.gp,t.lastQuality=0,v(t)):t.state=0,t}function v(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function _(e,t){var n=p.getStableBufferTime();if(e.stableBufferTime!==n){var r=m(n,e.bitrates,e.utilities);if(r.Vp!==e.Vp||r.gp!==e.gp){var i=h.getCurrentBufferLevel(t),a=i+e.placeholderBuffer;a-=d,a*=r.Vp/e.Vp,a+=d,e.stableBufferTime=n,e.Vp=r.Vp,e.gp=r.gp,e.placeholderBuffer=Math.max(0,a-i)}}}function T(e,t){return e.Vp*(e.utilities[t]+e.gp)}function b(e,t){for(var n=e.bitrates[t],r=e.utilities[t],i=0,a=t-1;a>=0;--a)if(e.utilities[a]<e.utilities[t]){var s=e.bitrates[a],o=e.utilities[a],u=e.Vp*(e.gp+(n*o-s*r)/(n-s));i=Math.max(i,u)}return i}function E(){for(var e in a)a.hasOwnProperty(e)&&2===a[e].state&&(a[e].placeholderBuffer=0)}function S(){for(var e in a)if(a.hasOwnProperty(e)){var t=a[e];0!==t.state&&(t.state=1,v(t))}}function w(e){if(e&&e.chunk&&e.chunk.mediaInfo){var t=a[e.chunk.mediaInfo.type];if(t&&0!==t.state){var n=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||n>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=n,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=n,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,I(t,e.chunk.mediaInfo.type)}}}function A(e){if(e&&e.metric===r.default.HTTP_REQUEST&&e.value&&e.value.type===s.HTTPRequest.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=a[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),I(t,e.mediaType))}}function I(e,t){if(!isNaN(e.lastSegmentStart)&&!isNaN(e.lastSegmentRequestTimeMs)&&!isNaN(e.placeholderBuffer)){if(e.placeholderBuffer*=.99,!isNaN(e.lastSegmentFinishTimeMs)){var n=h.getCurrentBufferLevel(t)+.001*(e.lastSegmentFinishTimeMs-e.lastSegmentRequestTimeMs),r=T(e,e.lastQuality),i=Math.max(0,r-n);e.placeholderBuffer=Math.min(i,e.placeholderBuffer)}e.lastSegmentWasReplacement&&!isNaN(e.lastSegmentDurationS)&&(e.placeholderBuffer+=e.lastSegmentDurationS),e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN}}function C(e){if(e){var t=a[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function R(e){if(e){var t=a[e.mediaType];if(t&&0!==t.state){var n,r=h.getCurrentBufferLevel(e.mediaType);n=t.abrQuality>0?b(t,t.abrQuality):d;var i=Math.max(0,n-r);t.placeholderBuffer=Math.min(t.placeholderBuffer,i)}}}function D(){a={}}return t={getMaxIndex:function(e){var t=Object(i.default)(f).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getScheduleController")&&e.hasOwnProperty("getStreamInfo")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("useBufferOccupancyABR")))return t;var r=e.getMediaInfo(),s=e.getMediaType(),o=e.getScheduleController(),u=e.getStreamInfo(),l=e.getAbrController(),c=l.getThroughputHistory(),d=u?u.id:null,p=u&&u.manifestInfo&&u.manifestInfo.isDynamic,g=e.useBufferOccupancyABR();if(t.reason=t.reason||{},!g)return t;o.setTimeToLoadDelay(0);var m=function(e){var t=e.getMediaType(),n=a[t];return n?0!==n.state&&_(n,t):(n=y(e),a[t]=n),n}(e);if(0===m.state)return t;var E,S=h.getCurrentBufferLevel(s),w=c.getAverageThroughput(s,p),A=c.getSafeAverageThroughput(s,p),I=c.getAverageLatency(s);if(t.reason.state=m.state,t.reason.throughput=w,t.reason.latency=I,isNaN(w))return t;switch(m.state){case 1:E=l.getQualityForBitrate(r,A,d,I),t.quality=E,t.reason.throughput=A,m.placeholderBuffer=Math.max(0,b(m,E)-S),m.lastQuality=E,!isNaN(m.lastSegmentDurationS)&&S>=m.lastSegmentDurationS&&(m.state=2);break;case 2:!function(e,t){var n=Date.now();if(isNaN(e.lastSegmentFinishTimeMs)){if(!isNaN(e.lastCallTimeMs)){var r=.001*(n-e.lastCallTimeMs);e.placeholderBuffer+=Math.max(0,r)}}else{var i=.001*(n-e.lastSegmentFinishTimeMs);e.placeholderBuffer+=Math.max(0,i)}e.lastCallTimeMs=n,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN,_(e,t)}(m,s),E=function(e,t){for(var n=e.bitrates.length,r=NaN,i=NaN,a=0;a<n;++a){var s=(e.Vp*(e.utilities[a]+e.gp)-t)/e.bitrates[a];(isNaN(i)||s>=i)&&(i=s,r=a)}return r}(m,S+m.placeholderBuffer);var C=l.getQualityForBitrate(r,A,d,I);E>m.lastQuality&&E>C&&(E=Math.max(C,m.lastQuality));var R=Math.max(0,S+m.placeholderBuffer-T(m,E));R<=m.placeholderBuffer?(m.placeholderBuffer-=R,R=0):(R-=m.placeholderBuffer,m.placeholderBuffer=0,E<l.getMaxAllowedIndexFor(s,d)?o.setTimeToLoadDelay(1e3*R):R=0),t.quality=E,t.reason.throughput=w,t.reason.latency=I,t.reason.bufferLevel=S,t.reason.placeholderBuffer=m.placeholderBuffer,t.reason.delay=R,m.lastQuality=E;break;default:n.debug("BOLA ABR rule invoked in bad state."),t.quality=l.getQualityForBitrate(r,A,d,I),t.reason.state=m.state,t.reason.throughput=A,t.reason.latency=I,m.state=1,v(m)}return t},reset:function(){D(),g.off(c.default.BUFFER_EMPTY,E,t),g.off(c.default.PLAYBACK_SEEKING,S,t),g.off(c.default.METRIC_ADDED,A,t),g.off(c.default.QUALITY_CHANGE_REQUESTED,C,t),g.off(c.default.FRAGMENT_LOADING_ABANDONED,R,t),g.off(u.default.MEDIA_FRAGMENT_LOADED,w,t)}},n=Object(l.default)(f).getInstance().getLogger(t),D(),g.on(c.default.BUFFER_EMPTY,E,t),g.on(c.default.PLAYBACK_SEEKING,S,t),g.on(c.default.METRIC_ADDED,A,t),g.on(c.default.QUALITY_CHANGE_REQUESTED,C,t),g.on(c.default.FRAGMENT_LOADING_ABANDONED,R,t),g.on(u.default.MEDIA_FRAGMENT_LOADED,w,t),t}f.__dashjs_factory_name="BolaRule",t.default=a.default.getClassFactory(f)},"./src/streaming/rules/abr/DroppedFramesRule.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/rules/SwitchRequest.js"),a=n("./src/core/Debug.js");function s(){var e,t,n=this.context;return e={getMaxIndex:function(e){var r=Object(i.default)(n).create();if(!e||!e.hasOwnProperty("getDroppedFramesHistory"))return r;var a=e.getDroppedFramesHistory(),s=e.getStreamInfo().id;if(a){var o=a.getFrameHistory(s);if(!o||0===o.length)return r;for(var u=0,l=0,c=i.default.NO_CHANGE,d=1;d<o.length;d++)if(o[d]&&(u=o[d].droppedVideoFrames,(l=o[d].totalVideoFrames)>375&&u/l>.15)){c=d-1,t.debug("index: "+c+" Dropped Frames: "+u+" Total Frames: "+l);break}return Object(i.default)(n).create(c,{droppedFrames:u})}return r}},t=Object(a.default)(n).getInstance().getLogger(e),e}s.__dashjs_factory_name="DroppedFramesRule",t.default=r.default.getClassFactory(s)},"./src/streaming/rules/abr/InsufficientBufferRule.js":function(e,t,n){n.r(t);var r=n("./src/core/EventBus.js"),i=n("./src/core/events/Events.js"),a=n("./src/core/FactoryMaker.js"),s=n("./src/core/Debug.js"),o=n("./src/streaming/rules/SwitchRequest.js"),u=n("./src/streaming/constants/Constants.js"),l=n("./src/streaming/constants/MetricsConstants.js"),c=n("./src/streaming/MediaPlayerEvents.js");function d(e){e=e||{};var t,n,a,d=2,f=this.context,h=Object(r.default)(f).getInstance(),p=e.dashMetrics,g=e.settings;function m(){(a={})[u.default.VIDEO]={ignoreCount:d},a[u.default.AUDIO]={ignoreCount:d}}function y(){m()}function v(e){isNaN(e.startTime)||e.mediaType!==u.default.AUDIO&&e.mediaType!==u.default.VIDEO||a[e.mediaType].ignoreCount>0&&a[e.mediaType].ignoreCount--}return t={getMaxIndex:function(e){var t=Object(o.default)(f).create();if(!e||!e.hasOwnProperty("getMediaType"))return t;!function(){if(!p||!p.hasOwnProperty("getCurrentBufferLevel")||!p.hasOwnProperty("getCurrentBufferState"))throw new Error(u.default.MISSING_CONFIG_ERROR)}();var r=e.getMediaType(),i=p.getCurrentBufferState(r),s=e.getRepresentationInfo().fragmentDuration,c=e.getStreamInfo(),d=c?c.id:null,h=c&&c.manifestInfo&&c.manifestInfo.isDynamic;if(function(e){return!g.get().streaming.lowLatencyEnabled&&a[e].ignoreCount>0}(r)||!s)return t;if(i&&i.state===l.default.BUFFER_EMPTY)n.debug("["+r+"] Switch to index 0; buffer is empty."),t.quality=0,t.reason="InsufficientBufferRule: Buffer is empty";else{var m=e.getMediaInfo(),y=e.getAbrController(),v=y.getThroughputHistory(),_=p.getCurrentBufferLevel(r),T=v.getAverageThroughput(r,h),b=v.getAverageLatency(r),E=T*(_/s)*.5;t.quality=y.getQualityForBitrate(m,E,d,b),t.reason="InsufficientBufferRule: being conservative to avoid immediate rebuffering"}return t},reset:function(){m(),h.off(c.default.PLAYBACK_SEEKING,y,t),h.off(i.default.BYTES_APPENDED_END_FRAGMENT,v,t)}},n=Object(s.default)(f).getInstance().getLogger(t),m(),h.on(c.default.PLAYBACK_SEEKING,y,t),h.on(i.default.BYTES_APPENDED_END_FRAGMENT,v,t),t}d.__dashjs_factory_name="InsufficientBufferRule",t.default=a.default.getClassFactory(d)},"./src/streaming/rules/abr/L2ARule.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/MetricsConstants.js"),i=n("./src/streaming/rules/SwitchRequest.js"),a=n("./src/core/FactoryMaker.js"),s=n("./src/streaming/vo/metrics/HTTPRequest.js"),o=n("./src/core/EventBus.js"),u=n("./src/core/events/Events.js"),l=n("./src/core/Debug.js"),c=n("./src/streaming/constants/Constants.js");function d(e){e=e||{};var t,n,a,d,f=this.context,h=e.dashMetrics,p=Object(o.default)(f).getInstance();function g(e){var t={},n=e.getMediaInfo(),r=n.bitrateList.map((function(e){return e.bandwidth/1e3}));return t.state=1,t.bitrates=r,t.lastQuality=0,function(e){e&&e.type&&(a[e.type]={},a[e.type].w=[],a[e.type].prev_w=[],a[e.type].Q=0,a[e.type].segment_request_start_s=0,a[e.type].segment_download_finish_s=0,a[e.type].B_target=1.5)}(n),m(t),t}function m(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function y(){for(var e in n)if(n.hasOwnProperty(e)){var t=n[e];0!==t.state&&(t.state=1,m(t))}}function v(e){if(e&&e.chunk&&e.chunk.mediaInfo){var t=n[e.chunk.mediaInfo.type],r=a[e.chunk.mediaInfo.type];if(t&&0!==t.state){var i=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||i>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=i,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=i,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,T(t,r)}}}function _(e){if(e&&e.metric===r.default.HTTP_REQUEST&&e.value&&e.value.type===s.HTTPRequest.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=n[e.mediaType],i=a[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),T(t,i))}}function T(e,t){isNaN(e.lastSegmentStart)||isNaN(e.lastSegmentRequestTimeMs)||(t.segment_request_start_s=.001*e.lastSegmentRequestTimeMs,t.segment_download_finish_s=.001*e.lastSegmentFinishTimeMs,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN)}function b(e){if(e&&e.mediaType){var t=n[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function E(e,t){if(e.length!==t.length)return-1;for(var n=0,r=0;r<e.length;r++)n+=e[r]*t[r];return n}function S(){n={},a={}}return t={getMaxIndex:function(e){var t,r=Object(i.default)(f).create(),s=Math.pow(4,.99),o=Math.max(Math.pow(4,1),s*Math.sqrt(4)),u=e.getMediaInfo(),l=e.getMediaType(),p=u.bitrateList.map((function(e){return e.bandwidth})),y=p.length,v=e.getScheduleController(),_=e.getStreamInfo(),T=e.getAbrController(),b=T.getThroughputHistory(),S=_&&_.manifestInfo&&_.manifestInfo.isDynamic,w=e.useL2AABR(),A=h.getCurrentBufferLevel(l,!0),I=b.getSafeAverageThroughput(l,S),C=b.getAverageThroughput(l,S),R=b.getAverageLatency(l),D=e.getVideoModel().getPlaybackRate();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getScheduleController")&&e.hasOwnProperty("getStreamInfo")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("useL2AABR")))return r;if(r.reason=r.reason||{},!w||l===c.default.AUDIO)return r;v.setTimeToLoadDelay(0);var x=function(e){var t=e.getMediaType(),r=n[t];return r||(r=g(e),n[t]=r),r}(e);if(0===x.state)return r;var N=a[l];if(!N)return r;if(r.reason.state=x.state,r.reason.throughput=C,r.reason.latency=R,isNaN(C))return r;switch(x.state){case 1:if(t=T.getQualityForBitrate(u,I,_.id,R),r.quality=t,r.reason.throughput=I,x.lastQuality=t,!isNaN(x.lastSegmentDurationS)&&A>=N.B_target){x.state=2,N.Q=s;for(var O=0;O<y;++O)O===x.lastQuality?N.prev_w[O]=1:N.prev_w[O]=0}break;case 2:var P=[],M=h.getCurrentHttpRequest(l).trace.reduce((function(e,t){return e+t.d}),0),k=h.getCurrentHttpRequest(l).trace.reduce((function(e,t){return e+t.b[0]}),0),L=Math.round(8*k/M);L<1&&(L=1);for(var F=x.lastSegmentDurationS,U=1,B=0;B<y;++B)p[B]=p[B]/1e3,D*p[B]>L&&(U=-1),N.w[B]=N.prev_w[B]+U*(F/(2*o))*((N.Q+s)*(D*p[B]/L));N.w=function(e){for(var t=e.length,n=!1,r=[],i=0;i<t;++i)r[i]=e[i];for(var a=e.sort((function(e,t){return t-e})),s=0,o=0,u=[],l=0;l<t-1;++l)if((o=((s+=a[l])-1)/(l+1))>=a[l+1]){n=!0;break}n||(o=(s+a[t-1]-1)/t);for(var c=0;c<t;++c)u[c]=Math.max(r[c]-o,0);return u}(N.w);for(var j=0;j<y;++j)P[j]=N.w[j]-N.prev_w[j],N.prev_w[j]=N.w[j];N.Q=Math.max(0,N.Q-F+F*D*((E(p,N.prev_w)+E(p,P))/L));for(var q=[],H=0;H<y;++H)q[H]=Math.abs(p[H]-E(N.w,p));(t=q.indexOf(Math.min.apply(Math,q)))>x.lastQuality&&p[x.lastQuality+1]<=L&&(t=x.lastQuality+1),p[t]>=L&&(N.Q=2*Math.max(s,N.Q)),r.quality=t,r.reason.throughput=C,r.reason.latency=R,r.reason.bufferLevel=A,x.lastQuality=r.quality;break;default:d.debug("L2A ABR rule invoked in bad state."),r.quality=T.getQualityForBitrate(u,I,_.id,R),r.reason.state=x.state,r.reason.throughput=I,r.reason.latency=R,x.state=1,m(x)}return r},reset:function(){S(),p.off(u.default.PLAYBACK_SEEKING,y,t),p.off(u.default.MEDIA_FRAGMENT_LOADED,v,t),p.off(u.default.METRIC_ADDED,_,t),p.off(u.default.QUALITY_CHANGE_REQUESTED,b,t)}},d=Object(l.default)(f).getInstance().getLogger(t),S(),p.on(u.default.PLAYBACK_SEEKING,y,t),p.on(u.default.MEDIA_FRAGMENT_LOADED,v,t),p.on(u.default.METRIC_ADDED,_,t),p.on(u.default.QUALITY_CHANGE_REQUESTED,b,t),t}d.__dashjs_factory_name="L2ARule",t.default=a.default.getClassFactory(d)},"./src/streaming/rules/abr/SwitchHistoryRule.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/core/Debug.js"),a=n("./src/streaming/rules/SwitchRequest.js");function s(){var e,t,n=this.context;return e={getMaxIndex:function(e){for(var r=e?e.getSwitchHistory():null,i=r?r.getSwitchRequests():[],s=0,o=0,u=0,l=Object(a.default)(n).create(),c=0;c<i.length;c++)if(void 0!==i[c]&&(s+=i[c].drops,o+=i[c].noDrops,u+=i[c].dropSize,s+o>=6&&s/o>.075)){l.quality=c>0&&i[c].drops>0?c-1:c,l.reason={index:l.quality,drops:s,noDrops:o,dropSize:u},t.debug("Switch history rule index: "+l.quality+" samples: "+(s+o)+" drops: "+s);break}return l}},t=Object(i.default)(n).getInstance().getLogger(e),e}s.__dashjs_factory_name="SwitchHistoryRule",t.default=r.default.getClassFactory(s)},"./src/streaming/rules/abr/ThroughputRule.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/rules/SwitchRequest.js"),a=n("./src/streaming/constants/Constants.js"),s=n("./src/streaming/constants/MetricsConstants.js");function o(e){e=e||{};var t=this.context,n=e.dashMetrics;return{getMaxIndex:function(e){var r=Object(i.default)(t).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("useBufferOccupancyABR")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("getScheduleController")))return r;!function(){if(!n||!n.hasOwnProperty("getCurrentBufferState"))throw new Error(a.default.MISSING_CONFIG_ERROR)}();var o=e.getMediaInfo(),u=e.getMediaType(),l=n.getCurrentBufferState(u),c=e.getScheduleController(),d=e.getAbrController(),f=e.getStreamInfo(),h=f?f.id:null,p=f&&f.manifestInfo?f.manifestInfo.isDynamic:null,g=d.getThroughputHistory(),m=g.getSafeAverageThroughput(u,p),y=g.getAverageLatency(u),v=e.useBufferOccupancyABR();return isNaN(m)||!l||v||d.getAbandonmentStateFor(h,u)!==s.default.ABANDON_LOAD&&(l.state===s.default.BUFFER_LOADED||p)&&(r.quality=d.getQualityForBitrate(o,m,h,y),c.setTimeToLoadDelay(0),r.reason={throughput:m,latency:y}),r},reset:function(){}}}o.__dashjs_factory_name="ThroughputRule",t.default=r.default.getClassFactory(o)},"./src/streaming/rules/abr/lolp/LearningAbrController.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/core/Debug.js"),a="manual_weight_selection",s="random_weight_selection",o="dynamic_weight_selection";function u(){var e,t,n,r,u,l,c,d,f,h=this.context;function p(){n=null,r=1,u=100,l=0,c=null,d=null,f=o}function g(){var e=0;if(n)for(var t=0;t<n.length;t++){var r=n[t];r.state.throughput>e&&(e=r.state.throughput)}return e}function m(e,t,n){var r=e.map((function(e,r){return n[r]*Math.pow(e-t[r],2)})).reduce((function(e,t){return e+t}));return(r<0?-1:1)*Math.sqrt(Math.abs(r))}function y(e,t){return m([e.state.throughput,e.state.latency,e.state.rebuffer,e.state.switch],[t.state.throughput,t.state.latency,t.state.rebuffer,t.state.switch],[1,1,1,1])}function v(e,t,n){for(var r=0;r<t.length;r++){var i=t[r],a=y(i,e);_(i,n,Math.exp(-1*Math.pow(a,2)/(2*Math.pow(.1,2))))}}function _(e,t,n){var r=e.state,i=[.01,.01,.01,.01];r.throughput=r.throughput+(t[0]-r.throughput)*i[0]*n,r.latency=r.latency+(t[1]-r.latency)*i[1]*n,r.rebuffer=r.rebuffer+(t[2]-r.rebuffer)*i[2]*n,r.switch=r.switch+(t[3]-r.switch)*i[3]*n}function T(e,t,n,r,i,a,s){c||(c=d[d.length-1]);var o=e.findWeightVector(t,n,r,i,a,s);null!==o&&-1!==o&&(c=o)}return e={getNextQuality:function(e,i,o,h,p,y,_){var b=o,E=h,S=i,w=function(e){if(!n){n=[];var t=e.bitrateList,i=[];l=t[0].bandwidth,t.forEach((function(e){i.push(e.bandwidth),e.bandwidth<l&&(l=e.bandwidth)})),o=i.map((function(e){return Math.pow(e,2)})).reduce((function(e,t){return e+t})),r=Math.sqrt(o);for(var a=0;a<t.length;a++){var s={qualityIndex:a,bitrate:t[a].bandwidth,state:{throughput:t[a].bandwidth/r,latency:0,rebuffer:0,switch:0}};n.push(s)}d=function(e){var t=[],n=function(e){for(var t=[],n=0;n<e;n++){var r=[Math.random()*g(),Math.random(),Math.random(),Math.random()];t.push(r)}return t}(Math.pow(e.length,2));t.push(n[0]);for(var r=[1,1,1,1],i=1;i<e.length;i++){for(var a=null,s=null,o=0;o<n.length;o++){for(var u=n[o],l=null,c=0;c<t.length;c++){var d=m(u,t[c],r);(null===l||d<l)&&(l=d)}(null===s||l>s)&&(a=u,s=l)}t.push(a)}for(var f=null,h=null,p=0;p<t.length;p++){for(var y=0,v=0;v<t.length;v++)p!==v&&(y+=m(t[p],t[v],r));(null===f||y>f)&&(f=y,h=p)}var _=[];for(_.push(t[h]),t.splice(h,1);t.length>0;){for(var T=null,b=null,E=0;E<t.length;E++){var S=m(_[0],t[E],r);(null===T||S<T)&&(T=S,b=E)}_.push(t[b]),t.splice(b,1)}return _}(n)}var o;return n}(e),A=i/r;A>1&&(A=g()),o/=u,t.debug("getNextQuality called throughput:".concat(A," latency:").concat(o," bufferSize:").concat(h," currentQualityIndex:").concat(y," playbackRate:").concat(p));var I=w[y],C=I.bitrate*_.getSegmentDuration()/S,R=Math.max(0,C-E);if(E-C<_.getMinBuffer())return t.debug("Buffer is low for bitrate= ".concat(I.bitrate," downloadTime=").concat(C," currentBuffer=").concat(E," rebuffer=").concat(R)),function(e,t){var r=0,i=e;if(n)for(var a=0;a<n.length;a++){var s=n[a];s.bitrate<e.bitrate&&s.bitrate>r&&t>s.bitrate&&(r=s.bitrate,i=s)}return i}(I,S).qualityIndex;switch(f){case a:c=[.4,.4,.4,.4];break;case s:!function(e){c=function(e,t){for(var n=[],r=Math.sqrt(2/e),i=0;i<t;i++)n.push(Math.random()*r);return c=n}(e.length,4)}(w);break;default:T(_,w,b,E,R,S,p)}for(var D=null,x=null,N=null,O=0;O<w.length;O++){var P=w[O],M=P.state,k=[M.throughput,M.latency,M.rebuffer,M.switch],L=c.slice(),F=_.getNextBufferWithBitrate(P.bitrate,E,S),U=F<_.getMinBuffer();U&&t.debug("Buffer is low for bitrate=".concat(P.bitrate," downloadTime=").concat(C," currentBuffer=").concat(E," nextBuffer=").concat(F)),(P.bitrate>i-1e4||U)&&P.bitrate!==l&&(L[0]=100);var B=m(k,[A,0,0,0],L);(null===D||B<D)&&(D=B,x=P.qualityIndex,N=P)}var j=Math.abs(I.bitrate-N.bitrate)/r;return v(I,w,[A,o,R,j]),v(N,w,[A,0,0,j]),x},reset:function(){p()}},t=Object(i.default)(h).getInstance().getLogger(e),p(),e}u.__dashjs_factory_name="LearningAbrController",t.default=r.default.getClassFactory(u)},"./src/streaming/rules/abr/lolp/LoLpQoEEvaluator.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/rules/abr/lolp/QoeInfo.js");function a(){var e,t,n,r,a;function s(){t=null,n=null,r=null,a=null}function o(e,t,n,r){var a=new i.default;return a.type=e,a.weights.bitrateReward=t||1,a.weights.bitrateSwitchPenalty=1,a.weights.rebufferPenalty=n||1e3,a.weights.latencyPenalty=[],a.weights.latencyPenalty.push({threshold:1.1,penalty:.05*r}),a.weights.latencyPenalty.push({threshold:1e8,penalty:.1*n}),a.weights.playbackSpeedPenalty=r||200,a}function u(e,t,n,r,i){i.bitrateWSum+=i.weights.bitrateReward*e,i.lastBitrate&&(i.bitrateSwitchWSum+=i.weights.bitrateSwitchPenalty*Math.abs(e-i.lastBitrate)),i.lastBitrate=e,i.rebufferWSum+=i.weights.rebufferPenalty*t;for(var a=0;a<i.weights.latencyPenalty.length;a++){var s=i.weights.latencyPenalty[a];if(n<=s.threshold){i.latencyWSum+=s.penalty*n;break}}i.playbackSpeedWSum+=i.weights.playbackSpeedPenalty*Math.abs(1-r),i.totalQoe=i.bitrateWSum-i.bitrateSwitchWSum-i.rebufferWSum-i.latencyWSum-i.playbackSpeedWSum}return e={setupPerSegmentQoe:function(e,i,s){t=o("segment",e,i,s),n=e,r=i,a=s},logSegmentMetrics:function(e,n,r,i){t&&u(e,n,r,i,t)},getPerSegmentQoe:function(){return t},calculateSingleUseQoe:function(e,t,i,s){var l=null;return n&&r&&a&&(l=o("segment",n,r,a)),l?(u(e,t,i,s,l),l.totalQoe):0},reset:function(){s()}},s(),e}a.__dashjs_factory_name="LoLpQoeEvaluator",t.default=r.default.getClassFactory(a)},"./src/streaming/rules/abr/lolp/LoLpRule.js":function(e,t,n){n.r(t);var r=n("./src/core/Debug.js"),i=n("./src/core/FactoryMaker.js"),a=n("./src/streaming/rules/abr/lolp/LearningAbrController.js"),s=n("./src/streaming/rules/abr/lolp/LoLpQoEEvaluator.js"),o=n("./src/streaming/rules/SwitchRequest.js"),u=n("./src/streaming/constants/MetricsConstants.js"),l=n("./src/streaming/rules/abr/lolp/LoLpWeightSelector.js"),c=n("./src/streaming/constants/Constants.js");function d(e){var t,n,i,d,f=(e=e||{}).dashMetrics,h=this.context;return n={getMaxIndex:function(e){try{var n=Object(o.default)(h).create(),r=e.getMediaInfo().type,a=e.getAbrController(),s=e.getStreamInfo(),p=a.getQualityFor(r,s.id),g=e.getMediaInfo(),m=f.getCurrentBufferState(r),y=e.getScheduleController(),v=f.getCurrentBufferLevel(r,!0),_=s&&s.manifestInfo?s.manifestInfo.isDynamic:null,T=y.getPlaybackController(),b=T.getCurrentLiveLatency();if(!e.useLoLPABR()||r===c.default.AUDIO)return n;b||(b=0);var E=T.getPlaybackRate(),S=a.getThroughputHistory().getSafeAverageThroughput(r,_);if(t.debug("Throughput ".concat(Math.round(S)," kbps")),isNaN(S)||!m)return n;if(a.getAbandonmentStateFor(s.id,r)===u.default.ABANDON_LOAD)return n;for(var w=g.bitrateList,A=e.getRepresentationInfo().fragmentDuration,I=w[0].bandwidth/1e3,C=w[w.length-1].bandwidth/1e3,R=0;R<w.length;R++){var D=w[R].bandwidth/1e3;D>C?C=D:D<I&&(I=D)}var x=w[p].bandwidth/1e3,N=f.getCurrentHttpRequest(r,!0),O=(N.tresponse.getTime()-N.trequest.getTime())/1e3,P=O>A?O-A:0;d.setupPerSegmentQoe(A,C,I),d.logSegmentMetrics(x,P,b,E);var M=Object(l.default)(h).create({targetLatency:1.5,bufferMin:.3,segmentDuration:A,qoeEvaluator:d});return n.quality=i.getNextQuality(g,1e3*S,b,v,E,p,M),n.reason={throughput:S,latency:b},n.priority=o.default.PRIORITY.STRONG,y.setTimeToLoadDelay(0),n.quality!==p&&console.log("[TgcLearningRule]["+r+"] requesting switch to index: ",n.quality,"Average throughput",Math.round(S),"kbps"),n}catch(e){throw e}},reset:function(){i.reset(),d.reset()}},t=Object(r.default)(h).getInstance().getLogger(n),i=Object(a.default)(h).create(),d=Object(s.default)(h).create(),n}d.__dashjs_factory_name="LoLPRule",t.default=i.default.getClassFactory(d)},"./src/streaming/rules/abr/lolp/LoLpWeightSelector.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js");function i(e){var t,n,r,i,a,s,o,u=e.targetLatency,l=e.bufferMin,c=e.segmentDuration,d=e.qoeEvaluator;function f(){return c}function h(e,t){var n=f();return t>n?e-n:e+n-t}return t={getMinBuffer:function(){return l},getSegmentDuration:f,getNextBufferWithBitrate:function(e,t,n){return h(t,e*c/n)},getNextBuffer:h,findWeightVector:function(e,t,i,a,s,o){var f=null,p=null,g=null,m=Math.abs(t-r);return e.forEach((function(e){n.forEach((function(n){n[0];var r=n[1],a=n[2],y=(n[3],e.bitrate*c/s),v=h(i,y),_=(0===a?10:1/a)*Math.max(1e-5,y-v),T=(0===r?10:1/r)*e.state.latency,b=d.calculateSingleUseQoe(e.bitrate,_,T,o);(null===f||b>f)&&function(e,t,n){return!(e>u+n)&&t>=l}(t,v,m)&&(f=b,p=n,g=e.bitrate)}))})),null===p&&null===g&&(p=-1),r=t,p}},a=4,s=(i=[.2,.4,.6,.8,1]).map((function(e){return[e]})),o=function e(t,n,r){if(r===n)return t;for(var a=t.length,s=0;s<a;s++)for(var o=t.shift(),u=0;u<i.length;u++)t.push(o.concat(i[u]));return e(t,n,r+1)},n=o(s,a,1),r=0,t}i.__dashjs_factory_name="LoLpWeightSelector",t.default=r.default.getClassFactory(i)},"./src/streaming/rules/abr/lolp/QoeInfo.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=null,this.lastBitrate=null,this.weights={},this.weights.bitrateReward=null,this.weights.bitrateSwitchPenalty=null,this.weights.rebufferPenalty=null,this.weights.latencyPenalty=null,this.weights.playbackSpeedPenalty=null,this.bitrateWSum=0,this.bitrateSwitchWSum=0,this.rebufferWSum=0,this.latencyWSum=0,this.playbackSpeedWSum=0,this.totalQoe=0}},"./src/streaming/text/EmbeddedTextHtmlRender.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js");function i(){var e=0;function t(e){for(var t="",n=0;n<e.length;++n)t+=e[n].uchar;return t.length-t.replace(/^\s+/,"").length}function n(e){return"left: "+3.125*e.x+"%; top: "+6.66*e.y1+"%; width: "+(100-3.125*e.x)+"%; height: "+6.66*Math.max(e.y2-1-e.y1,1)+"%; align-items: flex-start; overflow: visible; -webkit-writing-mode: horizontal-tb;"}function r(e){return"red"===e?"rgb(255, 0, 0)":"green"===e?"rgb(0, 255, 0)":"blue"===e?"rgb(0, 0, 255)":"cyan"===e?"rgb(0, 255, 255)":"magenta"===e?"rgb(255, 0, 255)":"yellow"===e?"rgb(255, 255, 0)":"white"===e?"rgb(255, 255, 255)":"black"===e?"rgb(0, 0, 0)":e}function i(e,t){var n=e.videoHeight/15;return t?"font-size: "+n+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; color: "+(t.foreground?r(t.foreground):"rgb(255, 255, 255)")+"; font-style: "+(t.italics?"italic":"normal")+"; text-decoration: "+(t.underline?"underline":"none")+"; white-space: pre; background-color: "+(t.background?r(t.background):"transparent")+";":"font-size: "+n+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; justify-content: flex-start; text-align: left; color: rgb(255, 255, 255); font-style: normal; white-space: pre; line-height: normal; font-weight: normal; text-decoration: none; width: 100%; display: flex;"}function a(e){return e.replace(/^\s+/g,"")}function s(e){return e.replace(/\s+$/g,"")}return{createHTMLCaptionsFromScreen:function(r,o,u,l){var c,d,f=null,h=!1,p=-1,g={start:o,end:u,spans:[]},m="style_cea608_white_black",y={},v={},_=[];for(c=0;c<15;++c){var T=l.rows[c],b="",E=null;if(!1===T.isEmpty()){var S=t(T.chars);null===f&&(f={x:S,y1:c,y2:c+1,p:[]}),S!==p&&h&&(f.p.push(g),g={start:o,end:u,spans:[]},f.y2=c,f.name="region_"+f.x+"_"+f.y1+"_"+f.y2,!1===y.hasOwnProperty(f.name)?(_.push(f),y[f.name]=f):y[f.name].p.contat(f.p),f={x:S,y1:c,y2:c+1,p:[]});for(var w=0;w<T.chars.length;++w){var A=T.chars[w],I=A.penState;if(null===E||!I.equals(E)){b.trim().length>0&&(g.spans.push({name:m,line:b,row:c}),b="");var C="style_cea608_"+I.foreground+"_"+I.background;I.underline&&(C+="_underline"),I.italics&&(C+="_italics"),v.hasOwnProperty(C)||(v[C]=JSON.parse(JSON.stringify(I))),E=I,m=C}b+=A.uchar}b.trim().length>0&&g.spans.push({name:m,line:b,row:c}),h=!0,p=S}else h=!1,p=-1,f&&(f.p.push(g),g={start:o,end:u,spans:[]},f.y2=c,f.name="region_"+f.x+"_"+f.y1+"_"+f.y2,!1===y.hasOwnProperty(f.name)?(_.push(f),y[f.name]=f):y[f.name].p.contat(f.p),f=null)}f&&(f.p.push(g),f.y2=c+1,f.name="region_"+f.x+"_"+f.y1+"_"+f.y2,!1===y.hasOwnProperty(f.name)?(_.push(f),y[f.name]=f):y[f.name].p.contat(f.p),f=null);var R=[];for(c=0;c<_.length;++c){var D=_[c],x="sub_cea608_"+e++,N=document.createElement("div");N.id=x;var O=n(D);N.style.cssText="position: absolute; margin: 0; display: flex; box-sizing: border-box; pointer-events: none;"+O;var P=document.createElement("div");P.className="paragraph bodyStyle",P.style.cssText=i(r);var M=document.createElement("div");M.className="cueUniWrapper",M.style.cssText="unicode-bidi: normal; direction: ltr;";for(var k=0;k<D.p.length;++k){var L=D.p[k],F=0;for(d=0;d<L.spans.length;++d){var U=L.spans[d];if(U.line.length>0){if(0!==d&&F!=U.row){var B=document.createElement("br");B.className="lineBreak",M.appendChild(B)}var j=!1;F===U.row&&(j=!0),F=U.row;var q=v[U.name],H=document.createElement("span");H.className="spanPadding "+U.name+" customSpanColor",H.style.cssText=i(r,q),0!==d&&j?d===L.spans.length-1?H.textContent=s(U.line):H.textContent=U.line:L.spans.length>1&&d<L.spans.length-1&&U.row===L.spans[d+1].row?H.textContent=a(U.line):H.textContent=U.line.trim(),M.appendChild(H)}}}P.appendChild(M),N.appendChild(P);var G={bodyStyle:["%",90]};for(var V in v)v.hasOwnProperty(V)&&(G[V]=["%",90]);R.push({type:"html",start:o,end:u,cueHTMLElement:N,cueID:x,cellResolution:[32,15],isFromCEA608:!0,fontSize:G,lineHeight:{},linePadding:{}})}return R}}}i.__dashjs_factory_name="EmbeddedTextHtmlRender",t.default=r.default.getSingletonFactory(i)},"./src/streaming/text/NotFragmentedTextBufferController.js":function(e,t,n){n.r(t);var r=n("./src/core/EventBus.js"),i=n("./src/core/events/Events.js"),a=n("./src/core/FactoryMaker.js"),s=n("./src/streaming/utils/InitCache.js"),o=n("./src/streaming/SourceBufferSink.js"),u=n("./src/streaming/vo/DashJSError.js"),l=n("./src/core/errors/Errors.js"),c="NotFragmentedTextBufferController";function d(e){e=e||{};var t,n,a,d,f,h,p=this.context,g=Object(r.default)(p).getInstance(),m=e.textController,y=e.errHandler,v=e.streamInfo,_=e.type;function T(e){d=e}function b(e){var t,r,a;n!==e&&(n=e)&&(t=i.default.BUFFERING_COMPLETED,a=r||{},g.trigger(t,a,{streamId:v.id,mediaType:_}))}function E(e){e.chunk.bytes&&!n&&(h.save(e.chunk),f.append(e.chunk),b(!0))}return t={initialize:function(e){T(e)},getStreamId:function(){return v.id},getType:function(){return _},getBufferControllerType:function(){return c},createBufferSink:function(e){return new Promise((function(t,n){try{(f=Object(o.default)(p).create({mediaSource:d,textController:m,eventBus:g})).initializeForFirstUse(v,e),a||(f.getBuffer()&&"function"==typeof f.getBuffer().initialize&&f.getBuffer().initialize(),a=!0),t(f)}catch(e){y.error(new u.default(l.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,l.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+_)),n(e)}}))},getBuffer:function(){return f},getBufferLevel:function(){return 0},getRangeAt:function(){return null},getAllRangesWithSafetyFactor:function(){return[]},getContinuousBufferTimeForTargetTime:function(){return Number.POSITIVE_INFINITY},setMediaSource:T,getMediaSource:function(){return d},appendInitSegmentFromCache:function(e){return null!==h.extract(v.id,e)},getIsBufferingCompleted:function(){return n},setIsBufferingCompleted:b,getIsPruningInProgress:function(){return!1},reset:function(e){g.off(i.default.INIT_FRAGMENT_LOADED,E,t),!e&&f&&(f.abort(),f.reset(),f=null)},clearBuffers:function(){return Promise.resolve()},prepareForPlaybackSeek:function(){return Promise.resolve()},prepareForReplacementTrackSwitch:function(){return n=!1,Promise.resolve()},setSeekTarget:function(){},updateAppendWindow:function(){return Promise.resolve()},pruneAllSafely:function(){return Promise.resolve()},updateBufferTimestampOffset:function(){return Promise.resolve()},segmentRequestingCompleted:function(){}},a=!1,d=null,n=!1,h=Object(s.default)(p).getInstance(),g.on(i.default.INIT_FRAGMENT_LOADED,E,t),t}d.__dashjs_factory_name=c,t.default=a.default.getClassFactory(d)},"./src/streaming/text/TextController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/core/FactoryMaker.js"),a=n("./src/streaming/text/TextSourceBuffer.js"),s=n("./src/streaming/text/TextTracks.js"),o=n("./src/streaming/utils/VTTParser.js"),u=n("./src/streaming/utils/TTMLParser.js"),l=n("./src/core/EventBus.js"),c=n("./src/core/events/Events.js"),d=n("./src/streaming/MediaPlayerEvents.js"),f=n("./src/streaming/utils/SupervisorTools.js");function h(e){var t,n,i,h,p,g,m,y,v,_,T,b,E,S=this.context,w=e.adapter,A=e.errHandler,I=e.manifestModel,C=e.mediaController,R=e.videoModel,D=e.settings;function x(e){var t=e.tracks,r=e.index,i=e.streamId;!1===D.get().streaming.text.defaultEnabled&&!O()||E?P(i,-1):(y&&t.some((function(e,t){if(C.matchSettings(y,e))return P(i,t),r=t,!0})),_=!1),n[i].lastEnabledIndex=r,m.trigger(d.default.TEXT_TRACKS_ADDED,{enabled:O(),index:r,tracks:t,streamId:i}),b=!0}function N(e){if(!v&&e&&e.newMediaInfo){var t=e.newMediaInfo;t.type===r.default.TEXT&&(y={lang:t.lang,role:t.roles[0],index:t.index,codec:t.codec,accessibility:t.accessibility[0]})}}function O(){var e=!0;return _&&!T&&(e=!1),e}function P(e,t){(_=-1===t)&&C&&C.saveTextSettingsDisabled();var n=M(e);if(n!==t&&h[e]){h[e].setModeForTrackIdx(n,r.default.TEXT_HIDDEN),h[e].setCurrentTrackIdx(t),h[e].setModeForTrackIdx(t,r.default.TEXT_SHOWING);var a=h[e].getCurrentTrackInfo();a&&a.isFragmented&&!a.isEmbedded?function(e,t,n){if(i[e])for(var a=i[e].getConfig().fragmentedTracks,s=0;s<a.length;s++){var o=a[s];if(t.lang===o.lang&&(o.id?t.id===o.id:t.index===o.index)){var u=C.getCurrentTrackFor(r.default.TEXT,e);(o.id?u.id!==o.id:u.index!==o.index)?(h[e].deleteCuesFromTrackIdx(n),i[e].setCurrentFragmentedTrackIdx(s)):-1===n&&m.trigger(c.default.SET_FRAGMENTED_TEXT_AFTER_DISABLED,{},{streamId:e,mediaType:r.default.TEXT})}}}(e,a,n):a&&!a.isFragmented&&function(e,t){m.trigger(c.default.SET_NON_FRAGMENTED_TEXT,{currentTrackInfo:t},{streamId:e,mediaType:r.default.TEXT})}(e,a),C.setTrack(a)}}function M(e){return h[e].getCurrentTrackIdx()}function k(){i={},h={},n={},_=!0,b=!1,E=!1}return t={deactivateStream:function(e){if(e){var t=e.id;i[t]&&i[t].resetMediaInfos(),h[t]&&h[t].deleteAllTextTracks()}},initialize:function(){m.on(c.default.CURRENT_TRACK_CHANGED,N,t),m.on(c.default.TEXT_TRACKS_QUEUE_INITIALIZED,x,t)},initializeForStream:function(e){var t=e.id,r=Object(s.default)(S).create({videoModel:R,streamInfo:e});r.initialize(),h[t]=r;var o=Object(a.default)(S).create({errHandler:A,adapter:w,manifestModel:I,mediaController:C,videoModel:R,textTracks:r,vttParser:p,ttmlParser:g,streamInfo:e});o.initialize(),i[t]=o,n[t]={},n[t].lastEnabledIndex=-1},createTracks:function(e){var t=e.id;h[t]&&h[t].createTracks()},getTextSourceBuffer:function(e){var t=e.id;if(i&&i[t])return i[t]},getAllTracksAreDisabled:function(){return _},addEmbeddedTrack:function(e,t){var n=e.id;i[n]&&i[n].addEmbeddedTrack(t)},setInitialSettings:function(e){y=e,v=!0},enableText:function(e,t){Object(f.checkParameterType)(t,"boolean"),O()!==t&&(t&&P(e,n[e].lastEnabledIndex),t||(n[e].lastEnabledIndex=M(e),b?P(e,-1):E=!0))},isTextEnabled:O,setTextTrack:P,getCurrentTrackIdx:M,enableForcedTextStreaming:function(e){Object(f.checkParameterType)(e,"boolean"),T=e},addMediaInfosToBuffer:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=e.id;i[a]&&i[a].addMediaInfos(t,n,r)},reset:function(){k(),m.off(c.default.CURRENT_TRACK_CHANGED,N,t),m.off(c.default.TEXT_TRACKS_QUEUE_INITIALIZED,x,t),Object.keys(i).forEach((function(e){i[e].resetEmbedded(),i[e].reset()}))}},y=null,T=!1,b=!1,v=!1,E=!1,p=Object(o.default)(S).getInstance(),g=Object(u.default)(S).getInstance(),m=Object(l.default)(S).getInstance(),k(),t}h.__dashjs_factory_name="TextController",t.default=i.default.getClassFactory(h)},"./src/streaming/text/TextSourceBuffer.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/streaming/vo/metrics/HTTPRequest.js"),a=n("./src/streaming/vo/TextTrackInfo.js"),s=n("./src/streaming/utils/BoxParser.js"),o=n("./src/streaming/utils/CustomTimeRanges.js"),u=n("./src/core/FactoryMaker.js"),l=n("./src/core/Debug.js"),c=n("./src/streaming/text/EmbeddedTextHtmlRender.js"),d=n("./node_modules/codem-isoboxer/dist/iso_boxer.js"),f=n.n(d),h=n("./externals/cea608-parser.js"),p=n.n(h),g=n("./src/core/EventBus.js"),m=n("./src/core/events/Events.js"),y=n("./src/streaming/vo/DashJSError.js"),v=n("./src/core/errors/Errors.js");function _(e){var t,n,u,d,h,_,T,b,E,S,w,A,I,C,R,D,x=e.errHandler,N=e.manifestModel,O=e.mediaController,P=e.videoModel,M=e.textTracks,k=e.vttParser,L=e.ttmlParser,F=e.streamInfo,U=this.context,B=Object(g.default)(U).getInstance(),j=!1;function q(){_=null,b=NaN,E=[],S=null,T=!1,h=[],d=null}function H(e){var t=new a.default;for(var n in e)t[n]=e[n];t.labels=e.labels,t.defaultTrack=function(e){var t=!1;return A.length>1&&e.isEmbedded?t=e.id&&e.id===r.default.CC1:1===A.length?e.id&&"string"==typeof e.id&&"CC"===e.id.substring(0,2)&&(t=!0):0===A.length&&(t=e.index===h[0].index),t}(e),t.isFragmented=e.isFragmented,t.isEmbedded=!!e.isEmbedded,t.isTTML=function(e){return e.codec&&e.codec.search(r.default.STPP)>=0||e.mimeType&&e.mimeType.search(r.default.TTML)>=0}(e),t.kind=function(e,t){var n=e.roles&&e.roles.length>0?t[e.roles[0]]:t.caption;return n===t.caption||n===t.subtitle?n:t.caption}(e,{subtitle:"subtitles",caption:"captions"}),M.addTextTrack(t)}function G(e){var t=e.chunk;t.mediaInfo.embeddedCaptions&&Y(t.bytes,t)}function V(e){w=e}function Y(e,a){var s=a.mediaInfo,o=s.type,l=s.mimeType,c=s.codec||l;c?-1!==s.codec.indexOf("application/mp4")?function(e,i,a){var s;if("InitializationSegment"===i.segmentType)T=!0,b=u.getMediaTimescaleFromMoov(e);else{if(!T)return;(s=u.getSamplesInfo(e).sampleList).length>0&&(S=s[0].cts-i.start*b),a.search(r.default.STPP)>=0?function(e,i,a){var s,o;for(d=null!==d?d:K(a),s=0;s<i.length;s++){var u=i[s],l=u.cts,c=Z(),h=c+l/b,p=h+u.duration/b;t.buffered.add(h,p);var g=new DataView(e,u.offset,u.subSizes[0]),m=f.a.Utils.dataViewToString(g,r.default.UTF8),y=[],v=u.offset+u.subSizes[0];for(o=1;o<u.subSizes.length;o++){var T=new Uint8Array(e,v,u.subSizes[o]),E=String.fromCharCode.apply(null,T);y.push(E),v+=u.subSizes[o]}try{var S=N.getValue().ttmlTimeIsRelative?l/b:0,A=d.parse(m,S,l/b,(l+u.duration)/b,y);M.addCaptions(w,c,A)}catch(e){_.removeExecutedRequestsBeforeTime(),this.remove(),n.error("TTML parser error: "+e.message)}}}(e,s,a):function(e,r){var i,a,s,o=[];for(i=0;i<r.length;i++){var u=r[i];u.cts-=S;var l=Z()+u.cts/b,c=l+u.duration/b;t.buffered.add(l,c);var d=e.slice(u.offset,u.offset+u.size),h=f.a.parseBuffer(d);for(a=0;a<h.boxes.length;a++){var p=h.boxes[a];if(n.debug("VTT box1: "+p.type),"vtte"!==p.type&&"vttc"===p.type)for(n.debug("VTT vttc boxes.length = "+p.boxes.length),s=0;s<p.boxes.length;s++){var g=p.boxes[s];if(n.debug("VTT box2: "+g.type),"payl"===g.type){var m=g.cue_text;n.debug("VTT cue_text = "+m);var y=u.cts/b,v=(u.cts+u.duration)/b;o.push({start:y,end:v,data:m,styles:{}}),n.debug("VTT "+y+"-"+v+" : "+m)}}}}o.length>0&&M.addCaptions(w,0,o)}(e,s)}}(e,a,c):o===r.default.VIDEO?function(e,t){var r,a;if(t.segmentType===i.HTTPRequest.INIT_SEGMENT_TYPE)0===I&&(I=u.getMediaTimescaleFromMoov(e));else if(t.segmentType===i.HTTPRequest.MEDIA_SEGMENT_TYPE){if(0===I)return void n.warn("CEA-608: No timescale for embeddedTextTrack yet");var s=(a=u.getSamplesInfo(e)).lastSequenceNumber;if(R[0]||R[1]||function(){for(var e,t=0;t<A.length;t++){if(-1===(e=M.getTrackIdxForId(A[t].id)))return void n.warn("CEA-608: data before track is ready.");var r=z(e);R[t]=new p.a.Cea608Parser(t+1,{newCue:r},null)}}(),I){if(null!==C&&s!==C+a.numSequences)for(r=0;r<R.length;r++)R[r]&&R[r].reset();for(var o=function(e,t){if(0===t.length)return null;for(var n={splits:[],fields:[[],[]]},r=new DataView(e),i=0;i<t.length;i++)for(var a=t[i],s=p.a.findCea608Nalus(r,a.offset,a.size),o=null,u=0,l=0;l<s.length;l++)for(var c=p.a.extractCea608DataFromRange(r,s[l]),d=0;d<2;d++)if(c[d].length>0){a.cts!==o?u=0:u+=1;var f=Z();n.fields[d].push([a.cts+f*I,c[d],u]),o=a.cts}return n.fields.forEach((function(e){e.sort((function(e,t){return e[0]===t[0]?e[2]-t[2]:e[0]-t[0]}))})),n}(e,a.sampleList),l=0;l<R.length;l++){var c=o.fields[l],d=R[l];if(d)for(r=0;r<c.length;r++)d.addData(c[r][0]/I,c[r][1])}C=s}}}(e,a):function(e,n,i){var a,s,o=new DataView(e,0,e.byteLength);s=f.a.Utils.dataViewToString(o,r.default.UTF8);try{a=K(i).parse(s,0),M.addCaptions(M.getCurrentTrackIdx(),0,a),t.buffered&&t.buffered.add(n.start,n.end)}catch(e){x.error(new y.default(v.default.TIMED_TEXT_ERROR_ID_PARSE_CODE,v.default.TIMED_TEXT_ERROR_MESSAGE_PARSE+e.message,s))}}(e,a,c):n.error("No text type defined")}function z(e){return function(t,n,r){var i;(i=P.getTTMLRenderingDiv()?D.createHTMLCaptionsFromScreen(P.getElement(),t,n,r):[{start:t,end:n,data:r.getDisplayText(),styles:{}}])&&M.addCaptions(e,0,i)}}function Z(){return isNaN(t.timestampOffset)?0:t.timestampOffset}function K(e){var t;return e.search(r.default.VTT)>=0?t=k:(e.search(r.default.TTML)>=0||e.search(r.default.STPP)>=0)&&(t=L),t}function W(e){A.forEach((function(t){var n=M.getTrackIdxForId(t.id);n>=0&&M.deleteCuesFromTrackIdx(n,e.from,e.to)}))}return t={initialize:function(){j||(A=[],w=null,I=0,R=[],C=null,j=!0,D=Object(c.default)(U).getInstance(),B.on(m.default.VIDEO_CHUNK_RECEIVED,G,t),B.on(m.default.BUFFER_CLEARED,W,t))},addMediaInfos:function(e,n,i){if(h=h.concat(n),e===r.default.TEXT&&n[0].isFragmented&&!n[0].isEmbedded){_=i,t.buffered=Object(o.default)(U).create(),E=O.getTracksFor(r.default.TEXT,F.id).filter((function(e){return e.isFragmented}));for(var a=O.getCurrentTrackFor(r.default.TEXT,F.id),s=0;s<E.length;s++)if(E[s]===a){V(s);break}}for(var u=0;u<n.length;u++)H(n[u])},resetMediaInfos:function(){h=[]},getStreamId:function(){return F.id},append:Y,abort:function(){},addEmbeddedTrack:function(e){if(j&&e)if(e.id===r.default.CC1||e.id===r.default.CC3){for(var t=0;t<A.length;t++)if(A[t].id===e.id)return;A.push(e)}else n.warn("Embedded track "+e.id+" not supported!")},resetEmbedded:function(){B.off(m.default.VIDEO_CHUNK_RECEIVED,G,t),B.off(m.default.BUFFER_CLEARED,W,t),M&&M.deleteAllTextTracks(),j=!1,A=[],R=[null,null],C=null},getConfig:function(){return{fragmentModel:_,fragmentedTracks:E,videoModel:P}},setCurrentFragmentedTrackIdx:V,remove:function(e,n){void 0===e&&e===n&&(e=t.buffered.start(0),n=t.buffered.end(t.buffered.length-1)),t.buffered.remove(e,n),M.deleteCuesFromTrackIdx(w,e,n)},reset:function(){q(),h=[],u=null}},n=Object(l.default)(U).getInstance().getLogger(t),u=Object(s.default)(U).getInstance(),q(),t}_.__dashjs_factory_name="TextSourceBuffer",t.default=u.default.getClassFactory(_)},"./src/streaming/text/TextTracks.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/core/EventBus.js"),a=n("./src/core/events/Events.js"),s=n("./src/streaming/MediaPlayerEvents.js"),o=n("./src/core/FactoryMaker.js"),u=n("./src/core/Debug.js"),l=n("./node_modules/imsc/src/main/js/main.js");function c(e){var t,n,o,c,d,f,h,p,g,m,y,v,_,T,b,E,S,w=this.context,A=Object(i.default)(w).getInstance(),I=e.videoModel,C=e.streamInfo;function R(e,t,n,r,i,a){var s=0,o=0;e/t>n/r?s=(o=t)/r*n:o=(s=e)/n*r;var u,l,c=0,d=0;return s/o>i?(d=o,c=o*i):(c=s,d=s/i),u=(e-c)/2,l=(t-d)/2,a?{x:u+.1*c,y:l+.1*d,w:.8*c,h:.8*d}:{x:u,y:l,w:c,h:d}}function D(e,t){var n=I.getClientWidth(),r=I.getClientHeight(),i=I.getVideoWidth(),a=I.getVideoHeight(),o=I.getVideoRelativeOffsetTop(),u=I.getVideoRelativeOffsetLeft();if(0!==i&&0!==a){var l=i/a,c=!1;e.isFromCEA608&&(l=3.5/3,c=!0);var d=R.call(this,n,r,i,a,l,c),f=d.w,v=d.h,b=d.x,S=d.y;if(f!=g||v!=m||b!=h||S!=p||t){if(h=b+u,p=S+o,g=f,m=v,y){var w=y.style;w&&(w.left=h+"px",w.top=p+"px",w.width=g+"px",w.height=m+"px",w.zIndex=_&&document[_]||T?E:null,A.trigger(s.default.CAPTION_CONTAINER_RESIZE))}var C=e.activeCues;if(C)for(var D=C.length,x=0;x<D;++x){var N=C[x];N.scaleCue(N)}}}}function x(e){var t,n,r,i,a,s=g,o=m;if(e.cellResolution){var u=[s/e.cellResolution[0],o/e.cellResolution[1]];if(e.linePadding)for(t in e.linePadding)if(e.linePadding.hasOwnProperty(t)){n=(e.linePadding[t]*u[0]).toString();for(var l=document.getElementsByClassName("spanPadding"),c=0;c<l.length;c++)l[c].style.cssText=l[c].style.cssText.replace(/(padding-left\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+n),l[c].style.cssText=l[c].style.cssText.replace(/(padding-right\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+n)}if(e.fontSize){for(t in e.fontSize)if(e.fontSize.hasOwnProperty(t)){"%"===e.fontSize[t][0]?r=e.fontSize[t][1]/100:"c"===e.fontSize[t][0]&&(r=e.fontSize[t][1]),n=(r*u[1]).toString(),a="defaultFontSize"!==t?document.getElementsByClassName(t):document.getElementsByClassName("paragraph");for(var d=0;d<a.length;d++)a[d].style.cssText=a[d].style.cssText.replace(/(font-size\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+n)}if(e.lineHeight)for(t in e.lineHeight)if(e.lineHeight.hasOwnProperty(t)){"%"===e.lineHeight[t][0]?i=e.lineHeight[t][1]/100:"c"===e.fontSize[t][0]&&(i=e.lineHeight[t][1]),n=(i*u[1]).toString(),a=document.getElementsByClassName(t);for(var f=0;f<a.length;f++)a[f].style.cssText=a[f].style.cssText.replace(/(line-height\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+n)}}}if(e.isd){var h=document.getElementById(e.cueID);h&&y.removeChild(h),N(e)}}function N(e){if(y){var t=document.createElement("div");y.appendChild(t),b=Object(l.renderHTML)(e.isd,t,(function(t){var n=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/,r=/^#(.*)$/;if(n.test(t)){var i=n.exec(t),a=parseInt(i[4],10)-1;return"data:image/png;base64,"+btoa(e.images[a])}if(r.test(t)){var s=r.exec(t)[1];return"data:image/png;base64,"+e.embeddedImages[s]}return null}),y.clientHeight,y.clientWidth,!1,(function(e){n.info("renderCaption :",e)}),b,!0),t.id=e.cueID,A.trigger(s.default.CAPTION_RENDERED,{captionDiv:t,currentTrackIdx:f})}}function O(e,t,i){var a=P(e),u=this;if(a&&Array.isArray(i)&&0!==i.length)for(var l=0;l<i.length;l++){var c=void 0,d=i[l];a.cellResolution=d.cellResolution,a.isFromCEA608=d.isFromCEA608,"html"!==d.type||!y||isNaN(d.start)||isNaN(d.end)?!d.data||isNaN(d.start)||isNaN(d.end)||(c=new o(d.start-t,d.end-t,d.data),d.styles&&(void 0!==d.styles.align&&"align"in c&&(c.align=d.styles.align),void 0!==d.styles.line&&"line"in c&&(c.line=d.styles.line),void 0!==d.styles.position&&"position"in c&&(c.position=d.styles.position),void 0!==d.styles.size&&"size"in c&&(c.size=d.styles.size)),c.onenter=function(){a.mode===r.default.TEXT_SHOWING&&A.trigger(s.default.CAPTION_RENDERED,{currentTrackIdx:f})}):((c=new o(d.start+t,d.end+t,"")).cueHTMLElement=d.cueHTMLElement,c.isd=d.isd,c.images=d.images,c.embeddedImages=d.embeddedImages,c.cueID=d.cueID,c.scaleCue=x.bind(u),c.cellResolution=d.cellResolution,c.lineHeight=d.lineHeight,c.linePadding=d.linePadding,c.fontSize=d.fontSize,y.style.left=h+"px",y.style.top=p+"px",y.style.width=g+"px",y.style.height=m+"px",c.onenter=function(){a.mode===r.default.TEXT_SHOWING&&(this.isd?(N(this),n.debug("Cue enter id:"+this.cueID)):(y.appendChild(this.cueHTMLElement),x.call(u,this),A.trigger(s.default.CAPTION_RENDERED,{captionDiv:this.cueHTMLElement,currentTrackIdx:f})))},c.onexit=function(){if(y)for(var e=y.childNodes,t=0;t<e.length;++t)e[t].id===this.cueID&&(n.debug("Cue exit id:"+e[t].id),y.removeChild(e[t]),--t)});try{c?L(a,c)||a.addCue(c):n.error("impossible to display subtitles.")}catch(e){throw U(a),a.addCue(c),e}}}function P(e){return e>=0&&c[e]?I.getTextTrack(c[e].kind,c[e].id,c[e].lang,c[e].isTTML,c[e].isEmbedded):null}function M(e){var t=this;if(e!==f){var n=P(f=e);k.call(this,n),v&&(clearInterval(v),v=null),n&&"html"===n.renderingType&&(D.call(this,n,!0),window.ResizeObserver?(S=new window.ResizeObserver((function(){D.call(t,n,!0)}))).observe(I.getElement()):v=setInterval(D.bind(this,n),500))}}function k(e){q.call(this),e&&"html"===e.renderingType?B.call(this):j.call(this)}function L(e,t){if(!e.cues)return!1;for(var n=0;n<e.cues.length;n++)if(e.cues[n].startTime===t.startTime&&e.cues[n].endTime===t.endTime)return!0;return!1}function F(e,t,n){return(isNaN(t)||e.startTime>=t)&&(isNaN(n)||e.endTime<=n)}function U(e,t,n){if(e.cues)for(var r=e.cues,i=r.length-1;i>=0;i--)F(r[i],t,n)&&(r[i].onexit&&r[i].onexit(),e.removeCue(r[i]))}function B(){var e=document.getElementById("native-cue-style");if(!e){(e=document.createElement("style")).id="native-cue-style",document.head.appendChild(e);var t=e.sheet,r=I.getElement();try{r&&(r.id?t.insertRule("#"+r.id+"::cue {background: transparent}",0):0!==r.classList.length?t.insertRule("."+r.className+"::cue {background: transparent}",0):t.insertRule("video::cue {background: transparent}",0))}catch(e){n.info(""+e.message)}}}function j(){var e=document.getElementById("native-cue-style");e&&document.head.removeChild(e)}function q(){if(y)for(;y.firstChild;)y.removeChild(y.firstChild)}return t={initialize:function(){"undefined"!=typeof window&&"undefined"!=typeof navigator&&(o=window.VTTCue||window.TextTrackCue,c=[],d=[],f=-1,h=0,p=0,g=0,m=0,y=null,v=null,T=!1,E=2147483647,b=null,void 0!==document.fullscreenElement?_="fullscreenElement":void 0!==document.webkitIsFullScreen?_="webkitIsFullScreen":document.msFullscreenElement?_="msFullscreenElement":document.mozFullScreen&&(_="mozFullScreen"))},getStreamId:function(){return C.id},addTextTrack:function(e){c.push(e)},addCaptions:O,createTracks:function(){c.sort((function(e,t){return e.index-t.index})),y=I.getTTMLRenderingDiv();for(var e,t,n,i,o,u,l=-1,h=0;h<c.length;h++){var p=(t=void 0,n=void 0,i=void 0,o=void 0,u=void 0,t=(e=c[h]).kind,n=void 0!==e.id?e.id:e.lang,i=e.lang,o=e.isTTML,u=e.isEmbedded,I.addTextTrack(t,n,i,o,u));d.push(p),c[h].defaultTrack&&(p.default=!0,l=h);var g=P(h);g&&(g.mode=r.default.TEXT_SHOWING,y&&(c[h].isTTML||c[h].isEmbedded)?g.renderingType="html":g.renderingType="default"),O(h,0,c[h].captionData),A.trigger(s.default.TEXT_TRACK_ADDED)}if(M.call(this,l),l>=0){A.on(s.default.PLAYBACK_METADATA_LOADED,(function e(){var t=P(l);t&&"html"===t.renderingType&&D.call(this,t,!0),A.off(s.default.PLAYBACK_METADATA_LOADED,e,this)}),this);for(var m=0;m<c.length;m++){var v=P(m);v&&(v.mode=m===l?r.default.TEXT_SHOWING:r.default.TEXT_HIDDEN)}}A.trigger(a.default.TEXT_TRACKS_QUEUE_INITIALIZED,{index:f,tracks:c,streamId:C.id})},getCurrentTrackIdx:function(){return f},setCurrentTrackIdx:M,getTrackIdxForId:function(e){for(var t=-1,n=0;n<c.length;n++)if(c[n].id===e){t=n;break}return t},getCurrentTrackInfo:function(){return c[f]},setModeForTrackIdx:function(e,t){var n=P(e);n&&n.mode!==t&&(n.mode=t)},deleteCuesFromTrackIdx:function(e,t,n){var r=P(e);r&&U(r,t,n)},deleteAllTextTracks:function(){for(var e=d?d.length:0,t=0;t<e;t++){var n=P(t);n&&U.call(this,n,C.start,C.start+C.duration)}d=[],c=[],v&&(clearInterval(v),v=null),S&&I&&(S.unobserve(I.getElement()),S=null),f=-1,q.call(this)},deleteTextTrack:function(e){I.removeChild(d[e]),d.splice(e,1)}},n=Object(u.default)(w).getInstance().getLogger(t),t}c.__dashjs_factory_name="TextTracks",t.default=o.default.getClassFactory(c)},"./src/streaming/thumbnail/ThumbnailController.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/constants/Constants.js"),a=n("./src/streaming/vo/Thumbnail.js"),s=n("./src/streaming/thumbnail/ThumbnailTracks.js"),o=n("./src/streaming/vo/BitrateInfo.js"),u=n("./src/dash/utils/SegmentsUtils.js");function l(e){var t,n,r=this.context,l=e.streamInfo;function c(e){n.setTrackByIndex(e)}function d(){n&&n.reset()}return t={getStreamId:function(){return l.id},initialize:function(){n.addTracks();var e=n.getTracks();e&&e.length>0&&c(0)},provide:function(e,t){if("function"==typeof t){var r,i,s=n.getCurrentTrack();if(!s||s.segmentDuration<=0||null==e)t(null);else{(i=n.getThumbnailRequestForTime(e))&&(s.segmentDuration=i.duration),r=e%s.segmentDuration;var o=Math.floor(r*s.tilesHor*s.tilesVert/s.segmentDuration),l=new a.default;if(l.width=Math.floor(s.widthPerTile),l.height=Math.floor(s.heightPerTile),l.x=Math.floor(o%s.tilesHor)*s.widthPerTile,l.y=Math.floor(o/s.tilesHor)*s.heightPerTile,"readThumbnail"in s)return s.readThumbnail(e,(function(e){l.url=e,t(l)}));if(i)l.url=i.url,s.segmentDuration=NaN;else{var c=Math.floor(e/s.segmentDuration);l.url=function(e,t){var n=t+e.startNumber,r=Object(u.replaceTokenForTemplate)(e.templateUrl,"Number",n);return r=Object(u.replaceTokenForTemplate)(r,"Time",(n-1)*e.segmentDuration*e.timescale),r=Object(u.replaceTokenForTemplate)(r,"Bandwidth",e.bandwidth),Object(u.unescapeDollarsInTemplate)(r)}(s,c)}t(l)}}},setTrackByIndex:c,getCurrentTrackIndex:function(){return n.getCurrentTrackIndex()},getBitrateList:function(){var e=n.getTracks(),t=0;return e.map((function(e){var n=new o.default;return n.mediaType=i.default.IMAGE,n.qualityIndex=t++,n.bitrate=e.bitrate,n.width=e.width,n.height=e.height,n}))},reset:d},d(),n=Object(s.default)(r).create({streamInfo:l,adapter:e.adapter,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:e.debug,eventBus:e.eventBus,events:e.events,dashConstants:e.dashConstants,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController}),t}l.__dashjs_factory_name="ThumbnailController",t.default=r.default.getClassFactory(l)},"./src/streaming/thumbnail/ThumbnailTracks.js":function(e,t,n){n.r(t),n.d(t,"THUMBNAILS_SCHEME_ID_URIS",(function(){return h}));var r=n("./src/streaming/constants/Constants.js"),i=n("./src/dash/constants/DashConstants.js"),a=n("./src/core/FactoryMaker.js"),s=n("./src/streaming/vo/ThumbnailTrackInfo.js"),o=n("./src/streaming/utils/URLUtils.js"),u=n("./src/dash/utils/SegmentsUtils.js"),l=n("./src/streaming/utils/BoxParser.js"),c=n("./src/streaming/net/XHRLoader.js"),d=n("./src/dash/DashHandler.js"),f=n("./src/dash/controllers/SegmentsController.js"),h=["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"];function p(e){var t,n,a,p,g,m,y,v,_=this.context,T=e.adapter,b=e.baseURLController,E=e.streamInfo,S=e.timelineConverter,w=e.debug,A=e.eventBus,I=e.events,C=e.dashConstants,R=Object(o.default)(_).getInstance();function D(e,t){var r=new s.default;r.id=e.id,r.bitrate=e.bandwidth,r.width=e.width,r.height=e.height,r.tilesHor=1,r.tilesVert=1,e.essentialProperties&&e.essentialProperties.forEach((function(e){if(h.indexOf(e.schemeIdUri)>=0&&e.value){var t=e.value.split("x");2!==t.length||isNaN(t[0])||isNaN(t[1])||(r.tilesHor=parseInt(t[0],10),r.tilesVert=parseInt(t[1],10))}})),t?m.updateSegmentData(e).then((function(t){!function(e,t,n){var r=[],i=function(e,t){var n,r,i,a,s=[],o=0;for(n=0,r=e.segments.length;n<r;n++)i=e.segments[n],(a=Object(u.getTimeBasedSegment)(S,T.getIsDynamic(),t,i.startTime,i.duration,i.timescale,i.media,i.mediaRange,o))&&(s.push(a),a=null,o++);return s}(n,t);t.segments=i,e.segmentDuration=t.segments[0].duration,e.readThumbnail=function(e,n){var i=null;r.some((function(t){if(t.start<=e&&t.end>e)return i=t.url,!0})),i?n(i):t.segments.some((function(i){if(i.mediaStartTime<=e&&i.mediaStartTime+i.duration>e){var a=b.resolve(t.path);return y.load({method:"get",url:a.url,request:{range:i.mediaRange,responseType:"arraybuffer"},onload:function(e){var t=v.getSamplesInfo(e.target.response),a=new Blob([e.target.response.slice(t.sampleList[0].offset,t.sampleList[0].offset+t.sampleList[0].size)],{type:"image/jpeg"}),s=window.URL.createObjectURL(a);r.push({start:i.mediaStartTime,end:i.mediaStartTime+i.duration,url:s}),n&&n(s)}}),!0}}))}}(r,e,t)})):(r.startNumber=e.startNumber,r.segmentDuration=e.segmentDuration,r.timescale=e.timescale,r.templateUrl=function(e){var t=R.isRelative(e.media)?R.resolve(e.media,b.resolve(e.path).url):e.media;return t?Object(u.replaceIDForTemplate)(t,e.id):""}(e)),r.tilesHor>0&&r.tilesVert>0&&(r.widthPerTile=r.width/r.tilesHor,r.heightPerTile=r.height/r.tilesVert,n.push(r))}function x(){n=[],p=-1,g=null}return t={getTracks:function(){return n},addTracks:function(){if(E&&T&&(g=T.getMediaInfoForType(E,r.default.IMAGE))){var e=T.getVoRepresentations(g);e&&e.length>0&&e.forEach((function(e){(e.segmentInfoType===i.default.SEGMENT_TEMPLATE&&e.segmentDuration>0&&e.media||e.segmentInfoType===i.default.SEGMENT_TIMELINE)&&D(e),e.segmentInfoType===i.default.SEGMENT_BASE&&D(e,!0)})),n.length>0&&n.sort((function(e,t){return e.bitrate-t.bitrate}))}},reset:x,setTrackByIndex:function(e){n&&0!==n.length&&(e>=n.length&&(e=n.length-1),p=e)},getCurrentTrack:function(){return p<0?null:n[p]},getCurrentTrackIndex:function(){return p},getThumbnailRequestForTime:function(e){for(var t,r=T.getVoRepresentations(g),i=0;i<r.length;i++)if(n[p].id===r[i].id){t=r[i];break}return a.getSegmentRequestForTime(g,t,e)}},x(),y=Object(c.default)(_).create({}),v=Object(l.default)(_).getInstance(),m=Object(f.default)(_).create({events:I,eventBus:A,streamInfo:E,timelineConverter:S,dashConstants:C,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController,type:r.default.IMAGE}),(a=Object(d.default)(_).create({streamInfo:E,type:r.default.IMAGE,timelineConverter:S,segmentsController:m,baseURLController:b,debug:w,eventBus:A,events:I,dashConstants:C,urlUtils:R})).initialize(!!T&&T.getIsDynamic()),t}p.__dashjs_factory_name="ThumbnailTracks",t.default=a.default.getClassFactory(p)},"./src/streaming/utils/BaseURLSelector.js":function(e,t,n){n.r(t);var r=n("./src/core/errors/Errors.js"),i=n("./src/core/EventBus.js"),a=n("./src/core/events/Events.js"),s=n("./src/streaming/controllers/BlacklistController.js"),o=n("./src/streaming/utils/baseUrlResolution/DVBSelector.js"),u=n("./src/streaming/utils/baseUrlResolution/BasicSelector.js"),l=n("./src/core/FactoryMaker.js"),c=n("./src/streaming/vo/DashJSError.js"),d=n("./src/streaming/utils/SupervisorTools.js");function f(){var e,t,n,l,f,h=this.context,p=Object(i.default)(h).getInstance();function g(){t.reset()}return e={chooseSelector:function(e){Object(d.checkParameterType)(e,"boolean"),f=e?l:n},select:function(e){if(e){var t=e.baseUrls,i=e.selectedIdx;if(!isNaN(i))return t[i];var s=f.select(t);return s?(e.selectedIdx=t.indexOf(s),s):(p.trigger(a.default.URL_RESOLUTION_FAILED,{error:new c.default(r.default.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE,r.default.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE)}),void(f===n&&g()))}},reset:g,setConfig:function(e){e.selector&&(f=e.selector)}},t=Object(s.default)(h).create({updateEventName:a.default.SERVICE_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:a.default.SERVICE_LOCATION_BLACKLIST_ADD}),n=Object(u.default)(h).create({blacklistController:t}),l=Object(o.default)(h).create({blacklistController:t}),f=n,e}f.__dashjs_factory_name="BaseURLSelector",t.default=l.default.getClassFactory(f)},"./src/streaming/utils/BoxParser.js":function(e,t,n){n.r(t);var r=n("./src/core/Debug.js"),i=n("./src/streaming/utils/IsoFile.js"),a=n("./src/core/FactoryMaker.js"),s=n("./node_modules/codem-isoboxer/dist/iso_boxer.js"),o=n.n(s),u=n("./src/streaming/vo/IsoBoxSearchInfo.js");function l(){var e,t,n=this.context;function a(e){if(!e)return null;void 0===e.fileStart&&(e.fileStart=0);var t=o.a.parseBuffer(e),r=Object(i.default)(n).create();return r.setData(t),r}function s(e,t){return e[t+3]>>>0|e[t+2]<<8>>>0|e[t+1]<<16>>>0|e[t]<<24>>>0}function l(e,t){return String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t])}return t={parse:a,findLastTopIsoBoxCompleted:function(e,t,n){if(void 0===n&&(n=0),!t||n+8>=t.byteLength)return new u.default(0,!1);for(var r,i=t instanceof ArrayBuffer?new Uint8Array(t):t,a=0;n<i.byteLength;){var o=s(i,n),c=l(i,n+4);if(0===o)break;n+o<=i.byteLength&&(e.indexOf(c)>=0?r=new u.default(n,!0,o):a=n+o),n+=o}return r||new u.default(a,!1)},getMediaTimescaleFromMoov:function(e){var t=a(e),n=t?t.getBox("mdhd"):void 0;return n?n.timescale:NaN},getSamplesInfo:function(e){if(!e||0===e.byteLength)return{sampleList:[],lastSequenceNumber:NaN,totalDuration:NaN,numSequences:NaN};var t,n,r,i,s,o,u,l,c,d,f,h,p,g,m,y,v=a(e),_=v.getBoxes("moof"),T=v.getBoxes("mfhd");m=v.getBoxes("moof").length,g=T[T.length-1].sequence_number,n=0,s=[];var b=-1,E=-1;for(d=0;d<_.length;d++){var S=_[d],w=S.getChildBoxes("traf");for(l=0;l<w.length;l++){var A=w[l],I=A.getChildBox("tfhd"),C=A.getChildBox("tfdt");i=C.baseMediaDecodeTime;var R=A.getChildBoxes("trun"),D=A.getChildBoxes("subs");for(c=0;c<R.length;c++){var x=R[c];for(n=x.sample_count,p=(I.base_data_offset||0)+(x.data_offset||0),u=0;u<n;u++){t=void 0!==(o=x.samples[u]).sample_duration?o.sample_duration:I.default_sample_duration,r=void 0!==o.sample_size?o.sample_size:I.default_sample_size;var N={dts:i,cts:i+(void 0!==o.sample_composition_time_offset?o.sample_composition_time_offset:0),duration:t,offset:S.offset+p,size:r,subSizes:[r]};if(D)for(f=0;f<D.length;f++){var O=D[f];if(b<O.entry_count-1&&u>E&&(b++,E+=O.entries[b].sample_delta),u==E){N.subSizes=[];var P=O.entries[b];for(h=0;h<P.subsample_count;h++)N.subSizes.push(P.subsamples[h].subsample_size)}}s.push(N),p+=r,i+=t}}y=i-C.baseMediaDecodeTime}}return{sampleList:s,lastSequenceNumber:g,totalDuration:y,numSequences:m}},findInitRange:function(t){var n=null,r=a(t);if(!r)return n;var i=r.getBox("ftyp"),s=r.getBox("moov");return e.debug("Searching for initialization."),s&&s.isComplete&&(n=(i?i.offset:s.offset)+"-"+(s.offset+s.size-1),e.debug("Found the initialization. Range: "+n)),n},parsePayload:function(e,t,n){if(void 0===n&&(n=0),!t||n+8>=t.byteLength)return new u.default(0,!1);for(var r,i=t instanceof ArrayBuffer?new Uint8Array(t):t,a=0;n<i.byteLength;){var o=s(i,n),c=l(i,n+4);if(0===o)break;n+o<=i.byteLength&&(e.indexOf(c)>=0?r=new u.default(n,!0,o,c):a=n+o),n+=o}return r||new u.default(a,!1)}},e=Object(r.default)(n).getInstance().getLogger(t),t}l.__dashjs_factory_name="BoxParser",t.default=a.default.getSingletonFactory(l)},"./src/streaming/utils/Capabilities.js":function(e,t,n){n.r(t),n.d(t,"supportsMediaSource",(function(){return o}));var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/thumbnail/ThumbnailTracks.js"),a=n("./src/streaming/constants/Constants.js"),s=[{codec:"avc1",compatibleCodecs:["avc3"]},{codec:"avc3",compatibleCodecs:["avc1"]}];function o(){var e="WebKitMediaSource"in window,t="MediaSource"in window;return e||t}function u(){var e,t,n;return e={setConfig:function(e){e&&e.settings&&(t=e.settings)},supportsMediaSource:o,supportsEncryptedMedia:function(){return n},supportsCodec:function(e,n){return n!==a.default.AUDIO&&n!==a.default.VIDEO?Promise.resolve(!0):function(e,n){return t.get().streaming.capabilities.useMediaCapabilitiesApi&&navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo&&(e.codec&&n===a.default.AUDIO||n===a.default.VIDEO&&e.codec&&e.width&&e.height&&e.bitrate&&e.framerate)}(e,n)?function(e,t){return new Promise((function(n){if(e&&e.codec){var r={type:"media-source"};r[t]={},r[t].contentType=e.codec,r[t].width=e.width,r[t].height=e.height,r[t].bitrate=parseInt(e.bitrate),r[t].framerate=parseFloat(e.framerate),navigator.mediaCapabilities.decodingInfo(r).then((function(e){n(e.supported)})).catch((function(){n(!1)}))}else n(!1)}))}(e,n):function(e){return new Promise((function(t){if(e&&e.codec){var n=e.codec;e.width&&e.height&&(n+=';width="'+e.width+'";height="'+e.height+'"'),"MediaSource"in window&&MediaSource.isTypeSupported(n)||"WebKitMediaSource"in window&&WebKitMediaSource.isTypeSupported(n)?t(!0):t(!1)}else t(!1)}))}(e)},setEncryptedMediaSupported:function(e){n=e},supportsEssentialProperty:function(e){try{return-1!==i.THUMBNAILS_SCHEME_ID_URIS.indexOf(e.schemeIdUri)}catch(e){return!0}},codecRootCompatibleWithCodec:function(e,t){for(var n,r=e.split(".")[0],i=0===t.indexOf(r),a=0;a<s.length;a++)if(s[a].codec===r){n=s[a];break}return n?i||n.compatibleCodecs.some((function(e){return 0===t.indexOf(e)})):i}},n=!1,e}u.__dashjs_factory_name="Capabilities",t.default=r.default.getSingletonFactory(u)},"./src/streaming/utils/CapabilitiesFilter.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/core/Debug.js"),a=n("./src/streaming/constants/Constants.js");function s(){var e,t,n,r,s,o,u=this.context;function l(e,r){if(!r||!r.Period_asArray||0===r.Period_asArray.length)return Promise.resolve();var i=[];return r.Period_asArray.forEach((function(r){i.push(function(e,r){return new Promise((function(i){if(e&&e.AdaptationSet_asArray&&0!==e.AdaptationSet_asArray.length){var o=[];e.AdaptationSet_asArray.forEach((function(e){t.getIsTypeOf(e,r)&&o.push(function(e,r){return new Promise((function(i){if(e.Representation_asArray&&0!==e.Representation_asArray.length){var o=[],u=[];e.Representation_asArray.forEach((function(i,s){var l=t.getCodec(e,s,!1),c=function(e,t,n){switch(e){case a.default.VIDEO:return function(e,t){return{codec:t,width:e.width||null,height:e.height||null,framerate:e.frameRate||null,bitrate:e.bandwidth||null}}(t,n);case a.default.AUDIO:return function(e,t){var n=e.audioSamplingRate||null;return{codec:t,bitrate:e.bandwidth||null,samplerate:n}}(t,n);default:return null}}(r,i,l);u.push(c),o.push(n.supportsCodec(c,r))})),Promise.all(o).then((function(t){e.Representation_asArray=e.Representation_asArray.filter((function(e,n){return t[n]||s.debug("[Stream] Codec ".concat(u[n].codec," not supported ")),t[n]})),i()})).catch((function(){i()}))}else i()}))}(e,r))})),Promise.all(o).then((function(){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter((function(e){var t=e.Representation_asArray&&e.Representation_asArray.length>0;return t||s.warn("AdaptationSet has been removed because of no supported Representation"),t})),i()})).catch((function(){i()}))}else i()}))}(r,e))})),Promise.all(i)}return e={setConfig:function(e){e&&(e.adapter&&(t=e.adapter),e.capabilities&&(n=e.capabilities),e.settings&&(r=e.settings))},filterUnsupportedFeatures:function(e){return new Promise((function(i){var u=[];u.push(l(a.default.VIDEO,e)),u.push(l(a.default.AUDIO,e)),Promise.all(u).then((function(){r.get().streaming.capabilities.filterUnsupportedEssentialProperties&&function(e){e&&e.Period_asArray&&0!==e.Period_asArray.length&&e.Period_asArray.forEach((function(e){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter((function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter((function(e){var r=t.getEssentialPropertiesForRepresentation(e);if(r&&r.length>0)for(var i=0;i<r.length;){if(!n.supportsEssentialProperty(r[i]))return s.debug("[Stream] EssentialProperty not supported: "+r[i].schemeIdUri),!1;i+=1}return!0})),e.Representation_asArray&&e.Representation_asArray.length>0)}))}))}(e),function(e){o&&0!==o.length&&e&&e.Period_asArray&&0!==e.Period_asArray.length&&e.Period_asArray.forEach((function(e){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter((function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter((function(e){return!o.some((function(t){return!t(e)}))})),e.Representation_asArray&&e.Representation_asArray.length>0)}))}))}(e),i()})).catch((function(){i()}))}))},setCustomCapabilitiesFilters:function(e){o=e}},s=Object(i.default)(u).getInstance().getLogger(e),e}s.__dashjs_factory_name="CapabilitiesFilter",t.default=r.default.getSingletonFactory(s)},"./src/streaming/utils/CustomTimeRanges.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/utils/SupervisorTools.js");function a(){return{customTimeRangeArray:[],length:0,add:function(e,t){var n=0;for(n=0;n<this.customTimeRangeArray.length&&e>this.customTimeRangeArray[n].start;n++);for(this.customTimeRangeArray.splice(n,0,{start:e,end:t}),n=0;n<this.customTimeRangeArray.length-1;n++)this.mergeRanges(n,n+1)&&n--;this.length=this.customTimeRangeArray.length},clear:function(){this.customTimeRangeArray=[],this.length=0},remove:function(e,t){for(var n=0;n<this.customTimeRangeArray.length;n++)if(e<=this.customTimeRangeArray[n].start&&t>=this.customTimeRangeArray[n].end)this.customTimeRangeArray.splice(n,1),n--;else{if(e>this.customTimeRangeArray[n].start&&t<this.customTimeRangeArray[n].end){this.customTimeRangeArray.splice(n+1,0,{start:t,end:this.customTimeRangeArray[n].end}),this.customTimeRangeArray[n].end=e;break}e>this.customTimeRangeArray[n].start&&e<this.customTimeRangeArray[n].end?this.customTimeRangeArray[n].end=e:t>this.customTimeRangeArray[n].start&&t<this.customTimeRangeArray[n].end&&(this.customTimeRangeArray[n].start=t)}this.length=this.customTimeRangeArray.length},mergeRanges:function(e,t){var n=this.customTimeRangeArray[e],r=this.customTimeRangeArray[t];return n.start<=r.start&&r.start<=n.end&&n.end<=r.end?(n.end=r.end,this.customTimeRangeArray.splice(t,1),!0):r.start<=n.start&&n.start<=r.end&&r.end<=n.end?(n.start=r.start,this.customTimeRangeArray.splice(t,1),!0):r.start<=n.start&&n.start<=r.end&&n.end<=r.end?(this.customTimeRangeArray.splice(e,1),!0):n.start<=r.start&&r.start<=n.end&&r.end<=n.end&&(this.customTimeRangeArray.splice(t,1),!0)},start:function(e){return Object(i.checkInteger)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].start},end:function(e){return Object(i.checkInteger)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].end}}}a.__dashjs_factory_name="CustomTimeRanges",t.default=r.default.getClassFactory(a)},"./src/streaming/utils/DOMStorage.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/core/Debug.js"),a=n("./src/streaming/constants/Constants.js"),s=[{oldKey:"dashjs_vbitrate",newKey:"dashjs_video_bitrate"},{oldKey:"dashjs_abitrate",newKey:"dashjs_audio_bitrate"},{oldKey:"dashjs_vsettings",newKey:"dashjs_video_settings"},{oldKey:"dashjs_asettings",newKey:"dashjs_audio_settings"}],o="dashjs_?_bitrate",u="dashjs_?_settings",l="localStorage",c="lastBitrate",d="lastMediaSettings";function f(e){e=e||{};var t,n,r,f=this.context,h=e.settings;function p(e){if(void 0!==r)return r;var t;r=!1;try{"undefined"!=typeof window&&(t=window[e])}catch(e){return n.warn("DOMStorage access denied: "+e.message),r}if(!t||e!==l&&"sessionStorage"!==e)return r;try{t.setItem("1","1"),t.removeItem("1"),r=!0}catch(e){n.warn("DOMStorage is supported, but cannot be used: "+e.message)}return r}function g(){var e=6e5;return Math.round((new Date).getTime()/e)*e}function m(e,t){return p(e)&&h.get().streaming[t+"CachingInfo"].enabled}function y(){if(!h)throw new Error(a.default.MISSING_CONFIG_ERROR)}return t={getSavedBitrateSettings:function(e){var t=NaN;if(y(),m(l,c)){var r=o.replace(/\?/,e);try{var i=JSON.parse(localStorage.getItem(r))||{},a=(new Date).getTime()-parseInt(i.timestamp,10)>=h.get().streaming.lastBitrateCachingInfo.ttl||!1,s=parseFloat(i.bitrate);isNaN(s)||a?a&&localStorage.removeItem(r):(t=s,n.debug("Last saved bitrate for "+e+" was "+s))}catch(e){return null}}return t},setSavedBitrateSettings:function(e,t){if(m(l,c)&&t){var r=o.replace(/\?/,e);try{localStorage.setItem(r,JSON.stringify({bitrate:t.toFixed(3),timestamp:g()}))}catch(e){n.error(e.message)}}},getSavedMediaSettings:function(e){var t=null;if(y(),m(l,d)){var n=u.replace(/\?/,e);try{var r=JSON.parse(localStorage.getItem(n))||{},i=(new Date).getTime()-parseInt(r.timestamp,10)>=h.get().streaming.lastMediaSettingsCachingInfo.ttl||!1;t=r.settings,i&&(localStorage.removeItem(n),t=null)}catch(e){return null}}return t},setSavedMediaSettings:function(e,t){if(m(l,d)){var r=u.replace(/\?/,e);try{localStorage.setItem(r,JSON.stringify({settings:t,timestamp:g()}))}catch(e){n.error(e.message)}}}},n=Object(i.default)(f).getInstance().getLogger(t),p(l)&&s.forEach((function(e){var t=localStorage.getItem(e.oldKey);if(t){localStorage.removeItem(e.oldKey);try{localStorage.setItem(e.newKey,t)}catch(e){n.error(e.message)}}})),t}f.__dashjs_factory_name="DOMStorage";var h=r.default.getSingletonFactory(f);t.default=h},"./src/streaming/utils/DefaultURLUtils.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js");function i(){var e,t=/^[a-z][a-z0-9+\-_.]*:/i,n=/^https?:\/\//i,r=/^https:\/\//i,i=/^([a-z][a-z0-9+\-_.]*:\/\/[^\/]+)\/?/i,a=function(e,t){try{return new window.URL(e,t).toString()}catch(t){return e}},s=function(e,t){var n=o;if(!t)return e;if(!c(e))return e;d(e)&&(n=u),f(e)&&(n=l);var r=n(t),i="/"!==r.charAt(r.length-1)&&"/"!==e.charAt(0)?"/":"";return[r,e].join(i)};function o(e){var t=e.indexOf("/"),n=e.lastIndexOf("/");return-1!==t?n===t+1?e:(-1!==e.indexOf("?")&&(e=e.substring(0,e.indexOf("?"))),e.substring(0,n+1)):""}function u(e){var t=e.match(i);return t?t[1]:""}function l(e){var n=e.match(t);return n?n[0]:""}function c(e){return!t.test(e)}function d(e){return c(e)&&"/"===e.charAt(0)}function f(e){return 0===e.indexOf("//")}return function(){try{new window.URL("x","http://y"),e=a}catch(e){}finally{e=e||s}}(),{parseBaseUrl:o,parseOrigin:u,parseScheme:l,isRelative:c,isPathAbsolute:d,isSchemeRelative:f,isHTTPURL:function(e){return n.test(e)},isHTTPS:function(e){return r.test(e)},removeHostname:function(e){return/^(?:\w+\:\/\/)?([^\/]+)(.*)$/.exec(e)[2].substring(1)},resolve:function(t,n){return e(t,n)}}}i.__dashjs_factory_name="DefaultURLUtils",t.default=r.default.getSingletonFactory(i)},"./src/streaming/utils/EBMLParser.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js");function i(e){var t;e=e||{};var n=new DataView(e.data),r=0;function i(e,t){var i=!0,a=0;if(void 0===t&&(t=!1),e.tag>16777215?(n.getUint32(r)!==e.tag&&(i=!1),a=4):e.tag>65535?(256*n.getUint16(r)+n.getUint8(r+2)!==e.tag&&(i=!1),a=3):e.tag>255?(n.getUint16(r)!==e.tag&&(i=!1),a=2):(n.getUint8(r)!==e.tag&&(i=!1),a=1),!i&&e.required&&!t)throw new Error("required tag not found");return i&&(r+=a),i}function a(e){var t=1,i=128,a=-1,s=0,o=n.getUint8(r),u=0;for(u=0;u<8;u+=1){if((o&i)===i){s=void 0===e?o&~i:o,a=u;break}i>>=1}for(u=0;u<a;u+=1,t+=1)s=s<<8|255&n.getUint8(r+t);return r+=t,s}return t={getPos:function(){return r},setPos:function(e){r=e},consumeTag:i,consumeTagAndSize:function(e,t){var n=i(e,t);return n&&a(),n},parseTag:function(e){var n;return i(e),n=a(),t[e.parse](n)},skipOverElement:function(e,t){var n,s=i(e,t);return s&&(n=a(),r+=n),s},getMatroskaCodedNum:a,getMatroskaFloat:function(e){var t;switch(e){case 4:t=n.getFloat32(r),r+=4;break;case 8:t=n.getFloat64(r),r+=8}return t},getMatroskaUint:function(e){for(var t=0,i=0;i<e;i+=1)t<<=8,t|=255&n.getUint8(r+i);return r+=e,t},moreData:function(){return r<n.byteLength}},t}i.__dashjs_factory_name="EBMLParser",t.default=r.default.getClassFactory(i)},"./src/streaming/utils/ErrorHandler.js":function(e,t,n){n.r(t);var r=n("./src/core/EventBus.js"),i=n("./src/core/events/Events.js"),a=n("./src/core/FactoryMaker.js");function s(){var e=this.context,t=Object(r.default)(e).getInstance();return{error:function(e){t.trigger(i.default.ERROR,{error:e})}}}s.__dashjs_factory_name="ErrorHandler",t.default=a.default.getSingletonFactory(s)},"./src/streaming/utils/InitCache.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js");function i(){var e={};return{save:function(t){var n=t.streamId,r=t.representationId;e[n]=e[n]||{},e[n][r]=t},extract:function(t,n){return e&&e[t]&&e[t][n]?e[t][n]:null},reset:function(){e={}}}}i.__dashjs_factory_name="InitCache",t.default=r.default.getSingletonFactory(i)},"./src/streaming/utils/IsoFile.js":function(e,t,n){n.r(t);var r=n("./src/streaming/vo/IsoBox.js"),i=n("./src/core/FactoryMaker.js");function a(){var e;function t(t){var r=[];if(!t||!e||"function"!=typeof e.fetchAll)return r;for(var i,a=e.fetchAll(t),s=0,o=a.length;s<o;s++)(i=n(a[s]))&&r.push(i);return r}function n(e){if(!e)return null;var t=new r.default(e);return e.hasOwnProperty("_incomplete")&&(t.isComplete=!e._incomplete),t}return{getBox:function(t){return t&&e&&e.boxes&&0!==e.boxes.length&&"function"==typeof e.fetch?n(e.fetch(t)):null},getBoxes:t,setData:function(t){e=t},getLastBox:function(){if(!e||!e.boxes||!e.boxes.length)return null;var n=t(e.boxes[e.boxes.length-1].type);return n.length>0?n[n.length-1]:null}}}a.__dashjs_factory_name="IsoFile",t.default=i.default.getClassFactory(a)},"./src/streaming/utils/ObjectUtils.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./node_modules/fast-deep-equal/index.js"),a=n.n(i);function s(){return{areEqual:function(e,t){return a()(e,t)}}}s.__dashjs_factory_name="ObjectUtils",t.default=r.default.getSingletonFactory(s)},"./src/streaming/utils/RequestModifier.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js");function i(){return{modifyRequestURL:function(e){return e},modifyRequestHeader:function(e){return e}}}i.__dashjs_factory_name="RequestModifier",t.default=r.default.getSingletonFactory(i)},"./src/streaming/utils/SupervisorTools.js":function(e,t,n){n.r(t),n.d(t,"checkParameterType",(function(){return a})),n.d(t,"checkInteger",(function(){return s})),n.d(t,"checkRange",(function(){return o})),n.d(t,"checkIsVideoOrAudioType",(function(){return u}));var r=n("./src/streaming/constants/Constants.js");function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){if(i(e)!==t)throw r.default.BAD_ARGUMENT_ERROR}function s(e){if(null===e||isNaN(e)||e%1!=0)throw r.default.BAD_ARGUMENT_ERROR+" : argument is not an integer"}function o(e,t,n){if(e<t||e>n)throw r.default.BAD_ARGUMENT_ERROR+" : argument out of range"}function u(e){if("string"!=typeof e||e!==r.default.AUDIO&&e!==r.default.VIDEO)throw r.default.BAD_ARGUMENT_ERROR}},"./src/streaming/utils/TTMLParser.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/core/Debug.js"),a=n("./src/core/EventBus.js"),s=n("./src/core/events/Events.js"),o=n("./node_modules/imsc/src/main/js/main.js"),u=n("./src/streaming/MediaPlayerEvents.js"),l=n("./src/streaming/constants/ConformanceViolationConstants.js");function c(){var e,t,n=this.context,r=Object(a.default)(n).getInstance(),c=0;return e={parse:function(e,n,i,a,d){var f,h,p,g="",m=[],y={},v={},_="",T="",b={onOpenTag:function(e,n,i){if(i[" imagetype"]&&!i[" imageType"]&&(r.trigger(u.default.CONFORMANCE_VIOLATION,{level:l.default.LEVELS.ERROR,event:l.default.EVENTS.NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE}),i[" imageType"]=i[" imagetype"]),"image"===n&&("http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt"===e||"http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"===e)){if(!i[" imageType"]||"PNG"!==i[" imageType"].value)return void t.warn("smpte-tt imageType != PNG. Discarded");_=i["http://www.w3.org/XML/1998/namespace id"].value}},onCloseTag:function(){_&&(v[_]=T.trim()),T="",_=""},onText:function(e){_&&(T+=e)}};if(!e)throw g="no ttml data to parse",new Error(g);y.data=e,r.trigger(s.default.TTML_TO_PARSE,y);var E=Object(o.fromXML)(y.data,(function(e){g=e}),b);r.trigger(s.default.TTML_PARSED,{ttmlString:y.data,ttmlDoc:E});var S,w=E.getMediaTimeEvents();for(p=0;p<w.length;p++){var A=Object(o.generateISD)(E,w[p],(function(e){g=e}));A.contents.some((function(e){return e.contents.length}))&&(f=w[p]+n<i?i:w[p]+n)<(h=w[p+1]+n>a?a:w[p+1]+n)&&m.push({start:f,end:h,type:"html",cueID:(S=void 0,S="cue_TTML_"+c,c++,S),isd:A,images:d,embeddedImages:v})}if(""!==g)throw t.error(g),new Error(g);return m}},t=Object(i.default)(n).getInstance().getLogger(e),e}c.__dashjs_factory_name="TTMLParser",t.default=r.default.getSingletonFactory(c)},"./src/streaming/utils/URLUtils.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/utils/DefaultURLUtils.js");function a(){var e,t,n=[],r=this.context;function a(e,r,i){var a=function(e){var r;for(r=0;r<n.length;r++)if(n[r].regex.test(e))return n[r].utils;return t}(i||r);return a&&"function"==typeof a[e]?a[e](r,i):t[e](r,i)}return t=Object(i.default)(r).getInstance(),e={registerUrlRegex:function(e,t){n.push({regex:e,utils:t})},parseBaseUrl:function(e){return a("parseBaseUrl",e)},parseOrigin:function(e){return a("parseOrigin",e)},parseScheme:function(e){return a("parseScheme",e)},isRelative:function(e){return a("isRelative",e)},isPathAbsolute:function(e){return a("isPathAbsolute",e)},isSchemeRelative:function(e){return a("isSchemeRelative",e)},isHTTPURL:function(e){return a("isHTTPURL",e)},isHTTPS:function(e){return a("isHTTPS",e)},removeHostname:function(e){return a("removeHostname",e)},resolve:function(e,t){return a("resolve",e,t)}},e}a.__dashjs_factory_name="URLUtils";var s=r.default.getSingletonFactory(a);t.default=s},"./src/streaming/utils/VTTParser.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/core/Debug.js");function a(){var e,t,n,r,a,s,o=this.context;function u(e){var t=e.split(":"),n=t.length-1;return e=60*parseInt(t[n-1],10)+parseFloat(t[n]),2===n&&(e+=3600*parseInt(t[0],10)),e}function l(e){var t=e.split(r),n=t[1].split(s);return n.shift(),t[1]=n[0],n.shift(),{cuePoints:t,styles:c(n)}}function c(e){var t={};return e.forEach((function(e){if(e.split(/:/).length>1){var n=e.split(/:/)[1];n&&-1!=n.search(/%/)&&(n=parseInt(n.replace(/%/,""),10)),(e.match(/align/)||e.match(/A/))&&(t.align=n),(e.match(/line/)||e.match(/L/))&&(t.line=n),(e.match(/position/)||e.match(/P/))&&(t.position=n),(e.match(/size/)||e.match(/S/))&&(t.size=n)}})),t}function d(e,t){for(var n,i=t,a="",s="";""!==e[i]&&i<e.length;)i++;if((n=i-t)>1)for(var o=0;o<n;o++){if((s=e[t+o]).match(r)){a="";break}a+=s,o!==n-1&&(a+="\n")}else(s=e[t]).match(r)||(a=s);return a}return e={parse:function(e){var i,s,o=[];if(!e)return o;i=(e=e.split(n)).length,s=-1;for(var c=0;c<i;c++){var f=e[c];if(f.length>0&&"WEBVTT"!==f&&f.match(r)){var h=l(f),p=h.cuePoints,g=h.styles,m=d(e,c+1),y=u(p[0].replace(a,"")),v=u(p[1].replace(a,""));!isNaN(y)&&!isNaN(v)&&y>=s&&v>y?""!==m?(s=y,o.push({start:y,end:v,data:m,styles:g})):t.error("Skipping cue due to empty/malformed cue text"):t.error("Skipping cue due to incorrect cue timing")}}return o}},t=Object(i.default)(o).getInstance().getLogger(e),n=/(?:\r\n|\r|\n)/gm,r=/-->/,a=/(^[\s]+|[\s]+$)/g,s=/\s\b/g,e}a.__dashjs_factory_name="VTTParser",t.default=r.default.getSingletonFactory(a)},"./src/streaming/utils/baseUrlResolution/BasicSelector.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js");function i(e){var t=(e=e||{}).blacklistController;return{select:function(e){var n,r=0;return e&&e.some((function(e,n){return r=n,!t.contains(e.serviceLocation)}))&&(n=e[r]),n}}}i.__dashjs_factory_name="BasicSelector",t.default=r.default.getClassFactory(i)},"./src/streaming/utils/baseUrlResolution/DVBSelector.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js");function i(e){var t=(e=e||{}).blacklistController;return{select:function(e){return e&&function(e){var t,n,r=0,i=[],a=0;if((n=e.sort((function(e,t){var n=e.dvb_priority-t.dvb_priority;return isNaN(n)?0:n})).filter((function(e,t,n){return!t||n[0].dvb_priority&&e.dvb_priority&&n[0].dvb_priority===e.dvb_priority}))).length)return n.length>1&&(n.forEach((function(e){r+=e.dvb_weight,i.push(r)})),t=Math.floor(Math.random()*(r-1)),i.every((function(e,n){return a=n,!(t<e)}))),n[a]}((n=[],e.filter((function(e){return!t.contains(e.serviceLocation)||(e.dvb_priority&&n.push(e.dvb_priority),!1)})).filter((function(e){return!n.length||!e.dvb_priority||-1===n.indexOf(e.dvb_priority)}))));var n}}}i.__dashjs_factory_name="DVBSelector",t.default=r.default.getClassFactory(i)},"./src/streaming/vo/BitrateInfo.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mediaType=null,this.bitrate=null,this.width=null,this.height=null,this.scanType=null,this.qualityIndex=NaN}},"./src/streaming/vo/DashJSError.js":function(e,t,n){n.r(t),t.default=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.code=t||null,this.message=n||null,this.data=r||null}},"./src/streaming/vo/DataChunk.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.streamId=null,this.mediaInfo=null,this.segmentType=null,this.quality=NaN,this.index=NaN,this.bytes=null,this.start=NaN,this.end=NaN,this.duration=NaN,this.representationId=null,this.endFragment=null}},"./src/streaming/vo/FragmentRequest.js":function(e,t,n){n.r(t);var r=n("./src/streaming/vo/metrics/HTTPRequest.js");function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.action=e.ACTION_DOWNLOAD,this.startTime=NaN,this.mediaStartTime=NaN,this.mediaType=null,this.mediaInfo=null,this.type=null,this.duration=NaN,this.timescale=NaN,this.range=null,this.url=t||null,this.serviceLocation=null,this.requestStartDate=null,this.firstByteDate=null,this.requestEndDate=null,this.quality=NaN,this.index=NaN,this.availabilityStartTime=null,this.availabilityEndTime=null,this.wallStartTime=null,this.bytesLoaded=NaN,this.bytesTotal=NaN,this.delayLoadingTime=NaN,this.responseType="arraybuffer",this.representationId=null}var t,n,a;return t=e,(n=[{key:"isInitializationRequest",value:function(){return this.type&&this.type===r.HTTPRequest.INIT_SEGMENT_TYPE}},{key:"setInfo",value:function(e){this.type=e&&e.init?r.HTTPRequest.INIT_SEGMENT_TYPE:r.HTTPRequest.MEDIA_SEGMENT_TYPE,this.url=e&&e.url?e.url:null,this.range=e&&e.range?e.range.start+"-"+e.range.end:null,this.mediaType=e&&e.mediaType?e.mediaType:null}}])&&i(t.prototype,n),a&&i(t,a),e}();a.ACTION_DOWNLOAD="download",a.ACTION_COMPLETE="complete",t.default=a},"./src/streaming/vo/HeadRequest.js":function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=s(e);if(t){var a=s(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}n.r(t);var o=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,e);var t=a(n);function n(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(r=t.call(this,e)).checkForExistenceOnly=!0,r}return n}(n("./src/streaming/vo/FragmentRequest.js").default);t.default=o},"./src/streaming/vo/IsoBox.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.offset=t._offset,this.type=t.type,this.size=t.size,this.boxes=[],t.boxes)for(var n=0;n<t.boxes.length;n++)this.boxes.push(new e(t.boxes[n]));switch(this.isComplete=!0,t.type){case"sidx":if(this.timescale=t.timescale,this.earliest_presentation_time=t.earliest_presentation_time,this.first_offset=t.first_offset,this.references=t.references,t.references){this.references=[];for(var r=0;r<t.references.length;r++){var i={reference_type:t.references[r].reference_type,referenced_size:t.references[r].referenced_size,subsegment_duration:t.references[r].subsegment_duration};this.references.push(i)}}break;case"emsg":this.id=t.id,this.version=1===t.version?1:0,this.value=t.value,this.timescale=t.timescale,this.scheme_id_uri=t.scheme_id_uri,this.presentation_time_delta=1===t.version?t.presentation_time:t.presentation_time_delta,this.event_duration=t.event_duration,this.message_data=t.message_data;break;case"mdhd":this.timescale=t.timescale;break;case"mfhd":this.sequence_number=t.sequence_number;break;case"subs":this.entry_count=t.entry_count,this.entries=t.entries;break;case"tfhd":this.base_data_offset=t.base_data_offset,this.sample_description_index=t.sample_description_index,this.default_sample_duration=t.default_sample_duration,this.default_sample_size=t.default_sample_size,this.default_sample_flags=t.default_sample_flags,this.flags=t.flags;break;case"tfdt":this.version=t.version,this.baseMediaDecodeTime=t.baseMediaDecodeTime,this.flags=t.flags;break;case"trun":if(this.sample_count=t.sample_count,this.first_sample_flags=t.first_sample_flags,this.data_offset=t.data_offset,this.flags=t.flags,this.samples=t.samples,t.samples){this.samples=[];for(var a=0,s=t.samples.length;a<s;a++){var o={sample_size:t.samples[a].sample_size,sample_duration:t.samples[a].sample_duration,sample_composition_time_offset:t.samples[a].sample_composition_time_offset};this.samples.push(o)}}}}var t,n,i;return t=e,n=[{key:"getChildBox",value:function(e){for(var t=0;t<this.boxes.length;t++)if(this.boxes[t].type===e)return this.boxes[t]}},{key:"getChildBoxes",value:function(e){for(var t=[],n=0;n<this.boxes.length;n++)this.boxes[n].type===e&&t.push(this.boxes[n]);return t}}],n&&r(t.prototype,n),i&&r(t,i),e}();t.default=i},"./src/streaming/vo/IsoBoxSearchInfo.js":function(e,t,n){n.r(t),t.default=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.lastCompletedOffset=t,this.found=n,this.size=r}},"./src/streaming/vo/MetricsList.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TcpList=[],this.HttpList=[],this.RepSwitchList=[],this.BufferLevel=[],this.BufferState=[],this.PlayList=[],this.DroppedFrames=[],this.SchedulingInfo=[],this.DVRInfo=[],this.ManifestUpdate=[],this.RequestsQueue=null,this.DVBErrors=[]}},"./src/streaming/vo/TextRequest.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js");function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=o(e);if(t){var a=o(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}var u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(n,e);var t=s(n);function n(e,i){var a;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(a=t.call(this)).url=e||null,a.type=i||null,a.mediaType=r.default.STREAM,a.responseType="",a}return n}(n("./src/streaming/vo/FragmentRequest.js").default);t.default=u},"./src/streaming/vo/TextTrackInfo.js":function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=s(e);if(t){var a=s(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}n.r(t);var o=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,e);var t=a(n);function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=t.call(this)).captionData=null,e.label=null,e.defaultTrack=!1,e.kind=null,e.isFragmented=!1,e.isEmbedded=!1,e.isTTML=null,e}return n}(n("./src/dash/vo/MediaInfo.js").default);t.default=o},"./src/streaming/vo/Thumbnail.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=null,this.width=null,this.height=null,this.x=null,this.y=null}},"./src/streaming/vo/ThumbnailTrackInfo.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bitrate=0,this.width=0,this.height=0,this.tilesHor=0,this.tilesVert=0,this.widthPerTile=0,this.heightPerTile=0,this.startNumber=0,this.segmentDuration=0,this.timescale=0,this.templateUrl="",this.id=""}},"./src/streaming/vo/URIFragmentData.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.xywh=null,this.track=null,this.id=null,this.s=null,this.r=null}},"./src/streaming/vo/metrics/BufferLevel.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.level=null}},"./src/streaming/vo/metrics/BufferState.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/MetricsConstants.js");t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.target=null,this.state=r.default.BUFFER_EMPTY}},"./src/streaming/vo/metrics/DVRInfo.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=null,this.range=null,this.manifestInfo=null}},"./src/streaming/vo/metrics/DroppedFrames.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=null,this.droppedFrames=null}},"./src/streaming/vo/metrics/HTTPRequest.js":function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.r(t),n.d(t,"HTTPRequest",(function(){return i})),n.d(t,"HTTPRequestTrace",(function(){return a}));var i=function e(){r(this,e),this.tcpid=null,this.type=null,this.url=null,this.actualurl=null,this.range=null,this.trequest=null,this.tresponse=null,this.responsecode=null,this.interval=null,this.trace=[],this._stream=null,this._tfinish=null,this._mediaduration=null,this._quality=null,this._responseHeaders=null,this._serviceLocation=null},a=function e(){r(this,e),this.s=null,this.d=null,this.b=[],this.t=null};i.GET="GET",i.HEAD="HEAD",i.MPD_TYPE="MPD",i.XLINK_EXPANSION_TYPE="XLinkExpansion",i.INIT_SEGMENT_TYPE="InitializationSegment",i.INDEX_SEGMENT_TYPE="IndexSegment",i.MEDIA_SEGMENT_TYPE="MediaSegment",i.BITSTREAM_SWITCHING_SEGMENT_TYPE="BitstreamSwitchingSegment",i.MSS_FRAGMENT_INFO_SEGMENT_TYPE="FragmentInfoSegment",i.LICENSE="license",i.OTHER_TYPE="other"},"./src/streaming/vo/metrics/ManifestUpdate.js":function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.r(t),n.d(t,"ManifestUpdate",(function(){return i})),n.d(t,"ManifestUpdateStreamInfo",(function(){return a})),n.d(t,"ManifestUpdateRepresentationInfo",(function(){return s}));var i=function e(){r(this,e),this.mediaType=null,this.type=null,this.requestTime=null,this.fetchTime=null,this.availabilityStartTime=null,this.presentationStartTime=0,this.clientTimeOffset=0,this.currentTime=null,this.buffered=null,this.latency=0,this.streamInfo=[],this.representationInfo=[]},a=function e(){r(this,e),this.id=null,this.index=null,this.start=null,this.duration=null},s=function e(){r(this,e),this.id=null,this.index=null,this.mediaType=null,this.streamIndex=null,this.presentationTimeOffset=null,this.startNumber=null,this.fragmentInfoType=null}},"./src/streaming/vo/metrics/PlayList.js":function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.r(t),n.d(t,"PlayList",(function(){return i})),n.d(t,"PlayListTrace",(function(){return a}));var i=function e(){r(this,e),this.start=null,this.mstart=null,this.starttype=null,this.trace=[]};i.INITIAL_PLAYOUT_START_REASON="initial_playout",i.SEEK_START_REASON="seek",i.RESUME_FROM_PAUSE_START_REASON="resume",i.METRICS_COLLECTION_START_REASON="metrics_collection_start";var a=function e(){r(this,e),this.representationid=null,this.subreplevel=null,this.start=null,this.mstart=null,this.duration=null,this.playbackspeed=null,this.stopreason=null};a.REPRESENTATION_SWITCH_STOP_REASON="representation_switch",a.REBUFFERING_REASON="rebuffering",a.USER_REQUEST_STOP_REASON="user_request",a.END_OF_PERIOD_STOP_REASON="end_of_period",a.END_OF_CONTENT_STOP_REASON="end_of_content",a.METRICS_COLLECTION_STOP_REASON="metrics_collection_end",a.FAILURE_STOP_REASON="failure"},"./src/streaming/vo/metrics/RepresentationSwitch.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.mt=null,this.to=null,this.lto=null}},"./src/streaming/vo/metrics/RequestsQueue.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.loadingRequests=[],this.executedRequests=[]}},"./src/streaming/vo/metrics/SchedulingInfo.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mediaType=null,this.t=null,this.type=null,this.startTime=null,this.availabilityStartTime=null,this.duration=null,this.quality=null,this.range=null,this.state=null}},0:function(e,t){},1:function(e,t){}}).default},ql(Hl={exports:{}}),Hl.exports),Yl=(Gl=Vl)&&Gl.__esModule&&Object.prototype.hasOwnProperty.call(Gl,"default")?Gl.default:Gl;function zl(e,t){var n=e.dash.mediaPlayer,r=n.getTracksFor("audio"),i=e.audioTracks();function a(e){return"dash-audio-"+e}function s(e,t){return e.find((function(e){return a(e.index)===t.id}))}i.length&&t.clearTracks(["audio"]);var o=n.getCurrentTrackFor("audio");r.forEach((function(t){var n,r;if(Array.isArray(t.labels))for(var s=0;s<t.labels.length;s++)if(t.labels[s].lang&&-1!==e.language().indexOf(t.labels[s].lang.toLowerCase())){n=t.labels[s];break}n?r=n.text:Array.isArray(t.labels)&&1===t.labels.length?r=t.labels[0].text:(r=t.lang,t.roles&&t.roles.length&&(r+=" ("+t.roles.join(", ")+")")),i.addTrack(new jl.AudioTrack({enabled:t===o,id:a(t.index),kind:t.kind||"main",label:r,language:t.lang}))}));var u=function(){for(var e=0;e<i.length;e++){var t=i[e];if(t.enabled){var a=s(r,t);n.setCurrentTrack(a)}}};i.addEventListener("change",u),e.dash.mediaPlayer.on(Yl.MediaPlayer.events.STREAM_TEARDOWN_COMPLETE,(function(){i.removeEventListener("change",u)}))}function Zl(e,t){e.dash.mediaPlayer.on(Yl.MediaPlayer.events.PLAYBACK_METADATA_LOADED,zl.bind(null,e,t))}function Kl(e,t,n){i().VTTCue&&!/\[native code\]/.test(i().VTTCue.toString())&&(i().VTTCue=!1);var r=[];if(t.featuresNativeTextTracks)jl.log.error("You must pass {html: {nativeCaptions: false}} in the videojs constructor to use text tracks in videojs-contrib-dash");else{var a=e.dash.mediaPlayer;a.on(Yl.MediaPlayer.events.TEXT_TRACKS_ADDED,s),a.on(Yl.MediaPlayer.events.CAN_PLAY,(function(){a.off(Yl.MediaPlayer.events.TEXT_TRACKS_ADDED,s)}))}function s(t){t.index;var n=t.tracks;a.off(Yl.MediaPlayer.events.TEXT_TRACKS_ADDED,s),r.forEach(e.removeRemoteTextTrack.bind(e)),r=[],n.length&&(r=function(e,t,n){var r=[],i=n.map((function(t){var n;if(Array.isArray(t.labels))for(var r=0;r<t.labels.length;r++)if(t.labels[r].lang&&-1!==e.language().indexOf(t.labels[r].lang.toLowerCase())){n=t.labels[r];break}return{dashTrack:t,trackConfig:{label:n?n.text:Array.isArray(t.labels)&&1===t.labels.length?t.labels[0].text:t.lang||t.label,language:t.lang,srclang:t.lang,kind:t.kind}}})).map((function(t){var n=t.trackConfig,i=t.dashTrack;if(i.isTTML&&!e.getChild("TTMLTextTrackDisplay"))return null;var a=e.addRemoteTextTrack(n,!1);return r.push({textTrack:a.track,dashTrack:i}),a})).filter((function(e){return null!==e}));function a(){for(var t=e.dash.mediaPlayer,i=e.textTracks(),a=-1,s=function(e){var t=i[e];if("showing"===t.mode){var s=function(e,n){for(var r=0;r<e.length;r++)if(e[r].textTrack===t)return e[r]}(r),o=s?s.dashTrack:null;o&&(a=n.indexOf(o))}},o=0;o<i.length;o+=1)s(o);a!==t.getCurrentTextTrackIndex()&&t.setTextTrack(a)}return e.textTracks().on("change",a),e.dash.mediaPlayer.on(Yl.MediaPlayer.events.STREAM_TEARDOWN_COMPLETE,(function(){e.textTracks().off("change",a)})),a(),i}(e,0,n))}}function Wl(e,t){return Wl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Wl(e,t)}function Xl(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var $l=jl.getComponent("Component"),Ql="#222",Jl={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function ec(e,t,n){try{e.style[t]=n}catch(e){return}}function tc(e){for(var t in e.style&&(e.style.left=null,e.style.width="100%"),e.children)tc(e.children[t])}function nc(e,t){var n;if(4===e.length)n=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");n=e.slice(1)}return"rgba("+parseInt(n.slice(0,2),16)+","+parseInt(n.slice(2,4),16)+","+parseInt(n.slice(4,6),16)+","+t+")"}var rc=function(e){var t,n;function r(t,n,r){var i;i=e.call(this,t,jl.mergeOptions(n,{playerOptions:{}}),r)||this;for(var a=t.getChild("TextTrackSettings").$$("select"),s=0;s<a.length;s++)i.on(a[s],"change",i.updateStyle.bind(Xl(i)));return t.dash.mediaPlayer.on(Yl.MediaPlayer.events.CAPTION_RENDERED,i.updateStyle.bind(Xl(i))),i}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Wl(t,n);var a=r.prototype;return a.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-text-track-display-ttml"},{"aria-live":"off","aria-atomic":"true"});return t.style.position="absolute",t.style.left="0",t.style.right="0",t.style.top="0",t.style.bottom="0",t.style.margin="1.5%",t},a.updateStyle=function(e){var t=e.captionDiv;if(this.player_.textTrackSettings){var n=this.player_.textTrackSettings.getValues();if(t=t||this.player_.getChild("TTMLTextTrackDisplay").el().firstChild){tc(t);for(var r=t.getElementsByTagName("span"),a=0;a<r.length;a++){var s=r[a];if(s.parentNode.style.textAlign="center",n.color&&(s.style.color=n.color),n.textOpacity&&ec(s,"color",nc(n.color||"#fff",n.textOpacity)),n.backgroundColor&&(s.style.backgroundColor=n.backgroundColor),n.backgroundOpacity&&ec(s,"backgroundColor",nc(n.backgroundColor||"#000",n.backgroundOpacity)),n.windowColor&&(n.windowOpacity?ec(s.parentNode,"backgroundColor",nc(n.windowColor,n.windowOpacity)):s.parent.style.backgroundColor=n.windowColor),n.edgeStyle&&("dropshadow"===n.edgeStyle?s.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px "+Ql:"raised"===n.edgeStyle?s.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px "+Ql:"depressed"===n.edgeStyle?s.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px "+Ql:"uniform"===n.edgeStyle&&(s.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px "+Ql)),n.fontPercent&&1!==n.fontPercent){var o=i().parseFloat(s.style.fontSize);s.style.fontSize=o*n.fontPercent+"px",s.style.height="auto",s.style.top="auto",s.style.bottom="2px"}n.fontFamily&&"default"!==n.fontFamily&&("small-caps"===n.fontFamily?s.style.fontVariant="small-caps":s.style.fontFamily=Jl[n.fontFamily])}}}},r}($l);jl.registerComponent("TTMLTextTrackDisplay",rc);var ic=function(){function e(t,n,r){var i=this;if(r=r||n.options_,this.player=jl(r.playerId),this.player.dash=this.player.dash||{},this.tech_=n,this.el_=n.el(),this.elParent_=this.el_.parentNode,this.hasFiniteDuration_=!1,t.src){n.isReady_=!1,e.updateSourceData&&(jl.log.warn('updateSourceData has been deprecated. Please switch to using hook("updatesource", callback).'),t=e.updateSourceData(t)),e.hooks("updatesource").forEach((function(e){t=e(t)}));var a=t.src;this.keySystemOptions_=e.buildDashJSProtData(t.keySystemOptions),this.player.dash.mediaPlayer=Yl.MediaPlayer().create(),this.mediaPlayer_=this.player.dash.mediaPlayer,e.useVideoJSDebug&&(jl.log.warn('useVideoJSDebug has been deprecated. Please switch to using hook("beforeinitialize", callback).'),e.useVideoJSDebug(this.mediaPlayer_)),e.beforeInitialize&&(jl.log.warn('beforeInitialize has been deprecated. Please switch to using hook("beforeinitialize", callback).'),e.beforeInitialize(this.player,this.mediaPlayer_)),e.hooks("beforeinitialize").forEach((function(e){e(i.player,i.mediaPlayer_)})),this.mediaPlayer_.initialize(),this.retriggerError_=function(e){if("capability"===e.error&&"mediasource"===e.event)i.player.error({code:4,message:"The media cannot be played because it requires a feature that your browser does not support."});else if("manifestError"!==e.error||"createParser"!==e.event.id&&"codec"!==e.event.id&&"nostreams"!==e.event.id&&"nostreamscomposed"!==e.event.id&&"parse"!==e.event.id&&"multiplexedrep"!==e.event.id)if("mediasource"===e.error)e.event.match("MEDIA_ERR_ABORTED")?i.player.error({code:1,message:e.event}):e.event.match("MEDIA_ERR_NETWORK")?i.player.error({code:2,message:e.event}):e.event.match("MEDIA_ERR_DECODE")?i.player.error({code:3,message:e.event}):e.event.match("MEDIA_ERR_SRC_NOT_SUPPORTED")?i.player.error({code:4,message:e.event}):e.event.match("MEDIA_ERR_ENCRYPTED")?i.player.error({code:5,message:e.event}):(e.event.match("UNKNOWN"),i.player.error({code:4,message:e.event}));else if("capability"===e.error&&"encryptedmedia"===e.event)i.player.error({code:5,message:"The media cannot be played because it requires encryption features that your browser does not support."});else if("key_session"===e.error)i.player.error({code:5,message:e.event});else if("download"===e.error)i.player.error({code:2,message:"The media playback was aborted because too many consecutive download errors occurred."});else{if("mssError"!==e.error)return;i.player.error({code:3,message:e.event})}else i.player.error({code:4,message:e.event.message});setTimeout((function(){i.mediaPlayer_.reset()}),10)},this.mediaPlayer_.on(Yl.MediaPlayer.events.ERROR,this.retriggerError_),this.getDuration_=function(e){var t=e.data.Period_asArray,n=i.hasFiniteDuration_;e.data.mediaPresentationDuration||t[t.length-1].duration?i.hasFiniteDuration_=!0:i.hasFiniteDuration_=!1,i.hasFiniteDuration_!==n&&i.player.trigger("durationchange")},this.mediaPlayer_.on(Yl.MediaPlayer.events.MANIFEST_LOADED,this.getDuration_),r.dash&&Object.keys(r.dash).forEach((function(e){var t;if("useTTML"!==e){var n="set"+e.charAt(0).toUpperCase()+e.slice(1),a=r.dash[e];i.mediaPlayer_.hasOwnProperty(n)&&(jl.log.warn("Using dash options in videojs-contrib-dash without the set prefix has been deprecated. Change '"+e+"' to '"+n+"'"),e=n),i.mediaPlayer_.hasOwnProperty(e)?(Array.isArray(a)||(a=[a]),(t=i.mediaPlayer_)[e].apply(t,a)):jl.log.warn("Warning: dash configuration option unrecognized: "+e)}})),this.mediaPlayer_.attachView(this.el_),r.dash&&r.dash.useTTML&&(this.ttmlContainer_=this.player.addChild("TTMLTextTrackDisplay"),this.mediaPlayer_.attachTTMLRenderingDiv(this.ttmlContainer_.el())),this.mediaPlayer_.setAutoPlay(!1),Zl.call(null,this.player,n),Kl.call(null,this.player,n,r),this.mediaPlayer_.setProtectionData(this.keySystemOptions_),this.mediaPlayer_.attachSource(a),this.tech_.triggerReady()}}e.buildDashJSProtData=function(e){var t={};if(!e||!Array.isArray(e))return null;for(var n=0;n<e.length;n++){var r=e[n],i=jl.mergeOptions({},r.options);i.licenseUrl&&(i.serverURL=i.licenseUrl,delete i.licenseUrl),t[r.name]=i}return t};var t=e.prototype;return t.dispose=function(){this.mediaPlayer_&&(this.mediaPlayer_.off(Yl.MediaPlayer.events.ERROR,this.retriggerError_),this.mediaPlayer_.off(Yl.MediaPlayer.events.MANIFEST_LOADED,this.getDuration_),this.mediaPlayer_.reset()),this.player.dash&&delete this.player.dash,this.ttmlContainer_&&(this.ttmlContainer_.dispose(),this.player.removeChild("TTMLTextTrackDisplay"))},t.duration=function(){return this.mediaPlayer_.isDynamic()&&!this.hasFiniteDuration_?1/0:this.mediaPlayer_.duration()},e.hooks=function(t,n){return e.hooks_[t]=e.hooks_[t]||[],n&&(e.hooks_[t]=e.hooks_[t].concat(n)),e.hooks_[t]},e.hook=function(t,n){e.hooks(t,n)},e.removeHook=function(t,n){var r=e.hooks(t).indexOf(n);return-1!==r&&(e.hooks_[t]=e.hooks_[t].slice(),e.hooks_[t].splice(r,1),!0)},e}();ic.hooks_={},jl.DashSourceHandler=function(){return{canHandleSource:function(e){return function(e){e=JSON.parse(JSON.stringify(e)),ic.updateSourceData&&(jl.log.warn('updateSourceData has been deprecated. Please switch to using hook("updatesource", callback).'),e=ic.updateSourceData(e)),ic.hooks("updatesource").forEach((function(t){e=t(e)}));var t=u().createElement("video");return!(e.keySystemOptions&&!i().navigator.requestMediaKeySystemAccess&&!t.msSetMediaKeys)}(e)?jl.DashSourceHandler.canPlayType(e.type)?"probably":/\.mpd/i.test(e.src)?"maybe":"":""},handleSource:function(e,t,n){return new ic(e,t,n)},canPlayType:function(e){return jl.DashSourceHandler.canPlayType(e)}}},jl.DashSourceHandler.canPlayType=function(e){return/^application\/dash\+xml/i.test(e)?"probably":""},i().MediaSource&&jl.getTech("Html5").registerSourceHandler(jl.DashSourceHandler(),0),jl.Html5DashJS=ic;const ac=ic},1215:(e,t,n)=>{var r=n(9223).getUint64;e.exports=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},i=12;0===n.version?(n.earliestPresentationTime=t.getUint32(i),n.firstOffset=t.getUint32(i+4),i+=8):(n.earliestPresentationTime=r(e.subarray(i)),n.firstOffset=r(e.subarray(i+8)),i+=16),i+=2;var a=t.getUint16(i);for(i+=2;a>0;i+=12,a--)n.references.push({referenceType:(128&e[i])>>>7,referencedSize:2147483647&t.getUint32(i),subsegmentDuration:t.getUint32(i+4),startsWithSap:!!(128&e[i+8]),sapType:(112&e[i+8])>>>4,sapDeltaTime:268435455&t.getUint32(i+8)});return n}},9458:e=>{var t,n,r,i,a,s,o,u=9e4;t=function(e){return e*u},n=function(e,t){return e*t},r=function(e){return e/u},i=function(e,t){return e/t},a=function(e,n){return t(i(e,n))},s=function(e,t){return n(r(e),t)},o=function(e,t,n){return r(n?e:e-t)},e.exports={ONE_SECOND_IN_TS:u,secondsToVideoTs:t,secondsToAudioTs:n,videoTsToSeconds:r,audioTsToSeconds:i,audioTsToVideoTs:a,videoTsToAudioTs:s,metadataTsToSeconds:o}},9223:e=>{var t=Math.pow(2,32);e.exports={getUint64:function(e){var n,r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getBigUint64?(n=r.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(n):n:r.getUint32(0)*t+r.getUint32(4)},MAX_UINT32:t}},3407:(e,t,n)=>{var r=n(8908),i=e.exports={WebVTT:n(3706),VTTCue:n(2230),VTTRegion:n(3710)};r.vttjs=i,r.WebVTT=i.WebVTT;var a=i.VTTCue,s=i.VTTRegion,o=r.VTTCue,u=r.VTTRegion;i.shim=function(){r.VTTCue=a,r.VTTRegion=s},i.restore=function(){r.VTTCue=o,r.VTTRegion=u},r.VTTCue||i.shim()},3706:(e,t,n)=>{var r=n(9144),i=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function a(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function s(e){function t(e,t,n,r){return 3600*(0|e)+60*(0|t)+(0|n)+(0|r)/1e3}var n=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return n?n[3]?t(n[1],n[2],n[3].replace(":",""),n[4]):n[1]>59?t(n[1],n[2],0,n[4]):t(0,n[1],n[2],n[4]):null}function o(){this.values=i(null)}function u(e,t,n,r){var i=r?e.split(r):[e];for(var a in i)if("string"==typeof i[a]){var s=i[a].split(n);2===s.length&&t(s[0].trim(),s[1].trim())}}function l(e,t,n){var r=e;function i(){var t=s(e);if(null===t)throw new a(a.Errors.BadTimeStamp,"Malformed timestamp: "+r);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function l(){e=e.replace(/^\s+/,"")}if(l(),t.startTime=i(),l(),"--\x3e"!==e.substr(0,3))throw new a(a.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+r);e=e.substr(3),l(),t.endTime=i(),l(),function(e,t){var r=new o;u(e,(function(e,t){switch(e){case"region":for(var i=n.length-1;i>=0;i--)if(n[i].id===t){r.set(e,n[i].region);break}break;case"vertical":r.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),s=a[0];r.integer(e,s),r.percent(e,s)&&r.set("snapToLines",!1),r.alt(e,s,["auto"]),2===a.length&&r.alt("lineAlign",a[1],["start","center","end"]);break;case"position":a=t.split(","),r.percent(e,a[0]),2===a.length&&r.alt("positionAlign",a[1],["start","center","end"]);break;case"size":r.percent(e,t);break;case"align":r.alt(e,t,["start","center","end","left","right"])}}),/:/,/\s/),t.region=r.get("region",null),t.vertical=r.get("vertical","");try{t.line=r.get("line","auto")}catch(e){}t.lineAlign=r.get("lineAlign","start"),t.snapToLines=r.get("snapToLines",!0),t.size=r.get("size",100);try{t.align=r.get("align","center")}catch(e){t.align=r.get("align","middle")}try{t.position=r.get("position","auto")}catch(e){t.position=r.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=r.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(e,t)}a.prototype=i(Error.prototype),a.prototype.constructor=a,a.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},o.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,n){for(var r=0;r<n.length;++r)if(t===n[r]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t))>=0&&t<=100)&&(this.set(e,t),!0)}};var c=r.createElement&&r.createElement("textarea"),d={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},f={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},h={v:"title",lang:"lang"},p={rt:"ruby"};function g(e,t){function n(){if(!t)return null;var e,n=t.match(/^([^<]*)(<[^>]*>?)?/);return e=n[1]?n[1]:n[2],t=t.substr(e.length),e}function r(e){return c.innerHTML=e,e=c.textContent,c.textContent="",e}function i(e,t){return!p[t.localName]||p[t.localName]===e.localName}function a(t,n){var r=d[t];if(!r)return null;var i=e.document.createElement(r),a=h[t];return a&&n&&(i[a]=n.trim()),i}for(var o,u=e.document.createElement("div"),l=u,g=[];null!==(o=n());)if("<"!==o[0])l.appendChild(e.document.createTextNode(r(o)));else{if("/"===o[1]){g.length&&g[g.length-1]===o.substr(2).replace(">","")&&(g.pop(),l=l.parentNode);continue}var m,y=s(o.substr(1,o.length-2));if(y){m=e.document.createProcessingInstruction("timestamp",y),l.appendChild(m);continue}var v=o.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!v)continue;if(!(m=a(v[1],v[3])))continue;if(!i(l,m))continue;if(v[2]){var _=v[2].split(".");_.forEach((function(e){var t=/^bg_/.test(e),n=t?e.slice(3):e;if(f.hasOwnProperty(n)){var r=t?"background-color":"color",i=f[n];m.style[r]=i}})),m.className=_.join(" ")}g.push(v[1]),l.appendChild(m),l=m}return u}var m=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function y(e){for(var t=0;t<m.length;t++){var n=m[t];if(e>=n[0]&&e<=n[1])return!0}return!1}function v(e){var t=[],n="";if(!e||!e.childNodes)return"ltr";function r(e,t){for(var n=t.childNodes.length-1;n>=0;n--)e.push(t.childNodes[n])}function i(e){if(!e||!e.length)return null;var t=e.pop(),n=t.textContent||t.innerText;if(n){var a=n.match(/^.*(\n|\r)/);return a?(e.length=0,a[0]):n}return"ruby"===t.tagName?i(e):t.childNodes?(r(e,t),i(e)):void 0}for(r(t,e);n=i(t);)for(var a=0;a<n.length;a++)if(y(n.charCodeAt(a)))return"rtl";return"ltr"}function _(){}function T(e,t,n){_.call(this),this.cue=t,this.cueDiv=g(e,t.text);var r={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(r,this.cueDiv),this.div=e.document.createElement("div"),r={direction:v(this.cueDiv),writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===t.align?"center":t.align,font:n.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(r),this.div.appendChild(this.cueDiv);var i=0;switch(t.positionAlign){case"start":case"line-left":i=t.position;break;case"center":i=t.position-t.size/2;break;case"end":case"line-right":i=t.position-t.size}""===t.vertical?this.applyStyles({left:this.formatStyle(i,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(i,"%"),height:this.formatStyle(t.size,"%")}),this.move=function(e){this.applyStyles({top:this.formatStyle(e.top,"px"),bottom:this.formatStyle(e.bottom,"px"),left:this.formatStyle(e.left,"px"),right:this.formatStyle(e.right,"px"),height:this.formatStyle(e.height,"px"),width:this.formatStyle(e.width,"px")})}}function b(e){var t,n,r,i;if(e.div){n=e.div.offsetHeight,r=e.div.offsetWidth,i=e.div.offsetTop;var a=(a=e.div.childNodes)&&(a=a[0])&&a.getClientRects&&a.getClientRects();e=e.div.getBoundingClientRect(),t=a?Math.max(a[0]&&a[0].height||0,e.height/a.length):0}this.left=e.left,this.right=e.right,this.top=e.top||i,this.height=e.height||n,this.bottom=e.bottom||i+(e.height||n),this.width=e.width||r,this.lineHeight=void 0!==t?t:e.lineHeight}function E(e,t,n,r){var i=new b(t),a=t.cue,s=function(e){if("number"==typeof e.line&&(e.snapToLines||e.line>=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,n=t.textTrackList,r=0,i=0;i<n.length&&n[i]!==t;i++)"showing"===n[i].mode&&r++;return-1*++r}(a),o=[];if(a.snapToLines){var u;switch(a.vertical){case"":o=["+y","-y"],u="height";break;case"rl":o=["+x","-x"],u="width";break;case"lr":o=["-x","+x"],u="width"}var l=i.lineHeight,c=l*Math.round(s),d=n[u]+l,f=o[0];Math.abs(c)>d&&(c=c<0?-1:1,c*=Math.ceil(d/l)*l),s<0&&(c+=""===a.vertical?n.height:n.width,o=o.reverse()),i.move(f,c)}else{var h=i.lineHeight/n.height*100;switch(a.lineAlign){case"center":s-=h/2;break;case"end":s-=h}switch(a.vertical){case"":t.applyStyles({top:t.formatStyle(s,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(s,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(s,"%")})}o=["+y","-x","+x","-y"],i=new b(t)}var p=function(e,t){for(var i,a=new b(e),s=1,o=0;o<t.length;o++){for(;e.overlapsOppositeAxis(n,t[o])||e.within(n)&&e.overlapsAny(r);)e.move(t[o]);if(e.within(n))return e;var u=e.intersectPercentage(n);s>u&&(i=new b(e),s=u),e=new b(a)}return i||a}(i,o);t.move(p.toCSSCompatValues(n))}function S(){}_.prototype.applyStyles=function(e,t){for(var n in t=t||this.div,e)e.hasOwnProperty(n)&&(t.style[n]=e[n])},_.prototype.formatStyle=function(e,t){return 0===e?0:e+t},T.prototype=i(_.prototype),T.prototype.constructor=T,b.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},b.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},b.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},b.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},b.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}},b.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},b.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},b.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,n=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,r=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||r,height:e.height||t,bottom:e.bottom||r+(e.height||t),width:e.width||n}},S.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},S.convertCueToDOMTree=function(e,t){return e&&t?g(e,t):null},S.processCues=function(e,t,n){if(!e||!t||!n)return null;for(;n.firstChild;)n.removeChild(n.firstChild);var r=e.document.createElement("div");if(r.style.position="absolute",r.style.left="0",r.style.right="0",r.style.top="0",r.style.bottom="0",r.style.margin="1.5%",n.appendChild(r),function(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}(t)){var i=[],a=b.getSimpleBoxPosition(r),s={font:Math.round(.05*a.height*100)/100+"px sans-serif"};!function(){for(var n,o,u=0;u<t.length;u++)o=t[u],n=new T(e,o,s),r.appendChild(n.div),E(0,n,a,i),o.displayState=n.div,i.push(b.getSimpleBoxPosition(n))}()}else for(var o=0;o<t.length;o++)r.appendChild(t[o].displayState)},S.Parser=function(e,t,n){n||(n=t,t={}),t||(t={}),this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=n||new TextDecoder("utf8"),this.regionList=[]},S.Parser.prototype={reportOrThrowError:function(e){if(!(e instanceof a))throw e;this.onparsingerror&&this.onparsingerror(e)},parse:function(e){var t,n=this;function r(){for(var e=n.buffer,t=0;t<e.length&&"\r"!==e[t]&&"\n"!==e[t];)++t;var r=e.substr(0,t);return"\r"===e[t]&&++t,"\n"===e[t]&&++t,n.buffer=e.substr(t),r}e&&(n.buffer+=n.decoder.decode(e,{stream:!0}));try{var i;if("INITIAL"===n.state){if(!/\r\n|\n/.test(n.buffer))return this;var c=(i=r()).match(/^WEBVTT([ \t].*)?$/);if(!c||!c[0])throw new a(a.Errors.BadSignature);n.state="HEADER"}for(var d=!1;n.buffer;){if(!/\r\n|\n/.test(n.buffer))return this;switch(d?d=!1:i=r(),n.state){case"HEADER":/:/.test(i)?(t=i).match(/X-TIMESTAMP-MAP/)?u(t,(function(e,t){"X-TIMESTAMP-MAP"===e&&function(e){var t=new o;u(e,(function(e,n){switch(e){case"MPEGT":t.integer(e+"S",n);break;case"LOCA":t.set(e+"L",s(n))}}),/[^\d]:/,/,/),n.ontimestampmap&&n.ontimestampmap({MPEGTS:t.get("MPEGTS"),LOCAL:t.get("LOCAL")})}(t)}),/=/):u(t,(function(e,t){"Region"===e&&function(e){var t=new o;if(u(e,(function(e,n){switch(e){case"id":t.set(e,n);break;case"width":t.percent(e,n);break;case"lines":t.integer(e,n);break;case"regionanchor":case"viewportanchor":var r=n.split(",");if(2!==r.length)break;var i=new o;if(i.percent("x",r[0]),i.percent("y",r[1]),!i.has("x")||!i.has("y"))break;t.set(e+"X",i.get("x")),t.set(e+"Y",i.get("y"));break;case"scroll":t.alt(e,n,["up"])}}),/=/,/\s/),t.has("id")){var r=new(n.vttjs.VTTRegion||n.window.VTTRegion);r.width=t.get("width",100),r.lines=t.get("lines",3),r.regionAnchorX=t.get("regionanchorX",0),r.regionAnchorY=t.get("regionanchorY",100),r.viewportAnchorX=t.get("viewportanchorX",0),r.viewportAnchorY=t.get("viewportanchorY",100),r.scroll=t.get("scroll",""),n.onregion&&n.onregion(r),n.regionList.push({id:t.get("id"),region:r})}}(t)}),/:/):i||(n.state="ID");continue;case"NOTE":i||(n.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(i)){n.state="NOTE";break}if(!i)continue;n.cue=new(n.vttjs.VTTCue||n.window.VTTCue)(0,0,"");try{n.cue.align="center"}catch(e){n.cue.align="middle"}if(n.state="CUE",-1===i.indexOf("--\x3e")){n.cue.id=i;continue}case"CUE":try{l(i,n.cue,n.regionList)}catch(e){n.reportOrThrowError(e),n.cue=null,n.state="BADCUE";continue}n.state="CUETEXT";continue;case"CUETEXT":var f=-1!==i.indexOf("--\x3e");if(!i||f&&(d=!0)){n.oncue&&n.oncue(n.cue),n.cue=null,n.state="ID";continue}n.cue.text&&(n.cue.text+="\n"),n.cue.text+=i.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":i||(n.state="ID");continue}}}catch(e){n.reportOrThrowError(e),"CUETEXT"===n.state&&n.cue&&n.oncue&&n.oncue(n.cue),n.cue=null,n.state="INITIAL"===n.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new a(a.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}},e.exports=S},2230:e=>{var t={"":1,lr:1,rl:1},n={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function r(e){return"string"==typeof e&&!!n[e.toLowerCase()]&&e.toLowerCase()}function i(e,n,i){this.hasBeenReset=!1;var a="",s=!1,o=e,u=n,l=i,c=null,d="",f=!0,h="auto",p="start",g="auto",m="auto",y=100,v="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return a},set:function(e){a=""+e}},pauseOnExit:{enumerable:!0,get:function(){return s},set:function(e){s=!!e}},startTime:{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");o=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");u=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return l},set:function(e){l=""+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return c},set:function(e){c=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return d},set:function(e){var n=function(e){return"string"==typeof e&&!!t[e.toLowerCase()]&&e.toLowerCase()}(e);if(!1===n)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");d=n,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return f},set:function(e){f=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return h},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("Line: an invalid number or illegal string was specified.");h=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return p},set:function(e){var t=r(e);t?(p=t,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return g},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");g=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return m},set:function(e){var t=r(e);t?(m=t,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return y},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");y=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return v},set:function(e){var t=r(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");v=t,this.hasBeenReset=!0}}}),this.displayState=void 0}i.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},e.exports=i},3710:e=>{var t={"":!0,up:!0};function n(e){return"number"==typeof e&&e>=0&&e<=100}e.exports=function(){var e=100,r=3,i=0,a=100,s=0,o=100,u="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!n(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return r},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");r=e}},regionAnchorY:{enumerable:!0,get:function(){return a},set:function(e){if(!n(e))throw new Error("RegionAnchorX must be between 0 and 100.");a=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!n(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!n(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return s},set:function(e){if(!n(e))throw new Error("ViewportAnchorX must be between 0 and 100.");s=e}},scroll:{enumerable:!0,get:function(){return u},set:function(e){var n=function(e){return"string"==typeof e&&!!t[e.toLowerCase()]&&e.toLowerCase()}(e);!1===n?console.warn("Scroll: an invalid or illegal string was specified."):u=n}}})}},3831:(e,t,n)=>{"use strict";var r={};n.r(r),n.d(r,{VERSION:()=>i,after:()=>Mt,all:()=>en,allKeys:()=>me,any:()=>tn,assign:()=>Me,before:()=>kt,bind:()=>Et,bindAll:()=>At,chain:()=>vt,chunk:()=>Un,clone:()=>Ue,collect:()=>Kt,compact:()=>Cn,compose:()=>Pt,constant:()=>Q,contains:()=>nn,countBy:()=>yn,create:()=>Fe,debounce:()=>xt,default:()=>qn,defaults:()=>ke,defer:()=>Rt,delay:()=>Ct,detect:()=>Yt,difference:()=>Dn,drop:()=>An,each:()=>Zt,escape:()=>st,every:()=>en,extend:()=>Pe,extendOwn:()=>Me,filter:()=>Qt,find:()=>Yt,findIndex:()=>Bt,findKey:()=>Ft,findLastIndex:()=>jt,findWhere:()=>zt,first:()=>wn,flatten:()=>Rn,foldl:()=>Xt,foldr:()=>$t,forEach:()=>Zt,functions:()=>Ne,get:()=>Ge,groupBy:()=>gn,has:()=>Ve,head:()=>wn,identity:()=>Ye,include:()=>nn,includes:()=>nn,indexBy:()=>mn,indexOf:()=>Gt,initial:()=>Sn,inject:()=>Xt,intersection:()=>Pn,invert:()=>xe,invoke:()=>rn,isArguments:()=>W,isArray:()=>z,isArrayBuffer:()=>F,isBoolean:()=>R,isDataView:()=>Y,isDate:()=>P,isElement:()=>D,isEmpty:()=>ue,isEqual:()=>ge,isError:()=>k,isFinite:()=>X,isFunction:()=>j,isMap:()=>we,isMatch:()=>le,isNaN:()=>$,isNull:()=>I,isNumber:()=>O,isObject:()=>A,isRegExp:()=>M,isSet:()=>Ie,isString:()=>N,isSymbol:()=>L,isTypedArray:()=>ie,isUndefined:()=>C,isWeakMap:()=>Ae,isWeakSet:()=>Ce,iteratee:()=>Xe,keys:()=>oe,last:()=>In,lastIndexOf:()=>Vt,map:()=>Kt,mapObject:()=>Qe,matcher:()=>ze,matches:()=>ze,max:()=>on,memoize:()=>It,methods:()=>Ne,min:()=>un,mixin:()=>jn,negate:()=>Ot,noop:()=>Je,now:()=>rt,object:()=>Ln,omit:()=>En,once:()=>Lt,pairs:()=>De,partial:()=>bt,partition:()=>vn,pick:()=>bn,pluck:()=>an,property:()=>Ze,propertyOf:()=>et,random:()=>nt,range:()=>Fn,reduce:()=>Xt,reduceRight:()=>$t,reject:()=>Jt,rest:()=>An,restArguments:()=>w,result:()=>gt,sample:()=>dn,select:()=>Qt,shuffle:()=>fn,size:()=>_n,some:()=>tn,sortBy:()=>hn,sortedIndex:()=>qt,tail:()=>An,take:()=>wn,tap:()=>Be,template:()=>pt,templateSettings:()=>ut,throttle:()=>Dt,times:()=>tt,toArray:()=>cn,toPath:()=>je,transpose:()=>Mn,unescape:()=>ot,union:()=>On,uniq:()=>Nn,unique:()=>Nn,uniqueId:()=>yt,unzip:()=>Mn,values:()=>Re,where:()=>sn,without:()=>xn,wrap:()=>Nt,zip:()=>kn});var i="1.13.6",a="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},s=Array.prototype,o=Object.prototype,u="undefined"!=typeof Symbol?Symbol.prototype:null,l=s.push,c=s.slice,d=o.toString,f=o.hasOwnProperty,h="undefined"!=typeof ArrayBuffer,p="undefined"!=typeof DataView,g=Array.isArray,m=Object.keys,y=Object.create,v=h&&ArrayBuffer.isView,_=isNaN,T=isFinite,b=!{toString:null}.propertyIsEnumerable("toString"),E=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],S=Math.pow(2,53)-1;function w(e,t){return t=null==t?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),r=Array(n),i=0;i<n;i++)r[i]=arguments[i+t];switch(t){case 0:return e.call(this,r);case 1:return e.call(this,arguments[0],r);case 2:return e.call(this,arguments[0],arguments[1],r)}var a=Array(t+1);for(i=0;i<t;i++)a[i]=arguments[i];return a[t]=r,e.apply(this,a)}}function A(e){var t=typeof e;return"function"===t||"object"===t&&!!e}function I(e){return null===e}function C(e){return void 0===e}function R(e){return!0===e||!1===e||"[object Boolean]"===d.call(e)}function D(e){return!(!e||1!==e.nodeType)}function x(e){var t="[object "+e+"]";return function(e){return d.call(e)===t}}const N=x("String"),O=x("Number"),P=x("Date"),M=x("RegExp"),k=x("Error"),L=x("Symbol"),F=x("ArrayBuffer");var U=x("Function"),B=a.document&&a.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof B&&(U=function(e){return"function"==typeof e||!1});const j=U,q=x("Object");var H=p&&q(new DataView(new ArrayBuffer(8))),G="undefined"!=typeof Map&&q(new Map),V=x("DataView");const Y=H?function(e){return null!=e&&j(e.getInt8)&&F(e.buffer)}:V,z=g||x("Array");function Z(e,t){return null!=e&&f.call(e,t)}var K=x("Arguments");!function(){K(arguments)||(K=function(e){return Z(e,"callee")})}();const W=K;function X(e){return!L(e)&&T(e)&&!isNaN(parseFloat(e))}function $(e){return O(e)&&_(e)}function Q(e){return function(){return e}}function J(e){return function(t){var n=e(t);return"number"==typeof n&&n>=0&&n<=S}}function ee(e){return function(t){return null==t?void 0:t[e]}}const te=ee("byteLength"),ne=J(te);var re=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;const ie=h?function(e){return v?v(e)&&!Y(e):ne(e)&&re.test(d.call(e))}:Q(!1),ae=ee("length");function se(e,t){t=function(e){for(var t={},n=e.length,r=0;r<n;++r)t[e[r]]=!0;return{contains:function(e){return!0===t[e]},push:function(n){return t[n]=!0,e.push(n)}}}(t);var n=E.length,r=e.constructor,i=j(r)&&r.prototype||o,a="constructor";for(Z(e,a)&&!t.contains(a)&&t.push(a);n--;)(a=E[n])in e&&e[a]!==i[a]&&!t.contains(a)&&t.push(a)}function oe(e){if(!A(e))return[];if(m)return m(e);var t=[];for(var n in e)Z(e,n)&&t.push(n);return b&&se(e,t),t}function ue(e){if(null==e)return!0;var t=ae(e);return"number"==typeof t&&(z(e)||N(e)||W(e))?0===t:0===ae(oe(e))}function le(e,t){var n=oe(t),r=n.length;if(null==e)return!r;for(var i=Object(e),a=0;a<r;a++){var s=n[a];if(t[s]!==i[s]||!(s in i))return!1}return!0}function ce(e){return e instanceof ce?e:this instanceof ce?void(this._wrapped=e):new ce(e)}function de(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,te(e))}ce.VERSION=i,ce.prototype.value=function(){return this._wrapped},ce.prototype.valueOf=ce.prototype.toJSON=ce.prototype.value,ce.prototype.toString=function(){return String(this._wrapped)};var fe="[object DataView]";function he(e,t,n,r){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var i=typeof e;return("function"===i||"object"===i||"object"==typeof t)&&pe(e,t,n,r)}function pe(e,t,n,r){e instanceof ce&&(e=e._wrapped),t instanceof ce&&(t=t._wrapped);var i=d.call(e);if(i!==d.call(t))return!1;if(H&&"[object Object]"==i&&Y(e)){if(!Y(t))return!1;i=fe}switch(i){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return u.valueOf.call(e)===u.valueOf.call(t);case"[object ArrayBuffer]":case fe:return pe(de(e),de(t),n,r)}var a="[object Array]"===i;if(!a&&ie(e)){if(te(e)!==te(t))return!1;if(e.buffer===t.buffer&&e.byteOffset===t.byteOffset)return!0;a=!0}if(!a){if("object"!=typeof e||"object"!=typeof t)return!1;var s=e.constructor,o=t.constructor;if(s!==o&&!(j(s)&&s instanceof s&&j(o)&&o instanceof o)&&"constructor"in e&&"constructor"in t)return!1}r=r||[];for(var l=(n=n||[]).length;l--;)if(n[l]===e)return r[l]===t;if(n.push(e),r.push(t),a){if((l=e.length)!==t.length)return!1;for(;l--;)if(!he(e[l],t[l],n,r))return!1}else{var c,f=oe(e);if(l=f.length,oe(t).length!==l)return!1;for(;l--;)if(!Z(t,c=f[l])||!he(e[c],t[c],n,r))return!1}return n.pop(),r.pop(),!0}function ge(e,t){return he(e,t)}function me(e){if(!A(e))return[];var t=[];for(var n in e)t.push(n);return b&&se(e,t),t}function ye(e){var t=ae(e);return function(n){if(null==n)return!1;var r=me(n);if(ae(r))return!1;for(var i=0;i<t;i++)if(!j(n[e[i]]))return!1;return e!==Ee||!j(n[ve])}}var ve="forEach",_e=["clear","delete"],Te=["get","has","set"],be=_e.concat(ve,Te),Ee=_e.concat(Te),Se=["add"].concat(_e,ve,"has");const we=G?ye(be):x("Map"),Ae=G?ye(Ee):x("WeakMap"),Ie=G?ye(Se):x("Set"),Ce=x("WeakSet");function Re(e){for(var t=oe(e),n=t.length,r=Array(n),i=0;i<n;i++)r[i]=e[t[i]];return r}function De(e){for(var t=oe(e),n=t.length,r=Array(n),i=0;i<n;i++)r[i]=[t[i],e[t[i]]];return r}function xe(e){for(var t={},n=oe(e),r=0,i=n.length;r<i;r++)t[e[n[r]]]=n[r];return t}function Ne(e){var t=[];for(var n in e)j(e[n])&&t.push(n);return t.sort()}function Oe(e,t){return function(n){var r=arguments.length;if(t&&(n=Object(n)),r<2||null==n)return n;for(var i=1;i<r;i++)for(var a=arguments[i],s=e(a),o=s.length,u=0;u<o;u++){var l=s[u];t&&void 0!==n[l]||(n[l]=a[l])}return n}}const Pe=Oe(me),Me=Oe(oe),ke=Oe(me,!0);function Le(e){if(!A(e))return{};if(y)return y(e);var t=function(){};t.prototype=e;var n=new t;return t.prototype=null,n}function Fe(e,t){var n=Le(e);return t&&Me(n,t),n}function Ue(e){return A(e)?z(e)?e.slice():Pe({},e):e}function Be(e,t){return t(e),e}function je(e){return z(e)?e:[e]}function qe(e){return ce.toPath(e)}function He(e,t){for(var n=t.length,r=0;r<n;r++){if(null==e)return;e=e[t[r]]}return n?e:void 0}function Ge(e,t,n){var r=He(e,qe(t));return C(r)?n:r}function Ve(e,t){for(var n=(t=qe(t)).length,r=0;r<n;r++){var i=t[r];if(!Z(e,i))return!1;e=e[i]}return!!n}function Ye(e){return e}function ze(e){return e=Me({},e),function(t){return le(t,e)}}function Ze(e){return e=qe(e),function(t){return He(t,e)}}function Ke(e,t,n){if(void 0===t)return e;switch(null==n?3:n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,a){return e.call(t,n,r,i,a)}}return function(){return e.apply(t,arguments)}}function We(e,t,n){return null==e?Ye:j(e)?Ke(e,t,n):A(e)&&!z(e)?ze(e):Ze(e)}function Xe(e,t){return We(e,t,1/0)}function $e(e,t,n){return ce.iteratee!==Xe?ce.iteratee(e,t):We(e,t,n)}function Qe(e,t,n){t=$e(t,n);for(var r=oe(e),i=r.length,a={},s=0;s<i;s++){var o=r[s];a[o]=t(e[o],o,e)}return a}function Je(){}function et(e){return null==e?Je:function(t){return Ge(e,t)}}function tt(e,t,n){var r=Array(Math.max(0,e));t=Ke(t,n,1);for(var i=0;i<e;i++)r[i]=t(i);return r}function nt(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}ce.toPath=je,ce.iteratee=Xe;const rt=Date.now||function(){return(new Date).getTime()};function it(e){var t=function(t){return e[t]},n="(?:"+oe(e).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(e){return e=null==e?"":""+e,r.test(e)?e.replace(i,t):e}}const at={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},st=it(at),ot=it(xe(at)),ut=ce.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var lt=/(.)^/,ct={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},dt=/\\|'|\r|\n|\u2028|\u2029/g;function ft(e){return"\\"+ct[e]}var ht=/^\s*(\w|\$)+\s*$/;function pt(e,t,n){!t&&n&&(t=n),t=ke({},t,ce.templateSettings);var r=RegExp([(t.escape||lt).source,(t.interpolate||lt).source,(t.evaluate||lt).source].join("|")+"|$","g"),i=0,a="__p+='";e.replace(r,(function(t,n,r,s,o){return a+=e.slice(i,o).replace(dt,ft),i=o+t.length,n?a+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?a+="'+\n((__t=("+r+"))==null?'':__t)+\n'":s&&(a+="';\n"+s+"\n__p+='"),t})),a+="';\n";var s,o=t.variable;if(o){if(!ht.test(o))throw new Error("variable is not a bare identifier: "+o)}else a="with(obj||{}){\n"+a+"}\n",o="obj";a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{s=new Function(o,"_",a)}catch(e){throw e.source=a,e}var u=function(e){return s.call(this,e,ce)};return u.source="function("+o+"){\n"+a+"}",u}function gt(e,t,n){var r=(t=qe(t)).length;if(!r)return j(n)?n.call(e):n;for(var i=0;i<r;i++){var a=null==e?void 0:e[t[i]];void 0===a&&(a=n,i=r),e=j(a)?a.call(e):a}return e}var mt=0;function yt(e){var t=++mt+"";return e?e+t:t}function vt(e){var t=ce(e);return t._chain=!0,t}function _t(e,t,n,r,i){if(!(r instanceof t))return e.apply(n,i);var a=Le(e.prototype),s=e.apply(a,i);return A(s)?s:a}var Tt=w((function(e,t){var n=Tt.placeholder,r=function(){for(var i=0,a=t.length,s=Array(a),o=0;o<a;o++)s[o]=t[o]===n?arguments[i++]:t[o];for(;i<arguments.length;)s.push(arguments[i++]);return _t(e,r,this,this,s)};return r}));Tt.placeholder=ce;const bt=Tt,Et=w((function(e,t,n){if(!j(e))throw new TypeError("Bind must be called on a function");var r=w((function(i){return _t(e,r,t,this,n.concat(i))}));return r})),St=J(ae);function wt(e,t,n,r){if(r=r||[],t||0===t){if(t<=0)return r.concat(e)}else t=1/0;for(var i=r.length,a=0,s=ae(e);a<s;a++){var o=e[a];if(St(o)&&(z(o)||W(o)))if(t>1)wt(o,t-1,n,r),i=r.length;else for(var u=0,l=o.length;u<l;)r[i++]=o[u++];else n||(r[i++]=o)}return r}const At=w((function(e,t){var n=(t=wt(t,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=t[n];e[r]=Et(e[r],e)}return e}));function It(e,t){var n=function(r){var i=n.cache,a=""+(t?t.apply(this,arguments):r);return Z(i,a)||(i[a]=e.apply(this,arguments)),i[a]};return n.cache={},n}const Ct=w((function(e,t,n){return setTimeout((function(){return e.apply(null,n)}),t)})),Rt=bt(Ct,ce,1);function Dt(e,t,n){var r,i,a,s,o=0;n||(n={});var u=function(){o=!1===n.leading?0:rt(),r=null,s=e.apply(i,a),r||(i=a=null)},l=function(){var l=rt();o||!1!==n.leading||(o=l);var c=t-(l-o);return i=this,a=arguments,c<=0||c>t?(r&&(clearTimeout(r),r=null),o=l,s=e.apply(i,a),r||(i=a=null)):r||!1===n.trailing||(r=setTimeout(u,c)),s};return l.cancel=function(){clearTimeout(r),o=0,r=i=a=null},l}function xt(e,t,n){var r,i,a,s,o,u=function(){var l=rt()-i;t>l?r=setTimeout(u,t-l):(r=null,n||(s=e.apply(o,a)),r||(a=o=null))},l=w((function(l){return o=this,a=l,i=rt(),r||(r=setTimeout(u,t),n&&(s=e.apply(o,a))),s}));return l.cancel=function(){clearTimeout(r),r=a=o=null},l}function Nt(e,t){return bt(t,e)}function Ot(e){return function(){return!e.apply(this,arguments)}}function Pt(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}}function Mt(e,t){return function(){if(--e<1)return t.apply(this,arguments)}}function kt(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}}const Lt=bt(kt,2);function Ft(e,t,n){t=$e(t,n);for(var r,i=oe(e),a=0,s=i.length;a<s;a++)if(t(e[r=i[a]],r,e))return r}function Ut(e){return function(t,n,r){n=$e(n,r);for(var i=ae(t),a=e>0?0:i-1;a>=0&&a<i;a+=e)if(n(t[a],a,t))return a;return-1}}const Bt=Ut(1),jt=Ut(-1);function qt(e,t,n,r){for(var i=(n=$e(n,r,1))(t),a=0,s=ae(e);a<s;){var o=Math.floor((a+s)/2);n(e[o])<i?a=o+1:s=o}return a}function Ht(e,t,n){return function(r,i,a){var s=0,o=ae(r);if("number"==typeof a)e>0?s=a>=0?a:Math.max(a+o,s):o=a>=0?Math.min(a+1,o):a+o+1;else if(n&&a&&o)return r[a=n(r,i)]===i?a:-1;if(i!=i)return(a=t(c.call(r,s,o),$))>=0?a+s:-1;for(a=e>0?s:o-1;a>=0&&a<o;a+=e)if(r[a]===i)return a;return-1}}const Gt=Ht(1,Bt,qt),Vt=Ht(-1,jt);function Yt(e,t,n){var r=(St(e)?Bt:Ft)(e,t,n);if(void 0!==r&&-1!==r)return e[r]}function zt(e,t){return Yt(e,ze(t))}function Zt(e,t,n){var r,i;if(t=Ke(t,n),St(e))for(r=0,i=e.length;r<i;r++)t(e[r],r,e);else{var a=oe(e);for(r=0,i=a.length;r<i;r++)t(e[a[r]],a[r],e)}return e}function Kt(e,t,n){t=$e(t,n);for(var r=!St(e)&&oe(e),i=(r||e).length,a=Array(i),s=0;s<i;s++){var o=r?r[s]:s;a[s]=t(e[o],o,e)}return a}function Wt(e){return function(t,n,r,i){var a=arguments.length>=3;return function(t,n,r,i){var a=!St(t)&&oe(t),s=(a||t).length,o=e>0?0:s-1;for(i||(r=t[a?a[o]:o],o+=e);o>=0&&o<s;o+=e){var u=a?a[o]:o;r=n(r,t[u],u,t)}return r}(t,Ke(n,i,4),r,a)}}const Xt=Wt(1),$t=Wt(-1);function Qt(e,t,n){var r=[];return t=$e(t,n),Zt(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function Jt(e,t,n){return Qt(e,Ot($e(t)),n)}function en(e,t,n){t=$e(t,n);for(var r=!St(e)&&oe(e),i=(r||e).length,a=0;a<i;a++){var s=r?r[a]:a;if(!t(e[s],s,e))return!1}return!0}function tn(e,t,n){t=$e(t,n);for(var r=!St(e)&&oe(e),i=(r||e).length,a=0;a<i;a++){var s=r?r[a]:a;if(t(e[s],s,e))return!0}return!1}function nn(e,t,n,r){return St(e)||(e=Re(e)),("number"!=typeof n||r)&&(n=0),Gt(e,t,n)>=0}const rn=w((function(e,t,n){var r,i;return j(t)?i=t:(t=qe(t),r=t.slice(0,-1),t=t[t.length-1]),Kt(e,(function(e){var a=i;if(!a){if(r&&r.length&&(e=He(e,r)),null==e)return;a=e[t]}return null==a?a:a.apply(e,n)}))}));function an(e,t){return Kt(e,Ze(t))}function sn(e,t){return Qt(e,ze(t))}function on(e,t,n){var r,i,a=-1/0,s=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var o=0,u=(e=St(e)?e:Re(e)).length;o<u;o++)null!=(r=e[o])&&r>a&&(a=r);else t=$e(t,n),Zt(e,(function(e,n,r){((i=t(e,n,r))>s||i===-1/0&&a===-1/0)&&(a=e,s=i)}));return a}function un(e,t,n){var r,i,a=1/0,s=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var o=0,u=(e=St(e)?e:Re(e)).length;o<u;o++)null!=(r=e[o])&&r<a&&(a=r);else t=$e(t,n),Zt(e,(function(e,n,r){((i=t(e,n,r))<s||i===1/0&&a===1/0)&&(a=e,s=i)}));return a}var ln=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function cn(e){return e?z(e)?c.call(e):N(e)?e.match(ln):St(e)?Kt(e,Ye):Re(e):[]}function dn(e,t,n){if(null==t||n)return St(e)||(e=Re(e)),e[nt(e.length-1)];var r=cn(e),i=ae(r);t=Math.max(Math.min(t,i),0);for(var a=i-1,s=0;s<t;s++){var o=nt(s,a),u=r[s];r[s]=r[o],r[o]=u}return r.slice(0,t)}function fn(e){return dn(e,1/0)}function hn(e,t,n){var r=0;return t=$e(t,n),an(Kt(e,(function(e,n,i){return{value:e,index:r++,criteria:t(e,n,i)}})).sort((function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return e.index-t.index})),"value")}function pn(e,t){return function(n,r,i){var a=t?[[],[]]:{};return r=$e(r,i),Zt(n,(function(t,i){var s=r(t,i,n);e(a,t,s)})),a}}const gn=pn((function(e,t,n){Z(e,n)?e[n].push(t):e[n]=[t]})),mn=pn((function(e,t,n){e[n]=t})),yn=pn((function(e,t,n){Z(e,n)?e[n]++:e[n]=1})),vn=pn((function(e,t,n){e[n?0:1].push(t)}),!0);function _n(e){return null==e?0:St(e)?e.length:oe(e).length}function Tn(e,t,n){return t in n}const bn=w((function(e,t){var n={},r=t[0];if(null==e)return n;j(r)?(t.length>1&&(r=Ke(r,t[1])),t=me(e)):(r=Tn,t=wt(t,!1,!1),e=Object(e));for(var i=0,a=t.length;i<a;i++){var s=t[i],o=e[s];r(o,s,e)&&(n[s]=o)}return n})),En=w((function(e,t){var n,r=t[0];return j(r)?(r=Ot(r),t.length>1&&(n=t[1])):(t=Kt(wt(t,!1,!1),String),r=function(e,n){return!nn(t,n)}),bn(e,r,n)}));function Sn(e,t,n){return c.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))}function wn(e,t,n){return null==e||e.length<1?null==t||n?void 0:[]:null==t||n?e[0]:Sn(e,e.length-t)}function An(e,t,n){return c.call(e,null==t||n?1:t)}function In(e,t,n){return null==e||e.length<1?null==t||n?void 0:[]:null==t||n?e[e.length-1]:An(e,Math.max(0,e.length-t))}function Cn(e){return Qt(e,Boolean)}function Rn(e,t){return wt(e,t,!1)}const Dn=w((function(e,t){return t=wt(t,!0,!0),Qt(e,(function(e){return!nn(t,e)}))})),xn=w((function(e,t){return Dn(e,t)}));function Nn(e,t,n,r){R(t)||(r=n,n=t,t=!1),null!=n&&(n=$e(n,r));for(var i=[],a=[],s=0,o=ae(e);s<o;s++){var u=e[s],l=n?n(u,s,e):u;t&&!n?(s&&a===l||i.push(u),a=l):n?nn(a,l)||(a.push(l),i.push(u)):nn(i,u)||i.push(u)}return i}const On=w((function(e){return Nn(wt(e,!0,!0))}));function Pn(e){for(var t=[],n=arguments.length,r=0,i=ae(e);r<i;r++){var a=e[r];if(!nn(t,a)){var s;for(s=1;s<n&&nn(arguments[s],a);s++);s===n&&t.push(a)}}return t}function Mn(e){for(var t=e&&on(e,ae).length||0,n=Array(t),r=0;r<t;r++)n[r]=an(e,r);return n}const kn=w(Mn);function Ln(e,t){for(var n={},r=0,i=ae(e);r<i;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n}function Fn(e,t,n){null==t&&(t=e||0,e=0),n||(n=t<e?-1:1);for(var r=Math.max(Math.ceil((t-e)/n),0),i=Array(r),a=0;a<r;a++,e+=n)i[a]=e;return i}function Un(e,t){if(null==t||t<1)return[];for(var n=[],r=0,i=e.length;r<i;)n.push(c.call(e,r,r+=t));return n}function Bn(e,t){return e._chain?ce(t).chain():t}function jn(e){return Zt(Ne(e),(function(t){var n=ce[t]=e[t];ce.prototype[t]=function(){var e=[this._wrapped];return l.apply(e,arguments),Bn(this,n.apply(ce,e))}})),ce}Zt(["pop","push","reverse","shift","sort","splice","unshift"],(function(e){var t=s[e];ce.prototype[e]=function(){var n=this._wrapped;return null!=n&&(t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0]),Bn(this,n)}})),Zt(["concat","join","slice"],(function(e){var t=s[e];ce.prototype[e]=function(){var e=this._wrapped;return null!=e&&(e=t.apply(e,arguments)),Bn(this,e)}}));const qn=ce;var Hn=jn(r);Hn._=Hn;const Gn=Hn;var Vn=n(9755),Yn=n.n(Vn),zn=n(7079),Zn=n.n(zn),Kn=n(7484),Wn=n.n(Kn);let Xn=n.g.annotations;function $n(e,t){return void 0===n.g[e]?t:n.g[e]}function Qn(e){const t=e.replace(/^\@+/,"").split("@");return`https://${t[1]}/u/${t[0]}`}void 0!==Xn&&Xn||(Xn={default:{colors:{h:0,s:0}},positive:{display_name:"++ | important",keywords:[/\+\+/],colors:{h:.3,s:.65}},negative:{display_name:"** | index",keywords:[/\*\*/],colors:{h:0,s:.8}},reference:{display_name:"== | commentaire",keywords:[/\=\=/],colors:{h:.16,s:.8}},question:{display_name:"?? | trouble",keywords:[/\?\?/],colors:{h:.6,s:.8}}});const Jn=$n("suggested_keywords",[]),er=$n("max_pages",5),tr=$n("social_network","Twitter"),nr=$n("social_login_domain"),rr=$n("social_access_token"),ir=$n("social_group");tracking_keywords=Gn($n("tracking_keywords",[])).map((function(e){return e.toLowerCase()}));var ar={tlPaper:null,followLast:!0,position:"0",currentIdIndex:0,date_levels:[36e5,9e5,3e5,6e4],timeLevel:1,deltaX:40,tlWidth:150,tlHeight:480,globalWords:{},suggestCount:Gn(Jn).map((function(e){return{word:e,rgxp:new RegExp(e.replace(/(\W)/g,"\\$1"),"im"),freq:0,annotations:{}}})),refMouse:{x:0,y:0},refPosTl:{x:0,y:0},tlMouseMoved:!1,tlMouseClicked:!1,filtre:null,tlBuffer:"",relHover:[],wheelDelta:0,scrollEnabled:!1,scrollExtent:7520,lastScrollPos:0,urlRegExp:/https?:\/\/[0-9a-zA-Z\.%\/-_]+/g,wordRegExp:/[^ \.&;,'"!\?\d\(\)\+\[\]\\\…\-«»:\/]{3,}/g,stopWords:["aussi","and","avec","aux","bien","car","cette","comme","dans","donc","des","elle","encore","est","être","eux","faire","fait","http","ici","ils","les","leur","leurs","mais","mes","même","mon","notre","non","nos","nous","ont","oui","par","pas","peu","peut","plus","pour","que","qui","ses","son","sont","sur","tes","très","the","ton","tous","tout","une","votre","vos","vous"]};function sr(e){e.tweets=[],e.pages||(e.pages=1),e.rpp||(e.rpp=100),e.currentPage=0;var t={tweet_mode:"extended",q:e.keyword,count:e.rpp};e.lang&&(t.lang=e.lang),e.since_id&&(t.since_id=e.since_id),t.social_network=e.social_network?e.social_network:"Twitter",function t(n){Yn().getJSON(n,(function(n){e.tweets=e.tweets.concat(n.statuses),e.currentPage++,e.cbData&&e.cbData();var r=!0;if(n.results&&n.results.length){var i=n.results[n.results.length-1].id_str;e.currentPage<e.pages&&(r=!1,t(baseurl+firstparams+"&max_id="+i+lastparams))}r&&(e.tweets.sort((function(e,t){return e.id.localeCompare(t.id)})),e.cbEnd&&e.cbEnd())}))}("search_tweets.php?"+Yn().param(t))}function or(e,t){return Zn().hsl2rgb(Xn[e].colors.h,Xn[e].colors.s,t)}function ur(e){if(!e)return void console.log(e);if(t=e.from_user,/^[A-Z][a-z]{2,8}[0-9]{4,6}$/.test(t))return;var t;function n(e,t,n){var r=gr(t);if(r){var i={referenced_by_id:e,type:n};r.backRefs?r.backRefs.push(i):r.backRefs=[i]}}if(Gn(["id","from_user_id","in_reply_to_status_id"]).each((function(t){void 0!==e[t+"_str"]&&(e[t]=e[t+"_str"],delete e[t+"_str"])})),-1!=Gn(ar.idIndex).indexOf(e.id))return;if(e.html_parts=[],e.entities&&e.entities.user_mentions)for(var r=0;r<e.entities.user_mentions.length;r++){var i=e.entities.user_mentions[r];e.html_parts.push({text:"@"+i.screen_name,start:i.indices[0],end:i.indices[1],link:'<a href="http://twitter.com/'+i.screen_name+'" onclick="filtrerTexte(\''+i.screen_name+'\'); return false;" target="_blank">'})}if(e.entities&&e.entities.hashtags)for(r=0;r<e.entities.hashtags.length;r++){var a="#"+(i=e.entities.hashtags[r]).text;e.html_parts.push({text:a,start:i.indices[0],end:i.indices[1],link:'<a href="http://twitter.com/search?q='+encodeURIComponent(a)+'" onclick="filtrerTexte(\''+Gn.escape(a)+'\'); return false;" target="_blank">'})}if(e.entities&&e.entities.urls)for(r=0;r<e.entities.urls.length;r++)i=e.entities.urls[r],e.html_parts.push({text:i.display_url||i.url,start:i.indices[0],end:i.indices[1],link:'<a href="'+i.url+'" target="_blank">'});e.date_value=Wn()(e.created_at).valueOf();var s=[];for(var o in Xn)if("default"!=o)for(var u in Xn[o].keywords)if(-1!=e.full_text.search(Xn[o].keywords[u])){s.push(o);break}e.annotations=s,e.in_reply_to_status_id&&n(e.id,e.in_reply_to_status_id,"reply"),e.retweeted_status&&e.retweeted_status.id_str&&(e.retweeted_status_id=e.retweeted_status.id_str,n(e.id,e.retweeted_status_id,"retweet"));const l=document.createElement("div");l.innerHTML=e.full_text;var c=(l.textContent||l.innerText||e.full_text).replace(ar.urlRegExp,"").match(ar.wordRegExp);Gn(c).each((function(e){var t=e.toLowerCase();if(-1==Gn(ar.stopWords).indexOf(t)&&-1==Gn(tracking_keywords).indexOf(t)&&"@"!=t[0]){if(ar.globalWords[t])ar.globalWords[t].freq++;else for(var n in ar.globalWords[t]={freq:1,annotations:{}},Xn)"default"!=n&&(ar.globalWords[t].annotations[n]=0);for(var n in s)void 0!==ar.globalWords[t].annotations&&ar.globalWords[t].annotations[s[n]]++}})),Gn(ar.suggestCount).each((function(t){-1!=e.full_text.search(t.rgxp)&&(t.freq++,Gn(s).each((function(e){t.annotations[e]=1+(t.annotations[e]||0)})))}));for(var d=ar.idIndex.length;d&&e.id<ar.idIndex[d-1];)d--;for(ar.tweets.splice(d,0,e),ar.idIndex.splice(d,0,e.id),ar.timeline.length||(ar.timeline=[fr(0,ar.date_levels[0]*parseInt(e.date_value/ar.date_levels[0]))]);e.date_value>ar.timeline[ar.timeline.length-1].end;)ar.timeline.push(fr(0,ar.timeline[ar.timeline.length-1].end));hr(ar.timeline,e)}function lr(e){if(e.slices){var t=[];for(var n in e.slices)t=t.concat(lr(e.slices[n]))}else t=e.tweets;return t}function cr(e,t){if(!e||!e.length)return[];var n=[];if(e[0].level<t){if(e[0].slices)for(var r in e)n=n.concat(cr(e[r].slices,t))}else for(var r in e)n.push({start:e[r].start,end:e[r].end,tweets:lr(e[r])});return n}function dr(){var e=cr(ar.timeline,ar.timeLevel);if(!e.length)return[];for(;0==e[0].tweets.length;)e.splice(0,1);for(;0==e[e.length-1].tweets.length;)e.pop();for(var t=ar.centralTweet?ar.centralTweet:ar.tweets[ar.tweets.length-1],n=30*ar.date_levels[ar.timeLevel],r=Math.min(e[e.length-1].end-n,Math.max(e[0].start+n,t.date_value)),i=r-n,a=r+n;e[0].start<i;)e.splice(0,1);for(;e[e.length-1].end>a;)e.pop();return e}function fr(e,t){var n=t+ar.date_levels[e],r={level:e,start:t,end:n};if(e<ar.date_levels.length-1){r.slices=[];for(var i=t;i<n;)r.slices.push(fr(e+1,i)),i+=ar.date_levels[e+1]}else r.tweets=[];return r}function hr(e,t){var n=t.date_value;for(var r in e)if(n<e[r].end){e[r].slices?hr(e[r].slices,t):e[r].tweets.push(t.id);break}}function pr(e){return'<li class="placeholder '+e+'"></li>'}function gr(e){var t=Gn(ar.idIndex).indexOf(e);return-1!=t&&ar.tweets[t]}function mr(e){ar.position=e,ar.followLast=ar.position==ar.idIndex[ar.tweets.length-1],Cr()}function yr(e){ar.position=ar.currentIdIndex[Math.min(ar.currentIdIndex.length-1,Math.max(0,e))],ar.followLast=!ar.filtre&&e==ar.tweets.length-1,Cr()}function vr(e,t,n){function r(e){return ar.filtre?e.replace(ar.filtre,'<span class="highlight">$1</span>'):e}if(!e)return pr(t);const i={Twitter:{getMsgUrl:function(){return"https://twitter.com/"+a.user.screen_name+"/status/"+a.id},getMsgUri:function(){return"https://twitter.com/"+a.user.screen_name+"/status/"+a.id},getMsgId:function(){return"tweet_"+a.id},getMsgTitle:function(){return"Tweet by "+Gn(a.user.name).escape()},getMsgDescription:function(){return Gn(a.full_text).escape()},getMsgUserUrl:function(){return"https://twitter.com/"+a.user.screen_name},getMsgReplyUrl:function(){return"https://twitter.com/intent/tweet?in_reply_to="+a.id},getMsgRetweetUrl:function(){return"https://twitter.com/intent/retweet?tweet_id="+a.id},getMsgFavoriteUrl:function(){return"https://twitter.com/intent/favorite?tweet_id="+a.id}},Mastodon:{getMsgUrl:function(){return a.url},getMsgUri:function(){return a.uri},getMsgId:function(){return"toot_"+a.id},getMsgTitle:function(){return"Toot by "+Gn(a.user.name).escape()},getMsgDescription:function(){return Gn(Yn()(a.full_text).text()).escape()},getMsgUserUrl:function(){return a.user.url},getMsgReplyUrl:function(){return""},getMsgRetweetUrl:function(){return""},getMsgFavoriteUrl:function(){return""}}}[(a=e).type];var a,s=n||"li",o="<"+s+' draggable="true" class="tweet '+t+'" id="tweet_'+e.id+'" data-title="'+i.getMsgTitle()+'" data-description="'+i.getMsgDescription()+'" data-uri="'+i.getMsgUri()+'"';if("full"!=t&&(o+=" onclick=\"selectTweet('"+e.id+"'); return false;\""),o+=" onmouseover=\"rolloverTweet('"+e.id+"', "+("icons"==t)+');"',ar.followLast&&"full"==t&&"li"==s&&(o+=' style="display: none"'),o+=">",e.annotations&&e.annotations.length){for(var u in o+='<div class="annotations">',e.annotations)o+='<div class="annotation" style="width:'+100/e.annotations.length+"%; background:"+or(e.annotations[u],"icons"==t?.4:.85).hex+'"></div>';o+="</div>"}o+='<div class="twmain">';var l='<a href="'+i.getMsgUserUrl()+'" onclick="filtrerTexte(\'@'+e.user.screen_name+'\'); return false;" target="_blank">';if(o+='<div class="around_img"><img class="profile_image" src="'+e.user.profile_image_url_https+'" />',"full"==t&&(o+='<p class="created_at">'+new Date(e.date_value).toTimeString().substr(0,8)+"</a></p>"),o+="</div>","icons"!=t){let n=0;var c="";const a=Yn()(e.full_text).text();if(e.html_parts.sort((function(e,t){return e.start-t.start})),Gn(e.html_parts).each((function(e){c+=r(a.substring(n,e.start))+e.link+r(e.text)+"</a>",n=e.end})),c+=r(a.substring(n)),o+='<p class="tweet_text"><b>'+l+'<span title="'+e.user.screen_name+'">'+r("@"+e.user.name)+"</span></a>"+("full"==t?" ("+e.user.name+")</b><br />":"</b> : ")+c+"</p>","full"==t&&"li"==s){o+='<div class="tweet_actions"><a href="'+i.getMsgUrl()+'" onclick="tweetPopup(this.href); return false;" target="_blank">afficher message</a>';const e=i.getMsgReplyUrl();e&&(o+='<a href="'+e+'" onclick="tweetPopup(this.href); return false;" target="_blank">répondre</a> · ');const t=i.getMsgRetweetUrl();t&&(o+='<a href="'+t+'" onclick="tweetPopup(this.href); return false;" target="_blank">retransmettre</a> · ');const n=i.getMsgFavoriteUrl();n&&(o+='<a href="'+n+'" onclick="tweetPopup(this.href); return false;" target="_blank">favori</a>'),o+="</div>"}}return o+"</div></"+s+">"}function _r(e,t,n){if(ar.tlOnDisplay&&ar.tlOnDisplay.length){var r=Math.min(ar.tlOnDisplay.length-1,Math.max(0,Math.floor((ar.tlHeight-t)/ar.scaleY))),i=Math.floor((e-ar.deltaX)/ar.scaleX),a=0;if(i>=ar.tlOnDisplay[r].totalTweets||i<0){if(!n)return null;i=Math.min(ar.tlOnDisplay[r].totalTweets-1,Math.max(0,i))}for(var s in ar.tlOnDisplay[r].displayData){var o=a+ar.tlOnDisplay[r].displayData[s].length;if(i<o)return{id:ar.tlOnDisplay[r].displayData[s][i-a],annotation:s};a=o}}}function Tr(e,t){if(ar.tweets){for(var n,r,i=e.date_value,a=t||(e.annotations&&e.annotations.length?e.annotations[0]:"default"),s=0;s<ar.tlOnDisplay.length;s++)if(ar.tlOnDisplay[s].end>i){r=ar.tlHeight-(s+.5)*ar.scaleY;var o=0;for(var u in ar.tlOnDisplay[s].displayData){if(u==a){var l=Gn(ar.tlOnDisplay[s].displayData[u]).indexOf(e.id);-1!=l&&(n=ar.deltaX+ar.scaleX*(l+o+.5));break}o+=ar.tlOnDisplay[s].displayData[u].length}break}return n&&r?{x:n,y:r}:null}}function br(e,t,n){var r=gr(e);if(r){var i=Tr(r,n);if(i){var a=Yn()("#timeline").offset();for(var s in t?(Yn()("#hovercontent").html(vr(r,"full","div")),Yn()("#hovertweet").css({left:parseInt(a.left+i.x)+"px",top:parseInt(a.top+i.y),display:"block"})):Yn()("#hovertweet").hide(),ar.relHover)ar.relHover[s].remove();ar.relHover=Sr(r,i,"#303030"),ar.relHover.push(Er(i,"#ffffff"))}}}function Er(e,t){var n=ar.tlPaper.rect(e.x-.5*ar.scaleX,e.y-.5*ar.scaleY,ar.scaleX,ar.scaleY);return n.attr({stroke:t,fill:t,"fill-opacity":.25}),n}function Sr(e,t,n){var r=[];function i(e,t,i){if(e&&t){r.push(Er(i?e:t,n));var a=ar.tlPaper.path((s=e,o=t,u=.3*o.y-.3*s.y+.8*s.x+.2*o.x,l=.8*s.y+.2*o.y-.3*o.x+.3*s.x,c=.3*o.y-.3*s.y+.2*s.x+.8*o.x,d=.2*s.y+.8*o.y-.3*o.x+.3*s.x,"M"+s.x+" "+s.y+"C"+[u,l,c,d,o.x,o.y].join(" "))).attr({stroke:n,"stroke-width":1.5,"stroke-opacity":.8});r.push(a)}var s,o,u,l,c,d}if(e.retweeted_status_id&&(s=gr(e.retweeted_status_id))&&i(t,Tr(s)),e.in_reply_to_status_id&&(s=gr(e.in_reply_to_status_id))&&i(t,Tr(s)),e.backRefs)for(var a in e.backRefs){var s;(s=gr(e.backRefs[a].referenced_by_id))&&i(Tr(s),t,!0)}return r}function wr(){var e=Yn()(this),t=e.offset();e.css({color:"#0099ff"}),Yn()("#hoverkw").css({left:t.left+"px",top:parseInt(t.top)+~~(e.height()/2)+"px",display:"block"}).attr("kw",e.text())}function Ar(){Yn()("#hoverkw").hide(),Yn()(this).css({color:"#000000"})}function Ir(e,t){var n=Gn(e).min((function(e){return e.freq})).freq,r=Math.max(n+.1,Gn(e).max((function(e){return e.freq})).freq),i=8/Math.sqrt(r-n),a="";Gn(e).each((function(e){var t=0,r="default";for(var s in e.annotations)e.annotations[s]==t&&(r="default"),e.annotations[s]>t&&(r=s,t=e.annotations[s]);if("default"==r)var o="";else{var u=or(r,.6);o="background: rgba("+[Math.floor(u.r),Math.floor(u.g),Math.floor(u.b),e.annotations[r]/e.freq].join(",")+")"}var l=Math.floor(12+Math.sqrt(e.freq-n)*i);a+='<span style="line-height: '+(8+l)+"px; font-size: "+l+"px;"+o+'">'+e.word+"</span> "})),Yn()(t).html(a),Yn()(t+" span").mouseover(wr).mouseout(Ar).click((function(){Yn()("#hoverkw").toggle()}))}function Cr(){if(ar.tweets){if(ar.filtre){var e=Gn(ar.tweets).filter((function(e){var t="@"+e.user.screen_name;return-1!=e.full_text.search(ar.filtre)||-1!=t.search(ar.filtre)}));if(Yn()("#inp_q").val(ar.filtreTexte+" ("+e.length+" tweets)"),e.length){var t=Gn(e).map((function(e){return e.id}));if(-1==(n=Gn(t).indexOf(ar.position)))for(n=t.length-1;n>0&&t[n]>ar.position;n--);ar.position=t[n],ar.currentIdIndex=t}}else{var n;ar.currentIdIndex=ar.idIndex,e=ar.tweets,-1==(n=Gn(ar.idIndex).indexOf(ar.position))&&(n=ar.followLast?ar.idIndex.length-1:0)}var r=e.length,i=0,a=0,s="",o=[];if(r){if(ar.lastScrollPos=Math.floor(ar.scrollExtent*(1-n/r)),Yn()("#scrollcont").scrollTop(ar.lastScrollPos),r>n+18){i++,a+=20;for(var u=n+31;u>=n+18;u--)x(u,"icons")}if(r>n+4)for(i++,a+=20,u=n+17;u>=n+4;u--)x(u,"icons");for(var l=3;l>=1;l--)r>n+l&&(a+=47,i++,x(n+l,"half"));x(n,"full");var c=n-1;for(u=0;u<Math.min(6,Math.max(3,6-i))&&!(c<0);u++)x(c,"half"),c--;for(u=0;u<14*Math.min(4,Math.max(2,7-i))&&!(c<0);u++)x(c,"icons"),c--;s!=ar.tlBuffer&&(Yn()("#tweetlist").html(s),Yn()(".tweet.full").fadeIn(),ar.tlBuffer=s),ar.suggestCount.length&&Ir(ar.suggestCount,"#suggkw");var d=Gn(ar.globalWords).chain().map((function(e,t){return{word:t,freq:e.freq,annotations:e.annotations}})).filter((function(e){return e.freq>3})).value();d.length?Ir(d=Gn(d).sortBy((function(e){return-e.freq})).slice(0,40),"#motscles"):Yn()("#motscles").html(""),ar.centralTweet=e[n]}else Yn()("#tweetlist").html(""),ar.tlBuffer="",Yn()("#motscles").html("");if(ar.tlOnDisplay=dr(),ar.tlOnDisplay&&ar.tlOnDisplay.length){ar.scaleY=ar.tlHeight/ar.tlOnDisplay.length;var f=0,h=0,p=ar.tlOnDisplay.length-1;if(r)var g=e[o[o.length-1]].date_value,m=e[o[0]].date_value;for(u=0;u<ar.tlOnDisplay.length;u++){r&&(g>=ar.tlOnDisplay[u].start&&g<ar.tlOnDisplay[u].end&&(h=u),m>=ar.tlOnDisplay[u].start&&m<ar.tlOnDisplay[u].end&&(p=u));var y={};for(var v in Xn)y[v]=[];for(var v in ar.tlOnDisplay[u].tweets){var _=ar.tlOnDisplay[u].tweets[v],T=gr(_);if(T)if(T.annotations&&T.annotations.length)for(var l in T.annotations)y[T.annotations[l]].push(_);else y.default.push(_)}var b=0;for(var v in y)b+=y[v].length;f=Math.max(f,b),ar.tlOnDisplay[u].displayData=y,ar.tlOnDisplay[u].totalTweets=b}if(ar.scaleX=(ar.tlWidth-ar.deltaX)/f,ar.tlPaper.clear(),ar.relHover=null,r){var E=ar.tlHeight-h*ar.scaleY,S=ar.tlHeight-(p+1)*ar.scaleY,w="M0 "+ar.tlHeight+"C"+.7*ar.deltaX+" "+ar.tlHeight+" "+.3*ar.deltaX+" "+E+" "+ar.deltaX+" "+E+"L"+ar.tlWidth+" "+E+"L"+ar.tlWidth+" "+S+"L"+ar.deltaX+" "+S+"C"+.3*ar.deltaX+" "+S+" "+.7*ar.deltaX+" 0 0 0";ar.tlPaper.path(w).attr({stroke:"none",fill:"#000080",opacity:.2})}for(ar.tlPaper.text(ar.deltaX/2,ar.tlHeight-7,new Date(ar.tlOnDisplay[0].start).toTimeString().substr(0,5)).attr({"text-anchor":"middle","font-size":"9px"}),ar.tlPaper.text(ar.deltaX/2,7,new Date(ar.tlOnDisplay[ar.tlOnDisplay.length-1].end).toTimeString().substr(0,5)).attr({"text-anchor":"middle","font-size":"9px"}),u=0;u<ar.tlOnDisplay.length;u++){c=0;var A=ar.tlHeight-(u+1)*ar.scaleY;for(var v in ar.tlOnDisplay[u].displayData){var I=ar.tlOnDisplay[u].displayData[v].length;I>0&&(ar.tlPaper.rect(ar.deltaX+c*ar.scaleX,A,I*ar.scaleX,ar.scaleY).attr({stroke:"none",fill:or(v,.4).hex}),c+=I)}u<ar.tlOnDisplay.length-1&&!(ar.tlOnDisplay[u].end%18e5)&&(ar.tlPaper.path("M0 "+A+"L"+ar.tlWidth+" "+A).attr({stroke:"#ccc"}),ar.tlPaper.text(ar.deltaX/2,A,new Date(ar.tlOnDisplay[u].end).toTimeString().substr(0,5)).attr({"text-anchor":"middle","font-size":"9px"}))}if(r){if(ar.filtre)for(u=0;u<e.length;u++)if(u!=n){var C=Tr(e[u]);C&&Er(C,"#ffccff")}var R=Tr(e[n]);if(R){Er(R,"#ffff00");var D=R.y-.5*ar.scaleY;w="M0 "+a+"C"+.7*ar.deltaX+" "+a+" "+.2*ar.deltaX+" "+D+" "+ar.deltaX+" "+D+"L"+(R.x-.5*ar.scaleX)+" "+D,D=R.y+.5*ar.scaleY,a+=117,w+="L"+(R.x-.5*ar.scaleX)+" "+D+"L"+ar.deltaX+" "+D+"C"+.2*ar.deltaX+" "+D+" "+.7*ar.deltaX+" "+a+" 0 "+a,ar.tlPaper.path(w).attr({stroke:"#ffff00",fill:"#ffff00","fill-opacity":.15}),Sr(e[n],R,"#800080")}}}}function x(t,n){t<r&&t>=0?(s+=vr(e[t],n),o.push(t)):s+=pr(n)}}function Rr(e){var t,n;t=e,n=e?new RegExp("("+e.replace(/(\W)/g,"\\$1")+")","gim"):null,Yn()("#recherche_annot").slideUp(),Yn()("#inp_q").val(t).attr("class","rechercheCourante"),ar.filtreTexte=t,ar.filtre=n,ar.followLast=!n&&ar.position==ar.idIndex[ar.idIndex.length-1],Cr()}function Dr(e){var t=Yn()("#timeline").offset();if(ar.tlMouseClicked&&ar.tlMouseMoved)(n=_r(e.pageX-t.left+ar.refPosTl.x-ar.refMouse.x,e.pageY-t.top+ar.refPosTl.y-ar.refMouse.y,!0))&&mr(n.id);else{var n=_r(e.pageX-t.left,e.pageY-t.top,ar.tlMouseClicked);ar.tlMouseMoved&&!ar.tlMouseClicked&&(n?br(n.id,!0,n.annotation):Yn()("#hovertweet").hide()),ar.tlMouseClicked&&!ar.tlMouseMoved&&n&&mr(n.id)}}function xr(e,t){for(var n in t||(ar.timeline=[],ar.idIndex=[],ar.tweets=[]),e)ur(e[n]);ar.followLast&&(ar.position=ar.idIndex[ar.tweets.length-1]),Cr()}function Nr(){Yn()("#recherche_annot").slideUp();var e=Yn()("#inp_q"),t=e.val();""!=t&&t!=ar.filtreTexte||(ar.filtre?e.attr("class","rechercheCourante").val(ar.filtreTexte):e.attr("class","greyed").val(l10n.rechercher))}function Or(){var e="",t=ar.date_levels[ar.timeLevel],n=36e5,r=Math.floor(t/n);r&&(e+=r+" h. "),t-=r*n;var i=Math.floor(t/6e4);i&&(e+=i+" min. "),(t-=6e4*i)&&(e+=Math.floor(t/1e3)+" sec."),Yn()("#time_scale").html(e),Yn()("#time_zoomout").attr("class",0==ar.timeLevel?"inactive":""),Yn()("#time_zoomin").attr("class",ar.timeLevel==ar.date_levels.length-1?"inactive":"")}function Pr(){Yn().ajax({beforeSend:function(e){e.setRequestHeader("Authorization",`Bearer ${rr}`)},type:"GET",dataType:"json",url:`https://${nr}/api/v1/accounts/verify_credentials`}).then((e=>{var t;(t=e.id,Yn().ajax({beforeSend:function(e){e.setRequestHeader("Authorization",`Bearer ${rr}`)},type:"GET",dataType:"json",url:`https://${nr}/api/v1/accounts/${t}/following`})).then((e=>{let t=!1;for(const n of e){const e=Qn(ir);n.uri==e&&(t=!0)}Yn()("#socialGroupFollow").remove(),t||(function(){const e=ir.replace(/^\@+/,"");Yn()("#twwWrap").prepend(`<div id="socialGroupFollow" ><a target=”_blank” href="https://${nr}/authorize_interaction?uri=${e}">Suivez le groupe ${ir}</a> et recharger cette page</div>`)}(),setTimeout((function(){Pr()}),5e3))}))}))}Yn()((function(){"Mastodon"==tr&&Pr(),ar.tlWidth=Yn()("#timeline").width(),ar.tlHeight=Yn()("#timeline").height(),ar.tlPaper=Zn()("timeline",ar.tlWidth,ar.tlHeight),function(){ar.tlPaper.clear();var e=ar.tlPaper.rect(0,ar.tlHeight,ar.tlWidth,0).attr({stroke:"none",fill:"#8080cc"}),t=ar.tlPaper.text(ar.tlWidth/2,ar.tlHeight/2,"0 tweet").attr({"font-size":"20px","text-anchor":"middle"});sr({social_network:tr,keyword:tracking_keywords.join(" OR "),pages:er,rpp:100,cbData:function(){t.attr("text",this.tweets.length-this.currentPage+1+" tweets");var n=ar.tlHeight*this.currentPage/this.pages;e.animate({y:ar.tlHeight-n,height:n})},cbEnd:function(){xr(this.tweets),setInterval((function(){sr({social_network:tr,keyword:tracking_keywords.join(" OR "),pages:1,since_id:ar.idIndex[ar.idIndex.length-1],rpp:100,cbEnd:function(){xr(this.tweets,!0)}})}),2e4)}})}();var e="";for(var t in Xn)"default"!=t&&(e+='<a href="#" style="background: '+or(t,.7).hex+";\" onclick=filtrerAnnotation('"+t+"'); return false;\">"+Xn[t].display_name+"</a> ");Yn()("#rech_list_annot").html(e),Or(),Yn()("#tweetlist").mousewheel((function(e,t){return ar.wheelDelta+=t,Math.abs(ar.wheelDelta)>=1&&(yr(parseInt(ar.wheelDelta)+Gn(ar.currentIdIndex).indexOf(ar.position)),ar.wheelDelta=0),!1})),Yn()("#tweetlist").delegate(".tweet","dragstart",(function(e){var t=document.createElement("div");t.appendChild(this.cloneNode(!0));try{e.originalEvent.dataTransfer.setData("text/html",t.innerHTML)}catch(n){e.originalEvent.dataTransfer.setData("text",t.innerHTML)}})),Yn()("#timeline").mousewheel((function(e,t){ar.wheelDelta+=t;let n=0;return Math.abs(ar.wheelDelta)>=1&&(n=ar.wheelDelta>0?Math.min(ar.date_levels.length-1,ar.timeLevel+1):Math.max(0,ar.timeLevel-1),n!=ar.timeLevel&&(ar.timeLevel=n,Or(),Cr()),ar.wheelDelta=0),!1})),Yn()("#time_zoomin").click((function(){ar.timeLevel<ar.date_levels.length-1&&(ar.timeLevel++,Or(),Cr())})),Yn()("#time_zoomout").click((function(){ar.timeLevel>0&&(ar.timeLevel--,Or(),Cr())})),Yn()("#timeline, #tweetlist").mouseout((function(){ar.tlMouseClicked=!1,ar.tlMouseMoved=!1,Yn()("#hovertweet").hide()})),Yn()("#timeline").mousemove((function(e){ar.tlMouseMoved=!0,Dr(e)})).mousedown((function(e){ar.tlMouseClicked=!0,ar.tlMouseMoved=!1;var t=Yn()(this).offset();ar.refMouse={x:e.pageX-t.left,y:e.pageY-t.top},ar.refPosTl=Tr(gr(ar.position))||ar.refMouse})).mouseup((function(e){Dr(e),ar.tlMouseClicked=!1,ar.tlMouseMoved=!1})),Yn()("#inp_q").focus((function(){Yn()("#recherche_annot").slideDown(),Yn()(this).val(Yn()(this).val().replace(/ \(.+\)$/,"")),Yn()(this).hasClass("greyed")&&Yn()(this).val(""),Yn()(this).attr("class","")})).focusout((function(){Nr()})),Yn()("#inp_reset").click((function(){return Yn()("#inp_q").val(""),ar.filtre&&(ar.filtre=null,Cr()),ar.filtreTexte="",Nr(),!1})),Yn()("#recherche").submit((function(e){return e.preventDefault(),Yn()("#inp_q").hasClass("greyed")||Rr(Yn()("#inp_q").val()),!1})),Yn()("#hoverkw").mouseover((function(){Yn()(this).dequeue().show()})).mouseout((function(){Yn()(this).hide()})),Yn()("#hkwsearch").click((function(){var e=Yn()("#hoverkw");return Rr(e.attr("kw")),e.hide(),!1})),Yn()("#hkwtweet").click((function(){var e=Yn()("#hoverkw");return add_grammar(e.attr("kw")),e.hide(),!1})),Yn()(".acctitre").click((function(){return Yn()(this).next().slideToggle(),!1})),Jn.length||Yn()("#suggkw").parent().hide(),setInterval((function(){var e=Yn()("#scrollcont");e.scrollTop()!=ar.lastScrollPos&&ar.tweets&&ar.currentIdIndex&&yr(Math.floor(ar.currentIdIndex.length*(1-e.scrollTop()/ar.scrollExtent)))}),100)})),n(9357),n(3369);const Mr=/[a-z]{1,6}(?:[._][a-z]{1,2})?/i,kr=/\!'#%&'\(\)*\+,\\\-\.\/:;<=>\?@\[\]\^_{|}~\$/;function Lr(e,t,n){return n=n||"","string"!=typeof e&&(e.global&&n.indexOf("g")<0&&(n+="g"),e.ignoreCase&&n.indexOf("i")<0&&(n+="i"),e.multiline&&n.indexOf("m")<0&&(n+="m"),e=e.source),new RegExp(e.replace(/#\{(\w+)\}/g,(function(e,n){var r=t[n]||"";return"string"!=typeof r&&(r=r.source),r})),n)}n(3946);const Fr=/\x09-\x0D\x20\x85\xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000/,Ur=Lr(/[#{spacesGroup}]/,{spacesGroup:Fr}),Br=Lr("(^|#{spaces})(\\$)(#{cashtag})(?=$|\\s|[#{punct}])",{cashtag:Mr,spaces:Ur,punct:kr},"gi");function jr(e){if(!e||-1===e.indexOf("$"))return[];var t=[];return e.replace(Br,(function(e,n,r,i,a,s){var o=a+n.length,u=o+i.length+1;t.push({cashtag:i,indices:[o,u]})})),t}n(1466);const qr=/[##]/,Hr=Lr(/^(?:#{hashSigns}|:\/\/)/,{hashSigns:qr}),Gr=Lr(RegExp("(?:(?:한국|香港|澳門|新加坡|台灣|台湾|中國|中国|გე|ລາວ|ไทย|ලංකා|ഭാരതം|ಭಾರತ|భారత్|சிங்கப்பூர்|இலங்கை|இந்தியா|ଭାରତ|ભારત|ਭਾਰਤ|ভাৰত|ভারত|বাংলা|भारोत|भारतम्|भारत|ڀارت|پاکستان|موريتانيا|مليسيا|مصر|قطر|فلسطين|عمان|عراق|سورية|سودان|تونس|بھارت|بارت|ایران|امارات|المغرب|السعودية|الجزائر|البحرين|الاردن|հայ|қаз|укр|срб|рф|мон|мкд|ею|бел|бг|ευ|ελ|zw|zm|za|yt|ye|ws|wf|vu|vn|vi|vg|ve|vc|va|uz|uy|us|um|uk|ug|ua|tz|tw|tv|tt|tr|tp|to|tn|tm|tl|tk|tj|th|tg|tf|td|tc|sz|sy|sx|sv|su|st|ss|sr|so|sn|sm|sl|sk|sj|si|sh|sg|se|sd|sc|sb|sa|rw|ru|rs|ro|re|qa|py|pw|pt|ps|pr|pn|pm|pl|pk|ph|pg|pf|pe|pa|om|nz|nu|nr|np|no|nl|ni|ng|nf|ne|nc|na|mz|my|mx|mw|mv|mu|mt|ms|mr|mq|mp|mo|mn|mm|ml|mk|mh|mg|mf|me|md|mc|ma|ly|lv|lu|lt|ls|lr|lk|li|lc|lb|la|kz|ky|kw|kr|kp|kn|km|ki|kh|kg|ke|jp|jo|jm|je|it|is|ir|iq|io|in|im|il|ie|id|hu|ht|hr|hn|hm|hk|gy|gw|gu|gt|gs|gr|gq|gp|gn|gm|gl|gi|gh|gg|gf|ge|gd|gb|ga|fr|fo|fm|fk|fj|fi|eu|et|es|er|eh|eg|ee|ec|dz|do|dm|dk|dj|de|cz|cy|cx|cw|cv|cu|cr|co|cn|cm|cl|ck|ci|ch|cg|cf|cd|cc|ca|bz|by|bw|bv|bt|bs|br|bq|bo|bn|bm|bl|bj|bi|bh|bg|bf|be|bd|bb|ba|az|ax|aw|au|at|as|ar|aq|ao|an|am|al|ai|ag|af|ae|ad|ac)(?=[^0-9a-zA-Z@+-]|$))")),Vr=/\u202A-\u202E\u061C\u200E\u200F\u2066\u2067\u2068\u2069/,Yr=/\uFFFE\uFEFF\uFFFF/;function zr(e,t){return e.replace(/#\{(\w+)\}/g,(function(e,n){return t[n]||""}))}const Zr=zr("#{punct}#{spacesGroup}#{invalidCharsGroup}#{directionalMarkersGroup}",{punct:kr,spacesGroup:Fr,invalidCharsGroup:Yr,directionalMarkersGroup:Vr}),Kr=Lr(/[^#{invalidDomainChars}]/,{invalidDomainChars:Zr}),Wr=Lr(/(?:(?:#{validDomainChars}(?:-|#{validDomainChars})*)?#{validDomainChars}\.)/,{validDomainChars:Kr}),Xr=Lr(RegExp("(?:(?:삼성|닷컴|닷넷|香格里拉|餐厅|食品|飞利浦|電訊盈科|集团|通販|购物|谷歌|诺基亚|联通|网络|网站|网店|网址|组织机构|移动|珠宝|点看|游戏|淡马锡|机构|書籍|时尚|新闻|政府|政务|招聘|手表|手机|我爱你|慈善|微博|广东|工行|家電|娱乐|天主教|大拿|大众汽车|在线|嘉里大酒店|嘉里|商标|商店|商城|公益|公司|八卦|健康|信息|佛山|企业|中文网|中信|世界|ポイント|ファッション|セール|ストア|コム|グーグル|クラウド|みんな|คอม|संगठन|नेट|कॉम|همراه|موقع|موبايلي|كوم|كاثوليك|عرب|شبكة|بيتك|بازار|العليان|ارامكو|اتصالات|ابوظبي|קום|сайт|рус|орг|онлайн|москва|ком|католик|дети|zuerich|zone|zippo|zip|zero|zara|zappos|yun|youtube|you|yokohama|yoga|yodobashi|yandex|yamaxun|yahoo|yachts|xyz|xxx|xperia|xin|xihuan|xfinity|xerox|xbox|wtf|wtc|wow|world|works|work|woodside|wolterskluwer|wme|winners|wine|windows|win|williamhill|wiki|wien|whoswho|weir|weibo|wedding|wed|website|weber|webcam|weatherchannel|weather|watches|watch|warman|wanggou|wang|walter|walmart|wales|vuelos|voyage|voto|voting|vote|volvo|volkswagen|vodka|vlaanderen|vivo|viva|vistaprint|vista|vision|visa|virgin|vip|vin|villas|viking|vig|video|viajes|vet|versicherung|vermögensberatung|vermögensberater|verisign|ventures|vegas|vanguard|vana|vacations|ups|uol|uno|university|unicom|uconnect|ubs|ubank|tvs|tushu|tunes|tui|tube|trv|trust|travelersinsurance|travelers|travelchannel|travel|training|trading|trade|toys|toyota|town|tours|total|toshiba|toray|top|tools|tokyo|today|tmall|tkmaxx|tjx|tjmaxx|tirol|tires|tips|tiffany|tienda|tickets|tiaa|theatre|theater|thd|teva|tennis|temasek|telefonica|telecity|tel|technology|tech|team|tdk|tci|taxi|tax|tattoo|tatar|tatamotors|target|taobao|talk|taipei|tab|systems|symantec|sydney|swiss|swiftcover|swatch|suzuki|surgery|surf|support|supply|supplies|sucks|style|study|studio|stream|store|storage|stockholm|stcgroup|stc|statoil|statefarm|statebank|starhub|star|staples|stada|srt|srl|spreadbetting|spot|sport|spiegel|space|soy|sony|song|solutions|solar|sohu|software|softbank|social|soccer|sncf|smile|smart|sling|skype|sky|skin|ski|site|singles|sina|silk|shriram|showtime|show|shouji|shopping|shop|shoes|shiksha|shia|shell|shaw|sharp|shangrila|sfr|sexy|sex|sew|seven|ses|services|sener|select|seek|security|secure|seat|search|scot|scor|scjohnson|science|schwarz|schule|school|scholarships|schmidt|schaeffler|scb|sca|sbs|sbi|saxo|save|sas|sarl|sapo|sap|sanofi|sandvikcoromant|sandvik|samsung|samsclub|salon|sale|sakura|safety|safe|saarland|ryukyu|rwe|run|ruhr|rugby|rsvp|room|rogers|rodeo|rocks|rocher|rmit|rip|rio|ril|rightathome|ricoh|richardli|rich|rexroth|reviews|review|restaurant|rest|republican|report|repair|rentals|rent|ren|reliance|reit|reisen|reise|rehab|redumbrella|redstone|red|recipes|realty|realtor|realestate|read|raid|radio|racing|qvc|quest|quebec|qpon|pwc|pub|prudential|pru|protection|property|properties|promo|progressive|prof|productions|prod|pro|prime|press|praxi|pramerica|post|porn|politie|poker|pohl|pnc|plus|plumbing|playstation|play|place|pizza|pioneer|pink|ping|pin|pid|pictures|pictet|pics|piaget|physio|photos|photography|photo|phone|philips|phd|pharmacy|pfizer|pet|pccw|pay|passagens|party|parts|partners|pars|paris|panerai|panasonic|pamperedchef|page|ovh|ott|otsuka|osaka|origins|orientexpress|organic|org|orange|oracle|open|ooo|onyourside|online|onl|ong|one|omega|ollo|oldnavy|olayangroup|olayan|okinawa|office|off|observer|obi|nyc|ntt|nrw|nra|nowtv|nowruz|now|norton|northwesternmutual|nokia|nissay|nissan|ninja|nikon|nike|nico|nhk|ngo|nfl|nexus|nextdirect|next|news|newholland|new|neustar|network|netflix|netbank|net|nec|nba|navy|natura|nationwide|name|nagoya|nadex|nab|mutuelle|mutual|museum|mtr|mtpc|mtn|msd|movistar|movie|mov|motorcycles|moto|moscow|mortgage|mormon|mopar|montblanc|monster|money|monash|mom|moi|moe|moda|mobily|mobile|mobi|mma|mls|mlb|mitsubishi|mit|mint|mini|mil|microsoft|miami|metlife|merckmsd|meo|menu|men|memorial|meme|melbourne|meet|media|med|mckinsey|mcdonalds|mcd|mba|mattel|maserati|marshalls|marriott|markets|marketing|market|map|mango|management|man|makeup|maison|maif|madrid|macys|luxury|luxe|lupin|lundbeck|ltda|ltd|lplfinancial|lpl|love|lotto|lotte|london|lol|loft|locus|locker|loans|loan|llp|llc|lixil|living|live|lipsy|link|linde|lincoln|limo|limited|lilly|like|lighting|lifestyle|lifeinsurance|life|lidl|liaison|lgbt|lexus|lego|legal|lefrak|leclerc|lease|lds|lawyer|law|latrobe|latino|lat|lasalle|lanxess|landrover|land|lancome|lancia|lancaster|lamer|lamborghini|ladbrokes|lacaixa|kyoto|kuokgroup|kred|krd|kpn|kpmg|kosher|komatsu|koeln|kiwi|kitchen|kindle|kinder|kim|kia|kfh|kerryproperties|kerrylogistics|kerryhotels|kddi|kaufen|juniper|juegos|jprs|jpmorgan|joy|jot|joburg|jobs|jnj|jmp|jll|jlc|jio|jewelry|jetzt|jeep|jcp|jcb|java|jaguar|iwc|iveco|itv|itau|istanbul|ist|ismaili|iselect|irish|ipiranga|investments|intuit|international|intel|int|insure|insurance|institute|ink|ing|info|infiniti|industries|inc|immobilien|immo|imdb|imamat|ikano|iinet|ifm|ieee|icu|ice|icbc|ibm|hyundai|hyatt|hughes|htc|hsbc|how|house|hotmail|hotels|hoteles|hot|hosting|host|hospital|horse|honeywell|honda|homesense|homes|homegoods|homedepot|holiday|holdings|hockey|hkt|hiv|hitachi|hisamitsu|hiphop|hgtv|hermes|here|helsinki|help|healthcare|health|hdfcbank|hdfc|hbo|haus|hangout|hamburg|hair|guru|guitars|guide|guge|gucci|guardian|group|grocery|gripe|green|gratis|graphics|grainger|gov|got|gop|google|goog|goodyear|goodhands|goo|golf|goldpoint|gold|godaddy|gmx|gmo|gmbh|gmail|globo|global|gle|glass|glade|giving|gives|gifts|gift|ggee|george|genting|gent|gea|gdn|gbiz|gay|garden|gap|games|game|gallup|gallo|gallery|gal|fyi|futbol|furniture|fund|fun|fujixerox|fujitsu|ftr|frontier|frontdoor|frogans|frl|fresenius|free|fox|foundation|forum|forsale|forex|ford|football|foodnetwork|food|foo|fly|flsmidth|flowers|florist|flir|flights|flickr|fitness|fit|fishing|fish|firmdale|firestone|fire|financial|finance|final|film|fido|fidelity|fiat|ferrero|ferrari|feedback|fedex|fast|fashion|farmers|farm|fans|fan|family|faith|fairwinds|fail|fage|extraspace|express|exposed|expert|exchange|everbank|events|eus|eurovision|etisalat|esurance|estate|esq|erni|ericsson|equipment|epson|epost|enterprises|engineering|engineer|energy|emerck|email|education|edu|edeka|eco|eat|earth|dvr|dvag|durban|dupont|duns|dunlop|duck|dubai|dtv|drive|download|dot|doosan|domains|doha|dog|dodge|doctor|docs|dnp|diy|dish|discover|discount|directory|direct|digital|diet|diamonds|dhl|dev|design|desi|dentist|dental|democrat|delta|deloitte|dell|delivery|degree|deals|dealer|deal|dds|dclk|day|datsun|dating|date|data|dance|dad|dabur|cyou|cymru|cuisinella|csc|cruises|cruise|crs|crown|cricket|creditunion|creditcard|credit|cpa|courses|coupons|coupon|country|corsica|coop|cool|cookingchannel|cooking|contractors|contact|consulting|construction|condos|comsec|computer|compare|company|community|commbank|comcast|com|cologne|college|coffee|codes|coach|clubmed|club|cloud|clothing|clinique|clinic|click|cleaning|claims|cityeats|city|citic|citi|citadel|cisco|circle|cipriani|church|chrysler|chrome|christmas|chloe|chintai|cheap|chat|chase|charity|channel|chanel|cfd|cfa|cern|ceo|center|ceb|cbs|cbre|cbn|cba|catholic|catering|cat|casino|cash|caseih|case|casa|cartier|cars|careers|career|care|cards|caravan|car|capitalone|capital|capetown|canon|cancerresearch|camp|camera|cam|calvinklein|call|cal|cafe|cab|bzh|buzz|buy|business|builders|build|bugatti|budapest|brussels|brother|broker|broadway|bridgestone|bradesco|box|boutique|bot|boston|bostik|bosch|boots|booking|book|boo|bond|bom|bofa|boehringer|boats|bnpparibas|bnl|bmw|bms|blue|bloomberg|blog|blockbuster|blanco|blackfriday|black|biz|bio|bingo|bing|bike|bid|bible|bharti|bet|bestbuy|best|berlin|bentley|beer|beauty|beats|bcn|bcg|bbva|bbt|bbc|bayern|bauhaus|basketball|baseball|bargains|barefoot|barclays|barclaycard|barcelona|bar|bank|band|bananarepublic|banamex|baidu|baby|azure|axa|aws|avianca|autos|auto|author|auspost|audio|audible|audi|auction|attorney|athleta|associates|asia|asda|arte|art|arpa|army|archi|aramco|arab|aquarelle|apple|app|apartments|aol|anz|anquan|android|analytics|amsterdam|amica|amfam|amex|americanfamily|americanexpress|alstom|alsace|ally|allstate|allfinanz|alipay|alibaba|alfaromeo|akdn|airtel|airforce|airbus|aigo|aig|agency|agakhan|africa|afl|afamilycompany|aetna|aero|aeg|adult|ads|adac|actor|active|aco|accountants|accountant|accenture|academy|abudhabi|abogado|able|abc|abbvie|abbott|abb|abarth|aarp|aaa|onion)(?=[^0-9a-zA-Z@+-]|$))")),$r=/(?:xn--[\-0-9a-z]+)/,Qr=Lr(/(?:(?:#{validDomainChars}(?:[_-]|#{validDomainChars})*)?#{validDomainChars}\.)/,{validDomainChars:Kr}),Jr=Lr(/(?:#{validSubdomain}*#{validDomainName}(?:#{validGTLD}|#{validCCTLD}|#{validPunycode}))/,{validDomainName:Wr,validSubdomain:Qr,validGTLD:Xr,validCCTLD:Gr,validPunycode:$r}),ei=/[0-9]+/,ti=/\u0400-\u04FF/,ni=/\xC0-\xD6\xD8-\xF6\xF8-\xFF\u0100-\u024F\u0253\u0254\u0256\u0257\u0259\u025B\u0263\u0268\u026F\u0272\u0289\u028B\u02BB\u0300-\u036F\u1E00-\u1EFF/,ri=Lr(/[a-z#{cyrillicLettersAndMarks}0-9!\*';:=\+,\.\$\/%#\[\]\-\u2013_~@\|&#{latinAccentChars}]/i,{cyrillicLettersAndMarks:ti,latinAccentChars:ni}),ii=Lr("\\((?:#{validGeneralUrlPathChars}+|(?:#{validGeneralUrlPathChars}*\\(#{validGeneralUrlPathChars}+\\)#{validGeneralUrlPathChars}*))\\)",{validGeneralUrlPathChars:ri},"i"),ai=Lr(/[\+\-a-z#{cyrillicLettersAndMarks}0-9=_#\/#{latinAccentChars}]|(?:#{validUrlBalancedParens})/i,{cyrillicLettersAndMarks:ti,latinAccentChars:ni,validUrlBalancedParens:ii}),si=Lr("(?:(?:#{validGeneralUrlPathChars}*(?:#{validUrlBalancedParens}#{validGeneralUrlPathChars}*)*#{validUrlPathEndingChars})|(?:@#{validGeneralUrlPathChars}+/))",{validGeneralUrlPathChars:ri,validUrlBalancedParens:ii,validUrlPathEndingChars:ai},"i"),oi=Lr(/(?:[^A-Za-z0-9@@$###{invalidCharsGroup}]|[#{directionalMarkersGroup}]|^)/,{invalidCharsGroup:Yr,directionalMarkersGroup:Vr}),ui=/[a-z0-9!?\*'@\(\);:&=\+\$\/%#\[\]\-_\.,~|]/i,li=/[a-z0-9\-_&=#\/]/i,ci=Lr("((#{validUrlPrecedingChars})((https?:\\/\\/)?(#{validDomain})(?::(#{validPortNumber}))?(\\/#{validUrlPath}*)?(\\?#{validUrlQueryChars}*#{validUrlQueryEndingChars})?))",{validUrlPrecedingChars:oi,validDomain:Jr,validPortNumber:ei,validUrlPath:si,validUrlQueryChars:ui,validUrlQueryEndingChars:li},"gi"),di=/[-_.\/]$/;n(1876);var fi=n(1454),hi=n.n(fi);const pi=Lr(/(?:(?:[\-a-z0-9#{latinAccentChars}]+)\.)+(?:#{validGTLD}|#{validCCTLD}|#{validPunycode})/gi,{latinAccentChars:ni,validGTLD:Xr,validCCTLD:Gr,validPunycode:$r}),gi=function(e){if("xn--"!==e.substring(0,4)||e.match(pi)){for(var t=e.split("."),n=0;n<t.length;n++){var r=t[n],i=hi().toASCII(r);if(i.length<1||i.length>63)return}return t.join(".")}},mi=Lr(/^https?:\/\/t\.co\/([a-z0-9]+)(?:\?#{validUrlQueryChars}*#{validUrlQueryEndingChars})?/,{validUrlQueryChars:ui,validUrlQueryEndingChars:li},"i");var yi={extractUrlsWithoutProtocol:!0};const vi=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yi;if(!e||(t.extractUrlsWithoutProtocol?!e.match(/\./):!e.match(/:/)))return[];for(var n=[],r=function(){var e=RegExp.$2,r=RegExp.$3,i=RegExp.$4,a=RegExp.$5,s=RegExp.$7,o=ci.lastIndex,u=o-r.length;if(!function(e,t,n){var r=e.length,i=gi(n);return!(!i||!i.length)&&(r=r+i.length-n.length,t.length+r<=4096)}(r,i||"https://",a))return"continue";if(i){if(r.match(mi)){var l=RegExp.$1;if(l&&l.length>40)return"continue";r=RegExp.lastMatch,o=u+r.length}n.push({url:r,indices:[u,o]})}else{if(!t.extractUrlsWithoutProtocol||e.match(di))return"continue";var c=null,d=0;if(a.replace(pi,(function(e){var t=a.indexOf(e,d);d=t+e.length,c={url:e,indices:[u+t,u+d]},n.push(c)})),null==c)return"continue";s&&(c.url=r.replace(a,c.url),c.indices[1]=o)}};ci.exec(e);)r();return n};function _i(e){e.sort((function(e,t){return e.indices[0]-t.indices[0]}));for(var t=e[0],n=1;n<e.length;n++)t.indices[1]>e[n].indices[0]?(e.splice(n,1),n--):t=e[n]}n(75);const Ti=/\ud800[\udc00-\udc0b\udc0d-\udc26\udc28-\udc3a\udc3c\udc3d\udc3f-\udc4d\udc50-\udc5d\udc80-\udcfa\uddfd\ude80-\ude9c\udea0-\uded0\udee0\udf00-\udf1f\udf30-\udf40\udf42-\udf49\udf50-\udf7a\udf80-\udf9d\udfa0-\udfc3\udfc8-\udfcf]|\ud801[\udc00-\udc9d\udd00-\udd27\udd30-\udd63\ude00-\udf36\udf40-\udf55\udf60-\udf67]|\ud802[\udc00-\udc05\udc08\udc0a-\udc35\udc37\udc38\udc3c\udc3f-\udc55\udc60-\udc76\udc80-\udc9e\udd00-\udd15\udd20-\udd39\udd80-\uddb7\uddbe\uddbf\ude00-\ude03\ude05\ude06\ude0c-\ude13\ude15-\ude17\ude19-\ude33\ude38-\ude3a\ude3f\ude60-\ude7c\ude80-\ude9c\udec0-\udec7\udec9-\udee6\udf00-\udf35\udf40-\udf55\udf60-\udf72\udf80-\udf91]|\ud803[\udc00-\udc48]|\ud804[\udc00-\udc46\udc7f-\udcba\udcd0-\udce8\udd00-\udd34\udd50-\udd73\udd76\udd80-\uddc4\uddda\ude00-\ude11\ude13-\ude37\udeb0-\udeea\udf01-\udf03\udf05-\udf0c\udf0f\udf10\udf13-\udf28\udf2a-\udf30\udf32\udf33\udf35-\udf39\udf3c-\udf44\udf47\udf48\udf4b-\udf4d\udf57\udf5d-\udf63\udf66-\udf6c\udf70-\udf74]|\ud805[\udc80-\udcc5\udcc7\udd80-\uddb5\uddb8-\uddc0\ude00-\ude40\ude44\ude80-\udeb7]|\ud806[\udca0-\udcdf\udcff\udec0-\udef8]|\ud808[\udc00-\udf98]|\ud80c[\udc00-\udfff]|\ud80d[\udc00-\udc2e]|\ud81a[\udc00-\ude38\ude40-\ude5e\uded0-\udeed\udef0-\udef4\udf00-\udf36\udf40-\udf43\udf63-\udf77\udf7d-\udf8f]|\ud81b[\udf00-\udf44\udf50-\udf7e\udf8f-\udf9f]|\ud82c[\udc00\udc01]|\ud82f[\udc00-\udc6a\udc70-\udc7c\udc80-\udc88\udc90-\udc99\udc9d\udc9e]|\ud834[\udd65-\udd69\udd6d-\udd72\udd7b-\udd82\udd85-\udd8b\uddaa-\uddad\ude42-\ude44]|\ud835[\udc00-\udc54\udc56-\udc9c\udc9e\udc9f\udca2\udca5\udca6\udca9-\udcac\udcae-\udcb9\udcbb\udcbd-\udcc3\udcc5-\udd05\udd07-\udd0a\udd0d-\udd14\udd16-\udd1c\udd1e-\udd39\udd3b-\udd3e\udd40-\udd44\udd46\udd4a-\udd50\udd52-\udea5\udea8-\udec0\udec2-\udeda\udedc-\udefa\udefc-\udf14\udf16-\udf34\udf36-\udf4e\udf50-\udf6e\udf70-\udf88\udf8a-\udfa8\udfaa-\udfc2\udfc4-\udfcb]|\ud83a[\udc00-\udcc4\udcd0-\udcd6]|\ud83b[\ude00-\ude03\ude05-\ude1f\ude21\ude22\ude24\ude27\ude29-\ude32\ude34-\ude37\ude39\ude3b\ude42\ude47\ude49\ude4b\ude4d-\ude4f\ude51\ude52\ude54\ude57\ude59\ude5b\ude5d\ude5f\ude61\ude62\ude64\ude67-\ude6a\ude6c-\ude72\ude74-\ude77\ude79-\ude7c\ude7e\ude80-\ude89\ude8b-\ude9b\udea1-\udea3\udea5-\udea9\udeab-\udebb]|\ud840[\udc00-\udfff]|\ud841[\udc00-\udfff]|\ud842[\udc00-\udfff]|\ud843[\udc00-\udfff]|\ud844[\udc00-\udfff]|\ud845[\udc00-\udfff]|\ud846[\udc00-\udfff]|\ud847[\udc00-\udfff]|\ud848[\udc00-\udfff]|\ud849[\udc00-\udfff]|\ud84a[\udc00-\udfff]|\ud84b[\udc00-\udfff]|\ud84c[\udc00-\udfff]|\ud84d[\udc00-\udfff]|\ud84e[\udc00-\udfff]|\ud84f[\udc00-\udfff]|\ud850[\udc00-\udfff]|\ud851[\udc00-\udfff]|\ud852[\udc00-\udfff]|\ud853[\udc00-\udfff]|\ud854[\udc00-\udfff]|\ud855[\udc00-\udfff]|\ud856[\udc00-\udfff]|\ud857[\udc00-\udfff]|\ud858[\udc00-\udfff]|\ud859[\udc00-\udfff]|\ud85a[\udc00-\udfff]|\ud85b[\udc00-\udfff]|\ud85c[\udc00-\udfff]|\ud85d[\udc00-\udfff]|\ud85e[\udc00-\udfff]|\ud85f[\udc00-\udfff]|\ud860[\udc00-\udfff]|\ud861[\udc00-\udfff]|\ud862[\udc00-\udfff]|\ud863[\udc00-\udfff]|\ud864[\udc00-\udfff]|\ud865[\udc00-\udfff]|\ud866[\udc00-\udfff]|\ud867[\udc00-\udfff]|\ud868[\udc00-\udfff]|\ud869[\udc00-\uded6\udf00-\udfff]|\ud86a[\udc00-\udfff]|\ud86b[\udc00-\udfff]|\ud86c[\udc00-\udfff]|\ud86d[\udc00-\udf34\udf40-\udfff]|\ud86e[\udc00-\udc1d]|\ud87e[\udc00-\ude1d]|\udb40[\udd00-\uddef]/,bi=/A-Za-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0300-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u0483-\u052f\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u05d0-\u05ea\u05f0-\u05f2\u0610-\u061a\u0620-\u065f\u066e-\u06d3\u06d5-\u06dc\u06df-\u06e8\u06ea-\u06ef\u06fa-\u06fc\u06ff\u0710-\u074a\u074d-\u07b1\u07ca-\u07f5\u07fa\u0800-\u082d\u0840-\u085b\u08a0-\u08b2\u08e4-\u0963\u0971-\u0983\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bc-\u09c4\u09c7\u09c8\u09cb-\u09ce\u09d7\u09dc\u09dd\u09df-\u09e3\u09f0\u09f1\u0a01-\u0a03\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a59-\u0a5c\u0a5e\u0a70-\u0a75\u0a81-\u0a83\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abc-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ad0\u0ae0-\u0ae3\u0b01-\u0b03\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3c-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5c\u0b5d\u0b5f-\u0b63\u0b71\u0b82\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd0\u0bd7\u0c00-\u0c03\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c58\u0c59\u0c60-\u0c63\u0c81-\u0c83\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbc-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0cde\u0ce0-\u0ce3\u0cf1\u0cf2\u0d01-\u0d03\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d-\u0d44\u0d46-\u0d48\u0d4a-\u0d4e\u0d57\u0d60-\u0d63\u0d7a-\u0d7f\u0d82\u0d83\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e01-\u0e3a\u0e40-\u0e4e\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb9\u0ebb-\u0ebd\u0ec0-\u0ec4\u0ec6\u0ec8-\u0ecd\u0edc-\u0edf\u0f00\u0f18\u0f19\u0f35\u0f37\u0f39\u0f3e-\u0f47\u0f49-\u0f6c\u0f71-\u0f84\u0f86-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u103f\u1050-\u108f\u109a-\u109d\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u135d-\u135f\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16f1-\u16f8\u1700-\u170c\u170e-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176c\u176e-\u1770\u1772\u1773\u1780-\u17d3\u17d7\u17dc\u17dd\u180b-\u180d\u1820-\u1877\u1880-\u18aa\u18b0-\u18f5\u1900-\u191e\u1920-\u192b\u1930-\u193b\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a1b\u1a20-\u1a5e\u1a60-\u1a7c\u1a7f\u1aa7\u1ab0-\u1abe\u1b00-\u1b4b\u1b6b-\u1b73\u1b80-\u1baf\u1bba-\u1bf3\u1c00-\u1c37\u1c4d-\u1c4f\u1c5a-\u1c7d\u1cd0-\u1cd2\u1cd4-\u1cf6\u1cf8\u1cf9\u1d00-\u1df5\u1dfc-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u20d0-\u20f0\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2183\u2184\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d7f-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2de0-\u2dff\u2e2f\u3005\u3006\u302a-\u302f\u3031-\u3035\u303b\u303c\u3041-\u3096\u3099\u309a\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua672\ua674-\ua67d\ua67f-\ua69d\ua69f-\ua6e5\ua6f0\ua6f1\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua7ad\ua7b0\ua7b1\ua7f7-\ua827\ua840-\ua873\ua880-\ua8c4\ua8e0-\ua8f7\ua8fb\ua90a-\ua92d\ua930-\ua953\ua960-\ua97c\ua980-\ua9c0\ua9cf\ua9e0-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa36\uaa40-\uaa4d\uaa60-\uaa76\uaa7a-\uaac2\uaadb-\uaadd\uaae0-\uaaef\uaaf2-\uaaf6\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab5f\uab64\uab65\uabc0-\uabea\uabec\uabed\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf870-\uf87f\uf882\uf884-\uf89f\uf8b8\uf8c1-\uf8d6\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe00-\ufe0f\ufe20-\ufe2d\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc/,Ei=/[\uD800-\uDBFF][\uDC00-\uDFFF]/gm,Si=Lr(/(?:[#{bmpLetterAndMarks}]|(?=#{nonBmpCodePairs})(?:#{astralLetterAndMarks}))/,{bmpLetterAndMarks:bi,nonBmpCodePairs:Ei,astralLetterAndMarks:Ti}),wi=/\ud801[\udca0-\udca9]|\ud804[\udc66-\udc6f\udcf0-\udcf9\udd36-\udd3f\uddd0-\uddd9\udef0-\udef9]|\ud805[\udcd0-\udcd9\ude50-\ude59\udec0-\udec9]|\ud806[\udce0-\udce9]|\ud81a[\ude60-\ude69\udf50-\udf59]|\ud835[\udfce-\udfff]/,Ai=/0-9\u0660-\u0669\u06f0-\u06f9\u07c0-\u07c9\u0966-\u096f\u09e6-\u09ef\u0a66-\u0a6f\u0ae6-\u0aef\u0b66-\u0b6f\u0be6-\u0bef\u0c66-\u0c6f\u0ce6-\u0cef\u0d66-\u0d6f\u0de6-\u0def\u0e50-\u0e59\u0ed0-\u0ed9\u0f20-\u0f29\u1040-\u1049\u1090-\u1099\u17e0-\u17e9\u1810-\u1819\u1946-\u194f\u19d0-\u19d9\u1a80-\u1a89\u1a90-\u1a99\u1b50-\u1b59\u1bb0-\u1bb9\u1c40-\u1c49\u1c50-\u1c59\ua620-\ua629\ua8d0-\ua8d9\ua900-\ua909\ua9d0-\ua9d9\ua9f0-\ua9f9\uaa50-\uaa59\uabf0-\uabf9\uff10-\uff19/,Ii=/_\u200c\u200d\ua67e\u05be\u05f3\u05f4\uff5e\u301c\u309b\u309c\u30a0\u30fb\u3003\u0f0b\u0f0c\xb7/,Ci=Lr(/(?:[#{bmpLetterAndMarks}#{bmpNumerals}#{hashtagSpecialChars}]|(?=#{nonBmpCodePairs})(?:#{astralLetterAndMarks}|#{astralNumerals}))/,{bmpLetterAndMarks:bi,bmpNumerals:Ai,hashtagSpecialChars:Ii,nonBmpCodePairs:Ei,astralLetterAndMarks:Ti,astralNumerals:wi}),Ri=/(?:[^\uD800-\uDFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF])/,Di=Lr(/(?:^|\uFE0E|\uFE0F|$|(?!#{hashtagAlphaNumeric}|&)#{codePoint})/,{codePoint:Ri,hashtagAlphaNumeric:Ci}),xi=Lr(/(#{hashtagBoundary})(#{hashSigns})(?!\uFE0F|\u20E3)(#{hashtagAlphaNumeric}*#{hashtagAlpha}#{hashtagAlphaNumeric}*)/gi,{hashtagBoundary:Di,hashSigns:qr,hashtagAlphaNumeric:Ci,hashtagAlpha:Si}),Ni=function(e,t){if(t||(t={checkUrlOverlap:!0}),!e||!e.match(qr))return[];var n=[];if(e.replace(xi,(function(e,t,r,i,a,s){if(!s.slice(a+e.length).match(Hr)){var o=a+t.length,u=o+i.length+1;n.push({hashtag:i,indices:[o,u]})}})),t.checkUrlOverlap){var r=vi(e);if(r.length>0){var i=n.concat(r);_i(i),n=[];for(var a=0;a<i.length;a++)i[a].hashtag&&n.push(i[a])}}return n},Oi=/[@@]/,Pi=Lr(/^(?:#{atSigns}|[#{latinAccentChars}]|:\/\/)/,{atSigns:Oi,latinAccentChars:ni}),Mi=/(?:^|[^a-zA-Z0-9_!#$%&*@@]|(?:^|[^a-zA-Z0-9_+~.-])(?:rt|RT|rT|Rt):?)/,ki=Lr("(#{validMentionPrecedingChars})(#{atSigns})([a-zA-Z0-9_]{1,20})(/[a-zA-Z][a-zA-Z0-9_-]{0,24})?",{validMentionPrecedingChars:Mi,atSigns:Oi},"g");function Li(e){if(!e||!e.match(Oi))return[];var t=[];return e.replace(ki,(function(e,n,r,i,a,s,o){if(!o.slice(s+e.length).match(Pi)){a=a||"";var u=s+n.length,l=u+i.length+a.length+1;t.push({screenName:i,listSlug:a,indices:[u,l]})}})),t}function Fi(e,t){var n=vi(e,t).concat(Li(e)).concat(Ni(e,{checkUrlOverlap:!1})).concat(jr(e));return 0==n.length?[]:(_i(n),n)}function Ui(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}var Bi={disabled:!0,readonly:!0,multiple:!0,checked:!0},ji={urlClass:!0,listClass:!0,usernameClass:!0,hashtagClass:!0,cashtagClass:!0,usernameUrlBase:!0,listUrlBase:!0,hashtagUrlBase:!0,cashtagUrlBase:!0,usernameUrlBlock:!0,listUrlBlock:!0,hashtagUrlBlock:!0,linkUrlBlock:!0,usernameIncludeSymbol:!0,suppressLists:!0,suppressNoFollow:!0,targetBlank:!0,suppressDataScreenName:!0,urlEntities:!0,symbolTag:!0,textWithSymbolTag:!0,urlTarget:!0,invisibleTagAttrs:!0,linkAttributeBlock:!0,linkTextBlock:!0,htmlEscapeNonEntities:!0};function qi(e){var t={};for(var n in e){var r=e[n];ji[n]||(Bi[n]&&(r=r?n:null),null!=r&&(t[n]=r))}return t}var Hi={"&":"&",">":">","<":"<",'"':""","'":"'"};function Gi(e){return e&&e.replace(/[&"'><]/g,(function(e){return Hi[e]}))}n(6108),n(6331),n(6253);var Vi={disabled:!0,readonly:!0,multiple:!0,checked:!0};function Yi(e){var t="";for(var n in e){var r=e[n];Vi[n]&&(r=r?n:null),null!=r&&(t+=" ".concat(Gi(n),'="').concat(Gi(r.toString()),'"'))}return t}function zi(e,t,n,r){return r.suppressNoFollow||(n.rel="nofollow"),r.linkAttributeBlock&&r.linkAttributeBlock(e,n),r.linkTextBlock&&(t=r.linkTextBlock(e,t)),zr("<a#{attr}>#{text}</a>",{text:t,attr:Yi(n)})}function Zi(e,t,n,r,i){var a=i.symbolTag?"<".concat(i.symbolTag,">").concat(t,"</").concat(i.symbolTag,">"):t;n=Gi(n);var s=i.textWithSymbolTag?"<".concat(i.textWithSymbolTag,">").concat(n,"</").concat(i.textWithSymbolTag,">"):n;return i.usernameIncludeSymbol||!t.match(Oi)?zi(e,a+s,r,i):a+zi(e,s,r,i)}function Ki(e,t,n){var r=Gi(e.cashtag),i=Ui(n.htmlAttrs||{});return i.href=n.cashtagUrlBase+r,i.title="$".concat(r),i.class=n.cashtagClass,n.targetBlank&&(i.target="_blank"),Zi(e,"$",r,i,n)}const Wi=/[\u0600-\u06FF]|[\u0750-\u077F]|[\u0590-\u05FF]|[\uFE70-\uFEFF]/gm;function Xi(e,t,n){var r=t.substring(e.indices[0],e.indices[0]+1),i=Gi(e.hashtag),a=Ui(n.htmlAttrs||{});return a.href=n.hashtagUrlBase+i,a.title="#".concat(i),a.class=n.hashtagClass,i.charAt(0).match(Wi)&&(a.class+=" rtl"),n.targetBlank&&(a.target="_blank"),Zi(e,r,i,a,n)}function $i(e,t){var n=e.display_url,r=e.expanded_url,i=n.replace(/…/g,"");if(-1!=r.indexOf(i)){var a=r.indexOf(i),s={displayUrlSansEllipses:i,beforeDisplayUrl:r.substr(0,a),afterDisplayUrl:r.substr(a+i.length),precedingEllipsis:n.match(/^…/)?"…":"",followingEllipsis:n.match(/…$/)?"…":""};for(var o in s)s.hasOwnProperty(o)&&(s[o]=Gi(s[o]));return s.invisible=t.invisibleTagAttrs,zr("<span class='tco-ellipsis'>#{precedingEllipsis}<span #{invisible}> </span></span><span #{invisible}>#{beforeDisplayUrl}</span><span class='js-display-url'>#{displayUrlSansEllipses}</span><span #{invisible}>#{afterDisplayUrl}</span><span class='tco-ellipsis'><span #{invisible}> </span>#{followingEllipsis}</span>",s)}return n}const Qi=/^https?:\/\//i;function Ji(e,t,n){var r=e.url,i=Gi(r),a=n.urlEntities&&n.urlEntities[r]||e;a.display_url&&(i=$i(a,n));var s=Ui(n.htmlAttrs||{});return r.match(Qi)||(r="http://".concat(r)),s.href=r,n.targetBlank&&(s.target="_blank"),n.urlClass&&(s.class=n.urlClass),n.urlTarget&&(s.target=n.urlTarget),!n.title&&a.display_url&&(s.title=a.expanded_url),zi(e,i,s,n)}function ea(e,t,n){var r=t.substring(e.indices[0],e.indices[0]+1),i=Gi(e.screenName),a=Gi(e.listSlug),s=e.listSlug&&!n.suppressLists,o=Ui(n.htmlAttrs||{});return o.class=s?n.listClass:n.usernameClass,o.href=s?n.listUrlBase+i+a:n.usernameUrlBase+i,s||n.suppressDataScreenName||(o["data-screen-name"]=i),n.targetBlank&&(o.target="_blank"),Zi(e,r,s?i+a:i,o,n)}function ta(e,t,n){var r,i;if((n=Ui(n||{})).hashtagClass=n.hashtagClass||"tweet-url hashtag",n.hashtagUrlBase=n.hashtagUrlBase||"https://twitter.com/search?q=%23",n.cashtagClass=n.cashtagClass||"tweet-url cashtag",n.cashtagUrlBase=n.cashtagUrlBase||"https://twitter.com/search?q=%24",n.listClass=n.listClass||"tweet-url list-slug",n.usernameClass=n.usernameClass||"tweet-url username",n.usernameUrlBase=n.usernameUrlBase||"https://twitter.com/",n.listUrlBase=n.listUrlBase||"https://twitter.com/",n.htmlAttrs=qi(n),n.invisibleTagAttrs=n.invisibleTagAttrs||"style='position:absolute;left:-9999px;'",n.urlEntities){for(r={},u=0,i=n.urlEntities.length;u<i;u++)r[n.urlEntities[u].url]=n.urlEntities[u];n.urlEntities=r}var a="",s=0;t.sort((function(e,t){return e.indices[0]-t.indices[0]}));for(var o=n.htmlEscapeNonEntities?Gi:function(e){return e},u=0;u<t.length;u++){var l=t[u];a+=o(e.substring(s,l.indices[0])),l.url?a+=Ji(l,0,n):l.hashtag?a+=Xi(l,e,n):l.screenName?a+=ea(l,e,n):l.cashtag&&(a+=Ki(l,0,n)),s=l.indices[1]}return a+o(e.substring(s,e.length))}const na=function(e,t,n){if(0!==t.length){var r=0,i=0;t.sort((function(e,t){return e.indices[0]-t.indices[0]}));for(var a=0,s=t[0];r<e.length;){if(s.indices[0]===(n?r:i)){var o=s.indices[1]-s.indices[0];if(s.indices[0]=n?i:r,s.indices[1]=s.indices[0]+o,++a===t.length)break;s=t[a]}var u=e.charCodeAt(r);u>=55296&&u<=56319&&r<e.length-1&&(u=e.charCodeAt(r+1))>=56320&&u<=57343&&r++,i++,r++}}};function ra(e,t){na(e,t,!1)}const ia={version1:{version:1,maxWeightedTweetLength:140,scale:1,defaultWeight:1,transformedURLLength:23,ranges:[]},version2:{version:2,maxWeightedTweetLength:280,scale:100,defaultWeight:200,transformedURLLength:23,ranges:[{start:0,end:4351,weight:100},{start:8192,end:8205,weight:100},{start:8208,end:8223,weight:100},{start:8242,end:8247,weight:100}]},version3:{version:3,maxWeightedTweetLength:280,scale:100,defaultWeight:200,emojiParsingEnabled:!0,transformedURLLength:23,ranges:[{start:0,end:4351,weight:100},{start:8192,end:8205,weight:100},{start:8208,end:8223,weight:100},{start:8242,end:8247,weight:100}]},defaults:{version:3,maxWeightedTweetLength:280,scale:100,defaultWeight:200,emojiParsingEnabled:!0,transformedURLLength:23,ranges:[{start:0,end:4351,weight:100},{start:8192,end:8205,weight:100},{start:8208,end:8223,weight:100},{start:8242,end:8247,weight:100}]}};function aa(e){for(var t=[],n=Ni(e),r=0;r<n.length;r++)t.push(n[r].hashtag);return t}function sa(e){for(var t,n=[],r=Li(e),i=0;i<r.length;i++)""===(t=r[i]).listSlug&&n.push({screenName:t.screenName,indices:t.indices});return n}function oa(e){for(var t=[],n=sa(e),r=0;r<n.length;r++){var i=n[r].screenName;t.push(i)}return t}const ua=Lr(/^(?:#{spaces})*#{atSigns}([a-zA-Z0-9_]{1,20})/,{atSigns:Oi,spaces:Ur});n(774);const la=function(e,t){var n=t.defaultWeight,r=t.ranges,i=n,a=e.charCodeAt(0);if(Array.isArray(r))for(var s=0,o=r.length;s<o;s++){var u=r[s];if(a>=u.start&&a<=u.end){i=u.weight;break}}return i};n(3057),n(1181),n(6997),n(7476);const ca=Lr(/[#{invalidCharsGroup}]/,{invalidCharsGroup:Yr});function da(e){return ca.test(e)}var fa=n(4875),ha=function(e){return e.reduce((function(e,t){return e[t.indices[0]]=t,e}),{})},pa=function(e,t){if(t<e.length-1){var n=e.charCodeAt(t),r=e.charCodeAt(t+1);return 55296<=n&&n<=56319&&56320<=r&&r<=57343}return!1};const ga=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ia.defaults,n=Object.keys(t).length?t:ia.defaults,r=n.defaultWeight,i=n.emojiParsingEnabled,a=n.scale,s=n.maxWeightedTweetLength,o=n.transformedURLLength,u="function"==typeof String.prototype.normalize?e.normalize():e,l=ha(vi(u)),c=i?ha((0,fa.Qc)(u)):[],d=u.length,f=0,h=0,p=!0,g=0;g<d;g++){if(l[g]){var m=l[g],y=m.url;m.indices,f+=o*a,g+=y.length-1}else if(i&&c[g]){var v=c[g],_=v.text;v.indices,f+=r,g+=_.length-1}else g+=pa(u,g)?1:0,f+=la(u.charAt(g),n);p&&(p=!da(u.substring(g,g+1))),p&&f<=s*a&&(h=g)}return{weightedLength:f/=a,valid:p=p&&f>0&&f<=s,permillage:Math.floor(f/s*1e3),validRangeStart:0,validRangeEnd:h+=e.length-u.length,displayRangeStart:0,displayRangeEnd:e.length>0?e.length-1:0}},ma=function(e){return ga(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:ia.defaults).weightedLength};function ya(e){return e.replace(Ei," ").length}function va(e){for(var t,n,r=e.split("<"),i=[],a=0;a<r.length;a+=1)if(n=r[a]){t=n.split(">");for(var s=0;s<t.length;s+=1)i.push(t[s])}else i.push("");return i}function _a(e){return _a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_a(e)}function Ta(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==_a(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==_a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===_a(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ba(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ea(e){if(!e)return"empty";var t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ba(n,!0).forEach((function(t){Ta(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ba(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},ia.defaults,{},arguments.length>1&&void 0!==arguments[1]?arguments[1]:ia.defaults),n=t.maxWeightedTweetLength;return ma(e,t)>n?"too_long":!!da(e)&&"invalid_characters"}n(8388),n(7470),n(8351),n(4336),n(8837),n(5767);var Sa=Lr(/^#{validMentionOrList}$/,{validMentionOrList:ki});const wa=/[a-z\u0400-\u04FF0-9\-._~]/i,Aa=/(?:%[0-9a-f]{2})/i,Ia=/[!$&'()*+,;=]/i,Ca=Lr("(?:#{validateUrlUnreserved}|#{validateUrlPctEncoded}|#{validateUrlSubDelims}|:)*",{validateUrlUnreserved:wa,validateUrlPctEncoded:Aa,validateUrlSubDelims:Ia},"i"),Ra=/(?:[a-z0-9](?:[a-z0-9\-]*[a-z0-9])?)/i,Da=/(?:[a-z](?:[a-z0-9\-]*[a-z0-9])?)/i,xa=/(?:[a-z0-9](?:[a-z0-9_\-]*[a-z0-9])?)/i,Na=Lr(/(?:(?:#{validateUrlSubDomainSegment}\.)*(?:#{validateUrlDomainSegment}\.)#{validateUrlDomainTld})/i,{validateUrlSubDomainSegment:xa,validateUrlDomainSegment:Ra,validateUrlDomainTld:Da}),Oa=/(?:[0-9]|(?:[1-9][0-9])|(?:1[0-9]{2})|(?:2[0-4][0-9])|(?:25[0-5]))/i,Pa=Lr(/(?:#{validateUrlDecOctet}(?:\.#{validateUrlDecOctet}){3})/i,{validateUrlDecOctet:Oa}),Ma=/(?:\[[a-f0-9:\.]+\])/i,ka=Lr("(?:#{validateUrlIpv4}|#{validateUrlIpv6})",{validateUrlIpv4:Pa,validateUrlIpv6:Ma},"i"),La=Lr("(?:#{validateUrlIp}|#{validateUrlDomain})",{validateUrlIp:ka,validateUrlDomain:Na},"i"),Fa=/[0-9]{1,5}/,Ua=Lr("(?:(#{validateUrlUserinfo})@)?(#{validateUrlHost})(?::(#{validateUrlPort}))?",{validateUrlUserinfo:Ca,validateUrlHost:La,validateUrlPort:Fa},"i"),Ba=Lr("(?:#{validateUrlUnreserved}|#{validateUrlPctEncoded}|#{validateUrlSubDelims}|[:|@])",{validateUrlUnreserved:wa,validateUrlPctEncoded:Aa,validateUrlSubDelims:Ia},"i"),ja=Lr(/(#{validateUrlPchar}|\/|\?)*/i,{validateUrlPchar:Ba}),qa=Lr(/(\/#{validateUrlPchar}*)*/i,{validateUrlPchar:Ba}),Ha=Lr(/(#{validateUrlPchar}|\/|\?)*/i,{validateUrlPchar:Ba}),Ga=/(?:[a-z][a-z0-9+\-.]*)/i,Va=Lr("^(?:([^:/?#]+):\\/\\/)?([^/?#]*)([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$","i"),Ya=/(?:(?:[a-z0-9]|[^\u0000-\u007f])(?:(?:[a-z0-9_\-]|[^\u0000-\u007f])*(?:[a-z0-9]|[^\u0000-\u007f]))?)/i,za=/(?:(?:[a-z0-9]|[^\u0000-\u007f])(?:(?:[a-z0-9\-]|[^\u0000-\u007f])*(?:[a-z0-9]|[^\u0000-\u007f]))?)/i,Za=/(?:(?:[a-z]|[^\u0000-\u007f])(?:(?:[a-z0-9\-]|[^\u0000-\u007f])*(?:[a-z0-9]|[^\u0000-\u007f]))?)/i,Ka=Lr(/(?:(?:#{validateUrlUnicodeSubDomainSegment}\.)*(?:#{validateUrlUnicodeDomainSegment}\.)#{validateUrlUnicodeDomainTld})/i,{validateUrlUnicodeSubDomainSegment:Ya,validateUrlUnicodeDomainSegment:za,validateUrlUnicodeDomainTld:Za}),Wa=Lr("(?:#{validateUrlIp}|#{validateUrlUnicodeDomain})",{validateUrlIp:ka,validateUrlUnicodeDomain:Ka},"i"),Xa=Lr("(?:(#{validateUrlUserinfo})@)?(#{validateUrlUnicodeHost})(?::(#{validateUrlPort}))?",{validateUrlUserinfo:Ca,validateUrlUnicodeHost:Wa,validateUrlPort:Fa},"i");function $a(e,t,n){return n?!e||e.match(t)&&RegExp["$&"]===e:"string"==typeof e&&e.match(t)&&RegExp["$&"]===e}const Qa={astralLetterAndMarks:Ti,astralNumerals:wi,atSigns:Oi,bmpLetterAndMarks:bi,bmpNumerals:Ai,cashtag:Mr,codePoint:Ri,cyrillicLettersAndMarks:ti,endHashtagMatch:Hr,endMentionMatch:Pi,extractUrl:ci,hashSigns:qr,hashtagAlpha:Si,hashtagAlphaNumeric:Ci,hashtagBoundary:Di,hashtagSpecialChars:Ii,invalidChars:ca,invalidCharsGroup:Yr,invalidDomainChars:Zr,invalidUrlWithoutProtocolPrecedingChars:di,latinAccentChars:ni,nonBmpCodePairs:Ei,punct:kr,rtlChars:Wi,spaces:Ur,spacesGroup:Fr,urlHasHttps:/^https:\/\//i,urlHasProtocol:Qi,validAsciiDomain:pi,validateUrlAuthority:Ua,validateUrlDecOctet:Oa,validateUrlDomain:Na,validateUrlDomainSegment:Ra,validateUrlDomainTld:Da,validateUrlFragment:ja,validateUrlHost:La,validateUrlIp:ka,validateUrlIpv4:Pa,validateUrlIpv6:Ma,validateUrlPath:qa,validateUrlPchar:Ba,validateUrlPctEncoded:Aa,validateUrlPort:Fa,validateUrlQuery:Ha,validateUrlScheme:Ga,validateUrlSubDelims:Ia,validateUrlSubDomainSegment:xa,validateUrlUnencoded:Va,validateUrlUnicodeAuthority:Xa,validateUrlUnicodeDomain:Ka,validateUrlUnicodeDomainSegment:za,validateUrlUnicodeDomainTld:Za,validateUrlUnicodeHost:Wa,validateUrlUnicodeSubDomainSegment:Ya,validateUrlUnreserved:wa,validateUrlUserinfo:Ca,validCashtag:Br,validCCTLD:Gr,validDomain:Jr,validDomainChars:Kr,validDomainName:Wr,validGeneralUrlPathChars:ri,validGTLD:Xr,validHashtag:xi,validMentionOrList:ki,validMentionPrecedingChars:Mi,validPortNumber:ei,validPunycode:$r,validReply:ua,validSubdomain:Qr,validTcoUrl:mi,validUrlBalancedParens:ii,validUrlPath:si,validUrlPathEndingChars:ai,validUrlPrecedingChars:oi,validUrlQueryChars:ui,validUrlQueryEndingChars:li};n(9115),n(522);const Ja={autoLink:function(e,t){return ta(e,Fi(e,{extractUrlsWithoutProtocol:!1}),t)},autoLinkCashtags:function(e,t){return ta(e,jr(e),t)},autoLinkEntities:ta,autoLinkHashtags:function(e,t){return ta(e,Ni(e),t)},autoLinkUrlsCustom:function(e,t){return ta(e,vi(e,{extractUrlsWithoutProtocol:!1}),t)},autoLinkUsernamesOrLists:function(e,t){return ta(e,Li(e),t)},autoLinkWithJSON:function(e,t,n){if(t.user_mentions)for(var r=0;r<t.user_mentions.length;r++)t.user_mentions[r].screenName=t.user_mentions[r].screen_name;if(t.hashtags)for(r=0;r<t.hashtags.length;r++)t.hashtags[r].hashtag=t.hashtags[r].text;if(t.symbols)for(r=0;r<t.symbols.length;r++)t.symbols[r].cashtag=t.symbols[r].text;var i=[];for(var a in t)i=i.concat(t[a]);return ra(e,i),ta(e,i,n)},configs:ia,convertUnicodeIndices:function(e,t,n){if(0!=t.length){var r=0,i=0;t.sort((function(e,t){return e.indices[0]-t.indices[0]}));for(var a=0,s=t[0];r<e.length;){if(s.indices[0]==(n?r:i)){var o=s.indices[1]-s.indices[0];if(s.indices[0]=n?i:r,s.indices[1]=s.indices[0]+o,++a==t.length)break;s=t[a]}var u=e.charCodeAt(r);u>=55296&&u<=56319&&r<e.length-1&&(u=e.charCodeAt(r+1))>=56320&&u<=57343&&r++,i++,r++}}},extractCashtags:function(e){for(var t=[],n=jr(e),r=0;r<n.length;r++)t.push(n[r].cashtag);return t},extractCashtagsWithIndices:jr,extractEntitiesWithIndices:Fi,extractHashtags:aa,extractHashtagsWithIndices:Ni,extractHtmlAttrsFromOptions:qi,extractMentions:oa,extractMentionsOrListsWithIndices:Li,extractMentionsWithIndices:sa,extractReplies:function(e){if(!e)return null;var t=e.match(ua);return!t||RegExp.rightContext.match(Pi)?null:t[1]},extractUrls:function(e,t){for(var n=[],r=vi(e,t),i=0;i<r.length;i++)n.push(r[i].url);return n},extractUrlsWithIndices:vi,getTweetLength:ma,getUnicodeTextLength:ya,hasInvalidCharacters:da,hitHighlight:function(e,t,n){if(n=n||{},0===(t=t||[]).length)return e;var r,i,a,s,o,u,l,c=n.tag||"em",d=["<".concat(c,">"),"</".concat(c,">")],f=va(e),h="",p=0,g=f[0],m=0,y=0,v=!1,_=g,T=[];for(r=0;r<t.length;r+=1)for(i=0;i<t[r].length;i+=1)T.push(t[r][i]);for(a=0;a<T.length;a+=1){for(s=T[a],o=d[a%2],u=!1;null!=g&&s>=m+g.length;)h+=_.slice(y),v&&s===m+_.length&&(h+=o,u=!0),f[p+1]&&(h+="<".concat(f[p+1],">")),m+=_.length,y=0,_=g=f[p+=2],v=!1;u||null==g?u||(u=!0,h+=o):(l=s-m,h+=_.slice(y,l)+o,y=l,v=a%2==0)}if(null!=g)for(y<_.length&&(h+=_.slice(y)),a=p+1;a<f.length;a+=1)h+=a%2==0?f[a]:"<".concat(f[a],">");return h},htmlEscape:Gi,isInvalidTweet:Ea,isValidHashtag:function(e){if(!e)return!1;var t=aa(e);return 1===t.length&&t[0]===e.slice(1)},isValidList:function(e){var t=e.match(Sa);return!(!t||""!=t[1]||!t[4])},isValidTweetText:function(e,t){return!Ea(e,t)},isValidUrl:function(e,t,n){if(null==t&&(t=!0),null==n&&(n=!0),!e)return!1;var r=e.match(Va);if(!r||r[0]!==e)return!1;var i=r[1],a=r[2],s=r[3],o=r[4],u=r[5];return!!((!n||$a(i,Ga)&&i.match(/^https?$/i))&&$a(s,qa)&&$a(o,Ha,!0)&&$a(u,ja,!0))&&(t&&$a(a,Xa)||!t&&$a(a,Ua))},isValidUsername:function(e){if(!e)return!1;var t=oa(e);return 1===t.length&&t[0]===e.slice(1)},linkTextWithEntity:$i,linkToCashtag:Ki,linkToHashtag:Xi,linkToMentionAndList:ea,linkToText:zi,linkToTextWithSymbol:Zi,linkToUrl:Ji,modifyIndicesFromUTF16ToUnicode:function(e,t){na(e,t,!0)},modifyIndicesFromUnicodeToUTF16:ra,regexen:Qa,removeOverlappingEntities:_i,parseTweet:ga,splitTags:va,standardizeIndices:function(e,t,n){var r=ya(e);if(e.length-r>0){var i=Array.from(e),a=0===t?"":i.slice(0,t).join(""),s=i.slice(t,n).join("");return[a.length,a.length+s.length]}return[t,n]},tagAttrs:Yi};var es=n(9755),ts=es;n(6891),n(3430),n(7440),n(9459),n(3033),n(5176),n(825),n.g.$=es,n.g.jQuery=ts,n.g.twitter=Ja,n.g.rolloverTweet=br,n.g.selectTweet=mr,n.g.filtrerTexte=Rr,n.g.tweetPopup=function(e){var t=screen.width,n=screen.height,r=Math.round(t/2-275),i=n>350?Math.round(n/2-175):0;window.open(e,"","left="+r+",top="+i+",width=550,height=350,personalbar=0,toolbar=0,scrollbars=1,resizable=1")}},5165:(e,t,n)=>{"use strict";e.exports=n.p+"../css/common.css"},7731:(e,t,n)=>{"use strict";e.exports=n.p+"../css/main.css"},691:(e,t,n)=>{"use strict";e.exports=n.p+"../css/vendors.css"},5893:()=>{},434:e=>{function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(this,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},7462:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}n.d(t,{Z:()=>r})}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var i=r.length-1;i>-1&&!e;)e=r[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),n(3831),n(7731),n(5165),n(691)})(); |