/*! For license information please see gallery-assets-d2ca27b12da32fdeb047.js.LICENSE.txt */ (()=>{var e={67154:e=>{function t(){return e.exports=t=Object.assign||function(e){for(var t=1;t{"use strict";var i=n(58908);e.exports=function(e,t){return void 0===t&&(t=!1),function(n,r,a){if(n)e(n);else if(r.statusCode>=400&&r.statusCode<=599){var s=a;if(t)if(i.TextDecoder){var o=(void 0===(u=r.headers&&r.headers["content-type"])&&(u=""),u.toLowerCase().split(";").reduce((function(e,t){var n=t.split("="),i=n[0],r=n[1];return"charset"===i.trim()?r.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 i=n(58908),r=n(67154),a=n(27376);function s(e,t,n){var i=e;return a(t)?(n=t,"string"==typeof e&&(i={uri:e})):i=r({},t,{uri:e}),i.callback=n,i}function o(e,t,n){return u(t=s(e,t,n))}function u(e){if(void 0===e.callback)throw new Error("callback argument missing");var t=!1,n=function(n,i,r){t||(t=!0,e.callback(n,i,r))};function i(){var e=void 0;if(e=l.response?l.response:l.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}(l),g)try{e=JSON.parse(e)}catch(e){}return e}function r(e){return clearTimeout(c),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,n(e,v)}function a(){if(!u){var t;clearTimeout(c),t=e.useXDR&&void 0===l.status?200:1223===l.status?204:l.status;var r=v,a=null;return 0!==t?(r={body:i(),statusCode:t,method:h,headers:{},url:d,rawRequest:l},l.getAllResponseHeaders&&(r.headers=function(e){var t={};return e?(e.trim().split("\n").forEach((function(e){var n=e.indexOf(":"),i=e.slice(0,n).trim().toLowerCase(),r=e.slice(n+1).trim();void 0===t[i]?t[i]=r:Array.isArray(t[i])?t[i].push(r):t[i]=[t[i],r]})),t):t}(l.getAllResponseHeaders()))):a=new Error("Internal XMLHttpRequest Error"),n(a,r,r.body)}}var s,u,l=e.xhr||null;l||(l=e.cors||e.useXDR?new o.XDomainRequest:new o.XMLHttpRequest);var c,d=l.url=e.uri||e.url,h=l.method=e.method||"GET",p=e.body||e.data,f=l.headers=e.headers||{},m=!!e.sync,g=!1,v={body:void 0,headers:{},statusCode:0,method:h,url:d,rawRequest:l};if("json"in e&&!1!==e.json&&(g=!0,f.accept||f.Accept||(f.Accept="application/json"),"GET"!==h&&"HEAD"!==h&&(f["content-type"]||f["Content-Type"]||(f["Content-Type"]="application/json"),p=JSON.stringify(!0===e.json?p:e.json))),l.onreadystatechange=function(){4===l.readyState&&setTimeout(a,0)},l.onload=a,l.onerror=r,l.onprogress=function(){},l.onabort=function(){u=!0},l.ontimeout=r,l.open(h,d,!m,e.username,e.password),m||(l.withCredentials=!!e.withCredentials),!m&&e.timeout>0&&(c=setTimeout((function(){if(!u){u=!0,l.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",r(e)}}),e.timeout)),l.setRequestHeader)for(s in f)f.hasOwnProperty(s)&&l.setRequestHeader(s,f[s]);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&&(l.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(l),l.send(p||null),l}o.httpHandler=n(13490),e.exports=o,e.exports.default=o,o.XMLHttpRequest=i.XMLHttpRequest||function(){},o.XDomainRequest="withCredentials"in new o.XMLHttpRequest?o.XMLHttpRequest:i.XDomainRequest,function(e,t){for(var n=0;n{"use strict";function n(e,t){return void 0===t&&(t=Object),t&&"function"==typeof t.freeze?t.freeze(e):e}var i=n({HTML:"text/html",isHTML:function(e){return e===i.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),r=n({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===r.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});t.freeze=n,t.MIME_TYPE=i,t.NAMESPACE=r},86129:(e,t,n)=>{var i=n(72167),r=n(41146),a=n(31045),s=n(76925),o=r.DOMImplementation,u=i.NAMESPACE,l=s.ParseError,c=s.XMLReader;function d(e){this.options=e||{locator:{}}}function h(){this.cdata=!1}function p(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function f(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 g(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}d.prototype.parseFromString=function(e,t){var n=this.options,i=new c,r=n.domBuilder||new h,s=n.errorHandler,o=n.locator,l=n.xmlns||{},d=/\/x?html?$/.test(t),p=d?a.HTML_ENTITIES:a.XML_ENTITIES;return o&&r.setDocumentLocator(o),i.errorHandler=function(e,t,n){if(!e){if(t instanceof h)return t;e=t}var i={},r=e instanceof Function;function a(t){var a=e[t];!a&&r&&(a=2==e.length?function(n){e(t,n)}:e),i[t]=a&&function(e){a("[xmldom "+t+"]\t"+e+f(n))}||function(){}}return n=n||{},a("warning"),a("error"),a("fatalError"),i}(s,r,o),i.domBuilder=n.domBuilder||r,d&&(l[""]=u.HTML),l.xml=l.xml||u.XML,e&&"string"==typeof e?i.parse(e,l,p):i.errorHandler.error("invalid doc source"),r.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,i){var r=this.doc,a=r.createElementNS(e,n||t),s=i.length;g(this,a),this.currentElement=a,this.locator&&p(this.locator,a);for(var o=0;o{var i=n(72167).NAMESPACE;function r(e){return""!==e}function a(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function s(e){if(!e)return[];var t=function(e){return e?e.split(/[\t\n\f\r ]+/).filter(r):[]}(e);return Object.keys(t.reduce(a,{}))}function o(e,t){for(var n in e)t[n]=e[n]}function u(e,t){var n=e.prototype;if(!(n instanceof t)){function i(){}i.prototype=t.prototype,o(n,i=new i),e.prototype=n=i}n.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),n.constructor=e)}var l={},c=l.ELEMENT_NODE=1,d=l.ATTRIBUTE_NODE=2,h=l.TEXT_NODE=3,p=l.CDATA_SECTION_NODE=4,f=l.ENTITY_REFERENCE_NODE=5,m=l.ENTITY_NODE=6,g=l.PROCESSING_INSTRUCTION_NODE=7,v=l.COMMENT_NODE=8,y=l.DOCUMENT_NODE=9,_=l.DOCUMENT_TYPE_NODE=10,b=l.DOCUMENT_FRAGMENT_NODE=11,T=l.NOTATION_NODE=12,S={},E={},w=(S.INDEX_SIZE_ERR=(E[1]="Index size error",1),S.DOMSTRING_SIZE_ERR=(E[2]="DOMString size error",2),S.HIERARCHY_REQUEST_ERR=(E[3]="Hierarchy request error",3)),C=(S.WRONG_DOCUMENT_ERR=(E[4]="Wrong document",4),S.INVALID_CHARACTER_ERR=(E[5]="Invalid character",5),S.NO_DATA_ALLOWED_ERR=(E[6]="No data allowed",6),S.NO_MODIFICATION_ALLOWED_ERR=(E[7]="No modification allowed",7),S.NOT_FOUND_ERR=(E[8]="Not found",8)),k=(S.NOT_SUPPORTED_ERR=(E[9]="Not supported",9),S.INUSE_ATTRIBUTE_ERR=(E[10]="Attribute in use",10));function x(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,E[e]),this.message=E[e],Error.captureStackTrace&&Error.captureStackTrace(this,x);return n.code=e,t&&(this.message=this.message+": "+t),n}function I(){}function P(e,t){this._node=e,this._refresh=t,A(this)}function A(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var n=e._refresh(e._node);le(e,"length",n.length),o(n,e),e._inc=t}}function O(){}function L(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function D(e,t,n,r){if(r?t[L(t,r)]=n:t[t.length++]=n,e){n.ownerElement=e;var a=e.ownerDocument;a&&(r&&F(a,e,r),function(e,t,n){e&&e._inc++,n.namespaceURI===i.XMLNS&&(t._nsMap[n.prefix?n.localName:""]=n.value)}(a,e,n))}}function N(e,t,n){var i=L(t,n);if(!(i>=0))throw x(C,new Error(e.tagName+"@"+n));for(var r=t.length-1;i"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function B(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(B(e,t))return!0}while(e=e.nextSibling)}function j(){}function F(e,t,n,r){e&&e._inc++,n.namespaceURI===i.XMLNS&&delete t._nsMap[n.prefix?n.localName:""]}function H(e,t,n){if(e&&e._inc){e._inc++;var i=t.childNodes;if(n)i[i.length++]=n;else{for(var r=t.firstChild,a=0;r;)i[a++]=r,r=r.nextSibling;i.length=a}}}function q(e,t){var n=t.previousSibling,i=t.nextSibling;return n?n.nextSibling=i:e.firstChild=i,i?i.previousSibling=n:e.lastChild=n,H(e.ownerDocument,e),t}function V(e,t,n){var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===b){var r=t.firstChild;if(null==r)return t;var a=t.lastChild}else r=a=t;var s=n?n.previousSibling:e.lastChild;r.previousSibling=s,a.nextSibling=n,s?s.nextSibling=r:e.firstChild=r,null==n?e.lastChild=a:n.previousSibling=a;do{r.parentNode=e}while(r!==a&&(r=r.nextSibling));return H(e.ownerDocument||e,e),t.nodeType==b&&(t.firstChild=t.lastChild=null),t}function W(){this._nsMap={}}function z(){}function X(){}function G(){}function K(){}function Y(){}function Q(){}function $(){}function Z(){}function J(){}function ee(){}function te(){}function ne(){}function ie(e,t){var n=[],i=9==this.nodeType&&this.documentElement||this,r=i.prefix,a=i.namespaceURI;if(a&&null==r&&null==(r=i.lookupPrefix(a)))var s=[{namespace:a,prefix:null}];return se(this,n,e,t,s),n.join("")}function re(e,t,n){var r=e.prefix||"",a=e.namespaceURI;if(!a)return!1;if("xml"===r&&a===i.XML||a===i.XMLNS)return!1;for(var s=n.length;s--;){var o=n[s];if(o.prefix===r)return o.namespace!==a}return!0}function ae(e,t,n){e.push(" ",t,'="',n.replace(/[<&"]/g,U),'"')}function se(e,t,n,r,a){if(a||(a=[]),r){if(!(e=r(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case c:var s=e.attributes,o=s.length,u=e.firstChild,l=e.tagName,m=l;if(!(n=i.isHTML(e.namespaceURI)||n)&&!e.prefix&&e.namespaceURI){for(var T,S=0;S=0;E--)if(""===(w=a[E]).prefix&&w.namespace===e.namespaceURI){T=w.namespace;break}if(T!==e.namespaceURI)for(E=a.length-1;E>=0;E--){var w;if((w=a[E]).namespace===e.namespaceURI){w.prefix&&(m=w.prefix+":"+l);break}}}t.push("<",m);for(var C=0;C"),n&&/^script$/i.test(l))for(;u;)u.data?t.push(u.data):se(u,t,n,r,a.slice()),u=u.nextSibling;else for(;u;)se(u,t,n,r,a.slice()),u=u.nextSibling;t.push("")}else t.push("/>");return;case y:case b:for(u=e.firstChild;u;)se(u,t,n,r,a.slice()),u=u.nextSibling;return;case d:return ae(t,e.name,e.value);case h:return t.push(e.data.replace(/[<&]/g,U).replace(/]]>/g,"]]>"));case p:return t.push("");case v:return t.push("\x3c!--",e.data,"--\x3e");case _:var P=e.publicId,A=e.systemId;if(t.push("");else if(A&&"."!=A)t.push(" SYSTEM ",A,">");else{var O=e.internalSubset;O&&t.push(" [",O,"]"),t.push(">")}return;case g:return t.push("");case f:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function oe(e,t,n){var i;switch(t.nodeType){case c:(i=t.cloneNode(!1)).ownerDocument=e;case b:break;case d:n=!0}if(i||(i=t.cloneNode(!1)),i.ownerDocument=e,i.parentNode=null,n)for(var r=t.firstChild;r;)i.appendChild(oe(e,r,n)),r=r.nextSibling;return i}function ue(e,t,n){var i=new t.constructor;for(var r in t){var a=t[r];"object"!=typeof a&&a!=i[r]&&(i[r]=a)}switch(t.childNodes&&(i.childNodes=new I),i.ownerDocument=e,i.nodeType){case c:var s=t.attributes,o=i.attributes=new O,u=s.length;o._ownerElement=i;for(var l=0;l0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n)for(var i in n)if(n[i]==e)return i;t=t.nodeType==d?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&e in n)return n[e];t=t.nodeType==d?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},o(l,M),o(l,M.prototype),j.prototype={nodeName:"#document",nodeType:y,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==b){for(var n=e.firstChild;n;){var i=n.nextSibling;this.insertBefore(n,t),n=i}return e}return null==this.documentElement&&e.nodeType==c&&(this.documentElement=e),V(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),q(this,e)},importNode:function(e,t){return oe(this,e,t)},getElementById:function(e){var t=null;return B(this.documentElement,(function(n){if(n.nodeType==c&&n.getAttribute("id")==e)return t=n,!0})),t},getElementsByClassName:function(e){var t=s(e);return new P(this,(function(n){var i=[];return t.length>0&&B(n.documentElement,(function(r){if(r!==n&&r.nodeType===c){var a=r.getAttribute("class");if(a){var o=e===a;if(!o){var u=s(a);o=t.every((l=u,function(e){return l&&-1!==l.indexOf(e)}))}o&&i.push(r)}}var l})),i}))},createElement:function(e){var t=new W;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new I,(t.attributes=new O)._ownerElement=t,t},createDocumentFragment:function(){var e=new ee;return e.ownerDocument=this,e.childNodes=new I,e},createTextNode:function(e){var t=new G;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new K;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new Y;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new te;return n.ownerDocument=this,n.tagName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new z;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new J;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new W,i=t.split(":"),r=n.attributes=new O;return n.childNodes=new I,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==i.length?(n.prefix=i[0],n.localName=i[1]):n.localName=t,r._ownerElement=n,n},createAttributeNS:function(e,t){var n=new z,i=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==i.length?(n.prefix=i[0],n.localName=i[1]):n.localName=t,n}},u(j,M),W.prototype={nodeType:c,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===b?this.insertBefore(e,null):function(e,t){var n=t.parentNode;if(n){var i=e.lastChild;n.removeChild(t),i=e.lastChild}return i=e.lastChild,t.parentNode=e,t.previousSibling=i,t.nextSibling=null,i?i.nextSibling=t:e.firstChild=t,e.lastChild=t,H(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 i=this.ownerDocument.createAttributeNS(e,t);i.value=i.nodeValue=""+n,this.setAttributeNode(i)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new P(this,(function(t){var n=[];return B(t,(function(i){i===t||i.nodeType!=c||"*"!==e&&i.tagName!=e||n.push(i)})),n}))},getElementsByTagNameNS:function(e,t){return new P(this,(function(n){var i=[];return B(n,(function(r){r===n||r.nodeType!==c||"*"!==e&&r.namespaceURI!==e||"*"!==t&&r.localName!=t||i.push(r)})),i}))}},j.prototype.getElementsByTagName=W.prototype.getElementsByTagName,j.prototype.getElementsByTagNameNS=W.prototype.getElementsByTagNameNS,u(W,M),z.prototype.nodeType=d,u(z,M),X.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(E[w])},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}},u(X,M),G.prototype={nodeName:"#text",nodeType:h,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 i=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}},u(G,X),K.prototype={nodeName:"#comment",nodeType:v},u(K,X),Y.prototype={nodeName:"#cdata-section",nodeType:p},u(Y,X),Q.prototype.nodeType=_,u(Q,M),$.prototype.nodeType=T,u($,M),Z.prototype.nodeType=m,u(Z,M),J.prototype.nodeType=f,u(J,M),ee.prototype.nodeName="#document-fragment",ee.prototype.nodeType=b,u(ee,M),te.prototype.nodeType=g,u(te,M),ne.prototype.serializeToString=function(e,t,n){return ie.call(e,t,n)},M.prototype.toString=ie;try{if(Object.defineProperty){function ce(e){switch(e.nodeType){case c:case b:var t=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&t.push(ce(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}Object.defineProperty(P.prototype,"length",{get:function(){return A(this),this.$$length}}),Object.defineProperty(M.prototype,"textContent",{get:function(){return ce(this)},set:function(e){switch(this.nodeType){case c:case b: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}}}),le=function(e,t,n){e["$$"+t]=n}}}catch(de){}t.DocumentType=Q,t.DOMException=x,t.DOMImplementation=R,t.Element=W,t.Node=M,t.NodeList=I,t.XMLSerializer=ne},31045:(e,t,n)=>{var i=n(72167).freeze;t.XML_ENTITIES=i({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=i({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}),t.entityMap=t.HTML_ENTITIES},3969:(e,t,n)=>{var i=n(41146);i.DOMImplementation,i.XMLSerializer,t.DOMParser=n(86129).DOMParser},76925:(e,t,n)=>{var i=n(72167).NAMESPACE,r=/[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"+r.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),s=new RegExp("^"+r.source+a.source+"*(?::"+r.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,r,a,s){function o(e,t,i){n.attributeNames.hasOwnProperty(e)&&s.fatalError("Attribute "+e+" redefined"),n.addValue(e,t,i)}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,h=e.slice(t,l).replace(/&#?\w+;/g,a),t-1),c=5}else{if(4!=c)throw new Error('attribute value must after "="');o(u,h=e.slice(t,l).replace(/&#?\w+;/g,a),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:case 2: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:"/"===(h=e.slice(t,l)).slice(-1)&&(n.closed=!0,h=h.slice(0,-1));case 2:2===c&&(h=u),4==c?(s.warning('attribute "'+h+'" missed quot(")!'),o(u,h.replace(/&#?\w+;/g,a),t)):(i.isHTML(r[""])&&h.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+h+'" missed value!! "'+h+'" instead!!'),o(h,h,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 h=e.slice(t,l).replace(/&#?\w+;/g,a);s.warning('attribute "'+h+'" missed quot(")!!'),o(u,h,t);case 5:c=6}else switch(c){case 2:n.tagName,i.isHTML(r[""])&&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 r=e.tagName,a=null,s=e.length;s--;){var o=e[s],u=o.qName,l=o.value;if((p=u.indexOf(":"))>0)var c=o.prefix=u.slice(0,p),d=u.slice(p+1),h="xmlns"===c&&d;else d=u,c=null,h="xmlns"===u&&"";o.localName=d,!1!==h&&(null==a&&(a={},f(n,n={})),n[h]=a[h]=l,o.uri=i.XMLNS,t.startPrefixMapping(h,l))}for(s=e.length;s--;)(c=(o=e[s]).prefix)&&("xml"===c&&(o.uri=i.XML),"xmlns"!==c&&(o.uri=n[c||""]));var p;(p=r.indexOf(":"))>0?(c=e.prefix=r.slice(0,p),d=e.localName=r.slice(p+1)):(c=null,d=e.localName=r);var m=e.uri=n[c||""];if(t.startElement(m,d,r,e),!e.closed)return e.currentNSMap=n,e.localNSMap=a,!0;if(t.endElement(m,d,r),a)for(c in a)t.endPrefixMapping(c)}function h(e,t,n,i,r){if(/^(?:script|textarea)$/i.test(n)){var a=e.indexOf("",t),s=e.substring(t+1,a);if(/[&<]/.test(s))return/^script$/i.test(n)?(r.characters(s,0,s.length),a):(s=s.replace(/&#?\w+;/g,i),r.characters(s,0,s.length),a)}return t+1}function p(e,t,n,i){var r=i[n];return null==r&&((r=e.lastIndexOf(""))t?(n.comment(e,t+4,r-t-4),r+3):(i.error("Unclosed comment"),-1):-1;if("CDATA["==e.substr(t+3,6)){var r=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,r-t-9),n.endCDATA(),r+3}var a=function(e,t){var n,i=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=t,r.exec(e);n=r.exec(e);)if(i.push(n),n[1])return i}(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 g(e,t,n){var i=e.indexOf("?>",t);if(i){var r=e.substring(t,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return r?(r[0].length,n.processingInstruction(r[1],r[2]),i+2):-1}return-1}function v(){this.attributeNames={}}o.prototype=new Error,o.prototype.name=o.name,u.prototype={parse:function(e,t,n){var r=this.domBuilder;r.startDocument(),f(t,t={}),function(e,t,n,r,a){function s(e){var t=e.slice(1,-1);return t in n?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);T&&f(w),r.characters(n,0,t-w),w=t}}function f(t,n){for(;t>=_&&(n=b.exec(e));)y=n.index,_=y+n[0].length,T.lineNumber++;T.columnNumber=t-y+1}for(var y=0,_=0,b=/.*(?:\r\n?|\n)|.*$/g,T=r.locator,S=[{currentNSMap:t}],E={},w=0;;){try{var C=e.indexOf("<",w);if(C<0){if(!e.substr(w).match(/^\s*$/)){var k=r.doc,x=k.createTextNode(e.substr(w));k.appendChild(x),r.currentElement=x}return}switch(C>w&&u(C),e.charAt(C+1)){case"/":var I=e.indexOf(">",C+3),P=e.substring(C+2,I).replace(/[ \t\n\r]+$/g,""),A=S.pop();I<0?(P=e.substring(C+2).replace(/[\s<].*/,""),a.error("end tag name: "+P+" is not complete:"+A.tagName),I=C+1+P.length):P.match(/\sw?w=I:u(Math.max(C,w)+1)}}(e,t,n,r,this.errorHandler),r.endDocument()}},v.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},77328:()=>{Math.trunc=Math.trunc||function(e){return isNaN(e)?NaN:e>0?Math.floor(e):Math.ceil(e)}},89144:(e,t,n)=>{var i,r=void 0!==n.g?n.g:"undefined"!=typeof window?window:{},a=n(25893);"undefined"!=typeof document?i=document:(i=r["__GLOBAL_DOCUMENT_CACHE@4"])||(i=r["__GLOBAL_DOCUMENT_CACHE@4"]=a),e.exports=i},58908:(e,t,n)=>{var i;i="undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},e.exports=i},27376:e=>{e.exports=function(e){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},27537:(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=i[a.toLowerCase()])?n:(n=r[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=i[t.toLowerCase()])return a===n;if(a=r[t.toLowerCase()])return a===n}else if("number"==typeof t)return t===n;return!1}};var i=(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},r=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++)i[String.fromCharCode(a)]=a-32;for(var a=48;a<58;a++)i[a-48]=a;for(a=1;a<13;a++)i["f"+a]=a+111;for(a=0;a<10;a++)i["numpad "+a]=a+96;var s=t.names=t.title={};for(a in i)s[i[a]]=a;for(var o in r)i[o]=r[o]},30758:(e,t,n)=>{"use strict";n.r(t)},68202:(e,t,n)=>{"use strict";n.r(t)},84221:e=>{var t=Math.pow(2,32);e.exports=function(e){var n=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:n.getUint32(4),timescale:n.getUint32(8)},r=12;0===i.version?(i.earliestPresentationTime=n.getUint32(r),i.firstOffset=n.getUint32(r+4),r+=8):(i.earliestPresentationTime=n.getUint32(r)*t+n.getUint32(r+4),i.firstOffset=n.getUint32(r+8)*t+n.getUint32(r+12),r+=16),r+=2;var a=n.getUint16(r);for(r+=2;a>0;r+=12,a--)i.references.push({referenceType:(128&e[r])>>>7,referencedSize:2147483647&n.getUint32(r),subsegmentDuration:n.getUint32(r+4),startsWithSap:!!(128&e[r+8]),sapType:(112&e[r+8])>>>4,sapDeltaTime:268435455&n.getUint32(r+8)});return i}},51489:e=>{var t,n,i,r,a,s,o,u=9e4;t=function(e){return e*u},n=function(e,t){return e*t},i=function(e){return e/u},r=function(e,t){return e/t},a=function(e,n){return t(r(e,n))},s=function(e,t){return n(i(e),t)},o=function(e,t,n){return i(n?e:e-t)},e.exports={ONE_SECOND_IN_TS:u,secondsToVideoTs:t,secondsToAudioTs:n,videoTsToSeconds:i,audioTsToSeconds:r,audioTsToVideoTs:a,videoTsToAudioTs:s,metadataTsToSeconds:o}},75974:e=>{e.exports=function(e,t){var n,i=null;try{n=JSON.parse(e,t)}catch(e){i=e}return[i,n]}},49945:function(e){var t,n,i,r,a;t=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,n=/^([^\/?#]*)([^]*)$/,i=/(?:\/|^)\.(?=\/)/g,r=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(e,t,i){if(i=i||{},e=e.trim(),!(t=t.trim())){if(!i.alwaysNormalize)return e;var r=a.parseURL(e);if(!r)throw new Error("Error trying to parse base URL.");return r.path=a.normalizePath(r.path),a.buildURLFromParts(r)}var s=a.parseURL(t);if(!s)throw new Error("Error trying to parse relative URL.");if(s.scheme)return i.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=i.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(i,"");e.length!==(e=e.replace(r,"")).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},13407:(e,t,n)=>{var i=n(58908),r=e.exports={WebVTT:n(63706),VTTCue:n(22230),VTTRegion:n(13710)};i.vttjs=r,i.WebVTT=r.WebVTT;var a=r.VTTCue,s=r.VTTRegion,o=i.VTTCue,u=i.VTTRegion;r.shim=function(){i.VTTCue=a,i.VTTRegion=s},r.restore=function(){i.VTTCue=o,i.VTTRegion=u},i.VTTCue||r.shim()},63706:(e,t,n)=>{var i=n(89144),r=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,i){return 3600*(0|e)+60*(0|t)+(0|n)+(0|i)/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=r(null)}function u(e,t,n,i){var r=i?e.split(i):[e];for(var a in r)if("string"==typeof r[a]){var s=r[a].split(n);2===s.length&&t(s[0],s[1])}}function l(e,t,n){var i=e;function r(){var t=s(e);if(null===t)throw new a(a.Errors.BadTimeStamp,"Malformed timestamp: "+i);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function l(){e=e.replace(/^\s+/,"")}if(l(),t.startTime=r(),l(),"--\x3e"!==e.substr(0,3))throw new a(a.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+i);e=e.substr(3),l(),t.endTime=r(),l(),function(e,t){var i=new o;u(e,(function(e,t){switch(e){case"region":for(var r=n.length-1;r>=0;r--)if(n[r].id===t){i.set(e,n[r].region);break}break;case"vertical":i.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),s=a[0];i.integer(e,s),i.percent(e,s)&&i.set("snapToLines",!1),i.alt(e,s,["auto"]),2===a.length&&i.alt("lineAlign",a[1],["start","center","end"]);break;case"position":a=t.split(","),i.percent(e,a[0]),2===a.length&&i.alt("positionAlign",a[1],["start","center","end"]);break;case"size":i.percent(e,t);break;case"align":i.alt(e,t,["start","center","end","left","right"])}}),/:/,/\s/),t.region=i.get("region",null),t.vertical=i.get("vertical","");try{t.line=i.get("line","auto")}catch(e){}t.lineAlign=i.get("lineAlign","start"),t.snapToLines=i.get("snapToLines",!0),t.size=i.get("size",100);try{t.align=i.get("align","center")}catch(e){t.align=i.get("align","middle")}try{t.position=i.get("position","auto")}catch(e){t.position=i.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=i.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(e,t)}a.prototype=r(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 i=0;i=0&&t<=100)&&(this.set(e,t),!0)}};var c=i.createElement&&i.createElement("textarea"),d={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},h={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)"},p={v:"title",lang:"lang"},f={rt:"ruby"};function m(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 i(e,t){return!f[t.localName]||f[t.localName]===e.localName}function r(t,n){var i=d[t];if(!i)return null;var r=e.document.createElement(i),a=p[t];return a&&n&&(r[a]=n.trim()),r}for(var a,o,u=e.document.createElement("div"),l=u,m=[];null!==(a=n());)if("<"!==a[0])l.appendChild(e.document.createTextNode((o=a,c.innerHTML=o,o=c.textContent,c.textContent="",o)));else{if("/"===a[1]){m.length&&m[m.length-1]===a.substr(2).replace(">","")&&(m.pop(),l=l.parentNode);continue}var g,v=s(a.substr(1,a.length-2));if(v){g=e.document.createProcessingInstruction("timestamp",v),l.appendChild(g);continue}var y=a.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!y)continue;if(!(g=r(y[1],y[3])))continue;if(!i(l,g))continue;if(y[2]){var _=y[2].split(".");_.forEach((function(e){var t=/^bg_/.test(e),n=t?e.slice(3):e;if(h.hasOwnProperty(n)){var i=t?"background-color":"color",r=h[n];g.style[i]=r}})),g.className=_.join(" ")}m.push(y[1]),l.appendChild(g),l=g}return u}var g=[[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 v(e){for(var t=0;t=n[0]&&e<=n[1])return!0}return!1}function y(e){var t=[],n="";if(!e||!e.childNodes)return"ltr";function i(e,t){for(var n=t.childNodes.length-1;n>=0;n--)e.push(t.childNodes[n])}function r(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?r(e):t.childNodes?(i(e,t),r(e)):void 0}for(i(t,e);n=r(t);)for(var a=0;a=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,i=0,r=0;rd&&(c=c<0?-1:1,c*=Math.ceil(d/l)*l),s<0&&(c+=""===a.vertical?n.height:n.width,o=o.reverse()),r.move(h,c)}else{var p=r.lineHeight/n.height*100;switch(a.lineAlign){case"center":s-=p/2;break;case"end":s-=p}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"],r=new T(t)}var f=function(e,t){for(var r,a=new T(e),s=1,o=0;ou&&(r=new T(e),s=u),e=new T(a)}return r||a}(r,o);t.move(f.toCSSCompatValues(n))}function E(){}_.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},b.prototype=r(_.prototype),b.prototype.constructor=b,T.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}},T.prototype.overlaps=function(e){return this.lefte.left&&this.tope.top},T.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},T.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},T.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)},T.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}},T.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,i=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||i,height:e.height||t,bottom:e.bottom||i+(e.height||t),width:e.width||n}},E.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},E.convertCueToDOMTree=function(e,t){return e&&t?m(e,t):null},E.processCues=function(e,t,n){if(!e||!t||!n)return null;for(;n.firstChild;)n.removeChild(n.firstChild);var i=e.document.createElement("div");if(i.style.position="absolute",i.style.left="0",i.style.right="0",i.style.top="0",i.style.bottom="0",i.style.margin="1.5%",n.appendChild(i),function(e){for(var t=0;t{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 i(e){return"string"==typeof e&&!!n[e.toLowerCase()]&&e.toLowerCase()}function r(e,n,r){this.hasBeenReset=!1;var a="",s=!1,o=e,u=n,l=r,c=null,d="",h=!0,p="auto",f="start",m="auto",g="auto",v=100,y="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 h},set:function(e){h=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return p},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("Line: an invalid number or illegal string was specified.");p=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return f},set:function(e){var t=i(e);t?(f=t,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return m},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");m=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return g},set:function(e){var t=i(e);t?(g=t,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return v},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");v=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return y},set:function(e){var t=i(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");y=t,this.hasBeenReset=!0}}}),this.displayState=void 0}r.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},e.exports=r},13710:e=>{var t={"":!0,up:!0};function n(e){return"number"==typeof e&&e>=0&&e<=100}e.exports=function(){var e=100,i=3,r=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 i},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");i=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 r},set:function(e){if(!n(e))throw new Error("RegionAnchorY must be between 0 and 100.");r=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}}})}},25893:()=>{}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var a=t[i]={exports:{}};return e[i].call(a.exports,a,a.exports,n),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 i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},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})},(()=>{"use strict";const e=React;var t=n.n(e);const i=ReactDOM;var r=n.n(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 s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function o(e){for(var t=1;t-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var n=t.length,i=0;i-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(U),V=String.fromCharCode(9),W=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},z=function(e){for(var t,n=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),i={},r=n.length;r--;)""!==n[r]&&((t=/([^=]*)=(.*)/.exec(n[r]).slice(1))[0]=t[0].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^['"](.*)['"]$/g,"$1"),i[t[0]]=t[1]);return i},X=function(e){function t(){var t;return(t=e.call(this)||this).customParsers=[],t.tagMappers=[],t}S(t,e);var n=t.prototype;return n.push=function(e){var t,n,i=this;0!==(e=e.trim()).length&&("#"===e[0]?this.tagMappers.reduce((function(t,n){var i=n(e);return i===e?t:t.concat([i])}),[e]).forEach((function(e){for(var r=0;r0&&(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("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:B(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"}),i={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void 0!==e.attributes.IV&&(i.iv=e.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else i=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,c=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),i&&(n.key=i)},"stream-inf":function(){this.manifest.playlists=a,this.manifest.mediaGroups=this.manifest.mediaGroups||l,e.attributes?(s.attributes||(s.attributes={}),_(s.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||l,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"]],(p={default:/yes/i.test(e.attributes.DEFAULT)}).default?p.autoselect=!0:p.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(p.language=e.attributes.LANGUAGE),e.attributes.URI&&(p.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(p.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(p.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(p.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=p}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){c+=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,K.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=G(e.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",e.attributes,["SKIPPED-SEGMENTS"])},part:function(){var t=this;o=!0;var n=this.manifest.segments.length,i=G(e.attributes);s.parts=s.parts||[],s.parts.push(i),i.byterange&&(i.byterange.hasOwnProperty("offset")||(i.byterange.offset=h),h=i.byterange.offset+i.byterange.length);var r=s.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+r+" 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=G(e.attributes);t.hasOwnProperty("canBlockReload")||(t.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),K.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=G(e.attributes),i=n.type&&"PART"===n.type;s.preloadHints=s.preloadHints||[],s.preloadHints.push(n),n.byterange&&(n.byterange.hasOwnProperty("offset")||(n.byterange.offset=i?h:0,i&&(h=n.byterange.offset+n.byterange.length)));var r=s.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+r+" for segment #"+t,e.attributes,["TYPE","URI"]),n.type)for(var a=0;af&&(f=_);var b=void 0;if(y<0){var T=m+1;b=T===t.length?"dynamic"===n&&r>0&&s.indexOf("$Number$")>0?Pe(e,f,v):(o*l-f)/v:(t[T].t-f)/v}else b=y+1;for(var S=d+p.length+b,E=d+p.length;E=r?a:""+new Array(r-a.length+1).join("0")+a)}}(t))},De=function(e,t){var n={RepresentationID:e.id,Bandwidth:e.bandwidth||0},i=e.initialization,r=void 0===i?{sourceURL:"",range:""}:i,a=me({baseUrl:e.baseUrl,source:Le(r.sourceURL,n),range:r.range}),s=function(e,t){return e.duration||t?e.duration?ye(e):Ae(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodIndex}]}(e,t);return s.map((function(t){n.Number=t.number,n.Time=t.time;var i=Le(e.media||"",n),r=e.timescale||1,s=e.presentationTimeOffset||0,o=e.periodStart+(t.time-s)/r;return{uri:i,timeline:t.timeline,duration:t.duration,resolvedUri:M(e.baseUrl||"",i),map:a,number:t.number,presentationTime:o}}))},Ne=function(e,t){var n=e.duration,i=e.segmentUrls,r=void 0===i?[]:i,a=e.periodStart;if(!n&&!t||n&&t)throw new Error("SEGMENT_TIME_UNSPECIFIED");var s,o=r.map((function(t){return function(e,t){var n=e.baseUrl,i=e.initialization,r=void 0===i?{}:i,a=me({baseUrl:n,source:r.sourceURL,range:r.range}),s=me({baseUrl:n,source:t.media,range:t.mediaRange});return s.map=a,s}(e,t)}));return n&&(s=ye(e)),t&&(s=Ae(e,t)),s.map((function(t,n){if(o[n]){var i=o[n],r=e.timescale||1,s=e.presentationTimeOffset||0;return i.timeline=t.timeline,i.duration=t.duration,i.number=t.number,i.presentationTime=a+(t.time-s)/r,i}})).filter((function(e){return e}))},Re=function(e){var t,n,i=e.attributes,r=e.segmentInfo;r.template?(n=De,t=he(i,r.template)):r.base?(n=_e,t=he(i,r.base)):r.list&&(n=Ne,t=he(i,r.list));var a={attributes:i};if(!n)return a;var s=n(t,r.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,r.base&&t.indexRange&&(a.sidx=s[0],a.segments=[]),a},Me=function(e,t){return fe(e.childNodes).filter((function(e){return e.tagName===t}))},Ue=function(e){return e.textContent.trim()},Be=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),i=n[0],r=n[1],a=n[2],s=n[3],o=n[4],u=n[5];return 31536e3*parseFloat(i||0)+2592e3*parseFloat(r||0)+86400*parseFloat(a||0)+3600*parseFloat(s||0)+60*parseFloat(o||0)+parseFloat(u||0)},je={mediaPresentationDuration:function(e){return Be(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 Be(e)},suggestedPresentationDelay:function(e){return Be(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return Be(e)},start:function(e){return Be(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},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)?Be(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}},Fe=function(e){return e&&e.attributes?fe(e.attributes).reduce((function(e,t){var n=je[t.name]||je.DEFAULT;return e[t.name]=n(t.value),e}),{}):{}},He={"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"},qe=function(e,t){return t.length?pe(e.map((function(e){return t.map((function(t){return M(e,Ue(t))}))}))):e},Ve=function(e){var t=Me(e,"SegmentTemplate")[0],n=Me(e,"SegmentList")[0],i=n&&Me(n,"SegmentURL").map((function(e){return he({tag:"SegmentURL"},Fe(e))})),r=Me(e,"SegmentBase")[0],a=n||t,s=a&&Me(a,"SegmentTimeline")[0],o=n||r||t,u=o&&Me(o,"Initialization")[0],l=t&&Fe(t);l&&u?l.initialization=u&&Fe(u):l&&l.initialization&&(l.initialization={sourceURL:l.initialization});var c={template:l,segmentTimeline:s&&Me(s,"S").map((function(e){return Fe(e)})),list:n&&he(Fe(n),{segmentUrls:i,initialization:Fe(u)}),base:r&&he(Fe(r),{initialization:Fe(u)})};return Object.keys(c).forEach((function(e){c[e]||delete c[e]})),c},We=function(e,t){return function(n,i){var r=qe(t,Me(n.node,"BaseURL")),a=parseInt(n.attributes.id,10),s=g().isNaN(a)?i:a,o=he(e,{periodIndex:s,periodStart:n.attributes.start});"number"==typeof n.attributes.duration&&(o.periodDuration=n.attributes.duration);var u=Me(n.node,"AdaptationSet"),l=Ve(n.node);return pe(u.map(function(e,t,n){return function(i){var r,a=Fe(i),s=qe(t,Me(i,"BaseURL")),o=Me(i,"Role")[0],u={role:Fe(o)},l=he(e,a,u),c=Me(i,"Accessibility")[0],d="urn:scte:dash:cc:cea-608:2015"===(r=Fe(c)).schemeIdUri?("string"!=typeof r.value?[]:r.value.split(";")).map((function(e){var t,n;if(n=e,/^CC\d=/.test(e)){var i=e.split("=");t=i[0],n=i[1]}else/^CC\d$/.test(e)&&(t=e);return{channel:t,language:n}})):"urn:scte:dash:cc:cea-708:2015"===r.schemeIdUri?("string"!=typeof r.value?[]:r.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("="),i=n[0],r=n[1],a=void 0===r?"":r;t.channel=i,t.language=e,a.split(",").forEach((function(e){var n=e.split(":"),i=n[0],r=n[1];"lang"===i?t.language=r:"er"===i?t.easyReader=Number(r):"war"===i?t.aspectRatio=Number(r):"3D"===i&&(t["3D"]=Number(r))}))}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t})):void 0;d&&(l=he(l,{captionServices:d}));var h=Me(i,"Label")[0];if(h&&h.childNodes.length){var p=h.childNodes[0].nodeValue.trim();l=he(l,{label:p})}var f=Me(i,"ContentProtection").reduce((function(e,t){var n=Fe(t),i=He[n.schemeIdUri];if(i){e[i]={attributes:n};var r=Me(t,"cenc:pssh")[0];if(r){var a=Ue(r),s=a&&B(a);e[i].pssh=s}}return e}),{});Object.keys(f).length&&(l=he(l,{contentProtection:f}));var m=Ve(i),g=Me(i,"Representation"),v=he(n,m);return pe(g.map(function(e,t,n){return function(i){var r=Me(i,"BaseURL"),a=qe(t,r),s=he(e,Fe(i)),o=Ve(i);return a.map((function(e){return{segmentInfo:he(n,o),attributes:he(s,{baseUrl:e})}}))}}(l,s,v)))}}(o,r,l)))}},ze=function(e){if(""===e)throw new Error("DASH_EMPTY_MANIFEST");var t,n,i=new ce.DOMParser;try{n=(t=i.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},Xe=function(e,t){void 0===t&&(t={});var n=function(e,t){void 0===t&&(t={});var n=t,i=n.manifestUri,r=void 0===i?"":i,a=n.NOW,s=void 0===a?Date.now():a,o=n.clientOffset,u=void 0===o?0:o,l=Me(e,"Period");if(!l.length)throw new Error("INVALID_NUMBER_OF_PERIOD");var c=Me(e,"Location"),d=Fe(e),h=qe([r],Me(e,"BaseURL"));d.type=d.type||"static",d.sourceDuration=d.mediaPresentationDuration||0,d.NOW=s,d.clientOffset=u,c.length&&(d.locations=c.map(Ue));var p=[];return l.forEach((function(e,t){var n=Fe(e),i=p[t-1];n.start=function(e){var t=e.attributes,n=e.priorPeriodAttributes,i=e.mpdType;return"number"==typeof t.start?t.start:n&&"number"==typeof n.start&&"number"==typeof n.duration?n.start+n.duration:n||"static"!==i?null:0}({attributes:n,priorPeriodAttributes:i?i.attributes:null,mpdType:d.type}),p.push({node:e,attributes:n})})),{locations:d.locations,representationInfo:pe(p.map(We(d,h)))}}(ze(e),t);return function(e,t,n){var i;if(void 0===n&&(n={}),!e.length)return{};var r=e[0].attributes,a=r.sourceDuration,s=r.type,o=r.suggestedPresentationDelay,u=r.minimumUpdatePeriod,l=Se(e.filter(ke)).map(Ce),c=Se(e.filter(xe)),d=e.filter(Ie),h=e.map((function(e){return e.attributes.captionServices})).filter(Boolean),p={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(i={AUDIO:{},VIDEO:{}},i["CLOSED-CAPTIONS"]={},i.SUBTITLES={},i),uri:"",duration:a,playlists:we(l,n)};u>=0&&(p.minimumUpdatePeriod=1e3*u),t&&(p.locations=t),"dynamic"===s&&(p.suggestedPresentationDelay=o);var f=0===p.playlists.length;return c.length&&(p.mediaGroups.AUDIO.audio=function(e,t,n){var i;void 0===t&&(t={}),void 0===n&&(n=!1);var r=e.reduce((function(e,r){var a=r.attributes.role&&r.attributes.role.value||"",s=r.attributes.lang||"",o=r.attributes.label||"main";if(s&&!r.attributes.label){var u=a?" ("+a+")":"";o=""+r.attributes.lang+u}e[o]||(e[o]={language:s,autoselect:!0,default:"main"===a,playlists:[],uri:""});var l=Ee(function(e,t){var n,i=e.attributes,r=e.segments,a=e.sidx,s={attributes:(n={NAME:i.id,BANDWIDTH:i.bandwidth,CODECS:i.codecs},n["PROGRAM-ID"]=1,n),uri:"",endList:"static"===i.type,timeline:i.periodIndex,resolvedUri:"",targetDuration:i.duration,segments:r,mediaSequence:r.length?r[0].number:1};return i.contentProtection&&(s.contentProtection=i.contentProtection),a&&(s.sidx=a),t&&(s.attributes.AUDIO="audio",s.attributes.SUBTITLES="subs"),s}(r,n),t);return e[o].playlists.push(l),void 0===i&&"main"===a&&((i=r).default=!0),e}),{});return i||(r[Object.keys(r)[0]].default=!0),r}(c,n,f)),d.length&&(p.mediaGroups.SUBTITLES.subs=function(e,t){return void 0===t&&(t={}),e.reduce((function(e,n){var i=n.attributes.lang||"text";return e[i]||(e[i]={language:i,default:!1,autoselect:!1,playlists:[],uri:""}),e[i].playlists.push(Ee(function(e){var t,n=e.attributes,i=e.segments;void 0===i&&(i=[{uri:n.baseUrl,timeline:n.periodIndex,resolvedUri:n.baseUrl||"",duration:n.sourceDuration,number:0}],n.duration=n.sourceDuration);var r=((t={NAME:n.id,BANDWIDTH:n.bandwidth})["PROGRAM-ID"]=1,t);return n.codecs&&(r.CODECS=n.codecs),{attributes:r,uri:"",endList:"static"===n.type,timeline:n.periodIndex,resolvedUri:n.baseUrl||"",targetDuration:n.duration,segments:i,mediaSequence:i.length?i[0].number:1}}(n),t)),e}),{})}(d,n)),h.length&&(p.mediaGroups["CLOSED-CAPTIONS"].cc=h.reduce((function(e,t){return t?(t.forEach((function(t){var n=t.channel,i=t.language;e[i]={autoselect:!1,default:!1,instreamId:n,language:i},t.hasOwnProperty("aspectRatio")&&(e[i].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[i].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[i]["3D"]=t["3D"])})),e):e}),{})),p}(n.representationInfo.map(Re),n.locations,t.sidxMapping)},Ge=n(84221),Ke=n.n(Ge),Ye=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||(t=e,ArrayBuffer.isView(t))||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));var t},Qe=g().BigInt||Number,$e=[Qe("0x1"),Qe("0x100"),Qe("0x10000"),Qe("0x1000000"),Qe("0x100000000"),Qe("0x10000000000"),Qe("0x1000000000000"),Qe("0x100000000000000"),Qe("0x10000000000000000")],Ze=(j=new Uint16Array([65484]),255===(F=new Uint8Array(j.buffer,j.byteOffset,j.byteLength))[0]||F[0],function(e,t){var n=void 0===t?{}:t,i=n.signed,r=void 0!==i&&i,a=n.le,s=void 0!==a&&a;e=Ye(e);var o=s?"reduce":"reduceRight",u=(e[o]?e[o]:Array.prototype[o]).call(e,(function(t,n,i){var r=s?i:Math.abs(i+1-e.length);return t+Qe(n)*$e[r]}),Qe(0));if(r){var l=$e[e.length]/Qe(2)-Qe(1);(u=Qe(u))>l&&(u-=l,u-=l,u-=Qe(2))}return Number(u)}),Je=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),i=0;i=t.length&&u.call(t,(function(t,n){return t===(o[n]?o[n]&e[a+n]:e[a+n])}))},tt=Ye([73,68,51]),nt=function e(t,n){return void 0===n&&(n=0),(t=Ye(t)).length-n<10||!et(t,tt,{offset:n})?n:(n+=function(e,t){void 0===t&&(t=0);var n=(e=Ye(e))[t+5],i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&n)>>4?i+20:i+10}(t,n),e(t,n))},it=(new Uint8Array([79,112,117,115,72,101,97,100]),function(e){return"string"==typeof e?Je(e):e}),rt=function(e){e=Ye(e);for(var t=[],n=0;e.length>n;){var i=e[n],r=0,a=0,s=e[++a];for(a++;128&s;)r=(127&s)<<7,s=e[a],a++;r+=127&s;for(var o=0;o>>0,o=t.subarray(a+4,a+8);if(0===s)break;var u=a+s;if(u>t.length){if(i)break;u=t.length}var l=t.subarray(a+8,u);et(o,n[0])&&(1===n.length?r.push(l):r.push.apply(r,e(l,n.slice(1),i))),a=u}return r},st={EBML:Ye([26,69,223,163]),DocType:Ye([66,130]),Segment:Ye([24,83,128,103]),SegmentInfo:Ye([21,73,169,102]),Tracks:Ye([22,84,174,107]),Track:Ye([174]),TrackNumber:Ye([215]),DefaultDuration:Ye([35,227,131]),TrackEntry:Ye([174]),TrackType:Ye([131]),FlagDefault:Ye([136]),CodecID:Ye([134]),CodecPrivate:Ye([99,162]),VideoTrack:Ye([224]),AudioTrack:Ye([225]),Cluster:Ye([31,67,182,117]),Timestamp:Ye([231]),TimestampScale:Ye([42,215,177]),BlockGroup:Ye([160]),BlockDuration:Ye([155]),Block:Ye([161]),SimpleBlock:Ye([163])},ot=[128,64,32,16,8,4,2,1],ut=function(e,t,n,i){void 0===n&&(n=!0),void 0===i&&(i=!1);var r=function(e){for(var t=1,n=0;n=n.length)return n.length;var r=ut(n,i,!1);if(et(t.bytes,r.bytes))return i;var a=ut(n,i+r.length);return e(t,n,i+a.length+a.value+r.length)},dt=function e(t,n){n=function(e){return Array.isArray(e)?e.map((function(e){return lt(e)})):[lt(e)]}(n),t=Ye(t);var i=[];if(!n.length)return i;for(var r=0;rt.length?t.length:o+s.value,l=t.subarray(o,u);et(n[0],a.bytes)&&(1===n.length?i.push(l):i=i.concat(e(l,n.slice(1)))),r+=a.length+s.length+l.length}return i},ht=Ye([0,0,0,1]),pt=Ye([0,0,1]),ft=Ye([0,0,3]),mt=function(e){for(var t=[],n=1;n>1&63),-1!==n.indexOf(u)&&(r=a+o),a+=o+("h264"===t?1:2)}else a++}return e.subarray(0,0)},vt={webm:Ye([119,101,98,109]),matroska:Ye([109,97,116,114,111,115,107,97]),flac:Ye([102,76,97,67]),ogg:Ye([79,103,103,83]),ac3:Ye([11,119]),riff:Ye([82,73,70,70]),avi:Ye([65,86,73]),wav:Ye([87,65,86,69]),"3gp":Ye([102,116,121,112,51,103]),mp4:Ye([102,116,121,112]),fmp4:Ye([115,116,121,112]),mov:Ye([102,116,121,112,113,116]),moov:Ye([109,111,111,118]),moof:Ye([109,111,111,102])},yt={aac:function(e){var t=nt(e);return et(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=nt(e);return et(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=dt(e,[st.EBML,st.DocType])[0];return et(t,vt.webm)},mkv:function(e){var t=dt(e,[st.EBML,st.DocType])[0];return et(t,vt.matroska)},mp4:function(e){return!yt["3gp"](e)&&!yt.mov(e)&&(!(!et(e,vt.mp4,{offset:4})&&!et(e,vt.fmp4,{offset:4}))||!(!et(e,vt.moof,{offset:4})&&!et(e,vt.moov,{offset:4}))||void 0)},mov:function(e){return et(e,vt.mov,{offset:4})},"3gp":function(e){return et(e,vt["3gp"],{offset:4})},ac3:function(e){var t=nt(e);return et(e,vt.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];for(var t=0;t+1880?o:0)}if(g().console){var u=g().console[n];u||"debug"!==n||(u=g().console.info||g().console.log),u&&a&&s.test(n)&&u[Array.isArray(r)?"apply":"call"](g().console,r)}}}(t,r),r.createLogger=function(n){return e(t+": "+n)},r.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:i},r.level=function(e){if("string"==typeof e){if(!r.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');i=e}return i},(r.history=function(){return Dt?[].concat(Dt):[]}).filter=function(e){return(Dt||[]).filter((function(t){return new RegExp(".*"+e+".*").test(t[0])}))},r.history.clear=function(){Dt&&(Dt.length=0)},r.history.disable=function(){null!==Dt&&(Dt.length=0,Dt=null)},r.history.enable=function(){null===Dt&&(Dt=[])},r.error=function(){for(var e=arguments.length,t=new Array(e),r=0;r1?t-1:0),i=1;i=0)throw new Error("class has illegal whitespace characters")}function gn(){return y()===g().document}function vn(e){return Ft(e)&&1===e.nodeType}function yn(){try{return g().parent!==g().self}catch(e){return!0}}function _n(e){return function(t,n){if(!fn(t))return y()[e](null);fn(n)&&(n=y().querySelector(n));var i=vn(n)?n:y();return i[e]&&i[e](t)}}function bn(e,t,n,i){void 0===e&&(e="div"),void 0===t&&(t={}),void 0===n&&(n={});var r=y().createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){var n=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(Nt.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+"."),r.setAttribute(e,n)):"textContent"===e?Tn(r,n):r[e]===n&&"tabIndex"!==e||(r[e]=n)})),Object.getOwnPropertyNames(n).forEach((function(e){r.setAttribute(e,n[e])})),i&&Fn(r,i),r}function Tn(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function Sn(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function En(e,t){return mn(t),e.classList?e.classList.contains(t):(n=t,new RegExp("(^|\\s)"+n+"($|\\s)")).test(e.className);var n}function wn(e,t){return e.classList?e.classList.add(t):En(e,t)||(e.className=(e.className+" "+t).trim()),e}function Cn(e,t){return e?(e.classList?e.classList.remove(t):(mn(t),e.className=e.className.split(/\s+/).filter((function(e){return e!==t})).join(" ")),e):(Nt.warn("removeClass was called with an element that doesn't exist"),null)}function kn(e,t,n){var i=En(e,t);if("function"==typeof n&&(n=n(e,t)),"boolean"!=typeof n&&(n=!i),n!==i)return n?wn(e,t):Cn(e,t),e}function xn(e,t){Object.getOwnPropertyNames(t).forEach((function(n){var i=t[n];null==i||!1===i?e.removeAttribute(n):e.setAttribute(n,!0===i?"":i)}))}function In(e){var t={};if(e&&e.attributes&&e.attributes.length>0)for(var n=e.attributes,i=n.length-1;i>=0;i--){var r=n[i].name,a=n[i].value;"boolean"!=typeof e[r]&&-1===",autoplay,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+r+",")||(a=null!==a),t[r]=a}return t}function Pn(e,t){return e.getAttribute(t)}function An(e,t,n){e.setAttribute(t,n)}function On(e,t){e.removeAttribute(t)}function Ln(){y().body.focus(),y().onselectstart=function(){return!1}}function Dn(){y().onselectstart=function(){return!0}}function Nn(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(qt(e,"height"))),n.width||(n.width=parseFloat(qt(e,"width"))),n}}function Rn(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};for(var t=e.offsetWidth,n=e.offsetHeight,i=0,r=0;e.offsetParent&&e!==y()[It.fullscreenElement];)i+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;return{left:i,top:r,width:t,height:n}}function Mn(e,t){var n={x:0,y:0};if(dn)for(var i=e;i&&"html"!==i.nodeName.toLowerCase();){var r=qt(i,"transform");if(/^matrix/.test(r)){var a=r.slice(7,-1).split(/,\s/).map(Number);n.x+=a[4],n.y+=a[5]}else if(/^matrix3d/.test(r)){var s=r.slice(9,-1).split(/,\s/).map(Number);n.x+=s[12],n.y+=s[13]}i=i.parentNode}var o={},u=Rn(t.target),l=Rn(e),c=l.width,d=l.height,h=t.offsetY-(l.top-u.top),p=t.offsetX-(l.left-u.left);return t.changedTouches&&(p=t.changedTouches[0].pageX-l.left,h=t.changedTouches[0].pageY+l.top,dn&&(p-=n.x,h-=n.y)),o.y=1-Math.max(0,Math.min(1,h/d)),o.x=Math.max(0,Math.min(1,p/c)),o}function Un(e){return Ft(e)&&3===e.nodeType}function Bn(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function jn(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((function(e){return"function"==typeof e&&(e=e()),vn(e)||Un(e)?e:"string"==typeof e&&/\S/.test(e)?y().createTextNode(e):void 0})).filter((function(e){return e}))}function Fn(e,t){return jn(t).forEach((function(t){return e.appendChild(t)})),e}function Hn(e,t){return Fn(Bn(e),t)}function qn(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 Vn,Wn=_n("querySelector"),zn=_n("querySelectorAll"),Xn=Object.freeze({__proto__:null,isReal:gn,isEl:vn,isInFrame:yn,createEl:bn,textContent:Tn,prependTo:Sn,hasClass:En,addClass:wn,removeClass:Cn,toggleClass:kn,setAttributes:xn,getAttributes:In,getAttribute:Pn,setAttribute:An,removeAttribute:On,blockTextSelection:Ln,unblockTextSelection:Dn,getBoundingClientRect:Nn,findPosition:Rn,getPointerPosition:Mn,isTextNode:Un,emptyEl:Bn,normalizeContent:jn,appendContent:Fn,insertContent:Hn,isSingleLeftClick:qn,$:Wn,$$:zn}),Gn=!1,Kn=function(){if(!1!==Vn.options.autoSetup){var e=Array.prototype.slice.call(y().getElementsByTagName("video")),t=Array.prototype.slice.call(y().getElementsByTagName("audio")),n=Array.prototype.slice.call(y().getElementsByTagName("video-js")),i=e.concat(t,n);if(i&&i.length>0)for(var r=0,a=i.length;r-1&&(r={passive:!0}),e.addEventListener(t,i.dispatcher,r)}else e.attachEvent&&e.attachEvent("on"+t,i.dispatcher)}function li(e,t,n){if(ii.has(e)){var i=ii.get(e);if(i.handlers){if(Array.isArray(t))return ai(li,e,t,n);var r=function(e,t){i.handlers[t]=[],ri(e,t)};if(void 0!==t){var a=i.handlers[t];if(a)if(n){if(n.guid)for(var s=0;s=t&&(e.apply(void 0,arguments),n=i)}},yi=function(){};yi.prototype.allowedEvents_={},yi.prototype.on=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},ui(this,e,t),this.addEventListener=n},yi.prototype.addEventListener=yi.prototype.on,yi.prototype.off=function(e,t){li(this,e,t)},yi.prototype.removeEventListener=yi.prototype.off,yi.prototype.one=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},di(this,e,t),this.addEventListener=n},yi.prototype.any=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},hi(this,e,t),this.addEventListener=n},yi.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=si(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),ci(this,e)},yi.prototype.dispatchEvent=yi.prototype.trigger,yi.prototype.queueTrigger=function(e){var t=this;pi||(pi=new Map);var n=e.type||e,i=pi.get(this);i||(i=new Map,pi.set(this,i));var r=i.get(n);i.delete(n),g().clearTimeout(r);var a=g().setTimeout((function(){0===i.size&&(i=null,pi.delete(t)),t.trigger(e)}),0);i.set(n,a)};var _i=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},bi=function(e){return e instanceof yi||!!e.eventBusEl_&&["on","one","off","trigger"].every((function(t){return"function"==typeof e[t]}))},Ti=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},Si=function(e,t,n){if(!e||!e.nodeName&&!bi(e))throw new Error("Invalid target for "+_i(t)+"#"+n+"; must be a DOM node or evented object.")},Ei=function(e,t,n){if(!Ti(e))throw new Error("Invalid event type for "+_i(t)+"#"+n+"; must be a non-empty string or array.")},wi=function(e,t,n){if("function"!=typeof e)throw new Error("Invalid listener for "+_i(t)+"#"+n+"; must be a function.")},Ci=function(e,t,n){var i,r,a,s=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return s?(i=e.eventBusEl_,t.length>=3&&t.shift(),r=t[0],a=t[1]):(i=t[0],r=t[1],a=t[2]),Si(i,e,n),Ei(r,e,n),wi(a,e,n),{isTargetingSelf:s,target:i,type:r,listener:a=gi(e,a)}},ki=function(e,t,n,i){Si(e,e,t),e.nodeName?fi[t](e,n,i):e[t](n,i)},xi={on:function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i=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&&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_=Di(this.options_,e),this.options_):this.options_},t.el=function(){return this.el_},t.createEl=function(e,t,n){return bn(e,t,n)},t.localize=function(e,t,n){void 0===n&&(n=e);var i=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),a=r&&r[i],s=i&&i.split("-")[0],o=r&&r[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 i=t[n-1],r=i;return void 0===i&&(r=e),r}))),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=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_[Li(e.name())]=null,this.childNameIndex_[Oi(e.name())]=null;var i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},t.initChildren=function(){var t=this,n=this.options_.children;if(n){var i,r=this.options_,a=e.getComponent("Tech");(i=Array.isArray(n)?n:Object.keys(n)).concat(Object.keys(this.options_).filter((function(e){return!i.some((function(t){return"string"==typeof t?e===t:e===t.name}))}))).map((function(e){var i,r;return"string"==typeof e?r=n[i=e]||t.options_[i]||{}:(i=e.name,r=e),{name:i,opts:r}})).filter((function(t){var n=e.getComponent(t.opts.componentClass||Li(t.name));return n&&!a.isTech(n)})).forEach((function(e){var n=e.name,i=e.opts;if(void 0!==r[n]&&(i=r[n]),!1!==i){!0===i&&(i={}),i.playerOptions=t.options_.playerOptions;var a=t.addChild(n,i);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 Wn(e,t||this.contentEl())},t.$$=function(e,t){return zn(e,t||this.contentEl())},t.hasClass=function(e){return En(this.el_,e)},t.addClass=function(e){wn(this.el_,e)},t.removeClass=function(e){Cn(this.el_,e)},t.toggleClass=function(e,t){kn(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 Pn(this.el_,e)},t.setAttribute=function(e,t){An(this.el_,e,t)},t.removeAttribute=function(e){On(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 i=this.el_.style[e],r=i.indexOf("px");return-1!==r?parseInt(i.slice(0,r),10):parseInt(this.el_["offset"+Li(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=qt(this.el_,e),0===(t=parseFloat(t))||isNaN(t)){var n="offset"+Li(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_&&(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(i){1===i.touches.length&&(n={pageX:i.touches[0].pageX,pageY:i.touches[0].pageY},t=g().performance.now(),e=!0)})),this.on("touchmove",(function(t){if(t.touches.length>1)e=!1;else if(n){var i=t.touches[0].pageX-n.pageX,r=t.touches[0].pageY-n.pageY;Math.sqrt(i*i+r*r)>10&&(e=!1)}}));var i=function(){e=!1};this.on("touchleave",i),this.on("touchcancel",i),this.on("touchend",(function(i){n=null,!0===e&&g().performance.now()-t<200&&(i.preventDefault(),this.trigger("tap"))}))},t.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,t=gi(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,i=this;return e=gi(this,e),this.clearTimersOnDispose_(),n=g().setTimeout((function(){i.setTimeoutIds_.has(n)&&i.setTimeoutIds_.delete(n),e()}),t),this.setTimeoutIds_.add(n),n},t.clearTimeout=function(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),g().clearTimeout(e)),e},t.setInterval=function(e,t){e=gi(this,e),this.clearTimersOnDispose_();var n=g().setInterval(e,t);return this.setIntervalIds_.add(n),n},t.clearInterval=function(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),g().clearInterval(e)),e},t.requestAnimationFrame=function(e){var t,n=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),e=gi(this,e),t=g().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=gi(this,t);var i=this.requestAnimationFrame((function(){t(),n.namedRafs_.has(e)&&n.namedRafs_.delete(e)}));return this.namedRafs_.set(e,i),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),g().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],i=t[1];e[n].forEach((function(t,n){return e[i](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 i=e.getComponent("Tech"),r=i&&i.isTech(n),a=e===n||e.prototype.isPrototypeOf(n.prototype);if(r||!a)throw new Error('Illegal component, "'+t+'"; '+(r?"techs must be registered using Tech.registerTech()":"must be a Component subclass")+".");t=Li(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_[Oi(t)]=n,n},e.getComponent=function(t){if(t&&e.components_)return e.components_[t]},e}();function ji(e,t,n,i){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,i,n.length-1),n[i][t]}function Fi(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:ji.bind(null,"start",0,e),end:ji.bind(null,"end",1,e)},g().Symbol&&g().Symbol.iterator&&(t[g().Symbol.iterator]=function(){return(e||[]).values()}),t}function Hi(e,t){return Array.isArray(e)?Fi(e):void 0===e||void 0===t?Fi():Fi([[e,t]])}function qi(e,t){var n,i,r=0;if(!t)return 0;e&&e.length||(e=Hi(0,0));for(var a=0;at&&(i=t),r+=i-n;return r/t}function Vi(e){if(e instanceof Vi)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:Ft(e)&&("number"==typeof e.code&&(this.code=e.code),jt(this,e)),this.message||(this.message=Vi.defaultMessages[this.code]||"")}Bi.prototype.supportsRaf_="function"==typeof g().requestAnimationFrame&&"function"==typeof g().cancelAnimationFrame,Bi.registerComponent("Component",Bi),Vi.prototype.code=0,Vi.prototype.message="",Vi.prototype.status=null,Vi.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Vi.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 Wi=0;Wi=0;i--)if(t[i].enabled){$i(t,t[i]);break}return(n=e.call(this,t)||this).changing_=!1,n}S(t,e);var n=t.prototype;return n.addTrack=function(t){var n=this;t.enabled&&$i(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.enabledChange_=function(){n.changing_||(n.changing_=!0,$i(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}(Yi),Ji=function(e,t){for(var n=0;n=0;i--)if(t[i].selected){Ji(t,t[i]);break}return(n=e.call(this,t)||this).changing_=!1,Object.defineProperty(b(n),"selectedIndex",{get:function(){for(var e=0;e0&&(g().console&&g().console.groupCollapsed&&g().console.groupCollapsed("Text Track parsing errors for "+t.src),i.forEach((function(e){return Nt.error(e)})),g().console&&g().console.groupEnd&&g().console.groupEnd()),n.flush()},mr=function(e,t){var n={uri:e},i=hr(e);i&&(n.cors=i);var r="use-credentials"===t.tech_.crossOrigin();r&&(n.withCredentials=r),I()(n,gi(this,(function(e,n,i){if(e)return Nt.error(e,n);t.loaded_=!0,"function"!=typeof g().WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],(function(e){if("vttjserror"!==e.type)return fr(i,t);Nt.error("vttjs failed to load, stopping trying to process "+t.src)})):fr(i,t)})))},gr=function(e){function t(t){var n;if(void 0===t&&(t={}),!t.tech)throw new Error("A tech was not provided.");var i=Di(t,{kind:sr[t.kind]||"subtitles",language:t.language||t.srclang||""}),r=or[i.mode]||"disabled",a=i.default;"metadata"!==i.kind&&"chapters"!==i.kind||(r="hidden"),(n=e.call(this,i)||this).tech_=i.tech,n.cues_=[],n.activeCues_=[],n.preload_=!1!==n.tech_.preloadTextTracks;var s=new ir(n.cues_),o=new ir(n.activeCues_),u=!1,l=gi(b(n),(function(){this.tech_.isReady_&&!this.tech_.isDisposed()&&(this.activeCues=this.activeCues,u&&(this.trigger("cuechange"),u=!1))}));return n.tech_.one("dispose",(function(){n.tech_.off("timeupdate",l)})),"disabled"!==r&&n.tech_.on("timeupdate",l),Object.defineProperties(b(n),{default:{get:function(){return a},set:function(){}},mode:{get:function(){return r},set:function(e){or[e]&&r!==e&&(r=e,this.preload_||"disabled"===r||0!==this.cues.length||mr(this.src,this),this.tech_.off("timeupdate",l),"disabled"!==r&&this.tech_.on("timeupdate",l),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,i=this.cues.length;n=e||r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e)&&t.push(r)}if(u=!1,t.length!==this.activeCues_.length)u=!0;else for(var a=0;a0)return void this.trigger("vttjsloaded");var t=y().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})),g().WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)},n.emulateTextTracks=function(){var e=this,t=this.textTracks(),n=this.remoteTextTracks(),i=function(e){return t.addTrack(e.track)},r=function(e){return t.removeTrack(e.track)};n.on("addtrack",i),n.on("removetrack",r),this.addWebVttScript_();var a=function(){return e.trigger("texttrackchange")},s=function(){a();for(var e=0;e=0;r--){var a=e[r];a[t]&&a[t](i,n)}}(e,n,o,s),o}var Pr={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},Ar={setCurrentTime:1,setMuted:1,setVolume:1},Or={play:1,pause:1};function Lr(e){return function(t,n){return t===kr?kr:n[e]?n[e](t):t}}function Dr(e,t,n,i,r,a){void 0===e&&(e={}),void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===a&&(a=!1);var s=t,o=s[0],u=s.slice(1);if("string"==typeof o)Dr(e,wr[o],n,i,r,a);else if(o){var l=function(e,t){var n=Cr[e.id()],i=null;if(null==n)return i=t(e),Cr[e.id()]=[[t,i]],i;for(var r=0;r0;!this.player_.tech(!0)||(an||tn)&&t||this.player_.tech(!0).focus(),this.player_.paused()?Xi(this.player_.play()):this.player_.pause()}},t}(jr);Bi.registerComponent("PosterImage",Fr);var Hr={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 qr(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 Vr(e,t,n){try{e.style[t]=n}catch(e){return}}var Wr=function(e){function t(t,n,i){var r;r=e.call(this,t,n,i)||this;var a=function(e){return r.updateDisplay(e)};return t.on("loadstart",(function(e){return r.toggleDisplay(e)})),t.on("texttrackchange",a),t.on("loadedmetadata",(function(e){return r.preselectTrack(e)})),t.ready(gi(b(r),(function(){if(t.tech_&&t.tech_.featuresNativeTextTracks)this.hide();else{t.on("fullscreenchange",a),t.on("playerresize",a),g().addEventListener("orientationchange",a),t.on("dispose",(function(){return g().removeEventListener("orientationchange",a)}));for(var e=this.options_.playerOptions.tracks||[],n=0;n0;return Xi(t),void(!this.player_.tech(!0)||(an||tn)&&n||this.player_.tech(!0).focus())}var i=this.player_.getChild("controlBar"),r=i&&i.getChild("playToggle");if(r){var a=function(){return r.focus()};zi(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}(Xr);Gr.prototype.controlText_="Play Video",Bi.registerComponent("BigPlayButton",Gr);var Kr=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).controlText(n&&n.controlText||i.localize("Close")),i}S(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){k().isEventKey(t,"Esc")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},t}(Xr);Bi.registerComponent("CloseButton",Kr);var Yr=function(e){function t(t,n){var i;return void 0===n&&(n={}),i=e.call(this,t,n)||this,n.replay=void 0===n.replay||n.replay,i.on(t,"play",(function(e){return i.handlePlay(e)})),i.on(t,"pause",(function(e){return i.handlePause(e)})),n.replay&&i.on(t,"ended",(function(e){return i.handleEnded(e)})),i}S(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()?Xi(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}(Xr);Yr.prototype.controlText_="Play",Bi.registerComponent("PlayToggle",Yr);var Qr=function(e,t){e=e<0?0:e;var n=Math.floor(e%60),i=Math.floor(e/60%60),r=Math.floor(e/3600),a=Math.floor(t/60%60),s=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=i=n="-"),(r=r>0||s>0?r+":":"")+(i=((r||a>=10)&&i<10?"0"+i:i)+":")+(n<10?"0"+n:n)},$r=Qr;function Zr(e,t){return void 0===t&&(t=e),$r(e,t)}var Jr=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).on(t,["timeupdate","ended"],(function(e){return i.updateContent(e)})),i.updateTextNode_(),i}S(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"}),i=bn("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+" "},{role:"presentation"});return n.appendChild(i),this.contentEl_=bn("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=Zr(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,Nt.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_=y().createTextNode(t.formattedTime_),t.textNode_&&(e?t.contentEl_.replaceChild(t.textNode_,e):t.contentEl_.appendChild(t.textNode_))}})))},n.updateContent=function(e){},t}(Bi);Jr.prototype.labelText_="Time",Jr.prototype.controlText_="Time",Bi.registerComponent("TimeDisplay",Jr);var ea=function(e){function t(){return e.apply(this,arguments)||this}S(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}(Jr);ea.prototype.labelText_="Current Time",ea.prototype.controlText_="Current Time",Bi.registerComponent("CurrentTimeDisplay",ea);var ta=function(e){function t(t,n){var i,r=function(e){return i.updateContent(e)};return(i=e.call(this,t,n)||this).on(t,"durationchange",r),i.on(t,"loadstart",r),i.on(t,"loadedmetadata",r),i}S(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}(Jr);ta.prototype.labelText_="Duration",ta.prototype.controlText_="Duration",Bi.registerComponent("DurationDisplay",ta);var na=function(e){function t(){return e.apply(this,arguments)||this}return S(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"),i=e.prototype.createEl.call(this,"span",{textContent:"/"});return n.appendChild(i),t.appendChild(n),t},t}(Bi);Bi.registerComponent("TimeDivider",na);var ia=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).on(t,"durationchange",(function(e){return i.updateContent(e)})),i}S(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 t.insertBefore(bn("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}(Jr);ia.prototype.labelText_="Remaining Time",ia.prototype.controlText_="Remaining Time",Bi.registerComponent("RemainingTimeDisplay",ia);var ra=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).updateShowing(),i.on(i.player(),"durationchange",(function(e){return i.updateShowing(e)})),i}S(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_=bn("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(bn("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+" "})),this.contentEl_.appendChild(y().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}(Bi);Bi.registerComponent("LiveDisplay",ra);var aa=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).updateLiveEdgeStatus(),i.player_.liveTracker&&(i.updateLiveEdgeStatusHandler_=function(e){return i.updateLiveEdgeStatus(e)},i.on(i.player_.liveTracker,"liveedgechange",i.updateLiveEdgeStatusHandler_)),i}S(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_=bn("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}(Xr);aa.prototype.controlText_="Seek to live, currently playing live",Bi.registerComponent("SeekToLive",aa);var sa=function(e,t,n){return e=Number(e),Math.min(n,Math.max(t,isNaN(e)?t:e))},oa=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).handleMouseDown_=function(e){return i.handleMouseDown(e)},i.handleMouseUp_=function(e){return i.handleMouseUp(e)},i.handleKeyDown_=function(e){return i.handleKeyDown(e)},i.handleClick_=function(e){return i.handleClick(e)},i.handleMouseMove_=function(e){return i.handleMouseMove(e)},i.update_=function(e){return i.update(e)},i.bar=i.getChild(i.options_.barName),i.vertical(!!i.options_.vertical),i.enable(),i}S(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,i){return void 0===n&&(n={}),void 0===i&&(i={}),n.className=n.className+" vjs-slider",n=jt({tabIndex:0},n),i=jt({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},i),e.prototype.createEl.call(this,t,n,i)},n.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||nn||e.preventDefault(),Ln(),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)},n.handleMouseMove=function(e){},n.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;Dn(),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(sa(this.getPercent(),0,1).toFixed(4))},n.calculateDistance=function(e){var t=Mn(this.el_,e);return this.vertical()?t.y:t.x},n.handleKeyDown=function(t){k().isEventKey(t,"Left")||k().isEventKey(t,"Down")?(t.preventDefault(),t.stopPropagation(),this.stepBack()):k().isEventKey(t,"Right")||k().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}(Bi);Bi.registerComponent("Slider",oa);var ua=function(e,t){return sa(e/t*100,0,100).toFixed(2)+"%"},la=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).partEls_=[],i.on(t,"progress",(function(e){return i.update(e)})),i}S(t,e);var n=t.prototype;return n.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),n=bn("span",{className:"vjs-control-text"}),i=bn("span",{textContent:this.localize("Loaded")}),r=y().createTextNode(": ");return this.percentageEl_=bn("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),t.appendChild(n),n.appendChild(i),n.appendChild(r),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(),i=e&&e.isLive()?e.seekableEnd():t.player_.duration(),r=t.player_.bufferedEnd(),a=t.partEls_,s=ua(r,i);t.percent_!==s&&(t.el_.style.width=s,Tn(t.percentageEl_,s),t.percent_=s);for(var o=0;on.length;d--)t.el_.removeChild(a[d-1]);a.length=n.length}))},t}(Bi);Bi.registerComponent("LoadProgressBar",la);var ca=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).update=vi(gi(b(i),i.update),mi),i}S(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 i=Rn(this.el_),r=Nn(this.player_.el()),a=e.width*t;if(r&&i){var s=e.left-r.left+a,o=e.width-a+(r.right-e.right),u=i.width/2;si.width&&(u=i.width),u=Math.round(u),this.el_.style.right="-"+u+"px",this.write(n)}},n.write=function(e){Tn(this.el_,e)},n.updateTime=function(e,t,n,i){var r=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",(function(){var a,s=r.player_.duration();if(r.player_.liveTracker&&r.player_.liveTracker.isLive()){var o=r.player_.liveTracker.liveWindow(),u=o-t*o;a=(u<1?"":"-")+Zr(u,o)}else a=Zr(n,s);r.update(e,t,a),i&&i()}))},t}(Bi);Bi.registerComponent("TimeTooltip",ca);var da=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).update=vi(gi(b(i),i.update),mi),i}S(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 i=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();n.updateTime(e,t,i)}},t}(Bi);da.prototype.options_={children:[]},dn||$t||da.prototype.options_.children.push("timeTooltip"),Bi.registerComponent("PlayProgressBar",da);var ha=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).update=vi(gi(b(i),i.update),mi),i}S(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,i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,(function(){n.el_.style.left=e.width*t+"px"}))},t}(Bi);ha.prototype.options_={children:["timeTooltip"]},Bi.registerComponent("MouseTimeDisplay",ha);var pa=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).setEventHandlers_(),i}S(t,e);var n=t.prototype;return n.setEventHandlers_=function(){var e=this;this.update_=gi(this,this.update),this.update=vi(this.update_,mi),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 y()&&"visibilityState"in y()&&this.on(y(),"visibilitychange",this.toggleVisibility_)},n.toggleVisibility_=function(e){"hidden"===y().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,mi))},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"!==y().visibilityState){var i=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,r=n.player_.duration();t&&t.isLive()&&(r=n.player_.liveTracker.liveCurrentTime()),n.percent_!==i&&(n.el_.setAttribute("aria-valuenow",(100*i).toFixed(2)),n.percent_=i),n.currentTime_===e&&n.duration_===r||(n.el_.setAttribute("aria-valuetext",n.localize("progress bar timing: currentTime={1} duration={2}",[Zr(e,r),Zr(r,r)],"{1} of {2}")),n.currentTime_=e,n.duration_=r),n.bar&&n.bar.update(Nn(n.el()),n.getProgress())})),i}},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){qn(t)&&(t.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},n.handleMouseMove=function(e){if(qn(e)){var t,n=this.calculateDistance(e),i=this.player_.liveTracker;if(i&&i.isLive()){if(n>=.99)return void i.seekToLiveEdge();var r=i.seekableStart(),a=i.liveCurrentTime();if((t=r+n*i.liveWindow())>=a&&(t=a),t<=r&&(t=r+.1),t===1/0)return}else(t=n*this.player_.duration())===this.player_.duration()&&(t-=.1);this.userSeek_(t)}},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?Xi(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(k().isEventKey(t,"Space")||k().isEventKey(t,"Enter"))t.preventDefault(),t.stopPropagation(),this.handleAction(t);else if(k().isEventKey(t,"Home"))t.preventDefault(),t.stopPropagation(),this.userSeek_(0);else if(k().isEventKey(t,"End"))t.preventDefault(),t.stopPropagation(),n&&n.isLive()?this.userSeek_(n.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(k()(t))){t.preventDefault(),t.stopPropagation();var i=10*(k().codes[k()(t)]-k().codes[0])/100;n&&n.isLive()?this.userSeek_(n.seekableStart()+n.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}else k().isEventKey(t,"PgDn")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):k().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 y()&&"visibilityState"in y()&&this.off(y(),"visibilitychange",this.toggleVisibility_),e.prototype.dispose.call(this)},t}(oa);pa.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},dn||$t||pa.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),Bi.registerComponent("SeekBar",pa);var fa=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).handleMouseMove=vi(gi(b(i),i.handleMouseMove),mi),i.throttledHandleMouseSeek=vi(gi(b(i),i.handleMouseSeek),mi),i.handleMouseUpHandler_=function(e){return i.handleMouseUp(e)},i.handleMouseDownHandler_=function(e){return i.handleMouseDown(e)},i.enable(),i}S(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"),i=t.getChild("mouseTimeDisplay");if(n||i){var r=t.el(),a=Rn(r),s=Mn(r,e).x;s=sa(s,0,1),i&&i.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&&Xi(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}(Bi);fa.prototype.options_={children:["seekBar"]},Bi.registerComponent("ProgressControl",fa);var ma=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).on(t,["enterpictureinpicture","leavepictureinpicture"],(function(e){return i.handlePictureInPictureChange(e)})),i.on(t,["disablepictureinpicturechanged","loadedmetadata"],(function(e){return i.handlePictureInPictureEnabledChange(e)})),i.disable(),i}S(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-picture-in-picture-control "+e.prototype.buildCSSClass.call(this)},n.handlePictureInPictureEnabledChange=function(){y().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}(Xr);ma.prototype.controlText_="Picture-in-Picture",Bi.registerComponent("PictureInPictureToggle",ma);var ga=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).on(t,"fullscreenchange",(function(e){return i.handleFullscreenChange(e)})),!1===y()[t.fsApi_.fullscreenEnabled]&&i.disable(),i}S(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}(Xr);ga.prototype.controlText_="Fullscreen",Bi.registerComponent("FullscreenToggle",ga);var va=function(e){function t(){return e.apply(this,arguments)||this}return S(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}(Bi);Bi.registerComponent("VolumeLevel",va);var ya=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).update=vi(gi(b(i),i.update),mi),i}S(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,i){if(!n){var r=Nn(this.el_),a=Nn(this.player_.el()),s=e.width*t;if(!a||!r)return;var o=e.left-a.left+s,u=e.width-s+(a.right-e.right),l=r.width/2;or.width&&(l=r.width),this.el_.style.right="-"+l+"px"}this.write(i+"%")},n.write=function(e){Tn(this.el_,e)},n.updateVolume=function(e,t,n,i,r){var a=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",(function(){a.update(e,t,n,i.toFixed(0)),r&&r()}))},t}(Bi);Bi.registerComponent("VolumeLevelTooltip",ya);var _a=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).update=vi(gi(b(i),i.update),mi),i}S(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 i=this,r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,n,r,(function(){n?i.el_.style.bottom=e.height*t+"px":i.el_.style.left=e.width*t+"px"}))},t}(Bi);_a.prototype.options_={children:["volumeLevelTooltip"]},Bi.registerComponent("MouseVolumeLevelDisplay",_a);var ba=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).on("slideractive",(function(e){return i.updateLastVolume_(e)})),i.on(t,"volumechange",(function(e){return i.updateARIAAttributes(e)})),t.ready((function(){return i.updateARIAAttributes()})),i}S(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){qn(t)&&e.prototype.handleMouseDown.call(this,t)},n.handleMouseMove=function(e){var t=this.getChild("mouseVolumeLevelDisplay");if(t){var n=this.el(),i=Nn(n),r=this.vertical(),a=Mn(n,e);a=r?a.y:a.x,a=sa(a,0,1),t.update(i,a,r)}qn(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}(oa);ba.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},dn||$t||ba.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),ba.prototype.playerEvent="volumechange",Bi.registerComponent("VolumeBar",ba);var Ta=function(e){function t(t,n){var i;return void 0===n&&(n={}),n.vertical=n.vertical||!1,(void 0===n.volumeBar||Ht(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")}))}(b(i=e.call(this,t,n)||this),t),i.throttledHandleMouseMove=vi(gi(b(i),i.handleMouseMove),mi),i.handleMouseUpHandler_=function(e){return i.handleMouseUp(e)},i.on("mousedown",(function(e){return i.handleMouseDown(e)})),i.on("touchstart",(function(e){return i.handleMouseDown(e)})),i.on("mousemove",(function(e){return i.handleMouseMove(e)})),i.on(i.volumeBar,["focus","slideractive"],(function(){i.volumeBar.addClass("vjs-slider-active"),i.addClass("vjs-slider-active"),i.trigger("slideractive")})),i.on(i.volumeBar,["blur","sliderinactive"],(function(){i.volumeBar.removeClass("vjs-slider-active"),i.removeClass("vjs-slider-active"),i.trigger("sliderinactive")})),i}S(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}(Bi);Ta.prototype.options_={children:["volumeBar"]},Bi.registerComponent("VolumeControl",Ta);var Sa=function(e){function t(t,n){var i;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")}))}(b(i=e.call(this,t,n)||this),t),i.on(t,["loadstart","volumechange"],(function(e){return i.update(e)})),i}S(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 i=n<.1?.1:n;this.player_.volume(i),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;dn&&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++)Cn(this.el_,"vjs-vol-"+n);wn(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}(Xr);Sa.prototype.controlText_="Mute",Bi.registerComponent("MuteToggle",Sa);var Ea=function(e){function t(t,n){var i;return void 0===n&&(n={}),void 0!==n.inline?n.inline=n.inline:n.inline=!0,(void 0===n.volumeControl||Ht(n.volumeControl))&&(n.volumeControl=n.volumeControl||{},n.volumeControl.vertical=!n.inline),(i=e.call(this,t,n)||this).handleKeyPressHandler_=function(e){return i.handleKeyPress(e)},i.on(t,["loadstart"],(function(e){return i.volumePanelState_(e)})),i.on(i.muteToggle,"keyup",(function(e){return i.handleKeyPress(e)})),i.on(i.volumeControl,"keyup",(function(e){return i.handleVolumeControlKeyUp(e)})),i.on("keydown",(function(e){return i.handleKeyPress(e)})),i.on("mouseover",(function(e){return i.handleMouseOver(e)})),i.on("mouseout",(function(e){return i.handleMouseOut(e)})),i.on(i.volumeControl,["slideractive"],i.sliderActive_),i.on(i.volumeControl,["sliderinactive"],i.sliderInactive_),i}S(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){k().isEventKey(e,"Esc")&&this.muteToggle.focus()},n.handleMouseOver=function(e){this.addClass("vjs-hover"),ui(y(),"keyup",this.handleKeyPressHandler_)},n.handleMouseOut=function(e){this.removeClass("vjs-hover"),li(y(),"keyup",this.handleKeyPressHandler_)},n.handleKeyPress=function(e){k().isEventKey(e,"Esc")&&this.handleMouseOut()},t}(Bi);Ea.prototype.options_={children:["muteToggle","volumeControl"]},Bi.registerComponent("VolumePanel",Ea);var wa=function(e){function t(t,n){var i;return i=e.call(this,t,n)||this,n&&(i.menuButton_=n.menuButton),i.focusedChild_=-1,i.on("keydown",(function(e){return i.handleKeyDown(e)})),i.boundHandleBlur_=function(e){return i.handleBlur(e)},i.boundHandleTapClick_=function(e){return i.handleTapClick(e)},i}S(t,e);var n=t.prototype;return n.addEventListenerForItem=function(e){e instanceof Bi&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},n.removeEventListenerForItem=function(e){e instanceof Bi&&(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_=bn(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_),ui(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||y().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){k().isEventKey(e,"Left")||k().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(k().isEventKey(e,"Right")||k().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}(Bi);Bi.registerComponent("Menu",wa);var Ca=function(e){function t(t,n){var i;void 0===n&&(n={}),(i=e.call(this,t,n)||this).menuButton_=new Xr(t,n),i.menuButton_.controlText(i.controlText_),i.menuButton_.el_.setAttribute("aria-haspopup","true");var r=Xr.prototype.buildCSSClass();i.menuButton_.el_.className=i.buildCSSClass()+" "+r,i.menuButton_.removeClass("vjs-control"),i.addChild(i.menuButton_),i.update(),i.enabled_=!0;var a=function(e){return i.handleClick(e)};return i.handleMenuKeyUp_=function(e){return i.handleMenuKeyUp(e)},i.on(i.menuButton_,"tap",a),i.on(i.menuButton_,"click",a),i.on(i.menuButton_,"keydown",(function(e){return i.handleKeyDown(e)})),i.on(i.menuButton_,"mouseenter",(function(){i.addClass("vjs-hover"),i.menu.show(),ui(y(),"keyup",i.handleMenuKeyUp_)})),i.on("mouseleave",(function(e){return i.handleMouseLeave(e)})),i.on("keydown",(function(e){return i.handleSubmenuKeyDown(e)})),i}S(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.show()},n.createMenu=function(){var e=new wa(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=bn("li",{className:"vjs-menu-title",textContent:Li(this.options_.title),tabIndex:-1}),n=new Bi(this.player_,{el:t});e.addItem(n)}if(this.items=this.createItems(),this.items)for(var i=0;i-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,i=0,r=t.length;i-1&&"showing"===a.mode){n=!1;break}}n&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(Pa);Bi.registerComponent("OffTextTrackMenuItem",Aa);var Oa=function(e){function t(t,n){return void 0===n&&(n={}),n.tracks=t.textTracks(),e.call(this,t,n)||this}return S(t,e),t.prototype.createItems=function(e,t){var n;void 0===e&&(e=[]),void 0===t&&(t=Pa),this.label_&&(n=this.label_+" off"),e.push(new Aa(this.player_,{kinds:this.kinds_,kind:this.kind_,label:n})),this.hideThreshold_+=1;var i=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var r=0;r-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}(ka);Bi.registerComponent("TextTrackButton",Oa);var La=function(e){function t(t,n){var i,r=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=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(Li(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,i=t.length;n-1&&(i.label_="captions"),i.menuButton_.controlText(Li(i.label_)),i}S(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,Ba)},t}(Oa);ja.prototype.kinds_=["captions","subtitles"],ja.prototype.controlText_="Subtitles",Bi.registerComponent("SubsCapsButton",ja);var Fa=function(e){function t(t,n){var i,r=n.track,a=t.audioTracks();n.label=r.label||r.language||"Unknown",n.selected=r.enabled,(i=e.call(this,t,n)||this).track=r,i.addClass("vjs-"+r.kind+"-menu-item");var s=function(){for(var e=arguments.length,t=new Array(e),n=0;n=0;n--)t.push(new qa(this.player(),{rate:e[n]+"x"}));return t},n.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},n.handleClick=function(e){for(var t=this.player().playbackRate(),n=this.playbackRates(),i=n[0],r=0;rt){i=n[r];break}this.player().playbackRate(i)},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}(Ca);Va.prototype.controlText_="Playback Rate",Bi.registerComponent("PlaybackRateMenuButton",Va);var Wa=function(e){function t(){return e.apply(this,arguments)||this}S(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},n.createEl=function(t,n,i){return void 0===t&&(t="div"),void 0===n&&(n={}),void 0===i&&(i={}),n.className||(n.className=this.buildCSSClass()),e.prototype.createEl.call(this,t,n,i)},t}(Bi);Bi.registerComponent("Spacer",Wa);var za=function(e){function t(){return e.apply(this,arguments)||this}S(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}(Wa);Bi.registerComponent("CustomControlSpacer",za);var Xa=function(e){function t(){return e.apply(this,arguments)||this}return S(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(Bi);Xa.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in y()&&Xa.prototype.options_.children.splice(Xa.prototype.options_.children.length-1,0,"pictureInPictureToggle"),Bi.registerComponent("ControlBar",Xa);var Ga=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).on(t,"error",(function(e){return i.open(e)})),i}S(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}(Ki);Ga.prototype.options_=_({},Ki.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Bi.registerComponent("ErrorDisplay",Ga);var Ka="vjs-text-track-settings",Ya=["#000","Black"],Qa=["#00F","Blue"],$a=["#0FF","Cyan"],Za=["#0F0","Green"],Ja=["#F0F","Magenta"],es=["#F00","Red"],ts=["#FFF","White"],ns=["#FF0","Yellow"],is=["1","Opaque"],rs=["0.5","Semi-Transparent"],as=["0","Transparent"],ss={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Ya,ts,es,Za,Qa,ns,Ja,$a]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[is,rs,as]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[ts,Ya,es,Za,Qa,ns,Ja,$a]},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:[is,rs]},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:[as,rs,is]}};function os(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}ss.windowColor.options=ss.backgroundColor.options;var us=function(e){function t(t,n){var i;return n.temporary=!1,(i=e.call(this,t,n)||this).updateDisplay=i.updateDisplay.bind(b(i)),i.fill(),i.hasBeenOpened_=i.hasBeenFilled_=!0,i.endDialog=bn("p",{className:"vjs-control-text",textContent:i.localize("End of dialog window.")}),i.el().appendChild(i.endDialog),i.setDefaults(),void 0===n.persistTextTrackSettings&&(i.options_.persistTextTrackSettings=i.options_.playerOptions.persistTextTrackSettings),i.on(i.$(".vjs-done-button"),"click",(function(){i.saveSettings(),i.close()})),i.on(i.$(".vjs-default-button"),"click",(function(){i.setDefaults(),i.updateDisplay()})),Bt(ss,(function(e){i.on(i.$(e.selector),"change",i.updateDisplay)})),i.options_.persistTextTrackSettings&&i.restoreSettings(),i}S(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 i=this;void 0===t&&(t=""),void 0===n&&(n="label");var r=ss[e],a=r.id.replace("%s",this.id_),s=[t,a].join(" ").trim();return["<"+n+' id="'+a+'" class="'+("label"===n?"vjs-label":"")+'">',this.localize(r.label),"",'").join("")},n.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['
','',this.localize("Text"),"",this.createElSelect_("color",e),'',this.createElSelect_("textOpacity",e),"","
"].join("")},n.createElBgColor_=function(){var e="captions-background-"+this.id_;return['
','',this.localize("Background"),"",this.createElSelect_("backgroundColor",e),'',this.createElSelect_("backgroundOpacity",e),"","
"].join("")},n.createElWinColor_=function(){var e="captions-window-"+this.id_;return['
','',this.localize("Window"),"",this.createElSelect_("windowColor",e),'',this.createElSelect_("windowOpacity",e),"","
"].join("")},n.createElColors_=function(){return bn("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},n.createElFont_=function(){return bn("div",{className:"vjs-track-settings-font",innerHTML:['
',this.createElSelect_("fontPercent","","legend"),"
",'
',this.createElSelect_("edgeStyle","","legend"),"
",'
',this.createElSelect_("fontFamily","","legend"),"
"].join("")})},n.createElControls_=function(){var e=this.localize("restore all settings to the default values");return bn("div",{className:"vjs-track-settings-controls",innerHTML:['",'"].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,i=this;return t=function(e,t,n){var r,a,s=(r=i.$(t.selector),a=t.parser,os(r.options[r.options.selectedIndex].value,a));return void 0!==s&&(e[n]=s),e},void 0===(n={})&&(n=0),Ut(e=ss).reduce((function(n,i){return t(n,e[i],i)}),n)},n.setValues=function(e){var t=this;Bt(ss,(function(n,i){!function(e,t,n){if(t)for(var i=0;ithis.options_.liveTolerance;this.timeupdateSeen_&&i!==1/0||(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,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_,mi),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(y(),"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),e.prototype.dispose.call(this)},t}(Bi);Bi.registerComponent("LiveTracker",ds);var hs,ps=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var n=e.$$("source"),i=[],r="";if(!n.length)return!1;for(var a=0;a=2&&r.push("loadeddata"),e.readyState>=3&&r.push("canplay"),e.readyState>=4&&r.push("canplaythrough"),this.ready((function(){r.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&&hn?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){Nt(e,"Video is not ready. (Video.js)")}},n.duration=function(){var e=this;return this.el_.duration===1/0&&$t&&nn&&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})},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=g().navigator&&g().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)Xi(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.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,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,n,i):e.prototype.addTextTrack.call(this,t,n,i)},n.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t);var n=y().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 i=e.prototype.addRemoteTextTrack.call(this,t,n);return this.featuresNativeTextTracks&&this.el().appendChild(i),i},n.removeRemoteTextTrack=function(t){if(e.prototype.removeRemoteTextTrack.call(this,t),this.featuresNativeTextTracks)for(var n=this.$$("track"),i=n.length;i--;)t!==n[i]&&t!==n[i].track||this.el().removeChild(n[i])},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),g().performance&&"function"==typeof g().performance.now?e.creationTime=g().performance.now():g().performance&&g().performance.timing&&"number"==typeof g().performance.timing.navigationStart&&(e.creationTime=g().Date.now()-g().performance.timing.navigationStart),e},t}(Er);ys(_s,"TEST_VID",(function(){if(gn()){var e=y().createElement("video"),t=y().createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e}})),_s.isSupported=function(){try{_s.TEST_VID.volume=.5}catch(e){return!1}return!(!_s.TEST_VID||!_s.TEST_VID.canPlayType)},_s.canPlayType=function(e){return _s.TEST_VID.canPlayType(e)},_s.canPlaySource=function(e,t){return _s.canPlayType(e.type)},_s.canControlVolume=function(){try{var e=_s.TEST_VID.volume;return _s.TEST_VID.volume=e/2+.1,e!==_s.TEST_VID.volume}catch(e){return!1}},_s.canMuteVolume=function(){try{var e=_s.TEST_VID.muted;return _s.TEST_VID.muted=!e,_s.TEST_VID.muted?An(_s.TEST_VID,"muted","muted"):On(_s.TEST_VID,"muted"),e!==_s.TEST_VID.muted}catch(e){return!1}},_s.canControlPlaybackRate=function(){if($t&&nn&&rn<58)return!1;try{var e=_s.TEST_VID.playbackRate;return _s.TEST_VID.playbackRate=e/2+.1,e!==_s.TEST_VID.playbackRate}catch(e){return!1}},_s.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(y().createElement("video"),"src",{get:e,set:e}),Object.defineProperty(y().createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(y().createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(y().createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},_s.supportsNativeTextTracks=function(){return hn||dn&&nn},_s.supportsNativeVideoTracks=function(){return!(!_s.TEST_VID||!_s.TEST_VID.videoTracks)},_s.supportsNativeAudioTracks=function(){return!(!_s.TEST_VID||!_s.TEST_VID.audioTracks)},_s.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresVolumeControl","canControlVolume"],["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach((function(e){var t=e[0],n=e[1];ys(_s.prototype,t,(function(){return _s[n]()}),!0)})),_s.prototype.movingMediaElementInDOM=!dn,_s.prototype.featuresFullscreenResize=!0,_s.prototype.featuresProgressEvents=!0,_s.prototype.featuresTimeupdateEvents=!0,_s.patchCanPlayType=function(){Zt>=4&&!en&&!nn&&(hs=_s.TEST_VID&&_s.TEST_VID.constructor.prototype.canPlayType,_s.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(e)?"maybe":hs.call(this,e)})},_s.unpatchCanPlayType=function(){var e=_s.TEST_VID.constructor.prototype.canPlayType;return hs&&(_s.TEST_VID.constructor.prototype.canPlayType=hs),e},_s.patchCanPlayType(),_s.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){}}()}},_s.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){_s.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){_s.prototype["set"+Li(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){_s.prototype[e]=function(){return this.el_[e]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach((function(e){_s.prototype["set"+Li(e)]=function(t){this.el_[e]=t}})),["pause","load","play"].forEach((function(e){_s.prototype[e]=function(){return this.el_[e]()}})),Er.withSourceHandlers(_s),_s.nativeSourceHandler={},_s.nativeSourceHandler.canPlayType=function(e){try{return _s.TEST_VID.canPlayType(e)}catch(e){return""}},_s.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return _s.nativeSourceHandler.canPlayType(e.type);if(e.src){var n=dr(e.src);return _s.nativeSourceHandler.canPlayType("video/"+n)}return""},_s.nativeSourceHandler.handleSource=function(e,t,n){t.setSrc(e.src)},_s.nativeSourceHandler.dispose=function(){},_s.registerSourceHandler(_s.nativeSourceHandler),Er.registerTech("Html5",_s);var bs=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Ts={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Ss=["tiny","xsmall","small","medium","large","xlarge","huge"],Es={};Ss.forEach((function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;Es[e]="vjs-layout-"+t}));var ws={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Cs=function(e){function t(n,i,r){var a;if(n.id=n.id||i.id||"vjs_video_"+ti(),(i=jt(t.getTagSettings(n),i)).initChildren=!1,i.createEl=!1,i.evented=!1,i.reportTouchActivity=!1,!i.language)if("function"==typeof n.closest){var s=n.closest("[lang]");s&&s.getAttribute&&(i.language=s.getAttribute("lang"))}else for(var o=n;o&&1===o.nodeType;){if(In(o).hasOwnProperty("lang")){i.language=o.getAttribute("lang");break}o=o.parentNode}if((a=e.call(this,null,i,r)||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=Rt(a.id_),a.fsApi_=It,a.isPosterFromTech_=!1,a.queuedCallbacks_=[],a.isReady_=!1,a.hasStarted_=!1,a.userActive_=!1,a.debugEnabled_=!1,!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&&In(n),a.language(a.options_.language),i.languages){var u={};Object.getOwnPropertyNames(i.languages).forEach((function(e){u[e.toLowerCase()]=i.languages[e]})),a.languages_=u}else a.languages_=t.prototype.options_.languages;a.resetCache_(),a.poster_=i.poster||"",a.controls_=!!i.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),i.plugins&&Object.keys(i.plugins).forEach((function(e){if("function"!=typeof a[e])throw new Error('plugin "'+e+'" does not exist')})),a.scrubbing_=!1,a.el_=a.createEl(),Ii(b(a),{eventBusKey:"el_"}),a.fsApi_.requestFullscreen&&(ui(y(),a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_),a.on(a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_)),a.fluid_&&a.on(["playerreset","resize"],a.boundUpdateStyleEl_);var l=Di(a.options_);i.plugins&&Object.keys(i.plugins).forEach((function(e){a[e](i.plugins[e])})),i.debug&&a.debug(!0),a.options_.playerOptions=l,a.middleware_=[],a.playbackRates(i.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"),un&&a.addClass("vjs-touch-enabled"),dn||a.addClass("vjs-workinghover"),t.players[a.id_]=b(a);var c=wt.split(".")[0];return a.addClass("vjs-v"+c),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}S(t,e);var n=t.prototype;return n.dispose=function(){var n=this;this.trigger("dispose"),this.off("dispose"),li(y(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),li(y(),"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),Cr[this.id()]=null,Sr.names.forEach((function(e){var t=Sr[e],i=n[t.getterName]();i&&i.off&&i.off()})),e.prototype.dispose.call(this)},n.createEl=function(){var t,n=this.tag,i=this.playerElIngest_=n.parentNode&&n.parentNode.hasAttribute&&n.parentNode.hasAttribute("data-vjs-player"),r="video-js"===this.tag.tagName.toLowerCase();i?t=this.el_=n.parentNode:r||(t=this.el_=e.prototype.createEl.call(this,"div"));var a=In(n);if(r){for(t=this.el_=n,n=this.tag=y().createElement("video");t.children.length;)n.appendChild(t.firstChild);En(t,"video-js")||wn(t,"video-js"),t.appendChild(n),i=this.playerElIngest_=t,Object.keys(t).forEach((function(e){try{n[e]=t[e]}catch(e){}}))}if(n.setAttribute("tabindex","-1"),a.tabindex="-1",(an||nn&&on)&&(n.setAttribute("role","application"),a.role="application"),n.removeAttribute("width"),n.removeAttribute("height"),"width"in a&&delete a.width,"height"in a&&delete a.height,Object.getOwnPropertyNames(a).forEach((function(e){r&&"class"===e||t.setAttribute(e,a[e]),r&&n.setAttribute(e,a[e])})),n.playerId=n.id,n.id+="_html5_api",n.className="vjs-tech",n.player=t.player=this,this.addClass("vjs-paused"),!0!==g().VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=Zn("vjs-styles-dimensions");var s=Wn(".vjs-styles-defaults"),o=Wn("head");o.insertBefore(this.styleEl_,s?s.nextSibling:o.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 u=n.getElementsByTagName("a"),l=0;l0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),r=i[1]/i[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/r:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*r,n=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(n),Jn(this.styleEl_,"\n ."+n+" {\n width: "+e+"px;\n height: "+t+"px;\n }\n\n ."+n+".vjs-fluid {\n padding-top: "+100*r+"%;\n }\n ")}else{var a="number"==typeof this.width_?this.width_:this.options_.width,s="number"==typeof this.height_?this.height_:this.options_.height,o=this.tech_&&this.tech_.el();o&&(a>=0&&(o.width=a),s>=0&&(o.height=s))}},n.loadTech_=function(e,t){var n=this;this.tech_&&this.unloadTech_();var i=Li(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==i&&this.tag&&(Er.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,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()+"_"+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,Promise:this.options_.Promise};Sr.names.forEach((function(e){var t=Sr[e];s[t.getterName]=n[t.privateName]})),jt(s,this.options_[i]),jt(s,this.options_[r]),jt(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=Er.getTech(e);if(!l)throw new Error("No Tech named '"+i+"' exists! '"+i+"' should be registered using videojs.registerTech()'");this.tech_=new l(s),this.tech_.ready(gi(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(),bs.forEach((function(e){n.on(n.tech_,e,(function(t){return n["handleTech"+Li(e)+"_"](t)}))})),Object.keys(Ts).forEach((function(e){n.on(n.tech_,e,(function(t){0===n.tech_.playbackRate()&&n.tech_.seeking()?n.queuedCallbacks_.push({callback:n["handleTech"+Ts[e]+"_"].bind(n),event:t}):n["handleTech"+Ts[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"===i&&this.tag||Sn(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},n.unloadTech_=function(){var e,t,n,i=this;Sr.names.forEach((function(e){var t=Sr[e];i[t.privateName]=i[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=Gi(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(Gi))),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&&Nt.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,i=function(){var e=t.muted();t.muted(!0);var n=function(){t.muted(e)};t.playTerminatedQueue_.push(n);var i=t.play();if(zi(i))return i.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():i():zi(n=this.play())&&(n=n.catch(i)),zi(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 i=e.$$("source"),r=0;r0&&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&&(Nt.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()?Xi(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(),i=y()[this.fsApi_.fullscreenElement]===n;!i&&n.matches?i=n.matches(":"+this.fsApi_.fullscreen):!i&&n.msMatchesSelector&&(i=n.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(i)}},n.handleTechFullscreenChange_=function(e,t){t&&(t.nativeIOSFullscreen&&this.toggleClass("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 Ar)return function(e,t,n,i){return t[n](e.reduce(Lr(n),i))}(this.middleware_,this.tech_,e,t);if(e in Or)return Ir(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw Nt(e),e}}),!0)},n.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in Pr)return function(e,t,n){return e.reduceRight(Lr(n),t[n]())}(this.middleware_,this.tech_,e);if(e in Or)return Ir(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw Nt("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",t),t;if("TypeError"===t.name)throw Nt("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",t),this.tech_.isReady_=!1,t;throw Nt(t),t}}},n.play=function(){var e=this,t=this.options_.Promise||g().Promise;return t?new t((function(t){e.play_(t)})):this.play_()},n.play_=function(e){var t=this;void 0===e&&(e=Xi),this.playCallbacks_.push(e);var n=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));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||!hn&&!dn||this.load());var i=this.techGet_("play");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")||Hi(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=Hi(0,0)),e},n.bufferedPercent=function(){return qi(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||g().Promise;if(t){var n=this;return new t((function(t,i){function r(){n.off("fullscreenerror",s),n.off("fullscreenchange",a)}function a(){r(),t()}function s(e,t){r(),i(t)}n.one("fullscreenchange",a),n.one("fullscreenerror",s);var o=n.requestFullscreenHelper_(e);o&&(o.then(r,r),o.then(t,i))}))}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 i=this.el_[this.fsApi_.requestFullscreen](t);return i&&i.then((function(){return n.isFullscreen(!0)}),(function(){return n.isFullscreen(!1)})),i}this.tech_.supportsFullScreen()&&1==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},n.exitFullscreen=function(){var e=this.options_.Promise||g().Promise;if(e){var t=this;return new e((function(e,n){function i(){t.off("fullscreenerror",a),t.off("fullscreenchange",r)}function r(){i(),e()}function a(e,t){i(),n(t)}t.one("fullscreenchange",r),t.one("fullscreenerror",a);var s=t.exitFullscreenHelper_();s&&(s.then(i,i),s.then(e,n))}))}return this.exitFullscreenHelper_()},n.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var t=y()[this.fsApi_.exitFullscreen]();return t&&Xi(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=y().documentElement.style.overflow,ui(y(),"keydown",this.boundFullWindowOnEscKey_),y().documentElement.style.overflow="hidden",wn(y().body,"vjs-full-window"),this.trigger("enterFullWindow")},n.fullWindowOnEscKey=function(e){k().isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},n.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,li(y(),"keydown",this.boundFullWindowOnEscKey_),y().documentElement.style.overflow=this.docOrigOverflow,Cn(y().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 y()&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture")},n.exitPictureInPicture=function(){if("pictureInPictureEnabled"in y())return y().exitPictureInPicture()},n.handleKeyDown=function(e){var t,n,i=this.options_.userActions;i&&i.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 i.hotkeys?i.hotkeys.call(this,e):this.handleHotkeys(e)))},n.handleHotkeys=function(e){var t=this.options_.userActions?this.options_.userActions.hotkeys:{},n=t.fullscreenKey,i=void 0===n?function(e){return k().isEventKey(e,"f")}:n,r=t.muteKey,a=void 0===r?function(e){return k().isEventKey(e,"m")}:r,s=t.playPauseKey,o=void 0===s?function(e){return k().isEventKey(e,"k")||k().isEventKey(e,"Space")}:s;if(i.call(this,e)){e.preventDefault(),e.stopPropagation();var u=Bi.getComponent("FullscreenToggle");!1!==y()[this.fsApi_.fullscreenEnabled]&&u.prototype.handleClick.call(this,e)}else a.call(this,e)?(e.preventDefault(),e.stopPropagation(),Bi.getComponent("MuteToggle").prototype.handleClick.call(this,e)):o.call(this,e)&&(e.preventDefault(),e.stopPropagation(),Bi.getComponent("PlayToggle").prototype.handleClick.call(this,e))},n.canPlayType=function(e){for(var t,n=0,i=this.options_.techOrder;n1?n.handleSrc_(i.slice(1)):(n.changingSrc_=!1,n.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0),void n.triggerReady());a=r,s=n.tech_,a.forEach((function(e){return e.setTech&&e.setTech(s)}))})),this.options_.retryOnError&&i.length>1){var r=function(){n.error(null),n.handleSrc_(i.slice(1),!0)},a=function(){n.off("error",r)};this.one("error",r),this.one("playing",a),this.resetRetryOnError_=function(){n.off("error",r),n.off("playing",a)}}}else this.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0)},n.src=function(e){return this.handleSrc_(e,!1)},n.src_=function(e){var t,n,i=this,r=this.selectSource([e]);return!r||(t=r.tech,n=this.techName_,Li(t)!==Li(n)?(this.changingSrc_=!0,this.loadTech_(r.tech,r.source),this.tech_.ready((function(){i.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||g().Promise;this.paused()||!t?this.doReset_():Xi(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_(),bi(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(kt("beforeerror").forEach((function(n){var i=n(t,e);Ft(i)&&!Array.isArray(i)||"string"==typeof i||"number"==typeof i||null===i?e=i: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 Vi(e),this.addClass("vjs-error"),Nt.error("(CODE:"+this.error_.code+" "+Vi.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),kt("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,i=gi(this,this.reportUserActivity),r=function(t){i(),this.clearInterval(e)};this.on("mousedown",(function(){i(),this.clearInterval(e),e=this.setInterval(i,250)})),this.on("mousemove",(function(e){e.screenX===t&&e.screenY===n||(t=e.screenX,n=e.screenY,i())})),this.on("mouseup",r),this.on("mouseleave",r);var a,s=this.getChild("controlBar");!s||dn||$t||(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",i),this.on("keyup",i),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.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(),bi(this)&&this.trigger("languagechange"))},n.languages=function(){return Di(t.prototype.options_.languages,this.languages_)},n.toJSON=function(){var e=Di(this.options_),t=e.tracks;e.tracks=[];for(var n=0;n"):function(){}},qs=1/30,Vs=.1,Ws=function(e,t){var n,i=[];if(e&&e.length)for(n=0;n=t}))},Xs=function(e,t){return Ws(e,(function(e){return e-qs>=t}))},Gs=function(e){var t=[];if(!e||!e.length)return"";for(var n=0;n "+e.end(n));return t.join(", ")},Ks=function(e){for(var t=[],n=0;na||(n+=t>r&&t<=a?a-t:a-r)}return n},$s=Ms.createTimeRange,Zs=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(i,r){e.push({duration:i.duration,segmentIndex:n,partIndex:r,part:i,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},io=function(e,t,n){if(void 0===t&&(t=e.mediaSequence+e.segments.length),tr){var s=[r,i];i=s[0],r=s[1]}if(i<0){for(var o=i;oDate.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]},ho=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)0)for(var h=l-1;h>=0;h--){var p=u[h];if(o+=p.duration,s){if(o<0)continue}else if(o+qs<=0)continue;return{partIndex:p.partIndex,segmentIndex:p.segmentIndex,startTime:a-ao({defaultDuration:t.targetDuration,durationList:u,startIndex:l,endIndex:h})}}return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:n}}if(l<0){for(var f=l;f<0;f++)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 m=l;m0)continue}else if(o-qs>=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:a+ao({defaultDuration:t.targetDuration,durationList:u,startIndex:l,endIndex:m})}}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-1&&s!==a.length-1&&(n._HLS_part=s),(s>-1||a.length)&&r--}n._HLS_msn=r}if(t.serverControl&&t.serverControl.canSkipUntil&&(n._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(n).length){var o=new(g().URL)(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach((function(e){n.hasOwnProperty(e)&&o.searchParams.set(e,n[e])})),e=o.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 i=t.uri,r=t.id;this.request=null,n&&(this.state=n),this.error={playlist:this.master.playlists[r],status:e.status,message:"HLS playlist request error at URL: "+i+".",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,i=e.manifestString,r=e.customTagParsers,a=void 0===r?[]:r,s=e.customTagMappers,o=void 0===s?[]:s,u=e.experimentalLLHLS,l=new Y;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(i),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 h=eo(c);if(h.length&&!c.partTargetDuration){var p=h.reduce((function(e,t){return Math.max(e,t.duration)}),0);t&&(t("manifest has no partTargetDuration defaulting to "+p),vo.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=p}return c}({onwarn:function(e){var i=e.message;return t.logger_("m3u8-parser warn for "+n+": "+i)},oninfo:function(e){var i=e.message;return t.logger_("m3u8-parser info for "+n+": "+i)},manifestString:e.manifestString,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},n.haveMetadata=function(e){var t=e.playlistString,n=e.playlistObject,i=e.url,r=e.id;this.request=null,this.state="HAVE_METADATA";var a=n||this.parseManifest_({url:i,manifestString:t});a.lastRequest=Date.now(),bo({playlist:a,uri:i,id:r});var s=Io(this.master,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,s?(this.master=s,this.media_=this.master.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Po(this.media(),!!s)),this.trigger("loadedplaylist")},n.dispose=function(){this.trigger("dispose"),this.stopRequest(),g().clearTimeout(this.mediaUpdateTimeout),g().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(g().clearTimeout(this.finalRenditionTimeout),t){var i=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=g().setTimeout(this.media.bind(this,e,!1),i)}else{var r=this.state,a=!this.media_||e.id!==this.media_.id,s=this.master.playlists[e.id];if(s&&s.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(a&&(this.trigger("mediachanging"),"HAVE_MASTER"===r?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(Po(e,!0)),a){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,i){if(n.request){if(e.lastRequest=Date.now(),e.resolvedUri=Fs(n.handleManifestRedirects,e.resolvedUri,i),t)return n.playlistRequestError(n.request,e,r);n.haveMetadata({playlistString:i.responseText,url:e.uri,id:e.id}),"HAVE_MASTER"===r?n.trigger("loadedmetadata"):n.trigger("mediachange")}}))}}},n.pause=function(){this.mediaUpdateTimeout&&(g().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&&(g().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var n=this.media();if(e){var i=n?(n.partTargetDuration||n.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=g().setTimeout((function(){t.mediaUpdateTimeout=null,t.load()}),i)}else this.started?n&&!n.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()},n.updateMediaUpdateTimeout_=function(e){var t=this;this.mediaUpdateTimeout&&(g().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=g().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=g().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=Fs(e.handleManifestRedirects,e.src,n);var i=e.parseManifest_({manifestString:n.responseText,url:e.src});e.setupInitialPlaylist(i)}}))},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,To(this.master,this.srcUri()),e.playlists.forEach((function(e){e.segments=ko(e),e.segments.forEach((function(t){Co(t,e.resolvedUri)}))})),this.trigger("loadedplaylist"),void(this.request||this.media(this.master.playlists[0]));var t=this.srcUri()||g().location.href;this.master=function(e,t){var n=yo(0,t),i={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:g().location.href,resolvedUri:g().location.href,playlists:[{uri:t,id:n,resolvedUri:t,attributes:{}}]};return i.playlists[n]=i.playlists[0],i.playlists[t]=i.playlists[0],i}(0,t),this.haveMetadata({playlistObject:e,url:t,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},t}(Eo),Oo=Ms.xhr,Lo=Ms.mergeOptions,Do=function(e,t,n,i){var r="arraybuffer"===e.responseType?e.response:e.responseText;!t&&r&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=r.byteLength||r.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&&(r||e.responseText)))),i(t,e)},No=function(){var e=function e(t,n){t=Lo({timeout:45e3},t);var i=e.beforeRequest||Ms.Vhs.xhr.beforeRequest;if(i&&"function"==typeof i){var r=i(t);r&&(t=r)}var a=(!0===Ms.Vhs.xhr.original?Oo:Ms.Vhs.xhr)(t,(function(e,t){return Do(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},Ro=function(e){var t,n,i={};return e.byterange&&(i.Range=(n=(t=e.byterange).offset+t.length-1,"bytes="+t.offset+"-"+n)),i},Mo=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 i=e[n];ArrayBuffer.isView(i)?t[n]={bytes:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength}:t[n]=i})),t},Fo=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},qo=function(e){for(var t=Array.prototype.slice.call(e),n=16,i="",r=0;rnew Date(o.getTime()+1e3*u)?null:(n>o&&(i=s),{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:go.duration(t,t.mediaSequence+t.segments.indexOf(i)),type:i.videoTimingInfo?"accurate":"estimate"})}(n,i);if(!d)return c({message:n+" was not found in the stream"});var h=d.segment,p=function(e,t){var n,i;try{n=new Date(e),i=new Date(t)}catch(e){}var r=n.getTime();return(i.getTime()-r)/1e3}(h.dateTimeObject,n);if("estimate"===d.type)return 0===a?c({message:n+" is not buffered yet. Try again"}):(s(d.estimatedStart+p),void l.one("seeked",(function(){e({programTime:n,playlist:i,retryCount:a-1,seekTo:s,pauseAfterSeek:u,tech:l,callback:c})})));var f=h.start+p;l.one("seeked",(function(){return c(null,l.currentTime())})),u&&l.pause(),s(f)},zo=function(e,t){if(4===e.readyState)return t()},Xo=Ms.EventTarget,Go=Ms.mergeOptions,Ko=function(e,t){if(!xo(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=c+l)return s(t,{response:o.subarray(l,l+c),status:n.status,uri:n.uri});i.request=i.vhs_.xhr({uri:a,responseType:"arraybuffer",headers:Ro({byterange:e.sidx.byterange})},s)}))}else this.mediaRequest_=g().setTimeout((function(){return n(!1)}),0)},n.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},g().clearTimeout(this.minimumUpdatePeriodTimeout_),g().clearTimeout(this.mediaRequest_),g().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 i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(i&&(this.trigger("mediachanging"),this.trigger("mediachange")));i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,n,(function(i){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(),g().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(g().clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)},n.load=function(e){var t=this;g().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var n=this.media();if(e){var i=n?n.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=g().setTimeout((function(){return t.load()}),i)}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_=g().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,i){if(!t.requestErrored_(n,i)){var r=i.responseText!==t.masterPlaylistLoader_.masterXml_;return t.masterPlaylistLoader_.masterXml_=i.responseText,i.responseHeaders&&i.responseHeaders.date?t.masterLoaded_=Date.parse(i.responseHeaders.date):t.masterLoaded_=Date.now(),t.masterPlaylistLoader_.srcUrl=Fs(t.handleManifestRedirects,t.masterPlaylistLoader_.srcUrl,i),r?(t.handleMaster_(),void t.syncClientServerClock_((function(){return e(i,r)}))):e(i,r)}"HAVE_NOTHING"===t.state&&(t.started=!1)}))},n.syncClientServerClock_=function(e){var t,n=this,i=(t=this.masterPlaylistLoader_.masterXml_,function(e){var t=Me(e,"UTCTiming")[0];if(!t)return null;var n=Fe(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}(ze(t)));return null===i?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),e()):"DIRECT"===i.method?(this.masterPlaylistLoader_.clientOffset_=i.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:js(this.masterPlaylistLoader_.srcUrl,i.value),method:i.method,withCredentials:this.withCredentials},(function(t,r){if(n.request){if(t)return n.masterPlaylistLoader_.clientOffset_=n.masterLoaded_-Date.now(),e();var a;a="HEAD"===i.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):n.masterLoaded_:Date.parse(r.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,i=(e={masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_},n=Xe(e.masterXml,{manifestUri:t=e.srcUrl,clientOffset:e.clientOffset,sidxMapping:e.sidxMapping}),To(n,t),n),r=this.masterPlaylistLoader_.master;r&&(i=function(e,t,n){for(var i=!0,r=Go(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod}),a=0;a-1)},this.trigger=function(t){var n,i,r,a;if(n=e[t])if(2===arguments.length)for(r=n.length,i=0;i>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},m=function(e){return t(S.hdlr,I[e])},f=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,f(e),m(e.type),s(e))},a=function(e){return t(S.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},s=function(e){return t(S.minf,"video"===e.type?t(S.vmhd,P):t(S.smhd,A),n(),v(e))},o=function(e,n){for(var i=[],r=n.length;r--;)i[r]=_(n[r]);return t.apply(null,[S.moof,a(e)].concat(i))},u=function(e){for(var n=e.length,i=[];n--;)i[n]=d(e[n]);return t.apply(null,[S.moov,c(4294967295)].concat(i).concat(l(e)))},l=function(e){for(var n=e.length,i=[];n--;)i[n]=b(e[n]);return t.apply(null,[S.mvex].concat(i))},c=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)},g=function(e){var n,i,r=e.samples||[],a=new Uint8Array(4+r.length);for(i=0;i>>8),s.push(255&r[n].byteLength),s=s.concat(Array.prototype.slice.call(r[n]));for(n=0;n>>8),o.push(255&a[n].byteLength),o=o.concat(Array.prototype.slice.call(a[n]));if(i=[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([r.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];i.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,i)},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)},_=function(e){var n,i,r,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/(q+1)),o=Math.floor(e.baseMediaDecodeTime%(q+1)),i=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?(r=T(e,92),t(S.traf,n,i,r)):(a=g(e),r=T(e,a.length+92),t(S.traf,n,i,r,a))},d=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)},F=function(e,t){var n=0,i=0,r=0,a=0;return e.length&&(void 0!==e[0].duration&&(n=1),void 0!==e[0].size&&(i=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,n|i|r|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 i,r,a,s,o,u;for(n+=20+16*(s=e.samples||[]).length,a=F(s,n),(r=new Uint8Array(a.length+16*s.length)).set(a),i=a.length,u=0;u>>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,r[i++]=o.flags.isLeading<<2|o.flags.dependsOn,r[i++]=o.flags.isDependedOn<<6|o.flags.hasRedundancy<<4|o.flags.paddingValue<<1|o.flags.isNonSyncSample,r[i++]=61440&o.flags.degradationPriority,r[i++]=15&o.flags.degradationPriority,r[i++]=(4278190080&o.compositionTimeOffset)>>>24,r[i++]=(16711680&o.compositionTimeOffset)>>>16,r[i++]=(65280&o.compositionTimeOffset)>>>8,r[i++]=255&o.compositionTimeOffset;return t(S.trun,r)},B=function(e,n){var i,r,a,s,o,u;for(n+=20+8*(s=e.samples||[]).length,a=F(s,n),(i=new Uint8Array(a.length+8*s.length)).set(a),r=a.length,u=0;u>>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;return t(S.trun,i)},T=function(e,t){return"audio"===e.type?B(e,t):j(e,t)},r=function(){return t(S.ftyp,E,w,E,C)};var V,W,z,X,G,K,Y,Q,$=function(e){return t(S.mdat,e)},Z=o,J=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},ee=[33,16,5,32,164,27],te=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],ne=function(e){for(var t=[];e--;)t.push(0);return t},ie=9e4;K=function(e,t){return W(G(e,t))},Y=function(e,t){return z(X(e),t)},Q=function(e,t,n){return X(n?e:e-t)};var re=ie,ae=W=function(e){return e*ie},se=(z=function(e,t){return e*t},X=function(e){return e/ie}),oe=(G=function(e,t){return e/t},K),ue=Y,le=Q,ce=function(e,t,n,i){var r,a,s,o,u,l=0,c=0,d=0;if(t.length&&(r=oe(e.baseMediaDecodeTime,e.samplerate),a=Math.ceil(re/(e.samplerate/1024)),n&&i&&(l=r-Math.max(n,i),d=(c=Math.floor(l/a))*a),!(c<1||d>45e3))){for((s=function(){if(!V){var e={96e3:[ee,[227,64],ne(154),[56]],88200:[ee,[231],ne(170),[56]],64e3:[ee,[248,192],ne(240),[56]],48e3:[ee,[255,192],ne(268),[55,148,128],ne(54),[112]],44100:[ee,[255,192],ne(268),[55,163,128],ne(84),[112]],32e3:[ee,[255,192],ne(268),[55,234],ne(226),[112]],24e3:[ee,[255,192],ne(268),[55,255,128],ne(268),[111,112],ne(126),[224]],16e3:[ee,[255,192],ne(268),[55,255,128],ne(268),[111,255],ne(269),[223,108],ne(195),[1,192]],12e3:[te,ne(268),[3,127,248],ne(268),[6,255,240],ne(268),[13,255,224],ne(268),[27,253,128],ne(259),[56]],11025:[te,ne(268),[3,127,248],ne(268),[6,255,240],ne(268),[13,255,224],ne(268),[27,255,192],ne(268),[55,175,128],ne(108),[112]],8e3:[te,ne(268),[3,121,16],ne(47),[7]]};t=e,V=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 V}()[e.samplerate])||(s=t[0].data),o=0;o=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--},ve.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},ve.prototype.addText=function(e){this.rows[this.rowIdx]+=e},ve.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var ye=function(e,t,n){this.serviceNum=e,this.text="",this.currentWindow=new ve(-1),this.windows=[],this.stream=n,"string"==typeof t&&this.createTextDecoder(t)};ye.prototype.init=function(e,t){this.startPts=e;for(var n=0;n<8;n++)this.windows[n]=new ve(n),"function"==typeof t&&(this.windows[n].beforeRowOverflow=t)},ye.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},ye.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 _e=function e(t){t=t||{},e.prototype.init.call(this);var n,i=this,r=t.captionServices||{},a={};Object.keys(r).forEach((function(e){n=r[e],/^SERVICE/.test(e)&&(a[e]=n.encoding)})),this.serviceEncodings=a,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(i.new708Packet(),i.add708Bytes(e)):(null===i.current708Packet&&i.new708Packet(),i.add708Bytes(e))}};_e.prototype=new H,_e.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},_e.prototype.add708Bytes=function(e){var t=e.ccData,n=t>>>8,i=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(n),this.current708Packet.data.push(i)},_e.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,n=null,i=null,r=0,a=t[r++];for(e.seq=a>>6,e.sizeCode=63&a;r>5)&&i>0&&(n=a=t[r++]),this.pushServiceBlock(n,r,i),i>0&&(r+=i-1)},_e.prototype.pushServiceBlock=function(e,t,n){var i,r=t,a=this.current708Packet.data,s=this.services[e];for(s||(s=this.initService(e,r));r>5,a.rowLock=(16&i)>>4,a.columnLock=(8&i)>>3,a.priority=7&i,i=n[++e],a.relativePositioning=(128&i)>>7,a.anchorVertical=127&i,i=n[++e],a.anchorHorizontal=i,i=n[++e],a.anchorPoint=(240&i)>>4,a.rowCount=15&i,i=n[++e],a.columnCount=63&i,i=n[++e],a.windowStyle=(56&i)>>3,a.penStyle=7&i,a.virtualRowCount=a.rowCount+1,e},_e.prototype.setWindowAttributes=function(e,t){var n=this.current708Packet.data,i=n[e],r=t.currentWindow.winAttr;return i=n[++e],r.fillOpacity=(192&i)>>6,r.fillRed=(48&i)>>4,r.fillGreen=(12&i)>>2,r.fillBlue=3&i,i=n[++e],r.borderType=(192&i)>>6,r.borderRed=(48&i)>>4,r.borderGreen=(12&i)>>2,r.borderBlue=3&i,i=n[++e],r.borderType+=(128&i)>>5,r.wordWrap=(64&i)>>6,r.printDirection=(48&i)>>4,r.scrollDirection=(12&i)>>2,r.justify=3&i,i=n[++e],r.effectSpeed=(240&i)>>4,r.effectDirection=(12&i)>>2,r.displayEffect=3&i,e},_e.prototype.flushDisplayed=function(e,t){for(var n=[],i=0;i<8;i++)t.windows[i].visible&&!t.windows[i].isEmpty()&&n.push(t.windows[i].getText());t.endPts=e,t.text=n.join("\n\n"),this.pushCaption(t),t.startPts=e},_e.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)},_e.prototype.displayWindows=function(e,t){var n=this.current708Packet.data[++e],i=this.getPts(e);this.flushDisplayed(i,t);for(var r=0;r<8;r++)n&1<>4,r.offset=(12&i)>>2,r.penSize=3&i,i=n[++e],r.italics=(128&i)>>7,r.underline=(64&i)>>6,r.edgeType=(56&i)>>3,r.fontStyle=7&i,e},_e.prototype.setPenColor=function(e,t){var n=this.current708Packet.data,i=n[e],r=t.currentWindow.penColor;return i=n[++e],r.fgOpacity=(192&i)>>6,r.fgRed=(48&i)>>4,r.fgGreen=(12&i)>>2,r.fgBlue=3&i,i=n[++e],r.bgOpacity=(192&i)>>6,r.bgRed=(48&i)>>4,r.bgGreen=(12&i)>>2,r.bgBlue=3&i,i=n[++e],r.edgeRed=(48&i)>>4,r.edgeGreen=(12&i)>>2,r.edgeBlue=3&i,e},_e.prototype.setPenLocation=function(e,t){var n=this.current708Packet.data,i=n[e],r=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,i=n[++e],r.row=15&i,i=n[++e],r.column=63&i,e},_e.prototype.reset=function(e,t){var n=this.getPts(e);return this.flushDisplayed(n,t),this.initService(t.serviceNum,e)};var be={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},Te=function(e){return null===e?"":(e=be[e]||e,String.fromCharCode(e))},Se=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Ee=function(){for(var e=[],t=15;t--;)e.push("");return e},we=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,i,r,a;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),i=t>>>8,r=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_=Ee();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Ee();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Ee()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(i,r))a=Te((i=(3&i)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(i,r))"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=Te((i=(3&i)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(i,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&r)&&this.addFormatting(e.pts,["i"]),1==(1&r)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(i,r))this.column_+=3&r;else if(this.isPAC(i,r)){var s=Se.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&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(r)&&14==(14&r)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(i)&&(0===r&&(r=null),a=Te(i),a+=Te(r),this[this.mode_](e.pts,a),this.column_+=a.length)}else this.lastControlCode_=null}};we.prototype=new H,we.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_})},we.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Ee(),this.nonDisplayed_=Ee(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},we.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_},we.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},we.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},we.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},we.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},we.prototype.isPAC=function(e,t){return e>=this.BASE_&&e=64&&t<=127},we.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},we.prototype.isNormalChar=function(e){return e>=32&&e<=127},we.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Ee(),this.displayed_=Ee()),void 0!==t&&t!==this.row_)for(var n=0;n"}),"");this[this.mode_](e,n)},we.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce((function(e,t){return e+""}),"");this.formatting_=[],this[this.mode_](e,t)}},we.prototype.popOn=function(e,t){var n=this.nonDisplayed_[this.row_];n+=t,this.nonDisplayed_[this.row_]=n},we.prototype.rollUp=function(e,t){var n=this.displayed_[this.row_];n+=t,this.displayed_[this.row_]=n},we.prototype.shiftRowsUp_=function(){var e;for(e=0;et&&(n=-1);Math.abs(t-e)>4294967296;)e+=8589934592*n;return e},Pe=function e(t){var n,i;e.prototype.init.call(this),this.type_=t||xe,this.push=function(e){this.type_!==xe&&e.type!==this.type_||(void 0===i&&(i=e.dts),e.dts=Ie(e.dts,i),e.pts=Ie(e.pts,i),n=e.dts,this.trigger("data",e))},this.flush=function(){i=n,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){i=void 0,n=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Pe.prototype=new H;var Ae,Oe=Pe,Le=Ie,De=function(e,t,n){var i,r="";for(i=t;i>>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>>4>1&&(i+=t[i]+1),0===n.pid)n.type="pat",e(t.subarray(i),n),this.trigger("data",n);else if(n.pid===this.pmtPid)for(n.type="pmt",e(t.subarray(i),n),this.trigger("data",n);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,i,n]):this.processPes_(t,i,n)},this.processPes_=function(e,t,n){n.pid===this.programMapTable.video?n.streamType=ke.H264_STREAM_TYPE:n.pid===this.programMapTable.audio?n.streamType=ke.ADTS_STREAM_TYPE:n.streamType=this.programMapTable["timed-metadata"][n.pid],n.type="pes",n.data=e.subarray(t),this.trigger("data",n)}},Be.prototype=new H,Be.STREAM_TYPES={h264:27,adts:15},je=function(){var e,t=this,n=!1,i={data:[],size:0},r={data:[],size:0},a={data:[],size:0},s=function(e,n,i){var r,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>>3,d.pts*=4,d.pts+=(6&c[13])>>>1,d.dts=d.pts,64&h&&(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])),r="video"===n||o.packetLength<=e.size,(i||r)&&(e.size=0,e.data.length=0),r&&t.trigger("data",o)}};je.prototype.init.call(this),this.push=function(o){({pat:function(){},pes:function(){var e,t;switch(o.streamType){case ke.H264_STREAM_TYPE:e=i,t="video";break;case ke.ADTS_STREAM_TYPE:e=r,t="audio";break;case ke.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 i={type:"metadata",tracks:[]};null!==(e=o.programMapTable).video&&i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),n=!0,t.trigger("data",i)}})[o.type]()},this.reset=function(){i.size=0,i.data.length=0,r.size=0,r.data.length=0,this.trigger("reset")},this.flushStreams_=function(){s(i,"video"),s(r,"audio"),s(a,"timed-metadata")},this.flush=function(){if(!n&&e){var i={type:"metadata",tracks:[]};null!==e.video&&i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",i)}n=!1,this.flushStreams_(),this.trigger("done")}},je.prototype=new H;var Ve={PAT_PID:0,MP2T_PACKET_LENGTH:qe,TransportPacketStream:Ue,TransportParseStream:Be,ElementaryStream:je,TimestampRolloverStream:He,CaptionStream:Ce.CaptionStream,Cea608Stream:Ce.Cea608Stream,Cea708Stream:Ce.Cea708Stream,MetadataStream:Fe};for(var We in ke)ke.hasOwnProperty(We)&&(Ve[We]=ke[We]);var ze,Xe=Ve,Ge=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];ze=function(e){var t,n=0;ze.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(i){var r,a,s,o,u,l=0;if(e||(n=0),"audio"===i.type){var c;for(t&&t.length?(s=t,(t=new Uint8Array(s.byteLength+i.data.byteLength)).set(s),t.set(i.data,s.byteLength)):t=i.data;l+7>5,u=9e4*(o=1024*(1+(3&t[l+6])))/Ge[(60&t[l+2])>>>2],t.byteLength-l>>6&3),channelcount:(1&t[l+2])<<2|(192&t[l+3])>>>6,samplerate:Ge[(60&t[l+2])>>>2],samplingfrequencyindex:(60&t[l+2])>>>2,samplesize:16,data:t.subarray(l+7+a,l+r)}),n++,l+=r}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")}},ze.prototype=new H;var Ke,Ye,Qe,$e=ze,Ze=function(e){var t=e.byteLength,n=0,i=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+i},this.loadWord=function(){var r=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(r,r+s)),n=new DataView(a.buffer).getUint32(0),i=8*s,t-=s},this.skipBits=function(e){var r;i>e?(n<<=e,i-=e):(e-=i,e-=8*(r=Math.floor(e/8)),t-=r,this.loadWord(),n<<=e,i-=e)},this.readBits=function(e){var r=Math.min(i,e),a=n>>>32-r;return(i-=r)>0?n<<=r:t>0&&this.loadWord(),(r=e-r)>0?a<>>e))return n<<=e,i-=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()};Ye=function(){var e,t,n=0;Ye.prototype.init.call(this),this.push=function(i){var r;t?((r=new Uint8Array(t.byteLength+i.data.byteLength)).set(t),r.set(i.data,t.byteLength),t=r):t=i.data;for(var a=t.byteLength;n3&&this.trigger("data",t.subarray(n+3)),t=null,n=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Ye.prototype=new H,Qe={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Ke=function(){var e,t,n,i,r,a,s,o=new Ye;Ke.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,n=e.pts,i=e.dts,o.push(e))},o.on("data",(function(s){var o={trackId:t,pts:n,dts:i,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=r(s.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=r(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,i=8,r=8;for(n=0;n=0?n:0,(16&e[t+5])>>4?n+20:n+10},it=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+=nt(t,n))},rt=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},at={isLikelyAacData:function(e){var t=it(e,0);return e.length>=t+2&&255==(255&e[t])&&240==(240&e[t+1])&&16==(22&e[t+1])},parseId3TagSize:nt,parseAdtsSize:function(e,t){var n=(224&e[t+5])>>5,i=e[t+4]<<3;return 6144&e[t+3]|i|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>>2];t++}return null},parseAacTimestamp:function(e){var t,n,i;t=10,64&e[5]&&(t+=4,t+=rt(e.subarray(10,14)));do{if((n=rt(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){i=e.subarray(t+10,t+n+10);for(var r=0;r>>2;return(o*=4)+(3&s[7])}break}}t+=10,t+=n}while(t=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=at.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=at.parseId3TagSize(e,u))>e.length)break;r={type:"timed-metadata",data:e.subarray(u,u+o)},this.trigger("data",r),u+=o}i=e.length-u,e=i>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 st,ot,ut,lt,ct=Je,dt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],ht=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],pt=et.H264Stream,ft=at.isLikelyAacData,mt=function(e,t){t.stream=e,this.trigger("log",t)},gt=function(e,t){for(var n=Object.keys(t),i=0;i=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)})))}(i,e,r),e.baseMediaDecodeTime=he(e,t.keepOriginalTimestamps),p=ce(e,o,a,s),e.samples=function(e){var t,n,i=[];for(t=0;t1&&(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 f;if(!(f=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");de(e),o=f}pe(e,o),e.samples=function(e,t){var n,i,r,a,s,o=t||0,u=[];for(n=0;n=-1e4&&n<=45e3&&(!i||o>n)&&(i=a,o=n));return i?i.gop:null},this.alignGopsAtStart_=function(e){var t,n,i,r,a,o,u,l;for(a=e.byteLength,o=e.nalCount,u=e.duration,t=n=0;ti.pts?t++:(n++,a-=r.byteLength,o-=r.nalCount,u-=r.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,i,r,a,o,u;for(t=s.length-1,n=e.length-1,a=null,o=!1;t>=0&&n>=0;){if(i=s[t],r=e[n],i.pts===r.pts){o=!0;break}i.pts>r.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}},st.prototype=new H,lt=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,lt.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))))}},lt.prototype=new H,lt.prototype.flush=function(e){var t,n,i,a,s=0,o={captions:[],captionStreams:{},metadata:[],info:{}},l=0;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(l=this.videoTrack.timelineStartInfo.pts,ht.forEach((function(e){o.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(l=this.audioTrack.timelineStartInfo.pts,dt.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,i=function(e){var t,n=r(),i=u(e);return(t=new Uint8Array(n.byteLength+i.byteLength)).set(n),t.set(i,n.byteLength),t}(this.pendingTracks),o.initSegment=new Uint8Array(i.byteLength),o.initSegment.set(i),o.data=new Uint8Array(this.pendingBytes),a=0;a=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},lt.prototype.setRemux=function(e){this.remuxTracks=e},ut=function(e){var t,n,i=this,r=!0;ut.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="aac",r.metadataStream=new Xe.MetadataStream,r.aacStream=new ct,r.audioTimestampRolloverStream=new Xe.TimestampRolloverStream("audio"),r.timedMetadataTimestampRolloverStream=new Xe.TimestampRolloverStream("timed-metadata"),r.adtsStream=new $e,r.coalesceStream=new lt(e,r.metadataStream),r.headOfPipeline=r.aacStream,r.aacStream.pipe(r.audioTimestampRolloverStream).pipe(r.adtsStream),r.aacStream.pipe(r.timedMetadataTimestampRolloverStream).pipe(r.metadataStream).pipe(r.coalesceStream),r.metadataStream.on("timestamp",(function(e){r.aacStream.setTimestamp(e.timeStamp)})),r.aacStream.on("data",(function(a){"timed-metadata"!==a.type&&"audio"!==a.type||r.audioSegmentStream||(n=n||{timelineStartInfo:{baseMediaDecodeTime:i.baseMediaDecodeTime},codec:"adts",type:"audio"},r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new ot(n,e),r.audioSegmentStream.on("log",i.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",i.trigger.bind(i,"audioTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream),i.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!t}))})),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),gt(this,r)},this.setupTsPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="ts",r.metadataStream=new Xe.MetadataStream,r.packetStream=new Xe.TransportPacketStream,r.parseStream=new Xe.TransportParseStream,r.elementaryStream=new Xe.ElementaryStream,r.timestampRolloverStream=new Xe.TimestampRolloverStream,r.adtsStream=new $e,r.h264Stream=new pt,r.captionStream=new Xe.CaptionStream(e),r.coalesceStream=new lt(e,r.metadataStream),r.headOfPipeline=r.packetStream,r.packetStream.pipe(r.parseStream).pipe(r.elementaryStream).pipe(r.timestampRolloverStream),r.timestampRolloverStream.pipe(r.h264Stream),r.timestampRolloverStream.pipe(r.adtsStream),r.timestampRolloverStream.pipe(r.metadataStream).pipe(r.coalesceStream),r.h264Stream.pipe(r.captionStream).pipe(r.coalesceStream),r.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=i.baseMediaDecodeTime):(t=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=i.baseMediaDecodeTime;t&&!r.videoSegmentStream&&(r.coalesceStream.numberOfTracks++,r.videoSegmentStream=new st(t,e),r.videoSegmentStream.on("log",i.getLogTrigger_("videoSegmentStream")),r.videoSegmentStream.on("timelineStartInfo",(function(t){n&&!e.keepOriginalTimestamps&&(n.timelineStartInfo=t,r.audioSegmentStream.setEarliestDts(t.dts-i.baseMediaDecodeTime))})),r.videoSegmentStream.on("processedGopsInfo",i.trigger.bind(i,"gopInfo")),r.videoSegmentStream.on("segmentTimingInfo",i.trigger.bind(i,"videoSegmentTimingInfo")),r.videoSegmentStream.on("baseMediaDecodeTime",(function(e){n&&r.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),r.videoSegmentStream.on("timingInfo",i.trigger.bind(i,"videoTimingInfo")),r.h264Stream.pipe(r.videoSegmentStream).pipe(r.coalesceStream)),n&&!r.audioSegmentStream&&(r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new ot(n,e),r.audioSegmentStream.on("log",i.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",i.trigger.bind(i,"audioTimingInfo")),r.audioSegmentStream.on("segmentTimingInfo",i.trigger.bind(i,"audioSegmentTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream)),i.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!t})}})),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("id3Frame",(function(e){e.dispatchType=r.metadataStream.dispatchType,i.trigger("id3Frame",e)})),r.coalesceStream.on("caption",this.trigger.bind(this,"caption")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),gt(this,r)},this.setBaseMediaDecodeTime=function(i){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=i),n&&(n.timelineStartInfo.dts=void 0,n.timelineStartInfo.pts=void 0,de(n),r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,de(t),r.captionStream.reset()),r.timestampRolloverStream&&r.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(r){var t=ft(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),r=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){r=!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()}},ut.prototype=new H;var _t,bt,Tt,St={Transmuxer:ut,VideoSegmentStream:st,AudioSegmentStream:ot,AUDIO_PROPERTIES:dt,VIDEO_PROPERTIES:ht,generateSegmentTimingInfo:yt},Et=function(e){return e>>>0},wt=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),(t+=String.fromCharCode(e[2]))+String.fromCharCode(e[3])},Ct=Et,kt=function e(t,n){var i,r,a,s,o,u=[];if(!n.length)return null;for(i=0;i1?i+r:t.byteLength,a===n[0]&&(1===n.length?u.push(t.subarray(i+8,s)):(o=e(t.subarray(i+8,s),n.slice(1))).length&&(u=u.concat(o))),i=s;return u},xt=Et,It=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=function(e){for(var t,n,i=e.byteLength,r=[],a=1;a0?function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),baseMediaDecodeTime:xt(e[4]<<24|e[5]<<16|e[6]<<8|e[7])};return 1===t.version&&(t.baseMediaDecodeTime*=Math.pow(2,32),t.baseMediaDecodeTime+=xt(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),t}(l[0]).baseMediaDecodeTime:0,d=kt(s,["trun"]);t===u&&d.length>0&&(n=function(e,t,n){var i=t,r=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:[]},i=new DataView(e.buffer,e.byteOffset,e.byteLength),r=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=i.getUint32(4),d=8;for(r&&(n.dataOffset=i.getInt32(d),d+=4),a&&c&&(t={flags:It(e.subarray(d,d+4))},d+=4,s&&(t.duration=i.getUint32(d),d+=4),o&&(t.size=i.getUint32(d),d+=4),l&&(1===n.version?t.compositionTimeOffset=i.getInt32(d):t.compositionTimeOffset=i.getUint32(d),d+=4),n.samples.push(t),c--);c--;)t={},s&&(t.duration=i.getUint32(d),d+=4),o&&(t.size=i.getUint32(d),d+=4),u&&(t.flags=It(e.subarray(d,d+4)),d+=4),l&&(1===n.version?t.compositionTimeOffset=i.getInt32(d):t.compositionTimeOffset=i.getUint32(d),d+=4),n.samples.push(t);return n}(e).samples;t.forEach((function(e){void 0===e.duration&&(e.duration=r),void 0===e.size&&(e.size=a),e.trackId=s,e.dts=i,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),e.pts=i+e.compositionTimeOffset,i+=e.duration})),o=o.concat(t)})),o}(d,c,o),i=function(e,t,n){var i,r,a,s,o=new DataView(e.buffer,e.byteOffset,e.byteLength),u={logs:[],seiNals:[]};for(r=0;r+40;){var u=t.shift();this.parse(u,a,s)}return o=function(e,t,n){if(null===t)return null;var i=Lt(e,t)[t]||{};return{seiNals:i.seiNals,logs:i.logs,timescale:n}}(e,n,i),o&&o.logs&&(r.logs=r.logs.concat(o.logs)),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),r):r.logs.length?{logs:r.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(){r.captions=[],r.captionStreams={},r.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],n=null,i=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Nt=Et,Rt=function(e){return("00"+e.toString(16)).slice(-2)};_t=function(e,t){var n,i,r;return n=kt(t,["moof","traf"]),i=[].concat.apply([],n.map((function(t){return kt(t,["tfhd"]).map((function(n){var i,r,a;return i=Nt(n[4]<<24|n[5]<<16|n[6]<<8|n[7]),r=e[i]||9e4,a=kt(t,["tfdt"]).map((function(e){var t,n;return t=e[0],n=Nt(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),1===t&&(n*=Math.pow(2,32),n+=Nt(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),n}))[0],(a="number"!=typeof a||isNaN(a)?1/0:a)/r}))}))),r=Math.min.apply(null,i),isFinite(r)?r:0},Tt=function(e){var t=0===e[0]?12:20;return Nt(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},bt=function(e){var t=kt(e,["moov","trak"]),n=[];return t.forEach((function(e){var t,i,r={},a=kt(e,["tkhd"])[0];a&&(i=(t=new DataView(a.buffer,a.byteOffset,a.byteLength)).getUint8(0),r.id=0===i?t.getUint32(12):t.getUint32(20));var s=kt(e,["mdia","hdlr"])[0];if(s){var o=wt(s.subarray(8,12));r.type="vide"===o?"video":"soun"===o?"audio":o}var u=kt(e,["mdia","minf","stbl","stsd"])[0];if(u){var l=u.subarray(8);r.codec=wt(l.subarray(4,8));var c,d=kt(l,[r.codec])[0];d&&(/^[asm]vc[1-9]$/i.test(r.codec)?(c=d.subarray(78),"avcC"===wt(c.subarray(4,8))&&c.length>11?(r.codec+=".",r.codec+=Rt(c[9]),r.codec+=Rt(c[10]),r.codec+=Rt(c[11])):r.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(r.codec)?(c=d.subarray(28),"esds"===wt(c.subarray(4,8))&&c.length>20&&0!==c[19]?(r.codec+="."+Rt(c[19]),r.codec+="."+Rt(c[20]>>>2&63).replace(/^0/,"")):r.codec="mp4a.40.2"):r.codec=r.codec.toLowerCase())}var h=kt(e,["mdia","mdhd"])[0];h&&(r.timescale=Tt(h)),n.push(r)})),n};var Mt=_t,Ut=bt,Bt=function(e){var t=31&e[1];return(t<<=8)|e[2]},jt=function(e){return!!(64&e[1])},Ft=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},Ht=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}},qt={parseType:function(e,t){var n=Bt(e);return 0===n?"pat":n===t?"pmt":t?"pes":null},parsePat:function(e){var t=jt(e),n=4+Ft(e);return t&&(n+=e[n]+1),(31&e[n+10])<<8|e[n+11]},parsePmt:function(e){var t={},n=jt(e),i=4+Ft(e);if(n&&(i+=e[i]+1),1&e[i+5]){var r;r=3+((15&e[i+1])<<8|e[i+2])-4;for(var a=12+((15&e[i+10])<<8|e[i+11]);a=e.byteLength)return null;var n,i=null;return 192&(n=e[t+7])&&((i={}).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,i.pts*=4,i.pts+=(6&e[t+13])>>>1,i.dts=i.pts,64&n&&(i.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,i.dts*=4,i.dts+=(6&e[t+18])>>>1)),i},videoPacketContainsKeyFrame:function(e){for(var t=4+Ft(e),n=e.subarray(t),i=0,r=0,a=!1;r3&&"slice_layer_without_partitioning_rbsp_idr"===Ht(31&n[r+3])&&(a=!0),a}},Vt=Le,Wt={};Wt.ts=qt,Wt.aac=at;var zt=re,Xt=188,Gt=71,Kt=function(e,t,n){for(var i,r,a,s,o=0,u=Xt,l=!1;u<=e.byteLength;)if(e[o]!==Gt||e[u]!==Gt&&u!==e.byteLength)o++,u++;else{if(i=e.subarray(o,u),"pes"===Wt.ts.parseType(i,t.pid)&&(r=Wt.ts.parsePesType(i,t.table),a=Wt.ts.parsePayloadUnitStartIndicator(i),"audio"===r&&a&&(s=Wt.ts.parsePesTime(i))&&(s.type="audio",n.audio.push(s),l=!0)),l)break;o+=Xt,u+=Xt}for(o=(u=e.byteLength)-Xt,l=!1;o>=0;)if(e[o]!==Gt||e[u]!==Gt&&u!==e.byteLength)o--,u--;else{if(i=e.subarray(o,u),"pes"===Wt.ts.parseType(i,t.pid)&&(r=Wt.ts.parsePesType(i,t.table),a=Wt.ts.parsePayloadUnitStartIndicator(i),"audio"===r&&a&&(s=Wt.ts.parsePesTime(i))&&(s.type="audio",n.audio.push(s),l=!0)),l)break;o-=Xt,u-=Xt}},Yt=function(e,t,n){for(var i,r,a,s,o,u,l,c=0,d=Xt,h=!1,p={data:[],size:0};d=0;)if(e[c]!==Gt||e[d]!==Gt)c--,d--;else{if(i=e.subarray(c,d),"pes"===Wt.ts.parseType(i,t.pid)&&(r=Wt.ts.parsePesType(i,t.table),a=Wt.ts.parsePayloadUnitStartIndicator(i),"video"===r&&a&&(s=Wt.ts.parsePesTime(i))&&(s.type="video",n.video.push(s),h=!0)),h)break;c-=Xt,d-=Xt}},Qt=function(e,t){var n;return n=Wt.aac.isLikelyAacData(e)?function(e){for(var t,n=!1,i=0,r=null,a=null,s=0,o=0;e.length-o>=3;){switch(Wt.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){n=!0;break}if((s=Wt.aac.parseId3TagSize(e,o))>e.length){n=!0;break}null===a&&(t=e.subarray(o,o+s),a=Wt.aac.parseAacTimestamp(t)),o+=s;break;case"audio":if(e.length-o<7){n=!0;break}if((s=Wt.aac.parseAdtsSize(e,o))>e.length){n=!0;break}null===r&&(t=e.subarray(o,o+s),r=Wt.aac.parseSampleRate(t)),i++,o+=s;break;default:o++}if(n)return null}if(null===r||null===a)return null;var u=zt/r;return{audio:[{type:"audio",dts:a,pts:a},{type:"audio",dts:a+1024*i*u,pts:a+1024*i*u}]}}(e):function(e){var t={pid:null,table:null},n={};for(var i in function(e,t){for(var n,i=0,r=Xt;r0}(f)){t.isFmp4=!0;var m=t.map.tracks,g={isFmp4:!0,hasVideo:!!m.video,hasAudio:!!m.audio};m.audio&&m.audio.codec&&"enca"!==m.audio.codec&&(g.audioCodec=m.audio.codec),m.video&&m.video.codec&&"encv"!==m.video.codec&&(g.videoCodec=m.video.codec),m.video&&m.audio&&(g.isMuxed=!0),i(t,g);var v=function(e){d(t,{data:f,type:g.hasAudio&&!g.isMuxed?"audio":"video"}),e&&e.length&&u(t,e),h(null,t,{})};lu({action:"probeMp4StartTime",timescales:t.map.timescales,data:f,transmuxer:t.transmuxer,callback:function(e){var i=e.data,a=e.startTime;n=i.buffer,t.bytes=f=i,g.hasAudio&&!g.isMuxed&&r(t,"audio","start",a),g.hasVideo&&r(t,"video","start",a),m.video&&i.byteLength&&t.transmuxer?lu({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:f,timescales:t.map.timescales,trackIds:[m.video.id],callback:function(e){n=e.data.buffer,t.bytes=f=e.data,e.logs.forEach((function(e){p(Ms.mergeOptions(e,{stream:"mp4CaptionParser"}))})),v(e.captions)}}):v()}})}else if(t.transmuxer){if(void 0===t.container&&(t.container=St(f)),"ts"!==t.container&&"aac"!==t.container)return i(t,{hasAudio:!1,hasVideo:!1}),void h(null,t,{});gu({segment:t,bytes:n,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p})}else h(null,t,{})},yu=function(e,t){var n,i=e.id,r=e.key,a=e.encryptedBytes,s=e.decryptionWorker;s.addEventListener("message",(function e(n){if(n.data.source===i){s.removeEventListener("message",e);var r=n.data.decrypted;t(new Uint8Array(r.bytes,r.byteOffset,r.byteLength))}})),n=r.bytes.slice?r.bytes.slice():new Uint32Array(Array.prototype.slice.call(r.bytes)),s.postMessage(jo({source:i,encrypted:a,key:n,iv:r.iv}),[a.buffer,n.buffer])},_u=function(e){var t=e.xhr,n=e.xhrOptions,i=e.decryptionWorker,r=e.segment,a=e.abortFn,s=e.progressFn,o=e.trackInfoFn,u=e.timingInfoFn,l=e.videoSegmentTimingInfoFn,c=e.audioSegmentTimingInfoFn,d=e.id3Fn,h=e.captionsFn,p=e.isEndOfTimeline,f=e.endedTimelineFn,m=e.dataFn,g=e.doneFn,v=e.onTransmuxerLog,y=[],_=function(e){var t=e.activeXhrs,n=e.decryptionWorker,i=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog,f=0,m=!1;return function(e,g){if(!m){if(e)return m=!0,hu(t),h(e,g);if((f+=1)===t.length){var v=function(){if(g.encryptedBytes)return function(e){var t=e.decryptionWorker,n=e.segment,i=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog;yu({id:n.requestId,key:n.key,encryptedBytes:n.encryptedBytes,decryptionWorker:t},(function(e){n.bytes=e,vu({segment:n,bytes:n.bytes,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p})}))}({decryptionWorker:n,segment:g,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p});vu({segment:g,bytes:g.bytes,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p})};if(g.endOfAllRequests=Date.now(),g.map&&g.map.encryptedBytes&&!g.map.bytes)return yu({decryptionWorker:n,id:g.requestId+"-init",encryptedBytes:g.map.encryptedBytes,key:g.map.key},(function(e){g.map.bytes=e,mu(g,(function(e){if(e)return hu(t),h(e,g);v()}))}));v()}}}}({activeXhrs:y,decryptionWorker:i,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:d,captionsFn:h,isEndOfTimeline:p,endedTimelineFn:f,dataFn:m,doneFn:g,onTransmuxerLog:v});if(r.key&&!r.key.bytes){var b=[r.key];r.map&&!r.map.bytes&&r.map.key&&r.map.key.resolvedUri===r.key.resolvedUri&&b.push(r.map.key);var T=t(Ms.mergeOptions(n,{uri:r.key.resolvedUri,responseType:"arraybuffer"}),fu(r,b,_));y.push(T)}if(r.map&&!r.map.bytes){if(r.map.key&&(!r.key||r.key.resolvedUri!==r.map.key.resolvedUri)){var S=t(Ms.mergeOptions(n,{uri:r.map.key.resolvedUri,responseType:"arraybuffer"}),fu(r,[r.map.key],_));y.push(S)}var E=Ms.mergeOptions(n,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:Ro(r.map)}),w=function(e){var t=e.segment,n=e.finishProcessingFn;return function(e,i){var r=pu(e,i);if(r)return n(r,t);var a=new Uint8Array(i.response);if(t.map.key)return t.map.encryptedBytes=a,n(null,t);t.map.bytes=a,mu(t,(function(e){if(e)return e.xhr=i,e.status=i.status,n(e,t);n(null,t)}))}}({segment:r,finishProcessingFn:_}),C=t(E,w);y.push(C)}var k=Ms.mergeOptions(n,{uri:r.part&&r.part.resolvedUri||r.resolvedUri,responseType:"arraybuffer",headers:Ro(r)}),x=t(k,function(e){var t=e.segment,n=e.finishProcessingFn,i=e.responseType;return function(e,r){var a=pu(e,r);if(a)return n(a,t);var s="arraybuffer"!==i&&r.responseText?function(e){for(var t=new Uint8Array(new ArrayBuffer(e.length)),n=0;n1)return bu("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},Eu=function(e){var t=0;return e.audio&&t++,e.video&&t++,t},wu=function(e,t){var n=t.attributes||{},i=Su(function(e){var t=e.attributes||{};if(t.CODECS)return te(t.CODECS)}(t)||[]);if(Tu(e,t)&&!i.audio&&!function(e,t){if(!Tu(e,t))return!0;var n=t.attributes||{},i=e.mediaGroups.AUDIO[n.AUDIO];for(var r in i)if(!i[r].uri&&!i[r].playlists)return!0;return!1}(e,t)){var r=Su(function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var n=e.mediaGroups.AUDIO[t];if(!n)return null;for(var i in n){var r=n[i];if(r.default&&r.playlists)return te(r.playlists[0].attributes.CODECS)}return null}(e,n.AUDIO)||[]);r.audio&&(i.audio=r.audio)}return i},Cu=Hs("PlaylistSelector"),ku=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||""})}},xu=function(e,t){if(!e)return"";var n=g().getComputedStyle(e);return n?n[t]:""},Iu=function(e,t){var n=e.slice();e.sort((function(e,i){var r=t(e,i);return 0===r?n.indexOf(e)-n.indexOf(i):r}))},Pu=function(e,t){var n,i;return e.attributes.BANDWIDTH&&(n=e.attributes.BANDWIDTH),n=n||g().Number.MAX_VALUE,t.attributes.BANDWIDTH&&(i=t.attributes.BANDWIDTH),n-(i||g().Number.MAX_VALUE)},Au=function(e,t,n,i,r,a){if(e){var s={bandwidth:t,width:n,height:i,limitRenditionByPlayerDimensions:r},o=e.playlists;go.isAudioOnly(e)&&(o=a.getAudioTrackPlaylists_(),s.audioOnly=!0);var u=o.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||g().Number.MAX_VALUE,width:t,height:n,playlist:e}}));Iu(u,(function(e,t){return e.bandwidth-t.bandwidth}));var l=(u=u.filter((function(e){return!go.isIncompatible(e.playlist)}))).filter((function(e){return go.isEnabled(e.playlist)}));l.length||(l=u.filter((function(e){return!go.isDisabled(e.playlist)})));var c=l.filter((function(e){return e.bandwidth*Zo.BANDWIDTH_VARIANCEn||e.height>i}))).filter((function(e){return e.width===y[0].width&&e.height===y[0].height})),d=_[_.length-1],b=_.filter((function(e){return e.bandwidth===d.bandwidth}))[0]),a.experimentalLeastPixelDiffSelector){var E=m.map((function(e){return e.pixelDiff=Math.abs(e.width-n)+Math.abs(e.height-i),e}));Iu(E,(function(e,t){return e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff})),T=E[0]}var w=T||b||S||h||l[0]||u[0];if(w&&w.playlist){var C="sortedPlaylistReps";return T?C="leastPixelDiffRep":b?C="resolutionPlusOneRep":S?C="resolutionBestRep":h?C="bandwidthBestRep":l[0]&&(C="enabledPlaylistReps"),Cu("choosing "+ku(w)+" using "+C+" with options",s),w.playlist}return Cu("could not choose a playlist with options",s),null}},Ou=function(){var e=this.useDevicePixelRatio&&g().devicePixelRatio||1;return Au(this.playlists.master,this.systemBandwidth,parseInt(xu(this.tech_.el(),"width"),10)*e,parseInt(xu(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},Lu=function(e,t,n){var i,r;if(n&&n.cues)for(i=n.cues.length;i--;)(r=n.cues[i]).startTime>=e&&r.endTime<=t&&n.removeCue(r)},Du=function(e){return"number"==typeof e&&isFinite(e)},Nu=1/60,Ru=function(e){var t=e.startOfSegment,n=e.duration,i=e.segment,r=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,h=e.timeline,p=l.length-1,f="mediaIndex/partIndex increment";e.getMediaInfoForTime?f="getMediaInfoForTime ("+e.getMediaInfoForTime+")":e.isSyncRequest&&(f="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(f+=" with independent "+e.independent);var m="number"==typeof d,g=e.segment.uri?"segment":"pre-segment",v=m?to({preloadSegment:i})-1:0;return g+" ["+(s+c)+"/"+(s+p)+"]"+(m?" part ["+d+"/"+v+"]":"")+" segment start/end ["+i.start+" => "+i.end+"]"+(m?" part start/end ["+r.start+" => "+r.end+"]":"")+" startOfSegment ["+t+"] duration ["+n+"] timeline ["+h+"] selected by ["+f+"] playlist ["+o+"]"},Mu=function(e){return e+"TimingInfo"},Uu=function(e){var t=e.timelineChangeController,n=e.currentTimeline,i=e.segmentTimeline,r=e.loaderType,a=e.audioDisabled;if(n===i)return!1;if("audio"===r){var s=t.lastTimelineChange({type:"main"});return!s||s.to!==i}if("main"===r&&a){var o=t.pendingTimelineChange({type:"audio"});return!o||o.to!==i}return!1},Bu=function(e){var t=e.segmentDuration,n=e.maxDuration;return!!t&&Math.round(t)>n+qs},ju=function(e){function t(t,n){var i;if(i=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 i.bandwidth=t.bandwidth,i.throughput={rate:0,count:0},i.roundTrip=NaN,i.resetStats_(),i.mediaIndex=null,i.partIndex=null,i.hasPlayed_=t.hasPlayed,i.currentTime_=t.currentTime,i.seekable_=t.seekable,i.seeking_=t.seeking,i.duration_=t.duration,i.mediaSource_=t.mediaSource,i.vhs_=t.vhs,i.loaderType_=t.loaderType,i.currentMediaInfo_=void 0,i.startingMediaInfo_=void 0,i.segmentMetadataTrack_=t.segmentMetadataTrack,i.goalBufferLength_=t.goalBufferLength,i.sourceType_=t.sourceType,i.sourceUpdater_=t.sourceUpdater,i.inbandTextTracks_=t.inbandTextTracks,i.state_="INIT",i.timelineChangeController_=t.timelineChangeController,i.shouldSaveSegmentTimingInfo_=!0,i.parse708captions_=t.parse708captions,i.captionServices_=t.captionServices,i.experimentalExactManifestTimings=t.experimentalExactManifestTimings,i.checkBufferTimeout_=null,i.error_=void 0,i.currentTimeline_=-1,i.pendingSegment_=null,i.xhrOptions_=null,i.pendingSegments_=[],i.audioDisabled_=!1,i.isPendingTimestampOffset_=!1,i.gopBuffer_=[],i.timeMapping_=0,i.safeAppend_=Ms.browser.IE_VERSION>=11,i.appendInitSegment_={audio:!0,video:!0},i.playlistOfLastInitSegment_={audio:null,video:null},i.callQueue_=[],i.loadQueue_=[],i.metadataQueue_={id3:[],caption:[]},i.waitingOnRemove_=!1,i.quotaExceededErrorRetryTimeout_=null,i.activeInitSegmentId_=null,i.initSegments_={},i.cacheEncryptionKeys_=t.cacheEncryptionKeys,i.keyCache_={},i.decrypter_=t.decrypter,i.syncController_=t.syncController,i.syncPoint_={segmentIndex:0,time:0},i.transmuxer_=i.createTransmuxer_(),i.triggerSyncInfoUpdate_=function(){return i.trigger("syncinfoupdate")},i.syncController_.on("syncinfoupdate",i.triggerSyncInfoUpdate_),i.mediaSource_.addEventListener("sourceopen",(function(){i.isEndOfStream_()||(i.ended_=!1)})),i.fetchAtBuffer_=!1,i.logger_=Hs("SegmentLoader["+i.loaderType_+"]"),Object.defineProperty(b(i),"state",{get:function(){return this.state_},set:function(e){e!==this.state_&&(this.logger_(this.state_+" -> "+e),this.state_=e,this.trigger("statechange"))}}),i.sourceUpdater_.on("ready",(function(){i.hasEnoughInfoToAppend_()&&i.processCallQueue_()})),"main"===i.loaderType_&&i.timelineChangeController_.on("pendingtimelinechange",(function(){i.hasEnoughInfoToAppend_()&&i.processCallQueue_()})),"audio"===i.loaderType_&&i.timelineChangeController_.on("timelinechange",(function(){i.hasEnoughInfoToLoad_()&&i.processLoadQueue_(),i.hasEnoughInfoToAppend_()&&i.processCallQueue_()})),i}S(t,e);var n=t.prototype;return n.createTransmuxer_=function(){return function(e){var t=new ru;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_&&g().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,g().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_&&uu(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},n.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Ms.createTimeRanges();if("main"===this.loaderType_){var t=e.hasAudio,n=e.hasVideo,i=e.isMuxed;if(n&&t&&!this.audioDisabled_&&!i)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=Fo(e),i=this.initSegments_[n];return t&&!i&&e.bytes&&(this.initSegments_[n]=i={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),i||e},n.segmentKey=function(e,t){if(void 0===t&&(t=!1),!e)return null;var n=Ho(e),i=this.keyCache_[n];this.cacheEncryptionKeys_&&t&&!i&&e.bytes&&(this.keyCache_[n]=i={resolvedUri:e.resolvedUri,bytes:e.bytes});var r={resolvedUri:(i||e).resolvedUri};return i&&(r.bytes=i.bytes),r},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_,i=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 r=null;if(n&&(n.id?r=n.id:n.uri&&(r=n.uri)),this.logger_("playlist update ["+r+" => "+(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}}i&&(i.mediaIndex-=a,i.mediaIndex<0?(i.mediaIndex=null,i.partIndex=null):(i.mediaIndex>=0&&(i.segment=e.segments[i.mediaIndex]),i.partIndex>=0&&i.segment.parts&&(i.part=i.segment.parts[i.partIndex]))),this.syncController_.saveExpiredSegmentInfo(n,e)}},n.pause=function(){this.checkBufferTimeout_&&(g().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},n.paused=function(){return null===this.checkBufferTimeout_},n.resetEverything=function(e){this.ended_=!1,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_&&uu(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,i){if(void 0===n&&(n=function(){}),void 0===i&&(i=!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 r=1,a=function(){0==--r&&n()};for(var s in!i&&this.audioDisabled_||(r++,this.sourceUpdater_.removeAudio(e,t,a)),(i||"main"===this.loaderType_)&&(this.gopBuffer_=function(e,t,n,i){for(var r=Math.ceil((t-i)*Et.ONE_SECOND_IN_TS),a=Math.ceil((n-i)*Et.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<=r););return u=Math.max(u,0),s.splice(u,o-u+1),s}(this.gopBuffer_,e,t,this.timeMapping_),r++,this.sourceUpdater_.removeVideo(e,t,a)),this.inbandTextTracks_)Lu(e,t,this.inbandTextTracks_[s]);Lu(e,t,this.segmentMetadataTrack_),a()}else this.logger_("skipping remove because no source updater or starting media info")},n.monitorBuffer_=function(){this.checkBufferTimeout_&&g().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=g().setTimeout(this.monitorBufferTick_.bind(this),1)},n.monitorBufferTick_=function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&g().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=g().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 i="number"==typeof e&&t.segments[e],r=e+1===t.segments.length,a=!i||!i.parts||n+1===i.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&r&&a},n.chooseNextRequest_=function(){var e=this.buffered_(),t=Ys(e)||0,n=Qs(e,this.currentTime_()),i=!this.hasPlayed_()&&n>=1,r=n>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||i||r)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 i=[],r=0,a=0;an))return a}return 0===i.length?0:i[i.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=go.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,h=l.partIndex;s.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+t:"currentTime "+this.currentTime_(),s.mediaIndex=c,s.startOfSegment=d,s.partIndex=h}var p=a[s.mediaIndex],f=p&&"number"==typeof s.partIndex&&p.parts&&p.parts[s.partIndex];if(!p||"number"==typeof s.partIndex&&!f)return null;if("number"!=typeof s.partIndex&&p.parts&&(s.partIndex=0,f=p.parts[0]),!n&&f&&!f.independent)if(0===s.partIndex){var m=a[s.mediaIndex-1],g=m.parts&&m.parts.length&&m.parts[m.parts.length-1];g&&g.independent&&(s.mediaIndex-=1,s.partIndex=m.parts.length-1,s.independent="previous segment")}else p.parts[s.partIndex-1].independent&&(s.partIndex-=1,s.independent="previous part");var v=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return s.mediaIndex>=a.length-1&&v&&!this.seeking_()?null:this.generateSegmentInfo_(s)},n.generateSegmentInfo_=function(e){var t=e.independent,n=e.playlist,i=e.mediaIndex,r=e.startOfSegment,a=e.isSyncRequest,s=e.partIndex,o=e.forceTimestampOffset,u=e.getMediaInfoForTime,l=n.segments[i],c="number"==typeof s&&l.parts[s],d={requestId:"segment-loader-"+Math.random(),uri:c&&c.resolvedUri||l.resolvedUri,mediaIndex:i,partIndex:c?s:null,isSyncRequest:a,startOfSegment:r,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},h=void 0!==o?o:this.isPendingTimestampOffset_;d.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:l.timeline,currentTimeline:this.currentTimeline_,startOfSegment:r,buffered:this.buffered_(),overrideCheck:h});var p=Ys(this.sourceUpdater_.audioBuffered());return"number"==typeof p&&(d.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(d.gopsToAlignWith=function(e,t,n){if(null==t||!e.length)return[];var i,r=Math.ceil((t-n+3)*Et.ONE_SECOND_IN_TS);for(i=0;ir);i++);return e.slice(i)}(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),d},n.timestampOffsetForSegment_=function(e){return n=(t=e).segmentTimeline,i=t.currentTimeline,r=t.startOfSegment,a=t.buffered,t.overrideCheck||n!==i?n "+s+" for "+e),function(e,t,n){if(!e[n]){t.trigger({type:"usage",name:"vhs-608"}),t.trigger({type:"usage",name:"hls-608"});var i=n;/^cc708_/.test(n)&&(i="SERVICE"+n.split("_")[1]);var r=t.textTracks().getTrackById(i);if(r)e[n]=r;else{var a=n,s=n,o=!1,u=(t.options_.vhs&&t.options_.vhs.captionServices||{})[i];u&&(a=u.label,s=u.language,o=u.default),e[n]=t.addRemoteTextTrack({kind:"captions",id:i,default:o,label:a,language:s},!1).track}}}(u,n.vhs_.tech_,e),Lu(a,s,u[e]),function(e){var t=e.inbandTextTracks,n=e.captionArray,i=e.timestampOffset;if(n){var r=g().WebKitDataCue||g().VTTCue;n.forEach((function(e){var n=e.stream;t[n].addCue(new r(e.startTime+i,e.endTime+i,e.text))}))}}({captionArray:o,inbandTextTracks:u,timestampOffset:i})})),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 i=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,i=e.timestampOffset,r=e.videoDuration;if(n){var a=g().WebKitDataCue||g().VTTCue,s=t.metadataTrack_;if(s&&(n.forEach((function(e){var t=e.cueTime+i;!("number"!=typeof t||g().isNaN(t)||t<0)&&t<1/0&&e.frames.forEach((function(e){var 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:function(){return Ms.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return Ms.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return Ms.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})}(n),s.addCue(n)}))})),s.cues&&s.cues.length)){for(var o=s.cues,u=[],l=0;l1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Ks(s).join(", ")),o.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Ks(o).join(", "));var u=s.length?s.start(0):0,l=s.length?s.end(s.length-1):0,c=o.length?o.start(0):0,d=o.length?o.end(o.length-1):0;if(l-u<=1&&d-c<=1)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+a.byteLength+", audio buffer: "+Ks(s).join(", ")+", video buffer: "+Ks(o).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:i,type:r,bytes:a}));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_=g().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,i=e.type,r=e.bytes;t&&(22!==t.code?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",t),this.error(i+" append of "+r.length+"b failed for segment #"+n.mediaIndex+" in playlist "+n.playlist.id),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:n,type:i,bytes:r}))},n.appendToSourceBuffer_=function(e){var t,n,i,r=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),i=0,(t={bytes:c,segments:l}).bytes&&(n=new Uint8Array(t.bytes),t.segments.forEach((function(e){n.set(e,i),i+=e.byteLength}))),u=n}this.sourceUpdater_.appendBuffer({segmentInfo:r,type:a,bytes:u},this.handleAppendError_.bind(this,{segmentInfo:r,type:a,bytes:u}))},n.handleSegmentTimingInfo_=function(e,t,n){if(this.pendingSegment_&&t===this.pendingSegment_.requestId){var i=this.pendingSegment_.segment,r=e+"TimingInfo";i[r]||(i[r]={}),i[r].transmuxerPrependedSeconds=n.prependedContentDuration||0,i[r].transmuxedPresentationStart=n.start.presentation,i[r].transmuxedDecodeStart=n.start.decode,i[r].transmuxedPresentationEnd=n.end.presentation,i[r].transmuxedDecodeEnd=n.end.decode,i[r].baseMediaDecodeTime=n.baseMediaDecodeTime}},n.appendData_=function(e,t){var n=t.type,i=t.data;if(i&&i.byteLength&&("audio"!==n||!this.audioDisabled_)){var r=this.getInitSegmentAndUpdateState_({type:n,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:n,initSegment:r,data:i})}},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=_({},e,{forceTimestampOffset:!0});_(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),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=null!==this.mediaIndex,a=e.timeline!==this.currentTimeline_&&e.timeline>0,s=i||r&&a;this.logger_("Requesting "+Ru(e)),n.map&&!n.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=_u({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 i=n.message,r=n.level,a=n.stream;t.logger_(Ru(e)+" logged from transmuxer stream "+a+" as a "+r+": "+i)}})},n.trimBackBuffer_=function(e){var t=function(e,t,n){var i=t-Zo.BACK_BUFFER_LENGTH;e.length&&(i=Math.max(i,e.start(0)));var r=t-n;return Math.min(r,i)}(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,i={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},r=e.playlist.segments[e.mediaIndex-1];if(r&&r.timeline===t.timeline&&(r.videoTimingInfo?i.baseStartTime=r.videoTimingInfo.transmuxedDecodeEnd:r.audioTimingInfo&&(i.baseStartTime=r.audioTimingInfo.transmuxedDecodeEnd)),t.key){var a=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);i.key=this.segmentKey(t.key),i.key.iv=a}return t.map&&(i.map=this.initSegmentForMap(t.map)),i},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=i);r++);return e.slice(0,r).concat(t)}(this.gopBuffer_,n.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(i)}},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,i=e.mediaIndex,r=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[i-1];return 0!==i&&l&&void 0!==l.start&&l.end===r+a?o.start:r},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,i=t.hasVideo,r=t.isMuxed,a="main"===this.loaderType_&&i,s=!this.audioDisabled_&&n&&!r;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-=e.timingInfo.start,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.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,i,r,a,s=(n=e.audioTimingInfo,i=e.videoTimingInfo,r=n&&"number"==typeof n.start&&"number"==typeof n.end?n.end-n.start:0,a=i&&"number"==typeof i.start&&"number"==typeof i.end?i.end-i.start:0,Math.max(r,a));if(!s)return null;var o=e.playlist.targetDuration,u=Bu({segmentDuration:s,maxDuration:2*o}),l=Bu({segmentDuration:s,maxDuration:o}),c="Segment with index "+e.mediaIndex+" from playlist "+e.playlist.id+" has a duration of "+s+" when the reported duration is "+e.duration+" and the target duration is "+o+". 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 u||l?{severity:u?"warn":"info",message:c}:null}(e,this.sourceType_);if(t&&("warn"===t.severity?Ms.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 "+Ru(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,i=e.part,r=n.end&&this.currentTime_()-n.end>3*e.playlist.targetDuration,a=i&&i.end&&this.currentTime_()-i.end>3*e.playlist.partTargetDuration;if(r||a)return this.logger_("bad "+(r?"segment":"part")+" "+Ru(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 "+Ru(e))},n.recordThroughput_=function(e){if(e.duration=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 i=this;if(this.subtitlesTrack_){if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===cu&&this.handleTimeout_(),e.code===du?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);var r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),this.state="APPENDING",this.trigger("appending");var a=r.segment;if(a.map&&(a.map.bytes=t.map.bytes),r.bytes=t.bytes,"function"!=typeof g().WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var s,o=function(){i.subtitlesTrack_.tech_.off("vttjsloaded",s),i.stopForError({message:"Error loading vtt.js"})};return s=function(){i.subtitlesTrack_.tech_.off("vttjserror",o),i.segmentRequestFinished_(e,t,n)},this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",s),void this.subtitlesTrack_.tech_.one("vttjserror",o)}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((function(e){i.subtitlesTrack_.addCue(i.featuresNativeTextTracks_?new(g().VTTCue)(e.startTime,e.endTime,e.text):e)})),function(e){var t=e.cues;if(t)for(var n=0;n1&&i.push(t[a]);i.length&&i.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;"function"==typeof g().TextDecoder?t=new(g().TextDecoder)("utf8"):(t=g().WebVTT.StringDecoder(),n=!0);var i=new(g().WebVTT.Parser)(g(),g().vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},i.oncue=e.cues.push.bind(e.cues),i.ontimestampmap=function(t){e.timestampmap=t},i.onparsingerror=function(e){Ms.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){var r=e.segment.map.bytes;n&&(r=al(r)),i.parse(r)}var a=e.bytes;n&&(a=al(a)),i.parse(a),i.flush()},n.updateTimeMapping_=function(e,t,n){var i=e.segment;if(t)if(e.cues.length){var r=e.timestampmap,a=r.MPEGTS/Et.ONE_SECOND_IN_TS-r.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-i.duration)}}}else i.empty=!0},t}(ju),ul=function(e,t){for(var n=e.cues,i=0;i=r.adStartTime&&t<=r.adEndTime)return r}return null},ll=[{name:"VOD",run:function(e,t,n,i,r){return n!==1/0?{time:0,segmentIndex:0,partIndex:null}:null}},{name:"ProgramDateTime",run:function(e,t,n,i,r){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;var a=null,s=null,o=Js(t);r=r||0;for(var u=0;u=h)&&(s=h,a={time:d,segmentIndex:l.segmentIndex,partIndex:l.partIndex})}}return a}},{name:"Discontinuity",run:function(e,t,n,i,r){var a=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var s=null,o=0;o=d)&&(s=d,a={time:c.time,segmentIndex:u,partIndex:null})}}return a}},{name:"Playlist",run:function(e,t,n,i,r){return t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}}],cl=function(e){function t(t){var n;return(n=e.call(this)||this).timelines=[],n.discontinuities=[],n.timelineToDatetimeMappings={},n.logger_=Hs("SyncController"),n}S(t,e);var n=t.prototype;return n.getSyncPoint=function(e,t,n,i){var r=this.runStrategies_(e,t,n,i);return r.length?this.selectSyncPoint_(r,{key:"time",value:i}):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 i=this.selectSyncPoint_(n,{key:"segmentIndex",value:0});return i.segmentIndex>0&&(i.time*=-1),Math.abs(i.time+ao({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:i.segmentIndex,endIndex:0}))},n.runStrategies_=function(e,t,n,i){for(var r=[],a=0;a86400)Ms.log.warn("Not saving expired segment info. Media sequence gap "+n+" is too large.");else for(var i=n-1;i>=0;i--){var r=e.segments[i];if(r&&void 0!==r.start){t.syncInfo={mediaSequence:e.mediaSequence+i,time:r.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,i=this.calculateSegmentTimeMapping_(t,t.timingInfo,n),r=t.segment;i&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:r.start}));var a=r.dateTimeObject;r.discontinuity&&n&&a&&(this.timelineToDatetimeMappings[r.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 i,r,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+"]")),i=e.startOfSegment,r=t.end+o.mapping;else{if(!o)return!1;i=t.start+o.mapping,r=t.end+o.mapping}return s&&(s.start=i,s.end=r),(!a.start||io){var u;u=s<0?n.start-ao({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:r}):n.end+ao({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:r}),this.discontinuities[a]={time:u,accuracy:o}}}},n.dispose=function(){this.trigger("dispose"),this.off()},t}(Ms.EventTarget),dl=function(e){function t(){var t;return(t=e.call(this)||this).pendingTimelineChanges_={},t.lastTimelineChanges_={},t}S(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,i=e.to;return"number"==typeof n&&"number"==typeof i&&(this.pendingTimelineChanges_[t]={type:t,from:n,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t]},n.lastTimelineChange=function(e){var t=e.type,n=e.from,i=e.to;return"number"==typeof n&&"number"==typeof i&&(this.lastTimelineChanges_[t]={type:t,from:n,to:i},delete this.pendingTimelineChanges_[t],this.trigger("timelinechange")),this.lastTimelineChanges_[t]},n.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},t}(Ms.EventTarget),hl=tu(nu((function(){function e(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 t=e((function(e){function t(e,t){for(var n=0;n-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var n=t.length,i=0;i>7))^e]=e;for(t=n=0;!d[t];t^=i||1,n=f[n]||1)for(a=(a=n^n<<1^n<<2^n<<3^n<<4)>>8^255&a^99,d[t]=a,h[a]=t,o=16843009*p[r=p[i=p[t]]]^65537*r^257*i^16843008*t,s=257*p[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=[[a[0][0].slice(),a[0][1].slice(),a[0][2].slice(),a[0][3].slice(),a[0][4].slice()],[a[1][0].slice(),a[1][1].slice(),a[1][2].slice(),a[1][3].slice(),a[1][4].slice()]];var r=this._tables[0][4],s=this._tables[1],o=e.length,u=1;if(4!==o&&6!==o&&8!==o)throw new Error("Invalid aes key size");var l=e.slice(0),c=[];for(this._key=[l,c],t=o;t<4*o+28;t++)i=l[t-1],(t%o==0||8===o&&t%o==4)&&(i=r[i>>>24]<<24^r[i>>16&255]<<16^r[i>>8&255]<<8^r[255&i],t%o==0&&(i=i<<8^i>>>24^u<<24,u=u<<1^283*(u>>7))),l[t]=l[t-o]^i;for(n=0;t;n++,t--)i=l[3&n?t:t-4],c[n]=t<=4||n<4?i:s[0][r[i>>>24]]^s[1][r[i>>16&255]]^s[2][r[i>>8&255]]^s[3][r[255&i]]}return e.prototype.decrypt=function(e,t,n,i,r,a){var s,o,u,l,c=this._key[1],d=e^c[0],h=i^c[1],p=n^c[2],f=t^c[3],m=c.length/4-2,g=4,v=this._tables[1],y=v[0],_=v[1],b=v[2],T=v[3],S=v[4];for(l=0;l>>24]^_[h>>16&255]^b[p>>8&255]^T[255&f]^c[g],o=y[h>>>24]^_[p>>16&255]^b[f>>8&255]^T[255&d]^c[g+1],u=y[p>>>24]^_[f>>16&255]^b[d>>8&255]^T[255&h]^c[g+2],f=y[f>>>24]^_[d>>16&255]^b[h>>8&255]^T[255&p]^c[g+3],g+=4,d=s,h=o,p=u;for(l=0;l<4;l++)r[(3&-l)+a]=S[d>>>24]<<24^S[h>>16&255]<<16^S[p>>8&255]<<8^S[255&f]^c[g++],s=d,d=h,h=p,p=f,f=s},e}(),o=function(e){function t(){var t;return(t=e.call(this,r)||this).jobs=[],t.delay=1,t.timeout_=null,t}i(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}(r),u=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},l=function(){function e(t,n,i,r){var a=e.STEP,s=new Int32Array(t.buffer),l=new Uint8Array(t.byteLength),c=0;for(this.asyncStream_=new o,this.asyncStream_.push(this.decryptChunk_(s.subarray(c,c+a),n,i,l)),c=a;c>2),m=new s(Array.prototype.slice.call(t)),g=new Uint8Array(e.byteLength),v=new Int32Array(g.buffer);for(i=n[0],r=n[1],a=n[2],o=n[3],p=0;p=0&&(t="main-desc"),t},ml=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},gl=function(e,t){t.activePlaylistLoader=e,e.load()},vl={AUDIO:function(e,t){return function(){var n=t.segmentLoaders[e],i=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;ml(n,i);var a=i.activeTrack(),s=i.activeGroup(),o=(s.filter((function(e){return e.default}))[0]||s[0]).id,u=i.tracks[o];if(a!==u){for(var l in Ms.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),i.tracks)i.tracks[l].enabled=i.tracks[l]===u;i.onTrackChanged()}else r({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,t){return function(){var n=t.segmentLoaders[e],i=t.mediaTypes[e];Ms.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),ml(n,i);var r=i.activeTrack();r&&(r.mode="disabled"),i.onTrackChanged()}}},yl={AUDIO:function(e,t,n){if(t){var i=n.tech,r=n.requestOptions,a=n.segmentLoaders[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),(!i.paused()||e.endList&&"none"!==i.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),i.paused()||a.load()})),t.on("error",vl[e](e,n))}},SUBTITLES:function(e,t,n){var i=n.tech,r=n.requestOptions,a=n.segmentLoaders[e],s=n.mediaTypes[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),a.track(s.activeTrack()),(!i.paused()||e.endList&&"none"!==i.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),i.paused()||a.load()})),t.on("error",vl[e](e,n))}},_l={AUDIO:function(e,t){var n=t.vhs,i=t.sourceType,r=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,h=mo(d.master);for(var p in s[e]&&0!==Object.keys(s[e]).length||(s[e]={main:{default:{default:!0}}},h&&(s[e].main.default.playlists=d.master.playlists)),s[e])for(var f in u[p]||(u[p]=[]),s[e][p]){var m=s[e][p][f],g=void 0;if(h?(c("AUDIO group '"+p+"' label '"+f+"' is a master playlist"),m.isMasterPlaylist=!0,g=null):g="vhs-json"===i&&m.playlists?new Ao(m.playlists[0],n,a):m.resolvedUri?new Ao(m.resolvedUri,n,a):m.playlists&&"dash"===i?new $o(m.playlists[0],n,a,d):null,m=Ms.mergeOptions({id:f,playlistLoader:g},m),yl[e](e,m.playlistLoader,t),u[p].push(m),void 0===l[f]){var v=new Ms.AudioTrack({id:f,kind:fl(m),enabled:!1,language:m.language,default:m.default,label:f});l[f]=v}}r.on("error",vl[e](e,t))},SUBTITLES:function(e,t){var n=t.tech,i=t.vhs,r=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 h in o[e])for(var p in l[h]||(l[h]=[]),o[e][h])if(!o[e][h][p].forced){var f=o[e][h][p],m=void 0;if("hls"===r)m=new Ao(f.resolvedUri,i,s);else if("dash"===r){if(!f.playlists.filter((function(e){return e.excludeUntil!==1/0})).length)return;m=new $o(f.playlists[0],i,s,d)}else"vhs-json"===r&&(m=new Ao(f.playlists?f.playlists[0]:f.resolvedUri,i,s));if(f=Ms.mergeOptions({id:p,playlistLoader:m},f),yl[e](e,f.playlistLoader,t),l[h].push(f),void 0===c[p]){var g=n.addRemoteTextTrack({id:p,kind:"subtitles",default:f.default&&f.autoselect,language:f.language,label:p},!1).track;c[p]=g}}a.on("error",vl[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var n=t.tech,i=t.master.mediaGroups,r=t.mediaTypes[e],a=r.groups,s=r.tracks;for(var o in i[e])for(var u in a[o]||(a[o]=[]),i[e][o]){var l=i[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=Ms.mergeOptions(d,c[d.instreamId])),void 0===d.default&&delete d.default,a[o].push(Ms.mergeOptions({id:u},l)),void 0===s[u]){var h=n.addRemoteTextTrack({id:d.instreamId,kind:"captions",default:d.default,language:d.language,label:d.label},!1).track;s[u]=h}}}}},bl=function e(t,n){for(var i=0;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_=g().setInterval((function(){return e.checkABR_()}),250)},n.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(g().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,i=e.mediaGroups.AUDIO,r=Object.keys(i);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{var a=i.main||r.length&&i[r[0]];for(var s in a)if(a[s].default){n={label:s};break}}if(!n)return t;var o=[];for(var u in i)if(i[u][n.label]){var l=i[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;c1&&mo(t.master))for(var u=0;u1&&(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(),i=this.bufferLowWaterLine(),r=this.bufferHighWaterLine();return function(e){var t=e.currentPlaylist,n=e.buffered,i=e.currentTime,r=e.nextPlaylist,a=e.bufferLowWaterLine,s=e.bufferHighWaterLine,o=e.duration,u=e.experimentalBufferBasedABR,l=e.log;if(!r)return Ms.log.warn("We received no playlist to switch to. Please check your stream."),!1;var c="allowing switch "+(t&&t.id||"null")+" -> "+r.id;if(!t)return l(c+" as current playlist is not set"),!0;if(r.id===t.id)return!1;var d=Boolean(zs(n,i).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 h=Qs(n,i),p=u?Zo.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Zo.MAX_BUFFER_LOW_WATER_LINE;if(om)&&h>=a){var v=c+" as forwardBuffer >= bufferLowWaterLine ("+h+" >= "+a+")";return u&&(v+=" and next bandwidth > current bandwidth ("+f+" > "+m+")"),l(v),!0}return l("not "+c+" as no switching criteria met"),!1}({buffered:this.tech_.buffered(),currentTime:n,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:i,bufferHighWaterLine:r,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},n.setupSegmentLoaderListeners_=function(){var e=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",(function(){var t=e.selectPlaylist();e.shouldSwitchToMedia_(t)&&e.switchMedia_(t,"bandwidthupdate"),e.tech_.trigger("bandwidthupdate")})),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(){Ms.browser.IE_VERSION||Ms.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()this.maxPlaylistRetries?1/0:Date.now()+1e3*t,n.excludeUntil=i,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_:Ms.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,h="number"==typeof u.lastRequest&&Date.now()-u.lastRequest<=d;return this.switchMedia_(u,"exclude",s||h)},n.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},n.delegateLoaders_=function(e,t){var n=this,i=[],r="all"===e;(r||"main"===e)&&i.push(this.masterPlaylistLoader_);var a=[];(r||"audio"===e)&&a.push("AUDIO"),(r||"subtitle"===e)&&(a.push("CLOSED-CAPTIONS"),a.push("SUBTITLES")),a.forEach((function(e){var t=n.mediaTypes_[e]&&n.mediaTypes_[e].activePlaylistLoader;t&&i.push(t)})),["main","audio","subtitle"].forEach((function(t){var r=n[t+"SegmentLoader_"];!r||e!==t&&"all"!==e||i.push(r)})),i.forEach((function(e){return t.forEach((function(t){"function"==typeof e[t]&&e[t]()}))}))},n.setCurrentTime=function(e){var t=zs(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:Hu.Playlist.duration(e):1/0:0},n.seekable=function(){return this.seekable_},n.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_&&!this.sourceUpdater_.hasCreatedSourceBuffers()){var t=this.masterPlaylistLoader_.media();if(t){var n=this.syncController_.getExpiredTime(t,this.duration());if(null!==n){var i=this.masterPlaylistLoader_.master,r=Hu.Playlist.seekable(t,n,Hu.Playlist.liveEdgeDelay(i,t));if(0!==r.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=Hu.Playlist.seekable(t,n,Hu.Playlist.liveEdgeDelay(i,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)>r.end(0)||r.start(0)>e.end(0)?this.seekable_=r:this.seekable_=Ms.createTimeRanges([[e.start(0)>r.start(0)?e.start(0):r.start(0),e.end(0)0&&(i=Math.max(i,n.end(n.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}},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 i in n)n[i].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_()||{}};t.video=t.main;var n=wu(this.master(),this.media()),i={},r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(i.video=n.video||t.main.videoCodec||"avc1.4d400d"),t.main.isMuxed&&(i.video+=","+(n.audio||t.main.audioCodec||se)),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||r)&&(i.audio=n.audio||t.main.audioCodec||t.audio.audioCodec||se,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),i.audio||i.video){var a,s={};if(["video","audio"].forEach((function(e){if(i.hasOwnProperty(e)&&(r=t[e].isFmp4,o=i[e],!(r?re(o):ae(o)))){var n=t[e].isFmp4?"browser":"muxer";s[n]=s[n]||[],s[n].push(i[e]),"audio"===e&&(a=n)}var r,o})),r&&a&&this.media().attributes.AUDIO){var o=this.media().attributes.AUDIO;this.master().playlists.forEach((function(t){(t.attributes&&t.attributes.AUDIO)===o&&t!==e.media()&&(t.excludeUntil=1/0)})),this.logger_("excluding audio group "+o+" as "+a+' does not support codec(s): "'+i.audio+'"')}if(!Object.keys(s).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var u=[];if(["video","audio"].forEach((function(t){var n=(te(e.sourceUpdater_.codecs[t]||"")[0]||{}).type,r=(te(i[t]||"")[0]||{}).type;n&&r&&n.toLowerCase()!==r.toLowerCase()&&u.push('"'+e.sourceUpdater_.codecs[t]+'" -> "'+i[t]+'"')})),u.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+u.join(", ")+".",blacklistDuration:1/0,internal:!0})}return i}var l=Object.keys(s).reduce((function(e,t){return e&&(e+=", "),e+(t+' does not support codec(s): "')+s[t].join(",")+'"'}),"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:l,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:this.media(),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(i){var r=t[i];if(-1===n.indexOf(r.id)){n.push(r.id);var a=wu(e.master,r),s=[];!a.audio||ae(a.audio)||re(a.audio)||s.push("audio codec "+a.audio),!a.video||ae(a.video)||re(a.video)||s.push("video codec "+a.video),a.text&&"stpp.ttml.im1t"===a.text&&s.push("text codec "+a.text),s.length&&(r.excludeUntil=1/0,e.logger_("excluding "+r.id+" for unsupported: "+s.join(", ")))}}))},n.excludeIncompatibleVariants_=function(e){var t=this,n=[],i=this.master().playlists,r=Su(te(e)),a=Eu(r),s=r.video&&te(r.video)[0]||null,o=r.audio&&te(r.audio)[0]||null;Object.keys(i).forEach((function(e){var r=i[e];if(-1===n.indexOf(r.id)&&r.excludeUntil!==1/0){n.push(r.id);var u=[],l=wu(t.masterPlaylistLoader_.master,r),c=Eu(l);if(l.audio||l.video){if(c!==a&&u.push('codec count "'+c+'" !== "'+a+'"'),!t.sourceUpdater_.canChangeType()){var d=l.video&&te(l.video)[0]||null,h=l.audio&&te(l.audio)[0]||null;d&&s&&d.type.toLowerCase()!==s.type.toLowerCase()&&u.push('video codec "'+d.type+'" !== "'+s.type+'"'),h&&o&&h.type.toLowerCase()!==o.type.toLowerCase()&&u.push('audio codec "'+h.type+'" !== "'+o.type+'"')}u.length&&(r.excludeUntil=1/0,t.logger_("blacklisting "+r.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 i,r=n,a=0;a0&&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_"],i=n.buffered_(),r=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=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 i=t.start(0);e=i+(i===t.end(0)?0:Vs)}if(void 0!==e)return this.logger_("Trying to seek outside of seekable at time "+n+" with seekable range "+Gs(t)+". Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0;for(var r=this.masterPlaylistController_.sourceUpdater_,a=this.tech_.buffered(),s=r.audioBuffer?r.audioBuffered():null,o=r.videoBuffer?r.videoBuffered():null,u=this.media(),l=u.partTargetDuration?u.partTargetDuration:2*(u.targetDuration-qs),c=[s,o],d=0;d "+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 i=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.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=Xs(r,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,i){if(void 0===i&&(i=!1),!e.length)return!1;var r=e.end(e.length-1)+Vs;return!n.endList&&i&&(r=e.end(e.length-1)+3*n.targetDuration),t>r},t.beforeSeekableWindow_=function(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:r,end:a}}return null},e}(),Il={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},Pl=function e(t,n){var i=0,r=0,a=Ms.mergeOptions(Il,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(){r&&t.currentTime(r)},o=function(e){null!=e&&(r=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()-i<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?(i=Date.now(),a.getSource.call(t,o)):void Ms.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)}},Al="2.12.0",Ol={PlaylistLoader:Ao,Playlist:go,utils:Vo,STANDARD_PLAYLIST_SELECTOR:Ou,INITIAL_PLAYLIST_SELECTOR:function(){var e=this,t=this.playlists.master.playlists.filter(go.isEnabled);return Iu(t,(function(e,t){return Pu(e,t)})),t.filter((function(t){return!!wu(e.playlists.master,t).video}))[0]||null},lastBandwidthSelector:Ou,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 i=this.useDevicePixelRatio&&g().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),Au(this.playlists.master,t,parseInt(xu(this.tech_.el(),"width"),10)*i,parseInt(xu(this.tech_.el(),"height"),10)*i,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:Pu,comparePlaylistResolution:function(e,t){var n,i;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(n=e.attributes.RESOLUTION.width),n=n||g().Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(i=t.attributes.RESOLUTION.width),n===(i=i||g().Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:n-i},xhr:No()};Object.keys(Zo).forEach((function(e){Object.defineProperty(Ol,e,{get:function(){return Ms.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),Zo[e]},set:function(t){Ms.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?Ms.log.warn("value of Vhs."+e+" must be greater than or equal to 0"):Zo[e]=t}})}));var Ll="videojs-vhs",Dl=function(e,t){for(var n=t.media(),i=-1,r=0;r=n&&e>=n?Math.max(e,i):i}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(){Ms.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(!g().localStorage)return!1;var t=Nl();t=t?Ms.mergeOptions(t,e):e;try{g().localStorage.setItem(Ll,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=mo(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return n?n.filter((function(e){return!uo(e)})).map((function(t,n){return new Cl(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_=g().URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},n.setupEme_=function(){var e,t,n,i=this,r=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,a=(e={player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:r&&r.media()},t=e.player,!(!(n=function(e,t,n){if(!e)return e;var i={};t&&t.attributes&&t.attributes.CODECS&&(i=Su(te(t.attributes.CODECS))),n&&n.attributes&&n.attributes.CODECS&&(i.audio=n.attributes.CODECS);var r=ie(i.video),a=ie(i.audio),s={};for(var o in e)s[o]={},a&&(s[o].audioContentType=a),r&&(s[o].videoContentType=r),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 Ms.mergeOptions(e,s)}(e.sourceKeySystems,e.media,e.audioMedia))||(t.currentSource().keySystems=n,n&&!t.eme&&(Ms.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),1))));this.player_.tech_.on("keystatuschange",(function(e){"output-restricted"===e.status&&i.masterPlaylistController_.blacklistCurrentPlaylist({playlist:i.masterPlaylistController_.media(),message:"DRM keystatus changed to "+e.status+". Playlist will fail to play. Check for HDCP content.",blacklistDuration:1/0})})),11!==Ms.browser.IE_VERSION&&a?(this.logger_("waiting for EME key session creation"),function(e){var t=e.player,n=e.sourceKeySystems,i=e.audioMedia,r=e.mainPlaylists;if(!t.eme.initializeMediaKeys)return Promise.resolve();var a,s,o=(a=i?r.concat([i]):r,s=Object.keys(n),a.reduce((function(e,t){if(!t.contentProtection)return e;var n=s.reduce((function(e,n){var i=t.contentProtection[n];return i&&i.pssh&&(e[n]={pssh:i.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,i){t.eme.initializeMediaKeys({keySystems:e},(function(e){e?i(e):n()}))})))})),Promise.race([Promise.all(u),Promise.race(l)])}({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:r&&r.media(),mainPlaylists:this.playlists.master.playlists}).then((function(){i.logger_("created EME key session"),i.masterPlaylistController_.sourceUpdater_.initializedEme()})).catch((function(e){i.logger_("error while creating EME key session",e),i.player_.error({message:"Failed to initialize media keys for EME",code:3})}))):this.masterPlaylistController_.sourceUpdater_.initializedEme()},n.setupQualityLevels_=function(){var e=this,t=Ms.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)})),Dl(t,n.playlists)})),this.playlists.on("mediachange",(function(){Dl(e.qualityLevels_,e.playlists)})))},t.version=function(){return{"@videojs/http-streaming":Al,"mux.js":"5.14.1","mpd-parser":"0.19.2","m3u8-parser":"4.7.0","aes-decrypter":"3.1.2"}},n.version=function(){return this.constructor.version()},n.canChangeType=function(){return rl.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_&&g().URL.revokeObjectURL&&(g().URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),e.prototype.dispose.call(this)},n.convertToProgramTime=function(e,t){return function(e){var t=e.playlist,n=e.time,i=void 0===n?void 0:n,r=e.callback;if(!r)throw new Error("getProgramTime: callback must be provided");if(!t||void 0===i)return r({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,i=0,r=0;ri){if(e>i+.25*a.duration)return null;n=a}return{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:i-n.duration,type:n.videoTimingInfo?"accurate":"estimate"}}(i,t);if(!a)return r({message:"valid programTime was not found"});if("estimate"===a.type)return r({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var s={mediaSeconds:i},o=function(e,t){if(!t.dateTimeObject)return null;var n=t.videoTimingInfo.transmuxerPrependedSeconds,i=e-(t.videoTimingInfo.transmuxedPresentationStart+n);return new Date(t.dateTimeObject.getTime()+1e3*i)}(i,a.segment);return o&&(s.programDateTime=o.toISOString()),r(null,s)}({playlist:this.masterPlaylistController_.media(),time:e,callback:t})},n.seekToProgramTime=function(e,t,n,i){return void 0===n&&(n=!0),void 0===i&&(i=2),Wo({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:i,pauseAfterSeek:n,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})},t}(Ms.getComponent("Component")),Ml={name:"videojs-http-streaming",VERSION:Al,canHandleSource:function(e,t){void 0===t&&(t={});var n=Ms.mergeOptions(Ms.options,t);return Ml.canPlayType(e.type,n)},handleSource:function(e,t,n){void 0===n&&(n={});var i=Ms.mergeOptions(Ms.options,n);return t.vhs=new Rl(e,t,i),Ms.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return Ms.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=No(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){void 0===t&&(t={});var n=Ms.mergeOptions(Ms.options,t).vhs.overrideNative,i=void 0===n?!Ms.browser.IS_ANY_SAFARI:n,r=le(e);return!r||Ol.supportsTypeNatively(r)&&!i?"":"maybe"}};re("avc1.4d400d,mp4a.40.2")&&Ms.getTech("Html5").registerSourceHandler(Ml,0),Ms.VhsHandler=Rl,Object.defineProperty(Ms,"HlsHandler",{get:function(){return Ms.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),Rl},configurable:!0}),Ms.VhsSourceHandler=Ml,Object.defineProperty(Ms,"HlsSourceHandler",{get:function(){return Ms.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),Ml},configurable:!0}),Ms.Vhs=Ol,Object.defineProperty(Ms,"Hls",{get:function(){return Ms.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Ol},configurable:!0}),Ms.use||(Ms.registerComponent("Hls",Ol),Ms.registerComponent("Vhs",Ol)),Ms.options.vhs=Ms.options.vhs||{},Ms.options.hls=Ms.options.hls||{},Ms.getPlugin&&Ms.getPlugin("reloadSourceOnError")||(Ms.registerPlugin||Ms.plugin)("reloadSourceOnError",(function(e){Pl(this,e)}));const Ul=Ms;function Bl(e){return Bl="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},Bl(e)}function jl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fl(e,t){for(var n=0;n25&&!n?(n=!0,t(25)):e>50&&!i?(i=!0,t(50)):e>75&&!r?(r=!0,t(75)):e>=100&&!a&&(a=!0,t(100))})),this.on("play",(function(){s(this)<=1?(n=i=r=a=!1,e("video_initial_play","video_played")):e("video_resumed")})),this.on("pause",(function(){s(this)<100&&e("video_paused")})),this.on("ended",(function(){e("video_end")}))}))}},{key:"componentWillUnmount",value:function(){this.player&&this.player.dispose()}},{key:"render",value:function(){var e=this;return t().createElement("div",{"data-vjs-player":!0},t().createElement("video",{ref:function(t){return e.videoNode=t},className:"video-js vjs-default-skin vjs-big-play-centered"}))}}]),i}(t().Component),Ql=function(e,t){return Ql=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Ql(e,t)},$l=function(){return $l=Object.assign||function(e){for(var t,n=1,i=arguments.length;n=n?(i(1),e.animation=null):e.animation&&(i(s),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function ac(e,t,n,i){var r=function(e){var t=e.scale,n=e.positionX,i=e.positionY;return!(isNaN(t)||isNaN(n)||isNaN(i))}(t);if(e.mounted&&r){var a=e.setTransformState,s=e.transformState,o=s.scale,u=s.positionX,l=s.positionY,c=t.scale-o,d=t.positionX-u,h=t.positionY-l;0===n?a(t.scale,t.positionX,t.positionY):rc(e,i,n,(function(e){a(o+c*e,u+d*e,l+h*e)}))}}var sc=function(e,t){var n=e.wrapperComponent,i=e.contentComponent,r=e.setup.centerZoomedOut;if(!n||!i)throw new Error("Components are not mounted");var a=function(e,t,n){var i=e.offsetWidth,r=e.offsetHeight,a=t.offsetWidth*n,s=t.offsetHeight*n;return{wrapperWidth:i,wrapperHeight:r,newContentWidth:a,newDiffWidth:i-a,newContentHeight:s,newDiffHeight:r-s}}(n,i,t),s=a.wrapperWidth,o=a.wrapperHeight,u=function(e,t,n,i,r,a,s){var o=e>t?n*(s?1:.5):0,u=i>r?a*(s?1:.5):0;return{minPositionX:e-t-o,maxPositionX:o,minPositionY:i-r-u,maxPositionY:u}}(s,a.newContentWidth,a.newDiffWidth,o,a.newContentHeight,a.newDiffHeight,Boolean(r));return u},oc=function(e,t){var n=sc(e,t);return e.bounds=n,n};function uc(e,t,n,i,r,a,s){var o=n.minPositionX,u=n.minPositionY,l=n.maxPositionX,c=n.maxPositionY,d=0,h=0;return s&&(d=r,h=a),{x:lc(e,o-d,l+d,i),y:lc(t,u-h,c+h,i)}}var lc=function(e,t,n,i){return Jl(i?en?n:e:e,2)};function cc(e,t,n,i,r,a){var s=e.transformState,o=s.scale,u=s.positionX,l=s.positionY,c=i-o;return"number"!=typeof t||"number"!=typeof n?(console.error("Mouse X and Y position were not provided!"),{x:u,y:l}):uc(u-t*c,l-n*c,r,a,0,0,null)}function dc(e,t,n,i,r){var a=t-(r?i:0);return!isNaN(n)&&e>=n?n:!isNaN(t)&&e<=a?a:e}var hc=function(e,t){var n=e.setup.panning.excluded,i=e.isInitialized,r=e.wrapperComponent,a=t.target,s=null==r?void 0:r.contains(a);return!!(i&&a&&s)&&!Bc(a,n)},pc=function(e){var t=e.isInitialized,n=e.isPanning,i=e.setup.panning.disabled;return!(!t||!n||i)},fc=function(e,t){var n=e.setup,i=e.transformState.scale,r=n.minScale;return t>0&&i>=r?t:0};function mc(e,t,n,i,r,a,s,o,u,l){if(r){var c;if(t>s&&n>s)return(c=s+(e-s)*l)>u?u:ca?a:c}return i?t:lc(e,a,s,r)}function gc(e,t){var n=e.transformState.scale;ic(e),oc(e,n),t.touches?function(e,t){var n=t.touches,i=e.transformState,r=i.positionX,a=i.positionY;if(e.isPanning=!0,1===n.length){var s=n[0].clientX,o=n[0].clientY;e.startCoords={x:s-r,y:o-a}}}(e,t):function(e,t){var n=e.transformState,i=n.positionX,r=n.positionY;e.isPanning=!0;var a=t.clientX,s=t.clientY;e.startCoords={x:a-i,y:s-r}}(e,t)}function vc(e,t,n){var i=e.startCoords,r=e.setup.alignmentAnimation,a=r.sizeX,s=r.sizeY;if(i){var o=function(e,t,n){var i=e.startCoords,r=e.transformState,a=e.setup.panning,s=a.lockAxisX,o=a.lockAxisY,u=r.positionX,l=r.positionY;if(!i)return{x:u,y:l};var c=t-i.x,d=n-i.y;return{x:s?u:c,y:o?l:d}}(e,t,n),u=o.x,l=o.y,c=fc(e,a),d=fc(e,s);(function(e,t){var n=function(e){var t=e.mounted,n=e.setup,i=n.disabled,r=n.velocityAnimation,a=e.transformState.scale;return!(r.disabled&&!(a>1)&&i&&!t)}(e);if(n){var i=e.lastMousePosition,r=e.velocityTime,a=e.setup,s=e.wrapperComponent,o=a.velocityAnimation.equalToMove,u=Date.now();if(i&&r&&s){var l=function(e,t){return t?Math.min(1,e.offsetWidth/window.innerWidth):1}(s,o),c=t.x-i.x,d=t.y-i.y,h=c/l,p=d/l,f=u-r,m=c*c+d*d,g=Math.sqrt(m)/f;e.velocity={velocityX:h,velocityY:p,total:g}}e.lastMousePosition=t,e.velocityTime=u}})(e,{x:u,y:l}),function(e,t,n,i,r){var a=e.setup.limitToBounds,s=e.wrapperComponent,o=e.bounds,u=e.transformState,l=u.scale,c=u.positionX,d=u.positionY;if(s&&t!==c&&n!==d&&o){var h=uc(t,n,o,a,i,r,s),p=h.x,f=h.y;e.setTransformState(l,p,f)}}(e,u,l,c,d)}}function yc(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,i=e.wrapperComponent,r=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var a=null==i?void 0:i.getBoundingClientRect(),s=null==r?void 0:r.getBoundingClientRect(),o=(null==a?void 0:a.width)||0,u=(null==a?void 0:a.height)||0,l=(null==s?void 0:s.width)||0,c=(null==s?void 0:s.height)||0,d=o.1&&d?function(e){var t=e.velocity,n=e.bounds,i=e.setup,r=e.wrapperComponent,a=function(e){var t=e.mounted,n=e.velocity,i=e.bounds,r=e.setup,a=r.disabled,s=r.velocityAnimation,o=e.transformState.scale;return!(s.disabled&&!(o>1)&&a&&!t||!n||!i)}(e);if(a&&t&&n&&r){var s=t.velocityX,o=t.velocityY,u=t.total,l=n.maxPositionX,c=n.minPositionX,d=n.maxPositionY,h=n.minPositionY,p=i.limitToBounds,f=i.alignmentAnimation,m=i.zoomAnimation,g=i.panning,v=g.lockAxisY,y=g.lockAxisX,_=m.animationType,b=f.sizeX,T=f.sizeY,S=f.velocityAlignmentTime,E=function(e,t){var n=e.setup.velocityAnimation,i=n.equalToMove,r=n.animationTime,a=n.sensitivity;return i?r*t*a:r}(e,u),w=Math.max(E,S),C=fc(e,b),k=fc(e,T),x=C*r.offsetWidth/100,I=k*r.offsetHeight/100,P=l+x,A=c-x,O=d+I,L=h-I,D=e.transformState,N=(new Date).getTime();rc(e,_,w,(function(t){var n=e.transformState,i=n.scale,r=n.positionX,a=n.positionY,u=((new Date).getTime()-N)/S,m=1-(0,tc[f.animationType])(Math.min(1,u)),g=1-t,_=r+s*g,b=a+o*g,T=mc(_,D.positionX,r,y,p,c,l,A,P,m),E=mc(b,D.positionY,a,v,p,h,d,L,O,m);r===_&&a===b||e.setTransformState(i,T,E)}))}}(e):_c(e)}}function _c(e){var t=e.transformState.scale,n=e.setup,i=n.minScale,r=n.alignmentAnimation,a=r.disabled,s=r.sizeX,o=r.sizeY,u=r.animationTime,l=r.animationType;if(!(a||td||np||id?l.offsetWidth:e.setup.minPositionX||0,i>p?l.offsetHeight:e.setup.minPositionY||0,r,e.bounds,o||u),y=v.x,_=v.y;return{scale:r,positionX:m?y:n,positionY:g?_:i}}}(e);c&&ac(e,c,u,l)}}function bc(e,t,n){var i=e.transformState.scale,r=e.wrapperComponent,a=e.setup,s=a.minScale,o=a.limitToBounds,u=a.zoomAnimation,l=u.disabled,c=u.animationTime,d=u.animationType,h=l||i>=s;if((i>=1||o)&&_c(e),!h&&r&&e.mounted){var p=Tc(e,s,t||r.offsetWidth/2,n||r.offsetHeight/2);p&&ac(e,p,c,d)}}function Tc(e,t,n,i){var r=e.setup,a=r.minScale,s=r.maxScale,o=r.limitToBounds,u=dc(Jl(t,2),a,s,0,!1),l=cc(e,n,i,u,oc(e,u),o);return{scale:u,positionX:l.x,positionY:l.y}}var Sc={previousScale:1,scale:1,positionX:0,positionY:0},Ec=$l($l({},Sc),{setComponents:function(){},contextInstance:null}),wc={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,wheel:{step:.2,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},Cc=function(e){var t,n,i,r;return{previousScale:null!==(t=e.initialScale)&&void 0!==t?t:Sc.scale,scale:null!==(n=e.initialScale)&&void 0!==n?n:Sc.scale,positionX:null!==(i=e.initialPositionX)&&void 0!==i?i:Sc.positionX,positionY:null!==(r=e.initialPositionY)&&void 0!==r?r:Sc.positionY}},kc=function(e){var t=$l({},wc);return Object.keys(e).forEach((function(n){var i=void 0!==e[n];if(void 0!==wc[n]&&i){var r=Object.prototype.toString.call(wc[n]),a="[object Object]"===r,s="[object Array]"===r;t[n]=a?$l($l({},wc[n]),e[n]):s?Zl(Zl([],wc[n]),e[n]):e[n]}})),t},xc=function(e,t,n){var i=e.transformState.scale,r=e.wrapperComponent,a=e.setup,s=a.maxScale,o=a.minScale,u=a.zoomAnimation.size;if(!r)throw new Error("Wrapper is not mounted");var l=i*Math.exp(t*n);return dc(Jl(l,3),o,s,u,!1)};function Ic(e,t,n,i,r){var a=e.wrapperComponent,s=e.transformState,o=s.scale,u=s.positionX,l=s.positionY;if(!a)return console.error("No WrapperComponent found");var c=(a.offsetWidth/2-u)/o,d=(a.offsetHeight/2-l)/o,h=Tc(e,xc(e,t,n),c,d);if(!h)return console.error("Error during zoom event. New transformation state was not calculated.");ac(e,h,i,r)}function Pc(e,t,n){var i=e.setup,r=e.wrapperComponent,a=i.limitToBounds,s=Cc(e.props),o=e.transformState,u=o.scale,l=o.positionX,c=o.positionY;if(r){var d=sc(e,s.scale),h=uc(s.positionX,s.positionY,d,a,0,0,r),p={scale:s.scale,positionX:h.x,positionY:h.y};u===s.scale&&l===s.positionX&&c===s.positionY||ac(e,p,t,n)}}var Ac=function(e){return function(t,n,i){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===i&&(i="easeOut"),Ic(e,1,t,n,i)}},Oc=function(e){return function(t,n,i){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===i&&(i="easeOut"),Ic(e,-1,t,n,i)}},Lc=function(e){return function(t,n,i,r,a){void 0===r&&(r=300),void 0===a&&(a="easeOut");var s=e.transformState,o=s.positionX,u=s.positionY,l=s.scale,c=e.wrapperComponent,d=e.contentComponent;if(!e.setup.disabled&&c&&d){var h={positionX:isNaN(t)?o:t,positionY:isNaN(n)?u:n,scale:isNaN(i)?l:i};ac(e,h,r,a)}}},Dc=function(e){return function(t,n){void 0===t&&(t=200),void 0===n&&(n="easeOut"),Pc(e,t,n)}},Nc=function(e){return function(t,n,i){void 0===n&&(n=200),void 0===i&&(i="easeOut");var r=e.transformState,a=e.wrapperComponent,s=e.contentComponent;if(a&&s){var o=Hc(t||r.scale,a,s);ac(e,o,n,i)}}},Rc=function(e){return function(t,n,i,r){void 0===i&&(i=600),void 0===r&&(r="easeOut"),ic(e);var a=e.wrapperComponent,s="string"==typeof t?document.getElementById(t):t;if(a&&function(e){return e?void 0!==(null==e?void 0:e.offsetWidth)&&void 0!==(null==e?void 0:e.offsetHeight)||(console.error("Zoom node is not valid - it must contain offsetWidth and offsetHeight"),!1):(console.error("Zoom node not found"),!1)}(s)&&s&&a.contains(s)){var o=function(e,t,n){var i=e.wrapperComponent,r=e.setup,a=r.limitToBounds,s=r.minScale,o=r.maxScale;if(!i)return Sc;var u=i.getBoundingClientRect(),l=function(e){for(var t=e,n=0,i=0;t;)n+=t.offsetLeft,i+=t.offsetTop,t=t.offsetParent;return{x:n,y:i}}(t),c=l.x,d=l.y,h=t.offsetWidth,p=t.offsetHeight,f=i.offsetWidth/h,m=i.offsetHeight/p,g=dc(n||Math.min(f,m),s,o,0,!1),v=(u.width-h*g)/2,y=(u.height-p*g)/2,_=uc((u.left-c)*g+v,(u.top-d)*g+y,sc(e,g),a,0,0,i);return{positionX:_.x,positionY:_.y,scale:g}}(e,s,n);ac(e,o,i,r)}}},Mc=function(e){return{instance:e,state:e.transformState,zoomIn:Ac(e),zoomOut:Oc(e),setTransform:Lc(e),resetTransform:Dc(e),centerView:Nc(e),zoomToElement:Rc(e)}};function Uc(){try{return{get passive(){return!1}}}catch(e){return!1}}var Bc=function(e,t){var n=e.tagName.toUpperCase();return!!t.find((function(e){return e.toUpperCase()===n}))||!!t.find((function(t){return e.classList.contains(t)}))},jc=function(e){e&&clearTimeout(e)},Fc=function(e,t,n){return"translate3d("+e+"px, "+t+"px, 0) scale("+n+")"},Hc=function(e,t,n){var i=n.offsetWidth*e,r=n.offsetHeight*e;return{scale:e,positionX:(t.offsetWidth-i)/2,positionY:(t.offsetHeight-r)/2}},qc=function(e,t){var n=e.setup.wheel,i=n.disabled,r=n.wheelDisabled,a=n.touchPadDisabled,s=n.excluded,o=e.isInitialized,u=e.isPanning,l=t.target;return!(!o||u||i||!l||r&&!t.ctrlKey||a&&t.ctrlKey||Bc(l,s))};function Vc(e,t,n){var i=t.getBoundingClientRect(),r=0,a=0;if("clientX"in e)r=(e.clientX-i.left)/n,a=(e.clientY-i.top)/n;else{var s=e.touches[0];r=(s.clientX-i.left)/n,a=(s.clientY-i.top)/n}return(isNaN(r)||isNaN(a))&&console.error("No mouse or touch offset found"),{x:r,y:a}}var Wc=function(e,t){var n=e.setup.pinch,i=n.disabled,r=n.excluded,a=e.isInitialized,s=t.target;return!(!a||i||!s||Bc(s,r))},zc=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,i=e.pinchStartDistance;return!(!n||t||!i)},Xc=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},Gc=function(e,t){var n=e.props,i=n.onWheelStart,r=n.onZoomStart;e.wheelStopEventTimer||(ic(e),ec(Mc(e),t,i),ec(Mc(e),t,r))},Kc=function(e,t){var n=e.props,i=n.onWheel,r=n.onZoom,a=e.contentComponent,s=e.setup,o=e.transformState.scale,u=s.limitToBounds,l=s.centerZoomedOut,c=s.zoomAnimation,d=s.wheel,h=c.size,p=c.disabled,f=d.step;if(!a)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var m=function(e,t){var n=e?e.deltaY<0?1:-1:0;return"number"==typeof null?null:n}(t),g=function(e,t,n,i,r){var a=e.transformState.scale,s=e.wrapperComponent,o=e.setup,u=o.maxScale,l=o.minScale,c=o.zoomAnimation,d=c.size,h=c.disabled;if(!s)throw new Error("Wrapper is not mounted");var p=a+t*(a-a*n)*n;var f=!i&&!h;return dc(Jl(p,3),l,u,d,f)}(e,m,f,!t.ctrlKey);if(o!==g){var v=oc(e,g),y=Vc(t,a,o),_=u&&(p||0===h||l),b=cc(e,y.x,y.y,g,v,_),T=b.x,S=b.y;e.previousWheelEvent=t,e.setTransformState(g,T,S),ec(Mc(e),t,i),ec(Mc(e),t,r)}},Yc=function(e,t){var n=e.props,i=n.onWheelStop,r=n.onZoomStop;jc(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout((function(){e.mounted&&(bc(e,t.x,t.y),e.wheelAnimationTimer=null)}),100);var a=function(e,t){var n=e.previousWheelEvent,i=e.transformState.scale,r=e.setup,a=r.maxScale,s=r.minScale;return!!n&&(is||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaYt.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY))}(e,t);a&&(jc(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout((function(){e.mounted&&(e.wheelStopEventTimer=null,ec(Mc(e),t,i),ec(Mc(e),t,r))}),160))},Qc=function(e,t){var n=Xc(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,ic(e)},$c=function(e,t){var n=e.contentComponent,i=e.pinchStartDistance,r=e.transformState.scale,a=e.setup,s=a.limitToBounds,o=a.centerZoomedOut,u=a.zoomAnimation,l=u.disabled,c=u.size;if(null!==i&&n){var d=function(e,t,n){var i=n.getBoundingClientRect(),r=e.touches,a=Jl(r[0].clientX-i.left,5),s=Jl(r[0].clientY-i.top,5);return{x:(a+Jl(r[1].clientX-i.left,5))/2/t,y:(s+Jl(r[1].clientY-i.top,5))/2/t}}(t,r,n);if(isFinite(d.x)&&isFinite(d.y)){var h=Xc(t),p=function(e,t){var n=e.pinchStartScale,i=e.pinchStartDistance,r=e.setup,a=r.maxScale,s=r.minScale,o=r.zoomAnimation,u=o.size,l=o.disabled;if(!n||null===i||!t)throw new Error("Pinch touches distance was not provided");return t<0?e.transformState.scale:dc(Jl(t/i*n,2),s,a,u,!l)}(e,h);if(p!==r){var f=oc(e,p),m=s&&(l||0===c||o),g=cc(e,d.x,d.y,p,f,m),v=g.x,y=g.y;e.pinchMidpoint=d,e.lastDistance=h,e.setTransformState(p,v,y)}}}},Zc=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,bc(e,null==t?void 0:t.x,null==t?void 0:t.y)};function Jc(e,t){var n=e.setup.doubleClick,i=n.disabled,r=n.mode,a=n.step,s=n.animationTime,o=n.animationType;if(!i){if("reset"===r)return Pc(e,s,o);var u=e.transformState.scale,l=e.contentComponent;if(!l)return console.error("No ContentComponent found");var c=xc(e,"zoomOut"===r?-1:1,a),d=Vc(t,l,u),h=Tc(e,c,d.x,d.y);if(!h)return console.error("Error during zoom event. New transformation state was not calculated.");ac(e,h,s,o)}}var ed=function(e,t){var n=e.isInitialized,i=e.setup,r=e.wrapperComponent,a=i.doubleClick,s=a.disabled,o=a.excluded,u=t.target,l=null==r?void 0:r.contains(u),c=n&&u&&l&&!s;return!!c&&!Bc(u,o)&&!!c},td=t().createContext(Ec),nd=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.mounted=!0,t.transformState=Cc(t.props),t.setup=kc(t.props),t.wrapperComponent=null,t.contentComponent=null,t.isInitialized=!1,t.bounds=null,t.previousWheelEvent=null,t.wheelStopEventTimer=null,t.wheelAnimationTimer=null,t.isPanning=!1,t.startCoords=null,t.lastTouch=null,t.distance=null,t.lastDistance=null,t.pinchStartDistance=null,t.pinchStartScale=null,t.pinchMidpoint=null,t.velocity=null,t.velocityTime=null,t.lastMousePosition=null,t.animate=!1,t.animation=null,t.maxBounds=null,t.pressedKeys={},t.handleInitializeWrapperEvents=function(e){var n=Uc();e.addEventListener("wheel",t.onWheelZoom,n),e.addEventListener("dblclick",t.onDoubleClick,n),e.addEventListener("touchstart",t.onTouchPanningStart,n),e.addEventListener("touchmove",t.onTouchPanning,n),e.addEventListener("touchend",t.onTouchPanningStop,n)},t.handleInitialize=function(){var e=t.setup.centerOnInit;t.applyTransformation(),t.forceUpdate(),e&&(setTimeout((function(){t.mounted&&t.setCenter()}),50),setTimeout((function(){t.mounted&&t.setCenter()}),100),setTimeout((function(){t.mounted&&t.setCenter()}),200))},t.onWheelZoom=function(e){t.setup.disabled||qc(t,e)&&t.isPressingKeys(t.setup.wheel.activationKeys)&&(Gc(t,e),Kc(t,e),Yc(t,e))},t.onPanningStart=function(e){var n=t.setup.disabled,i=t.props.onPanningStart;n||hc(t,e)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.preventDefault(),e.stopPropagation(),ic(t),gc(t,e),ec(Mc(t),e,i))},t.onPanning=function(e){var n=t.setup.disabled,i=t.props.onPanning;n||pc(t)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.preventDefault(),e.stopPropagation(),vc(t,e.clientX,e.clientY),ec(Mc(t),e,i))},t.onPanningStop=function(e){var n=t.props.onPanningStop;t.isPanning&&(yc(t),ec(Mc(t),e,n))},t.onPinchStart=function(e){var n=t.setup.disabled,i=t.props,r=i.onPinchingStart,a=i.onZoomStart;n||Wc(t,e)&&(Qc(t,e),ic(t),ec(Mc(t),e,r),ec(Mc(t),e,a))},t.onPinch=function(e){var n=t.setup.disabled,i=t.props,r=i.onPinching,a=i.onZoom;n||zc(t)&&(e.preventDefault(),e.stopPropagation(),$c(t,e),ec(Mc(t),e,r),ec(Mc(t),e,a))},t.onPinchStop=function(e){var n=t.props,i=n.onPinchingStop,r=n.onZoomStop;t.pinchStartScale&&(Zc(t),ec(Mc(t),e,i),ec(Mc(t),e,r))},t.onTouchPanningStart=function(e){var n=t.setup.disabled,i=t.props.onPanningStart;if(!n&&hc(t,e))if(t.lastTouch&&+new Date-t.lastTouch<200&&1===e.touches.length)t.onDoubleClick(e);else{t.lastTouch=+new Date,ic(t);var r=e.touches,a=1===r.length,s=2===r.length;a&&(ic(t),gc(t,e),ec(Mc(t),e,i)),s&&t.onPinchStart(e)}},t.onTouchPanning=function(e){var n=t.setup.disabled,i=t.props.onPanning;if(t.isPanning&&1===e.touches.length){if(n)return;if(!pc(t))return;e.preventDefault(),e.stopPropagation();var r=e.touches[0];vc(t,r.clientX,r.clientY),ec(Mc(t),e,i)}else e.touches.length>1&&t.onPinch(e)},t.onTouchPanningStop=function(e){t.onPanningStop(e),t.onPinchStop(e)},t.onDoubleClick=function(e){t.setup.disabled||ed(t,e)&&Jc(t,e)},t.clearPanning=function(e){t.isPanning&&t.onPanningStop(e)},t.setKeyPressed=function(e){t.pressedKeys[e.key]=!0},t.setKeyUnPressed=function(e){t.pressedKeys[e.key]=!1},t.isPressingKeys=function(e){return!e.length||Boolean(e.find((function(e){return t.pressedKeys[e]})))},t.setComponents=function(e,n){t.wrapperComponent=e,t.contentComponent=n,oc(t,t.transformState.scale),t.handleInitializeWrapperEvents(e),t.handleInitialize(),t.handleRef(),t.isInitialized=!0,ec(Mc(t),void 0,t.props.onInit)},t.setTransformState=function(e,n,i){isNaN(e)||isNaN(n)||isNaN(i)?console.error("Detected NaN set state values"):(e!==t.transformState.scale&&(t.transformState.previousScale=t.transformState.scale,t.transformState.scale=e),t.transformState.positionX=n,t.transformState.positionY=i,t.applyTransformation())},t.setCenter=function(){if(t.wrapperComponent&&t.contentComponent){var e=Hc(t.transformState.scale,t.wrapperComponent,t.contentComponent);t.setTransformState(e.scale,e.positionX,e.positionY)}},t.applyTransformation=function(){if(t.mounted&&t.contentComponent){var e=t.transformState,n=e.scale,i=e.positionX,r=e.positionY,a=Fc(i,r,n);t.contentComponent.style.transform=a,t.handleRef()}},t.handleRef=function(){t.props.setRef(Mc(t))},t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Ql(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(n,e),n.prototype.componentDidMount=function(){var e=Uc();window.addEventListener("mousedown",this.onPanningStart,e),window.addEventListener("mousemove",this.onPanning,e),window.addEventListener("mouseup",this.onPanningStop,e),document.addEventListener("mouseleave",this.clearPanning,e),window.addEventListener("keyup",this.setKeyUnPressed,e),window.addEventListener("keydown",this.setKeyPressed,e),this.handleRef()},n.prototype.componentWillUnmount=function(){var e=Uc();window.removeEventListener("mousedown",this.onPanningStart,e),window.removeEventListener("mousemove",this.onPanning,e),window.removeEventListener("mouseup",this.onPanningStop,e),window.removeEventListener("keyup",this.setKeyUnPressed,e),window.removeEventListener("keydown",this.setKeyPressed,e),ic(this)},n.prototype.componentDidUpdate=function(e){e!==this.props&&(oc(this,this.transformState.scale),this.setup=kc(this.props))},n.prototype.render=function(){var e=Mc(this),n=this.props.children,i="function"==typeof n?n(e):n;return t().createElement(td.Provider,{value:$l($l({},this.transformState),{setComponents:this.setComponents,contextInstance:this})},i)},n}(e.Component),id=t().forwardRef((function(n,i){var r=(0,e.useState)(null),a=r[0],s=r[1];return(0,e.useImperativeHandle)(i,(function(){return a}),[a]),t().createElement(nd,$l({},n,{setRef:s}))}));!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}(".transform-component-module_wrapper__1_Fgj {\n position: relative;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n overflow: hidden;\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Safari */\n -khtml-user-select: none; /* Konqueror HTML */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none;\n margin: 0;\n padding: 0;\n}\n.transform-component-module_content__2jYgh {\n display: flex;\n flex-wrap: wrap;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n margin: 0;\n padding: 0;\n transform-origin: 0% 0%;\n}\n.transform-component-module_content__2jYgh img {\n pointer-events: none;\n}\n");var rd=function(n){var i=n.children,r=n.wrapperClass,a=void 0===r?"":r,s=n.contentClass,o=void 0===s?"":s,u=n.wrapperStyle,l=n.contentStyle,c=(0,e.useContext)(td).setComponents,d=(0,e.useRef)(null),h=(0,e.useRef)(null);return(0,e.useEffect)((function(){var e=d.current,t=h.current;null!==e&&null!==t&&c&&c(e,t)}),[]),t().createElement("div",{ref:d,className:"react-transform-wrapper transform-component-module_wrapper__1_Fgj "+a,style:u},t().createElement("div",{ref:h,className:"react-transform-component transform-component-module_content__2jYgh "+o,style:l},i))};function ad(e){return ad="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},ad(e)}function sd(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:1e3;if(!t){var r=Array.prototype.slice.call(e,2);t=!0,r.length>0?n(r):n(),setTimeout((function(){return t=!1}),i)}}}(),n.zoomWrapper=t().createRef(),n.onImageLoad=n.onImageLoad.bind(ld(n)),n}return n=u,r=[{key:"getDerivedStateFromProps",value:function(e,t){return e.url!==t.url?{isLoading:!0,url:e.url}:null}}],(i=[{key:"onImageLoad",value:function(){var e,t;this.state.zoomLevel!=this.DEFAULT_ZOOM&&(null===(e=this.zoomWrapper)||void 0===e||null===(t=e.current)||void 0===t||t.resetTransform()),this.setState({isLoading:!1,zoomLevel:this.DEFAULT_ZOOM})}},{key:"onZoomIn",value:function(){var e=this;this.state.zoomLevel!==this.MAX_ZOOM&&this.throttle((function(){var t;null===(t=e.zoomWrapper.current)||void 0===t||t.zoomIn(),e.setState((function(e){e.zoomLevel++}))}),250)}},{key:"onZoomOut",value:function(){var e=this;this.state.zoomLevel!==this.DEFAULT_ZOOM&&this.throttle((function(){var t;null===(t=e.zoomWrapper.current)||void 0===t||t.zoomOut(),e.setState((function(e){e.zoomLevel--}))}),250)}},{key:"onZoomReset",value:function(){var e=this;this.state.zoomLevel!==this.DEFAULT_ZOOM&&this.throttle((function(){var t;null===(t=e.zoomWrapper.current)||void 0===t||t.resetTransform(),e.setState({zoomLevel:1})}),250)}},{key:"isZoomInDisabled",get:function(){return this.state.zoomLevel===this.MAX_ZOOM}},{key:"isZoomOutDisabled",get:function(){return this.state.zoomLevel===this.DEFAULT_ZOOM}},{key:"isZoomResetDisabled",get:function(){return this.state.zoomLevel===this.DEFAULT_ZOOM}},{key:"render",value:function(){var e=this,n=this.state,i=n.url,r=n.isLoading,a={backgroundImage:"url(".concat(i,")")};return t().createElement(id,{ref:this.zoomWrapper,pinch:{disabled:!0},wheel:{disabled:!0},doubleClick:{disabled:!0},alignmentAnimation:{sizeX:0,sizeY:0},maxScale:7},(function(){return t().createElement(t().Fragment,null,t().createElement("div",{className:"zoom-controls"},t().createElement("div",{disabled:e.isZoomInDisabled,onClick:function(){return e.onZoomIn()},className:"zoom-controls-in"},t().createElement("span",null)),t().createElement("div",{disabled:e.isZoomResetDisabled,onClick:function(){return e.onZoomReset()},className:"zoom-controls-reset"},e.state.resetTxt),t().createElement("div",{disabled:e.isZoomOutDisabled,onClick:function(){return e.onZoomOut()},className:"zoom-controls-out"},t().createElement("span",null))),t().createElement(rd,{wrapperClass:"image-canvas",contentClass:"image-canvas"},t().createElement("div",{className:"image-canvas"},t().createElement("div",{style:a,className:"image"}),t().createElement("img",{className:"preloader",src:i,onLoad:e.onImageLoad}),r&&t().createElement("div",{className:"image-canvas-overlay"}))))}))}}])&&sd(n.prototype,i),r&&sd(n,r),u}(t().Component);function hd(e){return hd="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},hd(e)}function pd(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&(t.state.media=e.data.media[0].data),null!=t.state.media[5]&&"fuseAd"!==t.state.media[5].type||(t.state.galleryAdvertResolved=!0),t.onClose=t.onClose.bind(Zd(t)),t.onKeyDown=t.onKeyDown.bind(Zd(t)),t.onPrev=t.onPrev.bind(Zd(t)),t.onNext=t.onNext.bind(Zd(t)),t.onPrevOrNext=t.onPrevOrNext.bind(Zd(t)),t.onSelectedItemChanged=t.onSelectedItemChanged.bind(Zd(t)),t.loadGalleryAdvert(e.data),t.onSelectedCategory=t.onSelectedCategory.bind(Zd(t)),t.onShowContextualSignup=t.onShowContextualSignup.bind(Zd(t)),t.onSelectedCategory(t.state.categoryType),t}return n=u,(i=[{key:"componentDidMount",value:function(){if(!(void 0===(e=this.props.sidebarNodeSelector)||null==e||e.replace(/\s/g,"").length<1)){var e,t=document.querySelector(this.props.sidebarNodeSelector);t.style.display="block",r().findDOMNode(this.refs.sidebarNode).appendChild(t),document.addEventListener("keydown",this.onKeyDown,!1),document.body.classList.add("fixed")}}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.onKeyDown,!1);var e=document.querySelector(this.props.sidebarNodeSelector);e.style.display="none",document.body.appendChild(e),CsnInsights&&(CsnInsights.metaData.contentgroup2="details")}},{key:"trackNativeAdvertImpression",value:function(){var e=document.createElement("img");e.style.display="none",e.src="https://ad.doubleclick.net/ddm/trackimp/N80https://ad.doubleclick.net/ddm/trackimp69.3911078QTDCARSALES/B24307450.301529445;dc_trk_aid=494933910;dc_trk_cid=133937643;ord=%%CACHEBUSTER%%;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;tfua=;gdpr=${GDPR};gdpr_consent=${GDPR_CONSENT_755};ltd=?",document.body.appendChild(e),e.addEventListener("load",this.removeNativeAdvertImpTrackerImg)}},{key:"removeNativeAdvertImpTrackerImg",value:function(e){document.body.removeChild(e.target)}},{key:"loadGalleryAdvert",value:function(e){var t=this;if(null!=this.state.media[5]&&"fuseAd"!==this.state.media[5].type&&"undefined"!=typeof fusetag){var n=e.galleryAdvertUrl;n&&""!=n&&fetch(n).then((function(e){200===e.status&&e.json().then((function(e){var n={type:"fuseAd",fuseZone:e.fuseZone,adTags:e.adTags,thumbnailUrl:"https://carsales.pxcrush.net/carsales/car?pxc_method=gravityfill&pxc_bgtype=self&pxc_size=1%2c1"};t.state.media.splice(5,0,n),t.setState({galleryAdvertResolved:!0})}))}))}}},{key:"loadNativeAdvert",value:function(e){var t=e.nativeAdUrl;if(t&&""!=t){t+=this.getAdvertParams();var n=this;fetch(t).then((function(t){200===t.status&&t.json().then((function(t){if(t.sections["native-advert"]){var i={type:"advert",htmlContent:t.sections["native-advert"],thumbnailUrl:t.data.logo,onAfterLoad:function(){window.lazyLoadDoubleClickAds&&setTimeout((function(){window.lazyLoadDoubleClickAds(".gallery-popup .native-advert")}),500)}};n.trackNativeAdvertImpression(),"advert"===this.state.media[5].type?this.state.media[5]=i:this.state.media.splice(5,0,i),n.setState({data:e})}}))}))}}},{key:"getAdvertParams",value:function(){var e=localStorage.getItem("kxkuid"),t=localStorage.getItem("kxallsegs"),n=localStorage.getItem("kxsegs"),i=t||(n?n.join(","):null);return"?kuid=".concat(e,"&ksg=").concat(i)}},{key:"onClose",value:function(){this.props.onClose&&this.props.onClose(),document.body.classList.remove("fixed")}},{key:"onNext",value:function(){var e=this;this.setState((function(t){var n=t.selectedItem+1;return n>=e.state.media.length&&(n=0),{selectedItem:n,goingNext:!0}}))}},{key:"onPrev",value:function(){var e=this;this.setState((function(t){var n=t.selectedItem-1;return n<0&&(n=e.state.media.length-1),{selectedItem:n,goingNext:!1}}))}},{key:"onPrevOrNext",value:function(){this.state.goingNext?this.onNext():this.onPrev()}},{key:"onSelectedItemChanged",value:function(e){this.setState({selectedItem:e})}},{key:"onKeyDown",value:function(e){switch(e.keyCode){case 27:this.onClose();break;case 39:this.onNext();break;case 37:this.onPrev()}}},{key:"preloadImage",value:function(e){if(void 0===this.preloadedList[e]&&!(e<0||e>=this.state.media.length||"video"===this.state.media[e].type)){var t=new Image;t.src=this.state.media[e].contentUrl,this.preloadedList[e]=t}}},{key:"componentWillUpdate",value:function(e,t){var n=t.selectedItem,i=e.data.media.length,r=0==n?i-1:n-1,a=n==i-1?0:n+1;this.preloadImage(r),this.preloadImage(a),$(window).trigger("Gallery.IndexChanged")}},{key:"onSelectedCategory",value:function(e){var t=this;this.props.data.media.find((function(n){n.name===e&&(t.state.media=n.data,t.setState((function(t){return{selectedItem:0,goingNext:!1,categoryType:e,showContextualSignupModal:!1}})))}))}},{key:"onShowContextualSignup",value:function(){var e=document.body.appendChild(document.createElement("div"));new Gd(e,this.props.data.lockedImperfections).renderWithoutBackground()}},{key:"render",value:function(){var e=this.state,n=e.selectedItem,i=e.showSidebar,r=e.showGalleryButtons,a=e.categoryType,s=this.state.media[n],o=(i?"col-7 col-lg-9":"col")+" d-flex h-100 flex-column",u=i?"col-5 col-lg-3":"d-none",l=this.state.media[n].photoTag;return s.resetTxt=this.state.resetTxt,t().createElement("div",{className:"gallery-popup"},t().createElement("div",{className:"wrapper container-fluid"},t().createElement("div",{className:"close",onClick:this.onClose}),t().createElement("div",{className:"inner-wrapper"},t().createElement("div",{className:"row h-100"},t().createElement("div",{className:o},t().createElement("div",{className:"row"},t().createElement("div",{className:"col"},t().createElement("div",{className:"title"},this.props.data.title),r&&t().createElement(Bd,{showContextualSignup:this.onShowContextualSignup,selectedCategory:this.onSelectedCategory,category:a,hasImperfections:this.props.data.media.length>1,lockedImperfections:this.props.data.lockedImperfections})),t().createElement("div",{className:"col-3"},t().createElement("div",{className:"price"},this.props.data.price.preText&&t().createElement("span",{className:"pre-price-text"},this.props.data.price.preText),this.props.data.price.price," ",this.props.data.price.currency&&t().createElement("span",{className:"price-currency"},this.props.data.price.currency)),t().createElement("div",{className:"price-description"},this.props.data.price.priceInfo,this.props.data.price.additionalInfo&&t().createElement("span",{className:"post-price-text",dangerouslySetInnerHTML:{__html:this.props.data.price.additionalInfo}})))),t().createElement("div",{className:"row fill d-flex"},t().createElement(Ld,{item:s,index:n,onNext:this.onNext,onPrev:this.onPrev,onPrevOrNext:this.onPrevOrNext})),r&&t().createElement("div",{className:"row"},t().createElement("span",{className:"image-tag"},l)),t().createElement("div",{className:"row"},t().createElement(f,{thumbnails:this.state.media,value:n,onChange:this.onSelectedItemChanged})),this.props.data.disclaimer&&t().createElement("div",{className:"row"},t().createElement("div",{className:"disclaimer"},this.props.data.disclaimer))),t().createElement("div",{className:u},t().createElement("div",{className:"sidebar",ref:"sidebarNode"}))))),t().createElement("div",{className:"overlay",onClick:this.onClose}))}}])&&Yd(n.prototype,i),u}(t().Component);function th(e){return th="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},th(e)}function nh(e,t){for(var n=0;n0)){if(new ih(i,t,e(this).data("galleryIndex"),".gallery-side-bar",e(this).data("galleryCategory")||a).render(),window.CsnInsightsEventTracker){var s=e.extend({},n);window.CsnInsightsEventTracker.sendPageView(s,"/gallery")}e.isFunction(window.refreshEnquiryAdSlot)&&refreshEnquiryAdSlot()}}}))}(jQuery,gallery_data,gallery_meta)})()})();