@byteplus/veplayer-plugin 2.10.3-rc.0 → 2.10.3-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/ad.d.ts +3 -0
- package/esm/hlsjs.d.ts +3 -0
- package/esm/index.development.js +495 -217
- package/esm/index.production.js +1 -1
- package/esm/time-shift.d.ts +3 -0
- package/esm/veplayer.plugin.abr.development.js +1 -1
- package/esm/veplayer.plugin.abr.production.js +1 -1
- package/esm/veplayer.plugin.drm.development.js +1 -1
- package/esm/veplayer.plugin.drm.production.js +1 -1
- package/esm/veplayer.plugin.flv.development.js +1 -1
- package/esm/veplayer.plugin.flv.production.js +1 -1
- package/esm/veplayer.plugin.hls.development.js +1 -1
- package/esm/veplayer.plugin.hls.production.js +1 -1
- package/esm/veplayer.plugin.hlsjs.development.js +496 -218
- package/esm/veplayer.plugin.hlsjs.production.js +1 -1
- package/esm/veplayer.plugin.rtm.development.js +1 -1
- package/esm/veplayer.plugin.rtm.production.js +1 -1
- package/esm/veplayer.plugin.time.shift.development.js +13 -16
- package/esm/veplayer.plugin.time.shift.production.js +1 -1
- package/esm/veplayer.plugin.xgvideo.development.js +1 -1
- package/esm/veplayer.plugin.xgvideo.production.js +1 -1
- package/esm/veplayer.strategy.base.development.js +1 -1
- package/esm/veplayer.strategy.base.production.js +1 -1
- package/esm/veplayer.strategy.rtm.adaptive.buffer.development.js +1 -1
- package/esm/veplayer.strategy.rtm.adaptive.buffer.production.js +1 -1
- package/package.json +106 -2
- package/umd/ad.d.ts +3 -0
- package/umd/hlsjs.d.ts +3 -0
- package/umd/time-shift.d.ts +3 -0
- package/umd/veplayer.plugin.hlsjs.development.js +495 -217
- package/umd/veplayer.plugin.hlsjs.production.js +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function _classCallCheck$5(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var defineProperty$e={exports:{}},check=function(e){return e&&e.Math==Math&&e},global$s=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof commonjsGlobal&&commonjsGlobal)||function(){return this}()||commonjsGlobal||Function("return this")(),fails$z=function(e){try{return!!e()}catch(e){return!0}},fails$y=fails$z,functionBindNative=!fails$y((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),NATIVE_BIND$4=functionBindNative,FunctionPrototype$3=Function.prototype,apply$6=FunctionPrototype$3.apply,call$A=FunctionPrototype$3.call,functionApply="object"==typeof Reflect&&Reflect.apply||(NATIVE_BIND$4?call$A.bind(apply$6):function(){return call$A.apply(apply$6,arguments)}),NATIVE_BIND$3=functionBindNative,FunctionPrototype$2=Function.prototype,call$z=FunctionPrototype$2.call,uncurryThisWithBind=NATIVE_BIND$3&&FunctionPrototype$2.bind.bind(call$z,call$z),functionUncurryThis=NATIVE_BIND$3?uncurryThisWithBind:function(e){return function(){return call$z.apply(e,arguments)}},uncurryThis$D=functionUncurryThis,toString$i=uncurryThis$D({}.toString),stringSlice$4=uncurryThis$D("".slice),classofRaw$2=function(e){return stringSlice$4(toString$i(e),8,-1)},classofRaw$1=classofRaw$2,uncurryThis$C=functionUncurryThis,functionUncurryThisClause=function(e){if("Function"===classofRaw$1(e))return uncurryThis$C(e)},documentAll$2="object"==typeof document&&document.all,IS_HTMLDDA=void 0===documentAll$2&&void 0!==documentAll$2,documentAll_1={all:documentAll$2,IS_HTMLDDA:IS_HTMLDDA},$documentAll$1=documentAll_1,documentAll$1=$documentAll$1.all,isCallable$r=$documentAll$1.IS_HTMLDDA?function(e){return"function"==typeof e||e===documentAll$1}:function(e){return"function"==typeof e},objectGetOwnPropertyDescriptor={},fails$x=fails$z,descriptors=!fails$x((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),NATIVE_BIND$2=functionBindNative,call$y=Function.prototype.call,functionCall=NATIVE_BIND$2?call$y.bind(call$y):function(){return call$y.apply(call$y,arguments)},objectPropertyIsEnumerable={},$propertyIsEnumerable$1={}.propertyIsEnumerable,getOwnPropertyDescriptor$b=Object.getOwnPropertyDescriptor,NASHORN_BUG=getOwnPropertyDescriptor$b&&!$propertyIsEnumerable$1.call({1:2},1);objectPropertyIsEnumerable.f=NASHORN_BUG?function(e){var t=getOwnPropertyDescriptor$b(this,e);return!!t&&t.enumerable}:$propertyIsEnumerable$1;var match,version$1,createPropertyDescriptor$8=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},uncurryThis$B=functionUncurryThis,fails$w=fails$z,classof$g=classofRaw$2,$Object$5=Object,split$3=uncurryThis$B("".split),indexedObject=fails$w((function(){return!$Object$5("z").propertyIsEnumerable(0)}))?function(e){return"String"==classof$g(e)?split$3(e,""):$Object$5(e)}:$Object$5,isNullOrUndefined$7=function(e){return null==e},isNullOrUndefined$6=isNullOrUndefined$7,$TypeError$m=TypeError,requireObjectCoercible$7=function(e){if(isNullOrUndefined$6(e))throw $TypeError$m("Can't call method on "+e);return e},IndexedObject$3=indexedObject,requireObjectCoercible$6=requireObjectCoercible$7,toIndexedObject$a=function(e){return IndexedObject$3(requireObjectCoercible$6(e))},isCallable$q=isCallable$r,$documentAll=documentAll_1,documentAll=$documentAll.all,isObject$m=$documentAll.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:isCallable$q(e)||e===documentAll}:function(e){return"object"==typeof e?null!==e:isCallable$q(e)},path$w={},path$v=path$w,global$r=global$s,isCallable$p=isCallable$r,aFunction=function(e){return isCallable$p(e)?e:void 0},getBuiltIn$j=function(e,t){return arguments.length<2?aFunction(path$v[e])||aFunction(global$r[e]):path$v[e]&&path$v[e][t]||global$r[e]&&global$r[e][t]},uncurryThis$A=functionUncurryThis,objectIsPrototypeOf=uncurryThis$A({}.isPrototypeOf),engineUserAgent="undefined"!=typeof navigator&&String(navigator.userAgent)||"",global$q=global$s,userAgent$6=engineUserAgent,process$4=global$q.process,Deno$1=global$q.Deno,versions=process$4&&process$4.versions||Deno$1&&Deno$1.version,v8=versions&&versions.v8;v8&&(version$1=(match=v8.split("."))[0]>0&&match[0]<4?1:+(match[0]+match[1])),!version$1&&userAgent$6&&(!(match=userAgent$6.match(/Edge\/(\d+)/))||match[1]>=74)&&(match=userAgent$6.match(/Chrome\/(\d+)/))&&(version$1=+match[1]);var engineV8Version=version$1,V8_VERSION$3=engineV8Version,fails$v=fails$z,global$p=global$s,$String$5=global$p.String,symbolConstructorDetection=!!Object.getOwnPropertySymbols&&!fails$v((function(){var e=Symbol();return!$String$5(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&V8_VERSION$3&&V8_VERSION$3<41})),NATIVE_SYMBOL$5=symbolConstructorDetection,useSymbolAsUid=NATIVE_SYMBOL$5&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,getBuiltIn$i=getBuiltIn$j,isCallable$o=isCallable$r,isPrototypeOf$p=objectIsPrototypeOf,USE_SYMBOL_AS_UID$1=useSymbolAsUid,$Object$4=Object,isSymbol$5=USE_SYMBOL_AS_UID$1?function(e){return"symbol"==typeof e}:function(e){var t=getBuiltIn$i("Symbol");return isCallable$o(t)&&isPrototypeOf$p(t.prototype,$Object$4(e))},$String$4=String,tryToString$8=function(e){try{return $String$4(e)}catch(e){return"Object"}},isCallable$n=isCallable$r,tryToString$7=tryToString$8,$TypeError$l=TypeError,aCallable$l=function(e){if(isCallable$n(e))return e;throw $TypeError$l(tryToString$7(e)+" is not a function")},aCallable$k=aCallable$l,isNullOrUndefined$5=isNullOrUndefined$7,getMethod$3=function(e,t){var r=e[t];return isNullOrUndefined$5(r)?void 0:aCallable$k(r)},call$x=functionCall,isCallable$m=isCallable$r,isObject$l=isObject$m,$TypeError$k=TypeError,ordinaryToPrimitive$1=function(e,t){var r,n;if("string"===t&&isCallable$m(r=e.toString)&&!isObject$l(n=call$x(r,e)))return n;if(isCallable$m(r=e.valueOf)&&!isObject$l(n=call$x(r,e)))return n;if("string"!==t&&isCallable$m(r=e.toString)&&!isObject$l(n=call$x(r,e)))return n;throw $TypeError$k("Can't convert object to primitive value")},shared$7={exports:{}},isPure=!0,global$o=global$s,defineProperty$d=Object.defineProperty,defineGlobalProperty$1=function(e,t){try{defineProperty$d(global$o,e,{value:t,configurable:!0,writable:!0})}catch(r){global$o[e]=t}return t},global$n=global$s,defineGlobalProperty=defineGlobalProperty$1,SHARED="__core-js_shared__",store$3=global$n[SHARED]||defineGlobalProperty(SHARED,{}),sharedStore=store$3,store$2=sharedStore;(shared$7.exports=function(e,t){return store$2[e]||(store$2[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.30.2",mode:"pure",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.2/LICENSE",source:"https://github.com/zloirock/core-js"});var sharedExports=shared$7.exports,requireObjectCoercible$5=requireObjectCoercible$7,$Object$3=Object,toObject$c=function(e){return $Object$3(requireObjectCoercible$5(e))},uncurryThis$z=functionUncurryThis,toObject$b=toObject$c,hasOwnProperty=uncurryThis$z({}.hasOwnProperty),hasOwnProperty_1=Object.hasOwn||function(e,t){return hasOwnProperty(toObject$b(e),t)},uncurryThis$y=functionUncurryThis,id$1=0,postfix=Math.random(),toString$h=uncurryThis$y(1..toString),uid$4=function(e){return"Symbol("+(void 0===e?"":e)+")_"+toString$h(++id$1+postfix,36)},global$m=global$s,shared$6=sharedExports,hasOwn$m=hasOwnProperty_1,uid$3=uid$4,NATIVE_SYMBOL$4=symbolConstructorDetection,USE_SYMBOL_AS_UID=useSymbolAsUid,Symbol$5=global$m.Symbol,WellKnownSymbolsStore$2=shared$6("wks"),createWellKnownSymbol=USE_SYMBOL_AS_UID?Symbol$5.for||Symbol$5:Symbol$5&&Symbol$5.withoutSetter||uid$3,wellKnownSymbol$r=function(e){return hasOwn$m(WellKnownSymbolsStore$2,e)||(WellKnownSymbolsStore$2[e]=NATIVE_SYMBOL$4&&hasOwn$m(Symbol$5,e)?Symbol$5[e]:createWellKnownSymbol("Symbol."+e)),WellKnownSymbolsStore$2[e]},call$w=functionCall,isObject$k=isObject$m,isSymbol$4=isSymbol$5,getMethod$2=getMethod$3,ordinaryToPrimitive=ordinaryToPrimitive$1,wellKnownSymbol$q=wellKnownSymbol$r,$TypeError$j=TypeError,TO_PRIMITIVE=wellKnownSymbol$q("toPrimitive"),toPrimitive$7=function(e,t){if(!isObject$k(e)||isSymbol$4(e))return e;var r,n=getMethod$2(e,TO_PRIMITIVE);if(n){if(void 0===t&&(t="default"),r=call$w(n,e,t),!isObject$k(r)||isSymbol$4(r))return r;throw $TypeError$j("Can't convert object to primitive value")}return void 0===t&&(t="number"),ordinaryToPrimitive(e,t)},toPrimitive$6=toPrimitive$7,isSymbol$3=isSymbol$5,toPropertyKey$4=function(e){var t=toPrimitive$6(e,"string");return isSymbol$3(t)?t:t+""},global$l=global$s,isObject$j=isObject$m,document$3=global$l.document,EXISTS$1=isObject$j(document$3)&&isObject$j(document$3.createElement),documentCreateElement$1=function(e){return EXISTS$1?document$3.createElement(e):{}},DESCRIPTORS$k=descriptors,fails$u=fails$z,createElement$1=documentCreateElement$1,ie8DomDefine=!DESCRIPTORS$k&&!fails$u((function(){return 7!=Object.defineProperty(createElement$1("div"),"a",{get:function(){return 7}}).a})),DESCRIPTORS$j=descriptors,call$v=functionCall,propertyIsEnumerableModule$2=objectPropertyIsEnumerable,createPropertyDescriptor$7=createPropertyDescriptor$8,toIndexedObject$9=toIndexedObject$a,toPropertyKey$3=toPropertyKey$4,hasOwn$l=hasOwnProperty_1,IE8_DOM_DEFINE$1=ie8DomDefine,$getOwnPropertyDescriptor$2=Object.getOwnPropertyDescriptor;objectGetOwnPropertyDescriptor.f=DESCRIPTORS$j?$getOwnPropertyDescriptor$2:function(e,t){if(e=toIndexedObject$9(e),t=toPropertyKey$3(t),IE8_DOM_DEFINE$1)try{return $getOwnPropertyDescriptor$2(e,t)}catch(e){}if(hasOwn$l(e,t))return createPropertyDescriptor$7(!call$v(propertyIsEnumerableModule$2.f,e,t),e[t])};var fails$t=fails$z,isCallable$l=isCallable$r,replacement=/#|\.prototype\./,isForced$2=function(e,t){var r=data[normalize(e)];return r==POLYFILL||r!=NATIVE&&(isCallable$l(t)?fails$t(t):!!t)},normalize=isForced$2.normalize=function(e){return String(e).replace(replacement,".").toLowerCase()},data=isForced$2.data={},NATIVE=isForced$2.NATIVE="N",POLYFILL=isForced$2.POLYFILL="P",isForced_1=isForced$2,uncurryThis$x=functionUncurryThisClause,aCallable$j=aCallable$l,NATIVE_BIND$1=functionBindNative,bind$w=functionUncurryThisClause(functionUncurryThisClause.bind),functionBindContext=function(e,t){return aCallable$j(e),void 0===t?e:NATIVE_BIND$1?bind$w(e,t):function(){return e.apply(t,arguments)}},objectDefineProperty={},DESCRIPTORS$i=descriptors,fails$s=fails$z,v8PrototypeDefineBug=DESCRIPTORS$i&&fails$s((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),isObject$i=isObject$m,$String$3=String,$TypeError$i=TypeError,anObject$i=function(e){if(isObject$i(e))return e;throw $TypeError$i($String$3(e)+" is not an object")},DESCRIPTORS$h=descriptors,IE8_DOM_DEFINE=ie8DomDefine,V8_PROTOTYPE_DEFINE_BUG$1=v8PrototypeDefineBug,anObject$h=anObject$i,toPropertyKey$2=toPropertyKey$4,$TypeError$h=TypeError,$defineProperty$1=Object.defineProperty,$getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor,ENUMERABLE="enumerable",CONFIGURABLE$1="configurable",WRITABLE="writable";objectDefineProperty.f=DESCRIPTORS$h?V8_PROTOTYPE_DEFINE_BUG$1?function(e,t,r){if(anObject$h(e),t=toPropertyKey$2(t),anObject$h(r),"function"==typeof e&&"prototype"===t&&"value"in r&&WRITABLE in r&&!r[WRITABLE]){var n=$getOwnPropertyDescriptor$1(e,t);n&&n[WRITABLE]&&(e[t]=r.value,r={configurable:CONFIGURABLE$1 in r?r[CONFIGURABLE$1]:n[CONFIGURABLE$1],enumerable:ENUMERABLE in r?r[ENUMERABLE]:n[ENUMERABLE],writable:!1})}return $defineProperty$1(e,t,r)}:$defineProperty$1:function(e,t,r){if(anObject$h(e),t=toPropertyKey$2(t),anObject$h(r),IE8_DOM_DEFINE)try{return $defineProperty$1(e,t,r)}catch(e){}if("get"in r||"set"in r)throw $TypeError$h("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var DESCRIPTORS$g=descriptors,definePropertyModule$4=objectDefineProperty,createPropertyDescriptor$6=createPropertyDescriptor$8,createNonEnumerableProperty$9=DESCRIPTORS$g?function(e,t,r){return definePropertyModule$4.f(e,t,createPropertyDescriptor$6(1,r))}:function(e,t,r){return e[t]=r,e},global$k=global$s,apply$5=functionApply,uncurryThis$w=functionUncurryThisClause,isCallable$k=isCallable$r,getOwnPropertyDescriptor$a=objectGetOwnPropertyDescriptor.f,isForced$1=isForced_1,path$u=path$w,bind$v=functionBindContext,createNonEnumerableProperty$8=createNonEnumerableProperty$9,hasOwn$k=hasOwnProperty_1,wrapConstructor=function(e){var t=function(r,n,o){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,o)}return apply$5(e,this,arguments)};return t.prototype=e.prototype,t},_export=function(e,t){var r,n,o,i,a,s,c,l,u,p=e.target,$=e.global,f=e.stat,d=e.proto,y=$?global$k:f?global$k[p]:(global$k[p]||{}).prototype,h=$?path$u:path$u[p]||createNonEnumerableProperty$8(path$u,p,{})[p],_=h.prototype;for(i in t)n=!(r=isForced$1($?i:p+(f?".":"#")+i,e.forced))&&y&&hasOwn$k(y,i),s=h[i],n&&(c=e.dontCallGetSet?(u=getOwnPropertyDescriptor$a(y,i))&&u.value:y[i]),a=n&&c?c:t[i],n&&typeof s==typeof a||(l=e.bind&&n?bind$v(a,global$k):e.wrap&&n?wrapConstructor(a):d&&isCallable$k(a)?uncurryThis$w(a):a,(e.sham||a&&a.sham||s&&s.sham)&&createNonEnumerableProperty$8(l,"sham",!0),createNonEnumerableProperty$8(h,i,l),d&&(hasOwn$k(path$u,o=p+"Prototype")||createNonEnumerableProperty$8(path$u,o,{}),createNonEnumerableProperty$8(path$u[o],i,a),e.real&&_&&(r||!_[i])&&createNonEnumerableProperty$8(_,i,a)))},$$1I=_export,DESCRIPTORS$f=descriptors,defineProperty$c=objectDefineProperty.f;$$1I({target:"Object",stat:!0,forced:Object.defineProperty!==defineProperty$c,sham:!DESCRIPTORS$f},{defineProperty:defineProperty$c});var path$t=path$w,Object$4=path$t.Object,defineProperty$b=defineProperty$e.exports=function(e,t,r){return Object$4.defineProperty(e,t,r)};Object$4.defineProperty.sham&&(defineProperty$b.sham=!0);var definePropertyExports=defineProperty$e.exports,parent$2m=definePropertyExports,defineProperty$a=parent$2m,parent$2l=defineProperty$a,defineProperty$9=parent$2l,parent$2k=defineProperty$9,defineProperty$8=parent$2k,defineProperty$7=defineProperty$8,_Object$defineProperty$1=getDefaultExportFromCjs(defineProperty$7),classof$f=classofRaw$2,isArray$d=Array.isArray||function(e){return"Array"==classof$f(e)},ceil$1=Math.ceil,floor$3=Math.floor,mathTrunc=Math.trunc||function(e){var t=+e;return(t>0?floor$3:ceil$1)(t)},trunc2=mathTrunc,toIntegerOrInfinity$6=function(e){var t=+e;return t!=t||0===t?0:trunc2(t)},toIntegerOrInfinity$5=toIntegerOrInfinity$6,min$2=Math.min,toLength$2=function(e){return e>0?min$2(toIntegerOrInfinity$5(e),9007199254740991):0},toLength$1=toLength$2,lengthOfArrayLike$a=function(e){return toLength$1(e.length)},$TypeError$g=TypeError,MAX_SAFE_INTEGER=9007199254740991,doesNotExceedSafeInteger$2=function(e){if(e>MAX_SAFE_INTEGER)throw $TypeError$g("Maximum allowed index exceeded");return e},toPropertyKey$1=toPropertyKey$4,definePropertyModule$3=objectDefineProperty,createPropertyDescriptor$5=createPropertyDescriptor$8,createProperty$6=function(e,t,r){var n=toPropertyKey$1(t);n in e?definePropertyModule$3.f(e,n,createPropertyDescriptor$5(0,r)):e[n]=r},wellKnownSymbol$p=wellKnownSymbol$r,TO_STRING_TAG$4=wellKnownSymbol$p("toStringTag"),test$2={};test$2[TO_STRING_TAG$4]="z";var toStringTagSupport="[object z]"===String(test$2),TO_STRING_TAG_SUPPORT$2=toStringTagSupport,isCallable$j=isCallable$r,classofRaw=classofRaw$2,wellKnownSymbol$o=wellKnownSymbol$r,TO_STRING_TAG$3=wellKnownSymbol$o("toStringTag"),$Object$2=Object,CORRECT_ARGUMENTS="Arguments"==classofRaw(function(){return arguments}()),tryGet=function(e,t){try{return e[t]}catch(e){}},classof$e=TO_STRING_TAG_SUPPORT$2?classofRaw:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=tryGet(t=$Object$2(e),TO_STRING_TAG$3))?r:CORRECT_ARGUMENTS?classofRaw(t):"Object"==(n=classofRaw(t))&&isCallable$j(t.callee)?"Arguments":n},uncurryThis$v=functionUncurryThis,isCallable$i=isCallable$r,store$1=sharedStore,functionToString=uncurryThis$v(Function.toString);isCallable$i(store$1.inspectSource)||(store$1.inspectSource=function(e){return functionToString(e)});var inspectSource$2=store$1.inspectSource,uncurryThis$u=functionUncurryThis,fails$r=fails$z,isCallable$h=isCallable$r,classof$d=classof$e,getBuiltIn$h=getBuiltIn$j,inspectSource$1=inspectSource$2,noop=function(){},empty=[],construct$7=getBuiltIn$h("Reflect","construct"),constructorRegExp=/^\s*(?:class|function)\b/,exec$4=uncurryThis$u(constructorRegExp.exec),INCORRECT_TO_STRING=!constructorRegExp.exec(noop),isConstructorModern=function(e){if(!isCallable$h(e))return!1;try{return construct$7(noop,empty,e),!0}catch(e){return!1}},isConstructorLegacy=function(e){if(!isCallable$h(e))return!1;switch(classof$d(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return INCORRECT_TO_STRING||!!exec$4(constructorRegExp,inspectSource$1(e))}catch(e){return!0}};isConstructorLegacy.sham=!0;var isConstructor$4=!construct$7||fails$r((function(){var e;return isConstructorModern(isConstructorModern.call)||!isConstructorModern(Object)||!isConstructorModern((function(){e=!0}))||e}))?isConstructorLegacy:isConstructorModern,isArray$c=isArray$d,isConstructor$3=isConstructor$4,isObject$h=isObject$m,wellKnownSymbol$n=wellKnownSymbol$r,SPECIES$5=wellKnownSymbol$n("species"),$Array$3=Array,arraySpeciesConstructor$1=function(e){var t;return isArray$c(e)&&(t=e.constructor,(isConstructor$3(t)&&(t===$Array$3||isArray$c(t.prototype))||isObject$h(t)&&null===(t=t[SPECIES$5]))&&(t=void 0)),void 0===t?$Array$3:t},arraySpeciesConstructor=arraySpeciesConstructor$1,arraySpeciesCreate$3=function(e,t){return new(arraySpeciesConstructor(e))(0===t?0:t)},fails$q=fails$z,wellKnownSymbol$m=wellKnownSymbol$r,V8_VERSION$2=engineV8Version,SPECIES$4=wellKnownSymbol$m("species"),arrayMethodHasSpeciesSupport$5=function(e){return V8_VERSION$2>=51||!fails$q((function(){var t=[];return(t.constructor={})[SPECIES$4]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},$$1H=_export,fails$p=fails$z,isArray$b=isArray$d,isObject$g=isObject$m,toObject$a=toObject$c,lengthOfArrayLike$9=lengthOfArrayLike$a,doesNotExceedSafeInteger$1=doesNotExceedSafeInteger$2,createProperty$5=createProperty$6,arraySpeciesCreate$2=arraySpeciesCreate$3,arrayMethodHasSpeciesSupport$4=arrayMethodHasSpeciesSupport$5,wellKnownSymbol$l=wellKnownSymbol$r,V8_VERSION$1=engineV8Version,IS_CONCAT_SPREADABLE=wellKnownSymbol$l("isConcatSpreadable"),IS_CONCAT_SPREADABLE_SUPPORT=V8_VERSION$1>=51||!fails$p((function(){var e=[];return e[IS_CONCAT_SPREADABLE]=!1,e.concat()[0]!==e})),isConcatSpreadable=function(e){if(!isObject$g(e))return!1;var t=e[IS_CONCAT_SPREADABLE];return void 0!==t?!!t:isArray$b(e)},FORCED$8=!IS_CONCAT_SPREADABLE_SUPPORT||!arrayMethodHasSpeciesSupport$4("concat");$$1H({target:"Array",proto:!0,arity:1,forced:FORCED$8},{concat:function(e){var t,r,n,o,i,a=toObject$a(this),s=arraySpeciesCreate$2(a,0),c=0;for(t=-1,n=arguments.length;t<n;t++)if(isConcatSpreadable(i=-1===t?a:arguments[t]))for(o=lengthOfArrayLike$9(i),doesNotExceedSafeInteger$1(c+o),r=0;r<o;r++,c++)r in i&&createProperty$5(s,c,i[r]);else doesNotExceedSafeInteger$1(c+1),createProperty$5(s,c++,i);return s.length=c,s}});var classof$c=classof$e,$String$2=String,toString$g=function(e){if("Symbol"===classof$c(e))throw TypeError("Cannot convert a Symbol value to a string");return $String$2(e)},objectDefineProperties={},toIntegerOrInfinity$4=toIntegerOrInfinity$6,max$4=Math.max,min$1=Math.min,toAbsoluteIndex$5=function(e,t){var r=toIntegerOrInfinity$4(e);return r<0?max$4(r+t,0):min$1(r,t)},toIndexedObject$8=toIndexedObject$a,toAbsoluteIndex$4=toAbsoluteIndex$5,lengthOfArrayLike$8=lengthOfArrayLike$a,createMethod$5=function(e){return function(t,r,n){var o,i=toIndexedObject$8(t),a=lengthOfArrayLike$8(i),s=toAbsoluteIndex$4(n,a);if(e&&r!=r){for(;a>s;)if((o=i[s++])!=o)return!0}else for(;a>s;s++)if((e||s in i)&&i[s]===r)return e||s||0;return!e&&-1}},arrayIncludes={includes:createMethod$5(!0),indexOf:createMethod$5(!1)},hiddenKeys$6={},uncurryThis$t=functionUncurryThis,hasOwn$j=hasOwnProperty_1,toIndexedObject$7=toIndexedObject$a,indexOf$7=arrayIncludes.indexOf,hiddenKeys$5=hiddenKeys$6,push$c=uncurryThis$t([].push),objectKeysInternal=function(e,t){var r,n=toIndexedObject$7(e),o=0,i=[];for(r in n)!hasOwn$j(hiddenKeys$5,r)&&hasOwn$j(n,r)&&push$c(i,r);for(;t.length>o;)hasOwn$j(n,r=t[o++])&&(~indexOf$7(i,r)||push$c(i,r));return i},enumBugKeys$3=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],internalObjectKeys$1=objectKeysInternal,enumBugKeys$2=enumBugKeys$3,objectKeys$3=Object.keys||function(e){return internalObjectKeys$1(e,enumBugKeys$2)},DESCRIPTORS$e=descriptors,V8_PROTOTYPE_DEFINE_BUG=v8PrototypeDefineBug,definePropertyModule$2=objectDefineProperty,anObject$g=anObject$i,toIndexedObject$6=toIndexedObject$a,objectKeys$2=objectKeys$3;objectDefineProperties.f=DESCRIPTORS$e&&!V8_PROTOTYPE_DEFINE_BUG?Object.defineProperties:function(e,t){anObject$g(e);for(var r,n=toIndexedObject$6(t),o=objectKeys$2(t),i=o.length,a=0;i>a;)definePropertyModule$2.f(e,r=o[a++],n[r]);return e};var activeXDocument,getBuiltIn$g=getBuiltIn$j,html$2=getBuiltIn$g("document","documentElement"),shared$5=sharedExports,uid$2=uid$4,keys$6=shared$5("keys"),sharedKey$4=function(e){return keys$6[e]||(keys$6[e]=uid$2(e))},anObject$f=anObject$i,definePropertiesModule$1=objectDefineProperties,enumBugKeys$1=enumBugKeys$3,hiddenKeys$4=hiddenKeys$6,html$1=html$2,documentCreateElement=documentCreateElement$1,sharedKey$3=sharedKey$4,GT=">",LT="<",PROTOTYPE$1="prototype",SCRIPT="script",IE_PROTO$1=sharedKey$3("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return LT+SCRIPT+GT+e+LT+"/"+SCRIPT+GT},NullProtoObjectViaActiveX=function(e){e.write(scriptTag("")),e.close();var t=e.parentWindow.Object;return e=null,t},NullProtoObjectViaIFrame=function(){var e,t=documentCreateElement("iframe"),r="java"+SCRIPT+":";return t.style.display="none",html$1.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(scriptTag("document.F=Object")),e.close(),e.F},NullProtoObject=function(){try{activeXDocument=new ActiveXObject("htmlfile")}catch(e){}NullProtoObject="undefined"!=typeof document?document.domain&&activeXDocument?NullProtoObjectViaActiveX(activeXDocument):NullProtoObjectViaIFrame():NullProtoObjectViaActiveX(activeXDocument);for(var e=enumBugKeys$1.length;e--;)delete NullProtoObject[PROTOTYPE$1][enumBugKeys$1[e]];return NullProtoObject()};hiddenKeys$4[IE_PROTO$1]=!0;var objectCreate=Object.create||function(e,t){var r;return null!==e?(EmptyConstructor[PROTOTYPE$1]=anObject$f(e),r=new EmptyConstructor,EmptyConstructor[PROTOTYPE$1]=null,r[IE_PROTO$1]=e):r=NullProtoObject(),void 0===t?r:definePropertiesModule$1.f(r,t)},objectGetOwnPropertyNames={},internalObjectKeys=objectKeysInternal,enumBugKeys=enumBugKeys$3,hiddenKeys$3=enumBugKeys.concat("length","prototype");objectGetOwnPropertyNames.f=Object.getOwnPropertyNames||function(e){return internalObjectKeys(e,hiddenKeys$3)};var objectGetOwnPropertyNamesExternal={},toAbsoluteIndex$3=toAbsoluteIndex$5,lengthOfArrayLike$7=lengthOfArrayLike$a,createProperty$4=createProperty$6,$Array$2=Array,max$3=Math.max,arraySliceSimple=function(e,t,r){for(var n=lengthOfArrayLike$7(e),o=toAbsoluteIndex$3(t,n),i=toAbsoluteIndex$3(void 0===r?n:r,n),a=$Array$2(max$3(i-o,0)),s=0;o<i;o++,s++)createProperty$4(a,s,e[o]);return a.length=s,a},classof$b=classofRaw$2,toIndexedObject$5=toIndexedObject$a,$getOwnPropertyNames$1=objectGetOwnPropertyNames.f,arraySlice$8=arraySliceSimple,windowNames="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],getWindowNames=function(e){try{return $getOwnPropertyNames$1(e)}catch(e){return arraySlice$8(windowNames)}};objectGetOwnPropertyNamesExternal.f=function(e){return windowNames&&"Window"==classof$b(e)?getWindowNames(e):$getOwnPropertyNames$1(toIndexedObject$5(e))};var objectGetOwnPropertySymbols={};objectGetOwnPropertySymbols.f=Object.getOwnPropertySymbols;var createNonEnumerableProperty$7=createNonEnumerableProperty$9,defineBuiltIn$8=function(e,t,r,n){return n&&n.enumerable?e[t]=r:createNonEnumerableProperty$7(e,t,r),e},defineProperty$6=objectDefineProperty,defineBuiltInAccessor$5=function(e,t,r){return defineProperty$6.f(e,t,r)},wellKnownSymbolWrapped={},wellKnownSymbol$k=wellKnownSymbol$r;wellKnownSymbolWrapped.f=wellKnownSymbol$k;var set$d,get$9,has$7,path$s=path$w,hasOwn$i=hasOwnProperty_1,wrappedWellKnownSymbolModule$1=wellKnownSymbolWrapped,defineProperty$5=objectDefineProperty.f,wellKnownSymbolDefine=function(e){var t=path$s.Symbol||(path$s.Symbol={});hasOwn$i(t,e)||defineProperty$5(t,e,{value:wrappedWellKnownSymbolModule$1.f(e)})},call$u=functionCall,getBuiltIn$f=getBuiltIn$j,wellKnownSymbol$j=wellKnownSymbol$r,defineBuiltIn$7=defineBuiltIn$8,symbolDefineToPrimitive=function(){var e=getBuiltIn$f("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,n=wellKnownSymbol$j("toPrimitive");t&&!t[n]&&defineBuiltIn$7(t,n,(function(e){return call$u(r,this)}),{arity:1})},TO_STRING_TAG_SUPPORT$1=toStringTagSupport,classof$a=classof$e,objectToString=TO_STRING_TAG_SUPPORT$1?{}.toString:function(){return"[object "+classof$a(this)+"]"},TO_STRING_TAG_SUPPORT=toStringTagSupport,defineProperty$4=objectDefineProperty.f,createNonEnumerableProperty$6=createNonEnumerableProperty$9,hasOwn$h=hasOwnProperty_1,toString$f=objectToString,wellKnownSymbol$i=wellKnownSymbol$r,TO_STRING_TAG$2=wellKnownSymbol$i("toStringTag"),setToStringTag$9=function(e,t,r,n){if(e){var o=r?e:e.prototype;hasOwn$h(o,TO_STRING_TAG$2)||defineProperty$4(o,TO_STRING_TAG$2,{configurable:!0,value:t}),n&&!TO_STRING_TAG_SUPPORT&&createNonEnumerableProperty$6(o,"toString",toString$f)}},global$j=global$s,isCallable$g=isCallable$r,WeakMap$1=global$j.WeakMap,weakMapBasicDetection=isCallable$g(WeakMap$1)&&/native code/.test(String(WeakMap$1)),NATIVE_WEAK_MAP=weakMapBasicDetection,global$i=global$s,isObject$f=isObject$m,createNonEnumerableProperty$5=createNonEnumerableProperty$9,hasOwn$g=hasOwnProperty_1,shared$4=sharedStore,sharedKey$2=sharedKey$4,hiddenKeys$2=hiddenKeys$6,OBJECT_ALREADY_INITIALIZED="Object already initialized",TypeError$5=global$i.TypeError,WeakMap=global$i.WeakMap,enforce=function(e){return has$7(e)?get$9(e):set$d(e,{})},getterFor=function(e){return function(t){var r;if(!isObject$f(t)||(r=get$9(t)).type!==e)throw TypeError$5("Incompatible receiver, "+e+" required");return r}};if(NATIVE_WEAK_MAP||shared$4.state){var store=shared$4.state||(shared$4.state=new WeakMap);store.get=store.get,store.has=store.has,store.set=store.set,set$d=function(e,t){if(store.has(e))throw TypeError$5(OBJECT_ALREADY_INITIALIZED);return t.facade=e,store.set(e,t),t},get$9=function(e){return store.get(e)||{}},has$7=function(e){return store.has(e)}}else{var STATE=sharedKey$2("state");hiddenKeys$2[STATE]=!0,set$d=function(e,t){if(hasOwn$g(e,STATE))throw TypeError$5(OBJECT_ALREADY_INITIALIZED);return t.facade=e,createNonEnumerableProperty$5(e,STATE,t),t},get$9=function(e){return hasOwn$g(e,STATE)?e[STATE]:{}},has$7=function(e){return hasOwn$g(e,STATE)}}var internalState={set:set$d,get:get$9,has:has$7,enforce:enforce,getterFor:getterFor},bind$u=functionBindContext,uncurryThis$s=functionUncurryThis,IndexedObject$2=indexedObject,toObject$9=toObject$c,lengthOfArrayLike$6=lengthOfArrayLike$a,arraySpeciesCreate$1=arraySpeciesCreate$3,push$b=uncurryThis$s([].push),createMethod$4=function(e){var t=1==e,r=2==e,n=3==e,o=4==e,i=6==e,a=7==e,s=5==e||i;return function(c,l,u,p){for(var $,f,d=toObject$9(c),y=IndexedObject$2(d),h=bind$u(l,u),_=lengthOfArrayLike$6(y),g=0,m=p||arraySpeciesCreate$1,v=t?m(c,_):r||a?m(c,0):void 0;_>g;g++)if((s||g in y)&&(f=h($=y[g],g,d),e))if(t)v[g]=f;else if(f)switch(e){case 3:return!0;case 5:return $;case 6:return g;case 2:push$b(v,$)}else switch(e){case 4:return!1;case 7:push$b(v,$)}return i?-1:n||o?o:v}},arrayIteration={forEach:createMethod$4(0),map:createMethod$4(1),filter:createMethod$4(2),some:createMethod$4(3),every:createMethod$4(4),find:createMethod$4(5),findIndex:createMethod$4(6),filterReject:createMethod$4(7)},$$1G=_export,global$h=global$s,call$t=functionCall,uncurryThis$r=functionUncurryThis,DESCRIPTORS$d=descriptors,NATIVE_SYMBOL$3=symbolConstructorDetection,fails$o=fails$z,hasOwn$f=hasOwnProperty_1,isPrototypeOf$o=objectIsPrototypeOf,anObject$e=anObject$i,toIndexedObject$4=toIndexedObject$a,toPropertyKey=toPropertyKey$4,$toString$2=toString$g,createPropertyDescriptor$4=createPropertyDescriptor$8,nativeObjectCreate=objectCreate,objectKeys$1=objectKeys$3,getOwnPropertyNamesModule$2=objectGetOwnPropertyNames,getOwnPropertyNamesExternal=objectGetOwnPropertyNamesExternal,getOwnPropertySymbolsModule$3=objectGetOwnPropertySymbols,getOwnPropertyDescriptorModule$3=objectGetOwnPropertyDescriptor,definePropertyModule$1=objectDefineProperty,definePropertiesModule=objectDefineProperties,propertyIsEnumerableModule$1=objectPropertyIsEnumerable,defineBuiltIn$6=defineBuiltIn$8,defineBuiltInAccessor$4=defineBuiltInAccessor$5,shared$3=sharedExports,sharedKey$1=sharedKey$4,hiddenKeys$1=hiddenKeys$6,uid$1=uid$4,wellKnownSymbol$h=wellKnownSymbol$r,wrappedWellKnownSymbolModule=wellKnownSymbolWrapped,defineWellKnownSymbol$l=wellKnownSymbolDefine,defineSymbolToPrimitive$1=symbolDefineToPrimitive,setToStringTag$8=setToStringTag$9,InternalStateModule$7=internalState,$forEach$1=arrayIteration.forEach,HIDDEN=sharedKey$1("hidden"),SYMBOL="Symbol",PROTOTYPE="prototype",setInternalState$7=InternalStateModule$7.set,getInternalState$2=InternalStateModule$7.getterFor(SYMBOL),ObjectPrototype$2=Object[PROTOTYPE],$Symbol=global$h.Symbol,SymbolPrototype=$Symbol&&$Symbol[PROTOTYPE],TypeError$4=global$h.TypeError,QObject=global$h.QObject,nativeGetOwnPropertyDescriptor$1=getOwnPropertyDescriptorModule$3.f,nativeDefineProperty=definePropertyModule$1.f,nativeGetOwnPropertyNames=getOwnPropertyNamesExternal.f,nativePropertyIsEnumerable=propertyIsEnumerableModule$1.f,push$a=uncurryThis$r([].push),AllSymbols=shared$3("symbols"),ObjectPrototypeSymbols=shared$3("op-symbols"),WellKnownSymbolsStore$1=shared$3("wks"),USE_SETTER=!QObject||!QObject[PROTOTYPE]||!QObject[PROTOTYPE].findChild,setSymbolDescriptor=DESCRIPTORS$d&&fails$o((function(){return 7!=nativeObjectCreate(nativeDefineProperty({},"a",{get:function(){return nativeDefineProperty(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=nativeGetOwnPropertyDescriptor$1(ObjectPrototype$2,t);n&&delete ObjectPrototype$2[t],nativeDefineProperty(e,t,r),n&&e!==ObjectPrototype$2&&nativeDefineProperty(ObjectPrototype$2,t,n)}:nativeDefineProperty,wrap=function(e,t){var r=AllSymbols[e]=nativeObjectCreate(SymbolPrototype);return setInternalState$7(r,{type:SYMBOL,tag:e,description:t}),DESCRIPTORS$d||(r.description=t),r},$defineProperty=function(e,t,r){e===ObjectPrototype$2&&$defineProperty(ObjectPrototypeSymbols,t,r),anObject$e(e);var n=toPropertyKey(t);return anObject$e(r),hasOwn$f(AllSymbols,n)?(r.enumerable?(hasOwn$f(e,HIDDEN)&&e[HIDDEN][n]&&(e[HIDDEN][n]=!1),r=nativeObjectCreate(r,{enumerable:createPropertyDescriptor$4(0,!1)})):(hasOwn$f(e,HIDDEN)||nativeDefineProperty(e,HIDDEN,createPropertyDescriptor$4(1,{})),e[HIDDEN][n]=!0),setSymbolDescriptor(e,n,r)):nativeDefineProperty(e,n,r)},$defineProperties=function(e,t){anObject$e(e);var r=toIndexedObject$4(t),n=objectKeys$1(r).concat($getOwnPropertySymbols(r));return $forEach$1(n,(function(t){DESCRIPTORS$d&&!call$t($propertyIsEnumerable,r,t)||$defineProperty(e,t,r[t])})),e},$create=function(e,t){return void 0===t?nativeObjectCreate(e):$defineProperties(nativeObjectCreate(e),t)},$propertyIsEnumerable=function(e){var t=toPropertyKey(e),r=call$t(nativePropertyIsEnumerable,this,t);return!(this===ObjectPrototype$2&&hasOwn$f(AllSymbols,t)&&!hasOwn$f(ObjectPrototypeSymbols,t))&&(!(r||!hasOwn$f(this,t)||!hasOwn$f(AllSymbols,t)||hasOwn$f(this,HIDDEN)&&this[HIDDEN][t])||r)},$getOwnPropertyDescriptor=function(e,t){var r=toIndexedObject$4(e),n=toPropertyKey(t);if(r!==ObjectPrototype$2||!hasOwn$f(AllSymbols,n)||hasOwn$f(ObjectPrototypeSymbols,n)){var o=nativeGetOwnPropertyDescriptor$1(r,n);return!o||!hasOwn$f(AllSymbols,n)||hasOwn$f(r,HIDDEN)&&r[HIDDEN][n]||(o.enumerable=!0),o}},$getOwnPropertyNames=function(e){var t=nativeGetOwnPropertyNames(toIndexedObject$4(e)),r=[];return $forEach$1(t,(function(e){hasOwn$f(AllSymbols,e)||hasOwn$f(hiddenKeys$1,e)||push$a(r,e)})),r},$getOwnPropertySymbols=function(e){var t=e===ObjectPrototype$2,r=nativeGetOwnPropertyNames(t?ObjectPrototypeSymbols:toIndexedObject$4(e)),n=[];return $forEach$1(r,(function(e){!hasOwn$f(AllSymbols,e)||t&&!hasOwn$f(ObjectPrototype$2,e)||push$a(n,AllSymbols[e])})),n};NATIVE_SYMBOL$3||(defineBuiltIn$6(SymbolPrototype=($Symbol=function(){if(isPrototypeOf$o(SymbolPrototype,this))throw TypeError$4("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?$toString$2(arguments[0]):void 0,t=uid$1(e),r=function(e){this===ObjectPrototype$2&&call$t(r,ObjectPrototypeSymbols,e),hasOwn$f(this,HIDDEN)&&hasOwn$f(this[HIDDEN],t)&&(this[HIDDEN][t]=!1),setSymbolDescriptor(this,t,createPropertyDescriptor$4(1,e))};return DESCRIPTORS$d&&USE_SETTER&&setSymbolDescriptor(ObjectPrototype$2,t,{configurable:!0,set:r}),wrap(t,e)})[PROTOTYPE],"toString",(function(){return getInternalState$2(this).tag})),defineBuiltIn$6($Symbol,"withoutSetter",(function(e){return wrap(uid$1(e),e)})),propertyIsEnumerableModule$1.f=$propertyIsEnumerable,definePropertyModule$1.f=$defineProperty,definePropertiesModule.f=$defineProperties,getOwnPropertyDescriptorModule$3.f=$getOwnPropertyDescriptor,getOwnPropertyNamesModule$2.f=getOwnPropertyNamesExternal.f=$getOwnPropertyNames,getOwnPropertySymbolsModule$3.f=$getOwnPropertySymbols,wrappedWellKnownSymbolModule.f=function(e){return wrap(wellKnownSymbol$h(e),e)},DESCRIPTORS$d&&defineBuiltInAccessor$4(SymbolPrototype,"description",{configurable:!0,get:function(){return getInternalState$2(this).description}})),$$1G({global:!0,constructor:!0,wrap:!0,forced:!NATIVE_SYMBOL$3,sham:!NATIVE_SYMBOL$3},{Symbol:$Symbol}),$forEach$1(objectKeys$1(WellKnownSymbolsStore$1),(function(e){defineWellKnownSymbol$l(e)})),$$1G({target:SYMBOL,stat:!0,forced:!NATIVE_SYMBOL$3},{useSetter:function(){USE_SETTER=!0},useSimple:function(){USE_SETTER=!1}}),$$1G({target:"Object",stat:!0,forced:!NATIVE_SYMBOL$3,sham:!DESCRIPTORS$d},{create:$create,defineProperty:$defineProperty,defineProperties:$defineProperties,getOwnPropertyDescriptor:$getOwnPropertyDescriptor}),$$1G({target:"Object",stat:!0,forced:!NATIVE_SYMBOL$3},{getOwnPropertyNames:$getOwnPropertyNames}),defineSymbolToPrimitive$1(),setToStringTag$8($Symbol,SYMBOL),hiddenKeys$1[HIDDEN]=!0;var NATIVE_SYMBOL$2=symbolConstructorDetection,symbolRegistryDetection=NATIVE_SYMBOL$2&&!!Symbol.for&&!!Symbol.keyFor,$$1F=_export,getBuiltIn$e=getBuiltIn$j,hasOwn$e=hasOwnProperty_1,toString$e=toString$g,shared$2=sharedExports,NATIVE_SYMBOL_REGISTRY$1=symbolRegistryDetection,StringToSymbolRegistry=shared$2("string-to-symbol-registry"),SymbolToStringRegistry$1=shared$2("symbol-to-string-registry");$$1F({target:"Symbol",stat:!0,forced:!NATIVE_SYMBOL_REGISTRY$1},{for:function(e){var t=toString$e(e);if(hasOwn$e(StringToSymbolRegistry,t))return StringToSymbolRegistry[t];var r=getBuiltIn$e("Symbol")(t);return StringToSymbolRegistry[t]=r,SymbolToStringRegistry$1[r]=t,r}});var $$1E=_export,hasOwn$d=hasOwnProperty_1,isSymbol$2=isSymbol$5,tryToString$6=tryToString$8,shared$1=sharedExports,NATIVE_SYMBOL_REGISTRY=symbolRegistryDetection,SymbolToStringRegistry=shared$1("symbol-to-string-registry");$$1E({target:"Symbol",stat:!0,forced:!NATIVE_SYMBOL_REGISTRY},{keyFor:function(e){if(!isSymbol$2(e))throw TypeError(tryToString$6(e)+" is not a symbol");if(hasOwn$d(SymbolToStringRegistry,e))return SymbolToStringRegistry[e]}});var uncurryThis$q=functionUncurryThis,arraySlice$7=uncurryThis$q([].slice),uncurryThis$p=functionUncurryThis,isArray$a=isArray$d,isCallable$f=isCallable$r,classof$9=classofRaw$2,toString$d=toString$g,push$9=uncurryThis$p([].push),getJsonReplacerFunction=function(e){if(isCallable$f(e))return e;if(isArray$a(e)){for(var t=e.length,r=[],n=0;n<t;n++){var o=e[n];"string"==typeof o?push$9(r,o):"number"!=typeof o&&"Number"!=classof$9(o)&&"String"!=classof$9(o)||push$9(r,toString$d(o))}var i=r.length,a=!0;return function(e,t){if(a)return a=!1,t;if(isArray$a(this))return t;for(var n=0;n<i;n++)if(r[n]===e)return t}}},$$1D=_export,getBuiltIn$d=getBuiltIn$j,apply$4=functionApply,call$s=functionCall,uncurryThis$o=functionUncurryThis,fails$n=fails$z,isCallable$e=isCallable$r,isSymbol$1=isSymbol$5,arraySlice$6=arraySlice$7,getReplacerFunction=getJsonReplacerFunction,NATIVE_SYMBOL$1=symbolConstructorDetection,$String$1=String,$stringify=getBuiltIn$d("JSON","stringify"),exec$3=uncurryThis$o(/./.exec),charAt$5=uncurryThis$o("".charAt),charCodeAt$2=uncurryThis$o("".charCodeAt),replace$5=uncurryThis$o("".replace),numberToString$1=uncurryThis$o(1..toString),tester=/[\uD800-\uDFFF]/g,low=/^[\uD800-\uDBFF]$/,hi=/^[\uDC00-\uDFFF]$/,WRONG_SYMBOLS_CONVERSION=!NATIVE_SYMBOL$1||fails$n((function(){var e=getBuiltIn$d("Symbol")();return"[null]"!=$stringify([e])||"{}"!=$stringify({a:e})||"{}"!=$stringify(Object(e))})),ILL_FORMED_UNICODE=fails$n((function(){return'"\\udf06\\ud834"'!==$stringify("\udf06\ud834")||'"\\udead"'!==$stringify("\udead")})),stringifyWithSymbolsFix=function(e,t){var r=arraySlice$6(arguments),n=getReplacerFunction(t);if(isCallable$e(n)||void 0!==e&&!isSymbol$1(e))return r[1]=function(e,t){if(isCallable$e(n)&&(t=call$s(n,this,$String$1(e),t)),!isSymbol$1(t))return t},apply$4($stringify,null,r)},fixIllFormed=function(e,t,r){var n=charAt$5(r,t-1),o=charAt$5(r,t+1);return exec$3(low,e)&&!exec$3(hi,o)||exec$3(hi,e)&&!exec$3(low,n)?"\\u"+numberToString$1(charCodeAt$2(e,0),16):e};$stringify&&$$1D({target:"JSON",stat:!0,arity:3,forced:WRONG_SYMBOLS_CONVERSION||ILL_FORMED_UNICODE},{stringify:function(e,t,r){var n=arraySlice$6(arguments),o=apply$4(WRONG_SYMBOLS_CONVERSION?stringifyWithSymbolsFix:$stringify,null,n);return ILL_FORMED_UNICODE&&"string"==typeof o?replace$5(o,tester,fixIllFormed):o}});var $$1C=_export,NATIVE_SYMBOL=symbolConstructorDetection,fails$m=fails$z,getOwnPropertySymbolsModule$2=objectGetOwnPropertySymbols,toObject$8=toObject$c,FORCED$7=!NATIVE_SYMBOL||fails$m((function(){getOwnPropertySymbolsModule$2.f(1)}));$$1C({target:"Object",stat:!0,forced:FORCED$7},{getOwnPropertySymbols:function(e){var t=getOwnPropertySymbolsModule$2.f;return t?t(toObject$8(e)):[]}});var defineWellKnownSymbol$k=wellKnownSymbolDefine;defineWellKnownSymbol$k("asyncIterator");var defineWellKnownSymbol$j=wellKnownSymbolDefine;defineWellKnownSymbol$j("hasInstance");var defineWellKnownSymbol$i=wellKnownSymbolDefine;defineWellKnownSymbol$i("isConcatSpreadable");var defineWellKnownSymbol$h=wellKnownSymbolDefine;defineWellKnownSymbol$h("iterator");var defineWellKnownSymbol$g=wellKnownSymbolDefine;defineWellKnownSymbol$g("match");var defineWellKnownSymbol$f=wellKnownSymbolDefine;defineWellKnownSymbol$f("matchAll");var defineWellKnownSymbol$e=wellKnownSymbolDefine;defineWellKnownSymbol$e("replace");var defineWellKnownSymbol$d=wellKnownSymbolDefine;defineWellKnownSymbol$d("search");var defineWellKnownSymbol$c=wellKnownSymbolDefine;defineWellKnownSymbol$c("species");var defineWellKnownSymbol$b=wellKnownSymbolDefine;defineWellKnownSymbol$b("split");var defineWellKnownSymbol$a=wellKnownSymbolDefine,defineSymbolToPrimitive=symbolDefineToPrimitive;defineWellKnownSymbol$a("toPrimitive"),defineSymbolToPrimitive();var getBuiltIn$c=getBuiltIn$j,defineWellKnownSymbol$9=wellKnownSymbolDefine,setToStringTag$7=setToStringTag$9;defineWellKnownSymbol$9("toStringTag"),setToStringTag$7(getBuiltIn$c("Symbol"),"Symbol");var defineWellKnownSymbol$8=wellKnownSymbolDefine;defineWellKnownSymbol$8("unscopables");var global$g=global$s,setToStringTag$6=setToStringTag$9;setToStringTag$6(global$g.JSON,"JSON",!0);var IteratorPrototype$1,PrototypeOfArrayIteratorPrototype,arrayIterator,path$r=path$w,symbol$5=path$r.Symbol,iterators={},DESCRIPTORS$c=descriptors,hasOwn$c=hasOwnProperty_1,FunctionPrototype$1=Function.prototype,getDescriptor=DESCRIPTORS$c&&Object.getOwnPropertyDescriptor,EXISTS=hasOwn$c(FunctionPrototype$1,"name"),PROPER=EXISTS&&"something"===function(){}.name,CONFIGURABLE=EXISTS&&(!DESCRIPTORS$c||DESCRIPTORS$c&&getDescriptor(FunctionPrototype$1,"name").configurable),functionName={EXISTS:EXISTS,PROPER:PROPER,CONFIGURABLE:CONFIGURABLE},fails$l=fails$z,correctPrototypeGetter=!fails$l((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),hasOwn$b=hasOwnProperty_1,isCallable$d=isCallable$r,toObject$7=toObject$c,sharedKey=sharedKey$4,CORRECT_PROTOTYPE_GETTER$1=correctPrototypeGetter,IE_PROTO=sharedKey("IE_PROTO"),$Object$1=Object,ObjectPrototype$1=$Object$1.prototype,objectGetPrototypeOf=CORRECT_PROTOTYPE_GETTER$1?$Object$1.getPrototypeOf:function(e){var t=toObject$7(e);if(hasOwn$b(t,IE_PROTO))return t[IE_PROTO];var r=t.constructor;return isCallable$d(r)&&t instanceof r?r.prototype:t instanceof $Object$1?ObjectPrototype$1:null},fails$k=fails$z,isCallable$c=isCallable$r,isObject$e=isObject$m,create$c=objectCreate,getPrototypeOf$9=objectGetPrototypeOf,defineBuiltIn$5=defineBuiltIn$8,wellKnownSymbol$g=wellKnownSymbol$r,ITERATOR$9=wellKnownSymbol$g("iterator"),BUGGY_SAFARI_ITERATORS$1=!1;[].keys&&("next"in(arrayIterator=[].keys())?(PrototypeOfArrayIteratorPrototype=getPrototypeOf$9(getPrototypeOf$9(arrayIterator)))!==Object.prototype&&(IteratorPrototype$1=PrototypeOfArrayIteratorPrototype):BUGGY_SAFARI_ITERATORS$1=!0);var NEW_ITERATOR_PROTOTYPE=!isObject$e(IteratorPrototype$1)||fails$k((function(){var e={};return IteratorPrototype$1[ITERATOR$9].call(e)!==e}));isCallable$c((IteratorPrototype$1=NEW_ITERATOR_PROTOTYPE?{}:create$c(IteratorPrototype$1))[ITERATOR$9])||defineBuiltIn$5(IteratorPrototype$1,ITERATOR$9,(function(){return this}));var iteratorsCore={IteratorPrototype:IteratorPrototype$1,BUGGY_SAFARI_ITERATORS:BUGGY_SAFARI_ITERATORS$1},IteratorPrototype=iteratorsCore.IteratorPrototype,create$b=objectCreate,createPropertyDescriptor$3=createPropertyDescriptor$8,setToStringTag$5=setToStringTag$9,Iterators$6=iterators,returnThis$1=function(){return this},iteratorCreateConstructor=function(e,t,r,n){var o=t+" Iterator";return e.prototype=create$b(IteratorPrototype,{next:createPropertyDescriptor$3(+!n,r)}),setToStringTag$5(e,o,!1,!0),Iterators$6[o]=returnThis$1,e},uncurryThis$n=functionUncurryThis,aCallable$i=aCallable$l,functionUncurryThisAccessor=function(e,t,r){try{return uncurryThis$n(aCallable$i(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}},isCallable$b=isCallable$r,$String=String,$TypeError$f=TypeError,aPossiblePrototype$1=function(e){if("object"==typeof e||isCallable$b(e))return e;throw $TypeError$f("Can't set "+$String(e)+" as a prototype")},uncurryThisAccessor=functionUncurryThisAccessor,anObject$d=anObject$i,aPossiblePrototype=aPossiblePrototype$1,objectSetPrototypeOf=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=uncurryThisAccessor(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return anObject$d(r),aPossiblePrototype(n),t?e(r,n):r.__proto__=n,r}}():void 0),$$1B=_export,call$r=functionCall,FunctionName=functionName,createIteratorConstructor$1=iteratorCreateConstructor,getPrototypeOf$8=objectGetPrototypeOf,setToStringTag$4=setToStringTag$9,defineBuiltIn$4=defineBuiltIn$8,wellKnownSymbol$f=wellKnownSymbol$r,Iterators$5=iterators,IteratorsCore=iteratorsCore,PROPER_FUNCTION_NAME$1=FunctionName.PROPER;FunctionName.CONFIGURABLE,IteratorsCore.IteratorPrototype;var BUGGY_SAFARI_ITERATORS=IteratorsCore.BUGGY_SAFARI_ITERATORS,ITERATOR$8=wellKnownSymbol$f("iterator"),KEYS="keys",VALUES="values",ENTRIES="entries",returnThis=function(){return this},iteratorDefine=function(e,t,r,n,o,i,a){createIteratorConstructor$1(r,t,n);var s,c,l,u=function(e){if(e===o&&y)return y;if(!BUGGY_SAFARI_ITERATORS&&e in f)return f[e];switch(e){case KEYS:case VALUES:case ENTRIES:return function(){return new r(this,e)}}return function(){return new r(this)}},p=t+" Iterator",$=!1,f=e.prototype,d=f[ITERATOR$8]||f["@@iterator"]||o&&f[o],y=!BUGGY_SAFARI_ITERATORS&&d||u(o),h="Array"==t&&f.entries||d;if(h&&(s=getPrototypeOf$8(h.call(new e)))!==Object.prototype&&s.next&&(setToStringTag$4(s,p,!0,!0),Iterators$5[p]=returnThis),PROPER_FUNCTION_NAME$1&&o==VALUES&&d&&d.name!==VALUES&&($=!0,y=function(){return call$r(d,this)}),o)if(c={values:u(VALUES),keys:i?y:u(KEYS),entries:u(ENTRIES)},a)for(l in c)(BUGGY_SAFARI_ITERATORS||$||!(l in f))&&defineBuiltIn$4(f,l,c[l]);else $$1B({target:t,proto:!0,forced:BUGGY_SAFARI_ITERATORS||$},c);return a&&f[ITERATOR$8]!==y&&defineBuiltIn$4(f,ITERATOR$8,y,{name:o}),Iterators$5[t]=y,c},createIterResultObject$3=function(e,t){return{value:e,done:t}},toIndexedObject$3=toIndexedObject$a,Iterators$4=iterators,InternalStateModule$6=internalState;objectDefineProperty.f;var defineIterator$2=iteratorDefine,createIterResultObject$2=createIterResultObject$3,ARRAY_ITERATOR="Array Iterator",setInternalState$6=InternalStateModule$6.set,getInternalState$1=InternalStateModule$6.getterFor(ARRAY_ITERATOR);defineIterator$2(Array,"Array",(function(e,t){setInternalState$6(this,{type:ARRAY_ITERATOR,target:toIndexedObject$3(e),index:0,kind:t})}),(function(){var e=getInternalState$1(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,createIterResultObject$2(void 0,!0)):createIterResultObject$2("keys"==r?n:"values"==r?t[n]:[n,t[n]],!1)}),"values"),Iterators$4.Arguments=Iterators$4.Array;var domIterables={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},DOMIterables$2=domIterables,global$f=global$s,classof$8=classof$e,createNonEnumerableProperty$4=createNonEnumerableProperty$9,Iterators$3=iterators,wellKnownSymbol$e=wellKnownSymbol$r,TO_STRING_TAG$1=wellKnownSymbol$e("toStringTag");for(var COLLECTION_NAME in DOMIterables$2){var Collection=global$f[COLLECTION_NAME],CollectionPrototype=Collection&&Collection.prototype;CollectionPrototype&&classof$8(CollectionPrototype)!==TO_STRING_TAG$1&&createNonEnumerableProperty$4(CollectionPrototype,TO_STRING_TAG$1,COLLECTION_NAME),Iterators$3[COLLECTION_NAME]=Iterators$3.Array}var parent$2j=symbol$5,symbol$4=parent$2j,defineWellKnownSymbol$7=wellKnownSymbolDefine;defineWellKnownSymbol$7("dispose");var parent$2i=symbol$4,symbol$3=parent$2i,defineWellKnownSymbol$6=wellKnownSymbolDefine;defineWellKnownSymbol$6("asyncDispose");var $$1A=_export,getBuiltIn$b=getBuiltIn$j,uncurryThis$m=functionUncurryThis,Symbol$4=getBuiltIn$b("Symbol"),keyFor2=Symbol$4.keyFor,thisSymbolValue$1=uncurryThis$m(Symbol$4.prototype.valueOf);$$1A({target:"Symbol",stat:!0},{isRegistered:function(e){try{return void 0!==keyFor2(thisSymbolValue$1(e))}catch(e){return!1}}});for(var $$1z=_export,shared=sharedExports,getBuiltIn$a=getBuiltIn$j,uncurryThis$l=functionUncurryThis,isSymbol=isSymbol$5,wellKnownSymbol$d=wellKnownSymbol$r,Symbol$3=getBuiltIn$a("Symbol"),$isWellKnown=Symbol$3.isWellKnown,getOwnPropertyNames4=getBuiltIn$a("Object","getOwnPropertyNames"),thisSymbolValue=uncurryThis$l(Symbol$3.prototype.valueOf),WellKnownSymbolsStore=shared("wks"),i=0,symbolKeys=getOwnPropertyNames4(Symbol$3),symbolKeysLength=symbolKeys.length;i<symbolKeysLength;i++)try{var symbolKey=symbolKeys[i];isSymbol(Symbol$3[symbolKey])&&wellKnownSymbol$d(symbolKey)}catch(e){}$$1z({target:"Symbol",stat:!0,forced:!0},{isWellKnown:function(e){if($isWellKnown&&$isWellKnown(e))return!0;try{for(var t=thisSymbolValue(e),r=0,n=getOwnPropertyNames4(WellKnownSymbolsStore),o=n.length;r<o;r++)if(WellKnownSymbolsStore[n[r]]==t)return!0}catch(e){}return!1}});var defineWellKnownSymbol$5=wellKnownSymbolDefine;defineWellKnownSymbol$5("matcher");var defineWellKnownSymbol$4=wellKnownSymbolDefine;defineWellKnownSymbol$4("metadataKey");var defineWellKnownSymbol$3=wellKnownSymbolDefine;defineWellKnownSymbol$3("observable");var defineWellKnownSymbol$2=wellKnownSymbolDefine;defineWellKnownSymbol$2("metadata");var defineWellKnownSymbol$1=wellKnownSymbolDefine;defineWellKnownSymbol$1("patternMatch");var defineWellKnownSymbol=wellKnownSymbolDefine;defineWellKnownSymbol("replaceAll");var parent$2h=symbol$3,symbol$2=parent$2h,symbol$1=symbol$2,_Symbol$1=getDefaultExportFromCjs(symbol$1),uncurryThis$k=functionUncurryThis,toIntegerOrInfinity$3=toIntegerOrInfinity$6,toString$c=toString$g,requireObjectCoercible$4=requireObjectCoercible$7,charAt$4=uncurryThis$k("".charAt),charCodeAt$1=uncurryThis$k("".charCodeAt),stringSlice$3=uncurryThis$k("".slice),createMethod$3=function(e){return function(t,r){var n,o,i=toString$c(requireObjectCoercible$4(t)),a=toIntegerOrInfinity$3(r),s=i.length;return a<0||a>=s?e?"":void 0:(n=charCodeAt$1(i,a))<55296||n>56319||a+1===s||(o=charCodeAt$1(i,a+1))<56320||o>57343?e?charAt$4(i,a):n:e?stringSlice$3(i,a,a+2):o-56320+(n-55296<<10)+65536}},stringMultibyte={codeAt:createMethod$3(!1),charAt:createMethod$3(!0)},charAt$3=stringMultibyte.charAt,toString$b=toString$g,InternalStateModule$5=internalState,defineIterator$1=iteratorDefine,createIterResultObject$1=createIterResultObject$3,STRING_ITERATOR="String Iterator",setInternalState$5=InternalStateModule$5.set,getInternalState=InternalStateModule$5.getterFor(STRING_ITERATOR);defineIterator$1(String,"String",(function(e){setInternalState$5(this,{type:STRING_ITERATOR,string:toString$b(e),index:0})}),(function(){var e,t=getInternalState(this),r=t.string,n=t.index;return n>=r.length?createIterResultObject$1(void 0,!0):(e=charAt$3(r,n),t.index+=e.length,createIterResultObject$1(e,!1))}));var WrappedWellKnownSymbolModule$1=wellKnownSymbolWrapped,iterator$5=WrappedWellKnownSymbolModule$1.f("iterator"),parent$2g=iterator$5,iterator$4=parent$2g,parent$2f=iterator$4,iterator$3=parent$2f,parent$2e=iterator$3,iterator$2=parent$2e,iterator$1=iterator$2,_Symbol$iterator$1=getDefaultExportFromCjs(iterator$1);function _typeof$3(e){return(_typeof$3="function"==typeof _Symbol$1&&"symbol"==typeof _Symbol$iterator$1?function(e){return typeof e}:function(e){return e&&"function"==typeof _Symbol$1&&e.constructor===_Symbol$1&&e!==_Symbol$1.prototype?"symbol":typeof e})(e)}var WrappedWellKnownSymbolModule=wellKnownSymbolWrapped,toPrimitive$5=WrappedWellKnownSymbolModule.f("toPrimitive"),parent$2d=toPrimitive$5,toPrimitive$4=parent$2d,parent$2c=toPrimitive$4,toPrimitive$3=parent$2c,parent$2b=toPrimitive$3,toPrimitive$2=parent$2b,toPrimitive$1=toPrimitive$2,_Symbol$toPrimitive$1=getDefaultExportFromCjs(toPrimitive$1);function _toPrimitive$5(e,t){if("object"!==_typeof$3(e)||null===e)return e;var r=e[_Symbol$toPrimitive$1];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof$3(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey$5(e){var t=_toPrimitive$5(e,"string");return"symbol"===_typeof$3(t)?t:String(t)}function _defineProperties$5(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),_Object$defineProperty$1(e,_toPropertyKey$5(n.key),n)}}function _createClass$5(e,t,r){return t&&_defineProperties$5(e.prototype,t),r&&_defineProperties$5(e,r),_Object$defineProperty$1(e,"prototype",{writable:!1}),e}function _assertThisInitialized$4(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var hasOwn$a=hasOwnProperty_1,isDataDescriptor$1=function(e){return void 0!==e&&(hasOwn$a(e,"value")||hasOwn$a(e,"writable"))},$$1y=_export,call$q=functionCall,isObject$d=isObject$m,anObject$c=anObject$i,isDataDescriptor=isDataDescriptor$1,getOwnPropertyDescriptorModule$2=objectGetOwnPropertyDescriptor,getPrototypeOf$7=objectGetPrototypeOf;function get$8(e,t){var r,n,o=arguments.length<3?e:arguments[2];return anObject$c(e)===o?e[t]:(r=getOwnPropertyDescriptorModule$2.f(e,t))?isDataDescriptor(r)?r.value:void 0===r.get?void 0:call$q(r.get,o):isObject$d(n=getPrototypeOf$7(e))?get$8(n,t,o):void 0}$$1y({target:"Reflect",stat:!0},{get:get$8});var path$q=path$w,get$7=path$q.Reflect.get,parent$2a=get$7,get$6=parent$2a,parent$29=get$6,get$5=parent$29,parent$28=get$5,get$4=parent$28,get$3=get$4,_Reflect$get$1=getDefaultExportFromCjs(get$3),uncurryThis$j=functionUncurryThis,aCallable$h=aCallable$l,isObject$c=isObject$m,hasOwn$9=hasOwnProperty_1,arraySlice$5=arraySlice$7,NATIVE_BIND=functionBindNative,$Function=Function,concat$9=uncurryThis$j([].concat),join$4=uncurryThis$j([].join),factories={},construct$6=function(e,t,r){if(!hasOwn$9(factories,t)){for(var n=[],o=0;o<t;o++)n[o]="a["+o+"]";factories[t]=$Function("C,a","return new C("+join$4(n,",")+")")}return factories[t](e,r)},functionBind=NATIVE_BIND?$Function.bind:function(e){var t=aCallable$h(this),r=t.prototype,n=arraySlice$5(arguments,1),o=function(){var r=concat$9(n,arraySlice$5(arguments));return this instanceof o?construct$6(t,r.length,r):t.apply(e,r)};return isObject$c(r)&&(o.prototype=r),o},$$1x=_export,bind$t=functionBind;$$1x({target:"Function",proto:!0,forced:Function.bind!==bind$t},{bind:bind$t});var path$p=path$w,entryVirtual$k=function(e){return path$p[e+"Prototype"]},entryVirtual$j=entryVirtual$k,bind$s=entryVirtual$j("Function").bind,isPrototypeOf$n=objectIsPrototypeOf,method$h=bind$s,FunctionPrototype=Function.prototype,bind$r=function(e){var t=e.bind;return e===FunctionPrototype||isPrototypeOf$n(FunctionPrototype,e)&&t===FunctionPrototype.bind?method$h:t},parent$27=bind$r,bind$q=parent$27,parent$26=bind$q,bind$p=parent$26,parent$25=bind$p,bind$o=parent$25,bind$n=bind$o,_bindInstanceProperty$1=getDefaultExportFromCjs(bind$n),getOwnPropertyDescriptor$9={exports:{}},$$1w=_export,fails$j=fails$z,toIndexedObject$2=toIndexedObject$a,nativeGetOwnPropertyDescriptor=objectGetOwnPropertyDescriptor.f,DESCRIPTORS$b=descriptors,FORCED$6=!DESCRIPTORS$b||fails$j((function(){nativeGetOwnPropertyDescriptor(1)}));$$1w({target:"Object",stat:!0,forced:FORCED$6,sham:!DESCRIPTORS$b},{getOwnPropertyDescriptor:function(e,t){return nativeGetOwnPropertyDescriptor(toIndexedObject$2(e),t)}});var path$o=path$w,Object$3=path$o.Object,getOwnPropertyDescriptor$8=getOwnPropertyDescriptor$9.exports=function(e,t){return Object$3.getOwnPropertyDescriptor(e,t)};Object$3.getOwnPropertyDescriptor.sham&&(getOwnPropertyDescriptor$8.sham=!0);var getOwnPropertyDescriptorExports=getOwnPropertyDescriptor$9.exports,parent$24=getOwnPropertyDescriptorExports,getOwnPropertyDescriptor$7=parent$24,parent$23=getOwnPropertyDescriptor$7,getOwnPropertyDescriptor$6=parent$23,parent$22=getOwnPropertyDescriptor$6,getOwnPropertyDescriptor$5=parent$22,getOwnPropertyDescriptor$4=getOwnPropertyDescriptor$5,_Object$getOwnPropertyDescriptor$1=getDefaultExportFromCjs(getOwnPropertyDescriptor$4),$$1v=_export,setPrototypeOf$7=objectSetPrototypeOf;$$1v({target:"Object",stat:!0},{setPrototypeOf:setPrototypeOf$7});var path$n=path$w,setPrototypeOf$6=path$n.Object.setPrototypeOf,parent$21=setPrototypeOf$6,setPrototypeOf$5=parent$21,parent$20=setPrototypeOf$5,setPrototypeOf$4=parent$20,parent$1$=setPrototypeOf$4,setPrototypeOf$3=parent$1$,setPrototypeOf$2=setPrototypeOf$3,_Object$setPrototypeOf$1=getDefaultExportFromCjs(setPrototypeOf$2),$$1u=_export,fails$i=fails$z,toObject$6=toObject$c,nativeGetPrototypeOf=objectGetPrototypeOf,CORRECT_PROTOTYPE_GETTER=correctPrototypeGetter,FAILS_ON_PRIMITIVES$2=fails$i((function(){nativeGetPrototypeOf(1)}));$$1u({target:"Object",stat:!0,forced:FAILS_ON_PRIMITIVES$2,sham:!CORRECT_PROTOTYPE_GETTER},{getPrototypeOf:function(e){return nativeGetPrototypeOf(toObject$6(e))}});var path$m=path$w,getPrototypeOf$6=path$m.Object.getPrototypeOf,parent$1_=getPrototypeOf$6,getPrototypeOf$5=parent$1_,parent$1Z=getPrototypeOf$5,getPrototypeOf$4=parent$1Z,parent$1Y=getPrototypeOf$4,getPrototypeOf$3=parent$1Y,getPrototypeOf$2=getPrototypeOf$3,_Object$getPrototypeOf$1=getDefaultExportFromCjs(getPrototypeOf$2);function _getPrototypeOf$4(e){var t;return(_getPrototypeOf$4=_Object$setPrototypeOf$1?_bindInstanceProperty$1(t=_Object$getPrototypeOf$1).call(t):function(e){return e.__proto__||_Object$getPrototypeOf$1(e)})(e)}function _superPropBase$1(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf$4(e)););return e}function _get$1(){var e;"undefined"!=typeof Reflect&&_Reflect$get$1?_get$1=_bindInstanceProperty$1(e=_Reflect$get$1).call(e):_get$1=function(e,t,r){var n=_superPropBase$1(e,t);if(n){var o=_Object$getOwnPropertyDescriptor$1(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}};return _get$1.apply(this,arguments)}var $$1t=_export,DESCRIPTORS$a=descriptors,create$a=objectCreate;$$1t({target:"Object",stat:!0,sham:!DESCRIPTORS$a},{create:create$a});var path$l=path$w,Object$2=path$l.Object,create$9=function(e,t){return Object$2.create(e,t)},parent$1X=create$9,create$8=parent$1X,parent$1W=create$8,create$7=parent$1W,parent$1V=create$7,create$6=parent$1V,create$5=create$6,_Object$create$1=getDefaultExportFromCjs(create$5);function _setPrototypeOf$4(e,t){var r;return(_setPrototypeOf$4=_Object$setPrototypeOf$1?_bindInstanceProperty$1(r=_Object$setPrototypeOf$1).call(r):function(e,t){return e.__proto__=t,e})(e,t)}function _inherits$4(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=_Object$create$1(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),_Object$defineProperty$1(e,"prototype",{writable:!1}),t&&_setPrototypeOf$4(e,t)}var isConstructor$2=isConstructor$4,tryToString$5=tryToString$8,$TypeError$e=TypeError,aConstructor$3=function(e){if(isConstructor$2(e))return e;throw $TypeError$e(tryToString$5(e)+" is not a constructor")},$$1s=_export,getBuiltIn$9=getBuiltIn$j,apply$3=functionApply,bind$m=functionBind,aConstructor$2=aConstructor$3,anObject$b=anObject$i,isObject$b=isObject$m,create$4=objectCreate,fails$h=fails$z,nativeConstruct=getBuiltIn$9("Reflect","construct"),ObjectPrototype=Object.prototype,push$8=[].push,NEW_TARGET_BUG=fails$h((function(){function e(){}return!(nativeConstruct((function(){}),[],e)instanceof e)})),ARGS_BUG=!fails$h((function(){nativeConstruct((function(){}))})),FORCED$5=NEW_TARGET_BUG||ARGS_BUG;$$1s({target:"Reflect",stat:!0,forced:FORCED$5,sham:FORCED$5},{construct:function(e,t){aConstructor$2(e),anObject$b(t);var r=arguments.length<3?e:aConstructor$2(arguments[2]);if(ARGS_BUG&&!NEW_TARGET_BUG)return nativeConstruct(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 apply$3(push$8,n,t),new(apply$3(bind$m,e,n))}var o=r.prototype,i=create$4(isObject$b(o)?o:ObjectPrototype),a=apply$3(e,i,t);return isObject$b(a)?a:i}});var path$k=path$w,construct$5=path$k.Reflect.construct,parent$1U=construct$5,construct$4=parent$1U,parent$1T=construct$4,construct$3=parent$1T,parent$1S=construct$3,construct$2=parent$1S,construct$1=construct$2,_Reflect$construct$1=getDefaultExportFromCjs(construct$1);function _isNativeReflectConstruct$4(){if("undefined"==typeof Reflect||!_Reflect$construct$1)return!1;if(_Reflect$construct$1.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_Reflect$construct$1(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _possibleConstructorReturn$4(e,t){if(t&&("object"===_typeof$3(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$4(e)}function _createSuper$3(e){var t=_isNativeReflectConstruct$4();return function(){var r,n=_getPrototypeOf$4(e);if(t){var o=_getPrototypeOf$4(this).constructor;r=_Reflect$construct$1(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn$4(this,r)}}function _defineProperty$4(e,t,r){return(t=_toPropertyKey$5(t))in e?_Object$defineProperty$1(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var entryVirtual$i=entryVirtual$k,concat$8=entryVirtual$i("Array").concat,isPrototypeOf$m=objectIsPrototypeOf,method$g=concat$8,ArrayPrototype$g=Array.prototype,concat$7=function(e){var t=e.concat;return e===ArrayPrototype$g||isPrototypeOf$m(ArrayPrototype$g,e)&&t===ArrayPrototype$g.concat?method$g:t},parent$1R=concat$7,concat$6=parent$1R,parent$1Q=concat$6,concat$5=parent$1Q,parent$1P=concat$5,concat$4=parent$1P,concat$3=concat$4,concat$2=concat$3,_concatInstanceProperty=getDefaultExportFromCjs(concat$2),$$1r=_export,toObject$5=toObject$c,nativeKeys=objectKeys$3,fails$g=fails$z,FAILS_ON_PRIMITIVES$1=fails$g((function(){nativeKeys(1)}));$$1r({target:"Object",stat:!0,forced:FAILS_ON_PRIMITIVES$1},{keys:function(e){return nativeKeys(toObject$5(e))}});var path$j=path$w,keys$5=path$j.Object.keys,parent$1O=keys$5,keys$4=parent$1O,parent$1N=keys$4,keys$3=parent$1N,parent$1M=keys$3,keys$2=parent$1M,keys$1=keys$2,keys3=keys$1,_Object$keys=getDefaultExportFromCjs(keys3),path$i=path$w,getOwnPropertySymbols$5=path$i.Object.getOwnPropertySymbols,parent$1L=getOwnPropertySymbols$5,getOwnPropertySymbols$4=parent$1L,parent$1K=getOwnPropertySymbols$4,getOwnPropertySymbols$3=parent$1K,parent$1J=getOwnPropertySymbols$3,getOwnPropertySymbols$2=parent$1J,getOwnPropertySymbols$1=getOwnPropertySymbols$2,getOwnPropertySymbols2=getOwnPropertySymbols$1,_Object$getOwnPropertySymbols=getDefaultExportFromCjs(getOwnPropertySymbols2),$$1q=_export,$filter=arrayIteration.filter,arrayMethodHasSpeciesSupport$3=arrayMethodHasSpeciesSupport$5,HAS_SPECIES_SUPPORT$3=arrayMethodHasSpeciesSupport$3("filter");$$1q({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT$3},{filter:function(e){return $filter(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$h=entryVirtual$k,filter$6=entryVirtual$h("Array").filter,isPrototypeOf$l=objectIsPrototypeOf,method$f=filter$6,ArrayPrototype$f=Array.prototype,filter$5=function(e){var t=e.filter;return e===ArrayPrototype$f||isPrototypeOf$l(ArrayPrototype$f,e)&&t===ArrayPrototype$f.filter?method$f:t},parent$1I=filter$5,filter$4=parent$1I,parent$1H=filter$4,filter$3=parent$1H,parent$1G=filter$3,filter$2=parent$1G,filter$1=filter$2,filter2=filter$1,_filterInstanceProperty=getDefaultExportFromCjs(filter2),getOwnPropertyDescriptor$3=getOwnPropertyDescriptor$4,_Object$getOwnPropertyDescriptor=getDefaultExportFromCjs(getOwnPropertyDescriptor$3),fails$f=fails$z,arrayMethodIsStrict$6=function(e,t){var r=[][e];return!!r&&fails$f((function(){r.call(null,t||function(){return 1},1)}))},$forEach=arrayIteration.forEach,arrayMethodIsStrict$5=arrayMethodIsStrict$6,STRICT_METHOD$3=arrayMethodIsStrict$5("forEach"),arrayForEach=STRICT_METHOD$3?[].forEach:function(e){return $forEach(this,e,arguments.length>1?arguments[1]:void 0)},$$1p=_export,forEach$8=arrayForEach;$$1p({target:"Array",proto:!0,forced:[].forEach!=arrayForEach},{forEach:arrayForEach});var entryVirtual$g=entryVirtual$k,forEach$7=entryVirtual$g("Array").forEach,parent$1F=forEach$7,forEach$6=parent$1F,classof$7=classof$e,hasOwn$8=hasOwnProperty_1,isPrototypeOf$k=objectIsPrototypeOf,method$e=forEach$6,ArrayPrototype$e=Array.prototype,DOMIterables$1={DOMTokenList:!0,NodeList:!0},forEach$5=function(e){var t=e.forEach;return e===ArrayPrototype$e||isPrototypeOf$k(ArrayPrototype$e,e)&&t===ArrayPrototype$e.forEach||hasOwn$8(DOMIterables$1,classof$7(e))?method$e:t},parent$1E=forEach$5,forEach$4=parent$1E,parent$1D=forEach$4,forEach$3=parent$1D,forEach$2=forEach$3,forEach$1=forEach$2,_forEachInstanceProperty=getDefaultExportFromCjs(forEach$1),getBuiltIn$8=getBuiltIn$j,uncurryThis$i=functionUncurryThis,getOwnPropertyNamesModule$1=objectGetOwnPropertyNames,getOwnPropertySymbolsModule$1=objectGetOwnPropertySymbols,anObject$a=anObject$i,concat$1=uncurryThis$i([].concat),ownKeys$5=getBuiltIn$8("Reflect","ownKeys")||function(e){var t=getOwnPropertyNamesModule$1.f(anObject$a(e)),r=getOwnPropertySymbolsModule$1.f;return r?concat$1(t,r(e)):t},$$1o=_export,DESCRIPTORS$9=descriptors,ownKeys$4=ownKeys$5,toIndexedObject$1=toIndexedObject$a,getOwnPropertyDescriptorModule$1=objectGetOwnPropertyDescriptor,createProperty$3=createProperty$6;$$1o({target:"Object",stat:!0,sham:!DESCRIPTORS$9},{getOwnPropertyDescriptors:function(e){for(var t,r,n=toIndexedObject$1(e),o=getOwnPropertyDescriptorModule$1.f,i=ownKeys$4(n),a={},s=0;i.length>s;)void 0!==(r=o(n,t=i[s++]))&&createProperty$3(a,t,r);return a}});var path$h=path$w,getOwnPropertyDescriptors$5=path$h.Object.getOwnPropertyDescriptors,parent$1C=getOwnPropertyDescriptors$5,getOwnPropertyDescriptors$4=parent$1C,parent$1B=getOwnPropertyDescriptors$4,getOwnPropertyDescriptors$3=parent$1B,parent$1A=getOwnPropertyDescriptors$3,getOwnPropertyDescriptors$2=parent$1A,getOwnPropertyDescriptors$1=getOwnPropertyDescriptors$2,getOwnPropertyDescriptors2=getOwnPropertyDescriptors$1,_Object$getOwnPropertyDescriptors=getDefaultExportFromCjs(getOwnPropertyDescriptors2),defineProperties$7={exports:{}},$$1n=_export,DESCRIPTORS$8=descriptors,defineProperties$6=objectDefineProperties.f;$$1n({target:"Object",stat:!0,forced:Object.defineProperties!==defineProperties$6,sham:!DESCRIPTORS$8},{defineProperties:defineProperties$6});var path$g=path$w,Object$1=path$g.Object,defineProperties$5=defineProperties$7.exports=function(e,t){return Object$1.defineProperties(e,t)};Object$1.defineProperties.sham&&(defineProperties$5.sham=!0);var definePropertiesExports=defineProperties$7.exports,parent$1z=definePropertiesExports,defineProperties$4=parent$1z,parent$1y=defineProperties$4,defineProperties$3=parent$1y,parent$1x=defineProperties$3,defineProperties$2=parent$1x,defineProperties$1=defineProperties$2,defineProperties4=defineProperties$1,_Object$defineProperties=getDefaultExportFromCjs(defineProperties4),defineProperty$3=defineProperty$7,_Object$defineProperty=getDefaultExportFromCjs(defineProperty$3),symbol=symbol$1,_Symbol=getDefaultExportFromCjs(symbol),create$3=create$5,_Object$create=getDefaultExportFromCjs(create$3),getPrototypeOf$1=getPrototypeOf$2,_Object$getPrototypeOf=getDefaultExportFromCjs(getPrototypeOf$1),setPrototypeOf$1=setPrototypeOf$2,_Object$setPrototypeOf=getDefaultExportFromCjs(setPrototypeOf$1),hasOwn$7=hasOwnProperty_1,ownKeys$3=ownKeys$5,getOwnPropertyDescriptorModule=objectGetOwnPropertyDescriptor,definePropertyModule=objectDefineProperty,copyConstructorProperties$1=function(e,t,r){for(var n=ownKeys$3(t),o=definePropertyModule.f,i=getOwnPropertyDescriptorModule.f,a=0;a<n.length;a++){var s=n[a];hasOwn$7(e,s)||r&&hasOwn$7(r,s)||o(e,s,i(t,s))}},isObject$a=isObject$m,createNonEnumerableProperty$3=createNonEnumerableProperty$9,installErrorCause$1=function(e,t){isObject$a(t)&&"cause"in t&&createNonEnumerableProperty$3(e,"cause",t.cause)},uncurryThis$h=functionUncurryThis,$Error$1=Error,replace$4=uncurryThis$h("".replace),TEST=String($Error$1("zxcasd").stack),V8_OR_CHAKRA_STACK_ENTRY=/\n\s*at [^:]*:[^\n]*/,IS_V8_OR_CHAKRA_STACK=V8_OR_CHAKRA_STACK_ENTRY.test(TEST),errorStackClear=function(e,t){if(IS_V8_OR_CHAKRA_STACK&&"string"==typeof e&&!$Error$1.prepareStackTrace)for(;t--;)e=replace$4(e,V8_OR_CHAKRA_STACK_ENTRY,"");return e},fails$e=fails$z,createPropertyDescriptor$2=createPropertyDescriptor$8,errorStackInstallable=!fails$e((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",createPropertyDescriptor$2(1,7)),7!==e.stack)})),createNonEnumerableProperty$2=createNonEnumerableProperty$9,clearErrorStack=errorStackClear,ERROR_STACK_INSTALLABLE=errorStackInstallable,captureStackTrace=Error.captureStackTrace,errorStackInstall=function(e,t,r,n){ERROR_STACK_INSTALLABLE&&(captureStackTrace?captureStackTrace(e,t):createNonEnumerableProperty$2(e,"stack",clearErrorStack(r,n)))},wellKnownSymbol$c=wellKnownSymbol$r,Iterators$2=iterators,ITERATOR$7=wellKnownSymbol$c("iterator"),ArrayPrototype$d=Array.prototype,isArrayIteratorMethod$2=function(e){return void 0!==e&&(Iterators$2.Array===e||ArrayPrototype$d[ITERATOR$7]===e)},classof$6=classof$e,getMethod$1=getMethod$3,isNullOrUndefined$4=isNullOrUndefined$7,Iterators$1=iterators,wellKnownSymbol$b=wellKnownSymbol$r,ITERATOR$6=wellKnownSymbol$b("iterator"),getIteratorMethod$a=function(e){if(!isNullOrUndefined$4(e))return getMethod$1(e,ITERATOR$6)||getMethod$1(e,"@@iterator")||Iterators$1[classof$6(e)]},call$p=functionCall,aCallable$g=aCallable$l,anObject$9=anObject$i,tryToString$4=tryToString$8,getIteratorMethod$9=getIteratorMethod$a,$TypeError$d=TypeError,getIterator$3=function(e,t){var r=arguments.length<2?getIteratorMethod$9(e):t;if(aCallable$g(r))return anObject$9(call$p(r,e));throw $TypeError$d(tryToString$4(e)+" is not iterable")},call$o=functionCall,anObject$8=anObject$i,getMethod=getMethod$3,iteratorClose$4=function(e,t,r){var n,o;anObject$8(e);try{if(!(n=getMethod(e,"return"))){if("throw"===t)throw r;return r}n=call$o(n,e)}catch(e){o=!0,n=e}if("throw"===t)throw r;if(o)throw n;return anObject$8(n),r},bind$l=functionBindContext,call$n=functionCall,anObject$7=anObject$i,tryToString$3=tryToString$8,isArrayIteratorMethod$1=isArrayIteratorMethod$2,lengthOfArrayLike$5=lengthOfArrayLike$a,isPrototypeOf$j=objectIsPrototypeOf,getIterator$2=getIterator$3,getIteratorMethod$8=getIteratorMethod$a,iteratorClose$3=iteratorClose$4,$TypeError$c=TypeError,Result=function(e,t){this.stopped=e,this.result=t},ResultPrototype=Result.prototype,iterate$u=function(e,t,r){var n,o,i,a,s,c,l,u=r&&r.that,p=!(!r||!r.AS_ENTRIES),$=!(!r||!r.IS_RECORD),f=!(!r||!r.IS_ITERATOR),d=!(!r||!r.INTERRUPTED),y=bind$l(t,u),h=function(e){return n&&iteratorClose$3(n,"normal",e),new Result(!0,e)},_=function(e){return p?(anObject$7(e),d?y(e[0],e[1],h):y(e[0],e[1])):d?y(e,h):y(e)};if($)n=e.iterator;else if(f)n=e;else{if(!(o=getIteratorMethod$8(e)))throw $TypeError$c(tryToString$3(e)+" is not iterable");if(isArrayIteratorMethod$1(o)){for(i=0,a=lengthOfArrayLike$5(e);a>i;i++)if((s=_(e[i]))&&isPrototypeOf$j(ResultPrototype,s))return s;return new Result(!1)}n=getIterator$2(e,o)}for(c=$?e.next:n.next;!(l=call$n(c,n)).done;){try{s=_(l.value)}catch(e){iteratorClose$3(n,"throw",e)}if("object"==typeof s&&s&&isPrototypeOf$j(ResultPrototype,s))return s}return new Result(!1)},toString$a=toString$g,normalizeStringArgument$1=function(e,t){return void 0===e?arguments.length<2?"":t:toString$a(e)},$$1m=_export,isPrototypeOf$i=objectIsPrototypeOf,getPrototypeOf2=objectGetPrototypeOf,setPrototypeOf=objectSetPrototypeOf,copyConstructorProperties=copyConstructorProperties$1,create$2=objectCreate,createNonEnumerableProperty$1=createNonEnumerableProperty$9,createPropertyDescriptor$1=createPropertyDescriptor$8,installErrorCause=installErrorCause$1,installErrorStack=errorStackInstall,iterate$t=iterate$u,normalizeStringArgument=normalizeStringArgument$1,wellKnownSymbol$a=wellKnownSymbol$r,TO_STRING_TAG=wellKnownSymbol$a("toStringTag"),$Error=Error,push$7=[].push,$AggregateError=function(e,t){var r,n=isPrototypeOf$i(AggregateErrorPrototype,this);setPrototypeOf?r=setPrototypeOf($Error(),n?getPrototypeOf2(this):AggregateErrorPrototype):(r=n?this:create$2(AggregateErrorPrototype),createNonEnumerableProperty$1(r,TO_STRING_TAG,"Error")),void 0!==t&&createNonEnumerableProperty$1(r,"message",normalizeStringArgument(t)),installErrorStack(r,$AggregateError,r.stack,1),arguments.length>2&&installErrorCause(r,arguments[2]);var o=[];return iterate$t(e,push$7,{that:o}),createNonEnumerableProperty$1(r,"errors",o),r};setPrototypeOf?setPrototypeOf($AggregateError,$Error):copyConstructorProperties($AggregateError,$Error,{name:!0});var AggregateErrorPrototype=$AggregateError.prototype=create$2($Error.prototype,{constructor:createPropertyDescriptor$1(1,$AggregateError),message:createPropertyDescriptor$1(1,""),name:createPropertyDescriptor$1(1,"AggregateError")});$$1m({global:!0,constructor:!0,arity:2},{AggregateError:$AggregateError});var $location,defer,channel,port,classof$5=classofRaw$2,engineIsNode="undefined"!=typeof process&&"process"==classof$5(process),getBuiltIn$7=getBuiltIn$j,defineBuiltInAccessor$3=defineBuiltInAccessor$5,wellKnownSymbol$9=wellKnownSymbol$r,DESCRIPTORS$7=descriptors,SPECIES$3=wellKnownSymbol$9("species"),setSpecies$2=function(e){var t=getBuiltIn$7(e);DESCRIPTORS$7&&t&&!t[SPECIES$3]&&defineBuiltInAccessor$3(t,SPECIES$3,{configurable:!0,get:function(){return this}})},isPrototypeOf$h=objectIsPrototypeOf,$TypeError$b=TypeError,anInstance$5=function(e,t){if(isPrototypeOf$h(t,e))return e;throw $TypeError$b("Incorrect invocation")},anObject$6=anObject$i,aConstructor$1=aConstructor$3,isNullOrUndefined$3=isNullOrUndefined$7,wellKnownSymbol$8=wellKnownSymbol$r,SPECIES$2=wellKnownSymbol$8("species"),speciesConstructor$2=function(e,t){var r,n=anObject$6(e).constructor;return void 0===n||isNullOrUndefined$3(r=anObject$6(n)[SPECIES$2])?t:aConstructor$1(r)},$TypeError$a=TypeError,validateArgumentsLength$5=function(e,t){if(e<t)throw $TypeError$a("Not enough arguments");return e},userAgent$5=engineUserAgent,engineIsIos=/(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$5),global$e=global$s,apply$2=functionApply,bind$k=functionBindContext,isCallable$a=isCallable$r,hasOwn$6=hasOwnProperty_1,fails$d=fails$z,html=html$2,arraySlice$4=arraySlice$7,createElement=documentCreateElement$1,validateArgumentsLength$4=validateArgumentsLength$5,IS_IOS$1=engineIsIos,IS_NODE$4=engineIsNode,set$c=global$e.setImmediate,clear=global$e.clearImmediate,process$3=global$e.process,Dispatch=global$e.Dispatch,Function$2=global$e.Function,MessageChannel=global$e.MessageChannel,String$1=global$e.String,counter=0,queue$2={},ONREADYSTATECHANGE="onreadystatechange";fails$d((function(){$location=global$e.location}));var run=function(e){if(hasOwn$6(queue$2,e)){var t=queue$2[e];delete queue$2[e],t()}},runner=function(e){return function(){run(e)}},eventListener=function(e){run(e.data)},globalPostMessageDefer=function(e){global$e.postMessage(String$1(e),$location.protocol+"//"+$location.host)};set$c&&clear||(set$c=function(e){validateArgumentsLength$4(arguments.length,1);var t=isCallable$a(e)?e:Function$2(e),r=arraySlice$4(arguments,1);return queue$2[++counter]=function(){apply$2(t,void 0,r)},defer(counter),counter},clear=function(e){delete queue$2[e]},IS_NODE$4?defer=function(e){process$3.nextTick(runner(e))}:Dispatch&&Dispatch.now?defer=function(e){Dispatch.now(runner(e))}:MessageChannel&&!IS_IOS$1?(port=(channel=new MessageChannel).port2,channel.port1.onmessage=eventListener,defer=bind$k(port.postMessage,port)):global$e.addEventListener&&isCallable$a(global$e.postMessage)&&!global$e.importScripts&&$location&&"file:"!==$location.protocol&&!fails$d(globalPostMessageDefer)?(defer=globalPostMessageDefer,global$e.addEventListener("message",eventListener,!1)):defer=ONREADYSTATECHANGE in createElement("script")?function(e){html.appendChild(createElement("script"))[ONREADYSTATECHANGE]=function(){html.removeChild(this),run(e)}}:function(e){setTimeout(runner(e),0)});var task$1={set:set$c,clear:clear},Queue$2=function(){this.head=null,this.tail=null};Queue$2.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}};var notify$1,toggle,node,promise$6,then,queue$1=Queue$2,userAgent$4=engineUserAgent,engineIsIosPebble=/ipad|iphone|ipod/i.test(userAgent$4)&&"undefined"!=typeof Pebble,userAgent$3=engineUserAgent,engineIsWebosWebkit=/web0s(?!.*chrome)/i.test(userAgent$3),global$d=global$s,bind$j=functionBindContext,getOwnPropertyDescriptor$2=objectGetOwnPropertyDescriptor.f,macrotask=task$1.set,Queue$1=queue$1,IS_IOS=engineIsIos,IS_IOS_PEBBLE=engineIsIosPebble,IS_WEBOS_WEBKIT=engineIsWebosWebkit,IS_NODE$3=engineIsNode,MutationObserver=global$d.MutationObserver||global$d.WebKitMutationObserver,document$2=global$d.document,process$2=global$d.process,Promise$1=global$d.Promise,queueMicrotaskDescriptor=getOwnPropertyDescriptor$2(global$d,"queueMicrotask"),microtask$1=queueMicrotaskDescriptor&&queueMicrotaskDescriptor.value;if(!microtask$1){var queue=new Queue$1,flush=function(){var e,t;for(IS_NODE$3&&(e=process$2.domain)&&e.exit();t=queue.get();)try{t()}catch(e){throw queue.head&¬ify$1(),e}e&&e.enter()};IS_IOS||IS_NODE$3||IS_WEBOS_WEBKIT||!MutationObserver||!document$2?!IS_IOS_PEBBLE&&Promise$1&&Promise$1.resolve?((promise$6=Promise$1.resolve(void 0)).constructor=Promise$1,then=bind$j(promise$6.then,promise$6),notify$1=function(){then(flush)}):IS_NODE$3?notify$1=function(){process$2.nextTick(flush)}:(macrotask=bind$j(macrotask,global$d),notify$1=function(){macrotask(flush)}):(toggle=!0,node=document$2.createTextNode(""),new MutationObserver(flush).observe(node,{characterData:!0}),notify$1=function(){node.data=toggle=!toggle}),microtask$1=function(e){queue.head||notify$1(),queue.add(e)}}var microtask_1=microtask$1,hostReportErrors$1=function(e,t){try{1==arguments.length?console.error(e):console.error(e,t)}catch(e){}},perform$6=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},global$c=global$s,promiseNativeConstructor=global$c.Promise,engineIsDeno="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,IS_DENO$1=engineIsDeno,IS_NODE$2=engineIsNode,engineIsBrowser=!IS_DENO$1&&!IS_NODE$2&&"object"==typeof window&&"object"==typeof document,global$b=global$s,NativePromiseConstructor$5=promiseNativeConstructor,isCallable$9=isCallable$r,isForced=isForced_1,inspectSource=inspectSource$2,wellKnownSymbol$7=wellKnownSymbol$r,IS_BROWSER=engineIsBrowser,IS_DENO=engineIsDeno,V8_VERSION=engineV8Version,NativePromisePrototype$2=NativePromiseConstructor$5&&NativePromiseConstructor$5.prototype,SPECIES$1=wellKnownSymbol$7("species"),SUBCLASSING=!1,NATIVE_PROMISE_REJECTION_EVENT$1=isCallable$9(global$b.PromiseRejectionEvent),FORCED_PROMISE_CONSTRUCTOR$5=isForced("Promise",(function(){var e=inspectSource(NativePromiseConstructor$5),t=e!==String(NativePromiseConstructor$5);if(!t&&66===V8_VERSION)return!0;if(!NativePromisePrototype$2.catch||!NativePromisePrototype$2.finally)return!0;if(!V8_VERSION||V8_VERSION<51||!/native code/.test(e)){var r=new NativePromiseConstructor$5((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((r.constructor={})[SPECIES$1]=n,!(SUBCLASSING=r.then((function(){}))instanceof n))return!0}return!t&&(IS_BROWSER||IS_DENO)&&!NATIVE_PROMISE_REJECTION_EVENT$1})),promiseConstructorDetection={CONSTRUCTOR:FORCED_PROMISE_CONSTRUCTOR$5,REJECTION_EVENT:NATIVE_PROMISE_REJECTION_EVENT$1,SUBCLASSING:SUBCLASSING},newPromiseCapability$2={},aCallable$f=aCallable$l,$TypeError$9=TypeError,PromiseCapability=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw $TypeError$9("Bad Promise constructor");t=e,r=n})),this.resolve=aCallable$f(t),this.reject=aCallable$f(r)};newPromiseCapability$2.f=function(e){return new PromiseCapability(e)};var $$1l=_export,IS_NODE$1=engineIsNode,global$a=global$s,call$m=functionCall,defineBuiltIn$3=defineBuiltIn$8,setToStringTag$3=setToStringTag$9,setSpecies$1=setSpecies$2,aCallable$e=aCallable$l,isCallable$8=isCallable$r,isObject$9=isObject$m,anInstance$4=anInstance$5,speciesConstructor$1=speciesConstructor$2,task=task$1.set,microtask=microtask_1,hostReportErrors=hostReportErrors$1,perform$5=perform$6,Queue=queue$1,InternalStateModule$4=internalState,NativePromiseConstructor$4=promiseNativeConstructor,PromiseConstructorDetection=promiseConstructorDetection,newPromiseCapabilityModule$6=newPromiseCapability$2,PROMISE="Promise",FORCED_PROMISE_CONSTRUCTOR$4=PromiseConstructorDetection.CONSTRUCTOR,NATIVE_PROMISE_REJECTION_EVENT=PromiseConstructorDetection.REJECTION_EVENT;PromiseConstructorDetection.SUBCLASSING;var Internal,OwnPromiseCapability,PromiseWrapper,getInternalPromiseState=InternalStateModule$4.getterFor(PROMISE),setInternalState$4=InternalStateModule$4.set,NativePromisePrototype$1=NativePromiseConstructor$4&&NativePromiseConstructor$4.prototype,PromiseConstructor=NativePromiseConstructor$4,PromisePrototype=NativePromisePrototype$1,TypeError$3=global$a.TypeError,document$1=global$a.document,process$1=global$a.process,newPromiseCapability$1=newPromiseCapabilityModule$6.f,newGenericPromiseCapability=newPromiseCapability$1,DISPATCH_EVENT=!!(document$1&&document$1.createEvent&&global$a.dispatchEvent),UNHANDLED_REJECTION="unhandledrejection",REJECTION_HANDLED="rejectionhandled",PENDING=0,FULFILLED=1,REJECTED=2,HANDLED=1,UNHANDLED=2,isThenable=function(e){var t;return!(!isObject$9(e)||!isCallable$8(t=e.then))&&t},callReaction=function(e,t){var r,n,o,i=t.value,a=t.state==FULFILLED,s=a?e.ok:e.fail,c=e.resolve,l=e.reject,u=e.domain;try{s?(a||(t.rejection===UNHANDLED&&onHandleUnhandled(t),t.rejection=HANDLED),!0===s?r=i:(u&&u.enter(),r=s(i),u&&(u.exit(),o=!0)),r===e.promise?l(TypeError$3("Promise-chain cycle")):(n=isThenable(r))?call$m(n,r,c,l):c(r)):l(i)}catch(e){u&&!o&&u.exit(),l(e)}},notify=function(e,t){e.notified||(e.notified=!0,microtask((function(){for(var r,n=e.reactions;r=n.get();)callReaction(r,e);e.notified=!1,t&&!e.rejection&&onUnhandled(e)})))},dispatchEvent=function(e,t,r){var n,o;DISPATCH_EVENT?((n=document$1.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),global$a.dispatchEvent(n)):n={promise:t,reason:r},!NATIVE_PROMISE_REJECTION_EVENT&&(o=global$a["on"+e])?o(n):e===UNHANDLED_REJECTION&&hostReportErrors("Unhandled promise rejection",r)},onUnhandled=function(e){call$m(task,global$a,(function(){var t,r=e.facade,n=e.value;if(isUnhandled(e)&&(t=perform$5((function(){IS_NODE$1?process$1.emit("unhandledRejection",n,r):dispatchEvent(UNHANDLED_REJECTION,r,n)})),e.rejection=IS_NODE$1||isUnhandled(e)?UNHANDLED:HANDLED,t.error))throw t.value}))},isUnhandled=function(e){return e.rejection!==HANDLED&&!e.parent},onHandleUnhandled=function(e){call$m(task,global$a,(function(){var t=e.facade;IS_NODE$1?process$1.emit("rejectionHandled",t):dispatchEvent(REJECTION_HANDLED,t,e.value)}))},bind$i=function(e,t,r){return function(n){e(t,n,r)}},internalReject=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=REJECTED,notify(e,!0))},internalResolve=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw TypeError$3("Promise can't be resolved itself");var n=isThenable(t);n?microtask((function(){var r={done:!1};try{call$m(n,t,bind$i(internalResolve,r,e),bind$i(internalReject,r,e))}catch(t){internalReject(r,t,e)}})):(e.value=t,e.state=FULFILLED,notify(e,!1))}catch(t){internalReject({done:!1},t,e)}}};FORCED_PROMISE_CONSTRUCTOR$4&&(PromisePrototype=(PromiseConstructor=function(e){anInstance$4(this,PromisePrototype),aCallable$e(e),call$m(Internal,this);var t=getInternalPromiseState(this);try{e(bind$i(internalResolve,t),bind$i(internalReject,t))}catch(e){internalReject(t,e)}}).prototype,(Internal=function(e){setInternalState$4(this,{type:PROMISE,done:!1,notified:!1,parent:!1,reactions:new Queue,rejection:!1,state:PENDING,value:void 0})}).prototype=defineBuiltIn$3(PromisePrototype,"then",(function(e,t){var r=getInternalPromiseState(this),n=newPromiseCapability$1(speciesConstructor$1(this,PromiseConstructor));return r.parent=!0,n.ok=!isCallable$8(e)||e,n.fail=isCallable$8(t)&&t,n.domain=IS_NODE$1?process$1.domain:void 0,r.state==PENDING?r.reactions.add(n):microtask((function(){callReaction(n,r)})),n.promise})),OwnPromiseCapability=function(){var e=new Internal,t=getInternalPromiseState(e);this.promise=e,this.resolve=bind$i(internalResolve,t),this.reject=bind$i(internalReject,t)},newPromiseCapabilityModule$6.f=newPromiseCapability$1=function(e){return e===PromiseConstructor||e===PromiseWrapper?new OwnPromiseCapability(e):newGenericPromiseCapability(e)}),$$1l({global:!0,constructor:!0,wrap:!0,forced:FORCED_PROMISE_CONSTRUCTOR$4},{Promise:PromiseConstructor}),setToStringTag$3(PromiseConstructor,PROMISE,!1,!0),setSpecies$1(PROMISE);var wellKnownSymbol$6=wellKnownSymbol$r,ITERATOR$5=wellKnownSymbol$6("iterator"),SAFE_CLOSING=!1;try{var called=0,iteratorWithReturn={next:function(){return{done:!!called++}},return:function(){SAFE_CLOSING=!0}};iteratorWithReturn[ITERATOR$5]=function(){return this},Array.from(iteratorWithReturn,(function(){throw 2}))}catch(e){}var checkCorrectnessOfIteration$2=function(e,t){if(!t&&!SAFE_CLOSING)return!1;var r=!1;try{var n={};n[ITERATOR$5]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},NativePromiseConstructor$3=promiseNativeConstructor,checkCorrectnessOfIteration$1=checkCorrectnessOfIteration$2,FORCED_PROMISE_CONSTRUCTOR$3=promiseConstructorDetection.CONSTRUCTOR,promiseStaticsIncorrectIteration=FORCED_PROMISE_CONSTRUCTOR$3||!checkCorrectnessOfIteration$1((function(e){NativePromiseConstructor$3.all(e).then(void 0,(function(){}))})),$$1k=_export,call$l=functionCall,aCallable$d=aCallable$l,newPromiseCapabilityModule$5=newPromiseCapability$2,perform$4=perform$6,iterate$s=iterate$u,PROMISE_STATICS_INCORRECT_ITERATION$3=promiseStaticsIncorrectIteration;$$1k({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION$3},{all:function(e){var t=this,r=newPromiseCapabilityModule$5.f(t),n=r.resolve,o=r.reject,i=perform$4((function(){var r=aCallable$d(t.resolve),i=[],a=0,s=1;iterate$s(e,(function(e){var c=a++,l=!1;s++,call$l(r,t,e).then((function(e){l||(l=!0,i[c]=e,--s||n(i))}),o)})),--s||n(i)}));return i.error&&o(i.value),r.promise}});var $$1j=_export,FORCED_PROMISE_CONSTRUCTOR$2=promiseConstructorDetection.CONSTRUCTOR,NativePromiseConstructor$2=promiseNativeConstructor;promiseNativeConstructor&&promiseNativeConstructor.prototype,$$1j({target:"Promise",proto:!0,forced:FORCED_PROMISE_CONSTRUCTOR$2,real:!0},{catch:function(e){return this.then(void 0,e)}});var $$1i=_export,call$k=functionCall,aCallable$c=aCallable$l,newPromiseCapabilityModule$4=newPromiseCapability$2,perform$3=perform$6,iterate$r=iterate$u,PROMISE_STATICS_INCORRECT_ITERATION$2=promiseStaticsIncorrectIteration;$$1i({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION$2},{race:function(e){var t=this,r=newPromiseCapabilityModule$4.f(t),n=r.reject,o=perform$3((function(){var o=aCallable$c(t.resolve);iterate$r(e,(function(e){call$k(o,t,e).then(r.resolve,n)}))}));return o.error&&n(o.value),r.promise}});var $$1h=_export,call$j=functionCall,newPromiseCapabilityModule$3=newPromiseCapability$2,FORCED_PROMISE_CONSTRUCTOR$1=promiseConstructorDetection.CONSTRUCTOR;$$1h({target:"Promise",stat:!0,forced:FORCED_PROMISE_CONSTRUCTOR$1},{reject:function(e){var t=newPromiseCapabilityModule$3.f(this);return call$j(t.reject,void 0,e),t.promise}});var anObject$5=anObject$i,isObject$8=isObject$m,newPromiseCapability=newPromiseCapability$2,promiseResolve$2=function(e,t){if(anObject$5(e),isObject$8(t)&&t.constructor===e)return t;var r=newPromiseCapability.f(e);return(0,r.resolve)(t),r.promise},$$1g=_export,getBuiltIn$6=getBuiltIn$j,IS_PURE$1=isPure,NativePromiseConstructor$1=promiseNativeConstructor,FORCED_PROMISE_CONSTRUCTOR=promiseConstructorDetection.CONSTRUCTOR,promiseResolve$1=promiseResolve$2,PromiseConstructorWrapper=getBuiltIn$6("Promise"),CHECK_WRAPPER=!FORCED_PROMISE_CONSTRUCTOR;$$1g({target:"Promise",stat:!0,forced:IS_PURE$1},{resolve:function(e){return promiseResolve$1(CHECK_WRAPPER&&this===PromiseConstructorWrapper?NativePromiseConstructor$1:this,e)}});var $$1f=_export,call$i=functionCall,aCallable$b=aCallable$l,newPromiseCapabilityModule$2=newPromiseCapability$2,perform$2=perform$6,iterate$q=iterate$u,PROMISE_STATICS_INCORRECT_ITERATION$1=promiseStaticsIncorrectIteration;$$1f({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION$1},{allSettled:function(e){var t=this,r=newPromiseCapabilityModule$2.f(t),n=r.resolve,o=r.reject,i=perform$2((function(){var r=aCallable$b(t.resolve),o=[],i=0,a=1;iterate$q(e,(function(e){var s=i++,c=!1;a++,call$i(r,t,e).then((function(e){c||(c=!0,o[s]={status:"fulfilled",value:e},--a||n(o))}),(function(e){c||(c=!0,o[s]={status:"rejected",reason:e},--a||n(o))}))})),--a||n(o)}));return i.error&&o(i.value),r.promise}});var $$1e=_export,call$h=functionCall,aCallable$a=aCallable$l,getBuiltIn$5=getBuiltIn$j,newPromiseCapabilityModule$1=newPromiseCapability$2,perform$1=perform$6,iterate$p=iterate$u,PROMISE_STATICS_INCORRECT_ITERATION=promiseStaticsIncorrectIteration,PROMISE_ANY_ERROR="No one promise resolved";$$1e({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION},{any:function(e){var t=this,r=getBuiltIn$5("AggregateError"),n=newPromiseCapabilityModule$1.f(t),o=n.resolve,i=n.reject,a=perform$1((function(){var n=aCallable$a(t.resolve),a=[],s=0,c=1,l=!1;iterate$p(e,(function(e){var u=s++,p=!1;c++,call$h(n,t,e).then((function(e){p||l||(l=!0,o(e))}),(function(e){p||l||(p=!0,a[u]=e,--c||i(new r(a,PROMISE_ANY_ERROR)))}))})),--c||i(new r(a,PROMISE_ANY_ERROR))}));return a.error&&i(a.value),n.promise}});var $$1d=_export,NativePromiseConstructor=promiseNativeConstructor,fails$c=fails$z,getBuiltIn$4=getBuiltIn$j,isCallable$7=isCallable$r,speciesConstructor=speciesConstructor$2,promiseResolve=promiseResolve$2,NativePromisePrototype=NativePromiseConstructor&&NativePromiseConstructor.prototype,NON_GENERIC=!!NativePromiseConstructor&&fails$c((function(){NativePromisePrototype.finally.call({then:function(){}},(function(){}))}));$$1d({target:"Promise",proto:!0,real:!0,forced:NON_GENERIC},{finally:function(e){var t=speciesConstructor(this,getBuiltIn$4("Promise")),r=isCallable$7(e);return this.then(r?function(r){return promiseResolve(t,e()).then((function(){return r}))}:e,r?function(r){return promiseResolve(t,e()).then((function(){throw r}))}:e)}});var path$f=path$w,promise$5=path$f.Promise,parent$1w=promise$5,promise$4=parent$1w,parent$1v=promise$4,promise$3=parent$1v,$$1c=_export,newPromiseCapabilityModule=newPromiseCapability$2,perform=perform$6;$$1c({target:"Promise",stat:!0,forced:!0},{try:function(e){var t=newPromiseCapabilityModule.f(this),r=perform(e);return(r.error?t.reject:t.resolve)(r.value),t.promise}});var parent$1u=promise$3,promise$2=parent$1u,promise$1=promise$2,promise=promise$1,_Promise=getDefaultExportFromCjs(promise),$$1b=_export,uncurryThis$g=functionUncurryThis,isArray$9=isArray$d,nativeReverse=uncurryThis$g([].reverse),test$1=[1,2];$$1b({target:"Array",proto:!0,forced:String(test$1)===String(test$1.reverse())},{reverse:function(){return isArray$9(this)&&(this.length=this.length),nativeReverse(this)}});var entryVirtual$f=entryVirtual$k,reverse$6=entryVirtual$f("Array").reverse,isPrototypeOf$g=objectIsPrototypeOf,method$d=reverse$6,ArrayPrototype$c=Array.prototype,reverse$5=function(e){var t=e.reverse;return e===ArrayPrototype$c||isPrototypeOf$g(ArrayPrototype$c,e)&&t===ArrayPrototype$c.reverse?method$d:t},parent$1t=reverse$5,reverse$4=parent$1t,parent$1s=reverse$4,reverse$3=parent$1s,parent$1r=reverse$3,reverse$2=parent$1r,reverse$1=reverse$2,reverse2=reverse$1,_reverseInstanceProperty=getDefaultExportFromCjs(reverse2),$$1a=_export,isArray$8=isArray$d,isConstructor$1=isConstructor$4,isObject$7=isObject$m,toAbsoluteIndex$2=toAbsoluteIndex$5,lengthOfArrayLike$4=lengthOfArrayLike$a,toIndexedObject=toIndexedObject$a,createProperty$2=createProperty$6,wellKnownSymbol$5=wellKnownSymbol$r,arrayMethodHasSpeciesSupport$2=arrayMethodHasSpeciesSupport$5,nativeSlice=arraySlice$7,HAS_SPECIES_SUPPORT$2=arrayMethodHasSpeciesSupport$2("slice"),SPECIES=wellKnownSymbol$5("species"),$Array$1=Array,max$2=Math.max;$$1a({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT$2},{slice:function(e,t){var r,n,o,i=toIndexedObject(this),a=lengthOfArrayLike$4(i),s=toAbsoluteIndex$2(e,a),c=toAbsoluteIndex$2(void 0===t?a:t,a);if(isArray$8(i)&&(r=i.constructor,(isConstructor$1(r)&&(r===$Array$1||isArray$8(r.prototype))||isObject$7(r)&&null===(r=r[SPECIES]))&&(r=void 0),r===$Array$1||void 0===r))return nativeSlice(i,s,c);for(n=new(void 0===r?$Array$1:r)(max$2(c-s,0)),o=0;s<c;s++,o++)s in i&&createProperty$2(n,o,i[s]);return n.length=o,n}});var entryVirtual$e=entryVirtual$k,slice$6=entryVirtual$e("Array").slice,isPrototypeOf$f=objectIsPrototypeOf,method$c=slice$6,ArrayPrototype$b=Array.prototype,slice$5=function(e){var t=e.slice;return e===ArrayPrototype$b||isPrototypeOf$f(ArrayPrototype$b,e)&&t===ArrayPrototype$b.slice?method$c:t},parent$1q=slice$5,slice$4=parent$1q,parent$1p=slice$4,slice$3=parent$1p,parent$1o=slice$3,slice$2=parent$1o,slice$1=slice$2,slice2=slice$1,_sliceInstanceProperty=getDefaultExportFromCjs(slice2),iterator=iterator$1,_Symbol$iterator=getDefaultExportFromCjs(iterator),bind$h=bind$n,_bindInstanceProperty=getDefaultExportFromCjs(bind$h),construct2=construct$1,_Reflect$construct=getDefaultExportFromCjs(construct2),toPrimitive=toPrimitive$1,_Symbol$toPrimitive=getDefaultExportFromCjs(toPrimitive);function ownKeys$2(e,t){var r=_Object$keys(e);if(_Object$getOwnPropertySymbols){var n=_Object$getOwnPropertySymbols(e);t&&(n=_filterInstanceProperty(n).call(n,(function(t){return _Object$getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread2$2(e){for(var t=1;t<arguments.length;t++){var r,n,o=null!=arguments[t]?arguments[t]:{};t%2?_forEachInstanceProperty(r=ownKeys$2(Object(o),!0)).call(r,(function(t){_defineProperty$3(e,t,o[t])})):_Object$getOwnPropertyDescriptors?_Object$defineProperties(e,_Object$getOwnPropertyDescriptors(o)):_forEachInstanceProperty(n=ownKeys$2(Object(o))).call(n,(function(t){_Object$defineProperty(e,t,_Object$getOwnPropertyDescriptor(o,t))}))}return e}function _regeneratorRuntime$1(){_regeneratorRuntime$1=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=_Object$defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof _Symbol?_Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,r){return _Object$defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,o){var i=t&&t.prototype instanceof $?t:$,a=_Object$create(i.prototype),s=new P(o||[]);return n(a,"_invoke",{value:v(e,r,s)}),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var p={};function $(){}function f(){}function d(){}var y={};c(y,i,(function(){return this}));var h=_Object$getPrototypeOf&&_Object$getPrototypeOf(_Object$getPrototypeOf(O([])));h&&h!==t&&r.call(h,i)&&(y=h);var _=d.prototype=$.prototype=_Object$create(y);function g(e){var t;_forEachInstanceProperty(t=["next","throw","return"]).call(t,(function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function m(e,t){function o(n,i,a,s){var c=u(e[n],e,i);if("throw"!==c.type){var l=c.arg,p=l.value;return p&&"object"==_typeof$3(p)&&r.call(p,"__await")?t.resolve(p.__await).then((function(e){o("next",e,a,s)}),(function(e){o("throw",e,a,s)})):t.resolve(p).then((function(e){l.value=e,a(l)}),(function(e){return o("throw",e,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){o(e,r,t,n)}))}return i=i?i.then(n,n):n()}})}function v(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=b(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function b(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var o=u(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,p;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],_forEachInstanceProperty(e).call(e,S,this),this.reset(!0)}function O(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:T}}function T(){return{value:void 0,done:!0}}return f.prototype=d,n(_,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:f,configurable:!0}),f.displayName=c(d,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return _Object$setPrototypeOf?_Object$setPrototypeOf(e,d):(e.__proto__=d,c(e,s,"GeneratorFunction")),e.prototype=_Object$create(_),e},e.awrap=function(e){return{__await:e}},g(m.prototype),c(m.prototype,a,(function(){return this})),e.AsyncIterator=m,e.async=function(t,r,n,o,i){void 0===i&&(i=_Promise);var a=new m(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(_),c(_,s,"Generator"),c(_,i,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return _reverseInstanceProperty(r).call(r),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=O,P.prototype={constructor:P,reset:function(e){var t;if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,_forEachInstanceProperty(t=this.tryEntries).call(t,E),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+_sliceInstanceProperty(n).call(n,1))&&(this[n]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(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 o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},e}function _typeof$2(e){return(_typeof$2="function"==typeof _Symbol&&"symbol"==typeof _Symbol$iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof _Symbol&&e.constructor===_Symbol&&e!==_Symbol.prototype?"symbol":typeof e})(e)}function asyncGeneratorStep$1(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):_Promise.resolve(c).then(n,o)}function _asyncToGenerator$1(e){return function(){var t=this,r=arguments;return new _Promise((function(n,o){var i=e.apply(t,r);function a(e){asyncGeneratorStep$1(i,n,o,a,s,"next",e)}function s(e){asyncGeneratorStep$1(i,n,o,a,s,"throw",e)}a(void 0)}))}}function _classCallCheck$4(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$4(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),_Object$defineProperty(e,_toPropertyKey$4(n.key),n)}}function _createClass$4(e,t,r){return t&&_defineProperties$4(e.prototype,t),r&&_defineProperties$4(e,r),_Object$defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty$3(e,t,r){return(t=_toPropertyKey$4(t))in e?_Object$defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _inherits$3(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=_Object$create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),_Object$defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf$3(e,t)}function _getPrototypeOf$3(e){var t;return(_getPrototypeOf$3=_Object$setPrototypeOf?_bindInstanceProperty(t=_Object$getPrototypeOf).call(t):function(e){return e.__proto__||_Object$getPrototypeOf(e)})(e)}function _setPrototypeOf$3(e,t){var r;return(_setPrototypeOf$3=_Object$setPrototypeOf?_bindInstanceProperty(r=_Object$setPrototypeOf).call(r):function(e,t){return e.__proto__=t,e})(e,t)}function _isNativeReflectConstruct$3(){if("undefined"==typeof Reflect||!_Reflect$construct)return!1;if(_Reflect$construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_Reflect$construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _assertThisInitialized$3(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn$3(e,t){if(t&&("object"===_typeof$3(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$3(e)}function _createSuper$2(e){var t=_isNativeReflectConstruct$3();return function(){var r,n=_getPrototypeOf$3(e);if(t){var o=_getPrototypeOf$3(this).constructor;r=_Reflect$construct(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn$3(this,r)}}function _toPrimitive$4(e,t){if("object"!==_typeof$3(e)||null===e)return e;var r=e[_Symbol$toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof$3(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey$4(e){var t=_toPrimitive$4(e,"string");return"symbol"===_typeof$3(t)?t:String(t)}var $$19=_export,uncurryThis$f=functionUncurryThisClause,$indexOf=arrayIncludes.indexOf,arrayMethodIsStrict$4=arrayMethodIsStrict$6,nativeIndexOf=uncurryThis$f([].indexOf),NEGATIVE_ZERO=!!nativeIndexOf&&1/nativeIndexOf([1],1,-0)<0,FORCED$4=NEGATIVE_ZERO||!arrayMethodIsStrict$4("indexOf");$$19({target:"Array",proto:!0,forced:FORCED$4},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return NEGATIVE_ZERO?nativeIndexOf(this,e,t)||0:$indexOf(this,e,t)}});var entryVirtual$d=entryVirtual$k,indexOf$6=entryVirtual$d("Array").indexOf,isPrototypeOf$e=objectIsPrototypeOf,method$b=indexOf$6,ArrayPrototype$a=Array.prototype,indexOf$5=function(e){var t=e.indexOf;return e===ArrayPrototype$a||isPrototypeOf$e(ArrayPrototype$a,e)&&t===ArrayPrototype$a.indexOf?method$b:t},parent$1n=indexOf$5,indexOf$4=parent$1n,parent$1m=indexOf$4,indexOf$3=parent$1m,parent$1l=indexOf$3,indexOf$2=parent$1l,indexOf$1=indexOf$2,indexOf2=indexOf$1,_indexOfInstanceProperty=getDefaultExportFromCjs(indexOf2),$$18=_export,$find=arrayIteration.find,FIND="find",SKIPS_HOLES$1=!0;FIND in[]&&Array(1)[FIND]((function(){SKIPS_HOLES$1=!1})),$$18({target:"Array",proto:!0,forced:SKIPS_HOLES$1},{find:function(e){return $find(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$c=entryVirtual$k,find$7=entryVirtual$c("Array").find,isPrototypeOf$d=objectIsPrototypeOf,method$a=find$7,ArrayPrototype$9=Array.prototype,find$6=function(e){var t=e.find;return e===ArrayPrototype$9||isPrototypeOf$d(ArrayPrototype$9,e)&&t===ArrayPrototype$9.find?method$a:t},parent$1k=find$6,find$5=parent$1k,parent$1j=find$5,find$4=parent$1j,parent$1i=find$4,find$3=parent$1i,find$2=find$3,find$1=find$2,_findInstanceProperty=getDefaultExportFromCjs(find$1),DESCRIPTORS$6=descriptors,isArray$7=isArray$d,$TypeError$8=TypeError,getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor,SILENT_ON_NON_WRITABLE_LENGTH_SET=DESCRIPTORS$6&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}(),arraySetLength=SILENT_ON_NON_WRITABLE_LENGTH_SET?function(e,t){if(isArray$7(e)&&!getOwnPropertyDescriptor$1(e,"length").writable)throw $TypeError$8("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},tryToString$2=tryToString$8,$TypeError$7=TypeError,deletePropertyOrThrow$2=function(e,t){if(!delete e[t])throw $TypeError$7("Cannot delete property "+tryToString$2(t)+" of "+tryToString$2(e))},$$17=_export,toObject$4=toObject$c,toAbsoluteIndex$1=toAbsoluteIndex$5,toIntegerOrInfinity$2=toIntegerOrInfinity$6,lengthOfArrayLike$3=lengthOfArrayLike$a,setArrayLength=arraySetLength,doesNotExceedSafeInteger=doesNotExceedSafeInteger$2,arraySpeciesCreate=arraySpeciesCreate$3,createProperty$1=createProperty$6,deletePropertyOrThrow$1=deletePropertyOrThrow$2,arrayMethodHasSpeciesSupport$1=arrayMethodHasSpeciesSupport$5,HAS_SPECIES_SUPPORT$1=arrayMethodHasSpeciesSupport$1("splice"),max$1=Math.max,min=Math.min;$$17({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT$1},{splice:function(e,t){var r,n,o,i,a,s,c=toObject$4(this),l=lengthOfArrayLike$3(c),u=toAbsoluteIndex$1(e,l),p=arguments.length;for(0===p?r=n=0:1===p?(r=0,n=l-u):(r=p-2,n=min(max$1(toIntegerOrInfinity$2(t),0),l-u)),doesNotExceedSafeInteger(l+r-n),o=arraySpeciesCreate(c,n),i=0;i<n;i++)(a=u+i)in c&&createProperty$1(o,i,c[a]);if(o.length=n,r<n){for(i=u;i<l-n;i++)s=i+r,(a=i+n)in c?c[s]=c[a]:deletePropertyOrThrow$1(c,s);for(i=l;i>l-n+r;i--)deletePropertyOrThrow$1(c,i-1)}else if(r>n)for(i=l-n;i>u;i--)s=i+r-1,(a=i+n-1)in c?c[s]=c[a]:deletePropertyOrThrow$1(c,s);for(i=0;i<r;i++)c[i+u]=arguments[i+2];return setArrayLength(c,l-n+r),o}});var entryVirtual$b=entryVirtual$k,splice$7=entryVirtual$b("Array").splice,isPrototypeOf$c=objectIsPrototypeOf,method$9=splice$7,ArrayPrototype$8=Array.prototype,splice$6=function(e){var t=e.splice;return e===ArrayPrototype$8||isPrototypeOf$c(ArrayPrototype$8,e)&&t===ArrayPrototype$8.splice?method$9:t},parent$1h=splice$6,splice$5=parent$1h,parent$1g=splice$5,splice$4=parent$1g,parent$1f=splice$4,splice$3=parent$1f,splice$2=splice$3,splice$1=splice$2,_spliceInstanceProperty=getDefaultExportFromCjs(splice$1),$$16=_export;$$16({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var path$e=path$w,isNan$5=path$e.Number.isNaN,parent$1e=isNan$5,isNan$4=parent$1e,parent$1d=isNan$4,isNan$3=parent$1d,parent$1c=isNan$3,isNan$2=parent$1c,isNan$1=isNan$2,isNan=isNan$1,_Number$isNaN=getDefaultExportFromCjs(isNan),whitespaces$4="\t\n\v\f\r \u2028\u2029\ufeff",uncurryThis$e=functionUncurryThis,requireObjectCoercible$3=requireObjectCoercible$7,toString$9=toString$g,whitespaces$3=whitespaces$4,replace$3=uncurryThis$e("".replace),ltrim=RegExp("^["+whitespaces$3+"]+"),rtrim=RegExp("(^|[^"+whitespaces$3+"])["+whitespaces$3+"]+$"),createMethod$2=function(e){return function(t){var r=toString$9(requireObjectCoercible$3(t));return 1&e&&(r=replace$3(r,ltrim,"")),2&e&&(r=replace$3(r,rtrim,"$1")),r}},stringTrim={start:createMethod$2(1),end:createMethod$2(2),trim:createMethod$2(3)},global$9=global$s,fails$b=fails$z,uncurryThis$d=functionUncurryThis,toString$8=toString$g,trim$8=stringTrim.trim,whitespaces$2=whitespaces$4,$parseInt$1=global$9.parseInt,Symbol$2=global$9.Symbol,ITERATOR$4=Symbol$2&&Symbol$2.iterator,hex=/^[+-]?0x/i,exec$2=uncurryThis$d(hex.exec),FORCED$3=8!==$parseInt$1(whitespaces$2+"08")||22!==$parseInt$1(whitespaces$2+"0x16")||ITERATOR$4&&!fails$b((function(){$parseInt$1(Object(ITERATOR$4))})),numberParseInt=FORCED$3?function(e,t){var r=trim$8(toString$8(e));return $parseInt$1(r,t>>>0||(exec$2(hex,r)?16:10))}:$parseInt$1,$$15=_export,$parseInt=numberParseInt;$$15({global:!0,forced:parseInt!=numberParseInt},{parseInt:numberParseInt});var path$d=path$w,_parseInt$6=path$d.parseInt,parent$1b=_parseInt$6,_parseInt$5=parent$1b,parent$1a=_parseInt$5,_parseInt$4=parent$1a,parent$19=_parseInt$4,_parseInt$3=parent$19,_parseInt$2=_parseInt$3,_parseInt=_parseInt$2,_parseInt$1=getDefaultExportFromCjs(_parseInt),$$14=_export,$map=arrayIteration.map,arrayMethodHasSpeciesSupport=arrayMethodHasSpeciesSupport$5,HAS_SPECIES_SUPPORT=arrayMethodHasSpeciesSupport("map");$$14({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT},{map:function(e){return $map(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$a=entryVirtual$k,map$c=entryVirtual$a("Array").map,isPrototypeOf$b=objectIsPrototypeOf,method$8=map$c,ArrayPrototype$7=Array.prototype,map$b=function(e){var t=e.map;return e===ArrayPrototype$7||isPrototypeOf$b(ArrayPrototype$7,e)&&t===ArrayPrototype$7.map?method$8:t},parent$18=map$b,map$a=parent$18,parent$17=map$a,map$9=parent$17,parent$16=map$9,map$8=parent$16,map$7=map$8,map$6=map$7,_mapInstanceProperty=getDefaultExportFromCjs(map$6),$$13=_export,isArray$6=isArray$d;$$13({target:"Array",stat:!0},{isArray:isArray$6});var path$c=path$w,isArray$5=path$c.Array.isArray,parent$15=isArray$5,isArray$4=parent$15,parent$14=isArray$4,isArray$3=parent$14,parent$13=isArray$3,isArray$2=parent$13,isArray$1=isArray$2,isArray2=isArray$1,_Array$isArray=getDefaultExportFromCjs(isArray2),DESCRIPTORS$5=descriptors,uncurryThis$c=functionUncurryThis,call$g=functionCall,fails$a=fails$z,objectKeys=objectKeys$3,getOwnPropertySymbolsModule=objectGetOwnPropertySymbols,propertyIsEnumerableModule=objectPropertyIsEnumerable,toObject$3=toObject$c,IndexedObject$1=indexedObject,$assign=Object.assign,defineProperty$2=Object.defineProperty,concat2=uncurryThis$c([].concat),objectAssign=!$assign||fails$a((function(){if(DESCRIPTORS$5&&1!==$assign({b:1},$assign(defineProperty$2({},"a",{enumerable:!0,get:function(){defineProperty$2(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach((function(e){t[e]=e})),7!=$assign({},e)[r]||objectKeys($assign({},t)).join("")!=n}))?function(e,t){for(var r=toObject$3(e),n=arguments.length,o=1,i=getOwnPropertySymbolsModule.f,a=propertyIsEnumerableModule.f;n>o;)for(var s,c=IndexedObject$1(arguments[o++]),l=i?concat2(objectKeys(c),i(c)):objectKeys(c),u=l.length,p=0;u>p;)s=l[p++],DESCRIPTORS$5&&!call$g(a,c,s)||(r[s]=c[s]);return r}:$assign,$$12=_export,assign$7=objectAssign;$$12({target:"Object",stat:!0,arity:2,forced:Object.assign!==assign$7},{assign:assign$7});var path$b=path$w,assign$6=path$b.Object.assign,parent$12=assign$6,assign$5=parent$12,parent$11=assign$5,assign$4=parent$11,parent$10=assign$4,assign$3=parent$10,assign$2=assign$3,assign$1=assign$2,_Object$assign=getDefaultExportFromCjs(assign$1),get$2=get$3,_Reflect$get=getDefaultExportFromCjs(get$2),getIteratorMethod$7=getIteratorMethod$a,getIteratorMethod_1=getIteratorMethod$7,parent$$=getIteratorMethod_1,getIteratorMethod$6=parent$$,parent$_=getIteratorMethod$6,getIteratorMethod$5=parent$_,parent$Z=getIteratorMethod$5,getIteratorMethod$4=parent$Z,getIteratorMethod$3=getIteratorMethod$4,getIteratorMethod$2=getIteratorMethod$3,_getIteratorMethod=getDefaultExportFromCjs(getIteratorMethod$2),anObject$4=anObject$i,iteratorClose$2=iteratorClose$4,callWithSafeIterationClosing$1=function(e,t,r,n){try{return n?t(anObject$4(r)[0],r[1]):t(r)}catch(t){iteratorClose$2(e,"throw",t)}},bind$g=functionBindContext,call$f=functionCall,toObject$2=toObject$c,callWithSafeIterationClosing=callWithSafeIterationClosing$1,isArrayIteratorMethod=isArrayIteratorMethod$2,isConstructor3=isConstructor$4,lengthOfArrayLike$2=lengthOfArrayLike$a,createProperty=createProperty$6,getIterator$1=getIterator$3,getIteratorMethod$1=getIteratorMethod$a,$Array=Array,arrayFrom$1=function(e){var t=toObject$2(e),r=isConstructor3(this),n=arguments.length,o=n>1?arguments[1]:void 0,i=void 0!==o;i&&(o=bind$g(o,n>2?arguments[2]:void 0));var a,s,c,l,u,p,$=getIteratorMethod$1(t),f=0;if(!$||this===$Array&&isArrayIteratorMethod($))for(a=lengthOfArrayLike$2(t),s=r?new this(a):$Array(a);a>f;f++)p=i?o(t[f],f):t[f],createProperty(s,f,p);else for(u=(l=getIterator$1(t,$)).next,s=r?new this:[];!(c=call$f(u,l)).done;f++)p=i?callWithSafeIterationClosing(l,o,[c.value,f],!0):c.value,createProperty(s,f,p);return s.length=f,s},$$11=_export,from$8=arrayFrom$1,checkCorrectnessOfIteration=checkCorrectnessOfIteration$2,INCORRECT_ITERATION=!checkCorrectnessOfIteration((function(e){Array.from(e)}));$$11({target:"Array",stat:!0,forced:INCORRECT_ITERATION},{from:from$8});var path$a=path$w,from$7=path$a.Array.from,parent$Y=from$7,from$6=parent$Y,parent$X=from$6,from$5=parent$X,parent$W=from$5,from$4=parent$W,from$3=from$4,from$2=from$3,_Array$from=getDefaultExportFromCjs(from$2);function ownKeys$1(e,t){var r=_Object$keys(e);if(_Object$getOwnPropertySymbols){var n=_Object$getOwnPropertySymbols(e);t&&(n=_filterInstanceProperty(n).call(n,(function(t){return _Object$getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread2$1(e){for(var t=1;t<arguments.length;t++){var r,n,o=null!=arguments[t]?arguments[t]:{};t%2?_forEachInstanceProperty(r=ownKeys$1(Object(o),!0)).call(r,(function(t){_defineProperty$2(e,t,o[t])})):_Object$getOwnPropertyDescriptors?_Object$defineProperties(e,_Object$getOwnPropertyDescriptors(o)):_forEachInstanceProperty(n=ownKeys$1(Object(o))).call(n,(function(t){_Object$defineProperty(e,t,_Object$getOwnPropertyDescriptor(o,t))}))}return e}function _typeof$1(e){return(_typeof$1="function"==typeof _Symbol&&"symbol"==typeof _Symbol$iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof _Symbol&&e.constructor===_Symbol&&e!==_Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck$3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$3(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),_Object$defineProperty(e,_toPropertyKey$3(n.key),n)}}function _createClass$3(e,t,r){return t&&_defineProperties$3(e.prototype,t),r&&_defineProperties$3(e,r),_Object$defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty$2(e,t,r){return(t=_toPropertyKey$3(t))in e?_Object$defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toConsumableArray$1(e){return _arrayWithoutHoles$1(e)||_iterableToArray$1(e)||_unsupportedIterableToArray$2(e)||_nonIterableSpread$1()}function _arrayWithoutHoles$1(e){if(_Array$isArray(e))return _arrayLikeToArray$2(e)}function _iterableToArray$1(e){if(void 0!==_Symbol&&null!=_getIteratorMethod(e)||null!=e["@@iterator"])return _Array$from(e)}function _unsupportedIterableToArray$2(e,t){var r;if(e){if("string"==typeof e)return _arrayLikeToArray$2(e,t);var n=_sliceInstanceProperty(r=Object.prototype.toString.call(e)).call(r,8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?_Array$from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray$2(e,t):void 0}}function _arrayLikeToArray$2(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _nonIterableSpread$1(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toPrimitive$3(e,t){if("object"!==_typeof$3(e)||null===e)return e;var r=e[_Symbol$toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof$3(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey$3(e){var t=_toPrimitive$3(e,"string");return"symbol"===_typeof$3(t)?t:String(t)}var eventemitter3={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}function o(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function i(e,t,n,i,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new o(n,i||e,a),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}_Object$create&&(n.prototype=_Object$create(null),(new n).__proto__||(r=!1)),s.prototype.eventNames=function(){var e,n,o=[];if(0===this._eventsCount)return o;for(n in e=this._events)t.call(e,n)&&o.push(r?_sliceInstanceProperty(n).call(n,1):n);return _Object$getOwnPropertySymbols?_concatInstanceProperty(o).call(o,_Object$getOwnPropertySymbols(e)):o},s.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 o=0,i=n.length,a=new Array(i);o<i;o++)a[o]=n[o].fn;return a},s.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,o,i,a){var s=r?r+e:e;if(!this._events[s])return!1;var c,l,u=this._events[s],p=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,o),!0;case 5:return u.fn.call(u.context,t,n,o,i),!0;case 6:return u.fn.call(u.context,t,n,o,i,a),!0}for(l=1,c=new Array(p-1);l<p;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var $,f=u.length;for(l=0;l<f;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),p){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,n);break;case 4:u[l].fn.call(u[l].context,t,n,o);break;default:if(!c)for($=1,c=new Array(p-1);$<p;$++)c[$-1]=arguments[$];u[l].fn.apply(u[l].context,c)}}return!0},s.prototype.on=function(e,t,r){return i(this,e,t,r,!1)},s.prototype.once=function(e,t,r){return i(this,e,t,r,!0)},s.prototype.removeListener=function(e,t,n,o){var i=r?r+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var s=this._events[i];if(s.fn)s.fn!==t||o&&!s.once||n&&s.context!==n||a(this,i);else{for(var c=0,l=[],u=s.length;c<u;c++)(s[c].fn!==t||o&&!s[c].once||n&&s[c].context!==n)&&l.push(s[c]);l.length?this._events[i]=1===l.length?l[0]:l:a(this,i)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=r,s.EventEmitter=s,e.exports=s}(eventemitter3);var eventemitter3Exports=eventemitter3.exports,EventEmitter=getDefaultExportFromCjs(eventemitter3Exports),$$10=_export,$some=arrayIteration.some,arrayMethodIsStrict$3=arrayMethodIsStrict$6,STRICT_METHOD$2=arrayMethodIsStrict$3("some");$$10({target:"Array",proto:!0,forced:!STRICT_METHOD$2},{some:function(e){return $some(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$9=entryVirtual$k,some$6=entryVirtual$9("Array").some,isPrototypeOf$a=objectIsPrototypeOf,method$7=some$6,ArrayPrototype$6=Array.prototype,some$5=function(e){var t=e.some;return e===ArrayPrototype$6||isPrototypeOf$a(ArrayPrototype$6,e)&&t===ArrayPrototype$6.some?method$7:t},parent$V=some$5,some$4=parent$V,parent$U=some$4,some$3=parent$U,parent$T=some$3,some$2=parent$T,some$1=some$2,some2=some$1,_someInstanceProperty=getDefaultExportFromCjs(some2),toIntegerOrInfinity$1=toIntegerOrInfinity$6,toString$7=toString$g,requireObjectCoercible$2=requireObjectCoercible$7,$RangeError$2=RangeError,stringRepeat=function(e){var t=toString$7(requireObjectCoercible$2(this)),r="",n=toIntegerOrInfinity$1(e);if(n<0||n==1/0)throw $RangeError$2("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(r+=t);return r},uncurryThis$b=functionUncurryThis,toLength=toLength$2,toString$6=toString$g,$repeat=stringRepeat,requireObjectCoercible$1=requireObjectCoercible$7,repeat2=uncurryThis$b($repeat),stringSlice$2=uncurryThis$b("".slice),ceil=Math.ceil,createMethod$1=function(e){return function(t,r,n){var o,i,a=toString$6(requireObjectCoercible$1(t)),s=toLength(r),c=a.length,l=void 0===n?" ":toString$6(n);return s<=c||""==l?a:((i=repeat2(l,ceil((o=s-c)/l.length))).length>o&&(i=stringSlice$2(i,0,o)),e?a+i:i+a)}},stringPad={start:createMethod$1(!1),end:createMethod$1(!0)},userAgent$2=engineUserAgent,stringPadWebkitBug=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(userAgent$2),$$$=_export,$padStart=stringPad.start,WEBKIT_BUG=stringPadWebkitBug;$$$({target:"String",proto:!0,forced:WEBKIT_BUG},{padStart:function(e){return $padStart(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$8=entryVirtual$k,padStart$6=entryVirtual$8("String").padStart,isPrototypeOf$9=objectIsPrototypeOf,method$6=padStart$6,StringPrototype$2=String.prototype,padStart$5=function(e){var t=e.padStart;return"string"==typeof e||e===StringPrototype$2||isPrototypeOf$9(StringPrototype$2,e)&&t===StringPrototype$2.padStart?method$6:t},parent$S=padStart$5,padStart$4=parent$S,parent$R=padStart$4,padStart$3=parent$R,parent$Q=padStart$3,padStart$2=parent$Q,padStart$1=padStart$2,padStart2=padStart$1,_padStartInstanceProperty=getDefaultExportFromCjs(padStart2),engineIsBun="function"==typeof Bun&&Bun&&"string"==typeof Bun.version,global$8=global$s,apply$1=functionApply,isCallable$6=isCallable$r,ENGINE_IS_BUN=engineIsBun,USER_AGENT=engineUserAgent,arraySlice$3=arraySlice$7,validateArgumentsLength$3=validateArgumentsLength$5,Function$1=global$8.Function,WRAP=/MSIE .\./.test(USER_AGENT)||ENGINE_IS_BUN&&function(){var e=global$8.Bun.version.split(".");return e.length<3||0==e[0]&&(e[1]<3||3==e[1]&&0==e[2])}(),schedulersFix$2=function(e,t){var r=t?2:1;return WRAP?function(n,o){var i=validateArgumentsLength$3(arguments.length,1)>r,a=isCallable$6(n)?n:Function$1(n),s=i?arraySlice$3(arguments,r):[],c=i?function(){apply$1(a,this,s)}:a;return t?e(c,o):e(c)}:e},$$_=_export,global$7=global$s,schedulersFix$1=schedulersFix$2,setInterval$5=schedulersFix$1(global$7.setInterval,!0);$$_({global:!0,bind:!0,forced:global$7.setInterval!==setInterval$5},{setInterval:setInterval$5});var $$Z=_export,global$6=global$s,schedulersFix=schedulersFix$2,setTimeout$6=schedulersFix(global$6.setTimeout,!0);$$Z({global:!0,bind:!0,forced:global$6.setTimeout!==setTimeout$6},{setTimeout:setTimeout$6});var path$9=path$w,setInterval$4=path$9.setInterval,parent$P=setInterval$4,setInterval$3=parent$P,parent$O=setInterval$3,setInterval$2=parent$O,setInterval$1=setInterval$2,setInterval=setInterval$1,_setInterval=getDefaultExportFromCjs(setInterval),path$8=path$w,setTimeout$5=path$8.setTimeout,parent$N=setTimeout$5,setTimeout$4=parent$N,parent$M=setTimeout$4,setTimeout$3=parent$M,setTimeout$2=setTimeout$3,setTimeout$1=setTimeout$2,_setTimeout=getDefaultExportFromCjs(setTimeout$1),$$Y=_export,$every=arrayIteration.every,arrayMethodIsStrict$2=arrayMethodIsStrict$6,STRICT_METHOD$1=arrayMethodIsStrict$2("every");$$Y({target:"Array",proto:!0,forced:!STRICT_METHOD$1},{every:function(e){return $every(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$7=entryVirtual$k,every$6=entryVirtual$7("Array").every,isPrototypeOf$8=objectIsPrototypeOf,method$5=every$6,ArrayPrototype$5=Array.prototype,every$5=function(e){var t=e.every;return e===ArrayPrototype$5||isPrototypeOf$8(ArrayPrototype$5,e)&&t===ArrayPrototype$5.every?method$5:t},parent$L=every$5,every$4=parent$L,parent$K=every$4,every$3=parent$K,parent$J=every$3,every$2=parent$J,every$1=every$2,every2=every$1,_everyInstanceProperty=getDefaultExportFromCjs(every2),global$5=global$s,fails$9=fails$z,uncurryThis$a=functionUncurryThis,toString$5=toString$g,trim$7=stringTrim.trim,whitespaces$1=whitespaces$4,charAt$2=uncurryThis$a("".charAt),$parseFloat$1=global$5.parseFloat,Symbol$1=global$5.Symbol,ITERATOR$3=Symbol$1&&Symbol$1.iterator,FORCED$2=1/$parseFloat$1(whitespaces$1+"-0")!=-1/0||ITERATOR$3&&!fails$9((function(){$parseFloat$1(Object(ITERATOR$3))})),numberParseFloat=FORCED$2?function(e){var t=trim$7(toString$5(e)),r=$parseFloat$1(t);return 0===r&&"-"==charAt$2(t,0)?-0:r}:$parseFloat$1,$$X=_export,$parseFloat=numberParseFloat;$$X({global:!0,forced:parseFloat!=numberParseFloat},{parseFloat:numberParseFloat});var path$7=path$w,_parseFloat$6=path$7.parseFloat,parent$I=_parseFloat$6,_parseFloat$5=parent$I,parent$H=_parseFloat$5,_parseFloat$4=parent$H,parent$G=_parseFloat$4,_parseFloat$3=parent$G,_parseFloat$2=_parseFloat$3,_parseFloat=_parseFloat$2,_parseFloat$1=getDefaultExportFromCjs(_parseFloat),PROPER_FUNCTION_NAME=functionName.PROPER,fails$8=fails$z,whitespaces=whitespaces$4,non="
",stringTrimForced=function(e){return fails$8((function(){return!!whitespaces[e]()||non[e]()!==non||PROPER_FUNCTION_NAME&&whitespaces[e].name!==e}))},$$W=_export,$trim=stringTrim.trim,forcedStringTrimMethod=stringTrimForced;$$W({target:"String",proto:!0,forced:forcedStringTrimMethod("trim")},{trim:function(){return $trim(this)}});var entryVirtual$6=entryVirtual$k,trim$6=entryVirtual$6("String").trim,isPrototypeOf$7=objectIsPrototypeOf,method$4=trim$6,StringPrototype$1=String.prototype,trim$5=function(e){var t=e.trim;return"string"==typeof e||e===StringPrototype$1||isPrototypeOf$7(StringPrototype$1,e)&&t===StringPrototype$1.trim?method$4:t},parent$F=trim$5,trim$4=parent$F,parent$E=trim$4,trim$3=parent$E,parent$D=trim$3,trim$2=parent$D,trim$1=trim$2,trim2=trim$1,_trimInstanceProperty=getDefaultExportFromCjs(trim2),arraySlice$2=arraySliceSimple,floor$2=Math.floor,mergeSort=function(e,t){var r=e.length,n=floor$2(r/2);return r<8?insertionSort(e,t):merge(e,mergeSort(arraySlice$2(e,0,n),t),mergeSort(arraySlice$2(e,n),t),t)},insertionSort=function(e,t){for(var r,n,o=e.length,i=1;i<o;){for(n=i,r=e[i];n&&t(e[n-1],r)>0;)e[n]=e[--n];n!==i++&&(e[n]=r)}return e},merge=function(e,t,r,n){for(var o=t.length,i=r.length,a=0,s=0;a<o||s<i;)e[a+s]=a<o&&s<i?n(t[a],r[s])<=0?t[a++]:r[s++]:a<o?t[a++]:r[s++];return e},arraySort$1=mergeSort,userAgent$1=engineUserAgent,firefox=userAgent$1.match(/firefox\/(\d+)/i),engineFfVersion=!!firefox&&+firefox[1],UA=engineUserAgent,engineIsIeOrEdge=/MSIE|Trident/.test(UA),userAgent=engineUserAgent,webkit=userAgent.match(/AppleWebKit\/(\d+)\./),engineWebkitVersion=!!webkit&&+webkit[1],$$V=_export,uncurryThis$9=functionUncurryThis,aCallable$9=aCallable$l,toObject$1=toObject$c,lengthOfArrayLike$1=lengthOfArrayLike$a,deletePropertyOrThrow=deletePropertyOrThrow$2,toString$4=toString$g,fails$7=fails$z,internalSort=arraySort$1,arrayMethodIsStrict$1=arrayMethodIsStrict$6,FF=engineFfVersion,IE_OR_EDGE=engineIsIeOrEdge,V8=engineV8Version,WEBKIT=engineWebkitVersion,test=[],nativeSort=uncurryThis$9(test.sort),push$6=uncurryThis$9(test.push),FAILS_ON_UNDEFINED=fails$7((function(){test.sort(void 0)})),FAILS_ON_NULL=fails$7((function(){test.sort(null)})),STRICT_METHOD=arrayMethodIsStrict$1("sort"),STABLE_SORT=!fails$7((function(){if(V8)return V8<70;if(!(FF&&FF>3)){if(IE_OR_EDGE)return!0;if(WEBKIT)return WEBKIT<603;var e,t,r,n,o="";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++)test.push({k:t+n,v:r})}for(test.sort((function(e,t){return t.v-e.v})),n=0;n<test.length;n++)t=test[n].k.charAt(0),o.charAt(o.length-1)!==t&&(o+=t);return"DGBEFHACIJK"!==o}})),FORCED$1=FAILS_ON_UNDEFINED||!FAILS_ON_NULL||!STRICT_METHOD||!STABLE_SORT,getSortCompare=function(e){return function(t,r){return void 0===r?-1:void 0===t?1:void 0!==e?+e(t,r)||0:toString$4(t)>toString$4(r)?1:-1}};$$V({target:"Array",proto:!0,forced:FORCED$1},{sort:function(e){void 0!==e&&aCallable$9(e);var t=toObject$1(this);if(STABLE_SORT)return void 0===e?nativeSort(t):nativeSort(t,e);var r,n,o=[],i=lengthOfArrayLike$1(t);for(n=0;n<i;n++)n in t&&push$6(o,t[n]);for(internalSort(o,getSortCompare(e)),r=lengthOfArrayLike$1(o),n=0;n<r;)t[n]=o[n++];for(;n<i;)deletePropertyOrThrow(t,n++);return t}});var entryVirtual$5=entryVirtual$k,sort$6=entryVirtual$5("Array").sort,isPrototypeOf$6=objectIsPrototypeOf,method$3=sort$6,ArrayPrototype$4=Array.prototype,sort$5=function(e){var t=e.sort;return e===ArrayPrototype$4||isPrototypeOf$6(ArrayPrototype$4,e)&&t===ArrayPrototype$4.sort?method$3:t},parent$C=sort$5,sort$4=parent$C,parent$B=sort$4,sort$3=parent$B,parent$A=sort$3,sort$2=parent$A,sort$1=sort$2,sort2=sort$1,_sortInstanceProperty=getDefaultExportFromCjs(sort2),$$U=_export,uncurryThis$8=functionUncurryThis,$Date=Date,thisTimeValue=uncurryThis$8($Date.prototype.getTime);$$U({target:"Date",stat:!0},{now:function(){return thisTimeValue(new $Date)}});var _context,path$6=path$w,now$5=path$6.Date.now,parent$z=now$5,now$4=parent$z,parent$y=now$4,now$3=parent$y,parent$x=now$3,now$2=parent$x,now$1=now$2,now2=now$1,_Date$now=getDefaultExportFromCjs(now2),XG_DEBUG_OPEN="undefined"!=typeof window&&window.location&&_indexOfInstanceProperty(_context=window.location.href).call(_context,"xgplayerdebugger=1")>-1,STYLE={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},XGTAG="%c[xgplayer]",XG_DEBUG={config:{debug:XG_DEBUG_OPEN?3:0},logInfo:function(e){for(var t,r,n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];this.config.debug>=3&&(r=console).log.apply(r,_concatInstanceProperty(t=[XGTAG,STYLE.info,e]).call(t,o))},logWarn:function(e){for(var t,r,n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];this.config.debug>=1&&(r=console).warn.apply(r,_concatInstanceProperty(t=[XGTAG,STYLE.warn,e]).call(t,o))},logError:function(e){var t,r;if(!(this.config.debug<1)){for(var n=this.config.debug>=2?"trace":"error",o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];(r=console)[n].apply(r,_concatInstanceProperty(t=[XGTAG,STYLE.error,e]).call(t,i))}}},XgplayerTimeRange=function(){function e(t){_classCallCheck$3(this,e),this.bufferedList=t}return _createClass$3(e,[{key:"start",value:function(e){return this.bufferedList[e].start}},{key:"end",value:function(e){return this.bufferedList[e].end}},{key:"length",get:function(){return this.bufferedList.length}}]),e}(),util={};function checkIsIn(e,t){for(var r=0,n=t.length;r<n;r++)if(_indexOfInstanceProperty(e).call(e,t[r])>-1)return!0;return!1}util.createDom=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=document.createElement(t);return i.className=o,i.innerHTML=r,_forEachInstanceProperty(e=_Object$keys(n)).call(e,(function(e){var r=e,o=n[e];"video"===t||"audio"===t||"live-video"===t?o&&i.setAttribute(r,o):i.setAttribute(r,o)})),i},util.createDomFromHtml=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{var n=document.createElement("div");n.innerHTML=e;var o=n.children;if(n=null,o.length>0){var i;if(o=o[0],r&&util.addClass(o,r),t)_forEachInstanceProperty(i=_Object$keys(t)).call(i,(function(e){o.setAttribute(e,t[e])}));return o}return null}catch(e){return XG_DEBUG.logError("util.createDomFromHtml",e),null}},util.hasClass=function(e,t){if(!e||!t)return!1;try{return _someInstanceProperty(Array.prototype).call(e.classList,(function(e){return e===t}))}catch(n){var r=e.className&&"object"===_typeof$1(e.className)?e.getAttribute("class"):e.className;return r&&!!r.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},util.addClass=function(e,t){if(e&&t)try{var r;_forEachInstanceProperty(r=t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g)).call(r,(function(t){t&&e.classList.add(t)}))}catch(r){util.hasClass(e,t)||(e.className&&"object"===_typeof$1(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},util.removeClass=function(e,t){if(e&&t)try{var r;_forEachInstanceProperty(r=t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g)).call(r,(function(t){t&&e.classList.remove(t)}))}catch(r){var n;if(util.hasClass(e,t))_forEachInstanceProperty(n=t.split(/\s+/g)).call(n,(function(t){var r=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===_typeof$1(e.className)?e.setAttribute("class",e.getAttribute("class").replace(r," ")):e.className=e.className.replace(r," ")}))}},util.toggleClass=function(e,t){var r;e&&_forEachInstanceProperty(r=t.split(/\s+/g)).call(r,(function(t){util.hasClass(e,t)?util.removeClass(e,t):util.addClass(e,t)}))},util.classNames=function(){for(var e=arguments,t=[],r=function(r){if("String"===util.typeOf(e[r]))t.push(e[r]);else if("Object"===util.typeOf(e[r])){var n;_mapInstanceProperty(n=_Object$keys(e[r])).call(n,(function(n){e[r][n]&&t.push(n)}))}},n=0;n<arguments.length;n++)r(n);return t.join(" ")},util.findDom=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,r=arguments.length>1?arguments[1]:void 0;try{e=t.querySelector(r)}catch(n){XG_DEBUG.logError("util.findDom",n),0===_indexOfInstanceProperty(r).call(r,"#")&&(e=t.getElementById(_sliceInstanceProperty(r).call(r,1)))}return e},util.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},util.padStart=function(e,t,r){for(var n=String(r),o=t>>0,i=Math.ceil(o/n.length),a=[],s=String(e);i--;)a.push(n);return a.join("").substring(0,o-s.length)+s},util.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=_padStartInstanceProperty(util).call(util,Math.floor(e/3600),2,0),r=_padStartInstanceProperty(util).call(util,Math.floor((e-3600*t)/60),2,0),n=_padStartInstanceProperty(util).call(util,Math.floor(e-3600*t-60*r),2,0);return("00"===t?[r,n]:[t,r,n]).join(":")},util.event=function(e){if(e.touches){var t=e.touches[0]||e.changedTouches[0];e.clientX=t.clientX||0,e.clientY=t.clientY||0,e.offsetX=t.pageX-t.target.offsetLeft,e.offsetY=t.pageY-t.target.offsetTop}e._target=e.target||e.srcElement},util.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},util.deepCopy=function(e,t){var r;if("Object"===util.typeOf(t)&&"Object"===util.typeOf(e))return _forEachInstanceProperty(r=_Object$keys(t)).call(r,(function(r){if("Object"!==util.typeOf(t[r])||t[r]instanceof Node)if("Array"===util.typeOf(t[r])){var n;e[r]="Array"===util.typeOf(e[r])?_concatInstanceProperty(n=e[r]).call(n,t[r]):t[r]}else e[r]=t[r];else void 0===e[r]||void 0===e[r]?e[r]=t[r]:util.deepCopy(e[r],t[r])})),e},util.deepMerge=function(e,t){var r;return _mapInstanceProperty(r=_Object$keys(t)).call(r,(function(r){var n;"Array"===util.typeOf(t[r])&&"Array"===util.typeOf(e[r])?"Array"===util.typeOf(e[r])&&(n=e[r]).push.apply(n,_toConsumableArray$1(t[r])):util.typeOf(e[r])!==util.typeOf(t[r])||null===e[r]||"Object"!==util.typeOf(e[r])||t[r]instanceof window.Node?null!==t[r]&&(e[r]=t[r]):util.deepMerge(e[r],t[r])})),e},util.getBgImage=function(e){var t=(e.currentStyle||window.getComputedStyle(e,null)).backgroundImage;if(!t||"none"===t)return"";var r=document.createElement("a");return r.href=t.replace(/url\("|"\)/g,""),r.href},util.copyDom=function(e){if(e&&1===e.nodeType){var t=document.createElement(e.tagName);return _forEachInstanceProperty(Array.prototype).call(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),e.innerHTML&&(t.innerHTML=e.innerHTML),t}return""},util.setInterval=function(e,t,r,n){e._interval[t]||(e._interval[t]=_setInterval(_bindInstanceProperty(r).call(r,e),n))},util.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},util.setTimeout=function(e,t,r){e._timers||(e._timers=[]);var n=_setTimeout((function(){t(),util.clearTimeout(e,n)}),r);return e._timers.push(n),n},util.clearTimeout=function(e,t){var r=e._timers;if("Array"===util.typeOf(r)){for(var n=0;n<r.length;n++)if(r[n]===t){_spliceInstanceProperty(r).call(r,n,1),clearTimeout(t);break}}else clearTimeout(t)},util.clearAllTimers=function(e){var t=e._timers;"Array"===util.typeOf(t)&&(_mapInstanceProperty(t).call(t,(function(e){clearTimeout(e)})),e._timerIds=[])},util.createImgBtn=function(e,t,r,n){var o,i,a,s,c,l,u,p,$,f,d,y,h=util.createDom("xg-".concat(e),"",{},"xgplayer-".concat(e,"-img"));(h.style.backgroundImage='url("'.concat(t,'")'),r&&n)&&(_everyInstanceProperty(o=["px","rem","em","pt","dp","vw","vh","vm","%"]).call(o,(function(e){var t,o;return!(_indexOfInstanceProperty(r).call(r,e)>-1&&_indexOfInstanceProperty(n).call(n,e)>-1)||(u=_parseFloat$1(_trimInstanceProperty(t=_sliceInstanceProperty(r).call(r,0,_indexOfInstanceProperty(r).call(r,e))).call(t)),p=_parseFloat$1(_trimInstanceProperty(o=_sliceInstanceProperty(n).call(n,0,_indexOfInstanceProperty(n).call(n,e))).call(o)),$=e,!1)})),h.style.width=_concatInstanceProperty(i="".concat(u)).call(i,$),h.style.height=_concatInstanceProperty(a="".concat(p)).call(a,$),h.style.backgroundSize=_concatInstanceProperty(s=_concatInstanceProperty(c=_concatInstanceProperty(l="".concat(u)).call(l,$," ")).call(c,p)).call(s,$),h.style.margin="start"===e?_concatInstanceProperty(f=_concatInstanceProperty(d=_concatInstanceProperty(y="-".concat(p/2)).call(y,$," auto auto -")).call(d,u/2)).call(f,$):"auto 5px auto 5px");return h},util.Hex2RGBA=function(e,t){var r,n=[];if(/^\#[0-9A-F]{3}$/i.test(e)){var o="#";e.replace(/[0-9A-F]/gi,(function(e){o+=e+e})),e=o}return/^#[0-9A-F]{6}$/i.test(e)?(e.replace(/[0-9A-F]{2}/gi,(function(e){n.push(_parseInt$1(e,16))})),_concatInstanceProperty(r="rgba(".concat(n.join(","),", ")).call(r,t,")")):"rgba(255, 255, 255, 0.1)"},util.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},util.checkIsFunction=function(e){return e&&"function"==typeof e},util.checkIsObject=function(e){return null!==e&&"object"===_typeof$1(e)},util.hide=function(e){e.style.display="none"},util.show=function(e,t){e.style.display=t||"block"},util.isUndefined=function(e){if(null==e)return!0},util.isNotNull=function(e){return!(null==e)},util.setStyleFromCsstext=function(e,t){if(t)if("String"===util.typeOf(t)){var r=t.replace(/\s+/g,"").split(";");_mapInstanceProperty(r).call(r,(function(t){if(t){var r=t.split(":");r.length>1&&(e.style[r[0]]=r[1])}}))}else{var n;_mapInstanceProperty(n=_Object$keys(t)).call(n,(function(r){e.style[r]=t[r]}))}},util.filterStyleFromText=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],n=e.style.cssText;if(!n)return{};var o=n.replace(/\s+/g,"").split(";"),i={},a={};return _mapInstanceProperty(o).call(o,(function(e){if(e){var t=e.split(":");t.length>1&&(checkIsIn(t[0],r)?i[t[0]]=t[1]:a[t[0]]=t[1])}})),e.setAttribute("style",""),_mapInstanceProperty(t=_Object$keys(a)).call(t,(function(t){e.style[t]=a[t]})),i},util.getStyleFromCsstext=function(e){var t=e.style.cssText;if(!t)return{};var r=t.replace(/\s+/g,"").split(";"),n={};return _mapInstanceProperty(r).call(r,(function(e){if(e){var t=e.split(":");t.length>1&&(n[t[0]]=t[1])}})),n},util.preloadImg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){var n=new window.Image;n.onload=function(e){n=null,t&&t(e)},n.onerror=function(e){n=null,r&&r(e)},n.src=e}},util.stopPropagation=function(e){e&&e.stopPropagation()},util.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},util.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},util.checkTouchSupport=function(){return"ontouchstart"in window},util.getBuffered2=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,r=[],n=0;n<e.length;n++)r.push({start:e.start(n)<.5?0:e.start(n),end:e.end(n)});_sortInstanceProperty(r).call(r,(function(e,t){var r=e.start-t.start;return r||t.end-e.end}));var o=[];if(t)for(var i=0;i<r.length;i++){var a=o.length;if(a){var s=o[a-1].end;r[i].start-s<t?r[i].end>s&&(o[a-1].end=r[i].end):o.push(r[i])}else o.push(r[i])}else o=r;return new XgplayerTimeRange(o)},util.getEventPos=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e.touches&&e.touches.length>0&&(e=e.touches[0]),{x:e.x/t,y:e.y/t,clientX:e.clientX/t,clientY:e.clientY/t,offsetX:e.offsetX/t,offsetY:e.offsetY/t,pageX:e.pageX/t,pageY:e.pageY/t}},util.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},util.getHostFromUrl=function(e){if("String"!==util.typeOf(e))return"";var t=e.split("/"),r="";return t.length>3&&t[2]&&(r=t[2]),r},util.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},util.isMSE=function(e){return e.media&&(e=e.media),!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},util.isBlob=function(e){return"string"==typeof e&&/^blob/.test(e)},util.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=_parseInt$1(e)}catch(t){e=0}return t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=_parseInt$1(window.performance.now())),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var r=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?r:3&r|8).toString(16)}))},util.createEvent=function(e){var t;return"function"==typeof window.Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},util.adjustTimeByDuration=function(e,t,r){return t&&e&&(e>t||r&&e<t)?t:e},util.createPositionBar=function(e,t){var r=util.createDom("xg-bar","",{"data-index":-1},e);return t.appendChild(r),r},util.getTransformStyle=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{x:0,y:0,scale:1,rotate:0},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n={scale:"".concat(t.scale||1),translate:_concatInstanceProperty(e="".concat(t.x||0,"%, ")).call(e,t.y||0,"%"),rotate:"".concat(t.rotate||0,"deg")},o=_Object$keys(n);return _forEachInstanceProperty(o).call(o,(function(e){var t,o=new RegExp("".concat(e,"\\([^\\(]+\\)"),"g"),i=_concatInstanceProperty(t="".concat(e,"(")).call(t,n[e],")");o.test(r)?(o.lastIndex=-1,r=r.replace(o,i)):r+="".concat(i," ")})),r},util.convertDeg=function(e){return Math.abs(e)<=1?360*e:e%360},util.getIndexByTime=function(e,t){var r=t.length,n=-1;if(r<1)return n;if(e<=t[0].end||r<2)n=0;else if(e>t[r-1].end)n=r-1;else for(var o=1;o<r;o++)if(e>t[o-1].end&&e<=t[o].end){n=o;break}return n},util.getOffsetCurrentTime=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,n=-1;if((n=r>=0&&r<t.length?r:util.getIndexByTime(e,t))<0)return-1;var o=t.length,i=t[n],a=i.start,s=i.end,c=i.cTime,l=i.offset;return e<a?c:e>=a&&e<=s?e-l:e>s&&n>=o-1?s:-1},util.getCurrentTimeByOffset=function(e,t){var r=-1;if(!t||t.length<0)return e;for(var n=0;n<t.length;n++)if(e<=t[n].duration){r=n;break}if(-1!==r){var o=t[r].start;return r-1<0?o+e:o+(e-t[r-1].duration)}return e};var version="3.0.21-rc.21",ERROR_MAP={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},Errors=_createClass$3((function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null};_classCallCheck$3(this,e);var n=t&&t.i18n?t.i18n.ERROR_TYPES:null;if(t.media){var o,i=r.mediaError?r.mediaError:t.media.error||{},a=t.duration,s=t.currentTime,c=t.ended,l=t.src,u=t.currentSrc,p=t.media,$=p.readyState,f=p.networkState,d=r.errorCode||i.code;ERROR_MAP[d]&&(d=ERROR_MAP[d]);var y={playerVersion:version,currentTime:s,duration:a,ended:c,readyState:$,networkState:f,src:l||u,errorType:r.errorType,errorCode:d,message:r.errorMessage||i.message,mediaError:i,originError:r.originError?r.originError.stack:"",host:util.getHostFromUrl(l||u)};return r.ext&&_mapInstanceProperty(o=_Object$keys(r.ext)).call(o,(function(e){y[e]=r.ext[e]})),y}if(arguments.length>1){for(var h={playerVersion:version,domain:document.domain},_=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],g=0;g<arguments.length;g++)h[_[g]]=arguments[g];return h.ex=n?(n[arguments[0]]||{}).msg:"",h}})),ERROR="error",DESTROY="destroy",URL_CHANGE="urlchange";function callHandler(e,t,r){for(var n,o=arguments.length,i=new Array(o>3?o-3:0),a=3;a<o;a++)i[a-3]=arguments[a];var s,c=t.call.apply(t,_concatInstanceProperty(n=[e]).call(n,i));r&&"function"==typeof r&&(c&&c.then?c.then((function(){for(var t,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r.call.apply(r,_concatInstanceProperty(t=[e]).call(t,o))})):r.call.apply(r,_concatInstanceProperty(s=[e]).call(s,i)))}function hook(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{pre:null,next:null};return this.__hooks||(this.__hooks={}),!this.__hooks[e]&&(this.__hooks[e]=null),_bindInstanceProperty(r=function(){var r,o=arguments,i=this;if(n.pre)try{var a,s;(s=n.pre).call.apply(s,_concatInstanceProperty(a=[this]).call(a,_sliceInstanceProperty(Array.prototype).call(arguments)))}catch(t){var c,l;throw t.message=_concatInstanceProperty(c=_concatInstanceProperty(l="[pluginName: ".concat(this.pluginName,":")).call(l,e,":pre error] >> ")).call(c,t.message),t}if(this.__hooks&&this.__hooks[e])try{var u,p=runHooks(this,e,t);if(p)if(p.then)p.then((function(e){var r;!1!==e&&callHandler.apply(void 0,_concatInstanceProperty(r=[i,t,n.next]).call(r,_toConsumableArray$1(o)))})).catch((function(e){throw e}));else callHandler.apply(void 0,_concatInstanceProperty(u=[this,t,n.next]).call(u,_sliceInstanceProperty(Array.prototype).call(arguments)));else if(void 0===p){var $;callHandler.apply(void 0,_concatInstanceProperty($=[this,t,n.next]).call($,_sliceInstanceProperty(Array.prototype).call(arguments)))}}catch(t){var f,d;throw t.message=_concatInstanceProperty(f=_concatInstanceProperty(d="[pluginName: ".concat(this.pluginName,":")).call(d,e,"] >> ")).call(f,t.message),t}else callHandler.apply(void 0,_concatInstanceProperty(r=[this,t,n.next]).call(r,_sliceInstanceProperty(Array.prototype).call(arguments)))}).call(r,this)}function findHookIndex(e,t){var r=this.__hooks;if(!r||!_Array$isArray(r[e]))return-1;for(var n=r[e],o=0;o<n.length;o++)if(n[o]===t)return o;return-1}function useHooks(e,t){var r=this.__hooks;if(r)return r.hasOwnProperty(e)?(_Array$isArray(r[e])||(r[e]=[]),-1===findHookIndex.call(this,e,t)&&r[e].push(t),!0):(console.warn("has no supported hook which name [".concat(e,"]")),!1)}function removeHooks(e,t){var r=this.__hooks;if(r)if(_Array$isArray(r[e])){var n=r[e],o=findHookIndex.call(this,e,t);-1!==o&&_spliceInstanceProperty(n).call(n,o,1)}else r[e]&&(r[e]=null)}function hooksDescriptor(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.__hooks={},t&&_mapInstanceProperty(t).call(t,(function(t){e.__hooks[t]=null})),_Object$defineProperty(e,"hooks",{get:function(){var t;return e.__hooks&&_mapInstanceProperty(t=_Object$keys(e.__hooks)).call(t,(function(t){if(e.__hooks[t])return t}))}})}function delHooksDescriptor(e){e.__hooks=null}function runHooks(e,t,r){for(var n=arguments.length,o=new Array(n>3?n-3:0),i=3;i<n;i++)o[i-3]=arguments[i];if(e.__hooks&&_Array$isArray(e.__hooks[t])){var a,s=e.__hooks[t],c=-1;return function e(t,r,n){for(var o,i,a=arguments.length,l=new Array(a>3?a-3:0),u=3;u<a;u++)l[u-3]=arguments[u];if(c++,0===s.length||c===s.length)return n.call.apply(n,_concatInstanceProperty(i=[t,t]).call(i,l));var p,$=s[c],f=$.call.apply($,_concatInstanceProperty(o=[t,t]).call(o,l));return f&&f.then?f.then((function(o){var i;return!1===o?null:e.apply(void 0,_concatInstanceProperty(i=[t,r,n]).call(i,l))})).catch((function(e){console.warn("[runHooks]".concat(r," reject"),e.message)})):!1!==f?e.apply(void 0,_concatInstanceProperty(p=[t,r,n]).call(p,l)):void 0}.apply(void 0,_concatInstanceProperty(a=[e,t,r]).call(a,o))}var l;return r.call.apply(r,_concatInstanceProperty(l=[e,e]).call(l,o))}function showErrorMsg(e,t){var r;XG_DEBUG.logError(_concatInstanceProperty(r="[".concat(e,"] event or callback cant be undefined or null when call ")).call(r,t))}var BasePlugin=function(){function e(t){_classCallCheck$3(this,e),util.checkIsFunction(this.beforeCreate)&&this.beforeCreate(t),hooksDescriptor(this),this.__args=t,this.__events={},this.__onceEvents={},this.config=t.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(t)}return _createClass$3(e,[{key:"beforeCreate",value:function(e){}},{key:"afterCreate",value:function(){}},{key:"beforePlayerInit",value:function(){}},{key:"onPluginsReady",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"destroy",value:function(){}},{key:"__init",value:function(e){this.player=e.player,this.playerConfig=e.player&&e.player.config,this.pluginName=e.pluginName?e.pluginName.toLowerCase():this.constructor.pluginName.toLowerCase(),this.logger=e.player&&e.player.logger}},{key:"updateLang",value:function(e){e||(e=this.lang)}},{key:"lang",get:function(){return this.player.lang}},{key:"i18n",get:function(){return this.player.i18n}},{key:"i18nKeys",get:function(){return this.player.i18nKeys}},{key:"domEventType",get:function(){var e=util.checkTouchSupport()?"touch":"mouse";return!this.playerConfig||"touch"!==this.playerConfig.domEventType&&"mouse"!==this.playerConfig.domEventType||(e=this.playerConfig.domEventType),e}},{key:"on",value:function(e,t){var r=this;e&&t&&this.player?"string"==typeof e?(this.__events[e]=t,this.player.on(e,t)):_Array$isArray(e)&&_forEachInstanceProperty(e).call(e,(function(e){r.__events[e]=t,r.player.on(e,t)})):showErrorMsg(this.pluginName,"plugin.on(event, callback)")}},{key:"once",value:function(e,t){var r=this;e&&t&&this.player?"string"==typeof e?(this.__onceEvents[e]=t,this.player.once(e,t)):_Array$isArray(e)&&_forEachInstanceProperty(e).call(e,(function(n){r.__onceEvents[n]=t,r.player.once(e,t)})):showErrorMsg(this.pluginName,"plugin.once(event, callback)")}},{key:"off",value:function(e,t){var r=this;e&&t&&this.player?"string"==typeof e?(delete this.__events[e],this.player.off(e,t)):_Array$isArray(e)&&_forEachInstanceProperty(e).call(e,(function(n){delete r.__events[e],r.player.off(n,t)})):showErrorMsg(this.pluginName,"plugin.off(event, callback)")}},{key:"offAll",value:function(){var e,t=this;_forEachInstanceProperty(e=["__events","__onceEvents"]).call(e,(function(e){var r;_forEachInstanceProperty(r=_Object$keys(t[e])).call(r,(function(r){t[e][r]&&t.off(r,t[e][r]),r&&delete t[e][r]}))})),this.__events={},this.__onceEvents={}}},{key:"emit",value:function(e){var t,r;if(this.player){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];(r=this.player).emit.apply(r,_concatInstanceProperty(t=[e]).call(t,o))}}},{key:"emitUserAction",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.player){var n=_objectSpread2$1(_objectSpread2$1({},r),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,n)}}},{key:"hook",value:function(e,t){var r;return hook.call.apply(hook,_concatInstanceProperty(r=[this]).call(r,_sliceInstanceProperty(Array.prototype).call(arguments)))}},{key:"useHooks",value:function(e,t){for(var r,n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];return useHooks.call.apply(useHooks,_concatInstanceProperty(r=[this]).call(r,_sliceInstanceProperty(Array.prototype).call(arguments)))}},{key:"removeHooks",value:function(e,t){for(var r,n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];return removeHooks.call.apply(removeHooks,_concatInstanceProperty(r=[this]).call(r,_sliceInstanceProperty(Array.prototype).call(arguments)))}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.player)return r&&(t.pluginName=r),this.player.registerPlugin({plugin:e,options:t})}},{key:"getPlugin",value:function(e){return this.player?this.player.getPlugin(e):null}},{key:"__destroy",value:function(){var e,t=this,r=this.player,n=this.pluginName;this.offAll(),util.clearAllTimers(this),util.checkIsFunction(this.destroy)&&this.destroy(),_mapInstanceProperty(e=["player","playerConfig","pluginName","logger","__args","__hooks"]).call(e,(function(e){t[e]=null})),r.unRegisterPlugin(n),delHooksDescriptor(this)}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&_Object$defineProperty(e,r,t[r])}},{key:"defineMethod",value:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&"function"==typeof t[r]&&_Object$defineProperty(e,r,{configurable:!0,value:t[r]})}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),e}(),$$T=_export,$findIndex=arrayIteration.findIndex,FIND_INDEX="findIndex",SKIPS_HOLES=!0;FIND_INDEX in[]&&Array(1)[FIND_INDEX]((function(){SKIPS_HOLES=!1})),$$T({target:"Array",proto:!0,forced:SKIPS_HOLES},{findIndex:function(e){return $findIndex(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$4=entryVirtual$k,findIndex$6=entryVirtual$4("Array").findIndex,isPrototypeOf$5=objectIsPrototypeOf,method$2=findIndex$6,ArrayPrototype$3=Array.prototype,findIndex$5=function(e){var t=e.findIndex;return e===ArrayPrototype$3||isPrototypeOf$5(ArrayPrototype$3,e)&&t===ArrayPrototype$3.findIndex?method$2:t},parent$w=findIndex$5,findIndex$4=parent$w,parent$v=findIndex$4,findIndex$3=parent$v,parent$u=findIndex$3,findIndex$2=parent$u,findIndex$1=findIndex$2,findIndex2=findIndex$1,_findIndexInstanceProperty=getDefaultExportFromCjs(findIndex2),fails$6=fails$z,wellKnownSymbol$4=wellKnownSymbol$r,DESCRIPTORS$4=descriptors,IS_PURE=isPure,ITERATOR$2=wellKnownSymbol$4("iterator"),urlConstructorDetection=!fails$6((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),r+=n+e})),IS_PURE&&!e.toJSON||!t.size&&(IS_PURE||!DESCRIPTORS$4)||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[ITERATOR$2]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host})),uncurryThis$7=functionUncurryThis,maxInt=2147483647,base=36,tMin=1,tMax=26,skew=38,damp=700,initialBias=72,initialN=128,delimiter="-",regexNonASCII=/[^\0-\u007E]/,regexSeparators=/[.\u3002\uFF0E\uFF61]/g,OVERFLOW_ERROR="Overflow: input needs wider integers to process",baseMinusTMin=base-tMin,$RangeError$1=RangeError,exec$1=uncurryThis$7(regexSeparators.exec),floor$1=Math.floor,fromCharCode$1=String.fromCharCode,charCodeAt=uncurryThis$7("".charCodeAt),join$3=uncurryThis$7([].join),push$5=uncurryThis$7([].push),replace$2=uncurryThis$7("".replace),split$2=uncurryThis$7("".split),toLowerCase$1=uncurryThis$7("".toLowerCase),ucs2decode=function(e){for(var t=[],r=0,n=e.length;r<n;){var o=charCodeAt(e,r++);if(o>=55296&&o<=56319&&r<n){var i=charCodeAt(e,r++);56320==(64512&i)?push$5(t,((1023&o)<<10)+(1023&i)+65536):(push$5(t,o),r--)}else push$5(t,o)}return t},digitToBasic=function(e){return e+22+75*(e<26)},adapt=function(e,t,r){var n=0;for(e=r?floor$1(e/damp):e>>1,e+=floor$1(e/t);e>baseMinusTMin*tMax>>1;)e=floor$1(e/baseMinusTMin),n+=base;return floor$1(n+(baseMinusTMin+1)*e/(e+skew))},encode$1=function(e){var t,r,n=[],o=(e=ucs2decode(e)).length,i=initialN,a=0,s=initialBias;for(t=0;t<e.length;t++)(r=e[t])<128&&push$5(n,fromCharCode$1(r));var c=n.length,l=c;for(c&&push$5(n,delimiter);l<o;){var u=maxInt;for(t=0;t<e.length;t++)(r=e[t])>=i&&r<u&&(u=r);var p=l+1;if(u-i>floor$1((maxInt-a)/p))throw $RangeError$1(OVERFLOW_ERROR);for(a+=(u-i)*p,i=u,t=0;t<e.length;t++){if((r=e[t])<i&&++a>maxInt)throw $RangeError$1(OVERFLOW_ERROR);if(r==i){for(var $=a,f=base;;){var d=f<=s?tMin:f>=s+tMax?tMax:f-s;if($<d)break;var y=$-d,h=base-d;push$5(n,fromCharCode$1(digitToBasic(d+y%h))),$=floor$1(y/h),f+=base}push$5(n,fromCharCode$1(digitToBasic($))),s=adapt(a,p,l==c),a=0,l++}}a++,i++}return join$3(n,"")},stringPunycodeToAscii=function(e){var t,r,n=[],o=split$2(replace$2(toLowerCase$1(e),regexSeparators,"."),".");for(t=0;t<o.length;t++)r=o[t],push$5(n,exec$1(regexNonASCII,r)?"xn--"+encode$1(r):r);return join$3(n,".")},defineBuiltIn$2=defineBuiltIn$8,defineBuiltIns$2=function(e,t,r){for(var n in t)r&&r.unsafe&&e[n]?e[n]=t[n]:defineBuiltIn$2(e,n,t[n],r);return e},$$S=_export,global$4=global$s,call$e=functionCall,uncurryThis$6=functionUncurryThis,DESCRIPTORS$3=descriptors,USE_NATIVE_URL$2=urlConstructorDetection,defineBuiltIn$1=defineBuiltIn$8,defineBuiltInAccessor$2=defineBuiltInAccessor$5,defineBuiltIns$1=defineBuiltIns$2,setToStringTag$2=setToStringTag$9,createIteratorConstructor=iteratorCreateConstructor,InternalStateModule$3=internalState,anInstance$3=anInstance$5,isCallable$5=isCallable$r,hasOwn$5=hasOwnProperty_1,bind$f=functionBindContext,classof$4=classof$e,anObject$3=anObject$i,isObject$6=isObject$m,$toString$1=toString$g,create$1=objectCreate,createPropertyDescriptor=createPropertyDescriptor$8,getIterator=getIterator$3,getIteratorMethod=getIteratorMethod$a,validateArgumentsLength$2=validateArgumentsLength$5,wellKnownSymbol$3=wellKnownSymbol$r,arraySort=arraySort$1,ITERATOR$1=wellKnownSymbol$3("iterator"),URL_SEARCH_PARAMS="URLSearchParams",URL_SEARCH_PARAMS_ITERATOR=URL_SEARCH_PARAMS+"Iterator",setInternalState$3=InternalStateModule$3.set,getInternalParamsState=InternalStateModule$3.getterFor(URL_SEARCH_PARAMS),getInternalIteratorState=InternalStateModule$3.getterFor(URL_SEARCH_PARAMS_ITERATOR),getOwnPropertyDescriptor5=Object.getOwnPropertyDescriptor,safeGetBuiltIn=function(e){if(!DESCRIPTORS$3)return global$4[e];var t=getOwnPropertyDescriptor5(global$4,e);return t&&t.value},nativeFetch=safeGetBuiltIn("fetch"),NativeRequest=safeGetBuiltIn("Request"),Headers$1=safeGetBuiltIn("Headers"),RequestPrototype=NativeRequest&&NativeRequest.prototype,HeadersPrototype=Headers$1&&Headers$1.prototype,RegExp$1=global$4.RegExp,TypeError$2=global$4.TypeError,decodeURIComponent=global$4.decodeURIComponent,encodeURIComponent$1=global$4.encodeURIComponent,charAt$1=uncurryThis$6("".charAt),join$2=uncurryThis$6([].join),push$4=uncurryThis$6([].push),replace$1=uncurryThis$6("".replace),shift$1=uncurryThis$6([].shift),splice2=uncurryThis$6([].splice),split$1=uncurryThis$6("".split),stringSlice$1=uncurryThis$6("".slice),plus=/\+/g,sequences=Array(4),percentSequence=function(e){return sequences[e-1]||(sequences[e-1]=RegExp$1("((?:%[\\da-f]{2}){"+e+"})","gi"))},percentDecode=function(e){try{return decodeURIComponent(e)}catch(t){return e}},deserialize=function(e){var t=replace$1(e,plus," "),r=4;try{return decodeURIComponent(t)}catch(e){for(;r;)t=replace$1(t,percentSequence(r--),percentDecode);return t}},find2=/[!'()~]|%20/g,replacements={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},replacer=function(e){return replacements[e]},serialize=function(e){return replace$1(encodeURIComponent$1(e),find2,replacer)},URLSearchParamsIterator=createIteratorConstructor((function(e,t){setInternalState$3(this,{type:URL_SEARCH_PARAMS_ITERATOR,iterator:getIterator(getInternalParamsState(e).entries),kind:t})}),"Iterator",(function(){var e=getInternalIteratorState(this),t=e.kind,r=e.iterator.next(),n=r.value;return r.done||(r.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),r}),!0),URLSearchParamsState=function(e){this.entries=[],this.url=null,void 0!==e&&(isObject$6(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===charAt$1(e,0)?stringSlice$1(e,1):e:$toString$1(e)))};URLSearchParamsState.prototype={type:URL_SEARCH_PARAMS,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,o,i,a,s,c=getIteratorMethod(e);if(c)for(r=(t=getIterator(e,c)).next;!(n=call$e(r,t)).done;){if(i=(o=getIterator(anObject$3(n.value))).next,(a=call$e(i,o)).done||(s=call$e(i,o)).done||!call$e(i,o).done)throw TypeError$2("Expected sequence with length 2");push$4(this.entries,{key:$toString$1(a.value),value:$toString$1(s.value)})}else for(var l in e)hasOwn$5(e,l)&&push$4(this.entries,{key:l,value:$toString$1(e[l])})},parseQuery:function(e){if(e)for(var t,r,n=split$1(e,"&"),o=0;o<n.length;)(t=n[o++]).length&&(r=split$1(t,"="),push$4(this.entries,{key:deserialize(shift$1(r)),value:deserialize(join$2(r,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],n=0;n<t.length;)e=t[n++],push$4(r,serialize(e.key)+"="+serialize(e.value));return join$2(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var URLSearchParamsConstructor=function(){anInstance$3(this,URLSearchParamsPrototype);var e=setInternalState$3(this,new URLSearchParamsState(arguments.length>0?arguments[0]:void 0));DESCRIPTORS$3||(this.length=e.entries.length)},URLSearchParamsPrototype=URLSearchParamsConstructor.prototype;if(defineBuiltIns$1(URLSearchParamsPrototype,{append:function(e,t){validateArgumentsLength$2(arguments.length,2);var r=getInternalParamsState(this);push$4(r.entries,{key:$toString$1(e),value:$toString$1(t)}),DESCRIPTORS$3||this.length++,r.updateURL()},delete:function(e){validateArgumentsLength$2(arguments.length,1);for(var t=getInternalParamsState(this),r=t.entries,n=$toString$1(e),o=0;o<r.length;)r[o].key===n?splice2(r,o,1):o++;DESCRIPTORS$3||(this.length=r.length),t.updateURL()},get:function(e){validateArgumentsLength$2(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){validateArgumentsLength$2(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),n=[],o=0;o<t.length;o++)t[o].key===r&&push$4(n,t[o].value);return n},has:function(e){validateArgumentsLength$2(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function(e,t){validateArgumentsLength$2(arguments.length,1);for(var r,n=getInternalParamsState(this),o=n.entries,i=!1,a=$toString$1(e),s=$toString$1(t),c=0;c<o.length;c++)(r=o[c]).key===a&&(i?splice2(o,c--,1):(i=!0,r.value=s));i||push$4(o,{key:a,value:s}),DESCRIPTORS$3||(this.length=o.length),n.updateURL()},sort:function(){var e=getInternalParamsState(this);arraySort(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,r=getInternalParamsState(this).entries,n=bind$f(e,arguments.length>1?arguments[1]:void 0),o=0;o<r.length;)n((t=r[o++]).value,t.key,this)},keys:function(){return new URLSearchParamsIterator(this,"keys")},values:function(){return new URLSearchParamsIterator(this,"values")},entries:function(){return new URLSearchParamsIterator(this,"entries")}},{enumerable:!0}),defineBuiltIn$1(URLSearchParamsPrototype,ITERATOR$1,URLSearchParamsPrototype.entries,{name:"entries"}),defineBuiltIn$1(URLSearchParamsPrototype,"toString",(function(){return getInternalParamsState(this).serialize()}),{enumerable:!0}),DESCRIPTORS$3&&defineBuiltInAccessor$2(URLSearchParamsPrototype,"size",{get:function(){return getInternalParamsState(this).entries.length},configurable:!0,enumerable:!0}),setToStringTag$2(URLSearchParamsConstructor,URL_SEARCH_PARAMS),$$S({global:!0,constructor:!0,forced:!USE_NATIVE_URL$2},{URLSearchParams:URLSearchParamsConstructor}),!USE_NATIVE_URL$2&&isCallable$5(Headers$1)){var headersHas=uncurryThis$6(HeadersPrototype.has),headersSet=uncurryThis$6(HeadersPrototype.set),wrapRequestOptions=function(e){if(isObject$6(e)){var t,r=e.body;if(classof$4(r)===URL_SEARCH_PARAMS)return t=e.headers?new Headers$1(e.headers):new Headers$1,headersHas(t,"content-type")||headersSet(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),create$1(e,{body:createPropertyDescriptor(0,$toString$1(r)),headers:createPropertyDescriptor(0,t)})}return e};if(isCallable$5(nativeFetch)&&$$S({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return nativeFetch(e,arguments.length>1?wrapRequestOptions(arguments[1]):{})}}),isCallable$5(NativeRequest)){var RequestConstructor=function(e){return anInstance$3(this,RequestPrototype),new NativeRequest(e,arguments.length>1?wrapRequestOptions(arguments[1]):{})};RequestPrototype.constructor=RequestConstructor,RequestConstructor.prototype=RequestPrototype,$$S({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:RequestConstructor})}}var EOF,web_urlSearchParams_constructor={URLSearchParams:URLSearchParamsConstructor,getState:getInternalParamsState},$$R=_export,DESCRIPTORS$2=descriptors,USE_NATIVE_URL$1=urlConstructorDetection,global$3=global$s,bind$e=functionBindContext,uncurryThis$5=functionUncurryThis,defineBuiltIn=defineBuiltIn$8,defineBuiltInAccessor$1=defineBuiltInAccessor$5,anInstance$2=anInstance$5,hasOwn$4=hasOwnProperty_1,assign2=objectAssign,arrayFrom=arrayFrom$1,arraySlice$1=arraySliceSimple,codeAt=stringMultibyte.codeAt,toASCII=stringPunycodeToAscii,$toString=toString$g,setToStringTag$1=setToStringTag$9,validateArgumentsLength$1=validateArgumentsLength$5,URLSearchParamsModule=web_urlSearchParams_constructor,InternalStateModule$2=internalState,setInternalState$2=InternalStateModule$2.set,getInternalURLState=InternalStateModule$2.getterFor("URL"),URLSearchParams$1=URLSearchParamsModule.URLSearchParams,getInternalSearchParamsState=URLSearchParamsModule.getState,NativeURL=global$3.URL,TypeError$1=global$3.TypeError,parseInt$1=global$3.parseInt,floor=Math.floor,pow=Math.pow,charAt=uncurryThis$5("".charAt),exec=uncurryThis$5(/./.exec),join$1=uncurryThis$5([].join),numberToString=uncurryThis$5(1..toString),pop=uncurryThis$5([].pop),push$3=uncurryThis$5([].push),replace=uncurryThis$5("".replace),shift=uncurryThis$5([].shift),split=uncurryThis$5("".split),stringSlice=uncurryThis$5("".slice),toLowerCase=uncurryThis$5("".toLowerCase),unshift=uncurryThis$5([].unshift),INVALID_AUTHORITY="Invalid authority",INVALID_SCHEME="Invalid scheme",INVALID_HOST="Invalid host",INVALID_PORT="Invalid port",ALPHA=/[a-z]/i,ALPHANUMERIC=/[\d+-.a-z]/i,DIGIT=/\d/,HEX_START=/^0x/i,OCT=/^[0-7]+$/,DEC=/^\d+$/,HEX=/^[\da-f]+$/i,FORBIDDEN_HOST_CODE_POINT=/[\0\t\n\r #%/:<>?@[\\\]^|]/,FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT=/[\0\t\n\r #/:<>?@[\\\]^|]/,LEADING_C0_CONTROL_OR_SPACE=/^[\u0000-\u0020]+/,TRAILING_C0_CONTROL_OR_SPACE=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,TAB_AND_NEW_LINE=/[\t\n\r]/g,parseIPv4=function(e){var t,r,n,o,i,a,s,c=split(e,".");if(c.length&&""==c[c.length-1]&&c.length--,(t=c.length)>4)return e;for(r=[],n=0;n<t;n++){if(""==(o=c[n]))return e;if(i=10,o.length>1&&"0"==charAt(o,0)&&(i=exec(HEX_START,o)?16:8,o=stringSlice(o,8==i?1:2)),""===o)a=0;else{if(!exec(10==i?DEC:8==i?OCT:HEX,o))return e;a=parseInt$1(o,i)}push$3(r,a)}for(n=0;n<t;n++)if(a=r[n],n==t-1){if(a>=pow(256,5-t))return null}else if(a>255)return null;for(s=pop(r),n=0;n<r.length;n++)s+=r[n]*pow(256,3-n);return s},parseIPv6=function(e){var t,r,n,o,i,a,s,c=[0,0,0,0,0,0,0,0],l=0,u=null,p=0,$=function(){return charAt(e,p)};if(":"==$()){if(":"!=charAt(e,1))return;p+=2,u=++l}for(;$();){if(8==l)return;if(":"!=$()){for(t=r=0;r<4&&exec(HEX,$());)t=16*t+parseInt$1($(),16),p++,r++;if("."==$()){if(0==r)return;if(p-=r,l>6)return;for(n=0;$();){if(o=null,n>0){if(!("."==$()&&n<4))return;p++}if(!exec(DIGIT,$()))return;for(;exec(DIGIT,$());){if(i=parseInt$1($(),10),null===o)o=i;else{if(0==o)return;o=10*o+i}if(o>255)return;p++}c[l]=256*c[l]+o,2!=++n&&4!=n||l++}if(4!=n)return;break}if(":"==$()){if(p++,!$())return}else if($())return;c[l++]=t}else{if(null!==u)return;p++,u=++l}}if(null!==u)for(a=l-u,l=7;0!=l&&a>0;)s=c[l],c[l--]=c[u+a-1],c[u+--a]=s;else if(8!=l)return;return c},findLongestZeroSequence=function(e){for(var t=null,r=1,n=null,o=0,i=0;i<8;i++)0!==e[i]?(o>r&&(t=n,r=o),n=null,o=0):(null===n&&(n=i),++o);return o>r&&(t=n,r=o),t},serializeHost=function(e){var t,r,n,o;if("number"==typeof e){for(t=[],r=0;r<4;r++)unshift(t,e%256),e=floor(e/256);return join$1(t,".")}if("object"==typeof e){for(t="",n=findLongestZeroSequence(e),r=0;r<8;r++)o&&0===e[r]||(o&&(o=!1),n===r?(t+=r?":":"::",o=!0):(t+=numberToString(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},C0ControlPercentEncodeSet={},fragmentPercentEncodeSet=assign2({},C0ControlPercentEncodeSet,{" ":1,'"':1,"<":1,">":1,"`":1}),pathPercentEncodeSet=assign2({},fragmentPercentEncodeSet,{"#":1,"?":1,"{":1,"}":1}),userinfoPercentEncodeSet=assign2({},pathPercentEncodeSet,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),percentEncode=function(e,t){var r=codeAt(e,0);return r>32&&r<127&&!hasOwn$4(t,e)?e:encodeURIComponent(e)},specialSchemes={ftp:21,file:null,http:80,https:443,ws:80,wss:443},isWindowsDriveLetter=function(e,t){var r;return 2==e.length&&exec(ALPHA,charAt(e,0))&&(":"==(r=charAt(e,1))||!t&&"|"==r)},startsWithWindowsDriveLetter=function(e){var t;return e.length>1&&isWindowsDriveLetter(stringSlice(e,0,2))&&(2==e.length||"/"===(t=charAt(e,2))||"\\"===t||"?"===t||"#"===t)},isSingleDot=function(e){return"."===e||"%2e"===toLowerCase(e)},isDoubleDot=function(e){return".."===(e=toLowerCase(e))||"%2e."===e||".%2e"===e||"%2e%2e"===e},SCHEME_START={},SCHEME={},NO_SCHEME={},SPECIAL_RELATIVE_OR_AUTHORITY={},PATH_OR_AUTHORITY={},RELATIVE={},RELATIVE_SLASH={},SPECIAL_AUTHORITY_SLASHES={},SPECIAL_AUTHORITY_IGNORE_SLASHES={},AUTHORITY={},HOST={},HOSTNAME={},PORT={},FILE={},FILE_SLASH={},FILE_HOST={},PATH_START={},PATH={},CANNOT_BE_A_BASE_URL_PATH={},QUERY={},FRAGMENT={},URLState=function(e,t,r){var n,o,i,a=$toString(e);if(t){if(o=this.parse(a))throw TypeError$1(o);this.searchParams=null}else{if(void 0!==r&&(n=new URLState(r,!0)),o=this.parse(a,null,n))throw TypeError$1(o);(i=getInternalSearchParamsState(new URLSearchParams$1)).bindURL(this),this.searchParams=i}};URLState.prototype={type:"URL",parse:function(e,t,r){var n,o,i,a,s=this,c=t||SCHEME_START,l=0,u="",p=!1,$=!1,f=!1;for(e=$toString(e),t||(s.scheme="",s.username="",s.password="",s.host=null,s.port=null,s.path=[],s.query=null,s.fragment=null,s.cannotBeABaseURL=!1,e=replace(e,LEADING_C0_CONTROL_OR_SPACE,""),e=replace(e,TRAILING_C0_CONTROL_OR_SPACE,"$1")),e=replace(e,TAB_AND_NEW_LINE,""),n=arrayFrom(e);l<=n.length;){switch(o=n[l],c){case SCHEME_START:if(!o||!exec(ALPHA,o)){if(t)return INVALID_SCHEME;c=NO_SCHEME;continue}u+=toLowerCase(o),c=SCHEME;break;case SCHEME:if(o&&(exec(ALPHANUMERIC,o)||"+"==o||"-"==o||"."==o))u+=toLowerCase(o);else{if(":"!=o){if(t)return INVALID_SCHEME;u="",c=NO_SCHEME,l=0;continue}if(t&&(s.isSpecial()!=hasOwn$4(specialSchemes,u)||"file"==u&&(s.includesCredentials()||null!==s.port)||"file"==s.scheme&&!s.host))return;if(s.scheme=u,t)return void(s.isSpecial()&&specialSchemes[s.scheme]==s.port&&(s.port=null));u="","file"==s.scheme?c=FILE:s.isSpecial()&&r&&r.scheme==s.scheme?c=SPECIAL_RELATIVE_OR_AUTHORITY:s.isSpecial()?c=SPECIAL_AUTHORITY_SLASHES:"/"==n[l+1]?(c=PATH_OR_AUTHORITY,l++):(s.cannotBeABaseURL=!0,push$3(s.path,""),c=CANNOT_BE_A_BASE_URL_PATH)}break;case NO_SCHEME:if(!r||r.cannotBeABaseURL&&"#"!=o)return INVALID_SCHEME;if(r.cannotBeABaseURL&&"#"==o){s.scheme=r.scheme,s.path=arraySlice$1(r.path),s.query=r.query,s.fragment="",s.cannotBeABaseURL=!0,c=FRAGMENT;break}c="file"==r.scheme?FILE:RELATIVE;continue;case SPECIAL_RELATIVE_OR_AUTHORITY:if("/"!=o||"/"!=n[l+1]){c=RELATIVE;continue}c=SPECIAL_AUTHORITY_IGNORE_SLASHES,l++;break;case PATH_OR_AUTHORITY:if("/"==o){c=AUTHORITY;break}c=PATH;continue;case RELATIVE:if(s.scheme=r.scheme,o==EOF)s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice$1(r.path),s.query=r.query;else if("/"==o||"\\"==o&&s.isSpecial())c=RELATIVE_SLASH;else if("?"==o)s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice$1(r.path),s.query="",c=QUERY;else{if("#"!=o){s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice$1(r.path),s.path.length--,c=PATH;continue}s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice$1(r.path),s.query=r.query,s.fragment="",c=FRAGMENT}break;case RELATIVE_SLASH:if(!s.isSpecial()||"/"!=o&&"\\"!=o){if("/"!=o){s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,c=PATH;continue}c=AUTHORITY}else c=SPECIAL_AUTHORITY_IGNORE_SLASHES;break;case SPECIAL_AUTHORITY_SLASHES:if(c=SPECIAL_AUTHORITY_IGNORE_SLASHES,"/"!=o||"/"!=charAt(u,l+1))continue;l++;break;case SPECIAL_AUTHORITY_IGNORE_SLASHES:if("/"!=o&&"\\"!=o){c=AUTHORITY;continue}break;case AUTHORITY:if("@"==o){p&&(u="%40"+u),p=!0,i=arrayFrom(u);for(var d=0;d<i.length;d++){var y=i[d];if(":"!=y||f){var h=percentEncode(y,userinfoPercentEncodeSet);f?s.password+=h:s.username+=h}else f=!0}u=""}else if(o==EOF||"/"==o||"?"==o||"#"==o||"\\"==o&&s.isSpecial()){if(p&&""==u)return INVALID_AUTHORITY;l-=arrayFrom(u).length+1,u="",c=HOST}else u+=o;break;case HOST:case HOSTNAME:if(t&&"file"==s.scheme){c=FILE_HOST;continue}if(":"!=o||$){if(o==EOF||"/"==o||"?"==o||"#"==o||"\\"==o&&s.isSpecial()){if(s.isSpecial()&&""==u)return INVALID_HOST;if(t&&""==u&&(s.includesCredentials()||null!==s.port))return;if(a=s.parseHost(u))return a;if(u="",c=PATH_START,t)return;continue}"["==o?$=!0:"]"==o&&($=!1),u+=o}else{if(""==u)return INVALID_HOST;if(a=s.parseHost(u))return a;if(u="",c=PORT,t==HOSTNAME)return}break;case PORT:if(!exec(DIGIT,o)){if(o==EOF||"/"==o||"?"==o||"#"==o||"\\"==o&&s.isSpecial()||t){if(""!=u){var _=parseInt$1(u,10);if(_>65535)return INVALID_PORT;s.port=s.isSpecial()&&_===specialSchemes[s.scheme]?null:_,u=""}if(t)return;c=PATH_START;continue}return INVALID_PORT}u+=o;break;case FILE:if(s.scheme="file","/"==o||"\\"==o)c=FILE_SLASH;else{if(!r||"file"!=r.scheme){c=PATH;continue}if(o==EOF)s.host=r.host,s.path=arraySlice$1(r.path),s.query=r.query;else if("?"==o)s.host=r.host,s.path=arraySlice$1(r.path),s.query="",c=QUERY;else{if("#"!=o){startsWithWindowsDriveLetter(join$1(arraySlice$1(n,l),""))||(s.host=r.host,s.path=arraySlice$1(r.path),s.shortenPath()),c=PATH;continue}s.host=r.host,s.path=arraySlice$1(r.path),s.query=r.query,s.fragment="",c=FRAGMENT}}break;case FILE_SLASH:if("/"==o||"\\"==o){c=FILE_HOST;break}r&&"file"==r.scheme&&!startsWithWindowsDriveLetter(join$1(arraySlice$1(n,l),""))&&(isWindowsDriveLetter(r.path[0],!0)?push$3(s.path,r.path[0]):s.host=r.host),c=PATH;continue;case FILE_HOST:if(o==EOF||"/"==o||"\\"==o||"?"==o||"#"==o){if(!t&&isWindowsDriveLetter(u))c=PATH;else if(""==u){if(s.host="",t)return;c=PATH_START}else{if(a=s.parseHost(u))return a;if("localhost"==s.host&&(s.host=""),t)return;u="",c=PATH_START}continue}u+=o;break;case PATH_START:if(s.isSpecial()){if(c=PATH,"/"!=o&&"\\"!=o)continue}else if(t||"?"!=o)if(t||"#"!=o){if(o!=EOF&&(c=PATH,"/"!=o))continue}else s.fragment="",c=FRAGMENT;else s.query="",c=QUERY;break;case PATH:if(o==EOF||"/"==o||"\\"==o&&s.isSpecial()||!t&&("?"==o||"#"==o)){if(isDoubleDot(u)?(s.shortenPath(),"/"==o||"\\"==o&&s.isSpecial()||push$3(s.path,"")):isSingleDot(u)?"/"==o||"\\"==o&&s.isSpecial()||push$3(s.path,""):("file"==s.scheme&&!s.path.length&&isWindowsDriveLetter(u)&&(s.host&&(s.host=""),u=charAt(u,0)+":"),push$3(s.path,u)),u="","file"==s.scheme&&(o==EOF||"?"==o||"#"==o))for(;s.path.length>1&&""===s.path[0];)shift(s.path);"?"==o?(s.query="",c=QUERY):"#"==o&&(s.fragment="",c=FRAGMENT)}else u+=percentEncode(o,pathPercentEncodeSet);break;case CANNOT_BE_A_BASE_URL_PATH:"?"==o?(s.query="",c=QUERY):"#"==o?(s.fragment="",c=FRAGMENT):o!=EOF&&(s.path[0]+=percentEncode(o,C0ControlPercentEncodeSet));break;case QUERY:t||"#"!=o?o!=EOF&&("'"==o&&s.isSpecial()?s.query+="%27":s.query+="#"==o?"%23":percentEncode(o,C0ControlPercentEncodeSet)):(s.fragment="",c=FRAGMENT);break;case FRAGMENT:o!=EOF&&(s.fragment+=percentEncode(o,fragmentPercentEncodeSet))}l++}},parseHost:function(e){var t,r,n;if("["==charAt(e,0)){if("]"!=charAt(e,e.length-1))return INVALID_HOST;if(!(t=parseIPv6(stringSlice(e,1,-1))))return INVALID_HOST;this.host=t}else if(this.isSpecial()){if(e=toASCII(e),exec(FORBIDDEN_HOST_CODE_POINT,e))return INVALID_HOST;if(null===(t=parseIPv4(e)))return INVALID_HOST;this.host=t}else{if(exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT,e))return INVALID_HOST;for(t="",r=arrayFrom(e),n=0;n<r.length;n++)t+=percentEncode(r[n],C0ControlPercentEncodeSet);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return hasOwn$4(specialSchemes,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&isWindowsDriveLetter(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,o=e.host,i=e.port,a=e.path,s=e.query,c=e.fragment,l=t+":";return null!==o?(l+="//",e.includesCredentials()&&(l+=r+(n?":"+n:"")+"@"),l+=serializeHost(o),null!==i&&(l+=":"+i)):"file"==t&&(l+="//"),l+=e.cannotBeABaseURL?a[0]:a.length?"/"+join$1(a,"/"):"",null!==s&&(l+="?"+s),null!==c&&(l+="#"+c),l},setHref:function(e){var t=this.parse(e);if(t)throw TypeError$1(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new URLConstructor(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+serializeHost(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse($toString(e)+":",SCHEME_START)},getUsername:function(){return this.username},setUsername:function(e){var t=arrayFrom($toString(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=percentEncode(t[r],userinfoPercentEncodeSet)}},getPassword:function(){return this.password},setPassword:function(e){var t=arrayFrom($toString(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=percentEncode(t[r],userinfoPercentEncodeSet)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?serializeHost(e):serializeHost(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,HOST)},getHostname:function(){var e=this.host;return null===e?"":serializeHost(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,HOSTNAME)},getPort:function(){var e=this.port;return null===e?"":$toString(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=$toString(e))?this.port=null:this.parse(e,PORT))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+join$1(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,PATH_START))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=$toString(e))?this.query=null:("?"==charAt(e,0)&&(e=stringSlice(e,1)),this.query="",this.parse(e,QUERY)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=$toString(e))?("#"==charAt(e,0)&&(e=stringSlice(e,1)),this.fragment="",this.parse(e,FRAGMENT)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var URLConstructor=function(e){var t=anInstance$2(this,URLPrototype),r=validateArgumentsLength$1(arguments.length,1)>1?arguments[1]:void 0,n=setInternalState$2(t,new URLState(e,!1,r));DESCRIPTORS$2||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},URLPrototype=URLConstructor.prototype,accessorDescriptor=function(e,t){return{get:function(){return getInternalURLState(this)[e]()},set:t&&function(e){return getInternalURLState(this)[t](e)},configurable:!0,enumerable:!0}};if(DESCRIPTORS$2&&(defineBuiltInAccessor$1(URLPrototype,"href",accessorDescriptor("serialize","setHref")),defineBuiltInAccessor$1(URLPrototype,"origin",accessorDescriptor("getOrigin")),defineBuiltInAccessor$1(URLPrototype,"protocol",accessorDescriptor("getProtocol","setProtocol")),defineBuiltInAccessor$1(URLPrototype,"username",accessorDescriptor("getUsername","setUsername")),defineBuiltInAccessor$1(URLPrototype,"password",accessorDescriptor("getPassword","setPassword")),defineBuiltInAccessor$1(URLPrototype,"host",accessorDescriptor("getHost","setHost")),defineBuiltInAccessor$1(URLPrototype,"hostname",accessorDescriptor("getHostname","setHostname")),defineBuiltInAccessor$1(URLPrototype,"port",accessorDescriptor("getPort","setPort")),defineBuiltInAccessor$1(URLPrototype,"pathname",accessorDescriptor("getPathname","setPathname")),defineBuiltInAccessor$1(URLPrototype,"search",accessorDescriptor("getSearch","setSearch")),defineBuiltInAccessor$1(URLPrototype,"searchParams",accessorDescriptor("getSearchParams")),defineBuiltInAccessor$1(URLPrototype,"hash",accessorDescriptor("getHash","setHash"))),defineBuiltIn(URLPrototype,"toJSON",(function(){return getInternalURLState(this).serialize()}),{enumerable:!0}),defineBuiltIn(URLPrototype,"toString",(function(){return getInternalURLState(this).serialize()}),{enumerable:!0}),NativeURL){var nativeCreateObjectURL=NativeURL.createObjectURL,nativeRevokeObjectURL=NativeURL.revokeObjectURL;nativeCreateObjectURL&&defineBuiltIn(URLConstructor,"createObjectURL",bind$e(nativeCreateObjectURL,NativeURL)),nativeRevokeObjectURL&&defineBuiltIn(URLConstructor,"revokeObjectURL",bind$e(nativeRevokeObjectURL,NativeURL))}setToStringTag$1(URLConstructor,"URL"),$$R({global:!0,constructor:!0,forced:!USE_NATIVE_URL$1,sham:!DESCRIPTORS$2},{URL:URLConstructor});var $$Q=_export,getBuiltIn$3=getBuiltIn$j,fails$5=fails$z,validateArgumentsLength=validateArgumentsLength$5,toString$3=toString$g,USE_NATIVE_URL=urlConstructorDetection,URL$1=getBuiltIn$3("URL"),THROWS_WITHOUT_ARGUMENTS=USE_NATIVE_URL&&fails$5((function(){URL$1.canParse()}));$$Q({target:"URL",stat:!0,forced:!THROWS_WITHOUT_ARGUMENTS},{canParse:function(e){var t=validateArgumentsLength(arguments.length,1),r=toString$3(e),n=t<2||void 0===arguments[1]?void 0:toString$3(arguments[1]);try{return!!new URL$1(r,n)}catch(e){return!1}}});var path$5=path$w,url$5=path$5.URL,parent$t=url$5,url$4=parent$t,parent$s=url$4,url$3=parent$s,parent$r=url$3,url$2=parent$r,url$1=url$2,url=url$1,_URL=getDefaultExportFromCjs(url),path$4=path$w,apply=functionApply;path$4.JSON||(path$4.JSON={stringify:JSON.stringify});var stringify$5=function(e,t,r){return apply(path$4.JSON.stringify,null,arguments)},parent$q=stringify$5,stringify$4=parent$q,parent$p=stringify$4,stringify$3=parent$p,parent$o=stringify$3,stringify$2=parent$o,stringify$1=stringify$2,stringify2=stringify$1,_JSON$stringify=getDefaultExportFromCjs(stringify2),isObject$5=isObject$m,classof$3=classofRaw$2,wellKnownSymbol$2=wellKnownSymbol$r,MATCH$1=wellKnownSymbol$2("match"),isRegexp=function(e){var t;return isObject$5(e)&&(void 0!==(t=e[MATCH$1])?!!t:"RegExp"==classof$3(e))},isRegExp=isRegexp,$TypeError$6=TypeError,notARegexp=function(e){if(isRegExp(e))throw $TypeError$6("The method doesn't accept regular expressions");return e},wellKnownSymbol$1=wellKnownSymbol$r,MATCH=wellKnownSymbol$1("match"),correctIsRegexpLogic=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[MATCH]=!1,"/./"[e](t)}catch(e){}}return!1},$$P=_export,$includes=arrayIncludes.includes,fails$4=fails$z,BROKEN_ON_SPARSE=fails$4((function(){return!Array(1).includes()}));$$P({target:"Array",proto:!0,forced:BROKEN_ON_SPARSE},{includes:function(e){return $includes(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$3=entryVirtual$k,includes$7=entryVirtual$3("Array").includes,$$O=_export,uncurryThis$4=functionUncurryThis,notARegExp=notARegexp,requireObjectCoercible=requireObjectCoercible$7,toString$2=toString$g,correctIsRegExpLogic=correctIsRegexpLogic,stringIndexOf=uncurryThis$4("".indexOf);$$O({target:"String",proto:!0,forced:!correctIsRegExpLogic("includes")},{includes:function(e){return!!~stringIndexOf(toString$2(requireObjectCoercible(this)),toString$2(notARegExp(e)),arguments.length>1?arguments[1]:void 0)}});var entryVirtual$2=entryVirtual$k,includes$6=entryVirtual$2("String").includes,isPrototypeOf$4=objectIsPrototypeOf,arrayMethod=includes$7,stringMethod=includes$6,ArrayPrototype$2=Array.prototype,StringPrototype=String.prototype,includes$5=function(e){var t=e.includes;return e===ArrayPrototype$2||isPrototypeOf$4(ArrayPrototype$2,e)&&t===ArrayPrototype$2.includes?arrayMethod:"string"==typeof e||e===StringPrototype||isPrototypeOf$4(StringPrototype,e)&&t===StringPrototype.includes?stringMethod:t},parent$n=includes$5,includes$4=parent$n,parent$m=includes$4,includes$3=parent$m,parent$l=includes$3,includes$2=parent$l,includes$1=includes$2,includes3=includes$1,_includesInstanceProperty=getDefaultExportFromCjs(includes3),internalMetadata={exports:{}},fails$3=fails$z,arrayBufferNonExtensible=fails$3((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),fails$2=fails$z,isObject$4=isObject$m,classof$2=classofRaw$2,ARRAY_BUFFER_NON_EXTENSIBLE=arrayBufferNonExtensible,$isExtensible=Object.isExtensible,FAILS_ON_PRIMITIVES=fails$2((function(){$isExtensible(1)})),objectIsExtensible=FAILS_ON_PRIMITIVES||ARRAY_BUFFER_NON_EXTENSIBLE?function(e){return!!isObject$4(e)&&((!ARRAY_BUFFER_NON_EXTENSIBLE||"ArrayBuffer"!=classof$2(e))&&(!$isExtensible||$isExtensible(e)))}:$isExtensible,fails$1=fails$z,freezing=!fails$1((function(){return Object.isExtensible(Object.preventExtensions({}))})),$$N=_export,uncurryThis$3=functionUncurryThis,hiddenKeys=hiddenKeys$6,isObject$3=isObject$m,hasOwn$3=hasOwnProperty_1,defineProperty$1=objectDefineProperty.f,getOwnPropertyNamesModule=objectGetOwnPropertyNames,getOwnPropertyNamesExternalModule=objectGetOwnPropertyNamesExternal,isExtensible2=objectIsExtensible,uid=uid$4,FREEZING=freezing,REQUIRED=!1,METADATA=uid("meta"),id=0,setMetadata=function(e){defineProperty$1(e,METADATA,{value:{objectID:"O"+id++,weakData:{}}})},fastKey$1=function(e,t){if(!isObject$3(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!hasOwn$3(e,METADATA)){if(!isExtensible2(e))return"F";if(!t)return"E";setMetadata(e)}return e[METADATA].objectID},getWeakData=function(e,t){if(!hasOwn$3(e,METADATA)){if(!isExtensible2(e))return!0;if(!t)return!1;setMetadata(e)}return e[METADATA].weakData},onFreeze=function(e){return FREEZING&&REQUIRED&&isExtensible2(e)&&!hasOwn$3(e,METADATA)&&setMetadata(e),e},enable=function(){meta.enable=function(){},REQUIRED=!0;var e=getOwnPropertyNamesModule.f,t=uncurryThis$3([].splice),r={};r[METADATA]=1,e(r).length&&(getOwnPropertyNamesModule.f=function(r){for(var n=e(r),o=0,i=n.length;o<i;o++)if(n[o]===METADATA){t(n,o,1);break}return n},$$N({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:getOwnPropertyNamesExternalModule.f}))},meta=internalMetadata.exports={enable:enable,fastKey:fastKey$1,getWeakData:getWeakData,onFreeze:onFreeze};hiddenKeys[METADATA]=!0;var internalMetadataExports=internalMetadata.exports,$$M=_export,global$2=global$s,InternalMetadataModule=internalMetadataExports,fails=fails$z,createNonEnumerableProperty=createNonEnumerableProperty$9,iterate$o=iterate$u,anInstance$1=anInstance$5,isCallable$4=isCallable$r,isObject$2=isObject$m,setToStringTag=setToStringTag$9,defineProperty5=objectDefineProperty.f,forEach3=arrayIteration.forEach,DESCRIPTORS$1=descriptors,InternalStateModule$1=internalState,setInternalState$1=InternalStateModule$1.set,internalStateGetterFor$1=InternalStateModule$1.getterFor,collection$2=function(e,t,r){var n,o=-1!==e.indexOf("Map"),i=-1!==e.indexOf("Weak"),a=o?"set":"add",s=global$2[e],c=s&&s.prototype,l={};if(DESCRIPTORS$1&&isCallable$4(s)&&(i||c.forEach&&!fails((function(){(new s).entries().next()})))){var u=(n=t((function(t,r){setInternalState$1(anInstance$1(t,u),{type:e,collection:new s}),null!=r&&iterate$o(r,t[a],{that:t,AS_ENTRIES:o})}))).prototype,p=internalStateGetterFor$1(e);forEach3(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(e){var t="add"==e||"set"==e;!(e in c)||i&&"clear"==e||createNonEnumerableProperty(u,e,(function(r,n){var o=p(this).collection;if(!t&&i&&!isObject$2(r))return"get"==e&&void 0;var a=o[e](0===r?0:r,n);return t?this:a}))})),i||defineProperty5(u,"size",{configurable:!0,get:function(){return p(this).collection.size}})}else n=r.getConstructor(t,e,o,a),InternalMetadataModule.enable();return setToStringTag(n,e,!1,!0),l[e]=n,$$M({global:!0,forced:!0},l),i||r.setStrong(n,e,o),n},create4=objectCreate,defineBuiltInAccessor=defineBuiltInAccessor$5,defineBuiltIns=defineBuiltIns$2,bind$d=functionBindContext,anInstance=anInstance$5,isNullOrUndefined$2=isNullOrUndefined$7,iterate$n=iterate$u,defineIterator=iteratorDefine,createIterResultObject=createIterResultObject$3,setSpecies=setSpecies$2,DESCRIPTORS=descriptors,fastKey=internalMetadataExports.fastKey,InternalStateModule=internalState,setInternalState=InternalStateModule.set,internalStateGetterFor=InternalStateModule.getterFor,collectionStrong$2={getConstructor:function(e,t,r,n){var o=e((function(e,o){anInstance(e,i),setInternalState(e,{type:t,index:create4(null),first:void 0,last:void 0,size:0}),DESCRIPTORS||(e.size=0),isNullOrUndefined$2(o)||iterate$n(o,e[n],{that:e,AS_ENTRIES:r})})),i=o.prototype,a=internalStateGetterFor(t),s=function(e,t,r){var n,o,i=a(e),s=c(e,t);return s?s.value=r:(i.last=s={index:o=fastKey(t,!0),key:t,value:r,previous:n=i.last,next:void 0,removed:!1},i.first||(i.first=s),n&&(n.next=s),DESCRIPTORS?i.size++:e.size++,"F"!==o&&(i.index[o]=s)),e},c=function(e,t){var r,n=a(e),o=fastKey(t);if("F"!==o)return n.index[o];for(r=n.first;r;r=r.next)if(r.key==t)return r};return defineBuiltIns(i,{clear:function(){for(var e=a(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,DESCRIPTORS?e.size=0:this.size=0},delete:function(e){var t=this,r=a(t),n=c(t,e);if(n){var o=n.next,i=n.previous;delete r.index[n.index],n.removed=!0,i&&(i.next=o),o&&(o.previous=i),r.first==n&&(r.first=o),r.last==n&&(r.last=i),DESCRIPTORS?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=a(this),n=bind$d(e,arguments.length>1?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!!c(this,e)}}),defineBuiltIns(i,r?{get:function(e){var t=c(this,e);return t&&t.value},set:function(e,t){return s(this,0===e?0:e,t)}}:{add:function(e){return s(this,e=0===e?0:e,e)}}),DESCRIPTORS&&defineBuiltInAccessor(i,"size",{configurable:!0,get:function(){return a(this).size}}),o},setStrong:function(e,t,r){var n=t+" Iterator",o=internalStateGetterFor(t),i=internalStateGetterFor(n);defineIterator(e,t,(function(e,t){setInternalState(this,{type:n,target:e,state:o(e),kind:t,last:void 0})}),(function(){for(var e=i(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)?createIterResultObject("keys"==t?r.key:"values"==t?r.value:[r.key,r.value],!1):(e.target=void 0,createIterResultObject(void 0,!0))}),r?"entries":"values",!r,!0),setSpecies(t)}},collection$1=collection$2,collectionStrong$1=collectionStrong$2;collection$1("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),collectionStrong$1);var path$3=path$w,map$5=path$3.Map,parent$k=map$5,map$4=parent$k,parent$j=map$4,map$3=parent$j,bind$c=functionBindContext,call$d=functionCall,aCallable$8=aCallable$l,aConstructor=aConstructor$3,isNullOrUndefined$1=isNullOrUndefined$7,iterate$m=iterate$u,push$2=[].push,collectionFrom=function(e){var t,r,n,o,i=arguments.length,a=i>1?arguments[1]:void 0;return aConstructor(this),(t=void 0!==a)&&aCallable$8(a),isNullOrUndefined$1(e)?new this:(r=[],t?(n=0,o=bind$c(a,i>2?arguments[2]:void 0),iterate$m(e,(function(e){call$d(push$2,r,o(e,n++))}))):iterate$m(e,push$2,{that:r}),new this(r))},$$L=_export,from$1=collectionFrom;$$L({target:"Map",stat:!0,forced:!0},{from:from$1});var arraySlice=arraySlice$7,collectionOf=function(){return new this(arraySlice(arguments))},$$K=_export,of$1=collectionOf;$$K({target:"Map",stat:!0,forced:!0},{of:of$1});var tryToString$1=tryToString$8,aMap$e=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 TypeError(tryToString$1(e)+" is not a map")},caller$2=function(e,t){return 1==t?function(t,r){return t[e](r)}:function(t,r,n){return t[e](r,n)}},getBuiltIn$2=getBuiltIn$j,caller$1=caller$2,Map$5=getBuiltIn$2("Map"),mapHelpers={Map:Map$5,set:caller$1("set",2),get:caller$1("get",1),has:caller$1("has",1),remove:caller$1("delete",1),proto:Map$5.prototype},$$J=_export,aMap$d=aMap$e,remove$3=mapHelpers.remove;$$J({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=aMap$d(this),r=!0,n=0,o=arguments.length;n<o;n++)e=remove$3(t,arguments[n]),r=r&&e;return!!r}});var $$I=_export,aMap$c=aMap$e,MapHelpers$4=mapHelpers,get$1=MapHelpers$4.get,has$6=MapHelpers$4.has,set$b=MapHelpers$4.set;$$I({target:"Map",proto:!0,real:!0,forced:!0},{emplace:function(e,t){var r,n,o=aMap$c(this);return has$6(o,e)?(r=get$1(o,e),"update"in t&&(r=t.update(r,e,o),set$b(o,e,r)),r):(n=t.insert(e,o),set$b(o,e,n),n)}});var call$c=functionCall,iterateSimple$8=function(e,t,r){for(var n,o,i=r||e.next;!(n=call$c(i,e)).done;)if(void 0!==(o=t(n.value)))return o},iterateSimple$7=iterateSimple$8,mapIterate=function(e,t,r){return r?iterateSimple$7(e.entries(),(function(e){return t(e[1],e[0])})):e.forEach(t)},$$H=_export,bind$b=functionBindContext,aMap$b=aMap$e,iterate$l=mapIterate;$$H({target:"Map",proto:!0,real:!0,forced:!0},{every:function(e){var t=aMap$b(this),r=bind$b(e,arguments.length>1?arguments[1]:void 0);return!1!==iterate$l(t,(function(e,n){if(!r(e,n,t))return!1}),!0)}});var $$G=_export,bind$a=functionBindContext,aMap$a=aMap$e,MapHelpers$3=mapHelpers,iterate$k=mapIterate,Map$4=MapHelpers$3.Map,set$a=MapHelpers$3.set;$$G({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(e){var t=aMap$a(this),r=bind$a(e,arguments.length>1?arguments[1]:void 0),n=new Map$4;return iterate$k(t,(function(e,o){r(e,o,t)&&set$a(n,o,e)})),n}});var $$F=_export,bind$9=functionBindContext,aMap$9=aMap$e,iterate$j=mapIterate;$$F({target:"Map",proto:!0,real:!0,forced:!0},{find:function(e){var t=aMap$9(this),r=bind$9(e,arguments.length>1?arguments[1]:void 0),n=iterate$j(t,(function(e,n){if(r(e,n,t))return{value:e}}),!0);return n&&n.value}});var $$E=_export,bind$8=functionBindContext,aMap$8=aMap$e,iterate$i=mapIterate;$$E({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(e){var t=aMap$8(this),r=bind$8(e,arguments.length>1?arguments[1]:void 0),n=iterate$i(t,(function(e,n){if(r(e,n,t))return{key:n}}),!0);return n&&n.key}});var $$D=_export,call$b=functionCall,uncurryThis$2=functionUncurryThis,isCallable$3=isCallable$r,aCallable$7=aCallable$l,iterate$h=iterate$u,Map$3=mapHelpers.Map,push$1=uncurryThis$2([].push);$$D({target:"Map",stat:!0,forced:!0},{groupBy:function(e,t){var r=new(isCallable$3(this)?this:Map$3);aCallable$7(t);var n=aCallable$7(r.has),o=aCallable$7(r.get),i=aCallable$7(r.set);return iterate$h(e,(function(e){var a=t(e);call$b(n,r,a)?push$1(call$b(o,r,a),e):call$b(i,r,a,[e])})),r}});var sameValueZero$1=function(e,t){return e===t||e!=e&&t!=t},$$C=_export,sameValueZero=sameValueZero$1,aMap$7=aMap$e,iterate$g=mapIterate;$$C({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(e){return!0===iterate$g(aMap$7(this),(function(t){if(sameValueZero(t,e))return!0}),!0)}});var $$B=_export,call$a=functionCall,iterate$f=iterate$u,isCallable$2=isCallable$r,aCallable$6=aCallable$l,Map$2=mapHelpers.Map;$$B({target:"Map",stat:!0,forced:!0},{keyBy:function(e,t){var r=new(isCallable$2(this)?this:Map$2);aCallable$6(t);var n=aCallable$6(r.set);return iterate$f(e,(function(e){call$a(n,r,t(e),e)})),r}});var $$A=_export,aMap$6=aMap$e,iterate$e=mapIterate;$$A({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(e){var t=iterate$e(aMap$6(this),(function(t,r){if(t===e)return{key:r}}),!0);return t&&t.key}});var $$z=_export,bind$7=functionBindContext,aMap$5=aMap$e,MapHelpers$2=mapHelpers,iterate$d=mapIterate,Map$1=MapHelpers$2.Map,set$9=MapHelpers$2.set;$$z({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(e){var t=aMap$5(this),r=bind$7(e,arguments.length>1?arguments[1]:void 0),n=new Map$1;return iterate$d(t,(function(e,o){set$9(n,r(e,o,t),e)})),n}});var $$y=_export,bind$6=functionBindContext,aMap$4=aMap$e,MapHelpers$1=mapHelpers,iterate$c=mapIterate,Map=MapHelpers$1.Map,set$8=MapHelpers$1.set;$$y({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(e){var t=aMap$4(this),r=bind$6(e,arguments.length>1?arguments[1]:void 0),n=new Map;return iterate$c(t,(function(e,o){set$8(n,o,r(e,o,t))})),n}});var $$x=_export,aMap$3=aMap$e,iterate$b=iterate$u,set$7=mapHelpers.set;$$x({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(e){for(var t=aMap$3(this),r=arguments.length,n=0;n<r;)iterate$b(arguments[n++],(function(e,r){set$7(t,e,r)}),{AS_ENTRIES:!0});return t}});var $$w=_export,aCallable$5=aCallable$l,aMap$2=aMap$e,iterate$a=mapIterate,$TypeError$5=TypeError;$$w({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=aMap$2(this),r=arguments.length<2,n=r?void 0:arguments[1];if(aCallable$5(e),iterate$a(t,(function(o,i){r?(r=!1,n=o):n=e(n,o,i,t)})),r)throw $TypeError$5("Reduce of empty map with no initial value");return n}});var $$v=_export,bind$5=functionBindContext,aMap$1=aMap$e,iterate$9=mapIterate;$$v({target:"Map",proto:!0,real:!0,forced:!0},{some:function(e){var t=aMap$1(this),r=bind$5(e,arguments.length>1?arguments[1]:void 0);return!0===iterate$9(t,(function(e,n){if(r(e,n,t))return!0}),!0)}});var $$u=_export,aCallable$4=aCallable$l,aMap=aMap$e,MapHelpers=mapHelpers,$TypeError$4=TypeError,get2=MapHelpers.get,has$5=MapHelpers.has,set$6=MapHelpers.set;$$u({target:"Map",proto:!0,real:!0,forced:!0},{update:function(e,t){var r=aMap(this),n=arguments.length;aCallable$4(t);var o=has$5(r,e);if(!o&&n<3)throw $TypeError$4("Updating absent value");var i=o?get2(r,e):aCallable$4(n>2?arguments[2]:void 0)(e,r);return set$6(r,e,t(i,e,r)),r}});var call$9=functionCall,aCallable$3=aCallable$l,isCallable$1=isCallable$r,anObject$2=anObject$i,$TypeError$3=TypeError,mapUpsert=function(e,t){var r,n=anObject$2(this),o=aCallable$3(n.get),i=aCallable$3(n.has),a=aCallable$3(n.set),s=arguments.length>2?arguments[2]:void 0;if(!isCallable$1(t)&&!isCallable$1(s))throw $TypeError$3("At least one callback required");return call$9(i,n,e)?(r=call$9(o,n,e),isCallable$1(t)&&(r=t(r),call$9(a,n,e,r))):isCallable$1(s)&&(r=s(),call$9(a,n,e,r)),r},$$t=_export,upsert$1=mapUpsert;$$t({target:"Map",proto:!0,real:!0,forced:!0},{upsert:upsert$1});var $$s=_export,upsert2=mapUpsert;$$s({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:upsert2});var parent$i=map$3,map$2=parent$i,map$1=map$2,map2=map$1,_Map=getDefaultExportFromCjs(map2);function ownKeys2(e,t){var r=_Object$keys(e);if(_Object$getOwnPropertySymbols){var n=_Object$getOwnPropertySymbols(e);t&&(n=_filterInstanceProperty(n).call(n,(function(t){return _Object$getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r,n,o=null!=arguments[t]?arguments[t]:{};t%2?_forEachInstanceProperty(r=ownKeys2(Object(o),!0)).call(r,(function(t){_defineProperty$1(e,t,o[t])})):_Object$getOwnPropertyDescriptors?_Object$defineProperties(e,_Object$getOwnPropertyDescriptors(o)):_forEachInstanceProperty(n=ownKeys2(Object(o))).call(n,(function(t){_Object$defineProperty(e,t,_Object$getOwnPropertyDescriptor(o,t))}))}return e}function _regeneratorRuntime(){_regeneratorRuntime=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=_Object$defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof _Symbol?_Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,r){return _Object$defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,o){var i=t&&t.prototype instanceof $?t:$,a=_Object$create(i.prototype),s=new P(o||[]);return n(a,"_invoke",{value:v(e,r,s)}),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var p={};function $(){}function f(){}function d(){}var y={};c(y,i,(function(){return this}));var h=_Object$getPrototypeOf&&_Object$getPrototypeOf(_Object$getPrototypeOf(O([])));h&&h!==t&&r.call(h,i)&&(y=h);var _=d.prototype=$.prototype=_Object$create(y);function g(e){var t;_forEachInstanceProperty(t=["next","throw","return"]).call(t,(function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function m(e,t){function o(n,i,a,s){var c=u(e[n],e,i);if("throw"!==c.type){var l=c.arg,p=l.value;return p&&"object"==_typeof$3(p)&&r.call(p,"__await")?t.resolve(p.__await).then((function(e){o("next",e,a,s)}),(function(e){o("throw",e,a,s)})):t.resolve(p).then((function(e){l.value=e,a(l)}),(function(e){return o("throw",e,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){o(e,r,t,n)}))}return i=i?i.then(n,n):n()}})}function v(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=b(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function b(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var o=u(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,p;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],_forEachInstanceProperty(e).call(e,S,this),this.reset(!0)}function O(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:T}}function T(){return{value:void 0,done:!0}}return f.prototype=d,n(_,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:f,configurable:!0}),f.displayName=c(d,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return _Object$setPrototypeOf?_Object$setPrototypeOf(e,d):(e.__proto__=d,c(e,s,"GeneratorFunction")),e.prototype=_Object$create(_),e},e.awrap=function(e){return{__await:e}},g(m.prototype),c(m.prototype,a,(function(){return this})),e.AsyncIterator=m,e.async=function(t,r,n,o,i){void 0===i&&(i=_Promise);var a=new m(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(_),c(_,s,"Generator"),c(_,i,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return _reverseInstanceProperty(r).call(r),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=O,P.prototype={constructor:P,reset:function(e){var t;if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,_forEachInstanceProperty(t=this.tryEntries).call(t,E),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+_sliceInstanceProperty(n).call(n,1))&&(this[n]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(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 o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},e}function _typeof(e){return(_typeof="function"==typeof _Symbol&&"symbol"==typeof _Symbol$iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof _Symbol&&e.constructor===_Symbol&&e!==_Symbol.prototype?"symbol":typeof e})(e)}function asyncGeneratorStep(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):_Promise.resolve(c).then(n,o)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new _Promise((function(n,o){var i=e.apply(t,r);function a(e){asyncGeneratorStep(i,n,o,a,s,"next",e)}function s(e){asyncGeneratorStep(i,n,o,a,s,"throw",e)}a(void 0)}))}}function _classCallCheck$2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$2(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),_Object$defineProperty(e,_toPropertyKey$2(n.key),n)}}function _createClass$2(e,t,r){return t&&_defineProperties$2(e.prototype,t),r&&_defineProperties$2(e,r),_Object$defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty$1(e,t,r){return(t=_toPropertyKey$2(t))in e?_Object$defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _inherits$2(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=_Object$create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),_Object$defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf$2(e,t)}function _getPrototypeOf$2(e){var t;return(_getPrototypeOf$2=_Object$setPrototypeOf?_bindInstanceProperty(t=_Object$getPrototypeOf).call(t):function(e){return e.__proto__||_Object$getPrototypeOf(e)})(e)}function _setPrototypeOf$2(e,t){var r;return(_setPrototypeOf$2=_Object$setPrototypeOf?_bindInstanceProperty(r=_Object$setPrototypeOf).call(r):function(e,t){return e.__proto__=t,e})(e,t)}function _isNativeReflectConstruct$2(){if("undefined"==typeof Reflect||!_Reflect$construct)return!1;if(_Reflect$construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_Reflect$construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _construct(e,t,r){var n;_isNativeReflectConstruct$2()?_construct=_bindInstanceProperty(n=_Reflect$construct).call(n):_construct=function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(_bindInstanceProperty(Function).apply(e,n));return r&&_setPrototypeOf$2(o,r.prototype),o};return _construct.apply(null,arguments)}function _isNativeFunction(e){var t;return-1!==_indexOfInstanceProperty(t=Function.toString.call(e)).call(t,"[native code]")}function _wrapNativeSuper(e){var t="function"==typeof _Map?new _Map:void 0;return _wrapNativeSuper=function(e){if(null===e||!_isNativeFunction(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return _construct(e,arguments,_getPrototypeOf$2(this).constructor)}return r.prototype=_Object$create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf$2(r,e)},_wrapNativeSuper(e)}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,n,o={},i=_Object$keys(e);for(n=0;n<i.length;n++)r=i[n],_indexOfInstanceProperty(t).call(t,r)>=0||(o[r]=e[r]);return o}function _objectWithoutProperties(e,t){if(null==e)return{};var r,n,o=_objectWithoutPropertiesLoose(e,t);if(_Object$getOwnPropertySymbols){var i=_Object$getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],_indexOfInstanceProperty(t).call(t,r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function _assertThisInitialized$2(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn$2(e,t){if(t&&("object"===_typeof$3(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$2(e)}function _createSuper$1(e){var t=_isNativeReflectConstruct$2();return function(){var r,n=_getPrototypeOf$2(e);if(t){var o=_getPrototypeOf$2(this).constructor;r=_Reflect$construct(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn$2(this,r)}}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf$2(e)););return e}function _get(){var e;"undefined"!=typeof Reflect&&_Reflect$get?_get=_bindInstanceProperty(e=_Reflect$get).call(e):_get=function(e,t,r){var n=_superPropBase(e,t);if(n){var o=_Object$getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}};return _get.apply(this,arguments)}function _unsupportedIterableToArray$1(e,t){var r;if(e){if("string"==typeof e)return _arrayLikeToArray$1(e,t);var n=_sliceInstanceProperty(r=Object.prototype.toString.call(e)).call(r,8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?_Array$from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray$1(e,t):void 0}}function _arrayLikeToArray$1(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _createForOfIteratorHelper(e,t){var r=void 0!==_Symbol&&_getIteratorMethod(e)||e["@@iterator"];if(!r){if(_Array$isArray(e)||(r=_unsupportedIterableToArray$1(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function _toPrimitive$2(e,t){if("object"!==_typeof$3(e)||null===e)return e;var r=e[_Symbol$toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof$3(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey$2(e){var t=_toPrimitive$2(e,"string");return"symbol"===_typeof$3(t)?t:String(t)}var aCallable$2=aCallable$l,toObject=toObject$c,IndexedObject=indexedObject,lengthOfArrayLike=lengthOfArrayLike$a,$TypeError$2=TypeError,createMethod=function(e){return function(t,r,n,o){aCallable$2(r);var i=toObject(t),a=IndexedObject(i),s=lengthOfArrayLike(i),c=e?s-1:0,l=e?-1:1;if(n<2)for(;;){if(c in a){o=a[c],c+=l;break}if(c+=l,e?c<0:s<=c)throw $TypeError$2("Reduce of empty array with no initial value")}for(;e?c>=0:s>c;c+=l)c in a&&(o=r(o,a[c],c,i));return o}},arrayReduce={left:createMethod(!1),right:createMethod(!0)},$$r=_export,$reduce=arrayReduce.left,arrayMethodIsStrict=arrayMethodIsStrict$6,CHROME_VERSION=engineV8Version,IS_NODE=engineIsNode,CHROME_BUG=!IS_NODE&&engineV8Version>79&&engineV8Version<83,FORCED=CHROME_BUG||!arrayMethodIsStrict("reduce");$$r({target:"Array",proto:!0,forced:FORCED},{reduce:function(e){var t=arguments.length;return $reduce(this,e,t,t>1?arguments[1]:void 0)}});var _ERR_CODE,entryVirtual$1=entryVirtual$k,reduce$6=entryVirtual$1("Array").reduce,isPrototypeOf$3=objectIsPrototypeOf,method$1=reduce$6,ArrayPrototype$1=Array.prototype,reduce$5=function(e){var t=e.reduce;return e===ArrayPrototype$1||isPrototypeOf$3(ArrayPrototype$1,e)&&t===ArrayPrototype$1.reduce?method$1:t},parent$h=reduce$5,reduce$4=parent$h,parent$g=reduce$4,reduce$3=parent$g,parent$f=reduce$3,reduce$2=parent$f,reduce$1=reduce$2,reduce3=reduce$1,_reduceInstanceProperty=getDefaultExportFromCjs(reduce3),Buffer$1=function(){function e(){_classCallCheck$2(this,e)}return _createClass$2(e,null,[{key:"start",value:function(e){return e&&e.length?1===e.length&&e.end(0)-e.start(0)<1e-6||1===e.length&&e.start(0)<0?0:e.start(0):0}},{key:"end",value:function(e){return e&&e.length?1===e.length&&e.end(0)-e.start(0)<1e-6?0:e.end(e.length-1):0}},{key:"get",value:function(e){if(e)try{return e.buffered}catch(e){}}},{key:"buffers",value:function(e,t){if(!e||!e.length)return[];for(var r=[],n=0,o=e.length;n<o;n++){var i=r.length;if(i&&t){var a=r[i-1],s=a[1];if(e.start(n)-s<=t){var c=e.end(n);c>s&&(a[1]=c)}else r.push([e.start(n),e.end(n)])}else r.push([e.start(n),e.end(n)])}return r}},{key:"totalLength",value:function(e){return e&&e.length?_reduceInstanceProperty(e).call(e,(function(e,t){return e+(t[1]-t[0])}),0):0}},{key:"info",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!t||!t.length)return{start:0,end:0,buffers:[]};for(var o=0,i=0,a=0,s=0,c=0,l=0,u=0,p=e.buffers(t,n),$=0,f=p.length;$<f;$++){var d=p[$];if(r+n>=d[0]&&r<=d[1])o=d[0],i=d[1],a=$;else{if(r+n<d[0]){s=d[0],c=d[1];break}r+n>d[1]&&(l=d[0],u=d[1])}}return{start:o,end:i,index:a,buffers:p,nextStart:s,nextEnd:c,prevStart:l,prevEnd:u,currentTime:r,behind:r-o,remaining:i?i-r:0,length:e.totalLength&&e.totalLength(p)}}},{key:"isBuffered",value:function(t,r){if(t){var n=e.get(t);if(null!=n&&n.length)for(var o=0;o<n.length;o++)if(r>=n.start(o)&&r<=n.end(o))return!0}return!1}}]),e}(),isBrowser$1="undefined"!=typeof window,ERR={MANIFEST:"manifest",NETWORK:"network",NETWORK_TIMEOUT:"network_timeout",NETWORK_FORBIDDEN:"network_forbidden",NETWORK_NOTFOUND:"network_notfound",NETWROK_RANGE_NOT_SATISFIABLE:"network_range_not_satisfiable",DEMUX:"demux",REMUX:"remux",MEDIA:"media",DRM:"drm",OTHER:"other",RUNTIME:"runtime",SUB_TYPES:{FLV:"FLV",HLS:"HLS",MP4:"MP4",FMP4:"FMP4",MSE_ADD_SB:"MSE_ADD_SB",MSE_APPEND_BUFFER:"MSE_APPEND_BUFFER",MSE_OTHER:"MSE_OTHER",MSE_FULL:"MSE_FULL",MSE_CHANGE_TYPE:"MSE_CHANGE_TYPE",OPTION:"OPTION",DASH:"DASH",LICENSE:"LICENSE",CUSTOM_LICENSE:"CUSTOM_LICENSE",MSE_HIJACK:"MSE_HIJACK",EME_HIJACK:"EME_HIJACK",SIDX:"SIDX",NO_CANPLAY_ERROR:"NO_CANPLAY_ERROR",BUFFERBREAK_ERROR:"BUFFERBREAK_ERROR",WAITING_TIMEOUT_ERROR:"WAITING_TIMEOUT_ERROR",MEDIA_ERR_ABORTED:"MEDIA_ERR_ABORTED",MEDIA_ERR_NETWORK:"MEDIA_ERR_NETWORK",MEDIA_ERR_DECODE:"MEDIA_ERR_DECODE",MEDIA_ERR_SRC_NOT_SUPPORTED:"MEDIA_ERR_SRC_NOT_SUPPORTED",MEDIA_ERR_CODEC_NOT_SUPPORTED:"MEDIA_ERR_CODEC_NOT_SUPPORTED",MEDIA_ERR_URL_EMPTY:"MEDIA_ERR_URL_EMPTY"}},ERR_CODE=(_defineProperty$1(_ERR_CODE={},ERR.MANIFEST,{HLS:1100,DASH:1200}),_defineProperty$1(_ERR_CODE,ERR.NETWORK,2100),_defineProperty$1(_ERR_CODE,ERR.NETWORK_TIMEOUT,2101),_defineProperty$1(_ERR_CODE,ERR.NETWORK_FORBIDDEN,2103),_defineProperty$1(_ERR_CODE,ERR.NETWORK_NOTFOUND,2104),_defineProperty$1(_ERR_CODE,ERR.NETWROK_RANGE_NOT_SATISFIABLE,2116),_defineProperty$1(_ERR_CODE,ERR.DEMUX,{FLV:3100,HLS:3200,MP4:3300,FMP4:3400,SIDX:3410}),_defineProperty$1(_ERR_CODE,ERR.REMUX,{FMP4:4100,MP4:4200}),_defineProperty$1(_ERR_CODE,ERR.MEDIA,{MEDIA_ERR_ABORTED:5101,MEDIA_ERR_NETWORK:5102,MEDIA_ERR_DECODE:5103,MEDIA_ERR_SRC_NOT_SUPPORTED:5104,MEDIA_ERR_CODEC_NOT_SUPPORTED:5105,MEDIA_ERR_URL_EMPTY:5106,MSE_ADD_SB:5200,MSE_APPEND_BUFFER:5201,MSE_OTHER:5202,MSE_FULL:5203,MSE_HIJACK:5204,MSE_CHANGE_TYPE:5205,EME_HIJACK:5301}),_defineProperty$1(_ERR_CODE,ERR.DRM,{LICENSE:7100,CUSTOM_LICENSE:7200}),_defineProperty$1(_ERR_CODE,ERR.OTHER,8e3),_defineProperty$1(_ERR_CODE,ERR.RUNTIME,{NO_CANPLAY_ERROR:9001,BUFFERBREAK_ERROR:9002,WAITING_TIMEOUT_ERROR:9003}),_ERR_CODE),StreamingError=function(e){_inherits$2(r,_wrapNativeSuper(Error));var t=_createSuper$1(r);function r(e,n,o,i,a){var s;return _classCallCheck$2(this,r),(s=t.call(this,a||(null==o?void 0:o.message))).errorType=e===ERR.NETWORK_TIMEOUT?ERR.NETWORK:e,s.originError=o,s.ext=i,s.errorCode=ERR_CODE[e][n]||ERR_CODE[e],s.errorMessage=s.message,s.errorCode||(s.errorType=ERR.OTHER,s.errorCode=ERR_CODE[s.errorType]),s}return _createClass$2(r,null,[{key:"create",value:function(e,t,n,o,i){return e instanceof r?e:(e instanceof Error&&(n=e,e=""),e||(e=ERR.OTHER),new r(e,t,n,o,i))}},{key:"network",value:function(e){var t;return new r(null!=e&&e.isTimeout?ERR.NETWORK_TIMEOUT:ERR.NETWORK,null,e instanceof Error?e:null,{url:null==e?void 0:e.url,response:null==e?void 0:e.response,httpCode:null==e||null===(t=e.response)||void 0===t?void 0:t.status})}}]),r}(),LogCacheLevel={DEBUG:1,LOG:2,WARN:3,ERROR:4},LOG_MAX_SIZE=204800,SIMPLE_TYPE=["Boolean","Number","String","Undefined","Null","Date","Object"],Logger$2=function(){function e(t,r){_classCallCheck$2(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]"),this.logCacheLevel=(null==r?void 0:r.logCacheLevel)||3,this.logMaxSize=(null==r?void 0:r.logMaxSize)||LOG_MAX_SIZE,this.logSize=0,this.logTextArray=[]}return _createClass$2(e,[{key:"debug",value:function(){for(var t,r,n,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];this.logCache.apply(this,_concatInstanceProperty(t=[LogCacheLevel.DEBUG]).call(t,i)),e.disabled||(n=console).debug.apply(n,_concatInstanceProperty(r=["[".concat(nowTime$1(),"]"),this._prefix]).call(r,i))}},{key:"log",value:function(){for(var t,r,n,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];this.logCache.apply(this,_concatInstanceProperty(t=[LogCacheLevel.LOG]).call(t,i)),e.disabled||(n=console).log.apply(n,_concatInstanceProperty(r=["[".concat(nowTime$1(),"]"),this._prefix]).call(r,i))}},{key:"warn",value:function(){for(var t,r,n,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];this.logCache.apply(this,_concatInstanceProperty(t=[LogCacheLevel.WARN]).call(t,i)),e.disabled||(n=console).warn.apply(n,_concatInstanceProperty(r=["[".concat(nowTime$1(),"]"),this._prefix]).call(r,i))}},{key:"error",value:function(){for(var t,r,n,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];this.logCache.apply(this,_concatInstanceProperty(t=[LogCacheLevel.ERROR]).call(t,i)),e.disabled||(n=console).error.apply(n,_concatInstanceProperty(r=["[".concat(nowTime$1(),"]"),this._prefix]).call(r,i))}},{key:"logCache",value:function(e){if(!(e<this.logCacheLevel)){var t="";try{for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];var i=_mapInstanceProperty(n).call(n,(function(e){return logable(e)}));t="[".concat(nowTime$1(),"]")+this._prefix+_JSON$stringify(i)}catch(e){return}if(e>=this.logCacheLevel&&(this.logSize+=t.length,this.logTextArray.push(t)),this.logSize>this.logMaxSize){var a=this.logTextArray.shift();this.logSize-=a.length}}}},{key:"getLogCache",value:function(){var e=this.logTextArray.join("\n");return this.reset(),e}},{key:"reset",value:function(){this.logTextArray=[],this.logSize=0}},{key:"table",value:function(){var t;e.disabled||(console.group(this._prefix),(t=console).table.apply(t,arguments),console.groupEnd())}},{key:"setLogLevel",value:function(e){this.logCacheLevel=e}}],[{key:"enable",value:function(){e.disabled=!1}},{key:"disable",value:function(){e.disabled=!0}}]),e}();function nowTime$1(){return(new Date).toLocaleString()}function reduceDepth(e){var t;if("object"!==_typeof(e))return e;var r=_sliceInstanceProperty(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}}function logable(e,t,r){var n;r||(r=1),t||(t=2);var o={};if(!e||"object"!==_typeof(e))return e;var i=_sliceInstanceProperty(n=Object.prototype.toString.call(e)).call(n,8,-1);if(!_includesInstanceProperty(SIMPLE_TYPE).call(SIMPLE_TYPE,i))return i;if(!(r>t)){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(r===t?o[a]=reduceDepth(e[a]):"object"===_typeof(e[a])?o[a]=logable(e[a],t,r+1):o[a]=e[a]);return o}}function createPublicPromise(){var e,t,r=new _Promise((function(r,n){e=r,t=n}));return r.used=!1,r.resolve=function(){return r.used=!0,e.apply(void 0,arguments)},r.reject=function(){return r.used=!0,t.apply(void 0,arguments)},r}function nowTime(){try{return _parseInt$1(performance.now(),10)}catch(e){return(new Date).getTime()}}_defineProperty$1(Logger$2,"disabled",!0);var SafeJSON={stringify:function(e){try{return _JSON$stringify(e)}catch(e){return""}},parse:function(e){try{return JSON.parse(e)}catch(e){return}}};function getMediaSource(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];try{return isBrowser$1?e&&"undefined"!=typeof ManagedMediaSource?ManagedMediaSource:window.MediaSource:null}catch(e){}}function isMMS(e){return/ManagedMediaSource/gi.test(Object.prototype.toString.call(e))}function getTimeRanges(e){var t=[];if(e instanceof TimeRanges)for(var r=0;r<e.length;r++)t.push({start:e.start(r),end:e.end(r)});return t}var OP_NAME={APPEND:"appendBuffer",REMOVE:"removeBuffer",UPDATE_DURATION:"updateDuration"},MSE=function(){function e(t,r){var n=this;_classCallCheck$2(this,e),_defineProperty$1(this,"media",null),_defineProperty$1(this,"mediaSource",null),_defineProperty$1(this,"_openPromise",createPublicPromise()),_defineProperty$1(this,"_queue",_Object$create(null)),_defineProperty$1(this,"_sourceBuffer",_Object$create(null)),_defineProperty$1(this,"_mseFullFlag",{}),_defineProperty$1(this,"_st",0),_defineProperty$1(this,"_opst",0),_defineProperty$1(this,"_logger",null),_defineProperty$1(this,"_config",null),_defineProperty$1(this,"_url",null),_defineProperty$1(this,"_onStartStreaming",(function(){n._logger.debug("startstreaming")})),_defineProperty$1(this,"_onEndStreaming",(function(){n._logger.debug("endstreaming")})),_defineProperty$1(this,"_onSBUpdateEnd",(function(e){var t=n._queue[e];if(t){var r=t[0];if((null==r?void 0:r.opName)!==OP_NAME.UPDATE_DURATION&&t.shift(),r){var o,i,a,s=nowTime()-n._opst;n._logger.debug(_concatInstanceProperty(o="UpdateEnd(".concat(e,"/")).call(o,r.opName,")"),SafeJSON.stringify(getTimeRanges(null===(i=n._sourceBuffer[e])||void 0===i?void 0:i.buffered)),s,r.context),r.promise.resolve({name:r.opName,context:r.context,costtime:s});var c=null===(a=r.context)||void 0===a?void 0:a.callback;c&&"function"==typeof c&&c(r.context),n._startQueue(e)}}})),_defineProperty$1(this,"_onSBUpdateError",(function(e,t){var r=n._queue[e];if(r){var o=r[0];o&&(n._logger.error("UpdateError",e,o.opName,o.context),o.promise.reject(new StreamingError(ERR.MEDIA,ERR.SUB_TYPES.MSE_APPEND_BUFFER,t)))}})),this._config=_Object$assign(e.getDefaultConfig(),r),t&&this.bindMedia(t),this._logger=new Logger$2("MSE"),this._config.openLog&&Logger$2.enable()}var t,r,n;return _createClass$2(e,[{key:"isOpened",get:function(){var e;return"open"===(null===(e=this.mediaSource)||void 0===e?void 0:e.readyState)}},{key:"hasOpTasks",get:function(){var e,t=this,r=!1;return _forEachInstanceProperty(e=_Object$keys(this._queue)).call(e,(function(e){var n=t._queue[e];_Array$isArray(n)&&(r||(r=n.length>0))})),r}},{key:"url",get:function(){return this._url}},{key:"duration",get:function(){var e;return(null===(e=this.mediaSource)||void 0===e?void 0:e.duration)||-1}},{key:"isEnded",get:function(){return!!this.mediaSource&&"ended"===this.mediaSource.readyState}},{key:"streaming",get:function(){return!isMMS(this.mediaSource)||this.mediaSource.streaming}},{key:"isFull",value:function(t){return t?this._mseFullFlag[t]:this._mseFullFlag[e.VIDEO]}},{key:"updateDuration",value:function(e){var t=this,r=this.mediaSource&&this.mediaSource.duration>e;if(this.mediaSource&&this.mediaSource.duration>e){var n,o=0;if(_forEachInstanceProperty(n=_Object$keys(this._sourceBuffer)).call(n,(function(e){try{o=Math.max(t.bufferEnd(e)||0,o)}catch(e){}})),e<o)return _Promise.resolve()}return this._enqueueBlockingOp((function(){t.isEnded?t._logger.debug("setDuration but ended"):t.mediaSource&&(t.mediaSource.duration=e,t._logger.debug("setDuration",e))}),OP_NAME.UPDATE_DURATION,{isReduceDuration:r})}},{key:"open",value:function(){var e=this;if(this._openPromise.used&&!this.isOpened&&this.mediaSource){var t=this.mediaSource;t.addEventListener("sourceopen",(function r(){var n=nowTime()-e._st;e._logger.debug("sourceopen",n),t.removeEventListener("sourceopen",r),e._openPromise.resolve({costtime:n})})),this._openPromise=createPublicPromise()}return this._openPromise}},{key:"bindMedia",value:(n=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n,o,i,a=this;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mediaSource&&!this.media){e.next=3;break}return e.next=3,this.unbindMedia();case 3:if(r=getMediaSource(this._config.preferMMS),t&&r){e.next=6;break}throw new Error("Param media or MediaSource does not exist");case 6:return this.media=t,n=this.mediaSource=new r,o=isMMS(n),this._st=nowTime(),i=function e(){var r=nowTime()-a._st;a._logger.debug("sourceopen"),n.removeEventListener("sourceopen",e),_URL.revokeObjectURL(t.src),a._openPromise.resolve({costtime:r})},n.addEventListener("sourceopen",i),o&&(n.addEventListener("startstreaming",this._onStartStreaming),n.addEventListener("endstreaming",this._onEndStreaming)),this._url=_URL.createObjectURL(n),t.src=this._url,t.disableRemotePlayback=o,e.abrupt("return",this._openPromise);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"unbindMedia",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,r,n,o=this;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._openPromise.used||this._openPromise.resolve(),t=this.mediaSource){var i,a;if(_forEachInstanceProperty(i=_Object$keys(this._queue)).call(i,(function(e){var t=o._queue[e];t&&_forEachInstanceProperty(t).call(t,(function(e){var t,r;return null===(t=e.promise)||void 0===t||null===(r=t.resolve)||void 0===r?void 0:r.call(t)}))})),r=!!this.media&&this.media.readyState>=1,n="open"===t.readyState,r&&n)try{t.endOfStream()}catch(e){}_forEachInstanceProperty(a=_Object$keys(this._sourceBuffer)).call(a,(function(e){try{t.removeSourceBuffer(o._sourceBuffer[e])}catch(e){}})),isMMS(t)&&(t.removeEventListener("startstreaming",this._onStartStreaming),t.removeEventListener("endstreaming",this._onEndStreaming))}if(this.media){this.media.disableRemotePlayback=!1,this.media.removeAttribute("src");try{this.media.load()}catch(e){}this.media=null}this.mediaSource=null,this._openPromise=createPublicPromise(),this._queue=_Object$create(null),this._sourceBuffer=_Object$create(null);case 8:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"createSource",value:function(e,t){var r,n;if(!this._sourceBuffer[e]&&this.mediaSource){var o;try{o=this._sourceBuffer[e]=this.mediaSource.addSourceBuffer(t)}catch(e){throw new StreamingError(ERR.MEDIA,ERR.SUB_TYPES.MSE_ADD_SB,e)}o.mimeType=t,o.addEventListener("updateend",_bindInstanceProperty(r=this._onSBUpdateEnd).call(r,this,e)),o.addEventListener("error",_bindInstanceProperty(n=this._onSBUpdateError).call(n,this,e))}}},{key:"changeType",value:function(e,t){var r=this,n=this._sourceBuffer[e];return this.mediaSource&&n&&n.mimeType!==t?"function"!=typeof n.changeType?_Promise.reject(new StreamingError(ERR.MEDIA,ERR.SUB_TYPES.MSE_CHANGE_TYPE,new Error("changeType is not a function"))):this._enqueueOp(e,(function(){try{n.changeType(t)}catch(e){throw new StreamingError(ERR.MEDIA,ERR.SUB_TYPES.MSE_CHANGE_TYPE,e)}n.mimeType=t,r._onSBUpdateEnd(e)}),"changeType",{mimeType:t}):_Promise.resolve()}},{key:"createOrChangeSource",value:function(e,t){return this.createSource(e,t),this.changeType(e,t)}},{key:"append",value:function(e,t,r){var n=this;return t&&t.byteLength&&this._sourceBuffer[e]?this._enqueueOp(e,(function(){var o;n.mediaSource&&!n.media.error&&(n._logger.debug("MSE APPEND START",r),n._opst=nowTime(),null===(o=n._sourceBuffer[e])||void 0===o||o.appendBuffer(t))}),OP_NAME.APPEND,r):_Promise.resolve()}},{key:"remove",value:function(e,t,r,n){var o=this,i=!1;return this._mseFullFlag[e]&&(i=!0),this._enqueueOp(e,(function(){if(o.mediaSource&&!o.media.error){var i=o._sourceBuffer[e];t>=r||!i?o._onSBUpdateEnd(e):(o._opst=nowTime(),o._logger.debug("MSE REMOVE START",e,t,r,n),i.remove(t,r))}}),OP_NAME.REMOVE,n,i)}},{key:"clearBuffer",value:function(e,t){var r,n,o=this;return _forEachInstanceProperty(r=_Object$keys(this._sourceBuffer)).call(r,(function(r){n=o.remove(r,e,t)})),n||_Promise.resolve()}},{key:"clearAllBuffer",value:function(){var e,t,r=this;return _forEachInstanceProperty(e=_Object$keys(this._sourceBuffer)).call(e,(function(e){var n=r._sourceBuffer[e];t=r.remove(e,0,Buffer$1.end(Buffer$1.get(n)))})),t}},{key:"clearOpQueues",value:function(e,t){var r;this._logger.debug("MSE clearOpQueue START");var n=this._queue[e];if(t&&n)this._queue[e]=[];else if(n&&n[e]&&!(n.length<5)){var o=[];_forEachInstanceProperty(n).call(n,(function(e){e.context&&e.context.isinit&&o.push(e)})),this._queue[e]=_sliceInstanceProperty(n).call(n,0,2),o.length>0&&(r=this._queue[e]).push.apply(r,o)}}},{key:"endOfStream",value:function(e){var t=this;return this.mediaSource&&"open"===this.mediaSource.readyState?this._enqueueBlockingOp((function(){var r=t.mediaSource;r&&"open"===r.readyState&&(t._logger.debug("MSE endOfStream START"),e?r.endOfStream(e):r.endOfStream())}),"endOfStream"):_Promise.resolve()}},{key:"setLiveSeekableRange",value:function(e,t){var r=this.mediaSource;e<0||t<e||null==r||!r.setLiveSeekableRange||"open"!==r.readyState||r.setLiveSeekableRange(e,t)}},{key:"getSourceBuffer",value:function(e){return this._sourceBuffer[e]}},{key:"buffered",value:function(e){return Buffer$1.get(this._sourceBuffer[e])}},{key:"bufferStart",value:function(e){return Buffer$1.start(this.buffered(e))}},{key:"bufferEnd",value:function(e){return Buffer$1.end(this.buffered(e))}},{key:"_enqueueOp",value:function(e,t,r,n,o){var i=this;if(!this.mediaSource)return _Promise.resolve();var a=this._queue[e]=this._queue[e]||[],s={exec:t,promise:createPublicPromise(),opName:r,context:n};return o?(_spliceInstanceProperty(a).call(a,0,0,s),this._mseFullFlag[e]=!1,this._startQueue(e)):a.push(s),this.isOpened||this.isEnded?1===a.length&&this._startQueue(e):this._openPromise.then((function(){1===a.length&&i._startQueue(e)})),s.promise}},{key:"_enqueueBlockingOp",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){var o,i,a=this;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mediaSource){e.next=2;break}return e.abrupt("return",_Promise.resolve());case 2:if((o=_Object$keys(this._sourceBuffer)).length){e.next=5;break}return e.abrupt("return",t());case 5:return i=[],_forEachInstanceProperty(o).call(o,(function(e){var t=a._queue[e],o=createPublicPromise();i.push(o),t.push({exec:function(){o.resolve()},promise:o,opName:r,context:n}),1===t.length&&a._startQueue(e)})),e.abrupt("return",_Promise.all(i).then((function(){try{return t()}finally{_forEachInstanceProperty(o).call(o,(function(e){var t=a._queue[e],r=a._sourceBuffer[e];null==t||t.shift(),r&&r.updating||a._startQueue(e)}))}})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})},{key:"_startQueue",value:function(e){var t=this._queue[e];if(t){var r=t[0];if(r&&!this._mseFullFlag[e])try{r.exec()}catch(a){var n,o,i;if(a&&a.message&&_indexOfInstanceProperty(n=a.message).call(n,"SourceBuffer is full")>=0)this._mseFullFlag[e]=!0,r.context&&"object"===_typeof(r.context)&&(r.context.isFull=!0),this._logger.error("[MSE error], context,",r.context," ,name,",r.opName,",err,SourceBuffer is full"),null==r||null===(o=r.promise)||void 0===o||o.reject(new StreamingError(ERR.MEDIA,ERR.SUB_TYPES.MSE_FULL,a));else this._logger.error(a),null==r||null===(i=r.promise)||void 0===i||i.reject(a.constructor===StreamingError?a:new StreamingError(ERR.MEDIA,ERR.SUB_TYPES.MSE_OTHER,a)),t.shift(),this._startQueue(e)}}}},{key:"setTimeoffset",value:function(e,t,r){var n=this;return this._enqueueOp(e,(function(){t<0&&(t+=.001),n._sourceBuffer[e].timestampOffset=t,n._onSBUpdateEnd(e)}),"setTimeoffset",r)}},{key:"abort",value:function(e,t){var r=this;return this.isOpened?this._enqueueOp(e,(function(){r._sourceBuffer[e].abort(),r._onSBUpdateEnd(e)}),"abort",t):_Promise.resolve()}}],[{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'video/mp4; codecs="avc1.42E01E,mp4a.40.2"',t=getMediaSource(!(arguments.length>1&&void 0!==arguments[1])||arguments[1]);if(!t)return!1;try{return t.isTypeSupported(e)}catch(t){return this._logger.error(e,t),!1}}},{key:"isMMSOnly",value:function(){return"undefined"!=typeof ManagedMediaSource&&"undefined"==typeof MediaSource}},{key:"getDefaultConfig",value:function(){return{openLog:!1,preferMMS:!1}}}]),e}();_defineProperty$1(MSE,"VIDEO","video"),_defineProperty$1(MSE,"AUDIO","audio");var LoaderType={FETCH:"fetch",XHR:"xhr"},ResponseType={ARRAY_BUFFER:"arraybuffer",TEXT:"text",JSON:"json"},NetError=function(e){_inherits$2(r,_wrapNativeSuper(Error));var t=_createSuper$1(r);function r(e,n,o,i){var a;return _classCallCheck$2(this,r),_defineProperty$1(_assertThisInitialized$2(a=t.call(this,i)),"retryCount",0),_defineProperty$1(_assertThisInitialized$2(a),"isTimeout",!1),_defineProperty$1(_assertThisInitialized$2(a),"loaderType",LoaderType.FETCH),_defineProperty$1(_assertThisInitialized$2(a),"startTime",0),_defineProperty$1(_assertThisInitialized$2(a),"endTime",0),_defineProperty$1(_assertThisInitialized$2(a),"options",{}),a.url=e,a.request=n,a.response=o,a}return _createClass$2(r)}(),toString$1=Object.prototype.toString;function isObject$1(e){return null!==e&&"object"===_typeof(e)}function isPlainObject(e){if("[object Object]"!==toString$1.call(e))return!1;var t=_Object$getPrototypeOf(e);return null===t||t===Object.prototype}function isDate(e){return"[object Date]"===toString$1.call(e)}function getRangeValue(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 encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function setUrlParams(e,t){var r,n;if(e){if(!t)return e;var o,i=_filterInstanceProperty(r=_mapInstanceProperty(n=_Object$keys(t)).call(n,(function(e){if(null!=(o=t[e]))return _Array$isArray(o)?e+="[]":o=[o],_mapInstanceProperty(o).call(o,(function(t){var r;return isDate(t)?t=t.toISOString():isObject$1(t)&&(t=_JSON$stringify(t)),_concatInstanceProperty(r="".concat(encode(e),"=")).call(r,encode(t))})).join("&")}))).call(r,Boolean).join("&");if(i){var a=_indexOfInstanceProperty(e).call(e,"#");-1!==a&&(e=_sliceInstanceProperty(e).call(e,0,a)),e+=(-1===_indexOfInstanceProperty(e).call(e,"?")?"?":"&")+i}return e}}function createResponse(e,t,r,n,o,i,a,s,c,l,u){return o=null!=o?_parseFloat$1(o):null,n=_parseInt$1(n||"0",10),_Number$isNaN(n)&&(n=0),{data:e,done:t,options:{range:c,vid:l,index:s,contentLength:n,age:o,startTime:i,firstByteTime:a,endTime:_Date$now(),priOptions:u},response:r}}function calculateSpeed(e,t){return Math.round(8*e*1e3/t/1024)}var EVENT={ERROR:"error",TTFB:"core.ttfb",LOAD_START:"core.loadstart",LOAD_RESPONSE_HEADERS:"core.loadresponseheaders",LOAD_COMPLETE:"core.loadcomplete",LOAD_RETRY:"core.loadretry",SOURCEBUFFER_CREATED:"core.sourcebuffercreated",MEDIASOURCE_OPENED:"core.mediasourceopened",ANALYZE_DURATION_EXCEEDED:"core.analyzedurationexceeded",APPEND_BUFFER:"core.appendbuffer",REMOVE_BUFFER:"core.removebuffer",BUFFEREOS:"core.buffereos",KEYFRAME:"core.keyframe",CHASEFRAME:"core.chaseframe",METADATA_PARSED:"core.metadataparsed",SEI:"core.sei",SEI_IN_TIME:"core.seiintime",FLV_SCRIPT_DATA:"core.flvscriptdata",LOWDECODE:"core.lowdecode",SWITCH_URL_SUCCESS:"core.switchurlsuccess",SWITCH_URL_FAILED:"core.switchurlfailed",SPEED:"core.speed",HLS_MANIFEST_LOADED:"core.hlsmanifestloaded",HLS_LEVEL_LOADED:"core.hlslevelloaded",DEMUXED_TRACK:"core.demuxedtrack",STREAM_EXCEPTION:"core.streamexception",LARGE_AV_FIRST_FRAME_GAP_DETECT:"LARGE_AV_FIRST_FRAME_GAP_DETECT",LARGE_VIDEO_DTS_GAP_DETECT:"LARGE_VIDEO_DTS_GAP_DETECT",LARGE_AUDIO_DTS_GAP_DETECT:"LARGE_AUDIO_DTS_GAP_DETECT",AUDIO_GAP_DETECT:"AUDIO_GAP_DETECT",AUDIO_OVERLAP_DETECT:"AUDIO_OVERLAP_DETECT",MAX_DTS_DELTA_WITH_NEXT_SEGMENT_DETECT:"MAX_DTS_DELTA_WITH_NEXT_SEGMENT_DETECT",REAL_TIME_SPEED:"real_time_speed"},CACHESIZE=2097152,FetchLoader=function(e){_inherits$2(n,EventEmitter);var t,r=_createSuper$1(n);function n(){var e;return _classCallCheck$2(this,n),_defineProperty$1(_assertThisInitialized$2(e=r.call(this)),"_abortController",null),_defineProperty$1(_assertThisInitialized$2(e),"_timeoutTimer",null),_defineProperty$1(_assertThisInitialized$2(e),"_reader",null),_defineProperty$1(_assertThisInitialized$2(e),"_response",null),_defineProperty$1(_assertThisInitialized$2(e),"_aborted",!1),_defineProperty$1(_assertThisInitialized$2(e),"_index",-1),_defineProperty$1(_assertThisInitialized$2(e),"_range",null),_defineProperty$1(_assertThisInitialized$2(e),"_receivedLength",0),_defineProperty$1(_assertThisInitialized$2(e),"_running",!1),_defineProperty$1(_assertThisInitialized$2(e),"_logger",null),_defineProperty$1(_assertThisInitialized$2(e),"_vid",""),_defineProperty$1(_assertThisInitialized$2(e),"_firtstByte",0),_defineProperty$1(_assertThisInitialized$2(e),"_onProcessMinLen",0),_defineProperty$1(_assertThisInitialized$2(e),"_onCancel",null),_defineProperty$1(_assertThisInitialized$2(e),"_priOptions",null),e}return _createClass$2(n,[{key:"load",value:function(e){var t,r=this,n=e.url,o=e.vid,i=e.timeout,a=e.responseType,s=e.onProgress,c=e.index,l=e.onTimeout,u=e.onCancel,p=e.range,$=e.transformResponse,f=e.request,d=e.params,y=e.logger,h=e.method,_=e.headers,g=e.body,m=e.mode,v=e.credentials,b=e.cache,S=e.redirect,E=e.referrer,P=e.referrerPolicy,O=e.onProcessMinLen,T=e.priOptions,I=e.streamRes,A=e.firstMaxChunkSize;this._logger=y,this._aborted=!1,this._onProcessMinLen=O,this._onCancel=u,this._abortController="undefined"!=typeof AbortController&&new AbortController,this._running=!0,this._index=c,this._range=p||[0,0],this._vid=o||n,this._priOptions=T||{},this._firstMaxChunkSize=A;var R={method:h,headers:_,body:g,mode:m,credentials:v,cache:b,redirect:S,referrer:E,referrerPolicy:P,signal:null===(t=this._abortController)||void 0===t?void 0:t.signal},C=!1;clearTimeout(this._timeoutTimer),n=setUrlParams(n,d);var w=getRangeValue(p);w&&(_=f?f.headers:R.headers=R.headers||(Headers?new Headers:{}),Headers&&_ instanceof Headers?_.append("Range",w):_.Range=w),i&&(this._timeoutTimer=_setTimeout((function(){if(C=!0,r.cancel(),l){var e=new NetError(n,R,null,"timeout");e.isTimeout=!0,l(e,{index:r._index,range:r._range,vid:r._vid,priOptions:r._priOptions})}}),i));var D=_Date$now();return this._logger.debug("[fetch load start], index,",c,",range,",p),new _Promise((function(e,t){(I?new _Promise((function(e){e(I)})):fetch(f||n,f?void 0:R)).then(function(){var o=_asyncToGenerator(_regeneratorRuntime().mark((function o(i){var l,u,f,d;return _regeneratorRuntime().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(clearTimeout(r._timeoutTimer),r._response=i,!r._aborted&&r._running){o.next=4;break}return o.abrupt("return");case 4:if($&&(i=$(i,n)||i),i.ok){o.next=7;break}throw new NetError(n,R,i,"bad network response");case 7:if(l=_Date$now(),a!==ResponseType.TEXT){o.next=15;break}return o.next=11,i.text();case 11:u=o.sent,r._running=!1,o.next=37;break;case 15:if(a!==ResponseType.JSON){o.next=22;break}return o.next=18,i.json();case 18:u=o.sent,r._running=!1,o.next=37;break;case 22:if(!s){o.next=29;break}return r.resolve=e,r.reject=t,r._loadChunk(i,s,D,l),o.abrupt("return");case 29:return o.next=31,i.arrayBuffer();case 31:u=o.sent,u=new Uint8Array(u),r._running=!1,f=_Date$now()-D,d=calculateSpeed(u.byteLength,f),r.emit(EVENT.REAL_TIME_SPEED,{speed:d,len:u.byteLength,time:f,vid:r._vid,index:r._index,range:r._range,priOptions:r._priOptions});case 37:r._logger.debug("[fetch load end], index,",c,",range,",p),e(createResponse(u,!0,i,i.headers.get("Content-Length"),i.headers.get("age"),D,l,c,p,r._vid,r._priOptions));case 39:case"end":return o.stop()}}),o)})));return function(e){return o.apply(this,arguments)}}()).catch((function(e){var o;clearTimeout(r._timeoutTimer),r._running=!1,r._aborted&&!C||((e=e instanceof NetError?e:new NetError(n,R,null,null===(o=e)||void 0===o?void 0:o.message)).startTime=D,e.endTime=_Date$now(),e.isTimeout=C,e.options={index:r._index,range:r._range,vid:r._vid,priOptions:r._priOptions},t(e))}))}))}},{key:"cancel",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().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 t.apply(this,arguments)})},{key:"_loadChunk",value:function(e,t,r,n){var o=this;if(!e.body||!e.body.getReader){this._running=!1;var i=new NetError(e.url,"",e,"onProgress of bad response.body.getReader");return i.options={index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions},void this.reject(i)}this._onProcessMinLen>0&&(this._cache=new Uint8Array(CACHESIZE),this._writeIdx=0);var a,s,c,l=this._reader=e.body.getReader(),u=function(){var i=_asyncToGenerator(_regeneratorRuntime().mark((function i(){var p,$,f,d,y,h,_,g,m,v;return _regeneratorRuntime().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return s=_Date$now(),i.prev=1,i.next=4,l.read();case 4:a=i.sent,c=_Date$now(),i.next=13;break;case 8:return i.prev=8,i.t0=i.catch(1),c=_Date$now(),o._aborted||(o._running=!1,i.t0.options={index:o._index,range:o._range,vid:o._vid,priOptions:o._priOptions},o.reject(i.t0)),i.abrupt("return");case 13:if($=(null===(p=o._range)||void 0===p?void 0:p.length)>0?o._range[0]:0,f=$+o._receivedLength,!o._aborted){i.next=19;break}return o._running=!1,t(void 0,!1,{range:[f,f],vid:o._vid,index:o._index,startTime:s,endTime:c,st:r,firstByteTime:n,priOptions:o._priOptions},e),i.abrupt("return");case 19:var b;if(d=a.value?a.value.byteLength:0,o._receivedLength+=d,o._logger.debug("【fetchLoader,onProgress call】,task,",o._range,", start,",f,", end,",$+o._receivedLength,", done,",a.done),o._onProcessMinLen>0){if(o._writeIdx+d>=o._onProcessMinLen||a.done)(y=new Uint8Array(o._writeIdx+d)).set(_sliceInstanceProperty(b=o._cache).call(b,0,o._writeIdx),0),d>0&&y.set(a.value,o._writeIdx),o._writeIdx=0,o._logger.debug("【fetchLoader,onProgress enough】,done,",a.done,",len,",y.byteLength,", writeIdx,",o._writeIdx);else if(d>0&&o._writeIdx+d<CACHESIZE)o._cache.set(a.value,o._writeIdx),o._writeIdx+=d,o._logger.debug("【fetchLoader,onProgress cache】,len,",d,", writeIdx,",o._writeIdx);else if(d>0){var S;h=new Uint8Array(o._writeIdx+d+2048),o._logger.debug("【fetchLoader,onProgress extra start】,size,",o._writeIdx+d+2048,", datalen,",d,", writeIdx,",o._writeIdx),h.set(_sliceInstanceProperty(S=o._cache).call(S,0,o._writeIdx),0),d>0&&h.set(a.value,o._writeIdx),o._writeIdx+=d,delete o._cache,o._cache=h,o._logger.debug("【fetchLoader,onProgress extra end】,len,",d,", writeIdx,",o._writeIdx)}}else y=a.value;(y&&y.byteLength>0||a.done)&&(o._firstMaxChunkSize&&(o._firtstByte?o._cacheData&&((g=new Uint8Array(o._cacheData.byteLength+y.byteLength)).set(o._cacheData,0),g.set(y,o._cacheData.byteLength),y=g,o._cacheData=null):(o._firtstByte++,_=_sliceInstanceProperty(y).call(y,0,o._firstMaxChunkSize),o._cacheData=_sliceInstanceProperty(y).call(y,o._firstMaxChunkSize),y=_)),t(y,a.done,{range:[o._range[0]+o._receivedLength-(y?y.byteLength:0),o._range[0]+o._receivedLength],vid:o._vid,index:o._index,startTime:s,endTime:c,st:r,firstByteTime:n,priOptions:o._priOptions},e)),a.done?(m=_Date$now()-r,v=calculateSpeed(o._receivedLength,m),o.emit(EVENT.REAL_TIME_SPEED,{speed:v,len:o._receivedLength,time:m,vid:o._vid,index:o._index,range:o._range,priOptions:o._priOptions}),o._running=!1,o._logger.debug("[fetchLoader onProgress end],task,",o._range,",done,",a.done),o.resolve(createResponse(a,!0,e,e.headers.get("Content-Length"),e.headers.get("age"),r,n,o._index,o._range,o._vid,o._priOptions))):o._firstMaxChunkSize?_setTimeout((function(){u()}),0):u();case 25:case"end":return i.stop()}}),i,null,[[1,8]])})));return function(){return i.apply(this,arguments)}}();u()}},{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)}}]),n}();function getConfig(e){return _objectSpread2({loaderType:LoaderType.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:ResponseType.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},e)}var XhrLoader=function(e){_inherits$2(r,EventEmitter);var t=_createSuper$1(r);function r(){var e;return _classCallCheck$2(this,r),_defineProperty$1(_assertThisInitialized$2(e=t.call(this)),"_xhr",null),_defineProperty$1(_assertThisInitialized$2(e),"_aborted",!1),_defineProperty$1(_assertThisInitialized$2(e),"_timeoutTimer",null),_defineProperty$1(_assertThisInitialized$2(e),"_range",null),_defineProperty$1(_assertThisInitialized$2(e),"_receivedLength",0),_defineProperty$1(_assertThisInitialized$2(e),"_url",null),_defineProperty$1(_assertThisInitialized$2(e),"_onProgress",null),_defineProperty$1(_assertThisInitialized$2(e),"_index",-1),_defineProperty$1(_assertThisInitialized$2(e),"_headers",null),_defineProperty$1(_assertThisInitialized$2(e),"_currentChunkSizeKB",384),_defineProperty$1(_assertThisInitialized$2(e),"_timeout",null),_defineProperty$1(_assertThisInitialized$2(e),"_xhr",null),_defineProperty$1(_assertThisInitialized$2(e),"_withCredentials",null),_defineProperty$1(_assertThisInitialized$2(e),"_startTime",-1),_defineProperty$1(_assertThisInitialized$2(e),"_loadCompleteResolve",null),_defineProperty$1(_assertThisInitialized$2(e),"_loadCompleteReject",null),_defineProperty$1(_assertThisInitialized$2(e),"_runing",!1),_defineProperty$1(_assertThisInitialized$2(e),"_logger",!1),_defineProperty$1(_assertThisInitialized$2(e),"_vid",""),_defineProperty$1(_assertThisInitialized$2(e),"_responseType",void 0),_defineProperty$1(_assertThisInitialized$2(e),"_credentials",void 0),_defineProperty$1(_assertThisInitialized$2(e),"_method",void 0),_defineProperty$1(_assertThisInitialized$2(e),"_transformResponse",void 0),_defineProperty$1(_assertThisInitialized$2(e),"_firstRtt",void 0),_defineProperty$1(_assertThisInitialized$2(e),"_onCancel",null),_defineProperty$1(_assertThisInitialized$2(e),"_priOptions",null),e}return _createClass$2(r,[{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=setUrlParams(e.url,e.params);var r=_Date$now();return new _Promise((function(e,r){t._loadCompleteResolve=e,t._loadCompleteReject=r,t._startLoad()})).catch((function(e){if(clearTimeout(t._timeoutTimer),t._runing=!1,!t._aborted)throw(e=e instanceof NetError?e:new NetError(t._url,t._request)).startTime=r,e.endTime=_Date$now(),e.options={index:t._index,vid:t._vid,priOptions:t._priOptions},e}))}},{key:"_startLoad",value:function(){var e=null;if(this._responseType===ResponseType.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<this._range[1]-r&&(n=r+t),e=[r,n],this._logger.debug("[xhr_loader->],tast :",this._range,", SubRange, ",e)}else e=this._range,this._logger.debug("[xhr_loader->],tast :",this._range,", allRange, ",e);this._internalOpen(e)}},{key:"_internalOpen",value:function(e){var t=this;try{var r,n;this._startTime=_Date$now();var o=this._xhr=new XMLHttpRequest;o.open(this._method||"GET",this._url,!0),o.responseType=this._responseType,this._timeout&&(o.timeout=this._timeout),o.withCredentials=this._withCredentials,o.onload=_bindInstanceProperty(r=this._onLoad).call(r,this),o.onreadystatechange=_bindInstanceProperty(n=this._onReadyStatechange).call(n,this),o.onerror=function(e){var r,n,o;t._running=!1;var i=new NetError(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===(o=e.currentTarget)||void 0===o?void 0:o.statusText));i.options={index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions},t._loadCompleteReject(i)},o.ontimeout=function(e){t.cancel();var r=new NetError(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 i,a=this._headers||{},s=getRangeValue(e);if(s&&(a.Range=s),a)_forEachInstanceProperty(i=_Object$keys(a)).call(i,(function(e){o.setRequestHeader(e,a[e])}));this._logger.debug("[xhr.send->] tast,",this._range,",load sub range, ",e),o.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=_Date$now())}},{key:"_onLoad",value:function(e){var t,r=e.target.status;if(r<200||r>299){var n=new NetError(this._url,null,_objectSpread2(_objectSpread2({},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 o,i=null,a=!1,s=(null===(t=this._range)||void 0===t?void 0:t.length)>0?this._range[0]:0;if(this._responseType===ResponseType.ARRAY_BUFFER){var c,l=new Uint8Array(e.target.response);if(o=s+this._receivedLength,l&&l.byteLength>0){this._receivedLength+=l.byteLength;var u=_Date$now()-this._startTime,p=calculateSpeed(this._receivedLength,u);this.emit(EVENT.REAL_TIME_SPEED,{speed:p,len:this._receivedLength,time:u,vid:this._vid,index:this._index,range:[o,s+this._receivedLength],priOptions:this._priOptions})}i=l,a=!((null===(c=this._range)||void 0===c?void 0:c.length)>1&&this._range[1]&&this._receivedLength<this._range[1]-this._range[0]),this._logger.debug("[xhr load done->], tast :",this._range,", start",o,"end ",s+this._receivedLength,",dataLen,",l?l.byteLength:0,",receivedLength",this._receivedLength,",index,",this._index,", done,",a)}else a=!0,i=e.target.response;var $={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&&($=this._transformResponse($,this._url)||$),this._onProgress&&this._onProgress(i,a,{index:this._index,vid:this._vid,range:[o,s+this._receivedLength],startTime:this._startTime,endTime:_Date$now(),priOptions:this._priOptions},$),a?(this._runing=!1,this._loadCompleteResolve&&this._loadCompleteResolve(createResponse(this._onProgress?null:i,a,$,$.headers["content-length"],$.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,_get(_getPrototypeOf$2(r.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={},o=_createForOfIteratorHelper(_trimInstanceProperty(t=e.getAllResponseHeaders()).call(t).split("\r\n"));try{for(o.s();!(r=o.n()).done;){var i=r.value.split(": ");n[i[0].toLowerCase()]=_sliceInstanceProperty(i).call(i,1).join(": ")}}catch(e){o.e(e)}finally{o.f()}return n}}],[{key:"isSupported",value:function(){return"undefined"!=typeof XMLHttpRequest}}]),r}(),_excluded=["retry","retryDelay","onRetryError","transformError"],Task=function(){function e(t,r){_classCallCheck$2(this,e),this.promise=createPublicPromise(),this.alive=!!r.onProgress,!r.logger&&(r.logger=new Logger$2("Loader")),this._loaderType=t,this._loader=t===LoaderType.FETCH&&"undefined"!=typeof fetch?new FetchLoader:new XhrLoader,this._config=r,this._retryCount=0,this._retryTimer=null,this._canceled=!1,this._retryCheckFunc=r.retryCheckFunc,this._logger=r.logger}var t;return _createClass$2(e,[{key:"exec",value:function(){var e=this,t=this._config,r=t.retry,n=t.retryDelay,o=t.onRetryError,i=t.transformError,a=_objectWithoutProperties(t,_excluded),s=function(){var t=_asyncToGenerator(_regeneratorRuntime().mark((function t(){var c,l,u;return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e._loader.load(a);case 3:c=t.sent,e.promise.resolve(c),t.next=27;break;case 7:if(t.prev=7,t.t0=t.catch(0),e._loader.running=!1,e._logger.debug("[task request catch err]",t.t0),!e._canceled){t.next=13;break}return t.abrupt("return");case 13:if(t.t0.loaderType=e._loaderType,t.t0.retryCount=e._retryCount,l=t.t0,i&&(l=i(l)||l),o&&e._retryCount>0&&o(l,e._retryCount,{index:a.index,vid:a.vid,range:a.range,priOptions:a.priOptions}),e._retryCount++,u=!0,e._retryCheckFunc&&(u=e._retryCheckFunc(t.t0)),!(u&&e._retryCount<=r)){t.next=26;break}return clearTimeout(e._retryTimer),e._logger.debug("[task request setTimeout],retry",e._retryCount,",retry range,",a.range),e._retryTimer=_setTimeout(s,n),t.abrupt("return");case 26:e.promise.reject(l);case 27:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}();return s(),this.promise}},{key:"cancel",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return clearTimeout(this._retryTimer),this._canceled=!0,this._loader.running=!1,e.abrupt("return",this._loader.cancel());case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"running",get:function(){return this._loader&&this._loader.running}},{key:"loader",get:function(){return this._loader}}]),e}();function isMediaPlaying(e){return e&&!e.paused&&!e.ended&&0!==e.playbackRate&&0!==e.readyState}function getVideoPlaybackQuality(e){if(!e)return{};if("function"==typeof e.getVideoPlaybackQuality){var t=e.getVideoPlaybackQuality();return{droppedVideoFrames:t.droppedVideoFrames||t.corruptedVideoFrames,totalVideoFrames:t.totalVideoFrames,creationTime:t.creationTime}}return{droppedVideoFrames:e.webkitDroppedFrameCount,totalVideoFrames:e.webkitDecodedFrameCount,creationTime:performance.now()}}function concatUint8Array$1(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if((t=_filterInstanceProperty(t).call(t,Boolean)).length<2)return t[0];var n=new Uint8Array(_reduceInstanceProperty(t).call(t,(function(e,t){return e+t.byteLength}),0)),o=0;return _forEachInstanceProperty(t).call(t,(function(e){n.set(e,o),o+=e.byteLength})),n}function sleep(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new _Promise((function(t){return _setTimeout(t,e)}))}var NetLoader=function(e){_inherits$2(n,EventEmitter);var t,r=_createSuper$1(n);function n(e){var t;return _classCallCheck$2(this,n),_defineProperty$1(_assertThisInitialized$2(t=r.call(this,e)),"type",LoaderType.FETCH),_defineProperty$1(_assertThisInitialized$2(t),"_queue",[]),_defineProperty$1(_assertThisInitialized$2(t),"_alive",[]),_defineProperty$1(_assertThisInitialized$2(t),"_currentTask",null),_defineProperty$1(_assertThisInitialized$2(t),"_finnalUrl",""),_defineProperty$1(_assertThisInitialized$2(t),"_config",void 0),t._config=getConfig(e),t._config.loaderType!==LoaderType.XHR&&FetchLoader.isSupported()||(t.type=LoaderType.XHR),t.log=e.logger,t}return _createClass$2(n,[{key:"isFetch",value:function(){return this.type===LoaderType.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=_Object$assign({},this._config,r)).params&&(r.params=_Object$assign({},r.params)),r.headers&&isPlainObject(r.headers)&&(r.headers=_Object$assign({},r.headers)),r.body&&isPlainObject(r.body)&&(r.body=_Object$assign({},r.body)),r.transformRequest&&(r=r.transformRequest(r)||r),r.logger=this.log;var n=new Task(this.type,r);return n.loader.on(EVENT.REAL_TIME_SPEED,(function(e){t.emit(EVENT.REAL_TIME_SPEED,e)})),this._queue.push(n),1!==this._queue.length||this._currentTask&&this._currentTask.running||this._processTask(),n.promise}},{key:"cancel",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t;return _regeneratorRuntime().wrap((function(e){for(var r,n,o;;)switch(e.prev=e.next){case 0:return t=_concatInstanceProperty(r=_mapInstanceProperty(n=this._queue).call(n,(function(e){return e.cancel()}))).call(r,_mapInstanceProperty(o=this._alive).call(o,(function(e){return e.cancel()}))),this._currentTask&&t.push(this._currentTask.cancel()),this._queue=[],this._alive=[],e.next=6,_Promise.all(t);case 6:return e.next=8,sleep();case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.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=_filterInstanceProperty(n=e._alive).call(n,(function(t){return t&&t!==e._currentTask})));e._processTask()}))}}}],[{key:"isFetchSupport",value:function(){return FetchLoader.isSupported()}}]),n}(),GapService=function(){function e(){_classCallCheck$2(this,e),_defineProperty$1(this,"_prevCurrentTime",0)}return _createClass$2(e,[{key:"do",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(e){var o=e.currentTime,i=0;if(this._prevCurrentTime===o){var a=Buffer$1.info(Buffer$1.get(e),o);if(!a.buffers.length)return;r&&a.nextStart||a.nextStart&&a.nextStart-o<t?i=a.nextStart+.1:a.end&&a.end-o>n&&!e.seeking&&(i=o+.1)}this._prevCurrentTime=o,i&&o!==i&&(e.currentTime=i)}}}]),e}(),collection=collection$2,collectionStrong=collectionStrong$2;collection("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),collectionStrong);var path$2=path$w,set$5=path$2.Set,parent$e=set$5,set$4=parent$e,tryToString=tryToString$8,aSet$g=function(e){if("object"==typeof e&&"size"in e&&"has"in e&&"add"in e&&"delete"in e&&"keys"in e)return e;throw TypeError(tryToString(e)+" is not a set")},getBuiltIn$1=getBuiltIn$j,caller=caller$2,Set$5=getBuiltIn$1("Set"),SetPrototype=Set$5.prototype,setHelpers={Set:Set$5,add:caller("add",1),has:caller("has",1),remove:caller("delete",1),proto:SetPrototype},iterateSimple$6=iterateSimple$8,setIterate=function(e,t,r){return r?iterateSimple$6(e.keys(),t):e.forEach(t)},SetHelpers$5=setHelpers,iterate$8=setIterate,Set$4=SetHelpers$5.Set,add$6=SetHelpers$5.add,setClone=function(e){var t=new Set$4;return iterate$8(e,(function(e){add$6(t,e)})),t},setSize=function(e){return e.size},aCallable$1=aCallable$l,anObject$1=anObject$i,call$8=functionCall,toIntegerOrInfinity=toIntegerOrInfinity$6,$TypeError$1=TypeError,max=Math.max,SetRecord=function(e,t,r,n){this.set=e,this.size=t,this.has=r,this.keys=n};SetRecord.prototype={getIterator:function(){return anObject$1(call$8(this.keys,this.set))},includes:function(e){return call$8(this.has,this.set,e)}};var getSetRecord$7=function(e){anObject$1(e);var t=+e.size;if(t!=t)throw $TypeError$1("Invalid size");return new SetRecord(e,max(toIntegerOrInfinity(t),0),aCallable$1(e.has),aCallable$1(e.keys))},aSet$f=aSet$g,SetHelpers$4=setHelpers,clone$2=setClone,size$4=setSize,getSetRecord$6=getSetRecord$7,iterateSet$2=setIterate,iterateSimple$5=iterateSimple$8,has$4=SetHelpers$4.has,remove$2=SetHelpers$4.remove,setDifference=function(e){var t=aSet$f(this),r=getSetRecord$6(e),n=clone$2(t);return size$4(t)<=r.size?iterateSet$2(t,(function(e){r.includes(e)&&remove$2(n,e)})):iterateSimple$5(r.getIterator(),(function(e){has$4(t,e)&&remove$2(n,e)})),n},setMethodAcceptSetLike$7=function(){return!1},$$q=_export,difference2=setDifference,setMethodAcceptSetLike$6=setMethodAcceptSetLike$7;$$q({target:"Set",proto:!0,real:!0,forced:!setMethodAcceptSetLike$6()},{difference:difference2});var aSet$e=aSet$g,SetHelpers$3=setHelpers,size$3=setSize,getSetRecord$5=getSetRecord$7,iterateSet$1=setIterate,iterateSimple$4=iterateSimple$8,Set$3=SetHelpers$3.Set,add$5=SetHelpers$3.add,has$3=SetHelpers$3.has,setIntersection=function(e){var t=aSet$e(this),r=getSetRecord$5(e),n=new Set$3;return size$3(t)>r.size?iterateSimple$4(r.getIterator(),(function(e){has$3(t,e)&&add$5(n,e)})):iterateSet$1(t,(function(e){r.includes(e)&&add$5(n,e)})),n},$$p=_export,intersection2=setIntersection,setMethodAcceptSetLike$5=setMethodAcceptSetLike$7,INCORRECT=!setMethodAcceptSetLike$5();$$p({target:"Set",proto:!0,real:!0,forced:INCORRECT},{intersection:intersection2});var aSet$d=aSet$g,has$2=setHelpers.has,size$2=setSize,getSetRecord$4=getSetRecord$7,iterateSet=setIterate,iterateSimple$3=iterateSimple$8,iteratorClose$1=iteratorClose$4,setIsDisjointFrom=function(e){var t=aSet$d(this),r=getSetRecord$4(e);if(size$2(t)<=r.size)return!1!==iterateSet(t,(function(e){if(r.includes(e))return!1}),!0);var n=r.getIterator();return!1!==iterateSimple$3(n,(function(e){if(has$2(t,e))return iteratorClose$1(n,"normal",!1)}))},$$o=_export,isDisjointFrom2=setIsDisjointFrom,setMethodAcceptSetLike$4=setMethodAcceptSetLike$7;$$o({target:"Set",proto:!0,real:!0,forced:!setMethodAcceptSetLike$4()},{isDisjointFrom:isDisjointFrom2});var aSet$c=aSet$g,size$1=setSize,iterate$7=setIterate,getSetRecord$3=getSetRecord$7,setIsSubsetOf=function(e){var t=aSet$c(this),r=getSetRecord$3(e);return!(size$1(t)>r.size)&&!1!==iterate$7(t,(function(e){if(!r.includes(e))return!1}),!0)},$$n=_export,isSubsetOf2=setIsSubsetOf,setMethodAcceptSetLike$3=setMethodAcceptSetLike$7;$$n({target:"Set",proto:!0,real:!0,forced:!setMethodAcceptSetLike$3()},{isSubsetOf:isSubsetOf2});var aSet$b=aSet$g,has$1=setHelpers.has,size2=setSize,getSetRecord$2=getSetRecord$7,iterateSimple$2=iterateSimple$8,iteratorClose=iteratorClose$4,setIsSupersetOf=function(e){var t=aSet$b(this),r=getSetRecord$2(e);if(size2(t)<r.size)return!1;var n=r.getIterator();return!1!==iterateSimple$2(n,(function(e){if(!has$1(t,e))return iteratorClose(n,"normal",!1)}))},$$m=_export,isSupersetOf2=setIsSupersetOf,setMethodAcceptSetLike$2=setMethodAcceptSetLike$7;$$m({target:"Set",proto:!0,real:!0,forced:!setMethodAcceptSetLike$2()},{isSupersetOf:isSupersetOf2});var aSet$a=aSet$g,SetHelpers$2=setHelpers,clone$1=setClone,getSetRecord$1=getSetRecord$7,iterateSimple$1=iterateSimple$8,add$4=SetHelpers$2.add,has2=SetHelpers$2.has,remove$1=SetHelpers$2.remove,setSymmetricDifference=function(e){var t=aSet$a(this),r=getSetRecord$1(e).getIterator(),n=clone$1(t);return iterateSimple$1(r,(function(e){has2(t,e)?remove$1(n,e):add$4(n,e)})),n},$$l=_export,symmetricDifference2=setSymmetricDifference,setMethodAcceptSetLike$1=setMethodAcceptSetLike$7;$$l({target:"Set",proto:!0,real:!0,forced:!setMethodAcceptSetLike$1()},{symmetricDifference:symmetricDifference2});var aSet$9=aSet$g,add$3=setHelpers.add,clone=setClone,getSetRecord=getSetRecord$7,iterateSimple=iterateSimple$8,setUnion=function(e){var t=aSet$9(this),r=getSetRecord(e).getIterator(),n=clone(t);return iterateSimple(r,(function(e){add$3(n,e)})),n},$$k=_export,union2=setUnion,setMethodAcceptSetLike=setMethodAcceptSetLike$7;$$k({target:"Set",proto:!0,real:!0,forced:!setMethodAcceptSetLike()},{union:union2});var parent$d=set$4,set$3=parent$d,$$j=_export,from3=collectionFrom;$$j({target:"Set",stat:!0,forced:!0},{from:from3});var $$i=_export,of2=collectionOf;$$i({target:"Set",stat:!0,forced:!0},{of:of2});var $$h=_export,aSet$8=aSet$g,add$2=setHelpers.add;$$h({target:"Set",proto:!0,real:!0,forced:!0},{addAll:function(){for(var e=aSet$8(this),t=0,r=arguments.length;t<r;t++)add$2(e,arguments[t]);return e}});var $$g=_export,aSet$7=aSet$g,remove=setHelpers.remove;$$g({target:"Set",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=aSet$7(this),r=!0,n=0,o=arguments.length;n<o;n++)e=remove(t,arguments[n]),r=r&&e;return!!r}});var $$f=_export,bind$4=functionBindContext,aSet$6=aSet$g,iterate$6=setIterate;$$f({target:"Set",proto:!0,real:!0,forced:!0},{every:function(e){var t=aSet$6(this),r=bind$4(e,arguments.length>1?arguments[1]:void 0);return!1!==iterate$6(t,(function(e){if(!r(e,e,t))return!1}),!0)}});var classof$1=classof$e,hasOwn$2=hasOwnProperty_1,isNullOrUndefined=isNullOrUndefined$7,wellKnownSymbol=wellKnownSymbol$r,Iterators=iterators,ITERATOR=wellKnownSymbol("iterator"),$Object=Object,isIterable$1=function(e){if(isNullOrUndefined(e))return!1;var t=$Object(e);return void 0!==t[ITERATOR]||"@@iterator"in t||hasOwn$2(Iterators,classof$1(t))},getBuiltIn=getBuiltIn$j,isCallable=isCallable$r,isIterable=isIterable$1,isObject=isObject$m,Set$2=getBuiltIn("Set"),isSetLike=function(e){return isObject(e)&&"number"==typeof e.size&&isCallable(e.has)&&isCallable(e.keys)},toSetLike$7=function(e){return isSetLike(e)?e:isIterable(e)?new Set$2(e):e},$$e=_export,call$7=functionCall,toSetLike$6=toSetLike$7,$difference=setDifference;$$e({target:"Set",proto:!0,real:!0,forced:!0},{difference:function(e){return call$7($difference,this,toSetLike$6(e))}});var $$d=_export,bind$3=functionBindContext,aSet$5=aSet$g,SetHelpers$1=setHelpers,iterate$5=setIterate,Set$1=SetHelpers$1.Set,add$1=SetHelpers$1.add;$$d({target:"Set",proto:!0,real:!0,forced:!0},{filter:function(e){var t=aSet$5(this),r=bind$3(e,arguments.length>1?arguments[1]:void 0),n=new Set$1;return iterate$5(t,(function(e){r(e,e,t)&&add$1(n,e)})),n}});var $$c=_export,bind$2=functionBindContext,aSet$4=aSet$g,iterate$4=setIterate;$$c({target:"Set",proto:!0,real:!0,forced:!0},{find:function(e){var t=aSet$4(this),r=bind$2(e,arguments.length>1?arguments[1]:void 0),n=iterate$4(t,(function(e){if(r(e,e,t))return{value:e}}),!0);return n&&n.value}});var $$b=_export,call$6=functionCall,toSetLike$5=toSetLike$7,$intersection=setIntersection;$$b({target:"Set",proto:!0,real:!0,forced:!0},{intersection:function(e){return call$6($intersection,this,toSetLike$5(e))}});var $$a=_export,call$5=functionCall,toSetLike$4=toSetLike$7,$isDisjointFrom=setIsDisjointFrom;$$a({target:"Set",proto:!0,real:!0,forced:!0},{isDisjointFrom:function(e){return call$5($isDisjointFrom,this,toSetLike$4(e))}});var $$9=_export,call$4=functionCall,toSetLike$3=toSetLike$7,$isSubsetOf=setIsSubsetOf;$$9({target:"Set",proto:!0,real:!0,forced:!0},{isSubsetOf:function(e){return call$4($isSubsetOf,this,toSetLike$3(e))}});var $$8=_export,call$3=functionCall,toSetLike$2=toSetLike$7,$isSupersetOf=setIsSupersetOf;$$8({target:"Set",proto:!0,real:!0,forced:!0},{isSupersetOf:function(e){return call$3($isSupersetOf,this,toSetLike$2(e))}});var $$7=_export,uncurryThis$1=functionUncurryThis,aSet$3=aSet$g,iterate$3=setIterate,toString4=toString$g,arrayJoin=uncurryThis$1([].join),push=uncurryThis$1([].push);$$7({target:"Set",proto:!0,real:!0,forced:!0},{join:function(e){var t=aSet$3(this),r=void 0===e?",":toString4(e),n=[];return iterate$3(t,(function(e){push(n,e)})),arrayJoin(n,r)}});var $$6=_export,bind$1=functionBindContext,aSet$2=aSet$g,SetHelpers=setHelpers,iterate$2=setIterate,Set=SetHelpers.Set,add=SetHelpers.add;$$6({target:"Set",proto:!0,real:!0,forced:!0},{map:function(e){var t=aSet$2(this),r=bind$1(e,arguments.length>1?arguments[1]:void 0),n=new Set;return iterate$2(t,(function(e){add(n,r(e,e,t))})),n}});var $$5=_export,aCallable=aCallable$l,aSet$1=aSet$g,iterate$1=setIterate,$TypeError=TypeError;$$5({target:"Set",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=aSet$1(this),r=arguments.length<2,n=r?void 0:arguments[1];if(aCallable(e),iterate$1(t,(function(o){r?(r=!1,n=o):n=e(n,o,o,t)})),r)throw $TypeError("Reduce of empty set with no initial value");return n}});var $$4=_export,bind2=functionBindContext,aSet=aSet$g,iterate=setIterate;$$4({target:"Set",proto:!0,real:!0,forced:!0},{some:function(e){var t=aSet(this),r=bind2(e,arguments.length>1?arguments[1]:void 0);return!0===iterate(t,(function(e){if(r(e,e,t))return!0}),!0)}});var $$3=_export,call$2=functionCall,toSetLike$1=toSetLike$7,$symmetricDifference=setSymmetricDifference;$$3({target:"Set",proto:!0,real:!0,forced:!0},{symmetricDifference:function(e){return call$2($symmetricDifference,this,toSetLike$1(e))}});var $$2=_export,call$1=functionCall,toSetLike=toSetLike$7,$union=setUnion;$$2({target:"Set",proto:!0,real:!0,forced:!0},{union:function(e){return call$1($union,this,toSetLike(e))}});var parent$c=set$3,set$2=parent$c,set$1=set$2,set2=set$1,_Set=getDefaultExportFromCjs(set2),SeiService=function(){function e(t){var r=this;_classCallCheck$2(this,e),_defineProperty$1(this,"_seiSet",new _Set),this.emitter=t,t.on(EVENT.SEI,(function(e){e&&r._seiSet.add(e)}))}return _createClass$2(e,[{key:"throw",value:function(e,t){var r,n,o=this;if(null!=e&&this._seiSet.size){var i=e-.2,a=e+.2,s=[];_forEachInstanceProperty(r=this._seiSet).call(r,(function(e){e.time>=i&&e.time<=a&&s.push(e)})),_forEachInstanceProperty(s).call(s,(function(e){o._seiSet.delete(e),o.emitter.emit(EVENT.SEI_IN_TIME,e)})),t&&_forEachInstanceProperty(n=this._seiSet).call(n,(function(t){t.time<e-5&&o._seiSet.delete(t)}))}}},{key:"reset",value:function(){this._seiSet.clear()}}]),e}(),SKIP_SMALL_CHUNK=1e3,MAX_CHUNK_SAVE_SIZE=50,MAX_SEGMENT_SAVE_SIZE=3,LONGTIME_NO_RECEIVE=3e3,BandwidthService=function(){function e(t){_classCallCheck$2(this,e),_defineProperty$1(this,"_chunkSpeed",0),_defineProperty$1(this,"_chunkCache",[]),_defineProperty$1(this,"_speeds",[]),_defineProperty$1(this,"_totalSize",0),_defineProperty$1(this,"_totalCost",0),this._opts=t||{}}return _createClass$2(e,[{key:"addRecord",value:function(e,t){var r;e&&t&&(this._speeds.push(8e3*e/t),this._speeds=_sliceInstanceProperty(r=this._speeds).call(r,-MAX_SEGMENT_SAVE_SIZE))}},{key:"addChunkRecord",value:function(e,t){var r,n;if(e&&t&&!(e<((null===(r=this._opts)||void 0===r?void 0:r.skipChunkSize)||SKIP_SMALL_CHUNK))){this._totalSize+=e,this._totalCost+=t,this._chunkSpeed=8e3*e/t,this._chunkCache.push({size:e,duration:t,timestamp:performance.now()});var o,i=(null===(n=this._opts)||void 0===n?void 0:n.chunkCountForSpeed)||MAX_CHUNK_SAVE_SIZE;if(this._chunkCache.length>i)this._chunkCache=_sliceInstanceProperty(o=this._chunkCache).call(o,-i)}}},{key:"getAvgSpeed",value:function(){var e,t,r,n;if(!this._chunkCache.length&&!this._speeds.length)return 0;if(this._speeds.length)return _reduceInstanceProperty(n=this._speeds).call(n,(function(e,t){return e+t}))/this._speeds.length;var o=this._chunkCache[this._chunkCache.length-1],i=performance.now()-o.timestamp;return i>((null===(r=this._opts)||void 0===r?void 0:r.longtimeNoReceived)||LONGTIME_NO_RECEIVE)&&this._chunkCache.push({size:0,duration:i,timestamp:performance.now()}),8e3*_reduceInstanceProperty(e=this._chunkCache).call(e,(function(e,t){return e+t.size}),0)/_reduceInstanceProperty(t=this._chunkCache).call(t,(function(e,t){return e+t.duration}),0)}},{key:"getLatestSpeed",value:function(){return this._chunkCache.length||this._speeds.length?this._speeds.length?this._speeds[this._speeds.length-1]:this._chunkSpeed:0}},{key:"getTotalSize",value:function(){return this._totalSize}},{key:"getTotalCost",value:function(){return this._totalCost}},{key:"reset",value:function(){this._chunkCache=[],this._speeds=[],this._totalSize=0,this._totalCost=0}}]),e}(),Stats=function(){function e(t){_classCallCheck$2(this,e),_defineProperty$1(this,"encodeType",""),_defineProperty$1(this,"audioCodec",""),_defineProperty$1(this,"videoCodec",""),_defineProperty$1(this,"domain",""),_defineProperty$1(this,"fps",0),_defineProperty$1(this,"bitrate",0),_defineProperty$1(this,"width",0),_defineProperty$1(this,"height",0),_defineProperty$1(this,"samplerate",0),_defineProperty$1(this,"channelCount",0),_defineProperty$1(this,"gop",0),_defineProperty$1(this,"_bitsAccumulateSize",0),_defineProperty$1(this,"_bitsAccumulateDuration",0),_defineProperty$1(this,"_startGopId",-1),this._timescale=t}return _createClass$2(e,[{key:"getStats",value:function(){return{encodeType:this.encodeType,audioCodec:this.audioCodec,videoCodec:this.videoCodec,domain:this.domain,fps:this.fps,bitrate:this.bitrate,width:this.width,height:this.height,samplerate:this.samplerate,channelCount:this.channelCount,gop:this.gop}}},{key:"setEncodeType",value:function(e){this.encodeType=e}},{key:"setFpsFromScriptData",value:function(e){var t,r=e.data,n=null==r||null===(t=r.onMetaData)||void 0===t?void 0:t.framerate;n&&n>0&&n<100&&(this.fps=n)}},{key:"setVideoMeta",value:function(e){if(this.width=e.width,this.height=e.height,this.videoCodec=e.codec,this.encodeType=e.codecType,e.fpsNum&&e.fpsDen){var t=e.fpsNum/e.fpsDen;t>0&&t<100&&(this.fps=t)}}},{key:"setAudioMeta",value:function(e){this.audioCodec=e.codec,this.samplerate=e.sampleRate,this.channelCount=e.channelCount}},{key:"setDomain",value:function(e){var t;this.domain=_sliceInstanceProperty(t=e.split("/")).call(t,2,3)[0]}},{key:"updateBitrate",value:function(e){var t=this;if((!this.fps||this.fps>=100)&&e.length){var r=_reduceInstanceProperty(e).call(e,(function(e,t){return e+t.duration}),0)/e.length;this.fps=Math.round(this._timescale/r)}_forEachInstanceProperty(e).call(e,(function(e){var r;-1===t._startGopId&&(t._startGopId=e.gopId),e.gopId===t._startGopId&&t.gop++,t._bitsAccumulateDuration+=e.duration/(t._timescale/1e3),t._bitsAccumulateSize+=_reduceInstanceProperty(r=e.units).call(r,(function(e,t){return e+t.length}),0),t._bitsAccumulateDuration>=1e3&&(t.bitrate=8*t._bitsAccumulateSize,t._bitsAccumulateDuration=0,t._bitsAccumulateSize=0)}))}}]),e}(),MediaStatsService=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;_classCallCheck$2(this,e),_defineProperty$1(this,"_core",null),_defineProperty$1(this,"_samples",[]),this._core=t,this._timescale=r,this._stats=new Stats(r),this._bindEvents()}return _createClass$2(e,[{key:"getStats",value:function(){var e,t,r,n,o,i,a,s,c,l,u,p=(null===(e=this._core)||void 0===e?void 0:e.media)||{},$=p.currentTime,f=void 0===$?0:$,d=p.decodeFps,y=void 0===d?0:d;return _objectSpread2(_objectSpread2({},this._stats.getStats()),{},{downloadSpeed:(null===(t=this._core)||void 0===t||null===(r=t.speedInfo)||void 0===r?void 0:r.call(t).speed)||0,avgSpeed:(null===(n=this._core)||void 0===n||null===(o=n.speedInfo)||void 0===o?void 0:o.call(n).avgSpeed)||0,totalReceivedByte:(null===(i=this._core)||void 0===i||null===(a=i.speedInfo)||void 0===a?void 0:a.call(i).totalSize)||0,totalReceivedCost:(null===(s=this._core)||void 0===s||null===(c=s.speedInfo)||void 0===c?void 0:c.call(s).totalCost)||0,currentTime:f,bufferEnd:(null===(l=this._core)||void 0===l||null===(u=l.bufferInfo())||void 0===u?void 0:u.remaining)||0,decodeFps:y})}},{key:"_bindEvents",value:function(){var e=this;this._core.on(EVENT.DEMUXED_TRACK,(function(t){var r=t.videoTrack;return e._stats.updateBitrate(r.samples)})),this._core.on(EVENT.FLV_SCRIPT_DATA,(function(t){e._stats.setFpsFromScriptData(t)})),this._core.on(EVENT.METADATA_PARSED,(function(t){"video"===t.type?e._stats.setVideoMeta(t.track):e._stats.setAudioMeta(t.track)})),this._core.on(EVENT.TTFB,(function(t){e._stats.setDomain(t.responseUrl)}))}},{key:"reset",value:function(){this._samples=[],this._stats=new Stats(this._timescale)}}]),e}();function _iterableToArrayLimit(e,t){var r=null==e?null:void 0!==_Symbol&&_getIteratorMethod(e)||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],c=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}function _classCallCheck$1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),_Object$defineProperty(e,_toPropertyKey$1(n.key),n)}}function _createClass$1(e,t,r){return t&&_defineProperties$1(e.prototype,t),r&&_defineProperties$1(e,r),_Object$defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,t,r){return(t=_toPropertyKey$1(t))in e?_Object$defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _inherits$1(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=_Object$create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),_Object$defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf$1(e,t)}function _getPrototypeOf$1(e){var t;return(_getPrototypeOf$1=_Object$setPrototypeOf?_bindInstanceProperty(t=_Object$getPrototypeOf).call(t):function(e){return e.__proto__||_Object$getPrototypeOf(e)})(e)}function _setPrototypeOf$1(e,t){var r;return(_setPrototypeOf$1=_Object$setPrototypeOf?_bindInstanceProperty(r=_Object$setPrototypeOf).call(r):function(e,t){return e.__proto__=t,e})(e,t)}function _isNativeReflectConstruct$1(){if("undefined"==typeof Reflect||!_Reflect$construct)return!1;if(_Reflect$construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_Reflect$construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _assertThisInitialized$1(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn$1(e,t){if(t&&("object"===_typeof$3(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$1(e)}function _createSuper(e){var t=_isNativeReflectConstruct$1();return function(){var r,n=_getPrototypeOf$1(e);if(t){var o=_getPrototypeOf$1(this).constructor;r=_Reflect$construct(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn$1(this,r)}}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(_Array$isArray(e))return _arrayLikeToArray(e)}function _arrayWithHoles(e){if(_Array$isArray(e))return e}function _iterableToArray(e){if(void 0!==_Symbol&&null!=_getIteratorMethod(e)||null!=e["@@iterator"])return _Array$from(e)}function _unsupportedIterableToArray(e,t){var r;if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=_sliceInstanceProperty(r=Object.prototype.toString.call(e)).call(r,8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?_Array$from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toPrimitive$1(e,t){if("object"!==_typeof$3(e)||null===e)return e;var r=e[_Symbol$toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof$3(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey$1(e){var t=_toPrimitive$1(e,"string");return"symbol"===_typeof$3(t)?t:String(t)}var TrackType={VIDEO:"video",AUDIO:"audio",METADATA:"metadata"},VideoCodecType={AV1:"av1",AVC:"avc",HEVC:"hevc"},AudioCodecType={AAC:"aac",G711PCMA:"g7110a",G711PCMU:"g7110m",OPUS:"opus",MP3:"mp3"},WarningType={LARGE_AV_SHIFT:"LARGE_AV_SHIFT",LARGE_VIDEO_GAP:"LARGE_VIDEO_GAP",LARGE_VIDEO_GAP_BETWEEN_CHUNK:"LARGE_VIDEO_GAP_BETWEEN_CHUNK",LARGE_AUDIO_GAP:"LARGE_AUDIO_GAP",AUDIO_FILLED:"AUDIO_FILLED",AUDIO_DROPPED:"AUDIO_DROPPED"},VideoTrack=function(){function e(){_classCallCheck$1(this,e),_defineProperty(this,"id",1),_defineProperty(this,"type",TrackType.VIDEO),_defineProperty(this,"codecType",VideoCodecType.AVC),_defineProperty(this,"pid",-1),_defineProperty(this,"hvcC",void 0),_defineProperty(this,"codec",""),_defineProperty(this,"timescale",0),_defineProperty(this,"formatTimescale",0),_defineProperty(this,"sequenceNumber",0),_defineProperty(this,"baseMediaDecodeTime",0),_defineProperty(this,"baseDts",0),_defineProperty(this,"duration",0),_defineProperty(this,"warnings",[]),_defineProperty(this,"samples",[]),_defineProperty(this,"pps",[]),_defineProperty(this,"sps",[]),_defineProperty(this,"vps",[]),_defineProperty(this,"fpsNum",0),_defineProperty(this,"fpsDen",0),_defineProperty(this,"sarRatio",[]),_defineProperty(this,"width",0),_defineProperty(this,"height",0),_defineProperty(this,"nalUnitSize",4),_defineProperty(this,"present",!1),_defineProperty(this,"isVideoEncryption",!1),_defineProperty(this,"isAudioEncryption",!1),_defineProperty(this,"isVideo",!0),_defineProperty(this,"lastKeyFrameDts",0),_defineProperty(this,"kid",null),_defineProperty(this,"pssh",null),_defineProperty(this,"ext",void 0)}return _createClass$1(e,[{key:"reset",value:function(){this.sequenceNumber=this.width=this.height=this.fpsDen=this.fpsNum=this.duration=this.baseMediaDecodeTime=this.timescale=0,this.codec="",this.present=!1,this.pid=-1,this.pps=[],this.sps=[],this.vps=[],this.sarRatio=[],this.samples=[],this.warnings=[],this.hvcC=null}},{key:"firstDts",get:function(){return this.samples.length?this.samples[0].dts:null}},{key:"firstPts",get:function(){return this.samples.length?this.samples[0].pts:null}},{key:"samplesDuration",get:function(){if(this.samples.length>0){var e=this.samples[0],t=this.samples[this.samples.length-1];return t.dts-e.dts+t.duration}return 0}},{key:"exist",value:function(){return!!/av01/.test(this.codec)||!!(this.pps.length&&this.sps.length&&this.codec)}},{key:"hasSample",value:function(){return!!this.samples.length}},{key:"isEncryption",get:function(){return this.isVideoEncryption}}]),e}(),AudioTrack=function(){function e(){_classCallCheck$1(this,e),_defineProperty(this,"id",2),_defineProperty(this,"type",TrackType.AUDIO),_defineProperty(this,"codecType",AudioCodecType.AAC),_defineProperty(this,"pid",-1),_defineProperty(this,"codec",""),_defineProperty(this,"container",""),_defineProperty(this,"sequenceNumber",0),_defineProperty(this,"sampleDuration",0),_defineProperty(this,"timescale",0),_defineProperty(this,"formatTimescale",0),_defineProperty(this,"baseMediaDecodeTime",0),_defineProperty(this,"duration",0),_defineProperty(this,"warnings",[]),_defineProperty(this,"samples",[]),_defineProperty(this,"baseDts",0),_defineProperty(this,"sampleSize",16),_defineProperty(this,"sampleRate",0),_defineProperty(this,"channelCount",0),_defineProperty(this,"objectType",0),_defineProperty(this,"sampleRateIndex",0),_defineProperty(this,"config",[]),_defineProperty(this,"present",!1),_defineProperty(this,"isVideoEncryption",!1),_defineProperty(this,"isAudioEncryption",!1),_defineProperty(this,"kid",null),_defineProperty(this,"ext",void 0)}return _createClass$1(e,[{key:"reset",value:function(){this.sequenceNumber=0,this.timescale=0,this.sampleDuration=0,this.sampleRate=0,this.channelCount=0,this.baseMediaDecodeTime=0,this.present=!1,this.pid=-1,this.codec="",this.samples=[],this.config=[],this.warnings=[]}},{key:"exist",value:function(){return!(!this.sampleRate||!this.channelCount||!this.codec&&!this.container||this.codecType!==AudioCodecType.AAC&&this.codecType!==AudioCodecType.G711PCMA&&this.codecType!==AudioCodecType.G711PCMU&&this.codecType!==AudioCodecType.OPUS&&this.codecType!==AudioCodecType.MP3)}},{key:"hasSample",value:function(){return!!this.samples.length}},{key:"isEncryption",get:function(){return this.isAudioEncryption}},{key:"firstDts",get:function(){return this.samples.length?this.samples[0].dts:null}},{key:"firstPts",get:function(){return this.samples.length?this.samples[0].pts:null}},{key:"samplesDuration",get:function(){if(this.samples.length>0){var e=this.samples[0],t=this.samples[this.samples.length-1];return t.dts-e.dts+t.duration}return 0}}]),e}(),VideoSample=function(){function e(t,r,n){_classCallCheck$1(this,e),_defineProperty(this,"flag",{}),_defineProperty(this,"keyframe",!1),_defineProperty(this,"gopId",0),_defineProperty(this,"duration",0),_defineProperty(this,"size",0),_defineProperty(this,"units",[]),_defineProperty(this,"chromaFormat",420),this.originPts=this.pts=t,this.originDts=this.dts=r,n&&(this.units=n)}return _createClass$1(e,[{key:"cts",get:function(){return this.pts-this.dts}},{key:"setToKeyframe",value:function(){this.keyframe=!0,this.flag.dependsOn=2,this.flag.isNonSyncSample=0}}]),e}(),AudioSample=_createClass$1((function e(t,r,n,o){_classCallCheck$1(this,e),_defineProperty(this,"duration",1024),_defineProperty(this,"flag",{dependsOn:2,isNonSyncSample:0}),_defineProperty(this,"keyframe",!0),this.originPts=this.pts=this.dts=t,this.data=r,this.size=r.byteLength,this.sampleOffset=o,n&&(this.duration=n)})),Sample=_createClass$1((function e(t,r){_classCallCheck$1(this,e),_defineProperty(this,"time",0),this.data=t,this.originPts=this.pts=r})),FlvScriptSample=function(e){_inherits$1(r,Sample);var t=_createSuper(r);function r(){return _classCallCheck$1(this,r),t.apply(this,arguments)}return _createClass$1(r)}(),SeiSample=function(e){_inherits$1(r,Sample);var t=_createSuper(r);function r(){return _classCallCheck$1(this,r),t.apply(this,arguments)}return _createClass$1(r)}(),MetadataTrack=function(){function e(){_classCallCheck$1(this,e),_defineProperty(this,"id",3),_defineProperty(this,"type",TrackType.METADATA),_defineProperty(this,"timescale",0),_defineProperty(this,"flvScriptSamples",[]),_defineProperty(this,"seiSamples",[])}return _createClass$1(e,[{key:"exist",value:function(){return!(!this.flvScriptSamples.length&&!this.seiSamples.length||!this.timescale)}},{key:"reset",value:function(){this.timescale=0,this.flvScriptSamples=[],this.seiSamples=[]}},{key:"hasSample",value:function(){return!(!this.flvScriptSamples.length&&!this.seiSamples.length)}}]),e}(),global$1=global$s,globalIsFinite=global$1.isFinite,numberIsFinite$1=Number.isFinite||function(e){return"number"==typeof e&&globalIsFinite(e)},$$1=_export,numberIsFinite=numberIsFinite$1;$$1({target:"Number",stat:!0},{isFinite:numberIsFinite});var path$1=path$w,_isFinite$5=path$1.Number.isFinite,parent$b=_isFinite$5,_isFinite$4=parent$b,parent$a=_isFinite$4,_isFinite$3=parent$a,parent$9=_isFinite$3,_isFinite$2=parent$9,_isFinite$1=_isFinite$2,_isFinite=_isFinite$1,_Number$isFinite=getDefaultExportFromCjs(_isFinite),Logger$1=function(){function e(t){_classCallCheck$1(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]")}return _createClass$1(e,[{key:"warn",value:function(){var t,r;if(!e.disabled){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];(r=console).warn.apply(r,_concatInstanceProperty(t=[this._prefix]).call(t,o))}}}],[{key:"enable",value:function(){e.disabled=!1}},{key:"disable",value:function(){e.disabled=!0}}]),e}();_defineProperty(Logger$1,"disabled",!0);var isBrowser="undefined"!=typeof window,ua=isBrowser&&navigator.userAgent.toLocaleLowerCase(),isSafari=isBrowser&&/^((?!chrome|android).)*safari/.test(ua),isFirefox=isBrowser&&_includesInstanceProperty(ua).call(ua,"firefox"),isAndroid=isBrowser&&_includesInstanceProperty(ua).call(ua,"android"),AAC=function(){function e(){_classCallCheck$1(this,e)}return _createClass$1(e,null,[{key:"getRateIndexByRate",value:function(t){var r;return _indexOfInstanceProperty(r=e.FREQ).call(r,t)}},{key:"parseADTS",value:function(t,r){for(var n=t.length,o=0;o+2<n&&(255!==t[o]||240!=(246&t[o+1]));)o++;if(!(o>=n)){var i=o,a=[],s=(60&t[o+2])>>>2,c=e.FREQ[s];if(!c)throw new Error("Invalid sampling index: ".concat(s));for(var l,u,p=1+((192&t[o+2])>>>6),$=(1&t[o+2])<<2|(192&t[o+3])>>>6,f=e._getConfig(s,$,p),d=f.config,y=f.codec,h=0,_=e.getFrameDuration(c);o+7<n;)if(255===t[o]&&240==(246&t[o+1])){if(!(u=(3&t[o+3])<<11|t[o+4]<<3|(224&t[o+5])>>5)||n-o<u)break;l=2*(1&~t[o+1]),a.push({pts:r+h*_,data:t.subarray(o+7+l,o+u)}),h++,o+=u}else o++;return{skip:i,remaining:o>=n?void 0:t.subarray(o),frames:a,samplingFrequencyIndex:s,sampleRate:c,objectType:p,channelCount:$,codec:y,config:d,originCodec:"mp4a.40.".concat(p)}}}},{key:"parseAudioSpecificConfig",value:function(t){if(t.length){var r=t[0]>>>3,n=(7&t[0])<<1|t[1]>>>7,o=(120&t[1])>>>3,i=e.FREQ[n];if(i){var a=e._getConfig(n,o,r);return{samplingFrequencyIndex:n,sampleRate:i,objectType:r,channelCount:o,config:a.config,codec:a.codec,originCodec:"mp4a.40.".concat(r)}}}}},{key:"getFrameDuration",value:function(e){return 1024*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4)/e}},{key:"_getConfig",value:function(e,t,r){var n,o,i=[];return isFirefox?e>=6?(n=5,o=e-3):(n=2,o=e):isAndroid?(n=2,o=e):(n=5,o=e,e>=6?o=e-3:1===t&&(n=2,o=e)),i[0]=n<<3,i[0]|=(14&e)>>1,i[1]=(1&e)<<7,i[1]|=t<<3,5===n&&(i[1]|=(14&o)>>1,i[2]=(1&o)<<7,i[2]|=8,i[3]=0),{config:i,codec:"mp4a.40.".concat(n)}}},{key:"getSilentFrame",value:function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}}}]),e}();_defineProperty(AAC,"FREQ",[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350]);var $=_export,uncurryThis=functionUncurryThis,toAbsoluteIndex=toAbsoluteIndex$5,$RangeError=RangeError,fromCharCode=String.fromCharCode,$fromCodePoint=String.fromCodePoint,join2=uncurryThis([].join),INCORRECT_LENGTH=!!$fromCodePoint&&1!=$fromCodePoint.length;$({target:"String",stat:!0,arity:1,forced:INCORRECT_LENGTH},{fromCodePoint:function(e){for(var t,r=[],n=arguments.length,o=0;n>o;){if(t=+arguments[o++],toAbsoluteIndex(t,1114111)!==t)throw $RangeError(t+" is not a valid code point");r[o]=t<65536?fromCharCode(t):fromCharCode(55296+((t-=65536)>>10),t%1024+56320)}return join2(r,"")}});var path=path$w,fromCodePoint$5=path.String.fromCodePoint,parent$8=fromCodePoint$5,fromCodePoint$4=parent$8,parent$7=fromCodePoint$4,fromCodePoint$3=parent$7,parent$6=fromCodePoint$3,fromCodePoint$2=parent$6,fromCodePoint$1=fromCodePoint$2,fromCodePoint2=fromCodePoint$1,_String$fromCodePoint=getDefaultExportFromCjs(fromCodePoint2),OPUS=function(){function e(){_classCallCheck$1(this,e)}return _createClass$1(e,null,[{key:"getFrameDuration",value:function(e){return 20}},{key:"parseHeaderPackets",value:function(e){if(e.length){for(var t=new DataView(e.buffer,e.byteOffset,e.byteLength),r="",n=0;n<8;n++)r+=_String$fromCodePoint(e[n]);if("OpusHead"!==r)throw new Error("Invalid Opus MagicSignature");var o=e[9];console.log("Pre-skip",e[10],e[11]);var i=t.getUint32(12,!0),a=t.getInt16(16,!0);if(i){return{outputGain:a,sampleRate:i,channelCount:o,config:new Uint8Array(e.buffer,e.byteOffset+8,e.byteLength-8),codec:"opus",originCodec:"opus"}}}}}]),e}(),LARGE_AV_FIRST_FRAME_GAP=500,AUDIO_GAP_OVERLAP_THRESHOLD_COUNT=3,MAX_SILENT_FRAME_DURATION=1e3,AUDIO_EXCEPTION_LOG_EMIT_DURATION=5e3,MAX_VIDEO_FRAME_DURATION=1e3,MAX_DTS_DELTA_WITH_NEXT_CHUNK=200,VIDEO_EXCEPTION_LOG_EMIT_DURATION=5e3,TRACK_BROKEN_CHECK_TIME=5,FlvFixer=function(){function e(t,r,n){_classCallCheck$1(this,e),this.videoTrack=t,this.audioTrack=r,this.metadataTrack=n,this._baseDts=-1,this._baseDtsInited=!1,this._audioNextPts=void 0,this._videoNextDts=void 0,this._audioTimestampBreak=0,this._videoTimestampBreak=0,this._lastVideoDuration=0,this._keyFrameInNextChunk=!1,this._lastAudioExceptionGapDot=-1/0,this._lastAudioExceptionOverlapDot=-1/0,this._lastAudioExceptionLargeGapDot=-1/0,this._lastVideoExceptionLargeGapDot=-1/0,this._lastVideoExceptionChunkFirstDtsDot=-1/0}return _createClass$1(e,[{key:"fix",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];t=Math.round(1e3*t);var o=this.videoTrack,i=this.audioTrack;if(!r&&n||(this._videoLastSample=null,this._audioNextPts=void 0,this._videoNextDts=void 0,this._audioTimestampBreak=0,this._videoTimestampBreak=0,this._lastAudioExceptionGapDot=-1/0,this._lastAudioExceptionOverlapDot=-1/0,this._lastAudioExceptionLargeGapDot=-1/0,this._lastVideoExceptionLargeGapDot=-1/0,this._lastVideoExceptionChunkFirstDtsDot=-1/0),r&&!n&&(this._baseDtsInited=!1),this._baseDtsInited||this._calculateBaseDts(i,o),!n&&t&&(this._audioNextPts=this._videoNextDts=t),this._baseDtsInited&&(this._videoTimestampBreak||!this.videoTrack.exist())&&(this._audioTimestampBreak||!this.audioTrack.exist())&&this._resetBaseDtsWhenStreamBreaked(),this._fixAudio(i),this._keyFrameInNextChunk=!1,this._fixVideo(o),this.metadataTrack.exist()){var a,s,c=this.metadataTrack.timescale;_forEachInstanceProperty(a=this.metadataTrack.seiSamples).call(a,(function(t){t.pts=t.originPts-e._baseDts,t.time=Math.max(0,t.pts)/c})),_forEachInstanceProperty(s=this.metadataTrack.flvScriptSamples).call(s,(function(t){t.pts=t.originPts-e._baseDts,t.time=Math.max(0,t.pts)/c}))}o.samples.length&&(o.baseMediaDecodeTime=o.samples[0].dts),i.samples.length&&(i.baseMediaDecodeTime=i.samples[0].pts*i.timescale/1e3)}},{key:"_fixVideo",value:function(e){var t=this,r=e.samples;if(r.length){var n;if(_forEachInstanceProperty(r).call(r,(function(e){e.dts-=t._baseDts,e.pts-=t._baseDts,e.keyframe&&(t._keyFrameInNextChunk=!0)})),e.fpsNum&&e.fpsDen)n=e.timescale*(e.fpsDen/e.fpsNum);else if(e.length>1){var o=e.samples[0],i=e.samples[r.length-1];n=Math.floor((i.dts-o.dts)/(r.length-1))}else n=this._lastVideoDuration||40;var a=r.pop();if(this._videoLastSample&&r.unshift(this._videoLastSample),this._videoLastSample=a,r.length){if(void 0===this._videoNextDts){var s=r[0];this._videoNextDts=s.dts}var c=r.length,l=0,u=r[0],p=this._videoNextDts-u.dts;if(Math.abs(p)>MAX_DTS_DELTA_WITH_NEXT_CHUNK){var $;if(Math.abs(u.dts-this._lastVideoExceptionChunkFirstDtsDot)>VIDEO_EXCEPTION_LOG_EMIT_DURATION)this._lastVideoExceptionChunkFirstDtsDot=u.dts,e.warnings.push({type:WarningType.LARGE_VIDEO_GAP_BETWEEN_CHUNK,nextDts:this._videoNextDts,firstSampleDts:u.dts,nextSampleDts:null===($=r[1])||void 0===$?void 0:$.dts,sampleDuration:p});this._videoTimestampBreak>=TRACK_BROKEN_CHECK_TIME?(this._videoNextDts=u.dts,this._videoTimestampBreak=0):(u.dts+=p,u.pts+=p,this.audioTrack.exist()||(this._videoTimestampBreak=1))}for(var f=0;f<c;f++){var d=r[f].dts,y=r[f+1];((l=f<c-1?y.dts-d:a?a.dts-d:n)>MAX_VIDEO_FRAME_DURATION||l<0)&&(this._videoTimestampBreak++,Math.abs(d-this._lastVideoExceptionLargeGapDot)>VIDEO_EXCEPTION_LOG_EMIT_DURATION&&(this._lastVideoExceptionLargeGapDot=d,e.warnings.push({type:WarningType.LARGE_VIDEO_GAP,time:d/e.timescale,dts:d,originDts:r[f].originDts,nextDts:this._videoNextDts,sampleDuration:l,refSampleDuration:n})),l=n),r[f].duration=l,this._videoNextDts+=l,this._lastVideoDuration=l}}}}},{key:"_fixAudio",value:function(e){var t=this,r=e.samples;r.length&&(_forEachInstanceProperty(r).call(r,(function(e){e.dts=e.pts-=t._baseDts})),this._doFixAudioInternal(e,r,1e3))}},{key:"_calculateBaseDts",value:function(e,t){var r=e.samples,n=t.samples;if(!r.length&&!n.length)return!1;var o=1/0,i=1/0;r.length&&(e.baseDts=o=r[0].pts),n.length&&(t.baseDts=i=n[0].dts),this._baseDts=Math.min(o,i);var a=i-o;return _Number$isFinite(a)&&Math.abs(a)>LARGE_AV_FIRST_FRAME_GAP&&t.warnings.push({type:WarningType.LARGE_AV_SHIFT,videoBaseDts:i,audioBasePts:o,baseDts:this._baseDts,delta:a}),this._baseDtsInited=!0,!0}},{key:"_resetBaseDtsWhenStreamBreaked",value:function(){this._calculateBaseDts(this.audioTrack,this.videoTrack)&&(this.audioTrack.exist()?this.videoTrack.exist()?this._baseDts-=Math.min(this._audioNextPts,this._videoNextDts):this._baseDts-=this._audioNextPts:this._baseDts-=this._videoNextDts,this._videoTimestampBreak=0,this._audioTimestampBreak=0)}},{key:"_doFixAudioInternal",value:function(e,t,r){if(!e.sampleDuration)switch(e.codecType){case AudioCodecType.AAC:e.sampleDuration=AAC.getFrameDuration(e.timescale,r);break;case AudioCodecType.OPUS:e.sampleDuration=OPUS.getFrameDuration(e.samples,r);break;case AudioCodecType.G711PCMA:case AudioCodecType.G711PCMU:e.sampleDuration=this._getG711Duration(e);break;default:console.error("can't fix audio codecType:",e.codecType)}var n=e.sampleDuration,o=e.codecType===AudioCodecType.OPUS?20:e.codecType===AudioCodecType.AAC?1024:n*e.timescale/1e3;if(void 0===this._audioNextPts){var i=t[0];this._audioNextPts=i.pts}for(var a=0;a<t.length;a++){var s=this._audioNextPts,c=t[a],l=c.pts-s;if(0===a&&this._audioTimestampBreak>=TRACK_BROKEN_CHECK_TIME&&this._keyFrameInNextChunk&&(s=this._audioNextPts=c.dts,l=0,this._audioTimestampBreak=0),!this._audioTimestampBreak&&l>=AUDIO_GAP_OVERLAP_THRESHOLD_COUNT*n&&l<=MAX_SILENT_FRAME_DURATION&&!isSafari){var u=this._getSilentFrame(e)||t[0].data.subarray(),p=Math.floor(l/n);Math.abs(c.pts-this._lastAudioExceptionGapDot)>AUDIO_EXCEPTION_LOG_EMIT_DURATION&&(this._lastAudioExceptionGapDot=c.pts,e.warnings.push({type:WarningType.AUDIO_FILLED,pts:c.pts,originPts:c.originPts,count:p,nextPts:s,refSampleDuration:n}));for(var $=0;$<p;$++){var f=new AudioSample(Math.floor(this._audioNextPts+n)-Math.floor(this._audioNextPts),u,o);f.originPts=Math.floor(this._baseDts+s),_spliceInstanceProperty(t).call(t,a,0,f),this._audioNextPts+=n,a++}a--}else if(l<=-AUDIO_GAP_OVERLAP_THRESHOLD_COUNT*n&&l>=-1*MAX_SILENT_FRAME_DURATION)Math.abs(c.pts-this._lastAudioExceptionOverlapDot)>AUDIO_EXCEPTION_LOG_EMIT_DURATION&&(this._lastAudioExceptionOverlapDot=c.pts,e.warnings.push({type:WarningType.AUDIO_DROPPED,pts:c.pts,originPts:c.originPts,nextPts:s,refSampleDuration:n})),_spliceInstanceProperty(t).call(t,a,1),a--;else{if(Math.abs(l)>MAX_SILENT_FRAME_DURATION&&(this._audioTimestampBreak++,Math.abs(c.pts-this._lastAudioExceptionLargeGapDot)>AUDIO_EXCEPTION_LOG_EMIT_DURATION&&(this._lastAudioExceptionLargeGapDot=c.pts,e.warnings.push({type:WarningType.LARGE_AUDIO_GAP,time:c.pts/1e3,pts:c.pts,originPts:c.originPts,nextPts:s,sampleDuration:l,refSampleDuration:n}))),e.codecType===AudioCodecType.OPUS){var d=t[t.length-1];d&&(d.duration=c.pts-d.pts)}else c.dts=c.pts=s,c.duration=o;this._audioNextPts+=n}}}},{key:"_getG711Duration",value:function(e){var t=e.sampleSize,r=e.channelCount,n=e.sampleRate,o=e.samples[0];if(o)return 2*o.data.byteLength/r/(t/8)/n*1e3}},{key:"_getSilentFrame",value:function(e){return e.codecType===AudioCodecType.AAC?AAC.getSilentFrame(e.codec,e.channelCount):new Uint8Array(8*e.sampleDuration*e.channelCount)}}]),e}();function concatUint8Array(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];t=_filterInstanceProperty(t).call(t,Boolean);var n=new Uint8Array(_reduceInstanceProperty(t).call(t,(function(e,t){return e+t.byteLength}),0)),o=0;return _forEachInstanceProperty(t).call(t,(function(e){n.set(e,o),o+=e.byteLength})),n}function readBig32(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 getAvcCodec(e){for(var t,r="avc1.",n=0;n<3;n++)(t=e[n].toString(16)).length<2&&(t="0".concat(t)),r+=t;return r}function parse2(e){if(!_Array$isArray(e)){for(var t=[],r="",n=0;n<e.length;n++)n%2&&(r=e[n-1]+e[n],t.push(_parseInt$1(r,16)),r="");return t}return _mapInstanceProperty(e).call(e,(function(e){return _parseInt$1(e,16)}))}var NALu=function(){function e(){_classCallCheck$1(this,e)}return _createClass$1(e,null,[{key:"parseAnnexB",value:function(e){var t=e.byteLength-1,r=0;do{if(0!==e[t])break;r++,t--}while(t>0);r>=3&&(e=e.subarray(0,t+1));for(var n=e.length,o=2,i=0;null!==e[o]&&void 0!==e[o]&&1!==e[o];)o++;if((i=++o+2)>=n)return[];for(var a=[];i<n;)switch(e[i]){case 0:if(0!==e[i-1]){i+=2;break}if(0!==e[i-2]){i++;break}if(i<n-1&&1!==e[i+1]){i++;break}o!==i-2&&a.push(e.subarray(o,i-2));do{i++}while(1!==e[i]&&i<n);i=(o=i+1)+2;break;case 1:if(0!==e[i-1]||0!==e[i-2]){i+=3;break}o!==i-2&&a.push(e.subarray(o,i-2)),i=(o=i+1)+2;break;default:i+=3}return o<n&&a.push(e.subarray(o)),a}},{key:"parseAvcC",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;if(!(e.length<4)){for(var r,n=e.length,o=[],i=0;i+t<n;)if(r=readBig32(e,i),3===t&&(r>>>=8),i+=t,r){if(i+r>n)break;o.push(e.subarray(i,i+r)),i+=r}return o}}},{key:"parseSEI",value:function(e,t){for(var r=e.length,n=t?2:1,o=0,i=0,a="";255===e[n];)o+=255,n++;for(o+=e[n++];255===e[n];)i+=255,n++;if(i+=e[n++],5===o&&r>n+16)for(var s=0;s<16;s++)a+=e[n].toString(16),n++;return{payload:e.subarray(n,n+i),type:o,size:i,uuid:a}}},{key:"removeEPB",value:function(e){for(var t=e.byteLength,r=[],n=1;n<t-2;)0===e[n]&&0===e[n+1]&&3===e[n+2]?(r.push(n+2),n+=2):n++;if(!r.length)return e;var o=t-r.length,i=new Uint8Array(o),a=0;for(n=0;n<o;a++,n++)a===r[0]&&(a++,r.shift()),i[n]=e[a];return i}}]),e}(),ExpGolomb=function(){function e(t){if(_classCallCheck$1(this,e),_defineProperty(this,"_bytesAvailable",void 0),_defineProperty(this,"_bitsAvailable",0),_defineProperty(this,"_word",0),!t)throw new Error("ExpGolomb data params is required");this._data=t,this._bytesAvailable=t.byteLength,this._bytesAvailable&&this._loadWord()}return _createClass$1(e,[{key:"bitsAvailable",get:function(){return this._bitsAvailable}},{key:"_loadWord",value:function(){var e=this._data.byteLength-this._bytesAvailable,t=Math.min(4,this._bytesAvailable);if(0===t)throw new Error("No bytes available");var r=new Uint8Array(4);r.set(this._data.subarray(e,e+t)),this._word=new DataView(r.buffer).getUint32(0),this._bitsAvailable=8*t,this._bytesAvailable-=t}},{key:"skipBits",value:function(e){if(this._bitsAvailable>e)this._word<<=e,this._bitsAvailable-=e;else{e-=this._bitsAvailable;var t=Math.floor(e/8);e-=8*t,this._bytesAvailable-=t,this._loadWord(),this._word<<=e,this._bitsAvailable-=e}}},{key:"readBits",value:function(e){if(e>32)throw new Error("Cannot read more than 32 bits");var t=Math.min(this._bitsAvailable,e),r=this._word>>>32-t;return this._bitsAvailable-=t,this._bitsAvailable>0?this._word<<=t:this._bytesAvailable>0&&this._loadWord(),(t=e-t)>0&&this._bitsAvailable?r<<t|this.readBits(t):r}},{key:"skipLZ",value:function(){var e;for(e=0;e<this._bitsAvailable;++e)if(0!=(this._word&2147483648>>>e))return this._word<<=e,this._bitsAvailable-=e,e;return this._loadWord(),e+this.skipLZ()}},{key:"skipUEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"readUEG",value:function(){var e=this.skipLZ();return this.readBits(e+1)-1}},{key:"readEG",value:function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}},{key:"readBool",value:function(){return 1===this.readBits(1)}},{key:"readUByte",value:function(){return this.readBits(8)}},{key:"skipScalingList",value:function(e){for(var t=8,r=8,n=0;n<e;n++)0!==r&&(r=(t+this.readEG()+256)%256),t=0===r?t:r}}]),e}(),AVC=function(){function e(){_classCallCheck$1(this,e)}return _createClass$1(e,null,[{key:"parseAVCDecoderConfigurationRecord",value:function(t){if(!(t.length<7)){for(var r,n,o=1+(3&t[4]),i=[],a=[],s=6,c=31&t[5],l=0;l<c;l++)if(n=t[s]<<8|t[s+1],s+=2,n){var u=t.subarray(s,s+n);s+=n,i.push(u),r||(r=e.parseSPS(NALu.removeEPB(u)))}var p,$=t[s];s++;for(var f=0;f<$;f++)p=t[s]<<8|t[s+1],s+=2,p&&(a.push(t.subarray(s,s+p)),s+=p);return{sps:r,spsArr:i,ppsArr:a,nalUnitSize:o}}}},{key:"parseSPS",value:function(e){var t=new ExpGolomb(e);t.readUByte();var r=t.readUByte(),n=t.readUByte(),o=t.readUByte();t.skipUEG();var i=420;if(100===r||110===r||122===r||244===r||44===r||83===r||86===r||118===r||128===r||138===r||144===r){var a=t.readUEG();if(a<=3&&(i=[0,420,422,444][a]),3===a&&t.skipBits(1),t.skipUEG(),t.skipUEG(),t.skipBits(1),t.readBool())for(var s=3!==a?8:12,c=0;c<s;c++)t.readBool()&&(c<6?t.skipScalingList(16):t.skipScalingList(64))}t.skipUEG();var l=t.readUEG();if(0===l)t.readUEG();else if(1===l){t.skipBits(1),t.skipUEG(),t.skipUEG();for(var u=t.readUEG(),p=0;p<u;p++)t.skipUEG()}t.skipUEG(),t.skipBits(1);var $=t.readUEG(),f=t.readUEG(),d=t.readBits(1);0===d&&t.skipBits(1),t.skipBits(1);var y,h,_,g,m,v=0,b=0,S=0,E=0;if(t.readBool()&&(v=t.readUEG(),b=t.readUEG(),S=t.readUEG(),E=t.readUEG()),t.readBool()){if(t.readBool())switch(t.readUByte()){case 1:y=[1,1];break;case 2:y=[12,11];break;case 3:y=[10,11];break;case 4:y=[16,11];break;case 5:y=[40,33];break;case 6:y=[24,11];break;case 7:y=[20,11];break;case 8:y=[32,11];break;case 9:y=[80,33];break;case 10:y=[18,11];break;case 11:y=[15,11];break;case 12:y=[64,33];break;case 13:y=[160,99];break;case 14:y=[4,3];break;case 15:y=[3,2];break;case 16:y=[2,1];break;case 255:y=[t.readUByte()<<8|t.readUByte(),t.readUByte()<<8|t.readUByte()]}if(t.readBool()&&t.readBool(),t.readBool()&&(t.readBits(4),t.readBool()&&t.readBits(24)),t.readBool()&&(t.readUEG(),t.readUEG()),t.readBool()){var P=t.readBits(32),O=t.readBits(32);h=t.readBool(),m=(_=O)/(g=2*P)}}return{codec:getAvcCodec(e.subarray(1,4)),profileIdc:r,profileCompatibility:n,levelIdc:o,chromaFormat:i,width:Math.ceil(16*($+1)-2*(v+b)),height:(2-d)*(f+1)*16-(d?2:4)*(S+E),sarRatio:y,fpsNum:_,fpsDen:g,fps:m,fixedFrame:h}}}]),e}(),HEVC=function(){function e(){_classCallCheck$1(this,e)}return _createClass$1(e,null,[{key:"parseHEVCDecoderConfigurationRecord",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(t.length<23)){r=r||{};for(var n,o,i,a,s,c=1+(3&t[21]),l=[],u=[],p=[],$=23,f=t[22],d=0;d<f;d++){i=63&t[$],a=t[$+1]<<8|t[$+2],$+=3;for(var y=0;y<a;y++)if(s=t[$]<<8|t[$+1],$+=2,s){switch(i){case 32:var h=t.subarray($,$+s);n||(n=e.parseVPS(NALu.removeEPB(h),r)),p.push(h);break;case 33:var _=t.subarray($,$+s);o||(o=e.parseSPS(NALu.removeEPB(_),r)),l.push(_);break;case 34:u.push(t.subarray($,$+s))}$+=s}}return{hvcC:r,sps:o,spsArr:l,ppsArr:u,vpsArr:p,nalUnitSize:c}}}},{key:"parseVPS",value:function(t,r){r=r||{};var n=new ExpGolomb(t);n.readUByte(),n.readUByte(),n.readBits(12);var o=n.readBits(3);return r.numTemporalLayers=Math.max(r.numTemporalLayers||0,o+1),n.readBits(17),e._parseProfileTierLevel(n,o,r),r}},{key:"parseSPS",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r=r||{};var n=new ExpGolomb(t);n.readUByte(),n.readUByte(),n.readBits(4);var o=n.readBits(3);r.numTemporalLayers=Math.max(o+1,r.numTemporalLayers||0),r.temporalIdNested=n.readBits(1),e._parseProfileTierLevel(n,o,r),n.readUEG();var i=r.chromaFormatIdc=n.readUEG(),a=420;i<=3&&(a=[0,420,422,444][i]);var s=0;3===i&&(s=n.readBits(1));var c,l,u,p,$=n.readUEG(),f=n.readUEG(),d=n.readBits(1);(1===d&&(c=n.readUEG(),l=n.readUEG(),u=n.readUEG(),p=n.readUEG()),r.bitDepthLumaMinus8=n.readUEG(),r.bitDepthChromaMinus8=n.readUEG(),1===d)&&($-=(1!==i&&2!==i||0!==s?1:2)*(l+c),f-=(1===i&&0===s?2:1)*(p+u));return{codec:"hev1.1.6.L93.B0",width:$,height:f,chromaFormat:a,hvcC:r}}},{key:"_parseProfileTierLevel",value:function(e,t,r){var n=r.generalTierFlag||0;r.generalProfileSpace=e.readBits(2),r.generalTierFlag=Math.max(e.readBits(1),n),r.generalProfileIdc=Math.max(e.readBits(5),r.generalProfileIdc||0),r.generalProfileCompatibilityFlags=e.readBits(32),r.generalConstraintIndicatorFlags=[e.readBits(8),e.readBits(8),e.readBits(8),e.readBits(8),e.readBits(8),e.readBits(8)];var o=e.readBits(8);n<r.generalTierFlag?r.generalLevelIdc=o:r.generalLevelIdc=Math.max(o,r.generalLevelIdc||0);var i=[],a=[];if(t>e.bitsAvailable)throw new Error("maxSubLayersMinus inavlid size ".concat(t));for(var s=0;s<t;s++)i[s]=e.readBits(1),a[s]=e.readBits(1);t>0&&e.readBits(2*(8-t));for(var c=0;c<t;c++)0!==i[c]&&(e.readBits(2),e.readBits(1),e.readBits(5),e.readBits(16),e.readBits(16),e.readBits(4),e.readBits(16),e.readBits(16),e.readBits(12)),0!==a[c]&&e.readBits(8)}}]),e}(),UTF8=function(){function e(){_classCallCheck$1(this,e)}return _createClass$1(e,null,[{key:"decode",value:function(t){for(var r=[],n=t,o=0,i=t.length;o<i;)if(n[o]<128)r.push(String.fromCharCode(n[o])),++o;else{if(n[o]<192);else if(n[o]<224){if(e._checkContinuation(n,o,1)){var a=(31&n[o])<<6|63&n[o+1];if(a>=128){r.push(String.fromCharCode(65535&a)),o+=2;continue}}}else if(n[o]<240){if(e._checkContinuation(n,o,2)){var s=(15&n[o])<<12|(63&n[o+1])<<6|63&n[o+2];if(s>=2048&&55296!=(63488&s)){r.push(String.fromCharCode(65535&s)),o+=3;continue}}}else if(n[o]<248&&e._checkContinuation(n,o,3)){var c=(7&n[o])<<18|(63&n[o+1])<<12|(63&n[o+2])<<6|63&n[o+3];if(c>65536&&c<1114112){c-=65536,r.push(String.fromCharCode(c>>>10|55296)),r.push(String.fromCharCode(1023&c|56320)),o+=4;continue}}r.push(String.fromCharCode(65533)),++o}return r.join("")}},{key:"_checkContinuation",value:function(e,t,r){var n=e;if(t+r<n.length){for(;r--;)if(128!=(192&n[++t]))return!1;return!0}return!1}}]),e}(),AMF=function(){function e(){_classCallCheck$1(this,e)}return _createClass$1(e,null,[{key:"parse",value:function(t){if(!(t.length<3)){var r={},n=e._parseValue(new DataView(t.buffer,t.byteOffset,t.byteLength)),o=e._parseValue(new DataView(t.buffer,t.byteOffset+n.size,t.byteLength-n.size));return r[n.data]=o.data,r}}},{key:"_parseValue",value:function(t){var r,n=t.byteLength,o=1,i=!1;switch(t.getUint8(0)){case 0:r=t.getFloat64(1),o+=8;break;case 1:r=!!t.getUint8(1),o+=1;break;case 2:var a=e._parseString(new DataView(t.buffer,t.byteOffset+o,t.byteLength-o));r=a.data,o+=a.size;break;case 3:r={};var s=0;for(9==(16777215&t.getUint32(n-4))&&(s=3);o<n-4;){var c=e._parseObject(new DataView(t.buffer,t.byteOffset+o,t.byteLength-o-s)),l=c.size,u=c.data;if(c.isEnd)break;r[u.name]=u.value,o+=l}if(o<=n-3)9===(16777215&t.getUint32(o-1))&&(o+=3);break;case 8:r={},o+=4;var p=0;for(9==(16777215&t.getUint32(n-4))&&(p=3);o<n-8;){var $=e._parseObject(new DataView(t.buffer,t.byteOffset+o,t.byteLength-o-p)),f=$.size,d=$.data;if($.isEnd)break;r[d.name]=d.value,o+=f}if(o<=n-3)9===(16777215&t.getUint32(o-1))&&(o+=3);break;case 9:r=void 0,o=1,i=!0;break;case 10:r=[];var y=t.getUint32(1);o+=4;for(var h=0;h<y;h++){var _=e._parseValue(new DataView(t.buffer,t.byteOffset+o,t.byteLength-o)),g=_.data,m=_.size;r.push(g),o+=m}break;case 11:var v=t.getFloat64(o)+6e4*t.getInt16(o+8);r=new Date(v),o+=10;break;case 12:var b=t.getUint32(1);o+=4,r="",b>0&&(r=UTF8.decode(new Uint8Array(t.buffer,t.byteOffset+o,b))),o+=b;break;default:o=n}return{data:r,size:o,isEnd:i}}},{key:"_parseString",value:function(e){var t=e.getUint16(0),r="";return t>0&&(r=UTF8.decode(new Uint8Array(e.buffer,e.byteOffset+2,t))),{data:r,size:2+t}}},{key:"_parseObject",value:function(t){if(!(t.byteLength<3)){var r=e._parseString(t),n=e._parseValue(new DataView(t.buffer,t.byteOffset+r.size,t.byteLength-r.size));return{data:{name:r.data,value:n.data},size:r.size+n.size,isEnd:n.isEnd}}}}]),e}(),FlvSoundFormat={MP3:2,G711A:7,G711M:8,AAC:10,OPUS:13},logger$2=new Logger$1("FlvDemuxer"),FlvDemuxer=function(){function e(t,r,n){_classCallCheck$1(this,e),_defineProperty(this,"_headerParsed",!1),_defineProperty(this,"_remainingData",null),_defineProperty(this,"_gopId",0),_defineProperty(this,"_needAddMetaBeforeKeyFrameNal",!0),this.videoTrack=t||new VideoTrack,this.audioTrack=r||new AudioTrack,this.metadataTrack=n||new MetadataTrack,this._fixer=new FlvFixer(this.videoTrack,this.audioTrack,this.metadataTrack)}return _createClass$1(e,[{key:"demux",value:function(t){var r,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3?arguments[3]:void 0,a=this.audioTrack,s=this.videoTrack,c=this.metadataTrack;if(!n&&o||(this._remainingData=null),n&&(this._headerParsed=!1),n?(s.reset(),a.reset(),c.reset()):(s.samples=[],a.samples=[],c.seiSamples=[],c.flvScriptSamples=[],s.warnings=[],a.warnings=[],this._remainingData&&(t=concatUint8Array(this._remainingData,t),this._remainingData=null)),!t.length)return{videoTrack:s,audioTrack:a,metadataTrack:c};var l=0;if(!this._headerParsed){if(!e.probe(t))throw new Error("Invalid flv file");a.present=(4&t[4])>>>2!=0,s.present=0!=(1&t[4]),this._headerParsed=!0,l=readBig32(t,5)+4}for(var u,p,$,f,d,y=t.length;l+15<y&&(u=t[l],!(l+15+(p=t[l+1]<<16|t[l+2]<<8|t[l+3])>y));){var h;$=(t[l+7]<<24>>>0)+(t[l+4]<<16)+(t[l+5]<<8)+t[l+6],l+=11,f=t.subarray(l,l+p),8===u?this._parseAudio(f,$):9===u?(i&&(this.seamlessLoadingSwitching=!0),this._parseVideo(f,$)):18===u?this._parseScript(f,$):logger$2.warn("Invalid tag type: ".concat(u)),(d=readBig32(t,l+=p))!==11+p&&logger$2.warn(_concatInstanceProperty(h="Invalid PrevTagSize ".concat(d," (")).call(h,11+p,")")),l+=4}l<y&&(this._remainingData=t.subarray(l)),a.formatTimescale=s.formatTimescale=s.timescale=c.timescale=1e3,a.timescale=a.codecType===AudioCodecType.OPUS?1e3:a.sampleRate||0,!a.exist()&&a.hasSample()&&a.reset(),!s.exist()&&s.hasSample()&&s.reset();var _=c.flvScriptSamples[c.flvScriptSamples.length-1],g=null==_||null===(r=_.data)||void 0===r?void 0:r.onMetaData;return g&&(null!=s&&s.exist()&&(g.hasOwnProperty("duration")&&(s.duration=1e3*g.duration),!s.width&&g.hasOwnProperty("width")&&(s.width=g.width),!s.height&&g.hasOwnProperty("height")&&(s.height=g.height)),null!=a&&a.exist()&&g.hasOwnProperty("duration")&&(a.duration=1e3*g.duration)),{videoTrack:s,audioTrack:a,metadataTrack:c}}},{key:"fix",value:function(e,t,r){return this._fixer.fix(e,t,r),{videoTrack:this.videoTrack,audioTrack:this.audioTrack,metadataTrack:this.metadataTrack}}},{key:"demuxAndFix",value:function(e,t,r,n,o){return this.demux(e,t,r,o),this.fix(n,t,r)}},{key:"_parseAudio",value:function(t,r){if(t.length){var n=(240&t[0])>>>4,o=this.audioTrack;if(n!==FlvSoundFormat.AAC&&n!==FlvSoundFormat.G711A&&n!==FlvSoundFormat.G711M&&n!==FlvSoundFormat.OPUS)return logger$2.warn("Unsupported sound format: ".concat(n)),void o.reset();if(n!==FlvSoundFormat.AAC&&n!==FlvSoundFormat.OPUS){var i=(12&t[0])>>2,a=(2&t[0])>>1,s=1&t[0];o.sampleRate=e.AUDIO_RATE[i],o.sampleSize=a?16:8,o.channelCount=s+1}switch(n){case FlvSoundFormat.G711A:case FlvSoundFormat.G711M:this._parseG711(t,r,n);break;case FlvSoundFormat.AAC:this._parseAac(t,r);break;case FlvSoundFormat.OPUS:this._parseOpus(t,r)}}}},{key:"_parseOpus",value:function(e,t){var r=this.audioTrack,n=e[1];switch(r.codecType=AudioCodecType.OPUS,n){case 0:var o=OPUS.parseHeaderPackets(e.subarray(2));o?(r.codec=o.codec,r.channelCount=o.channelCount,r.sampleRate=o.sampleRate,r.config=o.config,r.sampleDuration=OPUS.getFrameDuration([],r.timescale)):(r.reset(),logger$2.warn("Cannot parse AudioSpecificConfig",e));break;case 1:if(null==t)return;var i=new AudioSample(t,e.subarray(2),r.sampleDuration);r.samples.push(i);break;default:logger$2.warn("Unknown OpusPacketType: ".concat(n))}}},{key:"_parseG711",value:function(e,t,r){var n=this.audioTrack,o=e.subarray(1);if(!(o.byteLength<1)){var i=new AudioSample(t,o);n.codecType=7===r?AudioCodecType.G711PCMA:AudioCodecType.G711PCMU,n.sampleRate=8e3,n.codec=n.codecType,n.samples.push(i)}}},{key:"_parseAac",value:function(e,t){var r=this.audioTrack;if(r.codecType=AudioCodecType.AAC,0===e[1]){var n=AAC.parseAudioSpecificConfig(e.subarray(2));n?(r.codec=n.codec,r.channelCount=n.channelCount,r.sampleRate=n.sampleRate,r.config=n.config,r.objectType=n.objectType,r.sampleRateIndex=n.samplingFrequencyIndex):(r.reset(),logger$2.warn("Cannot parse AudioSpecificConfig",e))}else if(1===e[1]){if(null==t)return;r.samples.push(new AudioSample(t,e.subarray(2)))}else logger$2.warn("Unknown AACPacketType: ".concat(e[1]))}},{key:"_parseVideo",value:function(e,t){var r=this;if(!(e.length<6)){var n=(240&e[0])>>>4,o=15&e[0],i=this.videoTrack;if(7!==o&&12!==o)return i.reset(),void logger$2.warn("Unsupported codecId: ".concat(o));var a=12===o;i.codecType=a?VideoCodecType.HEVC:VideoCodecType.AVC;var s=e[1],c=(e[2]<<16|e[3]<<8|e[4])<<8>>8;if(0===s){var l=e.subarray(5),u=a?HEVC.parseHEVCDecoderConfigurationRecord(l):AVC.parseAVCDecoderConfigurationRecord(l);if(u){var p=u.hvcC,$=u.sps,f=u.ppsArr,d=u.spsArr,y=u.vpsArr,h=u.nalUnitSize;p&&(i.hvcC=i.hvcC||p),$&&(i.codec=$.codec,i.width=$.width,i.height=$.height,i.sarRatio=$.sarRatio,i.fpsNum=$.fpsNum,i.fpsDen=$.fpsDen),d.length&&(i.sps=d),f.length&&(i.pps=f),y&&y.length&&(i.vps=y),h&&(i.nalUnitSize=h)}else logger$2.warn("Cannot parse ".concat(a?"HEVC":"AVC","DecoderConfigurationRecord"),e)}else if(1===s){var _=NALu.parseAvcC(e.subarray(5),i.nalUnitSize);if((_=this._checkAddMetaNalToUnits(a,_,i))&&_.length){var g=new VideoSample(t+c,t,_);if(this.seamlessLoadingSwitching&&t<i.lastKeyFrameDts)return;this.seamlessLoadingSwitching=!1,1===n&&(g.setToKeyframe(),i.lastKeyFrameDts=t),i.samples.push(g),_forEachInstanceProperty(_).call(_,(function(e){var n=a?e[0]>>>1&63:31&e[0];switch(n){case 5:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:if(!a&&5!==n||a&&5===n)break;g.setToKeyframe();break;case 6:case 39:case 40:if(!a&&6!==n||a&&6===n)break;r.metadataTrack.seiSamples.push(new SeiSample(NALu.parseSEI(NALu.removeEPB(e),a),t+c))}})),g.keyframe&&this._gopId++,g.gopId=this._gopId}else logger$2.warn("Cannot parse NALUs",e)}else 2===s||logger$2.warn("Unknown AVCPacketType: ".concat(s))}}},{key:"_checkAddMetaNalToUnits",value:function(e,t,r){if(!e||!this._needAddMetaBeforeKeyFrameNal)return this._needAddMetaBeforeKeyFrameNal=!1,t;var n=_mapInstanceProperty(t).call(t,(function(e){return e[0]>>>1&63}));return _includesInstanceProperty(n).call(n,32)?(this._needAddMetaBeforeKeyFrameNal=!1,t):(t.unshift(r.pps[0]),t.unshift(r.sps[0]),t.unshift(r.vps[0]),_filterInstanceProperty(t).call(t,Boolean))}},{key:"_parseScript",value:function(e,t){this.metadataTrack.flvScriptSamples.push(new FlvScriptSample(AMF.parse(e),t))}}],[{key:"probe",value:function(e){return 70===e[0]&&76===e[1]&&86===e[2]&&1===e[3]&&readBig32(e,5)>=9}}]),e}();_defineProperty(FlvDemuxer,"AUDIO_RATE",[5500,11e3,22e3,44e3]);var anObject=anObject$i,regexpFlags=function(){var e=anObject(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},call=functionCall,hasOwn$1=hasOwnProperty_1,isPrototypeOf$2=objectIsPrototypeOf,regExpFlags=regexpFlags,RegExpPrototype$1=RegExp.prototype,regexpGetFlags=function(e){var t=e.flags;return void 0!==t||"flags"in RegExpPrototype$1||hasOwn$1(e,"flags")||!isPrototypeOf$2(RegExpPrototype$1,e)?t:call(regExpFlags,e)},getRegExpFlags=regexpGetFlags,flags$6=getRegExpFlags,isPrototypeOf$1=objectIsPrototypeOf,flags$5=flags$6,RegExpPrototype=RegExp.prototype,flags_1=function(e){return e===RegExpPrototype||isPrototypeOf$1(RegExpPrototype,e)?flags$5(e):e.flags},parent$5=flags_1,flags$4=parent$5,parent$4=flags$4,flags$3=parent$4,parent$3=flags$3,flags$2=parent$3,flags$1=flags$2,flags=flags$1,_flagsInstanceProperty=getDefaultExportFromCjs(flags),entryVirtual=entryVirtual$k,entries$6=entryVirtual("Array").entries,parent$2=entries$6,entries$5=parent$2,classof=classof$e,hasOwn2=hasOwnProperty_1,isPrototypeOf=objectIsPrototypeOf,method=entries$5,ArrayPrototype=Array.prototype,DOMIterables={DOMTokenList:!0,NodeList:!0},entries$4=function(e){var t=e.entries;return e===ArrayPrototype||isPrototypeOf(ArrayPrototype,e)&&t===ArrayPrototype.entries||hasOwn2(DOMIterables,classof(e))?method:t},parent$1=entries$4,entries$3=parent$1,parent=entries$3,entries$2=parent,entries$1=entries$2,entries2=entries$1,_entriesInstanceProperty=getDefaultExportFromCjs(entries2);function Concat(e){for(var t=0,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];_forEachInstanceProperty(n).call(n,(function(e){t+=e.length}));var i=new e(t),a=0;return _forEachInstanceProperty(n).call(n,(function(e){i.set(e,a),a+=e.length})),i}var _context21,Buffer=function(){function e(){_classCallCheck$1(this,e),this.buffer=new Uint8Array(0)}return _createClass$1(e,[{key:"write",value:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];_forEachInstanceProperty(r).call(r,(function(t){t?e.buffer=Concat(Uint8Array,e.buffer,t):window.console.warn(t)}))}}],[{key:"writeUint16",value:function(e){return new Uint8Array([e>>8&255,255&e])}},{key:"writeUint32",value:function(e){return new Uint8Array([e>>24,e>>16&255,e>>8&255,255&e])}}]),e}(),UINT32_MAX=Math.pow(2,32)-1,MP4=function(){function e(){_classCallCheck$1(this,e)}return _createClass$1(e,null,[{key:"box",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];r=_filterInstanceProperty(r).call(r,Boolean);var o=8+_reduceInstanceProperty(r).call(r,(function(e,t){return e+t.byteLength}),0),i=new Uint8Array(o);i[0]=o>>24&255,i[1]=o>>16&255,i[2]=o>>8&255,i[3]=255&o,i.set(e,4);var a=8;return _forEachInstanceProperty(r).call(r,(function(e){i.set(e,a),a+=e.byteLength})),i}},{key:"ftyp",value:function(t){return _findInstanceProperty(t).call(t,(function(e){return e.type===TrackType.VIDEO&&e.codecType===VideoCodecType.HEVC}))?e.FTYPHEV1:e.FTYPAVC1}},{key:"initSegment",value:function(t){return concatUint8Array(e.ftyp(t),e.moov(t))}},{key:"pssh",value:function(t){var r,n=new Uint8Array(_concatInstanceProperty(r=[1,0,0,0]).call(r,[16,119,239,236,192,178,77,2,172,227,60,30,82,226,251,75],[0,0,0,1],parse2(t.kid),[0,0,0,0]));return e.box(e.types.pssh,n)}},{key:"moov",value:function(t){if(t[0].useEME&&(t[0].encv||t[0].enca)){var r;t[0].pssh||(t[0].pssh={kid:t[0].kid});var n=this.pssh(t[0].pssh);return e.box.apply(e,_concatInstanceProperty(r=[e.types.moov,e.mvhd(t[0].mvhdDurtion||t[0].duration,t[0].mvhdTimecale||t[0].timescale),e.mvex(t)]).call(r,_toConsumableArray(_mapInstanceProperty(t).call(t,(function(t){return e.trak(t)}))),[n]))}var o;return e.box.apply(e,_concatInstanceProperty(o=[e.types.moov,e.mvhd(t[0].mvhdDurtion||t[0].duration,t[0].mvhdTimecale||t[0].timescale)]).call(o,_toConsumableArray(_mapInstanceProperty(t).call(t,(function(t){return e.trak(t)}))),[e.mvex(t)]))}},{key:"mvhd",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4;return e.box(e.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r,t>>24&255,t>>16&255,t>>8&255,255&t,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))}},{key:"trak",value:function(t){return e.box(e.types.trak,e.tkhd(t.id,t.tkhdDuration||0,t.width,t.height),e.mdia(t))}},{key:"tkhd",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,t>>24&255,t>>16&255,t>>8&255,255&t,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,n>>8&255,255&n,0,0,o>>8&255,255&o,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t.duration,t.timescale),e.hdlr(t.type),e.minf(t))}},{key:"mdhd",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4;return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r,t>>24&255,t>>16&255,t>>8&255,255&t,85,196,0,0]))}},{key:"hdlr",value:function(t){return e.box(e.types.hdlr,e.HDLR_TYPES[t])}},{key:"minf",value:function(t){return e.box(e.types.minf,t.type===TrackType.VIDEO?e.VMHD:e.SMHD,e.DINF,e.stbl(t))}},{key:"stbl",value:function(t){var r=[];return t&&t.ext&&t.ext.stss&&r.push(e.stss(_entriesInstanceProperty(t.ext.stss))),e.box(e.types.stbl,e.stsd(t),e.STTS,r[0],e.STSC,e.STSZ,e.STCO)}},{key:"stsd",value:function(t){var r;return r="audio"===t.type?t.useEME&&t.enca?e.enca(t):t.codecType===AudioCodecType.OPUS?e.opus(t):e.mp4a(t):t.useEME&&t.encv?e.encv(t):t.av1C?e.av01(t):e.avc1hev1(t),e.box(e.types.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),r)}},{key:"enca",value:function(t){var r=t.enca.channelCount,n=t.enca.sampleRate,o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,r,0,16,0,0,0,0,n>>8&255,255&n,0,0]),i=e.esds(t.config),a=e.sinf(t.enca);return e.box(e.types.enca,o,i,a)}},{key:"encv",value:function(t){var r,n,o,i=t.sps.length>0?t.sps[0]:[],a=t.pps.length>0?t.pps[0]:[],s=t.width,c=t.height,l=t.sarRatio[0],u=t.sarRatio[1],p=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,s>>8&255,255&s,c>>8&255,255&c,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),$=new Uint8Array(_concatInstanceProperty(n=_concatInstanceProperty(r=_concatInstanceProperty(o=[1,i[1],i[2],i[3],255,225,i.length>>>8&255,255&i.length]).apply(o,_toConsumableArray(i))).call(r,[1,a.length>>>8&255,255&a.length])).apply(n,_toConsumableArray(a))),f=new Uint8Array([0,0,88,57,0,15,200,192,0,4,86,72]),d=e.sinf(t.encv),y=new Uint8Array([l>>24,l>>16&255,l>>8&255,255&l,u>>24,u>>16&255,u>>8&255,255&u]);return e.box(e.types.encv,p,e.box(e.types.avcC,$),e.box(e.types.btrt,f),d,e.box(e.types.pasp,y))}},{key:"schi",value:function(t){var r=new Uint8Array([]),n=e.tenc(t);return e.box(e.types.schi,r,n)}},{key:"tenc",value:function(t){var r,n=new Uint8Array(_concatInstanceProperty(r=[0,0,0,0,0,0,255&t.default_IsEncrypted,255&t.default_IV_size]).call(r,parse2(t.default_KID)));return e.box(e.types.tenc,n)}},{key:"sinf",value:function(t){var r=new Uint8Array([]),n=new Uint8Array([t.data_format.charCodeAt(0),t.data_format.charCodeAt(1),t.data_format.charCodeAt(2),t.data_format.charCodeAt(3)]),o=new Uint8Array([0,0,0,0,99,101,110,99,0,1,0,0]),i=e.schi(t);return e.box(e.types.sinf,r,e.box(e.types.frma,n),e.box(e.types.schm,o),i)}},{key:"av01",value:function(t){return e.box(e.types.av01,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,t.width>>8&255,255&t.width,t.height>>8&255,255&t.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),t.av1C,t.colr)}},{key:"avc1hev1",value:function(t){var r,n=t.codecType===VideoCodecType.HEVC,o=n?e.types.hvc1:e.types.avc1,i=n?e.hvcC(t):e.avcC(t),a=[new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,t.width>>8&255,255&t.width,t.height>>8&255,255&t.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),i];return n?a.push(e.box(e.types.fiel,new Uint8Array([1,0]))):t.sarRatio&&t.sarRatio.length>1&&a.push(e.pasp(t.sarRatio)),e.box.apply(e,_concatInstanceProperty(r=[o]).call(r,a))}},{key:"avcC",value:function(t){var r,n,o,i,a,s,c=[],l=[];return _forEachInstanceProperty(r=t.sps).call(r,(function(e){s=e.byteLength,c.push(s>>>8&255),c.push(255&s),c.push.apply(c,_toConsumableArray(e))})),_forEachInstanceProperty(n=t.pps).call(n,(function(e){s=e.byteLength,l.push(s>>>8&255),l.push(255&s),l.push.apply(l,_toConsumableArray(e))})),e.box(e.types.avcC,new Uint8Array(_concatInstanceProperty(i=_concatInstanceProperty(o=_concatInstanceProperty(a=[1,c[3],c[4],c[5],255,224|t.sps.length]).apply(a,c)).call(o,[t.pps.length])).apply(i,l)))}},{key:"hvcC",value:function(t){var r=t.hvcC;if(r instanceof ArrayBuffer||r instanceof Uint8Array)return r;var n,o=t.vps,i=t.sps,a=t.pps;if(r){var s=r.generalProfileCompatibilityFlags,c=r.generalConstraintIndicatorFlags,l=(o.length&&1)+(i.length&&1)+(a.length&&1);n=[1,r.generalProfileSpace<<6|r.generalTierFlag<<5|r.generalProfileIdc,s>>>24,s>>>16,s>>>8,s,c[0],c[1],c[2],c[3],c[4],c[5],r.generalLevelIdc,240,0,252,252|r.chromaFormatIdc,248|r.bitDepthLumaMinus8,248|r.bitDepthChromaMinus8,0,0,r.numTemporalLayers<<3|r.temporalIdNested<<2|3,l];var u=function(e){var t;n.push(e.length>>8,e.length),(t=n).push.apply(t,_toConsumableArray(e))};o.length&&(n.push(160,0,o.length),_forEachInstanceProperty(o).call(o,u)),i.length&&(n.push(161,0,i.length),_forEachInstanceProperty(i).call(i,u)),a.length&&(n.push(162,0,a.length),_forEachInstanceProperty(a).call(a,u))}else n=[1,1,96,0,0,0,144,0,0,0,0,0,93,240,0,252,253,248,248,0,0,15,3,160,0,1,0,24,64,1,12,1,255,255,1,96,0,0,3,0,144,0,0,3,0,0,3,0,93,153,152,9,161,0,1,0,45,66,1,1,1,96,0,0,3,0,144,0,0,3,0,0,3,0,93,160,2,128,128,45,22,89,153,164,147,43,154,128,128,128,130,0,0,3,0,2,0,0,3,0,50,16,162,0,1,0,7,68,1,193,114,180,98,64];return e.box(e.types.hvcC,new Uint8Array(n))}},{key:"pasp",value:function(t){var r=_slicedToArray(t,2),n=r[0],o=r[1];return e.box(e.types.pasp,new Uint8Array([n>>24,n>>16&255,n>>8&255,255&n,o>>24,o>>16&255,o>>8&255,255&o]))}},{key:"mp4a",value:function(t){return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,t.sampleRate>>8&255,255&t.sampleRate,0,0]),t.config.length?e.esds(t.config):void 0)}},{key:"esds",value:function(t){var r,n,o,i=t.length;return e.box(e.types.esds,new Uint8Array(_concatInstanceProperty(r=_concatInstanceProperty(n=_concatInstanceProperty(o=[0,0,0,0,3,23+i,0,0,0,4,15+i,64,21,0,6,0,0,0,218,192,0,0,218,192,5]).call(o,[i])).call(n,t)).call(r,[6,1,2])))}},{key:"opus",value:function(t){var r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,t.sampleRate>>8&255,255&t.sampleRate,0,0]),n=t.config.length?e.dOps(t):[];return e.box(e.types.Opus,r,n)}},{key:"dOps",value:function(t){if(t.config)return t.config[4]=t.sampleRate>>>24&255,t.config[5]=t.sampleRate>>>16&255,t.config[6]=t.sampleRate>>>8&255,t.config[7]=255&t.sampleRate,e.box(e.types.dOps,t.config)}},{key:"mvex",value:function(t){var r;return e.box.apply(e,_concatInstanceProperty(r=[e.types.mvex]).call(r,_toConsumableArray(_mapInstanceProperty(t).call(t,(function(t){return e.trex(t.id)})))))}},{key:"trex",value:function(t){return e.box(e.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"trex1",value:function(t){return e.box(e.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,2,0,0,0,0,0,0,1,0,0]))}},{key:"trex2",value:function(t){return e.box(e.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,4,0,0,0,0,0,2,0,0,0]))}},{key:"moof",value:function(t){var r;return e.box.apply(e,_concatInstanceProperty(r=[e.types.moof,e.mfhd(t[0].samples?t[0].samples[0].gopId:0)]).call(r,_toConsumableArray(_mapInstanceProperty(t).call(t,(function(t){return e.traf(t)})))))}},{key:"mfhd",value:function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"traf",value:function(t){var r,n=e.tfhd(t.id),o=e.tfdt(t,t.baseMediaDecodeTime),i=0;if(t.isVideo&&t.videoSenc&&(r=t.videoSenc,_forEachInstanceProperty(r).call(r,(function(e){i+=8,e.subsamples&&e.subsamples.length&&(i+=2,i+=6*e.subsamples.length)}))),t.videoSencLength=i,t.useEME&&(t.isVideoEncryption||t.isAudioEncryption)){if(t.isVideoEncryption){if(t.isVideo){var a=e.saiz(t),s=e.saio(t),c=e.trun1(t),l=e.senc(t);return e.box(e.types.traf,n,o,a,s,c,l)}if(t.isAudioEncryption){var u=e.sbgp(),p=e.saiz(t),$=e.saio(t),f=e.senc(t),d=e.trun1(t);return e.box(e.types.traf,n,o,u,p,$,f,d)}var y=e.sbgp(),h=e.trun1(t);return e.box(e.types.traf,n,o,y,h)}if(t.isVideo){var _=e.trun1(t);return e.box(e.types.traf,n,o,_)}var g=e.sbgp(),m=e.saiz(t),v=e.saio(t),b=e.senc(t),S=e.trun1(t);return e.box(e.types.traf,n,o,g,m,v,b,S)}var E=e.sdtp(t);return e.box(e.types.traf,n,o,E,e.trun(t.samples,E.byteLength+76))}},{key:"sdtp",value:function(t){var r,n=new Buffer;return _forEachInstanceProperty(r=t.samples).call(r,(function(e){n.write(new Uint8Array(t.isVideo?[e.keyframe?32:16]:[16]))})),e.box(e.types.sdtp,this.extension(0,0),n.buffer)}},{key:"trun1",value:function(t){var r,n=new Buffer,o=Buffer.writeUint32(t.samples.length),i=null;if(t.isVideo){var a=t.videoSencLength;i=Buffer.writeUint32(16*t.samples.length+a+149),!t.isVideoEncryption&&t.isAudioEncryption&&(i=Buffer.writeUint32(16*t.samples.length+92))}else{var s=12*t.samples.length+124;t.isAudioEncryption&&(s=12*t.samples.length+8*t.audioSenc.length+177),i=Buffer.writeUint32(s)}return _forEachInstanceProperty(r=t.samples).call(r,(function(e){n.write(Buffer.writeUint32(e.duration)),n.write(Buffer.writeUint32(e.size)),n.write(Buffer.writeUint32(e.keyframe?33554432:65536)),t.isVideo&&n.write(Buffer.writeUint32(e.cts?e.cts:0))})),e.box(e.types.trun,this.extension(0,_flagsInstanceProperty(t)),o,i,n.buffer)}},{key:"senc",value:function(t){var r=new Buffer,n=t.samples.length,o=t.isVideo?16:8,i=t.isVideo?2:0,a=[],s=0;return t.isVideo?(a=t.videoSenc,s=t.videoSencLength):a=t.audioSenc,s=s||o*n,r.write(Buffer.writeUint32(16+s),e.types.senc,this.extension(0,i)),r.write(Buffer.writeUint32(n)),_forEachInstanceProperty(a).call(a,(function(e){for(var t=0;t<e.InitializationVector.length;t++)r.write(new Uint8Array([e.InitializationVector[t]]));var n;e.subsamples&&e.subsamples.length&&(r.write(Buffer.writeUint16(e.subsamples.length)),_forEachInstanceProperty(n=e.subsamples).call(n,(function(e){r.write(Buffer.writeUint16(e.BytesOfClearData)),r.write(Buffer.writeUint32(e.BytesOfProtectedData))})))})),r.buffer}},{key:"saio",value:function(t){var r=12*t.samples.length+141;!t.isVideo&&t.isAudioEncryption&&(r=149);var n=new Uint8Array([1,0,0,0,0,0,0,1,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r]);return e.box(e.types.saio,n)}},{key:"saiz",value:function(t){var r=t.samples.length,n=new Uint8Array([0,0,0,0,16,r>>24&255,r>>16&255,r>>8&255,255&r]);return e.box(e.types.saiz,n)}},{key:"sbgp",value:function(){var t=new Uint8Array([114,111,108,108,0,0,0,1,0,0,1,25,0,0,0,1]);return e.box(e.types.sbgp,this.extension(0,0),t)}},{key:"extension",value:function(e,t){return new Uint8Array([e,t>>16&255,t>>8&255,255&t])}},{key:"tfhd",value:function(t){return e.box(e.types.tfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"tfdt",value:function(t,r){var n=Math.floor(r/(UINT32_MAX+1)),o=Math.floor(r%(UINT32_MAX+1));return t.useEME&&(t.isVideoEncryption||t.isAudioEncryption)?e.box(e.types.tfdt,new Uint8Array([0,0,0,0,o>>24,o>>16&255,o>>8&255,255&o])):e.box(e.types.tfdt,new Uint8Array([1,0,0,0,n>>24,n>>16&255,n>>8&255,255&n,o>>24,o>>16&255,o>>8&255,255&o]))}},{key:"trun",value:function(t,r){var n=t.length,o=12+16*n;r+=8+o;var i=new Uint8Array(o);i.set([0,0,15,1,n>>>24&255,n>>>16&255,n>>>8&255,255&n,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0);for(var a=0;a<n;a++){var s=t[a],c=s.duration,l=s.size,u=s.flag,p=void 0===u?{}:u,$=s.cts,f=void 0===$?0:$;i.set([c>>>24&255,c>>>16&255,c>>>8&255,255&c,l>>>24&255,l>>>16&255,l>>>8&255,255&l,p.isLeading<<2|(null===p.dependsOn||void 0===p.dependsOn?1:p.dependsOn),p.isDependedOn<<6|p.hasRedundancy<<4|p.paddingValue<<1|(null===p.isNonSyncSample||void 0===p.isNonSyncSample?1:p.isNonSyncSample),61440&p.degradationPriority,15&p.degradationPriority,f>>>24&255,f>>>16&255,f>>>8&255,255&f],12+16*a)}return e.box(e.types.trun,i)}},{key:"moovMP4",value:function(t){var r;return e.box.apply(e,_concatInstanceProperty(r=[e.types.moov,e.mvhd(t[0].duration,t[0].timescale)]).call(r,_toConsumableArray(_mapInstanceProperty(t).call(t,(function(t){return e.trackMP4(t)})))))}},{key:"trackMP4",value:function(t){return e.box(e.types.trak,e.tkhd(t.id,t.duration,t.width,t.height),e.mdiaMP4(t))}},{key:"mdiaMP4",value:function(t){return e.box(e.types.mdia,e.mdhd(t.duration,t.timescale),e.hdlr(t.type),e.minfMP4(t))}},{key:"minfMP4",value:function(t){return e.box(e.types.minf,t.type===TrackType.VIDEO?e.VMHD:e.SMHD,e.DINF,e.stblMP4(t))}},{key:"stblMP4",value:function(t){var r,n=t.ext,o=[e.stsd(t),e.stts(n.stts),e.stsc(n.stsc),e.stsz(n.stsz),e.stco(n.stco)];return n.stss.length&&o.push(e.stss(n.stss)),n.ctts.length&&o.push(e.ctts(n.ctts)),e.box.apply(e,_concatInstanceProperty(r=[e.types.stbl]).call(r,o))}},{key:"stts",value:function(t){var r=t.length,n=new Uint8Array(8*r),o=0;return _forEachInstanceProperty(t).call(t,(function(e){var t=e.value,r=e.count;n.set([r>>24,r>>16&255,r>>8&255,255&r,t>>24,t>>16&255,t>>8&255,255&t],o),o+=8})),e.box(e.types.stts,concatUint8Array(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stsc",value:function(t){var r=t.length,n=new Uint8Array(12*r),o=0;return _forEachInstanceProperty(t).call(t,(function(e){var t=e.firstChunk,r=e.samplesPerChunk,i=e.sampleDescIndex;n.set([t>>24,t>>16&255,t>>8&255,255&t,r>>24,r>>16&255,r>>8&255,255&r,i>>24,i>>16&255,i>>8&255,255&i],o),o+=12})),e.box(e.types.stsc,concatUint8Array(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stsz",value:function(t){var r=t.length,n=new Uint8Array(4*r),o=0;return _forEachInstanceProperty(t).call(t,(function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],o),o+=4})),e.box(e.types.stsz,concatUint8Array(new Uint8Array([0,0,0,0,0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stco",value:function(t){var r=t.length,n=new Uint8Array(4*r),o=0;return _forEachInstanceProperty(t).call(t,(function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],o),o+=4})),e.box(e.types.stco,concatUint8Array(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stss",value:function(t){var r=t.length,n=new Uint8Array(4*r),o=0;return _forEachInstanceProperty(t).call(t,(function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],o),o+=4})),e.box(e.types.stss,concatUint8Array(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"ctts",value:function(t){var r=t.length,n=new Uint8Array(8*r),o=0;return _forEachInstanceProperty(t).call(t,(function(e){var t=e.value,r=e.count;n.set([r>>24,r>>16&255,r>>8&255,255&r,t>>24,t>>16&255,t>>8&255,255&t],o),o+=8})),e.box(e.types.ctts,concatUint8Array(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"styp",value:function(){return e.box(e.types.styp,new Uint8Array([109,115,100,104,0,0,0,0,109,115,100,104,109,115,105,120]))}},{key:"sidx",value:function(t){var r,n=t.timescale,o=t.samples[0].duration,i=o*t.samples.length,a=t.samples[0].sampleOffset*o,s=8;_forEachInstanceProperty(r=t.samples).call(r,(function(e){s+=e.size}));var c=0;if(t.isVideo){var l,u=0;t.videoSenc&&(l=t.videoSenc),t.isVideo&&_forEachInstanceProperty(l).call(l,(function(e){u+=8,e.subsamples&&e.subsamples.length&&(u+=2,u+=6*e.subsamples.length)})),t.videoSencLength=u,c=s+141+16*t.samples.length+u,t.useEME&&t.isAudioEncryption&&!t.isVideoEncryption&&(c=s+16*t.samples.length+84)}else c=s+116+12*t.samples.length,t.useEME&&t.isAudioEncryption&&(c=s+169+12*t.samples.length+8*t.audioSenc.length);var p=new Uint8Array([0,0,0,0,0,0,0,255&t.id,n>>24&255,n>>16&255,n>>8&255,255&n,a>>24&255,a>>16&255,a>>8&255,255&a,0,0,0,0,0,0,0,1,0,c>>16&255,c>>8&255,255&c,i>>24&255,i>>16&255,i>>8&255,255&i,144,0,0,0]);return e.box(e.types.sidx,p)}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}}]),e}();_defineProperty(MP4,"types",_reduceInstanceProperty(_context21=["Opus","dOps","av01","av1C","avc1","avcC","hvc1","hvcC","dinf","dref","esds","ftyp","hdlr","mdat","mdhd","mdia","mfhd","minf","moof","moov","mp4a","mvex","mvhd","pasp","stbl","stco","stsc","stsd","stsz","stts","tfdt","tfhd","traf","trak","trex","tkhd","vmhd","smhd","ctts","stss","styp","pssh","sidx","sbgp","saiz","saio","senc","trun","encv","enca","sinf","btrt","frma","tenc","schm","schi","mehd","fiel","sdtp"]).call(_context21,(function(e,t){return e[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)],e}),_Object$create(null))),_defineProperty(MP4,"HDLR_TYPES",{video:new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),audio:new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0])}),_defineProperty(MP4,"FTYPAVC1",MP4.box(MP4.types.ftyp,new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]))),_defineProperty(MP4,"FTYPHEV1",MP4.box(MP4.types.ftyp,new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,104,101,118,49]))),_defineProperty(MP4,"DINF",MP4.box(MP4.types.dinf,MP4.box(MP4.types.dref,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1])))),_defineProperty(MP4,"VMHD",MP4.box(MP4.types.vmhd,new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]))),_defineProperty(MP4,"SMHD",MP4.box(MP4.types.smhd,new Uint8Array([0,0,0,0,0,0,0,0]))),_defineProperty(MP4,"StblTable",new Uint8Array([0,0,0,0,0,0,0,0])),_defineProperty(MP4,"STTS",MP4.box(MP4.types.stts,MP4.StblTable)),_defineProperty(MP4,"STSC",MP4.box(MP4.types.stsc,MP4.StblTable)),_defineProperty(MP4,"STSZ",MP4.box(MP4.types.stsz,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]))),_defineProperty(MP4,"STCO",MP4.box(MP4.types.stco,MP4.StblTable));var Logger=function(){function e(t,r){_classCallCheck$1(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]"),e.disabled=r}return _createClass$1(e,[{key:"debug",value:function(){var t,r;if(!e.disabled){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];(r=console).debug.apply(r,_concatInstanceProperty(t=[this._prefix]).call(t,o))}}},{key:"log",value:function(){var t,r;if(!e.disabled){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];(r=console).log.apply(r,_concatInstanceProperty(t=[this._prefix]).call(t,o))}}},{key:"warn",value:function(){var t,r;if(!e.disabled){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];(r=console).warn.apply(r,_concatInstanceProperty(t=[this._prefix]).call(t,o))}}},{key:"error",value:function(){var t,r;if(!e.disabled){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];(r=console).error.apply(r,_concatInstanceProperty(t=[this._prefix]).call(t,o))}}},{key:"table",value:function(){var t;e.disabled||(console.group(this._prefix),(t=console).table.apply(t,arguments),console.groupEnd())}}],[{key:"enable",value:function(){e.disabled=!1}},{key:"disable",value:function(){e.disabled=!0}}]),e}();_defineProperty(Logger,"disabled",!0);var FMP4Remuxer=function(){function e(t,r,n){_classCallCheck$1(this,e),this.videoTrack=t,this.audioTrack=r;var o=/Chrome\/([^.]+)/.exec(navigator.userAgent);this.forceFirstIDR=o&&Number(o[1])<50,this.log=new Logger("FMP4Remuxer",!n||!n.openLog||!n.openLog)}return _createClass$1(e,[{key:"remux",value:function(){var e,t,r,n,o,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=this.videoTrack,c=this.audioTrack,l=s.exist(),u=c.exist(),p=[];return i&&(a&&a.initMerge?(l&&p.push(this.videoTrack),u&&p.push(this.audioTrack),r=MP4.initSegment(p)):(l&&(e=MP4.initSegment([this.videoTrack])),u&&(t=MP4.initSegment([this.audioTrack])))),l&&s.hasSample()&&(n=this._remuxVideo()),u&&c.hasSample()&&(o=this._remuxAudio()),s.samples=[],c.samples=[],{initSegment:r,videoInitSegment:e,audioInitSegment:t,videoSegment:n,audioSegment:o}}},{key:"_remuxVideo",value:function(){var e=this.videoTrack;this.forceFirstIDR&&(e.samples[0].flag={dependsOn:2,isNonSyncSample:0});var t=e.samples,r=/av01/.test(e.codec),n=0;r?_forEachInstanceProperty(t).call(t,(function(e){n+=e.data.byteLength})):_forEachInstanceProperty(t).call(t,(function(e){var t;n+=_reduceInstanceProperty(t=e.units).call(t,(function(e,t){return e+t.byteLength}),0),n+=4*e.units.length}));var o=new Uint8Array(n);if(r)for(var i,a=0,s=t.length,c=0;a<s;a++)i=t[a],o.set(i.data,c),i.size=i.data.byteLength,c+=i.size;else for(var l,u=new DataView(o.buffer),p=function(e,r){var n;r=t[$];var i=0;_forEachInstanceProperty(n=r.units).call(n,(function(t){u.setUint32(e,t.byteLength),e+=4,o.set(t,e),e+=t.byteLength,i+=4+t.byteLength})),r.size=i,d=e,l=r},$=0,f=t.length,d=0;$<f;$++)p(d,l);var y=MP4.mdat(o);return concatUint8Array(MP4.moof([e]),y)}},{key:"_remuxAudio",value:function(){var e,t,r=this.audioTrack,n=new Uint8Array(_reduceInstanceProperty(e=r.samples).call(e,(function(e,t){return e+t.size}),0));_reduceInstanceProperty(t=r.samples).call(t,(function(e,t){return n.set(t.data,e),e+t.size}),0);var o=MP4.mdat(n);return concatUint8Array(MP4.moof([r]),o)}},{key:"reset",value:function(){this.videoTrack.reset(),this.audioTrack.reset()}}]),e}(),TransferCost=function(){function e(){_classCallCheck$4(this,e),_defineProperty$3(this,"_ttfb",0),_defineProperty$3(this,"_demuxStart",0),_defineProperty$3(this,"_demuxEnd",0),_defineProperty$3(this,"_demuxCost",0),_defineProperty$3(this,"_remuxStart",0),_defineProperty$3(this,"_remuxEnd",0),_defineProperty$3(this,"_remuxCost",0),_defineProperty$3(this,"_appendStart",0),_defineProperty$3(this,"_appendEnd",0),_defineProperty$3(this,"_appendCost",0)}return _createClass$4(e,[{key:"set",value:function(e,t){this["_".concat(e)]=t}},{key:"start",value:function(e){this["_".concat(e,"Start")]=_Date$now()}},{key:"end",value:function(e){this["_".concat(e,"End")]=_Date$now(),this["_".concat(e,"Cost")]=this["_".concat(e,"Cost")]+(this["_".concat(e,"End")]-this["_".concat(e,"Start")])}},{key:"transferCost",get:function(){return{ttfbCost:this._ttfb,demuxCost:this._demuxCost,remuxCost:this._remuxCost,appendCost:this._appendCost}}}]),e}(),TRANSFER_EVENT={TTFB:"ttfb",DEMUX:"demux",REMUX:"remux",APPEND:"append"},logger$1=new Logger$2("BufferService"),BufferService=function(){function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};_classCallCheck$4(this,e),_defineProperty$3(this,"flv",null),_defineProperty$3(this,"_demuxer",new FlvDemuxer),_defineProperty$3(this,"_remuxer",null),_defineProperty$3(this,"_mse",null),_defineProperty$3(this,"_softVideo",null),_defineProperty$3(this,"_sourceCreated",!1),_defineProperty$3(this,"_needInitSegment",!0),_defineProperty$3(this,"_discontinuity",!0),_defineProperty$3(this,"_contiguous",!1),_defineProperty$3(this,"_initSegmentId",""),_defineProperty$3(this,"_cachedBuffer",null),_defineProperty$3(this,"_demuxStartTime",0),_defineProperty$3(this,"_opts",null),this.flv=t,this._opts=n,r?this._softVideo=r:(this._remuxer=new FMP4Remuxer(this._demuxer.videoTrack,this._demuxer.audioTrack),this._mse=new MSE(null,{preferMMS:"boolean"==typeof n.preferMMS?n.preferMMS:!!n.perferMMS}),this._mse.bindMedia(t.media))}var t,r,n,o,i,a;return _createClass$4(e,[{key:"baseDts",get:function(){var e,t;return null===(e=this._demuxer)||void 0===e||null===(t=e._fixer)||void 0===t?void 0:t._baseDts}},{key:"blobUrl",get:function(){var e;return null===(e=this._mse)||void 0===e?void 0:e.url}},{key:"isFull",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:MSE.VIDEO;return this._mse.isFull(e)}},{key:"seamlessSwitch",value:function(){this._needInitSegment=!0,this._discontinuity=!0,this._contiguous=!0,this._initSegmentId=""}},{key:"unContiguous",value:function(e){this._contiguous=!1,this._demuxStartTime=e}},{key:"reset",value:(a=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(){var t,r=arguments;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.length>0&&void 0!==r[0]&&r[0],!this._mse||t){e.next=6;break}return e.next=4,this._mse.unbindMedia();case 4:return e.next=6,this._mse.bindMedia(this.flv.media);case 6:this._needInitSegment=!0,this._discontinuity=!0,this._contiguous=!1,this._sourceCreated=!1,this._initSegmentId="",this.resetSeamlessSwitchStats();case 12:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"resetSeamlessSwitchStats",value:function(){this.seamlessLoadingSwitch=null,this.seamlessLoadingSwitching=!1,this._demuxer&&(this._demuxer.seamlessLoadingSwitching=!1)}},{key:"endOfStream",value:(i=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(){return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._mse){e.next=7;break}if(!this._sourceCreated){e.next=5;break}return e.next=4,this._mse.endOfStream();case 4:this.flv.emit(EVENT.BUFFEREOS);case 5:e.next=8;break;case 7:this._softVideo&&this._softVideo.endOfStream();case 8:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateDuration",value:(o=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t){return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._mse){e.next=7;break}if(this._mse.isOpened){e.next=4;break}return e.next=4,this._mse.open();case 4:return logger$1.debug("update duration",t),e.next=7,this._mse.updateDuration(t);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"destroy",value:(n=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(){return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._mse){e.next=3;break}return e.next=3,this._mse.unbindMedia();case 3:this._mse=null,this._softVideo=null,this._demuxer=null,this._remuxer=null;case 7:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"appendBuffer",value:(r=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t){var r,n,o,i,a,s,c,l,u,p,$,f,d,y,h,_,g,m,v=this;return _regeneratorRuntime$1().wrap((function(e){for(var b,S,E,P,O,T;;)switch(e.prev=e.next){case 0:if(r=!1,this._cachedBuffer&&(t=concatUint8Array$1(this._cachedBuffer,t),this._cachedBuffer=null),n=this._demuxer,t&&t.length&&n){e.next=5;break}return e.abrupt("return");case 5:e.prev=5,this.flv._transferCost.start(TRANSFER_EVENT.DEMUX),n.demuxAndFix(t,this.seamlessLoadingSwitching||this._discontinuity,this._contiguous,this._demuxStartTime,this.seamlessLoadingSwitching),this.seamlessLoadingSwitching=!1,this.flv._transferCost.end(TRANSFER_EVENT.DEMUX),e.next=15;break;case 12:throw e.prev=12,e.t0=e.catch(5),new StreamingError(ERR.DEMUX,ERR.SUB_TYPES.FLV,e.t0);case 15:if(o=n.videoTrack,i=n.audioTrack,a=n.metadataTrack,!this.seamlessLoadingSwitch){e.next=25;break}if(!((s=_findIndexInstanceProperty(b=o.samples).call(b,(function(e){return e.originDts===o.lastKeyFrameDts})))>=0)){e.next=25;break}return _spliceInstanceProperty(S=o.samples).call(S,s),e.next=22,this.seamlessLoadingSwitch();case 22:this.seamlessLoadingSwitch=null,t=null,r=!0;case 25:if(c=o.exist(),l=i.exist(),this._opts.onlyAudio&&(c=!1,o.present=!1),this._opts.onlyVideo&&(l=!1,i.present=!1),!(!c&&o.present||!l&&i.present)){e.next=42;break}if(u=0,(p=c?o:l?i:void 0)&&p.samples.length&&(u=(p.samples[p.samples.length-1].originPts-p.samples[0].originPts)/p.timescale*1e3),!(u>this._opts.analyzeDuration)){e.next=40;break}logger$1.warn("analyze duration exceeded, ".concat(u,"ms"),p),o.present=c,i.present=l,this.flv.emit(EVENT.ANALYZE_DURATION_EXCEEDED,{duration:u}),e.next=42;break;case 40:return this._cachedBuffer=t,e.abrupt("return");case 42:if($=o.type,f=i.type,this._fireEvents(o,i,a),r||(this._discontinuity=!1,this._contiguous=!0,this._demuxStartTime=0),d=this._mse,y=function(){var e,t;null!==(e=v.flv)&&void 0!==e&&e.emit&&(null===(t=v.flv)||void 0===t||t.emit(EVENT.APPEND_BUFFER,{}))},this.flv.emit(EVENT.DEMUXED_TRACK,{videoTrack:o}),(h=_concatInstanceProperty(E=_concatInstanceProperty(P=_concatInstanceProperty(O=_concatInstanceProperty(T="".concat(o.codec,"/")).call(T,o.width,"/")).call(O,o.height,"/")).call(P,i.codec,"/")).call(E,i.config))!==this._initSegmentId&&(this._needInitSegment=!0,this._initSegmentId=h,this._emitMetaParsedEvent(o,i)),!d){e.next=83;break}if(this._sourceCreated){e.next=59;break}return e.next=55,d.open();case 55:c&&(logger$1.log("codec: video/mp4;codecs=".concat(o.codec)),d.createSource($,"video/mp4;codecs=".concat(o.codec))),l&&(logger$1.log("codec: audio/mp4;codecs=".concat(i.codec)),d.createSource(f,"audio/mp4;codecs=".concat(i.codec))),this._sourceCreated=!0,this.flv.emit(EVENT.SOURCEBUFFER_CREATED);case 59:e.prev=59,this._needInitSegment&&!this._opts.mseLowLatency&&(o.duration=this._opts.durationForMSELowLatencyOff*o.timescale,i.duration=this._opts.durationForMSELowLatencyOff*l.timescale),this.flv._transferCost.start(TRANSFER_EVENT.REMUX),_=this._remuxer.remux(this._needInitSegment),this.flv._transferCost.end(TRANSFER_EVENT.REMUX),e.next=69;break;case 66:throw e.prev=66,e.t1=e.catch(59),new StreamingError(ERR.REMUX,ERR.SUB_TYPES.FMP4,e.t1);case 69:if(!this._needInitSegment||_.videoInitSegment||_.audioInitSegment){e.next=71;break}return e.abrupt("return");case 71:return this._needInitSegment=!1,g=[],_.videoInitSegment&&g.push(d.append($,_.videoInitSegment)),_.audioInitSegment&&g.push(d.append(f,_.audioInitSegment)),_.videoSegment&&g.push(d.append($,_.videoSegment)),_.audioSegment&&g.push(d.append(f,_.audioSegment)),this.flv._transferCost.start(TRANSFER_EVENT.APPEND),(m=_Promise.all(g)).then(y).then((function(){v.flv._transferCost.end(TRANSFER_EVENT.APPEND),y()})),e.abrupt("return",m);case 83:this._softVideo&&(this._softVideo.appendBuffer(o,i),y());case 84:case"end":return e.stop()}}),e,this,[[5,12],[59,66]])}))),function(e){return r.apply(this,arguments)})},{key:"evictBuffer",value:(t=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t){var r,n,o,i=this;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.flv.media,this._mse&&this._demuxer&&r&&t&&!(t<0)){e.next=3;break}return e.abrupt("return");case 3:if(n=r.currentTime,!((o=n-t)<=0)){e.next=7;break}return e.abrupt("return");case 7:if(!(Buffer$1.start(Buffer$1.get(r))+1>=o)){e.next=10;break}return e.abrupt("return");case 10:return e.abrupt("return",this._mse.clearBuffer(0,o).then((function(){return i.flv.emit(EVENT.REMOVE_BUFFER,{removeEnd:o})})));case 11:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_emitMetaParsedEvent",value:function(e,t){e.exist()&&this.flv.emit(EVENT.METADATA_PARSED,{type:"video",track:e,meta:{codec:e.codec,timescale:e.timescale,width:e.width,height:e.height,sarRatio:e.sarRatio,baseDts:e.baseDts}}),t.exist()&&this.flv.emit(EVENT.METADATA_PARSED,{type:"audio",track:t,meta:{codec:t.codec,channelCount:t.channelCount,sampleRate:t.sampleRate,timescale:t.timescale,baseDts:t.baseDts}}),logger$1.debug("track parsed",e,t)}},{key:"_fireEvents",value:function(e,t,r){var n,o,i,a,s,c,l=this;logger$1.debug(_concatInstanceProperty(n="videoTrack samples count: ".concat(e.samples.length,", audioTrack samples count: ")).call(n,t.samples.length)),_forEachInstanceProperty(o=r.flvScriptSamples).call(o,(function(e){l.flv.emit(EVENT.FLV_SCRIPT_DATA,e),logger$1.debug("flvScriptData",e)})),_forEachInstanceProperty(i=e.samples).call(i,(function(e){e.keyframe&&l.flv.emit(EVENT.KEYFRAME,{pts:e.originPts})})),_forEachInstanceProperty(a=e.warnings).call(a,(function(e){var t;switch(e.type){case WarningType.LARGE_AV_SHIFT:t=EVENT.LARGE_AV_FIRST_FRAME_GAP_DETECT;break;case WarningType.LARGE_VIDEO_GAP:t=EVENT.LARGE_VIDEO_DTS_GAP_DETECT;break;case WarningType.LARGE_VIDEO_GAP_BETWEEN_CHUNK:t=EVENT.MAX_DTS_DELTA_WITH_NEXT_SEGMENT_DETECT}t&&l.flv.emit(EVENT.STREAM_EXCEPTION,_objectSpread2$2(_objectSpread2$2({},e),{},{type:t})),logger$1.warn("video exception",e)})),_forEachInstanceProperty(s=t.warnings).call(s,(function(e){var t;switch(e.type){case WarningType.LARGE_AUDIO_GAP:t=EVENT.LARGE_AUDIO_DTS_GAP_DETECT;break;case WarningType.AUDIO_FILLED:t=EVENT.AUDIO_GAP_DETECT;break;case WarningType.AUDIO_DROPPED:t=EVENT.AUDIO_OVERLAP_DETECT}t&&l.flv.emit(EVENT.STREAM_EXCEPTION,_objectSpread2$2(_objectSpread2$2({},e),{},{type:t})),logger$1.warn("audio exception",e)})),_forEachInstanceProperty(c=r.seiSamples).call(c,(function(e){l.flv.emit(EVENT.SEI,_objectSpread2$2(_objectSpread2$2({},e),{},{sei:{code:e.data.type,content:e.data.payload,dts:e.pts}}))}))}}]),e}();function getOption(e){var t=_objectSpread2$2({retryCount:3,retryDelay:1e3,disconnectRetryCount:0,loadTimeout:1e4,maxReaderInterval:5e3,preloadTime:5,defaultVodLoadSize:1e7,isLive:!1,softDecode:!1,bufferBehind:10,maxJumpDistance:3,analyzeDuration:2e4,seamlesslyReload:!1,keepStatusAfterSwitch:!0,onlyVideo:!1,onlyAudio:!1,preferMMS:!1,mseLowLatency:!0,durationForMSELowLatencyOff:6,chunkCountForSpeed:50,skipChunkSize:1e3,longtimeNoReceived:3e3,enableStartGapJump:!0},e);return t.isLive&&t.preloadTime&&(t.maxLatency||(t.maxLatency=2*t.preloadTime),t.targetLatency||(t.targetLatency=t.preloadTime),null!==t.disconnectTime&&void 0!==t.disconnectTime||(t.disconnectTime=t.maxLatency)),t}function searchKeyframeIndex(e,t){var r=0,n=e.length-1,o=0,i=0,a=n;for(t<e[0]&&(r=0,i=a+1);i<=a;){if((o=i+Math.floor((a-i)/2))===n||t>=e[o]&&t<e[o+1]){r=o;break}e[o]<t?i=o+1:a=o-1}return r}var logger=new Logger$2("flv"),MAX_HOLE=.1,MAX_START_GAP=.3,Flv=function(e){_inherits$3(l,EventEmitter);var t,r,n,o,i,a,s,c=_createSuper$2(l);function l(e){var t;return _classCallCheck$4(this,l),_defineProperty$3(_assertThisInitialized$3(t=c.call(this)),"media",null),_defineProperty$3(_assertThisInitialized$3(t),"_loading",!1),_defineProperty$3(_assertThisInitialized$3(t),"_opts",null),_defineProperty$3(_assertThisInitialized$3(t),"_bufferService",null),_defineProperty$3(_assertThisInitialized$3(t),"_gapService",null),_defineProperty$3(_assertThisInitialized$3(t),"_stats",null),_defineProperty$3(_assertThisInitialized$3(t),"_mediaLoader",null),_defineProperty$3(_assertThisInitialized$3(t),"_maxChunkWaitTimer",null),_defineProperty$3(_assertThisInitialized$3(t),"_tickTimer",null),_defineProperty$3(_assertThisInitialized$3(t),"_tickInterval",500),_defineProperty$3(_assertThisInitialized$3(t),"_urlSwitching",!1),_defineProperty$3(_assertThisInitialized$3(t),"_seamlessSwitching",!1),_defineProperty$3(_assertThisInitialized$3(t),"_disconnectRetryCount",0),_defineProperty$3(_assertThisInitialized$3(t),"_preLoadEndPoint",0),_defineProperty$3(_assertThisInitialized$3(t),"_keyframes",null),_defineProperty$3(_assertThisInitialized$3(t),"_acceptRanges",!0),_defineProperty$3(_assertThisInitialized$3(t),"_onProgress",function(){var e=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(r,n,o,i){var a,s,c,l,u,p,$,f,d,y;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=o.startTime,s=o.endTime,c=o.st,l=o.firstByteTime,t._loading=!n,t._firstProgressEmit){e.next=13;break}if(t.media){e.next=6;break}return null===(u=t._mediaLoader)||void 0===u||u.cancel(),e.abrupt("return");case 6:p=i.headers,$=c?l-c:s-a,t.emit(EVENT.TTFB,{url:t._opts.url,responseUrl:i.url,elapsed:$}),t.emit(EVENT.LOAD_RESPONSE_HEADERS,{headers:p}),t._transferCost.set(TRANSFER_EVENT.TTFB,$),t._acceptRanges=!(null==p||!p.get("Accept-Ranges"))||!(null==p||!p.get("Content-Range")),t._firstProgressEmit=!0;case 13:if(t._bufferService){e.next=15;break}return e.abrupt("return");case 15:return clearTimeout(t._maxChunkWaitTimer),t._bandwidthService.addChunkRecord(null==r?void 0:r.byteLength,s-a),e.prev=17,e.next=20,t._bufferService.appendBuffer(r);case 20:null===(f=t._bufferService)||void 0===f||f.evictBuffer(t._opts.bufferBehind),e.next=33;break;case 23:if(e.prev=23,e.t0=e.catch(17),t.isLive||!t._bufferService.isFull()){e.next=32;break}return e.next=28,t._mediaLoader.cancel();case 28:return t._loading=!1,d=t.bufferInfo().remaining,t._opts.preloadTime=_parseInt$1(d)/2,e.abrupt("return");case 32:return e.abrupt("return",t._emitError(StreamingError.create(e.t0)));case 33:if(t._urlSwitching&&(t._urlSwitching=!1,t.emit(EVENT.SWITCH_URL_SUCCESS,{url:t._opts.url})),t._seamlessSwitching&&(t._seamlessSwitching=!1,t._tick()),!n||t.media.seeking){e.next=40;break}return t.emit(EVENT.LOAD_COMPLETE),logger.debug("load done"),t.isLive&&t._disconnectRetryCount<=0&&t._end(),e.abrupt("return");case 40:if(t.isLive){e.next=42;break}return e.abrupt("return");case 42:(y=t._opts.maxReaderInterval)&&t._firstProgressEmit&&(clearTimeout(t._maxChunkWaitTimer),t._maxChunkWaitTimer=_setTimeout((function(){if(t._disconnectRetryCount)return t._disconnectRetryCount--,void t.load();logger.debug("onMaxChunkWait",y),t._end()}),y));case 44:case"end":return e.stop()}}),e,null,[[17,23]])})));return function(t,r,n,o){return e.apply(this,arguments)}}()),_defineProperty$3(_assertThisInitialized$3(t),"_onRetryError",(function(e,r){logger.debug("load retry",e,r),t.emit(EVENT.LOAD_RETRY,{error:StreamingError.network(e),retryTime:r})})),_defineProperty$3(_assertThisInitialized$3(t),"_end",(function(){t._clear(),t._bufferService&&t._bufferService.endOfStream(),logger.debug("end stream")})),_defineProperty$3(_assertThisInitialized$3(t),"_resetDisconnectCount",(function(){t._disconnectRetryCount=t._opts.disconnectRetryCount})),_defineProperty$3(_assertThisInitialized$3(t),"_tick",(function(){clearTimeout(t._tickTimer);var e=_assertThisInitialized$3(t).media;if(e){t._tickTimer=_setTimeout(t._tick,t._tickInterval);var r=Buffer$1.end(Buffer$1.get(e));if(!(r<MAX_HOLE)&&e.readyState){var n=t._opts;if(isMediaPlaying(e)&&e.currentTime)t._gapService&&t._gapService.do(e,n.maxJumpDistance,t.isLive,3);else{if(!e.currentTime&&t._gapService&&n.enableStartGapJump)return void((t._opts.mseLowLatency||!1===t._opts.mseLowLatency&&t.bufferInfo(MAX_START_GAP).nextStart)&&t._gapService.do(e,n.maxJumpDistance,t.isLive,3));n.isLive&&4===e.readyState&&r-e.currentTime>n.disconnectTime&&t.disconnect()}}}})),_defineProperty$3(_assertThisInitialized$3(t),"_onPlay",(function(){var e,r,n=t._opts.softDecode||(null===(e=t.media)||void 0===e||null===(r=e.buffered)||void 0===r?void 0:r.length);if(t.isLive)!t._loading&&n&&t.replay(void 0,!0);else{var o=t.bufferInfo();(o.start||o.nextStart)>MAX_HOLE&&t._tick()}})),_defineProperty$3(_assertThisInitialized$3(t),"_onLoadeddata",(function(){t.isLive&&!t._opts.mseLowLatency&&t.media.duration!==1/0&&t._bufferService.updateDuration(1/0).catch((function(e){}))})),_defineProperty$3(_assertThisInitialized$3(t),"_onSeeking",_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(){return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:!t.isLive&&t.seekable&&(t._preLoadEndPoint=-1,t._checkPreload());case 1:case"end":return e.stop()}}),e)})))),_defineProperty$3(_assertThisInitialized$3(t),"_onTimeupdate",(function(){if(t.media){var e=t._opts,r=t.media.currentTime;if(e.isLive&&e.maxLatency&&e.targetLatency){var n=Buffer$1.end(Buffer$1.get(t.media));n-r>=e.maxLatency&&(t.media.currentTime=n-e.targetLatency,t.emit(EVENT.CHASEFRAME,{currentTime:t.media.currentTime,latency:e.targetLatency}))}t._seiService.throw(r,!0),e.isLive||!t.seekable||t._loading||t._checkPreload()}})),_defineProperty$3(_assertThisInitialized$3(t),"_onWaiting",(function(){t.isLive&&!t._loading&&t._disconnectRetryCount&&(t._disconnectRetryCount--,t.load())})),_defineProperty$3(_assertThisInitialized$3(t),"_onBufferUpdate",(function(){if(!t._opts.isLive){var e=t.bufferInfo(),r=e.end,n=e.nextEnd;Math.abs((r||n)-t.media.duration)<1&&(t._end(),t.media.readyState<=2&&t._tick())}})),_defineProperty$3(_assertThisInitialized$3(t),"_checkPreload",_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(){var r,n,o,i,a,s,c,l,u,p;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.bufferInfo(),n=r.remaining,o=void 0===n?0:n,i=t._opts,a=t._keyframes.filepositions,s=t._keyframes.times,c=t.media.currentTime,!(o<i.preloadTime)){e.next=19;break}if(l=searchKeyframeIndex(t._keyframes.times,c+o+MAX_HOLE),(u=searchKeyframeIndex(t._keyframes.times,c+o+t._opts.preloadTime))===l&&(u=l+1),t._preLoadEndPoint!==u){e.next=11;break}return e.abrupt("return");case 11:if(null!=(p=a[l])){e.next=14;break}return e.abrupt("return");case 14:return e.next=16,t._mediaLoader.cancel();case 16:t._loadData(null,[p,a[u]]),t._preLoadEndPoint=u,t._bufferService.unContiguous(s[l]);case 19:case"end":return e.stop()}}),e)})))),_defineProperty$3(_assertThisInitialized$3(t),"_onFlvScriptData",(function(e){var r,n,o,i,a=null===(r=e.data)||void 0===r||null===(n=r.onMetaData)||void 0===n?void 0:n.keyframes,s=null===(o=e.data)||void 0===o||null===(i=o.onMetaData)||void 0===i?void 0:i.duration;a&&(t._keyframes=a),!t._opts.isLive&&s&&t._bufferService.updateDuration(s)})),t._opts=getOption(e),t.media=t._opts.media||document.createElement("video"),t._opts.media=null,t._firstProgressEmit=!1,t._mediaLoader=new NetLoader(_objectSpread2$2(_objectSpread2$2({},t._opts.fetchOptions),{},{retry:t._opts.retryCount,retryDelay:t._opts.retryDelay,timeout:t._opts.loadTimeout,onRetryError:t._onRetryError,onProgress:t._onProgress,responseType:"arraybuffer"})),t._disconnectRetryCount=t._opts.disconnectRetryCount,t._transferCost=new TransferCost,t._bufferService=new BufferService(_assertThisInitialized$3(t),t._opts.softDecode?t.media:void 0,t._opts),t._seiService=new SeiService(_assertThisInitialized$3(t)),t._bandwidthService=new BandwidthService({chunkCountForSpeed:t._opts.chunkCountForSpeed,skipChunkSize:t._opts.skipChunkSize,longtimeNoReceived:t._opts.longtimeNoReceived}),t._stats=new MediaStatsService(_assertThisInitialized$3(t)),t._opts.softDecode||(t._gapService=new GapService),t.media.addEventListener("play",t._onPlay),t.media.addEventListener("loadeddata",t._onLoadeddata),t.media.addEventListener("seeking",t._onSeeking),t.media.addEventListener("timeupdate",t._onTimeupdate),t.media.addEventListener("progress",t._onBufferUpdate),t.media.addEventListener("waiting",t._onWaiting),t.on(EVENT.FLV_SCRIPT_DATA,t._onFlvScriptData),t}return _createClass$4(l,[{key:"version",get:function(){return"3.0.23-rc.6"}},{key:"isLive",get:function(){return this._opts.isLive}},{key:"baseDts",get:function(){var e;return null===(e=this._bufferService)||void 0===e?void 0:e.baseDts}},{key:"seekable",get:function(){return!!this._keyframes&&this._acceptRanges}},{key:"loader",get:function(){return this._mediaLoader}},{key:"blobUrl",get:function(){var e;return null===(e=this._bufferService)||void 0===e?void 0:e.blobUrl}},{key:"speedInfo",value:function(){return{speed:this._bandwidthService.getLatestSpeed(),avgSpeed:this._bandwidthService.getAvgSpeed(),totalSize:this._bandwidthService.getTotalSize(),totalCost:this._bandwidthService.getTotalCost()}}},{key:"getStats",value:function(){return this._stats.getStats()}},{key:"bufferInfo",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:MAX_HOLE;return Buffer$1.info(Buffer$1.get(this.media),null===(e=this.media)||void 0===e?void 0:e.currentTime,t)}},{key:"playbackQuality",value:function(){return getVideoPlaybackQuality(this.media)}},{key:"load",value:(s=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t){var r,n,o=arguments;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=o.length>1&&void 0!==o[1]&&o[1],n=o.length>2?o[2]:void 0,this._bufferService){e.next=4;break}return e.abrupt("return");case 4:return e.next=6,this._reset(r);case 6:this._loadData(t,this._opts.isLive?[]:[0,this._opts.defaultVodLoadSize],n),clearTimeout(this._tickTimer),this._tickTimer=_setTimeout(this._tick,this._tickInterval);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"replay",value:(a=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(){var t,r,n=this,o=arguments;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:this._opts.seamlesslyReload,r=o.length>1?o[1]:void 0,this.media){e.next=4;break}return e.abrupt("return");case 4:if(this._resetDisconnectCount(),!t){e.next=11;break}return e.next=8,this._clear();case 8:_setTimeout((function(){n._seamlessSwitching=!0,n._loadData(n._opts.url),n._bufferService.seamlessSwitch()})),e.next=13;break;case 11:return e.next=13,this.load();case 13:return e.abrupt("return",this.media.play(!r).catch((function(){})));case 14:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"disconnect",value:function(){var e;return logger.debug("disconnect!"),null===(e=this._bufferService)||void 0===e||e.resetSeamlessSwitchStats(),this._clear()}},{key:"switchURL",value:(i=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t,r){var n=this;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._bufferService){e.next=2;break}return e.abrupt("return");case 2:if(this._resetDisconnectCount(),!this._loading||!r){e.next=6;break}return this._bufferService.seamlessLoadingSwitch=function(){var e=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(r){return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n._clear();case 2:n._bufferService.seamlessLoadingSwitching=!0,n._urlSwitching=!0,n._seamlessSwitching=!0,n._bufferService.seamlessSwitch(),n._loadData(t);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.abrupt("return");case 6:if(r&&this._opts.isLive){e.next=11;break}return e.next=9,this.load(t);case 9:return this._urlSwitching=!0,e.abrupt("return",this.media.play(!0).catch((function(){})));case 11:return e.next=13,this._clear();case 13:_setTimeout((function(){n._urlSwitching=!0,n._seamlessSwitching=!0,n._loadData(t),n._bufferService.seamlessSwitch()}));case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"destroy",value:(o=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(){return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.media){e.next=2;break}return e.abrupt("return");case 2:return this.removeAllListeners(),this._seiService.reset(),this.media.removeEventListener("play",this._onPlay),this.media.removeEventListener("loadeddata",this._onLoadeddata),this.media.removeEventListener("seeking",this._onSeeking),this.media.removeEventListener("timeupdate",this._onTimeupdate),this.media.removeEventListener("waiting",this._onWaiting),this.media.removeEventListener("progress",this._onBufferUpdate),e.next=12,_Promise.all([this._clear(),this._bufferService.destroy()]);case 12:this.media=null,this._bufferService=null;case 14:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"_emitError",value:function(e){var t,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];logger.table(e),logger.error(e),logger.error(null===(t=this.media)||void 0===t?void 0:t.error),this._urlSwitching&&(this._urlSwitching=!1,this._seamlessSwitching=!1,this.emit(EVENT.SWITCH_URL_FAILED,e)),this.emit(EVENT.ERROR,e),r&&(this._seiService.reset(),this._end())}},{key:"_reset",value:(n=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(){var t,r=arguments;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]&&r[0],this._seiService.reset(),this._bandwidthService.reset(),this._stats.reset(),e.next=6,this._clear();case 6:return e.next=8,this._bufferService.reset(t);case 8:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"_loadData",value:(r=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t,r,n){var o;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&(this._opts.url=t),o=t=this._opts.url,t){e.next=4;break}throw new Error("Source url is missing");case 4:if(this._opts.preProcessUrl&&(o=this._opts.preProcessUrl(t).url),this._mediaLoader.finnalUrl=o,this.emit(EVENT.LOAD_START,{url:o,seamlessSwitching:this._seamlessSwitching}),logger.debug("load data, loading:",this._loading,o),!this._loading){e.next=11;break}return e.next=11,this._mediaLoader.cancel();case 11:return this._loading=!0,e.prev=12,e.next=15,this._mediaLoader.load({url:o,range:r,streamRes:n,firstMaxChunkSize:this._opts.firstMaxChunkSize});case 15:e.next=21;break;case 17:return e.prev=17,e.t0=e.catch(12),this._loading=!1,e.abrupt("return",this._emitError(StreamingError.network(e.t0),!1));case 21:case"end":return e.stop()}}),e,this,[[12,17]])}))),function(e,t,n){return r.apply(this,arguments)})},{key:"_clear",value:(t=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(){return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._mediaLoader){e.next=3;break}return e.next=3,this._mediaLoader.cancel();case 3:clearTimeout(this._maxChunkWaitTimer),clearTimeout(this._tickTimer),this._loading=!1,this._firstProgressEmit=!1;case 7:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}],[{key:"isSupported",value:function(e){return e&&"video"!==e&&"audio"!==e?"undefined"!=typeof WebAssembly:MSE.isSupported()}},{key:"enableLogger",value:function(){Logger$2.enable(),Logger$1.enable()}},{key:"disableLogger",value:function(){Logger$2.disable(),Logger$1.disable()}}]),l}();try{localStorage.getItem("xgd")?Flv.enableLogger():Flv.disableLogger()}catch(e){}var PluginExtension=function(){function e(t,r){var n=this;_classCallCheck$4(this,e),_defineProperty$3(this,"_onLowDecode",(function(){var e,t,r,o,i=n._opts,a=i.media,s=i.innerDegrade,c=i.backupURL;null===(e=n._plugin)||void 0===e||null===(t=e.player)||void 0===t||t.emit("lowdecode",a.degradeInfo),null===(r=n._plugin)||void 0===r||null===(o=r.player)||void 0===o||o.emit("core_event",_objectSpread2$2(_objectSpread2$2({},a.degradeInfo),{},{eventName:EVENT.LOWDECODE})),1!==s&&3!==s||!c||n._degrade(c)})),_defineProperty$3(this,"_degrade",(function(e){var t=n._plugin.player,r=t.video;if("MVideo"===(null==r?void 0:r.TAG)){var o=t.video.degradeVideo;t.video=o,r.degrade(e),e&&(t.config.url=e);var i=t.root.firstChild;"MVideo"===i.TAG&&t.root.replaceChild(o,i);var a=n._plugin.constructor.pluginName.toLowerCase();t.unRegisterPlugin(a),t.once("canplay",(function(){t.play()}))}})),_defineProperty$3(this,"forceDegradeToVideo",(function(e){var t=n._opts.innerDegrade;1!==t&&3!==t||n._degrade(e)})),this._opts=t,this._plugin=r,this._init()}return _createClass$4(e,[{key:"_init",value:function(){var e=this._opts,t=e.media,r=e.isLive,n=e.preloadTime,o=e.innerDegrade,i=e.decodeMode;t&&(r||!t.setPlayMode?(o&&t.setAttribute("innerdegrade",o),n&&t.setAttribute("preloadtime",n),t.setDecodeMode&&t.setDecodeMode(i),this._bindEvents()):t.setPlayMode("VOD"))}},{key:"_bindEvents",value:function(){this._opts.media.addEventListener("lowdecode",this._onLowDecode)}},{key:"destroy",value:function(){var e,t;null===(e=this._opts)||void 0===e||null===(t=e.media)||void 0===t||t.removeEventListener("lowdecode",this._onLowDecode),this._plugin=null}}]),e}(),FlvPlugin$1=function(e){_inherits$3(r,BasePlugin);var t=_createSuper$2(r);function r(){var e,n;_classCallCheck$4(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return _defineProperty$3(_assertThisInitialized$3(n=t.call.apply(t,_concatInstanceProperty(e=[this]).call(e,i))),"logger",logger),_defineProperty$3(_assertThisInitialized$3(n),"flv",null),_defineProperty$3(_assertThisInitialized$3(n),"pluginExtension",null),_defineProperty$3(_assertThisInitialized$3(n),"getStats",(function(){var e;return null===(e=n.flv)||void 0===e?void 0:e.getStats()})),_defineProperty$3(_assertThisInitialized$3(n),"loadSource",(function(){var e;arguments.length>0&&void 0!==arguments[0]||n.player.config.url;var t=arguments.length>1?arguments[1]:void 0;null===(e=n.flv)||void 0===e||e.load(n.player.config.url,!0,t)})),_defineProperty$3(_assertThisInitialized$3(n),"destroy",(function(){var e;n.flv&&(n.flv.destroy(),n.flv=null),null===(e=n.pluginExtension)||void 0===e||e.destroy(),n.pluginExtension=null})),_defineProperty$3(_assertThisInitialized$3(n),"_onSwitchURL",(function(e,t){var r,o;n.flv&&(n.player.config.url=e,"object"===_typeof$2(t)&&(t=t.seamless),n.flv.switchURL(e,t),!t&&null!==(r=n.player.config)&&void 0!==r&&null!==(o=r.flv)&&void 0!==o&&o.keepStatusAfterSwitch&&n._keepPauseStatus())})),_defineProperty$3(_assertThisInitialized$3(n),"_keepPauseStatus",(function(){n.player.paused&&n.player.once("canplay",(function(){n.player.pause()}))})),_defineProperty$3(_assertThisInitialized$3(n),"_onDefinitionChange",(function(e){var t=e.to;n.flv&&n.flv.switchURL(t)})),n}return _createClass$4(r,[{key:"core",get:function(){return this.flv}},{key:"version",get:function(){var e;return null===(e=this.flv)||void 0===e?void 0:e.version}},{key:"softDecode",get:function(){var e,t,r=null===(e=this.player)||void 0===e||null===(t=e.config)||void 0===t?void 0:t.mediaType;return!!r&&"video"!==r&&"audio"!==r&&"offscreen-video"!==r}},{key:"loader",get:function(){var e;return null===(e=this.flv)||void 0===e?void 0:e.loader}},{key:"transferCost",get:function(){return this.flv._transferCost.transferCost}},{key:"beforePlayerInit",value:function(){var e=this,t=this.player.config,r=this.player.media||this.player.video;if(t.url){this.flv&&this.flv.destroy(),this.player.switchURL=this._onSwitchURL;var n,o=t.flv||{};if(null!==o.disconnectTime&&void 0!==o.disconnectTime||(o.disconnectTime=0),this.flv=new Flv(_objectSpread2$2({softDecode:this.softDecode,isLive:t.isLive,media:r,preProcessUrl:function(t,r){var n,o;return(null===(n=e.player)||void 0===n||null===(o=n.preProcessUrl)||void 0===o?void 0:o.call(n,t,r))||{url:t,ext:r}}},o)),this.softDecode||BasePlugin.defineGetterOrSetter(this.player,{url:{get:function(){var t;return null===(t=e.flv)||void 0===t?void 0:t.blobUrl},configurable:!0}}),this.softDecode&&(this.pluginExtension=new PluginExtension(_objectSpread2$2({media:this.player.video,isLive:t.isLive},t.flv),this),this.player.forceDegradeToVideo=function(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return null===(t=e.pluginExtension)||void 0===t?void 0:t.forceDegradeToVideo.apply(t,n)}),t.isLive)null===(n=this.player)||void 0===n||n.useHooks("replay",(function(){var t;return null===(t=e.flv)||void 0===t?void 0:t.replay()}));this.on(URL_CHANGE,this._onSwitchURL),this.on(DESTROY,this.destroy),this._transError(),this._transCoreEvent(EVENT.TTFB),this._transCoreEvent(EVENT.LOAD_START),this._transCoreEvent(EVENT.LOAD_RESPONSE_HEADERS),this._transCoreEvent(EVENT.LOAD_COMPLETE),this._transCoreEvent(EVENT.LOAD_RETRY),this._transCoreEvent(EVENT.SOURCEBUFFER_CREATED),this._transCoreEvent(EVENT.ANALYZE_DURATION_EXCEEDED),this._transCoreEvent(EVENT.APPEND_BUFFER),this._transCoreEvent(EVENT.REMOVE_BUFFER),this._transCoreEvent(EVENT.BUFFEREOS),this._transCoreEvent(EVENT.KEYFRAME),this._transCoreEvent(EVENT.CHASEFRAME),this._transCoreEvent(EVENT.METADATA_PARSED),this._transCoreEvent(EVENT.SEI),this._transCoreEvent(EVENT.SEI_IN_TIME),this._transCoreEvent(EVENT.FLV_SCRIPT_DATA),this._transCoreEvent(EVENT.STREAM_EXCEPTION),this._transCoreEvent(EVENT.SWITCH_URL_SUCCESS),this._transCoreEvent(EVENT.SWITCH_URL_FAILED),o.manualLoad||this.loadSource(t.url,o.streamRes)}}},{key:"_transError",value:function(){var e=this;this.flv.on(EVENT.ERROR,(function(t){e.player&&e.player.emit(ERROR,new Errors(e.player,t))}))}},{key:"_transCoreEvent",value:function(e){var t=this;this.flv.on(e,(function(r){t.player&&t.player.emit("core_event",_objectSpread2$2(_objectSpread2$2({},r),{},{eventName:e}))}))}}],[{key:"pluginName",get:function(){return"flv"}},{key:"isSupported",value:function(e,t){return Flv.isSupported(e,t)}},{key:"isSupportedMMS",value:function(){return"undefined"!=typeof ManagedMediaSource}}]),r}();function _callSuper(e,t,r){return t=_getPrototypeOf(t),_possibleConstructorReturn(e,_isNativeReflectConstruct()?_Reflect$construct(t,r||[],_getPrototypeOf(e).constructor):t.apply(e,r))}function _isNativeReflectConstruct(){try{var e=!Boolean.prototype.valueOf.call(_Reflect$construct(Boolean,[],(function(){})))}catch(e){}return(_isNativeReflectConstruct=function(){return!!e})()}function _toPrimitive(e,t){if("object"!=_typeof$3(e)||!e)return e;var r=e[_Symbol$toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=_typeof$3(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==_typeof$3(t)?t:String(t)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),_Object$defineProperty(e,_toPropertyKey(n.key),n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),_Object$defineProperty(e,"prototype",{writable:!1}),e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=_Object$create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),_Object$defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _getPrototypeOf(e){var t;return(_getPrototypeOf=_Object$setPrototypeOf?_bindInstanceProperty(t=_Object$getPrototypeOf).call(t):function(e){return e.__proto__||_Object$getPrototypeOf(e)})(e)}function _setPrototypeOf(e,t){var r;return(_setPrototypeOf=_Object$setPrototypeOf?_bindInstanceProperty(r=_Object$setPrototypeOf).call(r):function(e,t){return e.__proto__=t,e})(e,t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof$3(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}_defineProperty$3(FlvPlugin$1,"Flv",Flv);var Adaptive=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,BasePlugin),_createClass(t,[{key:"afterCreate",value:function(){var e;this.on("timeupdate",_bindInstanceProperty(e=this.onTimeUpdate).call(e,this))}},{key:"onTimeUpdate",value:function(){var e=this.bufferLength;this.speed===this.config.hurrySpeed?e<=this.config.hurryEndMs&&(this.speed=1):1===this.speed&&e>=this.config.hurryStartMs&&(this.speed=this.config.hurrySpeed)}},{key:"bufferLength",get:function(){var e=this.player.getBufferedRange(),t=this.player.video.currentTime,r=e[1]-Math.max(e[0],t);return r=Math.round(1e3*Math.max(0,r))}},{key:"speed",get:function(){return this.player.playbackRate},set:function(e){this.speed!==e&&(this.player.playbackRate=e)}}],[{key:"pluginName",get:function(){return"adaptive"}},{key:"defaultConfig",get:function(){return{hurryEndMs:1800,hurryStartMs:2500,hurrySpeed:1.1}}}]),t}(),FlvPlugin=function(e){_inherits$4(r,FlvPlugin$1);var t=_createSuper$3(r);function r(){var e,n;_classCallCheck$5(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return _defineProperty$4(_assertThisInitialized$4(n=t.call.apply(t,_concatInstanceProperty(e=[this]).call(e,i))),"_originSwitchURL",void 0),n}return _createClass$5(r,[{key:"beforePlayerInit",value:function(){var e=this;this._originSwitchURL=this.player.switchURL;var t=this.destroy;this.destroy=function(){e.player.switchURL=e._originSwitchURL,t()},_get$1(_getPrototypeOf$4(r.prototype),"beforePlayerInit",this).call(this)}}]),r}(),DynamicModule=window.VePlayer.DynamicModule,__PLUGIN_NAME__=DynamicModule.PluginFlv;export{Adaptive,FlvPlugin,__PLUGIN_NAME__};
|
|
1
|
+
import{DynamicModule}from"@byteplus/veplayer";function _classCallCheck$5(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var defineProperty$e={exports:{}},check=function(e){return e&&e.Math==Math&&e},global$s=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof commonjsGlobal&&commonjsGlobal)||function(){return this}()||commonjsGlobal||Function("return this")(),fails$z=function(e){try{return!!e()}catch(e){return!0}},fails$y=fails$z,functionBindNative=!fails$y((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),NATIVE_BIND$4=functionBindNative,FunctionPrototype$3=Function.prototype,apply$6=FunctionPrototype$3.apply,call$A=FunctionPrototype$3.call,functionApply="object"==typeof Reflect&&Reflect.apply||(NATIVE_BIND$4?call$A.bind(apply$6):function(){return call$A.apply(apply$6,arguments)}),NATIVE_BIND$3=functionBindNative,FunctionPrototype$2=Function.prototype,call$z=FunctionPrototype$2.call,uncurryThisWithBind=NATIVE_BIND$3&&FunctionPrototype$2.bind.bind(call$z,call$z),functionUncurryThis=NATIVE_BIND$3?uncurryThisWithBind:function(e){return function(){return call$z.apply(e,arguments)}},uncurryThis$D=functionUncurryThis,toString$i=uncurryThis$D({}.toString),stringSlice$4=uncurryThis$D("".slice),classofRaw$2=function(e){return stringSlice$4(toString$i(e),8,-1)},classofRaw$1=classofRaw$2,uncurryThis$C=functionUncurryThis,functionUncurryThisClause=function(e){if("Function"===classofRaw$1(e))return uncurryThis$C(e)},documentAll$2="object"==typeof document&&document.all,IS_HTMLDDA=void 0===documentAll$2&&void 0!==documentAll$2,documentAll_1={all:documentAll$2,IS_HTMLDDA:IS_HTMLDDA},$documentAll$1=documentAll_1,documentAll$1=$documentAll$1.all,isCallable$r=$documentAll$1.IS_HTMLDDA?function(e){return"function"==typeof e||e===documentAll$1}:function(e){return"function"==typeof e},objectGetOwnPropertyDescriptor={},fails$x=fails$z,descriptors=!fails$x((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),NATIVE_BIND$2=functionBindNative,call$y=Function.prototype.call,functionCall=NATIVE_BIND$2?call$y.bind(call$y):function(){return call$y.apply(call$y,arguments)},objectPropertyIsEnumerable={},$propertyIsEnumerable$1={}.propertyIsEnumerable,getOwnPropertyDescriptor$b=Object.getOwnPropertyDescriptor,NASHORN_BUG=getOwnPropertyDescriptor$b&&!$propertyIsEnumerable$1.call({1:2},1);objectPropertyIsEnumerable.f=NASHORN_BUG?function(e){var t=getOwnPropertyDescriptor$b(this,e);return!!t&&t.enumerable}:$propertyIsEnumerable$1;var match,version$1,createPropertyDescriptor$8=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},uncurryThis$B=functionUncurryThis,fails$w=fails$z,classof$g=classofRaw$2,$Object$5=Object,split$3=uncurryThis$B("".split),indexedObject=fails$w((function(){return!$Object$5("z").propertyIsEnumerable(0)}))?function(e){return"String"==classof$g(e)?split$3(e,""):$Object$5(e)}:$Object$5,isNullOrUndefined$7=function(e){return null==e},isNullOrUndefined$6=isNullOrUndefined$7,$TypeError$m=TypeError,requireObjectCoercible$7=function(e){if(isNullOrUndefined$6(e))throw $TypeError$m("Can't call method on "+e);return e},IndexedObject$3=indexedObject,requireObjectCoercible$6=requireObjectCoercible$7,toIndexedObject$a=function(e){return IndexedObject$3(requireObjectCoercible$6(e))},isCallable$q=isCallable$r,$documentAll=documentAll_1,documentAll=$documentAll.all,isObject$m=$documentAll.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:isCallable$q(e)||e===documentAll}:function(e){return"object"==typeof e?null!==e:isCallable$q(e)},path$w={},path$v=path$w,global$r=global$s,isCallable$p=isCallable$r,aFunction=function(e){return isCallable$p(e)?e:void 0},getBuiltIn$j=function(e,t){return arguments.length<2?aFunction(path$v[e])||aFunction(global$r[e]):path$v[e]&&path$v[e][t]||global$r[e]&&global$r[e][t]},uncurryThis$A=functionUncurryThis,objectIsPrototypeOf=uncurryThis$A({}.isPrototypeOf),engineUserAgent="undefined"!=typeof navigator&&String(navigator.userAgent)||"",global$q=global$s,userAgent$6=engineUserAgent,process$4=global$q.process,Deno$1=global$q.Deno,versions=process$4&&process$4.versions||Deno$1&&Deno$1.version,v8=versions&&versions.v8;v8&&(version$1=(match=v8.split("."))[0]>0&&match[0]<4?1:+(match[0]+match[1])),!version$1&&userAgent$6&&(!(match=userAgent$6.match(/Edge\/(\d+)/))||match[1]>=74)&&(match=userAgent$6.match(/Chrome\/(\d+)/))&&(version$1=+match[1]);var engineV8Version=version$1,V8_VERSION$3=engineV8Version,fails$v=fails$z,global$p=global$s,$String$5=global$p.String,symbolConstructorDetection=!!Object.getOwnPropertySymbols&&!fails$v((function(){var e=Symbol();return!$String$5(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&V8_VERSION$3&&V8_VERSION$3<41})),NATIVE_SYMBOL$5=symbolConstructorDetection,useSymbolAsUid=NATIVE_SYMBOL$5&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,getBuiltIn$i=getBuiltIn$j,isCallable$o=isCallable$r,isPrototypeOf$p=objectIsPrototypeOf,USE_SYMBOL_AS_UID$1=useSymbolAsUid,$Object$4=Object,isSymbol$5=USE_SYMBOL_AS_UID$1?function(e){return"symbol"==typeof e}:function(e){var t=getBuiltIn$i("Symbol");return isCallable$o(t)&&isPrototypeOf$p(t.prototype,$Object$4(e))},$String$4=String,tryToString$8=function(e){try{return $String$4(e)}catch(e){return"Object"}},isCallable$n=isCallable$r,tryToString$7=tryToString$8,$TypeError$l=TypeError,aCallable$l=function(e){if(isCallable$n(e))return e;throw $TypeError$l(tryToString$7(e)+" is not a function")},aCallable$k=aCallable$l,isNullOrUndefined$5=isNullOrUndefined$7,getMethod$3=function(e,t){var r=e[t];return isNullOrUndefined$5(r)?void 0:aCallable$k(r)},call$x=functionCall,isCallable$m=isCallable$r,isObject$l=isObject$m,$TypeError$k=TypeError,ordinaryToPrimitive$1=function(e,t){var r,n;if("string"===t&&isCallable$m(r=e.toString)&&!isObject$l(n=call$x(r,e)))return n;if(isCallable$m(r=e.valueOf)&&!isObject$l(n=call$x(r,e)))return n;if("string"!==t&&isCallable$m(r=e.toString)&&!isObject$l(n=call$x(r,e)))return n;throw $TypeError$k("Can't convert object to primitive value")},shared$7={exports:{}},isPure=!0,global$o=global$s,defineProperty$d=Object.defineProperty,defineGlobalProperty$1=function(e,t){try{defineProperty$d(global$o,e,{value:t,configurable:!0,writable:!0})}catch(r){global$o[e]=t}return t},global$n=global$s,defineGlobalProperty=defineGlobalProperty$1,SHARED="__core-js_shared__",store$3=global$n[SHARED]||defineGlobalProperty(SHARED,{}),sharedStore=store$3,store$2=sharedStore;(shared$7.exports=function(e,t){return store$2[e]||(store$2[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.30.2",mode:"pure",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.2/LICENSE",source:"https://github.com/zloirock/core-js"});var sharedExports=shared$7.exports,requireObjectCoercible$5=requireObjectCoercible$7,$Object$3=Object,toObject$c=function(e){return $Object$3(requireObjectCoercible$5(e))},uncurryThis$z=functionUncurryThis,toObject$b=toObject$c,hasOwnProperty=uncurryThis$z({}.hasOwnProperty),hasOwnProperty_1=Object.hasOwn||function(e,t){return hasOwnProperty(toObject$b(e),t)},uncurryThis$y=functionUncurryThis,id$1=0,postfix=Math.random(),toString$h=uncurryThis$y(1..toString),uid$4=function(e){return"Symbol("+(void 0===e?"":e)+")_"+toString$h(++id$1+postfix,36)},global$m=global$s,shared$6=sharedExports,hasOwn$m=hasOwnProperty_1,uid$3=uid$4,NATIVE_SYMBOL$4=symbolConstructorDetection,USE_SYMBOL_AS_UID=useSymbolAsUid,Symbol$5=global$m.Symbol,WellKnownSymbolsStore$2=shared$6("wks"),createWellKnownSymbol=USE_SYMBOL_AS_UID?Symbol$5.for||Symbol$5:Symbol$5&&Symbol$5.withoutSetter||uid$3,wellKnownSymbol$r=function(e){return hasOwn$m(WellKnownSymbolsStore$2,e)||(WellKnownSymbolsStore$2[e]=NATIVE_SYMBOL$4&&hasOwn$m(Symbol$5,e)?Symbol$5[e]:createWellKnownSymbol("Symbol."+e)),WellKnownSymbolsStore$2[e]},call$w=functionCall,isObject$k=isObject$m,isSymbol$4=isSymbol$5,getMethod$2=getMethod$3,ordinaryToPrimitive=ordinaryToPrimitive$1,wellKnownSymbol$q=wellKnownSymbol$r,$TypeError$j=TypeError,TO_PRIMITIVE=wellKnownSymbol$q("toPrimitive"),toPrimitive$7=function(e,t){if(!isObject$k(e)||isSymbol$4(e))return e;var r,n=getMethod$2(e,TO_PRIMITIVE);if(n){if(void 0===t&&(t="default"),r=call$w(n,e,t),!isObject$k(r)||isSymbol$4(r))return r;throw $TypeError$j("Can't convert object to primitive value")}return void 0===t&&(t="number"),ordinaryToPrimitive(e,t)},toPrimitive$6=toPrimitive$7,isSymbol$3=isSymbol$5,toPropertyKey$4=function(e){var t=toPrimitive$6(e,"string");return isSymbol$3(t)?t:t+""},global$l=global$s,isObject$j=isObject$m,document$3=global$l.document,EXISTS$1=isObject$j(document$3)&&isObject$j(document$3.createElement),documentCreateElement$1=function(e){return EXISTS$1?document$3.createElement(e):{}},DESCRIPTORS$k=descriptors,fails$u=fails$z,createElement$1=documentCreateElement$1,ie8DomDefine=!DESCRIPTORS$k&&!fails$u((function(){return 7!=Object.defineProperty(createElement$1("div"),"a",{get:function(){return 7}}).a})),DESCRIPTORS$j=descriptors,call$v=functionCall,propertyIsEnumerableModule$2=objectPropertyIsEnumerable,createPropertyDescriptor$7=createPropertyDescriptor$8,toIndexedObject$9=toIndexedObject$a,toPropertyKey$3=toPropertyKey$4,hasOwn$l=hasOwnProperty_1,IE8_DOM_DEFINE$1=ie8DomDefine,$getOwnPropertyDescriptor$2=Object.getOwnPropertyDescriptor;objectGetOwnPropertyDescriptor.f=DESCRIPTORS$j?$getOwnPropertyDescriptor$2:function(e,t){if(e=toIndexedObject$9(e),t=toPropertyKey$3(t),IE8_DOM_DEFINE$1)try{return $getOwnPropertyDescriptor$2(e,t)}catch(e){}if(hasOwn$l(e,t))return createPropertyDescriptor$7(!call$v(propertyIsEnumerableModule$2.f,e,t),e[t])};var fails$t=fails$z,isCallable$l=isCallable$r,replacement=/#|\.prototype\./,isForced$2=function(e,t){var r=data[normalize(e)];return r==POLYFILL||r!=NATIVE&&(isCallable$l(t)?fails$t(t):!!t)},normalize=isForced$2.normalize=function(e){return String(e).replace(replacement,".").toLowerCase()},data=isForced$2.data={},NATIVE=isForced$2.NATIVE="N",POLYFILL=isForced$2.POLYFILL="P",isForced_1=isForced$2,uncurryThis$x=functionUncurryThisClause,aCallable$j=aCallable$l,NATIVE_BIND$1=functionBindNative,bind$w=functionUncurryThisClause(functionUncurryThisClause.bind),functionBindContext=function(e,t){return aCallable$j(e),void 0===t?e:NATIVE_BIND$1?bind$w(e,t):function(){return e.apply(t,arguments)}},objectDefineProperty={},DESCRIPTORS$i=descriptors,fails$s=fails$z,v8PrototypeDefineBug=DESCRIPTORS$i&&fails$s((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),isObject$i=isObject$m,$String$3=String,$TypeError$i=TypeError,anObject$i=function(e){if(isObject$i(e))return e;throw $TypeError$i($String$3(e)+" is not an object")},DESCRIPTORS$h=descriptors,IE8_DOM_DEFINE=ie8DomDefine,V8_PROTOTYPE_DEFINE_BUG$1=v8PrototypeDefineBug,anObject$h=anObject$i,toPropertyKey$2=toPropertyKey$4,$TypeError$h=TypeError,$defineProperty$1=Object.defineProperty,$getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor,ENUMERABLE="enumerable",CONFIGURABLE$1="configurable",WRITABLE="writable";objectDefineProperty.f=DESCRIPTORS$h?V8_PROTOTYPE_DEFINE_BUG$1?function(e,t,r){if(anObject$h(e),t=toPropertyKey$2(t),anObject$h(r),"function"==typeof e&&"prototype"===t&&"value"in r&&WRITABLE in r&&!r[WRITABLE]){var n=$getOwnPropertyDescriptor$1(e,t);n&&n[WRITABLE]&&(e[t]=r.value,r={configurable:CONFIGURABLE$1 in r?r[CONFIGURABLE$1]:n[CONFIGURABLE$1],enumerable:ENUMERABLE in r?r[ENUMERABLE]:n[ENUMERABLE],writable:!1})}return $defineProperty$1(e,t,r)}:$defineProperty$1:function(e,t,r){if(anObject$h(e),t=toPropertyKey$2(t),anObject$h(r),IE8_DOM_DEFINE)try{return $defineProperty$1(e,t,r)}catch(e){}if("get"in r||"set"in r)throw $TypeError$h("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var DESCRIPTORS$g=descriptors,definePropertyModule$4=objectDefineProperty,createPropertyDescriptor$6=createPropertyDescriptor$8,createNonEnumerableProperty$9=DESCRIPTORS$g?function(e,t,r){return definePropertyModule$4.f(e,t,createPropertyDescriptor$6(1,r))}:function(e,t,r){return e[t]=r,e},global$k=global$s,apply$5=functionApply,uncurryThis$w=functionUncurryThisClause,isCallable$k=isCallable$r,getOwnPropertyDescriptor$a=objectGetOwnPropertyDescriptor.f,isForced$1=isForced_1,path$u=path$w,bind$v=functionBindContext,createNonEnumerableProperty$8=createNonEnumerableProperty$9,hasOwn$k=hasOwnProperty_1,wrapConstructor=function(e){var t=function(r,n,o){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,o)}return apply$5(e,this,arguments)};return t.prototype=e.prototype,t},_export=function(e,t){var r,n,o,i,a,s,c,l,u,p=e.target,$=e.global,f=e.stat,d=e.proto,y=$?global$k:f?global$k[p]:(global$k[p]||{}).prototype,h=$?path$u:path$u[p]||createNonEnumerableProperty$8(path$u,p,{})[p],_=h.prototype;for(i in t)n=!(r=isForced$1($?i:p+(f?".":"#")+i,e.forced))&&y&&hasOwn$k(y,i),s=h[i],n&&(c=e.dontCallGetSet?(u=getOwnPropertyDescriptor$a(y,i))&&u.value:y[i]),a=n&&c?c:t[i],n&&typeof s==typeof a||(l=e.bind&&n?bind$v(a,global$k):e.wrap&&n?wrapConstructor(a):d&&isCallable$k(a)?uncurryThis$w(a):a,(e.sham||a&&a.sham||s&&s.sham)&&createNonEnumerableProperty$8(l,"sham",!0),createNonEnumerableProperty$8(h,i,l),d&&(hasOwn$k(path$u,o=p+"Prototype")||createNonEnumerableProperty$8(path$u,o,{}),createNonEnumerableProperty$8(path$u[o],i,a),e.real&&_&&(r||!_[i])&&createNonEnumerableProperty$8(_,i,a)))},$$1I=_export,DESCRIPTORS$f=descriptors,defineProperty$c=objectDefineProperty.f;$$1I({target:"Object",stat:!0,forced:Object.defineProperty!==defineProperty$c,sham:!DESCRIPTORS$f},{defineProperty:defineProperty$c});var path$t=path$w,Object$4=path$t.Object,defineProperty$b=defineProperty$e.exports=function(e,t,r){return Object$4.defineProperty(e,t,r)};Object$4.defineProperty.sham&&(defineProperty$b.sham=!0);var definePropertyExports=defineProperty$e.exports,parent$2m=definePropertyExports,defineProperty$a=parent$2m,parent$2l=defineProperty$a,defineProperty$9=parent$2l,parent$2k=defineProperty$9,defineProperty$8=parent$2k,defineProperty$7=defineProperty$8,_Object$defineProperty$1=getDefaultExportFromCjs(defineProperty$7),classof$f=classofRaw$2,isArray$d=Array.isArray||function(e){return"Array"==classof$f(e)},ceil$1=Math.ceil,floor$3=Math.floor,mathTrunc=Math.trunc||function(e){var t=+e;return(t>0?floor$3:ceil$1)(t)},trunc2=mathTrunc,toIntegerOrInfinity$6=function(e){var t=+e;return t!=t||0===t?0:trunc2(t)},toIntegerOrInfinity$5=toIntegerOrInfinity$6,min$2=Math.min,toLength$2=function(e){return e>0?min$2(toIntegerOrInfinity$5(e),9007199254740991):0},toLength$1=toLength$2,lengthOfArrayLike$a=function(e){return toLength$1(e.length)},$TypeError$g=TypeError,MAX_SAFE_INTEGER=9007199254740991,doesNotExceedSafeInteger$2=function(e){if(e>MAX_SAFE_INTEGER)throw $TypeError$g("Maximum allowed index exceeded");return e},toPropertyKey$1=toPropertyKey$4,definePropertyModule$3=objectDefineProperty,createPropertyDescriptor$5=createPropertyDescriptor$8,createProperty$6=function(e,t,r){var n=toPropertyKey$1(t);n in e?definePropertyModule$3.f(e,n,createPropertyDescriptor$5(0,r)):e[n]=r},wellKnownSymbol$p=wellKnownSymbol$r,TO_STRING_TAG$4=wellKnownSymbol$p("toStringTag"),test$2={};test$2[TO_STRING_TAG$4]="z";var toStringTagSupport="[object z]"===String(test$2),TO_STRING_TAG_SUPPORT$2=toStringTagSupport,isCallable$j=isCallable$r,classofRaw=classofRaw$2,wellKnownSymbol$o=wellKnownSymbol$r,TO_STRING_TAG$3=wellKnownSymbol$o("toStringTag"),$Object$2=Object,CORRECT_ARGUMENTS="Arguments"==classofRaw(function(){return arguments}()),tryGet=function(e,t){try{return e[t]}catch(e){}},classof$e=TO_STRING_TAG_SUPPORT$2?classofRaw:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=tryGet(t=$Object$2(e),TO_STRING_TAG$3))?r:CORRECT_ARGUMENTS?classofRaw(t):"Object"==(n=classofRaw(t))&&isCallable$j(t.callee)?"Arguments":n},uncurryThis$v=functionUncurryThis,isCallable$i=isCallable$r,store$1=sharedStore,functionToString=uncurryThis$v(Function.toString);isCallable$i(store$1.inspectSource)||(store$1.inspectSource=function(e){return functionToString(e)});var inspectSource$2=store$1.inspectSource,uncurryThis$u=functionUncurryThis,fails$r=fails$z,isCallable$h=isCallable$r,classof$d=classof$e,getBuiltIn$h=getBuiltIn$j,inspectSource$1=inspectSource$2,noop=function(){},empty=[],construct$7=getBuiltIn$h("Reflect","construct"),constructorRegExp=/^\s*(?:class|function)\b/,exec$4=uncurryThis$u(constructorRegExp.exec),INCORRECT_TO_STRING=!constructorRegExp.exec(noop),isConstructorModern=function(e){if(!isCallable$h(e))return!1;try{return construct$7(noop,empty,e),!0}catch(e){return!1}},isConstructorLegacy=function(e){if(!isCallable$h(e))return!1;switch(classof$d(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return INCORRECT_TO_STRING||!!exec$4(constructorRegExp,inspectSource$1(e))}catch(e){return!0}};isConstructorLegacy.sham=!0;var isConstructor$4=!construct$7||fails$r((function(){var e;return isConstructorModern(isConstructorModern.call)||!isConstructorModern(Object)||!isConstructorModern((function(){e=!0}))||e}))?isConstructorLegacy:isConstructorModern,isArray$c=isArray$d,isConstructor$3=isConstructor$4,isObject$h=isObject$m,wellKnownSymbol$n=wellKnownSymbol$r,SPECIES$5=wellKnownSymbol$n("species"),$Array$3=Array,arraySpeciesConstructor$1=function(e){var t;return isArray$c(e)&&(t=e.constructor,(isConstructor$3(t)&&(t===$Array$3||isArray$c(t.prototype))||isObject$h(t)&&null===(t=t[SPECIES$5]))&&(t=void 0)),void 0===t?$Array$3:t},arraySpeciesConstructor=arraySpeciesConstructor$1,arraySpeciesCreate$3=function(e,t){return new(arraySpeciesConstructor(e))(0===t?0:t)},fails$q=fails$z,wellKnownSymbol$m=wellKnownSymbol$r,V8_VERSION$2=engineV8Version,SPECIES$4=wellKnownSymbol$m("species"),arrayMethodHasSpeciesSupport$5=function(e){return V8_VERSION$2>=51||!fails$q((function(){var t=[];return(t.constructor={})[SPECIES$4]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},$$1H=_export,fails$p=fails$z,isArray$b=isArray$d,isObject$g=isObject$m,toObject$a=toObject$c,lengthOfArrayLike$9=lengthOfArrayLike$a,doesNotExceedSafeInteger$1=doesNotExceedSafeInteger$2,createProperty$5=createProperty$6,arraySpeciesCreate$2=arraySpeciesCreate$3,arrayMethodHasSpeciesSupport$4=arrayMethodHasSpeciesSupport$5,wellKnownSymbol$l=wellKnownSymbol$r,V8_VERSION$1=engineV8Version,IS_CONCAT_SPREADABLE=wellKnownSymbol$l("isConcatSpreadable"),IS_CONCAT_SPREADABLE_SUPPORT=V8_VERSION$1>=51||!fails$p((function(){var e=[];return e[IS_CONCAT_SPREADABLE]=!1,e.concat()[0]!==e})),isConcatSpreadable=function(e){if(!isObject$g(e))return!1;var t=e[IS_CONCAT_SPREADABLE];return void 0!==t?!!t:isArray$b(e)},FORCED$8=!IS_CONCAT_SPREADABLE_SUPPORT||!arrayMethodHasSpeciesSupport$4("concat");$$1H({target:"Array",proto:!0,arity:1,forced:FORCED$8},{concat:function(e){var t,r,n,o,i,a=toObject$a(this),s=arraySpeciesCreate$2(a,0),c=0;for(t=-1,n=arguments.length;t<n;t++)if(isConcatSpreadable(i=-1===t?a:arguments[t]))for(o=lengthOfArrayLike$9(i),doesNotExceedSafeInteger$1(c+o),r=0;r<o;r++,c++)r in i&&createProperty$5(s,c,i[r]);else doesNotExceedSafeInteger$1(c+1),createProperty$5(s,c++,i);return s.length=c,s}});var classof$c=classof$e,$String$2=String,toString$g=function(e){if("Symbol"===classof$c(e))throw TypeError("Cannot convert a Symbol value to a string");return $String$2(e)},objectDefineProperties={},toIntegerOrInfinity$4=toIntegerOrInfinity$6,max$4=Math.max,min$1=Math.min,toAbsoluteIndex$5=function(e,t){var r=toIntegerOrInfinity$4(e);return r<0?max$4(r+t,0):min$1(r,t)},toIndexedObject$8=toIndexedObject$a,toAbsoluteIndex$4=toAbsoluteIndex$5,lengthOfArrayLike$8=lengthOfArrayLike$a,createMethod$5=function(e){return function(t,r,n){var o,i=toIndexedObject$8(t),a=lengthOfArrayLike$8(i),s=toAbsoluteIndex$4(n,a);if(e&&r!=r){for(;a>s;)if((o=i[s++])!=o)return!0}else for(;a>s;s++)if((e||s in i)&&i[s]===r)return e||s||0;return!e&&-1}},arrayIncludes={includes:createMethod$5(!0),indexOf:createMethod$5(!1)},hiddenKeys$6={},uncurryThis$t=functionUncurryThis,hasOwn$j=hasOwnProperty_1,toIndexedObject$7=toIndexedObject$a,indexOf$7=arrayIncludes.indexOf,hiddenKeys$5=hiddenKeys$6,push$c=uncurryThis$t([].push),objectKeysInternal=function(e,t){var r,n=toIndexedObject$7(e),o=0,i=[];for(r in n)!hasOwn$j(hiddenKeys$5,r)&&hasOwn$j(n,r)&&push$c(i,r);for(;t.length>o;)hasOwn$j(n,r=t[o++])&&(~indexOf$7(i,r)||push$c(i,r));return i},enumBugKeys$3=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],internalObjectKeys$1=objectKeysInternal,enumBugKeys$2=enumBugKeys$3,objectKeys$3=Object.keys||function(e){return internalObjectKeys$1(e,enumBugKeys$2)},DESCRIPTORS$e=descriptors,V8_PROTOTYPE_DEFINE_BUG=v8PrototypeDefineBug,definePropertyModule$2=objectDefineProperty,anObject$g=anObject$i,toIndexedObject$6=toIndexedObject$a,objectKeys$2=objectKeys$3;objectDefineProperties.f=DESCRIPTORS$e&&!V8_PROTOTYPE_DEFINE_BUG?Object.defineProperties:function(e,t){anObject$g(e);for(var r,n=toIndexedObject$6(t),o=objectKeys$2(t),i=o.length,a=0;i>a;)definePropertyModule$2.f(e,r=o[a++],n[r]);return e};var activeXDocument,getBuiltIn$g=getBuiltIn$j,html$2=getBuiltIn$g("document","documentElement"),shared$5=sharedExports,uid$2=uid$4,keys$6=shared$5("keys"),sharedKey$4=function(e){return keys$6[e]||(keys$6[e]=uid$2(e))},anObject$f=anObject$i,definePropertiesModule$1=objectDefineProperties,enumBugKeys$1=enumBugKeys$3,hiddenKeys$4=hiddenKeys$6,html$1=html$2,documentCreateElement=documentCreateElement$1,sharedKey$3=sharedKey$4,GT=">",LT="<",PROTOTYPE$1="prototype",SCRIPT="script",IE_PROTO$1=sharedKey$3("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return LT+SCRIPT+GT+e+LT+"/"+SCRIPT+GT},NullProtoObjectViaActiveX=function(e){e.write(scriptTag("")),e.close();var t=e.parentWindow.Object;return e=null,t},NullProtoObjectViaIFrame=function(){var e,t=documentCreateElement("iframe"),r="java"+SCRIPT+":";return t.style.display="none",html$1.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(scriptTag("document.F=Object")),e.close(),e.F},NullProtoObject=function(){try{activeXDocument=new ActiveXObject("htmlfile")}catch(e){}NullProtoObject="undefined"!=typeof document?document.domain&&activeXDocument?NullProtoObjectViaActiveX(activeXDocument):NullProtoObjectViaIFrame():NullProtoObjectViaActiveX(activeXDocument);for(var e=enumBugKeys$1.length;e--;)delete NullProtoObject[PROTOTYPE$1][enumBugKeys$1[e]];return NullProtoObject()};hiddenKeys$4[IE_PROTO$1]=!0;var objectCreate=Object.create||function(e,t){var r;return null!==e?(EmptyConstructor[PROTOTYPE$1]=anObject$f(e),r=new EmptyConstructor,EmptyConstructor[PROTOTYPE$1]=null,r[IE_PROTO$1]=e):r=NullProtoObject(),void 0===t?r:definePropertiesModule$1.f(r,t)},objectGetOwnPropertyNames={},internalObjectKeys=objectKeysInternal,enumBugKeys=enumBugKeys$3,hiddenKeys$3=enumBugKeys.concat("length","prototype");objectGetOwnPropertyNames.f=Object.getOwnPropertyNames||function(e){return internalObjectKeys(e,hiddenKeys$3)};var objectGetOwnPropertyNamesExternal={},toAbsoluteIndex$3=toAbsoluteIndex$5,lengthOfArrayLike$7=lengthOfArrayLike$a,createProperty$4=createProperty$6,$Array$2=Array,max$3=Math.max,arraySliceSimple=function(e,t,r){for(var n=lengthOfArrayLike$7(e),o=toAbsoluteIndex$3(t,n),i=toAbsoluteIndex$3(void 0===r?n:r,n),a=$Array$2(max$3(i-o,0)),s=0;o<i;o++,s++)createProperty$4(a,s,e[o]);return a.length=s,a},classof$b=classofRaw$2,toIndexedObject$5=toIndexedObject$a,$getOwnPropertyNames$1=objectGetOwnPropertyNames.f,arraySlice$8=arraySliceSimple,windowNames="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],getWindowNames=function(e){try{return $getOwnPropertyNames$1(e)}catch(e){return arraySlice$8(windowNames)}};objectGetOwnPropertyNamesExternal.f=function(e){return windowNames&&"Window"==classof$b(e)?getWindowNames(e):$getOwnPropertyNames$1(toIndexedObject$5(e))};var objectGetOwnPropertySymbols={};objectGetOwnPropertySymbols.f=Object.getOwnPropertySymbols;var createNonEnumerableProperty$7=createNonEnumerableProperty$9,defineBuiltIn$8=function(e,t,r,n){return n&&n.enumerable?e[t]=r:createNonEnumerableProperty$7(e,t,r),e},defineProperty$6=objectDefineProperty,defineBuiltInAccessor$5=function(e,t,r){return defineProperty$6.f(e,t,r)},wellKnownSymbolWrapped={},wellKnownSymbol$k=wellKnownSymbol$r;wellKnownSymbolWrapped.f=wellKnownSymbol$k;var set$d,get$9,has$7,path$s=path$w,hasOwn$i=hasOwnProperty_1,wrappedWellKnownSymbolModule$1=wellKnownSymbolWrapped,defineProperty$5=objectDefineProperty.f,wellKnownSymbolDefine=function(e){var t=path$s.Symbol||(path$s.Symbol={});hasOwn$i(t,e)||defineProperty$5(t,e,{value:wrappedWellKnownSymbolModule$1.f(e)})},call$u=functionCall,getBuiltIn$f=getBuiltIn$j,wellKnownSymbol$j=wellKnownSymbol$r,defineBuiltIn$7=defineBuiltIn$8,symbolDefineToPrimitive=function(){var e=getBuiltIn$f("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,n=wellKnownSymbol$j("toPrimitive");t&&!t[n]&&defineBuiltIn$7(t,n,(function(e){return call$u(r,this)}),{arity:1})},TO_STRING_TAG_SUPPORT$1=toStringTagSupport,classof$a=classof$e,objectToString=TO_STRING_TAG_SUPPORT$1?{}.toString:function(){return"[object "+classof$a(this)+"]"},TO_STRING_TAG_SUPPORT=toStringTagSupport,defineProperty$4=objectDefineProperty.f,createNonEnumerableProperty$6=createNonEnumerableProperty$9,hasOwn$h=hasOwnProperty_1,toString$f=objectToString,wellKnownSymbol$i=wellKnownSymbol$r,TO_STRING_TAG$2=wellKnownSymbol$i("toStringTag"),setToStringTag$9=function(e,t,r,n){if(e){var o=r?e:e.prototype;hasOwn$h(o,TO_STRING_TAG$2)||defineProperty$4(o,TO_STRING_TAG$2,{configurable:!0,value:t}),n&&!TO_STRING_TAG_SUPPORT&&createNonEnumerableProperty$6(o,"toString",toString$f)}},global$j=global$s,isCallable$g=isCallable$r,WeakMap$1=global$j.WeakMap,weakMapBasicDetection=isCallable$g(WeakMap$1)&&/native code/.test(String(WeakMap$1)),NATIVE_WEAK_MAP=weakMapBasicDetection,global$i=global$s,isObject$f=isObject$m,createNonEnumerableProperty$5=createNonEnumerableProperty$9,hasOwn$g=hasOwnProperty_1,shared$4=sharedStore,sharedKey$2=sharedKey$4,hiddenKeys$2=hiddenKeys$6,OBJECT_ALREADY_INITIALIZED="Object already initialized",TypeError$5=global$i.TypeError,WeakMap=global$i.WeakMap,enforce=function(e){return has$7(e)?get$9(e):set$d(e,{})},getterFor=function(e){return function(t){var r;if(!isObject$f(t)||(r=get$9(t)).type!==e)throw TypeError$5("Incompatible receiver, "+e+" required");return r}};if(NATIVE_WEAK_MAP||shared$4.state){var store=shared$4.state||(shared$4.state=new WeakMap);store.get=store.get,store.has=store.has,store.set=store.set,set$d=function(e,t){if(store.has(e))throw TypeError$5(OBJECT_ALREADY_INITIALIZED);return t.facade=e,store.set(e,t),t},get$9=function(e){return store.get(e)||{}},has$7=function(e){return store.has(e)}}else{var STATE=sharedKey$2("state");hiddenKeys$2[STATE]=!0,set$d=function(e,t){if(hasOwn$g(e,STATE))throw TypeError$5(OBJECT_ALREADY_INITIALIZED);return t.facade=e,createNonEnumerableProperty$5(e,STATE,t),t},get$9=function(e){return hasOwn$g(e,STATE)?e[STATE]:{}},has$7=function(e){return hasOwn$g(e,STATE)}}var internalState={set:set$d,get:get$9,has:has$7,enforce:enforce,getterFor:getterFor},bind$u=functionBindContext,uncurryThis$s=functionUncurryThis,IndexedObject$2=indexedObject,toObject$9=toObject$c,lengthOfArrayLike$6=lengthOfArrayLike$a,arraySpeciesCreate$1=arraySpeciesCreate$3,push$b=uncurryThis$s([].push),createMethod$4=function(e){var t=1==e,r=2==e,n=3==e,o=4==e,i=6==e,a=7==e,s=5==e||i;return function(c,l,u,p){for(var $,f,d=toObject$9(c),y=IndexedObject$2(d),h=bind$u(l,u),_=lengthOfArrayLike$6(y),g=0,m=p||arraySpeciesCreate$1,v=t?m(c,_):r||a?m(c,0):void 0;_>g;g++)if((s||g in y)&&(f=h($=y[g],g,d),e))if(t)v[g]=f;else if(f)switch(e){case 3:return!0;case 5:return $;case 6:return g;case 2:push$b(v,$)}else switch(e){case 4:return!1;case 7:push$b(v,$)}return i?-1:n||o?o:v}},arrayIteration={forEach:createMethod$4(0),map:createMethod$4(1),filter:createMethod$4(2),some:createMethod$4(3),every:createMethod$4(4),find:createMethod$4(5),findIndex:createMethod$4(6),filterReject:createMethod$4(7)},$$1G=_export,global$h=global$s,call$t=functionCall,uncurryThis$r=functionUncurryThis,DESCRIPTORS$d=descriptors,NATIVE_SYMBOL$3=symbolConstructorDetection,fails$o=fails$z,hasOwn$f=hasOwnProperty_1,isPrototypeOf$o=objectIsPrototypeOf,anObject$e=anObject$i,toIndexedObject$4=toIndexedObject$a,toPropertyKey=toPropertyKey$4,$toString$2=toString$g,createPropertyDescriptor$4=createPropertyDescriptor$8,nativeObjectCreate=objectCreate,objectKeys$1=objectKeys$3,getOwnPropertyNamesModule$2=objectGetOwnPropertyNames,getOwnPropertyNamesExternal=objectGetOwnPropertyNamesExternal,getOwnPropertySymbolsModule$3=objectGetOwnPropertySymbols,getOwnPropertyDescriptorModule$3=objectGetOwnPropertyDescriptor,definePropertyModule$1=objectDefineProperty,definePropertiesModule=objectDefineProperties,propertyIsEnumerableModule$1=objectPropertyIsEnumerable,defineBuiltIn$6=defineBuiltIn$8,defineBuiltInAccessor$4=defineBuiltInAccessor$5,shared$3=sharedExports,sharedKey$1=sharedKey$4,hiddenKeys$1=hiddenKeys$6,uid$1=uid$4,wellKnownSymbol$h=wellKnownSymbol$r,wrappedWellKnownSymbolModule=wellKnownSymbolWrapped,defineWellKnownSymbol$l=wellKnownSymbolDefine,defineSymbolToPrimitive$1=symbolDefineToPrimitive,setToStringTag$8=setToStringTag$9,InternalStateModule$7=internalState,$forEach$1=arrayIteration.forEach,HIDDEN=sharedKey$1("hidden"),SYMBOL="Symbol",PROTOTYPE="prototype",setInternalState$7=InternalStateModule$7.set,getInternalState$2=InternalStateModule$7.getterFor(SYMBOL),ObjectPrototype$2=Object[PROTOTYPE],$Symbol=global$h.Symbol,SymbolPrototype=$Symbol&&$Symbol[PROTOTYPE],TypeError$4=global$h.TypeError,QObject=global$h.QObject,nativeGetOwnPropertyDescriptor$1=getOwnPropertyDescriptorModule$3.f,nativeDefineProperty=definePropertyModule$1.f,nativeGetOwnPropertyNames=getOwnPropertyNamesExternal.f,nativePropertyIsEnumerable=propertyIsEnumerableModule$1.f,push$a=uncurryThis$r([].push),AllSymbols=shared$3("symbols"),ObjectPrototypeSymbols=shared$3("op-symbols"),WellKnownSymbolsStore$1=shared$3("wks"),USE_SETTER=!QObject||!QObject[PROTOTYPE]||!QObject[PROTOTYPE].findChild,setSymbolDescriptor=DESCRIPTORS$d&&fails$o((function(){return 7!=nativeObjectCreate(nativeDefineProperty({},"a",{get:function(){return nativeDefineProperty(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=nativeGetOwnPropertyDescriptor$1(ObjectPrototype$2,t);n&&delete ObjectPrototype$2[t],nativeDefineProperty(e,t,r),n&&e!==ObjectPrototype$2&&nativeDefineProperty(ObjectPrototype$2,t,n)}:nativeDefineProperty,wrap=function(e,t){var r=AllSymbols[e]=nativeObjectCreate(SymbolPrototype);return setInternalState$7(r,{type:SYMBOL,tag:e,description:t}),DESCRIPTORS$d||(r.description=t),r},$defineProperty=function(e,t,r){e===ObjectPrototype$2&&$defineProperty(ObjectPrototypeSymbols,t,r),anObject$e(e);var n=toPropertyKey(t);return anObject$e(r),hasOwn$f(AllSymbols,n)?(r.enumerable?(hasOwn$f(e,HIDDEN)&&e[HIDDEN][n]&&(e[HIDDEN][n]=!1),r=nativeObjectCreate(r,{enumerable:createPropertyDescriptor$4(0,!1)})):(hasOwn$f(e,HIDDEN)||nativeDefineProperty(e,HIDDEN,createPropertyDescriptor$4(1,{})),e[HIDDEN][n]=!0),setSymbolDescriptor(e,n,r)):nativeDefineProperty(e,n,r)},$defineProperties=function(e,t){anObject$e(e);var r=toIndexedObject$4(t),n=objectKeys$1(r).concat($getOwnPropertySymbols(r));return $forEach$1(n,(function(t){DESCRIPTORS$d&&!call$t($propertyIsEnumerable,r,t)||$defineProperty(e,t,r[t])})),e},$create=function(e,t){return void 0===t?nativeObjectCreate(e):$defineProperties(nativeObjectCreate(e),t)},$propertyIsEnumerable=function(e){var t=toPropertyKey(e),r=call$t(nativePropertyIsEnumerable,this,t);return!(this===ObjectPrototype$2&&hasOwn$f(AllSymbols,t)&&!hasOwn$f(ObjectPrototypeSymbols,t))&&(!(r||!hasOwn$f(this,t)||!hasOwn$f(AllSymbols,t)||hasOwn$f(this,HIDDEN)&&this[HIDDEN][t])||r)},$getOwnPropertyDescriptor=function(e,t){var r=toIndexedObject$4(e),n=toPropertyKey(t);if(r!==ObjectPrototype$2||!hasOwn$f(AllSymbols,n)||hasOwn$f(ObjectPrototypeSymbols,n)){var o=nativeGetOwnPropertyDescriptor$1(r,n);return!o||!hasOwn$f(AllSymbols,n)||hasOwn$f(r,HIDDEN)&&r[HIDDEN][n]||(o.enumerable=!0),o}},$getOwnPropertyNames=function(e){var t=nativeGetOwnPropertyNames(toIndexedObject$4(e)),r=[];return $forEach$1(t,(function(e){hasOwn$f(AllSymbols,e)||hasOwn$f(hiddenKeys$1,e)||push$a(r,e)})),r},$getOwnPropertySymbols=function(e){var t=e===ObjectPrototype$2,r=nativeGetOwnPropertyNames(t?ObjectPrototypeSymbols:toIndexedObject$4(e)),n=[];return $forEach$1(r,(function(e){!hasOwn$f(AllSymbols,e)||t&&!hasOwn$f(ObjectPrototype$2,e)||push$a(n,AllSymbols[e])})),n};NATIVE_SYMBOL$3||(defineBuiltIn$6(SymbolPrototype=($Symbol=function(){if(isPrototypeOf$o(SymbolPrototype,this))throw TypeError$4("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?$toString$2(arguments[0]):void 0,t=uid$1(e),r=function(e){this===ObjectPrototype$2&&call$t(r,ObjectPrototypeSymbols,e),hasOwn$f(this,HIDDEN)&&hasOwn$f(this[HIDDEN],t)&&(this[HIDDEN][t]=!1),setSymbolDescriptor(this,t,createPropertyDescriptor$4(1,e))};return DESCRIPTORS$d&&USE_SETTER&&setSymbolDescriptor(ObjectPrototype$2,t,{configurable:!0,set:r}),wrap(t,e)})[PROTOTYPE],"toString",(function(){return getInternalState$2(this).tag})),defineBuiltIn$6($Symbol,"withoutSetter",(function(e){return wrap(uid$1(e),e)})),propertyIsEnumerableModule$1.f=$propertyIsEnumerable,definePropertyModule$1.f=$defineProperty,definePropertiesModule.f=$defineProperties,getOwnPropertyDescriptorModule$3.f=$getOwnPropertyDescriptor,getOwnPropertyNamesModule$2.f=getOwnPropertyNamesExternal.f=$getOwnPropertyNames,getOwnPropertySymbolsModule$3.f=$getOwnPropertySymbols,wrappedWellKnownSymbolModule.f=function(e){return wrap(wellKnownSymbol$h(e),e)},DESCRIPTORS$d&&defineBuiltInAccessor$4(SymbolPrototype,"description",{configurable:!0,get:function(){return getInternalState$2(this).description}})),$$1G({global:!0,constructor:!0,wrap:!0,forced:!NATIVE_SYMBOL$3,sham:!NATIVE_SYMBOL$3},{Symbol:$Symbol}),$forEach$1(objectKeys$1(WellKnownSymbolsStore$1),(function(e){defineWellKnownSymbol$l(e)})),$$1G({target:SYMBOL,stat:!0,forced:!NATIVE_SYMBOL$3},{useSetter:function(){USE_SETTER=!0},useSimple:function(){USE_SETTER=!1}}),$$1G({target:"Object",stat:!0,forced:!NATIVE_SYMBOL$3,sham:!DESCRIPTORS$d},{create:$create,defineProperty:$defineProperty,defineProperties:$defineProperties,getOwnPropertyDescriptor:$getOwnPropertyDescriptor}),$$1G({target:"Object",stat:!0,forced:!NATIVE_SYMBOL$3},{getOwnPropertyNames:$getOwnPropertyNames}),defineSymbolToPrimitive$1(),setToStringTag$8($Symbol,SYMBOL),hiddenKeys$1[HIDDEN]=!0;var NATIVE_SYMBOL$2=symbolConstructorDetection,symbolRegistryDetection=NATIVE_SYMBOL$2&&!!Symbol.for&&!!Symbol.keyFor,$$1F=_export,getBuiltIn$e=getBuiltIn$j,hasOwn$e=hasOwnProperty_1,toString$e=toString$g,shared$2=sharedExports,NATIVE_SYMBOL_REGISTRY$1=symbolRegistryDetection,StringToSymbolRegistry=shared$2("string-to-symbol-registry"),SymbolToStringRegistry$1=shared$2("symbol-to-string-registry");$$1F({target:"Symbol",stat:!0,forced:!NATIVE_SYMBOL_REGISTRY$1},{for:function(e){var t=toString$e(e);if(hasOwn$e(StringToSymbolRegistry,t))return StringToSymbolRegistry[t];var r=getBuiltIn$e("Symbol")(t);return StringToSymbolRegistry[t]=r,SymbolToStringRegistry$1[r]=t,r}});var $$1E=_export,hasOwn$d=hasOwnProperty_1,isSymbol$2=isSymbol$5,tryToString$6=tryToString$8,shared$1=sharedExports,NATIVE_SYMBOL_REGISTRY=symbolRegistryDetection,SymbolToStringRegistry=shared$1("symbol-to-string-registry");$$1E({target:"Symbol",stat:!0,forced:!NATIVE_SYMBOL_REGISTRY},{keyFor:function(e){if(!isSymbol$2(e))throw TypeError(tryToString$6(e)+" is not a symbol");if(hasOwn$d(SymbolToStringRegistry,e))return SymbolToStringRegistry[e]}});var uncurryThis$q=functionUncurryThis,arraySlice$7=uncurryThis$q([].slice),uncurryThis$p=functionUncurryThis,isArray$a=isArray$d,isCallable$f=isCallable$r,classof$9=classofRaw$2,toString$d=toString$g,push$9=uncurryThis$p([].push),getJsonReplacerFunction=function(e){if(isCallable$f(e))return e;if(isArray$a(e)){for(var t=e.length,r=[],n=0;n<t;n++){var o=e[n];"string"==typeof o?push$9(r,o):"number"!=typeof o&&"Number"!=classof$9(o)&&"String"!=classof$9(o)||push$9(r,toString$d(o))}var i=r.length,a=!0;return function(e,t){if(a)return a=!1,t;if(isArray$a(this))return t;for(var n=0;n<i;n++)if(r[n]===e)return t}}},$$1D=_export,getBuiltIn$d=getBuiltIn$j,apply$4=functionApply,call$s=functionCall,uncurryThis$o=functionUncurryThis,fails$n=fails$z,isCallable$e=isCallable$r,isSymbol$1=isSymbol$5,arraySlice$6=arraySlice$7,getReplacerFunction=getJsonReplacerFunction,NATIVE_SYMBOL$1=symbolConstructorDetection,$String$1=String,$stringify=getBuiltIn$d("JSON","stringify"),exec$3=uncurryThis$o(/./.exec),charAt$5=uncurryThis$o("".charAt),charCodeAt$2=uncurryThis$o("".charCodeAt),replace$5=uncurryThis$o("".replace),numberToString$1=uncurryThis$o(1..toString),tester=/[\uD800-\uDFFF]/g,low=/^[\uD800-\uDBFF]$/,hi=/^[\uDC00-\uDFFF]$/,WRONG_SYMBOLS_CONVERSION=!NATIVE_SYMBOL$1||fails$n((function(){var e=getBuiltIn$d("Symbol")();return"[null]"!=$stringify([e])||"{}"!=$stringify({a:e})||"{}"!=$stringify(Object(e))})),ILL_FORMED_UNICODE=fails$n((function(){return'"\\udf06\\ud834"'!==$stringify("\udf06\ud834")||'"\\udead"'!==$stringify("\udead")})),stringifyWithSymbolsFix=function(e,t){var r=arraySlice$6(arguments),n=getReplacerFunction(t);if(isCallable$e(n)||void 0!==e&&!isSymbol$1(e))return r[1]=function(e,t){if(isCallable$e(n)&&(t=call$s(n,this,$String$1(e),t)),!isSymbol$1(t))return t},apply$4($stringify,null,r)},fixIllFormed=function(e,t,r){var n=charAt$5(r,t-1),o=charAt$5(r,t+1);return exec$3(low,e)&&!exec$3(hi,o)||exec$3(hi,e)&&!exec$3(low,n)?"\\u"+numberToString$1(charCodeAt$2(e,0),16):e};$stringify&&$$1D({target:"JSON",stat:!0,arity:3,forced:WRONG_SYMBOLS_CONVERSION||ILL_FORMED_UNICODE},{stringify:function(e,t,r){var n=arraySlice$6(arguments),o=apply$4(WRONG_SYMBOLS_CONVERSION?stringifyWithSymbolsFix:$stringify,null,n);return ILL_FORMED_UNICODE&&"string"==typeof o?replace$5(o,tester,fixIllFormed):o}});var $$1C=_export,NATIVE_SYMBOL=symbolConstructorDetection,fails$m=fails$z,getOwnPropertySymbolsModule$2=objectGetOwnPropertySymbols,toObject$8=toObject$c,FORCED$7=!NATIVE_SYMBOL||fails$m((function(){getOwnPropertySymbolsModule$2.f(1)}));$$1C({target:"Object",stat:!0,forced:FORCED$7},{getOwnPropertySymbols:function(e){var t=getOwnPropertySymbolsModule$2.f;return t?t(toObject$8(e)):[]}});var defineWellKnownSymbol$k=wellKnownSymbolDefine;defineWellKnownSymbol$k("asyncIterator");var defineWellKnownSymbol$j=wellKnownSymbolDefine;defineWellKnownSymbol$j("hasInstance");var defineWellKnownSymbol$i=wellKnownSymbolDefine;defineWellKnownSymbol$i("isConcatSpreadable");var defineWellKnownSymbol$h=wellKnownSymbolDefine;defineWellKnownSymbol$h("iterator");var defineWellKnownSymbol$g=wellKnownSymbolDefine;defineWellKnownSymbol$g("match");var defineWellKnownSymbol$f=wellKnownSymbolDefine;defineWellKnownSymbol$f("matchAll");var defineWellKnownSymbol$e=wellKnownSymbolDefine;defineWellKnownSymbol$e("replace");var defineWellKnownSymbol$d=wellKnownSymbolDefine;defineWellKnownSymbol$d("search");var defineWellKnownSymbol$c=wellKnownSymbolDefine;defineWellKnownSymbol$c("species");var defineWellKnownSymbol$b=wellKnownSymbolDefine;defineWellKnownSymbol$b("split");var defineWellKnownSymbol$a=wellKnownSymbolDefine,defineSymbolToPrimitive=symbolDefineToPrimitive;defineWellKnownSymbol$a("toPrimitive"),defineSymbolToPrimitive();var getBuiltIn$c=getBuiltIn$j,defineWellKnownSymbol$9=wellKnownSymbolDefine,setToStringTag$7=setToStringTag$9;defineWellKnownSymbol$9("toStringTag"),setToStringTag$7(getBuiltIn$c("Symbol"),"Symbol");var defineWellKnownSymbol$8=wellKnownSymbolDefine;defineWellKnownSymbol$8("unscopables");var global$g=global$s,setToStringTag$6=setToStringTag$9;setToStringTag$6(global$g.JSON,"JSON",!0);var IteratorPrototype$1,PrototypeOfArrayIteratorPrototype,arrayIterator,path$r=path$w,symbol$5=path$r.Symbol,iterators={},DESCRIPTORS$c=descriptors,hasOwn$c=hasOwnProperty_1,FunctionPrototype$1=Function.prototype,getDescriptor=DESCRIPTORS$c&&Object.getOwnPropertyDescriptor,EXISTS=hasOwn$c(FunctionPrototype$1,"name"),PROPER=EXISTS&&"something"===function(){}.name,CONFIGURABLE=EXISTS&&(!DESCRIPTORS$c||DESCRIPTORS$c&&getDescriptor(FunctionPrototype$1,"name").configurable),functionName={EXISTS:EXISTS,PROPER:PROPER,CONFIGURABLE:CONFIGURABLE},fails$l=fails$z,correctPrototypeGetter=!fails$l((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),hasOwn$b=hasOwnProperty_1,isCallable$d=isCallable$r,toObject$7=toObject$c,sharedKey=sharedKey$4,CORRECT_PROTOTYPE_GETTER$1=correctPrototypeGetter,IE_PROTO=sharedKey("IE_PROTO"),$Object$1=Object,ObjectPrototype$1=$Object$1.prototype,objectGetPrototypeOf=CORRECT_PROTOTYPE_GETTER$1?$Object$1.getPrototypeOf:function(e){var t=toObject$7(e);if(hasOwn$b(t,IE_PROTO))return t[IE_PROTO];var r=t.constructor;return isCallable$d(r)&&t instanceof r?r.prototype:t instanceof $Object$1?ObjectPrototype$1:null},fails$k=fails$z,isCallable$c=isCallable$r,isObject$e=isObject$m,create$c=objectCreate,getPrototypeOf$9=objectGetPrototypeOf,defineBuiltIn$5=defineBuiltIn$8,wellKnownSymbol$g=wellKnownSymbol$r,ITERATOR$9=wellKnownSymbol$g("iterator"),BUGGY_SAFARI_ITERATORS$1=!1;[].keys&&("next"in(arrayIterator=[].keys())?(PrototypeOfArrayIteratorPrototype=getPrototypeOf$9(getPrototypeOf$9(arrayIterator)))!==Object.prototype&&(IteratorPrototype$1=PrototypeOfArrayIteratorPrototype):BUGGY_SAFARI_ITERATORS$1=!0);var NEW_ITERATOR_PROTOTYPE=!isObject$e(IteratorPrototype$1)||fails$k((function(){var e={};return IteratorPrototype$1[ITERATOR$9].call(e)!==e}));isCallable$c((IteratorPrototype$1=NEW_ITERATOR_PROTOTYPE?{}:create$c(IteratorPrototype$1))[ITERATOR$9])||defineBuiltIn$5(IteratorPrototype$1,ITERATOR$9,(function(){return this}));var iteratorsCore={IteratorPrototype:IteratorPrototype$1,BUGGY_SAFARI_ITERATORS:BUGGY_SAFARI_ITERATORS$1},IteratorPrototype=iteratorsCore.IteratorPrototype,create$b=objectCreate,createPropertyDescriptor$3=createPropertyDescriptor$8,setToStringTag$5=setToStringTag$9,Iterators$6=iterators,returnThis$1=function(){return this},iteratorCreateConstructor=function(e,t,r,n){var o=t+" Iterator";return e.prototype=create$b(IteratorPrototype,{next:createPropertyDescriptor$3(+!n,r)}),setToStringTag$5(e,o,!1,!0),Iterators$6[o]=returnThis$1,e},uncurryThis$n=functionUncurryThis,aCallable$i=aCallable$l,functionUncurryThisAccessor=function(e,t,r){try{return uncurryThis$n(aCallable$i(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}},isCallable$b=isCallable$r,$String=String,$TypeError$f=TypeError,aPossiblePrototype$1=function(e){if("object"==typeof e||isCallable$b(e))return e;throw $TypeError$f("Can't set "+$String(e)+" as a prototype")},uncurryThisAccessor=functionUncurryThisAccessor,anObject$d=anObject$i,aPossiblePrototype=aPossiblePrototype$1,objectSetPrototypeOf=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=uncurryThisAccessor(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return anObject$d(r),aPossiblePrototype(n),t?e(r,n):r.__proto__=n,r}}():void 0),$$1B=_export,call$r=functionCall,FunctionName=functionName,createIteratorConstructor$1=iteratorCreateConstructor,getPrototypeOf$8=objectGetPrototypeOf,setToStringTag$4=setToStringTag$9,defineBuiltIn$4=defineBuiltIn$8,wellKnownSymbol$f=wellKnownSymbol$r,Iterators$5=iterators,IteratorsCore=iteratorsCore,PROPER_FUNCTION_NAME$1=FunctionName.PROPER;FunctionName.CONFIGURABLE,IteratorsCore.IteratorPrototype;var BUGGY_SAFARI_ITERATORS=IteratorsCore.BUGGY_SAFARI_ITERATORS,ITERATOR$8=wellKnownSymbol$f("iterator"),KEYS="keys",VALUES="values",ENTRIES="entries",returnThis=function(){return this},iteratorDefine=function(e,t,r,n,o,i,a){createIteratorConstructor$1(r,t,n);var s,c,l,u=function(e){if(e===o&&y)return y;if(!BUGGY_SAFARI_ITERATORS&&e in f)return f[e];switch(e){case KEYS:case VALUES:case ENTRIES:return function(){return new r(this,e)}}return function(){return new r(this)}},p=t+" Iterator",$=!1,f=e.prototype,d=f[ITERATOR$8]||f["@@iterator"]||o&&f[o],y=!BUGGY_SAFARI_ITERATORS&&d||u(o),h="Array"==t&&f.entries||d;if(h&&(s=getPrototypeOf$8(h.call(new e)))!==Object.prototype&&s.next&&(setToStringTag$4(s,p,!0,!0),Iterators$5[p]=returnThis),PROPER_FUNCTION_NAME$1&&o==VALUES&&d&&d.name!==VALUES&&($=!0,y=function(){return call$r(d,this)}),o)if(c={values:u(VALUES),keys:i?y:u(KEYS),entries:u(ENTRIES)},a)for(l in c)(BUGGY_SAFARI_ITERATORS||$||!(l in f))&&defineBuiltIn$4(f,l,c[l]);else $$1B({target:t,proto:!0,forced:BUGGY_SAFARI_ITERATORS||$},c);return a&&f[ITERATOR$8]!==y&&defineBuiltIn$4(f,ITERATOR$8,y,{name:o}),Iterators$5[t]=y,c},createIterResultObject$3=function(e,t){return{value:e,done:t}},toIndexedObject$3=toIndexedObject$a,Iterators$4=iterators,InternalStateModule$6=internalState;objectDefineProperty.f;var defineIterator$2=iteratorDefine,createIterResultObject$2=createIterResultObject$3,ARRAY_ITERATOR="Array Iterator",setInternalState$6=InternalStateModule$6.set,getInternalState$1=InternalStateModule$6.getterFor(ARRAY_ITERATOR);defineIterator$2(Array,"Array",(function(e,t){setInternalState$6(this,{type:ARRAY_ITERATOR,target:toIndexedObject$3(e),index:0,kind:t})}),(function(){var e=getInternalState$1(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,createIterResultObject$2(void 0,!0)):createIterResultObject$2("keys"==r?n:"values"==r?t[n]:[n,t[n]],!1)}),"values"),Iterators$4.Arguments=Iterators$4.Array;var domIterables={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},DOMIterables$2=domIterables,global$f=global$s,classof$8=classof$e,createNonEnumerableProperty$4=createNonEnumerableProperty$9,Iterators$3=iterators,wellKnownSymbol$e=wellKnownSymbol$r,TO_STRING_TAG$1=wellKnownSymbol$e("toStringTag");for(var COLLECTION_NAME in DOMIterables$2){var Collection=global$f[COLLECTION_NAME],CollectionPrototype=Collection&&Collection.prototype;CollectionPrototype&&classof$8(CollectionPrototype)!==TO_STRING_TAG$1&&createNonEnumerableProperty$4(CollectionPrototype,TO_STRING_TAG$1,COLLECTION_NAME),Iterators$3[COLLECTION_NAME]=Iterators$3.Array}var parent$2j=symbol$5,symbol$4=parent$2j,defineWellKnownSymbol$7=wellKnownSymbolDefine;defineWellKnownSymbol$7("dispose");var parent$2i=symbol$4,symbol$3=parent$2i,defineWellKnownSymbol$6=wellKnownSymbolDefine;defineWellKnownSymbol$6("asyncDispose");var $$1A=_export,getBuiltIn$b=getBuiltIn$j,uncurryThis$m=functionUncurryThis,Symbol$4=getBuiltIn$b("Symbol"),keyFor2=Symbol$4.keyFor,thisSymbolValue$1=uncurryThis$m(Symbol$4.prototype.valueOf);$$1A({target:"Symbol",stat:!0},{isRegistered:function(e){try{return void 0!==keyFor2(thisSymbolValue$1(e))}catch(e){return!1}}});for(var $$1z=_export,shared=sharedExports,getBuiltIn$a=getBuiltIn$j,uncurryThis$l=functionUncurryThis,isSymbol=isSymbol$5,wellKnownSymbol$d=wellKnownSymbol$r,Symbol$3=getBuiltIn$a("Symbol"),$isWellKnown=Symbol$3.isWellKnown,getOwnPropertyNames4=getBuiltIn$a("Object","getOwnPropertyNames"),thisSymbolValue=uncurryThis$l(Symbol$3.prototype.valueOf),WellKnownSymbolsStore=shared("wks"),i=0,symbolKeys=getOwnPropertyNames4(Symbol$3),symbolKeysLength=symbolKeys.length;i<symbolKeysLength;i++)try{var symbolKey=symbolKeys[i];isSymbol(Symbol$3[symbolKey])&&wellKnownSymbol$d(symbolKey)}catch(e){}$$1z({target:"Symbol",stat:!0,forced:!0},{isWellKnown:function(e){if($isWellKnown&&$isWellKnown(e))return!0;try{for(var t=thisSymbolValue(e),r=0,n=getOwnPropertyNames4(WellKnownSymbolsStore),o=n.length;r<o;r++)if(WellKnownSymbolsStore[n[r]]==t)return!0}catch(e){}return!1}});var defineWellKnownSymbol$5=wellKnownSymbolDefine;defineWellKnownSymbol$5("matcher");var defineWellKnownSymbol$4=wellKnownSymbolDefine;defineWellKnownSymbol$4("metadataKey");var defineWellKnownSymbol$3=wellKnownSymbolDefine;defineWellKnownSymbol$3("observable");var defineWellKnownSymbol$2=wellKnownSymbolDefine;defineWellKnownSymbol$2("metadata");var defineWellKnownSymbol$1=wellKnownSymbolDefine;defineWellKnownSymbol$1("patternMatch");var defineWellKnownSymbol=wellKnownSymbolDefine;defineWellKnownSymbol("replaceAll");var parent$2h=symbol$3,symbol$2=parent$2h,symbol$1=symbol$2,_Symbol$1=getDefaultExportFromCjs(symbol$1),uncurryThis$k=functionUncurryThis,toIntegerOrInfinity$3=toIntegerOrInfinity$6,toString$c=toString$g,requireObjectCoercible$4=requireObjectCoercible$7,charAt$4=uncurryThis$k("".charAt),charCodeAt$1=uncurryThis$k("".charCodeAt),stringSlice$3=uncurryThis$k("".slice),createMethod$3=function(e){return function(t,r){var n,o,i=toString$c(requireObjectCoercible$4(t)),a=toIntegerOrInfinity$3(r),s=i.length;return a<0||a>=s?e?"":void 0:(n=charCodeAt$1(i,a))<55296||n>56319||a+1===s||(o=charCodeAt$1(i,a+1))<56320||o>57343?e?charAt$4(i,a):n:e?stringSlice$3(i,a,a+2):o-56320+(n-55296<<10)+65536}},stringMultibyte={codeAt:createMethod$3(!1),charAt:createMethod$3(!0)},charAt$3=stringMultibyte.charAt,toString$b=toString$g,InternalStateModule$5=internalState,defineIterator$1=iteratorDefine,createIterResultObject$1=createIterResultObject$3,STRING_ITERATOR="String Iterator",setInternalState$5=InternalStateModule$5.set,getInternalState=InternalStateModule$5.getterFor(STRING_ITERATOR);defineIterator$1(String,"String",(function(e){setInternalState$5(this,{type:STRING_ITERATOR,string:toString$b(e),index:0})}),(function(){var e,t=getInternalState(this),r=t.string,n=t.index;return n>=r.length?createIterResultObject$1(void 0,!0):(e=charAt$3(r,n),t.index+=e.length,createIterResultObject$1(e,!1))}));var WrappedWellKnownSymbolModule$1=wellKnownSymbolWrapped,iterator$5=WrappedWellKnownSymbolModule$1.f("iterator"),parent$2g=iterator$5,iterator$4=parent$2g,parent$2f=iterator$4,iterator$3=parent$2f,parent$2e=iterator$3,iterator$2=parent$2e,iterator$1=iterator$2,_Symbol$iterator$1=getDefaultExportFromCjs(iterator$1);function _typeof$3(e){return(_typeof$3="function"==typeof _Symbol$1&&"symbol"==typeof _Symbol$iterator$1?function(e){return typeof e}:function(e){return e&&"function"==typeof _Symbol$1&&e.constructor===_Symbol$1&&e!==_Symbol$1.prototype?"symbol":typeof e})(e)}var WrappedWellKnownSymbolModule=wellKnownSymbolWrapped,toPrimitive$5=WrappedWellKnownSymbolModule.f("toPrimitive"),parent$2d=toPrimitive$5,toPrimitive$4=parent$2d,parent$2c=toPrimitive$4,toPrimitive$3=parent$2c,parent$2b=toPrimitive$3,toPrimitive$2=parent$2b,toPrimitive$1=toPrimitive$2,_Symbol$toPrimitive$1=getDefaultExportFromCjs(toPrimitive$1);function _toPrimitive$5(e,t){if("object"!==_typeof$3(e)||null===e)return e;var r=e[_Symbol$toPrimitive$1];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof$3(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey$5(e){var t=_toPrimitive$5(e,"string");return"symbol"===_typeof$3(t)?t:String(t)}function _defineProperties$5(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),_Object$defineProperty$1(e,_toPropertyKey$5(n.key),n)}}function _createClass$5(e,t,r){return t&&_defineProperties$5(e.prototype,t),r&&_defineProperties$5(e,r),_Object$defineProperty$1(e,"prototype",{writable:!1}),e}function _assertThisInitialized$4(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var hasOwn$a=hasOwnProperty_1,isDataDescriptor$1=function(e){return void 0!==e&&(hasOwn$a(e,"value")||hasOwn$a(e,"writable"))},$$1y=_export,call$q=functionCall,isObject$d=isObject$m,anObject$c=anObject$i,isDataDescriptor=isDataDescriptor$1,getOwnPropertyDescriptorModule$2=objectGetOwnPropertyDescriptor,getPrototypeOf$7=objectGetPrototypeOf;function get$8(e,t){var r,n,o=arguments.length<3?e:arguments[2];return anObject$c(e)===o?e[t]:(r=getOwnPropertyDescriptorModule$2.f(e,t))?isDataDescriptor(r)?r.value:void 0===r.get?void 0:call$q(r.get,o):isObject$d(n=getPrototypeOf$7(e))?get$8(n,t,o):void 0}$$1y({target:"Reflect",stat:!0},{get:get$8});var path$q=path$w,get$7=path$q.Reflect.get,parent$2a=get$7,get$6=parent$2a,parent$29=get$6,get$5=parent$29,parent$28=get$5,get$4=parent$28,get$3=get$4,_Reflect$get$1=getDefaultExportFromCjs(get$3),uncurryThis$j=functionUncurryThis,aCallable$h=aCallable$l,isObject$c=isObject$m,hasOwn$9=hasOwnProperty_1,arraySlice$5=arraySlice$7,NATIVE_BIND=functionBindNative,$Function=Function,concat$9=uncurryThis$j([].concat),join$4=uncurryThis$j([].join),factories={},construct$6=function(e,t,r){if(!hasOwn$9(factories,t)){for(var n=[],o=0;o<t;o++)n[o]="a["+o+"]";factories[t]=$Function("C,a","return new C("+join$4(n,",")+")")}return factories[t](e,r)},functionBind=NATIVE_BIND?$Function.bind:function(e){var t=aCallable$h(this),r=t.prototype,n=arraySlice$5(arguments,1),o=function(){var r=concat$9(n,arraySlice$5(arguments));return this instanceof o?construct$6(t,r.length,r):t.apply(e,r)};return isObject$c(r)&&(o.prototype=r),o},$$1x=_export,bind$t=functionBind;$$1x({target:"Function",proto:!0,forced:Function.bind!==bind$t},{bind:bind$t});var path$p=path$w,entryVirtual$k=function(e){return path$p[e+"Prototype"]},entryVirtual$j=entryVirtual$k,bind$s=entryVirtual$j("Function").bind,isPrototypeOf$n=objectIsPrototypeOf,method$h=bind$s,FunctionPrototype=Function.prototype,bind$r=function(e){var t=e.bind;return e===FunctionPrototype||isPrototypeOf$n(FunctionPrototype,e)&&t===FunctionPrototype.bind?method$h:t},parent$27=bind$r,bind$q=parent$27,parent$26=bind$q,bind$p=parent$26,parent$25=bind$p,bind$o=parent$25,bind$n=bind$o,_bindInstanceProperty$1=getDefaultExportFromCjs(bind$n),getOwnPropertyDescriptor$9={exports:{}},$$1w=_export,fails$j=fails$z,toIndexedObject$2=toIndexedObject$a,nativeGetOwnPropertyDescriptor=objectGetOwnPropertyDescriptor.f,DESCRIPTORS$b=descriptors,FORCED$6=!DESCRIPTORS$b||fails$j((function(){nativeGetOwnPropertyDescriptor(1)}));$$1w({target:"Object",stat:!0,forced:FORCED$6,sham:!DESCRIPTORS$b},{getOwnPropertyDescriptor:function(e,t){return nativeGetOwnPropertyDescriptor(toIndexedObject$2(e),t)}});var path$o=path$w,Object$3=path$o.Object,getOwnPropertyDescriptor$8=getOwnPropertyDescriptor$9.exports=function(e,t){return Object$3.getOwnPropertyDescriptor(e,t)};Object$3.getOwnPropertyDescriptor.sham&&(getOwnPropertyDescriptor$8.sham=!0);var getOwnPropertyDescriptorExports=getOwnPropertyDescriptor$9.exports,parent$24=getOwnPropertyDescriptorExports,getOwnPropertyDescriptor$7=parent$24,parent$23=getOwnPropertyDescriptor$7,getOwnPropertyDescriptor$6=parent$23,parent$22=getOwnPropertyDescriptor$6,getOwnPropertyDescriptor$5=parent$22,getOwnPropertyDescriptor$4=getOwnPropertyDescriptor$5,_Object$getOwnPropertyDescriptor$1=getDefaultExportFromCjs(getOwnPropertyDescriptor$4),$$1v=_export,setPrototypeOf$7=objectSetPrototypeOf;$$1v({target:"Object",stat:!0},{setPrototypeOf:setPrototypeOf$7});var path$n=path$w,setPrototypeOf$6=path$n.Object.setPrototypeOf,parent$21=setPrototypeOf$6,setPrototypeOf$5=parent$21,parent$20=setPrototypeOf$5,setPrototypeOf$4=parent$20,parent$1$=setPrototypeOf$4,setPrototypeOf$3=parent$1$,setPrototypeOf$2=setPrototypeOf$3,_Object$setPrototypeOf$1=getDefaultExportFromCjs(setPrototypeOf$2),$$1u=_export,fails$i=fails$z,toObject$6=toObject$c,nativeGetPrototypeOf=objectGetPrototypeOf,CORRECT_PROTOTYPE_GETTER=correctPrototypeGetter,FAILS_ON_PRIMITIVES$2=fails$i((function(){nativeGetPrototypeOf(1)}));$$1u({target:"Object",stat:!0,forced:FAILS_ON_PRIMITIVES$2,sham:!CORRECT_PROTOTYPE_GETTER},{getPrototypeOf:function(e){return nativeGetPrototypeOf(toObject$6(e))}});var path$m=path$w,getPrototypeOf$6=path$m.Object.getPrototypeOf,parent$1_=getPrototypeOf$6,getPrototypeOf$5=parent$1_,parent$1Z=getPrototypeOf$5,getPrototypeOf$4=parent$1Z,parent$1Y=getPrototypeOf$4,getPrototypeOf$3=parent$1Y,getPrototypeOf$2=getPrototypeOf$3,_Object$getPrototypeOf$1=getDefaultExportFromCjs(getPrototypeOf$2);function _getPrototypeOf$4(e){var t;return(_getPrototypeOf$4=_Object$setPrototypeOf$1?_bindInstanceProperty$1(t=_Object$getPrototypeOf$1).call(t):function(e){return e.__proto__||_Object$getPrototypeOf$1(e)})(e)}function _superPropBase$1(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf$4(e)););return e}function _get$1(){var e;"undefined"!=typeof Reflect&&_Reflect$get$1?_get$1=_bindInstanceProperty$1(e=_Reflect$get$1).call(e):_get$1=function(e,t,r){var n=_superPropBase$1(e,t);if(n){var o=_Object$getOwnPropertyDescriptor$1(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}};return _get$1.apply(this,arguments)}var $$1t=_export,DESCRIPTORS$a=descriptors,create$a=objectCreate;$$1t({target:"Object",stat:!0,sham:!DESCRIPTORS$a},{create:create$a});var path$l=path$w,Object$2=path$l.Object,create$9=function(e,t){return Object$2.create(e,t)},parent$1X=create$9,create$8=parent$1X,parent$1W=create$8,create$7=parent$1W,parent$1V=create$7,create$6=parent$1V,create$5=create$6,_Object$create$1=getDefaultExportFromCjs(create$5);function _setPrototypeOf$4(e,t){var r;return(_setPrototypeOf$4=_Object$setPrototypeOf$1?_bindInstanceProperty$1(r=_Object$setPrototypeOf$1).call(r):function(e,t){return e.__proto__=t,e})(e,t)}function _inherits$4(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=_Object$create$1(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),_Object$defineProperty$1(e,"prototype",{writable:!1}),t&&_setPrototypeOf$4(e,t)}var isConstructor$2=isConstructor$4,tryToString$5=tryToString$8,$TypeError$e=TypeError,aConstructor$3=function(e){if(isConstructor$2(e))return e;throw $TypeError$e(tryToString$5(e)+" is not a constructor")},$$1s=_export,getBuiltIn$9=getBuiltIn$j,apply$3=functionApply,bind$m=functionBind,aConstructor$2=aConstructor$3,anObject$b=anObject$i,isObject$b=isObject$m,create$4=objectCreate,fails$h=fails$z,nativeConstruct=getBuiltIn$9("Reflect","construct"),ObjectPrototype=Object.prototype,push$8=[].push,NEW_TARGET_BUG=fails$h((function(){function e(){}return!(nativeConstruct((function(){}),[],e)instanceof e)})),ARGS_BUG=!fails$h((function(){nativeConstruct((function(){}))})),FORCED$5=NEW_TARGET_BUG||ARGS_BUG;$$1s({target:"Reflect",stat:!0,forced:FORCED$5,sham:FORCED$5},{construct:function(e,t){aConstructor$2(e),anObject$b(t);var r=arguments.length<3?e:aConstructor$2(arguments[2]);if(ARGS_BUG&&!NEW_TARGET_BUG)return nativeConstruct(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 apply$3(push$8,n,t),new(apply$3(bind$m,e,n))}var o=r.prototype,i=create$4(isObject$b(o)?o:ObjectPrototype),a=apply$3(e,i,t);return isObject$b(a)?a:i}});var path$k=path$w,construct$5=path$k.Reflect.construct,parent$1U=construct$5,construct$4=parent$1U,parent$1T=construct$4,construct$3=parent$1T,parent$1S=construct$3,construct$2=parent$1S,construct$1=construct$2,_Reflect$construct$1=getDefaultExportFromCjs(construct$1);function _isNativeReflectConstruct$4(){if("undefined"==typeof Reflect||!_Reflect$construct$1)return!1;if(_Reflect$construct$1.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_Reflect$construct$1(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _possibleConstructorReturn$4(e,t){if(t&&("object"===_typeof$3(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$4(e)}function _createSuper$3(e){var t=_isNativeReflectConstruct$4();return function(){var r,n=_getPrototypeOf$4(e);if(t){var o=_getPrototypeOf$4(this).constructor;r=_Reflect$construct$1(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn$4(this,r)}}function _defineProperty$4(e,t,r){return(t=_toPropertyKey$5(t))in e?_Object$defineProperty$1(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var entryVirtual$i=entryVirtual$k,concat$8=entryVirtual$i("Array").concat,isPrototypeOf$m=objectIsPrototypeOf,method$g=concat$8,ArrayPrototype$g=Array.prototype,concat$7=function(e){var t=e.concat;return e===ArrayPrototype$g||isPrototypeOf$m(ArrayPrototype$g,e)&&t===ArrayPrototype$g.concat?method$g:t},parent$1R=concat$7,concat$6=parent$1R,parent$1Q=concat$6,concat$5=parent$1Q,parent$1P=concat$5,concat$4=parent$1P,concat$3=concat$4,concat$2=concat$3,_concatInstanceProperty=getDefaultExportFromCjs(concat$2),$$1r=_export,toObject$5=toObject$c,nativeKeys=objectKeys$3,fails$g=fails$z,FAILS_ON_PRIMITIVES$1=fails$g((function(){nativeKeys(1)}));$$1r({target:"Object",stat:!0,forced:FAILS_ON_PRIMITIVES$1},{keys:function(e){return nativeKeys(toObject$5(e))}});var path$j=path$w,keys$5=path$j.Object.keys,parent$1O=keys$5,keys$4=parent$1O,parent$1N=keys$4,keys$3=parent$1N,parent$1M=keys$3,keys$2=parent$1M,keys$1=keys$2,keys3=keys$1,_Object$keys=getDefaultExportFromCjs(keys3),path$i=path$w,getOwnPropertySymbols$5=path$i.Object.getOwnPropertySymbols,parent$1L=getOwnPropertySymbols$5,getOwnPropertySymbols$4=parent$1L,parent$1K=getOwnPropertySymbols$4,getOwnPropertySymbols$3=parent$1K,parent$1J=getOwnPropertySymbols$3,getOwnPropertySymbols$2=parent$1J,getOwnPropertySymbols$1=getOwnPropertySymbols$2,getOwnPropertySymbols2=getOwnPropertySymbols$1,_Object$getOwnPropertySymbols=getDefaultExportFromCjs(getOwnPropertySymbols2),$$1q=_export,$filter=arrayIteration.filter,arrayMethodHasSpeciesSupport$3=arrayMethodHasSpeciesSupport$5,HAS_SPECIES_SUPPORT$3=arrayMethodHasSpeciesSupport$3("filter");$$1q({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT$3},{filter:function(e){return $filter(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$h=entryVirtual$k,filter$6=entryVirtual$h("Array").filter,isPrototypeOf$l=objectIsPrototypeOf,method$f=filter$6,ArrayPrototype$f=Array.prototype,filter$5=function(e){var t=e.filter;return e===ArrayPrototype$f||isPrototypeOf$l(ArrayPrototype$f,e)&&t===ArrayPrototype$f.filter?method$f:t},parent$1I=filter$5,filter$4=parent$1I,parent$1H=filter$4,filter$3=parent$1H,parent$1G=filter$3,filter$2=parent$1G,filter$1=filter$2,filter2=filter$1,_filterInstanceProperty=getDefaultExportFromCjs(filter2),getOwnPropertyDescriptor$3=getOwnPropertyDescriptor$4,_Object$getOwnPropertyDescriptor=getDefaultExportFromCjs(getOwnPropertyDescriptor$3),fails$f=fails$z,arrayMethodIsStrict$6=function(e,t){var r=[][e];return!!r&&fails$f((function(){r.call(null,t||function(){return 1},1)}))},$forEach=arrayIteration.forEach,arrayMethodIsStrict$5=arrayMethodIsStrict$6,STRICT_METHOD$3=arrayMethodIsStrict$5("forEach"),arrayForEach=STRICT_METHOD$3?[].forEach:function(e){return $forEach(this,e,arguments.length>1?arguments[1]:void 0)},$$1p=_export,forEach$8=arrayForEach;$$1p({target:"Array",proto:!0,forced:[].forEach!=arrayForEach},{forEach:arrayForEach});var entryVirtual$g=entryVirtual$k,forEach$7=entryVirtual$g("Array").forEach,parent$1F=forEach$7,forEach$6=parent$1F,classof$7=classof$e,hasOwn$8=hasOwnProperty_1,isPrototypeOf$k=objectIsPrototypeOf,method$e=forEach$6,ArrayPrototype$e=Array.prototype,DOMIterables$1={DOMTokenList:!0,NodeList:!0},forEach$5=function(e){var t=e.forEach;return e===ArrayPrototype$e||isPrototypeOf$k(ArrayPrototype$e,e)&&t===ArrayPrototype$e.forEach||hasOwn$8(DOMIterables$1,classof$7(e))?method$e:t},parent$1E=forEach$5,forEach$4=parent$1E,parent$1D=forEach$4,forEach$3=parent$1D,forEach$2=forEach$3,forEach$1=forEach$2,_forEachInstanceProperty=getDefaultExportFromCjs(forEach$1),getBuiltIn$8=getBuiltIn$j,uncurryThis$i=functionUncurryThis,getOwnPropertyNamesModule$1=objectGetOwnPropertyNames,getOwnPropertySymbolsModule$1=objectGetOwnPropertySymbols,anObject$a=anObject$i,concat$1=uncurryThis$i([].concat),ownKeys$5=getBuiltIn$8("Reflect","ownKeys")||function(e){var t=getOwnPropertyNamesModule$1.f(anObject$a(e)),r=getOwnPropertySymbolsModule$1.f;return r?concat$1(t,r(e)):t},$$1o=_export,DESCRIPTORS$9=descriptors,ownKeys$4=ownKeys$5,toIndexedObject$1=toIndexedObject$a,getOwnPropertyDescriptorModule$1=objectGetOwnPropertyDescriptor,createProperty$3=createProperty$6;$$1o({target:"Object",stat:!0,sham:!DESCRIPTORS$9},{getOwnPropertyDescriptors:function(e){for(var t,r,n=toIndexedObject$1(e),o=getOwnPropertyDescriptorModule$1.f,i=ownKeys$4(n),a={},s=0;i.length>s;)void 0!==(r=o(n,t=i[s++]))&&createProperty$3(a,t,r);return a}});var path$h=path$w,getOwnPropertyDescriptors$5=path$h.Object.getOwnPropertyDescriptors,parent$1C=getOwnPropertyDescriptors$5,getOwnPropertyDescriptors$4=parent$1C,parent$1B=getOwnPropertyDescriptors$4,getOwnPropertyDescriptors$3=parent$1B,parent$1A=getOwnPropertyDescriptors$3,getOwnPropertyDescriptors$2=parent$1A,getOwnPropertyDescriptors$1=getOwnPropertyDescriptors$2,getOwnPropertyDescriptors2=getOwnPropertyDescriptors$1,_Object$getOwnPropertyDescriptors=getDefaultExportFromCjs(getOwnPropertyDescriptors2),defineProperties$7={exports:{}},$$1n=_export,DESCRIPTORS$8=descriptors,defineProperties$6=objectDefineProperties.f;$$1n({target:"Object",stat:!0,forced:Object.defineProperties!==defineProperties$6,sham:!DESCRIPTORS$8},{defineProperties:defineProperties$6});var path$g=path$w,Object$1=path$g.Object,defineProperties$5=defineProperties$7.exports=function(e,t){return Object$1.defineProperties(e,t)};Object$1.defineProperties.sham&&(defineProperties$5.sham=!0);var definePropertiesExports=defineProperties$7.exports,parent$1z=definePropertiesExports,defineProperties$4=parent$1z,parent$1y=defineProperties$4,defineProperties$3=parent$1y,parent$1x=defineProperties$3,defineProperties$2=parent$1x,defineProperties$1=defineProperties$2,defineProperties4=defineProperties$1,_Object$defineProperties=getDefaultExportFromCjs(defineProperties4),defineProperty$3=defineProperty$7,_Object$defineProperty=getDefaultExportFromCjs(defineProperty$3),symbol=symbol$1,_Symbol=getDefaultExportFromCjs(symbol),create$3=create$5,_Object$create=getDefaultExportFromCjs(create$3),getPrototypeOf$1=getPrototypeOf$2,_Object$getPrototypeOf=getDefaultExportFromCjs(getPrototypeOf$1),setPrototypeOf$1=setPrototypeOf$2,_Object$setPrototypeOf=getDefaultExportFromCjs(setPrototypeOf$1),hasOwn$7=hasOwnProperty_1,ownKeys$3=ownKeys$5,getOwnPropertyDescriptorModule=objectGetOwnPropertyDescriptor,definePropertyModule=objectDefineProperty,copyConstructorProperties$1=function(e,t,r){for(var n=ownKeys$3(t),o=definePropertyModule.f,i=getOwnPropertyDescriptorModule.f,a=0;a<n.length;a++){var s=n[a];hasOwn$7(e,s)||r&&hasOwn$7(r,s)||o(e,s,i(t,s))}},isObject$a=isObject$m,createNonEnumerableProperty$3=createNonEnumerableProperty$9,installErrorCause$1=function(e,t){isObject$a(t)&&"cause"in t&&createNonEnumerableProperty$3(e,"cause",t.cause)},uncurryThis$h=functionUncurryThis,$Error$1=Error,replace$4=uncurryThis$h("".replace),TEST=String($Error$1("zxcasd").stack),V8_OR_CHAKRA_STACK_ENTRY=/\n\s*at [^:]*:[^\n]*/,IS_V8_OR_CHAKRA_STACK=V8_OR_CHAKRA_STACK_ENTRY.test(TEST),errorStackClear=function(e,t){if(IS_V8_OR_CHAKRA_STACK&&"string"==typeof e&&!$Error$1.prepareStackTrace)for(;t--;)e=replace$4(e,V8_OR_CHAKRA_STACK_ENTRY,"");return e},fails$e=fails$z,createPropertyDescriptor$2=createPropertyDescriptor$8,errorStackInstallable=!fails$e((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",createPropertyDescriptor$2(1,7)),7!==e.stack)})),createNonEnumerableProperty$2=createNonEnumerableProperty$9,clearErrorStack=errorStackClear,ERROR_STACK_INSTALLABLE=errorStackInstallable,captureStackTrace=Error.captureStackTrace,errorStackInstall=function(e,t,r,n){ERROR_STACK_INSTALLABLE&&(captureStackTrace?captureStackTrace(e,t):createNonEnumerableProperty$2(e,"stack",clearErrorStack(r,n)))},wellKnownSymbol$c=wellKnownSymbol$r,Iterators$2=iterators,ITERATOR$7=wellKnownSymbol$c("iterator"),ArrayPrototype$d=Array.prototype,isArrayIteratorMethod$2=function(e){return void 0!==e&&(Iterators$2.Array===e||ArrayPrototype$d[ITERATOR$7]===e)},classof$6=classof$e,getMethod$1=getMethod$3,isNullOrUndefined$4=isNullOrUndefined$7,Iterators$1=iterators,wellKnownSymbol$b=wellKnownSymbol$r,ITERATOR$6=wellKnownSymbol$b("iterator"),getIteratorMethod$a=function(e){if(!isNullOrUndefined$4(e))return getMethod$1(e,ITERATOR$6)||getMethod$1(e,"@@iterator")||Iterators$1[classof$6(e)]},call$p=functionCall,aCallable$g=aCallable$l,anObject$9=anObject$i,tryToString$4=tryToString$8,getIteratorMethod$9=getIteratorMethod$a,$TypeError$d=TypeError,getIterator$3=function(e,t){var r=arguments.length<2?getIteratorMethod$9(e):t;if(aCallable$g(r))return anObject$9(call$p(r,e));throw $TypeError$d(tryToString$4(e)+" is not iterable")},call$o=functionCall,anObject$8=anObject$i,getMethod=getMethod$3,iteratorClose$4=function(e,t,r){var n,o;anObject$8(e);try{if(!(n=getMethod(e,"return"))){if("throw"===t)throw r;return r}n=call$o(n,e)}catch(e){o=!0,n=e}if("throw"===t)throw r;if(o)throw n;return anObject$8(n),r},bind$l=functionBindContext,call$n=functionCall,anObject$7=anObject$i,tryToString$3=tryToString$8,isArrayIteratorMethod$1=isArrayIteratorMethod$2,lengthOfArrayLike$5=lengthOfArrayLike$a,isPrototypeOf$j=objectIsPrototypeOf,getIterator$2=getIterator$3,getIteratorMethod$8=getIteratorMethod$a,iteratorClose$3=iteratorClose$4,$TypeError$c=TypeError,Result=function(e,t){this.stopped=e,this.result=t},ResultPrototype=Result.prototype,iterate$u=function(e,t,r){var n,o,i,a,s,c,l,u=r&&r.that,p=!(!r||!r.AS_ENTRIES),$=!(!r||!r.IS_RECORD),f=!(!r||!r.IS_ITERATOR),d=!(!r||!r.INTERRUPTED),y=bind$l(t,u),h=function(e){return n&&iteratorClose$3(n,"normal",e),new Result(!0,e)},_=function(e){return p?(anObject$7(e),d?y(e[0],e[1],h):y(e[0],e[1])):d?y(e,h):y(e)};if($)n=e.iterator;else if(f)n=e;else{if(!(o=getIteratorMethod$8(e)))throw $TypeError$c(tryToString$3(e)+" is not iterable");if(isArrayIteratorMethod$1(o)){for(i=0,a=lengthOfArrayLike$5(e);a>i;i++)if((s=_(e[i]))&&isPrototypeOf$j(ResultPrototype,s))return s;return new Result(!1)}n=getIterator$2(e,o)}for(c=$?e.next:n.next;!(l=call$n(c,n)).done;){try{s=_(l.value)}catch(e){iteratorClose$3(n,"throw",e)}if("object"==typeof s&&s&&isPrototypeOf$j(ResultPrototype,s))return s}return new Result(!1)},toString$a=toString$g,normalizeStringArgument$1=function(e,t){return void 0===e?arguments.length<2?"":t:toString$a(e)},$$1m=_export,isPrototypeOf$i=objectIsPrototypeOf,getPrototypeOf2=objectGetPrototypeOf,setPrototypeOf=objectSetPrototypeOf,copyConstructorProperties=copyConstructorProperties$1,create$2=objectCreate,createNonEnumerableProperty$1=createNonEnumerableProperty$9,createPropertyDescriptor$1=createPropertyDescriptor$8,installErrorCause=installErrorCause$1,installErrorStack=errorStackInstall,iterate$t=iterate$u,normalizeStringArgument=normalizeStringArgument$1,wellKnownSymbol$a=wellKnownSymbol$r,TO_STRING_TAG=wellKnownSymbol$a("toStringTag"),$Error=Error,push$7=[].push,$AggregateError=function(e,t){var r,n=isPrototypeOf$i(AggregateErrorPrototype,this);setPrototypeOf?r=setPrototypeOf($Error(),n?getPrototypeOf2(this):AggregateErrorPrototype):(r=n?this:create$2(AggregateErrorPrototype),createNonEnumerableProperty$1(r,TO_STRING_TAG,"Error")),void 0!==t&&createNonEnumerableProperty$1(r,"message",normalizeStringArgument(t)),installErrorStack(r,$AggregateError,r.stack,1),arguments.length>2&&installErrorCause(r,arguments[2]);var o=[];return iterate$t(e,push$7,{that:o}),createNonEnumerableProperty$1(r,"errors",o),r};setPrototypeOf?setPrototypeOf($AggregateError,$Error):copyConstructorProperties($AggregateError,$Error,{name:!0});var AggregateErrorPrototype=$AggregateError.prototype=create$2($Error.prototype,{constructor:createPropertyDescriptor$1(1,$AggregateError),message:createPropertyDescriptor$1(1,""),name:createPropertyDescriptor$1(1,"AggregateError")});$$1m({global:!0,constructor:!0,arity:2},{AggregateError:$AggregateError});var $location,defer,channel,port,classof$5=classofRaw$2,engineIsNode="undefined"!=typeof process&&"process"==classof$5(process),getBuiltIn$7=getBuiltIn$j,defineBuiltInAccessor$3=defineBuiltInAccessor$5,wellKnownSymbol$9=wellKnownSymbol$r,DESCRIPTORS$7=descriptors,SPECIES$3=wellKnownSymbol$9("species"),setSpecies$2=function(e){var t=getBuiltIn$7(e);DESCRIPTORS$7&&t&&!t[SPECIES$3]&&defineBuiltInAccessor$3(t,SPECIES$3,{configurable:!0,get:function(){return this}})},isPrototypeOf$h=objectIsPrototypeOf,$TypeError$b=TypeError,anInstance$5=function(e,t){if(isPrototypeOf$h(t,e))return e;throw $TypeError$b("Incorrect invocation")},anObject$6=anObject$i,aConstructor$1=aConstructor$3,isNullOrUndefined$3=isNullOrUndefined$7,wellKnownSymbol$8=wellKnownSymbol$r,SPECIES$2=wellKnownSymbol$8("species"),speciesConstructor$2=function(e,t){var r,n=anObject$6(e).constructor;return void 0===n||isNullOrUndefined$3(r=anObject$6(n)[SPECIES$2])?t:aConstructor$1(r)},$TypeError$a=TypeError,validateArgumentsLength$5=function(e,t){if(e<t)throw $TypeError$a("Not enough arguments");return e},userAgent$5=engineUserAgent,engineIsIos=/(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$5),global$e=global$s,apply$2=functionApply,bind$k=functionBindContext,isCallable$a=isCallable$r,hasOwn$6=hasOwnProperty_1,fails$d=fails$z,html=html$2,arraySlice$4=arraySlice$7,createElement=documentCreateElement$1,validateArgumentsLength$4=validateArgumentsLength$5,IS_IOS$1=engineIsIos,IS_NODE$4=engineIsNode,set$c=global$e.setImmediate,clear=global$e.clearImmediate,process$3=global$e.process,Dispatch=global$e.Dispatch,Function$2=global$e.Function,MessageChannel=global$e.MessageChannel,String$1=global$e.String,counter=0,queue$2={},ONREADYSTATECHANGE="onreadystatechange";fails$d((function(){$location=global$e.location}));var run=function(e){if(hasOwn$6(queue$2,e)){var t=queue$2[e];delete queue$2[e],t()}},runner=function(e){return function(){run(e)}},eventListener=function(e){run(e.data)},globalPostMessageDefer=function(e){global$e.postMessage(String$1(e),$location.protocol+"//"+$location.host)};set$c&&clear||(set$c=function(e){validateArgumentsLength$4(arguments.length,1);var t=isCallable$a(e)?e:Function$2(e),r=arraySlice$4(arguments,1);return queue$2[++counter]=function(){apply$2(t,void 0,r)},defer(counter),counter},clear=function(e){delete queue$2[e]},IS_NODE$4?defer=function(e){process$3.nextTick(runner(e))}:Dispatch&&Dispatch.now?defer=function(e){Dispatch.now(runner(e))}:MessageChannel&&!IS_IOS$1?(port=(channel=new MessageChannel).port2,channel.port1.onmessage=eventListener,defer=bind$k(port.postMessage,port)):global$e.addEventListener&&isCallable$a(global$e.postMessage)&&!global$e.importScripts&&$location&&"file:"!==$location.protocol&&!fails$d(globalPostMessageDefer)?(defer=globalPostMessageDefer,global$e.addEventListener("message",eventListener,!1)):defer=ONREADYSTATECHANGE in createElement("script")?function(e){html.appendChild(createElement("script"))[ONREADYSTATECHANGE]=function(){html.removeChild(this),run(e)}}:function(e){setTimeout(runner(e),0)});var task$1={set:set$c,clear:clear},Queue$2=function(){this.head=null,this.tail=null};Queue$2.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}};var notify$1,toggle,node,promise$6,then,queue$1=Queue$2,userAgent$4=engineUserAgent,engineIsIosPebble=/ipad|iphone|ipod/i.test(userAgent$4)&&"undefined"!=typeof Pebble,userAgent$3=engineUserAgent,engineIsWebosWebkit=/web0s(?!.*chrome)/i.test(userAgent$3),global$d=global$s,bind$j=functionBindContext,getOwnPropertyDescriptor$2=objectGetOwnPropertyDescriptor.f,macrotask=task$1.set,Queue$1=queue$1,IS_IOS=engineIsIos,IS_IOS_PEBBLE=engineIsIosPebble,IS_WEBOS_WEBKIT=engineIsWebosWebkit,IS_NODE$3=engineIsNode,MutationObserver=global$d.MutationObserver||global$d.WebKitMutationObserver,document$2=global$d.document,process$2=global$d.process,Promise$1=global$d.Promise,queueMicrotaskDescriptor=getOwnPropertyDescriptor$2(global$d,"queueMicrotask"),microtask$1=queueMicrotaskDescriptor&&queueMicrotaskDescriptor.value;if(!microtask$1){var queue=new Queue$1,flush=function(){var e,t;for(IS_NODE$3&&(e=process$2.domain)&&e.exit();t=queue.get();)try{t()}catch(e){throw queue.head&¬ify$1(),e}e&&e.enter()};IS_IOS||IS_NODE$3||IS_WEBOS_WEBKIT||!MutationObserver||!document$2?!IS_IOS_PEBBLE&&Promise$1&&Promise$1.resolve?((promise$6=Promise$1.resolve(void 0)).constructor=Promise$1,then=bind$j(promise$6.then,promise$6),notify$1=function(){then(flush)}):IS_NODE$3?notify$1=function(){process$2.nextTick(flush)}:(macrotask=bind$j(macrotask,global$d),notify$1=function(){macrotask(flush)}):(toggle=!0,node=document$2.createTextNode(""),new MutationObserver(flush).observe(node,{characterData:!0}),notify$1=function(){node.data=toggle=!toggle}),microtask$1=function(e){queue.head||notify$1(),queue.add(e)}}var microtask_1=microtask$1,hostReportErrors$1=function(e,t){try{1==arguments.length?console.error(e):console.error(e,t)}catch(e){}},perform$6=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},global$c=global$s,promiseNativeConstructor=global$c.Promise,engineIsDeno="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,IS_DENO$1=engineIsDeno,IS_NODE$2=engineIsNode,engineIsBrowser=!IS_DENO$1&&!IS_NODE$2&&"object"==typeof window&&"object"==typeof document,global$b=global$s,NativePromiseConstructor$5=promiseNativeConstructor,isCallable$9=isCallable$r,isForced=isForced_1,inspectSource=inspectSource$2,wellKnownSymbol$7=wellKnownSymbol$r,IS_BROWSER=engineIsBrowser,IS_DENO=engineIsDeno,V8_VERSION=engineV8Version,NativePromisePrototype$2=NativePromiseConstructor$5&&NativePromiseConstructor$5.prototype,SPECIES$1=wellKnownSymbol$7("species"),SUBCLASSING=!1,NATIVE_PROMISE_REJECTION_EVENT$1=isCallable$9(global$b.PromiseRejectionEvent),FORCED_PROMISE_CONSTRUCTOR$5=isForced("Promise",(function(){var e=inspectSource(NativePromiseConstructor$5),t=e!==String(NativePromiseConstructor$5);if(!t&&66===V8_VERSION)return!0;if(!NativePromisePrototype$2.catch||!NativePromisePrototype$2.finally)return!0;if(!V8_VERSION||V8_VERSION<51||!/native code/.test(e)){var r=new NativePromiseConstructor$5((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((r.constructor={})[SPECIES$1]=n,!(SUBCLASSING=r.then((function(){}))instanceof n))return!0}return!t&&(IS_BROWSER||IS_DENO)&&!NATIVE_PROMISE_REJECTION_EVENT$1})),promiseConstructorDetection={CONSTRUCTOR:FORCED_PROMISE_CONSTRUCTOR$5,REJECTION_EVENT:NATIVE_PROMISE_REJECTION_EVENT$1,SUBCLASSING:SUBCLASSING},newPromiseCapability$2={},aCallable$f=aCallable$l,$TypeError$9=TypeError,PromiseCapability=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw $TypeError$9("Bad Promise constructor");t=e,r=n})),this.resolve=aCallable$f(t),this.reject=aCallable$f(r)};newPromiseCapability$2.f=function(e){return new PromiseCapability(e)};var $$1l=_export,IS_NODE$1=engineIsNode,global$a=global$s,call$m=functionCall,defineBuiltIn$3=defineBuiltIn$8,setToStringTag$3=setToStringTag$9,setSpecies$1=setSpecies$2,aCallable$e=aCallable$l,isCallable$8=isCallable$r,isObject$9=isObject$m,anInstance$4=anInstance$5,speciesConstructor$1=speciesConstructor$2,task=task$1.set,microtask=microtask_1,hostReportErrors=hostReportErrors$1,perform$5=perform$6,Queue=queue$1,InternalStateModule$4=internalState,NativePromiseConstructor$4=promiseNativeConstructor,PromiseConstructorDetection=promiseConstructorDetection,newPromiseCapabilityModule$6=newPromiseCapability$2,PROMISE="Promise",FORCED_PROMISE_CONSTRUCTOR$4=PromiseConstructorDetection.CONSTRUCTOR,NATIVE_PROMISE_REJECTION_EVENT=PromiseConstructorDetection.REJECTION_EVENT;PromiseConstructorDetection.SUBCLASSING;var Internal,OwnPromiseCapability,PromiseWrapper,getInternalPromiseState=InternalStateModule$4.getterFor(PROMISE),setInternalState$4=InternalStateModule$4.set,NativePromisePrototype$1=NativePromiseConstructor$4&&NativePromiseConstructor$4.prototype,PromiseConstructor=NativePromiseConstructor$4,PromisePrototype=NativePromisePrototype$1,TypeError$3=global$a.TypeError,document$1=global$a.document,process$1=global$a.process,newPromiseCapability$1=newPromiseCapabilityModule$6.f,newGenericPromiseCapability=newPromiseCapability$1,DISPATCH_EVENT=!!(document$1&&document$1.createEvent&&global$a.dispatchEvent),UNHANDLED_REJECTION="unhandledrejection",REJECTION_HANDLED="rejectionhandled",PENDING=0,FULFILLED=1,REJECTED=2,HANDLED=1,UNHANDLED=2,isThenable=function(e){var t;return!(!isObject$9(e)||!isCallable$8(t=e.then))&&t},callReaction=function(e,t){var r,n,o,i=t.value,a=t.state==FULFILLED,s=a?e.ok:e.fail,c=e.resolve,l=e.reject,u=e.domain;try{s?(a||(t.rejection===UNHANDLED&&onHandleUnhandled(t),t.rejection=HANDLED),!0===s?r=i:(u&&u.enter(),r=s(i),u&&(u.exit(),o=!0)),r===e.promise?l(TypeError$3("Promise-chain cycle")):(n=isThenable(r))?call$m(n,r,c,l):c(r)):l(i)}catch(e){u&&!o&&u.exit(),l(e)}},notify=function(e,t){e.notified||(e.notified=!0,microtask((function(){for(var r,n=e.reactions;r=n.get();)callReaction(r,e);e.notified=!1,t&&!e.rejection&&onUnhandled(e)})))},dispatchEvent=function(e,t,r){var n,o;DISPATCH_EVENT?((n=document$1.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),global$a.dispatchEvent(n)):n={promise:t,reason:r},!NATIVE_PROMISE_REJECTION_EVENT&&(o=global$a["on"+e])?o(n):e===UNHANDLED_REJECTION&&hostReportErrors("Unhandled promise rejection",r)},onUnhandled=function(e){call$m(task,global$a,(function(){var t,r=e.facade,n=e.value;if(isUnhandled(e)&&(t=perform$5((function(){IS_NODE$1?process$1.emit("unhandledRejection",n,r):dispatchEvent(UNHANDLED_REJECTION,r,n)})),e.rejection=IS_NODE$1||isUnhandled(e)?UNHANDLED:HANDLED,t.error))throw t.value}))},isUnhandled=function(e){return e.rejection!==HANDLED&&!e.parent},onHandleUnhandled=function(e){call$m(task,global$a,(function(){var t=e.facade;IS_NODE$1?process$1.emit("rejectionHandled",t):dispatchEvent(REJECTION_HANDLED,t,e.value)}))},bind$i=function(e,t,r){return function(n){e(t,n,r)}},internalReject=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=REJECTED,notify(e,!0))},internalResolve=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw TypeError$3("Promise can't be resolved itself");var n=isThenable(t);n?microtask((function(){var r={done:!1};try{call$m(n,t,bind$i(internalResolve,r,e),bind$i(internalReject,r,e))}catch(t){internalReject(r,t,e)}})):(e.value=t,e.state=FULFILLED,notify(e,!1))}catch(t){internalReject({done:!1},t,e)}}};FORCED_PROMISE_CONSTRUCTOR$4&&(PromisePrototype=(PromiseConstructor=function(e){anInstance$4(this,PromisePrototype),aCallable$e(e),call$m(Internal,this);var t=getInternalPromiseState(this);try{e(bind$i(internalResolve,t),bind$i(internalReject,t))}catch(e){internalReject(t,e)}}).prototype,(Internal=function(e){setInternalState$4(this,{type:PROMISE,done:!1,notified:!1,parent:!1,reactions:new Queue,rejection:!1,state:PENDING,value:void 0})}).prototype=defineBuiltIn$3(PromisePrototype,"then",(function(e,t){var r=getInternalPromiseState(this),n=newPromiseCapability$1(speciesConstructor$1(this,PromiseConstructor));return r.parent=!0,n.ok=!isCallable$8(e)||e,n.fail=isCallable$8(t)&&t,n.domain=IS_NODE$1?process$1.domain:void 0,r.state==PENDING?r.reactions.add(n):microtask((function(){callReaction(n,r)})),n.promise})),OwnPromiseCapability=function(){var e=new Internal,t=getInternalPromiseState(e);this.promise=e,this.resolve=bind$i(internalResolve,t),this.reject=bind$i(internalReject,t)},newPromiseCapabilityModule$6.f=newPromiseCapability$1=function(e){return e===PromiseConstructor||e===PromiseWrapper?new OwnPromiseCapability(e):newGenericPromiseCapability(e)}),$$1l({global:!0,constructor:!0,wrap:!0,forced:FORCED_PROMISE_CONSTRUCTOR$4},{Promise:PromiseConstructor}),setToStringTag$3(PromiseConstructor,PROMISE,!1,!0),setSpecies$1(PROMISE);var wellKnownSymbol$6=wellKnownSymbol$r,ITERATOR$5=wellKnownSymbol$6("iterator"),SAFE_CLOSING=!1;try{var called=0,iteratorWithReturn={next:function(){return{done:!!called++}},return:function(){SAFE_CLOSING=!0}};iteratorWithReturn[ITERATOR$5]=function(){return this},Array.from(iteratorWithReturn,(function(){throw 2}))}catch(e){}var checkCorrectnessOfIteration$2=function(e,t){if(!t&&!SAFE_CLOSING)return!1;var r=!1;try{var n={};n[ITERATOR$5]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},NativePromiseConstructor$3=promiseNativeConstructor,checkCorrectnessOfIteration$1=checkCorrectnessOfIteration$2,FORCED_PROMISE_CONSTRUCTOR$3=promiseConstructorDetection.CONSTRUCTOR,promiseStaticsIncorrectIteration=FORCED_PROMISE_CONSTRUCTOR$3||!checkCorrectnessOfIteration$1((function(e){NativePromiseConstructor$3.all(e).then(void 0,(function(){}))})),$$1k=_export,call$l=functionCall,aCallable$d=aCallable$l,newPromiseCapabilityModule$5=newPromiseCapability$2,perform$4=perform$6,iterate$s=iterate$u,PROMISE_STATICS_INCORRECT_ITERATION$3=promiseStaticsIncorrectIteration;$$1k({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION$3},{all:function(e){var t=this,r=newPromiseCapabilityModule$5.f(t),n=r.resolve,o=r.reject,i=perform$4((function(){var r=aCallable$d(t.resolve),i=[],a=0,s=1;iterate$s(e,(function(e){var c=a++,l=!1;s++,call$l(r,t,e).then((function(e){l||(l=!0,i[c]=e,--s||n(i))}),o)})),--s||n(i)}));return i.error&&o(i.value),r.promise}});var $$1j=_export,FORCED_PROMISE_CONSTRUCTOR$2=promiseConstructorDetection.CONSTRUCTOR,NativePromiseConstructor$2=promiseNativeConstructor;promiseNativeConstructor&&promiseNativeConstructor.prototype,$$1j({target:"Promise",proto:!0,forced:FORCED_PROMISE_CONSTRUCTOR$2,real:!0},{catch:function(e){return this.then(void 0,e)}});var $$1i=_export,call$k=functionCall,aCallable$c=aCallable$l,newPromiseCapabilityModule$4=newPromiseCapability$2,perform$3=perform$6,iterate$r=iterate$u,PROMISE_STATICS_INCORRECT_ITERATION$2=promiseStaticsIncorrectIteration;$$1i({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION$2},{race:function(e){var t=this,r=newPromiseCapabilityModule$4.f(t),n=r.reject,o=perform$3((function(){var o=aCallable$c(t.resolve);iterate$r(e,(function(e){call$k(o,t,e).then(r.resolve,n)}))}));return o.error&&n(o.value),r.promise}});var $$1h=_export,call$j=functionCall,newPromiseCapabilityModule$3=newPromiseCapability$2,FORCED_PROMISE_CONSTRUCTOR$1=promiseConstructorDetection.CONSTRUCTOR;$$1h({target:"Promise",stat:!0,forced:FORCED_PROMISE_CONSTRUCTOR$1},{reject:function(e){var t=newPromiseCapabilityModule$3.f(this);return call$j(t.reject,void 0,e),t.promise}});var anObject$5=anObject$i,isObject$8=isObject$m,newPromiseCapability=newPromiseCapability$2,promiseResolve$2=function(e,t){if(anObject$5(e),isObject$8(t)&&t.constructor===e)return t;var r=newPromiseCapability.f(e);return(0,r.resolve)(t),r.promise},$$1g=_export,getBuiltIn$6=getBuiltIn$j,IS_PURE$1=isPure,NativePromiseConstructor$1=promiseNativeConstructor,FORCED_PROMISE_CONSTRUCTOR=promiseConstructorDetection.CONSTRUCTOR,promiseResolve$1=promiseResolve$2,PromiseConstructorWrapper=getBuiltIn$6("Promise"),CHECK_WRAPPER=!FORCED_PROMISE_CONSTRUCTOR;$$1g({target:"Promise",stat:!0,forced:IS_PURE$1},{resolve:function(e){return promiseResolve$1(CHECK_WRAPPER&&this===PromiseConstructorWrapper?NativePromiseConstructor$1:this,e)}});var $$1f=_export,call$i=functionCall,aCallable$b=aCallable$l,newPromiseCapabilityModule$2=newPromiseCapability$2,perform$2=perform$6,iterate$q=iterate$u,PROMISE_STATICS_INCORRECT_ITERATION$1=promiseStaticsIncorrectIteration;$$1f({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION$1},{allSettled:function(e){var t=this,r=newPromiseCapabilityModule$2.f(t),n=r.resolve,o=r.reject,i=perform$2((function(){var r=aCallable$b(t.resolve),o=[],i=0,a=1;iterate$q(e,(function(e){var s=i++,c=!1;a++,call$i(r,t,e).then((function(e){c||(c=!0,o[s]={status:"fulfilled",value:e},--a||n(o))}),(function(e){c||(c=!0,o[s]={status:"rejected",reason:e},--a||n(o))}))})),--a||n(o)}));return i.error&&o(i.value),r.promise}});var $$1e=_export,call$h=functionCall,aCallable$a=aCallable$l,getBuiltIn$5=getBuiltIn$j,newPromiseCapabilityModule$1=newPromiseCapability$2,perform$1=perform$6,iterate$p=iterate$u,PROMISE_STATICS_INCORRECT_ITERATION=promiseStaticsIncorrectIteration,PROMISE_ANY_ERROR="No one promise resolved";$$1e({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION},{any:function(e){var t=this,r=getBuiltIn$5("AggregateError"),n=newPromiseCapabilityModule$1.f(t),o=n.resolve,i=n.reject,a=perform$1((function(){var n=aCallable$a(t.resolve),a=[],s=0,c=1,l=!1;iterate$p(e,(function(e){var u=s++,p=!1;c++,call$h(n,t,e).then((function(e){p||l||(l=!0,o(e))}),(function(e){p||l||(p=!0,a[u]=e,--c||i(new r(a,PROMISE_ANY_ERROR)))}))})),--c||i(new r(a,PROMISE_ANY_ERROR))}));return a.error&&i(a.value),n.promise}});var $$1d=_export,NativePromiseConstructor=promiseNativeConstructor,fails$c=fails$z,getBuiltIn$4=getBuiltIn$j,isCallable$7=isCallable$r,speciesConstructor=speciesConstructor$2,promiseResolve=promiseResolve$2,NativePromisePrototype=NativePromiseConstructor&&NativePromiseConstructor.prototype,NON_GENERIC=!!NativePromiseConstructor&&fails$c((function(){NativePromisePrototype.finally.call({then:function(){}},(function(){}))}));$$1d({target:"Promise",proto:!0,real:!0,forced:NON_GENERIC},{finally:function(e){var t=speciesConstructor(this,getBuiltIn$4("Promise")),r=isCallable$7(e);return this.then(r?function(r){return promiseResolve(t,e()).then((function(){return r}))}:e,r?function(r){return promiseResolve(t,e()).then((function(){throw r}))}:e)}});var path$f=path$w,promise$5=path$f.Promise,parent$1w=promise$5,promise$4=parent$1w,parent$1v=promise$4,promise$3=parent$1v,$$1c=_export,newPromiseCapabilityModule=newPromiseCapability$2,perform=perform$6;$$1c({target:"Promise",stat:!0,forced:!0},{try:function(e){var t=newPromiseCapabilityModule.f(this),r=perform(e);return(r.error?t.reject:t.resolve)(r.value),t.promise}});var parent$1u=promise$3,promise$2=parent$1u,promise$1=promise$2,promise=promise$1,_Promise=getDefaultExportFromCjs(promise),$$1b=_export,uncurryThis$g=functionUncurryThis,isArray$9=isArray$d,nativeReverse=uncurryThis$g([].reverse),test$1=[1,2];$$1b({target:"Array",proto:!0,forced:String(test$1)===String(test$1.reverse())},{reverse:function(){return isArray$9(this)&&(this.length=this.length),nativeReverse(this)}});var entryVirtual$f=entryVirtual$k,reverse$6=entryVirtual$f("Array").reverse,isPrototypeOf$g=objectIsPrototypeOf,method$d=reverse$6,ArrayPrototype$c=Array.prototype,reverse$5=function(e){var t=e.reverse;return e===ArrayPrototype$c||isPrototypeOf$g(ArrayPrototype$c,e)&&t===ArrayPrototype$c.reverse?method$d:t},parent$1t=reverse$5,reverse$4=parent$1t,parent$1s=reverse$4,reverse$3=parent$1s,parent$1r=reverse$3,reverse$2=parent$1r,reverse$1=reverse$2,reverse2=reverse$1,_reverseInstanceProperty=getDefaultExportFromCjs(reverse2),$$1a=_export,isArray$8=isArray$d,isConstructor$1=isConstructor$4,isObject$7=isObject$m,toAbsoluteIndex$2=toAbsoluteIndex$5,lengthOfArrayLike$4=lengthOfArrayLike$a,toIndexedObject=toIndexedObject$a,createProperty$2=createProperty$6,wellKnownSymbol$5=wellKnownSymbol$r,arrayMethodHasSpeciesSupport$2=arrayMethodHasSpeciesSupport$5,nativeSlice=arraySlice$7,HAS_SPECIES_SUPPORT$2=arrayMethodHasSpeciesSupport$2("slice"),SPECIES=wellKnownSymbol$5("species"),$Array$1=Array,max$2=Math.max;$$1a({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT$2},{slice:function(e,t){var r,n,o,i=toIndexedObject(this),a=lengthOfArrayLike$4(i),s=toAbsoluteIndex$2(e,a),c=toAbsoluteIndex$2(void 0===t?a:t,a);if(isArray$8(i)&&(r=i.constructor,(isConstructor$1(r)&&(r===$Array$1||isArray$8(r.prototype))||isObject$7(r)&&null===(r=r[SPECIES]))&&(r=void 0),r===$Array$1||void 0===r))return nativeSlice(i,s,c);for(n=new(void 0===r?$Array$1:r)(max$2(c-s,0)),o=0;s<c;s++,o++)s in i&&createProperty$2(n,o,i[s]);return n.length=o,n}});var entryVirtual$e=entryVirtual$k,slice$6=entryVirtual$e("Array").slice,isPrototypeOf$f=objectIsPrototypeOf,method$c=slice$6,ArrayPrototype$b=Array.prototype,slice$5=function(e){var t=e.slice;return e===ArrayPrototype$b||isPrototypeOf$f(ArrayPrototype$b,e)&&t===ArrayPrototype$b.slice?method$c:t},parent$1q=slice$5,slice$4=parent$1q,parent$1p=slice$4,slice$3=parent$1p,parent$1o=slice$3,slice$2=parent$1o,slice$1=slice$2,slice2=slice$1,_sliceInstanceProperty=getDefaultExportFromCjs(slice2),iterator=iterator$1,_Symbol$iterator=getDefaultExportFromCjs(iterator),bind$h=bind$n,_bindInstanceProperty=getDefaultExportFromCjs(bind$h),construct2=construct$1,_Reflect$construct=getDefaultExportFromCjs(construct2),toPrimitive=toPrimitive$1,_Symbol$toPrimitive=getDefaultExportFromCjs(toPrimitive);function ownKeys$2(e,t){var r=_Object$keys(e);if(_Object$getOwnPropertySymbols){var n=_Object$getOwnPropertySymbols(e);t&&(n=_filterInstanceProperty(n).call(n,(function(t){return _Object$getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread2$2(e){for(var t=1;t<arguments.length;t++){var r,n,o=null!=arguments[t]?arguments[t]:{};t%2?_forEachInstanceProperty(r=ownKeys$2(Object(o),!0)).call(r,(function(t){_defineProperty$3(e,t,o[t])})):_Object$getOwnPropertyDescriptors?_Object$defineProperties(e,_Object$getOwnPropertyDescriptors(o)):_forEachInstanceProperty(n=ownKeys$2(Object(o))).call(n,(function(t){_Object$defineProperty(e,t,_Object$getOwnPropertyDescriptor(o,t))}))}return e}function _regeneratorRuntime$1(){_regeneratorRuntime$1=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=_Object$defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof _Symbol?_Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,r){return _Object$defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,o){var i=t&&t.prototype instanceof $?t:$,a=_Object$create(i.prototype),s=new P(o||[]);return n(a,"_invoke",{value:v(e,r,s)}),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var p={};function $(){}function f(){}function d(){}var y={};c(y,i,(function(){return this}));var h=_Object$getPrototypeOf&&_Object$getPrototypeOf(_Object$getPrototypeOf(O([])));h&&h!==t&&r.call(h,i)&&(y=h);var _=d.prototype=$.prototype=_Object$create(y);function g(e){var t;_forEachInstanceProperty(t=["next","throw","return"]).call(t,(function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function m(e,t){function o(n,i,a,s){var c=u(e[n],e,i);if("throw"!==c.type){var l=c.arg,p=l.value;return p&&"object"==_typeof$3(p)&&r.call(p,"__await")?t.resolve(p.__await).then((function(e){o("next",e,a,s)}),(function(e){o("throw",e,a,s)})):t.resolve(p).then((function(e){l.value=e,a(l)}),(function(e){return o("throw",e,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){o(e,r,t,n)}))}return i=i?i.then(n,n):n()}})}function v(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=b(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function b(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var o=u(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,p;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],_forEachInstanceProperty(e).call(e,S,this),this.reset(!0)}function O(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:T}}function T(){return{value:void 0,done:!0}}return f.prototype=d,n(_,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:f,configurable:!0}),f.displayName=c(d,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return _Object$setPrototypeOf?_Object$setPrototypeOf(e,d):(e.__proto__=d,c(e,s,"GeneratorFunction")),e.prototype=_Object$create(_),e},e.awrap=function(e){return{__await:e}},g(m.prototype),c(m.prototype,a,(function(){return this})),e.AsyncIterator=m,e.async=function(t,r,n,o,i){void 0===i&&(i=_Promise);var a=new m(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(_),c(_,s,"Generator"),c(_,i,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return _reverseInstanceProperty(r).call(r),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=O,P.prototype={constructor:P,reset:function(e){var t;if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,_forEachInstanceProperty(t=this.tryEntries).call(t,E),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+_sliceInstanceProperty(n).call(n,1))&&(this[n]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(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 o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},e}function _typeof$2(e){return(_typeof$2="function"==typeof _Symbol&&"symbol"==typeof _Symbol$iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof _Symbol&&e.constructor===_Symbol&&e!==_Symbol.prototype?"symbol":typeof e})(e)}function asyncGeneratorStep$1(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):_Promise.resolve(c).then(n,o)}function _asyncToGenerator$1(e){return function(){var t=this,r=arguments;return new _Promise((function(n,o){var i=e.apply(t,r);function a(e){asyncGeneratorStep$1(i,n,o,a,s,"next",e)}function s(e){asyncGeneratorStep$1(i,n,o,a,s,"throw",e)}a(void 0)}))}}function _classCallCheck$4(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$4(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),_Object$defineProperty(e,_toPropertyKey$4(n.key),n)}}function _createClass$4(e,t,r){return t&&_defineProperties$4(e.prototype,t),r&&_defineProperties$4(e,r),_Object$defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty$3(e,t,r){return(t=_toPropertyKey$4(t))in e?_Object$defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _inherits$3(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=_Object$create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),_Object$defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf$3(e,t)}function _getPrototypeOf$3(e){var t;return(_getPrototypeOf$3=_Object$setPrototypeOf?_bindInstanceProperty(t=_Object$getPrototypeOf).call(t):function(e){return e.__proto__||_Object$getPrototypeOf(e)})(e)}function _setPrototypeOf$3(e,t){var r;return(_setPrototypeOf$3=_Object$setPrototypeOf?_bindInstanceProperty(r=_Object$setPrototypeOf).call(r):function(e,t){return e.__proto__=t,e})(e,t)}function _isNativeReflectConstruct$3(){if("undefined"==typeof Reflect||!_Reflect$construct)return!1;if(_Reflect$construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_Reflect$construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _assertThisInitialized$3(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn$3(e,t){if(t&&("object"===_typeof$3(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$3(e)}function _createSuper$2(e){var t=_isNativeReflectConstruct$3();return function(){var r,n=_getPrototypeOf$3(e);if(t){var o=_getPrototypeOf$3(this).constructor;r=_Reflect$construct(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn$3(this,r)}}function _toPrimitive$4(e,t){if("object"!==_typeof$3(e)||null===e)return e;var r=e[_Symbol$toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof$3(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey$4(e){var t=_toPrimitive$4(e,"string");return"symbol"===_typeof$3(t)?t:String(t)}var $$19=_export,uncurryThis$f=functionUncurryThisClause,$indexOf=arrayIncludes.indexOf,arrayMethodIsStrict$4=arrayMethodIsStrict$6,nativeIndexOf=uncurryThis$f([].indexOf),NEGATIVE_ZERO=!!nativeIndexOf&&1/nativeIndexOf([1],1,-0)<0,FORCED$4=NEGATIVE_ZERO||!arrayMethodIsStrict$4("indexOf");$$19({target:"Array",proto:!0,forced:FORCED$4},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return NEGATIVE_ZERO?nativeIndexOf(this,e,t)||0:$indexOf(this,e,t)}});var entryVirtual$d=entryVirtual$k,indexOf$6=entryVirtual$d("Array").indexOf,isPrototypeOf$e=objectIsPrototypeOf,method$b=indexOf$6,ArrayPrototype$a=Array.prototype,indexOf$5=function(e){var t=e.indexOf;return e===ArrayPrototype$a||isPrototypeOf$e(ArrayPrototype$a,e)&&t===ArrayPrototype$a.indexOf?method$b:t},parent$1n=indexOf$5,indexOf$4=parent$1n,parent$1m=indexOf$4,indexOf$3=parent$1m,parent$1l=indexOf$3,indexOf$2=parent$1l,indexOf$1=indexOf$2,indexOf2=indexOf$1,_indexOfInstanceProperty=getDefaultExportFromCjs(indexOf2),$$18=_export,$find=arrayIteration.find,FIND="find",SKIPS_HOLES$1=!0;FIND in[]&&Array(1)[FIND]((function(){SKIPS_HOLES$1=!1})),$$18({target:"Array",proto:!0,forced:SKIPS_HOLES$1},{find:function(e){return $find(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$c=entryVirtual$k,find$7=entryVirtual$c("Array").find,isPrototypeOf$d=objectIsPrototypeOf,method$a=find$7,ArrayPrototype$9=Array.prototype,find$6=function(e){var t=e.find;return e===ArrayPrototype$9||isPrototypeOf$d(ArrayPrototype$9,e)&&t===ArrayPrototype$9.find?method$a:t},parent$1k=find$6,find$5=parent$1k,parent$1j=find$5,find$4=parent$1j,parent$1i=find$4,find$3=parent$1i,find$2=find$3,find$1=find$2,_findInstanceProperty=getDefaultExportFromCjs(find$1),DESCRIPTORS$6=descriptors,isArray$7=isArray$d,$TypeError$8=TypeError,getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor,SILENT_ON_NON_WRITABLE_LENGTH_SET=DESCRIPTORS$6&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}(),arraySetLength=SILENT_ON_NON_WRITABLE_LENGTH_SET?function(e,t){if(isArray$7(e)&&!getOwnPropertyDescriptor$1(e,"length").writable)throw $TypeError$8("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},tryToString$2=tryToString$8,$TypeError$7=TypeError,deletePropertyOrThrow$2=function(e,t){if(!delete e[t])throw $TypeError$7("Cannot delete property "+tryToString$2(t)+" of "+tryToString$2(e))},$$17=_export,toObject$4=toObject$c,toAbsoluteIndex$1=toAbsoluteIndex$5,toIntegerOrInfinity$2=toIntegerOrInfinity$6,lengthOfArrayLike$3=lengthOfArrayLike$a,setArrayLength=arraySetLength,doesNotExceedSafeInteger=doesNotExceedSafeInteger$2,arraySpeciesCreate=arraySpeciesCreate$3,createProperty$1=createProperty$6,deletePropertyOrThrow$1=deletePropertyOrThrow$2,arrayMethodHasSpeciesSupport$1=arrayMethodHasSpeciesSupport$5,HAS_SPECIES_SUPPORT$1=arrayMethodHasSpeciesSupport$1("splice"),max$1=Math.max,min=Math.min;$$17({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT$1},{splice:function(e,t){var r,n,o,i,a,s,c=toObject$4(this),l=lengthOfArrayLike$3(c),u=toAbsoluteIndex$1(e,l),p=arguments.length;for(0===p?r=n=0:1===p?(r=0,n=l-u):(r=p-2,n=min(max$1(toIntegerOrInfinity$2(t),0),l-u)),doesNotExceedSafeInteger(l+r-n),o=arraySpeciesCreate(c,n),i=0;i<n;i++)(a=u+i)in c&&createProperty$1(o,i,c[a]);if(o.length=n,r<n){for(i=u;i<l-n;i++)s=i+r,(a=i+n)in c?c[s]=c[a]:deletePropertyOrThrow$1(c,s);for(i=l;i>l-n+r;i--)deletePropertyOrThrow$1(c,i-1)}else if(r>n)for(i=l-n;i>u;i--)s=i+r-1,(a=i+n-1)in c?c[s]=c[a]:deletePropertyOrThrow$1(c,s);for(i=0;i<r;i++)c[i+u]=arguments[i+2];return setArrayLength(c,l-n+r),o}});var entryVirtual$b=entryVirtual$k,splice$7=entryVirtual$b("Array").splice,isPrototypeOf$c=objectIsPrototypeOf,method$9=splice$7,ArrayPrototype$8=Array.prototype,splice$6=function(e){var t=e.splice;return e===ArrayPrototype$8||isPrototypeOf$c(ArrayPrototype$8,e)&&t===ArrayPrototype$8.splice?method$9:t},parent$1h=splice$6,splice$5=parent$1h,parent$1g=splice$5,splice$4=parent$1g,parent$1f=splice$4,splice$3=parent$1f,splice$2=splice$3,splice$1=splice$2,_spliceInstanceProperty=getDefaultExportFromCjs(splice$1),$$16=_export;$$16({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var path$e=path$w,isNan$5=path$e.Number.isNaN,parent$1e=isNan$5,isNan$4=parent$1e,parent$1d=isNan$4,isNan$3=parent$1d,parent$1c=isNan$3,isNan$2=parent$1c,isNan$1=isNan$2,isNan=isNan$1,_Number$isNaN=getDefaultExportFromCjs(isNan),whitespaces$4="\t\n\v\f\r \u2028\u2029\ufeff",uncurryThis$e=functionUncurryThis,requireObjectCoercible$3=requireObjectCoercible$7,toString$9=toString$g,whitespaces$3=whitespaces$4,replace$3=uncurryThis$e("".replace),ltrim=RegExp("^["+whitespaces$3+"]+"),rtrim=RegExp("(^|[^"+whitespaces$3+"])["+whitespaces$3+"]+$"),createMethod$2=function(e){return function(t){var r=toString$9(requireObjectCoercible$3(t));return 1&e&&(r=replace$3(r,ltrim,"")),2&e&&(r=replace$3(r,rtrim,"$1")),r}},stringTrim={start:createMethod$2(1),end:createMethod$2(2),trim:createMethod$2(3)},global$9=global$s,fails$b=fails$z,uncurryThis$d=functionUncurryThis,toString$8=toString$g,trim$8=stringTrim.trim,whitespaces$2=whitespaces$4,$parseInt$1=global$9.parseInt,Symbol$2=global$9.Symbol,ITERATOR$4=Symbol$2&&Symbol$2.iterator,hex=/^[+-]?0x/i,exec$2=uncurryThis$d(hex.exec),FORCED$3=8!==$parseInt$1(whitespaces$2+"08")||22!==$parseInt$1(whitespaces$2+"0x16")||ITERATOR$4&&!fails$b((function(){$parseInt$1(Object(ITERATOR$4))})),numberParseInt=FORCED$3?function(e,t){var r=trim$8(toString$8(e));return $parseInt$1(r,t>>>0||(exec$2(hex,r)?16:10))}:$parseInt$1,$$15=_export,$parseInt=numberParseInt;$$15({global:!0,forced:parseInt!=numberParseInt},{parseInt:numberParseInt});var path$d=path$w,_parseInt$6=path$d.parseInt,parent$1b=_parseInt$6,_parseInt$5=parent$1b,parent$1a=_parseInt$5,_parseInt$4=parent$1a,parent$19=_parseInt$4,_parseInt$3=parent$19,_parseInt$2=_parseInt$3,_parseInt=_parseInt$2,_parseInt$1=getDefaultExportFromCjs(_parseInt),$$14=_export,$map=arrayIteration.map,arrayMethodHasSpeciesSupport=arrayMethodHasSpeciesSupport$5,HAS_SPECIES_SUPPORT=arrayMethodHasSpeciesSupport("map");$$14({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT},{map:function(e){return $map(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$a=entryVirtual$k,map$c=entryVirtual$a("Array").map,isPrototypeOf$b=objectIsPrototypeOf,method$8=map$c,ArrayPrototype$7=Array.prototype,map$b=function(e){var t=e.map;return e===ArrayPrototype$7||isPrototypeOf$b(ArrayPrototype$7,e)&&t===ArrayPrototype$7.map?method$8:t},parent$18=map$b,map$a=parent$18,parent$17=map$a,map$9=parent$17,parent$16=map$9,map$8=parent$16,map$7=map$8,map$6=map$7,_mapInstanceProperty=getDefaultExportFromCjs(map$6),$$13=_export,isArray$6=isArray$d;$$13({target:"Array",stat:!0},{isArray:isArray$6});var path$c=path$w,isArray$5=path$c.Array.isArray,parent$15=isArray$5,isArray$4=parent$15,parent$14=isArray$4,isArray$3=parent$14,parent$13=isArray$3,isArray$2=parent$13,isArray$1=isArray$2,isArray2=isArray$1,_Array$isArray=getDefaultExportFromCjs(isArray2),DESCRIPTORS$5=descriptors,uncurryThis$c=functionUncurryThis,call$g=functionCall,fails$a=fails$z,objectKeys=objectKeys$3,getOwnPropertySymbolsModule=objectGetOwnPropertySymbols,propertyIsEnumerableModule=objectPropertyIsEnumerable,toObject$3=toObject$c,IndexedObject$1=indexedObject,$assign=Object.assign,defineProperty$2=Object.defineProperty,concat2=uncurryThis$c([].concat),objectAssign=!$assign||fails$a((function(){if(DESCRIPTORS$5&&1!==$assign({b:1},$assign(defineProperty$2({},"a",{enumerable:!0,get:function(){defineProperty$2(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach((function(e){t[e]=e})),7!=$assign({},e)[r]||objectKeys($assign({},t)).join("")!=n}))?function(e,t){for(var r=toObject$3(e),n=arguments.length,o=1,i=getOwnPropertySymbolsModule.f,a=propertyIsEnumerableModule.f;n>o;)for(var s,c=IndexedObject$1(arguments[o++]),l=i?concat2(objectKeys(c),i(c)):objectKeys(c),u=l.length,p=0;u>p;)s=l[p++],DESCRIPTORS$5&&!call$g(a,c,s)||(r[s]=c[s]);return r}:$assign,$$12=_export,assign$7=objectAssign;$$12({target:"Object",stat:!0,arity:2,forced:Object.assign!==assign$7},{assign:assign$7});var path$b=path$w,assign$6=path$b.Object.assign,parent$12=assign$6,assign$5=parent$12,parent$11=assign$5,assign$4=parent$11,parent$10=assign$4,assign$3=parent$10,assign$2=assign$3,assign$1=assign$2,_Object$assign=getDefaultExportFromCjs(assign$1),get$2=get$3,_Reflect$get=getDefaultExportFromCjs(get$2),getIteratorMethod$7=getIteratorMethod$a,getIteratorMethod_1=getIteratorMethod$7,parent$$=getIteratorMethod_1,getIteratorMethod$6=parent$$,parent$_=getIteratorMethod$6,getIteratorMethod$5=parent$_,parent$Z=getIteratorMethod$5,getIteratorMethod$4=parent$Z,getIteratorMethod$3=getIteratorMethod$4,getIteratorMethod$2=getIteratorMethod$3,_getIteratorMethod=getDefaultExportFromCjs(getIteratorMethod$2),anObject$4=anObject$i,iteratorClose$2=iteratorClose$4,callWithSafeIterationClosing$1=function(e,t,r,n){try{return n?t(anObject$4(r)[0],r[1]):t(r)}catch(t){iteratorClose$2(e,"throw",t)}},bind$g=functionBindContext,call$f=functionCall,toObject$2=toObject$c,callWithSafeIterationClosing=callWithSafeIterationClosing$1,isArrayIteratorMethod=isArrayIteratorMethod$2,isConstructor3=isConstructor$4,lengthOfArrayLike$2=lengthOfArrayLike$a,createProperty=createProperty$6,getIterator$1=getIterator$3,getIteratorMethod$1=getIteratorMethod$a,$Array=Array,arrayFrom$1=function(e){var t=toObject$2(e),r=isConstructor3(this),n=arguments.length,o=n>1?arguments[1]:void 0,i=void 0!==o;i&&(o=bind$g(o,n>2?arguments[2]:void 0));var a,s,c,l,u,p,$=getIteratorMethod$1(t),f=0;if(!$||this===$Array&&isArrayIteratorMethod($))for(a=lengthOfArrayLike$2(t),s=r?new this(a):$Array(a);a>f;f++)p=i?o(t[f],f):t[f],createProperty(s,f,p);else for(u=(l=getIterator$1(t,$)).next,s=r?new this:[];!(c=call$f(u,l)).done;f++)p=i?callWithSafeIterationClosing(l,o,[c.value,f],!0):c.value,createProperty(s,f,p);return s.length=f,s},$$11=_export,from$8=arrayFrom$1,checkCorrectnessOfIteration=checkCorrectnessOfIteration$2,INCORRECT_ITERATION=!checkCorrectnessOfIteration((function(e){Array.from(e)}));$$11({target:"Array",stat:!0,forced:INCORRECT_ITERATION},{from:from$8});var path$a=path$w,from$7=path$a.Array.from,parent$Y=from$7,from$6=parent$Y,parent$X=from$6,from$5=parent$X,parent$W=from$5,from$4=parent$W,from$3=from$4,from$2=from$3,_Array$from=getDefaultExportFromCjs(from$2);function ownKeys$1(e,t){var r=_Object$keys(e);if(_Object$getOwnPropertySymbols){var n=_Object$getOwnPropertySymbols(e);t&&(n=_filterInstanceProperty(n).call(n,(function(t){return _Object$getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread2$1(e){for(var t=1;t<arguments.length;t++){var r,n,o=null!=arguments[t]?arguments[t]:{};t%2?_forEachInstanceProperty(r=ownKeys$1(Object(o),!0)).call(r,(function(t){_defineProperty$2(e,t,o[t])})):_Object$getOwnPropertyDescriptors?_Object$defineProperties(e,_Object$getOwnPropertyDescriptors(o)):_forEachInstanceProperty(n=ownKeys$1(Object(o))).call(n,(function(t){_Object$defineProperty(e,t,_Object$getOwnPropertyDescriptor(o,t))}))}return e}function _typeof$1(e){return(_typeof$1="function"==typeof _Symbol&&"symbol"==typeof _Symbol$iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof _Symbol&&e.constructor===_Symbol&&e!==_Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck$3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$3(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),_Object$defineProperty(e,_toPropertyKey$3(n.key),n)}}function _createClass$3(e,t,r){return t&&_defineProperties$3(e.prototype,t),r&&_defineProperties$3(e,r),_Object$defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty$2(e,t,r){return(t=_toPropertyKey$3(t))in e?_Object$defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toConsumableArray$1(e){return _arrayWithoutHoles$1(e)||_iterableToArray$1(e)||_unsupportedIterableToArray$2(e)||_nonIterableSpread$1()}function _arrayWithoutHoles$1(e){if(_Array$isArray(e))return _arrayLikeToArray$2(e)}function _iterableToArray$1(e){if(void 0!==_Symbol&&null!=_getIteratorMethod(e)||null!=e["@@iterator"])return _Array$from(e)}function _unsupportedIterableToArray$2(e,t){var r;if(e){if("string"==typeof e)return _arrayLikeToArray$2(e,t);var n=_sliceInstanceProperty(r=Object.prototype.toString.call(e)).call(r,8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?_Array$from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray$2(e,t):void 0}}function _arrayLikeToArray$2(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _nonIterableSpread$1(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toPrimitive$3(e,t){if("object"!==_typeof$3(e)||null===e)return e;var r=e[_Symbol$toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof$3(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey$3(e){var t=_toPrimitive$3(e,"string");return"symbol"===_typeof$3(t)?t:String(t)}var eventemitter3={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}function o(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function i(e,t,n,i,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new o(n,i||e,a),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}_Object$create&&(n.prototype=_Object$create(null),(new n).__proto__||(r=!1)),s.prototype.eventNames=function(){var e,n,o=[];if(0===this._eventsCount)return o;for(n in e=this._events)t.call(e,n)&&o.push(r?_sliceInstanceProperty(n).call(n,1):n);return _Object$getOwnPropertySymbols?_concatInstanceProperty(o).call(o,_Object$getOwnPropertySymbols(e)):o},s.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 o=0,i=n.length,a=new Array(i);o<i;o++)a[o]=n[o].fn;return a},s.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,o,i,a){var s=r?r+e:e;if(!this._events[s])return!1;var c,l,u=this._events[s],p=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,o),!0;case 5:return u.fn.call(u.context,t,n,o,i),!0;case 6:return u.fn.call(u.context,t,n,o,i,a),!0}for(l=1,c=new Array(p-1);l<p;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var $,f=u.length;for(l=0;l<f;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),p){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,n);break;case 4:u[l].fn.call(u[l].context,t,n,o);break;default:if(!c)for($=1,c=new Array(p-1);$<p;$++)c[$-1]=arguments[$];u[l].fn.apply(u[l].context,c)}}return!0},s.prototype.on=function(e,t,r){return i(this,e,t,r,!1)},s.prototype.once=function(e,t,r){return i(this,e,t,r,!0)},s.prototype.removeListener=function(e,t,n,o){var i=r?r+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var s=this._events[i];if(s.fn)s.fn!==t||o&&!s.once||n&&s.context!==n||a(this,i);else{for(var c=0,l=[],u=s.length;c<u;c++)(s[c].fn!==t||o&&!s[c].once||n&&s[c].context!==n)&&l.push(s[c]);l.length?this._events[i]=1===l.length?l[0]:l:a(this,i)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=r,s.EventEmitter=s,e.exports=s}(eventemitter3);var eventemitter3Exports=eventemitter3.exports,EventEmitter=getDefaultExportFromCjs(eventemitter3Exports),$$10=_export,$some=arrayIteration.some,arrayMethodIsStrict$3=arrayMethodIsStrict$6,STRICT_METHOD$2=arrayMethodIsStrict$3("some");$$10({target:"Array",proto:!0,forced:!STRICT_METHOD$2},{some:function(e){return $some(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$9=entryVirtual$k,some$6=entryVirtual$9("Array").some,isPrototypeOf$a=objectIsPrototypeOf,method$7=some$6,ArrayPrototype$6=Array.prototype,some$5=function(e){var t=e.some;return e===ArrayPrototype$6||isPrototypeOf$a(ArrayPrototype$6,e)&&t===ArrayPrototype$6.some?method$7:t},parent$V=some$5,some$4=parent$V,parent$U=some$4,some$3=parent$U,parent$T=some$3,some$2=parent$T,some$1=some$2,some2=some$1,_someInstanceProperty=getDefaultExportFromCjs(some2),toIntegerOrInfinity$1=toIntegerOrInfinity$6,toString$7=toString$g,requireObjectCoercible$2=requireObjectCoercible$7,$RangeError$2=RangeError,stringRepeat=function(e){var t=toString$7(requireObjectCoercible$2(this)),r="",n=toIntegerOrInfinity$1(e);if(n<0||n==1/0)throw $RangeError$2("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(r+=t);return r},uncurryThis$b=functionUncurryThis,toLength=toLength$2,toString$6=toString$g,$repeat=stringRepeat,requireObjectCoercible$1=requireObjectCoercible$7,repeat2=uncurryThis$b($repeat),stringSlice$2=uncurryThis$b("".slice),ceil=Math.ceil,createMethod$1=function(e){return function(t,r,n){var o,i,a=toString$6(requireObjectCoercible$1(t)),s=toLength(r),c=a.length,l=void 0===n?" ":toString$6(n);return s<=c||""==l?a:((i=repeat2(l,ceil((o=s-c)/l.length))).length>o&&(i=stringSlice$2(i,0,o)),e?a+i:i+a)}},stringPad={start:createMethod$1(!1),end:createMethod$1(!0)},userAgent$2=engineUserAgent,stringPadWebkitBug=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(userAgent$2),$$$=_export,$padStart=stringPad.start,WEBKIT_BUG=stringPadWebkitBug;$$$({target:"String",proto:!0,forced:WEBKIT_BUG},{padStart:function(e){return $padStart(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$8=entryVirtual$k,padStart$6=entryVirtual$8("String").padStart,isPrototypeOf$9=objectIsPrototypeOf,method$6=padStart$6,StringPrototype$2=String.prototype,padStart$5=function(e){var t=e.padStart;return"string"==typeof e||e===StringPrototype$2||isPrototypeOf$9(StringPrototype$2,e)&&t===StringPrototype$2.padStart?method$6:t},parent$S=padStart$5,padStart$4=parent$S,parent$R=padStart$4,padStart$3=parent$R,parent$Q=padStart$3,padStart$2=parent$Q,padStart$1=padStart$2,padStart2=padStart$1,_padStartInstanceProperty=getDefaultExportFromCjs(padStart2),engineIsBun="function"==typeof Bun&&Bun&&"string"==typeof Bun.version,global$8=global$s,apply$1=functionApply,isCallable$6=isCallable$r,ENGINE_IS_BUN=engineIsBun,USER_AGENT=engineUserAgent,arraySlice$3=arraySlice$7,validateArgumentsLength$3=validateArgumentsLength$5,Function$1=global$8.Function,WRAP=/MSIE .\./.test(USER_AGENT)||ENGINE_IS_BUN&&function(){var e=global$8.Bun.version.split(".");return e.length<3||0==e[0]&&(e[1]<3||3==e[1]&&0==e[2])}(),schedulersFix$2=function(e,t){var r=t?2:1;return WRAP?function(n,o){var i=validateArgumentsLength$3(arguments.length,1)>r,a=isCallable$6(n)?n:Function$1(n),s=i?arraySlice$3(arguments,r):[],c=i?function(){apply$1(a,this,s)}:a;return t?e(c,o):e(c)}:e},$$_=_export,global$7=global$s,schedulersFix$1=schedulersFix$2,setInterval$5=schedulersFix$1(global$7.setInterval,!0);$$_({global:!0,bind:!0,forced:global$7.setInterval!==setInterval$5},{setInterval:setInterval$5});var $$Z=_export,global$6=global$s,schedulersFix=schedulersFix$2,setTimeout$6=schedulersFix(global$6.setTimeout,!0);$$Z({global:!0,bind:!0,forced:global$6.setTimeout!==setTimeout$6},{setTimeout:setTimeout$6});var path$9=path$w,setInterval$4=path$9.setInterval,parent$P=setInterval$4,setInterval$3=parent$P,parent$O=setInterval$3,setInterval$2=parent$O,setInterval$1=setInterval$2,setInterval=setInterval$1,_setInterval=getDefaultExportFromCjs(setInterval),path$8=path$w,setTimeout$5=path$8.setTimeout,parent$N=setTimeout$5,setTimeout$4=parent$N,parent$M=setTimeout$4,setTimeout$3=parent$M,setTimeout$2=setTimeout$3,setTimeout$1=setTimeout$2,_setTimeout=getDefaultExportFromCjs(setTimeout$1),$$Y=_export,$every=arrayIteration.every,arrayMethodIsStrict$2=arrayMethodIsStrict$6,STRICT_METHOD$1=arrayMethodIsStrict$2("every");$$Y({target:"Array",proto:!0,forced:!STRICT_METHOD$1},{every:function(e){return $every(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$7=entryVirtual$k,every$6=entryVirtual$7("Array").every,isPrototypeOf$8=objectIsPrototypeOf,method$5=every$6,ArrayPrototype$5=Array.prototype,every$5=function(e){var t=e.every;return e===ArrayPrototype$5||isPrototypeOf$8(ArrayPrototype$5,e)&&t===ArrayPrototype$5.every?method$5:t},parent$L=every$5,every$4=parent$L,parent$K=every$4,every$3=parent$K,parent$J=every$3,every$2=parent$J,every$1=every$2,every2=every$1,_everyInstanceProperty=getDefaultExportFromCjs(every2),global$5=global$s,fails$9=fails$z,uncurryThis$a=functionUncurryThis,toString$5=toString$g,trim$7=stringTrim.trim,whitespaces$1=whitespaces$4,charAt$2=uncurryThis$a("".charAt),$parseFloat$1=global$5.parseFloat,Symbol$1=global$5.Symbol,ITERATOR$3=Symbol$1&&Symbol$1.iterator,FORCED$2=1/$parseFloat$1(whitespaces$1+"-0")!=-1/0||ITERATOR$3&&!fails$9((function(){$parseFloat$1(Object(ITERATOR$3))})),numberParseFloat=FORCED$2?function(e){var t=trim$7(toString$5(e)),r=$parseFloat$1(t);return 0===r&&"-"==charAt$2(t,0)?-0:r}:$parseFloat$1,$$X=_export,$parseFloat=numberParseFloat;$$X({global:!0,forced:parseFloat!=numberParseFloat},{parseFloat:numberParseFloat});var path$7=path$w,_parseFloat$6=path$7.parseFloat,parent$I=_parseFloat$6,_parseFloat$5=parent$I,parent$H=_parseFloat$5,_parseFloat$4=parent$H,parent$G=_parseFloat$4,_parseFloat$3=parent$G,_parseFloat$2=_parseFloat$3,_parseFloat=_parseFloat$2,_parseFloat$1=getDefaultExportFromCjs(_parseFloat),PROPER_FUNCTION_NAME=functionName.PROPER,fails$8=fails$z,whitespaces=whitespaces$4,non="
",stringTrimForced=function(e){return fails$8((function(){return!!whitespaces[e]()||non[e]()!==non||PROPER_FUNCTION_NAME&&whitespaces[e].name!==e}))},$$W=_export,$trim=stringTrim.trim,forcedStringTrimMethod=stringTrimForced;$$W({target:"String",proto:!0,forced:forcedStringTrimMethod("trim")},{trim:function(){return $trim(this)}});var entryVirtual$6=entryVirtual$k,trim$6=entryVirtual$6("String").trim,isPrototypeOf$7=objectIsPrototypeOf,method$4=trim$6,StringPrototype$1=String.prototype,trim$5=function(e){var t=e.trim;return"string"==typeof e||e===StringPrototype$1||isPrototypeOf$7(StringPrototype$1,e)&&t===StringPrototype$1.trim?method$4:t},parent$F=trim$5,trim$4=parent$F,parent$E=trim$4,trim$3=parent$E,parent$D=trim$3,trim$2=parent$D,trim$1=trim$2,trim2=trim$1,_trimInstanceProperty=getDefaultExportFromCjs(trim2),arraySlice$2=arraySliceSimple,floor$2=Math.floor,mergeSort=function(e,t){var r=e.length,n=floor$2(r/2);return r<8?insertionSort(e,t):merge(e,mergeSort(arraySlice$2(e,0,n),t),mergeSort(arraySlice$2(e,n),t),t)},insertionSort=function(e,t){for(var r,n,o=e.length,i=1;i<o;){for(n=i,r=e[i];n&&t(e[n-1],r)>0;)e[n]=e[--n];n!==i++&&(e[n]=r)}return e},merge=function(e,t,r,n){for(var o=t.length,i=r.length,a=0,s=0;a<o||s<i;)e[a+s]=a<o&&s<i?n(t[a],r[s])<=0?t[a++]:r[s++]:a<o?t[a++]:r[s++];return e},arraySort$1=mergeSort,userAgent$1=engineUserAgent,firefox=userAgent$1.match(/firefox\/(\d+)/i),engineFfVersion=!!firefox&&+firefox[1],UA=engineUserAgent,engineIsIeOrEdge=/MSIE|Trident/.test(UA),userAgent=engineUserAgent,webkit=userAgent.match(/AppleWebKit\/(\d+)\./),engineWebkitVersion=!!webkit&&+webkit[1],$$V=_export,uncurryThis$9=functionUncurryThis,aCallable$9=aCallable$l,toObject$1=toObject$c,lengthOfArrayLike$1=lengthOfArrayLike$a,deletePropertyOrThrow=deletePropertyOrThrow$2,toString$4=toString$g,fails$7=fails$z,internalSort=arraySort$1,arrayMethodIsStrict$1=arrayMethodIsStrict$6,FF=engineFfVersion,IE_OR_EDGE=engineIsIeOrEdge,V8=engineV8Version,WEBKIT=engineWebkitVersion,test=[],nativeSort=uncurryThis$9(test.sort),push$6=uncurryThis$9(test.push),FAILS_ON_UNDEFINED=fails$7((function(){test.sort(void 0)})),FAILS_ON_NULL=fails$7((function(){test.sort(null)})),STRICT_METHOD=arrayMethodIsStrict$1("sort"),STABLE_SORT=!fails$7((function(){if(V8)return V8<70;if(!(FF&&FF>3)){if(IE_OR_EDGE)return!0;if(WEBKIT)return WEBKIT<603;var e,t,r,n,o="";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++)test.push({k:t+n,v:r})}for(test.sort((function(e,t){return t.v-e.v})),n=0;n<test.length;n++)t=test[n].k.charAt(0),o.charAt(o.length-1)!==t&&(o+=t);return"DGBEFHACIJK"!==o}})),FORCED$1=FAILS_ON_UNDEFINED||!FAILS_ON_NULL||!STRICT_METHOD||!STABLE_SORT,getSortCompare=function(e){return function(t,r){return void 0===r?-1:void 0===t?1:void 0!==e?+e(t,r)||0:toString$4(t)>toString$4(r)?1:-1}};$$V({target:"Array",proto:!0,forced:FORCED$1},{sort:function(e){void 0!==e&&aCallable$9(e);var t=toObject$1(this);if(STABLE_SORT)return void 0===e?nativeSort(t):nativeSort(t,e);var r,n,o=[],i=lengthOfArrayLike$1(t);for(n=0;n<i;n++)n in t&&push$6(o,t[n]);for(internalSort(o,getSortCompare(e)),r=lengthOfArrayLike$1(o),n=0;n<r;)t[n]=o[n++];for(;n<i;)deletePropertyOrThrow(t,n++);return t}});var entryVirtual$5=entryVirtual$k,sort$6=entryVirtual$5("Array").sort,isPrototypeOf$6=objectIsPrototypeOf,method$3=sort$6,ArrayPrototype$4=Array.prototype,sort$5=function(e){var t=e.sort;return e===ArrayPrototype$4||isPrototypeOf$6(ArrayPrototype$4,e)&&t===ArrayPrototype$4.sort?method$3:t},parent$C=sort$5,sort$4=parent$C,parent$B=sort$4,sort$3=parent$B,parent$A=sort$3,sort$2=parent$A,sort$1=sort$2,sort2=sort$1,_sortInstanceProperty=getDefaultExportFromCjs(sort2),$$U=_export,uncurryThis$8=functionUncurryThis,$Date=Date,thisTimeValue=uncurryThis$8($Date.prototype.getTime);$$U({target:"Date",stat:!0},{now:function(){return thisTimeValue(new $Date)}});var _context,path$6=path$w,now$5=path$6.Date.now,parent$z=now$5,now$4=parent$z,parent$y=now$4,now$3=parent$y,parent$x=now$3,now$2=parent$x,now$1=now$2,now2=now$1,_Date$now=getDefaultExportFromCjs(now2),XG_DEBUG_OPEN="undefined"!=typeof window&&window.location&&_indexOfInstanceProperty(_context=window.location.href).call(_context,"xgplayerdebugger=1")>-1,STYLE={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},XGTAG="%c[xgplayer]",XG_DEBUG={config:{debug:XG_DEBUG_OPEN?3:0},logInfo:function(e){for(var t,r,n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];this.config.debug>=3&&(r=console).log.apply(r,_concatInstanceProperty(t=[XGTAG,STYLE.info,e]).call(t,o))},logWarn:function(e){for(var t,r,n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];this.config.debug>=1&&(r=console).warn.apply(r,_concatInstanceProperty(t=[XGTAG,STYLE.warn,e]).call(t,o))},logError:function(e){var t,r;if(!(this.config.debug<1)){for(var n=this.config.debug>=2?"trace":"error",o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];(r=console)[n].apply(r,_concatInstanceProperty(t=[XGTAG,STYLE.error,e]).call(t,i))}}},XgplayerTimeRange=function(){function e(t){_classCallCheck$3(this,e),this.bufferedList=t}return _createClass$3(e,[{key:"start",value:function(e){return this.bufferedList[e].start}},{key:"end",value:function(e){return this.bufferedList[e].end}},{key:"length",get:function(){return this.bufferedList.length}}]),e}(),util={};function checkIsIn(e,t){for(var r=0,n=t.length;r<n;r++)if(_indexOfInstanceProperty(e).call(e,t[r])>-1)return!0;return!1}util.createDom=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=document.createElement(t);return i.className=o,i.innerHTML=r,_forEachInstanceProperty(e=_Object$keys(n)).call(e,(function(e){var r=e,o=n[e];"video"===t||"audio"===t||"live-video"===t?o&&i.setAttribute(r,o):i.setAttribute(r,o)})),i},util.createDomFromHtml=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{var n=document.createElement("div");n.innerHTML=e;var o=n.children;if(n=null,o.length>0){var i;if(o=o[0],r&&util.addClass(o,r),t)_forEachInstanceProperty(i=_Object$keys(t)).call(i,(function(e){o.setAttribute(e,t[e])}));return o}return null}catch(e){return XG_DEBUG.logError("util.createDomFromHtml",e),null}},util.hasClass=function(e,t){if(!e||!t)return!1;try{return _someInstanceProperty(Array.prototype).call(e.classList,(function(e){return e===t}))}catch(n){var r=e.className&&"object"===_typeof$1(e.className)?e.getAttribute("class"):e.className;return r&&!!r.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},util.addClass=function(e,t){if(e&&t)try{var r;_forEachInstanceProperty(r=t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g)).call(r,(function(t){t&&e.classList.add(t)}))}catch(r){util.hasClass(e,t)||(e.className&&"object"===_typeof$1(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},util.removeClass=function(e,t){if(e&&t)try{var r;_forEachInstanceProperty(r=t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g)).call(r,(function(t){t&&e.classList.remove(t)}))}catch(r){var n;if(util.hasClass(e,t))_forEachInstanceProperty(n=t.split(/\s+/g)).call(n,(function(t){var r=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===_typeof$1(e.className)?e.setAttribute("class",e.getAttribute("class").replace(r," ")):e.className=e.className.replace(r," ")}))}},util.toggleClass=function(e,t){var r;e&&_forEachInstanceProperty(r=t.split(/\s+/g)).call(r,(function(t){util.hasClass(e,t)?util.removeClass(e,t):util.addClass(e,t)}))},util.classNames=function(){for(var e=arguments,t=[],r=function(r){if("String"===util.typeOf(e[r]))t.push(e[r]);else if("Object"===util.typeOf(e[r])){var n;_mapInstanceProperty(n=_Object$keys(e[r])).call(n,(function(n){e[r][n]&&t.push(n)}))}},n=0;n<arguments.length;n++)r(n);return t.join(" ")},util.findDom=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,r=arguments.length>1?arguments[1]:void 0;try{e=t.querySelector(r)}catch(n){XG_DEBUG.logError("util.findDom",n),0===_indexOfInstanceProperty(r).call(r,"#")&&(e=t.getElementById(_sliceInstanceProperty(r).call(r,1)))}return e},util.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},util.padStart=function(e,t,r){for(var n=String(r),o=t>>0,i=Math.ceil(o/n.length),a=[],s=String(e);i--;)a.push(n);return a.join("").substring(0,o-s.length)+s},util.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=_padStartInstanceProperty(util).call(util,Math.floor(e/3600),2,0),r=_padStartInstanceProperty(util).call(util,Math.floor((e-3600*t)/60),2,0),n=_padStartInstanceProperty(util).call(util,Math.floor(e-3600*t-60*r),2,0);return("00"===t?[r,n]:[t,r,n]).join(":")},util.event=function(e){if(e.touches){var t=e.touches[0]||e.changedTouches[0];e.clientX=t.clientX||0,e.clientY=t.clientY||0,e.offsetX=t.pageX-t.target.offsetLeft,e.offsetY=t.pageY-t.target.offsetTop}e._target=e.target||e.srcElement},util.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},util.deepCopy=function(e,t){var r;if("Object"===util.typeOf(t)&&"Object"===util.typeOf(e))return _forEachInstanceProperty(r=_Object$keys(t)).call(r,(function(r){if("Object"!==util.typeOf(t[r])||t[r]instanceof Node)if("Array"===util.typeOf(t[r])){var n;e[r]="Array"===util.typeOf(e[r])?_concatInstanceProperty(n=e[r]).call(n,t[r]):t[r]}else e[r]=t[r];else void 0===e[r]||void 0===e[r]?e[r]=t[r]:util.deepCopy(e[r],t[r])})),e},util.deepMerge=function(e,t){var r;return _mapInstanceProperty(r=_Object$keys(t)).call(r,(function(r){var n;"Array"===util.typeOf(t[r])&&"Array"===util.typeOf(e[r])?"Array"===util.typeOf(e[r])&&(n=e[r]).push.apply(n,_toConsumableArray$1(t[r])):util.typeOf(e[r])!==util.typeOf(t[r])||null===e[r]||"Object"!==util.typeOf(e[r])||t[r]instanceof window.Node?null!==t[r]&&(e[r]=t[r]):util.deepMerge(e[r],t[r])})),e},util.getBgImage=function(e){var t=(e.currentStyle||window.getComputedStyle(e,null)).backgroundImage;if(!t||"none"===t)return"";var r=document.createElement("a");return r.href=t.replace(/url\("|"\)/g,""),r.href},util.copyDom=function(e){if(e&&1===e.nodeType){var t=document.createElement(e.tagName);return _forEachInstanceProperty(Array.prototype).call(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),e.innerHTML&&(t.innerHTML=e.innerHTML),t}return""},util.setInterval=function(e,t,r,n){e._interval[t]||(e._interval[t]=_setInterval(_bindInstanceProperty(r).call(r,e),n))},util.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},util.setTimeout=function(e,t,r){e._timers||(e._timers=[]);var n=_setTimeout((function(){t(),util.clearTimeout(e,n)}),r);return e._timers.push(n),n},util.clearTimeout=function(e,t){var r=e._timers;if("Array"===util.typeOf(r)){for(var n=0;n<r.length;n++)if(r[n]===t){_spliceInstanceProperty(r).call(r,n,1),clearTimeout(t);break}}else clearTimeout(t)},util.clearAllTimers=function(e){var t=e._timers;"Array"===util.typeOf(t)&&(_mapInstanceProperty(t).call(t,(function(e){clearTimeout(e)})),e._timerIds=[])},util.createImgBtn=function(e,t,r,n){var o,i,a,s,c,l,u,p,$,f,d,y,h=util.createDom("xg-".concat(e),"",{},"xgplayer-".concat(e,"-img"));(h.style.backgroundImage='url("'.concat(t,'")'),r&&n)&&(_everyInstanceProperty(o=["px","rem","em","pt","dp","vw","vh","vm","%"]).call(o,(function(e){var t,o;return!(_indexOfInstanceProperty(r).call(r,e)>-1&&_indexOfInstanceProperty(n).call(n,e)>-1)||(u=_parseFloat$1(_trimInstanceProperty(t=_sliceInstanceProperty(r).call(r,0,_indexOfInstanceProperty(r).call(r,e))).call(t)),p=_parseFloat$1(_trimInstanceProperty(o=_sliceInstanceProperty(n).call(n,0,_indexOfInstanceProperty(n).call(n,e))).call(o)),$=e,!1)})),h.style.width=_concatInstanceProperty(i="".concat(u)).call(i,$),h.style.height=_concatInstanceProperty(a="".concat(p)).call(a,$),h.style.backgroundSize=_concatInstanceProperty(s=_concatInstanceProperty(c=_concatInstanceProperty(l="".concat(u)).call(l,$," ")).call(c,p)).call(s,$),h.style.margin="start"===e?_concatInstanceProperty(f=_concatInstanceProperty(d=_concatInstanceProperty(y="-".concat(p/2)).call(y,$," auto auto -")).call(d,u/2)).call(f,$):"auto 5px auto 5px");return h},util.Hex2RGBA=function(e,t){var r,n=[];if(/^\#[0-9A-F]{3}$/i.test(e)){var o="#";e.replace(/[0-9A-F]/gi,(function(e){o+=e+e})),e=o}return/^#[0-9A-F]{6}$/i.test(e)?(e.replace(/[0-9A-F]{2}/gi,(function(e){n.push(_parseInt$1(e,16))})),_concatInstanceProperty(r="rgba(".concat(n.join(","),", ")).call(r,t,")")):"rgba(255, 255, 255, 0.1)"},util.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},util.checkIsFunction=function(e){return e&&"function"==typeof e},util.checkIsObject=function(e){return null!==e&&"object"===_typeof$1(e)},util.hide=function(e){e.style.display="none"},util.show=function(e,t){e.style.display=t||"block"},util.isUndefined=function(e){if(null==e)return!0},util.isNotNull=function(e){return!(null==e)},util.setStyleFromCsstext=function(e,t){if(t)if("String"===util.typeOf(t)){var r=t.replace(/\s+/g,"").split(";");_mapInstanceProperty(r).call(r,(function(t){if(t){var r=t.split(":");r.length>1&&(e.style[r[0]]=r[1])}}))}else{var n;_mapInstanceProperty(n=_Object$keys(t)).call(n,(function(r){e.style[r]=t[r]}))}},util.filterStyleFromText=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],n=e.style.cssText;if(!n)return{};var o=n.replace(/\s+/g,"").split(";"),i={},a={};return _mapInstanceProperty(o).call(o,(function(e){if(e){var t=e.split(":");t.length>1&&(checkIsIn(t[0],r)?i[t[0]]=t[1]:a[t[0]]=t[1])}})),e.setAttribute("style",""),_mapInstanceProperty(t=_Object$keys(a)).call(t,(function(t){e.style[t]=a[t]})),i},util.getStyleFromCsstext=function(e){var t=e.style.cssText;if(!t)return{};var r=t.replace(/\s+/g,"").split(";"),n={};return _mapInstanceProperty(r).call(r,(function(e){if(e){var t=e.split(":");t.length>1&&(n[t[0]]=t[1])}})),n},util.preloadImg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){var n=new window.Image;n.onload=function(e){n=null,t&&t(e)},n.onerror=function(e){n=null,r&&r(e)},n.src=e}},util.stopPropagation=function(e){e&&e.stopPropagation()},util.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},util.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},util.checkTouchSupport=function(){return"ontouchstart"in window},util.getBuffered2=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,r=[],n=0;n<e.length;n++)r.push({start:e.start(n)<.5?0:e.start(n),end:e.end(n)});_sortInstanceProperty(r).call(r,(function(e,t){var r=e.start-t.start;return r||t.end-e.end}));var o=[];if(t)for(var i=0;i<r.length;i++){var a=o.length;if(a){var s=o[a-1].end;r[i].start-s<t?r[i].end>s&&(o[a-1].end=r[i].end):o.push(r[i])}else o.push(r[i])}else o=r;return new XgplayerTimeRange(o)},util.getEventPos=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e.touches&&e.touches.length>0&&(e=e.touches[0]),{x:e.x/t,y:e.y/t,clientX:e.clientX/t,clientY:e.clientY/t,offsetX:e.offsetX/t,offsetY:e.offsetY/t,pageX:e.pageX/t,pageY:e.pageY/t}},util.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},util.getHostFromUrl=function(e){if("String"!==util.typeOf(e))return"";var t=e.split("/"),r="";return t.length>3&&t[2]&&(r=t[2]),r},util.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},util.isMSE=function(e){return e.media&&(e=e.media),!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},util.isBlob=function(e){return"string"==typeof e&&/^blob/.test(e)},util.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=_parseInt$1(e)}catch(t){e=0}return t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=_parseInt$1(window.performance.now())),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var r=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?r:3&r|8).toString(16)}))},util.createEvent=function(e){var t;return"function"==typeof window.Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},util.adjustTimeByDuration=function(e,t,r){return t&&e&&(e>t||r&&e<t)?t:e},util.createPositionBar=function(e,t){var r=util.createDom("xg-bar","",{"data-index":-1},e);return t.appendChild(r),r},util.getTransformStyle=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{x:0,y:0,scale:1,rotate:0},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n={scale:"".concat(t.scale||1),translate:_concatInstanceProperty(e="".concat(t.x||0,"%, ")).call(e,t.y||0,"%"),rotate:"".concat(t.rotate||0,"deg")},o=_Object$keys(n);return _forEachInstanceProperty(o).call(o,(function(e){var t,o=new RegExp("".concat(e,"\\([^\\(]+\\)"),"g"),i=_concatInstanceProperty(t="".concat(e,"(")).call(t,n[e],")");o.test(r)?(o.lastIndex=-1,r=r.replace(o,i)):r+="".concat(i," ")})),r},util.convertDeg=function(e){return Math.abs(e)<=1?360*e:e%360},util.getIndexByTime=function(e,t){var r=t.length,n=-1;if(r<1)return n;if(e<=t[0].end||r<2)n=0;else if(e>t[r-1].end)n=r-1;else for(var o=1;o<r;o++)if(e>t[o-1].end&&e<=t[o].end){n=o;break}return n},util.getOffsetCurrentTime=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,n=-1;if((n=r>=0&&r<t.length?r:util.getIndexByTime(e,t))<0)return-1;var o=t.length,i=t[n],a=i.start,s=i.end,c=i.cTime,l=i.offset;return e<a?c:e>=a&&e<=s?e-l:e>s&&n>=o-1?s:-1},util.getCurrentTimeByOffset=function(e,t){var r=-1;if(!t||t.length<0)return e;for(var n=0;n<t.length;n++)if(e<=t[n].duration){r=n;break}if(-1!==r){var o=t[r].start;return r-1<0?o+e:o+(e-t[r-1].duration)}return e};var version="3.0.21-rc.21",ERROR_MAP={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},Errors=_createClass$3((function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null};_classCallCheck$3(this,e);var n=t&&t.i18n?t.i18n.ERROR_TYPES:null;if(t.media){var o,i=r.mediaError?r.mediaError:t.media.error||{},a=t.duration,s=t.currentTime,c=t.ended,l=t.src,u=t.currentSrc,p=t.media,$=p.readyState,f=p.networkState,d=r.errorCode||i.code;ERROR_MAP[d]&&(d=ERROR_MAP[d]);var y={playerVersion:version,currentTime:s,duration:a,ended:c,readyState:$,networkState:f,src:l||u,errorType:r.errorType,errorCode:d,message:r.errorMessage||i.message,mediaError:i,originError:r.originError?r.originError.stack:"",host:util.getHostFromUrl(l||u)};return r.ext&&_mapInstanceProperty(o=_Object$keys(r.ext)).call(o,(function(e){y[e]=r.ext[e]})),y}if(arguments.length>1){for(var h={playerVersion:version,domain:document.domain},_=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],g=0;g<arguments.length;g++)h[_[g]]=arguments[g];return h.ex=n?(n[arguments[0]]||{}).msg:"",h}})),ERROR="error",DESTROY="destroy",URL_CHANGE="urlchange";function callHandler(e,t,r){for(var n,o=arguments.length,i=new Array(o>3?o-3:0),a=3;a<o;a++)i[a-3]=arguments[a];var s,c=t.call.apply(t,_concatInstanceProperty(n=[e]).call(n,i));r&&"function"==typeof r&&(c&&c.then?c.then((function(){for(var t,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r.call.apply(r,_concatInstanceProperty(t=[e]).call(t,o))})):r.call.apply(r,_concatInstanceProperty(s=[e]).call(s,i)))}function hook(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{pre:null,next:null};return this.__hooks||(this.__hooks={}),!this.__hooks[e]&&(this.__hooks[e]=null),_bindInstanceProperty(r=function(){var r,o=arguments,i=this;if(n.pre)try{var a,s;(s=n.pre).call.apply(s,_concatInstanceProperty(a=[this]).call(a,_sliceInstanceProperty(Array.prototype).call(arguments)))}catch(t){var c,l;throw t.message=_concatInstanceProperty(c=_concatInstanceProperty(l="[pluginName: ".concat(this.pluginName,":")).call(l,e,":pre error] >> ")).call(c,t.message),t}if(this.__hooks&&this.__hooks[e])try{var u,p=runHooks(this,e,t);if(p)if(p.then)p.then((function(e){var r;!1!==e&&callHandler.apply(void 0,_concatInstanceProperty(r=[i,t,n.next]).call(r,_toConsumableArray$1(o)))})).catch((function(e){throw e}));else callHandler.apply(void 0,_concatInstanceProperty(u=[this,t,n.next]).call(u,_sliceInstanceProperty(Array.prototype).call(arguments)));else if(void 0===p){var $;callHandler.apply(void 0,_concatInstanceProperty($=[this,t,n.next]).call($,_sliceInstanceProperty(Array.prototype).call(arguments)))}}catch(t){var f,d;throw t.message=_concatInstanceProperty(f=_concatInstanceProperty(d="[pluginName: ".concat(this.pluginName,":")).call(d,e,"] >> ")).call(f,t.message),t}else callHandler.apply(void 0,_concatInstanceProperty(r=[this,t,n.next]).call(r,_sliceInstanceProperty(Array.prototype).call(arguments)))}).call(r,this)}function findHookIndex(e,t){var r=this.__hooks;if(!r||!_Array$isArray(r[e]))return-1;for(var n=r[e],o=0;o<n.length;o++)if(n[o]===t)return o;return-1}function useHooks(e,t){var r=this.__hooks;if(r)return r.hasOwnProperty(e)?(_Array$isArray(r[e])||(r[e]=[]),-1===findHookIndex.call(this,e,t)&&r[e].push(t),!0):(console.warn("has no supported hook which name [".concat(e,"]")),!1)}function removeHooks(e,t){var r=this.__hooks;if(r)if(_Array$isArray(r[e])){var n=r[e],o=findHookIndex.call(this,e,t);-1!==o&&_spliceInstanceProperty(n).call(n,o,1)}else r[e]&&(r[e]=null)}function hooksDescriptor(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.__hooks={},t&&_mapInstanceProperty(t).call(t,(function(t){e.__hooks[t]=null})),_Object$defineProperty(e,"hooks",{get:function(){var t;return e.__hooks&&_mapInstanceProperty(t=_Object$keys(e.__hooks)).call(t,(function(t){if(e.__hooks[t])return t}))}})}function delHooksDescriptor(e){e.__hooks=null}function runHooks(e,t,r){for(var n=arguments.length,o=new Array(n>3?n-3:0),i=3;i<n;i++)o[i-3]=arguments[i];if(e.__hooks&&_Array$isArray(e.__hooks[t])){var a,s=e.__hooks[t],c=-1;return function e(t,r,n){for(var o,i,a=arguments.length,l=new Array(a>3?a-3:0),u=3;u<a;u++)l[u-3]=arguments[u];if(c++,0===s.length||c===s.length)return n.call.apply(n,_concatInstanceProperty(i=[t,t]).call(i,l));var p,$=s[c],f=$.call.apply($,_concatInstanceProperty(o=[t,t]).call(o,l));return f&&f.then?f.then((function(o){var i;return!1===o?null:e.apply(void 0,_concatInstanceProperty(i=[t,r,n]).call(i,l))})).catch((function(e){console.warn("[runHooks]".concat(r," reject"),e.message)})):!1!==f?e.apply(void 0,_concatInstanceProperty(p=[t,r,n]).call(p,l)):void 0}.apply(void 0,_concatInstanceProperty(a=[e,t,r]).call(a,o))}var l;return r.call.apply(r,_concatInstanceProperty(l=[e,e]).call(l,o))}function showErrorMsg(e,t){var r;XG_DEBUG.logError(_concatInstanceProperty(r="[".concat(e,"] event or callback cant be undefined or null when call ")).call(r,t))}var BasePlugin=function(){function e(t){_classCallCheck$3(this,e),util.checkIsFunction(this.beforeCreate)&&this.beforeCreate(t),hooksDescriptor(this),this.__args=t,this.__events={},this.__onceEvents={},this.config=t.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(t)}return _createClass$3(e,[{key:"beforeCreate",value:function(e){}},{key:"afterCreate",value:function(){}},{key:"beforePlayerInit",value:function(){}},{key:"onPluginsReady",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"destroy",value:function(){}},{key:"__init",value:function(e){this.player=e.player,this.playerConfig=e.player&&e.player.config,this.pluginName=e.pluginName?e.pluginName.toLowerCase():this.constructor.pluginName.toLowerCase(),this.logger=e.player&&e.player.logger}},{key:"updateLang",value:function(e){e||(e=this.lang)}},{key:"lang",get:function(){return this.player.lang}},{key:"i18n",get:function(){return this.player.i18n}},{key:"i18nKeys",get:function(){return this.player.i18nKeys}},{key:"domEventType",get:function(){var e=util.checkTouchSupport()?"touch":"mouse";return!this.playerConfig||"touch"!==this.playerConfig.domEventType&&"mouse"!==this.playerConfig.domEventType||(e=this.playerConfig.domEventType),e}},{key:"on",value:function(e,t){var r=this;e&&t&&this.player?"string"==typeof e?(this.__events[e]=t,this.player.on(e,t)):_Array$isArray(e)&&_forEachInstanceProperty(e).call(e,(function(e){r.__events[e]=t,r.player.on(e,t)})):showErrorMsg(this.pluginName,"plugin.on(event, callback)")}},{key:"once",value:function(e,t){var r=this;e&&t&&this.player?"string"==typeof e?(this.__onceEvents[e]=t,this.player.once(e,t)):_Array$isArray(e)&&_forEachInstanceProperty(e).call(e,(function(n){r.__onceEvents[n]=t,r.player.once(e,t)})):showErrorMsg(this.pluginName,"plugin.once(event, callback)")}},{key:"off",value:function(e,t){var r=this;e&&t&&this.player?"string"==typeof e?(delete this.__events[e],this.player.off(e,t)):_Array$isArray(e)&&_forEachInstanceProperty(e).call(e,(function(n){delete r.__events[e],r.player.off(n,t)})):showErrorMsg(this.pluginName,"plugin.off(event, callback)")}},{key:"offAll",value:function(){var e,t=this;_forEachInstanceProperty(e=["__events","__onceEvents"]).call(e,(function(e){var r;_forEachInstanceProperty(r=_Object$keys(t[e])).call(r,(function(r){t[e][r]&&t.off(r,t[e][r]),r&&delete t[e][r]}))})),this.__events={},this.__onceEvents={}}},{key:"emit",value:function(e){var t,r;if(this.player){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];(r=this.player).emit.apply(r,_concatInstanceProperty(t=[e]).call(t,o))}}},{key:"emitUserAction",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.player){var n=_objectSpread2$1(_objectSpread2$1({},r),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,n)}}},{key:"hook",value:function(e,t){var r;return hook.call.apply(hook,_concatInstanceProperty(r=[this]).call(r,_sliceInstanceProperty(Array.prototype).call(arguments)))}},{key:"useHooks",value:function(e,t){for(var r,n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];return useHooks.call.apply(useHooks,_concatInstanceProperty(r=[this]).call(r,_sliceInstanceProperty(Array.prototype).call(arguments)))}},{key:"removeHooks",value:function(e,t){for(var r,n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];return removeHooks.call.apply(removeHooks,_concatInstanceProperty(r=[this]).call(r,_sliceInstanceProperty(Array.prototype).call(arguments)))}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.player)return r&&(t.pluginName=r),this.player.registerPlugin({plugin:e,options:t})}},{key:"getPlugin",value:function(e){return this.player?this.player.getPlugin(e):null}},{key:"__destroy",value:function(){var e,t=this,r=this.player,n=this.pluginName;this.offAll(),util.clearAllTimers(this),util.checkIsFunction(this.destroy)&&this.destroy(),_mapInstanceProperty(e=["player","playerConfig","pluginName","logger","__args","__hooks"]).call(e,(function(e){t[e]=null})),r.unRegisterPlugin(n),delHooksDescriptor(this)}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&_Object$defineProperty(e,r,t[r])}},{key:"defineMethod",value:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&"function"==typeof t[r]&&_Object$defineProperty(e,r,{configurable:!0,value:t[r]})}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),e}(),$$T=_export,$findIndex=arrayIteration.findIndex,FIND_INDEX="findIndex",SKIPS_HOLES=!0;FIND_INDEX in[]&&Array(1)[FIND_INDEX]((function(){SKIPS_HOLES=!1})),$$T({target:"Array",proto:!0,forced:SKIPS_HOLES},{findIndex:function(e){return $findIndex(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$4=entryVirtual$k,findIndex$6=entryVirtual$4("Array").findIndex,isPrototypeOf$5=objectIsPrototypeOf,method$2=findIndex$6,ArrayPrototype$3=Array.prototype,findIndex$5=function(e){var t=e.findIndex;return e===ArrayPrototype$3||isPrototypeOf$5(ArrayPrototype$3,e)&&t===ArrayPrototype$3.findIndex?method$2:t},parent$w=findIndex$5,findIndex$4=parent$w,parent$v=findIndex$4,findIndex$3=parent$v,parent$u=findIndex$3,findIndex$2=parent$u,findIndex$1=findIndex$2,findIndex2=findIndex$1,_findIndexInstanceProperty=getDefaultExportFromCjs(findIndex2),fails$6=fails$z,wellKnownSymbol$4=wellKnownSymbol$r,DESCRIPTORS$4=descriptors,IS_PURE=isPure,ITERATOR$2=wellKnownSymbol$4("iterator"),urlConstructorDetection=!fails$6((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),r+=n+e})),IS_PURE&&!e.toJSON||!t.size&&(IS_PURE||!DESCRIPTORS$4)||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[ITERATOR$2]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host})),uncurryThis$7=functionUncurryThis,maxInt=2147483647,base=36,tMin=1,tMax=26,skew=38,damp=700,initialBias=72,initialN=128,delimiter="-",regexNonASCII=/[^\0-\u007E]/,regexSeparators=/[.\u3002\uFF0E\uFF61]/g,OVERFLOW_ERROR="Overflow: input needs wider integers to process",baseMinusTMin=base-tMin,$RangeError$1=RangeError,exec$1=uncurryThis$7(regexSeparators.exec),floor$1=Math.floor,fromCharCode$1=String.fromCharCode,charCodeAt=uncurryThis$7("".charCodeAt),join$3=uncurryThis$7([].join),push$5=uncurryThis$7([].push),replace$2=uncurryThis$7("".replace),split$2=uncurryThis$7("".split),toLowerCase$1=uncurryThis$7("".toLowerCase),ucs2decode=function(e){for(var t=[],r=0,n=e.length;r<n;){var o=charCodeAt(e,r++);if(o>=55296&&o<=56319&&r<n){var i=charCodeAt(e,r++);56320==(64512&i)?push$5(t,((1023&o)<<10)+(1023&i)+65536):(push$5(t,o),r--)}else push$5(t,o)}return t},digitToBasic=function(e){return e+22+75*(e<26)},adapt=function(e,t,r){var n=0;for(e=r?floor$1(e/damp):e>>1,e+=floor$1(e/t);e>baseMinusTMin*tMax>>1;)e=floor$1(e/baseMinusTMin),n+=base;return floor$1(n+(baseMinusTMin+1)*e/(e+skew))},encode$1=function(e){var t,r,n=[],o=(e=ucs2decode(e)).length,i=initialN,a=0,s=initialBias;for(t=0;t<e.length;t++)(r=e[t])<128&&push$5(n,fromCharCode$1(r));var c=n.length,l=c;for(c&&push$5(n,delimiter);l<o;){var u=maxInt;for(t=0;t<e.length;t++)(r=e[t])>=i&&r<u&&(u=r);var p=l+1;if(u-i>floor$1((maxInt-a)/p))throw $RangeError$1(OVERFLOW_ERROR);for(a+=(u-i)*p,i=u,t=0;t<e.length;t++){if((r=e[t])<i&&++a>maxInt)throw $RangeError$1(OVERFLOW_ERROR);if(r==i){for(var $=a,f=base;;){var d=f<=s?tMin:f>=s+tMax?tMax:f-s;if($<d)break;var y=$-d,h=base-d;push$5(n,fromCharCode$1(digitToBasic(d+y%h))),$=floor$1(y/h),f+=base}push$5(n,fromCharCode$1(digitToBasic($))),s=adapt(a,p,l==c),a=0,l++}}a++,i++}return join$3(n,"")},stringPunycodeToAscii=function(e){var t,r,n=[],o=split$2(replace$2(toLowerCase$1(e),regexSeparators,"."),".");for(t=0;t<o.length;t++)r=o[t],push$5(n,exec$1(regexNonASCII,r)?"xn--"+encode$1(r):r);return join$3(n,".")},defineBuiltIn$2=defineBuiltIn$8,defineBuiltIns$2=function(e,t,r){for(var n in t)r&&r.unsafe&&e[n]?e[n]=t[n]:defineBuiltIn$2(e,n,t[n],r);return e},$$S=_export,global$4=global$s,call$e=functionCall,uncurryThis$6=functionUncurryThis,DESCRIPTORS$3=descriptors,USE_NATIVE_URL$2=urlConstructorDetection,defineBuiltIn$1=defineBuiltIn$8,defineBuiltInAccessor$2=defineBuiltInAccessor$5,defineBuiltIns$1=defineBuiltIns$2,setToStringTag$2=setToStringTag$9,createIteratorConstructor=iteratorCreateConstructor,InternalStateModule$3=internalState,anInstance$3=anInstance$5,isCallable$5=isCallable$r,hasOwn$5=hasOwnProperty_1,bind$f=functionBindContext,classof$4=classof$e,anObject$3=anObject$i,isObject$6=isObject$m,$toString$1=toString$g,create$1=objectCreate,createPropertyDescriptor=createPropertyDescriptor$8,getIterator=getIterator$3,getIteratorMethod=getIteratorMethod$a,validateArgumentsLength$2=validateArgumentsLength$5,wellKnownSymbol$3=wellKnownSymbol$r,arraySort=arraySort$1,ITERATOR$1=wellKnownSymbol$3("iterator"),URL_SEARCH_PARAMS="URLSearchParams",URL_SEARCH_PARAMS_ITERATOR=URL_SEARCH_PARAMS+"Iterator",setInternalState$3=InternalStateModule$3.set,getInternalParamsState=InternalStateModule$3.getterFor(URL_SEARCH_PARAMS),getInternalIteratorState=InternalStateModule$3.getterFor(URL_SEARCH_PARAMS_ITERATOR),getOwnPropertyDescriptor5=Object.getOwnPropertyDescriptor,safeGetBuiltIn=function(e){if(!DESCRIPTORS$3)return global$4[e];var t=getOwnPropertyDescriptor5(global$4,e);return t&&t.value},nativeFetch=safeGetBuiltIn("fetch"),NativeRequest=safeGetBuiltIn("Request"),Headers$1=safeGetBuiltIn("Headers"),RequestPrototype=NativeRequest&&NativeRequest.prototype,HeadersPrototype=Headers$1&&Headers$1.prototype,RegExp$1=global$4.RegExp,TypeError$2=global$4.TypeError,decodeURIComponent=global$4.decodeURIComponent,encodeURIComponent$1=global$4.encodeURIComponent,charAt$1=uncurryThis$6("".charAt),join$2=uncurryThis$6([].join),push$4=uncurryThis$6([].push),replace$1=uncurryThis$6("".replace),shift$1=uncurryThis$6([].shift),splice2=uncurryThis$6([].splice),split$1=uncurryThis$6("".split),stringSlice$1=uncurryThis$6("".slice),plus=/\+/g,sequences=Array(4),percentSequence=function(e){return sequences[e-1]||(sequences[e-1]=RegExp$1("((?:%[\\da-f]{2}){"+e+"})","gi"))},percentDecode=function(e){try{return decodeURIComponent(e)}catch(t){return e}},deserialize=function(e){var t=replace$1(e,plus," "),r=4;try{return decodeURIComponent(t)}catch(e){for(;r;)t=replace$1(t,percentSequence(r--),percentDecode);return t}},find2=/[!'()~]|%20/g,replacements={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},replacer=function(e){return replacements[e]},serialize=function(e){return replace$1(encodeURIComponent$1(e),find2,replacer)},URLSearchParamsIterator=createIteratorConstructor((function(e,t){setInternalState$3(this,{type:URL_SEARCH_PARAMS_ITERATOR,iterator:getIterator(getInternalParamsState(e).entries),kind:t})}),"Iterator",(function(){var e=getInternalIteratorState(this),t=e.kind,r=e.iterator.next(),n=r.value;return r.done||(r.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),r}),!0),URLSearchParamsState=function(e){this.entries=[],this.url=null,void 0!==e&&(isObject$6(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===charAt$1(e,0)?stringSlice$1(e,1):e:$toString$1(e)))};URLSearchParamsState.prototype={type:URL_SEARCH_PARAMS,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,o,i,a,s,c=getIteratorMethod(e);if(c)for(r=(t=getIterator(e,c)).next;!(n=call$e(r,t)).done;){if(i=(o=getIterator(anObject$3(n.value))).next,(a=call$e(i,o)).done||(s=call$e(i,o)).done||!call$e(i,o).done)throw TypeError$2("Expected sequence with length 2");push$4(this.entries,{key:$toString$1(a.value),value:$toString$1(s.value)})}else for(var l in e)hasOwn$5(e,l)&&push$4(this.entries,{key:l,value:$toString$1(e[l])})},parseQuery:function(e){if(e)for(var t,r,n=split$1(e,"&"),o=0;o<n.length;)(t=n[o++]).length&&(r=split$1(t,"="),push$4(this.entries,{key:deserialize(shift$1(r)),value:deserialize(join$2(r,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],n=0;n<t.length;)e=t[n++],push$4(r,serialize(e.key)+"="+serialize(e.value));return join$2(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var URLSearchParamsConstructor=function(){anInstance$3(this,URLSearchParamsPrototype);var e=setInternalState$3(this,new URLSearchParamsState(arguments.length>0?arguments[0]:void 0));DESCRIPTORS$3||(this.length=e.entries.length)},URLSearchParamsPrototype=URLSearchParamsConstructor.prototype;if(defineBuiltIns$1(URLSearchParamsPrototype,{append:function(e,t){validateArgumentsLength$2(arguments.length,2);var r=getInternalParamsState(this);push$4(r.entries,{key:$toString$1(e),value:$toString$1(t)}),DESCRIPTORS$3||this.length++,r.updateURL()},delete:function(e){validateArgumentsLength$2(arguments.length,1);for(var t=getInternalParamsState(this),r=t.entries,n=$toString$1(e),o=0;o<r.length;)r[o].key===n?splice2(r,o,1):o++;DESCRIPTORS$3||(this.length=r.length),t.updateURL()},get:function(e){validateArgumentsLength$2(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){validateArgumentsLength$2(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),n=[],o=0;o<t.length;o++)t[o].key===r&&push$4(n,t[o].value);return n},has:function(e){validateArgumentsLength$2(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function(e,t){validateArgumentsLength$2(arguments.length,1);for(var r,n=getInternalParamsState(this),o=n.entries,i=!1,a=$toString$1(e),s=$toString$1(t),c=0;c<o.length;c++)(r=o[c]).key===a&&(i?splice2(o,c--,1):(i=!0,r.value=s));i||push$4(o,{key:a,value:s}),DESCRIPTORS$3||(this.length=o.length),n.updateURL()},sort:function(){var e=getInternalParamsState(this);arraySort(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,r=getInternalParamsState(this).entries,n=bind$f(e,arguments.length>1?arguments[1]:void 0),o=0;o<r.length;)n((t=r[o++]).value,t.key,this)},keys:function(){return new URLSearchParamsIterator(this,"keys")},values:function(){return new URLSearchParamsIterator(this,"values")},entries:function(){return new URLSearchParamsIterator(this,"entries")}},{enumerable:!0}),defineBuiltIn$1(URLSearchParamsPrototype,ITERATOR$1,URLSearchParamsPrototype.entries,{name:"entries"}),defineBuiltIn$1(URLSearchParamsPrototype,"toString",(function(){return getInternalParamsState(this).serialize()}),{enumerable:!0}),DESCRIPTORS$3&&defineBuiltInAccessor$2(URLSearchParamsPrototype,"size",{get:function(){return getInternalParamsState(this).entries.length},configurable:!0,enumerable:!0}),setToStringTag$2(URLSearchParamsConstructor,URL_SEARCH_PARAMS),$$S({global:!0,constructor:!0,forced:!USE_NATIVE_URL$2},{URLSearchParams:URLSearchParamsConstructor}),!USE_NATIVE_URL$2&&isCallable$5(Headers$1)){var headersHas=uncurryThis$6(HeadersPrototype.has),headersSet=uncurryThis$6(HeadersPrototype.set),wrapRequestOptions=function(e){if(isObject$6(e)){var t,r=e.body;if(classof$4(r)===URL_SEARCH_PARAMS)return t=e.headers?new Headers$1(e.headers):new Headers$1,headersHas(t,"content-type")||headersSet(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),create$1(e,{body:createPropertyDescriptor(0,$toString$1(r)),headers:createPropertyDescriptor(0,t)})}return e};if(isCallable$5(nativeFetch)&&$$S({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return nativeFetch(e,arguments.length>1?wrapRequestOptions(arguments[1]):{})}}),isCallable$5(NativeRequest)){var RequestConstructor=function(e){return anInstance$3(this,RequestPrototype),new NativeRequest(e,arguments.length>1?wrapRequestOptions(arguments[1]):{})};RequestPrototype.constructor=RequestConstructor,RequestConstructor.prototype=RequestPrototype,$$S({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:RequestConstructor})}}var EOF,web_urlSearchParams_constructor={URLSearchParams:URLSearchParamsConstructor,getState:getInternalParamsState},$$R=_export,DESCRIPTORS$2=descriptors,USE_NATIVE_URL$1=urlConstructorDetection,global$3=global$s,bind$e=functionBindContext,uncurryThis$5=functionUncurryThis,defineBuiltIn=defineBuiltIn$8,defineBuiltInAccessor$1=defineBuiltInAccessor$5,anInstance$2=anInstance$5,hasOwn$4=hasOwnProperty_1,assign2=objectAssign,arrayFrom=arrayFrom$1,arraySlice$1=arraySliceSimple,codeAt=stringMultibyte.codeAt,toASCII=stringPunycodeToAscii,$toString=toString$g,setToStringTag$1=setToStringTag$9,validateArgumentsLength$1=validateArgumentsLength$5,URLSearchParamsModule=web_urlSearchParams_constructor,InternalStateModule$2=internalState,setInternalState$2=InternalStateModule$2.set,getInternalURLState=InternalStateModule$2.getterFor("URL"),URLSearchParams$1=URLSearchParamsModule.URLSearchParams,getInternalSearchParamsState=URLSearchParamsModule.getState,NativeURL=global$3.URL,TypeError$1=global$3.TypeError,parseInt$1=global$3.parseInt,floor=Math.floor,pow=Math.pow,charAt=uncurryThis$5("".charAt),exec=uncurryThis$5(/./.exec),join$1=uncurryThis$5([].join),numberToString=uncurryThis$5(1..toString),pop=uncurryThis$5([].pop),push$3=uncurryThis$5([].push),replace=uncurryThis$5("".replace),shift=uncurryThis$5([].shift),split=uncurryThis$5("".split),stringSlice=uncurryThis$5("".slice),toLowerCase=uncurryThis$5("".toLowerCase),unshift=uncurryThis$5([].unshift),INVALID_AUTHORITY="Invalid authority",INVALID_SCHEME="Invalid scheme",INVALID_HOST="Invalid host",INVALID_PORT="Invalid port",ALPHA=/[a-z]/i,ALPHANUMERIC=/[\d+-.a-z]/i,DIGIT=/\d/,HEX_START=/^0x/i,OCT=/^[0-7]+$/,DEC=/^\d+$/,HEX=/^[\da-f]+$/i,FORBIDDEN_HOST_CODE_POINT=/[\0\t\n\r #%/:<>?@[\\\]^|]/,FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT=/[\0\t\n\r #/:<>?@[\\\]^|]/,LEADING_C0_CONTROL_OR_SPACE=/^[\u0000-\u0020]+/,TRAILING_C0_CONTROL_OR_SPACE=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,TAB_AND_NEW_LINE=/[\t\n\r]/g,parseIPv4=function(e){var t,r,n,o,i,a,s,c=split(e,".");if(c.length&&""==c[c.length-1]&&c.length--,(t=c.length)>4)return e;for(r=[],n=0;n<t;n++){if(""==(o=c[n]))return e;if(i=10,o.length>1&&"0"==charAt(o,0)&&(i=exec(HEX_START,o)?16:8,o=stringSlice(o,8==i?1:2)),""===o)a=0;else{if(!exec(10==i?DEC:8==i?OCT:HEX,o))return e;a=parseInt$1(o,i)}push$3(r,a)}for(n=0;n<t;n++)if(a=r[n],n==t-1){if(a>=pow(256,5-t))return null}else if(a>255)return null;for(s=pop(r),n=0;n<r.length;n++)s+=r[n]*pow(256,3-n);return s},parseIPv6=function(e){var t,r,n,o,i,a,s,c=[0,0,0,0,0,0,0,0],l=0,u=null,p=0,$=function(){return charAt(e,p)};if(":"==$()){if(":"!=charAt(e,1))return;p+=2,u=++l}for(;$();){if(8==l)return;if(":"!=$()){for(t=r=0;r<4&&exec(HEX,$());)t=16*t+parseInt$1($(),16),p++,r++;if("."==$()){if(0==r)return;if(p-=r,l>6)return;for(n=0;$();){if(o=null,n>0){if(!("."==$()&&n<4))return;p++}if(!exec(DIGIT,$()))return;for(;exec(DIGIT,$());){if(i=parseInt$1($(),10),null===o)o=i;else{if(0==o)return;o=10*o+i}if(o>255)return;p++}c[l]=256*c[l]+o,2!=++n&&4!=n||l++}if(4!=n)return;break}if(":"==$()){if(p++,!$())return}else if($())return;c[l++]=t}else{if(null!==u)return;p++,u=++l}}if(null!==u)for(a=l-u,l=7;0!=l&&a>0;)s=c[l],c[l--]=c[u+a-1],c[u+--a]=s;else if(8!=l)return;return c},findLongestZeroSequence=function(e){for(var t=null,r=1,n=null,o=0,i=0;i<8;i++)0!==e[i]?(o>r&&(t=n,r=o),n=null,o=0):(null===n&&(n=i),++o);return o>r&&(t=n,r=o),t},serializeHost=function(e){var t,r,n,o;if("number"==typeof e){for(t=[],r=0;r<4;r++)unshift(t,e%256),e=floor(e/256);return join$1(t,".")}if("object"==typeof e){for(t="",n=findLongestZeroSequence(e),r=0;r<8;r++)o&&0===e[r]||(o&&(o=!1),n===r?(t+=r?":":"::",o=!0):(t+=numberToString(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},C0ControlPercentEncodeSet={},fragmentPercentEncodeSet=assign2({},C0ControlPercentEncodeSet,{" ":1,'"':1,"<":1,">":1,"`":1}),pathPercentEncodeSet=assign2({},fragmentPercentEncodeSet,{"#":1,"?":1,"{":1,"}":1}),userinfoPercentEncodeSet=assign2({},pathPercentEncodeSet,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),percentEncode=function(e,t){var r=codeAt(e,0);return r>32&&r<127&&!hasOwn$4(t,e)?e:encodeURIComponent(e)},specialSchemes={ftp:21,file:null,http:80,https:443,ws:80,wss:443},isWindowsDriveLetter=function(e,t){var r;return 2==e.length&&exec(ALPHA,charAt(e,0))&&(":"==(r=charAt(e,1))||!t&&"|"==r)},startsWithWindowsDriveLetter=function(e){var t;return e.length>1&&isWindowsDriveLetter(stringSlice(e,0,2))&&(2==e.length||"/"===(t=charAt(e,2))||"\\"===t||"?"===t||"#"===t)},isSingleDot=function(e){return"."===e||"%2e"===toLowerCase(e)},isDoubleDot=function(e){return".."===(e=toLowerCase(e))||"%2e."===e||".%2e"===e||"%2e%2e"===e},SCHEME_START={},SCHEME={},NO_SCHEME={},SPECIAL_RELATIVE_OR_AUTHORITY={},PATH_OR_AUTHORITY={},RELATIVE={},RELATIVE_SLASH={},SPECIAL_AUTHORITY_SLASHES={},SPECIAL_AUTHORITY_IGNORE_SLASHES={},AUTHORITY={},HOST={},HOSTNAME={},PORT={},FILE={},FILE_SLASH={},FILE_HOST={},PATH_START={},PATH={},CANNOT_BE_A_BASE_URL_PATH={},QUERY={},FRAGMENT={},URLState=function(e,t,r){var n,o,i,a=$toString(e);if(t){if(o=this.parse(a))throw TypeError$1(o);this.searchParams=null}else{if(void 0!==r&&(n=new URLState(r,!0)),o=this.parse(a,null,n))throw TypeError$1(o);(i=getInternalSearchParamsState(new URLSearchParams$1)).bindURL(this),this.searchParams=i}};URLState.prototype={type:"URL",parse:function(e,t,r){var n,o,i,a,s=this,c=t||SCHEME_START,l=0,u="",p=!1,$=!1,f=!1;for(e=$toString(e),t||(s.scheme="",s.username="",s.password="",s.host=null,s.port=null,s.path=[],s.query=null,s.fragment=null,s.cannotBeABaseURL=!1,e=replace(e,LEADING_C0_CONTROL_OR_SPACE,""),e=replace(e,TRAILING_C0_CONTROL_OR_SPACE,"$1")),e=replace(e,TAB_AND_NEW_LINE,""),n=arrayFrom(e);l<=n.length;){switch(o=n[l],c){case SCHEME_START:if(!o||!exec(ALPHA,o)){if(t)return INVALID_SCHEME;c=NO_SCHEME;continue}u+=toLowerCase(o),c=SCHEME;break;case SCHEME:if(o&&(exec(ALPHANUMERIC,o)||"+"==o||"-"==o||"."==o))u+=toLowerCase(o);else{if(":"!=o){if(t)return INVALID_SCHEME;u="",c=NO_SCHEME,l=0;continue}if(t&&(s.isSpecial()!=hasOwn$4(specialSchemes,u)||"file"==u&&(s.includesCredentials()||null!==s.port)||"file"==s.scheme&&!s.host))return;if(s.scheme=u,t)return void(s.isSpecial()&&specialSchemes[s.scheme]==s.port&&(s.port=null));u="","file"==s.scheme?c=FILE:s.isSpecial()&&r&&r.scheme==s.scheme?c=SPECIAL_RELATIVE_OR_AUTHORITY:s.isSpecial()?c=SPECIAL_AUTHORITY_SLASHES:"/"==n[l+1]?(c=PATH_OR_AUTHORITY,l++):(s.cannotBeABaseURL=!0,push$3(s.path,""),c=CANNOT_BE_A_BASE_URL_PATH)}break;case NO_SCHEME:if(!r||r.cannotBeABaseURL&&"#"!=o)return INVALID_SCHEME;if(r.cannotBeABaseURL&&"#"==o){s.scheme=r.scheme,s.path=arraySlice$1(r.path),s.query=r.query,s.fragment="",s.cannotBeABaseURL=!0,c=FRAGMENT;break}c="file"==r.scheme?FILE:RELATIVE;continue;case SPECIAL_RELATIVE_OR_AUTHORITY:if("/"!=o||"/"!=n[l+1]){c=RELATIVE;continue}c=SPECIAL_AUTHORITY_IGNORE_SLASHES,l++;break;case PATH_OR_AUTHORITY:if("/"==o){c=AUTHORITY;break}c=PATH;continue;case RELATIVE:if(s.scheme=r.scheme,o==EOF)s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice$1(r.path),s.query=r.query;else if("/"==o||"\\"==o&&s.isSpecial())c=RELATIVE_SLASH;else if("?"==o)s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice$1(r.path),s.query="",c=QUERY;else{if("#"!=o){s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice$1(r.path),s.path.length--,c=PATH;continue}s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice$1(r.path),s.query=r.query,s.fragment="",c=FRAGMENT}break;case RELATIVE_SLASH:if(!s.isSpecial()||"/"!=o&&"\\"!=o){if("/"!=o){s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,c=PATH;continue}c=AUTHORITY}else c=SPECIAL_AUTHORITY_IGNORE_SLASHES;break;case SPECIAL_AUTHORITY_SLASHES:if(c=SPECIAL_AUTHORITY_IGNORE_SLASHES,"/"!=o||"/"!=charAt(u,l+1))continue;l++;break;case SPECIAL_AUTHORITY_IGNORE_SLASHES:if("/"!=o&&"\\"!=o){c=AUTHORITY;continue}break;case AUTHORITY:if("@"==o){p&&(u="%40"+u),p=!0,i=arrayFrom(u);for(var d=0;d<i.length;d++){var y=i[d];if(":"!=y||f){var h=percentEncode(y,userinfoPercentEncodeSet);f?s.password+=h:s.username+=h}else f=!0}u=""}else if(o==EOF||"/"==o||"?"==o||"#"==o||"\\"==o&&s.isSpecial()){if(p&&""==u)return INVALID_AUTHORITY;l-=arrayFrom(u).length+1,u="",c=HOST}else u+=o;break;case HOST:case HOSTNAME:if(t&&"file"==s.scheme){c=FILE_HOST;continue}if(":"!=o||$){if(o==EOF||"/"==o||"?"==o||"#"==o||"\\"==o&&s.isSpecial()){if(s.isSpecial()&&""==u)return INVALID_HOST;if(t&&""==u&&(s.includesCredentials()||null!==s.port))return;if(a=s.parseHost(u))return a;if(u="",c=PATH_START,t)return;continue}"["==o?$=!0:"]"==o&&($=!1),u+=o}else{if(""==u)return INVALID_HOST;if(a=s.parseHost(u))return a;if(u="",c=PORT,t==HOSTNAME)return}break;case PORT:if(!exec(DIGIT,o)){if(o==EOF||"/"==o||"?"==o||"#"==o||"\\"==o&&s.isSpecial()||t){if(""!=u){var _=parseInt$1(u,10);if(_>65535)return INVALID_PORT;s.port=s.isSpecial()&&_===specialSchemes[s.scheme]?null:_,u=""}if(t)return;c=PATH_START;continue}return INVALID_PORT}u+=o;break;case FILE:if(s.scheme="file","/"==o||"\\"==o)c=FILE_SLASH;else{if(!r||"file"!=r.scheme){c=PATH;continue}if(o==EOF)s.host=r.host,s.path=arraySlice$1(r.path),s.query=r.query;else if("?"==o)s.host=r.host,s.path=arraySlice$1(r.path),s.query="",c=QUERY;else{if("#"!=o){startsWithWindowsDriveLetter(join$1(arraySlice$1(n,l),""))||(s.host=r.host,s.path=arraySlice$1(r.path),s.shortenPath()),c=PATH;continue}s.host=r.host,s.path=arraySlice$1(r.path),s.query=r.query,s.fragment="",c=FRAGMENT}}break;case FILE_SLASH:if("/"==o||"\\"==o){c=FILE_HOST;break}r&&"file"==r.scheme&&!startsWithWindowsDriveLetter(join$1(arraySlice$1(n,l),""))&&(isWindowsDriveLetter(r.path[0],!0)?push$3(s.path,r.path[0]):s.host=r.host),c=PATH;continue;case FILE_HOST:if(o==EOF||"/"==o||"\\"==o||"?"==o||"#"==o){if(!t&&isWindowsDriveLetter(u))c=PATH;else if(""==u){if(s.host="",t)return;c=PATH_START}else{if(a=s.parseHost(u))return a;if("localhost"==s.host&&(s.host=""),t)return;u="",c=PATH_START}continue}u+=o;break;case PATH_START:if(s.isSpecial()){if(c=PATH,"/"!=o&&"\\"!=o)continue}else if(t||"?"!=o)if(t||"#"!=o){if(o!=EOF&&(c=PATH,"/"!=o))continue}else s.fragment="",c=FRAGMENT;else s.query="",c=QUERY;break;case PATH:if(o==EOF||"/"==o||"\\"==o&&s.isSpecial()||!t&&("?"==o||"#"==o)){if(isDoubleDot(u)?(s.shortenPath(),"/"==o||"\\"==o&&s.isSpecial()||push$3(s.path,"")):isSingleDot(u)?"/"==o||"\\"==o&&s.isSpecial()||push$3(s.path,""):("file"==s.scheme&&!s.path.length&&isWindowsDriveLetter(u)&&(s.host&&(s.host=""),u=charAt(u,0)+":"),push$3(s.path,u)),u="","file"==s.scheme&&(o==EOF||"?"==o||"#"==o))for(;s.path.length>1&&""===s.path[0];)shift(s.path);"?"==o?(s.query="",c=QUERY):"#"==o&&(s.fragment="",c=FRAGMENT)}else u+=percentEncode(o,pathPercentEncodeSet);break;case CANNOT_BE_A_BASE_URL_PATH:"?"==o?(s.query="",c=QUERY):"#"==o?(s.fragment="",c=FRAGMENT):o!=EOF&&(s.path[0]+=percentEncode(o,C0ControlPercentEncodeSet));break;case QUERY:t||"#"!=o?o!=EOF&&("'"==o&&s.isSpecial()?s.query+="%27":s.query+="#"==o?"%23":percentEncode(o,C0ControlPercentEncodeSet)):(s.fragment="",c=FRAGMENT);break;case FRAGMENT:o!=EOF&&(s.fragment+=percentEncode(o,fragmentPercentEncodeSet))}l++}},parseHost:function(e){var t,r,n;if("["==charAt(e,0)){if("]"!=charAt(e,e.length-1))return INVALID_HOST;if(!(t=parseIPv6(stringSlice(e,1,-1))))return INVALID_HOST;this.host=t}else if(this.isSpecial()){if(e=toASCII(e),exec(FORBIDDEN_HOST_CODE_POINT,e))return INVALID_HOST;if(null===(t=parseIPv4(e)))return INVALID_HOST;this.host=t}else{if(exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT,e))return INVALID_HOST;for(t="",r=arrayFrom(e),n=0;n<r.length;n++)t+=percentEncode(r[n],C0ControlPercentEncodeSet);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return hasOwn$4(specialSchemes,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&isWindowsDriveLetter(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,o=e.host,i=e.port,a=e.path,s=e.query,c=e.fragment,l=t+":";return null!==o?(l+="//",e.includesCredentials()&&(l+=r+(n?":"+n:"")+"@"),l+=serializeHost(o),null!==i&&(l+=":"+i)):"file"==t&&(l+="//"),l+=e.cannotBeABaseURL?a[0]:a.length?"/"+join$1(a,"/"):"",null!==s&&(l+="?"+s),null!==c&&(l+="#"+c),l},setHref:function(e){var t=this.parse(e);if(t)throw TypeError$1(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new URLConstructor(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+serializeHost(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse($toString(e)+":",SCHEME_START)},getUsername:function(){return this.username},setUsername:function(e){var t=arrayFrom($toString(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=percentEncode(t[r],userinfoPercentEncodeSet)}},getPassword:function(){return this.password},setPassword:function(e){var t=arrayFrom($toString(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=percentEncode(t[r],userinfoPercentEncodeSet)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?serializeHost(e):serializeHost(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,HOST)},getHostname:function(){var e=this.host;return null===e?"":serializeHost(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,HOSTNAME)},getPort:function(){var e=this.port;return null===e?"":$toString(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=$toString(e))?this.port=null:this.parse(e,PORT))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+join$1(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,PATH_START))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=$toString(e))?this.query=null:("?"==charAt(e,0)&&(e=stringSlice(e,1)),this.query="",this.parse(e,QUERY)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=$toString(e))?("#"==charAt(e,0)&&(e=stringSlice(e,1)),this.fragment="",this.parse(e,FRAGMENT)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var URLConstructor=function(e){var t=anInstance$2(this,URLPrototype),r=validateArgumentsLength$1(arguments.length,1)>1?arguments[1]:void 0,n=setInternalState$2(t,new URLState(e,!1,r));DESCRIPTORS$2||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},URLPrototype=URLConstructor.prototype,accessorDescriptor=function(e,t){return{get:function(){return getInternalURLState(this)[e]()},set:t&&function(e){return getInternalURLState(this)[t](e)},configurable:!0,enumerable:!0}};if(DESCRIPTORS$2&&(defineBuiltInAccessor$1(URLPrototype,"href",accessorDescriptor("serialize","setHref")),defineBuiltInAccessor$1(URLPrototype,"origin",accessorDescriptor("getOrigin")),defineBuiltInAccessor$1(URLPrototype,"protocol",accessorDescriptor("getProtocol","setProtocol")),defineBuiltInAccessor$1(URLPrototype,"username",accessorDescriptor("getUsername","setUsername")),defineBuiltInAccessor$1(URLPrototype,"password",accessorDescriptor("getPassword","setPassword")),defineBuiltInAccessor$1(URLPrototype,"host",accessorDescriptor("getHost","setHost")),defineBuiltInAccessor$1(URLPrototype,"hostname",accessorDescriptor("getHostname","setHostname")),defineBuiltInAccessor$1(URLPrototype,"port",accessorDescriptor("getPort","setPort")),defineBuiltInAccessor$1(URLPrototype,"pathname",accessorDescriptor("getPathname","setPathname")),defineBuiltInAccessor$1(URLPrototype,"search",accessorDescriptor("getSearch","setSearch")),defineBuiltInAccessor$1(URLPrototype,"searchParams",accessorDescriptor("getSearchParams")),defineBuiltInAccessor$1(URLPrototype,"hash",accessorDescriptor("getHash","setHash"))),defineBuiltIn(URLPrototype,"toJSON",(function(){return getInternalURLState(this).serialize()}),{enumerable:!0}),defineBuiltIn(URLPrototype,"toString",(function(){return getInternalURLState(this).serialize()}),{enumerable:!0}),NativeURL){var nativeCreateObjectURL=NativeURL.createObjectURL,nativeRevokeObjectURL=NativeURL.revokeObjectURL;nativeCreateObjectURL&&defineBuiltIn(URLConstructor,"createObjectURL",bind$e(nativeCreateObjectURL,NativeURL)),nativeRevokeObjectURL&&defineBuiltIn(URLConstructor,"revokeObjectURL",bind$e(nativeRevokeObjectURL,NativeURL))}setToStringTag$1(URLConstructor,"URL"),$$R({global:!0,constructor:!0,forced:!USE_NATIVE_URL$1,sham:!DESCRIPTORS$2},{URL:URLConstructor});var $$Q=_export,getBuiltIn$3=getBuiltIn$j,fails$5=fails$z,validateArgumentsLength=validateArgumentsLength$5,toString$3=toString$g,USE_NATIVE_URL=urlConstructorDetection,URL$1=getBuiltIn$3("URL"),THROWS_WITHOUT_ARGUMENTS=USE_NATIVE_URL&&fails$5((function(){URL$1.canParse()}));$$Q({target:"URL",stat:!0,forced:!THROWS_WITHOUT_ARGUMENTS},{canParse:function(e){var t=validateArgumentsLength(arguments.length,1),r=toString$3(e),n=t<2||void 0===arguments[1]?void 0:toString$3(arguments[1]);try{return!!new URL$1(r,n)}catch(e){return!1}}});var path$5=path$w,url$5=path$5.URL,parent$t=url$5,url$4=parent$t,parent$s=url$4,url$3=parent$s,parent$r=url$3,url$2=parent$r,url$1=url$2,url=url$1,_URL=getDefaultExportFromCjs(url),path$4=path$w,apply=functionApply;path$4.JSON||(path$4.JSON={stringify:JSON.stringify});var stringify$5=function(e,t,r){return apply(path$4.JSON.stringify,null,arguments)},parent$q=stringify$5,stringify$4=parent$q,parent$p=stringify$4,stringify$3=parent$p,parent$o=stringify$3,stringify$2=parent$o,stringify$1=stringify$2,stringify2=stringify$1,_JSON$stringify=getDefaultExportFromCjs(stringify2),isObject$5=isObject$m,classof$3=classofRaw$2,wellKnownSymbol$2=wellKnownSymbol$r,MATCH$1=wellKnownSymbol$2("match"),isRegexp=function(e){var t;return isObject$5(e)&&(void 0!==(t=e[MATCH$1])?!!t:"RegExp"==classof$3(e))},isRegExp=isRegexp,$TypeError$6=TypeError,notARegexp=function(e){if(isRegExp(e))throw $TypeError$6("The method doesn't accept regular expressions");return e},wellKnownSymbol$1=wellKnownSymbol$r,MATCH=wellKnownSymbol$1("match"),correctIsRegexpLogic=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[MATCH]=!1,"/./"[e](t)}catch(e){}}return!1},$$P=_export,$includes=arrayIncludes.includes,fails$4=fails$z,BROKEN_ON_SPARSE=fails$4((function(){return!Array(1).includes()}));$$P({target:"Array",proto:!0,forced:BROKEN_ON_SPARSE},{includes:function(e){return $includes(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$3=entryVirtual$k,includes$7=entryVirtual$3("Array").includes,$$O=_export,uncurryThis$4=functionUncurryThis,notARegExp=notARegexp,requireObjectCoercible=requireObjectCoercible$7,toString$2=toString$g,correctIsRegExpLogic=correctIsRegexpLogic,stringIndexOf=uncurryThis$4("".indexOf);$$O({target:"String",proto:!0,forced:!correctIsRegExpLogic("includes")},{includes:function(e){return!!~stringIndexOf(toString$2(requireObjectCoercible(this)),toString$2(notARegExp(e)),arguments.length>1?arguments[1]:void 0)}});var entryVirtual$2=entryVirtual$k,includes$6=entryVirtual$2("String").includes,isPrototypeOf$4=objectIsPrototypeOf,arrayMethod=includes$7,stringMethod=includes$6,ArrayPrototype$2=Array.prototype,StringPrototype=String.prototype,includes$5=function(e){var t=e.includes;return e===ArrayPrototype$2||isPrototypeOf$4(ArrayPrototype$2,e)&&t===ArrayPrototype$2.includes?arrayMethod:"string"==typeof e||e===StringPrototype||isPrototypeOf$4(StringPrototype,e)&&t===StringPrototype.includes?stringMethod:t},parent$n=includes$5,includes$4=parent$n,parent$m=includes$4,includes$3=parent$m,parent$l=includes$3,includes$2=parent$l,includes$1=includes$2,includes3=includes$1,_includesInstanceProperty=getDefaultExportFromCjs(includes3),internalMetadata={exports:{}},fails$3=fails$z,arrayBufferNonExtensible=fails$3((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),fails$2=fails$z,isObject$4=isObject$m,classof$2=classofRaw$2,ARRAY_BUFFER_NON_EXTENSIBLE=arrayBufferNonExtensible,$isExtensible=Object.isExtensible,FAILS_ON_PRIMITIVES=fails$2((function(){$isExtensible(1)})),objectIsExtensible=FAILS_ON_PRIMITIVES||ARRAY_BUFFER_NON_EXTENSIBLE?function(e){return!!isObject$4(e)&&((!ARRAY_BUFFER_NON_EXTENSIBLE||"ArrayBuffer"!=classof$2(e))&&(!$isExtensible||$isExtensible(e)))}:$isExtensible,fails$1=fails$z,freezing=!fails$1((function(){return Object.isExtensible(Object.preventExtensions({}))})),$$N=_export,uncurryThis$3=functionUncurryThis,hiddenKeys=hiddenKeys$6,isObject$3=isObject$m,hasOwn$3=hasOwnProperty_1,defineProperty$1=objectDefineProperty.f,getOwnPropertyNamesModule=objectGetOwnPropertyNames,getOwnPropertyNamesExternalModule=objectGetOwnPropertyNamesExternal,isExtensible2=objectIsExtensible,uid=uid$4,FREEZING=freezing,REQUIRED=!1,METADATA=uid("meta"),id=0,setMetadata=function(e){defineProperty$1(e,METADATA,{value:{objectID:"O"+id++,weakData:{}}})},fastKey$1=function(e,t){if(!isObject$3(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!hasOwn$3(e,METADATA)){if(!isExtensible2(e))return"F";if(!t)return"E";setMetadata(e)}return e[METADATA].objectID},getWeakData=function(e,t){if(!hasOwn$3(e,METADATA)){if(!isExtensible2(e))return!0;if(!t)return!1;setMetadata(e)}return e[METADATA].weakData},onFreeze=function(e){return FREEZING&&REQUIRED&&isExtensible2(e)&&!hasOwn$3(e,METADATA)&&setMetadata(e),e},enable=function(){meta.enable=function(){},REQUIRED=!0;var e=getOwnPropertyNamesModule.f,t=uncurryThis$3([].splice),r={};r[METADATA]=1,e(r).length&&(getOwnPropertyNamesModule.f=function(r){for(var n=e(r),o=0,i=n.length;o<i;o++)if(n[o]===METADATA){t(n,o,1);break}return n},$$N({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:getOwnPropertyNamesExternalModule.f}))},meta=internalMetadata.exports={enable:enable,fastKey:fastKey$1,getWeakData:getWeakData,onFreeze:onFreeze};hiddenKeys[METADATA]=!0;var internalMetadataExports=internalMetadata.exports,$$M=_export,global$2=global$s,InternalMetadataModule=internalMetadataExports,fails=fails$z,createNonEnumerableProperty=createNonEnumerableProperty$9,iterate$o=iterate$u,anInstance$1=anInstance$5,isCallable$4=isCallable$r,isObject$2=isObject$m,setToStringTag=setToStringTag$9,defineProperty5=objectDefineProperty.f,forEach3=arrayIteration.forEach,DESCRIPTORS$1=descriptors,InternalStateModule$1=internalState,setInternalState$1=InternalStateModule$1.set,internalStateGetterFor$1=InternalStateModule$1.getterFor,collection$2=function(e,t,r){var n,o=-1!==e.indexOf("Map"),i=-1!==e.indexOf("Weak"),a=o?"set":"add",s=global$2[e],c=s&&s.prototype,l={};if(DESCRIPTORS$1&&isCallable$4(s)&&(i||c.forEach&&!fails((function(){(new s).entries().next()})))){var u=(n=t((function(t,r){setInternalState$1(anInstance$1(t,u),{type:e,collection:new s}),null!=r&&iterate$o(r,t[a],{that:t,AS_ENTRIES:o})}))).prototype,p=internalStateGetterFor$1(e);forEach3(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(e){var t="add"==e||"set"==e;!(e in c)||i&&"clear"==e||createNonEnumerableProperty(u,e,(function(r,n){var o=p(this).collection;if(!t&&i&&!isObject$2(r))return"get"==e&&void 0;var a=o[e](0===r?0:r,n);return t?this:a}))})),i||defineProperty5(u,"size",{configurable:!0,get:function(){return p(this).collection.size}})}else n=r.getConstructor(t,e,o,a),InternalMetadataModule.enable();return setToStringTag(n,e,!1,!0),l[e]=n,$$M({global:!0,forced:!0},l),i||r.setStrong(n,e,o),n},create4=objectCreate,defineBuiltInAccessor=defineBuiltInAccessor$5,defineBuiltIns=defineBuiltIns$2,bind$d=functionBindContext,anInstance=anInstance$5,isNullOrUndefined$2=isNullOrUndefined$7,iterate$n=iterate$u,defineIterator=iteratorDefine,createIterResultObject=createIterResultObject$3,setSpecies=setSpecies$2,DESCRIPTORS=descriptors,fastKey=internalMetadataExports.fastKey,InternalStateModule=internalState,setInternalState=InternalStateModule.set,internalStateGetterFor=InternalStateModule.getterFor,collectionStrong$2={getConstructor:function(e,t,r,n){var o=e((function(e,o){anInstance(e,i),setInternalState(e,{type:t,index:create4(null),first:void 0,last:void 0,size:0}),DESCRIPTORS||(e.size=0),isNullOrUndefined$2(o)||iterate$n(o,e[n],{that:e,AS_ENTRIES:r})})),i=o.prototype,a=internalStateGetterFor(t),s=function(e,t,r){var n,o,i=a(e),s=c(e,t);return s?s.value=r:(i.last=s={index:o=fastKey(t,!0),key:t,value:r,previous:n=i.last,next:void 0,removed:!1},i.first||(i.first=s),n&&(n.next=s),DESCRIPTORS?i.size++:e.size++,"F"!==o&&(i.index[o]=s)),e},c=function(e,t){var r,n=a(e),o=fastKey(t);if("F"!==o)return n.index[o];for(r=n.first;r;r=r.next)if(r.key==t)return r};return defineBuiltIns(i,{clear:function(){for(var e=a(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,DESCRIPTORS?e.size=0:this.size=0},delete:function(e){var t=this,r=a(t),n=c(t,e);if(n){var o=n.next,i=n.previous;delete r.index[n.index],n.removed=!0,i&&(i.next=o),o&&(o.previous=i),r.first==n&&(r.first=o),r.last==n&&(r.last=i),DESCRIPTORS?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=a(this),n=bind$d(e,arguments.length>1?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!!c(this,e)}}),defineBuiltIns(i,r?{get:function(e){var t=c(this,e);return t&&t.value},set:function(e,t){return s(this,0===e?0:e,t)}}:{add:function(e){return s(this,e=0===e?0:e,e)}}),DESCRIPTORS&&defineBuiltInAccessor(i,"size",{configurable:!0,get:function(){return a(this).size}}),o},setStrong:function(e,t,r){var n=t+" Iterator",o=internalStateGetterFor(t),i=internalStateGetterFor(n);defineIterator(e,t,(function(e,t){setInternalState(this,{type:n,target:e,state:o(e),kind:t,last:void 0})}),(function(){for(var e=i(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)?createIterResultObject("keys"==t?r.key:"values"==t?r.value:[r.key,r.value],!1):(e.target=void 0,createIterResultObject(void 0,!0))}),r?"entries":"values",!r,!0),setSpecies(t)}},collection$1=collection$2,collectionStrong$1=collectionStrong$2;collection$1("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),collectionStrong$1);var path$3=path$w,map$5=path$3.Map,parent$k=map$5,map$4=parent$k,parent$j=map$4,map$3=parent$j,bind$c=functionBindContext,call$d=functionCall,aCallable$8=aCallable$l,aConstructor=aConstructor$3,isNullOrUndefined$1=isNullOrUndefined$7,iterate$m=iterate$u,push$2=[].push,collectionFrom=function(e){var t,r,n,o,i=arguments.length,a=i>1?arguments[1]:void 0;return aConstructor(this),(t=void 0!==a)&&aCallable$8(a),isNullOrUndefined$1(e)?new this:(r=[],t?(n=0,o=bind$c(a,i>2?arguments[2]:void 0),iterate$m(e,(function(e){call$d(push$2,r,o(e,n++))}))):iterate$m(e,push$2,{that:r}),new this(r))},$$L=_export,from$1=collectionFrom;$$L({target:"Map",stat:!0,forced:!0},{from:from$1});var arraySlice=arraySlice$7,collectionOf=function(){return new this(arraySlice(arguments))},$$K=_export,of$1=collectionOf;$$K({target:"Map",stat:!0,forced:!0},{of:of$1});var tryToString$1=tryToString$8,aMap$e=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 TypeError(tryToString$1(e)+" is not a map")},caller$2=function(e,t){return 1==t?function(t,r){return t[e](r)}:function(t,r,n){return t[e](r,n)}},getBuiltIn$2=getBuiltIn$j,caller$1=caller$2,Map$5=getBuiltIn$2("Map"),mapHelpers={Map:Map$5,set:caller$1("set",2),get:caller$1("get",1),has:caller$1("has",1),remove:caller$1("delete",1),proto:Map$5.prototype},$$J=_export,aMap$d=aMap$e,remove$3=mapHelpers.remove;$$J({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=aMap$d(this),r=!0,n=0,o=arguments.length;n<o;n++)e=remove$3(t,arguments[n]),r=r&&e;return!!r}});var $$I=_export,aMap$c=aMap$e,MapHelpers$4=mapHelpers,get$1=MapHelpers$4.get,has$6=MapHelpers$4.has,set$b=MapHelpers$4.set;$$I({target:"Map",proto:!0,real:!0,forced:!0},{emplace:function(e,t){var r,n,o=aMap$c(this);return has$6(o,e)?(r=get$1(o,e),"update"in t&&(r=t.update(r,e,o),set$b(o,e,r)),r):(n=t.insert(e,o),set$b(o,e,n),n)}});var call$c=functionCall,iterateSimple$8=function(e,t,r){for(var n,o,i=r||e.next;!(n=call$c(i,e)).done;)if(void 0!==(o=t(n.value)))return o},iterateSimple$7=iterateSimple$8,mapIterate=function(e,t,r){return r?iterateSimple$7(e.entries(),(function(e){return t(e[1],e[0])})):e.forEach(t)},$$H=_export,bind$b=functionBindContext,aMap$b=aMap$e,iterate$l=mapIterate;$$H({target:"Map",proto:!0,real:!0,forced:!0},{every:function(e){var t=aMap$b(this),r=bind$b(e,arguments.length>1?arguments[1]:void 0);return!1!==iterate$l(t,(function(e,n){if(!r(e,n,t))return!1}),!0)}});var $$G=_export,bind$a=functionBindContext,aMap$a=aMap$e,MapHelpers$3=mapHelpers,iterate$k=mapIterate,Map$4=MapHelpers$3.Map,set$a=MapHelpers$3.set;$$G({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(e){var t=aMap$a(this),r=bind$a(e,arguments.length>1?arguments[1]:void 0),n=new Map$4;return iterate$k(t,(function(e,o){r(e,o,t)&&set$a(n,o,e)})),n}});var $$F=_export,bind$9=functionBindContext,aMap$9=aMap$e,iterate$j=mapIterate;$$F({target:"Map",proto:!0,real:!0,forced:!0},{find:function(e){var t=aMap$9(this),r=bind$9(e,arguments.length>1?arguments[1]:void 0),n=iterate$j(t,(function(e,n){if(r(e,n,t))return{value:e}}),!0);return n&&n.value}});var $$E=_export,bind$8=functionBindContext,aMap$8=aMap$e,iterate$i=mapIterate;$$E({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(e){var t=aMap$8(this),r=bind$8(e,arguments.length>1?arguments[1]:void 0),n=iterate$i(t,(function(e,n){if(r(e,n,t))return{key:n}}),!0);return n&&n.key}});var $$D=_export,call$b=functionCall,uncurryThis$2=functionUncurryThis,isCallable$3=isCallable$r,aCallable$7=aCallable$l,iterate$h=iterate$u,Map$3=mapHelpers.Map,push$1=uncurryThis$2([].push);$$D({target:"Map",stat:!0,forced:!0},{groupBy:function(e,t){var r=new(isCallable$3(this)?this:Map$3);aCallable$7(t);var n=aCallable$7(r.has),o=aCallable$7(r.get),i=aCallable$7(r.set);return iterate$h(e,(function(e){var a=t(e);call$b(n,r,a)?push$1(call$b(o,r,a),e):call$b(i,r,a,[e])})),r}});var sameValueZero$1=function(e,t){return e===t||e!=e&&t!=t},$$C=_export,sameValueZero=sameValueZero$1,aMap$7=aMap$e,iterate$g=mapIterate;$$C({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(e){return!0===iterate$g(aMap$7(this),(function(t){if(sameValueZero(t,e))return!0}),!0)}});var $$B=_export,call$a=functionCall,iterate$f=iterate$u,isCallable$2=isCallable$r,aCallable$6=aCallable$l,Map$2=mapHelpers.Map;$$B({target:"Map",stat:!0,forced:!0},{keyBy:function(e,t){var r=new(isCallable$2(this)?this:Map$2);aCallable$6(t);var n=aCallable$6(r.set);return iterate$f(e,(function(e){call$a(n,r,t(e),e)})),r}});var $$A=_export,aMap$6=aMap$e,iterate$e=mapIterate;$$A({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(e){var t=iterate$e(aMap$6(this),(function(t,r){if(t===e)return{key:r}}),!0);return t&&t.key}});var $$z=_export,bind$7=functionBindContext,aMap$5=aMap$e,MapHelpers$2=mapHelpers,iterate$d=mapIterate,Map$1=MapHelpers$2.Map,set$9=MapHelpers$2.set;$$z({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(e){var t=aMap$5(this),r=bind$7(e,arguments.length>1?arguments[1]:void 0),n=new Map$1;return iterate$d(t,(function(e,o){set$9(n,r(e,o,t),e)})),n}});var $$y=_export,bind$6=functionBindContext,aMap$4=aMap$e,MapHelpers$1=mapHelpers,iterate$c=mapIterate,Map=MapHelpers$1.Map,set$8=MapHelpers$1.set;$$y({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(e){var t=aMap$4(this),r=bind$6(e,arguments.length>1?arguments[1]:void 0),n=new Map;return iterate$c(t,(function(e,o){set$8(n,o,r(e,o,t))})),n}});var $$x=_export,aMap$3=aMap$e,iterate$b=iterate$u,set$7=mapHelpers.set;$$x({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(e){for(var t=aMap$3(this),r=arguments.length,n=0;n<r;)iterate$b(arguments[n++],(function(e,r){set$7(t,e,r)}),{AS_ENTRIES:!0});return t}});var $$w=_export,aCallable$5=aCallable$l,aMap$2=aMap$e,iterate$a=mapIterate,$TypeError$5=TypeError;$$w({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=aMap$2(this),r=arguments.length<2,n=r?void 0:arguments[1];if(aCallable$5(e),iterate$a(t,(function(o,i){r?(r=!1,n=o):n=e(n,o,i,t)})),r)throw $TypeError$5("Reduce of empty map with no initial value");return n}});var $$v=_export,bind$5=functionBindContext,aMap$1=aMap$e,iterate$9=mapIterate;$$v({target:"Map",proto:!0,real:!0,forced:!0},{some:function(e){var t=aMap$1(this),r=bind$5(e,arguments.length>1?arguments[1]:void 0);return!0===iterate$9(t,(function(e,n){if(r(e,n,t))return!0}),!0)}});var $$u=_export,aCallable$4=aCallable$l,aMap=aMap$e,MapHelpers=mapHelpers,$TypeError$4=TypeError,get2=MapHelpers.get,has$5=MapHelpers.has,set$6=MapHelpers.set;$$u({target:"Map",proto:!0,real:!0,forced:!0},{update:function(e,t){var r=aMap(this),n=arguments.length;aCallable$4(t);var o=has$5(r,e);if(!o&&n<3)throw $TypeError$4("Updating absent value");var i=o?get2(r,e):aCallable$4(n>2?arguments[2]:void 0)(e,r);return set$6(r,e,t(i,e,r)),r}});var call$9=functionCall,aCallable$3=aCallable$l,isCallable$1=isCallable$r,anObject$2=anObject$i,$TypeError$3=TypeError,mapUpsert=function(e,t){var r,n=anObject$2(this),o=aCallable$3(n.get),i=aCallable$3(n.has),a=aCallable$3(n.set),s=arguments.length>2?arguments[2]:void 0;if(!isCallable$1(t)&&!isCallable$1(s))throw $TypeError$3("At least one callback required");return call$9(i,n,e)?(r=call$9(o,n,e),isCallable$1(t)&&(r=t(r),call$9(a,n,e,r))):isCallable$1(s)&&(r=s(),call$9(a,n,e,r)),r},$$t=_export,upsert$1=mapUpsert;$$t({target:"Map",proto:!0,real:!0,forced:!0},{upsert:upsert$1});var $$s=_export,upsert2=mapUpsert;$$s({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:upsert2});var parent$i=map$3,map$2=parent$i,map$1=map$2,map2=map$1,_Map=getDefaultExportFromCjs(map2);function ownKeys2(e,t){var r=_Object$keys(e);if(_Object$getOwnPropertySymbols){var n=_Object$getOwnPropertySymbols(e);t&&(n=_filterInstanceProperty(n).call(n,(function(t){return _Object$getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r,n,o=null!=arguments[t]?arguments[t]:{};t%2?_forEachInstanceProperty(r=ownKeys2(Object(o),!0)).call(r,(function(t){_defineProperty$1(e,t,o[t])})):_Object$getOwnPropertyDescriptors?_Object$defineProperties(e,_Object$getOwnPropertyDescriptors(o)):_forEachInstanceProperty(n=ownKeys2(Object(o))).call(n,(function(t){_Object$defineProperty(e,t,_Object$getOwnPropertyDescriptor(o,t))}))}return e}function _regeneratorRuntime(){_regeneratorRuntime=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=_Object$defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof _Symbol?_Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,r){return _Object$defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,o){var i=t&&t.prototype instanceof $?t:$,a=_Object$create(i.prototype),s=new P(o||[]);return n(a,"_invoke",{value:v(e,r,s)}),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var p={};function $(){}function f(){}function d(){}var y={};c(y,i,(function(){return this}));var h=_Object$getPrototypeOf&&_Object$getPrototypeOf(_Object$getPrototypeOf(O([])));h&&h!==t&&r.call(h,i)&&(y=h);var _=d.prototype=$.prototype=_Object$create(y);function g(e){var t;_forEachInstanceProperty(t=["next","throw","return"]).call(t,(function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function m(e,t){function o(n,i,a,s){var c=u(e[n],e,i);if("throw"!==c.type){var l=c.arg,p=l.value;return p&&"object"==_typeof$3(p)&&r.call(p,"__await")?t.resolve(p.__await).then((function(e){o("next",e,a,s)}),(function(e){o("throw",e,a,s)})):t.resolve(p).then((function(e){l.value=e,a(l)}),(function(e){return o("throw",e,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){o(e,r,t,n)}))}return i=i?i.then(n,n):n()}})}function v(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=b(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function b(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var o=u(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,p;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],_forEachInstanceProperty(e).call(e,S,this),this.reset(!0)}function O(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:T}}function T(){return{value:void 0,done:!0}}return f.prototype=d,n(_,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:f,configurable:!0}),f.displayName=c(d,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return _Object$setPrototypeOf?_Object$setPrototypeOf(e,d):(e.__proto__=d,c(e,s,"GeneratorFunction")),e.prototype=_Object$create(_),e},e.awrap=function(e){return{__await:e}},g(m.prototype),c(m.prototype,a,(function(){return this})),e.AsyncIterator=m,e.async=function(t,r,n,o,i){void 0===i&&(i=_Promise);var a=new m(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(_),c(_,s,"Generator"),c(_,i,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return _reverseInstanceProperty(r).call(r),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=O,P.prototype={constructor:P,reset:function(e){var t;if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,_forEachInstanceProperty(t=this.tryEntries).call(t,E),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+_sliceInstanceProperty(n).call(n,1))&&(this[n]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(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 o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},e}function _typeof(e){return(_typeof="function"==typeof _Symbol&&"symbol"==typeof _Symbol$iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof _Symbol&&e.constructor===_Symbol&&e!==_Symbol.prototype?"symbol":typeof e})(e)}function asyncGeneratorStep(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):_Promise.resolve(c).then(n,o)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new _Promise((function(n,o){var i=e.apply(t,r);function a(e){asyncGeneratorStep(i,n,o,a,s,"next",e)}function s(e){asyncGeneratorStep(i,n,o,a,s,"throw",e)}a(void 0)}))}}function _classCallCheck$2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$2(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),_Object$defineProperty(e,_toPropertyKey$2(n.key),n)}}function _createClass$2(e,t,r){return t&&_defineProperties$2(e.prototype,t),r&&_defineProperties$2(e,r),_Object$defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty$1(e,t,r){return(t=_toPropertyKey$2(t))in e?_Object$defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _inherits$2(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=_Object$create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),_Object$defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf$2(e,t)}function _getPrototypeOf$2(e){var t;return(_getPrototypeOf$2=_Object$setPrototypeOf?_bindInstanceProperty(t=_Object$getPrototypeOf).call(t):function(e){return e.__proto__||_Object$getPrototypeOf(e)})(e)}function _setPrototypeOf$2(e,t){var r;return(_setPrototypeOf$2=_Object$setPrototypeOf?_bindInstanceProperty(r=_Object$setPrototypeOf).call(r):function(e,t){return e.__proto__=t,e})(e,t)}function _isNativeReflectConstruct$2(){if("undefined"==typeof Reflect||!_Reflect$construct)return!1;if(_Reflect$construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_Reflect$construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _construct(e,t,r){var n;_isNativeReflectConstruct$2()?_construct=_bindInstanceProperty(n=_Reflect$construct).call(n):_construct=function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(_bindInstanceProperty(Function).apply(e,n));return r&&_setPrototypeOf$2(o,r.prototype),o};return _construct.apply(null,arguments)}function _isNativeFunction(e){var t;return-1!==_indexOfInstanceProperty(t=Function.toString.call(e)).call(t,"[native code]")}function _wrapNativeSuper(e){var t="function"==typeof _Map?new _Map:void 0;return _wrapNativeSuper=function(e){if(null===e||!_isNativeFunction(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return _construct(e,arguments,_getPrototypeOf$2(this).constructor)}return r.prototype=_Object$create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf$2(r,e)},_wrapNativeSuper(e)}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,n,o={},i=_Object$keys(e);for(n=0;n<i.length;n++)r=i[n],_indexOfInstanceProperty(t).call(t,r)>=0||(o[r]=e[r]);return o}function _objectWithoutProperties(e,t){if(null==e)return{};var r,n,o=_objectWithoutPropertiesLoose(e,t);if(_Object$getOwnPropertySymbols){var i=_Object$getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],_indexOfInstanceProperty(t).call(t,r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function _assertThisInitialized$2(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn$2(e,t){if(t&&("object"===_typeof$3(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$2(e)}function _createSuper$1(e){var t=_isNativeReflectConstruct$2();return function(){var r,n=_getPrototypeOf$2(e);if(t){var o=_getPrototypeOf$2(this).constructor;r=_Reflect$construct(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn$2(this,r)}}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf$2(e)););return e}function _get(){var e;"undefined"!=typeof Reflect&&_Reflect$get?_get=_bindInstanceProperty(e=_Reflect$get).call(e):_get=function(e,t,r){var n=_superPropBase(e,t);if(n){var o=_Object$getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}};return _get.apply(this,arguments)}function _unsupportedIterableToArray$1(e,t){var r;if(e){if("string"==typeof e)return _arrayLikeToArray$1(e,t);var n=_sliceInstanceProperty(r=Object.prototype.toString.call(e)).call(r,8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?_Array$from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray$1(e,t):void 0}}function _arrayLikeToArray$1(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _createForOfIteratorHelper(e,t){var r=void 0!==_Symbol&&_getIteratorMethod(e)||e["@@iterator"];if(!r){if(_Array$isArray(e)||(r=_unsupportedIterableToArray$1(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function _toPrimitive$2(e,t){if("object"!==_typeof$3(e)||null===e)return e;var r=e[_Symbol$toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof$3(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey$2(e){var t=_toPrimitive$2(e,"string");return"symbol"===_typeof$3(t)?t:String(t)}var aCallable$2=aCallable$l,toObject=toObject$c,IndexedObject=indexedObject,lengthOfArrayLike=lengthOfArrayLike$a,$TypeError$2=TypeError,createMethod=function(e){return function(t,r,n,o){aCallable$2(r);var i=toObject(t),a=IndexedObject(i),s=lengthOfArrayLike(i),c=e?s-1:0,l=e?-1:1;if(n<2)for(;;){if(c in a){o=a[c],c+=l;break}if(c+=l,e?c<0:s<=c)throw $TypeError$2("Reduce of empty array with no initial value")}for(;e?c>=0:s>c;c+=l)c in a&&(o=r(o,a[c],c,i));return o}},arrayReduce={left:createMethod(!1),right:createMethod(!0)},$$r=_export,$reduce=arrayReduce.left,arrayMethodIsStrict=arrayMethodIsStrict$6,CHROME_VERSION=engineV8Version,IS_NODE=engineIsNode,CHROME_BUG=!IS_NODE&&engineV8Version>79&&engineV8Version<83,FORCED=CHROME_BUG||!arrayMethodIsStrict("reduce");$$r({target:"Array",proto:!0,forced:FORCED},{reduce:function(e){var t=arguments.length;return $reduce(this,e,t,t>1?arguments[1]:void 0)}});var _ERR_CODE,entryVirtual$1=entryVirtual$k,reduce$6=entryVirtual$1("Array").reduce,isPrototypeOf$3=objectIsPrototypeOf,method$1=reduce$6,ArrayPrototype$1=Array.prototype,reduce$5=function(e){var t=e.reduce;return e===ArrayPrototype$1||isPrototypeOf$3(ArrayPrototype$1,e)&&t===ArrayPrototype$1.reduce?method$1:t},parent$h=reduce$5,reduce$4=parent$h,parent$g=reduce$4,reduce$3=parent$g,parent$f=reduce$3,reduce$2=parent$f,reduce$1=reduce$2,reduce3=reduce$1,_reduceInstanceProperty=getDefaultExportFromCjs(reduce3),Buffer$1=function(){function e(){_classCallCheck$2(this,e)}return _createClass$2(e,null,[{key:"start",value:function(e){return e&&e.length?1===e.length&&e.end(0)-e.start(0)<1e-6||1===e.length&&e.start(0)<0?0:e.start(0):0}},{key:"end",value:function(e){return e&&e.length?1===e.length&&e.end(0)-e.start(0)<1e-6?0:e.end(e.length-1):0}},{key:"get",value:function(e){if(e)try{return e.buffered}catch(e){}}},{key:"buffers",value:function(e,t){if(!e||!e.length)return[];for(var r=[],n=0,o=e.length;n<o;n++){var i=r.length;if(i&&t){var a=r[i-1],s=a[1];if(e.start(n)-s<=t){var c=e.end(n);c>s&&(a[1]=c)}else r.push([e.start(n),e.end(n)])}else r.push([e.start(n),e.end(n)])}return r}},{key:"totalLength",value:function(e){return e&&e.length?_reduceInstanceProperty(e).call(e,(function(e,t){return e+(t[1]-t[0])}),0):0}},{key:"info",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!t||!t.length)return{start:0,end:0,buffers:[]};for(var o=0,i=0,a=0,s=0,c=0,l=0,u=0,p=e.buffers(t,n),$=0,f=p.length;$<f;$++){var d=p[$];if(r+n>=d[0]&&r<=d[1])o=d[0],i=d[1],a=$;else{if(r+n<d[0]){s=d[0],c=d[1];break}r+n>d[1]&&(l=d[0],u=d[1])}}return{start:o,end:i,index:a,buffers:p,nextStart:s,nextEnd:c,prevStart:l,prevEnd:u,currentTime:r,behind:r-o,remaining:i?i-r:0,length:e.totalLength&&e.totalLength(p)}}},{key:"isBuffered",value:function(t,r){if(t){var n=e.get(t);if(null!=n&&n.length)for(var o=0;o<n.length;o++)if(r>=n.start(o)&&r<=n.end(o))return!0}return!1}}]),e}(),isBrowser$1="undefined"!=typeof window,ERR={MANIFEST:"manifest",NETWORK:"network",NETWORK_TIMEOUT:"network_timeout",NETWORK_FORBIDDEN:"network_forbidden",NETWORK_NOTFOUND:"network_notfound",NETWROK_RANGE_NOT_SATISFIABLE:"network_range_not_satisfiable",DEMUX:"demux",REMUX:"remux",MEDIA:"media",DRM:"drm",OTHER:"other",RUNTIME:"runtime",SUB_TYPES:{FLV:"FLV",HLS:"HLS",MP4:"MP4",FMP4:"FMP4",MSE_ADD_SB:"MSE_ADD_SB",MSE_APPEND_BUFFER:"MSE_APPEND_BUFFER",MSE_OTHER:"MSE_OTHER",MSE_FULL:"MSE_FULL",MSE_CHANGE_TYPE:"MSE_CHANGE_TYPE",OPTION:"OPTION",DASH:"DASH",LICENSE:"LICENSE",CUSTOM_LICENSE:"CUSTOM_LICENSE",MSE_HIJACK:"MSE_HIJACK",EME_HIJACK:"EME_HIJACK",SIDX:"SIDX",NO_CANPLAY_ERROR:"NO_CANPLAY_ERROR",BUFFERBREAK_ERROR:"BUFFERBREAK_ERROR",WAITING_TIMEOUT_ERROR:"WAITING_TIMEOUT_ERROR",MEDIA_ERR_ABORTED:"MEDIA_ERR_ABORTED",MEDIA_ERR_NETWORK:"MEDIA_ERR_NETWORK",MEDIA_ERR_DECODE:"MEDIA_ERR_DECODE",MEDIA_ERR_SRC_NOT_SUPPORTED:"MEDIA_ERR_SRC_NOT_SUPPORTED",MEDIA_ERR_CODEC_NOT_SUPPORTED:"MEDIA_ERR_CODEC_NOT_SUPPORTED",MEDIA_ERR_URL_EMPTY:"MEDIA_ERR_URL_EMPTY"}},ERR_CODE=(_defineProperty$1(_ERR_CODE={},ERR.MANIFEST,{HLS:1100,DASH:1200}),_defineProperty$1(_ERR_CODE,ERR.NETWORK,2100),_defineProperty$1(_ERR_CODE,ERR.NETWORK_TIMEOUT,2101),_defineProperty$1(_ERR_CODE,ERR.NETWORK_FORBIDDEN,2103),_defineProperty$1(_ERR_CODE,ERR.NETWORK_NOTFOUND,2104),_defineProperty$1(_ERR_CODE,ERR.NETWROK_RANGE_NOT_SATISFIABLE,2116),_defineProperty$1(_ERR_CODE,ERR.DEMUX,{FLV:3100,HLS:3200,MP4:3300,FMP4:3400,SIDX:3410}),_defineProperty$1(_ERR_CODE,ERR.REMUX,{FMP4:4100,MP4:4200}),_defineProperty$1(_ERR_CODE,ERR.MEDIA,{MEDIA_ERR_ABORTED:5101,MEDIA_ERR_NETWORK:5102,MEDIA_ERR_DECODE:5103,MEDIA_ERR_SRC_NOT_SUPPORTED:5104,MEDIA_ERR_CODEC_NOT_SUPPORTED:5105,MEDIA_ERR_URL_EMPTY:5106,MSE_ADD_SB:5200,MSE_APPEND_BUFFER:5201,MSE_OTHER:5202,MSE_FULL:5203,MSE_HIJACK:5204,MSE_CHANGE_TYPE:5205,EME_HIJACK:5301}),_defineProperty$1(_ERR_CODE,ERR.DRM,{LICENSE:7100,CUSTOM_LICENSE:7200}),_defineProperty$1(_ERR_CODE,ERR.OTHER,8e3),_defineProperty$1(_ERR_CODE,ERR.RUNTIME,{NO_CANPLAY_ERROR:9001,BUFFERBREAK_ERROR:9002,WAITING_TIMEOUT_ERROR:9003}),_ERR_CODE),StreamingError=function(e){_inherits$2(r,_wrapNativeSuper(Error));var t=_createSuper$1(r);function r(e,n,o,i,a){var s;return _classCallCheck$2(this,r),(s=t.call(this,a||(null==o?void 0:o.message))).errorType=e===ERR.NETWORK_TIMEOUT?ERR.NETWORK:e,s.originError=o,s.ext=i,s.errorCode=ERR_CODE[e][n]||ERR_CODE[e],s.errorMessage=s.message,s.errorCode||(s.errorType=ERR.OTHER,s.errorCode=ERR_CODE[s.errorType]),s}return _createClass$2(r,null,[{key:"create",value:function(e,t,n,o,i){return e instanceof r?e:(e instanceof Error&&(n=e,e=""),e||(e=ERR.OTHER),new r(e,t,n,o,i))}},{key:"network",value:function(e){var t;return new r(null!=e&&e.isTimeout?ERR.NETWORK_TIMEOUT:ERR.NETWORK,null,e instanceof Error?e:null,{url:null==e?void 0:e.url,response:null==e?void 0:e.response,httpCode:null==e||null===(t=e.response)||void 0===t?void 0:t.status})}}]),r}(),LogCacheLevel={DEBUG:1,LOG:2,WARN:3,ERROR:4},LOG_MAX_SIZE=204800,SIMPLE_TYPE=["Boolean","Number","String","Undefined","Null","Date","Object"],Logger$2=function(){function e(t,r){_classCallCheck$2(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]"),this.logCacheLevel=(null==r?void 0:r.logCacheLevel)||3,this.logMaxSize=(null==r?void 0:r.logMaxSize)||LOG_MAX_SIZE,this.logSize=0,this.logTextArray=[]}return _createClass$2(e,[{key:"debug",value:function(){for(var t,r,n,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];this.logCache.apply(this,_concatInstanceProperty(t=[LogCacheLevel.DEBUG]).call(t,i)),e.disabled||(n=console).debug.apply(n,_concatInstanceProperty(r=["[".concat(nowTime$1(),"]"),this._prefix]).call(r,i))}},{key:"log",value:function(){for(var t,r,n,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];this.logCache.apply(this,_concatInstanceProperty(t=[LogCacheLevel.LOG]).call(t,i)),e.disabled||(n=console).log.apply(n,_concatInstanceProperty(r=["[".concat(nowTime$1(),"]"),this._prefix]).call(r,i))}},{key:"warn",value:function(){for(var t,r,n,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];this.logCache.apply(this,_concatInstanceProperty(t=[LogCacheLevel.WARN]).call(t,i)),e.disabled||(n=console).warn.apply(n,_concatInstanceProperty(r=["[".concat(nowTime$1(),"]"),this._prefix]).call(r,i))}},{key:"error",value:function(){for(var t,r,n,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];this.logCache.apply(this,_concatInstanceProperty(t=[LogCacheLevel.ERROR]).call(t,i)),e.disabled||(n=console).error.apply(n,_concatInstanceProperty(r=["[".concat(nowTime$1(),"]"),this._prefix]).call(r,i))}},{key:"logCache",value:function(e){if(!(e<this.logCacheLevel)){var t="";try{for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];var i=_mapInstanceProperty(n).call(n,(function(e){return logable(e)}));t="[".concat(nowTime$1(),"]")+this._prefix+_JSON$stringify(i)}catch(e){return}if(e>=this.logCacheLevel&&(this.logSize+=t.length,this.logTextArray.push(t)),this.logSize>this.logMaxSize){var a=this.logTextArray.shift();this.logSize-=a.length}}}},{key:"getLogCache",value:function(){var e=this.logTextArray.join("\n");return this.reset(),e}},{key:"reset",value:function(){this.logTextArray=[],this.logSize=0}},{key:"table",value:function(){var t;e.disabled||(console.group(this._prefix),(t=console).table.apply(t,arguments),console.groupEnd())}},{key:"setLogLevel",value:function(e){this.logCacheLevel=e}}],[{key:"enable",value:function(){e.disabled=!1}},{key:"disable",value:function(){e.disabled=!0}}]),e}();function nowTime$1(){return(new Date).toLocaleString()}function reduceDepth(e){var t;if("object"!==_typeof(e))return e;var r=_sliceInstanceProperty(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}}function logable(e,t,r){var n;r||(r=1),t||(t=2);var o={};if(!e||"object"!==_typeof(e))return e;var i=_sliceInstanceProperty(n=Object.prototype.toString.call(e)).call(n,8,-1);if(!_includesInstanceProperty(SIMPLE_TYPE).call(SIMPLE_TYPE,i))return i;if(!(r>t)){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(r===t?o[a]=reduceDepth(e[a]):"object"===_typeof(e[a])?o[a]=logable(e[a],t,r+1):o[a]=e[a]);return o}}function createPublicPromise(){var e,t,r=new _Promise((function(r,n){e=r,t=n}));return r.used=!1,r.resolve=function(){return r.used=!0,e.apply(void 0,arguments)},r.reject=function(){return r.used=!0,t.apply(void 0,arguments)},r}function nowTime(){try{return _parseInt$1(performance.now(),10)}catch(e){return(new Date).getTime()}}_defineProperty$1(Logger$2,"disabled",!0);var SafeJSON={stringify:function(e){try{return _JSON$stringify(e)}catch(e){return""}},parse:function(e){try{return JSON.parse(e)}catch(e){return}}};function getMediaSource(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];try{return isBrowser$1?e&&"undefined"!=typeof ManagedMediaSource?ManagedMediaSource:window.MediaSource:null}catch(e){}}function isMMS(e){return/ManagedMediaSource/gi.test(Object.prototype.toString.call(e))}function getTimeRanges(e){var t=[];if(e instanceof TimeRanges)for(var r=0;r<e.length;r++)t.push({start:e.start(r),end:e.end(r)});return t}var OP_NAME={APPEND:"appendBuffer",REMOVE:"removeBuffer",UPDATE_DURATION:"updateDuration"},MSE=function(){function e(t,r){var n=this;_classCallCheck$2(this,e),_defineProperty$1(this,"media",null),_defineProperty$1(this,"mediaSource",null),_defineProperty$1(this,"_openPromise",createPublicPromise()),_defineProperty$1(this,"_queue",_Object$create(null)),_defineProperty$1(this,"_sourceBuffer",_Object$create(null)),_defineProperty$1(this,"_mseFullFlag",{}),_defineProperty$1(this,"_st",0),_defineProperty$1(this,"_opst",0),_defineProperty$1(this,"_logger",null),_defineProperty$1(this,"_config",null),_defineProperty$1(this,"_url",null),_defineProperty$1(this,"_onStartStreaming",(function(){n._logger.debug("startstreaming")})),_defineProperty$1(this,"_onEndStreaming",(function(){n._logger.debug("endstreaming")})),_defineProperty$1(this,"_onSBUpdateEnd",(function(e){var t=n._queue[e];if(t){var r=t[0];if((null==r?void 0:r.opName)!==OP_NAME.UPDATE_DURATION&&t.shift(),r){var o,i,a,s=nowTime()-n._opst;n._logger.debug(_concatInstanceProperty(o="UpdateEnd(".concat(e,"/")).call(o,r.opName,")"),SafeJSON.stringify(getTimeRanges(null===(i=n._sourceBuffer[e])||void 0===i?void 0:i.buffered)),s,r.context),r.promise.resolve({name:r.opName,context:r.context,costtime:s});var c=null===(a=r.context)||void 0===a?void 0:a.callback;c&&"function"==typeof c&&c(r.context),n._startQueue(e)}}})),_defineProperty$1(this,"_onSBUpdateError",(function(e,t){var r=n._queue[e];if(r){var o=r[0];o&&(n._logger.error("UpdateError",e,o.opName,o.context),o.promise.reject(new StreamingError(ERR.MEDIA,ERR.SUB_TYPES.MSE_APPEND_BUFFER,t)))}})),this._config=_Object$assign(e.getDefaultConfig(),r),t&&this.bindMedia(t),this._logger=new Logger$2("MSE"),this._config.openLog&&Logger$2.enable()}var t,r,n;return _createClass$2(e,[{key:"isOpened",get:function(){var e;return"open"===(null===(e=this.mediaSource)||void 0===e?void 0:e.readyState)}},{key:"hasOpTasks",get:function(){var e,t=this,r=!1;return _forEachInstanceProperty(e=_Object$keys(this._queue)).call(e,(function(e){var n=t._queue[e];_Array$isArray(n)&&(r||(r=n.length>0))})),r}},{key:"url",get:function(){return this._url}},{key:"duration",get:function(){var e;return(null===(e=this.mediaSource)||void 0===e?void 0:e.duration)||-1}},{key:"isEnded",get:function(){return!!this.mediaSource&&"ended"===this.mediaSource.readyState}},{key:"streaming",get:function(){return!isMMS(this.mediaSource)||this.mediaSource.streaming}},{key:"isFull",value:function(t){return t?this._mseFullFlag[t]:this._mseFullFlag[e.VIDEO]}},{key:"updateDuration",value:function(e){var t=this,r=this.mediaSource&&this.mediaSource.duration>e;if(this.mediaSource&&this.mediaSource.duration>e){var n,o=0;if(_forEachInstanceProperty(n=_Object$keys(this._sourceBuffer)).call(n,(function(e){try{o=Math.max(t.bufferEnd(e)||0,o)}catch(e){}})),e<o)return _Promise.resolve()}return this._enqueueBlockingOp((function(){t.isEnded?t._logger.debug("setDuration but ended"):t.mediaSource&&(t.mediaSource.duration=e,t._logger.debug("setDuration",e))}),OP_NAME.UPDATE_DURATION,{isReduceDuration:r})}},{key:"open",value:function(){var e=this;if(this._openPromise.used&&!this.isOpened&&this.mediaSource){var t=this.mediaSource;t.addEventListener("sourceopen",(function r(){var n=nowTime()-e._st;e._logger.debug("sourceopen",n),t.removeEventListener("sourceopen",r),e._openPromise.resolve({costtime:n})})),this._openPromise=createPublicPromise()}return this._openPromise}},{key:"bindMedia",value:(n=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n,o,i,a=this;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mediaSource&&!this.media){e.next=3;break}return e.next=3,this.unbindMedia();case 3:if(r=getMediaSource(this._config.preferMMS),t&&r){e.next=6;break}throw new Error("Param media or MediaSource does not exist");case 6:return this.media=t,n=this.mediaSource=new r,o=isMMS(n),this._st=nowTime(),i=function e(){var r=nowTime()-a._st;a._logger.debug("sourceopen"),n.removeEventListener("sourceopen",e),_URL.revokeObjectURL(t.src),a._openPromise.resolve({costtime:r})},n.addEventListener("sourceopen",i),o&&(n.addEventListener("startstreaming",this._onStartStreaming),n.addEventListener("endstreaming",this._onEndStreaming)),this._url=_URL.createObjectURL(n),t.src=this._url,t.disableRemotePlayback=o,e.abrupt("return",this._openPromise);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"unbindMedia",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,r,n,o=this;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._openPromise.used||this._openPromise.resolve(),t=this.mediaSource){var i,a;if(_forEachInstanceProperty(i=_Object$keys(this._queue)).call(i,(function(e){var t=o._queue[e];t&&_forEachInstanceProperty(t).call(t,(function(e){var t,r;return null===(t=e.promise)||void 0===t||null===(r=t.resolve)||void 0===r?void 0:r.call(t)}))})),r=!!this.media&&this.media.readyState>=1,n="open"===t.readyState,r&&n)try{t.endOfStream()}catch(e){}_forEachInstanceProperty(a=_Object$keys(this._sourceBuffer)).call(a,(function(e){try{t.removeSourceBuffer(o._sourceBuffer[e])}catch(e){}})),isMMS(t)&&(t.removeEventListener("startstreaming",this._onStartStreaming),t.removeEventListener("endstreaming",this._onEndStreaming))}if(this.media){this.media.disableRemotePlayback=!1,this.media.removeAttribute("src");try{this.media.load()}catch(e){}this.media=null}this.mediaSource=null,this._openPromise=createPublicPromise(),this._queue=_Object$create(null),this._sourceBuffer=_Object$create(null);case 8:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"createSource",value:function(e,t){var r,n;if(!this._sourceBuffer[e]&&this.mediaSource){var o;try{o=this._sourceBuffer[e]=this.mediaSource.addSourceBuffer(t)}catch(e){throw new StreamingError(ERR.MEDIA,ERR.SUB_TYPES.MSE_ADD_SB,e)}o.mimeType=t,o.addEventListener("updateend",_bindInstanceProperty(r=this._onSBUpdateEnd).call(r,this,e)),o.addEventListener("error",_bindInstanceProperty(n=this._onSBUpdateError).call(n,this,e))}}},{key:"changeType",value:function(e,t){var r=this,n=this._sourceBuffer[e];return this.mediaSource&&n&&n.mimeType!==t?"function"!=typeof n.changeType?_Promise.reject(new StreamingError(ERR.MEDIA,ERR.SUB_TYPES.MSE_CHANGE_TYPE,new Error("changeType is not a function"))):this._enqueueOp(e,(function(){try{n.changeType(t)}catch(e){throw new StreamingError(ERR.MEDIA,ERR.SUB_TYPES.MSE_CHANGE_TYPE,e)}n.mimeType=t,r._onSBUpdateEnd(e)}),"changeType",{mimeType:t}):_Promise.resolve()}},{key:"createOrChangeSource",value:function(e,t){return this.createSource(e,t),this.changeType(e,t)}},{key:"append",value:function(e,t,r){var n=this;return t&&t.byteLength&&this._sourceBuffer[e]?this._enqueueOp(e,(function(){var o;n.mediaSource&&!n.media.error&&(n._logger.debug("MSE APPEND START",r),n._opst=nowTime(),null===(o=n._sourceBuffer[e])||void 0===o||o.appendBuffer(t))}),OP_NAME.APPEND,r):_Promise.resolve()}},{key:"remove",value:function(e,t,r,n){var o=this,i=!1;return this._mseFullFlag[e]&&(i=!0),this._enqueueOp(e,(function(){if(o.mediaSource&&!o.media.error){var i=o._sourceBuffer[e];t>=r||!i?o._onSBUpdateEnd(e):(o._opst=nowTime(),o._logger.debug("MSE REMOVE START",e,t,r,n),i.remove(t,r))}}),OP_NAME.REMOVE,n,i)}},{key:"clearBuffer",value:function(e,t){var r,n,o=this;return _forEachInstanceProperty(r=_Object$keys(this._sourceBuffer)).call(r,(function(r){n=o.remove(r,e,t)})),n||_Promise.resolve()}},{key:"clearAllBuffer",value:function(){var e,t,r=this;return _forEachInstanceProperty(e=_Object$keys(this._sourceBuffer)).call(e,(function(e){var n=r._sourceBuffer[e];t=r.remove(e,0,Buffer$1.end(Buffer$1.get(n)))})),t}},{key:"clearOpQueues",value:function(e,t){var r;this._logger.debug("MSE clearOpQueue START");var n=this._queue[e];if(t&&n)this._queue[e]=[];else if(n&&n[e]&&!(n.length<5)){var o=[];_forEachInstanceProperty(n).call(n,(function(e){e.context&&e.context.isinit&&o.push(e)})),this._queue[e]=_sliceInstanceProperty(n).call(n,0,2),o.length>0&&(r=this._queue[e]).push.apply(r,o)}}},{key:"endOfStream",value:function(e){var t=this;return this.mediaSource&&"open"===this.mediaSource.readyState?this._enqueueBlockingOp((function(){var r=t.mediaSource;r&&"open"===r.readyState&&(t._logger.debug("MSE endOfStream START"),e?r.endOfStream(e):r.endOfStream())}),"endOfStream"):_Promise.resolve()}},{key:"setLiveSeekableRange",value:function(e,t){var r=this.mediaSource;e<0||t<e||null==r||!r.setLiveSeekableRange||"open"!==r.readyState||r.setLiveSeekableRange(e,t)}},{key:"getSourceBuffer",value:function(e){return this._sourceBuffer[e]}},{key:"buffered",value:function(e){return Buffer$1.get(this._sourceBuffer[e])}},{key:"bufferStart",value:function(e){return Buffer$1.start(this.buffered(e))}},{key:"bufferEnd",value:function(e){return Buffer$1.end(this.buffered(e))}},{key:"_enqueueOp",value:function(e,t,r,n,o){var i=this;if(!this.mediaSource)return _Promise.resolve();var a=this._queue[e]=this._queue[e]||[],s={exec:t,promise:createPublicPromise(),opName:r,context:n};return o?(_spliceInstanceProperty(a).call(a,0,0,s),this._mseFullFlag[e]=!1,this._startQueue(e)):a.push(s),this.isOpened||this.isEnded?1===a.length&&this._startQueue(e):this._openPromise.then((function(){1===a.length&&i._startQueue(e)})),s.promise}},{key:"_enqueueBlockingOp",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){var o,i,a=this;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mediaSource){e.next=2;break}return e.abrupt("return",_Promise.resolve());case 2:if((o=_Object$keys(this._sourceBuffer)).length){e.next=5;break}return e.abrupt("return",t());case 5:return i=[],_forEachInstanceProperty(o).call(o,(function(e){var t=a._queue[e],o=createPublicPromise();i.push(o),t.push({exec:function(){o.resolve()},promise:o,opName:r,context:n}),1===t.length&&a._startQueue(e)})),e.abrupt("return",_Promise.all(i).then((function(){try{return t()}finally{_forEachInstanceProperty(o).call(o,(function(e){var t=a._queue[e],r=a._sourceBuffer[e];null==t||t.shift(),r&&r.updating||a._startQueue(e)}))}})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})},{key:"_startQueue",value:function(e){var t=this._queue[e];if(t){var r=t[0];if(r&&!this._mseFullFlag[e])try{r.exec()}catch(a){var n,o,i;if(a&&a.message&&_indexOfInstanceProperty(n=a.message).call(n,"SourceBuffer is full")>=0)this._mseFullFlag[e]=!0,r.context&&"object"===_typeof(r.context)&&(r.context.isFull=!0),this._logger.error("[MSE error], context,",r.context," ,name,",r.opName,",err,SourceBuffer is full"),null==r||null===(o=r.promise)||void 0===o||o.reject(new StreamingError(ERR.MEDIA,ERR.SUB_TYPES.MSE_FULL,a));else this._logger.error(a),null==r||null===(i=r.promise)||void 0===i||i.reject(a.constructor===StreamingError?a:new StreamingError(ERR.MEDIA,ERR.SUB_TYPES.MSE_OTHER,a)),t.shift(),this._startQueue(e)}}}},{key:"setTimeoffset",value:function(e,t,r){var n=this;return this._enqueueOp(e,(function(){t<0&&(t+=.001),n._sourceBuffer[e].timestampOffset=t,n._onSBUpdateEnd(e)}),"setTimeoffset",r)}},{key:"abort",value:function(e,t){var r=this;return this.isOpened?this._enqueueOp(e,(function(){r._sourceBuffer[e].abort(),r._onSBUpdateEnd(e)}),"abort",t):_Promise.resolve()}}],[{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'video/mp4; codecs="avc1.42E01E,mp4a.40.2"',t=getMediaSource(!(arguments.length>1&&void 0!==arguments[1])||arguments[1]);if(!t)return!1;try{return t.isTypeSupported(e)}catch(t){return this._logger.error(e,t),!1}}},{key:"isMMSOnly",value:function(){return"undefined"!=typeof ManagedMediaSource&&"undefined"==typeof MediaSource}},{key:"getDefaultConfig",value:function(){return{openLog:!1,preferMMS:!1}}}]),e}();_defineProperty$1(MSE,"VIDEO","video"),_defineProperty$1(MSE,"AUDIO","audio");var LoaderType={FETCH:"fetch",XHR:"xhr"},ResponseType={ARRAY_BUFFER:"arraybuffer",TEXT:"text",JSON:"json"},NetError=function(e){_inherits$2(r,_wrapNativeSuper(Error));var t=_createSuper$1(r);function r(e,n,o,i){var a;return _classCallCheck$2(this,r),_defineProperty$1(_assertThisInitialized$2(a=t.call(this,i)),"retryCount",0),_defineProperty$1(_assertThisInitialized$2(a),"isTimeout",!1),_defineProperty$1(_assertThisInitialized$2(a),"loaderType",LoaderType.FETCH),_defineProperty$1(_assertThisInitialized$2(a),"startTime",0),_defineProperty$1(_assertThisInitialized$2(a),"endTime",0),_defineProperty$1(_assertThisInitialized$2(a),"options",{}),a.url=e,a.request=n,a.response=o,a}return _createClass$2(r)}(),toString$1=Object.prototype.toString;function isObject$1(e){return null!==e&&"object"===_typeof(e)}function isPlainObject(e){if("[object Object]"!==toString$1.call(e))return!1;var t=_Object$getPrototypeOf(e);return null===t||t===Object.prototype}function isDate(e){return"[object Date]"===toString$1.call(e)}function getRangeValue(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 encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function setUrlParams(e,t){var r,n;if(e){if(!t)return e;var o,i=_filterInstanceProperty(r=_mapInstanceProperty(n=_Object$keys(t)).call(n,(function(e){if(null!=(o=t[e]))return _Array$isArray(o)?e+="[]":o=[o],_mapInstanceProperty(o).call(o,(function(t){var r;return isDate(t)?t=t.toISOString():isObject$1(t)&&(t=_JSON$stringify(t)),_concatInstanceProperty(r="".concat(encode(e),"=")).call(r,encode(t))})).join("&")}))).call(r,Boolean).join("&");if(i){var a=_indexOfInstanceProperty(e).call(e,"#");-1!==a&&(e=_sliceInstanceProperty(e).call(e,0,a)),e+=(-1===_indexOfInstanceProperty(e).call(e,"?")?"?":"&")+i}return e}}function createResponse(e,t,r,n,o,i,a,s,c,l,u){return o=null!=o?_parseFloat$1(o):null,n=_parseInt$1(n||"0",10),_Number$isNaN(n)&&(n=0),{data:e,done:t,options:{range:c,vid:l,index:s,contentLength:n,age:o,startTime:i,firstByteTime:a,endTime:_Date$now(),priOptions:u},response:r}}function calculateSpeed(e,t){return Math.round(8*e*1e3/t/1024)}var EVENT={ERROR:"error",TTFB:"core.ttfb",LOAD_START:"core.loadstart",LOAD_RESPONSE_HEADERS:"core.loadresponseheaders",LOAD_COMPLETE:"core.loadcomplete",LOAD_RETRY:"core.loadretry",SOURCEBUFFER_CREATED:"core.sourcebuffercreated",MEDIASOURCE_OPENED:"core.mediasourceopened",ANALYZE_DURATION_EXCEEDED:"core.analyzedurationexceeded",APPEND_BUFFER:"core.appendbuffer",REMOVE_BUFFER:"core.removebuffer",BUFFEREOS:"core.buffereos",KEYFRAME:"core.keyframe",CHASEFRAME:"core.chaseframe",METADATA_PARSED:"core.metadataparsed",SEI:"core.sei",SEI_IN_TIME:"core.seiintime",FLV_SCRIPT_DATA:"core.flvscriptdata",LOWDECODE:"core.lowdecode",SWITCH_URL_SUCCESS:"core.switchurlsuccess",SWITCH_URL_FAILED:"core.switchurlfailed",SPEED:"core.speed",HLS_MANIFEST_LOADED:"core.hlsmanifestloaded",HLS_LEVEL_LOADED:"core.hlslevelloaded",DEMUXED_TRACK:"core.demuxedtrack",STREAM_EXCEPTION:"core.streamexception",LARGE_AV_FIRST_FRAME_GAP_DETECT:"LARGE_AV_FIRST_FRAME_GAP_DETECT",LARGE_VIDEO_DTS_GAP_DETECT:"LARGE_VIDEO_DTS_GAP_DETECT",LARGE_AUDIO_DTS_GAP_DETECT:"LARGE_AUDIO_DTS_GAP_DETECT",AUDIO_GAP_DETECT:"AUDIO_GAP_DETECT",AUDIO_OVERLAP_DETECT:"AUDIO_OVERLAP_DETECT",MAX_DTS_DELTA_WITH_NEXT_SEGMENT_DETECT:"MAX_DTS_DELTA_WITH_NEXT_SEGMENT_DETECT",REAL_TIME_SPEED:"real_time_speed"},CACHESIZE=2097152,FetchLoader=function(e){_inherits$2(n,EventEmitter);var t,r=_createSuper$1(n);function n(){var e;return _classCallCheck$2(this,n),_defineProperty$1(_assertThisInitialized$2(e=r.call(this)),"_abortController",null),_defineProperty$1(_assertThisInitialized$2(e),"_timeoutTimer",null),_defineProperty$1(_assertThisInitialized$2(e),"_reader",null),_defineProperty$1(_assertThisInitialized$2(e),"_response",null),_defineProperty$1(_assertThisInitialized$2(e),"_aborted",!1),_defineProperty$1(_assertThisInitialized$2(e),"_index",-1),_defineProperty$1(_assertThisInitialized$2(e),"_range",null),_defineProperty$1(_assertThisInitialized$2(e),"_receivedLength",0),_defineProperty$1(_assertThisInitialized$2(e),"_running",!1),_defineProperty$1(_assertThisInitialized$2(e),"_logger",null),_defineProperty$1(_assertThisInitialized$2(e),"_vid",""),_defineProperty$1(_assertThisInitialized$2(e),"_firtstByte",0),_defineProperty$1(_assertThisInitialized$2(e),"_onProcessMinLen",0),_defineProperty$1(_assertThisInitialized$2(e),"_onCancel",null),_defineProperty$1(_assertThisInitialized$2(e),"_priOptions",null),e}return _createClass$2(n,[{key:"load",value:function(e){var t,r=this,n=e.url,o=e.vid,i=e.timeout,a=e.responseType,s=e.onProgress,c=e.index,l=e.onTimeout,u=e.onCancel,p=e.range,$=e.transformResponse,f=e.request,d=e.params,y=e.logger,h=e.method,_=e.headers,g=e.body,m=e.mode,v=e.credentials,b=e.cache,S=e.redirect,E=e.referrer,P=e.referrerPolicy,O=e.onProcessMinLen,T=e.priOptions,I=e.streamRes,A=e.firstMaxChunkSize;this._logger=y,this._aborted=!1,this._onProcessMinLen=O,this._onCancel=u,this._abortController="undefined"!=typeof AbortController&&new AbortController,this._running=!0,this._index=c,this._range=p||[0,0],this._vid=o||n,this._priOptions=T||{},this._firstMaxChunkSize=A;var R={method:h,headers:_,body:g,mode:m,credentials:v,cache:b,redirect:S,referrer:E,referrerPolicy:P,signal:null===(t=this._abortController)||void 0===t?void 0:t.signal},C=!1;clearTimeout(this._timeoutTimer),n=setUrlParams(n,d);var w=getRangeValue(p);w&&(_=f?f.headers:R.headers=R.headers||(Headers?new Headers:{}),Headers&&_ instanceof Headers?_.append("Range",w):_.Range=w),i&&(this._timeoutTimer=_setTimeout((function(){if(C=!0,r.cancel(),l){var e=new NetError(n,R,null,"timeout");e.isTimeout=!0,l(e,{index:r._index,range:r._range,vid:r._vid,priOptions:r._priOptions})}}),i));var D=_Date$now();return this._logger.debug("[fetch load start], index,",c,",range,",p),new _Promise((function(e,t){(I?new _Promise((function(e){e(I)})):fetch(f||n,f?void 0:R)).then(function(){var o=_asyncToGenerator(_regeneratorRuntime().mark((function o(i){var l,u,f,d;return _regeneratorRuntime().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(clearTimeout(r._timeoutTimer),r._response=i,!r._aborted&&r._running){o.next=4;break}return o.abrupt("return");case 4:if($&&(i=$(i,n)||i),i.ok){o.next=7;break}throw new NetError(n,R,i,"bad network response");case 7:if(l=_Date$now(),a!==ResponseType.TEXT){o.next=15;break}return o.next=11,i.text();case 11:u=o.sent,r._running=!1,o.next=37;break;case 15:if(a!==ResponseType.JSON){o.next=22;break}return o.next=18,i.json();case 18:u=o.sent,r._running=!1,o.next=37;break;case 22:if(!s){o.next=29;break}return r.resolve=e,r.reject=t,r._loadChunk(i,s,D,l),o.abrupt("return");case 29:return o.next=31,i.arrayBuffer();case 31:u=o.sent,u=new Uint8Array(u),r._running=!1,f=_Date$now()-D,d=calculateSpeed(u.byteLength,f),r.emit(EVENT.REAL_TIME_SPEED,{speed:d,len:u.byteLength,time:f,vid:r._vid,index:r._index,range:r._range,priOptions:r._priOptions});case 37:r._logger.debug("[fetch load end], index,",c,",range,",p),e(createResponse(u,!0,i,i.headers.get("Content-Length"),i.headers.get("age"),D,l,c,p,r._vid,r._priOptions));case 39:case"end":return o.stop()}}),o)})));return function(e){return o.apply(this,arguments)}}()).catch((function(e){var o;clearTimeout(r._timeoutTimer),r._running=!1,r._aborted&&!C||((e=e instanceof NetError?e:new NetError(n,R,null,null===(o=e)||void 0===o?void 0:o.message)).startTime=D,e.endTime=_Date$now(),e.isTimeout=C,e.options={index:r._index,range:r._range,vid:r._vid,priOptions:r._priOptions},t(e))}))}))}},{key:"cancel",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().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 t.apply(this,arguments)})},{key:"_loadChunk",value:function(e,t,r,n){var o=this;if(!e.body||!e.body.getReader){this._running=!1;var i=new NetError(e.url,"",e,"onProgress of bad response.body.getReader");return i.options={index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions},void this.reject(i)}this._onProcessMinLen>0&&(this._cache=new Uint8Array(CACHESIZE),this._writeIdx=0);var a,s,c,l=this._reader=e.body.getReader(),u=function(){var i=_asyncToGenerator(_regeneratorRuntime().mark((function i(){var p,$,f,d,y,h,_,g,m,v;return _regeneratorRuntime().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return s=_Date$now(),i.prev=1,i.next=4,l.read();case 4:a=i.sent,c=_Date$now(),i.next=13;break;case 8:return i.prev=8,i.t0=i.catch(1),c=_Date$now(),o._aborted||(o._running=!1,i.t0.options={index:o._index,range:o._range,vid:o._vid,priOptions:o._priOptions},o.reject(i.t0)),i.abrupt("return");case 13:if($=(null===(p=o._range)||void 0===p?void 0:p.length)>0?o._range[0]:0,f=$+o._receivedLength,!o._aborted){i.next=19;break}return o._running=!1,t(void 0,!1,{range:[f,f],vid:o._vid,index:o._index,startTime:s,endTime:c,st:r,firstByteTime:n,priOptions:o._priOptions},e),i.abrupt("return");case 19:var b;if(d=a.value?a.value.byteLength:0,o._receivedLength+=d,o._logger.debug("【fetchLoader,onProgress call】,task,",o._range,", start,",f,", end,",$+o._receivedLength,", done,",a.done),o._onProcessMinLen>0){if(o._writeIdx+d>=o._onProcessMinLen||a.done)(y=new Uint8Array(o._writeIdx+d)).set(_sliceInstanceProperty(b=o._cache).call(b,0,o._writeIdx),0),d>0&&y.set(a.value,o._writeIdx),o._writeIdx=0,o._logger.debug("【fetchLoader,onProgress enough】,done,",a.done,",len,",y.byteLength,", writeIdx,",o._writeIdx);else if(d>0&&o._writeIdx+d<CACHESIZE)o._cache.set(a.value,o._writeIdx),o._writeIdx+=d,o._logger.debug("【fetchLoader,onProgress cache】,len,",d,", writeIdx,",o._writeIdx);else if(d>0){var S;h=new Uint8Array(o._writeIdx+d+2048),o._logger.debug("【fetchLoader,onProgress extra start】,size,",o._writeIdx+d+2048,", datalen,",d,", writeIdx,",o._writeIdx),h.set(_sliceInstanceProperty(S=o._cache).call(S,0,o._writeIdx),0),d>0&&h.set(a.value,o._writeIdx),o._writeIdx+=d,delete o._cache,o._cache=h,o._logger.debug("【fetchLoader,onProgress extra end】,len,",d,", writeIdx,",o._writeIdx)}}else y=a.value;(y&&y.byteLength>0||a.done)&&(o._firstMaxChunkSize&&(o._firtstByte?o._cacheData&&((g=new Uint8Array(o._cacheData.byteLength+y.byteLength)).set(o._cacheData,0),g.set(y,o._cacheData.byteLength),y=g,o._cacheData=null):(o._firtstByte++,_=_sliceInstanceProperty(y).call(y,0,o._firstMaxChunkSize),o._cacheData=_sliceInstanceProperty(y).call(y,o._firstMaxChunkSize),y=_)),t(y,a.done,{range:[o._range[0]+o._receivedLength-(y?y.byteLength:0),o._range[0]+o._receivedLength],vid:o._vid,index:o._index,startTime:s,endTime:c,st:r,firstByteTime:n,priOptions:o._priOptions},e)),a.done?(m=_Date$now()-r,v=calculateSpeed(o._receivedLength,m),o.emit(EVENT.REAL_TIME_SPEED,{speed:v,len:o._receivedLength,time:m,vid:o._vid,index:o._index,range:o._range,priOptions:o._priOptions}),o._running=!1,o._logger.debug("[fetchLoader onProgress end],task,",o._range,",done,",a.done),o.resolve(createResponse(a,!0,e,e.headers.get("Content-Length"),e.headers.get("age"),r,n,o._index,o._range,o._vid,o._priOptions))):o._firstMaxChunkSize?_setTimeout((function(){u()}),0):u();case 25:case"end":return i.stop()}}),i,null,[[1,8]])})));return function(){return i.apply(this,arguments)}}();u()}},{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)}}]),n}();function getConfig(e){return _objectSpread2({loaderType:LoaderType.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:ResponseType.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},e)}var XhrLoader=function(e){_inherits$2(r,EventEmitter);var t=_createSuper$1(r);function r(){var e;return _classCallCheck$2(this,r),_defineProperty$1(_assertThisInitialized$2(e=t.call(this)),"_xhr",null),_defineProperty$1(_assertThisInitialized$2(e),"_aborted",!1),_defineProperty$1(_assertThisInitialized$2(e),"_timeoutTimer",null),_defineProperty$1(_assertThisInitialized$2(e),"_range",null),_defineProperty$1(_assertThisInitialized$2(e),"_receivedLength",0),_defineProperty$1(_assertThisInitialized$2(e),"_url",null),_defineProperty$1(_assertThisInitialized$2(e),"_onProgress",null),_defineProperty$1(_assertThisInitialized$2(e),"_index",-1),_defineProperty$1(_assertThisInitialized$2(e),"_headers",null),_defineProperty$1(_assertThisInitialized$2(e),"_currentChunkSizeKB",384),_defineProperty$1(_assertThisInitialized$2(e),"_timeout",null),_defineProperty$1(_assertThisInitialized$2(e),"_xhr",null),_defineProperty$1(_assertThisInitialized$2(e),"_withCredentials",null),_defineProperty$1(_assertThisInitialized$2(e),"_startTime",-1),_defineProperty$1(_assertThisInitialized$2(e),"_loadCompleteResolve",null),_defineProperty$1(_assertThisInitialized$2(e),"_loadCompleteReject",null),_defineProperty$1(_assertThisInitialized$2(e),"_runing",!1),_defineProperty$1(_assertThisInitialized$2(e),"_logger",!1),_defineProperty$1(_assertThisInitialized$2(e),"_vid",""),_defineProperty$1(_assertThisInitialized$2(e),"_responseType",void 0),_defineProperty$1(_assertThisInitialized$2(e),"_credentials",void 0),_defineProperty$1(_assertThisInitialized$2(e),"_method",void 0),_defineProperty$1(_assertThisInitialized$2(e),"_transformResponse",void 0),_defineProperty$1(_assertThisInitialized$2(e),"_firstRtt",void 0),_defineProperty$1(_assertThisInitialized$2(e),"_onCancel",null),_defineProperty$1(_assertThisInitialized$2(e),"_priOptions",null),e}return _createClass$2(r,[{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=setUrlParams(e.url,e.params);var r=_Date$now();return new _Promise((function(e,r){t._loadCompleteResolve=e,t._loadCompleteReject=r,t._startLoad()})).catch((function(e){if(clearTimeout(t._timeoutTimer),t._runing=!1,!t._aborted)throw(e=e instanceof NetError?e:new NetError(t._url,t._request)).startTime=r,e.endTime=_Date$now(),e.options={index:t._index,vid:t._vid,priOptions:t._priOptions},e}))}},{key:"_startLoad",value:function(){var e=null;if(this._responseType===ResponseType.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<this._range[1]-r&&(n=r+t),e=[r,n],this._logger.debug("[xhr_loader->],tast :",this._range,", SubRange, ",e)}else e=this._range,this._logger.debug("[xhr_loader->],tast :",this._range,", allRange, ",e);this._internalOpen(e)}},{key:"_internalOpen",value:function(e){var t=this;try{var r,n;this._startTime=_Date$now();var o=this._xhr=new XMLHttpRequest;o.open(this._method||"GET",this._url,!0),o.responseType=this._responseType,this._timeout&&(o.timeout=this._timeout),o.withCredentials=this._withCredentials,o.onload=_bindInstanceProperty(r=this._onLoad).call(r,this),o.onreadystatechange=_bindInstanceProperty(n=this._onReadyStatechange).call(n,this),o.onerror=function(e){var r,n,o;t._running=!1;var i=new NetError(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===(o=e.currentTarget)||void 0===o?void 0:o.statusText));i.options={index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions},t._loadCompleteReject(i)},o.ontimeout=function(e){t.cancel();var r=new NetError(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 i,a=this._headers||{},s=getRangeValue(e);if(s&&(a.Range=s),a)_forEachInstanceProperty(i=_Object$keys(a)).call(i,(function(e){o.setRequestHeader(e,a[e])}));this._logger.debug("[xhr.send->] tast,",this._range,",load sub range, ",e),o.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=_Date$now())}},{key:"_onLoad",value:function(e){var t,r=e.target.status;if(r<200||r>299){var n=new NetError(this._url,null,_objectSpread2(_objectSpread2({},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 o,i=null,a=!1,s=(null===(t=this._range)||void 0===t?void 0:t.length)>0?this._range[0]:0;if(this._responseType===ResponseType.ARRAY_BUFFER){var c,l=new Uint8Array(e.target.response);if(o=s+this._receivedLength,l&&l.byteLength>0){this._receivedLength+=l.byteLength;var u=_Date$now()-this._startTime,p=calculateSpeed(this._receivedLength,u);this.emit(EVENT.REAL_TIME_SPEED,{speed:p,len:this._receivedLength,time:u,vid:this._vid,index:this._index,range:[o,s+this._receivedLength],priOptions:this._priOptions})}i=l,a=!((null===(c=this._range)||void 0===c?void 0:c.length)>1&&this._range[1]&&this._receivedLength<this._range[1]-this._range[0]),this._logger.debug("[xhr load done->], tast :",this._range,", start",o,"end ",s+this._receivedLength,",dataLen,",l?l.byteLength:0,",receivedLength",this._receivedLength,",index,",this._index,", done,",a)}else a=!0,i=e.target.response;var $={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&&($=this._transformResponse($,this._url)||$),this._onProgress&&this._onProgress(i,a,{index:this._index,vid:this._vid,range:[o,s+this._receivedLength],startTime:this._startTime,endTime:_Date$now(),priOptions:this._priOptions},$),a?(this._runing=!1,this._loadCompleteResolve&&this._loadCompleteResolve(createResponse(this._onProgress?null:i,a,$,$.headers["content-length"],$.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,_get(_getPrototypeOf$2(r.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={},o=_createForOfIteratorHelper(_trimInstanceProperty(t=e.getAllResponseHeaders()).call(t).split("\r\n"));try{for(o.s();!(r=o.n()).done;){var i=r.value.split(": ");n[i[0].toLowerCase()]=_sliceInstanceProperty(i).call(i,1).join(": ")}}catch(e){o.e(e)}finally{o.f()}return n}}],[{key:"isSupported",value:function(){return"undefined"!=typeof XMLHttpRequest}}]),r}(),_excluded=["retry","retryDelay","onRetryError","transformError"],Task=function(){function e(t,r){_classCallCheck$2(this,e),this.promise=createPublicPromise(),this.alive=!!r.onProgress,!r.logger&&(r.logger=new Logger$2("Loader")),this._loaderType=t,this._loader=t===LoaderType.FETCH&&"undefined"!=typeof fetch?new FetchLoader:new XhrLoader,this._config=r,this._retryCount=0,this._retryTimer=null,this._canceled=!1,this._retryCheckFunc=r.retryCheckFunc,this._logger=r.logger}var t;return _createClass$2(e,[{key:"exec",value:function(){var e=this,t=this._config,r=t.retry,n=t.retryDelay,o=t.onRetryError,i=t.transformError,a=_objectWithoutProperties(t,_excluded),s=function(){var t=_asyncToGenerator(_regeneratorRuntime().mark((function t(){var c,l,u;return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e._loader.load(a);case 3:c=t.sent,e.promise.resolve(c),t.next=27;break;case 7:if(t.prev=7,t.t0=t.catch(0),e._loader.running=!1,e._logger.debug("[task request catch err]",t.t0),!e._canceled){t.next=13;break}return t.abrupt("return");case 13:if(t.t0.loaderType=e._loaderType,t.t0.retryCount=e._retryCount,l=t.t0,i&&(l=i(l)||l),o&&e._retryCount>0&&o(l,e._retryCount,{index:a.index,vid:a.vid,range:a.range,priOptions:a.priOptions}),e._retryCount++,u=!0,e._retryCheckFunc&&(u=e._retryCheckFunc(t.t0)),!(u&&e._retryCount<=r)){t.next=26;break}return clearTimeout(e._retryTimer),e._logger.debug("[task request setTimeout],retry",e._retryCount,",retry range,",a.range),e._retryTimer=_setTimeout(s,n),t.abrupt("return");case 26:e.promise.reject(l);case 27:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}();return s(),this.promise}},{key:"cancel",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return clearTimeout(this._retryTimer),this._canceled=!0,this._loader.running=!1,e.abrupt("return",this._loader.cancel());case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"running",get:function(){return this._loader&&this._loader.running}},{key:"loader",get:function(){return this._loader}}]),e}();function isMediaPlaying(e){return e&&!e.paused&&!e.ended&&0!==e.playbackRate&&0!==e.readyState}function getVideoPlaybackQuality(e){if(!e)return{};if("function"==typeof e.getVideoPlaybackQuality){var t=e.getVideoPlaybackQuality();return{droppedVideoFrames:t.droppedVideoFrames||t.corruptedVideoFrames,totalVideoFrames:t.totalVideoFrames,creationTime:t.creationTime}}return{droppedVideoFrames:e.webkitDroppedFrameCount,totalVideoFrames:e.webkitDecodedFrameCount,creationTime:performance.now()}}function concatUint8Array$1(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if((t=_filterInstanceProperty(t).call(t,Boolean)).length<2)return t[0];var n=new Uint8Array(_reduceInstanceProperty(t).call(t,(function(e,t){return e+t.byteLength}),0)),o=0;return _forEachInstanceProperty(t).call(t,(function(e){n.set(e,o),o+=e.byteLength})),n}function sleep(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new _Promise((function(t){return _setTimeout(t,e)}))}var NetLoader=function(e){_inherits$2(n,EventEmitter);var t,r=_createSuper$1(n);function n(e){var t;return _classCallCheck$2(this,n),_defineProperty$1(_assertThisInitialized$2(t=r.call(this,e)),"type",LoaderType.FETCH),_defineProperty$1(_assertThisInitialized$2(t),"_queue",[]),_defineProperty$1(_assertThisInitialized$2(t),"_alive",[]),_defineProperty$1(_assertThisInitialized$2(t),"_currentTask",null),_defineProperty$1(_assertThisInitialized$2(t),"_finnalUrl",""),_defineProperty$1(_assertThisInitialized$2(t),"_config",void 0),t._config=getConfig(e),t._config.loaderType!==LoaderType.XHR&&FetchLoader.isSupported()||(t.type=LoaderType.XHR),t.log=e.logger,t}return _createClass$2(n,[{key:"isFetch",value:function(){return this.type===LoaderType.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=_Object$assign({},this._config,r)).params&&(r.params=_Object$assign({},r.params)),r.headers&&isPlainObject(r.headers)&&(r.headers=_Object$assign({},r.headers)),r.body&&isPlainObject(r.body)&&(r.body=_Object$assign({},r.body)),r.transformRequest&&(r=r.transformRequest(r)||r),r.logger=this.log;var n=new Task(this.type,r);return n.loader.on(EVENT.REAL_TIME_SPEED,(function(e){t.emit(EVENT.REAL_TIME_SPEED,e)})),this._queue.push(n),1!==this._queue.length||this._currentTask&&this._currentTask.running||this._processTask(),n.promise}},{key:"cancel",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t;return _regeneratorRuntime().wrap((function(e){for(var r,n,o;;)switch(e.prev=e.next){case 0:return t=_concatInstanceProperty(r=_mapInstanceProperty(n=this._queue).call(n,(function(e){return e.cancel()}))).call(r,_mapInstanceProperty(o=this._alive).call(o,(function(e){return e.cancel()}))),this._currentTask&&t.push(this._currentTask.cancel()),this._queue=[],this._alive=[],e.next=6,_Promise.all(t);case 6:return e.next=8,sleep();case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.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=_filterInstanceProperty(n=e._alive).call(n,(function(t){return t&&t!==e._currentTask})));e._processTask()}))}}}],[{key:"isFetchSupport",value:function(){return FetchLoader.isSupported()}}]),n}(),GapService=function(){function e(){_classCallCheck$2(this,e),_defineProperty$1(this,"_prevCurrentTime",0)}return _createClass$2(e,[{key:"do",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(e){var o=e.currentTime,i=0;if(this._prevCurrentTime===o){var a=Buffer$1.info(Buffer$1.get(e),o);if(!a.buffers.length)return;r&&a.nextStart||a.nextStart&&a.nextStart-o<t?i=a.nextStart+.1:a.end&&a.end-o>n&&!e.seeking&&(i=o+.1)}this._prevCurrentTime=o,i&&o!==i&&(e.currentTime=i)}}}]),e}(),collection=collection$2,collectionStrong=collectionStrong$2;collection("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),collectionStrong);var path$2=path$w,set$5=path$2.Set,parent$e=set$5,set$4=parent$e,tryToString=tryToString$8,aSet$g=function(e){if("object"==typeof e&&"size"in e&&"has"in e&&"add"in e&&"delete"in e&&"keys"in e)return e;throw TypeError(tryToString(e)+" is not a set")},getBuiltIn$1=getBuiltIn$j,caller=caller$2,Set$5=getBuiltIn$1("Set"),SetPrototype=Set$5.prototype,setHelpers={Set:Set$5,add:caller("add",1),has:caller("has",1),remove:caller("delete",1),proto:SetPrototype},iterateSimple$6=iterateSimple$8,setIterate=function(e,t,r){return r?iterateSimple$6(e.keys(),t):e.forEach(t)},SetHelpers$5=setHelpers,iterate$8=setIterate,Set$4=SetHelpers$5.Set,add$6=SetHelpers$5.add,setClone=function(e){var t=new Set$4;return iterate$8(e,(function(e){add$6(t,e)})),t},setSize=function(e){return e.size},aCallable$1=aCallable$l,anObject$1=anObject$i,call$8=functionCall,toIntegerOrInfinity=toIntegerOrInfinity$6,$TypeError$1=TypeError,max=Math.max,SetRecord=function(e,t,r,n){this.set=e,this.size=t,this.has=r,this.keys=n};SetRecord.prototype={getIterator:function(){return anObject$1(call$8(this.keys,this.set))},includes:function(e){return call$8(this.has,this.set,e)}};var getSetRecord$7=function(e){anObject$1(e);var t=+e.size;if(t!=t)throw $TypeError$1("Invalid size");return new SetRecord(e,max(toIntegerOrInfinity(t),0),aCallable$1(e.has),aCallable$1(e.keys))},aSet$f=aSet$g,SetHelpers$4=setHelpers,clone$2=setClone,size$4=setSize,getSetRecord$6=getSetRecord$7,iterateSet$2=setIterate,iterateSimple$5=iterateSimple$8,has$4=SetHelpers$4.has,remove$2=SetHelpers$4.remove,setDifference=function(e){var t=aSet$f(this),r=getSetRecord$6(e),n=clone$2(t);return size$4(t)<=r.size?iterateSet$2(t,(function(e){r.includes(e)&&remove$2(n,e)})):iterateSimple$5(r.getIterator(),(function(e){has$4(t,e)&&remove$2(n,e)})),n},setMethodAcceptSetLike$7=function(){return!1},$$q=_export,difference2=setDifference,setMethodAcceptSetLike$6=setMethodAcceptSetLike$7;$$q({target:"Set",proto:!0,real:!0,forced:!setMethodAcceptSetLike$6()},{difference:difference2});var aSet$e=aSet$g,SetHelpers$3=setHelpers,size$3=setSize,getSetRecord$5=getSetRecord$7,iterateSet$1=setIterate,iterateSimple$4=iterateSimple$8,Set$3=SetHelpers$3.Set,add$5=SetHelpers$3.add,has$3=SetHelpers$3.has,setIntersection=function(e){var t=aSet$e(this),r=getSetRecord$5(e),n=new Set$3;return size$3(t)>r.size?iterateSimple$4(r.getIterator(),(function(e){has$3(t,e)&&add$5(n,e)})):iterateSet$1(t,(function(e){r.includes(e)&&add$5(n,e)})),n},$$p=_export,intersection2=setIntersection,setMethodAcceptSetLike$5=setMethodAcceptSetLike$7,INCORRECT=!setMethodAcceptSetLike$5();$$p({target:"Set",proto:!0,real:!0,forced:INCORRECT},{intersection:intersection2});var aSet$d=aSet$g,has$2=setHelpers.has,size$2=setSize,getSetRecord$4=getSetRecord$7,iterateSet=setIterate,iterateSimple$3=iterateSimple$8,iteratorClose$1=iteratorClose$4,setIsDisjointFrom=function(e){var t=aSet$d(this),r=getSetRecord$4(e);if(size$2(t)<=r.size)return!1!==iterateSet(t,(function(e){if(r.includes(e))return!1}),!0);var n=r.getIterator();return!1!==iterateSimple$3(n,(function(e){if(has$2(t,e))return iteratorClose$1(n,"normal",!1)}))},$$o=_export,isDisjointFrom2=setIsDisjointFrom,setMethodAcceptSetLike$4=setMethodAcceptSetLike$7;$$o({target:"Set",proto:!0,real:!0,forced:!setMethodAcceptSetLike$4()},{isDisjointFrom:isDisjointFrom2});var aSet$c=aSet$g,size$1=setSize,iterate$7=setIterate,getSetRecord$3=getSetRecord$7,setIsSubsetOf=function(e){var t=aSet$c(this),r=getSetRecord$3(e);return!(size$1(t)>r.size)&&!1!==iterate$7(t,(function(e){if(!r.includes(e))return!1}),!0)},$$n=_export,isSubsetOf2=setIsSubsetOf,setMethodAcceptSetLike$3=setMethodAcceptSetLike$7;$$n({target:"Set",proto:!0,real:!0,forced:!setMethodAcceptSetLike$3()},{isSubsetOf:isSubsetOf2});var aSet$b=aSet$g,has$1=setHelpers.has,size2=setSize,getSetRecord$2=getSetRecord$7,iterateSimple$2=iterateSimple$8,iteratorClose=iteratorClose$4,setIsSupersetOf=function(e){var t=aSet$b(this),r=getSetRecord$2(e);if(size2(t)<r.size)return!1;var n=r.getIterator();return!1!==iterateSimple$2(n,(function(e){if(!has$1(t,e))return iteratorClose(n,"normal",!1)}))},$$m=_export,isSupersetOf2=setIsSupersetOf,setMethodAcceptSetLike$2=setMethodAcceptSetLike$7;$$m({target:"Set",proto:!0,real:!0,forced:!setMethodAcceptSetLike$2()},{isSupersetOf:isSupersetOf2});var aSet$a=aSet$g,SetHelpers$2=setHelpers,clone$1=setClone,getSetRecord$1=getSetRecord$7,iterateSimple$1=iterateSimple$8,add$4=SetHelpers$2.add,has2=SetHelpers$2.has,remove$1=SetHelpers$2.remove,setSymmetricDifference=function(e){var t=aSet$a(this),r=getSetRecord$1(e).getIterator(),n=clone$1(t);return iterateSimple$1(r,(function(e){has2(t,e)?remove$1(n,e):add$4(n,e)})),n},$$l=_export,symmetricDifference2=setSymmetricDifference,setMethodAcceptSetLike$1=setMethodAcceptSetLike$7;$$l({target:"Set",proto:!0,real:!0,forced:!setMethodAcceptSetLike$1()},{symmetricDifference:symmetricDifference2});var aSet$9=aSet$g,add$3=setHelpers.add,clone=setClone,getSetRecord=getSetRecord$7,iterateSimple=iterateSimple$8,setUnion=function(e){var t=aSet$9(this),r=getSetRecord(e).getIterator(),n=clone(t);return iterateSimple(r,(function(e){add$3(n,e)})),n},$$k=_export,union2=setUnion,setMethodAcceptSetLike=setMethodAcceptSetLike$7;$$k({target:"Set",proto:!0,real:!0,forced:!setMethodAcceptSetLike()},{union:union2});var parent$d=set$4,set$3=parent$d,$$j=_export,from3=collectionFrom;$$j({target:"Set",stat:!0,forced:!0},{from:from3});var $$i=_export,of2=collectionOf;$$i({target:"Set",stat:!0,forced:!0},{of:of2});var $$h=_export,aSet$8=aSet$g,add$2=setHelpers.add;$$h({target:"Set",proto:!0,real:!0,forced:!0},{addAll:function(){for(var e=aSet$8(this),t=0,r=arguments.length;t<r;t++)add$2(e,arguments[t]);return e}});var $$g=_export,aSet$7=aSet$g,remove=setHelpers.remove;$$g({target:"Set",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=aSet$7(this),r=!0,n=0,o=arguments.length;n<o;n++)e=remove(t,arguments[n]),r=r&&e;return!!r}});var $$f=_export,bind$4=functionBindContext,aSet$6=aSet$g,iterate$6=setIterate;$$f({target:"Set",proto:!0,real:!0,forced:!0},{every:function(e){var t=aSet$6(this),r=bind$4(e,arguments.length>1?arguments[1]:void 0);return!1!==iterate$6(t,(function(e){if(!r(e,e,t))return!1}),!0)}});var classof$1=classof$e,hasOwn$2=hasOwnProperty_1,isNullOrUndefined=isNullOrUndefined$7,wellKnownSymbol=wellKnownSymbol$r,Iterators=iterators,ITERATOR=wellKnownSymbol("iterator"),$Object=Object,isIterable$1=function(e){if(isNullOrUndefined(e))return!1;var t=$Object(e);return void 0!==t[ITERATOR]||"@@iterator"in t||hasOwn$2(Iterators,classof$1(t))},getBuiltIn=getBuiltIn$j,isCallable=isCallable$r,isIterable=isIterable$1,isObject=isObject$m,Set$2=getBuiltIn("Set"),isSetLike=function(e){return isObject(e)&&"number"==typeof e.size&&isCallable(e.has)&&isCallable(e.keys)},toSetLike$7=function(e){return isSetLike(e)?e:isIterable(e)?new Set$2(e):e},$$e=_export,call$7=functionCall,toSetLike$6=toSetLike$7,$difference=setDifference;$$e({target:"Set",proto:!0,real:!0,forced:!0},{difference:function(e){return call$7($difference,this,toSetLike$6(e))}});var $$d=_export,bind$3=functionBindContext,aSet$5=aSet$g,SetHelpers$1=setHelpers,iterate$5=setIterate,Set$1=SetHelpers$1.Set,add$1=SetHelpers$1.add;$$d({target:"Set",proto:!0,real:!0,forced:!0},{filter:function(e){var t=aSet$5(this),r=bind$3(e,arguments.length>1?arguments[1]:void 0),n=new Set$1;return iterate$5(t,(function(e){r(e,e,t)&&add$1(n,e)})),n}});var $$c=_export,bind$2=functionBindContext,aSet$4=aSet$g,iterate$4=setIterate;$$c({target:"Set",proto:!0,real:!0,forced:!0},{find:function(e){var t=aSet$4(this),r=bind$2(e,arguments.length>1?arguments[1]:void 0),n=iterate$4(t,(function(e){if(r(e,e,t))return{value:e}}),!0);return n&&n.value}});var $$b=_export,call$6=functionCall,toSetLike$5=toSetLike$7,$intersection=setIntersection;$$b({target:"Set",proto:!0,real:!0,forced:!0},{intersection:function(e){return call$6($intersection,this,toSetLike$5(e))}});var $$a=_export,call$5=functionCall,toSetLike$4=toSetLike$7,$isDisjointFrom=setIsDisjointFrom;$$a({target:"Set",proto:!0,real:!0,forced:!0},{isDisjointFrom:function(e){return call$5($isDisjointFrom,this,toSetLike$4(e))}});var $$9=_export,call$4=functionCall,toSetLike$3=toSetLike$7,$isSubsetOf=setIsSubsetOf;$$9({target:"Set",proto:!0,real:!0,forced:!0},{isSubsetOf:function(e){return call$4($isSubsetOf,this,toSetLike$3(e))}});var $$8=_export,call$3=functionCall,toSetLike$2=toSetLike$7,$isSupersetOf=setIsSupersetOf;$$8({target:"Set",proto:!0,real:!0,forced:!0},{isSupersetOf:function(e){return call$3($isSupersetOf,this,toSetLike$2(e))}});var $$7=_export,uncurryThis$1=functionUncurryThis,aSet$3=aSet$g,iterate$3=setIterate,toString4=toString$g,arrayJoin=uncurryThis$1([].join),push=uncurryThis$1([].push);$$7({target:"Set",proto:!0,real:!0,forced:!0},{join:function(e){var t=aSet$3(this),r=void 0===e?",":toString4(e),n=[];return iterate$3(t,(function(e){push(n,e)})),arrayJoin(n,r)}});var $$6=_export,bind$1=functionBindContext,aSet$2=aSet$g,SetHelpers=setHelpers,iterate$2=setIterate,Set=SetHelpers.Set,add=SetHelpers.add;$$6({target:"Set",proto:!0,real:!0,forced:!0},{map:function(e){var t=aSet$2(this),r=bind$1(e,arguments.length>1?arguments[1]:void 0),n=new Set;return iterate$2(t,(function(e){add(n,r(e,e,t))})),n}});var $$5=_export,aCallable=aCallable$l,aSet$1=aSet$g,iterate$1=setIterate,$TypeError=TypeError;$$5({target:"Set",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=aSet$1(this),r=arguments.length<2,n=r?void 0:arguments[1];if(aCallable(e),iterate$1(t,(function(o){r?(r=!1,n=o):n=e(n,o,o,t)})),r)throw $TypeError("Reduce of empty set with no initial value");return n}});var $$4=_export,bind2=functionBindContext,aSet=aSet$g,iterate=setIterate;$$4({target:"Set",proto:!0,real:!0,forced:!0},{some:function(e){var t=aSet(this),r=bind2(e,arguments.length>1?arguments[1]:void 0);return!0===iterate(t,(function(e){if(r(e,e,t))return!0}),!0)}});var $$3=_export,call$2=functionCall,toSetLike$1=toSetLike$7,$symmetricDifference=setSymmetricDifference;$$3({target:"Set",proto:!0,real:!0,forced:!0},{symmetricDifference:function(e){return call$2($symmetricDifference,this,toSetLike$1(e))}});var $$2=_export,call$1=functionCall,toSetLike=toSetLike$7,$union=setUnion;$$2({target:"Set",proto:!0,real:!0,forced:!0},{union:function(e){return call$1($union,this,toSetLike(e))}});var parent$c=set$3,set$2=parent$c,set$1=set$2,set2=set$1,_Set=getDefaultExportFromCjs(set2),SeiService=function(){function e(t){var r=this;_classCallCheck$2(this,e),_defineProperty$1(this,"_seiSet",new _Set),this.emitter=t,t.on(EVENT.SEI,(function(e){e&&r._seiSet.add(e)}))}return _createClass$2(e,[{key:"throw",value:function(e,t){var r,n,o=this;if(null!=e&&this._seiSet.size){var i=e-.2,a=e+.2,s=[];_forEachInstanceProperty(r=this._seiSet).call(r,(function(e){e.time>=i&&e.time<=a&&s.push(e)})),_forEachInstanceProperty(s).call(s,(function(e){o._seiSet.delete(e),o.emitter.emit(EVENT.SEI_IN_TIME,e)})),t&&_forEachInstanceProperty(n=this._seiSet).call(n,(function(t){t.time<e-5&&o._seiSet.delete(t)}))}}},{key:"reset",value:function(){this._seiSet.clear()}}]),e}(),SKIP_SMALL_CHUNK=1e3,MAX_CHUNK_SAVE_SIZE=50,MAX_SEGMENT_SAVE_SIZE=3,LONGTIME_NO_RECEIVE=3e3,BandwidthService=function(){function e(t){_classCallCheck$2(this,e),_defineProperty$1(this,"_chunkSpeed",0),_defineProperty$1(this,"_chunkCache",[]),_defineProperty$1(this,"_speeds",[]),_defineProperty$1(this,"_totalSize",0),_defineProperty$1(this,"_totalCost",0),this._opts=t||{}}return _createClass$2(e,[{key:"addRecord",value:function(e,t){var r;e&&t&&(this._speeds.push(8e3*e/t),this._speeds=_sliceInstanceProperty(r=this._speeds).call(r,-MAX_SEGMENT_SAVE_SIZE))}},{key:"addChunkRecord",value:function(e,t){var r,n;if(e&&t&&!(e<((null===(r=this._opts)||void 0===r?void 0:r.skipChunkSize)||SKIP_SMALL_CHUNK))){this._totalSize+=e,this._totalCost+=t,this._chunkSpeed=8e3*e/t,this._chunkCache.push({size:e,duration:t,timestamp:performance.now()});var o,i=(null===(n=this._opts)||void 0===n?void 0:n.chunkCountForSpeed)||MAX_CHUNK_SAVE_SIZE;if(this._chunkCache.length>i)this._chunkCache=_sliceInstanceProperty(o=this._chunkCache).call(o,-i)}}},{key:"getAvgSpeed",value:function(){var e,t,r,n;if(!this._chunkCache.length&&!this._speeds.length)return 0;if(this._speeds.length)return _reduceInstanceProperty(n=this._speeds).call(n,(function(e,t){return e+t}))/this._speeds.length;var o=this._chunkCache[this._chunkCache.length-1],i=performance.now()-o.timestamp;return i>((null===(r=this._opts)||void 0===r?void 0:r.longtimeNoReceived)||LONGTIME_NO_RECEIVE)&&this._chunkCache.push({size:0,duration:i,timestamp:performance.now()}),8e3*_reduceInstanceProperty(e=this._chunkCache).call(e,(function(e,t){return e+t.size}),0)/_reduceInstanceProperty(t=this._chunkCache).call(t,(function(e,t){return e+t.duration}),0)}},{key:"getLatestSpeed",value:function(){return this._chunkCache.length||this._speeds.length?this._speeds.length?this._speeds[this._speeds.length-1]:this._chunkSpeed:0}},{key:"getTotalSize",value:function(){return this._totalSize}},{key:"getTotalCost",value:function(){return this._totalCost}},{key:"reset",value:function(){this._chunkCache=[],this._speeds=[],this._totalSize=0,this._totalCost=0}}]),e}(),Stats=function(){function e(t){_classCallCheck$2(this,e),_defineProperty$1(this,"encodeType",""),_defineProperty$1(this,"audioCodec",""),_defineProperty$1(this,"videoCodec",""),_defineProperty$1(this,"domain",""),_defineProperty$1(this,"fps",0),_defineProperty$1(this,"bitrate",0),_defineProperty$1(this,"width",0),_defineProperty$1(this,"height",0),_defineProperty$1(this,"samplerate",0),_defineProperty$1(this,"channelCount",0),_defineProperty$1(this,"gop",0),_defineProperty$1(this,"_bitsAccumulateSize",0),_defineProperty$1(this,"_bitsAccumulateDuration",0),_defineProperty$1(this,"_startGopId",-1),this._timescale=t}return _createClass$2(e,[{key:"getStats",value:function(){return{encodeType:this.encodeType,audioCodec:this.audioCodec,videoCodec:this.videoCodec,domain:this.domain,fps:this.fps,bitrate:this.bitrate,width:this.width,height:this.height,samplerate:this.samplerate,channelCount:this.channelCount,gop:this.gop}}},{key:"setEncodeType",value:function(e){this.encodeType=e}},{key:"setFpsFromScriptData",value:function(e){var t,r=e.data,n=null==r||null===(t=r.onMetaData)||void 0===t?void 0:t.framerate;n&&n>0&&n<100&&(this.fps=n)}},{key:"setVideoMeta",value:function(e){if(this.width=e.width,this.height=e.height,this.videoCodec=e.codec,this.encodeType=e.codecType,e.fpsNum&&e.fpsDen){var t=e.fpsNum/e.fpsDen;t>0&&t<100&&(this.fps=t)}}},{key:"setAudioMeta",value:function(e){this.audioCodec=e.codec,this.samplerate=e.sampleRate,this.channelCount=e.channelCount}},{key:"setDomain",value:function(e){var t;this.domain=_sliceInstanceProperty(t=e.split("/")).call(t,2,3)[0]}},{key:"updateBitrate",value:function(e){var t=this;if((!this.fps||this.fps>=100)&&e.length){var r=_reduceInstanceProperty(e).call(e,(function(e,t){return e+t.duration}),0)/e.length;this.fps=Math.round(this._timescale/r)}_forEachInstanceProperty(e).call(e,(function(e){var r;-1===t._startGopId&&(t._startGopId=e.gopId),e.gopId===t._startGopId&&t.gop++,t._bitsAccumulateDuration+=e.duration/(t._timescale/1e3),t._bitsAccumulateSize+=_reduceInstanceProperty(r=e.units).call(r,(function(e,t){return e+t.length}),0),t._bitsAccumulateDuration>=1e3&&(t.bitrate=8*t._bitsAccumulateSize,t._bitsAccumulateDuration=0,t._bitsAccumulateSize=0)}))}}]),e}(),MediaStatsService=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;_classCallCheck$2(this,e),_defineProperty$1(this,"_core",null),_defineProperty$1(this,"_samples",[]),this._core=t,this._timescale=r,this._stats=new Stats(r),this._bindEvents()}return _createClass$2(e,[{key:"getStats",value:function(){var e,t,r,n,o,i,a,s,c,l,u,p=(null===(e=this._core)||void 0===e?void 0:e.media)||{},$=p.currentTime,f=void 0===$?0:$,d=p.decodeFps,y=void 0===d?0:d;return _objectSpread2(_objectSpread2({},this._stats.getStats()),{},{downloadSpeed:(null===(t=this._core)||void 0===t||null===(r=t.speedInfo)||void 0===r?void 0:r.call(t).speed)||0,avgSpeed:(null===(n=this._core)||void 0===n||null===(o=n.speedInfo)||void 0===o?void 0:o.call(n).avgSpeed)||0,totalReceivedByte:(null===(i=this._core)||void 0===i||null===(a=i.speedInfo)||void 0===a?void 0:a.call(i).totalSize)||0,totalReceivedCost:(null===(s=this._core)||void 0===s||null===(c=s.speedInfo)||void 0===c?void 0:c.call(s).totalCost)||0,currentTime:f,bufferEnd:(null===(l=this._core)||void 0===l||null===(u=l.bufferInfo())||void 0===u?void 0:u.remaining)||0,decodeFps:y})}},{key:"_bindEvents",value:function(){var e=this;this._core.on(EVENT.DEMUXED_TRACK,(function(t){var r=t.videoTrack;return e._stats.updateBitrate(r.samples)})),this._core.on(EVENT.FLV_SCRIPT_DATA,(function(t){e._stats.setFpsFromScriptData(t)})),this._core.on(EVENT.METADATA_PARSED,(function(t){"video"===t.type?e._stats.setVideoMeta(t.track):e._stats.setAudioMeta(t.track)})),this._core.on(EVENT.TTFB,(function(t){e._stats.setDomain(t.responseUrl)}))}},{key:"reset",value:function(){this._samples=[],this._stats=new Stats(this._timescale)}}]),e}();function _iterableToArrayLimit(e,t){var r=null==e?null:void 0!==_Symbol&&_getIteratorMethod(e)||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],c=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}function _classCallCheck$1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),_Object$defineProperty(e,_toPropertyKey$1(n.key),n)}}function _createClass$1(e,t,r){return t&&_defineProperties$1(e.prototype,t),r&&_defineProperties$1(e,r),_Object$defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,t,r){return(t=_toPropertyKey$1(t))in e?_Object$defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _inherits$1(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=_Object$create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),_Object$defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf$1(e,t)}function _getPrototypeOf$1(e){var t;return(_getPrototypeOf$1=_Object$setPrototypeOf?_bindInstanceProperty(t=_Object$getPrototypeOf).call(t):function(e){return e.__proto__||_Object$getPrototypeOf(e)})(e)}function _setPrototypeOf$1(e,t){var r;return(_setPrototypeOf$1=_Object$setPrototypeOf?_bindInstanceProperty(r=_Object$setPrototypeOf).call(r):function(e,t){return e.__proto__=t,e})(e,t)}function _isNativeReflectConstruct$1(){if("undefined"==typeof Reflect||!_Reflect$construct)return!1;if(_Reflect$construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_Reflect$construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _assertThisInitialized$1(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn$1(e,t){if(t&&("object"===_typeof$3(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$1(e)}function _createSuper(e){var t=_isNativeReflectConstruct$1();return function(){var r,n=_getPrototypeOf$1(e);if(t){var o=_getPrototypeOf$1(this).constructor;r=_Reflect$construct(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn$1(this,r)}}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(_Array$isArray(e))return _arrayLikeToArray(e)}function _arrayWithHoles(e){if(_Array$isArray(e))return e}function _iterableToArray(e){if(void 0!==_Symbol&&null!=_getIteratorMethod(e)||null!=e["@@iterator"])return _Array$from(e)}function _unsupportedIterableToArray(e,t){var r;if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=_sliceInstanceProperty(r=Object.prototype.toString.call(e)).call(r,8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?_Array$from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toPrimitive$1(e,t){if("object"!==_typeof$3(e)||null===e)return e;var r=e[_Symbol$toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof$3(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey$1(e){var t=_toPrimitive$1(e,"string");return"symbol"===_typeof$3(t)?t:String(t)}var TrackType={VIDEO:"video",AUDIO:"audio",METADATA:"metadata"},VideoCodecType={AV1:"av1",AVC:"avc",HEVC:"hevc"},AudioCodecType={AAC:"aac",G711PCMA:"g7110a",G711PCMU:"g7110m",OPUS:"opus",MP3:"mp3"},WarningType={LARGE_AV_SHIFT:"LARGE_AV_SHIFT",LARGE_VIDEO_GAP:"LARGE_VIDEO_GAP",LARGE_VIDEO_GAP_BETWEEN_CHUNK:"LARGE_VIDEO_GAP_BETWEEN_CHUNK",LARGE_AUDIO_GAP:"LARGE_AUDIO_GAP",AUDIO_FILLED:"AUDIO_FILLED",AUDIO_DROPPED:"AUDIO_DROPPED"},VideoTrack=function(){function e(){_classCallCheck$1(this,e),_defineProperty(this,"id",1),_defineProperty(this,"type",TrackType.VIDEO),_defineProperty(this,"codecType",VideoCodecType.AVC),_defineProperty(this,"pid",-1),_defineProperty(this,"hvcC",void 0),_defineProperty(this,"codec",""),_defineProperty(this,"timescale",0),_defineProperty(this,"formatTimescale",0),_defineProperty(this,"sequenceNumber",0),_defineProperty(this,"baseMediaDecodeTime",0),_defineProperty(this,"baseDts",0),_defineProperty(this,"duration",0),_defineProperty(this,"warnings",[]),_defineProperty(this,"samples",[]),_defineProperty(this,"pps",[]),_defineProperty(this,"sps",[]),_defineProperty(this,"vps",[]),_defineProperty(this,"fpsNum",0),_defineProperty(this,"fpsDen",0),_defineProperty(this,"sarRatio",[]),_defineProperty(this,"width",0),_defineProperty(this,"height",0),_defineProperty(this,"nalUnitSize",4),_defineProperty(this,"present",!1),_defineProperty(this,"isVideoEncryption",!1),_defineProperty(this,"isAudioEncryption",!1),_defineProperty(this,"isVideo",!0),_defineProperty(this,"lastKeyFrameDts",0),_defineProperty(this,"kid",null),_defineProperty(this,"pssh",null),_defineProperty(this,"ext",void 0)}return _createClass$1(e,[{key:"reset",value:function(){this.sequenceNumber=this.width=this.height=this.fpsDen=this.fpsNum=this.duration=this.baseMediaDecodeTime=this.timescale=0,this.codec="",this.present=!1,this.pid=-1,this.pps=[],this.sps=[],this.vps=[],this.sarRatio=[],this.samples=[],this.warnings=[],this.hvcC=null}},{key:"firstDts",get:function(){return this.samples.length?this.samples[0].dts:null}},{key:"firstPts",get:function(){return this.samples.length?this.samples[0].pts:null}},{key:"samplesDuration",get:function(){if(this.samples.length>0){var e=this.samples[0],t=this.samples[this.samples.length-1];return t.dts-e.dts+t.duration}return 0}},{key:"exist",value:function(){return!!/av01/.test(this.codec)||!!(this.pps.length&&this.sps.length&&this.codec)}},{key:"hasSample",value:function(){return!!this.samples.length}},{key:"isEncryption",get:function(){return this.isVideoEncryption}}]),e}(),AudioTrack=function(){function e(){_classCallCheck$1(this,e),_defineProperty(this,"id",2),_defineProperty(this,"type",TrackType.AUDIO),_defineProperty(this,"codecType",AudioCodecType.AAC),_defineProperty(this,"pid",-1),_defineProperty(this,"codec",""),_defineProperty(this,"container",""),_defineProperty(this,"sequenceNumber",0),_defineProperty(this,"sampleDuration",0),_defineProperty(this,"timescale",0),_defineProperty(this,"formatTimescale",0),_defineProperty(this,"baseMediaDecodeTime",0),_defineProperty(this,"duration",0),_defineProperty(this,"warnings",[]),_defineProperty(this,"samples",[]),_defineProperty(this,"baseDts",0),_defineProperty(this,"sampleSize",16),_defineProperty(this,"sampleRate",0),_defineProperty(this,"channelCount",0),_defineProperty(this,"objectType",0),_defineProperty(this,"sampleRateIndex",0),_defineProperty(this,"config",[]),_defineProperty(this,"present",!1),_defineProperty(this,"isVideoEncryption",!1),_defineProperty(this,"isAudioEncryption",!1),_defineProperty(this,"kid",null),_defineProperty(this,"ext",void 0)}return _createClass$1(e,[{key:"reset",value:function(){this.sequenceNumber=0,this.timescale=0,this.sampleDuration=0,this.sampleRate=0,this.channelCount=0,this.baseMediaDecodeTime=0,this.present=!1,this.pid=-1,this.codec="",this.samples=[],this.config=[],this.warnings=[]}},{key:"exist",value:function(){return!(!this.sampleRate||!this.channelCount||!this.codec&&!this.container||this.codecType!==AudioCodecType.AAC&&this.codecType!==AudioCodecType.G711PCMA&&this.codecType!==AudioCodecType.G711PCMU&&this.codecType!==AudioCodecType.OPUS&&this.codecType!==AudioCodecType.MP3)}},{key:"hasSample",value:function(){return!!this.samples.length}},{key:"isEncryption",get:function(){return this.isAudioEncryption}},{key:"firstDts",get:function(){return this.samples.length?this.samples[0].dts:null}},{key:"firstPts",get:function(){return this.samples.length?this.samples[0].pts:null}},{key:"samplesDuration",get:function(){if(this.samples.length>0){var e=this.samples[0],t=this.samples[this.samples.length-1];return t.dts-e.dts+t.duration}return 0}}]),e}(),VideoSample=function(){function e(t,r,n){_classCallCheck$1(this,e),_defineProperty(this,"flag",{}),_defineProperty(this,"keyframe",!1),_defineProperty(this,"gopId",0),_defineProperty(this,"duration",0),_defineProperty(this,"size",0),_defineProperty(this,"units",[]),_defineProperty(this,"chromaFormat",420),this.originPts=this.pts=t,this.originDts=this.dts=r,n&&(this.units=n)}return _createClass$1(e,[{key:"cts",get:function(){return this.pts-this.dts}},{key:"setToKeyframe",value:function(){this.keyframe=!0,this.flag.dependsOn=2,this.flag.isNonSyncSample=0}}]),e}(),AudioSample=_createClass$1((function e(t,r,n,o){_classCallCheck$1(this,e),_defineProperty(this,"duration",1024),_defineProperty(this,"flag",{dependsOn:2,isNonSyncSample:0}),_defineProperty(this,"keyframe",!0),this.originPts=this.pts=this.dts=t,this.data=r,this.size=r.byteLength,this.sampleOffset=o,n&&(this.duration=n)})),Sample=_createClass$1((function e(t,r){_classCallCheck$1(this,e),_defineProperty(this,"time",0),this.data=t,this.originPts=this.pts=r})),FlvScriptSample=function(e){_inherits$1(r,Sample);var t=_createSuper(r);function r(){return _classCallCheck$1(this,r),t.apply(this,arguments)}return _createClass$1(r)}(),SeiSample=function(e){_inherits$1(r,Sample);var t=_createSuper(r);function r(){return _classCallCheck$1(this,r),t.apply(this,arguments)}return _createClass$1(r)}(),MetadataTrack=function(){function e(){_classCallCheck$1(this,e),_defineProperty(this,"id",3),_defineProperty(this,"type",TrackType.METADATA),_defineProperty(this,"timescale",0),_defineProperty(this,"flvScriptSamples",[]),_defineProperty(this,"seiSamples",[])}return _createClass$1(e,[{key:"exist",value:function(){return!(!this.flvScriptSamples.length&&!this.seiSamples.length||!this.timescale)}},{key:"reset",value:function(){this.timescale=0,this.flvScriptSamples=[],this.seiSamples=[]}},{key:"hasSample",value:function(){return!(!this.flvScriptSamples.length&&!this.seiSamples.length)}}]),e}(),global$1=global$s,globalIsFinite=global$1.isFinite,numberIsFinite$1=Number.isFinite||function(e){return"number"==typeof e&&globalIsFinite(e)},$$1=_export,numberIsFinite=numberIsFinite$1;$$1({target:"Number",stat:!0},{isFinite:numberIsFinite});var path$1=path$w,_isFinite$5=path$1.Number.isFinite,parent$b=_isFinite$5,_isFinite$4=parent$b,parent$a=_isFinite$4,_isFinite$3=parent$a,parent$9=_isFinite$3,_isFinite$2=parent$9,_isFinite$1=_isFinite$2,_isFinite=_isFinite$1,_Number$isFinite=getDefaultExportFromCjs(_isFinite),Logger$1=function(){function e(t){_classCallCheck$1(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]")}return _createClass$1(e,[{key:"warn",value:function(){var t,r;if(!e.disabled){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];(r=console).warn.apply(r,_concatInstanceProperty(t=[this._prefix]).call(t,o))}}}],[{key:"enable",value:function(){e.disabled=!1}},{key:"disable",value:function(){e.disabled=!0}}]),e}();_defineProperty(Logger$1,"disabled",!0);var isBrowser="undefined"!=typeof window,ua=isBrowser&&navigator.userAgent.toLocaleLowerCase(),isSafari=isBrowser&&/^((?!chrome|android).)*safari/.test(ua),isFirefox=isBrowser&&_includesInstanceProperty(ua).call(ua,"firefox"),isAndroid=isBrowser&&_includesInstanceProperty(ua).call(ua,"android"),AAC=function(){function e(){_classCallCheck$1(this,e)}return _createClass$1(e,null,[{key:"getRateIndexByRate",value:function(t){var r;return _indexOfInstanceProperty(r=e.FREQ).call(r,t)}},{key:"parseADTS",value:function(t,r){for(var n=t.length,o=0;o+2<n&&(255!==t[o]||240!=(246&t[o+1]));)o++;if(!(o>=n)){var i=o,a=[],s=(60&t[o+2])>>>2,c=e.FREQ[s];if(!c)throw new Error("Invalid sampling index: ".concat(s));for(var l,u,p=1+((192&t[o+2])>>>6),$=(1&t[o+2])<<2|(192&t[o+3])>>>6,f=e._getConfig(s,$,p),d=f.config,y=f.codec,h=0,_=e.getFrameDuration(c);o+7<n;)if(255===t[o]&&240==(246&t[o+1])){if(!(u=(3&t[o+3])<<11|t[o+4]<<3|(224&t[o+5])>>5)||n-o<u)break;l=2*(1&~t[o+1]),a.push({pts:r+h*_,data:t.subarray(o+7+l,o+u)}),h++,o+=u}else o++;return{skip:i,remaining:o>=n?void 0:t.subarray(o),frames:a,samplingFrequencyIndex:s,sampleRate:c,objectType:p,channelCount:$,codec:y,config:d,originCodec:"mp4a.40.".concat(p)}}}},{key:"parseAudioSpecificConfig",value:function(t){if(t.length){var r=t[0]>>>3,n=(7&t[0])<<1|t[1]>>>7,o=(120&t[1])>>>3,i=e.FREQ[n];if(i){var a=e._getConfig(n,o,r);return{samplingFrequencyIndex:n,sampleRate:i,objectType:r,channelCount:o,config:a.config,codec:a.codec,originCodec:"mp4a.40.".concat(r)}}}}},{key:"getFrameDuration",value:function(e){return 1024*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4)/e}},{key:"_getConfig",value:function(e,t,r){var n,o,i=[];return isFirefox?e>=6?(n=5,o=e-3):(n=2,o=e):isAndroid?(n=2,o=e):(n=5,o=e,e>=6?o=e-3:1===t&&(n=2,o=e)),i[0]=n<<3,i[0]|=(14&e)>>1,i[1]=(1&e)<<7,i[1]|=t<<3,5===n&&(i[1]|=(14&o)>>1,i[2]=(1&o)<<7,i[2]|=8,i[3]=0),{config:i,codec:"mp4a.40.".concat(n)}}},{key:"getSilentFrame",value:function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}}}]),e}();_defineProperty(AAC,"FREQ",[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350]);var $=_export,uncurryThis=functionUncurryThis,toAbsoluteIndex=toAbsoluteIndex$5,$RangeError=RangeError,fromCharCode=String.fromCharCode,$fromCodePoint=String.fromCodePoint,join2=uncurryThis([].join),INCORRECT_LENGTH=!!$fromCodePoint&&1!=$fromCodePoint.length;$({target:"String",stat:!0,arity:1,forced:INCORRECT_LENGTH},{fromCodePoint:function(e){for(var t,r=[],n=arguments.length,o=0;n>o;){if(t=+arguments[o++],toAbsoluteIndex(t,1114111)!==t)throw $RangeError(t+" is not a valid code point");r[o]=t<65536?fromCharCode(t):fromCharCode(55296+((t-=65536)>>10),t%1024+56320)}return join2(r,"")}});var path=path$w,fromCodePoint$5=path.String.fromCodePoint,parent$8=fromCodePoint$5,fromCodePoint$4=parent$8,parent$7=fromCodePoint$4,fromCodePoint$3=parent$7,parent$6=fromCodePoint$3,fromCodePoint$2=parent$6,fromCodePoint$1=fromCodePoint$2,fromCodePoint2=fromCodePoint$1,_String$fromCodePoint=getDefaultExportFromCjs(fromCodePoint2),OPUS=function(){function e(){_classCallCheck$1(this,e)}return _createClass$1(e,null,[{key:"getFrameDuration",value:function(e){return 20}},{key:"parseHeaderPackets",value:function(e){if(e.length){for(var t=new DataView(e.buffer,e.byteOffset,e.byteLength),r="",n=0;n<8;n++)r+=_String$fromCodePoint(e[n]);if("OpusHead"!==r)throw new Error("Invalid Opus MagicSignature");var o=e[9];console.log("Pre-skip",e[10],e[11]);var i=t.getUint32(12,!0),a=t.getInt16(16,!0);if(i){return{outputGain:a,sampleRate:i,channelCount:o,config:new Uint8Array(e.buffer,e.byteOffset+8,e.byteLength-8),codec:"opus",originCodec:"opus"}}}}}]),e}(),LARGE_AV_FIRST_FRAME_GAP=500,AUDIO_GAP_OVERLAP_THRESHOLD_COUNT=3,MAX_SILENT_FRAME_DURATION=1e3,AUDIO_EXCEPTION_LOG_EMIT_DURATION=5e3,MAX_VIDEO_FRAME_DURATION=1e3,MAX_DTS_DELTA_WITH_NEXT_CHUNK=200,VIDEO_EXCEPTION_LOG_EMIT_DURATION=5e3,TRACK_BROKEN_CHECK_TIME=5,FlvFixer=function(){function e(t,r,n){_classCallCheck$1(this,e),this.videoTrack=t,this.audioTrack=r,this.metadataTrack=n,this._baseDts=-1,this._baseDtsInited=!1,this._audioNextPts=void 0,this._videoNextDts=void 0,this._audioTimestampBreak=0,this._videoTimestampBreak=0,this._lastVideoDuration=0,this._keyFrameInNextChunk=!1,this._lastAudioExceptionGapDot=-1/0,this._lastAudioExceptionOverlapDot=-1/0,this._lastAudioExceptionLargeGapDot=-1/0,this._lastVideoExceptionLargeGapDot=-1/0,this._lastVideoExceptionChunkFirstDtsDot=-1/0}return _createClass$1(e,[{key:"fix",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];t=Math.round(1e3*t);var o=this.videoTrack,i=this.audioTrack;if(!r&&n||(this._videoLastSample=null,this._audioNextPts=void 0,this._videoNextDts=void 0,this._audioTimestampBreak=0,this._videoTimestampBreak=0,this._lastAudioExceptionGapDot=-1/0,this._lastAudioExceptionOverlapDot=-1/0,this._lastAudioExceptionLargeGapDot=-1/0,this._lastVideoExceptionLargeGapDot=-1/0,this._lastVideoExceptionChunkFirstDtsDot=-1/0),r&&!n&&(this._baseDtsInited=!1),this._baseDtsInited||this._calculateBaseDts(i,o),!n&&t&&(this._audioNextPts=this._videoNextDts=t),this._baseDtsInited&&(this._videoTimestampBreak||!this.videoTrack.exist())&&(this._audioTimestampBreak||!this.audioTrack.exist())&&this._resetBaseDtsWhenStreamBreaked(),this._fixAudio(i),this._keyFrameInNextChunk=!1,this._fixVideo(o),this.metadataTrack.exist()){var a,s,c=this.metadataTrack.timescale;_forEachInstanceProperty(a=this.metadataTrack.seiSamples).call(a,(function(t){t.pts=t.originPts-e._baseDts,t.time=Math.max(0,t.pts)/c})),_forEachInstanceProperty(s=this.metadataTrack.flvScriptSamples).call(s,(function(t){t.pts=t.originPts-e._baseDts,t.time=Math.max(0,t.pts)/c}))}o.samples.length&&(o.baseMediaDecodeTime=o.samples[0].dts),i.samples.length&&(i.baseMediaDecodeTime=i.samples[0].pts*i.timescale/1e3)}},{key:"_fixVideo",value:function(e){var t=this,r=e.samples;if(r.length){var n;if(_forEachInstanceProperty(r).call(r,(function(e){e.dts-=t._baseDts,e.pts-=t._baseDts,e.keyframe&&(t._keyFrameInNextChunk=!0)})),e.fpsNum&&e.fpsDen)n=e.timescale*(e.fpsDen/e.fpsNum);else if(e.length>1){var o=e.samples[0],i=e.samples[r.length-1];n=Math.floor((i.dts-o.dts)/(r.length-1))}else n=this._lastVideoDuration||40;var a=r.pop();if(this._videoLastSample&&r.unshift(this._videoLastSample),this._videoLastSample=a,r.length){if(void 0===this._videoNextDts){var s=r[0];this._videoNextDts=s.dts}var c=r.length,l=0,u=r[0],p=this._videoNextDts-u.dts;if(Math.abs(p)>MAX_DTS_DELTA_WITH_NEXT_CHUNK){var $;if(Math.abs(u.dts-this._lastVideoExceptionChunkFirstDtsDot)>VIDEO_EXCEPTION_LOG_EMIT_DURATION)this._lastVideoExceptionChunkFirstDtsDot=u.dts,e.warnings.push({type:WarningType.LARGE_VIDEO_GAP_BETWEEN_CHUNK,nextDts:this._videoNextDts,firstSampleDts:u.dts,nextSampleDts:null===($=r[1])||void 0===$?void 0:$.dts,sampleDuration:p});this._videoTimestampBreak>=TRACK_BROKEN_CHECK_TIME?(this._videoNextDts=u.dts,this._videoTimestampBreak=0):(u.dts+=p,u.pts+=p,this.audioTrack.exist()||(this._videoTimestampBreak=1))}for(var f=0;f<c;f++){var d=r[f].dts,y=r[f+1];((l=f<c-1?y.dts-d:a?a.dts-d:n)>MAX_VIDEO_FRAME_DURATION||l<0)&&(this._videoTimestampBreak++,Math.abs(d-this._lastVideoExceptionLargeGapDot)>VIDEO_EXCEPTION_LOG_EMIT_DURATION&&(this._lastVideoExceptionLargeGapDot=d,e.warnings.push({type:WarningType.LARGE_VIDEO_GAP,time:d/e.timescale,dts:d,originDts:r[f].originDts,nextDts:this._videoNextDts,sampleDuration:l,refSampleDuration:n})),l=n),r[f].duration=l,this._videoNextDts+=l,this._lastVideoDuration=l}}}}},{key:"_fixAudio",value:function(e){var t=this,r=e.samples;r.length&&(_forEachInstanceProperty(r).call(r,(function(e){e.dts=e.pts-=t._baseDts})),this._doFixAudioInternal(e,r,1e3))}},{key:"_calculateBaseDts",value:function(e,t){var r=e.samples,n=t.samples;if(!r.length&&!n.length)return!1;var o=1/0,i=1/0;r.length&&(e.baseDts=o=r[0].pts),n.length&&(t.baseDts=i=n[0].dts),this._baseDts=Math.min(o,i);var a=i-o;return _Number$isFinite(a)&&Math.abs(a)>LARGE_AV_FIRST_FRAME_GAP&&t.warnings.push({type:WarningType.LARGE_AV_SHIFT,videoBaseDts:i,audioBasePts:o,baseDts:this._baseDts,delta:a}),this._baseDtsInited=!0,!0}},{key:"_resetBaseDtsWhenStreamBreaked",value:function(){this._calculateBaseDts(this.audioTrack,this.videoTrack)&&(this.audioTrack.exist()?this.videoTrack.exist()?this._baseDts-=Math.min(this._audioNextPts,this._videoNextDts):this._baseDts-=this._audioNextPts:this._baseDts-=this._videoNextDts,this._videoTimestampBreak=0,this._audioTimestampBreak=0)}},{key:"_doFixAudioInternal",value:function(e,t,r){if(!e.sampleDuration)switch(e.codecType){case AudioCodecType.AAC:e.sampleDuration=AAC.getFrameDuration(e.timescale,r);break;case AudioCodecType.OPUS:e.sampleDuration=OPUS.getFrameDuration(e.samples,r);break;case AudioCodecType.G711PCMA:case AudioCodecType.G711PCMU:e.sampleDuration=this._getG711Duration(e);break;default:console.error("can't fix audio codecType:",e.codecType)}var n=e.sampleDuration,o=e.codecType===AudioCodecType.OPUS?20:e.codecType===AudioCodecType.AAC?1024:n*e.timescale/1e3;if(void 0===this._audioNextPts){var i=t[0];this._audioNextPts=i.pts}for(var a=0;a<t.length;a++){var s=this._audioNextPts,c=t[a],l=c.pts-s;if(0===a&&this._audioTimestampBreak>=TRACK_BROKEN_CHECK_TIME&&this._keyFrameInNextChunk&&(s=this._audioNextPts=c.dts,l=0,this._audioTimestampBreak=0),!this._audioTimestampBreak&&l>=AUDIO_GAP_OVERLAP_THRESHOLD_COUNT*n&&l<=MAX_SILENT_FRAME_DURATION&&!isSafari){var u=this._getSilentFrame(e)||t[0].data.subarray(),p=Math.floor(l/n);Math.abs(c.pts-this._lastAudioExceptionGapDot)>AUDIO_EXCEPTION_LOG_EMIT_DURATION&&(this._lastAudioExceptionGapDot=c.pts,e.warnings.push({type:WarningType.AUDIO_FILLED,pts:c.pts,originPts:c.originPts,count:p,nextPts:s,refSampleDuration:n}));for(var $=0;$<p;$++){var f=new AudioSample(Math.floor(this._audioNextPts+n)-Math.floor(this._audioNextPts),u,o);f.originPts=Math.floor(this._baseDts+s),_spliceInstanceProperty(t).call(t,a,0,f),this._audioNextPts+=n,a++}a--}else if(l<=-AUDIO_GAP_OVERLAP_THRESHOLD_COUNT*n&&l>=-1*MAX_SILENT_FRAME_DURATION)Math.abs(c.pts-this._lastAudioExceptionOverlapDot)>AUDIO_EXCEPTION_LOG_EMIT_DURATION&&(this._lastAudioExceptionOverlapDot=c.pts,e.warnings.push({type:WarningType.AUDIO_DROPPED,pts:c.pts,originPts:c.originPts,nextPts:s,refSampleDuration:n})),_spliceInstanceProperty(t).call(t,a,1),a--;else{if(Math.abs(l)>MAX_SILENT_FRAME_DURATION&&(this._audioTimestampBreak++,Math.abs(c.pts-this._lastAudioExceptionLargeGapDot)>AUDIO_EXCEPTION_LOG_EMIT_DURATION&&(this._lastAudioExceptionLargeGapDot=c.pts,e.warnings.push({type:WarningType.LARGE_AUDIO_GAP,time:c.pts/1e3,pts:c.pts,originPts:c.originPts,nextPts:s,sampleDuration:l,refSampleDuration:n}))),e.codecType===AudioCodecType.OPUS){var d=t[t.length-1];d&&(d.duration=c.pts-d.pts)}else c.dts=c.pts=s,c.duration=o;this._audioNextPts+=n}}}},{key:"_getG711Duration",value:function(e){var t=e.sampleSize,r=e.channelCount,n=e.sampleRate,o=e.samples[0];if(o)return 2*o.data.byteLength/r/(t/8)/n*1e3}},{key:"_getSilentFrame",value:function(e){return e.codecType===AudioCodecType.AAC?AAC.getSilentFrame(e.codec,e.channelCount):new Uint8Array(8*e.sampleDuration*e.channelCount)}}]),e}();function concatUint8Array(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];t=_filterInstanceProperty(t).call(t,Boolean);var n=new Uint8Array(_reduceInstanceProperty(t).call(t,(function(e,t){return e+t.byteLength}),0)),o=0;return _forEachInstanceProperty(t).call(t,(function(e){n.set(e,o),o+=e.byteLength})),n}function readBig32(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 getAvcCodec(e){for(var t,r="avc1.",n=0;n<3;n++)(t=e[n].toString(16)).length<2&&(t="0".concat(t)),r+=t;return r}function parse2(e){if(!_Array$isArray(e)){for(var t=[],r="",n=0;n<e.length;n++)n%2&&(r=e[n-1]+e[n],t.push(_parseInt$1(r,16)),r="");return t}return _mapInstanceProperty(e).call(e,(function(e){return _parseInt$1(e,16)}))}var NALu=function(){function e(){_classCallCheck$1(this,e)}return _createClass$1(e,null,[{key:"parseAnnexB",value:function(e){var t=e.byteLength-1,r=0;do{if(0!==e[t])break;r++,t--}while(t>0);r>=3&&(e=e.subarray(0,t+1));for(var n=e.length,o=2,i=0;null!==e[o]&&void 0!==e[o]&&1!==e[o];)o++;if((i=++o+2)>=n)return[];for(var a=[];i<n;)switch(e[i]){case 0:if(0!==e[i-1]){i+=2;break}if(0!==e[i-2]){i++;break}if(i<n-1&&1!==e[i+1]){i++;break}o!==i-2&&a.push(e.subarray(o,i-2));do{i++}while(1!==e[i]&&i<n);i=(o=i+1)+2;break;case 1:if(0!==e[i-1]||0!==e[i-2]){i+=3;break}o!==i-2&&a.push(e.subarray(o,i-2)),i=(o=i+1)+2;break;default:i+=3}return o<n&&a.push(e.subarray(o)),a}},{key:"parseAvcC",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;if(!(e.length<4)){for(var r,n=e.length,o=[],i=0;i+t<n;)if(r=readBig32(e,i),3===t&&(r>>>=8),i+=t,r){if(i+r>n)break;o.push(e.subarray(i,i+r)),i+=r}return o}}},{key:"parseSEI",value:function(e,t){for(var r=e.length,n=t?2:1,o=0,i=0,a="";255===e[n];)o+=255,n++;for(o+=e[n++];255===e[n];)i+=255,n++;if(i+=e[n++],5===o&&r>n+16)for(var s=0;s<16;s++)a+=e[n].toString(16),n++;return{payload:e.subarray(n,n+i),type:o,size:i,uuid:a}}},{key:"removeEPB",value:function(e){for(var t=e.byteLength,r=[],n=1;n<t-2;)0===e[n]&&0===e[n+1]&&3===e[n+2]?(r.push(n+2),n+=2):n++;if(!r.length)return e;var o=t-r.length,i=new Uint8Array(o),a=0;for(n=0;n<o;a++,n++)a===r[0]&&(a++,r.shift()),i[n]=e[a];return i}}]),e}(),ExpGolomb=function(){function e(t){if(_classCallCheck$1(this,e),_defineProperty(this,"_bytesAvailable",void 0),_defineProperty(this,"_bitsAvailable",0),_defineProperty(this,"_word",0),!t)throw new Error("ExpGolomb data params is required");this._data=t,this._bytesAvailable=t.byteLength,this._bytesAvailable&&this._loadWord()}return _createClass$1(e,[{key:"bitsAvailable",get:function(){return this._bitsAvailable}},{key:"_loadWord",value:function(){var e=this._data.byteLength-this._bytesAvailable,t=Math.min(4,this._bytesAvailable);if(0===t)throw new Error("No bytes available");var r=new Uint8Array(4);r.set(this._data.subarray(e,e+t)),this._word=new DataView(r.buffer).getUint32(0),this._bitsAvailable=8*t,this._bytesAvailable-=t}},{key:"skipBits",value:function(e){if(this._bitsAvailable>e)this._word<<=e,this._bitsAvailable-=e;else{e-=this._bitsAvailable;var t=Math.floor(e/8);e-=8*t,this._bytesAvailable-=t,this._loadWord(),this._word<<=e,this._bitsAvailable-=e}}},{key:"readBits",value:function(e){if(e>32)throw new Error("Cannot read more than 32 bits");var t=Math.min(this._bitsAvailable,e),r=this._word>>>32-t;return this._bitsAvailable-=t,this._bitsAvailable>0?this._word<<=t:this._bytesAvailable>0&&this._loadWord(),(t=e-t)>0&&this._bitsAvailable?r<<t|this.readBits(t):r}},{key:"skipLZ",value:function(){var e;for(e=0;e<this._bitsAvailable;++e)if(0!=(this._word&2147483648>>>e))return this._word<<=e,this._bitsAvailable-=e,e;return this._loadWord(),e+this.skipLZ()}},{key:"skipUEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"readUEG",value:function(){var e=this.skipLZ();return this.readBits(e+1)-1}},{key:"readEG",value:function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}},{key:"readBool",value:function(){return 1===this.readBits(1)}},{key:"readUByte",value:function(){return this.readBits(8)}},{key:"skipScalingList",value:function(e){for(var t=8,r=8,n=0;n<e;n++)0!==r&&(r=(t+this.readEG()+256)%256),t=0===r?t:r}}]),e}(),AVC=function(){function e(){_classCallCheck$1(this,e)}return _createClass$1(e,null,[{key:"parseAVCDecoderConfigurationRecord",value:function(t){if(!(t.length<7)){for(var r,n,o=1+(3&t[4]),i=[],a=[],s=6,c=31&t[5],l=0;l<c;l++)if(n=t[s]<<8|t[s+1],s+=2,n){var u=t.subarray(s,s+n);s+=n,i.push(u),r||(r=e.parseSPS(NALu.removeEPB(u)))}var p,$=t[s];s++;for(var f=0;f<$;f++)p=t[s]<<8|t[s+1],s+=2,p&&(a.push(t.subarray(s,s+p)),s+=p);return{sps:r,spsArr:i,ppsArr:a,nalUnitSize:o}}}},{key:"parseSPS",value:function(e){var t=new ExpGolomb(e);t.readUByte();var r=t.readUByte(),n=t.readUByte(),o=t.readUByte();t.skipUEG();var i=420;if(100===r||110===r||122===r||244===r||44===r||83===r||86===r||118===r||128===r||138===r||144===r){var a=t.readUEG();if(a<=3&&(i=[0,420,422,444][a]),3===a&&t.skipBits(1),t.skipUEG(),t.skipUEG(),t.skipBits(1),t.readBool())for(var s=3!==a?8:12,c=0;c<s;c++)t.readBool()&&(c<6?t.skipScalingList(16):t.skipScalingList(64))}t.skipUEG();var l=t.readUEG();if(0===l)t.readUEG();else if(1===l){t.skipBits(1),t.skipUEG(),t.skipUEG();for(var u=t.readUEG(),p=0;p<u;p++)t.skipUEG()}t.skipUEG(),t.skipBits(1);var $=t.readUEG(),f=t.readUEG(),d=t.readBits(1);0===d&&t.skipBits(1),t.skipBits(1);var y,h,_,g,m,v=0,b=0,S=0,E=0;if(t.readBool()&&(v=t.readUEG(),b=t.readUEG(),S=t.readUEG(),E=t.readUEG()),t.readBool()){if(t.readBool())switch(t.readUByte()){case 1:y=[1,1];break;case 2:y=[12,11];break;case 3:y=[10,11];break;case 4:y=[16,11];break;case 5:y=[40,33];break;case 6:y=[24,11];break;case 7:y=[20,11];break;case 8:y=[32,11];break;case 9:y=[80,33];break;case 10:y=[18,11];break;case 11:y=[15,11];break;case 12:y=[64,33];break;case 13:y=[160,99];break;case 14:y=[4,3];break;case 15:y=[3,2];break;case 16:y=[2,1];break;case 255:y=[t.readUByte()<<8|t.readUByte(),t.readUByte()<<8|t.readUByte()]}if(t.readBool()&&t.readBool(),t.readBool()&&(t.readBits(4),t.readBool()&&t.readBits(24)),t.readBool()&&(t.readUEG(),t.readUEG()),t.readBool()){var P=t.readBits(32),O=t.readBits(32);h=t.readBool(),m=(_=O)/(g=2*P)}}return{codec:getAvcCodec(e.subarray(1,4)),profileIdc:r,profileCompatibility:n,levelIdc:o,chromaFormat:i,width:Math.ceil(16*($+1)-2*(v+b)),height:(2-d)*(f+1)*16-(d?2:4)*(S+E),sarRatio:y,fpsNum:_,fpsDen:g,fps:m,fixedFrame:h}}}]),e}(),HEVC=function(){function e(){_classCallCheck$1(this,e)}return _createClass$1(e,null,[{key:"parseHEVCDecoderConfigurationRecord",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(t.length<23)){r=r||{};for(var n,o,i,a,s,c=1+(3&t[21]),l=[],u=[],p=[],$=23,f=t[22],d=0;d<f;d++){i=63&t[$],a=t[$+1]<<8|t[$+2],$+=3;for(var y=0;y<a;y++)if(s=t[$]<<8|t[$+1],$+=2,s){switch(i){case 32:var h=t.subarray($,$+s);n||(n=e.parseVPS(NALu.removeEPB(h),r)),p.push(h);break;case 33:var _=t.subarray($,$+s);o||(o=e.parseSPS(NALu.removeEPB(_),r)),l.push(_);break;case 34:u.push(t.subarray($,$+s))}$+=s}}return{hvcC:r,sps:o,spsArr:l,ppsArr:u,vpsArr:p,nalUnitSize:c}}}},{key:"parseVPS",value:function(t,r){r=r||{};var n=new ExpGolomb(t);n.readUByte(),n.readUByte(),n.readBits(12);var o=n.readBits(3);return r.numTemporalLayers=Math.max(r.numTemporalLayers||0,o+1),n.readBits(17),e._parseProfileTierLevel(n,o,r),r}},{key:"parseSPS",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r=r||{};var n=new ExpGolomb(t);n.readUByte(),n.readUByte(),n.readBits(4);var o=n.readBits(3);r.numTemporalLayers=Math.max(o+1,r.numTemporalLayers||0),r.temporalIdNested=n.readBits(1),e._parseProfileTierLevel(n,o,r),n.readUEG();var i=r.chromaFormatIdc=n.readUEG(),a=420;i<=3&&(a=[0,420,422,444][i]);var s=0;3===i&&(s=n.readBits(1));var c,l,u,p,$=n.readUEG(),f=n.readUEG(),d=n.readBits(1);(1===d&&(c=n.readUEG(),l=n.readUEG(),u=n.readUEG(),p=n.readUEG()),r.bitDepthLumaMinus8=n.readUEG(),r.bitDepthChromaMinus8=n.readUEG(),1===d)&&($-=(1!==i&&2!==i||0!==s?1:2)*(l+c),f-=(1===i&&0===s?2:1)*(p+u));return{codec:"hev1.1.6.L93.B0",width:$,height:f,chromaFormat:a,hvcC:r}}},{key:"_parseProfileTierLevel",value:function(e,t,r){var n=r.generalTierFlag||0;r.generalProfileSpace=e.readBits(2),r.generalTierFlag=Math.max(e.readBits(1),n),r.generalProfileIdc=Math.max(e.readBits(5),r.generalProfileIdc||0),r.generalProfileCompatibilityFlags=e.readBits(32),r.generalConstraintIndicatorFlags=[e.readBits(8),e.readBits(8),e.readBits(8),e.readBits(8),e.readBits(8),e.readBits(8)];var o=e.readBits(8);n<r.generalTierFlag?r.generalLevelIdc=o:r.generalLevelIdc=Math.max(o,r.generalLevelIdc||0);var i=[],a=[];if(t>e.bitsAvailable)throw new Error("maxSubLayersMinus inavlid size ".concat(t));for(var s=0;s<t;s++)i[s]=e.readBits(1),a[s]=e.readBits(1);t>0&&e.readBits(2*(8-t));for(var c=0;c<t;c++)0!==i[c]&&(e.readBits(2),e.readBits(1),e.readBits(5),e.readBits(16),e.readBits(16),e.readBits(4),e.readBits(16),e.readBits(16),e.readBits(12)),0!==a[c]&&e.readBits(8)}}]),e}(),UTF8=function(){function e(){_classCallCheck$1(this,e)}return _createClass$1(e,null,[{key:"decode",value:function(t){for(var r=[],n=t,o=0,i=t.length;o<i;)if(n[o]<128)r.push(String.fromCharCode(n[o])),++o;else{if(n[o]<192);else if(n[o]<224){if(e._checkContinuation(n,o,1)){var a=(31&n[o])<<6|63&n[o+1];if(a>=128){r.push(String.fromCharCode(65535&a)),o+=2;continue}}}else if(n[o]<240){if(e._checkContinuation(n,o,2)){var s=(15&n[o])<<12|(63&n[o+1])<<6|63&n[o+2];if(s>=2048&&55296!=(63488&s)){r.push(String.fromCharCode(65535&s)),o+=3;continue}}}else if(n[o]<248&&e._checkContinuation(n,o,3)){var c=(7&n[o])<<18|(63&n[o+1])<<12|(63&n[o+2])<<6|63&n[o+3];if(c>65536&&c<1114112){c-=65536,r.push(String.fromCharCode(c>>>10|55296)),r.push(String.fromCharCode(1023&c|56320)),o+=4;continue}}r.push(String.fromCharCode(65533)),++o}return r.join("")}},{key:"_checkContinuation",value:function(e,t,r){var n=e;if(t+r<n.length){for(;r--;)if(128!=(192&n[++t]))return!1;return!0}return!1}}]),e}(),AMF=function(){function e(){_classCallCheck$1(this,e)}return _createClass$1(e,null,[{key:"parse",value:function(t){if(!(t.length<3)){var r={},n=e._parseValue(new DataView(t.buffer,t.byteOffset,t.byteLength)),o=e._parseValue(new DataView(t.buffer,t.byteOffset+n.size,t.byteLength-n.size));return r[n.data]=o.data,r}}},{key:"_parseValue",value:function(t){var r,n=t.byteLength,o=1,i=!1;switch(t.getUint8(0)){case 0:r=t.getFloat64(1),o+=8;break;case 1:r=!!t.getUint8(1),o+=1;break;case 2:var a=e._parseString(new DataView(t.buffer,t.byteOffset+o,t.byteLength-o));r=a.data,o+=a.size;break;case 3:r={};var s=0;for(9==(16777215&t.getUint32(n-4))&&(s=3);o<n-4;){var c=e._parseObject(new DataView(t.buffer,t.byteOffset+o,t.byteLength-o-s)),l=c.size,u=c.data;if(c.isEnd)break;r[u.name]=u.value,o+=l}if(o<=n-3)9===(16777215&t.getUint32(o-1))&&(o+=3);break;case 8:r={},o+=4;var p=0;for(9==(16777215&t.getUint32(n-4))&&(p=3);o<n-8;){var $=e._parseObject(new DataView(t.buffer,t.byteOffset+o,t.byteLength-o-p)),f=$.size,d=$.data;if($.isEnd)break;r[d.name]=d.value,o+=f}if(o<=n-3)9===(16777215&t.getUint32(o-1))&&(o+=3);break;case 9:r=void 0,o=1,i=!0;break;case 10:r=[];var y=t.getUint32(1);o+=4;for(var h=0;h<y;h++){var _=e._parseValue(new DataView(t.buffer,t.byteOffset+o,t.byteLength-o)),g=_.data,m=_.size;r.push(g),o+=m}break;case 11:var v=t.getFloat64(o)+6e4*t.getInt16(o+8);r=new Date(v),o+=10;break;case 12:var b=t.getUint32(1);o+=4,r="",b>0&&(r=UTF8.decode(new Uint8Array(t.buffer,t.byteOffset+o,b))),o+=b;break;default:o=n}return{data:r,size:o,isEnd:i}}},{key:"_parseString",value:function(e){var t=e.getUint16(0),r="";return t>0&&(r=UTF8.decode(new Uint8Array(e.buffer,e.byteOffset+2,t))),{data:r,size:2+t}}},{key:"_parseObject",value:function(t){if(!(t.byteLength<3)){var r=e._parseString(t),n=e._parseValue(new DataView(t.buffer,t.byteOffset+r.size,t.byteLength-r.size));return{data:{name:r.data,value:n.data},size:r.size+n.size,isEnd:n.isEnd}}}}]),e}(),FlvSoundFormat={MP3:2,G711A:7,G711M:8,AAC:10,OPUS:13},logger$2=new Logger$1("FlvDemuxer"),FlvDemuxer=function(){function e(t,r,n){_classCallCheck$1(this,e),_defineProperty(this,"_headerParsed",!1),_defineProperty(this,"_remainingData",null),_defineProperty(this,"_gopId",0),_defineProperty(this,"_needAddMetaBeforeKeyFrameNal",!0),this.videoTrack=t||new VideoTrack,this.audioTrack=r||new AudioTrack,this.metadataTrack=n||new MetadataTrack,this._fixer=new FlvFixer(this.videoTrack,this.audioTrack,this.metadataTrack)}return _createClass$1(e,[{key:"demux",value:function(t){var r,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3?arguments[3]:void 0,a=this.audioTrack,s=this.videoTrack,c=this.metadataTrack;if(!n&&o||(this._remainingData=null),n&&(this._headerParsed=!1),n?(s.reset(),a.reset(),c.reset()):(s.samples=[],a.samples=[],c.seiSamples=[],c.flvScriptSamples=[],s.warnings=[],a.warnings=[],this._remainingData&&(t=concatUint8Array(this._remainingData,t),this._remainingData=null)),!t.length)return{videoTrack:s,audioTrack:a,metadataTrack:c};var l=0;if(!this._headerParsed){if(!e.probe(t))throw new Error("Invalid flv file");a.present=(4&t[4])>>>2!=0,s.present=0!=(1&t[4]),this._headerParsed=!0,l=readBig32(t,5)+4}for(var u,p,$,f,d,y=t.length;l+15<y&&(u=t[l],!(l+15+(p=t[l+1]<<16|t[l+2]<<8|t[l+3])>y));){var h;$=(t[l+7]<<24>>>0)+(t[l+4]<<16)+(t[l+5]<<8)+t[l+6],l+=11,f=t.subarray(l,l+p),8===u?this._parseAudio(f,$):9===u?(i&&(this.seamlessLoadingSwitching=!0),this._parseVideo(f,$)):18===u?this._parseScript(f,$):logger$2.warn("Invalid tag type: ".concat(u)),(d=readBig32(t,l+=p))!==11+p&&logger$2.warn(_concatInstanceProperty(h="Invalid PrevTagSize ".concat(d," (")).call(h,11+p,")")),l+=4}l<y&&(this._remainingData=t.subarray(l)),a.formatTimescale=s.formatTimescale=s.timescale=c.timescale=1e3,a.timescale=a.codecType===AudioCodecType.OPUS?1e3:a.sampleRate||0,!a.exist()&&a.hasSample()&&a.reset(),!s.exist()&&s.hasSample()&&s.reset();var _=c.flvScriptSamples[c.flvScriptSamples.length-1],g=null==_||null===(r=_.data)||void 0===r?void 0:r.onMetaData;return g&&(null!=s&&s.exist()&&(g.hasOwnProperty("duration")&&(s.duration=1e3*g.duration),!s.width&&g.hasOwnProperty("width")&&(s.width=g.width),!s.height&&g.hasOwnProperty("height")&&(s.height=g.height)),null!=a&&a.exist()&&g.hasOwnProperty("duration")&&(a.duration=1e3*g.duration)),{videoTrack:s,audioTrack:a,metadataTrack:c}}},{key:"fix",value:function(e,t,r){return this._fixer.fix(e,t,r),{videoTrack:this.videoTrack,audioTrack:this.audioTrack,metadataTrack:this.metadataTrack}}},{key:"demuxAndFix",value:function(e,t,r,n,o){return this.demux(e,t,r,o),this.fix(n,t,r)}},{key:"_parseAudio",value:function(t,r){if(t.length){var n=(240&t[0])>>>4,o=this.audioTrack;if(n!==FlvSoundFormat.AAC&&n!==FlvSoundFormat.G711A&&n!==FlvSoundFormat.G711M&&n!==FlvSoundFormat.OPUS)return logger$2.warn("Unsupported sound format: ".concat(n)),void o.reset();if(n!==FlvSoundFormat.AAC&&n!==FlvSoundFormat.OPUS){var i=(12&t[0])>>2,a=(2&t[0])>>1,s=1&t[0];o.sampleRate=e.AUDIO_RATE[i],o.sampleSize=a?16:8,o.channelCount=s+1}switch(n){case FlvSoundFormat.G711A:case FlvSoundFormat.G711M:this._parseG711(t,r,n);break;case FlvSoundFormat.AAC:this._parseAac(t,r);break;case FlvSoundFormat.OPUS:this._parseOpus(t,r)}}}},{key:"_parseOpus",value:function(e,t){var r=this.audioTrack,n=e[1];switch(r.codecType=AudioCodecType.OPUS,n){case 0:var o=OPUS.parseHeaderPackets(e.subarray(2));o?(r.codec=o.codec,r.channelCount=o.channelCount,r.sampleRate=o.sampleRate,r.config=o.config,r.sampleDuration=OPUS.getFrameDuration([],r.timescale)):(r.reset(),logger$2.warn("Cannot parse AudioSpecificConfig",e));break;case 1:if(null==t)return;var i=new AudioSample(t,e.subarray(2),r.sampleDuration);r.samples.push(i);break;default:logger$2.warn("Unknown OpusPacketType: ".concat(n))}}},{key:"_parseG711",value:function(e,t,r){var n=this.audioTrack,o=e.subarray(1);if(!(o.byteLength<1)){var i=new AudioSample(t,o);n.codecType=7===r?AudioCodecType.G711PCMA:AudioCodecType.G711PCMU,n.sampleRate=8e3,n.codec=n.codecType,n.samples.push(i)}}},{key:"_parseAac",value:function(e,t){var r=this.audioTrack;if(r.codecType=AudioCodecType.AAC,0===e[1]){var n=AAC.parseAudioSpecificConfig(e.subarray(2));n?(r.codec=n.codec,r.channelCount=n.channelCount,r.sampleRate=n.sampleRate,r.config=n.config,r.objectType=n.objectType,r.sampleRateIndex=n.samplingFrequencyIndex):(r.reset(),logger$2.warn("Cannot parse AudioSpecificConfig",e))}else if(1===e[1]){if(null==t)return;r.samples.push(new AudioSample(t,e.subarray(2)))}else logger$2.warn("Unknown AACPacketType: ".concat(e[1]))}},{key:"_parseVideo",value:function(e,t){var r=this;if(!(e.length<6)){var n=(240&e[0])>>>4,o=15&e[0],i=this.videoTrack;if(7!==o&&12!==o)return i.reset(),void logger$2.warn("Unsupported codecId: ".concat(o));var a=12===o;i.codecType=a?VideoCodecType.HEVC:VideoCodecType.AVC;var s=e[1],c=(e[2]<<16|e[3]<<8|e[4])<<8>>8;if(0===s){var l=e.subarray(5),u=a?HEVC.parseHEVCDecoderConfigurationRecord(l):AVC.parseAVCDecoderConfigurationRecord(l);if(u){var p=u.hvcC,$=u.sps,f=u.ppsArr,d=u.spsArr,y=u.vpsArr,h=u.nalUnitSize;p&&(i.hvcC=i.hvcC||p),$&&(i.codec=$.codec,i.width=$.width,i.height=$.height,i.sarRatio=$.sarRatio,i.fpsNum=$.fpsNum,i.fpsDen=$.fpsDen),d.length&&(i.sps=d),f.length&&(i.pps=f),y&&y.length&&(i.vps=y),h&&(i.nalUnitSize=h)}else logger$2.warn("Cannot parse ".concat(a?"HEVC":"AVC","DecoderConfigurationRecord"),e)}else if(1===s){var _=NALu.parseAvcC(e.subarray(5),i.nalUnitSize);if((_=this._checkAddMetaNalToUnits(a,_,i))&&_.length){var g=new VideoSample(t+c,t,_);if(this.seamlessLoadingSwitching&&t<i.lastKeyFrameDts)return;this.seamlessLoadingSwitching=!1,1===n&&(g.setToKeyframe(),i.lastKeyFrameDts=t),i.samples.push(g),_forEachInstanceProperty(_).call(_,(function(e){var n=a?e[0]>>>1&63:31&e[0];switch(n){case 5:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:if(!a&&5!==n||a&&5===n)break;g.setToKeyframe();break;case 6:case 39:case 40:if(!a&&6!==n||a&&6===n)break;r.metadataTrack.seiSamples.push(new SeiSample(NALu.parseSEI(NALu.removeEPB(e),a),t+c))}})),g.keyframe&&this._gopId++,g.gopId=this._gopId}else logger$2.warn("Cannot parse NALUs",e)}else 2===s||logger$2.warn("Unknown AVCPacketType: ".concat(s))}}},{key:"_checkAddMetaNalToUnits",value:function(e,t,r){if(!e||!this._needAddMetaBeforeKeyFrameNal)return this._needAddMetaBeforeKeyFrameNal=!1,t;var n=_mapInstanceProperty(t).call(t,(function(e){return e[0]>>>1&63}));return _includesInstanceProperty(n).call(n,32)?(this._needAddMetaBeforeKeyFrameNal=!1,t):(t.unshift(r.pps[0]),t.unshift(r.sps[0]),t.unshift(r.vps[0]),_filterInstanceProperty(t).call(t,Boolean))}},{key:"_parseScript",value:function(e,t){this.metadataTrack.flvScriptSamples.push(new FlvScriptSample(AMF.parse(e),t))}}],[{key:"probe",value:function(e){return 70===e[0]&&76===e[1]&&86===e[2]&&1===e[3]&&readBig32(e,5)>=9}}]),e}();_defineProperty(FlvDemuxer,"AUDIO_RATE",[5500,11e3,22e3,44e3]);var anObject=anObject$i,regexpFlags=function(){var e=anObject(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},call=functionCall,hasOwn$1=hasOwnProperty_1,isPrototypeOf$2=objectIsPrototypeOf,regExpFlags=regexpFlags,RegExpPrototype$1=RegExp.prototype,regexpGetFlags=function(e){var t=e.flags;return void 0!==t||"flags"in RegExpPrototype$1||hasOwn$1(e,"flags")||!isPrototypeOf$2(RegExpPrototype$1,e)?t:call(regExpFlags,e)},getRegExpFlags=regexpGetFlags,flags$6=getRegExpFlags,isPrototypeOf$1=objectIsPrototypeOf,flags$5=flags$6,RegExpPrototype=RegExp.prototype,flags_1=function(e){return e===RegExpPrototype||isPrototypeOf$1(RegExpPrototype,e)?flags$5(e):e.flags},parent$5=flags_1,flags$4=parent$5,parent$4=flags$4,flags$3=parent$4,parent$3=flags$3,flags$2=parent$3,flags$1=flags$2,flags=flags$1,_flagsInstanceProperty=getDefaultExportFromCjs(flags),entryVirtual=entryVirtual$k,entries$6=entryVirtual("Array").entries,parent$2=entries$6,entries$5=parent$2,classof=classof$e,hasOwn2=hasOwnProperty_1,isPrototypeOf=objectIsPrototypeOf,method=entries$5,ArrayPrototype=Array.prototype,DOMIterables={DOMTokenList:!0,NodeList:!0},entries$4=function(e){var t=e.entries;return e===ArrayPrototype||isPrototypeOf(ArrayPrototype,e)&&t===ArrayPrototype.entries||hasOwn2(DOMIterables,classof(e))?method:t},parent$1=entries$4,entries$3=parent$1,parent=entries$3,entries$2=parent,entries$1=entries$2,entries2=entries$1,_entriesInstanceProperty=getDefaultExportFromCjs(entries2);function Concat(e){for(var t=0,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];_forEachInstanceProperty(n).call(n,(function(e){t+=e.length}));var i=new e(t),a=0;return _forEachInstanceProperty(n).call(n,(function(e){i.set(e,a),a+=e.length})),i}var _context21,Buffer=function(){function e(){_classCallCheck$1(this,e),this.buffer=new Uint8Array(0)}return _createClass$1(e,[{key:"write",value:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];_forEachInstanceProperty(r).call(r,(function(t){t?e.buffer=Concat(Uint8Array,e.buffer,t):window.console.warn(t)}))}}],[{key:"writeUint16",value:function(e){return new Uint8Array([e>>8&255,255&e])}},{key:"writeUint32",value:function(e){return new Uint8Array([e>>24,e>>16&255,e>>8&255,255&e])}}]),e}(),UINT32_MAX=Math.pow(2,32)-1,MP4=function(){function e(){_classCallCheck$1(this,e)}return _createClass$1(e,null,[{key:"box",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];r=_filterInstanceProperty(r).call(r,Boolean);var o=8+_reduceInstanceProperty(r).call(r,(function(e,t){return e+t.byteLength}),0),i=new Uint8Array(o);i[0]=o>>24&255,i[1]=o>>16&255,i[2]=o>>8&255,i[3]=255&o,i.set(e,4);var a=8;return _forEachInstanceProperty(r).call(r,(function(e){i.set(e,a),a+=e.byteLength})),i}},{key:"ftyp",value:function(t){return _findInstanceProperty(t).call(t,(function(e){return e.type===TrackType.VIDEO&&e.codecType===VideoCodecType.HEVC}))?e.FTYPHEV1:e.FTYPAVC1}},{key:"initSegment",value:function(t){return concatUint8Array(e.ftyp(t),e.moov(t))}},{key:"pssh",value:function(t){var r,n=new Uint8Array(_concatInstanceProperty(r=[1,0,0,0]).call(r,[16,119,239,236,192,178,77,2,172,227,60,30,82,226,251,75],[0,0,0,1],parse2(t.kid),[0,0,0,0]));return e.box(e.types.pssh,n)}},{key:"moov",value:function(t){if(t[0].useEME&&(t[0].encv||t[0].enca)){var r;t[0].pssh||(t[0].pssh={kid:t[0].kid});var n=this.pssh(t[0].pssh);return e.box.apply(e,_concatInstanceProperty(r=[e.types.moov,e.mvhd(t[0].mvhdDurtion||t[0].duration,t[0].mvhdTimecale||t[0].timescale),e.mvex(t)]).call(r,_toConsumableArray(_mapInstanceProperty(t).call(t,(function(t){return e.trak(t)}))),[n]))}var o;return e.box.apply(e,_concatInstanceProperty(o=[e.types.moov,e.mvhd(t[0].mvhdDurtion||t[0].duration,t[0].mvhdTimecale||t[0].timescale)]).call(o,_toConsumableArray(_mapInstanceProperty(t).call(t,(function(t){return e.trak(t)}))),[e.mvex(t)]))}},{key:"mvhd",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4;return e.box(e.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r,t>>24&255,t>>16&255,t>>8&255,255&t,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))}},{key:"trak",value:function(t){return e.box(e.types.trak,e.tkhd(t.id,t.tkhdDuration||0,t.width,t.height),e.mdia(t))}},{key:"tkhd",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,t>>24&255,t>>16&255,t>>8&255,255&t,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,n>>8&255,255&n,0,0,o>>8&255,255&o,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t.duration,t.timescale),e.hdlr(t.type),e.minf(t))}},{key:"mdhd",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4;return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r,t>>24&255,t>>16&255,t>>8&255,255&t,85,196,0,0]))}},{key:"hdlr",value:function(t){return e.box(e.types.hdlr,e.HDLR_TYPES[t])}},{key:"minf",value:function(t){return e.box(e.types.minf,t.type===TrackType.VIDEO?e.VMHD:e.SMHD,e.DINF,e.stbl(t))}},{key:"stbl",value:function(t){var r=[];return t&&t.ext&&t.ext.stss&&r.push(e.stss(_entriesInstanceProperty(t.ext.stss))),e.box(e.types.stbl,e.stsd(t),e.STTS,r[0],e.STSC,e.STSZ,e.STCO)}},{key:"stsd",value:function(t){var r;return r="audio"===t.type?t.useEME&&t.enca?e.enca(t):t.codecType===AudioCodecType.OPUS?e.opus(t):e.mp4a(t):t.useEME&&t.encv?e.encv(t):t.av1C?e.av01(t):e.avc1hev1(t),e.box(e.types.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),r)}},{key:"enca",value:function(t){var r=t.enca.channelCount,n=t.enca.sampleRate,o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,r,0,16,0,0,0,0,n>>8&255,255&n,0,0]),i=e.esds(t.config),a=e.sinf(t.enca);return e.box(e.types.enca,o,i,a)}},{key:"encv",value:function(t){var r,n,o,i=t.sps.length>0?t.sps[0]:[],a=t.pps.length>0?t.pps[0]:[],s=t.width,c=t.height,l=t.sarRatio[0],u=t.sarRatio[1],p=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,s>>8&255,255&s,c>>8&255,255&c,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),$=new Uint8Array(_concatInstanceProperty(n=_concatInstanceProperty(r=_concatInstanceProperty(o=[1,i[1],i[2],i[3],255,225,i.length>>>8&255,255&i.length]).apply(o,_toConsumableArray(i))).call(r,[1,a.length>>>8&255,255&a.length])).apply(n,_toConsumableArray(a))),f=new Uint8Array([0,0,88,57,0,15,200,192,0,4,86,72]),d=e.sinf(t.encv),y=new Uint8Array([l>>24,l>>16&255,l>>8&255,255&l,u>>24,u>>16&255,u>>8&255,255&u]);return e.box(e.types.encv,p,e.box(e.types.avcC,$),e.box(e.types.btrt,f),d,e.box(e.types.pasp,y))}},{key:"schi",value:function(t){var r=new Uint8Array([]),n=e.tenc(t);return e.box(e.types.schi,r,n)}},{key:"tenc",value:function(t){var r,n=new Uint8Array(_concatInstanceProperty(r=[0,0,0,0,0,0,255&t.default_IsEncrypted,255&t.default_IV_size]).call(r,parse2(t.default_KID)));return e.box(e.types.tenc,n)}},{key:"sinf",value:function(t){var r=new Uint8Array([]),n=new Uint8Array([t.data_format.charCodeAt(0),t.data_format.charCodeAt(1),t.data_format.charCodeAt(2),t.data_format.charCodeAt(3)]),o=new Uint8Array([0,0,0,0,99,101,110,99,0,1,0,0]),i=e.schi(t);return e.box(e.types.sinf,r,e.box(e.types.frma,n),e.box(e.types.schm,o),i)}},{key:"av01",value:function(t){return e.box(e.types.av01,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,t.width>>8&255,255&t.width,t.height>>8&255,255&t.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),t.av1C,t.colr)}},{key:"avc1hev1",value:function(t){var r,n=t.codecType===VideoCodecType.HEVC,o=n?e.types.hvc1:e.types.avc1,i=n?e.hvcC(t):e.avcC(t),a=[new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,t.width>>8&255,255&t.width,t.height>>8&255,255&t.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),i];return n?a.push(e.box(e.types.fiel,new Uint8Array([1,0]))):t.sarRatio&&t.sarRatio.length>1&&a.push(e.pasp(t.sarRatio)),e.box.apply(e,_concatInstanceProperty(r=[o]).call(r,a))}},{key:"avcC",value:function(t){var r,n,o,i,a,s,c=[],l=[];return _forEachInstanceProperty(r=t.sps).call(r,(function(e){s=e.byteLength,c.push(s>>>8&255),c.push(255&s),c.push.apply(c,_toConsumableArray(e))})),_forEachInstanceProperty(n=t.pps).call(n,(function(e){s=e.byteLength,l.push(s>>>8&255),l.push(255&s),l.push.apply(l,_toConsumableArray(e))})),e.box(e.types.avcC,new Uint8Array(_concatInstanceProperty(i=_concatInstanceProperty(o=_concatInstanceProperty(a=[1,c[3],c[4],c[5],255,224|t.sps.length]).apply(a,c)).call(o,[t.pps.length])).apply(i,l)))}},{key:"hvcC",value:function(t){var r=t.hvcC;if(r instanceof ArrayBuffer||r instanceof Uint8Array)return r;var n,o=t.vps,i=t.sps,a=t.pps;if(r){var s=r.generalProfileCompatibilityFlags,c=r.generalConstraintIndicatorFlags,l=(o.length&&1)+(i.length&&1)+(a.length&&1);n=[1,r.generalProfileSpace<<6|r.generalTierFlag<<5|r.generalProfileIdc,s>>>24,s>>>16,s>>>8,s,c[0],c[1],c[2],c[3],c[4],c[5],r.generalLevelIdc,240,0,252,252|r.chromaFormatIdc,248|r.bitDepthLumaMinus8,248|r.bitDepthChromaMinus8,0,0,r.numTemporalLayers<<3|r.temporalIdNested<<2|3,l];var u=function(e){var t;n.push(e.length>>8,e.length),(t=n).push.apply(t,_toConsumableArray(e))};o.length&&(n.push(160,0,o.length),_forEachInstanceProperty(o).call(o,u)),i.length&&(n.push(161,0,i.length),_forEachInstanceProperty(i).call(i,u)),a.length&&(n.push(162,0,a.length),_forEachInstanceProperty(a).call(a,u))}else n=[1,1,96,0,0,0,144,0,0,0,0,0,93,240,0,252,253,248,248,0,0,15,3,160,0,1,0,24,64,1,12,1,255,255,1,96,0,0,3,0,144,0,0,3,0,0,3,0,93,153,152,9,161,0,1,0,45,66,1,1,1,96,0,0,3,0,144,0,0,3,0,0,3,0,93,160,2,128,128,45,22,89,153,164,147,43,154,128,128,128,130,0,0,3,0,2,0,0,3,0,50,16,162,0,1,0,7,68,1,193,114,180,98,64];return e.box(e.types.hvcC,new Uint8Array(n))}},{key:"pasp",value:function(t){var r=_slicedToArray(t,2),n=r[0],o=r[1];return e.box(e.types.pasp,new Uint8Array([n>>24,n>>16&255,n>>8&255,255&n,o>>24,o>>16&255,o>>8&255,255&o]))}},{key:"mp4a",value:function(t){return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,t.sampleRate>>8&255,255&t.sampleRate,0,0]),t.config.length?e.esds(t.config):void 0)}},{key:"esds",value:function(t){var r,n,o,i=t.length;return e.box(e.types.esds,new Uint8Array(_concatInstanceProperty(r=_concatInstanceProperty(n=_concatInstanceProperty(o=[0,0,0,0,3,23+i,0,0,0,4,15+i,64,21,0,6,0,0,0,218,192,0,0,218,192,5]).call(o,[i])).call(n,t)).call(r,[6,1,2])))}},{key:"opus",value:function(t){var r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,t.sampleRate>>8&255,255&t.sampleRate,0,0]),n=t.config.length?e.dOps(t):[];return e.box(e.types.Opus,r,n)}},{key:"dOps",value:function(t){if(t.config)return t.config[4]=t.sampleRate>>>24&255,t.config[5]=t.sampleRate>>>16&255,t.config[6]=t.sampleRate>>>8&255,t.config[7]=255&t.sampleRate,e.box(e.types.dOps,t.config)}},{key:"mvex",value:function(t){var r;return e.box.apply(e,_concatInstanceProperty(r=[e.types.mvex]).call(r,_toConsumableArray(_mapInstanceProperty(t).call(t,(function(t){return e.trex(t.id)})))))}},{key:"trex",value:function(t){return e.box(e.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"trex1",value:function(t){return e.box(e.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,2,0,0,0,0,0,0,1,0,0]))}},{key:"trex2",value:function(t){return e.box(e.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,4,0,0,0,0,0,2,0,0,0]))}},{key:"moof",value:function(t){var r;return e.box.apply(e,_concatInstanceProperty(r=[e.types.moof,e.mfhd(t[0].samples?t[0].samples[0].gopId:0)]).call(r,_toConsumableArray(_mapInstanceProperty(t).call(t,(function(t){return e.traf(t)})))))}},{key:"mfhd",value:function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"traf",value:function(t){var r,n=e.tfhd(t.id),o=e.tfdt(t,t.baseMediaDecodeTime),i=0;if(t.isVideo&&t.videoSenc&&(r=t.videoSenc,_forEachInstanceProperty(r).call(r,(function(e){i+=8,e.subsamples&&e.subsamples.length&&(i+=2,i+=6*e.subsamples.length)}))),t.videoSencLength=i,t.useEME&&(t.isVideoEncryption||t.isAudioEncryption)){if(t.isVideoEncryption){if(t.isVideo){var a=e.saiz(t),s=e.saio(t),c=e.trun1(t),l=e.senc(t);return e.box(e.types.traf,n,o,a,s,c,l)}if(t.isAudioEncryption){var u=e.sbgp(),p=e.saiz(t),$=e.saio(t),f=e.senc(t),d=e.trun1(t);return e.box(e.types.traf,n,o,u,p,$,f,d)}var y=e.sbgp(),h=e.trun1(t);return e.box(e.types.traf,n,o,y,h)}if(t.isVideo){var _=e.trun1(t);return e.box(e.types.traf,n,o,_)}var g=e.sbgp(),m=e.saiz(t),v=e.saio(t),b=e.senc(t),S=e.trun1(t);return e.box(e.types.traf,n,o,g,m,v,b,S)}var E=e.sdtp(t);return e.box(e.types.traf,n,o,E,e.trun(t.samples,E.byteLength+76))}},{key:"sdtp",value:function(t){var r,n=new Buffer;return _forEachInstanceProperty(r=t.samples).call(r,(function(e){n.write(new Uint8Array(t.isVideo?[e.keyframe?32:16]:[16]))})),e.box(e.types.sdtp,this.extension(0,0),n.buffer)}},{key:"trun1",value:function(t){var r,n=new Buffer,o=Buffer.writeUint32(t.samples.length),i=null;if(t.isVideo){var a=t.videoSencLength;i=Buffer.writeUint32(16*t.samples.length+a+149),!t.isVideoEncryption&&t.isAudioEncryption&&(i=Buffer.writeUint32(16*t.samples.length+92))}else{var s=12*t.samples.length+124;t.isAudioEncryption&&(s=12*t.samples.length+8*t.audioSenc.length+177),i=Buffer.writeUint32(s)}return _forEachInstanceProperty(r=t.samples).call(r,(function(e){n.write(Buffer.writeUint32(e.duration)),n.write(Buffer.writeUint32(e.size)),n.write(Buffer.writeUint32(e.keyframe?33554432:65536)),t.isVideo&&n.write(Buffer.writeUint32(e.cts?e.cts:0))})),e.box(e.types.trun,this.extension(0,_flagsInstanceProperty(t)),o,i,n.buffer)}},{key:"senc",value:function(t){var r=new Buffer,n=t.samples.length,o=t.isVideo?16:8,i=t.isVideo?2:0,a=[],s=0;return t.isVideo?(a=t.videoSenc,s=t.videoSencLength):a=t.audioSenc,s=s||o*n,r.write(Buffer.writeUint32(16+s),e.types.senc,this.extension(0,i)),r.write(Buffer.writeUint32(n)),_forEachInstanceProperty(a).call(a,(function(e){for(var t=0;t<e.InitializationVector.length;t++)r.write(new Uint8Array([e.InitializationVector[t]]));var n;e.subsamples&&e.subsamples.length&&(r.write(Buffer.writeUint16(e.subsamples.length)),_forEachInstanceProperty(n=e.subsamples).call(n,(function(e){r.write(Buffer.writeUint16(e.BytesOfClearData)),r.write(Buffer.writeUint32(e.BytesOfProtectedData))})))})),r.buffer}},{key:"saio",value:function(t){var r=12*t.samples.length+141;!t.isVideo&&t.isAudioEncryption&&(r=149);var n=new Uint8Array([1,0,0,0,0,0,0,1,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r]);return e.box(e.types.saio,n)}},{key:"saiz",value:function(t){var r=t.samples.length,n=new Uint8Array([0,0,0,0,16,r>>24&255,r>>16&255,r>>8&255,255&r]);return e.box(e.types.saiz,n)}},{key:"sbgp",value:function(){var t=new Uint8Array([114,111,108,108,0,0,0,1,0,0,1,25,0,0,0,1]);return e.box(e.types.sbgp,this.extension(0,0),t)}},{key:"extension",value:function(e,t){return new Uint8Array([e,t>>16&255,t>>8&255,255&t])}},{key:"tfhd",value:function(t){return e.box(e.types.tfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"tfdt",value:function(t,r){var n=Math.floor(r/(UINT32_MAX+1)),o=Math.floor(r%(UINT32_MAX+1));return t.useEME&&(t.isVideoEncryption||t.isAudioEncryption)?e.box(e.types.tfdt,new Uint8Array([0,0,0,0,o>>24,o>>16&255,o>>8&255,255&o])):e.box(e.types.tfdt,new Uint8Array([1,0,0,0,n>>24,n>>16&255,n>>8&255,255&n,o>>24,o>>16&255,o>>8&255,255&o]))}},{key:"trun",value:function(t,r){var n=t.length,o=12+16*n;r+=8+o;var i=new Uint8Array(o);i.set([0,0,15,1,n>>>24&255,n>>>16&255,n>>>8&255,255&n,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0);for(var a=0;a<n;a++){var s=t[a],c=s.duration,l=s.size,u=s.flag,p=void 0===u?{}:u,$=s.cts,f=void 0===$?0:$;i.set([c>>>24&255,c>>>16&255,c>>>8&255,255&c,l>>>24&255,l>>>16&255,l>>>8&255,255&l,p.isLeading<<2|(null===p.dependsOn||void 0===p.dependsOn?1:p.dependsOn),p.isDependedOn<<6|p.hasRedundancy<<4|p.paddingValue<<1|(null===p.isNonSyncSample||void 0===p.isNonSyncSample?1:p.isNonSyncSample),61440&p.degradationPriority,15&p.degradationPriority,f>>>24&255,f>>>16&255,f>>>8&255,255&f],12+16*a)}return e.box(e.types.trun,i)}},{key:"moovMP4",value:function(t){var r;return e.box.apply(e,_concatInstanceProperty(r=[e.types.moov,e.mvhd(t[0].duration,t[0].timescale)]).call(r,_toConsumableArray(_mapInstanceProperty(t).call(t,(function(t){return e.trackMP4(t)})))))}},{key:"trackMP4",value:function(t){return e.box(e.types.trak,e.tkhd(t.id,t.duration,t.width,t.height),e.mdiaMP4(t))}},{key:"mdiaMP4",value:function(t){return e.box(e.types.mdia,e.mdhd(t.duration,t.timescale),e.hdlr(t.type),e.minfMP4(t))}},{key:"minfMP4",value:function(t){return e.box(e.types.minf,t.type===TrackType.VIDEO?e.VMHD:e.SMHD,e.DINF,e.stblMP4(t))}},{key:"stblMP4",value:function(t){var r,n=t.ext,o=[e.stsd(t),e.stts(n.stts),e.stsc(n.stsc),e.stsz(n.stsz),e.stco(n.stco)];return n.stss.length&&o.push(e.stss(n.stss)),n.ctts.length&&o.push(e.ctts(n.ctts)),e.box.apply(e,_concatInstanceProperty(r=[e.types.stbl]).call(r,o))}},{key:"stts",value:function(t){var r=t.length,n=new Uint8Array(8*r),o=0;return _forEachInstanceProperty(t).call(t,(function(e){var t=e.value,r=e.count;n.set([r>>24,r>>16&255,r>>8&255,255&r,t>>24,t>>16&255,t>>8&255,255&t],o),o+=8})),e.box(e.types.stts,concatUint8Array(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stsc",value:function(t){var r=t.length,n=new Uint8Array(12*r),o=0;return _forEachInstanceProperty(t).call(t,(function(e){var t=e.firstChunk,r=e.samplesPerChunk,i=e.sampleDescIndex;n.set([t>>24,t>>16&255,t>>8&255,255&t,r>>24,r>>16&255,r>>8&255,255&r,i>>24,i>>16&255,i>>8&255,255&i],o),o+=12})),e.box(e.types.stsc,concatUint8Array(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stsz",value:function(t){var r=t.length,n=new Uint8Array(4*r),o=0;return _forEachInstanceProperty(t).call(t,(function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],o),o+=4})),e.box(e.types.stsz,concatUint8Array(new Uint8Array([0,0,0,0,0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stco",value:function(t){var r=t.length,n=new Uint8Array(4*r),o=0;return _forEachInstanceProperty(t).call(t,(function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],o),o+=4})),e.box(e.types.stco,concatUint8Array(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stss",value:function(t){var r=t.length,n=new Uint8Array(4*r),o=0;return _forEachInstanceProperty(t).call(t,(function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],o),o+=4})),e.box(e.types.stss,concatUint8Array(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"ctts",value:function(t){var r=t.length,n=new Uint8Array(8*r),o=0;return _forEachInstanceProperty(t).call(t,(function(e){var t=e.value,r=e.count;n.set([r>>24,r>>16&255,r>>8&255,255&r,t>>24,t>>16&255,t>>8&255,255&t],o),o+=8})),e.box(e.types.ctts,concatUint8Array(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"styp",value:function(){return e.box(e.types.styp,new Uint8Array([109,115,100,104,0,0,0,0,109,115,100,104,109,115,105,120]))}},{key:"sidx",value:function(t){var r,n=t.timescale,o=t.samples[0].duration,i=o*t.samples.length,a=t.samples[0].sampleOffset*o,s=8;_forEachInstanceProperty(r=t.samples).call(r,(function(e){s+=e.size}));var c=0;if(t.isVideo){var l,u=0;t.videoSenc&&(l=t.videoSenc),t.isVideo&&_forEachInstanceProperty(l).call(l,(function(e){u+=8,e.subsamples&&e.subsamples.length&&(u+=2,u+=6*e.subsamples.length)})),t.videoSencLength=u,c=s+141+16*t.samples.length+u,t.useEME&&t.isAudioEncryption&&!t.isVideoEncryption&&(c=s+16*t.samples.length+84)}else c=s+116+12*t.samples.length,t.useEME&&t.isAudioEncryption&&(c=s+169+12*t.samples.length+8*t.audioSenc.length);var p=new Uint8Array([0,0,0,0,0,0,0,255&t.id,n>>24&255,n>>16&255,n>>8&255,255&n,a>>24&255,a>>16&255,a>>8&255,255&a,0,0,0,0,0,0,0,1,0,c>>16&255,c>>8&255,255&c,i>>24&255,i>>16&255,i>>8&255,255&i,144,0,0,0]);return e.box(e.types.sidx,p)}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}}]),e}();_defineProperty(MP4,"types",_reduceInstanceProperty(_context21=["Opus","dOps","av01","av1C","avc1","avcC","hvc1","hvcC","dinf","dref","esds","ftyp","hdlr","mdat","mdhd","mdia","mfhd","minf","moof","moov","mp4a","mvex","mvhd","pasp","stbl","stco","stsc","stsd","stsz","stts","tfdt","tfhd","traf","trak","trex","tkhd","vmhd","smhd","ctts","stss","styp","pssh","sidx","sbgp","saiz","saio","senc","trun","encv","enca","sinf","btrt","frma","tenc","schm","schi","mehd","fiel","sdtp"]).call(_context21,(function(e,t){return e[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)],e}),_Object$create(null))),_defineProperty(MP4,"HDLR_TYPES",{video:new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),audio:new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0])}),_defineProperty(MP4,"FTYPAVC1",MP4.box(MP4.types.ftyp,new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]))),_defineProperty(MP4,"FTYPHEV1",MP4.box(MP4.types.ftyp,new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,104,101,118,49]))),_defineProperty(MP4,"DINF",MP4.box(MP4.types.dinf,MP4.box(MP4.types.dref,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1])))),_defineProperty(MP4,"VMHD",MP4.box(MP4.types.vmhd,new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]))),_defineProperty(MP4,"SMHD",MP4.box(MP4.types.smhd,new Uint8Array([0,0,0,0,0,0,0,0]))),_defineProperty(MP4,"StblTable",new Uint8Array([0,0,0,0,0,0,0,0])),_defineProperty(MP4,"STTS",MP4.box(MP4.types.stts,MP4.StblTable)),_defineProperty(MP4,"STSC",MP4.box(MP4.types.stsc,MP4.StblTable)),_defineProperty(MP4,"STSZ",MP4.box(MP4.types.stsz,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]))),_defineProperty(MP4,"STCO",MP4.box(MP4.types.stco,MP4.StblTable));var Logger=function(){function e(t,r){_classCallCheck$1(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]"),e.disabled=r}return _createClass$1(e,[{key:"debug",value:function(){var t,r;if(!e.disabled){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];(r=console).debug.apply(r,_concatInstanceProperty(t=[this._prefix]).call(t,o))}}},{key:"log",value:function(){var t,r;if(!e.disabled){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];(r=console).log.apply(r,_concatInstanceProperty(t=[this._prefix]).call(t,o))}}},{key:"warn",value:function(){var t,r;if(!e.disabled){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];(r=console).warn.apply(r,_concatInstanceProperty(t=[this._prefix]).call(t,o))}}},{key:"error",value:function(){var t,r;if(!e.disabled){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];(r=console).error.apply(r,_concatInstanceProperty(t=[this._prefix]).call(t,o))}}},{key:"table",value:function(){var t;e.disabled||(console.group(this._prefix),(t=console).table.apply(t,arguments),console.groupEnd())}}],[{key:"enable",value:function(){e.disabled=!1}},{key:"disable",value:function(){e.disabled=!0}}]),e}();_defineProperty(Logger,"disabled",!0);var FMP4Remuxer=function(){function e(t,r,n){_classCallCheck$1(this,e),this.videoTrack=t,this.audioTrack=r;var o=/Chrome\/([^.]+)/.exec(navigator.userAgent);this.forceFirstIDR=o&&Number(o[1])<50,this.log=new Logger("FMP4Remuxer",!n||!n.openLog||!n.openLog)}return _createClass$1(e,[{key:"remux",value:function(){var e,t,r,n,o,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=this.videoTrack,c=this.audioTrack,l=s.exist(),u=c.exist(),p=[];return i&&(a&&a.initMerge?(l&&p.push(this.videoTrack),u&&p.push(this.audioTrack),r=MP4.initSegment(p)):(l&&(e=MP4.initSegment([this.videoTrack])),u&&(t=MP4.initSegment([this.audioTrack])))),l&&s.hasSample()&&(n=this._remuxVideo()),u&&c.hasSample()&&(o=this._remuxAudio()),s.samples=[],c.samples=[],{initSegment:r,videoInitSegment:e,audioInitSegment:t,videoSegment:n,audioSegment:o}}},{key:"_remuxVideo",value:function(){var e=this.videoTrack;this.forceFirstIDR&&(e.samples[0].flag={dependsOn:2,isNonSyncSample:0});var t=e.samples,r=/av01/.test(e.codec),n=0;r?_forEachInstanceProperty(t).call(t,(function(e){n+=e.data.byteLength})):_forEachInstanceProperty(t).call(t,(function(e){var t;n+=_reduceInstanceProperty(t=e.units).call(t,(function(e,t){return e+t.byteLength}),0),n+=4*e.units.length}));var o=new Uint8Array(n);if(r)for(var i,a=0,s=t.length,c=0;a<s;a++)i=t[a],o.set(i.data,c),i.size=i.data.byteLength,c+=i.size;else for(var l,u=new DataView(o.buffer),p=function(e,r){var n;r=t[$];var i=0;_forEachInstanceProperty(n=r.units).call(n,(function(t){u.setUint32(e,t.byteLength),e+=4,o.set(t,e),e+=t.byteLength,i+=4+t.byteLength})),r.size=i,d=e,l=r},$=0,f=t.length,d=0;$<f;$++)p(d,l);var y=MP4.mdat(o);return concatUint8Array(MP4.moof([e]),y)}},{key:"_remuxAudio",value:function(){var e,t,r=this.audioTrack,n=new Uint8Array(_reduceInstanceProperty(e=r.samples).call(e,(function(e,t){return e+t.size}),0));_reduceInstanceProperty(t=r.samples).call(t,(function(e,t){return n.set(t.data,e),e+t.size}),0);var o=MP4.mdat(n);return concatUint8Array(MP4.moof([r]),o)}},{key:"reset",value:function(){this.videoTrack.reset(),this.audioTrack.reset()}}]),e}(),TransferCost=function(){function e(){_classCallCheck$4(this,e),_defineProperty$3(this,"_ttfb",0),_defineProperty$3(this,"_demuxStart",0),_defineProperty$3(this,"_demuxEnd",0),_defineProperty$3(this,"_demuxCost",0),_defineProperty$3(this,"_remuxStart",0),_defineProperty$3(this,"_remuxEnd",0),_defineProperty$3(this,"_remuxCost",0),_defineProperty$3(this,"_appendStart",0),_defineProperty$3(this,"_appendEnd",0),_defineProperty$3(this,"_appendCost",0)}return _createClass$4(e,[{key:"set",value:function(e,t){this["_".concat(e)]=t}},{key:"start",value:function(e){this["_".concat(e,"Start")]=_Date$now()}},{key:"end",value:function(e){this["_".concat(e,"End")]=_Date$now(),this["_".concat(e,"Cost")]=this["_".concat(e,"Cost")]+(this["_".concat(e,"End")]-this["_".concat(e,"Start")])}},{key:"transferCost",get:function(){return{ttfbCost:this._ttfb,demuxCost:this._demuxCost,remuxCost:this._remuxCost,appendCost:this._appendCost}}}]),e}(),TRANSFER_EVENT={TTFB:"ttfb",DEMUX:"demux",REMUX:"remux",APPEND:"append"},logger$1=new Logger$2("BufferService"),BufferService=function(){function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};_classCallCheck$4(this,e),_defineProperty$3(this,"flv",null),_defineProperty$3(this,"_demuxer",new FlvDemuxer),_defineProperty$3(this,"_remuxer",null),_defineProperty$3(this,"_mse",null),_defineProperty$3(this,"_softVideo",null),_defineProperty$3(this,"_sourceCreated",!1),_defineProperty$3(this,"_needInitSegment",!0),_defineProperty$3(this,"_discontinuity",!0),_defineProperty$3(this,"_contiguous",!1),_defineProperty$3(this,"_initSegmentId",""),_defineProperty$3(this,"_cachedBuffer",null),_defineProperty$3(this,"_demuxStartTime",0),_defineProperty$3(this,"_opts",null),this.flv=t,this._opts=n,r?this._softVideo=r:(this._remuxer=new FMP4Remuxer(this._demuxer.videoTrack,this._demuxer.audioTrack),this._mse=new MSE(null,{preferMMS:"boolean"==typeof n.preferMMS?n.preferMMS:!!n.perferMMS}),this._mse.bindMedia(t.media))}var t,r,n,o,i,a;return _createClass$4(e,[{key:"baseDts",get:function(){var e,t;return null===(e=this._demuxer)||void 0===e||null===(t=e._fixer)||void 0===t?void 0:t._baseDts}},{key:"blobUrl",get:function(){var e;return null===(e=this._mse)||void 0===e?void 0:e.url}},{key:"isFull",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:MSE.VIDEO;return this._mse.isFull(e)}},{key:"seamlessSwitch",value:function(){this._needInitSegment=!0,this._discontinuity=!0,this._contiguous=!0,this._initSegmentId=""}},{key:"unContiguous",value:function(e){this._contiguous=!1,this._demuxStartTime=e}},{key:"reset",value:(a=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(){var t,r=arguments;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.length>0&&void 0!==r[0]&&r[0],!this._mse||t){e.next=6;break}return e.next=4,this._mse.unbindMedia();case 4:return e.next=6,this._mse.bindMedia(this.flv.media);case 6:this._needInitSegment=!0,this._discontinuity=!0,this._contiguous=!1,this._sourceCreated=!1,this._initSegmentId="",this.resetSeamlessSwitchStats();case 12:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"resetSeamlessSwitchStats",value:function(){this.seamlessLoadingSwitch=null,this.seamlessLoadingSwitching=!1,this._demuxer&&(this._demuxer.seamlessLoadingSwitching=!1)}},{key:"endOfStream",value:(i=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(){return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._mse){e.next=7;break}if(!this._sourceCreated){e.next=5;break}return e.next=4,this._mse.endOfStream();case 4:this.flv.emit(EVENT.BUFFEREOS);case 5:e.next=8;break;case 7:this._softVideo&&this._softVideo.endOfStream();case 8:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateDuration",value:(o=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t){return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._mse){e.next=7;break}if(this._mse.isOpened){e.next=4;break}return e.next=4,this._mse.open();case 4:return logger$1.debug("update duration",t),e.next=7,this._mse.updateDuration(t);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"destroy",value:(n=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(){return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._mse){e.next=3;break}return e.next=3,this._mse.unbindMedia();case 3:this._mse=null,this._softVideo=null,this._demuxer=null,this._remuxer=null;case 7:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"appendBuffer",value:(r=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t){var r,n,o,i,a,s,c,l,u,p,$,f,d,y,h,_,g,m,v=this;return _regeneratorRuntime$1().wrap((function(e){for(var b,S,E,P,O,T;;)switch(e.prev=e.next){case 0:if(r=!1,this._cachedBuffer&&(t=concatUint8Array$1(this._cachedBuffer,t),this._cachedBuffer=null),n=this._demuxer,t&&t.length&&n){e.next=5;break}return e.abrupt("return");case 5:e.prev=5,this.flv._transferCost.start(TRANSFER_EVENT.DEMUX),n.demuxAndFix(t,this.seamlessLoadingSwitching||this._discontinuity,this._contiguous,this._demuxStartTime,this.seamlessLoadingSwitching),this.seamlessLoadingSwitching=!1,this.flv._transferCost.end(TRANSFER_EVENT.DEMUX),e.next=15;break;case 12:throw e.prev=12,e.t0=e.catch(5),new StreamingError(ERR.DEMUX,ERR.SUB_TYPES.FLV,e.t0);case 15:if(o=n.videoTrack,i=n.audioTrack,a=n.metadataTrack,!this.seamlessLoadingSwitch){e.next=25;break}if(!((s=_findIndexInstanceProperty(b=o.samples).call(b,(function(e){return e.originDts===o.lastKeyFrameDts})))>=0)){e.next=25;break}return _spliceInstanceProperty(S=o.samples).call(S,s),e.next=22,this.seamlessLoadingSwitch();case 22:this.seamlessLoadingSwitch=null,t=null,r=!0;case 25:if(c=o.exist(),l=i.exist(),this._opts.onlyAudio&&(c=!1,o.present=!1),this._opts.onlyVideo&&(l=!1,i.present=!1),!(!c&&o.present||!l&&i.present)){e.next=42;break}if(u=0,(p=c?o:l?i:void 0)&&p.samples.length&&(u=(p.samples[p.samples.length-1].originPts-p.samples[0].originPts)/p.timescale*1e3),!(u>this._opts.analyzeDuration)){e.next=40;break}logger$1.warn("analyze duration exceeded, ".concat(u,"ms"),p),o.present=c,i.present=l,this.flv.emit(EVENT.ANALYZE_DURATION_EXCEEDED,{duration:u}),e.next=42;break;case 40:return this._cachedBuffer=t,e.abrupt("return");case 42:if($=o.type,f=i.type,this._fireEvents(o,i,a),r||(this._discontinuity=!1,this._contiguous=!0,this._demuxStartTime=0),d=this._mse,y=function(){var e,t;null!==(e=v.flv)&&void 0!==e&&e.emit&&(null===(t=v.flv)||void 0===t||t.emit(EVENT.APPEND_BUFFER,{}))},this.flv.emit(EVENT.DEMUXED_TRACK,{videoTrack:o}),(h=_concatInstanceProperty(E=_concatInstanceProperty(P=_concatInstanceProperty(O=_concatInstanceProperty(T="".concat(o.codec,"/")).call(T,o.width,"/")).call(O,o.height,"/")).call(P,i.codec,"/")).call(E,i.config))!==this._initSegmentId&&(this._needInitSegment=!0,this._initSegmentId=h,this._emitMetaParsedEvent(o,i)),!d){e.next=83;break}if(this._sourceCreated){e.next=59;break}return e.next=55,d.open();case 55:c&&(logger$1.log("codec: video/mp4;codecs=".concat(o.codec)),d.createSource($,"video/mp4;codecs=".concat(o.codec))),l&&(logger$1.log("codec: audio/mp4;codecs=".concat(i.codec)),d.createSource(f,"audio/mp4;codecs=".concat(i.codec))),this._sourceCreated=!0,this.flv.emit(EVENT.SOURCEBUFFER_CREATED);case 59:e.prev=59,this._needInitSegment&&!this._opts.mseLowLatency&&(o.duration=this._opts.durationForMSELowLatencyOff*o.timescale,i.duration=this._opts.durationForMSELowLatencyOff*l.timescale),this.flv._transferCost.start(TRANSFER_EVENT.REMUX),_=this._remuxer.remux(this._needInitSegment),this.flv._transferCost.end(TRANSFER_EVENT.REMUX),e.next=69;break;case 66:throw e.prev=66,e.t1=e.catch(59),new StreamingError(ERR.REMUX,ERR.SUB_TYPES.FMP4,e.t1);case 69:if(!this._needInitSegment||_.videoInitSegment||_.audioInitSegment){e.next=71;break}return e.abrupt("return");case 71:return this._needInitSegment=!1,g=[],_.videoInitSegment&&g.push(d.append($,_.videoInitSegment)),_.audioInitSegment&&g.push(d.append(f,_.audioInitSegment)),_.videoSegment&&g.push(d.append($,_.videoSegment)),_.audioSegment&&g.push(d.append(f,_.audioSegment)),this.flv._transferCost.start(TRANSFER_EVENT.APPEND),(m=_Promise.all(g)).then(y).then((function(){v.flv._transferCost.end(TRANSFER_EVENT.APPEND),y()})),e.abrupt("return",m);case 83:this._softVideo&&(this._softVideo.appendBuffer(o,i),y());case 84:case"end":return e.stop()}}),e,this,[[5,12],[59,66]])}))),function(e){return r.apply(this,arguments)})},{key:"evictBuffer",value:(t=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t){var r,n,o,i=this;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.flv.media,this._mse&&this._demuxer&&r&&t&&!(t<0)){e.next=3;break}return e.abrupt("return");case 3:if(n=r.currentTime,!((o=n-t)<=0)){e.next=7;break}return e.abrupt("return");case 7:if(!(Buffer$1.start(Buffer$1.get(r))+1>=o)){e.next=10;break}return e.abrupt("return");case 10:return e.abrupt("return",this._mse.clearBuffer(0,o).then((function(){return i.flv.emit(EVENT.REMOVE_BUFFER,{removeEnd:o})})));case 11:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_emitMetaParsedEvent",value:function(e,t){e.exist()&&this.flv.emit(EVENT.METADATA_PARSED,{type:"video",track:e,meta:{codec:e.codec,timescale:e.timescale,width:e.width,height:e.height,sarRatio:e.sarRatio,baseDts:e.baseDts}}),t.exist()&&this.flv.emit(EVENT.METADATA_PARSED,{type:"audio",track:t,meta:{codec:t.codec,channelCount:t.channelCount,sampleRate:t.sampleRate,timescale:t.timescale,baseDts:t.baseDts}}),logger$1.debug("track parsed",e,t)}},{key:"_fireEvents",value:function(e,t,r){var n,o,i,a,s,c,l=this;logger$1.debug(_concatInstanceProperty(n="videoTrack samples count: ".concat(e.samples.length,", audioTrack samples count: ")).call(n,t.samples.length)),_forEachInstanceProperty(o=r.flvScriptSamples).call(o,(function(e){l.flv.emit(EVENT.FLV_SCRIPT_DATA,e),logger$1.debug("flvScriptData",e)})),_forEachInstanceProperty(i=e.samples).call(i,(function(e){e.keyframe&&l.flv.emit(EVENT.KEYFRAME,{pts:e.originPts})})),_forEachInstanceProperty(a=e.warnings).call(a,(function(e){var t;switch(e.type){case WarningType.LARGE_AV_SHIFT:t=EVENT.LARGE_AV_FIRST_FRAME_GAP_DETECT;break;case WarningType.LARGE_VIDEO_GAP:t=EVENT.LARGE_VIDEO_DTS_GAP_DETECT;break;case WarningType.LARGE_VIDEO_GAP_BETWEEN_CHUNK:t=EVENT.MAX_DTS_DELTA_WITH_NEXT_SEGMENT_DETECT}t&&l.flv.emit(EVENT.STREAM_EXCEPTION,_objectSpread2$2(_objectSpread2$2({},e),{},{type:t})),logger$1.warn("video exception",e)})),_forEachInstanceProperty(s=t.warnings).call(s,(function(e){var t;switch(e.type){case WarningType.LARGE_AUDIO_GAP:t=EVENT.LARGE_AUDIO_DTS_GAP_DETECT;break;case WarningType.AUDIO_FILLED:t=EVENT.AUDIO_GAP_DETECT;break;case WarningType.AUDIO_DROPPED:t=EVENT.AUDIO_OVERLAP_DETECT}t&&l.flv.emit(EVENT.STREAM_EXCEPTION,_objectSpread2$2(_objectSpread2$2({},e),{},{type:t})),logger$1.warn("audio exception",e)})),_forEachInstanceProperty(c=r.seiSamples).call(c,(function(e){l.flv.emit(EVENT.SEI,_objectSpread2$2(_objectSpread2$2({},e),{},{sei:{code:e.data.type,content:e.data.payload,dts:e.pts}}))}))}}]),e}();function getOption(e){var t=_objectSpread2$2({retryCount:3,retryDelay:1e3,disconnectRetryCount:0,loadTimeout:1e4,maxReaderInterval:5e3,preloadTime:5,defaultVodLoadSize:1e7,isLive:!1,softDecode:!1,bufferBehind:10,maxJumpDistance:3,analyzeDuration:2e4,seamlesslyReload:!1,keepStatusAfterSwitch:!0,onlyVideo:!1,onlyAudio:!1,preferMMS:!1,mseLowLatency:!0,durationForMSELowLatencyOff:6,chunkCountForSpeed:50,skipChunkSize:1e3,longtimeNoReceived:3e3,enableStartGapJump:!0},e);return t.isLive&&t.preloadTime&&(t.maxLatency||(t.maxLatency=2*t.preloadTime),t.targetLatency||(t.targetLatency=t.preloadTime),null!==t.disconnectTime&&void 0!==t.disconnectTime||(t.disconnectTime=t.maxLatency)),t}function searchKeyframeIndex(e,t){var r=0,n=e.length-1,o=0,i=0,a=n;for(t<e[0]&&(r=0,i=a+1);i<=a;){if((o=i+Math.floor((a-i)/2))===n||t>=e[o]&&t<e[o+1]){r=o;break}e[o]<t?i=o+1:a=o-1}return r}var logger=new Logger$2("flv"),MAX_HOLE=.1,MAX_START_GAP=.3,Flv=function(e){_inherits$3(l,EventEmitter);var t,r,n,o,i,a,s,c=_createSuper$2(l);function l(e){var t;return _classCallCheck$4(this,l),_defineProperty$3(_assertThisInitialized$3(t=c.call(this)),"media",null),_defineProperty$3(_assertThisInitialized$3(t),"_loading",!1),_defineProperty$3(_assertThisInitialized$3(t),"_opts",null),_defineProperty$3(_assertThisInitialized$3(t),"_bufferService",null),_defineProperty$3(_assertThisInitialized$3(t),"_gapService",null),_defineProperty$3(_assertThisInitialized$3(t),"_stats",null),_defineProperty$3(_assertThisInitialized$3(t),"_mediaLoader",null),_defineProperty$3(_assertThisInitialized$3(t),"_maxChunkWaitTimer",null),_defineProperty$3(_assertThisInitialized$3(t),"_tickTimer",null),_defineProperty$3(_assertThisInitialized$3(t),"_tickInterval",500),_defineProperty$3(_assertThisInitialized$3(t),"_urlSwitching",!1),_defineProperty$3(_assertThisInitialized$3(t),"_seamlessSwitching",!1),_defineProperty$3(_assertThisInitialized$3(t),"_disconnectRetryCount",0),_defineProperty$3(_assertThisInitialized$3(t),"_preLoadEndPoint",0),_defineProperty$3(_assertThisInitialized$3(t),"_keyframes",null),_defineProperty$3(_assertThisInitialized$3(t),"_acceptRanges",!0),_defineProperty$3(_assertThisInitialized$3(t),"_onProgress",function(){var e=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(r,n,o,i){var a,s,c,l,u,p,$,f,d,y;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=o.startTime,s=o.endTime,c=o.st,l=o.firstByteTime,t._loading=!n,t._firstProgressEmit){e.next=13;break}if(t.media){e.next=6;break}return null===(u=t._mediaLoader)||void 0===u||u.cancel(),e.abrupt("return");case 6:p=i.headers,$=c?l-c:s-a,t.emit(EVENT.TTFB,{url:t._opts.url,responseUrl:i.url,elapsed:$}),t.emit(EVENT.LOAD_RESPONSE_HEADERS,{headers:p}),t._transferCost.set(TRANSFER_EVENT.TTFB,$),t._acceptRanges=!(null==p||!p.get("Accept-Ranges"))||!(null==p||!p.get("Content-Range")),t._firstProgressEmit=!0;case 13:if(t._bufferService){e.next=15;break}return e.abrupt("return");case 15:return clearTimeout(t._maxChunkWaitTimer),t._bandwidthService.addChunkRecord(null==r?void 0:r.byteLength,s-a),e.prev=17,e.next=20,t._bufferService.appendBuffer(r);case 20:null===(f=t._bufferService)||void 0===f||f.evictBuffer(t._opts.bufferBehind),e.next=33;break;case 23:if(e.prev=23,e.t0=e.catch(17),t.isLive||!t._bufferService.isFull()){e.next=32;break}return e.next=28,t._mediaLoader.cancel();case 28:return t._loading=!1,d=t.bufferInfo().remaining,t._opts.preloadTime=_parseInt$1(d)/2,e.abrupt("return");case 32:return e.abrupt("return",t._emitError(StreamingError.create(e.t0)));case 33:if(t._urlSwitching&&(t._urlSwitching=!1,t.emit(EVENT.SWITCH_URL_SUCCESS,{url:t._opts.url})),t._seamlessSwitching&&(t._seamlessSwitching=!1,t._tick()),!n||t.media.seeking){e.next=40;break}return t.emit(EVENT.LOAD_COMPLETE),logger.debug("load done"),t.isLive&&t._disconnectRetryCount<=0&&t._end(),e.abrupt("return");case 40:if(t.isLive){e.next=42;break}return e.abrupt("return");case 42:(y=t._opts.maxReaderInterval)&&t._firstProgressEmit&&(clearTimeout(t._maxChunkWaitTimer),t._maxChunkWaitTimer=_setTimeout((function(){if(t._disconnectRetryCount)return t._disconnectRetryCount--,void t.load();logger.debug("onMaxChunkWait",y),t._end()}),y));case 44:case"end":return e.stop()}}),e,null,[[17,23]])})));return function(t,r,n,o){return e.apply(this,arguments)}}()),_defineProperty$3(_assertThisInitialized$3(t),"_onRetryError",(function(e,r){logger.debug("load retry",e,r),t.emit(EVENT.LOAD_RETRY,{error:StreamingError.network(e),retryTime:r})})),_defineProperty$3(_assertThisInitialized$3(t),"_end",(function(){t._clear(),t._bufferService&&t._bufferService.endOfStream(),logger.debug("end stream")})),_defineProperty$3(_assertThisInitialized$3(t),"_resetDisconnectCount",(function(){t._disconnectRetryCount=t._opts.disconnectRetryCount})),_defineProperty$3(_assertThisInitialized$3(t),"_tick",(function(){clearTimeout(t._tickTimer);var e=_assertThisInitialized$3(t).media;if(e){t._tickTimer=_setTimeout(t._tick,t._tickInterval);var r=Buffer$1.end(Buffer$1.get(e));if(!(r<MAX_HOLE)&&e.readyState){var n=t._opts;if(isMediaPlaying(e)&&e.currentTime)t._gapService&&t._gapService.do(e,n.maxJumpDistance,t.isLive,3);else{if(!e.currentTime&&t._gapService&&n.enableStartGapJump)return void((t._opts.mseLowLatency||!1===t._opts.mseLowLatency&&t.bufferInfo(MAX_START_GAP).nextStart)&&t._gapService.do(e,n.maxJumpDistance,t.isLive,3));n.isLive&&4===e.readyState&&r-e.currentTime>n.disconnectTime&&t.disconnect()}}}})),_defineProperty$3(_assertThisInitialized$3(t),"_onPlay",(function(){var e,r,n=t._opts.softDecode||(null===(e=t.media)||void 0===e||null===(r=e.buffered)||void 0===r?void 0:r.length);if(t.isLive)!t._loading&&n&&t.replay(void 0,!0);else{var o=t.bufferInfo();(o.start||o.nextStart)>MAX_HOLE&&t._tick()}})),_defineProperty$3(_assertThisInitialized$3(t),"_onLoadeddata",(function(){t.isLive&&!t._opts.mseLowLatency&&t.media.duration!==1/0&&t._bufferService.updateDuration(1/0).catch((function(e){}))})),_defineProperty$3(_assertThisInitialized$3(t),"_onSeeking",_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(){return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:!t.isLive&&t.seekable&&(t._preLoadEndPoint=-1,t._checkPreload());case 1:case"end":return e.stop()}}),e)})))),_defineProperty$3(_assertThisInitialized$3(t),"_onTimeupdate",(function(){if(t.media){var e=t._opts,r=t.media.currentTime;if(e.isLive&&e.maxLatency&&e.targetLatency){var n=Buffer$1.end(Buffer$1.get(t.media));n-r>=e.maxLatency&&(t.media.currentTime=n-e.targetLatency,t.emit(EVENT.CHASEFRAME,{currentTime:t.media.currentTime,latency:e.targetLatency}))}t._seiService.throw(r,!0),e.isLive||!t.seekable||t._loading||t._checkPreload()}})),_defineProperty$3(_assertThisInitialized$3(t),"_onWaiting",(function(){t.isLive&&!t._loading&&t._disconnectRetryCount&&(t._disconnectRetryCount--,t.load())})),_defineProperty$3(_assertThisInitialized$3(t),"_onBufferUpdate",(function(){if(!t._opts.isLive){var e=t.bufferInfo(),r=e.end,n=e.nextEnd;Math.abs((r||n)-t.media.duration)<1&&(t._end(),t.media.readyState<=2&&t._tick())}})),_defineProperty$3(_assertThisInitialized$3(t),"_checkPreload",_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(){var r,n,o,i,a,s,c,l,u,p;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.bufferInfo(),n=r.remaining,o=void 0===n?0:n,i=t._opts,a=t._keyframes.filepositions,s=t._keyframes.times,c=t.media.currentTime,!(o<i.preloadTime)){e.next=19;break}if(l=searchKeyframeIndex(t._keyframes.times,c+o+MAX_HOLE),(u=searchKeyframeIndex(t._keyframes.times,c+o+t._opts.preloadTime))===l&&(u=l+1),t._preLoadEndPoint!==u){e.next=11;break}return e.abrupt("return");case 11:if(null!=(p=a[l])){e.next=14;break}return e.abrupt("return");case 14:return e.next=16,t._mediaLoader.cancel();case 16:t._loadData(null,[p,a[u]]),t._preLoadEndPoint=u,t._bufferService.unContiguous(s[l]);case 19:case"end":return e.stop()}}),e)})))),_defineProperty$3(_assertThisInitialized$3(t),"_onFlvScriptData",(function(e){var r,n,o,i,a=null===(r=e.data)||void 0===r||null===(n=r.onMetaData)||void 0===n?void 0:n.keyframes,s=null===(o=e.data)||void 0===o||null===(i=o.onMetaData)||void 0===i?void 0:i.duration;a&&(t._keyframes=a),!t._opts.isLive&&s&&t._bufferService.updateDuration(s)})),t._opts=getOption(e),t.media=t._opts.media||document.createElement("video"),t._opts.media=null,t._firstProgressEmit=!1,t._mediaLoader=new NetLoader(_objectSpread2$2(_objectSpread2$2({},t._opts.fetchOptions),{},{retry:t._opts.retryCount,retryDelay:t._opts.retryDelay,timeout:t._opts.loadTimeout,onRetryError:t._onRetryError,onProgress:t._onProgress,responseType:"arraybuffer"})),t._disconnectRetryCount=t._opts.disconnectRetryCount,t._transferCost=new TransferCost,t._bufferService=new BufferService(_assertThisInitialized$3(t),t._opts.softDecode?t.media:void 0,t._opts),t._seiService=new SeiService(_assertThisInitialized$3(t)),t._bandwidthService=new BandwidthService({chunkCountForSpeed:t._opts.chunkCountForSpeed,skipChunkSize:t._opts.skipChunkSize,longtimeNoReceived:t._opts.longtimeNoReceived}),t._stats=new MediaStatsService(_assertThisInitialized$3(t)),t._opts.softDecode||(t._gapService=new GapService),t.media.addEventListener("play",t._onPlay),t.media.addEventListener("loadeddata",t._onLoadeddata),t.media.addEventListener("seeking",t._onSeeking),t.media.addEventListener("timeupdate",t._onTimeupdate),t.media.addEventListener("progress",t._onBufferUpdate),t.media.addEventListener("waiting",t._onWaiting),t.on(EVENT.FLV_SCRIPT_DATA,t._onFlvScriptData),t}return _createClass$4(l,[{key:"version",get:function(){return"3.0.23-rc.6"}},{key:"isLive",get:function(){return this._opts.isLive}},{key:"baseDts",get:function(){var e;return null===(e=this._bufferService)||void 0===e?void 0:e.baseDts}},{key:"seekable",get:function(){return!!this._keyframes&&this._acceptRanges}},{key:"loader",get:function(){return this._mediaLoader}},{key:"blobUrl",get:function(){var e;return null===(e=this._bufferService)||void 0===e?void 0:e.blobUrl}},{key:"speedInfo",value:function(){return{speed:this._bandwidthService.getLatestSpeed(),avgSpeed:this._bandwidthService.getAvgSpeed(),totalSize:this._bandwidthService.getTotalSize(),totalCost:this._bandwidthService.getTotalCost()}}},{key:"getStats",value:function(){return this._stats.getStats()}},{key:"bufferInfo",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:MAX_HOLE;return Buffer$1.info(Buffer$1.get(this.media),null===(e=this.media)||void 0===e?void 0:e.currentTime,t)}},{key:"playbackQuality",value:function(){return getVideoPlaybackQuality(this.media)}},{key:"load",value:(s=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t){var r,n,o=arguments;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=o.length>1&&void 0!==o[1]&&o[1],n=o.length>2?o[2]:void 0,this._bufferService){e.next=4;break}return e.abrupt("return");case 4:return e.next=6,this._reset(r);case 6:this._loadData(t,this._opts.isLive?[]:[0,this._opts.defaultVodLoadSize],n),clearTimeout(this._tickTimer),this._tickTimer=_setTimeout(this._tick,this._tickInterval);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"replay",value:(a=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(){var t,r,n=this,o=arguments;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:this._opts.seamlesslyReload,r=o.length>1?o[1]:void 0,this.media){e.next=4;break}return e.abrupt("return");case 4:if(this._resetDisconnectCount(),!t){e.next=11;break}return e.next=8,this._clear();case 8:_setTimeout((function(){n._seamlessSwitching=!0,n._loadData(n._opts.url),n._bufferService.seamlessSwitch()})),e.next=13;break;case 11:return e.next=13,this.load();case 13:return e.abrupt("return",this.media.play(!r).catch((function(){})));case 14:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"disconnect",value:function(){var e;return logger.debug("disconnect!"),null===(e=this._bufferService)||void 0===e||e.resetSeamlessSwitchStats(),this._clear()}},{key:"switchURL",value:(i=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t,r){var n=this;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._bufferService){e.next=2;break}return e.abrupt("return");case 2:if(this._resetDisconnectCount(),!this._loading||!r){e.next=6;break}return this._bufferService.seamlessLoadingSwitch=function(){var e=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(r){return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n._clear();case 2:n._bufferService.seamlessLoadingSwitching=!0,n._urlSwitching=!0,n._seamlessSwitching=!0,n._bufferService.seamlessSwitch(),n._loadData(t);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.abrupt("return");case 6:if(r&&this._opts.isLive){e.next=11;break}return e.next=9,this.load(t);case 9:return this._urlSwitching=!0,e.abrupt("return",this.media.play(!0).catch((function(){})));case 11:return e.next=13,this._clear();case 13:_setTimeout((function(){n._urlSwitching=!0,n._seamlessSwitching=!0,n._loadData(t),n._bufferService.seamlessSwitch()}));case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"destroy",value:(o=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(){return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.media){e.next=2;break}return e.abrupt("return");case 2:return this.removeAllListeners(),this._seiService.reset(),this.media.removeEventListener("play",this._onPlay),this.media.removeEventListener("loadeddata",this._onLoadeddata),this.media.removeEventListener("seeking",this._onSeeking),this.media.removeEventListener("timeupdate",this._onTimeupdate),this.media.removeEventListener("waiting",this._onWaiting),this.media.removeEventListener("progress",this._onBufferUpdate),e.next=12,_Promise.all([this._clear(),this._bufferService.destroy()]);case 12:this.media=null,this._bufferService=null;case 14:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"_emitError",value:function(e){var t,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];logger.table(e),logger.error(e),logger.error(null===(t=this.media)||void 0===t?void 0:t.error),this._urlSwitching&&(this._urlSwitching=!1,this._seamlessSwitching=!1,this.emit(EVENT.SWITCH_URL_FAILED,e)),this.emit(EVENT.ERROR,e),r&&(this._seiService.reset(),this._end())}},{key:"_reset",value:(n=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(){var t,r=arguments;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]&&r[0],this._seiService.reset(),this._bandwidthService.reset(),this._stats.reset(),e.next=6,this._clear();case 6:return e.next=8,this._bufferService.reset(t);case 8:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"_loadData",value:(r=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t,r,n){var o;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&(this._opts.url=t),o=t=this._opts.url,t){e.next=4;break}throw new Error("Source url is missing");case 4:if(this._opts.preProcessUrl&&(o=this._opts.preProcessUrl(t).url),this._mediaLoader.finnalUrl=o,this.emit(EVENT.LOAD_START,{url:o,seamlessSwitching:this._seamlessSwitching}),logger.debug("load data, loading:",this._loading,o),!this._loading){e.next=11;break}return e.next=11,this._mediaLoader.cancel();case 11:return this._loading=!0,e.prev=12,e.next=15,this._mediaLoader.load({url:o,range:r,streamRes:n,firstMaxChunkSize:this._opts.firstMaxChunkSize});case 15:e.next=21;break;case 17:return e.prev=17,e.t0=e.catch(12),this._loading=!1,e.abrupt("return",this._emitError(StreamingError.network(e.t0),!1));case 21:case"end":return e.stop()}}),e,this,[[12,17]])}))),function(e,t,n){return r.apply(this,arguments)})},{key:"_clear",value:(t=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(){return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._mediaLoader){e.next=3;break}return e.next=3,this._mediaLoader.cancel();case 3:clearTimeout(this._maxChunkWaitTimer),clearTimeout(this._tickTimer),this._loading=!1,this._firstProgressEmit=!1;case 7:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}],[{key:"isSupported",value:function(e){return e&&"video"!==e&&"audio"!==e?"undefined"!=typeof WebAssembly:MSE.isSupported()}},{key:"enableLogger",value:function(){Logger$2.enable(),Logger$1.enable()}},{key:"disableLogger",value:function(){Logger$2.disable(),Logger$1.disable()}}]),l}();try{localStorage.getItem("xgd")?Flv.enableLogger():Flv.disableLogger()}catch(e){}var PluginExtension=function(){function e(t,r){var n=this;_classCallCheck$4(this,e),_defineProperty$3(this,"_onLowDecode",(function(){var e,t,r,o,i=n._opts,a=i.media,s=i.innerDegrade,c=i.backupURL;null===(e=n._plugin)||void 0===e||null===(t=e.player)||void 0===t||t.emit("lowdecode",a.degradeInfo),null===(r=n._plugin)||void 0===r||null===(o=r.player)||void 0===o||o.emit("core_event",_objectSpread2$2(_objectSpread2$2({},a.degradeInfo),{},{eventName:EVENT.LOWDECODE})),1!==s&&3!==s||!c||n._degrade(c)})),_defineProperty$3(this,"_degrade",(function(e){var t=n._plugin.player,r=t.video;if("MVideo"===(null==r?void 0:r.TAG)){var o=t.video.degradeVideo;t.video=o,r.degrade(e),e&&(t.config.url=e);var i=t.root.firstChild;"MVideo"===i.TAG&&t.root.replaceChild(o,i);var a=n._plugin.constructor.pluginName.toLowerCase();t.unRegisterPlugin(a),t.once("canplay",(function(){t.play()}))}})),_defineProperty$3(this,"forceDegradeToVideo",(function(e){var t=n._opts.innerDegrade;1!==t&&3!==t||n._degrade(e)})),this._opts=t,this._plugin=r,this._init()}return _createClass$4(e,[{key:"_init",value:function(){var e=this._opts,t=e.media,r=e.isLive,n=e.preloadTime,o=e.innerDegrade,i=e.decodeMode;t&&(r||!t.setPlayMode?(o&&t.setAttribute("innerdegrade",o),n&&t.setAttribute("preloadtime",n),t.setDecodeMode&&t.setDecodeMode(i),this._bindEvents()):t.setPlayMode("VOD"))}},{key:"_bindEvents",value:function(){this._opts.media.addEventListener("lowdecode",this._onLowDecode)}},{key:"destroy",value:function(){var e,t;null===(e=this._opts)||void 0===e||null===(t=e.media)||void 0===t||t.removeEventListener("lowdecode",this._onLowDecode),this._plugin=null}}]),e}(),FlvPlugin$1=function(e){_inherits$3(r,BasePlugin);var t=_createSuper$2(r);function r(){var e,n;_classCallCheck$4(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return _defineProperty$3(_assertThisInitialized$3(n=t.call.apply(t,_concatInstanceProperty(e=[this]).call(e,i))),"logger",logger),_defineProperty$3(_assertThisInitialized$3(n),"flv",null),_defineProperty$3(_assertThisInitialized$3(n),"pluginExtension",null),_defineProperty$3(_assertThisInitialized$3(n),"getStats",(function(){var e;return null===(e=n.flv)||void 0===e?void 0:e.getStats()})),_defineProperty$3(_assertThisInitialized$3(n),"loadSource",(function(){var e;arguments.length>0&&void 0!==arguments[0]||n.player.config.url;var t=arguments.length>1?arguments[1]:void 0;null===(e=n.flv)||void 0===e||e.load(n.player.config.url,!0,t)})),_defineProperty$3(_assertThisInitialized$3(n),"destroy",(function(){var e;n.flv&&(n.flv.destroy(),n.flv=null),null===(e=n.pluginExtension)||void 0===e||e.destroy(),n.pluginExtension=null})),_defineProperty$3(_assertThisInitialized$3(n),"_onSwitchURL",(function(e,t){var r,o;n.flv&&(n.player.config.url=e,"object"===_typeof$2(t)&&(t=t.seamless),n.flv.switchURL(e,t),!t&&null!==(r=n.player.config)&&void 0!==r&&null!==(o=r.flv)&&void 0!==o&&o.keepStatusAfterSwitch&&n._keepPauseStatus())})),_defineProperty$3(_assertThisInitialized$3(n),"_keepPauseStatus",(function(){n.player.paused&&n.player.once("canplay",(function(){n.player.pause()}))})),_defineProperty$3(_assertThisInitialized$3(n),"_onDefinitionChange",(function(e){var t=e.to;n.flv&&n.flv.switchURL(t)})),n}return _createClass$4(r,[{key:"core",get:function(){return this.flv}},{key:"version",get:function(){var e;return null===(e=this.flv)||void 0===e?void 0:e.version}},{key:"softDecode",get:function(){var e,t,r=null===(e=this.player)||void 0===e||null===(t=e.config)||void 0===t?void 0:t.mediaType;return!!r&&"video"!==r&&"audio"!==r&&"offscreen-video"!==r}},{key:"loader",get:function(){var e;return null===(e=this.flv)||void 0===e?void 0:e.loader}},{key:"transferCost",get:function(){return this.flv._transferCost.transferCost}},{key:"beforePlayerInit",value:function(){var e=this,t=this.player.config,r=this.player.media||this.player.video;if(t.url){this.flv&&this.flv.destroy(),this.player.switchURL=this._onSwitchURL;var n,o=t.flv||{};if(null!==o.disconnectTime&&void 0!==o.disconnectTime||(o.disconnectTime=0),this.flv=new Flv(_objectSpread2$2({softDecode:this.softDecode,isLive:t.isLive,media:r,preProcessUrl:function(t,r){var n,o;return(null===(n=e.player)||void 0===n||null===(o=n.preProcessUrl)||void 0===o?void 0:o.call(n,t,r))||{url:t,ext:r}}},o)),this.softDecode||BasePlugin.defineGetterOrSetter(this.player,{url:{get:function(){var t;return null===(t=e.flv)||void 0===t?void 0:t.blobUrl},configurable:!0}}),this.softDecode&&(this.pluginExtension=new PluginExtension(_objectSpread2$2({media:this.player.video,isLive:t.isLive},t.flv),this),this.player.forceDegradeToVideo=function(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return null===(t=e.pluginExtension)||void 0===t?void 0:t.forceDegradeToVideo.apply(t,n)}),t.isLive)null===(n=this.player)||void 0===n||n.useHooks("replay",(function(){var t;return null===(t=e.flv)||void 0===t?void 0:t.replay()}));this.on(URL_CHANGE,this._onSwitchURL),this.on(DESTROY,this.destroy),this._transError(),this._transCoreEvent(EVENT.TTFB),this._transCoreEvent(EVENT.LOAD_START),this._transCoreEvent(EVENT.LOAD_RESPONSE_HEADERS),this._transCoreEvent(EVENT.LOAD_COMPLETE),this._transCoreEvent(EVENT.LOAD_RETRY),this._transCoreEvent(EVENT.SOURCEBUFFER_CREATED),this._transCoreEvent(EVENT.ANALYZE_DURATION_EXCEEDED),this._transCoreEvent(EVENT.APPEND_BUFFER),this._transCoreEvent(EVENT.REMOVE_BUFFER),this._transCoreEvent(EVENT.BUFFEREOS),this._transCoreEvent(EVENT.KEYFRAME),this._transCoreEvent(EVENT.CHASEFRAME),this._transCoreEvent(EVENT.METADATA_PARSED),this._transCoreEvent(EVENT.SEI),this._transCoreEvent(EVENT.SEI_IN_TIME),this._transCoreEvent(EVENT.FLV_SCRIPT_DATA),this._transCoreEvent(EVENT.STREAM_EXCEPTION),this._transCoreEvent(EVENT.SWITCH_URL_SUCCESS),this._transCoreEvent(EVENT.SWITCH_URL_FAILED),o.manualLoad||this.loadSource(t.url,o.streamRes)}}},{key:"_transError",value:function(){var e=this;this.flv.on(EVENT.ERROR,(function(t){e.player&&e.player.emit(ERROR,new Errors(e.player,t))}))}},{key:"_transCoreEvent",value:function(e){var t=this;this.flv.on(e,(function(r){t.player&&t.player.emit("core_event",_objectSpread2$2(_objectSpread2$2({},r),{},{eventName:e}))}))}}],[{key:"pluginName",get:function(){return"flv"}},{key:"isSupported",value:function(e,t){return Flv.isSupported(e,t)}},{key:"isSupportedMMS",value:function(){return"undefined"!=typeof ManagedMediaSource}}]),r}();function _callSuper(e,t,r){return t=_getPrototypeOf(t),_possibleConstructorReturn(e,_isNativeReflectConstruct()?_Reflect$construct(t,r||[],_getPrototypeOf(e).constructor):t.apply(e,r))}function _isNativeReflectConstruct(){try{var e=!Boolean.prototype.valueOf.call(_Reflect$construct(Boolean,[],(function(){})))}catch(e){}return(_isNativeReflectConstruct=function(){return!!e})()}function _toPrimitive(e,t){if("object"!=_typeof$3(e)||!e)return e;var r=e[_Symbol$toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=_typeof$3(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==_typeof$3(t)?t:String(t)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),_Object$defineProperty(e,_toPropertyKey(n.key),n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),_Object$defineProperty(e,"prototype",{writable:!1}),e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=_Object$create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),_Object$defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _getPrototypeOf(e){var t;return(_getPrototypeOf=_Object$setPrototypeOf?_bindInstanceProperty(t=_Object$getPrototypeOf).call(t):function(e){return e.__proto__||_Object$getPrototypeOf(e)})(e)}function _setPrototypeOf(e,t){var r;return(_setPrototypeOf=_Object$setPrototypeOf?_bindInstanceProperty(r=_Object$setPrototypeOf).call(r):function(e,t){return e.__proto__=t,e})(e,t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof$3(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}_defineProperty$3(FlvPlugin$1,"Flv",Flv);var Adaptive=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,BasePlugin),_createClass(t,[{key:"afterCreate",value:function(){var e;this.on("timeupdate",_bindInstanceProperty(e=this.onTimeUpdate).call(e,this))}},{key:"onTimeUpdate",value:function(){var e=this.bufferLength;this.speed===this.config.hurrySpeed?e<=this.config.hurryEndMs&&(this.speed=1):1===this.speed&&e>=this.config.hurryStartMs&&(this.speed=this.config.hurrySpeed)}},{key:"bufferLength",get:function(){var e=this.player.getBufferedRange(),t=this.player.video.currentTime,r=e[1]-Math.max(e[0],t);return r=Math.round(1e3*Math.max(0,r))}},{key:"speed",get:function(){return this.player.playbackRate},set:function(e){this.speed!==e&&(this.player.playbackRate=e)}}],[{key:"pluginName",get:function(){return"adaptive"}},{key:"defaultConfig",get:function(){return{hurryEndMs:1800,hurryStartMs:2500,hurrySpeed:1.1}}}]),t}(),FlvPlugin=function(e){_inherits$4(r,FlvPlugin$1);var t=_createSuper$3(r);function r(){var e,n;_classCallCheck$5(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return _defineProperty$4(_assertThisInitialized$4(n=t.call.apply(t,_concatInstanceProperty(e=[this]).call(e,i))),"_originSwitchURL",void 0),n}return _createClass$5(r,[{key:"beforePlayerInit",value:function(){var e=this;this._originSwitchURL=this.player.switchURL;var t=this.destroy;this.destroy=function(){e.player.switchURL=e._originSwitchURL,t()},_get$1(_getPrototypeOf$4(r.prototype),"beforePlayerInit",this).call(this)}}]),r}(),__PLUGIN_NAME__=DynamicModule.PluginFlv;export{Adaptive,FlvPlugin,__PLUGIN_NAME__};
|
|
2
2
|
//# sourceMappingURL=esm/veplayer.plugin.flv.production.js.map
|