");return;case qi:case zi:for(o=e.firstChild;o;)_e(o,t,i,n,r),o=o.nextSibling;return;case Ui:return t.push(" ",e.name,'="',e.value.replace(/[<&"]/g,Q),'"');case Mi:return t.push(e.data.replace(/[<&]/g,Q));case Bi:return t.push("");case Vi:return t.push("\x3c!--",e.data,"--\x3e");case Wi:var f=e.publicId,m=e.systemId;if(t.push("');else if(m&&"."!=m)t.push(' SYSTEM "',m,'">');else{var g=e.internalSubset;g&&t.push(" [",g,"]"),t.push(">")}return;case Hi:return t.push("",e.target," ",e.data,"?>");case ji:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function be(e,t,i){var n;switch(t.nodeType){case Ri:(n=t.cloneNode(!1)).ownerDocument=e;case zi:break;case Ui:i=!0}if(n||(n=t.cloneNode(!1)),n.ownerDocument=e,n.parentNode=null,i)for(var r=t.firstChild;r;)n.appendChild(be(e,r,i)),r=r.nextSibling;return n}function Te(e,t,i){var n=new t.constructor;for(var r in t){var s=t[r];"object"!=typeof s&&s!=n[r]&&(n[r]=s)}switch(t.childNodes&&(n.childNodes=new V),n.ownerDocument=e,n.nodeType){case Ri:var a=t.attributes,o=n.attributes=new z,u=a.length;o._ownerElement=n;for(var l=0;l1?t-1:0),n=1;n=0)throw new Error("class has illegal whitespace characters")}function Le(){return qt===Ft.document}function Oe(e){return Ee(e)&&1===e.nodeType}function De(){try{return Ft.parent!==Ft.self}catch(e){return!0}}function Ne(e){return function(t,i){if(!Ie(t))return qt[e](null);Ie(i)&&(i=qt.querySelector(i));var n=Oe(i)?i:qt;return n[e]&&n[e](t)}}function Re(e,t,i,n){void 0===e&&(e="div"),void 0===t&&(t={}),void 0===i&&(i={});var r=qt.createElement(e);return Object.getOwnPropertyNames(t).forEach(function(e){var i=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(Qr.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 "+i+"."),r.setAttribute(e,i)):"textContent"===e?Ue(r,i):r[e]!==i&&(r[e]=i)}),Object.getOwnPropertyNames(i).forEach(function(e){r.setAttribute(e,i[e])}),n&&tt(r,n),r}function Ue(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function Me(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function Be(e,t){return Pe(t),e.classList?e.classList.contains(t):(i=t,new RegExp("(^|\\s)"+i+"($|\\s)")).test(e.className);var i}function je(e,t){return e.classList?e.classList.add(t):Be(e,t)||(e.className=(e.className+" "+t).trim()),e}function Fe(e,t){return e.classList?e.classList.remove(t):(Pe(t),e.className=e.className.split(/\s+/).filter(function(e){return e!==t}).join(" ")),e}function He(e,t,i){var n=Be(e,t);if("function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=!n),i!==n)return i?je(e,t):Fe(e,t),e}function Ve(e,t){Object.getOwnPropertyNames(t).forEach(function(i){var n=t[i];null==n||!1===n?e.removeAttribute(i):e.setAttribute(i,!0===n?"":n)})}function qe(e){var t={};if(e&&e.attributes&&e.attributes.length>0)for(var i=e.attributes,n=i.length-1;n>=0;n--){var r=i[n].name,s=i[n].value;"boolean"!=typeof e[r]&&-1===",autoplay,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+r+",")||(s=null!==s),t[r]=s}return t}function We(e,t){return e.getAttribute(t)}function ze(e,t,i){e.setAttribute(t,i)}function Ge(e,t){e.removeAttribute(t)}function Xe(){qt.body.focus(),qt.onselectstart=function(){return!1}}function Ke(){qt.onselectstart=function(){return!0}}function Ye(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach(function(e){void 0!==t[e]&&(i[e]=t[e])}),i.height||(i.height=parseFloat(Ae(e,"height"))),i.width||(i.width=parseFloat(Ae(e,"width"))),i}}function $e(e){var t;if(e.getBoundingClientRect&&e.parentNode&&(t=e.getBoundingClientRect()),!t)return{left:0,top:0};var i=qt.documentElement,n=qt.body,r=i.clientLeft||n.clientLeft||0,s=Ft.pageXOffset||n.scrollLeft,a=t.left+s-r,o=i.clientTop||n.clientTop||0,u=Ft.pageYOffset||n.scrollTop,l=t.top+u-o;return{left:Math.round(a),top:Math.round(l)}}function Qe(e,t){var i={},n=$e(e),r=e.offsetWidth,s=e.offsetHeight,a=n.top,o=n.left,u=t.pageY,l=t.pageX;return t.changedTouches&&(l=t.changedTouches[0].pageX,u=t.changedTouches[0].pageY),i.y=Math.max(0,Math.min(1,(a-u+s)/s)),i.x=Math.max(0,Math.min(1,(l-o)/r)),i}function Je(e){return Ee(e)&&3===e.nodeType}function Ze(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function et(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(function(e){return"function"==typeof e&&(e=e()),Oe(e)||Je(e)?e:"string"==typeof e&&/\S/.test(e)?qt.createTextNode(e):void 0}).filter(function(e){return e})}function tt(e,t){return et(t).forEach(function(t){return e.appendChild(t)}),e}function it(e,t){return tt(Ze(e),t)}function nt(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}function rt(e,t){t&&(Nr=t),Ft.setTimeout(ss,e)}function st(){rs=!0,Ft.removeEventListener("load",st)}function at(){return ls++}function ot(e,t){if(ds.has(e)){var i=ds.get(e);0===i.handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&ds.delete(e)}}function ut(e,t,i,n){i.forEach(function(i){e(t,i,n)})}function lt(e){function t(){return!0}function i(){return!1}if(e.fixed_)return e;if(!e||!e.isPropagationStopped){var n=e||Ft.event;for(var r in e={},n)"layerX"!==r&&"layerY"!==r&&"keyLocation"!==r&&"webkitMovementX"!==r&&"webkitMovementY"!==r&&("returnValue"===r&&n.preventDefault||(e[r]=n[r]));if(e.target||(e.target=e.srcElement||qt),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){n.preventDefault&&n.preventDefault(),e.returnValue=!1,n.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){n.stopPropagation&&n.stopPropagation(),e.cancelBubble=!0,n.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){n.stopImmediatePropagation&&n.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX){var s=qt.documentElement,a=qt.body;e.pageX=e.clientX+(s&&s.scrollLeft||a&&a.scrollLeft||0)-(s&&s.clientLeft||a&&a.clientLeft||0),e.pageY=e.clientY+(s&&s.scrollTop||a&&a.scrollTop||0)-(s&&s.clientTop||a&&a.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e.fixed_=!0,e}function ct(e,t,i){if(Array.isArray(t))return ut(ct,e,t,i);ds.has(e)||ds.set(e,{});var n=ds.get(e);if(n.handlers||(n.handlers={}),n.handlers[t]||(n.handlers[t]=[]),i.guid||(i.guid=at()),n.handlers[t].push(i),n.dispatcher||(n.disabled=!1,n.dispatcher=function(t,i){if(!n.disabled){t=lt(t);var r=n.handlers[t.type];if(r)for(var s=r.slice(0),a=0,o=s.length;a-1&&(r={passive:!0}),e.addEventListener(t,n.dispatcher,r)}else e.attachEvent&&e.attachEvent("on"+t,n.dispatcher)}function ht(e,t,i){if(ds.has(e)){var n=ds.get(e);if(n.handlers){if(Array.isArray(t))return ut(ht,e,t,i);var r=function(e,t){n.handlers[t]=[],ot(e,t)};if(void 0!==t){var s=n.handlers[t];if(s)if(i){if(i.guid)for(var a=0;ai)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+i+").")}(e,n,i.length-1),i[n][t]}function _t(e){return 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:yt.bind(null,"start",0,e),end:yt.bind(null,"end",1,e)}}function bt(e,t){return Array.isArray(e)?_t(e):void 0===e||void 0===t?_t():_t([[e,t]])}function Tt(e,t){var i,n,r=0
;if(!t)return 0;e&&e.length||(e=bt(0,0));for(var s=0;st&&(n=t),r+=n-i;return r/t}function St(e){if(e instanceof St)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:Ee(e)&&("number"==typeof e.code&&(this.code=e.code),we(this,e)),this.message||(this.message=St.defaultMessages[this.code]||"")}function kt(e){return null!=e&&"function"==typeof e.then}function Ct(e){kt(e)&&e.then(null,function(e){})}function wt(e,t,i){e.setTimeout(function(){return At(t,ja[t.type],i,e)},1)}function Et(e,t,i,n){void 0===n&&(n=null);var r="call"+Is(i),s=e.reduce(xt(r),n),a=s===Ha,o=a?null:t[i](s);return function(e,t,i,n){for(var r=e.length-1;r>=0;r--){var s=e[r];s[t]&&s[t](n,i)}}(e,i,o,a),o}function xt(e){return function(t,i){return t===Ha?Ha:i[e]?i[e](t):t}}function At(e,t,i,n,r,s){void 0===e&&(e={}),void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===s&&(s=!1);var a=t,o=a[0],u=a.slice(1);if("string"==typeof o)At(e,ja[o],i,n,r,s);else if(o){var l=function(e,t){var i=Fa[e.id()],n=null;if(null==i)return n=t(e),Fa[e.id()]=[[t,n]],n;for(var r=0;r=0&&t<=100)&&(this.set(e,t),!0)}};var ti=qt.createElement("textarea"),ii={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},ni={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)"},ri={v:"title",lang:"lang"},si={rt:"ruby"},ai=[[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]];g.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},g.prototype.formatStyle=function(e,t){return 0===e?0:e+t},v.prototype=ei(g.prototype),v.prototype.constructor=v,y.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}},y.prototype.overlaps=function(e){return this.lefte.left&&this.tope.top},y.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},y.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},y.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)},y.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}},y.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=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||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i}},b.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},b.convertCueToDOMTree=function(e,t){return e&&t?p(e,t):null},b.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var n=e.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",i.appendChild(n),function(e){for(var t=0;t-1},t.trigger=function(e){var t,i,n,r=this.listeners[e];if(r)if(2===arguments.length)for(i=r.length,t=0;t-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(bi),Si=function(e){for(var t,i=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),n={},r=i.length;r--;)""!==i[r]&&((t=/([^=]*)=(.*)/.exec(i[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"),n[t[0]]=t[1]);return n},ki=function(e){function t(){var t;return(t=e.call(this)||this).customParsers=[],t.tagMappers=[],t}w(t,e);var i=t.prototype;return i.push=function(e){var t,i,n=this;0!==(e=e.trim()).length&&("#"===e[0]?this.tagMappers.reduce(function(t,i){var n=i(e);return n===e?t:t.concat([n])},[e]).forEach(function(e){for(var r=0;r0&&(a.duration=e.duration),0===e.duration&&(a.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=s},key:function(){if(e.attributes)if("NONE"!==e.attributes.METHOD)if(e.attributes.URI){if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===e.attributes.KEYFORMAT)return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(e.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===e.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==e.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):e.attributes.KEYID&&"0x"===e.attributes.KEYID.substring(0,2)?void(this.manifest.contentProtection={"com.widevine.alpha":{attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:E(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"}),n={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void 0!==e.attributes.IV&&(n.iv=e.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else n=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,l=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(){i={},e.uri&&(i.uri=e.uri),e.byterange&&(i.byterange=e.byterange)},"stream-inf":function(){this.manifest.playlists=s,this.manifest.mediaGroups=this.manifest.mediaGroups||u,e.attributes?(a.attributes||(a.attributes={}),C(a.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||u,e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME){var i=this.manifest.mediaGroups[e.attributes.TYPE];i[e.attributes["GROUP-ID"]]=i[e.attributes["GROUP-ID"]]||{},t=i[e.attributes["GROUP-ID"]],(c={default:/yes/i.test(e.attributes.DEFAULT)}).default?c.autoselect=!0:c.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(c.language=e.attributes.LANGUAGE),e.attributes.URI&&(c.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(c.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(c.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(c.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=c}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){l+=1,a.discontinuity=!0,this.manifest.discontinuityStarts.push(s.length)},"program-date-time":function(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),a.dateTimeString=e.dateTimeString,a.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},totalduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid total duration: "+e.duration}):this.manifest.totalDuration=e.duration},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(){a.cueOut=e.data},"cue-out-cont":function(){a.cueOutCont=e.data},"cue-in":function(){a.cueIn=e.data}})[e.tagType]||o).call(r)},uri:function(){a.uri=e.uri,s.push(a),this.manifest.targetDuration&&!("duration"in a)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),a.duration=this.manifest.targetDuration),n&&(a.key=n),a.timeline=l,i&&(a.map=i),a={}},comment:function(){},custom:function(){e.segment?(a.custom=a.custom||{},
a.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(r)}),t}w(t,e);var i=t.prototype;return i.push=function(e){this.lineStream.push(e)},i.end=function(){this.lineStream.push("\n")},i.addParser=function(e){this.parseStream.addParser(e)},i.addTagMapper=function(e){this.parseStream.addTagMapper(e)},t}(bi),wi=x(_i),Ei=x(Ft),xi=function(e,t){return/^[a-z]+:/i.test(t)?t:(/\/\//i.test(e)||(e=wi.buildAbsoluteURL(Ei.location&&Ei.location.href||"",e)),wi.buildAbsoluteURL(e,t))},Ai=(ci=Ft)&&"object"==typeof ci&&"default"in ci?ci.default:ci,Ii=function(e){for(var t,i=(t=e,Ai.atob?Ai.atob(t):n.from(t,"base64").toString("binary")),r=new Uint8Array(i.length),s=0;s65535){var t=55296+((e-=65536)>>10),i=56320+(1023&e);return String.fromCharCode(t,i)}return String.fromCharCode(e)}function a(e){var t=e.slice(1,-1);return t in i?i[t]:"#"===t.charAt(0)?s(parseInt(t.substr(1).replace("x","0x"))):(r.error("entity not found:"+e),e)}function o(t){if(t>m){var i=e.substring(m,t).replace(/?\w+;/g,a);d&&u(m),n.characters(i,0,t-m),m=t}}function u(t,i){for(;t>=c&&(i=h.exec(e));)l=i.index,c=l+i[0].length,d.lineNumber++;d.columnNumber=t-l+1}for(var l=0,c=0,h=/.*(?:\r\n?|\n)|.*$/g,d=n.locator,p=[{currentNSMap:t}],f={},m=0;;){try{var g=e.indexOf("<",m);if(g<0){if(!e.substr(m).match(/^\s*$/)){var v=n.doc,y=v.createTextNode(e.substr(m));v.appendChild(y),n.currentElement=y}return}switch(g>m&&o(g),e.charAt(g+1)){case"/":var _=e.indexOf(">",g+3),b=e.substring(g+2,_),T=p.pop();_<0?(b=e.substring(g+2).replace(/[\s<].*/,""),r.error("end tag name: "+b+" is not complete:"+T.tagName),_=g+1+b.length):b.match(/\s)&&(b=b.replace(/[\s<].*/,""),r.error("end tag name: "+b+" maybe not complete"),_=g+1+b.length);var S=T.localNSMap,k=T.tagName==b;if(k||T.tagName&&T.tagName.toLowerCase()==b.toLowerCase()){if(n.endElement(T.uri,T.localName,b),S)for(var C in S)n.endPrefixMapping(C);k||r.fatalError("end tag name: "+b+" is not match the current start tagName:"+T.tagName)}else p.push(T);_++;break;case"?":d&&u(g),_=U(e,g,n);break;case"!":d&&u(g),_=R(e,g,n,r);break;default:d&&u(g);var w=new M,E=p[p.length-1].currentNSMap,x=(_=P(e,g,w,E,a,r),w.length);if(!w.closed&&D(e,_,w.tagName,f)&&(w.closed=!0,i.nbsp||r.warning("unclosed xml attribute")),d&&x){for(var A=I(d,{}),N=0;Nm?m=_:o(Math.max(g,m)+1)}}(e,t,i,n,this.errorHandler),n.endDocument()}},M.prototype={setTagName:function(e){if(!Oi.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},add:function(e,t,i){if(!Oi.test(e))throw new Error("invalid attribute:"+e);this[this.length++]={qName:e,value:t,offset:i}},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}},B({},B.prototype)instanceof B||(B=function(e,t){function i(){}for(t in i.prototype=t,i=new i,e)i[t]=e[t];return i});var Di={XMLReader:A},Ni={},Ri=Ni.ELEMENT_NODE=1,Ui=Ni.ATTRIBUTE_NODE=2,Mi=Ni.TEXT_NODE=3,Bi=Ni.CDATA_SECTION_NODE=4,ji=Ni.ENTITY_REFERENCE_NODE=5,Fi=Ni.ENTITY_NODE=6,Hi=Ni.PROCESSING_INSTRUCTION_NODE=7,Vi=Ni.COMMENT_NODE=8,qi=Ni.DOCUMENT_NODE=9,Wi=Ni.DOCUMENT_TYPE_NODE=10,zi=Ni.DOCUMENT_FRAGMENT_NODE=11,Gi=Ni.NOTATION_NODE=12,Xi={},Ki={},Yi=(Xi.INDEX_SIZE_ERR=(Ki[1]="Index size error",1),Xi.DOMSTRING_SIZE_ERR=(Ki[2]="DOMString size error",2),Xi.HIERARCHY_REQUEST_ERR=(Ki[3]="Hierarchy request error",3)),$i=(Xi.WRONG_DOCUMENT_ERR=(Ki[4]="Wrong document",4),Xi.INVALID_CHARACTER_ERR=(Ki[5]="Invalid character",5),Xi.NO_DATA_ALLOWED_ERR=(Ki[6]="No data allowed",6),Xi.NO_MODIFICATION_ALLOWED_ERR=(Ki[7]="No modification allowed",7),Xi.NOT_FOUND_ERR=(Ki[8]="Not found",8)),Qi=(Xi.NOT_SUPPORTED_ERR=(Ki[9]="Not supported",9),Xi.INUSE_ATTRIBUTE_ERR=(Ki[10]="Attribute in use",10));Xi.INVALID_STATE_ERR=(Ki[11]="Invalid state",11),Xi.SYNTAX_ERR=(Ki[12]="Syntax error",12),Xi.INVALID_MODIFICATION_ERR=(Ki[13]="Invalid modification",13),Xi.NAMESPACE_ERR=(Ki[14]="Invalid namespace",14),Xi.INVALID_ACCESS_ERR=(Ki[15]="Invalid access",15),H.prototype=Error.prototype,j(Xi,H),V.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var i=[],n=0;n0},lookupPrefix:function(e){for(var t=this;t;){var i=t._nsMap;if(i)for(var n in i)if(i[n]==e)return n;t=t.nodeType==Ui?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var i=t._nsMap;if(i&&e in i)return i[e];t=t.nodeType==Ui?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},j(Ni,$),j(Ni,$.prototype),Z.prototype={nodeName:"#document",nodeType:qi,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==zi){for(var i=e.firstChild;i;){var n=i.nextSibling;this.insertBefore(i,t),i=n}return e}return null==this.documentElement&&e.nodeType==Ri&&(this.documentElement=e),ne(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),ie(this,e)},importNode:function(e,t){return be(this,e,t)},getElementById:function(e){var t=null;return J(this.documentElement,function(i){if(i.nodeType==Ri&&i.getAttribute("id")==e)return t=i,!0}),t},createElement:function(e){var t=new re;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.childNodes=new V,(t.attributes=new z)._ownerElement=t,t},createDocumentFragment:function(){var e=new fe;return e.ownerDocument=this,e.childNodes=new V,e},createTextNode:function(e){var t=new oe;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new ue;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new le;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var i=new me;return i.ownerDocument=this,i.tagName=i.target=e,i.nodeValue=i.data=t,i},createAttribute:function(e){var t=new se;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new pe;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var i=new re,n=t.split(":"),r=i.attributes=new z;return i.childNodes=new V,i.ownerDocument=this,i.nodeName=t,i.tagName=t,i.namespaceURI=e,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,r._ownerElement=i,i},createAttributeNS:function(e,t){var i=new se,n=t.split(":");return i.ownerDocument=this,i.nodeName=t,i.name=t,i.namespaceURI=e,i.specified=!0,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,i}},F(Z,$),re.prototype={nodeType:Ri,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 i=this.ownerDocument.createAttribute(e);i.value=i.nodeValue=""+t,this.setAttributeNode(i)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===zi?this.insertBefore(e,null):function(e,t){var i=t.parentNode;if(i){var n=e.lastChild;i.removeChild(t),n=e.lastChild}return n=e.lastChild,t.parentNode=e,t.previousSibling=n,t.nextSibling=null,n?n.nextSibling=t:e.firstChild=t,e.lastChild=t,te(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 i=this.getAttributeNodeNS(e,t);i&&this.removeAttributeNode(i)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);return i&&i.value||""},setAttributeNS:function(e,t,i){var n=this.ownerDocument.createAttributeNS(e,t);n.value=n.nodeValue=""+i,this.setAttributeNode(n)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new q(this,function(t){var i=[];return J(t,function(n){n===t||n.nodeType!=Ri||"*"!==e&&n.tagName!=e||i.push(n)}),i})},getElementsByTagNameNS:function(e,t){return new q(this,function(i){var n=[];return J(i,function(r){r===i||r.nodeType!==Ri||"*"!==e&&r.namespaceURI!==e||"*"!==t&&r.localName!=t||n.push(r)}),n})}},Z.prototype.getElementsByTagName=re.prototype.getElementsByTagName,Z.prototype.getElementsByTagNameNS=re.prototype.getElementsByTagNameNS,F(re,$),se.prototype.nodeType=Ui,F(se,$),ae.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(Ki[Yi])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){i=this.data.substring(0,e)+i+this.data.substring(e+t),this.nodeValue=this.data=i,this.length=i.length}},F(ae,$),oe.prototype={nodeName:"#text",nodeType:Mi,splitText:function(e){var t=this.data,i=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},F(oe,ae),ue.prototype={nodeName:"#comment",nodeType:Vi},F(ue,ae),le.prototype={nodeName:"#cdata-section",nodeType:Bi},F(le,ae),ce.prototype.nodeType=Wi,F(ce,$),he.prototype.nodeType=Gi,F(he,$),de.prototype.nodeType=Fi,F(de,$),pe.prototype.nodeType=ji,F(pe,$),fe.prototype.nodeName="#document-fragment",fe.prototype.nodeType=zi,F(fe,$),me.prototype.nodeType=Hi,F(me,$),ge.prototype.serializeToString=function(e,t,i){return ve.call(e,t,i)},$.prototype.toString=ve;try{Object.defineProperty&&(Object.defineProperty(q.prototype,"length",{get:function(){return W(this),this.$$length}}),Object.defineProperty($.prototype,"textContent",{get:function(){return ke(this)},set:function(e){switch(this.nodeType){case Ri:case zi: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}}}),Se=function(e,t,i){e["$$"+t]=i})}catch(e){}var Ji,Zi,en,tn,nn,rn,sn,an={DOMImplementation:Y,XMLSerializer:ge},on=r(function(e,t){function i(e){this.options=e||{locator:{}}}function n(){this.cdata=!1}function r(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function s(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function a(e,t,i){return"string"==typeof e?e.substr(t,i):e.length>=t+i||t?new java.lang.String(e,t,i)+"":e}function o(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}i.prototype.parseFromString=function(e,t){var i=this.options,r=new u,a=i.domBuilder||new n,o=i.errorHandler,l=i.locator,c=i.xmlns||{},h={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return l&&a.setDocumentLocator(l),r.errorHandler=function(e,t,i){function r(t){var n=e[t];!n&&o&&(n=2==e.length?function(i){e(t,i)}:e),a[t]=n&&function(e){n("[xmldom "+t+"]\t"+e+s(i))}||function(){}}if(!e){if(t instanceof n)return t;e=t}var a={},o=e instanceof Function;return i=i||{},r("warning"),r("error"),r("fatalError"),a}(o,a,l),r.domBuilder=i.domBuilder||a,/\/x?html?$/.test(t)&&(h.nbsp=" ",h.copy="©",c[""]="http://www.w3.org/1999/xhtml"),c.xml=c.xml||"http://www.w3.org/XML/1998/namespace",e?r.parse(e,c,h):r.errorHandler.error("invalid doc source"),a.doc},n.prototype={startDocument:function(){this.doc=(new l).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,i,n){var s=this.doc,a=s.createElementNS(e,i||t),u=n.length;o(this,a),this.currentElement=a,this.locator&&r(this.locator,a);for(var l=0;ln.attributes.bandwidth||(e[a]={language:s,autoselect:!0,default:"main"===r,playlists:yn([_n(n)],t),uri:""},void 0===i&&"main"===r&&((i=n).default=!0)),e},{});return i||(n[Object.keys(n)[0]].default=!0),n}(h,t)),d.length&&(p.mediaGroups.SUBTITLES.subs=function(e,t){return void 0===t&&(t={}),e.reduce(function(e,i){var n,r,s,a,o=i.attributes.lang||"text";return e[o]||(e[o]={language:o,default:!1,autoselect:!1,playlists:yn([(n=i,s=n.attributes,a=n.segments,void 0===a&&(a=[{uri:s.baseUrl,timeline:s.periodIndex,resolvedUri:s.baseUrl||"",duration:s.sourceDuration,number:0}],s.duration=s.sourceDuration),{attributes:(r={NAME:s.id,BANDWIDTH:s.bandwidth},r["PROGRAM-ID"]=1,r),uri:"",endList:"static"===(s.type||"static"),timeline:s.periodIndex,resolvedUri:s.baseUrl||"",targetDuration:s.duration,segments:a,mediaSequence:a.length?a[0].number:1})],t),uri:""}),e},{})}(d,t)),p},Sn=function(e,t,i){var n=e.NOW,r=e.clientOffset,s=e.availabilityStartTime,a=e.timescale,o=void 0===a?1:a,u=e.start,l=void 0===u?0:u,c=e.minimumUpdatePeriod,h=(n+r)/1e3+(void 0===c?0:c)-(s+l);return Math.ceil((h*o-t)/i)},kn=function(e,t){for(var i=e.type,n=void 0===i?"static":i,r=e.minimumUpdatePeriod,s=void 0===r?0:r,a=e.media,o=void 0===a?"":a,u=e.sourceDuration,l=e.timescale,c=void 0===l?1:l,h=e.startNumber,d=void 0===h?1:h,p=e.periodIndex,f=[],m=-1,g=0;gm&&(m=b);var T=void 0;if(_<0){var S=g+1;T=S===t.length?"dynamic"===n&&s>0&&o.indexOf("$Number$")>0?Sn(e,m,y):(u*c-m)/y:(t[S].t-m)/y}else T=_+1;for(var k=d+f.length+T,C=d+f.length;C=r?s:""+new Array(r-s.length+1).join("0")+s)}}(t))},En=function(e,t){var i={RepresentationID:e.id,Bandwidth:e.bandwidth||0},n=e.initialization,r=void 0===n?{sourceURL:"",range:""}:n,s=dn({baseUrl:e.baseUrl,source:wn(r.sourceURL,i),range:r.range});return function(e,t){return e.duration||t?e.duration?fn(e):kn(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodIndex}]}(e,t).map(function(t){i.Number=t.number,i.Time=t.time;var n=wn(e.media||"",i);return{uri:n,timeline:t.timeline,duration:t.duration,resolvedUri:xi(e.baseUrl||"",n),map:s,number:t.number}})},xn=function(e,t){var i=e.duration,n=e.segmentUrls,r=void 0===n?[]:n;if(!i&&!t||i&&t)throw new Error("SEGMENT_TIME_UNSPECIFIED");var s,a=r.map(function(t){return function(e,t){var i=e.baseUrl,n=e.initialization,r=void 0===n?{}:n,s=dn({baseUrl:i,source:r.sourceURL,range:r.range}),a=dn({baseUrl:i,source:t.media,range:t.mediaRange});return a.map=s,a}(e,t)});return i&&(s=fn(e)),t&&(s=kn(e,t)),s.map(function(e,t){if(a[t]){var i=a[t];return i.timeline=e.timeline,i.duration=e.duration,i.number=e.number,i}}).filter(function(e){return e})},An=function(e){var t,i,n=e.attributes,r=e.segmentInfo;r.template?(i=En,t=ln(n,r.template)):r.base?(i=mn,t=ln(n,r.base)):r.list&&(i=xn,t=ln(n,r.list));var s={attributes:n};if(!i)return s;var a=i(t,r.timeline);if(t.duration){var o=t,u=o.duration,l=o.timescale,c=void 0===l?1:l;t.duration=u/c}else a.length?t.duration=a.reduce(function(e,t){return Math.max(e,Math.ceil(t.duration))},0):t.duration=0;return s.attributes=t,s.segments=a,r.base&&t.indexRange&&(s.sidx=a[0],s.segments=[]),s},In=function(e,t){return hn(e.childNodes).filter(function(e){return e.tagName===t})},Pn=function(e){return e.textContent.trim()},Ln=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 i=t.slice(1),n=i[0],r=i[1],s=i[2],a=i[3],o=i[4],u=i[5];return 31536e3*parseFloat(n||0)+2592e3*parseFloat(r||0)+86400*parseFloat(s||0)+3600*parseFloat(a||0)+60*parseFloat(o||0)+parseFloat(u||0)},On={mediaPresentationDuration:function(e){return Ln(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 Ln(e)},suggestedPresentationDelay:function(e){return Ln(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return Ln(e)},start:function(e){return Ln(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)},duration:function(e){var t=parseInt(e,10);return isNaN(t)?Ln(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}},Dn=function(e){return e&&e.attributes?hn(e.attributes).reduce(function(e,t){var i=On[t.name]||On.DEFAULT;return e[t.name]=i(t.value),e},{}):{}},Nn={"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"},Rn=function(e,t){return t.length?cn(e.map(function(e){return t.map(function(t){return xi(e,Pn(t))})})):e},Un=function(e){var t=In(e,"SegmentTemplate")[0],i=In(e,"SegmentList")[0],n=i&&In(i,"SegmentURL").map(function(e){return ln({tag:"SegmentURL"},Dn(e))}),r=In(e,"SegmentBase")[0],s=i||t,a=s&&In(s,"SegmentTimeline")[0],o=i||r||t,u=o&&In(o,"Initialization")[0],l=t&&Dn(t);l&&u?l.initialization=u&&Dn(u):l&&l.initialization&&(l.initialization={sourceURL:l.initialization});var c={template:l,timeline:a&&In(a,"S").map(function(e){return Dn(e)}),list:i&&ln(Dn(i),{segmentUrls:n,initialization:Dn(u)}),base:r&&ln(Dn(r),{initialization:Dn(u)})};return Object.keys(c).forEach(function(e){c[e]||delete c[e]}),c},Mn=function(e,t,i){return function(n){var r=Dn(n),s=Rn(t,In(n,"BaseURL")),a=In(n,"Role")[0],o={role:Dn(a)},u=ln(e,r,o),l=In(n,"ContentProtection").reduce(function(e,t){var i=Dn(t),n=Nn[i.schemeIdUri];if(n){e[n]={attributes:i};var r=In(t,"cenc:pssh")[0];if(r){var s=Pn(r),a=s&&Ii(s);e[n].pssh=a}}return e},{});Object.keys(l).length&&(u=ln(u,{contentProtection:l}));var c=Un(n),h=In(n,"Representation"),d=ln(i,c);return cn(h.map(function(e,t,i){return function(n){var r=In(n,"BaseURL"),s=Rn(t,r),a=ln(e,Dn(n)),o=Un(n);return s.map(function(e){return{segmentInfo:ln(i,o),attributes:ln(a,{baseUrl:e})}})}}(u,s,d)))}},Bn=function(e,t){void 0===t&&(t={});var i=t,n=i.manifestUri,r=void 0===n?"":n,s=i.NOW,a=void 0===s?Date.now():s,o=i.clientOffset,u=void 0===o?0:o,l=In(e,"Period");if(!l.length)throw new Error("INVALID_NUMBER_OF_PERIOD");var c=Dn(e),h=Rn([r],In(e,"BaseURL"));return c.sourceDuration=c.mediaPresentationDuration||0,c.NOW=a,c.clientOffset=u,cn(l.map(function(e,t){return function(i,n){var r=Rn(t,In(i,"BaseURL")),s=Dn(i),a=parseInt(s.id,10),o=Ft.isNaN(a)?n:a,u=ln(e,{periodIndex:o}),l=In(i,"AdaptationSet"),c=Un(i);return cn(l.map(Mn(u,r,c)))}}(c,h)))},jn=function(e){if(""===e)throw new Error("DASH_EMPTY_MANIFEST");var t=(new on.DOMParser).parseFromString(e,"application/xml"),i=t&&"MPD"===t.documentElement.tagName?t.documentElement:null;if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw new Error("DASH_INVALID_XML");return i},Fn=function(e,t){return void 0===t&&(t={}),Tn(Bn(jn(e),t).map(An),t.sidxMapping)},Hn=function(e){return function(e){var t=In(e,"UTCTiming")[0];if(!t)return null;var i=Dn(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.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":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error("UNSUPPORTED_UTC_TIMING_SCHEME")}return i}(jn(e))},Vn=function(e){return e>>>0},qn=function(e){return("00"+e.toString(16)).slice(-2)},Wn=Vn,zn=function(e){return new Date(1e3*e-20828448e5)},Gn=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]}},Xn=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3])},Kn=function(e,t){var i,n,r,s,a,o=[];if(!t.length)return null;for(i=0;i1?i+n:e.byteLength,r===t[0]&&(1===t.length?o.push(e.subarray(i+8,s)):(a=Kn(e.subarray(i+8,s),t.slice(1))).length&&(o=o.concat(a))),i=s;return o},Yn=function(e){var t,i,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=[];for(t=0;t+4MALFORMED DATA");else switch(31&e[t]){case 1:r.push("slice_layer_without_partitioning_rbsp");break;case 5:r.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:r.push("sei_rbsp");break;case 7:r.push("seq_parameter_set_rbsp");break;case 8:r.push("pic_parameter_set_rbsp");break;case 9:r.push("access_unit_delimiter_rbsp");break;default:r.push("UNKNOWN NAL - "+e[t]&31)}return r},$n={avc1:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{dataReferenceIndex:t.getUint16(6),width:t.getUint16(24),height:t.getUint16(26),horizresolution:t.getUint16(28)+t.getUint16(30)/16,vertresolution:t.getUint16(32)+t.getUint16(34)/16,frameCount:t.getUint16(40),depth:t.getUint16(74),config:Ji(e.subarray(78,e.byteLength))}},avcC:function(e){var t,i,n,r,s=new DataView(e.buffer,e.byteOffset,e.byteLength),a={configurationVersion:e[0],avcProfileIndication:e[1],profileCompatibility:e[2],avcLevelIndication:e[3],
lengthSizeMinusOne:3&e[4],sps:[],pps:[]},o=31&e[5];for(n=6,r=0;r>>2&63,bufferSize:e[13]<<16|e[14]<<8|e[15],maxBitrate:e[16]<<24|e[17]<<16|e[18]<<8|e[19],avgBitrate:e[20]<<24|e[21]<<16|e[22]<<8|e[23],decoderConfigDescriptor:{tag:e[24],length:e[25],audioObjectType:e[26]>>>3&31,samplingFrequencyIndex:(7&e[26])<<1|e[27]>>>7&1,channelConfiguration:e[27]>>>3&15}}}},ftyp:function(e){for(var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={majorBrand:Xn(e.subarray(0,4)),minorVersion:t.getUint32(4),compatibleBrands:[]},n=8;n>10)),r.language+=String.fromCharCode(96+((992&t)>>5)),r.language+=String.fromCharCode(96+(31&t)),r},mdia:function(e){return{boxes:Ji(e)}},mfhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sequenceNumber:e[4]<<24|e[5]<<16|e[6]<<8|e[7]}},minf:function(e){return{boxes:Ji(e)}},mp4a:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={dataReferenceIndex:t.getUint16(6),channelcount:t.getUint16(16),samplesize:t.getUint16(18),samplerate:t.getUint16(24)+t.getUint16(26)/65536};return e.byteLength>28&&(i.streamDescriptor=Ji(e.subarray(28))[0]),i},moof:function(e){return{boxes:Ji(e)}},moov:function(e){return{boxes:Ji(e)}},mvex:function(e){return{boxes:Ji(e)}},mvhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=4,n={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=zn(t.getUint32(i)),i+=8,n.modificationTime=zn(t.getUint32(i)),i+=4,n.timescale=t.getUint32(i),i+=8,n.duration=t.getUint32(i)):(n.creationTime=zn(t.getUint32(i)),i+=4,n.modificationTime=zn(t.getUint32(i)),i+=4,n.timescale=t.getUint32(i),i+=4,n.duration=t.getUint32(i)),i+=4,n.rate=t.getUint16(i)+t.getUint16(i+2)/16,i+=4,n.volume=t.getUint8(i)+t.getUint8(i+1)/8,i+=2,i+=2,i+=8,n.matrix=new Uint32Array(e.subarray(i,i+36)),i+=36,i+=24,n.nextTrackId=t.getUint32(i),n},pdin:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),rate:t.getUint32(4),initialDelay:t.getUint32(8)}},sdtp:function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]};for(t=4;t>4,isDependedOn:(12&e[t])>>2,hasRedundancy:3&e[t]});return i},sidx:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:i.getUint32(4),timescale:i.getUint32(8),earliestPresentationTime:i.getUint32(12),firstOffset:i.getUint32(16)},r=i.getUint16(22);for(t=24;r;t+=12,r--)n.references.push({referenceType:(128&e[t])>>>7,referencedSize:2147483647&i.getUint32(t),subsegmentDuration:i.getUint32(t+4),startsWithSap:!!(128&e[t+8]),sapType:(112&e[t+8])>>>4,sapDeltaTime:268435455&i.getUint32(t+8)});return n},smhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),balance:e[4]+e[5]/256}},stbl:function(e){return{boxes:Ji(e)}},stco:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),chunkOffsets:[]},r=i.getUint32(4);for(t=8;r;t+=4,r--)n.chunkOffsets.push(i.getUint32(t));return n},stsc:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n=i.getUint32(4),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleToChunks:[]};for(t=8;n;t+=12,n--)r.sampleToChunks.push({firstChunk:i.getUint32(t),samplesPerChunk:i.getUint32(t+4),sampleDescriptionIndex:i.getUint32(t+8)});return r},stsd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleDescriptions:Ji(e.subarray(8))}},stsz:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleSize:i.getUint32(4),entries:[]};for(t=12;t>6,sampleHasRedundancy:(48&e[21])>>4,samplePaddingValue:(14&e[21])>>1,sampleIsDifferenceSample:!!(1&e[21]),sampleDegradationPriority:t.getUint16(22)}},trun:function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&i.flags[2],s=4&i.flags[2],a=1&i.flags[1],o=2&i.flags[1],u=4&i.flags[1],l=8&i.flags[1],c=n.getUint32(4),h=8;for(r&&(i.dataOffset=n.getInt32(h),h+=4),s&&c&&(t={flags:Gn(e.subarray(h,h+4))},h+=4,a&&(t.duration=n.getUint32(h),h+=4),o&&(t.size=n.getUint32(h),h+=4),l&&(t.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(t),c--);c--;)t={},a&&(t.duration=n.getUint32(h),h+=4),o&&(t.size=n.getUint32(h),h+=4),u&&(t.flags=Gn(e.subarray(h,h+4)),h+=4),l&&(t.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(t);return i},"url ":function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4))}},vmhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),graphicsmode:t.getUint16(4),opcolor:new Uint16Array([t.getUint16(6),t.getUint16(8),t.getUint16(10)])}}},Qn={inspect:Ji=function(e){for(var t,i,n,r,s,a=0,o=[],u=new ArrayBuffer(e.length),l=new Uint8Array(u),c=0;c1?a+i:e.byteLength,(s=($n[n]||function(e){return{data:e}})(e.subarray(a+8,r))).size=i,s.type=n,o.push(s),a=r;return o},textify:Zi=function(e,t){var i;return t=t||0,i=new Array(2*t+1).join(" "),e.map(function(e,n){return i+e.type+"\n"+Object.keys(e).filter(function(e){return"type"!==e&&"boxes"!==e}).map(function(t){var n=i+" "+t+": ",r=e[t];if(r instanceof Uint8Array||r instanceof Uint32Array){var s=Array.prototype.slice.call(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)).map(function(e){return" "+("00"+e.toString(16)).slice(-2)}).join("").match(/.{1,24}/g);return s?1===s.length?n+"<"+s.join("").slice(1)+">":n+"<\n"+s.map(function(e){return i+" "+e}).join("\n")+"\n"+i+" >":n+"<>"}return n+JSON.stringify(r,null,2).split("\n").map(function(e,t){return 0===t?e:i+" "+e}).join("\n")}).join("\n")+(e.boxes?"\n"+Zi(e.boxes,t+1):"")}).join("\n")},parseType:Xn,findBox:Kn,parseTraf:$n.traf,parseTfdt:$n.tfdt,parseHdlr:$n.hdlr,parseTfhd:$n.tfhd,parseTrun:$n.trun,parseSidx:$n.sidx},Jn=Vn,Zn=qn;en=function(e){return Qn.findBox(e,["moov","trak"]).reduce(function(e,t){var i,n,r,s,a;return(i=Qn.findBox(t,["tkhd"])[0])?(n=i[0],s=Jn(i[r=0===n?12:20]<<24|i[r+1]<<16|i[r+2]<<8|i[r+3]),(a=Qn.findBox(t,["mdia","mdhd"])[0])?(r=0===(n=a[0])?12:20,e[s]=Jn(a[r]<<24|a[r+1]<<16|a[r+2]<<8|a[r+3]),e):null):null},{})},tn=function(e,t){var i,n,r;return i=Qn.findBox(t,["moof","traf"]),n=[].concat.apply([],i.map(function(t){return Qn.findBox(t,["tfhd"]).map(function(i){var n,r;return n=Jn(i[4]<<24|i[5]<<16|i[6]<<8|i[7]),r=e[n]||9e4,(Qn.findBox(t,["tfdt"]).map(function(e){var t,i;return t=e[0],i=Jn(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),1===t&&(i*=Math.pow(2,32),i+=Jn(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),i})[0]||1/0)/r})})),r=Math.min.apply(null,n),isFinite(r)?r:0},nn=function(e,t){var i,n=Qn.findBox(t,["moof","traf"]),r=0,s=0;if(n&&n.length)for(var a=Qn.parseTraf(n[0]),o=0;o11?(r.codec+=".",r.codec+=Zn(c[9]),r.codec+=Zn(c[10]),r.codec+=Zn(c[11])):r.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(r.codec)&&(c=h.subarray(28),"esds"===Qn.parseType(c.subarray(4,8))&&c.length>20&&0!==c[19]?(r.codec+="."+Zn(c[19]),r.codec+="."+Zn(c[20]>>>2&63).replace(/^0/,"")):r.codec="mp4a.40.2"))}var d=Qn.findBox(e,["mdia","mdhd"])[0];if(d&&s){var p=0===n?12:20;r.timescale=Jn(d[p]<<24|d[p+1]<<16|d[p+2]<<8|d[p+3])}i.push(r)}),i};var er={findBox:Qn.findBox,parseType:Qn.parseType,timescale:en,startTime:tn,compositionStartTime:nn,videoTrackIds:rn,tracks:sn},tr=function(e){for(var t=0,i={payloadType:-1,payloadSize:0},n=0,r=0;t-1)},this.trigger=function(t){var i,n,r,s;if(i=e[t])if(2===arguments.length)for(r=i.length,n=0;n>>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),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,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_=hr();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=hr();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=hr()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(n,r))s=lr((n=(3&n)<<8)|r),this[this.mode_](e.pts,s),this.column_++;else if(this.isExtCharacter(n,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),s=lr((n=(3&n)<<8)|r),this[this.mode_](e.pts,s),this.column_++;else if(this.isMidRowCode(n,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(n,r))this.column_+=3&r;else if(this.isPAC(n,r)){var a=cr.indexOf(7968&t);"rollUp"===this.mode_&&(a-this.rollUpRows_+1<0&&(a=this.rollUpRows_-1),this.setRollUp(e.pts,a)),a!==this.row_&&(this.clearFormatting(e.pts),this.row_=a),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(n)&&(0===r&&(r=null),s=lr(n),s+=lr(r),this[this.mode_](e.pts,s),this.column_+=s.length)}else this.lastControlCode_=null}};dr.prototype=new ar,dr.prototype.flushDisplayed=function(e){var t=this.displayed_.map(function(e){try{return e.trim()}catch(e){return console.error("Skipping malformed caption."),""}}).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},dr.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=hr(),this.nonDisplayed_=hr(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},dr.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_},dr.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},dr.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},dr.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},dr.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},dr.prototype.isPAC=function(e,t){return e>=this.BASE_&&e=64&&t<=127},dr.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},dr.prototype.isNormalChar=function(e){return e>=32&&e<=127},dr.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=hr(),this.displayed_=hr()),void 0!==t&&t!==this.row_)for(var i=0;i"},"");this[this.mode_](e,i)},dr.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce(function(e,t){return e+""+t+">"},"");this.formatting_=[],this[this.mode_](e,t)}},dr.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];i+=t,this.nonDisplayed_[this.row_]=i},dr.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i},dr.prototype.shiftRowsUp_=function(){var e;for(e=0;e0?Qn.parseTfdt(l[0]).baseMediaDecodeTime:0,h=er.findBox(s,["trun"]);t===u&&h.length>0&&(i=function(e,t,i){var n,r,s,a,o=new DataView(e.buffer,e.byteOffset,e.byteLength),u=[];for(r=0;r+40;){var u=t.shift();this.parse(u,s,a)}return null!==(o=function(e,t,i){return null===t?null:{seiNals:gr(e,t)[t],timescale:i}}(e,i,n))&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),r):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;s?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){r.captions=[],r.captionStreams={}},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,n=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{}},this.resetCaptionStream()},this.reset()},yr=function(e,t){var i=1;for(e>t&&(i=-1);Math.abs(t-e)>4294967296;)e+=8589934592*i;return e},_r=function(e){var t,i;_r.prototype.init.call(this),this.type_=e||"shared",this.push=function(e){"shared"!==this.type_&&e.type!==this.type_||(void 0===i&&(i=e.dts),e.dts=yr(e.dts,i),e.pts=yr(e.pts,i),t=e.dts,this.trigger("data",e))},this.flush=function(){i=t,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){i=void 0,t=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};_r.prototype=new ar;var br,Tr,Sr,kr,Cr=function(e){var t=31&e[1];return t<<=8,t|=e[2]},wr=function(e){return!!(64&e[1])},Er=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},xr=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}},Ar={parseType:function(e,t){var i=Cr(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},parsePat:function(e){var t=wr(e),i=4+Er(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t={},i=wr(e),n=4+Er(e);if(i&&(n+=e[n]+1),1&e[n+5]){var r;r=3+((15&e[n+1])<<8|e[n+2])-4;for(var s=12+((15&e[n+10])<<8|e[n+11]);s=e.byteLength)return null;var i,n=null;return 192&(i=e[t+7])&&((n={}).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,n.pts*=4,n.pts+=(6&e[t+13])>>>1,n.dts=n.pts,64&i&&(n.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,n.dts*=4,n.dts+=(6&e[t+18])>>>1)),n},videoPacketContainsKeyFrame:function(e){for(var t=4+Er(e),i=e.subarray(t),n=0,r=0,s=!1;r3&&"slice_layer_without_partitioning_rbsp_idr"===xr(31&i[r+3])&&(s=!0),s}},Ir=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Pr=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Lr={isLikelyAacData:function(e){return e[0]==="I".charCodeAt(0)&&e[1]==="D".charCodeAt(0)&&e[2]==="3".charCodeAt(0)},parseId3TagSize:function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&e[t+5])>>4?i+20:i+10},parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3;return 6144&e[t+3]|n|i},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,i,n;t=10,64&e[5]&&(t+=4,t+=Pr(e.subarray(10,14)));do{if((i=Pr(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){n=e.subarray(t+10,t+i+10);for(var r=0;r>>2;return a*=4,a+=3&s[7]}break}}t+=10,t+=i}while(t=0;)if(71!==e[o]||71!==e[u]&&u!==e.byteLength)o--,u--;else{switch(n=e.subarray(o,u),Dr.ts.parseType(n,t.pid)){case"pes":r=Dr.ts.parsePesType(n,t.table),s=Dr.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&s&&(a=Dr.ts.parsePesTime(n))&&(a.type="audio",i.audio.push(a),l=!0)}if(l)break;o-=Rr,u-=Rr}},Mr=function(e,t,i){for(var n,r,s,a,o,u,l,c=0,h=Rr,d=!1,p={data:[],size:0};h=0;)if(71!==e[c]||71!==e[h])c--,h--;else{switch(n=e.subarray(c,h),Dr.ts.parseType(n,t.pid)){case"pes":r=Dr.ts.parsePesType(n,t.table),s=Dr.ts.parsePayloadUnitStartIndicator(n),"video"===r&&s&&(a=Dr.ts.parsePesTime(n))&&(a.type="video",i.video.push(a),d=!0)}if(d)break;c-=Rr,h-=Rr}},Br=function(e){var t={pid:null,table:null},i={};for(var n in function(e,t){for(var i,n=0,r=Rr;r=3;){switch(Dr.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){i=!0;break}if((a=Dr.aac.parseId3TagSize(e,o))>e.length){i=!0;break}null===s&&(t=e.subarray(o,o+a),s=Dr.aac.parseAacTimestamp(t)),o+=a;break;case"audio":if(e.length-o<7){i=!0;break}if((a=Dr.aac.parseAdtsSize(e,o))>e.length){i=!0;break}null===r&&(t=e.subarray(o,o+a),r=Dr.aac.parseSampleRate(t)),n++,o+=a;break;default:o++}if(i)return null}if(null===r||null===s)return null;var u=9e4/r;return{audio:[{type:"audio",dts:s,pts:s},{type:"audio",dts:s+1024*n*u,pts:s+1024*n*u}]}}(e):Br(e))&&(i.audio||i.video)?(function(e,t){if(e.audio&&e.audio.length){var i=t;void 0===i&&(i=e.audio[0].dts),e.audio.forEach(function(e){e.dts=Or(e.dts,i),e.pts=Or(e.pts,i),e.dtsTime=e.dts/9e4,e.ptsTime=e.pts/9e4})}if(e.video&&e.video.length){var n=t;if(void 0===n&&(n=e.video[0].dts),e.video.forEach(function(e){e.dts=Or(e.dts,n),e.pts=Or(e.pts,n),e.dtsTime=e.dts/9e4,e.ptsTime=e.pts/9e4}),e.firstKeyFrame){var r=e.firstKeyFrame;r.dts=Or(r.dts,n),r.pts=Or(r.pts,n),r.dtsTime=r.dts/9e4,r.ptsTime=r.dts/9e4}}}(i,t),i):null},Fr=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Hr=function(){function e(e,t){for(var i=0;i>7))^s]=s;for(a=o=0;!n[a];a^=c||1,o=l[o]||1)for(d=(d=o^o<<1^o<<2^o<<3^o<<4)>>8^255&d^99,n[a]=d,r[d]=a,f=16843009*u[h=u[c=u[a]]]^65537*h^257*c^16843008*a,p=257*u[d]^16843008*d,s=0;s<4;s++)t[s][a]=p=p<<24^p>>>8,i[s][d]=f=f<<24^f>>>8;for(s=0;s<5;s++)t[s]=t[s].slice(0),i[s]=i[s].slice(0);return e}()),this._tables=[[Vr[0][0].slice(),Vr[0][1].slice(),Vr[0][2].slice(),Vr[0][3].slice(),Vr[0][4].slice()],[Vr[1][0].slice(),Vr[1][1].slice(),Vr[1][2].slice(),Vr[1][3].slice(),Vr[1][4].slice()]];var i=void 0,n=void 0,r=void 0,s=void 0,a=void 0,o=this._tables[0][4],u=this._tables[1],l=t.length,c=1;if(4!==l&&6!==l&&8!==l)throw new Error("Invalid aes key size");for(s=t.slice(0),a=[],this._key=[s,a],i=l;i<4*l+28;i++)r=s[i-1],(i%l==0||8===l&&i%l==4)&&(r=o[r>>>24]<<24^o[r>>16&255]<<16^o[r>>8&255]<<8^o[255&r],i%l==0&&(r=r<<8^r>>>24^c<<24,c=c<<1^283*(c>>7))),s[i]=s[i-l]^r;for(n=0;i;n++,i--)r=s[3&n?i:i-4],a[n]=i<=4||n<4?r:u[0][o[r>>>24]]^u[1][o[r>>16&255]]^u[2][o[r>>8&255]]^u[3][o[255&r]]}return e.prototype.decrypt=function(e,t,i,n,r,s){var a=this._key[1],o=e^a[0],u=n^a[1],l=i^a[2],c=t^a[3],h=void 0,d=void 0,p=void 0,f=a.length/4-2,m=void 0,g=4,v=this._tables[1],y=v[0],_=v[1],b=v[2],T=v[3],S=v[4];for(m=0;m>>24]^_[u>>16&255]^b[l>>8&255]^T[255&c]^a[g],d=y[u>>>24]^_[l>>16&255]^b[c>>8&255]^T[255&o]^a[g+1],p=y[l>>>24]^_[c>>16&255]^b[o>>8&255]^T[255&u]^a[g+2],c=y[c>>>24]^_[o>>16&255]^b[u>>8&255]^T[255&l]^a[g+3],g+=4,o=h,u=d,l=p;for(m=0;m<4;m++)r[(3&-m)+s]=S[o>>>24]<<24^S[u>>16&255]<<16^S[l>>8&255]<<8^S[255&c]^a[g++],h=o,o=u,u=l,l=c,c=h},e}(),Wr=function(){function e(){Fr(this,e),this.listeners={}}return e.prototype.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},e.prototype.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e].splice(i,1),i>-1},e.prototype.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n>8|e>>>24},Xr=function(e,t,i){var n=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),r=new qr(Array.prototype.slice.call(t)),s=new Uint8Array(e.byteLength),a=new Int32Array(s.buffer),o=void 0,u=void 0,l=void 0,c=void 0,h=void 0,d=void 0,p=void 0,f=void 0,m=void 0;for(o=i[0],u=i[1],l=i[2],c=i[3],m=0;m0?o:0)}if(Ft.console){var u=Ft.console[i];u||"debug"!==i||(u=Ft.console.info||Ft.console.log),u&&s&&a.test(i)&&u[Array.isArray(r)?"apply":"call"](Ft.console,r)}}}(t,r),r.createLogger=function(i){return e(t+": "+i)},r.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:n},r.level=function(e){if("string"==typeof e){if(!r.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');n=e}return n},(r.history=function(){return $r?[].concat($r):[]}).filter=function(e){return($r||[]).filter(function(t){return new RegExp(".*"+e+".*").test(t[0])})},r.history.clear=function(){$r&&($r.length=0)},r.history.disable=function(){null!==$r&&($r.length=0,$r=null)},r.history.enable=function(){null===$r&&($r=[])},r.error=function(){for(var e=arguments.length,t=new Array(e),r=0;r0)for(var r=0,s=n.length;r=t&&(e.apply(void 0,arguments),i=n)}},ys=function(){};ys.prototype.allowedEvents_={},ys.prototype.on=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},ct(this,e,t),this.addEventListener=i},ys.prototype.addEventListener=ys.prototype.on,ys.prototype.off=function(e,t){ht(this,e,t)},ys.prototype.removeEventListener=ys.prototype.off,ys.prototype.one=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},pt(this,e,t),this.addEventListener=i},ys.prototype.any=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},ft(this,e,t),this.addEventListener=i},ys.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=lt(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),dt(this,e)},ys.prototype.dispatchEvent=ys.prototype.trigger,ys.prototype.queueTrigger=function(e){var t=this;hs||(hs=new Map);var i=e.type||e,n=hs.get(this);n||(n=new Map,hs.set(this,n));var r=n.get(i);n.delete(i),Ft.clearTimeout(r);var s=Ft.setTimeout(function(){0===n.size&&(n=null,hs.delete(t)),t.trigger(e)},0);n.set(i,s)};var _s=function(e){return e instanceof ys||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(t){return"function"==typeof e[t]})},bs=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},Ts=function(e){if(!e.nodeName&&!_s(e))throw new Error("Invalid target; must be a DOM node or evented object.")},Ss=function(e){if(!bs(e))throw new Error("Invalid event type; must be a non-empty string or array.")},ks=function(e){if("function"!=typeof e)throw new Error("Invalid listener; must be a function.")},Cs=function(e,t){var i,n,r,s=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return s?(i=e.eventBusEl_,t.length>=3&&t.shift(),n=t[0],r=t[1]):(i=t[0],n=t[1],r=t[2]),Ts(i),Ss(n),ks(r),{isTargetingSelf:s,target:i,type:n,listener:r=gs(e,r)}},ws=function(e,t,i,n){Ts(e),e.nodeName?fs[t](e,i,n):e[t](i,n)},Es={on:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n=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_),ds.has(this.el_)&&ds.delete(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_=vt(this.options_,e),this.options_):this.options_},t.el=function(){return this.el_},t.createEl=function(e,t,i){return Re(e,t,i)},t.localize=function(e,t,i){void 0===i&&(i=e);var n=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),s=r&&r[n],a=n&&n.split("-")[0],o=r&&r[a],u=i;return s&&s[e]?u=s[e]:o&&o[e]&&(u=o[e]),t&&(u=u.replace(/\{(\d+)\}/g,function(e,i){var n=t[i-1],r=n;return void 0===n&&(r=e),r})),u},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),i=0;i=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(t){e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[Is(e.name())]=null,this.childNameIndex_[As(e.name())]=null;var n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},t.initChildren=function(){var t=this,i=this.options_.children;if(i){var n,r=this.options_,s=e.getComponent("Tech");(n=Array.isArray(i)?i:Object.keys(i)).concat(Object.keys(this.options_).filter(function(e){return!n.some(function(t){return"string"==typeof t?e===t:e===t.name})})).map(function(e){var n,r;return"string"==typeof e?r=i[n=e]||t.options_[n]||{}:(n=e.name,r=e),{name:n,opts:r}}).filter(function(t){var i=e.getComponent(t.opts.componentClass||Is(t.name));return i&&!s.isTech(i)}).forEach(function(e){var i=e.name,n=e.opts;if(void 0!==r[i]&&(n=r[i]),!1!==n){!0===n&&(n={}),n.playerOptions=t.options_.playerOptions;var s=t.addChild(i,n);s&&(t[i]=s)}})}},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 ts(e,t||this.contentEl())},t.$$=function(e,t){return is(e,t||this.contentEl())},t.hasClass=function(e){return Be(this.el_,e)},t.addClass=function(e){je(this.el_,e)},t.removeClass=function(e){Fe(this.el_,e)},t.toggleClass=function(e,t){He(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 We(this.el_,e)},t.setAttribute=function(e,t){ze(this.el_,e,t)},t.removeAttribute=function(e){Ge(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,i){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(i||this.trigger("componentresize"));if(!this.el_)return 0;var n=this.el_.style[e],r=n.indexOf("px");return-1!==r?parseInt(n.slice(0,r),10):parseInt(this.el_["offset"+Is(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=Ae(this.el_,e),0===(t=parseFloat(t))||isNaN(t)){var i="offset"+Is(e);t=this.el_[i]}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,i=null;this.on("touchstart",function(n){1===n.touches.length&&(i={pageX:n.touches[0].pageX,pageY:n.touches[0].pageY},t=Ft.performance.now(),e=!0)}),this.on("touchmove",function(t){if(t.touches.length>1)e=!1;else if(i){var n=t.touches[0].pageX-i.pageX,r=t.touches[0].pageY-i.pageY;Math.sqrt(n*n+r*r)>10&&(e=!1)}});var n=function(){e=!1};this.on("touchleave",n),this.on("touchcancel",n),this.on("touchend",function(n){i=null,!0===e&&Ft.performance.now()-t<200&&(n.preventDefault(),this.trigger("tap"))})},t.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,t=gs(this.player(),this.player().reportUserActivity);this.on("touchstart",function(){t(),this.clearInterval(e),e=this.setInterval(t,250)});var i=function(i){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",i),this.on("touchcancel",i)}},t.setTimeout=function(e,t){var i,n=this;return e=gs(this,e),this.clearTimersOnDispose_(),i=Ft.setTimeout(function(){n.setTimeoutIds_.has(i)&&n.setTimeoutIds_.delete(i),e()},t),this.setTimeoutIds_.add(i),i},t.clearTimeout=function(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),Ft.clearTimeout(e)),e},t.setInterval=function(e,t){e=gs(this,e),this.clearTimersOnDispose_();var i=Ft.setInterval(e,t);return this.setIntervalIds_.add(i),i},t.clearInterval=function(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),Ft.clearInterval(e)),e},t.requestAnimationFrame=function(e){var t,i=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),e=gs(this,e),t=Ft.requestAnimationFrame(function(){i.rafIds_.has(t)&&i.rafIds_.delete(t),e()}),this.rafIds_.add(t),t):this.setTimeout(e,1e3/60)},t.cancelAnimationFrame=function(e){return this.supportsRaf_?(this.rafIds_.has(e)&&(this.rafIds_.delete(e),Ft.cancelAnimationFrame(e)),e):this.clearTimeout(e)},t.clearTimersOnDispose_=function(){var e=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(t){var i=t[0],n=t[1];e[i].forEach(e[n],e)}),e.clearingTimersOnDispose_=!1}))},e.registerComponent=function(t,i){if("string"!=typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var n,r=e.getComponent("Tech"),s=r&&r.isTech(i),a=e===i||e.prototype.isPrototypeOf(i.prototype);if(s||!a)throw n=s?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+t+'"; '+n+".");t=Is(t),e.components_||(e.components_={});var o=e.getComponent("Player");if("Player"===t&&o&&o.players){var u=o.players,l=Object.keys(u);if(u&&l.length>0&&l.map(function(e){return u[e]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=i,e.components_[As(t)]=i,i},e.getComponent=function(t){if(t&&e.components_)return e.components_[t]},e}();Ps.prototype.supportsRaf_="function"==typeof Ft.requestAnimationFrame&&"function"==typeof Ft.cancelAnimationFrame,Ps.registerComponent("Component",Ps);for(var Ls,Os,Ds=Ft.navigator&&Ft.navigator.userAgent||"",Ns=/AppleWebKit\/([\d.]+)/i.exec(Ds),Rs=Ns?parseFloat(Ns.pop()):null,Us=/iPod/i.test(Ds),Ms=(Ls=Ds.match(/OS (\d+)_/i))&&Ls[1]?Ls[1]:null,Bs=/Android/i.test(Ds),js=function(){var e=Ds.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null}(),Fs=Bs&&js<5&&Rs<537,Hs=/Firefox/i.test(Ds),Vs=/Edg/i.test(Ds),qs=!Vs&&(/Chrome/i.test(Ds)||/CriOS/i.test(Ds)),Ws=function(){var e=Ds.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),zs=function(){var e=/MSIE\s(\d+)\.\d/.exec(Ds),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(Ds)&&/rv:11.0/.test(Ds)&&(t=11),t}(),Gs=/Safari/i.test(Ds)&&!qs&&!Bs&&!Vs,Xs=/Windows/i.test(Ds),Ks=(Le()&&("ontouchstart"in Ft||Ft.navigator.maxTouchPoints||Ft.DocumentTouch&&Ft.document instanceof Ft.DocumentTouch)),Ys=/iPad/i.test(Ds)||Gs&&Ks&&!/iPhone/i.test(Ds),$s=/iPhone/i.test(Ds)&&!Ys,Qs=$s||Ys||Us,Js=(Gs||Qs)&&!qs,Zs=Object.freeze({__proto__:null,IS_IPOD:Us,IOS_VERSION:Ms,IS_ANDROID:Bs,ANDROID_VERSION:js,IS_NATIVE_ANDROID:Fs,IS_FIREFOX:Hs,IS_EDGE:Vs,IS_CHROME:qs,CHROME_VERSION:Ws,IE_VERSION:zs,IS_SAFARI:Gs,IS_WINDOWS:Xs,TOUCH_ENABLED:Ks,IS_IPAD:Ys,IS_IPHONE:$s,IS_IOS:Qs,IS_ANY_SAFARI:Js}),ea={prefixed:!0},ta=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],ia=ta[0],na=0;na=0;n--)if(t[n].enabled){da(t,t[n]);break}return(i=e.call(this,t)||this).changing_=!1,i}Gt(t,e);var i=t.prototype;return i.addTrack=function(t){var i=this;t.enabled&&da(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.enabledChange_=function(){i.changing_||(i.changing_=!0,da(i,t),i.changing_=!1,i.trigger("change"))},t.addEventListener("enabledchange",t.enabledChange_))},i.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.enabledChange_&&(t.removeEventListener("enabledchange",t.enabledChange_),t.enabledChange_=null)},t}(ca),fa=function(e,t){for(var i=0;i=0;n--)if(t[n].selected){fa(t,t[n]);break}return(i=e.call(this,t)||this).changing_=!1,Object.defineProperty(zt(i),"selectedIndex",{get:function(){for(var e=0;e',i=n.firstChild,n.setAttribute("style","display:none; position:absolute;"),qt.body.appendChild(n));for(var s={},a=0;ax',e=t.firstChild.href}return e},Ea=function(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(t)return t.pop().toLowerCase()}return""},xa=function(e,t){void 0===t&&(t=Ft.location);var i=Ca(e);return(":"===i.protocol?t.protocol:i.protocol)+i.host!==t.protocol+t.host},Aa=Object.freeze({__proto__:null,parseUrl:Ca,getAbsoluteURL:wa,getFileExtension:Ea,isCrossOrigin:xa}),Ia=function(e,t){var i=new Ft.WebVTT.Parser(Ft,Ft.vttjs,Ft.WebVTT.StringDecoder()),n=[];i.oncue=function(e){t.addCue(e)},i.onparsingerror=function(e){n.push(e)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),n.length>0&&(Ft.console&&Ft.console.groupCollapsed&&Ft.console.groupCollapsed("Text Track parsing errors for "+t.src),n.forEach(function(e){return Qr.error(e)}),Ft.console&&Ft.console.groupEnd&&Ft.console.groupEnd()),i.flush()},Pa=function(e,t){var i={uri:e},n=xa(e);n&&(i.cors=n),Jt(i,gs(this,function(e,i,n){if(e)return Qr.error(e,i);t.loaded_=!0,"function"!=typeof Ft.WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],function(e){if("vttjserror"!==e.type)return Ia(n,t);Qr.error("vttjs failed to load, stopping trying to process "+t.src)}):Ia(n,t)}))},La=function(e){function t(t){var i;if(void 0===t&&(t={}),!t.tech)throw new Error("A tech was not provided.");var n=vt(t,{kind:Ta[t.kind]||"subtitles",language:t.language||t.srclang||""}),r=Sa[n.mode]||"disabled",s=n.default;"metadata"!==n.kind&&"chapters"!==n.kind||(r="hidden"),(i=e.call(this,n)||this).tech_=n.tech,i.cues_=[],i.activeCues_=[],i.preload_=!1!==i.tech_.preloadTextTracks;var a=new ya(i.cues_),o=new ya(i.activeCues_),u=!1,l=gs(zt(i),function(){this.activeCues=this.activeCues,u&&(this.trigger("cuechange"),u=!1)});return"disabled"!==r&&i.tech_.ready(function(){i.tech_.on("timeupdate",l)},!0),Object.defineProperties(zt(i),{default:{get:function(){return s},set:function(){}},mode:{get:function(){return r},set:function(e){var t=this;Sa[e]&&(r=e,this.preload_||"disabled"===r||0!==this.cues.length||Pa(this.src,this),"disabled"!==r?this.tech_.ready(function(){t.tech_.on("timeupdate",l)},!0):this.tech_.off("timeupdate",l),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?a: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=[],i=0,n=this.cues.length;i=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 s=0;s0)return void this.trigger("vttjsloaded");var t=qt.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}),Ft.WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)},i.emulateTextTracks=function(){var e=this,t=this.textTracks(),i=this.remoteTextTracks(),n=function(e){return t.addTrack(e.track)},r=function(e){return t.removeTrack(e.track)};i.on("addtrack",n),i.on("removetrack",r),this.addWebVttScript_();var s=function(){return e.trigger("texttrackchange")},a=function(){s();for(var e=0;e',className:this.buildCSSClass(),tabIndex:0},i),"button"===t&&Qr.error("Creating a ClickableComponent with an HTML element of "+t+" is not supported; use a Button instead."),n=we({role:"button"},n),this.tabIndex_=i.tabIndex;var r=e.prototype.createEl.call(this,t,i,n);return this.createControlTextEl(r),r},i.dispose=function(){this.controlTextEl_=null,e.prototype.dispose.call(this)},i.createControlTextEl=function(e){return this.controlTextEl_=Re("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},i.controlText=function(e,t){if(void 0===t&&(t=this.el()),void 0===e)return this.controlText_||"Need Text";var i=this.localize(e);this.controlText_=e,Ue(this.controlTextEl_,i),this.nonIconControl||t.setAttribute("title",i)},i.buildCSSClass=function(){return"vjs-control vjs-button "+e.prototype.buildCSSClass.call(this)},i.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick),this.on("keydown",this.handleKeyDown))},i.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver),this.off("mouseout",this.handleMouseOut),this.off(["tap","click"],this.handleClick),this.off("keydown",this.handleKeyDown)},i.handleClick=function(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)},i.handleKeyDown=function(t){Kt.isEventKey(t,"Space")||Kt.isEventKey(t,"Enter")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},t}(Ps);Ps.registerComponent("ClickableComponent",Ya);var $a=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update(),t.on("posterchange",gs(zt(n),n.update)),n}Gt(t,e);var i=t.prototype;return i.dispose=function(){this.player().off("posterchange",this.update),e.prototype.dispose.call(this)},i.createEl=function(){return Re("div",{className:"vjs-poster",tabIndex:-1})},i.update=function(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide()},i.setSrc=function(e){var t="";e&&(t='url("'+e+'")'),this.el_.style.backgroundImage=t},i.handleClick=function(e){if(this.player_.controls()){var t=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;!this.player_.tech(!0)||(zs||Vs)&&t||this.player_.tech(!0).focus(),this.player_.paused()?Ct(this.player_.play()):this.player_.pause()}},t}(Ya);Ps.registerComponent("PosterImage",$a);var Qa={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'},Ja=function(e){function t(t,i,n){var r;r=e.call(this,t,i,n)||this;var s=gs(zt(r),r.updateDisplay);return t.on("loadstart",gs(zt(r),r.toggleDisplay)),t.on("texttrackchange",s),t.on("loadedmetadata",gs(zt(r),r.preselectTrack)),t.ready(gs(zt(r),function(){if(t.tech_&&t.tech_.featuresNativeTextTracks)this.hide();else{t.on("fullscreenchange",s),t.on("playerresize",s),Ft.addEventListener("orientationchange",s),t.on("dispose",function(){return Ft.removeEventListener("orientationchange",s)});for(var e=this.options_.playerOptions.tracks||[],i=0;i',className:this.buildCSSClass()},t),i=we({type:"button"},i);var n=Ps.prototype.createEl.call(this,"button",t,i);return this.createControlTextEl(n),n},i.addChild=function(e,t){void 0===t&&(t={});var i=this.constructor.name;return Qr.warn("Adding an actionable (user controllable) child to a Button ("+i+") is not supported; use a ClickableComponent instead."),Ps.prototype.addChild.call(this,e,t)},i.enable=function(){e.prototype.enable.call(this),this.el_.removeAttribute("disabled")},i.disable=function(){e.prototype.disable.call(this),
this.el_.setAttribute("disabled","disabled")},i.handleKeyDown=function(t){Kt.isEventKey(t,"Space")||Kt.isEventKey(t,"Enter")?t.stopPropagation():e.prototype.handleKeyDown.call(this,t)},t}(Ya);Ps.registerComponent("Button",eo);var to=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).mouseused_=!1,n.on("mousedown",n.handleMouseDown),n}Gt(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-big-play-button"},i.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY){var i=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;return Ct(t),void(!this.player_.tech(!0)||(zs||Vs)&&i||this.player_.tech(!0).focus())}var n=this.player_.getChild("controlBar"),r=n&&n.getChild("playToggle");if(r){var s=function(){return r.focus()};kt(t)?t.then(s,function(){}):this.setTimeout(s,1)}else this.player_.tech(!0).focus()},i.handleKeyDown=function(t){this.mouseused_=!1,e.prototype.handleKeyDown.call(this,t)},i.handleMouseDown=function(e){this.mouseused_=!0},t}(eo);to.prototype.controlText_="Play Video",Ps.registerComponent("BigPlayButton",to);var io=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).controlText(i&&i.controlText||n.localize("Close")),n}Gt(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},i.handleKeyDown=function(t){Kt.isEventKey(t,"Esc")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},t}(eo);Ps.registerComponent("CloseButton",io);var no=function(e){function t(t,i){var n;return void 0===i&&(i={}),n=e.call(this,t,i)||this,i.replay=void 0===i.replay||i.replay,n.on(t,"play",n.handlePlay),n.on(t,"pause",n.handlePause),i.replay&&n.on(t,"ended",n.handleEnded),n}Gt(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},i.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},i.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},i.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},i.handleEnded=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",this.handleSeeked)},t}(eo);no.prototype.controlText_="Play",Ps.registerComponent("PlayToggle",no);var ro=function(e,t){e=e<0?0:e;var i=Math.floor(e%60),n=Math.floor(e/60%60),r=Math.floor(e/3600),s=Math.floor(t/60%60),a=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=n=i="-"),(r=r>0||a>0?r+":":"")+(n=((r||s>=10)&&n<10?"0"+n:n)+":")+(i=i<10?"0"+i:i)},so=ro,ao=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,["timeupdate","ended"],n.updateContent),n.updateTextNode_(),n}Gt(t,e);var i=t.prototype;return i.createEl=function(){var t=this.buildCSSClass(),i=e.prototype.createEl.call(this,"div",{className:t+" vjs-time-control vjs-control",innerHTML:''+this.localize(this.labelText_)+" "});return this.contentEl_=Re("span",{className:t+"-display"},{"aria-live":"off",role:"presentation"}),i.appendChild(this.contentEl_),i},i.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},i.updateTextNode_=function(e){var t=this;void 0===e&&(e=0),e=Ot(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestAnimationFrame(function(){if(t.contentEl_){var e=t.textNode_;t.textNode_=qt.createTextNode(t.formattedTime_),t.textNode_&&(e?t.contentEl_.replaceChild(t.textNode_,e):t.contentEl_.appendChild(t.textNode_))}}))},i.updateContent=function(e){},t}(Ps);ao.prototype.labelText_="Time",ao.prototype.controlText_="Time",Ps.registerComponent("TimeDisplay",ao);var oo=function(e){function t(){return e.apply(this,arguments)||this}Gt(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-current-time"},i.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}(ao);oo.prototype.labelText_="Current Time",oo.prototype.controlText_="Current Time",Ps.registerComponent("CurrentTimeDisplay",oo);var uo=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"durationchange",n.updateContent),n.on(t,"loadstart",n.updateContent),n.on(t,"loadedmetadata",n.updateContent),n}Gt(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-duration"},i.updateContent=function(e){var t=this.player_.duration();this.updateTextNode_(t)},t}(ao);uo.prototype.labelText_="Duration",uo.prototype.controlText_="Duration",Ps.registerComponent("DurationDisplay",uo);var lo=function(e){function t(){return e.apply(this,arguments)||this}return Gt(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"/
"},{"aria-hidden":!0})},t}(Ps);Ps.registerComponent("TimeDivider",lo);var co=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"durationchange",n.updateContent),n}Gt(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-remaining-time"},i.createEl=function(){var t=e.prototype.createEl.call(this);return t.insertBefore(Re("span",{},{"aria-hidden":!0},"-"),this.contentEl_),t},i.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}(ao);co.prototype.labelText_="Remaining Time",co.prototype.controlText_="Remaining Time",Ps.registerComponent("RemainingTimeDisplay",co);var ho=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).updateShowing(),n.on(n.player(),"durationchange",n.updateShowing),n}Gt(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=Re("div",{className:"vjs-live-display",innerHTML:''+this.localize("Stream Type")+" "+this.localize("LIVE")},{"aria-live":"off"}),t.appendChild(this.contentEl_),t},i.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},i.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(Ps);Ps.registerComponent("LiveDisplay",ho);var po=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).updateLiveEdgeStatus(),n.player_.liveTracker&&n.on(n.player_.liveTracker,"liveedgechange",n.updateLiveEdgeStatus),n}Gt(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=Re("span",{className:"vjs-seek-to-live-text",innerHTML:this.localize("LIVE")},{"aria-hidden":"true"}),t.appendChild(this.textEl_),t},i.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"))},i.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},i.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatus),this.textEl_=null,e.prototype.dispose.call(this)},t}(eo);po.prototype.controlText_="Seek to live, currently playing live",Ps.registerComponent("SeekToLive",po);var fo=function(e,t,i){return e=Number(e),Math.min(i,Math.max(t,isNaN(e)?t:e))},mo=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).bar=n.getChild(n.options_.barName),n.vertical(!!n.options_.vertical),n.enable(),n}Gt(t,e);var i=t.prototype;return i.enabled=function(){return this.enabled_},i.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)},i.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}},i.createEl=function(t,i,n){return void 0===i&&(i={}),void 0===n&&(n={}),i.className=i.className+" vjs-slider",i=we({tabIndex:0},i),n=we({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},n),e.prototype.createEl.call(this,t,i,n)},i.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||qs||e.preventDefault(),Xe(),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)},i.handleMouseMove=function(e){},i.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;Ke(),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()},i.update=function(){var e=this;if(this.el_&&this.bar){var t=this.getProgress();return t===this.progress_||(this.progress_=t,this.requestAnimationFrame(function(){var i=e.vertical()?"height":"width";e.bar.el().style[i]=(100*t).toFixed(2)+"%"})),t}},i.getProgress=function(){return Number(fo(this.getPercent(),0,1).toFixed(4))},i.calculateDistance=function(e){var t=Qe(this.el_,e);return this.vertical()?t.y:t.x},i.handleKeyDown=function(t){Kt.isEventKey(t,"Left")||Kt.isEventKey(t,"Down")?(t.preventDefault(),t.stopPropagation(),this.stepBack()):Kt.isEventKey(t,"Right")||Kt.isEventKey(t,"Up")?(t.preventDefault(),t.stopPropagation(),this.stepForward()):e.prototype.handleKeyDown.call(this,t)},i.handleClick=function(e){e.stopPropagation(),e.preventDefault()},i.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}(Ps);Ps.registerComponent("Slider",mo);var go=function(e,t){return fo(e/t*100,0,100).toFixed(2)+"%"},vo=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).partEls_=[],n.on(t,"progress",n.update),n}Gt(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),i=Re("span",{className:"vjs-control-text"}),n=Re("span",{textContent:this.localize("Loaded")}),r=qt.createTextNode(": ");return this.percentageEl_=Re("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),t.appendChild(i),i.appendChild(n),i.appendChild(r),i.appendChild(this.percentageEl_),t},i.dispose=function(){this.partEls_=null,this.percentageEl_=null,e.prototype.dispose.call(this)},i.update=function(e){var t=this;this.requestAnimationFrame(function(){var e=t.player_.liveTracker,i=t.player_.buffered(),n=e&&e.isLive()?e.seekableEnd():t.player_.duration(),r=t.player_.bufferedEnd(),s=t.partEls_,a=go(r,n);t.percent_!==a&&(t.el_.style.width=a,Ue(t.percentageEl_,a),t.percent_=a);for(var o=0;oi.length;h--)t.el_.removeChild(s[h-1]);s.length=i.length})},t}(Ps);Ps.registerComponent("LoadProgressBar",vo);var yo=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=vs(gs(zt(n),n.update),ms),n}Gt(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},i.update=function(e,t,i){var n=Ye(this.el_),r=Ye(this.player_.el()),s=e.width*t;if(r&&n){var a=e.left-r.left+s,o=e.width-s+(r.right-e.right),u=n.width/2;an.width&&(u=n.width),this.el_.style.right="-"+u+"px",this.write(i)}},i.write=function(e){Ue(this.el_,e)},i.updateTime=function(e,t,i,n){var r=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var s,a=r.player_.duration();if(r.player_.liveTracker&&r.player_.liveTracker.isLive()){var o=r.player_.liveTracker.liveWindow(),u=o-t*o;s=(u<1?"":"-")+Ot(u,o)}else s=Ot(i,a);r.update(e,t,s),n&&n()})},t}(Ps);Ps.registerComponent("TimeTooltip",yo);var _o=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=vs(gs(zt(n),n.update),ms),n}Gt(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},i.update=function(e,t){var i=this.getChild("timeTooltip");if(i){var n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,n)}},t}(Ps);_o.prototype.options_={children:[]},Qs||Bs||_o.prototype.options_.children.push("timeTooltip"),Ps.registerComponent("PlayProgressBar",_o);var bo=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=vs(gs(zt(n),n.update),ms),n}Gt(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},i.update=function(e,t){var i=this,n=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,n,function(){i.el_.style.left=e.width*t+"px"})},t}(Ps);bo.prototype.options_={children:["timeTooltip"]},Ps.registerComponent("MouseTimeDisplay",bo);var To=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).setEventHandlers_(),n}Gt(t,e);var i=t.prototype;return i.setEventHandlers_=function(){this.update_=gs(this,this.update),this.update=vs(this.update_,ms),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.on(this.player_,["playing"],this.enableInterval_),this.on(this.player_,["ended","pause","waiting"],this.disableInterval_),"hidden"in qt&&"visibilityState"in qt&&this.on(qt,"visibilitychange",this.toggleVisibility_)},i.toggleVisibility_=function(e){qt.hidden?this.disableInterval_(e):(this.enableInterval_(),this.update())},i.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,ms))},i.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},i.update=function(t){var i=this,n=e.prototype.update.call(this);return this.requestAnimationFrame(function(){var e=i.player_.ended()?i.player_.duration():i.getCurrentTime_(),t=i.player_.liveTracker,r=i.player_.duration();t&&t.isLive()&&(r=i.player_.liveTracker.liveCurrentTime()),i.percent_!==n&&(i.el_.setAttribute("aria-valuenow",(100*n).toFixed(2)),i.percent_=n),i.currentTime_===e&&i.duration_===r||(i.el_.setAttribute("aria-valuetext",i.localize("progress bar timing: currentTime={1} duration={2}",[Ot(e,r),Ot(r,r)],"{1} of {2}")),i.currentTime_=e,i.duration_=r),i.bar&&i.bar.update(Ye(i.el()),i.getProgress())}),n},i.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},i.getPercent=function(){var e,t=this.getCurrentTime_(),i=this.player_.liveTracker;return i&&i.isLive()?(e=(t-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e},i.handleMouseDown=function(t){nt(t)&&(t.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},i.handleMouseMove=function(e){if(nt(e)){var t,i=this.calculateDistance(e),n=this.player_.liveTracker;if(n&&n.isLive()){if(i>=.99)return void n.seekToLiveEdge();var r=n.seekableStart(),s=n.liveCurrentTime();if((t=r+i*n.liveWindow())>=s&&(t=s),t<=r&&(t=r+.1),t===1/0)return}else(t=i*this.player_.duration())===this.player_.duration()&&(t-=.1);this.player_.currentTime(t)}},i.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},i.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},i.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?Ct(this.player_.play()):this.update_()},i.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+5)},i.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-5)},i.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},i.handleKeyDown=function(t){if(Kt.isEventKey(t,"Space")||Kt.isEventKey(t,"Enter"))t.preventDefault(),t.stopPropagation(),this.handleAction(t);else if(Kt.isEventKey(t,"Home"))t.preventDefault(),t.stopPropagation(),this.player_.currentTime(0);else if(Kt.isEventKey(t,"End"))t.preventDefault(),t.stopPropagation(),this.player_.currentTime(this.player_.duration());else if(/^[0-9]$/.test(Kt(t))){t.preventDefault(),t.stopPropagation();var i=10*(Kt.codes[Kt(t)]-Kt.codes[0])/100;this.player_.currentTime(this.player_.duration()*i)}else Kt.isEventKey(t,"PgDn")?(t.preventDefault(),t.stopPropagation(),this.player_.currentTime(this.player_.currentTime()-60)):Kt.isEventKey(t,"PgUp")?(t.preventDefault(),t.stopPropagation(),this.player_.currentTime(this.player_.currentTime()+60)):e.prototype.handleKeyDown.call(this,t)},i.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableInterval_),this.off(this.player_,["ended","pause","waiting"],this.disableInterval_),"hidden"in qt&&"visibilityState"in qt&&this.off(qt,"visibilitychange",this.toggleVisibility_),e.prototype.dispose.call(this)},t}(mo);To.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},Qs||Bs||To.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),Ps.registerComponent("SeekBar",To);var So=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).handleMouseMove=vs(gs(zt(n),n.handleMouseMove),ms),n.throttledHandleMouseSeek=vs(gs(zt(n),n.handleMouseSeek),ms),n.enable(),n}Gt(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},i.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var i=t.getChild("playProgressBar"),n=t.getChild("mouseTimeDisplay");if(i||n){var r=t.el(),s=Ye(r),a=Qe(r,e).x;a=fo(0,1,a),n&&n.update(s,a),i&&i.update(s,t.getProgress())}}},i.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},i.enabled=function(){return this.enabled_},i.disable=function(){this.children().forEach(function(e){return e.disable&&e.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDown),this.off(this.el_,"mousemove",this.handleMouseMove),this.handleMouseUp(),this.addClass("disabled"),this.enabled_=!1)},i.enable=function(){this.children().forEach(function(e){return e.enable&&e.enable()}),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDown),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},i.handleMouseDown=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},i.handleMouseUp=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseUp(e),this.off(t,"mousemove",this.throttledHandleMouseSeek),this.off(t,"touchmove",this.throttledHandleMouseSeek),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},t}(Ps);So.prototype.options_={children:["seekBar"]},Ps.registerComponent("ProgressControl",So);var ko=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,["enterpictureinpicture","leavepictureinpicture"],n.handlePictureInPictureChange),qt.pictureInPictureEnabled||n.disable(),n}Gt(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-picture-in-picture-control "+e.prototype.buildCSSClass.call(this)},i.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture")},i.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},t}(eo);ko.prototype.controlText_="Picture-in-Picture",Ps.registerComponent("PictureInPictureToggle",ko);var Co=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"fullscreenchange",n.handleFullscreenChange),!1===qt[t.fsApi_.fullscreenEnabled]&&n.disable(),n}Gt(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},i.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},i.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(eo);Co.prototype.controlText_="Fullscreen",Ps.registerComponent("FullscreenToggle",Co);var wo=function(e){function t(){return e.apply(this,arguments)||this}return Gt(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:''})},t}(Ps);Ps.registerComponent("VolumeLevel",wo);var Eo=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on("slideractive",n.updateLastVolume_),n.on(t,"volumechange",n.updateARIAAttributes),t.ready(function(){return n.updateARIAAttributes()}),n}Gt(t,e);var i=t.prototype;return i.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"})},i.handleMouseDown=function(t){nt(t)&&e.prototype.handleMouseDown.call(this,t)},i.handleMouseMove=function(e){nt(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},i.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},i.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},i.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},i.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},i.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},i.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},i.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",function(){0===e.player_.volume()&&e.player_.lastVolume_(t)})},t}(mo);Eo.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},Eo.prototype.playerEvent="volumechange",Ps.registerComponent("VolumeBar",Eo);var xo=function(e){function t(t,i){var n;return void 0===i&&(i={}),i.vertical=i.vertical||!1,(void 0===i.volumeBar||xe(i.volumeBar))&&(i.volumeBar=i.volumeBar||{},i.volumeBar.vertical=i.vertical),n=e.call(this,t,i)||this,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")})}(zt(n),t),n.throttledHandleMouseMove=vs(gs(zt(n),n.handleMouseMove),ms),n.on("mousedown",n.handleMouseDown),n.on("touchstart",n.handleMouseDown),n.on(n.volumeBar,["focus","slideractive"],function(){n.volumeBar.addClass("vjs-slider-active"),n.addClass("vjs-slider-active"),n.trigger("slideractive")}),n.on(n.volumeBar,["blur","sliderinactive"],function(){n.volumeBar.removeClass("vjs-slider-active"),n.removeClass("vjs-slider-active"),n.trigger("sliderinactive")}),n}Gt(t,e);var i=t.prototype;return i.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})},i.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.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},i.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.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},i.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(Ps);xo.prototype.options_={children:["volumeBar"]},Ps.registerComponent("VolumeControl",xo);var Ao=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,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")})}(zt(n),t),n.on(t,["loadstart","volumechange"],n.update),n}Gt(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){var t=this.player_.volume(),i=this.player_.lastVolume_();if(0===t){var n=i<.1?.1:i;this.player_.volume(n),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},i.update=function(e){this.updateIcon_(),this.updateControlText_()},i.updateIcon_=function(){var e=this.player_.volume(),t=3;Qs&&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 i=0;i<4;i++)Fe(this.el_,"vjs-vol-"+i);je(this.el_,"vjs-vol-"+t)},i.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},t}(eo);Ao.prototype.controlText_="Mute",Ps.registerComponent("MuteToggle",Ao);var Io=function(e){function t(t,i){var n;return void 0===i&&(i={}),void 0!==i.inline?i.inline=i.inline:i.inline=!0,(void 0===i.volumeControl||xe(i.volumeControl))&&(i.volumeControl=i.volumeControl||{},i.volumeControl.vertical=!i.inline),(n=e.call(this,t,i)||this).on(t,["loadstart"],n.volumePanelState_),n.on(n.muteToggle,"keyup",n.handleKeyPress),n.on(n.volumeControl,"keyup",n.handleVolumeControlKeyUp),n.on("keydown",n.handleKeyPress),n.on("mouseover",n.handleMouseOver),n.on("mouseout",n.handleMouseOut),n.on(n.volumeControl,["slideractive"],n.sliderActive_),n.on(n.volumeControl,["sliderinactive"],n.sliderInactive_),n}Gt(t,e);var i=t.prototype;return i.sliderActive_=function(){this.addClass("vjs-slider-active")},i.sliderInactive_=function(){this.removeClass("vjs-slider-active")},i.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")},i.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})},i.dispose=function(){this.handleMouseOut(),e.prototype.dispose.call(this)},i.handleVolumeControlKeyUp=function(e){Kt.isEventKey(e,"Esc")&&this.muteToggle.focus()},i.handleMouseOver=function(e){this.addClass("vjs-hover"),ct(qt,"keyup",gs(this,this.handleKeyPress))},i.handleMouseOut=function(e){this.removeClass("vjs-hover"),ht(qt,"keyup",gs(this,this.handleKeyPress))},i.handleKeyPress=function(e){Kt.isEventKey(e,"Esc")&&this.handleMouseOut()},t}(Ps);Io.prototype.options_={children:["muteToggle","volumeControl"]},Ps.registerComponent("VolumePanel",Io);var Po=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,i&&(n.menuButton_=i.menuButton),n.focusedChild_=-1,n.on("keydown",n.handleKeyDown),n.boundHandleBlur_=gs(zt(n),n.handleBlur),n.boundHandleTapClick_=gs(zt(n),n.handleTapClick),n}Gt(t,e);var i=t.prototype;return i.addEventListenerForItem=function(e){e instanceof Ps&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},i.removeEventListenerForItem=function(e){e instanceof Ps&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},i.removeChild=function(t){"string"==typeof t&&(t=this.getChild(t)),this.removeEventListenerForItem(t),e.prototype.removeChild.call(this,t)},i.addItem=function(e){var t=this.addChild(e);t&&this.addEventListenerForItem(t)},i.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=Re(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var i=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),ct(i,"click",function(e){e.preventDefault(),e.stopImmediatePropagation()}),i},i.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,e.prototype.dispose.call(this)},i.handleBlur=function(e){var t=e.relatedTarget||qt.activeElement;if(!this.children().some(function(e){return e.el()===t})){var i=this.menuButton_;i&&i.buttonPressed_&&t!==i.el().firstChild&&i.unpressButton()}},i.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var t=this.children();if(!Array.isArray(t))return;var i=t.filter(function(t){return t.el()===e.target})[0];if(!i)return;"CaptionSettingsMenuItem"!==i.name()&&this.menuButton_.focus()}},i.handleKeyDown=function(e){Kt.isEventKey(e,"Left")||Kt.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(Kt.isEventKey(e,"Right")||Kt.isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},i.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},i.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},i.focus=function(e){void 0===e&&(e=0);var t=this.children().slice();t.length&&t[0].className&&/vjs-menu-title/.test(t[0].className)&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,
t[e].el_.focus())},t}(Ps);Ps.registerComponent("Menu",Po);var Lo=function(e){function t(t,i){var n;void 0===i&&(i={}),(n=e.call(this,t,i)||this).menuButton_=new eo(t,i),n.menuButton_.controlText(n.controlText_),n.menuButton_.el_.setAttribute("aria-haspopup","true");var r=eo.prototype.buildCSSClass();return n.menuButton_.el_.className=n.buildCSSClass()+" "+r,n.menuButton_.removeClass("vjs-control"),n.addChild(n.menuButton_),n.update(),n.enabled_=!0,n.on(n.menuButton_,"tap",n.handleClick),n.on(n.menuButton_,"click",n.handleClick),n.on(n.menuButton_,"keydown",n.handleKeyDown),n.on(n.menuButton_,"mouseenter",function(){n.addClass("vjs-hover"),n.menu.show(),ct(qt,"keyup",gs(zt(n),n.handleMenuKeyUp))}),n.on("mouseleave",n.handleMouseLeave),n.on("keydown",n.handleSubmenuKeyDown),n}Gt(t,e);var i=t.prototype;return i.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()},i.createMenu=function(){var e=new Po(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=Re("li",{className:"vjs-menu-title",innerHTML:Is(this.options_.title),tabIndex:-1});this.hideThreshold_+=1;var i=new Ps(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(var n=0;n