xgplayer-mp4-loader 0.0.1 → 3.0.3-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/es/_virtual/_rollupPluginBabelHelpers.js +596 -0
- package/es/cache.js +8 -15
- package/es/config.js +7 -20
- package/es/error.js +5 -8
- package/es/index.js +2 -5
- package/es/loader.d.ts +14 -9
- package/es/loader.js +428 -405
- package/es/utils.d.ts +3 -0
- package/es/utils.js +110 -132
- package/package.json +12 -7
package/dist/index.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).MP4Loader=e()}(this,(function(){"use strict";function t(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function e(e){return function(){var r=this,n=arguments;return new Promise((function(o,i){var a=e.apply(r,n);function u(e){t(a,o,i,u,c,"next",e)}function c(e){t(a,o,i,u,c,"throw",e)}u(void 0)}))}}function r(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function i(t,e,r){return e&&o(t.prototype,e),r&&o(t,r),t}function a(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},c=function(t){return t&&t.Math==Math&&t},s=c("object"==typeof globalThis&&globalThis)||c("object"==typeof window&&window)||c("object"==typeof self&&self)||c("object"==typeof u&&u)||function(){return this}()||Function("return this")(),f={},l=function(t){try{return!!t()}catch(t){return!0}},d=!l((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),h={},p={}.propertyIsEnumerable,v=Object.getOwnPropertyDescriptor,y=v&&!p.call({1:2},1);h.f=y?function(t){var e=v(this,t);return!!e&&e.enumerable}:p;var g,m,b=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},w={}.toString,x=function(t){return w.call(t).slice(8,-1)},T=x,S="".split,k=l((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==T(t)?S.call(t,""):Object(t)}:Object,O=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},A=k,_=O,E=function(t){return A(_(t))},j=function(t){return"object"==typeof t?null!==t:"function"==typeof t},R=s,I=function(t){return"function"==typeof t?t:void 0},C=function(t,e){return arguments.length<2?I(R[t]):R[t]&&R[t][e]},P=C("navigator","userAgent")||"",L=s,M=P,D=L.process,B=L.Deno,F=D&&D.versions||B&&B.version,z=F&&F.v8;z?m=(g=z.split("."))[0]<4?1:g[0]+g[1]:M&&(!(g=M.match(/Edge\/(\d+)/))||g[1]>=74)&&(g=M.match(/Chrome\/(\d+)/))&&(m=g[1]);var U=m&&+m,N=U,Y=l,V=!!Object.getOwnPropertySymbols&&!Y((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&N&&N<41})),G=V&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,q=C,$=G?function(t){return"symbol"==typeof t}:function(t){var e=q("Symbol");return"function"==typeof e&&Object(t)instanceof e},W=j,H={exports:{}},K=s,Q=function(t,e){try{Object.defineProperty(K,t,{value:e,configurable:!0,writable:!0})}catch(r){K[t]=e}return e},J=Q,X="__core-js_shared__",Z=s[X]||J(X,{}),tt=Z;(H.exports=function(t,e){return tt[t]||(tt[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.16.2",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var et=O,rt=function(t){return Object(et(t))},nt=rt,ot={}.hasOwnProperty,it=Object.hasOwn||function(t,e){return ot.call(nt(t),e)},at=0,ut=Math.random(),ct=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++at+ut).toString(36)},st=s,ft=H.exports,lt=it,dt=ct,ht=V,pt=G,vt=ft("wks"),yt=st.Symbol,gt=pt?yt:yt&&yt.withoutSetter||dt,mt=function(t){return lt(vt,t)&&(ht||"string"==typeof vt[t])||(ht&<(yt,t)?vt[t]=yt[t]:vt[t]=gt("Symbol."+t)),vt[t]},bt=j,wt=$,xt=function(t,e){var r,n;if("string"===e&&"function"==typeof(r=t.toString)&&!W(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!W(n=r.call(t)))return n;if("string"!==e&&"function"==typeof(r=t.toString)&&!W(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")},Tt=mt("toPrimitive"),St=function(t,e){if(!bt(t)||wt(t))return t;var r,n=t[Tt];if(void 0!==n){if(void 0===e&&(e="default"),r=n.call(t,e),!bt(r)||wt(r))return r;throw TypeError("Can't convert object to primitive value")}return void 0===e&&(e="number"),xt(t,e)},kt=$,Ot=function(t){var e=St(t,"string");return kt(e)?e:String(e)},At=j,_t=s.document,Et=At(_t)&&At(_t.createElement),jt=function(t){return Et?_t.createElement(t):{}},Rt=jt,It=!d&&!l((function(){return 7!=Object.defineProperty(Rt("div"),"a",{get:function(){return 7}}).a})),Ct=d,Pt=h,Lt=b,Mt=E,Dt=Ot,Bt=it,Ft=It,zt=Object.getOwnPropertyDescriptor;f.f=Ct?zt:function(t,e){if(t=Mt(t),e=Dt(e),Ft)try{return zt(t,e)}catch(t){}if(Bt(t,e))return Lt(!Pt.f.call(t,e),t[e])};var Ut={},Nt=j,Yt=function(t){if(!Nt(t))throw TypeError(String(t)+" is not an object");return t},Vt=d,Gt=It,qt=Yt,$t=Ot,Wt=Object.defineProperty;Ut.f=Vt?Wt:function(t,e,r){if(qt(t),e=$t(e),qt(r),Gt)try{return Wt(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var Ht=Ut,Kt=b,Qt=d?function(t,e,r){return Ht.f(t,e,Kt(1,r))}:function(t,e,r){return t[e]=r,t},Jt={exports:{}},Xt=Z,Zt=Function.toString;"function"!=typeof Xt.inspectSource&&(Xt.inspectSource=function(t){return Zt.call(t)});var te,ee,re,ne=Xt.inspectSource,oe=ne,ie=s.WeakMap,ae="function"==typeof ie&&/native code/.test(oe(ie)),ue=H.exports,ce=ct,se=ue("keys"),fe=function(t){return se[t]||(se[t]=ce(t))},le={},de=ae,he=j,pe=Qt,ve=it,ye=Z,ge=fe,me=le,be="Object already initialized",we=s.WeakMap;if(de||ye.state){var xe=ye.state||(ye.state=new we),Te=xe.get,Se=xe.has,ke=xe.set;te=function(t,e){if(Se.call(xe,t))throw new TypeError(be);return e.facade=t,ke.call(xe,t,e),e},ee=function(t){return Te.call(xe,t)||{}},re=function(t){return Se.call(xe,t)}}else{var Oe=ge("state");me[Oe]=!0,te=function(t,e){if(ve(t,Oe))throw new TypeError(be);return e.facade=t,pe(t,Oe,e),e},ee=function(t){return ve(t,Oe)?t[Oe]:{}},re=function(t){return ve(t,Oe)}}var Ae={set:te,get:ee,has:re,enforce:function(t){return re(t)?ee(t):te(t,{})},getterFor:function(t){return function(e){var r;if(!he(e)||(r=ee(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}},_e=s,Ee=Qt,je=it,Re=Q,Ie=ne,Ce=Ae.get,Pe=Ae.enforce,Le=String(String).split("String");(Jt.exports=function(t,e,r,n){var o,i=!!n&&!!n.unsafe,a=!!n&&!!n.enumerable,u=!!n&&!!n.noTargetGet;"function"==typeof r&&("string"!=typeof e||je(r,"name")||Ee(r,"name",e),(o=Pe(r)).source||(o.source=Le.join("string"==typeof e?e:""))),t!==_e?(i?!u&&t[e]&&(a=!0):delete t[e],a?t[e]=r:Ee(t,e,r)):a?t[e]=r:Re(e,r)})(Function.prototype,"toString",(function(){return"function"==typeof this&&Ce(this).source||Ie(this)}));var Me={},De=Math.ceil,Be=Math.floor,Fe=function(t){return isNaN(t=+t)?0:(t>0?Be:De)(t)},ze=Fe,Ue=Math.min,Ne=function(t){return t>0?Ue(ze(t),9007199254740991):0},Ye=Fe,Ve=Math.max,Ge=Math.min,qe=function(t,e){var r=Ye(t);return r<0?Ve(r+e,0):Ge(r,e)},$e=E,We=Ne,He=qe,Ke=function(t){return function(e,r,n){var o,i=$e(e),a=We(i.length),u=He(n,a);if(t&&r!=r){for(;a>u;)if((o=i[u++])!=o)return!0}else for(;a>u;u++)if((t||u in i)&&i[u]===r)return t||u||0;return!t&&-1}},Qe={includes:Ke(!0),indexOf:Ke(!1)},Je=it,Xe=E,Ze=Qe.indexOf,tr=le,er=function(t,e){var r,n=Xe(t),o=0,i=[];for(r in n)!Je(tr,r)&&Je(n,r)&&i.push(r);for(;e.length>o;)Je(n,r=e[o++])&&(~Ze(i,r)||i.push(r));return i},rr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],nr=er,or=rr.concat("length","prototype");Me.f=Object.getOwnPropertyNames||function(t){return nr(t,or)};var ir={};ir.f=Object.getOwnPropertySymbols;var ar,ur=Me,cr=ir,sr=Yt,fr=C("Reflect","ownKeys")||function(t){var e=ur.f(sr(t)),r=cr.f;return r?e.concat(r(t)):e},lr=it,dr=fr,hr=f,pr=Ut,vr=function(t,e){for(var r=dr(e),n=pr.f,o=hr.f,i=0;i<r.length;i++){var a=r[i];lr(t,a)||n(t,a,o(e,a))}},yr=l,gr=/#|\.prototype\./,mr=function(t,e){var r=wr[br(t)];return r==Tr||r!=xr&&("function"==typeof e?yr(e):!!e)},br=mr.normalize=function(t){return String(t).replace(gr,".").toLowerCase()},wr=mr.data={},xr=mr.NATIVE="N",Tr=mr.POLYFILL="P",Sr=mr,kr=s,Or=f.f,Ar=Qt,_r=Jt.exports,Er=Q,jr=vr,Rr=Sr,Ir=function(t,e){var r,n,o,i,a,u=t.target,c=t.global,s=t.stat;if(r=c?kr:s?kr[u]||Er(u,{}):(kr[u]||{}).prototype)for(n in e){if(i=e[n],o=t.noTargetGet?(a=Or(r,n))&&a.value:r[n],!Rr(c?n:u+(s?".":"#")+n,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;jr(i,o)}(t.sham||o&&o.sham)&&Ar(i,"sham",!0),_r(r,n,i,t)}},Cr=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},Pr=Cr,Lr=function(t,e,r){if(Pr(t),void 0===e)return t;switch(r){case 0:return function(){return t.call(e)};case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,o){return t.call(e,r,n,o)}}return function(){return t.apply(e,arguments)}},Mr=x,Dr=Array.isArray||function(t){return"Array"==Mr(t)},Br=j,Fr=Dr,zr=mt("species"),Ur=function(t){var e;return Fr(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!Fr(e.prototype)?Br(e)&&null===(e=e[zr])&&(e=void 0):e=void 0),void 0===e?Array:e},Nr=function(t,e){return new(Ur(t))(0===e?0:e)},Yr=Lr,Vr=k,Gr=rt,qr=Ne,$r=Nr,Wr=[].push,Hr=function(t){var e=1==t,r=2==t,n=3==t,o=4==t,i=6==t,a=7==t,u=5==t||i;return function(c,s,f,l){for(var d,h,p=Gr(c),v=Vr(p),y=Yr(s,f,3),g=qr(v.length),m=0,b=l||$r,w=e?b(c,g):r||a?b(c,0):void 0;g>m;m++)if((u||m in v)&&(h=y(d=v[m],m,p),t))if(e)w[m]=h;else if(h)switch(t){case 3:return!0;case 5:return d;case 6:return m;case 2:Wr.call(w,d)}else switch(t){case 4:return!1;case 7:Wr.call(w,d)}return i?-1:n||o?o:w}},Kr={forEach:Hr(0),map:Hr(1),filter:Hr(2),some:Hr(3),every:Hr(4),find:Hr(5),findIndex:Hr(6),filterReject:Hr(7)},Qr=er,Jr=rr,Xr=Object.keys||function(t){return Qr(t,Jr)},Zr=Ut,tn=Yt,en=Xr,rn=d?Object.defineProperties:function(t,e){tn(t);for(var r,n=en(e),o=n.length,i=0;o>i;)Zr.f(t,r=n[i++],e[r]);return t},nn=C("document","documentElement"),on=Yt,an=rn,un=rr,cn=le,sn=nn,fn=jt,ln=fe("IE_PROTO"),dn=function(){},hn=function(t){return"<script>"+t+"</"+"script>"},pn=function(t){t.write(hn("")),t.close();var e=t.parentWindow.Object;return t=null,e},vn=function(){try{ar=new ActiveXObject("htmlfile")}catch(t){}var t,e;vn="undefined"!=typeof document?document.domain&&ar?pn(ar):((e=fn("iframe")).style.display="none",sn.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(hn("document.F=Object")),t.close(),t.F):pn(ar);for(var r=un.length;r--;)delete vn.prototype[un[r]];return vn()};cn[ln]=!0;var yn=Object.create||function(t,e){var r;return null!==t?(dn.prototype=on(t),r=new dn,dn.prototype=null,r[ln]=t):r=vn(),void 0===e?r:an(r,e)},gn=yn,mn=Ut,bn=mt("unscopables"),wn=Array.prototype;null==wn[bn]&&mn.f(wn,bn,{configurable:!0,value:gn(null)});var xn=function(t){wn[bn][t]=!0},Tn=Ir,Sn=Kr.find,kn=xn,On="find",An=!0;On in[]&&Array(1).find((function(){An=!1})),Tn({target:"Array",proto:!0,forced:An},{find:function(t){return Sn(this,t,arguments.length>1?arguments[1]:void 0)}}),kn(On);var _n=Ot,En=Ut,jn=b,Rn=function(t,e,r){var n=_n(e);n in t?En.f(t,n,jn(0,r)):t[n]=r},In=l,Cn=U,Pn=mt("species"),Ln=function(t){return Cn>=51||!In((function(){var e=[];return(e.constructor={})[Pn]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Mn=Ir,Dn=j,Bn=Dr,Fn=qe,zn=Ne,Un=E,Nn=Rn,Yn=mt,Vn=Ln("slice"),Gn=Yn("species"),qn=[].slice,$n=Math.max;Mn({target:"Array",proto:!0,forced:!Vn},{slice:function(t,e){var r,n,o,i=Un(this),a=zn(i.length),u=Fn(t,a),c=Fn(void 0===e?a:e,a);if(Bn(i)&&("function"!=typeof(r=i.constructor)||r!==Array&&!Bn(r.prototype)?Dn(r)&&null===(r=r[Gn])&&(r=void 0):r=void 0,r===Array||void 0===r))return qn.call(i,u,c);for(n=new(void 0===r?Array:r)($n(c-u,0)),o=0;u<c;u++,o++)u in i&&Nn(n,o,i[u]);return n.length=o,n}});var Wn={exports:{}};!function(t){var e=function(t){var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new E(n||[]);return i._invoke=function(t,e,r){var n=l;return function(o,i){if(n===h)throw new Error("Generator is already running");if(n===p){if("throw"===o)throw i;return R()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=O(a,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var c=f(t,e,r);if("normal"===c.type){if(n=r.done?p:d,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=p,r.method="throw",r.arg=c.arg)}}}(t,r,a),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var l="suspendedStart",d="suspendedYield",h="executing",p="completed",v={};function y(){}function g(){}function m(){}var b={};b[i]=function(){return this};var w=Object.getPrototypeOf,x=w&&w(w(j([])));x&&x!==r&&n.call(x,i)&&(b=x);var T=m.prototype=y.prototype=Object.create(b);function S(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function O(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,O(t,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=f(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function j(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:R}}function R(){return{value:e,done:!0}}return g.prototype=T.constructor=m,m.constructor=g,g.displayName=c(m,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,c(t,u,"GeneratorFunction")),t.prototype=Object.create(T),t},t.awrap=function(t){return{__await:t}},S(k.prototype),k.prototype[a]=function(){return this},t.AsyncIterator=k,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new k(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(T),c(T,u,"Generator"),T[i]=function(){return this},T.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=j,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(_),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return u.type="throw",u.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),_(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;_(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:j(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}(Wn);var Hn=Wn.exports,Kn=Cr,Qn=j,Jn=[].slice,Xn={},Zn=function(t,e,r){if(!(e in Xn)){for(var n=[],o=0;o<e;o++)n[o]="a["+o+"]";Xn[e]=Function("C,a","return new C("+n.join(",")+")")}return Xn[e](t,r)},to=Function.bind||function(t){var e=Kn(this),r=Jn.call(arguments,1),n=function(){var o=r.concat(Jn.call(arguments));return this instanceof n?Zn(e,o.length,o):e.apply(t,o)};return Qn(e.prototype)&&(n.prototype=e.prototype),n},eo=Ir,ro=Cr,no=Yt,oo=j,io=yn,ao=to,uo=l,co=C("Reflect","construct"),so=uo((function(){function t(){}return!(co((function(){}),[],t)instanceof t)})),fo=!uo((function(){co((function(){}))})),lo=so||fo;function ho(t,e){return(ho=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function po(t){return(po="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function vo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function yo(t,e){if(e&&("object"===po(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return vo(t)}function go(t){return(go=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function mo(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function bo(t,e,r){return(bo=mo()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&ho(o,r.prototype),o}).apply(null,arguments)}function wo(t){var e="function"==typeof Map?new Map:void 0;return(wo=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return bo(t,arguments,go(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),ho(n,t)})(t)}eo({target:"Reflect",stat:!0,forced:lo,sham:lo},{construct:function(t,e){ro(t),no(e);var r=arguments.length<3?t:ro(arguments[2]);if(fo&&!so)return co(t,e,r);if(t==r){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var n=[null];return n.push.apply(n,e),new(ao.apply(t,n))}var o=r.prototype,i=io(oo(o)?o:Object.prototype),a=Function.apply.call(t,i,e);return oo(a)?a:i}});var xo,To,So,ko={},Oo=!l((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Ao=it,_o=rt,Eo=Oo,jo=fe("IE_PROTO"),Ro=Object.prototype,Io=Eo?Object.getPrototypeOf:function(t){return t=_o(t),Ao(t,jo)?t[jo]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Ro:null},Co=l,Po=Io,Lo=Qt,Mo=it,Do=mt("iterator"),Bo=!1;[].keys&&("next"in(So=[].keys())?(To=Po(Po(So)))!==Object.prototype&&(xo=To):Bo=!0),(null==xo||Co((function(){var t={};return xo[Do].call(t)!==t})))&&(xo={}),Mo(xo,Do)||Lo(xo,Do,(function(){return this}));var Fo={IteratorPrototype:xo,BUGGY_SAFARI_ITERATORS:Bo},zo=Ut.f,Uo=it,No=mt("toStringTag"),Yo=function(t,e,r){t&&!Uo(t=r?t:t.prototype,No)&&zo(t,No,{configurable:!0,value:e})},Vo=Fo.IteratorPrototype,Go=yn,qo=b,$o=Yo,Wo=ko,Ho=function(){return this},Ko=j,Qo=Yt,Jo=function(t){if(!Ko(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t},Xo=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return Qo(r),Jo(n),e?t.call(r,n):r.__proto__=n,r}}():void 0),Zo=Ir,ti=function(t,e,r){var n=e+" Iterator";return t.prototype=Go(Vo,{next:qo(1,r)}),$o(t,n,!1),Wo[n]=Ho,t},ei=Io,ri=Xo,ni=Yo,oi=Qt,ii=Jt.exports,ai=ko,ui=Fo.IteratorPrototype,ci=Fo.BUGGY_SAFARI_ITERATORS,si=mt("iterator"),fi="keys",li="values",di="entries",hi=function(){return this},pi=function(t,e,r,n,o,i,a){ti(r,e,n);var u,c,s,f=function(t){if(t===o&&v)return v;if(!ci&&t in h)return h[t];switch(t){case fi:case li:case di:return function(){return new r(this,t)}}return function(){return new r(this)}},l=e+" Iterator",d=!1,h=t.prototype,p=h[si]||h["@@iterator"]||o&&h[o],v=!ci&&p||f(o),y="Array"==e&&h.entries||p;if(y&&(u=ei(y.call(new t)),ui!==Object.prototype&&u.next&&(ei(u)!==ui&&(ri?ri(u,ui):"function"!=typeof u[si]&&oi(u,si,hi)),ni(u,l,!0))),o==li&&p&&p.name!==li&&(d=!0,v=function(){return p.call(this)}),h[si]!==v&&oi(h,si,v),ai[e]=v,o)if(c={values:f(li),keys:i?v:f(fi),entries:f(di)},a)for(s in c)(ci||d||!(s in h))&&ii(h,s,c[s]);else Zo({target:e,proto:!0,forced:ci||d},c);return c},vi=E,yi=xn,gi=ko,mi=Ae,bi=pi,wi="Array Iterator",xi=mi.set,Ti=mi.getterFor(wi),Si=bi(Array,"Array",(function(t,e){xi(this,{type:wi,target:vi(t),index:0,kind:e})}),(function(){var t=Ti(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}}),"values");gi.Arguments=gi.Array,yi("keys"),yi("values"),yi("entries");var ki={};ki[mt("toStringTag")]="z";var Oi="[object z]"===String(ki),Ai=Oi,_i=x,Ei=mt("toStringTag"),ji="Arguments"==_i(function(){return arguments}()),Ri=Ai?_i:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),Ei))?r:ji?_i(e):"Object"==(n=_i(e))&&"function"==typeof e.callee?"Arguments":n},Ii=Ri,Ci=Oi?{}.toString:function(){return"[object "+Ii(this)+"]"},Pi=Oi,Li=Jt.exports,Mi=Ci;Pi||Li(Object.prototype,"toString",Mi,{unsafe:!0});var Di=$,Bi=function(t){if(Di(t))throw TypeError("Cannot convert a Symbol value to a string");return String(t)},Fi=Fe,zi=Bi,Ui=O,Ni=function(t){return function(e,r){var n,o,i=zi(Ui(e)),a=Fi(r),u=i.length;return a<0||a>=u?t?"":void 0:(n=i.charCodeAt(a))<55296||n>56319||a+1===u||(o=i.charCodeAt(a+1))<56320||o>57343?t?i.charAt(a):n:t?i.slice(a,a+2):o-56320+(n-55296<<10)+65536}},Yi={codeAt:Ni(!1),charAt:Ni(!0)},Vi=Yi.charAt,Gi=Bi,qi=Ae,$i=pi,Wi="String Iterator",Hi=qi.set,Ki=qi.getterFor(Wi);$i(String,"String",(function(t){Hi(this,{type:Wi,string:Gi(t),index:0})}),(function(){var t,e=Ki(this),r=e.string,n=e.index;return n>=r.length?{value:void 0,done:!0}:(t=Vi(r,n),e.index+=t.length,{value:t,done:!1})}));var Qi={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Ji=s,Xi=Qi,Zi=Si,ta=Qt,ea=mt,ra=ea("iterator"),na=ea("toStringTag"),oa=Zi.values;for(var ia in Xi){var aa=Ji[ia],ua=aa&&aa.prototype;if(ua){if(ua[ra]!==oa)try{ta(ua,ra,oa)}catch(t){ua[ra]=oa}if(ua[na]||ta(ua,na,ia),Xi[ia])for(var ca in Zi)if(ua[ca]!==Zi[ca])try{ta(ua,ca,Zi[ca])}catch(t){ua[ca]=Zi[ca]}}}var sa=function(t,e,r){if(!(t instanceof e))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return t},fa=d,la=l,da=Xr,ha=ir,pa=h,va=rt,ya=k,ga=Object.assign,ma=Object.defineProperty,ba=!ga||la((function(){if(fa&&1!==ga({b:1},ga(ma({},"a",{enumerable:!0,get:function(){ma(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol(),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach((function(t){e[t]=t})),7!=ga({},t)[r]||da(ga({},e)).join("")!=n}))?function(t,e){for(var r=va(t),n=arguments.length,o=1,i=ha.f,a=pa.f;n>o;)for(var u,c=ya(arguments[o++]),s=i?da(c).concat(i(c)):da(c),f=s.length,l=0;f>l;)u=s[l++],fa&&!a.call(c,u)||(r[u]=c[u]);return r}:ga,wa=Yt,xa=function(t){var e=t.return;if(void 0!==e)return wa(e.call(t)).value},Ta=Yt,Sa=xa,ka=ko,Oa=mt("iterator"),Aa=Array.prototype,_a=function(t){return void 0!==t&&(ka.Array===t||Aa[Oa]===t)},Ea=Ri,ja=ko,Ra=mt("iterator"),Ia=function(t){if(null!=t)return t[Ra]||t["@@iterator"]||ja[Ea(t)]},Ca=Lr,Pa=rt,La=function(t,e,r,n){try{return n?e(Ta(r)[0],r[1]):e(r)}catch(e){throw Sa(t),e}},Ma=_a,Da=Ne,Ba=Rn,Fa=Ia,za=Jt.exports,Ua=function(t,e,r){for(var n in e)za(t,n,e[n],r);return t},Na=l,Ya=function(t,e){var r=[][t];return!!r&&Na((function(){r.call(null,e||function(){throw 1},1)}))},Va=Kr.forEach,Ga=s,qa=Qi,$a=Ya("forEach")?[].forEach:function(t){return Va(this,t,arguments.length>1?arguments[1]:void 0)},Wa=Qt;for(var Ha in qa){var Ka=Ga[Ha],Qa=Ka&&Ka.prototype;if(Qa&&Qa.forEach!==$a)try{Wa(Qa,"forEach",$a)}catch(t){Qa.forEach=$a}}var Ja=rt,Xa=Xr;Ir({target:"Object",stat:!0,forced:l((function(){Xa(1)}))},{keys:function(t){return Xa(Ja(t))}});var Za=s.Promise,tu=C,eu=Ut,ru=d,nu=mt("species"),ou=function(t){var e=tu(t),r=eu.f;ru&&e&&!e[nu]&&r(e,nu,{configurable:!0,get:function(){return this}})},iu=Yt,au=_a,uu=Ne,cu=Lr,su=Ia,fu=xa,lu=function(t,e){this.stopped=t,this.result=e},du=mt("iterator"),hu=!1;try{var pu=0,vu={next:function(){return{done:!!pu++}},return:function(){hu=!0}};vu[du]=function(){return this},Array.from(vu,(function(){throw 2}))}catch(t){}var yu,gu,mu,bu,wu=function(t,e){if(!e&&!hu)return!1;var r=!1;try{var n={};n[du]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(t){}return r},xu=Yt,Tu=Cr,Su=mt("species"),ku=function(t,e){var r,n=xu(t).constructor;return void 0===n||null==(r=xu(n)[Su])?e:Tu(r)},Ou=/(?:ipad|iphone|ipod).*applewebkit/i.test(P),Au="process"==x(s.process),_u=s,Eu=l,ju=Lr,Ru=nn,Iu=jt,Cu=Ou,Pu=Au,Lu=_u.setImmediate,Mu=_u.clearImmediate,Du=_u.process,Bu=_u.MessageChannel,Fu=_u.Dispatch,zu=0,Uu={},Nu="onreadystatechange";try{yu=_u.location}catch(t){}var Yu=function(t){if(Uu.hasOwnProperty(t)){var e=Uu[t];delete Uu[t],e()}},Vu=function(t){return function(){Yu(t)}},Gu=function(t){Yu(t.data)},qu=function(t){_u.postMessage(String(t),yu.protocol+"//"+yu.host)};Lu&&Mu||(Lu=function(t){for(var e=[],r=arguments.length,n=1;r>n;)e.push(arguments[n++]);return Uu[++zu]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},gu(zu),zu},Mu=function(t){delete Uu[t]},Pu?gu=function(t){Du.nextTick(Vu(t))}:Fu&&Fu.now?gu=function(t){Fu.now(Vu(t))}:Bu&&!Cu?(bu=(mu=new Bu).port2,mu.port1.onmessage=Gu,gu=ju(bu.postMessage,bu,1)):_u.addEventListener&&"function"==typeof postMessage&&!_u.importScripts&&yu&&"file:"!==yu.protocol&&!Eu(qu)?(gu=qu,_u.addEventListener("message",Gu,!1)):gu=Nu in Iu("script")?function(t){Ru.appendChild(Iu("script")).onreadystatechange=function(){Ru.removeChild(this),Yu(t)}}:function(t){setTimeout(Vu(t),0)});var $u,Wu,Hu,Ku,Qu,Ju,Xu,Zu,tc={set:Lu,clear:Mu},ec=s,rc=/ipad|iphone|ipod/i.test(P)&&void 0!==ec.Pebble,nc=/web0s(?!.*chrome)/i.test(P),oc=s,ic=f.f,ac=tc.set,uc=Ou,cc=rc,sc=nc,fc=Au,lc=oc.MutationObserver||oc.WebKitMutationObserver,dc=oc.document,hc=oc.process,pc=oc.Promise,vc=ic(oc,"queueMicrotask"),yc=vc&&vc.value;yc||($u=function(){var t,e;for(fc&&(t=hc.domain)&&t.exit();Wu;){e=Wu.fn,Wu=Wu.next;try{e()}catch(t){throw Wu?Ku():Hu=void 0,t}}Hu=void 0,t&&t.enter()},uc||fc||sc||!lc||!dc?!cc&&pc&&pc.resolve?((Xu=pc.resolve(void 0)).constructor=pc,Zu=Xu.then,Ku=function(){Zu.call(Xu,$u)}):Ku=fc?function(){hc.nextTick($u)}:function(){ac.call(oc,$u)}:(Qu=!0,Ju=dc.createTextNode(""),new lc($u).observe(Ju,{characterData:!0}),Ku=function(){Ju.data=Qu=!Qu}));var gc=yc||function(t){var e={fn:t,next:void 0};Hu&&(Hu.next=e),Wu||(Wu=e,Ku()),Hu=e},mc={},bc=Cr,wc=function(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw TypeError("Bad Promise constructor");e=t,r=n})),this.resolve=bc(e),this.reject=bc(r)};mc.f=function(t){return new wc(t)};var xc,Tc,Sc,kc,Oc=Yt,Ac=j,_c=mc,Ec=function(t,e){if(Oc(t),Ac(e)&&e.constructor===t)return e;var r=_c.f(t);return(0,r.resolve)(e),r.promise},jc=s,Rc="object"==typeof window,Ic=Ir,Cc=s,Pc=C,Lc=Za,Mc=Jt.exports,Dc=Ua,Bc=Xo,Fc=Yo,zc=ou,Uc=j,Nc=Cr,Yc=sa,Vc=ne,Gc=function(t,e,r){var n,o,i,a,u,c,s,f=r&&r.that,l=!(!r||!r.AS_ENTRIES),d=!(!r||!r.IS_ITERATOR),h=!(!r||!r.INTERRUPTED),p=cu(e,f,1+l+h),v=function(t){return n&&fu(n),new lu(!0,t)},y=function(t){return l?(iu(t),h?p(t[0],t[1],v):p(t[0],t[1])):h?p(t,v):p(t)};if(d)n=t;else{if("function"!=typeof(o=su(t)))throw TypeError("Target is not iterable");if(au(o)){for(i=0,a=uu(t.length);a>i;i++)if((u=y(t[i]))&&u instanceof lu)return u;return new lu(!1)}n=o.call(t)}for(c=n.next;!(s=c.call(n)).done;){try{u=y(s.value)}catch(t){throw fu(n),t}if("object"==typeof u&&u&&u instanceof lu)return u}return new lu(!1)},qc=wu,$c=ku,Wc=tc.set,Hc=gc,Kc=Ec,Qc=function(t,e){var r=jc.console;r&&r.error&&(1===arguments.length?r.error(t):r.error(t,e))},Jc=mc,Xc=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Zc=Ae,ts=Sr,es=Rc,rs=Au,ns=U,os=mt("species"),is="Promise",as=Zc.get,us=Zc.set,cs=Zc.getterFor(is),ss=Lc&&Lc.prototype,fs=Lc,ls=ss,ds=Cc.TypeError,hs=Cc.document,ps=Cc.process,vs=Jc.f,ys=vs,gs=!!(hs&&hs.createEvent&&Cc.dispatchEvent),ms="function"==typeof PromiseRejectionEvent,bs="unhandledrejection",ws=!1,xs=ts(is,(function(){var t=Vc(fs),e=t!==String(fs);if(!e&&66===ns)return!0;if(ns>=51&&/native code/.test(t))return!1;var r=new fs((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};return(r.constructor={})[os]=n,!(ws=r.then((function(){}))instanceof n)||!e&&es&&!ms})),Ts=xs||!qc((function(t){fs.all(t).catch((function(){}))})),Ss=function(t){var e;return!(!Uc(t)||"function"!=typeof(e=t.then))&&e},ks=function(t,e){if(!t.notified){t.notified=!0;var r=t.reactions;Hc((function(){for(var n=t.value,o=1==t.state,i=0;r.length>i;){var a,u,c,s=r[i++],f=o?s.ok:s.fail,l=s.resolve,d=s.reject,h=s.domain;try{f?(o||(2===t.rejection&&Es(t),t.rejection=1),!0===f?a=n:(h&&h.enter(),a=f(n),h&&(h.exit(),c=!0)),a===s.promise?d(ds("Promise-chain cycle")):(u=Ss(a))?u.call(a,l,d):l(a)):d(n)}catch(t){h&&!c&&h.exit(),d(t)}}t.reactions=[],t.notified=!1,e&&!t.rejection&&As(t)}))}},Os=function(t,e,r){var n,o;gs?((n=hs.createEvent("Event")).promise=e,n.reason=r,n.initEvent(t,!1,!0),Cc.dispatchEvent(n)):n={promise:e,reason:r},!ms&&(o=Cc["on"+t])?o(n):t===bs&&Qc("Unhandled promise rejection",r)},As=function(t){Wc.call(Cc,(function(){var e,r=t.facade,n=t.value;if(_s(t)&&(e=Xc((function(){rs?ps.emit("unhandledRejection",n,r):Os(bs,r,n)})),t.rejection=rs||_s(t)?2:1,e.error))throw e.value}))},_s=function(t){return 1!==t.rejection&&!t.parent},Es=function(t){Wc.call(Cc,(function(){var e=t.facade;rs?ps.emit("rejectionHandled",e):Os("rejectionhandled",e,t.value)}))},js=function(t,e,r){return function(n){t(e,n,r)}},Rs=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,ks(t,!0))},Is=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw ds("Promise can't be resolved itself");var n=Ss(e);n?Hc((function(){var r={done:!1};try{n.call(e,js(Is,r,t),js(Rs,r,t))}catch(e){Rs(r,e,t)}})):(t.value=e,t.state=1,ks(t,!1))}catch(e){Rs({done:!1},e,t)}}};if(xs&&(ls=(fs=function(t){Yc(this,fs,is),Nc(t),xc.call(this);var e=as(this);try{t(js(Is,e),js(Rs,e))}catch(t){Rs(e,t)}}).prototype,(xc=function(t){us(this,{type:is,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=Dc(ls,{then:function(t,e){var r=cs(this),n=vs($c(this,fs));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=rs?ps.domain:void 0,r.parent=!0,r.reactions.push(n),0!=r.state&&ks(r,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),Tc=function(){var t=new xc,e=as(t);this.promise=t,this.resolve=js(Is,e),this.reject=js(Rs,e)},Jc.f=vs=function(t){return t===fs||t===Sc?new Tc(t):ys(t)},"function"==typeof Lc&&ss!==Object.prototype)){kc=ss.then,ws||(Mc(ss,"then",(function(t,e){var r=this;return new fs((function(t,e){kc.call(r,t,e)})).then(t,e)}),{unsafe:!0}),Mc(ss,"catch",ls.catch,{unsafe:!0}));try{delete ss.constructor}catch(t){}Bc&&Bc(ss,ls)}Ic({global:!0,wrap:!0,forced:xs},{Promise:fs}),Fc(fs,is,!1),zc(is),Sc=Pc(is),Ic({target:is,stat:!0,forced:xs},{reject:function(t){var e=vs(this);return e.reject.call(void 0,t),e.promise}}),Ic({target:is,stat:!0,forced:xs},{resolve:function(t){return Kc(this,t)}}),Ic({target:is,stat:!0,forced:Ts},{all:function(t){var e=this,r=vs(e),n=r.resolve,o=r.reject,i=Xc((function(){var r=Nc(e.resolve),i=[],a=0,u=1;Gc(t,(function(t){var c=a++,s=!1;i.push(void 0),u++,r.call(e,t).then((function(t){s||(s=!0,i[c]=t,--u||n(i))}),o)})),--u||n(i)}));return i.error&&o(i.value),r.promise},race:function(t){var e=this,r=vs(e),n=r.reject,o=Xc((function(){var o=Nc(e.resolve);Gc(t,(function(t){o.call(e,t).then(r.resolve,n)}))}));return o.error&&n(o.value),r.promise}});var Cs=Yt,Ps=function(){var t=Cs(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e},Ls={},Ms=l,Ds=s.RegExp;Ls.UNSUPPORTED_Y=Ms((function(){var t=Ds("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),Ls.BROKEN_CARET=Ms((function(){var t=Ds("^r","gy");return t.lastIndex=2,null!=t.exec("str")}));var Bs,Fs,zs=l,Us=s.RegExp,Ns=zs((function(){var t=Us(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)})),Ys=l,Vs=s.RegExp,Gs=Ys((function(){var t=Vs("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")})),qs=Bi,$s=Ps,Ws=Ls,Hs=H.exports,Ks=yn,Qs=Ae.get,Js=Ns,Xs=Gs,Zs=RegExp.prototype.exec,tf=Hs("native-string-replace",String.prototype.replace),ef=Zs,rf=(Bs=/a/,Fs=/b*/g,Zs.call(Bs,"a"),Zs.call(Fs,"a"),0!==Bs.lastIndex||0!==Fs.lastIndex),nf=Ws.UNSUPPORTED_Y||Ws.BROKEN_CARET,of=void 0!==/()??/.exec("")[1];(rf||of||nf||Js||Xs)&&(ef=function(t){var e,r,n,o,i,a,u,c=this,s=Qs(c),f=qs(t),l=s.raw;if(l)return l.lastIndex=c.lastIndex,e=ef.call(l,f),c.lastIndex=l.lastIndex,e;var d=s.groups,h=nf&&c.sticky,p=$s.call(c),v=c.source,y=0,g=f;if(h&&(-1===(p=p.replace("y","")).indexOf("g")&&(p+="g"),g=f.slice(c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==f.charAt(c.lastIndex-1))&&(v="(?: "+v+")",g=" "+g,y++),r=new RegExp("^(?:"+v+")",p)),of&&(r=new RegExp("^"+v+"$(?!\\s)",p)),rf&&(n=c.lastIndex),o=Zs.call(h?r:c,g),h?o?(o.input=o.input.slice(y),o[0]=o[0].slice(y),o.index=c.lastIndex,c.lastIndex+=o[0].length):c.lastIndex=0:rf&&o&&(c.lastIndex=c.global?o.index+o[0].length:n),of&&o&&o.length>1&&tf.call(o[0],r,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(o[i]=void 0)})),o&&d)for(o.groups=a=Ks(null),i=0;i<d.length;i++)a[(u=d[i])[0]]=o[u[1]];return o});var af=ef;Ir({target:"RegExp",proto:!0,forced:/./.exec!==af},{exec:af});var uf=ba;Ir({target:"Object",stat:!0,forced:Object.assign!==uf},{assign:uf});var cf=Ir,sf=l,ff=Dr,lf=j,df=rt,hf=Ne,pf=Rn,vf=Nr,yf=Ln,gf=U,mf=mt("isConcatSpreadable"),bf=9007199254740991,wf="Maximum allowed index exceeded",xf=gf>=51||!sf((function(){var t=[];return t[mf]=!1,t.concat()[0]!==t})),Tf=yf("concat"),Sf=function(t){if(!lf(t))return!1;var e=t[mf];return void 0!==e?!!e:ff(t)};cf({target:"Array",proto:!0,forced:!xf||!Tf},{concat:function(t){var e,r,n,o,i,a=df(this),u=vf(a,0),c=0;for(e=-1,n=arguments.length;e<n;e++)if(Sf(i=-1===e?a:arguments[e])){if(c+(o=hf(i.length))>bf)throw TypeError(wf);for(r=0;r<o;r++,c++)r in i&&pf(u,c,i[r])}else{if(c>=bf)throw TypeError(wf);pf(u,c++,i)}return u.length=c,u}});var kf=Kr.map;Ir({target:"Array",proto:!0,forced:!Ln("map")},{map:function(t){return kf(this,t,arguments.length>1?arguments[1]:void 0)}});var Of=Ir,Af=Za,_f=l,Ef=C,jf=ku,Rf=Ec,If=Jt.exports;if(Of({target:"Promise",proto:!0,real:!0,forced:!!Af&&_f((function(){Af.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=jf(this,Ef("Promise")),r="function"==typeof t;return this.then(r?function(r){return Rf(e,t()).then((function(){return r}))}:t,r?function(r){return Rf(e,t()).then((function(){throw r}))}:t)}}),"function"==typeof Af){var Cf=Ef("Promise").prototype.finally;Af.prototype.finally!==Cf&&If(Af.prototype,"finally",Cf,{unsafe:!0})}var Pf,Lf,Mf,Df={exports:{}},Bf="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,Ff=Bf,zf=d,Uf=s,Nf=j,Yf=it,Vf=Ri,Gf=Qt,qf=Jt.exports,$f=Ut.f,Wf=Io,Hf=Xo,Kf=mt,Qf=ct,Jf=Uf.Int8Array,Xf=Jf&&Jf.prototype,Zf=Uf.Uint8ClampedArray,tl=Zf&&Zf.prototype,el=Jf&&Wf(Jf),rl=Xf&&Wf(Xf),nl=Object.prototype,ol=nl.isPrototypeOf,il=Kf("toStringTag"),al=Qf("TYPED_ARRAY_TAG"),ul=Qf("TYPED_ARRAY_CONSTRUCTOR"),cl=Ff&&!!Hf&&"Opera"!==Vf(Uf.opera),sl=!1,fl={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},ll={BigInt64Array:8,BigUint64Array:8},dl=function(t){if(!Nf(t))return!1;var e=Vf(t);return Yf(fl,e)||Yf(ll,e)};for(Pf in fl)(Mf=(Lf=Uf[Pf])&&Lf.prototype)?Gf(Mf,ul,Lf):cl=!1;for(Pf in ll)(Mf=(Lf=Uf[Pf])&&Lf.prototype)&&Gf(Mf,ul,Lf);if((!cl||"function"!=typeof el||el===Function.prototype)&&(el=function(){throw TypeError("Incorrect invocation")},cl))for(Pf in fl)Uf[Pf]&&Hf(Uf[Pf],el);if((!cl||!rl||rl===nl)&&(rl=el.prototype,cl))for(Pf in fl)Uf[Pf]&&Hf(Uf[Pf].prototype,rl);if(cl&&Wf(tl)!==rl&&Hf(tl,rl),zf&&!Yf(rl,il))for(Pf in sl=!0,$f(rl,il,{get:function(){return Nf(this)?this[al]:void 0}}),fl)Uf[Pf]&&Gf(Uf[Pf],al,Pf);var hl={NATIVE_ARRAY_BUFFER_VIEWS:cl,TYPED_ARRAY_CONSTRUCTOR:ul,TYPED_ARRAY_TAG:sl&&al,aTypedArray:function(t){if(dl(t))return t;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(t){if(Hf&&!ol.call(el,t))throw TypeError("Target is not a typed array constructor");return t},exportTypedArrayMethod:function(t,e,r){if(zf){if(r)for(var n in fl){var o=Uf[n];if(o&&Yf(o.prototype,t))try{delete o.prototype[t]}catch(t){}}rl[t]&&!r||qf(rl,t,r?e:cl&&Xf[t]||e)}},exportTypedArrayStaticMethod:function(t,e,r){var n,o;if(zf){if(Hf){if(r)for(n in fl)if((o=Uf[n])&&Yf(o,t))try{delete o[t]}catch(t){}if(el[t]&&!r)return;try{return qf(el,t,r?e:cl&&el[t]||e)}catch(t){}}for(n in fl)!(o=Uf[n])||o[t]&&!r||qf(o,t,e)}},isView:function(t){if(!Nf(t))return!1;var e=Vf(t);return"DataView"===e||Yf(fl,e)||Yf(ll,e)},isTypedArray:dl,TypedArray:el,TypedArrayPrototype:rl},pl=s,vl=l,yl=wu,gl=hl.NATIVE_ARRAY_BUFFER_VIEWS,ml=pl.ArrayBuffer,bl=pl.Int8Array,wl=!gl||!vl((function(){bl(1)}))||!vl((function(){new bl(-1)}))||!yl((function(t){new bl,new bl(null),new bl(1.5),new bl(t)}),!0)||vl((function(){return 1!==new bl(new ml(2),1,void 0).length})),xl=Fe,Tl=Ne,Sl=function(t){if(void 0===t)return 0;var e=xl(t),r=Tl(e);if(e!==r)throw RangeError("Wrong length or index");return r},kl=Math.abs,Ol=Math.pow,Al=Math.floor,_l=Math.log,El=Math.LN2,jl=rt,Rl=qe,Il=Ne,Cl=function(t){for(var e=jl(this),r=Il(e.length),n=arguments.length,o=Rl(n>1?arguments[1]:void 0,r),i=n>2?arguments[2]:void 0,a=void 0===i?r:Rl(i,r);a>o;)e[o++]=t;return e},Pl=s,Ll=d,Ml=Bf,Dl=Qt,Bl=Ua,Fl=l,zl=sa,Ul=Fe,Nl=Ne,Yl=Sl,Vl={pack:function(t,e,r){var n,o,i,a=new Array(r),u=8*r-e-1,c=(1<<u)-1,s=c>>1,f=23===e?Ol(2,-24)-Ol(2,-77):0,l=t<0||0===t&&1/t<0?1:0,d=0;for((t=kl(t))!=t||t===1/0?(o=t!=t?1:0,n=c):(n=Al(_l(t)/El),t*(i=Ol(2,-n))<1&&(n--,i*=2),(t+=n+s>=1?f/i:f*Ol(2,1-s))*i>=2&&(n++,i/=2),n+s>=c?(o=0,n=c):n+s>=1?(o=(t*i-1)*Ol(2,e),n+=s):(o=t*Ol(2,s-1)*Ol(2,e),n=0));e>=8;a[d++]=255&o,o/=256,e-=8);for(n=n<<e|o,u+=e;u>0;a[d++]=255&n,n/=256,u-=8);return a[--d]|=128*l,a},unpack:function(t,e){var r,n=t.length,o=8*n-e-1,i=(1<<o)-1,a=i>>1,u=o-7,c=n-1,s=t[c--],f=127&s;for(s>>=7;u>0;f=256*f+t[c],c--,u-=8);for(r=f&(1<<-u)-1,f>>=-u,u+=e;u>0;r=256*r+t[c],c--,u-=8);if(0===f)f=1-a;else{if(f===i)return r?NaN:s?-1/0:1/0;r+=Ol(2,e),f-=a}return(s?-1:1)*r*Ol(2,f-e)}},Gl=Io,ql=Xo,$l=Me.f,Wl=Ut.f,Hl=Cl,Kl=Yo,Ql=Ae.get,Jl=Ae.set,Xl="ArrayBuffer",Zl="DataView",td="Wrong index",ed=Pl.ArrayBuffer,rd=ed,nd=Pl.DataView,od=nd&&nd.prototype,id=Object.prototype,ad=Pl.RangeError,ud=Vl.pack,cd=Vl.unpack,sd=function(t){return[255&t]},fd=function(t){return[255&t,t>>8&255]},ld=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},dd=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},hd=function(t){return ud(t,23,4)},pd=function(t){return ud(t,52,8)},vd=function(t,e){Wl(t.prototype,e,{get:function(){return Ql(this)[e]}})},yd=function(t,e,r,n){var o=Yl(r),i=Ql(t);if(o+e>i.byteLength)throw ad(td);var a=Ql(i.buffer).bytes,u=o+i.byteOffset,c=a.slice(u,u+e);return n?c:c.reverse()},gd=function(t,e,r,n,o,i){var a=Yl(r),u=Ql(t);if(a+e>u.byteLength)throw ad(td);for(var c=Ql(u.buffer).bytes,s=a+u.byteOffset,f=n(+o),l=0;l<e;l++)c[s+l]=f[i?l:e-l-1]};if(Ml){if(!Fl((function(){ed(1)}))||!Fl((function(){new ed(-1)}))||Fl((function(){return new ed,new ed(1.5),new ed(NaN),ed.name!=Xl}))){for(var md,bd=(rd=function(t){return zl(this,rd),new ed(Yl(t))}).prototype=ed.prototype,wd=$l(ed),xd=0;wd.length>xd;)(md=wd[xd++])in rd||Dl(rd,md,ed[md]);bd.constructor=rd}ql&&Gl(od)!==id&&ql(od,id);var Td=new nd(new rd(2)),Sd=od.setInt8;Td.setInt8(0,2147483648),Td.setInt8(1,2147483649),!Td.getInt8(0)&&Td.getInt8(1)||Bl(od,{setInt8:function(t,e){Sd.call(this,t,e<<24>>24)},setUint8:function(t,e){Sd.call(this,t,e<<24>>24)}},{unsafe:!0})}else rd=function(t){zl(this,rd,Xl);var e=Yl(t);Jl(this,{bytes:Hl.call(new Array(e),0),byteLength:e}),Ll||(this.byteLength=e)},nd=function(t,e,r){zl(this,nd,Zl),zl(t,rd,Zl);var n=Ql(t).byteLength,o=Ul(e);if(o<0||o>n)throw ad("Wrong offset");if(o+(r=void 0===r?n-o:Nl(r))>n)throw ad("Wrong length");Jl(this,{buffer:t,byteLength:r,byteOffset:o}),Ll||(this.buffer=t,this.byteLength=r,this.byteOffset=o)},Ll&&(vd(rd,"byteLength"),vd(nd,"buffer"),vd(nd,"byteLength"),vd(nd,"byteOffset")),Bl(nd.prototype,{getInt8:function(t){return yd(this,1,t)[0]<<24>>24},getUint8:function(t){return yd(this,1,t)[0]},getInt16:function(t){var e=yd(this,2,t,arguments.length>1?arguments[1]:void 0);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=yd(this,2,t,arguments.length>1?arguments[1]:void 0);return e[1]<<8|e[0]},getInt32:function(t){return dd(yd(this,4,t,arguments.length>1?arguments[1]:void 0))},getUint32:function(t){return dd(yd(this,4,t,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(t){return cd(yd(this,4,t,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(t){return cd(yd(this,8,t,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(t,e){gd(this,1,t,sd,e)},setUint8:function(t,e){gd(this,1,t,sd,e)},setInt16:function(t,e){gd(this,2,t,fd,e,arguments.length>2?arguments[2]:void 0)},setUint16:function(t,e){gd(this,2,t,fd,e,arguments.length>2?arguments[2]:void 0)},setInt32:function(t,e){gd(this,4,t,ld,e,arguments.length>2?arguments[2]:void 0)},setUint32:function(t,e){gd(this,4,t,ld,e,arguments.length>2?arguments[2]:void 0)},setFloat32:function(t,e){gd(this,4,t,hd,e,arguments.length>2?arguments[2]:void 0)},setFloat64:function(t,e){gd(this,8,t,pd,e,arguments.length>2?arguments[2]:void 0)}});Kl(rd,Xl),Kl(nd,Zl);var kd={ArrayBuffer:rd,DataView:nd},Od=j,Ad=Math.floor,_d=Fe,Ed=function(t){var e=_d(t);if(e<0)throw RangeError("The argument can't be less than 0");return e},jd=function(t,e){var r=Ed(t);if(r%e)throw RangeError("Wrong offset");return r},Rd=rt,Id=Ne,Cd=Ia,Pd=_a,Ld=Lr,Md=hl.aTypedArrayConstructor,Dd=j,Bd=Xo,Fd=Ir,zd=s,Ud=d,Nd=wl,Yd=hl,Vd=kd,Gd=sa,qd=b,$d=Qt,Wd=function(t){return!Od(t)&&isFinite(t)&&Ad(t)===t},Hd=Ne,Kd=Sl,Qd=jd,Jd=Ot,Xd=it,Zd=Ri,th=j,eh=$,rh=yn,nh=Xo,oh=Me.f,ih=function(t){var e,r,n,o,i,a,u=Rd(t),c=arguments.length,s=c>1?arguments[1]:void 0,f=void 0!==s,l=Cd(u);if(null!=l&&!Pd(l))for(a=(i=l.call(u)).next,u=[];!(o=a.call(i)).done;)u.push(o.value);for(f&&c>2&&(s=Ld(s,arguments[2],2)),r=Id(u.length),n=new(Md(this))(r),e=0;r>e;e++)n[e]=f?s(u[e],e):u[e];return n},ah=Kr.forEach,uh=ou,ch=Ut,sh=f,fh=function(t,e,r){var n,o;return Bd&&"function"==typeof(n=e.constructor)&&n!==r&&Dd(o=n.prototype)&&o!==r.prototype&&Bd(t,o),t},lh=Ae.get,dh=Ae.set,hh=ch.f,ph=sh.f,vh=Math.round,yh=zd.RangeError,gh=Vd.ArrayBuffer,mh=Vd.DataView,bh=Yd.NATIVE_ARRAY_BUFFER_VIEWS,wh=Yd.TYPED_ARRAY_CONSTRUCTOR,xh=Yd.TYPED_ARRAY_TAG,Th=Yd.TypedArray,Sh=Yd.TypedArrayPrototype,kh=Yd.aTypedArrayConstructor,Oh=Yd.isTypedArray,Ah="BYTES_PER_ELEMENT",_h="Wrong length",Eh=function(t,e){for(var r=0,n=e.length,o=new(kh(t))(n);n>r;)o[r]=e[r++];return o},jh=function(t,e){hh(t,e,{get:function(){return lh(this)[e]}})},Rh=function(t){var e;return t instanceof gh||"ArrayBuffer"==(e=Zd(t))||"SharedArrayBuffer"==e},Ih=function(t,e){return Oh(t)&&!eh(e)&&e in t&&Wd(+e)&&e>=0},Ch=function(t,e){return e=Jd(e),Ih(t,e)?qd(2,t[e]):ph(t,e)},Ph=function(t,e,r){return e=Jd(e),!(Ih(t,e)&&th(r)&&Xd(r,"value"))||Xd(r,"get")||Xd(r,"set")||r.configurable||Xd(r,"writable")&&!r.writable||Xd(r,"enumerable")&&!r.enumerable?hh(t,e,r):(t[e]=r.value,t)};Ud?(bh||(sh.f=Ch,ch.f=Ph,jh(Sh,"buffer"),jh(Sh,"byteOffset"),jh(Sh,"byteLength"),jh(Sh,"length")),Fd({target:"Object",stat:!0,forced:!bh},{getOwnPropertyDescriptor:Ch,defineProperty:Ph}),Df.exports=function(t,e,r){var n=t.match(/\d+$/)[0]/8,o=t+(r?"Clamped":"")+"Array",i="get"+t,a="set"+t,u=zd[o],c=u,s=c&&c.prototype,f={},l=function(t,e){hh(t,e,{get:function(){return function(t,e){var r=lh(t);return r.view[i](e*n+r.byteOffset,!0)}(this,e)},set:function(t){return function(t,e,o){var i=lh(t);r&&(o=(o=vh(o))<0?0:o>255?255:255&o),i.view[a](e*n+i.byteOffset,o,!0)}(this,e,t)},enumerable:!0})};bh?Nd&&(c=e((function(t,e,r,i){return Gd(t,c,o),fh(th(e)?Rh(e)?void 0!==i?new u(e,Qd(r,n),i):void 0!==r?new u(e,Qd(r,n)):new u(e):Oh(e)?Eh(c,e):ih.call(c,e):new u(Kd(e)),t,c)})),nh&&nh(c,Th),ah(oh(u),(function(t){t in c||$d(c,t,u[t])})),c.prototype=s):(c=e((function(t,e,r,i){Gd(t,c,o);var a,u,s,f=0,d=0;if(th(e)){if(!Rh(e))return Oh(e)?Eh(c,e):ih.call(c,e);a=e,d=Qd(r,n);var h=e.byteLength;if(void 0===i){if(h%n)throw yh(_h);if((u=h-d)<0)throw yh(_h)}else if((u=Hd(i)*n)+d>h)throw yh(_h);s=u/n}else s=Kd(e),a=new gh(u=s*n);for(dh(t,{buffer:a,byteOffset:d,byteLength:u,length:s,view:new mh(a)});f<s;)l(t,f++)})),nh&&nh(c,Th),s=c.prototype=rh(Sh)),s.constructor!==c&&$d(s,"constructor",c),$d(s,wh,c),xh&&$d(s,xh,o),f[o]=c,Fd({global:!0,forced:c!=u,sham:!bh},f),Ah in c||$d(c,Ah,n),Ah in s||$d(s,Ah,n),uh(o)}):Df.exports=function(){},(0,Df.exports)("Uint8",(function(t){return function(e,r,n){return t(this,e,r,n)}}));var Lh=rt,Mh=qe,Dh=Ne,Bh=Math.min,Fh=[].copyWithin||function(t,e){var r=Lh(this),n=Dh(r.length),o=Mh(t,n),i=Mh(e,n),a=arguments.length>2?arguments[2]:void 0,u=Bh((void 0===a?n:Mh(a,n))-i,n-o),c=1;for(i<o&&o<i+u&&(c=-1,i+=u-1,o+=u-1);u-- >0;)i in r?r[o]=r[i]:delete r[o],o+=c,i+=c;return r},zh=hl.aTypedArray;(0,hl.exportTypedArrayMethod)("copyWithin",(function(t,e){return Fh.call(zh(this),t,e,arguments.length>2?arguments[2]:void 0)}));var Uh=Kr.every,Nh=hl.aTypedArray;(0,hl.exportTypedArrayMethod)("every",(function(t){return Uh(Nh(this),t,arguments.length>1?arguments[1]:void 0)}));var Yh=Cl,Vh=hl.aTypedArray;(0,hl.exportTypedArrayMethod)("fill",(function(t){return Yh.apply(Vh(this),arguments)}));var Gh=ku,qh=hl.TYPED_ARRAY_CONSTRUCTOR,$h=hl.aTypedArrayConstructor,Wh=function(t){return $h(Gh(t,t[qh]))},Hh=function(t,e){for(var r=0,n=e.length,o=new t(n);n>r;)o[r]=e[r++];return o},Kh=Wh,Qh=Kr.filter,Jh=function(t,e){return Hh(Kh(t),e)},Xh=hl.aTypedArray;(0,hl.exportTypedArrayMethod)("filter",(function(t){var e=Qh(Xh(this),t,arguments.length>1?arguments[1]:void 0);return Jh(this,e)}));var Zh=Kr.find,tp=hl.aTypedArray;(0,hl.exportTypedArrayMethod)("find",(function(t){return Zh(tp(this),t,arguments.length>1?arguments[1]:void 0)}));var ep=Kr.findIndex,rp=hl.aTypedArray;(0,hl.exportTypedArrayMethod)("findIndex",(function(t){return ep(rp(this),t,arguments.length>1?arguments[1]:void 0)}));var np=Kr.forEach,op=hl.aTypedArray;(0,hl.exportTypedArrayMethod)("forEach",(function(t){np(op(this),t,arguments.length>1?arguments[1]:void 0)}));var ip=Qe.includes,ap=hl.aTypedArray;(0,hl.exportTypedArrayMethod)("includes",(function(t){return ip(ap(this),t,arguments.length>1?arguments[1]:void 0)}));var up=Qe.indexOf,cp=hl.aTypedArray;(0,hl.exportTypedArrayMethod)("indexOf",(function(t){return up(cp(this),t,arguments.length>1?arguments[1]:void 0)}));var sp=s,fp=hl,lp=Si,dp=mt("iterator"),hp=sp.Uint8Array,pp=lp.values,vp=lp.keys,yp=lp.entries,gp=fp.aTypedArray,mp=fp.exportTypedArrayMethod,bp=hp&&hp.prototype[dp],wp=!!bp&&("values"==bp.name||null==bp.name),xp=function(){return pp.call(gp(this))};mp("entries",(function(){return yp.call(gp(this))})),mp("keys",(function(){return vp.call(gp(this))})),mp("values",xp,!wp),mp(dp,xp,!wp);var Tp=hl.aTypedArray,Sp=[].join;(0,hl.exportTypedArrayMethod)("join",(function(t){return Sp.apply(Tp(this),arguments)}));var kp=E,Op=Fe,Ap=Ne,_p=Ya,Ep=Math.min,jp=[].lastIndexOf,Rp=!!jp&&1/[1].lastIndexOf(1,-0)<0,Ip=_p("lastIndexOf"),Cp=Rp||!Ip?function(t){if(Rp)return jp.apply(this,arguments)||0;var e=kp(this),r=Ap(e.length),n=r-1;for(arguments.length>1&&(n=Ep(n,Op(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in e&&e[n]===t)return n||0;return-1}:jp,Pp=hl.aTypedArray;(0,hl.exportTypedArrayMethod)("lastIndexOf",(function(t){return Cp.apply(Pp(this),arguments)}));var Lp=Kr.map,Mp=Wh,Dp=hl.aTypedArray;(0,hl.exportTypedArrayMethod)("map",(function(t){return Lp(Dp(this),t,arguments.length>1?arguments[1]:void 0,(function(t,e){return new(Mp(t))(e)}))}));var Bp=Cr,Fp=rt,zp=k,Up=Ne,Np=function(t){return function(e,r,n,o){Bp(r);var i=Fp(e),a=zp(i),u=Up(i.length),c=t?u-1:0,s=t?-1:1;if(n<2)for(;;){if(c in a){o=a[c],c+=s;break}if(c+=s,t?c<0:u<=c)throw TypeError("Reduce of empty array with no initial value")}for(;t?c>=0:u>c;c+=s)c in a&&(o=r(o,a[c],c,i));return o}},Yp={left:Np(!1),right:Np(!0)},Vp=Yp.left,Gp=hl.aTypedArray;(0,hl.exportTypedArrayMethod)("reduce",(function(t){return Vp(Gp(this),t,arguments.length,arguments.length>1?arguments[1]:void 0)}));var qp=Yp.right,$p=hl.aTypedArray;(0,hl.exportTypedArrayMethod)("reduceRight",(function(t){return qp($p(this),t,arguments.length,arguments.length>1?arguments[1]:void 0)}));var Wp=hl.aTypedArray,Hp=hl.exportTypedArrayMethod,Kp=Math.floor;Hp("reverse",(function(){for(var t,e=this,r=Wp(e).length,n=Kp(r/2),o=0;o<n;)t=e[o],e[o++]=e[--r],e[r]=t;return e}));var Qp=Ne,Jp=jd,Xp=rt,Zp=hl.aTypedArray;(0,hl.exportTypedArrayMethod)("set",(function(t){Zp(this);var e=Jp(arguments.length>1?arguments[1]:void 0,1),r=this.length,n=Xp(t),o=Qp(n.length),i=0;if(o+e>r)throw RangeError("Wrong length");for(;i<o;)this[e+i]=n[i++]}),l((function(){new Int8Array(1).set({})})));var tv=Wh,ev=hl.aTypedArray,rv=[].slice;(0,hl.exportTypedArrayMethod)("slice",(function(t,e){for(var r=rv.call(ev(this),t,e),n=tv(this),o=0,i=r.length,a=new n(i);i>o;)a[o]=r[o++];return a}),l((function(){new Int8Array(1).slice()})));var nv=Kr.some,ov=hl.aTypedArray;(0,hl.exportTypedArrayMethod)("some",(function(t){return nv(ov(this),t,arguments.length>1?arguments[1]:void 0)}));var iv=Math.floor,av=function(t,e){var r=t.length,n=iv(r/2);return r<8?uv(t,e):cv(av(t.slice(0,n),e),av(t.slice(n),e),e)},uv=function(t,e){for(var r,n,o=t.length,i=1;i<o;){for(n=i,r=t[i];n&&e(t[n-1],r)>0;)t[n]=t[--n];n!==i++&&(t[n]=r)}return t},cv=function(t,e,r){for(var n=t.length,o=e.length,i=0,a=0,u=[];i<n||a<o;)i<n&&a<o?u.push(r(t[i],e[a])<=0?t[i++]:e[a++]):u.push(i<n?t[i++]:e[a++]);return u},sv=av,fv=P.match(/firefox\/(\d+)/i),lv=!!fv&&+fv[1],dv=/MSIE|Trident/.test(P),hv=P.match(/AppleWebKit\/(\d+)\./),pv=!!hv&&+hv[1],vv=l,yv=Cr,gv=Ne,mv=sv,bv=lv,wv=dv,xv=U,Tv=pv,Sv=hl.aTypedArray,kv=hl.exportTypedArrayMethod,Ov=s.Uint16Array,Av=Ov&&Ov.prototype.sort,_v=!!Av&&!vv((function(){var t=new Ov(2);t.sort(null),t.sort({})})),Ev=!!Av&&!vv((function(){if(xv)return xv<74;if(bv)return bv<67;if(wv)return!0;if(Tv)return Tv<602;var t,e,r=new Ov(516),n=Array(516);for(t=0;t<516;t++)e=t%4,r[t]=515-t,n[t]=t-2*e+3;for(r.sort((function(t,e){return(t/4|0)-(e/4|0)})),t=0;t<516;t++)if(r[t]!==n[t])return!0}));kv("sort",(function(t){var e=this;if(void 0!==t&&yv(t),Ev)return Av.call(e,t);Sv(e);var r,n=gv(e.length),o=Array(n);for(r=0;r<n;r++)o[r]=e[r];for(o=mv(e,function(t){return function(e,r){return void 0!==t?+t(e,r)||0:r!=r?-1:e!=e?1:0===e&&0===r?1/e>0&&1/r<0?1:-1:e>r}}(t)),r=0;r<n;r++)e[r]=o[r];return e}),!Ev||_v);var jv=Ne,Rv=qe,Iv=Wh,Cv=hl.aTypedArray;(0,hl.exportTypedArrayMethod)("subarray",(function(t,e){var r=Cv(this),n=r.length,o=Rv(t,n);return new(Iv(r))(r.buffer,r.byteOffset+o*r.BYTES_PER_ELEMENT,jv((void 0===e?n:Rv(e,n))-o))}));var Pv=hl,Lv=l,Mv=s.Int8Array,Dv=Pv.aTypedArray,Bv=Pv.exportTypedArrayMethod,Fv=[].toLocaleString,zv=[].slice,Uv=!!Mv&&Lv((function(){Fv.call(new Mv(1))}));Bv("toLocaleString",(function(){return Fv.apply(Uv?zv.call(Dv(this)):Dv(this),arguments)}),Lv((function(){return[1,2].toLocaleString()!=new Mv([1,2]).toLocaleString()}))||!Lv((function(){Mv.prototype.toLocaleString.call([1,2])})));var Nv=hl.exportTypedArrayMethod,Yv=l,Vv=s.Uint8Array,Gv=Vv&&Vv.prototype||{},qv=[].toString,$v=[].join;Yv((function(){qv.call({})}))&&(qv=function(){return $v.call(this)});var Wv=Gv.toString!=qv;Nv("toString",qv,Wv);var Hv="fetch",Kv="xhr",Qv="arraybuffer",Jv="text",Xv="json";function Zv(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=go(t);if(e){var o=go(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return yo(this,r)}}var ty=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ho(t,e)}(r,t);var e=Zv(r);function r(t,o,i,u){var c;return n(this,r),a(vo(c=e.call(this,u)),"retryCount",0),a(vo(c),"isTimeout",!1),a(vo(c),"loaderType",Hv),a(vo(c),"startTime",0),a(vo(c),"endTime",0),c.url=t,c.request=o,c.response=i,c}return r}(wo(Error)),ey=Jt.exports,ry=af,ny=l,oy=mt,iy=Qt,ay=oy("species"),uy=RegExp.prototype,cy=function(t,e,r,n){var o=oy(t),i=!ny((function(){var e={};return e[o]=function(){return 7},7!=""[t](e)})),a=i&&!ny((function(){var e=!1,r=/a/;return"split"===t&&((r={}).constructor={},r.constructor[ay]=function(){return r},r.flags="",r[o]=/./[o]),r.exec=function(){return e=!0,null},r[o](""),!e}));if(!i||!a||r){var u=/./[o],c=e(o,""[t],(function(t,e,r,n,o){var a=e.exec;return a===ry||a===uy.exec?i&&!o?{done:!0,value:u.call(e,r,n)}:{done:!0,value:t.call(r,e,n)}:{done:!1}}));ey(String.prototype,t,c[0]),ey(uy,o,c[1])}n&&iy(uy[o],"sham",!0)},sy=Yi.charAt,fy=function(t,e,r){return e+(r?sy(t,e).length:1)},ly=rt,dy=Math.floor,hy="".replace,py=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,vy=/\$([$&'`]|\d{1,2})/g,yy=x,gy=af,my=function(t,e){var r=t.exec;if("function"==typeof r){var n=r.call(t,e);if("object"!=typeof n)throw TypeError("RegExp exec method returned something other than an Object or null");return n}if("RegExp"!==yy(t))throw TypeError("RegExp#exec called on incompatible receiver");return gy.call(t,e)},by=cy,wy=l,xy=Yt,Ty=Fe,Sy=Ne,ky=Bi,Oy=O,Ay=fy,_y=function(t,e,r,n,o,i){var a=r+t.length,u=n.length,c=vy;return void 0!==o&&(o=ly(o),c=py),hy.call(i,c,(function(i,c){var s;switch(c.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,r);case"'":return e.slice(a);case"<":s=o[c.slice(1,-1)];break;default:var f=+c;if(0===f)return i;if(f>u){var l=dy(f/10);return 0===l?i:l<=u?void 0===n[l-1]?c.charAt(1):n[l-1]+c.charAt(1):i}s=n[f-1]}return void 0===s?"":s}))},Ey=my,jy=mt("replace"),Ry=Math.max,Iy=Math.min,Cy="$0"==="a".replace(/./,"$0"),Py=!!/./[jy]&&""===/./[jy]("a","$0");by("replace",(function(t,e,r){var n=Py?"$":"$0";return[function(t,r){var n=Oy(this),o=null==t?void 0:t[jy];return void 0!==o?o.call(t,n,r):e.call(ky(n),t,r)},function(t,o){var i=xy(this),a=ky(t);if("string"==typeof o&&-1===o.indexOf(n)&&-1===o.indexOf("$<")){var u=r(e,i,a,o);if(u.done)return u.value}var c="function"==typeof o;c||(o=ky(o));var s=i.global;if(s){var f=i.unicode;i.lastIndex=0}for(var l=[];;){var d=Ey(i,a);if(null===d)break;if(l.push(d),!s)break;""===ky(d[0])&&(i.lastIndex=Ay(a,Sy(i.lastIndex),f))}for(var h,p="",v=0,y=0;y<l.length;y++){d=l[y];for(var g=ky(d[0]),m=Ry(Iy(Ty(d.index),a.length),0),b=[],w=1;w<d.length;w++)b.push(void 0===(h=d[w])?h:String(h));var x=d.groups;if(c){var T=[g].concat(b,m,a);void 0!==x&&T.push(x);var S=ky(o.apply(void 0,T))}else S=_y(g,a,m,b,x,o);m>=v&&(p+=a.slice(v,m)+S,v=m+g.length)}return p+a.slice(v)}]}),!!wy((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!Cy||Py);var Ly=Ir,My=E,Dy=[].join,By=k!=Object,Fy=Ya("join",",");Ly({target:"Array",proto:!0,forced:By||!Fy},{join:function(t){return Dy.call(My(this),void 0===t?",":t)}});var zy=Kr.filter;Ir({target:"Array",proto:!0,forced:!Ln("filter")},{filter:function(t){return zy(this,t,arguments.length>1?arguments[1]:void 0)}});var Uy=rt,Ny=Io,Yy=Oo;Ir({target:"Object",stat:!0,forced:l((function(){Ny(1)})),sham:!Yy},{getPrototypeOf:function(t){return Ny(Uy(t))}});var Vy=Object.prototype.toString;function Gy(t){if("[object Object]"!==Vy.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function qy(t){if(t&&null!=t[0]&&(0!==t[0]||null!=t[1])){var e="bytes="+t[0]+"-";return t[1]&&(e+=t[1]),e}}function $y(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Wy(t,e){if(t){if(!e)return t;var r,n=Object.keys(e).map((function(t){if(null!=(r=e[t]))return Array.isArray(r)?t+="[]":r=[r],r.map((function(e){var r;return r=e,"[object Date]"===Vy.call(r)?e=e.toISOString():function(t){return null!==t&&"object"===po(t)}(e)&&(e=JSON.stringify(e)),"".concat($y(t),"=").concat($y(e))})).join("&")})).filter(Boolean).join("&");if(n){var o=t.indexOf("#");-1!==o&&(t=t.slice(0,o)),t+=(-1===t.indexOf("?")?"?":"&")+n}return t}}function Hy(t,e,r,n,o,i){return n=null!=n?parseFloat(n):null,r=parseInt(r||"0",10),isNaN(r)&&(r=0),{data:t,response:e,contentLength:r,age:n,startTime:o,firstByteTime:i,endTime:Date.now()}}var Ky=function(){function t(){n(this,t),a(this,"_abortController",null),a(this,"_timeoutTimer",null),a(this,"_reader",null),a(this,"_response",null),a(this,"_aborted",!1)}var r;return i(t,[{key:"load",value:function(t){var r=this,n=t.url,o=t.timeout,i=t.responseType,a=t.onProgress,u=t.onTimeout,c=t.range,s=t.transformResponse,f=t.request,l=t.params,d=t.method,h=t.headers,p=t.body,v=t.mode,y=t.credentials,g=t.cache,m=t.redirect,b=t.referrer,w=t.referrerPolicy,x=t.integrity;this._aborted=!1,this._abortController=new AbortController;var T={method:d,headers:h,body:p,mode:v,credentials:y,cache:g,redirect:m,referrer:b,referrerPolicy:w,integrity:x,signal:this._abortController.signal},S=!1;clearTimeout(this._timeoutTimer),n=Wy(n,l);var k=qy(c);k&&((h=f?f.headers:T.headers=T.headers||new Headers)instanceof Headers?h.append("Range",k):h.Range=k),o&&(this._timeoutTimer=setTimeout((function(){if(S=!0,r.cancel(),u){var t=new ty(n,T);t.isTimeout=!0,u(t)}}),o));var O=Date.now();return fetch(f||n,f?void 0:T).then(function(){var t=e(Hn.mark((function t(e){var o,u;return Hn.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(clearTimeout(r._timeoutTimer),r._response=e,!r._aborted){t.next=4;break}return t.abrupt("return");case 4:if(s&&(e=s(e,n)||e),e.ok){t.next=7;break}throw new ty(n,T,e,"bad network response");case 7:if(o=Date.now(),i!==Jv){t.next=14;break}return t.next=11,e.text();case 11:u=t.sent,t.next=28;break;case 14:if(i!==Xv){t.next=20;break}return t.next=17,e.json();case 17:u=t.sent,t.next=28;break;case 20:if(!a){t.next=24;break}r._loadChunk(e,a),t.next=28;break;case 24:return t.next=26,e.arrayBuffer();case 26:u=t.sent,u=new Uint8Array(u);case 28:return t.abrupt("return",Hy(u,e,e.headers.get("Content-Length"),e.headers.get("age"),O,o));case 29:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){if(clearTimeout(r._timeoutTimer),!r._aborted||S)throw(t=t instanceof ty?t:new ty(n,T)).startTime=O,t.endTime=Date.now(),t.isTimeout=S,t}))}},{key:"cancel",value:(r=e(Hn.mark((function t(){return Hn.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._aborted){t.next=2;break}return t.abrupt("return");case 2:if(this._aborted=!0,!this._response){t.next=15;break}return t.prev=4,t.next=7,this._response.body.cancel();case 7:if(!this._reader){t.next=10;break}return t.next=10,this._reader.cancel();case 10:t.next=14;break;case 12:t.prev=12,t.t0=t.catch(4);case 14:this._response=this._reader=null;case 15:if(this._abortController){try{this._abortController.abort()}catch(t){}this._abortController=null}case 16:case"end":return t.stop()}}),t,this,[[4,12]])}))),function(){return r.apply(this,arguments)})},{key:"_loadChunk",value:function(t,r){var n,o,i,a=this,u=this._reader=t.body.getReader(),c=function(){var s=e(Hn.mark((function e(){return Hn.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=Date.now(),e.prev=1,e.next=4,u.read();case 4:n=e.sent,i=Date.now(),e.next=13;break;case 8:return e.prev=8,e.t0=e.catch(1),i=Date.now(),r(void 0,!0,{startTime:o,endTime:i},t),e.abrupt("return");case 13:if(!a._aborted){e.next=16;break}return r(void 0,!0,{startTime:o,endTime:i},t),e.abrupt("return");case 16:r(n.value,n.done,{startTime:o,endTime:i},t),n.done||c();case 18:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return s.apply(this,arguments)}}();c()}}],[{key:"isSupported",value:function(){if("undefined"==typeof ReadableStream)return!1;try{new ReadableStream({})}catch(t){return!1}return!("undefined"==typeof fetch||"undefined"==typeof AbortController)}}]),t}(),Qy={},Jy=E,Xy=Me.f,Zy={}.toString,tg="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Qy.f=function(t){return tg&&"[object Window]"==Zy.call(t)?function(t){try{return Xy(t)}catch(t){return tg.slice()}}(t):Xy(Jy(t))};var eg={},rg=mt;eg.f=rg;var ng=s,og=it,ig=eg,ag=Ut.f,ug=function(t){var e=ng.Symbol||(ng.Symbol={});og(e,t)||ag(e,t,{value:ig.f(t)})},cg=Ir,sg=s,fg=C,lg=d,dg=V,hg=l,pg=it,vg=Dr,yg=j,gg=$,mg=Yt,bg=rt,wg=E,xg=Ot,Tg=Bi,Sg=b,kg=yn,Og=Xr,Ag=Me,_g=Qy,Eg=ir,jg=f,Rg=Ut,Ig=h,Cg=Qt,Pg=Jt.exports,Lg=H.exports,Mg=le,Dg=ct,Bg=mt,Fg=eg,zg=ug,Ug=Yo,Ng=Ae,Yg=Kr.forEach,Vg=fe("hidden"),Gg="Symbol",qg=Bg("toPrimitive"),$g=Ng.set,Wg=Ng.getterFor(Gg),Hg=Object.prototype,Kg=sg.Symbol,Qg=fg("JSON","stringify"),Jg=jg.f,Xg=Rg.f,Zg=_g.f,tm=Ig.f,em=Lg("symbols"),rm=Lg("op-symbols"),nm=Lg("string-to-symbol-registry"),om=Lg("symbol-to-string-registry"),im=Lg("wks"),am=sg.QObject,um=!am||!am.prototype||!am.prototype.findChild,cm=lg&&hg((function(){return 7!=kg(Xg({},"a",{get:function(){return Xg(this,"a",{value:7}).a}})).a}))?function(t,e,r){var n=Jg(Hg,e);n&&delete Hg[e],Xg(t,e,r),n&&t!==Hg&&Xg(Hg,e,n)}:Xg,sm=function(t,e){var r=em[t]=kg(Kg.prototype);return $g(r,{type:Gg,tag:t,description:e}),lg||(r.description=e),r},fm=function(t,e,r){t===Hg&&fm(rm,e,r),mg(t);var n=xg(e);return mg(r),pg(em,n)?(r.enumerable?(pg(t,Vg)&&t[Vg][n]&&(t[Vg][n]=!1),r=kg(r,{enumerable:Sg(0,!1)})):(pg(t,Vg)||Xg(t,Vg,Sg(1,{})),t[Vg][n]=!0),cm(t,n,r)):Xg(t,n,r)},lm=function(t,e){mg(t);var r=wg(e),n=Og(r).concat(vm(r));return Yg(n,(function(e){lg&&!dm.call(r,e)||fm(t,e,r[e])})),t},dm=function(t){var e=xg(t),r=tm.call(this,e);return!(this===Hg&&pg(em,e)&&!pg(rm,e))&&(!(r||!pg(this,e)||!pg(em,e)||pg(this,Vg)&&this[Vg][e])||r)},hm=function(t,e){var r=wg(t),n=xg(e);if(r!==Hg||!pg(em,n)||pg(rm,n)){var o=Jg(r,n);return!o||!pg(em,n)||pg(r,Vg)&&r[Vg][n]||(o.enumerable=!0),o}},pm=function(t){var e=Zg(wg(t)),r=[];return Yg(e,(function(t){pg(em,t)||pg(Mg,t)||r.push(t)})),r},vm=function(t){var e=t===Hg,r=Zg(e?rm:wg(t)),n=[];return Yg(r,(function(t){!pg(em,t)||e&&!pg(Hg,t)||n.push(em[t])})),n};(dg||(Pg((Kg=function(){if(this instanceof Kg)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?Tg(arguments[0]):void 0,e=Dg(t),r=function(t){this===Hg&&r.call(rm,t),pg(this,Vg)&&pg(this[Vg],e)&&(this[Vg][e]=!1),cm(this,e,Sg(1,t))};return lg&&um&&cm(Hg,e,{configurable:!0,set:r}),sm(e,t)}).prototype,"toString",(function(){return Wg(this).tag})),Pg(Kg,"withoutSetter",(function(t){return sm(Dg(t),t)})),Ig.f=dm,Rg.f=fm,jg.f=hm,Ag.f=_g.f=pm,Eg.f=vm,Fg.f=function(t){return sm(Bg(t),t)},lg&&(Xg(Kg.prototype,"description",{configurable:!0,get:function(){return Wg(this).description}}),Pg(Hg,"propertyIsEnumerable",dm,{unsafe:!0}))),cg({global:!0,wrap:!0,forced:!dg,sham:!dg},{Symbol:Kg}),Yg(Og(im),(function(t){zg(t)})),cg({target:Gg,stat:!0,forced:!dg},{for:function(t){var e=Tg(t);if(pg(nm,e))return nm[e];var r=Kg(e);return nm[e]=r,om[r]=e,r},keyFor:function(t){if(!gg(t))throw TypeError(t+" is not a symbol");if(pg(om,t))return om[t]},useSetter:function(){um=!0},useSimple:function(){um=!1}}),cg({target:"Object",stat:!0,forced:!dg,sham:!lg},{create:function(t,e){return void 0===e?kg(t):lm(kg(t),e)},defineProperty:fm,defineProperties:lm,getOwnPropertyDescriptor:hm}),cg({target:"Object",stat:!0,forced:!dg},{getOwnPropertyNames:pm,getOwnPropertySymbols:vm}),cg({target:"Object",stat:!0,forced:hg((function(){Eg.f(1)}))},{getOwnPropertySymbols:function(t){return Eg.f(bg(t))}}),Qg)&&cg({target:"JSON",stat:!0,forced:!dg||hg((function(){var t=Kg();return"[null]"!=Qg([t])||"{}"!=Qg({a:t})||"{}"!=Qg(Object(t))}))},{stringify:function(t,e,r){for(var n,o=[t],i=1;arguments.length>i;)o.push(arguments[i++]);if(n=e,(yg(e)||void 0!==t)&&!gg(t))return vg(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!gg(e))return e}),o[1]=e,Qg.apply(null,o)}});Kg.prototype[qg]||Cg(Kg.prototype,qg,Kg.prototype.valueOf),Ug(Kg,Gg),Mg[Vg]=!0;var ym=Ir,gm=l,mm=E,bm=f.f,wm=d,xm=gm((function(){bm(1)}));ym({target:"Object",stat:!0,forced:!wm||xm,sham:!wm},{getOwnPropertyDescriptor:function(t,e){return bm(mm(t),e)}});var Tm=fr,Sm=E,km=f,Om=Rn;function Am(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _m(t){return function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Am(Object(r),!0).forEach((function(e){a(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Am(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({loaderType:Hv,retry:0,retryDelay:0,timeout:0,request:null,onTimeout:void 0,onProgress:void 0,onRetryError:void 0,transformRequest:void 0,transformResponse:void 0,transformError:void 0,responseType:Jv,range:void 0,url:"",params:void 0,method:"GET",headers:{},body:void 0,mode:void 0,credentials:void 0,cache:void 0,redirect:void 0,referrer:void 0,referrerPolicy:void 0,integrity:void 0},t)}Ir({target:"Object",stat:!0,sham:!d},{getOwnPropertyDescriptors:function(t){for(var e,r,n=Sm(t),o=km.f,i=Tm(n),a={},u=0;i.length>u;)void 0!==(r=o(n,e=i[u++]))&&Om(a,e,r);return a}});var Em=d,jm=Ut.f,Rm=Function.prototype,Im=Rm.toString,Cm=/^\s*function ([^ (]*)/,Pm="name";Em&&!(Pm in Rm)&&jm(Rm,Pm,{configurable:!0,get:function(){try{return Im.call(this).match(Cm)[1]}catch(t){return""}}});var Lm=function(t){var e,r,n,o,i,a,u=Pa(t),c="function"==typeof this?this:Array,s=arguments.length,f=s>1?arguments[1]:void 0,l=void 0!==f,d=Fa(u),h=0;if(l&&(f=Ca(f,s>2?arguments[2]:void 0,2)),null==d||c==Array&&Ma(d))for(r=new c(e=Da(u.length));e>h;h++)a=l?f(u[h],h):u[h],Ba(r,h,a);else for(i=(o=d.call(u)).next,r=new c;!(n=i.call(o)).done;h++)a=l?La(o,f,[n.value,h],!0):n.value,Ba(r,h,a);return r.length=h,r};Ir({target:"Array",stat:!0,forced:!wu((function(t){Array.from(t)}))},{from:Lm});var Mm=Ir,Dm=d,Bm=s,Fm=it,zm=j,Um=Ut.f,Nm=vr,Ym=Bm.Symbol;if(Dm&&"function"==typeof Ym&&(!("description"in Ym.prototype)||void 0!==Ym().description)){var Vm={},Gm=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),e=this instanceof Gm?new Ym(t):void 0===t?Ym():Ym(t);return""===t&&(Vm[e]=!0),e};Nm(Gm,Ym);var qm=Gm.prototype=Ym.prototype;qm.constructor=Gm;var $m=qm.toString,Wm="Symbol(test)"==String(Ym("test")),Hm=/^Symbol\((.*)\)[^)]+$/;Um(qm,"description",{configurable:!0,get:function(){var t=zm(this)?this.valueOf():this,e=$m.call(t);if(Fm(Vm,t))return"";var r=Wm?e.slice(7,-1):e.replace(Hm,"$1");return""===r?void 0:r}}),Mm({global:!0,forced:!0},{Symbol:Gm})}ug("iterator");var Km=j,Qm=x,Jm=mt("match"),Xm=function(t){var e;return Km(t)&&(void 0!==(e=t[Jm])?!!e:"RegExp"==Qm(t))},Zm=cy,tb=Xm,eb=Yt,rb=O,nb=ku,ob=fy,ib=Ne,ab=Bi,ub=my,cb=af,sb=l,fb=Ls.UNSUPPORTED_Y,lb=[].push,db=Math.min,hb=4294967295;Zm("split",(function(t,e,r){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,r){var n=ab(rb(this)),o=void 0===r?hb:r>>>0;if(0===o)return[];if(void 0===t)return[n];if(!tb(t))return e.call(n,t,o);for(var i,a,u,c=[],s=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),f=0,l=new RegExp(t.source,s+"g");(i=cb.call(l,n))&&!((a=l.lastIndex)>f&&(c.push(n.slice(f,i.index)),i.length>1&&i.index<n.length&&lb.apply(c,i.slice(1)),u=i[0].length,f=a,c.length>=o));)l.lastIndex===i.index&&l.lastIndex++;return f===n.length?!u&&l.test("")||c.push(""):c.push(n.slice(f)),c.length>o?c.slice(0,o):c}:"0".split(void 0,0).length?function(t,r){return void 0===t&&0===r?[]:e.call(this,t,r)}:e,[function(e,r){var o=rb(this),i=null==e?void 0:e[t];return void 0!==i?i.call(e,o,r):n.call(ab(o),e,r)},function(t,o){var i=eb(this),a=ab(t),u=r(n,i,a,o,n!==e);if(u.done)return u.value;var c=nb(i,RegExp),s=i.unicode,f=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(fb?"g":"y"),l=new c(fb?"^(?:"+i.source+")":i,f),d=void 0===o?hb:o>>>0;if(0===d)return[];if(0===a.length)return null===ub(l,a)?[a]:[];for(var h=0,p=0,v=[];p<a.length;){l.lastIndex=fb?0:p;var y,g=ub(l,fb?a.slice(p):a);if(null===g||(y=db(ib(l.lastIndex+(fb?p:0)),a.length))===h)p=ob(a,p,s);else{if(v.push(a.slice(h,p)),v.length===d)return v;for(var m=1;m<=g.length-1;m++)if(v.push(g[m]),v.length===d)return v;p=h=y}}return v.push(a.slice(h)),v}]}),!!sb((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var r="ab".split(t);return 2!==r.length||"a"!==r[0]||"b"!==r[1]})),fb);var pb="\t\n\v\f\r \u2028\u2029\ufeff",vb=O,yb=Bi,gb="[\t\n\v\f\r \u2028\u2029\ufeff]",mb=RegExp("^"+gb+gb+"*"),bb=RegExp(gb+gb+"*$"),wb=function(t){return function(e){var r=yb(vb(e));return 1&t&&(r=r.replace(mb,"")),2&t&&(r=r.replace(bb,"")),r}},xb={start:wb(1),end:wb(2),trim:wb(3)},Tb=l,Sb=pb,kb=xb.trim;function Ob(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Ab(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ab(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Ab(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}Ir({target:"String",proto:!0,forced:function(t){return Tb((function(){return!!Sb[t]()||"
"!="
"[t]()||Sb[t].name!==t}))}("trim")},{trim:function(){return kb(this)}});var _b=function(){function t(){n(this,t),a(this,"_xhr",null),a(this,"_aborted",!1),a(this,"_timeoutTimer",null)}return i(t,[{key:"load",value:function(t){var e=this;clearTimeout(this._timeoutTimer);var r=t.url,n=t.params,o=t.timeout,i=t.responseType,a=t.onTimeout,u=t.transformResponse,c=t.onProgress,s=t.method,f=t.credentials,l=t.body,d=t.headers,h=t.range,p=t.request,v=!1;r=Wy(r,n);var y=Date.now();return new Promise((function(t,n){var g=e._xhr=new XMLHttpRequest;g.open(s||"GET",r,!0),g.responseType=i,g.withCredentials="include"===f||"same-origin"===f;var m=qy(h);m&&((d=d||{}).Range=m),d&&Object.keys(d).forEach((function(t){g.setRequestHeader(t,d[t])})),o&&(e._timeoutTimer=setTimeout((function(){if(v=!0,e.cancel(),a){var t=new ty(r,p);t.isTimeout=!0,a(t)}}),o)),g.onerror=function(t){return n(t)},g.onreadystatechange=function(){if(g.readyState>=2){clearTimeout(e._timeoutTimer);var o=Date.now();if(4===g.readyState){if(g.onreadystatechange=null,e._aborted)return;var i=g.status,a={ok:i>=200&&i<300,status:i,statusText:g.statusText,url:g.responseURL,headers:e._getHeaders(g),body:g.response};if(u&&(a=u(a,r)||a),!a.ok)return n(new ty(r,p,a,"bad network response"));var s=g.responseType===Qv,f=s?new Uint8Array(g.response):g.response;c&&c(s?f:void 0,!0,{startTime:y,endTime:Date.now()},a),t(Hy(f,a,a.headers["content-length"],a.headers.age,y,o))}}},g.send(l)})).catch((function(t){if(clearTimeout(e._timeoutTimer),!e._aborted||v)throw(t=t instanceof ty?t:new ty(r,p)).startTime=y,t.endTime=Date.now(),t.isTimeout=v,t}))}},{key:"cancel",value:function(){if(!this._aborted)return this._aborted=!0,this._xhr?this._xhr.cancel():void 0}},{key:"_getHeaders",value:function(t){var e,r={},n=Ob(t.getAllResponseHeaders().trim().split("\r\n"));try{for(n.s();!(e=n.n()).done;){var o=e.value.split(": ");r[o[0].toLowerCase()]=o.slice(1).join(": ")}}catch(t){n.e(t)}finally{n.f()}return r}}],[{key:"isSupported",value:function(){return"undefined"!=typeof XMLHttpRequest}}]),t}(),Eb=["retry","retryDelay","onRetryError","transformError"],jb=function(){function t(e,r){n(this,t),this.promise=function(){var t,e,r=new Promise((function(r,n){t=r,e=n}));return r.used=!1,r.resolve=function(){return r.used=!0,t.apply(void 0,arguments)},r.reject=function(){return r.used=!0,e.apply(void 0,arguments)},r}(),this.alive=!!r.onProgress,this._loaderType=e,this._loader=e===Hv?new Ky:new _b,this._config=r,this._retryCount=0,this._retryTimer=null,this._canceled=!1}var o;return i(t,[{key:"exec",value:function(){var t=this,n=this._config,o=n.retry,i=n.retryDelay,a=n.onRetryError,u=n.transformError,c=r(n,Eb),s=function(){var r=e(Hn.mark((function e(){var r,n;return Hn.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t._loader.load(c);case 3:r=e.sent,t.promise.resolve(r),e.next=22;break;case 7:if(e.prev=7,e.t0=e.catch(0),!t._canceled){e.next=11;break}return e.abrupt("return");case 11:if(e.t0.loaderType=t._loaderType,e.t0.retryCount=t._retryCount,n=e.t0,u&&(n=u(n)||n),a&&t._retryCount>0&&a(n,t._retryCount,o),t._retryCount++,!(t._retryCount<=o)){e.next=21;break}return clearTimeout(t._retryTimer),t._retryTimer=setTimeout(s,i),e.abrupt("return");case 21:t.promise.reject(n);case 22:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(){return r.apply(this,arguments)}}();return s(),this.promise}},{key:"cancel",value:(o=e(Hn.mark((function t(){return Hn.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return clearTimeout(this._retryTimer),this._canceled=!0,t.abrupt("return",this._loader.cancel());case 3:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})}]),t}(),Rb=function(){function t(e){n(this,t),a(this,"type",Hv),a(this,"_queue",[]),a(this,"_alive",[]),a(this,"_currentTask",null),this._config=_m(e),this._config.loaderType!==Kv&&Ky.isSupported()||(this.type=Kv)}return i(t,[{key:"isFetch",value:function(){return this.type===Hv}},{key:"load",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"!=typeof t&&t?e=t:e.url=t||e.url||this._config.url,(e=Object.assign({},this._config,e)).params&&(e.params=Object.assign({},e.params)),e.headers&&Gy(e.headers)&&(e.headers=Object.assign({},e.headers)),e.body&&Gy(e.body)&&(e.body=Object.assign({},e.body)),e.transformRequest&&(e=e.transformRequest(e)||e);var r=new jb(this.type,e);return this._queue.push(r),1===this._queue.length&&this._processTask(),r.promise}},{key:"cancel",value:function(){var t=this._queue.map((function(t){return t.cancel()})).concat(this._alive.map((function(t){return t.cancel()})));return this._currentTask&&t.push(this._currentTask.cancel()),this._queue=[],this._alive=[],Promise.all(t)}},{key:"_processTask",value:function(){var t=this;this._currentTask=this._queue.shift(),this._currentTask&&(this._currentTask.alive&&this._alive.push(this._currentTask),this._currentTask.exec().finally((function(){t._processTask()})))}}],[{key:"isFetchSupport",value:function(){return Ky.isSupported()}}]),t}();function Ib(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];e=e.filter(Boolean);var n=new Uint8Array(e.reduce((function(t,e){return t+e.byteLength}),0)),o=0;return e.forEach((function(t){n.set(t,o),o+=t.byteLength})),n}var Cb=Qe.includes,Pb=xn;Ir({target:"Array",proto:!0},{includes:function(t){return Cb(this,t,arguments.length>1?arguments[1]:void 0)}}),Pb("includes");var Lb=Xm,Mb=mt("match"),Db=function(t){if(Lb(t))throw TypeError("The method doesn't accept regular expressions");return t},Bb=O,Fb=Bi;Ir({target:"String",proto:!0,forced:!function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[Mb]=!1,"/./"[t](e)}catch(t){}}return!1}("includes")},{includes:function(t){return!!~Fb(Bb(this)).indexOf(Fb(Db(t)),arguments.length>1?arguments[1]:void 0)}});var zb="hevc",Ub=Jt.exports,Nb=Yt,Yb=Bi,Vb=l,Gb=Ps,qb="toString",$b=RegExp.prototype,Wb=$b.toString,Hb=Vb((function(){return"/a/b"!=Wb.call({source:"a",flags:"b"})})),Kb=Wb.name!=qb;(Hb||Kb)&&Ub(RegExp.prototype,qb,(function(){var t=Nb(this),e=Yb(t.source),r=t.flags;return"/"+e+"/"+Yb(void 0===r&&t instanceof RegExp&&!("flags"in $b)?Gb.call(t):r)}),{unsafe:!0});var Qb="undefined"!=typeof window,Jb=Qb&&navigator.userAgent.toLocaleLowerCase();Qb&&/^((?!chrome|android).)*safari/.test(Jb);var Xb=Qb&&Jb.includes("firefox"),Zb=Qb&&Jb.includes("android"),tw=Math.pow(2,32);function ew(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(t[e]<<8)+(t[e+1]||0)}function rw(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(t[e]<<24>>>0)+(t[e+1]<<16)+(t[e+2]<<8)+(t[e+3]||0)}function nw(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return rw(t,e)*tw+rw(t,e+4)}var ow=function(){function t(){n(this,t)}return i(t,null,[{key:"getRateIndexByRate",value:function(e){return t.FREQ.indexOf(e)}},{key:"parseADTS",value:function(e,r){for(var n=e.length,o=0;o+2<n&&(255!==e[o]||240!=(246&e[o+1]));)o++;if(!(o>=n)){var i=o,a=[],u=(60&e[o+2])>>>2,c=t.FREQ[u];if(!c)throw new Error("Invalid sampling index: ".concat(u));for(var s,f,l=1+((192&e[o+2])>>>6),d=(1&e[o+2])<<2|(192&e[o+3])>>>6,h=t._getConfig(u,d,l),p=h.config,v=h.codec,y=0,g=t.getFrameDuration(c);o+7<n;)if(255===e[o]&&240==(246&e[o+1])){if(n-o<(f=(3&e[o+3])<<11|e[o+4]<<3|(224&e[o+5])>>5))break;s=2*(1&~e[o+1]),a.push({pts:r+y*g,data:e.subarray(o+7+s,o+f)}),y++,o+=f}else o++;return{skip:i,remaining:o>=n?void 0:e.subarray(o),frames:a,samplingFrequencyIndex:u,sampleRate:c,objectType:l,channelCount:d,codec:v,config:p,originCodec:"mp4a.40.".concat(l)}}}},{key:"parseAudioSpecificConfig",value:function(e){if(e.length){var r=e[0]>>>3,n=(7&e[0])<<1|e[1]>>>7,o=(120&e[1])>>>3,i=t.FREQ[n];if(!i)throw new Error("Invalid sampling index: ".concat(n));var a=t._getConfig(n,o,r);return{samplingFrequencyIndex:n,sampleRate:i,objectType:r,channelCount:o,config:a.config,codec:a.codec,originCodec:"mp4a.40.".concat(r)}}}},{key:"getFrameDuration",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4;return 1024*e/t}},{key:"_getConfig",value:function(t,e,r){var n,o,i=[];return Xb?t>=6?(n=5,o=t-3):(n=2,o=t):Zb?(n=2,o=t):(n=r,o=t,t>=6?o=t-3:1===e&&(n=2,o=t)),i[0]=n<<3,i[0]|=(14&t)>>1,i[1]=(1&t)<<7,i[1]|=e<<3,5===n&&(i[1]|=(14&o)>>1,i[2]=(1&o)<<7,i[2]|=8,i[3]=0),{config:i,codec:"mp4a.40.".concat(n)}}},{key:"getSilentFrame",value:function(t,e){switch(t){case"mp4a.40.2":if(1===e)return new Uint8Array([0,200,0,128,35,128]);if(2===e)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(1===e)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}}}]),t}();function iw(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function aw(t){return function(t){if(Array.isArray(t))return iw(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return iw(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?iw(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}a(ow,"FREQ",[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350]);var uw=Fe,cw=Bi,sw=O,fw=Ne,lw=Bi,dw=function(t){var e=cw(sw(this)),r="",n=uw(t);if(n<0||n==1/0)throw RangeError("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(e+=e))1&n&&(r+=e);return r},hw=O,pw=Math.ceil,vw=function(t){return function(e,r,n){var o,i,a=lw(hw(e)),u=a.length,c=void 0===n?" ":lw(n),s=fw(r);return s<=u||""==c?a:(o=s-u,(i=dw.call(c,pw(o/c.length))).length>o&&(i=i.slice(0,o)),t?a+i:i+a)}},yw={start:vw(!1),end:vw(!0)},gw=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(P),mw=yw.start;Ir({target:"String",proto:!0,forced:gw},{padStart:function(t){return mw(this,t,arguments.length>1?arguments[1]:void 0)}});var bw=Ut,ww=Ps;d&&l((function(){return"sy"!==Object.getOwnPropertyDescriptor(RegExp.prototype,"flags").get.call({dotAll:!0,sticky:!0})}))&&bw.f(RegExp.prototype,"flags",{configurable:!0,get:ww});var xw=function(){function t(){n(this,t)}return i(t,null,[{key:"findBox",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=[];if(!e)return o;for(var i=0,a="",u=0;e.length>7;){if(i=rw(e),a=String.fromCharCode.apply(null,e.subarray(4,8)),u=8,1===i?(i=nw(e,8),u+=8):i||(i=e.length),!r[0]||a===r[0]){var c=e.subarray(0,i);if(!(r.length<2))return t.findBox(c.subarray(u),r.slice(1),n+u);o.push({start:n,size:i,headerSize:u,type:a,data:c})}n+=i,e=e.subarray(i)}return o}},{key:"moov",value:function(e){return kw(e,!1,(function(e,r,n){e.mvhd=t.mvhd(t.findBox(r,["mvhd"],n)[0]),e.trak=t.findBox(r,["trak"],n).map((function(e){return t.trak(e)}))}))}},{key:"mvhd",value:function(t){return kw(t,!0,(function(t,e){var r=0;1===t.version?(t.timescale=rw(e,16),t.duration=nw(e,20),r+=28):(t.timescale=rw(e,8),t.duration=rw(e,12),r+=16),t.nextTrackId=rw(e,r+76)}))}},{key:"trak",value:function(e){return kw(e,!1,(function(e,r,n){e.tkhd=t.tkhd(t.findBox(r,["tkhd"],n)[0]),e.mdia=t.mdia(t.findBox(r,["mdia"],n)[0])}))}},{key:"tkhd",value:function(t){return kw(t,!0,(function(t,e){var r=0;1===t.version?(t.trackId=rw(e,16),t.duration=nw(e,24),r+=32):(t.trackId=rw(e,8),t.duration=rw(e,16),r+=20),t.width=rw(e,r+52),t.height=rw(e,r+56)}))}},{key:"mdia",value:function(e){return kw(e,!1,(function(e,r,n){e.mdhd=t.mdhd(t.findBox(r,["mdhd"],n)[0]),e.hdlr=t.hdlr(t.findBox(r,["hdlr"],n)[0]),e.minf=t.minf(t.findBox(r,["minf"],n)[0])}))}},{key:"mdhd",value:function(t){return kw(t,!0,(function(t,e){var r=0;1===t.version?(t.timescale=rw(e,16),t.duration=nw(e,20),r+=28):(t.timescale=rw(e,8),t.duration=rw(e,12),r+=16);var n=ew(e,r);t.language=String.fromCharCode(96+(n>>10&31),96+(n>>5&31),96+(31&n))}))}},{key:"hdlr",value:function(t){return kw(t,!0,(function(t,e){0===t.version&&(t.handlerType=String.fromCharCode.apply(null,e.subarray(4,8)))}))}},{key:"minf",value:function(e){return kw(e,!1,(function(e,r,n){e.vmhd=t.vmhd(t.findBox(r,["vmhd"],n)[0]),e.smhd=t.smhd(t.findBox(r,["smhd"],n)[0]),e.stbl=t.stbl(t.findBox(r,["stbl"],n)[0])}))}},{key:"vmhd",value:function(t){return kw(t,!0,(function(t,e){t.graphicsmode=ew(e),t.opcolor=[ew(e,2),ew(e,4),ew(e,6)]}))}},{key:"smhd",value:function(t){return kw(t,!0,(function(t,e){t.balance=ew(e)}))}},{key:"stbl",value:function(e){return kw(e,!1,(function(e,r,n){e.stsd=t.stsd(t.findBox(r,["stsd"],n)[0]),e.stts=t.stts(t.findBox(r,["stts"],n)[0]),e.ctts=t.ctts(t.findBox(r,["ctts"],n)[0]),e.stsc=t.stsc(t.findBox(r,["stsc"],n)[0]),e.stsz=t.stsz(t.findBox(r,["stsz"],n)[0]),e.stco=t.stco(t.findBox(r,["stco"],n)[0]),e.stss=t.stss(t.findBox(r,["stss"],n)[0])}))}},{key:"stsd",value:function(e){return kw(e,!0,(function(e,r,n){e.entryCount=rw(r),e.entries=t.findBox(r.subarray(4),[],n+4).map((function(e){switch(e.type){case"avc1":case"avc2":case"avc3":case"avc4":return t.avc1(e);case"hvc1":case"hev1":return t.hvc1(e);case"mp4a":return t.mp4a(e)}})).filter(Boolean)}))}},{key:"avc1",value:function(e){return kw(e,!1,(function(e,r,n){var o=Sw(e,r),i=r.subarray(o);n+=o,e.avcC=t.avcC(t.findBox(i,["avcC"],n)[0]),e.pasp=t.pasp(t.findBox(i,["pasp"],n)[0])}))}},{key:"avcC",value:function(t){return kw(t,!1,(function(t,e){t.configurationVersion=e[0],t.AVCProfileIndication=e[1],t.profileCompatibility=e[2],t.AVCLevelIndication=e[3],t.codec=function(t){for(var e,r="avc1.",n=0;n<3;n++)(e=t[n].toString(16)).length<2&&(e="0".concat(e)),r+=e;return r}([e[1],e[2],e[3]]),t.lengthSizeMinusOne=3&e[4],t.spsLength=31&e[5],t.sps=[];for(var r=6,n=0;n<t.spsLength;n++){var o=ew(e,r);r+=2,t.sps.push(e.subarray(r,r+o)),r+=o}t.ppsLength=e[r],r+=1,t.pps=[];for(var i=0;i<t.ppsLength;i++){var a=ew(e,r);r+=2,t.pps.push(e.subarray(r,r+=a)),r+=a}}))}},{key:"hvc1",value:function(e){return kw(e,!1,(function(e,r,n){var o=Sw(e,r),i=r.subarray(o);n+=o,e.hvcC=t.hvcC(t.findBox(i,["hvcC"],n)[0]),e.pasp=t.pasp(t.findBox(i,["pasp"],n)[0])}))}},{key:"hvcC",value:function(t){return kw(t,!1,(function(e,r){e.data=t.data,e.codec="hev1.1.6.L93.B0",e.configurationVersion=r[0];var n=r[1];e.generalProfileSpace=n>>6,e.generalTierFlag=(32&n)>>5,e.generalProfileIdc=31&n,e.generalProfileCompatibility=rw(r,2),e.generalConstraintIndicatorFlags=r.subarray(6,12),e.generalLevelIdc=r[12],e.avgFrameRate=ew(r,19),e.numOfArrays=r[22],e.vps=[],e.sps=[],e.pps=[];for(var o=23,i=0,a=0,u=0,c=0;c<e.numOfArrays;c++){i=63&r[o],a=ew(r,o+1),o+=3;for(var s,f=[],l=0;l<a;l++)u=ew(r,o),o+=2,f.push(r.subarray(o,o+u)),o+=u;if(32===i)(s=e.vps).push.apply(s,f);else if(33===i){var d;(d=e.sps).push.apply(d,f)}else if(34===i){var h;(h=e.pps).push.apply(h,f)}}}))}},{key:"pasp",value:function(t){return kw(t,!1,(function(t,e){t.hSpacing=rw(e),t.vSpacing=rw(e,4)}))}},{key:"mp4a",value:function(e){return kw(e,!1,(function(e,r,n){var o=function(t,e){return t.dataReferenceIndex=ew(e,6),t.channelCount=ew(e,16),t.sampleSize=ew(e,18),t.sampleRate=rw(e,24)/65536,28}(e,r);e.esds=t.esds(t.findBox(r.subarray(o),["esds"],n+o)[0])}))}},{key:"esds",value:function(t){return kw(t,!0,(function(t,e){t.codec="mp4a.";for(var r=0,n=0,o=0,i=0;e.length;){for(i=e[r=0],n=e[r+1],r+=2;128&n;)o=(127&n)<<7,n=e[r],r+=1;if(o+=127&n,3===i)e=e.subarray(r+3);else{if(4!==i){if(5===i){var a=t.config=e.subarray(r,r+o),u=(248&a[0])>>3;return 31===u&&a.length>=2&&(u=32+((7&a[0])<<3)+((224&a[1])>>5)),t.objectType=u,void(t.codec+=u.toString(16))}return}t.codec+=(e[r].toString(16)+".").padStart(3,"0"),e=e.subarray(r+13)}}}))}},{key:"stts",value:function(t){return kw(t,!0,(function(t,e){for(var r=rw(e),n=[],o=4,i=0;i<r;i++)n.push({count:rw(e,o),delta:rw(e,o+4)}),o+=8;t.entryCount=r,t.entries=n}))}},{key:"ctts",value:function(t){return kw(t,!0,(function(t,e){var r=rw(e),n=[],o=4;if(1===t.version)for(var i=0;i<r;i++)n.push({count:rw(e,o),offset:rw(e,o+4)}),o+=8;else for(var a=0;a<r;a++)n.push({count:rw(e,o),offset:-(1+~rw(e,o+4))}),o+=8;t.entryCount=r,t.entries=n}))}},{key:"stsc",value:function(t){return kw(t,!0,(function(t,e){for(var r=rw(e),n=[],o=4,i=0;i<r;i++)n.push({firstChunk:rw(e,o),samplesPerChunk:rw(e,o+4),sampleDescriptionIndex:rw(e,o+8)}),o+=12;t.entryCount=r,t.entries=n}))}},{key:"stsz",value:function(t){return kw(t,!0,(function(t,e){var r=rw(e),n=rw(e,4),o=[];if(!r)for(var i=8,a=0;a<n;a++)o.push(rw(e,i)),i+=4;t.sampleSize=r,t.sampleCount=n,t.entrySizes=o}))}},{key:"stco",value:function(t){return kw(t,!0,(function(t,e){for(var r=rw(e),n=[],o=4,i=0;i<r;i++)n.push(rw(e,o)),o+=4;t.entryCount=r,t.entries=n}))}},{key:"stss",value:function(t){return kw(t,!0,(function(t,e){for(var r=rw(e),n=[],o=4,i=0;i<r;i++)n.push(rw(e,o)),o+=4;t.entryCount=r,t.entries=n}))}},{key:"moovToTrack",value:function(t,e,r){var n=t.trak;if(n&&n.length){var o=n.find((function(t){var e,r;return"vide"===(null===(e=t.mdia)||void 0===e||null===(r=e.hdlr)||void 0===r?void 0:r.handlerType)})),i=n.find((function(t){var e,r;return"soun"===(null===(e=t.mdia)||void 0===e||null===(r=e.hdlr)||void 0===r?void 0:r.handlerType)}));if(o&&e){var a=e;a.timescale=a.formatTimescale=o.mdia.mdhd.timescale,a.duration=o.mdia.mdhd.duration;var u=o.mdia.minf.stbl.stsd.entries[0];if(a.width=u.width,a.height=u.height,u.pasp&&(a.sarRatio=[u.pasp.hSpacing,u.pasp.vSpacing]),u.hvcC)a.codecType=zb,a.codec=u.hvcC.codec,a.vps=u.hvcC.vps,a.sps=u.hvcC.sps,a.pps=u.hvcC.pps,a.hvcC=u.hvcC.data;else{if(!u.avcC)throw new Error("unknown video stsd entry");a.codec=u.avcC.codec,a.sps=u.avcC.sps,a.pps=u.avcC.pps}a.present=!0}if(i&&r){var c,s,f=r;f.timescale=f.formatTimescale=i.mdia.mdhd.timescale,f.duration=i.mdia.mdhd.duration;var l=i.mdia.minf.stbl.stsd.entries[0];f.sampleSize=l.sampleSize,f.sampleRate=l.sampleRate,f.channelCount=l.channelCount,f.sampleDuration=ow.getFrameDuration(f.sampleRate,f.timescale),f.objectType=(null===(c=l.esds)||void 0===c?void 0:c.objectType)||2,l.esds&&(f.config=Array.from(l.esds.config)),f.codec=(null===(s=l.esds)||void 0===s?void 0:s.codec)||"mp4a.40.2",f.sampleRateIndex=ow.getRateIndexByRate(f.sampleRate),f.present=!0}return{videoTrack:e,audioTrack:r}}}},{key:"moovToSamples",value:function(t){var e=t.trak;if(e&&e.length){var r=e.find((function(t){var e,r;return"vide"===(null===(e=t.mdia)||void 0===e||null===(r=e.hdlr)||void 0===r?void 0:r.handlerType)})),n=e.find((function(t){var e,r;return"soun"===(null===(e=t.mdia)||void 0===e||null===(r=e.hdlr)||void 0===r?void 0:r.handlerType)}));if(r||n){var o,i;if(r){var a,u,c=null===(a=r.mdia)||void 0===a||null===(u=a.minf)||void 0===u?void 0:u.stbl;if(!c)return;var s=c.stts,f=c.stsc,l=c.stsz,d=c.stco,h=c.stss,p=c.ctts;if(!(s&&f&&l&&d&&h))return;o=Tw(s,f,l,d,p,h)}if(n){var v,y,g,m=null===(v=n.mdia)||void 0===v||null===(y=v.minf)||void 0===y?void 0:y.stbl;if(!m)return;var b=null===(g=n.mdia.mdhd)||void 0===g?void 0:g.timescale,w=m.stts,x=m.stsc,T=m.stsz,S=m.stco;if(!(b&&w&&x&&T&&S))return;i=Tw(w,x,T,S)}return{videoSamples:o,audioSamples:i}}}}}]),t}();function Tw(t,e,r,n,o,i){var a,u,c,s=[],f=null==o?void 0:o.entries,l=e.entries,d=n.entries,h=r.entrySizes,p=null==i?void 0:i.entries;p&&(a={},p.forEach((function(t){a[t-1]=!0}))),f&&(u=[],f.forEach((function(t){for(var e=t.count,r=t.offset,n=0;n<e;n++)u.push(r)})));var v=-1,y=0,g=0,m=0,b=0,w=0,x=l[0].samplesPerChunk,T=l[1]?l[1].firstChunk-1:1/0;return t.entries.forEach((function(t){for(var e=t.count,n=t.delta,o=0;o<e;o++)c={dts:y,duration:n,size:h[g]||r.sampleSize,offset:d[m]+w,index:g},p&&(c.keyframe=a[g],c.keyframe&&v++,c.gopId=v),u&&u[g]&&(c.pts=c.dts+u[g]),s.push(c),y+=n,++g<x?w+=c.size:(m++,w=0,m>=T&&(b++,T=l[b+1]?l[b+1].firstChunk-1:1/0),x+=l[b].samplesPerChunk)})),s}function Sw(t,e){return t.dataReferenceIndex=ew(e,6),t.width=ew(e,24),t.height=ew(e,26),t.horizresolution=rw(e,28),t.vertresolution=rw(e,32),t.frameCount=ew(e,40),t.depth=ew(e,74),78}function kw(t,e,r){if(t){if(t.size!==t.data.length)throw new Error("box ".concat(t.type," size !== data.length"));var n={start:t.start,size:t.size,headerSize:t.headerSize,type:t.type};return e&&(n.version=t.data[t.headerSize],n.flags=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(t[e]<<16)+(t[e+1]<<8)+(t[e+2]||0)}(t.data,t.headerSize+1),n.headerSize+=4),r(n,t.data.subarray(n.headerSize),n.start+n.headerSize),n}}function Ow(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Aw(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ow(Object(r),!0).forEach((function(e){a(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ow(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var _w=function t(e,r){n(this,t),this.type="file",this.message=e,this.data=r},Ew=function(){function t(){n(this,t),a(this,"_data",Object.create(null))}return i(t,[{key:"set",value:function(t,e){this._data[t]=e}},{key:"get",value:function(t){return this._data[t]}},{key:"clear",value:function(){this._data=Object.create(null)}}]),t}();function jw(t,e){var r=t.trak;if(r&&r.length){var n=r.find((function(t){var e,r;return"vide"===(null===(e=t.mdia)||void 0===e||null===(r=e.hdlr)||void 0===r?void 0:r.handlerType)})),o=r.find((function(t){var e,r;return"soun"===(null===(e=t.mdia)||void 0===e||null===(r=e.hdlr)||void 0===r?void 0:r.handlerType)}));if(n||o){var i,a=[],u=[];if(n){var c,s,f,l=null===(c=n.mdia)||void 0===c||null===(s=c.minf)||void 0===s?void 0:s.stbl;if(!l)return;var d=null===(f=n.mdia.mdhd)||void 0===f?void 0:f.timescale,h=l.stts,p=l.stsc,v=l.stsz,y=l.stco,g=l.stss;if(!(d&&h&&p&&v&&y&&g))return;i=(a=Rw(e,d,h,p,v,y,g)).map((function(t){return t.endTime-t.startTime}))}if(o){var m,b,w,x=null===(m=o.mdia)||void 0===m||null===(b=m.minf)||void 0===b?void 0:b.stbl;if(!x)return;var T=null===(w=o.mdia.mdhd)||void 0===w?void 0:w.timescale,S=x.stts,k=x.stsc,O=x.stsz,A=x.stco;if(!(T&&S&&k&&O&&A))return;u=Rw(e,T,S,k,O,A,null,i)}return{videoSegments:a,audioSegments:u}}}}function Rw(t,e,r,n,o,i,a,u){var c,s,f,l=[],d=[],h=[],p=n.entries,v=i.entries,y=o.entrySizes,g=null==a?void 0:a.entries;g&&(c={},g.forEach((function(t){c[t-1]=!0})));var m=0,b=0,w=0,x=0,T=0,S=p[0].samplesPerChunk,k=p[1]?p[1].firstChunk-1:1/0;r.entries.forEach((function(t){var r=t.count,n=t.delta;f=n/e;for(var i=0;i<r;i++)s={startTime:m,duration:f,size:y[b]||o.sampleSize,offset:v[w]+T,index:b},g&&(s.keyframe=c[b],s.keyframe?(d.push([s]),h.push(s.duration)):(d[d.length-1].push(s),h[d.length-1]+=s.duration)),l.push(s),m+=f,++b<S?T+=s.size:(w++,T=0,w>=k&&(x++,k=p[x+1]?p[x+1].firstChunk-1:1/0),S+=p[x].samplesPerChunk)}));var O=l.length;if(O&&(!a||l[0].keyframe)){var A,_=[],E=[],j=0,R=function(){var t;A=E[E.length-1],_.push({index:_.length,startTime:(null===(t=_[_.length-1])||void 0===t?void 0:t.endTime)||E[0].startTime,endTime:A.startTime+A.duration,range:[E[0].offset,A.offset+A.size],frames:E}),j=0,E=[]};if(a)for(var I=0,C=0,P=d.length;C<P;C++){var L,M;if(j+=h[C],(L=E).push.apply(L,aw(d[C])),C+1<P){if((I=j+h[C+1])>=t)if(I-t<Math.abs(t-j))(M=E).push.apply(M,aw(d[C+1])),R(),C++;else R()}else R()}else for(var D=(u=u||[])[0]||t,B=0;B<O;B++)E.push(l[B]),j+=l[B].duration,(B+1>=O||j>=D)&&(R(),D=u[_.length]||t);return _}}function Iw(t){var e="",r="",n=0,o=0,i=0,a=0,u=0;t.mvhd&&(u=t.mvhd.duration/t.mvhd.timescale);var c=t.trak;if(c){var s,f,l,d,h,p,v,y,g,m=c.find((function(t){var e,r;return"vide"===(null===(e=t.mdia)||void 0===e||null===(r=e.hdlr)||void 0===r?void 0:r.handlerType)})),b=c.find((function(t){var e,r;return"soun"===(null===(e=t.mdia)||void 0===e||null===(r=e.hdlr)||void 0===r?void 0:r.handlerType)}));if(m)if(s=null===(f=m.mdia)||void 0===f||null===(l=f.minf)||void 0===l||null===(d=l.stbl)||void 0===d?void 0:d.stsd.entries[0])n=s.width,o=s.height,e=null===(h=s.avcC||s.hvcC)||void 0===h?void 0:h.codec;if(b)if(s=null===(p=b.mdia)||void 0===p||null===(v=p.minf)||void 0===v||null===(y=v.stbl)||void 0===y?void 0:y.stsd.entries[0])i=s.channelCount,a=s.sampleRate,r=null===(g=s.esds)||void 0===g?void 0:g.codec}return{videoCodec:e,audioCodec:r,width:n,height:o,audioChannelCount:i,audioSampleRate:a,duration:u,moov:t}}function Cw(t){return"number"==typeof t&&!isNaN(t)}var Pw=["vid","moovEnd","segmentDuration","cache","maxDownloadInfoSize"];return function(){function t(e){n(this,t),a(this,"vid",""),a(this,"url",""),a(this,"meta",{}),a(this,"downloadInfo",[]),a(this,"videoSegments",[]),a(this,"audioSegments",[]),a(this,"cache",null),a(this,"_currentSegmentIndex",-1),a(this,"_currentLoadingSegmentIndex",-1),a(this,"_transformError",(function(t){return t.type="network",t})),this._config=Aw(Aw({vid:"",moovEnd:8e3,segmentDuration:5,maxDownloadInfoSize:30,cache:null},e),{},{responseType:"arraybuffer"});var o=this._config,i=o.vid;o.moovEnd,o.segmentDuration;var u=o.cache;o.maxDownloadInfoSize;var c=r(o,Pw);this.cache=u||new Ew,this.vid=i||c.url,this.url=c.url,c.transformError=this._transformError,this._loader=new Rb(c)}var o,u,c,s,f,l,d,h,p,v;return i(t,[{key:"isMetaLoaded",get:function(){return this.videoSegments.length||this.audioSegments.length}},{key:"setCurrentSegment",value:function(t){Cw(t)&&(this._currentSegmentIndex=t)}},{key:"isLastSegment",value:function(t){var e,r;return!!Cw(t)&&t===((null===(e=this.videoSegments[this.videoSegments.length-1])||void 0===e?void 0:e.index)||(null===(r=this.audioSegments[this.audioSegments.length-1])||void 0===r?void 0:r.index)||0)}},{key:"isSegmentLoading",value:function(t){return t===this._currentLoadingSegmentIndex}},{key:"changeUrl",value:(v=e(Hn.mark((function t(e){var r,n,o=arguments;return Hn.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:e,n=o.length>2?o[2]:void 0,t.next=4,this.reset();case 4:e&&(this.url=e),r&&(this.vid=r),n&&(this._config.moovEnd=n);case 7:case"end":return t.stop()}}),t,this)}))),function(t){return v.apply(this,arguments)})},{key:"getOrLoadMeta",value:(p=e(Hn.mark((function t(e){return Hn.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.isMetaLoaded){t.next=3;break}return t.next=3,this.loadMeta(e);case 3:return t.abrupt("return",this.meta);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return p.apply(this,arguments)})},{key:"loadMeta",value:(h=e(Hn.mark((function t(e,r){var n,o,i,a,u,c,s,f,l;return Hn.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=[],t.next=3,this._loadData([0,r||this._config.moovEnd],e);case 3:if(o=t.sent){t.next=6;break}return t.abrupt("return");case 6:if(n.push(o),i=xw.findBox(o.data,["moov"])[0]){t.next=22;break}if(a=xw.findBox(o.data,["mdat"])[0]){t.next=12;break}throw new _w("cannot find moov or mdat box",o.data);case 12:return u=a.start+a.size,t.next=15,this._loadData([u],e);case 15:if(o=t.sent){t.next=18;break}return t.abrupt("return");case 18:if(n.push(o),i=xw.findBox(o.data,["moov"],u)[0]){t.next=22;break}throw new _w("cannot find moov box",o.data);case 22:if(!(i.size>i.data.length)){t.next=30;break}return t.next=25,this._loadData([o.data.length,i.start+i.size-1],e);case 25:if(o=t.sent){t.next=28;break}return t.abrupt("return");case 28:n.push(o),i.data=Ib(i.data,o.data);case 30:if(c=xw.moov(i)){t.next=33;break}throw new _w("cannot parse moov box",i.data);case 33:if(s=jw(c,this._config.segmentDuration)){t.next=36;break}throw new _w("cannot parse segments",i.data);case 36:return this.meta=Iw(c),f=s.videoSegments,l=s.audioSegments,this.videoSegments=f,this.audioSegments=l,t.abrupt("return",{meta:this.meta,videoSegments:f,audioSegments:l,responses:n});case 41:case"end":return t.stop()}}),t,this)}))),function(t,e){return h.apply(this,arguments)})},{key:"getSegmentByTime",value:function(t){var e,r;return this.videoSegments.length?(e=this.videoSegments.find((function(e){return e.startTime<=t&&e.endTime>t})))&&(r=this.audioSegments[e.index]):r=this.audioSegments.find((function(e){return e.startTime<=t&&e.endTime>t})),{video:e,audio:r}}},{key:"loadSegmentByTime",value:(d=e(Hn.mark((function t(e,r){var n,o,i,a,u=arguments;return Hn.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=!(u.length>2&&void 0!==u[2])||u[2],this.isMetaLoaded){t.next=4;break}return t.next=4,this.loadMeta(r);case 4:return o=this.getSegmentByTime(e),i=o.video,a=o.audio,t.abrupt("return",this._loadSegment(i,a,r,n));case 6:case"end":return t.stop()}}),t,this)}))),function(t,e){return d.apply(this,arguments)})},{key:"loadNextSegment",value:(l=e(Hn.mark((function t(e){var r,n,o,i=arguments;return Hn.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=!(i.length>1&&void 0!==i[1])||i[1],this.isMetaLoaded){t.next=4;break}return t.next=4,this.loadMeta();case 4:return n=this.videoSegments[this._currentSegmentIndex+1],o=this.audioSegments[this._currentSegmentIndex+1],t.abrupt("return",this._loadSegment(n,o,e,r));case 7:case"end":return t.stop()}}),t,this)}))),function(t){return l.apply(this,arguments)})},{key:"preload",value:(f=e(Hn.mark((function t(r){var n,o,i,a,u,c,s,f=this;return Hn.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.isMetaLoaded){t.next=3;break}return t.next=3,this.loadMeta(!0);case 3:if(r&&!(r<0)){t.next=5;break}return t.abrupt("return");case 5:if(n=this.getSegmentByTime(r),o=n.video,i=n.audio,a=Math.max((null==o?void 0:o.index)||0,(null==i?void 0:i.index)||0)){t.next=9;break}return t.abrupt("return");case 9:return u=this.videoSegments.slice(0,a),c=this.audioSegments.slice(0,a),s=function(){var t=e(Hn.mark((function t(e){return Hn.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e>a)){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,f._loadSegment(u[e],c[e],!0,!1);case 4:return t.next=6,s(e+1);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),t.next=14,s(0);case 14:case"end":return t.stop()}}),t,this)}))),function(t){return f.apply(this,arguments)})},{key:"cancel",value:function(){return this._loader.cancel()}},{key:"reset",value:(s=e(Hn.mark((function t(){return Hn.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._loader.cancel();case 2:this.vid=this.url="",this.meta={},this.downloadInfo=[],this.videoSegments=[],this.audioSegments=[],this._currentSegmentIndex=-1,this._currentLoadingSegmentIndex=-1;case 9:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"destroy",value:(c=e(Hn.mark((function t(){return Hn.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.cancel();case 2:this.cache.clear();case 3:case"end":return t.stop()}}),t,this)}))),function(){return c.apply(this,arguments)})},{key:"_loadSegment",value:(u=e(Hn.mark((function t(e,r,n,o){var i,a;return Hn.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e||r){t.next=2;break}return t.abrupt("return");case 2:return i=(null==e?void 0:e.index)||(null==r?void 0:r.index)||0,this._currentLoadingSegmentIndex=i,t.prev=4,t.next=7,this._loadData([Math.min((null==e?void 0:e.range[0])||1/0,(null==r?void 0:r.range[0])||1/0),Math.max((null==e?void 0:e.range[1])||0,(null==r?void 0:r.range[1])||0)],n);case 7:a=t.sent;case 8:return t.prev=8,this._currentLoadingSegmentIndex=-1,t.finish(8);case 11:if(a){t.next=13;break}return t.abrupt("return");case 13:return o&&(this._currentSegmentIndex=i),a.video=e,a.audio=r,t.abrupt("return",a);case 17:case"end":return t.stop()}}),t,this,[[4,,8,11]])}))),function(t,e,r,n){return u.apply(this,arguments)})},{key:"_loadData",value:(o=e(Hn.mark((function t(e,r){var n,o,i;return Hn.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this._getCacheKey(e),t.next=3,this.cache.get(n);case 3:if(o=t.sent){t.next=10;break}return t.next=7,this._loader.load(this.url,{range:e});case 7:i=t.sent,t.next=11;break;case 10:i={data:o,fromCache:!0};case 11:if(i){t.next=13;break}return t.abrupt("return");case 13:return o||(this.downloadInfo.push({startTime:i.startTime,endTime:i.endTime,size:i.data.byteLength,range:e}),this._addDownloadInfo>this._config.maxDownloadInfoSize&&(this._downloadInfos=this.downloadInfo.slice(-this._config.maxDownloadInfoSize))),!o&&r&&this.cache.set(n,i.data),i.range=e,t.abrupt("return",i);case 17:case"end":return t.stop()}}),t,this)}))),function(t,e){return o.apply(this,arguments)})},{key:"_getCacheKey",value:function(t){return(this.vid||this.url)+":"+t}}]),t}()}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("core-js/modules/es.array.find.js"),require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.array.slice.js"),require("core-js/modules/es.object.assign.js"),require("core-js/modules/es.promise.js"),require("core-js/modules/es.array.iterator.js"),require("core-js/modules/es.string.iterator.js"),require("core-js/modules/web.dom-collections.iterator.js"),require("core-js/modules/web.url.js"),require("core-js/modules/web.url-search-params.js"),require("core-js/modules/web.dom-collections.for-each.js"),require("core-js/modules/es.object.keys.js"),require("core-js/modules/es.array.splice.js"),require("core-js/modules/es.regexp.exec.js"),require("core-js/modules/es.function.name.js"),require("core-js/modules/es.array.concat.js"),require("core-js/modules/es.array.map.js"),require("core-js/modules/es.json.stringify.js"),require("core-js/modules/es.array.join.js"),require("core-js/modules/es.array.includes.js"),require("core-js/modules/es.promise.finally.js"),require("core-js/modules/es.array.filter.js"),require("core-js/modules/es.typed-array.uint8-array.js"),require("core-js/modules/esnext.typed-array.at.js"),require("core-js/modules/es.typed-array.copy-within.js"),require("core-js/modules/es.typed-array.every.js"),require("core-js/modules/es.typed-array.fill.js"),require("core-js/modules/es.typed-array.filter.js"),require("core-js/modules/es.typed-array.find.js"),require("core-js/modules/es.typed-array.find-index.js"),require("core-js/modules/esnext.typed-array.find-last.js"),require("core-js/modules/esnext.typed-array.find-last-index.js"),require("core-js/modules/es.typed-array.for-each.js"),require("core-js/modules/es.typed-array.includes.js"),require("core-js/modules/es.typed-array.index-of.js"),require("core-js/modules/es.typed-array.iterator.js"),require("core-js/modules/es.typed-array.join.js"),require("core-js/modules/es.typed-array.last-index-of.js"),require("core-js/modules/es.typed-array.map.js"),require("core-js/modules/es.typed-array.reduce.js"),require("core-js/modules/es.typed-array.reduce-right.js"),require("core-js/modules/es.typed-array.reverse.js"),require("core-js/modules/es.typed-array.set.js"),require("core-js/modules/es.typed-array.slice.js"),require("core-js/modules/es.typed-array.some.js"),require("core-js/modules/es.typed-array.sort.js"),require("core-js/modules/es.typed-array.subarray.js"),require("core-js/modules/es.typed-array.to-locale-string.js"),require("core-js/modules/es.typed-array.to-string.js"),require("core-js/modules/es.string.replace.js"),require("core-js/modules/es.number.is-nan.js"),require("core-js/modules/es.number.constructor.js"),require("core-js/modules/es.object.get-prototype-of.js"),require("core-js/modules/es.symbol.js"),require("core-js/modules/es.string.trim.js"),require("core-js/modules/es.set.js"),require("core-js/modules/es.string.includes.js"),require("core-js/modules/es.number.is-finite.js"),require("core-js/modules/es.regexp.to-string.js"),require("core-js/modules/es.regexp.test.js"),require("core-js/modules/es.regexp.flags.js"),require("core-js/modules/es.string.pad-start.js"),require("core-js/modules/es.array.from.js"),require("core-js/modules/es.array-buffer.constructor.js"),require("core-js/modules/es.typed-array.int8-array.js"),require("core-js/modules/es.typed-array.uint8-clamped-array.js"),require("core-js/modules/es.typed-array.int16-array.js"),require("core-js/modules/es.typed-array.uint16-array.js"),require("core-js/modules/es.typed-array.int32-array.js"),require("core-js/modules/es.typed-array.uint32-array.js"),require("core-js/modules/es.typed-array.float32-array.js"),require("core-js/modules/es.typed-array.float64-array.js")):"function"==typeof define&&define.amd?define(["core-js/modules/es.array.find.js","core-js/modules/es.object.to-string.js","core-js/modules/es.array.slice.js","core-js/modules/es.object.assign.js","core-js/modules/es.promise.js","core-js/modules/es.array.iterator.js","core-js/modules/es.string.iterator.js","core-js/modules/web.dom-collections.iterator.js","core-js/modules/web.url.js","core-js/modules/web.url-search-params.js","core-js/modules/web.dom-collections.for-each.js","core-js/modules/es.object.keys.js","core-js/modules/es.array.splice.js","core-js/modules/es.regexp.exec.js","core-js/modules/es.function.name.js","core-js/modules/es.array.concat.js","core-js/modules/es.array.map.js","core-js/modules/es.json.stringify.js","core-js/modules/es.array.join.js","core-js/modules/es.array.includes.js","core-js/modules/es.promise.finally.js","core-js/modules/es.array.filter.js","core-js/modules/es.typed-array.uint8-array.js","core-js/modules/esnext.typed-array.at.js","core-js/modules/es.typed-array.copy-within.js","core-js/modules/es.typed-array.every.js","core-js/modules/es.typed-array.fill.js","core-js/modules/es.typed-array.filter.js","core-js/modules/es.typed-array.find.js","core-js/modules/es.typed-array.find-index.js","core-js/modules/esnext.typed-array.find-last.js","core-js/modules/esnext.typed-array.find-last-index.js","core-js/modules/es.typed-array.for-each.js","core-js/modules/es.typed-array.includes.js","core-js/modules/es.typed-array.index-of.js","core-js/modules/es.typed-array.iterator.js","core-js/modules/es.typed-array.join.js","core-js/modules/es.typed-array.last-index-of.js","core-js/modules/es.typed-array.map.js","core-js/modules/es.typed-array.reduce.js","core-js/modules/es.typed-array.reduce-right.js","core-js/modules/es.typed-array.reverse.js","core-js/modules/es.typed-array.set.js","core-js/modules/es.typed-array.slice.js","core-js/modules/es.typed-array.some.js","core-js/modules/es.typed-array.sort.js","core-js/modules/es.typed-array.subarray.js","core-js/modules/es.typed-array.to-locale-string.js","core-js/modules/es.typed-array.to-string.js","core-js/modules/es.string.replace.js","core-js/modules/es.number.is-nan.js","core-js/modules/es.number.constructor.js","core-js/modules/es.object.get-prototype-of.js","core-js/modules/es.symbol.js","core-js/modules/es.string.trim.js","core-js/modules/es.set.js","core-js/modules/es.string.includes.js","core-js/modules/es.number.is-finite.js","core-js/modules/es.regexp.to-string.js","core-js/modules/es.regexp.test.js","core-js/modules/es.regexp.flags.js","core-js/modules/es.string.pad-start.js","core-js/modules/es.array.from.js","core-js/modules/es.array-buffer.constructor.js","core-js/modules/es.typed-array.int8-array.js","core-js/modules/es.typed-array.uint8-clamped-array.js","core-js/modules/es.typed-array.int16-array.js","core-js/modules/es.typed-array.uint16-array.js","core-js/modules/es.typed-array.int32-array.js","core-js/modules/es.typed-array.uint32-array.js","core-js/modules/es.typed-array.float32-array.js","core-js/modules/es.typed-array.float64-array.js"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).MP4Loader=t()}(this,(function(){"use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function t(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?e(Object(n),!0).forEach((function(e){c(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function r(){r=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",o=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(D){c=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var a=t&&t.prototype instanceof f?t:f,s=Object.create(a.prototype),o=new E(n||[]);return i(s,"_invoke",{value:x(e,r,o)}),s}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(D){return{type:"throw",arg:D}}}e.wrap=l;var h={};function f(){}function p(){}function v(){}var y={};c(y,s,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(T([])));g&&g!==t&&n.call(g,s)&&(y=g);var _=v.prototype=f.prototype=Object.create(y);function b(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function r(i,a,s,o){var u=d(e[i],e,a);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,s,o)}),(function(e){r("throw",e,s,o)})):t.resolve(l).then((function(e){c.value=e,s(c)}),(function(e){return r("throw",e,s,o)}))}o(u.arg)}var a;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return a=a?a.then(i,i):i()}})}function x(e,t,r){var n="suspendedStart";return function(i,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw a;return{value:void 0,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var o=w(s,r);if(o){if(o===h)continue;return o}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=d(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=d(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function T(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:A}}function A(){return{value:void 0,done:!0}}return p.prototype=v,i(_,"constructor",{value:v,configurable:!0}),i(v,"constructor",{value:p,configurable:!0}),p.displayName=c(v,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,c(e,u,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},b(k.prototype),c(k.prototype,o,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var s=new k(l(t,r,n,i),a);return e.isGeneratorFunction(r)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},b(_),c(_,u,"Generator"),c(_,s,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=T,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(j),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,n){return s.type="throw",s.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var o=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(o&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(o){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var s=a?a.completion:{};return s.type=e,s.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),j(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;j(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:T(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t,r,n,i,a,s){try{var o=e[a](s),u=o.value}catch(c){return void r(c)}o.done?t(u):Promise.resolve(u).then(n,i)}function a(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var s=e.apply(t,r);function o(e){i(s,n,a,o,u,"next",e)}function u(e){i(s,n,a,o,u,"throw",e)}o(void 0)}))}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,E(n.key),n)}}function u(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e,t,r){return(t=E(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(e,t){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function f(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function p(e,t,r){return(p=f()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&h(i,r.prototype),i}).apply(null,arguments)}function v(e){var t="function"==typeof Map?new Map:void 0;return v=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return p(e,arguments,d(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,e)},v(e)}function y(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return m(e)}function _(e){var t=f();return function(){var r,n=d(e);if(t){var i=d(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return g(this,r)}}function b(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=d(e)););return e}function k(){return k="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=b(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},k.apply(this,arguments)}function x(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a,s,o=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(o.push(n.value),o.length!==t);u=!0);}catch(l){c=!0,i=l}finally{try{if(!u&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return o}}(e,t)||S(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e){return function(e){if(Array.isArray(e))return j(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||S(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,t){if(e){if("string"==typeof e)return j(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?j(e,t):void 0}}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function E(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function T(){var e,t,r=new Promise((function(r,n){e=r,t=n}));return r.used=!1,r.resolve=function(){return r.used=!0,e.apply(void 0,arguments)},r.reject=function(){return r.used=!0,t.apply(void 0,arguments)},r}function A(){try{return parseInt(performance.now(),10)}catch(e){return(new Date).getTime()}}var D,O=function(){function e(){s(this,e)}return u(e,null,[{key:"start",value:function(e){return e&&e.length?1===e.length&&e.end(0)-e.start(0)<1e-6||1===e.length&&e.start(0)<0?0:e.start(0):0}},{key:"end",value:function(e){return e&&e.length?1===e.length&&e.end(0)-e.start(0)<1e-6?0:e.end(e.length-1):0}},{key:"get",value:function(e){if(e)try{return e.buffered}catch(t){}}},{key:"buffers",value:function(e,t){if(!e||!e.length)return[];for(var r=[],n=0,i=e.length;n<i;n++){var a=r.length;if(a&&t){var s=r[a-1],o=s[1];if(e.start(n)-o<=t){var u=e.end(n);u>o&&(s[1]=u)}else r.push([e.start(n),e.end(n)])}else r.push([e.start(n),e.end(n)])}return r}},{key:"totalLength",value:function(e){return e&&e.length?e.reduce((function(e,t){return e+(t[1]-t[0])}),0):0}},{key:"info",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!t||!t.length)return{start:0,end:0,buffers:[]};for(var i=0,a=0,s=0,o=0,u=0,c=0,l=0,d=e.buffers(t,n),h=0,f=d.length;h<f;h++){var p=d[h];if(r+n>=p[0]&&r<p[1])i=p[0],a=p[1],s=h;else{if(r+n<p[0]){o=p[0],u=p[1];break}r+n>p[1]&&(c=p[0],l=p[1])}}return{start:i,end:a,index:s,buffers:d,nextStart:o,nextEnd:u,prevStart:c,prevEnd:l,currentTime:r,behind:r-i,remaining:a?a-r:0,length:e.totalLength&&e.totalLength(d)}}}]),e}(),C="network",B="network_timeout",L="network_forbidden",R="network_range_not_satisfiable",P="demux",U="remux",I="media",M="drm",z="other",q="runtime",N={FLV:"FLV",HLS:"HLS",MP4:"MP4",FMP4:"FMP4",MSE_ADD_SB:"MSE_ADD_SB",MSE_APPEND_BUFFER:"MSE_APPEND_BUFFER",MSE_OTHER:"MSE_OTHER",MSE_FULL:"MSE_FULL",OPTION:"OPTION",DASH:"DASH",LICENSE:"LICENSE",CUSTOM_LICENSE:"CUSTOM_LICENSE",MSE_HIJACK:"MSE_HIJACK",EME_HIJACK:"EME_HIJACK",SIDX:"SIDX",NO_CANPLAY_ERROR:"NO_CANPLAY_ERROR",BUFFERBREAK_ERROR:"BUFFERBREAK_ERROR",MEDIA_ERR_ABORTED:"MEDIA_ERR_ABORTED",MEDIA_ERR_NETWORK:"MEDIA_ERR_NETWORK",MEDIA_ERR_DECODE:"MEDIA_ERR_DECODE",MEDIA_ERR_SRC_NOT_SUPPORTED:"MEDIA_ERR_SRC_NOT_SUPPORTED",MEDIA_ERR_CODEC_NOT_SUPPORTED:"MEDIA_ERR_CODEC_NOT_SUPPORTED",MEDIA_ERR_URL_EMPTY:"MEDIA_ERR_URL_EMPTY"},F=(c(D={},"manifest",{HLS:1100,DASH:1200}),c(D,C,2100),c(D,B,2101),c(D,L,2103),c(D,R,2116),c(D,P,{FLV:3100,HLS:3200,MP4:3300,FMP4:3400,SIDX:3410}),c(D,U,{FMP4:4100,MP4:4200}),c(D,I,{MEDIA_ERR_ABORTED:5101,MEDIA_ERR_NETWORK:5102,MEDIA_ERR_DECODE:5103,MEDIA_ERR_SRC_NOT_SUPPORTED:5104,MEDIA_ERR_CODEC_NOT_SUPPORTED:5105,MEDIA_ERR_URL_EMPTY:5106,MSE_ADD_SB:5200,MSE_APPEND_BUFFER:5201,MSE_OTHER:5202,MSE_FULL:5203,MSE_HIJACK:5204,EME_HIJACK:5301}),c(D,M,{LICENSE:7100,CUSTOM_LICENSE:7200}),c(D,z,8e3),c(D,q,{NO_CANPLAY_ERROR:9001,BUFFERBREAK_ERROR:9002}),D),V=function(e){l(r,e);var t=_(r);function r(e,n,i,a,o){var u;return s(this,r),(u=t.call(this,o||(null==i?void 0:i.message))).errorType=e===B?C:e,u.originError=i,u.ext=a,u.errorCode=F[e][n]||F[e],u.errorMessage=u.message,u.errorCode||(u.errorType=z,u.errorCode=F[u.errorType]),u}return u(r,null,[{key:"create",value:function(e,t,n,i,a){return e instanceof r?e:(e instanceof Error&&(n=e,e=""),e||(e=z),new r(e,t,n,i,a))}},{key:"network",value:function(e){var t;return new r(null!=e&&e.isTimeout?B:C,null,e instanceof Error?e:null,{url:null==e?void 0:e.url,response:null==e?void 0:e.response,httpCode:null==e||null===(t=e.response)||void 0===t?void 0:t.status})}}]),r}(v(Error)),G="undefined"!=typeof window,H={DEBUG:1,LOG:2,WARN:3,ERROR:4},K=["Boolean","Number","String","Undefined","Null","Date","Object"],Q=function(){function e(t,r){s(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]"),e.disabled=(null==r?void 0:r.disabled)||!0,this.logCacheLevel=(null==r?void 0:r.logCacheLevel)||3,this.logMaxSize=(null==r?void 0:r.logMaxSize)||204800,this.logSize=0,this.logTextArray=[]}return u(e,[{key:"debug",value:function(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];this.logCache.apply(this,[H.DEBUG].concat(n)),e.disabled||(t=console).debug.apply(t,[this._prefix,Y()].concat(n))}},{key:"log",value:function(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];this.logCache.apply(this,[H.LOG].concat(n)),e.disabled||(t=console).log.apply(t,[this._prefix,Y()].concat(n))}},{key:"warn",value:function(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];this.logCache.apply(this,[H.WARN].concat(n)),e.disabled||(t=console).warn.apply(t,[this._prefix,Y()].concat(n))}},{key:"error",value:function(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];this.logCache.apply(this,[H.ERROR].concat(n)),e.disabled||(t=console).error.apply(t,[this._prefix,Y()].concat(n))}},{key:"logCache",value:function(e){if(!(e<this.logCacheLevel)){var t="";try{for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];var a=n.map((function(e){return X(e)}));t=this._prefix+Y()+JSON.stringify(a)}catch(o){return}if(e>=this.logCacheLevel&&(this.logSize+=t.length,this.logTextArray.push(t)),this.logSize>this.logMaxSize){var s=this.logTextArray.shift();this.logSize-=s.length}}}},{key:"getLogCache",value:function(){var e=this.logTextArray.join("\n");return this.reset(),e}},{key:"reset",value:function(){this.logTextArray=[],this.logSize=0}},{key:"table",value:function(){var t;e.disabled||(console.group(this._prefix),(t=console).table.apply(t,arguments),console.groupEnd())}},{key:"setLogLevel",value:function(e){this.logCacheLevel=e}}],[{key:"enable",value:function(){e.disabled=!1}},{key:"disable",value:function(){e.disabled=!0}}]),e}();function Y(){return(new Date).toLocaleString()}function W(e){if("object"!==n(e))return e;var t=Object.prototype.toString.call(e).slice(8,-1);switch(t){case"Array":case"Uint8Array":case"ArrayBuffer":return t+"["+e.length+"]";case"Object":return"{}";default:return t}}function X(e,t,r){r||(r=1),t||(t=2);var i={};if(!e||"object"!==n(e))return e;var a=Object.prototype.toString.call(e).slice(8,-1);if(!K.includes(a))return a;if(!(r>t)){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r===t?i[s]=W(e[s]):"object"===n(e[s])?i[s]=X(e[s],t,r+1):i[s]=e[s]);return i}}c(Q,"disabled",!0);var J=function(){try{return G?window.MediaSource:null}catch(e){}}(),Z="appendBuffer",$="removeBuffer",ee=function(){function e(t,r){var n=this;s(this,e),c(this,"media",null),c(this,"mediaSource",null),c(this,"_openPromise",T()),c(this,"_queue",Object.create(null)),c(this,"_sourceBuffer",Object.create(null)),c(this,"_mseFullFlag",{}),c(this,"_st",0),c(this,"_opst",0),c(this,"_logger",null),c(this,"_config",null),c(this,"_url",null),c(this,"_onSBUpdateEnd",(function(e){var t=n._queue[e];if(t){var r=t.shift();if(r){var i=A()-n._opst;n._logger.debug("UpdateEnd",r.opName,i,r.context),r.promise.resolve({name:r.opName,context:r.context,costtime:i}),n._startQueue(e)}}})),c(this,"_onSBUpdateError",(function(e,t){var r=n._queue[e];if(r){var i=r[0];i&&(n._logger.error("UpdateError",e,i.opName,i.context),i.promise.reject(new V(I,N.MSE_APPEND_BUFFER,t)))}})),this._config=Object.assign(e.getDefaultConfig(),r),t&&this.bindMedia(t),this._logger=new Q("MSE"),this._config.openLog&&Q.enable()}var t,n,i;return u(e,[{key:"isOpened",get:function(){var e;return"open"===(null===(e=this.mediaSource)||void 0===e?void 0:e.readyState)}},{key:"url",get:function(){return this._url}},{key:"duration",get:function(){var e;return(null===(e=this.mediaSource)||void 0===e?void 0:e.duration)||-1}},{key:"isEnded",get:function(){return!!this.mediaSource&&"ended"===this.mediaSource.readyState}},{key:"isFull",value:function(t){return t?this._mseFullFlag[t]:this._mseFullFlag[e.VIDEO]}},{key:"updateDuration",value:function(e){var t=this;return this.mediaSource&&this.mediaSource.duration>e?Promise.resolve():this._enqueueBlockingOp((function(){t.isEnded?t._logger.debug("[debug mse] setDuration ended"):t.mediaSource&&(t.mediaSource.duration=e,t._logger.debug("[debug mse] setDuration"))}),"updateDuration")}},{key:"open",value:function(){var e=this;if(this._openPromise.used&&!this.isOpened&&this.mediaSource){var t=this.mediaSource;t.addEventListener("sourceopen",(function r(){var n=A()-e._st;e._logger.debug("MSE OPEN",n),t.removeEventListener("sourceopen",r),e._openPromise.resolve({costtime:n})})),this._openPromise=T()}return this._openPromise}},{key:"bindMedia",value:(i=a(r().mark((function e(t){var n,i,a=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mediaSource&&!this.media){e.next=3;break}return e.next=3,this.unbindMedia();case 3:if(t&&J){e.next=5;break}throw new Error("Param media or MediaSource does not exist");case 5:return this.media=t,n=this.mediaSource=new J,this._st=A(),i=function e(){var r=A()-a._st;a._logger.debug("MSE OPEN"),n.removeEventListener("sourceopen",e),URL.revokeObjectURL(t.src),a._openPromise.resolve({costtime:r})},n.addEventListener("sourceopen",i),this._url=URL.createObjectURL(n),t.src=this._url,e.abrupt("return",this._openPromise);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"unbindMedia",value:(n=a(r().mark((function e(){var t,n,i,a=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._openPromise.used||this._openPromise.resolve(),t=this.mediaSource){if(Object.keys(this._queue).forEach((function(e){var t=a._queue[e];t&&t.forEach((function(e){return e.promise.resolve}))})),n=!!this.media&&this.media.readyState>=1,i="open"===t.readyState,n&&i)try{t.endOfStream()}catch(r){}Object.keys(this._sourceBuffer).forEach((function(e){try{t.removeSourceBuffer(a._sourceBuffer[e])}catch(r){}}))}if(this.media){this.media.removeAttribute("src");try{this.media.load()}catch(r){}this.media=null}this.mediaSource=null,this._openPromise=T(),this._queue=Object.create(null),this._sourceBuffer=Object.create(null);case 8:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"createSource",value:function(e,t){if(!this._sourceBuffer[e]&&this.mediaSource){var r;try{r=this._sourceBuffer[e]=this.mediaSource.addSourceBuffer(t)}catch(n){throw new V(I,N.MSE_ADD_SB,n)}r.mimeType=t,r.addEventListener("updateend",this._onSBUpdateEnd.bind(this,e)),r.addEventListener("error",this._onSBUpdateError.bind(this,e))}}},{key:"changeType",value:function(e,t){var r=this,n=this._sourceBuffer[e];return this.mediaSource&&n&&n.mimeType!==t&&"function"==typeof n.changeType?this._enqueueOp(e,(function(){n.changeType(t),n.mimeType=t,r._onSBUpdateEnd(e)})):Promise.resolve()}},{key:"createOrChangeSource",value:function(e,t){return this.createSource(e,t),this.changeType(e,t)}},{key:"append",value:function(e,t,r){var n=this;return t&&t.byteLength&&this._sourceBuffer[e]?this._enqueueOp(e,(function(){var i;n.mediaSource&&(n._logger.debug("MSE APPEND START",r),n._opst=A(),null===(i=n._sourceBuffer[e])||void 0===i||i.appendBuffer(t))}),Z,r):Promise.resolve()}},{key:"remove",value:function(e,t,r,n){var i=this,a=!1;return this._mseFullFlag[e]&&(a=!0),this._enqueueOp(e,(function(){if(i.mediaSource){var a=i._sourceBuffer[e];t>=r||!a?i._onSBUpdateEnd(e):(i._opst=A(),i._logger.debug("MSE REMOVE START",e,t,r,n),a.remove(t,r))}}),$,n,a)}},{key:"clearBuffer",value:function(e,t){var r,n=this;return Object.keys(this._sourceBuffer).forEach((function(i){r=n._enqueueOp(i,(function(){if(n.mediaSource){var r=n._sourceBuffer[i];n._logger.debug("MSE clearBuffer START",i,e,t),r.remove(e,t)}}))})),r}},{key:"clearAllBuffer",value:function(){var e,t=this;return Object.keys(this._sourceBuffer).forEach((function(r){e=t._enqueueOp(r,(function(){if(t.mediaSource){var e=t._sourceBuffer[r];t._logger.debug("MSE clearAllBuffer START",r),e.remove(0,O.end(O.get(e)))}}))})),e}},{key:"clearOpQueues",value:function(e){var t;this._logger.debug("MSE clearOpQueue START");var r=this._queue[e];if(r&&r[e]&&!(r.length<5)){var n=[];r.forEach((function(e){e.context&&e.context.isinit&&n.push(e)})),this._queue[e]=r.slice(0,2),n.length>0&&(t=this._queue[e]).push.apply(t,n)}}},{key:"endOfStream",value:function(e){var t=this;return this.mediaSource&&"open"===this.mediaSource.readyState?this._enqueueBlockingOp((function(){var r=t.mediaSource;r&&"open"===r.readyState&&(t._logger.debug("MSE endOfStream START"),e?r.endOfStream(e):r.endOfStream())}),"endOfStream"):Promise.resolve()}},{key:"setLiveSeekableRange",value:function(e,t){var r=this.mediaSource;e<0||t<e||null==r||!r.setLiveSeekableRange||"open"!==r.readyState||r.setLiveSeekableRange(e,t)}},{key:"getSourceBuffer",value:function(e){return this._sourceBuffer[e]}},{key:"buffered",value:function(e){return O.get(this._sourceBuffer[e])}},{key:"bufferStart",value:function(e){return O.start(this.buffered(e))}},{key:"bufferEnd",value:function(e){return O.end(this.buffered(e))}},{key:"_enqueueOp",value:function(e,t,r,n,i){var a=this;if(!this.mediaSource)return Promise.resolve();var s=this._queue[e]=this._queue[e]||[],o={exec:t,promise:T(),opName:r,context:n};return i?(s.splice(0,0,o),this._mseFullFlag[e]=!1,this._startQueue(e)):s.push(o),this.isOpened?1===s.length&&this._startQueue(e):this._openPromise.then((function(){1===s.length&&a._startQueue(e)})),o.promise}},{key:"_enqueueBlockingOp",value:(t=a(r().mark((function e(t,n){var i,a,s=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mediaSource){e.next=2;break}return e.abrupt("return",Promise.resolve());case 2:if((i=Object.keys(this._sourceBuffer)).length){e.next=5;break}return e.abrupt("return",t());case 5:return a=[],i.forEach((function(e){var t=s._queue[e],r=T();a.push(r),t.push({exec:function(){return r.resolve()},promise:r,opName:n}),1===t.length&&s._startQueue(e)})),e.abrupt("return",Promise.all(a).then((function(){try{return t()}finally{i.forEach((function(e){var t=s._queue[e],r=s._sourceBuffer[e];null==t||t.shift(),r&&r.updating||s._startQueue(e)}))}})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})},{key:"_startQueue",value:function(e){var t=this._queue[e];if(t){var r=t[0];if(r&&!this._mseFullFlag[e])try{r.exec()}catch(n){n&&n.message&&n.message.indexOf("SourceBuffer is full")>=0?(this._mseFullFlag[e]=!0,this._logger.error("[MSE error], context,",r.context," ,name,",r.opName,",err,SourceBuffer is full"),r.promise.reject(new V(I,N.MSE_FULL,n))):(this._logger.error(n),r.promise.reject(new V(I,N.MSE_OTHER,n)),t.shift(),this._startQueue(e))}}}},{key:"setTimeoffset",value:function(e,t,r){var n=this;return this._enqueueOp(e,(function(){t<0&&(t+=.001),n._sourceBuffer[e].timestampOffset=t,n._onSBUpdateEnd(e)}),"setTimeoffset",r)}},{key:"abort",value:function(e,t){var r=this;return this.isOpened?this._enqueueOp(e,(function(){r._sourceBuffer[e].abort(),r._onSBUpdateEnd(e)}),"abort",t):Promise.resolve()}}],[{key:"getDefaultConfig",value:function(){return{openLog:!1}}},{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'video/mp4; codecs="avc1.42E01E,mp4a.40.2"';if(!J)return!1;try{return J.isTypeSupported(e)}catch(t){return this._logger.error(e,t),!1}}}]),e}();c(ee,"VIDEO","video"),c(ee,"AUDIO","audio");var te="fetch",re="xhr",ne="arraybuffer",ie="text",ae="json",se=function(e){l(r,e);var t=_(r);function r(e,n,i,a){var o;return s(this,r),c(m(o=t.call(this,a)),"retryCount",0),c(m(o),"isTimeout",!1),c(m(o),"loaderType",te),c(m(o),"startTime",0),c(m(o),"endTime",0),c(m(o),"options",{}),o.url=e,o.request=n,o.response=i,o}return u(r)}(v(Error)),oe=Object.prototype.toString;function ue(e){if("[object Object]"!==oe.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function ce(e){if(e&&null!==e[0]&&void 0!==e[0]&&(0!==e[0]||null!==e[1]&&void 0!==e[1])){var t="bytes="+e[0]+"-";return e[1]&&(t+=e[1]),t}}function le(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function de(e,t){if(e){if(!t)return e;var r,i=Object.keys(t).map((function(e){if(null!=(r=t[e]))return Array.isArray(r)?e+="[]":r=[r],r.map((function(t){var r;return r=t,"[object Date]"===oe.call(r)?t=t.toISOString():function(e){return null!==e&&"object"===n(e)}(t)&&(t=JSON.stringify(t)),"".concat(le(e),"=").concat(le(t))})).join("&")})).filter(Boolean).join("&");if(i){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}}function he(e,t,r,n,i,a,s,o,u,c,l){return i=null!=i?parseFloat(i):null,n=parseInt(n||"0",10),Number.isNaN(n)&&(n=0),{data:e,done:t,option:{range:u,vid:c,index:o,contentLength:n,age:i,startTime:a,firstByteTime:s,endTime:Date.now(),priOptions:l},response:r}}function fe(e,t){return Math.round(8*e*1e3/t/1024)}var pe="real_time_speed",ve={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function a(e,t,n,a,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new i(n,a||e,s),u=r?r+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],o]:e._events[u].push(o):(e._events[u]=o,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),o.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},o.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,s=new Array(a);i<a;i++)s[i]=n[i].fn;return s},o.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},o.prototype.emit=function(e,t,n,i,a,s){var o=r?r+e:e;if(!this._events[o])return!1;var u,c,l=this._events[o],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,n),!0;case 4:return l.fn.call(l.context,t,n,i),!0;case 5:return l.fn.call(l.context,t,n,i,a),!0;case 6:return l.fn.call(l.context,t,n,i,a,s),!0}for(c=1,u=new Array(d-1);c<d;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var h,f=l.length;for(c=0;c<f;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),d){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,t);break;case 3:l[c].fn.call(l[c].context,t,n);break;case 4:l[c].fn.call(l[c].context,t,n,i);break;default:if(!u)for(h=1,u=new Array(d-1);h<d;h++)u[h-1]=arguments[h];l[c].fn.apply(l[c].context,u)}}return!0},o.prototype.on=function(e,t,r){return a(this,e,t,r,!1)},o.prototype.once=function(e,t,r){return a(this,e,t,r,!0)},o.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn!==t||i&&!o.once||n&&o.context!==n||s(this,a);else{for(var u=0,c=[],l=o.length;u<l;u++)(o[u].fn!==t||i&&!o[u].once||n&&o[u].context!==n)&&c.push(o[u]);c.length?this._events[a]=1===c.length?c[0]:c:s(this,a)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,e.exports=o}(ve);var ye=ve.exports,me=2097152,ge=function(e){l(i,e);var t,n=_(i);function i(){var e;return s(this,i),c(m(e=n.call(this)),"_abortController",null),c(m(e),"_timeoutTimer",null),c(m(e),"_reader",null),c(m(e),"_response",null),c(m(e),"_aborted",!1),c(m(e),"_index",-1),c(m(e),"_range",null),c(m(e),"_receivedLength",0),c(m(e),"_running",!1),c(m(e),"_logger",null),c(m(e),"_vid",""),c(m(e),"_onProcessMinLen",0),c(m(e),"_onCancel",null),c(m(e),"_priOptions",null),e}return u(i,[{key:"load",value:function(e){var t,n=this,i=e.url,s=e.vid,o=e.timeout,u=e.responseType,c=e.onProgress,l=e.index,d=e.onTimeout,h=e.onCancel,f=e.range,p=e.transformResponse,v=e.request,y=e.params,m=e.logger,g=e.method,_=e.headers,b=e.body,k=e.mode,x=e.credentials,w=e.cache,S=e.redirect,j=e.referrer,E=e.referrerPolicy,T=e.onProcessMinLen,A=e.priOptions;this._logger=m,this._aborted=!1,this._onProcessMinLen=T,this._onCancel=h,this._abortController="undefined"!=typeof AbortController&&new AbortController,this._running=!0,this._index=l,this._range=f||[0,0],this._vid=s||i,this._priOptions=A||{};var D={method:g,headers:_,body:b,mode:k,credentials:x,cache:w,redirect:S,referrer:j,referrerPolicy:E,signal:null===(t=this._abortController)||void 0===t?void 0:t.signal},O=!1;clearTimeout(this._timeoutTimer),i=de(i,y);var C=ce(f);C&&(_=v?v.headers:D.headers=D.headers||(Headers?new Headers:{}),Headers&&_ instanceof Headers?_.append("Range",C):_.Range=C),o&&(this._timeoutTimer=setTimeout((function(){if(O=!0,n.cancel(),d){var e=new se(i,D,null,"timeout");e.isTimeout=!0,d(e,{index:n._index,range:n._range,vid:n._vid,priOptions:n._priOptions})}}),o));var B=Date.now();return this._logger.debug("[fetch load start], index,",l,",range,",f),new Promise((function(e,t){fetch(v||i,v?void 0:D).then(function(){var s=a(r().mark((function a(s){var o,d,h,v;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(clearTimeout(n._timeoutTimer),n._response=s,!n._aborted&&n._running){r.next=4;break}return r.abrupt("return");case 4:if(p&&(s=p(s,i)||s),s.ok){r.next=7;break}throw new se(i,D,s,"bad network response");case 7:if(o=Date.now(),u!==ie){r.next=15;break}return r.next=11,s.text();case 11:d=r.sent,n._running=!1,r.next=37;break;case 15:if(u!==ae){r.next=22;break}return r.next=18,s.json();case 18:d=r.sent,n._running=!1,r.next=37;break;case 22:if(!c){r.next=29;break}return n.resolve=e,n.reject=t,n._loadChunk(s,c,B,o),r.abrupt("return");case 29:return r.next=31,s.arrayBuffer();case 31:d=r.sent,d=new Uint8Array(d),n._running=!1,h=Date.now()-B,v=fe(d.byteLength,h),n.emit(pe,{speed:v,len:d.byteLength,time:h,vid:n._vid,index:n._index,range:n._range,priOptions:n._priOptions});case 37:n._logger.debug("[fetch load end], index,",l,",range,",f),e(he(d,!0,s,s.headers.get("Content-Length"),s.headers.get("age"),B,o,l,f,n._vid,n._priOptions));case 39:case"end":return r.stop()}}),a)})));return function(e){return s.apply(this,arguments)}}()).catch((function(e){var r;clearTimeout(n._timeoutTimer),n._running=!1,n._aborted&&!O||((e=e instanceof se?e:new se(i,D,null,null===(r=e)||void 0===r?void 0:r.message)).startTime=B,e.endTime=Date.now(),e.isTimeout=O,e.options={index:n._index,range:n._range,vid:n._vid,priOptions:n._priOptions},t(e))}))}))}},{key:"cancel",value:(t=a(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._aborted){e.next=2;break}return e.abrupt("return");case 2:if(this._aborted=!0,this._running=!1,!this._response){e.next=14;break}if(e.prev=5,!this._reader){e.next=9;break}return e.next=9,this._reader.cancel();case 9:e.next=13;break;case 11:e.prev=11,e.t0=e.catch(5);case 13:this._response=this._reader=null;case 14:if(this._abortController){try{this._abortController.abort()}catch(t){}this._abortController=null}this._onCancel&&this._onCancel({index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions});case 16:case"end":return e.stop()}}),e,this,[[5,11]])}))),function(){return t.apply(this,arguments)})},{key:"_loadChunk",value:function(e,t,n,i){var s=this;if(!e.body||!e.body.getReader){this._running=!1;var o=new se(e.url,"",e,"onProgress of bad response.body.getReader");return o.options={index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions},void this.reject(o)}this._onProcessMinLen>0&&(this._cache=new Uint8Array(me),this._writeIdx=0);var u,c,l,d=this._reader=e.body.getReader(),h=function(){var o=a(r().mark((function a(){var o,f,p,v,y,m,g,_;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return c=Date.now(),r.prev=1,r.next=4,d.read();case 4:u=r.sent,l=Date.now(),r.next=13;break;case 8:return r.prev=8,r.t0=r.catch(1),l=Date.now(),s._aborted||(s._running=!1,r.t0.options={index:s._index,range:s._range,vid:s._vid,priOptions:s._priOptions},s.reject(r.t0)),r.abrupt("return");case 13:if(f=(null===(o=s._range)||void 0===o?void 0:o.length)>0?s._range[0]:0,p=f+s._receivedLength,!s._aborted){r.next=19;break}return s._running=!1,t(void 0,!1,{range:[p,p],vid:s._vid,index:s._index,startTime:c,endTime:l,st:n,firstByteTime:i,priOptions:s._priOptions},e),r.abrupt("return");case 19:v=u.value?u.value.byteLength:0,s._receivedLength+=v,s._logger.debug("【fetchLoader,onProgress call】,task,",s._range,", start,",p,", end,",f+s._receivedLength,", done,",u.done),s._onProcessMinLen>0?s._writeIdx+v>=s._onProcessMinLen||u.done?((y=new Uint8Array(s._writeIdx+v)).set(s._cache.slice(0,s._writeIdx),0),v>0&&y.set(u.value,s._writeIdx),s._writeIdx=0,s._logger.debug("【fetchLoader,onProgress enough】,done,",u.done,",len,",y.byteLength,", writeIdx,",s._writeIdx)):v>0&&s._writeIdx+v<me?(s._cache.set(u.value,s._writeIdx),s._writeIdx+=v,s._logger.debug("【fetchLoader,onProgress cache】,len,",v,", writeIdx,",s._writeIdx)):v>0&&(m=new Uint8Array(s._writeIdx+v+2048),s._logger.debug("【fetchLoader,onProgress extra start】,size,",s._writeIdx+v+2048,", datalen,",v,", writeIdx,",s._writeIdx),m.set(s._cache.slice(0,s._writeIdx),0),v>0&&m.set(u.value,s._writeIdx),s._writeIdx+=v,delete s._cache,s._cache=m,s._logger.debug("【fetchLoader,onProgress extra end】,len,",v,", writeIdx,",s._writeIdx)):y=u.value,(y&&y.byteLength>0||u.done)&&t(y,u.done,{range:[s._range[0]+s._receivedLength-(y?y.byteLength:0),s._range[0]+s._receivedLength],vid:s._vid,index:s._index,startTime:c,endTime:l,st:n,firstByteTime:i,priOptions:s._priOptions},e),u.done?(g=Date.now()-n,_=fe(s._receivedLength,g),s.emit(pe,{speed:_,len:s._receivedLength,time:g,vid:s._vid,index:s._index,range:s._range,priOptions:s._priOptions}),s._running=!1,s._logger.debug("[fetchLoader onProgress end],task,",s._range,",done,",u.done),s.resolve(he(u,!0,e,e.headers.get("Content-Length"),e.headers.get("age"),n,i,s._index,s._range,s._vid,s._priOptions))):h();case 25:case"end":return r.stop()}}),a,null,[[1,8]])})));return function(){return o.apply(this,arguments)}}();h()}},{key:"receiveLen",get:function(){return this._receivedLength}},{key:"running",get:function(){return this._running},set:function(e){this._running=e}}],[{key:"isSupported",value:function(){return!("undefined"==typeof fetch)}}]),i}(ye);var _e=function(e){l(n,e);var r=_(n);function n(){var e;return s(this,n),c(m(e=r.call(this)),"_xhr",null),c(m(e),"_aborted",!1),c(m(e),"_timeoutTimer",null),c(m(e),"_range",null),c(m(e),"_receivedLength",0),c(m(e),"_url",null),c(m(e),"_onProgress",null),c(m(e),"_index",-1),c(m(e),"_headers",null),c(m(e),"_currentChunkSizeKB",384),c(m(e),"_timeout",null),c(m(e),"_xhr",null),c(m(e),"_withCredentials",null),c(m(e),"_startTime",-1),c(m(e),"_loadCompleteResolve",null),c(m(e),"_loadCompleteReject",null),c(m(e),"_runing",!1),c(m(e),"_logger",!1),c(m(e),"_vid",""),c(m(e),"_responseType",void 0),c(m(e),"_credentials",void 0),c(m(e),"_method",void 0),c(m(e),"_transformResponse",void 0),c(m(e),"_firstRtt",void 0),c(m(e),"_onCancel",null),c(m(e),"_priOptions",null),e}return u(n,[{key:"load",value:function(e){var t=this;clearTimeout(this._timeoutTimer),this._logger=e.logger,this._range=e.range,this._onProgress=e.onProgress,this._index=e.index,this._headers=e.headers,this._withCredentials="include"===e.credentials||"same-origin"===e.credentials,this._body=e.body||null,e.method&&(this._method=e.method),this._timeout=e.timeout||null,this._runing=!0,this._vid=e.vid||e.url,this._responseType=e.responseType,this._firstRtt=-1,this._onTimeout=e.onTimeout,this._onCancel=e.onCancel,this._request=e.request,this._priOptions=e.priOptions||{},this._logger.debug("【xhrLoader task】, range",this._range),this._url=de(e.url,e.params);var r=Date.now();return new Promise((function(e,r){t._loadCompleteResolve=e,t._loadCompleteReject=r,t._startLoad()})).catch((function(e){if(clearTimeout(t._timeoutTimer),t._runing=!1,!t._aborted)throw(e=e instanceof se?e:new se(t._url,t._request)).startTime=r,e.endTime=Date.now(),e.options={index:t._index,vid:t._vid,priOptions:t._priOptions},e}))}},{key:"_startLoad",value:function(){var e=null;if(this._responseType===ne&&this._range&&this._range.length>1)if(this._onProgress){this._firstRtt=-1;var t=1024*this._currentChunkSizeKB,r=this._range[0]+this._receivedLength,n=this._range[1];t<this._range[1]-r&&(n=r+t),e=[r,n],this._logger.debug("[xhr_loader->],tast :",this._range,", SubRange, ",e)}else e=this._range,this._logger.debug("[xhr_loader->],tast :",this._range,", allRange, ",e);this._internalOpen(e)}},{key:"_internalOpen",value:function(e){var t=this;try{this._startTime=Date.now();var r=this._xhr=new XMLHttpRequest;r.open(this._method||"GET",this._url,!0),r.responseType=this._responseType,this._timeout&&(r.timeout=this._timeout),r.withCredentials=this._withCredentials,r.onload=this._onLoad.bind(this),r.onreadystatechange=this._onReadyStatechange.bind(this),r.onerror=function(e){var r,n,i;t._running=!1;var a=new se(t._url,t._request,null==e||null===(r=e.currentTarget)||void 0===r?void 0:r.response,"xhr.onerror.status:"+(null==e||null===(n=e.currentTarget)||void 0===n?void 0:n.status)+",statusText,"+(null==e||null===(i=e.currentTarget)||void 0===i?void 0:i.statusText));a.options={index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions},t._loadCompleteReject(a)},r.ontimeout=function(e){t.cancel();var r=new se(t._url,t._request,{status:408},"timeout");t._onTimeout&&(r.isTimeout=!0,t._onTimeout(r,{index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions})),r.options={index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions},t._loadCompleteReject(r)};var n=this._headers||{},i=ce(e);i&&(n.Range=i),n&&Object.keys(n).forEach((function(e){r.setRequestHeader(e,n[e])})),this._logger.debug("[xhr.send->] tast,",this._range,",load sub range, ",e),r.send(this._body)}catch(a){a.options={index:this._index,range:e,vid:this._vid,priOptions:this._priOptions},this._loadCompleteReject(a)}}},{key:"_onReadyStatechange",value:function(e){2===e.target.readyState&&this._firstRtt<0&&(this._firstRtt=Date.now())}},{key:"_onLoad",value:function(e){var r,n=e.target.status;if(n<200||n>299){var i=new se(this._url,null,t(t({},e.target.response),{},{status:n}),"bad response,status:"+n);return i.options={index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions},this._loadCompleteReject(i)}var a,s=null,o=!1,u=(null===(r=this._range)||void 0===r?void 0:r.length)>0?this._range[0]:0;if(this._responseType===ne){var c,l=new Uint8Array(e.target.response);if(a=u+this._receivedLength,l&&l.byteLength>0){this._receivedLength+=l.byteLength;var d=Date.now()-this._startTime,h=fe(this._receivedLength,d);this.emit(pe,{speed:h,len:this._receivedLength,time:d,vid:this._vid,index:this._index,range:[a,u+this._receivedLength],priOptions:this._priOptions})}s=l,o=!((null===(c=this._range)||void 0===c?void 0:c.length)>1&&this._range[1]&&this._receivedLength<this._range[1]-this._range[0]),this._logger.debug("[xhr load done->], tast :",this._range,", start",a,"end ",u+this._receivedLength,",dataLen,",l?l.byteLength:0,",receivedLength",this._receivedLength,",index,",this._index,", done,",o)}else o=!0,s=e.target.response;var f={ok:n>=200&&n<300,status:n,statusText:this._xhr.statusText,url:this._xhr.responseURL,headers:this._getHeaders(this._xhr),body:this._xhr.response};this._transformResponse&&(f=this._transformResponse(f,this._url)||f),this._onProgress&&this._onProgress(s,o,{index:this._index,vid:this._vid,range:[a,u+this._receivedLength],startTime:this._startTime,endTime:Date.now(),priOptions:this._priOptions},f),o?(this._runing=!1,this._loadCompleteResolve&&this._loadCompleteResolve(he(this._onProgress?null:s,o,f,f.headers["content-length"],f.headers.age,this._startTime,this._firstRtt,this._index,this._range,this._vid,this._priOptions))):this._startLoad()}},{key:"cancel",value:function(){if(!this._aborted)return this._aborted=!0,this._runing=!1,k(d(n.prototype),"removeAllListeners",this).call(this),this._onCancel&&this._onCancel({index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions}),this._xhr?this._xhr.abort():void 0}},{key:"receiveLen",get:function(){return this._receivedLength}},{key:"running",get:function(){return this._running},set:function(e){this._running=e}},{key:"_getHeaders",value:function(e){var t,r={},n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=S(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(o)throw a}}}}(e.getAllResponseHeaders().trim().split("\r\n"));try{for(n.s();!(t=n.n()).done;){var i=t.value.split(": ");r[i[0].toLowerCase()]=i.slice(1).join(": ")}}catch(a){n.e(a)}finally{n.f()}return r}}],[{key:"isSupported",value:function(){return"undefined"!=typeof XMLHttpRequest}}]),n}(ye),be=["retry","retryDelay","onRetryError","transformError"],ke=function(){function e(t,r){s(this,e),this.promise=T(),this.alive=!!r.onProgress,!r.logger&&(r.logger=new Q("Loader")),this._loaderType=t,this._loader=t===te&&window.fetch?new ge:new _e,this._config=r,this._retryCount=0,this._retryTimer=null,this._canceled=!1,this._retryCheckFunc=r.retryCheckFunc,this._logger=r.logger}var t;return u(e,[{key:"exec",value:function(){var e=this,t=this._config,n=t.retry,i=t.retryDelay,s=t.onRetryError,o=t.transformError,u=y(t,be),c=function(){var t=a(r().mark((function t(){var a,l,d;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e._loader.load(u);case 3:a=t.sent,e.promise.resolve(a),t.next=27;break;case 7:if(t.prev=7,t.t0=t.catch(0),e._loader.running=!1,e._logger.debug("[task request catch err]",t.t0),!e._canceled){t.next=13;break}return t.abrupt("return");case 13:if(t.t0.loaderType=e._loaderType,t.t0.retryCount=e._retryCount,l=t.t0,o&&(l=o(l)||l),s&&e._retryCount>0&&s(l,e._retryCount,{index:u.index,vid:u.vid,range:u.range,priOptions:u.priOptions}),e._retryCount++,d=!0,e._retryCheckFunc&&(d=e._retryCheckFunc(t.t0)),!(d&&e._retryCount<=n)){t.next=26;break}return clearTimeout(e._retryTimer),e._logger.debug("[task request setTimeout],retry",e._retryCount,",retry range,",u.range),e._retryTimer=setTimeout(c,i),t.abrupt("return");case 26:e.promise.reject(l);case 27:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}();return c(),this.promise}},{key:"cancel",value:(t=a(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return clearTimeout(this._retryTimer),this._canceled=!0,this._loader.running=!1,e.abrupt("return",this._loader.cancel());case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"running",get:function(){return this._loader&&this._loader.running}},{key:"loader",get:function(){return this._loader}}]),e}();function xe(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if((t=t.filter(Boolean)).length<2)return t[0];var n=new Uint8Array(t.reduce((function(e,t){return e+t.byteLength}),0)),i=0;return t.forEach((function(e){n.set(e,i),i+=e.byteLength})),n}function we(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(t){return setTimeout(t,e)}))}var Se=function(e){l(o,e);var n,i=_(o);function o(e){var r;return s(this,o),c(m(r=i.call(this,e)),"type",te),c(m(r),"_queue",[]),c(m(r),"_alive",[]),c(m(r),"_currentTask",null),c(m(r),"_config",void 0),r._config=function(e){return t({loaderType:te,retry:0,retryDelay:0,timeout:0,request:null,onTimeout:void 0,onProgress:void 0,onRetryError:void 0,transformRequest:void 0,transformResponse:void 0,transformError:void 0,responseType:ie,range:void 0,url:"",params:void 0,method:"GET",headers:{},body:void 0,mode:void 0,credentials:void 0,cache:void 0,redirect:void 0,referrer:void 0,referrerPolicy:void 0,integrity:void 0,onProcessMinLen:0},e)}(e),r._config.loaderType!==re&&ge.isSupported()||(r.type=re),r.log=e.logger,r}return u(o,[{key:"isFetch",value:function(){return this.type===te}},{key:"load",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"!=typeof e&&e?r=e:r.url=e||r.url||this._config.url,(r=Object.assign({},this._config,r)).params&&(r.params=Object.assign({},r.params)),r.headers&&ue(r.headers)&&(r.headers=Object.assign({},r.headers)),r.body&&ue(r.body)&&(r.body=Object.assign({},r.body)),r.transformRequest&&(r=r.transformRequest(r)||r),r.logger=this.log;var n=new ke(this.type,r);return n.loader.on(pe,(function(e){t.emit(pe,e)})),this._queue.push(n),1!==this._queue.length||this._currentTask&&this._currentTask.running||this._processTask(),n.promise}},{key:"cancel",value:(n=a(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._queue.map((function(e){return e.cancel()})).concat(this._alive.map((function(e){return e.cancel()}))),this._currentTask&&t.push(this._currentTask.cancel()),this._queue=[],this._alive=[],e.next=6,Promise.all(t);case 6:return e.next=8,we();case 8:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"_processTask",value:function(){var e=this;if(this._currentTask=this._queue.shift(),this._currentTask){this._currentTask.alive&&this._alive.push(this._currentTask);var t=this._currentTask.exec().catch((function(e){}));t&&"function"==typeof t.finally&&t.finally((function(){var t,r;null!==(t=e._currentTask)&&void 0!==t&&t.alive&&(null===(r=e._alive)||void 0===r?void 0:r.length)>0&&(e._alive=e._alive.filter((function(t){return t&&t!==e._currentTask}))),e._processTask()}))}}}],[{key:"isFetchSupport",value:function(){return ge.isSupported()}}]),o}(ye),je="video",Ee="audio",Te="metadata",Ae="avc",De="hevc",Oe="aac",Ce="g7110a",Be="g7110m",Le="LARGE_AV_SHIFT",Re="LARGE_VIDEO_GAP",Pe="LARGE_VIDEO_GAP_BETWEEN_CHUNK",Ue="LARGE_AUDIO_GAP",Ie="AUDIO_FILLED",Me="AUDIO_DROPPED",ze=function(){function e(){s(this,e),c(this,"id",1),c(this,"type",je),c(this,"codecType",Ae),c(this,"pid",-1),c(this,"hvcC",void 0),c(this,"codec",""),c(this,"timescale",0),c(this,"formatTimescale",0),c(this,"sequenceNumber",0),c(this,"baseMediaDecodeTime",0),c(this,"baseDts",0),c(this,"duration",0),c(this,"warnings",[]),c(this,"samples",[]),c(this,"pps",[]),c(this,"sps",[]),c(this,"vps",[]),c(this,"fpsNum",0),c(this,"fpsDen",0),c(this,"sarRatio",[]),c(this,"width",0),c(this,"height",0),c(this,"nalUnitSize",4),c(this,"present",!1),c(this,"isVideoEncryption",!1),c(this,"isAudioEncryption",!1),c(this,"isVideo",!0),c(this,"kid",null),c(this,"pssh",null),c(this,"ext",void 0)}return u(e,[{key:"reset",value:function(){this.sequenceNumber=this.width=this.height=this.fpsDen=this.fpsNum=this.duration=this.baseMediaDecodeTime=this.timescale=0,this.codec="",this.present=!1,this.pid=-1,this.pps=[],this.sps=[],this.vps=[],this.sarRatio=[],this.samples=[],this.warnings=[],this.hvcC=null}},{key:"exist",value:function(){return!!(this.pps.length&&this.sps.length&&this.codec)}},{key:"hasSample",value:function(){return!!this.samples.length}},{key:"isEncryption",get:function(){return this.isVideoEncryption}}]),e}(),qe=function(){function e(){s(this,e),c(this,"id",2),c(this,"type",Ee),c(this,"codecType",Oe),c(this,"pid",-1),c(this,"codec",""),c(this,"sequenceNumber",0),c(this,"sampleDuration",0),c(this,"timescale",0),c(this,"formatTimescale",0),c(this,"baseMediaDecodeTime",0),c(this,"duration",0),c(this,"warnings",[]),c(this,"samples",[]),c(this,"baseDts",0),c(this,"sampleSize",16),c(this,"sampleRate",0),c(this,"channelCount",0),c(this,"objectType",0),c(this,"sampleRateIndex",0),c(this,"config",[]),c(this,"present",!1),c(this,"isVideoEncryption",!1),c(this,"isAudioEncryption",!1),c(this,"kid",null),c(this,"ext",void 0)}return u(e,[{key:"reset",value:function(){this.sequenceNumber=0,this.timescale=0,this.sampleDuration=0,this.sampleRate=0,this.channelCount=0,this.baseMediaDecodeTime=0,this.present=!1,this.pid=-1,this.codec="",this.samples=[],this.config=[],this.warnings=[]}},{key:"exist",value:function(){return!!(this.sampleRate&&this.channelCount&&this.codec&&this.codecType===Oe)}},{key:"hasSample",value:function(){return!!this.samples.length}},{key:"isEncryption",get:function(){return this.isAudioEncryption}}]),e}(),Ne=function(){function e(t,r,n){s(this,e),c(this,"flag",{}),c(this,"keyframe",!1),c(this,"gopId",0),c(this,"duration",0),c(this,"size",0),c(this,"units",[]),c(this,"chromaFormat",420),this.originPts=this.pts=t,this.originDts=this.dts=r,n&&(this.units=n)}return u(e,[{key:"cts",get:function(){return this.pts-this.dts}},{key:"setToKeyframe",value:function(){this.keyframe=!0,this.flag.dependsOn=2,this.flag.isNonSyncSample=0}}]),e}(),Fe=u((function e(t,r,n,i){s(this,e),c(this,"duration",1024),c(this,"flag",{dependsOn:2,isNonSyncSample:0}),c(this,"keyframe",!0),this.originPts=this.pts=this.dts=t,this.data=r,this.size=r.byteLength,this.sampleOffset=i,n&&(this.duration=n)})),Ve=u((function e(t,r){s(this,e),c(this,"time",0),this.data=t,this.originPts=this.pts=r})),Ge=function(e){l(r,e);var t=_(r);function r(){return s(this,r),t.apply(this,arguments)}return u(r)}(Ve),He=function(e){l(r,e);var t=_(r);function r(){return s(this,r),t.apply(this,arguments)}return u(r)}(Ve),Ke=function(){function e(){s(this,e),c(this,"id",3),c(this,"type",Te),c(this,"timescale",0),c(this,"flvScriptSamples",[]),c(this,"seiSamples",[])}return u(e,[{key:"exist",value:function(){return!(!this.flvScriptSamples.length&&!this.seiSamples.length||!this.timescale)}},{key:"reset",value:function(){this.timescale=0,this.flvScriptSamples=[],this.seiSamples=[]}},{key:"hasSample",value:function(){return!(!this.flvScriptSamples.length&&!this.seiSamples.length)}}]),e}(),Qe=function(){function e(t){if(s(this,e),c(this,"_bytesAvailable",void 0),c(this,"_bitsAvailable",0),c(this,"_word",0),!t)throw new Error("ExpGolomb data params is required");this._data=t,this._bytesAvailable=t.byteLength,this._bytesAvailable&&this._loadWord()}return u(e,[{key:"_loadWord",value:function(){var e=this._data.byteLength-this._bytesAvailable,t=Math.min(4,this._bytesAvailable);if(0===t)throw new Error("No bytes available");var r=new Uint8Array(4);r.set(this._data.subarray(e,e+t)),this._word=new DataView(r.buffer).getUint32(0),this._bitsAvailable=8*t,this._bytesAvailable-=t}},{key:"skipBits",value:function(e){if(this._bitsAvailable>e)this._word<<=e,this._bitsAvailable-=e;else{e-=this._bitsAvailable;var t=Math.floor(e/8);e-=8*t,this._bytesAvailable-=t,this._loadWord(),this._word<<=e,this._bitsAvailable-=e}}},{key:"readBits",value:function(e){if(e>32)throw new Error("Cannot read more than 32 bits");var t=Math.min(this._bitsAvailable,e),r=this._word>>>32-t;return this._bitsAvailable-=t,this._bitsAvailable>0?this._word<<=t:this._bytesAvailable>0&&this._loadWord(),(t=e-t)>0&&this._bitsAvailable?r<<t|this.readBits(t):r}},{key:"skipLZ",value:function(){var e;for(e=0;e<this._bitsAvailable;++e)if(0!=(this._word&2147483648>>>e))return this._word<<=e,this._bitsAvailable-=e,e;return this._loadWord(),e+this.skipLZ()}},{key:"skipUEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"readUEG",value:function(){var e=this.skipLZ();return this.readBits(e+1)-1}},{key:"readEG",value:function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}},{key:"readBool",value:function(){return 1===this.readBits(1)}},{key:"readUByte",value:function(){return this.readBits(8)}},{key:"skipScalingList",value:function(e){for(var t=8,r=8,n=0;n<e;n++)0!==r&&(r=(t+this.readEG()+256)%256),t=0===r?t:r}}]),e}(),Ye=function(){function e(t){s(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]")}return u(e,[{key:"warn",value:function(){var t;if(!e.disabled){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];(t=console).warn.apply(t,[this._prefix].concat(n))}}}],[{key:"enable",value:function(){e.disabled=!1}},{key:"disable",value:function(){e.disabled=!0}}]),e}();c(Ye,"disabled",!0);var We=function(){function e(){s(this,e)}return u(e,null,[{key:"decode",value:function(t){for(var r=[],n=t,i=0,a=t.length;i<a;)if(n[i]<128)r.push(String.fromCharCode(n[i])),++i;else{if(n[i]<192);else if(n[i]<224){if(e._checkContinuation(n,i,1)){var s=(31&n[i])<<6|63&n[i+1];if(s>=128){r.push(String.fromCharCode(65535&s)),i+=2;continue}}}else if(n[i]<240){if(e._checkContinuation(n,i,2)){var o=(15&n[i])<<12|(63&n[i+1])<<6|63&n[i+2];if(o>=2048&&55296!=(63488&o)){r.push(String.fromCharCode(65535&o)),i+=3;continue}}}else if(n[i]<248&&e._checkContinuation(n,i,3)){var u=(7&n[i])<<18|(63&n[i+1])<<12|(63&n[i+2])<<6|63&n[i+3];if(u>65536&&u<1114112){u-=65536,r.push(String.fromCharCode(u>>>10|55296)),r.push(String.fromCharCode(1023&u|56320)),i+=4;continue}}r.push(String.fromCharCode(65533)),++i}return r.join("")}},{key:"_checkContinuation",value:function(e,t,r){var n=e;if(t+r<n.length){for(;r--;)if(128!=(192&n[++t]))return!1;return!0}return!1}}]),e}(),Xe="undefined"!=typeof window,Je=Xe&&navigator.userAgent.toLocaleLowerCase(),Ze=Xe&&/^((?!chrome|android).)*safari/.test(Je),$e=Xe&&Je.includes("firefox"),et=Xe&&Je.includes("android");function tt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];t=t.filter(Boolean);var n=new Uint8Array(t.reduce((function(e,t){return e+t.byteLength}),0)),i=0;return t.forEach((function(e){n.set(e,i),i+=e.byteLength})),n}var rt=Math.pow(2,32);function nt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(e[t]<<8)+(e[t+1]||0)}function it(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(e[t]<<24>>>0)+(e[t+1]<<16)+(e[t+2]<<8)+(e[t+3]||0)}function at(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return it(e,t)*rt+it(e,t+4)}function st(e){for(var t,r="avc1.",n=0;n<3;n++)(t=e[n].toString(16)).length<2&&(t="0".concat(t)),r+=t;return r}function ot(e){if(!Array.isArray(e)){for(var t=[],r="",n=0;n<e.length;n++)n%2&&(r=e[n-1]+e[n],t.push(parseInt(r,16)),r="");return t}return e.map((function(e){return parseInt(e,16)}))}var ut=function(){function e(){s(this,e)}return u(e,null,[{key:"parseAnnexB",value:function(e){for(var t=e.length,r=2,n=0;null!==e[r]&&void 0!==e[r]&&1!==e[r];)r++;if((n=++r+2)>=t)return[];for(var i=[];n<t;)switch(e[n]){case 0:if(0!==e[n-1]){n+=2;break}if(0!==e[n-2]){n++;break}r!==n-2&&i.push(e.subarray(r,n-2));do{n++}while(1!==e[n]&&n<t);n=(r=n+1)+2;break;case 1:if(0!==e[n-1]||0!==e[n-2]){n+=3;break}r!==n-2&&i.push(e.subarray(r,n-2)),n=(r=n+1)+2;break;default:n+=3}return r<t&&i.push(e.subarray(r)),i}},{key:"parseAvcC",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;if(!(e.length<4)){for(var r,n=e.length,i=[],a=0;a+t<n;)if(r=it(e,a),3===t&&(r>>>=8),a+=t,r){if(a+r>n)break;i.push(e.subarray(a,a+r)),a+=r}return i}}},{key:"parseSEI",value:function(e,t){for(var r=e.length,n=t?2:1,i=0,a=0,s="";255===e[n];)i+=255,n++;for(i+=e[n++];255===e[n];)a+=255,n++;if(a+=e[n++],5===i&&r>n+16)for(var o=0;o<16;o++)s+=e[n].toString(16),n++;return{payload:e.subarray(n),type:i,size:a,uuid:s}}},{key:"removeEPB",value:function(e){for(var t=e.byteLength,r=[],n=1;n<t-2;)0===e[n]&&0===e[n+1]&&3===e[n+2]?(r.push(n+2),n+=2):n++;if(!r.length)return e;var i=t-r.length,a=new Uint8Array(i),s=0;for(n=0;n<i;s++,n++)s===r[0]&&(s++,r.shift()),a[n]=e[s];return a}}]),e}(),ct=function(){function e(){s(this,e)}return u(e,null,[{key:"parseAVCDecoderConfigurationRecord",value:function(t){if(!(t.length<7)){for(var r,n,i=1+(3&t[4]),a=[],s=[],o=6,u=31&t[5],c=0;c<u;c++)if(n=t[o]<<8|t[o+1],o+=2,n){var l=t.subarray(o,o+n);o+=n,a.push(l),r||(r=e.parseSPS(ut.removeEPB(l)))}var d,h=t[o];o++;for(var f=0;f<h;f++)d=t[o]<<8|t[o+1],o+=2,d&&(s.push(t.subarray(o,o+d)),o+=d);return{sps:r,spsArr:a,ppsArr:s,nalUnitSize:i}}}},{key:"parseSPS",value:function(e){var t=new Qe(e);t.readUByte();var r=t.readUByte(),n=t.readUByte(),i=t.readUByte();t.skipUEG();var a=420;if(100===r||110===r||122===r||244===r||44===r||83===r||86===r||118===r||128===r||138===r||144===r){var s=t.readUEG();if(s<=3&&(a=[0,420,422,444][s]),3===s&&t.skipBits(1),t.skipUEG(),t.skipUEG(),t.skipBits(1),t.readBool())for(var o=3!==s?8:12,u=0;u<o;u++)t.readBool()&&(u<6?t.skipScalingList(16):t.skipScalingList(64))}t.skipUEG();var c=t.readUEG();if(0===c)t.readUEG();else if(1===c){t.skipBits(1),t.skipUEG(),t.skipUEG();for(var l=t.readUEG(),d=0;d<l;d++)t.skipUEG()}t.skipUEG(),t.skipBits(1);var h=t.readUEG(),f=t.readUEG(),p=t.readBits(1);0===p&&t.skipBits(1),t.skipBits(1);var v,y,m,g,_,b=0,k=0,x=0,w=0;if(t.readBool()&&(b=t.readUEG(),k=t.readUEG(),x=t.readUEG(),w=t.readUEG()),t.readBool()){if(t.readBool())switch(t.readUByte()){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:v=[t.readUByte()<<8|t.readUByte(),t.readUByte()<<8|t.readUByte()]}if(t.readBool()&&t.readBool(),t.readBool()&&(t.readBits(4),t.readBool()&&t.readBits(24)),t.readBool()&&(t.readUEG(),t.readUEG()),t.readBool()){var S=t.readBits(32),j=t.readBits(32);y=t.readBool(),_=(m=j)/(g=2*S)}}return{codec:st(e.subarray(1,4)),profileIdc:r,profileCompatibility:n,levelIdc:i,chromaFormat:a,width:Math.ceil(16*(h+1)-2*(b+k)),height:(2-p)*(f+1)*16-(p?2:4)*(x+w),sarRatio:v,fpsNum:m,fpsDen:g,fps:_,fixedFrame:y}}}]),e}(),lt=function(){function e(){s(this,e)}return u(e,null,[{key:"getRateIndexByRate",value:function(t){return e.FREQ.indexOf(t)}},{key:"parseADTS",value:function(t,r){for(var n=t.length,i=0;i+2<n&&(255!==t[i]||240!=(246&t[i+1]));)i++;if(!(i>=n)){var a=i,s=[],o=(60&t[i+2])>>>2,u=e.FREQ[o];if(!u)throw new Error("Invalid sampling index: ".concat(o));for(var c,l,d=1+((192&t[i+2])>>>6),h=(1&t[i+2])<<2|(192&t[i+3])>>>6,f=e._getConfig(o,h,d),p=f.config,v=f.codec,y=0,m=e.getFrameDuration(u);i+7<n;)if(255===t[i]&&240==(246&t[i+1])){if(n-i<(l=(3&t[i+3])<<11|t[i+4]<<3|(224&t[i+5])>>5))break;c=2*(1&~t[i+1]),s.push({pts:r+y*m,data:t.subarray(i+7+c,i+l)}),y++,i+=l}else i++;return{skip:a,remaining:i>=n?void 0:t.subarray(i),frames:s,samplingFrequencyIndex:o,sampleRate:u,objectType:d,channelCount:h,codec:v,config:p,originCodec:"mp4a.40.".concat(d)}}}},{key:"parseAudioSpecificConfig",value:function(t){if(t.length){var r=t[0]>>>3,n=(7&t[0])<<1|t[1]>>>7,i=(120&t[1])>>>3,a=e.FREQ[n];if(a){var s=e._getConfig(n,i,r);return{samplingFrequencyIndex:n,sampleRate:a,objectType:r,channelCount:i,config:s.config,codec:s.codec,originCodec:"mp4a.40.".concat(r)}}}}},{key:"getFrameDuration",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4;return 1024*t/e}},{key:"_getConfig",value:function(e,t,r){var n,i,a=[];return $e?e>=6?(n=5,i=e-3):(n=2,i=e):et?(n=2,i=e):(n=2===r||5===r?r:5,i=e,e>=6?i=e-3:1===t&&(n=2,i=e)),a[0]=n<<3,a[0]|=(14&e)>>1,a[1]=(1&e)<<7,a[1]|=t<<3,5===n&&(a[1]|=(14&i)>>1,a[2]=(1&i)<<7,a[2]|=8,a[3]=0),{config:a,codec:"mp4a.40.".concat(n)}}},{key:"getSilentFrame",value:function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}}}]),e}();c(lt,"FREQ",[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350]);var dt=function(){function e(){s(this,e)}return u(e,null,[{key:"parseHEVCDecoderConfigurationRecord",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(t.length<23)){r=r||{};for(var n,i,a,s,o,u=1+(3&t[21]),c=[],l=[],d=[],h=23,f=t[22],p=0;p<f;p++){a=63&t[h],s=t[h+1]<<8|t[h+2],h+=3;for(var v=0;v<s;v++)if(o=t[h]<<8|t[h+1],h+=2,o){switch(a){case 32:var y=t.subarray(h,h+o);n||(n=e.parseVPS(ut.removeEPB(y),r)),d.push(y);break;case 33:var m=t.subarray(h,h+o);i||(i=e.parseSPS(ut.removeEPB(m),r)),c.push(m);break;case 34:l.push(t.subarray(h,h+o))}h+=o}}return{hvcC:r,sps:i,spsArr:c,ppsArr:l,vpsArr:d,nalUnitSize:u}}}},{key:"parseVPS",value:function(t,r){r=r||{};var n=new Qe(t);n.readUByte(),n.readUByte(),n.readBits(12);var i=n.readBits(3);return r.numTemporalLayers=Math.max(r.numTemporalLayers||0,i+1),n.readBits(17),e._parseProfileTierLevel(n,i,r),r}},{key:"parseSPS",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r=r||{};var n=new Qe(t);n.readUByte(),n.readUByte(),n.readBits(4);var i=n.readBits(3);r.numTemporalLayers=Math.max(i+1,r.numTemporalLayers||0),r.temporalIdNested=n.readBits(1),e._parseProfileTierLevel(n,i,r),n.readUEG();var a=r.chromaFormatIdc=n.readUEG(),s=420;a<=3&&(s=[0,420,422,444][a]);var o=0;3===a&&(o=n.readBits(1));var u,c,l,d,h=n.readUEG(),f=n.readUEG(),p=n.readBits(1);if(1===p&&(u=n.readUEG(),c=n.readUEG(),l=n.readUEG(),d=n.readUEG()),r.bitDepthLumaMinus8=n.readUEG(),r.bitDepthChromaMinus8=n.readUEG(),1===p){var v=1!==a&&2!==a||0!==o?1:2,y=1===a&&0===o?2:1;h-=v*(c+u),f-=y*(d+l)}return{codec:"hev1.1.6.L93.B0",width:h,height:f,chromaFormat:s,hvcC:r}}},{key:"_parseProfileTierLevel",value:function(e,t,r){var n=r.generalTierFlag||0;r.generalProfileSpace=e.readBits(2),r.generalTierFlag=Math.max(e.readBits(1),n),r.generalProfileIdc=Math.max(e.readBits(5),r.generalProfileIdc||0),r.generalProfileCompatibilityFlags=e.readBits(32),r.generalConstraintIndicatorFlags=[e.readBits(8),e.readBits(8),e.readBits(8),e.readBits(8),e.readBits(8),e.readBits(8)];var i=e.readBits(8);n<r.generalTierFlag?r.generalLevelIdc=i:r.generalLevelIdc=Math.max(i,r.generalLevelIdc||0);for(var a=[],s=[],o=0;o<t;o++)a[o]=e.readBits(1),s[o]=e.readBits(1);t>0&&e.readBits(2*(8-t));for(var u=0;u<t;u++)0!==a[u]&&(e.readBits(2),e.readBits(1),e.readBits(5),e.readBits(16),e.readBits(16),e.readBits(4),e.readBits(16),e.readBits(16),e.readBits(12)),0!==s[u]&&e.readBits(8)}}]),e}(),ht=1e3,ft=5e3,pt=function(){function e(t,r,n){s(this,e),this.videoTrack=t,this.audioTrack=r,this.metadataTrack=n,this._baseDts=-1,this._baseDtsInited=!1,this._audioNextPts=void 0,this._videoNextDts=void 0,this._audioTimestampBreak=0,this._videoTimestampBreak=0,this._lastVideoDuration=0,this._keyFrameInNextChunk=!1,this._lastAudioExceptionGapDot=-1/0,this._lastAudioExceptionOverlapDot=-1/0,this._lastAudioExceptionLargeGapDot=-1/0,this._lastVideoExceptionLargeGapDot=-1/0,this._lastVideoExceptionChunkFirstDtsDot=-1/0}return u(e,[{key:"fix",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];t=Math.round(1e3*t);var i=this.videoTrack,a=this.audioTrack;!r&&n||(this._videoLastSample=null,this._audioNextPts=void 0,this._videoNextDts=void 0,this._audioTimestampBreak=0,this._videoTimestampBreak=0,this._lastAudioExceptionGapDot=-1/0,this._lastAudioExceptionOverlapDot=-1/0,this._lastAudioExceptionLargeGapDot=-1/0,this._lastVideoExceptionLargeGapDot=-1/0,this._lastVideoExceptionChunkFirstDtsDot=-1/0),r&&!n&&(this._baseDtsInited=!1),this._baseDtsInited||this._calculateBaseDts(a,i),!n&&t&&(this._audioNextPts=this._videoNextDts=t);var s=this._baseDtsInited&&(this._videoTimestampBreak||!this.videoTrack.exist())&&(this._audioTimestampBreak||!this.audioTrack.exist());if(s&&this._resetBaseDtsWhenStreamBreaked(),this._fixAudio(a),this._keyFrameInNextChunk=!1,this._fixVideo(i),this.metadataTrack.exist()){var o=this.metadataTrack.timescale;this.metadataTrack.seiSamples.forEach((function(t){t.pts=t.originPts-e._baseDts,t.time=Math.max(0,t.pts)/o})),this.metadataTrack.flvScriptSamples.forEach((function(t){t.pts=t.originPts-e._baseDts,t.time=Math.max(0,t.pts)/o}))}i.samples.length&&(i.baseMediaDecodeTime=i.samples[0].dts),a.samples.length&&(a.baseMediaDecodeTime=a.samples[0].pts*a.timescale/1e3)}},{key:"_fixVideo",value:function(e){var t=this,r=e.samples;if(r.length){var n;if(r.forEach((function(e){e.dts-=t._baseDts,e.pts-=t._baseDts,e.keyframe&&(t._keyFrameInNextChunk=!0)})),e.fpsNum&&e.fpsDen)n=e.timescale*(e.fpsDen/e.fpsNum);else if(e.length>1){var i=e.samples[0],a=e.samples[r.length-1];n=Math.floor((a.dts-i.dts)/(r.length-1))}else n=this._lastVideoDuration||40;var s=r.pop();if(this._videoLastSample&&r.unshift(this._videoLastSample),this._videoLastSample=s,r.length){if(void 0===this._videoNextDts){var o=r[0];this._videoNextDts=o.dts}var u=r.length,c=0,l=r[0],d=this._videoNextDts-l.dts;if(Math.abs(d)>200){var h;if(Math.abs(l.dts-this._lastVideoExceptionChunkFirstDtsDot)>5e3)this._lastVideoExceptionChunkFirstDtsDot=l.dts,e.warnings.push({type:Pe,nextDts:this._videoNextDts,firstSampleDts:l.dts,nextSampleDts:null===(h=r[1])||void 0===h?void 0:h.dts,sampleDuration:d});this._videoTimestampBreak>=5?(this._videoNextDts=l.dts,this._videoTimestampBreak=0):(l.dts+=d,l.pts+=d,this.audioTrack.exist()||(this._videoTimestampBreak=1))}for(var f=0;f<u;f++){var p=r[f].dts,v=r[f+1];((c=f<u-1?v.dts-p:s?s.dts-p:n)>1e3||c<0)&&(this._videoTimestampBreak++,Math.abs(p-this._lastVideoExceptionLargeGapDot)>5e3&&(this._lastVideoExceptionLargeGapDot=p,e.warnings.push({type:Re,time:p/e.timescale,dts:p,originDts:r[f].originDts,nextDts:this._videoNextDts,sampleDuration:c,refSampleDuration:n})),c=n),r[f].duration=c,this._videoNextDts+=c,this._lastVideoDuration=c}}}}},{key:"_fixAudio",value:function(e){var t=this,r=e.samples;r.length&&(r.forEach((function(e){e.dts=e.pts-=t._baseDts})),this._doFixAudioInternal(e,r,1e3))}},{key:"_calculateBaseDts",value:function(e,t){var r=e.samples,n=t.samples;if(!r.length&&!n.length)return!1;var i=1/0,a=1/0;r.length&&(e.baseDts=i=r[0].pts),n.length&&(t.baseDts=a=n[0].dts),this._baseDts=Math.min(i,a);var s=a-i;return Number.isFinite(s)&&Math.abs(s)>500&&t.warnings.push({type:Le,videoBaseDts:a,audioBasePts:i,baseDts:this._baseDts,delta:s}),this._baseDtsInited=!0,!0}},{key:"_resetBaseDtsWhenStreamBreaked",value:function(){this._calculateBaseDts(this.audioTrack,this.videoTrack)&&(this.audioTrack.exist()?this.videoTrack.exist()?this._baseDts-=Math.min(this._audioNextPts,this._videoNextDts):this._baseDts-=this._audioNextPts:this._baseDts-=this._videoNextDts,this._videoTimestampBreak=0,this._audioTimestampBreak=0)}},{key:"_doFixAudioInternal",value:function(e,t,r){e.sampleDuration||(e.sampleDuration=e.codecType===Oe?lt.getFrameDuration(e.timescale,r):this._getG711Duration(e));var n=e.sampleDuration,i=e.codecType===Oe?1024:n*e.timescale/1e3;if(void 0===this._audioNextPts){var a=t[0];this._audioNextPts=a.pts}for(var s=0;s<t.length;s++){var o=this._audioNextPts,u=t[s],c=u.pts-o;if(0===s&&this._audioTimestampBreak>=5&&this._keyFrameInNextChunk&&(o=this._audioNextPts=u.dts,c=0,this._audioTimestampBreak=0),!this._audioTimestampBreak&&c>=3*n&&c<=ht&&!Ze){var l=this._getSilentFrame(e)||t[0].data.subarray(),d=Math.floor(c/n);Math.abs(u.pts-this._lastAudioExceptionGapDot)>ft&&(this._lastAudioExceptionGapDot=u.pts,e.warnings.push({type:Ie,pts:u.pts,originPts:u.originPts,count:d,nextPts:o,refSampleDuration:n}));for(var h=0;h<d;h++){var f=new Fe(Math.floor(this._audioNextPts+n)-Math.floor(this._audioNextPts),l,i);f.originPts=Math.floor(this._baseDts+o),t.splice(s,0,f),this._audioNextPts+=n,s++}s--}else c<=-3*n&&c>=-1e3?(Math.abs(u.pts-this._lastAudioExceptionOverlapDot)>ft&&(this._lastAudioExceptionOverlapDot=u.pts,e.warnings.push({type:Me,pts:u.pts,originPts:u.originPts,nextPts:o,refSampleDuration:n})),t.splice(s,1),s--):(Math.abs(c)>ht&&(this._audioTimestampBreak++,Math.abs(u.pts-this._lastAudioExceptionLargeGapDot)>ft&&(this._lastAudioExceptionLargeGapDot=u.pts,e.warnings.push({type:Ue,time:u.pts/1e3,pts:u.pts,originPts:u.originPts,nextPts:o,sampleDuration:c,refSampleDuration:n}))),u.dts=u.pts=o,u.duration=i,this._audioNextPts+=n)}}},{key:"_getG711Duration",value:function(e){var t=e.sampleSize,r=e.channelCount,n=e.sampleRate,i=e.samples[0];if(i)return 2*i.data.byteLength/r/(t/8)/n*1e3}},{key:"_getSilentFrame",value:function(e){return e.codecType===Oe?lt.getSilentFrame(e.codec,e.channelCount):new Uint8Array(8*e.sampleDuration*e.channelCount)}}]),e}(),vt=function(){function e(){s(this,e)}return u(e,null,[{key:"parse",value:function(t){if(!(t.length<3)){var r={},n=e._parseValue(new DataView(t.buffer,t.byteOffset,t.byteLength)),i=e._parseValue(new DataView(t.buffer,t.byteOffset+n.size,t.byteLength-n.size));return r[n.data]=i.data,r}}},{key:"_parseValue",value:function(t){var r,n=t.byteLength,i=1,a=!1;switch(t.getUint8(0)){case 0:r=t.getFloat64(1),i+=8;break;case 1:r=!!t.getUint8(1),i+=1;break;case 2:var s=e._parseString(new DataView(t.buffer,t.byteOffset+i,t.byteLength-i));r=s.data,i+=s.size;break;case 3:r={};var o=0;for(9==(16777215&t.getUint32(n-4))&&(o=3);i<n-4;){var u=e._parseObject(new DataView(t.buffer,t.byteOffset+i,t.byteLength-i-o)),c=u.size,l=u.data;if(u.isEnd)break;r[l.name]=l.value,i+=c}if(i<=n-3)9===(16777215&t.getUint32(i-1))&&(i+=3);break;case 8:r={},i+=4;var d=0;for(9==(16777215&t.getUint32(n-4))&&(d=3);i<n-8;){var h=e._parseObject(new DataView(t.buffer,t.byteOffset+i,t.byteLength-i-d)),f=h.size,p=h.data;if(h.isEnd)break;r[p.name]=p.value,i+=f}if(i<=n-3)9===(16777215&t.getUint32(i-1))&&(i+=3);break;case 9:r=void 0,i=1,a=!0;break;case 10:r=[];var v=t.getUint32(1);i+=4;for(var y=0;y<v;y++){var m=e._parseValue(new DataView(t.buffer,t.byteOffset+i,t.byteLength-i)),g=m.data,_=m.size;r.push(g),i+=_}break;case 11:var b=t.getFloat64(i)+6e4*t.getInt16(i+8);r=new Date(b),i+=10;break;case 12:var k=t.getUint32(1);i+=4,r="",k>0&&(r=We.decode(new Uint8Array(t.buffer,t.byteOffset+i,k))),i+=k;break;default:i=n}return{data:r,size:i,isEnd:a}}},{key:"_parseString",value:function(e){var t=e.getUint16(0),r="";return t>0&&(r=We.decode(new Uint8Array(e.buffer,e.byteOffset+2,t))),{data:r,size:2+t}}},{key:"_parseObject",value:function(t){if(!(t.byteLength<3)){var r=e._parseString(t),n=e._parseValue(new DataView(t.buffer,t.byteOffset+r.size,t.byteLength-r.size));return{data:{name:r.data,value:n.data},size:r.size+n.size,isEnd:n.isEnd}}}}]),e}(),yt=new Ye("FlvDemuxer"),mt=function(){function e(t,r,n){s(this,e),c(this,"_headerParsed",!1),c(this,"_remainingData",null),c(this,"_gopId",0),c(this,"_needAddMetaBeforeKeyFrameNal",!0),this.videoTrack=t||new ze,this.audioTrack=r||new qe,this.metadataTrack=n||new Ke,this._fixer=new pt(this.videoTrack,this.audioTrack,this.metadataTrack)}return u(e,[{key:"demux",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=this.audioTrack,a=this.videoTrack,s=this.metadataTrack;if(!r&&n||(this._remainingData=null,this._headerParsed=!1),r?(a.reset(),i.reset(),s.reset()):(a.samples=[],i.samples=[],s.seiSamples=[],s.flvScriptSamples=[],a.warnings=[],i.warnings=[],this._remainingData&&(t=tt(this._remainingData,t),this._remainingData=null)),!t.length)return{videoTrack:a,audioTrack:i,metadataTrack:s};var o=0;if(!this._headerParsed){if(!e.probe(t))throw new Error("Invalid flv file");i.present=(4&t[4])>>>2!=0,a.present=0!=(1&t[4]),this._headerParsed=!0,o=it(t,5)+4}for(var u,c,l,d,h,f=t.length;o+15<f&&(u=t[o],!(o+15+(c=t[o+1]<<16|t[o+2]<<8|t[o+3])>f));)l=(t[o+7]<<24>>>0)+(t[o+4]<<16)+(t[o+5]<<8)+t[o+6],o+=11,d=t.subarray(o,o+c),8===u?this._parseAudio(d,l):9===u?this._parseVideo(d,l):18===u?this._parseScript(d,l):yt.warn("Invalid tag type: ".concat(u)),(h=it(t,o+=c))!==11+c&&yt.warn("Invalid PrevTagSize ".concat(h," (").concat(11+c,")")),o+=4;return o<f&&(this._remainingData=t.subarray(o)),i.formatTimescale=a.formatTimescale=a.timescale=s.timescale=1e3,i.timescale=i.sampleRate||0,!i.exist()&&i.hasSample()&&i.reset(),!a.exist()&&a.hasSample()&&a.reset(),{videoTrack:a,audioTrack:i,metadataTrack:s}}},{key:"fix",value:function(e,t,r){return this._fixer.fix(e,t,r),{videoTrack:this.videoTrack,audioTrack:this.audioTrack,metadataTrack:this.metadataTrack}}},{key:"demuxAndFix",value:function(e,t,r,n){return this.demux(e,t,r),this.fix(n,t,r)}},{key:"_parseAudio",value:function(t,r){if(t.length){var n=(240&t[0])>>>4,i=this.audioTrack;if(10!==n&&7!==n&&8!==n)return yt.warn("Unsupported sound format: ".concat(n)),void i.reset();if(10!==n){var a=(12&t[0])>>2,s=(2&t[0])>>1,o=1&t[0];i.sampleRate=e.AUDIO_RATE[a],i.sampleSize=s?16:8,i.channelCount=o+1}10===n?this._parseAac(t,r):this._parseG711(t,r,n)}}},{key:"_parseG711",value:function(e,t,r){var n=this.audioTrack;n.codecType=7===r?Ce:Be,n.sampleRate=8e3,n.codec=n.codecType,n.samples.push(new Fe(t,e.subarray(1)))}},{key:"_parseAac",value:function(e,t){var r=this.audioTrack;if(r.codecType=Oe,0===e[1]){var n=lt.parseAudioSpecificConfig(e.subarray(2));n?(r.codec=n.codec,r.channelCount=n.channelCount,r.sampleRate=n.sampleRate,r.config=n.config,r.objectType=n.objectType,r.sampleRateIndex=n.samplingFrequencyIndex):(r.reset(),yt.warn("Cannot parse AudioSpecificConfig",e))}else if(1===e[1]){if(null==t)return;r.samples.push(new Fe(t,e.subarray(2)))}else yt.warn("Unknown AACPacketType: ".concat(e[1]))}},{key:"_parseVideo",value:function(e,t){var r=this;if(!(e.length<6)){var n=(240&e[0])>>>4,i=15&e[0],a=this.videoTrack;if(7!==i&&12!==i)return a.reset(),void yt.warn("Unsupported codecId: ".concat(i));var s=12===i;a.codecType=s?De:Ae;var o=e[1],u=(e[2]<<16|e[3]<<8|e[4])<<8>>8;if(0===o){var c=e.subarray(5),l=s?dt.parseHEVCDecoderConfigurationRecord(c):ct.parseAVCDecoderConfigurationRecord(c);if(l){var d=l.hvcC,h=l.sps,f=l.ppsArr,p=l.spsArr,v=l.vpsArr,y=l.nalUnitSize;d&&(a.hvcC=a.hvcC||d),h&&(a.codec=h.codec,a.width=h.width,a.height=h.height,a.sarRatio=h.sarRatio,a.fpsNum=h.fpsNum,a.fpsDen=h.fpsDen),p.length&&(a.sps=p),f.length&&(a.pps=f),v&&v.length&&(a.vps=v),y&&(a.nalUnitSize=y)}else yt.warn("Cannot parse ".concat(s?"HEVC":"AVC","DecoderConfigurationRecord"),e)}else if(1===o){var m=ut.parseAvcC(e.subarray(5),a.nalUnitSize);if((m=this._checkAddMetaNalToUnits(s,m,a))&&m.length){var g=new Ne(t+u,t,m);1===n&&g.setToKeyframe(),a.samples.push(g),m.forEach((function(e){var n=s?e[0]>>>1&63:31&e[0];switch(n){case 5:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:if(!s&&5!==n||s&&5===n)break;g.setToKeyframe();break;case 6:case 39:case 40:if(!s&&6!==n||s&&6===n)break;r.metadataTrack.seiSamples.push(new He(ut.parseSEI(ut.removeEPB(e),s),t+u))}})),g.keyframe&&this._gopId++,g.gopId=this._gopId}else yt.warn("Cannot parse NALUs",e)}else 2===o||yt.warn("Unknown AVCPacketType: ".concat(o))}}},{key:"_checkAddMetaNalToUnits",value:function(e,t,r){return e&&this._needAddMetaBeforeKeyFrameNal?t.map((function(e){return e[0]>>>1&63})).includes(32)?(this._needAddMetaBeforeKeyFrameNal=!1,t):(t.unshift(r.pps[0]),t.unshift(r.sps[0]),t.unshift(r.vps[0]),t.filter(Boolean)):(this._needAddMetaBeforeKeyFrameNal=!1,t)}},{key:"_parseScript",value:function(e,t){this.metadataTrack.flvScriptSamples.push(new Ge(vt.parse(e),t))}}],[{key:"probe",value:function(e){return 70===e[0]&&76===e[1]&&86===e[2]&&1===e[3]&&it(e,5)>=9}}]),e}();c(mt,"AUDIO_RATE",[5500,11e3,22e3,44e3]),new Ye("TsDemuxer");var gt=function(){function e(){s(this,e)}return u(e,null,[{key:"findBox",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=[];if(!t)return i;for(var a=0,s="",o=0;t.length>7;){if(a=it(t),s=String.fromCharCode.apply(null,t.subarray(4,8)),o=8,1===a?(a=at(t,8),o+=8):a||(a=t.length),!r[0]||s===r[0]){var u=t.subarray(0,a);if(!(r.length<2))return e.findBox(u.subarray(o),r.slice(1),n+o);i.push({start:n,size:a,headerSize:o,type:s,data:u})}n+=a,t=t.subarray(a)}return i}},{key:"tfhd",value:function(e){return xt(e,!0,(function(e,t){e.trackId=it(t);var r=4,n=1&e.flags,i=2&e.flags,a=8&e.flags,s=16&e.flags,o=32&e.flags;n&&(r+=4,e.baseDataOffset=it(t,r),r+=4),i&&(e.sampleDescriptionIndex=it(t,r),r+=4),a&&(e.defaultSampleDuration=it(t,r),r+=4),s&&(e.defaultSampleSize=it(t,r),r+=4),o&&(e.defaultSampleFlags=it(t,r))}))}},{key:"sidx",value:function(e){return xt(e,!0,(function(e,t){var r=0;e.reference_ID=it(t,r),r+=4,e.timescale=it(t,r),r+=4,0===e.version?(e.earliest_presentation_time=it(t,r),r+=4,e.first_offset=it(t,r),r+=4):(e.earliest_presentation_time=at(t,r),r+=8,e.first_offset=at(t,r),r+=8),r+=2,e.references=[];var n=nt(t,r);r+=2;for(var i=0;i<n;i++){var a={};e.references.push(a);var s=it(t,r);r+=4,a.reference_type=s>>31&1,a.referenced_size=2147483647&s,a.subsegment_duration=it(t,r),s=it(t,r+=4),r+=4,a.starts_with_SAP=s>>31&1,a.SAP_type=s>>28&7,a.SAP_delta_time=268435455&s}}))}},{key:"moov",value:function(t){return xt(t,!1,(function(t,r,n){t.mvhd=e.mvhd(e.findBox(r,["mvhd"],n)[0]),t.trak=e.findBox(r,["trak"],n).map((function(t){return e.trak(t)})),t.pssh=e.pssh(e.findBox(r,["pssh"],n)[0])}))}},{key:"mvhd",value:function(e){return xt(e,!0,(function(e,t){var r=0;1===e.version?(e.timescale=it(t,16),e.duration=at(t,20),r+=28):(e.timescale=it(t,8),e.duration=it(t,12),r+=16),e.nextTrackId=it(t,r+76)}))}},{key:"trak",value:function(t){return xt(t,!1,(function(t,r,n){t.tkhd=e.tkhd(e.findBox(r,["tkhd"],n)[0]),t.mdia=e.mdia(e.findBox(r,["mdia"],n)[0])}))}},{key:"tkhd",value:function(e){return xt(e,!0,(function(e,t){var r=0;1===e.version?(e.trackId=it(t,16),e.duration=at(t,24),r+=32):(e.trackId=it(t,8),e.duration=it(t,16),r+=20),e.width=it(t,r+52),e.height=it(t,r+56)}))}},{key:"mdia",value:function(t){return xt(t,!1,(function(t,r,n){t.mdhd=e.mdhd(e.findBox(r,["mdhd"],n)[0]),t.hdlr=e.hdlr(e.findBox(r,["hdlr"],n)[0]),t.minf=e.minf(e.findBox(r,["minf"],n)[0])}))}},{key:"mdhd",value:function(e){return xt(e,!0,(function(e,t){var r=0;1===e.version?(e.timescale=it(t,16),e.duration=at(t,20),r+=28):(e.timescale=it(t,8),e.duration=it(t,12),r+=16);var n=nt(t,r);e.language=String.fromCharCode(96+(n>>10&31),96+(n>>5&31),96+(31&n))}))}},{key:"hdlr",value:function(e){return xt(e,!0,(function(e,t){0===e.version&&(e.handlerType=String.fromCharCode.apply(null,t.subarray(4,8)))}))}},{key:"minf",value:function(t){return xt(t,!1,(function(t,r,n){t.vmhd=e.vmhd(e.findBox(r,["vmhd"],n)[0]),t.smhd=e.smhd(e.findBox(r,["smhd"],n)[0]),t.stbl=e.stbl(e.findBox(r,["stbl"],n)[0])}))}},{key:"vmhd",value:function(e){return xt(e,!0,(function(e,t){e.graphicsmode=nt(t),e.opcolor=[nt(t,2),nt(t,4),nt(t,6)]}))}},{key:"smhd",value:function(e){return xt(e,!0,(function(e,t){e.balance=nt(t)}))}},{key:"stbl",value:function(t){return xt(t,!1,(function(t,r,n){var i,a,s;t.stsd=e.stsd(e.findBox(r,["stsd"],n)[0]),t.stts=e.stts(e.findBox(r,["stts"],n)[0]),t.ctts=e.ctts(e.findBox(r,["ctts"],n)[0]),t.stsc=e.stsc(e.findBox(r,["stsc"],n)[0]),t.stsz=e.stsz(e.findBox(r,["stsz"],n)[0]),t.stco=e.stco(e.findBox(r,["stco"],n)[0]),t.stco||(t.co64=e.co64(e.findBox(r,["co64"],n)[0]),t.stco=t.co64);var o=null===(i=t.stsd.entries[0])||void 0===i||null===(a=i.sinf)||void 0===a||null===(s=a.schi)||void 0===s?void 0:s.tenc.default_IV_size;t.stss=e.stss(e.findBox(r,["stss"],n)[0]),t.senc=e.senc(e.findBox(r,["senc"],n)[0],o)}))}},{key:"senc",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return xt(e,!0,(function(e,r){var n=0,i=it(r,n);n+=4,e.samples=[];for(var a=0;a<i;a++){for(var s={InitializationVector:[]},o=0;o<t;o++)s.InitializationVector[o]=r[n+o];if(n+=t,2&e.flags){s.subsamples=[];var u=nt(r,n);n+=2;for(var c=0;c<u;c++){var l={};l.BytesOfClearData=nt(r,n),n+=2,l.BytesOfProtectedData=it(r,n),n+=4,s.subsamples.push(l)}}e.samples.push(s)}}))}},{key:"pssh",value:function(e){return xt(e,!0,(function(e,t){for(var r=[],n=[],i=0,a=0;a<16;a++)n.push(St(t[i+a]));if(i+=16,e.version>0){var s=it(t,i);i+=4;for(var o=0;o<(""+s).length;o++)for(var u=0;u<16;u++){var c=t[i];i+=1,r.push(St(c))}}var l=it(t,i);e.data_size=l,i+=4,e.kid=r,e.system_id=n,e.buffer=t}))}},{key:"stsd",value:function(t){return xt(t,!0,(function(t,r,n){t.entryCount=it(r),t.entries=e.findBox(r.subarray(4),[],n+4).map((function(t){switch(t.type){case"avc1":case"avc2":case"avc3":case"avc4":return e.avc1(t);case"hvc1":case"hev1":return e.hvc1(t);case"mp4a":return e.mp4a(t);case"alaw":case"ulaw":return e.alaw(t);case"enca":return xt(t,!1,(function(t,r,n){t.channelCount=nt(r,16),t.samplesize=nt(r,18),t.sampleRate=it(r,24)/65536,r=r.subarray(28),t.sinf=e.sinf(e.findBox(r,["sinf"],n)[0]),t.esds=e.esds(e.findBox(r,["esds"],n)[0])}));case"encv":return xt(t,!1,(function(t,r,n){t.width=nt(r,24),t.height=nt(r,26),t.horizresolution=it(r,28),t.vertresolution=it(r,32),r=r.subarray(78),t.sinf=e.sinf(e.findBox(r,["sinf"],n)[0]),t.avcC=e.avcC(e.findBox(r,["avcC"],n)[0]),t.hvcC=e.hvcC(e.findBox(r,["hvcC"],n)[0]),t.pasp=e.pasp(e.findBox(r,["pasp"],n)[0])}))}})).filter(Boolean)}))}},{key:"tenc",value:function(e){return xt(e,!1,(function(e,t){var r=6;e.default_IsEncrypted=t[r],r+=1,e.default_IV_size=t[r],r+=1,e.default_KID=[];for(var n=0;n<16;n++)e.default_KID.push(St(t[r])),r+=1}))}},{key:"schi",value:function(t){return xt(t,!1,(function(t,r,n){t.tenc=e.tenc(e.findBox(r,["tenc"],n)[0])}))}},{key:"sinf",value:function(t){return xt(t,!1,(function(t,r,n){t.schi=e.schi(e.findBox(r,["schi"],n)[0]),t.frma=e.frma(e.findBox(r,["frma"],n)[0])}))}},{key:"frma",value:function(e){return xt(e,!1,(function(e,t){e.data_format="";for(var r=0;r<4;r++)e.data_format+=String.fromCharCode(t[r])}))}},{key:"avc1",value:function(t){return xt(t,!1,(function(t,r,n){var i=bt(t,r),a=r.subarray(i);n+=i,t.avcC=e.avcC(e.findBox(a,["avcC"],n)[0]),t.pasp=e.pasp(e.findBox(a,["pasp"],n)[0])}))}},{key:"avcC",value:function(e){return xt(e,!1,(function(e,t){e.configurationVersion=t[0],e.AVCProfileIndication=t[1],e.profileCompatibility=t[2],e.AVCLevelIndication=t[3],e.codec=st([t[1],t[2],t[3]]),e.lengthSizeMinusOne=3&t[4],e.spsLength=31&t[5],e.sps=[];for(var r=6,n=0;n<e.spsLength;n++){var i=nt(t,r);r+=2,e.sps.push(t.subarray(r,r+i)),r+=i}e.ppsLength=t[r],r+=1,e.pps=[];for(var a=0;a<e.ppsLength;a++){var s=nt(t,r);r+=2,e.pps.push(t.subarray(r,r+=s)),r+=s}}))}},{key:"hvc1",value:function(t){return xt(t,!1,(function(t,r,n){var i=bt(t,r),a=r.subarray(i);n+=i,t.hvcC=e.hvcC(e.findBox(a,["hvcC"],n)[0]),t.pasp=e.pasp(e.findBox(a,["pasp"],n)[0])}))}},{key:"hvcC",value:function(e){return xt(e,!1,(function(t,r){t.data=e.data,t.codec="hev1.1.6.L93.B0",t.configurationVersion=r[0];var n=r[1];t.generalProfileSpace=n>>6,t.generalTierFlag=(32&n)>>5,t.generalProfileIdc=31&n,t.generalProfileCompatibility=it(r,2),t.generalConstraintIndicatorFlags=r.subarray(6,12),t.generalLevelIdc=r[12],t.avgFrameRate=nt(r,19),t.numOfArrays=r[22],t.vps=[],t.sps=[],t.pps=[];for(var i=23,a=0,s=0,o=0,u=0;u<t.numOfArrays;u++){a=63&r[i],s=nt(r,i+1),i+=3;for(var c,l=[],d=0;d<s;d++)o=nt(r,i),i+=2,l.push(r.subarray(i,i+o)),i+=o;if(32===a)(c=t.vps).push.apply(c,l);else if(33===a){var h;(h=t.sps).push.apply(h,l)}else if(34===a){var f;(f=t.pps).push.apply(f,l)}}}))}},{key:"pasp",value:function(e){return xt(e,!1,(function(e,t){e.hSpacing=it(t),e.vSpacing=it(t,4)}))}},{key:"mp4a",value:function(t){return xt(t,!1,(function(t,r,n){var i=kt(t,r);t.esds=e.esds(e.findBox(r.subarray(i),["esds"],n+i)[0])}))}},{key:"esds",value:function(e){return xt(e,!0,(function(e,t){e.codec="mp4a.";for(var r=0,n=0,i=0,a=0;t.length;){for(a=t[r=0],n=t[r+1],r+=2;128&n;)i=(127&n)<<7,n=t[r],r+=1;if(i+=127&n,3===a)t=t.subarray(r+3);else{if(4!==a){if(5===a){var s=e.config=t.subarray(r,r+i),o=(248&s[0])>>3;return 31===o&&s.length>=2&&(o=32+((7&s[0])<<3)+((224&s[1])>>5)),e.objectType=o,e.codec+=o.toString(16),void("."===e.codec[e.codec.length-1]&&(e.codec=e.codec.substring(0,e.codec.length-1)))}return void("."===e.codec[e.codec.length-1]&&(e.codec=e.codec.substring(0,e.codec.length-1)))}e.codec+=(t[r].toString(16)+".").padStart(3,"0"),t=t.subarray(r+13)}}}))}},{key:"alaw",value:function(e){return xt(e,!1,(function(e,t){kt(e,t)}))}},{key:"stts",value:function(e){return xt(e,!0,(function(e,t){for(var r=it(t),n=[],i=4,a=0;a<r;a++)n.push({count:it(t,i),delta:it(t,i+4)}),i+=8;e.entryCount=r,e.entries=n}))}},{key:"ctts",value:function(e){return xt(e,!0,(function(e,t){var r=it(t),n=[],i=4;if(1===e.version)for(var a=0;a<r;a++)n.push({count:it(t,i),offset:it(t,i+4)}),i+=8;else for(var s=0;s<r;s++)n.push({count:it(t,i),offset:-(1+~it(t,i+4))}),i+=8;e.entryCount=r,e.entries=n}))}},{key:"stsc",value:function(e){return xt(e,!0,(function(e,t){for(var r=it(t),n=[],i=4,a=0;a<r;a++)n.push({firstChunk:it(t,i),samplesPerChunk:it(t,i+4),sampleDescriptionIndex:it(t,i+8)}),i+=12;e.entryCount=r,e.entries=n}))}},{key:"stsz",value:function(e){return xt(e,!0,(function(e,t){var r=it(t),n=it(t,4),i=[];if(!r)for(var a=8,s=0;s<n;s++)i.push(it(t,a)),a+=4;e.sampleSize=r,e.sampleCount=n,e.entrySizes=i}))}},{key:"stco",value:function(e){return xt(e,!0,(function(e,t){for(var r=it(t),n=[],i=4,a=0;a<r;a++)n.push(it(t,i)),i+=4;e.entryCount=r,e.entries=n}))}},{key:"co64",value:function(e){return xt(e,!0,(function(e,t){for(var r=it(t),n=[],i=4,a=0;a<r;a++)n.push(at(t,i)),i+=8;e.entryCount=r,e.entries=n}))}},{key:"stss",value:function(e){return xt(e,!0,(function(e,t){for(var r=it(t),n=[],i=4,a=0;a<r;a++)n.push(it(t,i)),i+=4;e.entryCount=r,e.entries=n}))}},{key:"moof",value:function(t){return xt(t,!1,(function(t,r,n){t.mfhd=e.mfhd(e.findBox(r,["mfhd"],n)[0]),t.traf=e.findBox(r,["traf"],n).map((function(t){return e.traf(t)}))}))}},{key:"mfhd",value:function(e){return xt(e,!0,(function(e,t){e.sequenceNumber=it(t)}))}},{key:"traf",value:function(t){return xt(t,!1,(function(t,r,n){t.tfhd=e.tfhd(e.findBox(r,["tfhd"],n)[0]),t.tfdt=e.tfdt(e.findBox(r,["tfdt"],n)[0]),t.trun=e.trun(e.findBox(r,["trun"],n)[0])}))}},{key:"trun",value:function(e){return xt(e,!0,(function(e,t){var r=e.version,n=e.flags,i=t.length,a=e.sampleCount=it(t),s=4;if(i>s&&1&n&&(e.dataOffset=-(1+~it(t,s)),s+=4),i>s&&4&n&&(e.firstSampleFlags=it(t,s),s+=4),e.samples=[],i>s)for(var o,u=0;u<a;u++)o={},256&n&&(o.duration=it(t,s),s+=4),512&n&&(o.size=it(t,s),s+=4),1024&n&&(o.flags=it(t,s),s+=4),2048&n&&(o.cts=r?-(1+~it(t,s+4)):it(t,s),s+=4),e.samples.push(o)}))}},{key:"tfdt",value:function(e){return xt(e,!0,(function(e,t){1===e.version?e.baseMediaDecodeTime=at(t):e.baseMediaDecodeTime=it(t)}))}},{key:"probe",value:function(t){return!!e.findBox(t,["ftyp"])}},{key:"parseSampleFlags",value: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]}}},{key:"moovToTrack",value:function(e,t,r){var n,i,a=e.trak;if(a&&a.length){var s=a.find((function(e){var t,r;return"vide"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)})),o=a.find((function(e){var t,r;return"soun"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)}));if(s&&t){var u,c,l,d,h,f,p,v=t,y=null===(u=s.tkhd)||void 0===u?void 0:u.trackId;null!=y&&(v.id=s.tkhd.trackId),v.tkhdDuration=s.tkhd.duration,v.mvhdDurtion=e.mvhd.duration,v.mvhdTimecale=e.mvhd.timescale,v.timescale=v.formatTimescale=s.mdia.mdhd.timescale,v.duration=s.mdia.mdhd.duration||v.mvhdDurtion/v.mvhdTimecale*v.timescale;var m,g,_,b,k,x,w,S,j=s.mdia.minf.stbl.stsd.entries[0];if(v.width=j.width,v.height=j.height,j.pasp&&(v.sarRatio=[j.pasp.hSpacing,j.pasp.vSpacing]),j.hvcC)v.codecType=De,v.codec=j.hvcC.codec,v.vps=j.hvcC.vps,v.sps=j.hvcC.sps,v.pps=j.hvcC.pps,v.hvcC=j.hvcC.data;else{if(!j.avcC)throw new Error("unknown video stsd entry");v.codec=j.avcC.codec,v.sps=j.avcC.sps,v.pps=j.avcC.pps}if(v.present=!0,v.ext={},v.ext.stss=null===(c=s.mdia)||void 0===c||null===(l=c.minf)||void 0===l||null===(d=l.stbl)||void 0===d?void 0:d.stss,v.ext.ctts=null===(h=s.mdia)||void 0===h||null===(f=h.minf)||void 0===f||null===(p=f.stbl)||void 0===p?void 0:p.ctts,j&&"encv"===j.type)v.isVideoEncryption=!0,j.default_KID=null===(m=j.sinf)||void 0===m||null===(g=m.schi)||void 0===g?void 0:g.tenc.default_KID,j.default_IsEncrypted=null===(_=j.sinf)||void 0===_||null===(b=_.schi)||void 0===b?void 0:b.tenc.default_IsEncrypted,j.default_IV_size=null===(k=j.sinf)||void 0===k||null===(x=k.schi)||void 0===x?void 0:x.tenc.default_IV_size,v.videoSenc=s.mdia.minf.stbl.senc&&s.mdia.minf.stbl.senc.samples,j.data_format=null===(w=j.sinf)||void 0===w||null===(S=w.frma)||void 0===S?void 0:S.data_format,v.useEME=e.useEME,v.kidValue=e.kidValue,v.pssh=e.pssh,v.encv=j}if(o&&r){var E,T,A,D,O,C,B,L,R,P=r,U=null===(E=o.tkhd)||void 0===E?void 0:E.trackId;null!=U&&(P.id=o.tkhd.trackId),P.tkhdDuration=o.tkhd.duration,P.mvhdDurtion=e.mvhd.duration,P.mvhdTimecale=e.mvhd.timescale,P.timescale=P.formatTimescale=o.mdia.mdhd.timescale,P.duration=o.mdia.mdhd.duration||P.mvhdDurtion/P.mvhdTimecale*P.timescale;var I,M,z,q,N,F,V,G,H=o.mdia.minf.stbl.stsd.entries[0];switch(P.sampleSize=H.sampleSize,P.sampleRate=H.sampleRate,P.channelCount=H.channelCount,P.present=!0,H.type){case"alaw":P.codecType=P.codec=Ce,P.sampleRate=8e3;break;case"ulaw":P.codecType=P.codec=Be,P.sampleRate=8e3;break;default:P.sampleDuration=lt.getFrameDuration(P.sampleRate,P.timescale),P.sampleRateIndex=lt.getRateIndexByRate(P.sampleRate),P.objectType=(null===(n=H.esds)||void 0===n?void 0:n.objectType)||2,H.esds&&(P.config=Array.from(H.esds.config)),P.codec=(null===(i=H.esds)||void 0===i?void 0:i.codec)||"mp4a.40.2"}if(P.sampleDuration=lt.getFrameDuration(P.sampleRate,P.timescale),P.objectType=(null===(T=H.esds)||void 0===T?void 0:T.objectType)||2,H.esds&&(H.esds.config?P.config=Array.from(H.esds.config):console.warn("esds config is null")),P.codec=(null===(A=H.esds)||void 0===A?void 0:A.codec)||"mp4a.40.2",P.sampleRateIndex=lt.getRateIndexByRate(P.sampleRate),P.ext={},P.ext.stss=null===(D=o.mdia)||void 0===D||null===(O=D.minf)||void 0===O||null===(C=O.stbl)||void 0===C?void 0:C.stss,P.ext.ctts=null===(B=o.mdia)||void 0===B||null===(L=B.minf)||void 0===L||null===(R=L.stbl)||void 0===R?void 0:R.ctts,P.present=!0,H&&"enca"===H.type)P.isAudioEncryption=!0,H.data_format=null===(I=H.sinf)||void 0===I||null===(M=I.frma)||void 0===M?void 0:M.data_format,H.default_KID=null===(z=H.sinf)||void 0===z||null===(q=z.schi)||void 0===q?void 0:q.tenc.default_KID,H.default_IsEncrypted=null===(N=H.sinf)||void 0===N||null===(F=N.schi)||void 0===F?void 0:F.tenc.default_IsEncrypted,H.default_IV_size=null===(V=H.sinf)||void 0===V||null===(G=V.schi)||void 0===G?void 0:G.tenc.default_IV_size,P.audioSenc=o.mdia.minf.stbl.senc&&o.mdia.minf.stbl.senc.samples,P.useEME=e.useEME,P.kidValue=e.kidValue,P.enca=H}if(r&&(r.isVideoEncryption=!!t&&t.isVideoEncryption),t&&(t.isAudioEncryption=!!r&&r.isAudioEncryption),null!=t&&t.encv||null!=r&&r.enca){var K,Q,Y=null==t||null===(K=t.encv)||void 0===K?void 0:K.default_KID,W=null==r||null===(Q=r.enca)||void 0===Q?void 0:Q.default_KID,X=Y||W?(Y||W).join(""):null;t&&(t.kid=X),r&&(r.kid=X)}return t&&(t.flags=3841),r&&(r.flags=1793),{videoTrack:t,audioTrack:r}}}},{key:"evaluateDefaultDuration",value:function(e,t,r){var n,i=null==t||null===(n=t.samples)||void 0===n?void 0:n.length;return i?1024*i/t.timescale*e.timescale/r:1024}},{key:"moofToSamples",value:function(t,r,n){var i={};return t.mfhd&&(r&&(r.sequenceNumber=t.mfhd.sequenceNumber),n&&(n.sequenceNumber=t.mfhd.sequenceNumber)),t.traf.forEach((function(t){var a=t.tfhd,s=t.tfdt,o=t.trun;if(a&&o){s&&(r&&r.id===a.trackId&&(r.baseMediaDecodeTime=s.baseMediaDecodeTime),n&&n.id===a.trackId&&(n.baseMediaDecodeTime=s.baseMediaDecodeTime));var u=a.defaultSampleSize||0,c=a.defaultSampleDuration||e.evaluateDefaultDuration(r,n,o.samples.length||o.sampleCount),l=o.dataOffset||0,d=0,h=-1;if(!o.samples.length&&o.sampleCount){i[a.trackId]=[];for(var f=0;f<o.sampleCount;f++)i[a.trackId].push({offset:l,dts:d,duration:c,size:u}),d+=c,l+=u}else i[a.trackId]=o.samples.map((function(e,t){return(e={offset:l,dts:d,pts:d+(e.cts||0),duration:e.duration||c,size:e.size||u,gopId:h,keyframe:0===t||null!==e.flags&&void 0!==e.flags&&(65536&e.flags)>>>0!=65536}).keyframe&&(h++,e.gopId=h),d+=e.duration,l+=e.size,e}))}})),i}},{key:"moovToSamples",value:function(e){var t=e.trak;if(t&&t.length){var r=t.find((function(e){var t,r;return"vide"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)})),n=t.find((function(e){var t,r;return"soun"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)}));if(r||n){var i,a;if(r){var s,o,u=null===(s=r.mdia)||void 0===s||null===(o=s.minf)||void 0===o?void 0:o.stbl;if(!u)return;var c=u.stts,l=u.stsc,d=u.stsz,h=u.stco,f=u.stss,p=u.ctts;if(!(c&&l&&d&&h&&f))return;i=_t(c,l,d,h,p,f)}if(n){var v,y,m,g=null===(v=n.mdia)||void 0===v||null===(y=v.minf)||void 0===y?void 0:y.stbl;if(!g)return;var _=null===(m=n.mdia.mdhd)||void 0===m?void 0:m.timescale,b=g.stts,k=g.stsc,x=g.stsz,w=g.stco;if(!(_&&b&&k&&x&&w))return;a=_t(b,k,x,w)}return{videoSamples:i,audioSamples:a}}}}}]),e}();function _t(e,t,r,n,i,a){var s,o,u,c=[],l=null==i?void 0:i.entries,d=t.entries,h=n.entries,f=r.entrySizes,p=null==a?void 0:a.entries;p&&(s={},p.forEach((function(e){s[e-1]=!0}))),l&&(o=[],l.forEach((function(e){for(var t=e.count,r=e.offset,n=0;n<t;n++)o.push(r)})));var v=-1,y=0,m=0,g=0,_=0,b=0,k=d[0].samplesPerChunk,x=d[1]?d[1].firstChunk-1:1/0;return e.entries.forEach((function(e){for(var t=e.count,n=e.delta,i=0;i<t;i++)u={dts:y,duration:n,size:f[m]||r.sampleSize,offset:h[g]+b,index:m},p&&(u.keyframe=s[m],u.keyframe&&v++,u.gopId=v),o&&m<o.length&&(u.pts=u.dts+o[m]),c.push(u),y+=n,++m<k?b+=u.size:(g++,b=0,g>=x&&(_++,x=d[_+1]?d[_+1].firstChunk-1:1/0),k+=d[_].samplesPerChunk)})),c}function bt(e,t){return e.dataReferenceIndex=nt(t,6),e.width=nt(t,24),e.height=nt(t,26),e.horizresolution=it(t,28),e.vertresolution=it(t,32),e.frameCount=nt(t,40),e.depth=nt(t,74),78}function kt(e,t){return e.dataReferenceIndex=nt(t,6),e.channelCount=nt(t,16),e.sampleSize=nt(t,18),e.sampleRate=it(t,24)/65536,28}function xt(e,t,r){if(e){if(e.size!==e.data.length)throw new Error("box ".concat(e.type," size !== data.length"));var n={start:e.start,size:e.size,headerSize:e.headerSize,type:e.type};return t&&(n.version=e.data[e.headerSize],n.flags=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(e[t]<<16)+(e[t+1]<<8)+(e[t+2]||0)}(e.data,e.headerSize+1),n.headerSize+=4),r(n,e.data.subarray(n.headerSize),n.start+n.headerSize),n}}var wt=function(e,t,r){for(var n=String(r),i=t>>0,a=Math.ceil(i/n.length),s=[],o=String(e);a--;)s.push(n);return s.join("").substring(0,i-o.length)+o},St=function(){for(var e=[],t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.forEach((function(t){e.push(wt(Number(t).toString(16),2,0))})),e[0]};function jt(e){for(var t=0,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];n.forEach((function(e){t+=e.length}));var a=new e(t),s=0;return n.forEach((function(e){a.set(e,s),s+=e.length})),a}var Et=function(){function e(){s(this,e),this.buffer=new Uint8Array(0)}return u(e,[{key:"write",value:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];r.forEach((function(t){t?e.buffer=jt(Uint8Array,e.buffer,t):window.console.warn(t)}))}}],[{key:"writeUint16",value:function(e){return new Uint8Array([e>>8&255,255&e])}},{key:"writeUint32",value:function(e){return new Uint8Array([e>>24,e>>16&255,e>>8&255,255&e])}}]),e}(),Tt=Math.pow(2,32)-1,At=function(){function e(){s(this,e)}return u(e,null,[{key:"box",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=8+(r=r.filter(Boolean)).reduce((function(e,t){return e+t.byteLength}),0),a=new Uint8Array(i);a[0]=i>>24&255,a[1]=i>>16&255,a[2]=i>>8&255,a[3]=255&i,a.set(e,4);var s=8;return r.forEach((function(e){a.set(e,s),s+=e.byteLength})),a}},{key:"ftyp",value:function(t){return t.find((function(e){return e.type===je&&e.codecType===De}))?e.FTYPHEV1:e.FTYPAVC1}},{key:"initSegment",value:function(t){return tt(e.ftyp(t),e.moov(t))}},{key:"pssh",value:function(t){var r=new Uint8Array([1,0,0,0].concat([16,119,239,236,192,178,77,2,172,227,60,30,82,226,251,75],[0,0,0,1],ot(t.kid),[0,0,0,0]));return e.box(e.types.pssh,r)}},{key:"moov",value:function(t){if(t[0].useEME&&(t[0].encv||t[0].enca)){t[0].pssh||(t[0].pssh={kid:t[0].kid});var r=this.pssh(t[0].pssh);return e.box.apply(e,[e.types.moov,e.mvhd(t[0].mvhdDurtion||t[0].duration,t[0].mvhdTimecale||t[0].timescale),e.mvex(t)].concat(w(t.map((function(t){return e.trak(t)}))),[r]))}return e.box.apply(e,[e.types.moov,e.mvhd(t[0].mvhdDurtion||t[0].duration,t[0].mvhdTimecale||t[0].timescale)].concat(w(t.map((function(t){return e.trak(t)}))),[e.mvex(t)]))}},{key:"mvhd",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4,n=e.box(e.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r,t>>24&255,t>>16&255,t>>8&255,255&t,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]));return n}},{key:"trak",value:function(t){return e.box(e.types.trak,e.tkhd(t.id,t.tkhdDuration||0,t.width,t.height),e.mdia(t))}},{key:"tkhd",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,t>>24&255,t>>16&255,t>>8&255,255&t,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,n>>8&255,255&n,0,0,i>>8&255,255&i,0,0]));return a}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t.duration,t.timescale),e.hdlr(t.type),e.minf(t))}},{key:"mdhd",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4,n=e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r,t>>24&255,t>>16&255,t>>8&255,255&t,85,196,0,0]));return n}},{key:"hdlr",value:function(t){return e.box(e.types.hdlr,e.HDLR_TYPES[t])}},{key:"minf",value:function(t){return e.box(e.types.minf,t.type===je?e.VMHD:e.SMHD,e.DINF,e.stbl(t))}},{key:"stbl",value:function(t){var r=[];return t&&t.ext&&t.ext.stss&&r.push(e.stss(t.ext.stss.entries)),e.box(e.types.stbl,e.stsd(t),e.STTS,r[0],e.STSC,e.STSZ,e.STCO)}},{key:"stsd",value:function(t){var r;return r="audio"===t.type?t.useEME&&t.enca?e.enca(t):e.mp4a(t):t.useEME&&t.encv?e.encv(t):e.avc1hev1(t),e.box(e.types.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),r)}},{key:"enca",value:function(t){var r=t.enca.channelCount,n=t.enca.sampleRate,i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,r,0,16,0,0,0,0,n>>8&255,255&n,0,0]),a=e.esds(t.config),s=e.sinf(t.enca);return e.box(e.types.enca,i,a,s)}},{key:"encv",value:function(t){var r,n,i=t.sps.length>0?t.sps[0]:[],a=t.pps.length>0?t.pps[0]:[],s=t.width,o=t.height,u=t.sarRatio[0],c=t.sarRatio[1],l=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,s>>8&255,255&s,o>>8&255,255&o,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),d=new Uint8Array((r=(n=[1,i[1],i[2],i[3],255,225,i.length>>>8&255,255&i.length]).concat.apply(n,w(i)).concat([1,a.length>>>8&255,255&a.length])).concat.apply(r,w(a))),h=new Uint8Array([0,0,88,57,0,15,200,192,0,4,86,72]),f=e.sinf(t.encv),p=new Uint8Array([u>>24,u>>16&255,u>>8&255,255&u,c>>24,c>>16&255,c>>8&255,255&c]);return e.box(e.types.encv,l,e.box(e.types.avcC,d),e.box(e.types.btrt,h),f,e.box(e.types.pasp,p))}},{key:"schi",value:function(t){var r=new Uint8Array([]),n=e.tenc(t);return e.box(e.types.schi,r,n)}},{key:"tenc",value:function(t){var r=new Uint8Array([0,0,0,0,0,0,255&t.default_IsEncrypted,255&t.default_IV_size].concat(ot(t.default_KID)));return e.box(e.types.tenc,r)}},{key:"sinf",value:function(t){var r=new Uint8Array([]),n=new Uint8Array([t.data_format.charCodeAt(0),t.data_format.charCodeAt(1),t.data_format.charCodeAt(2),t.data_format.charCodeAt(3)]),i=new Uint8Array([0,0,0,0,99,101,110,99,0,1,0,0]),a=e.schi(t);return e.box(e.types.sinf,r,e.box(e.types.frma,n),e.box(e.types.schm,i),a)}},{key:"avc1hev1",value:function(t){var r=t.codecType===De,n=r?e.types.hvc1:e.types.avc1,i=r?e.hvcC(t):e.avcC(t),a=[new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,t.width>>8&255,255&t.width,t.height>>8&255,255&t.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),i];return r?a.push(e.box(e.types.fiel,new Uint8Array([1,0]))):t.sarRatio&&t.sarRatio.length>1&&a.push(e.pasp(t.sarRatio)),e.box.apply(e,[n].concat(a))}},{key:"avcC",value:function(t){var r,n,i,a=[],s=[];return t.sps.forEach((function(e){i=e.byteLength,a.push(i>>>8&255),a.push(255&i),a.push.apply(a,w(e))})),t.pps.forEach((function(e){i=e.byteLength,s.push(i>>>8&255),s.push(255&i),s.push.apply(s,w(e))})),e.box(e.types.avcC,new Uint8Array((r=(n=[1,a[3],a[4],a[5],255,224|t.sps.length]).concat.apply(n,a).concat([t.pps.length])).concat.apply(r,s)))}},{key:"hvcC",value:function(t){var r=t.hvcC;if(r instanceof ArrayBuffer||r instanceof Uint8Array)return r;var n,i=t.vps,a=t.sps,s=t.pps;if(r){var o=r.generalProfileCompatibilityFlags,u=r.generalConstraintIndicatorFlags,c=(i.length&&1)+(a.length&&1)+(s.length&&1);n=[1,r.generalProfileSpace<<6|r.generalTierFlag<<5|r.generalProfileIdc,o>>>24,o>>>16,o>>>8,o,u[0],u[1],u[2],u[3],u[4],u[5],r.generalLevelIdc,240,0,252,252|r.chromaFormatIdc,248|r.bitDepthLumaMinus8,248|r.bitDepthChromaMinus8,0,0,r.numTemporalLayers<<3|r.temporalIdNested<<2|3,c];var l=function(e){var t;n.push(e.length>>8,e.length),(t=n).push.apply(t,w(e))};i.length&&(n.push(160,0,i.length),i.forEach(l)),a.length&&(n.push(161,0,a.length),a.forEach(l)),s.length&&(n.push(162,0,s.length),s.forEach(l))}else n=[1,1,96,0,0,0,144,0,0,0,0,0,93,240,0,252,253,248,248,0,0,15,3,160,0,1,0,24,64,1,12,1,255,255,1,96,0,0,3,0,144,0,0,3,0,0,3,0,93,153,152,9,161,0,1,0,45,66,1,1,1,96,0,0,3,0,144,0,0,3,0,0,3,0,93,160,2,128,128,45,22,89,153,164,147,43,154,128,128,128,130,0,0,3,0,2,0,0,3,0,50,16,162,0,1,0,7,68,1,193,114,180,98,64];return e.box(e.types.hvcC,new Uint8Array(n))}},{key:"pasp",value:function(t){var r=x(t,2),n=r[0],i=r[1];return e.box(e.types.pasp,new Uint8Array([n>>24,n>>16&255,n>>8&255,255&n,i>>24,i>>16&255,i>>8&255,255&i]))}},{key:"mp4a",value:function(t){return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,t.sampleRate>>8&255,255&t.sampleRate,0,0]),t.config.length?e.esds(t.config):void 0)}},{key:"esds",value:function(t){var r=t.length;return e.box(e.types.esds,new Uint8Array([0,0,0,0,3,23+r,0,0,0,4,15+r,64,21,0,6,0,0,0,218,192,0,0,218,192,5].concat([r]).concat(t).concat([6,1,2])))}},{key:"mvex",value:function(t){return e.box.apply(e,[e.types.mvex].concat(w(t.map((function(t){return e.trex(t.id)})))))}},{key:"trex",value:function(t){return e.box(e.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"trex1",value:function(t){return e.box(e.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,2,0,0,0,0,0,0,1,0,0]))}},{key:"trex2",value:function(t){return e.box(e.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,4,0,0,0,0,0,2,0,0,0]))}},{key:"moof",value:function(t){return e.box.apply(e,[e.types.moof,e.mfhd(t[0].samples?t[0].samples[0].gopId:0)].concat(w(t.map((function(t){return e.traf(t)})))))}},{key:"mfhd",value:function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"traf",value:function(t){var r=e.tfhd(t.id),n=e.tfdt(t,t.baseMediaDecodeTime),i=0;if(t.isVideo&&t.videoSenc&&t.videoSenc.forEach((function(e){i+=8,e.subsamples&&e.subsamples.length&&(i+=2,i+=6*e.subsamples.length)})),t.videoSencLength=i,t.useEME&&(t.isVideoEncryption||t.isAudioEncryption)){if(t.isVideoEncryption){if(t.isVideo){var a=e.saiz(t),s=e.saio(t),o=e.trun1(t),u=e.senc(t);return e.box(e.types.traf,r,n,a,s,o,u)}if(t.isAudioEncryption){var c=e.sbgp(),l=e.saiz(t),d=e.saio(t),h=e.senc(t),f=e.trun1(t);return e.box(e.types.traf,r,n,c,l,d,h,f)}var p=e.sbgp(),v=e.trun1(t);return e.box(e.types.traf,r,n,p,v)}if(t.isVideo){var y=e.trun1(t);return e.box(e.types.traf,r,n,y)}var m=e.sbgp(),g=e.saiz(t),_=e.saio(t),b=e.senc(t),k=e.trun1(t);return e.box(e.types.traf,r,n,m,g,_,b,k)}var x=e.sdtp(t);return e.box(e.types.traf,r,n,x,e.trun(t.samples,x.byteLength+76))}},{key:"sdtp",value:function(t){var r=new Et;return t.samples.forEach((function(e){r.write(new Uint8Array(t.isVideo?[e.keyframe?32:16]:[16]))})),e.box(e.types.sdtp,this.extension(0,0),r.buffer)}},{key:"trun1",value:function(t){var r=new Et,n=Et.writeUint32(t.samples.length),i=null;if(t.isVideo){var a=t.videoSencLength;i=Et.writeUint32(16*t.samples.length+a+149),!t.isVideoEncryption&&t.isAudioEncryption&&(i=Et.writeUint32(16*t.samples.length+92))}else{var s=12*t.samples.length+124;t.isAudioEncryption&&(s=12*t.samples.length+8*t.audioSenc.length+177),i=Et.writeUint32(s)}return t.samples.forEach((function(e){r.write(Et.writeUint32(e.duration)),r.write(Et.writeUint32(e.size)),r.write(Et.writeUint32(e.keyframe?33554432:65536)),t.isVideo&&r.write(Et.writeUint32(e.cts?e.cts:0))})),e.box(e.types.trun,this.extension(0,t.flags),n,i,r.buffer)}},{key:"senc",value:function(t){var r=new Et,n=t.samples.length,i=t.isVideo?16:8,a=t.isVideo?2:0,s=[],o=0;return t.isVideo?(s=t.videoSenc,o=t.videoSencLength):s=t.audioSenc,o=o||i*n,r.write(Et.writeUint32(16+o),e.types.senc,this.extension(0,a)),r.write(Et.writeUint32(n)),s.forEach((function(e){for(var t=0;t<e.InitializationVector.length;t++)r.write(new Uint8Array([e.InitializationVector[t]]));e.subsamples&&e.subsamples.length&&(r.write(Et.writeUint16(e.subsamples.length)),e.subsamples.forEach((function(e){r.write(Et.writeUint16(e.BytesOfClearData)),r.write(Et.writeUint32(e.BytesOfProtectedData))})))})),r.buffer}},{key:"saio",value:function(t){var r=12*t.samples.length+141;!t.isVideo&&t.isAudioEncryption&&(r=149);var n=new Uint8Array([1,0,0,0,0,0,0,1,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r]);return e.box(e.types.saio,n)}},{key:"saiz",value:function(t){var r=t.samples.length,n=new Uint8Array([0,0,0,0,16,r>>24&255,r>>16&255,r>>8&255,255&r]);return e.box(e.types.saiz,n)}},{key:"sbgp",value:function(){var t=new Uint8Array([114,111,108,108,0,0,0,1,0,0,1,25,0,0,0,1]);return e.box(e.types.sbgp,this.extension(0,0),t)}},{key:"extension",value:function(e,t){return new Uint8Array([e,t>>16&255,t>>8&255,255&t])}},{key:"tfhd",value:function(t){return e.box(e.types.tfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"tfdt",value:function(t,r){var n=Math.floor(r/(Tt+1)),i=Math.floor(r%(Tt+1));return t.useEME&&(t.isVideoEncryption||t.isAudioEncryption)?e.box(e.types.tfdt,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i])):e.box(e.types.tfdt,new Uint8Array([1,0,0,0,n>>24,n>>16&255,n>>8&255,255&n,i>>24,i>>16&255,i>>8&255,255&i]))}},{key:"trun",value:function(t,r){var n=t.length,i=12+16*n;r+=8+i;var a=new Uint8Array(i);a.set([0,0,15,1,n>>>24&255,n>>>16&255,n>>>8&255,255&n,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0);for(var s=0;s<n;s++){var o=t[s],u=o.duration,c=o.size,l=o.flag,d=void 0===l?{}:l,h=o.cts,f=void 0===h?0:h;a.set([u>>>24&255,u>>>16&255,u>>>8&255,255&u,c>>>24&255,c>>>16&255,c>>>8&255,255&c,d.isLeading<<2|(null===d.dependsOn||void 0===d.dependsOn?1:d.dependsOn),d.isDependedOn<<6|d.hasRedundancy<<4|d.paddingValue<<1|(null===d.isNonSyncSample||void 0===d.isNonSyncSample?1:d.isNonSyncSample),61440&d.degradationPriority,15&d.degradationPriority,f>>>24&255,f>>>16&255,f>>>8&255,255&f],12+16*s)}return e.box(e.types.trun,a)}},{key:"moovMP4",value:function(t){return e.box.apply(e,[e.types.moov,e.mvhd(t[0].duration,t[0].timescale)].concat(w(t.map((function(t){return e.trackMP4(t)})))))}},{key:"trackMP4",value:function(t){return e.box(e.types.trak,e.tkhd(t.id,t.duration,t.width,t.height),e.mdiaMP4(t))}},{key:"mdiaMP4",value:function(t){return e.box(e.types.mdia,e.mdhd(t.duration,t.timescale),e.hdlr(t.type),e.minfMP4(t))}},{key:"minfMP4",value:function(t){return e.box(e.types.minf,t.type===je?e.VMHD:e.SMHD,e.DINF,e.stblMP4(t))}},{key:"stblMP4",value:function(t){var r=t.ext,n=[e.stsd(t),e.stts(r.stts),e.stsc(r.stsc),e.stsz(r.stsz),e.stco(r.stco)];return r.stss.length&&n.push(e.stss(r.stss)),r.ctts.length&&n.push(e.ctts(r.ctts)),e.box.apply(e,[e.types.stbl].concat(n))}},{key:"stts",value:function(t){var r=t.length,n=new Uint8Array(8*r),i=0;return t.forEach((function(e){var t=e.value,r=e.count;n.set([r>>24,r>>16&255,r>>8&255,255&r,t>>24,t>>16&255,t>>8&255,255&t],i),i+=8})),e.box(e.types.stts,tt(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stsc",value:function(t){var r=t.length,n=new Uint8Array(12*r),i=0;return t.forEach((function(e){var t=e.firstChunk,r=e.samplesPerChunk,a=e.sampleDescIndex;n.set([t>>24,t>>16&255,t>>8&255,255&t,r>>24,r>>16&255,r>>8&255,255&r,a>>24,a>>16&255,a>>8&255,255&a],i),i+=12})),e.box(e.types.stsc,tt(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stsz",value:function(t){var r=t.length,n=new Uint8Array(4*r),i=0;return t.forEach((function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],i),i+=4})),e.box(e.types.stsz,tt(new Uint8Array([0,0,0,0,0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stco",value:function(t){var r=t.length,n=new Uint8Array(4*r),i=0;return t.forEach((function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],i),i+=4})),e.box(e.types.stco,tt(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stss",value:function(t){var r=t.length,n=new Uint8Array(4*r),i=0;return t.forEach((function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],i),i+=4})),e.box(e.types.stss,tt(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"ctts",value:function(t){var r=t.length,n=new Uint8Array(8*r),i=0;return t.forEach((function(e){var t=e.value,r=e.count;n.set([r>>24,r>>16&255,r>>8&255,255&r,t>>24,t>>16&255,t>>8&255,255&t],i),i+=8})),e.box(e.types.ctts,tt(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"styp",value:function(){return e.box(e.types.styp,new Uint8Array([109,115,100,104,0,0,0,0,109,115,100,104,109,115,105,120]))}},{key:"sidx",value:function(t){var r=t.timescale,n=t.samples[0].duration,i=n*t.samples.length,a=t.samples[0].sampleOffset*n,s=8;t.samples.forEach((function(e){s+=e.size}));var o=0;if(t.isVideo){var u,c=0;t.videoSenc&&(u=t.videoSenc),t.isVideo&&u.forEach((function(e){c+=8,e.subsamples&&e.subsamples.length&&(c+=2,c+=6*e.subsamples.length)})),t.videoSencLength=c,o=s+141+16*t.samples.length+c,t.useEME&&t.isAudioEncryption&&!t.isVideoEncryption&&(o=s+16*t.samples.length+84)}else o=s+116+12*t.samples.length,t.useEME&&t.isAudioEncryption&&(o=s+169+12*t.samples.length+8*t.audioSenc.length);var l=new Uint8Array([0,0,0,0,0,0,0,255&t.id,r>>24&255,r>>16&255,r>>8&255,255&r,a>>24&255,a>>16&255,a>>8&255,255&a,0,0,0,0,0,0,0,1,0,o>>16&255,o>>8&255,255&o,i>>24&255,i>>16&255,i>>8&255,255&i,144,0,0,0]);return e.box(e.types.sidx,l)}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}}]),e}();c(At,"types",["avc1","avcC","hvc1","hvcC","dinf","dref","esds","ftyp","hdlr","mdat","mdhd","mdia","mfhd","minf","moof","moov","mp4a","mvex","mvhd","pasp","stbl","stco","stsc","stsd","stsz","stts","tfdt","tfhd","traf","trak","trex","tkhd","vmhd","smhd","ctts","stss","styp","pssh","sidx","sbgp","saiz","saio","senc","trun","encv","enca","sinf","btrt","frma","tenc","schm","schi","mehd","fiel","sdtp"].reduce((function(e,t){return e[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)],e}),Object.create(null))),c(At,"HDLR_TYPES",{video:new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),audio:new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0])}),c(At,"FTYPAVC1",At.box(At.types.ftyp,new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]))),c(At,"FTYPHEV1",At.box(At.types.ftyp,new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,104,101,118,49]))),c(At,"DINF",At.box(At.types.dinf,At.box(At.types.dref,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1])))),c(At,"VMHD",At.box(At.types.vmhd,new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]))),c(At,"SMHD",At.box(At.types.smhd,new Uint8Array([0,0,0,0,0,0,0,0]))),c(At,"StblTable",new Uint8Array([0,0,0,0,0,0,0,0])),c(At,"STTS",At.box(At.types.stts,At.StblTable)),c(At,"STSC",At.box(At.types.stsc,At.StblTable)),c(At,"STSZ",At.box(At.types.stsz,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]))),c(At,"STCO",At.box(At.types.stco,At.StblTable));var Dt=function(){function e(t,r){s(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]"),e.disabled=r}return u(e,[{key:"debug",value:function(){var t;if(!e.disabled){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];(t=console).debug.apply(t,[this._prefix].concat(n))}}},{key:"log",value:function(){var t;if(!e.disabled){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];(t=console).log.apply(t,[this._prefix].concat(n))}}},{key:"warn",value:function(){var t;if(!e.disabled){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];(t=console).warn.apply(t,[this._prefix].concat(n))}}},{key:"error",value:function(){var t;if(!e.disabled){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];(t=console).error.apply(t,[this._prefix].concat(n))}}},{key:"table",value:function(){var t;e.disabled||(console.group(this._prefix),(t=console).table.apply(t,arguments),console.groupEnd())}}],[{key:"enable",value:function(){e.disabled=!1}},{key:"disable",value:function(){e.disabled=!0}}]),e}();c(Dt,"disabled",!0);for(var Ot=function(){function e(){s(this,e)}return u(e,[{key:"mixIn",value:function(e){return Object.assign(this,e)}},{key:"clone",value:function(){var e=new this.constructor;return Object.assign(e,this),e}}],[{key:"create",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return p(this,t)}}]),e}(),Ct=function(e){l(r,e);var t=_(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4*n.length;s(this,r),e=t.call(this);var a=n;if(a instanceof ArrayBuffer&&(a=new Uint8Array(a)),(a instanceof Int8Array||a instanceof Uint8ClampedArray||a instanceof Int16Array||a instanceof Uint16Array||a instanceof Int32Array||a instanceof Uint32Array||a instanceof Float32Array||a instanceof Float64Array)&&(a=new Uint8Array(a.buffer,a.byteOffset,a.byteLength)),a instanceof Uint8Array){for(var o=a.byteLength,u=[],c=0;c<o;c+=1)u[c>>>2]|=a[c]<<24-c%4*8;e.words=u,e.sigBytes=o}else e.words=n,e.sigBytes=i;return e}return u(r,[{key:"toString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Bt;return e.stringify(this)}},{key:"concat",value:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var a=0;a<i;a+=1){var s=r[a>>>2]>>>24-a%4*8&255;t[n+a>>>2]|=s<<24-(n+a)%4*8}else for(var o=0;o<i;o+=4)t[n+o>>>2]=r[o>>>2];return this.sigBytes+=i,this}},{key:"clamp",value:function(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-t%4*8,e.length=Math.ceil(t/4)}},{key:"clone",value:function(){var e=k(d(r.prototype),"clone",this).call(this);return e.words=this.words.slice(0),e}}],[{key:"random",value:function(e){for(var t,n=[],i=function(e){var t=e,r=987654321,n=4294967295;return function(){var e=((r=36969*(65535&r)+(r>>16)&n)<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n;return e/=4294967296,(e+=.5)*(Math.random()>.5?1:-1)}},a=0;a<e;a+=4){var s=i(4294967296*(t||Math.random()));t=987654071*s(),n.push(4294967296*s()|0)}return new r(n,e)}}]),r}(Ot),Bt={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i+=1){var a=t[i>>>2]>>>24-i%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new Ct(r,t/2)}},Lt=function(e){for(var t=e.length,r=[],n=0;n<t;n+=1)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new Ct(r,t)},Rt=function(e){return Lt(unescape(encodeURIComponent(e)))},Pt=function(e){l(r,e);var t=_(r);function r(){var e;return s(this,r),(e=t.call(this))._minBufferSize=0,e}return u(r,[{key:"reset",value:function(){this._data=new Ct,this._nDataBytes=0}},{key:"_append",value:function(e){var t=e;"string"==typeof t&&(t=Rt(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes}},{key:"_process",value:function(e){var t,r=this._data,n=this.blockSize,i=r.words,a=r.sigBytes,s=a/(4*n),o=(s=e?Math.ceil(s):Math.max((0|s)-this._minBufferSize,0))*n,u=Math.min(4*o,a);if(o){for(var c=0;c<o;c+=n)this._doProcessBlock(i,c);t=i.splice(0,o),r.sigBytes-=u}return new Ct(t,u)}},{key:"clone",value:function(){var e=k(d(r.prototype),"clone",this).call(this);return e._data=this._data.clone(),e}}]),r}(Ot),Ut=function(e){l(r,e);var t=_(r);function r(e){var n;return s(this,r),(n=t.call(this)).blockSize=16,n.cfg=Object.assign(new Ot,e),n.reset(),n}return u(r,[{key:"reset",value:function(){k(d(r.prototype),"reset",this).call(this),this._doReset()}},{key:"update",value:function(e){return this._append(e),this._process(),this}},{key:"finalize",value:function(e){return e&&this._append(e),this._doFinalize()}}],[{key:"_createHelper",value:function(e){return function(t,r){return new e(r).finalize(t)}}},{key:"_createHmacHelper",value:function(e){return function(t,r){return new It(e,r).finalize(t)}}}]),r}(Pt),It=function(e){l(r,e);var t=_(r);function r(e,n){var i;s(this,r),i=t.call(this);var a=new e;i._hasher=a;var o=n;"string"==typeof o&&(o=Rt(o));var u=a.blockSize,c=4*u;o.sigBytes>c&&(o=a.finalize(n)),o.clamp();var l=o.clone();i._oKey=l;var d=o.clone();i._iKey=d;for(var h=l.words,f=d.words,p=0;p<u;p+=1)h[p]^=1549556828,f[p]^=909522486;return l.sigBytes=c,d.sigBytes=c,i.reset(),i}return u(r,[{key:"reset",value:function(){var e=this._hasher;e.reset(),e.update(this._iKey)}},{key:"update",value:function(e){return this._hasher.update(e),this}},{key:"finalize",value:function(e){var t=this._hasher,r=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(r))}}]),r}(Ot),Mt={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],a=0;a<r;a+=3)for(var s=(t[a>>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,o=0;o<4&&a+.75*o<r;o+=1)i.push(n.charAt(s>>>6*(3-o)&63));var u=n.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(e){var t=e.length,r=this._map,n=this._reverseMap;if(!n){this._reverseMap=[],n=this._reverseMap;for(var i=0;i<r.length;i+=1)n[r.charCodeAt(i)]=i}var a=r.charAt(64);if(a){var s=e.indexOf(a);-1!==s&&(t=s)}return function(e,t,r){for(var n=[],i=0,a=0;a<t;a+=1)if(a%4){var s=r[e.charCodeAt(a-1)]<<a%4*2|r[e.charCodeAt(a)]>>>6-a%4*2;n[i>>>2]|=s<<24-i%4*8,i+=1}return Ct.create(n,i)}(e,t,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},zt=[],qt=0;qt<64;qt+=1)zt[qt]=4294967296*Math.abs(Math.sin(qt+1))|0;var Nt=function(e,t,r,n,i,a,s){var o=e+(t&r|~t&n)+i+s;return(o<<a|o>>>32-a)+t},Ft=function(e,t,r,n,i,a,s){var o=e+(t&n|r&~n)+i+s;return(o<<a|o>>>32-a)+t},Vt=function(e,t,r,n,i,a,s){var o=e+(t^r^n)+i+s;return(o<<a|o>>>32-a)+t},Gt=function(e,t,r,n,i,a,s){var o=e+(r^(t|~n))+i+s;return(o<<a|o>>>32-a)+t},Ht=function(e){l(r,e);var t=_(r);function r(){return s(this,r),t.apply(this,arguments)}return u(r,[{key:"_doReset",value:function(){this._hash=new Ct([1732584193,4023233417,2562383102,271733878])}},{key:"_doProcessBlock",value:function(e,t){for(var r=e,n=0;n<16;n+=1){var i=t+n,a=e[i];r[i]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}var s=this._hash.words,o=r[t+0],u=r[t+1],c=r[t+2],l=r[t+3],d=r[t+4],h=r[t+5],f=r[t+6],p=r[t+7],v=r[t+8],y=r[t+9],m=r[t+10],g=r[t+11],_=r[t+12],b=r[t+13],k=r[t+14],x=r[t+15],w=s[0],S=s[1],j=s[2],E=s[3];w=Nt(w,S,j,E,o,7,zt[0]),E=Nt(E,w,S,j,u,12,zt[1]),j=Nt(j,E,w,S,c,17,zt[2]),S=Nt(S,j,E,w,l,22,zt[3]),w=Nt(w,S,j,E,d,7,zt[4]),E=Nt(E,w,S,j,h,12,zt[5]),j=Nt(j,E,w,S,f,17,zt[6]),S=Nt(S,j,E,w,p,22,zt[7]),w=Nt(w,S,j,E,v,7,zt[8]),E=Nt(E,w,S,j,y,12,zt[9]),j=Nt(j,E,w,S,m,17,zt[10]),S=Nt(S,j,E,w,g,22,zt[11]),w=Nt(w,S,j,E,_,7,zt[12]),E=Nt(E,w,S,j,b,12,zt[13]),j=Nt(j,E,w,S,k,17,zt[14]),S=Nt(S,j,E,w,x,22,zt[15]),w=Ft(w,S,j,E,u,5,zt[16]),E=Ft(E,w,S,j,f,9,zt[17]),j=Ft(j,E,w,S,g,14,zt[18]),S=Ft(S,j,E,w,o,20,zt[19]),w=Ft(w,S,j,E,h,5,zt[20]),E=Ft(E,w,S,j,m,9,zt[21]),j=Ft(j,E,w,S,x,14,zt[22]),S=Ft(S,j,E,w,d,20,zt[23]),w=Ft(w,S,j,E,y,5,zt[24]),E=Ft(E,w,S,j,k,9,zt[25]),j=Ft(j,E,w,S,l,14,zt[26]),S=Ft(S,j,E,w,v,20,zt[27]),w=Ft(w,S,j,E,b,5,zt[28]),E=Ft(E,w,S,j,c,9,zt[29]),j=Ft(j,E,w,S,p,14,zt[30]),S=Ft(S,j,E,w,_,20,zt[31]),w=Vt(w,S,j,E,h,4,zt[32]),E=Vt(E,w,S,j,v,11,zt[33]),j=Vt(j,E,w,S,g,16,zt[34]),S=Vt(S,j,E,w,k,23,zt[35]),w=Vt(w,S,j,E,u,4,zt[36]),E=Vt(E,w,S,j,d,11,zt[37]),j=Vt(j,E,w,S,p,16,zt[38]),S=Vt(S,j,E,w,m,23,zt[39]),w=Vt(w,S,j,E,b,4,zt[40]),E=Vt(E,w,S,j,o,11,zt[41]),j=Vt(j,E,w,S,l,16,zt[42]),S=Vt(S,j,E,w,f,23,zt[43]),w=Vt(w,S,j,E,y,4,zt[44]),E=Vt(E,w,S,j,_,11,zt[45]),j=Vt(j,E,w,S,x,16,zt[46]),S=Vt(S,j,E,w,c,23,zt[47]),w=Gt(w,S,j,E,o,6,zt[48]),E=Gt(E,w,S,j,p,10,zt[49]),j=Gt(j,E,w,S,k,15,zt[50]),S=Gt(S,j,E,w,h,21,zt[51]),w=Gt(w,S,j,E,_,6,zt[52]),E=Gt(E,w,S,j,l,10,zt[53]),j=Gt(j,E,w,S,m,15,zt[54]),S=Gt(S,j,E,w,u,21,zt[55]),w=Gt(w,S,j,E,v,6,zt[56]),E=Gt(E,w,S,j,x,10,zt[57]),j=Gt(j,E,w,S,f,15,zt[58]),S=Gt(S,j,E,w,b,21,zt[59]),w=Gt(w,S,j,E,d,6,zt[60]),E=Gt(E,w,S,j,g,10,zt[61]),j=Gt(j,E,w,S,c,15,zt[62]),S=Gt(S,j,E,w,y,21,zt[63]),s[0]=s[0]+w|0,s[1]=s[1]+S|0,s[2]=s[2]+j|0,s[3]=s[3]+E|0}},{key:"_doFinalize",value:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32;var i=Math.floor(r/4294967296),a=r;t[15+(n+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),t[14+(n+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(t.length+1),this._process();for(var s=this._hash,o=s.words,u=0;u<4;u+=1){var c=o[u];o[u]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}return s}},{key:"clone",value:function(){var e=k(d(r.prototype),"clone",this).call(this);return e._hash=this._hash.clone(),e}}]),r}(Ut);Ut._createHelper(Ht),Ut._createHmacHelper(Ht);var Kt=function(e){l(r,e);var t=_(r);function r(e){var n;return s(this,r),(n=t.call(this)).cfg=Object.assign(new Ot,{keySize:4,hasher:Ht,iterations:1},e),n}return u(r,[{key:"compute",value:function(e,t){for(var r,n=this.cfg,i=n.hasher.create(),a=Ct.create(),s=a.words,o=n.keySize,u=n.iterations;s.length<o;){r&&i.update(r),r=i.update(e).finalize(t),i.reset();for(var c=1;c<u;c+=1)r=i.finalize(r),i.reset();a.concat(r)}return a.sigBytes=4*o,a}}]),r}(Ot),Qt=function(e){l(r,e);var t=_(r);function r(e,n,i){var a;return s(this,r),(a=t.call(this)).cfg=Object.assign(new Ot,i),a._xformMode=e,a._key=n,a.reset(),a}return u(r,[{key:"reset",value:function(){k(d(r.prototype),"reset",this).call(this),this._doReset()}},{key:"process",value:function(e){return this._append(e),this._process()}},{key:"finalize",value:function(e){return e&&this._append(e),this._doFinalize()}}],[{key:"createEncryptor",value:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)}},{key:"createDecryptor",value:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)}},{key:"_createHelper",value:function(e){var t=function(e){return"string"==typeof e?nr:tr};return{encrypt:function(r,n,i){return t(n).encrypt(e,r,n,i)},decrypt:function(r,n,i){return t(n).decrypt(e,r,n,i)}}}}]),r}(Pt);Qt._ENC_XFORM_MODE=1,Qt._DEC_XFORM_MODE=2,Qt.keySize=4,Qt.ivSize=4;var Yt=function(e){l(r,e);var t=_(r);function r(e,n){var i;return s(this,r),(i=t.call(this))._cipher=e,i._iv=n,i}return u(r,null,[{key:"createEncryptor",value:function(e,t){return this.Encryptor.create(e,t)}},{key:"createDecryptor",value:function(e,t){return this.Decryptor.create(e,t)}}]),r}(Ot);function Wt(e,t,r){var n,i=e,a=this._iv;a?(n=a,this._iv=void 0):n=this._prevBlock;for(var s=0;s<r;s+=1)i[t+s]^=n[s]}var Xt=function(e){l(r,e);var t=_(r);function r(){return s(this,r),t.apply(this,arguments)}return u(r)}(Yt);Xt.Encryptor=function(e){l(r,e);var t=_(r);function r(){return s(this,r),t.apply(this,arguments)}return u(r,[{key:"processBlock",value:function(e,t){var r=this._cipher,n=r.blockSize;Wt.call(this,e,t,n),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+n)}}]),r}(Xt),Xt.Decryptor=function(e){l(r,e);var t=_(r);function r(){return s(this,r),t.apply(this,arguments)}return u(r,[{key:"processBlock",value:function(e,t){var r=this._cipher,n=r.blockSize,i=e.slice(t,t+n);r.decryptBlock(e,t),Wt.call(this,e,t,n),this._prevBlock=i}}]),r}(Xt);var Jt={pad:function(e,t){for(var r=4*t,n=r-e.sigBytes%r,i=n<<24|n<<16|n<<8|n,a=[],s=0;s<n;s+=4)a.push(i);var o=Ct.create(a,n);e.concat(o)},unpad:function(e){var t=e,r=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=r}},Zt=function(e){l(r,e);var t=_(r);function r(e,n,i){var a;return s(this,r),(a=t.call(this,e,n,Object.assign({mode:Xt,padding:Jt},i))).blockSize=4,a}return u(r,[{key:"reset",value:function(){var e;k(d(r.prototype),"reset",this).call(this);var t=this.cfg,n=t.iv,i=t.mode;this._xformMode===this.constructor._ENC_XFORM_MODE?e=i.createEncryptor:(e=i.createDecryptor,this._minBufferSize=1),this._mode=e.call(i,this,n&&n.words),this._mode.__creator=e}},{key:"_doProcessBlock",value:function(e,t){this._mode.processBlock(e,t)}},{key:"_doFinalize",value:function(){var e,t=this.cfg.padding;return this._xformMode===this.constructor._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e}}]),r}(Qt),$t=function(e){l(r,e);var t=_(r);function r(e){var n;return s(this,r),(n=t.call(this)).mixIn(e),n}return u(r,[{key:"toString",value:function(e){return(e||this.formatter).stringify(this)}}]),r}(Ot),er={stringify:function(e){var t=e.ciphertext,r=e.salt;return(r?Ct.create([1398893684,1701076831]).concat(r).concat(t):t).toString(Mt)},parse:function(e){var t,r=Mt.parse(e),n=r.words;return 1398893684===n[0]&&1701076831===n[1]&&(t=Ct.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),$t.create({ciphertext:r,salt:t})}},tr=function(e){l(r,e);var t=_(r);function r(){return s(this,r),t.apply(this,arguments)}return u(r,null,[{key:"encrypt",value:function(e,t,r,n){var i=Object.assign(new Ot,this.cfg,n),a=e.createEncryptor(r,i),s=a.finalize(t),o=a.cfg;return $t.create({ciphertext:s,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:a.blockSize,formatter:i.format})}},{key:"decrypt",value:function(e,t,r,n){var i=t,a=Object.assign(new Ot,this.cfg,n);return i=this._parse(i,a.format),e.createDecryptor(r,a).finalize(i.ciphertext)}},{key:"_parse",value:function(e,t){return"string"==typeof e?t.parse(e,this):e}}]),r}(Ot);tr.cfg=Object.assign(new Ot,{format:er});var rr={execute:function(e,t,r,n){var i=n;i||(i=Ct.random(8));var a=Kt.create({keySize:t+r}).compute(e,i),s=Ct.create(a.words.slice(t),4*r);return a.sigBytes=4*t,$t.create({key:a,iv:s,salt:i})}},nr=function(e){l(r,e);var t=_(r);function r(){return s(this,r),t.apply(this,arguments)}return u(r,null,[{key:"encrypt",value:function(e,t,r,n){var i=Object.assign(new Ot,this.cfg,n),a=i.kdf.execute(r,e.keySize,e.ivSize);i.iv=a.iv;var s=tr.encrypt.call(this,e,t,a.key,i);return s.mixIn(a),s}},{key:"decrypt",value:function(e,t,r,n){var i=t,a=Object.assign(new Ot,this.cfg,n);i=this._parse(i,a.format);var s=a.kdf.execute(r,e.keySize,e.ivSize,i.salt);return a.iv=s.iv,tr.decrypt.call(this,e,i,s.key,a)}}]),r}(tr);nr.cfg=Object.assign(tr.cfg,{kdf:rr});for(var ir=[],ar=[],sr=[],or=[],ur=[],cr=[],lr=[],dr=[],hr=[],fr=[],pr=[],vr=0;vr<256;vr+=1)pr[vr]=vr<128?vr<<1:vr<<1^283;for(var yr=0,mr=0,gr=0;gr<256;gr+=1){var _r=mr^mr<<1^mr<<2^mr<<3^mr<<4;_r=_r>>>8^255&_r^99,ir[yr]=_r,ar[_r]=yr;var br=pr[yr],kr=pr[br],xr=pr[kr],wr=257*pr[_r]^16843008*_r;sr[yr]=wr<<24|wr>>>8,or[yr]=wr<<16|wr>>>16,ur[yr]=wr<<8|wr>>>24,cr[yr]=wr,wr=16843009*xr^65537*kr^257*br^16843008*yr,lr[_r]=wr<<24|wr>>>8,dr[_r]=wr<<16|wr>>>16,hr[_r]=wr<<8|wr>>>24,fr[_r]=wr,yr?(yr=br^pr[pr[pr[xr^br]]],mr^=pr[pr[mr]]):yr=mr=1}var Sr=[0,1,2,4,8,16,32,64,128,27,54],jr=function(e){l(r,e);var t=_(r);function r(){return s(this,r),t.apply(this,arguments)}return u(r,[{key:"_doReset",value:function(){var e;if(!this._nRounds||this._keyPriorReset!==this._key){this._keyPriorReset=this._key;var t=this._keyPriorReset,r=t.words,n=t.sigBytes/4;this._nRounds=n+6;var i=4*(this._nRounds+1);this._keySchedule=[];for(var a=this._keySchedule,s=0;s<i;s+=1)s<n?a[s]=r[s]:(e=a[s-1],s%n?n>6&&s%n==4&&(e=ir[e>>>24]<<24|ir[e>>>16&255]<<16|ir[e>>>8&255]<<8|ir[255&e]):(e=ir[(e=e<<8|e>>>24)>>>24]<<24|ir[e>>>16&255]<<16|ir[e>>>8&255]<<8|ir[255&e],e^=Sr[s/n|0]<<24),a[s]=a[s-n]^e);this._invKeySchedule=[];for(var o=this._invKeySchedule,u=0;u<i;u+=1){var c=i-u;e=u%4?a[c]:a[c-4],o[u]=u<4||c<=4?e:lr[ir[e>>>24]]^dr[ir[e>>>16&255]]^hr[ir[e>>>8&255]]^fr[ir[255&e]]}}}},{key:"encryptBlock",value:function(e,t){this._doCryptBlock(e,t,this._keySchedule,sr,or,ur,cr,ir)}},{key:"decryptBlock",value:function(e,t){var r=e,n=r[t+1];r[t+1]=r[t+3],r[t+3]=n,this._doCryptBlock(r,t,this._invKeySchedule,lr,dr,hr,fr,ar),n=r[t+1],r[t+1]=r[t+3],r[t+3]=n}},{key:"_doCryptBlock",value:function(e,t,r,n,i,a,s,o){for(var u=e,c=this._nRounds,l=u[t]^r[0],d=u[t+1]^r[1],h=u[t+2]^r[2],f=u[t+3]^r[3],p=4,v=1;v<c;v+=1){var y=n[l>>>24]^i[d>>>16&255]^a[h>>>8&255]^s[255&f]^r[p];p+=1;var m=n[d>>>24]^i[h>>>16&255]^a[f>>>8&255]^s[255&l]^r[p];p+=1;var g=n[h>>>24]^i[f>>>16&255]^a[l>>>8&255]^s[255&d]^r[p];p+=1;var _=n[f>>>24]^i[l>>>16&255]^a[d>>>8&255]^s[255&h]^r[p];p+=1,l=y,d=m,h=g,f=_}var b=(o[l>>>24]<<24|o[d>>>16&255]<<16|o[h>>>8&255]<<8|o[255&f])^r[p];p+=1;var k=(o[d>>>24]<<24|o[h>>>16&255]<<16|o[f>>>8&255]<<8|o[255&l])^r[p];p+=1;var x=(o[h>>>24]<<24|o[f>>>16&255]<<16|o[l>>>8&255]<<8|o[255&d])^r[p];p+=1;var w=(o[f>>>24]<<24|o[l>>>16&255]<<16|o[d>>>8&255]<<8|o[255&h])^r[p];p+=1,u[t]=b,u[t+1]=k,u[t+2]=x,u[t+3]=w}}]),r}(Zt);jr.keySize=8,Zt._createHelper(jr);var Er=function(e){l(r,e);var t=_(r);function r(){return s(this,r),t.apply(this,arguments)}return u(r)}(Yt);Er.Encryptor=function(e){l(r,e);var t=_(r);function r(){return s(this,r),t.apply(this,arguments)}return u(r,[{key:"processBlock",value:function(e,t){var r=e,n=this._cipher,i=n.blockSize,a=this._iv,s=this._counter;a&&(this._counter=a.slice(0),s=this._counter,this._iv=void 0);var o=s.slice(0);n.encryptBlock(o,0),s[i-1]=s[i-1]+1|0;for(var u=0;u<i;u+=1)r[t+u]^=o[u]}}]),r}(Er),Er.Decryptor=Er.Encryptor;var Tr=u((function e(t,r){s(this,e),this.type="file",this.message=t,this.data=r})),Ar=function(){function e(){s(this,e),c(this,"_data",Object.create(null))}return u(e,[{key:"set",value:function(e,t){this._data[e]=t}},{key:"get",value:function(e){return this._data[e]}},{key:"clear",value:function(){this._data=Object.create(null)}}]),e}();function Dr(e,t){var r=e.trak;if(r&&r.length){var n=r.find((function(e){var t,r;return"vide"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)})),i=r.find((function(e){var t,r;return"soun"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)}));if(n||i){var a,s=[],o=[];if(n){var u,c,l,d=null===(u=n.mdia)||void 0===u||null===(c=u.minf)||void 0===c?void 0:c.stbl;if(!d)return;var h=null===(l=n.mdia.mdhd)||void 0===l?void 0:l.timescale,f=d.stts,p=d.stsc,v=d.stsz,y=d.stco,m=d.stss,g=d.ctts;if(!(h&&f&&p&&v&&y&&m))return;a=(s=Or(t,h,f,p,v,y,m,g)).map((function(e){return e.duration}))}if(i){var _,b,k,x=null===(_=i.mdia)||void 0===_||null===(b=_.minf)||void 0===b?void 0:b.stbl;if(!x)return;var w=null===(k=i.mdia.mdhd)||void 0===k?void 0:k.timescale,S=x.stts,j=x.stsc,E=x.stsz,T=x.stco;if(!(w&&S&&j&&E&&T))return;o=Or(t,w,S,j,E,T,null,null,a)}return{videoSegments:s,audioSegments:o}}}}function Or(e,t,r,n,i,a,s,o,u){var c,l,d,h,f=[],p=[],v=[],y=n.entries,m=a.entries,g=i.entrySizes,_=null==s?void 0:s.entries,b=null==o?void 0:o.entries;b&&(c=[],b.forEach((function(e){for(var t=e.count,r=e.offset,n=0;n<t;n++)c.push(r)}))),_&&(l={},_.forEach((function(e){l[e-1]=!0})));var k=0,x=0,S=0,j=0,E=0,T=y[0].samplesPerChunk,A=y[1]?y[1].firstChunk-1:1/0,D=0,O=-1;r.entries.forEach((function(e){var t=e.count,r=e.delta;h=r;for(var n=0;n<t;n++)d={dts:D,startTime:k,duration:h,size:g[x]||i.sampleSize,offset:m[S]+E,index:x},_&&(d.keyframe=l[x],d.keyframe?(O++,p.push([d]),v.push(d.duration)):(p[p.length-1].push(d),v[p.length-1]+=d.duration),d.gopId=O),c&&x<c.length&&(d.pts=D+c[x]),0===x&&(d.pts=0),f.push(d),k+=h,D+=r,++x<T?E+=d.size:(S++,E=0,S>=A&&(j++,A=y[j+1]?y[j+1].firstChunk-1:1/0),T+=y[j].samplesPerChunk)}));var C=f.length;if(C&&(!s||f[0].keyframe)){var B,L=[],R=[],P=0,U=0,I=function(e){var r;B=R[R.length-1],L.push({index:L.length,startTime:(null===(r=L[L.length-1])||void 0===r?void 0:r.endTime)||R[0].startTime/t,endTime:(B.startTime+B.duration)/t,duration:e,range:[R[0].offset,B.offset+B.size],frames:R}),P=0,R=[]};if(s)for(var M=e*t,z=0,q=p.length;z<q;z++){var N;P+=v[z],(N=R).push.apply(N,w(p[z])),z+1<q?(0===z||P>M)&&I(P/t):I(P/t)}else for(var F=(u=u||[])[0]||e,V=0;V<C;V++){R.push(f[V]);var G=(P+=f[V].duration)/t;(V+1>=C||G+U>=F)&&(U+=G-F,I(G),F=u[L.length]||e)}return L}}function Cr(e){var t="",r="",n=0,i=0,a=0,s=0,o=0,u=0,c=0;e.mvhd&&(o=e.mvhd.duration/e.mvhd.timescale);var l=e.trak;if(l){var d,h,f,p,v,y,m,g,_,b,k,x,w,S,j,E,T,A=l.find((function(e){var t,r;return"vide"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)})),D=l.find((function(e){var t,r;return"soun"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)})),O=null;if(A)if(O=null===(h=A.mdia)||void 0===h||null===(f=h.minf)||void 0===f||null===(p=f.stbl)||void 0===p?void 0:p.stsd.entries[0])if(n=O.width,i=O.height,u=null===(v=A.mdia)||void 0===v||null===(y=v.mdhd)||void 0===y?void 0:y.timescale,t=null===(m=O.avcC||O.hvcC)||void 0===m?void 0:m.codec,"encv"===O.type)d=null===(g=O.sinf)||void 0===g||null===(_=g.schi)||void 0===_?void 0:_.tenc.default_KID;if(D)if(O=null===(b=D.mdia)||void 0===b||null===(k=b.minf)||void 0===k||null===(x=k.stbl)||void 0===x?void 0:x.stsd.entries[0])if(a=O.channelCount,s=O.sampleRate,r=null===(w=O.esds)||void 0===w?void 0:w.codec,c=null===(S=D.mdia)||void 0===S||null===(j=S.mdhd)||void 0===j?void 0:j.timescale,"enca"===O.type)d=d||(null===(E=O.sinf)||void 0===E||null===(T=E.schi)||void 0===T?void 0:T.tenc.default_KID);return{kid:d?d.join(""):null,videoCodec:t,audioCodec:r,width:n,height:i,videoTimescale:u,audioChannelCount:a,audioSampleRate:s,duration:o,audioTimescale:c,moov:e}}}function Br(e){return"number"==typeof e&&!Number.isNaN(e)}var Lr=["vid","cache"],Rr=function(e){l(S,e);var n,i,o,d,h,f,p,v,g,b,k,w=_(S);function S(e){var r;s(this,S),c(m(r=w.call(this)),"vid",""),c(m(r),"url",""),c(m(r),"meta",{}),c(m(r),"downloadInfo",[]),c(m(r),"videoSegments",[]),c(m(r),"audioSegments",[]),c(m(r),"cache",null),c(m(r),"_currentSegmentIndex",-1),c(m(r),"_currentLoadingSegmentIndex",-1),c(m(r),"buffer",void 0),c(m(r),"_error",void 0),c(m(r),"_transformError",(function(e){return e})),r._config=t({vid:"",moovEnd:8e4,segmentDuration:2,maxDownloadInfoSize:30,responseType:"arraybuffer",cache:null},e);var n=r._config,i=n.vid,a=n.cache,o=y(n,Lr);return r.cache=a||new Ar,r.vid=i||o.url,r.url=o.url,o.transformError=r._transformError,r.logger=new Q("MP4Loader_"+r.vid),e.openLog&&Q.enable(),o.logger=r.logger,r._loader=new Se(o),r._loader.on(pe,(function(e){r.emit(pe,e)})),r}return u(S,[{key:"isMetaLoaded",get:function(){return this.videoSegments.length||this.audioSegments.length}},{key:"setCurrentSegment",value:function(e){Br(e)&&(this._currentSegmentIndex=e)}},{key:"isLastSegment",value:function(e){var t,r;return!!Br(e)&&e>=((null===(t=this.videoSegments[this.videoSegments.length-1])||void 0===t?void 0:t.index)||(null===(r=this.audioSegments[this.audioSegments.length-1])||void 0===r?void 0:r.index)||0)}},{key:"isSegmentLoading",value:function(e){return e===this._currentLoadingSegmentIndex}},{key:"changeUrl",value:(k=a(r().mark((function e(t){var n,i,a,s=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:t,i=s.length>2?s[2]:void 0,a=s.length>3?s[3]:void 0,e.next=5,this.reset(a);case 5:t&&(this.url=t),n&&(this.vid=n),i&&(this._config.moovEnd=i);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return k.apply(this,arguments)})},{key:"getOrLoadMeta",value:(b=a(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isMetaLoaded){e.next=3;break}return e.next=3,this.loadMeta(t);case 3:return e.abrupt("return",this.meta);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return b.apply(this,arguments)})},{key:"loadMetaProcess",value:(g=a(r().mark((function e(n,i,s,o){var u,c,l,d,h=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=x(i,2),c=u[0],l=u[1],this._error=!1,this.logger.debug("[loadMetaProcess start], range,",[c,l]),d=function(){var e=a(r().mark((function e(t,i,a){var u,d,f,p,v,y,m,g;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h.meta&&null!=a&&a.range&&a.range.length>0&&a.range[1]>=l&&(i=!0,h.logger.debug("[loadMetaProcess],data done,setstate true,[",c,l,"]")),i&&null!=a&&a.range&&a.range.length>0&&a.range[1]<l&&(i=!1,h.logger.debug("[loadMetaProcess],data not done,setstate false,[",c,l,"]")),h.logger.debug("[loadMetaProcess],task,[",c,l,"], range,",a.range,",dataLen,",t?t.byteLength:void 0,", state,",i,",err,",h._error),!h._error&&t&&t.byteLength>0&&s(t,i,a),!h.meta.moov&&!h._error){e.next=6;break}return e.abrupt("return");case 6:if(!(t&&t.byteLength>0)){e.next=44;break}if(h.buffer=xe(h.buffer,t),u=gt.findBox(h.buffer,["moov"])[0]){e.next=23;break}if(d=gt.findBox(h.buffer,["mdat"])[0],!i){e.next=23;break}if(d){e.next=18;break}return h._error=!0,s(null,i,a,{err:"cannot find moov or mdat box"}),e.abrupt("return");case 18:return f=d.start+d.size,e.next=21,h.loadData([f,""],n,o);case 21:(p=e.sent)&&(u=gt.findBox(p.data,["moov"])[0]);case 23:if(!(u&&i&&u.size>u.data.length)){e.next=27;break}return h.logger.debug("[loadMetaProcess],moov not all, range,",a.range[1],",dataLen,",h.buffer.byteLength,", state,",i),e.next=27,h.loadMetaProcess(n,[a.range[1],u.start+u.size-1],s);case 27:if(!(u&&u.size<=u.data.length)||h.meta.moov){e.next=44;break}if(v=gt.moov(u)){e.next=33;break}return h._error=!0,s(null,i,a,{err:"cannot parse moov box"}),e.abrupt("return");case 33:if(y=Dr(v,h._config.segmentDuration)){e.next=38;break}return h._error=!0,s(null,i,a,{err:"cannot parse segments"}),e.abrupt("return");case 38:h.meta=Cr(v),m=y.videoSegments,g=y.audioSegments,h.videoSegments=m,h.audioSegments=g,h.logger.debug("[loadMetaProcess] moov ok"),s(void 0,i,{meta:{meta:h.meta,videoSegments:m,audioSegments:g}});case 44:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),e.next=6,this.loadData([c,l||this._config.moovEnd],n,t({onProgress:d},o));case 6:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return g.apply(this,arguments)})},{key:"loadMeta",value:(v=a(r().mark((function e(t,n,i){var a,s,o,u,c,l,d,h,f;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=[],this.logger.debug("[loadMeta start]"),e.next=4,this.loadData([0,n||this._config.moovEnd],t,i);case 4:if(s=e.sent){e.next=7;break}return e.abrupt("return");case 7:if(a.push(s),o=gt.findBox(s.data,["moov"])[0]){e.next=23;break}if(u=gt.findBox(s.data,["mdat"])[0]){e.next=13;break}throw new Tr("cannot find moov or mdat box",s.data);case 13:return c=u.start+u.size,e.next=16,this.loadData([c],t,i);case 16:if(s=e.sent){e.next=19;break}return e.abrupt("return");case 19:if(a.push(s),o=gt.findBox(s.data,["moov"],c)[0]){e.next=23;break}throw new Tr("cannot find moov box",s.data);case 23:if(!(o.size>o.data.length)){e.next=31;break}return e.next=26,this.loadData([s.data.length,o.start+o.size-1],t,i);case 26:if(s=e.sent){e.next=29;break}return e.abrupt("return");case 29:a.push(s),o.data=xe(o.data,s.data);case 31:if(l=gt.moov(o)){e.next=34;break}throw new Tr("cannot parse moov box",o.data);case 34:if(d=Dr(l,this._config.segmentDuration)){e.next=37;break}throw new Tr("cannot parse segments",o.data);case 37:return this.meta=Cr(l),h=d.videoSegments,f=d.audioSegments,this.videoSegments=h,this.audioSegments=f,this.logger.debug("[load moov end!!!!!]"),e.abrupt("return",{meta:this.meta,videoSegments:h,audioSegments:f,responses:a});case 43:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return v.apply(this,arguments)})},{key:"loadCacheMeta",value:function(e,t){var r=Dr(e.moov,this._config.segmentDuration),n=r.videoSegments,i=r.audioSegments;this.videoSegments=n,this.audioSegments=i,this._currentSegmentIndex=t,this.meta=e}},{key:"getSegmentByTime",value:function(e){var t,r;return this.videoSegments.length?(t=this.videoSegments.find((function(t){return t.startTime<=e&&t.endTime>e})))&&(r=this.audioSegments[t.index]):r=this.audioSegments.find((function(t){return t.startTime<=e&&t.endTime>e})),{video:t,audio:r}}},{key:"loadSegmentByTime",value:(p=a(r().mark((function e(t,n){var i,a,s,o,u,c=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=!(c.length>2&&void 0!==c[2])||c[2],a=c.length>3&&void 0!==c[3]?c[3]:{},this.isMetaLoaded){e.next=5;break}return e.next=5,this.loadMeta(n);case 5:return s=this.getSegmentByTime(t),o=s.video,u=s.audio,e.abrupt("return",this._loadSegment(o,u,n,i,a));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"loadNextSegment",value:(f=a(r().mark((function e(t){var n,i,a,s,o=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!(o.length>1&&void 0!==o[1])||o[1],i=o.length>2&&void 0!==o[2]?o[2]:{},this.isMetaLoaded){e.next=5;break}return e.next=5,this.loadMeta();case 5:return a=this.videoSegments[this._currentSegmentIndex+1],s=this.audioSegments[this._currentSegmentIndex+1],e.abrupt("return",this._loadSegment(a,s,t,n,i));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"preload",value:(h=a(r().mark((function e(t){var n,i,s,o,u,c,l,d=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isMetaLoaded){e.next=3;break}return e.next=3,this.loadMeta(!0);case 3:if(t&&!(t<0)){e.next=5;break}return e.abrupt("return");case 5:if(n=this.getSegmentByTime(t),i=n.video,s=n.audio,o=Math.max((null==i?void 0:i.index)||0,(null==s?void 0:s.index)||0)){e.next=9;break}return e.abrupt("return");case 9:return u=this.videoSegments.slice(0,o),c=this.audioSegments.slice(0,o),l=function(){var e=a(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t>o)){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,d._loadSegment(u[t],c[t],!0,!1);case 4:return e.next=6,l(t+1);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.next=14,l(0);case 14:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"cancel",value:function(){return this._loader.cancel()}},{key:"reset",value:(d=a(r().mark((function e(){var t=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.length>0&&void 0!==t[0]&&t[0]){e.next=5;break}return this.logger.debug("[MP4loader reset func call loader.cancel]"),e.next=5,this._loader.cancel();case 5:this.vid=this.url="",this.meta={},this.downloadInfo=[],this.videoSegments=[],this.audioSegments=[],this._currentSegmentIndex=-1,this._currentLoadingSegmentIndex=-1;case 12:case"end":return e.stop()}}),e,this)}))),function(){return d.apply(this,arguments)})},{key:"destroy",value:(o=a(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.reset();case 2:this.cache.clear();case 3:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"_loadSegment",value:(i=a(r().mark((function e(t,n,i,a,s){var o,u;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t||n){e.next=2;break}return e.abrupt("return");case 2:return o=(null==t?void 0:t.index)||(null==n?void 0:n.index)||0,this._currentLoadingSegmentIndex=o,e.prev=4,e.next=7,this.loadData([Math.min((null==t?void 0:t.range[0])||1/0,(null==n?void 0:n.range[0])||1/0),Math.max((null==t?void 0:t.range[1])||0,(null==n?void 0:n.range[1])||0)],i,s);case 7:u=e.sent;case 8:return e.prev=8,this._currentLoadingSegmentIndex=-1,e.finish(8);case 11:if(u){e.next=13;break}return e.abrupt("return");case 13:return a&&(this._currentSegmentIndex=o),u.video=t,u.audio=n,e.abrupt("return",u);case 17:case"end":return e.stop()}}),e,this,[[4,,8,11]])}))),function(e,t,r,n,a){return i.apply(this,arguments)})},{key:"loadData",value:(n=a(r().mark((function e(n,i,a){var s,o,u,c;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=this._getCacheKey(n),e.next=3,this.cache.get(s);case 3:if(o=e.sent){e.next=11;break}return c=a&&a.url?a.url:this.url,e.next=8,this._loader.load(c,t({range:n,vid:this.vid},a));case 8:u=e.sent,e.next=12;break;case 11:u={data:o,state:!0,options:{fromCache:!0,range:n,vid:this.vid}};case 12:if(u){e.next=14;break}return e.abrupt("return");case 14:return o||(u.data&&this.downloadInfo.push({startTime:u.startTime,endTime:u.endTime,size:u.data.byteLength,range:n}),this.downloadInfo&&this.downloadInfo.length>this._config.maxDownloadInfoSize&&(this.downloadInfo=this.downloadInfo.slice(-this._config.maxDownloadInfoSize))),e.abrupt("return",u);case 17:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"_getCacheKey",value:function(e){return(this.vid||this.url)+":"+e}}]),S}(ye);return Rr}));
|
|
2
2
|
//# sourceMappingURL=index.min.js.map
|