/*! For license information please see 35365.297b1a99.js.LICENSE.txt */ "use strict";(self.webpackChunkdouyin_web=self.webpackChunkdouyin_web||[]).push([["35365"],{71889:function(e,t,r){r.d(t,{Mp4Preloader:function(){return Tu}});var n,i,a,o,u,s,c,l,f,d,h="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{};function v(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var p=function(e){return e&&e.Math===Math&&e},g=p("object"==typeof globalThis&&globalThis)||p("object"==typeof window&&window)||p("object"==typeof self&&self)||p("object"==typeof h&&h)||p("object"==typeof h&&h)||function(){return this}()||Function("return this")(),y=function(e){try{return!!e()}catch(e){return!0}},m=!y(function(){var e=(function(){}).bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}),_=Function.prototype,b=_.apply,k=_.call,w="object"==typeof Reflect&&Reflect.apply||(m?k.bind(b):function(){return k.apply(b,arguments)}),S=Function.prototype,T=S.call,x=m&&S.bind.bind(T,T),I=m?x:function(e){return function(){return T.apply(e,arguments)}},C=I({}.toString),P=I("".slice),E=function(e){return P(C(e),8,-1)},O=function(e){if("Function"===E(e))return I(e)},L="object"==typeof document&&document.all,R=void 0===L&&void 0!==L?function(e){return"function"==typeof e||e===L}:function(e){return"function"==typeof e},A={},D=!y(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}),M=Function.prototype.call,B=m?M.bind(M):function(){return M.apply(M,arguments)},j={},N={}.propertyIsEnumerable,U=Object.getOwnPropertyDescriptor,F=U&&!N.call({1:2},1);j.f=F?function(e){var t=U(this,e);return!!t&&t.enumerable}:N;var z,K,V=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},q=Object,H=I("".split),G=y(function(){return!q("z").propertyIsEnumerable(0)})?function(e){return"String"===E(e)?H(e,""):q(e)}:q,W=function(e){return null==e},Y=TypeError,X=function(e){if(W(e))throw new Y("Can't call method on "+e);return e},Q=function(e){return G(X(e))},$=function(e){return"object"==typeof e?null!==e:R(e)},J={},Z=function(e){return R(e)?e:void 0},ee=function(e,t){return arguments.length<2?Z(J[e])||Z(g[e]):J[e]&&J[e][t]||g[e]&&g[e][t]},et=I({}.isPrototypeOf),er=g.navigator,en=er&&er.userAgent,ei=en?String(en):"",ea=g.process,eo=g.Deno,eu=ea&&ea.versions||eo&&eo.version,es=eu&&eu.v8;es&&(K=(z=es.split("."))[0]>0&&z[0]<4?1:+(z[0]+z[1])),!K&&ei&&(!(z=ei.match(/Edge\/(\d+)/))||z[1]>=74)&&(z=ei.match(/Chrome\/(\d+)/))&&(K=+z[1]);var ec=K,el=g.String,ef=!!Object.getOwnPropertySymbols&&!y(function(){var e=Symbol("symbol detection");return!el(e)||!(Object(e) instanceof Symbol)||!Symbol.sham&&ec&&ec<41}),ed=ef&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,eh=Object,ev=ed?function(e){return"symbol"==typeof e}:function(e){var t=ee("Symbol");return R(t)&&et(t.prototype,eh(e))},ep=String,eg=function(e){try{return ep(e)}catch(e){return"Object"}},ey=TypeError,em=function(e){if(R(e))return e;throw new ey(eg(e)+" is not a function")},e_=function(e,t){var r=e[t];return W(r)?void 0:em(r)},eb=TypeError,ek={exports:{}},ew=Object.defineProperty,eS="__core-js_shared__",eT=ek.exports=g[eS]||function(e,t){try{ew(g,e,{value:t,configurable:!0,writable:!0})}catch(r){g[e]=t}return t}(eS,{});(eT.versions||(eT.versions=[])).push({version:"3.45.1",mode:"pure",copyright:"\xa9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.45.1/LICENSE",source:"https://github.com/zloirock/core-js"});var ex=ek.exports,eI=function(e,t){return ex[e]||(ex[e]=t||{})},eC=Object,eP=function(e){return eC(X(e))},eE=I({}.hasOwnProperty),eO=Object.hasOwn||function(e,t){return eE(eP(e),t)},eL=0,eR=Math.random(),eA=I(1.1.toString),eD=function(e){return"Symbol("+(void 0===e?"":e)+")_"+eA(++eL+eR,36)},eM=g.Symbol,eB=eI("wks"),ej=ed?eM.for||eM:eM&&eM.withoutSetter||eD,eN=function(e){return eO(eB,e)||(eB[e]=ef&&eO(eM,e)?eM[e]:ej("Symbol."+e)),eB[e]},eU=function(e,t){var r,n;if("string"===t&&R(r=e.toString)&&!$(n=B(r,e))||R(r=e.valueOf)&&!$(n=B(r,e))||"string"!==t&&R(r=e.toString)&&!$(n=B(r,e)))return n;throw new eb("Can't convert object to primitive value")},eF=TypeError,ez=eN("toPrimitive"),eK=function(e,t){if(!$(e)||ev(e))return e;var r,n=e_(e,ez);if(n){if(void 0===t&&(t="default"),!$(r=B(n,e,t))||ev(r))return r;throw new eF("Can't convert object to primitive value")}return void 0===t&&(t="number"),eU(e,t)},eV=function(e){var t=eK(e,"string");return ev(t)?t:t+""},eq=g.document,eH=$(eq)&&$(eq.createElement),eG=function(e){return eH?eq.createElement(e):{}},eW=!D&&!y(function(){return 7!==Object.defineProperty(eG("div"),"a",{get:function(){return 7}}).a}),eY=Object.getOwnPropertyDescriptor;A.f=D?eY:function(e,t){if(e=Q(e),t=eV(t),eW)try{return eY(e,t)}catch(e){}if(eO(e,t))return V(!B(j.f,e,t),e[t])};var eX=/#|\.prototype\./,eQ=function(e,t){var r=eJ[e$(e)];return r===e0||r!==eZ&&(R(t)?y(t):!!t)},e$=eQ.normalize=function(e){return String(e).replace(eX,".").toLowerCase()},eJ=eQ.data={},eZ=eQ.NATIVE="N",e0=eQ.POLYFILL="P",e1=O(O.bind),e2=function(e,t){return em(e),void 0===t?e:m?e1(e,t):function(){return e.apply(t,arguments)}},e4={},e3=D&&y(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),e6=String,e8=TypeError,e5=function(e){if($(e))return e;throw new e8(e6(e)+" is not an object")},e9=TypeError,e7=Object.defineProperty,te=Object.getOwnPropertyDescriptor,tt="enumerable",tr="configurable",tn="writable";e4.f=D?e3?function(e,t,r){if(e5(e),t=eV(t),e5(r),"function"==typeof e&&"prototype"===t&&"value"in r&&tn in r&&!r[tn]){var n=te(e,t);n&&n[tn]&&(e[t]=r.value,r={configurable:tr in r?r[tr]:n[tr],enumerable:tt in r?r[tt]:n[tt],writable:!1})}return e7(e,t,r)}:e7:function(e,t,r){if(e5(e),t=eV(t),e5(r),eW)try{return e7(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new e9("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var ti=D?function(e,t,r){return e4.f(e,t,V(1,r))}:function(e,t,r){return e[t]=r,e},ta=A.f,to=function(e){var t=function(r,n,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,n)}return new e(r,n,i)}return w(e,this,arguments)};return t.prototype=e.prototype,t},tu=function(e,t){var r,n,i,a,o,u,s,c,l,f=e.target,d=e.global,h=e.stat,v=e.proto,p=d?g:h?g[f]:g[f]&&g[f].prototype,y=d?J:J[f]||ti(J,f,{})[f],m=y.prototype;for(a in t)n=!(r=eQ(d?a:f+(h?".":"#")+a,e.forced))&&p&&eO(p,a),u=y[a],n&&(s=e.dontCallGetSet?(l=ta(p,a))&&l.value:p[a]),o=n&&s?s:t[a],(r||v||typeof u!=typeof o)&&(c=e.bind&&n?e2(o,g):e.wrap&&n?to(o):v&&R(o)?O(o):o,(e.sham||o&&o.sham||u&&u.sham)&&ti(c,"sham",!0),ti(y,a,c),v&&(eO(J,i=f+"Prototype")||ti(J,i,{}),ti(J[i],a,o),e.real&&m&&(r||!m[a])&&ti(m,a,o)))},ts=I([].slice),tc=Function,tl=I([].concat),tf=I([].join),td={},th=function(e,t,r){if(!eO(td,t)){for(var n=[],i=0;i0?tj:tB)(t)},tU=function(e){var t=+e;return t!=t||0===t?0:tN(t)},tF=Math.max,tz=Math.min,tK=function(e,t){var r=tU(e);return r<0?tF(r+t,0):tz(r,t)},tV=Math.min,tq=function(e){var t=tU(e);return t>0?tV(t,9007199254740991):0},tH=function(e){return tq(e.length)},tG=function(e){return function(t,r,n){var i=Q(t),a=tH(i);if(0===a)return!e&&-1;var o,u=tK(n,a);if(e&&r!=r){for(;a>u;)if((o=i[u++])!=o)return!0}else for(;a>u;u++)if((e||u in i)&&i[u]===r)return e||u||0;return!e&&-1}},tW={includes:tG(!0),indexOf:tG(!1)},tY={},tX=tW.indexOf,tQ=I([].push),t$=function(e,t){var r,n=Q(e),i=0,a=[];for(r in n)!eO(tY,r)&&eO(n,r)&&tQ(a,r);for(;t.length>i;)eO(n,r=t[i++])&&(~tX(a,r)||tQ(a,r));return a},tJ=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],tZ=Object.keys||function(e){return t$(e,tJ)};tM.f=D&&!e3?Object.defineProperties:function(e,t){e5(e);for(var r,n=Q(t),i=tZ(t),a=i.length,o=0;a>o;)e4.f(e,r=i[o++],n[r]);return e};var t0,t1=ee("document","documentElement"),t2=eI("keys"),t4=function(e){return t2[e]||(t2[e]=eD(e))},t3="prototype",t6="script",t8=t4("IE_PROTO"),t5=function(){},t9=function(e){return"<"+t6+">"+e+""},t7=function(e){e.write(t9("")),e.close();var t=e.parentWindow.Object;return e=null,t},re=function(){var e,t=eG("iframe");return t.style.display="none",t1.appendChild(t),t.src=String("java"+t6+":"),(e=t.contentWindow.document).open(),e.write(t9("document.F=Object")),e.close(),e.F},rt=function(){try{t0=new ActiveXObject("htmlfile")}catch(e){}rt="undefined"!=typeof document?document.domain&&t0?t7(t0):re():t7(t0);for(var e=tJ.length;e--;)delete rt[t3][tJ[e]];return rt()};tY[t8]=!0;var rr=Object.create||function(e,t){var r;return null!==e?(t5[t3]=e5(e),r=new t5,t5[t3]=null,r[t8]=e):r=rt(),void 0===t?r:tM.f(r,t)},rn=ee("Reflect","construct"),ri=Object.prototype,ra=[].push,ro=y(function(){function e(){}return!(rn(function(){},[],e) instanceof e)}),ru=!y(function(){rn(function(){})}),rs=ro||ru;tu({target:"Reflect",stat:!0,forced:rs,sham:rs},{construct:function(e,t){tD(e),e5(t);var r=arguments.length<3?e:tD(arguments[2]);if(ru&&!ro)return rn(e,t,r);if(e===r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return w(ra,n,t),new(w(tv,e,n))}var i=r.prototype,a=rr($(i)?i:ri),o=w(e,a,t);return $(o)?o:a}});var rc=J.Reflect.construct,rl=v(rc),rf=v(rc),rd=!y(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),rh=t4("IE_PROTO"),rv=Object,rp=rv.prototype,rg=rd?rv.getPrototypeOf:function(e){var t=eP(e);if(eO(t,rh))return t[rh];var r=t.constructor;return R(r)&&t instanceof r?r.prototype:t instanceof rv?rp:null};tu({target:"Object",stat:!0,forced:y(function(){rg(1)}),sham:!rd},{getPrototypeOf:function(e){return rg(eP(e))}});var ry=J.Object.getPrototypeOf,rm=v(ry),r_=Array.isArray||function(e){return"Array"===E(e)},rb=I([].reverse),rk=[1,2];tu({target:"Array",proto:!0,forced:String(rk)===String(rk.reverse())},{reverse:function(){return r_(this)&&(this.length=this.length),rb(this)}});var rw=function(e,t){var r=J[e+"Prototype"],n=r&&r[t];if(n)return n;var i=g[e],a=i&&i.prototype;return a&&a[t]},rS=rw("Array","reverse"),rT=Array.prototype,rx=function(e){var t=e.reverse;return e===rT||et(rT,e)&&t===rT.reverse?rS:t},rI=v(rx);function rC(e,t){this.v=e,this.k=t}var rP=TypeError,rE=function(e){if(e>9007199254740991)throw rP("Maximum allowed index exceeded");return e},rO=function(e,t,r){D?e4.f(e,t,V(0,r)):e[t]=r},rL=eN("species"),rR=Array,rA=function(e){var t;return r_(e)&&(tR(t=e.constructor)&&(t===rR||r_(t.prototype))||$(t)&&null===(t=t[rL]))&&(t=void 0),void 0===t?rR:t},rD=function(e,t){return new(rA(e))(0===t?0:t)},rM=eN("species"),rB=function(e){return ec>=51||!y(function(){var t=[];return(t.constructor={})[rM]=function(){return{foo:1}},1!==t[e](Boolean).foo})},rj=eN("isConcatSpreadable"),rN=ec>=51||!y(function(){var e=[];return e[rj]=!1,e.concat()[0]!==e}),rU=function(e){if(!$(e))return!1;var t=e[rj];return void 0!==t?!!t:r_(e)};tu({target:"Array",proto:!0,arity:1,forced:!rN||!rB("concat")},{concat:function(e){var t,r,n,i,a,o=eP(this),u=rD(o,0),s=0;for(t=-1,n=arguments.length;tm;m++)if((u||m in p)&&(h=y(d=p[m],m,v),e)){if(t)b[m]=h;else if(h)switch(e){case 3:return!0;case 5:return d;case 6:return m;case 2:no(b,d)}else switch(e){case 4:return!1;case 7:no(b,d)}}return a?-1:n||i?i:b}},ns={forEach:nu(0),map:nu(1),filter:nu(2),some:nu(3),every:nu(4),find:nu(5),findIndex:nu(6),filterReject:nu(7)},nc=ns.forEach,nl=t4("hidden"),nf="Symbol",nd="prototype",nh=na.set,nv=na.getterFor(nf),np=Object[nd],ng=g.Symbol,ny=ng&&ng[nd],nm=g.RangeError,n_=g.TypeError,nb=g.QObject,nk=A.f,nw=e4.f,nS=rq.f,nT=j.f,nx=I([].push),nI=eI("symbols"),nC=eI("op-symbols"),nP=eI("wks"),nE=!nb||!nb[nd]||!nb[nd].findChild,nO=function(e,t,r){var n=nk(np,t);n&&delete np[t],nw(e,t,r),n&&e!==np&&nw(np,t,n)},nL=D&&y(function(){return 7!==rr(nw({},"a",{get:function(){return nw(this,"a",{value:7}).a}})).a})?nO:nw,nR=function(e,t){var r=nI[e]=rr(ny);return nh(r,{type:nf,tag:e,description:t}),D||(r.description=t),r},nA=function(e,t,r){e===np&&nA(nC,t,r),e5(e);var n=eV(t);return e5(r),eO(nI,n)?(r.enumerable?(eO(e,nl)&&e[nl][n]&&(e[nl][n]=!1),r=rr(r,{enumerable:V(0,!1)})):(eO(e,nl)||nw(e,nl,V(1,rr(null))),e[nl][n]=!0),nL(e,n,r)):nw(e,n,r)},nD=function(e,t){e5(e);var r=Q(t);return nc(tZ(r).concat(nN(r)),function(t){D&&!B(nM,r,t)||nA(e,t,r[t])}),e},nM=function(e){var t=eV(e),r=B(nT,this,t);return!(this===np&&eO(nI,t)&&!eO(nC,t))&&(!(r||!eO(this,t)||!eO(nI,t)||eO(this,nl)&&this[nl][t])||r)},nB=function(e,t){var r=Q(e),n=eV(t);if(r!==np||!eO(nI,n)||eO(nC,n)){var i=nk(r,n);return!i||!eO(nI,n)||eO(r,nl)&&r[nl][n]||(i.enumerable=!0),i}},nj=function(e){var t=nS(Q(e)),r=[];return nc(t,function(e){eO(nI,e)||eO(tY,e)||nx(r,e)}),r},nN=function(e){var t=e===np,r=nS(t?nC:Q(e)),n=[];return nc(r,function(e){eO(nI,e)&&(!t||eO(np,e))&&nx(n,nI[e])}),n};ef||(rX(ny=(ng=function(){if(et(ny,this))throw new n_("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?rz(arguments[0]):void 0,t=eD(e),r=function(e){var n=void 0===this?g:this;n===np&&B(r,nC,e),eO(n,nl)&&eO(n[nl],t)&&(n[nl][t]=!1);var i=V(1,e);try{nL(n,t,i)}catch(e){if(!(e instanceof nm))throw e;nO(n,t,i)}};return D&&nE&&nL(np,t,{configurable:!0,set:r}),nR(t,e)})[nd],"toString",function(){return nv(this).tag}),rX(ng,"withoutSetter",function(e){return nR(eD(e),e)}),j.f=nM,e4.f=nA,tM.f=nD,A.f=nB,rK.f=rq.f=nj,rY.f=nN,r$.f=function(e){return nR(eN(e),e)},D&&rQ(ny,"description",{configurable:!0,get:function(){return nv(this).description}})),tu({global:!0,constructor:!0,wrap:!0,forced:!ef,sham:!ef},{Symbol:ng}),nc(tZ(nP),function(e){r2(e)}),tu({target:nf,stat:!0,forced:!ef},{useSetter:function(){nE=!0},useSimple:function(){nE=!1}}),tu({target:"Object",stat:!0,forced:!ef,sham:!D},{create:function(e,t){return void 0===t?rr(e):nD(rr(e),t)},defineProperty:nA,defineProperties:nD,getOwnPropertyDescriptor:nB}),tu({target:"Object",stat:!0,forced:!ef},{getOwnPropertyNames:nj}),r4(),r5(ng,nf),tY[nl]=!0;var nU=ef&&!!Symbol.for&&!!Symbol.keyFor,nF=eI("string-to-symbol-registry"),nz=eI("symbol-to-string-registry");tu({target:"Symbol",stat:!0,forced:!nU},{for:function(e){var t=rz(e);if(eO(nF,t))return nF[t];var r=ee("Symbol")(t);return nF[t]=r,nz[r]=t,r}});var nK=eI("symbol-to-string-registry");tu({target:"Symbol",stat:!0,forced:!nU},{keyFor:function(e){if(!ev(e))throw TypeError(eg(e)+" is not a symbol");if(eO(nK,e))return nK[e]}});var nV=I([].push),nq=function(e){if(R(e))return e;if(r_(e)){for(var t=e.length,r=[],n=0;n=t.length)return e.target=null,iI(void 0,!0);switch(e.kind){case"keys":return iI(r,!1);case"values":return iI(t[r],!1)}return iI([r,t[r]],!1)},"values"),n7.Arguments=n7.Array;var iO={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};for(var iL in iO)r5(g[iL],iL),n7[iL]=n7.Array;var iR=e4.f,iA=eN("metadata"),iD=Function.prototype;void 0===iD[iA]&&iR(iD,iA,{value:null});r2("metadata");var iM=ee("Symbol"),iB=iM.keyFor,ij=I(iM.prototype.valueOf),iN=iM.isRegisteredSymbol||function(e){try{return void 0!==iB(ij(e))}catch(e){return!1}};tu({target:"Symbol",stat:!0},{isRegisteredSymbol:iN});for(var iU=ee("Symbol"),iF=iU.isWellKnownSymbol,iz=ee("Object","getOwnPropertyNames"),iK=I(iU.prototype.valueOf),iV=eI("wks"),iq=0,iH=iz(iU),iG=iH.length;iq3?(i=v===n)&&(s=a[(u=a[4])?5:(u=3,3)],a[4]=a[5]=e):a[0]<=h&&((i=r<2&&hn||n>v)&&(a[4]=r,a[5]=n,d.n=v,u=0))}if(i||r>1)return o;throw f=!0,n}return function(i,l,v){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,v),u=l,s=v;(t=u<2?e:s)||!f;){a||(u?u<3?(u>1&&(d.n=-1),h(u,s)):d.n=s:d.v=s);try{if(c=2,a){if(u||(i="next"),t=a[i]){if(!(t=t.call(a,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,u<2&&(u=0)}else 1===u&&(t=a.return)&&t.call(a),u<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),u=1);a=e}else if((t=(f=d.n<0)?s:r.call(n,d))!==o)break}catch(t){a=e,u=1,s=t}finally{c=1}}return{value:t,done:f}}}(r,i,a),!0),s}var o={};function u(){}function s(){}function c(){}t=rm;var l=[][n]?t(t([][n]())):(at(t={},n,function(){return this}),t),f=c.prototype=u.prototype=iJ(l);function d(e){return i3?i3(e,c):(e.__proto__=c,at(e,i,"GeneratorFunction")),e.prototype=iJ(f),e}return s.prototype=c,at(f,"constructor",c),at(c,"constructor",s),s.displayName="GeneratorFunction",at(c,i,"GeneratorFunction"),at(f),at(f,i,"Generator"),at(f,n,function(){return this}),at(f,"toString",function(){return"[object Generator]"}),(ar=function(){return{w:a,m:d}})()}var an=I([].concat),ai=ee("Reflect","ownKeys")||function(e){var t=rK.f(e5(e)),r=rY.f;return r?an(t,r(e)):t},aa=Error,ao=I("".replace),au=String(new aa("zxcasd").stack),as=/\n\s*at [^:]*:[^\n]*/,ac=as.test(au),al=!y(function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",V(1,7)),7!==e.stack)}),af=function(e,t){if(ac&&"string"==typeof e&&!aa.prepareStackTrace)for(;t--;)e=ao(e,as,"");return e},ad=Error.captureStackTrace,ah=eN("iterator"),av=Array.prototype,ap=function(e){return void 0!==e&&(n7.Array===e||av[ah]===e)},ag=eN("iterator"),ay=function(e){if(!W(e))return e_(e,ag)||e_(e,"@@iterator")||n7[tw(e)]},am=TypeError,a_=function(e,t){var r=arguments.length<2?ay(e):t;if(em(r))return e5(B(r,e));throw new am(eg(e)+" is not iterable")},ab=function(e,t,r){var n,i;e5(e);try{if(!(n=e_(e,"return"))){if("throw"===t)throw r;return r}n=B(n,e)}catch(e){i=!0,n=e}if("throw"===t)throw r;if(i)throw n;return e5(n),r},ak=TypeError,aw=function(e,t){this.stopped=e,this.result=t},aS=aw.prototype,aT=function(e,t,r){var n,i,a,o,u,s,c,l=r&&r.that,f=!(!r||!r.AS_ENTRIES),d=!(!r||!r.IS_RECORD),h=!(!r||!r.IS_ITERATOR),v=!(!r||!r.INTERRUPTED),p=e2(t,l),g=function(e){return n&&ab(n,"normal"),new aw(!0,e)},y=function(e){return f?(e5(e),v?p(e[0],e[1],g):p(e[0],e[1])):v?p(e,g):p(e)};if(d)n=e.iterator;else if(h)n=e;else{if(!(i=ay(e)))throw new ak(eg(e)+" is not iterable");if(ap(i)){for(a=0,o=tH(e);o>a;a++)if((u=y(e[a]))&&et(aS,u))return u;return new aw(!1)}n=a_(e,i)}for(s=d?e.next:n.next;!(c=B(s,n)).done;){try{u=y(c.value)}catch(e){ab(n,"throw",e)}if("object"==typeof u&&u&&et(aS,u))return u}return new aw(!1)},ax=function(e,t){$(t)&&"cause"in t&&ti(e,"cause",t.cause)},aI=function(e,t,r,n){al&&(ad?ad(e,t):ti(e,"stack",af(r,n)))},aC=eN("toStringTag"),aP=Error,aE=[].push,aO=function(e,t){var r,n=et(aL,this);ig?r=ig(new aP,n?rg(this):aL):ti(r=n?this:rr(aL),aC,"Error"),void 0!==t&&ti(r,"message",function(e,t){return void 0===e?arguments.length<2?"":t:rz(e)}(t)),aI(r,aO,r.stack,1),arguments.length>2&&ax(r,arguments[2]);var i=[];return aT(e,aE,{that:i}),ti(r,"errors",i),r};ig?ig(aO,aP):function(e,t,r){for(var n=ai(t),i=e4.f,a=A.f,o=0;o1?ts(arguments,1):[],r=oT.f(this),n=oy(function(){return w(em(e),void 0,t)});return(n.error?r.reject:r.resolve)(n.value),r.promise}});tu({target:"Promise",stat:!0},{withResolvers:function(){var e=oT.f(this);return{promise:e.promise,resolve:e.resolve,reject:e.reject}}});var uu=om&&om.prototype;tu({target:"Promise",proto:!0,real:!0,forced:!!om&&y(function(){uu.finally.call({then:function(){}},function(){})})},{finally:function(e){var t=aq(this,ee("Promise")),r=R(e);return this.then(r?function(r){return ue(t,e()).then(function(){return r})}:e,r?function(r){return ue(t,e()).then(function(){throw r})}:e)}});var us=I("".charAt),uc=I("".charCodeAt),ul=I("".slice),uf=function(e){return function(t,r){var n,i,a=rz(X(t)),o=tU(r),u=a.length;return o<0||o>=u?e?"":void 0:(n=uc(a,o))<55296||n>56319||o+1===u||(i=uc(a,o+1))<56320||i>57343?e?us(a,o):n:e?ul(a,o,o+2):i-56320+(n-55296<<10)+65536}},ud={codeAt:uf(!1),charAt:uf(!0)}.charAt,uh="String Iterator",uv=na.set,up=na.getterFor(uh);ix(String,"String",function(e){uv(this,{type:uh,string:rz(e),index:0})},function(){var e,t=up(this),r=t.string,n=t.index;return n>=r.length?iI(void 0,!0):(e=ud(r,n),t.index+=e.length,iI(e,!1))});var ug=J.Promise,uy=v(ug),um=r$.f("asyncIterator"),u_=v(um);function ub(e,t){var r;this.next||(at(ub.prototype),at(ub.prototype,"function"==typeof iX&&u_||"@asyncIterator",function(){return this})),at(this,"_invoke",function(n,i,a){function o(){return new t(function(r,i){(function r(n,i,a,o){try{var u=e[n](i),s=u.value;return s instanceof rC?t.resolve(s.v).then(function(e){r("next",e,a,o)},function(e){r("throw",e,a,o)}):t.resolve(s).then(function(e){u.value=e,a(u)},function(e){return r("throw",e,a,o)})}catch(e){o(e)}})(n,a,r,i)})}return r=r?r.then(o,o):o()},!0)}function uk(e,t,r,n,i){return new ub(ar().w(e,t,r,n),i||uy)}var uw=TypeError,uS=Object.getOwnPropertyDescriptor,uT=D&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,t){if(r_(e)&&!uS(e,"length").writable)throw new uw("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},ux=TypeError,uI=function(e,t){if(!delete e[t])throw new ux("Cannot delete property "+eg(t)+" of "+eg(e))};tu({target:"Array",proto:!0,arity:1,forced:1!==[].unshift(0)||!function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(e){return e instanceof TypeError}}()},{unshift:function(e){var t=eP(this),r=tH(t),n=arguments.length;if(n){rE(r+n);for(var i=r;i--;){var a=i+n;i in t?t[a]=t[i]:uI(t,a)}for(var o=0;o=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw TypeError(uA(e)+" is not iterable")}function uM(){var e=ar(),t=e.m(uM),r=(rm?rm(t):t.__proto__).constructor;function n(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===r||"GeneratorFunction"===(t.displayName||t.name))}var i={throw:1,return:2,break:3,continue:3};function a(e){var t,r;return function(n){t||(t={stop:function(){return r(n.a,2)},catch:function(){return n.v},abrupt:function(e,t){return r(n.a,i[e],t)},delegateYield:function(e,i,a){return t.resultName=i,r(n.d,uD(e),a)},finish:function(e){return r(n.f,e)}},r=function(e,r,i){n.p=t.prev,n.n=t.next;try{return e(r,i)}finally{t.next=n.n}}),t.resultName&&(t[t.resultName]=n.v,t.resultName=void 0),t.sent=n.v,t.next=n.n;try{return e.call(this,t)}finally{n.p=t.prev,n.n=t.next}}}return(uM=function(){return{wrap:function(t,r,n,i){return e.w(a(t),r,n,i&&rI(i).call(i))},isGeneratorFunction:n,mark:e.m,awrap:function(e,t){return new rC(e,t)},AsyncIterator:ub,async:function(e,t,r,i,o){return(n(t)?uk:function(e,t,r,n,i){var a=uk(e,t,r,n,i);return a.next().then(function(e){return e.done?e.value:a.next()})})(a(e),t,r,i,o)},keys:uO,values:uD}})()}function uB(e,t,r,n,i,a,o){try{var u=e[a](o),s=u.value}catch(e){return void r(e)}u.done?t(s):uy.resolve(s).then(n,i)}function uj(e){return function(){var t=this,r=arguments;return new uy(function(n,i){var a=e.apply(t,r);function o(e){uB(a,n,i,o,u,"next",e)}function u(e){uB(a,n,i,o,u,"throw",e)}o(void 0)})}}tu({target:"Object",stat:!0,forced:y(function(){tZ(1)})},{keys:function(e){return tZ(eP(e))}});var uN=J.Object.keys,uU=v(uN),uF=J.Object.getOwnPropertySymbols,uz=v(uF),uK=ns.filter;tu({target:"Array",proto:!0,forced:!rB("filter")},{filter:function(e){return uK(this,e,arguments.length>1?arguments[1]:void 0)}});var uV=rw("Array","filter"),uq=Array.prototype,uH=function(e){var t=e.filter;return e===uq||et(uq,e)&&t===uq.filter?uV:t},uG=v(uH),uW={exports:{}},uY=A.f;tu({target:"Object",stat:!0,forced:!D||y(function(){uY(1)}),sham:!D},{getOwnPropertyDescriptor:function(e,t){return uY(Q(e),t)}});var uX=J.Object,uQ=uW.exports=function(e,t){return uX.getOwnPropertyDescriptor(e,t)};uX.getOwnPropertyDescriptor.sham&&(uQ.sham=!0);var u$=uW.exports,uJ=v(u$);tu({target:"Array",proto:!0,arity:1,forced:y(function(){return 4294967297!==[].push.call({length:4294967296},1)})||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=eP(this),r=tH(t),n=arguments.length;rE(r+n);for(var i=0;i1?arguments[1]:void 0)};tu({target:"Array",proto:!0,forced:[].forEach!==u3},{forEach:u3});var u6=rw("Array","forEach"),u8=Array.prototype,u5={DOMTokenList:!0,NodeList:!0},u9=function(e){var t=e.forEach;return e===u8||et(u8,e)&&t===u8.forEach||eO(u5,tw(e))?u6:t},u7=v(u9);tu({target:"Object",stat:!0,sham:!D},{getOwnPropertyDescriptors:function(e){for(var t,r,n=Q(e),i=A.f,a=ai(n),o={},u=0;a.length>u;)void 0!==(r=i(n,t=a[u++]))&&rO(o,t,r);return o}});var se=J.Object.getOwnPropertyDescriptors,st=v(se),sr={exports:{}},sn=tM.f;tu({target:"Object",stat:!0,forced:Object.defineProperties!==sn,sham:!D},{defineProperties:sn});var si=J.Object,sa=sr.exports=function(e,t){return si.defineProperties(e,t)};si.defineProperties.sham&&(sa.sham=!0);var so=sr.exports,su=v(so),ss=r$.f("toPrimitive"),sc=v(ss);function sl(e){var t=function(e,t){if("object"!=uA(e)||!e)return e;var r=e[sc];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=uA(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==uA(t)?t:t+""}function sf(e,t,r){return(t=sl(t))in e?ae(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sd(e,t){var r=uU(e);if(uz){var n=uz(e);t&&(n=uG(n).call(n,function(t){return uJ(e,t).enumerable})),u1(r).apply(r,n)}return r}function sh(e){for(var t=1;ti;)for(var u,s=G(arguments[i++]),c=a?sT(tZ(s),a(s)):tZ(s),l=c.length,f=0;l>f;)u=c[f++],D&&!B(o,s,u)||(r[u]=s[u]);return r}:sw;tu({target:"Object",stat:!0,arity:2,forced:Object.assign!==sx},{assign:sx});var sI=J.Object.assign,sC=v(sI),sP=sg(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};sv(this,e),sf(this,"player",void 0);var r=!0;try{r=!t.player}catch(e){}this.player=r?t:t.player},[{key:"playerConfig",get:function(){return this.player.config}},{key:"config",get:function(){var e;return null!==(e=(this.player.config.pluginsConfig||this.player.config||{})[this.constructor.pluginName])&&void 0!==e?e:{}}},{key:"beforePlayerInit",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"configDidUpdate",value:function(){}},{key:"beforeDestroy",value:function(){}},{key:"getConfig",value:function(e){var t=this.playerConfig,r=t.baseConfig||{};return((null==r?void 0:r.mediaInfo)||{})[e]||r[e]||t[e]}},{key:"setBaseConfig",value:function(e,t){var r=this.playerConfig.baseConfig||{};"string"==typeof e?r[e]=t:sC(r,e)}},{key:"setSharedConfig",value:function(e,t){var r=this.playerConfig.shared||{};"string"==typeof e?r[e]=t:sC(r,e)}}]),sE=sg(function e(t){sv(this,e),sf(this,"strategyCenter",void 0),sf(this,"ctx",void 0),sf(this,"config",void 0),sf(this,"player",void 0),sf(this,"strategyName",void 0),this.ctx=t.ctx,this.config=t.config,this.strategyName=t.strategyName,this.strategyCenter=t.strategyCenter,this.player=null},[{key:"strategyPriority",get:function(){return this.constructor.strategyPriority}},{key:"getStrategyConfig",value:function(){return this.config}},{key:"setPlayerInst",value:function(e){this.player=e.getInst()}},{key:"onBasePluginCreated",value:function(e){}},{key:"beforePlayerCreate",value:function(e){}},{key:"onPlayerEvent",value:function(e,t){}},{key:"onGlobalEvent",value:function(e,t){}}]),sO=RangeError,sL=I(function(e){var t=rz(X(this)),r="",n=tU(e);if(n<0||n===1/0)throw new sO("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(r+=t);return r}),sR=I("".slice),sA=Math.ceil,sD=function(e){return function(t,r,n){var i,a,o=rz(X(t)),u=tq(r),s=o.length,c=void 0===n?" ":rz(n);return u<=s||""===c?o:((a=sL(c,sA((i=u-s)/c.length))).length>i&&(a=sR(a,0,i)),e?o+a:a+o)}},sM={start:sD(!1),end:sD(!0)},sB=sM.start,sj=RangeError,sN=isFinite,sU=Math.abs,sF=Date.prototype,sz=sF.toISOString,sK=I(sF.getTime),sV=I(sF.getUTCDate),sq=I(sF.getUTCFullYear),sH=I(sF.getUTCHours),sG=I(sF.getUTCMilliseconds),sW=I(sF.getUTCMinutes),sY=I(sF.getUTCMonth),sX=I(sF.getUTCSeconds),sQ=y(function(){return"0385-07-25T07:06:39.999Z"!==sz.call(new Date(-50000000000001))})||!y(function(){sz.call(new Date(NaN))})?function(){if(!sN(sK(this)))throw new sj("Invalid time value");var e=sq(this),t=sG(this),r=e<0?"-":e>9999?"+":"";return r+sB(sU(e),r?6:4,0)+"-"+sB(sY(this)+1,2,0)+"-"+sB(sV(this),2,0)+"T"+sB(sH(this),2,0)+":"+sB(sW(this),2,0)+":"+sB(sX(this),2,0)+"."+sB(t,3,0)+"Z"}:sz;tu({target:"Date",proto:!0,forced:y(function(){return null!==new Date(NaN).toJSON()||1!==B(Date.prototype.toJSON,{toISOString:function(){return 1}})})},{toJSON:function(e){var t=eP(this),r=eK(t,"number");return"number"!=typeof r||isFinite(r)?"toISOString"in t||"Date"!==E(t)?t.toISOString():B(sQ,t):null}});J.JSON||(J.JSON={stringify:JSON.stringify});var s$=v(function(e,t,r){return w(J.JSON.stringify,null,arguments)}),sJ=Date,sZ=I(sJ.prototype.getTime);tu({target:"Date",stat:!0},{now:function(){return sZ(new sJ)}});var s0=J.Date.now,s1=v(s0),s2=((vt=s2||{}).h265="h265",vt.adaptRange="adaptRange",vt.preload="preload",vt.bitrateSelector="bitrateSelector",vt.testSpeed="testSpeed",vt.degrade="degrade",vt.vodLogger="vodLogger",vt.pcdn="pcdn",vt.urlProcess="urlProcess",vt.abr="abr",vt.bufferControl="bufferControl",vt),s4=((vr=s4||{})[vr.urlProcess=4]="urlProcess",vr[vr.degrade=4]="degrade",vr[vr.testSpeed=3]="testSpeed",vr[vr.bitrateSelector=2]="bitrateSelector",vr[vr.h265=0]="h265",vr[vr.adaptRange=0]="adaptRange",vr[vr.preload=0]="preload",vr[vr.vodLogger=0]="vodLogger",vr[vr.pcdn=0]="pcdn",vr[vr.abr=0]="abr",vr[vr.bufferControl=0]="bufferControl",vr),s3=rw("Array","concat"),s6=Array.prototype,s8=v(function(e){var t=e.concat;return e===s6||et(s6,e)&&t===s6.concat?s3:t}),s5={info:3,warn:2,error:1},s9=!1;try{s9=!!window.localStorage.getItem("VESTRATEGY_LOG")}catch(e){}var s7=sg(function e(t,r){var n=this;sv(this,e),sf(this,"logger",void 0),sf(this,"level",void 0),sf(this,"customLogger",void 0),this.level=null==r?void 0:r.level,this.customLogger=null==r?void 0:r.logger,this.logger=function(e,r){var i,a,o,u;try{u="2.0.0-rc.58"}catch(e){u="--"}for(var s,c,l,f,d,h,v,p,g,y,m,_=s8(i=s8(a="[".concat(t,"][")).call(a,u,"][")).call(i,r,"]"),b=arguments.length,k=Array(b>2?b-2:0),w=2;w=s5[e]||"undefined"!=typeof window&&s9)&&(null===(g=window.console)||void 0===g||null===(y=g[e])||void 0===y||y.call.apply(y,s8(m=[g,_]).call(m,k)))}},[{key:"update",value:function(e){var t=e||{},r=t.logger,n=t.level;this.updateLevel(n),this.updateLogger(r)}},{key:"info",value:function(e){for(var t,r=arguments.length,n=Array(r>1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i1?arguments[1]:void 0)}});var ct=rw("Array","includes"),cr=eN("match"),cn=function(e){var t;return $(e)&&(void 0!==(t=e[cr])?!!t:"RegExp"===E(e))},ci=TypeError,ca=function(e){if(cn(e))throw new ci("The method doesn't accept regular expressions");return e},co=eN("match"),cu=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[co]=!1,"/./"[e](t)}catch(e){}}return!1},cs=I("".indexOf);tu({target:"String",proto:!0,forced:!cu("includes")},{includes:function(e){return!!~cs(rz(X(this)),rz(ca(e)),arguments.length>1?arguments[1]:void 0)}});var cc=rw("String","includes"),cl=Array.prototype,cf=String.prototype,cd=v(function(e){var t=e.includes;return e===cl||et(cl,e)&&t===cl.includes?ct:"string"==typeof e||e===cf||et(cf,e)&&t===cf.includes?cc:t});tu({target:"Array",stat:!0},{isArray:r_});var ch=J.Array.isArray,cv=v(ch),cp=v(ch),cg=ns.map;tu({target:"Array",proto:!0,forced:!rB("map")},{map:function(e){return cg(this,e,arguments.length>1?arguments[1]:void 0)}});var cy=rw("Array","map"),cm=Array.prototype,c_=v(function(e){var t=e.map;return e===cm||et(cm,e)&&t===cm.map?cy:t}),cb=v(u9),ck=v(i7),cw=v(uN),cS=v(ug);tu({target:"Array",proto:!0},{fill:function(e){for(var t=eP(this),r=tH(t),n=arguments.length,i=tK(n>1?arguments[1]:void 0,r),a=n>2?arguments[2]:void 0,o=void 0===a?r:tK(a,r);o>i;)t[i++]=e;return t}});var cT=rw("Array","fill"),cx=Array.prototype,cI=v(function(e){var t=e.fill;return e===cx||et(cx,e)&&t===cx.fill?cT:t}),cC=v(uH),cP=TypeError,cE="Reduce of empty array with no initial value",cO=function(e){return function(t,r,n,i){var a=eP(t),o=G(a),u=tH(a);if(em(r),0===u&&n<2)throw new cP(cE);var s=e?u-1:0,c=e?-1:1;if(n<2)for(;;){if(s in o){i=o[s],s+=c;break}if(s+=c,e?s<0:u<=s)throw new cP(cE)}for(;e?s>=0:u>s;s+=c)s in o&&(i=r(i,o[s],s,a));return i}},cL={left:cO(!1),right:cO(!0)}.left;tu({target:"Array",proto:!0,forced:!aN&&ec>79&&ec<83||!u2("reduce")},{reduce:function(e){var t=arguments.length;return cL(this,e,t,t>1?arguments[1]:void 0)}});var cR=rw("Array","reduce"),cA=Array.prototype,cD=v(function(e){var t=e.reduce;return e===cA||et(cA,e)&&t===cA.reduce?cR:t}),cM=" \n\v\f\r \xa0               \u2028\u2029\uFEFF",cB=I("".replace),cj=RegExp("^["+cM+"]+"),cN=RegExp("(^|[^"+cM+"])["+cM+"]+$"),cU=function(e){return function(t){var r=rz(X(t));return 1&e&&(r=cB(r,cj,"")),2&e&&(r=cB(r,cN,"$1")),r}},cF={start:cU(1),end:cU(2),trim:cU(3)},cz=cF.trim,cK=g.parseInt,cV=g.Symbol,cq=cV&&cV.iterator,cH=/^[+-]?0x/i,cG=I(cH.exec),cW=8!==cK(cM+"08")||22!==cK(cM+"0x16")||cq&&!y(function(){cK(Object(cq))})?function(e,t){var r=cz(rz(e));return cK(r,t>>>0||(cG(cH,r)?16:10))}:cK;tu({global:!0,forced:parseInt!==cW},{parseInt:cW});var cY=J.parseInt,cX=v(cY),cQ=ia.PROPER,c$="​\x85᠎",cJ=cF.trim;tu({target:"String",proto:!0,forced:(vn="trim",y(function(){return!!cM[vn]()||c$[vn]()!==c$||cQ&&cM[vn].name!==vn}))},{trim:function(){return cJ(this)}});var cZ=rw("String","trim"),c0=String.prototype,c1=v(function(e){var t=e.trim;return"string"==typeof e||e===c0||et(c0,e)&&t===c0.trim?cZ:t}),c2=cF.trim,c4=I("".charAt),c3=g.parseFloat,c6=g.Symbol,c8=c6&&c6.iterator,c5=1/c3(cM+"-0")!=-Infinity||c8&&!y(function(){c3(Object(c8))})?function(e){var t=c2(rz(e)),r=c3(t);return 0===r&&"-"===c4(t,0)?-0:r}:c3;tu({global:!0,forced:parseFloat!==c5},{parseFloat:c5});var c9=J.parseFloat,c7=v(c9),le=ns.find,lt="find",lr=!0;lt in[]&&[,][lt](function(){lr=!1}),tu({target:"Array",proto:!0,forced:lr},{find:function(e){return le(this,e,arguments.length>1?arguments[1]:void 0)}});var ln=rw("Array","find"),li=Array.prototype,la=v(function(e){var t=e.find;return e===li||et(li,e)&&t===li.find?ln:t}),lo=tW.indexOf,lu=O([].indexOf),ls=!!lu&&1/lu([1],1,-0)<0;tu({target:"Array",proto:!0,forced:ls||!u2("indexOf")},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return ls?lu(this,e,t)||0:lo(this,e,t)}});var lc=rw("Array","indexOf"),ll=Array.prototype,lf=v(function(e){var t=e.indexOf;return e===ll||et(ll,e)&&t===ll.indexOf?lc:t}),ld=rB("splice"),lh=Math.max,lv=Math.min;tu({target:"Array",proto:!0,forced:!ld},{splice:function(e,t){var r,n,i,a,o,u,s=eP(this),c=tH(s),l=tK(e,c),f=arguments.length;for(0===f?r=n=0:1===f?(r=0,n=c-l):(r=f-2,n=lv(lh(tU(t),0),c-l)),rE(c+r-n),i=rD(s,n),a=0;ac-n+r;a--)uI(s,a-1)}else if(r>n)for(a=c-n;a>l;a--)u=a+r-1,(o=a+n-1)in s?s[u]=s[o]:uI(s,u);for(a=0;a1?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!s(this,e)}}),lB(a,r?{get:function(e){var t=s(this,e);return t&&t.value},set:function(e,t){return u(this,0===e?0:e,t)}}:{add:function(e){return u(this,e=0===e?0:e,e)}}),D&&rQ(a,"size",{configurable:!0,get:function(){return o(this).size}}),i},setStrong:function(e,t,r){var n=t+" Iterator",i=lU(t),a=lU(n);ix(e,t,function(e,t){lN(this,{type:n,target:e,state:i(e),kind:t,last:null})},function(){for(var e=a(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?iI("keys"===t?r.key:"values"===t?r.value:[r.key,r.value],!1):(e.target=null,iI(void 0,!0))},r?"entries":"values",!r,!0),aF(t)}};lM("Map",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},lF);var lz=function(e,t){return 1===t?function(t,r){return t[e](r)}:function(t,r,n){return t[e](r,n)}},lK=ee("Map"),lV={Map:lK,set:lz("set",2),get:lz("get",1),has:lz("has",1),remove:lz("delete",1),proto:lK.prototype},lq=lV.Map,lH=lV.has,lG=lV.get,lW=lV.set,lY=I([].push);tu({target:"Map",stat:!0,forced:!0},{groupBy:function(e,t){X(e),em(t);var r=new lq,n=0;return aT(e,function(e){var i=t(e,n++);lH(r,i)?lY(lG(r,i),e):lW(r,i,[e])}),r}});var lX=J.Map,lQ=TypeError,l$=function(e){if("object"==typeof e&&"size"in e&&"has"in e&&"get"in e&&"set"in e&&"delete"in e&&"entries"in e)return e;throw new lQ(eg(e)+" is not a map")},lJ=lV.get,lZ=lV.has,l0=lV.set;tu({target:"Map",proto:!0,real:!0,forced:!0},{getOrInsert:function(e,t){return lZ(l$(this),e)?lJ(this,e):(l0(this,e,t),t)}});var l1=lV.get,l2=lV.has,l4=lV.set;tu({target:"Map",proto:!0,real:!0,forced:!0},{getOrInsertComputed:function(e,t){if(l$(this),em(t),l2(this,e))return l1(this,e);0===e&&1/e==-Infinity&&(e=0);var r=t(e);return l4(this,e,r),r}});var l3=function(e,t,r){return function(n){var i=eP(n),a=arguments.length,o=a>1?arguments[1]:void 0,u=void 0!==o,s=u?e2(o,a>2?arguments[2]:void 0):void 0,c=new e,l=0;return aT(i,function(e){var n=u?s(e,l++):e;r?t(c,e5(n)[0],n[1]):t(c,n)}),c}};tu({target:"Map",stat:!0,forced:!0},{from:l3(lV.Map,lV.set,!0)});var l6=function(e,t,r){return function(){for(var n=new e,i=arguments.length,a=0;a1?arguments[1]:void 0);return!1!==fr(t,function(e,n){if(!r(e,n,t))return!1},!0)}});var fn=lV.Map,fi=lV.set;tu({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(e){var t=l$(this),r=e2(e,arguments.length>1?arguments[1]:void 0),n=new fn;return fr(t,function(e,i){r(e,i,t)&&fi(n,i,e)}),n}});tu({target:"Map",proto:!0,real:!0,forced:!0},{find:function(e){var t=l$(this),r=e2(e,arguments.length>1?arguments[1]:void 0),n=fr(t,function(e,n){if(r(e,n,t))return{value:e}},!0);return n&&n.value}});tu({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(e){var t=l$(this),r=e2(e,arguments.length>1?arguments[1]:void 0),n=fr(t,function(e,n){if(r(e,n,t))return{key:n}},!0);return n&&n.key}});tu({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(e){return!0===fr(l$(this),function(t){var r,n;if((r=t)===(n=e)||r!=r&&n!=n)return!0},!0)}});tu({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(e){var t=fr(l$(this),function(t,r){if(t===e)return{key:r}},!0);return t&&t.key}});var fa=lV.Map,fo=lV.set;tu({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(e){var t=l$(this),r=e2(e,arguments.length>1?arguments[1]:void 0),n=new fa;return fr(t,function(e,i){fo(n,r(e,i,t),e)}),n}});var fu=lV.Map,fs=lV.set;tu({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(e){var t=l$(this),r=e2(e,arguments.length>1?arguments[1]:void 0),n=new fu;return fr(t,function(e,i){fs(n,i,r(e,i,t))}),n}});var fc=lV.set;tu({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(e){for(var t=l$(this),r=arguments.length,n=0;n1?arguments[1]:void 0);return!0===fr(t,function(e,n){if(r(e,n,t))return!0},!0)}});var ff=TypeError,fd=lV.get,fh=lV.has,fv=lV.set;tu({target:"Map",proto:!0,real:!0,forced:!0},{update:function(e,t){var r=l$(this),n=arguments.length;em(t);var i=fh(r,e);if(!i&&n<3)throw new ff("Updating absent value");var a=i?fd(r,e):em(n>2?arguments[2]:void 0)(e,r);return fv(r,e,t(a,e,r)),r}});var fp=TypeError,fg=function(e,t){var r,n=e5(this),i=em(n.get),a=em(n.has),o=em(n.set),u=arguments.length>2?arguments[2]:void 0;if(!R(t)&&!R(u))throw new fp("At least one callback required");return B(a,n,e)?(r=B(i,n,e),R(t)&&B(o,n,e,r=t(r))):R(u)&&B(o,n,e,r=u()),r};tu({target:"Map",proto:!0,real:!0,forced:!0},{upsert:fg});tu({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:fg});var fy=v(lX),fm=function(e,t,r,n){try{return n?t(e5(r)[0],r[1]):t(r)}catch(t){ab(e,"throw",t)}},f_=Array;tu({target:"Array",stat:!0,forced:!o5(function(e){Array.from(e)})},{from:function(e){var t=eP(e),r=tR(this),n=arguments.length,i=n>1?arguments[1]:void 0,a=void 0!==i;a&&(i=e2(i,n>2?arguments[2]:void 0));var o,u,s,c,l,f,d=ay(t),h=0;if(!d||this===f_&&ap(d))for(o=tH(t),u=r?new this(o):f_(o);o>h;h++)f=a?i(t[h],h):t[h],rO(u,h,f);else for(u=r?new this:[],l=(c=a_(t,d)).next;!(s=B(l,c)).done;h++)f=a?fm(c,i,[s.value,h],!0):s.value,rO(u,h,f);return u.length=h,u}});var fb=J.Array.from,fk=v(fb),fw=v(fb),fS=Math.floor,fT=function(e,t){var r=e.length;if(r<8)for(var n,i,a=1;a0;)e[i]=e[--i];i!==a++&&(e[i]=n)}else for(var o=fS(r/2),u=fT(ts(e,0,o),t),s=fT(ts(e,o),t),c=u.length,l=s.length,f=0,d=0;f=t(u[f],s[d])?u[f++]:s[d++]:f3)){if(fC)return!0;if(fE)return fE<603;var e,t,r,n,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)fO.push({k:t+n,v:r})}for(fO.sort(function(e,t){return t.v-e.v}),n=0;nrz(r)?1:-1})),n=tH(a),i=0;i0&&(r.baseConfig.urlList=t.url,r.baseConfig.url=t.url[0].src),r.baseConfig.mediaInfo||(r.baseConfig.mediaInfo={}),r.baseConfig.mediaInfo.file_id=t.file_id,r.baseConfig.mediaInfo.bitrate=t.bitrate,cp(t.pktOffsetMap)&&t.pktOffsetMap.length>0){var n=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;return(null==e||null===(t=la(e).call(e,function(e){return(null==e?void 0:e.time)===r}))||void 0===t?void 0:t.offset)||0}(t.pktOffsetMap,5);n>0&&(r.baseConfig.firstLoadSize=n)}}else r.url=t.url}}function fK(e){var t,r=null;try{r=(null===(t=e.getProperty)||void 0===t?void 0:t.call(e,"curDefinition"))||e.curDefinition}catch(e){}return r}function fV(e,t,r){e.defineProperty&&e.defineProperty(t,{value:r,enumerable:!0,configurable:!0,writable:!0});try{e[t]=r}catch(e){}}function fq(e){var t,r,n=e.config;return n.vid||(null===(t=n.baseConfig)||void 0===t||null===(t=t.mediaInfo)||void 0===t?void 0:t.vid)||(null===(r=n.baseConfig)||void 0===r||null===(r=r.mediaInfo)||void 0===r?void 0:r.id)||void 0}var fH=((vi=fH||{}).DEFAULT="default",vi.USER_SELECT="userSelect",vi.PRELOAD="preload",vi.BITRATE_ADAPTER="bitRateAdapter",vi.OVER_SCORE="overscore",vi),fG=((va=fG||{})[va.PRELOAD_NOT_HIT=0]="PRELOAD_NOT_HIT",va[va.ERROR_ON_FLY=1]="ERROR_ON_FLY",va);function fW(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);rr.size?ft(r.getIterator(),function(e){d_(t,e)&&dm(n,e)}):de(t,function(e){r.includes(e)&&dm(n,e)}),n};tu({target:"Set",proto:!0,real:!0,forced:!dp()},{intersection:db});var dk=f7.has,dw=function(e){var t=f8(this),r=df(e);if(di(t)<=r.size)return!1!==de(t,function(e){if(r.includes(e))return!1},!0);var n=r.getIterator();return!1!==ft(n,function(e){if(dk(t,e))return ab(n,"normal",!1)})};tu({target:"Set",proto:!0,real:!0,forced:!dp()},{isDisjointFrom:dw});var dS=function(e){var t=f8(this),r=df(e);return!(di(t)>r.size)&&!1!==de(t,function(e){if(!r.includes(e))return!1},!0)};tu({target:"Set",proto:!0,real:!0,forced:!dp()},{isSubsetOf:dS});var dT=f7.has,dx=function(e){var t=f8(this),r=df(e);if(di(t)1?arguments[1]:void 0);return!1!==de(t,function(e){if(!r(e,e,t))return!1},!0)}});var dM=eN("iterator"),dB=Object,dj=function(e){if(W(e))return!1;var t=dB(e);return void 0!==t[dM]||"@@iterator"in t||eO(n7,tw(t))},dN=ee("Set"),dU=function(e){var t;return $(t=e)&&"number"==typeof t.size&&R(t.has)&&R(t.keys)?e:dj(e)?new dN(e):e};tu({target:"Set",proto:!0,real:!0,forced:!0},{difference:function(e){return B(dv,this,dU(e))}});var dF=f7.Set,dz=f7.add;tu({target:"Set",proto:!0,real:!0,forced:!0},{filter:function(e){var t=f8(this),r=e2(e,arguments.length>1?arguments[1]:void 0),n=new dF;return de(t,function(e){r(e,e,t)&&dz(n,e)}),n}});tu({target:"Set",proto:!0,real:!0,forced:!0},{find:function(e){var t=f8(this),r=e2(e,arguments.length>1?arguments[1]:void 0),n=de(t,function(e){if(r(e,e,t))return{value:e}},!0);return n&&n.value}});tu({target:"Set",proto:!0,real:!0,forced:!0},{intersection:function(e){return B(db,this,dU(e))}});tu({target:"Set",proto:!0,real:!0,forced:!0},{isDisjointFrom:function(e){return B(dw,this,dU(e))}});tu({target:"Set",proto:!0,real:!0,forced:!0},{isSubsetOf:function(e){return B(dS,this,dU(e))}});tu({target:"Set",proto:!0,real:!0,forced:!0},{isSupersetOf:function(e){return B(dx,this,dU(e))}});var dK=I([].join),dV=I([].push);tu({target:"Set",proto:!0,real:!0,forced:!0},{join:function(e){var t=f8(this),r=void 0===e?",":rz(e),n=[];return de(t,function(e){dV(n,e)}),dK(n,r)}});var dq=f7.Set,dH=f7.add;tu({target:"Set",proto:!0,real:!0,forced:!0},{map:function(e){var t=f8(this),r=e2(e,arguments.length>1?arguments[1]:void 0),n=new dq;return de(t,function(e){dH(n,r(e,e,t))}),n}});var dG=TypeError;tu({target:"Set",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=f8(this),r=arguments.length<2,n=r?void 0:arguments[1];if(em(e),de(t,function(i){r?(r=!1,n=i):n=e(n,i,i,t)}),r)throw new dG("Reduce of empty set with no initial value");return n}});tu({target:"Set",proto:!0,real:!0,forced:!0},{some:function(e){var t=f8(this),r=e2(e,arguments.length>1?arguments[1]:void 0);return!0===de(t,function(e){if(r(e,e,t))return!0},!0)}});tu({target:"Set",proto:!0,real:!0,forced:!0},{symmetricDifference:function(e){return B(dE,this,dU(e))}});tu({target:"Set",proto:!0,real:!0,forced:!0},{union:function(e){return B(dL,this,dU(e))}});var dW=v(dR),dY=["cdn"],dX=0,dQ=function(){function e(){sv(this,e);for(var t,r,n,i,a,o=arguments.length,u=Array(o),s=0;s3&&void 0!==arguments[3]?arguments[3]:"cdn";e.speedListCache&&e.speedListCache[a]&&(e.speedListCache[a].length>=r.saveSpeedMax&&e.speedListCache[a].shift(),e.speedListCache[a].push({speed:t,bytes:n,time:i}),r._updateSpeed(a))}),sf(r,"_onChannelMessage",function(e){if("speedSample"===e.data.type){var t=e.data.data,n=t.speed,i=t.bytes,a=t.timestamp,o=t.type;r.appendList(8*n,i,a,o||"cdn")}}),sf(r,"_onChannelError",function(e){}),r}return sk(e,sP),sg(e,[{key:"saveSpeedMax",get:function(){var e,t=null===(e=this.config)||void 0===e?void 0:e.saveSpeedMax;return"number"==typeof t?t:20}},{key:"avgSpeed",get:function(){return dX},set:function(e){var t;dX=e,null===(t=this._channel)||void 0===t||t.postMessage({type:"speedAvg",data:{value:e}})}},{key:"afterPlayerInit",value:function(){var e=this.player._core;"undefined"!=typeof BroadcastChannel&&(this._channel=new BroadcastChannel(e._cfg.broadcastChannelName),this._channel.addEventListener("message",this._onChannelMessage),this._channel.addEventListener("error",this._onChannelError));var t=this.config.addSpeedTypeList;if(cp(t)){var r,n=f3(new dW(s8(r=[]).call(r,dY,f3(t))));dY.length=0,dY.push.apply(dY,f3(n))}this._initSpeedList()}},{key:"destroy",value:function(){this._channel&&(this._channel.removeEventListener("message",this._onChannelMessage),this._channel.removeEventListener("error",this._onChannelError),this._channel.close(),this._channel=void 0)}},{key:"getSpeedName",value:function(e,t){return e+"Speed"+t.toUpperCase()}},{key:"_updateSpeed",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"cdn",r=e.getAvgSpeedKbs(t),n=this.player;if(n){var i=!1;if("cdn"===t)this.avgSpeed&&r===this.avgSpeed||(this.avgSpeed=r,i=!0);else{var a=this.getSpeedName("avg",t);this[a]&&r===this[a]||(this[a]=r,i=!0)}i&&n.emit("download_speed_change",{type:t,speed:r})}}},{key:"_initSpeedList",value:function(){cb(dY).call(dY,function(t){e.speedListCache[t]||(e.speedListCache[t]=[])})}}],[{key:"pluginName",get:function(){return"testspeed"}},{key:"speedSampleList",get:function(){return e.speedListCache}},{key:"getAvgSpeedKbs",value:function(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"cdn";if(!e.speedListCache||!e.speedListCache[r]||e.speedListCache[r].length<=0)return -1;var n=0;return c_(t=e.speedListCache[r]).call(t,function(e){n+=e.speed}),Math.floor(n/e.speedListCache[r].length)}},{key:"getWeightedSpeedKbs",value:function(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"cdn",n=-1;if(!e.speedListCache||!e.speedListCache[r]||e.speedListCache[r].length<=0)return n;var i=[];cb(t=e.speedListCache[r]).call(t,function(e){i.push(e)}),fU(i).call(i,function(e,t){return e.speed-t.speed});for(var a=i.length,o=0,u=0;u=i._xgOrgBitrate){r=n;break}}return r<0?null:e[r]}(e,t):function(e,t){if(!e)return null;var r=1/0,n=null;return cb(e).call(e,function(e){var i=Math.abs(e._xgOrgBitrate-t);r>i&&(n=e,r=i)}),n||null}(e,t)}function d0(e,t){return cb(e).call(e,function(e){e[t]?e._xgOrgBitrate=e[t]:e.bitrate&&(e._xgOrgBitrate=e.bitrate)}),e}var d1=sg(function e(t){sv(this,e),sf(this,"analysis",void 0),sf(this,"_config",void 0),this._config=sC({},t)},[{key:"select",value:function(e,t,r){if(e.length<=1)return e[0];var n,i=r.autoBitrateParams,a=i.paramA,o=i.paramB,u=i.paramC,s=i.paramD;this._config=sC({},r);var c=this._config.defaultBitrate,l=t<=0||!t?c:a*Math.pow(t,3)+o*Math.pow(t,2)+u*t+s;return(n=dZ(e,l,r.selectAlgType))||(n=e[e.length-1]),n._targetBitrate=l,n}}]),d2=g.Function,d4=/MSIE .\./.test(ei)||"BUN"===aj&&((vu=g.Bun.version.split(".")).length<3||"0"===vu[0]&&(vu[1]<3||"3"===vu[1]&&"0"===vu[2])),d3=function(e,t){var r=t?2:1;return d4?function(n,i){var a=aG(arguments.length,1)>r,o=R(n)?n:d2(n),u=a?ts(arguments,r):[],s=a?function(){w(o,this,u)}:o;return t?e(s,i):e(s)}:e},d6=d3(g.setInterval,!0);tu({global:!0,bind:!0,forced:g.setInterval!==d6},{setInterval:d6});var d8=d3(g.setTimeout,!0);tu({global:!0,bind:!0,forced:g.setTimeout!==d8},{setTimeout:d8});var d5=J.setTimeout,d9=v(d5),d7=sg(function e(t){var r=this;sv(this,e),sf(this,"player",void 0),sf(this,"_timer",null),sf(this,"_prevPauseTime",0),sf(this,"_prevStallTime",0),sf(this,"_prevCurrentTime",0),sf(this,"_info",void 0),sf(this,"_onPlay",function(){r._calcPausedTime()}),sf(this,"_onPause",function(){r._prevPauseTime=s1()}),sf(this,"_onEnded",function(){!r._info.downloadDuration&&r._info.canPlayTime&&(r._info.downloadDuration=(s1()-r._info.canPlayTime)/1e3),r.disable()}),sf(this,"_canPlay",function(){r._info.canPlayTime=s1();var e,t=null===(e=r.player)||void 0===e?void 0:e.buffered;t&&t.length&&(r._info.startBufferTime=t.end(t.length-1))}),sf(this,"_onProgress",function(){var e=r.player;if(e){var t=e.buffered;r._info.canPlayTime&&t&&t.length&&t.end(t.length-1)+.8>e.duration&&(r._info.downloadDuration=(s1()-r._info.canPlayTime)/1e3)}}),sf(this,"_onTick",function(){var e=r.player;if(e){r._timer=d9(r._onTick,500);var t=e.currentTime;(!e.paused||e.ended||0===e.playbackRate||0===e.readyState)&&(r._prevCurrentTime===t?r._prevStallTime||(r._prevStallTime=s1()):r._calcStallTime()),r._prevCurrentTime=t}}),this.player=t,this.resetInfo(),this.enable()},[{key:"isStalling",get:function(){return!!this._prevStallTime}},{key:"destroy",value:function(){this.disable(),this.player=void 0}},{key:"enable",value:function(){this.disable();var e=this.player;e&&(e.on("play",this._onPlay),e.on("pause",this._onPause),e.on("canplay",this._canPlay),e.on("progress",this._onProgress),e.on("ended",this._onEnded),this._timer=d9(this._onTick,500))}},{key:"disable",value:function(){this._timer&&(clearTimeout(this._timer),this._timer=null),this.resetInfo();var e=this.player;e&&(e.off("play",this._onPlay),e.off("pause",this._onPause),e.off("canplay",this._canPlay),e.off("progress",this._onProgress),e.off("ended",this._onEnded))}},{key:"endPlay",value:function(){if(this.player){var e=this.player.buffered;if(e.length)try{this._info.endBufferTime=e.end(e.length-1)}catch(e){}this._info.leaveWithBlock=this.isStalling,this._calcPausedTime(),this._calcStallTime(),!this._info.downloadDuration&&this._info.canPlayTime&&(this._info.downloadDuration=(s1()-this._info.canPlayTime)/1e3)}}},{key:"getInfo",value:function(){return this._info}},{key:"resetInfo",value:function(){this._prevPauseTime=0,this._prevStallTime=0,this._prevCurrentTime=0,this._info={pausedTime:0,stalledTime:0,downloadDuration:0,startBufferTime:0,endBufferTime:0,canPlayTime:0,leaveWithBlock:!1}}},{key:"_calcStallTime",value:function(){this._prevStallTime&&(this._info.stalledTime+=(s1()-this._prevStallTime)/1e3,this._prevStallTime=0)}},{key:"_calcPausedTime",value:function(){this._prevPauseTime&&(this._info.pausedTime+=(s1()-this._prevPauseTime)/1e3,this._prevPauseTime=0)}}]),he=v(f1),ht=sg(function e(){sv(this,e),sf(this,"_queue",[]),sf(this,"_current",{}),sf(this,"_config",{defaultTargetBitrate:1e6,paramBf:1e-6,paramBp:1e-6,paramUpperBl:1.2,paramUpper:1.2,paramLower:.5,slidingWindowWeight:"time",slidingWindowType:"by_weight",slidingWindowWeightThreshold:1e3,slidingWindowCountThreshold:10,paramVlLower:.8,paramVlUpper:.9,paramVl1:.8,paramVl2:1e3,bitrateLower:1e5,bitrateUpper:1e6,slidingWindowExtraction:"weighted_median"})},[{key:"queue",get:function(){return this._queue}},{key:"setConfig",value:function(e){sC(this._config,e||{})}},{key:"setCurrent",value:function(e){sC(this._current,e)}},{key:"getCurrent",value:function(){return this._current}},{key:"resetCurrent",value:function(){this._current={}}},{key:"calcAndReset",value:function(){var e=this._current,t=e.startBufferTime,r=e.duration,n=e.endBufferTime,i=e.leaveWithBlock,a=e.stalledTime,o=e.pausedTime,u=e.downloadDuration,s=e.bitrate;if(r&&s&&n){var c,l,f,d=this._config,h=d.paramBf,v=d.paramBp,p=d.paramUpperBl,g=d.paramUpper,y=d.slidingWindowWeight,m=d.slidingWindowType,_=d.slidingWindowWeightThreshold,b=d.slidingWindowCountThreshold,k=1+((n-t)*h-(a+o)*v)/u;i&&(k=Math.min(k,p));var w=s*Math.max(g,k),S=0;if(S="time"===y?Math.min(u,r+a):Math.min(u,r)*s,this._queue.push([w,S,this._current]),"by_weight"===m){this._queue=he(c=this._queue).call(c,-30);for(var T=cD(l=this._queue).call(l,function(e,t){return e+t[1]},0)-_;T>0;){var x=this._queue.shift();if(!x)break;if(x[1]>T){x[1]-=T,this._queue.unshift(x);break}T-=x[1]}}else this._queue=he(f=this._queue).call(f,-b);this.resetCurrent()}else this.resetCurrent()}},{key:"getDefaultBitrate",value:function(e){if(!e||0===e.length)return 0;for(var t=this._config.defaultTargetBitrate||1e6,r=0,n=0;n=r&&(r=e[n]._xgOrgBitrate);return r||(r=e[e.length-1]._xgOrgBitrate),r}},{key:"getTargetBitrate",value:function(e,t){if(!this._queue.length||!e)return 0;var r,n=this._config,i=n.paramVlLower,a=n.paramVlUpper,o=n.paramVl1,u=n.paramVl2,s=n.bitrateLower,c=n.bitrateUpper,l=n.slidingWindowExtraction,f=0,d=cD(h=this._queue).call(h,function(e,t){return e+t[1]},0);if("weighted_median"===l){var h,v,p=d/2,g=1/0,y=0;cb(v=this._queue).call(v,function(e){(y=Math.abs(p-e[1]))=i[0]&&e._xgOrgBitrate<=i[1]})).call(u,function(e,t){return"number"==typeof t._xgOrgBitrate&&"number"==typeof e._xgOrgBitrate?t._xgOrgBitrate-e._xgOrgBitrate:0});if(!o.length){var u,s,c=1/0;cb(e).call(e,function(e){var t=Math.abs(e._xgOrgBitrate-a);t=(null===(n=e[e.length-1])||void 0===n?void 0:n._xgOrgBitrate)&&(i=0),e[i]._xgOrgBitrate<=t._xgOrgBitrate?1:0}(o,l)),l}},{key:"selector",get:function(){var e=this.config.mode;return this._selectorMap[e]||this._selectorMap.simple}},{key:"getTargetBitrate",value:function(e,t){var r=this.selector;if("getTargetBitrate"in r)return r.getTargetBitrate(e,t)}},{key:"addSelect",value:function(e,t){var r=e||t.name;this._selectorMap[r]=t}},{key:"destroy",value:function(){var e,t=this._selectorMap;cb(e=cw(t)).call(e,function(e){var r=t[e];"destroy"in r&&"function"==typeof r.destroy&&r.destroy()})}}],[{key:"defaultConfig",get:function(){return{disabled:!1,paramBf:.3,paramBp:.5,paramUpper:1.5,paramLower:.6,paramUpperBl:.7,paramVl1:.7,paramVl2:1e3,paramVlUpper:.9,paramVlLower:.8,bitrateUpper:2e6,bitrateLower:2e5,slidingWindowType:"by_weight",slidingWindowWeight:"size",slidingWindowWeightThreshold:3e5,slidingWindowCountThreshold:30,slidingWindowExtraction:"weighted_median",bitrateRange:[2e5,25e5],defaultBitrate:1e6,defaultTargetBitrate:1e6,autoBitrateParams:{paramA:0,paramB:404330129e-17,paramC:.0164405979,paramD:225511.28,minBitrate:2e5},mSpeedRecordValidThreshold:2,mode:"simple",needCheckDuration:!0,overscore:{isOpen:!1,type:"filter",enable266:!0,filterKey:"definition",filterList:[],scoreMultiple:2},bitrateKey:"bitrate"}}},{key:"MaxQueueCapacity",get:function(){return ha},set:function(e){ha=e}}]),hc=sg(function e(){var t,r=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};sv(this,e),sf(this,"config",{size:30,severeBlockDuration:1500,slightBlockDuration:100,highBitrateRatio:1.5,lowBitrateRatio:.8,highLadderSelectedCnt:1,lowLadderSelectedCnt:1,blockSumMaxTime:6e5}),sf(this,"timerId",null),sf(this,"_tBQueue",[]),sf(this,"_sBQueue",[]),sf(this,"_blockQueue",[]),sf(this,"_info",{blockDurationSum:0,currentBlockDur:0,targetBitrateAvg:0,selectedBitrateAvg:0,higherSelectedCnt:0,lowerSelectedCnt:0}),c_(t=cw(n)).call(t,function(e){r.config[e]=n[e]||0}),this.setTimer()},[{key:"targetBitRate",set:function(e){var t;if(e&&"number"==typeof e){this._tBQueue.push(cX("".concat(e),10)),this._tBQueue.length>this.config.size&&this._tBQueue.shift();var r=0;c_(t=this._tBQueue).call(t,function(e){r+=e}),this._info.targetBitrateAvg=r/this._tBQueue.length}}},{key:"selectBitRate",set:function(e){var t;if(e&&"number"==typeof e){this._sBQueue.push(e),this._sBQueue.length>this.config.size&&this._sBQueue.shift();var r=0;c_(t=this._sBQueue).call(t,function(e){r+=e}),this._info.selectedBitrateAvg=r/this._sBQueue.length}}},{key:"blockDuration",set:function(e){this._blockQueue.push(e),this._blockQueue.length>this.config.size&&this._blockQueue.shift();var t,r=0;c_(t=this._blockQueue).call(t,function(e){r+=e}),this._info.blockDurationSum=r}},{key:"currentBlockDur",set:function(e){this._info.currentBlockDur+=e}},{key:"updateBitRateInfo",value:function(e,t){e&&t&&(e>t?this._info.higherSelectedCnt++:ee.severeBlockDuration&&(t.selectedBitrateAvg>t.targetBitrateAvg*e.highBitrateRatio&&t.higherSelectedCnt>=e.highLadderSelectedCnt||t.currentBlockDur>e.severeBlockDuration)?1:t.blockDurationSum=e.lowLadderSelectedCnt?2:0}},{key:"setConfig",value:function(){var e,t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};c_(e=cw(r)).call(e,function(e){t.config[e]=r[e]||0})}},{key:"resetCurrent",value:function(){this._info.currentBlockDur=0}},{key:"setTimer",value:function(){var e=this;this._blockQueue=[],this._tBQueue=[],this._sBQueue=[],this._info={blockDurationSum:0,currentBlockDur:0,targetBitrateAvg:0,selectedBitrateAvg:0,higherSelectedCnt:0,lowerSelectedCnt:0},this.timerId&&(clearTimeout(this.timerId),this.timerId=null),this.timerId=d9(function(){e.setTimer()},this.config.blockSumMaxTime)}}]),hl=new hc({}),hf=null,hd=null,hh={needCheckDuration:!0};function hv(e){var t=0,r=e.speedAlgoType;return r&&r!==hu.AVG?r===hu.WEIGHT&&(t=dQ.getWeightedSpeedKbs()):t=dQ.getAvgSpeedKbs(),t}function hp(e,t){var r,n,i=t.userDefinition,a=t.config,o=t.bitrateAdapter,u=new dJ;if(y=[],cb(g=e).call(g,function(e){e.mediaType&&"video"!==e.mediaType||y.push(e)}),e=y,a.disabled||!e||e.length<1)return null;var s=d0(e,a.bitrateKey),c=fU(s).call(s,function(e,t){return"number"==typeof t._xgOrgBitrate&&"number"==typeof e._xgOrgBitrate?t._xgOrgBitrate-e._xgOrgBitrate:0}),l=1024*hv(a),f=null;if(o||(hf||(hf=new hs({config:a})),o=hf),o.analysis=u,c&&c.length&&(f=o.select(c,a.mode,l))&&a.mode===ho.BANDWIDTH){var d=f._targetBitrate||f._xgOrgBitrate,h=null;if(!l||l<0||1!==a.mixFactor){var v=sC({},a);v.mode=ho.BUFFER_INFO;var p=new hs({config:v});"number"==typeof l&&l>0&&(p.speed=l),h=null==p?void 0:p.select(s,v.mode,l)}if(h){var g,y,m,_=h._targetBitrate||h._xgOrgBitrate;(f=dZ(s,m=!l||l<0?_:a&&"number"==typeof a.mixFactor&&a.mixFactor>=0&&a.mixFactor<=1?d*a.mixFactor+_*(1-a.mixFactor):a&&"number"==typeof a.mixFactor&&a.mixFactor>1?Math.max(d,_):Math.min(d,_),a.selectAlgType))||(f=e[e.length-1]),f._targetBitrate=m}}f&&(f.type=fH.BITRATE_ADAPTER);var b=(null===(r=f)||void 0===r?void 0:r.duration)||0,k=null===(n=o)||void 0===n?void 0:n.getTargetBitrate(b,e);if(k&&(hl.targetBitRate=k),i){var w=hg.getUserSelectBitrate(c,i);w&&(hl.selectBitRate=w._xgOrgBitrate,hl.updateBitRateInfo(w._xgOrgBitrate,k),f=w,u.type=d$.USER_SELECT)}if(a.overscore&&a.overscore.isOpen&&f){var S=function(e,t,r){var n=r.isOpen,i=r.enable266,a=r.filterKey,o=r.filterList,u=r.scoreMultiple,s=r.type;if(!n)return e;var c=null;return"filter"===s?c=function(e,t,r,n){var i=null;if(cb(r).call(r,function(r){r.source===t[e]&&(i=r)}),!i)return null;for(var a=null,o=function(t){var r;if(cb(r=i.target).call(r,function(r){n[t][e]===r&&(a=n[t])}),a)return 1},u=0;u-1&&nr.length-1?r.length-1:n+e]:null}(u,e,t)),c&&(!c.isH266||i)?(c.type=fH.OVER_SCORE,c.fromType=e.type,c.orgDefinition=e.definition,c):e}(f,c,a.overscore);u.type=d$.SR,f=S}return f&&(f.chosenType=u.type,f.chosenReason=u.reason),f}var hg=function(){function e(t){var r,n,i,a;return sv(this,e),sf((n=this,i=e,a=[t],i=s_(i),r=sy(n,sm()?rf(i,a||[],s_(n).constructor):i.apply(n,a))),"bitRateAdapter",void 0),sf(r,"curBitRate",void 0),sf(r,"_onXLog",function(e){"waitingEnd"===e.eventType&&0===e.type&&(hl.blockDuration=e.costTime,r.player.isUserActive&&(hl.currentBlockDur=e.costTime))}),e.defaultConfig=r.config,r}return sk(e,sP),sg(e,[{key:"detectDefInfo",get:function(){return hl}},{key:"beforeDestroy",value:function(){this.destroy()}},{key:"destroy",value:function(){var e,t;null===(e=this.player)||void 0===e||e.off("xglog",this._onXLog),null===(t=this.bitRateAdapter)||void 0===t||t.destroy(),this.bitRateAdapter=void 0,null==hl||hl.resetCurrent()}},{key:"beforePlayerInit",value:function(){var e=this.player,t=this.config,r=t.multiFactors;(null==r?void 0:r.length)>0&&this.updateParamsByFactor(r),this._bindEvent(),this.bitRateAdapter=new hs({config:t},e),hf||(hf=new hs({config:t})),hl.setConfig(t.detectConfig||{}),hl.resetCurrent();var n=this.getInitBitrate();this.curBitRate=n,fz(e,n)}},{key:"updateParamsByFactor",value:function(e){for(var t,r=this,n=this.playerConfig.mediaInfo||this.playerConfig,i=(this.playerConfig.baseConfig||n).codecType,a=n.videoHeight,o=n.videoWidth,u=0|navigator.deviceMemory,s=0|navigator.hardwareConcurrency,c=null,l={codecType:i,videoHeight:a,videoWidth:o,memory:u,core:s},f=0;f0?null===(s=t.baseConfig)||void 0===s?void 0:s.urlList:(null===(c=t.baseConfig)||void 0===c?void 0:c.url)||t.url,definition:(null==n?void 0:n.defaultDefinition)||t.defaultDefinition||-1,bitrate:(n||t).defaultBitrate||((null===(l=t.baseConfig)||void 0===l?void 0:l.mediaInfo)||t).bitrate||-1,type:fH.DEFAULT}),f&&(f.networkSpeed=this.getSpeed()),f||void 0}}},{key:"getSuitableBitrate",value:function(e,t){if(this.bitRateAdapter)return hp(e,{config:this.config,bitrateAdapter:this.bitRateAdapter,userDefinition:t})}},{key:"getAdaptBitrate",value:function(e,t){var r,n=null,i=this.bitRateAdapter,a=this.config;return a.disabled||!i||(cp(e=fU(r=d0(e,a.bitrateKey)).call(r,function(e,t){return"number"==typeof e._xgOrgBitrate&&"number"==typeof t._xgOrgBitrate?t._xgOrgBitrate-e._xgOrgBitrate:0}))&&e.length&&(i.speed=t,n=i.select(e,a.mode,t)),n&&(n.type=fH.BITRATE_ADAPTER)),n}},{key:"getDefinition",value:function(e,t,r){for(var n=-1,i=0;in+1?e[n+1]:!r&&n-1>=0?e[n-1]:null}},{key:"needChangeDefinition",value:function(){var t,r,n,i,a=this.playerConfig,o=this.player,u=[];try{i=o.curDefinition,u=(null===(t=a.shared)||void 0===t||null===(t=t.definition)||void 0===t?void 0:t.list)||o.definitionList}catch(e){}var s=(null===(r=a.shared)||void 0===r||null===(r=r.definition)||void 0===r?void 0:r.userSelectDefinition)||a.userSelectDefinition,c=(null===(n=a.shared)||void 0===n||null===(n=n.definition)||void 0===n?void 0:n.extDefinition)||a.extDefinition,l=cp(c)&&c.length>0?c:u||[],f={type:0,message:"DO_NOT_UPDATE",targetDefinition:null};if(!s||l.length<2)return f;var d=i;s&&(d=e.getUserSelectBitrate(l,s));var h=hl.checkDefinition();f.type=h;var v=1024*this.getSpeed(),p=this.getAdaptBitrate(l,v);if(!(p&&0!==h&&p&&p._xgOrgBitrate&&d&&d._xgOrgBitrate))return f.message="DO_NOT_UPDATE",f;var g=p._xgOrgBitrate>=d._xgOrgBitrate,y=p._xgOrgBitrate1&&r.core>=Number(u[0])&&r.core<=Number(u[1])&&(s=!0);break;case"memory":r.memory&&u.length>1&&r.memory>=Number(u[0])&&r.memory<=Number(u[1])&&(s=!0);break;case"video_screen_mode":;u.length>0&&"landscape"===u[0]&&(a=r.videoHeight,o=r.videoWidth,a&&o&&o>a)&&(s=!0);break;case"encoder":u.length>0&&u[0]&&r.codecType&&u[0]===r.codecType&&(s=!0)}return s}},{key:"getSpeed",value:function(){return hv(this.config)}}],[{key:"pluginName",get:function(){return"BitrateSelector"}},{key:"defaultConfig",get:function(){return sC({needCheckDuration:!0},hh)},set:function(e){var t;cb(t=cw(e)).call(t,function(t){hh[t]=e[t]})}},{key:"getSuitableBitrate",value:function(t,r,n){return n||(n=e.defaultConfig),n=sC(n,hh),r||(r=hd),hp(t,{userDefinition:r,config:n})}},{key:"getUserSelectBitrate",value:function(e,t){if(t&&e&&e.length>0){for(var r=null,n=null,i=0;i1?arguments[1]:void 0)}});var hb=rw("Array","findIndex"),hk=Array.prototype,hw=v(function(e){var t=e.findIndex;return e===hk||et(hk,e)&&t===hk.findIndex?hb:t}),hS=((vl=hS||{})[vl.DURATION=0]="DURATION",vl[vl.SIZE=1]="SIZE",vl),hT=((vf=hT||{})[vf.INDEXDB=0]="INDEXDB",vf[vf.MEMORY=1]="MEMORY",vf),hx=((vd=hx||{}).PRELOAD_NEXT="PRELOAD_NEXT",vd.PRELOAD_START="PRELOAD_START",vd.PRELOAD_CANCEL="PRELOAD_CANCEL",vd),hI=v(n9),hC=v(ay),hP=v(i4),hE=v(i1),hO=v(ry),hL=v(i$),hR=v(uF),hA=v(u$),hD=v(se),hM=v(so),hB=v(ss),hj=v(uL);function hN(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function hG(e,t,r){return(t=h1(t))in e?ck(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hW(e){return(hW=hP?hE(hO).call(hO):function(e){return e.__proto__||hO(e)})(e)}function hY(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=hL(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),ck(e,"prototype",{writable:!1}),t&&h0(e,t)}function hX(){try{var e=!Boolean.prototype.valueOf.call(rf(Boolean,[],function(){}))}catch(e){}return(hX=function(){return!!e})()}function hQ(e,t){var r=cw(e);if(hR){var n=hR(e);t&&(n=cC(n).call(n,function(t){return hA(e,t).enumerable})),r.push.apply(r,n)}return r}function h$(e){for(var t=1;t=0;--a){var o=this.tryEntries[a],u=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),p}},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;x(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:C(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),p}},t}function h0(e,t){return(h0=hP?hE(hP).call(hP):function(e,t){return e.__proto__=t,e})(e,t)}function h1(e){var t=function(e,t){if("object"!=uA(e)||!e)return e;var r=e[hB];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=uA(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==uA(t)?t:t+""}function h2(e){return(h2="function"==typeof hI&&"symbol"==typeof hj?function(e){return typeof e}:function(e){return e&&"function"==typeof hI&&e.constructor===hI&&e!==hI.prototype?"symbol":typeof e})(e)}function h4(e,t){if(e){if("string"==typeof e)return hN(e,t);var r,n=he(r=({}).toString.call(e)).call(r,8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?fw(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hN(e,t):void 0}}var h3=function(e){return e&&e.Math==Math&&e},h6=h3("object"==typeof globalThis&&globalThis)||h3("object"==typeof window&&window)||h3("object"==typeof self&&self)||h3("object"==typeof h&&h)||function(){return this}()||Function("return this")(),h8={exports:{}},h5=Object.defineProperty,h9=function(e,t){try{h5(h6,e,{value:t,configurable:!0,writable:!0})}catch(r){h6[e]=t}return t},h7="__core-js_shared__",ve=h6[h7]||h9(h7,{});(h8.exports=function(e,t){return ve[e]||(ve[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.26.1",mode:"global",copyright:"\xa9 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE",source:"https://github.com/zloirock/core-js"});var vt,vr,vn,vi,va,vo,vu,vs,vc,vl,vf,vd,vh,vv,vp=h8.exports,vg=function(e){try{return!!e()}catch(e){return!0}},vy=!vg(function(){var e=(function(){}).bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}),vm=Function.prototype,v_=vm.call,vb=vy&&vm.bind.bind(v_,v_),vk=vy?vb:function(e){return function(){return v_.apply(e,arguments)}},vw=function(e){return null==e},vS=TypeError,vT=function(e){if(vw(e))throw vS("Can't call method on "+e);return e},vx=Object,vI=function(e){return vx(vT(e))},vC=vk({}.hasOwnProperty),vP=Object.hasOwn||function(e,t){return vC(vI(e),t)},vE=0,vO=Math.random(),vL=vk(1..toString),vR=function(e){return"Symbol("+(void 0===e?"":e)+")_"+vL(++vE+vO,36)},vA="object"==typeof document&&document.all,vD={all:vA,IS_HTMLDDA:void 0===vA&&void 0!==vA},vM=vD.all,vB=vD.IS_HTMLDDA?function(e){return"function"==typeof e||e===vM}:function(e){return"function"==typeof e},vj=function(e,t){var r;return arguments.length<2?vB(r=h6[e])?r:void 0:h6[e]&&h6[e][t]},vN=vj("navigator","userAgent")||"",vU=h6.process,vF=h6.Deno,vz=vU&&vU.versions||vF&&vF.version,vK=vz&&vz.v8;vK&&(vv=(vh=vK.split("."))[0]>0&&vh[0]<4?1:+(vh[0]+vh[1])),!vv&&vN&&(!(vh=vN.match(/Edge\/(\d+)/))||vh[1]>=74)&&(vh=vN.match(/Chrome\/(\d+)/))&&(vv=+vh[1]);var vV=vv,vq=!!Object.getOwnPropertySymbols&&!vg(function(){var e=Symbol();return!String(e)||!(Object(e) instanceof Symbol)||!Symbol.sham&&vV&&vV<41}),vH=vq&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,vG=vp("wks"),vW=h6.Symbol,vY=vW&&vW.for,vX=vH?vW:vW&&vW.withoutSetter||vR,vQ=function(e){if(!vP(vG,e)||!vq&&"string"!=typeof vG[e]){var t="Symbol."+e;vq&&vP(vW,e)?vG[e]=vW[e]:vG[e]=vH&&vY?vY(t):vX(t)}return vG[e]},v$=vQ("toStringTag"),vJ={};vJ[v$]="z";var vZ="[object z]"===String(vJ),v0={},v1=!vg(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}),v2=vD.all,v4=vD.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:vB(e)||e===v2}:function(e){return"object"==typeof e?null!==e:vB(e)},v3=h6.document,v6=v4(v3)&&v4(v3.createElement),v8=function(e){return v6?v3.createElement(e):{}},v5=!v1&&!vg(function(){return 7!=Object.defineProperty(v8("div"),"a",{get:function(){return 7}}).a}),v9=v1&&vg(function(){return 42!=Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),v7=String,pe=TypeError,pt=function(e){if(v4(e))return e;throw pe(v7(e)+" is not an object")},pr=Function.prototype.call,pn=vy?pr.bind(pr):function(){return pr.apply(pr,arguments)},pi=vk({}.isPrototypeOf),pa=Object,po=vH?function(e){return"symbol"==typeof e}:function(e){var t=vj("Symbol");return vB(t)&&pi(t.prototype,pa(e))},pu=String,ps=function(e){try{return pu(e)}catch(e){return"Object"}},pc=TypeError,pl=function(e){if(vB(e))return e;throw pc(ps(e)+" is not a function")},pf=function(e,t){var r=e[t];return vw(r)?void 0:pl(r)},pd=TypeError,ph=function(e,t){var r,n;if("string"===t&&vB(r=e.toString)&&!v4(n=pn(r,e))||vB(r=e.valueOf)&&!v4(n=pn(r,e))||"string"!==t&&vB(r=e.toString)&&!v4(n=pn(r,e)))return n;throw pd("Can't convert object to primitive value")},pv=TypeError,pp=vQ("toPrimitive"),pg=function(e,t){if(!v4(e)||po(e))return e;var r,n=pf(e,pp);if(n){if(void 0===t&&(t="default"),!v4(r=pn(n,e,t))||po(r))return r;throw pv("Can't convert object to primitive value")}return void 0===t&&(t="number"),ph(e,t)},py=function(e){var t=pg(e,"string");return po(t)?t:t+""},pm=TypeError,p_=Object.defineProperty,pb=Object.getOwnPropertyDescriptor,pk="enumerable",pw="configurable",pS="writable";v0.f=v1?v9?function(e,t,r){if(pt(e),t=py(t),pt(r),"function"==typeof e&&"prototype"===t&&"value"in r&&pS in r&&!r[pS]){var n=pb(e,t);n&&n[pS]&&(e[t]=r.value,r={configurable:pw in r?r[pw]:n[pw],enumerable:pk in r?r[pk]:n[pk],writable:!1})}return p_(e,t,r)}:p_:function(e,t,r){if(pt(e),t=py(t),pt(r),v5)try{return p_(e,t,r)}catch(e){}if("get"in r||"set"in r)throw pm("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var pT={exports:{}},px=Function.prototype,pI=v1&&Object.getOwnPropertyDescriptor,pC=vP(px,"name"),pP=pC&&(!v1||v1&&pI(px,"name").configurable),pE={EXISTS:pC,PROPER:pC&&"something"===(function(){}).name,CONFIGURABLE:pP},pO=vk(Function.toString);vB(ve.inspectSource)||(ve.inspectSource=function(e){return pO(e)});var pL,pR,pA,pD=ve.inspectSource,pM=h6.WeakMap,pB=vB(pM)&&/native code/.test(String(pM)),pj=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},pN=v1?function(e,t,r){return v0.f(e,t,pj(1,r))}:function(e,t,r){return e[t]=r,e},pU=vp("keys"),pF=function(e){return pU[e]||(pU[e]=vR(e))},pz={},pK="Object already initialized",pV=h6.TypeError,pq=h6.WeakMap;if(pB||ve.state){var pH=ve.state||(ve.state=new pq);pH.get=pH.get,pH.has=pH.has,pH.set=pH.set,pL=function(e,t){if(pH.has(e))throw pV(pK);return t.facade=e,pH.set(e,t),t},pR=function(e){return pH.get(e)||{}},pA=function(e){return pH.has(e)}}else{var pG=pF("state");pz[pG]=!0,pL=function(e,t){if(vP(e,pG))throw pV(pK);return t.facade=e,pN(e,pG,t),t},pR=function(e){return vP(e,pG)?e[pG]:{}},pA=function(e){return vP(e,pG)}}var pW={set:pL,get:pR,has:pA,enforce:function(e){return pA(e)?pR(e):pL(e,{})},getterFor:function(e){return function(t){var r;if(!v4(t)||(r=pR(t)).type!==e)throw pV("Incompatible receiver, "+e+" required");return r}}},pY=pE.CONFIGURABLE,pX=pW.enforce,pQ=pW.get,p$=Object.defineProperty,pJ=v1&&!vg(function(){return 8!==p$(function(){},"length",{value:8}).length}),pZ=String(String).split("String"),p0=pT.exports=function(e,t,r){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!vP(e,"name")||pY&&e.name!==t)&&(v1?p$(e,"name",{value:t,configurable:!0}):e.name=t),pJ&&r&&vP(r,"arity")&&e.length!==r.arity&&p$(e,"length",{value:r.arity});try{r&&vP(r,"constructor")&&r.constructor?v1&&p$(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=pX(e);return vP(n,"source")||(n.source=pZ.join("string"==typeof t?t:"")),e};Function.prototype.toString=p0(function(){return vB(this)&&pQ(this).source||pD(this)},"toString");var p1=pT.exports,p2=function(e,t,r,n){n||(n={});var i=n.enumerable,a=void 0!==n.name?n.name:t;if(vB(r)&&p1(r,a,n),n.global)i?e[t]=r:h9(t,r);else{try{n.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=r:v0.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},p4=vk({}.toString),p3=vk("".slice),p6=function(e){return p3(p4(e),8,-1)},p8=vQ("toStringTag"),p5=Object,p9="Arguments"==p6(function(){return arguments}()),p7=function(e,t){try{return e[t]}catch(e){}},ge=vZ?p6:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=p7(t=p5(e),p8))?r:p9?p6(t):"Object"==(n=p6(t))&&vB(t.callee)?"Arguments":n};vZ||p2(Object.prototype,"toString",vZ?({}).toString:function(){return"[object "+ge(this)+"]"},{unsafe:!0});var gt={},gr={},gn={}.propertyIsEnumerable,gi=Object.getOwnPropertyDescriptor,ga=gi&&!gn.call({1:2},1);gr.f=ga?function(e){var t=gi(this,e);return!!t&&t.enumerable}:gn;var go=Object,gu=vk("".split),gs=vg(function(){return!go("z").propertyIsEnumerable(0)})?function(e){return"String"==p6(e)?gu(e,""):go(e)}:go,gc=function(e){return gs(vT(e))},gl=Object.getOwnPropertyDescriptor;gt.f=v1?gl:function(e,t){if(e=gc(e),t=py(t),v5)try{return gl(e,t)}catch(e){}if(vP(e,t))return pj(!pn(gr.f,e,t),e[t])};var gf={},gd=Math.ceil,gh=Math.floor,gv=Math.trunc||function(e){var t=+e;return(t>0?gh:gd)(t)},gp=function(e){var t=+e;return t!=t||0===t?0:gv(t)},gg=Math.max,gy=Math.min,gm=function(e,t){var r=gp(e);return r<0?gg(r+t,0):gy(r,t)},g_=Math.min,gb=function(e){return e>0?g_(gp(e),9007199254740991):0},gk=function(e){return gb(e.length)},gw=function(e){return function(t,r,n){var i,a=gc(t),o=gk(a),u=gm(n,o);if(e&&r!=r){for(;o>u;)if((i=a[u++])!=i)return!0}else for(;o>u;u++)if((e||u in a)&&a[u]===r)return e||u||0;return!e&&-1}},gS={includes:gw(!0),indexOf:gw(!1)},gT=gS.indexOf,gx=vk([].push),gI=function(e,t){var r,n=gc(e),i=0,a=[];for(r in n)!vP(pz,r)&&vP(n,r)&&gx(a,r);for(;t.length>i;)vP(n,r=t[i++])&&(~gT(a,r)||gx(a,r));return a},gC=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],gP=gC.concat("length","prototype");gf.f=Object.getOwnPropertyNames||function(e){return gI(e,gP)};var gE={};gE.f=Object.getOwnPropertySymbols;var gO=vk([].concat),gL=vj("Reflect","ownKeys")||function(e){var t=gf.f(pt(e)),r=gE.f;return r?gO(t,r(e)):t},gR=/#|\.prototype\./,gA=function(e,t){var r=gM[gD(e)];return r==gj||r!=gB&&(vB(t)?vg(t):!!t)},gD=gA.normalize=function(e){return String(e).replace(gR,".").toLowerCase()},gM=gA.data={},gB=gA.NATIVE="N",gj=gA.POLYFILL="P",gN=gt.f,gU=function(e,t,r){for(var n=gL(t),i=v0.f,a=gt.f,o=0;oo;o++)if((s=m(e[o]))&&pi(mK,s))return s;return new mz(!1)}i=mN(e,a)}for(c=h?e.next:i.next;!(l=pn(c,i)).done;){try{s=m(l.value)}catch(e){mU(i,"throw",e)}if("object"==typeof s&&s&&pi(mK,s))return s}return new mz(!1)},mq=vQ("iterator"),mH=!1;try{var mG=0,mW={next:function(){return{done:!!mG++}},return:function(){mH=!0}};mW[mq]=function(){return this},Array.from(mW,function(){throw 2})}catch(e){}var mY=function(e,t){if(!t&&!mH)return!1;var r=!1;try{var n={};n[mq]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},mX=y8.CONSTRUCTOR||!mY(function(e){y0.all(e).then(void 0,function(){})});gF({target:"Promise",stat:!0,forced:mX},{all:function(e){var t=this,r=y5.f(t),n=r.resolve,i=r.reject,a=yJ(function(){var r=pl(t.resolve),a=[],o=0,u=1;mV(e,function(e){var s=o++,c=!1;u++,pn(r,t,e).then(function(e){c||(c=!0,a[s]=e,--u||n(a))},i)}),--u||n(a)});return a.error&&i(a.value),r.promise}});var mQ=y8.CONSTRUCTOR,m$=y0&&y0.prototype;if(gF({target:"Promise",proto:!0,forced:mQ,real:!0},{catch:function(e){return this.then(void 0,e)}}),vB(y0)){var mJ=vj("Promise").prototype.catch;m$.catch!==mJ&&p2(m$,"catch",mJ,{unsafe:!0})}gF({target:"Promise",stat:!0,forced:mX},{race:function(e){var t=this,r=y5.f(t),n=r.reject,i=yJ(function(){var i=pl(t.resolve);mV(e,function(e){pn(i,t,e).then(r.resolve,n)})});return i.error&&n(i.value),r.promise}}),gF({target:"Promise",stat:!0,forced:y8.CONSTRUCTOR},{reject:function(e){var t=y5.f(this);return pn(t.reject,void 0,e),t.promise}});var mZ=function(e,t){if(pt(e),v4(t)&&t.constructor===e)return t;var r=y5.f(e);return(0,r.resolve)(t),r.promise},m0=y8.CONSTRUCTOR;vj("Promise"),gF({target:"Promise",stat:!0,forced:m0},{resolve:function(e){return mZ(this,e)}});var m1=y0&&y0.prototype;if(gF({target:"Promise",proto:!0,real:!0,forced:!!y0&&vg(function(){m1.finally.call({then:function(){}},function(){})})},{finally:function(e){var t=ya(this,vj("Promise")),r=vB(e);return this.then(r?function(r){return mZ(t,e()).then(function(){return r})}:e,r?function(r){return mZ(t,e()).then(function(){throw r})}:e)}}),vB(y0)){var m2=vj("Promise").prototype.finally;m1.finally!==m2&&p2(m1,"finally",m2,{unsafe:!0})}var m4={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,o){if("function"!=typeof n)throw TypeError("The listener must be a function");var u=new i(n,a||e,o),s=r?r+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],u]:e._events[s].push(u):(e._events[s]=u,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function u(){this._events=new n,this._eventsCount=0}hL&&(n.prototype=hL(null),(new n).__proto__||(r=!1)),u.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?he(n).call(n,1):n);return hR?s8(i).call(i,hR(e)):i},u.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,o=Array(a);i9007199254740991)throw m8("Maximum allowed index exceeded");return e},m9=function(e,t,r){var n=py(t);n in e?v0.f(e,n,pj(0,r)):e[n]=r},m7=vQ("species"),_e=Array,_t=function(e){var t;return m6(e)&&(yt(t=e.constructor)&&(t===_e||m6(t.prototype))||v4(t)&&null===(t=t[m7]))&&(t=void 0),void 0===t?_e:t},_r=function(e,t){return new(_t(e))(0===t?0:t)},_n=vQ("species"),_i=function(e){return vV>=51||!vg(function(){var t=[];return(t.constructor={})[_n]=function(){return{foo:1}},1!==t[e](Boolean).foo})},_a=vQ("isConcatSpreadable"),_o=vV>=51||!vg(function(){var e=[];return e[_a]=!1,e.concat()[0]!==e}),_u=_i("concat"),_s=function(e){if(!v4(e))return!1;var t=e[_a];return void 0!==t?!!t:m6(e)};gF({target:"Array",proto:!0,arity:1,forced:!_o||!_u},{concat:function(e){var t,r,n,i,a,o=vI(this),u=_r(o,0),s=0;for(t=-1,n=arguments.length;tm;m++)if((u||m in p)&&(h=g(d=p[m],m,v),e)){if(t)b[m]=h;else if(h)switch(e){case 3:return!0;case 5:return d;case 6:return m;case 2:_c(b,d)}else switch(e){case 4:return!1;case 7:_c(b,d)}}return a?-1:n||i?i:b}},_f={forEach:_l(0),map:_l(1),filter:_l(2),some:_l(3),every:_l(4),find:_l(5),findIndex:_l(6),filterReject:_l(7)},_d=_f.filter;gF({target:"Array",proto:!0,forced:!_i("filter")},{filter:function(e){return _d(this,e,arguments.length>1?arguments[1]:void 0)}});var _h=TypeError,_v=function(e,t){if(!delete e[t])throw _h("Cannot delete property "+ps(t)+" of "+ps(e))},_p=String,_g=function(e){if("Symbol"===ge(e))throw TypeError("Cannot convert a Symbol value to a string");return _p(e)},_y=Array,_m=Math.max,__=function(e,t,r){for(var n=gk(e),i=gm(t,n),a=gm(void 0===r?n:r,n),o=_y(_m(a-i,0)),u=0;i0;)e[n]=e[--n];n!==a++&&(e[n]=r)}return e},_S=function(e,t,r,n){for(var i=t.length,a=r.length,o=0,u=0;o=n(t[o],r[u])?t[o++]:r[u++]:o3)){if(_C)return!0;if(_E)return _E<603;var e,t,r,n,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)_O.push({k:t+n,v:r})}for(_O.sort(function(e,t){return t.v-e.v}),n=0;n<_O.length;n++)t=_O[n].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}});gF({target:"Array",proto:!0,forced:_A||!_D||!_M||!_B},{sort:function(e){void 0!==e&&pl(e);var t,r=vI(this);if(_B)return void 0===e?_L(r):_L(r,e);var n,i,a=[],o=gk(r);for(i=0;i_g(r)?1:-1})),n=gk(a),i=0;ic-n+r;a--)_v(s,a-1)}else if(r>n)for(a=c-n;a>l;a--)u=a+r-1,(o=a+n-1)in s?s[u]=s[o]:_v(s,u);for(a=0;ai;)for(var u,s=gs(arguments[i++]),c=a?_G(_V(s),a(s)):_V(s),l=c.length,f=0;l>f;)u=c[f++],v1&&!pn(o,s,u)||(r[u]=s[u]);return r}:_q;gF({target:"Object",stat:!0,arity:2,forced:Object.assign!==_W},{assign:_W}),gF({target:"Object",stat:!0,forced:vg(function(){_V(1)})},{keys:function(e){return _V(vI(e))}});var _Y={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},_X=v8("span").classList,_Q=_X&&_X.constructor&&_X.constructor.prototype,_$=_Q===Object.prototype?void 0:_Q,_J=_f.forEach,_Z=_T("forEach")?[].forEach:function(e){return _J(this,e,arguments.length>1?arguments[1]:void 0)},_0=function(e){if(e&&e.forEach!==_Z)try{pN(e,"forEach",_Z)}catch(t){e.forEach=_Z}};for(var _1 in _Y)_Y[_1]&&_0(h6[_1]&&h6[_1].prototype);_0(_$);tu({target:"Reflect",stat:!0},{get:function e(t,r){var n,i,a,o=arguments.length<3?t:arguments[2];return e5(t)===o?t[r]:(i=A.f(t,r))?void 0!==(n=i)&&(eO(n,"value")||eO(n,"writable"))?i.value:void 0===i.get?void 0:B(i.get,o):$(a=rg(t))?e(a,r,o):void 0}});var _2=J.Reflect.get,_4=v(_2),_3=v(_2);function _6(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=uA(e)||!e)return e;var r=e[hB];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=uA(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==uA(t)?t:t+""}(t))in e?ck(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _8=((bc=_8||{}).MP4="MP4",bc.MP4_MSE_SOFT="MP4_MSE_SOFT",bc.MP4_MSE="MP4_MSE",bc.MP4_0="MP4_0",bc.MP4_1="MP4_1",bc.MP4_2="MP4_2",bc.DASH="DASH",bc.HLS="HLS",bc),_5={CDN:"cdn"},_9=0,_7=1,be=2,bt=3,br=4,bn=5,bi=6,ba=7,bo=8,bu=9;_6(_6(_6(_6(_6(_6(_6(_6(_6(_6({},_9,"before start"),_7,"codec not support"),be,"start init destroy"),bt,"no preload"),br,"close downgrade"),bn,"init promise catch"),bi,"player error"),ba,"http error"),bo,"mse error"),bu,"destroy");var bs={};bs.f=v1&&!v9?Object.defineProperties:function(e,t){pt(e);for(var r,n=gc(t),i=_V(t),a=i.length,o=0;a>o;)v0.f(e,r=i[o++],n[r]);return e};var bc,bl,bf="prototype",bd="script",bh=pF("IE_PROTO"),bv=function(){},bp=function(e){return"<"+bd+">"+e+""},bg=function(e){e.write(bp("")),e.close();var t=e.parentWindow.Object;return e=null,t},by=function(){var e,t=v8("iframe");return t.style.display="none",yh.appendChild(t),t.src=String("java"+bd+":"),(e=t.contentWindow.document).open(),e.write(bp("document.F=Object")),e.close(),e.F},bm=function(){try{bl=new ActiveXObject("htmlfile")}catch(e){}bm="undefined"!=typeof document?document.domain&&bl?bg(bl):by():bg(bl);for(var e=gC.length;e--;)delete bm[bf][gC[e]];return bm()};pz[bh]=!0;var b_=Object.create||function(e,t){var r;return null!==e?(bv[bf]=pt(e),r=new bv,bv[bf]=null,r[bh]=e):r=bm(),void 0===t?r:bs.f(r,t)},bb=v0.f,bk=vQ("unscopables"),bw=Array.prototype;null==bw[bk]&&bb(bw,bk,{configurable:!0,value:b_(null)});var bS,bT,bx,bI=function(e){bw[bk][e]=!0},bC=!vg(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),bP=pF("IE_PROTO"),bE=Object,bO=bE.prototype,bL=bC?bE.getPrototypeOf:function(e){var t=vI(e);if(vP(t,bP))return t[bP];var r=t.constructor;return vB(r)&&t instanceof r?r.prototype:t instanceof bE?bO:null},bR=vQ("iterator"),bA=!1;[].keys&&("next"in(bx=[].keys())?(bT=bL(bL(bx)))!==Object.prototype&&(bS=bT):bA=!0),(!v4(bS)||vg(function(){var e={};return bS[bR].call(e)!==e}))&&(bS={}),vB(bS[bR])||p2(bS,bR,function(){return this});var bD={IteratorPrototype:bS,BUGGY_SAFARI_ITERATORS:bA},bM=bD.IteratorPrototype,bB=function(){return this},bj=function(e,t,r,n){var i=t+" Iterator";return e.prototype=b_(bM,{next:pj(+!n,r)}),gY(e,i,!1),mR[i]=bB,e},bN=pE.PROPER,bU=pE.CONFIGURABLE,bF=bD.IteratorPrototype,bz=bD.BUGGY_SAFARI_ITERATORS,bK=vQ("iterator"),bV="keys",bq="values",bH="entries",bG=function(){return this},bW=function(e,t,r,n,i,a,o){bj(r,t,n);var u,s,c,l=function(e){if(e===i&&p)return p;if(!bz&&e in h)return h[e];switch(e){case bV:case bq:case bH:return function(){return new r(this,e)}}return function(){return new r(this)}},f=t+" Iterator",d=!1,h=e.prototype,v=h[bK]||h["@@iterator"]||i&&h[i],p=!bz&&v||l(i),g="Array"==t&&h.entries||v;if(g&&(u=bL(g.call(new e)))!==Object.prototype&&u.next&&(bL(u)!==bF&&(gH?gH(u,bF):vB(u[bK])||p2(u,bK,bG)),gY(u,f,!0)),bN&&i==bq&&v&&v.name!==bq&&(bU?pN(h,"name",bq):(d=!0,p=function(){return pn(v,this)})),i){if(s={values:l(bq),keys:a?p:l(bV),entries:l(bH)},o)for(c in s)!bz&&!d&&c in h||p2(h,c,s[c]);else gF({target:t,proto:!0,forced:bz||d},s)}return h[bK]!==p&&p2(h,bK,p,{name:i}),mR[t]=p,s},bY=function(e,t){return{value:e,done:t}},bX=v0.f,bQ="Array Iterator",b$=pW.set,bJ=pW.getterFor(bQ),bZ=bW(Array,"Array",function(e,t){b$(this,{type:bQ,target:gc(e),index:0,kind:t})},function(){var e=bJ(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,bY(void 0,!0)):bY("keys"==r?n:"values"==r?t[n]:[n,t[n]],!1)},"values"),b0=mR.Arguments=mR.Array;if(bI("keys"),bI("values"),bI("entries"),v1&&"values"!==b0.name)try{bX(b0,"name",{value:"values"})}catch(e){}var b1={exports:{}},b2={},b4=gf.f,b3="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],b6=function(e){try{return b4(e)}catch(e){return __(b3)}};b2.f=function(e){return b3&&"Window"==p6(e)?b6(e):b4(gc(e))};var b8=vg(function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}),b5=Object.isExtensible,b9=vg(function(){b5(1)})||b8?function(e){return!!v4(e)&&(!b8||"ArrayBuffer"!=p6(e))&&(!b5||b5(e))}:b5,b7=!vg(function(){return Object.isExtensible(Object.preventExtensions({}))}),ke=v0.f,kt=!1,kr=vR("meta"),kn=0,ki=function(e){ke(e,kr,{value:{objectID:"O"+kn++,weakData:{}}})},ka=b1.exports={enable:function(){ka.enable=function(){},kt=!0;var e=gf.f,t=vk([].splice),r={};r[kr]=1,e(r).length&&(gf.f=function(r){for(var n=e(r),i=0,a=n.length;i1?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!s(this,e)}}),kc(a,r?{get:function(e){var t=s(this,e);return t&&t.value},set:function(e,t){return u(this,0===e?0:e,t)}}:{add:function(e){return u(this,e=0===e?0:e,e)}}),v1&&ks(a,"size",{get:function(){return o(this).size}}),i},setStrong:function(e,t,r){var n=t+" Iterator",i=kd(t),a=kd(n);bW(e,t,function(e,t){kf(this,{type:n,target:e,state:i(e),kind:t,last:void 0})},function(){for(var e=a(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?bY("keys"==t?r.key:"values"==t?r.value:[r.key,r.value],!1):(e.target=void 0,bY(void 0,!0))},r?"entries":"values",!r,!0),gQ(t)}});var kh=vk("".charAt),kv=vk("".charCodeAt),kp=vk("".slice),kg=function(e){return function(t,r){var n,i,a=_g(vT(t)),o=gp(r),u=a.length;return o<0||o>=u?e?"":void 0:(n=kv(a,o))<55296||n>56319||o+1===u||(i=kv(a,o+1))<56320||i>57343?e?kh(a,o):n:e?kp(a,o,o+2):i-56320+(n-55296<<10)+65536}},ky={codeAt:kg(!1),charAt:kg(!0)},km=ky.charAt,k_="String Iterator",kb=pW.set,kk=pW.getterFor(k_);bW(String,"String",function(e){kb(this,{type:k_,string:_g(e),index:0})},function(){var e,t=kk(this),r=t.string,n=t.index;return n>=r.length?bY(void 0,!0):(e=km(r,n),t.index+=e.length,bY(e,!1))});gF({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=pt(this),r=pl(t.delete),n=!0,i=0,a=arguments.length;i1?arguments[1]:void 0);return!mV(r,function(e,r,i){if(!n(r,e,t))return i()},{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}});gF({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(e){var t=pt(this),r=kw(t),n=yd(e,arguments.length>1?arguments[1]:void 0),i=new(ya(t,vj("Map"))),a=pl(i.set);return mV(r,function(e,r){n(r,e,t)&&pn(a,i,e,r)},{AS_ENTRIES:!0,IS_ITERATOR:!0}),i}});gF({target:"Map",proto:!0,real:!0,forced:!0},{find:function(e){var t=pt(this),r=kw(t),n=yd(e,arguments.length>1?arguments[1]:void 0);return mV(r,function(e,r,i){if(n(r,e,t))return i(r)},{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}});gF({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(e){var t=pt(this),r=kw(t),n=yd(e,arguments.length>1?arguments[1]:void 0);return mV(r,function(e,r,i){if(n(r,e,t))return i(e)},{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}});gF({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(e){return mV(kw(pt(this)),function(t,r,n){var i,a;if((i=r)===(a=e)||i!=i&&a!=a)return n()},{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}});gF({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(e){return mV(kw(pt(this)),function(t,r,n){if(r===e)return n(t)},{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}});gF({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(e){var t=pt(this),r=kw(t),n=yd(e,arguments.length>1?arguments[1]:void 0),i=new(ya(t,vj("Map"))),a=pl(i.set);return mV(r,function(e,r){pn(a,i,n(r,e,t),r)},{AS_ENTRIES:!0,IS_ITERATOR:!0}),i}});gF({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(e){var t=pt(this),r=kw(t),n=yd(e,arguments.length>1?arguments[1]:void 0),i=new(ya(t,vj("Map"))),a=pl(i.set);return mV(r,function(e,r){pn(a,i,e,n(r,e,t))},{AS_ENTRIES:!0,IS_ITERATOR:!0}),i}});gF({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(e){for(var t=pt(this),r=pl(t.set),n=arguments.length,i=0;i1?arguments[1]:void 0);return mV(r,function(e,r,i){if(n(r,e,t))return i()},{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}});var kT=TypeError;gF({target:"Map",proto:!0,real:!0,forced:!0},{update:function(e,t){var r=pt(this),n=pl(r.get),i=pl(r.has),a=pl(r.set),o=arguments.length;pl(t);var u=pn(i,r,e);if(!u&&o<3)throw kT("Updating absent value");var s=u?pn(n,r,e):pl(o>2?arguments[2]:void 0)(e,r);return pn(a,r,e,t(s,e,r)),r}});var kx=vQ("iterator"),kI=vQ("toStringTag"),kC=bZ.values,kP=function(e,t){if(e){if(e[kx]!==kC)try{pN(e,kx,kC)}catch(t){e[kx]=kC}if(e[kI]||pN(e,kI,t),_Y[t]){for(var r in bZ)if(e[r]!==bZ[r])try{pN(e,r,bZ[r])}catch(t){e[r]=bZ[r]}}}};for(var kE in _Y)kP(h6[kE]&&h6[kE].prototype,kE);kP(_$,"DOMTokenList");tu({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var kO=J.Number.isNaN,kL=v(kO),kR=vQ("match"),kA=function(e){var t;return v4(e)&&(void 0!==(t=e[kR])?!!t:"RegExp"==p6(e))},kD=function(){var e=pt(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},kM=RegExp.prototype,kB=h6.RegExp,kj=vg(function(){var e=kB("a","y");return e.lastIndex=2,null!=e.exec("abcd")}),kN=kj||vg(function(){return!kB("a","y").sticky}),kU={BROKEN_CARET:kj||vg(function(){var e=kB("^r","gy");return e.lastIndex=2,null!=e.exec("str")}),MISSED_STICKY:kN,UNSUPPORTED_Y:kj},kF=h6.RegExp,kz=vg(function(){var e=kF(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)}),kK=h6.RegExp,kV=vg(function(){var e=kK("(?b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$c")}),kq=pW.get,kH=vp("native-string-replace",String.prototype.replace),kG=RegExp.prototype.exec,kW=kG,kY=vk("".charAt),kX=vk("".indexOf),kQ=vk("".replace),k$=vk("".slice),kJ=(i=/b*/g,pn(kG,n=/a/,"a"),pn(kG,i,"a"),0!==n.lastIndex||0!==i.lastIndex),kZ=kU.BROKEN_CARET,k0=void 0!==/()??/.exec("")[1];(kJ||k0||kZ||kz||kV)&&(kW=function(e){var t,r,n,i,a,o,u,s=kq(this),c=_g(e),l=s.raw;if(l)return l.lastIndex=this.lastIndex,t=pn(kW,l,c),this.lastIndex=l.lastIndex,t;var f=s.groups,d=kZ&&this.sticky,h=pn(kD,this),v=this.source,p=0,g=c;if(d&&(-1===kX(h=kQ(h,"y",""),"g")&&(h+="g"),g=k$(c,this.lastIndex),this.lastIndex>0&&(!this.multiline||this.multiline&&"\n"!==kY(c,this.lastIndex-1))&&(v="(?: "+v+")",g=" "+g,p++),r=RegExp("^(?:"+v+")",h)),k0&&(r=RegExp("^"+v+"$(?!\\s)",h)),kJ&&(n=this.lastIndex),i=pn(kG,d?r:this,g),d?i?(i.input=k$(i.input,p),i[0]=k$(i[0],p),i.index=this.lastIndex,this.lastIndex+=i[0].length):this.lastIndex=0:kJ&&i&&(this.lastIndex=this.global?i.index+i[0].length:n),k0&&i&&i.length>1&&pn(kH,i[0],r,function(){for(a=1;au;)r=i[u++],(!D||(a?r in n:wr(n,r)))&&wn(s,e?[r,n[r]]:n[r]);return s}},wo={entries:wa(!0),values:wa(!1)}.values;tu({target:"Object",stat:!0},{values:function(e){return wo(e)}});var wu=J.Object.values,ws=v(wu),wc=gS.includes;gF({target:"Array",proto:!0,forced:vg(function(){return![,].includes()})},{includes:function(e){return wc(this,e,arguments.length>1?arguments[1]:void 0)}}),bI("includes");var wl=vk([].join),wf=gs!=Object,wd=_T("join",",");gF({target:"Array",proto:!0,forced:wf||!wd},{join:function(e){return wl(gc(this),void 0===e?",":e)}});var wh=_i("slice"),wv=vQ("species"),wp=Array,wg=Math.max;gF({target:"Array",proto:!0,forced:!wh},{slice:function(e,t){var r,n,i,a=gc(this),o=gk(a),u=gm(e,o),s=gm(void 0===t?o:t,o);if(m6(a)&&((yt(r=a.constructor)&&(r===wp||m6(r.prototype))||v4(r)&&null===(r=r[wv]))&&(r=void 0),r===wp||void 0===r))return yv(a,u,s);for(n=new(void 0===r?wp:r)(wg(s-u,0)),i=0;uo;)r=i[o++],v1&&!wy(n,r)||wm(u,e?[r,n[r]]:n[r]);return u}},wb={entries:w_(!0),values:w_(!1)}.values;gF({target:"Object",stat:!0},{values:function(e){return wb(e)}});var wk=TypeError,ww=vQ("match"),wS=function(e){if(kA(e))throw wk("The method doesn't accept regular expressions");return e},wT=vk("".indexOf);gF({target:"String",proto:!0,forced:!function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[ww]=!1,"/./"[e](t)}catch(e){}}return!1}("includes")},{includes:function(e){return!!~wT(_g(vT(this)),_g(wS(e)),arguments.length>1?arguments[1]:void 0)}});var wx=function(e,t){var r=e.exec;if(vB(r)){var n=pn(r,e,t);return null!==n&&pt(n),n}if("RegExp"===p6(e))return pn(k1,e,t);throw wt("RegExp#exec called on incompatible receiver")},wI=kU.UNSUPPORTED_Y,wC=Math.min,wP=[].push,wE=vk(/./.exec),wO=vk(wP),wL=vk("".slice),wR=!vg(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]});function wA(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function wD(e,t){for(var r=0;r1||"".split(/.?/).length?function(e,r){var n=_g(vT(this)),i=void 0===r?4294967295:r>>>0;if(0===i)return[];if(void 0===e)return[n];if(!kA(e))return pn(t,n,e,i);for(var a,o,u,s=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,f=RegExp(e.source,c+"g");(a=pn(k1,f,n))&&!((o=f.lastIndex)>l&&(wO(s,wL(n,l,a.index)),a.length>1&&a.index=i));)f.lastIndex===a.index&&f.lastIndex++;return l===n.length?!u&&wE(f,"")||wO(s,""):wO(s,wL(n,l)),s.length>i?__(s,0,i):s}:"0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:pn(t,this,e,r)}:t,[function(t,r){var i=vT(this),a=vw(t)?void 0:pf(t,e);return a?pn(a,t,i,r):pn(n,_g(i),t,r)},function(e,i){var a=pt(this),o=_g(e),u=r(n,a,o,i,n!==t);if(u.done)return u.value;var s=ya(a,RegExp),c=a.unicode,l=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(wI?"g":"y"),f=new s(wI?"^(?:"+a.source+")":a,l),d=void 0===i?4294967295:i>>>0;if(0===d)return[];if(0===o.length)return null===wx(f,o)?[o]:[];for(var h=0,v=0,p=[];v=0;t--){var r=localStorage.key(t);0===lf(r).call(r,e)&&localStorage.removeItem(r)}}catch(e){}},getItem:function(e){try{return localStorage.getItem(e)}catch(e){return null}},key:function(e){try{return localStorage.key(e)}catch(e){return null}},setItem:function(e,t){try{localStorage.setItem(e,t)}catch(e){}},removeItem:function(e){try{localStorage.removeItem(e)}catch(e){}},isSupport:wB},wU=function(){function e(){wA(this,e);var t,r,n=new cS(function(e,n){t=e,r=n});return n.resolve=t,n.reject=r,n}return wM(e,[{key:"resolve",value:function(e){}},{key:"reject",value:function(e){}}]),e}(),wF=pE.EXISTS,wz=v0.f,wK=Function.prototype,wV=vk(wK.toString),wq=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,wH=vk(wq.exec);v1&&!wF&&wz(wK,"name",{configurable:!0,get:function(){try{return wH(wq,wV(this))[1]}catch(e){return""}}});var wG=function(){function e(){wA(this,e)}return wM(e,null,[{key:"parse",value:function(t){var r=e.parseXmlString(t);return null!==r?e.parseDOMChildren(r):null}},{key:"parseXmlString",value:function(e){if(void 0===e)return null;var t,r=new window.DOMParser;try{(t=r.parseFromString(e,"text/xml")).getElementsByTagNameNS("*","parsererror").length>0&&(t=null)}catch(e){t=null}return t}},{key:"parseDOMChildren",value:function(t,r){if(t.nodeType===Node.DOCUMENT_NODE){for(var n={},i=t.childNodes,a=0;ae.db.version;if(n&&(e.version,e.version=e.db.version),i||r){if(r){var a=e.db.version+1;a>e.version&&(e.version=a)}return!0}return!1}function w3(e,t,r,n){void 0===n&&(n=1);try{var i=e.db.transaction(e.storeName,t);r(null,i)}catch(i){if(n>0&&(!e.db||"InvalidStateError"===i.name||"NotFoundError"===i.name))return cS.resolve().then(function(){if(!e.db||"NotFoundError"===i.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),w0(e,!0)}).then(function(){return(function(e){wZ(e);for(var t=wQ[e.name],r=t.forages,n=0;n0){var i=he(t).call(t,0,r);n=he(t).call(t,r);for(var a=0;a0&&(this._maxCache=e)}},{key:"getMemoryInfo",value:function(){return{memory:this._memory,cnt:this._cnt}}}]),St=["vid","loadType","size","speed","cacheKey","vtype","duration","bitrate"],Sr=0,Sn=hq(function e(t){var r=this;hK(this,e),this._preload_bandwith_map=new fy,this._usepreload_info=new fy,this._pcdn_info_map=new fy,this._updateRealTimeSpeed=function(e){Sr=e.speed,r.emit("real_time_speed",e)},this._manager=t},[{key:"setPreloadBandwidth",value:function(e,t){this._preload_bandwith_map.set(e,t)}},{key:"getPreloadBandwidth",value:function(e){return this._preload_bandwith_map.get(e)}},{key:"_updateLoadInfo",value:function(e,t,r){var n=this._pcdn_info_map.get(e);n||(n={}),n[t]||(n[t]={},n[t].loadLen=0),n[t].loadLen=n[t].loadLen+r,this._pcdn_info_map.set(e,n)}},{key:"getLoadInfoAndDelete",value:function(e){var t=this._pcdn_info_map.get(e);return this._pcdn_info_map.delete(e),t}},{key:"getPreloadUnuseInfo",value:function(){var e,t={},r=hH(this._preload_bandwith_map);try{for(r.s();!(e=r.n()).done;){var n,i,a=(n=e.value,i=2,function(e){if(cp(e))return e}(n)||function(e,t){var r=null==e?null:void 0!==hI&&hC(e)||e["@@iterator"];if(null!=r){var n,i,a,o,u=[],s=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=a.call(r)).done)&&(u.push(n.value),u.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return u}}(n,2)||h4(n,i)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=a[0],u=a[1];if(this._usepreload_info.get(o))this._preload_bandwith_map.delete(o);else{var s=o.split("#"),c=s.length>0?s[0]:o;t[c]?(t[c].bw+=u.bw||0,t[c].pbw+=u.pbw||0):t[c]={vid:c,bw:u.bw||0,pbw:u.pbw||0,bitrate:u.bitrate||0,duration:u.duration||0}}}}catch(e){r.e(e)}finally{r.f()}return ws(t)}},{key:"bwEventEmit",value:function(e){var t=e.vid,r=e.loadType,n=e.size,i=e.speed,a=e.cacheKey,o=e.vtype,u=e.duration,s=e.bitrate,c=hJ(e,St),l=this.getPreloadBandwidth(a)||{bw:0,pbw:0,vid:t,duration:u,bitrate:s};r&&r!==_5.CDN?(l.pbw=l.pbw+n,this.emit("prf_data_size",h$({vid:t,task_type:2,pcdn_size:n,pcdn_speed:i,vtype:o,bitrate:s,duration:u},c))):(l.bw=l.bw+n,this.emit("prf_data_size",h$({vid:t,task_type:2,cdn_size:n,cdn_speed:i,vtype:o,duration:u,bitrate:s},c))),this.setPreloadBandwidth(a,l),this._updateRealTimeSpeed({speed:i,type:r||_5.CDN}),this._updateLoadInfo(a,r,n)}},{key:"setUsePreloadInfo",value:function(e,t){this._usepreload_info.set(e,t)}},{key:"realTimeSpeed",get:function(){return Sr}},{key:"emit",value:function(e,t){var r;null===(r=this._manager)||void 0===r||r.emit(e,t)}},{key:"destroy",value:function(){this._preload_bandwith_map=new fy,this._usepreload_info=new fy,this._pcdn_info_map=new fy,this._manager=null}}]);function Si(e,t){var r=[0,0];if(e)for(var n=0,i=e.length;n-1&&ly(a).call(a,v,1),t.next=37;break;case 34:t.prev=34,t.t0=t.catch(26),e.log("error","preload data error!",t.t0);case 37:return t.prev=37,null===(p=e._currentPreloadInst)||void 0===p||p.setData(null),e._currentPreloadInst=null,e._config.autoPreload&&e.emit(hx.PRELOAD_NEXT),t.finish(37);case 42:return t.abrupt("return",!0);case 43:case"end":return t.stop()}},t,null,[[26,34,37,42]])})),e._stats=new Sn(e),e}return hY(o,m3),hq(o,[{key:"VTYPES",get:function(){return _8}},{key:"player",get:function(){return this._player}},{key:"stepwise",get:function(){return this._stepwise}},{key:"realTimeSpeed",get:function(){return this._stats.realTimeSpeed}},{key:"currentPreloadInst",get:function(){return this._currentPreloadInst}},{key:"cacheInst",get:function(){return this._cacheInst}},{key:"preloadDataList",get:function(){return this._preloadDataList}},{key:"log",value:function(e){for(var t,r,n=arguments.length,i=Array(n>1?n-1:0),a=1;a0){var e=this.findPreloadItem(this._preloadDataList),t=null==e?void 0:e.data;if(this._wipPreloadTask=e,e&&null!=t&&t.payload){if(!this._getPreloaderKey(t))return this.log("warn","need to set vtype"),this.stopCheckTask(),!1;var r=this._config.checkIfCanPreload;return r&&"function"==typeof r?r(t):this._config.autoCheckPreload?this._autoCheckPreload(t,e):(this.stopCheckTask(),!1)}}return!1}},{key:"_autoCheckPreload",value:function(e,t){return this._player?function(e,t,r){if(!e)return!1;var n=Si(e.buffered,e.currentTime),i=t.startPreloadControl,a=t.startPreloadMinBuffer,o=t.startPreloadMinPosTime,u=t.minBufferLength;if(i){var s=Math.max(n[1]-e.currentTime,0);if("number"==typeof a&&s>a){if("number"==typeof o&&e.currentTime>o||e.currentTime>e.duration/2)return null==r||r("log","[checkIfStartPreload] hit buffer",s,"startPreloadMinBuffer",a),!0}else if(e.currentTime+a+1>e.duration&&e.currentTime+s>e.duration-1)return null==r||r("log","[checkIfStartPreload] hit end"),!0}else{var c="number"==typeof u&&e.duration>u+5?u:e.duration/2,l=Math.min(e.currentTime+u,e.duration),f=n[1]-l;if(e.currentTime>c&&f>-1)return null==r||r("log","[checkIfStartPreload] hit minPos",c,"minCacheTime",l),!0}return!1}(this._player,this._config,this.log):(this.log("warn","need set video"),!1)}},{key:"_getPreloaderKey",value:function(e){return e.vtype?e.vtype.toUpperCase():""}},{key:"_sort",value:function(e){fU(e).call(e,function(e,t){return void 0===e.order&&void 0===t.order||"number"==typeof e.order&&"number"==typeof t.order&&e.order-1?r[n].vid=t:r.push({vid:t,playerId:e})}},{key:"selectBeforeStart",value:function(e){var t=e.targetDefinition,r=e.defaultDefinition;if(t)return h$({},t);var n=this.getUserSelectDefinition(),i=this.selectBitrate(null==e?void 0:e.payload,r,n),a=(null==i?void 0:i.vtype)||e.vtype,o=h$(h$({},i),{},{vtype:a});return e.targetDefinition=o,this.log("log","selectBeforeStart",null==e?void 0:e.vid,a,null==i?void 0:i.definition,null==e?void 0:e.payload,i),o}},{key:"selectBitrate",value:function(e,t,r){if(e.length<1)return null;var n,i,a,o=null;if(this._selector)o=this._selector.getSuitableBitrate(e,r),this.log("log","BitRateAdapter result",null===(n=o)||void 0===n?void 0:n.vtype,null===(i=o)||void 0===i?void 0:i.definition,null===(a=o)||void 0===a?void 0:a.bitrate);else{for(var u=-1,s=-1,c=0;c=0?u:s>=0?s:0]}return h$({},o)}},{key:"startCheckTask",value:function(){var e=this,t=this._preloadDataList,r=this._currentPreloadInst,n=this._config.autoCheck;(this._taskIntervalId&&(clearTimeout(this._taskIntervalId),this._taskIntervalId=0),null!=r&&r.taskInProgress&&function(e,t,r){var n=t.endPreloadControl,i=t.endPreloadMinBuffer,a=t.startPreloadMinBuffer;if(!e)return!1;if(n){if("number"==typeof a&&e.currentTime+a>=e.duration)return!1;var o,u=Math.max(Si(e.buffered,e.currentTime)[1]-e.currentTime,0);if(u<=i)return null==r||r("log","[checkIfCancelPreload] hit buffer:",u,"endPreloadMinBuffer:",i,"video:",s8(o="".concat(e.currentTime,"/")).call(o,e.duration)),!0}return!1}(this._player,this._config,this.log))?this.cancelPreloadingTask():0!==t.length&&(this._checkIfCanPreload()&&this.onPreloadNext(),this._taskIntervalId=d9(function(){e.startCheckTask()},n.interval))}},{key:"cancelPreloadingTask",value:function(){var e,t=this._preloadDataList,r=this._wipPreloadTask,n=this._config.endPreloadTaskStrategy;this.cancel(),r&&(this.stepwise?"number"==typeof(null===(e=r.data)||void 0===e?void 0:e.stepIdx)&&r.data.stepIdx>-1&&r.data.stepIdx--:0!==n&&t.unshift(r),this._emitEvtByCancel(r.data),this._wipPreloadTask=void 0)}},{key:"stopCheckTask",value:function(){this._taskIntervalId&&(clearTimeout(this._taskIntervalId),this._taskIntervalId=-1)}},{key:"getPreloadMetaByVid",value:function(e,t){for(var r=this.getAllCachedDataKeys(),n=[],i="",a=0;a-1){var a=ly(r).call(r,n,1);this.log("log","cancelPreloadByVid remove from list",a.length>0&&a[0].data.vid)}var o=this._currentPreloadInst,u=o?o.getData():null;this.log("log","_currentPreloadInst",u),u&&u.vid===e&&this.cancel(),t&&this._addPlayingVid(t,e)}},{key:"removePlayingId",value:function(e){var t=this._playingVids,r=Sa(t,"playerId",e);if(r>-1){var n=ly(t).call(t,r,1);this.log("log","removePlayingId",n.length>0&&n[0].playerId)}}},{key:"addPreload",value:(i=hF(hZ().mark(function e(t){return hZ().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._addData(t);case 2:if(e.sent){e.next=5;break}return e.abrupt("return");case 5:this._sort(this._preloadDataList),this._checkAutoTask();case 7:case"end":return e.stop()}},e,this)})),function(e){return i.apply(this,arguments)})},{key:"_addData",value:(n=hF(hZ().mark(function e(t){var r,n,i,a,o,u,s,c,l,f=this;return hZ().wrap(function(e){for(var d,h;;)switch(e.prev=e.next){case 0:if(t.data.vtype){e.next=3;break}return this.log("warn","vtype is null, can\xb7t select loader"),e.abrupt("return",!1);case 3:if(r=t.data,n=this._getLoader(r.vtype)){e.next=8;break}return this.log("warn","the loader for ".concat(r.vtype," not registered")),e.abrupt("return",!1);case 8:if(!((a=Sa(i=this._playingVids,"vid",t.data.vid))>=0)){e.next=14;break}return o=i[a],this.log("log",s8(d="vid:".concat(o.vid," is already instantiated and loaded, playerId is ")).call(d,o.playerId)),e.abrupt("return");case 14:return u=this._getUniqueKey(t),e.next=17,this.getItem(t.data,!0);case 17:if(!(s=e.sent)||!n.isUniqueCache(s)){e.next=22;break}return this.log("log","".concat(u," already exist in cache")),e.abrupt("return",!1);case 22:if(!this._currentPreloadInst||!(c=this._currentPreloadInst.getData())||this._getUniqueKey({data:c,order:0})!==u){e.next=29;break}return this.log("log","currentKey repeat"),e.abrupt("return");case 29:if(l=cC(h=this._preloadDataList).call(h,function(e){return f._getUniqueKey(e)===u}),this.log("log","addedItems",u,l),0!==l.length){e.next=35;break}return this._stepwise&&void 0===t.data.steps&&(t.data.steps=[0]),this._preloadDataList.push(t),e.abrupt("return",!0);case 35:return this.log("log","".concat(u," already exist in preloadList")),e.abrupt("return",!1);case 37:case"end":return e.stop()}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"_getUniqueKey",value:function(e){return e.data.vtype?o.generateUniqueCacheKey(e.data):e.data.vid}},{key:"_checkAutoTask",value:function(){var e=this,t=this._config,r=t.autoCheck,n=t.autoPreload;cS.resolve().then(function(){n&&e.emit(hx.PRELOAD_NEXT),null!=r&&r.enable&&!e._taskIntervalId&&e.startCheckTask()})}},{key:"setItem",value:function(e,t,r,n){var i=o.generateUniqueCacheKey(e);if(!r){var a=this._getLoader(e.vtype);if(!a)return this.log("warn","no ".concat(e.vtype," preloader, register")),cS.resolve(!1);t=hG({},a.generateUniqueKey(e),t)}return this._cacheInst.setItem(i,t,n)}},{key:"getItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=o.generateUniqueCacheKey(e),i=this._getLoader(e.vtype);if(!i)return this.log("warn","no ".concat(e.vtype," preloader, register")),cS.resolve(!1);var a=t?"":i.generateUniqueKey(e);return this._cacheInst.getItem(n,r,a)}},{key:"getItemSync",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=o.generateUniqueCacheKey(e),i=this._getLoader(e.vtype);if(!i)return this.log("warn","no ".concat(e.vtype," preloader, register")),!1;var a=t?"":i.generateUniqueKey(e);return this._cacheInst.getItemSync(n,r,a)}},{key:"supportSync",value:function(){return this._cacheInst.supportSync()}},{key:"removeItem",value:function(e,t){var r=o.generateUniqueCacheKey(e);return this._cacheInst.removeItem(r,t)}},{key:"getPreLoadData",value:(r=hF(hZ().mark(function e(t){var r,n,i;return hZ().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.vtype,!(n=this._getLoaderInst(r))){e.next=7;break}return e.next=5,n.getPreLoadData(t);case 5:return i=e.sent,e.abrupt("return",i);case 7:return e.abrupt("return",null);case 8:case"end":return e.stop()}},e,this)})),function(e){return r.apply(this,arguments)})},{key:"getPreLoadDataSync",value:function(e){var t=e.vtype,r=this._getLoaderInst(t);return r?r.getPreLoadDataSync(e):null}},{key:"removeAll",value:function(){var e=this,t=this.getAllCachedDataKeys();cb(t).call(t,function(t){var r=e.getPreloadMetaByVid(t.split("#")[0]);r&&e.removeItem(r,null)})}},{key:"removeAllPreloadTask",value:function(){this.cancel(),this._preloadDataList=[],this._playingVids=[]}},{key:"disable",value:function(){this._isOpen=!1,this.stopCheckTask()}},{key:"enable",value:function(){this._isOpen=!0,this._config.autoCheck.enable&&!this._taskIntervalId&&this._preloadDataList.length>0&&this.startCheckTask()}},{key:"setUserSelectDefinition",value:function(e){this._userDefinition=e}},{key:"getUserSelectDefinition",value:function(){return this._userDefinition||null}},{key:"getStartDefinition",value:function(){return this._startDefinition}},{key:"setStartDefinition",value:function(e){this._startDefinition=e}},{key:"destroy",value:(t=hF(hZ().mark(function e(){var t,r,n,i;return hZ().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this._stats.destroy(),t=cw(this._loaderInsts),r=0;case 3:if(!(r-1;r--){var n,i=this._preloadDataList[r];if(i.data.vid===e&&i.playerId===t){ly(n=this._preloadDataList).call(n,r,1);break}}}},{key:"getAllCachedDataKeys",value:function(){var e;return(null===(e=this._cacheInst)||void 0===e?void 0:e.getAllCachedDataKeys())||[]}},{key:"getDataUniqueKey",value:function(e){var t=this._getLoader(e.vtype);return!!t&&t.generateUniqueKey(e)}},{key:"hasItemSameVid",value:function(e){var t=this._getLoader(e.vtype),r=this._getLoaderInst(e.vtype);if(t&&r){var n=t.generateUniqueKey(e);return r.hasItemSameVid(n)}return!1}},{key:"_getLoader",value:function(e){return e=e||"",this._loaders[e]||this._loaders[e.toLocaleLowerCase()]||(this.log("warn","no ".concat(e," preloader, register")),null)}},{key:"_getLoaderInst",value:function(e){return e=e||"",this._loaderInsts[e]||this._loaderInsts[e.toLocaleLowerCase()]||(this.log("warn","no ".concat(e," preloader, register")),null)}},{key:"getPreloadMemoryInfo",value:function(){return this._cacheInst.getMemoryInfo()}},{key:"attachPlayer",value:function(e){this._player=e}},{key:"detachPlayer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;e&&this._player!==e||(this._player=null)}},{key:"setPreloadBandwidth",value:function(e,t){this._stats.setPreloadBandwidth(e,t)}},{key:"getPreloadBandwidth",value:function(e){return this._stats.getPreloadBandwidth(e)}},{key:"getLoadInfoAndDelete",value:function(e){return this._stats.getLoadInfoAndDelete(e)}},{key:"getPreloadUnuseInfo",value:function(){return this._stats.getPreloadUnuseInfo()}},{key:"setUsePreloadInfo",value:function(e,t){this._stats.setUsePreloadInfo(e,t)}},{key:"bwEventEmit",value:function(e){var t=e.vid,r=e.loadType,n=e.size,i=e.speed,a=e.cacheKey,o=e.vtype,u=e.duration,s=e.bitrate,c=hJ(e,So);this._stats.bwEventEmit(h$({vid:t,loadType:r,size:n,speed:i,cacheKey:a,vtype:o,duration:u,bitrate:s},c))}},{key:"findPreloadItem",value:function(e){var t,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._stepwise){var n=cD(e).call(e,function(e,t){return void 0===t.data.stepIdx||"number"==typeof t.data.stepIdx&&"number"==typeof e.data.stepIdx&&t.data.stepIdx1&&this._sort(i),t=i[0],!r){if("number"!=typeof t.data.stepIdx&&(t.data.stepIdx=-1),t.data.stepIdx++,cp(t.data.steps)&&t.data.stepIdx>=t.data.steps.length-1){var a=lf(e).call(e,t);ly(e).call(e,a,1)}t.data.stepIdx===1/0&&(t=void 0)}}else t=r?e[0]:e.shift();return t}},{key:"updateConfig",value:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]?this._config=sC({},o.getDefaultConfig(),e):sC(this._config,e);var t=this._config.autoCheck;t&&!t.enable&&this.stopCheckTask(),t&&t.enable&&this.startCheckTask()}},{key:"preProcessUrl",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=this._config,n=r.preProcessUrl,i=r.preProcessUrlOptions;return"function"==typeof n?n(e,sC({},i,t)):{url:e}}}],[{key:"getDefaultConfig",value:function(){return{autoPreload:!1,autoCheck:{enable:!1,interval:1e3},preloadMaxCacheCount:5,preloadCacheType:hT.MEMORY,autoCheckPreload:!0,startPreloadControl:!1,startPreloadMinBuffer:5,startPreloadMinPosTime:5,minBufferLength:5,endPreloadControl:!1,endPreloadTaskStrategy:0}}},{key:"generateUniqueCacheKey",value:function(e){var t,r,n=e.vid,i=e.codecType,a=e.vtype;return s8(t=s8(r="".concat(n,"#")).call(r,i,"#")).call(t,a.toUpperCase())}},{key:"parseKey",value:function(e){if(!e)throw Error("key ".concat(e," is empty"));var t=e.split("#");if(t.length<6)throw Error("key ".concat(e," is not right format"));return{vid:t[0],mediaType:t[1],codecType:t[2],vtype:t[3],definition:t[4],bitrate:cX("".concat(t[5]||0),10)||0}}},{key:"debugger",set:function(e){Su=!!e}}])}(),Sc=function(){var e,t,r,n;function i(e,t){var r;return hK(this,i),(r=hz(this,i))._data=null,r.preloadManager=e,r._config=t,r.promisePolyfill(),r}return hY(i,m3),hq(i,[{key:"taskInProgress",get:function(){return!1}},{key:"stepwise",get:function(){return this.preloadManager.stepwise}},{key:"getRequestOption",value:function(e){var t=this._config,r=t.getRequestOptionsCallback,n=t.reqOptions,i={};return e?i=e.reqOptions?e.reqOptions:"function"==typeof r?r(e):n||{}:i}},{key:"getUserSelectDefinition",value:function(){return this.preloadManager.getUserSelectDefinition()}},{key:"selectBitrate",value:function(e,t,r){return this.preloadManager.selectBitrate(e,t,r)}},{key:"promisePolyfill",value:function(){cS.prototype.finally||(cS.prototype.finally=({finally:function(e){var t=function(t){return cS.resolve(e()).then(t)};return this.then(function(e){return t(function(){return e})},function(e){return t(function(){return cS.reject(e)})})}}).finally)}},{key:"getData",value:function(){return this._data}},{key:"setData",value:function(e){this._data=e}},{key:"start",value:(n=hF(hZ().mark(function e(t,r){return hZ().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:throw Error("start need implement, return Promise");case 1:case"end":return e.stop()}},e)})),function(e,t){return n.apply(this,arguments)})},{key:"cancel",value:(r=hF(hZ().mark(function e(){return hZ().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:throw Error("cancel need implement, cancel current preload request");case 1:case"end":return e.stop()}},e)})),function(){return r.apply(this,arguments)})},{key:"getPreLoadData",value:(t=hF(hZ().mark(function e(t){return hZ().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:throw Error("getPreLoadData not implement");case 1:case"end":return e.stop()}},e)})),function(e){return t.apply(this,arguments)})},{key:"getPreLoadDataSync",value:function(e){return null}},{key:"hasItemSameVid",value:function(e){return!0}},{key:"destroy",value:(e=hF(hZ().mark(function e(){return hZ().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",cS.resolve());case 1:case"end":return e.stop()}},e)})),function(){return e.apply(this,arguments)})},{key:"parseKey",value:function(e){return Ss.parseKey(e[0])}}],[{key:"generateUniqueKey",value:function(e){throw Error("generateUniqueCacheKey need implement, return string")}},{key:"vtype",get:function(){throw Error("need vtype")}},{key:"isUniqueCache",value:function(e){return!0}}])}();function Sl(e){return(null==e?void 0:e.preLoadMeta)||{}}var Sf=((o=Sf||{})[o.NORMAL=0]="NORMAL",o[o.FEED=1]="FEED",o),Sd=new(function(){var e,t;function r(){sv(this,r),sf(this,"isRegistered",!1),sf(this,"initPromise",void 0),sf(this,"_inst",void 0),sf(this,"_tracker",void 0),sf(this,"pendingLoadList",[]),sf(this,"prevCount",1),sf(this,"nextCount",2),sf(this,"preloadScene",Sf.NORMAL)}return sg(r,[{key:"bitrateSelector",get:function(){var e;return null===(e=this._inst)||void 0===e?void 0:e._selector}},{key:"prepare",value:(t=uj(uM().mark(function e(t){var r;return uM().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isRegistered){e.next=1;break}return e.abrupt("return",!0);case 1:return this.initPromise||(this.initPromise=this._init(t)),e.next=2,null!==(r=this.initPromise)&&void 0!==r&&r;case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)})),function(e){return t.apply(this,arguments)})},{key:"register",value:function(e){if(!this.isRegistered){var t=sh(sh({},e),{},{preloadScene:(null==e?void 0:e.preloadScene)||Sf.NORMAL});this._register(this._adaptPreloadConfig(t)),this.isRegistered=!0,this.trackPreloadData()}}},{key:"inst",value:function(){return this._inst}},{key:"addPreloadList",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.isRegistered){if(null==r||!r.delayAdd)return this._addPreloadList(e);if(Sf.FEED!==this.preloadScene)return Sf.NORMAL===this.preloadScene?this._addPreloadList(e):void 0;this.pendingLoadList=s8(t=this.pendingLoadList).call(t,null!=e?e:[])}}},{key:"setPreloadList",value:function(e){if(this.isRegistered){if(Sf.FEED!==this.preloadScene)return Sf.NORMAL===this.preloadScene?this._addPreloadList(e):void 0;this.pendingLoadList=null!=e?e:[]}}},{key:"clearPreloadList",value:function(){this.pendingLoadList=[]}},{key:"attachPlayer",value:function(e){var t,r;e&&this.isRegistered&&(null===(t=this._inst)||void 0===t||null===(r=t.attachPlayer)||void 0===r||r.call(t,e))}},{key:"detachPlayer",value:function(e){var t,r;this.isRegistered&&(null===(t=this._inst)||void 0===t||null===(r=t.detachPlayer)||void 0===r||r.call(t,e))}},{key:"configure",value:function(e){return this.updateConfig(e)}},{key:"setPreloadScene",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.preloadScene,t=arguments.length>1?arguments[1]:void 0;return this.preloadScene!==e&&this.clearPreloadList(),this.updateConfig(sh({preloadScene:e},null!=t?t:{}))}},{key:"removeAll",value:function(){var e,t;return null===(e=this._inst)||void 0===e||null===(t=e.removeAll)||void 0===t?void 0:t.call(e)}},{key:"removeAllPreloadTask",value:function(){var e,t;return this.pendingLoadList=[],null===(e=this._inst)||void 0===e||null===(t=e.removeAllPreloadTask)||void 0===t?void 0:t.call(e)}},{key:"bindTracker",value:function(e){this._tracker=e}},{key:"checkPreloadData",value:function(e){var t;if(null!==(t=this.pendingLoadList)&&void 0!==t&&t.length&&e){var r=this._recPreloadList(e);null!=r&&r.length&&this._addPreloadList(r)}}},{key:"checkPreloadDataExist",value:function(e){var t,r=Sl(fK(e));return!!(null===(t=this._inst)||void 0===t?void 0:t.hasItemSameVid(r))}},{key:"addPlayingId",value:function(e,t){var r;null===(r=this._inst)||void 0===r||r.addPlayingId(e,t)}},{key:"removePlayingId",value:function(e){var t;null===(t=this._inst)||void 0===t||t.removePlayingId(e)}},{key:"getDataUniqueKey",value:function(e){var t;return null===(t=this._inst)||void 0===t?void 0:t.getDataUniqueKey(e)}},{key:"getPreloadMetaByVid",value:function(e,t){var r;return null===(r=this._inst)||void 0===r?void 0:r.getPreloadMetaByVid(e,t)}},{key:"getPreloadDataInfo",value:function(e){var t,r,n=fK(e),i=Sl(n),a=!1,o="DASH"===n.vtype;o&&(i={vid:fq(e),vtype:n.vtype,codecType:n.codecType},a=!0);var u=null===(t=this._inst)||void 0===t?void 0:t.getItemSync(i,a),s=[];if(u&&(null===(r=u)||void 0===r||null===(r=r.buffer)||void 0===r?void 0:r.byteLength)>0)s.push({type:"mixed",start:0,data:u.buffer,dur:u.duration||0});else if(o){var c,l={audioDuration:0,byteLength:0,preloadTime:0};cb(c=cw(u)).call(c,function(e){var t=u[e],r=t.isInitSegment;l.byteLength+=t.res.byteLength,"video"===t.mediaType?l.preloadTime+=t.duration||0:l.audioDuration+=t.duration||0,s.push({type:"mixed",start:0,data:t.res,dur:r?0:t.duration||5,cacheKey:e,range:t.range})}),u=l}return{preloadData:u,preloadDataList:s}}},{key:"getCachedBitrate",value:function(e){var t,r,n=e.config,i=(n.shared||n).definition,a=(null==i?void 0:i.list)||[],o=null==i?void 0:i.userSelectDefinition,u=null==i?void 0:i.focusUserDefinition,s=n.vid||(null===(t=n.baseConfig)||void 0===t||null===(t=t.mediaInfo)||void 0===t?void 0:t.vid)||(null===(r=n.baseConfig)||void 0===r||null===(r=r.mediaInfo)||void 0===r?void 0:r.id)||"",c=null;if(a.length>0){var l=this.getPreloadMetaByVid(s);if(l){var f=this.getDataUniqueKey(l),d=function(e,t){for(var r,n=e.vtype,i=e.codecType,a=e.definition,o=e.bitrate,u=null,s=0;r=t[s];s++){var c=r.vtype===n;if(c&&(c=r.codecType===i),c&&(c=r.definition===a||r.definition===Number(a)),c&&(c=!r.bitrate||!o||Number(r.bitrate)===Number(o)),c){u=r;break}}return u}(l,a);d&&(d.cacheKey=f,(c=d).type=fH.PRELOAD,c.preLoadMeta=l)}if(c&&o&&u){var h={m:1,ud:o,d:c.definition};o!==c.definition&&(c=null,h.m=1)}}return c}},{key:"_init",value:(e=uj(uM().mark(function e(t){var r,n,i;return uM().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t){e.next=2;break}return e.next=1,t();case 1:i=e.sent,e.next=3;break;case 2:i=t;case 3:if((n=i).PreloaderModule=n.PreloaderModule||Ss,null!=n&&n.PreloaderModule&&null!=n&&null!==(r=n.loaders)&&void 0!==r&&r.length){e.next=4;break}return e.abrupt("return",!1);case 4:return n.enableDebugger&&(n.PreloaderModule.debugger=n.enableDebugger),this.register(n),e.abrupt("return",!0);case 5:case"end":return e.stop()}},e,this)})),function(t){return e.apply(this,arguments)})},{key:"_addPreloadList",value:function(e){if(null!=e&&e.length){var t,r=null!=(t=e)&&t.length?c_(t).call(t,function(e){var t,r;if("data"in e)return e;return{order:1,data:{vid:e.vid,vtype:(null===(t=e.streamType)||void 0===t||null===(r=t.toUpperCase)||void 0===r?void 0:r.call(t))||"MP4",codecType:e.codec||"h264",payload:[{url:cp(e.url)?e.url:[{src:e.url}],bitrate:e.bitrate,definition:e.definition,duration:e.duration,size:e.size}],defaultDefinition:e.definition,bizType:0}}}):[];null!=r&&r.length&&this._addList(r)}}},{key:"trackPreloadData",value:function(){var e,t,r=this;null===(e=this._inst)||void 0===e||null===(t=e.on)||void 0===t||t.call(e,"prf_data_size",function(e){var t,n;null===(t=r._tracker)||void 0===t||null===(n=t.track)||void 0===n||n.call(t,"vestrategy_preload_prf_data_size",sh({},e))})}},{key:"_register",value:function(e){var t,n,i=this,a=e||{},o=a.playPlugins,u=a.loaders,s=a.preloader;if(Ss&&null!=u&&u.length){e.enableDebugger&&(Ss.debugger=e.enableDebugger);var c=s||(void 0!==fF?fF:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).playerPreloader;c?this._inst=c:(this._inst=new Ss,this._inst.register({config:sC({},r.defaultConfig,(null==e?void 0:e.config)||e),loaders:cC(u).call(u,function(e){return!!e}),BitrateSelector:e.BitrateSelector})),null!=o&&o.length&&cb(o).call(o,function(e){var t;null==e||null===(t=e.registerPreloader)||void 0===t||t.call(e,i._inst)}),null===(t=this._inst)||void 0===t||null===(n=t.enable)||void 0===n||n.call(t)}}},{key:"updateConfig",value:function(e){var t,r;e&&this.isRegistered&&(null===(t=this._inst)||void 0===t||null===(r=t.updateConfig)||void 0===r||r.call(t,this._adaptPreloadConfig(e)))}},{key:"_addList",value:function(e){var t,r;null!=e&&e.length&&this.isRegistered&&(null===(t=this._inst)||void 0===t||null===(r=t.addPreloadList)||void 0===r||r.call(t,e))}},{key:"_adaptPreloadConfig",value:function(e){var t,r,n;return this.nextCount=null!==(t=null==e?void 0:e.nextCount)&&void 0!==t?t:this.nextCount,this.prevCount=null!==(r=null==e?void 0:e.prevCount)&&void 0!==r?r:this.prevCount,void 0!==(null==e?void 0:e.preloadScene)&&cd(n=[Sf.FEED,Sf.NORMAL]).call(n,null==e?void 0:e.preloadScene)?(this.preloadScene=e.preloadScene,Sf.FEED===e.preloadScene?sh({autoPreload:!1,autoCheckPreload:!0},e):sh({autoPreload:!0,autoCheckPreload:!1},e)):sh({},e)}},{key:"_recPreloadList",value:function(e){var t,r=this.pendingLoadList;if(!e||null==r||!r.length)return[];var n=hw(r).call(r,function(t){var r;return t.vid===e||(null===(r=t.data)||void 0===r?void 0:r.vid)===e});if(-1===n)return[];var i=this.prevCount?he(r).call(r,n-this.prevCount<0?0:n-this.prevCount,n):[],a=this.nextCount?he(r).call(r,n+1,n+this.nextCount+1):[];return cC(t=s8(a).call(a,i)).call(t,function(e){return!!e})}}],[{key:"defaultConfig",get:function(){return{preloadCacheType:1,autoPreload:!0,autoCheckPreload:!1,autoCheck:{enable:!0,interval:1e3},preloadTime:5,preloadMaxCacheCount:15,startPreloadMinBuffer:5,startPreloadControl:!0,startPreloadMinPosTime:0,minBufferLength:15,segmentMinDuration:5,loadRangeType:"gop"}}}])}());function Sh(){return(Sh="undefined"!=typeof Reflect&&_4?i2(_4).call(_4):function(e,t,r){var n=function(e,t){for(;!({}).hasOwnProperty.call(e,t)&&null!==(e=s_(e)););return e}(e,t);if(n){var i=uJ(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}}).apply(null,arguments)}var Sv=new s7("VeStrategy-preload-plugin"),Sp=function(){function e(t){var r,n,i,a,o;return sv(this,e),sf((i=this,a=e,o=[t],a=s_(a),n=sy(i,sm()?rf(a,o||[],s_(i).constructor):a.apply(i,o))),"ctx",void 0),sf(n,"preloader",void 0),sf(n,"playerId",void 0),sf(n,"_onPlayerActiveChange",function(){n._initPreloader()}),sf(n,"_checkPreloadData",function(){var e,t,r,i;if(n.preloader&&n.player){var a=n.playerConfig,o=(null===(e=a.baseConfig)||void 0===e||null===(e=e.mediaInfo)||void 0===e?void 0:e.id)||(null===(t=a.shared)||void 0===t?void 0:t.vid);null===(r=(i=n.preloader).checkPreloadData)||void 0===r||r.call(i,o)}}),n.ctx=n.config.ctx,n.preloader=n.config.preloader,Sv.update(null===(r=n.ctx)||void 0===r||null===(r=r.dataCenter)||void 0===r||null===(r=r.getAppConfig())||void 0===r?void 0:r.log),Sv.info("PreloadPluginInitCompleted"),function(e,t){var r,n=null;try{n=(null===(r=e.getProperty)||void 0===r?void 0:r.call(e,t))||e[t]}catch(e){}return n}(n.player,"preloader")||fV(n.player,"preloader",Sd),n._bindEvents(),n}return sk(e,sP),sg(e,[{key:"beforePlayerInit",value:function(){(t=e,r="beforePlayerInit",n=this,i=3,a=Sh(s_(1&3?t.prototype:t),r,n),2&i&&"function"==typeof a?function(e){return a.apply(n,e)}:a)([]);var t,r,n,i,a,o=this.preloader,u=fq(this.player);this.playerId=this.player.playerId,this._initPreloader(),u&&this.playerId&&(null==o||o.addPlayingId(u,this.playerId));var s=this._getCachedBitrate();s&&fz(this.player,s);var c=fK(this.player);if(null!=o&&o.checkPreloadDataExist(this.player)||u&&null!=o&&o.getPreloadMetaByVid(u)&&"DASH"===c.vtype){var l=o.getPreloadDataInfo(this.player),f=l.preloadData,d=l.preloadDataList;if(cp(d)&&d.length>0){this.setBaseConfig({preloadDataInfo:{preloadDataList:d}});var h=f.byteLength||0,v=f.preloadTime||(null==d?void 0:cD(d).call(d,function(e,t){return e+(t.dur||0)},0))||0;fV(this.player,"preloadData",{byteLength:h,duration:v,audioDuration:f.audioDuration||0})}}else if(this.config.needPreloadCheck)return void this.player.emit("degrade",{category:fG.PRELOAD_NOT_HIT,errc:-1,err_msg:"preload data not exist"})}},{key:"beforeDestroy",value:function(){var e;this.playerId&&(null===(e=this.preloader)||void 0===e||e.removePlayingId(this.playerId)),this.preloader=void 0,this.playerId=void 0,this._unbindEvents()}},{key:"_bindEvents",value:function(){this.player&&this.player.on("user_active_change",this._onPlayerActiveChange)}},{key:"_unbindEvents",value:function(){this.player&&this.player.off("user_active_change",this._onPlayerActiveChange)}},{key:"_initPreloader",value:function(){var e,t,r=this.player,n=this.preloader;r.isUserActive?null==n||null===(e=n.attachPlayer)||void 0===e||e.call(n,r):null==n||null===(t=n.detachPlayer)||void 0===t||t.call(n,r),this._checkPreloadData()}},{key:"_getCachedBitrate",value:function(){var e,t=this.playerConfig,r=this.preloader,n=(t.shared||t).definition,i=(null==n?void 0:n.list)||[],a=t||n||{},o=a.userSelectDefinition,u=a.focusUserDefinition;if(null==r||!r.isRegistered)return e;if(cp(i)&&i.length>0&&(r&&(e=r.getCachedBitrate(this.player)),e&&o&&u)){var s={m:1,ud:o,d:e.definition};o!==e.definition&&(e=void 0,s.m=1)}return e}}],[{key:"pluginName",get:function(){return"AutoPreloadPlugin"}},{key:"defaultConfig",get:function(){return{}}}])}(),Sg=((u=Sg||{}).MP4="MP4",u.MP4_MSE_SOFT="MP4_MSE_SOFT",u.MP4_MSE="MP4_MSE",u.MP4_0="MP4_0",u.MP4_1="MP4_1",u.MP4_2="MP4_2",u.DASH="DASH",u.HLS="HLS",u),Sy=((s=Sy||{})[s.AVC=0]="AVC",s[s.HEVC=1]="HEVC",s[s.VVC=2]="VVC",s.H264="h264",s.H265="h265",s.H266="h266",s),Sm={CDN:"cdn",PCDN:"pcdn"};function S_(e,t){var r=cw(e);if(hR){var n=hR(e);t&&(n=cC(n).call(n,function(t){return hA(e,t).enumerable})),r.push.apply(r,n)}return r}function Sb(e){for(var t=1;t=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),k(r),f}},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;k(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function Sw(e){return(Sw="function"==typeof hI&&"symbol"==typeof hj?function(e){return typeof e}:function(e){return e&&"function"==typeof hI&&e.constructor===hI&&e!==hI.prototype?"symbol":typeof e})(e)}function SS(e,t,r,n,i,a,o){try{var u=e[a](o),s=u.value}catch(e){return void r(e)}u.done?t(s):cS.resolve(s).then(n,i)}function ST(e){return function(){var t=this,r=arguments;return new cS(function(n,i){var a=e.apply(t,r);function o(e){SS(a,n,i,o,u,"next",e)}function u(e){SS(a,n,i,o,u,"throw",e)}o(void 0)})}}function Sx(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function SI(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=Array(t);r1?r-1:0),i=1;ir)){for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(n===r?a[u]=function(e){if("object"!==Sw(e))return e;var t,r=he(t=Object.prototype.toString.call(e)).call(t,8,-1);switch(r){case"Array":case"Uint8Array":case"ArrayBuffer":return r+"["+e.length+"]";case"Object":return"{}";default:return r}}(t[u]):"object"===Sw(t[u])?a[u]=e(t[u],r,n+1):a[u]=t[u]);return a}}(e)});t=this._prefix+SV()+s$(a)}catch(e){return}if(e>=this.logCacheLevel&&(this.logSize+=t.length,this.logTextArray.push(t)),this.logSize>this.logMaxSize){var o=this.logTextArray.shift();this.logSize-=o.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||(t=console).table.apply(t,arguments)}},{key:"setLogLevel",value:function(e){this.logCacheLevel=e}}],[{key:"enable",value:function(){e.disabled=!1}},{key:"disable",value:function(){e.disabled=!0}}]),e}();function SV(){return(new Date).toLocaleString()}SP(SK,"disabled",!0);var Sq={FETCH:"fetch",XHR:"xhr"},SH={ARRAY_BUFFER:"arraybuffer",TEXT:"text",JSON:"json"},SG=function(){SE(t,SD(Error));var e=SB(t);function t(r,n,i,a){var o;return Sx(this,t),SP(SM(o=e.call(this,a)),"retryCount",0),SP(SM(o),"isTimeout",!1),SP(SM(o),"loaderType",Sq.FETCH),SP(SM(o),"startTime",0),SP(SM(o),"endTime",0),SP(SM(o),"options",{}),o.url=r,o.request=n,o.response=i,o}return SC(t)}(),SW=Object.prototype.toString;function SY(e){if("[object Object]"!==SW.call(e))return!1;var t=hO(e);return null===t||t===Object.prototype}function SX(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 SQ(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function S$(e,t){var r,n;if(e){if(!t)return e;var i,a=cC(r=c_(n=cw(t)).call(n,function(e){if(null!=(i=t[e]))return cp(i)?e+="[]":i=[i],c_(i).call(i,function(t){var r,n,i;return(n=t,"[object Date]"===SW.call(n))?t=t.toISOString():null!==(i=t)&&"object"===Sw(i)&&(t=s$(t)),s8(r="".concat(SQ(e),"=")).call(r,SQ(t))}).join("&")})).call(r,Boolean).join("&");if(a){var o=lf(e).call(e,"#");-1!==o&&(e=he(e).call(e,0,o)),e+=(-1===lf(e).call(e,"?")?"?":"&")+a}return e}}function SJ(e,t,r,n,i,a,o,u,s,c,l){return i=null!=i?c7(i):null,kL(n=cX(n||"0",10))&&(n=0),{data:e,done:t,options:{range:s,vid:c,index:u,contentLength:n,age:i,startTime:a,firstByteTime:o,endTime:s1(),priOptions:l},response:r}}function SZ(e,t){return Math.round(8*e*1e3/t/1024)}var S0={REAL_TIME_SPEED:"real_time_speed"},S1=function(){SE(r,m3);var e,t=SB(r);function r(){var e;return Sx(this,r),SP(SM(e=t.call(this)),"_abortController",null),SP(SM(e),"_timeoutTimer",null),SP(SM(e),"_reader",null),SP(SM(e),"_response",null),SP(SM(e),"_aborted",!1),SP(SM(e),"_index",-1),SP(SM(e),"_range",null),SP(SM(e),"_receivedLength",0),SP(SM(e),"_running",!1),SP(SM(e),"_logger",null),SP(SM(e),"_vid",""),SP(SM(e),"_onProcessMinLen",0),SP(SM(e),"_onCancel",null),SP(SM(e),"_priOptions",null),SP(SM(e),"_processMaxGapTime",1/0),e}return SC(r,[{key:"load",value:function(e){var t,r=this,n=e.url,i=e.vid,a=e.timeout,o=e.responseType,u=e.onProgress,s=e.index,c=e.onTimeout,l=e.onCancel,f=e.range,d=e.transformResponse,h=e.request,v=e.params,p=e.logger,g=e.method,y=e.headers,m=e.body,_=e.mode,b=e.credentials,k=e.cache,w=e.redirect,S=e.referrer,T=e.referrerPolicy,x=e.onProcessMinLen,I=e.processMaxGapTime,C=e.priOptions;this._logger=p,this._aborted=!1,this._onProcessMinLen=x,this._onCancel=l,this._abortController="undefined"!=typeof AbortController&&new AbortController,this._running=!0,this._receivedLength=0,this._index=s,this._range=f||[0,0],this._vid=i||n,this._priOptions=C||{},this._processMaxGapTime=I;var P={method:g,headers:y,body:m,mode:_,credentials:b,cache:k,redirect:w,referrer:S,referrerPolicy:T,signal:null===(t=this._abortController)||void 0===t?void 0:t.signal},E=!1;clearTimeout(this._timeoutTimer),n=S$(n,v);var O=SX(f);O&&(y=h?h.headers:P.headers=P.headers||(Headers?new Headers:{}),Headers&&y instanceof Headers?y.append("Range",O):y.Range=O),a&&(this._timeoutTimer=d9(ST(Sk().mark(function e(){var t;return Sk().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return E=!0,e.next=3,r.cancel();case 3:c&&((t=new SG(n,P,null,"timeout")).isTimeout=!0,c(t,{index:r._index,range:r._range,vid:r._vid,priOptions:r._priOptions}));case 4:case"end":return e.stop()}},e)})),a));var L=s1();return this._logger.debug("[fetch load start], index,",s,",range,",f),new cS(function(e,t){var i;fetch(h||n,h?void 0:P).then((i=ST(Sk().mark(function i(a){var c,l,h,v;return Sk().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(clearTimeout(r._timeoutTimer),r._response=a,!r._aborted&&r._running){i.next=4;break}return i.abrupt("return");case 4:if(d&&(a=d(a,n)||a),a.ok){i.next=7;break}throw new SG(n,P,a,"bad network response");case 7:if(c=s1(),o!==SH.TEXT){i.next=15;break}return i.next=11,a.text();case 11:case 18:l=i.sent,r._running=!1,i.next=37;break;case 15:if(o!==SH.JSON){i.next=22;break}return i.next=18,a.json();case 22:if(!u){i.next=29;break}return r.resolve=e,r.reject=t,r._loadChunk(a,u,L,c),i.abrupt("return");case 29:return i.next=31,a.arrayBuffer();case 31:l=new Uint8Array(l=i.sent),r._running=!1,h=s1()-L,v=SZ(l.byteLength,h),r.emit(S0.REAL_TIME_SPEED,{speed:v,len:l.byteLength,time:h,vid:r._vid,index:r._index,range:r._range,priOptions:r._priOptions});case 37:r._logger.debug("[fetch load end], index,",s,",range,",f),e(SJ(l,!0,a,a.headers.get("Content-Length"),a.headers.get("age"),L,c,s,f,r._vid,r._priOptions));case 39:case"end":return i.stop()}},i)})),function(e){return i.apply(this,arguments)})).catch(function(e){var i;clearTimeout(r._timeoutTimer),r._running=!1,r._aborted&&!E||((e=e instanceof SG?e:new SG(n,P,null,null===(i=e)||void 0===i?void 0:i.message)).startTime=L,e.endTime=s1(),e.isTimeout=E,e.options={index:r._index,range:r._range,vid:r._vid,priOptions:r._priOptions},t(e))})})}},{key:"cancel",value:(e=ST(Sk().mark(function e(){return Sk().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(e){}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 e.apply(this,arguments)})},{key:"_loadChunk",value:function(e,t,r,n){var i=this;if(!e.body||!e.body.getReader){this._running=!1;var a=new SG(e.url,"",e,"onProgress of bad response.body.getReader");return a.options={index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions},void this.reject(a)}this._onProcessMinLen>0&&(this._cache=new Uint8Array(2097152),this._writeIdx=0);var o,u,s,c,l=this._reader=e.body.getReader(),f=s1(),d=(o=ST(Sk().mark(function a(){var o,h,v,p,g,y,m,_,b;return Sk().wrap(function(a){for(var k,w;;)switch(a.prev=a.next){case 0:return s=s1(),a.prev=1,a.next=4,l.read();case 4:u=a.sent,c=s1(),a.next=13;break;case 8:return a.prev=8,a.t0=a.catch(1),c=s1(),i._aborted||(i._running=!1,a.t0.options={index:i._index,range:i._range,vid:i._vid,priOptions:i._priOptions},i.reject(a.t0)),a.abrupt("return");case 13:if(v=(h=(null===(o=i._range)||void 0===o?void 0:o.length)>0?i._range[0]:0)+i._receivedLength,!i._aborted){a.next=19;break}return i._running=!1,t(void 0,!1,{range:[v,v],vid:i._vid,index:i._index,startTime:s,endTime:c,st:r,firstByteTime:n,priOptions:i._priOptions},e),a.abrupt("return");case 19:if(p=u.value?u.value.byteLength:0,i._receivedLength+=p,i._onProcessMinLen>0?i._writeIdx+p>=i._onProcessMinLen||u.done?((g=new Uint8Array(i._writeIdx+p)).set(i._cache.subarray(0,i._writeIdx),0),p>0&&g.set(u.value,i._writeIdx),i._writeIdx=0,i._logger.debug("【fetchLoader,onProgress enough】,done,",u.done,",len,",g.byteLength,", writeIdx,",i._writeIdx)):p>0&&i._writeIdx+p<2097152?(i._cache.set(u.value,i._writeIdx),i._writeIdx+=p,i._logger.debug("【fetchLoader,onProgress cache】,len,",p,", writeIdx,",i._writeIdx)):p>0&&(y=new Uint8Array(i._writeIdx+p+2048),i._logger.debug("【fetchLoader,onProgress extra start】,size,",i._writeIdx+p+2048,", datalen,",p,", writeIdx,",i._writeIdx),y.set(i._cache.subarray(0,i._writeIdx),0),p>0&&y.set(u.value,i._writeIdx),i._writeIdx+=p,delete i._cache,i._cache=y,i._logger.debug("【fetchLoader,onProgress extra end】,len,",p,", writeIdx,",i._writeIdx)):g=u.value,!(g&&g.byteLength>0||u.done)){a.next=28;break}i._logger.debug("【fetchLoader,onProgress call】,task,",i._range,", start,",v,", end,",h+i._receivedLength,", done,",u.done,r),t(g,u.done,{range:[i._range[0]+i._receivedLength-(g?g.byteLength:0),i._range[0]+i._receivedLength],vid:i._vid,index:i._index,startTime:s,endTime:c,st:r,firstByteTime:n,priOptions:i._priOptions},e),f=s1(),a.next=37;break;case 28:if(!(s1()-f>=i._processMaxGapTime)){a.next=37;break}return i._logger.debug(s8(k=s8(w="[onProgress timeout],task: ".concat(s$(i._range)," done: ")).call(w,u.done," processMaxGapTime: ")).call(k,i._processMaxGapTime)),(m=new SG(e.url,null,e,"process timeout")).options={index:i._index,range:i._range,vid:i._vid,priOptions:i._priOptions},i.running=!1,a.next=35,i.cancel();case 35:return i.reject(m),a.abrupt("return");case 37:u.done?(_=s1()-r,b=SZ(i._receivedLength,_),i.emit(S0.REAL_TIME_SPEED,{speed:b,len:i._receivedLength,time:_,vid:i._vid,index:i._index,range:i._range,priOptions:i._priOptions}),i._running=!1,i._logger.debug("[fetchLoader onProgress end],task,",i._range,",done,",u.done),i.resolve(SJ(u,!0,e,e.headers.get("Content-Length"),e.headers.get("age"),r,n,i._index,i._range,i._vid,i._priOptions))):d();case 38:case"end":return a.stop()}},a,null,[[1,8]])})),function(){return o.apply(this,arguments)});d()}},{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}}]),r}(),S2=function(){SE(t,m3);var e=SB(t);function t(){var r;return Sx(this,t),SP(SM(r=e.call(this)),"_xhr",null),SP(SM(r),"_aborted",!1),SP(SM(r),"_timeoutTimer",null),SP(SM(r),"_range",null),SP(SM(r),"_receivedLength",0),SP(SM(r),"_url",null),SP(SM(r),"_onProgress",null),SP(SM(r),"_index",-1),SP(SM(r),"_headers",null),SP(SM(r),"_currentChunkSizeKB",384),SP(SM(r),"_timeout",null),SP(SM(r),"_xhr",null),SP(SM(r),"_withCredentials",null),SP(SM(r),"_startTime",-1),SP(SM(r),"_loadCompleteResolve",null),SP(SM(r),"_loadCompleteReject",null),SP(SM(r),"_runing",!1),SP(SM(r),"_logger",!1),SP(SM(r),"_vid",""),SP(SM(r),"_responseType",void 0),SP(SM(r),"_credentials",void 0),SP(SM(r),"_method",void 0),SP(SM(r),"_transformResponse",void 0),SP(SM(r),"_firstRtt",void 0),SP(SM(r),"_onCancel",null),SP(SM(r),"_priOptions",null),r}return SC(t,[{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=S$(e.url,e.params);var r=s1();return new cS(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 SG?e:new SG(t._url,t._request)).startTime=r,e.endTime=s1(),e.options={index:t._index,vid:t._vid,priOptions:t._priOptions},e})}},{key:"_startLoad",value:function(){var e=null;if(this._responseType===SH.ARRAY_BUFFER&&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],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=s1();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=hE(n=this._onLoad).call(n,this),r.onreadystatechange=hE(i=this._onReadyStatechange).call(i,this),r.onerror=function(e){t._running=!1;var r,n,i,a=new SG(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 SG(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,i,a,o=this._headers||{},u=SX(e);u&&(o.Range=u),o&&cb(a=cw(o)).call(a,function(e){r.setRequestHeader(e,o[e])}),this._logger.debug("[xhr.send->] tast,",this._range,",load sub range, ",e),r.send(this._body)}catch(t){t.options={index:this._index,range:e,vid:this._vid,priOptions:this._priOptions},this._loadCompleteReject(t)}}},{key:"_onReadyStatechange",value:function(e){2===e.target.readyState&&this._firstRtt<0&&(this._firstRtt=s1())}},{key:"_onLoad",value:function(e){var t,r=e.target.status;if(r<200||r>299){var n=new SG(this._url,null,Sb(Sb({},e.target.response),{},{status:r}),"bad response,status:"+r);return n.options={index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions},this._loadCompleteReject(n)}var i,a=null,o=!1,u=(null===(t=this._range)||void 0===t?void 0:t.length)>0?this._range[0]:0;if(this._responseType===SH.ARRAY_BUFFER){var s,c=new Uint8Array(e.target.response);if(i=u+this._receivedLength,c&&c.byteLength>0){this._receivedLength+=c.byteLength;var l=s1()-this._startTime,f=SZ(this._receivedLength,l);this.emit(S0.REAL_TIME_SPEED,{speed:f,len:this._receivedLength,time:l,vid:this._vid,index:this._index,range:[i,u+this._receivedLength],priOptions:this._priOptions})}a=c,o=!((null===(s=this._range)||void 0===s?void 0:s.length)>1&&this._range[1]&&this._receivedLength], tast :",this._range,", start",i,"end ",u+this._receivedLength,",dataLen,",c?c.byteLength:0,",receivedLength",this._receivedLength,",index,",this._index,", done,",o)}else o=!0,a=e.target.response;var d={ok:r>=200&&r<300,status:r,statusText:this._xhr.statusText,url:this._xhr.responseURL,headers:this._getHeaders(this._xhr),body:this._xhr.response};this._transformResponse&&(d=this._transformResponse(d,this._url)||d),this._onProgress&&this._onProgress(a,o,{index:this._index,vid:this._vid,range:[i,u+this._receivedLength],startTime:this._startTime,endTime:s1(),priOptions:this._priOptions},d),o?(this._runing=!1,this._loadCompleteResolve&&this._loadCompleteResolve(SJ(this._onProgress?null:a,o,d,d.headers["content-length"],d.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,Sj(SO(t.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={},i=function(e,t){var r=void 0!==hI&&hC(e)||e["@@iterator"];if(!r){if(cp(e)||(r=function(e,t){var r;if(e){if("string"==typeof e)return SN(e,void 0);var n=he(r=Object.prototype.toString.call(e)).call(r,8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?fw(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?SN(e,t):void 0}}(e))){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 TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}(c1(t=e.getAllResponseHeaders()).call(t).split("\r\n"));try{for(i.s();!(r=i.n()).done;){var a=r.value.split(": ");n[a[0].toLowerCase()]=he(a).call(a,1).join(": ")}}catch(e){i.e(e)}finally{i.f()}return n}}],[{key:"isSupported",value:function(){return"undefined"!=typeof XMLHttpRequest}}]),t}(),S4=["retry","retryDelay","onRetryError","transformError"],S3=function(){var e;function t(e,r){var n,i,a;Sx(this,t),this.promise=((a=new cS(function(e,t){n=e,i=t})).used=!1,a.resolve=function(){return a.used=!0,n.apply(void 0,arguments)},a.reject=function(){return a.used=!0,i.apply(void 0,arguments)},a),this.alive=!!r.onProgress,r.logger||(r.logger=new SK("Loader")),this._loaderType=e,this._loader=e===Sq.FETCH&&window.fetch?new S1:new S2,this._config=r,this._retryCount=0,this._retryTimer=null,this._canceled=!1,this._retryCheckFunc=r.retryCheckFunc,this._logger=r.logger}return SC(t,[{key:"exec",value:function(){var e,t=this,r=this._config,n=r.retry,i=r.retryDelay,a=r.onRetryError,o=r.transformError,u=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=cw(e);for(n=0;n=0||(i[r]=e[r]);return i}(e,t);if(hR){var a=hR(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(r,S4),s=(e=ST(Sk().mark(function e(){var r,c,l;return Sk().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t._loader.load(u);case 3:r=e.sent,t.promise.resolve(r),e.next=27;break;case 7:if(e.prev=7,e.t0=e.catch(0),t._loader.running=!1,t._logger.debug("[task request catch err]",e.t0),!t._canceled){e.next=13;break}return e.abrupt("return");case 13:if(e.t0.loaderType=t._loaderType,e.t0.retryCount=t._retryCount,c=e.t0,o&&(c=o(c)||c),a&&t._retryCount>0&&a(c,t._retryCount,{index:u.index,vid:u.vid,range:u.range,priOptions:u.priOptions}),t._retryCount++,l=!0,t._retryCheckFunc&&(l=t._retryCheckFunc(e.t0)),!(l&&t._retryCount<=n)){e.next=26;break}return clearTimeout(t._retryTimer),t._logger.debug("[task request setTimeout],retry",t._retryCount,",retry range,",u.range),t._retryTimer=d9(s,i),e.abrupt("return");case 26:t.promise.reject(c);case 27:case"end":return e.stop()}},e,null,[[0,7]])})),function(){return e.apply(this,arguments)});return s(),this.promise}},{key:"cancel",value:(e=ST(Sk().mark(function e(){return Sk().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 e.apply(this,arguments)})},{key:"running",get:function(){return this._loader&&this._loader.running}},{key:"loader",get:function(){return this._loader}}]),t}();function S6(){for(var e=arguments.length,t=Array(e),r=0;r0)break;r++}catch(e){if(!(r<10))throw Error("new array failed final,".concat(null==e?void 0:e.message));r++}return t}(cD(t).call(t,function(e,t){return e+t.byteLength},0)),i=0;return cb(t).call(t,function(e){n.set(e,i),i+=e.byteLength}),n}var S8=function(){SE(r,m3);var e,t=SB(r);function r(e){var n,i;return Sx(this,r),SP(SM(n=t.call(this,e)),"type",Sq.FETCH),SP(SM(n),"_queue",[]),SP(SM(n),"_alive",[]),SP(SM(n),"_currentTask",null),SP(SM(n),"_finnalUrl",""),SP(SM(n),"_config",void 0),n._config=(i=e,Sb({loaderType:Sq.FETCH,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:SH.TEXT,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,processMaxGapTime:1/0},i)),n._config.loaderType!==Sq.XHR&&S1.isSupported()||(n.type=Sq.XHR),n.log=e.logger,n}return SC(r,[{key:"isFetch",value:function(){return this.type===Sq.FETCH}},{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=sC({},this._config,r)).params&&(r.params=sC({},r.params)),r.headers&&SY(r.headers)&&(r.headers=sC({},r.headers)),r.body&&SY(r.body)&&(r.body=sC({},r.body)),r.transformRequest&&(r=r.transformRequest(r)||r),r.logger=this.log;var n=new S3(this.type,r);return n.loader.on(S0.REAL_TIME_SPEED,function(e){t.emit(S0.REAL_TIME_SPEED,e)}),this._queue.push(n),1!==this._queue.length||this._currentTask&&this._currentTask.running||this._processTask(),n.promise}},{key:"cancel",value:(e=ST(Sk().mark(function e(){var t;return Sk().wrap(function(e){for(var r,n,i;;)switch(e.prev=e.next){case 0:return t=s8(r=c_(n=this._queue).call(n,function(e){return e.cancel()})).call(r,c_(i=this._alive).call(i,function(e){return e.cancel()})),this._currentTask&&t.push(this._currentTask.cancel()),this._queue=[],this._alive=[],e.next=6,cS.all(t);case 6:return e.next=8,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new cS(function(t){return d9(t,e)})}();case 8:case"end":return e.stop()}},e,this)})),function(){return e.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,n;null!==(t=e._currentTask)&&void 0!==t&&t.alive&&(null===(r=e._alive)||void 0===r?void 0:r.length)>0&&(e._alive=cC(n=e._alive).call(n,function(t){return t&&t!==e._currentTask})),e._processTask()})}}}],[{key:"isFetchSupport",value:function(){return S1.isSupported()}}]),r}(),S5=[{range:[0,90],size:614400},{range:[90,120],size:819200},{range:[120,Number.MAX_VALUE],size:1024e3}];var S9=((c=S9||{}).H264="h264",c.H265="h265",c.H266="h266",c);function S7(){return{supportHevc:!1,preloadTime:5,preloadSize:0,segmentMinDuration:5,vtype:"MP4",preloadCacheType:1,preloadMaxCacheCount:5,globalKey:null,autoPreload:!1,reqOptions:null,getRequestOptionsCallback:null,minBufferLength:5,timeout:3e3,autoCheck:{enable:!0,interval:1e3},logCacheConfig:{logCacheLevel:2,logMaxSize:204800},pcdnConfig:{openPreloadPCDN:!1,enterMinBuffer:10,outMaxBuffer:5,pcdn_duration:2,pcdn_open:!0,openPCDN:!0,minDuration:25,trackerUrl:""},switchPCDNMaxCnt:2,retryCount:1,retryDelay:1e3,loaderType:"fetch"}}A.f;var Te=O("".slice),Tt=Math.min;tu({target:"String",proto:!0,forced:!cu("startsWith")},{startsWith:function(e){var t=rz(X(this));ca(e);var r=tq(Tt(arguments.length>1?arguments[1]:void 0,t.length)),n=rz(e);return Te(t,r,r+n.length)===n}});var Tr=rw("String","startsWith"),Tn=String.prototype,Ti=v(function(e){var t=e.startsWith;return"string"==typeof e||e===Tn||et(Tn,e)&&t===Tn.startsWith?Tr:t}),Ta="content-range";function To(e,t,r,n){var i=Sh(s_(1&n?e.prototype:e),t,r);return 2&n&&"function"==typeof i?function(e){return i.apply(r,e)}:i}var Tu=function(){var e,t,r,n;function i(e,t){sv(this,i),sf((r=this,n=i,a=[e,t],n=s_(n),s=sy(r,sm()?rf(n,a||[],s_(r).constructor):n.apply(r,a))),"options",void 0),sf(s,"playerId",void 0),sf(s,"logger",void 0),sf(s,"_nextPreloadCount",0),sf(s,"_netLoader",void 0),sf(s,"_pendingTask",{resolve:void 0,data:void 0});var r,n,a,o,u,s,c=S7();cb(o=cw(t)).call(o,function(e){c[e]=t[e]}),s.options=c,s.playerId=(null===(u=e.player)||void 0===u?void 0:u.playerId)||"default";var l=s.options.logCacheConfig,f=l.logCacheLevel,d=l.logMaxSize;return s.logger=new SK("[Mp4Preloader]",{logCacheLevel:f,logMaxSize:d}),s.log(SF.DEBUG,"[Preloader] new preloader, playerId",s.playerId),s}return sk(i,Sc),sg(i,[{key:"currentPreloadInst",get:function(){return this.preloadManager.currentPreloadInst}},{key:"allCachedKeys",get:function(){return this.preloadManager.getAllCachedDataKeys()}},{key:"cacheInst",get:function(){return this.preloadManager.cacheInst}},{key:"realTimeSpeed",get:function(){return 0}},{key:"taskInProgress",get:function(){return!!this._pendingTask.resolve&&!!this._pendingTask.data}},{key:"log",value:function(e,t){for(var r,n,i=arguments.length,a=Array(i>2?i-2:0),o=2;o3&&void 0!==arguments[3]?arguments[3]:Sg.MP4,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Sy.H264;if(r){var a=this.generateUniqueKey({vid:e,definition:r,vtype:n,codecType:i});return a&&this.hasItemSameVid(a)?a:null}for(var o=0;o0&&(m.buffer=w.data,m.byteLength+=m.buffer.byteLength,this._setPreLoadData(t,m)),e.next=5;break;case 4:e.prev=4,e.catch(2);case 5:this._endLoadFragments(!1);case 6:case"end":return e.stop()}},e,this,[[2,4]])})),function(e,t){return r.apply(this,arguments)})},{key:"setItem",value:function(e,t){return this.preloadManager.setItem(e,t,!1)}},{key:"clearPreloaderList",value:function(){}},{key:"setUserSelectDefinition",value:function(e){this.preloadManager&&this.preloadManager.setUserSelectDefinition(e)}},{key:"getUserSelectDefinition",value:function(){return this.preloadManager.getUserSelectDefinition()}},{key:"cancel",value:function(){return this.log(SF.LOG,"cancelLoading"),this._endLoadFragments(),cS.resolve()}},{key:"destroy",value:function(){return this.cancel(),cS.resolve()}},{key:"on",value:function(e,t){for(var r,n=arguments.length,a=Array(n>2?n-2:0),o=2;o2?n-2:0),o=2;o=4&&t.length>=4&&a[0]===t[0]){if(0===lf(o=a[2]).call(o,"pretime")&&0===lf(u=t[2]).call(u,"pretime"))return!0;var o,u,s=[cX(a[2]),cX(a[3])],c=[cX(t[2]),cX(t[3])];if(c[0]>=s[0]&&c[1]>c[0]&&c[1]<=s[1])return!0}}return!1}},{key:"getItemSameVid",value:(t=uj(uM().mark(function e(t){var r,n,a,o;return uM().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a=(n=i.generateUniqueKey(t))&&this.hasItemSameVid(n),this.log(SF.DEBUG,s8(r="getItemSameVid: key:".concat(n," checkResult:")).call(r,a)),a){e.next=1;break}return e.abrupt("return",{});case 1:return e.next=2,this.preloadManager.getItem(t);case 2:return o=e.sent,e.abrupt("return",{value:o,key:a});case 3:case"end":return e.stop()}},e,this)})),function(e){return t.apply(this,arguments)})},{key:"_beforeStart",value:function(e,t){var r,n,i,a,o,u,s,c,l=e.payload||[];if(0===l.length)return this.log(SF.LOG,"preload_is_null"),null;var f=e.vid,d=e.steps,h=e.stepIdx,v=e.targetDefinition,p=e.vtype||Sg.MP4,g=e.codecType||S9.H264,y="".concat(this.getUserSelectDefinition()||""),m=this.checkCacheKey(f,l,y,p,g);if(this.log(SF.LOG,s8(r="".concat(this.playerId," ")).call(r,f),s8(n=s8(i="codecType:".concat(g," vtype:")).call(i,p," hasCache:")).call(n,m)),m&&!this.stepwise||"MP3"===p)return this.log(SF.LOG,"vtype_".concat(p)),null;var _=v||this.getInitDefinition(l,t);if(this.log(SF.LOG,s8(a=" ".concat(this.playerId," ")).call(a,f," getInitDefinition"),null==_?void 0:_.definition),!_)return this.log(SF.WARN,"definition_error"),null;var b=_.definition,k=_.orgDefinition,w=e.preloadTime||this.options.preloadTime,S=e.preloadSize||this.options.preloadSize||390624,T=this.generateUniqueKey({vid:f,definition:b,vtype:p,codecType:g});this._nextPreloadCount>0&&this._nextPreloadCount--,this.log(SF.LOG,s8(o="".concat(this.playerId," ")).call(o,f),s8(u=s8(s="cacheKey:".concat(T," duration:")).call(s,_.duration," preloadTime:")).call(u,w));var x=sh({vid:f,definition:b,orgDefinition:k,preloadTime:w,preloadSize:S,cacheKey:T,codecType:g,vtype:p,steps:d,stepIdx:h,payload:e},_);return e.reqOptions&&(x.reqOptions=e.reqOptions),this.log(SF.LOG,s8(c="start preload,".concat(f," playerId:")).call(c,this.playerId)),x}},{key:"_decideRequestRange",value:function(e){var t=e.pktOffsetMap,r=e.bitrate,n=e.size,i=e.duration,a=[0,8e5],o=this._getRangeByOffsetMap(t,5),u=0;if("number"==typeof o&&o>0)a[1]=o,u=5;else{var s=n||function(e,t){try{return e&&t?cX("".concat(t*e/8),10):0}catch(e){return 0}}(r,i),c=function(e,t,r){var n=r>51200?Math.min(r,8e5):t;if(!e)return n||S5[0].size;var i=la(S5).call(S5,function(t){return e>=t.range[0]&&e0?r:t)),n||S5[0].size}(i,8e5,s);a[1]=c,u=1}return{range:a,duration:u}}},{key:"_getRangeByOffsetMap",value:function(e,t){var r=this,n=null==e?void 0:la(e).call(e,function(e){var n;return(null==e?void 0:e.time)===((null===(n=r.options)||void 0===n?void 0:n.firstLoadTimePos)||t)});return null==n?void 0:n.offset}},{key:"_setPreLoadData",value:(e=uj(uM().mark(function e(t,r){var n,i,a,o,u,s,c,l,f,d,h,v,p;return uM().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=r.vid,i=r.definition,a=r.orgDefinition,o=r.type,u=r.buffer,s=r.byteLength,c=r.preloadTime,l=r.fileSize,f=r.from,d=r.vtype,h=r.codecType,v=r.bitrate,(p={codecType:h,vtype:d,vid:n,definition:i,orgDefinition:a,cacheKey:r.cacheKey,type:o,from:f,fileSize:l,bitrate:v,memory:0,byteLength:0,preloadSize:0,preloadTime:0,buffer:u}).byteLength=s||0,p.preloadSize=s||0,p.preloadTime=c||0,p.fileSize=l,p.buffer&&p.buffer.byteLength>0&&(p.memory+=(null==u?void 0:u.byteLength)||0,this.setItem(t,p));case 1:case"end":return e.stop()}},e,this)})),function(t,r){return e.apply(this,arguments)})},{key:"_getLoadUrl",value:function(e){var t=cp(e.url)?e.url[0].src:e.url;return this.preloadManager.preProcessUrl&&(t=this.preloadManager.preProcessUrl(t).url),t}},{key:"_endLoadFragments",value:function(e){var t,r;this.log(SF.LOG,"[Preloader] _endLoadFragments ".concat(this.playerId)),this._netLoader&&(this._netLoader.cancel(),this._netLoader=void 0),null!==(t=this._pendingTask)&&void 0!==t&&t.resolve&&(null===(r=this._pendingTask)||void 0===r||r.resolve(),this._pendingTask.resolve=void 0)}}],[{key:"vtype",get:function(){return Sg.MP4}},{key:"PRELOAD_TYPES",get:function(){return hS}},{key:"getDefaultConfig",value:function(){return S7()}},{key:"getInfoByUniqueKey",value:function(e){var t=e.split("#"),r=["vid","mediaType","codecType","vtype","definition"],n={};return cb(t).call(t,function(e,t){n[r[t]]=e}),n}},{key:"generateUniqueKey",value:function(e){var t,r,n,i,a,o=e.vid,u=e.mediaType,s=e.definition,c=e.codecType,l=e.vtype,f=e.bitrate;return u=u||"video",s="".concat(s)||"-1",c=c||Sy.H264,l=l||Sg.MP4,f=f||0,o?s8(t=s8(r=s8(n=s8(i=s8(a="".concat(o,"#")).call(a,u,"#")).call(i,c,"#")).call(n,l,"#")).call(r,s,"#")).call(t,f):null}}])}();function Ts(e,t){var r=void 0!==iX&&fY(e)||e["@@iterator"];if(!r){if(cv(e)||(r=f4(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 TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}var Tc=Math.min,Tl=[].lastIndexOf,Tf=!!Tl&&1/[1].lastIndexOf(1,-0)<0,Td=u2("lastIndexOf"),Th=Tf||!Td?function(e){if(Tf)return w(Tl,this,arguments)||0;var t=Q(this),r=tH(t);if(0===r)return -1;var n=r-1;for(arguments.length>1&&(n=Tc(n,tU(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in t&&t[n]===e)return n||0;return -1}:Tl;tu({target:"Array",proto:!0,forced:Th!==[].lastIndexOf},{lastIndexOf:Th});var Tv=rw("Array","lastIndexOf"),Tp=Array.prototype,Tg=v(function(e){var t=e.lastIndexOf;return e===Tp||et(Tp,e)&&t===Tp.lastIndexOf?Tv:t});function Ty(e){var t=0,r=0,n=0;return e=he(e).call(e,lf(e).call(e,"PT")+2),lf(e).call(e,"H")>-1&&lf(e).call(e,"M")>-1&&lf(e).call(e,"S")>-1?(t=c7(he(e).call(e,0,lf(e).call(e,"H"))),r=c7(he(e).call(e,lf(e).call(e,"H")+1,lf(e).call(e,"M"))),n=c7(he(e).call(e,lf(e).call(e,"M")+1,lf(e).call(e,"S")))):lf(e).call(e,"H")>-1&&lf(e).call(e,"M")>-1&&0>lf(e).call(e,"S")?(t=c7(he(e).call(e,0,lf(e).call(e,"H"))),r=c7(he(e).call(e,lf(e).call(e,"H")+1,lf(e).call(e,"M")))):0>lf(e).call(e,"H")&&lf(e).call(e,"M")>-1&&lf(e).call(e,"S")>-1?(r=c7(he(e).call(e,0,lf(e).call(e,"M"))),n=c7(he(e).call(e,lf(e).call(e,"M")+1,lf(e).call(e,"S")))):lf(e).call(e,"H")>-1&&0>lf(e).call(e,"M")&&lf(e).call(e,"S")>-1?(t=c7(he(e).call(e,0,lf(e).call(e,"H"))),n=c7(he(e).call(e,lf(e).call(e,"H")+1,lf(e).call(e,"S")))):0>lf(e).call(e,"H")&&0>lf(e).call(e,"M")&&lf(e).call(e,"S")>-1?n=c7(he(e).call(e,0,lf(e).call(e,"S"))):0>lf(e).call(e,"H")&&lf(e).call(e,"M")>-1&&0>lf(e).call(e,"S")&&(r=c7(he(e).call(e,0,lf(e).call(e,"M")))),3600*t+60*r+n}function Tm(e){var t,r,n,i,a,o,u,s,c,l,f,d,h=e.vid,v=e.start,p=e.end,g=e.mediaType,y=e.definition,m=e.codecType,_=e.vtype,b=e.bitrate,k=e.fileId,w=e.range;if(w&&w.length>0?(v=w[0],p=w[1]):(v=v||0,p=p||0),m="hevc"===m?"h265":m||"h264",_=_||Sg.DASH,!h||!g)return"";var S,T=y?s8(t=s8(r=s8(n=s8(i=s8(a=s8(o="".concat(h,"#")).call(o,g,"#")).call(a,m,"#")).call(i,_,"#")).call(n,y,"#")).call(r,v,"#")).call(t,p):s8(u=s8(s=s8(c=s8(l=s8(f=s8(d="".concat(h,"#")).call(d,g,"#")).call(f,m,"#")).call(l,_,"##")).call(c,v,"#")).call(s,p,"#")).call(u,b);return k?s8(S="".concat(T,"#")).call(S,k):T}function T_(e){var t,r={},n=Ts(cw(e));try{for(n.s();!(t=n.n()).done;){var i=t.value,a=e[i],o=i.split("#"),u=o[1],s=o[4],c=o[7],l="video"===u?s:c;r[l]||(r[l]={}),r[l][i]=a}}catch(e){n.e(e)}finally{n.f()}return r}function Tb(e){var t,r,n=ws(e);if(fU(n).call(n,function(e,t){return e.range[0]-t.range[0]}),0===n.length)return{};var i,a,o=0,u=0,s=new Uint8Array,c=Ts(n);try{for(c.s();!(a=c.n()).done;){var l=a.value,f=l.range[0],d=l.range[1];if(o>0){if(u+1!==f)break;s=S6(s,new Uint8Array(l.res))}else s=S6(s,new Uint8Array(l.res));o=f,u=d,i=l}}catch(e){c.e(e)}finally{c.f()}var h=(t=i.cacheKey.split("#"),r=9,function(e){if(cv(e))return e}(t)||function(e,t){var r=null==e?null:void 0!==iX&&fY(e)||e["@@iterator"];if(null!=r){var n,i,a,o,u=[],s=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=a.call(r)).done)&&(u1(u).call(u,n.value),u.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return u}}(t,9)||f4(t,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),v=h[0],p=h[1],g=h[2],y=h[3],m=h[4],_=h[5],b=h[6],k=h[7],w=h[8],S=n[0].range[0],T=Tm({vid:v,mediaType:p,codecType:g,vtype:y,definition:m,start:_,end:b,fileId:"video"===p?k:w,range:[S,u],bitrate:k});return T?(delete i.cacheKey,sf({},T,sh(sh({},i),{},{res:s.buffer,range:[S,u],memory:s.buffer.byteLength}))):null}var Tk=sg(function e(t,r,n,i,a,o){sv(this,e),sf(this,"type",void 0),sf(this,"codecs",void 0),sf(this,"visualEntryBox",void 0),sf(this,"configurationBox",void 0),sf(this,"types",void 0),sf(this,"logCodeType",void 0),this.type=t,this.codecs=r,this.visualEntryBox=n,this.configurationBox=i,this.types=a,this.logCodeType=o}),Tw={AVC:"avc",AV1:"av1",HEVC:"hevc",BYTEVC1:"bytevc1",BYTEVC2:"bytevc2",BVC2:"bvc2"},TS=sf(sf(sf(sf(sf(sf({},Tw.AVC,new Tk("avc","avc1.64001E","avc1","avcC",["h264"],"h264")),Tw.AV1,new Tk("av1","av01.0.08M.08","av01","av1C",["av1"],"av1")),Tw.HEVC,new Tk("hevc","hev1.1.6.L120.90","hvc1","hvcC",["h265"],"h265")),Tw.BYTEVC1,new Tk("hevc","hev1.1.6.L120.90","hvc1","hvcC",["bytevc1","h265"],"h265")),Tw.BVC2,new Tk("bvc2","bvc2.1.6.L93.B0","bvc2","bvc2",["h266"],"h266")),Tw.BYTEVC2,new Tk("bvc2","bvc2.1.6.L93.B0","bvc2","bvc2",["bytevc2","h266"],"h266"));function TT(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function Tx(e,t){for(var r=0;r=n)){var a=i,o=[],u=(60&t[i+2])>>>2,s=e.FREQ[u];if(!s)throw Error("Invalid sampling index: ".concat(u));for(var c,l,f=((192&t[i+2])>>>6)+1,d=(1&t[i+2])<<2|(192&t[i+3])>>>6,h=e._getConfig(u,d,f),v=h.config,p=h.codec,g=0,y=e.getFrameDuration(s);i+7>5)||n-i=n?void 0:t.subarray(i),frames:o,samplingFrequencyIndex:u,sampleRate:s,objectType:f,channelCount:d,codec:p,config:v,originCodec:"mp4a.40.".concat(f)}}}},{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 o=e._getConfig(n,i,r);return{samplingFrequencyIndex:n,sampleRate:a,objectType:r,channelCount:i,config:o.config,codec:o.codec,originCodec:"mp4a.40.".concat(r)}}}}},{key:"getFrameDuration",value:function(e){return 1024*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4)/e}},{key:"_getConfig",value:function(e,t,r){var n,i,a=[];return TR?e>=6?(n=5,i=e-3):(n=2,i=e):TA?(n=2,i=e):(n=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||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}();l=TD,d=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],(f=TC(f="FREQ"))in l?ck(l,f,{value:d,enumerable:!0,configurable:!0,writable:!0}):l[f]=d;var TM=Math.hypot,TB=Math.abs,Tj=Math.sqrt;tu({target:"Math",stat:!0,arity:2,forced:!!TM&&TM(1/0,NaN)!==1/0},{hypot:function(e,t){for(var r,n,i=0,a=0,o=arguments.length,u=0;a0?(n=r/u)*n:r;return u===1/0?1/0:u*Tj(i)}});var TN=J.Math.hypot,TU=v(TN);function TF(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(e[t]<<8)+(e[t+1]||0)}function Tz(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 TK(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return 4294967296*Tz(e,t)+Tz(e,t+4)}function TV(e,t){return Number(e+"."+t)}var Tq=g.RegExp,TH={correct:!y(function(){var e=!0;try{Tq(".","d")}catch(t){e=!1}var t={},r="",n=e?"dgimsy":"gimsy",i=function(e,n){Object.defineProperty(t,e,{get:function(){return r+=n,!0}})},a={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var o in e&&(a.hasIndices="d"),a)i(o,a[o]);return Object.getOwnPropertyDescriptor(Tq.prototype,"flags").get.call(t)!==n||r!==n})},TG=function(){var e=e5(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},TW=RegExp.prototype,TY=TH.correct?function(e){return e.flags}:function(e){return TH.correct||!et(TW,e)||eO(e,"flags")?e.flags:B(TG,e)},TX=RegExp.prototype,TQ=v(function(e){return e===TX||et(TX,e)?TY(e):e.flags}),T$=rw("Array","entries"),TJ=Array.prototype,TZ={DOMTokenList:!0,NodeList:!0},T0=v(function(e){var t=e.entries;return e===TJ||et(TJ,e)&&t===TJ.entries||eO(TZ,tw(e))?T$:t}),T1=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(ei),T2=sM.start;tu({target:"String",proto:!0,forced:T1},{padStart:function(e){return T2(this,e,arguments.length>1?arguments[1]:void 0)}});var T4=rw("String","padStart"),T3=String.prototype,T6=v(function(e){var t=e.padStart;return"string"==typeof e||e===T3||et(T3,e)&&t===T3.padStart?T4:t}),T8=function(){function e(t,r,n){TT(this,e),this.dv=new DataView(t),this.start=this.offset=r||this.dv.byteOffset,this.end=n?this.start+n:this.start+this.dv.byteLength}return TI(e,[{key:"buffer",get:function(){return this.dv.buffer}},{key:"unreadLength",get:function(){return Math.max(this.end-this.offset,0)}},{key:"size",get:function(){return this.end-this.start}},{key:"readFloat",value:function(e){var t=0;switch(e){case 4:t=this.dv.getFloat32(this.offset);break;case 8:t=this.dv.getFloat64(this.offset);break;default:throw Error("read ".concat(e,"-byte float is not supported"))}return this.offset+=e,t}},{key:"back",value:function(e){this.offset-=e}},{key:"skip",value:function(e){this.offset+=e}},{key:"readInt",value:function(e){var t=this.offset;switch(this.offset+=e,e){case 1:return this.dv.getInt8(t);case 2:return this.dv.getInt16(t);case 4:return this.dv.getInt32(t);default:throw Error("read ".concat(e,"-byte integers is not supported"))}}},{key:"read",value:function(e){var t=this.offset;switch(this.offset+=e,e){case 1:return this.dv.getUint8(t);case 2:return this.dv.getUint16(t);case 3:return(this.dv.getUint16(t)<<8)+this.dv.getUint8(t+2);case 4:return this.dv.getUint32(t);default:return this.back(e-4),this.read(e-4)+this.dv.getUint32(t)*Math.pow(256,e-4)}}},{key:"write",value:function(e,t){var r=this.offset;switch(this.offset+=e,e){case 1:return this.dv.setUint8(r,t);case 2:return this.dv.setUint16(r,t);case 3:return this.dv.setUint8(r,t>>>16),this.dv.setUint16(r+1,65535&t);case 4:return this.dv.setUint32(r,t);default:throw Error("write ".concat(e,"-byte integers is not supported"))}}},{key:"readToBuffer",value:function(e){var t,r;return t=this.offset||e?he(r=this.dv.buffer).call(r,this.offset,e?this.offset+e:this.end):this.dv.buffer,this.offset+=t.byteLength,t}},{key:"readToUint8",value:function(e){var t=new Uint8Array(this.dv.buffer,this.offset,e||this.unreadLength);return this.offset+=t.byteLength,t}},{key:"readString",value:function(e){for(var t=0,r="";t=0){var r=0,n=0;if(this.offset+=e,this.size>31){for(;n>>t&r}throw Error("the number of the read operation exceeds the total length limit of bits")}}],[{key:"fromByte",value:function(t,r){return new e(t.read(r),r<<3)}}]),e}(),T9=function(){function e(){TT(this,e)}return TI(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,o="",u=0;t.length>7;){if(a=Tz(t),o=String.fromCharCode.apply(null,t.subarray(4,8)),u=8,1===a?(a=TK(t,8),u+=8):a||(a=t.length),!r[0]||o===r[0]){var s=t.subarray(0,a);if(!(r.length<2))return e.findBox(s.subarray(u),he(r).call(r,1),n+u);i.push({start:n,size:a,headerSize:u,type:o,data:s})}n+=a,t=t.subarray(a)}return i}},{key:"tfhd",value:function(e){return xr(e,!0,function(e,t){e.trackId=Tz(t);var r=4,n=1&TQ(e),i=2&TQ(e),a=8&TQ(e),o=16&TQ(e),u=32&TQ(e);n&&(r+=4,e.baseDataOffset=Tz(t,r),r+=4),i&&(e.sampleDescriptionIndex=Tz(t,r),r+=4),a&&(e.defaultSampleDuration=Tz(t,r),r+=4),o&&(e.defaultSampleSize=Tz(t,r),r+=4),u&&(e.defaultSampleFlags=Tz(t,r))})}},{key:"sidx",value:function(e){return xr(e,!0,function(e,t){var r=0;e.reference_ID=Tz(t,r),r+=4,e.timescale=Tz(t,r),r+=4,0===e.version?(e.earliest_presentation_time=Tz(t,r),r+=4,e.first_offset=Tz(t,r),r+=4):(e.earliest_presentation_time=TK(t,r),r+=8,e.first_offset=TK(t,r),r+=8),r+=2,e.references=[];var n=TF(t,r);r+=2;for(var i=0;i>31&1,a.referenced_size=2147483647&o,a.subsegment_duration=Tz(t,r),o=Tz(t,r+=4),r+=4,a.starts_with_SAP=o>>31&1,a.SAP_type=o>>28&7,a.SAP_delta_time=268435455&o}})}},{key:"moov",value:function(t){return xr(t,!1,function(t,r,n){var i;t.mvhd=e.mvhd(e.findBox(r,["mvhd"],n)[0]),t.trak=c_(i=e.findBox(r,["trak"],n)).call(i,function(t){return e.trak(t)}),t.pssh=e.pssh(e.findBox(r,["pssh"],n)[0])})}},{key:"mvhd",value:function(e){return xr(e,!0,function(e,t){var r=0;1===e.version?(e.timescale=Tz(t,16),e.duration=TK(t,20),r+=28):(e.timescale=Tz(t,8),e.duration=Tz(t,12),r+=16),e.nextTrackId=Tz(t,r+76)})}},{key:"trak",value:function(t){return xr(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 xr(e,!0,function(e,t){var r=T8.fromUint8(t);1===e.version?(r.read(8),r.read(8),e.trackId=r.read(4),r.read(4),e.duration=r.read(8)):(r.read(4),r.read(4),e.trackId=r.read(4),r.read(4),e.duration=r.read(4)),r.skip(16),e.matrix=[];for(var n=0;n<36;n++)e.matrix.push(r.read(1));r.back(36);for(var i,a=[],o=0;o<3;o++)a.push(TV(r.readInt(2),r.readInt(2))),a.push(TV(r.readInt(2),r.readInt(2))),i=r.readInt(4),a.push(TV(i>>30,1073741823&i));e.rotation=function(e){if(e.length<5)return 0;var t=TU(e[0],e[3]),r=TU(e[1],e[4]);return 0===t||0===r?0:180*Math.atan2(e[1]/r,e[0]/t)/Math.PI}(a),e.width=r.read(4),e.height=r.read(4)})}},{key:"mdia",value:function(t){return xr(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 xr(e,!0,function(e,t){var r=0;1===e.version?(e.timescale=Tz(t,16),e.duration=TK(t,20),r+=28):(e.timescale=Tz(t,8),e.duration=Tz(t,12),r+=16);var n=TF(t,r);e.language=String.fromCharCode(96+(n>>10&31),96+(n>>5&31),96+(31&n))})}},{key:"hdlr",value:function(e){return xr(e,!0,function(e,t){0===e.version&&(e.handlerType=String.fromCharCode.apply(null,t.subarray(4,8)))})}},{key:"minf",value:function(t){return xr(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 xr(e,!0,function(e,t){e.graphicsmode=TF(t),e.opcolor=[TF(t,2),TF(t,4),TF(t,6)]})}},{key:"smhd",value:function(e){return xr(e,!0,function(e,t){e.balance=TF(t)})}},{key:"stbl",value:function(t){return xr(t,!1,function(t,r,n){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 i,a,o,u=null===(i=T0(t.stsd)[0])||void 0===i||null===(a=i.sinf)||void 0===a||null===(o=a.schi)||void 0===o?void 0:o.tenc.default_IV_size;t.stss=e.stss(e.findBox(r,["stss"],n)[0]),t.senc=e.senc(e.findBox(r,["senc"],n)[0],u)})}},{key:"senc",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return xr(e,!0,function(e,r){var n=0,i=Tz(r,0);n+=4,e.samples=[];for(var a=0;a0){var o=Tz(t,i);i+=4;for(var u=0;u<(""+o).length;u++)for(var s=0;s<16;s++){var c=t[i];i+=1,r.push(xi(c))}}var l=Tz(t,i);e.data_size=l,i+=4,e.kid=r,e.system_id=n,e.buffer=t})}},{key:"stsd",value:function(t){return xr(t,!0,function(t,r,n){var i,a;t.entryCount=Tz(r),t.entries=cC(i=c_(a=e.findBox(r.subarray(4),[],n+4)).call(a,function(t){switch(t.type){case"av01":return e.av01(t);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 xr(t,!1,function(t,r,n){t.channelCount=TF(r,16),t.samplesize=TF(r,18),t.sampleRate=Tz(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 xr(t,!1,function(t,r,n){t.width=TF(r,24),t.height=TF(r,26),t.horizresolution=Tz(r,28),t.vertresolution=Tz(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])})}})).call(i,Boolean)})}},{key:"tenc",value:function(e){return xr(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(xi(t[r])),r+=1})}},{key:"schi",value:function(t){return xr(t,!1,function(t,r,n){t.tenc=e.tenc(e.findBox(r,["tenc"],n)[0])})}},{key:"sinf",value:function(t){return xr(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 xr(e,!1,function(e,t){e.data_format="";for(var r=0;r<4;r++)e.data_format+=String.fromCharCode(t[r])})}},{key:"colr",value:function(e){return xr(e,!1,function(t,r){var n=T8.fromUint8(r);t.data=e.data,t.colorType=n.readString(4),"nclx"===t.colorType?(t.colorPrimaries=n.read(2),t.transferCharacteristics=n.read(2),t.matrixCoefficients=n.read(2),t.fullRangeFlag=n.read(1)>>7):"rICC"!==t.colorType&&"prof"!==t.colorType||(t.iccProfile=r.readToUint8())})}},{key:"av01",value:function(t){return xr(t,!1,function(t,r,n){var i=xe(t,r),a=r.subarray(i);n+=i,t.av1C=e.av1C(e.findBox(a,["av1C"],n)[0]),t.colr=e.colr(e.findBox(a,["colr"],n)[0])})}},{key:"av1C",value:function(e){return xr(e,!1,function(t,r){t.data=e.data;var n,i=T8.fromUint8(r),a=T5.fromByte(i,4);t.marker=a.read(1),t.version=a.read(7),t.seqProfile=a.read(3),t.seqLevelIdx0=a.read(5),t.seqTier0=a.read(1),t.highBitdepth=a.read(1),t.twelveBit=a.read(1),t.monochrome=a.read(1),t.chromaSubsamplingX=a.read(1),t.chromaSubsamplingY=a.read(1),t.chromaSamplePosition=a.read(2),t.reserved=a.read(3),t.initialPresentationDelayPresent=a.read(1),t.initialPresentationDelayPresent?t.initialPresentationDelayMinusOne=a.read(4):t.initialPresentationDelayMinusOne=0,t.configOBUs=i.readToUint8(),2===t.seqLevelIdx0&&1===t.highBitdepth?n=1===t.twelveBit?"12":"10":t.seqProfile<=2&&(n=1===t.highBitdepth?"10":"08"),t.codec=["av01",t.seqProfile,(t.seqLevelIdx0<10?"0"+t.seqLevelIdx0:t.seqLevelIdx0)+(t.seqTier0?"H":"M"),n].join(".")})}},{key:"avc1",value:function(t){return xr(t,!1,function(t,r,n){var i=xe(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 xr(e,!1,function(t,r){t.data=e.data,t.configurationVersion=r[0],t.AVCProfileIndication=r[1],t.profileCompatibility=r[2],t.AVCLevelIndication=r[3],t.codec=function(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}([r[1],r[2],r[3]]),t.lengthSizeMinusOne=3&r[4],t.spsLength=31&r[5],t.sps=[];for(var n=6,i=0;i>6,t.generalTierFlag=(32&n)>>5,t.generalProfileIdc=31&n,t.generalProfileCompatibility=Tz(r,2),t.generalConstraintIndicatorFlags=r.subarray(6,12),t.generalLevelIdc=r[12],t.avgFrameRate=TF(r,19),t.numOfArrays=r[22],t.vps=[],t.sps=[],t.pps=[];for(var i=23,a=0,o=0,u=0,s=0;s>3;return 31===s&&u.length>=2&&(s=32+((7&u[0])<<3)+((224&u[1])>>5)),e.objectType=s,e.codec+=s.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+=T6(o=t[r].toString(16)+".").call(o,3,"0"),t=t.subarray(r+13)}}})}},{key:"alaw",value:function(e){return xr(e,!1,function(e,t){xt(e,t)})}},{key:"stts",value:function(e){return xr(e,!0,function(e,t){for(var r=Tz(t),n=[],i=4,a=0;a4&&1&n&&(e.dataOffset=-(1+~Tz(t,o)),o+=4),i>o&&4&n&&(e.firstSampleFlags=Tz(t,o),o+=4),e.samples=[],i>o)for(var u,s=0;s>>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 o=la(a).call(a,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)}),u=la(a).call(a,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(o&&t){null!=(null===(s=o.tkhd)||void 0===s?void 0:s.trackId)&&(t.id=o.tkhd.trackId),t.tkhdDuration=o.tkhd.duration,t.mvhdDurtion=e.mvhd.duration,t.mvhdTimecale=e.mvhd.timescale,t.timescale=t.formatTimescale=o.mdia.mdhd.timescale,t.duration=o.mdia.mdhd.duration||t.mvhdDurtion/t.mvhdTimecale*t.timescale,t.rotation=o.tkhd.rotation,t.matrix=o.tkhd.matrix;var s,c,l,f,d,h,v,p,g,y,m,_,b,k,w,S=T0(o.mdia.minf.stbl.stsd)[0];if(t.width=S.width,t.height=S.height,S.pasp&&(t.sarRatio=[S.pasp.hSpacing,S.pasp.vSpacing]),S.av1C)t.codecType=TP.AV1,t.codec=S.av1C.codec,t.av1C=S.av1C.data,S.colr&&(t.colr=S.colr.data);else if(S.hvcC)t.codecType=TP.HEVC,t.codec=S.hvcC.codec,t.vps=S.hvcC.vps,t.sps=S.hvcC.sps,t.pps=S.hvcC.pps,t.hvcC=S.hvcC.data;else{if(!S.avcC)throw Error("unknown video stsd entry");t.codec=S.avcC.codec,t.sps=S.avcC.sps,t.pps=S.avcC.pps}t.present=!0,t.ext={},t.ext.stss=null===(c=o.mdia)||void 0===c||null===(l=c.minf)||void 0===l||null===(f=l.stbl)||void 0===f?void 0:f.stss,t.ext.ctts=null===(d=o.mdia)||void 0===d||null===(h=d.minf)||void 0===h||null===(v=h.stbl)||void 0===v?void 0:v.ctts,S&&"encv"===S.type&&(t.isVideoEncryption=!0,S.default_KID=null===(p=S.sinf)||void 0===p||null===(g=p.schi)||void 0===g?void 0:g.tenc.default_KID,S.default_IsEncrypted=null===(y=S.sinf)||void 0===y||null===(m=y.schi)||void 0===m?void 0:m.tenc.default_IsEncrypted,S.default_IV_size=null===(_=S.sinf)||void 0===_||null===(b=_.schi)||void 0===b?void 0:b.tenc.default_IV_size,t.videoSenc=o.mdia.minf.stbl.senc&&o.mdia.minf.stbl.senc.samples,S.data_format=null===(k=S.sinf)||void 0===k||null===(w=k.frma)||void 0===w?void 0:w.data_format,t.useEME=e.useEME,t.kidValue=e.kidValue,t.pssh=e.pssh,t.encv=S)}if(u&&r){null!=(null===(T=u.tkhd)||void 0===T?void 0:T.trackId)&&(r.id=u.tkhd.trackId),r.tkhdDuration=u.tkhd.duration,r.mvhdDurtion=e.mvhd.duration,r.mvhdTimecale=e.mvhd.timescale,r.timescale=r.formatTimescale=u.mdia.mdhd.timescale,r.duration=u.mdia.mdhd.duration||r.mvhdDurtion/r.mvhdTimecale*r.timescale;var T,x,I,C,P,E,O,L,R,A,D,M,B,j,N,U,F,z=T0(u.mdia.minf.stbl.stsd)[0];switch(r.sampleSize=z.sampleSize,r.sampleRate=z.sampleRate,r.channelCount=z.channelCount,r.present=!0,z.type){case"alaw":r.codecType=r.codec=TE.G711PCMA,r.sampleRate=8e3;break;case"ulaw":r.codecType=r.codec=TE.G711PCMU,r.sampleRate=8e3;break;default:r.sampleDuration=TD.getFrameDuration(r.sampleRate,r.timescale),r.sampleRateIndex=TD.getRateIndexByRate(r.sampleRate),r.objectType=(null===(n=z.esds)||void 0===n?void 0:n.objectType)||2,z.esds&&(r.config=fw(z.esds.config)),r.codec=(null===(i=z.esds)||void 0===i?void 0:i.codec)||"mp4a.40.2"}r.sampleDuration=TD.getFrameDuration(r.sampleRate,r.timescale),r.objectType=(null===(x=z.esds)||void 0===x?void 0:x.objectType)||2,z.esds&&z.esds.config&&(r.config=fw(z.esds.config)),r.codec=(null===(I=z.esds)||void 0===I?void 0:I.codec)||"mp4a.40.2",r.sampleRateIndex=TD.getRateIndexByRate(r.sampleRate),r.ext={},r.ext.stss=null===(C=u.mdia)||void 0===C||null===(P=C.minf)||void 0===P||null===(E=P.stbl)||void 0===E?void 0:E.stss,r.ext.ctts=null===(O=u.mdia)||void 0===O||null===(L=O.minf)||void 0===L||null===(R=L.stbl)||void 0===R?void 0:R.ctts,r.present=!0,z&&"enca"===z.type&&(r.isAudioEncryption=!0,z.data_format=null===(A=z.sinf)||void 0===A||null===(D=A.frma)||void 0===D?void 0:D.data_format,z.default_KID=null===(M=z.sinf)||void 0===M||null===(B=M.schi)||void 0===B?void 0:B.tenc.default_KID,z.default_IsEncrypted=null===(j=z.sinf)||void 0===j||null===(N=j.schi)||void 0===N?void 0:N.tenc.default_IsEncrypted,z.default_IV_size=null===(U=z.sinf)||void 0===U||null===(F=U.schi)||void 0===F?void 0:F.tenc.default_IV_size,r.audioSenc=u.mdia.minf.stbl.senc&&u.mdia.minf.stbl.senc.samples,r.useEME=e.useEME,r.kidValue=e.kidValue,r.enca=z)}if(r&&(r.isVideoEncryption=!!t&&t.isVideoEncryption),t&&(t.isAudioEncryption=!!r&&r.isAudioEncryption),null!=t&&t.encv||null!=r&&r.enca){var K,V,q=null==t||null===(K=t.encv)||void 0===K?void 0:K.default_KID,H=null==r||null===(V=r.enca)||void 0===V?void 0:V.default_KID,G=q||H?(q||H).join(""):null;t&&(t.kid=G),r&&(r.kid=G)}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,a={};return t.mfhd&&(r&&(r.sequenceNumber=t.mfhd.sequenceNumber),n&&(n.sequenceNumber=t.mfhd.sequenceNumber)),cb(i=t.traf).call(i,function(t){var i=t.tfhd,o=t.tfdt,u=t.trun;if(i&&u){o&&(r&&r.id===i.trackId&&(r.baseMediaDecodeTime=o.baseMediaDecodeTime),n&&n.id===i.trackId&&(n.baseMediaDecodeTime=o.baseMediaDecodeTime));var s,c=i.defaultSampleSize||0,l=i.defaultSampleDuration||e.evaluateDefaultDuration(r,n,u.samples.length||u.sampleCount),f=u.dataOffset||0,d=0,h=-1;if(!u.samples.length&&u.sampleCount){a[i.trackId]=[];for(var v=0;v>>0!=65536}).keyframe&&(h++,e.gopId=h),d+=e.duration,f+=e.size,e})}}),a}},{key:"moovToSamples",value:function(e){var t=e.trak;if(t&&t.length){var r=la(t).call(t,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=la(t).call(t,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){if(r){var i,a,o,u,s=null===(o=r.mdia)||void 0===o||null===(u=o.minf)||void 0===u?void 0:u.stbl;if(!s)return;var c=s.stts,l=s.stsc,f=s.stsz,d=s.stco,h=s.stss,v=s.ctts;if(!(c&&l&&f&&d&&h))return;i=T7(c,l,f,d,v,h)}if(n){var p,g,y,m=null===(p=n.mdia)||void 0===p||null===(g=p.minf)||void 0===g?void 0:g.stbl;if(!m)return;var _=null===(y=n.mdia.mdhd)||void 0===y?void 0:y.timescale,b=m.stts,k=m.stsc,w=m.stsz,S=m.stco;if(!(_&&b&&k&&w&&S))return;a=T7(b,k,w,S)}return{videoSamples:i,audioSamples:a}}}}}]),e}();function T7(e,t,r,n,i,a){var o,u,s,c,l=[],f=null==i?void 0:T0(i),d=T0(t),h=T0(n),v=r.entrySizes,p=null==a?void 0:T0(a);p&&(u={},cb(p).call(p,function(e){u[e-1]=!0})),f&&(s=[],cb(f).call(f,function(e){for(var t=e.count,r=e.offset,n=0;n=S&&(S=d[++b+1]?d[b+1].firstChunk-1:1/0),w+=d[b].samplesPerChunk)}),l}function xe(e,t){return e.dataReferenceIndex=TF(t,6),e.width=TF(t,24),e.height=TF(t,26),e.horizresolution=Tz(t,28),e.vertresolution=Tz(t,32),e.frameCount=TF(t,40),e.depth=TF(t,74),78}function xt(e,t){return e.dataReferenceIndex=TF(t,6),e.channelCount=TF(t,16),e.sampleSize=TF(t,18),e.sampleRate=Tz(t,24)/65536,28}function xr(e,t,r){if(e){if(e.size!==e.data.length)throw 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 xn=function(e,t,r){for(var n=String(r),i=0|t,a=Math.ceil(i/n.length),o=[],u=String(e);a--;)o.push(n);return o.join("").substring(0,i-u.length)+u},xi=function(){for(var e=[],t=arguments.length,r=Array(t),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return sv(this,t),sf((r=this,n=s_(n=t),a=sy(r,sm()?rf(n,[],s_(r).constructor):n.apply(r,i))),"duration",void 0),sf(a,"url",void 0),sf(a,"options",void 0),sf(a,"mediaList",void 0),sf(a,"retryMax",void 0),sf(a,"retry",void 0),sf(a,"type",void 0),sf(a,"isEnd",void 0),sf(a,"videoCodecType",void 0),sf(a,"videoCodecs",void 0),sf(a,"hasSync",void 0),sf(a,"_readyPromise",void 0),sf(a,"dashType",void 0),sf(a,"sidxHanded",void 0),a.url=e,a.options=o,a.mediaList={video:[],audio:[]},a.mediaList.audio.selectedIdx=0,a.retryMax=10,a.retry=0,a.type="live",a.isEnd=!1,a.duration=0,a.videoCodecType="",a.videoCodecs="",a.hasSync=!1,a.dashType="segment_base",a._readyPromise=new wU,a}return sk(t,m3),sg(t,[{key:"_createLoadingState",value:function(){return{currentIndex:0,isLoading:!1}}},{key:"readyPromise",get:function(){return this._readyPromise}},{key:"calcVideoCodeType",value:function(e,t){if(e||t){var r=null;t?r=t.split(".")[0]:e&&(r=e.split(".")[0]);for(var n=cw(TS),i=0;i-1){this.videoCodecType=o,"hevc"===o?this.videoCodecType="h265":"bvc2"===o&&(this.videoCodecType="h266"),this.videoCodecs=u.codecs;break}}this.videoCodecType||(this.videoCodecType=Tw.AVC,this.videoCodecs=TS[Tw.AVC].codecs)}}},{key:"fetch",value:(e=uj(uM().mark(function e(r){var n,i,a,o,u,s,c=this;return uM().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n={TYPE:"LIVE",ENDLIST:""},i=[],e.prev=1,a=new S8({}),e.next=2,a.load(r);case 2:if(!(o=e.sent.data)){e.next=4;break}if(u=t.parseMPD(o)){e.next=3;break}throw Error("parse mpd error");case 3:return this._parseMeta(n,u),this._parseSegments(u,r),cb(s=["video","audio"]).call(s,function(e){var t;c.mediaList[e].length>0&&(c.mediaList[e].selectedIdx=0,fU(t=c.mediaList[e]).call(t,function(t,r){return"video"===e?r.height-t.height:r.bandwidth-t.bandwidth}))}),e.abrupt("return",{meta:n,segments:i});case 4:throw Error("MPD_PARSE_ERROR");case 5:e.next=7;break;case 6:throw e.prev=6,Error(e.catch(1).message);case 7:case"end":return e.stop()}},e,this,[[1,6]])})),function(t){return e.apply(this,arguments)})},{key:"_parseMeta",value:function(e,t){"static"===t.type&&(e.TYPE="VOD"),t.minBufferTime&&(e.minBufferTime=Ty(t.minBufferTime)),t.maxSegmentDuration&&(e.maxSegmentDuration=Ty(t.maxSegmentDuration)),t.mediaPresentationDuration&&(this.duration=Ty(t.mediaPresentationDuration));var r=t.Period[0];!this.duration&&r&&r.duration&&(this.duration=Ty(r.duration)),e.duration=this.duration}},{key:"_parseST",value:function(e,t,r,n,i){for(var a=c7(e.timescale),o=c7(e.duration),u=Math.round(o/a),s=cX(e.startNumber,10),c=s+Math.ceil(this.duration/u)-1,l=s;l<=c;l++){var f=u*(l-s),d=u*(l-s+1);l===c&&(u=this.duration-u*(c-s),d=this.duration),t.push({idx:l,start:Math.round(f),end:Math.round(d),url:n+e.media.replace("$RepresentationID$",r).replace("$Number%04d$",function(e,t){var r;return he(r="000"+e).call(r,-t)}(l,4)),downloaded:0,segmentDuration:u,height:i})}}},{key:"_getVideoSegments",value:function(e){var t,r,n,i,a=e.bandwidth,o=e.id,u=e.baseURL,s=e.initSegment,c=e.mediaSegments,l=e.mimeType,f=e.codecs,d=e.width,h=e.height,v=e.frameRate,p=e.sar,g=e.startWithSAP,y=e.timescale,m=e.duration,_=e.encrypted;if(this.options.dynamic_video&&this.options.dynamic_video.dynamic_video_list)for(var b=0;b1&&cb(r=o.AdaptationSet).call(r,function(e){var r,o="video/mp4",u="avc1.64001E",s=640,c=360,l=25,f="1:1",d="1",h=588633;e.mimeType&&("video/mp4"===(o=e.mimeType)?(u=e.codecs,s=c7(e.width),c=c7(e.height),l=c7(e.frameRate),f=e.sar,d=e.startWithSAP,h=c7(e.bandwidth),n.calcVideoCodeType(void 0,u)):"audio/mp4"===o&&(u=e.codecs,d=e.startWithSAP,h=c7(e.bandwidth))),cb(r=e.Representation).call(r,function(r){lf(i).call(i,r.id)>-1&&(r.id=(cX(i[i.length-1],10)+1).toString()),i.push(r.id);var v,p="",g=[],y=0,m=he(t).call(t,0,Tg(t).call(t,"/")+1)+a;"video/mp4"===(o=xa(r,"mimeType",o))?(r.codecs&&(u=r.codecs,n.calcVideoCodeType(void 0,u)),s=xa(r,"width",s,c7),c=xa(r,"height",c,c7),l=xa(r,"frameRate",l,c7),f=xa(r,"sar",f)):"audio/mp4"===o&&(u=xa(r,"codecs",u)),d=xa(r,"startWithSAP",d),h=xa(r,"bandwidth",h,c7),r.BaseURL&&r.BaseURL.length>0&&(m+=r.BaseURL[0]),e.SegmentTemplate&&e.SegmentTemplate.length>0&&(v=e.SegmentTemplate[0]),r.SegmentTemplate&&r.SegmentTemplate.length>0&&(v=r.SegmentTemplate[0]);var _=!1;(e.ContentProtection||r.ContentProtection)&&(_=!0),v&&(p=v.initialization,y=c7(v.duration),n._parseST(v,g,r.id,m,c)),h="string"==typeof h?cX(h):h,"video/mp4"===o?n._getVideoSegments({id:r.id,bandwidth:h,baseURL:m,initSegment:p,mediaSegments:g,mimeType:o,codecs:u,width:s,height:c,frameRate:l,sar:f,startWithSAP:d,timescale:0,duration:y,encrypted:_}):"audio/mp4"===o&&n._getAudioSegments({id:r.id,baseURL:m,bandwidth:h,initSegment:p,mediaSegments:g,mimeType:o,codecs:u,startWithSAP:d,timescale:0,duration:y,encrypted:_})})})}},{key:"init",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.mediaList={video:[],audio:[]};var r=this.options;if(r.dynamic_video.dynamic_type&&"segment_template"!==r.dynamic_video.dynamic_type){this.dashType="segment_base",r.duration;var n,i,a=r.dynamic_video;cb(n=["dynamic_video_list","dynamic_audio_list"]).call(n,function(t){var n,i="dynamic_audio_list"===t,o=0;cb(n=a[t]).call(n,function(n){var a=cX(n.init_range.split("-")[0],10),u=cX(n.init_range.split("-")[1],10),s=cX(n.index_range.split("-")[0],10),c=cX(n.index_range.split("-")[1],10),l=n.first_segment_range,f=l?[cX(l.split("-")[0],10),cX(l.split("-")[1],10)]:null;i||e.calcVideoCodeType(n.codec_type);e.mediaList["dynamic_audio_list"===t?"audio":"video"].push({id:(o++).toString(),baseURL:n.main_url,initSegment:n.main_url,initSegmentRange:[a,u],sidxRange:[s,c],firstMoofMdatRange:f,inited:!1,hasSidx:!1,mediaSegments:[],mimeType:i?"audio/mp4":"video/mp4",codecs:i?"mp4a.40.2":e.videoCodecs,width:n.vwidth,height:n.vheight,bandwidth:cX(n.bitrate),avg_bitrate:n.avg_bitrate,size:n.size,duration:r.duration,definition:n.definition,sidxRes:void 0,fileId:n.file_id,audioFileId:n.audio_file_id,fallbackUrl:n.fallback_url,hasFallback:!1,backupUrl:n.backup_url_1,hasBackup:!1})})}),this.type="vod",cb(i=["video","audio"]).call(i,function(t){var r;e.mediaList[t].length>0&&(e.mediaList[t].selectedIdx=0,"video"===t&&fU(r=e.mediaList[t]).call(r,function(e,r){return"video"===t?r.height-e.height:r.bandwidth-e.bandwidth}))}),t&&this.emit("ready"),this._readyPromise.resolve()}else this.dashType="segment_template",this.fetch(r.dynamic_video.main_url).then(function(t){e.type=t.meta.TYPE.toLocaleLowerCase(),e.emit("ready"),e._readyPromise.resolve()},function(){})}},{key:"getSidx",value:function(e){var t,r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"video",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3?arguments[3]:void 0,o=this.mediaList[n][i],u=o.sidxRange[1];try{var s,c,l,f,d=e instanceof ArrayBuffer?e:e.buffer,h=new Uint8Array(d),v=String.fromCharCode.apply(null,fw(h.subarray(4,8)));if("sidx"!==v)throw Error(s8(c=s8(l=s8(f="topLevel ".concat(v,", index:")).call(f,i,", res:")).call(l,e.byteLength,", range:")).call(c,s$(o.sidxRange)));var p=(t=T9.sidx(T9.findBox(new Uint8Array(d),[])[0])).timescale,g=[],y=0,m=0,_=u+1,b=_-1;cb(s=t.references).call(s,function(e,t){m+=e.subsegment_duration,b+=e.referenced_size,g.push({idx:t+1,url:o.initSegment,start:Math.round(y/p),end:Math.round(m/p),startRaw:y/p,endRaw:m/p,range:[_,b],segmentDuration:Math.round(e.subsegment_duration/p),codecType:r.getCodecType(),mediaType:n,fileId:o.fileId}),y=m+1,_=b+1}),g[0].startTime_=0,o.mediaDuration=0,cb(g).call(g,function(e,t){o.mediaDuration+=e.segmentDuration,t>0&&(e.startTime_=g[t-1].startTime_+g[t-1].segmentDuration),t===g.length-1&&a&&(e.end=a)}),o.hasSidx=!0,o.mediaSegments=g,o.timescale=p,o.sidxRes=e}catch(e){if(this.sidxHanded)return;this.sidxHanded=!0}}},{key:"getCodecType",value:function(){return"bvc2"===this.videoCodecType?"h266":"hevc"===this.videoCodecType?"h265":this.videoCodecType?this.videoCodecType:"h264"}}],[{key:"parseMPD",value:function(e){var t;if("string"==typeof e&&(t=e),e instanceof ArrayBuffer){var r=new Uint8Array(e);t=String.fromCharCode.apply(null,fw(r))}return t?(t=t.replace(/<(\/)?(\w+:)+(\w+)/g,"<$1$3"),wG.parse(t)):null}}])}();!function(){var e,t,r,n,i,a,o;function u(e,t){var r,n,i,a;return sv(this,u),sf((n=this,i=u,a=[e,t],i=s_(i),r=sy(n,sm()?rf(i,a||[],s_(n).constructor):i.apply(n,a))),"_loader",void 0),sf(r,"_pendingItem",void 0),sf(r,"_pendingTask",void 0),sf(r,"options",void 0),sf(r,"preloadManager",void 0),r.preloadManager=e,r._loader=new S8({loaderType:Sq.XHR,responseType:"arraybuffer"}),r._loader.on("real_time_speed",function(t){if((null==t?void 0:t.len)>0){var n,i,a=(null==t||null===(n=t.priOptions)||void 0===n?void 0:n.type)||Sm.CDN,o=Math.round(8*t.len*1e3/t.time/1024),u=null==t?void 0:t.priOptions.extData,s=u.cacheKey,c=null===(i=r._pendingItem)||void 0===i?void 0:i.duration,l={vid:u.vid,loadType:a,size:t.len,speed:o,cacheKey:s,vtype:Sg.DASH,duration:c,bitrate:u.bitrate,range:t.range,mediaType:u.mediaType,format:Sg.DASH,segmentDuration:null==u?void 0:u.segmentDuration};e.bwEventEmit(l)}}),r.options=t,r._pendingTask=null,r}sk(u,Sc),sg(u,[{key:"_setItem",value:(o=uj(uM().mark(function e(t,r){var n,i;return uM().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.vtype=Sg.DASH,e.next=1,this.preloadManager.getItem(t,!0);case 1:(n=e.sent)?(i=function(e){var t,r={},n={},i={},a=Ts(cw(e));try{for(a.s();!(t=a.n()).done;){var o,u,s=t.value,c=e[s];c.isInitSegment?i[s]=c:(c.rangeEnd===(null===(o=c.range)||void 0===o?void 0:o[1])&&c.rangeStart===(null===(u=c.range)||void 0===u?void 0:u[0])?i[s]=c:"audio"===c.mediaType?r[s]=c:"video"===c.mediaType&&(n[s]=c),c.cacheKey=s)}}catch(e){a.e(e)}finally{a.f()}for(var l=T_(r),f=0,d=cw(l);f0&&(s=this.makeInitBaseSegemntRequest(t,r.duration,"audio",o.selectedIdx,void 0,r.vid),u.push(s)),a&&a.length>0&&(c=this._calVideoItemIdx(a,i.bandwidth)||0,l=a[c].definition,f=this.makeInitBaseSegemntRequest(t,r.duration,"video",c,l,r.vid),u.push(f)),e.next=1,cS.all(u);case 1:cb(d=e.sent).call(d,function(e){"video"===e.data.mediaType&&(e.data.orgDefinition=i.orgDefinition),n[e.key]=e.data});case 2:case"end":return e.stop()}},e,this)})),function(e,t,r,n){return a.apply(this,arguments)})},{key:"start",value:(i=uj(uM().mark(function e(t,r){var n,i,a,o,u,s,c,l,f,d,h,v,p,g,y,m,_,b,k,w,S,T,x,I,C,P,E,O,L,R,A,D,M,B,j,N,U,F,z,K,V,q,H,G,W,Y,X,Q,$=this;return uM().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=(n=cS.withResolvers()).resolve,a=n.promise,o={},this._pendingTask={resolve:i,data:t,map:o},s=(u=cS.withResolvers()).resolve,c=u.promise,l=new xo("anytext",this._getDashContext(t)),f=this._getStartContext(),d=function(){f.mediaInfos.dynamic_video_list=l.mediaList.video||[],f.mediaInfos.dynamic_audio_list=l.mediaList.audio||[],s(f)},l.once("ready",d),l.init(),e.next=1,c;case 1:if(this._pendingTask){e.next=2;break}return h=this.isStepWise(),i({remove:!h}),e.abrupt("return",a);case 2:if(p=(v=cS.withResolvers()).resolve,g=v.promise,y=f.mediaInfos,m=this._getIdx(y.dynamic_video_list,r||t.defaultDefinition),_=y.dynamic_video_list[m]||y.dynamic_video_list[0],y.dynamic_video_list[m]&&l.mediaList.audio&&y.dynamic_audio_list.length>0&&(l.mediaList.video.selectedIdx=m,-1===(b=function(e,t,r){var n,i=e.selectedIdx;var a=null===(n=e[i])||void 0===n?void 0:n.audioFileId;if(!a)return -1;for(var o=0;o0&&(null==D||null===(L=D.audio)||void 0===L?void 0:L.length)>0&&(A=D.video[D.video.selectedIdx].firstMoofMdatRange&&D.audio[D.audio.selectedIdx].firstMoofMdatRange),S||!A||null===(R=this.options)||void 0===R||!R.useSegmentRange){e.next=5;break}t.hasSegmentRange=!0,this._requestAcc(l,k,p,t),e.next=7;break;case 5:return e.next=6,this._cacheInitSegments(l,t,o,k);case 6:this._calRequests(l,k,p,t);case 7:e.next=9;break;case 8:p([]);case 9:e.next=11;break;case 10:p([]);case 11:return e.next=12,g;case 12:if(w=e.sent,0===(M=S?t.stepIdx:0)&&this._setItem(t,o),this._pendingTask){e.next=13;break}return i({remove:!S}),e.abrupt("return",a);case 13:S&&(N=t.steps.length,N<(U=Math.max(null===(B=t.video)||void 0===B?void 0:B.segments.length,null===(j=t.audio)||void 0===j?void 0:j.segments.length))&&(K=cI(F=Array(U-N)).call(F,1),(z=t.steps).push.apply(z,f3(K)))),V=[null===(x=t.video)||void 0===x?void 0:x.segments[M],null===(I=t.audio)||void 0===I?void 0:I.segments[M]],q=cC(C=s8(P=w||[]).call(P,V)).call(C,function(e){return!!e}),H=[],G=Ts(q),e.prev=14,Y=uM().mark(function e(){var r,n,i,a,u;return uM().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=(r=W.value).url,i=r.range,a=r.extData,u=$._getData(n,i,a).then(function(e){"video"===e.mediaType&&(e.orgDefinition=k.orgDefinition),!e.fromCache&&(o[a.cacheKey]=e,$._setItem(t,o))}),H.push(u);case 1:case"end":return e.stop()}},e)}),G.s();case 15:if((W=G.n()).done){e.next=17;break}return e.delegateYield(Y(),"t0",16);case 16:e.next=15;break;case 17:e.next=19;break;case 18:e.prev=18,X=e.catch(14),G.e(X);case 19:return e.prev=19,G.f(),e.finish(19);case 20:return e.next=21,cS.all(H);case 21:e.next=23;break;case 22:e.prev=22,e.catch(3);case 23:return e.prev=23,i({remove:!S}),e.finish(23);case 24:return this._pendingTask=null,e.abrupt("return",a);case 25:case"end":return e.stop()}},e,this,[[3,22,23,24],[14,18,19,20]])})),function(e,t){return i.apply(this,arguments)})},{key:"isStepWise",value:function(){var e=this.options.openStepwiseType;return this.stepwise&&(void 0===e||e.toUpperCase()===Sg.DASH)}},{key:"_getIdx",value:function(e,t){var r=0;return cb(e).call(e,function(e,n){e.definition===t&&(r=n)}),r}},{key:"_calRequests",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=[],o=t.bandwidth,u=e.mediaList.video||[],s=e.mediaList.audio||[],c=n.vid,l=e.videoCodecType;if(s&&s.length>0){var f=s.selectedIdx;s[f].codec_type=l;var d=this._calUrls(s[f],"audio",c,null,i,n);a=s8(a).call(a,d)}if(u&&u.length>0){var h=u[this._calVideoItemIdx(u,o)||0];h.codec_type=l;var v=this._calUrls(h,"video",c,h.definition,i,n);a=s8(a).call(a,v)}a.length,r(a)}},{key:"_getSplitGopRange",value:function(e,t,r){var n=e.segment,i=n.range;if(!e.isStep){var a=n.range[1],o=n.range[0];return{allRangeItems:[{item:n,range:i,segmentDuration:n.endRaw-n.startRaw,rangeEnd:a,rangeStart:o}],newSteps:t}}var u,s=[],c=[],l=Ts(t);try{for(l.s();!(u=l.n()).done;){var f=u.value;if(f>=n.endRaw){c.push(n.endRaw);break}c.push(f)}}catch(e){l.e(e)}finally{l.f()}var d=void 0===this.options.needfixSizeSegment||this.options.needfixSizeSegment;d&&c.length>0&&c[c.length-1]=n.endRaw,w=Math.floor(_*r/8)+i[0]+1,S=k?null===(m=n.range)||void 0===m?void 0:m[1]:w-1;h=S+1;var T=S>=g;if(i=[b,T?g:S],b>=S)break;s.push({item:n,range:i,segmentDuration:T?n.endRaw:_,rangeEnd:n.range[1],rangeStart:n.range[0]}),v++}return v=e.length)break}}catch(e){o.e(e)}finally{o.f()}return a}},{key:"_getRange",value:function(e,t){var r,n,i,a=e.mediaSegments,o=c_(r=t.steps).call(r,function(e){return e+0}),u=this._recalcSteps(o,a),s=[],c="segment_template"===t.dashType;if((null===(n=t.steps)||void 0===n?void 0:n.length)>0&&(null===(i=t.steps)||void 0===i?void 0:i[0])>0&&!c){if(u[0].isStep){var l=this._getSplitGopRange(u[0],t.steps,e.bandwidth).allRangeItems;s.push.apply(s,f3(l))}else{var f,d=Ts(u);try{for(d.s();!(f=d.n()).done;){var h=f.value,v=this._getSplitGopRange(h,t.steps,e.bandwidth).allRangeItems;s.push.apply(s,f3(v))}}catch(e){d.e(e)}finally{d.f()}}}else{var p=u[0].segment,g=p.range,y=p.range[0],m=p.range[1];s.push({item:p,range:g,segmentDuration:p.endRaw-p.startRaw,rangeEnd:m,rangeStart:y})}return s}},{key:"_calUrls",value:function(e,t,r,n,i,a){var o=[];if(e){var s=e.avg_bitrate||e.bandwidth||e.bitrate,c=u.vtype;a[t]||(a[t]={initSegment:null,segments:[]});var l=a[t];if(i){var f,d,h=[null===(f=e.initSegmentRange)||void 0===f?void 0:f[0],null===(d=e.sidxRange)||void 0===d?void 0:d[1]],v={url:e.initSegment,range:h,extData:{cacheKey:Tm({vid:r,mediaType:t,codecType:e.codec_type,vtype:c,bitrate:s,fileId:e.fileId,range:h,definition:n}),vid:r,vtype:c,isInitSegment:!0,mediaType:t,codecType:e.codec_type,range:h,bitrate:s,segmentDuration:0,checkPreload:!0}};o.push(v),l.initSegment=v}var p=[];if(a.hasSegmentRange){var g=e.firstMoofMdatRange[0],y=e.firstMoofMdatRange[1];p=[{item:{start:0,end:7,url:e.initSegment},range:[g,y],segmentDuration:7,rangeEnd:y,rangeStart:g}]}else p=this._getRange(e,a);var m,_=Ts(p);try{for(_.s();!(m=_.n()).done;){var b=m.value,k=b.item,w=b.range,S=b.segmentDuration,T=b.rangeEnd,x=b.rangeStart,I=Tm({vid:r,mediaType:t,codecType:e.codec_type,vtype:c,start:k.start,end:k.end,definition:n,bitrate:s,fileId:e.fileId,range:w});l.segments.push({url:k.url,range:w,extData:{cacheKey:I,vid:r,vtype:c,isInitSegment:!1,mediaType:t,codecType:e.codec_type,range:w,bitrate:s,segmentDuration:S,checkPreload:!0,rangeEnd:T,rangeStart:x,fileId:e.fileId}})}}catch(e){_.e(e)}finally{_.f()}}return o}},{key:"_requestAcc",value:function(e,t,r,n){this._calRequests(e,t,r,n,!0)}},{key:"_calStartEnd",value:function(e,t){for(var r=-1,n=0;n=a&&a1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=cS.withResolvers(),i=n.resolve,a=n.promise;return e instanceof ArrayBuffer&&i({initSegmentRes:0===t.length?e:he(e).call(e,t[0],t[1]+1),sidxSegmentRes:null===r?null:he(e).call(e,r[0],r[1]+1)}),a}},{key:"cancel",value:(r=uj(uM().mark(function e(){var t,r,n,i;return uM().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._loader){e.next=1;break}return e.next=1,this._loader.cancel();case 1:this._pendingTask&&(r=(t=this._pendingTask).data,n=c_(t),i=this.isStepWise(),this._pendingTask.resolve({remove:!i}),ws(n).length>0&&this._setItem(r,n),this._pendingTask=null);case 2:case"end":return e.stop()}},e,this)})),function(){return r.apply(this,arguments)})},{key:"getPreLoadDataSync",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Tm(e),n=this.preloadManager.getItemSync(e,t),i=this.preloadManager.getLoadInfoAndDelete(r);return sh(sh({cacheKey:r},n),{},{loadInfo:i})}},{key:"getPreLoadData",value:(t=uj(uM().mark(function e(t){var r,n,i,a,o=arguments;return uM().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]&&o[1],n=Tm(t),e.next=1,this.preloadManager.getItem(t,r);case 1:return i=e.sent,a=this.preloadManager.getLoadInfoAndDelete(n),e.abrupt("return",sh(sh({cacheKey:n},i),{},{loadInfo:a}));case 2:case"end":return e.stop()}},e,this)})),function(e){return t.apply(this,arguments)})},{key:"destroy",value:(e=uj(uM().mark(function e(){var t;return uM().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:null===(t=this._loader)||void 0===t||t.removeAllListeners(),this._loader=null;case 1:case"end":return e.stop()}},e,this)})),function(){return e.apply(this,arguments)})},{key:"parseKey",value:function(e){var t,r,n=Ts(e);try{for(n.s();!(r=n.n()).done;){var i=r.value,a=Ss.parseKey(i);"audio"===a.mediaType?a.hasAudio=!0:(a.hasVideo=!0,t=sC({},t,a))}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"taskInProgress",get:function(){return!!this._pendingTask.resolve&&!!this._pendingTask.data}}],[{key:"vtype",get:function(){return Sg.DASH}},{key:"isUniqueCache",value:function(e){return!!e&&4===cw(e).length}},{key:"generateUniqueKey",value:function(e){return Tm(e)}}])}();var xu=new s7("VeStrategy-preload"),xs=function(){var e,t;function r(e){var t,n,i,a,o,u;return sv(this,r),a=this,o=r,u=[e],o=s_(o),i=sy(a,sm()?rf(o,u||[],s_(a).constructor):o.apply(a,u)),Sd.bindTracker(null==e||null===(t=e.ctx)||void 0===t?void 0:t.tracker),xu.update(null===(n=e.ctx.dataCenter)||void 0===n||null===(n=n.getAppConfig())||void 0===n?void 0:n.log),xu.info("VeStrategyPreloadInit"),i}return sk(r,sE),sg(r,[{key:"getRecommendation",value:function(e){var t={plugins:[],pluginConfiguration:{},result:{enable:!1}};return!1!==this.config.disableAutoCheckPlugin&&(t.plugins=[Sp],t.pluginConfiguration=sf({},Sp.pluginName,sh({preloader:Sd},this.config))),t.result={enable:!0},!1===e.recResult&&delete t.result,t}}],[{key:"prepare",value:(t=uj(uM().mark(function e(t){var r,n,i,a,o;return uM().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.config,n=t.loaders,i=t.preloader,a=t.useBitrateSelector,e.next=1,this.preloader.prepare({config:r,loaders:n,preloader:i,BitrateSelector:a?hg:null});case 1:return o=e.sent,this._checkSelectorConfig(),e.abrupt("return",o);case 2:case"end":return e.stop()}},e,this)})),function(e){return t.apply(this,arguments)})},{key:"addPreloadList",value:(e=uj(uM().mark(function e(t){return uM().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this._checkSelectorConfig(),this.preloader.addPreloadList(t);case 1:case"end":return e.stop()}},e,this)})),function(t){return e.apply(this,arguments)})},{key:"_checkSelectorConfig",value:function(){var e=this.preloader.bitrateSelector;e&&(!e.defaultConfig||e.defaultConfig.mode&&e.defaultConfig.mode===hg.defaultConfig.mode||(e.defaultConfig=sC(e.defaultConfig,hg.defaultConfig)))}}])}();sf(xs,"strategyName",s2.preload),sf(xs,"strategyPriority",s4.preload),sf(xs,"preloader",Sd)}}]);