21 lines
574 KiB
JavaScript
21 lines
574 KiB
JavaScript
|
var app=function(){"use strict";function e(){}function t(e){return e()}function i(){return Object.create(null)}function n(e){e.forEach(t)}function r(e){return"function"==typeof e}function a(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function s(t,i,n){t.$$.on_destroy.push(function(t,...i){if(null==t)return e;const n=t.subscribe(...i);return n.unsubscribe?()=>n.unsubscribe():n}(i,n))}function o(e,t){e.appendChild(t)}function u(e,t,i){e.insertBefore(t,i||null)}function l(e){e.parentNode.removeChild(e)}function c(e){return document.createElement(e)}function d(e){return document.createTextNode(e)}function h(){return d(" ")}function p(e,t,i,n){return e.addEventListener(t,i,n),()=>e.removeEventListener(t,i,n)}function f(e,t,i){null==i?e.removeAttribute(t):e.getAttribute(t)!==i&&e.setAttribute(t,i)}function m(e){return Array.from(e.childNodes)}function g(e,t,i,n){for(let n=0;n<e.length;n+=1){const r=e[n];if(r.nodeName===t){let t=0;for(;t<r.attributes.length;){const e=r.attributes[t];i[e.name]?t++:r.removeAttribute(e.name)}return e.splice(n,1)[0]}}return n?function(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}(t):c(t)}function v(e,t){for(let i=0;i<e.length;i+=1){const n=e[i];if(3===n.nodeType)return n.data=""+t,e.splice(i,1)[0]}return d(t)}function y(e){return v(e," ")}function _(e,t){t=""+t,e.data!==t&&(e.data=t)}let b;function T(e){b=e}function S(e){(function(){if(!b)throw new Error("Function called outside component initialization");return b})().$$.on_mount.push(e)}const E=[],k=[],C=[],w=[],x=Promise.resolve();let I=!1;function A(e){C.push(e)}let P=!1;const L=new Set;function D(){if(!P){P=!0;do{for(let e=0;e<E.length;e+=1){const t=E[e];T(t),O(t.$$)}for(E.length=0;k.length;)k.pop()();for(let e=0;e<C.length;e+=1){const t=C[e];L.has(t)||(L.add(t),t())}C.length=0}while(E.length);for(;w.length;)w.pop()();I=!1,P=!1,L.clear()}}function O(e){if(null!==e.fragment){e.update(),n(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(A)}}const R=new Set;function M(e,t){e&&e.i&&(R.delete(e),e.i(t))}function N(e,t,i,n){if(e&&e.o){if(R.has(e))return;R.add(e),(void 0).c.push(()=>{R.delete(e),n&&(i&&e.d(1),n())}),e.o(t)}}function U(e){e&&e.c()}function B(e,t){e&&e.l(t)}function F(e,i,a){const{fragment:s,on_mount:o,on_destroy:u,after_update:l}=e.$$;s&&s.m(i,a),A(()=>{const i=o.map(t).filter(r);u?u.push(...i):n(i),e.$$.on_mount=[]}),l.forEach(A)}function j(e,t){const i=e.$$;null!==i.fragment&&(n(i.on_destroy),i.fragment&&i.fragment.d(t),i.on_destroy=i.fragment=null,i.ctx=[])}function H(e,t){-1===e.$$.dirty[0]&&(E.push(e),I||(I=!0,x.then(D)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function V(t,r,a,s,o,u,c=[-1]){const d=b;T(t);const h=r.props||{},p=t.$$={fragment:null,ctx:null,props:u,update:e,not_equal:o,bound:i(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(d?d.$$.context:[]),callbacks:i(),dirty:c};let f=!1;if(p.ctx=a?a(t,h,(e,i,...n)=>{const r=n.length?n[0]:i;return p.ctx&&o(p.ctx[e],p.ctx[e]=r)&&(p.bound[e]&&p.bound[e](r),f&&H(t,e)),i}):[],p.update(),f=!0,n(p.before_update),p.fragment=!!s&&s(p.ctx),r.target){if(r.hydrate){const e=m(r.target);p.fragment&&p.fragment.l(e),e.forEach(l)}else p.fragment&&p.fragment.c();r.intro&&M(t.$$.fragment),F(t,r.target,r.anchor),D()}T(d)}class q{$destroy(){j(this,1),this.$destroy=e}$on(e,t){const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const e=i.indexOf(t);-1!==e&&i.splice(e,1)}}$set(){}}const W=[];const z=function(t,i=e){let n;const r=[];function s(e){if(a(t,e)&&(t=e,n)){const e=!W.length;for(let e=0;e<r.length;e+=1){const i=r[e];i[1](),W.push(i,t)}if(e){for(let e=0;e<W.length;e+=2)W[e][0](W[e+1]);W.length=0}}}return{set:s,update:function(e){s(e(t))},subscribe:function(a,o=e){const u=[a,o];return r.push(u),1===r.length&&(n=i(s)||e),a(t),()=>{const e=r.indexOf(u);-1!==e&&r.splice(e,1),0===r.length&&(n(),n=null)}}}}(""),G={setPlaying(e){console.log(">> setPlaying",e),z.update(t=>t===e?"":e)}};function X(t){let i,n,r,a,s,b,T,S,E,k,C,w,x;return{c
|
||
|
/*!
|
||
|
* Programatically add the following
|
||
|
*/
|
||
|
for(a=97;a<123;a++)n[String.fromCharCode(a)]=a-32;for(var a=48;a<58;a++)n[a-48]=a;for(a=1;a<13;a++)n["f"+a]=a+111;for(a=0;a<10;a++)n["numpad "+a]=a+96;var s=t.names=t.title={};for(a in n)s[n[a]]=a;for(var o in r)n[o]=r[o]})),he=(de.code,de.codes,de.aliases,de.names,de.title,function(e){if(!e)return!1;var t=pe.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}),pe=Object.prototype.toString;var fe=function(e,t){return void 0===t&&(t=!1),function(i,n,r){if(i)e(i);else if(n.statusCode>=400&&n.statusCode<=599){var a=r;if(t)if(te.TextDecoder){var s=function(e){void 0===e&&(e="");return e.toLowerCase().split(";").reduce((function(e,t){var i=t.split("="),n=i[0],r=i[1];return"charset"===n.trim()?r.trim():e}),"utf-8")}(n.headers&&n.headers["content-type"]);try{a=new TextDecoder(s).decode(r)}catch(e){}}else a=String.fromCharCode.apply(null,new Uint8Array(r));e({cause:a})}else e(null,r)}};ye.httpHandler=fe;
|
||
|
/**
|
||
|
* @license
|
||
|
* slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
|
||
|
* Copyright (c) 2014 David Björklund
|
||
|
* Available under the MIT license
|
||
|
* <https://github.com/kesla/parse-headers/blob/master/LICENCE>
|
||
|
*/
|
||
|
var me=ye,ge=ye;function ve(e,t,i){var n=e;return he(t)?(i=t,"string"==typeof e&&(n={uri:e})):n=ae({},t,{uri:e}),n.callback=i,n}function ye(e,t,i){return _e(t=ve(e,t,i))}function _e(e){if(void 0===e.callback)throw new Error("callback argument missing");var t=!1,i=function(i,n,r){t||(t=!0,e.callback(i,n,r))};function n(){var e=void 0;if(e=u.response?u.response:u.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}(u),m)try{e=JSON.parse(e)}catch(e){}return e}function r(e){return clearTimeout(l),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,i(e,g)}function a(){if(!o){var t;clearTimeout(l),t=e.useXDR&&void 0===u.status?200:1223===u.status?204:u.status;var r=g,a=null;return 0!==t?(r={body:n(),statusCode:t,method:d,headers:{},url:c,rawRequest:u},u.getAllResponseHeaders&&(r.headers=function(e){var t={};return e?(e.trim().split("\n").forEach((function(e){var i=e.indexOf(":"),n=e.slice(0,i).trim().toLowerCase(),r=e.slice(i+1).trim();void 0===t[n]?t[n]=r:Array.isArray(t[n])?t[n].push(r):t[n]=[t[n],r]})),t):t}(u.getAllResponseHeaders()))):a=new Error("Internal XMLHttpRequest Error"),i(a,r,r.body)}}var s,o,u=e.xhr||null;u||(u=e.cors||e.useXDR?new ye.XDomainRequest:new ye.XMLHttpRequest);var l,c=u.url=e.uri||e.url,d=u.method=e.method||"GET",h=e.body||e.data,p=u.headers=e.headers||{},f=!!e.sync,m=!1,g={body:void 0,headers:{},statusCode:0,method:d,url:c,rawRequest:u};if("json"in e&&!1!==e.json&&(m=!0,p.accept||p.Accept||(p.Accept="application/json"),"GET"!==d&&"HEAD"!==d&&(p["content-type"]||p["Content-Type"]||(p["Content-Type"]="application/json"),h=JSON.stringify(!0===e.json?h:e.json))),u.onreadystatechange=function(){4===u.readyState&&setTimeout(a,0)},u.onload=a,u.onerror=r,u.onprogress=function(){},u.onabort=function(){o=!0},u.ontimeout=r,u.open(d,c,!f,e.username,e.password),f||(u.withCredentials=!!e.withCredentials),!f&&e.timeout>0&&(l=setTimeout((function(){if(!o){o=!0,u.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",r(e)}}),e.timeout)),u.setRequestHeader)for(s in p)p.hasOwnProperty(s)&&u.setRequestHeader(s,p[s]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(u.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(u),u.send(h||null),u}ye.XMLHttpRequest=te.XMLHttpRequest||function(){},ye.XDomainRequest="withCredentials"in new ye.XMLHttpRequest?ye.XMLHttpRequest:te.XDomainRequest,function(e,t){for(var i=0;i<e.length;i++)t(e[i])}(["get","put","post","patch","head","delete"],(function(e){ye["delete"===e?"del":e]=function(t,i,n){return(i=ve(t,i,n)).method=e.toUpperCase(),_e(i)}})),me.default=ge;var be=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function Te(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function Se(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/1e3}var i=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function Ee(){this.values=be(null)}function ke(e,t,i,n){var r=n?e.split(n):[e];for(var a in r)if("string"==typeof r[a]){var s=r[a].split(i);if(2===s.length)t(s[0],s[1])}}function Ce(e,t,i){var n=e;function r(){var t=Se(e);if(null===t)throw new Te(Te.Errors.BadTimeStamp,"Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function a(){e=e.replace(/^\s+/,"")}if(a(),t.startTime=r(),a(),"--\x3e"!==e.substr(0,3))throw new Te(Te.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),a(),t.endTime=r(),a(),function(e,t){var n=new Ee;ke(e,(function(e,t){swi
|
||
|
/*! @name m3u8-parser @version 4.7.0 @license Apache-2.0 */var nt=function(e){function t(){var t;return(t=e.call(this)||this).buffer="",t}return le(t,e),t.prototype.push=function(e){var t;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(tt),rt=String.fromCharCode(9),at=function(e){var t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),i={};return t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),i},st=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},ot=function(e){function t(){var t;return(t=e.call(this)||this).customParsers=[],t.tagMappers=[],t}le(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;r<n.customParsers.length;r++)if(n.customParsers[r].call(n,e))return;if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e))n.trigger("data",{type:"tag",tagType:"m3u"});else{if(t=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e))return i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),void n.trigger("data",i);if(t=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e))return i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),void n.trigger("data",i);if(t=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(e))return i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),void n.trigger("data",i);if(t=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void n.trigger("data",i);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void n.trigger("data",i);if(t=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e))return i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),void n.trigger("data",i);if(t=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(e))return i=se(at(t[1]),{type:"tag",tagType:"byterange"}),void n.trigger("data",i);if(t=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e))return i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),void n.trigger("data",i);if(t=/^#EXT-X-MAP:?(.*)$/.exec(e)){if(i={type:"tag",tagType:"map"},t[1]){var a=st(t[1]);a.URI&&(i.uri=a.URI),a.BYTERANGE&&(i.byterange=at(a.BYTERANGE))}n.trigger("data",i)}else if(t=/^#EXT-X-STREAM-INF:?(.*)$/.exec(e)){if(i={type:"tag",tagType:"stream-inf"},t[1]){if(i.attributes=st(t[1]),i.attributes.RESOLUTION){var s=i.attributes.RESOLUTION.split("x"),o={};s[0]&&(o.width=parseInt(s[0],10)),s[1]&&(o.height=parseInt(s[1],10)),i.attributes.RESOLUTION=o}i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))}n.trigger("data",i)}else{if(t=/^#EXT-X-MEDIA:?(.*)$/.exec(e))return i={type:"tag",tagType:"media"},t[1]&&(i.attributes=st(t[1])),void n.trigger("data",i);if(t=/^#EXT-X-ENDLIST/.exec(e))n.trigger("data",{type:"tag",tagType:"endlist"});else if(t=/^#EXT-X-DISCONTINUITY/.exec(e))n.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(t=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e))return i={type:"tag",tagType:"program-date-time"},t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),void n.trigger("data",i);if(t=/^#EXT-X-KEY:?(.*)$/.exec(e))return i={type:"tag",tagType:"key"},t[1]&&(i.attributes=st(t[1]),i.attributes.IV&&("0x"===i.attributes.IV.substring(0,2).toLowerCase()&&(i.attributes.IV=i.attributes.IV.substring(2)),i.attributes.IV=i.attributes.IV.match(/.{8}/g),i.attributes.IV[0]=parseInt(i.attributes.IV[0],16),i.attributes.IV[1]=parseInt(i.attributes.IV[1],16),i.attributes.IV[2]=pa
|
||
|
/*! @name @videojs/http-streaming @version 2.12.0 @license Apache-2.0 */
|
||
|
var Wl=et,zl=function(e,t,i){return e&&i&&i.responseURL&&t!==i.responseURL?i.responseURL:t},Gl=function(e){return Hl.log.debug?Hl.log.debug.bind(Hl,"VHS:",e+" >"):function(){}},Xl=function(e,t){var i,n=[];if(e&&e.length)for(i=0;i<e.length;i++)t(e.start(i),e.end(i))&&n.push([e.start(i),e.end(i)]);return Hl.createTimeRanges(n)},$l=function(e,t){return Xl(e,(function(e,i){return e-.1<=t&&i+.1>=t}))},Kl=function(e,t){return Xl(e,(function(e){return e-1/30>=t}))},Yl=function(e){var t=[];if(!e||!e.length)return"";for(var i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")},Ql=function(e){for(var t=[],i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t},Jl=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},Zl=function(e,t){var i=0;if(!e||!e.length)return i;for(var n=0;n<e.length;n++){var r=e.start(n),a=e.end(n);t>a||(i+=t>r&&t<=a?a-t:a-r)}return i},ec=Hl.createTimeRange,tc=function(e,t){if(!t.preload)return t.duration;var i=0;return(t.parts||[]).forEach((function(e){i+=e.duration})),(t.preloadHints||[]).forEach((function(t){"PART"===t.type&&(i+=e.partTargetDuration)})),i},ic=function(e){return(e.segments||[]).reduce((function(e,t,i){return t.parts?t.parts.forEach((function(n,r){e.push({duration:n.duration,segmentIndex:i,partIndex:r,part:n,segment:t})})):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e}),[])},nc=function(e){var t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},rc=function(e){var t=e.preloadSegment;if(t){var i=t.parts,n=(t.preloadHints||[]).reduce((function(e,t){return e+("PART"===t.type?1:0)}),0);return n+=i&&i.length?i.length:0}},ac=function(e,t){if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;var i=nc(t).length>0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},sc=function(e,t,i){if(void 0===t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;var n=function(e,t){var i=0,n=t-e.mediaSequence,r=e.segments[n];if(r){if(void 0!==r.start)return{result:r.start,precise:!0};if(void 0!==r.end)return{result:r.end-r.duration,precise:!0}}for(;n--;){if(void 0!==(r=e.segments[n]).end)return{result:i+r.end,precise:!0};if(i+=tc(e,r),void 0!==r.start)return{result:i+r.start,precise:!0}}return{result:i,precise:!1}}(e,t);if(n.precise)return n.result;var r=function(e,t){for(var i,n=0,r=t-e.mediaSequence;r<e.segments.length;r++){if(void 0!==(i=e.segments[r]).start)return{result:i.start-n,precise:!0};if(n+=tc(e,i),void 0!==i.end)return{result:i.end-n,precise:!0}}return{result:-1,precise:!1}}(e,t);return r.precise?r.result:n.result+i},oc=function(e,t,i){if(!e)return 0;if("number"!=typeof i&&(i=0),void 0===t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return te.Infinity}return sc(e,t,i)},uc=function(e){var t=e.defaultDuration,i=e.durationList,n=e.startIndex,r=e.endIndex,a=0;if(n>r){var s=[r,n];n=s[0],r=s[1]}if(n<0){for(var o=n;o<Math.min(0,r);o++)a+=t;n=0}for(var u=n;u<r;u++)a+=i[u].duration;return a},lc=function(e,t,i,n){if(!e||!e.segments)return null;if(e.endList)return oc(e);if(null===t)return null;t=t||0;var r=sc(e,e.mediaSequence+e.segments.length,t);return i&&(r-=n="number"==typeof n?n:ac(null,e)),Math.max(0,r)},cc=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},dc=function(e){return e.excludeUntil&&e.excludeUntil===1/0},hc=function(e){var t=cc(e);return!e.disabled&&!t},pc=function(e,t){return t.attributes&&t.attributes[e]},fc=function(e,t){if(1===e.playlists.length)return!0;var i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((function(e){return!!hc(e)&&(e.attributes.BANDWIDTH||0)<i})).length},mc=function(e,t){return!(!e&&!t||!e&&t||e&&!t)&&(e===t||(!(!e.id||!t.id||e.id!==t.id)||(!(!e.resolvedUri||!t.resolvedUri||e.resolvedUri!==t.resolvedUri)||!(!e.uri||!t.uri||e.uri!==t.uri))))},gc=function(e,t){var i=e&&e.mediaGro
|
||
|
/*! @name aes-decrypter @version 3.1.2 @license Apache-2.0 */
|
||
|
var a=null,s=function(){function e(e){var t,i,n;a||(a=function(){var e,t,i,n,r,a,s,o,u=[[[],[],[],[],[]],[[],[],[],[],[]]],l=u[0],c=u[1],d=l[4],h=c[4],p=[],f=[];for(e=0;e<256;e++)f[(p[e]=e<<1^283*(e>>7))^e]=e;for(t=i=0;!d[t];t^=n||1,i=f[i]||1)for(a=(a=i^i<<1^i<<2^i<<3^i<<4)>>8^255&a^99,d[t]=a,h[a]=t,o=16843009*p[r=p[n=p[t]]]^65537*r^257*n^16843008*t,s=257*p[a]^16843008*a,e=0;e<4;e++)l[e][t]=s=s<<24^s>>>8,c[e][a]=o=o<<24^o>>>8;for(e=0;e<5;e++)l[e]=l[e].slice(0),c[e]=c[e].slice(0);return u}()),this._tables=[[a[0][0].slice(),a[0][1].slice(),a[0][2].slice(),a[0][3].slice(),a[0][4].slice()],[a[1][0].slice(),a[1][1].slice(),a[1][2].slice(),a[1][3].slice(),a[1][4].slice()]];var r=this._tables[0][4],s=this._tables[1],o=e.length,u=1;if(4!==o&&6!==o&&8!==o)throw new Error("Invalid aes key size");var l=e.slice(0),c=[];for(this._key=[l,c],t=o;t<4*o+28;t++)n=l[t-1],(t%o==0||8===o&&t%o==4)&&(n=r[n>>>24]<<24^r[n>>16&255]<<16^r[n>>8&255]<<8^r[255&n],t%o==0&&(n=n<<8^n>>>24^u<<24,u=u<<1^283*(u>>7))),l[t]=l[t-o]^n;for(i=0;t;i++,t--)n=l[3&i?t:t-4],c[i]=t<=4||i<4?n:s[0][r[n>>>24]]^s[1][r[n>>16&255]]^s[2][r[n>>8&255]]^s[3][r[255&n]]}return e.prototype.decrypt=function(e,t,i,n,r,a){var s,o,u,l,c=this._key[1],d=e^c[0],h=n^c[1],p=i^c[2],f=t^c[3],m=c.length/4-2,g=4,v=this._tables[1],y=v[0],_=v[1],b=v[2],T=v[3],S=v[4];for(l=0;l<m;l++)s=y[d>>>24]^_[h>>16&255]^b[p>>8&255]^T[255&f]^c[g],o=y[h>>>24]^_[p>>16&255]^b[f>>8&255]^T[255&d]^c[g+1],u=y[p>>>24]^_[f>>16&255]^b[d>>8&255]^T[255&h]^c[g+2],f=y[f>>>24]^_[d>>16&255]^b[h>>8&255]^T[255&p]^c[g+3],g+=4,d=s,h=o,p=u;for(l=0;l<4;l++)r[(3&-l)+a]=S[d>>>24]<<24^S[h>>16&255]<<16^S[p>>8&255]<<8^S[255&f]^c[g++],s=d,d=h,h=p,p=f,f=s},e}(),o=function(e){function t(){var t;return(t=e.call(this,r)||this).jobs=[],t.delay=1,t.timeout_=null,t}n(t,e);var i=t.prototype;return i.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},i.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},t}(r),u=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},l=function(){function e(t,i,n,r){var a=e.STEP,s=new Int32Array(t.buffer),l=new Uint8Array(t.byteLength),c=0;for(this.asyncStream_=new o,this.asyncStream_.push(this.decryptChunk_(s.subarray(c,c+a),i,n,l)),c=a;c<s.length;c+=a)n=new Uint32Array([u(s[c-4]),u(s[c-3]),u(s[c-2]),u(s[c-1])]),this.asyncStream_.push(this.decryptChunk_(s.subarray(c,c+a),i,n,l));this.asyncStream_.push((function(){
|
||
|
/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
|
||
|
var e;r(null,(e=l).subarray(0,e.byteLength-e[e.byteLength-1]))}))}return e.prototype.decryptChunk_=function(e,t,i,n){return function(){var r=function(e,t,i){var n,r,a,o,l,c,d,h,p,f=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),m=new s(Array.prototype.slice.call(t)),g=new Uint8Array(e.byteLength),v=new Int32Array(g.buffer);for(n=i[0],r=i[1],a=i[2],o=i[3],p=0;p<f.length;p+=4)l=u(f[p]),c=u(f[p+1]),d=u(f[p+2]),h=u(f[p+3]),m.decrypt(l,c,d,h,v,p),v[p]=u(v[p]^n),v[p+1]=u(v[p+1]^r),v[p+2]=u(v[p+2]^a),v[p+3]=u(v[p+3]^o),n=l,r=c,a=d,o=h;return g}(e,t,i);n.set(r,e.byteOffset)}},t(e,null,[{key:"STEP",get:function(){return 32e3}}]),e}();self.onmessage=function(e){var t=e.data,i=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),n=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),r=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new l(i,n,r,(function(e,i){var n,r;self.postMessage((n={source:t.source,decrypted:i},r={},Object.keys(n).forEach((function(e){var t=n[e];ArrayBuffer.isView(t)?r[e]={bytes:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength}:r[e]=t})),r),[i.buffer])}))}})))),Ch=function(e){var t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},wh=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},xh=function(e,t){t.activePlaylistLoader=e,e.load()},Ih={AUDIO:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;wh(i,n);var a=n.activeTrack(),s=n.activeGroup(),o=(s.filter((function(e){return e.default}))[0]||s[0]).id,u=n.tracks[o];if(a!==u){for(var l in Hl.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks)n.tracks[l].enabled=n.tracks[l]===u;n.onTrackChanged()}else r({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e];Hl.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),wh(i,n);var r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged()}}},Ah={AUDIO:function(e,t,i){if(t){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",Ih[e](e,i))}},SUBTITLES:function(e,t,i){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e],s=i.mediaTypes[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),a.track(s.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",Ih[e](e,i))}},Ph={AUDIO:function(e,t){var i=t.vhs,n=t.sourceType,r=t.segmentLoaders[e],a=t.requestOptions,s=t.master.mediaGroups,o=t.mediaTypes[e],u=o.groups,l=o.tracks,c=o.logger_,d=t.masterPlaylistLoader,h=vc(d.master);for(var p in s[e]&&0!==Object.keys(s[e]).length||(s[e]={main:{default:{default:!0}}},h&&(s[e].main.default.playlists=d.master.playlists)),s[e])for(var f in u[p]||(u[p]=[]),s[e][p]){var m=s[e][p][f],g=void 0;if(h?(c("AUDIO group '"+p+"' label '"+f+"' is a master playlist"),m.isMasterPlaylist=!0,g=null):g="vhs-json"===n&&m.playlists?new Dc(m.playlists[0],i,a):m.resolvedUri?new Dc(m.resolvedUri,i,a):m.playlists&&"dash"===n?new ed(m.playlists[0],i,a,d):null,m=Hl.mergeOptions({id:f,playlistLoader:g},m),Ah[e](e,m.playlistLoader,t),u[p].push(m),void 0===l[f]){var v=new Hl.AudioTrack({id:f,kind:Ch(m),enabled:!1,language:m.language,default:m.default,label:f});l[f]=v}}r.on("error",Ih[e](e,t))},SUBTITLES:function(e,t){var i=t.tech,n=t.vhs,r=t.sourceType,a=t.segmentLoaders[e],s=t.requestOptions,o=t.master.mediaGroups,u=t.mediaTypes[e],l=u.groups,c=u.tracks,d=t.masterPlaylistLoader;for(var h in o[e])for(var p in l[h]||(l[h]=[]),o[e][h])if(!o[e][h][p].forced){var f=
|